function e(e, t) {
  for (var n = 0; n < t.length; n++) {
    const i = t[n];
    if ("string" != typeof i && !Array.isArray(i))
      for (const t in i)
        if ("default" !== t && !(t in e)) {
          const n = Object.getOwnPropertyDescriptor(i, t);
          n && Object.defineProperty(e, t, n.get ? n : { enumerable: !0, get: () => i[t] });
        }
  }
  return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
}
!(function () {
  const e = document.createElement("link").relList;
  if (!(e && e.supports && e.supports("modulepreload"))) {
    for (const e of document.querySelectorAll('link[rel="modulepreload"]')) t(e);
    new MutationObserver((e) => {
      for (const n of e)
        if ("childList" === n.type)
          for (const e of n.addedNodes) "LINK" === e.tagName && "modulepreload" === e.rel && t(e);
    }).observe(document, { childList: !0, subtree: !0 });
  }
  function t(e) {
    if (e.ep) return;
    e.ep = !0;
    const t = (function (e) {
      const t = {};
      return (
        e.integrity && (t.integrity = e.integrity),
        e.referrerPolicy && (t.referrerPolicy = e.referrerPolicy),
        "use-credentials" === e.crossOrigin
          ? (t.credentials = "include")
          : "anonymous" === e.crossOrigin
            ? (t.credentials = "omit")
            : (t.credentials = "same-origin"),
        t
      );
    })(e);
    fetch(e.href, t);
  }
})();
var t =
  "undefined" != typeof globalThis
    ? globalThis
    : "undefined" != typeof window
      ? window
      : "undefined" != typeof global
        ? global
        : "undefined" != typeof self
          ? self
          : {};
function n(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function i(e) {
  if (e.__esModule) return e;
  var t = e.default;
  if ("function" == typeof t) {
    var n = function e() {
      return this instanceof e
        ? Reflect.construct(t, arguments, this.constructor)
        : t.apply(this, arguments);
    };
    n.prototype = t.prototype;
  } else n = {};
  return (
    Object.defineProperty(n, "__esModule", { value: !0 }),
    Object.keys(e).forEach(function (t) {
      var i = Object.getOwnPropertyDescriptor(e, t);
      Object.defineProperty(
        n,
        t,
        i.get
          ? i
          : {
              enumerable: !0,
              get: function () {
                return e[t];
              },
            },
      );
    }),
    n
  );
}
var r = { exports: {} },
  o = {},
  s = { exports: {} },
  a = {},
  l = Symbol.for("react.element"),
  c = Symbol.for("react.portal"),
  d = Symbol.for("react.fragment"),
  u = Symbol.for("react.strict_mode"),
  h = Symbol.for("react.profiler"),
  g = Symbol.for("react.provider"),
  p = Symbol.for("react.context"),
  f = Symbol.for("react.forward_ref"),
  m = Symbol.for("react.suspense"),
  _ = Symbol.for("react.memo"),
  v = Symbol.for("react.lazy"),
  b = Symbol.iterator;
var y = {
    isMounted: function () {
      return !1;
    },
    enqueueForceUpdate: function () {},
    enqueueReplaceState: function () {},
    enqueueSetState: function () {},
  },
  x = Object.assign,
  w = {};
function C(e, t, n) {
  ((this.props = e), (this.context = t), (this.refs = w), (this.updater = n || y));
}
function S() {}
function k(e, t, n) {
  ((this.props = e), (this.context = t), (this.refs = w), (this.updater = n || y));
}
((C.prototype.isReactComponent = {}),
  (C.prototype.setState = function (e, t) {
    if ("object" != typeof e && "function" != typeof e && null != e)
      throw Error(
        "setState(...): takes an object of state variables to update or a function which returns an object of state variables.",
      );
    this.updater.enqueueSetState(this, e, t, "setState");
  }),
  (C.prototype.forceUpdate = function (e) {
    this.updater.enqueueForceUpdate(this, e, "forceUpdate");
  }),
  (S.prototype = C.prototype));
var E = (k.prototype = new S());
((E.constructor = k), x(E, C.prototype), (E.isPureReactComponent = !0));
var N = Array.isArray,
  L = Object.prototype.hasOwnProperty,
  D = { current: null },
  T = { key: !0, ref: !0, __self: !0, __source: !0 };
function I(e, t, n) {
  var i,
    r = {},
    o = null,
    s = null;
  if (null != t)
    for (i in (void 0 !== t.ref && (s = t.ref), void 0 !== t.key && (o = "" + t.key), t))
      L.call(t, i) && !T.hasOwnProperty(i) && (r[i] = t[i]);
  var a = arguments.length - 2;
  if (1 === a) r.children = n;
  else if (1 < a) {
    for (var c = Array(a), d = 0; d < a; d++) c[d] = arguments[d + 2];
    r.children = c;
  }
  if (e && e.defaultProps) for (i in (a = e.defaultProps)) void 0 === r[i] && (r[i] = a[i]);
  return { $$typeof: l, type: e, key: o, ref: s, props: r, _owner: D.current };
}
function R(e) {
  return "object" == typeof e && null !== e && e.$$typeof === l;
}
var O = /\/+/g;
function M(e, t) {
  return "object" == typeof e && null !== e && null != e.key
    ? (function (e) {
        var t = { "=": "=0", ":": "=2" };
        return (
          "$" +
          e.replace(/[=:]/g, function (e) {
            return t[e];
          })
        );
      })("" + e.key)
    : t.toString(36);
}
function A(e, t, n, i, r) {
  var o = typeof e;
  ("undefined" !== o && "boolean" !== o) || (e = null);
  var s = !1;
  if (null === e) s = !0;
  else
    switch (o) {
      case "string":
      case "number":
        s = !0;
        break;
      case "object":
        switch (e.$$typeof) {
          case l:
          case c:
            s = !0;
        }
    }
  if (s)
    return (
      (r = r((s = e))),
      (e = "" === i ? "." + M(s, 0) : i),
      N(r)
        ? ((n = ""),
          null != e && (n = e.replace(O, "$&/") + "/"),
          A(r, t, n, "", function (e) {
            return e;
          }))
        : null != r &&
          (R(r) &&
            (r = (function (e, t) {
              return {
                $$typeof: l,
                type: e.type,
                key: t,
                ref: e.ref,
                props: e.props,
                _owner: e._owner,
              };
            })(
              r,
              n +
                (!r.key || (s && s.key === r.key) ? "" : ("" + r.key).replace(O, "$&/") + "/") +
                e,
            )),
          t.push(r)),
      1
    );
  if (((s = 0), (i = "" === i ? "." : i + ":"), N(e)))
    for (var a = 0; a < e.length; a++) {
      var d = i + M((o = e[a]), a);
      s += A(o, t, n, d, r);
    }
  else if (
    ((d = (function (e) {
      return null === e || "object" != typeof e
        ? null
        : "function" == typeof (e = (b && e[b]) || e["@@iterator"])
          ? e
          : null;
    })(e)),
    "function" == typeof d)
  )
    for (e = d.call(e), a = 0; !(o = e.next()).done; )
      s += A((o = o.value), t, n, (d = i + M(o, a++)), r);
  else if ("object" === o)
    throw (
      (t = String(e)),
      Error(
        "Objects are not valid as a React child (found: " +
          ("[object Object]" === t ? "object with keys {" + Object.keys(e).join(", ") + "}" : t) +
          "). If you meant to render a collection of children, use an array instead.",
      )
    );
  return s;
}
function P(e, t, n) {
  if (null == e) return e;
  var i = [],
    r = 0;
  return (
    A(e, i, "", "", function (e) {
      return t.call(n, e, r++);
    }),
    i
  );
}
function j(e) {
  if (-1 === e._status) {
    var t = e._result;
    ((t = t()).then(
      function (t) {
        (0 !== e._status && -1 !== e._status) || ((e._status = 1), (e._result = t));
      },
      function (t) {
        (0 !== e._status && -1 !== e._status) || ((e._status = 2), (e._result = t));
      },
    ),
      -1 === e._status && ((e._status = 0), (e._result = t)));
  }
  if (1 === e._status) return e._result.default;
  throw e._result;
}
var F = { current: null },
  B = { transition: null },
  V = { ReactCurrentDispatcher: F, ReactCurrentBatchConfig: B, ReactCurrentOwner: D };
function W() {
  throw Error("act(...) is not supported in production builds of React.");
}
((a.Children = {
  map: P,
  forEach: function (e, t, n) {
    P(
      e,
      function () {
        t.apply(this, arguments);
      },
      n,
    );
  },
  count: function (e) {
    var t = 0;
    return (
      P(e, function () {
        t++;
      }),
      t
    );
  },
  toArray: function (e) {
    return (
      P(e, function (e) {
        return e;
      }) || []
    );
  },
  only: function (e) {
    if (!R(e)) throw Error("React.Children.only expected to receive a single React element child.");
    return e;
  },
}),
  (a.Component = C),
  (a.Fragment = d),
  (a.Profiler = h),
  (a.PureComponent = k),
  (a.StrictMode = u),
  (a.Suspense = m),
  (a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = V),
  (a.act = W),
  (a.cloneElement = function (e, t, n) {
    if (null == e)
      throw Error(
        "React.cloneElement(...): The argument must be a React element, but you passed " + e + ".",
      );
    var i = x({}, e.props),
      r = e.key,
      o = e.ref,
      s = e._owner;
    if (null != t) {
      if (
        (void 0 !== t.ref && ((o = t.ref), (s = D.current)),
        void 0 !== t.key && (r = "" + t.key),
        e.type && e.type.defaultProps)
      )
        var a = e.type.defaultProps;
      for (c in t)
        L.call(t, c) &&
          !T.hasOwnProperty(c) &&
          (i[c] = void 0 === t[c] && void 0 !== a ? a[c] : t[c]);
    }
    var c = arguments.length - 2;
    if (1 === c) i.children = n;
    else if (1 < c) {
      a = Array(c);
      for (var d = 0; d < c; d++) a[d] = arguments[d + 2];
      i.children = a;
    }
    return { $$typeof: l, type: e.type, key: r, ref: o, props: i, _owner: s };
  }),
  (a.createContext = function (e) {
    return (
      ((e = {
        $$typeof: p,
        _currentValue: e,
        _currentValue2: e,
        _threadCount: 0,
        Provider: null,
        Consumer: null,
        _defaultValue: null,
        _globalName: null,
      }).Provider = { $$typeof: g, _context: e }),
      (e.Consumer = e)
    );
  }),
  (a.createElement = I),
  (a.createFactory = function (e) {
    var t = I.bind(null, e);
    return ((t.type = e), t);
  }),
  (a.createRef = function () {
    return { current: null };
  }),
  (a.forwardRef = function (e) {
    return { $$typeof: f, render: e };
  }),
  (a.isValidElement = R),
  (a.lazy = function (e) {
    return { $$typeof: v, _payload: { _status: -1, _result: e }, _init: j };
  }),
  (a.memo = function (e, t) {
    return { $$typeof: _, type: e, compare: void 0 === t ? null : t };
  }),
  (a.startTransition = function (e) {
    var t = B.transition;
    B.transition = {};
    try {
      e();
    } finally {
      B.transition = t;
    }
  }),
  (a.unstable_act = W),
  (a.useCallback = function (e, t) {
    return F.current.useCallback(e, t);
  }),
  (a.useContext = function (e) {
    return F.current.useContext(e);
  }),
  (a.useDebugValue = function () {}),
  (a.useDeferredValue = function (e) {
    return F.current.useDeferredValue(e);
  }),
  (a.useEffect = function (e, t) {
    return F.current.useEffect(e, t);
  }),
  (a.useId = function () {
    return F.current.useId();
  }),
  (a.useImperativeHandle = function (e, t, n) {
    return F.current.useImperativeHandle(e, t, n);
  }),
  (a.useInsertionEffect = function (e, t) {
    return F.current.useInsertionEffect(e, t);
  }),
  (a.useLayoutEffect = function (e, t) {
    return F.current.useLayoutEffect(e, t);
  }),
  (a.useMemo = function (e, t) {
    return F.current.useMemo(e, t);
  }),
  (a.useReducer = function (e, t, n) {
    return F.current.useReducer(e, t, n);
  }),
  (a.useRef = function (e) {
    return F.current.useRef(e);
  }),
  (a.useState = function (e) {
    return F.current.useState(e);
  }),
  (a.useSyncExternalStore = function (e, t, n) {
    return F.current.useSyncExternalStore(e, t, n);
  }),
  (a.useTransition = function () {
    return F.current.useTransition();
  }),
  (a.version = "18.3.1"),
  (s.exports = a));
var H = s.exports;
const z = n(H),
  U = e({ __proto__: null, default: z }, [H]);
/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var $ = H,
  q = Symbol.for("react.element"),
  K = Symbol.for("react.fragment"),
  G = Object.prototype.hasOwnProperty,
  Z = $.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
  Y = { key: !0, ref: !0, __self: !0, __source: !0 };
function X(e, t, n) {
  var i,
    r = {},
    o = null,
    s = null;
  for (i in (void 0 !== n && (o = "" + n),
  void 0 !== t.key && (o = "" + t.key),
  void 0 !== t.ref && (s = t.ref),
  t))
    G.call(t, i) && !Y.hasOwnProperty(i) && (r[i] = t[i]);
  if (e && e.defaultProps) for (i in (t = e.defaultProps)) void 0 === r[i] && (r[i] = t[i]);
  return { $$typeof: q, type: e, key: o, ref: s, props: r, _owner: Z.current };
}
((o.Fragment = K), (o.jsx = X), (o.jsxs = X), (r.exports = o));
var Q = r.exports,
  J = {},
  ee = { exports: {} },
  te = {},
  ne = { exports: {} },
  ie = {};
/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
(!(function (e) {
  function t(e, t) {
    var n = e.length;
    e.push(t);
    e: for (; 0 < n; ) {
      var i = (n - 1) >>> 1,
        o = e[i];
      if (!(0 < r(o, t))) break e;
      ((e[i] = t), (e[n] = o), (n = i));
    }
  }
  function n(e) {
    return 0 === e.length ? null : e[0];
  }
  function i(e) {
    if (0 === e.length) return null;
    var t = e[0],
      n = e.pop();
    if (n !== t) {
      e[0] = n;
      e: for (var i = 0, o = e.length, s = o >>> 1; i < s; ) {
        var a = 2 * (i + 1) - 1,
          l = e[a],
          c = a + 1,
          d = e[c];
        if (0 > r(l, n))
          c < o && 0 > r(d, l)
            ? ((e[i] = d), (e[c] = n), (i = c))
            : ((e[i] = l), (e[a] = n), (i = a));
        else {
          if (!(c < o && 0 > r(d, n))) break e;
          ((e[i] = d), (e[c] = n), (i = c));
        }
      }
    }
    return t;
  }
  function r(e, t) {
    var n = e.sortIndex - t.sortIndex;
    return 0 !== n ? n : e.id - t.id;
  }
  if ("object" == typeof performance && "function" == typeof performance.now) {
    var o = performance;
    e.unstable_now = function () {
      return o.now();
    };
  } else {
    var s = Date,
      a = s.now();
    e.unstable_now = function () {
      return s.now() - a;
    };
  }
  var l = [],
    c = [],
    d = 1,
    u = null,
    h = 3,
    g = !1,
    p = !1,
    f = !1,
    m = "function" == typeof setTimeout ? setTimeout : null,
    _ = "function" == typeof clearTimeout ? clearTimeout : null,
    v = "undefined" != typeof setImmediate ? setImmediate : null;
  function b(e) {
    for (var r = n(c); null !== r; ) {
      if (null === r.callback) i(c);
      else {
        if (!(r.startTime <= e)) break;
        (i(c), (r.sortIndex = r.expirationTime), t(l, r));
      }
      r = n(c);
    }
  }
  function y(e) {
    if (((f = !1), b(e), !p))
      if (null !== n(l)) ((p = !0), R(x));
      else {
        var t = n(c);
        null !== t && O(y, t.startTime - e);
      }
  }
  function x(t, r) {
    ((p = !1), f && ((f = !1), _(k), (k = -1)), (g = !0));
    var o = h;
    try {
      for (b(r), u = n(l); null !== u && (!(u.expirationTime > r) || (t && !L())); ) {
        var s = u.callback;
        if ("function" == typeof s) {
          ((u.callback = null), (h = u.priorityLevel));
          var a = s(u.expirationTime <= r);
          ((r = e.unstable_now()),
            "function" == typeof a ? (u.callback = a) : u === n(l) && i(l),
            b(r));
        } else i(l);
        u = n(l);
      }
      if (null !== u) var d = !0;
      else {
        var m = n(c);
        (null !== m && O(y, m.startTime - r), (d = !1));
      }
      return d;
    } finally {
      ((u = null), (h = o), (g = !1));
    }
  }
  "undefined" != typeof navigator &&
    void 0 !== navigator.scheduling &&
    void 0 !== navigator.scheduling.isInputPending &&
    navigator.scheduling.isInputPending.bind(navigator.scheduling);
  var w,
    C = !1,
    S = null,
    k = -1,
    E = 5,
    N = -1;
  function L() {
    return !(e.unstable_now() - N < E);
  }
  function D() {
    if (null !== S) {
      var t = e.unstable_now();
      N = t;
      var n = !0;
      try {
        n = S(!0, t);
      } finally {
        n ? w() : ((C = !1), (S = null));
      }
    } else C = !1;
  }
  if ("function" == typeof v)
    w = function () {
      v(D);
    };
  else if ("undefined" != typeof MessageChannel) {
    var T = new MessageChannel(),
      I = T.port2;
    ((T.port1.onmessage = D),
      (w = function () {
        I.postMessage(null);
      }));
  } else
    w = function () {
      m(D, 0);
    };
  function R(e) {
    ((S = e), C || ((C = !0), w()));
  }
  function O(t, n) {
    k = m(function () {
      t(e.unstable_now());
    }, n);
  }
  ((e.unstable_IdlePriority = 5),
    (e.unstable_ImmediatePriority = 1),
    (e.unstable_LowPriority = 4),
    (e.unstable_NormalPriority = 3),
    (e.unstable_Profiling = null),
    (e.unstable_UserBlockingPriority = 2),
    (e.unstable_cancelCallback = function (e) {
      e.callback = null;
    }),
    (e.unstable_continueExecution = function () {
      p || g || ((p = !0), R(x));
    }),
    (e.unstable_forceFrameRate = function (e) {
      0 > e || 125 < e || (E = 0 < e ? Math.floor(1e3 / e) : 5);
    }),
    (e.unstable_getCurrentPriorityLevel = function () {
      return h;
    }),
    (e.unstable_getFirstCallbackNode = function () {
      return n(l);
    }),
    (e.unstable_next = function (e) {
      switch (h) {
        case 1:
        case 2:
        case 3:
          var t = 3;
          break;
        default:
          t = h;
      }
      var n = h;
      h = t;
      try {
        return e();
      } finally {
        h = n;
      }
    }),
    (e.unstable_pauseExecution = function () {}),
    (e.unstable_requestPaint = function () {}),
    (e.unstable_runWithPriority = function (e, t) {
      switch (e) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
          break;
        default:
          e = 3;
      }
      var n = h;
      h = e;
      try {
        return t();
      } finally {
        h = n;
      }
    }),
    (e.unstable_scheduleCallback = function (i, r, o) {
      var s = e.unstable_now();
      switch (
        ("object" == typeof o && null !== o
          ? (o = "number" == typeof (o = o.delay) && 0 < o ? s + o : s)
          : (o = s),
        i)
      ) {
        case 1:
          var a = -1;
          break;
        case 2:
          a = 250;
          break;
        case 5:
          a = 1073741823;
          break;
        case 4:
          a = 1e4;
          break;
        default:
          a = 5e3;
      }
      return (
        (i = {
          id: d++,
          callback: r,
          priorityLevel: i,
          startTime: o,
          expirationTime: (a = o + a),
          sortIndex: -1,
        }),
        o > s
          ? ((i.sortIndex = o),
            t(c, i),
            null === n(l) && i === n(c) && (f ? (_(k), (k = -1)) : (f = !0), O(y, o - s)))
          : ((i.sortIndex = a), t(l, i), p || g || ((p = !0), R(x))),
        i
      );
    }),
    (e.unstable_shouldYield = L),
    (e.unstable_wrapCallback = function (e) {
      var t = h;
      return function () {
        var n = h;
        h = t;
        try {
          return e.apply(this, arguments);
        } finally {
          h = n;
        }
      };
    }));
})(ie),
  (ne.exports = ie));
var re = ne.exports,
  oe = H,
  se = re;
/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */ function ae(e) {
  for (
    var t = "https://reactjs.org/docs/error-decoder.html?invariant=" + e, n = 1;
    n < arguments.length;
    n++
  )
    t += "&args[]=" + encodeURIComponent(arguments[n]);
  return (
    "Minified React error #" +
    e +
    "; visit " +
    t +
    " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
  );
}
var le = new Set(),
  ce = {};
function de(e, t) {
  (ue(e, t), ue(e + "Capture", t));
}
function ue(e, t) {
  for (ce[e] = t, e = 0; e < t.length; e++) le.add(t[e]);
}
var he = !(
    "undefined" == typeof window ||
    void 0 === window.document ||
    void 0 === window.document.createElement
  ),
  ge = Object.prototype.hasOwnProperty,
  pe =
    /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
  fe = {},
  me = {};
function _e(e, t, n, i, r, o, s) {
  ((this.acceptsBooleans = 2 === t || 3 === t || 4 === t),
    (this.attributeName = i),
    (this.attributeNamespace = r),
    (this.mustUseProperty = n),
    (this.propertyName = e),
    (this.type = t),
    (this.sanitizeURL = o),
    (this.removeEmptyString = s));
}
var ve = {};
("children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style"
  .split(" ")
  .forEach(function (e) {
    ve[e] = new _e(e, 0, !1, e, null, !1, !1);
  }),
  [
    ["acceptCharset", "accept-charset"],
    ["className", "class"],
    ["htmlFor", "for"],
    ["httpEquiv", "http-equiv"],
  ].forEach(function (e) {
    var t = e[0];
    ve[t] = new _e(t, 1, !1, e[1], null, !1, !1);
  }),
  ["contentEditable", "draggable", "spellCheck", "value"].forEach(function (e) {
    ve[e] = new _e(e, 2, !1, e.toLowerCase(), null, !1, !1);
  }),
  ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function (e) {
    ve[e] = new _e(e, 2, !1, e, null, !1, !1);
  }),
  "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope"
    .split(" ")
    .forEach(function (e) {
      ve[e] = new _e(e, 3, !1, e.toLowerCase(), null, !1, !1);
    }),
  ["checked", "multiple", "muted", "selected"].forEach(function (e) {
    ve[e] = new _e(e, 3, !0, e, null, !1, !1);
  }),
  ["capture", "download"].forEach(function (e) {
    ve[e] = new _e(e, 4, !1, e, null, !1, !1);
  }),
  ["cols", "rows", "size", "span"].forEach(function (e) {
    ve[e] = new _e(e, 6, !1, e, null, !1, !1);
  }),
  ["rowSpan", "start"].forEach(function (e) {
    ve[e] = new _e(e, 5, !1, e.toLowerCase(), null, !1, !1);
  }));
var be = /[\-:]([a-z])/g;
function ye(e) {
  return e[1].toUpperCase();
}
function xe(e, t, n, i) {
  var r = ve.hasOwnProperty(t) ? ve[t] : null;
  (null !== r
    ? 0 !== r.type
    : i || !(2 < t.length) || ("o" !== t[0] && "O" !== t[0]) || ("n" !== t[1] && "N" !== t[1])) &&
    ((function (e, t, n, i) {
      if (
        null == t ||
        (function (e, t, n, i) {
          if (null !== n && 0 === n.type) return !1;
          switch (typeof t) {
            case "function":
            case "symbol":
              return !0;
            case "boolean":
              return (
                !i &&
                (null !== n
                  ? !n.acceptsBooleans
                  : "data-" !== (e = e.toLowerCase().slice(0, 5)) && "aria-" !== e)
              );
            default:
              return !1;
          }
        })(e, t, n, i)
      )
        return !0;
      if (i) return !1;
      if (null !== n)
        switch (n.type) {
          case 3:
            return !t;
          case 4:
            return !1 === t;
          case 5:
            return isNaN(t);
          case 6:
            return isNaN(t) || 1 > t;
        }
      return !1;
    })(t, n, r, i) && (n = null),
    i || null === r
      ? (function (e) {
          return (
            !!ge.call(me, e) ||
            (!ge.call(fe, e) && (pe.test(e) ? (me[e] = !0) : ((fe[e] = !0), !1)))
          );
        })(t) && (null === n ? e.removeAttribute(t) : e.setAttribute(t, "" + n))
      : r.mustUseProperty
        ? (e[r.propertyName] = null === n ? 3 !== r.type && "" : n)
        : ((t = r.attributeName),
          (i = r.attributeNamespace),
          null === n
            ? e.removeAttribute(t)
            : ((n = 3 === (r = r.type) || (4 === r && !0 === n) ? "" : "" + n),
              i ? e.setAttributeNS(i, t, n) : e.setAttribute(t, n))));
}
("accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height"
  .split(" ")
  .forEach(function (e) {
    var t = e.replace(be, ye);
    ve[t] = new _e(t, 1, !1, e, null, !1, !1);
  }),
  "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type"
    .split(" ")
    .forEach(function (e) {
      var t = e.replace(be, ye);
      ve[t] = new _e(t, 1, !1, e, "http://www.w3.org/1999/xlink", !1, !1);
    }),
  ["xml:base", "xml:lang", "xml:space"].forEach(function (e) {
    var t = e.replace(be, ye);
    ve[t] = new _e(t, 1, !1, e, "http://www.w3.org/XML/1998/namespace", !1, !1);
  }),
  ["tabIndex", "crossOrigin"].forEach(function (e) {
    ve[e] = new _e(e, 1, !1, e.toLowerCase(), null, !1, !1);
  }),
  (ve.xlinkHref = new _e("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1)),
  ["src", "href", "action", "formAction"].forEach(function (e) {
    ve[e] = new _e(e, 1, !1, e.toLowerCase(), null, !0, !0);
  }));
var we = oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
  Ce = Symbol.for("react.element"),
  Se = Symbol.for("react.portal"),
  ke = Symbol.for("react.fragment"),
  Ee = Symbol.for("react.strict_mode"),
  Ne = Symbol.for("react.profiler"),
  Le = Symbol.for("react.provider"),
  De = Symbol.for("react.context"),
  Te = Symbol.for("react.forward_ref"),
  Ie = Symbol.for("react.suspense"),
  Re = Symbol.for("react.suspense_list"),
  Oe = Symbol.for("react.memo"),
  Me = Symbol.for("react.lazy"),
  Ae = Symbol.for("react.offscreen"),
  Pe = Symbol.iterator;
function je(e) {
  return null === e || "object" != typeof e
    ? null
    : "function" == typeof (e = (Pe && e[Pe]) || e["@@iterator"])
      ? e
      : null;
}
var Fe,
  Be = Object.assign;
function Ve(e) {
  if (void 0 === Fe)
    try {
      throw Error();
    } catch (kmt) {
      var t = kmt.stack.trim().match(/\n( *(at )?)/);
      Fe = (t && t[1]) || "";
    }
  return "\n" + Fe + e;
}
var We = !1;
function He(e, t) {
  if (!e || We) return "";
  We = !0;
  var n = Error.prepareStackTrace;
  Error.prepareStackTrace = void 0;
  try {
    if (t)
      if (
        ((t = function () {
          throw Error();
        }),
        Object.defineProperty(t.prototype, "props", {
          set: function () {
            throw Error();
          },
        }),
        "object" == typeof Reflect && Reflect.construct)
      ) {
        try {
          Reflect.construct(t, []);
        } catch (upt) {
          var i = upt;
        }
        Reflect.construct(e, [], t);
      } else {
        try {
          t.call();
        } catch (upt) {
          i = upt;
        }
        e.call(t.prototype);
      }
    else {
      try {
        throw Error();
      } catch (upt) {
        i = upt;
      }
      e();
    }
  } catch (upt) {
    if (upt && i && "string" == typeof upt.stack) {
      for (
        var r = upt.stack.split("\n"), o = i.stack.split("\n"), s = r.length - 1, a = o.length - 1;
        1 <= s && 0 <= a && r[s] !== o[a];
      )
        a--;
      for (; 1 <= s && 0 <= a; s--, a--)
        if (r[s] !== o[a]) {
          if (1 !== s || 1 !== a)
            do {
              if ((s--, 0 > --a || r[s] !== o[a])) {
                var l = "\n" + r[s].replace(" at new ", " at ");
                return (
                  e.displayName &&
                    l.includes("<anonymous>") &&
                    (l = l.replace("<anonymous>", e.displayName)),
                  l
                );
              }
            } while (1 <= s && 0 <= a);
          break;
        }
    }
  } finally {
    ((We = !1), (Error.prepareStackTrace = n));
  }
  return (e = e ? e.displayName || e.name : "") ? Ve(e) : "";
}
function ze(e) {
  switch (e.tag) {
    case 5:
      return Ve(e.type);
    case 16:
      return Ve("Lazy");
    case 13:
      return Ve("Suspense");
    case 19:
      return Ve("SuspenseList");
    case 0:
    case 2:
    case 15:
      return (e = He(e.type, !1));
    case 11:
      return (e = He(e.type.render, !1));
    case 1:
      return (e = He(e.type, !0));
    default:
      return "";
  }
}
function Ue(e) {
  if (null == e) return null;
  if ("function" == typeof e) return e.displayName || e.name || null;
  if ("string" == typeof e) return e;
  switch (e) {
    case ke:
      return "Fragment";
    case Se:
      return "Portal";
    case Ne:
      return "Profiler";
    case Ee:
      return "StrictMode";
    case Ie:
      return "Suspense";
    case Re:
      return "SuspenseList";
  }
  if ("object" == typeof e)
    switch (e.$$typeof) {
      case De:
        return (e.displayName || "Context") + ".Consumer";
      case Le:
        return (e._context.displayName || "Context") + ".Provider";
      case Te:
        var t = e.render;
        return (
          (e = e.displayName) ||
            (e =
              "" !== (e = t.displayName || t.name || "") ? "ForwardRef(" + e + ")" : "ForwardRef"),
          e
        );
      case Oe:
        return null !== (t = e.displayName || null) ? t : Ue(e.type) || "Memo";
      case Me:
        ((t = e._payload), (e = e._init));
        try {
          return Ue(e(t));
        } catch (kmt) {}
    }
  return null;
}
function $e(e) {
  var t = e.type;
  switch (e.tag) {
    case 24:
      return "Cache";
    case 9:
      return (t.displayName || "Context") + ".Consumer";
    case 10:
      return (t._context.displayName || "Context") + ".Provider";
    case 18:
      return "DehydratedFragment";
    case 11:
      return (
        (e = (e = t.render).displayName || e.name || ""),
        t.displayName || ("" !== e ? "ForwardRef(" + e + ")" : "ForwardRef")
      );
    case 7:
      return "Fragment";
    case 5:
      return t;
    case 4:
      return "Portal";
    case 3:
      return "Root";
    case 6:
      return "Text";
    case 16:
      return Ue(t);
    case 8:
      return t === Ee ? "StrictMode" : "Mode";
    case 22:
      return "Offscreen";
    case 12:
      return "Profiler";
    case 21:
      return "Scope";
    case 13:
      return "Suspense";
    case 19:
      return "SuspenseList";
    case 25:
      return "TracingMarker";
    case 1:
    case 0:
    case 17:
    case 2:
    case 14:
    case 15:
      if ("function" == typeof t) return t.displayName || t.name || null;
      if ("string" == typeof t) return t;
  }
  return null;
}
function qe(e) {
  switch (typeof e) {
    case "boolean":
    case "number":
    case "string":
    case "undefined":
    case "object":
      return e;
    default:
      return "";
  }
}
function Ke(e) {
  var t = e.type;
  return (e = e.nodeName) && "input" === e.toLowerCase() && ("checkbox" === t || "radio" === t);
}
function Ge(e) {
  e._valueTracker ||
    (e._valueTracker = (function (e) {
      var t = Ke(e) ? "checked" : "value",
        n = Object.getOwnPropertyDescriptor(e.constructor.prototype, t),
        i = "" + e[t];
      if (
        !e.hasOwnProperty(t) &&
        void 0 !== n &&
        "function" == typeof n.get &&
        "function" == typeof n.set
      ) {
        var r = n.get,
          o = n.set;
        return (
          Object.defineProperty(e, t, {
            configurable: !0,
            get: function () {
              return r.call(this);
            },
            set: function (e) {
              ((i = "" + e), o.call(this, e));
            },
          }),
          Object.defineProperty(e, t, { enumerable: n.enumerable }),
          {
            getValue: function () {
              return i;
            },
            setValue: function (e) {
              i = "" + e;
            },
            stopTracking: function () {
              ((e._valueTracker = null), delete e[t]);
            },
          }
        );
      }
    })(e));
}
function Ze(e) {
  if (!e) return !1;
  var t = e._valueTracker;
  if (!t) return !0;
  var n = t.getValue(),
    i = "";
  return (
    e && (i = Ke(e) ? (e.checked ? "true" : "false") : e.value),
    (e = i) !== n && (t.setValue(e), !0)
  );
}
function Ye(e) {
  if (void 0 === (e = e || ("undefined" != typeof document ? document : void 0))) return null;
  try {
    return e.activeElement || e.body;
  } catch (ipt) {
    return e.body;
  }
}
function Xe(e, t) {
  var n = t.checked;
  return Be({}, t, {
    defaultChecked: void 0,
    defaultValue: void 0,
    value: void 0,
    checked: null != n ? n : e._wrapperState.initialChecked,
  });
}
function Qe(e, t) {
  var n = null == t.defaultValue ? "" : t.defaultValue,
    i = null != t.checked ? t.checked : t.defaultChecked;
  ((n = qe(null != t.value ? t.value : n)),
    (e._wrapperState = {
      initialChecked: i,
      initialValue: n,
      controlled: "checkbox" === t.type || "radio" === t.type ? null != t.checked : null != t.value,
    }));
}
function Je(e, t) {
  null != (t = t.checked) && xe(e, "checked", t, !1);
}
function et(e, t) {
  Je(e, t);
  var n = qe(t.value),
    i = t.type;
  if (null != n)
    "number" === i
      ? ((0 === n && "" === e.value) || e.value != n) && (e.value = "" + n)
      : e.value !== "" + n && (e.value = "" + n);
  else if ("submit" === i || "reset" === i) return void e.removeAttribute("value");
  (t.hasOwnProperty("value")
    ? nt(e, t.type, n)
    : t.hasOwnProperty("defaultValue") && nt(e, t.type, qe(t.defaultValue)),
    null == t.checked && null != t.defaultChecked && (e.defaultChecked = !!t.defaultChecked));
}
function tt(e, t, n) {
  if (t.hasOwnProperty("value") || t.hasOwnProperty("defaultValue")) {
    var i = t.type;
    if (!(("submit" !== i && "reset" !== i) || (void 0 !== t.value && null !== t.value))) return;
    ((t = "" + e._wrapperState.initialValue),
      n || t === e.value || (e.value = t),
      (e.defaultValue = t));
  }
  ("" !== (n = e.name) && (e.name = ""),
    (e.defaultChecked = !!e._wrapperState.initialChecked),
    "" !== n && (e.name = n));
}
function nt(e, t, n) {
  ("number" === t && Ye(e.ownerDocument) === e) ||
    (null == n
      ? (e.defaultValue = "" + e._wrapperState.initialValue)
      : e.defaultValue !== "" + n && (e.defaultValue = "" + n));
}
var it = Array.isArray;
function rt(e, t, n, i) {
  if (((e = e.options), t)) {
    t = {};
    for (var r = 0; r < n.length; r++) t["$" + n[r]] = !0;
    for (n = 0; n < e.length; n++)
      ((r = t.hasOwnProperty("$" + e[n].value)),
        e[n].selected !== r && (e[n].selected = r),
        r && i && (e[n].defaultSelected = !0));
  } else {
    for (n = "" + qe(n), t = null, r = 0; r < e.length; r++) {
      if (e[r].value === n) return ((e[r].selected = !0), void (i && (e[r].defaultSelected = !0)));
      null !== t || e[r].disabled || (t = e[r]);
    }
    null !== t && (t.selected = !0);
  }
}
function ot(e, t) {
  if (null != t.dangerouslySetInnerHTML) throw Error(ae(91));
  return Be({}, t, {
    value: void 0,
    defaultValue: void 0,
    children: "" + e._wrapperState.initialValue,
  });
}
function st(e, t) {
  var n = t.value;
  if (null == n) {
    if (((n = t.children), (t = t.defaultValue), null != n)) {
      if (null != t) throw Error(ae(92));
      if (it(n)) {
        if (1 < n.length) throw Error(ae(93));
        n = n[0];
      }
      t = n;
    }
    (null == t && (t = ""), (n = t));
  }
  e._wrapperState = { initialValue: qe(n) };
}
function at(e, t) {
  var n = qe(t.value),
    i = qe(t.defaultValue);
  (null != n &&
    ((n = "" + n) !== e.value && (e.value = n),
    null == t.defaultValue && e.defaultValue !== n && (e.defaultValue = n)),
    null != i && (e.defaultValue = "" + i));
}
function lt(e) {
  var t = e.textContent;
  t === e._wrapperState.initialValue && "" !== t && null !== t && (e.value = t);
}
function ct(e) {
  switch (e) {
    case "svg":
      return "http://www.w3.org/2000/svg";
    case "math":
      return "http://www.w3.org/1998/Math/MathML";
    default:
      return "http://www.w3.org/1999/xhtml";
  }
}
function dt(e, t) {
  return null == e || "http://www.w3.org/1999/xhtml" === e
    ? ct(t)
    : "http://www.w3.org/2000/svg" === e && "foreignObject" === t
      ? "http://www.w3.org/1999/xhtml"
      : e;
}
var ut,
  ht = (function (e) {
    return "undefined" != typeof MSApp && MSApp.execUnsafeLocalFunction
      ? function (t, n, i, r) {
          MSApp.execUnsafeLocalFunction(function () {
            return e(t, n);
          });
        }
      : e;
  })(function (e, t) {
    if ("http://www.w3.org/2000/svg" !== e.namespaceURI || "innerHTML" in e) e.innerHTML = t;
    else {
      for (
        (ut = ut || document.createElement("div")).innerHTML =
          "<svg>" + t.valueOf().toString() + "</svg>",
          t = ut.firstChild;
        e.firstChild;
      )
        e.removeChild(e.firstChild);
      for (; t.firstChild; ) e.appendChild(t.firstChild);
    }
  });
function gt(e, t) {
  if (t) {
    var n = e.firstChild;
    if (n && n === e.lastChild && 3 === n.nodeType) return void (n.nodeValue = t);
  }
  e.textContent = t;
}
var pt = {
    animationIterationCount: !0,
    aspectRatio: !0,
    borderImageOutset: !0,
    borderImageSlice: !0,
    borderImageWidth: !0,
    boxFlex: !0,
    boxFlexGroup: !0,
    boxOrdinalGroup: !0,
    columnCount: !0,
    columns: !0,
    flex: !0,
    flexGrow: !0,
    flexPositive: !0,
    flexShrink: !0,
    flexNegative: !0,
    flexOrder: !0,
    gridArea: !0,
    gridRow: !0,
    gridRowEnd: !0,
    gridRowSpan: !0,
    gridRowStart: !0,
    gridColumn: !0,
    gridColumnEnd: !0,
    gridColumnSpan: !0,
    gridColumnStart: !0,
    fontWeight: !0,
    lineClamp: !0,
    lineHeight: !0,
    opacity: !0,
    order: !0,
    orphans: !0,
    tabSize: !0,
    widows: !0,
    zIndex: !0,
    zoom: !0,
    fillOpacity: !0,
    floodOpacity: !0,
    stopOpacity: !0,
    strokeDasharray: !0,
    strokeDashoffset: !0,
    strokeMiterlimit: !0,
    strokeOpacity: !0,
    strokeWidth: !0,
  },
  ft = ["Webkit", "ms", "Moz", "O"];
function mt(e, t, n) {
  return null == t || "boolean" == typeof t || "" === t
    ? ""
    : n || "number" != typeof t || 0 === t || (pt.hasOwnProperty(e) && pt[e])
      ? ("" + t).trim()
      : t + "px";
}
function _t(e, t) {
  for (var n in ((e = e.style), t))
    if (t.hasOwnProperty(n)) {
      var i = 0 === n.indexOf("--"),
        r = mt(n, t[n], i);
      ("float" === n && (n = "cssFloat"), i ? e.setProperty(n, r) : (e[n] = r));
    }
}
Object.keys(pt).forEach(function (e) {
  ft.forEach(function (t) {
    ((t = t + e.charAt(0).toUpperCase() + e.substring(1)), (pt[t] = pt[e]));
  });
});
var vt = Be(
  { menuitem: !0 },
  {
    area: !0,
    base: !0,
    br: !0,
    col: !0,
    embed: !0,
    hr: !0,
    img: !0,
    input: !0,
    keygen: !0,
    link: !0,
    meta: !0,
    param: !0,
    source: !0,
    track: !0,
    wbr: !0,
  },
);
function bt(e, t) {
  if (t) {
    if (vt[e] && (null != t.children || null != t.dangerouslySetInnerHTML)) throw Error(ae(137, e));
    if (null != t.dangerouslySetInnerHTML) {
      if (null != t.children) throw Error(ae(60));
      if ("object" != typeof t.dangerouslySetInnerHTML || !("__html" in t.dangerouslySetInnerHTML))
        throw Error(ae(61));
    }
    if (null != t.style && "object" != typeof t.style) throw Error(ae(62));
  }
}
function yt(e, t) {
  if (-1 === e.indexOf("-")) return "string" == typeof t.is;
  switch (e) {
    case "annotation-xml":
    case "color-profile":
    case "font-face":
    case "font-face-src":
    case "font-face-uri":
    case "font-face-format":
    case "font-face-name":
    case "missing-glyph":
      return !1;
    default:
      return !0;
  }
}
var xt = null;
function wt(e) {
  return (
    (e = e.target || e.srcElement || window).correspondingUseElement &&
      (e = e.correspondingUseElement),
    3 === e.nodeType ? e.parentNode : e
  );
}
var Ct = null,
  St = null,
  kt = null;
function Et(e) {
  if ((e = xo(e))) {
    if ("function" != typeof Ct) throw Error(ae(280));
    var t = e.stateNode;
    t && ((t = Co(t)), Ct(e.stateNode, e.type, t));
  }
}
function Nt(e) {
  St ? (kt ? kt.push(e) : (kt = [e])) : (St = e);
}
function Lt() {
  if (St) {
    var e = St,
      t = kt;
    if (((kt = St = null), Et(e), t)) for (e = 0; e < t.length; e++) Et(t[e]);
  }
}
function Dt(e, t) {
  return e(t);
}
function Tt() {}
var It = !1;
function Rt(e, t, n) {
  if (It) return e(t, n);
  It = !0;
  try {
    return Dt(e, t, n);
  } finally {
    ((It = !1), (null !== St || null !== kt) && (Tt(), Lt()));
  }
}
function Ot(e, t) {
  var n = e.stateNode;
  if (null === n) return null;
  var i = Co(n);
  if (null === i) return null;
  n = i[t];
  e: switch (t) {
    case "onClick":
    case "onClickCapture":
    case "onDoubleClick":
    case "onDoubleClickCapture":
    case "onMouseDown":
    case "onMouseDownCapture":
    case "onMouseMove":
    case "onMouseMoveCapture":
    case "onMouseUp":
    case "onMouseUpCapture":
    case "onMouseEnter":
      ((i = !i.disabled) ||
        (i = !("button" === (e = e.type) || "input" === e || "select" === e || "textarea" === e)),
        (e = !i));
      break e;
    default:
      e = !1;
  }
  if (e) return null;
  if (n && "function" != typeof n) throw Error(ae(231, t, typeof n));
  return n;
}
var Mt = !1;
if (he)
  try {
    var At = {};
    (Object.defineProperty(At, "passive", {
      get: function () {
        Mt = !0;
      },
    }),
      window.addEventListener("test", At, At),
      window.removeEventListener("test", At, At));
  } catch (Lmt) {
    Mt = !1;
  }
function Pt(e, t, n, i, r, o, s, a, l) {
  var c = Array.prototype.slice.call(arguments, 3);
  try {
    t.apply(n, c);
  } catch (hpt) {
    this.onError(hpt);
  }
}
var jt = !1,
  Ft = null,
  Bt = !1,
  Vt = null,
  Wt = {
    onError: function (e) {
      ((jt = !0), (Ft = e));
    },
  };
function Ht(e, t, n, i, r, o, s, a, l) {
  ((jt = !1), (Ft = null), Pt.apply(Wt, arguments));
}
function zt(e) {
  var t = e,
    n = e;
  if (e.alternate) for (; t.return; ) t = t.return;
  else {
    e = t;
    do {
      (!!(4098 & (t = e).flags) && (n = t.return), (e = t.return));
    } while (e);
  }
  return 3 === t.tag ? n : null;
}
function Ut(e) {
  if (13 === e.tag) {
    var t = e.memoizedState;
    if ((null === t && null !== (e = e.alternate) && (t = e.memoizedState), null !== t))
      return t.dehydrated;
  }
  return null;
}
function $t(e) {
  if (zt(e) !== e) throw Error(ae(188));
}
function qt(e) {
  return (
    (e = (function (e) {
      var t = e.alternate;
      if (!t) {
        if (null === (t = zt(e))) throw Error(ae(188));
        return t !== e ? null : e;
      }
      for (var n = e, i = t; ; ) {
        var r = n.return;
        if (null === r) break;
        var o = r.alternate;
        if (null === o) {
          if (null !== (i = r.return)) {
            n = i;
            continue;
          }
          break;
        }
        if (r.child === o.child) {
          for (o = r.child; o; ) {
            if (o === n) return ($t(r), e);
            if (o === i) return ($t(r), t);
            o = o.sibling;
          }
          throw Error(ae(188));
        }
        if (n.return !== i.return) ((n = r), (i = o));
        else {
          for (var s = !1, a = r.child; a; ) {
            if (a === n) {
              ((s = !0), (n = r), (i = o));
              break;
            }
            if (a === i) {
              ((s = !0), (i = r), (n = o));
              break;
            }
            a = a.sibling;
          }
          if (!s) {
            for (a = o.child; a; ) {
              if (a === n) {
                ((s = !0), (n = o), (i = r));
                break;
              }
              if (a === i) {
                ((s = !0), (i = o), (n = r));
                break;
              }
              a = a.sibling;
            }
            if (!s) throw Error(ae(189));
          }
        }
        if (n.alternate !== i) throw Error(ae(190));
      }
      if (3 !== n.tag) throw Error(ae(188));
      return n.stateNode.current === n ? e : t;
    })(e)),
    null !== e ? Kt(e) : null
  );
}
function Kt(e) {
  if (5 === e.tag || 6 === e.tag) return e;
  for (e = e.child; null !== e; ) {
    var t = Kt(e);
    if (null !== t) return t;
    e = e.sibling;
  }
  return null;
}
var Gt = se.unstable_scheduleCallback,
  Zt = se.unstable_cancelCallback,
  Yt = se.unstable_shouldYield,
  Xt = se.unstable_requestPaint,
  Qt = se.unstable_now,
  Jt = se.unstable_getCurrentPriorityLevel,
  en = se.unstable_ImmediatePriority,
  tn = se.unstable_UserBlockingPriority,
  nn = se.unstable_NormalPriority,
  rn = se.unstable_LowPriority,
  on = se.unstable_IdlePriority,
  sn = null,
  an = null;
var ln = Math.clz32
    ? Math.clz32
    : function (e) {
        return ((e >>>= 0), 0 === e ? 32 : (31 - ((cn(e) / dn) | 0)) | 0);
      },
  cn = Math.log,
  dn = Math.LN2;
var un = 64,
  hn = 4194304;
function gn(e) {
  switch (e & -e) {
    case 1:
      return 1;
    case 2:
      return 2;
    case 4:
      return 4;
    case 8:
      return 8;
    case 16:
      return 16;
    case 32:
      return 32;
    case 64:
    case 128:
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
      return 4194240 & e;
    case 4194304:
    case 8388608:
    case 16777216:
    case 33554432:
    case 67108864:
      return 130023424 & e;
    case 134217728:
      return 134217728;
    case 268435456:
      return 268435456;
    case 536870912:
      return 536870912;
    case 1073741824:
      return 1073741824;
    default:
      return e;
  }
}
function pn(e, t) {
  var n = e.pendingLanes;
  if (0 === n) return 0;
  var i = 0,
    r = e.suspendedLanes,
    o = e.pingedLanes,
    s = 268435455 & n;
  if (0 !== s) {
    var a = s & ~r;
    0 !== a ? (i = gn(a)) : 0 !== (o &= s) && (i = gn(o));
  } else 0 !== (s = n & ~r) ? (i = gn(s)) : 0 !== o && (i = gn(o));
  if (0 === i) return 0;
  if (
    0 !== t &&
    t !== i &&
    0 === (t & r) &&
    ((r = i & -i) >= (o = t & -t) || (16 === r && 4194240 & o))
  )
    return t;
  if ((4 & i && (i |= 16 & n), 0 !== (t = e.entangledLanes)))
    for (e = e.entanglements, t &= i; 0 < t; )
      ((r = 1 << (n = 31 - ln(t))), (i |= e[n]), (t &= ~r));
  return i;
}
function fn(e, t) {
  switch (e) {
    case 1:
    case 2:
    case 4:
      return t + 250;
    case 8:
    case 16:
    case 32:
    case 64:
    case 128:
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
      return t + 5e3;
    default:
      return -1;
  }
}
function mn(e) {
  return 0 !== (e = -1073741825 & e.pendingLanes) ? e : 1073741824 & e ? 1073741824 : 0;
}
function _n() {
  var e = un;
  return (!(4194240 & (un <<= 1)) && (un = 64), e);
}
function vn(e) {
  for (var t = [], n = 0; 31 > n; n++) t.push(e);
  return t;
}
function bn(e, t, n) {
  ((e.pendingLanes |= t),
    536870912 !== t && ((e.suspendedLanes = 0), (e.pingedLanes = 0)),
    ((e = e.eventTimes)[(t = 31 - ln(t))] = n));
}
function yn(e, t) {
  var n = (e.entangledLanes |= t);
  for (e = e.entanglements; n; ) {
    var i = 31 - ln(n),
      r = 1 << i;
    ((r & t) | (e[i] & t) && (e[i] |= t), (n &= ~r));
  }
}
var xn = 0;
function wn(e) {
  return 1 < (e &= -e) ? (4 < e ? (268435455 & e ? 16 : 536870912) : 4) : 1;
}
var Cn,
  Sn,
  kn,
  En,
  Nn,
  Ln = !1,
  Dn = [],
  Tn = null,
  In = null,
  Rn = null,
  On = new Map(),
  Mn = new Map(),
  An = [],
  Pn =
    "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(
      " ",
    );
function jn(e, t) {
  switch (e) {
    case "focusin":
    case "focusout":
      Tn = null;
      break;
    case "dragenter":
    case "dragleave":
      In = null;
      break;
    case "mouseover":
    case "mouseout":
      Rn = null;
      break;
    case "pointerover":
    case "pointerout":
      On.delete(t.pointerId);
      break;
    case "gotpointercapture":
    case "lostpointercapture":
      Mn.delete(t.pointerId);
  }
}
function Fn(e, t, n, i, r, o) {
  return null === e || e.nativeEvent !== o
    ? ((e = {
        blockedOn: t,
        domEventName: n,
        eventSystemFlags: i,
        nativeEvent: o,
        targetContainers: [r],
      }),
      null !== t && null !== (t = xo(t)) && Sn(t),
      e)
    : ((e.eventSystemFlags |= i),
      (t = e.targetContainers),
      null !== r && -1 === t.indexOf(r) && t.push(r),
      e);
}
function Bn(e) {
  var t = yo(e.target);
  if (null !== t) {
    var n = zt(t);
    if (null !== n)
      if (13 === (t = n.tag)) {
        if (null !== (t = Ut(n)))
          return (
            (e.blockedOn = t),
            void Nn(e.priority, function () {
              kn(n);
            })
          );
      } else if (3 === t && n.stateNode.current.memoizedState.isDehydrated)
        return void (e.blockedOn = 3 === n.tag ? n.stateNode.containerInfo : null);
  }
  e.blockedOn = null;
}
function Vn(e) {
  if (null !== e.blockedOn) return !1;
  for (var t = e.targetContainers; 0 < t.length; ) {
    var n = Xn(e.domEventName, e.eventSystemFlags, t[0], e.nativeEvent);
    if (null !== n) return (null !== (t = xo(n)) && Sn(t), (e.blockedOn = n), !1);
    var i = new (n = e.nativeEvent).constructor(n.type, n);
    ((xt = i), n.target.dispatchEvent(i), (xt = null), t.shift());
  }
  return !0;
}
function Wn(e, t, n) {
  Vn(e) && n.delete(t);
}
function Hn() {
  ((Ln = !1),
    null !== Tn && Vn(Tn) && (Tn = null),
    null !== In && Vn(In) && (In = null),
    null !== Rn && Vn(Rn) && (Rn = null),
    On.forEach(Wn),
    Mn.forEach(Wn));
}
function zn(e, t) {
  e.blockedOn === t &&
    ((e.blockedOn = null),
    Ln || ((Ln = !0), se.unstable_scheduleCallback(se.unstable_NormalPriority, Hn)));
}
function Un(e) {
  function t(t) {
    return zn(t, e);
  }
  if (0 < Dn.length) {
    zn(Dn[0], e);
    for (var n = 1; n < Dn.length; n++) {
      var i = Dn[n];
      i.blockedOn === e && (i.blockedOn = null);
    }
  }
  for (
    null !== Tn && zn(Tn, e),
      null !== In && zn(In, e),
      null !== Rn && zn(Rn, e),
      On.forEach(t),
      Mn.forEach(t),
      n = 0;
    n < An.length;
    n++
  )
    (i = An[n]).blockedOn === e && (i.blockedOn = null);
  for (; 0 < An.length && null === (n = An[0]).blockedOn; )
    (Bn(n), null === n.blockedOn && An.shift());
}
var $n = we.ReactCurrentBatchConfig,
  qn = !0;
function Kn(e, t, n, i) {
  var r = xn,
    o = $n.transition;
  $n.transition = null;
  try {
    ((xn = 1), Zn(e, t, n, i));
  } finally {
    ((xn = r), ($n.transition = o));
  }
}
function Gn(e, t, n, i) {
  var r = xn,
    o = $n.transition;
  $n.transition = null;
  try {
    ((xn = 4), Zn(e, t, n, i));
  } finally {
    ((xn = r), ($n.transition = o));
  }
}
function Zn(e, t, n, i) {
  if (qn) {
    var r = Xn(e, t, n, i);
    if (null === r) ($r(e, t, i, Yn, n), jn(e, i));
    else if (
      (function (e, t, n, i, r) {
        switch (t) {
          case "focusin":
            return ((Tn = Fn(Tn, e, t, n, i, r)), !0);
          case "dragenter":
            return ((In = Fn(In, e, t, n, i, r)), !0);
          case "mouseover":
            return ((Rn = Fn(Rn, e, t, n, i, r)), !0);
          case "pointerover":
            var o = r.pointerId;
            return (On.set(o, Fn(On.get(o) || null, e, t, n, i, r)), !0);
          case "gotpointercapture":
            return ((o = r.pointerId), Mn.set(o, Fn(Mn.get(o) || null, e, t, n, i, r)), !0);
        }
        return !1;
      })(r, e, t, n, i)
    )
      i.stopPropagation();
    else if ((jn(e, i), 4 & t && -1 < Pn.indexOf(e))) {
      for (; null !== r; ) {
        var o = xo(r);
        if ((null !== o && Cn(o), null === (o = Xn(e, t, n, i)) && $r(e, t, i, Yn, n), o === r))
          break;
        r = o;
      }
      null !== r && i.stopPropagation();
    } else $r(e, t, i, null, n);
  }
}
var Yn = null;
function Xn(e, t, n, i) {
  if (((Yn = null), null !== (e = yo((e = wt(i))))))
    if (null === (t = zt(e))) e = null;
    else if (13 === (n = t.tag)) {
      if (null !== (e = Ut(t))) return e;
      e = null;
    } else if (3 === n) {
      if (t.stateNode.current.memoizedState.isDehydrated)
        return 3 === t.tag ? t.stateNode.containerInfo : null;
      e = null;
    } else t !== e && (e = null);
  return ((Yn = e), null);
}
function Qn(e) {
  switch (e) {
    case "cancel":
    case "click":
    case "close":
    case "contextmenu":
    case "copy":
    case "cut":
    case "auxclick":
    case "dblclick":
    case "dragend":
    case "dragstart":
    case "drop":
    case "focusin":
    case "focusout":
    case "input":
    case "invalid":
    case "keydown":
    case "keypress":
    case "keyup":
    case "mousedown":
    case "mouseup":
    case "paste":
    case "pause":
    case "play":
    case "pointercancel":
    case "pointerdown":
    case "pointerup":
    case "ratechange":
    case "reset":
    case "resize":
    case "seeked":
    case "submit":
    case "touchcancel":
    case "touchend":
    case "touchstart":
    case "volumechange":
    case "change":
    case "selectionchange":
    case "textInput":
    case "compositionstart":
    case "compositionend":
    case "compositionupdate":
    case "beforeblur":
    case "afterblur":
    case "beforeinput":
    case "blur":
    case "fullscreenchange":
    case "focus":
    case "hashchange":
    case "popstate":
    case "select":
    case "selectstart":
      return 1;
    case "drag":
    case "dragenter":
    case "dragexit":
    case "dragleave":
    case "dragover":
    case "mousemove":
    case "mouseout":
    case "mouseover":
    case "pointermove":
    case "pointerout":
    case "pointerover":
    case "scroll":
    case "toggle":
    case "touchmove":
    case "wheel":
    case "mouseenter":
    case "mouseleave":
    case "pointerenter":
    case "pointerleave":
      return 4;
    case "message":
      switch (Jt()) {
        case en:
          return 1;
        case tn:
          return 4;
        case nn:
        case rn:
          return 16;
        case on:
          return 536870912;
        default:
          return 16;
      }
    default:
      return 16;
  }
}
var Jn = null,
  ei = null,
  ti = null;
function ni() {
  if (ti) return ti;
  var e,
    t,
    n = ei,
    i = n.length,
    r = "value" in Jn ? Jn.value : Jn.textContent,
    o = r.length;
  for (e = 0; e < i && n[e] === r[e]; e++);
  var s = i - e;
  for (t = 1; t <= s && n[i - t] === r[o - t]; t++);
  return (ti = r.slice(e, 1 < t ? 1 - t : void 0));
}
function ii(e) {
  var t = e.keyCode;
  return (
    "charCode" in e ? 0 === (e = e.charCode) && 13 === t && (e = 13) : (e = t),
    10 === e && (e = 13),
    32 <= e || 13 === e ? e : 0
  );
}
function ri() {
  return !0;
}
function oi() {
  return !1;
}
function si(e) {
  function t(t, n, i, r, o) {
    for (var s in ((this._reactName = t),
    (this._targetInst = i),
    (this.type = n),
    (this.nativeEvent = r),
    (this.target = o),
    (this.currentTarget = null),
    e))
      e.hasOwnProperty(s) && ((t = e[s]), (this[s] = t ? t(r) : r[s]));
    return (
      (this.isDefaultPrevented = (
        null != r.defaultPrevented ? r.defaultPrevented : !1 === r.returnValue
      )
        ? ri
        : oi),
      (this.isPropagationStopped = oi),
      this
    );
  }
  return (
    Be(t.prototype, {
      preventDefault: function () {
        this.defaultPrevented = !0;
        var e = this.nativeEvent;
        e &&
          (e.preventDefault
            ? e.preventDefault()
            : "unknown" != typeof e.returnValue && (e.returnValue = !1),
          (this.isDefaultPrevented = ri));
      },
      stopPropagation: function () {
        var e = this.nativeEvent;
        e &&
          (e.stopPropagation
            ? e.stopPropagation()
            : "unknown" != typeof e.cancelBubble && (e.cancelBubble = !0),
          (this.isPropagationStopped = ri));
      },
      persist: function () {},
      isPersistent: ri,
    }),
    t
  );
}
var ai,
  li,
  ci,
  di = {
    eventPhase: 0,
    bubbles: 0,
    cancelable: 0,
    timeStamp: function (e) {
      return e.timeStamp || Date.now();
    },
    defaultPrevented: 0,
    isTrusted: 0,
  },
  ui = si(di),
  hi = Be({}, di, { view: 0, detail: 0 }),
  gi = si(hi),
  pi = Be({}, hi, {
    screenX: 0,
    screenY: 0,
    clientX: 0,
    clientY: 0,
    pageX: 0,
    pageY: 0,
    ctrlKey: 0,
    shiftKey: 0,
    altKey: 0,
    metaKey: 0,
    getModifierState: Ei,
    button: 0,
    buttons: 0,
    relatedTarget: function (e) {
      return void 0 === e.relatedTarget
        ? e.fromElement === e.srcElement
          ? e.toElement
          : e.fromElement
        : e.relatedTarget;
    },
    movementX: function (e) {
      return "movementX" in e
        ? e.movementX
        : (e !== ci &&
            (ci && "mousemove" === e.type
              ? ((ai = e.screenX - ci.screenX), (li = e.screenY - ci.screenY))
              : (li = ai = 0),
            (ci = e)),
          ai);
    },
    movementY: function (e) {
      return "movementY" in e ? e.movementY : li;
    },
  }),
  fi = si(pi),
  mi = si(Be({}, pi, { dataTransfer: 0 })),
  _i = si(Be({}, hi, { relatedTarget: 0 })),
  vi = si(Be({}, di, { animationName: 0, elapsedTime: 0, pseudoElement: 0 })),
  bi = Be({}, di, {
    clipboardData: function (e) {
      return "clipboardData" in e ? e.clipboardData : window.clipboardData;
    },
  }),
  yi = si(bi),
  xi = si(Be({}, di, { data: 0 })),
  wi = {
    Esc: "Escape",
    Spacebar: " ",
    Left: "ArrowLeft",
    Up: "ArrowUp",
    Right: "ArrowRight",
    Down: "ArrowDown",
    Del: "Delete",
    Win: "OS",
    Menu: "ContextMenu",
    Apps: "ContextMenu",
    Scroll: "ScrollLock",
    MozPrintableKey: "Unidentified",
  },
  Ci = {
    8: "Backspace",
    9: "Tab",
    12: "Clear",
    13: "Enter",
    16: "Shift",
    17: "Control",
    18: "Alt",
    19: "Pause",
    20: "CapsLock",
    27: "Escape",
    32: " ",
    33: "PageUp",
    34: "PageDown",
    35: "End",
    36: "Home",
    37: "ArrowLeft",
    38: "ArrowUp",
    39: "ArrowRight",
    40: "ArrowDown",
    45: "Insert",
    46: "Delete",
    112: "F1",
    113: "F2",
    114: "F3",
    115: "F4",
    116: "F5",
    117: "F6",
    118: "F7",
    119: "F8",
    120: "F9",
    121: "F10",
    122: "F11",
    123: "F12",
    144: "NumLock",
    145: "ScrollLock",
    224: "Meta",
  },
  Si = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };
function ki(e) {
  var t = this.nativeEvent;
  return t.getModifierState ? t.getModifierState(e) : !!(e = Si[e]) && !!t[e];
}
function Ei() {
  return ki;
}
var Ni = Be({}, hi, {
    key: function (e) {
      if (e.key) {
        var t = wi[e.key] || e.key;
        if ("Unidentified" !== t) return t;
      }
      return "keypress" === e.type
        ? 13 === (e = ii(e))
          ? "Enter"
          : String.fromCharCode(e)
        : "keydown" === e.type || "keyup" === e.type
          ? Ci[e.keyCode] || "Unidentified"
          : "";
    },
    code: 0,
    location: 0,
    ctrlKey: 0,
    shiftKey: 0,
    altKey: 0,
    metaKey: 0,
    repeat: 0,
    locale: 0,
    getModifierState: Ei,
    charCode: function (e) {
      return "keypress" === e.type ? ii(e) : 0;
    },
    keyCode: function (e) {
      return "keydown" === e.type || "keyup" === e.type ? e.keyCode : 0;
    },
    which: function (e) {
      return "keypress" === e.type
        ? ii(e)
        : "keydown" === e.type || "keyup" === e.type
          ? e.keyCode
          : 0;
    },
  }),
  Li = si(Ni),
  Di = si(
    Be({}, pi, {
      pointerId: 0,
      width: 0,
      height: 0,
      pressure: 0,
      tangentialPressure: 0,
      tiltX: 0,
      tiltY: 0,
      twist: 0,
      pointerType: 0,
      isPrimary: 0,
    }),
  ),
  Ti = si(
    Be({}, hi, {
      touches: 0,
      targetTouches: 0,
      changedTouches: 0,
      altKey: 0,
      metaKey: 0,
      ctrlKey: 0,
      shiftKey: 0,
      getModifierState: Ei,
    }),
  ),
  Ii = si(Be({}, di, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 })),
  Ri = Be({}, pi, {
    deltaX: function (e) {
      return "deltaX" in e ? e.deltaX : "wheelDeltaX" in e ? -e.wheelDeltaX : 0;
    },
    deltaY: function (e) {
      return "deltaY" in e
        ? e.deltaY
        : "wheelDeltaY" in e
          ? -e.wheelDeltaY
          : "wheelDelta" in e
            ? -e.wheelDelta
            : 0;
    },
    deltaZ: 0,
    deltaMode: 0,
  }),
  Oi = si(Ri),
  Mi = [9, 13, 27, 32],
  Ai = he && "CompositionEvent" in window,
  Pi = null;
he && "documentMode" in document && (Pi = document.documentMode);
var ji = he && "TextEvent" in window && !Pi,
  Fi = he && (!Ai || (Pi && 8 < Pi && 11 >= Pi)),
  Bi = String.fromCharCode(32),
  Vi = !1;
function Wi(e, t) {
  switch (e) {
    case "keyup":
      return -1 !== Mi.indexOf(t.keyCode);
    case "keydown":
      return 229 !== t.keyCode;
    case "keypress":
    case "mousedown":
    case "focusout":
      return !0;
    default:
      return !1;
  }
}
function Hi(e) {
  return "object" == typeof (e = e.detail) && "data" in e ? e.data : null;
}
var zi = !1;
var Ui = {
  color: !0,
  date: !0,
  datetime: !0,
  "datetime-local": !0,
  email: !0,
  month: !0,
  number: !0,
  password: !0,
  range: !0,
  search: !0,
  tel: !0,
  text: !0,
  time: !0,
  url: !0,
  week: !0,
};
function $i(e) {
  var t = e && e.nodeName && e.nodeName.toLowerCase();
  return "input" === t ? !!Ui[e.type] : "textarea" === t;
}
function qi(e, t, n, i) {
  (Nt(i),
    0 < (t = Kr(t, "onChange")).length &&
      ((n = new ui("onChange", "change", null, n, i)), e.push({ event: n, listeners: t })));
}
var Ki = null,
  Gi = null;
function Zi(e) {
  Br(e, 0);
}
function Yi(e) {
  if (Ze(wo(e))) return e;
}
function Xi(e, t) {
  if ("change" === e) return t;
}
var Qi = !1;
if (he) {
  var Ji;
  if (he) {
    var er = "oninput" in document;
    if (!er) {
      var tr = document.createElement("div");
      (tr.setAttribute("oninput", "return;"), (er = "function" == typeof tr.oninput));
    }
    Ji = er;
  } else Ji = !1;
  Qi = Ji && (!document.documentMode || 9 < document.documentMode);
}
function nr() {
  Ki && (Ki.detachEvent("onpropertychange", ir), (Gi = Ki = null));
}
function ir(e) {
  if ("value" === e.propertyName && Yi(Gi)) {
    var t = [];
    (qi(t, Gi, e, wt(e)), Rt(Zi, t));
  }
}
function rr(e, t, n) {
  "focusin" === e
    ? (nr(), (Gi = n), (Ki = t).attachEvent("onpropertychange", ir))
    : "focusout" === e && nr();
}
function or(e) {
  if ("selectionchange" === e || "keyup" === e || "keydown" === e) return Yi(Gi);
}
function sr(e, t) {
  if ("click" === e) return Yi(t);
}
function ar(e, t) {
  if ("input" === e || "change" === e) return Yi(t);
}
var lr =
  "function" == typeof Object.is
    ? Object.is
    : function (e, t) {
        return (e === t && (0 !== e || 1 / e == 1 / t)) || (e != e && t != t);
      };
function cr(e, t) {
  if (lr(e, t)) return !0;
  if ("object" != typeof e || null === e || "object" != typeof t || null === t) return !1;
  var n = Object.keys(e),
    i = Object.keys(t);
  if (n.length !== i.length) return !1;
  for (i = 0; i < n.length; i++) {
    var r = n[i];
    if (!ge.call(t, r) || !lr(e[r], t[r])) return !1;
  }
  return !0;
}
function dr(e) {
  for (; e && e.firstChild; ) e = e.firstChild;
  return e;
}
function ur(e, t) {
  var n,
    i = dr(e);
  for (e = 0; i; ) {
    if (3 === i.nodeType) {
      if (((n = e + i.textContent.length), e <= t && n >= t)) return { node: i, offset: t - e };
      e = n;
    }
    e: {
      for (; i; ) {
        if (i.nextSibling) {
          i = i.nextSibling;
          break e;
        }
        i = i.parentNode;
      }
      i = void 0;
    }
    i = dr(i);
  }
}
function hr(e, t) {
  return (
    !(!e || !t) &&
    (e === t ||
      ((!e || 3 !== e.nodeType) &&
        (t && 3 === t.nodeType
          ? hr(e, t.parentNode)
          : "contains" in e
            ? e.contains(t)
            : !!e.compareDocumentPosition && !!(16 & e.compareDocumentPosition(t)))))
  );
}
function gr() {
  for (var e = window, t = Ye(); t instanceof e.HTMLIFrameElement; ) {
    try {
      var n = "string" == typeof t.contentWindow.location.href;
    } catch (opt) {
      n = !1;
    }
    if (!n) break;
    t = Ye((e = t.contentWindow).document);
  }
  return t;
}
function pr(e) {
  var t = e && e.nodeName && e.nodeName.toLowerCase();
  return (
    t &&
    (("input" === t &&
      ("text" === e.type ||
        "search" === e.type ||
        "tel" === e.type ||
        "url" === e.type ||
        "password" === e.type)) ||
      "textarea" === t ||
      "true" === e.contentEditable)
  );
}
function fr(e) {
  var t = gr(),
    n = e.focusedElem,
    i = e.selectionRange;
  if (t !== n && n && n.ownerDocument && hr(n.ownerDocument.documentElement, n)) {
    if (null !== i && pr(n))
      if (((t = i.start), void 0 === (e = i.end) && (e = t), "selectionStart" in n))
        ((n.selectionStart = t), (n.selectionEnd = Math.min(e, n.value.length)));
      else if ((e = ((t = n.ownerDocument || document) && t.defaultView) || window).getSelection) {
        e = e.getSelection();
        var r = n.textContent.length,
          o = Math.min(i.start, r);
        ((i = void 0 === i.end ? o : Math.min(i.end, r)),
          !e.extend && o > i && ((r = i), (i = o), (o = r)),
          (r = ur(n, o)));
        var s = ur(n, i);
        r &&
          s &&
          (1 !== e.rangeCount ||
            e.anchorNode !== r.node ||
            e.anchorOffset !== r.offset ||
            e.focusNode !== s.node ||
            e.focusOffset !== s.offset) &&
          ((t = t.createRange()).setStart(r.node, r.offset),
          e.removeAllRanges(),
          o > i
            ? (e.addRange(t), e.extend(s.node, s.offset))
            : (t.setEnd(s.node, s.offset), e.addRange(t)));
      }
    for (t = [], e = n; (e = e.parentNode); )
      1 === e.nodeType && t.push({ element: e, left: e.scrollLeft, top: e.scrollTop });
    for ("function" == typeof n.focus && n.focus(), n = 0; n < t.length; n++)
      (((e = t[n]).element.scrollLeft = e.left), (e.element.scrollTop = e.top));
  }
}
var mr = he && "documentMode" in document && 11 >= document.documentMode,
  _r = null,
  vr = null,
  br = null,
  yr = !1;
function xr(e, t, n) {
  var i = n.window === n ? n.document : 9 === n.nodeType ? n : n.ownerDocument;
  yr ||
    null == _r ||
    _r !== Ye(i) ||
    ("selectionStart" in (i = _r) && pr(i)
      ? (i = { start: i.selectionStart, end: i.selectionEnd })
      : (i = {
          anchorNode: (i = (
            (i.ownerDocument && i.ownerDocument.defaultView) ||
            window
          ).getSelection()).anchorNode,
          anchorOffset: i.anchorOffset,
          focusNode: i.focusNode,
          focusOffset: i.focusOffset,
        }),
    (br && cr(br, i)) ||
      ((br = i),
      0 < (i = Kr(vr, "onSelect")).length &&
        ((t = new ui("onSelect", "select", null, t, n)),
        e.push({ event: t, listeners: i }),
        (t.target = _r))));
}
function wr(e, t) {
  var n = {};
  return (
    (n[e.toLowerCase()] = t.toLowerCase()),
    (n["Webkit" + e] = "webkit" + t),
    (n["Moz" + e] = "moz" + t),
    n
  );
}
var Cr = {
    animationend: wr("Animation", "AnimationEnd"),
    animationiteration: wr("Animation", "AnimationIteration"),
    animationstart: wr("Animation", "AnimationStart"),
    transitionend: wr("Transition", "TransitionEnd"),
  },
  Sr = {},
  kr = {};
function Er(e) {
  if (Sr[e]) return Sr[e];
  if (!Cr[e]) return e;
  var t,
    n = Cr[e];
  for (t in n) if (n.hasOwnProperty(t) && t in kr) return (Sr[e] = n[t]);
  return e;
}
he &&
  ((kr = document.createElement("div").style),
  "AnimationEvent" in window ||
    (delete Cr.animationend.animation,
    delete Cr.animationiteration.animation,
    delete Cr.animationstart.animation),
  "TransitionEvent" in window || delete Cr.transitionend.transition);
var Nr = Er("animationend"),
  Lr = Er("animationiteration"),
  Dr = Er("animationstart"),
  Tr = Er("transitionend"),
  Ir = new Map(),
  Rr =
    "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(
      " ",
    );
function Or(e, t) {
  (Ir.set(e, t), de(t, [e]));
}
for (var Mr = 0; Mr < Rr.length; Mr++) {
  var Ar = Rr[Mr];
  Or(Ar.toLowerCase(), "on" + (Ar[0].toUpperCase() + Ar.slice(1)));
}
(Or(Nr, "onAnimationEnd"),
  Or(Lr, "onAnimationIteration"),
  Or(Dr, "onAnimationStart"),
  Or("dblclick", "onDoubleClick"),
  Or("focusin", "onFocus"),
  Or("focusout", "onBlur"),
  Or(Tr, "onTransitionEnd"),
  ue("onMouseEnter", ["mouseout", "mouseover"]),
  ue("onMouseLeave", ["mouseout", "mouseover"]),
  ue("onPointerEnter", ["pointerout", "pointerover"]),
  ue("onPointerLeave", ["pointerout", "pointerover"]),
  de("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")),
  de(
    "onSelect",
    "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
      " ",
    ),
  ),
  de("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]),
  de("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")),
  de("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")),
  de(
    "onCompositionUpdate",
    "compositionupdate focusout keydown keypress keyup mousedown".split(" "),
  ));
var Pr =
    "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(
      " ",
    ),
  jr = new Set("cancel close invalid load scroll toggle".split(" ").concat(Pr));
function Fr(e, t, n) {
  var i = e.type || "unknown-event";
  ((e.currentTarget = n),
    (function (e, t, n, i, r, o, s, a, l) {
      if ((Ht.apply(this, arguments), jt)) {
        if (!jt) throw Error(ae(198));
        var c = Ft;
        ((jt = !1), (Ft = null), Bt || ((Bt = !0), (Vt = c)));
      }
    })(i, t, void 0, e),
    (e.currentTarget = null));
}
function Br(e, t) {
  t = !!(4 & t);
  for (var n = 0; n < e.length; n++) {
    var i = e[n],
      r = i.event;
    i = i.listeners;
    e: {
      var o = void 0;
      if (t)
        for (var s = i.length - 1; 0 <= s; s--) {
          var a = i[s],
            l = a.instance,
            c = a.currentTarget;
          if (((a = a.listener), l !== o && r.isPropagationStopped())) break e;
          (Fr(r, a, c), (o = l));
        }
      else
        for (s = 0; s < i.length; s++) {
          if (
            ((l = (a = i[s]).instance),
            (c = a.currentTarget),
            (a = a.listener),
            l !== o && r.isPropagationStopped())
          )
            break e;
          (Fr(r, a, c), (o = l));
        }
    }
  }
  if (Bt) throw ((e = Vt), (Bt = !1), (Vt = null), e);
}
function Vr(e, t) {
  var n = t[_o];
  void 0 === n && (n = t[_o] = new Set());
  var i = e + "__bubble";
  n.has(i) || (Ur(t, e, 2, !1), n.add(i));
}
function Wr(e, t, n) {
  var i = 0;
  (t && (i |= 4), Ur(n, e, i, t));
}
var Hr = "_reactListening" + Math.random().toString(36).slice(2);
function zr(e) {
  if (!e[Hr]) {
    ((e[Hr] = !0),
      le.forEach(function (t) {
        "selectionchange" !== t && (jr.has(t) || Wr(t, !1, e), Wr(t, !0, e));
      }));
    var t = 9 === e.nodeType ? e : e.ownerDocument;
    null === t || t[Hr] || ((t[Hr] = !0), Wr("selectionchange", !1, t));
  }
}
function Ur(e, t, n, i) {
  switch (Qn(t)) {
    case 1:
      var r = Kn;
      break;
    case 4:
      r = Gn;
      break;
    default:
      r = Zn;
  }
  ((n = r.bind(null, t, n, e)),
    (r = void 0),
    !Mt || ("touchstart" !== t && "touchmove" !== t && "wheel" !== t) || (r = !0),
    i
      ? void 0 !== r
        ? e.addEventListener(t, n, { capture: !0, passive: r })
        : e.addEventListener(t, n, !0)
      : void 0 !== r
        ? e.addEventListener(t, n, { passive: r })
        : e.addEventListener(t, n, !1));
}
function $r(e, t, n, i, r) {
  var o = i;
  if (!(1 & t || 2 & t || null === i))
    e: for (;;) {
      if (null === i) return;
      var s = i.tag;
      if (3 === s || 4 === s) {
        var a = i.stateNode.containerInfo;
        if (a === r || (8 === a.nodeType && a.parentNode === r)) break;
        if (4 === s)
          for (s = i.return; null !== s; ) {
            var l = s.tag;
            if (
              (3 === l || 4 === l) &&
              ((l = s.stateNode.containerInfo) === r || (8 === l.nodeType && l.parentNode === r))
            )
              return;
            s = s.return;
          }
        for (; null !== a; ) {
          if (null === (s = yo(a))) return;
          if (5 === (l = s.tag) || 6 === l) {
            i = o = s;
            continue e;
          }
          a = a.parentNode;
        }
      }
      i = i.return;
    }
  Rt(function () {
    var i = o,
      r = wt(n),
      s = [];
    e: {
      var a = Ir.get(e);
      if (void 0 !== a) {
        var l = ui,
          c = e;
        switch (e) {
          case "keypress":
            if (0 === ii(n)) break e;
          case "keydown":
          case "keyup":
            l = Li;
            break;
          case "focusin":
            ((c = "focus"), (l = _i));
            break;
          case "focusout":
            ((c = "blur"), (l = _i));
            break;
          case "beforeblur":
          case "afterblur":
            l = _i;
            break;
          case "click":
            if (2 === n.button) break e;
          case "auxclick":
          case "dblclick":
          case "mousedown":
          case "mousemove":
          case "mouseup":
          case "mouseout":
          case "mouseover":
          case "contextmenu":
            l = fi;
            break;
          case "drag":
          case "dragend":
          case "dragenter":
          case "dragexit":
          case "dragleave":
          case "dragover":
          case "dragstart":
          case "drop":
            l = mi;
            break;
          case "touchcancel":
          case "touchend":
          case "touchmove":
          case "touchstart":
            l = Ti;
            break;
          case Nr:
          case Lr:
          case Dr:
            l = vi;
            break;
          case Tr:
            l = Ii;
            break;
          case "scroll":
            l = gi;
            break;
          case "wheel":
            l = Oi;
            break;
          case "copy":
          case "cut":
          case "paste":
            l = yi;
            break;
          case "gotpointercapture":
          case "lostpointercapture":
          case "pointercancel":
          case "pointerdown":
          case "pointermove":
          case "pointerout":
          case "pointerover":
          case "pointerup":
            l = Di;
        }
        var d = !!(4 & t),
          u = !d && "scroll" === e,
          h = d ? (null !== a ? a + "Capture" : null) : a;
        d = [];
        for (var g, p = i; null !== p; ) {
          var f = (g = p).stateNode;
          if (
            (5 === g.tag &&
              null !== f &&
              ((g = f), null !== h && null != (f = Ot(p, h)) && d.push(qr(p, f, g))),
            u)
          )
            break;
          p = p.return;
        }
        0 < d.length && ((a = new l(a, c, null, n, r)), s.push({ event: a, listeners: d }));
      }
    }
    if (!(7 & t)) {
      if (
        ((l = "mouseout" === e || "pointerout" === e),
        (!(a = "mouseover" === e || "pointerover" === e) ||
          n === xt ||
          !(c = n.relatedTarget || n.fromElement) ||
          (!yo(c) && !c[mo])) &&
          (l || a) &&
          ((a =
            r.window === r ? r : (a = r.ownerDocument) ? a.defaultView || a.parentWindow : window),
          l
            ? ((l = i),
              null !== (c = (c = n.relatedTarget || n.toElement) ? yo(c) : null) &&
                (c !== (u = zt(c)) || (5 !== c.tag && 6 !== c.tag)) &&
                (c = null))
            : ((l = null), (c = i)),
          l !== c))
      ) {
        if (
          ((d = fi),
          (f = "onMouseLeave"),
          (h = "onMouseEnter"),
          (p = "mouse"),
          ("pointerout" !== e && "pointerover" !== e) ||
            ((d = Di), (f = "onPointerLeave"), (h = "onPointerEnter"), (p = "pointer")),
          (u = null == l ? a : wo(l)),
          (g = null == c ? a : wo(c)),
          ((a = new d(f, p + "leave", l, n, r)).target = u),
          (a.relatedTarget = g),
          (f = null),
          yo(r) === i &&
            (((d = new d(h, p + "enter", c, n, r)).target = g), (d.relatedTarget = u), (f = d)),
          (u = f),
          l && c)
        )
          e: {
            for (h = c, p = 0, g = d = l; g; g = Gr(g)) p++;
            for (g = 0, f = h; f; f = Gr(f)) g++;
            for (; 0 < p - g; ) ((d = Gr(d)), p--);
            for (; 0 < g - p; ) ((h = Gr(h)), g--);
            for (; p--; ) {
              if (d === h || (null !== h && d === h.alternate)) break e;
              ((d = Gr(d)), (h = Gr(h)));
            }
            d = null;
          }
        else d = null;
        (null !== l && Zr(s, a, l, d, !1), null !== c && null !== u && Zr(s, u, c, d, !0));
      }
      if (
        "select" === (l = (a = i ? wo(i) : window).nodeName && a.nodeName.toLowerCase()) ||
        ("input" === l && "file" === a.type)
      )
        var m = Xi;
      else if ($i(a))
        if (Qi) m = ar;
        else {
          m = or;
          var _ = rr;
        }
      else
        (l = a.nodeName) &&
          "input" === l.toLowerCase() &&
          ("checkbox" === a.type || "radio" === a.type) &&
          (m = sr);
      switch (
        (m && (m = m(e, i))
          ? qi(s, m, n, r)
          : (_ && _(e, a, i),
            "focusout" === e &&
              (_ = a._wrapperState) &&
              _.controlled &&
              "number" === a.type &&
              nt(a, "number", a.value)),
        (_ = i ? wo(i) : window),
        e)
      ) {
        case "focusin":
          ($i(_) || "true" === _.contentEditable) && ((_r = _), (vr = i), (br = null));
          break;
        case "focusout":
          br = vr = _r = null;
          break;
        case "mousedown":
          yr = !0;
          break;
        case "contextmenu":
        case "mouseup":
        case "dragend":
          ((yr = !1), xr(s, n, r));
          break;
        case "selectionchange":
          if (mr) break;
        case "keydown":
        case "keyup":
          xr(s, n, r);
      }
      var v;
      if (Ai)
        e: {
          switch (e) {
            case "compositionstart":
              var b = "onCompositionStart";
              break e;
            case "compositionend":
              b = "onCompositionEnd";
              break e;
            case "compositionupdate":
              b = "onCompositionUpdate";
              break e;
          }
          b = void 0;
        }
      else
        zi
          ? Wi(e, n) && (b = "onCompositionEnd")
          : "keydown" === e && 229 === n.keyCode && (b = "onCompositionStart");
      (b &&
        (Fi &&
          "ko" !== n.locale &&
          (zi || "onCompositionStart" !== b
            ? "onCompositionEnd" === b && zi && (v = ni())
            : ((ei = "value" in (Jn = r) ? Jn.value : Jn.textContent), (zi = !0))),
        0 < (_ = Kr(i, b)).length &&
          ((b = new xi(b, e, null, n, r)),
          s.push({ event: b, listeners: _ }),
          v ? (b.data = v) : null !== (v = Hi(n)) && (b.data = v))),
        (v = ji
          ? (function (e, t) {
              switch (e) {
                case "compositionend":
                  return Hi(t);
                case "keypress":
                  return 32 !== t.which ? null : ((Vi = !0), Bi);
                case "textInput":
                  return (e = t.data) === Bi && Vi ? null : e;
                default:
                  return null;
              }
            })(e, n)
          : (function (e, t) {
              if (zi)
                return "compositionend" === e || (!Ai && Wi(e, t))
                  ? ((e = ni()), (ti = ei = Jn = null), (zi = !1), e)
                  : null;
              switch (e) {
                case "paste":
                default:
                  return null;
                case "keypress":
                  if (!(t.ctrlKey || t.altKey || t.metaKey) || (t.ctrlKey && t.altKey)) {
                    if (t.char && 1 < t.char.length) return t.char;
                    if (t.which) return String.fromCharCode(t.which);
                  }
                  return null;
                case "compositionend":
                  return Fi && "ko" !== t.locale ? null : t.data;
              }
            })(e, n)) &&
          0 < (i = Kr(i, "onBeforeInput")).length &&
          ((r = new xi("onBeforeInput", "beforeinput", null, n, r)),
          s.push({ event: r, listeners: i }),
          (r.data = v)));
    }
    Br(s, t);
  });
}
function qr(e, t, n) {
  return { instance: e, listener: t, currentTarget: n };
}
function Kr(e, t) {
  for (var n = t + "Capture", i = []; null !== e; ) {
    var r = e,
      o = r.stateNode;
    (5 === r.tag &&
      null !== o &&
      ((r = o),
      null != (o = Ot(e, n)) && i.unshift(qr(e, o, r)),
      null != (o = Ot(e, t)) && i.push(qr(e, o, r))),
      (e = e.return));
  }
  return i;
}
function Gr(e) {
  if (null === e) return null;
  do {
    e = e.return;
  } while (e && 5 !== e.tag);
  return e || null;
}
function Zr(e, t, n, i, r) {
  for (var o = t._reactName, s = []; null !== n && n !== i; ) {
    var a = n,
      l = a.alternate,
      c = a.stateNode;
    if (null !== l && l === i) break;
    (5 === a.tag &&
      null !== c &&
      ((a = c),
      r
        ? null != (l = Ot(n, o)) && s.unshift(qr(n, l, a))
        : r || (null != (l = Ot(n, o)) && s.push(qr(n, l, a)))),
      (n = n.return));
  }
  0 !== s.length && e.push({ event: t, listeners: s });
}
var Yr = /\r\n?/g,
  Xr = /\u0000|\uFFFD/g;
function Qr(e) {
  return ("string" == typeof e ? e : "" + e).replace(Yr, "\n").replace(Xr, "");
}
function Jr(e, t, n) {
  if (((t = Qr(t)), Qr(e) !== t && n)) throw Error(ae(425));
}
function eo() {}
var to = null,
  no = null;
function io(e, t) {
  return (
    "textarea" === e ||
    "noscript" === e ||
    "string" == typeof t.children ||
    "number" == typeof t.children ||
    ("object" == typeof t.dangerouslySetInnerHTML &&
      null !== t.dangerouslySetInnerHTML &&
      null != t.dangerouslySetInnerHTML.__html)
  );
}
var ro = "function" == typeof setTimeout ? setTimeout : void 0,
  oo = "function" == typeof clearTimeout ? clearTimeout : void 0,
  so = "function" == typeof Promise ? Promise : void 0,
  ao =
    "function" == typeof queueMicrotask
      ? queueMicrotask
      : void 0 !== so
        ? function (e) {
            return so.resolve(null).then(e).catch(lo);
          }
        : ro;
function lo(e) {
  setTimeout(function () {
    throw e;
  });
}
function co(e, t) {
  var n = t,
    i = 0;
  do {
    var r = n.nextSibling;
    if ((e.removeChild(n), r && 8 === r.nodeType))
      if ("/$" === (n = r.data)) {
        if (0 === i) return (e.removeChild(r), void Un(t));
        i--;
      } else ("$" !== n && "$?" !== n && "$!" !== n) || i++;
    n = r;
  } while (n);
  Un(t);
}
function uo(e) {
  for (; null != e; e = e.nextSibling) {
    var t = e.nodeType;
    if (1 === t || 3 === t) break;
    if (8 === t) {
      if ("$" === (t = e.data) || "$!" === t || "$?" === t) break;
      if ("/$" === t) return null;
    }
  }
  return e;
}
function ho(e) {
  e = e.previousSibling;
  for (var t = 0; e; ) {
    if (8 === e.nodeType) {
      var n = e.data;
      if ("$" === n || "$!" === n || "$?" === n) {
        if (0 === t) return e;
        t--;
      } else "/$" === n && t++;
    }
    e = e.previousSibling;
  }
  return null;
}
var go = Math.random().toString(36).slice(2),
  po = "__reactFiber$" + go,
  fo = "__reactProps$" + go,
  mo = "__reactContainer$" + go,
  _o = "__reactEvents$" + go,
  vo = "__reactListeners$" + go,
  bo = "__reactHandles$" + go;
function yo(e) {
  var t = e[po];
  if (t) return t;
  for (var n = e.parentNode; n; ) {
    if ((t = n[mo] || n[po])) {
      if (((n = t.alternate), null !== t.child || (null !== n && null !== n.child)))
        for (e = ho(e); null !== e; ) {
          if ((n = e[po])) return n;
          e = ho(e);
        }
      return t;
    }
    n = (e = n).parentNode;
  }
  return null;
}
function xo(e) {
  return !(e = e[po] || e[mo]) || (5 !== e.tag && 6 !== e.tag && 13 !== e.tag && 3 !== e.tag)
    ? null
    : e;
}
function wo(e) {
  if (5 === e.tag || 6 === e.tag) return e.stateNode;
  throw Error(ae(33));
}
function Co(e) {
  return e[fo] || null;
}
var So = [],
  ko = -1;
function Eo(e) {
  return { current: e };
}
function No(e) {
  0 > ko || ((e.current = So[ko]), (So[ko] = null), ko--);
}
function Lo(e, t) {
  (ko++, (So[ko] = e.current), (e.current = t));
}
var Do = {},
  To = Eo(Do),
  Io = Eo(!1),
  Ro = Do;
function Oo(e, t) {
  var n = e.type.contextTypes;
  if (!n) return Do;
  var i = e.stateNode;
  if (i && i.__reactInternalMemoizedUnmaskedChildContext === t)
    return i.__reactInternalMemoizedMaskedChildContext;
  var r,
    o = {};
  for (r in n) o[r] = t[r];
  return (
    i &&
      (((e = e.stateNode).__reactInternalMemoizedUnmaskedChildContext = t),
      (e.__reactInternalMemoizedMaskedChildContext = o)),
    o
  );
}
function Mo(e) {
  return null != (e = e.childContextTypes);
}
function Ao() {
  (No(Io), No(To));
}
function Po(e, t, n) {
  if (To.current !== Do) throw Error(ae(168));
  (Lo(To, t), Lo(Io, n));
}
function jo(e, t, n) {
  var i = e.stateNode;
  if (((t = t.childContextTypes), "function" != typeof i.getChildContext)) return n;
  for (var r in (i = i.getChildContext()))
    if (!(r in t)) throw Error(ae(108, $e(e) || "Unknown", r));
  return Be({}, n, i);
}
function Fo(e) {
  return (
    (e = ((e = e.stateNode) && e.__reactInternalMemoizedMergedChildContext) || Do),
    (Ro = To.current),
    Lo(To, e),
    Lo(Io, Io.current),
    !0
  );
}
function Bo(e, t, n) {
  var i = e.stateNode;
  if (!i) throw Error(ae(169));
  (n
    ? ((e = jo(e, t, Ro)),
      (i.__reactInternalMemoizedMergedChildContext = e),
      No(Io),
      No(To),
      Lo(To, e))
    : No(Io),
    Lo(Io, n));
}
var Vo = null,
  Wo = !1,
  Ho = !1;
function zo(e) {
  null === Vo ? (Vo = [e]) : Vo.push(e);
}
function Uo() {
  if (!Ho && null !== Vo) {
    Ho = !0;
    var e = 0,
      t = xn;
    try {
      var n = Vo;
      for (xn = 1; e < n.length; e++) {
        var i = n[e];
        do {
          i = i(!0);
        } while (null !== i);
      }
      ((Vo = null), (Wo = !1));
    } catch (spt) {
      throw (null !== Vo && (Vo = Vo.slice(e + 1)), Gt(en, Uo), spt);
    } finally {
      ((xn = t), (Ho = !1));
    }
  }
  return null;
}
var $o = [],
  qo = 0,
  Ko = null,
  Go = 0,
  Zo = [],
  Yo = 0,
  Xo = null,
  Qo = 1,
  Jo = "";
function es(e, t) {
  (($o[qo++] = Go), ($o[qo++] = Ko), (Ko = e), (Go = t));
}
function ts(e, t, n) {
  ((Zo[Yo++] = Qo), (Zo[Yo++] = Jo), (Zo[Yo++] = Xo), (Xo = e));
  var i = Qo;
  e = Jo;
  var r = 32 - ln(i) - 1;
  ((i &= ~(1 << r)), (n += 1));
  var o = 32 - ln(t) + r;
  if (30 < o) {
    var s = r - (r % 5);
    ((o = (i & ((1 << s) - 1)).toString(32)),
      (i >>= s),
      (r -= s),
      (Qo = (1 << (32 - ln(t) + r)) | (n << r) | i),
      (Jo = o + e));
  } else ((Qo = (1 << o) | (n << r) | i), (Jo = e));
}
function ns(e) {
  null !== e.return && (es(e, 1), ts(e, 1, 0));
}
function is(e) {
  for (; e === Ko; ) ((Ko = $o[--qo]), ($o[qo] = null), (Go = $o[--qo]), ($o[qo] = null));
  for (; e === Xo; )
    ((Xo = Zo[--Yo]),
      (Zo[Yo] = null),
      (Jo = Zo[--Yo]),
      (Zo[Yo] = null),
      (Qo = Zo[--Yo]),
      (Zo[Yo] = null));
}
var rs = null,
  os = null,
  ss = !1,
  as = null;
function ls(e, t) {
  var n = Id(5, null, null, 0);
  ((n.elementType = "DELETED"),
    (n.stateNode = t),
    (n.return = e),
    null === (t = e.deletions) ? ((e.deletions = [n]), (e.flags |= 16)) : t.push(n));
}
function cs(e, t) {
  switch (e.tag) {
    case 5:
      var n = e.type;
      return (
        null !==
          (t = 1 !== t.nodeType || n.toLowerCase() !== t.nodeName.toLowerCase() ? null : t) &&
        ((e.stateNode = t), (rs = e), (os = uo(t.firstChild)), !0)
      );
    case 6:
      return (
        null !== (t = "" === e.pendingProps || 3 !== t.nodeType ? null : t) &&
        ((e.stateNode = t), (rs = e), (os = null), !0)
      );
    case 13:
      return (
        null !== (t = 8 !== t.nodeType ? null : t) &&
        ((n = null !== Xo ? { id: Qo, overflow: Jo } : null),
        (e.memoizedState = { dehydrated: t, treeContext: n, retryLane: 1073741824 }),
        ((n = Id(18, null, null, 0)).stateNode = t),
        (n.return = e),
        (e.child = n),
        (rs = e),
        (os = null),
        !0)
      );
    default:
      return !1;
  }
}
function ds(e) {
  return !(!(1 & e.mode) || 128 & e.flags);
}
function us(e) {
  if (ss) {
    var t = os;
    if (t) {
      var n = t;
      if (!cs(e, t)) {
        if (ds(e)) throw Error(ae(418));
        t = uo(n.nextSibling);
        var i = rs;
        t && cs(e, t) ? ls(i, n) : ((e.flags = (-4097 & e.flags) | 2), (ss = !1), (rs = e));
      }
    } else {
      if (ds(e)) throw Error(ae(418));
      ((e.flags = (-4097 & e.flags) | 2), (ss = !1), (rs = e));
    }
  }
}
function hs(e) {
  for (e = e.return; null !== e && 5 !== e.tag && 3 !== e.tag && 13 !== e.tag; ) e = e.return;
  rs = e;
}
function gs(e) {
  if (e !== rs) return !1;
  if (!ss) return (hs(e), (ss = !0), !1);
  var t;
  if (
    ((t = 3 !== e.tag) &&
      !(t = 5 !== e.tag) &&
      (t = "head" !== (t = e.type) && "body" !== t && !io(e.type, e.memoizedProps)),
    t && (t = os))
  ) {
    if (ds(e)) throw (ps(), Error(ae(418)));
    for (; t; ) (ls(e, t), (t = uo(t.nextSibling)));
  }
  if ((hs(e), 13 === e.tag)) {
    if (!(e = null !== (e = e.memoizedState) ? e.dehydrated : null)) throw Error(ae(317));
    e: {
      for (e = e.nextSibling, t = 0; e; ) {
        if (8 === e.nodeType) {
          var n = e.data;
          if ("/$" === n) {
            if (0 === t) {
              os = uo(e.nextSibling);
              break e;
            }
            t--;
          } else ("$" !== n && "$!" !== n && "$?" !== n) || t++;
        }
        e = e.nextSibling;
      }
      os = null;
    }
  } else os = rs ? uo(e.stateNode.nextSibling) : null;
  return !0;
}
function ps() {
  for (var e = os; e; ) e = uo(e.nextSibling);
}
function fs() {
  ((os = rs = null), (ss = !1));
}
function ms(e) {
  null === as ? (as = [e]) : as.push(e);
}
var _s = we.ReactCurrentBatchConfig;
function vs(e, t, n) {
  if (null !== (e = n.ref) && "function" != typeof e && "object" != typeof e) {
    if (n._owner) {
      if ((n = n._owner)) {
        if (1 !== n.tag) throw Error(ae(309));
        var i = n.stateNode;
      }
      if (!i) throw Error(ae(147, e));
      var r = i,
        o = "" + e;
      return null !== t && null !== t.ref && "function" == typeof t.ref && t.ref._stringRef === o
        ? t.ref
        : ((t = function (e) {
            var t = r.refs;
            null === e ? delete t[o] : (t[o] = e);
          }),
          (t._stringRef = o),
          t);
    }
    if ("string" != typeof e) throw Error(ae(284));
    if (!n._owner) throw Error(ae(290, e));
  }
  return e;
}
function bs(e, t) {
  throw (
    (e = Object.prototype.toString.call(t)),
    Error(
      ae(31, "[object Object]" === e ? "object with keys {" + Object.keys(t).join(", ") + "}" : e),
    )
  );
}
function ys(e) {
  return (0, e._init)(e._payload);
}
function xs(e) {
  function t(t, n) {
    if (e) {
      var i = t.deletions;
      null === i ? ((t.deletions = [n]), (t.flags |= 16)) : i.push(n);
    }
  }
  function n(n, i) {
    if (!e) return null;
    for (; null !== i; ) (t(n, i), (i = i.sibling));
    return null;
  }
  function i(e, t) {
    for (e = new Map(); null !== t; )
      (null !== t.key ? e.set(t.key, t) : e.set(t.index, t), (t = t.sibling));
    return e;
  }
  function r(e, t) {
    return (((e = Od(e, t)).index = 0), (e.sibling = null), e);
  }
  function o(t, n, i) {
    return (
      (t.index = i),
      e
        ? null !== (i = t.alternate)
          ? (i = i.index) < n
            ? ((t.flags |= 2), n)
            : i
          : ((t.flags |= 2), n)
        : ((t.flags |= 1048576), n)
    );
  }
  function s(t) {
    return (e && null === t.alternate && (t.flags |= 2), t);
  }
  function a(e, t, n, i) {
    return null === t || 6 !== t.tag
      ? (((t = jd(n, e.mode, i)).return = e), t)
      : (((t = r(t, n)).return = e), t);
  }
  function l(e, t, n, i) {
    var o = n.type;
    return o === ke
      ? d(e, t, n.props.children, i, n.key)
      : null !== t &&
          (t.elementType === o ||
            ("object" == typeof o && null !== o && o.$$typeof === Me && ys(o) === t.type))
        ? (((i = r(t, n.props)).ref = vs(e, t, n)), (i.return = e), i)
        : (((i = Md(n.type, n.key, n.props, null, e.mode, i)).ref = vs(e, t, n)),
          (i.return = e),
          i);
  }
  function c(e, t, n, i) {
    return null === t ||
      4 !== t.tag ||
      t.stateNode.containerInfo !== n.containerInfo ||
      t.stateNode.implementation !== n.implementation
      ? (((t = Fd(n, e.mode, i)).return = e), t)
      : (((t = r(t, n.children || [])).return = e), t);
  }
  function d(e, t, n, i, o) {
    return null === t || 7 !== t.tag
      ? (((t = Ad(n, e.mode, i, o)).return = e), t)
      : (((t = r(t, n)).return = e), t);
  }
  function u(e, t, n) {
    if (("string" == typeof t && "" !== t) || "number" == typeof t)
      return (((t = jd("" + t, e.mode, n)).return = e), t);
    if ("object" == typeof t && null !== t) {
      switch (t.$$typeof) {
        case Ce:
          return (
            ((n = Md(t.type, t.key, t.props, null, e.mode, n)).ref = vs(e, null, t)),
            (n.return = e),
            n
          );
        case Se:
          return (((t = Fd(t, e.mode, n)).return = e), t);
        case Me:
          return u(e, (0, t._init)(t._payload), n);
      }
      if (it(t) || je(t)) return (((t = Ad(t, e.mode, n, null)).return = e), t);
      bs(e, t);
    }
    return null;
  }
  function h(e, t, n, i) {
    var r = null !== t ? t.key : null;
    if (("string" == typeof n && "" !== n) || "number" == typeof n)
      return null !== r ? null : a(e, t, "" + n, i);
    if ("object" == typeof n && null !== n) {
      switch (n.$$typeof) {
        case Ce:
          return n.key === r ? l(e, t, n, i) : null;
        case Se:
          return n.key === r ? c(e, t, n, i) : null;
        case Me:
          return h(e, t, (r = n._init)(n._payload), i);
      }
      if (it(n) || je(n)) return null !== r ? null : d(e, t, n, i, null);
      bs(e, n);
    }
    return null;
  }
  function g(e, t, n, i, r) {
    if (("string" == typeof i && "" !== i) || "number" == typeof i)
      return a(t, (e = e.get(n) || null), "" + i, r);
    if ("object" == typeof i && null !== i) {
      switch (i.$$typeof) {
        case Ce:
          return l(t, (e = e.get(null === i.key ? n : i.key) || null), i, r);
        case Se:
          return c(t, (e = e.get(null === i.key ? n : i.key) || null), i, r);
        case Me:
          return g(e, t, n, (0, i._init)(i._payload), r);
      }
      if (it(i) || je(i)) return d(t, (e = e.get(n) || null), i, r, null);
      bs(t, i);
    }
    return null;
  }
  function p(r, s, a, l) {
    for (var c = null, d = null, p = s, f = (s = 0), m = null; null !== p && f < a.length; f++) {
      p.index > f ? ((m = p), (p = null)) : (m = p.sibling);
      var _ = h(r, p, a[f], l);
      if (null === _) {
        null === p && (p = m);
        break;
      }
      (e && p && null === _.alternate && t(r, p),
        (s = o(_, s, f)),
        null === d ? (c = _) : (d.sibling = _),
        (d = _),
        (p = m));
    }
    if (f === a.length) return (n(r, p), ss && es(r, f), c);
    if (null === p) {
      for (; f < a.length; f++)
        null !== (p = u(r, a[f], l)) &&
          ((s = o(p, s, f)), null === d ? (c = p) : (d.sibling = p), (d = p));
      return (ss && es(r, f), c);
    }
    for (p = i(r, p); f < a.length; f++)
      null !== (m = g(p, r, f, a[f], l)) &&
        (e && null !== m.alternate && p.delete(null === m.key ? f : m.key),
        (s = o(m, s, f)),
        null === d ? (c = m) : (d.sibling = m),
        (d = m));
    return (
      e &&
        p.forEach(function (e) {
          return t(r, e);
        }),
      ss && es(r, f),
      c
    );
  }
  function f(r, s, a, l) {
    var c = je(a);
    if ("function" != typeof c) throw Error(ae(150));
    if (null == (a = c.call(a))) throw Error(ae(151));
    for (
      var d = (c = null), p = s, f = (s = 0), m = null, _ = a.next();
      null !== p && !_.done;
      f++, _ = a.next()
    ) {
      p.index > f ? ((m = p), (p = null)) : (m = p.sibling);
      var v = h(r, p, _.value, l);
      if (null === v) {
        null === p && (p = m);
        break;
      }
      (e && p && null === v.alternate && t(r, p),
        (s = o(v, s, f)),
        null === d ? (c = v) : (d.sibling = v),
        (d = v),
        (p = m));
    }
    if (_.done) return (n(r, p), ss && es(r, f), c);
    if (null === p) {
      for (; !_.done; f++, _ = a.next())
        null !== (_ = u(r, _.value, l)) &&
          ((s = o(_, s, f)), null === d ? (c = _) : (d.sibling = _), (d = _));
      return (ss && es(r, f), c);
    }
    for (p = i(r, p); !_.done; f++, _ = a.next())
      null !== (_ = g(p, r, f, _.value, l)) &&
        (e && null !== _.alternate && p.delete(null === _.key ? f : _.key),
        (s = o(_, s, f)),
        null === d ? (c = _) : (d.sibling = _),
        (d = _));
    return (
      e &&
        p.forEach(function (e) {
          return t(r, e);
        }),
      ss && es(r, f),
      c
    );
  }
  return function e(i, o, a, l) {
    if (
      ("object" == typeof a &&
        null !== a &&
        a.type === ke &&
        null === a.key &&
        (a = a.props.children),
      "object" == typeof a && null !== a)
    ) {
      switch (a.$$typeof) {
        case Ce:
          e: {
            for (var c = a.key, d = o; null !== d; ) {
              if (d.key === c) {
                if ((c = a.type) === ke) {
                  if (7 === d.tag) {
                    (n(i, d.sibling), ((o = r(d, a.props.children)).return = i), (i = o));
                    break e;
                  }
                } else if (
                  d.elementType === c ||
                  ("object" == typeof c && null !== c && c.$$typeof === Me && ys(c) === d.type)
                ) {
                  (n(i, d.sibling),
                    ((o = r(d, a.props)).ref = vs(i, d, a)),
                    (o.return = i),
                    (i = o));
                  break e;
                }
                n(i, d);
                break;
              }
              (t(i, d), (d = d.sibling));
            }
            a.type === ke
              ? (((o = Ad(a.props.children, i.mode, l, a.key)).return = i), (i = o))
              : (((l = Md(a.type, a.key, a.props, null, i.mode, l)).ref = vs(i, o, a)),
                (l.return = i),
                (i = l));
          }
          return s(i);
        case Se:
          e: {
            for (d = a.key; null !== o; ) {
              if (o.key === d) {
                if (
                  4 === o.tag &&
                  o.stateNode.containerInfo === a.containerInfo &&
                  o.stateNode.implementation === a.implementation
                ) {
                  (n(i, o.sibling), ((o = r(o, a.children || [])).return = i), (i = o));
                  break e;
                }
                n(i, o);
                break;
              }
              (t(i, o), (o = o.sibling));
            }
            (((o = Fd(a, i.mode, l)).return = i), (i = o));
          }
          return s(i);
        case Me:
          return e(i, o, (d = a._init)(a._payload), l);
      }
      if (it(a)) return p(i, o, a, l);
      if (je(a)) return f(i, o, a, l);
      bs(i, a);
    }
    return ("string" == typeof a && "" !== a) || "number" == typeof a
      ? ((a = "" + a),
        null !== o && 6 === o.tag
          ? (n(i, o.sibling), ((o = r(o, a)).return = i), (i = o))
          : (n(i, o), ((o = jd(a, i.mode, l)).return = i), (i = o)),
        s(i))
      : n(i, o);
  };
}
var ws = xs(!0),
  Cs = xs(!1),
  Ss = Eo(null),
  ks = null,
  Es = null,
  Ns = null;
function Ls() {
  Ns = Es = ks = null;
}
function Ds(e) {
  var t = Ss.current;
  (No(Ss), (e._currentValue = t));
}
function Ts(e, t, n) {
  for (; null !== e; ) {
    var i = e.alternate;
    if (
      ((e.childLanes & t) !== t
        ? ((e.childLanes |= t), null !== i && (i.childLanes |= t))
        : null !== i && (i.childLanes & t) !== t && (i.childLanes |= t),
      e === n)
    )
      break;
    e = e.return;
  }
}
function Is(e, t) {
  ((ks = e),
    (Ns = Es = null),
    null !== (e = e.dependencies) &&
      null !== e.firstContext &&
      (0 !== (e.lanes & t) && (bl = !0), (e.firstContext = null)));
}
function Rs(e) {
  var t = e._currentValue;
  if (Ns !== e)
    if (((e = { context: e, memoizedValue: t, next: null }), null === Es)) {
      if (null === ks) throw Error(ae(308));
      ((Es = e), (ks.dependencies = { lanes: 0, firstContext: e }));
    } else Es = Es.next = e;
  return t;
}
var Os = null;
function Ms(e) {
  null === Os ? (Os = [e]) : Os.push(e);
}
function As(e, t, n, i) {
  var r = t.interleaved;
  return (
    null === r ? ((n.next = n), Ms(t)) : ((n.next = r.next), (r.next = n)),
    (t.interleaved = n),
    Ps(e, i)
  );
}
function Ps(e, t) {
  e.lanes |= t;
  var n = e.alternate;
  for (null !== n && (n.lanes |= t), n = e, e = e.return; null !== e; )
    ((e.childLanes |= t),
      null !== (n = e.alternate) && (n.childLanes |= t),
      (n = e),
      (e = e.return));
  return 3 === n.tag ? n.stateNode : null;
}
var js = !1;
function Fs(e) {
  e.updateQueue = {
    baseState: e.memoizedState,
    firstBaseUpdate: null,
    lastBaseUpdate: null,
    shared: { pending: null, interleaved: null, lanes: 0 },
    effects: null,
  };
}
function Bs(e, t) {
  ((e = e.updateQueue),
    t.updateQueue === e &&
      (t.updateQueue = {
        baseState: e.baseState,
        firstBaseUpdate: e.firstBaseUpdate,
        lastBaseUpdate: e.lastBaseUpdate,
        shared: e.shared,
        effects: e.effects,
      }));
}
function Vs(e, t) {
  return { eventTime: e, lane: t, tag: 0, payload: null, callback: null, next: null };
}
function Ws(e, t, n) {
  var i = e.updateQueue;
  if (null === i) return null;
  if (((i = i.shared), 2 & Lc)) {
    var r = i.pending;
    return (
      null === r ? (t.next = t) : ((t.next = r.next), (r.next = t)),
      (i.pending = t),
      Ps(e, n)
    );
  }
  return (
    null === (r = i.interleaved) ? ((t.next = t), Ms(i)) : ((t.next = r.next), (r.next = t)),
    (i.interleaved = t),
    Ps(e, n)
  );
}
function Hs(e, t, n) {
  if (null !== (t = t.updateQueue) && ((t = t.shared), 4194240 & n)) {
    var i = t.lanes;
    ((n |= i &= e.pendingLanes), (t.lanes = n), yn(e, n));
  }
}
function zs(e, t) {
  var n = e.updateQueue,
    i = e.alternate;
  if (null !== i && n === (i = i.updateQueue)) {
    var r = null,
      o = null;
    if (null !== (n = n.firstBaseUpdate)) {
      do {
        var s = {
          eventTime: n.eventTime,
          lane: n.lane,
          tag: n.tag,
          payload: n.payload,
          callback: n.callback,
          next: null,
        };
        (null === o ? (r = o = s) : (o = o.next = s), (n = n.next));
      } while (null !== n);
      null === o ? (r = o = t) : (o = o.next = t);
    } else r = o = t;
    return (
      (n = {
        baseState: i.baseState,
        firstBaseUpdate: r,
        lastBaseUpdate: o,
        shared: i.shared,
        effects: i.effects,
      }),
      void (e.updateQueue = n)
    );
  }
  (null === (e = n.lastBaseUpdate) ? (n.firstBaseUpdate = t) : (e.next = t),
    (n.lastBaseUpdate = t));
}
function Us(e, t, n, i) {
  var r = e.updateQueue;
  js = !1;
  var o = r.firstBaseUpdate,
    s = r.lastBaseUpdate,
    a = r.shared.pending;
  if (null !== a) {
    r.shared.pending = null;
    var l = a,
      c = l.next;
    ((l.next = null), null === s ? (o = c) : (s.next = c), (s = l));
    var d = e.alternate;
    null !== d &&
      (a = (d = d.updateQueue).lastBaseUpdate) !== s &&
      (null === a ? (d.firstBaseUpdate = c) : (a.next = c), (d.lastBaseUpdate = l));
  }
  if (null !== o) {
    var u = r.baseState;
    for (s = 0, d = c = l = null, a = o; ; ) {
      var h = a.lane,
        g = a.eventTime;
      if ((i & h) === h) {
        null !== d &&
          (d = d.next =
            {
              eventTime: g,
              lane: 0,
              tag: a.tag,
              payload: a.payload,
              callback: a.callback,
              next: null,
            });
        e: {
          var p = e,
            f = a;
          switch (((h = t), (g = n), f.tag)) {
            case 1:
              if ("function" == typeof (p = f.payload)) {
                u = p.call(g, u, h);
                break e;
              }
              u = p;
              break e;
            case 3:
              p.flags = (-65537 & p.flags) | 128;
            case 0:
              if (null == (h = "function" == typeof (p = f.payload) ? p.call(g, u, h) : p)) break e;
              u = Be({}, u, h);
              break e;
            case 2:
              js = !0;
          }
        }
        null !== a.callback &&
          0 !== a.lane &&
          ((e.flags |= 64), null === (h = r.effects) ? (r.effects = [a]) : h.push(a));
      } else
        ((g = {
          eventTime: g,
          lane: h,
          tag: a.tag,
          payload: a.payload,
          callback: a.callback,
          next: null,
        }),
          null === d ? ((c = d = g), (l = u)) : (d = d.next = g),
          (s |= h));
      if (null === (a = a.next)) {
        if (null === (a = r.shared.pending)) break;
        ((a = (h = a).next), (h.next = null), (r.lastBaseUpdate = h), (r.shared.pending = null));
      }
    }
    if (
      (null === d && (l = u),
      (r.baseState = l),
      (r.firstBaseUpdate = c),
      (r.lastBaseUpdate = d),
      null !== (t = r.shared.interleaved))
    ) {
      r = t;
      do {
        ((s |= r.lane), (r = r.next));
      } while (r !== t);
    } else null === o && (r.shared.lanes = 0);
    ((Pc |= s), (e.lanes = s), (e.memoizedState = u));
  }
}
function $s(e, t, n) {
  if (((e = t.effects), (t.effects = null), null !== e))
    for (t = 0; t < e.length; t++) {
      var i = e[t],
        r = i.callback;
      if (null !== r) {
        if (((i.callback = null), (i = n), "function" != typeof r)) throw Error(ae(191, r));
        r.call(i);
      }
    }
}
var qs = {},
  Ks = Eo(qs),
  Gs = Eo(qs),
  Zs = Eo(qs);
function Ys(e) {
  if (e === qs) throw Error(ae(174));
  return e;
}
function Xs(e, t) {
  switch ((Lo(Zs, t), Lo(Gs, e), Lo(Ks, qs), (e = t.nodeType))) {
    case 9:
    case 11:
      t = (t = t.documentElement) ? t.namespaceURI : dt(null, "");
      break;
    default:
      t = dt((t = (e = 8 === e ? t.parentNode : t).namespaceURI || null), (e = e.tagName));
  }
  (No(Ks), Lo(Ks, t));
}
function Qs() {
  (No(Ks), No(Gs), No(Zs));
}
function Js(e) {
  Ys(Zs.current);
  var t = Ys(Ks.current),
    n = dt(t, e.type);
  t !== n && (Lo(Gs, e), Lo(Ks, n));
}
function ea(e) {
  Gs.current === e && (No(Ks), No(Gs));
}
var ta = Eo(0);
function na(e) {
  for (var t = e; null !== t; ) {
    if (13 === t.tag) {
      var n = t.memoizedState;
      if (null !== n && (null === (n = n.dehydrated) || "$?" === n.data || "$!" === n.data))
        return t;
    } else if (19 === t.tag && void 0 !== t.memoizedProps.revealOrder) {
      if (128 & t.flags) return t;
    } else if (null !== t.child) {
      ((t.child.return = t), (t = t.child));
      continue;
    }
    if (t === e) break;
    for (; null === t.sibling; ) {
      if (null === t.return || t.return === e) return null;
      t = t.return;
    }
    ((t.sibling.return = t.return), (t = t.sibling));
  }
  return null;
}
var ia = [];
function ra() {
  for (var e = 0; e < ia.length; e++) ia[e]._workInProgressVersionPrimary = null;
  ia.length = 0;
}
var oa = we.ReactCurrentDispatcher,
  sa = we.ReactCurrentBatchConfig,
  aa = 0,
  la = null,
  ca = null,
  da = null,
  ua = !1,
  ha = !1,
  ga = 0,
  pa = 0;
function fa() {
  throw Error(ae(321));
}
function ma(e, t) {
  if (null === t) return !1;
  for (var n = 0; n < t.length && n < e.length; n++) if (!lr(e[n], t[n])) return !1;
  return !0;
}
function _a(e, t, n, i, r, o) {
  if (
    ((aa = o),
    (la = t),
    (t.memoizedState = null),
    (t.updateQueue = null),
    (t.lanes = 0),
    (oa.current = null === e || null === e.memoizedState ? el : tl),
    (e = n(i, r)),
    ha)
  ) {
    o = 0;
    do {
      if (((ha = !1), (ga = 0), 25 <= o)) throw Error(ae(301));
      ((o += 1), (da = ca = null), (t.updateQueue = null), (oa.current = nl), (e = n(i, r)));
    } while (ha);
  }
  if (
    ((oa.current = Ja),
    (t = null !== ca && null !== ca.next),
    (aa = 0),
    (da = ca = la = null),
    (ua = !1),
    t)
  )
    throw Error(ae(300));
  return e;
}
function va() {
  var e = 0 !== ga;
  return ((ga = 0), e);
}
function ba() {
  var e = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null };
  return (null === da ? (la.memoizedState = da = e) : (da = da.next = e), da);
}
function ya() {
  if (null === ca) {
    var e = la.alternate;
    e = null !== e ? e.memoizedState : null;
  } else e = ca.next;
  var t = null === da ? la.memoizedState : da.next;
  if (null !== t) ((da = t), (ca = e));
  else {
    if (null === e) throw Error(ae(310));
    ((e = {
      memoizedState: (ca = e).memoizedState,
      baseState: ca.baseState,
      baseQueue: ca.baseQueue,
      queue: ca.queue,
      next: null,
    }),
      null === da ? (la.memoizedState = da = e) : (da = da.next = e));
  }
  return da;
}
function xa(e, t) {
  return "function" == typeof t ? t(e) : t;
}
function wa(e) {
  var t = ya(),
    n = t.queue;
  if (null === n) throw Error(ae(311));
  n.lastRenderedReducer = e;
  var i = ca,
    r = i.baseQueue,
    o = n.pending;
  if (null !== o) {
    if (null !== r) {
      var s = r.next;
      ((r.next = o.next), (o.next = s));
    }
    ((i.baseQueue = r = o), (n.pending = null));
  }
  if (null !== r) {
    ((o = r.next), (i = i.baseState));
    var a = (s = null),
      l = null,
      c = o;
    do {
      var d = c.lane;
      if ((aa & d) === d)
        (null !== l &&
          (l = l.next =
            {
              lane: 0,
              action: c.action,
              hasEagerState: c.hasEagerState,
              eagerState: c.eagerState,
              next: null,
            }),
          (i = c.hasEagerState ? c.eagerState : e(i, c.action)));
      else {
        var u = {
          lane: d,
          action: c.action,
          hasEagerState: c.hasEagerState,
          eagerState: c.eagerState,
          next: null,
        };
        (null === l ? ((a = l = u), (s = i)) : (l = l.next = u), (la.lanes |= d), (Pc |= d));
      }
      c = c.next;
    } while (null !== c && c !== o);
    (null === l ? (s = i) : (l.next = a),
      lr(i, t.memoizedState) || (bl = !0),
      (t.memoizedState = i),
      (t.baseState = s),
      (t.baseQueue = l),
      (n.lastRenderedState = i));
  }
  if (null !== (e = n.interleaved)) {
    r = e;
    do {
      ((o = r.lane), (la.lanes |= o), (Pc |= o), (r = r.next));
    } while (r !== e);
  } else null === r && (n.lanes = 0);
  return [t.memoizedState, n.dispatch];
}
function Ca(e) {
  var t = ya(),
    n = t.queue;
  if (null === n) throw Error(ae(311));
  n.lastRenderedReducer = e;
  var i = n.dispatch,
    r = n.pending,
    o = t.memoizedState;
  if (null !== r) {
    n.pending = null;
    var s = (r = r.next);
    do {
      ((o = e(o, s.action)), (s = s.next));
    } while (s !== r);
    (lr(o, t.memoizedState) || (bl = !0),
      (t.memoizedState = o),
      null === t.baseQueue && (t.baseState = o),
      (n.lastRenderedState = o));
  }
  return [o, i];
}
function Sa() {}
function ka(e, t) {
  var n = la,
    i = ya(),
    r = t(),
    o = !lr(i.memoizedState, r);
  if (
    (o && ((i.memoizedState = r), (bl = !0)),
    (i = i.queue),
    ja(La.bind(null, n, i, e), [e]),
    i.getSnapshot !== t || o || (null !== da && 1 & da.memoizedState.tag))
  ) {
    if (((n.flags |= 2048), Ra(9, Na.bind(null, n, i, r, t), void 0, null), null === Dc))
      throw Error(ae(349));
    30 & aa || Ea(n, t, r);
  }
  return r;
}
function Ea(e, t, n) {
  ((e.flags |= 16384),
    (e = { getSnapshot: t, value: n }),
    null === (t = la.updateQueue)
      ? ((t = { lastEffect: null, stores: null }), (la.updateQueue = t), (t.stores = [e]))
      : null === (n = t.stores)
        ? (t.stores = [e])
        : n.push(e));
}
function Na(e, t, n, i) {
  ((t.value = n), (t.getSnapshot = i), Da(t) && Ta(e));
}
function La(e, t, n) {
  return n(function () {
    Da(t) && Ta(e);
  });
}
function Da(e) {
  var t = e.getSnapshot;
  e = e.value;
  try {
    var n = t();
    return !lr(e, n);
  } catch (opt) {
    return !0;
  }
}
function Ta(e) {
  var t = Ps(e, 1);
  null !== t && nd(t, e, 1, -1);
}
function Ia(e) {
  var t = ba();
  return (
    "function" == typeof e && (e = e()),
    (t.memoizedState = t.baseState = e),
    (e = {
      pending: null,
      interleaved: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: xa,
      lastRenderedState: e,
    }),
    (t.queue = e),
    (e = e.dispatch = Za.bind(null, la, e)),
    [t.memoizedState, e]
  );
}
function Ra(e, t, n, i) {
  return (
    (e = { tag: e, create: t, destroy: n, deps: i, next: null }),
    null === (t = la.updateQueue)
      ? ((t = { lastEffect: null, stores: null }),
        (la.updateQueue = t),
        (t.lastEffect = e.next = e))
      : null === (n = t.lastEffect)
        ? (t.lastEffect = e.next = e)
        : ((i = n.next), (n.next = e), (e.next = i), (t.lastEffect = e)),
    e
  );
}
function Oa() {
  return ya().memoizedState;
}
function Ma(e, t, n, i) {
  var r = ba();
  ((la.flags |= e), (r.memoizedState = Ra(1 | t, n, void 0, void 0 === i ? null : i)));
}
function Aa(e, t, n, i) {
  var r = ya();
  i = void 0 === i ? null : i;
  var o = void 0;
  if (null !== ca) {
    var s = ca.memoizedState;
    if (((o = s.destroy), null !== i && ma(i, s.deps)))
      return void (r.memoizedState = Ra(t, n, o, i));
  }
  ((la.flags |= e), (r.memoizedState = Ra(1 | t, n, o, i)));
}
function Pa(e, t) {
  return Ma(8390656, 8, e, t);
}
function ja(e, t) {
  return Aa(2048, 8, e, t);
}
function Fa(e, t) {
  return Aa(4, 2, e, t);
}
function Ba(e, t) {
  return Aa(4, 4, e, t);
}
function Va(e, t) {
  return "function" == typeof t
    ? ((e = e()),
      t(e),
      function () {
        t(null);
      })
    : null != t
      ? ((e = e()),
        (t.current = e),
        function () {
          t.current = null;
        })
      : void 0;
}
function Wa(e, t, n) {
  return ((n = null != n ? n.concat([e]) : null), Aa(4, 4, Va.bind(null, t, e), n));
}
function Ha() {}
function za(e, t) {
  var n = ya();
  t = void 0 === t ? null : t;
  var i = n.memoizedState;
  return null !== i && null !== t && ma(t, i[1]) ? i[0] : ((n.memoizedState = [e, t]), e);
}
function Ua(e, t) {
  var n = ya();
  t = void 0 === t ? null : t;
  var i = n.memoizedState;
  return null !== i && null !== t && ma(t, i[1])
    ? i[0]
    : ((e = e()), (n.memoizedState = [e, t]), e);
}
function $a(e, t, n) {
  return 21 & aa
    ? (lr(n, t) || ((n = _n()), (la.lanes |= n), (Pc |= n), (e.baseState = !0)), t)
    : (e.baseState && ((e.baseState = !1), (bl = !0)), (e.memoizedState = n));
}
function qa(e, t) {
  var n = xn;
  ((xn = 0 !== n && 4 > n ? n : 4), e(!0));
  var i = sa.transition;
  sa.transition = {};
  try {
    (e(!1), t());
  } finally {
    ((xn = n), (sa.transition = i));
  }
}
function Ka() {
  return ya().memoizedState;
}
function Ga(e, t, n) {
  var i = td(e);
  if (((n = { lane: i, action: n, hasEagerState: !1, eagerState: null, next: null }), Ya(e)))
    Xa(t, n);
  else if (null !== (n = As(e, t, n, i))) {
    (nd(n, e, i, ed()), Qa(n, t, i));
  }
}
function Za(e, t, n) {
  var i = td(e),
    r = { lane: i, action: n, hasEagerState: !1, eagerState: null, next: null };
  if (Ya(e)) Xa(t, r);
  else {
    var o = e.alternate;
    if (0 === e.lanes && (null === o || 0 === o.lanes) && null !== (o = t.lastRenderedReducer))
      try {
        var s = t.lastRenderedState,
          a = o(s, n);
        if (((r.hasEagerState = !0), (r.eagerState = a), lr(a, s))) {
          var l = t.interleaved;
          return (
            null === l ? ((r.next = r), Ms(t)) : ((r.next = l.next), (l.next = r)),
            void (t.interleaved = r)
          );
        }
      } catch (upt) {}
    null !== (n = As(e, t, r, i)) && (nd(n, e, i, (r = ed())), Qa(n, t, i));
  }
}
function Ya(e) {
  var t = e.alternate;
  return e === la || (null !== t && t === la);
}
function Xa(e, t) {
  ha = ua = !0;
  var n = e.pending;
  (null === n ? (t.next = t) : ((t.next = n.next), (n.next = t)), (e.pending = t));
}
function Qa(e, t, n) {
  if (4194240 & n) {
    var i = t.lanes;
    ((n |= i &= e.pendingLanes), (t.lanes = n), yn(e, n));
  }
}
var Ja = {
    readContext: Rs,
    useCallback: fa,
    useContext: fa,
    useEffect: fa,
    useImperativeHandle: fa,
    useInsertionEffect: fa,
    useLayoutEffect: fa,
    useMemo: fa,
    useReducer: fa,
    useRef: fa,
    useState: fa,
    useDebugValue: fa,
    useDeferredValue: fa,
    useTransition: fa,
    useMutableSource: fa,
    useSyncExternalStore: fa,
    useId: fa,
    unstable_isNewReconciler: !1,
  },
  el = {
    readContext: Rs,
    useCallback: function (e, t) {
      return ((ba().memoizedState = [e, void 0 === t ? null : t]), e);
    },
    useContext: Rs,
    useEffect: Pa,
    useImperativeHandle: function (e, t, n) {
      return ((n = null != n ? n.concat([e]) : null), Ma(4194308, 4, Va.bind(null, t, e), n));
    },
    useLayoutEffect: function (e, t) {
      return Ma(4194308, 4, e, t);
    },
    useInsertionEffect: function (e, t) {
      return Ma(4, 2, e, t);
    },
    useMemo: function (e, t) {
      var n = ba();
      return ((t = void 0 === t ? null : t), (e = e()), (n.memoizedState = [e, t]), e);
    },
    useReducer: function (e, t, n) {
      var i = ba();
      return (
        (t = void 0 !== n ? n(t) : t),
        (i.memoizedState = i.baseState = t),
        (e = {
          pending: null,
          interleaved: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: e,
          lastRenderedState: t,
        }),
        (i.queue = e),
        (e = e.dispatch = Ga.bind(null, la, e)),
        [i.memoizedState, e]
      );
    },
    useRef: function (e) {
      return ((e = { current: e }), (ba().memoizedState = e));
    },
    useState: Ia,
    useDebugValue: Ha,
    useDeferredValue: function (e) {
      return (ba().memoizedState = e);
    },
    useTransition: function () {
      var e = Ia(!1),
        t = e[0];
      return ((e = qa.bind(null, e[1])), (ba().memoizedState = e), [t, e]);
    },
    useMutableSource: function () {},
    useSyncExternalStore: function (e, t, n) {
      var i = la,
        r = ba();
      if (ss) {
        if (void 0 === n) throw Error(ae(407));
        n = n();
      } else {
        if (((n = t()), null === Dc)) throw Error(ae(349));
        30 & aa || Ea(i, t, n);
      }
      r.memoizedState = n;
      var o = { value: n, getSnapshot: t };
      return (
        (r.queue = o),
        Pa(La.bind(null, i, o, e), [e]),
        (i.flags |= 2048),
        Ra(9, Na.bind(null, i, o, n, t), void 0, null),
        n
      );
    },
    useId: function () {
      var e = ba(),
        t = Dc.identifierPrefix;
      if (ss) {
        var n = Jo;
        ((t = ":" + t + "R" + (n = (Qo & ~(1 << (32 - ln(Qo) - 1))).toString(32) + n)),
          0 < (n = ga++) && (t += "H" + n.toString(32)),
          (t += ":"));
      } else t = ":" + t + "r" + (n = pa++).toString(32) + ":";
      return (e.memoizedState = t);
    },
    unstable_isNewReconciler: !1,
  },
  tl = {
    readContext: Rs,
    useCallback: za,
    useContext: Rs,
    useEffect: ja,
    useImperativeHandle: Wa,
    useInsertionEffect: Fa,
    useLayoutEffect: Ba,
    useMemo: Ua,
    useReducer: wa,
    useRef: Oa,
    useState: function () {
      return wa(xa);
    },
    useDebugValue: Ha,
    useDeferredValue: function (e) {
      return $a(ya(), ca.memoizedState, e);
    },
    useTransition: function () {
      return [wa(xa)[0], ya().memoizedState];
    },
    useMutableSource: Sa,
    useSyncExternalStore: ka,
    useId: Ka,
    unstable_isNewReconciler: !1,
  },
  nl = {
    readContext: Rs,
    useCallback: za,
    useContext: Rs,
    useEffect: ja,
    useImperativeHandle: Wa,
    useInsertionEffect: Fa,
    useLayoutEffect: Ba,
    useMemo: Ua,
    useReducer: Ca,
    useRef: Oa,
    useState: function () {
      return Ca(xa);
    },
    useDebugValue: Ha,
    useDeferredValue: function (e) {
      var t = ya();
      return null === ca ? (t.memoizedState = e) : $a(t, ca.memoizedState, e);
    },
    useTransition: function () {
      return [Ca(xa)[0], ya().memoizedState];
    },
    useMutableSource: Sa,
    useSyncExternalStore: ka,
    useId: Ka,
    unstable_isNewReconciler: !1,
  };
function il(e, t) {
  if (e && e.defaultProps) {
    for (var n in ((t = Be({}, t)), (e = e.defaultProps))) void 0 === t[n] && (t[n] = e[n]);
    return t;
  }
  return t;
}
function rl(e, t, n, i) {
  ((n = null == (n = n(i, (t = e.memoizedState))) ? t : Be({}, t, n)),
    (e.memoizedState = n),
    0 === e.lanes && (e.updateQueue.baseState = n));
}
var ol = {
  isMounted: function (e) {
    return !!(e = e._reactInternals) && zt(e) === e;
  },
  enqueueSetState: function (e, t, n) {
    e = e._reactInternals;
    var i = ed(),
      r = td(e),
      o = Vs(i, r);
    ((o.payload = t),
      null != n && (o.callback = n),
      null !== (t = Ws(e, o, r)) && (nd(t, e, r, i), Hs(t, e, r)));
  },
  enqueueReplaceState: function (e, t, n) {
    e = e._reactInternals;
    var i = ed(),
      r = td(e),
      o = Vs(i, r);
    ((o.tag = 1),
      (o.payload = t),
      null != n && (o.callback = n),
      null !== (t = Ws(e, o, r)) && (nd(t, e, r, i), Hs(t, e, r)));
  },
  enqueueForceUpdate: function (e, t) {
    e = e._reactInternals;
    var n = ed(),
      i = td(e),
      r = Vs(n, i);
    ((r.tag = 2),
      null != t && (r.callback = t),
      null !== (t = Ws(e, r, i)) && (nd(t, e, i, n), Hs(t, e, i)));
  },
};
function sl(e, t, n, i, r, o, s) {
  return "function" == typeof (e = e.stateNode).shouldComponentUpdate
    ? e.shouldComponentUpdate(i, o, s)
    : !t.prototype || !t.prototype.isPureReactComponent || !cr(n, i) || !cr(r, o);
}
function al(e, t, n) {
  var i = !1,
    r = Do,
    o = t.contextType;
  return (
    "object" == typeof o && null !== o
      ? (o = Rs(o))
      : ((r = Mo(t) ? Ro : To.current), (o = (i = null != (i = t.contextTypes)) ? Oo(e, r) : Do)),
    (t = new t(n, o)),
    (e.memoizedState = null !== t.state && void 0 !== t.state ? t.state : null),
    (t.updater = ol),
    (e.stateNode = t),
    (t._reactInternals = e),
    i &&
      (((e = e.stateNode).__reactInternalMemoizedUnmaskedChildContext = r),
      (e.__reactInternalMemoizedMaskedChildContext = o)),
    t
  );
}
function ll(e, t, n, i) {
  ((e = t.state),
    "function" == typeof t.componentWillReceiveProps && t.componentWillReceiveProps(n, i),
    "function" == typeof t.UNSAFE_componentWillReceiveProps &&
      t.UNSAFE_componentWillReceiveProps(n, i),
    t.state !== e && ol.enqueueReplaceState(t, t.state, null));
}
function cl(e, t, n, i) {
  var r = e.stateNode;
  ((r.props = n), (r.state = e.memoizedState), (r.refs = {}), Fs(e));
  var o = t.contextType;
  ("object" == typeof o && null !== o
    ? (r.context = Rs(o))
    : ((o = Mo(t) ? Ro : To.current), (r.context = Oo(e, o))),
    (r.state = e.memoizedState),
    "function" == typeof (o = t.getDerivedStateFromProps) &&
      (rl(e, t, o, n), (r.state = e.memoizedState)),
    "function" == typeof t.getDerivedStateFromProps ||
      "function" == typeof r.getSnapshotBeforeUpdate ||
      ("function" != typeof r.UNSAFE_componentWillMount &&
        "function" != typeof r.componentWillMount) ||
      ((t = r.state),
      "function" == typeof r.componentWillMount && r.componentWillMount(),
      "function" == typeof r.UNSAFE_componentWillMount && r.UNSAFE_componentWillMount(),
      t !== r.state && ol.enqueueReplaceState(r, r.state, null),
      Us(e, n, r, i),
      (r.state = e.memoizedState)),
    "function" == typeof r.componentDidMount && (e.flags |= 4194308));
}
function dl(e, t) {
  try {
    var n = "",
      i = t;
    do {
      ((n += ze(i)), (i = i.return));
    } while (i);
    var r = n;
  } catch (apt) {
    r = "\nError generating stack: " + apt.message + "\n" + apt.stack;
  }
  return { value: e, source: t, stack: r, digest: null };
}
function ul(e, t, n) {
  return { value: e, source: null, stack: null != n ? n : null, digest: null != t ? t : null };
}
var hl = "function" == typeof WeakMap ? WeakMap : Map;
function gl(e, t, n) {
  (((n = Vs(-1, n)).tag = 3), (n.payload = { element: null }));
  var i = t.value;
  return (
    (n.callback = function () {
      Uc || ((Uc = !0), ($c = i));
    }),
    n
  );
}
function pl(e, t, n) {
  (n = Vs(-1, n)).tag = 3;
  var i = e.type.getDerivedStateFromError;
  if ("function" == typeof i) {
    var r = t.value;
    ((n.payload = function () {
      return i(r);
    }),
      (n.callback = function () {}));
  }
  var o = e.stateNode;
  return (
    null !== o &&
      "function" == typeof o.componentDidCatch &&
      (n.callback = function () {
        "function" != typeof i && (null === qc ? (qc = new Set([this])) : qc.add(this));
        var e = t.stack;
        this.componentDidCatch(t.value, { componentStack: null !== e ? e : "" });
      }),
    n
  );
}
function fl(e, t, n) {
  var i = e.pingCache;
  if (null === i) {
    i = e.pingCache = new hl();
    var r = new Set();
    i.set(t, r);
  } else void 0 === (r = i.get(t)) && ((r = new Set()), i.set(t, r));
  r.has(n) || (r.add(n), (e = kd.bind(null, e, t, n)), t.then(e, e));
}
function ml(e) {
  do {
    var t;
    if (((t = 13 === e.tag) && (t = null === (t = e.memoizedState) || null !== t.dehydrated), t))
      return e;
    e = e.return;
  } while (null !== e);
  return null;
}
function _l(e, t, n, i, r) {
  return 1 & e.mode
    ? ((e.flags |= 65536), (e.lanes = r), e)
    : (e === t
        ? (e.flags |= 65536)
        : ((e.flags |= 128),
          (n.flags |= 131072),
          (n.flags &= -52805),
          1 === n.tag &&
            (null === n.alternate ? (n.tag = 17) : (((t = Vs(-1, 1)).tag = 2), Ws(n, t, 1))),
          (n.lanes |= 1)),
      e);
}
var vl = we.ReactCurrentOwner,
  bl = !1;
function yl(e, t, n, i) {
  t.child = null === e ? Cs(t, null, n, i) : ws(t, e.child, n, i);
}
function xl(e, t, n, i, r) {
  n = n.render;
  var o = t.ref;
  return (
    Is(t, r),
    (i = _a(e, t, n, i, o, r)),
    (n = va()),
    null === e || bl
      ? (ss && n && ns(t), (t.flags |= 1), yl(e, t, i, r), t.child)
      : ((t.updateQueue = e.updateQueue), (t.flags &= -2053), (e.lanes &= ~r), Ul(e, t, r))
  );
}
function wl(e, t, n, i, r) {
  if (null === e) {
    var o = n.type;
    return "function" != typeof o ||
      Rd(o) ||
      void 0 !== o.defaultProps ||
      null !== n.compare ||
      void 0 !== n.defaultProps
      ? (((e = Md(n.type, null, i, t, t.mode, r)).ref = t.ref), (e.return = t), (t.child = e))
      : ((t.tag = 15), (t.type = o), Cl(e, t, o, i, r));
  }
  if (((o = e.child), 0 === (e.lanes & r))) {
    var s = o.memoizedProps;
    if ((n = null !== (n = n.compare) ? n : cr)(s, i) && e.ref === t.ref) return Ul(e, t, r);
  }
  return ((t.flags |= 1), ((e = Od(o, i)).ref = t.ref), (e.return = t), (t.child = e));
}
function Cl(e, t, n, i, r) {
  if (null !== e) {
    var o = e.memoizedProps;
    if (cr(o, i) && e.ref === t.ref) {
      if (((bl = !1), (t.pendingProps = i = o), 0 === (e.lanes & r)))
        return ((t.lanes = e.lanes), Ul(e, t, r));
      131072 & e.flags && (bl = !0);
    }
  }
  return El(e, t, n, i, r);
}
function Sl(e, t, n) {
  var i = t.pendingProps,
    r = i.children,
    o = null !== e ? e.memoizedState : null;
  if ("hidden" === i.mode)
    if (1 & t.mode) {
      if (!(1073741824 & n))
        return (
          (e = null !== o ? o.baseLanes | n : n),
          (t.lanes = t.childLanes = 1073741824),
          (t.memoizedState = { baseLanes: e, cachePool: null, transitions: null }),
          (t.updateQueue = null),
          Lo(Oc, Rc),
          (Rc |= e),
          null
        );
      ((t.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }),
        (i = null !== o ? o.baseLanes : n),
        Lo(Oc, Rc),
        (Rc |= i));
    } else
      ((t.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }),
        Lo(Oc, Rc),
        (Rc |= n));
  else
    (null !== o ? ((i = o.baseLanes | n), (t.memoizedState = null)) : (i = n),
      Lo(Oc, Rc),
      (Rc |= i));
  return (yl(e, t, r, n), t.child);
}
function kl(e, t) {
  var n = t.ref;
  ((null === e && null !== n) || (null !== e && e.ref !== n)) &&
    ((t.flags |= 512), (t.flags |= 2097152));
}
function El(e, t, n, i, r) {
  var o = Mo(n) ? Ro : To.current;
  return (
    (o = Oo(t, o)),
    Is(t, r),
    (n = _a(e, t, n, i, o, r)),
    (i = va()),
    null === e || bl
      ? (ss && i && ns(t), (t.flags |= 1), yl(e, t, n, r), t.child)
      : ((t.updateQueue = e.updateQueue), (t.flags &= -2053), (e.lanes &= ~r), Ul(e, t, r))
  );
}
function Nl(e, t, n, i, r) {
  if (Mo(n)) {
    var o = !0;
    Fo(t);
  } else o = !1;
  if ((Is(t, r), null === t.stateNode)) (zl(e, t), al(t, n, i), cl(t, n, i, r), (i = !0));
  else if (null === e) {
    var s = t.stateNode,
      a = t.memoizedProps;
    s.props = a;
    var l = s.context,
      c = n.contextType;
    "object" == typeof c && null !== c ? (c = Rs(c)) : (c = Oo(t, (c = Mo(n) ? Ro : To.current)));
    var d = n.getDerivedStateFromProps,
      u = "function" == typeof d || "function" == typeof s.getSnapshotBeforeUpdate;
    (u ||
      ("function" != typeof s.UNSAFE_componentWillReceiveProps &&
        "function" != typeof s.componentWillReceiveProps) ||
      ((a !== i || l !== c) && ll(t, s, i, c)),
      (js = !1));
    var h = t.memoizedState;
    ((s.state = h),
      Us(t, i, s, r),
      (l = t.memoizedState),
      a !== i || h !== l || Io.current || js
        ? ("function" == typeof d && (rl(t, n, d, i), (l = t.memoizedState)),
          (a = js || sl(t, n, a, i, h, l, c))
            ? (u ||
                ("function" != typeof s.UNSAFE_componentWillMount &&
                  "function" != typeof s.componentWillMount) ||
                ("function" == typeof s.componentWillMount && s.componentWillMount(),
                "function" == typeof s.UNSAFE_componentWillMount && s.UNSAFE_componentWillMount()),
              "function" == typeof s.componentDidMount && (t.flags |= 4194308))
            : ("function" == typeof s.componentDidMount && (t.flags |= 4194308),
              (t.memoizedProps = i),
              (t.memoizedState = l)),
          (s.props = i),
          (s.state = l),
          (s.context = c),
          (i = a))
        : ("function" == typeof s.componentDidMount && (t.flags |= 4194308), (i = !1)));
  } else {
    ((s = t.stateNode),
      Bs(e, t),
      (a = t.memoizedProps),
      (c = t.type === t.elementType ? a : il(t.type, a)),
      (s.props = c),
      (u = t.pendingProps),
      (h = s.context),
      "object" == typeof (l = n.contextType) && null !== l
        ? (l = Rs(l))
        : (l = Oo(t, (l = Mo(n) ? Ro : To.current))));
    var g = n.getDerivedStateFromProps;
    ((d = "function" == typeof g || "function" == typeof s.getSnapshotBeforeUpdate) ||
      ("function" != typeof s.UNSAFE_componentWillReceiveProps &&
        "function" != typeof s.componentWillReceiveProps) ||
      ((a !== u || h !== l) && ll(t, s, i, l)),
      (js = !1),
      (h = t.memoizedState),
      (s.state = h),
      Us(t, i, s, r));
    var p = t.memoizedState;
    a !== u || h !== p || Io.current || js
      ? ("function" == typeof g && (rl(t, n, g, i), (p = t.memoizedState)),
        (c = js || sl(t, n, c, i, h, p, l) || !1)
          ? (d ||
              ("function" != typeof s.UNSAFE_componentWillUpdate &&
                "function" != typeof s.componentWillUpdate) ||
              ("function" == typeof s.componentWillUpdate && s.componentWillUpdate(i, p, l),
              "function" == typeof s.UNSAFE_componentWillUpdate &&
                s.UNSAFE_componentWillUpdate(i, p, l)),
            "function" == typeof s.componentDidUpdate && (t.flags |= 4),
            "function" == typeof s.getSnapshotBeforeUpdate && (t.flags |= 1024))
          : ("function" != typeof s.componentDidUpdate ||
              (a === e.memoizedProps && h === e.memoizedState) ||
              (t.flags |= 4),
            "function" != typeof s.getSnapshotBeforeUpdate ||
              (a === e.memoizedProps && h === e.memoizedState) ||
              (t.flags |= 1024),
            (t.memoizedProps = i),
            (t.memoizedState = p)),
        (s.props = i),
        (s.state = p),
        (s.context = l),
        (i = c))
      : ("function" != typeof s.componentDidUpdate ||
          (a === e.memoizedProps && h === e.memoizedState) ||
          (t.flags |= 4),
        "function" != typeof s.getSnapshotBeforeUpdate ||
          (a === e.memoizedProps && h === e.memoizedState) ||
          (t.flags |= 1024),
        (i = !1));
  }
  return Ll(e, t, n, i, o, r);
}
function Ll(e, t, n, i, r, o) {
  kl(e, t);
  var s = !!(128 & t.flags);
  if (!i && !s) return (r && Bo(t, n, !1), Ul(e, t, o));
  ((i = t.stateNode), (vl.current = t));
  var a = s && "function" != typeof n.getDerivedStateFromError ? null : i.render();
  return (
    (t.flags |= 1),
    null !== e && s
      ? ((t.child = ws(t, e.child, null, o)), (t.child = ws(t, null, a, o)))
      : yl(e, t, a, o),
    (t.memoizedState = i.state),
    r && Bo(t, n, !0),
    t.child
  );
}
function Dl(e) {
  var t = e.stateNode;
  (t.pendingContext
    ? Po(0, t.pendingContext, t.pendingContext !== t.context)
    : t.context && Po(0, t.context, !1),
    Xs(e, t.containerInfo));
}
function Tl(e, t, n, i, r) {
  return (fs(), ms(r), (t.flags |= 256), yl(e, t, n, i), t.child);
}
var Il,
  Rl,
  Ol,
  Ml,
  Al = { dehydrated: null, treeContext: null, retryLane: 0 };
function Pl(e) {
  return { baseLanes: e, cachePool: null, transitions: null };
}
function jl(e, t, n) {
  var i,
    r = t.pendingProps,
    o = ta.current,
    s = !1,
    a = !!(128 & t.flags);
  if (
    ((i = a) || (i = (null === e || null !== e.memoizedState) && !!(2 & o)),
    i ? ((s = !0), (t.flags &= -129)) : (null !== e && null === e.memoizedState) || (o |= 1),
    Lo(ta, 1 & o),
    null === e)
  )
    return (
      us(t),
      null !== (e = t.memoizedState) && null !== (e = e.dehydrated)
        ? (1 & t.mode ? ("$!" === e.data ? (t.lanes = 8) : (t.lanes = 1073741824)) : (t.lanes = 1),
          null)
        : ((a = r.children),
          (e = r.fallback),
          s
            ? ((r = t.mode),
              (s = t.child),
              (a = { mode: "hidden", children: a }),
              1 & r || null === s
                ? (s = Pd(a, r, 0, null))
                : ((s.childLanes = 0), (s.pendingProps = a)),
              (e = Ad(e, r, n, null)),
              (s.return = t),
              (e.return = t),
              (s.sibling = e),
              (t.child = s),
              (t.child.memoizedState = Pl(n)),
              (t.memoizedState = Al),
              e)
            : Fl(t, a))
    );
  if (null !== (o = e.memoizedState) && null !== (i = o.dehydrated))
    return (function (e, t, n, i, r, o, s) {
      if (n)
        return 256 & t.flags
          ? ((t.flags &= -257), Bl(e, t, s, (i = ul(Error(ae(422))))))
          : null !== t.memoizedState
            ? ((t.child = e.child), (t.flags |= 128), null)
            : ((o = i.fallback),
              (r = t.mode),
              (i = Pd({ mode: "visible", children: i.children }, r, 0, null)),
              ((o = Ad(o, r, s, null)).flags |= 2),
              (i.return = t),
              (o.return = t),
              (i.sibling = o),
              (t.child = i),
              1 & t.mode && ws(t, e.child, null, s),
              (t.child.memoizedState = Pl(s)),
              (t.memoizedState = Al),
              o);
      if (!(1 & t.mode)) return Bl(e, t, s, null);
      if ("$!" === r.data) {
        if ((i = r.nextSibling && r.nextSibling.dataset)) var a = i.dgst;
        return ((i = a), Bl(e, t, s, (i = ul((o = Error(ae(419))), i, void 0))));
      }
      if (((a = 0 !== (s & e.childLanes)), bl || a)) {
        if (null !== (i = Dc)) {
          switch (s & -s) {
            case 4:
              r = 2;
              break;
            case 16:
              r = 8;
              break;
            case 64:
            case 128:
            case 256:
            case 512:
            case 1024:
            case 2048:
            case 4096:
            case 8192:
            case 16384:
            case 32768:
            case 65536:
            case 131072:
            case 262144:
            case 524288:
            case 1048576:
            case 2097152:
            case 4194304:
            case 8388608:
            case 16777216:
            case 33554432:
            case 67108864:
              r = 32;
              break;
            case 536870912:
              r = 268435456;
              break;
            default:
              r = 0;
          }
          0 !== (r = 0 !== (r & (i.suspendedLanes | s)) ? 0 : r) &&
            r !== o.retryLane &&
            ((o.retryLane = r), Ps(e, r), nd(i, e, r, -1));
        }
        return (fd(), Bl(e, t, s, (i = ul(Error(ae(421))))));
      }
      return "$?" === r.data
        ? ((t.flags |= 128), (t.child = e.child), (t = Nd.bind(null, e)), (r._reactRetry = t), null)
        : ((e = o.treeContext),
          (os = uo(r.nextSibling)),
          (rs = t),
          (ss = !0),
          (as = null),
          null !== e &&
            ((Zo[Yo++] = Qo),
            (Zo[Yo++] = Jo),
            (Zo[Yo++] = Xo),
            (Qo = e.id),
            (Jo = e.overflow),
            (Xo = t)),
          (t = Fl(t, i.children)),
          (t.flags |= 4096),
          t);
    })(e, t, a, r, i, o, n);
  if (s) {
    ((s = r.fallback), (a = t.mode), (i = (o = e.child).sibling));
    var l = { mode: "hidden", children: r.children };
    return (
      1 & a || t.child === o
        ? ((r = Od(o, l)).subtreeFlags = 14680064 & o.subtreeFlags)
        : (((r = t.child).childLanes = 0), (r.pendingProps = l), (t.deletions = null)),
      null !== i ? (s = Od(i, s)) : ((s = Ad(s, a, n, null)).flags |= 2),
      (s.return = t),
      (r.return = t),
      (r.sibling = s),
      (t.child = r),
      (r = s),
      (s = t.child),
      (a =
        null === (a = e.child.memoizedState)
          ? Pl(n)
          : { baseLanes: a.baseLanes | n, cachePool: null, transitions: a.transitions }),
      (s.memoizedState = a),
      (s.childLanes = e.childLanes & ~n),
      (t.memoizedState = Al),
      r
    );
  }
  return (
    (e = (s = e.child).sibling),
    (r = Od(s, { mode: "visible", children: r.children })),
    !(1 & t.mode) && (r.lanes = n),
    (r.return = t),
    (r.sibling = null),
    null !== e && (null === (n = t.deletions) ? ((t.deletions = [e]), (t.flags |= 16)) : n.push(e)),
    (t.child = r),
    (t.memoizedState = null),
    r
  );
}
function Fl(e, t) {
  return (((t = Pd({ mode: "visible", children: t }, e.mode, 0, null)).return = e), (e.child = t));
}
function Bl(e, t, n, i) {
  return (
    null !== i && ms(i),
    ws(t, e.child, null, n),
    ((e = Fl(t, t.pendingProps.children)).flags |= 2),
    (t.memoizedState = null),
    e
  );
}
function Vl(e, t, n) {
  e.lanes |= t;
  var i = e.alternate;
  (null !== i && (i.lanes |= t), Ts(e.return, t, n));
}
function Wl(e, t, n, i, r) {
  var o = e.memoizedState;
  null === o
    ? (e.memoizedState = {
        isBackwards: t,
        rendering: null,
        renderingStartTime: 0,
        last: i,
        tail: n,
        tailMode: r,
      })
    : ((o.isBackwards = t),
      (o.rendering = null),
      (o.renderingStartTime = 0),
      (o.last = i),
      (o.tail = n),
      (o.tailMode = r));
}
function Hl(e, t, n) {
  var i = t.pendingProps,
    r = i.revealOrder,
    o = i.tail;
  if ((yl(e, t, i.children, n), 2 & (i = ta.current))) ((i = (1 & i) | 2), (t.flags |= 128));
  else {
    if (null !== e && 128 & e.flags)
      e: for (e = t.child; null !== e; ) {
        if (13 === e.tag) null !== e.memoizedState && Vl(e, n, t);
        else if (19 === e.tag) Vl(e, n, t);
        else if (null !== e.child) {
          ((e.child.return = e), (e = e.child));
          continue;
        }
        if (e === t) break e;
        for (; null === e.sibling; ) {
          if (null === e.return || e.return === t) break e;
          e = e.return;
        }
        ((e.sibling.return = e.return), (e = e.sibling));
      }
    i &= 1;
  }
  if ((Lo(ta, i), 1 & t.mode))
    switch (r) {
      case "forwards":
        for (n = t.child, r = null; null !== n; )
          (null !== (e = n.alternate) && null === na(e) && (r = n), (n = n.sibling));
        (null === (n = r)
          ? ((r = t.child), (t.child = null))
          : ((r = n.sibling), (n.sibling = null)),
          Wl(t, !1, r, n, o));
        break;
      case "backwards":
        for (n = null, r = t.child, t.child = null; null !== r; ) {
          if (null !== (e = r.alternate) && null === na(e)) {
            t.child = r;
            break;
          }
          ((e = r.sibling), (r.sibling = n), (n = r), (r = e));
        }
        Wl(t, !0, n, null, o);
        break;
      case "together":
        Wl(t, !1, null, null, void 0);
        break;
      default:
        t.memoizedState = null;
    }
  else t.memoizedState = null;
  return t.child;
}
function zl(e, t) {
  !(1 & t.mode) && null !== e && ((e.alternate = null), (t.alternate = null), (t.flags |= 2));
}
function Ul(e, t, n) {
  if ((null !== e && (t.dependencies = e.dependencies), (Pc |= t.lanes), 0 === (n & t.childLanes)))
    return null;
  if (null !== e && t.child !== e.child) throw Error(ae(153));
  if (null !== t.child) {
    for (n = Od((e = t.child), e.pendingProps), t.child = n, n.return = t; null !== e.sibling; )
      ((e = e.sibling), ((n = n.sibling = Od(e, e.pendingProps)).return = t));
    n.sibling = null;
  }
  return t.child;
}
function $l(e, t) {
  if (!ss)
    switch (e.tailMode) {
      case "hidden":
        t = e.tail;
        for (var n = null; null !== t; ) (null !== t.alternate && (n = t), (t = t.sibling));
        null === n ? (e.tail = null) : (n.sibling = null);
        break;
      case "collapsed":
        n = e.tail;
        for (var i = null; null !== n; ) (null !== n.alternate && (i = n), (n = n.sibling));
        null === i
          ? t || null === e.tail
            ? (e.tail = null)
            : (e.tail.sibling = null)
          : (i.sibling = null);
    }
}
function ql(e) {
  var t = null !== e.alternate && e.alternate.child === e.child,
    n = 0,
    i = 0;
  if (t)
    for (var r = e.child; null !== r; )
      ((n |= r.lanes | r.childLanes),
        (i |= 14680064 & r.subtreeFlags),
        (i |= 14680064 & r.flags),
        (r.return = e),
        (r = r.sibling));
  else
    for (r = e.child; null !== r; )
      ((n |= r.lanes | r.childLanes),
        (i |= r.subtreeFlags),
        (i |= r.flags),
        (r.return = e),
        (r = r.sibling));
  return ((e.subtreeFlags |= i), (e.childLanes = n), t);
}
function Kl(e, t, n) {
  var i = t.pendingProps;
  switch ((is(t), t.tag)) {
    case 2:
    case 16:
    case 15:
    case 0:
    case 11:
    case 7:
    case 8:
    case 12:
    case 9:
    case 14:
      return (ql(t), null);
    case 1:
    case 17:
      return (Mo(t.type) && Ao(), ql(t), null);
    case 3:
      return (
        (i = t.stateNode),
        Qs(),
        No(Io),
        No(To),
        ra(),
        i.pendingContext && ((i.context = i.pendingContext), (i.pendingContext = null)),
        (null !== e && null !== e.child) ||
          (gs(t)
            ? (t.flags |= 4)
            : null === e ||
              (e.memoizedState.isDehydrated && !(256 & t.flags)) ||
              ((t.flags |= 1024), null !== as && (sd(as), (as = null)))),
        Rl(e, t),
        ql(t),
        null
      );
    case 5:
      ea(t);
      var r = Ys(Zs.current);
      if (((n = t.type), null !== e && null != t.stateNode))
        (Ol(e, t, n, i, r), e.ref !== t.ref && ((t.flags |= 512), (t.flags |= 2097152)));
      else {
        if (!i) {
          if (null === t.stateNode) throw Error(ae(166));
          return (ql(t), null);
        }
        if (((e = Ys(Ks.current)), gs(t))) {
          ((i = t.stateNode), (n = t.type));
          var o = t.memoizedProps;
          switch (((i[po] = t), (i[fo] = o), (e = !!(1 & t.mode)), n)) {
            case "dialog":
              (Vr("cancel", i), Vr("close", i));
              break;
            case "iframe":
            case "object":
            case "embed":
              Vr("load", i);
              break;
            case "video":
            case "audio":
              for (r = 0; r < Pr.length; r++) Vr(Pr[r], i);
              break;
            case "source":
              Vr("error", i);
              break;
            case "img":
            case "image":
            case "link":
              (Vr("error", i), Vr("load", i));
              break;
            case "details":
              Vr("toggle", i);
              break;
            case "input":
              (Qe(i, o), Vr("invalid", i));
              break;
            case "select":
              ((i._wrapperState = { wasMultiple: !!o.multiple }), Vr("invalid", i));
              break;
            case "textarea":
              (st(i, o), Vr("invalid", i));
          }
          for (var s in (bt(n, o), (r = null), o))
            if (o.hasOwnProperty(s)) {
              var a = o[s];
              "children" === s
                ? "string" == typeof a
                  ? i.textContent !== a &&
                    (!0 !== o.suppressHydrationWarning && Jr(i.textContent, a, e),
                    (r = ["children", a]))
                  : "number" == typeof a &&
                    i.textContent !== "" + a &&
                    (!0 !== o.suppressHydrationWarning && Jr(i.textContent, a, e),
                    (r = ["children", "" + a]))
                : ce.hasOwnProperty(s) && null != a && "onScroll" === s && Vr("scroll", i);
            }
          switch (n) {
            case "input":
              (Ge(i), tt(i, o, !0));
              break;
            case "textarea":
              (Ge(i), lt(i));
              break;
            case "select":
            case "option":
              break;
            default:
              "function" == typeof o.onClick && (i.onclick = eo);
          }
          ((i = r), (t.updateQueue = i), null !== i && (t.flags |= 4));
        } else {
          ((s = 9 === r.nodeType ? r : r.ownerDocument),
            "http://www.w3.org/1999/xhtml" === e && (e = ct(n)),
            "http://www.w3.org/1999/xhtml" === e
              ? "script" === n
                ? (((e = s.createElement("div")).innerHTML = "<script><\/script>"),
                  (e = e.removeChild(e.firstChild)))
                : "string" == typeof i.is
                  ? (e = s.createElement(n, { is: i.is }))
                  : ((e = s.createElement(n)),
                    "select" === n &&
                      ((s = e), i.multiple ? (s.multiple = !0) : i.size && (s.size = i.size)))
              : (e = s.createElementNS(e, n)),
            (e[po] = t),
            (e[fo] = i),
            Il(e, t, !1, !1),
            (t.stateNode = e));
          e: {
            switch (((s = yt(n, i)), n)) {
              case "dialog":
                (Vr("cancel", e), Vr("close", e), (r = i));
                break;
              case "iframe":
              case "object":
              case "embed":
                (Vr("load", e), (r = i));
                break;
              case "video":
              case "audio":
                for (r = 0; r < Pr.length; r++) Vr(Pr[r], e);
                r = i;
                break;
              case "source":
                (Vr("error", e), (r = i));
                break;
              case "img":
              case "image":
              case "link":
                (Vr("error", e), Vr("load", e), (r = i));
                break;
              case "details":
                (Vr("toggle", e), (r = i));
                break;
              case "input":
                (Qe(e, i), (r = Xe(e, i)), Vr("invalid", e));
                break;
              case "option":
              default:
                r = i;
                break;
              case "select":
                ((e._wrapperState = { wasMultiple: !!i.multiple }),
                  (r = Be({}, i, { value: void 0 })),
                  Vr("invalid", e));
                break;
              case "textarea":
                (st(e, i), (r = ot(e, i)), Vr("invalid", e));
            }
            for (o in (bt(n, r), (a = r)))
              if (a.hasOwnProperty(o)) {
                var l = a[o];
                "style" === o
                  ? _t(e, l)
                  : "dangerouslySetInnerHTML" === o
                    ? null != (l = l ? l.__html : void 0) && ht(e, l)
                    : "children" === o
                      ? "string" == typeof l
                        ? ("textarea" !== n || "" !== l) && gt(e, l)
                        : "number" == typeof l && gt(e, "" + l)
                      : "suppressContentEditableWarning" !== o &&
                        "suppressHydrationWarning" !== o &&
                        "autoFocus" !== o &&
                        (ce.hasOwnProperty(o)
                          ? null != l && "onScroll" === o && Vr("scroll", e)
                          : null != l && xe(e, o, l, s));
              }
            switch (n) {
              case "input":
                (Ge(e), tt(e, i, !1));
                break;
              case "textarea":
                (Ge(e), lt(e));
                break;
              case "option":
                null != i.value && e.setAttribute("value", "" + qe(i.value));
                break;
              case "select":
                ((e.multiple = !!i.multiple),
                  null != (o = i.value)
                    ? rt(e, !!i.multiple, o, !1)
                    : null != i.defaultValue && rt(e, !!i.multiple, i.defaultValue, !0));
                break;
              default:
                "function" == typeof r.onClick && (e.onclick = eo);
            }
            switch (n) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                i = !!i.autoFocus;
                break e;
              case "img":
                i = !0;
                break e;
              default:
                i = !1;
            }
          }
          i && (t.flags |= 4);
        }
        null !== t.ref && ((t.flags |= 512), (t.flags |= 2097152));
      }
      return (ql(t), null);
    case 6:
      if (e && null != t.stateNode) Ml(e, t, e.memoizedProps, i);
      else {
        if ("string" != typeof i && null === t.stateNode) throw Error(ae(166));
        if (((n = Ys(Zs.current)), Ys(Ks.current), gs(t))) {
          if (
            ((i = t.stateNode),
            (n = t.memoizedProps),
            (i[po] = t),
            (o = i.nodeValue !== n) && null !== (e = rs))
          )
            switch (e.tag) {
              case 3:
                Jr(i.nodeValue, n, !!(1 & e.mode));
                break;
              case 5:
                !0 !== e.memoizedProps.suppressHydrationWarning &&
                  Jr(i.nodeValue, n, !!(1 & e.mode));
            }
          o && (t.flags |= 4);
        } else
          (((i = (9 === n.nodeType ? n : n.ownerDocument).createTextNode(i))[po] = t),
            (t.stateNode = i));
      }
      return (ql(t), null);
    case 13:
      if (
        (No(ta),
        (i = t.memoizedState),
        null === e || (null !== e.memoizedState && null !== e.memoizedState.dehydrated))
      ) {
        if (ss && null !== os && 1 & t.mode && !(128 & t.flags))
          (ps(), fs(), (t.flags |= 98560), (o = !1));
        else if (((o = gs(t)), null !== i && null !== i.dehydrated)) {
          if (null === e) {
            if (!o) throw Error(ae(318));
            if (!(o = null !== (o = t.memoizedState) ? o.dehydrated : null)) throw Error(ae(317));
            o[po] = t;
          } else (fs(), !(128 & t.flags) && (t.memoizedState = null), (t.flags |= 4));
          (ql(t), (o = !1));
        } else (null !== as && (sd(as), (as = null)), (o = !0));
        if (!o) return 65536 & t.flags ? t : null;
      }
      return 128 & t.flags
        ? ((t.lanes = n), t)
        : ((i = null !== i) !== (null !== e && null !== e.memoizedState) &&
            i &&
            ((t.child.flags |= 8192),
            1 & t.mode && (null === e || 1 & ta.current ? 0 === Mc && (Mc = 3) : fd())),
          null !== t.updateQueue && (t.flags |= 4),
          ql(t),
          null);
    case 4:
      return (Qs(), Rl(e, t), null === e && zr(t.stateNode.containerInfo), ql(t), null);
    case 10:
      return (Ds(t.type._context), ql(t), null);
    case 19:
      if ((No(ta), null === (o = t.memoizedState))) return (ql(t), null);
      if (((i = !!(128 & t.flags)), null === (s = o.rendering)))
        if (i) $l(o, !1);
        else {
          if (0 !== Mc || (null !== e && 128 & e.flags))
            for (e = t.child; null !== e; ) {
              if (null !== (s = na(e))) {
                for (
                  t.flags |= 128,
                    $l(o, !1),
                    null !== (i = s.updateQueue) && ((t.updateQueue = i), (t.flags |= 4)),
                    t.subtreeFlags = 0,
                    i = n,
                    n = t.child;
                  null !== n;
                )
                  ((e = i),
                    ((o = n).flags &= 14680066),
                    null === (s = o.alternate)
                      ? ((o.childLanes = 0),
                        (o.lanes = e),
                        (o.child = null),
                        (o.subtreeFlags = 0),
                        (o.memoizedProps = null),
                        (o.memoizedState = null),
                        (o.updateQueue = null),
                        (o.dependencies = null),
                        (o.stateNode = null))
                      : ((o.childLanes = s.childLanes),
                        (o.lanes = s.lanes),
                        (o.child = s.child),
                        (o.subtreeFlags = 0),
                        (o.deletions = null),
                        (o.memoizedProps = s.memoizedProps),
                        (o.memoizedState = s.memoizedState),
                        (o.updateQueue = s.updateQueue),
                        (o.type = s.type),
                        (e = s.dependencies),
                        (o.dependencies =
                          null === e ? null : { lanes: e.lanes, firstContext: e.firstContext })),
                    (n = n.sibling));
                return (Lo(ta, (1 & ta.current) | 2), t.child);
              }
              e = e.sibling;
            }
          null !== o.tail &&
            Qt() > Hc &&
            ((t.flags |= 128), (i = !0), $l(o, !1), (t.lanes = 4194304));
        }
      else {
        if (!i)
          if (null !== (e = na(s))) {
            if (
              ((t.flags |= 128),
              (i = !0),
              null !== (n = e.updateQueue) && ((t.updateQueue = n), (t.flags |= 4)),
              $l(o, !0),
              null === o.tail && "hidden" === o.tailMode && !s.alternate && !ss)
            )
              return (ql(t), null);
          } else
            2 * Qt() - o.renderingStartTime > Hc &&
              1073741824 !== n &&
              ((t.flags |= 128), (i = !0), $l(o, !1), (t.lanes = 4194304));
        o.isBackwards
          ? ((s.sibling = t.child), (t.child = s))
          : (null !== (n = o.last) ? (n.sibling = s) : (t.child = s), (o.last = s));
      }
      return null !== o.tail
        ? ((t = o.tail),
          (o.rendering = t),
          (o.tail = t.sibling),
          (o.renderingStartTime = Qt()),
          (t.sibling = null),
          (n = ta.current),
          Lo(ta, i ? (1 & n) | 2 : 1 & n),
          t)
        : (ql(t), null);
    case 22:
    case 23:
      return (
        ud(),
        (i = null !== t.memoizedState),
        null !== e && (null !== e.memoizedState) !== i && (t.flags |= 8192),
        i && 1 & t.mode
          ? !!(1073741824 & Rc) && (ql(t), 6 & t.subtreeFlags && (t.flags |= 8192))
          : ql(t),
        null
      );
    case 24:
    case 25:
      return null;
  }
  throw Error(ae(156, t.tag));
}
function Gl(e, t) {
  switch ((is(t), t.tag)) {
    case 1:
      return (
        Mo(t.type) && Ao(),
        65536 & (e = t.flags) ? ((t.flags = (-65537 & e) | 128), t) : null
      );
    case 3:
      return (
        Qs(),
        No(Io),
        No(To),
        ra(),
        65536 & (e = t.flags) && !(128 & e) ? ((t.flags = (-65537 & e) | 128), t) : null
      );
    case 5:
      return (ea(t), null);
    case 13:
      if ((No(ta), null !== (e = t.memoizedState) && null !== e.dehydrated)) {
        if (null === t.alternate) throw Error(ae(340));
        fs();
      }
      return 65536 & (e = t.flags) ? ((t.flags = (-65537 & e) | 128), t) : null;
    case 19:
      return (No(ta), null);
    case 4:
      return (Qs(), null);
    case 10:
      return (Ds(t.type._context), null);
    case 22:
    case 23:
      return (ud(), null);
    default:
      return null;
  }
}
((Il = function (e, t) {
  for (var n = t.child; null !== n; ) {
    if (5 === n.tag || 6 === n.tag) e.appendChild(n.stateNode);
    else if (4 !== n.tag && null !== n.child) {
      ((n.child.return = n), (n = n.child));
      continue;
    }
    if (n === t) break;
    for (; null === n.sibling; ) {
      if (null === n.return || n.return === t) return;
      n = n.return;
    }
    ((n.sibling.return = n.return), (n = n.sibling));
  }
}),
  (Rl = function () {}),
  (Ol = function (e, t, n, i) {
    var r = e.memoizedProps;
    if (r !== i) {
      ((e = t.stateNode), Ys(Ks.current));
      var o,
        s = null;
      switch (n) {
        case "input":
          ((r = Xe(e, r)), (i = Xe(e, i)), (s = []));
          break;
        case "select":
          ((r = Be({}, r, { value: void 0 })), (i = Be({}, i, { value: void 0 })), (s = []));
          break;
        case "textarea":
          ((r = ot(e, r)), (i = ot(e, i)), (s = []));
          break;
        default:
          "function" != typeof r.onClick && "function" == typeof i.onClick && (e.onclick = eo);
      }
      for (c in (bt(n, i), (n = null), r))
        if (!i.hasOwnProperty(c) && r.hasOwnProperty(c) && null != r[c])
          if ("style" === c) {
            var a = r[c];
            for (o in a) a.hasOwnProperty(o) && (n || (n = {}), (n[o] = ""));
          } else
            "dangerouslySetInnerHTML" !== c &&
              "children" !== c &&
              "suppressContentEditableWarning" !== c &&
              "suppressHydrationWarning" !== c &&
              "autoFocus" !== c &&
              (ce.hasOwnProperty(c) ? s || (s = []) : (s = s || []).push(c, null));
      for (c in i) {
        var l = i[c];
        if (
          ((a = null != r ? r[c] : void 0),
          i.hasOwnProperty(c) && l !== a && (null != l || null != a))
        )
          if ("style" === c)
            if (a) {
              for (o in a)
                !a.hasOwnProperty(o) || (l && l.hasOwnProperty(o)) || (n || (n = {}), (n[o] = ""));
              for (o in l) l.hasOwnProperty(o) && a[o] !== l[o] && (n || (n = {}), (n[o] = l[o]));
            } else (n || (s || (s = []), s.push(c, n)), (n = l));
          else
            "dangerouslySetInnerHTML" === c
              ? ((l = l ? l.__html : void 0),
                (a = a ? a.__html : void 0),
                null != l && a !== l && (s = s || []).push(c, l))
              : "children" === c
                ? ("string" != typeof l && "number" != typeof l) || (s = s || []).push(c, "" + l)
                : "suppressContentEditableWarning" !== c &&
                  "suppressHydrationWarning" !== c &&
                  (ce.hasOwnProperty(c)
                    ? (null != l && "onScroll" === c && Vr("scroll", e), s || a === l || (s = []))
                    : (s = s || []).push(c, l));
      }
      n && (s = s || []).push("style", n);
      var c = s;
      (t.updateQueue = c) && (t.flags |= 4);
    }
  }),
  (Ml = function (e, t, n, i) {
    n !== i && (t.flags |= 4);
  }));
var Zl = !1,
  Yl = !1,
  Xl = "function" == typeof WeakSet ? WeakSet : Set,
  Ql = null;
function Jl(e, t) {
  var n = e.ref;
  if (null !== n)
    if ("function" == typeof n)
      try {
        n(null);
      } catch (opt) {
        Sd(e, t, opt);
      }
    else n.current = null;
}
function ec(e, t, n) {
  try {
    n();
  } catch (opt) {
    Sd(e, t, opt);
  }
}
var tc = !1;
function nc(e, t, n) {
  var i = t.updateQueue;
  if (null !== (i = null !== i ? i.lastEffect : null)) {
    var r = (i = i.next);
    do {
      if ((r.tag & e) === e) {
        var o = r.destroy;
        ((r.destroy = void 0), void 0 !== o && ec(t, n, o));
      }
      r = r.next;
    } while (r !== i);
  }
}
function ic(e, t) {
  if (null !== (t = null !== (t = t.updateQueue) ? t.lastEffect : null)) {
    var n = (t = t.next);
    do {
      if ((n.tag & e) === e) {
        var i = n.create;
        n.destroy = i();
      }
      n = n.next;
    } while (n !== t);
  }
}
function rc(e) {
  var t = e.ref;
  if (null !== t) {
    var n = e.stateNode;
    (e.tag, (e = n), "function" == typeof t ? t(e) : (t.current = e));
  }
}
function oc(e) {
  var t = e.alternate;
  (null !== t && ((e.alternate = null), oc(t)),
    (e.child = null),
    (e.deletions = null),
    (e.sibling = null),
    5 === e.tag &&
      null !== (t = e.stateNode) &&
      (delete t[po], delete t[fo], delete t[_o], delete t[vo], delete t[bo]),
    (e.stateNode = null),
    (e.return = null),
    (e.dependencies = null),
    (e.memoizedProps = null),
    (e.memoizedState = null),
    (e.pendingProps = null),
    (e.stateNode = null),
    (e.updateQueue = null));
}
function sc(e) {
  return 5 === e.tag || 3 === e.tag || 4 === e.tag;
}
function ac(e) {
  e: for (;;) {
    for (; null === e.sibling; ) {
      if (null === e.return || sc(e.return)) return null;
      e = e.return;
    }
    for (e.sibling.return = e.return, e = e.sibling; 5 !== e.tag && 6 !== e.tag && 18 !== e.tag; ) {
      if (2 & e.flags) continue e;
      if (null === e.child || 4 === e.tag) continue e;
      ((e.child.return = e), (e = e.child));
    }
    if (!(2 & e.flags)) return e.stateNode;
  }
}
function lc(e, t, n) {
  var i = e.tag;
  if (5 === i || 6 === i)
    ((e = e.stateNode),
      t
        ? 8 === n.nodeType
          ? n.parentNode.insertBefore(e, t)
          : n.insertBefore(e, t)
        : (8 === n.nodeType ? (t = n.parentNode).insertBefore(e, n) : (t = n).appendChild(e),
          null != (n = n._reactRootContainer) || null !== t.onclick || (t.onclick = eo)));
  else if (4 !== i && null !== (e = e.child))
    for (lc(e, t, n), e = e.sibling; null !== e; ) (lc(e, t, n), (e = e.sibling));
}
function cc(e, t, n) {
  var i = e.tag;
  if (5 === i || 6 === i) ((e = e.stateNode), t ? n.insertBefore(e, t) : n.appendChild(e));
  else if (4 !== i && null !== (e = e.child))
    for (cc(e, t, n), e = e.sibling; null !== e; ) (cc(e, t, n), (e = e.sibling));
}
var dc = null,
  uc = !1;
function hc(e, t, n) {
  for (n = n.child; null !== n; ) (gc(e, t, n), (n = n.sibling));
}
function gc(e, t, n) {
  if (an && "function" == typeof an.onCommitFiberUnmount)
    try {
      an.onCommitFiberUnmount(sn, n);
    } catch (cpt) {}
  switch (n.tag) {
    case 5:
      Yl || Jl(n, t);
    case 6:
      var i = dc,
        r = uc;
      ((dc = null),
        hc(e, t, n),
        (uc = r),
        null !== (dc = i) &&
          (uc
            ? ((e = dc),
              (n = n.stateNode),
              8 === e.nodeType ? e.parentNode.removeChild(n) : e.removeChild(n))
            : dc.removeChild(n.stateNode)));
      break;
    case 18:
      null !== dc &&
        (uc
          ? ((e = dc),
            (n = n.stateNode),
            8 === e.nodeType ? co(e.parentNode, n) : 1 === e.nodeType && co(e, n),
            Un(e))
          : co(dc, n.stateNode));
      break;
    case 4:
      ((i = dc),
        (r = uc),
        (dc = n.stateNode.containerInfo),
        (uc = !0),
        hc(e, t, n),
        (dc = i),
        (uc = r));
      break;
    case 0:
    case 11:
    case 14:
    case 15:
      if (!Yl && null !== (i = n.updateQueue) && null !== (i = i.lastEffect)) {
        r = i = i.next;
        do {
          var o = r,
            s = o.destroy;
          ((o = o.tag), void 0 !== s && (2 & o || 4 & o) && ec(n, t, s), (r = r.next));
        } while (r !== i);
      }
      hc(e, t, n);
      break;
    case 1:
      if (!Yl && (Jl(n, t), "function" == typeof (i = n.stateNode).componentWillUnmount))
        try {
          ((i.props = n.memoizedProps), (i.state = n.memoizedState), i.componentWillUnmount());
        } catch (cpt) {
          Sd(n, t, cpt);
        }
      hc(e, t, n);
      break;
    case 21:
      hc(e, t, n);
      break;
    case 22:
      1 & n.mode
        ? ((Yl = (i = Yl) || null !== n.memoizedState), hc(e, t, n), (Yl = i))
        : hc(e, t, n);
      break;
    default:
      hc(e, t, n);
  }
}
function pc(e) {
  var t = e.updateQueue;
  if (null !== t) {
    e.updateQueue = null;
    var n = e.stateNode;
    (null === n && (n = e.stateNode = new Xl()),
      t.forEach(function (t) {
        var i = Ld.bind(null, e, t);
        n.has(t) || (n.add(t), t.then(i, i));
      }));
  }
}
function fc(e, t) {
  var n = t.deletions;
  if (null !== n)
    for (var i = 0; i < n.length; i++) {
      var r = n[i];
      try {
        var o = e,
          s = t,
          a = s;
        e: for (; null !== a; ) {
          switch (a.tag) {
            case 5:
              ((dc = a.stateNode), (uc = !1));
              break e;
            case 3:
            case 4:
              ((dc = a.stateNode.containerInfo), (uc = !0));
              break e;
          }
          a = a.return;
        }
        if (null === dc) throw Error(ae(160));
        (gc(o, s, r), (dc = null), (uc = !1));
        var l = r.alternate;
        (null !== l && (l.return = null), (r.return = null));
      } catch (upt) {
        Sd(r, t, upt);
      }
    }
  if (12854 & t.subtreeFlags) for (t = t.child; null !== t; ) (mc(t, e), (t = t.sibling));
}
function mc(e, t) {
  var n = e.alternate,
    i = e.flags;
  switch (e.tag) {
    case 0:
    case 11:
    case 14:
    case 15:
      if ((fc(t, e), _c(e), 4 & i)) {
        try {
          (nc(3, e, e.return), ic(3, e));
        } catch (mpt) {
          Sd(e, e.return, mpt);
        }
        try {
          nc(5, e, e.return);
        } catch (mpt) {
          Sd(e, e.return, mpt);
        }
      }
      break;
    case 1:
      (fc(t, e), _c(e), 512 & i && null !== n && Jl(n, n.return));
      break;
    case 5:
      if ((fc(t, e), _c(e), 512 & i && null !== n && Jl(n, n.return), 32 & e.flags)) {
        var r = e.stateNode;
        try {
          gt(r, "");
        } catch (mpt) {
          Sd(e, e.return, mpt);
        }
      }
      if (4 & i && null != (r = e.stateNode)) {
        var o = e.memoizedProps,
          s = null !== n ? n.memoizedProps : o,
          a = e.type,
          l = e.updateQueue;
        if (((e.updateQueue = null), null !== l))
          try {
            ("input" === a && "radio" === o.type && null != o.name && Je(r, o), yt(a, s));
            var c = yt(a, o);
            for (s = 0; s < l.length; s += 2) {
              var d = l[s],
                u = l[s + 1];
              "style" === d
                ? _t(r, u)
                : "dangerouslySetInnerHTML" === d
                  ? ht(r, u)
                  : "children" === d
                    ? gt(r, u)
                    : xe(r, d, u, c);
            }
            switch (a) {
              case "input":
                et(r, o);
                break;
              case "textarea":
                at(r, o);
                break;
              case "select":
                var h = r._wrapperState.wasMultiple;
                r._wrapperState.wasMultiple = !!o.multiple;
                var g = o.value;
                null != g
                  ? rt(r, !!o.multiple, g, !1)
                  : h !== !!o.multiple &&
                    (null != o.defaultValue
                      ? rt(r, !!o.multiple, o.defaultValue, !0)
                      : rt(r, !!o.multiple, o.multiple ? [] : "", !1));
            }
            r[fo] = o;
          } catch (mpt) {
            Sd(e, e.return, mpt);
          }
      }
      break;
    case 6:
      if ((fc(t, e), _c(e), 4 & i)) {
        if (null === e.stateNode) throw Error(ae(162));
        ((r = e.stateNode), (o = e.memoizedProps));
        try {
          r.nodeValue = o;
        } catch (mpt) {
          Sd(e, e.return, mpt);
        }
      }
      break;
    case 3:
      if ((fc(t, e), _c(e), 4 & i && null !== n && n.memoizedState.isDehydrated))
        try {
          Un(t.containerInfo);
        } catch (mpt) {
          Sd(e, e.return, mpt);
        }
      break;
    case 4:
    default:
      (fc(t, e), _c(e));
      break;
    case 13:
      (fc(t, e),
        _c(e),
        8192 & (r = e.child).flags &&
          ((o = null !== r.memoizedState),
          (r.stateNode.isHidden = o),
          !o || (null !== r.alternate && null !== r.alternate.memoizedState) || (Wc = Qt())),
        4 & i && pc(e));
      break;
    case 22:
      if (
        ((d = null !== n && null !== n.memoizedState),
        1 & e.mode ? ((Yl = (c = Yl) || d), fc(t, e), (Yl = c)) : fc(t, e),
        _c(e),
        8192 & i)
      ) {
        if (((c = null !== e.memoizedState), (e.stateNode.isHidden = c) && !d && 1 & e.mode))
          for (Ql = e, d = e.child; null !== d; ) {
            for (u = Ql = d; null !== Ql; ) {
              switch (((g = (h = Ql).child), h.tag)) {
                case 0:
                case 11:
                case 14:
                case 15:
                  nc(4, h, h.return);
                  break;
                case 1:
                  Jl(h, h.return);
                  var p = h.stateNode;
                  if ("function" == typeof p.componentWillUnmount) {
                    ((i = h), (n = h.return));
                    try {
                      ((t = i),
                        (p.props = t.memoizedProps),
                        (p.state = t.memoizedState),
                        p.componentWillUnmount());
                    } catch (mpt) {
                      Sd(i, n, mpt);
                    }
                  }
                  break;
                case 5:
                  Jl(h, h.return);
                  break;
                case 22:
                  if (null !== h.memoizedState) {
                    xc(u);
                    continue;
                  }
              }
              null !== g ? ((g.return = h), (Ql = g)) : xc(u);
            }
            d = d.sibling;
          }
        e: for (d = null, u = e; ; ) {
          if (5 === u.tag) {
            if (null === d) {
              d = u;
              try {
                ((r = u.stateNode),
                  c
                    ? "function" == typeof (o = r.style).setProperty
                      ? o.setProperty("display", "none", "important")
                      : (o.display = "none")
                    : ((a = u.stateNode),
                      (s =
                        null != (l = u.memoizedProps.style) && l.hasOwnProperty("display")
                          ? l.display
                          : null),
                      (a.style.display = mt("display", s))));
              } catch (mpt) {
                Sd(e, e.return, mpt);
              }
            }
          } else if (6 === u.tag) {
            if (null === d)
              try {
                u.stateNode.nodeValue = c ? "" : u.memoizedProps;
              } catch (mpt) {
                Sd(e, e.return, mpt);
              }
          } else if (
            ((22 !== u.tag && 23 !== u.tag) || null === u.memoizedState || u === e) &&
            null !== u.child
          ) {
            ((u.child.return = u), (u = u.child));
            continue;
          }
          if (u === e) break e;
          for (; null === u.sibling; ) {
            if (null === u.return || u.return === e) break e;
            (d === u && (d = null), (u = u.return));
          }
          (d === u && (d = null), (u.sibling.return = u.return), (u = u.sibling));
        }
      }
      break;
    case 19:
      (fc(t, e), _c(e), 4 & i && pc(e));
    case 21:
  }
}
function _c(e) {
  var t = e.flags;
  if (2 & t) {
    try {
      e: {
        for (var n = e.return; null !== n; ) {
          if (sc(n)) {
            var i = n;
            break e;
          }
          n = n.return;
        }
        throw Error(ae(160));
      }
      switch (i.tag) {
        case 5:
          var r = i.stateNode;
          (32 & i.flags && (gt(r, ""), (i.flags &= -33)), cc(e, ac(e), r));
          break;
        case 3:
        case 4:
          var o = i.stateNode.containerInfo;
          lc(e, ac(e), o);
          break;
        default:
          throw Error(ae(161));
      }
    } catch (Nmt) {
      Sd(e, e.return, Nmt);
    }
    e.flags &= -3;
  }
  4096 & t && (e.flags &= -4097);
}
function vc(e, t, n) {
  ((Ql = e), bc(e));
}
function bc(e, t, n) {
  for (var i = !!(1 & e.mode); null !== Ql; ) {
    var r = Ql,
      o = r.child;
    if (22 === r.tag && i) {
      var s = null !== r.memoizedState || Zl;
      if (!s) {
        var a = r.alternate,
          l = (null !== a && null !== a.memoizedState) || Yl;
        a = Zl;
        var c = Yl;
        if (((Zl = s), (Yl = l) && !c))
          for (Ql = r; null !== Ql; )
            ((l = (s = Ql).child),
              22 === s.tag && null !== s.memoizedState
                ? wc(r)
                : null !== l
                  ? ((l.return = s), (Ql = l))
                  : wc(r));
        for (; null !== o; ) ((Ql = o), bc(o), (o = o.sibling));
        ((Ql = r), (Zl = a), (Yl = c));
      }
      yc(e);
    } else 8772 & r.subtreeFlags && null !== o ? ((o.return = r), (Ql = o)) : yc(e);
  }
}
function yc(e) {
  for (; null !== Ql; ) {
    var t = Ql;
    if (8772 & t.flags) {
      var n = t.alternate;
      try {
        if (8772 & t.flags)
          switch (t.tag) {
            case 0:
            case 11:
            case 15:
              Yl || ic(5, t);
              break;
            case 1:
              var i = t.stateNode;
              if (4 & t.flags && !Yl)
                if (null === n) i.componentDidMount();
                else {
                  var r = t.elementType === t.type ? n.memoizedProps : il(t.type, n.memoizedProps);
                  i.componentDidUpdate(r, n.memoizedState, i.__reactInternalSnapshotBeforeUpdate);
                }
              var o = t.updateQueue;
              null !== o && $s(t, o, i);
              break;
            case 3:
              var s = t.updateQueue;
              if (null !== s) {
                if (((n = null), null !== t.child))
                  switch (t.child.tag) {
                    case 5:
                    case 1:
                      n = t.child.stateNode;
                  }
                $s(t, s, n);
              }
              break;
            case 5:
              var a = t.stateNode;
              if (null === n && 4 & t.flags) {
                n = a;
                var l = t.memoizedProps;
                switch (t.type) {
                  case "button":
                  case "input":
                  case "select":
                  case "textarea":
                    l.autoFocus && n.focus();
                    break;
                  case "img":
                    l.src && (n.src = l.src);
                }
              }
              break;
            case 6:
            case 4:
            case 12:
            case 19:
            case 17:
            case 21:
            case 22:
            case 23:
            case 25:
              break;
            case 13:
              if (null === t.memoizedState) {
                var c = t.alternate;
                if (null !== c) {
                  var d = c.memoizedState;
                  if (null !== d) {
                    var u = d.dehydrated;
                    null !== u && Un(u);
                  }
                }
              }
              break;
            default:
              throw Error(ae(163));
          }
        Yl || (512 & t.flags && rc(t));
      } catch (Q3e) {
        Sd(t, t.return, Q3e);
      }
    }
    if (t === e) {
      Ql = null;
      break;
    }
    if (null !== (n = t.sibling)) {
      ((n.return = t.return), (Ql = n));
      break;
    }
    Ql = t.return;
  }
}
function xc(e) {
  for (; null !== Ql; ) {
    var t = Ql;
    if (t === e) {
      Ql = null;
      break;
    }
    var n = t.sibling;
    if (null !== n) {
      ((n.return = t.return), (Ql = n));
      break;
    }
    Ql = t.return;
  }
}
function wc(e) {
  for (; null !== Ql; ) {
    var t = Ql;
    try {
      switch (t.tag) {
        case 0:
        case 11:
        case 15:
          var n = t.return;
          try {
            ic(4, t);
          } catch (Nmt) {
            Sd(t, n, Nmt);
          }
          break;
        case 1:
          var i = t.stateNode;
          if ("function" == typeof i.componentDidMount) {
            var r = t.return;
            try {
              i.componentDidMount();
            } catch (Nmt) {
              Sd(t, r, Nmt);
            }
          }
          var o = t.return;
          try {
            rc(t);
          } catch (Nmt) {
            Sd(t, o, Nmt);
          }
          break;
        case 5:
          var s = t.return;
          try {
            rc(t);
          } catch (Nmt) {
            Sd(t, s, Nmt);
          }
      }
    } catch (Nmt) {
      Sd(t, t.return, Nmt);
    }
    if (t === e) {
      Ql = null;
      break;
    }
    var a = t.sibling;
    if (null !== a) {
      ((a.return = t.return), (Ql = a));
      break;
    }
    Ql = t.return;
  }
}
var Cc,
  Sc = Math.ceil,
  kc = we.ReactCurrentDispatcher,
  Ec = we.ReactCurrentOwner,
  Nc = we.ReactCurrentBatchConfig,
  Lc = 0,
  Dc = null,
  Tc = null,
  Ic = 0,
  Rc = 0,
  Oc = Eo(0),
  Mc = 0,
  Ac = null,
  Pc = 0,
  jc = 0,
  Fc = 0,
  Bc = null,
  Vc = null,
  Wc = 0,
  Hc = 1 / 0,
  zc = null,
  Uc = !1,
  $c = null,
  qc = null,
  Kc = !1,
  Gc = null,
  Zc = 0,
  Yc = 0,
  Xc = null,
  Qc = -1,
  Jc = 0;
function ed() {
  return 6 & Lc ? Qt() : -1 !== Qc ? Qc : (Qc = Qt());
}
function td(e) {
  return 1 & e.mode
    ? 2 & Lc && 0 !== Ic
      ? Ic & -Ic
      : null !== _s.transition
        ? (0 === Jc && (Jc = _n()), Jc)
        : 0 !== (e = xn)
          ? e
          : (e = void 0 === (e = window.event) ? 16 : Qn(e.type))
    : 1;
}
function nd(e, t, n, i) {
  if (50 < Yc) throw ((Yc = 0), (Xc = null), Error(ae(185)));
  (bn(e, n, i),
    (2 & Lc && e === Dc) ||
      (e === Dc && (!(2 & Lc) && (jc |= n), 4 === Mc && ad(e, Ic)),
      id(e, i),
      1 === n && 0 === Lc && !(1 & t.mode) && ((Hc = Qt() + 500), Wo && Uo())));
}
function id(e, t) {
  var n = e.callbackNode;
  !(function (e, t) {
    for (
      var n = e.suspendedLanes, i = e.pingedLanes, r = e.expirationTimes, o = e.pendingLanes;
      0 < o;
    ) {
      var s = 31 - ln(o),
        a = 1 << s,
        l = r[s];
      (-1 === l
        ? (0 !== (a & n) && 0 === (a & i)) || (r[s] = fn(a, t))
        : l <= t && (e.expiredLanes |= a),
        (o &= ~a));
    }
  })(e, t);
  var i = pn(e, e === Dc ? Ic : 0);
  if (0 === i) (null !== n && Zt(n), (e.callbackNode = null), (e.callbackPriority = 0));
  else if (((t = i & -i), e.callbackPriority !== t)) {
    if ((null != n && Zt(n), 1 === t))
      (0 === e.tag
        ? (function (e) {
            ((Wo = !0), zo(e));
          })(ld.bind(null, e))
        : zo(ld.bind(null, e)),
        ao(function () {
          !(6 & Lc) && Uo();
        }),
        (n = null));
    else {
      switch (wn(i)) {
        case 1:
          n = en;
          break;
        case 4:
          n = tn;
          break;
        case 16:
        default:
          n = nn;
          break;
        case 536870912:
          n = on;
      }
      n = Dd(n, rd.bind(null, e));
    }
    ((e.callbackPriority = t), (e.callbackNode = n));
  }
}
function rd(e, t) {
  if (((Qc = -1), (Jc = 0), 6 & Lc)) throw Error(ae(327));
  var n = e.callbackNode;
  if (wd() && e.callbackNode !== n) return null;
  var i = pn(e, e === Dc ? Ic : 0);
  if (0 === i) return null;
  if (30 & i || 0 !== (i & e.expiredLanes) || t) t = md(e, i);
  else {
    t = i;
    var r = Lc;
    Lc |= 2;
    var o = pd();
    for ((Dc === e && Ic === t) || ((zc = null), (Hc = Qt() + 500), hd(e, t)); ; )
      try {
        vd();
        break;
      } catch (cpt) {
        gd(e, cpt);
      }
    (Ls(), (kc.current = o), (Lc = r), null !== Tc ? (t = 0) : ((Dc = null), (Ic = 0), (t = Mc)));
  }
  if (0 !== t) {
    if ((2 === t && 0 !== (r = mn(e)) && ((i = r), (t = od(e, r))), 1 === t))
      throw ((n = Ac), hd(e, 0), ad(e, i), id(e, Qt()), n);
    if (6 === t) ad(e, i);
    else {
      if (
        ((r = e.current.alternate),
        !(
          30 & i ||
          (function (e) {
            for (var t = e; ; ) {
              if (16384 & t.flags) {
                var n = t.updateQueue;
                if (null !== n && null !== (n = n.stores))
                  for (var i = 0; i < n.length; i++) {
                    var r = n[i],
                      o = r.getSnapshot;
                    r = r.value;
                    try {
                      if (!lr(o(), r)) return !1;
                    } catch (s) {
                      return !1;
                    }
                  }
              }
              if (((n = t.child), 16384 & t.subtreeFlags && null !== n)) ((n.return = t), (t = n));
              else {
                if (t === e) break;
                for (; null === t.sibling; ) {
                  if (null === t.return || t.return === e) return !0;
                  t = t.return;
                }
                ((t.sibling.return = t.return), (t = t.sibling));
              }
            }
            return !0;
          })(r) ||
          ((t = md(e, i)), 2 === t && ((o = mn(e)), 0 !== o && ((i = o), (t = od(e, o)))), 1 !== t)
        ))
      )
        throw ((n = Ac), hd(e, 0), ad(e, i), id(e, Qt()), n);
      switch (((e.finishedWork = r), (e.finishedLanes = i), t)) {
        case 0:
        case 1:
          throw Error(ae(345));
        case 2:
        case 5:
          xd(e, Vc, zc);
          break;
        case 3:
          if ((ad(e, i), (130023424 & i) === i && 10 < (t = Wc + 500 - Qt()))) {
            if (0 !== pn(e, 0)) break;
            if (((r = e.suspendedLanes) & i) !== i) {
              (ed(), (e.pingedLanes |= e.suspendedLanes & r));
              break;
            }
            e.timeoutHandle = ro(xd.bind(null, e, Vc, zc), t);
            break;
          }
          xd(e, Vc, zc);
          break;
        case 4:
          if ((ad(e, i), (4194240 & i) === i)) break;
          for (t = e.eventTimes, r = -1; 0 < i; ) {
            var s = 31 - ln(i);
            ((o = 1 << s), (s = t[s]) > r && (r = s), (i &= ~o));
          }
          if (
            ((i = r),
            10 <
              (i =
                (120 > (i = Qt() - i)
                  ? 120
                  : 480 > i
                    ? 480
                    : 1080 > i
                      ? 1080
                      : 1920 > i
                        ? 1920
                        : 3e3 > i
                          ? 3e3
                          : 4320 > i
                            ? 4320
                            : 1960 * Sc(i / 1960)) - i))
          ) {
            e.timeoutHandle = ro(xd.bind(null, e, Vc, zc), i);
            break;
          }
          xd(e, Vc, zc);
          break;
        default:
          throw Error(ae(329));
      }
    }
  }
  return (id(e, Qt()), e.callbackNode === n ? rd.bind(null, e) : null);
}
function od(e, t) {
  var n = Bc;
  return (
    e.current.memoizedState.isDehydrated && (hd(e, t).flags |= 256),
    2 !== (e = md(e, t)) && ((t = Vc), (Vc = n), null !== t && sd(t)),
    e
  );
}
function sd(e) {
  null === Vc ? (Vc = e) : Vc.push.apply(Vc, e);
}
function ad(e, t) {
  for (
    t &= ~Fc, t &= ~jc, e.suspendedLanes |= t, e.pingedLanes &= ~t, e = e.expirationTimes;
    0 < t;
  ) {
    var n = 31 - ln(t),
      i = 1 << n;
    ((e[n] = -1), (t &= ~i));
  }
}
function ld(e) {
  if (6 & Lc) throw Error(ae(327));
  wd();
  var t = pn(e, 0);
  if (!(1 & t)) return (id(e, Qt()), null);
  var n = md(e, t);
  if (0 !== e.tag && 2 === n) {
    var i = mn(e);
    0 !== i && ((t = i), (n = od(e, i)));
  }
  if (1 === n) throw ((n = Ac), hd(e, 0), ad(e, t), id(e, Qt()), n);
  if (6 === n) throw Error(ae(345));
  return (
    (e.finishedWork = e.current.alternate),
    (e.finishedLanes = t),
    xd(e, Vc, zc),
    id(e, Qt()),
    null
  );
}
function cd(e, t) {
  var n = Lc;
  Lc |= 1;
  try {
    return e(t);
  } finally {
    0 === (Lc = n) && ((Hc = Qt() + 500), Wo && Uo());
  }
}
function dd(e) {
  null !== Gc && 0 === Gc.tag && !(6 & Lc) && wd();
  var t = Lc;
  Lc |= 1;
  var n = Nc.transition,
    i = xn;
  try {
    if (((Nc.transition = null), (xn = 1), e)) return e();
  } finally {
    ((xn = i), (Nc.transition = n), !(6 & (Lc = t)) && Uo());
  }
}
function ud() {
  ((Rc = Oc.current), No(Oc));
}
function hd(e, t) {
  ((e.finishedWork = null), (e.finishedLanes = 0));
  var n = e.timeoutHandle;
  if ((-1 !== n && ((e.timeoutHandle = -1), oo(n)), null !== Tc))
    for (n = Tc.return; null !== n; ) {
      var i = n;
      switch ((is(i), i.tag)) {
        case 1:
          null != (i = i.type.childContextTypes) && Ao();
          break;
        case 3:
          (Qs(), No(Io), No(To), ra());
          break;
        case 5:
          ea(i);
          break;
        case 4:
          Qs();
          break;
        case 13:
        case 19:
          No(ta);
          break;
        case 10:
          Ds(i.type._context);
          break;
        case 22:
        case 23:
          ud();
      }
      n = n.return;
    }
  if (
    ((Dc = e),
    (Tc = e = Od(e.current, null)),
    (Ic = Rc = t),
    (Mc = 0),
    (Ac = null),
    (Fc = jc = Pc = 0),
    (Vc = Bc = null),
    null !== Os)
  ) {
    for (t = 0; t < Os.length; t++)
      if (null !== (i = (n = Os[t]).interleaved)) {
        n.interleaved = null;
        var r = i.next,
          o = n.pending;
        if (null !== o) {
          var s = o.next;
          ((o.next = r), (i.next = s));
        }
        n.pending = i;
      }
    Os = null;
  }
  return e;
}
function gd(e, t) {
  for (;;) {
    var n = Tc;
    try {
      if ((Ls(), (oa.current = Ja), ua)) {
        for (var i = la.memoizedState; null !== i; ) {
          var r = i.queue;
          (null !== r && (r.pending = null), (i = i.next));
        }
        ua = !1;
      }
      if (
        ((aa = 0),
        (da = ca = la = null),
        (ha = !1),
        (ga = 0),
        (Ec.current = null),
        null === n || null === n.return)
      ) {
        ((Mc = 1), (Ac = t), (Tc = null));
        break;
      }
      e: {
        var o = e,
          s = n.return,
          a = n,
          l = t;
        if (
          ((t = Ic),
          (a.flags |= 32768),
          null !== l && "object" == typeof l && "function" == typeof l.then)
        ) {
          var c = l,
            d = a,
            u = d.tag;
          if (!(1 & d.mode || (0 !== u && 11 !== u && 15 !== u))) {
            var h = d.alternate;
            h
              ? ((d.updateQueue = h.updateQueue),
                (d.memoizedState = h.memoizedState),
                (d.lanes = h.lanes))
              : ((d.updateQueue = null), (d.memoizedState = null));
          }
          var g = ml(s);
          if (null !== g) {
            ((g.flags &= -257), _l(g, s, a, 0, t), 1 & g.mode && fl(o, c, t), (l = c));
            var p = (t = g).updateQueue;
            if (null === p) {
              var f = new Set();
              (f.add(l), (t.updateQueue = f));
            } else p.add(l);
            break e;
          }
          if (!(1 & t)) {
            (fl(o, c, t), fd());
            break e;
          }
          l = Error(ae(426));
        } else if (ss && 1 & a.mode) {
          var m = ml(s);
          if (null !== m) {
            (!(65536 & m.flags) && (m.flags |= 256), _l(m, s, a, 0, t), ms(dl(l, a)));
            break e;
          }
        }
        ((o = l = dl(l, a)), 4 !== Mc && (Mc = 2), null === Bc ? (Bc = [o]) : Bc.push(o), (o = s));
        do {
          switch (o.tag) {
            case 3:
              ((o.flags |= 65536), (t &= -t), (o.lanes |= t), zs(o, gl(0, l, t)));
              break e;
            case 1:
              a = l;
              var _ = o.type,
                v = o.stateNode;
              if (
                !(
                  128 & o.flags ||
                  ("function" != typeof _.getDerivedStateFromError &&
                    (null === v ||
                      "function" != typeof v.componentDidCatch ||
                      (null !== qc && qc.has(v))))
                )
              ) {
                ((o.flags |= 65536), (t &= -t), (o.lanes |= t), zs(o, pl(o, a, t)));
                break e;
              }
          }
          o = o.return;
        } while (null !== o);
      }
      yd(n);
    } catch (b) {
      ((t = b), Tc === n && null !== n && (Tc = n = n.return));
      continue;
    }
    break;
  }
}
function pd() {
  var e = kc.current;
  return ((kc.current = Ja), null === e ? Ja : e);
}
function fd() {
  ((0 !== Mc && 3 !== Mc && 2 !== Mc) || (Mc = 4),
    null === Dc || (!(268435455 & Pc) && !(268435455 & jc)) || ad(Dc, Ic));
}
function md(e, t) {
  var n = Lc;
  Lc |= 2;
  var i = pd();
  for ((Dc === e && Ic === t) || ((zc = null), hd(e, t)); ; )
    try {
      _d();
      break;
    } catch (spt) {
      gd(e, spt);
    }
  if ((Ls(), (Lc = n), (kc.current = i), null !== Tc)) throw Error(ae(261));
  return ((Dc = null), (Ic = 0), Mc);
}
function _d() {
  for (; null !== Tc; ) bd(Tc);
}
function vd() {
  for (; null !== Tc && !Yt(); ) bd(Tc);
}
function bd(e) {
  var t = Cc(e.alternate, e, Rc);
  ((e.memoizedProps = e.pendingProps), null === t ? yd(e) : (Tc = t), (Ec.current = null));
}
function yd(e) {
  var t = e;
  do {
    var n = t.alternate;
    if (((e = t.return), 32768 & t.flags)) {
      if (null !== (n = Gl(n, t))) return ((n.flags &= 32767), void (Tc = n));
      if (null === e) return ((Mc = 6), void (Tc = null));
      ((e.flags |= 32768), (e.subtreeFlags = 0), (e.deletions = null));
    } else if (null !== (n = Kl(n, t, Rc))) return void (Tc = n);
    if (null !== (t = t.sibling)) return void (Tc = t);
    Tc = t = e;
  } while (null !== t);
  0 === Mc && (Mc = 5);
}
function xd(e, t, n) {
  var i = xn,
    r = Nc.transition;
  try {
    ((Nc.transition = null),
      (xn = 1),
      (function (e, t, n, i) {
        do {
          wd();
        } while (null !== Gc);
        if (6 & Lc) throw Error(ae(327));
        n = e.finishedWork;
        var r = e.finishedLanes;
        if (null === n) return null;
        if (((e.finishedWork = null), (e.finishedLanes = 0), n === e.current)) throw Error(ae(177));
        ((e.callbackNode = null), (e.callbackPriority = 0));
        var o = n.lanes | n.childLanes;
        if (
          ((function (e, t) {
            var n = e.pendingLanes & ~t;
            ((e.pendingLanes = t),
              (e.suspendedLanes = 0),
              (e.pingedLanes = 0),
              (e.expiredLanes &= t),
              (e.mutableReadLanes &= t),
              (e.entangledLanes &= t),
              (t = e.entanglements));
            var i = e.eventTimes;
            for (e = e.expirationTimes; 0 < n; ) {
              var r = 31 - ln(n),
                o = 1 << r;
              ((t[r] = 0), (i[r] = -1), (e[r] = -1), (n &= ~o));
            }
          })(e, o),
          e === Dc && ((Tc = Dc = null), (Ic = 0)),
          (!(2064 & n.subtreeFlags) && !(2064 & n.flags)) ||
            Kc ||
            ((Kc = !0),
            Dd(nn, function () {
              return (wd(), null);
            })),
          (o = !!(15990 & n.flags)),
          !!(15990 & n.subtreeFlags) || o)
        ) {
          ((o = Nc.transition), (Nc.transition = null));
          var s = xn;
          xn = 1;
          var a = Lc;
          ((Lc |= 4),
            (Ec.current = null),
            (function (e, t) {
              if (((to = qn), pr((e = gr())))) {
                if ("selectionStart" in e) var n = { start: e.selectionStart, end: e.selectionEnd };
                else
                  e: {
                    var i =
                      (n = ((n = e.ownerDocument) && n.defaultView) || window).getSelection &&
                      n.getSelection();
                    if (i && 0 !== i.rangeCount) {
                      n = i.anchorNode;
                      var r = i.anchorOffset,
                        o = i.focusNode;
                      i = i.focusOffset;
                      try {
                        (n.nodeType, o.nodeType);
                      } catch (S) {
                        n = null;
                        break e;
                      }
                      var s = 0,
                        a = -1,
                        l = -1,
                        c = 0,
                        d = 0,
                        u = e,
                        h = null;
                      t: for (;;) {
                        for (
                          var g;
                          u !== n || (0 !== r && 3 !== u.nodeType) || (a = s + r),
                            u !== o || (0 !== i && 3 !== u.nodeType) || (l = s + i),
                            3 === u.nodeType && (s += u.nodeValue.length),
                            null !== (g = u.firstChild);
                        )
                          ((h = u), (u = g));
                        for (;;) {
                          if (u === e) break t;
                          if (
                            (h === n && ++c === r && (a = s),
                            h === o && ++d === i && (l = s),
                            null !== (g = u.nextSibling))
                          )
                            break;
                          h = (u = h).parentNode;
                        }
                        u = g;
                      }
                      n = -1 === a || -1 === l ? null : { start: a, end: l };
                    } else n = null;
                  }
                n = n || { start: 0, end: 0 };
              } else n = null;
              for (no = { focusedElem: e, selectionRange: n }, qn = !1, Ql = t; null !== Ql; )
                if (((e = (t = Ql).child), 1028 & t.subtreeFlags && null !== e))
                  ((e.return = t), (Ql = e));
                else
                  for (; null !== Ql; ) {
                    t = Ql;
                    try {
                      var p = t.alternate;
                      if (1024 & t.flags)
                        switch (t.tag) {
                          case 0:
                          case 11:
                          case 15:
                          case 5:
                          case 6:
                          case 4:
                          case 17:
                            break;
                          case 1:
                            if (null !== p) {
                              var f = p.memoizedProps,
                                m = p.memoizedState,
                                _ = t.stateNode,
                                v = _.getSnapshotBeforeUpdate(
                                  t.elementType === t.type ? f : il(t.type, f),
                                  m,
                                );
                              _.__reactInternalSnapshotBeforeUpdate = v;
                            }
                            break;
                          case 3:
                            var b = t.stateNode.containerInfo;
                            1 === b.nodeType
                              ? (b.textContent = "")
                              : 9 === b.nodeType &&
                                b.documentElement &&
                                b.removeChild(b.documentElement);
                            break;
                          default:
                            throw Error(ae(163));
                        }
                    } catch (S) {
                      Sd(t, t.return, S);
                    }
                    if (null !== (e = t.sibling)) {
                      ((e.return = t.return), (Ql = e));
                      break;
                    }
                    Ql = t.return;
                  }
              ((p = tc), (tc = !1));
            })(e, n),
            mc(n, e),
            fr(no),
            (qn = !!to),
            (no = to = null),
            (e.current = n),
            vc(n),
            Xt(),
            (Lc = a),
            (xn = s),
            (Nc.transition = o));
        } else e.current = n;
        if (
          (Kc && ((Kc = !1), (Gc = e), (Zc = r)),
          (o = e.pendingLanes),
          0 === o && (qc = null),
          (function (e) {
            if (an && "function" == typeof an.onCommitFiberRoot)
              try {
                an.onCommitFiberRoot(sn, e, void 0, !(128 & ~e.current.flags));
              } catch (t) {}
          })(n.stateNode),
          id(e, Qt()),
          null !== t)
        )
          for (i = e.onRecoverableError, n = 0; n < t.length; n++)
            ((r = t[n]), i(r.value, { componentStack: r.stack, digest: r.digest }));
        if (Uc) throw ((Uc = !1), (e = $c), ($c = null), e);
        (!!(1 & Zc) && 0 !== e.tag && wd(),
          (o = e.pendingLanes),
          1 & o ? (e === Xc ? Yc++ : ((Yc = 0), (Xc = e))) : (Yc = 0),
          Uo());
      })(e, t, n, i));
  } finally {
    ((Nc.transition = r), (xn = i));
  }
  return null;
}
function wd() {
  if (null !== Gc) {
    var e = wn(Zc),
      t = Nc.transition,
      n = xn;
    try {
      if (((Nc.transition = null), (xn = 16 > e ? 16 : e), null === Gc)) var i = !1;
      else {
        if (((e = Gc), (Gc = null), (Zc = 0), 6 & Lc)) throw Error(ae(331));
        var r = Lc;
        for (Lc |= 4, Ql = e.current; null !== Ql; ) {
          var o = Ql,
            s = o.child;
          if (16 & Ql.flags) {
            var a = o.deletions;
            if (null !== a) {
              for (var l = 0; l < a.length; l++) {
                var c = a[l];
                for (Ql = c; null !== Ql; ) {
                  var d = Ql;
                  switch (d.tag) {
                    case 0:
                    case 11:
                    case 15:
                      nc(8, d, o);
                  }
                  var u = d.child;
                  if (null !== u) ((u.return = d), (Ql = u));
                  else
                    for (; null !== Ql; ) {
                      var h = (d = Ql).sibling,
                        g = d.return;
                      if ((oc(d), d === c)) {
                        Ql = null;
                        break;
                      }
                      if (null !== h) {
                        ((h.return = g), (Ql = h));
                        break;
                      }
                      Ql = g;
                    }
                }
              }
              var p = o.alternate;
              if (null !== p) {
                var f = p.child;
                if (null !== f) {
                  p.child = null;
                  do {
                    var m = f.sibling;
                    ((f.sibling = null), (f = m));
                  } while (null !== f);
                }
              }
              Ql = o;
            }
          }
          if (2064 & o.subtreeFlags && null !== s) ((s.return = o), (Ql = s));
          else
            e: for (; null !== Ql; ) {
              if (2048 & (o = Ql).flags)
                switch (o.tag) {
                  case 0:
                  case 11:
                  case 15:
                    nc(9, o, o.return);
                }
              var _ = o.sibling;
              if (null !== _) {
                ((_.return = o.return), (Ql = _));
                break e;
              }
              Ql = o.return;
            }
        }
        var v = e.current;
        for (Ql = v; null !== Ql; ) {
          var b = (s = Ql).child;
          if (2064 & s.subtreeFlags && null !== b) ((b.return = s), (Ql = b));
          else
            e: for (s = v; null !== Ql; ) {
              if (2048 & (a = Ql).flags)
                try {
                  switch (a.tag) {
                    case 0:
                    case 11:
                    case 15:
                      ic(9, a);
                  }
                } catch (x) {
                  Sd(a, a.return, x);
                }
              if (a === s) {
                Ql = null;
                break e;
              }
              var y = a.sibling;
              if (null !== y) {
                ((y.return = a.return), (Ql = y));
                break e;
              }
              Ql = a.return;
            }
        }
        if (((Lc = r), Uo(), an && "function" == typeof an.onPostCommitFiberRoot))
          try {
            an.onPostCommitFiberRoot(sn, e);
          } catch (x) {}
        i = !0;
      }
      return i;
    } finally {
      ((xn = n), (Nc.transition = t));
    }
  }
  return !1;
}
function Cd(e, t, n) {
  ((e = Ws(e, (t = gl(0, (t = dl(n, t)), 1)), 1)),
    (t = ed()),
    null !== e && (bn(e, 1, t), id(e, t)));
}
function Sd(e, t, n) {
  if (3 === e.tag) Cd(e, e, n);
  else
    for (; null !== t; ) {
      if (3 === t.tag) {
        Cd(t, e, n);
        break;
      }
      if (1 === t.tag) {
        var i = t.stateNode;
        if (
          "function" == typeof t.type.getDerivedStateFromError ||
          ("function" == typeof i.componentDidCatch && (null === qc || !qc.has(i)))
        ) {
          ((t = Ws(t, (e = pl(t, (e = dl(n, e)), 1)), 1)),
            (e = ed()),
            null !== t && (bn(t, 1, e), id(t, e)));
          break;
        }
      }
      t = t.return;
    }
}
function kd(e, t, n) {
  var i = e.pingCache;
  (null !== i && i.delete(t),
    (t = ed()),
    (e.pingedLanes |= e.suspendedLanes & n),
    Dc === e &&
      (Ic & n) === n &&
      (4 === Mc || (3 === Mc && (130023424 & Ic) === Ic && 500 > Qt() - Wc) ? hd(e, 0) : (Fc |= n)),
    id(e, t));
}
function Ed(e, t) {
  0 === t && (1 & e.mode ? ((t = hn), !(130023424 & (hn <<= 1)) && (hn = 4194304)) : (t = 1));
  var n = ed();
  null !== (e = Ps(e, t)) && (bn(e, t, n), id(e, n));
}
function Nd(e) {
  var t = e.memoizedState,
    n = 0;
  (null !== t && (n = t.retryLane), Ed(e, n));
}
function Ld(e, t) {
  var n = 0;
  switch (e.tag) {
    case 13:
      var i = e.stateNode,
        r = e.memoizedState;
      null !== r && (n = r.retryLane);
      break;
    case 19:
      i = e.stateNode;
      break;
    default:
      throw Error(ae(314));
  }
  (null !== i && i.delete(t), Ed(e, n));
}
function Dd(e, t) {
  return Gt(e, t);
}
function Td(e, t, n, i) {
  ((this.tag = e),
    (this.key = n),
    (this.sibling =
      this.child =
      this.return =
      this.stateNode =
      this.type =
      this.elementType =
        null),
    (this.index = 0),
    (this.ref = null),
    (this.pendingProps = t),
    (this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null),
    (this.mode = i),
    (this.subtreeFlags = this.flags = 0),
    (this.deletions = null),
    (this.childLanes = this.lanes = 0),
    (this.alternate = null));
}
function Id(e, t, n, i) {
  return new Td(e, t, n, i);
}
function Rd(e) {
  return !(!(e = e.prototype) || !e.isReactComponent);
}
function Od(e, t) {
  var n = e.alternate;
  return (
    null === n
      ? (((n = Id(e.tag, t, e.key, e.mode)).elementType = e.elementType),
        (n.type = e.type),
        (n.stateNode = e.stateNode),
        (n.alternate = e),
        (e.alternate = n))
      : ((n.pendingProps = t),
        (n.type = e.type),
        (n.flags = 0),
        (n.subtreeFlags = 0),
        (n.deletions = null)),
    (n.flags = 14680064 & e.flags),
    (n.childLanes = e.childLanes),
    (n.lanes = e.lanes),
    (n.child = e.child),
    (n.memoizedProps = e.memoizedProps),
    (n.memoizedState = e.memoizedState),
    (n.updateQueue = e.updateQueue),
    (t = e.dependencies),
    (n.dependencies = null === t ? null : { lanes: t.lanes, firstContext: t.firstContext }),
    (n.sibling = e.sibling),
    (n.index = e.index),
    (n.ref = e.ref),
    n
  );
}
function Md(e, t, n, i, r, o) {
  var s = 2;
  if (((i = e), "function" == typeof e)) Rd(e) && (s = 1);
  else if ("string" == typeof e) s = 5;
  else
    e: switch (e) {
      case ke:
        return Ad(n.children, r, o, t);
      case Ee:
        ((s = 8), (r |= 8));
        break;
      case Ne:
        return (((e = Id(12, n, t, 2 | r)).elementType = Ne), (e.lanes = o), e);
      case Ie:
        return (((e = Id(13, n, t, r)).elementType = Ie), (e.lanes = o), e);
      case Re:
        return (((e = Id(19, n, t, r)).elementType = Re), (e.lanes = o), e);
      case Ae:
        return Pd(n, r, o, t);
      default:
        if ("object" == typeof e && null !== e)
          switch (e.$$typeof) {
            case Le:
              s = 10;
              break e;
            case De:
              s = 9;
              break e;
            case Te:
              s = 11;
              break e;
            case Oe:
              s = 14;
              break e;
            case Me:
              ((s = 16), (i = null));
              break e;
          }
        throw Error(ae(130, null == e ? e : typeof e, ""));
    }
  return (((t = Id(s, n, t, r)).elementType = e), (t.type = i), (t.lanes = o), t);
}
function Ad(e, t, n, i) {
  return (((e = Id(7, e, i, t)).lanes = n), e);
}
function Pd(e, t, n, i) {
  return (
    ((e = Id(22, e, i, t)).elementType = Ae),
    (e.lanes = n),
    (e.stateNode = { isHidden: !1 }),
    e
  );
}
function jd(e, t, n) {
  return (((e = Id(6, e, null, t)).lanes = n), e);
}
function Fd(e, t, n) {
  return (
    ((t = Id(4, null !== e.children ? e.children : [], e.key, t)).lanes = n),
    (t.stateNode = {
      containerInfo: e.containerInfo,
      pendingChildren: null,
      implementation: e.implementation,
    }),
    t
  );
}
function Bd(e, t, n, i, r) {
  ((this.tag = t),
    (this.containerInfo = e),
    (this.finishedWork = this.pingCache = this.current = this.pendingChildren = null),
    (this.timeoutHandle = -1),
    (this.callbackNode = this.pendingContext = this.context = null),
    (this.callbackPriority = 0),
    (this.eventTimes = vn(0)),
    (this.expirationTimes = vn(-1)),
    (this.entangledLanes =
      this.finishedLanes =
      this.mutableReadLanes =
      this.expiredLanes =
      this.pingedLanes =
      this.suspendedLanes =
      this.pendingLanes =
        0),
    (this.entanglements = vn(0)),
    (this.identifierPrefix = i),
    (this.onRecoverableError = r),
    (this.mutableSourceEagerHydrationData = null));
}
function Vd(e, t, n, i, r, o, s, a, l) {
  return (
    (e = new Bd(e, t, n, a, l)),
    1 === t ? ((t = 1), !0 === o && (t |= 8)) : (t = 0),
    (o = Id(3, null, null, t)),
    (e.current = o),
    (o.stateNode = e),
    (o.memoizedState = {
      element: i,
      isDehydrated: n,
      cache: null,
      transitions: null,
      pendingSuspenseBoundaries: null,
    }),
    Fs(o),
    e
  );
}
function Wd(e) {
  if (!e) return Do;
  e: {
    if (zt((e = e._reactInternals)) !== e || 1 !== e.tag) throw Error(ae(170));
    var t = e;
    do {
      switch (t.tag) {
        case 3:
          t = t.stateNode.context;
          break e;
        case 1:
          if (Mo(t.type)) {
            t = t.stateNode.__reactInternalMemoizedMergedChildContext;
            break e;
          }
      }
      t = t.return;
    } while (null !== t);
    throw Error(ae(171));
  }
  if (1 === e.tag) {
    var n = e.type;
    if (Mo(n)) return jo(e, n, t);
  }
  return t;
}
function Hd(e, t, n, i, r, o, s, a, l) {
  return (
    ((e = Vd(n, i, !0, e, 0, o, 0, a, l)).context = Wd(null)),
    (n = e.current),
    ((o = Vs((i = ed()), (r = td(n)))).callback = null != t ? t : null),
    Ws(n, o, r),
    (e.current.lanes = r),
    bn(e, r, i),
    id(e, i),
    e
  );
}
function zd(e, t, n, i) {
  var r = t.current,
    o = ed(),
    s = td(r);
  return (
    (n = Wd(n)),
    null === t.context ? (t.context = n) : (t.pendingContext = n),
    ((t = Vs(o, s)).payload = { element: e }),
    null !== (i = void 0 === i ? null : i) && (t.callback = i),
    null !== (e = Ws(r, t, s)) && (nd(e, r, s, o), Hs(e, r, s)),
    s
  );
}
function Ud(e) {
  return (e = e.current).child ? (e.child.tag, e.child.stateNode) : null;
}
function $d(e, t) {
  if (null !== (e = e.memoizedState) && null !== e.dehydrated) {
    var n = e.retryLane;
    e.retryLane = 0 !== n && n < t ? n : t;
  }
}
function qd(e, t) {
  ($d(e, t), (e = e.alternate) && $d(e, t));
}
Cc = function (e, t, n) {
  if (null !== e)
    if (e.memoizedProps !== t.pendingProps || Io.current) bl = !0;
    else {
      if (0 === (e.lanes & n) && !(128 & t.flags))
        return (
          (bl = !1),
          (function (e, t, n) {
            switch (t.tag) {
              case 3:
                (Dl(t), fs());
                break;
              case 5:
                Js(t);
                break;
              case 1:
                Mo(t.type) && Fo(t);
                break;
              case 4:
                Xs(t, t.stateNode.containerInfo);
                break;
              case 10:
                var i = t.type._context,
                  r = t.memoizedProps.value;
                (Lo(Ss, i._currentValue), (i._currentValue = r));
                break;
              case 13:
                if (null !== (i = t.memoizedState))
                  return null !== i.dehydrated
                    ? (Lo(ta, 1 & ta.current), (t.flags |= 128), null)
                    : 0 !== (n & t.child.childLanes)
                      ? jl(e, t, n)
                      : (Lo(ta, 1 & ta.current), null !== (e = Ul(e, t, n)) ? e.sibling : null);
                Lo(ta, 1 & ta.current);
                break;
              case 19:
                if (((i = 0 !== (n & t.childLanes)), 128 & e.flags)) {
                  if (i) return Hl(e, t, n);
                  t.flags |= 128;
                }
                if (
                  (null !== (r = t.memoizedState) &&
                    ((r.rendering = null), (r.tail = null), (r.lastEffect = null)),
                  Lo(ta, ta.current),
                  i)
                )
                  break;
                return null;
              case 22:
              case 23:
                return ((t.lanes = 0), Sl(e, t, n));
            }
            return Ul(e, t, n);
          })(e, t, n)
        );
      bl = !!(131072 & e.flags);
    }
  else ((bl = !1), ss && 1048576 & t.flags && ts(t, Go, t.index));
  switch (((t.lanes = 0), t.tag)) {
    case 2:
      var i = t.type;
      (zl(e, t), (e = t.pendingProps));
      var r = Oo(t, To.current);
      (Is(t, n), (r = _a(null, t, i, e, r, n)));
      var o = va();
      return (
        (t.flags |= 1),
        "object" == typeof r && null !== r && "function" == typeof r.render && void 0 === r.$$typeof
          ? ((t.tag = 1),
            (t.memoizedState = null),
            (t.updateQueue = null),
            Mo(i) ? ((o = !0), Fo(t)) : (o = !1),
            (t.memoizedState = null !== r.state && void 0 !== r.state ? r.state : null),
            Fs(t),
            (r.updater = ol),
            (t.stateNode = r),
            (r._reactInternals = t),
            cl(t, i, e, n),
            (t = Ll(null, t, i, !0, o, n)))
          : ((t.tag = 0), ss && o && ns(t), yl(null, t, r, n), (t = t.child)),
        t
      );
    case 16:
      i = t.elementType;
      e: {
        switch (
          (zl(e, t),
          (e = t.pendingProps),
          (i = (r = i._init)(i._payload)),
          (t.type = i),
          (r = t.tag =
            (function (e) {
              if ("function" == typeof e) return Rd(e) ? 1 : 0;
              if (null != e) {
                if ((e = e.$$typeof) === Te) return 11;
                if (e === Oe) return 14;
              }
              return 2;
            })(i)),
          (e = il(i, e)),
          r)
        ) {
          case 0:
            t = El(null, t, i, e, n);
            break e;
          case 1:
            t = Nl(null, t, i, e, n);
            break e;
          case 11:
            t = xl(null, t, i, e, n);
            break e;
          case 14:
            t = wl(null, t, i, il(i.type, e), n);
            break e;
        }
        throw Error(ae(306, i, ""));
      }
      return t;
    case 0:
      return (
        (i = t.type),
        (r = t.pendingProps),
        El(e, t, i, (r = t.elementType === i ? r : il(i, r)), n)
      );
    case 1:
      return (
        (i = t.type),
        (r = t.pendingProps),
        Nl(e, t, i, (r = t.elementType === i ? r : il(i, r)), n)
      );
    case 3:
      e: {
        if ((Dl(t), null === e)) throw Error(ae(387));
        ((i = t.pendingProps), (r = (o = t.memoizedState).element), Bs(e, t), Us(t, i, null, n));
        var s = t.memoizedState;
        if (((i = s.element), o.isDehydrated)) {
          if (
            ((o = {
              element: i,
              isDehydrated: !1,
              cache: s.cache,
              pendingSuspenseBoundaries: s.pendingSuspenseBoundaries,
              transitions: s.transitions,
            }),
            (t.updateQueue.baseState = o),
            (t.memoizedState = o),
            256 & t.flags)
          ) {
            t = Tl(e, t, i, n, (r = dl(Error(ae(423)), t)));
            break e;
          }
          if (i !== r) {
            t = Tl(e, t, i, n, (r = dl(Error(ae(424)), t)));
            break e;
          }
          for (
            os = uo(t.stateNode.containerInfo.firstChild),
              rs = t,
              ss = !0,
              as = null,
              n = Cs(t, null, i, n),
              t.child = n;
            n;
          )
            ((n.flags = (-3 & n.flags) | 4096), (n = n.sibling));
        } else {
          if ((fs(), i === r)) {
            t = Ul(e, t, n);
            break e;
          }
          yl(e, t, i, n);
        }
        t = t.child;
      }
      return t;
    case 5:
      return (
        Js(t),
        null === e && us(t),
        (i = t.type),
        (r = t.pendingProps),
        (o = null !== e ? e.memoizedProps : null),
        (s = r.children),
        io(i, r) ? (s = null) : null !== o && io(i, o) && (t.flags |= 32),
        kl(e, t),
        yl(e, t, s, n),
        t.child
      );
    case 6:
      return (null === e && us(t), null);
    case 13:
      return jl(e, t, n);
    case 4:
      return (
        Xs(t, t.stateNode.containerInfo),
        (i = t.pendingProps),
        null === e ? (t.child = ws(t, null, i, n)) : yl(e, t, i, n),
        t.child
      );
    case 11:
      return (
        (i = t.type),
        (r = t.pendingProps),
        xl(e, t, i, (r = t.elementType === i ? r : il(i, r)), n)
      );
    case 7:
      return (yl(e, t, t.pendingProps, n), t.child);
    case 8:
    case 12:
      return (yl(e, t, t.pendingProps.children, n), t.child);
    case 10:
      e: {
        if (
          ((i = t.type._context),
          (r = t.pendingProps),
          (o = t.memoizedProps),
          (s = r.value),
          Lo(Ss, i._currentValue),
          (i._currentValue = s),
          null !== o)
        )
          if (lr(o.value, s)) {
            if (o.children === r.children && !Io.current) {
              t = Ul(e, t, n);
              break e;
            }
          } else
            for (null !== (o = t.child) && (o.return = t); null !== o; ) {
              var a = o.dependencies;
              if (null !== a) {
                s = o.child;
                for (var l = a.firstContext; null !== l; ) {
                  if (l.context === i) {
                    if (1 === o.tag) {
                      (l = Vs(-1, n & -n)).tag = 2;
                      var c = o.updateQueue;
                      if (null !== c) {
                        var d = (c = c.shared).pending;
                        (null === d ? (l.next = l) : ((l.next = d.next), (d.next = l)),
                          (c.pending = l));
                      }
                    }
                    ((o.lanes |= n),
                      null !== (l = o.alternate) && (l.lanes |= n),
                      Ts(o.return, n, t),
                      (a.lanes |= n));
                    break;
                  }
                  l = l.next;
                }
              } else if (10 === o.tag) s = o.type === t.type ? null : o.child;
              else if (18 === o.tag) {
                if (null === (s = o.return)) throw Error(ae(341));
                ((s.lanes |= n),
                  null !== (a = s.alternate) && (a.lanes |= n),
                  Ts(s, n, t),
                  (s = o.sibling));
              } else s = o.child;
              if (null !== s) s.return = o;
              else
                for (s = o; null !== s; ) {
                  if (s === t) {
                    s = null;
                    break;
                  }
                  if (null !== (o = s.sibling)) {
                    ((o.return = s.return), (s = o));
                    break;
                  }
                  s = s.return;
                }
              o = s;
            }
        (yl(e, t, r.children, n), (t = t.child));
      }
      return t;
    case 9:
      return (
        (r = t.type),
        (i = t.pendingProps.children),
        Is(t, n),
        (i = i((r = Rs(r)))),
        (t.flags |= 1),
        yl(e, t, i, n),
        t.child
      );
    case 14:
      return ((r = il((i = t.type), t.pendingProps)), wl(e, t, i, (r = il(i.type, r)), n));
    case 15:
      return Cl(e, t, t.type, t.pendingProps, n);
    case 17:
      return (
        (i = t.type),
        (r = t.pendingProps),
        (r = t.elementType === i ? r : il(i, r)),
        zl(e, t),
        (t.tag = 1),
        Mo(i) ? ((e = !0), Fo(t)) : (e = !1),
        Is(t, n),
        al(t, i, r),
        cl(t, i, r, n),
        Ll(null, t, i, !0, e, n)
      );
    case 19:
      return Hl(e, t, n);
    case 22:
      return Sl(e, t, n);
  }
  throw Error(ae(156, t.tag));
};
var Kd = "function" == typeof reportError ? reportError : function (e) {};
function Gd(e) {
  this._internalRoot = e;
}
function Zd(e) {
  this._internalRoot = e;
}
function Yd(e) {
  return !(!e || (1 !== e.nodeType && 9 !== e.nodeType && 11 !== e.nodeType));
}
function Xd(e) {
  return !(
    !e ||
    (1 !== e.nodeType &&
      9 !== e.nodeType &&
      11 !== e.nodeType &&
      (8 !== e.nodeType || " react-mount-point-unstable " !== e.nodeValue))
  );
}
function Qd() {}
function Jd(e, t, n, i, r) {
  var o = n._reactRootContainer;
  if (o) {
    var s = o;
    if ("function" == typeof r) {
      var a = r;
      r = function () {
        var e = Ud(s);
        a.call(e);
      };
    }
    zd(t, s, e, r);
  } else
    s = (function (e, t, n, i, r) {
      if (r) {
        if ("function" == typeof i) {
          var o = i;
          i = function () {
            var e = Ud(s);
            o.call(e);
          };
        }
        var s = Hd(t, i, e, 0, null, !1, 0, "", Qd);
        return (
          (e._reactRootContainer = s),
          (e[mo] = s.current),
          zr(8 === e.nodeType ? e.parentNode : e),
          dd(),
          s
        );
      }
      for (; (r = e.lastChild); ) e.removeChild(r);
      if ("function" == typeof i) {
        var a = i;
        i = function () {
          var e = Ud(l);
          a.call(e);
        };
      }
      var l = Vd(e, 0, !1, null, 0, !1, 0, "", Qd);
      return (
        (e._reactRootContainer = l),
        (e[mo] = l.current),
        zr(8 === e.nodeType ? e.parentNode : e),
        dd(function () {
          zd(t, l, n, i);
        }),
        l
      );
    })(n, t, e, r, i);
  return Ud(s);
}
((Zd.prototype.render = Gd.prototype.render =
  function (e) {
    var t = this._internalRoot;
    if (null === t) throw Error(ae(409));
    zd(e, t, null, null);
  }),
  (Zd.prototype.unmount = Gd.prototype.unmount =
    function () {
      var e = this._internalRoot;
      if (null !== e) {
        this._internalRoot = null;
        var t = e.containerInfo;
        (dd(function () {
          zd(null, e, null, null);
        }),
          (t[mo] = null));
      }
    }),
  (Zd.prototype.unstable_scheduleHydration = function (e) {
    if (e) {
      var t = En();
      e = { blockedOn: null, target: e, priority: t };
      for (var n = 0; n < An.length && 0 !== t && t < An[n].priority; n++);
      (An.splice(n, 0, e), 0 === n && Bn(e));
    }
  }),
  (Cn = function (e) {
    switch (e.tag) {
      case 3:
        var t = e.stateNode;
        if (t.current.memoizedState.isDehydrated) {
          var n = gn(t.pendingLanes);
          0 !== n && (yn(t, 1 | n), id(t, Qt()), !(6 & Lc) && ((Hc = Qt() + 500), Uo()));
        }
        break;
      case 13:
        (dd(function () {
          var t = Ps(e, 1);
          if (null !== t) {
            var n = ed();
            nd(t, e, 1, n);
          }
        }),
          qd(e, 1));
    }
  }),
  (Sn = function (e) {
    if (13 === e.tag) {
      var t = Ps(e, 134217728);
      if (null !== t) nd(t, e, 134217728, ed());
      qd(e, 134217728);
    }
  }),
  (kn = function (e) {
    if (13 === e.tag) {
      var t = td(e),
        n = Ps(e, t);
      if (null !== n) nd(n, e, t, ed());
      qd(e, t);
    }
  }),
  (En = function () {
    return xn;
  }),
  (Nn = function (e, t) {
    var n = xn;
    try {
      return ((xn = e), t());
    } finally {
      xn = n;
    }
  }),
  (Ct = function (e, t, n) {
    switch (t) {
      case "input":
        if ((et(e, n), (t = n.name), "radio" === n.type && null != t)) {
          for (n = e; n.parentNode; ) n = n.parentNode;
          for (
            n = n.querySelectorAll("input[name=" + JSON.stringify("" + t) + '][type="radio"]'),
              t = 0;
            t < n.length;
            t++
          ) {
            var i = n[t];
            if (i !== e && i.form === e.form) {
              var r = Co(i);
              if (!r) throw Error(ae(90));
              (Ze(i), et(i, r));
            }
          }
        }
        break;
      case "textarea":
        at(e, n);
        break;
      case "select":
        null != (t = n.value) && rt(e, !!n.multiple, t, !1);
    }
  }),
  (Dt = cd),
  (Tt = dd));
var eu = { usingClientEntryPoint: !1, Events: [xo, wo, Co, Nt, Lt, cd] },
  tu = {
    findFiberByHostInstance: yo,
    bundleType: 0,
    version: "18.3.1",
    rendererPackageName: "react-dom",
  },
  nu = {
    bundleType: tu.bundleType,
    version: tu.version,
    rendererPackageName: tu.rendererPackageName,
    rendererConfig: tu.rendererConfig,
    overrideHookState: null,
    overrideHookStateDeletePath: null,
    overrideHookStateRenamePath: null,
    overrideProps: null,
    overridePropsDeletePath: null,
    overridePropsRenamePath: null,
    setErrorHandler: null,
    setSuspenseHandler: null,
    scheduleUpdate: null,
    currentDispatcherRef: we.ReactCurrentDispatcher,
    findHostInstanceByFiber: function (e) {
      return null === (e = qt(e)) ? null : e.stateNode;
    },
    findFiberByHostInstance:
      tu.findFiberByHostInstance ||
      function () {
        return null;
      },
    findHostInstancesForRefresh: null,
    scheduleRefresh: null,
    scheduleRoot: null,
    setRefreshHandler: null,
    getCurrentFiber: null,
    reconcilerVersion: "18.3.1-next-f1338f8080-20240426",
  };
if ("undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
  var iu = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  if (!iu.isDisabled && iu.supportsFiber)
    try {
      ((sn = iu.inject(nu)), (an = iu));
    } catch (Lmt) {}
}
((te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = eu),
  (te.createPortal = function (e, t) {
    var n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
    if (!Yd(t)) throw Error(ae(200));
    return (function (e, t, n) {
      var i = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
      return {
        $$typeof: Se,
        key: null == i ? null : "" + i,
        children: e,
        containerInfo: t,
        implementation: n,
      };
    })(e, t, null, n);
  }),
  (te.createRoot = function (e, t) {
    if (!Yd(e)) throw Error(ae(299));
    var n = !1,
      i = "",
      r = Kd;
    return (
      null != t &&
        (!0 === t.unstable_strictMode && (n = !0),
        void 0 !== t.identifierPrefix && (i = t.identifierPrefix),
        void 0 !== t.onRecoverableError && (r = t.onRecoverableError)),
      (t = Vd(e, 1, !1, null, 0, n, 0, i, r)),
      (e[mo] = t.current),
      zr(8 === e.nodeType ? e.parentNode : e),
      new Gd(t)
    );
  }),
  (te.findDOMNode = function (e) {
    if (null == e) return null;
    if (1 === e.nodeType) return e;
    var t = e._reactInternals;
    if (void 0 === t) {
      if ("function" == typeof e.render) throw Error(ae(188));
      throw ((e = Object.keys(e).join(",")), Error(ae(268, e)));
    }
    return (e = null === (e = qt(t)) ? null : e.stateNode);
  }),
  (te.flushSync = function (e) {
    return dd(e);
  }),
  (te.hydrate = function (e, t, n) {
    if (!Xd(t)) throw Error(ae(200));
    return Jd(null, e, t, !0, n);
  }),
  (te.hydrateRoot = function (e, t, n) {
    if (!Yd(e)) throw Error(ae(405));
    var i = (null != n && n.hydratedSources) || null,
      r = !1,
      o = "",
      s = Kd;
    if (
      (null != n &&
        (!0 === n.unstable_strictMode && (r = !0),
        void 0 !== n.identifierPrefix && (o = n.identifierPrefix),
        void 0 !== n.onRecoverableError && (s = n.onRecoverableError)),
      (t = Hd(t, null, e, 1, null != n ? n : null, r, 0, o, s)),
      (e[mo] = t.current),
      zr(e),
      i)
    )
      for (e = 0; e < i.length; e++)
        ((r = (r = (n = i[e])._getVersion)(n._source)),
          null == t.mutableSourceEagerHydrationData
            ? (t.mutableSourceEagerHydrationData = [n, r])
            : t.mutableSourceEagerHydrationData.push(n, r));
    return new Zd(t);
  }),
  (te.render = function (e, t, n) {
    if (!Xd(t)) throw Error(ae(200));
    return Jd(null, e, t, !1, n);
  }),
  (te.unmountComponentAtNode = function (e) {
    if (!Xd(e)) throw Error(ae(40));
    return (
      !!e._reactRootContainer &&
      (dd(function () {
        Jd(null, null, e, !1, function () {
          ((e._reactRootContainer = null), (e[mo] = null));
        });
      }),
      !0)
    );
  }),
  (te.unstable_batchedUpdates = cd),
  (te.unstable_renderSubtreeIntoContainer = function (e, t, n, i) {
    if (!Xd(n)) throw Error(ae(200));
    if (null == e || void 0 === e._reactInternals) throw Error(ae(38));
    return Jd(e, t, n, !1, i);
  }),
  (te.version = "18.3.1-next-f1338f8080-20240426"),
  (function e() {
    if (
      "undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
      "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE
    )
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
      } catch (t) {}
  })(),
  (ee.exports = te));
var ru = ee.exports;
const ou = n(ru),
  su = e({ __proto__: null, default: ou }, [ru]);
var au,
  lu = ru;
/**
 * @remix-run/router v1.23.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */
function cu() {
  return (
    (cu = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    cu.apply(this, arguments)
  );
}
((J.createRoot = lu.createRoot),
  (J.hydrateRoot = lu.hydrateRoot),
  (function (e) {
    ((e.Pop = "POP"), (e.Push = "PUSH"), (e.Replace = "REPLACE"));
  })(au || (au = {})));
const du = "popstate";
function uu(e) {
  return (
    void 0 === e && (e = {}),
    (function (e, t, n, i) {
      void 0 === i && (i = {});
      let { window: r = document.defaultView, v5Compat: o = !1 } = i,
        s = r.history,
        a = au.Pop,
        l = null,
        c = d();
      null == c && ((c = 0), s.replaceState(cu({}, s.state, { idx: c }), ""));
      function d() {
        return (s.state || { idx: null }).idx;
      }
      function u() {
        a = au.Pop;
        let e = d(),
          t = null == e ? null : e - c;
        ((c = e), l && l({ action: a, location: f.location, delta: t }));
      }
      function h(e, t) {
        a = au.Push;
        let i = fu(f.location, e, t);
        (n && n(i, e), (c = d() + 1));
        let u = pu(i, c),
          h = f.createHref(i);
        try {
          s.pushState(u, "", h);
        } catch (D2t) {
          if (D2t instanceof DOMException && "DataCloneError" === D2t.name) throw D2t;
          r.location.assign(h);
        }
        o && l && l({ action: a, location: f.location, delta: 1 });
      }
      function g(e, t) {
        a = au.Replace;
        let i = fu(f.location, e, t);
        (n && n(i, e), (c = d()));
        let r = pu(i, c),
          u = f.createHref(i);
        (s.replaceState(r, "", u), o && l && l({ action: a, location: f.location, delta: 0 }));
      }
      function p(e) {
        let t = "null" !== r.location.origin ? r.location.origin : r.location.href,
          n = "string" == typeof e ? e : mu(e);
        return (
          (n = n.replace(/ $/, "%20")),
          hu(t, "No window.location.(origin|href) available to create URL for href: " + n),
          new URL(n, t)
        );
      }
      let f = {
        get action() {
          return a;
        },
        get location() {
          return e(r, s);
        },
        listen(e) {
          if (l) throw new Error("A history only accepts one active listener");
          return (
            r.addEventListener(du, u),
            (l = e),
            () => {
              (r.removeEventListener(du, u), (l = null));
            }
          );
        },
        createHref: (e) => t(r, e),
        createURL: p,
        encodeLocation(e) {
          let t = p(e);
          return { pathname: t.pathname, search: t.search, hash: t.hash };
        },
        push: h,
        replace: g,
        go: (e) => s.go(e),
      };
      return f;
    })(
      function (e, t) {
        let { pathname: n = "/", search: i = "", hash: r = "" } = _u(e.location.hash.substr(1));
        return (
          n.startsWith("/") || n.startsWith(".") || (n = "/" + n),
          fu(
            "",
            { pathname: n, search: i, hash: r },
            (t.state && t.state.usr) || null,
            (t.state && t.state.key) || "default",
          )
        );
      },
      function (e, t) {
        let n = e.document.querySelector("base"),
          i = "";
        if (n && n.getAttribute("href")) {
          let t = e.location.href,
            n = t.indexOf("#");
          i = -1 === n ? t : t.slice(0, n);
        }
        return i + "#" + ("string" == typeof t ? t : mu(t));
      },
      function (e, t) {
        gu(
          "/" === e.pathname.charAt(0),
          "relative pathnames are not supported in hash history.push(" + JSON.stringify(t) + ")",
        );
      },
      e,
    )
  );
}
function hu(e, t) {
  if (!1 === e || null == e) throw new Error(t);
}
function gu(e, t) {
  if (!e)
    try {
      throw new Error(t);
    } catch (spt) {}
}
function pu(e, t) {
  return { usr: e.state, key: e.key, idx: t };
}
function fu(e, t, n, i) {
  return (
    void 0 === n && (n = null),
    cu(
      { pathname: "string" == typeof e ? e : e.pathname, search: "", hash: "" },
      "string" == typeof t ? _u(t) : t,
      { state: n, key: (t && t.key) || i || Math.random().toString(36).substr(2, 8) },
    )
  );
}
function mu(e) {
  let { pathname: t = "/", search: n = "", hash: i = "" } = e;
  return (
    n && "?" !== n && (t += "?" === n.charAt(0) ? n : "?" + n),
    i && "#" !== i && (t += "#" === i.charAt(0) ? i : "#" + i),
    t
  );
}
function _u(e) {
  let t = {};
  if (e) {
    let n = e.indexOf("#");
    n >= 0 && ((t.hash = e.substr(n)), (e = e.substr(0, n)));
    let i = e.indexOf("?");
    (i >= 0 && ((t.search = e.substr(i)), (e = e.substr(0, i))), e && (t.pathname = e));
  }
  return t;
}
var vu;
!(function (e) {
  ((e.data = "data"), (e.deferred = "deferred"), (e.redirect = "redirect"), (e.error = "error"));
})(vu || (vu = {}));
const bu = new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]);
function yu(e, t, n, i) {
  return (
    void 0 === n && (n = []),
    void 0 === i && (i = {}),
    e.map((e, r) => {
      let o = [...n, String(r)],
        s = "string" == typeof e.id ? e.id : o.join("-");
      if (
        (hu(!0 !== e.index || !e.children, "Cannot specify children on an index route"),
        hu(
          !i[s],
          'Found a route id collision on id "' +
            s +
            "\".  Route id's must be globally unique within Data Router usages",
        ),
        (function (e) {
          return !0 === e.index;
        })(e))
      ) {
        let n = cu({}, e, t(e), { id: s });
        return ((i[s] = n), n);
      }
      {
        let n = cu({}, e, t(e), { id: s, children: void 0 });
        return ((i[s] = n), e.children && (n.children = yu(e.children, t, o, i)), n);
      }
    })
  );
}
function xu(e, t, n) {
  return (void 0 === n && (n = "/"), wu(e, t, n, !1));
}
function wu(e, t, n, i) {
  let r = Pu(("string" == typeof t ? _u(t) : t).pathname || "/", n);
  if (null == r) return null;
  let o = Cu(e);
  !(function (e) {
    e.sort((e, t) =>
      e.score !== t.score
        ? t.score - e.score
        : (function (e, t) {
            let n = e.length === t.length && e.slice(0, -1).every((e, n) => e === t[n]);
            return n ? e[e.length - 1] - t[t.length - 1] : 0;
          })(
            e.routesMeta.map((e) => e.childrenIndex),
            t.routesMeta.map((e) => e.childrenIndex),
          ),
    );
  })(o);
  let s = null;
  for (let a = 0; null == s && a < o.length; ++a) {
    let e = Au(r);
    s = Ou(o[a], e, i);
  }
  return s;
}
function Cu(e, t, n, i) {
  (void 0 === t && (t = []), void 0 === n && (n = []), void 0 === i && (i = ""));
  let r = (e, r, o) => {
    let s = {
      relativePath: void 0 === o ? e.path || "" : o,
      caseSensitive: !0 === e.caseSensitive,
      childrenIndex: r,
      route: e,
    };
    s.relativePath.startsWith("/") &&
      (hu(
        s.relativePath.startsWith(i),
        'Absolute route path "' +
          s.relativePath +
          '" nested under path "' +
          i +
          '" is not valid. An absolute child route path must start with the combined path of all its parent routes.',
      ),
      (s.relativePath = s.relativePath.slice(i.length)));
    let a = Uu([i, s.relativePath]),
      l = n.concat(s);
    (e.children &&
      e.children.length > 0 &&
      (hu(
        !0 !== e.index,
        'Index routes must not have child routes. Please remove all child routes from route path "' +
          a +
          '".',
      ),
      Cu(e.children, t, l, a)),
      (null != e.path || e.index) && t.push({ path: a, score: Ru(a, e.index), routesMeta: l }));
  };
  return (
    e.forEach((e, t) => {
      var n;
      if ("" !== e.path && null != (n = e.path) && n.includes("?"))
        for (let i of Su(e.path)) r(e, t, i);
      else r(e, t);
    }),
    t
  );
}
function Su(e) {
  let t = e.split("/");
  if (0 === t.length) return [];
  let [n, ...i] = t,
    r = n.endsWith("?"),
    o = n.replace(/\?$/, "");
  if (0 === i.length) return r ? [o, ""] : [o];
  let s = Su(i.join("/")),
    a = [];
  return (
    a.push(...s.map((e) => ("" === e ? o : [o, e].join("/")))),
    r && a.push(...s),
    a.map((t) => (e.startsWith("/") && "" === t ? "/" : t))
  );
}
const ku = /^:[\w-]+$/,
  Eu = 3,
  Nu = 2,
  Lu = 1,
  Du = 10,
  Tu = -2,
  Iu = (e) => "*" === e;
function Ru(e, t) {
  let n = e.split("/"),
    i = n.length;
  return (
    n.some(Iu) && (i += Tu),
    t && (i += Nu),
    n.filter((e) => !Iu(e)).reduce((e, t) => e + (ku.test(t) ? Eu : "" === t ? Lu : Du), i)
  );
}
function Ou(e, t, n) {
  void 0 === n && (n = !1);
  let { routesMeta: i } = e,
    r = {},
    o = "/",
    s = [];
  for (let a = 0; a < i.length; ++a) {
    let e = i[a],
      l = a === i.length - 1,
      c = "/" === o ? t : t.slice(o.length) || "/",
      d = Mu({ path: e.relativePath, caseSensitive: e.caseSensitive, end: l }, c),
      u = e.route;
    if (
      (!d &&
        l &&
        n &&
        !i[i.length - 1].route.index &&
        (d = Mu({ path: e.relativePath, caseSensitive: e.caseSensitive, end: !1 }, c)),
      !d)
    )
      return null;
    (Object.assign(r, d.params),
      s.push({
        params: r,
        pathname: Uu([o, d.pathname]),
        pathnameBase: $u(Uu([o, d.pathnameBase])),
        route: u,
      }),
      "/" !== d.pathnameBase && (o = Uu([o, d.pathnameBase])));
  }
  return s;
}
function Mu(e, t) {
  "string" == typeof e && (e = { path: e, caseSensitive: !1, end: !0 });
  let [n, i] = (function (e, t, n) {
      void 0 === t && (t = !1);
      void 0 === n && (n = !0);
      gu(
        "*" === e || !e.endsWith("*") || e.endsWith("/*"),
        'Route path "' +
          e +
          '" will be treated as if it were "' +
          e.replace(/\*$/, "/*") +
          '" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "' +
          e.replace(/\*$/, "/*") +
          '".',
      );
      let i = [],
        r =
          "^" +
          e
            .replace(/\/*\*?$/, "")
            .replace(/^\/*/, "/")
            .replace(/[\\.*+^${}|()[\]]/g, "\\$&")
            .replace(
              /\/:([\w-]+)(\?)?/g,
              (e, t, n) => (
                i.push({ paramName: t, isOptional: null != n }),
                n ? "/?([^\\/]+)?" : "/([^\\/]+)"
              ),
            );
      e.endsWith("*")
        ? (i.push({ paramName: "*" }),
          (r += "*" === e || "/*" === e ? "(.*)$" : "(?:\\/(.+)|\\/*)$"))
        : n
          ? (r += "\\/*$")
          : "" !== e && "/" !== e && (r += "(?:(?=\\/|$))");
      let o = new RegExp(r, t ? void 0 : "i");
      return [o, i];
    })(e.path, e.caseSensitive, e.end),
    r = t.match(n);
  if (!r) return null;
  let o = r[0],
    s = o.replace(/(.)\/+$/, "$1"),
    a = r.slice(1),
    l = i.reduce((e, t, n) => {
      let { paramName: i, isOptional: r } = t;
      if ("*" === i) {
        let e = a[n] || "";
        s = o.slice(0, o.length - e.length).replace(/(.)\/+$/, "$1");
      }
      const l = a[n];
      return ((e[i] = r && !l ? void 0 : (l || "").replace(/%2F/g, "/")), e);
    }, {});
  return { params: l, pathname: o, pathnameBase: s, pattern: e };
}
function Au(e) {
  try {
    return e
      .split("/")
      .map((e) => decodeURIComponent(e).replace(/\//g, "%2F"))
      .join("/");
  } catch (D2t) {
    return (
      gu(
        !1,
        'The URL path "' +
          e +
          '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (' +
          D2t +
          ").",
      ),
      e
    );
  }
}
function Pu(e, t) {
  if ("/" === t) return e;
  if (!e.toLowerCase().startsWith(t.toLowerCase())) return null;
  let n = t.endsWith("/") ? t.length - 1 : t.length,
    i = e.charAt(n);
  return i && "/" !== i ? null : e.slice(n) || "/";
}
const ju = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
function Fu(e, t) {
  void 0 === t && (t = "/");
  let n,
    { pathname: i, search: r = "", hash: o = "" } = "string" == typeof e ? _u(e) : e;
  if (i)
    if (((s = i), ju.test(s))) n = i;
    else {
      if (i.includes("//")) {
        let e = i;
        ((i = i.replace(/\/\/+/g, "/")),
          gu(!1, "Pathnames cannot have embedded double slashes - normalizing " + e + " -> " + i));
      }
      n = i.startsWith("/") ? Bu(i.substring(1), "/") : Bu(i, t);
    }
  else n = t;
  var s;
  return { pathname: n, search: qu(r), hash: Ku(o) };
}
function Bu(e, t) {
  let n = t.replace(/\/+$/, "").split("/");
  return (
    e.split("/").forEach((e) => {
      ".." === e ? n.length > 1 && n.pop() : "." !== e && n.push(e);
    }),
    n.length > 1 ? n.join("/") : "/"
  );
}
function Vu(e, t, n, i) {
  return (
    "Cannot include a '" +
    e +
    "' character in a manually specified `to." +
    t +
    "` field [" +
    JSON.stringify(i) +
    "].  Please separate it out to the `to." +
    n +
    '` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'
  );
}
function Wu(e) {
  return e.filter((e, t) => 0 === t || (e.route.path && e.route.path.length > 0));
}
function Hu(e, t) {
  let n = Wu(e);
  return t
    ? n.map((e, t) => (t === n.length - 1 ? e.pathname : e.pathnameBase))
    : n.map((e) => e.pathnameBase);
}
function zu(e, t, n, i) {
  let r;
  (void 0 === i && (i = !1),
    "string" == typeof e
      ? (r = _u(e))
      : ((r = cu({}, e)),
        hu(!r.pathname || !r.pathname.includes("?"), Vu("?", "pathname", "search", r)),
        hu(!r.pathname || !r.pathname.includes("#"), Vu("#", "pathname", "hash", r)),
        hu(!r.search || !r.search.includes("#"), Vu("#", "search", "hash", r))));
  let o,
    s = "" === e || "" === r.pathname,
    a = s ? "/" : r.pathname;
  if (null == a) o = n;
  else {
    let e = t.length - 1;
    if (!i && a.startsWith("..")) {
      let t = a.split("/");
      for (; ".." === t[0]; ) (t.shift(), (e -= 1));
      r.pathname = t.join("/");
    }
    o = e >= 0 ? t[e] : "/";
  }
  let l = Fu(r, o),
    c = a && "/" !== a && a.endsWith("/"),
    d = (s || "." === a) && n.endsWith("/");
  return (l.pathname.endsWith("/") || (!c && !d) || (l.pathname += "/"), l);
}
const Uu = (e) => e.join("/").replace(/\/\/+/g, "/"),
  $u = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"),
  qu = (e) => (e && "?" !== e ? (e.startsWith("?") ? e : "?" + e) : ""),
  Ku = (e) => (e && "#" !== e ? (e.startsWith("#") ? e : "#" + e) : "");
class Gu {
  constructor(e, t, n, i) {
    (void 0 === i && (i = !1),
      (this.status = e),
      (this.statusText = t || ""),
      (this.internal = i),
      n instanceof Error ? ((this.data = n.toString()), (this.error = n)) : (this.data = n));
  }
}
function Zu(e) {
  return (
    null != e &&
    "number" == typeof e.status &&
    "string" == typeof e.statusText &&
    "boolean" == typeof e.internal &&
    "data" in e
  );
}
const Yu = ["post", "put", "patch", "delete"],
  Xu = new Set(Yu),
  Qu = ["get", ...Yu],
  Ju = new Set(Qu),
  eh = new Set([301, 302, 303, 307, 308]),
  th = new Set([307, 308]),
  nh = {
    state: "idle",
    location: void 0,
    formMethod: void 0,
    formAction: void 0,
    formEncType: void 0,
    formData: void 0,
    json: void 0,
    text: void 0,
  },
  ih = {
    state: "idle",
    data: void 0,
    formMethod: void 0,
    formAction: void 0,
    formEncType: void 0,
    formData: void 0,
    json: void 0,
    text: void 0,
  },
  rh = { state: "unblocked", proceed: void 0, reset: void 0, location: void 0 },
  oh = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,
  sh = (e) => ({ hasErrorBoundary: Boolean(e.hasErrorBoundary) }),
  ah = "remix-router-transitions";
function lh(e) {
  const t = e.window ? e.window : "undefined" != typeof window ? window : void 0,
    n = void 0 !== t && void 0 !== t.document && void 0 !== t.document.createElement,
    i = !n;
  let r;
  if (
    (hu(e.routes.length > 0, "You must provide a non-empty routes array to createRouter"),
    e.mapRouteProperties)
  )
    r = e.mapRouteProperties;
  else if (e.detectErrorBoundary) {
    let t = e.detectErrorBoundary;
    r = (e) => ({ hasErrorBoundary: t(e) });
  } else r = sh;
  let o,
    s,
    a,
    l = {},
    c = yu(e.routes, r, void 0, l),
    d = e.basename || "/",
    u = e.dataStrategy || vh,
    h = e.patchRoutesOnNavigation,
    g = cu(
      {
        v7_fetcherPersist: !1,
        v7_normalizeFormMethod: !1,
        v7_partialHydration: !1,
        v7_prependBasename: !1,
        v7_relativeSplatPath: !1,
        v7_skipActionErrorRevalidation: !1,
      },
      e.future,
    ),
    p = null,
    f = new Set(),
    m = null,
    _ = null,
    v = null,
    b = null != e.hydrationData,
    y = xu(c, e.history.location, d),
    x = !1,
    w = null;
  if (null == y && !h) {
    let t = Th(404, { pathname: e.history.location.pathname }),
      { matches: n, route: i } = Dh(c);
    ((y = n), (w = { [i.id]: t }));
  }
  if (y && !e.hydrationData) {
    pe(y, c, e.history.location.pathname).active && (y = null);
  }
  if (y)
    if (y.some((e) => e.route.lazy)) s = !1;
    else if (y.some((e) => e.route.loader))
      if (g.v7_partialHydration) {
        let t = e.hydrationData ? e.hydrationData.loaderData : null,
          n = e.hydrationData ? e.hydrationData.errors : null;
        if (n) {
          let e = y.findIndex((e) => void 0 !== n[e.route.id]);
          s = y.slice(0, e + 1).every((e) => !gh(e.route, t, n));
        } else s = y.every((e) => !gh(e.route, t, n));
      } else s = null != e.hydrationData;
    else s = !0;
  else if (((s = !1), (y = []), g.v7_partialHydration)) {
    let t = pe(null, c, e.history.location.pathname);
    t.active && t.matches && ((x = !0), (y = t.matches));
  }
  let C,
    S,
    k = {
      historyAction: e.history.action,
      location: e.history.location,
      matches: y,
      initialized: s,
      navigation: nh,
      restoreScrollPosition: null == e.hydrationData && null,
      preventScrollReset: !1,
      revalidation: "idle",
      loaderData: (e.hydrationData && e.hydrationData.loaderData) || {},
      actionData: (e.hydrationData && e.hydrationData.actionData) || null,
      errors: (e.hydrationData && e.hydrationData.errors) || w,
      fetchers: new Map(),
      blockers: new Map(),
    },
    E = au.Pop,
    N = !1,
    L = !1,
    D = new Map(),
    T = null,
    I = !1,
    R = !1,
    O = [],
    M = new Set(),
    A = new Map(),
    P = 0,
    j = -1,
    F = new Map(),
    B = new Set(),
    V = new Map(),
    W = new Map(),
    H = new Set(),
    z = new Map(),
    U = new Map();
  function $(e, t) {
    (void 0 === t && (t = {}), (k = cu({}, k, e)));
    let n = [],
      i = [];
    (g.v7_fetcherPersist &&
      k.fetchers.forEach((e, t) => {
        "idle" === e.state && (H.has(t) ? i.push(t) : n.push(t));
      }),
      H.forEach((e) => {
        k.fetchers.has(e) || A.has(e) || i.push(e);
      }),
      [...f].forEach((e) =>
        e(k, {
          deletedFetchers: i,
          viewTransitionOpts: t.viewTransitionOpts,
          flushSync: !0 === t.flushSync,
        }),
      ),
      g.v7_fetcherPersist
        ? (n.forEach((e) => k.fetchers.delete(e)), i.forEach((e) => ne(e)))
        : i.forEach((e) => H.delete(e)));
  }
  function q(t, n, i) {
    var r, s;
    let a,
      { flushSync: l } = void 0 === i ? {} : i,
      d =
        null != k.actionData &&
        null != k.navigation.formMethod &&
        Bh(k.navigation.formMethod) &&
        "loading" === k.navigation.state &&
        !0 !== (null == (r = t.state) ? void 0 : r._isRedirect);
    a = n.actionData
      ? Object.keys(n.actionData).length > 0
        ? n.actionData
        : null
      : d
        ? k.actionData
        : null;
    let u = n.loaderData ? Eh(k.loaderData, n.loaderData, n.matches || [], n.errors) : k.loaderData,
      h = k.blockers;
    h.size > 0 && ((h = new Map(h)), h.forEach((e, t) => h.set(t, rh)));
    let g,
      p =
        !0 === N ||
        (null != k.navigation.formMethod &&
          Bh(k.navigation.formMethod) &&
          !0 !== (null == (s = t.state) ? void 0 : s._isRedirect));
    if (
      (o && ((c = o), (o = void 0)),
      I ||
        E === au.Pop ||
        (E === au.Push
          ? e.history.push(t, t.state)
          : E === au.Replace && e.history.replace(t, t.state)),
      E === au.Pop)
    ) {
      let e = D.get(k.location.pathname);
      e && e.has(t.pathname)
        ? (g = { currentLocation: k.location, nextLocation: t })
        : D.has(t.pathname) && (g = { currentLocation: t, nextLocation: k.location });
    } else if (L) {
      let e = D.get(k.location.pathname);
      (e ? e.add(t.pathname) : ((e = new Set([t.pathname])), D.set(k.location.pathname, e)),
        (g = { currentLocation: k.location, nextLocation: t }));
    }
    ($(
      cu({}, n, {
        actionData: a,
        loaderData: u,
        historyAction: E,
        location: t,
        initialized: !0,
        navigation: nh,
        revalidation: "idle",
        restoreScrollPosition: ge(t, n.matches || k.matches),
        preventScrollReset: p,
        blockers: h,
      }),
      { viewTransitionOpts: g, flushSync: !0 === l },
    ),
      (E = au.Pop),
      (N = !1),
      (L = !1),
      (I = !1),
      (R = !1),
      (O = []));
  }
  async function K(t, n, i) {
    (C && C.abort(),
      (C = null),
      (E = t),
      (I = !0 === (i && i.startUninterruptedRevalidation)),
      (function (e, t) {
        if (m && v) {
          let n = he(e, t);
          m[n] = v();
        }
      })(k.location, k.matches),
      (N = !0 === (i && i.preventScrollReset)),
      (L = !0 === (i && i.enableViewTransition)));
    let r = o || c,
      s = i && i.overrideNavigation,
      a =
        null != i && i.initialHydration && k.matches && k.matches.length > 0 && !x
          ? k.matches
          : xu(r, n, d),
      l = !0 === (i && i.flushSync);
    if (
      a &&
      k.initialized &&
      !R &&
      (function (e, t) {
        if (e.pathname !== t.pathname || e.search !== t.search) return !1;
        if ("" === e.hash) return "" !== t.hash;
        if (e.hash === t.hash) return !0;
        if ("" !== t.hash) return !0;
        return !1;
      })(k.location, n) &&
      !(i && i.submission && Bh(i.submission.formMethod))
    )
      return void q(n, { matches: a }, { flushSync: l });
    let u = pe(a, r, n.pathname);
    if ((u.active && u.matches && (a = u.matches), !a)) {
      let { error: e, notFoundMatches: t, route: i } = de(n.pathname);
      return void q(n, { matches: t, loaderData: {}, errors: { [i.id]: e } }, { flushSync: l });
    }
    C = new AbortController();
    let h,
      p = wh(e.history, n, C.signal, i && i.submission);
    if (i && i.pendingError) h = [Lh(a).route.id, { type: vu.error, error: i.pendingError }];
    else if (i && i.submission && Bh(i.submission.formMethod)) {
      let t = await (async function (e, t, n, i, r, o) {
        void 0 === o && (o = {});
        Q();
        let s,
          a = (function (e, t) {
            let n = {
              state: "submitting",
              location: e,
              formMethod: t.formMethod,
              formAction: t.formAction,
              formEncType: t.formEncType,
              formData: t.formData,
              json: t.json,
              text: t.text,
            };
            return n;
          })(t, n);
        if (($({ navigation: a }, { flushSync: !0 === o.flushSync }), r)) {
          let n = await fe(i, t.pathname, e.signal);
          if ("aborted" === n.type) return { shortCircuited: !0 };
          if ("error" === n.type) {
            let e = Lh(n.partialMatches).route.id;
            return {
              matches: n.partialMatches,
              pendingActionResult: [e, { type: vu.error, error: n.error }],
            };
          }
          if (!n.matches) {
            let { notFoundMatches: e, error: n, route: i } = de(t.pathname);
            return { matches: e, pendingActionResult: [i.id, { type: vu.error, error: n }] };
          }
          i = n.matches;
        }
        let l = Uh(i, t);
        if (l.route.action || l.route.lazy) {
          if (((s = (await Y("action", k, e, [l], i, null))[l.route.id]), e.signal.aborted))
            return { shortCircuited: !0 };
        } else
          s = {
            type: vu.error,
            error: Th(405, { method: e.method, pathname: t.pathname, routeId: l.route.id }),
          };
        if (Ph(s)) {
          let t;
          if (o && null != o.replace) t = o.replace;
          else {
            t =
              xh(s.response.headers.get("Location"), new URL(e.url), d) ===
              k.location.pathname + k.location.search;
          }
          return (await Z(e, s, !0, { submission: n, replace: t }), { shortCircuited: !0 });
        }
        if (Mh(s)) throw Th(400, { type: "defer-action" });
        if (Ah(s)) {
          let e = Lh(i, l.route.id);
          return (
            !0 !== (o && o.replace) && (E = au.Push),
            { matches: i, pendingActionResult: [e.route.id, s] }
          );
        }
        return { matches: i, pendingActionResult: [l.route.id, s] };
      })(p, n, i.submission, a, u.active, { replace: i.replace, flushSync: l });
      if (t.shortCircuited) return;
      if (t.pendingActionResult) {
        let [e, i] = t.pendingActionResult;
        if (Ah(i) && Zu(i.error) && 404 === i.error.status)
          return (
            (C = null),
            void q(n, { matches: t.matches, loaderData: {}, errors: { [e]: i.error } })
          );
      }
      ((a = t.matches || a),
        (h = t.pendingActionResult),
        (s = qh(n, i.submission)),
        (l = !1),
        (u.active = !1),
        (p = wh(e.history, p.url, p.signal)));
    }
    let {
      shortCircuited: f,
      matches: _,
      loaderData: b,
      errors: y,
    } = await (async function (t, n, i, r, s, a, l, u, h, p, f) {
      let m = s || qh(n, a),
        _ = a || l || $h(m),
        v = !(I || (g.v7_partialHydration && h));
      if (r) {
        if (v) {
          let e = G(f);
          $(cu({ navigation: m }, void 0 !== e ? { actionData: e } : {}), { flushSync: p });
        }
        let e = await fe(i, n.pathname, t.signal);
        if ("aborted" === e.type) return { shortCircuited: !0 };
        if ("error" === e.type) {
          let t = Lh(e.partialMatches).route.id;
          return { matches: e.partialMatches, loaderData: {}, errors: { [t]: e.error } };
        }
        if (!e.matches) {
          let { error: e, notFoundMatches: t, route: i } = de(n.pathname);
          return { matches: t, loaderData: {}, errors: { [i.id]: e } };
        }
        i = e.matches;
      }
      let b = o || c,
        [y, x] = hh(
          e.history,
          k,
          i,
          _,
          n,
          g.v7_partialHydration && !0 === h,
          g.v7_skipActionErrorRevalidation,
          R,
          O,
          M,
          H,
          V,
          B,
          b,
          d,
          f,
        );
      if (
        (ue(
          (e) => !(i && i.some((t) => t.route.id === e)) || (y && y.some((t) => t.route.id === e)),
        ),
        (j = ++P),
        0 === y.length && 0 === x.length)
      ) {
        let e = oe();
        return (
          q(
            n,
            cu(
              { matches: i, loaderData: {}, errors: f && Ah(f[1]) ? { [f[0]]: f[1].error } : null },
              Nh(f),
              e ? { fetchers: new Map(k.fetchers) } : {},
            ),
            { flushSync: p },
          ),
          { shortCircuited: !0 }
        );
      }
      if (v) {
        let e = {};
        if (!r) {
          e.navigation = m;
          let t = G(f);
          void 0 !== t && (e.actionData = t);
        }
        (x.length > 0 &&
          (e.fetchers = (function (e) {
            return (
              e.forEach((e) => {
                let t = k.fetchers.get(e.key),
                  n = Kh(void 0, t ? t.data : void 0);
                k.fetchers.set(e.key, n);
              }),
              new Map(k.fetchers)
            );
          })(x)),
          $(e, { flushSync: p }));
      }
      x.forEach((e) => {
        (ie(e.key), e.controller && A.set(e.key, e.controller));
      });
      let w = () => x.forEach((e) => ie(e.key));
      C && C.signal.addEventListener("abort", w);
      let { loaderResults: S, fetcherResults: E } = await X(k, i, y, x, t);
      if (t.signal.aborted) return { shortCircuited: !0 };
      C && C.signal.removeEventListener("abort", w);
      x.forEach((e) => A.delete(e.key));
      let N = Ih(S);
      if (N) return (await Z(t, N.result, !0, { replace: u }), { shortCircuited: !0 });
      if (((N = Ih(E)), N))
        return (B.add(N.key), await Z(t, N.result, !0, { replace: u }), { shortCircuited: !0 });
      let { loaderData: L, errors: D } = kh(k, i, S, f, x, E, z);
      (z.forEach((e, t) => {
        e.subscribe((n) => {
          (n || e.done) && z.delete(t);
        });
      }),
        g.v7_partialHydration && h && k.errors && (D = cu({}, k.errors, D)));
      let T = oe(),
        F = se(j),
        W = T || F || x.length > 0;
      return cu(
        { matches: i, loaderData: L, errors: D },
        W ? { fetchers: new Map(k.fetchers) } : {},
      );
    })(
      p,
      n,
      a,
      u.active,
      s,
      i && i.submission,
      i && i.fetcherSubmission,
      i && i.replace,
      i && !0 === i.initialHydration,
      l,
      h,
    );
    f || ((C = null), q(n, cu({ matches: _ || a }, Nh(h), { loaderData: b, errors: y })));
  }
  function G(e) {
    return e && !Ah(e[1])
      ? { [e[0]]: e[1].data }
      : k.actionData
        ? 0 === Object.keys(k.actionData).length
          ? null
          : k.actionData
        : void 0;
  }
  async function Z(i, r, o, s) {
    let {
      submission: a,
      fetcherSubmission: l,
      preventScrollReset: c,
      replace: u,
    } = void 0 === s ? {} : s;
    r.response.headers.has("X-Remix-Revalidate") && (R = !0);
    let h = r.response.headers.get("Location");
    (hu(h, "Expected a Location header on the redirect Response"), (h = xh(h, new URL(i.url), d)));
    let g = fu(k.location, h, { _isRedirect: !0 });
    if (n) {
      let n = !1;
      if (r.response.headers.has("X-Remix-Reload-Document")) n = !0;
      else if (oh.test(h)) {
        const i = e.history.createURL(h);
        n = i.origin !== t.location.origin || null == Pu(i.pathname, d);
      }
      if (n) return void (u ? t.location.replace(h) : t.location.assign(h));
    }
    C = null;
    let p = !0 === u || r.response.headers.has("X-Remix-Replace") ? au.Replace : au.Push,
      { formMethod: f, formAction: m, formEncType: _ } = k.navigation;
    !a && !l && f && m && _ && (a = $h(k.navigation));
    let v = a || l;
    if (th.has(r.response.status) && v && Bh(v.formMethod))
      await K(p, g, {
        submission: cu({}, v, { formAction: h }),
        preventScrollReset: c || N,
        enableViewTransition: o ? L : void 0,
      });
    else {
      let e = qh(g, a);
      await K(p, g, {
        overrideNavigation: e,
        fetcherSubmission: l,
        preventScrollReset: c || N,
        enableViewTransition: o ? L : void 0,
      });
    }
  }
  async function Y(e, t, n, i, o, s) {
    let a,
      c = {};
    try {
      a = await (async function (e, t, n, i, r, o, s, a, l, c) {
        let d = o.map((e) =>
            e.route.lazy
              ? (async function (e, t, n) {
                  if (!e.lazy) return;
                  let i = await e.lazy();
                  if (!e.lazy) return;
                  let r = n[e.id];
                  hu(r, "No route found in manifest");
                  let o = {};
                  for (let s in i) {
                    let e = void 0 !== r[s] && "hasErrorBoundary" !== s;
                    (gu(
                      !e,
                      'Route "' +
                        r.id +
                        '" has a static property "' +
                        s +
                        '" defined but its lazy function is also returning a value for this property. The lazy route property "' +
                        s +
                        '" will be ignored.',
                    ),
                      e || bu.has(s) || (o[s] = i[s]));
                  }
                  (Object.assign(r, o), Object.assign(r, cu({}, t(r), { lazy: void 0 })));
                })(e.route, l, a)
              : void 0,
          ),
          u = o.map((e, n) => {
            let o = d[n],
              s = r.some((t) => t.route.id === e.route.id),
              a = async (n) => (
                n && "GET" === i.method && (e.route.lazy || e.route.loader) && (s = !0),
                s
                  ? (async function (e, t, n, i, r, o) {
                      let s,
                        a,
                        l = (i) => {
                          let s,
                            l = new Promise((e, t) => (s = t));
                          ((a = () => s()), t.signal.addEventListener("abort", a));
                          let c = (r) =>
                              "function" != typeof i
                                ? Promise.reject(
                                    new Error(
                                      'You cannot call the handler for a route which defines a boolean "' +
                                        e +
                                        '" [routeId: ' +
                                        n.route.id +
                                        "]",
                                    ),
                                  )
                                : i(
                                    { request: t, params: n.params, context: o },
                                    ...(void 0 !== r ? [r] : []),
                                  ),
                            d = (async () => {
                              try {
                                return { type: "data", result: await (r ? r((e) => c(e)) : c()) };
                              } catch (spt) {
                                return { type: "error", result: spt };
                              }
                            })();
                          return Promise.race([d, l]);
                        };
                      try {
                        let r = n.route[e];
                        if (i)
                          if (r) {
                            let e,
                              [t] = await Promise.all([
                                l(r).catch((t) => {
                                  e = t;
                                }),
                                i,
                              ]);
                            if (void 0 !== e) throw e;
                            s = t;
                          } else {
                            if ((await i, (r = n.route[e]), !r)) {
                              if ("action" === e) {
                                let e = new URL(t.url),
                                  i = e.pathname + e.search;
                                throw Th(405, {
                                  method: t.method,
                                  pathname: i,
                                  routeId: n.route.id,
                                });
                              }
                              return { type: vu.data, result: void 0 };
                            }
                            s = await l(r);
                          }
                        else {
                          if (!r) {
                            let e = new URL(t.url);
                            throw Th(404, { pathname: e.pathname + e.search });
                          }
                          s = await l(r);
                        }
                        hu(
                          void 0 !== s.result,
                          "You defined " +
                            ("action" === e ? "an action" : "a loader") +
                            ' for route "' +
                            n.route.id +
                            "\" but didn't return anything from your `" +
                            e +
                            "` function. Please return a value or `null`.",
                        );
                      } catch (spt) {
                        return { type: vu.error, result: spt };
                      } finally {
                        a && t.signal.removeEventListener("abort", a);
                      }
                      return s;
                    })(t, i, e, o, n, c)
                  : Promise.resolve({ type: vu.data, result: void 0 })
              );
            return cu({}, e, { shouldLoad: s, resolve: a });
          }),
          h = await e({ matches: u, request: i, params: o[0].params, fetcherKey: s, context: c });
        try {
          await Promise.all(d);
        } catch (spt) {}
        return h;
      })(u, e, 0, n, i, o, s, l, r);
    } catch (spt) {
      return (
        i.forEach((t) => {
          c[t.route.id] = { type: vu.error, error: spt };
        }),
        c
      );
    }
    for (let [r, l] of Object.entries(a))
      if (Oh(l)) {
        let e = l.result;
        c[r] = { type: vu.redirect, response: yh(e, n, r, o, d, g.v7_relativeSplatPath) };
      } else c[r] = await bh(l);
    return c;
  }
  async function X(t, n, i, r, o) {
    let s = t.matches,
      a = Y("loader", 0, o, i, n, null),
      l = Promise.all(
        r.map(async (t) => {
          if (t.matches && t.match && t.controller) {
            let n = (
              await Y(
                "loader",
                0,
                wh(e.history, t.path, t.controller.signal),
                [t.match],
                t.matches,
                t.key,
              )
            )[t.match.route.id];
            return { [t.key]: n };
          }
          return Promise.resolve({
            [t.key]: { type: vu.error, error: Th(404, { pathname: t.path }) },
          });
        }),
      ),
      c = await a,
      d = (await l).reduce((e, t) => Object.assign(e, t), {});
    return (
      await Promise.all([Vh(n, c, o.signal, s, t.loaderData), Wh(n, d, r)]),
      { loaderResults: c, fetcherResults: d }
    );
  }
  function Q() {
    ((R = !0),
      O.push(...ue()),
      V.forEach((e, t) => {
        (A.has(t) && M.add(t), ie(t));
      }));
  }
  function J(e, t, n) {
    (void 0 === n && (n = {}),
      k.fetchers.set(e, t),
      $({ fetchers: new Map(k.fetchers) }, { flushSync: !0 === (n && n.flushSync) }));
  }
  function ee(e, t, n, i) {
    void 0 === i && (i = {});
    let r = Lh(k.matches, t);
    (ne(e),
      $(
        { errors: { [r.route.id]: n }, fetchers: new Map(k.fetchers) },
        { flushSync: !0 === (i && i.flushSync) },
      ));
  }
  function te(e) {
    return (W.set(e, (W.get(e) || 0) + 1), H.has(e) && H.delete(e), k.fetchers.get(e) || ih);
  }
  function ne(e) {
    let t = k.fetchers.get(e);
    (!A.has(e) || (t && "loading" === t.state && F.has(e)) || ie(e),
      V.delete(e),
      F.delete(e),
      B.delete(e),
      g.v7_fetcherPersist && H.delete(e),
      M.delete(e),
      k.fetchers.delete(e));
  }
  function ie(e) {
    let t = A.get(e);
    t && (t.abort(), A.delete(e));
  }
  function re(e) {
    for (let t of e) {
      let e = Gh(te(t).data);
      k.fetchers.set(t, e);
    }
  }
  function oe() {
    let e = [],
      t = !1;
    for (let n of B) {
      let i = k.fetchers.get(n);
      (hu(i, "Expected fetcher: " + n),
        "loading" === i.state && (B.delete(n), e.push(n), (t = !0)));
    }
    return (re(e), t);
  }
  function se(e) {
    let t = [];
    for (let [n, i] of F)
      if (i < e) {
        let e = k.fetchers.get(n);
        (hu(e, "Expected fetcher: " + n), "loading" === e.state && (ie(n), F.delete(n), t.push(n)));
      }
    return (re(t), t.length > 0);
  }
  function ae(e) {
    (k.blockers.delete(e), U.delete(e));
  }
  function le(e, t) {
    let n = k.blockers.get(e) || rh;
    hu(
      ("unblocked" === n.state && "blocked" === t.state) ||
        ("blocked" === n.state && "blocked" === t.state) ||
        ("blocked" === n.state && "proceeding" === t.state) ||
        ("blocked" === n.state && "unblocked" === t.state) ||
        ("proceeding" === n.state && "unblocked" === t.state),
      "Invalid blocker state transition: " + n.state + " -> " + t.state,
    );
    let i = new Map(k.blockers);
    (i.set(e, t), $({ blockers: i }));
  }
  function ce(e) {
    let { currentLocation: t, nextLocation: n, historyAction: i } = e;
    if (0 === U.size) return;
    U.size > 1 && gu(!1, "A router only supports one blocker at a time");
    let r = Array.from(U.entries()),
      [o, s] = r[r.length - 1],
      a = k.blockers.get(o);
    return a && "proceeding" === a.state
      ? void 0
      : s({ currentLocation: t, nextLocation: n, historyAction: i })
        ? o
        : void 0;
  }
  function de(e) {
    let t = Th(404, { pathname: e }),
      n = o || c,
      { matches: i, route: r } = Dh(n);
    return (ue(), { notFoundMatches: i, route: r, error: t });
  }
  function ue(e) {
    let t = [];
    return (
      z.forEach((n, i) => {
        (e && !e(i)) || (n.cancel(), t.push(i), z.delete(i));
      }),
      t
    );
  }
  function he(e, t) {
    if (_) {
      let n = _(
        e,
        t.map((e) =>
          (function (e, t) {
            let { route: n, pathname: i, params: r } = e;
            return { id: n.id, pathname: i, params: r, data: t[n.id], handle: n.handle };
          })(e, k.loaderData),
        ),
      );
      return n || e.key;
    }
    return e.key;
  }
  function ge(e, t) {
    if (m) {
      let n = he(e, t),
        i = m[n];
      if ("number" == typeof i) return i;
    }
    return null;
  }
  function pe(e, t, n) {
    if (h) {
      if (!e) {
        return { active: !0, matches: wu(t, n, d, !0) || [] };
      }
      if (Object.keys(e[0].params).length > 0) {
        return { active: !0, matches: wu(t, n, d, !0) };
      }
    }
    return { active: !1, matches: null };
  }
  async function fe(e, t, n, i) {
    if (!h) return { type: "success", matches: e };
    let s = e;
    for (;;) {
      let e = null == o,
        a = o || c,
        u = l;
      try {
        await h({
          signal: n,
          path: t,
          matches: s,
          fetcherKey: i,
          patch: (e, t) => {
            n.aborted || mh(e, t, a, u, r);
          },
        });
      } catch (spt) {
        return { type: "error", error: spt, partialMatches: s };
      } finally {
        e && !n.aborted && (c = [...c]);
      }
      if (n.aborted) return { type: "aborted" };
      let g = xu(a, t, d);
      if (g) return { type: "success", matches: g };
      let p = wu(a, t, d, !0);
      if (!p || (s.length === p.length && s.every((e, t) => e.route.id === p[t].route.id)))
        return { type: "success", matches: null };
      s = p;
    }
  }
  return (
    (a = {
      get basename() {
        return d;
      },
      get future() {
        return g;
      },
      get state() {
        return k;
      },
      get routes() {
        return c;
      },
      get window() {
        return t;
      },
      initialize: function () {
        if (
          ((p = e.history.listen((t) => {
            let { action: n, location: i, delta: r } = t;
            if (S) return (S(), void (S = void 0));
            gu(
              0 === U.size || null != r,
              "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.",
            );
            let o = ce({ currentLocation: k.location, nextLocation: i, historyAction: n });
            if (o && null != r) {
              let t = new Promise((e) => {
                S = e;
              });
              return (
                e.history.go(-1 * r),
                void le(o, {
                  state: "blocked",
                  location: i,
                  proceed() {
                    (le(o, { state: "proceeding", proceed: void 0, reset: void 0, location: i }),
                      t.then(() => e.history.go(r)));
                  },
                  reset() {
                    let e = new Map(k.blockers);
                    (e.set(o, rh), $({ blockers: e }));
                  },
                })
              );
            }
            return K(n, i);
          })),
          n)
        ) {
          !(function (e, t) {
            try {
              let n = e.sessionStorage.getItem(ah);
              if (n) {
                let e = JSON.parse(n);
                for (let [n, i] of Object.entries(e || {}))
                  i && Array.isArray(i) && t.set(n, new Set(i || []));
              }
            } catch (spt) {}
          })(t, D);
          let e = () =>
            (function (e, t) {
              if (t.size > 0) {
                let n = {};
                for (let [e, i] of t) n[e] = [...i];
                try {
                  e.sessionStorage.setItem(ah, JSON.stringify(n));
                } catch (D2t) {
                  gu(
                    !1,
                    "Failed to save applied view transitions in sessionStorage (" + D2t + ").",
                  );
                }
              }
            })(
              /**
               * React Router v6.30.2
               *
               * Copyright (c) Remix Software Inc.
               *
               * This source code is licensed under the MIT license found in the
               * LICENSE.md file in the root directory of this source tree.
               *
               * @license MIT
               */ t,
              D,
            );
          (t.addEventListener("pagehide", e), (T = () => t.removeEventListener("pagehide", e)));
        }
        return (k.initialized || K(au.Pop, k.location, { initialHydration: !0 }), a);
      },
      subscribe: function (e) {
        return (f.add(e), () => f.delete(e));
      },
      enableScrollRestoration: function (e, t, n) {
        if (((m = e), (v = t), (_ = n || null), !b && k.navigation === nh)) {
          b = !0;
          let e = ge(k.location, k.matches);
          null != e && $({ restoreScrollPosition: e });
        }
        return () => {
          ((m = null), (v = null), (_ = null));
        };
      },
      navigate: async function t(n, i) {
        if ("number" == typeof n) return void e.history.go(n);
        let r = ch(
            k.location,
            k.matches,
            d,
            g.v7_prependBasename,
            n,
            g.v7_relativeSplatPath,
            null == i ? void 0 : i.fromRouteId,
            null == i ? void 0 : i.relative,
          ),
          { path: o, submission: s, error: a } = dh(g.v7_normalizeFormMethod, !1, r, i),
          l = k.location,
          c = fu(k.location, o, i && i.state);
        c = cu({}, c, e.history.encodeLocation(c));
        let u = i && null != i.replace ? i.replace : void 0,
          h = au.Push;
        !0 === u
          ? (h = au.Replace)
          : !1 === u ||
            (null != s &&
              Bh(s.formMethod) &&
              s.formAction === k.location.pathname + k.location.search &&
              (h = au.Replace));
        let p = i && "preventScrollReset" in i ? !0 === i.preventScrollReset : void 0,
          f = !0 === (i && i.flushSync),
          m = ce({ currentLocation: l, nextLocation: c, historyAction: h });
        if (!m)
          return await K(h, c, {
            submission: s,
            pendingError: a,
            preventScrollReset: p,
            replace: i && i.replace,
            enableViewTransition: i && i.viewTransition,
            flushSync: f,
          });
        le(m, {
          state: "blocked",
          location: c,
          proceed() {
            (le(m, { state: "proceeding", proceed: void 0, reset: void 0, location: c }), t(n, i));
          },
          reset() {
            let e = new Map(k.blockers);
            (e.set(m, rh), $({ blockers: e }));
          },
        });
      },
      fetch: function (t, n, r, s) {
        if (i)
          throw new Error(
            "router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.",
          );
        ie(t);
        let a = !0 === (s && s.flushSync),
          l = o || c,
          u = ch(
            k.location,
            k.matches,
            d,
            g.v7_prependBasename,
            r,
            g.v7_relativeSplatPath,
            n,
            null == s ? void 0 : s.relative,
          ),
          h = xu(l, u, d),
          p = pe(h, l, u);
        if ((p.active && p.matches && (h = p.matches), !h))
          return void ee(t, n, Th(404, { pathname: u }), { flushSync: a });
        let { path: f, submission: m, error: _ } = dh(g.v7_normalizeFormMethod, !0, u, s);
        if (_) return void ee(t, n, _, { flushSync: a });
        let v = Uh(h, f),
          b = !0 === (s && s.preventScrollReset);
        m && Bh(m.formMethod)
          ? (async function (t, n, i, r, s, a, l, u, h) {
              function p(e) {
                if (!e.route.action && !e.route.lazy) {
                  let e = Th(405, { method: h.formMethod, pathname: i, routeId: n });
                  return (ee(t, n, e, { flushSync: l }), !0);
                }
                return !1;
              }
              if ((Q(), V.delete(t), !a && p(r))) return;
              let f = k.fetchers.get(t);
              J(
                t,
                (function (e, t) {
                  let n = {
                    state: "submitting",
                    formMethod: e.formMethod,
                    formAction: e.formAction,
                    formEncType: e.formEncType,
                    formData: e.formData,
                    json: e.json,
                    text: e.text,
                    data: t ? t.data : void 0,
                  };
                  return n;
                })(h, f),
                { flushSync: l },
              );
              let m = new AbortController(),
                _ = wh(e.history, i, m.signal, h);
              if (a) {
                let e = await fe(s, new URL(_.url).pathname, _.signal, t);
                if ("aborted" === e.type) return;
                if ("error" === e.type) return void ee(t, n, e.error, { flushSync: l });
                if (!e.matches) return void ee(t, n, Th(404, { pathname: i }), { flushSync: l });
                if (p((r = Uh((s = e.matches), i)))) return;
              }
              A.set(t, m);
              let v = P,
                b = await Y("action", k, _, [r], s, t),
                y = b[r.route.id];
              if (_.signal.aborted) return void (A.get(t) === m && A.delete(t));
              if (g.v7_fetcherPersist && H.has(t)) {
                if (Ph(y) || Ah(y)) return void J(t, Gh(void 0));
              } else {
                if (Ph(y))
                  return (
                    A.delete(t),
                    j > v
                      ? void J(t, Gh(void 0))
                      : (B.add(t),
                        J(t, Kh(h)),
                        Z(_, y, !1, { fetcherSubmission: h, preventScrollReset: u }))
                  );
                if (Ah(y)) return void ee(t, n, y.error);
              }
              if (Mh(y)) throw Th(400, { type: "defer-action" });
              let x = k.navigation.location || k.location,
                w = wh(e.history, x, m.signal),
                S = o || c,
                N = "idle" !== k.navigation.state ? xu(S, k.navigation.location, d) : k.matches;
              hu(N, "Didn't find any matches after fetcher action");
              let L = ++P;
              F.set(t, L);
              let D = Kh(h, y.data);
              k.fetchers.set(t, D);
              let [T, I] = hh(
                e.history,
                k,
                N,
                h,
                x,
                !1,
                g.v7_skipActionErrorRevalidation,
                R,
                O,
                M,
                H,
                V,
                B,
                S,
                d,
                [r.route.id, y],
              );
              (I.filter((e) => e.key !== t).forEach((e) => {
                let t = e.key,
                  n = k.fetchers.get(t),
                  i = Kh(void 0, n ? n.data : void 0);
                (k.fetchers.set(t, i), ie(t), e.controller && A.set(t, e.controller));
              }),
                $({ fetchers: new Map(k.fetchers) }));
              let W = () => I.forEach((e) => ie(e.key));
              m.signal.addEventListener("abort", W);
              let { loaderResults: U, fetcherResults: K } = await X(k, N, T, I, w);
              if (m.signal.aborted) return;
              (m.signal.removeEventListener("abort", W),
                F.delete(t),
                A.delete(t),
                I.forEach((e) => A.delete(e.key)));
              let G = Ih(U);
              if (G) return Z(w, G.result, !1, { preventScrollReset: u });
              if (((G = Ih(K)), G))
                return (B.add(G.key), Z(w, G.result, !1, { preventScrollReset: u }));
              let { loaderData: te, errors: ne } = kh(k, N, U, void 0, I, K, z);
              if (k.fetchers.has(t)) {
                let e = Gh(y.data);
                k.fetchers.set(t, e);
              }
              (se(L),
                "loading" === k.navigation.state && L > j
                  ? (hu(E, "Expected pending action"),
                    C && C.abort(),
                    q(k.navigation.location, {
                      matches: N,
                      loaderData: te,
                      errors: ne,
                      fetchers: new Map(k.fetchers),
                    }))
                  : ($({
                      errors: ne,
                      loaderData: Eh(k.loaderData, te, N, ne),
                      fetchers: new Map(k.fetchers),
                    }),
                    (R = !1)));
            })(t, n, f, v, h, p.active, a, b, m)
          : (V.set(t, { routeId: n, path: f }),
            (async function (t, n, i, r, o, s, a, l, c) {
              let d = k.fetchers.get(t);
              J(t, Kh(c, d ? d.data : void 0), { flushSync: a });
              let u = new AbortController(),
                h = wh(e.history, i, u.signal);
              if (s) {
                let e = await fe(o, new URL(h.url).pathname, h.signal, t);
                if ("aborted" === e.type) return;
                if ("error" === e.type) return void ee(t, n, e.error, { flushSync: a });
                if (!e.matches) return void ee(t, n, Th(404, { pathname: i }), { flushSync: a });
                r = Uh((o = e.matches), i);
              }
              A.set(t, u);
              let g = P,
                p = await Y("loader", k, h, [r], o, t),
                f = p[r.route.id];
              Mh(f) && (f = (await Hh(f, h.signal, !0)) || f);
              A.get(t) === u && A.delete(t);
              if (h.signal.aborted) return;
              if (H.has(t)) return void J(t, Gh(void 0));
              if (Ph(f))
                return j > g
                  ? void J(t, Gh(void 0))
                  : (B.add(t), void (await Z(h, f, !1, { preventScrollReset: l })));
              if (Ah(f)) return void ee(t, n, f.error);
              (hu(!Mh(f), "Unhandled fetcher deferred data"), J(t, Gh(f.data)));
            })(t, n, f, v, h, p.active, a, b, m));
      },
      revalidate: function () {
        (Q(),
          $({ revalidation: "loading" }),
          "submitting" !== k.navigation.state &&
            ("idle" !== k.navigation.state
              ? K(E || k.historyAction, k.navigation.location, {
                  overrideNavigation: k.navigation,
                  enableViewTransition: !0 === L,
                })
              : K(k.historyAction, k.location, { startUninterruptedRevalidation: !0 })));
      },
      createHref: (t) => e.history.createHref(t),
      encodeLocation: (t) => e.history.encodeLocation(t),
      getFetcher: te,
      deleteFetcher: function (e) {
        let t = (W.get(e) || 0) - 1;
        (t <= 0 ? (W.delete(e), H.add(e), g.v7_fetcherPersist || ne(e)) : W.set(e, t),
          $({ fetchers: new Map(k.fetchers) }));
      },
      dispose: function () {
        (p && p(),
          T && T(),
          f.clear(),
          C && C.abort(),
          k.fetchers.forEach((e, t) => ne(t)),
          k.blockers.forEach((e, t) => ae(t)));
      },
      getBlocker: function (e, t) {
        let n = k.blockers.get(e) || rh;
        return (U.get(e) !== t && U.set(e, t), n);
      },
      deleteBlocker: ae,
      patchRoutes: function (e, t) {
        let n = null == o;
        (mh(e, t, o || c, l, r), n && ((c = [...c]), $({})));
      },
      _internalFetchControllers: A,
      _internalActiveDeferreds: z,
      _internalSetRoutes: function (e) {
        ((l = {}), (o = yu(e, r, void 0, l)));
      },
    }),
    a
  );
}
function ch(e, t, n, i, r, o, s, a) {
  let l, c;
  if (s) {
    l = [];
    for (let e of t)
      if ((l.push(e), e.route.id === s)) {
        c = e;
        break;
      }
  } else ((l = t), (c = t[t.length - 1]));
  let d = zu(r || ".", Hu(l, o), Pu(e.pathname, n) || e.pathname, "path" === a);
  if (
    (null == r && ((d.search = e.search), (d.hash = e.hash)),
    (null == r || "" === r || "." === r) && c)
  ) {
    let e = zh(d.search);
    if (c.route.index && !e) d.search = d.search ? d.search.replace(/^\?/, "?index&") : "?index";
    else if (!c.route.index && e) {
      let e = new URLSearchParams(d.search),
        t = e.getAll("index");
      (e.delete("index"), t.filter((e) => e).forEach((t) => e.append("index", t)));
      let n = e.toString();
      d.search = n ? "?" + n : "";
    }
  }
  return (i && "/" !== n && (d.pathname = "/" === d.pathname ? n : Uu([n, d.pathname])), mu(d));
}
function dh(e, t, n, i) {
  if (
    !i ||
    !(function (e) {
      return (
        null != e && (("formData" in e && null != e.formData) || ("body" in e && void 0 !== e.body))
      );
    })(i)
  )
    return { path: n };
  if (i.formMethod && ((r = i.formMethod), !Ju.has(r.toLowerCase())))
    return { path: n, error: Th(405, { method: i.formMethod }) };
  var r;
  let o,
    s,
    a = () => ({ path: n, error: Th(400, { type: "invalid-body" }) }),
    l = i.formMethod || "get",
    c = e ? l.toUpperCase() : l.toLowerCase(),
    d = Rh(n);
  if (void 0 !== i.body) {
    if ("text/plain" === i.formEncType) {
      if (!Bh(c)) return a();
      let e =
        "string" == typeof i.body
          ? i.body
          : i.body instanceof FormData || i.body instanceof URLSearchParams
            ? Array.from(i.body.entries()).reduce((e, t) => {
                let [n, i] = t;
                return "" + e + n + "=" + i + "\n";
              }, "")
            : String(i.body);
      return {
        path: n,
        submission: {
          formMethod: c,
          formAction: d,
          formEncType: i.formEncType,
          formData: void 0,
          json: void 0,
          text: e,
        },
      };
    }
    if ("application/json" === i.formEncType) {
      if (!Bh(c)) return a();
      try {
        let e = "string" == typeof i.body ? JSON.parse(i.body) : i.body;
        return {
          path: n,
          submission: {
            formMethod: c,
            formAction: d,
            formEncType: i.formEncType,
            formData: void 0,
            json: e,
            text: void 0,
          },
        };
      } catch (spt) {
        return a();
      }
    }
  }
  if (
    (hu("function" == typeof FormData, "FormData is not available in this environment"), i.formData)
  )
    ((o = Ch(i.formData)), (s = i.formData));
  else if (i.body instanceof FormData) ((o = Ch(i.body)), (s = i.body));
  else if (i.body instanceof URLSearchParams) ((o = i.body), (s = Sh(o)));
  else if (null == i.body) ((o = new URLSearchParams()), (s = new FormData()));
  else
    try {
      ((o = new URLSearchParams(i.body)), (s = Sh(o)));
    } catch (spt) {
      return a();
    }
  let u = {
    formMethod: c,
    formAction: d,
    formEncType: (i && i.formEncType) || "application/x-www-form-urlencoded",
    formData: s,
    json: void 0,
    text: void 0,
  };
  if (Bh(u.formMethod)) return { path: n, submission: u };
  let h = _u(n);
  return (
    t && h.search && zh(h.search) && o.append("index", ""),
    (h.search = "?" + o),
    { path: mu(h), submission: u }
  );
}
function uh(e, t, n) {
  void 0 === n && (n = !1);
  let i = e.findIndex((e) => e.route.id === t);
  return i >= 0 ? e.slice(0, n ? i + 1 : i) : e;
}
function hh(e, t, n, i, r, o, s, a, l, c, d, u, h, g, p, f) {
  let m = f ? (Ah(f[1]) ? f[1].error : f[1].data) : void 0,
    _ = e.createURL(t.location),
    v = e.createURL(r),
    b = n;
  o && t.errors ? (b = uh(n, Object.keys(t.errors)[0], !0)) : f && Ah(f[1]) && (b = uh(n, f[0]));
  let y = f ? f[1].statusCode : void 0,
    x = s && y && y >= 400,
    w = b.filter((e, n) => {
      let { route: r } = e;
      if (r.lazy) return !0;
      if (null == r.loader) return !1;
      if (o) return gh(r, t.loaderData, t.errors);
      if (
        (function (e, t, n) {
          let i = !t || n.route.id !== t.route.id,
            r = void 0 === e[n.route.id];
          return i || r;
        })(t.loaderData, t.matches[n], e) ||
        l.some((t) => t === e.route.id)
      )
        return !0;
      let s = t.matches[n],
        c = e;
      return fh(
        e,
        cu({ currentUrl: _, currentParams: s.params, nextUrl: v, nextParams: c.params }, i, {
          actionResult: m,
          actionStatus: y,
          defaultShouldRevalidate:
            !x &&
            (a ||
              _.pathname + _.search === v.pathname + v.search ||
              _.search !== v.search ||
              ph(s, c)),
        }),
      );
    }),
    C = [];
  return (
    u.forEach((e, r) => {
      if (o || !n.some((t) => t.route.id === e.routeId) || d.has(r)) return;
      let s = xu(g, e.path, p);
      if (!s)
        return void C.push({
          key: r,
          routeId: e.routeId,
          path: e.path,
          matches: null,
          match: null,
          controller: null,
        });
      let l = t.fetchers.get(r),
        u = Uh(s, e.path),
        f = !1;
      (h.has(r)
        ? (f = !1)
        : c.has(r)
          ? (c.delete(r), (f = !0))
          : (f =
              l && "idle" !== l.state && void 0 === l.data
                ? a
                : fh(
                    u,
                    cu(
                      {
                        currentUrl: _,
                        currentParams: t.matches[t.matches.length - 1].params,
                        nextUrl: v,
                        nextParams: n[n.length - 1].params,
                      },
                      i,
                      { actionResult: m, actionStatus: y, defaultShouldRevalidate: !x && a },
                    ),
                  )),
        f &&
          C.push({
            key: r,
            routeId: e.routeId,
            path: e.path,
            matches: s,
            match: u,
            controller: new AbortController(),
          }));
    }),
    [w, C]
  );
}
function gh(e, t, n) {
  if (e.lazy) return !0;
  if (!e.loader) return !1;
  let i = null != t && void 0 !== t[e.id],
    r = null != n && void 0 !== n[e.id];
  return !(!i && r) && (("function" == typeof e.loader && !0 === e.loader.hydrate) || (!i && !r));
}
function ph(e, t) {
  let n = e.route.path;
  return (
    e.pathname !== t.pathname || (null != n && n.endsWith("*") && e.params["*"] !== t.params["*"])
  );
}
function fh(e, t) {
  if (e.route.shouldRevalidate) {
    let n = e.route.shouldRevalidate(t);
    if ("boolean" == typeof n) return n;
  }
  return t.defaultShouldRevalidate;
}
function mh(e, t, n, i, r) {
  var o;
  let s;
  if (e) {
    let t = i[e];
    (hu(t, "No route found to patch children into: routeId = " + e),
      t.children || (t.children = []),
      (s = t.children));
  } else s = n;
  let a = yu(
    t.filter((e) => !s.some((t) => _h(e, t))),
    r,
    [e || "_", "patch", String((null == (o = s) ? void 0 : o.length) || "0")],
    i,
  );
  s.push(...a);
}
function _h(e, t) {
  return (
    ("id" in e && "id" in t && e.id === t.id) ||
    (e.index === t.index &&
      e.path === t.path &&
      e.caseSensitive === t.caseSensitive &&
      (!((e.children && 0 !== e.children.length) || (t.children && 0 !== t.children.length)) ||
        e.children.every((e, n) => {
          var i;
          return null == (i = t.children) ? void 0 : i.some((t) => _h(e, t));
        })))
  );
}
async function vh(e) {
  let { matches: t } = e,
    n = t.filter((e) => e.shouldLoad),
    i = await Promise.all(n.map((e) => e.resolve()));
  return i.reduce((e, t, i) => Object.assign(e, { [n[i].route.id]: t }), {});
}
async function bh(e) {
  let { result: t, type: n } = e;
  if (Fh(t)) {
    let e;
    try {
      let n = t.headers.get("Content-Type");
      e =
        n && /\bapplication\/json\b/.test(n)
          ? null == t.body
            ? null
            : await t.json()
          : await t.text();
    } catch (spt) {
      return { type: vu.error, error: spt };
    }
    return n === vu.error
      ? {
          type: vu.error,
          error: new Gu(t.status, t.statusText, e),
          statusCode: t.status,
          headers: t.headers,
        }
      : { type: vu.data, data: e, statusCode: t.status, headers: t.headers };
  }
  var i, r, o, s, a, l, c, d;
  return n === vu.error
    ? jh(t)
      ? t.data instanceof Error
        ? {
            type: vu.error,
            error: t.data,
            statusCode: null == (o = t.init) ? void 0 : o.status,
            headers: null != (s = t.init) && s.headers ? new Headers(t.init.headers) : void 0,
          }
        : {
            type: vu.error,
            error: new Gu((null == (i = t.init) ? void 0 : i.status) || 500, void 0, t.data),
            statusCode: Zu(t) ? t.status : void 0,
            headers: null != (r = t.init) && r.headers ? new Headers(t.init.headers) : void 0,
          }
      : { type: vu.error, error: t, statusCode: Zu(t) ? t.status : void 0 }
    : (function (e) {
          let t = e;
          return (
            t &&
            "object" == typeof t &&
            "object" == typeof t.data &&
            "function" == typeof t.subscribe &&
            "function" == typeof t.cancel &&
            "function" == typeof t.resolveData
          );
        })(t)
      ? {
          type: vu.deferred,
          deferredData: t,
          statusCode: null == (a = t.init) ? void 0 : a.status,
          headers: (null == (l = t.init) ? void 0 : l.headers) && new Headers(t.init.headers),
        }
      : jh(t)
        ? {
            type: vu.data,
            data: t.data,
            statusCode: null == (c = t.init) ? void 0 : c.status,
            headers: null != (d = t.init) && d.headers ? new Headers(t.init.headers) : void 0,
          }
        : { type: vu.data, data: t };
}
function yh(e, t, n, i, r, o) {
  let s = e.headers.get("Location");
  if (
    (hu(s, "Redirects returned/thrown from loaders/actions must have a Location header"),
    !oh.test(s))
  ) {
    let a = i.slice(0, i.findIndex((e) => e.route.id === n) + 1);
    ((s = ch(new URL(t.url), a, r, !0, s, o)), e.headers.set("Location", s));
  }
  return e;
}
function xh(e, t, n) {
  if (oh.test(e)) {
    let i = e,
      r = i.startsWith("//") ? new URL(t.protocol + i) : new URL(i),
      o = null != Pu(r.pathname, n);
    if (r.origin === t.origin && o) return r.pathname + r.search + r.hash;
  }
  return e;
}
function wh(e, t, n, i) {
  let r = e.createURL(Rh(t)).toString(),
    o = { signal: n };
  if (i && Bh(i.formMethod)) {
    let { formMethod: e, formEncType: t } = i;
    ((o.method = e.toUpperCase()),
      "application/json" === t
        ? ((o.headers = new Headers({ "Content-Type": t })), (o.body = JSON.stringify(i.json)))
        : "text/plain" === t
          ? (o.body = i.text)
          : "application/x-www-form-urlencoded" === t && i.formData
            ? (o.body = Ch(i.formData))
            : (o.body = i.formData));
  }
  return new Request(r, o);
}
function Ch(e) {
  let t = new URLSearchParams();
  for (let [n, i] of e.entries()) t.append(n, "string" == typeof i ? i : i.name);
  return t;
}
function Sh(e) {
  let t = new FormData();
  for (let [n, i] of e.entries()) t.append(n, i);
  return t;
}
function kh(e, t, n, i, r, o, s) {
  let { loaderData: a, errors: l } = (function (e, t, n, i) {
    let r,
      o = {},
      s = null,
      a = !1,
      l = {},
      c = n && Ah(n[1]) ? n[1].error : void 0;
    return (
      e.forEach((n) => {
        if (!(n.route.id in t)) return;
        let d = n.route.id,
          u = t[d];
        if ((hu(!Ph(u), "Cannot handle redirect results in processLoaderData"), Ah(u))) {
          let t = u.error;
          (void 0 !== c && ((t = c), (c = void 0)), (s = s || {}));
          {
            let n = Lh(e, d);
            null == s[n.route.id] && (s[n.route.id] = t);
          }
          ((o[d] = void 0),
            a || ((a = !0), (r = Zu(u.error) ? u.error.status : 500)),
            u.headers && (l[d] = u.headers));
        } else
          Mh(u)
            ? (i.set(d, u.deferredData),
              (o[d] = u.deferredData.data),
              null == u.statusCode || 200 === u.statusCode || a || (r = u.statusCode),
              u.headers && (l[d] = u.headers))
            : ((o[d] = u.data),
              u.statusCode && 200 !== u.statusCode && !a && (r = u.statusCode),
              u.headers && (l[d] = u.headers));
      }),
      void 0 !== c && n && ((s = { [n[0]]: c }), (o[n[0]] = void 0)),
      { loaderData: o, errors: s, statusCode: r || 200, loaderHeaders: l }
    );
  })(t, n, i, s);
  return (
    r.forEach((t) => {
      let { key: n, match: i, controller: r } = t,
        s = o[n];
      if ((hu(s, "Did not find corresponding fetcher result"), !r || !r.signal.aborted))
        if (Ah(s)) {
          let t = Lh(e.matches, null == i ? void 0 : i.route.id);
          ((l && l[t.route.id]) || (l = cu({}, l, { [t.route.id]: s.error })),
            e.fetchers.delete(n));
        } else if (Ph(s)) hu(!1, "Unhandled fetcher revalidation redirect");
        else if (Mh(s)) hu(!1, "Unhandled fetcher deferred data");
        else {
          let t = Gh(s.data);
          e.fetchers.set(n, t);
        }
    }),
    { loaderData: a, errors: l }
  );
}
function Eh(e, t, n, i) {
  let r = cu({}, t);
  for (let o of n) {
    let n = o.route.id;
    if (
      (t.hasOwnProperty(n)
        ? void 0 !== t[n] && (r[n] = t[n])
        : void 0 !== e[n] && o.route.loader && (r[n] = e[n]),
      i && i.hasOwnProperty(n))
    )
      break;
  }
  return r;
}
function Nh(e) {
  return e ? (Ah(e[1]) ? { actionData: {} } : { actionData: { [e[0]]: e[1].data } }) : {};
}
function Lh(e, t) {
  let n = t ? e.slice(0, e.findIndex((e) => e.route.id === t) + 1) : [...e];
  return n.reverse().find((e) => !0 === e.route.hasErrorBoundary) || e[0];
}
function Dh(e) {
  let t =
    1 === e.length
      ? e[0]
      : e.find((e) => e.index || !e.path || "/" === e.path) || { id: "__shim-error-route__" };
  return { matches: [{ params: {}, pathname: "", pathnameBase: "", route: t }], route: t };
}
function Th(e, t) {
  let { pathname: n, routeId: i, method: r, type: o, message: s } = void 0 === t ? {} : t,
    a = "Unknown Server Error",
    l = "Unknown @remix-run/router error";
  return (
    400 === e
      ? ((a = "Bad Request"),
        r && n && i
          ? (l =
              "You made a " +
              r +
              ' request to "' +
              n +
              '" but did not provide a `loader` for route "' +
              i +
              '", so there is no way to handle the request.')
          : "defer-action" === o
            ? (l = "defer() is not supported in actions")
            : "invalid-body" === o && (l = "Unable to encode submission body"))
      : 403 === e
        ? ((a = "Forbidden"), (l = 'Route "' + i + '" does not match URL "' + n + '"'))
        : 404 === e
          ? ((a = "Not Found"), (l = 'No route matches URL "' + n + '"'))
          : 405 === e &&
            ((a = "Method Not Allowed"),
            r && n && i
              ? (l =
                  "You made a " +
                  r.toUpperCase() +
                  ' request to "' +
                  n +
                  '" but did not provide an `action` for route "' +
                  i +
                  '", so there is no way to handle the request.')
              : r && (l = 'Invalid request method "' + r.toUpperCase() + '"')),
    new Gu(e || 500, a, new Error(l), !0)
  );
}
function Ih(e) {
  let t = Object.entries(e);
  for (let n = t.length - 1; n >= 0; n--) {
    let [e, i] = t[n];
    if (Ph(i)) return { key: e, result: i };
  }
}
function Rh(e) {
  return mu(cu({}, "string" == typeof e ? _u(e) : e, { hash: "" }));
}
function Oh(e) {
  return Fh(e.result) && eh.has(e.result.status);
}
function Mh(e) {
  return e.type === vu.deferred;
}
function Ah(e) {
  return e.type === vu.error;
}
function Ph(e) {
  return (e && e.type) === vu.redirect;
}
function jh(e) {
  return (
    "object" == typeof e &&
    null != e &&
    "type" in e &&
    "data" in e &&
    "init" in e &&
    "DataWithResponseInit" === e.type
  );
}
function Fh(e) {
  return (
    null != e &&
    "number" == typeof e.status &&
    "string" == typeof e.statusText &&
    "object" == typeof e.headers &&
    void 0 !== e.body
  );
}
function Bh(e) {
  return Xu.has(e.toLowerCase());
}
async function Vh(e, t, n, i, r) {
  let o = Object.entries(t);
  for (let s = 0; s < o.length; s++) {
    let [a, l] = o[s],
      c = e.find((e) => (null == e ? void 0 : e.route.id) === a);
    if (!c) continue;
    let d = i.find((e) => e.route.id === c.route.id),
      u = null != d && !ph(d, c) && void 0 !== (r && r[c.route.id]);
    Mh(l) &&
      u &&
      (await Hh(l, n, !1).then((e) => {
        e && (t[a] = e);
      }));
  }
}
async function Wh(e, t, n) {
  for (let i = 0; i < n.length; i++) {
    let { key: r, routeId: o, controller: s } = n[i],
      a = t[r],
      l = e.find((e) => (null == e ? void 0 : e.route.id) === o);
    l &&
      Mh(a) &&
      (hu(s, "Expected an AbortController for revalidating fetcher deferred result"),
      await Hh(a, s.signal, !0).then((e) => {
        e && (t[r] = e);
      }));
  }
}
async function Hh(e, t, n) {
  if ((void 0 === n && (n = !1), !(await e.deferredData.resolveData(t)))) {
    if (n)
      try {
        return { type: vu.data, data: e.deferredData.unwrappedData };
      } catch (spt) {
        return { type: vu.error, error: spt };
      }
    return { type: vu.data, data: e.deferredData.data };
  }
}
function zh(e) {
  return new URLSearchParams(e).getAll("index").some((e) => "" === e);
}
function Uh(e, t) {
  let n = "string" == typeof t ? _u(t).search : t.search;
  if (e[e.length - 1].route.index && zh(n || "")) return e[e.length - 1];
  let i = Wu(e);
  return i[i.length - 1];
}
function $h(e) {
  let { formMethod: t, formAction: n, formEncType: i, text: r, formData: o, json: s } = e;
  if (t && n && i)
    return null != r
      ? { formMethod: t, formAction: n, formEncType: i, formData: void 0, json: void 0, text: r }
      : null != o
        ? { formMethod: t, formAction: n, formEncType: i, formData: o, json: void 0, text: void 0 }
        : void 0 !== s
          ? {
              formMethod: t,
              formAction: n,
              formEncType: i,
              formData: void 0,
              json: s,
              text: void 0,
            }
          : void 0;
}
function qh(e, t) {
  if (t) {
    return {
      state: "loading",
      location: e,
      formMethod: t.formMethod,
      formAction: t.formAction,
      formEncType: t.formEncType,
      formData: t.formData,
      json: t.json,
      text: t.text,
    };
  }
  return {
    state: "loading",
    location: e,
    formMethod: void 0,
    formAction: void 0,
    formEncType: void 0,
    formData: void 0,
    json: void 0,
    text: void 0,
  };
}
function Kh(e, t) {
  if (e) {
    return {
      state: "loading",
      formMethod: e.formMethod,
      formAction: e.formAction,
      formEncType: e.formEncType,
      formData: e.formData,
      json: e.json,
      text: e.text,
      data: t,
    };
  }
  return {
    state: "loading",
    formMethod: void 0,
    formAction: void 0,
    formEncType: void 0,
    formData: void 0,
    json: void 0,
    text: void 0,
    data: t,
  };
}
function Gh(e) {
  return {
    state: "idle",
    formMethod: void 0,
    formAction: void 0,
    formEncType: void 0,
    formData: void 0,
    json: void 0,
    text: void 0,
    data: e,
  };
}
function Zh() {
  return (
    (Zh = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    Zh.apply(this, arguments)
  );
}
const Yh = H.createContext(null),
  Xh = H.createContext(null),
  Qh = H.createContext(null),
  Jh = H.createContext(null),
  eg = H.createContext({ outlet: null, matches: [], isDataRoute: !1 }),
  tg = H.createContext(null);
function ng() {
  return null != H.useContext(Jh);
}
function ig() {
  return (ng() || hu(!1), H.useContext(Jh).location);
}
function rg(e) {
  H.useContext(Qh).static || H.useLayoutEffect(e);
}
function og() {
  let { isDataRoute: e } = H.useContext(eg);
  return e
    ? (function () {
        let { router: e } = (function () {
            let e = H.useContext(Yh);
            return (e || hu(!1), e);
          })(gg.UseNavigateStable),
          t = fg(),
          n = H.useRef(!1);
        rg(() => {
          n.current = !0;
        });
        let i = H.useCallback(
          function (i, r) {
            (void 0 === r && (r = {}),
              n.current &&
                ("number" == typeof i ? e.navigate(i) : e.navigate(i, Zh({ fromRouteId: t }, r))));
          },
          [e, t],
        );
        return i;
      })()
    : (function () {
        ng() || hu(!1);
        let e = H.useContext(Yh),
          { basename: t, future: n, navigator: i } = H.useContext(Qh),
          { matches: r } = H.useContext(eg),
          { pathname: o } = ig(),
          s = JSON.stringify(Hu(r, n.v7_relativeSplatPath)),
          a = H.useRef(!1);
        rg(() => {
          a.current = !0;
        });
        let l = H.useCallback(
          function (n, r) {
            if ((void 0 === r && (r = {}), !a.current)) return;
            if ("number" == typeof n) return void i.go(n);
            let l = zu(n, JSON.parse(s), o, "path" === r.relative);
            (null == e && "/" !== t && (l.pathname = "/" === l.pathname ? t : Uu([t, l.pathname])),
              (r.replace ? i.replace : i.push)(l, r.state, r));
          },
          [t, i, s, o, e],
        );
        return l;
      })();
}
const sg = H.createContext(null);
function ag(e, t) {
  let { relative: n } = void 0 === t ? {} : t,
    { future: i } = H.useContext(Qh),
    { matches: r } = H.useContext(eg),
    { pathname: o } = ig(),
    s = JSON.stringify(Hu(r, i.v7_relativeSplatPath));
  return H.useMemo(() => zu(e, JSON.parse(s), o, "path" === n), [e, s, o, n]);
}
function lg(e, t, n, i) {
  ng() || hu(!1);
  let { navigator: r } = H.useContext(Qh),
    { matches: o } = H.useContext(eg),
    s = o[o.length - 1],
    a = s ? s.params : {};
  !s || s.pathname;
  let l,
    c = s ? s.pathnameBase : "/";
  (s && s.route, (l = ig()));
  let d = l.pathname || "/",
    u = d;
  if ("/" !== c) {
    let e = c.replace(/^\//, "").split("/");
    u = "/" + d.replace(/^\//, "").split("/").slice(e.length).join("/");
  }
  let h = xu(e, { pathname: u }),
    g = (function (e, t, n, i) {
      var r;
      void 0 === t && (t = []);
      void 0 === n && (n = null);
      void 0 === i && (i = null);
      if (null == e) {
        var o;
        if (!n) return null;
        if (n.errors) e = n.matches;
        else {
          if (
            !(
              null != (o = i) &&
              o.v7_partialHydration &&
              0 === t.length &&
              !n.initialized &&
              n.matches.length > 0
            )
          )
            return null;
          e = n.matches;
        }
      }
      let s = e,
        a = null == (r = n) ? void 0 : r.errors;
      if (null != a) {
        let e = s.findIndex((e) => e.route.id && void 0 !== (null == a ? void 0 : a[e.route.id]));
        (e >= 0 || hu(!1), (s = s.slice(0, Math.min(s.length, e + 1))));
      }
      let l = !1,
        c = -1;
      if (n && i && i.v7_partialHydration)
        for (let d = 0; d < s.length; d++) {
          let e = s[d];
          if (
            ((e.route.HydrateFallback || e.route.hydrateFallbackElement) && (c = d), e.route.id)
          ) {
            let { loaderData: t, errors: i } = n,
              r = e.route.loader && void 0 === t[e.route.id] && (!i || void 0 === i[e.route.id]);
            if (e.route.lazy || r) {
              ((l = !0), (s = c >= 0 ? s.slice(0, c + 1) : [s[0]]));
              break;
            }
          }
        }
      return s.reduceRight((e, i, r) => {
        let o,
          d = !1,
          u = null,
          h = null;
        var g;
        n &&
          ((o = a && i.route.id ? a[i.route.id] : void 0),
          (u = i.route.errorElement || dg),
          l &&
            (c < 0 && 0 === r
              ? (_g[(g = "route-fallback")] || (_g[g] = !0), (d = !0), (h = null))
              : c === r && ((d = !0), (h = i.route.hydrateFallbackElement || null))));
        let p = t.concat(s.slice(0, r + 1)),
          f = () => {
            let t;
            return (
              (t = o
                ? u
                : d
                  ? h
                  : i.route.Component
                    ? H.createElement(i.route.Component, null)
                    : i.route.element
                      ? i.route.element
                      : e),
              H.createElement(hg, {
                match: i,
                routeContext: { outlet: e, matches: p, isDataRoute: null != n },
                children: t,
              })
            );
          };
        return n && (i.route.ErrorBoundary || i.route.errorElement || 0 === r)
          ? H.createElement(ug, {
              location: n.location,
              revalidation: n.revalidation,
              component: u,
              error: o,
              children: f(),
              routeContext: { outlet: null, matches: p, isDataRoute: !0 },
            })
          : f();
      }, null);
    })(
      h &&
        h.map((e) =>
          Object.assign({}, e, {
            params: Object.assign({}, a, e.params),
            pathname: Uu([
              c,
              r.encodeLocation ? r.encodeLocation(e.pathname).pathname : e.pathname,
            ]),
            pathnameBase:
              "/" === e.pathnameBase
                ? c
                : Uu([
                    c,
                    r.encodeLocation ? r.encodeLocation(e.pathnameBase).pathname : e.pathnameBase,
                  ]),
          }),
        ),
      o,
      n,
      i,
    );
  return g;
}
function cg() {
  let e = mg(),
    t = Zu(e) ? e.status + " " + e.statusText : e instanceof Error ? e.message : JSON.stringify(e),
    n = e instanceof Error ? e.stack : null,
    i = { padding: "0.5rem", backgroundColor: "rgba(200,200,200, 0.5)" };
  return H.createElement(
    H.Fragment,
    null,
    H.createElement("h2", null, "Unexpected Application Error!"),
    H.createElement("h3", { style: { fontStyle: "italic" } }, t),
    n ? H.createElement("pre", { style: i }, n) : null,
    null,
  );
}
const dg = H.createElement(cg, null);
class ug extends H.Component {
  constructor(e) {
    (super(e),
      (this.state = { location: e.location, revalidation: e.revalidation, error: e.error }));
  }
  static getDerivedStateFromError(e) {
    return { error: e };
  }
  static getDerivedStateFromProps(e, t) {
    return t.location !== e.location || ("idle" !== t.revalidation && "idle" === e.revalidation)
      ? { error: e.error, location: e.location, revalidation: e.revalidation }
      : {
          error: void 0 !== e.error ? e.error : t.error,
          location: t.location,
          revalidation: e.revalidation || t.revalidation,
        };
  }
  componentDidCatch(e, t) {}
  render() {
    return void 0 !== this.state.error
      ? H.createElement(
          eg.Provider,
          { value: this.props.routeContext },
          H.createElement(tg.Provider, { value: this.state.error, children: this.props.component }),
        )
      : this.props.children;
  }
}
function hg(e) {
  let { routeContext: t, match: n, children: i } = e,
    r = H.useContext(Yh);
  return (
    r &&
      r.static &&
      r.staticContext &&
      (n.route.errorElement || n.route.ErrorBoundary) &&
      (r.staticContext._deepestRenderedBoundaryId = n.route.id),
    H.createElement(eg.Provider, { value: t }, i)
  );
}
var gg = (function (e) {
    return (
      (e.UseBlocker = "useBlocker"),
      (e.UseRevalidator = "useRevalidator"),
      (e.UseNavigateStable = "useNavigate"),
      e
    );
  })(gg || {}),
  pg = (function (e) {
    return (
      (e.UseBlocker = "useBlocker"),
      (e.UseLoaderData = "useLoaderData"),
      (e.UseActionData = "useActionData"),
      (e.UseRouteError = "useRouteError"),
      (e.UseNavigation = "useNavigation"),
      (e.UseRouteLoaderData = "useRouteLoaderData"),
      (e.UseMatches = "useMatches"),
      (e.UseRevalidator = "useRevalidator"),
      (e.UseNavigateStable = "useNavigate"),
      (e.UseRouteId = "useRouteId"),
      e
    );
  })(pg || {});
function fg(e) {
  let t = (function () {
      let e = H.useContext(eg);
      return (e || hu(!1), e);
    })(),
    n = t.matches[t.matches.length - 1];
  return (n.route.id || hu(!1), n.route.id);
}
function mg() {
  var e;
  let t = H.useContext(tg),
    n = (function () {
      let e = H.useContext(Xh);
      return (e || hu(!1), e);
    })(pg.UseRouteError),
    i = fg();
  return void 0 !== t ? t : null == (e = n.errors) ? void 0 : e[i];
}
const _g = {};
function vg(e) {
  return (function (e) {
    let t = H.useContext(eg).outlet;
    return t ? H.createElement(sg.Provider, { value: e }, t) : t;
  })(e.context);
}
function bg(e) {
  let {
    basename: t = "/",
    children: n = null,
    location: i,
    navigationType: r = au.Pop,
    navigator: o,
    static: s = !1,
    future: a,
  } = e;
  ng() && hu(!1);
  let l = t.replace(/^\/*/, "/"),
    c = H.useMemo(
      () => ({ basename: l, navigator: o, static: s, future: Zh({ v7_relativeSplatPath: !1 }, a) }),
      [l, a, o, s],
    );
  "string" == typeof i && (i = _u(i));
  let { pathname: d = "/", search: u = "", hash: h = "", state: g = null, key: p = "default" } = i,
    f = H.useMemo(() => {
      let e = Pu(d, l);
      return null == e
        ? null
        : { location: { pathname: e, search: u, hash: h, state: g, key: p }, navigationType: r };
    }, [l, d, u, h, g, p, r]);
  return null == f
    ? null
    : H.createElement(
        Qh.Provider,
        { value: c },
        H.createElement(Jh.Provider, { children: n, value: f }),
      );
}
function yg(e) {
  let t = { hasErrorBoundary: null != e.ErrorBoundary || null != e.errorElement };
  return (
    e.Component && Object.assign(t, { element: H.createElement(e.Component), Component: void 0 }),
    e.HydrateFallback &&
      Object.assign(t, {
        hydrateFallbackElement: H.createElement(e.HydrateFallback),
        HydrateFallback: void 0,
      }),
    e.ErrorBoundary &&
      Object.assign(t, { errorElement: H.createElement(e.ErrorBoundary), ErrorBoundary: void 0 }),
    t
  );
}
/**
 * React Router DOM v6.30.2
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */ function xg() {
  return (
    (xg = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    xg.apply(this, arguments)
  );
}
function wg(e) {
  return (
    void 0 === e && (e = ""),
    new URLSearchParams(
      "string" == typeof e || Array.isArray(e) || e instanceof URLSearchParams
        ? e
        : Object.keys(e).reduce((t, n) => {
            let i = e[n];
            return t.concat(Array.isArray(i) ? i.map((e) => [n, e]) : [[n, i]]);
          }, []),
    )
  );
}
new Promise(() => {});
const Cg = [
  "onClick",
  "relative",
  "reloadDocument",
  "replace",
  "state",
  "target",
  "to",
  "preventScrollReset",
  "viewTransition",
];
try {
  window.__reactRouterVersion = "6";
} catch (spt) {}
function Sg() {
  var e;
  let t = null == (e = window) ? void 0 : e.__staticRouterHydrationData;
  return (t && t.errors && (t = xg({}, t, { errors: kg(t.errors) })), t);
}
function kg(e) {
  if (!e) return null;
  let t = Object.entries(e),
    n = {};
  for (let [i, r] of t)
    if (r && "RouteErrorResponse" === r.__type)
      n[i] = new Gu(r.status, r.statusText, r.data, !0 === r.internal);
    else if (r && "Error" === r.__type) {
      if (r.__subType) {
        let e = window[r.__subType];
        if ("function" == typeof e)
          try {
            let t = new e(r.message);
            ((t.stack = ""), (n[i] = t));
          } catch (spt) {}
      }
      if (null == n[i]) {
        let e = new Error(r.message);
        ((e.stack = ""), (n[i] = e));
      }
    } else n[i] = r;
  return n;
}
const Eg = H.createContext({ isTransitioning: !1 }),
  Ng = H.createContext(new Map()),
  Lg = U.startTransition,
  Dg = su.flushSync;
function Tg(e) {
  Dg ? Dg(e) : e();
}
let Ig = class {
  constructor() {
    ((this.status = "pending"),
      (this.promise = new Promise((e, t) => {
        ((this.resolve = (t) => {
          "pending" === this.status && ((this.status = "resolved"), e(t));
        }),
          (this.reject = (e) => {
            "pending" === this.status && ((this.status = "rejected"), t(e));
          }));
      })));
  }
};
function Rg(e) {
  let { fallbackElement: t, router: n, future: i } = e,
    [r, o] = H.useState(n.state),
    [s, a] = H.useState(),
    [l, c] = H.useState({ isTransitioning: !1 }),
    [d, u] = H.useState(),
    [h, g] = H.useState(),
    [p, f] = H.useState(),
    m = H.useRef(new Map()),
    { v7_startTransition: _ } = i || {},
    v = H.useCallback(
      (e) => {
        _
          ? (function (e) {
              Lg ? Lg(e) : e();
            })(e)
          : e();
      },
      [_],
    ),
    b = H.useCallback(
      (e, t) => {
        let { deletedFetchers: i, flushSync: r, viewTransitionOpts: s } = t;
        (e.fetchers.forEach((e, t) => {
          void 0 !== e.data && m.current.set(t, e.data);
        }),
          i.forEach((e) => m.current.delete(e)));
        let l =
          null == n.window ||
          null == n.window.document ||
          "function" != typeof n.window.document.startViewTransition;
        if (s && !l) {
          if (r) {
            Tg(() => {
              (h && (d && d.resolve(), h.skipTransition()),
                c({
                  isTransitioning: !0,
                  flushSync: !0,
                  currentLocation: s.currentLocation,
                  nextLocation: s.nextLocation,
                }));
            });
            let t = n.window.document.startViewTransition(() => {
              Tg(() => o(e));
            });
            return (
              t.finished.finally(() => {
                Tg(() => {
                  (u(void 0), g(void 0), a(void 0), c({ isTransitioning: !1 }));
                });
              }),
              void Tg(() => g(t))
            );
          }
          h
            ? (d && d.resolve(),
              h.skipTransition(),
              f({ state: e, currentLocation: s.currentLocation, nextLocation: s.nextLocation }))
            : (a(e),
              c({
                isTransitioning: !0,
                flushSync: !1,
                currentLocation: s.currentLocation,
                nextLocation: s.nextLocation,
              }));
        } else r ? Tg(() => o(e)) : v(() => o(e));
      },
      [n.window, h, d, m, v],
    );
  (H.useLayoutEffect(() => n.subscribe(b), [n, b]),
    H.useEffect(() => {
      l.isTransitioning && !l.flushSync && u(new Ig());
    }, [l]),
    H.useEffect(() => {
      if (d && s && n.window) {
        let e = s,
          t = d.promise,
          i = n.window.document.startViewTransition(async () => {
            (v(() => o(e)), await t);
          });
        (i.finished.finally(() => {
          (u(void 0), g(void 0), a(void 0), c({ isTransitioning: !1 }));
        }),
          g(i));
      }
    }, [v, s, d, n.window]),
    H.useEffect(() => {
      d && s && r.location.key === s.location.key && d.resolve();
    }, [d, h, r.location, s]),
    H.useEffect(() => {
      !l.isTransitioning &&
        p &&
        (a(p.state),
        c({
          isTransitioning: !0,
          flushSync: !1,
          currentLocation: p.currentLocation,
          nextLocation: p.nextLocation,
        }),
        f(void 0));
    }, [l.isTransitioning, p]),
    H.useEffect(() => {}, []));
  let y = H.useMemo(
      () => ({
        createHref: n.createHref,
        encodeLocation: n.encodeLocation,
        go: (e) => n.navigate(e),
        push: (e, t, i) =>
          n.navigate(e, {
            state: t,
            preventScrollReset: null == i ? void 0 : i.preventScrollReset,
          }),
        replace: (e, t, i) =>
          n.navigate(e, {
            replace: !0,
            state: t,
            preventScrollReset: null == i ? void 0 : i.preventScrollReset,
          }),
      }),
      [n],
    ),
    x = n.basename || "/",
    w = H.useMemo(() => ({ router: n, navigator: y, static: !1, basename: x }), [n, y, x]),
    C = H.useMemo(
      () => ({ v7_relativeSplatPath: n.future.v7_relativeSplatPath }),
      [n.future.v7_relativeSplatPath],
    );
  return (
    H.useEffect(
      () =>
        (function (e, t) {
          (null == e || e.v7_startTransition,
            void 0 === (null == e ? void 0 : e.v7_relativeSplatPath) &&
              (!t || t.v7_relativeSplatPath),
            t &&
              (t.v7_fetcherPersist,
              t.v7_normalizeFormMethod,
              t.v7_partialHydration,
              t.v7_skipActionErrorRevalidation));
        })(i, n.future),
      [i, n.future],
    ),
    H.createElement(
      H.Fragment,
      null,
      H.createElement(
        Yh.Provider,
        { value: w },
        H.createElement(
          Xh.Provider,
          { value: r },
          H.createElement(
            Ng.Provider,
            { value: m.current },
            H.createElement(
              Eg.Provider,
              { value: l },
              H.createElement(
                bg,
                {
                  basename: x,
                  location: r.location,
                  navigationType: r.historyAction,
                  navigator: y,
                  future: C,
                },
                r.initialized || n.future.v7_partialHydration
                  ? H.createElement(Og, { routes: n.routes, future: n.future, state: r })
                  : t,
              ),
            ),
          ),
        ),
      ),
      null,
    )
  );
}
const Og = H.memo(Mg);
function Mg(e) {
  let { routes: t, future: n, state: i } = e;
  return lg(t, 0, i, n);
}
const Ag =
    "undefined" != typeof window &&
    void 0 !== window.document &&
    void 0 !== window.document.createElement,
  Pg = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,
  jg = H.forwardRef(function (e, t) {
    let n,
      {
        onClick: i,
        relative: r,
        reloadDocument: o,
        replace: s,
        state: a,
        target: l,
        to: c,
        preventScrollReset: d,
        viewTransition: u,
      } = e,
      h = (function (e, t) {
        if (null == e) return {};
        var n,
          i,
          r = {},
          o = Object.keys(e);
        for (i = 0; i < o.length; i++) ((n = o[i]), t.indexOf(n) >= 0 || (r[n] = e[n]));
        return r;
      })(e, Cg),
      { basename: g } = H.useContext(Qh),
      p = !1;
    if ("string" == typeof c && Pg.test(c) && ((n = c), Ag))
      try {
        let e = new URL(window.location.href),
          t = c.startsWith("//") ? new URL(e.protocol + c) : new URL(c),
          n = Pu(t.pathname, g);
        t.origin === e.origin && null != n ? (c = n + t.search + t.hash) : (p = !0);
      } catch (spt) {}
    let f = (function (e, t) {
        let { relative: n } = void 0 === t ? {} : t;
        ng() || hu(!1);
        let { basename: i, navigator: r } = H.useContext(Qh),
          { hash: o, pathname: s, search: a } = ag(e, { relative: n }),
          l = s;
        return (
          "/" !== i && (l = "/" === s ? i : Uu([i, s])),
          r.createHref({ pathname: l, search: a, hash: o })
        );
      })(c, { relative: r }),
      m = (function (e, t) {
        let {
            target: n,
            replace: i,
            state: r,
            preventScrollReset: o,
            relative: s,
            viewTransition: a,
          } = void 0 === t ? {} : t,
          l = og(),
          c = ig(),
          d = ag(e, { relative: s });
        return H.useCallback(
          (t) => {
            if (
              (function (e, t) {
                return !(
                  0 !== e.button ||
                  (t && "_self" !== t) ||
                  (function (e) {
                    return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
                  })(e)
                );
              })(t, n)
            ) {
              t.preventDefault();
              let n = void 0 !== i ? i : mu(c) === mu(d);
              l(e, { replace: n, state: r, preventScrollReset: o, relative: s, viewTransition: a });
            }
          },
          [c, l, d, i, r, n, e, o, s, a],
        );
      })(c, {
        replace: s,
        state: a,
        target: l,
        preventScrollReset: d,
        relative: r,
        viewTransition: u,
      });
    return H.createElement(
      "a",
      xg({}, h, {
        href: n || f,
        onClick:
          p || o
            ? i
            : function (e) {
                (i && i(e), e.defaultPrevented || m(e));
              },
        ref: t,
        target: l,
      }),
    );
  });
var Fg, Bg, Vg, Wg;
function Hg(e) {
  let t = H.useRef(wg(e)),
    n = H.useRef(!1),
    i = ig(),
    r = H.useMemo(
      () =>
        (function (e, t) {
          let n = wg(e);
          return (
            t &&
              t.forEach((e, i) => {
                n.has(i) ||
                  t.getAll(i).forEach((e) => {
                    n.append(i, e);
                  });
              }),
            n
          );
        })(i.search, n.current ? null : t.current),
      [i.search],
    ),
    o = og(),
    s = H.useCallback(
      (e, t) => {
        const i = wg("function" == typeof e ? e(r) : e);
        ((n.current = !0), o("?" + i, t));
      },
      [o, r],
    );
  return [r, s];
}
(((Bg = Fg || (Fg = {})).UseScrollRestoration = "useScrollRestoration"),
  (Bg.UseSubmit = "useSubmit"),
  (Bg.UseSubmitFetcher = "useSubmitFetcher"),
  (Bg.UseFetcher = "useFetcher"),
  (Bg.useViewTransitionState = "useViewTransitionState"),
  ((Wg = Vg || (Vg = {})).UseFetcher = "useFetcher"),
  (Wg.UseFetchers = "useFetchers"),
  (Wg.UseScrollRestoration = "useScrollRestoration"));
const zg = H.createContext({ theme: "system", setTheme: () => null });
function Ug({ children: e, defaultTheme: t = "system", storageKey: n = "vite-ui-theme", ...i }) {
  const [r, o] = H.useState(() => localStorage.getItem(n) || t);
  H.useEffect(() => {
    const e = window.document.documentElement;
    if ((e.classList.remove("light", "dark"), "system" === r)) {
      const t = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
      return void e.classList.add(t);
    }
    e.classList.add(r);
  }, [r]);
  const s = {
    theme: r,
    setTheme: (e) => {
      (localStorage.setItem(n, e), o(e));
    },
  };
  return Q.jsx(zg.Provider, { ...i, value: s, children: e });
}
var $g = { exports: {} },
  qg = {},
  Kg = H;
var Gg =
    "function" == typeof Object.is
      ? Object.is
      : function (e, t) {
          return (e === t && (0 !== e || 1 / e == 1 / t)) || (e != e && t != t);
        },
  Zg = Kg.useSyncExternalStore,
  Yg = Kg.useRef,
  Xg = Kg.useEffect,
  Qg = Kg.useMemo,
  Jg = Kg.useDebugValue;
((qg.useSyncExternalStoreWithSelector = function (e, t, n, i, r) {
  var o = Yg(null);
  if (null === o.current) {
    var s = { hasValue: !1, value: null };
    o.current = s;
  } else s = o.current;
  o = Qg(
    function () {
      function e(e) {
        if (!l) {
          if (((l = !0), (o = e), (e = i(e)), void 0 !== r && s.hasValue)) {
            var t = s.value;
            if (r(t, e)) return (a = t);
          }
          return (a = e);
        }
        if (((t = a), Gg(o, e))) return t;
        var n = i(e);
        return void 0 !== r && r(t, n) ? ((o = e), t) : ((o = e), (a = n));
      }
      var o,
        a,
        l = !1,
        c = void 0 === n ? null : n;
      return [
        function () {
          return e(t());
        },
        null === c
          ? void 0
          : function () {
              return e(c());
            },
      ];
    },
    [t, n, i, r],
  );
  var a = Zg(e, o[0], o[1]);
  return (
    Xg(
      function () {
        ((s.hasValue = !0), (s.value = a));
      },
      [a],
    ),
    Jg(a),
    a
  );
}),
  ($g.exports = qg));
var ep = $g.exports;
var tp = { notify() {}, get: () => [] };
var np = (() =>
    !(
      "undefined" == typeof window ||
      void 0 === window.document ||
      void 0 === window.document.createElement
    ))(),
  ip = (() => "undefined" != typeof navigator && "ReactNative" === navigator.product)(),
  rp = (() => (np || ip ? H.useLayoutEffect : H.useEffect))(),
  op = Symbol.for("react-redux-context"),
  sp = "undefined" != typeof globalThis ? globalThis : {};
function ap() {
  if (!H.createContext) return {};
  const e = (sp[op] ??= new Map());
  let t = e.get(H.createContext);
  return (t || ((t = H.createContext(null)), e.set(H.createContext, t)), t);
}
var lp = ap();
var cp = function (e) {
  const { children: t, context: n, serverState: i, store: r } = e,
    o = H.useMemo(() => {
      const e = (function (e) {
        let t,
          n = tp,
          i = 0,
          r = !1;
        function o() {
          l.onStateChange && l.onStateChange();
        }
        function s() {
          (i++,
            t ||
              ((t = e.subscribe(o)),
              (n = (function () {
                let e = null,
                  t = null;
                return {
                  clear() {
                    ((e = null), (t = null));
                  },
                  notify() {
                    (() => {
                      let t = e;
                      for (; t; ) (t.callback(), (t = t.next));
                    })();
                  },
                  get() {
                    const t = [];
                    let n = e;
                    for (; n; ) (t.push(n), (n = n.next));
                    return t;
                  },
                  subscribe(n) {
                    let i = !0;
                    const r = (t = { callback: n, next: null, prev: t });
                    return (
                      r.prev ? (r.prev.next = r) : (e = r),
                      function () {
                        i &&
                          null !== e &&
                          ((i = !1),
                          r.next ? (r.next.prev = r.prev) : (t = r.prev),
                          r.prev ? (r.prev.next = r.next) : (e = r.next));
                      }
                    );
                  },
                };
              })())));
        }
        function a() {
          (i--, t && 0 === i && (t(), (t = void 0), n.clear(), (n = tp)));
        }
        const l = {
          addNestedSub: function (e) {
            s();
            const t = n.subscribe(e);
            let i = !1;
            return () => {
              i || ((i = !0), t(), a());
            };
          },
          notifyNestedSubs: function () {
            n.notify();
          },
          handleChangeWrapper: o,
          isSubscribed: function () {
            return r;
          },
          trySubscribe: function () {
            r || ((r = !0), s());
          },
          tryUnsubscribe: function () {
            r && ((r = !1), a());
          },
          getListeners: () => n,
        };
        return l;
      })(r);
      return { store: r, subscription: e, getServerState: i ? () => i : void 0 };
    }, [r, i]),
    s = H.useMemo(() => r.getState(), [r]);
  rp(() => {
    const { subscription: e } = o;
    return (
      (e.onStateChange = e.notifyNestedSubs),
      e.trySubscribe(),
      s !== r.getState() && e.notifyNestedSubs(),
      () => {
        (e.tryUnsubscribe(), (e.onStateChange = void 0));
      }
    );
  }, [o, s]);
  const a = n || lp;
  return H.createElement(a.Provider, { value: o }, t);
};
function dp(e = lp) {
  return function () {
    return H.useContext(e);
  };
}
var up = dp();
function hp(e = lp) {
  const t = e === lp ? up : dp(e),
    n = () => {
      const { store: e } = t();
      return e;
    };
  return (Object.assign(n, { withTypes: () => n }), n);
}
var gp = hp();
function pp(e = lp) {
  const t = e === lp ? gp : hp(e),
    n = () => t().dispatch;
  return (Object.assign(n, { withTypes: () => n }), n);
}
var fp = pp(),
  mp = (e, t) => e === t;
function _p(e = lp) {
  const t = e === lp ? up : dp(e),
    n = (e, n = {}) => {
      const { equalityFn: i = mp } = "function" == typeof n ? { equalityFn: n } : n,
        r = t(),
        { store: o, subscription: s, getServerState: a } = r;
      H.useRef(!0);
      const l = H.useCallback({ [e.name]: (t) => e(t) }[e.name], [e]),
        c = ep.useSyncExternalStoreWithSelector(s.addNestedSub, o.getState, a || o.getState, l, i);
      return (H.useDebugValue(c), c);
    };
  return (Object.assign(n, { withTypes: () => n }), n);
}
var vp = _p();
class bp extends H.Component {
  state = { hasError: !1 };
  static getDerivedStateFromError(e) {
    return { hasError: !0 };
  }
  componentDidCatch(e, t) {}
  render() {
    return this.state.hasError
      ? Q.jsxs("div", {
          className: "flex h-screen w-full flex-col items-center justify-center",
          children: [
            Q.jsx("h1", {
              className: "mb-4 text-4xl font-bold",
              children: "Something went wrong.",
            }),
            Q.jsx("p", {
              className: "text-lg",
              children: "Please refresh the page or contact support if the problem persists.",
            }),
          ],
        })
      : this.props.children;
  }
}
const yp = {},
  xp = function (e, t, n) {
    let i = Promise.resolve();
    if (t && t.length > 0) {
      const e = document.getElementsByTagName("link"),
        r = document.querySelector("meta[property=csp-nonce]"),
        o = r?.nonce || r?.getAttribute("nonce");
      i = Promise.allSettled(
        t.map((t) => {
          if (
            ((t = (function (e, t) {
              return new URL(e, t).href;
            })(t, n)),
            t in yp)
          )
            return;
          yp[t] = !0;
          const i = t.endsWith(".css"),
            r = i ? '[rel="stylesheet"]' : "";
          if (!!n)
            for (let n = e.length - 1; n >= 0; n--) {
              const r = e[n];
              if (r.href === t && (!i || "stylesheet" === r.rel)) return;
            }
          else if (document.querySelector(`link[href="${t}"]${r}`)) return;
          const s = document.createElement("link");
          return (
            (s.rel = i ? "stylesheet" : "modulepreload"),
            i || (s.as = "script"),
            (s.crossOrigin = ""),
            (s.href = t),
            o && s.setAttribute("nonce", o),
            document.head.appendChild(s),
            i
              ? new Promise((e, n) => {
                  (s.addEventListener("load", e),
                    s.addEventListener("error", () =>
                      n(new Error(`Unable to preload CSS for ${t}`)),
                    ));
                })
              : void 0
          );
        }),
      );
    }
    function r(e) {
      const t = new Event("vite:preloadError", { cancelable: !0 });
      if (((t.payload = e), window.dispatchEvent(t), !t.defaultPrevented)) throw e;
    }
    return i.then((t) => {
      for (const e of t || []) "rejected" === e.status && r(e.reason);
      return e().catch(r);
    });
  };
function wp(e, t) {
  if ("function" == typeof e) return e(t);
  null != e && (e.current = t);
}
function Cp(...e) {
  return (t) => {
    let n = !1;
    const i = e.map((e) => {
      const i = wp(e, t);
      return (n || "function" != typeof i || (n = !0), i);
    });
    if (n)
      return () => {
        for (let t = 0; t < i.length; t++) {
          const n = i[t];
          "function" == typeof n ? n() : wp(e[t], null);
        }
      };
  };
}
function Sp(...e) {
  return H.useCallback(Cp(...e), e);
}
var kp = Symbol.for("react.lazy"),
  Ep = U[" use ".trim().toString()];
function Np(e) {
  return (
    null != e &&
    "object" == typeof e &&
    "$$typeof" in e &&
    e.$$typeof === kp &&
    "_payload" in e &&
    "object" == typeof (t = e._payload) &&
    null !== t &&
    "then" in t
  );
  var t;
}
function Lp(e) {
  const t = Tp(e),
    n = H.forwardRef((e, n) => {
      let { children: i, ...r } = e;
      Np(i) && "function" == typeof Ep && (i = Ep(i._payload));
      const o = H.Children.toArray(i),
        s = o.find(Rp);
      if (s) {
        const e = s.props.children,
          i = o.map((t) =>
            t === s
              ? H.Children.count(e) > 1
                ? H.Children.only(null)
                : H.isValidElement(e)
                  ? e.props.children
                  : null
              : t,
          );
        return Q.jsx(t, {
          ...r,
          ref: n,
          children: H.isValidElement(e) ? H.cloneElement(e, void 0, i) : null,
        });
      }
      return Q.jsx(t, { ...r, ref: n, children: i });
    });
  return ((n.displayName = `${e}.Slot`), n);
}
var Dp = Lp("Slot");
function Tp(e) {
  const t = H.forwardRef((e, t) => {
    let { children: n, ...i } = e;
    if ((Np(n) && "function" == typeof Ep && (n = Ep(n._payload)), H.isValidElement(n))) {
      const e = (function (e) {
          let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get,
            n = t && "isReactWarning" in t && t.isReactWarning;
          if (n) return e.ref;
          if (
            ((t = Object.getOwnPropertyDescriptor(e, "ref")?.get),
            (n = t && "isReactWarning" in t && t.isReactWarning),
            n)
          )
            return e.props.ref;
          return e.props.ref || e.ref;
        })(n),
        r = (function (e, t) {
          const n = { ...t };
          for (const i in t) {
            const r = e[i],
              o = t[i];
            /^on[A-Z]/.test(i)
              ? r && o
                ? (n[i] = (...e) => {
                    const t = o(...e);
                    return (r(...e), t);
                  })
                : r && (n[i] = r)
              : "style" === i
                ? (n[i] = { ...r, ...o })
                : "className" === i && (n[i] = [r, o].filter(Boolean).join(" "));
          }
          return { ...e, ...n };
        })(i, n.props);
      return (n.type !== H.Fragment && (r.ref = t ? Cp(t, e) : e), H.cloneElement(n, r));
    }
    return H.Children.count(n) > 1 ? H.Children.only(null) : null;
  });
  return ((t.displayName = `${e}.SlotClone`), t);
}
var Ip = Symbol("radix.slottable");
function Rp(e) {
  return (
    H.isValidElement(e) &&
    "function" == typeof e.type &&
    "__radixId" in e.type &&
    e.type.__radixId === Ip
  );
}
function Op(e) {
  var t,
    n,
    i = "";
  if ("string" == typeof e || "number" == typeof e) i += e;
  else if ("object" == typeof e)
    if (Array.isArray(e)) {
      var r = e.length;
      for (t = 0; t < r; t++) e[t] && (n = Op(e[t])) && (i && (i += " "), (i += n));
    } else for (n in e) e[n] && (i && (i += " "), (i += n));
  return i;
}
function Mp() {
  for (var e, t, n = 0, i = "", r = arguments.length; n < r; n++)
    (e = arguments[n]) && (t = Op(e)) && (i && (i += " "), (i += t));
  return i;
}
const Ap = (e) => ("boolean" == typeof e ? `${e}` : 0 === e ? "0" : e),
  Pp = Mp,
  jp = (e, t) => (n) => {
    var i;
    if (null == (null == t ? void 0 : t.variants))
      return Pp(e, null == n ? void 0 : n.class, null == n ? void 0 : n.className);
    const { variants: r, defaultVariants: o } = t,
      s = Object.keys(r).map((e) => {
        const t = null == n ? void 0 : n[e],
          i = null == o ? void 0 : o[e];
        if (null === t) return null;
        const s = Ap(t) || Ap(i);
        return r[e][s];
      }),
      a =
        n &&
        Object.entries(n).reduce((e, t) => {
          let [n, i] = t;
          return (void 0 === i || (e[n] = i), e);
        }, {}),
      l =
        null == t || null === (i = t.compoundVariants) || void 0 === i
          ? void 0
          : i.reduce((e, t) => {
              let { class: n, className: i, ...r } = t;
              return Object.entries(r).every((e) => {
                let [t, n] = e;
                return Array.isArray(n) ? n.includes({ ...o, ...a }[t]) : { ...o, ...a }[t] === n;
              })
                ? [...e, n, i]
                : e;
            }, []);
    return Pp(e, s, l, null == n ? void 0 : n.class, null == n ? void 0 : n.className);
  },
  Fp = (e) => {
    const t = Hp(e),
      { conflictingClassGroups: n, conflictingClassGroupModifiers: i } = e;
    return {
      getClassGroupId: (e) => {
        const n = e.split("-");
        return ("" === n[0] && 1 !== n.length && n.shift(), Bp(n, t) || Wp(e));
      },
      getConflictingClassGroupIds: (e, t) => {
        const r = n[e] || [];
        return t && i[e] ? [...r, ...i[e]] : r;
      },
    };
  },
  Bp = (e, t) => {
    if (0 === e.length) return t.classGroupId;
    const n = e[0],
      i = t.nextPart.get(n),
      r = i ? Bp(e.slice(1), i) : void 0;
    if (r) return r;
    if (0 === t.validators.length) return;
    const o = e.join("-");
    return t.validators.find(({ validator: e }) => e(o))?.classGroupId;
  },
  Vp = /^\[(.+)\]$/,
  Wp = (e) => {
    if (Vp.test(e)) {
      const t = Vp.exec(e)[1],
        n = t?.substring(0, t.indexOf(":"));
      if (n) return "arbitrary.." + n;
    }
  },
  Hp = (e) => {
    const { theme: t, prefix: n } = e,
      i = { nextPart: new Map(), validators: [] };
    return (
      qp(Object.entries(e.classGroups), n).forEach(([e, n]) => {
        zp(n, i, e, t);
      }),
      i
    );
  },
  zp = (e, t, n, i) => {
    e.forEach((e) => {
      if ("string" == typeof e) {
        return void (("" === e ? t : Up(t, e)).classGroupId = n);
      }
      if ("function" == typeof e)
        return $p(e)
          ? void zp(e(i), t, n, i)
          : void t.validators.push({ validator: e, classGroupId: n });
      Object.entries(e).forEach(([e, r]) => {
        zp(r, Up(t, e), n, i);
      });
    });
  },
  Up = (e, t) => {
    let n = e;
    return (
      t.split("-").forEach((e) => {
        (n.nextPart.has(e) || n.nextPart.set(e, { nextPart: new Map(), validators: [] }),
          (n = n.nextPart.get(e)));
      }),
      n
    );
  },
  $p = (e) => e.isThemeGetter,
  qp = (e, t) =>
    t
      ? e.map(([e, n]) => [
          e,
          n.map((e) =>
            "string" == typeof e
              ? t + e
              : "object" == typeof e
                ? Object.fromEntries(Object.entries(e).map(([e, n]) => [t + e, n]))
                : e,
          ),
        ])
      : e,
  Kp = (e) => {
    if (e < 1) return { get: () => {}, set: () => {} };
    let t = 0,
      n = new Map(),
      i = new Map();
    const r = (r, o) => {
      (n.set(r, o), t++, t > e && ((t = 0), (i = n), (n = new Map())));
    };
    return {
      get(e) {
        let t = n.get(e);
        return void 0 !== t ? t : void 0 !== (t = i.get(e)) ? (r(e, t), t) : void 0;
      },
      set(e, t) {
        n.has(e) ? n.set(e, t) : r(e, t);
      },
    };
  },
  Gp = (e) => {
    const { separator: t, experimentalParseClassName: n } = e,
      i = 1 === t.length,
      r = t[0],
      o = t.length,
      s = (e) => {
        const n = [];
        let s,
          a = 0,
          l = 0;
        for (let u = 0; u < e.length; u++) {
          let c = e[u];
          if (0 === a) {
            if (c === r && (i || e.slice(u, u + o) === t)) {
              (n.push(e.slice(l, u)), (l = u + o));
              continue;
            }
            if ("/" === c) {
              s = u;
              continue;
            }
          }
          "[" === c ? a++ : "]" === c && a--;
        }
        const c = 0 === n.length ? e : e.substring(l),
          d = c.startsWith("!");
        return {
          modifiers: n,
          hasImportantModifier: d,
          baseClassName: d ? c.substring(1) : c,
          maybePostfixModifierPosition: s && s > l ? s - l : void 0,
        };
      };
    return n ? (e) => n({ className: e, parseClassName: s }) : s;
  },
  Zp = (e) => {
    if (e.length <= 1) return e;
    const t = [];
    let n = [];
    return (
      e.forEach((e) => {
        "[" === e[0] ? (t.push(...n.sort(), e), (n = [])) : n.push(e);
      }),
      t.push(...n.sort()),
      t
    );
  },
  Yp = /\s+/;
function Xp() {
  let e,
    t,
    n = 0,
    i = "";
  for (; n < arguments.length; ) (e = arguments[n++]) && (t = Qp(e)) && (i && (i += " "), (i += t));
  return i;
}
const Qp = (e) => {
  if ("string" == typeof e) return e;
  let t,
    n = "";
  for (let i = 0; i < e.length; i++) e[i] && (t = Qp(e[i])) && (n && (n += " "), (n += t));
  return n;
};
function Jp(e, ...t) {
  let n,
    i,
    r,
    o = function (a) {
      const l = t.reduce((e, t) => t(e), e());
      return (
        (n = ((e) => ({ cache: Kp(e.cacheSize), parseClassName: Gp(e), ...Fp(e) }))(l)),
        (i = n.cache.get),
        (r = n.cache.set),
        (o = s),
        s(a)
      );
    };
  function s(e) {
    const t = i(e);
    if (t) return t;
    const o = ((e, t) => {
      const { parseClassName: n, getClassGroupId: i, getConflictingClassGroupIds: r } = t,
        o = [],
        s = e.trim().split(Yp);
      let a = "";
      for (let l = s.length - 1; l >= 0; l -= 1) {
        const e = s[l],
          {
            modifiers: t,
            hasImportantModifier: c,
            baseClassName: d,
            maybePostfixModifierPosition: u,
          } = n(e);
        let h = Boolean(u),
          g = i(h ? d.substring(0, u) : d);
        if (!g) {
          if (!h) {
            a = e + (a.length > 0 ? " " + a : a);
            continue;
          }
          if (((g = i(d)), !g)) {
            a = e + (a.length > 0 ? " " + a : a);
            continue;
          }
          h = !1;
        }
        const p = Zp(t).join(":"),
          f = c ? p + "!" : p,
          m = f + g;
        if (o.includes(m)) continue;
        o.push(m);
        const _ = r(g, h);
        for (let n = 0; n < _.length; ++n) {
          const e = _[n];
          o.push(f + e);
        }
        a = e + (a.length > 0 ? " " + a : a);
      }
      return a;
    })(e, n);
    return (r(e, o), o);
  }
  return function () {
    return o(Xp.apply(null, arguments));
  };
}
const ef = (e) => {
    const t = (t) => t[e] || [];
    return ((t.isThemeGetter = !0), t);
  },
  tf = /^\[(?:([a-z-]+):)?(.+)\]$/i,
  nf = /^\d+\/\d+$/,
  rf = new Set(["px", "full", "screen"]),
  of = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,
  sf =
    /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,
  af = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,
  lf = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,
  cf =
    /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,
  df = (e) => hf(e) || rf.has(e) || nf.test(e),
  uf = (e) => kf(e, "length", Ef),
  hf = (e) => Boolean(e) && !Number.isNaN(Number(e)),
  gf = (e) => kf(e, "number", hf),
  pf = (e) => Boolean(e) && Number.isInteger(Number(e)),
  ff = (e) => e.endsWith("%") && hf(e.slice(0, -1)),
  mf = (e) => tf.test(e),
  _f = (e) => of.test(e),
  vf = new Set(["length", "size", "percentage"]),
  bf = (e) => kf(e, vf, Nf),
  yf = (e) => kf(e, "position", Nf),
  xf = new Set(["image", "url"]),
  wf = (e) => kf(e, xf, Df),
  Cf = (e) => kf(e, "", Lf),
  Sf = () => !0,
  kf = (e, t, n) => {
    const i = tf.exec(e);
    return !!i && (i[1] ? ("string" == typeof t ? i[1] === t : t.has(i[1])) : n(i[2]));
  },
  Ef = (e) => sf.test(e) && !af.test(e),
  Nf = () => !1,
  Lf = (e) => lf.test(e),
  Df = (e) => cf.test(e),
  Tf = () => {
    const e = ef("colors"),
      t = ef("spacing"),
      n = ef("blur"),
      i = ef("brightness"),
      r = ef("borderColor"),
      o = ef("borderRadius"),
      s = ef("borderSpacing"),
      a = ef("borderWidth"),
      l = ef("contrast"),
      c = ef("grayscale"),
      d = ef("hueRotate"),
      u = ef("invert"),
      h = ef("gap"),
      g = ef("gradientColorStops"),
      p = ef("gradientColorStopPositions"),
      f = ef("inset"),
      m = ef("margin"),
      _ = ef("opacity"),
      v = ef("padding"),
      b = ef("saturate"),
      y = ef("scale"),
      x = ef("sepia"),
      w = ef("skew"),
      C = ef("space"),
      S = ef("translate"),
      k = () => ["auto", mf, t],
      E = () => [mf, t],
      N = () => ["", df, uf],
      L = () => ["auto", hf, mf],
      D = () => ["", "0", mf],
      T = () => [hf, mf];
    return {
      cacheSize: 500,
      separator: ":",
      theme: {
        colors: [Sf],
        spacing: [df, uf],
        blur: ["none", "", _f, mf],
        brightness: T(),
        borderColor: [e],
        borderRadius: ["none", "", "full", _f, mf],
        borderSpacing: E(),
        borderWidth: N(),
        contrast: T(),
        grayscale: D(),
        hueRotate: T(),
        invert: D(),
        gap: E(),
        gradientColorStops: [e],
        gradientColorStopPositions: [ff, uf],
        inset: k(),
        margin: k(),
        opacity: T(),
        padding: E(),
        saturate: T(),
        scale: T(),
        sepia: D(),
        skew: T(),
        space: E(),
        translate: E(),
      },
      classGroups: {
        aspect: [{ aspect: ["auto", "square", "video", mf] }],
        container: ["container"],
        columns: [{ columns: [_f] }],
        "break-after": [
          {
            "break-after": [
              "auto",
              "avoid",
              "all",
              "avoid-page",
              "page",
              "left",
              "right",
              "column",
            ],
          },
        ],
        "break-before": [
          {
            "break-before": [
              "auto",
              "avoid",
              "all",
              "avoid-page",
              "page",
              "left",
              "right",
              "column",
            ],
          },
        ],
        "break-inside": [{ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"] }],
        "box-decoration": [{ "box-decoration": ["slice", "clone"] }],
        box: [{ box: ["border", "content"] }],
        display: [
          "block",
          "inline-block",
          "inline",
          "flex",
          "inline-flex",
          "table",
          "inline-table",
          "table-caption",
          "table-cell",
          "table-column",
          "table-column-group",
          "table-footer-group",
          "table-header-group",
          "table-row-group",
          "table-row",
          "flow-root",
          "grid",
          "inline-grid",
          "contents",
          "list-item",
          "hidden",
        ],
        float: [{ float: ["right", "left", "none", "start", "end"] }],
        clear: [{ clear: ["left", "right", "both", "none", "start", "end"] }],
        isolation: ["isolate", "isolation-auto"],
        "object-fit": [{ object: ["contain", "cover", "fill", "none", "scale-down"] }],
        "object-position": [
          {
            object: [
              "bottom",
              "center",
              "left",
              "left-bottom",
              "left-top",
              "right",
              "right-bottom",
              "right-top",
              "top",
              mf,
            ],
          },
        ],
        overflow: [{ overflow: ["auto", "hidden", "clip", "visible", "scroll"] }],
        "overflow-x": [{ "overflow-x": ["auto", "hidden", "clip", "visible", "scroll"] }],
        "overflow-y": [{ "overflow-y": ["auto", "hidden", "clip", "visible", "scroll"] }],
        overscroll: [{ overscroll: ["auto", "contain", "none"] }],
        "overscroll-x": [{ "overscroll-x": ["auto", "contain", "none"] }],
        "overscroll-y": [{ "overscroll-y": ["auto", "contain", "none"] }],
        position: ["static", "fixed", "absolute", "relative", "sticky"],
        inset: [{ inset: [f] }],
        "inset-x": [{ "inset-x": [f] }],
        "inset-y": [{ "inset-y": [f] }],
        start: [{ start: [f] }],
        end: [{ end: [f] }],
        top: [{ top: [f] }],
        right: [{ right: [f] }],
        bottom: [{ bottom: [f] }],
        left: [{ left: [f] }],
        visibility: ["visible", "invisible", "collapse"],
        z: [{ z: ["auto", pf, mf] }],
        basis: [{ basis: k() }],
        "flex-direction": [{ flex: ["row", "row-reverse", "col", "col-reverse"] }],
        "flex-wrap": [{ flex: ["wrap", "wrap-reverse", "nowrap"] }],
        flex: [{ flex: ["1", "auto", "initial", "none", mf] }],
        grow: [{ grow: D() }],
        shrink: [{ shrink: D() }],
        order: [{ order: ["first", "last", "none", pf, mf] }],
        "grid-cols": [{ "grid-cols": [Sf] }],
        "col-start-end": [{ col: ["auto", { span: ["full", pf, mf] }, mf] }],
        "col-start": [{ "col-start": L() }],
        "col-end": [{ "col-end": L() }],
        "grid-rows": [{ "grid-rows": [Sf] }],
        "row-start-end": [{ row: ["auto", { span: [pf, mf] }, mf] }],
        "row-start": [{ "row-start": L() }],
        "row-end": [{ "row-end": L() }],
        "grid-flow": [{ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"] }],
        "auto-cols": [{ "auto-cols": ["auto", "min", "max", "fr", mf] }],
        "auto-rows": [{ "auto-rows": ["auto", "min", "max", "fr", mf] }],
        gap: [{ gap: [h] }],
        "gap-x": [{ "gap-x": [h] }],
        "gap-y": [{ "gap-y": [h] }],
        "justify-content": [
          {
            justify: ["normal", "start", "end", "center", "between", "around", "evenly", "stretch"],
          },
        ],
        "justify-items": [{ "justify-items": ["start", "end", "center", "stretch"] }],
        "justify-self": [{ "justify-self": ["auto", "start", "end", "center", "stretch"] }],
        "align-content": [
          {
            content: [
              "normal",
              "start",
              "end",
              "center",
              "between",
              "around",
              "evenly",
              "stretch",
              "baseline",
            ],
          },
        ],
        "align-items": [{ items: ["start", "end", "center", "baseline", "stretch"] }],
        "align-self": [{ self: ["auto", "start", "end", "center", "stretch", "baseline"] }],
        "place-content": [
          {
            "place-content": [
              "start",
              "end",
              "center",
              "between",
              "around",
              "evenly",
              "stretch",
              "baseline",
            ],
          },
        ],
        "place-items": [{ "place-items": ["start", "end", "center", "baseline", "stretch"] }],
        "place-self": [{ "place-self": ["auto", "start", "end", "center", "stretch"] }],
        p: [{ p: [v] }],
        px: [{ px: [v] }],
        py: [{ py: [v] }],
        ps: [{ ps: [v] }],
        pe: [{ pe: [v] }],
        pt: [{ pt: [v] }],
        pr: [{ pr: [v] }],
        pb: [{ pb: [v] }],
        pl: [{ pl: [v] }],
        m: [{ m: [m] }],
        mx: [{ mx: [m] }],
        my: [{ my: [m] }],
        ms: [{ ms: [m] }],
        me: [{ me: [m] }],
        mt: [{ mt: [m] }],
        mr: [{ mr: [m] }],
        mb: [{ mb: [m] }],
        ml: [{ ml: [m] }],
        "space-x": [{ "space-x": [C] }],
        "space-x-reverse": ["space-x-reverse"],
        "space-y": [{ "space-y": [C] }],
        "space-y-reverse": ["space-y-reverse"],
        w: [{ w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", mf, t] }],
        "min-w": [{ "min-w": [mf, t, "min", "max", "fit"] }],
        "max-w": [
          { "max-w": [mf, t, "none", "full", "min", "max", "fit", "prose", { screen: [_f] }, _f] },
        ],
        h: [{ h: [mf, t, "auto", "min", "max", "fit", "svh", "lvh", "dvh"] }],
        "min-h": [{ "min-h": [mf, t, "min", "max", "fit", "svh", "lvh", "dvh"] }],
        "max-h": [{ "max-h": [mf, t, "min", "max", "fit", "svh", "lvh", "dvh"] }],
        size: [{ size: [mf, t, "auto", "min", "max", "fit"] }],
        "font-size": [{ text: ["base", _f, uf] }],
        "font-smoothing": ["antialiased", "subpixel-antialiased"],
        "font-style": ["italic", "not-italic"],
        "font-weight": [
          {
            font: [
              "thin",
              "extralight",
              "light",
              "normal",
              "medium",
              "semibold",
              "bold",
              "extrabold",
              "black",
              gf,
            ],
          },
        ],
        "font-family": [{ font: [Sf] }],
        "fvn-normal": ["normal-nums"],
        "fvn-ordinal": ["ordinal"],
        "fvn-slashed-zero": ["slashed-zero"],
        "fvn-figure": ["lining-nums", "oldstyle-nums"],
        "fvn-spacing": ["proportional-nums", "tabular-nums"],
        "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
        tracking: [{ tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", mf] }],
        "line-clamp": [{ "line-clamp": ["none", hf, gf] }],
        leading: [{ leading: ["none", "tight", "snug", "normal", "relaxed", "loose", df, mf] }],
        "list-image": [{ "list-image": ["none", mf] }],
        "list-style-type": [{ list: ["none", "disc", "decimal", mf] }],
        "list-style-position": [{ list: ["inside", "outside"] }],
        "placeholder-color": [{ placeholder: [e] }],
        "placeholder-opacity": [{ "placeholder-opacity": [_] }],
        "text-alignment": [{ text: ["left", "center", "right", "justify", "start", "end"] }],
        "text-color": [{ text: [e] }],
        "text-opacity": [{ "text-opacity": [_] }],
        "text-decoration": ["underline", "overline", "line-through", "no-underline"],
        "text-decoration-style": [
          { decoration: ["solid", "dashed", "dotted", "double", "none", "wavy"] },
        ],
        "text-decoration-thickness": [{ decoration: ["auto", "from-font", df, uf] }],
        "underline-offset": [{ "underline-offset": ["auto", df, mf] }],
        "text-decoration-color": [{ decoration: [e] }],
        "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
        "text-overflow": ["truncate", "text-ellipsis", "text-clip"],
        "text-wrap": [{ text: ["wrap", "nowrap", "balance", "pretty"] }],
        indent: [{ indent: E() }],
        "vertical-align": [
          {
            align: [
              "baseline",
              "top",
              "middle",
              "bottom",
              "text-top",
              "text-bottom",
              "sub",
              "super",
              mf,
            ],
          },
        ],
        whitespace: [
          { whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"] },
        ],
        break: [{ break: ["normal", "words", "all", "keep"] }],
        hyphens: [{ hyphens: ["none", "manual", "auto"] }],
        content: [{ content: ["none", mf] }],
        "bg-attachment": [{ bg: ["fixed", "local", "scroll"] }],
        "bg-clip": [{ "bg-clip": ["border", "padding", "content", "text"] }],
        "bg-opacity": [{ "bg-opacity": [_] }],
        "bg-origin": [{ "bg-origin": ["border", "padding", "content"] }],
        "bg-position": [
          {
            bg: [
              "bottom",
              "center",
              "left",
              "left-bottom",
              "left-top",
              "right",
              "right-bottom",
              "right-top",
              "top",
              yf,
            ],
          },
        ],
        "bg-repeat": [{ bg: ["no-repeat", { repeat: ["", "x", "y", "round", "space"] }] }],
        "bg-size": [{ bg: ["auto", "cover", "contain", bf] }],
        "bg-image": [
          { bg: ["none", { "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"] }, wf] },
        ],
        "bg-color": [{ bg: [e] }],
        "gradient-from-pos": [{ from: [p] }],
        "gradient-via-pos": [{ via: [p] }],
        "gradient-to-pos": [{ to: [p] }],
        "gradient-from": [{ from: [g] }],
        "gradient-via": [{ via: [g] }],
        "gradient-to": [{ to: [g] }],
        rounded: [{ rounded: [o] }],
        "rounded-s": [{ "rounded-s": [o] }],
        "rounded-e": [{ "rounded-e": [o] }],
        "rounded-t": [{ "rounded-t": [o] }],
        "rounded-r": [{ "rounded-r": [o] }],
        "rounded-b": [{ "rounded-b": [o] }],
        "rounded-l": [{ "rounded-l": [o] }],
        "rounded-ss": [{ "rounded-ss": [o] }],
        "rounded-se": [{ "rounded-se": [o] }],
        "rounded-ee": [{ "rounded-ee": [o] }],
        "rounded-es": [{ "rounded-es": [o] }],
        "rounded-tl": [{ "rounded-tl": [o] }],
        "rounded-tr": [{ "rounded-tr": [o] }],
        "rounded-br": [{ "rounded-br": [o] }],
        "rounded-bl": [{ "rounded-bl": [o] }],
        "border-w": [{ border: [a] }],
        "border-w-x": [{ "border-x": [a] }],
        "border-w-y": [{ "border-y": [a] }],
        "border-w-s": [{ "border-s": [a] }],
        "border-w-e": [{ "border-e": [a] }],
        "border-w-t": [{ "border-t": [a] }],
        "border-w-r": [{ "border-r": [a] }],
        "border-w-b": [{ "border-b": [a] }],
        "border-w-l": [{ "border-l": [a] }],
        "border-opacity": [{ "border-opacity": [_] }],
        "border-style": [{ border: ["solid", "dashed", "dotted", "double", "none", "hidden"] }],
        "divide-x": [{ "divide-x": [a] }],
        "divide-x-reverse": ["divide-x-reverse"],
        "divide-y": [{ "divide-y": [a] }],
        "divide-y-reverse": ["divide-y-reverse"],
        "divide-opacity": [{ "divide-opacity": [_] }],
        "divide-style": [{ divide: ["solid", "dashed", "dotted", "double", "none"] }],
        "border-color": [{ border: [r] }],
        "border-color-x": [{ "border-x": [r] }],
        "border-color-y": [{ "border-y": [r] }],
        "border-color-s": [{ "border-s": [r] }],
        "border-color-e": [{ "border-e": [r] }],
        "border-color-t": [{ "border-t": [r] }],
        "border-color-r": [{ "border-r": [r] }],
        "border-color-b": [{ "border-b": [r] }],
        "border-color-l": [{ "border-l": [r] }],
        "divide-color": [{ divide: [r] }],
        "outline-style": [{ outline: ["", "solid", "dashed", "dotted", "double", "none"] }],
        "outline-offset": [{ "outline-offset": [df, mf] }],
        "outline-w": [{ outline: [df, uf] }],
        "outline-color": [{ outline: [e] }],
        "ring-w": [{ ring: N() }],
        "ring-w-inset": ["ring-inset"],
        "ring-color": [{ ring: [e] }],
        "ring-opacity": [{ "ring-opacity": [_] }],
        "ring-offset-w": [{ "ring-offset": [df, uf] }],
        "ring-offset-color": [{ "ring-offset": [e] }],
        shadow: [{ shadow: ["", "inner", "none", _f, Cf] }],
        "shadow-color": [{ shadow: [Sf] }],
        opacity: [{ opacity: [_] }],
        "mix-blend": [
          {
            "mix-blend": [
              "normal",
              "multiply",
              "screen",
              "overlay",
              "darken",
              "lighten",
              "color-dodge",
              "color-burn",
              "hard-light",
              "soft-light",
              "difference",
              "exclusion",
              "hue",
              "saturation",
              "color",
              "luminosity",
              "plus-lighter",
              "plus-darker",
            ],
          },
        ],
        "bg-blend": [
          {
            "bg-blend": [
              "normal",
              "multiply",
              "screen",
              "overlay",
              "darken",
              "lighten",
              "color-dodge",
              "color-burn",
              "hard-light",
              "soft-light",
              "difference",
              "exclusion",
              "hue",
              "saturation",
              "color",
              "luminosity",
            ],
          },
        ],
        filter: [{ filter: ["", "none"] }],
        blur: [{ blur: [n] }],
        brightness: [{ brightness: [i] }],
        contrast: [{ contrast: [l] }],
        "drop-shadow": [{ "drop-shadow": ["", "none", _f, mf] }],
        grayscale: [{ grayscale: [c] }],
        "hue-rotate": [{ "hue-rotate": [d] }],
        invert: [{ invert: [u] }],
        saturate: [{ saturate: [b] }],
        sepia: [{ sepia: [x] }],
        "backdrop-filter": [{ "backdrop-filter": ["", "none"] }],
        "backdrop-blur": [{ "backdrop-blur": [n] }],
        "backdrop-brightness": [{ "backdrop-brightness": [i] }],
        "backdrop-contrast": [{ "backdrop-contrast": [l] }],
        "backdrop-grayscale": [{ "backdrop-grayscale": [c] }],
        "backdrop-hue-rotate": [{ "backdrop-hue-rotate": [d] }],
        "backdrop-invert": [{ "backdrop-invert": [u] }],
        "backdrop-opacity": [{ "backdrop-opacity": [_] }],
        "backdrop-saturate": [{ "backdrop-saturate": [b] }],
        "backdrop-sepia": [{ "backdrop-sepia": [x] }],
        "border-collapse": [{ border: ["collapse", "separate"] }],
        "border-spacing": [{ "border-spacing": [s] }],
        "border-spacing-x": [{ "border-spacing-x": [s] }],
        "border-spacing-y": [{ "border-spacing-y": [s] }],
        "table-layout": [{ table: ["auto", "fixed"] }],
        caption: [{ caption: ["top", "bottom"] }],
        transition: [
          { transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", mf] },
        ],
        duration: [{ duration: T() }],
        ease: [{ ease: ["linear", "in", "out", "in-out", mf] }],
        delay: [{ delay: T() }],
        animate: [{ animate: ["none", "spin", "ping", "pulse", "bounce", mf] }],
        transform: [{ transform: ["", "gpu", "none"] }],
        scale: [{ scale: [y] }],
        "scale-x": [{ "scale-x": [y] }],
        "scale-y": [{ "scale-y": [y] }],
        rotate: [{ rotate: [pf, mf] }],
        "translate-x": [{ "translate-x": [S] }],
        "translate-y": [{ "translate-y": [S] }],
        "skew-x": [{ "skew-x": [w] }],
        "skew-y": [{ "skew-y": [w] }],
        "transform-origin": [
          {
            origin: [
              "center",
              "top",
              "top-right",
              "right",
              "bottom-right",
              "bottom",
              "bottom-left",
              "left",
              "top-left",
              mf,
            ],
          },
        ],
        accent: [{ accent: ["auto", e] }],
        appearance: [{ appearance: ["none", "auto"] }],
        cursor: [
          {
            cursor: [
              "auto",
              "default",
              "pointer",
              "wait",
              "text",
              "move",
              "help",
              "not-allowed",
              "none",
              "context-menu",
              "progress",
              "cell",
              "crosshair",
              "vertical-text",
              "alias",
              "copy",
              "no-drop",
              "grab",
              "grabbing",
              "all-scroll",
              "col-resize",
              "row-resize",
              "n-resize",
              "e-resize",
              "s-resize",
              "w-resize",
              "ne-resize",
              "nw-resize",
              "se-resize",
              "sw-resize",
              "ew-resize",
              "ns-resize",
              "nesw-resize",
              "nwse-resize",
              "zoom-in",
              "zoom-out",
              mf,
            ],
          },
        ],
        "caret-color": [{ caret: [e] }],
        "pointer-events": [{ "pointer-events": ["none", "auto"] }],
        resize: [{ resize: ["none", "y", "x", ""] }],
        "scroll-behavior": [{ scroll: ["auto", "smooth"] }],
        "scroll-m": [{ "scroll-m": E() }],
        "scroll-mx": [{ "scroll-mx": E() }],
        "scroll-my": [{ "scroll-my": E() }],
        "scroll-ms": [{ "scroll-ms": E() }],
        "scroll-me": [{ "scroll-me": E() }],
        "scroll-mt": [{ "scroll-mt": E() }],
        "scroll-mr": [{ "scroll-mr": E() }],
        "scroll-mb": [{ "scroll-mb": E() }],
        "scroll-ml": [{ "scroll-ml": E() }],
        "scroll-p": [{ "scroll-p": E() }],
        "scroll-px": [{ "scroll-px": E() }],
        "scroll-py": [{ "scroll-py": E() }],
        "scroll-ps": [{ "scroll-ps": E() }],
        "scroll-pe": [{ "scroll-pe": E() }],
        "scroll-pt": [{ "scroll-pt": E() }],
        "scroll-pr": [{ "scroll-pr": E() }],
        "scroll-pb": [{ "scroll-pb": E() }],
        "scroll-pl": [{ "scroll-pl": E() }],
        "snap-align": [{ snap: ["start", "end", "center", "align-none"] }],
        "snap-stop": [{ snap: ["normal", "always"] }],
        "snap-type": [{ snap: ["none", "x", "y", "both"] }],
        "snap-strictness": [{ snap: ["mandatory", "proximity"] }],
        touch: [{ touch: ["auto", "none", "manipulation"] }],
        "touch-x": [{ "touch-pan": ["x", "left", "right"] }],
        "touch-y": [{ "touch-pan": ["y", "up", "down"] }],
        "touch-pz": ["touch-pinch-zoom"],
        select: [{ select: ["none", "text", "all", "auto"] }],
        "will-change": [{ "will-change": ["auto", "scroll", "contents", "transform", mf] }],
        fill: [{ fill: [e, "none"] }],
        "stroke-w": [{ stroke: [df, uf, gf] }],
        stroke: [{ stroke: [e, "none"] }],
        sr: ["sr-only", "not-sr-only"],
        "forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }],
      },
      conflictingClassGroups: {
        overflow: ["overflow-x", "overflow-y"],
        overscroll: ["overscroll-x", "overscroll-y"],
        inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
        "inset-x": ["right", "left"],
        "inset-y": ["top", "bottom"],
        flex: ["basis", "grow", "shrink"],
        gap: ["gap-x", "gap-y"],
        p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
        px: ["pr", "pl"],
        py: ["pt", "pb"],
        m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
        mx: ["mr", "ml"],
        my: ["mt", "mb"],
        size: ["w", "h"],
        "font-size": ["leading"],
        "fvn-normal": [
          "fvn-ordinal",
          "fvn-slashed-zero",
          "fvn-figure",
          "fvn-spacing",
          "fvn-fraction",
        ],
        "fvn-ordinal": ["fvn-normal"],
        "fvn-slashed-zero": ["fvn-normal"],
        "fvn-figure": ["fvn-normal"],
        "fvn-spacing": ["fvn-normal"],
        "fvn-fraction": ["fvn-normal"],
        "line-clamp": ["display", "overflow"],
        rounded: [
          "rounded-s",
          "rounded-e",
          "rounded-t",
          "rounded-r",
          "rounded-b",
          "rounded-l",
          "rounded-ss",
          "rounded-se",
          "rounded-ee",
          "rounded-es",
          "rounded-tl",
          "rounded-tr",
          "rounded-br",
          "rounded-bl",
        ],
        "rounded-s": ["rounded-ss", "rounded-es"],
        "rounded-e": ["rounded-se", "rounded-ee"],
        "rounded-t": ["rounded-tl", "rounded-tr"],
        "rounded-r": ["rounded-tr", "rounded-br"],
        "rounded-b": ["rounded-br", "rounded-bl"],
        "rounded-l": ["rounded-tl", "rounded-bl"],
        "border-spacing": ["border-spacing-x", "border-spacing-y"],
        "border-w": [
          "border-w-s",
          "border-w-e",
          "border-w-t",
          "border-w-r",
          "border-w-b",
          "border-w-l",
        ],
        "border-w-x": ["border-w-r", "border-w-l"],
        "border-w-y": ["border-w-t", "border-w-b"],
        "border-color": [
          "border-color-s",
          "border-color-e",
          "border-color-t",
          "border-color-r",
          "border-color-b",
          "border-color-l",
        ],
        "border-color-x": ["border-color-r", "border-color-l"],
        "border-color-y": ["border-color-t", "border-color-b"],
        "scroll-m": [
          "scroll-mx",
          "scroll-my",
          "scroll-ms",
          "scroll-me",
          "scroll-mt",
          "scroll-mr",
          "scroll-mb",
          "scroll-ml",
        ],
        "scroll-mx": ["scroll-mr", "scroll-ml"],
        "scroll-my": ["scroll-mt", "scroll-mb"],
        "scroll-p": [
          "scroll-px",
          "scroll-py",
          "scroll-ps",
          "scroll-pe",
          "scroll-pt",
          "scroll-pr",
          "scroll-pb",
          "scroll-pl",
        ],
        "scroll-px": ["scroll-pr", "scroll-pl"],
        "scroll-py": ["scroll-pt", "scroll-pb"],
        touch: ["touch-x", "touch-y", "touch-pz"],
        "touch-x": ["touch"],
        "touch-y": ["touch"],
        "touch-pz": ["touch"],
      },
      conflictingClassGroupModifiers: { "font-size": ["leading"] },
    };
  },
  If = Jp(Tf);
function Rf(...e) {
  return If(Mp(e));
}
var Of = { exports: {} };
function Mf() {}
function Af() {}
Af.resetWarningCache = Mf;
Of.exports = (function () {
  function e(e, t, n, i, r, o) {
    if ("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED" !== o) {
      var s = new Error(
        "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types",
      );
      throw ((s.name = "Invariant Violation"), s);
    }
  }
  function t() {
    return e;
  }
  e.isRequired = e;
  var n = {
    array: e,
    bigint: e,
    bool: e,
    func: e,
    number: e,
    object: e,
    string: e,
    symbol: e,
    any: e,
    arrayOf: t,
    element: e,
    elementType: e,
    instanceOf: t,
    node: e,
    objectOf: t,
    oneOf: t,
    oneOfType: t,
    shape: t,
    exact: t,
    checkPropTypes: Af,
    resetWarningCache: Mf,
  };
  return ((n.PropTypes = n), n);
})();
const Pf = n(Of.exports);
var jf = {
    xmlns: "http://www.w3.org/2000/svg",
    width: 24,
    height: 24,
    viewBox: "0 0 24 24",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: 2,
    strokeLinecap: "round",
    strokeLinejoin: "round",
  },
  Ff = Object.defineProperty,
  Bf = Object.defineProperties,
  Vf = Object.getOwnPropertyDescriptors,
  Wf = Object.getOwnPropertySymbols,
  Hf = Object.prototype.hasOwnProperty,
  zf = Object.prototype.propertyIsEnumerable,
  Uf = (e, t, n) =>
    t in e ? Ff(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : (e[t] = n),
  $f = (e, t) => {
    for (var n in t || (t = {})) Hf.call(t, n) && Uf(e, n, t[n]);
    if (Wf) for (var n of Wf(t)) zf.call(t, n) && Uf(e, n, t[n]);
    return e;
  },
  qf = (e, t, n) => {
    const i = H.forwardRef((t, i) => {
      var r = t,
        { color: o = "currentColor", size: s = 24, stroke: a = 2, children: l } = r,
        c = ((e, t) => {
          var n = {};
          for (var i in e) Hf.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
          if (null != e && Wf)
            for (var i of Wf(e)) t.indexOf(i) < 0 && zf.call(e, i) && (n[i] = e[i]);
          return n;
        })(r, ["color", "size", "stroke", "children"]);
      return H.createElement(
        "svg",
        $f(
          ((e, t) => Bf(e, Vf(t)))($f({ ref: i }, jf), {
            width: s,
            height: s,
            stroke: o,
            strokeWidth: a,
            className: `tabler-icon tabler-icon-${e}`,
          }),
          c,
        ),
        [...n.map(([e, t]) => H.createElement(e, t)), ...(l || [])],
      );
    });
    return (
      (i.propTypes = {
        color: Pf.string,
        size: Pf.oneOfType([Pf.string, Pf.number]),
        stroke: Pf.oneOfType([Pf.string, Pf.number]),
      }),
      (i.displayName = `${t}`),
      i
    );
  },
  Kf = qf("adjustments", "IconAdjustments", [
    ["path", { d: "M4 10a2 2 0 1 0 4 0a2 2 0 0 0 -4 0", key: "svg-0" }],
    ["path", { d: "M6 4v4", key: "svg-1" }],
    ["path", { d: "M6 12v8", key: "svg-2" }],
    ["path", { d: "M10 16a2 2 0 1 0 4 0a2 2 0 0 0 -4 0", key: "svg-3" }],
    ["path", { d: "M12 4v10", key: "svg-4" }],
    ["path", { d: "M12 18v2", key: "svg-5" }],
    ["path", { d: "M16 7a2 2 0 1 0 4 0a2 2 0 0 0 -4 0", key: "svg-6" }],
    ["path", { d: "M18 4v1", key: "svg-7" }],
    ["path", { d: "M18 9v11", key: "svg-8" }],
  ]),
  Gf = qf("brand-telegram", "IconBrandTelegram", [
    ["path", { d: "M15 10l-4 4l6 6l4 -16l-18 7l4 2l2 6l3 -4", key: "svg-0" }],
  ]),
  Zf = qf("building-store", "IconBuildingStore", [
    ["path", { d: "M3 21l18 0", key: "svg-0" }],
    [
      "path",
      {
        d: "M3 7v1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1h-18l2 -4h14l2 4",
        key: "svg-1",
      },
    ],
    ["path", { d: "M5 21l0 -10.15", key: "svg-2" }],
    ["path", { d: "M19 21l0 -10.15", key: "svg-3" }],
    ["path", { d: "M9 21v-4a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v4", key: "svg-4" }],
  ]),
  Yf = qf("building", "IconBuilding", [
    ["path", { d: "M3 21l18 0", key: "svg-0" }],
    ["path", { d: "M9 8l1 0", key: "svg-1" }],
    ["path", { d: "M9 12l1 0", key: "svg-2" }],
    ["path", { d: "M9 16l1 0", key: "svg-3" }],
    ["path", { d: "M14 8l1 0", key: "svg-4" }],
    ["path", { d: "M14 12l1 0", key: "svg-5" }],
    ["path", { d: "M14 16l1 0", key: "svg-6" }],
    ["path", { d: "M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16", key: "svg-7" }],
  ]),
  Xf = qf("cash", "IconCash", [
    [
      "path",
      {
        d: "M7 9m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",
        key: "svg-0",
      },
    ],
    ["path", { d: "M14 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-1" }],
    ["path", { d: "M17 9v-2a2 2 0 0 0 -2 -2h-10a2 2 0 0 0 -2 2v6a2 2 0 0 0 2 2h2", key: "svg-2" }],
  ]),
  Qf = qf("chevron-down", "IconChevronDown", [["path", { d: "M6 9l6 6l6 -6", key: "svg-0" }]]),
  Jf = qf("chevrons-left", "IconChevronsLeft", [
    ["path", { d: "M11 7l-5 5l5 5", key: "svg-0" }],
    ["path", { d: "M17 7l-5 5l5 5", key: "svg-1" }],
  ]),
  em = qf("copy", "IconCopy", [
    [
      "path",
      {
        d: "M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",
        key: "svg-0",
      },
    ],
    [
      "path",
      {
        d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",
        key: "svg-1",
      },
    ],
  ]),
  tm = qf("credit-card", "IconCreditCard", [
    [
      "path",
      {
        d: "M3 5m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",
        key: "svg-0",
      },
    ],
    ["path", { d: "M3 10l18 0", key: "svg-1" }],
    ["path", { d: "M7 15l.01 0", key: "svg-2" }],
    ["path", { d: "M11 15l2 0", key: "svg-3" }],
  ]),
  nm = qf("dashboard", "IconDashboard", [
    ["path", { d: "M12 13m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-0" }],
    ["path", { d: "M13.45 11.55l2.05 -2.05", key: "svg-1" }],
    ["path", { d: "M6.4 20a9 9 0 1 1 11.2 0z", key: "svg-2" }],
  ]),
  im = qf("device-desktop", "IconDeviceDesktop", [
    [
      "path",
      {
        d: "M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z",
        key: "svg-0",
      },
    ],
    ["path", { d: "M7 20h10", key: "svg-1" }],
    ["path", { d: "M9 16v4", key: "svg-2" }],
    ["path", { d: "M15 16v4", key: "svg-3" }],
  ]),
  rm = qf("discount-check", "IconDiscountCheck", [
    [
      "path",
      {
        d: "M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1",
        key: "svg-0",
      },
    ],
    ["path", { d: "M9 12l2 2l4 -4", key: "svg-1" }],
  ]),
  om = qf("eye-off", "IconEyeOff", [
    ["path", { d: "M10.585 10.587a2 2 0 0 0 2.829 2.828", key: "svg-0" }],
    [
      "path",
      {
        d: "M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",
        key: "svg-1",
      },
    ],
    ["path", { d: "M3 3l18 18", key: "svg-2" }],
  ]),
  sm = qf("eye", "IconEye", [
    ["path", { d: "M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0", key: "svg-0" }],
    [
      "path",
      {
        d: "M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",
        key: "svg-1",
      },
    ],
  ]),
  am = qf("file-text", "IconFileText", [
    ["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-0" }],
    [
      "path",
      { d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z", key: "svg-1" },
    ],
    ["path", { d: "M9 9l1 0", key: "svg-2" }],
    ["path", { d: "M9 13l6 0", key: "svg-3" }],
    ["path", { d: "M9 17l6 0", key: "svg-4" }],
  ]),
  lm = qf("gift", "IconGift", [
    [
      "path",
      {
        d: "M3 8m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1z",
        key: "svg-0",
      },
    ],
    ["path", { d: "M12 8l0 13", key: "svg-1" }],
    ["path", { d: "M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7", key: "svg-2" }],
    [
      "path",
      {
        d: "M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5",
        key: "svg-3",
      },
    ],
  ]),
  cm = qf("loader-2", "IconLoader2", [["path", { d: "M12 3a9 9 0 1 0 9 9", key: "svg-0" }]]),
  dm = qf("lock", "IconLock", [
    [
      "path",
      {
        d: "M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",
        key: "svg-0",
      },
    ],
    ["path", { d: "M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0", key: "svg-1" }],
    ["path", { d: "M8 11v-4a4 4 0 1 1 8 0v4", key: "svg-2" }],
  ]),
  um = qf("mail", "IconMail", [
    [
      "path",
      {
        d: "M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z",
        key: "svg-0",
      },
    ],
    ["path", { d: "M3 7l9 6l9 -6", key: "svg-1" }],
  ]),
  hm = qf("menu-2", "IconMenu2", [
    ["path", { d: "M4 6l16 0", key: "svg-0" }],
    ["path", { d: "M4 12l16 0", key: "svg-1" }],
    ["path", { d: "M4 18l16 0", key: "svg-2" }],
  ]),
  gm = qf("moon", "IconMoon", [
    [
      "path",
      {
        d: "M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z",
        key: "svg-0",
      },
    ],
  ]),
  pm = qf("news", "IconNews", [
    [
      "path",
      {
        d: "M16 6h3a1 1 0 0 1 1 1v11a2 2 0 0 1 -4 0v-13a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1v12a3 3 0 0 0 3 3h11",
        key: "svg-0",
      },
    ],
    ["path", { d: "M8 8l4 0", key: "svg-1" }],
    ["path", { d: "M8 12l4 0", key: "svg-2" }],
    ["path", { d: "M8 16l4 0", key: "svg-3" }],
  ]),
  fm = qf("route", "IconRoute", [
    ["path", { d: "M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0", key: "svg-0" }],
    ["path", { d: "M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4z", key: "svg-1" }],
    ["path", { d: "M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5", key: "svg-2" }],
  ]),
  mm = qf("server-bolt", "IconServerBolt", [
    [
      "path",
      {
        d: "M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",
        key: "svg-0",
      },
    ],
    ["path", { d: "M15 20h-9a3 3 0 0 1 -3 -3v-2a3 3 0 0 1 3 -3h12", key: "svg-1" }],
    ["path", { d: "M7 8v.01", key: "svg-2" }],
    ["path", { d: "M7 16v.01", key: "svg-3" }],
    ["path", { d: "M20 15l-2 3h3l-2 3", key: "svg-4" }],
  ]),
  _m = qf("server", "IconServer", [
    [
      "path",
      {
        d: "M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",
        key: "svg-0",
      },
    ],
    [
      "path",
      {
        d: "M3 12m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",
        key: "svg-1",
      },
    ],
    ["path", { d: "M7 8l0 .01", key: "svg-2" }],
    ["path", { d: "M7 16l0 .01", key: "svg-3" }],
  ]),
  vm = qf("settings", "IconSettings", [
    [
      "path",
      {
        d: "M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",
        key: "svg-0",
      },
    ],
    ["path", { d: "M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0", key: "svg-1" }],
  ]),
  bm = qf("sun", "IconSun", [
    ["path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0", key: "svg-0" }],
    [
      "path",
      {
        d: "M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",
        key: "svg-1",
      },
    ],
  ]),
  ym = qf("template", "IconTemplate", [
    [
      "path",
      {
        d: "M4 4m0 1a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z",
        key: "svg-0",
      },
    ],
    [
      "path",
      {
        d: "M4 12m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",
        key: "svg-1",
      },
    ],
    ["path", { d: "M14 12l6 0", key: "svg-2" }],
    ["path", { d: "M14 16l6 0", key: "svg-3" }],
    ["path", { d: "M14 20l6 0", key: "svg-4" }],
  ]),
  xm = qf("ticket", "IconTicket", [
    ["path", { d: "M15 5l0 2", key: "svg-0" }],
    ["path", { d: "M15 11l0 2", key: "svg-1" }],
    ["path", { d: "M15 17l0 2", key: "svg-2" }],
    [
      "path",
      {
        d: "M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2",
        key: "svg-3",
      },
    ],
  ]),
  wm = qf("user-circle", "IconUserCircle", [
    ["path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", key: "svg-0" }],
    ["path", { d: "M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-1" }],
    ["path", { d: "M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855", key: "svg-2" }],
  ]),
  Cm = qf("user", "IconUser", [
    ["path", { d: "M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0", key: "svg-0" }],
    ["path", { d: "M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2", key: "svg-1" }],
  ]),
  Sm = qf("users", "IconUsers", [
    ["path", { d: "M9 7m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0", key: "svg-0" }],
    ["path", { d: "M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2", key: "svg-1" }],
    ["path", { d: "M16 3.13a4 4 0 0 1 0 7.75", key: "svg-2" }],
    ["path", { d: "M21 21v-2a4 4 0 0 0 -3 -3.85", key: "svg-3" }],
  ]),
  km = qf("x", "IconX", [
    ["path", { d: "M18 6l-12 12", key: "svg-0" }],
    ["path", { d: "M6 6l12 12", key: "svg-1" }],
  ]);
const Em = jp(
    "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
    {
      variants: {
        variant: {
          default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
          destructive:
            "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
          outline:
            "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
          secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
          ghost: "hover:bg-accent hover:text-accent-foreground",
          link: "text-primary underline-offset-4 hover:underline",
        },
        size: {
          default: "h-9 px-4 py-2",
          sm: "h-8 rounded-md px-3 text-xs",
          lg: "h-10 rounded-md px-8",
          icon: "h-9 w-9",
        },
      },
      defaultVariants: { variant: "default", size: "default" },
    },
  ),
  Nm = H.forwardRef(
    (
      {
        className: e,
        variant: t,
        size: n,
        asChild: i = !1,
        children: r,
        disabled: o,
        loading: s = !1,
        leftSection: a,
        rightSection: l,
        ...c
      },
      d,
    ) => {
      const u = i ? Dp : "button";
      return Q.jsxs(u, {
        className: Rf(Em({ variant: t, size: n, className: e })),
        disabled: s || o,
        ref: d,
        ...c,
        children: [
          ((a && s) || (!a && !l && s)) && Q.jsx(cm, { className: "mr-2 h-4 w-4 animate-spin" }),
          !s && a && Q.jsx("div", { className: "mr-2", children: a }),
          r,
          !s && l && Q.jsx("div", { className: "ml-2", children: l }),
          l && s && Q.jsx(cm, { className: "ml-2 h-4 w-4 animate-spin" }),
        ],
      });
    },
  );
function Lm({ className: e, minimal: t = !1 }) {
  const n = og(),
    i = mg(),
    r = i?.message || i?.statusText || "Unknown error occurred";
  return Q.jsx("div", {
    className: Rf("h-svh w-full", e),
    children: Q.jsxs("div", {
      className: "m-auto flex h-full w-full flex-col items-center justify-center gap-2",
      children: [
        !t && Q.jsx("h1", { className: "text-[7rem] font-bold leading-tight", children: "500" }),
        Q.jsxs("span", {
          className: "font-medium",
          children: ["Oops! Something went wrong ", ":')"],
        }),
        Q.jsxs("p", {
          className: "text-center text-muted-foreground",
          children: ["We apologize for the inconvenience. ", Q.jsx("br", {}), r],
        }),
        !t &&
          Q.jsxs("div", {
            className: "mt-6 flex gap-4",
            children: [
              Q.jsx(Nm, { variant: "outline", onClick: () => n(-1), children: "Go Back" }),
              Q.jsx(Nm, { onClick: () => n("/"), children: "Back to Home" }),
            ],
          }),
      ],
    }),
  });
}
function Dm() {
  const e = og();
  return Q.jsx("div", {
    className: "h-svh",
    children: Q.jsxs("div", {
      className: "m-auto flex h-full w-full flex-col items-center justify-center gap-2",
      children: [
        Q.jsx("h1", { className: "text-[7rem] font-bold leading-tight", children: "404" }),
        Q.jsx("span", { className: "font-medium", children: "Oops! Page Not Found!" }),
        Q.jsxs("p", {
          className: "text-center text-muted-foreground",
          children: [
            "It seems like the page you're looking for ",
            Q.jsx("br", {}),
            "does not exist or might have been removed.",
          ],
        }),
        Q.jsxs("div", {
          className: "mt-6 flex gap-4",
          children: [
            Q.jsx(Nm, { variant: "outline", onClick: () => e(-1), children: "Go Back" }),
            Q.jsx(Nm, { onClick: () => e("/"), children: "Back to Home" }),
          ],
        }),
      ],
    }),
  });
}
Nm.displayName = "Button";
class Tm {
  storage;
  prefixKey;
  constructor(e) {
    ((this.storage = e.storage), (this.prefixKey = e.prefixKey));
  }
  getKey(e) {
    return `${this.prefixKey}${e}`.toUpperCase();
  }
  set(e, t, n = null) {
    const i = JSON.stringify({
      value: t,
      time: Date.now(),
      expire: null !== n ? new Date().getTime() + 1e3 * n : null,
    });
    this.storage.setItem(this.getKey(e), i);
  }
  get(e, t = null) {
    const n = this.storage.getItem(this.getKey(e));
    if (!n) return { value: t, time: 0 };
    try {
      const i = JSON.parse(n),
        { value: r, time: o, expire: s } = i;
      return (function (e) {
        return (
          (function (e) {
            return null === e;
          })(e) ||
          (function (e) {
            return void 0 === e;
          })(e)
        );
      })(s) || s > new Date().getTime()
        ? { value: r, time: o }
        : (this.remove(e), { value: t, time: 0 });
    } catch {
      return (this.remove(e), { value: t, time: 0 });
    }
  }
  remove(e) {
    this.storage.removeItem(this.getKey(e));
  }
  clear() {
    this.storage.clear();
  }
}
function Im({ prefixKey: e = "", storage: t = sessionStorage }) {
  return new Tm({ prefixKey: e, storage: t });
}
const Rm = "Xboard_",
  Om = (function (e = {}) {
    return Im({ prefixKey: e.prefixKey || "", storage: localStorage });
  })({ prefixKey: Rm });
!(function (e = {}) {
  Im({ prefixKey: e.prefixKey || "", storage: sessionStorage });
})({ prefixKey: Rm });
const Mm = "access_token";
function Am() {
  return Om.get(Mm);
}
function Pm() {
  Om.remove(Mm);
}
const jm = ["/sign-in", "/sign-in-2", "/sign-up", "/forgot-password", "/otp"];
function Fm({ children: e }) {
  const t = og(),
    n = ig(),
    i = Am();
  return (
    H.useEffect(() => {
      if (!i.value && !jm.includes(n.pathname)) {
        const e = encodeURIComponent(n.pathname + n.search);
        t(`/sign-in?redirect=${e}`);
      }
    }, [i.value, n.pathname, n.search, t]),
    jm.includes(n.pathname) || i.value ? Q.jsx(Q.Fragment, { children: e }) : null
  );
}
var Bm = [
    "a",
    "button",
    "div",
    "form",
    "h2",
    "h3",
    "img",
    "input",
    "label",
    "li",
    "nav",
    "ol",
    "p",
    "select",
    "span",
    "svg",
    "ul",
  ].reduce((e, t) => {
    const n = Lp(`Primitive.${t}`),
      i = H.forwardRef((e, i) => {
        const { asChild: r, ...o } = e,
          s = r ? n : t;
        return (
          "undefined" != typeof window && (window[Symbol.for("radix-ui")] = !0),
          Q.jsx(s, { ...o, ref: i })
        );
      });
    return ((i.displayName = `Primitive.${t}`), { ...e, [t]: i });
  }, {}),
  Vm = "horizontal",
  Wm = ["horizontal", "vertical"],
  Hm = H.forwardRef((e, t) => {
    const { decorative: n, orientation: i = Vm, ...r } = e,
      o = (function (e) {
        return Wm.includes(e);
      })(i)
        ? i
        : Vm,
      s = n
        ? { role: "none" }
        : { "aria-orientation": "vertical" === o ? o : void 0, role: "separator" };
    return Q.jsx(Bm.div, { "data-orientation": o, ...s, ...r, ref: t });
  });
Hm.displayName = "Separator";
var zm = Hm;
const Um = H.forwardRef(
  ({ className: e, orientation: t = "horizontal", decorative: n = !0, ...i }, r) =>
    Q.jsx(zm, {
      ref: r,
      decorative: n,
      orientation: t,
      className: Rf(
        "shrink-0 bg-border",
        "horizontal" === t ? "h-[1px] w-full" : "h-full w-[1px]",
        e,
      ),
      ...i,
    }),
);
Um.displayName = zm.displayName;
var $m = (e) => "checkbox" === e.type,
  qm = (e) => e instanceof Date,
  Km = (e) => null == e;
const Gm = (e) => "object" == typeof e;
var Zm = (e) => !Km(e) && !Array.isArray(e) && Gm(e) && !qm(e),
  Ym = (e) => (Zm(e) && e.target ? ($m(e.target) ? e.target.checked : e.target.value) : e),
  Xm = (e, t) => e.has(((e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e)(t)),
  Qm =
    "undefined" != typeof window && void 0 !== window.HTMLElement && "undefined" != typeof document;
function Jm(e) {
  let t;
  const n = Array.isArray(e),
    i = "undefined" != typeof FileList && e instanceof FileList;
  if (e instanceof Date) t = new Date(e);
  else {
    if ((Qm && (e instanceof Blob || i)) || (!n && !Zm(e))) return e;
    if (
      ((t = n ? [] : Object.create(Object.getPrototypeOf(e))),
      n ||
        ((e) => {
          const t = e.constructor && e.constructor.prototype;
          return Zm(t) && t.hasOwnProperty("isPrototypeOf");
        })(e))
    )
      for (const n in e) e.hasOwnProperty(n) && (t[n] = Jm(e[n]));
    else t = e;
  }
  return t;
}
var e_ = (e) => /^\w*$/.test(e),
  t_ = (e) => void 0 === e,
  n_ = (e) => (Array.isArray(e) ? e.filter(Boolean) : []),
  i_ = (e) => n_(e.replace(/["|']|\]/g, "").split(/\.|\[/)),
  r_ = (e, t, n) => {
    if (!t || !Zm(e)) return n;
    const i = (e_(t) ? [t] : i_(t)).reduce((e, t) => (Km(e) ? e : e[t]), e);
    return t_(i) || i === e ? (t_(e[t]) ? n : e[t]) : i;
  },
  o_ = (e) => "boolean" == typeof e,
  s_ = (e, t, n) => {
    let i = -1;
    const r = e_(t) ? [t] : i_(t),
      o = r.length,
      s = o - 1;
    for (; ++i < o; ) {
      const t = r[i];
      let o = n;
      if (i !== s) {
        const n = e[t];
        o = Zm(n) || Array.isArray(n) ? n : isNaN(+r[i + 1]) ? {} : [];
      }
      if ("__proto__" === t || "constructor" === t || "prototype" === t) return;
      ((e[t] = o), (e = e[t]));
    }
  };
const a_ = "blur",
  l_ = "focusout",
  c_ = "change",
  d_ = "onBlur",
  u_ = "onChange",
  h_ = "onSubmit",
  g_ = "onTouched",
  p_ = "all",
  f_ = "max",
  m_ = "min",
  __ = "maxLength",
  v_ = "minLength",
  b_ = "pattern",
  y_ = "required",
  x_ = "validate",
  w_ = z.createContext(null);
w_.displayName = "HookFormContext";
const C_ = () => z.useContext(w_);
var S_ = (e, t, n, i = !0) => {
  const r = { defaultValues: t._defaultValues };
  for (const o in e)
    Object.defineProperty(r, o, {
      get: () => {
        const r = o;
        return (
          t._proxyFormState[r] !== p_ && (t._proxyFormState[r] = !i || p_),
          n && (n[r] = !0),
          e[r]
        );
      },
    });
  return r;
};
const k_ = "undefined" != typeof window ? z.useLayoutEffect : z.useEffect;
var E_ = (e) => "string" == typeof e,
  N_ = (e, t, n, i, r) =>
    E_(e)
      ? (i && t.watch.add(e), r_(n, e, r))
      : Array.isArray(e)
        ? e.map((e) => (i && t.watch.add(e), r_(n, e)))
        : (i && (t.watchAll = !0), n),
  L_ = (e) => Km(e) || !Gm(e);
function D_(e, t, n = new WeakSet()) {
  if (L_(e) || L_(t)) return Object.is(e, t);
  if (qm(e) && qm(t)) return e.getTime() === t.getTime();
  const i = Object.keys(e),
    r = Object.keys(t);
  if (i.length !== r.length) return !1;
  if (n.has(e) || n.has(t)) return !0;
  (n.add(e), n.add(t));
  for (const o of i) {
    const i = e[o];
    if (!r.includes(o)) return !1;
    if ("ref" !== o) {
      const e = t[o];
      if (
        (qm(i) && qm(e)) || (Zm(i) && Zm(e)) || (Array.isArray(i) && Array.isArray(e))
          ? !D_(i, e, n)
          : !Object.is(i, e)
      )
        return !1;
    }
  }
  return !0;
}
function T_(e) {
  const t = C_(),
    {
      control: n = t.control,
      name: i,
      defaultValue: r,
      disabled: o,
      exact: s,
      compute: a,
    } = e || {},
    l = z.useRef(r),
    c = z.useRef(a),
    d = z.useRef(void 0),
    u = z.useRef(n),
    h = z.useRef(i);
  c.current = a;
  const [g, p] = z.useState(() => {
      const e = n._getWatch(i, l.current);
      return c.current ? c.current(e) : e;
    }),
    f = z.useCallback(
      (e) => {
        const t = N_(i, n._names, e || n._formValues, !1, l.current);
        return c.current ? c.current(t) : t;
      },
      [n._formValues, n._names, i],
    ),
    m = z.useCallback(
      (e) => {
        if (!o) {
          const t = N_(i, n._names, e || n._formValues, !1, l.current);
          if (c.current) {
            const e = c.current(t);
            D_(e, d.current) || (p(e), (d.current = e));
          } else p(t);
        }
      },
      [n._formValues, n._names, o, i],
    );
  (k_(
    () => (
      (u.current === n && D_(h.current, i)) || ((u.current = n), (h.current = i), m()),
      n._subscribe({
        name: i,
        formState: { values: !0 },
        exact: s,
        callback: (e) => {
          m(e.values);
        },
      })
    ),
    [n, s, i, m],
  ),
    z.useEffect(() => n._removeUnmounted()));
  const _ = u.current !== n,
    v = h.current,
    b = z.useMemo(() => {
      if (o) return null;
      const e = !_ && !D_(v, i);
      return _ || e ? f() : null;
    }, [o, _, i, v, f]);
  return null !== b ? b : g;
}
function I_(e) {
  const t = C_(),
    {
      name: n,
      disabled: i,
      control: r = t.control,
      shouldUnregister: o,
      defaultValue: s,
      exact: a = !0,
    } = e,
    l = Xm(r._names.array, n),
    c = z.useMemo(() => r_(r._formValues, n, r_(r._defaultValues, n, s)), [r, n, s]),
    d = T_({ control: r, name: n, defaultValue: c, exact: a }),
    u = (function (e) {
      const t = C_(),
        { control: n = t.control, disabled: i, name: r, exact: o } = e || {},
        [s, a] = z.useState(n._formState),
        l = z.useRef({
          isDirty: !1,
          isLoading: !1,
          dirtyFields: !1,
          touchedFields: !1,
          validatingFields: !1,
          isValidating: !1,
          isValid: !1,
          errors: !1,
        });
      return (
        k_(
          () =>
            n._subscribe({
              name: r,
              formState: l.current,
              exact: o,
              callback: (e) => {
                !i && a({ ...n._formState, ...e });
              },
            }),
          [r, i, o],
        ),
        z.useEffect(() => {
          l.current.isValid && n._setValid(!0);
        }, [n]),
        z.useMemo(() => S_(s, n, l.current, !1), [s, n])
      );
    })({ control: r, name: n, exact: a }),
    h = z.useRef(e),
    g = z.useRef(void 0),
    p = z.useRef(
      r.register(n, { ...e.rules, value: d, ...(o_(e.disabled) ? { disabled: e.disabled } : {}) }),
    );
  h.current = e;
  const f = z.useMemo(
      () =>
        Object.defineProperties(
          {},
          {
            invalid: { enumerable: !0, get: () => !!r_(u.errors, n) },
            isDirty: { enumerable: !0, get: () => !!r_(u.dirtyFields, n) },
            isTouched: { enumerable: !0, get: () => !!r_(u.touchedFields, n) },
            isValidating: { enumerable: !0, get: () => !!r_(u.validatingFields, n) },
            error: { enumerable: !0, get: () => r_(u.errors, n) },
          },
        ),
      [u, n],
    ),
    m = z.useCallback(
      (e) => p.current.onChange({ target: { value: Ym(e), name: n }, type: c_ }),
      [n],
    ),
    _ = z.useCallback(
      () => p.current.onBlur({ target: { value: r_(r._formValues, n), name: n }, type: a_ }),
      [n, r._formValues],
    ),
    v = z.useCallback(
      (e) => {
        const t = r_(r._fields, n);
        t &&
          e &&
          (t._f.ref = {
            focus: () => e.focus && e.focus(),
            select: () => e.select && e.select(),
            setCustomValidity: (t) => e.setCustomValidity(t),
            reportValidity: () => e.reportValidity(),
          });
      },
      [r._fields, n],
    ),
    b = z.useMemo(
      () => ({
        name: n,
        value: d,
        ...(o_(i) || u.disabled ? { disabled: u.disabled || i } : {}),
        onChange: m,
        onBlur: _,
        ref: v,
      }),
      [n, i, u.disabled, m, _, v, d],
    );
  return (
    z.useEffect(() => {
      const e = r._options.shouldUnregister || o,
        t = g.current;
      (t && t !== n && !l && r.unregister(t),
        r.register(n, {
          ...h.current.rules,
          ...(o_(h.current.disabled) ? { disabled: h.current.disabled } : {}),
        }));
      const i = (e, t) => {
        const n = r_(r._fields, e);
        n && n._f && (n._f.mount = t);
      };
      if ((i(n, !0), e)) {
        const e = Jm(r_(r._options.defaultValues, n, h.current.defaultValue));
        (s_(r._defaultValues, n, e), t_(r_(r._formValues, n)) && s_(r._formValues, n, e));
      }
      return (
        !l && r.register(n),
        (g.current = n),
        () => {
          (l ? e && !r._state.action : e) ? r.unregister(n) : i(n, !1);
        }
      );
    }, [n, r, l, o]),
    z.useEffect(() => {
      r._setDisabledField({ disabled: i, name: n });
    }, [i, n, r]),
    z.useMemo(() => ({ field: b, formState: u, fieldState: f }), [b, u, f])
  );
}
const R_ = (e) => e.render(I_(e));
var O_ = (e, t, n, i, r) =>
    t ? { ...n[e], types: { ...(n[e] && n[e].types ? n[e].types : {}), [i]: r || !0 } } : {},
  M_ = (e) => (Array.isArray(e) ? e : [e]),
  A_ = () => {
    let e = [];
    return {
      get observers() {
        return e;
      },
      next: (t) => {
        for (const n of e) n.next && n.next(t);
      },
      subscribe: (t) => (
        e.push(t),
        {
          unsubscribe: () => {
            e = e.filter((e) => e !== t);
          },
        }
      ),
      unsubscribe: () => {
        e = [];
      },
    };
  };
function P_(e, t) {
  const n = {};
  for (const i in e)
    if (e.hasOwnProperty(i)) {
      const r = e[i],
        o = t[i];
      if (r && Zm(r) && o) {
        const e = P_(r, o);
        Zm(e) && (n[i] = e);
      } else e[i] && (n[i] = o);
    }
  return n;
}
var j_ = (e) => Zm(e) && !Object.keys(e).length,
  F_ = (e) => "file" === e.type,
  B_ = (e) => "function" == typeof e,
  V_ = (e) => {
    if (!Qm) return !1;
    const t = e ? e.ownerDocument : 0;
    return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
  },
  W_ = (e) => "select-multiple" === e.type,
  H_ = (e) => "radio" === e.type,
  z_ = (e) => V_(e) && e.isConnected;
function U_(e, t) {
  const n = Array.isArray(t) ? t : e_(t) ? [t] : i_(t),
    i =
      1 === n.length
        ? e
        : (function (e, t) {
            const n = t.slice(0, -1).length;
            let i = 0;
            for (; i < n; ) e = t_(e) ? i++ : e[t[i++]];
            return e;
          })(e, n),
    r = n.length - 1,
    o = n[r];
  return (
    i && delete i[o],
    0 !== r &&
      ((Zm(i) && j_(i)) ||
        (Array.isArray(i) &&
          (function (e) {
            for (const t in e) if (e.hasOwnProperty(t) && !t_(e[t])) return !1;
            return !0;
          })(i))) &&
      U_(e, n.slice(0, -1)),
    e
  );
}
function $_(e) {
  return (
    Array.isArray(e) ||
    (Zm(e) &&
      !((e) => {
        for (const t in e) if (B_(e[t])) return !0;
        return !1;
      })(e))
  );
}
function q_(e, t = {}) {
  for (const n in e) {
    const i = e[n];
    $_(i) ? ((t[n] = Array.isArray(i) ? [] : {}), q_(i, t[n])) : t_(i) || (t[n] = !0);
  }
  return t;
}
function K_(e, t, n) {
  n || (n = q_(t));
  for (const i in e) {
    const r = e[i];
    if ($_(r))
      t_(t) || L_(n[i])
        ? (n[i] = q_(r, Array.isArray(r) ? [] : {}))
        : K_(r, Km(t) ? {} : t[i], n[i]);
    else {
      const e = t[i];
      n[i] = !D_(r, e);
    }
  }
  return n;
}
const G_ = { value: !1, isValid: !1 },
  Z_ = { value: !0, isValid: !0 };
var Y_ = (e) => {
    if (Array.isArray(e)) {
      if (e.length > 1) {
        const t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
        return { value: t, isValid: !!t.length };
      }
      return e[0].checked && !e[0].disabled
        ? e[0].attributes && !t_(e[0].attributes.value)
          ? t_(e[0].value) || "" === e[0].value
            ? Z_
            : { value: e[0].value, isValid: !0 }
          : Z_
        : G_;
    }
    return G_;
  },
  X_ = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: i }) =>
    t_(e) ? e : t ? ("" === e ? NaN : e ? +e : e) : n && E_(e) ? new Date(e) : i ? i(e) : e;
const Q_ = { isValid: !1, value: null };
var J_ = (e) =>
  Array.isArray(e)
    ? e.reduce((e, t) => (t && t.checked && !t.disabled ? { isValid: !0, value: t.value } : e), Q_)
    : Q_;
function ev(e) {
  const t = e.ref;
  return F_(t)
    ? t.files
    : H_(t)
      ? J_(e.refs).value
      : W_(t)
        ? [...t.selectedOptions].map(({ value: e }) => e)
        : $m(t)
          ? Y_(e.refs).value
          : X_(t_(t.value) ? e.ref.value : t.value, e);
}
var tv = (e) => e instanceof RegExp,
  nv = (e) => (t_(e) ? e : tv(e) ? e.source : Zm(e) ? (tv(e.value) ? e.value.source : e.value) : e),
  iv = (e) => ({
    isOnSubmit: !e || e === h_,
    isOnBlur: e === d_,
    isOnChange: e === u_,
    isOnAll: e === p_,
    isOnTouch: e === g_,
  });
const rv = "AsyncFunction";
var ov = (e) =>
    !!e &&
    !!e.validate &&
    !!(
      (B_(e.validate) && e.validate.constructor.name === rv) ||
      (Zm(e.validate) && Object.values(e.validate).find((e) => e.constructor.name === rv))
    ),
  sv = (e, t, n) =>
    !n &&
    (t.watchAll ||
      t.watch.has(e) ||
      [...t.watch].some((t) => e.startsWith(t) && /^\.\w+/.test(e.slice(t.length))));
const av = (e, t, n, i) => {
  for (const r of n || Object.keys(e)) {
    const n = r_(e, r);
    if (n) {
      const { _f: e, ...o } = n;
      if (e) {
        if (e.refs && e.refs[0] && t(e.refs[0], r) && !i) return !0;
        if (e.ref && t(e.ref, e.name) && !i) return !0;
        if (av(o, t)) break;
      } else if (Zm(o) && av(o, t)) break;
    }
  }
};
function lv(e, t, n) {
  const i = r_(e, n);
  if (i || e_(n)) return { error: i, name: n };
  const r = n.split(".");
  for (; r.length; ) {
    const i = r.join("."),
      o = r_(t, i),
      s = r_(e, i);
    if (o && !Array.isArray(o) && n !== i) return { name: n };
    if (s && s.type) return { name: i, error: s };
    if (s && s.root && s.root.type) return { name: `${i}.root`, error: s.root };
    r.pop();
  }
  return { name: n };
}
var cv = (e, t, n) => {
  const i = M_(r_(e, n));
  return (s_(i, "root", t[n]), s_(e, n, i), e);
};
function dv(e, t, n = "validate") {
  if (E_(e) || (Array.isArray(e) && e.every(E_)) || (o_(e) && !e))
    return { type: n, message: E_(e) ? e : "", ref: t };
}
var uv = (e) => (Zm(e) && !tv(e) ? e : { value: e, message: "" }),
  hv = async (e, t, n, i, r, o) => {
    const {
        ref: s,
        refs: a,
        required: l,
        maxLength: c,
        minLength: d,
        min: u,
        max: h,
        pattern: g,
        validate: p,
        name: f,
        valueAsNumber: m,
        mount: _,
      } = e._f,
      v = r_(n, f);
    if (!_ || t.has(f)) return {};
    const b = a ? a[0] : s,
      y = (e) => {
        r && b.reportValidity && (b.setCustomValidity(o_(e) ? "" : e || ""), b.reportValidity());
      },
      x = {},
      w = H_(s),
      C = $m(s),
      S = w || C,
      k =
        ((m || F_(s)) && t_(s.value) && t_(v)) ||
        (V_(s) && "" === s.value) ||
        "" === v ||
        (Array.isArray(v) && !v.length),
      E = O_.bind(null, f, i, x),
      N = (e, t, n, i = __, r = v_) => {
        const o = e ? t : n;
        x[f] = { type: e ? i : r, message: o, ref: s, ...E(e ? i : r, o) };
      };
    if (
      o
        ? !Array.isArray(v) || !v.length
        : l &&
          ((!S && (k || Km(v))) || (o_(v) && !v) || (C && !Y_(a).isValid) || (w && !J_(a).isValid))
    ) {
      const { value: e, message: t } = E_(l) ? { value: !!l, message: l } : uv(l);
      if (e && ((x[f] = { type: y_, message: t, ref: b, ...E(y_, t) }), !i)) return (y(t), x);
    }
    if (!(k || (Km(u) && Km(h)))) {
      let e, t;
      const n = uv(h),
        r = uv(u);
      if (Km(v) || isNaN(v)) {
        const i = s.valueAsDate || new Date(v),
          o = (e) => new Date(new Date().toDateString() + " " + e),
          a = "time" == s.type,
          l = "week" == s.type;
        (E_(n.value) && v && (e = a ? o(v) > o(n.value) : l ? v > n.value : i > new Date(n.value)),
          E_(r.value) &&
            v &&
            (t = a ? o(v) < o(r.value) : l ? v < r.value : i < new Date(r.value)));
      } else {
        const i = s.valueAsNumber || (v ? +v : v);
        (Km(n.value) || (e = i > n.value), Km(r.value) || (t = i < r.value));
      }
      if ((e || t) && (N(!!e, n.message, r.message, f_, m_), !i)) return (y(x[f].message), x);
    }
    if ((c || d) && !k && (E_(v) || (o && Array.isArray(v)))) {
      const e = uv(c),
        t = uv(d),
        n = !Km(e.value) && v.length > +e.value,
        r = !Km(t.value) && v.length < +t.value;
      if ((n || r) && (N(n, e.message, t.message), !i)) return (y(x[f].message), x);
    }
    if (g && !k && E_(v)) {
      const { value: e, message: t } = uv(g);
      if (tv(e) && !v.match(e) && ((x[f] = { type: b_, message: t, ref: s, ...E(b_, t) }), !i))
        return (y(t), x);
    }
    if (p)
      if (B_(p)) {
        const e = dv(await p(v, n), b);
        if (e && ((x[f] = { ...e, ...E(x_, e.message) }), !i)) return (y(e.message), x);
      } else if (Zm(p)) {
        let e = {};
        for (const t in p) {
          if (!j_(e) && !i) break;
          const r = dv(await p[t](v, n), b, t);
          r && ((e = { ...r, ...E(t, r.message) }), y(r.message), i && (x[f] = e));
        }
        if (!j_(e) && ((x[f] = { ref: b, ...e }), !i)) return x;
      }
    return (y(!0), x);
  };
const gv = { mode: h_, reValidateMode: u_, shouldFocusError: !0 };
function pv(e = {}) {
  let t,
    n = { ...gv, ...e },
    i = {
      submitCount: 0,
      isDirty: !1,
      isReady: !1,
      isLoading: B_(n.defaultValues),
      isValidating: !1,
      isSubmitted: !1,
      isSubmitting: !1,
      isSubmitSuccessful: !1,
      isValid: !1,
      touchedFields: {},
      dirtyFields: {},
      validatingFields: {},
      errors: n.errors || {},
      disabled: n.disabled || !1,
    },
    r = {},
    o = ((Zm(n.defaultValues) || Zm(n.values)) && Jm(n.defaultValues || n.values)) || {},
    s = n.shouldUnregister ? {} : Jm(o),
    a = { action: !1, mount: !1, watch: !1 },
    l = {
      mount: new Set(),
      disabled: new Set(),
      unMount: new Set(),
      array: new Set(),
      watch: new Set(),
    },
    c = 0;
  const d = {
    isDirty: !1,
    dirtyFields: !1,
    validatingFields: !1,
    touchedFields: !1,
    isValidating: !1,
    isValid: !1,
    errors: !1,
  };
  let u = { ...d };
  const h = { array: A_(), state: A_() },
    g = n.criteriaMode === p_,
    p = async (e) => {
      if (!n.disabled && (d.isValid || u.isValid || e)) {
        const e = n.resolver ? j_((await b()).errors) : await y(r, !0);
        e !== i.isValid && h.state.next({ isValid: e });
      }
    },
    f = (e, t) => {
      !n.disabled &&
        (d.isValidating || d.validatingFields || u.isValidating || u.validatingFields) &&
        ((e || Array.from(l.mount)).forEach((e) => {
          e && (t ? s_(i.validatingFields, e, t) : U_(i.validatingFields, e));
        }),
        h.state.next({
          validatingFields: i.validatingFields,
          isValidating: !j_(i.validatingFields),
        }));
    },
    m = (e, t, n, i) => {
      const l = r_(r, e);
      if (l) {
        const r = r_(s, e, t_(n) ? r_(o, e) : n);
        (t_(r) || (i && i.defaultChecked) || t ? s_(s, e, t ? r : ev(l._f)) : C(e, r),
          a.mount && !a.action && p());
      }
    },
    _ = (e, t, r, s, a) => {
      let l = !1,
        c = !1;
      const g = { name: e };
      if (!n.disabled) {
        if (!r || s) {
          (d.isDirty || u.isDirty) &&
            ((c = i.isDirty), (i.isDirty = g.isDirty = x()), (l = c !== g.isDirty));
          const n = D_(r_(o, e), t);
          ((c = !!r_(i.dirtyFields, e)),
            n ? U_(i.dirtyFields, e) : s_(i.dirtyFields, e, !0),
            (g.dirtyFields = i.dirtyFields),
            (l = l || ((d.dirtyFields || u.dirtyFields) && c !== !n)));
        }
        if (r) {
          const t = r_(i.touchedFields, e);
          t ||
            (s_(i.touchedFields, e, r),
            (g.touchedFields = i.touchedFields),
            (l = l || ((d.touchedFields || u.touchedFields) && t !== r)));
        }
        l && a && h.state.next(g);
      }
      return l ? g : {};
    },
    v = (e, r, o, s) => {
      const a = r_(i.errors, e),
        l = (d.isValid || u.isValid) && o_(r) && i.isValid !== r;
      var g;
      if (
        (n.delayError && o
          ? ((g = () =>
              ((e, t) => {
                (s_(i.errors, e, t), h.state.next({ errors: i.errors }));
              })(e, o)),
            (t = (e) => {
              (clearTimeout(c), (c = setTimeout(g, e)));
            }),
            t(n.delayError))
          : (clearTimeout(c), (t = null), o ? s_(i.errors, e, o) : U_(i.errors, e)),
        (o ? !D_(a, o) : a) || !j_(s) || l)
      ) {
        const t = { ...s, ...(l && o_(r) ? { isValid: r } : {}), errors: i.errors, name: e };
        ((i = { ...i, ...t }), h.state.next(t));
      }
    },
    b = async (e) => {
      f(e, !0);
      const t = await n.resolver(
        s,
        n.context,
        ((e, t, n, i) => {
          const r = {};
          for (const o of e) {
            const e = r_(t, o);
            e && s_(r, o, e._f);
          }
          return { criteriaMode: n, names: [...e], fields: r, shouldUseNativeValidation: i };
        })(e || l.mount, r, n.criteriaMode, n.shouldUseNativeValidation),
      );
      return (f(e), t);
    },
    y = async (e, t, r = { valid: !0 }) => {
      for (const o in e) {
        const a = e[o];
        if (a) {
          const { _f: e, ...o } = a;
          if (e) {
            const o = l.array.has(e.name),
              c = a._f && ov(a._f);
            c && d.validatingFields && f([e.name], !0);
            const u = await hv(a, l.disabled, s, g, n.shouldUseNativeValidation && !t, o);
            if ((c && d.validatingFields && f([e.name]), u[e.name] && ((r.valid = !1), t))) break;
            !t &&
              (r_(u, e.name)
                ? o
                  ? cv(i.errors, u, e.name)
                  : s_(i.errors, e.name, u[e.name])
                : U_(i.errors, e.name));
          }
          !j_(o) && (await y(o, t, r));
        }
      }
      return r.valid;
    },
    x = (e, t) => !n.disabled && (e && t && s_(s, e, t), !D_(D(), o)),
    w = (e, t, n) => N_(e, l, { ...(a.mount ? s : t_(t) ? o : E_(e) ? { [e]: t } : t) }, n, t),
    C = (e, t, n = {}) => {
      const i = r_(r, e);
      let o = t;
      if (i) {
        const n = i._f;
        n &&
          (!n.disabled && s_(s, e, X_(t, n)),
          (o = V_(n.ref) && Km(t) ? "" : t),
          W_(n.ref)
            ? [...n.ref.options].forEach((e) => (e.selected = o.includes(e.value)))
            : n.refs
              ? $m(n.ref)
                ? n.refs.forEach((e) => {
                    (e.defaultChecked && e.disabled) ||
                      (Array.isArray(o)
                        ? (e.checked = !!o.find((t) => t === e.value))
                        : (e.checked = o === e.value || !!o));
                  })
                : n.refs.forEach((e) => (e.checked = e.value === o))
              : F_(n.ref)
                ? (n.ref.value = "")
                : ((n.ref.value = o), n.ref.type || h.state.next({ name: e, values: Jm(s) })));
      }
      ((n.shouldDirty || n.shouldTouch) && _(e, o, n.shouldTouch, n.shouldDirty, !0),
        n.shouldValidate && L(e));
    },
    S = (e, t, n) => {
      for (const i in t) {
        if (!t.hasOwnProperty(i)) return;
        const o = t[i],
          s = e + "." + i,
          a = r_(r, s);
        (l.array.has(e) || Zm(o) || (a && !a._f)) && !qm(o) ? S(s, o, n) : C(s, o, n);
      }
    },
    k = (e, t, n = {}) => {
      const c = r_(r, e),
        g = l.array.has(e),
        p = Jm(t);
      (s_(s, e, p),
        g
          ? (h.array.next({ name: e, values: Jm(s) }),
            (d.isDirty || d.dirtyFields || u.isDirty || u.dirtyFields) &&
              n.shouldDirty &&
              h.state.next({ name: e, dirtyFields: K_(o, s), isDirty: x(e, p) }))
          : !c || c._f || Km(p)
            ? C(e, p, n)
            : S(e, p, n),
        sv(e, l) && h.state.next({ ...i, name: e }),
        h.state.next({ name: a.mount ? e : void 0, values: Jm(s) }));
    },
    E = async (e) => {
      a.mount = !0;
      const o = e.target;
      let c = o.name,
        m = !0;
      const x = r_(r, c),
        w = (e) => {
          m = Number.isNaN(e) || (qm(e) && isNaN(e.getTime())) || D_(e, r_(s, c, e));
        },
        C = iv(n.mode),
        S = iv(n.reValidateMode);
      if (x) {
        let a, k;
        const E = o.type ? ev(x._f) : Ym(e),
          N = e.type === a_ || e.type === l_,
          D =
            (!((e) =>
              e.mount &&
              (e.required ||
                e.min ||
                e.max ||
                e.maxLength ||
                e.minLength ||
                e.pattern ||
                e.validate))(x._f) &&
              !n.resolver &&
              !r_(i.errors, c) &&
              !x._f.deps) ||
            ((e, t, n, i, r) =>
              !r.isOnAll &&
              (!n && r.isOnTouch
                ? !(t || e)
                : (n ? i.isOnBlur : r.isOnBlur)
                  ? !e
                  : !(n ? i.isOnChange : r.isOnChange) || e))(
              N,
              r_(i.touchedFields, c),
              i.isSubmitted,
              S,
              C,
            ),
          T = sv(c, l, N);
        (s_(s, c, E),
          N
            ? (o && o.readOnly) || (x._f.onBlur && x._f.onBlur(e), t && t(0))
            : x._f.onChange && x._f.onChange(e));
        const I = _(c, E, N),
          R = !j_(I) || T;
        if ((!N && h.state.next({ name: c, type: e.type, values: Jm(s) }), D))
          return (
            (d.isValid || u.isValid) && ("onBlur" === n.mode ? N && p() : N || p()),
            R && h.state.next({ name: c, ...(T ? {} : I) })
          );
        if ((!N && T && h.state.next({ ...i }), n.resolver)) {
          const { errors: e } = await b([c]);
          if ((w(E), m)) {
            const t = lv(i.errors, r, c),
              n = lv(e, r, t.name || c);
            ((a = n.error), (c = n.name), (k = j_(e)));
          }
        } else
          (f([c], !0),
            (a = (await hv(x, l.disabled, s, g, n.shouldUseNativeValidation))[c]),
            f([c]),
            w(E),
            m && (a ? (k = !1) : (d.isValid || u.isValid) && (k = await y(r, !0))));
        m &&
          (x._f.deps && (!Array.isArray(x._f.deps) || x._f.deps.length > 0) && L(x._f.deps),
          v(c, k, a, I));
      }
    },
    N = (e, t) => {
      if (r_(i.errors, t) && e.focus) return (e.focus(), 1);
    },
    L = async (e, t = {}) => {
      let o, s;
      const a = M_(e);
      if (n.resolver) {
        const t = await (async (e) => {
          const { errors: t } = await b(e);
          if (e)
            for (const n of e) {
              const e = r_(t, n);
              e ? s_(i.errors, n, e) : U_(i.errors, n);
            }
          else i.errors = t;
          return t;
        })(t_(e) ? e : a);
        ((o = j_(t)), (s = e ? !a.some((e) => r_(t, e)) : o));
      } else
        e
          ? ((s = (
              await Promise.all(
                a.map(async (e) => {
                  const t = r_(r, e);
                  return await y(t && t._f ? { [e]: t } : t);
                }),
              )
            ).every(Boolean)),
            (s || i.isValid) && p())
          : (s = o = await y(r));
      return (
        h.state.next({
          ...(!E_(e) || ((d.isValid || u.isValid) && o !== i.isValid) ? {} : { name: e }),
          ...(n.resolver || !e ? { isValid: o } : {}),
          errors: i.errors,
        }),
        t.shouldFocus && !s && av(r, N, e ? a : l.mount),
        s
      );
    },
    D = (e, t) => {
      let n = { ...(a.mount ? s : o) };
      return (
        t && (n = P_(t.dirtyFields ? i.dirtyFields : i.touchedFields, n)),
        t_(e) ? n : E_(e) ? r_(n, e) : e.map((e) => r_(n, e))
      );
    },
    T = (e, t) => ({
      invalid: !!r_((t || i).errors, e),
      isDirty: !!r_((t || i).dirtyFields, e),
      error: r_((t || i).errors, e),
      isValidating: !!r_(i.validatingFields, e),
      isTouched: !!r_((t || i).touchedFields, e),
    }),
    I = (e, t, n) => {
      const o = (r_(r, e, { _f: {} })._f || {}).ref,
        s = r_(i.errors, e) || {},
        { ref: a, message: l, type: c, ...d } = s;
      (s_(i.errors, e, { ...d, ...t, ref: o }),
        h.state.next({ name: e, errors: i.errors, isValid: !1 }),
        n && n.shouldFocus && o && o.focus && o.focus());
    },
    R = (e) =>
      h.state.subscribe({
        next: (t) => {
          var n, r, a;
          ((n = e.name),
            (r = t.name),
            (a = e.exact),
            (n &&
              r &&
              n !== r &&
              !M_(n).some((e) => e && (a ? e === r : e.startsWith(r) || r.startsWith(e)))) ||
              !((e, t, n, i) => {
                n(e);
                const { name: r, ...o } = e;
                return (
                  j_(o) ||
                  Object.keys(o).length >= Object.keys(t).length ||
                  Object.keys(o).find((e) => t[e] === (!i || p_))
                );
              })(t, e.formState || d, V, e.reRenderRoot) ||
              e.callback({ values: { ...s }, ...i, ...t, defaultValues: o }));
        },
      }).unsubscribe,
    O = (e, t = {}) => {
      for (const a of e ? M_(e) : l.mount)
        (l.mount.delete(a),
          l.array.delete(a),
          t.keepValue || (U_(r, a), U_(s, a)),
          !t.keepError && U_(i.errors, a),
          !t.keepDirty && U_(i.dirtyFields, a),
          !t.keepTouched && U_(i.touchedFields, a),
          !t.keepIsValidating && U_(i.validatingFields, a),
          !n.shouldUnregister && !t.keepDefaultValue && U_(o, a));
      (h.state.next({ values: Jm(s) }),
        h.state.next({ ...i, ...(t.keepDirty ? { isDirty: x() } : {}) }),
        !t.keepIsValid && p());
    },
    M = ({ disabled: e, name: t }) => {
      ((o_(e) && a.mount) || e || l.disabled.has(t)) &&
        (e ? l.disabled.add(t) : l.disabled.delete(t));
    },
    A = (e, t = {}) => {
      let i = r_(r, e);
      const s = o_(t.disabled) || o_(n.disabled);
      return (
        s_(r, e, {
          ...(i || {}),
          _f: { ...(i && i._f ? i._f : { ref: { name: e } }), name: e, mount: !0, ...t },
        }),
        l.mount.add(e),
        i ? M({ disabled: o_(t.disabled) ? t.disabled : n.disabled, name: e }) : m(e, !0, t.value),
        {
          ...(s ? { disabled: t.disabled || n.disabled } : {}),
          ...(n.progressive
            ? {
                required: !!t.required,
                min: nv(t.min),
                max: nv(t.max),
                minLength: nv(t.minLength),
                maxLength: nv(t.maxLength),
                pattern: nv(t.pattern),
              }
            : {}),
          name: e,
          onChange: E,
          onBlur: E,
          ref: (s) => {
            if (s) {
              (A(e, t), (i = r_(r, e)));
              const n =
                  (t_(s.value) &&
                    s.querySelectorAll &&
                    s.querySelectorAll("input,select,textarea")[0]) ||
                  s,
                a = ((e) => H_(e) || $m(e))(n),
                l = i._f.refs || [];
              if (a ? l.find((e) => e === n) : n === i._f.ref) return;
              (s_(r, e, {
                _f: {
                  ...i._f,
                  ...(a
                    ? {
                        refs: [...l.filter(z_), n, ...(Array.isArray(r_(o, e)) ? [{}] : [])],
                        ref: { type: n.type, name: e },
                      }
                    : { ref: n }),
                },
              }),
                m(e, !1, void 0, n));
            } else
              ((i = r_(r, e, {})),
                i._f && (i._f.mount = !1),
                (n.shouldUnregister || t.shouldUnregister) &&
                  (!Xm(l.array, e) || !a.action) &&
                  l.unMount.add(e));
          },
        }
      );
    },
    P = () => n.shouldFocusError && av(r, N, l.mount),
    j = (e, t) => async (o) => {
      let a;
      o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
      let c = Jm(s);
      if ((h.state.next({ isSubmitting: !0 }), n.resolver)) {
        const { errors: e, values: t } = await b();
        ((i.errors = e), (c = Jm(t)));
      } else await y(r);
      if (l.disabled.size) for (const e of l.disabled) U_(c, e);
      if ((U_(i.errors, "root"), j_(i.errors))) {
        h.state.next({ errors: {} });
        try {
          await e(c, o);
        } catch (D2t) {
          a = D2t;
        }
      } else (t && (await t({ ...i.errors }, o)), P(), setTimeout(P));
      if (
        (h.state.next({
          isSubmitted: !0,
          isSubmitting: !1,
          isSubmitSuccessful: j_(i.errors) && !a,
          submitCount: i.submitCount + 1,
          errors: i.errors,
        }),
        a)
      )
        throw a;
    },
    F = (e, t = {}) => {
      const c = e ? Jm(e) : o,
        u = Jm(c),
        g = j_(e),
        p = g ? o : u;
      if ((t.keepDefaultValues || (o = c), !t.keepValues)) {
        if (t.keepDirtyValues) {
          const e = new Set([...l.mount, ...Object.keys(K_(o, s))]);
          for (const t of Array.from(e)) r_(i.dirtyFields, t) ? s_(p, t, r_(s, t)) : k(t, r_(p, t));
        } else {
          if (Qm && t_(e))
            for (const e of l.mount) {
              const t = r_(r, e);
              if (t && t._f) {
                const e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
                if (V_(e)) {
                  const t = e.closest("form");
                  if (t) {
                    t.reset();
                    break;
                  }
                }
              }
            }
          if (t.keepFieldsRef) for (const e of l.mount) k(e, r_(p, e));
          else r = {};
        }
        ((s = n.shouldUnregister ? (t.keepDefaultValues ? Jm(o) : {}) : Jm(p)),
          h.array.next({ values: { ...p } }),
          h.state.next({ values: { ...p } }));
      }
      ((l = {
        mount: t.keepDirtyValues ? l.mount : new Set(),
        unMount: new Set(),
        array: new Set(),
        disabled: new Set(),
        watch: new Set(),
        watchAll: !1,
        focus: "",
      }),
        (a.mount =
          !d.isValid || !!t.keepIsValid || !!t.keepDirtyValues || (!n.shouldUnregister && !j_(p))),
        (a.watch = !!n.shouldUnregister),
        (a.action = !1),
        t.keepErrors || (i.errors = {}),
        h.state.next({
          submitCount: t.keepSubmitCount ? i.submitCount : 0,
          isDirty: !g && (t.keepDirty ? i.isDirty : !(!t.keepDefaultValues || D_(e, o))),
          isSubmitted: !!t.keepIsSubmitted && i.isSubmitted,
          dirtyFields: g
            ? {}
            : t.keepDirtyValues
              ? t.keepDefaultValues && s
                ? K_(o, s)
                : i.dirtyFields
              : t.keepDefaultValues && e
                ? K_(o, e)
                : t.keepDirty
                  ? i.dirtyFields
                  : {},
          touchedFields: t.keepTouched ? i.touchedFields : {},
          errors: t.keepErrors ? i.errors : {},
          isSubmitSuccessful: !!t.keepIsSubmitSuccessful && i.isSubmitSuccessful,
          isSubmitting: !1,
          defaultValues: o,
        }));
    },
    B = (e, t) => F(B_(e) ? e(s) : e, t),
    V = (e) => {
      i = { ...i, ...e };
    },
    W = {
      control: {
        register: A,
        unregister: O,
        getFieldState: T,
        handleSubmit: j,
        setError: I,
        _subscribe: R,
        _runSchema: b,
        _focusError: P,
        _getWatch: w,
        _getDirty: x,
        _setValid: p,
        _setFieldArray: (e, t = [], l, c, g = !0, p = !0) => {
          if (c && l && !n.disabled) {
            if (((a.action = !0), p && Array.isArray(r_(r, e)))) {
              const t = l(r_(r, e), c.argA, c.argB);
              g && s_(r, e, t);
            }
            if (p && Array.isArray(r_(i.errors, e))) {
              const t = l(r_(i.errors, e), c.argA, c.argB);
              (g && s_(i.errors, e, t),
                ((e, t) => {
                  !n_(r_(e, t)).length && U_(e, t);
                })(i.errors, e));
            }
            if (
              (d.touchedFields || u.touchedFields) &&
              p &&
              Array.isArray(r_(i.touchedFields, e))
            ) {
              const t = l(r_(i.touchedFields, e), c.argA, c.argB);
              g && s_(i.touchedFields, e, t);
            }
            ((d.dirtyFields || u.dirtyFields) && (i.dirtyFields = K_(o, s)),
              h.state.next({
                name: e,
                isDirty: x(e, t),
                dirtyFields: i.dirtyFields,
                errors: i.errors,
                isValid: i.isValid,
              }));
          } else s_(s, e, t);
        },
        _setDisabledField: M,
        _setErrors: (e) => {
          ((i.errors = e), h.state.next({ errors: i.errors, isValid: !1 }));
        },
        _getFieldArray: (e) => n_(r_(a.mount ? s : o, e, n.shouldUnregister ? r_(o, e, []) : [])),
        _reset: F,
        _resetDefaultValues: () =>
          B_(n.defaultValues) &&
          n.defaultValues().then((e) => {
            (B(e, n.resetOptions), h.state.next({ isLoading: !1 }));
          }),
        _removeUnmounted: () => {
          for (const e of l.unMount) {
            const t = r_(r, e);
            t && (t._f.refs ? t._f.refs.every((e) => !z_(e)) : !z_(t._f.ref)) && O(e);
          }
          l.unMount = new Set();
        },
        _disableForm: (e) => {
          o_(e) &&
            (h.state.next({ disabled: e }),
            av(
              r,
              (t, n) => {
                const i = r_(r, n);
                i &&
                  ((t.disabled = i._f.disabled || e),
                  Array.isArray(i._f.refs) &&
                    i._f.refs.forEach((t) => {
                      t.disabled = i._f.disabled || e;
                    }));
              },
              0,
              !1,
            ));
        },
        _subjects: h,
        _proxyFormState: d,
        get _fields() {
          return r;
        },
        get _formValues() {
          return s;
        },
        get _state() {
          return a;
        },
        set _state(e) {
          a = e;
        },
        get _defaultValues() {
          return o;
        },
        get _names() {
          return l;
        },
        set _names(e) {
          l = e;
        },
        get _formState() {
          return i;
        },
        get _options() {
          return n;
        },
        set _options(e) {
          n = { ...n, ...e };
        },
      },
      subscribe: (e) => ((a.mount = !0), (u = { ...u, ...e.formState }), R({ ...e, formState: u })),
      trigger: L,
      register: A,
      handleSubmit: j,
      watch: (e, t) =>
        B_(e)
          ? h.state.subscribe({ next: (n) => "values" in n && e(w(void 0, t), n) })
          : w(e, t, !0),
      setValue: k,
      getValues: D,
      reset: B,
      resetField: (e, t = {}) => {
        r_(r, e) &&
          (t_(t.defaultValue)
            ? k(e, Jm(r_(o, e)))
            : (k(e, t.defaultValue), s_(o, e, Jm(t.defaultValue))),
          t.keepTouched || U_(i.touchedFields, e),
          t.keepDirty ||
            (U_(i.dirtyFields, e), (i.isDirty = t.defaultValue ? x(e, Jm(r_(o, e))) : x())),
          t.keepError || (U_(i.errors, e), d.isValid && p()),
          h.state.next({ ...i }));
      },
      clearErrors: (e) => {
        (e && M_(e).forEach((e) => U_(i.errors, e)), h.state.next({ errors: e ? i.errors : {} }));
      },
      unregister: O,
      setError: I,
      setFocus: (e, t = {}) => {
        const n = r_(r, e),
          i = n && n._f;
        if (i) {
          const e = i.refs ? i.refs[0] : i.ref;
          e.focus && (e.focus(), t.shouldSelect && B_(e.select) && e.select());
        }
      },
      getFieldState: T,
    };
  return { ...W, formControl: W };
}
var fv = () => {
    if ("undefined" != typeof crypto && crypto.randomUUID) return crypto.randomUUID();
    const e = "undefined" == typeof performance ? Date.now() : 1e3 * performance.now();
    return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
      const n = ((16 * Math.random() + e) % 16) | 0;
      return ("x" == t ? n : (3 & n) | 8).toString(16);
    });
  },
  mv = (e, t, n = {}) =>
    n.shouldFocus || t_(n.shouldFocus)
      ? n.focusName || `${e}.${t_(n.focusIndex) ? t : n.focusIndex}.`
      : "",
  _v = (e, t) => [...e, ...M_(t)],
  vv = (e) => (Array.isArray(e) ? e.map(() => {}) : void 0);
function bv(e, t, n) {
  return [...e.slice(0, t), ...M_(n), ...e.slice(t)];
}
var yv = (e, t, n) =>
    Array.isArray(e) ? (t_(e[n]) && (e[n] = void 0), e.splice(n, 0, e.splice(t, 1)[0]), e) : [],
  xv = (e, t) => [...M_(t), ...M_(e)];
var wv = (e, t) =>
    t_(t)
      ? []
      : (function (e, t) {
          let n = 0;
          const i = [...e];
          for (const r of t) (i.splice(r - n, 1), n++);
          return n_(i).length ? i : [];
        })(
          e,
          M_(t).sort((e, t) => e - t),
        ),
  Cv = (e, t, n) => {
    [e[t], e[n]] = [e[n], e[t]];
  },
  Sv = (e, t, n) => ((e[t] = n), e);
function kv(e = {}) {
  const t = z.useRef(void 0),
    n = z.useRef(void 0),
    [i, r] = z.useState({
      isDirty: !1,
      isValidating: !1,
      isLoading: B_(e.defaultValues),
      isSubmitted: !1,
      isSubmitting: !1,
      isSubmitSuccessful: !1,
      isValid: !1,
      submitCount: 0,
      dirtyFields: {},
      touchedFields: {},
      validatingFields: {},
      errors: e.errors || {},
      disabled: e.disabled || !1,
      isReady: !1,
      defaultValues: B_(e.defaultValues) ? void 0 : e.defaultValues,
    });
  if (!t.current)
    if (e.formControl)
      ((t.current = { ...e.formControl, formState: i }),
        e.defaultValues &&
          !B_(e.defaultValues) &&
          e.formControl.reset(e.defaultValues, e.resetOptions));
    else {
      const { formControl: n, ...r } = pv(e);
      t.current = { ...r, formState: i };
    }
  const o = t.current.control;
  return (
    (o._options = e),
    k_(() => {
      const e = o._subscribe({
        formState: o._proxyFormState,
        callback: () => r({ ...o._formState }),
        reRenderRoot: !0,
      });
      return (r((e) => ({ ...e, isReady: !0 })), (o._formState.isReady = !0), e);
    }, [o]),
    z.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]),
    z.useEffect(() => {
      (e.mode && (o._options.mode = e.mode),
        e.reValidateMode && (o._options.reValidateMode = e.reValidateMode));
    }, [o, e.mode, e.reValidateMode]),
    z.useEffect(() => {
      e.errors && (o._setErrors(e.errors), o._focusError());
    }, [o, e.errors]),
    z.useEffect(() => {
      e.shouldUnregister && o._subjects.state.next({ values: o._getWatch() });
    }, [o, e.shouldUnregister]),
    z.useEffect(() => {
      if (o._proxyFormState.isDirty) {
        const e = o._getDirty();
        e !== i.isDirty && o._subjects.state.next({ isDirty: e });
      }
    }, [o, i.isDirty]),
    z.useEffect(() => {
      var t;
      e.values && !D_(e.values, n.current)
        ? (o._reset(e.values, { keepFieldsRef: !0, ...o._options.resetOptions }),
          (null === (t = o._options.resetOptions) || void 0 === t ? void 0 : t.keepIsValid) ||
            o._setValid(),
          (n.current = e.values),
          r((e) => ({ ...e })))
        : o._resetDefaultValues();
    }, [o, e.values]),
    z.useEffect(() => {
      (o._state.mount || (o._setValid(), (o._state.mount = !0)),
        o._state.watch && ((o._state.watch = !1), o._subjects.state.next({ ...o._formState })),
        o._removeUnmounted());
    }),
    (t.current.formState = S_(i, o)),
    t.current
  );
}
const Ev = (e, t, n) => {
    if (e && "reportValidity" in e) {
      const i = r_(n, t);
      (e.setCustomValidity((i && i.message) || ""), e.reportValidity());
    }
  },
  Nv = (e, t) => {
    for (const n in t.fields) {
      const i = t.fields[n];
      i && i.ref && "reportValidity" in i.ref
        ? Ev(i.ref, n, e)
        : i.refs && i.refs.forEach((t) => Ev(t, n, e));
    }
  },
  Lv = (e, t) => {
    t.shouldUseNativeValidation && Nv(e, t);
    const n = {};
    for (const i in e) {
      const r = r_(t.fields, i),
        o = Object.assign(e[i] || {}, { ref: r && r.ref });
      if (Dv(t.names || Object.keys(e), i)) {
        const e = Object.assign({}, r_(n, i));
        (s_(e, "root", o), s_(n, i, e));
      } else s_(n, i, o);
    }
    return n;
  },
  Dv = (e, t) => e.some((e) => e.startsWith(t + "."));
var Tv,
  Iv,
  Rv = function (e, t) {
    for (var n = {}; e.length; ) {
      var i = e[0],
        r = i.code,
        o = i.message,
        s = i.path.join(".");
      if (!n[s])
        if ("unionErrors" in i) {
          var a = i.unionErrors[0].errors[0];
          n[s] = { message: a.message, type: a.code };
        } else n[s] = { message: o, type: r };
      if (
        ("unionErrors" in i &&
          i.unionErrors.forEach(function (t) {
            return t.errors.forEach(function (t) {
              return e.push(t);
            });
          }),
        t)
      ) {
        var l = n[s].types,
          c = l && l[i.code];
        n[s] = O_(s, t, n, r, c ? [].concat(c, i.message) : i.message);
      }
      e.shift();
    }
    return n;
  },
  Ov = function (e, t, n) {
    return (
      void 0 === n && (n = {}),
      function (i, r, o) {
        try {
          return Promise.resolve(
            (function (r, s) {
              try {
                var a = Promise.resolve(e["sync" === n.mode ? "parse" : "parseAsync"](i, t)).then(
                  function (e) {
                    return (
                      o.shouldUseNativeValidation && Nv({}, o),
                      { errors: {}, values: n.raw ? i : e }
                    );
                  },
                );
              } catch (Q3e) {
                return s(Q3e);
              }
              return a && a.then ? a.then(void 0, s) : a;
            })(0, function (e) {
              if (
                (function (e) {
                  return Array.isArray(null == e ? void 0 : e.errors);
                })(e)
              )
                return {
                  values: {},
                  errors: Lv(
                    Rv(e.errors, !o.shouldUseNativeValidation && "all" === o.criteriaMode),
                    o,
                  ),
                };
              throw e;
            }),
          );
        } catch (Q3e) {
          return Promise.reject(Q3e);
        }
      }
    );
  };
(!(function (e) {
  ((e.assertEqual = (e) => {}),
    (e.assertIs = function (e) {}),
    (e.assertNever = function (e) {
      throw new Error();
    }),
    (e.arrayToEnum = (e) => {
      const t = {};
      for (const n of e) t[n] = n;
      return t;
    }),
    (e.getValidEnumValues = (t) => {
      const n = e.objectKeys(t).filter((e) => "number" != typeof t[t[e]]),
        i = {};
      for (const e of n) i[e] = t[e];
      return e.objectValues(i);
    }),
    (e.objectValues = (t) =>
      e.objectKeys(t).map(function (e) {
        return t[e];
      })),
    (e.objectKeys =
      "function" == typeof Object.keys
        ? (e) => Object.keys(e)
        : (e) => {
            const t = [];
            for (const n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
            return t;
          }),
    (e.find = (e, t) => {
      for (const n of e) if (t(n)) return n;
    }),
    (e.isInteger =
      "function" == typeof Number.isInteger
        ? (e) => Number.isInteger(e)
        : (e) => "number" == typeof e && Number.isFinite(e) && Math.floor(e) === e),
    (e.joinValues = function (e, t = " | ") {
      return e.map((e) => ("string" == typeof e ? `'${e}'` : e)).join(t);
    }),
    (e.jsonStringifyReplacer = (e, t) => ("bigint" == typeof t ? t.toString() : t)));
})(Tv || (Tv = {})),
  (function (e) {
    e.mergeShapes = (e, t) => ({ ...e, ...t });
  })(Iv || (Iv = {})));
const Mv = Tv.arrayToEnum([
    "string",
    "nan",
    "number",
    "integer",
    "float",
    "boolean",
    "date",
    "bigint",
    "symbol",
    "function",
    "undefined",
    "null",
    "array",
    "object",
    "unknown",
    "promise",
    "void",
    "never",
    "map",
    "set",
  ]),
  Av = (e) => {
    switch (typeof e) {
      case "undefined":
        return Mv.undefined;
      case "string":
        return Mv.string;
      case "number":
        return Number.isNaN(e) ? Mv.nan : Mv.number;
      case "boolean":
        return Mv.boolean;
      case "function":
        return Mv.function;
      case "bigint":
        return Mv.bigint;
      case "symbol":
        return Mv.symbol;
      case "object":
        return Array.isArray(e)
          ? Mv.array
          : null === e
            ? Mv.null
            : e.then && "function" == typeof e.then && e.catch && "function" == typeof e.catch
              ? Mv.promise
              : "undefined" != typeof Map && e instanceof Map
                ? Mv.map
                : "undefined" != typeof Set && e instanceof Set
                  ? Mv.set
                  : "undefined" != typeof Date && e instanceof Date
                    ? Mv.date
                    : Mv.object;
      default:
        return Mv.unknown;
    }
  },
  Pv = Tv.arrayToEnum([
    "invalid_type",
    "invalid_literal",
    "custom",
    "invalid_union",
    "invalid_union_discriminator",
    "invalid_enum_value",
    "unrecognized_keys",
    "invalid_arguments",
    "invalid_return_type",
    "invalid_date",
    "invalid_string",
    "too_small",
    "too_big",
    "invalid_intersection_types",
    "not_multiple_of",
    "not_finite",
  ]);
class jv extends Error {
  get errors() {
    return this.issues;
  }
  constructor(e) {
    (super(),
      (this.issues = []),
      (this.addIssue = (e) => {
        this.issues = [...this.issues, e];
      }),
      (this.addIssues = (e = []) => {
        this.issues = [...this.issues, ...e];
      }));
    const t = new.target.prototype;
    (Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : (this.__proto__ = t),
      (this.name = "ZodError"),
      (this.issues = e));
  }
  format(e) {
    const t =
        e ||
        function (e) {
          return e.message;
        },
      n = { _errors: [] },
      i = (e) => {
        for (const r of e.issues)
          if ("invalid_union" === r.code) r.unionErrors.map(i);
          else if ("invalid_return_type" === r.code) i(r.returnTypeError);
          else if ("invalid_arguments" === r.code) i(r.argumentsError);
          else if (0 === r.path.length) n._errors.push(t(r));
          else {
            let e = n,
              i = 0;
            for (; i < r.path.length; ) {
              const n = r.path[i];
              (i === r.path.length - 1
                ? ((e[n] = e[n] || { _errors: [] }), e[n]._errors.push(t(r)))
                : (e[n] = e[n] || { _errors: [] }),
                (e = e[n]),
                i++);
            }
          }
      };
    return (i(this), n);
  }
  static assert(e) {
    if (!(e instanceof jv)) throw new Error(`Not a ZodError: ${e}`);
  }
  toString() {
    return this.message;
  }
  get message() {
    return JSON.stringify(this.issues, Tv.jsonStringifyReplacer, 2);
  }
  get isEmpty() {
    return 0 === this.issues.length;
  }
  flatten(e = (e) => e.message) {
    const t = {},
      n = [];
    for (const i of this.issues)
      if (i.path.length > 0) {
        const n = i.path[0];
        ((t[n] = t[n] || []), t[n].push(e(i)));
      } else n.push(e(i));
    return { formErrors: n, fieldErrors: t };
  }
  get formErrors() {
    return this.flatten();
  }
}
jv.create = (e) => new jv(e);
const Fv = (e, t) => {
  let n;
  switch (e.code) {
    case Pv.invalid_type:
      n =
        e.received === Mv.undefined ? "Required" : `Expected ${e.expected}, received ${e.received}`;
      break;
    case Pv.invalid_literal:
      n = `Invalid literal value, expected ${JSON.stringify(e.expected, Tv.jsonStringifyReplacer)}`;
      break;
    case Pv.unrecognized_keys:
      n = `Unrecognized key(s) in object: ${Tv.joinValues(e.keys, ", ")}`;
      break;
    case Pv.invalid_union:
      n = "Invalid input";
      break;
    case Pv.invalid_union_discriminator:
      n = `Invalid discriminator value. Expected ${Tv.joinValues(e.options)}`;
      break;
    case Pv.invalid_enum_value:
      n = `Invalid enum value. Expected ${Tv.joinValues(e.options)}, received '${e.received}'`;
      break;
    case Pv.invalid_arguments:
      n = "Invalid function arguments";
      break;
    case Pv.invalid_return_type:
      n = "Invalid function return type";
      break;
    case Pv.invalid_date:
      n = "Invalid date";
      break;
    case Pv.invalid_string:
      "object" == typeof e.validation
        ? "includes" in e.validation
          ? ((n = `Invalid input: must include "${e.validation.includes}"`),
            "number" == typeof e.validation.position &&
              (n = `${n} at one or more positions greater than or equal to ${e.validation.position}`))
          : "startsWith" in e.validation
            ? (n = `Invalid input: must start with "${e.validation.startsWith}"`)
            : "endsWith" in e.validation
              ? (n = `Invalid input: must end with "${e.validation.endsWith}"`)
              : Tv.assertNever(e.validation)
        : (n = "regex" !== e.validation ? `Invalid ${e.validation}` : "Invalid");
      break;
    case Pv.too_small:
      n =
        "array" === e.type
          ? `Array must contain ${e.exact ? "exactly" : e.inclusive ? "at least" : "more than"} ${e.minimum} element(s)`
          : "string" === e.type
            ? `String must contain ${e.exact ? "exactly" : e.inclusive ? "at least" : "over"} ${e.minimum} character(s)`
            : "number" === e.type || "bigint" === e.type
              ? `Number must be ${e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than "}${e.minimum}`
              : "date" === e.type
                ? `Date must be ${e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(e.minimum))}`
                : "Invalid input";
      break;
    case Pv.too_big:
      n =
        "array" === e.type
          ? `Array must contain ${e.exact ? "exactly" : e.inclusive ? "at most" : "less than"} ${e.maximum} element(s)`
          : "string" === e.type
            ? `String must contain ${e.exact ? "exactly" : e.inclusive ? "at most" : "under"} ${e.maximum} character(s)`
            : "number" === e.type
              ? `Number must be ${e.exact ? "exactly" : e.inclusive ? "less than or equal to" : "less than"} ${e.maximum}`
              : "bigint" === e.type
                ? `BigInt must be ${e.exact ? "exactly" : e.inclusive ? "less than or equal to" : "less than"} ${e.maximum}`
                : "date" === e.type
                  ? `Date must be ${e.exact ? "exactly" : e.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(e.maximum))}`
                  : "Invalid input";
      break;
    case Pv.custom:
      n = "Invalid input";
      break;
    case Pv.invalid_intersection_types:
      n = "Intersection results could not be merged";
      break;
    case Pv.not_multiple_of:
      n = `Number must be a multiple of ${e.multipleOf}`;
      break;
    case Pv.not_finite:
      n = "Number must be finite";
      break;
    default:
      ((n = t.defaultError), Tv.assertNever(e));
  }
  return { message: n };
};
let Bv = Fv;
function Vv(e, t) {
  const n = Bv,
    i = ((e) => {
      const { data: t, path: n, errorMaps: i, issueData: r } = e,
        o = [...n, ...(r.path || [])],
        s = { ...r, path: o };
      if (void 0 !== r.message) return { ...r, path: o, message: r.message };
      let a = "";
      const l = i
        .filter((e) => !!e)
        .slice()
        .reverse();
      for (const c of l) a = c(s, { data: t, defaultError: a }).message;
      return { ...r, path: o, message: a };
    })({
      issueData: t,
      data: e.data,
      path: e.path,
      errorMaps: [e.common.contextualErrorMap, e.schemaErrorMap, n, n === Fv ? void 0 : Fv].filter(
        (e) => !!e,
      ),
    });
  e.common.issues.push(i);
}
class Wv {
  constructor() {
    this.value = "valid";
  }
  dirty() {
    "valid" === this.value && (this.value = "dirty");
  }
  abort() {
    "aborted" !== this.value && (this.value = "aborted");
  }
  static mergeArray(e, t) {
    const n = [];
    for (const i of t) {
      if ("aborted" === i.status) return Hv;
      ("dirty" === i.status && e.dirty(), n.push(i.value));
    }
    return { status: e.value, value: n };
  }
  static async mergeObjectAsync(e, t) {
    const n = [];
    for (const i of t) {
      const e = await i.key,
        t = await i.value;
      n.push({ key: e, value: t });
    }
    return Wv.mergeObjectSync(e, n);
  }
  static mergeObjectSync(e, t) {
    const n = {};
    for (const i of t) {
      const { key: t, value: r } = i;
      if ("aborted" === t.status) return Hv;
      if ("aborted" === r.status) return Hv;
      ("dirty" === t.status && e.dirty(),
        "dirty" === r.status && e.dirty(),
        "__proto__" === t.value || (void 0 === r.value && !i.alwaysSet) || (n[t.value] = r.value));
    }
    return { status: e.value, value: n };
  }
}
const Hv = Object.freeze({ status: "aborted" }),
  zv = (e) => ({ status: "dirty", value: e }),
  Uv = (e) => ({ status: "valid", value: e }),
  $v = (e) => "aborted" === e.status,
  qv = (e) => "dirty" === e.status,
  Kv = (e) => "valid" === e.status,
  Gv = (e) => "undefined" != typeof Promise && e instanceof Promise;
var Zv;
!(function (e) {
  ((e.errToObj = (e) => ("string" == typeof e ? { message: e } : e || {})),
    (e.toString = (e) => ("string" == typeof e ? e : e?.message)));
})(Zv || (Zv = {}));
class Yv {
  constructor(e, t, n, i) {
    ((this._cachedPath = []),
      (this.parent = e),
      (this.data = t),
      (this._path = n),
      (this._key = i));
  }
  get path() {
    return (
      this._cachedPath.length ||
        (Array.isArray(this._key)
          ? this._cachedPath.push(...this._path, ...this._key)
          : this._cachedPath.push(...this._path, this._key)),
      this._cachedPath
    );
  }
}
const Xv = (e, t) => {
  if (Kv(t)) return { success: !0, data: t.value };
  if (!e.common.issues.length) throw new Error("Validation failed but no issues detected.");
  return {
    success: !1,
    get error() {
      if (this._error) return this._error;
      const t = new jv(e.common.issues);
      return ((this._error = t), this._error);
    },
  };
};
function Qv(e) {
  if (!e) return {};
  const { errorMap: t, invalid_type_error: n, required_error: i, description: r } = e;
  if (t && (n || i))
    throw new Error(
      'Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.',
    );
  if (t) return { errorMap: t, description: r };
  return {
    errorMap: (t, r) => {
      const { message: o } = e;
      return "invalid_enum_value" === t.code
        ? { message: o ?? r.defaultError }
        : void 0 === r.data
          ? { message: o ?? i ?? r.defaultError }
          : "invalid_type" !== t.code
            ? { message: r.defaultError }
            : { message: o ?? n ?? r.defaultError };
    },
    description: r,
  };
}
class Jv {
  get description() {
    return this._def.description;
  }
  _getType(e) {
    return Av(e.data);
  }
  _getOrReturnCtx(e, t) {
    return (
      t || {
        common: e.parent.common,
        data: e.data,
        parsedType: Av(e.data),
        schemaErrorMap: this._def.errorMap,
        path: e.path,
        parent: e.parent,
      }
    );
  }
  _processInputParams(e) {
    return {
      status: new Wv(),
      ctx: {
        common: e.parent.common,
        data: e.data,
        parsedType: Av(e.data),
        schemaErrorMap: this._def.errorMap,
        path: e.path,
        parent: e.parent,
      },
    };
  }
  _parseSync(e) {
    const t = this._parse(e);
    if (Gv(t)) throw new Error("Synchronous parse encountered promise.");
    return t;
  }
  _parseAsync(e) {
    const t = this._parse(e);
    return Promise.resolve(t);
  }
  parse(e, t) {
    const n = this.safeParse(e, t);
    if (n.success) return n.data;
    throw n.error;
  }
  safeParse(e, t) {
    const n = {
        common: { issues: [], async: t?.async ?? !1, contextualErrorMap: t?.errorMap },
        path: t?.path || [],
        schemaErrorMap: this._def.errorMap,
        parent: null,
        data: e,
        parsedType: Av(e),
      },
      i = this._parseSync({ data: e, path: n.path, parent: n });
    return Xv(n, i);
  }
  "~validate"(e) {
    const t = {
      common: { issues: [], async: !!this["~standard"].async },
      path: [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data: e,
      parsedType: Av(e),
    };
    if (!this["~standard"].async)
      try {
        const n = this._parseSync({ data: e, path: [], parent: t });
        return Kv(n) ? { value: n.value } : { issues: t.common.issues };
      } catch (n) {
        (n?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0),
          (t.common = { issues: [], async: !0 }));
      }
    return this._parseAsync({ data: e, path: [], parent: t }).then((e) =>
      Kv(e) ? { value: e.value } : { issues: t.common.issues },
    );
  }
  async parseAsync(e, t) {
    const n = await this.safeParseAsync(e, t);
    if (n.success) return n.data;
    throw n.error;
  }
  async safeParseAsync(e, t) {
    const n = {
        common: { issues: [], contextualErrorMap: t?.errorMap, async: !0 },
        path: t?.path || [],
        schemaErrorMap: this._def.errorMap,
        parent: null,
        data: e,
        parsedType: Av(e),
      },
      i = this._parse({ data: e, path: n.path, parent: n }),
      r = await (Gv(i) ? i : Promise.resolve(i));
    return Xv(n, r);
  }
  refine(e, t) {
    const n = (e) =>
      "string" == typeof t || void 0 === t ? { message: t } : "function" == typeof t ? t(e) : t;
    return this._refinement((t, i) => {
      const r = e(t),
        o = () => i.addIssue({ code: Pv.custom, ...n(t) });
      return "undefined" != typeof Promise && r instanceof Promise
        ? r.then((e) => !!e || (o(), !1))
        : !!r || (o(), !1);
    });
  }
  refinement(e, t) {
    return this._refinement(
      (n, i) => !!e(n) || (i.addIssue("function" == typeof t ? t(n, i) : t), !1),
    );
  }
  _refinement(e) {
    return new Qb({
      schema: this,
      typeName: ay.ZodEffects,
      effect: { type: "refinement", refinement: e },
    });
  }
  superRefine(e) {
    return this._refinement(e);
  }
  constructor(e) {
    ((this.spa = this.safeParseAsync),
      (this._def = e),
      (this.parse = this.parse.bind(this)),
      (this.safeParse = this.safeParse.bind(this)),
      (this.parseAsync = this.parseAsync.bind(this)),
      (this.safeParseAsync = this.safeParseAsync.bind(this)),
      (this.spa = this.spa.bind(this)),
      (this.refine = this.refine.bind(this)),
      (this.refinement = this.refinement.bind(this)),
      (this.superRefine = this.superRefine.bind(this)),
      (this.optional = this.optional.bind(this)),
      (this.nullable = this.nullable.bind(this)),
      (this.nullish = this.nullish.bind(this)),
      (this.array = this.array.bind(this)),
      (this.promise = this.promise.bind(this)),
      (this.or = this.or.bind(this)),
      (this.and = this.and.bind(this)),
      (this.transform = this.transform.bind(this)),
      (this.brand = this.brand.bind(this)),
      (this.default = this.default.bind(this)),
      (this.catch = this.catch.bind(this)),
      (this.describe = this.describe.bind(this)),
      (this.pipe = this.pipe.bind(this)),
      (this.readonly = this.readonly.bind(this)),
      (this.isNullable = this.isNullable.bind(this)),
      (this.isOptional = this.isOptional.bind(this)),
      (this["~standard"] = { version: 1, vendor: "zod", validate: (e) => this["~validate"](e) }));
  }
  optional() {
    return Jb.create(this, this._def);
  }
  nullable() {
    return ey.create(this, this._def);
  }
  nullish() {
    return this.nullable().optional();
  }
  array() {
    return Pb.create(this);
  }
  promise() {
    return Xb.create(this, this._def);
  }
  or(e) {
    return Bb.create([this, e], this._def);
  }
  and(e) {
    return Wb.create(this, e, this._def);
  }
  transform(e) {
    return new Qb({
      ...Qv(this._def),
      schema: this,
      typeName: ay.ZodEffects,
      effect: { type: "transform", transform: e },
    });
  }
  default(e) {
    const t = "function" == typeof e ? e : () => e;
    return new ty({ ...Qv(this._def), innerType: this, defaultValue: t, typeName: ay.ZodDefault });
  }
  brand() {
    return new ry({ typeName: ay.ZodBranded, type: this, ...Qv(this._def) });
  }
  catch(e) {
    const t = "function" == typeof e ? e : () => e;
    return new ny({ ...Qv(this._def), innerType: this, catchValue: t, typeName: ay.ZodCatch });
  }
  describe(e) {
    return new (0, this.constructor)({ ...this._def, description: e });
  }
  pipe(e) {
    return oy.create(this, e);
  }
  readonly() {
    return sy.create(this);
  }
  isOptional() {
    return this.safeParse(void 0).success;
  }
  isNullable() {
    return this.safeParse(null).success;
  }
}
const eb = /^c[^\s-]{8,}$/i,
  tb = /^[0-9a-z]+$/,
  nb = /^[0-9A-HJKMNP-TV-Z]{26}$/i,
  ib = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,
  rb = /^[a-z0-9_-]{21}$/i,
  ob = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,
  sb =
    /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,
  ab = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
let lb;
const cb =
    /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
  db =
    /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
  ub =
    /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,
  hb =
    /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
  gb = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
  pb = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
  fb =
    "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",
  mb = new RegExp(`^${fb}$`);
function _b(e) {
  let t = "[0-5]\\d";
  e.precision ? (t = `${t}\\.\\d{${e.precision}}`) : null == e.precision && (t = `${t}(\\.\\d+)?`);
  return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision ? "+" : "?"}`;
}
function vb(e) {
  return new RegExp(`^${_b(e)}$`);
}
function bb(e) {
  let t = `${fb}T${_b(e)}`;
  const n = [];
  return (
    n.push(e.local ? "Z?" : "Z"),
    e.offset && n.push("([+-]\\d{2}:?\\d{2})"),
    (t = `${t}(${n.join("|")})`),
    new RegExp(`^${t}$`)
  );
}
function yb(e, t) {
  return !(("v4" !== t && t) || !cb.test(e)) || !(("v6" !== t && t) || !ub.test(e));
}
function xb(e, t) {
  if (!ob.test(e)) return !1;
  try {
    const [n] = e.split(".");
    if (!n) return !1;
    const i = n
        .replace(/-/g, "+")
        .replace(/_/g, "/")
        .padEnd(n.length + ((4 - (n.length % 4)) % 4), "="),
      r = JSON.parse(atob(i));
    return (
      "object" == typeof r &&
      null !== r &&
      (!("typ" in r) || "JWT" === r?.typ) &&
      !!r.alg &&
      (!t || r.alg === t)
    );
  } catch {
    return !1;
  }
}
function wb(e, t) {
  return !(("v4" !== t && t) || !db.test(e)) || !(("v6" !== t && t) || !hb.test(e));
}
class Cb extends Jv {
  _parse(e) {
    this._def.coerce && (e.data = String(e.data));
    if (this._getType(e) !== Mv.string) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.string, received: t.parsedType }), Hv);
    }
    const t = new Wv();
    let n;
    for (const i of this._def.checks)
      if ("min" === i.kind)
        e.data.length < i.value &&
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, {
            code: Pv.too_small,
            minimum: i.value,
            type: "string",
            inclusive: !0,
            exact: !1,
            message: i.message,
          }),
          t.dirty());
      else if ("max" === i.kind)
        e.data.length > i.value &&
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, {
            code: Pv.too_big,
            maximum: i.value,
            type: "string",
            inclusive: !0,
            exact: !1,
            message: i.message,
          }),
          t.dirty());
      else if ("length" === i.kind) {
        const r = e.data.length > i.value,
          o = e.data.length < i.value;
        (r || o) &&
          ((n = this._getOrReturnCtx(e, n)),
          r
            ? Vv(n, {
                code: Pv.too_big,
                maximum: i.value,
                type: "string",
                inclusive: !0,
                exact: !0,
                message: i.message,
              })
            : o &&
              Vv(n, {
                code: Pv.too_small,
                minimum: i.value,
                type: "string",
                inclusive: !0,
                exact: !0,
                message: i.message,
              }),
          t.dirty());
      } else if ("email" === i.kind)
        ab.test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { validation: "email", code: Pv.invalid_string, message: i.message }),
          t.dirty());
      else if ("emoji" === i.kind)
        (lb || (lb = new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")),
          lb.test(e.data) ||
            ((n = this._getOrReturnCtx(e, n)),
            Vv(n, { validation: "emoji", code: Pv.invalid_string, message: i.message }),
            t.dirty()));
      else if ("uuid" === i.kind)
        ib.test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { validation: "uuid", code: Pv.invalid_string, message: i.message }),
          t.dirty());
      else if ("nanoid" === i.kind)
        rb.test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { validation: "nanoid", code: Pv.invalid_string, message: i.message }),
          t.dirty());
      else if ("cuid" === i.kind)
        eb.test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { validation: "cuid", code: Pv.invalid_string, message: i.message }),
          t.dirty());
      else if ("cuid2" === i.kind)
        tb.test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { validation: "cuid2", code: Pv.invalid_string, message: i.message }),
          t.dirty());
      else if ("ulid" === i.kind)
        nb.test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { validation: "ulid", code: Pv.invalid_string, message: i.message }),
          t.dirty());
      else if ("url" === i.kind)
        try {
          new URL(e.data);
        } catch {
          ((n = this._getOrReturnCtx(e, n)),
            Vv(n, { validation: "url", code: Pv.invalid_string, message: i.message }),
            t.dirty());
        }
      else if ("regex" === i.kind) {
        i.regex.lastIndex = 0;
        i.regex.test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { validation: "regex", code: Pv.invalid_string, message: i.message }),
          t.dirty());
      } else if ("trim" === i.kind) e.data = e.data.trim();
      else if ("includes" === i.kind)
        e.data.includes(i.value, i.position) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, {
            code: Pv.invalid_string,
            validation: { includes: i.value, position: i.position },
            message: i.message,
          }),
          t.dirty());
      else if ("toLowerCase" === i.kind) e.data = e.data.toLowerCase();
      else if ("toUpperCase" === i.kind) e.data = e.data.toUpperCase();
      else if ("startsWith" === i.kind)
        e.data.startsWith(i.value) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, {
            code: Pv.invalid_string,
            validation: { startsWith: i.value },
            message: i.message,
          }),
          t.dirty());
      else if ("endsWith" === i.kind)
        e.data.endsWith(i.value) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { code: Pv.invalid_string, validation: { endsWith: i.value }, message: i.message }),
          t.dirty());
      else if ("datetime" === i.kind) {
        bb(i).test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { code: Pv.invalid_string, validation: "datetime", message: i.message }),
          t.dirty());
      } else if ("date" === i.kind) {
        mb.test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { code: Pv.invalid_string, validation: "date", message: i.message }),
          t.dirty());
      } else if ("time" === i.kind) {
        vb(i).test(e.data) ||
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, { code: Pv.invalid_string, validation: "time", message: i.message }),
          t.dirty());
      } else
        "duration" === i.kind
          ? sb.test(e.data) ||
            ((n = this._getOrReturnCtx(e, n)),
            Vv(n, { validation: "duration", code: Pv.invalid_string, message: i.message }),
            t.dirty())
          : "ip" === i.kind
            ? yb(e.data, i.version) ||
              ((n = this._getOrReturnCtx(e, n)),
              Vv(n, { validation: "ip", code: Pv.invalid_string, message: i.message }),
              t.dirty())
            : "jwt" === i.kind
              ? xb(e.data, i.alg) ||
                ((n = this._getOrReturnCtx(e, n)),
                Vv(n, { validation: "jwt", code: Pv.invalid_string, message: i.message }),
                t.dirty())
              : "cidr" === i.kind
                ? wb(e.data, i.version) ||
                  ((n = this._getOrReturnCtx(e, n)),
                  Vv(n, { validation: "cidr", code: Pv.invalid_string, message: i.message }),
                  t.dirty())
                : "base64" === i.kind
                  ? gb.test(e.data) ||
                    ((n = this._getOrReturnCtx(e, n)),
                    Vv(n, { validation: "base64", code: Pv.invalid_string, message: i.message }),
                    t.dirty())
                  : "base64url" === i.kind
                    ? pb.test(e.data) ||
                      ((n = this._getOrReturnCtx(e, n)),
                      Vv(n, {
                        validation: "base64url",
                        code: Pv.invalid_string,
                        message: i.message,
                      }),
                      t.dirty())
                    : Tv.assertNever(i);
    return { status: t.value, value: e.data };
  }
  _regex(e, t, n) {
    return this.refinement((t) => e.test(t), {
      validation: t,
      code: Pv.invalid_string,
      ...Zv.errToObj(n),
    });
  }
  _addCheck(e) {
    return new Cb({ ...this._def, checks: [...this._def.checks, e] });
  }
  email(e) {
    return this._addCheck({ kind: "email", ...Zv.errToObj(e) });
  }
  url(e) {
    return this._addCheck({ kind: "url", ...Zv.errToObj(e) });
  }
  emoji(e) {
    return this._addCheck({ kind: "emoji", ...Zv.errToObj(e) });
  }
  uuid(e) {
    return this._addCheck({ kind: "uuid", ...Zv.errToObj(e) });
  }
  nanoid(e) {
    return this._addCheck({ kind: "nanoid", ...Zv.errToObj(e) });
  }
  cuid(e) {
    return this._addCheck({ kind: "cuid", ...Zv.errToObj(e) });
  }
  cuid2(e) {
    return this._addCheck({ kind: "cuid2", ...Zv.errToObj(e) });
  }
  ulid(e) {
    return this._addCheck({ kind: "ulid", ...Zv.errToObj(e) });
  }
  base64(e) {
    return this._addCheck({ kind: "base64", ...Zv.errToObj(e) });
  }
  base64url(e) {
    return this._addCheck({ kind: "base64url", ...Zv.errToObj(e) });
  }
  jwt(e) {
    return this._addCheck({ kind: "jwt", ...Zv.errToObj(e) });
  }
  ip(e) {
    return this._addCheck({ kind: "ip", ...Zv.errToObj(e) });
  }
  cidr(e) {
    return this._addCheck({ kind: "cidr", ...Zv.errToObj(e) });
  }
  datetime(e) {
    return "string" == typeof e
      ? this._addCheck({ kind: "datetime", precision: null, offset: !1, local: !1, message: e })
      : this._addCheck({
          kind: "datetime",
          precision: void 0 === e?.precision ? null : e?.precision,
          offset: e?.offset ?? !1,
          local: e?.local ?? !1,
          ...Zv.errToObj(e?.message),
        });
  }
  date(e) {
    return this._addCheck({ kind: "date", message: e });
  }
  time(e) {
    return "string" == typeof e
      ? this._addCheck({ kind: "time", precision: null, message: e })
      : this._addCheck({
          kind: "time",
          precision: void 0 === e?.precision ? null : e?.precision,
          ...Zv.errToObj(e?.message),
        });
  }
  duration(e) {
    return this._addCheck({ kind: "duration", ...Zv.errToObj(e) });
  }
  regex(e, t) {
    return this._addCheck({ kind: "regex", regex: e, ...Zv.errToObj(t) });
  }
  includes(e, t) {
    return this._addCheck({
      kind: "includes",
      value: e,
      position: t?.position,
      ...Zv.errToObj(t?.message),
    });
  }
  startsWith(e, t) {
    return this._addCheck({ kind: "startsWith", value: e, ...Zv.errToObj(t) });
  }
  endsWith(e, t) {
    return this._addCheck({ kind: "endsWith", value: e, ...Zv.errToObj(t) });
  }
  min(e, t) {
    return this._addCheck({ kind: "min", value: e, ...Zv.errToObj(t) });
  }
  max(e, t) {
    return this._addCheck({ kind: "max", value: e, ...Zv.errToObj(t) });
  }
  length(e, t) {
    return this._addCheck({ kind: "length", value: e, ...Zv.errToObj(t) });
  }
  nonempty(e) {
    return this.min(1, Zv.errToObj(e));
  }
  trim() {
    return new Cb({ ...this._def, checks: [...this._def.checks, { kind: "trim" }] });
  }
  toLowerCase() {
    return new Cb({ ...this._def, checks: [...this._def.checks, { kind: "toLowerCase" }] });
  }
  toUpperCase() {
    return new Cb({ ...this._def, checks: [...this._def.checks, { kind: "toUpperCase" }] });
  }
  get isDatetime() {
    return !!this._def.checks.find((e) => "datetime" === e.kind);
  }
  get isDate() {
    return !!this._def.checks.find((e) => "date" === e.kind);
  }
  get isTime() {
    return !!this._def.checks.find((e) => "time" === e.kind);
  }
  get isDuration() {
    return !!this._def.checks.find((e) => "duration" === e.kind);
  }
  get isEmail() {
    return !!this._def.checks.find((e) => "email" === e.kind);
  }
  get isURL() {
    return !!this._def.checks.find((e) => "url" === e.kind);
  }
  get isEmoji() {
    return !!this._def.checks.find((e) => "emoji" === e.kind);
  }
  get isUUID() {
    return !!this._def.checks.find((e) => "uuid" === e.kind);
  }
  get isNANOID() {
    return !!this._def.checks.find((e) => "nanoid" === e.kind);
  }
  get isCUID() {
    return !!this._def.checks.find((e) => "cuid" === e.kind);
  }
  get isCUID2() {
    return !!this._def.checks.find((e) => "cuid2" === e.kind);
  }
  get isULID() {
    return !!this._def.checks.find((e) => "ulid" === e.kind);
  }
  get isIP() {
    return !!this._def.checks.find((e) => "ip" === e.kind);
  }
  get isCIDR() {
    return !!this._def.checks.find((e) => "cidr" === e.kind);
  }
  get isBase64() {
    return !!this._def.checks.find((e) => "base64" === e.kind);
  }
  get isBase64url() {
    return !!this._def.checks.find((e) => "base64url" === e.kind);
  }
  get minLength() {
    let e = null;
    for (const t of this._def.checks)
      "min" === t.kind && (null === e || t.value > e) && (e = t.value);
    return e;
  }
  get maxLength() {
    let e = null;
    for (const t of this._def.checks)
      "max" === t.kind && (null === e || t.value < e) && (e = t.value);
    return e;
  }
}
function Sb(e, t) {
  const n = (e.toString().split(".")[1] || "").length,
    i = (t.toString().split(".")[1] || "").length,
    r = n > i ? n : i;
  return (
    (Number.parseInt(e.toFixed(r).replace(".", "")) %
      Number.parseInt(t.toFixed(r).replace(".", ""))) /
    10 ** r
  );
}
Cb.create = (e) =>
  new Cb({ checks: [], typeName: ay.ZodString, coerce: e?.coerce ?? !1, ...Qv(e) });
class kb extends Jv {
  constructor() {
    (super(...arguments),
      (this.min = this.gte),
      (this.max = this.lte),
      (this.step = this.multipleOf));
  }
  _parse(e) {
    this._def.coerce && (e.data = Number(e.data));
    if (this._getType(e) !== Mv.number) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.number, received: t.parsedType }), Hv);
    }
    let t;
    const n = new Wv();
    for (const i of this._def.checks)
      if ("int" === i.kind)
        Tv.isInteger(e.data) ||
          ((t = this._getOrReturnCtx(e, t)),
          Vv(t, {
            code: Pv.invalid_type,
            expected: "integer",
            received: "float",
            message: i.message,
          }),
          n.dirty());
      else if ("min" === i.kind) {
        (i.inclusive ? e.data < i.value : e.data <= i.value) &&
          ((t = this._getOrReturnCtx(e, t)),
          Vv(t, {
            code: Pv.too_small,
            minimum: i.value,
            type: "number",
            inclusive: i.inclusive,
            exact: !1,
            message: i.message,
          }),
          n.dirty());
      } else if ("max" === i.kind) {
        (i.inclusive ? e.data > i.value : e.data >= i.value) &&
          ((t = this._getOrReturnCtx(e, t)),
          Vv(t, {
            code: Pv.too_big,
            maximum: i.value,
            type: "number",
            inclusive: i.inclusive,
            exact: !1,
            message: i.message,
          }),
          n.dirty());
      } else
        "multipleOf" === i.kind
          ? 0 !== Sb(e.data, i.value) &&
            ((t = this._getOrReturnCtx(e, t)),
            Vv(t, { code: Pv.not_multiple_of, multipleOf: i.value, message: i.message }),
            n.dirty())
          : "finite" === i.kind
            ? Number.isFinite(e.data) ||
              ((t = this._getOrReturnCtx(e, t)),
              Vv(t, { code: Pv.not_finite, message: i.message }),
              n.dirty())
            : Tv.assertNever(i);
    return { status: n.value, value: e.data };
  }
  gte(e, t) {
    return this.setLimit("min", e, !0, Zv.toString(t));
  }
  gt(e, t) {
    return this.setLimit("min", e, !1, Zv.toString(t));
  }
  lte(e, t) {
    return this.setLimit("max", e, !0, Zv.toString(t));
  }
  lt(e, t) {
    return this.setLimit("max", e, !1, Zv.toString(t));
  }
  setLimit(e, t, n, i) {
    return new kb({
      ...this._def,
      checks: [...this._def.checks, { kind: e, value: t, inclusive: n, message: Zv.toString(i) }],
    });
  }
  _addCheck(e) {
    return new kb({ ...this._def, checks: [...this._def.checks, e] });
  }
  int(e) {
    return this._addCheck({ kind: "int", message: Zv.toString(e) });
  }
  positive(e) {
    return this._addCheck({ kind: "min", value: 0, inclusive: !1, message: Zv.toString(e) });
  }
  negative(e) {
    return this._addCheck({ kind: "max", value: 0, inclusive: !1, message: Zv.toString(e) });
  }
  nonpositive(e) {
    return this._addCheck({ kind: "max", value: 0, inclusive: !0, message: Zv.toString(e) });
  }
  nonnegative(e) {
    return this._addCheck({ kind: "min", value: 0, inclusive: !0, message: Zv.toString(e) });
  }
  multipleOf(e, t) {
    return this._addCheck({ kind: "multipleOf", value: e, message: Zv.toString(t) });
  }
  finite(e) {
    return this._addCheck({ kind: "finite", message: Zv.toString(e) });
  }
  safe(e) {
    return this._addCheck({
      kind: "min",
      inclusive: !0,
      value: Number.MIN_SAFE_INTEGER,
      message: Zv.toString(e),
    })._addCheck({
      kind: "max",
      inclusive: !0,
      value: Number.MAX_SAFE_INTEGER,
      message: Zv.toString(e),
    });
  }
  get minValue() {
    let e = null;
    for (const t of this._def.checks)
      "min" === t.kind && (null === e || t.value > e) && (e = t.value);
    return e;
  }
  get maxValue() {
    let e = null;
    for (const t of this._def.checks)
      "max" === t.kind && (null === e || t.value < e) && (e = t.value);
    return e;
  }
  get isInt() {
    return !!this._def.checks.find(
      (e) => "int" === e.kind || ("multipleOf" === e.kind && Tv.isInteger(e.value)),
    );
  }
  get isFinite() {
    let e = null,
      t = null;
    for (const n of this._def.checks) {
      if ("finite" === n.kind || "int" === n.kind || "multipleOf" === n.kind) return !0;
      "min" === n.kind
        ? (null === t || n.value > t) && (t = n.value)
        : "max" === n.kind && (null === e || n.value < e) && (e = n.value);
    }
    return Number.isFinite(t) && Number.isFinite(e);
  }
}
kb.create = (e) =>
  new kb({ checks: [], typeName: ay.ZodNumber, coerce: e?.coerce || !1, ...Qv(e) });
class Eb extends Jv {
  constructor() {
    (super(...arguments), (this.min = this.gte), (this.max = this.lte));
  }
  _parse(e) {
    if (this._def.coerce)
      try {
        e.data = BigInt(e.data);
      } catch {
        return this._getInvalidInput(e);
      }
    if (this._getType(e) !== Mv.bigint) return this._getInvalidInput(e);
    let t;
    const n = new Wv();
    for (const i of this._def.checks)
      if ("min" === i.kind) {
        (i.inclusive ? e.data < i.value : e.data <= i.value) &&
          ((t = this._getOrReturnCtx(e, t)),
          Vv(t, {
            code: Pv.too_small,
            type: "bigint",
            minimum: i.value,
            inclusive: i.inclusive,
            message: i.message,
          }),
          n.dirty());
      } else if ("max" === i.kind) {
        (i.inclusive ? e.data > i.value : e.data >= i.value) &&
          ((t = this._getOrReturnCtx(e, t)),
          Vv(t, {
            code: Pv.too_big,
            type: "bigint",
            maximum: i.value,
            inclusive: i.inclusive,
            message: i.message,
          }),
          n.dirty());
      } else
        "multipleOf" === i.kind
          ? e.data % i.value !== BigInt(0) &&
            ((t = this._getOrReturnCtx(e, t)),
            Vv(t, { code: Pv.not_multiple_of, multipleOf: i.value, message: i.message }),
            n.dirty())
          : Tv.assertNever(i);
    return { status: n.value, value: e.data };
  }
  _getInvalidInput(e) {
    const t = this._getOrReturnCtx(e);
    return (Vv(t, { code: Pv.invalid_type, expected: Mv.bigint, received: t.parsedType }), Hv);
  }
  gte(e, t) {
    return this.setLimit("min", e, !0, Zv.toString(t));
  }
  gt(e, t) {
    return this.setLimit("min", e, !1, Zv.toString(t));
  }
  lte(e, t) {
    return this.setLimit("max", e, !0, Zv.toString(t));
  }
  lt(e, t) {
    return this.setLimit("max", e, !1, Zv.toString(t));
  }
  setLimit(e, t, n, i) {
    return new Eb({
      ...this._def,
      checks: [...this._def.checks, { kind: e, value: t, inclusive: n, message: Zv.toString(i) }],
    });
  }
  _addCheck(e) {
    return new Eb({ ...this._def, checks: [...this._def.checks, e] });
  }
  positive(e) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: !1,
      message: Zv.toString(e),
    });
  }
  negative(e) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: !1,
      message: Zv.toString(e),
    });
  }
  nonpositive(e) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: !0,
      message: Zv.toString(e),
    });
  }
  nonnegative(e) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: !0,
      message: Zv.toString(e),
    });
  }
  multipleOf(e, t) {
    return this._addCheck({ kind: "multipleOf", value: e, message: Zv.toString(t) });
  }
  get minValue() {
    let e = null;
    for (const t of this._def.checks)
      "min" === t.kind && (null === e || t.value > e) && (e = t.value);
    return e;
  }
  get maxValue() {
    let e = null;
    for (const t of this._def.checks)
      "max" === t.kind && (null === e || t.value < e) && (e = t.value);
    return e;
  }
}
Eb.create = (e) =>
  new Eb({ checks: [], typeName: ay.ZodBigInt, coerce: e?.coerce ?? !1, ...Qv(e) });
class Nb extends Jv {
  _parse(e) {
    this._def.coerce && (e.data = Boolean(e.data));
    if (this._getType(e) !== Mv.boolean) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.boolean, received: t.parsedType }), Hv);
    }
    return Uv(e.data);
  }
}
Nb.create = (e) => new Nb({ typeName: ay.ZodBoolean, coerce: e?.coerce || !1, ...Qv(e) });
class Lb extends Jv {
  _parse(e) {
    this._def.coerce && (e.data = new Date(e.data));
    if (this._getType(e) !== Mv.date) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.date, received: t.parsedType }), Hv);
    }
    if (Number.isNaN(e.data.getTime())) {
      return (Vv(this._getOrReturnCtx(e), { code: Pv.invalid_date }), Hv);
    }
    const t = new Wv();
    let n;
    for (const i of this._def.checks)
      "min" === i.kind
        ? e.data.getTime() < i.value &&
          ((n = this._getOrReturnCtx(e, n)),
          Vv(n, {
            code: Pv.too_small,
            message: i.message,
            inclusive: !0,
            exact: !1,
            minimum: i.value,
            type: "date",
          }),
          t.dirty())
        : "max" === i.kind
          ? e.data.getTime() > i.value &&
            ((n = this._getOrReturnCtx(e, n)),
            Vv(n, {
              code: Pv.too_big,
              message: i.message,
              inclusive: !0,
              exact: !1,
              maximum: i.value,
              type: "date",
            }),
            t.dirty())
          : Tv.assertNever(i);
    return { status: t.value, value: new Date(e.data.getTime()) };
  }
  _addCheck(e) {
    return new Lb({ ...this._def, checks: [...this._def.checks, e] });
  }
  min(e, t) {
    return this._addCheck({ kind: "min", value: e.getTime(), message: Zv.toString(t) });
  }
  max(e, t) {
    return this._addCheck({ kind: "max", value: e.getTime(), message: Zv.toString(t) });
  }
  get minDate() {
    let e = null;
    for (const t of this._def.checks)
      "min" === t.kind && (null === e || t.value > e) && (e = t.value);
    return null != e ? new Date(e) : null;
  }
  get maxDate() {
    let e = null;
    for (const t of this._def.checks)
      "max" === t.kind && (null === e || t.value < e) && (e = t.value);
    return null != e ? new Date(e) : null;
  }
}
Lb.create = (e) => new Lb({ checks: [], coerce: e?.coerce || !1, typeName: ay.ZodDate, ...Qv(e) });
class Db extends Jv {
  _parse(e) {
    if (this._getType(e) !== Mv.symbol) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.symbol, received: t.parsedType }), Hv);
    }
    return Uv(e.data);
  }
}
Db.create = (e) => new Db({ typeName: ay.ZodSymbol, ...Qv(e) });
class Tb extends Jv {
  _parse(e) {
    if (this._getType(e) !== Mv.undefined) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.undefined, received: t.parsedType }), Hv);
    }
    return Uv(e.data);
  }
}
Tb.create = (e) => new Tb({ typeName: ay.ZodUndefined, ...Qv(e) });
class Ib extends Jv {
  _parse(e) {
    if (this._getType(e) !== Mv.null) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.null, received: t.parsedType }), Hv);
    }
    return Uv(e.data);
  }
}
Ib.create = (e) => new Ib({ typeName: ay.ZodNull, ...Qv(e) });
class Rb extends Jv {
  constructor() {
    (super(...arguments), (this._any = !0));
  }
  _parse(e) {
    return Uv(e.data);
  }
}
Rb.create = (e) => new Rb({ typeName: ay.ZodAny, ...Qv(e) });
class Ob extends Jv {
  constructor() {
    (super(...arguments), (this._unknown = !0));
  }
  _parse(e) {
    return Uv(e.data);
  }
}
Ob.create = (e) => new Ob({ typeName: ay.ZodUnknown, ...Qv(e) });
class Mb extends Jv {
  _parse(e) {
    const t = this._getOrReturnCtx(e);
    return (Vv(t, { code: Pv.invalid_type, expected: Mv.never, received: t.parsedType }), Hv);
  }
}
Mb.create = (e) => new Mb({ typeName: ay.ZodNever, ...Qv(e) });
class Ab extends Jv {
  _parse(e) {
    if (this._getType(e) !== Mv.undefined) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.void, received: t.parsedType }), Hv);
    }
    return Uv(e.data);
  }
}
Ab.create = (e) => new Ab({ typeName: ay.ZodVoid, ...Qv(e) });
class Pb extends Jv {
  _parse(e) {
    const { ctx: t, status: n } = this._processInputParams(e),
      i = this._def;
    if (t.parsedType !== Mv.array)
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.array, received: t.parsedType }), Hv);
    if (null !== i.exactLength) {
      const e = t.data.length > i.exactLength.value,
        r = t.data.length < i.exactLength.value;
      (e || r) &&
        (Vv(t, {
          code: e ? Pv.too_big : Pv.too_small,
          minimum: r ? i.exactLength.value : void 0,
          maximum: e ? i.exactLength.value : void 0,
          type: "array",
          inclusive: !0,
          exact: !0,
          message: i.exactLength.message,
        }),
        n.dirty());
    }
    if (
      (null !== i.minLength &&
        t.data.length < i.minLength.value &&
        (Vv(t, {
          code: Pv.too_small,
          minimum: i.minLength.value,
          type: "array",
          inclusive: !0,
          exact: !1,
          message: i.minLength.message,
        }),
        n.dirty()),
      null !== i.maxLength &&
        t.data.length > i.maxLength.value &&
        (Vv(t, {
          code: Pv.too_big,
          maximum: i.maxLength.value,
          type: "array",
          inclusive: !0,
          exact: !1,
          message: i.maxLength.message,
        }),
        n.dirty()),
      t.common.async)
    )
      return Promise.all(
        [...t.data].map((e, n) => i.type._parseAsync(new Yv(t, e, t.path, n))),
      ).then((e) => Wv.mergeArray(n, e));
    const r = [...t.data].map((e, n) => i.type._parseSync(new Yv(t, e, t.path, n)));
    return Wv.mergeArray(n, r);
  }
  get element() {
    return this._def.type;
  }
  min(e, t) {
    return new Pb({ ...this._def, minLength: { value: e, message: Zv.toString(t) } });
  }
  max(e, t) {
    return new Pb({ ...this._def, maxLength: { value: e, message: Zv.toString(t) } });
  }
  length(e, t) {
    return new Pb({ ...this._def, exactLength: { value: e, message: Zv.toString(t) } });
  }
  nonempty(e) {
    return this.min(1, e);
  }
}
function jb(e) {
  if (e instanceof Fb) {
    const t = {};
    for (const n in e.shape) {
      const i = e.shape[n];
      t[n] = Jb.create(jb(i));
    }
    return new Fb({ ...e._def, shape: () => t });
  }
  return e instanceof Pb
    ? new Pb({ ...e._def, type: jb(e.element) })
    : e instanceof Jb
      ? Jb.create(jb(e.unwrap()))
      : e instanceof ey
        ? ey.create(jb(e.unwrap()))
        : e instanceof Hb
          ? Hb.create(e.items.map((e) => jb(e)))
          : e;
}
Pb.create = (e, t) =>
  new Pb({
    type: e,
    minLength: null,
    maxLength: null,
    exactLength: null,
    typeName: ay.ZodArray,
    ...Qv(t),
  });
class Fb extends Jv {
  constructor() {
    (super(...arguments),
      (this._cached = null),
      (this.nonstrict = this.passthrough),
      (this.augment = this.extend));
  }
  _getCached() {
    if (null !== this._cached) return this._cached;
    const e = this._def.shape(),
      t = Tv.objectKeys(e);
    return ((this._cached = { shape: e, keys: t }), this._cached);
  }
  _parse(e) {
    if (this._getType(e) !== Mv.object) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.object, received: t.parsedType }), Hv);
    }
    const { status: t, ctx: n } = this._processInputParams(e),
      { shape: i, keys: r } = this._getCached(),
      o = [];
    if (!(this._def.catchall instanceof Mb && "strip" === this._def.unknownKeys))
      for (const a in n.data) r.includes(a) || o.push(a);
    const s = [];
    for (const a of r) {
      const e = i[a],
        t = n.data[a];
      s.push({
        key: { status: "valid", value: a },
        value: e._parse(new Yv(n, t, n.path, a)),
        alwaysSet: a in n.data,
      });
    }
    if (this._def.catchall instanceof Mb) {
      const e = this._def.unknownKeys;
      if ("passthrough" === e)
        for (const t of o)
          s.push({
            key: { status: "valid", value: t },
            value: { status: "valid", value: n.data[t] },
          });
      else if ("strict" === e)
        o.length > 0 && (Vv(n, { code: Pv.unrecognized_keys, keys: o }), t.dirty());
      else if ("strip" !== e)
        throw new Error("Internal ZodObject error: invalid unknownKeys value.");
    } else {
      const e = this._def.catchall;
      for (const t of o) {
        const i = n.data[t];
        s.push({
          key: { status: "valid", value: t },
          value: e._parse(new Yv(n, i, n.path, t)),
          alwaysSet: t in n.data,
        });
      }
    }
    return n.common.async
      ? Promise.resolve()
          .then(async () => {
            const e = [];
            for (const t of s) {
              const n = await t.key,
                i = await t.value;
              e.push({ key: n, value: i, alwaysSet: t.alwaysSet });
            }
            return e;
          })
          .then((e) => Wv.mergeObjectSync(t, e))
      : Wv.mergeObjectSync(t, s);
  }
  get shape() {
    return this._def.shape();
  }
  strict(e) {
    return (
      Zv.errToObj,
      new Fb({
        ...this._def,
        unknownKeys: "strict",
        ...(void 0 !== e
          ? {
              errorMap: (t, n) => {
                const i = this._def.errorMap?.(t, n).message ?? n.defaultError;
                return "unrecognized_keys" === t.code
                  ? { message: Zv.errToObj(e).message ?? i }
                  : { message: i };
              },
            }
          : {}),
      })
    );
  }
  strip() {
    return new Fb({ ...this._def, unknownKeys: "strip" });
  }
  passthrough() {
    return new Fb({ ...this._def, unknownKeys: "passthrough" });
  }
  extend(e) {
    return new Fb({ ...this._def, shape: () => ({ ...this._def.shape(), ...e }) });
  }
  merge(e) {
    return new Fb({
      unknownKeys: e._def.unknownKeys,
      catchall: e._def.catchall,
      shape: () => ({ ...this._def.shape(), ...e._def.shape() }),
      typeName: ay.ZodObject,
    });
  }
  setKey(e, t) {
    return this.augment({ [e]: t });
  }
  catchall(e) {
    return new Fb({ ...this._def, catchall: e });
  }
  pick(e) {
    const t = {};
    for (const n of Tv.objectKeys(e)) e[n] && this.shape[n] && (t[n] = this.shape[n]);
    return new Fb({ ...this._def, shape: () => t });
  }
  omit(e) {
    const t = {};
    for (const n of Tv.objectKeys(this.shape)) e[n] || (t[n] = this.shape[n]);
    return new Fb({ ...this._def, shape: () => t });
  }
  deepPartial() {
    return jb(this);
  }
  partial(e) {
    const t = {};
    for (const n of Tv.objectKeys(this.shape)) {
      const i = this.shape[n];
      e && !e[n] ? (t[n] = i) : (t[n] = i.optional());
    }
    return new Fb({ ...this._def, shape: () => t });
  }
  required(e) {
    const t = {};
    for (const n of Tv.objectKeys(this.shape))
      if (e && !e[n]) t[n] = this.shape[n];
      else {
        let e = this.shape[n];
        for (; e instanceof Jb; ) e = e._def.innerType;
        t[n] = e;
      }
    return new Fb({ ...this._def, shape: () => t });
  }
  keyof() {
    return Gb(Tv.objectKeys(this.shape));
  }
}
((Fb.create = (e, t) =>
  new Fb({
    shape: () => e,
    unknownKeys: "strip",
    catchall: Mb.create(),
    typeName: ay.ZodObject,
    ...Qv(t),
  })),
  (Fb.strictCreate = (e, t) =>
    new Fb({
      shape: () => e,
      unknownKeys: "strict",
      catchall: Mb.create(),
      typeName: ay.ZodObject,
      ...Qv(t),
    })),
  (Fb.lazycreate = (e, t) =>
    new Fb({
      shape: e,
      unknownKeys: "strip",
      catchall: Mb.create(),
      typeName: ay.ZodObject,
      ...Qv(t),
    })));
class Bb extends Jv {
  _parse(e) {
    const { ctx: t } = this._processInputParams(e),
      n = this._def.options;
    if (t.common.async)
      return Promise.all(
        n.map(async (e) => {
          const n = { ...t, common: { ...t.common, issues: [] }, parent: null };
          return { result: await e._parseAsync({ data: t.data, path: t.path, parent: n }), ctx: n };
        }),
      ).then(function (e) {
        for (const t of e) if ("valid" === t.result.status) return t.result;
        for (const i of e)
          if ("dirty" === i.result.status)
            return (t.common.issues.push(...i.ctx.common.issues), i.result);
        const n = e.map((e) => new jv(e.ctx.common.issues));
        return (Vv(t, { code: Pv.invalid_union, unionErrors: n }), Hv);
      });
    {
      let e;
      const i = [];
      for (const o of n) {
        const n = { ...t, common: { ...t.common, issues: [] }, parent: null },
          r = o._parseSync({ data: t.data, path: t.path, parent: n });
        if ("valid" === r.status) return r;
        ("dirty" !== r.status || e || (e = { result: r, ctx: n }),
          n.common.issues.length && i.push(n.common.issues));
      }
      if (e) return (t.common.issues.push(...e.ctx.common.issues), e.result);
      const r = i.map((e) => new jv(e));
      return (Vv(t, { code: Pv.invalid_union, unionErrors: r }), Hv);
    }
  }
  get options() {
    return this._def.options;
  }
}
function Vb(e, t) {
  const n = Av(e),
    i = Av(t);
  if (e === t) return { valid: !0, data: e };
  if (n === Mv.object && i === Mv.object) {
    const n = Tv.objectKeys(t),
      i = Tv.objectKeys(e).filter((e) => -1 !== n.indexOf(e)),
      r = { ...e, ...t };
    for (const o of i) {
      const n = Vb(e[o], t[o]);
      if (!n.valid) return { valid: !1 };
      r[o] = n.data;
    }
    return { valid: !0, data: r };
  }
  if (n === Mv.array && i === Mv.array) {
    if (e.length !== t.length) return { valid: !1 };
    const n = [];
    for (let i = 0; i < e.length; i++) {
      const r = Vb(e[i], t[i]);
      if (!r.valid) return { valid: !1 };
      n.push(r.data);
    }
    return { valid: !0, data: n };
  }
  return n === Mv.date && i === Mv.date && +e === +t ? { valid: !0, data: e } : { valid: !1 };
}
Bb.create = (e, t) => new Bb({ options: e, typeName: ay.ZodUnion, ...Qv(t) });
class Wb extends Jv {
  _parse(e) {
    const { status: t, ctx: n } = this._processInputParams(e),
      i = (e, i) => {
        if ($v(e) || $v(i)) return Hv;
        const r = Vb(e.value, i.value);
        return r.valid
          ? ((qv(e) || qv(i)) && t.dirty(), { status: t.value, value: r.data })
          : (Vv(n, { code: Pv.invalid_intersection_types }), Hv);
      };
    return n.common.async
      ? Promise.all([
          this._def.left._parseAsync({ data: n.data, path: n.path, parent: n }),
          this._def.right._parseAsync({ data: n.data, path: n.path, parent: n }),
        ]).then(([e, t]) => i(e, t))
      : i(
          this._def.left._parseSync({ data: n.data, path: n.path, parent: n }),
          this._def.right._parseSync({ data: n.data, path: n.path, parent: n }),
        );
  }
}
Wb.create = (e, t, n) => new Wb({ left: e, right: t, typeName: ay.ZodIntersection, ...Qv(n) });
class Hb extends Jv {
  _parse(e) {
    const { status: t, ctx: n } = this._processInputParams(e);
    if (n.parsedType !== Mv.array)
      return (Vv(n, { code: Pv.invalid_type, expected: Mv.array, received: n.parsedType }), Hv);
    if (n.data.length < this._def.items.length)
      return (
        Vv(n, {
          code: Pv.too_small,
          minimum: this._def.items.length,
          inclusive: !0,
          exact: !1,
          type: "array",
        }),
        Hv
      );
    !this._def.rest &&
      n.data.length > this._def.items.length &&
      (Vv(n, {
        code: Pv.too_big,
        maximum: this._def.items.length,
        inclusive: !0,
        exact: !1,
        type: "array",
      }),
      t.dirty());
    const i = [...n.data]
      .map((e, t) => {
        const i = this._def.items[t] || this._def.rest;
        return i ? i._parse(new Yv(n, e, n.path, t)) : null;
      })
      .filter((e) => !!e);
    return n.common.async ? Promise.all(i).then((e) => Wv.mergeArray(t, e)) : Wv.mergeArray(t, i);
  }
  get items() {
    return this._def.items;
  }
  rest(e) {
    return new Hb({ ...this._def, rest: e });
  }
}
Hb.create = (e, t) => {
  if (!Array.isArray(e)) throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
  return new Hb({ items: e, typeName: ay.ZodTuple, rest: null, ...Qv(t) });
};
class zb extends Jv {
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(e) {
    const { status: t, ctx: n } = this._processInputParams(e);
    if (n.parsedType !== Mv.object)
      return (Vv(n, { code: Pv.invalid_type, expected: Mv.object, received: n.parsedType }), Hv);
    const i = [],
      r = this._def.keyType,
      o = this._def.valueType;
    for (const s in n.data)
      i.push({
        key: r._parse(new Yv(n, s, n.path, s)),
        value: o._parse(new Yv(n, n.data[s], n.path, s)),
        alwaysSet: s in n.data,
      });
    return n.common.async ? Wv.mergeObjectAsync(t, i) : Wv.mergeObjectSync(t, i);
  }
  get element() {
    return this._def.valueType;
  }
  static create(e, t, n) {
    return new zb(
      t instanceof Jv
        ? { keyType: e, valueType: t, typeName: ay.ZodRecord, ...Qv(n) }
        : { keyType: Cb.create(), valueType: e, typeName: ay.ZodRecord, ...Qv(t) },
    );
  }
}
class Ub extends Jv {
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(e) {
    const { status: t, ctx: n } = this._processInputParams(e);
    if (n.parsedType !== Mv.map)
      return (Vv(n, { code: Pv.invalid_type, expected: Mv.map, received: n.parsedType }), Hv);
    const i = this._def.keyType,
      r = this._def.valueType,
      o = [...n.data.entries()].map(([e, t], o) => ({
        key: i._parse(new Yv(n, e, n.path, [o, "key"])),
        value: r._parse(new Yv(n, t, n.path, [o, "value"])),
      }));
    if (n.common.async) {
      const e = new Map();
      return Promise.resolve().then(async () => {
        for (const n of o) {
          const i = await n.key,
            r = await n.value;
          if ("aborted" === i.status || "aborted" === r.status) return Hv;
          (("dirty" !== i.status && "dirty" !== r.status) || t.dirty(), e.set(i.value, r.value));
        }
        return { status: t.value, value: e };
      });
    }
    {
      const e = new Map();
      for (const n of o) {
        const i = n.key,
          r = n.value;
        if ("aborted" === i.status || "aborted" === r.status) return Hv;
        (("dirty" !== i.status && "dirty" !== r.status) || t.dirty(), e.set(i.value, r.value));
      }
      return { status: t.value, value: e };
    }
  }
}
Ub.create = (e, t, n) => new Ub({ valueType: t, keyType: e, typeName: ay.ZodMap, ...Qv(n) });
class $b extends Jv {
  _parse(e) {
    const { status: t, ctx: n } = this._processInputParams(e);
    if (n.parsedType !== Mv.set)
      return (Vv(n, { code: Pv.invalid_type, expected: Mv.set, received: n.parsedType }), Hv);
    const i = this._def;
    (null !== i.minSize &&
      n.data.size < i.minSize.value &&
      (Vv(n, {
        code: Pv.too_small,
        minimum: i.minSize.value,
        type: "set",
        inclusive: !0,
        exact: !1,
        message: i.minSize.message,
      }),
      t.dirty()),
      null !== i.maxSize &&
        n.data.size > i.maxSize.value &&
        (Vv(n, {
          code: Pv.too_big,
          maximum: i.maxSize.value,
          type: "set",
          inclusive: !0,
          exact: !1,
          message: i.maxSize.message,
        }),
        t.dirty()));
    const r = this._def.valueType;
    function o(e) {
      const n = new Set();
      for (const i of e) {
        if ("aborted" === i.status) return Hv;
        ("dirty" === i.status && t.dirty(), n.add(i.value));
      }
      return { status: t.value, value: n };
    }
    const s = [...n.data.values()].map((e, t) => r._parse(new Yv(n, e, n.path, t)));
    return n.common.async ? Promise.all(s).then((e) => o(e)) : o(s);
  }
  min(e, t) {
    return new $b({ ...this._def, minSize: { value: e, message: Zv.toString(t) } });
  }
  max(e, t) {
    return new $b({ ...this._def, maxSize: { value: e, message: Zv.toString(t) } });
  }
  size(e, t) {
    return this.min(e, t).max(e, t);
  }
  nonempty(e) {
    return this.min(1, e);
  }
}
$b.create = (e, t) =>
  new $b({ valueType: e, minSize: null, maxSize: null, typeName: ay.ZodSet, ...Qv(t) });
class qb extends Jv {
  get schema() {
    return this._def.getter();
  }
  _parse(e) {
    const { ctx: t } = this._processInputParams(e);
    return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
  }
}
qb.create = (e, t) => new qb({ getter: e, typeName: ay.ZodLazy, ...Qv(t) });
class Kb extends Jv {
  _parse(e) {
    if (e.data !== this._def.value) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { received: t.data, code: Pv.invalid_literal, expected: this._def.value }), Hv);
    }
    return { status: "valid", value: e.data };
  }
  get value() {
    return this._def.value;
  }
}
function Gb(e, t) {
  return new Zb({ values: e, typeName: ay.ZodEnum, ...Qv(t) });
}
Kb.create = (e, t) => new Kb({ value: e, typeName: ay.ZodLiteral, ...Qv(t) });
class Zb extends Jv {
  _parse(e) {
    if ("string" != typeof e.data) {
      const t = this._getOrReturnCtx(e),
        n = this._def.values;
      return (
        Vv(t, { expected: Tv.joinValues(n), received: t.parsedType, code: Pv.invalid_type }),
        Hv
      );
    }
    if ((this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data))) {
      const t = this._getOrReturnCtx(e),
        n = this._def.values;
      return (Vv(t, { received: t.data, code: Pv.invalid_enum_value, options: n }), Hv);
    }
    return Uv(e.data);
  }
  get options() {
    return this._def.values;
  }
  get enum() {
    const e = {};
    for (const t of this._def.values) e[t] = t;
    return e;
  }
  get Values() {
    const e = {};
    for (const t of this._def.values) e[t] = t;
    return e;
  }
  get Enum() {
    const e = {};
    for (const t of this._def.values) e[t] = t;
    return e;
  }
  extract(e, t = this._def) {
    return Zb.create(e, { ...this._def, ...t });
  }
  exclude(e, t = this._def) {
    return Zb.create(
      this.options.filter((t) => !e.includes(t)),
      { ...this._def, ...t },
    );
  }
}
Zb.create = Gb;
class Yb extends Jv {
  _parse(e) {
    const t = Tv.getValidEnumValues(this._def.values),
      n = this._getOrReturnCtx(e);
    if (n.parsedType !== Mv.string && n.parsedType !== Mv.number) {
      const e = Tv.objectValues(t);
      return (
        Vv(n, { expected: Tv.joinValues(e), received: n.parsedType, code: Pv.invalid_type }),
        Hv
      );
    }
    if (
      (this._cache || (this._cache = new Set(Tv.getValidEnumValues(this._def.values))),
      !this._cache.has(e.data))
    ) {
      const e = Tv.objectValues(t);
      return (Vv(n, { received: n.data, code: Pv.invalid_enum_value, options: e }), Hv);
    }
    return Uv(e.data);
  }
  get enum() {
    return this._def.values;
  }
}
Yb.create = (e, t) => new Yb({ values: e, typeName: ay.ZodNativeEnum, ...Qv(t) });
class Xb extends Jv {
  unwrap() {
    return this._def.type;
  }
  _parse(e) {
    const { ctx: t } = this._processInputParams(e);
    if (t.parsedType !== Mv.promise && !1 === t.common.async)
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.promise, received: t.parsedType }), Hv);
    const n = t.parsedType === Mv.promise ? t.data : Promise.resolve(t.data);
    return Uv(
      n.then((e) =>
        this._def.type.parseAsync(e, { path: t.path, errorMap: t.common.contextualErrorMap }),
      ),
    );
  }
}
Xb.create = (e, t) => new Xb({ type: e, typeName: ay.ZodPromise, ...Qv(t) });
class Qb extends Jv {
  innerType() {
    return this._def.schema;
  }
  sourceType() {
    return this._def.schema._def.typeName === ay.ZodEffects
      ? this._def.schema.sourceType()
      : this._def.schema;
  }
  _parse(e) {
    const { status: t, ctx: n } = this._processInputParams(e),
      i = this._def.effect || null,
      r = {
        addIssue: (e) => {
          (Vv(n, e), e.fatal ? t.abort() : t.dirty());
        },
        get path() {
          return n.path;
        },
      };
    if (((r.addIssue = r.addIssue.bind(r)), "preprocess" === i.type)) {
      const e = i.transform(n.data, r);
      if (n.common.async)
        return Promise.resolve(e).then(async (e) => {
          if ("aborted" === t.value) return Hv;
          const i = await this._def.schema._parseAsync({ data: e, path: n.path, parent: n });
          return "aborted" === i.status
            ? Hv
            : "dirty" === i.status || "dirty" === t.value
              ? zv(i.value)
              : i;
        });
      {
        if ("aborted" === t.value) return Hv;
        const i = this._def.schema._parseSync({ data: e, path: n.path, parent: n });
        return "aborted" === i.status
          ? Hv
          : "dirty" === i.status || "dirty" === t.value
            ? zv(i.value)
            : i;
      }
    }
    if ("refinement" === i.type) {
      const e = (e) => {
        const t = i.refinement(e, r);
        if (n.common.async) return Promise.resolve(t);
        if (t instanceof Promise)
          throw new Error(
            "Async refinement encountered during synchronous parse operation. Use .parseAsync instead.",
          );
        return e;
      };
      if (!1 === n.common.async) {
        const i = this._def.schema._parseSync({ data: n.data, path: n.path, parent: n });
        return "aborted" === i.status
          ? Hv
          : ("dirty" === i.status && t.dirty(), e(i.value), { status: t.value, value: i.value });
      }
      return this._def.schema
        ._parseAsync({ data: n.data, path: n.path, parent: n })
        .then((n) =>
          "aborted" === n.status
            ? Hv
            : ("dirty" === n.status && t.dirty(),
              e(n.value).then(() => ({ status: t.value, value: n.value }))),
        );
    }
    if ("transform" === i.type) {
      if (!1 === n.common.async) {
        const e = this._def.schema._parseSync({ data: n.data, path: n.path, parent: n });
        if (!Kv(e)) return Hv;
        const o = i.transform(e.value, r);
        if (o instanceof Promise)
          throw new Error(
            "Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.",
          );
        return { status: t.value, value: o };
      }
      return this._def.schema
        ._parseAsync({ data: n.data, path: n.path, parent: n })
        .then((e) =>
          Kv(e)
            ? Promise.resolve(i.transform(e.value, r)).then((e) => ({ status: t.value, value: e }))
            : Hv,
        );
    }
    Tv.assertNever(i);
  }
}
((Qb.create = (e, t, n) => new Qb({ schema: e, typeName: ay.ZodEffects, effect: t, ...Qv(n) })),
  (Qb.createWithPreprocess = (e, t, n) =>
    new Qb({
      schema: t,
      effect: { type: "preprocess", transform: e },
      typeName: ay.ZodEffects,
      ...Qv(n),
    })));
class Jb extends Jv {
  _parse(e) {
    return this._getType(e) === Mv.undefined ? Uv(void 0) : this._def.innerType._parse(e);
  }
  unwrap() {
    return this._def.innerType;
  }
}
Jb.create = (e, t) => new Jb({ innerType: e, typeName: ay.ZodOptional, ...Qv(t) });
class ey extends Jv {
  _parse(e) {
    return this._getType(e) === Mv.null ? Uv(null) : this._def.innerType._parse(e);
  }
  unwrap() {
    return this._def.innerType;
  }
}
ey.create = (e, t) => new ey({ innerType: e, typeName: ay.ZodNullable, ...Qv(t) });
class ty extends Jv {
  _parse(e) {
    const { ctx: t } = this._processInputParams(e);
    let n = t.data;
    return (
      t.parsedType === Mv.undefined && (n = this._def.defaultValue()),
      this._def.innerType._parse({ data: n, path: t.path, parent: t })
    );
  }
  removeDefault() {
    return this._def.innerType;
  }
}
ty.create = (e, t) =>
  new ty({
    innerType: e,
    typeName: ay.ZodDefault,
    defaultValue: "function" == typeof t.default ? t.default : () => t.default,
    ...Qv(t),
  });
class ny extends Jv {
  _parse(e) {
    const { ctx: t } = this._processInputParams(e),
      n = { ...t, common: { ...t.common, issues: [] } },
      i = this._def.innerType._parse({ data: n.data, path: n.path, parent: { ...n } });
    return Gv(i)
      ? i.then((e) => ({
          status: "valid",
          value:
            "valid" === e.status
              ? e.value
              : this._def.catchValue({
                  get error() {
                    return new jv(n.common.issues);
                  },
                  input: n.data,
                }),
        }))
      : {
          status: "valid",
          value:
            "valid" === i.status
              ? i.value
              : this._def.catchValue({
                  get error() {
                    return new jv(n.common.issues);
                  },
                  input: n.data,
                }),
        };
  }
  removeCatch() {
    return this._def.innerType;
  }
}
ny.create = (e, t) =>
  new ny({
    innerType: e,
    typeName: ay.ZodCatch,
    catchValue: "function" == typeof t.catch ? t.catch : () => t.catch,
    ...Qv(t),
  });
class iy extends Jv {
  _parse(e) {
    if (this._getType(e) !== Mv.nan) {
      const t = this._getOrReturnCtx(e);
      return (Vv(t, { code: Pv.invalid_type, expected: Mv.nan, received: t.parsedType }), Hv);
    }
    return { status: "valid", value: e.data };
  }
}
iy.create = (e) => new iy({ typeName: ay.ZodNaN, ...Qv(e) });
class ry extends Jv {
  _parse(e) {
    const { ctx: t } = this._processInputParams(e),
      n = t.data;
    return this._def.type._parse({ data: n, path: t.path, parent: t });
  }
  unwrap() {
    return this._def.type;
  }
}
class oy extends Jv {
  _parse(e) {
    const { status: t, ctx: n } = this._processInputParams(e);
    if (n.common.async) {
      return (async () => {
        const e = await this._def.in._parseAsync({ data: n.data, path: n.path, parent: n });
        return "aborted" === e.status
          ? Hv
          : "dirty" === e.status
            ? (t.dirty(), zv(e.value))
            : this._def.out._parseAsync({ data: e.value, path: n.path, parent: n });
      })();
    }
    {
      const e = this._def.in._parseSync({ data: n.data, path: n.path, parent: n });
      return "aborted" === e.status
        ? Hv
        : "dirty" === e.status
          ? (t.dirty(), { status: "dirty", value: e.value })
          : this._def.out._parseSync({ data: e.value, path: n.path, parent: n });
    }
  }
  static create(e, t) {
    return new oy({ in: e, out: t, typeName: ay.ZodPipeline });
  }
}
class sy extends Jv {
  _parse(e) {
    const t = this._def.innerType._parse(e),
      n = (e) => (Kv(e) && (e.value = Object.freeze(e.value)), e);
    return Gv(t) ? t.then((e) => n(e)) : n(t);
  }
  unwrap() {
    return this._def.innerType;
  }
}
var ay;
((sy.create = (e, t) => new sy({ innerType: e, typeName: ay.ZodReadonly, ...Qv(t) })),
  (function (e) {
    ((e.ZodString = "ZodString"),
      (e.ZodNumber = "ZodNumber"),
      (e.ZodNaN = "ZodNaN"),
      (e.ZodBigInt = "ZodBigInt"),
      (e.ZodBoolean = "ZodBoolean"),
      (e.ZodDate = "ZodDate"),
      (e.ZodSymbol = "ZodSymbol"),
      (e.ZodUndefined = "ZodUndefined"),
      (e.ZodNull = "ZodNull"),
      (e.ZodAny = "ZodAny"),
      (e.ZodUnknown = "ZodUnknown"),
      (e.ZodNever = "ZodNever"),
      (e.ZodVoid = "ZodVoid"),
      (e.ZodArray = "ZodArray"),
      (e.ZodObject = "ZodObject"),
      (e.ZodUnion = "ZodUnion"),
      (e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion"),
      (e.ZodIntersection = "ZodIntersection"),
      (e.ZodTuple = "ZodTuple"),
      (e.ZodRecord = "ZodRecord"),
      (e.ZodMap = "ZodMap"),
      (e.ZodSet = "ZodSet"),
      (e.ZodFunction = "ZodFunction"),
      (e.ZodLazy = "ZodLazy"),
      (e.ZodLiteral = "ZodLiteral"),
      (e.ZodEnum = "ZodEnum"),
      (e.ZodEffects = "ZodEffects"),
      (e.ZodNativeEnum = "ZodNativeEnum"),
      (e.ZodOptional = "ZodOptional"),
      (e.ZodNullable = "ZodNullable"),
      (e.ZodDefault = "ZodDefault"),
      (e.ZodCatch = "ZodCatch"),
      (e.ZodPromise = "ZodPromise"),
      (e.ZodBranded = "ZodBranded"),
      (e.ZodPipeline = "ZodPipeline"),
      (e.ZodReadonly = "ZodReadonly"));
  })(ay || (ay = {})));
const ly = Cb.create,
  cy = kb.create;
Eb.create;
const dy = Nb.create;
Lb.create;
const uy = Rb.create;
Mb.create;
const hy = Pb.create,
  gy = Fb.create,
  py = Bb.create;
(Wb.create, Hb.create);
const fy = zb.create,
  my = Zb.create,
  _y = Yb.create;
(Xb.create, Jb.create, ey.create);
const vy = (e) => Cb.create({ ...e, coerce: !0 }),
  by = (e) => kb.create({ ...e, coerce: !0 }),
  yy = (e) => Nb.create({ ...e, coerce: !0 }),
  xy = {},
  wy = (e, t, n, i) => {
    (Ey(n) && xy[n]) ||
      (Ey(n) && (xy[n] = new Date()),
      ((e, t, n, i) => {
        const r = [n, { code: t, ...(i || {}) }];
        if (e?.services?.logger?.forward)
          return e.services.logger.forward(r, "warn", "react-i18next::", !0);
        (Ey(r[0]) && (r[0] = `react-i18next:: ${r[0]}`),
          e?.services?.logger?.warn ? e.services.logger.warn(...r) : console);
      })(e, t, n, i));
  },
  Cy = (e, t) => () => {
    if (e.isInitialized) t();
    else {
      const n = () => {
        (setTimeout(() => {
          e.off("initialized", n);
        }, 0),
          t());
      };
      e.on("initialized", n);
    }
  },
  Sy = (e, t, n) => {
    e.loadNamespaces(t, Cy(e, n));
  },
  ky = (e, t, n, i) => {
    if ((Ey(n) && (n = [n]), e.options.preload && e.options.preload.indexOf(t) > -1))
      return Sy(e, n, i);
    (n.forEach((t) => {
      e.options.ns.indexOf(t) < 0 && e.options.ns.push(t);
    }),
      e.loadLanguages(t, Cy(e, i)));
  },
  Ey = (e) => "string" == typeof e,
  Ny =
    /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,
  Ly = {
    "&amp;": "&",
    "&#38;": "&",
    "&lt;": "<",
    "&#60;": "<",
    "&gt;": ">",
    "&#62;": ">",
    "&apos;": "'",
    "&#39;": "'",
    "&quot;": '"',
    "&#34;": '"',
    "&nbsp;": " ",
    "&#160;": " ",
    "&copy;": "©",
    "&#169;": "©",
    "&reg;": "®",
    "&#174;": "®",
    "&hellip;": "…",
    "&#8230;": "…",
    "&#x2F;": "/",
    "&#47;": "/",
  },
  Dy = (e) => Ly[e];
let Ty = {
  bindI18n: "languageChanged",
  bindI18nStore: "",
  transEmptyNodeValue: "",
  transSupportBasicHtmlNodes: !0,
  transWrapTextNodes: "",
  transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
  useSuspense: !0,
  unescape: (e) => e.replace(Ny, Dy),
};
let Iy;
const Ry = {
    type: "3rdParty",
    init(e) {
      (((e = {}) => {
        Ty = { ...Ty, ...e };
      })(e.options.react),
        ((e) => {
          Iy = e;
        })(e));
    },
  },
  Oy = H.createContext();
class My {
  constructor() {
    this.usedNamespaces = {};
  }
  addUsedNamespaces(e) {
    e.forEach((e) => {
      this.usedNamespaces[e] || (this.usedNamespaces[e] = !0);
    });
  }
  getUsedNamespaces() {
    return Object.keys(this.usedNamespaces);
  }
}
const Ay = (e, t, n, i) => e.getFixedT(t, n, i),
  Py = (e, t = {}) => {
    const { i18n: n } = t,
      { i18n: i, defaultNS: r } = H.useContext(Oy) || {},
      o = n || i || Iy;
    if ((o && !o.reportNamespaces && (o.reportNamespaces = new My()), !o)) {
      wy(
        o,
        "NO_I18NEXT_INSTANCE",
        "useTranslation: You will need to pass in an i18next instance by using initReactI18next",
      );
      const e = (e, t) => {
          return Ey(t)
            ? t
            : "object" == typeof (n = t) && null !== n && Ey(t.defaultValue)
              ? t.defaultValue
              : Array.isArray(e)
                ? e[e.length - 1]
                : e;
          var n;
        },
        t = [e, {}, !1];
      return ((t.t = e), (t.i18n = {}), (t.ready = !1), t);
    }
    o.options.react?.wait &&
      wy(
        o,
        "DEPRECATED_OPTION",
        "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.",
      );
    const s = { ...Ty, ...o.options.react, ...t },
      { useSuspense: a, keyPrefix: l } = s;
    let c = e || r || o.options?.defaultNS;
    ((c = Ey(c) ? [c] : c || ["translation"]), o.reportNamespaces.addUsedNamespaces?.(c));
    const d =
        (o.isInitialized || o.initializedStoreOnce) &&
        c.every((e) =>
          ((e, t, n = {}) =>
            t.languages && t.languages.length
              ? t.hasLoadedNamespace(e, {
                  lng: n.lng,
                  precheck: (t, i) => {
                    if (
                      n.bindI18n &&
                      n.bindI18n.indexOf("languageChanging") > -1 &&
                      t.services.backendConnector.backend &&
                      t.isLanguageChangingTo &&
                      !i(t.isLanguageChangingTo, e)
                    )
                      return !1;
                  },
                })
              : (wy(t, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
                  languages: t.languages,
                }),
                !0))(e, o, s),
        ),
      u = ((e, t, n, i) => H.useCallback(Ay(e, t, n, i), [e, t, n, i]))(
        o,
        t.lng || null,
        "fallback" === s.nsMode ? c : c[0],
        l,
      ),
      h = () => u,
      g = () => Ay(o, t.lng || null, "fallback" === s.nsMode ? c : c[0], l),
      [p, f] = H.useState(h);
    let m = c.join();
    t.lng && (m = `${t.lng}${m}`);
    const _ = ((e, t) => {
        const n = H.useRef();
        return (
          H.useEffect(() => {
            n.current = e;
          }, [e, t]),
          n.current
        );
      })(m),
      v = H.useRef(!0);
    (H.useEffect(() => {
      const { bindI18n: e, bindI18nStore: n } = s;
      ((v.current = !0),
        d ||
          a ||
          (t.lng
            ? ky(o, t.lng, c, () => {
                v.current && f(g);
              })
            : Sy(o, c, () => {
                v.current && f(g);
              })),
        d && _ && _ !== m && v.current && f(g));
      const i = () => {
        v.current && f(g);
      };
      return (
        e && o?.on(e, i),
        n && o?.store.on(n, i),
        () => {
          ((v.current = !1),
            o && e && e?.split(" ").forEach((e) => o.off(e, i)),
            n && o && n.split(" ").forEach((e) => o.store.off(e, i)));
        }
      );
    }, [o, m]),
      H.useEffect(() => {
        v.current && d && f(h);
      }, [o, l, d]));
    const b = [p, o, d];
    if (((b.t = p), (b.i18n = o), (b.ready = d), d)) return b;
    if (!d && !a) return b;
    throw new Promise((e) => {
      t.lng ? ky(o, t.lng, c, () => e()) : Sy(o, c, () => e());
    });
  };
var jy = [
    "a",
    "button",
    "div",
    "form",
    "h2",
    "h3",
    "img",
    "input",
    "label",
    "li",
    "nav",
    "ol",
    "p",
    "select",
    "span",
    "svg",
    "ul",
  ].reduce((e, t) => {
    const n = Lp(`Primitive.${t}`),
      i = H.forwardRef((e, i) => {
        const { asChild: r, ...o } = e,
          s = r ? n : t;
        return (
          "undefined" != typeof window && (window[Symbol.for("radix-ui")] = !0),
          Q.jsx(s, { ...o, ref: i })
        );
      });
    return ((i.displayName = `Primitive.${t}`), { ...e, [t]: i });
  }, {}),
  Fy = H.forwardRef((e, t) =>
    Q.jsx(jy.label, {
      ...e,
      ref: t,
      onMouseDown: (t) => {
        t.target.closest("button, input, select, textarea") ||
          (e.onMouseDown?.(t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
      },
    }),
  );
Fy.displayName = "Label";
var By = Fy;
const Vy = jp(
    "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
  ),
  Wy = H.forwardRef(({ className: e, ...t }, n) =>
    Q.jsx(By, { ref: n, className: Rf(Vy(), e), ...t }),
  );
Wy.displayName = By.displayName;
const Hy = (e) => {
    const { children: t, ...n } = e;
    return z.createElement(w_.Provider, { value: n }, t);
  },
  zy = H.createContext({}),
  Uy = ({ ...e }) => Q.jsx(zy.Provider, { value: { name: e.name }, children: Q.jsx(R_, { ...e }) }),
  $y = () => {
    const e = H.useContext(zy),
      t = H.useContext(qy),
      { getFieldState: n, formState: i } = C_(),
      r = n(e.name, i);
    if (!e) throw new Error("useFormField should be used within <FormField>");
    const { id: o } = t;
    return {
      id: o,
      name: e.name,
      formItemId: `${o}-form-item`,
      formDescriptionId: `${o}-form-item-description`,
      formMessageId: `${o}-form-item-message`,
      ...r,
    };
  },
  qy = H.createContext({}),
  Ky = H.forwardRef(({ className: e, ...t }, n) => {
    const i = H.useId();
    return Q.jsx(qy.Provider, {
      value: { id: i },
      children: Q.jsx("div", { ref: n, className: Rf("space-y-2", e), ...t }),
    });
  });
Ky.displayName = "FormItem";
const Gy = H.forwardRef(({ className: e, ...t }, n) => {
  const { error: i, formItemId: r } = $y();
  return Q.jsx(Wy, { ref: n, className: Rf(i && "text-destructive", e), htmlFor: r, ...t });
});
Gy.displayName = "FormLabel";
const Zy = H.forwardRef(({ ...e }, t) => {
  const { error: n, formItemId: i, formDescriptionId: r, formMessageId: o } = $y();
  return Q.jsx(Dp, {
    ref: t,
    id: i,
    "aria-describedby": n ? `${r} ${o}` : `${r}`,
    "aria-invalid": !!n,
    ...e,
  });
});
Zy.displayName = "FormControl";
const Yy = H.forwardRef(({ className: e, ...t }, n) => {
  const { formDescriptionId: i } = $y();
  return Q.jsx("p", {
    ref: n,
    id: i,
    className: Rf("text-[0.8rem] text-muted-foreground", e),
    ...t,
  });
});
Yy.displayName = "FormDescription";
const Xy = H.forwardRef(({ className: e, children: t, ...n }, i) => {
  const { error: r, formMessageId: o } = $y(),
    s = r ? String(r?.message) : t;
  return s
    ? Q.jsx("p", {
        ref: i,
        id: o,
        className: Rf("text-[0.8rem] font-medium text-destructive", e),
        ...n,
        children: s,
      })
    : null;
});
function Qy(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
  return function (i) {
    if ((e?.(i), !1 === n || !i.defaultPrevented)) return t?.(i);
  };
}
function Jy(e, t = []) {
  let n = [];
  const i = () => {
    const t = n.map((e) => H.createContext(e));
    return function (n) {
      const i = n?.[e] || t;
      return H.useMemo(() => ({ [`__scope${e}`]: { ...n, [e]: i } }), [n, i]);
    };
  };
  return (
    (i.scopeName = e),
    [
      function (t, i) {
        const r = H.createContext(i),
          o = n.length;
        n = [...n, i];
        const s = (t) => {
          const { scope: n, children: i, ...s } = t,
            a = n?.[e]?.[o] || r,
            l = H.useMemo(() => s, Object.values(s));
          return Q.jsx(a.Provider, { value: l, children: i });
        };
        return (
          (s.displayName = t + "Provider"),
          [
            s,
            function (n, s) {
              const a = s?.[e]?.[o] || r,
                l = H.useContext(a);
              if (l) return l;
              if (void 0 !== i) return i;
              throw new Error(`\`${n}\` must be used within \`${t}\``);
            },
          ]
        );
      },
      ex(i, ...t),
    ]
  );
}
function ex(...e) {
  const t = e[0];
  if (1 === e.length) return t;
  const n = () => {
    const n = e.map((e) => ({ useScope: e(), scopeName: e.scopeName }));
    return function (e) {
      const i = n.reduce(
        (t, { useScope: n, scopeName: i }) => ({ ...t, ...n(e)[`__scope${i}`] }),
        {},
      );
      return H.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
    };
  };
  return ((n.scopeName = t.scopeName), n);
}
function tx(e) {
  const t = nx(e),
    n = H.forwardRef((e, n) => {
      const { children: i, ...r } = e,
        o = H.Children.toArray(i),
        s = o.find(rx);
      if (s) {
        const e = s.props.children,
          i = o.map((t) =>
            t === s
              ? H.Children.count(e) > 1
                ? H.Children.only(null)
                : H.isValidElement(e)
                  ? e.props.children
                  : null
              : t,
          );
        return Q.jsx(t, {
          ...r,
          ref: n,
          children: H.isValidElement(e) ? H.cloneElement(e, void 0, i) : null,
        });
      }
      return Q.jsx(t, { ...r, ref: n, children: i });
    });
  return ((n.displayName = `${e}.Slot`), n);
}
function nx(e) {
  const t = H.forwardRef((e, t) => {
    const { children: n, ...i } = e;
    if (H.isValidElement(n)) {
      const e = (function (e) {
          let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get,
            n = t && "isReactWarning" in t && t.isReactWarning;
          if (n) return e.ref;
          if (
            ((t = Object.getOwnPropertyDescriptor(e, "ref")?.get),
            (n = t && "isReactWarning" in t && t.isReactWarning),
            n)
          )
            return e.props.ref;
          return e.props.ref || e.ref;
        })(n),
        r = (function (e, t) {
          const n = { ...t };
          for (const i in t) {
            const r = e[i],
              o = t[i];
            /^on[A-Z]/.test(i)
              ? r && o
                ? (n[i] = (...e) => {
                    const t = o(...e);
                    return (r(...e), t);
                  })
                : r && (n[i] = r)
              : "style" === i
                ? (n[i] = { ...r, ...o })
                : "className" === i && (n[i] = [r, o].filter(Boolean).join(" "));
          }
          return { ...e, ...n };
        })(i, n.props);
      return (n.type !== H.Fragment && (r.ref = t ? Cp(t, e) : e), H.cloneElement(n, r));
    }
    return H.Children.count(n) > 1 ? H.Children.only(null) : null;
  });
  return ((t.displayName = `${e}.SlotClone`), t);
}
Xy.displayName = "FormMessage";
var ix = Symbol("radix.slottable");
function rx(e) {
  return (
    H.isValidElement(e) &&
    "function" == typeof e.type &&
    "__radixId" in e.type &&
    e.type.__radixId === ix
  );
}
function ox(e) {
  const t = e + "CollectionProvider",
    [n, i] = Jy(t),
    [r, o] = n(t, { collectionRef: { current: null }, itemMap: new Map() }),
    s = (e) => {
      const { scope: t, children: n } = e,
        i = z.useRef(null),
        o = z.useRef(new Map()).current;
      return Q.jsx(r, { scope: t, itemMap: o, collectionRef: i, children: n });
    };
  s.displayName = t;
  const a = e + "CollectionSlot",
    l = tx(a),
    c = z.forwardRef((e, t) => {
      const { scope: n, children: i } = e,
        r = Sp(t, o(a, n).collectionRef);
      return Q.jsx(l, { ref: r, children: i });
    });
  c.displayName = a;
  const d = e + "CollectionItemSlot",
    u = "data-radix-collection-item",
    h = tx(d),
    g = z.forwardRef((e, t) => {
      const { scope: n, children: i, ...r } = e,
        s = z.useRef(null),
        a = Sp(t, s),
        l = o(d, n);
      return (
        z.useEffect(
          () => (
            l.itemMap.set(s, { ref: s, ...r }),
            () => {
              l.itemMap.delete(s);
            }
          ),
        ),
        Q.jsx(h, { [u]: "", ref: a, children: i })
      );
    });
  return (
    (g.displayName = d),
    [
      { Provider: s, Slot: c, ItemSlot: g },
      function (t) {
        const n = o(e + "CollectionConsumer", t),
          i = z.useCallback(() => {
            const e = n.collectionRef.current;
            if (!e) return [];
            const t = Array.from(e.querySelectorAll(`[${u}]`)),
              i = Array.from(n.itemMap.values()).sort(
                (e, n) => t.indexOf(e.ref.current) - t.indexOf(n.ref.current),
              );
            return i;
          }, [n.collectionRef, n.itemMap]);
        return i;
      },
      i,
    ]
  );
}
var sx = globalThis?.document ? H.useLayoutEffect : () => {},
  ax = U[" useId ".trim().toString()] || (() => {}),
  lx = 0;
function cx(e) {
  const [t, n] = H.useState(ax());
  return (
    sx(() => {
      n((e) => e ?? String(lx++));
    }, [e]),
    t ? `radix-${t}` : ""
  );
}
function dx(e) {
  const t = H.forwardRef((e, t) => {
    const { children: n, ...i } = e;
    if (H.isValidElement(n)) {
      const e = (function (e) {
          let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get,
            n = t && "isReactWarning" in t && t.isReactWarning;
          if (n) return e.ref;
          if (
            ((t = Object.getOwnPropertyDescriptor(e, "ref")?.get),
            (n = t && "isReactWarning" in t && t.isReactWarning),
            n)
          )
            return e.props.ref;
          return e.props.ref || e.ref;
        })(n),
        r = (function (e, t) {
          const n = { ...t };
          for (const i in t) {
            const r = e[i],
              o = t[i];
            /^on[A-Z]/.test(i)
              ? r && o
                ? (n[i] = (...e) => {
                    const t = o(...e);
                    return (r(...e), t);
                  })
                : r && (n[i] = r)
              : "style" === i
                ? (n[i] = { ...r, ...o })
                : "className" === i && (n[i] = [r, o].filter(Boolean).join(" "));
          }
          return { ...e, ...n };
        })(i, n.props);
      return (n.type !== H.Fragment && (r.ref = t ? Cp(t, e) : e), H.cloneElement(n, r));
    }
    return H.Children.count(n) > 1 ? H.Children.only(null) : null;
  });
  return ((t.displayName = `${e}.SlotClone`), t);
}
var ux = Symbol("radix.slottable");
function hx(e) {
  return (
    H.isValidElement(e) &&
    "function" == typeof e.type &&
    "__radixId" in e.type &&
    e.type.__radixId === ux
  );
}
var gx = [
  "a",
  "button",
  "div",
  "form",
  "h2",
  "h3",
  "img",
  "input",
  "label",
  "li",
  "nav",
  "ol",
  "p",
  "select",
  "span",
  "svg",
  "ul",
].reduce((e, t) => {
  const n = (function (e) {
      const t = dx(e),
        n = H.forwardRef((e, n) => {
          const { children: i, ...r } = e,
            o = H.Children.toArray(i),
            s = o.find(hx);
          if (s) {
            const e = s.props.children,
              i = o.map((t) =>
                t === s
                  ? H.Children.count(e) > 1
                    ? H.Children.only(null)
                    : H.isValidElement(e)
                      ? e.props.children
                      : null
                  : t,
              );
            return Q.jsx(t, {
              ...r,
              ref: n,
              children: H.isValidElement(e) ? H.cloneElement(e, void 0, i) : null,
            });
          }
          return Q.jsx(t, { ...r, ref: n, children: i });
        });
      return ((n.displayName = `${e}.Slot`), n);
    })(`Primitive.${t}`),
    i = H.forwardRef((e, i) => {
      const { asChild: r, ...o } = e,
        s = r ? n : t;
      return (
        "undefined" != typeof window && (window[Symbol.for("radix-ui")] = !0),
        Q.jsx(s, { ...o, ref: i })
      );
    });
  return ((i.displayName = `Primitive.${t}`), { ...e, [t]: i });
}, {});
function px(e, t) {
  e && ru.flushSync(() => e.dispatchEvent(t));
}
function fx(e) {
  const t = H.useRef(e);
  return (
    H.useEffect(() => {
      t.current = e;
    }),
    H.useMemo(
      () =>
        (...e) =>
          t.current?.(...e),
      [],
    )
  );
}
var mx = U[" useInsertionEffect ".trim().toString()] || sx;
function _x({ prop: e, defaultProp: t, onChange: n = () => {}, caller: i }) {
  const [r, o, s] = (function ({ defaultProp: e, onChange: t }) {
      const [n, i] = H.useState(e),
        r = H.useRef(n),
        o = H.useRef(t);
      return (
        mx(() => {
          o.current = t;
        }, [t]),
        H.useEffect(() => {
          r.current !== n && (o.current?.(n), (r.current = n));
        }, [n, r]),
        [n, i, o]
      );
    })({ defaultProp: t, onChange: n }),
    a = void 0 !== e,
    l = a ? e : r;
  {
    const t = H.useRef(void 0 !== e);
    H.useEffect(() => {
      const e = t.current;
      if (e !== a) {
      }
      t.current = a;
    }, [a, i]);
  }
  const c = H.useCallback(
    (t) => {
      if (a) {
        const n = (function (e) {
          return "function" == typeof e;
        })(t)
          ? t(e)
          : t;
        n !== e && s.current?.(n);
      } else o(t);
    },
    [a, e, o, s],
  );
  return [l, c];
}
var vx = H.createContext(void 0);
function bx(e) {
  const t = H.useContext(vx);
  return e || t || "ltr";
}
var yx = "rovingFocusGroup.onEntryFocus",
  xx = { bubbles: !1, cancelable: !0 },
  wx = "RovingFocusGroup",
  [Cx, Sx, kx] = ox(wx),
  [Ex, Nx] = Jy(wx, [kx]),
  [Lx, Dx] = Ex(wx),
  Tx = H.forwardRef((e, t) =>
    Q.jsx(Cx.Provider, {
      scope: e.__scopeRovingFocusGroup,
      children: Q.jsx(Cx.Slot, {
        scope: e.__scopeRovingFocusGroup,
        children: Q.jsx(Ix, { ...e, ref: t }),
      }),
    }),
  );
Tx.displayName = wx;
var Ix = H.forwardRef((e, t) => {
    const {
        __scopeRovingFocusGroup: n,
        orientation: i,
        loop: r = !1,
        dir: o,
        currentTabStopId: s,
        defaultCurrentTabStopId: a,
        onCurrentTabStopIdChange: l,
        onEntryFocus: c,
        preventScrollOnEntryFocus: d = !1,
        ...u
      } = e,
      h = H.useRef(null),
      g = Sp(t, h),
      p = bx(o),
      [f, m] = _x({ prop: s, defaultProp: a ?? null, onChange: l, caller: wx }),
      [_, v] = H.useState(!1),
      b = fx(c),
      y = Sx(n),
      x = H.useRef(!1),
      [w, C] = H.useState(0);
    return (
      H.useEffect(() => {
        const e = h.current;
        if (e) return (e.addEventListener(yx, b), () => e.removeEventListener(yx, b));
      }, [b]),
      Q.jsx(Lx, {
        scope: n,
        orientation: i,
        dir: p,
        loop: r,
        currentTabStopId: f,
        onItemFocus: H.useCallback((e) => m(e), [m]),
        onItemShiftTab: H.useCallback(() => v(!0), []),
        onFocusableItemAdd: H.useCallback(() => C((e) => e + 1), []),
        onFocusableItemRemove: H.useCallback(() => C((e) => e - 1), []),
        children: Q.jsx(gx.div, {
          tabIndex: _ || 0 === w ? -1 : 0,
          "data-orientation": i,
          ...u,
          ref: g,
          style: { outline: "none", ...e.style },
          onMouseDown: Qy(e.onMouseDown, () => {
            x.current = !0;
          }),
          onFocus: Qy(e.onFocus, (e) => {
            const t = !x.current;
            if (e.target === e.currentTarget && t && !_) {
              const t = new CustomEvent(yx, xx);
              if ((e.currentTarget.dispatchEvent(t), !t.defaultPrevented)) {
                const e = y().filter((e) => e.focusable);
                Ax(
                  [e.find((e) => e.active), e.find((e) => e.id === f), ...e]
                    .filter(Boolean)
                    .map((e) => e.ref.current),
                  d,
                );
              }
            }
            x.current = !1;
          }),
          onBlur: Qy(e.onBlur, () => v(!1)),
        }),
      })
    );
  }),
  Rx = "RovingFocusGroupItem",
  Ox = H.forwardRef((e, t) => {
    const {
        __scopeRovingFocusGroup: n,
        focusable: i = !0,
        active: r = !1,
        tabStopId: o,
        children: s,
        ...a
      } = e,
      l = cx(),
      c = o || l,
      d = Dx(Rx, n),
      u = d.currentTabStopId === c,
      h = Sx(n),
      { onFocusableItemAdd: g, onFocusableItemRemove: p, currentTabStopId: f } = d;
    return (
      H.useEffect(() => {
        if (i) return (g(), () => p());
      }, [i, g, p]),
      Q.jsx(Cx.ItemSlot, {
        scope: n,
        id: c,
        focusable: i,
        active: r,
        children: Q.jsx(gx.span, {
          tabIndex: u ? 0 : -1,
          "data-orientation": d.orientation,
          ...a,
          ref: t,
          onMouseDown: Qy(e.onMouseDown, (e) => {
            i ? d.onItemFocus(c) : e.preventDefault();
          }),
          onFocus: Qy(e.onFocus, () => d.onItemFocus(c)),
          onKeyDown: Qy(e.onKeyDown, (e) => {
            if ("Tab" === e.key && e.shiftKey) return void d.onItemShiftTab();
            if (e.target !== e.currentTarget) return;
            const t = (function (e, t, n) {
              const i = (function (e, t) {
                return "rtl" !== t
                  ? e
                  : "ArrowLeft" === e
                    ? "ArrowRight"
                    : "ArrowRight" === e
                      ? "ArrowLeft"
                      : e;
              })(e.key, n);
              return ("vertical" === t && ["ArrowLeft", "ArrowRight"].includes(i)) ||
                ("horizontal" === t && ["ArrowUp", "ArrowDown"].includes(i))
                ? void 0
                : Mx[i];
            })(e, d.orientation, d.dir);
            if (void 0 !== t) {
              if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;
              e.preventDefault();
              let n = h()
                .filter((e) => e.focusable)
                .map((e) => e.ref.current);
              if ("last" === t) n.reverse();
              else if ("prev" === t || "next" === t) {
                "prev" === t && n.reverse();
                const i = n.indexOf(e.currentTarget);
                n = d.loop
                  ? (function (e, t) {
                      return e.map((n, i) => e[(t + i) % e.length]);
                    })(n, i + 1)
                  : n.slice(i + 1);
              }
              setTimeout(() => Ax(n));
            }
          }),
          children: "function" == typeof s ? s({ isCurrentTabStop: u, hasTabStop: null != f }) : s,
        }),
      })
    );
  });
Ox.displayName = Rx;
var Mx = {
  ArrowLeft: "prev",
  ArrowUp: "prev",
  ArrowRight: "next",
  ArrowDown: "next",
  PageUp: "first",
  Home: "first",
  PageDown: "last",
  End: "last",
};
function Ax(e, t = !1) {
  const n = document.activeElement;
  for (const i of e) {
    if (i === n) return;
    if ((i.focus({ preventScroll: t }), document.activeElement !== n)) return;
  }
}
var Px = Tx,
  jx = Ox;
var Fx = (e) => {
  const { present: t, children: n } = e,
    i = (function (e) {
      const [t, n] = H.useState(),
        i = H.useRef(null),
        r = H.useRef(e),
        o = H.useRef("none"),
        s = e ? "mounted" : "unmounted",
        [a, l] = (function (e, t) {
          return H.useReducer((e, n) => t[e][n] ?? e, e);
        })(s, {
          mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" },
          unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" },
          unmounted: { MOUNT: "mounted" },
        });
      return (
        H.useEffect(() => {
          const e = Bx(i.current);
          o.current = "mounted" === a ? e : "none";
        }, [a]),
        sx(() => {
          const t = i.current,
            n = r.current;
          if (n !== e) {
            const i = o.current,
              s = Bx(t);
            if (e) l("MOUNT");
            else if ("none" === s || "none" === t?.display) l("UNMOUNT");
            else {
              l(n && i !== s ? "ANIMATION_OUT" : "UNMOUNT");
            }
            r.current = e;
          }
        }, [e, l]),
        sx(() => {
          if (t) {
            let e;
            const n = t.ownerDocument.defaultView ?? window,
              s = (o) => {
                const s = Bx(i.current).includes(CSS.escape(o.animationName));
                if (o.target === t && s && (l("ANIMATION_END"), !r.current)) {
                  const i = t.style.animationFillMode;
                  ((t.style.animationFillMode = "forwards"),
                    (e = n.setTimeout(() => {
                      "forwards" === t.style.animationFillMode && (t.style.animationFillMode = i);
                    })));
                }
              },
              a = (e) => {
                e.target === t && (o.current = Bx(i.current));
              };
            return (
              t.addEventListener("animationstart", a),
              t.addEventListener("animationcancel", s),
              t.addEventListener("animationend", s),
              () => {
                (n.clearTimeout(e),
                  t.removeEventListener("animationstart", a),
                  t.removeEventListener("animationcancel", s),
                  t.removeEventListener("animationend", s));
              }
            );
          }
          l("ANIMATION_END");
        }, [t, l]),
        {
          isPresent: ["mounted", "unmountSuspended"].includes(a),
          ref: H.useCallback((e) => {
            ((i.current = e ? getComputedStyle(e) : null), n(e));
          }, []),
        }
      );
    })(t),
    r = "function" == typeof n ? n({ present: i.isPresent }) : H.Children.only(n),
    o = Sp(
      i.ref,
      (function (e) {
        let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get,
          n = t && "isReactWarning" in t && t.isReactWarning;
        if (n) return e.ref;
        if (
          ((t = Object.getOwnPropertyDescriptor(e, "ref")?.get),
          (n = t && "isReactWarning" in t && t.isReactWarning),
          n)
        )
          return e.props.ref;
        return e.props.ref || e.ref;
      })(r),
    );
  return "function" == typeof n || i.isPresent ? H.cloneElement(r, { ref: o }) : null;
};
function Bx(e) {
  return e?.animationName || "none";
}
Fx.displayName = "Presence";
var Vx = "Tabs",
  [Wx] = Jy(Vx, [Nx]),
  Hx = Nx(),
  [zx, Ux] = Wx(Vx),
  $x = H.forwardRef((e, t) => {
    const {
        __scopeTabs: n,
        value: i,
        onValueChange: r,
        defaultValue: o,
        orientation: s = "horizontal",
        dir: a,
        activationMode: l = "automatic",
        ...c
      } = e,
      d = bx(a),
      [u, h] = _x({ prop: i, onChange: r, defaultProp: o ?? "", caller: Vx });
    return Q.jsx(zx, {
      scope: n,
      baseId: cx(),
      value: u,
      onValueChange: h,
      orientation: s,
      dir: d,
      activationMode: l,
      children: Q.jsx(gx.div, { dir: d, "data-orientation": s, ...c, ref: t }),
    });
  });
$x.displayName = Vx;
var qx = "TabsList",
  Kx = H.forwardRef((e, t) => {
    const { __scopeTabs: n, loop: i = !0, ...r } = e,
      o = Ux(qx, n),
      s = Hx(n);
    return Q.jsx(Px, {
      asChild: !0,
      ...s,
      orientation: o.orientation,
      dir: o.dir,
      loop: i,
      children: Q.jsx(gx.div, { role: "tablist", "aria-orientation": o.orientation, ...r, ref: t }),
    });
  });
Kx.displayName = qx;
var Gx = "TabsTrigger",
  Zx = H.forwardRef((e, t) => {
    const { __scopeTabs: n, value: i, disabled: r = !1, ...o } = e,
      s = Ux(Gx, n),
      a = Hx(n),
      l = Qx(s.baseId, i),
      c = Jx(s.baseId, i),
      d = i === s.value;
    return Q.jsx(jx, {
      asChild: !0,
      ...a,
      focusable: !r,
      active: d,
      children: Q.jsx(gx.button, {
        type: "button",
        role: "tab",
        "aria-selected": d,
        "aria-controls": c,
        "data-state": d ? "active" : "inactive",
        "data-disabled": r ? "" : void 0,
        disabled: r,
        id: l,
        ...o,
        ref: t,
        onMouseDown: Qy(e.onMouseDown, (e) => {
          r || 0 !== e.button || !1 !== e.ctrlKey ? e.preventDefault() : s.onValueChange(i);
        }),
        onKeyDown: Qy(e.onKeyDown, (e) => {
          [" ", "Enter"].includes(e.key) && s.onValueChange(i);
        }),
        onFocus: Qy(e.onFocus, () => {
          const e = "manual" !== s.activationMode;
          d || r || !e || s.onValueChange(i);
        }),
      }),
    });
  });
Zx.displayName = Gx;
var Yx = "TabsContent",
  Xx = H.forwardRef((e, t) => {
    const { __scopeTabs: n, value: i, forceMount: r, children: o, ...s } = e,
      a = Ux(Yx, n),
      l = Qx(a.baseId, i),
      c = Jx(a.baseId, i),
      d = i === a.value,
      u = H.useRef(d);
    return (
      H.useEffect(() => {
        const e = requestAnimationFrame(() => (u.current = !1));
        return () => cancelAnimationFrame(e);
      }, []),
      Q.jsx(Fx, {
        present: r || d,
        children: ({ present: n }) =>
          Q.jsx(gx.div, {
            "data-state": d ? "active" : "inactive",
            "data-orientation": a.orientation,
            role: "tabpanel",
            "aria-labelledby": l,
            hidden: !n,
            id: c,
            tabIndex: 0,
            ...s,
            ref: t,
            style: { ...e.style, animationDuration: u.current ? "0s" : void 0 },
            children: n && o,
          }),
      })
    );
  });
function Qx(e, t) {
  return `${e}-trigger-${t}`;
}
function Jx(e, t) {
  return `${e}-content-${t}`;
}
Xx.displayName = Yx;
var ew = Kx,
  tw = Zx,
  nw = Xx;
const iw = $x,
  rw = H.forwardRef(({ className: e, ...t }, n) =>
    Q.jsx(ew, {
      ref: n,
      className: Rf(
        "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
        e,
      ),
      ...t,
    }),
  );
rw.displayName = ew.displayName;
const ow = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(tw, {
    ref: n,
    className: Rf(
      "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
      e,
    ),
    ...t,
  }),
);
ow.displayName = tw.displayName;
const sw = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(nw, {
    ref: n,
    className: Rf(
      "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
      e,
    ),
    ...t,
  }),
);
sw.displayName = nw.displayName;
var aw = class {
    constructor() {
      ((this.listeners = new Set()), (this.subscribe = this.subscribe.bind(this)));
    }
    subscribe(e) {
      return (
        this.listeners.add(e),
        this.onSubscribe(),
        () => {
          (this.listeners.delete(e), this.onUnsubscribe());
        }
      );
    }
    hasListeners() {
      return this.listeners.size > 0;
    }
    onSubscribe() {}
    onUnsubscribe() {}
  },
  lw = {
    setTimeout: (e, t) => setTimeout(e, t),
    clearTimeout: (e) => clearTimeout(e),
    setInterval: (e, t) => setInterval(e, t),
    clearInterval: (e) => clearInterval(e),
  },
  cw = new (class {
    #e = lw;
    #t = !1;
    setTimeoutProvider(e) {
      this.#e = e;
    }
    setTimeout(e, t) {
      return this.#e.setTimeout(e, t);
    }
    clearTimeout(e) {
      this.#e.clearTimeout(e);
    }
    setInterval(e, t) {
      return this.#e.setInterval(e, t);
    }
    clearInterval(e) {
      this.#e.clearInterval(e);
    }
  })();
var dw = "undefined" == typeof window || "Deno" in globalThis;
function uw() {}
function hw(e) {
  return "number" == typeof e && e >= 0 && e !== 1 / 0;
}
function gw(e, t) {
  return Math.max(e + (t || 0) - Date.now(), 0);
}
function pw(e, t) {
  return "function" == typeof e ? e(t) : e;
}
function fw(e, t) {
  return "function" == typeof e ? e(t) : e;
}
function mw(e, t) {
  const { type: n = "all", exact: i, fetchStatus: r, predicate: o, queryKey: s, stale: a } = e;
  if (s)
    if (i) {
      if (t.queryHash !== vw(s, t.options)) return !1;
    } else if (!yw(t.queryKey, s)) return !1;
  if ("all" !== n) {
    const e = t.isActive();
    if ("active" === n && !e) return !1;
    if ("inactive" === n && e) return !1;
  }
  return (
    ("boolean" != typeof a || t.isStale() === a) &&
    (!r || r === t.state.fetchStatus) &&
    !(o && !o(t))
  );
}
function _w(e, t) {
  const { exact: n, status: i, predicate: r, mutationKey: o } = e;
  if (o) {
    if (!t.options.mutationKey) return !1;
    if (n) {
      if (bw(t.options.mutationKey) !== bw(o)) return !1;
    } else if (!yw(t.options.mutationKey, o)) return !1;
  }
  return (!i || t.state.status === i) && !(r && !r(t));
}
function vw(e, t) {
  return (t?.queryKeyHashFn || bw)(e);
}
function bw(e) {
  return JSON.stringify(e, (e, t) =>
    kw(t)
      ? Object.keys(t)
          .sort()
          .reduce((e, n) => ((e[n] = t[n]), e), {})
      : t,
  );
}
function yw(e, t) {
  return (
    e === t ||
    (typeof e == typeof t &&
      !(!e || !t || "object" != typeof e || "object" != typeof t) &&
      Object.keys(t).every((n) => yw(e[n], t[n])))
  );
}
var xw = Object.prototype.hasOwnProperty;
function ww(e, t) {
  if (e === t) return e;
  const n = Sw(e) && Sw(t);
  if (!(n || (kw(e) && kw(t)))) return t;
  const i = (n ? e : Object.keys(e)).length,
    r = n ? t : Object.keys(t),
    o = r.length,
    s = n ? new Array(o) : {};
  let a = 0;
  for (let l = 0; l < o; l++) {
    const o = n ? l : r[l],
      c = e[o],
      d = t[o];
    if (c === d) {
      ((s[o] = c), (n ? l < i : xw.call(e, o)) && a++);
      continue;
    }
    if (null === c || null === d || "object" != typeof c || "object" != typeof d) {
      s[o] = d;
      continue;
    }
    const u = ww(c, d);
    ((s[o] = u), u === c && a++);
  }
  return i === o && a === i ? e : s;
}
function Cw(e, t) {
  if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
  for (const n in e) if (e[n] !== t[n]) return !1;
  return !0;
}
function Sw(e) {
  return Array.isArray(e) && e.length === Object.keys(e).length;
}
function kw(e) {
  if (!Ew(e)) return !1;
  const t = e.constructor;
  if (void 0 === t) return !0;
  const n = t.prototype;
  return (
    !!Ew(n) && !!n.hasOwnProperty("isPrototypeOf") && Object.getPrototypeOf(e) === Object.prototype
  );
}
function Ew(e) {
  return "[object Object]" === Object.prototype.toString.call(e);
}
function Nw(e, t, n) {
  return "function" == typeof n.structuralSharing
    ? n.structuralSharing(e, t)
    : !1 !== n.structuralSharing
      ? ww(e, t)
      : t;
}
function Lw(e, t, n = 0) {
  const i = [...e, t];
  return n && i.length > n ? i.slice(1) : i;
}
function Dw(e, t, n = 0) {
  const i = [t, ...e];
  return n && i.length > n ? i.slice(0, -1) : i;
}
var Tw = Symbol();
function Iw(e, t) {
  return !e.queryFn && t?.initialPromise
    ? () => t.initialPromise
    : e.queryFn && e.queryFn !== Tw
      ? e.queryFn
      : () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`));
}
function Rw(e, t) {
  return "function" == typeof e ? e(...t) : !!e;
}
var Ow = new (class extends aw {
  #n;
  #i;
  #r;
  constructor() {
    (super(),
      (this.#r = (e) => {
        if (!dw && window.addEventListener) {
          const t = () => e();
          return (
            window.addEventListener("visibilitychange", t, !1),
            () => {
              window.removeEventListener("visibilitychange", t);
            }
          );
        }
      }));
  }
  onSubscribe() {
    this.#i || this.setEventListener(this.#r);
  }
  onUnsubscribe() {
    this.hasListeners() || (this.#i?.(), (this.#i = void 0));
  }
  setEventListener(e) {
    ((this.#r = e),
      this.#i?.(),
      (this.#i = e((e) => {
        "boolean" == typeof e ? this.setFocused(e) : this.onFocus();
      })));
  }
  setFocused(e) {
    this.#n !== e && ((this.#n = e), this.onFocus());
  }
  onFocus() {
    const e = this.isFocused();
    this.listeners.forEach((t) => {
      t(e);
    });
  }
  isFocused() {
    return "boolean" == typeof this.#n
      ? this.#n
      : "hidden" !== globalThis.document?.visibilityState;
  }
})();
function Mw() {
  let e, t;
  const n = new Promise((n, i) => {
    ((e = n), (t = i));
  });
  function i(e) {
    (Object.assign(n, e), delete n.resolve, delete n.reject);
  }
  return (
    (n.status = "pending"),
    n.catch(() => {}),
    (n.resolve = (t) => {
      (i({ status: "fulfilled", value: t }), e(t));
    }),
    (n.reject = (e) => {
      (i({ status: "rejected", reason: e }), t(e));
    }),
    n
  );
}
var Aw = function (e) {
  setTimeout(e, 0);
};
var Pw = (function () {
    let e = [],
      t = 0,
      n = (e) => {
        e();
      },
      i = (e) => {
        e();
      },
      r = Aw;
    const o = (i) => {
      t
        ? e.push(i)
        : r(() => {
            n(i);
          });
    };
    return {
      batch: (o) => {
        let s;
        t++;
        try {
          s = o();
        } finally {
          (t--,
            t ||
              (() => {
                const t = e;
                ((e = []),
                  t.length &&
                    r(() => {
                      i(() => {
                        t.forEach((e) => {
                          n(e);
                        });
                      });
                    }));
              })());
        }
        return s;
      },
      batchCalls:
        (e) =>
        (...t) => {
          o(() => {
            e(...t);
          });
        },
      schedule: o,
      setNotifyFunction: (e) => {
        n = e;
      },
      setBatchNotifyFunction: (e) => {
        i = e;
      },
      setScheduler: (e) => {
        r = e;
      },
    };
  })(),
  jw = new (class extends aw {
    #o = !0;
    #i;
    #r;
    constructor() {
      (super(),
        (this.#r = (e) => {
          if (!dw && window.addEventListener) {
            const t = () => e(!0),
              n = () => e(!1);
            return (
              window.addEventListener("online", t, !1),
              window.addEventListener("offline", n, !1),
              () => {
                (window.removeEventListener("online", t), window.removeEventListener("offline", n));
              }
            );
          }
        }));
    }
    onSubscribe() {
      this.#i || this.setEventListener(this.#r);
    }
    onUnsubscribe() {
      this.hasListeners() || (this.#i?.(), (this.#i = void 0));
    }
    setEventListener(e) {
      ((this.#r = e), this.#i?.(), (this.#i = e(this.setOnline.bind(this))));
    }
    setOnline(e) {
      this.#o !== e &&
        ((this.#o = e),
        this.listeners.forEach((t) => {
          t(e);
        }));
    }
    isOnline() {
      return this.#o;
    }
  })();
function Fw(e) {
  return Math.min(1e3 * 2 ** e, 3e4);
}
function Bw(e) {
  return "online" !== (e ?? "online") || jw.isOnline();
}
var Vw = class extends Error {
  constructor(e) {
    (super("CancelledError"), (this.revert = e?.revert), (this.silent = e?.silent));
  }
};
function Ww(e) {
  let t,
    n = !1,
    i = 0;
  const r = Mw(),
    o = () => "pending" !== r.status,
    s = () => Ow.isFocused() && ("always" === e.networkMode || jw.isOnline()) && e.canRun(),
    a = () => Bw(e.networkMode) && e.canRun(),
    l = (e) => {
      o() || (t?.(), r.resolve(e));
    },
    c = (e) => {
      o() || (t?.(), r.reject(e));
    },
    d = () =>
      new Promise((n) => {
        ((t = (e) => {
          (o() || s()) && n(e);
        }),
          e.onPause?.());
      }).then(() => {
        ((t = void 0), o() || e.onContinue?.());
      }),
    u = () => {
      if (o()) return;
      let t;
      const r = 0 === i ? e.initialPromise : void 0;
      try {
        t = r ?? e.fn();
      } catch (D2t) {
        t = Promise.reject(D2t);
      }
      Promise.resolve(t)
        .then(l)
        .catch((t) => {
          if (o()) return;
          const r = e.retry ?? (dw ? 0 : 3),
            a = e.retryDelay ?? Fw,
            l = "function" == typeof a ? a(i, t) : a,
            h = !0 === r || ("number" == typeof r && i < r) || ("function" == typeof r && r(i, t));
          !n && h
            ? (i++,
              e.onFail?.(i, t),
              (function (e) {
                return new Promise((t) => {
                  cw.setTimeout(t, e);
                });
              })(l)
                .then(() => (s() ? void 0 : d()))
                .then(() => {
                  n ? c(t) : u();
                }))
            : c(t);
        });
    };
  return {
    promise: r,
    status: () => r.status,
    cancel: (t) => {
      if (!o()) {
        const n = new Vw(t);
        (c(n), e.onCancel?.(n));
      }
    },
    continue: () => (t?.(), r),
    cancelRetry: () => {
      n = !0;
    },
    continueRetry: () => {
      n = !1;
    },
    canStart: a,
    start: () => (a() ? u() : d().then(u), r),
  };
}
var Hw = class {
    #s;
    destroy() {
      this.clearGcTimeout();
    }
    scheduleGc() {
      (this.clearGcTimeout(),
        hw(this.gcTime) &&
          (this.#s = cw.setTimeout(() => {
            this.optionalRemove();
          }, this.gcTime)));
    }
    updateGcTime(e) {
      this.gcTime = Math.max(this.gcTime || 0, e ?? (dw ? 1 / 0 : 3e5));
    }
    clearGcTimeout() {
      this.#s && (cw.clearTimeout(this.#s), (this.#s = void 0));
    }
  },
  zw = class extends Hw {
    #a;
    #l;
    #c;
    #d;
    #u;
    #h;
    #g;
    constructor(e) {
      (super(),
        (this.#g = !1),
        (this.#h = e.defaultOptions),
        this.setOptions(e.options),
        (this.observers = []),
        (this.#d = e.client),
        (this.#c = this.#d.getQueryCache()),
        (this.queryKey = e.queryKey),
        (this.queryHash = e.queryHash),
        (this.#a = qw(this.options)),
        (this.state = e.state ?? this.#a),
        this.scheduleGc());
    }
    get meta() {
      return this.options.meta;
    }
    get promise() {
      return this.#u?.promise;
    }
    setOptions(e) {
      if (
        ((this.options = { ...this.#h, ...e }),
        this.updateGcTime(this.options.gcTime),
        this.state && void 0 === this.state.data)
      ) {
        const e = qw(this.options);
        void 0 !== e.data && (this.setState($w(e.data, e.dataUpdatedAt)), (this.#a = e));
      }
    }
    optionalRemove() {
      this.observers.length || "idle" !== this.state.fetchStatus || this.#c.remove(this);
    }
    setData(e, t) {
      const n = Nw(this.state.data, e, this.options);
      return (
        this.#p({ data: n, type: "success", dataUpdatedAt: t?.updatedAt, manual: t?.manual }),
        n
      );
    }
    setState(e, t) {
      this.#p({ type: "setState", state: e, setStateOptions: t });
    }
    cancel(e) {
      const t = this.#u?.promise;
      return (this.#u?.cancel(e), t ? t.then(uw).catch(uw) : Promise.resolve());
    }
    destroy() {
      (super.destroy(), this.cancel({ silent: !0 }));
    }
    reset() {
      (this.destroy(), this.setState(this.#a));
    }
    isActive() {
      return this.observers.some((e) => !1 !== fw(e.options.enabled, this));
    }
    isDisabled() {
      return this.getObserversCount() > 0
        ? !this.isActive()
        : this.options.queryFn === Tw ||
            this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
    }
    isStatic() {
      return (
        this.getObserversCount() > 0 &&
        this.observers.some((e) => "static" === pw(e.options.staleTime, this))
      );
    }
    isStale() {
      return this.getObserversCount() > 0
        ? this.observers.some((e) => e.getCurrentResult().isStale)
        : void 0 === this.state.data || this.state.isInvalidated;
    }
    isStaleByTime(e = 0) {
      return (
        void 0 === this.state.data ||
        ("static" !== e && (!!this.state.isInvalidated || !gw(this.state.dataUpdatedAt, e)))
      );
    }
    onFocus() {
      const e = this.observers.find((e) => e.shouldFetchOnWindowFocus());
      (e?.refetch({ cancelRefetch: !1 }), this.#u?.continue());
    }
    onOnline() {
      const e = this.observers.find((e) => e.shouldFetchOnReconnect());
      (e?.refetch({ cancelRefetch: !1 }), this.#u?.continue());
    }
    addObserver(e) {
      this.observers.includes(e) ||
        (this.observers.push(e),
        this.clearGcTimeout(),
        this.#c.notify({ type: "observerAdded", query: this, observer: e }));
    }
    removeObserver(e) {
      this.observers.includes(e) &&
        ((this.observers = this.observers.filter((t) => t !== e)),
        this.observers.length ||
          (this.#u && (this.#g ? this.#u.cancel({ revert: !0 }) : this.#u.cancelRetry()),
          this.scheduleGc()),
        this.#c.notify({ type: "observerRemoved", query: this, observer: e }));
    }
    getObserversCount() {
      return this.observers.length;
    }
    invalidate() {
      this.state.isInvalidated || this.#p({ type: "invalidate" });
    }
    async fetch(e, t) {
      if ("idle" !== this.state.fetchStatus && "rejected" !== this.#u?.status())
        if (void 0 !== this.state.data && t?.cancelRefetch) this.cancel({ silent: !0 });
        else if (this.#u) return (this.#u.continueRetry(), this.#u.promise);
      if ((e && this.setOptions(e), !this.options.queryFn)) {
        const e = this.observers.find((e) => e.options.queryFn);
        e && this.setOptions(e.options);
      }
      const n = new AbortController(),
        i = (e) => {
          Object.defineProperty(e, "signal", {
            enumerable: !0,
            get: () => ((this.#g = !0), n.signal),
          });
        },
        r = () => {
          const e = Iw(this.options, t),
            n = (() => {
              const e = { client: this.#d, queryKey: this.queryKey, meta: this.meta };
              return (i(e), e);
            })();
          return (
            (this.#g = !1),
            this.options.persister ? this.options.persister(e, n, this) : e(n)
          );
        },
        o = (() => {
          const e = {
            fetchOptions: t,
            options: this.options,
            queryKey: this.queryKey,
            client: this.#d,
            state: this.state,
            fetchFn: r,
          };
          return (i(e), e);
        })();
      (this.options.behavior?.onFetch(o, this),
        (this.#l = this.state),
        ("idle" !== this.state.fetchStatus && this.state.fetchMeta === o.fetchOptions?.meta) ||
          this.#p({ type: "fetch", meta: o.fetchOptions?.meta }),
        (this.#u = Ww({
          initialPromise: t?.initialPromise,
          fn: o.fetchFn,
          onCancel: (e) => {
            (e instanceof Vw && e.revert && this.setState({ ...this.#l, fetchStatus: "idle" }),
              n.abort());
          },
          onFail: (e, t) => {
            this.#p({ type: "failed", failureCount: e, error: t });
          },
          onPause: () => {
            this.#p({ type: "pause" });
          },
          onContinue: () => {
            this.#p({ type: "continue" });
          },
          retry: o.options.retry,
          retryDelay: o.options.retryDelay,
          networkMode: o.options.networkMode,
          canRun: () => !0,
        })));
      try {
        const e = await this.#u.start();
        if (void 0 === e) throw new Error(`${this.queryHash} data is undefined`);
        return (
          this.setData(e),
          this.#c.config.onSuccess?.(e, this),
          this.#c.config.onSettled?.(e, this.state.error, this),
          e
        );
      } catch (D2t) {
        if (D2t instanceof Vw) {
          if (D2t.silent) return this.#u.promise;
          if (D2t.revert) {
            if (void 0 === this.state.data) throw D2t;
            return this.state.data;
          }
        }
        throw (
          this.#p({ type: "error", error: D2t }),
          this.#c.config.onError?.(D2t, this),
          this.#c.config.onSettled?.(this.state.data, D2t, this),
          D2t
        );
      } finally {
        this.scheduleGc();
      }
    }
    #p(e) {
      ((this.state = ((t) => {
        switch (e.type) {
          case "failed":
            return { ...t, fetchFailureCount: e.failureCount, fetchFailureReason: e.error };
          case "pause":
            return { ...t, fetchStatus: "paused" };
          case "continue":
            return { ...t, fetchStatus: "fetching" };
          case "fetch":
            return { ...t, ...Uw(t.data, this.options), fetchMeta: e.meta ?? null };
          case "success":
            const n = {
              ...t,
              ...$w(e.data, e.dataUpdatedAt),
              dataUpdateCount: t.dataUpdateCount + 1,
              ...(!e.manual && {
                fetchStatus: "idle",
                fetchFailureCount: 0,
                fetchFailureReason: null,
              }),
            };
            return ((this.#l = e.manual ? n : void 0), n);
          case "error":
            const i = e.error;
            return {
              ...t,
              error: i,
              errorUpdateCount: t.errorUpdateCount + 1,
              errorUpdatedAt: Date.now(),
              fetchFailureCount: t.fetchFailureCount + 1,
              fetchFailureReason: i,
              fetchStatus: "idle",
              status: "error",
            };
          case "invalidate":
            return { ...t, isInvalidated: !0 };
          case "setState":
            return { ...t, ...e.state };
        }
      })(this.state)),
        Pw.batch(() => {
          (this.observers.forEach((e) => {
            e.onQueryUpdate();
          }),
            this.#c.notify({ query: this, type: "updated", action: e }));
        }));
    }
  };
function Uw(e, t) {
  return {
    fetchFailureCount: 0,
    fetchFailureReason: null,
    fetchStatus: Bw(t.networkMode) ? "fetching" : "paused",
    ...(void 0 === e && { error: null, status: "pending" }),
  };
}
function $w(e, t) {
  return {
    data: e,
    dataUpdatedAt: t ?? Date.now(),
    error: null,
    isInvalidated: !1,
    status: "success",
  };
}
function qw(e) {
  const t = "function" == typeof e.initialData ? e.initialData() : e.initialData,
    n = void 0 !== t,
    i = n
      ? "function" == typeof e.initialDataUpdatedAt
        ? e.initialDataUpdatedAt()
        : e.initialDataUpdatedAt
      : 0;
  return {
    data: t,
    dataUpdateCount: 0,
    dataUpdatedAt: n ? (i ?? Date.now()) : 0,
    error: null,
    errorUpdateCount: 0,
    errorUpdatedAt: 0,
    fetchFailureCount: 0,
    fetchFailureReason: null,
    fetchMeta: null,
    isInvalidated: !1,
    status: n ? "success" : "pending",
    fetchStatus: "idle",
  };
}
var Kw = class extends aw {
  constructor(e, t) {
    (super(),
      (this.options = t),
      (this.#d = e),
      (this.#f = null),
      (this.#m = Mw()),
      this.bindMethods(),
      this.setOptions(t));
  }
  #d;
  #_ = void 0;
  #v = void 0;
  #b = void 0;
  #y;
  #x;
  #m;
  #f;
  #w;
  #C;
  #S;
  #k;
  #E;
  #N;
  #L = new Set();
  bindMethods() {
    this.refetch = this.refetch.bind(this);
  }
  onSubscribe() {
    1 === this.listeners.size &&
      (this.#_.addObserver(this),
      Gw(this.#_, this.options) ? this.#D() : this.updateResult(),
      this.#T());
  }
  onUnsubscribe() {
    this.hasListeners() || this.destroy();
  }
  shouldFetchOnReconnect() {
    return Zw(this.#_, this.options, this.options.refetchOnReconnect);
  }
  shouldFetchOnWindowFocus() {
    return Zw(this.#_, this.options, this.options.refetchOnWindowFocus);
  }
  destroy() {
    ((this.listeners = new Set()), this.#I(), this.#R(), this.#_.removeObserver(this));
  }
  setOptions(e) {
    const t = this.options,
      n = this.#_;
    if (
      ((this.options = this.#d.defaultQueryOptions(e)),
      void 0 !== this.options.enabled &&
        "boolean" != typeof this.options.enabled &&
        "function" != typeof this.options.enabled &&
        "boolean" != typeof fw(this.options.enabled, this.#_))
    )
      throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");
    (this.#O(),
      this.#_.setOptions(this.options),
      t._defaulted &&
        !Cw(this.options, t) &&
        this.#d
          .getQueryCache()
          .notify({ type: "observerOptionsUpdated", query: this.#_, observer: this }));
    const i = this.hasListeners();
    (i && Yw(this.#_, n, this.options, t) && this.#D(),
      this.updateResult(),
      !i ||
        (this.#_ === n &&
          fw(this.options.enabled, this.#_) === fw(t.enabled, this.#_) &&
          pw(this.options.staleTime, this.#_) === pw(t.staleTime, this.#_)) ||
        this.#M());
    const r = this.#A();
    !i ||
      (this.#_ === n &&
        fw(this.options.enabled, this.#_) === fw(t.enabled, this.#_) &&
        r === this.#N) ||
      this.#P(r);
  }
  getOptimisticResult(e) {
    const t = this.#d.getQueryCache().build(this.#d, e),
      n = this.createResult(t, e);
    return (
      (function (e, t) {
        if (!Cw(e.getCurrentResult(), t)) return !0;
        return !1;
      })(this, n) && ((this.#b = n), (this.#x = this.options), (this.#y = this.#_.state)),
      n
    );
  }
  getCurrentResult() {
    return this.#b;
  }
  trackResult(e, t) {
    return new Proxy(e, {
      get: (e, n) => (
        this.trackProp(n),
        t?.(n),
        "promise" === n &&
          (this.trackProp("data"),
          this.options.experimental_prefetchInRender ||
            "pending" !== this.#m.status ||
            this.#m.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),
        Reflect.get(e, n)
      ),
    });
  }
  trackProp(e) {
    this.#L.add(e);
  }
  getCurrentQuery() {
    return this.#_;
  }
  refetch({ ...e } = {}) {
    return this.fetch({ ...e });
  }
  fetchOptimistic(e) {
    const t = this.#d.defaultQueryOptions(e),
      n = this.#d.getQueryCache().build(this.#d, t);
    return n.fetch().then(() => this.createResult(n, t));
  }
  fetch(e) {
    return this.#D({ ...e, cancelRefetch: e.cancelRefetch ?? !0 }).then(
      () => (this.updateResult(), this.#b),
    );
  }
  #D(e) {
    this.#O();
    let t = this.#_.fetch(this.options, e);
    return (e?.throwOnError || (t = t.catch(uw)), t);
  }
  #M() {
    this.#I();
    const e = pw(this.options.staleTime, this.#_);
    if (dw || this.#b.isStale || !hw(e)) return;
    const t = gw(this.#b.dataUpdatedAt, e) + 1;
    this.#k = cw.setTimeout(() => {
      this.#b.isStale || this.updateResult();
    }, t);
  }
  #A() {
    return (
      ("function" == typeof this.options.refetchInterval
        ? this.options.refetchInterval(this.#_)
        : this.options.refetchInterval) ?? !1
    );
  }
  #P(e) {
    (this.#R(),
      (this.#N = e),
      !dw &&
        !1 !== fw(this.options.enabled, this.#_) &&
        hw(this.#N) &&
        0 !== this.#N &&
        (this.#E = cw.setInterval(() => {
          (this.options.refetchIntervalInBackground || Ow.isFocused()) && this.#D();
        }, this.#N)));
  }
  #T() {
    (this.#M(), this.#P(this.#A()));
  }
  #I() {
    this.#k && (cw.clearTimeout(this.#k), (this.#k = void 0));
  }
  #R() {
    this.#E && (cw.clearInterval(this.#E), (this.#E = void 0));
  }
  createResult(e, t) {
    const n = this.#_,
      i = this.options,
      r = this.#b,
      o = this.#y,
      s = this.#x,
      a = e !== n ? e.state : this.#v,
      { state: l } = e;
    let c,
      d = { ...l },
      u = !1;
    if (t._optimisticResults) {
      const r = this.hasListeners(),
        o = !r && Gw(e, t),
        s = r && Yw(e, n, t, i);
      ((o || s) && (d = { ...d, ...Uw(l.data, e.options) }),
        "isRestoring" === t._optimisticResults && (d.fetchStatus = "idle"));
    }
    let { error: h, errorUpdatedAt: g, status: p } = d;
    c = d.data;
    let f = !1;
    if (void 0 !== t.placeholderData && void 0 === c && "pending" === p) {
      let e;
      (r?.isPlaceholderData && t.placeholderData === s?.placeholderData
        ? ((e = r.data), (f = !0))
        : (e =
            "function" == typeof t.placeholderData
              ? t.placeholderData(this.#S?.state.data, this.#S)
              : t.placeholderData),
        void 0 !== e && ((p = "success"), (c = Nw(r?.data, e, t)), (u = !0)));
    }
    if (t.select && void 0 !== c && !f)
      if (r && c === o?.data && t.select === this.#w) c = this.#C;
      else
        try {
          ((this.#w = t.select),
            (c = t.select(c)),
            (c = Nw(r?.data, c, t)),
            (this.#C = c),
            (this.#f = null));
        } catch (w) {
          this.#f = w;
        }
    this.#f && ((h = this.#f), (c = this.#C), (g = Date.now()), (p = "error"));
    const m = "fetching" === d.fetchStatus,
      _ = "pending" === p,
      v = "error" === p,
      b = _ && m,
      y = void 0 !== c,
      x = {
        status: p,
        fetchStatus: d.fetchStatus,
        isPending: _,
        isSuccess: "success" === p,
        isError: v,
        isInitialLoading: b,
        isLoading: b,
        data: c,
        dataUpdatedAt: d.dataUpdatedAt,
        error: h,
        errorUpdatedAt: g,
        failureCount: d.fetchFailureCount,
        failureReason: d.fetchFailureReason,
        errorUpdateCount: d.errorUpdateCount,
        isFetched: d.dataUpdateCount > 0 || d.errorUpdateCount > 0,
        isFetchedAfterMount:
          d.dataUpdateCount > a.dataUpdateCount || d.errorUpdateCount > a.errorUpdateCount,
        isFetching: m,
        isRefetching: m && !_,
        isLoadingError: v && !y,
        isPaused: "paused" === d.fetchStatus,
        isPlaceholderData: u,
        isRefetchError: v && y,
        isStale: Xw(e, t),
        refetch: this.refetch,
        promise: this.#m,
        isEnabled: !1 !== fw(t.enabled, e),
      };
    if (this.options.experimental_prefetchInRender) {
      const t = (e) => {
          "error" === x.status ? e.reject(x.error) : void 0 !== x.data && e.resolve(x.data);
        },
        i = () => {
          const e = (this.#m = x.promise = Mw());
          t(e);
        },
        r = this.#m;
      switch (r.status) {
        case "pending":
          e.queryHash === n.queryHash && t(r);
          break;
        case "fulfilled":
          ("error" !== x.status && x.data === r.value) || i();
          break;
        case "rejected":
          ("error" === x.status && x.error === r.reason) || i();
      }
    }
    return x;
  }
  updateResult() {
    const e = this.#b,
      t = this.createResult(this.#_, this.options);
    if (
      ((this.#y = this.#_.state),
      (this.#x = this.options),
      void 0 !== this.#y.data && (this.#S = this.#_),
      Cw(t, e))
    )
      return;
    this.#b = t;
    this.#j({
      listeners: (() => {
        if (!e) return !0;
        const { notifyOnChangeProps: t } = this.options,
          n = "function" == typeof t ? t() : t;
        if ("all" === n || (!n && !this.#L.size)) return !0;
        const i = new Set(n ?? this.#L);
        return (
          this.options.throwOnError && i.add("error"),
          Object.keys(this.#b).some((t) => {
            const n = t;
            return this.#b[n] !== e[n] && i.has(n);
          })
        );
      })(),
    });
  }
  #O() {
    const e = this.#d.getQueryCache().build(this.#d, this.options);
    if (e === this.#_) return;
    const t = this.#_;
    ((this.#_ = e),
      (this.#v = e.state),
      this.hasListeners() && (t?.removeObserver(this), e.addObserver(this)));
  }
  onQueryUpdate() {
    (this.updateResult(), this.hasListeners() && this.#T());
  }
  #j(e) {
    Pw.batch(() => {
      (e.listeners &&
        this.listeners.forEach((e) => {
          e(this.#b);
        }),
        this.#d.getQueryCache().notify({ query: this.#_, type: "observerResultsUpdated" }));
    });
  }
};
function Gw(e, t) {
  return (
    (function (e, t) {
      return (
        !1 !== fw(t.enabled, e) &&
        void 0 === e.state.data &&
        !("error" === e.state.status && !1 === t.retryOnMount)
      );
    })(e, t) ||
    (void 0 !== e.state.data && Zw(e, t, t.refetchOnMount))
  );
}
function Zw(e, t, n) {
  if (!1 !== fw(t.enabled, e) && "static" !== pw(t.staleTime, e)) {
    const i = "function" == typeof n ? n(e) : n;
    return "always" === i || (!1 !== i && Xw(e, t));
  }
  return !1;
}
function Yw(e, t, n, i) {
  return (
    (e !== t || !1 === fw(i.enabled, e)) && (!n.suspense || "error" !== e.state.status) && Xw(e, n)
  );
}
function Xw(e, t) {
  return !1 !== fw(t.enabled, e) && e.isStaleByTime(pw(t.staleTime, e));
}
function Qw(e) {
  return {
    onFetch: (t, n) => {
      const i = t.options,
        r = t.fetchOptions?.meta?.fetchMore?.direction,
        o = t.state.data?.pages || [],
        s = t.state.data?.pageParams || [];
      let a = { pages: [], pageParams: [] },
        l = 0;
      const c = async () => {
        let n = !1;
        const c = Iw(t.options, t.fetchOptions),
          d = async (e, i, r) => {
            if (n) return Promise.reject();
            if (null == i && e.pages.length) return Promise.resolve(e);
            const o = (() => {
                const e = {
                  client: t.client,
                  queryKey: t.queryKey,
                  pageParam: i,
                  direction: r ? "backward" : "forward",
                  meta: t.options.meta,
                };
                return (
                  ((e) => {
                    Object.defineProperty(e, "signal", {
                      enumerable: !0,
                      get: () => (
                        t.signal.aborted
                          ? (n = !0)
                          : t.signal.addEventListener("abort", () => {
                              n = !0;
                            }),
                        t.signal
                      ),
                    });
                  })(e),
                  e
                );
              })(),
              s = await c(o),
              { maxPages: a } = t.options,
              l = r ? Dw : Lw;
            return { pages: l(e.pages, s, a), pageParams: l(e.pageParams, i, a) };
          };
        if (r && o.length) {
          const e = "backward" === r,
            t = { pages: o, pageParams: s },
            n = (e ? eC : Jw)(i, t);
          a = await d(t, n, e);
        } else {
          const t = e ?? o.length;
          do {
            const e = 0 === l ? (s[0] ?? i.initialPageParam) : Jw(i, a);
            if (l > 0 && null == e) break;
            ((a = await d(a, e)), l++);
          } while (l < t);
        }
        return a;
      };
      t.options.persister
        ? (t.fetchFn = () =>
            t.options.persister?.(
              c,
              { client: t.client, queryKey: t.queryKey, meta: t.options.meta, signal: t.signal },
              n,
            ))
        : (t.fetchFn = c);
    },
  };
}
function Jw(e, { pages: t, pageParams: n }) {
  const i = t.length - 1;
  return t.length > 0 ? e.getNextPageParam(t[i], t, n[i], n) : void 0;
}
function eC(e, { pages: t, pageParams: n }) {
  return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
}
var tC = class extends Hw {
  #d;
  #F;
  #B;
  #u;
  constructor(e) {
    (super(),
      (this.#d = e.client),
      (this.mutationId = e.mutationId),
      (this.#B = e.mutationCache),
      (this.#F = []),
      (this.state = e.state || {
        context: void 0,
        data: void 0,
        error: null,
        failureCount: 0,
        failureReason: null,
        isPaused: !1,
        status: "idle",
        variables: void 0,
        submittedAt: 0,
      }),
      this.setOptions(e.options),
      this.scheduleGc());
  }
  setOptions(e) {
    ((this.options = e), this.updateGcTime(this.options.gcTime));
  }
  get meta() {
    return this.options.meta;
  }
  addObserver(e) {
    this.#F.includes(e) ||
      (this.#F.push(e),
      this.clearGcTimeout(),
      this.#B.notify({ type: "observerAdded", mutation: this, observer: e }));
  }
  removeObserver(e) {
    ((this.#F = this.#F.filter((t) => t !== e)),
      this.scheduleGc(),
      this.#B.notify({ type: "observerRemoved", mutation: this, observer: e }));
  }
  optionalRemove() {
    this.#F.length || ("pending" === this.state.status ? this.scheduleGc() : this.#B.remove(this));
  }
  continue() {
    return this.#u?.continue() ?? this.execute(this.state.variables);
  }
  async execute(e) {
    const t = () => {
        this.#p({ type: "continue" });
      },
      n = { client: this.#d, meta: this.options.meta, mutationKey: this.options.mutationKey };
    this.#u = Ww({
      fn: () =>
        this.options.mutationFn
          ? this.options.mutationFn(e, n)
          : Promise.reject(new Error("No mutationFn found")),
      onFail: (e, t) => {
        this.#p({ type: "failed", failureCount: e, error: t });
      },
      onPause: () => {
        this.#p({ type: "pause" });
      },
      onContinue: t,
      retry: this.options.retry ?? 0,
      retryDelay: this.options.retryDelay,
      networkMode: this.options.networkMode,
      canRun: () => this.#B.canRun(this),
    });
    const i = "pending" === this.state.status,
      r = !this.#u.canStart();
    try {
      if (i) t();
      else {
        (this.#p({ type: "pending", variables: e, isPaused: r }),
          await this.#B.config.onMutate?.(e, this, n));
        const t = await this.options.onMutate?.(e, n);
        t !== this.state.context &&
          this.#p({ type: "pending", context: t, variables: e, isPaused: r });
      }
      const o = await this.#u.start();
      return (
        await this.#B.config.onSuccess?.(o, e, this.state.context, this, n),
        await this.options.onSuccess?.(o, e, this.state.context, n),
        await this.#B.config.onSettled?.(
          o,
          null,
          this.state.variables,
          this.state.context,
          this,
          n,
        ),
        await this.options.onSettled?.(o, null, e, this.state.context, n),
        this.#p({ type: "success", data: o }),
        o
      );
    } catch (D2t) {
      try {
        throw (
          await this.#B.config.onError?.(D2t, e, this.state.context, this, n),
          await this.options.onError?.(D2t, e, this.state.context, n),
          await this.#B.config.onSettled?.(
            void 0,
            D2t,
            this.state.variables,
            this.state.context,
            this,
            n,
          ),
          await this.options.onSettled?.(void 0, D2t, e, this.state.context, n),
          D2t
        );
      } finally {
        this.#p({ type: "error", error: D2t });
      }
    } finally {
      this.#B.runNext(this);
    }
  }
  #p(e) {
    ((this.state = ((t) => {
      switch (e.type) {
        case "failed":
          return { ...t, failureCount: e.failureCount, failureReason: e.error };
        case "pause":
          return { ...t, isPaused: !0 };
        case "continue":
          return { ...t, isPaused: !1 };
        case "pending":
          return {
            ...t,
            context: e.context,
            data: void 0,
            failureCount: 0,
            failureReason: null,
            error: null,
            isPaused: e.isPaused,
            status: "pending",
            variables: e.variables,
            submittedAt: Date.now(),
          };
        case "success":
          return {
            ...t,
            data: e.data,
            failureCount: 0,
            failureReason: null,
            error: null,
            status: "success",
            isPaused: !1,
          };
        case "error":
          return {
            ...t,
            data: void 0,
            error: e.error,
            failureCount: t.failureCount + 1,
            failureReason: e.error,
            isPaused: !1,
            status: "error",
          };
      }
    })(this.state)),
      Pw.batch(() => {
        (this.#F.forEach((t) => {
          t.onMutationUpdate(e);
        }),
          this.#B.notify({ mutation: this, type: "updated", action: e }));
      }));
  }
};
var nC = class extends aw {
  constructor(e = {}) {
    (super(), (this.config = e), (this.#V = new Set()), (this.#W = new Map()), (this.#H = 0));
  }
  #V;
  #W;
  #H;
  build(e, t, n) {
    const i = new tC({
      client: e,
      mutationCache: this,
      mutationId: ++this.#H,
      options: e.defaultMutationOptions(t),
      state: n,
    });
    return (this.add(i), i);
  }
  add(e) {
    this.#V.add(e);
    const t = iC(e);
    if ("string" == typeof t) {
      const n = this.#W.get(t);
      n ? n.push(e) : this.#W.set(t, [e]);
    }
    this.notify({ type: "added", mutation: e });
  }
  remove(e) {
    if (this.#V.delete(e)) {
      const t = iC(e);
      if ("string" == typeof t) {
        const n = this.#W.get(t);
        if (n)
          if (n.length > 1) {
            const t = n.indexOf(e);
            -1 !== t && n.splice(t, 1);
          } else n[0] === e && this.#W.delete(t);
      }
    }
    this.notify({ type: "removed", mutation: e });
  }
  canRun(e) {
    const t = iC(e);
    if ("string" == typeof t) {
      const n = this.#W.get(t),
        i = n?.find((e) => "pending" === e.state.status);
      return !i || i === e;
    }
    return !0;
  }
  runNext(e) {
    const t = iC(e);
    if ("string" == typeof t) {
      const n = this.#W.get(t)?.find((t) => t !== e && t.state.isPaused);
      return n?.continue() ?? Promise.resolve();
    }
    return Promise.resolve();
  }
  clear() {
    Pw.batch(() => {
      (this.#V.forEach((e) => {
        this.notify({ type: "removed", mutation: e });
      }),
        this.#V.clear(),
        this.#W.clear());
    });
  }
  getAll() {
    return Array.from(this.#V);
  }
  find(e) {
    const t = { exact: !0, ...e };
    return this.getAll().find((e) => _w(t, e));
  }
  findAll(e = {}) {
    return this.getAll().filter((t) => _w(e, t));
  }
  notify(e) {
    Pw.batch(() => {
      this.listeners.forEach((t) => {
        t(e);
      });
    });
  }
  resumePausedMutations() {
    const e = this.getAll().filter((e) => e.state.isPaused);
    return Pw.batch(() => Promise.all(e.map((e) => e.continue().catch(uw))));
  }
};
function iC(e) {
  return e.options.scope?.id;
}
var rC = class extends aw {
    #d;
    #b = void 0;
    #z;
    #U;
    constructor(e, t) {
      (super(), (this.#d = e), this.setOptions(t), this.bindMethods(), this.#$());
    }
    bindMethods() {
      ((this.mutate = this.mutate.bind(this)), (this.reset = this.reset.bind(this)));
    }
    setOptions(e) {
      const t = this.options;
      ((this.options = this.#d.defaultMutationOptions(e)),
        Cw(this.options, t) ||
          this.#d
            .getMutationCache()
            .notify({ type: "observerOptionsUpdated", mutation: this.#z, observer: this }),
        t?.mutationKey &&
        this.options.mutationKey &&
        bw(t.mutationKey) !== bw(this.options.mutationKey)
          ? this.reset()
          : "pending" === this.#z?.state.status && this.#z.setOptions(this.options));
    }
    onUnsubscribe() {
      this.hasListeners() || this.#z?.removeObserver(this);
    }
    onMutationUpdate(e) {
      (this.#$(), this.#j(e));
    }
    getCurrentResult() {
      return this.#b;
    }
    reset() {
      (this.#z?.removeObserver(this), (this.#z = void 0), this.#$(), this.#j());
    }
    mutate(e, t) {
      return (
        (this.#U = t),
        this.#z?.removeObserver(this),
        (this.#z = this.#d.getMutationCache().build(this.#d, this.options)),
        this.#z.addObserver(this),
        this.#z.execute(e)
      );
    }
    #$() {
      const e = this.#z?.state ?? {
        context: void 0,
        data: void 0,
        error: null,
        failureCount: 0,
        failureReason: null,
        isPaused: !1,
        status: "idle",
        variables: void 0,
        submittedAt: 0,
      };
      this.#b = {
        ...e,
        isPending: "pending" === e.status,
        isSuccess: "success" === e.status,
        isError: "error" === e.status,
        isIdle: "idle" === e.status,
        mutate: this.mutate,
        reset: this.reset,
      };
    }
    #j(e) {
      Pw.batch(() => {
        if (this.#U && this.hasListeners()) {
          const t = this.#b.variables,
            n = this.#b.context,
            i = { client: this.#d, meta: this.options.meta, mutationKey: this.options.mutationKey };
          "success" === e?.type
            ? (this.#U.onSuccess?.(e.data, t, n, i), this.#U.onSettled?.(e.data, null, t, n, i))
            : "error" === e?.type &&
              (this.#U.onError?.(e.error, t, n, i), this.#U.onSettled?.(void 0, e.error, t, n, i));
        }
        this.listeners.forEach((e) => {
          e(this.#b);
        });
      });
    }
  },
  oC = class extends aw {
    constructor(e = {}) {
      (super(), (this.config = e), (this.#q = new Map()));
    }
    #q;
    build(e, t, n) {
      const i = t.queryKey,
        r = t.queryHash ?? vw(i, t);
      let o = this.get(r);
      return (
        o ||
          ((o = new zw({
            client: e,
            queryKey: i,
            queryHash: r,
            options: e.defaultQueryOptions(t),
            state: n,
            defaultOptions: e.getQueryDefaults(i),
          })),
          this.add(o)),
        o
      );
    }
    add(e) {
      this.#q.has(e.queryHash) ||
        (this.#q.set(e.queryHash, e), this.notify({ type: "added", query: e }));
    }
    remove(e) {
      const t = this.#q.get(e.queryHash);
      t &&
        (e.destroy(),
        t === e && this.#q.delete(e.queryHash),
        this.notify({ type: "removed", query: e }));
    }
    clear() {
      Pw.batch(() => {
        this.getAll().forEach((e) => {
          this.remove(e);
        });
      });
    }
    get(e) {
      return this.#q.get(e);
    }
    getAll() {
      return [...this.#q.values()];
    }
    find(e) {
      const t = { exact: !0, ...e };
      return this.getAll().find((e) => mw(t, e));
    }
    findAll(e = {}) {
      const t = this.getAll();
      return Object.keys(e).length > 0 ? t.filter((t) => mw(e, t)) : t;
    }
    notify(e) {
      Pw.batch(() => {
        this.listeners.forEach((t) => {
          t(e);
        });
      });
    }
    onFocus() {
      Pw.batch(() => {
        this.getAll().forEach((e) => {
          e.onFocus();
        });
      });
    }
    onOnline() {
      Pw.batch(() => {
        this.getAll().forEach((e) => {
          e.onOnline();
        });
      });
    }
  },
  sC = H.createContext(void 0),
  aC = (e) => {
    const t = H.useContext(sC);
    if (!t) throw new Error("No QueryClient set, use QueryClientProvider to set one");
    return t;
  },
  lC = ({ client: e, children: t }) => (
    H.useEffect(
      () => (
        e.mount(),
        () => {
          e.unmount();
        }
      ),
      [e],
    ),
    Q.jsx(sC.Provider, { value: e, children: t })
  ),
  cC = H.createContext(!1);
cC.Provider;
var dC = H.createContext(
    (function () {
      let e = !1;
      return {
        clearReset: () => {
          e = !1;
        },
        reset: () => {
          e = !0;
        },
        isReset: () => e,
      };
    })(),
  ),
  uC = (e, t, n) =>
    t.fetchOptimistic(e).catch(() => {
      n.clearReset();
    });
function hC(e, t, n) {
  const i = H.useContext(cC),
    r = H.useContext(dC),
    o = aC(),
    s = o.defaultQueryOptions(e);
  (o.getDefaultOptions().queries?._experimental_beforeQuery?.(s),
    (s._optimisticResults = i ? "isRestoring" : "optimistic"),
    ((e) => {
      if (e.suspense) {
        const t = 1e3,
          n = (e) => ("static" === e ? e : Math.max(e ?? t, t)),
          i = e.staleTime;
        ((e.staleTime = "function" == typeof i ? (...e) => n(i(...e)) : n(i)),
          "number" == typeof e.gcTime && (e.gcTime = Math.max(e.gcTime, t)));
      }
    })(s),
    ((e, t) => {
      (e.suspense || e.throwOnError || e.experimental_prefetchInRender) &&
        (t.isReset() || (e.retryOnMount = !1));
    })(s, r),
    ((e) => {
      H.useEffect(() => {
        e.clearReset();
      }, [e]);
    })(r));
  const a = !o.getQueryCache().get(s.queryHash),
    [l] = H.useState(() => new t(o, s)),
    c = l.getOptimisticResult(s),
    d = !i && !1 !== e.subscribed;
  if (
    (H.useSyncExternalStore(
      H.useCallback(
        (e) => {
          const t = d ? l.subscribe(Pw.batchCalls(e)) : uw;
          return (l.updateResult(), t);
        },
        [l, d],
      ),
      () => l.getCurrentResult(),
      () => l.getCurrentResult(),
    ),
    H.useEffect(() => {
      l.setOptions(s);
    }, [s, l]),
    ((e, t) => e?.suspense && t.isPending)(s, c))
  )
    throw uC(s, l, r);
  if (
    (({ result: e, errorResetBoundary: t, throwOnError: n, query: i, suspense: r }) =>
      e.isError &&
      !t.isReset() &&
      !e.isFetching &&
      i &&
      ((r && void 0 === e.data) || Rw(n, [e.error, i])))({
      result: c,
      errorResetBoundary: r,
      throwOnError: s.throwOnError,
      query: o.getQueryCache().get(s.queryHash),
      suspense: s.suspense,
    })
  )
    throw c.error;
  if (
    (o.getDefaultOptions().queries?._experimental_afterQuery?.(s, c),
    s.experimental_prefetchInRender && !dw && ((e, t) => e.isLoading && e.isFetching && !t)(c, i))
  ) {
    const e = a ? uC(s, l, r) : o.getQueryCache().get(s.queryHash)?.promise;
    e?.catch(uw).finally(() => {
      l.updateResult();
    });
  }
  return s.notifyOnChangeProps ? c : l.trackResult(c);
}
function gC(e, t) {
  return hC(e, Kw);
}
function pC(e, t) {
  const n = aC(),
    [i] = H.useState(() => new rC(n, e));
  H.useEffect(() => {
    i.setOptions(e);
  }, [i, e]);
  const r = H.useSyncExternalStore(
      H.useCallback((e) => i.subscribe(Pw.batchCalls(e)), [i]),
      () => i.getCurrentResult(),
      () => i.getCurrentResult(),
    ),
    o = H.useCallback(
      (e, t) => {
        i.mutate(e, t).catch(uw);
      },
      [i],
    );
  if (r.error && Rw(i.options.throwOnError, [r.error])) throw r.error;
  return { ...r, mutate: o, mutateAsync: r.mutate };
}
const fC = 6048e5,
  mC = Symbol.for("constructDateFrom");
function _C(e, t) {
  return "function" == typeof e
    ? e(t)
    : e && "object" == typeof e && mC in e
      ? e[mC](t)
      : e instanceof Date
        ? new e.constructor(t)
        : new Date(t);
}
function vC(e, t) {
  return _C(t || e, e);
}
function bC(e, t, n) {
  const i = vC(e, n?.in);
  return isNaN(t) ? _C(e, NaN) : t ? (i.setDate(i.getDate() + t), i) : i;
}
function yC(e, t, n) {
  const i = vC(e, n?.in);
  if (isNaN(t)) return _C(e, NaN);
  if (!t) return i;
  const r = i.getDate(),
    o = _C(e, i.getTime());
  o.setMonth(i.getMonth() + t + 1, 0);
  return r >= o.getDate() ? o : (i.setFullYear(o.getFullYear(), o.getMonth(), r), i);
}
let xC = {};
function wC() {
  return xC;
}
function CC(e, t) {
  const n = wC(),
    i =
      t?.weekStartsOn ??
      t?.locale?.options?.weekStartsOn ??
      n.weekStartsOn ??
      n.locale?.options?.weekStartsOn ??
      0,
    r = vC(e, t?.in),
    o = r.getDay(),
    s = (o < i ? 7 : 0) + o - i;
  return (r.setDate(r.getDate() - s), r.setHours(0, 0, 0, 0), r);
}
function SC(e, t) {
  return CC(e, { ...t, weekStartsOn: 1 });
}
function kC(e, t) {
  const n = vC(e, t?.in),
    i = n.getFullYear(),
    r = _C(n, 0);
  (r.setFullYear(i + 1, 0, 4), r.setHours(0, 0, 0, 0));
  const o = SC(r),
    s = _C(n, 0);
  (s.setFullYear(i, 0, 4), s.setHours(0, 0, 0, 0));
  const a = SC(s);
  return n.getTime() >= o.getTime() ? i + 1 : n.getTime() >= a.getTime() ? i : i - 1;
}
function EC(e) {
  const t = vC(e),
    n = new Date(
      Date.UTC(
        t.getFullYear(),
        t.getMonth(),
        t.getDate(),
        t.getHours(),
        t.getMinutes(),
        t.getSeconds(),
        t.getMilliseconds(),
      ),
    );
  return (n.setUTCFullYear(t.getFullYear()), +e - +n);
}
function NC(e, ...t) {
  const n = _C.bind(null, e || t.find((e) => "object" == typeof e));
  return t.map(n);
}
function LC(e, t) {
  const n = vC(e, t?.in);
  return (n.setHours(0, 0, 0, 0), n);
}
function DC(e, t, n) {
  const [i, r] = NC(n?.in, e, t),
    o = LC(i),
    s = LC(r),
    a = +o - EC(o),
    l = +s - EC(s);
  return Math.round((a - l) / 864e5);
}
function TC(e) {
  return (
    e instanceof Date ||
    ("object" == typeof e && "[object Date]" === Object.prototype.toString.call(e))
  );
}
function IC(e, t) {
  const [n, i] = NC(e, t.start, t.end);
  return { start: n, end: i };
}
function RC(e, t) {
  const n = vC(e, t?.in);
  return (n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n);
}
function OC(e, t) {
  const n = wC(),
    i =
      t?.weekStartsOn ??
      t?.locale?.options?.weekStartsOn ??
      n.weekStartsOn ??
      n.locale?.options?.weekStartsOn ??
      0,
    r = vC(e, t?.in),
    o = r.getDay(),
    s = 6 + (o < i ? -7 : 0) - (o - i);
  return (r.setDate(r.getDate() + s), r.setHours(23, 59, 59, 999), r);
}
const MC = {
  lessThanXSeconds: { one: "less than a second", other: "less than {{count}} seconds" },
  xSeconds: { one: "1 second", other: "{{count}} seconds" },
  halfAMinute: "half a minute",
  lessThanXMinutes: { one: "less than a minute", other: "less than {{count}} minutes" },
  xMinutes: { one: "1 minute", other: "{{count}} minutes" },
  aboutXHours: { one: "about 1 hour", other: "about {{count}} hours" },
  xHours: { one: "1 hour", other: "{{count}} hours" },
  xDays: { one: "1 day", other: "{{count}} days" },
  aboutXWeeks: { one: "about 1 week", other: "about {{count}} weeks" },
  xWeeks: { one: "1 week", other: "{{count}} weeks" },
  aboutXMonths: { one: "about 1 month", other: "about {{count}} months" },
  xMonths: { one: "1 month", other: "{{count}} months" },
  aboutXYears: { one: "about 1 year", other: "about {{count}} years" },
  xYears: { one: "1 year", other: "{{count}} years" },
  overXYears: { one: "over 1 year", other: "over {{count}} years" },
  almostXYears: { one: "almost 1 year", other: "almost {{count}} years" },
};
function AC(e) {
  return (t = {}) => {
    const n = t.width ? String(t.width) : e.defaultWidth;
    return e.formats[n] || e.formats[e.defaultWidth];
  };
}
const PC = {
    date: AC({
      formats: {
        full: "EEEE, MMMM do, y",
        long: "MMMM do, y",
        medium: "MMM d, y",
        short: "MM/dd/yyyy",
      },
      defaultWidth: "full",
    }),
    time: AC({
      formats: {
        full: "h:mm:ss a zzzz",
        long: "h:mm:ss a z",
        medium: "h:mm:ss a",
        short: "h:mm a",
      },
      defaultWidth: "full",
    }),
    dateTime: AC({
      formats: {
        full: "{{date}} 'at' {{time}}",
        long: "{{date}} 'at' {{time}}",
        medium: "{{date}}, {{time}}",
        short: "{{date}}, {{time}}",
      },
      defaultWidth: "full",
    }),
  },
  jC = {
    lastWeek: "'last' eeee 'at' p",
    yesterday: "'yesterday at' p",
    today: "'today at' p",
    tomorrow: "'tomorrow at' p",
    nextWeek: "eeee 'at' p",
    other: "P",
  };
function FC(e) {
  return (t, n) => {
    let i;
    if ("formatting" === (n?.context ? String(n.context) : "standalone") && e.formattingValues) {
      const t = e.defaultFormattingWidth || e.defaultWidth,
        r = n?.width ? String(n.width) : t;
      i = e.formattingValues[r] || e.formattingValues[t];
    } else {
      const t = e.defaultWidth,
        r = n?.width ? String(n.width) : e.defaultWidth;
      i = e.values[r] || e.values[t];
    }
    return i[e.argumentCallback ? e.argumentCallback(t) : t];
  };
}
const BC = {
  ordinalNumber: (e, t) => {
    const n = Number(e),
      i = n % 100;
    if (i > 20 || i < 10)
      switch (i % 10) {
        case 1:
          return n + "st";
        case 2:
          return n + "nd";
        case 3:
          return n + "rd";
      }
    return n + "th";
  },
  era: FC({
    values: {
      narrow: ["B", "A"],
      abbreviated: ["BC", "AD"],
      wide: ["Before Christ", "Anno Domini"],
    },
    defaultWidth: "wide",
  }),
  quarter: FC({
    values: {
      narrow: ["1", "2", "3", "4"],
      abbreviated: ["Q1", "Q2", "Q3", "Q4"],
      wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
    },
    defaultWidth: "wide",
    argumentCallback: (e) => e - 1,
  }),
  month: FC({
    values: {
      narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
      abbreviated: [
        "Jan",
        "Feb",
        "Mar",
        "Apr",
        "May",
        "Jun",
        "Jul",
        "Aug",
        "Sep",
        "Oct",
        "Nov",
        "Dec",
      ],
      wide: [
        "January",
        "February",
        "March",
        "April",
        "May",
        "June",
        "July",
        "August",
        "September",
        "October",
        "November",
        "December",
      ],
    },
    defaultWidth: "wide",
  }),
  day: FC({
    values: {
      narrow: ["S", "M", "T", "W", "T", "F", "S"],
      short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
      abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
      wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
    },
    defaultWidth: "wide",
  }),
  dayPeriod: FC({
    values: {
      narrow: {
        am: "a",
        pm: "p",
        midnight: "mi",
        noon: "n",
        morning: "morning",
        afternoon: "afternoon",
        evening: "evening",
        night: "night",
      },
      abbreviated: {
        am: "AM",
        pm: "PM",
        midnight: "midnight",
        noon: "noon",
        morning: "morning",
        afternoon: "afternoon",
        evening: "evening",
        night: "night",
      },
      wide: {
        am: "a.m.",
        pm: "p.m.",
        midnight: "midnight",
        noon: "noon",
        morning: "morning",
        afternoon: "afternoon",
        evening: "evening",
        night: "night",
      },
    },
    defaultWidth: "wide",
    formattingValues: {
      narrow: {
        am: "a",
        pm: "p",
        midnight: "mi",
        noon: "n",
        morning: "in the morning",
        afternoon: "in the afternoon",
        evening: "in the evening",
        night: "at night",
      },
      abbreviated: {
        am: "AM",
        pm: "PM",
        midnight: "midnight",
        noon: "noon",
        morning: "in the morning",
        afternoon: "in the afternoon",
        evening: "in the evening",
        night: "at night",
      },
      wide: {
        am: "a.m.",
        pm: "p.m.",
        midnight: "midnight",
        noon: "noon",
        morning: "in the morning",
        afternoon: "in the afternoon",
        evening: "in the evening",
        night: "at night",
      },
    },
    defaultFormattingWidth: "wide",
  }),
};
function VC(e) {
  return (t, n = {}) => {
    const i = n.width,
      r = (i && e.matchPatterns[i]) || e.matchPatterns[e.defaultMatchWidth],
      o = t.match(r);
    if (!o) return null;
    const s = o[0],
      a = (i && e.parsePatterns[i]) || e.parsePatterns[e.defaultParseWidth],
      l = Array.isArray(a)
        ? (function (e, t) {
            for (let n = 0; n < e.length; n++) if (t(e[n])) return n;
            return;
          })(a, (e) => e.test(s))
        : (function (e, t) {
            for (const n in e) if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n])) return n;
            return;
          })(a, (e) => e.test(s));
    let c;
    ((c = e.valueCallback ? e.valueCallback(l) : l),
      (c = n.valueCallback ? n.valueCallback(c) : c));
    return { value: c, rest: t.slice(s.length) };
  };
}
function WC(e) {
  return (t, n = {}) => {
    const i = t.match(e.matchPattern);
    if (!i) return null;
    const r = i[0],
      o = t.match(e.parsePattern);
    if (!o) return null;
    let s = e.valueCallback ? e.valueCallback(o[0]) : o[0];
    s = n.valueCallback ? n.valueCallback(s) : s;
    return { value: s, rest: t.slice(r.length) };
  };
}
const HC = {
    ordinalNumber: WC({
      matchPattern: /^(\d+)(th|st|nd|rd)?/i,
      parsePattern: /\d+/i,
      valueCallback: (e) => parseInt(e, 10),
    }),
    era: VC({
      matchPatterns: {
        narrow: /^(b|a)/i,
        abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
        wide: /^(before christ|before common era|anno domini|common era)/i,
      },
      defaultMatchWidth: "wide",
      parsePatterns: { any: [/^b/i, /^(a|c)/i] },
      defaultParseWidth: "any",
    }),
    quarter: VC({
      matchPatterns: {
        narrow: /^[1234]/i,
        abbreviated: /^q[1234]/i,
        wide: /^[1234](th|st|nd|rd)? quarter/i,
      },
      defaultMatchWidth: "wide",
      parsePatterns: { any: [/1/i, /2/i, /3/i, /4/i] },
      defaultParseWidth: "any",
      valueCallback: (e) => e + 1,
    }),
    month: VC({
      matchPatterns: {
        narrow: /^[jfmasond]/i,
        abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
        wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
      },
      defaultMatchWidth: "wide",
      parsePatterns: {
        narrow: [
          /^j/i,
          /^f/i,
          /^m/i,
          /^a/i,
          /^m/i,
          /^j/i,
          /^j/i,
          /^a/i,
          /^s/i,
          /^o/i,
          /^n/i,
          /^d/i,
        ],
        any: [
          /^ja/i,
          /^f/i,
          /^mar/i,
          /^ap/i,
          /^may/i,
          /^jun/i,
          /^jul/i,
          /^au/i,
          /^s/i,
          /^o/i,
          /^n/i,
          /^d/i,
        ],
      },
      defaultParseWidth: "any",
    }),
    day: VC({
      matchPatterns: {
        narrow: /^[smtwf]/i,
        short: /^(su|mo|tu|we|th|fr|sa)/i,
        abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
        wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
      },
      defaultMatchWidth: "wide",
      parsePatterns: {
        narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
        any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
      },
      defaultParseWidth: "any",
    }),
    dayPeriod: VC({
      matchPatterns: {
        narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
        any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
      },
      defaultMatchWidth: "any",
      parsePatterns: {
        any: {
          am: /^a/i,
          pm: /^p/i,
          midnight: /^mi/i,
          noon: /^no/i,
          morning: /morning/i,
          afternoon: /afternoon/i,
          evening: /evening/i,
          night: /night/i,
        },
      },
      defaultParseWidth: "any",
    }),
  },
  zC = {
    code: "en-US",
    formatDistance: (e, t, n) => {
      let i;
      const r = MC[e];
      return (
        (i =
          "string" == typeof r ? r : 1 === t ? r.one : r.other.replace("{{count}}", t.toString())),
        n?.addSuffix ? (n.comparison && n.comparison > 0 ? "in " + i : i + " ago") : i
      );
    },
    formatLong: PC,
    formatRelative: (e, t, n, i) => jC[e],
    localize: BC,
    match: HC,
    options: { weekStartsOn: 0, firstWeekContainsDate: 1 },
  };
function UC(e, t) {
  const n = vC(e, t?.in),
    i =
      +SC(n) -
      +(function (e, t) {
        const n = kC(e, t),
          i = _C(e, 0);
        return (i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0), SC(i));
      })(n);
  return Math.round(i / fC) + 1;
}
function $C(e, t) {
  const n = vC(e, t?.in),
    i = n.getFullYear(),
    r = wC(),
    o =
      t?.firstWeekContainsDate ??
      t?.locale?.options?.firstWeekContainsDate ??
      r.firstWeekContainsDate ??
      r.locale?.options?.firstWeekContainsDate ??
      1,
    s = _C(t?.in || e, 0);
  (s.setFullYear(i + 1, 0, o), s.setHours(0, 0, 0, 0));
  const a = CC(s, t),
    l = _C(t?.in || e, 0);
  (l.setFullYear(i, 0, o), l.setHours(0, 0, 0, 0));
  const c = CC(l, t);
  return +n >= +a ? i + 1 : +n >= +c ? i : i - 1;
}
function qC(e, t) {
  const n = vC(e, t?.in),
    i =
      +CC(n, t) -
      +(function (e, t) {
        const n = wC(),
          i =
            t?.firstWeekContainsDate ??
            t?.locale?.options?.firstWeekContainsDate ??
            n.firstWeekContainsDate ??
            n.locale?.options?.firstWeekContainsDate ??
            1,
          r = $C(e, t),
          o = _C(t?.in || e, 0);
        return (o.setFullYear(r, 0, i), o.setHours(0, 0, 0, 0), CC(o, t));
      })(n, t);
  return Math.round(i / fC) + 1;
}
function KC(e, t) {
  return (e < 0 ? "-" : "") + Math.abs(e).toString().padStart(t, "0");
}
const GC = {
    y(e, t) {
      const n = e.getFullYear(),
        i = n > 0 ? n : 1 - n;
      return KC("yy" === t ? i % 100 : i, t.length);
    },
    M(e, t) {
      const n = e.getMonth();
      return "M" === t ? String(n + 1) : KC(n + 1, 2);
    },
    d: (e, t) => KC(e.getDate(), t.length),
    a(e, t) {
      const n = e.getHours() / 12 >= 1 ? "pm" : "am";
      switch (t) {
        case "a":
        case "aa":
          return n.toUpperCase();
        case "aaa":
          return n;
        case "aaaaa":
          return n[0];
        default:
          return "am" === n ? "a.m." : "p.m.";
      }
    },
    h: (e, t) => KC(e.getHours() % 12 || 12, t.length),
    H: (e, t) => KC(e.getHours(), t.length),
    m: (e, t) => KC(e.getMinutes(), t.length),
    s: (e, t) => KC(e.getSeconds(), t.length),
    S(e, t) {
      const n = t.length,
        i = e.getMilliseconds();
      return KC(Math.trunc(i * Math.pow(10, n - 3)), t.length);
    },
  },
  ZC = "midnight",
  YC = "noon",
  XC = "morning",
  QC = "afternoon",
  JC = "evening",
  eS = "night",
  tS = {
    G: function (e, t, n) {
      const i = e.getFullYear() > 0 ? 1 : 0;
      switch (t) {
        case "G":
        case "GG":
        case "GGG":
          return n.era(i, { width: "abbreviated" });
        case "GGGGG":
          return n.era(i, { width: "narrow" });
        default:
          return n.era(i, { width: "wide" });
      }
    },
    y: function (e, t, n) {
      if ("yo" === t) {
        const t = e.getFullYear(),
          i = t > 0 ? t : 1 - t;
        return n.ordinalNumber(i, { unit: "year" });
      }
      return GC.y(e, t);
    },
    Y: function (e, t, n, i) {
      const r = $C(e, i),
        o = r > 0 ? r : 1 - r;
      if ("YY" === t) {
        return KC(o % 100, 2);
      }
      return "Yo" === t ? n.ordinalNumber(o, { unit: "year" }) : KC(o, t.length);
    },
    R: function (e, t) {
      return KC(kC(e), t.length);
    },
    u: function (e, t) {
      return KC(e.getFullYear(), t.length);
    },
    Q: function (e, t, n) {
      const i = Math.ceil((e.getMonth() + 1) / 3);
      switch (t) {
        case "Q":
          return String(i);
        case "QQ":
          return KC(i, 2);
        case "Qo":
          return n.ordinalNumber(i, { unit: "quarter" });
        case "QQQ":
          return n.quarter(i, { width: "abbreviated", context: "formatting" });
        case "QQQQQ":
          return n.quarter(i, { width: "narrow", context: "formatting" });
        default:
          return n.quarter(i, { width: "wide", context: "formatting" });
      }
    },
    q: function (e, t, n) {
      const i = Math.ceil((e.getMonth() + 1) / 3);
      switch (t) {
        case "q":
          return String(i);
        case "qq":
          return KC(i, 2);
        case "qo":
          return n.ordinalNumber(i, { unit: "quarter" });
        case "qqq":
          return n.quarter(i, { width: "abbreviated", context: "standalone" });
        case "qqqqq":
          return n.quarter(i, { width: "narrow", context: "standalone" });
        default:
          return n.quarter(i, { width: "wide", context: "standalone" });
      }
    },
    M: function (e, t, n) {
      const i = e.getMonth();
      switch (t) {
        case "M":
        case "MM":
          return GC.M(e, t);
        case "Mo":
          return n.ordinalNumber(i + 1, { unit: "month" });
        case "MMM":
          return n.month(i, { width: "abbreviated", context: "formatting" });
        case "MMMMM":
          return n.month(i, { width: "narrow", context: "formatting" });
        default:
          return n.month(i, { width: "wide", context: "formatting" });
      }
    },
    L: function (e, t, n) {
      const i = e.getMonth();
      switch (t) {
        case "L":
          return String(i + 1);
        case "LL":
          return KC(i + 1, 2);
        case "Lo":
          return n.ordinalNumber(i + 1, { unit: "month" });
        case "LLL":
          return n.month(i, { width: "abbreviated", context: "standalone" });
        case "LLLLL":
          return n.month(i, { width: "narrow", context: "standalone" });
        default:
          return n.month(i, { width: "wide", context: "standalone" });
      }
    },
    w: function (e, t, n, i) {
      const r = qC(e, i);
      return "wo" === t ? n.ordinalNumber(r, { unit: "week" }) : KC(r, t.length);
    },
    I: function (e, t, n) {
      const i = UC(e);
      return "Io" === t ? n.ordinalNumber(i, { unit: "week" }) : KC(i, t.length);
    },
    d: function (e, t, n) {
      return "do" === t ? n.ordinalNumber(e.getDate(), { unit: "date" }) : GC.d(e, t);
    },
    D: function (e, t, n) {
      const i = (function (e, t) {
        const n = vC(e, t?.in);
        return DC(n, RC(n)) + 1;
      })(e);
      return "Do" === t ? n.ordinalNumber(i, { unit: "dayOfYear" }) : KC(i, t.length);
    },
    E: function (e, t, n) {
      const i = e.getDay();
      switch (t) {
        case "E":
        case "EE":
        case "EEE":
          return n.day(i, { width: "abbreviated", context: "formatting" });
        case "EEEEE":
          return n.day(i, { width: "narrow", context: "formatting" });
        case "EEEEEE":
          return n.day(i, { width: "short", context: "formatting" });
        default:
          return n.day(i, { width: "wide", context: "formatting" });
      }
    },
    e: function (e, t, n, i) {
      const r = e.getDay(),
        o = (r - i.weekStartsOn + 8) % 7 || 7;
      switch (t) {
        case "e":
          return String(o);
        case "ee":
          return KC(o, 2);
        case "eo":
          return n.ordinalNumber(o, { unit: "day" });
        case "eee":
          return n.day(r, { width: "abbreviated", context: "formatting" });
        case "eeeee":
          return n.day(r, { width: "narrow", context: "formatting" });
        case "eeeeee":
          return n.day(r, { width: "short", context: "formatting" });
        default:
          return n.day(r, { width: "wide", context: "formatting" });
      }
    },
    c: function (e, t, n, i) {
      const r = e.getDay(),
        o = (r - i.weekStartsOn + 8) % 7 || 7;
      switch (t) {
        case "c":
          return String(o);
        case "cc":
          return KC(o, t.length);
        case "co":
          return n.ordinalNumber(o, { unit: "day" });
        case "ccc":
          return n.day(r, { width: "abbreviated", context: "standalone" });
        case "ccccc":
          return n.day(r, { width: "narrow", context: "standalone" });
        case "cccccc":
          return n.day(r, { width: "short", context: "standalone" });
        default:
          return n.day(r, { width: "wide", context: "standalone" });
      }
    },
    i: function (e, t, n) {
      const i = e.getDay(),
        r = 0 === i ? 7 : i;
      switch (t) {
        case "i":
          return String(r);
        case "ii":
          return KC(r, t.length);
        case "io":
          return n.ordinalNumber(r, { unit: "day" });
        case "iii":
          return n.day(i, { width: "abbreviated", context: "formatting" });
        case "iiiii":
          return n.day(i, { width: "narrow", context: "formatting" });
        case "iiiiii":
          return n.day(i, { width: "short", context: "formatting" });
        default:
          return n.day(i, { width: "wide", context: "formatting" });
      }
    },
    a: function (e, t, n) {
      const i = e.getHours() / 12 >= 1 ? "pm" : "am";
      switch (t) {
        case "a":
        case "aa":
          return n.dayPeriod(i, { width: "abbreviated", context: "formatting" });
        case "aaa":
          return n.dayPeriod(i, { width: "abbreviated", context: "formatting" }).toLowerCase();
        case "aaaaa":
          return n.dayPeriod(i, { width: "narrow", context: "formatting" });
        default:
          return n.dayPeriod(i, { width: "wide", context: "formatting" });
      }
    },
    b: function (e, t, n) {
      const i = e.getHours();
      let r;
      switch (((r = 12 === i ? YC : 0 === i ? ZC : i / 12 >= 1 ? "pm" : "am"), t)) {
        case "b":
        case "bb":
          return n.dayPeriod(r, { width: "abbreviated", context: "formatting" });
        case "bbb":
          return n.dayPeriod(r, { width: "abbreviated", context: "formatting" }).toLowerCase();
        case "bbbbb":
          return n.dayPeriod(r, { width: "narrow", context: "formatting" });
        default:
          return n.dayPeriod(r, { width: "wide", context: "formatting" });
      }
    },
    B: function (e, t, n) {
      const i = e.getHours();
      let r;
      switch (((r = i >= 17 ? JC : i >= 12 ? QC : i >= 4 ? XC : eS), t)) {
        case "B":
        case "BB":
        case "BBB":
          return n.dayPeriod(r, { width: "abbreviated", context: "formatting" });
        case "BBBBB":
          return n.dayPeriod(r, { width: "narrow", context: "formatting" });
        default:
          return n.dayPeriod(r, { width: "wide", context: "formatting" });
      }
    },
    h: function (e, t, n) {
      if ("ho" === t) {
        let t = e.getHours() % 12;
        return (0 === t && (t = 12), n.ordinalNumber(t, { unit: "hour" }));
      }
      return GC.h(e, t);
    },
    H: function (e, t, n) {
      return "Ho" === t ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : GC.H(e, t);
    },
    K: function (e, t, n) {
      const i = e.getHours() % 12;
      return "Ko" === t ? n.ordinalNumber(i, { unit: "hour" }) : KC(i, t.length);
    },
    k: function (e, t, n) {
      let i = e.getHours();
      return (
        0 === i && (i = 24),
        "ko" === t ? n.ordinalNumber(i, { unit: "hour" }) : KC(i, t.length)
      );
    },
    m: function (e, t, n) {
      return "mo" === t ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : GC.m(e, t);
    },
    s: function (e, t, n) {
      return "so" === t ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : GC.s(e, t);
    },
    S: function (e, t) {
      return GC.S(e, t);
    },
    X: function (e, t, n) {
      const i = e.getTimezoneOffset();
      if (0 === i) return "Z";
      switch (t) {
        case "X":
          return iS(i);
        case "XXXX":
        case "XX":
          return rS(i);
        default:
          return rS(i, ":");
      }
    },
    x: function (e, t, n) {
      const i = e.getTimezoneOffset();
      switch (t) {
        case "x":
          return iS(i);
        case "xxxx":
        case "xx":
          return rS(i);
        default:
          return rS(i, ":");
      }
    },
    O: function (e, t, n) {
      const i = e.getTimezoneOffset();
      switch (t) {
        case "O":
        case "OO":
        case "OOO":
          return "GMT" + nS(i, ":");
        default:
          return "GMT" + rS(i, ":");
      }
    },
    z: function (e, t, n) {
      const i = e.getTimezoneOffset();
      switch (t) {
        case "z":
        case "zz":
        case "zzz":
          return "GMT" + nS(i, ":");
        default:
          return "GMT" + rS(i, ":");
      }
    },
    t: function (e, t, n) {
      return KC(Math.trunc(+e / 1e3), t.length);
    },
    T: function (e, t, n) {
      return KC(+e, t.length);
    },
  };
function nS(e, t = "") {
  const n = e > 0 ? "-" : "+",
    i = Math.abs(e),
    r = Math.trunc(i / 60),
    o = i % 60;
  return 0 === o ? n + String(r) : n + String(r) + t + KC(o, 2);
}
function iS(e, t) {
  if (e % 60 == 0) {
    return (e > 0 ? "-" : "+") + KC(Math.abs(e) / 60, 2);
  }
  return rS(e, t);
}
function rS(e, t = "") {
  const n = e > 0 ? "-" : "+",
    i = Math.abs(e);
  return n + KC(Math.trunc(i / 60), 2) + t + KC(i % 60, 2);
}
const oS = (e, t) => {
    switch (e) {
      case "P":
        return t.date({ width: "short" });
      case "PP":
        return t.date({ width: "medium" });
      case "PPP":
        return t.date({ width: "long" });
      default:
        return t.date({ width: "full" });
    }
  },
  sS = (e, t) => {
    switch (e) {
      case "p":
        return t.time({ width: "short" });
      case "pp":
        return t.time({ width: "medium" });
      case "ppp":
        return t.time({ width: "long" });
      default:
        return t.time({ width: "full" });
    }
  },
  aS = {
    p: sS,
    P: (e, t) => {
      const n = e.match(/(P+)(p+)?/) || [],
        i = n[1],
        r = n[2];
      if (!r) return oS(e, t);
      let o;
      switch (i) {
        case "P":
          o = t.dateTime({ width: "short" });
          break;
        case "PP":
          o = t.dateTime({ width: "medium" });
          break;
        case "PPP":
          o = t.dateTime({ width: "long" });
          break;
        default:
          o = t.dateTime({ width: "full" });
      }
      return o.replace("{{date}}", oS(i, t)).replace("{{time}}", sS(r, t));
    },
  },
  lS = /^D+$/,
  cS = /^Y+$/,
  dS = ["D", "DD", "YY", "YYYY"];
const uS = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,
  hS = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,
  gS = /^'([^]*?)'?$/,
  pS = /''/g,
  fS = /[a-zA-Z]/;
function mS(e, t, n) {
  const i = wC(),
    r = n?.locale ?? i.locale ?? zC,
    o =
      n?.firstWeekContainsDate ??
      n?.locale?.options?.firstWeekContainsDate ??
      i.firstWeekContainsDate ??
      i.locale?.options?.firstWeekContainsDate ??
      1,
    s =
      n?.weekStartsOn ??
      n?.locale?.options?.weekStartsOn ??
      i.weekStartsOn ??
      i.locale?.options?.weekStartsOn ??
      0,
    a = vC(e, n?.in);
  if (
    !(function (e) {
      return !((!TC(e) && "number" != typeof e) || isNaN(+vC(e)));
    })(a)
  )
    throw new RangeError("Invalid time value");
  let l = t
    .match(hS)
    .map((e) => {
      const t = e[0];
      if ("p" === t || "P" === t) {
        return (0, aS[t])(e, r.formatLong);
      }
      return e;
    })
    .join("")
    .match(uS)
    .map((e) => {
      if ("''" === e) return { isToken: !1, value: "'" };
      const t = e[0];
      if ("'" === t) return { isToken: !1, value: _S(e) };
      if (tS[t]) return { isToken: !0, value: e };
      if (t.match(fS))
        throw new RangeError(
          "Format string contains an unescaped latin alphabet character `" + t + "`",
        );
      return { isToken: !1, value: e };
    });
  r.localize.preprocessor && (l = r.localize.preprocessor(a, l));
  const c = { firstWeekContainsDate: o, weekStartsOn: s, locale: r };
  return l
    .map((i) => {
      if (!i.isToken) return i.value;
      const o = i.value;
      ((!n?.useAdditionalWeekYearTokens &&
        (function (e) {
          return cS.test(e);
        })(o)) ||
        (!n?.useAdditionalDayOfYearTokens &&
          (function (e) {
            return lS.test(e);
          })(o))) &&
        (function (e, t, n) {
          const i = (function (e, t, n) {
            const i = "Y" === e[0] ? "years" : "days of the month";
            return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
          })(e, t, n);
          if (dS.includes(e)) throw new RangeError(i);
        })(o, t, String(e));
      return (0, tS[o[0]])(a, o, r.localize, c);
    })
    .join("");
}
function _S(e) {
  const t = e.match(gS);
  return t ? t[1].replace(pS, "'") : e;
}
function vS(e, t, n) {
  return bC(e, -t, n);
}
function bS(e, t, n) {
  const i = vC(e, n?.in),
    r = i.getFullYear(),
    o = i.getDate(),
    s = _C(e, 0);
  (s.setFullYear(r, t, 15), s.setHours(0, 0, 0, 0));
  const a = (function (e, t) {
    const n = vC(e, t?.in),
      i = n.getFullYear(),
      r = n.getMonth(),
      o = _C(n, 0);
    return (o.setFullYear(i, r + 1, 0), o.setHours(0, 0, 0, 0), o.getDate());
  })(s);
  return (i.setMonth(t, Math.min(o, a)), i);
}
var yS,
  xS = { exports: {} };
/*!
 * clipboard.js v2.0.11
 * https://clipboardjs.com/
 *
 * Licensed MIT © Zeno Rocha
 */ ((yS = xS),
  (function (e, t) {
    yS.exports = t();
  })(0, function () {
    return (function () {
      var e = {
          686: function (e, t, n) {
            n.d(t, {
              default: function () {
                return w;
              },
            });
            var i = n(279),
              r = n.n(i),
              o = n(370),
              s = n.n(o),
              a = n(817),
              l = n.n(a);
            function c(e) {
              try {
                return document.execCommand(e);
              } catch (t) {
                return !1;
              }
            }
            var d = function (e) {
                var t = l()(e);
                return (c("cut"), t);
              },
              u = function (e, t) {
                var n = (function (e) {
                  var t = "rtl" === document.documentElement.getAttribute("dir"),
                    n = document.createElement("textarea");
                  ((n.style.fontSize = "12pt"),
                    (n.style.border = "0"),
                    (n.style.padding = "0"),
                    (n.style.margin = "0"),
                    (n.style.position = "absolute"),
                    (n.style[t ? "right" : "left"] = "-9999px"));
                  var i = window.pageYOffset || document.documentElement.scrollTop;
                  return (
                    (n.style.top = "".concat(i, "px")),
                    n.setAttribute("readonly", ""),
                    (n.value = e),
                    n
                  );
                })(e);
                t.container.appendChild(n);
                var i = l()(n);
                return (c("copy"), n.remove(), i);
              },
              h = function (e) {
                var t =
                    arguments.length > 1 && void 0 !== arguments[1]
                      ? arguments[1]
                      : { container: document.body },
                  n = "";
                return (
                  "string" == typeof e
                    ? (n = u(e, t))
                    : e instanceof HTMLInputElement &&
                        !["text", "search", "url", "tel", "password"].includes(
                          null == e ? void 0 : e.type,
                        )
                      ? (n = u(e.value, t))
                      : ((n = l()(e)), c("copy")),
                  n
                );
              };
            function g(e) {
              return (
                (g =
                  "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
                    ? function (e) {
                        return typeof e;
                      }
                    : function (e) {
                        return e &&
                          "function" == typeof Symbol &&
                          e.constructor === Symbol &&
                          e !== Symbol.prototype
                          ? "symbol"
                          : typeof e;
                      }),
                g(e)
              );
            }
            var p = function () {
              var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
                t = e.action,
                n = void 0 === t ? "copy" : t,
                i = e.container,
                r = e.target,
                o = e.text;
              if ("copy" !== n && "cut" !== n)
                throw new Error('Invalid "action" value, use either "copy" or "cut"');
              if (void 0 !== r) {
                if (!r || "object" !== g(r) || 1 !== r.nodeType)
                  throw new Error('Invalid "target" value, use a valid Element');
                if ("copy" === n && r.hasAttribute("disabled"))
                  throw new Error(
                    'Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute',
                  );
                if ("cut" === n && (r.hasAttribute("readonly") || r.hasAttribute("disabled")))
                  throw new Error(
                    'Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes',
                  );
              }
              return o
                ? h(o, { container: i })
                : r
                  ? "cut" === n
                    ? d(r)
                    : h(r, { container: i })
                  : void 0;
            };
            function f(e) {
              return (
                (f =
                  "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
                    ? function (e) {
                        return typeof e;
                      }
                    : function (e) {
                        return e &&
                          "function" == typeof Symbol &&
                          e.constructor === Symbol &&
                          e !== Symbol.prototype
                          ? "symbol"
                          : typeof e;
                      }),
                f(e)
              );
            }
            function m(e, t) {
              for (var n = 0; n < t.length; n++) {
                var i = t[n];
                ((i.enumerable = i.enumerable || !1),
                  (i.configurable = !0),
                  "value" in i && (i.writable = !0),
                  Object.defineProperty(e, i.key, i));
              }
            }
            function _(e, t) {
              return (
                (_ =
                  Object.setPrototypeOf ||
                  function (e, t) {
                    return ((e.__proto__ = t), e);
                  }),
                _(e, t)
              );
            }
            function v(e) {
              var t = (function () {
                if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
                if (Reflect.construct.sham) return !1;
                if ("function" == typeof Proxy) return !0;
                try {
                  return (
                    Date.prototype.toString.call(Reflect.construct(Date, [], function () {})),
                    !0
                  );
                } catch (spt) {
                  return !1;
                }
              })();
              return function () {
                var n,
                  i = b(e);
                if (t) {
                  var r = b(this).constructor;
                  n = Reflect.construct(i, arguments, r);
                } else n = i.apply(this, arguments);
                return (function (e, t) {
                  return !t || ("object" !== f(t) && "function" != typeof t)
                    ? (function (e) {
                        if (void 0 === e)
                          throw new ReferenceError(
                            "this hasn't been initialised - super() hasn't been called",
                          );
                        return e;
                      })(e)
                    : t;
                })(this, n);
              };
            }
            function b(e) {
              return (
                (b = Object.setPrototypeOf
                  ? Object.getPrototypeOf
                  : function (e) {
                      return e.__proto__ || Object.getPrototypeOf(e);
                    }),
                b(e)
              );
            }
            function y(e, t) {
              var n = "data-clipboard-".concat(e);
              if (t.hasAttribute(n)) return t.getAttribute(n);
            }
            var x = (function (e) {
                !(function (e, t) {
                  if ("function" != typeof t && null !== t)
                    throw new TypeError("Super expression must either be null or a function");
                  ((e.prototype = Object.create(t && t.prototype, {
                    constructor: { value: e, writable: !0, configurable: !0 },
                  })),
                    t && _(e, t));
                })(o, e);
                var t,
                  n,
                  i,
                  r = v(o);
                function o(e, t) {
                  var n;
                  return (
                    (function (e, t) {
                      if (!(e instanceof t))
                        throw new TypeError("Cannot call a class as a function");
                    })(this, o),
                    (n = r.call(this)).resolveOptions(t),
                    n.listenClick(e),
                    n
                  );
                }
                return (
                  (t = o),
                  (n = [
                    {
                      key: "resolveOptions",
                      value: function () {
                        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
                        ((this.action =
                          "function" == typeof e.action ? e.action : this.defaultAction),
                          (this.target =
                            "function" == typeof e.target ? e.target : this.defaultTarget),
                          (this.text = "function" == typeof e.text ? e.text : this.defaultText),
                          (this.container =
                            "object" === f(e.container) ? e.container : document.body));
                      },
                    },
                    {
                      key: "listenClick",
                      value: function (e) {
                        var t = this;
                        this.listener = s()(e, "click", function (e) {
                          return t.onClick(e);
                        });
                      },
                    },
                    {
                      key: "onClick",
                      value: function (e) {
                        var t = e.delegateTarget || e.currentTarget,
                          n = this.action(t) || "copy",
                          i = p({
                            action: n,
                            container: this.container,
                            target: this.target(t),
                            text: this.text(t),
                          });
                        this.emit(i ? "success" : "error", {
                          action: n,
                          text: i,
                          trigger: t,
                          clearSelection: function () {
                            (t && t.focus(), window.getSelection().removeAllRanges());
                          },
                        });
                      },
                    },
                    {
                      key: "defaultAction",
                      value: function (e) {
                        return y("action", e);
                      },
                    },
                    {
                      key: "defaultTarget",
                      value: function (e) {
                        var t = y("target", e);
                        if (t) return document.querySelector(t);
                      },
                    },
                    {
                      key: "defaultText",
                      value: function (e) {
                        return y("text", e);
                      },
                    },
                    {
                      key: "destroy",
                      value: function () {
                        this.listener.destroy();
                      },
                    },
                  ]),
                  (i = [
                    {
                      key: "copy",
                      value: function (e) {
                        var t =
                          arguments.length > 1 && void 0 !== arguments[1]
                            ? arguments[1]
                            : { container: document.body };
                        return h(e, t);
                      },
                    },
                    {
                      key: "cut",
                      value: function (e) {
                        return d(e);
                      },
                    },
                    {
                      key: "isSupported",
                      value: function () {
                        var e =
                            arguments.length > 0 && void 0 !== arguments[0]
                              ? arguments[0]
                              : ["copy", "cut"],
                          t = "string" == typeof e ? [e] : e,
                          n = !!document.queryCommandSupported;
                        return (
                          t.forEach(function (e) {
                            n = n && !!document.queryCommandSupported(e);
                          }),
                          n
                        );
                      },
                    },
                  ]),
                  n && m(t.prototype, n),
                  i && m(t, i),
                  o
                );
              })(r()),
              w = x;
          },
          828: function (e) {
            if ("undefined" != typeof Element && !Element.prototype.matches) {
              var t = Element.prototype;
              t.matches =
                t.matchesSelector ||
                t.mozMatchesSelector ||
                t.msMatchesSelector ||
                t.oMatchesSelector ||
                t.webkitMatchesSelector;
            }
            e.exports = function (e, t) {
              for (; e && 9 !== e.nodeType; ) {
                if ("function" == typeof e.matches && e.matches(t)) return e;
                e = e.parentNode;
              }
            };
          },
          438: function (e, t, n) {
            var i = n(828);
            function r(e, t, n, i, r) {
              var s = o.apply(this, arguments);
              return (
                e.addEventListener(n, s, r),
                {
                  destroy: function () {
                    e.removeEventListener(n, s, r);
                  },
                }
              );
            }
            function o(e, t, n, r) {
              return function (n) {
                ((n.delegateTarget = i(n.target, t)), n.delegateTarget && r.call(e, n));
              };
            }
            e.exports = function (e, t, n, i, o) {
              return "function" == typeof e.addEventListener
                ? r.apply(null, arguments)
                : "function" == typeof n
                  ? r.bind(null, document).apply(null, arguments)
                  : ("string" == typeof e && (e = document.querySelectorAll(e)),
                    Array.prototype.map.call(e, function (e) {
                      return r(e, t, n, i, o);
                    }));
            };
          },
          879: function (e, t) {
            ((t.node = function (e) {
              return void 0 !== e && e instanceof HTMLElement && 1 === e.nodeType;
            }),
              (t.nodeList = function (e) {
                var n = Object.prototype.toString.call(e);
                return (
                  void 0 !== e &&
                  ("[object NodeList]" === n || "[object HTMLCollection]" === n) &&
                  "length" in e &&
                  (0 === e.length || t.node(e[0]))
                );
              }),
              (t.string = function (e) {
                return "string" == typeof e || e instanceof String;
              }),
              (t.fn = function (e) {
                return "[object Function]" === Object.prototype.toString.call(e);
              }));
          },
          370: function (e, t, n) {
            var i = n(879),
              r = n(438);
            e.exports = function (e, t, n) {
              if (!e && !t && !n) throw new Error("Missing required arguments");
              if (!i.string(t)) throw new TypeError("Second argument must be a String");
              if (!i.fn(n)) throw new TypeError("Third argument must be a Function");
              if (i.node(e))
                return (function (e, t, n) {
                  return (
                    e.addEventListener(t, n),
                    {
                      destroy: function () {
                        e.removeEventListener(t, n);
                      },
                    }
                  );
                })(e, t, n);
              if (i.nodeList(e))
                return (function (e, t, n) {
                  return (
                    Array.prototype.forEach.call(e, function (e) {
                      e.addEventListener(t, n);
                    }),
                    {
                      destroy: function () {
                        Array.prototype.forEach.call(e, function (e) {
                          e.removeEventListener(t, n);
                        });
                      },
                    }
                  );
                })(e, t, n);
              if (i.string(e))
                return (function (e, t, n) {
                  return r(document.body, e, t, n);
                })(e, t, n);
              throw new TypeError(
                "First argument must be a String, HTMLElement, HTMLCollection, or NodeList",
              );
            };
          },
          817: function (e) {
            e.exports = function (e) {
              var t;
              if ("SELECT" === e.nodeName) (e.focus(), (t = e.value));
              else if ("INPUT" === e.nodeName || "TEXTAREA" === e.nodeName) {
                var n = e.hasAttribute("readonly");
                (n || e.setAttribute("readonly", ""),
                  e.select(),
                  e.setSelectionRange(0, e.value.length),
                  n || e.removeAttribute("readonly"),
                  (t = e.value));
              } else {
                e.hasAttribute("contenteditable") && e.focus();
                var i = window.getSelection(),
                  r = document.createRange();
                (r.selectNodeContents(e), i.removeAllRanges(), i.addRange(r), (t = i.toString()));
              }
              return t;
            };
          },
          279: function (e) {
            function t() {}
            ((t.prototype = {
              on: function (e, t, n) {
                var i = this.e || (this.e = {});
                return ((i[e] || (i[e] = [])).push({ fn: t, ctx: n }), this);
              },
              once: function (e, t, n) {
                var i = this;
                function r() {
                  (i.off(e, r), t.apply(n, arguments));
                }
                return ((r._ = t), this.on(e, r, n));
              },
              emit: function (e) {
                for (
                  var t = [].slice.call(arguments, 1),
                    n = ((this.e || (this.e = {}))[e] || []).slice(),
                    i = 0,
                    r = n.length;
                  i < r;
                  i++
                )
                  n[i].fn.apply(n[i].ctx, t);
                return this;
              },
              off: function (e, t) {
                var n = this.e || (this.e = {}),
                  i = n[e],
                  r = [];
                if (i && t)
                  for (var o = 0, s = i.length; o < s; o++)
                    i[o].fn !== t && i[o].fn._ !== t && r.push(i[o]);
                return (r.length ? (n[e] = r) : delete n[e], this);
              },
            }),
              (e.exports = t),
              (e.exports.TinyEmitter = t));
          },
        },
        t = {};
      function n(i) {
        if (t[i]) return t[i].exports;
        var r = (t[i] = { exports: {} });
        return (e[i](r, r.exports, n), r.exports);
      }
      return (
        (n.n = function (e) {
          var t =
            e && e.__esModule
              ? function () {
                  return e.default;
                }
              : function () {
                  return e;
                };
          return (n.d(t, { a: t }), t);
        }),
        (n.d = function (e, t) {
          for (var i in t)
            n.o(t, i) && !n.o(e, i) && Object.defineProperty(e, i, { enumerable: !0, get: t[i] });
        }),
        (n.o = function (e, t) {
          return Object.prototype.hasOwnProperty.call(e, t);
        }),
        n(686)
      );
    })().default;
  }));
const wS = n(xS.exports);
function CS(e = void 0, t = "yyyy-MM-dd HH:mm:ss") {
  return null == e
    ? ""
    : (10 === Math.floor(e).toString().length && (e *= 1e3), mS(new Date(e), t));
}
function SS(e = void 0, t = "yyyy-MM-dd") {
  return CS(e, t);
}
const kS = (e) => 60 * (480 + e.getTimezoneOffset()) * 1e3;
function ES(e) {
  const t = kS(e);
  return new Date(e.getTime() + t);
}
function NS(e) {
  const t = kS(e);
  return new Date(e.getTime() - t);
}
function LS(e) {
  const t = "string" == typeof e ? parseFloat(e) : e;
  if (isNaN(t)) return "0.00";
  return t.toFixed(2);
}
function DS(e, t = !0) {
  if (null == e) return t ? "¥0.00" : "0.00";
  const n = "string" == typeof e ? parseFloat(e) : e;
  if (isNaN(n)) return t ? "¥0.00" : "0.00";
  const i = (n / 100).toFixed(2).replace(/\.?0+$/, (e) => (e.includes(".") ? ".00" : e));
  return t ? `¥${i}` : i;
}
function TS(e) {
  return new Promise((t) => {
    try {
      const n = document.createElement("button");
      ((n.style.position = "fixed"),
        (n.style.left = "-9999px"),
        (n.style.opacity = "0"),
        n.setAttribute("data-clipboard-text", e),
        document.body.appendChild(n));
      let i = null,
        r = !1;
      const o = () => {
        r ||
          ((r = !0), i && (i.destroy(), (i = null)), n.parentNode && n.parentNode.removeChild(n));
      };
      ((i = new wS(n)),
        i.on("success", () => {
          (o(), t(!0));
        }),
        i.on("error", (e) => {
          (o(), t(!1));
        }),
        n.click());
    } catch (D2t) {
      t(!1);
    }
  });
}
function IS(e) {
  if (null == e || e <= 0) return "0 B";
  const t = ["B", "KB", "MB", "GB", "TB"];
  let n = Math.floor(Math.log(e) / Math.log(1024));
  return (
    n < 0 ? (n = 0) : n >= t.length && (n = t.length - 1),
    `${parseFloat((e / Math.pow(1024, n)).toFixed(2))} ${t[n]}`
  );
}
function RS(e) {
  if (!e || e < 0) return "-";
  const t = Math.floor(e / 86400),
    n = Math.floor((e % 86400) / 3600),
    i = Math.floor((e % 3600) / 60),
    r = Math.floor(e % 60);
  return t > 0 ? `${t}d ${n}h` : n > 0 ? `${n}h ${i}m` : i > 0 ? `${i}m ${r}s` : `${r}s`;
}
function OS(e, t) {
  return function () {
    return e.apply(t, arguments);
  };
}
const { toString: MS } = Object.prototype,
  { getPrototypeOf: AS } = Object,
  { iterator: PS, toStringTag: jS } = Symbol,
  FS = ((e) => (t) => {
    const n = MS.call(t);
    return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
  })(Object.create(null)),
  BS = (e) => ((e = e.toLowerCase()), (t) => FS(t) === e),
  VS = (e) => (t) => typeof t === e,
  { isArray: WS } = Array,
  HS = VS("undefined");
function zS(e) {
  return (
    null !== e &&
    !HS(e) &&
    null !== e.constructor &&
    !HS(e.constructor) &&
    qS(e.constructor.isBuffer) &&
    e.constructor.isBuffer(e)
  );
}
const US = BS("ArrayBuffer");
const $S = VS("string"),
  qS = VS("function"),
  KS = VS("number"),
  GS = (e) => null !== e && "object" == typeof e,
  ZS = (e) => {
    if ("object" !== FS(e)) return !1;
    const t = AS(e);
    return !(
      (null !== t && t !== Object.prototype && null !== Object.getPrototypeOf(t)) ||
      jS in e ||
      PS in e
    );
  },
  YS = BS("Date"),
  XS = BS("File"),
  QS = BS("Blob"),
  JS = BS("FileList"),
  ek = BS("URLSearchParams"),
  [tk, nk, ik, rk] = ["ReadableStream", "Request", "Response", "Headers"].map(BS);
function ok(e, t, { allOwnKeys: n = !1 } = {}) {
  if (null == e) return;
  let i, r;
  if (("object" != typeof e && (e = [e]), WS(e)))
    for (i = 0, r = e.length; i < r; i++) t.call(null, e[i], i, e);
  else {
    if (zS(e)) return;
    const r = n ? Object.getOwnPropertyNames(e) : Object.keys(e),
      o = r.length;
    let s;
    for (i = 0; i < o; i++) ((s = r[i]), t.call(null, e[s], s, e));
  }
}
function sk(e, t) {
  if (zS(e)) return null;
  t = t.toLowerCase();
  const n = Object.keys(e);
  let i,
    r = n.length;
  for (; r-- > 0; ) if (((i = n[r]), t === i.toLowerCase())) return i;
  return null;
}
const ak =
    "undefined" != typeof globalThis
      ? globalThis
      : "undefined" != typeof self
        ? self
        : "undefined" != typeof window
          ? window
          : global,
  lk = (e) => !HS(e) && e !== ak;
const ck =
  ((dk = "undefined" != typeof Uint8Array && AS(Uint8Array)), (e) => dk && e instanceof dk);
var dk;
const uk = BS("HTMLFormElement"),
  hk = (
    ({ hasOwnProperty: e }) =>
    (t, n) =>
      e.call(t, n)
  )(Object.prototype),
  gk = BS("RegExp"),
  pk = (e, t) => {
    const n = Object.getOwnPropertyDescriptors(e),
      i = {};
    (ok(n, (n, r) => {
      let o;
      !1 !== (o = t(n, r, e)) && (i[r] = o || n);
    }),
      Object.defineProperties(e, i));
  };
const fk = BS("AsyncFunction"),
  mk =
    ((_k = "function" == typeof setImmediate),
    (vk = qS(ak.postMessage)),
    _k
      ? setImmediate
      : vk
        ? ((bk = `axios@${Math.random()}`),
          (yk = []),
          ak.addEventListener(
            "message",
            ({ source: e, data: t }) => {
              e === ak && t === bk && yk.length && yk.shift()();
            },
            !1,
          ),
          (e) => {
            (yk.push(e), ak.postMessage(bk, "*"));
          })
        : (e) => setTimeout(e));
var _k, vk, bk, yk;
const xk =
    "undefined" != typeof queueMicrotask
      ? queueMicrotask.bind(ak)
      : ("undefined" != typeof process && process.nextTick) || mk,
  wk = {
    isArray: WS,
    isArrayBuffer: US,
    isBuffer: zS,
    isFormData: (e) => {
      let t;
      return (
        e &&
        (("function" == typeof FormData && e instanceof FormData) ||
          (qS(e.append) &&
            ("formdata" === (t = FS(e)) ||
              ("object" === t && qS(e.toString) && "[object FormData]" === e.toString()))))
      );
    },
    isArrayBufferView: function (e) {
      let t;
      return (
        (t =
          "undefined" != typeof ArrayBuffer && ArrayBuffer.isView
            ? ArrayBuffer.isView(e)
            : e && e.buffer && US(e.buffer)),
        t
      );
    },
    isString: $S,
    isNumber: KS,
    isBoolean: (e) => !0 === e || !1 === e,
    isObject: GS,
    isPlainObject: ZS,
    isEmptyObject: (e) => {
      if (!GS(e) || zS(e)) return !1;
      try {
        return 0 === Object.keys(e).length && Object.getPrototypeOf(e) === Object.prototype;
      } catch (spt) {
        return !1;
      }
    },
    isReadableStream: tk,
    isRequest: nk,
    isResponse: ik,
    isHeaders: rk,
    isUndefined: HS,
    isDate: YS,
    isFile: XS,
    isBlob: QS,
    isRegExp: gk,
    isFunction: qS,
    isStream: (e) => GS(e) && qS(e.pipe),
    isURLSearchParams: ek,
    isTypedArray: ck,
    isFileList: JS,
    forEach: ok,
    merge: function e() {
      const { caseless: t, skipUndefined: n } = (lk(this) && this) || {},
        i = {},
        r = (r, o) => {
          const s = (t && sk(i, o)) || o;
          ZS(i[s]) && ZS(r)
            ? (i[s] = e(i[s], r))
            : ZS(r)
              ? (i[s] = e({}, r))
              : WS(r)
                ? (i[s] = r.slice())
                : (n && HS(r)) || (i[s] = r);
        };
      for (let o = 0, s = arguments.length; o < s; o++) arguments[o] && ok(arguments[o], r);
      return i;
    },
    extend: (e, t, n, { allOwnKeys: i } = {}) => (
      ok(
        t,
        (t, i) => {
          n && qS(t) ? (e[i] = OS(t, n)) : (e[i] = t);
        },
        { allOwnKeys: i },
      ),
      e
    ),
    trim: (e) => (e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")),
    stripBOM: (e) => (65279 === e.charCodeAt(0) && (e = e.slice(1)), e),
    inherits: (e, t, n, i) => {
      ((e.prototype = Object.create(t.prototype, i)),
        (e.prototype.constructor = e),
        Object.defineProperty(e, "super", { value: t.prototype }),
        n && Object.assign(e.prototype, n));
    },
    toFlatObject: (e, t, n, i) => {
      let r, o, s;
      const a = {};
      if (((t = t || {}), null == e)) return t;
      do {
        for (r = Object.getOwnPropertyNames(e), o = r.length; o-- > 0; )
          ((s = r[o]), (i && !i(s, e, t)) || a[s] || ((t[s] = e[s]), (a[s] = !0)));
        e = !1 !== n && AS(e);
      } while (e && (!n || n(e, t)) && e !== Object.prototype);
      return t;
    },
    kindOf: FS,
    kindOfTest: BS,
    endsWith: (e, t, n) => {
      ((e = String(e)), (void 0 === n || n > e.length) && (n = e.length), (n -= t.length));
      const i = e.indexOf(t, n);
      return -1 !== i && i === n;
    },
    toArray: (e) => {
      if (!e) return null;
      if (WS(e)) return e;
      let t = e.length;
      if (!KS(t)) return null;
      const n = new Array(t);
      for (; t-- > 0; ) n[t] = e[t];
      return n;
    },
    forEachEntry: (e, t) => {
      const n = (e && e[PS]).call(e);
      let i;
      for (; (i = n.next()) && !i.done; ) {
        const n = i.value;
        t.call(e, n[0], n[1]);
      }
    },
    matchAll: (e, t) => {
      let n;
      const i = [];
      for (; null !== (n = e.exec(t)); ) i.push(n);
      return i;
    },
    isHTMLForm: uk,
    hasOwnProperty: hk,
    hasOwnProp: hk,
    reduceDescriptors: pk,
    freezeMethods: (e) => {
      pk(e, (t, n) => {
        if (qS(e) && -1 !== ["arguments", "caller", "callee"].indexOf(n)) return !1;
        const i = e[n];
        qS(i) &&
          ((t.enumerable = !1),
          "writable" in t
            ? (t.writable = !1)
            : t.set ||
              (t.set = () => {
                throw Error("Can not rewrite read-only method '" + n + "'");
              }));
      });
    },
    toObjectSet: (e, t) => {
      const n = {},
        i = (e) => {
          e.forEach((e) => {
            n[e] = !0;
          });
        };
      return (WS(e) ? i(e) : i(String(e).split(t)), n);
    },
    toCamelCase: (e) =>
      e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function (e, t, n) {
        return t.toUpperCase() + n;
      }),
    noop: () => {},
    toFiniteNumber: (e, t) => (null != e && Number.isFinite((e = +e)) ? e : t),
    findKey: sk,
    global: ak,
    isContextDefined: lk,
    isSpecCompliantForm: function (e) {
      return !!(e && qS(e.append) && "FormData" === e[jS] && e[PS]);
    },
    toJSONObject: (e) => {
      const t = new Array(10),
        n = (e, i) => {
          if (GS(e)) {
            if (t.indexOf(e) >= 0) return;
            if (zS(e)) return e;
            if (!("toJSON" in e)) {
              t[i] = e;
              const r = WS(e) ? [] : {};
              return (
                ok(e, (e, t) => {
                  const o = n(e, i + 1);
                  !HS(o) && (r[t] = o);
                }),
                (t[i] = void 0),
                r
              );
            }
          }
          return e;
        };
      return n(e, 0);
    },
    isAsyncFn: fk,
    isThenable: (e) => e && (GS(e) || qS(e)) && qS(e.then) && qS(e.catch),
    setImmediate: mk,
    asap: xk,
    isIterable: (e) => null != e && qS(e[PS]),
  };
function Ck(e, t, n, i, r) {
  (Error.call(this),
    Error.captureStackTrace
      ? Error.captureStackTrace(this, this.constructor)
      : (this.stack = new Error().stack),
    (this.message = e),
    (this.name = "AxiosError"),
    t && (this.code = t),
    n && (this.config = n),
    i && (this.request = i),
    r && ((this.response = r), (this.status = r.status ? r.status : null)));
}
wk.inherits(Ck, Error, {
  toJSON: function () {
    return {
      message: this.message,
      name: this.name,
      description: this.description,
      number: this.number,
      fileName: this.fileName,
      lineNumber: this.lineNumber,
      columnNumber: this.columnNumber,
      stack: this.stack,
      config: wk.toJSONObject(this.config),
      code: this.code,
      status: this.status,
    };
  },
});
const Sk = Ck.prototype,
  kk = {};
([
  "ERR_BAD_OPTION_VALUE",
  "ERR_BAD_OPTION",
  "ECONNABORTED",
  "ETIMEDOUT",
  "ERR_NETWORK",
  "ERR_FR_TOO_MANY_REDIRECTS",
  "ERR_DEPRECATED",
  "ERR_BAD_RESPONSE",
  "ERR_BAD_REQUEST",
  "ERR_CANCELED",
  "ERR_NOT_SUPPORT",
  "ERR_INVALID_URL",
].forEach((e) => {
  kk[e] = { value: e };
}),
  Object.defineProperties(Ck, kk),
  Object.defineProperty(Sk, "isAxiosError", { value: !0 }),
  (Ck.from = (e, t, n, i, r, o) => {
    const s = Object.create(Sk);
    wk.toFlatObject(
      e,
      s,
      function (e) {
        return e !== Error.prototype;
      },
      (e) => "isAxiosError" !== e,
    );
    const a = e && e.message ? e.message : "Error",
      l = null == t && e ? e.code : t;
    return (
      Ck.call(s, a, l, n, i, r),
      e && null == s.cause && Object.defineProperty(s, "cause", { value: e, configurable: !0 }),
      (s.name = (e && e.name) || "Error"),
      o && Object.assign(s, o),
      s
    );
  }));
function Ek(e) {
  return wk.isPlainObject(e) || wk.isArray(e);
}
function Nk(e) {
  return wk.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Lk(e, t, n) {
  return e
    ? e
        .concat(t)
        .map(function (e, t) {
          return ((e = Nk(e)), !n && t ? "[" + e + "]" : e);
        })
        .join(n ? "." : "")
    : t;
}
const Dk = wk.toFlatObject(wk, {}, null, function (e) {
  return /^is[A-Z]/.test(e);
});
function Tk(e, t, n) {
  if (!wk.isObject(e)) throw new TypeError("target must be an object");
  ((t = t || new FormData()),
    (n = wk.toFlatObject(n, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function (e, t) {
      return !wk.isUndefined(t[e]);
    })));
  const i = n.metaTokens,
    r = n.visitor || c,
    o = n.dots,
    s = n.indexes,
    a = (n.Blob || ("undefined" != typeof Blob && Blob)) && wk.isSpecCompliantForm(t);
  if (!wk.isFunction(r)) throw new TypeError("visitor must be a function");
  function l(e) {
    if (null === e) return "";
    if (wk.isDate(e)) return e.toISOString();
    if (wk.isBoolean(e)) return e.toString();
    if (!a && wk.isBlob(e)) throw new Ck("Blob is not supported. Use a Buffer instead.");
    return wk.isArrayBuffer(e) || wk.isTypedArray(e)
      ? a && "function" == typeof Blob
        ? new Blob([e])
        : Buffer.from(e)
      : e;
  }
  function c(e, n, r) {
    let a = e;
    if (e && !r && "object" == typeof e)
      if (wk.endsWith(n, "{}")) ((n = i ? n : n.slice(0, -2)), (e = JSON.stringify(e)));
      else if (
        (wk.isArray(e) &&
          (function (e) {
            return wk.isArray(e) && !e.some(Ek);
          })(e)) ||
        ((wk.isFileList(e) || wk.endsWith(n, "[]")) && (a = wk.toArray(e)))
      )
        return (
          (n = Nk(n)),
          a.forEach(function (e, i) {
            !wk.isUndefined(e) &&
              null !== e &&
              t.append(!0 === s ? Lk([n], i, o) : null === s ? n : n + "[]", l(e));
          }),
          !1
        );
    return !!Ek(e) || (t.append(Lk(r, n, o), l(e)), !1);
  }
  const d = [],
    u = Object.assign(Dk, { defaultVisitor: c, convertValue: l, isVisitable: Ek });
  if (!wk.isObject(e)) throw new TypeError("data must be an object");
  return (
    (function e(n, i) {
      if (!wk.isUndefined(n)) {
        if (-1 !== d.indexOf(n)) throw Error("Circular reference detected in " + i.join("."));
        (d.push(n),
          wk.forEach(n, function (n, o) {
            !0 ===
              (!(wk.isUndefined(n) || null === n) &&
                r.call(t, n, wk.isString(o) ? o.trim() : o, i, u)) && e(n, i ? i.concat(o) : [o]);
          }),
          d.pop());
      }
    })(e),
    t
  );
}
function Ik(e) {
  const t = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" };
  return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function (e) {
    return t[e];
  });
}
function Rk(e, t) {
  ((this._pairs = []), e && Tk(e, this, t));
}
const Ok = Rk.prototype;
function Mk(e) {
  return encodeURIComponent(e)
    .replace(/%3A/gi, ":")
    .replace(/%24/g, "$")
    .replace(/%2C/gi, ",")
    .replace(/%20/g, "+");
}
function Ak(e, t, n) {
  if (!t) return e;
  const i = (n && n.encode) || Mk;
  wk.isFunction(n) && (n = { serialize: n });
  const r = n && n.serialize;
  let o;
  if (((o = r ? r(t, n) : wk.isURLSearchParams(t) ? t.toString() : new Rk(t, n).toString(i)), o)) {
    const t = e.indexOf("#");
    (-1 !== t && (e = e.slice(0, t)), (e += (-1 === e.indexOf("?") ? "?" : "&") + o));
  }
  return e;
}
((Ok.append = function (e, t) {
  this._pairs.push([e, t]);
}),
  (Ok.toString = function (e) {
    const t = e
      ? function (t) {
          return e.call(this, t, Ik);
        }
      : Ik;
    return this._pairs
      .map(function (e) {
        return t(e[0]) + "=" + t(e[1]);
      }, "")
      .join("&");
  }));
class Pk {
  constructor() {
    this.handlers = [];
  }
  use(e, t, n) {
    return (
      this.handlers.push({
        fulfilled: e,
        rejected: t,
        synchronous: !!n && n.synchronous,
        runWhen: n ? n.runWhen : null,
      }),
      this.handlers.length - 1
    );
  }
  eject(e) {
    this.handlers[e] && (this.handlers[e] = null);
  }
  clear() {
    this.handlers && (this.handlers = []);
  }
  forEach(e) {
    wk.forEach(this.handlers, function (t) {
      null !== t && e(t);
    });
  }
}
const jk = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 },
  Fk = {
    isBrowser: !0,
    classes: {
      URLSearchParams: "undefined" != typeof URLSearchParams ? URLSearchParams : Rk,
      FormData: "undefined" != typeof FormData ? FormData : null,
      Blob: "undefined" != typeof Blob ? Blob : null,
    },
    protocols: ["http", "https", "file", "blob", "url", "data"],
  },
  Bk = "undefined" != typeof window && "undefined" != typeof document,
  Vk = ("object" == typeof navigator && navigator) || void 0,
  Wk = Bk && (!Vk || ["ReactNative", "NativeScript", "NS"].indexOf(Vk.product) < 0),
  Hk =
    "undefined" != typeof WorkerGlobalScope &&
    self instanceof WorkerGlobalScope &&
    "function" == typeof self.importScripts,
  zk = (Bk && window.location.href) || "http://localhost",
  Uk = {
    ...Object.freeze(
      Object.defineProperty(
        {
          __proto__: null,
          hasBrowserEnv: Bk,
          hasStandardBrowserEnv: Wk,
          hasStandardBrowserWebWorkerEnv: Hk,
          navigator: Vk,
          origin: zk,
        },
        Symbol.toStringTag,
        { value: "Module" },
      ),
    ),
    ...Fk,
  };
function $k(e) {
  function t(e, n, i, r) {
    let o = e[r++];
    if ("__proto__" === o) return !0;
    const s = Number.isFinite(+o),
      a = r >= e.length;
    if (((o = !o && wk.isArray(i) ? i.length : o), a))
      return (wk.hasOwnProp(i, o) ? (i[o] = [i[o], n]) : (i[o] = n), !s);
    (i[o] && wk.isObject(i[o])) || (i[o] = []);
    return (
      t(e, n, i[o], r) &&
        wk.isArray(i[o]) &&
        (i[o] = (function (e) {
          const t = {},
            n = Object.keys(e);
          let i;
          const r = n.length;
          let o;
          for (i = 0; i < r; i++) ((o = n[i]), (t[o] = e[o]));
          return t;
        })(i[o])),
      !s
    );
  }
  if (wk.isFormData(e) && wk.isFunction(e.entries)) {
    const n = {};
    return (
      wk.forEachEntry(e, (e, i) => {
        t(
          (function (e) {
            return wk.matchAll(/\w+|\[(\w*)]/g, e).map((e) => ("[]" === e[0] ? "" : e[1] || e[0]));
          })(e),
          i,
          n,
          0,
        );
      }),
      n
    );
  }
  return null;
}
const qk = {
  transitional: jk,
  adapter: ["xhr", "http", "fetch"],
  transformRequest: [
    function (e, t) {
      const n = t.getContentType() || "",
        i = n.indexOf("application/json") > -1,
        r = wk.isObject(e);
      r && wk.isHTMLForm(e) && (e = new FormData(e));
      if (wk.isFormData(e)) return i ? JSON.stringify($k(e)) : e;
      if (
        wk.isArrayBuffer(e) ||
        wk.isBuffer(e) ||
        wk.isStream(e) ||
        wk.isFile(e) ||
        wk.isBlob(e) ||
        wk.isReadableStream(e)
      )
        return e;
      if (wk.isArrayBufferView(e)) return e.buffer;
      if (wk.isURLSearchParams(e))
        return (
          t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1),
          e.toString()
        );
      let o;
      if (r) {
        if (n.indexOf("application/x-www-form-urlencoded") > -1)
          return (function (e, t) {
            return Tk(e, new Uk.classes.URLSearchParams(), {
              visitor: function (e, t, n, i) {
                return Uk.isNode && wk.isBuffer(e)
                  ? (this.append(t, e.toString("base64")), !1)
                  : i.defaultVisitor.apply(this, arguments);
              },
              ...t,
            });
          })(e, this.formSerializer).toString();
        if ((o = wk.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
          const t = this.env && this.env.FormData;
          return Tk(o ? { "files[]": e } : e, t && new t(), this.formSerializer);
        }
      }
      return r || i
        ? (t.setContentType("application/json", !1),
          (function (e, t, n) {
            if (wk.isString(e))
              try {
                return ((t || JSON.parse)(e), wk.trim(e));
              } catch (spt) {
                if ("SyntaxError" !== spt.name) throw spt;
              }
            return (n || JSON.stringify)(e);
          })(e))
        : e;
    },
  ],
  transformResponse: [
    function (e) {
      const t = this.transitional || qk.transitional,
        n = t && t.forcedJSONParsing,
        i = "json" === this.responseType;
      if (wk.isResponse(e) || wk.isReadableStream(e)) return e;
      if (e && wk.isString(e) && ((n && !this.responseType) || i)) {
        const n = !(t && t.silentJSONParsing) && i;
        try {
          return JSON.parse(e, this.parseReviver);
        } catch (spt) {
          if (n) {
            if ("SyntaxError" === spt.name)
              throw Ck.from(spt, Ck.ERR_BAD_RESPONSE, this, null, this.response);
            throw spt;
          }
        }
      }
      return e;
    },
  ],
  timeout: 0,
  xsrfCookieName: "XSRF-TOKEN",
  xsrfHeaderName: "X-XSRF-TOKEN",
  maxContentLength: -1,
  maxBodyLength: -1,
  env: { FormData: Uk.classes.FormData, Blob: Uk.classes.Blob },
  validateStatus: function (e) {
    return e >= 200 && e < 300;
  },
  headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } },
};
wk.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
  qk.headers[e] = {};
});
const Kk = wk.toObjectSet([
    "age",
    "authorization",
    "content-length",
    "content-type",
    "etag",
    "expires",
    "from",
    "host",
    "if-modified-since",
    "if-unmodified-since",
    "last-modified",
    "location",
    "max-forwards",
    "proxy-authorization",
    "referer",
    "retry-after",
    "user-agent",
  ]),
  Gk = Symbol("internals");
function Zk(e) {
  return e && String(e).trim().toLowerCase();
}
function Yk(e) {
  return !1 === e || null == e ? e : wk.isArray(e) ? e.map(Yk) : String(e);
}
function Xk(e, t, n, i, r) {
  return wk.isFunction(i)
    ? i.call(this, t, n)
    : (r && (t = n),
      wk.isString(t)
        ? wk.isString(i)
          ? -1 !== t.indexOf(i)
          : wk.isRegExp(i)
            ? i.test(t)
            : void 0
        : void 0);
}
let Qk = class {
  constructor(e) {
    e && this.set(e);
  }
  set(e, t, n) {
    const i = this;
    function r(e, t, n) {
      const r = Zk(t);
      if (!r) throw new Error("header name must be a non-empty string");
      const o = wk.findKey(i, r);
      (!o || void 0 === i[o] || !0 === n || (void 0 === n && !1 !== i[o])) && (i[o || t] = Yk(e));
    }
    const o = (e, t) => wk.forEach(e, (e, n) => r(e, n, t));
    if (wk.isPlainObject(e) || e instanceof this.constructor) o(e, t);
    else if (wk.isString(e) && (e = e.trim()) && !/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))
      o(
        ((e) => {
          const t = {};
          let n, i, r;
          return (
            e &&
              e.split("\n").forEach(function (e) {
                ((r = e.indexOf(":")),
                  (n = e.substring(0, r).trim().toLowerCase()),
                  (i = e.substring(r + 1).trim()),
                  !n ||
                    (t[n] && Kk[n]) ||
                    ("set-cookie" === n
                      ? t[n]
                        ? t[n].push(i)
                        : (t[n] = [i])
                      : (t[n] = t[n] ? t[n] + ", " + i : i)));
              }),
            t
          );
        })(e),
        t,
      );
    else if (wk.isObject(e) && wk.isIterable(e)) {
      let n,
        i,
        r = {};
      for (const t of e) {
        if (!wk.isArray(t)) throw TypeError("Object iterator must return a key-value pair");
        r[(i = t[0])] = (n = r[i]) ? (wk.isArray(n) ? [...n, t[1]] : [n, t[1]]) : t[1];
      }
      o(r, t);
    } else null != e && r(t, e, n);
    return this;
  }
  get(e, t) {
    if ((e = Zk(e))) {
      const n = wk.findKey(this, e);
      if (n) {
        const e = this[n];
        if (!t) return e;
        if (!0 === t)
          return (function (e) {
            const t = Object.create(null),
              n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
            let i;
            for (; (i = n.exec(e)); ) t[i[1]] = i[2];
            return t;
          })(e);
        if (wk.isFunction(t)) return t.call(this, e, n);
        if (wk.isRegExp(t)) return t.exec(e);
        throw new TypeError("parser must be boolean|regexp|function");
      }
    }
  }
  has(e, t) {
    if ((e = Zk(e))) {
      const n = wk.findKey(this, e);
      return !(!n || void 0 === this[n] || (t && !Xk(0, this[n], n, t)));
    }
    return !1;
  }
  delete(e, t) {
    const n = this;
    let i = !1;
    function r(e) {
      if ((e = Zk(e))) {
        const r = wk.findKey(n, e);
        !r || (t && !Xk(0, n[r], r, t)) || (delete n[r], (i = !0));
      }
    }
    return (wk.isArray(e) ? e.forEach(r) : r(e), i);
  }
  clear(e) {
    const t = Object.keys(this);
    let n = t.length,
      i = !1;
    for (; n--; ) {
      const r = t[n];
      (e && !Xk(0, this[r], r, e, !0)) || (delete this[r], (i = !0));
    }
    return i;
  }
  normalize(e) {
    const t = this,
      n = {};
    return (
      wk.forEach(this, (i, r) => {
        const o = wk.findKey(n, r);
        if (o) return ((t[o] = Yk(i)), void delete t[r]);
        const s = e
          ? (function (e) {
              return e
                .trim()
                .toLowerCase()
                .replace(/([a-z\d])(\w*)/g, (e, t, n) => t.toUpperCase() + n);
            })(r)
          : String(r).trim();
        (s !== r && delete t[r], (t[s] = Yk(i)), (n[s] = !0));
      }),
      this
    );
  }
  concat(...e) {
    return this.constructor.concat(this, ...e);
  }
  toJSON(e) {
    const t = Object.create(null);
    return (
      wk.forEach(this, (n, i) => {
        null != n && !1 !== n && (t[i] = e && wk.isArray(n) ? n.join(", ") : n);
      }),
      t
    );
  }
  [Symbol.iterator]() {
    return Object.entries(this.toJSON())[Symbol.iterator]();
  }
  toString() {
    return Object.entries(this.toJSON())
      .map(([e, t]) => e + ": " + t)
      .join("\n");
  }
  getSetCookie() {
    return this.get("set-cookie") || [];
  }
  get [Symbol.toStringTag]() {
    return "AxiosHeaders";
  }
  static from(e) {
    return e instanceof this ? e : new this(e);
  }
  static concat(e, ...t) {
    const n = new this(e);
    return (t.forEach((e) => n.set(e)), n);
  }
  static accessor(e) {
    const t = (this[Gk] = this[Gk] = { accessors: {} }).accessors,
      n = this.prototype;
    function i(e) {
      const i = Zk(e);
      t[i] ||
        (!(function (e, t) {
          const n = wk.toCamelCase(" " + t);
          ["get", "set", "has"].forEach((i) => {
            Object.defineProperty(e, i + n, {
              value: function (e, n, r) {
                return this[i].call(this, t, e, n, r);
              },
              configurable: !0,
            });
          });
        })(n, e),
        (t[i] = !0));
    }
    return (wk.isArray(e) ? e.forEach(i) : i(e), this);
  }
};
function Jk(e, t) {
  const n = this || qk,
    i = t || n,
    r = Qk.from(i.headers);
  let o = i.data;
  return (
    wk.forEach(e, function (e) {
      o = e.call(n, o, r.normalize(), t ? t.status : void 0);
    }),
    r.normalize(),
    o
  );
}
function eE(e) {
  return !(!e || !e.__CANCEL__);
}
function tE(e, t, n) {
  (Ck.call(this, null == e ? "canceled" : e, Ck.ERR_CANCELED, t, n), (this.name = "CanceledError"));
}
function nE(e, t, n) {
  const i = n.config.validateStatus;
  n.status && i && !i(n.status)
    ? t(
        new Ck(
          "Request failed with status code " + n.status,
          [Ck.ERR_BAD_REQUEST, Ck.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
          n.config,
          n.request,
          n,
        ),
      )
    : e(n);
}
(Qk.accessor([
  "Content-Type",
  "Content-Length",
  "Accept",
  "Accept-Encoding",
  "User-Agent",
  "Authorization",
]),
  wk.reduceDescriptors(Qk.prototype, ({ value: e }, t) => {
    let n = t[0].toUpperCase() + t.slice(1);
    return {
      get: () => e,
      set(e) {
        this[n] = e;
      },
    };
  }),
  wk.freezeMethods(Qk),
  wk.inherits(tE, Ck, { __CANCEL__: !0 }));
const iE = (e, t, n = 3) => {
    let i = 0;
    const r = (function (e, t) {
      e = e || 10;
      const n = new Array(e),
        i = new Array(e);
      let r,
        o = 0,
        s = 0;
      return (
        (t = void 0 !== t ? t : 1e3),
        function (a) {
          const l = Date.now(),
            c = i[s];
          (r || (r = l), (n[o] = a), (i[o] = l));
          let d = s,
            u = 0;
          for (; d !== o; ) ((u += n[d++]), (d %= e));
          if (((o = (o + 1) % e), o === s && (s = (s + 1) % e), l - r < t)) return;
          const h = c && l - c;
          return h ? Math.round((1e3 * u) / h) : void 0;
        }
      );
    })(50, 250);
    return (function (e, t) {
      let n,
        i,
        r = 0,
        o = 1e3 / t;
      const s = (t, o = Date.now()) => {
        ((r = o), (n = null), i && (clearTimeout(i), (i = null)), e(...t));
      };
      return [
        (...e) => {
          const t = Date.now(),
            a = t - r;
          a >= o
            ? s(e, t)
            : ((n = e),
              i ||
                (i = setTimeout(() => {
                  ((i = null), s(n));
                }, o - a)));
        },
        () => n && s(n),
      ];
    })((n) => {
      const o = n.loaded,
        s = n.lengthComputable ? n.total : void 0,
        a = o - i,
        l = r(a);
      i = o;
      e({
        loaded: o,
        total: s,
        progress: s ? o / s : void 0,
        bytes: a,
        rate: l || void 0,
        estimated: l && s && o <= s ? (s - o) / l : void 0,
        event: n,
        lengthComputable: null != s,
        [t ? "download" : "upload"]: !0,
      });
    }, n);
  },
  rE = (e, t) => {
    const n = null != e;
    return [(i) => t[0]({ lengthComputable: n, total: e, loaded: i }), t[1]];
  },
  oE =
    (e) =>
    (...t) =>
      wk.asap(() => e(...t)),
  sE = Uk.hasStandardBrowserEnv
    ? ((e, t) => (n) => (
        (n = new URL(n, Uk.origin)),
        e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)
      ))(new URL(Uk.origin), Uk.navigator && /(msie|trident)/i.test(Uk.navigator.userAgent))
    : () => !0,
  aE = Uk.hasStandardBrowserEnv
    ? {
        write(e, t, n, i, r, o, s) {
          if ("undefined" == typeof document) return;
          const a = [`${e}=${encodeURIComponent(t)}`];
          (wk.isNumber(n) && a.push(`expires=${new Date(n).toUTCString()}`),
            wk.isString(i) && a.push(`path=${i}`),
            wk.isString(r) && a.push(`domain=${r}`),
            !0 === o && a.push("secure"),
            wk.isString(s) && a.push(`SameSite=${s}`),
            (document.cookie = a.join("; ")));
        },
        read(e) {
          if ("undefined" == typeof document) return null;
          const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
          return t ? decodeURIComponent(t[1]) : null;
        },
        remove(e) {
          this.write(e, "", Date.now() - 864e5, "/");
        },
      }
    : { write() {}, read: () => null, remove() {} };
function lE(e, t, n) {
  let i = !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
  return e && (i || 0 == n)
    ? (function (e, t) {
        return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
      })(e, t)
    : t;
}
const cE = (e) => (e instanceof Qk ? { ...e } : e);
function dE(e, t) {
  t = t || {};
  const n = {};
  function i(e, t, n, i) {
    return wk.isPlainObject(e) && wk.isPlainObject(t)
      ? wk.merge.call({ caseless: i }, e, t)
      : wk.isPlainObject(t)
        ? wk.merge({}, t)
        : wk.isArray(t)
          ? t.slice()
          : t;
  }
  function r(e, t, n, r) {
    return wk.isUndefined(t) ? (wk.isUndefined(e) ? void 0 : i(void 0, e, 0, r)) : i(e, t, 0, r);
  }
  function o(e, t) {
    if (!wk.isUndefined(t)) return i(void 0, t);
  }
  function s(e, t) {
    return wk.isUndefined(t) ? (wk.isUndefined(e) ? void 0 : i(void 0, e)) : i(void 0, t);
  }
  function a(n, r, o) {
    return o in t ? i(n, r) : o in e ? i(void 0, n) : void 0;
  }
  const l = {
    url: o,
    method: o,
    data: o,
    baseURL: s,
    transformRequest: s,
    transformResponse: s,
    paramsSerializer: s,
    timeout: s,
    timeoutMessage: s,
    withCredentials: s,
    withXSRFToken: s,
    adapter: s,
    responseType: s,
    xsrfCookieName: s,
    xsrfHeaderName: s,
    onUploadProgress: s,
    onDownloadProgress: s,
    decompress: s,
    maxContentLength: s,
    maxBodyLength: s,
    beforeRedirect: s,
    transport: s,
    httpAgent: s,
    httpsAgent: s,
    cancelToken: s,
    socketPath: s,
    responseEncoding: s,
    validateStatus: a,
    headers: (e, t, n) => r(cE(e), cE(t), 0, !0),
  };
  return (
    wk.forEach(Object.keys({ ...e, ...t }), function (i) {
      const o = l[i] || r,
        s = o(e[i], t[i], i);
      (wk.isUndefined(s) && o !== a) || (n[i] = s);
    }),
    n
  );
}
const uE = (e) => {
    const t = dE({}, e);
    let {
      data: n,
      withXSRFToken: i,
      xsrfHeaderName: r,
      xsrfCookieName: o,
      headers: s,
      auth: a,
    } = t;
    if (
      ((t.headers = s = Qk.from(s)),
      (t.url = Ak(lE(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer)),
      a &&
        s.set(
          "Authorization",
          "Basic " +
            btoa(
              (a.username || "") +
                ":" +
                (a.password ? unescape(encodeURIComponent(a.password)) : ""),
            ),
        ),
      wk.isFormData(n))
    )
      if (Uk.hasStandardBrowserEnv || Uk.hasStandardBrowserWebWorkerEnv) s.setContentType(void 0);
      else if (wk.isFunction(n.getHeaders)) {
        const e = n.getHeaders(),
          t = ["content-type", "content-length"];
        Object.entries(e).forEach(([e, n]) => {
          t.includes(e.toLowerCase()) && s.set(e, n);
        });
      }
    if (
      Uk.hasStandardBrowserEnv &&
      (i && wk.isFunction(i) && (i = i(t)), i || (!1 !== i && sE(t.url)))
    ) {
      const e = r && o && aE.read(o);
      e && s.set(r, e);
    }
    return t;
  },
  hE =
    "undefined" != typeof XMLHttpRequest &&
    function (e) {
      return new Promise(function (t, n) {
        const i = uE(e);
        let r = i.data;
        const o = Qk.from(i.headers).normalize();
        let s,
          a,
          l,
          c,
          d,
          { responseType: u, onUploadProgress: h, onDownloadProgress: g } = i;
        function p() {
          (c && c(),
            d && d(),
            i.cancelToken && i.cancelToken.unsubscribe(s),
            i.signal && i.signal.removeEventListener("abort", s));
        }
        let f = new XMLHttpRequest();
        function m() {
          if (!f) return;
          const i = Qk.from("getAllResponseHeaders" in f && f.getAllResponseHeaders());
          (nE(
            function (e) {
              (t(e), p());
            },
            function (e) {
              (n(e), p());
            },
            {
              data: u && "text" !== u && "json" !== u ? f.response : f.responseText,
              status: f.status,
              statusText: f.statusText,
              headers: i,
              config: e,
              request: f,
            },
          ),
            (f = null));
        }
        (f.open(i.method.toUpperCase(), i.url, !0),
          (f.timeout = i.timeout),
          "onloadend" in f
            ? (f.onloadend = m)
            : (f.onreadystatechange = function () {
                f &&
                  4 === f.readyState &&
                  (0 !== f.status || (f.responseURL && 0 === f.responseURL.indexOf("file:"))) &&
                  setTimeout(m);
              }),
          (f.onabort = function () {
            f && (n(new Ck("Request aborted", Ck.ECONNABORTED, e, f)), (f = null));
          }),
          (f.onerror = function (t) {
            const i = new Ck(t && t.message ? t.message : "Network Error", Ck.ERR_NETWORK, e, f);
            ((i.event = t || null), n(i), (f = null));
          }),
          (f.ontimeout = function () {
            let t = i.timeout ? "timeout of " + i.timeout + "ms exceeded" : "timeout exceeded";
            const r = i.transitional || jk;
            (i.timeoutErrorMessage && (t = i.timeoutErrorMessage),
              n(new Ck(t, r.clarifyTimeoutError ? Ck.ETIMEDOUT : Ck.ECONNABORTED, e, f)),
              (f = null));
          }),
          void 0 === r && o.setContentType(null),
          "setRequestHeader" in f &&
            wk.forEach(o.toJSON(), function (e, t) {
              f.setRequestHeader(t, e);
            }),
          wk.isUndefined(i.withCredentials) || (f.withCredentials = !!i.withCredentials),
          u && "json" !== u && (f.responseType = i.responseType),
          g && (([l, d] = iE(g, !0)), f.addEventListener("progress", l)),
          h &&
            f.upload &&
            (([a, c] = iE(h)),
            f.upload.addEventListener("progress", a),
            f.upload.addEventListener("loadend", c)),
          (i.cancelToken || i.signal) &&
            ((s = (t) => {
              f && (n(!t || t.type ? new tE(null, e, f) : t), f.abort(), (f = null));
            }),
            i.cancelToken && i.cancelToken.subscribe(s),
            i.signal && (i.signal.aborted ? s() : i.signal.addEventListener("abort", s))));
        const _ = (function (e) {
          const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
          return (t && t[1]) || "";
        })(i.url);
        _ && -1 === Uk.protocols.indexOf(_)
          ? n(new Ck("Unsupported protocol " + _ + ":", Ck.ERR_BAD_REQUEST, e))
          : f.send(r || null);
      });
    },
  gE = (e, t) => {
    const { length: n } = (e = e ? e.filter(Boolean) : []);
    if (t || n) {
      let n,
        i = new AbortController();
      const r = function (e) {
        if (!n) {
          ((n = !0), s());
          const t = e instanceof Error ? e : this.reason;
          i.abort(t instanceof Ck ? t : new tE(t instanceof Error ? t.message : t));
        }
      };
      let o =
        t &&
        setTimeout(() => {
          ((o = null), r(new Ck(`timeout ${t} of ms exceeded`, Ck.ETIMEDOUT)));
        }, t);
      const s = () => {
        e &&
          (o && clearTimeout(o),
          (o = null),
          e.forEach((e) => {
            e.unsubscribe ? e.unsubscribe(r) : e.removeEventListener("abort", r);
          }),
          (e = null));
      };
      e.forEach((e) => e.addEventListener("abort", r));
      const { signal: a } = i;
      return ((a.unsubscribe = () => wk.asap(s)), a);
    }
  },
  pE = function* (e, t) {
    let n = e.byteLength;
    if (n < t) return void (yield e);
    let i,
      r = 0;
    for (; r < n; ) ((i = r + t), yield e.slice(r, i), (r = i));
  },
  fE = async function* (e) {
    if (e[Symbol.asyncIterator]) return void (yield* e);
    const t = e.getReader();
    try {
      for (;;) {
        const { done: e, value: n } = await t.read();
        if (e) break;
        yield n;
      }
    } finally {
      await t.cancel();
    }
  },
  mE = (e, t, n, i) => {
    const r = (async function* (e, t) {
      for await (const n of fE(e)) yield* pE(n, t);
    })(e, t);
    let o,
      s = 0,
      a = (e) => {
        o || ((o = !0), i && i(e));
      };
    return new ReadableStream(
      {
        async pull(e) {
          try {
            const { done: t, value: i } = await r.next();
            if (t) return (a(), void e.close());
            let o = i.byteLength;
            if (n) {
              let e = (s += o);
              n(e);
            }
            e.enqueue(new Uint8Array(i));
          } catch (t) {
            throw (a(t), t);
          }
        },
        cancel: (e) => (a(e), r.return()),
      },
      { highWaterMark: 2 },
    );
  },
  { isFunction: _E } = wk,
  vE = (({ Request: e, Response: t }) => ({ Request: e, Response: t }))(wk.global),
  { ReadableStream: bE, TextEncoder: yE } = wk.global,
  xE = (e, ...t) => {
    try {
      return !!e(...t);
    } catch (spt) {
      return !1;
    }
  },
  wE = (e) => {
    e = wk.merge.call({ skipUndefined: !0 }, vE, e);
    const { fetch: t, Request: n, Response: i } = e,
      r = t ? _E(t) : "function" == typeof fetch,
      o = _E(n),
      s = _E(i);
    if (!r) return !1;
    const a = r && _E(bE),
      l =
        r &&
        ("function" == typeof yE
          ? ((c = new yE()), (e) => c.encode(e))
          : async (e) => new Uint8Array(await new n(e).arrayBuffer()));
    var c;
    const d =
        o &&
        a &&
        xE(() => {
          let e = !1;
          const t = new n(Uk.origin, {
            body: new bE(),
            method: "POST",
            get duplex() {
              return ((e = !0), "half");
            },
          }).headers.has("Content-Type");
          return e && !t;
        }),
      u = s && a && xE(() => wk.isReadableStream(new i("").body)),
      h = { stream: u && ((e) => e.body) };
    r &&
      ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
        !h[e] &&
          (h[e] = (t, n) => {
            let i = t && t[e];
            if (i) return i.call(t);
            throw new Ck(`Response type '${e}' is not supported`, Ck.ERR_NOT_SUPPORT, n);
          });
      });
    const g = async (e, t) => {
      const i = wk.toFiniteNumber(e.getContentLength());
      return null == i
        ? (async (e) => {
            if (null == e) return 0;
            if (wk.isBlob(e)) return e.size;
            if (wk.isSpecCompliantForm(e)) {
              const t = new n(Uk.origin, { method: "POST", body: e });
              return (await t.arrayBuffer()).byteLength;
            }
            return wk.isArrayBufferView(e) || wk.isArrayBuffer(e)
              ? e.byteLength
              : (wk.isURLSearchParams(e) && (e += ""),
                wk.isString(e) ? (await l(e)).byteLength : void 0);
          })(t)
        : i;
    };
    return async (e) => {
      let {
          url: r,
          method: s,
          data: a,
          signal: l,
          cancelToken: c,
          timeout: p,
          onDownloadProgress: f,
          onUploadProgress: m,
          responseType: _,
          headers: v,
          withCredentials: b = "same-origin",
          fetchOptions: y,
        } = uE(e),
        x = t || fetch;
      _ = _ ? (_ + "").toLowerCase() : "text";
      let w = gE([l, c && c.toAbortSignal()], p),
        C = null;
      const S =
        w &&
        w.unsubscribe &&
        (() => {
          w.unsubscribe();
        });
      let k;
      try {
        if (m && d && "get" !== s && "head" !== s && 0 !== (k = await g(v, a))) {
          let e,
            t = new n(r, { method: "POST", body: a, duplex: "half" });
          if (
            (wk.isFormData(a) && (e = t.headers.get("content-type")) && v.setContentType(e), t.body)
          ) {
            const [e, n] = rE(k, iE(oE(m)));
            a = mE(t.body, 65536, e, n);
          }
        }
        wk.isString(b) || (b = b ? "include" : "omit");
        const t = o && "credentials" in n.prototype,
          l = {
            ...y,
            signal: w,
            method: s.toUpperCase(),
            headers: v.normalize().toJSON(),
            body: a,
            duplex: "half",
            credentials: t ? b : void 0,
          };
        C = o && new n(r, l);
        let c = await (o ? x(C, y) : x(r, l));
        const p = u && ("stream" === _ || "response" === _);
        if (u && (f || (p && S))) {
          const e = {};
          ["status", "statusText", "headers"].forEach((t) => {
            e[t] = c[t];
          });
          const t = wk.toFiniteNumber(c.headers.get("content-length")),
            [n, r] = (f && rE(t, iE(oE(f), !0))) || [];
          c = new i(
            mE(c.body, 65536, n, () => {
              (r && r(), S && S());
            }),
            e,
          );
        }
        _ = _ || "text";
        let E = await h[wk.findKey(h, _) || "text"](c, e);
        return (
          !p && S && S(),
          await new Promise((t, n) => {
            nE(t, n, {
              data: E,
              headers: Qk.from(c.headers),
              status: c.status,
              statusText: c.statusText,
              config: e,
              request: C,
            });
          })
        );
      } catch (E) {
        if ((S && S(), E && "TypeError" === E.name && /Load failed|fetch/i.test(E.message)))
          throw Object.assign(new Ck("Network Error", Ck.ERR_NETWORK, e, C), {
            cause: E.cause || E,
          });
        throw Ck.from(E, E && E.code, e, C);
      }
    };
  },
  CE = new Map(),
  SE = (e) => {
    let t = (e && e.env) || {};
    const { fetch: n, Request: i, Response: r } = t,
      o = [i, r, n];
    let s,
      a,
      l = o.length,
      c = CE;
    for (; l--; )
      ((s = o[l]), (a = c.get(s)), void 0 === a && c.set(s, (a = l ? new Map() : wE(t))), (c = a));
    return a;
  };
SE();
const kE = { http: null, xhr: hE, fetch: { get: SE } };
wk.forEach(kE, (e, t) => {
  if (e) {
    try {
      Object.defineProperty(e, "name", { value: t });
    } catch (spt) {}
    Object.defineProperty(e, "adapterName", { value: t });
  }
});
const EE = (e) => `- ${e}`,
  NE = (e) => wk.isFunction(e) || null === e || !1 === e;
const LE = {
  getAdapter: function (e, t) {
    e = wk.isArray(e) ? e : [e];
    const { length: n } = e;
    let i, r;
    const o = {};
    for (let s = 0; s < n; s++) {
      let n;
      if (((i = e[s]), (r = i), !NE(i) && ((r = kE[(n = String(i)).toLowerCase()]), void 0 === r)))
        throw new Ck(`Unknown adapter '${n}'`);
      if (r && (wk.isFunction(r) || (r = r.get(t)))) break;
      o[n || "#" + s] = r;
    }
    if (!r) {
      const e = Object.entries(o).map(
        ([e, t]) =>
          `adapter ${e} ` +
          (!1 === t ? "is not supported by the environment" : "is not available in the build"),
      );
      throw new Ck(
        "There is no suitable adapter to dispatch the request " +
          (n
            ? e.length > 1
              ? "since :\n" + e.map(EE).join("\n")
              : " " + EE(e[0])
            : "as no adapter specified"),
        "ERR_NOT_SUPPORT",
      );
    }
    return r;
  },
  adapters: kE,
};
function DE(e) {
  if ((e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted))
    throw new tE(null, e);
}
function TE(e) {
  (DE(e),
    (e.headers = Qk.from(e.headers)),
    (e.data = Jk.call(e, e.transformRequest)),
    -1 !== ["post", "put", "patch"].indexOf(e.method) &&
      e.headers.setContentType("application/x-www-form-urlencoded", !1));
  return LE.getAdapter(
    e.adapter || qk.adapter,
    e,
  )(e).then(
    function (t) {
      return (
        DE(e),
        (t.data = Jk.call(e, e.transformResponse, t)),
        (t.headers = Qk.from(t.headers)),
        t
      );
    },
    function (t) {
      return (
        eE(t) ||
          (DE(e),
          t &&
            t.response &&
            ((t.response.data = Jk.call(e, e.transformResponse, t.response)),
            (t.response.headers = Qk.from(t.response.headers)))),
        Promise.reject(t)
      );
    },
  );
}
const IE = "1.13.2",
  RE = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
  RE[e] = function (n) {
    return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
  };
});
const OE = {};
((RE.transitional = function (e, t, n) {
  return (i, r, o) => {
    if (!1 === e)
      throw new Ck(
        (function (e, t) {
          return "[Axios v" + IE + "] Transitional option '" + e + "'" + t + (n ? ". " + n : "");
        })(r, " has been removed" + (t ? " in " + t : "")),
        Ck.ERR_DEPRECATED,
      );
    return (t && !OE[r] && (OE[r] = !0), !e || e(i, r, o));
  };
}),
  (RE.spelling = function (e) {
    return (e, t) => !0;
  }));
const ME = {
    assertOptions: function (e, t, n) {
      if ("object" != typeof e) throw new Ck("options must be an object", Ck.ERR_BAD_OPTION_VALUE);
      const i = Object.keys(e);
      let r = i.length;
      for (; r-- > 0; ) {
        const o = i[r],
          s = t[o];
        if (s) {
          const t = e[o],
            n = void 0 === t || s(t, o, e);
          if (!0 !== n) throw new Ck("option " + o + " must be " + n, Ck.ERR_BAD_OPTION_VALUE);
          continue;
        }
        if (!0 !== n) throw new Ck("Unknown option " + o, Ck.ERR_BAD_OPTION);
      }
    },
    validators: RE,
  },
  AE = ME.validators;
let PE = class {
  constructor(e) {
    ((this.defaults = e || {}), (this.interceptors = { request: new Pk(), response: new Pk() }));
  }
  async request(e, t) {
    try {
      return await this._request(e, t);
    } catch (n) {
      if (n instanceof Error) {
        let e = {};
        Error.captureStackTrace ? Error.captureStackTrace(e) : (e = new Error());
        const t = e.stack ? e.stack.replace(/^.+\n/, "") : "";
        try {
          n.stack
            ? t && !String(n.stack).endsWith(t.replace(/^.+\n.+\n/, "")) && (n.stack += "\n" + t)
            : (n.stack = t);
        } catch (spt) {}
      }
      throw n;
    }
  }
  _request(e, t) {
    ("string" == typeof e ? ((t = t || {}).url = e) : (t = e || {}), (t = dE(this.defaults, t)));
    const { transitional: n, paramsSerializer: i, headers: r } = t;
    (void 0 !== n &&
      ME.assertOptions(
        n,
        {
          silentJSONParsing: AE.transitional(AE.boolean),
          forcedJSONParsing: AE.transitional(AE.boolean),
          clarifyTimeoutError: AE.transitional(AE.boolean),
        },
        !1,
      ),
      null != i &&
        (wk.isFunction(i)
          ? (t.paramsSerializer = { serialize: i })
          : ME.assertOptions(i, { encode: AE.function, serialize: AE.function }, !0)),
      void 0 !== t.allowAbsoluteUrls ||
        (void 0 !== this.defaults.allowAbsoluteUrls
          ? (t.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls)
          : (t.allowAbsoluteUrls = !0)),
      ME.assertOptions(
        t,
        { baseUrl: AE.spelling("baseURL"), withXsrfToken: AE.spelling("withXSRFToken") },
        !0,
      ),
      (t.method = (t.method || this.defaults.method || "get").toLowerCase()));
    let o = r && wk.merge(r.common, r[t.method]);
    (r &&
      wk.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (e) => {
        delete r[e];
      }),
      (t.headers = Qk.concat(o, r)));
    const s = [];
    let a = !0;
    this.interceptors.request.forEach(function (e) {
      ("function" == typeof e.runWhen && !1 === e.runWhen(t)) ||
        ((a = a && e.synchronous), s.unshift(e.fulfilled, e.rejected));
    });
    const l = [];
    let c;
    this.interceptors.response.forEach(function (e) {
      l.push(e.fulfilled, e.rejected);
    });
    let d,
      u = 0;
    if (!a) {
      const e = [TE.bind(this), void 0];
      for (e.unshift(...s), e.push(...l), d = e.length, c = Promise.resolve(t); u < d; )
        c = c.then(e[u++], e[u++]);
      return c;
    }
    d = s.length;
    let h = t;
    for (; u < d; ) {
      const e = s[u++],
        t = s[u++];
      try {
        h = e(h);
      } catch (D2t) {
        t.call(this, D2t);
        break;
      }
    }
    try {
      c = TE.call(this, h);
    } catch (D2t) {
      return Promise.reject(D2t);
    }
    for (u = 0, d = l.length; u < d; ) c = c.then(l[u++], l[u++]);
    return c;
  }
  getUri(e) {
    return Ak(
      lE((e = dE(this.defaults, e)).baseURL, e.url, e.allowAbsoluteUrls),
      e.params,
      e.paramsSerializer,
    );
  }
};
(wk.forEach(["delete", "get", "head", "options"], function (e) {
  PE.prototype[e] = function (t, n) {
    return this.request(dE(n || {}, { method: e, url: t, data: (n || {}).data }));
  };
}),
  wk.forEach(["post", "put", "patch"], function (e) {
    function t(t) {
      return function (n, i, r) {
        return this.request(
          dE(r || {}, {
            method: e,
            headers: t ? { "Content-Type": "multipart/form-data" } : {},
            url: n,
            data: i,
          }),
        );
      };
    }
    ((PE.prototype[e] = t()), (PE.prototype[e + "Form"] = t(!0)));
  }));
const jE = {
  Continue: 100,
  SwitchingProtocols: 101,
  Processing: 102,
  EarlyHints: 103,
  Ok: 200,
  Created: 201,
  Accepted: 202,
  NonAuthoritativeInformation: 203,
  NoContent: 204,
  ResetContent: 205,
  PartialContent: 206,
  MultiStatus: 207,
  AlreadyReported: 208,
  ImUsed: 226,
  MultipleChoices: 300,
  MovedPermanently: 301,
  Found: 302,
  SeeOther: 303,
  NotModified: 304,
  UseProxy: 305,
  Unused: 306,
  TemporaryRedirect: 307,
  PermanentRedirect: 308,
  BadRequest: 400,
  Unauthorized: 401,
  PaymentRequired: 402,
  Forbidden: 403,
  NotFound: 404,
  MethodNotAllowed: 405,
  NotAcceptable: 406,
  ProxyAuthenticationRequired: 407,
  RequestTimeout: 408,
  Conflict: 409,
  Gone: 410,
  LengthRequired: 411,
  PreconditionFailed: 412,
  PayloadTooLarge: 413,
  UriTooLong: 414,
  UnsupportedMediaType: 415,
  RangeNotSatisfiable: 416,
  ExpectationFailed: 417,
  ImATeapot: 418,
  MisdirectedRequest: 421,
  UnprocessableEntity: 422,
  Locked: 423,
  FailedDependency: 424,
  TooEarly: 425,
  UpgradeRequired: 426,
  PreconditionRequired: 428,
  TooManyRequests: 429,
  RequestHeaderFieldsTooLarge: 431,
  UnavailableForLegalReasons: 451,
  InternalServerError: 500,
  NotImplemented: 501,
  BadGateway: 502,
  ServiceUnavailable: 503,
  GatewayTimeout: 504,
  HttpVersionNotSupported: 505,
  VariantAlsoNegotiates: 506,
  InsufficientStorage: 507,
  LoopDetected: 508,
  NotExtended: 510,
  NetworkAuthenticationRequired: 511,
  WebServerIsDown: 521,
  ConnectionTimedOut: 522,
  OriginIsUnreachable: 523,
  TimeoutOccurred: 524,
  SslHandshakeFailed: 525,
  InvalidSslCertificate: 526,
};
Object.entries(jE).forEach(([e, t]) => {
  jE[t] = e;
});
const FE = (function e(t) {
  const n = new PE(t),
    i = OS(PE.prototype.request, n);
  return (
    wk.extend(i, PE.prototype, n, { allOwnKeys: !0 }),
    wk.extend(i, n, null, { allOwnKeys: !0 }),
    (i.create = function (n) {
      return e(dE(t, n));
    }),
    i
  );
})(qk);
((FE.Axios = PE),
  (FE.CanceledError = tE),
  (FE.CancelToken = class e {
    constructor(e) {
      if ("function" != typeof e) throw new TypeError("executor must be a function.");
      let t;
      this.promise = new Promise(function (e) {
        t = e;
      });
      const n = this;
      (this.promise.then((e) => {
        if (!n._listeners) return;
        let t = n._listeners.length;
        for (; t-- > 0; ) n._listeners[t](e);
        n._listeners = null;
      }),
        (this.promise.then = (e) => {
          let t;
          const i = new Promise((e) => {
            (n.subscribe(e), (t = e));
          }).then(e);
          return (
            (i.cancel = function () {
              n.unsubscribe(t);
            }),
            i
          );
        }),
        e(function (e, i, r) {
          n.reason || ((n.reason = new tE(e, i, r)), t(n.reason));
        }));
    }
    throwIfRequested() {
      if (this.reason) throw this.reason;
    }
    subscribe(e) {
      this.reason
        ? e(this.reason)
        : this._listeners
          ? this._listeners.push(e)
          : (this._listeners = [e]);
    }
    unsubscribe(e) {
      if (!this._listeners) return;
      const t = this._listeners.indexOf(e);
      -1 !== t && this._listeners.splice(t, 1);
    }
    toAbortSignal() {
      const e = new AbortController(),
        t = (t) => {
          e.abort(t);
        };
      return (this.subscribe(t), (e.signal.unsubscribe = () => this.unsubscribe(t)), e.signal);
    }
    static source() {
      let t;
      const n = new e(function (e) {
        t = e;
      });
      return { token: n, cancel: t };
    }
  }),
  (FE.isCancel = eE),
  (FE.VERSION = IE),
  (FE.toFormData = Tk),
  (FE.AxiosError = Ck),
  (FE.Cancel = FE.CanceledError),
  (FE.all = function (e) {
    return Promise.all(e);
  }),
  (FE.spread = function (e) {
    return function (t) {
      return e.apply(null, t);
    };
  }),
  (FE.isAxiosError = function (e) {
    return wk.isObject(e) && !0 === e.isAxiosError;
  }),
  (FE.mergeConfig = dE),
  (FE.AxiosHeaders = Qk),
  (FE.formToJSON = (e) => $k(wk.isHTMLForm(e) ? new FormData(e) : e)),
  (FE.getAdapter = LE.getAdapter),
  (FE.HttpStatusCode = jE),
  (FE.default = FE));
const {
  Axios: BE,
  AxiosError: VE,
  CanceledError: WE,
  isCancel: HE,
  CancelToken: zE,
  VERSION: UE,
  all: $E,
  Cancel: qE,
  isAxiosError: KE,
  spread: GE,
  toFormData: ZE,
  AxiosHeaders: YE,
  HttpStatusCode: XE,
  formToJSON: QE,
  getAdapter: JE,
  mergeConfig: eN,
} = FE;
var tN = Array(12).fill(0),
  nN = ({ visible: e, className: t }) =>
    z.createElement(
      "div",
      { className: ["sonner-loading-wrapper", t].filter(Boolean).join(" "), "data-visible": e },
      z.createElement(
        "div",
        { className: "sonner-spinner" },
        tN.map((e, t) =>
          z.createElement("div", { className: "sonner-loading-bar", key: `spinner-bar-${t}` }),
        ),
      ),
    ),
  iN = z.createElement(
    "svg",
    {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 20 20",
      fill: "currentColor",
      height: "20",
      width: "20",
    },
    z.createElement("path", {
      fillRule: "evenodd",
      d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
      clipRule: "evenodd",
    }),
  ),
  rN = z.createElement(
    "svg",
    {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 24 24",
      fill: "currentColor",
      height: "20",
      width: "20",
    },
    z.createElement("path", {
      fillRule: "evenodd",
      d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
      clipRule: "evenodd",
    }),
  ),
  oN = z.createElement(
    "svg",
    {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 20 20",
      fill: "currentColor",
      height: "20",
      width: "20",
    },
    z.createElement("path", {
      fillRule: "evenodd",
      d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
      clipRule: "evenodd",
    }),
  ),
  sN = z.createElement(
    "svg",
    {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 20 20",
      fill: "currentColor",
      height: "20",
      width: "20",
    },
    z.createElement("path", {
      fillRule: "evenodd",
      d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
      clipRule: "evenodd",
    }),
  ),
  aN = z.createElement(
    "svg",
    {
      xmlns: "http://www.w3.org/2000/svg",
      width: "12",
      height: "12",
      viewBox: "0 0 24 24",
      fill: "none",
      stroke: "currentColor",
      strokeWidth: "1.5",
      strokeLinecap: "round",
      strokeLinejoin: "round",
    },
    z.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
    z.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }),
  ),
  lN = 1,
  cN = new (class {
    constructor() {
      ((this.subscribe = (e) => (
        this.subscribers.push(e),
        () => {
          let t = this.subscribers.indexOf(e);
          this.subscribers.splice(t, 1);
        }
      )),
        (this.publish = (e) => {
          this.subscribers.forEach((t) => t(e));
        }),
        (this.addToast = (e) => {
          (this.publish(e), (this.toasts = [...this.toasts, e]));
        }),
        (this.create = (e) => {
          var t;
          let { message: n, ...i } = e,
            r =
              "number" == typeof (null == e ? void 0 : e.id) ||
              (null == (t = e.id) ? void 0 : t.length) > 0
                ? e.id
                : lN++,
            o = this.toasts.find((e) => e.id === r),
            s = void 0 === e.dismissible || e.dismissible;
          return (
            this.dismissedToasts.has(r) && this.dismissedToasts.delete(r),
            o
              ? (this.toasts = this.toasts.map((t) =>
                  t.id === r
                    ? (this.publish({ ...t, ...e, id: r, title: n }),
                      { ...t, ...e, id: r, dismissible: s, title: n })
                    : t,
                ))
              : this.addToast({ title: n, ...i, dismissible: s, id: r }),
            r
          );
        }),
        (this.dismiss = (e) => (
          this.dismissedToasts.add(e),
          e ||
            this.toasts.forEach((e) => {
              this.subscribers.forEach((t) => t({ id: e.id, dismiss: !0 }));
            }),
          this.subscribers.forEach((t) => t({ id: e, dismiss: !0 })),
          e
        )),
        (this.message = (e, t) => this.create({ ...t, message: e })),
        (this.error = (e, t) => this.create({ ...t, message: e, type: "error" })),
        (this.success = (e, t) => this.create({ ...t, type: "success", message: e })),
        (this.info = (e, t) => this.create({ ...t, type: "info", message: e })),
        (this.warning = (e, t) => this.create({ ...t, type: "warning", message: e })),
        (this.loading = (e, t) => this.create({ ...t, type: "loading", message: e })),
        (this.promise = (e, t) => {
          if (!t) return;
          let n;
          void 0 !== t.loading &&
            (n = this.create({
              ...t,
              promise: e,
              type: "loading",
              message: t.loading,
              description: "function" != typeof t.description ? t.description : void 0,
            }));
          let i,
            r = e instanceof Promise ? e : e(),
            o = void 0 !== n,
            s = r
              .then(async (e) => {
                if (((i = ["resolve", e]), z.isValidElement(e)))
                  ((o = !1), this.create({ id: n, type: "default", message: e }));
                else if (dN(e) && !e.ok) {
                  o = !1;
                  let i =
                      "function" == typeof t.error
                        ? await t.error(`HTTP error! status: ${e.status}`)
                        : t.error,
                    r =
                      "function" == typeof t.description
                        ? await t.description(`HTTP error! status: ${e.status}`)
                        : t.description;
                  this.create({ id: n, type: "error", message: i, description: r });
                } else if (void 0 !== t.success) {
                  o = !1;
                  let i = "function" == typeof t.success ? await t.success(e) : t.success,
                    r = "function" == typeof t.description ? await t.description(e) : t.description;
                  this.create({ id: n, type: "success", message: i, description: r });
                }
              })
              .catch(async (e) => {
                if (((i = ["reject", e]), void 0 !== t.error)) {
                  o = !1;
                  let i = "function" == typeof t.error ? await t.error(e) : t.error,
                    r = "function" == typeof t.description ? await t.description(e) : t.description;
                  this.create({ id: n, type: "error", message: i, description: r });
                }
              })
              .finally(() => {
                var e;
                (o && (this.dismiss(n), (n = void 0)), null == (e = t.finally) || e.call(t));
              }),
            a = () =>
              new Promise((e, t) => s.then(() => ("reject" === i[0] ? t(i[1]) : e(i[1]))).catch(t));
          return "string" != typeof n && "number" != typeof n
            ? { unwrap: a }
            : Object.assign(n, { unwrap: a });
        }),
        (this.custom = (e, t) => {
          let n = (null == t ? void 0 : t.id) || lN++;
          return (this.create({ jsx: e(n), id: n, ...t }), n);
        }),
        (this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id))),
        (this.subscribers = []),
        (this.toasts = []),
        (this.dismissedToasts = new Set()));
    }
  })(),
  dN = (e) =>
    e &&
    "object" == typeof e &&
    "ok" in e &&
    "boolean" == typeof e.ok &&
    "status" in e &&
    "number" == typeof e.status,
  uN = (e, t) => {
    let n = (null == t ? void 0 : t.id) || lN++;
    return (cN.addToast({ title: e, ...t, id: n }), n);
  },
  hN = Object.assign(
    uN,
    {
      success: cN.success,
      info: cN.info,
      warning: cN.warning,
      error: cN.error,
      custom: cN.custom,
      message: cN.message,
      promise: cN.promise,
      dismiss: cN.dismiss,
      loading: cN.loading,
    },
    { getHistory: () => cN.toasts, getToasts: () => cN.getActiveToasts() },
  );
function gN(e) {
  return void 0 !== e.label;
}
!(function (e, { insertAt: t } = {}) {
  if ("undefined" == typeof document) return;
  let n = document.head || document.getElementsByTagName("head")[0],
    i = document.createElement("style");
  ((i.type = "text/css"),
    "top" === t && n.firstChild ? n.insertBefore(i, n.firstChild) : n.appendChild(i),
    i.styleSheet ? (i.styleSheet.cssText = e) : i.appendChild(document.createTextNode(e)));
})(
  ':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n',
);
var pN = 3,
  fN = 14;
function mN(...e) {
  return e.filter(Boolean).join(" ");
}
var _N = (e) => {
  var t, n, i, r, o, s, a, l, c, d, u;
  let {
      invert: h,
      toast: g,
      unstyled: p,
      interacting: f,
      setHeights: m,
      visibleToasts: _,
      heights: v,
      index: b,
      toasts: y,
      expanded: x,
      removeToast: w,
      defaultRichColors: C,
      closeButton: S,
      style: k,
      cancelButtonStyle: E,
      actionButtonStyle: N,
      className: L = "",
      descriptionClassName: D = "",
      duration: T,
      position: I,
      gap: R,
      loadingIcon: O,
      expandByDefault: M,
      classNames: A,
      icons: P,
      closeButtonAriaLabel: j = "Close toast",
      pauseWhenPageIsHidden: F,
    } = e,
    [B, V] = z.useState(null),
    [W, U] = z.useState(null),
    [$, q] = z.useState(!1),
    [K, G] = z.useState(!1),
    [Z, Y] = z.useState(!1),
    [X, Q] = z.useState(!1),
    [J, ee] = z.useState(!1),
    [te, ne] = z.useState(0),
    [ie, re] = z.useState(0),
    oe = z.useRef(g.duration || T || 4e3),
    se = z.useRef(null),
    ae = z.useRef(null),
    le = 0 === b,
    ce = b + 1 <= _,
    de = g.type,
    ue = !1 !== g.dismissible,
    he = g.className || "",
    ge = g.descriptionClassName || "",
    pe = z.useMemo(() => v.findIndex((e) => e.toastId === g.id) || 0, [v, g.id]),
    fe = z.useMemo(() => {
      var e;
      return null != (e = g.closeButton) ? e : S;
    }, [g.closeButton, S]),
    me = z.useMemo(() => g.duration || T || 4e3, [g.duration, T]),
    _e = z.useRef(0),
    ve = z.useRef(0),
    be = z.useRef(0),
    ye = z.useRef(null),
    [xe, we] = I.split("-"),
    Ce = z.useMemo(() => v.reduce((e, t, n) => (n >= pe ? e : e + t.height), 0), [v, pe]),
    Se = (() => {
      let [e, t] = z.useState(document.hidden);
      return (
        z.useEffect(() => {
          let e = () => {
            t(document.hidden);
          };
          return (
            document.addEventListener("visibilitychange", e),
            () => window.removeEventListener("visibilitychange", e)
          );
        }, []),
        e
      );
    })(),
    ke = g.invert || h,
    Ee = "loading" === de;
  ((ve.current = z.useMemo(() => pe * R + Ce, [pe, Ce])),
    z.useEffect(() => {
      oe.current = me;
    }, [me]),
    z.useEffect(() => {
      q(!0);
    }, []),
    z.useEffect(() => {
      let e = ae.current;
      if (e) {
        let t = e.getBoundingClientRect().height;
        return (
          re(t),
          m((e) => [{ toastId: g.id, height: t, position: g.position }, ...e]),
          () => m((e) => e.filter((e) => e.toastId !== g.id))
        );
      }
    }, [m, g.id]),
    z.useLayoutEffect(() => {
      if (!$) return;
      let e = ae.current,
        t = e.style.height;
      e.style.height = "auto";
      let n = e.getBoundingClientRect().height;
      ((e.style.height = t),
        re(n),
        m((e) =>
          e.find((e) => e.toastId === g.id)
            ? e.map((e) => (e.toastId === g.id ? { ...e, height: n } : e))
            : [{ toastId: g.id, height: n, position: g.position }, ...e],
        ));
    }, [$, g.title, g.description, m, g.id]));
  let Ne = z.useCallback(() => {
    (G(!0),
      ne(ve.current),
      m((e) => e.filter((e) => e.toastId !== g.id)),
      setTimeout(() => {
        w(g);
      }, 200));
  }, [g, w, m, ve]);
  return (
    z.useEffect(() => {
      if ((g.promise && "loading" === de) || g.duration === 1 / 0 || "loading" === g.type) return;
      let e;
      return (
        x || f || (F && Se)
          ? (() => {
              if (be.current < _e.current) {
                let e = new Date().getTime() - _e.current;
                oe.current = oe.current - e;
              }
              be.current = new Date().getTime();
            })()
          : oe.current !== 1 / 0 &&
            ((_e.current = new Date().getTime()),
            (e = setTimeout(() => {
              var e;
              (null == (e = g.onAutoClose) || e.call(g, g), Ne());
            }, oe.current))),
        () => clearTimeout(e)
      );
    }, [x, f, g, de, F, Se, Ne]),
    z.useEffect(() => {
      g.delete && Ne();
    }, [Ne, g.delete]),
    z.createElement(
      "li",
      {
        tabIndex: 0,
        ref: ae,
        className: mN(
          L,
          he,
          null == A ? void 0 : A.toast,
          null == (t = null == g ? void 0 : g.classNames) ? void 0 : t.toast,
          null == A ? void 0 : A.default,
          null == A ? void 0 : A[de],
          null == (n = null == g ? void 0 : g.classNames) ? void 0 : n[de],
        ),
        "data-sonner-toast": "",
        "data-rich-colors": null != (i = g.richColors) ? i : C,
        "data-styled": !(g.jsx || g.unstyled || p),
        "data-mounted": $,
        "data-promise": !!g.promise,
        "data-swiped": J,
        "data-removed": K,
        "data-visible": ce,
        "data-y-position": xe,
        "data-x-position": we,
        "data-index": b,
        "data-front": le,
        "data-swiping": Z,
        "data-dismissible": ue,
        "data-type": de,
        "data-invert": ke,
        "data-swipe-out": X,
        "data-swipe-direction": W,
        "data-expanded": !!(x || (M && $)),
        style: {
          "--index": b,
          "--toasts-before": b,
          "--z-index": y.length - b,
          "--offset": `${K ? te : ve.current}px`,
          "--initial-height": M ? "auto" : `${ie}px`,
          ...k,
          ...g.style,
        },
        onDragEnd: () => {
          (Y(!1), V(null), (ye.current = null));
        },
        onPointerDown: (e) => {
          Ee ||
            !ue ||
            ((se.current = new Date()),
            ne(ve.current),
            e.target.setPointerCapture(e.pointerId),
            "BUTTON" !== e.target.tagName &&
              (Y(!0), (ye.current = { x: e.clientX, y: e.clientY })));
        },
        onPointerUp: () => {
          var e, t, n, i;
          if (X || !ue) return;
          ye.current = null;
          let r = Number(
              (null == (e = ae.current)
                ? void 0
                : e.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0,
            ),
            o = Number(
              (null == (t = ae.current)
                ? void 0
                : t.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0,
            ),
            s = new Date().getTime() - (null == (n = se.current) ? void 0 : n.getTime()),
            a = "x" === B ? r : o,
            l = Math.abs(a) / s;
          if (Math.abs(a) >= 20 || l > 0.11)
            return (
              ne(ve.current),
              null == (i = g.onDismiss) || i.call(g, g),
              U("x" === B ? (r > 0 ? "right" : "left") : o > 0 ? "down" : "up"),
              Ne(),
              Q(!0),
              void ee(!1)
            );
          (Y(!1), V(null));
        },
        onPointerMove: (t) => {
          var n, i, r, o;
          if (
            !ye.current ||
            !ue ||
            (null == (n = window.getSelection()) ? void 0 : n.toString().length) > 0
          )
            return;
          let s = t.clientY - ye.current.y,
            a = t.clientX - ye.current.x,
            l =
              null != (i = e.swipeDirections)
                ? i
                : (function (e) {
                    let [t, n] = e.split("-"),
                      i = [];
                    return (t && i.push(t), n && i.push(n), i);
                  })(I);
          !B && (Math.abs(a) > 1 || Math.abs(s) > 1) && V(Math.abs(a) > Math.abs(s) ? "x" : "y");
          let c = { x: 0, y: 0 };
          ("y" === B
            ? (l.includes("top") || l.includes("bottom")) &&
              ((l.includes("top") && s < 0) || (l.includes("bottom") && s > 0)) &&
              (c.y = s)
            : "x" === B &&
              (l.includes("left") || l.includes("right")) &&
              ((l.includes("left") && a < 0) || (l.includes("right") && a > 0)) &&
              (c.x = a),
            (Math.abs(c.x) > 0 || Math.abs(c.y) > 0) && ee(!0),
            null == (r = ae.current) || r.style.setProperty("--swipe-amount-x", `${c.x}px`),
            null == (o = ae.current) || o.style.setProperty("--swipe-amount-y", `${c.y}px`));
        },
      },
      fe && !g.jsx
        ? z.createElement(
            "button",
            {
              "aria-label": j,
              "data-disabled": Ee,
              "data-close-button": !0,
              onClick:
                Ee || !ue
                  ? () => {}
                  : () => {
                      var e;
                      (Ne(), null == (e = g.onDismiss) || e.call(g, g));
                    },
              className: mN(
                null == A ? void 0 : A.closeButton,
                null == (r = null == g ? void 0 : g.classNames) ? void 0 : r.closeButton,
              ),
            },
            null != (o = null == P ? void 0 : P.close) ? o : aN,
          )
        : null,
      g.jsx || H.isValidElement(g.title)
        ? g.jsx
          ? g.jsx
          : "function" == typeof g.title
            ? g.title()
            : g.title
        : z.createElement(
            z.Fragment,
            null,
            de || g.icon || g.promise
              ? z.createElement(
                  "div",
                  {
                    "data-icon": "",
                    className: mN(
                      null == A ? void 0 : A.icon,
                      null == (s = null == g ? void 0 : g.classNames) ? void 0 : s.icon,
                    ),
                  },
                  g.promise || ("loading" === g.type && !g.icon)
                    ? g.icon ||
                        (function () {
                          var e, t, n;
                          return null != P && P.loading
                            ? z.createElement(
                                "div",
                                {
                                  className: mN(
                                    null == A ? void 0 : A.loader,
                                    null == (e = null == g ? void 0 : g.classNames)
                                      ? void 0
                                      : e.loader,
                                    "sonner-loader",
                                  ),
                                  "data-visible": "loading" === de,
                                },
                                P.loading,
                              )
                            : O
                              ? z.createElement(
                                  "div",
                                  {
                                    className: mN(
                                      null == A ? void 0 : A.loader,
                                      null == (t = null == g ? void 0 : g.classNames)
                                        ? void 0
                                        : t.loader,
                                      "sonner-loader",
                                    ),
                                    "data-visible": "loading" === de,
                                  },
                                  O,
                                )
                              : z.createElement(nN, {
                                  className: mN(
                                    null == A ? void 0 : A.loader,
                                    null == (n = null == g ? void 0 : g.classNames)
                                      ? void 0
                                      : n.loader,
                                  ),
                                  visible: "loading" === de,
                                });
                        })()
                    : null,
                  "loading" !== g.type
                    ? g.icon ||
                        (null == P ? void 0 : P[de]) ||
                        ((e) => {
                          switch (e) {
                            case "success":
                              return iN;
                            case "info":
                              return oN;
                            case "warning":
                              return rN;
                            case "error":
                              return sN;
                            default:
                              return null;
                          }
                        })(de)
                    : null,
                )
              : null,
            z.createElement(
              "div",
              {
                "data-content": "",
                className: mN(
                  null == A ? void 0 : A.content,
                  null == (a = null == g ? void 0 : g.classNames) ? void 0 : a.content,
                ),
              },
              z.createElement(
                "div",
                {
                  "data-title": "",
                  className: mN(
                    null == A ? void 0 : A.title,
                    null == (l = null == g ? void 0 : g.classNames) ? void 0 : l.title,
                  ),
                },
                "function" == typeof g.title ? g.title() : g.title,
              ),
              g.description
                ? z.createElement(
                    "div",
                    {
                      "data-description": "",
                      className: mN(
                        D,
                        ge,
                        null == A ? void 0 : A.description,
                        null == (c = null == g ? void 0 : g.classNames) ? void 0 : c.description,
                      ),
                    },
                    "function" == typeof g.description ? g.description() : g.description,
                  )
                : null,
            ),
            H.isValidElement(g.cancel)
              ? g.cancel
              : g.cancel && gN(g.cancel)
                ? z.createElement(
                    "button",
                    {
                      "data-button": !0,
                      "data-cancel": !0,
                      style: g.cancelButtonStyle || E,
                      onClick: (e) => {
                        var t, n;
                        gN(g.cancel) &&
                          ue &&
                          (null == (n = (t = g.cancel).onClick) || n.call(t, e), Ne());
                      },
                      className: mN(
                        null == A ? void 0 : A.cancelButton,
                        null == (d = null == g ? void 0 : g.classNames) ? void 0 : d.cancelButton,
                      ),
                    },
                    g.cancel.label,
                  )
                : null,
            H.isValidElement(g.action)
              ? g.action
              : g.action && gN(g.action)
                ? z.createElement(
                    "button",
                    {
                      "data-button": !0,
                      "data-action": !0,
                      style: g.actionButtonStyle || N,
                      onClick: (e) => {
                        var t, n;
                        gN(g.action) &&
                          (null == (n = (t = g.action).onClick) || n.call(t, e),
                          !e.defaultPrevented && Ne());
                      },
                      className: mN(
                        null == A ? void 0 : A.actionButton,
                        null == (u = null == g ? void 0 : g.classNames) ? void 0 : u.actionButton,
                      ),
                    },
                    g.action.label,
                  )
                : null,
          ),
    )
  );
};
function vN() {
  if ("undefined" == typeof window || "undefined" == typeof document) return "ltr";
  let e = document.documentElement.getAttribute("dir");
  return "auto" !== e && e ? e : window.getComputedStyle(document.documentElement).direction;
}
function bN(e, t) {
  let n = {};
  return (
    [e, t].forEach((e, t) => {
      let i = 1 === t,
        r = i ? "--mobile-offset" : "--offset",
        o = i ? "16px" : "32px";
      function s(e) {
        ["top", "right", "bottom", "left"].forEach((t) => {
          n[`${r}-${t}`] = "number" == typeof e ? `${e}px` : e;
        });
      }
      "number" == typeof e || "string" == typeof e
        ? s(e)
        : "object" == typeof e
          ? ["top", "right", "bottom", "left"].forEach((t) => {
              void 0 === e[t]
                ? (n[`${r}-${t}`] = o)
                : (n[`${r}-${t}`] = "number" == typeof e[t] ? `${e[t]}px` : e[t]);
            })
          : s(o);
    }),
    n
  );
}
var yN = H.forwardRef(function (e, t) {
  let {
      invert: n,
      position: i = "bottom-right",
      hotkey: r = ["altKey", "KeyT"],
      expand: o,
      closeButton: s,
      className: a,
      offset: l,
      mobileOffset: c,
      theme: d = "light",
      richColors: u,
      duration: h,
      style: g,
      visibleToasts: p = pN,
      toastOptions: f,
      dir: m = vN(),
      gap: _ = fN,
      loadingIcon: v,
      icons: b,
      containerAriaLabel: y = "Notifications",
      pauseWhenPageIsHidden: x,
    } = e,
    [w, C] = z.useState([]),
    S = z.useMemo(
      () => Array.from(new Set([i].concat(w.filter((e) => e.position).map((e) => e.position)))),
      [w, i],
    ),
    [k, E] = z.useState([]),
    [N, L] = z.useState(!1),
    [D, T] = z.useState(!1),
    [I, R] = z.useState(
      "system" !== d
        ? d
        : "undefined" != typeof window &&
            window.matchMedia &&
            window.matchMedia("(prefers-color-scheme: dark)").matches
          ? "dark"
          : "light",
    ),
    O = z.useRef(null),
    M = r.join("+").replace(/Key/g, "").replace(/Digit/g, ""),
    A = z.useRef(null),
    P = z.useRef(!1),
    j = z.useCallback((e) => {
      C((t) => {
        var n;
        return (
          (null != (n = t.find((t) => t.id === e.id)) && n.delete) || cN.dismiss(e.id),
          t.filter(({ id: t }) => t !== e.id)
        );
      });
    }, []);
  return (
    z.useEffect(
      () =>
        cN.subscribe((e) => {
          e.dismiss
            ? C((t) => t.map((t) => (t.id === e.id ? { ...t, delete: !0 } : t)))
            : setTimeout(() => {
                ou.flushSync(() => {
                  C((t) => {
                    let n = t.findIndex((t) => t.id === e.id);
                    return -1 !== n
                      ? [...t.slice(0, n), { ...t[n], ...e }, ...t.slice(n + 1)]
                      : [e, ...t];
                  });
                });
              });
        }),
      [],
    ),
    z.useEffect(() => {
      if ("system" !== d) return void R(d);
      if (
        ("system" === d &&
          (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches
            ? R("dark")
            : R("light")),
        "undefined" == typeof window)
      )
        return;
      let e = window.matchMedia("(prefers-color-scheme: dark)");
      try {
        e.addEventListener("change", ({ matches: e }) => {
          R(e ? "dark" : "light");
        });
      } catch (cpt) {
        e.addListener(({ matches: e }) => {
          try {
            R(e ? "dark" : "light");
          } catch (ed) {}
        });
      }
    }, [d]),
    z.useEffect(() => {
      w.length <= 1 && L(!1);
    }, [w]),
    z.useEffect(() => {
      let e = (e) => {
        var t, n;
        (r.every((t) => e[t] || e.code === t) && (L(!0), null == (t = O.current) || t.focus()),
          "Escape" === e.code &&
            (document.activeElement === O.current ||
              (null != (n = O.current) && n.contains(document.activeElement))) &&
            L(!1));
      };
      return (
        document.addEventListener("keydown", e),
        () => document.removeEventListener("keydown", e)
      );
    }, [r]),
    z.useEffect(() => {
      if (O.current)
        return () => {
          A.current &&
            (A.current.focus({ preventScroll: !0 }), (A.current = null), (P.current = !1));
        };
    }, [O.current]),
    z.createElement(
      "section",
      {
        ref: t,
        "aria-label": `${y} ${M}`,
        tabIndex: -1,
        "aria-live": "polite",
        "aria-relevant": "additions text",
        "aria-atomic": "false",
        suppressHydrationWarning: !0,
      },
      S.map((t, i) => {
        var r;
        let [d, y] = t.split("-");
        return w.length
          ? z.createElement(
              "ol",
              {
                key: t,
                dir: "auto" === m ? vN() : m,
                tabIndex: -1,
                ref: O,
                className: a,
                "data-sonner-toaster": !0,
                "data-theme": I,
                "data-y-position": d,
                "data-lifted": N && w.length > 1 && !o,
                "data-x-position": y,
                style: {
                  "--front-toast-height": `${(null == (r = k[0]) ? void 0 : r.height) || 0}px`,
                  "--width": "356px",
                  "--gap": `${_}px`,
                  ...g,
                  ...bN(l, c),
                },
                onBlur: (e) => {
                  P.current &&
                    !e.currentTarget.contains(e.relatedTarget) &&
                    ((P.current = !1),
                    A.current && (A.current.focus({ preventScroll: !0 }), (A.current = null)));
                },
                onFocus: (e) => {
                  (e.target instanceof HTMLElement && "false" === e.target.dataset.dismissible) ||
                    P.current ||
                    ((P.current = !0), (A.current = e.relatedTarget));
                },
                onMouseEnter: () => L(!0),
                onMouseMove: () => L(!0),
                onMouseLeave: () => {
                  D || L(!1);
                },
                onDragEnd: () => L(!1),
                onPointerDown: (e) => {
                  (e.target instanceof HTMLElement && "false" === e.target.dataset.dismissible) ||
                    T(!0);
                },
                onPointerUp: () => T(!1),
              },
              w
                .filter((e) => (!e.position && 0 === i) || e.position === t)
                .map((i, r) => {
                  var a, l;
                  return z.createElement(_N, {
                    key: i.id,
                    icons: b,
                    index: r,
                    toast: i,
                    defaultRichColors: u,
                    duration: null != (a = null == f ? void 0 : f.duration) ? a : h,
                    className: null == f ? void 0 : f.className,
                    descriptionClassName: null == f ? void 0 : f.descriptionClassName,
                    invert: n,
                    visibleToasts: p,
                    closeButton: null != (l = null == f ? void 0 : f.closeButton) ? l : s,
                    interacting: D,
                    position: t,
                    style: null == f ? void 0 : f.style,
                    unstyled: null == f ? void 0 : f.unstyled,
                    classNames: null == f ? void 0 : f.classNames,
                    cancelButtonStyle: null == f ? void 0 : f.cancelButtonStyle,
                    actionButtonStyle: null == f ? void 0 : f.actionButtonStyle,
                    removeToast: j,
                    toasts: w.filter((e) => e.position == i.position),
                    heights: k.filter((e) => e.position == i.position),
                    setHeights: E,
                    expandByDefault: o,
                    gap: _,
                    loadingIcon: v,
                    expanded: N,
                    pauseWhenPageIsHidden: x,
                    swipeDirections: e.swipeDirections,
                  });
                }),
            )
          : null;
      }),
    )
  );
});
function xN() {
  Pm();
  const e = window.location.pathname,
    t = e && !["/404", "/sign-in"].includes(e),
    n = new URL(window.location.href),
    i = `${n.pathname.split("/")[1] ? `/${n.pathname.split("/")[1]}` : ""}#/sign-in`;
  window.location.href = i + (t ? `?redirect=${e}` : "");
}
const wN = (e) => "string" == typeof e,
  CN = () => {
    let e, t;
    const n = new Promise((n, i) => {
      ((e = n), (t = i));
    });
    return ((n.resolve = e), (n.reject = t), n);
  },
  SN = (e) => (null == e ? "" : "" + e),
  kN = /###/g,
  EN = (e) => (e && e.indexOf("###") > -1 ? e.replace(kN, ".") : e),
  NN = (e) => !e || wN(e),
  LN = (e, t, n) => {
    const i = wN(t) ? t.split(".") : t;
    let r = 0;
    for (; r < i.length - 1; ) {
      if (NN(e)) return {};
      const t = EN(i[r]);
      (!e[t] && n && (e[t] = new n()),
        (e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}),
        ++r);
    }
    return NN(e) ? {} : { obj: e, k: EN(i[r]) };
  },
  DN = (e, t, n) => {
    const { obj: i, k: r } = LN(e, t, Object);
    if (void 0 !== i || 1 === t.length) return void (i[r] = n);
    let o = t[t.length - 1],
      s = t.slice(0, t.length - 1),
      a = LN(e, s, Object);
    for (; void 0 === a.obj && s.length; )
      ((o = `${s[s.length - 1]}.${o}`),
        (s = s.slice(0, s.length - 1)),
        (a = LN(e, s, Object)),
        a?.obj && void 0 !== a.obj[`${a.k}.${o}`] && (a.obj = void 0));
    a.obj[`${a.k}.${o}`] = n;
  },
  TN = (e, t) => {
    const { obj: n, k: i } = LN(e, t);
    if (n && Object.prototype.hasOwnProperty.call(n, i)) return n[i];
  },
  IN = (e, t, n) => {
    for (const i in t)
      "__proto__" !== i &&
        "constructor" !== i &&
        (i in e
          ? wN(e[i]) || e[i] instanceof String || wN(t[i]) || t[i] instanceof String
            ? n && (e[i] = t[i])
            : IN(e[i], t[i], n)
          : (e[i] = t[i]));
    return e;
  },
  RN = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
var ON = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;", "/": "&#x2F;" };
const MN = (e) => (wN(e) ? e.replace(/[&<>"'\/]/g, (e) => ON[e]) : e);
const AN = [" ", ",", "?", "!", ";"],
  PN = new (class {
    constructor(e) {
      ((this.capacity = e), (this.regExpMap = new Map()), (this.regExpQueue = []));
    }
    getRegExp(e) {
      const t = this.regExpMap.get(e);
      if (void 0 !== t) return t;
      const n = new RegExp(e);
      return (
        this.regExpQueue.length === this.capacity &&
          this.regExpMap.delete(this.regExpQueue.shift()),
        this.regExpMap.set(e, n),
        this.regExpQueue.push(e),
        n
      );
    }
  })(20),
  jN = function (e, t) {
    let n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : ".";
    if (!e) return;
    if (e[t]) {
      if (!Object.prototype.hasOwnProperty.call(e, t)) return;
      return e[t];
    }
    const i = t.split(n);
    let r = e;
    for (let o = 0; o < i.length; ) {
      if (!r || "object" != typeof r) return;
      let e,
        t = "";
      for (let s = o; s < i.length; ++s)
        if ((s !== o && (t += n), (t += i[s]), (e = r[t]), void 0 !== e)) {
          if (["string", "number", "boolean"].indexOf(typeof e) > -1 && s < i.length - 1) continue;
          o += s - o + 1;
          break;
        }
      r = e;
    }
    return r;
  },
  FN = (e) => e?.replace("_", "-"),
  BN = {
    type: "logger",
    log(e) {
      this.output("log", e);
    },
    warn(e) {
      this.output("warn", e);
    },
    error(e) {
      this.output("error", e);
    },
    output(e, t) {},
  };
var VN = new (class e {
  constructor(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    this.init(e, t);
  }
  init(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    ((this.prefix = t.prefix || "i18next:"),
      (this.logger = e || BN),
      (this.options = t),
      (this.debug = t.debug));
  }
  log() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
    return this.forward(t, "log", "", !0);
  }
  warn() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
    return this.forward(t, "warn", "", !0);
  }
  error() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
    return this.forward(t, "error", "");
  }
  deprecate() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
    return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
  }
  forward(e, t, n, i) {
    return i && !this.debug
      ? null
      : (wN(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
  }
  create(t) {
    return new e(this.logger, { prefix: `${this.prefix}:${t}:`, ...this.options });
  }
  clone(t) {
    return (((t = t || this.options).prefix = t.prefix || this.prefix), new e(this.logger, t));
  }
})();
let WN = class {
  constructor() {
    this.observers = {};
  }
  on(e, t) {
    return (
      e.split(" ").forEach((e) => {
        this.observers[e] || (this.observers[e] = new Map());
        const n = this.observers[e].get(t) || 0;
        this.observers[e].set(t, n + 1);
      }),
      this
    );
  }
  off(e, t) {
    this.observers[e] && (t ? this.observers[e].delete(t) : delete this.observers[e]);
  }
  emit(e) {
    for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
      n[i - 1] = arguments[i];
    if (this.observers[e]) {
      Array.from(this.observers[e].entries()).forEach((e) => {
        let [t, i] = e;
        for (let r = 0; r < i; r++) t(...n);
      });
    }
    if (this.observers["*"]) {
      Array.from(this.observers["*"].entries()).forEach((t) => {
        let [i, r] = t;
        for (let o = 0; o < r; o++) i.apply(i, [e, ...n]);
      });
    }
  }
};
class HN extends WN {
  constructor(e) {
    let t =
      arguments.length > 1 && void 0 !== arguments[1]
        ? arguments[1]
        : { ns: ["translation"], defaultNS: "translation" };
    (super(),
      (this.data = e || {}),
      (this.options = t),
      void 0 === this.options.keySeparator && (this.options.keySeparator = "."),
      void 0 === this.options.ignoreJSONStructure && (this.options.ignoreJSONStructure = !0));
  }
  addNamespaces(e) {
    this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
  }
  removeNamespaces(e) {
    const t = this.options.ns.indexOf(e);
    t > -1 && this.options.ns.splice(t, 1);
  }
  getResource(e, t, n) {
    let i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    const r = void 0 !== i.keySeparator ? i.keySeparator : this.options.keySeparator,
      o =
        void 0 !== i.ignoreJSONStructure ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
    let s;
    e.indexOf(".") > -1
      ? (s = e.split("."))
      : ((s = [e, t]),
        n && (Array.isArray(n) ? s.push(...n) : wN(n) && r ? s.push(...n.split(r)) : s.push(n)));
    const a = TN(this.data, s);
    return (
      !a && !t && !n && e.indexOf(".") > -1 && ((e = s[0]), (t = s[1]), (n = s.slice(2).join("."))),
      !a && o && wN(n) ? jN(this.data?.[e]?.[t], n, r) : a
    );
  }
  addResource(e, t, n, i) {
    let r = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : { silent: !1 };
    const o = void 0 !== r.keySeparator ? r.keySeparator : this.options.keySeparator;
    let s = [e, t];
    (n && (s = s.concat(o ? n.split(o) : n)),
      e.indexOf(".") > -1 && ((s = e.split(".")), (i = t), (t = s[1])),
      this.addNamespaces(t),
      DN(this.data, s, i),
      r.silent || this.emit("added", e, t, n, i));
  }
  addResources(e, t, n) {
    let i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : { silent: !1 };
    for (const r in n)
      (wN(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
    i.silent || this.emit("added", e, t, n);
  }
  addResourceBundle(e, t, n, i, r) {
    let o =
        arguments.length > 5 && void 0 !== arguments[5]
          ? arguments[5]
          : { silent: !1, skipCopy: !1 },
      s = [e, t];
    (e.indexOf(".") > -1 && ((s = e.split(".")), (i = n), (n = t), (t = s[1])),
      this.addNamespaces(t));
    let a = TN(this.data, s) || {};
    (o.skipCopy || (n = JSON.parse(JSON.stringify(n))),
      i ? IN(a, n, r) : (a = { ...a, ...n }),
      DN(this.data, s, a),
      o.silent || this.emit("added", e, t, n));
  }
  removeResourceBundle(e, t) {
    (this.hasResourceBundle(e, t) && delete this.data[e][t],
      this.removeNamespaces(t),
      this.emit("removed", e, t));
  }
  hasResourceBundle(e, t) {
    return void 0 !== this.getResource(e, t);
  }
  getResourceBundle(e, t) {
    return (t || (t = this.options.defaultNS), this.getResource(e, t));
  }
  getDataByLanguage(e) {
    return this.data[e];
  }
  hasLanguageSomeTranslations(e) {
    const t = this.getDataByLanguage(e);
    return !!((t && Object.keys(t)) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
  }
  toJSON() {
    return this.data;
  }
}
var zN = {
  processors: {},
  addPostProcessor(e) {
    this.processors[e.name] = e;
  },
  handle(e, t, n, i, r) {
    return (
      e.forEach((e) => {
        t = this.processors[e]?.process(t, n, i, r) ?? t;
      }),
      t
    );
  },
};
const UN = {},
  $N = (e) => !wN(e) && "boolean" != typeof e && "number" != typeof e;
class qN extends WN {
  constructor(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    (super(),
      ((e, t, n) => {
        e.forEach((e) => {
          t[e] && (n[e] = t[e]);
        });
      })(
        [
          "resourceStore",
          "languageUtils",
          "pluralResolver",
          "interpolator",
          "backendConnector",
          "i18nFormat",
          "utils",
        ],
        e,
        this,
      ),
      (this.options = t),
      void 0 === this.options.keySeparator && (this.options.keySeparator = "."),
      (this.logger = VN.create("translator")));
  }
  changeLanguage(e) {
    e && (this.language = e);
  }
  exists(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} };
    if (null == e) return !1;
    const n = this.resolve(e, t);
    return void 0 !== n?.res;
  }
  extractFromKey(e, t) {
    let n = void 0 !== t.nsSeparator ? t.nsSeparator : this.options.nsSeparator;
    void 0 === n && (n = ":");
    const i = void 0 !== t.keySeparator ? t.keySeparator : this.options.keySeparator;
    let r = t.ns || this.options.defaultNS || [];
    const o = n && e.indexOf(n) > -1,
      s = !(
        this.options.userDefinedKeySeparator ||
        t.keySeparator ||
        this.options.userDefinedNsSeparator ||
        t.nsSeparator ||
        ((e, t, n) => {
          ((t = t || ""), (n = n || ""));
          const i = AN.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
          if (0 === i.length) return !0;
          const r = PN.getRegExp(`(${i.map((e) => ("?" === e ? "\\?" : e)).join("|")})`);
          let o = !r.test(e);
          if (!o) {
            const t = e.indexOf(n);
            t > 0 && !r.test(e.substring(0, t)) && (o = !0);
          }
          return o;
        })(e, n, i)
      );
    if (o && !s) {
      const t = e.match(this.interpolator.nestingRegexp);
      if (t && t.length > 0) return { key: e, namespaces: wN(r) ? [r] : r };
      const o = e.split(n);
      ((n !== i || (n === i && this.options.ns.indexOf(o[0]) > -1)) && (r = o.shift()),
        (e = o.join(i)));
    }
    return { key: e, namespaces: wN(r) ? [r] : r };
  }
  translate(e, t, n) {
    if (
      ("object" != typeof t &&
        this.options.overloadTranslationOptionHandler &&
        (t = this.options.overloadTranslationOptionHandler(arguments)),
      "object" == typeof t && (t = { ...t }),
      t || (t = {}),
      null == e)
    )
      return "";
    Array.isArray(e) || (e = [String(e)]);
    const i = void 0 !== t.returnDetails ? t.returnDetails : this.options.returnDetails,
      r = void 0 !== t.keySeparator ? t.keySeparator : this.options.keySeparator,
      { key: o, namespaces: s } = this.extractFromKey(e[e.length - 1], t),
      a = s[s.length - 1],
      l = t.lng || this.language,
      c = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
    if ("cimode" === l?.toLowerCase()) {
      if (c) {
        const e = t.nsSeparator || this.options.nsSeparator;
        return i
          ? {
              res: `${a}${e}${o}`,
              usedKey: o,
              exactUsedKey: o,
              usedLng: l,
              usedNS: a,
              usedParams: this.getUsedParamsDetails(t),
            }
          : `${a}${e}${o}`;
      }
      return i
        ? {
            res: o,
            usedKey: o,
            exactUsedKey: o,
            usedLng: l,
            usedNS: a,
            usedParams: this.getUsedParamsDetails(t),
          }
        : o;
    }
    const d = this.resolve(e, t);
    let u = d?.res;
    const h = d?.usedKey || o,
      g = d?.exactUsedKey || o,
      p = void 0 !== t.joinArrays ? t.joinArrays : this.options.joinArrays,
      f = !this.i18nFormat || this.i18nFormat.handleAsObject,
      m = void 0 !== t.count && !wN(t.count),
      _ = qN.hasDefaultValue(t),
      v = m ? this.pluralResolver.getSuffix(l, t.count, t) : "",
      b = t.ordinal && m ? this.pluralResolver.getSuffix(l, t.count, { ordinal: !1 }) : "",
      y = m && !t.ordinal && 0 === t.count,
      x =
        (y && t[`defaultValue${this.options.pluralSeparator}zero`]) ||
        t[`defaultValue${v}`] ||
        t[`defaultValue${b}`] ||
        t.defaultValue;
    let w = u;
    f && !u && _ && (w = x);
    const C = $N(w),
      S = Object.prototype.toString.apply(w);
    if (
      !(
        f &&
        w &&
        C &&
        ["[object Number]", "[object Function]", "[object RegExp]"].indexOf(S) < 0
      ) ||
      (wN(p) && Array.isArray(w))
    )
      if (f && wN(p) && Array.isArray(u))
        ((u = u.join(p)), u && (u = this.extendTranslation(u, e, t, n)));
      else {
        let i = !1,
          s = !1;
        (!this.isValidLookup(u) && _ && ((i = !0), (u = x)),
          this.isValidLookup(u) || ((s = !0), (u = o)));
        const c =
            (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && s
              ? void 0
              : u,
          h = _ && x !== u && this.options.updateMissing;
        if (s || i || h) {
          if ((this.logger.log(h ? "updateKey" : "missingKey", l, a, o, h ? x : u), r)) {
            const e = this.resolve(o, { ...t, keySeparator: !1 });
            e &&
              e.res &&
              this.logger.warn(
                "Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.",
              );
          }
          let e = [];
          const n = this.languageUtils.getFallbackCodes(
            this.options.fallbackLng,
            t.lng || this.language,
          );
          if ("fallback" === this.options.saveMissingTo && n && n[0])
            for (let t = 0; t < n.length; t++) e.push(n[t]);
          else
            "all" === this.options.saveMissingTo
              ? (e = this.languageUtils.toResolveHierarchy(t.lng || this.language))
              : e.push(t.lng || this.language);
          const i = (e, n, i) => {
            const r = _ && i !== u ? i : c;
            (this.options.missingKeyHandler
              ? this.options.missingKeyHandler(e, a, n, r, h, t)
              : this.backendConnector?.saveMissing &&
                this.backendConnector.saveMissing(e, a, n, r, h, t),
              this.emit("missingKey", e, a, n, u));
          };
          this.options.saveMissing &&
            (this.options.saveMissingPlurals && m
              ? e.forEach((e) => {
                  const n = this.pluralResolver.getSuffixes(e, t);
                  (y &&
                    t[`defaultValue${this.options.pluralSeparator}zero`] &&
                    n.indexOf(`${this.options.pluralSeparator}zero`) < 0 &&
                    n.push(`${this.options.pluralSeparator}zero`),
                    n.forEach((n) => {
                      i([e], o + n, t[`defaultValue${n}`] || x);
                    }));
                })
              : i(e, o, x));
        }
        ((u = this.extendTranslation(u, e, t, d, n)),
          s && u === o && this.options.appendNamespaceToMissingKey && (u = `${a}:${o}`),
          (s || i) &&
            this.options.parseMissingKeyHandler &&
            (u = this.options.parseMissingKeyHandler(
              this.options.appendNamespaceToMissingKey ? `${a}:${o}` : o,
              i ? u : void 0,
            )));
      }
    else {
      if (!t.returnObjects && !this.options.returnObjects) {
        this.options.returnedObjectHandler ||
          this.logger.warn("accessing an object - but returnObjects options is not enabled!");
        const e = this.options.returnedObjectHandler
          ? this.options.returnedObjectHandler(h, w, { ...t, ns: s })
          : `key '${o} (${this.language})' returned an object instead of string.`;
        return i ? ((d.res = e), (d.usedParams = this.getUsedParamsDetails(t)), d) : e;
      }
      if (r) {
        const e = Array.isArray(w),
          n = e ? [] : {},
          i = e ? g : h;
        for (const o in w)
          if (Object.prototype.hasOwnProperty.call(w, o)) {
            const e = `${i}${r}${o}`;
            ((n[o] =
              _ && !u
                ? this.translate(e, {
                    ...t,
                    defaultValue: $N(x) ? x[o] : void 0,
                    joinArrays: !1,
                    ns: s,
                  })
                : this.translate(e, { ...t, joinArrays: !1, ns: s })),
              n[o] === e && (n[o] = w[o]));
          }
        u = n;
      }
    }
    return i ? ((d.res = u), (d.usedParams = this.getUsedParamsDetails(t)), d) : u;
  }
  extendTranslation(e, t, n, i, r) {
    var o = this;
    if (this.i18nFormat?.parse)
      e = this.i18nFormat.parse(
        e,
        { ...this.options.interpolation.defaultVariables, ...n },
        n.lng || this.language || i.usedLng,
        i.usedNS,
        i.usedKey,
        { resolved: i },
      );
    else if (!n.skipInterpolation) {
      n.interpolation &&
        this.interpolator.init({
          ...n,
          interpolation: { ...this.options.interpolation, ...n.interpolation },
        });
      const s =
        wN(e) &&
        (void 0 !== n?.interpolation?.skipOnVariables
          ? n.interpolation.skipOnVariables
          : this.options.interpolation.skipOnVariables);
      let a;
      if (s) {
        const t = e.match(this.interpolator.nestingRegexp);
        a = t && t.length;
      }
      let l = n.replace && !wN(n.replace) ? n.replace : n;
      if (
        (this.options.interpolation.defaultVariables &&
          (l = { ...this.options.interpolation.defaultVariables, ...l }),
        (e = this.interpolator.interpolate(e, l, n.lng || this.language || i.usedLng, n)),
        s)
      ) {
        const t = e.match(this.interpolator.nestingRegexp);
        a < (t && t.length) && (n.nest = !1);
      }
      (!n.lng && i && i.res && (n.lng = this.language || i.usedLng),
        !1 !== n.nest &&
          (e = this.interpolator.nest(
            e,
            function () {
              for (var e = arguments.length, i = new Array(e), s = 0; s < e; s++)
                i[s] = arguments[s];
              return r?.[0] !== i[0] || n.context
                ? o.translate(...i, t)
                : (o.logger.warn(
                    `It seems you are nesting recursively key: ${i[0]} in key: ${t[0]}`,
                  ),
                  null);
            },
            n,
          )),
        n.interpolation && this.interpolator.reset());
    }
    const s = n.postProcess || this.options.postProcess,
      a = wN(s) ? [s] : s;
    return (
      null != e &&
        a?.length &&
        !1 !== n.applyPostProcessor &&
        (e = zN.handle(
          a,
          e,
          t,
          this.options && this.options.postProcessPassResolved
            ? { i18nResolved: { ...i, usedParams: this.getUsedParamsDetails(n) }, ...n }
            : n,
          this,
        )),
      e
    );
  }
  resolve(e) {
    let t,
      n,
      i,
      r,
      o,
      s = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    return (
      wN(e) && (e = [e]),
      e.forEach((e) => {
        if (this.isValidLookup(t)) return;
        const a = this.extractFromKey(e, s),
          l = a.key;
        n = l;
        let c = a.namespaces;
        this.options.fallbackNS && (c = c.concat(this.options.fallbackNS));
        const d = void 0 !== s.count && !wN(s.count),
          u = d && !s.ordinal && 0 === s.count,
          h =
            void 0 !== s.context &&
            (wN(s.context) || "number" == typeof s.context) &&
            "" !== s.context,
          g = s.lngs
            ? s.lngs
            : this.languageUtils.toResolveHierarchy(s.lng || this.language, s.fallbackLng);
        c.forEach((e) => {
          this.isValidLookup(t) ||
            ((o = e),
            UN[`${g[0]}-${e}`] ||
              !this.utils?.hasLoadedNamespace ||
              this.utils?.hasLoadedNamespace(o) ||
              ((UN[`${g[0]}-${e}`] = !0),
              this.logger.warn(
                `key "${n}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,
                "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!",
              )),
            g.forEach((n) => {
              if (this.isValidLookup(t)) return;
              r = n;
              const o = [l];
              if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o, l, n, e, s);
              else {
                let e;
                d && (e = this.pluralResolver.getSuffix(n, s.count, s));
                const t = `${this.options.pluralSeparator}zero`,
                  i = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
                if (
                  (d &&
                    (o.push(l + e),
                    s.ordinal &&
                      0 === e.indexOf(i) &&
                      o.push(l + e.replace(i, this.options.pluralSeparator)),
                    u && o.push(l + t)),
                  h)
                ) {
                  const n = `${l}${this.options.contextSeparator}${s.context}`;
                  (o.push(n),
                    d &&
                      (o.push(n + e),
                      s.ordinal &&
                        0 === e.indexOf(i) &&
                        o.push(n + e.replace(i, this.options.pluralSeparator)),
                      u && o.push(n + t)));
                }
              }
              let a;
              for (; (a = o.pop()); )
                this.isValidLookup(t) || ((i = a), (t = this.getResource(n, e, a, s)));
            }));
        });
      }),
      { res: t, usedKey: n, exactUsedKey: i, usedLng: r, usedNS: o }
    );
  }
  isValidLookup(e) {
    return !(
      void 0 === e ||
      (!this.options.returnNull && null === e) ||
      (!this.options.returnEmptyString && "" === e)
    );
  }
  getResource(e, t, n) {
    let i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    return this.i18nFormat?.getResource
      ? this.i18nFormat.getResource(e, t, n, i)
      : this.resourceStore.getResource(e, t, n, i);
  }
  getUsedParamsDetails() {
    let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    const t = [
        "defaultValue",
        "ordinal",
        "context",
        "replace",
        "lng",
        "lngs",
        "fallbackLng",
        "ns",
        "keySeparator",
        "nsSeparator",
        "returnObjects",
        "returnDetails",
        "joinArrays",
        "postProcess",
        "interpolation",
      ],
      n = e.replace && !wN(e.replace);
    let i = n ? e.replace : e;
    if (
      (n && void 0 !== e.count && (i.count = e.count),
      this.options.interpolation.defaultVariables &&
        (i = { ...this.options.interpolation.defaultVariables, ...i }),
      !n)
    ) {
      i = { ...i };
      for (const e of t) delete i[e];
    }
    return i;
  }
  static hasDefaultValue(e) {
    const t = "defaultValue";
    for (const n in e)
      if (Object.prototype.hasOwnProperty.call(e, n) && t === n.substring(0, 12) && void 0 !== e[n])
        return !0;
    return !1;
  }
}
class KN {
  constructor(e) {
    ((this.options = e),
      (this.supportedLngs = this.options.supportedLngs || !1),
      (this.logger = VN.create("languageUtils")));
  }
  getScriptPartFromCode(e) {
    if (!(e = FN(e)) || e.indexOf("-") < 0) return null;
    const t = e.split("-");
    return 2 === t.length
      ? null
      : (t.pop(),
        "x" === t[t.length - 1].toLowerCase() ? null : this.formatLanguageCode(t.join("-")));
  }
  getLanguagePartFromCode(e) {
    if (!(e = FN(e)) || e.indexOf("-") < 0) return e;
    const t = e.split("-");
    return this.formatLanguageCode(t[0]);
  }
  formatLanguageCode(e) {
    if (wN(e) && e.indexOf("-") > -1) {
      let t;
      try {
        t = Intl.getCanonicalLocales(e)[0];
      } catch (spt) {}
      return (
        t && this.options.lowerCaseLng && (t = t.toLowerCase()),
        t || (this.options.lowerCaseLng ? e.toLowerCase() : e)
      );
    }
    return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
  }
  isSupportedCode(e) {
    return (
      ("languageOnly" === this.options.load || this.options.nonExplicitSupportedLngs) &&
        (e = this.getLanguagePartFromCode(e)),
      !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1
    );
  }
  getBestMatchFromCodes(e) {
    if (!e) return null;
    let t;
    return (
      e.forEach((e) => {
        if (t) return;
        const n = this.formatLanguageCode(e);
        (this.options.supportedLngs && !this.isSupportedCode(n)) || (t = n);
      }),
      !t &&
        this.options.supportedLngs &&
        e.forEach((e) => {
          if (t) return;
          const n = this.getLanguagePartFromCode(e);
          if (this.isSupportedCode(n)) return (t = n);
          t = this.options.supportedLngs.find((e) =>
            e === n
              ? e
              : e.indexOf("-") < 0 && n.indexOf("-") < 0
                ? void 0
                : (e.indexOf("-") > 0 &&
                      n.indexOf("-") < 0 &&
                      e.substring(0, e.indexOf("-")) === n) ||
                    (0 === e.indexOf(n) && n.length > 1)
                  ? e
                  : void 0,
          );
        }),
      t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]),
      t
    );
  }
  getFallbackCodes(e, t) {
    if (!e) return [];
    if (("function" == typeof e && (e = e(t)), wN(e) && (e = [e]), Array.isArray(e))) return e;
    if (!t) return e.default || [];
    let n = e[t];
    return (
      n || (n = e[this.getScriptPartFromCode(t)]),
      n || (n = e[this.formatLanguageCode(t)]),
      n || (n = e[this.getLanguagePartFromCode(t)]),
      n || (n = e.default),
      n || []
    );
  }
  toResolveHierarchy(e, t) {
    const n = this.getFallbackCodes(t || this.options.fallbackLng || [], e),
      i = [],
      r = (e) => {
        e &&
          (this.isSupportedCode(e)
            ? i.push(e)
            : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
      };
    return (
      wN(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1)
        ? ("languageOnly" !== this.options.load && r(this.formatLanguageCode(e)),
          "languageOnly" !== this.options.load &&
            "currentOnly" !== this.options.load &&
            r(this.getScriptPartFromCode(e)),
          "currentOnly" !== this.options.load && r(this.getLanguagePartFromCode(e)))
        : wN(e) && r(this.formatLanguageCode(e)),
      n.forEach((e) => {
        i.indexOf(e) < 0 && r(this.formatLanguageCode(e));
      }),
      i
    );
  }
}
const GN = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 },
  ZN = {
    select: (e) => (1 === e ? "one" : "other"),
    resolvedOptions: () => ({ pluralCategories: ["one", "other"] }),
  };
class YN {
  constructor(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    ((this.languageUtils = e),
      (this.options = t),
      (this.logger = VN.create("pluralResolver")),
      (this.pluralRulesCache = {}));
  }
  addRule(e, t) {
    this.rules[e] = t;
  }
  clearCache() {
    this.pluralRulesCache = {};
  }
  getRule(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    const n = FN("dev" === e ? "en" : e),
      i = t.ordinal ? "ordinal" : "cardinal",
      r = JSON.stringify({ cleanedCode: n, type: i });
    if (r in this.pluralRulesCache) return this.pluralRulesCache[r];
    let o;
    try {
      o = new Intl.PluralRules(n, { type: i });
    } catch (s) {
      if (!Intl) return (this.logger.error("No Intl support, please use an Intl polyfill!"), ZN);
      if (!e.match(/-|_/)) return ZN;
      const n = this.languageUtils.getLanguagePartFromCode(e);
      o = this.getRule(n, t);
    }
    return ((this.pluralRulesCache[r] = o), o);
  }
  needsPlural(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
      n = this.getRule(e, t);
    return (n || (n = this.getRule("dev", t)), n?.resolvedOptions().pluralCategories.length > 1);
  }
  getPluralFormsOfKey(e, t) {
    let n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
    return this.getSuffixes(e, n).map((e) => `${t}${e}`);
  }
  getSuffixes(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
      n = this.getRule(e, t);
    return (
      n || (n = this.getRule("dev", t)),
      n
        ? n
            .resolvedOptions()
            .pluralCategories.sort((e, t) => GN[e] - GN[t])
            .map(
              (e) =>
                `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`,
            )
        : []
    );
  }
  getSuffix(e, t) {
    let n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
    const i = this.getRule(e, n);
    return i
      ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}`
      : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
  }
}
const XN = function (e, t, n) {
    let i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : ".",
      r = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4],
      o = ((e, t, n) => {
        const i = TN(e, n);
        return void 0 !== i ? i : TN(t, n);
      })(e, t, n);
    return (!o && r && wN(n) && ((o = jN(e, n, i)), void 0 === o && (o = jN(t, n, i))), o);
  },
  QN = (e) => e.replace(/\$/g, "$$$$");
class JN {
  constructor() {
    let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    ((this.logger = VN.create("interpolator")),
      (this.options = e),
      (this.format = e?.interpolation?.format || ((e) => e)),
      this.init(e));
  }
  init() {
    let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    e.interpolation || (e.interpolation = { escapeValue: !0 });
    const {
      escape: t,
      escapeValue: n,
      useRawValueToEscape: i,
      prefix: r,
      prefixEscaped: o,
      suffix: s,
      suffixEscaped: a,
      formatSeparator: l,
      unescapeSuffix: c,
      unescapePrefix: d,
      nestingPrefix: u,
      nestingPrefixEscaped: h,
      nestingSuffix: g,
      nestingSuffixEscaped: p,
      nestingOptionsSeparator: f,
      maxReplaces: m,
      alwaysFormat: _,
    } = e.interpolation;
    ((this.escape = void 0 !== t ? t : MN),
      (this.escapeValue = void 0 === n || n),
      (this.useRawValueToEscape = void 0 !== i && i),
      (this.prefix = r ? RN(r) : o || "{{"),
      (this.suffix = s ? RN(s) : a || "}}"),
      (this.formatSeparator = l || ","),
      (this.unescapePrefix = c ? "" : d || "-"),
      (this.unescapeSuffix = this.unescapePrefix ? "" : c || ""),
      (this.nestingPrefix = u ? RN(u) : h || RN("$t(")),
      (this.nestingSuffix = g ? RN(g) : p || RN(")")),
      (this.nestingOptionsSeparator = f || ","),
      (this.maxReplaces = m || 1e3),
      (this.alwaysFormat = void 0 !== _ && _),
      this.resetRegExp());
  }
  reset() {
    this.options && this.init(this.options);
  }
  resetRegExp() {
    const e = (e, t) => (e?.source === t ? ((e.lastIndex = 0), e) : new RegExp(t, "g"));
    ((this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`)),
      (this.regexpUnescape = e(
        this.regexpUnescape,
        `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`,
      )),
      (this.nestingRegexp = e(
        this.nestingRegexp,
        `${this.nestingPrefix}(.+?)${this.nestingSuffix}`,
      )));
  }
  interpolate(e, t, n, i) {
    let r, o, s;
    const a =
        (this.options &&
          this.options.interpolation &&
          this.options.interpolation.defaultVariables) ||
        {},
      l = (e) => {
        if (e.indexOf(this.formatSeparator) < 0) {
          const r = XN(t, a, e, this.options.keySeparator, this.options.ignoreJSONStructure);
          return this.alwaysFormat
            ? this.format(r, void 0, n, { ...i, ...t, interpolationkey: e })
            : r;
        }
        const r = e.split(this.formatSeparator),
          o = r.shift().trim(),
          s = r.join(this.formatSeparator).trim();
        return this.format(
          XN(t, a, o, this.options.keySeparator, this.options.ignoreJSONStructure),
          s,
          n,
          { ...i, ...t, interpolationkey: o },
        );
      };
    this.resetRegExp();
    const c = i?.missingInterpolationHandler || this.options.missingInterpolationHandler,
      d =
        void 0 !== i?.interpolation?.skipOnVariables
          ? i.interpolation.skipOnVariables
          : this.options.interpolation.skipOnVariables;
    return (
      [
        { regex: this.regexpUnescape, safeValue: (e) => QN(e) },
        { regex: this.regexp, safeValue: (e) => (this.escapeValue ? QN(this.escape(e)) : QN(e)) },
      ].forEach((t) => {
        for (s = 0; (r = t.regex.exec(e)); ) {
          const n = r[1].trim();
          if (((o = l(n)), void 0 === o))
            if ("function" == typeof c) {
              const t = c(e, r, i);
              o = wN(t) ? t : "";
            } else if (i && Object.prototype.hasOwnProperty.call(i, n)) o = "";
            else {
              if (d) {
                o = r[0];
                continue;
              }
              (this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),
                (o = ""));
            }
          else wN(o) || this.useRawValueToEscape || (o = SN(o));
          const a = t.safeValue(o);
          if (
            ((e = e.replace(r[0], a)),
            d
              ? ((t.regex.lastIndex += o.length), (t.regex.lastIndex -= r[0].length))
              : (t.regex.lastIndex = 0),
            s++,
            s >= this.maxReplaces)
          )
            break;
        }
      }),
      e
    );
  }
  nest(e, t) {
    let n,
      i,
      r,
      o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
    const s = (e, t) => {
      const n = this.nestingOptionsSeparator;
      if (e.indexOf(n) < 0) return e;
      const i = e.split(new RegExp(`${n}[ ]*{`));
      let o = `{${i[1]}`;
      ((e = i[0]), (o = this.interpolate(o, r)));
      const s = o.match(/'/g),
        a = o.match(/"/g);
      (((s?.length ?? 0) % 2 == 0 && !a) || a.length % 2 != 0) && (o = o.replace(/'/g, '"'));
      try {
        ((r = JSON.parse(o)), t && (r = { ...t, ...r }));
      } catch (spt) {
        return (
          this.logger.warn(`failed parsing options string in nesting for key ${e}`, spt),
          `${e}${n}${o}`
        );
      }
      return (
        r.defaultValue && r.defaultValue.indexOf(this.prefix) > -1 && delete r.defaultValue,
        e
      );
    };
    for (; (n = this.nestingRegexp.exec(e)); ) {
      let a = [];
      ((r = { ...o }),
        (r = r.replace && !wN(r.replace) ? r.replace : r),
        (r.applyPostProcessor = !1),
        delete r.defaultValue);
      let l = !1;
      if (-1 !== n[0].indexOf(this.formatSeparator) && !/{.*}/.test(n[1])) {
        const e = n[1].split(this.formatSeparator).map((e) => e.trim());
        ((n[1] = e.shift()), (a = e), (l = !0));
      }
      if (((i = t(s.call(this, n[1].trim(), r), r)), i && n[0] === e && !wN(i))) return i;
      (wN(i) || (i = SN(i)),
        i || (this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`), (i = "")),
        l &&
          (i = a.reduce(
            (e, t) => this.format(e, t, o.lng, { ...o, interpolationkey: n[1].trim() }),
            i.trim(),
          )),
        (e = e.replace(n[0], i)),
        (this.regexp.lastIndex = 0));
    }
    return e;
  }
}
const eL = (e) => {
  const t = {};
  return (n, i, r) => {
    let o = r;
    r &&
      r.interpolationkey &&
      r.formatParams &&
      r.formatParams[r.interpolationkey] &&
      r[r.interpolationkey] &&
      (o = { ...o, [r.interpolationkey]: void 0 });
    const s = i + JSON.stringify(o);
    let a = t[s];
    return (a || ((a = e(FN(i), r)), (t[s] = a)), a(n));
  };
};
class tL {
  constructor() {
    let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    ((this.logger = VN.create("formatter")),
      (this.options = e),
      (this.formats = {
        number: eL((e, t) => {
          const n = new Intl.NumberFormat(e, { ...t });
          return (e) => n.format(e);
        }),
        currency: eL((e, t) => {
          const n = new Intl.NumberFormat(e, { ...t, style: "currency" });
          return (e) => n.format(e);
        }),
        datetime: eL((e, t) => {
          const n = new Intl.DateTimeFormat(e, { ...t });
          return (e) => n.format(e);
        }),
        relativetime: eL((e, t) => {
          const n = new Intl.RelativeTimeFormat(e, { ...t });
          return (e) => n.format(e, t.range || "day");
        }),
        list: eL((e, t) => {
          const n = new Intl.ListFormat(e, { ...t });
          return (e) => n.format(e);
        }),
      }),
      this.init(e));
  }
  init(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} };
    this.formatSeparator = t.interpolation.formatSeparator || ",";
  }
  add(e, t) {
    this.formats[e.toLowerCase().trim()] = t;
  }
  addCached(e, t) {
    this.formats[e.toLowerCase().trim()] = eL(t);
  }
  format(e, t, n) {
    let i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    const r = t.split(this.formatSeparator);
    if (
      r.length > 1 &&
      r[0].indexOf("(") > 1 &&
      r[0].indexOf(")") < 0 &&
      r.find((e) => e.indexOf(")") > -1)
    ) {
      const e = r.findIndex((e) => e.indexOf(")") > -1);
      r[0] = [r[0], ...r.splice(1, e)].join(this.formatSeparator);
    }
    const o = r.reduce((e, t) => {
      const { formatName: r, formatOptions: o } = ((e) => {
        let t = e.toLowerCase().trim();
        const n = {};
        if (e.indexOf("(") > -1) {
          const i = e.split("(");
          t = i[0].toLowerCase().trim();
          const r = i[1].substring(0, i[1].length - 1);
          "currency" === t && r.indexOf(":") < 0
            ? n.currency || (n.currency = r.trim())
            : "relativetime" === t && r.indexOf(":") < 0
              ? n.range || (n.range = r.trim())
              : r.split(";").forEach((e) => {
                  if (e) {
                    const [t, ...i] = e.split(":"),
                      r = i
                        .join(":")
                        .trim()
                        .replace(/^'+|'+$/g, ""),
                      o = t.trim();
                    (n[o] || (n[o] = r),
                      "false" === r && (n[o] = !1),
                      "true" === r && (n[o] = !0),
                      isNaN(r) || (n[o] = parseInt(r, 10)));
                  }
                });
        }
        return { formatName: t, formatOptions: n };
      })(t);
      if (this.formats[r]) {
        let t = e;
        try {
          const s = i?.formatParams?.[i.interpolationkey] || {},
            a = s.locale || s.lng || i.locale || i.lng || n;
          t = this.formats[r](e, a, { ...o, ...i, ...s });
        } catch (D2t) {
          this.logger.warn(D2t);
        }
        return t;
      }
      return (this.logger.warn(`there was no format function for ${r}`), e);
    }, e);
    return o;
  }
}
class nL extends WN {
  constructor(e, t, n) {
    let i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    (super(),
      (this.backend = e),
      (this.store = t),
      (this.services = n),
      (this.languageUtils = n.languageUtils),
      (this.options = i),
      (this.logger = VN.create("backendConnector")),
      (this.waitingReads = []),
      (this.maxParallelReads = i.maxParallelReads || 10),
      (this.readingCalls = 0),
      (this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5),
      (this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350),
      (this.state = {}),
      (this.queue = []),
      this.backend?.init?.(n, i.backend, i));
  }
  queueLoad(e, t, n, i) {
    const r = {},
      o = {},
      s = {},
      a = {};
    return (
      e.forEach((e) => {
        let i = !0;
        (t.forEach((t) => {
          const s = `${e}|${t}`;
          !n.reload && this.store.hasResourceBundle(e, t)
            ? (this.state[s] = 2)
            : this.state[s] < 0 ||
              (1 === this.state[s]
                ? void 0 === o[s] && (o[s] = !0)
                : ((this.state[s] = 1),
                  (i = !1),
                  void 0 === o[s] && (o[s] = !0),
                  void 0 === r[s] && (r[s] = !0),
                  void 0 === a[t] && (a[t] = !0)));
        }),
          i || (s[e] = !0));
      }),
      (Object.keys(r).length || Object.keys(o).length) &&
        this.queue.push({
          pending: o,
          pendingCount: Object.keys(o).length,
          loaded: {},
          errors: [],
          callback: i,
        }),
      {
        toLoad: Object.keys(r),
        pending: Object.keys(o),
        toLoadLanguages: Object.keys(s),
        toLoadNamespaces: Object.keys(a),
      }
    );
  }
  loaded(e, t, n) {
    const i = e.split("|"),
      r = i[0],
      o = i[1];
    (t && this.emit("failedLoading", r, o, t),
      !t && n && this.store.addResourceBundle(r, o, n, void 0, void 0, { skipCopy: !0 }),
      (this.state[e] = t ? -1 : 2),
      t && n && (this.state[e] = 0));
    const s = {};
    (this.queue.forEach((n) => {
      (((e, t, n) => {
        const { obj: i, k: r } = LN(e, t, Object);
        ((i[r] = i[r] || []), i[r].push(n));
      })(n.loaded, [r], o),
        ((e, t) => {
          void 0 !== e.pending[t] && (delete e.pending[t], e.pendingCount--);
        })(n, e),
        t && n.errors.push(t),
        0 !== n.pendingCount ||
          n.done ||
          (Object.keys(n.loaded).forEach((e) => {
            s[e] || (s[e] = {});
            const t = n.loaded[e];
            t.length &&
              t.forEach((t) => {
                void 0 === s[e][t] && (s[e][t] = !0);
              });
          }),
          (n.done = !0),
          n.errors.length ? n.callback(n.errors) : n.callback()));
    }),
      this.emit("loaded", s),
      (this.queue = this.queue.filter((e) => !e.done)));
  }
  read(e, t, n) {
    let i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0,
      r = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : this.retryTimeout,
      o = arguments.length > 5 ? arguments[5] : void 0;
    if (!e.length) return o(null, {});
    if (this.readingCalls >= this.maxParallelReads)
      return void this.waitingReads.push({
        lng: e,
        ns: t,
        fcName: n,
        tried: i,
        wait: r,
        callback: o,
      });
    this.readingCalls++;
    const s = (s, a) => {
        if ((this.readingCalls--, this.waitingReads.length > 0)) {
          const e = this.waitingReads.shift();
          this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
        }
        s && a && i < this.maxRetries
          ? setTimeout(() => {
              this.read.call(this, e, t, n, i + 1, 2 * r, o);
            }, r)
          : o(s, a);
      },
      a = this.backend[n].bind(this.backend);
    if (2 !== a.length) return a(e, t, s);
    try {
      const n = a(e, t);
      n && "function" == typeof n.then ? n.then((e) => s(null, e)).catch(s) : s(null, n);
    } catch (l) {
      s(l);
    }
  }
  prepareLoading(e, t) {
    let n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
      i = arguments.length > 3 ? arguments[3] : void 0;
    if (!this.backend)
      return (
        this.logger.warn("No backend was added via i18next.use. Will not load resources."),
        i && i()
      );
    (wN(e) && (e = this.languageUtils.toResolveHierarchy(e)), wN(t) && (t = [t]));
    const r = this.queueLoad(e, t, n, i);
    if (!r.toLoad.length) return (r.pending.length || i(), null);
    r.toLoad.forEach((e) => {
      this.loadOne(e);
    });
  }
  load(e, t, n) {
    this.prepareLoading(e, t, {}, n);
  }
  reload(e, t, n) {
    this.prepareLoading(e, t, { reload: !0 }, n);
  }
  loadOne(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "";
    const n = e.split("|"),
      i = n[0],
      r = n[1];
    this.read(i, r, "read", void 0, void 0, (n, o) => {
      (n && this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`, n),
        !n && o && this.logger.log(`${t}loaded namespace ${r} for language ${i}`, o),
        this.loaded(e, n, o));
    });
  }
  saveMissing(e, t, n, i, r) {
    let o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {},
      s = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : () => {};
    if (!this.services?.utils?.hasLoadedNamespace || this.services?.utils?.hasLoadedNamespace(t)) {
      if (null != n && "" !== n) {
        if (this.backend?.create) {
          const l = { ...o, isUpdate: r },
            c = this.backend.create.bind(this.backend);
          if (c.length < 6)
            try {
              let r;
              ((r = 5 === c.length ? c(e, t, n, i, l) : c(e, t, n, i)),
                r && "function" == typeof r.then ? r.then((e) => s(null, e)).catch(s) : s(null, r));
            } catch (a) {
              s(a);
            }
          else c(e, t, n, i, s, l);
        }
        e && e[0] && this.store.addResource(e[0], t, n, i);
      }
    } else
      this.logger.warn(
        `did not save key "${n}" as the namespace "${t}" was not yet loaded`,
        "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!",
      );
  }
}
const iL = () => ({
    debug: !1,
    initAsync: !0,
    ns: ["translation"],
    defaultNS: ["translation"],
    fallbackLng: ["dev"],
    fallbackNS: !1,
    supportedLngs: !1,
    nonExplicitSupportedLngs: !1,
    load: "all",
    preload: !1,
    simplifyPluralSuffix: !0,
    keySeparator: ".",
    nsSeparator: ":",
    pluralSeparator: "_",
    contextSeparator: "_",
    partialBundledLanguages: !1,
    saveMissing: !1,
    updateMissing: !1,
    saveMissingTo: "fallback",
    saveMissingPlurals: !0,
    missingKeyHandler: !1,
    missingInterpolationHandler: !1,
    postProcess: !1,
    postProcessPassResolved: !1,
    returnNull: !1,
    returnEmptyString: !0,
    returnObjects: !1,
    joinArrays: !1,
    returnedObjectHandler: !1,
    parseMissingKeyHandler: !1,
    appendNamespaceToMissingKey: !1,
    appendNamespaceToCIMode: !1,
    overloadTranslationOptionHandler: (e) => {
      let t = {};
      if (
        ("object" == typeof e[1] && (t = e[1]),
        wN(e[1]) && (t.defaultValue = e[1]),
        wN(e[2]) && (t.tDescription = e[2]),
        "object" == typeof e[2] || "object" == typeof e[3])
      ) {
        const n = e[3] || e[2];
        Object.keys(n).forEach((e) => {
          t[e] = n[e];
        });
      }
      return t;
    },
    interpolation: {
      escapeValue: !0,
      format: (e) => e,
      prefix: "{{",
      suffix: "}}",
      formatSeparator: ",",
      unescapePrefix: "-",
      nestingPrefix: "$t(",
      nestingSuffix: ")",
      nestingOptionsSeparator: ",",
      maxReplaces: 1e3,
      skipOnVariables: !0,
    },
  }),
  rL = (e) => (
    wN(e.ns) && (e.ns = [e.ns]),
    wN(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]),
    wN(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]),
    e.supportedLngs?.indexOf?.("cimode") < 0 &&
      (e.supportedLngs = e.supportedLngs.concat(["cimode"])),
    "boolean" == typeof e.initImmediate && (e.initAsync = e.initImmediate),
    e
  ),
  oL = () => {};
let sL = class e extends WN {
  constructor() {
    let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
      t = arguments.length > 1 ? arguments[1] : void 0;
    var n;
    if (
      (super(),
      (this.options = rL(e)),
      (this.services = {}),
      (this.logger = VN),
      (this.modules = { external: [] }),
      (n = this),
      Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e) => {
        "function" == typeof n[e] && (n[e] = n[e].bind(n));
      }),
      t && !this.isInitialized && !e.isClone)
    ) {
      if (!this.options.initAsync) return (this.init(e, t), this);
      setTimeout(() => {
        this.init(e, t);
      }, 0);
    }
  }
  init() {
    var e = this;
    let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
      n = arguments.length > 1 ? arguments[1] : void 0;
    ((this.isInitializing = !0),
      "function" == typeof t && ((n = t), (t = {})),
      null == t.defaultNS &&
        t.ns &&
        (wN(t.ns)
          ? (t.defaultNS = t.ns)
          : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0])));
    const i = iL();
    ((this.options = { ...i, ...this.options, ...rL(t) }),
      (this.options.interpolation = { ...i.interpolation, ...this.options.interpolation }),
      void 0 !== t.keySeparator && (this.options.userDefinedKeySeparator = t.keySeparator),
      void 0 !== t.nsSeparator && (this.options.userDefinedNsSeparator = t.nsSeparator));
    const r = (e) => (e ? ("function" == typeof e ? new e() : e) : null);
    if (!this.options.isClone) {
      let t;
      (this.modules.logger
        ? VN.init(r(this.modules.logger), this.options)
        : VN.init(null, this.options),
        (t = this.modules.formatter ? this.modules.formatter : tL));
      const n = new KN(this.options);
      this.store = new HN(this.options.resources, this.options);
      const o = this.services;
      ((o.logger = VN),
        (o.resourceStore = this.store),
        (o.languageUtils = n),
        (o.pluralResolver = new YN(n, {
          prepend: this.options.pluralSeparator,
          simplifyPluralSuffix: this.options.simplifyPluralSuffix,
        })),
        !t ||
          (this.options.interpolation.format &&
            this.options.interpolation.format !== i.interpolation.format) ||
          ((o.formatter = r(t)),
          o.formatter.init(o, this.options),
          (this.options.interpolation.format = o.formatter.format.bind(o.formatter))),
        (o.interpolator = new JN(this.options)),
        (o.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }),
        (o.backendConnector = new nL(r(this.modules.backend), o.resourceStore, o, this.options)),
        o.backendConnector.on("*", function (t) {
          for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++)
            i[r - 1] = arguments[r];
          e.emit(t, ...i);
        }),
        this.modules.languageDetector &&
          ((o.languageDetector = r(this.modules.languageDetector)),
          o.languageDetector.init &&
            o.languageDetector.init(o, this.options.detection, this.options)),
        this.modules.i18nFormat &&
          ((o.i18nFormat = r(this.modules.i18nFormat)),
          o.i18nFormat.init && o.i18nFormat.init(this)),
        (this.translator = new qN(this.services, this.options)),
        this.translator.on("*", function (t) {
          for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++)
            i[r - 1] = arguments[r];
          e.emit(t, ...i);
        }),
        this.modules.external.forEach((e) => {
          e.init && e.init(this);
        }));
    }
    if (
      ((this.format = this.options.interpolation.format),
      n || (n = oL),
      this.options.fallbackLng && !this.services.languageDetector && !this.options.lng)
    ) {
      const e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
      e.length > 0 && "dev" !== e[0] && (this.options.lng = e[0]);
    }
    this.services.languageDetector ||
      this.options.lng ||
      this.logger.warn("init: no languageDetector is used and no lng is defined");
    ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((t) => {
      this[t] = function () {
        return e.store[t](...arguments);
      };
    });
    ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((t) => {
      this[t] = function () {
        return (e.store[t](...arguments), e);
      };
    });
    const o = CN(),
      s = () => {
        const e = (e, t) => {
          ((this.isInitializing = !1),
            this.isInitialized &&
              !this.initializedStoreOnce &&
              this.logger.warn(
                "init: i18next is already initialized. You should call init just once!",
              ),
            (this.isInitialized = !0),
            this.options.isClone || this.logger.log("initialized", this.options),
            this.emit("initialized", this.options),
            o.resolve(t),
            n(e, t));
        };
        if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
        this.changeLanguage(this.options.lng, e);
      };
    return (this.options.resources || !this.options.initAsync ? s() : setTimeout(s, 0), o);
  }
  loadResources(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : oL;
    const n = wN(e) ? e : this.language;
    if (
      ("function" == typeof e && (t = e),
      !this.options.resources || this.options.partialBundledLanguages)
    ) {
      if (
        "cimode" === n?.toLowerCase() &&
        (!this.options.preload || 0 === this.options.preload.length)
      )
        return t();
      const e = [],
        i = (t) => {
          if (!t) return;
          if ("cimode" === t) return;
          this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
            "cimode" !== t && e.indexOf(t) < 0 && e.push(t);
          });
        };
      if (n) i(n);
      else {
        this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e) => i(e));
      }
      (this.options.preload?.forEach?.((e) => i(e)),
        this.services.backendConnector.load(e, this.options.ns, (e) => {
          (e || this.resolvedLanguage || !this.language || this.setResolvedLanguage(this.language),
            t(e));
        }));
    } else t(null);
  }
  reloadResources(e, t, n) {
    const i = CN();
    return (
      "function" == typeof e && ((n = e), (e = void 0)),
      "function" == typeof t && ((n = t), (t = void 0)),
      e || (e = this.languages),
      t || (t = this.options.ns),
      n || (n = oL),
      this.services.backendConnector.reload(e, t, (e) => {
        (i.resolve(), n(e));
      }),
      i
    );
  }
  use(e) {
    if (!e)
      throw new Error(
        "You are passing an undefined module! Please check the object you are passing to i18next.use()",
      );
    if (!e.type)
      throw new Error(
        "You are passing a wrong module! Please check the object you are passing to i18next.use()",
      );
    return (
      "backend" === e.type && (this.modules.backend = e),
      ("logger" === e.type || (e.log && e.warn && e.error)) && (this.modules.logger = e),
      "languageDetector" === e.type && (this.modules.languageDetector = e),
      "i18nFormat" === e.type && (this.modules.i18nFormat = e),
      "postProcessor" === e.type && zN.addPostProcessor(e),
      "formatter" === e.type && (this.modules.formatter = e),
      "3rdParty" === e.type && this.modules.external.push(e),
      this
    );
  }
  setResolvedLanguage(e) {
    if (e && this.languages && !(["cimode", "dev"].indexOf(e) > -1))
      for (let t = 0; t < this.languages.length; t++) {
        const e = this.languages[t];
        if (!(["cimode", "dev"].indexOf(e) > -1) && this.store.hasLanguageSomeTranslations(e)) {
          this.resolvedLanguage = e;
          break;
        }
      }
  }
  changeLanguage(e, t) {
    var n = this;
    this.isLanguageChangingTo = e;
    const i = CN();
    this.emit("languageChanging", e);
    const r = (e) => {
        ((this.language = e),
          (this.languages = this.services.languageUtils.toResolveHierarchy(e)),
          (this.resolvedLanguage = void 0),
          this.setResolvedLanguage(e));
      },
      o = (e, o) => {
        (o
          ? (r(o),
            this.translator.changeLanguage(o),
            (this.isLanguageChangingTo = void 0),
            this.emit("languageChanged", o),
            this.logger.log("languageChanged", o))
          : (this.isLanguageChangingTo = void 0),
          i.resolve(function () {
            return n.t(...arguments);
          }),
          t &&
            t(e, function () {
              return n.t(...arguments);
            }));
      },
      s = (t) => {
        e || t || !this.services.languageDetector || (t = []);
        const n = wN(t) ? t : this.services.languageUtils.getBestMatchFromCodes(t);
        (n &&
          (this.language || r(n),
          this.translator.language || this.translator.changeLanguage(n),
          this.services.languageDetector?.cacheUserLanguage?.(n)),
          this.loadResources(n, (e) => {
            o(e, n);
          }));
      };
    return (
      e || !this.services.languageDetector || this.services.languageDetector.async
        ? !e && this.services.languageDetector && this.services.languageDetector.async
          ? 0 === this.services.languageDetector.detect.length
            ? this.services.languageDetector.detect().then(s)
            : this.services.languageDetector.detect(s)
          : s(e)
        : s(this.services.languageDetector.detect()),
      i
    );
  }
  getFixedT(e, t, n) {
    var i = this;
    const r = function (e, t) {
      let o;
      if ("object" != typeof t) {
        for (var s = arguments.length, a = new Array(s > 2 ? s - 2 : 0), l = 2; l < s; l++)
          a[l - 2] = arguments[l];
        o = i.options.overloadTranslationOptionHandler([e, t].concat(a));
      } else o = { ...t };
      ((o.lng = o.lng || r.lng),
        (o.lngs = o.lngs || r.lngs),
        (o.ns = o.ns || r.ns),
        "" !== o.keyPrefix && (o.keyPrefix = o.keyPrefix || n || r.keyPrefix));
      const c = i.options.keySeparator || ".";
      let d;
      return (
        (d =
          o.keyPrefix && Array.isArray(e)
            ? e.map((e) => `${o.keyPrefix}${c}${e}`)
            : o.keyPrefix
              ? `${o.keyPrefix}${c}${e}`
              : e),
        i.t(d, o)
      );
    };
    return (wN(e) ? (r.lng = e) : (r.lngs = e), (r.ns = t), (r.keyPrefix = n), r);
  }
  t() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
    return this.translator?.translate(...t);
  }
  exists() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
    return this.translator?.exists(...t);
  }
  setDefaultNamespace(e) {
    this.options.defaultNS = e;
  }
  hasLoadedNamespace(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    if (!this.isInitialized)
      return (
        this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages),
        !1
      );
    if (!this.languages || !this.languages.length)
      return (
        this.logger.warn(
          "hasLoadedNamespace: i18n.languages were undefined or empty",
          this.languages,
        ),
        !1
      );
    const n = t.lng || this.resolvedLanguage || this.languages[0],
      i = !!this.options && this.options.fallbackLng,
      r = this.languages[this.languages.length - 1];
    if ("cimode" === n.toLowerCase()) return !0;
    const o = (e, t) => {
      const n = this.services.backendConnector.state[`${e}|${t}`];
      return -1 === n || 0 === n || 2 === n;
    };
    if (t.precheck) {
      const e = t.precheck(this, o);
      if (void 0 !== e) return e;
    }
    return (
      !!this.hasResourceBundle(n, e) ||
      !(
        this.services.backendConnector.backend &&
        (!this.options.resources || this.options.partialBundledLanguages)
      ) ||
      !(!o(n, e) || (i && !o(r, e)))
    );
  }
  loadNamespaces(e, t) {
    const n = CN();
    return this.options.ns
      ? (wN(e) && (e = [e]),
        e.forEach((e) => {
          this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
        }),
        this.loadResources((e) => {
          (n.resolve(), t && t(e));
        }),
        n)
      : (t && t(), Promise.resolve());
  }
  loadLanguages(e, t) {
    const n = CN();
    wN(e) && (e = [e]);
    const i = this.options.preload || [],
      r = e.filter((e) => i.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
    return r.length
      ? ((this.options.preload = i.concat(r)),
        this.loadResources((e) => {
          (n.resolve(), t && t(e));
        }),
        n)
      : (t && t(), Promise.resolve());
  }
  dir(e) {
    if (
      (e ||
        (e =
          this.resolvedLanguage ||
          (this.languages?.length > 0 ? this.languages[0] : this.language)),
      !e)
    )
      return "rtl";
    const t = this.services?.languageUtils || new KN(iL());
    return [
      "ar",
      "shu",
      "sqr",
      "ssh",
      "xaa",
      "yhd",
      "yud",
      "aao",
      "abh",
      "abv",
      "acm",
      "acq",
      "acw",
      "acx",
      "acy",
      "adf",
      "ads",
      "aeb",
      "aec",
      "afb",
      "ajp",
      "apc",
      "apd",
      "arb",
      "arq",
      "ars",
      "ary",
      "arz",
      "auz",
      "avl",
      "ayh",
      "ayl",
      "ayn",
      "ayp",
      "bbz",
      "pga",
      "he",
      "iw",
      "ps",
      "pbt",
      "pbu",
      "pst",
      "prp",
      "prd",
      "ug",
      "ur",
      "ydd",
      "yds",
      "yih",
      "ji",
      "yi",
      "hbo",
      "men",
      "xmn",
      "fa",
      "jpr",
      "peo",
      "pes",
      "prs",
      "dv",
      "sam",
      "ckb",
    ].indexOf(t.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1
      ? "rtl"
      : "ltr";
  }
  static createInstance() {
    return new e(
      arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
      arguments.length > 1 ? arguments[1] : void 0,
    );
  }
  cloneInstance() {
    let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
      n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : oL;
    const i = t.forkResourceStore;
    i && delete t.forkResourceStore;
    const r = { ...this.options, ...t, isClone: !0 },
      o = new e(r);
    (void 0 === t.debug && void 0 === t.prefix) || (o.logger = o.logger.clone(t));
    if (
      (["store", "services", "language"].forEach((e) => {
        o[e] = this[e];
      }),
      (o.services = { ...this.services }),
      (o.services.utils = { hasLoadedNamespace: o.hasLoadedNamespace.bind(o) }),
      i)
    ) {
      const e = Object.keys(this.store.data).reduce(
        (e, t) => (
          (e[t] = { ...this.store.data[t] }),
          Object.keys(e[t]).reduce((n, i) => ((n[i] = { ...e[t][i] }), n), {})
        ),
        {},
      );
      ((o.store = new HN(e, r)), (o.services.resourceStore = o.store));
    }
    return (
      (o.translator = new qN(o.services, r)),
      o.translator.on("*", function (e) {
        for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
          n[i - 1] = arguments[i];
        o.emit(e, ...n);
      }),
      o.init(r, n),
      (o.translator.options = r),
      (o.translator.backendConnector.services.utils = {
        hasLoadedNamespace: o.hasLoadedNamespace.bind(o),
      }),
      o
    );
  }
  toJSON() {
    return {
      options: this.options,
      store: this.store,
      language: this.language,
      languages: this.languages,
      resolvedLanguage: this.resolvedLanguage,
    };
  }
};
const aL = sL.createInstance();
((aL.createInstance = sL.createInstance),
  aL.createInstance,
  aL.dir,
  aL.init,
  aL.loadResources,
  aL.reloadResources,
  aL.use,
  aL.changeLanguage,
  aL.getFixedT,
  aL.t,
  aL.exists,
  aL.setDefaultNamespace,
  aL.hasLoadedNamespace,
  aL.loadNamespaces,
  aL.loadLanguages);
const { slice: lL, forEach: cL } = [];
const dL = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,
  uL = {
    create(e, t, n, i) {
      let r =
        arguments.length > 4 && void 0 !== arguments[4]
          ? arguments[4]
          : { path: "/", sameSite: "strict" };
      (n && ((r.expires = new Date()), r.expires.setTime(r.expires.getTime() + 60 * n * 1e3)),
        i && (r.domain = i),
        (document.cookie = (function (e, t) {
          const n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { path: "/" };
          let i = `${e}=${encodeURIComponent(t)}`;
          if (n.maxAge > 0) {
            const e = n.maxAge - 0;
            if (Number.isNaN(e)) throw new Error("maxAge should be a Number");
            i += `; Max-Age=${Math.floor(e)}`;
          }
          if (n.domain) {
            if (!dL.test(n.domain)) throw new TypeError("option domain is invalid");
            i += `; Domain=${n.domain}`;
          }
          if (n.path) {
            if (!dL.test(n.path)) throw new TypeError("option path is invalid");
            i += `; Path=${n.path}`;
          }
          if (n.expires) {
            if ("function" != typeof n.expires.toUTCString)
              throw new TypeError("option expires is invalid");
            i += `; Expires=${n.expires.toUTCString()}`;
          }
          if ((n.httpOnly && (i += "; HttpOnly"), n.secure && (i += "; Secure"), n.sameSite))
            switch ("string" == typeof n.sameSite ? n.sameSite.toLowerCase() : n.sameSite) {
              case !0:
                i += "; SameSite=Strict";
                break;
              case "lax":
                i += "; SameSite=Lax";
                break;
              case "strict":
                i += "; SameSite=Strict";
                break;
              case "none":
                i += "; SameSite=None";
                break;
              default:
                throw new TypeError("option sameSite is invalid");
            }
          return (n.partitioned && (i += "; Partitioned"), i);
        })(e, t, r)));
    },
    read(e) {
      const t = `${e}=`,
        n = document.cookie.split(";");
      for (let i = 0; i < n.length; i++) {
        let e = n[i];
        for (; " " === e.charAt(0); ) e = e.substring(1, e.length);
        if (0 === e.indexOf(t)) return e.substring(t.length, e.length);
      }
      return null;
    },
    remove(e, t) {
      this.create(e, "", -1, t);
    },
  };
var hL = {
    name: "cookie",
    lookup(e) {
      let { lookupCookie: t } = e;
      if (t && "undefined" != typeof document) return uL.read(t) || void 0;
    },
    cacheUserLanguage(e, t) {
      let { lookupCookie: n, cookieMinutes: i, cookieDomain: r, cookieOptions: o } = t;
      n && "undefined" != typeof document && uL.create(n, e, i, r, o);
    },
  },
  gL = {
    name: "querystring",
    lookup(e) {
      let t,
        { lookupQuerystring: n } = e;
      if ("undefined" != typeof window) {
        let { search: e } = window.location;
        !window.location.search &&
          window.location.hash?.indexOf("?") > -1 &&
          (e = window.location.hash.substring(window.location.hash.indexOf("?")));
        const i = e.substring(1).split("&");
        for (let r = 0; r < i.length; r++) {
          const e = i[r].indexOf("=");
          if (e > 0) {
            i[r].substring(0, e) === n && (t = i[r].substring(e + 1));
          }
        }
      }
      return t;
    },
  },
  pL = {
    name: "hash",
    lookup(e) {
      let t,
        { lookupHash: n, lookupFromHashIndex: i } = e;
      if ("undefined" != typeof window) {
        const { hash: e } = window.location;
        if (e && e.length > 2) {
          const r = e.substring(1);
          if (n) {
            const e = r.split("&");
            for (let i = 0; i < e.length; i++) {
              const r = e[i].indexOf("=");
              if (r > 0) {
                e[i].substring(0, r) === n && (t = e[i].substring(r + 1));
              }
            }
          }
          if (t) return t;
          if (!t && i > -1) {
            const t = e.match(/\/([a-zA-Z-]*)/g);
            if (!Array.isArray(t)) return;
            const n = "number" == typeof i ? i : 0;
            return t[n]?.replace("/", "");
          }
        }
      }
      return t;
    },
  };
let fL = null;
const mL = () => {
  if (null !== fL) return fL;
  try {
    if (((fL = "undefined" != typeof window && null !== window.localStorage), !fL)) return !1;
    const e = "i18next.translate.boo";
    (window.localStorage.setItem(e, "foo"), window.localStorage.removeItem(e));
  } catch (spt) {
    fL = !1;
  }
  return fL;
};
var _L = {
  name: "localStorage",
  lookup(e) {
    let { lookupLocalStorage: t } = e;
    if (t && mL()) return window.localStorage.getItem(t) || void 0;
  },
  cacheUserLanguage(e, t) {
    let { lookupLocalStorage: n } = t;
    n && mL() && window.localStorage.setItem(n, e);
  },
};
let vL = null;
const bL = () => {
  if (null !== vL) return vL;
  try {
    if (((vL = "undefined" != typeof window && null !== window.sessionStorage), !vL)) return !1;
    const e = "i18next.translate.boo";
    (window.sessionStorage.setItem(e, "foo"), window.sessionStorage.removeItem(e));
  } catch (spt) {
    vL = !1;
  }
  return vL;
};
var yL = {
    name: "sessionStorage",
    lookup(e) {
      let { lookupSessionStorage: t } = e;
      if (t && bL()) return window.sessionStorage.getItem(t) || void 0;
    },
    cacheUserLanguage(e, t) {
      let { lookupSessionStorage: n } = t;
      n && bL() && window.sessionStorage.setItem(n, e);
    },
  },
  xL = {
    name: "navigator",
    lookup(e) {
      const t = [];
      if ("undefined" != typeof navigator) {
        const { languages: e, userLanguage: n, language: i } = navigator;
        if (e) for (let r = 0; r < e.length; r++) t.push(e[r]);
        (n && t.push(n), i && t.push(i));
      }
      return t.length > 0 ? t : void 0;
    },
  },
  wL = {
    name: "htmlTag",
    lookup(e) {
      let t,
        { htmlTag: n } = e;
      const i = n || ("undefined" != typeof document ? document.documentElement : null);
      return (i && "function" == typeof i.getAttribute && (t = i.getAttribute("lang")), t);
    },
  },
  CL = {
    name: "path",
    lookup(e) {
      let { lookupFromPathIndex: t } = e;
      if ("undefined" == typeof window) return;
      const n = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
      if (!Array.isArray(n)) return;
      const i = "number" == typeof t ? t : 0;
      return n[i]?.replace("/", "");
    },
  },
  SL = {
    name: "subdomain",
    lookup(e) {
      let { lookupFromSubdomainIndex: t } = e;
      const n = "number" == typeof t ? t + 1 : 1,
        i =
          "undefined" != typeof window &&
          window.location?.hostname?.match(
            /^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i,
          );
      if (i) return i[n];
    },
  };
let kL = !1;
try {
  (document.cookie, (kL = !0));
} catch (spt) {}
const EL = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
kL || EL.splice(1, 1);
class NL {
  constructor(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    ((this.type = "languageDetector"), (this.detectors = {}), this.init(e, t));
  }
  init() {
    let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { languageUtils: {} },
      t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
      n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
    ((this.services = e),
      (this.options = (function (e) {
        return (
          cL.call(lL.call(arguments, 1), (t) => {
            if (t) for (const n in t) void 0 === e[n] && (e[n] = t[n]);
          }),
          e
        );
      })(t, this.options || {}, {
        order: EL,
        lookupQuerystring: "lng",
        lookupCookie: "i18next",
        lookupLocalStorage: "i18nextLng",
        lookupSessionStorage: "i18nextLng",
        caches: ["localStorage"],
        excludeCacheFor: ["cimode"],
        convertDetectedLanguage: (e) => e,
      })),
      "string" == typeof this.options.convertDetectedLanguage &&
        this.options.convertDetectedLanguage.indexOf("15897") > -1 &&
        (this.options.convertDetectedLanguage = (e) => e.replace("-", "_")),
      this.options.lookupFromUrlIndex &&
        (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex),
      (this.i18nOptions = n),
      this.addDetector(hL),
      this.addDetector(gL),
      this.addDetector(_L),
      this.addDetector(yL),
      this.addDetector(xL),
      this.addDetector(wL),
      this.addDetector(CL),
      this.addDetector(SL),
      this.addDetector(pL));
  }
  addDetector(e) {
    return ((this.detectors[e.name] = e), this);
  }
  detect() {
    let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.options.order,
      t = [];
    return (
      e.forEach((e) => {
        if (this.detectors[e]) {
          let n = this.detectors[e].lookup(this.options);
          (n && "string" == typeof n && (n = [n]), n && (t = t.concat(n)));
        }
      }),
      (t = t
        .filter((e) => {
          return (
            null != e &&
            !(
              "string" == typeof (t = e) &&
              [
                /<\s*script.*?>/i,
                /<\s*\/\s*script\s*>/i,
                /<\s*img.*?on\w+\s*=/i,
                /<\s*\w+\s*on\w+\s*=.*?>/i,
                /javascript\s*:/i,
                /vbscript\s*:/i,
                /expression\s*\(/i,
                /eval\s*\(/i,
                /alert\s*\(/i,
                /document\.cookie/i,
                /document\.write\s*\(/i,
                /window\.location/i,
                /innerHTML/i,
              ].some((e) => e.test(t))
            )
          );
          var t;
        })
        .map((e) => this.options.convertDetectedLanguage(e))),
      this.services &&
      this.services.languageUtils &&
      this.services.languageUtils.getBestMatchFromCodes
        ? t
        : t.length > 0
          ? t[0]
          : null
    );
  }
  cacheUserLanguage(e) {
    let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.options.caches;
    t &&
      ((this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1) ||
        t.forEach((t) => {
          this.detectors[t] && this.detectors[t].cacheUserLanguage(e, this.options);
        }));
  }
}
((NL.type = "languageDetector"),
  aL
    .use(NL)
    .use(Ry)
    .init({
      resources: {
        "en-US": window.XBOARD_TRANSLATIONS?.["en-US"] || {},
        "zh-CN": window.XBOARD_TRANSLATIONS?.["zh-CN"] || {},
        "ko-KR": window.XBOARD_TRANSLATIONS?.["ko-KR"] || {},
        "ru-RU": window.XBOARD_TRANSLATIONS?.["ru-RU"] || {},
      },
      fallbackLng: "zh-CN",
      supportedLngs: ["en-US", "zh-CN", "ko-KR", "ru-RU"],
      detection: {
        order: ["querystring", "localStorage", "navigator"],
        lookupQuerystring: "lang",
        lookupLocalStorage: "i18nextLng",
        caches: ["localStorage"],
      },
      interpolation: { escapeValue: !1 },
    }));
const LL = [
  "/passport/auth/login",
  "/passport/auth/token2Login",
  "/passport/auth/register",
  "/guest/comm/config",
  "/passport/comm/sendEmailVerify",
  "/passport/auth/forget",
];
const DL = FE.create({
  baseURL: (function () {
    let e = window.settings?.base_url || "/";
    if (
      "undefined" != typeof window &&
      "https:" === window.location?.protocol &&
      "string" == typeof e &&
      e.startsWith("http://")
    ) {
      e = "/";
    }
    return e.endsWith("/") ? e + "api/v2" : e + "/api/v2";
  })(),
  timeout: 3e4,
  headers: { "Content-Type": "application/json" },
});
(DL.interceptors.request.use(
  (e) => {
    const t = Am();
    if (!LL.includes(e.url?.split("?")[0] || "")) {
      if (!t.value)
        return (xN(), Promise.reject({ code: -1, message: aL.t("common:http.notLoggedIn") }));
      e.headers.Authorization = t.value;
    }
    return ((e.headers["Content-Language"] = localStorage.getItem("i18nextLng") || "zh-CN"), e);
  },
  (e) => Promise.reject(e),
),
  DL.interceptors.response.use(
    (e) => e?.data || { code: -1, message: aL.t("common:http.unknownError") },
    (e) => {
      const t = e.response?.status,
        n = e.response?.data?.message;
      (401 !== t && 403 !== t) || xN();
      const i = {
        401: aL.t("common:http.loginExpired"),
        403: aL.t("common:http.noPermission"),
        404: aL.t("common:http.notFound"),
      };
      return (
        hN.error(n || i[t] || aL.t("common:http.unknownException")),
        Promise.reject(
          e.response?.data || { data: null, code: -1, message: aL.t("common:http.unknownError") },
        )
      );
    },
  ));
const TL = (e, t) => DL.get(e, t),
  IL = (e, t, n) => DL.post(e, t, n),
  RL = () => window?.settings?.secure_path ?? "",
  OL = RL(),
  ML = (e) => TL(OL + "/stat/getOrder", { params: e }),
  AL = () => TL(OL + "/stat/getStats"),
  PL = (e) => TL(OL + "/stat/getTrafficRank", { params: e }),
  jL = RL(),
  FL = () => TL(jL + "/theme/getThemes"),
  BL = (e) => IL(jL + "/theme/getThemeConfig", { name: e }),
  VL = (e, t) => IL(jL + "/theme/saveThemeConfig", { name: e, config: t }),
  WL = (e) => {
    const t = new FormData();
    return (
      t.append("file", e),
      IL(jL + "/theme/upload", t, { headers: { "Content-Type": "multipart/form-data" } })
    );
  },
  HL = (e) => IL(jL + "/theme/delete", { name: e }),
  zL = RL(),
  UL = () => TL(zL + "/server/manage/getNodes"),
  $L = (e) => IL(zL + "/server/manage/save", e),
  qL = (e) => IL(zL + "/server/manage/drop", e),
  KL = (e) => IL(zL + "/server/manage/batchDelete", e),
  GL = (e) => IL(zL + "/server/manage/copy", e),
  ZL = (e) => IL(zL + "/server/manage/update", e),
  YL = (e) => IL(zL + "/server/manage/sort", e),
  XL = (e) => IL(zL + "/server/manage/resetTraffic", e),
  QL = (e) => IL(zL + "/server/manage/batchResetTraffic", e),
  JL = RL(),
  eD = () => TL(JL + "/server/group/fetch"),
  tD = (e) => IL(JL + "/server/group/save", e),
  nD = (e) => IL(JL + "/server/group/drop", e),
  iD = RL(),
  rD = () => TL(iD + "/server/route/fetch"),
  oD = (e) => IL(iD + "/server/route/save", e),
  sD = (e) => IL(iD + "/server/route/drop", e),
  aD = RL(),
  lD = () => TL(aD + "/payment/fetch"),
  cD = () => TL(aD + "/payment/getPaymentMethods"),
  dD = (e) => IL(aD + "/payment/getPaymentForm", e),
  uD = (e) => IL(aD + "/payment/save", e),
  hD = (e) => IL(aD + "/payment/drop", e),
  gD = (e) => IL(aD + "/payment/show", e),
  pD = (e) => IL(aD + "/payment/sort", e),
  fD = RL(),
  mD = () => TL(`${fD}/notice/fetch`),
  _D = (e) => IL(`${fD}/notice/save`, e),
  vD = (e) => IL(`${fD}/notice/drop`, { id: e }),
  bD = (e) => IL(`${fD}/notice/show`, { id: e }),
  yD = (e) => IL(`${fD}/notice/sort`, { ids: e }),
  xD = RL(),
  wD = () => TL(xD + "/knowledge/fetch"),
  CD = (e) => TL(xD + "/knowledge/fetch?id=" + e),
  SD = (e) => IL(xD + "/knowledge/save", e),
  kD = (e) => IL(xD + "/knowledge/drop", e),
  ED = (e) => IL(xD + "/knowledge/show", e),
  ND = (e) => IL(xD + "/knowledge/sort", e),
  LD = RL(),
  DD = () => TL(LD + "/plan/fetch"),
  TD = (e) => IL(LD + "/plan/save", e),
  ID = (e) => IL(LD + "/plan/update", e),
  RD = (e) => IL(LD + "/plan/drop", e),
  OD = (e) => IL(LD + "/plan/sort", { ids: e }),
  MD = RL(),
  AD = (e) => IL(MD + "/order/fetch", e),
  PD = (e) => IL(MD + "/order/detail", e),
  jD = (e) => IL(MD + "/order/paid", e),
  FD = (e) => IL(MD + "/order/cancel", e),
  BD = (e) => IL(MD + "/order/update", e),
  VD = (e) => IL(MD + "/order/assign", e),
  WD = RL(),
  HD = (e) => IL(WD + "/gift-card/templates", e),
  zD = (e) => IL(WD + "/gift-card/create-template", e),
  UD = (e) => IL(WD + "/gift-card/update-template", e),
  $D = (e) => IL(WD + "/gift-card/delete-template", e),
  qD = (e) => IL(WD + "/gift-card/codes", e),
  KD = (e) =>
    e.download_csv
      ? IL(WD + "/gift-card/generate-codes", e, { responseType: "blob" })
      : IL(WD + "/gift-card/generate-codes", e),
  GD = (e) => IL(WD + "/gift-card/toggle-code", e),
  ZD = (e) => IL(WD + "/gift-card/usages", e),
  YD = (e) => IL(WD + "/gift-card/statistics", e),
  XD = RL(),
  QD = (e) => IL(XD + "/coupon/fetch", e),
  JD = (e) => IL(XD + "/coupon/generate", e),
  eT = (e) => IL(XD + "/coupon/drop", e),
  tT = (e) => IL(XD + "/coupon/update", e),
  nT = RL(),
  iT = (e) => IL(`${nT}/user/fetch`, e),
  rT = (e) => IL(`${nT}/user/update`, e),
  oT = (e) => IL(`${nT}/user/resetSecret`, { id: e }),
  sT = (e) =>
    e.download_csv
      ? IL(`${nT}/user/generate`, e, { responseType: "blob" })
      : IL(`${nT}/user/generate`, e),
  aT = (e) => IL(`${nT}/stat/getStatUser`, e),
  lT = (e) => IL(`${nT}/user/destroy`, { id: e }),
  cT = (e) => IL(`${nT}/user/sendMail`, e),
  dT = (e) => IL(`${nT}/user/dumpCSV`, e, { responseType: "blob" }).then((e) => e),
  uT = (e) => IL(`${nT}/user/ban`, e),
  hT = (e) => TL(`${nT}/traffic-reset/logs`, { params: e }),
  gT = (e) => IL(`${nT}/traffic-reset/reset-user`, e),
  pT = (e, t) => TL(`${nT}/traffic-reset/user/${e}/history`, { params: t }),
  fT = RL(),
  mT = (e) => IL(fT + "/ticket/fetch", e),
  _T = (e) => TL(fT + "/ticket/fetch?id=" + e),
  vT = (e) => IL(fT + "/ticket/reply", e),
  bT = (e) => IL(fT + "/ticket/close", { id: e }),
  yT = RL(),
  xT = {
    getSettings: (e = "") => TL(yT + "/config/fetch?key=" + e),
    saveSettings: (e) => IL(yT + "/config/save", e),
    getEmailTemplate: () => TL(yT + "/config/getEmailTemplate"),
    sendTestMail: () => IL(yT + "/config/testSendMail"),
    setTelegramWebhook: () => IL(yT + "/config/setTelegramWebhook"),
    updateSystemConfig: (e) => IL(yT + "/config/save", e),
    getSystemStatus: () => TL(`${yT}/system/getSystemStatus`),
    getQueueStats: () => TL(`${yT}/system/getQueueStats`),
    getQueueWorkload: () => TL(`${yT}/system/getQueueWorkload`),
    getQueueMasters: () => TL(`${yT}/system/getQueueMasters`),
    getHorizonFailedJobs: (e) => TL(`${yT}/system/getHorizonFailedJobs`, { params: e }),
  },
  wT = RL(),
  CT = {
    getPluginTypes: () => TL(`${wT}/plugin/types`),
    getPluginList: (e) => TL(`${wT}/plugin/getPlugins`, { params: e ? { type: e } : {} }),
    uploadPlugin: (e) => {
      const t = new FormData();
      return (
        t.append("file", e),
        IL(`${wT}/plugin/upload`, t, { headers: { "Content-Type": "multipart/form-data" } })
      );
    },
    deletePlugin: (e) => IL(`${wT}/plugin/delete`, { code: e }),
    installPlugin: (e) => IL(`${wT}/plugin/install`, { code: e }),
    uninstallPlugin: (e) => IL(`${wT}/plugin/uninstall`, { code: e }),
    enablePlugin: (e) => IL(`${wT}/plugin/enable`, { code: e }),
    disablePlugin: (e) => IL(`${wT}/plugin/disable`, { code: e }),
    getPluginConfig: (e) => TL(`${wT}/plugin/config`, { params: { code: e } }),
    updatePluginConfig: (e, t) => IL(`${wT}/plugin/config`, { code: e, config: t }),
    upgradePlugin: (e) => IL(`${wT}/plugin/upgrade`, { code: e }),
  };
RL();
var ST = { exports: {} };
/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */ !(function (e, n) {
  (function () {
    var i,
      r = "Expected a function",
      o = "__lodash_hash_undefined__",
      s = "__lodash_placeholder__",
      a = 32,
      l = 128,
      c = 256,
      d = 1 / 0,
      u = 9007199254740991,
      h = NaN,
      g = 4294967295,
      p = [
        ["ary", l],
        ["bind", 1],
        ["bindKey", 2],
        ["curry", 8],
        ["curryRight", 16],
        ["flip", 512],
        ["partial", a],
        ["partialRight", 64],
        ["rearg", c],
      ],
      f = "[object Arguments]",
      m = "[object Array]",
      _ = "[object Boolean]",
      v = "[object Date]",
      b = "[object Error]",
      y = "[object Function]",
      x = "[object GeneratorFunction]",
      w = "[object Map]",
      C = "[object Number]",
      S = "[object Object]",
      k = "[object Promise]",
      E = "[object RegExp]",
      N = "[object Set]",
      L = "[object String]",
      D = "[object Symbol]",
      T = "[object WeakMap]",
      I = "[object ArrayBuffer]",
      R = "[object DataView]",
      O = "[object Float32Array]",
      M = "[object Float64Array]",
      A = "[object Int8Array]",
      P = "[object Int16Array]",
      j = "[object Int32Array]",
      F = "[object Uint8Array]",
      B = "[object Uint8ClampedArray]",
      V = "[object Uint16Array]",
      W = "[object Uint32Array]",
      H = /\b__p \+= '';/g,
      z = /\b(__p \+=) '' \+/g,
      U = /(__e\(.*?\)|\b__t\)) \+\n'';/g,
      $ = /&(?:amp|lt|gt|quot|#39);/g,
      q = /[&<>"']/g,
      K = RegExp($.source),
      G = RegExp(q.source),
      Z = /<%-([\s\S]+?)%>/g,
      Y = /<%([\s\S]+?)%>/g,
      X = /<%=([\s\S]+?)%>/g,
      Q = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
      J = /^\w*$/,
      ee =
        /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,
      te = /[\\^$.*+?()[\]{}|]/g,
      ne = RegExp(te.source),
      ie = /^\s+/,
      re = /\s/,
      oe = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
      se = /\{\n\/\* \[wrapped with (.+)\] \*/,
      ae = /,? & /,
      le = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,
      ce = /[()=,{}\[\]\/\s]/,
      de = /\\(\\)?/g,
      ue = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,
      he = /\w*$/,
      ge = /^[-+]0x[0-9a-f]+$/i,
      pe = /^0b[01]+$/i,
      fe = /^\[object .+?Constructor\]$/,
      me = /^0o[0-7]+$/i,
      _e = /^(?:0|[1-9]\d*)$/,
      ve = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,
      be = /($^)/,
      ye = /['\n\r\u2028\u2029\\]/g,
      xe = "\\ud800-\\udfff",
      we = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",
      Ce = "\\u2700-\\u27bf",
      Se = "a-z\\xdf-\\xf6\\xf8-\\xff",
      ke = "A-Z\\xc0-\\xd6\\xd8-\\xde",
      Ee = "\\ufe0e\\ufe0f",
      Ne =
        "\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",
      Le = "['’]",
      De = "[" + xe + "]",
      Te = "[" + Ne + "]",
      Ie = "[" + we + "]",
      Re = "\\d+",
      Oe = "[" + Ce + "]",
      Me = "[" + Se + "]",
      Ae = "[^" + xe + Ne + Re + Ce + Se + ke + "]",
      Pe = "\\ud83c[\\udffb-\\udfff]",
      je = "[^" + xe + "]",
      Fe = "(?:\\ud83c[\\udde6-\\uddff]){2}",
      Be = "[\\ud800-\\udbff][\\udc00-\\udfff]",
      Ve = "[" + ke + "]",
      We = "\\u200d",
      He = "(?:" + Me + "|" + Ae + ")",
      ze = "(?:" + Ve + "|" + Ae + ")",
      Ue = "(?:['’](?:d|ll|m|re|s|t|ve))?",
      $e = "(?:['’](?:D|LL|M|RE|S|T|VE))?",
      qe = "(?:" + Ie + "|" + Pe + ")" + "?",
      Ke = "[" + Ee + "]?",
      Ge = Ke + qe + ("(?:" + We + "(?:" + [je, Fe, Be].join("|") + ")" + Ke + qe + ")*"),
      Ze = "(?:" + [Oe, Fe, Be].join("|") + ")" + Ge,
      Ye = "(?:" + [je + Ie + "?", Ie, Fe, Be, De].join("|") + ")",
      Xe = RegExp(Le, "g"),
      Qe = RegExp(Ie, "g"),
      Je = RegExp(Pe + "(?=" + Pe + ")|" + Ye + Ge, "g"),
      et = RegExp(
        [
          Ve + "?" + Me + "+" + Ue + "(?=" + [Te, Ve, "$"].join("|") + ")",
          ze + "+" + $e + "(?=" + [Te, Ve + He, "$"].join("|") + ")",
          Ve + "?" + He + "+" + Ue,
          Ve + "+" + $e,
          "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",
          "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",
          Re,
          Ze,
        ].join("|"),
        "g",
      ),
      tt = RegExp("[" + We + xe + we + Ee + "]"),
      nt = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,
      it = [
        "Array",
        "Buffer",
        "DataView",
        "Date",
        "Error",
        "Float32Array",
        "Float64Array",
        "Function",
        "Int8Array",
        "Int16Array",
        "Int32Array",
        "Map",
        "Math",
        "Object",
        "Promise",
        "RegExp",
        "Set",
        "String",
        "Symbol",
        "TypeError",
        "Uint8Array",
        "Uint8ClampedArray",
        "Uint16Array",
        "Uint32Array",
        "WeakMap",
        "_",
        "clearTimeout",
        "isFinite",
        "parseInt",
        "setTimeout",
      ],
      rt = -1,
      ot = {};
    ((ot[O] = ot[M] = ot[A] = ot[P] = ot[j] = ot[F] = ot[B] = ot[V] = ot[W] = !0),
      (ot[f] =
        ot[m] =
        ot[I] =
        ot[_] =
        ot[R] =
        ot[v] =
        ot[b] =
        ot[y] =
        ot[w] =
        ot[C] =
        ot[S] =
        ot[E] =
        ot[N] =
        ot[L] =
        ot[T] =
          !1));
    var st = {};
    ((st[f] =
      st[m] =
      st[I] =
      st[R] =
      st[_] =
      st[v] =
      st[O] =
      st[M] =
      st[A] =
      st[P] =
      st[j] =
      st[w] =
      st[C] =
      st[S] =
      st[E] =
      st[N] =
      st[L] =
      st[D] =
      st[F] =
      st[B] =
      st[V] =
      st[W] =
        !0),
      (st[b] = st[y] = st[T] = !1));
    var at = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" },
      lt = parseFloat,
      ct = parseInt,
      dt = "object" == typeof t && t && t.Object === Object && t,
      ut = "object" == typeof self && self && self.Object === Object && self,
      ht = dt || ut || Function("return this")(),
      gt = n && !n.nodeType && n,
      pt = gt && e && !e.nodeType && e,
      ft = pt && pt.exports === gt,
      mt = ft && dt.process,
      _t = (function () {
        try {
          var e = pt && pt.require && pt.require("util").types;
          return e || (mt && mt.binding && mt.binding("util"));
        } catch (spt) {}
      })(),
      vt = _t && _t.isArrayBuffer,
      bt = _t && _t.isDate,
      yt = _t && _t.isMap,
      xt = _t && _t.isRegExp,
      wt = _t && _t.isSet,
      Ct = _t && _t.isTypedArray;
    function St(e, t, n) {
      switch (n.length) {
        case 0:
          return e.call(t);
        case 1:
          return e.call(t, n[0]);
        case 2:
          return e.call(t, n[0], n[1]);
        case 3:
          return e.call(t, n[0], n[1], n[2]);
      }
      return e.apply(t, n);
    }
    function kt(e, t, n, i) {
      for (var r = -1, o = null == e ? 0 : e.length; ++r < o; ) {
        var s = e[r];
        t(i, s, n(s), e);
      }
      return i;
    }
    function Et(e, t) {
      for (var n = -1, i = null == e ? 0 : e.length; ++n < i && !1 !== t(e[n], n, e); );
      return e;
    }
    function Nt(e, t) {
      for (var n = null == e ? 0 : e.length; n-- && !1 !== t(e[n], n, e); );
      return e;
    }
    function Lt(e, t) {
      for (var n = -1, i = null == e ? 0 : e.length; ++n < i; ) if (!t(e[n], n, e)) return !1;
      return !0;
    }
    function Dt(e, t) {
      for (var n = -1, i = null == e ? 0 : e.length, r = 0, o = []; ++n < i; ) {
        var s = e[n];
        t(s, n, e) && (o[r++] = s);
      }
      return o;
    }
    function Tt(e, t) {
      return !!(null == e ? 0 : e.length) && Vt(e, t, 0) > -1;
    }
    function It(e, t, n) {
      for (var i = -1, r = null == e ? 0 : e.length; ++i < r; ) if (n(t, e[i])) return !0;
      return !1;
    }
    function Rt(e, t) {
      for (var n = -1, i = null == e ? 0 : e.length, r = Array(i); ++n < i; ) r[n] = t(e[n], n, e);
      return r;
    }
    function Ot(e, t) {
      for (var n = -1, i = t.length, r = e.length; ++n < i; ) e[r + n] = t[n];
      return e;
    }
    function Mt(e, t, n, i) {
      var r = -1,
        o = null == e ? 0 : e.length;
      for (i && o && (n = e[++r]); ++r < o; ) n = t(n, e[r], r, e);
      return n;
    }
    function At(e, t, n, i) {
      var r = null == e ? 0 : e.length;
      for (i && r && (n = e[--r]); r--; ) n = t(n, e[r], r, e);
      return n;
    }
    function Pt(e, t) {
      for (var n = -1, i = null == e ? 0 : e.length; ++n < i; ) if (t(e[n], n, e)) return !0;
      return !1;
    }
    var jt = Ut("length");
    function Ft(e, t, n) {
      var i;
      return (
        n(e, function (e, n, r) {
          if (t(e, n, r)) return ((i = n), !1);
        }),
        i
      );
    }
    function Bt(e, t, n, i) {
      for (var r = e.length, o = n + (i ? 1 : -1); i ? o-- : ++o < r; ) if (t(e[o], o, e)) return o;
      return -1;
    }
    function Vt(e, t, n) {
      return t == t
        ? (function (e, t, n) {
            var i = n - 1,
              r = e.length;
            for (; ++i < r; ) if (e[i] === t) return i;
            return -1;
          })(e, t, n)
        : Bt(e, Ht, n);
    }
    function Wt(e, t, n, i) {
      for (var r = n - 1, o = e.length; ++r < o; ) if (i(e[r], t)) return r;
      return -1;
    }
    function Ht(e) {
      return e != e;
    }
    function zt(e, t) {
      var n = null == e ? 0 : e.length;
      return n ? Kt(e, t) / n : h;
    }
    function Ut(e) {
      return function (t) {
        return null == t ? i : t[e];
      };
    }
    function $t(e) {
      return function (t) {
        return null == e ? i : e[t];
      };
    }
    function qt(e, t, n, i, r) {
      return (
        r(e, function (e, r, o) {
          n = i ? ((i = !1), e) : t(n, e, r, o);
        }),
        n
      );
    }
    function Kt(e, t) {
      for (var n, r = -1, o = e.length; ++r < o; ) {
        var s = t(e[r]);
        s !== i && (n = n === i ? s : n + s);
      }
      return n;
    }
    function Gt(e, t) {
      for (var n = -1, i = Array(e); ++n < e; ) i[n] = t(n);
      return i;
    }
    function Zt(e) {
      return e ? e.slice(0, gn(e) + 1).replace(ie, "") : e;
    }
    function Yt(e) {
      return function (t) {
        return e(t);
      };
    }
    function Xt(e, t) {
      return Rt(t, function (t) {
        return e[t];
      });
    }
    function Qt(e, t) {
      return e.has(t);
    }
    function Jt(e, t) {
      for (var n = -1, i = e.length; ++n < i && Vt(t, e[n], 0) > -1; );
      return n;
    }
    function en(e, t) {
      for (var n = e.length; n-- && Vt(t, e[n], 0) > -1; );
      return n;
    }
    var tn = $t({
        À: "A",
        Á: "A",
        Â: "A",
        Ã: "A",
        Ä: "A",
        Å: "A",
        à: "a",
        á: "a",
        â: "a",
        ã: "a",
        ä: "a",
        å: "a",
        Ç: "C",
        ç: "c",
        Ð: "D",
        ð: "d",
        È: "E",
        É: "E",
        Ê: "E",
        Ë: "E",
        è: "e",
        é: "e",
        ê: "e",
        ë: "e",
        Ì: "I",
        Í: "I",
        Î: "I",
        Ï: "I",
        ì: "i",
        í: "i",
        î: "i",
        ï: "i",
        Ñ: "N",
        ñ: "n",
        Ò: "O",
        Ó: "O",
        Ô: "O",
        Õ: "O",
        Ö: "O",
        Ø: "O",
        ò: "o",
        ó: "o",
        ô: "o",
        õ: "o",
        ö: "o",
        ø: "o",
        Ù: "U",
        Ú: "U",
        Û: "U",
        Ü: "U",
        ù: "u",
        ú: "u",
        û: "u",
        ü: "u",
        Ý: "Y",
        ý: "y",
        ÿ: "y",
        Æ: "Ae",
        æ: "ae",
        Þ: "Th",
        þ: "th",
        ß: "ss",
        Ā: "A",
        Ă: "A",
        Ą: "A",
        ā: "a",
        ă: "a",
        ą: "a",
        Ć: "C",
        Ĉ: "C",
        Ċ: "C",
        Č: "C",
        ć: "c",
        ĉ: "c",
        ċ: "c",
        č: "c",
        Ď: "D",
        Đ: "D",
        ď: "d",
        đ: "d",
        Ē: "E",
        Ĕ: "E",
        Ė: "E",
        Ę: "E",
        Ě: "E",
        ē: "e",
        ĕ: "e",
        ė: "e",
        ę: "e",
        ě: "e",
        Ĝ: "G",
        Ğ: "G",
        Ġ: "G",
        Ģ: "G",
        ĝ: "g",
        ğ: "g",
        ġ: "g",
        ģ: "g",
        Ĥ: "H",
        Ħ: "H",
        ĥ: "h",
        ħ: "h",
        Ĩ: "I",
        Ī: "I",
        Ĭ: "I",
        Į: "I",
        İ: "I",
        ĩ: "i",
        ī: "i",
        ĭ: "i",
        į: "i",
        ı: "i",
        Ĵ: "J",
        ĵ: "j",
        Ķ: "K",
        ķ: "k",
        ĸ: "k",
        Ĺ: "L",
        Ļ: "L",
        Ľ: "L",
        Ŀ: "L",
        Ł: "L",
        ĺ: "l",
        ļ: "l",
        ľ: "l",
        ŀ: "l",
        ł: "l",
        Ń: "N",
        Ņ: "N",
        Ň: "N",
        Ŋ: "N",
        ń: "n",
        ņ: "n",
        ň: "n",
        ŋ: "n",
        Ō: "O",
        Ŏ: "O",
        Ő: "O",
        ō: "o",
        ŏ: "o",
        ő: "o",
        Ŕ: "R",
        Ŗ: "R",
        Ř: "R",
        ŕ: "r",
        ŗ: "r",
        ř: "r",
        Ś: "S",
        Ŝ: "S",
        Ş: "S",
        Š: "S",
        ś: "s",
        ŝ: "s",
        ş: "s",
        š: "s",
        Ţ: "T",
        Ť: "T",
        Ŧ: "T",
        ţ: "t",
        ť: "t",
        ŧ: "t",
        Ũ: "U",
        Ū: "U",
        Ŭ: "U",
        Ů: "U",
        Ű: "U",
        Ų: "U",
        ũ: "u",
        ū: "u",
        ŭ: "u",
        ů: "u",
        ű: "u",
        ų: "u",
        Ŵ: "W",
        ŵ: "w",
        Ŷ: "Y",
        ŷ: "y",
        Ÿ: "Y",
        Ź: "Z",
        Ż: "Z",
        Ž: "Z",
        ź: "z",
        ż: "z",
        ž: "z",
        Ĳ: "IJ",
        ĳ: "ij",
        Œ: "Oe",
        œ: "oe",
        ŉ: "'n",
        ſ: "s",
      }),
      nn = $t({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" });
    function rn(e) {
      return "\\" + at[e];
    }
    function on(e) {
      return tt.test(e);
    }
    function sn(e) {
      var t = -1,
        n = Array(e.size);
      return (
        e.forEach(function (e, i) {
          n[++t] = [i, e];
        }),
        n
      );
    }
    function an(e, t) {
      return function (n) {
        return e(t(n));
      };
    }
    function ln(e, t) {
      for (var n = -1, i = e.length, r = 0, o = []; ++n < i; ) {
        var a = e[n];
        (a !== t && a !== s) || ((e[n] = s), (o[r++] = n));
      }
      return o;
    }
    function cn(e) {
      var t = -1,
        n = Array(e.size);
      return (
        e.forEach(function (e) {
          n[++t] = e;
        }),
        n
      );
    }
    function dn(e) {
      var t = -1,
        n = Array(e.size);
      return (
        e.forEach(function (e) {
          n[++t] = [e, e];
        }),
        n
      );
    }
    function un(e) {
      return on(e)
        ? (function (e) {
            var t = (Je.lastIndex = 0);
            for (; Je.test(e); ) ++t;
            return t;
          })(e)
        : jt(e);
    }
    function hn(e) {
      return on(e)
        ? (function (e) {
            return e.match(Je) || [];
          })(e)
        : (function (e) {
            return e.split("");
          })(e);
    }
    function gn(e) {
      for (var t = e.length; t-- && re.test(e.charAt(t)); );
      return t;
    }
    var pn = $t({ "&amp;": "&", "&lt;": "<", "&gt;": ">", "&quot;": '"', "&#39;": "'" });
    var fn = (function e(t) {
      var n,
        re = (t = null == t ? ht : fn.defaults(ht.Object(), t, fn.pick(ht, it))).Array,
        xe = t.Date,
        we = t.Error,
        Ce = t.Function,
        Se = t.Math,
        ke = t.Object,
        Ee = t.RegExp,
        Ne = t.String,
        Le = t.TypeError,
        De = re.prototype,
        Te = Ce.prototype,
        Ie = ke.prototype,
        Re = t["__core-js_shared__"],
        Oe = Te.toString,
        Me = Ie.hasOwnProperty,
        Ae = 0,
        Pe = (n = /[^.]+$/.exec((Re && Re.keys && Re.keys.IE_PROTO) || ""))
          ? "Symbol(src)_1." + n
          : "",
        je = Ie.toString,
        Fe = Oe.call(ke),
        Be = ht._,
        Ve = Ee(
          "^" +
            Oe.call(Me)
              .replace(te, "\\$&")
              .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") +
            "$",
        ),
        We = ft ? t.Buffer : i,
        He = t.Symbol,
        ze = t.Uint8Array,
        Ue = We ? We.allocUnsafe : i,
        $e = an(ke.getPrototypeOf, ke),
        qe = ke.create,
        Ke = Ie.propertyIsEnumerable,
        Ge = De.splice,
        Ze = He ? He.isConcatSpreadable : i,
        Ye = He ? He.iterator : i,
        Je = He ? He.toStringTag : i,
        tt = (function () {
          try {
            var e = uo(ke, "defineProperty");
            return (e({}, "", {}), e);
          } catch (spt) {}
        })(),
        at = t.clearTimeout !== ht.clearTimeout && t.clearTimeout,
        dt = xe && xe.now !== ht.Date.now && xe.now,
        ut = t.setTimeout !== ht.setTimeout && t.setTimeout,
        gt = Se.ceil,
        pt = Se.floor,
        mt = ke.getOwnPropertySymbols,
        _t = We ? We.isBuffer : i,
        jt = t.isFinite,
        $t = De.join,
        mn = an(ke.keys, ke),
        _n = Se.max,
        vn = Se.min,
        bn = xe.now,
        yn = t.parseInt,
        xn = Se.random,
        wn = De.reverse,
        Cn = uo(t, "DataView"),
        Sn = uo(t, "Map"),
        kn = uo(t, "Promise"),
        En = uo(t, "Set"),
        Nn = uo(t, "WeakMap"),
        Ln = uo(ke, "create"),
        Dn = Nn && new Nn(),
        Tn = {},
        In = jo(Cn),
        Rn = jo(Sn),
        On = jo(kn),
        Mn = jo(En),
        An = jo(Nn),
        Pn = He ? He.prototype : i,
        jn = Pn ? Pn.valueOf : i,
        Fn = Pn ? Pn.toString : i;
      function Bn(e) {
        if (ea(e) && !zs(e) && !(e instanceof zn)) {
          if (e instanceof Hn) return e;
          if (Me.call(e, "__wrapped__")) return Fo(e);
        }
        return new Hn(e);
      }
      var Vn = (function () {
        function e() {}
        return function (t) {
          if (!Js(t)) return {};
          if (qe) return qe(t);
          e.prototype = t;
          var n = new e();
          return ((e.prototype = i), n);
        };
      })();
      function Wn() {}
      function Hn(e, t) {
        ((this.__wrapped__ = e),
          (this.__actions__ = []),
          (this.__chain__ = !!t),
          (this.__index__ = 0),
          (this.__values__ = i));
      }
      function zn(e) {
        ((this.__wrapped__ = e),
          (this.__actions__ = []),
          (this.__dir__ = 1),
          (this.__filtered__ = !1),
          (this.__iteratees__ = []),
          (this.__takeCount__ = g),
          (this.__views__ = []));
      }
      function Un(e) {
        var t = -1,
          n = null == e ? 0 : e.length;
        for (this.clear(); ++t < n; ) {
          var i = e[t];
          this.set(i[0], i[1]);
        }
      }
      function $n(e) {
        var t = -1,
          n = null == e ? 0 : e.length;
        for (this.clear(); ++t < n; ) {
          var i = e[t];
          this.set(i[0], i[1]);
        }
      }
      function qn(e) {
        var t = -1,
          n = null == e ? 0 : e.length;
        for (this.clear(); ++t < n; ) {
          var i = e[t];
          this.set(i[0], i[1]);
        }
      }
      function Kn(e) {
        var t = -1,
          n = null == e ? 0 : e.length;
        for (this.__data__ = new qn(); ++t < n; ) this.add(e[t]);
      }
      function Gn(e) {
        var t = (this.__data__ = new $n(e));
        this.size = t.size;
      }
      function Zn(e, t) {
        var n = zs(e),
          i = !n && Hs(e),
          r = !n && !i && Ks(e),
          o = !n && !i && !r && la(e),
          s = n || i || r || o,
          a = s ? Gt(e.length, Ne) : [],
          l = a.length;
        for (var c in e)
          (!t && !Me.call(e, c)) ||
            (s &&
              ("length" == c ||
                (r && ("offset" == c || "parent" == c)) ||
                (o && ("buffer" == c || "byteLength" == c || "byteOffset" == c)) ||
                vo(c, l))) ||
            a.push(c);
        return a;
      }
      function Yn(e) {
        var t = e.length;
        return t ? e[Ki(0, t - 1)] : i;
      }
      function Xn(e, t) {
        return Mo(Lr(e), si(t, 0, e.length));
      }
      function Qn(e) {
        return Mo(Lr(e));
      }
      function Jn(e, t, n) {
        ((n !== i && !Bs(e[t], n)) || (n === i && !(t in e))) && ri(e, t, n);
      }
      function ei(e, t, n) {
        var r = e[t];
        (Me.call(e, t) && Bs(r, n) && (n !== i || t in e)) || ri(e, t, n);
      }
      function ti(e, t) {
        for (var n = e.length; n--; ) if (Bs(e[n][0], t)) return n;
        return -1;
      }
      function ni(e, t, n, i) {
        return (
          ui(e, function (e, r, o) {
            t(i, e, n(e), o);
          }),
          i
        );
      }
      function ii(e, t) {
        return e && Dr(t, Ta(t), e);
      }
      function ri(e, t, n) {
        "__proto__" == t && tt
          ? tt(e, t, { configurable: !0, enumerable: !0, value: n, writable: !0 })
          : (e[t] = n);
      }
      function oi(e, t) {
        for (var n = -1, r = t.length, o = re(r), s = null == e; ++n < r; )
          o[n] = s ? i : ka(e, t[n]);
        return o;
      }
      function si(e, t, n) {
        return (e == e && (n !== i && (e = e <= n ? e : n), t !== i && (e = e >= t ? e : t)), e);
      }
      function ai(e, t, n, r, o, s) {
        var a,
          l = 1 & t,
          c = 2 & t,
          d = 4 & t;
        if ((n && (a = o ? n(e, r, o, s) : n(e)), a !== i)) return a;
        if (!Js(e)) return e;
        var u = zs(e);
        if (u) {
          if (
            ((a = (function (e) {
              var t = e.length,
                n = new e.constructor(t);
              t &&
                "string" == typeof e[0] &&
                Me.call(e, "index") &&
                ((n.index = e.index), (n.input = e.input));
              return n;
            })(e)),
            !l)
          )
            return Lr(e, a);
        } else {
          var h = po(e),
            g = h == y || h == x;
          if (Ks(e)) return wr(e, l);
          if (h == S || h == f || (g && !o)) {
            if (((a = c || g ? {} : mo(e)), !l))
              return c
                ? (function (e, t) {
                    return Dr(e, go(e), t);
                  })(
                    e,
                    (function (e, t) {
                      return e && Dr(t, Ia(t), e);
                    })(a, e),
                  )
                : (function (e, t) {
                    return Dr(e, ho(e), t);
                  })(e, ii(a, e));
          } else {
            if (!st[h]) return o ? e : {};
            a = (function (e, t, n) {
              var i = e.constructor;
              switch (t) {
                case I:
                  return Cr(e);
                case _:
                case v:
                  return new i(+e);
                case R:
                  return (function (e, t) {
                    var n = t ? Cr(e.buffer) : e.buffer;
                    return new e.constructor(n, e.byteOffset, e.byteLength);
                  })(e, n);
                case O:
                case M:
                case A:
                case P:
                case j:
                case F:
                case B:
                case V:
                case W:
                  return Sr(e, n);
                case w:
                  return new i();
                case C:
                case L:
                  return new i(e);
                case E:
                  return (function (e) {
                    var t = new e.constructor(e.source, he.exec(e));
                    return ((t.lastIndex = e.lastIndex), t);
                  })(e);
                case N:
                  return new i();
                case D:
                  return ((r = e), jn ? ke(jn.call(r)) : {});
              }
              var r;
            })(e, h, l);
          }
        }
        s || (s = new Gn());
        var p = s.get(e);
        if (p) return p;
        (s.set(e, a),
          oa(e)
            ? e.forEach(function (i) {
                a.add(ai(i, t, n, i, e, s));
              })
            : ta(e) &&
              e.forEach(function (i, r) {
                a.set(r, ai(i, t, n, r, e, s));
              }));
        var m = u ? i : (d ? (c ? io : no) : c ? Ia : Ta)(e);
        return (
          Et(m || e, function (i, r) {
            (m && (i = e[(r = i)]), ei(a, r, ai(i, t, n, r, e, s)));
          }),
          a
        );
      }
      function li(e, t, n) {
        var r = n.length;
        if (null == e) return !r;
        for (e = ke(e); r--; ) {
          var o = n[r],
            s = t[o],
            a = e[o];
          if ((a === i && !(o in e)) || !s(a)) return !1;
        }
        return !0;
      }
      function ci(e, t, n) {
        if ("function" != typeof e) throw new Le(r);
        return To(function () {
          e.apply(i, n);
        }, t);
      }
      function di(e, t, n, i) {
        var r = -1,
          o = Tt,
          s = !0,
          a = e.length,
          l = [],
          c = t.length;
        if (!a) return l;
        (n && (t = Rt(t, Yt(n))),
          i ? ((o = It), (s = !1)) : t.length >= 200 && ((o = Qt), (s = !1), (t = new Kn(t))));
        e: for (; ++r < a; ) {
          var d = e[r],
            u = null == n ? d : n(d);
          if (((d = i || 0 !== d ? d : 0), s && u == u)) {
            for (var h = c; h--; ) if (t[h] === u) continue e;
            l.push(d);
          } else o(t, u, i) || l.push(d);
        }
        return l;
      }
      ((Bn.templateSettings = {
        escape: Z,
        evaluate: Y,
        interpolate: X,
        variable: "",
        imports: { _: Bn },
      }),
        (Bn.prototype = Wn.prototype),
        (Bn.prototype.constructor = Bn),
        (Hn.prototype = Vn(Wn.prototype)),
        (Hn.prototype.constructor = Hn),
        (zn.prototype = Vn(Wn.prototype)),
        (zn.prototype.constructor = zn),
        (Un.prototype.clear = function () {
          ((this.__data__ = Ln ? Ln(null) : {}), (this.size = 0));
        }),
        (Un.prototype.delete = function (e) {
          var t = this.has(e) && delete this.__data__[e];
          return ((this.size -= t ? 1 : 0), t);
        }),
        (Un.prototype.get = function (e) {
          var t = this.__data__;
          if (Ln) {
            var n = t[e];
            return n === o ? i : n;
          }
          return Me.call(t, e) ? t[e] : i;
        }),
        (Un.prototype.has = function (e) {
          var t = this.__data__;
          return Ln ? t[e] !== i : Me.call(t, e);
        }),
        (Un.prototype.set = function (e, t) {
          var n = this.__data__;
          return ((this.size += this.has(e) ? 0 : 1), (n[e] = Ln && t === i ? o : t), this);
        }),
        ($n.prototype.clear = function () {
          ((this.__data__ = []), (this.size = 0));
        }),
        ($n.prototype.delete = function (e) {
          var t = this.__data__,
            n = ti(t, e);
          return !(n < 0) && (n == t.length - 1 ? t.pop() : Ge.call(t, n, 1), --this.size, !0);
        }),
        ($n.prototype.get = function (e) {
          var t = this.__data__,
            n = ti(t, e);
          return n < 0 ? i : t[n][1];
        }),
        ($n.prototype.has = function (e) {
          return ti(this.__data__, e) > -1;
        }),
        ($n.prototype.set = function (e, t) {
          var n = this.__data__,
            i = ti(n, e);
          return (i < 0 ? (++this.size, n.push([e, t])) : (n[i][1] = t), this);
        }),
        (qn.prototype.clear = function () {
          ((this.size = 0),
            (this.__data__ = { hash: new Un(), map: new (Sn || $n)(), string: new Un() }));
        }),
        (qn.prototype.delete = function (e) {
          var t = lo(this, e).delete(e);
          return ((this.size -= t ? 1 : 0), t);
        }),
        (qn.prototype.get = function (e) {
          return lo(this, e).get(e);
        }),
        (qn.prototype.has = function (e) {
          return lo(this, e).has(e);
        }),
        (qn.prototype.set = function (e, t) {
          var n = lo(this, e),
            i = n.size;
          return (n.set(e, t), (this.size += n.size == i ? 0 : 1), this);
        }),
        (Kn.prototype.add = Kn.prototype.push =
          function (e) {
            return (this.__data__.set(e, o), this);
          }),
        (Kn.prototype.has = function (e) {
          return this.__data__.has(e);
        }),
        (Gn.prototype.clear = function () {
          ((this.__data__ = new $n()), (this.size = 0));
        }),
        (Gn.prototype.delete = function (e) {
          var t = this.__data__,
            n = t.delete(e);
          return ((this.size = t.size), n);
        }),
        (Gn.prototype.get = function (e) {
          return this.__data__.get(e);
        }),
        (Gn.prototype.has = function (e) {
          return this.__data__.has(e);
        }),
        (Gn.prototype.set = function (e, t) {
          var n = this.__data__;
          if (n instanceof $n) {
            var i = n.__data__;
            if (!Sn || i.length < 199) return (i.push([e, t]), (this.size = ++n.size), this);
            n = this.__data__ = new qn(i);
          }
          return (n.set(e, t), (this.size = n.size), this);
        }));
      var ui = Rr(bi),
        hi = Rr(yi, !0);
      function gi(e, t) {
        var n = !0;
        return (
          ui(e, function (e, i, r) {
            return (n = !!t(e, i, r));
          }),
          n
        );
      }
      function pi(e, t, n) {
        for (var r = -1, o = e.length; ++r < o; ) {
          var s = e[r],
            a = t(s);
          if (null != a && (l === i ? a == a && !aa(a) : n(a, l)))
            var l = a,
              c = s;
        }
        return c;
      }
      function fi(e, t) {
        var n = [];
        return (
          ui(e, function (e, i, r) {
            t(e, i, r) && n.push(e);
          }),
          n
        );
      }
      function mi(e, t, n, i, r) {
        var o = -1,
          s = e.length;
        for (n || (n = _o), r || (r = []); ++o < s; ) {
          var a = e[o];
          t > 0 && n(a) ? (t > 1 ? mi(a, t - 1, n, i, r) : Ot(r, a)) : i || (r[r.length] = a);
        }
        return r;
      }
      var _i = Or(),
        vi = Or(!0);
      function bi(e, t) {
        return e && _i(e, t, Ta);
      }
      function yi(e, t) {
        return e && vi(e, t, Ta);
      }
      function xi(e, t) {
        return Dt(t, function (t) {
          return Ys(e[t]);
        });
      }
      function wi(e, t) {
        for (var n = 0, r = (t = vr(t, e)).length; null != e && n < r; ) e = e[Po(t[n++])];
        return n && n == r ? e : i;
      }
      function Ci(e, t, n) {
        var i = t(e);
        return zs(e) ? i : Ot(i, n(e));
      }
      function Si(e) {
        return null == e
          ? e === i
            ? "[object Undefined]"
            : "[object Null]"
          : Je && Je in ke(e)
            ? (function (e) {
                var t = Me.call(e, Je),
                  n = e[Je];
                try {
                  e[Je] = i;
                  var r = !0;
                } catch (spt) {}
                var o = je.call(e);
                r && (t ? (e[Je] = n) : delete e[Je]);
                return o;
              })(e)
            : (function (e) {
                return je.call(e);
              })(e);
      }
      function ki(e, t) {
        return e > t;
      }
      function Ei(e, t) {
        return null != e && Me.call(e, t);
      }
      function Ni(e, t) {
        return null != e && t in ke(e);
      }
      function Li(e, t, n) {
        for (
          var r = n ? It : Tt, o = e[0].length, s = e.length, a = s, l = re(s), c = 1 / 0, d = [];
          a--;
        ) {
          var u = e[a];
          (a && t && (u = Rt(u, Yt(t))),
            (c = vn(u.length, c)),
            (l[a] = !n && (t || (o >= 120 && u.length >= 120)) ? new Kn(a && u) : i));
        }
        u = e[0];
        var h = -1,
          g = l[0];
        e: for (; ++h < o && d.length < c; ) {
          var p = u[h],
            f = t ? t(p) : p;
          if (((p = n || 0 !== p ? p : 0), !(g ? Qt(g, f) : r(d, f, n)))) {
            for (a = s; --a; ) {
              var m = l[a];
              if (!(m ? Qt(m, f) : r(e[a], f, n))) continue e;
            }
            (g && g.push(f), d.push(p));
          }
        }
        return d;
      }
      function Di(e, t, n) {
        var r = null == (e = No(e, (t = vr(t, e)))) ? e : e[Po(Zo(t))];
        return null == r ? i : St(r, e, n);
      }
      function Ti(e) {
        return ea(e) && Si(e) == f;
      }
      function Ii(e, t, n, r, o) {
        return (
          e === t ||
          (null == e || null == t || (!ea(e) && !ea(t))
            ? e != e && t != t
            : (function (e, t, n, r, o, s) {
                var a = zs(e),
                  l = zs(t),
                  c = a ? m : po(e),
                  d = l ? m : po(t),
                  u = (c = c == f ? S : c) == S,
                  h = (d = d == f ? S : d) == S,
                  g = c == d;
                if (g && Ks(e)) {
                  if (!Ks(t)) return !1;
                  ((a = !0), (u = !1));
                }
                if (g && !u)
                  return (
                    s || (s = new Gn()),
                    a || la(e)
                      ? eo(e, t, n, r, o, s)
                      : (function (e, t, n, i, r, o, s) {
                          switch (n) {
                            case R:
                              if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
                                return !1;
                              ((e = e.buffer), (t = t.buffer));
                            case I:
                              return !(e.byteLength != t.byteLength || !o(new ze(e), new ze(t)));
                            case _:
                            case v:
                            case C:
                              return Bs(+e, +t);
                            case b:
                              return e.name == t.name && e.message == t.message;
                            case E:
                            case L:
                              return e == t + "";
                            case w:
                              var a = sn;
                            case N:
                              var l = 1 & i;
                              if ((a || (a = cn), e.size != t.size && !l)) return !1;
                              var c = s.get(e);
                              if (c) return c == t;
                              ((i |= 2), s.set(e, t));
                              var d = eo(a(e), a(t), i, r, o, s);
                              return (s.delete(e), d);
                            case D:
                              if (jn) return jn.call(e) == jn.call(t);
                          }
                          return !1;
                        })(e, t, c, n, r, o, s)
                  );
                if (!(1 & n)) {
                  var p = u && Me.call(e, "__wrapped__"),
                    y = h && Me.call(t, "__wrapped__");
                  if (p || y) {
                    var x = p ? e.value() : e,
                      k = y ? t.value() : t;
                    return (s || (s = new Gn()), o(x, k, n, r, s));
                  }
                }
                if (!g) return !1;
                return (
                  s || (s = new Gn()),
                  (function (e, t, n, r, o, s) {
                    var a = 1 & n,
                      l = no(e),
                      c = l.length,
                      d = no(t),
                      u = d.length;
                    if (c != u && !a) return !1;
                    var h = c;
                    for (; h--; ) {
                      var g = l[h];
                      if (!(a ? g in t : Me.call(t, g))) return !1;
                    }
                    var p = s.get(e),
                      f = s.get(t);
                    if (p && f) return p == t && f == e;
                    var m = !0;
                    (s.set(e, t), s.set(t, e));
                    var _ = a;
                    for (; ++h < c; ) {
                      var v = e[(g = l[h])],
                        b = t[g];
                      if (r) var y = a ? r(b, v, g, t, e, s) : r(v, b, g, e, t, s);
                      if (!(y === i ? v === b || o(v, b, n, r, s) : y)) {
                        m = !1;
                        break;
                      }
                      _ || (_ = "constructor" == g);
                    }
                    if (m && !_) {
                      var x = e.constructor,
                        w = t.constructor;
                      x == w ||
                        !("constructor" in e) ||
                        !("constructor" in t) ||
                        ("function" == typeof x &&
                          x instanceof x &&
                          "function" == typeof w &&
                          w instanceof w) ||
                        (m = !1);
                    }
                    return (s.delete(e), s.delete(t), m);
                  })(e, t, n, r, o, s)
                );
              })(e, t, n, r, Ii, o))
        );
      }
      function Ri(e, t, n, r) {
        var o = n.length,
          s = o,
          a = !r;
        if (null == e) return !s;
        for (e = ke(e); o--; ) {
          var l = n[o];
          if (a && l[2] ? l[1] !== e[l[0]] : !(l[0] in e)) return !1;
        }
        for (; ++o < s; ) {
          var c = (l = n[o])[0],
            d = e[c],
            u = l[1];
          if (a && l[2]) {
            if (d === i && !(c in e)) return !1;
          } else {
            var h = new Gn();
            if (r) var g = r(d, u, c, e, t, h);
            if (!(g === i ? Ii(u, d, 3, r, h) : g)) return !1;
          }
        }
        return !0;
      }
      function Oi(e) {
        return !(!Js(e) || ((t = e), Pe && Pe in t)) && (Ys(e) ? Ve : fe).test(jo(e));
        var t;
      }
      function Mi(e) {
        return "function" == typeof e
          ? e
          : null == e
            ? nl
            : "object" == typeof e
              ? zs(e)
                ? Vi(e[0], e[1])
                : Bi(e)
              : ul(e);
      }
      function Ai(e) {
        if (!Co(e)) return mn(e);
        var t = [];
        for (var n in ke(e)) Me.call(e, n) && "constructor" != n && t.push(n);
        return t;
      }
      function Pi(e) {
        if (!Js(e))
          return (function (e) {
            var t = [];
            if (null != e) for (var n in ke(e)) t.push(n);
            return t;
          })(e);
        var t = Co(e),
          n = [];
        for (var i in e) ("constructor" != i || (!t && Me.call(e, i))) && n.push(i);
        return n;
      }
      function ji(e, t) {
        return e < t;
      }
      function Fi(e, t) {
        var n = -1,
          i = $s(e) ? re(e.length) : [];
        return (
          ui(e, function (e, r, o) {
            i[++n] = t(e, r, o);
          }),
          i
        );
      }
      function Bi(e) {
        var t = co(e);
        return 1 == t.length && t[0][2]
          ? ko(t[0][0], t[0][1])
          : function (n) {
              return n === e || Ri(n, e, t);
            };
      }
      function Vi(e, t) {
        return yo(e) && So(t)
          ? ko(Po(e), t)
          : function (n) {
              var r = ka(n, e);
              return r === i && r === t ? Ea(n, e) : Ii(t, r, 3);
            };
      }
      function Wi(e, t, n, r, o) {
        e !== t &&
          _i(
            t,
            function (s, a) {
              if ((o || (o = new Gn()), Js(s)))
                !(function (e, t, n, r, o, s, a) {
                  var l = Lo(e, n),
                    c = Lo(t, n),
                    d = a.get(c);
                  if (d) return void Jn(e, n, d);
                  var u = s ? s(l, c, n + "", e, t, a) : i,
                    h = u === i;
                  if (h) {
                    var g = zs(c),
                      p = !g && Ks(c),
                      f = !g && !p && la(c);
                    ((u = c),
                      g || p || f
                        ? zs(l)
                          ? (u = l)
                          : qs(l)
                            ? (u = Lr(l))
                            : p
                              ? ((h = !1), (u = wr(c, !0)))
                              : f
                                ? ((h = !1), (u = Sr(c, !0)))
                                : (u = [])
                        : ia(c) || Hs(c)
                          ? ((u = l), Hs(l) ? (u = ma(l)) : (Js(l) && !Ys(l)) || (u = mo(c)))
                          : (h = !1));
                  }
                  h && (a.set(c, u), o(u, c, r, s, a), a.delete(c));
                  Jn(e, n, u);
                })(e, t, a, n, Wi, r, o);
              else {
                var l = r ? r(Lo(e, a), s, a + "", e, t, o) : i;
                (l === i && (l = s), Jn(e, a, l));
              }
            },
            Ia,
          );
      }
      function Hi(e, t) {
        var n = e.length;
        if (n) return vo((t += t < 0 ? n : 0), n) ? e[t] : i;
      }
      function zi(e, t, n) {
        t = t.length
          ? Rt(t, function (e) {
              return zs(e)
                ? function (t) {
                    return wi(t, 1 === e.length ? e[0] : e);
                  }
                : e;
            })
          : [nl];
        var i = -1;
        t = Rt(t, Yt(ao()));
        var r = Fi(e, function (e, n, r) {
          var o = Rt(t, function (t) {
            return t(e);
          });
          return { criteria: o, index: ++i, value: e };
        });
        return (function (e, t) {
          var n = e.length;
          for (e.sort(t); n--; ) e[n] = e[n].value;
          return e;
        })(r, function (e, t) {
          return (function (e, t, n) {
            var i = -1,
              r = e.criteria,
              o = t.criteria,
              s = r.length,
              a = n.length;
            for (; ++i < s; ) {
              var l = kr(r[i], o[i]);
              if (l) return i >= a ? l : l * ("desc" == n[i] ? -1 : 1);
            }
            return e.index - t.index;
          })(e, t, n);
        });
      }
      function Ui(e, t, n) {
        for (var i = -1, r = t.length, o = {}; ++i < r; ) {
          var s = t[i],
            a = wi(e, s);
          n(a, s) && Qi(o, vr(s, e), a);
        }
        return o;
      }
      function $i(e, t, n, i) {
        var r = i ? Wt : Vt,
          o = -1,
          s = t.length,
          a = e;
        for (e === t && (t = Lr(t)), n && (a = Rt(e, Yt(n))); ++o < s; )
          for (var l = 0, c = t[o], d = n ? n(c) : c; (l = r(a, d, l, i)) > -1; )
            (a !== e && Ge.call(a, l, 1), Ge.call(e, l, 1));
        return e;
      }
      function qi(e, t) {
        for (var n = e ? t.length : 0, i = n - 1; n--; ) {
          var r = t[n];
          if (n == i || r !== o) {
            var o = r;
            vo(r) ? Ge.call(e, r, 1) : dr(e, r);
          }
        }
        return e;
      }
      function Ki(e, t) {
        return e + pt(xn() * (t - e + 1));
      }
      function Gi(e, t) {
        var n = "";
        if (!e || t < 1 || t > u) return n;
        do {
          (t % 2 && (n += e), (t = pt(t / 2)) && (e += e));
        } while (t);
        return n;
      }
      function Zi(e, t) {
        return Io(Eo(e, t, nl), e + "");
      }
      function Yi(e) {
        return Yn(Ba(e));
      }
      function Xi(e, t) {
        var n = Ba(e);
        return Mo(n, si(t, 0, n.length));
      }
      function Qi(e, t, n, r) {
        if (!Js(e)) return e;
        for (var o = -1, s = (t = vr(t, e)).length, a = s - 1, l = e; null != l && ++o < s; ) {
          var c = Po(t[o]),
            d = n;
          if ("__proto__" === c || "constructor" === c || "prototype" === c) return e;
          if (o != a) {
            var u = l[c];
            (d = r ? r(u, c, l) : i) === i && (d = Js(u) ? u : vo(t[o + 1]) ? [] : {});
          }
          (ei(l, c, d), (l = l[c]));
        }
        return e;
      }
      var Ji = Dn
          ? function (e, t) {
              return (Dn.set(e, t), e);
            }
          : nl,
        er = tt
          ? function (e, t) {
              return tt(e, "toString", {
                configurable: !0,
                enumerable: !1,
                value: Ja(t),
                writable: !0,
              });
            }
          : nl;
      function tr(e) {
        return Mo(Ba(e));
      }
      function nr(e, t, n) {
        var i = -1,
          r = e.length;
        (t < 0 && (t = -t > r ? 0 : r + t),
          (n = n > r ? r : n) < 0 && (n += r),
          (r = t > n ? 0 : (n - t) >>> 0),
          (t >>>= 0));
        for (var o = re(r); ++i < r; ) o[i] = e[i + t];
        return o;
      }
      function ir(e, t) {
        var n;
        return (
          ui(e, function (e, i, r) {
            return !(n = t(e, i, r));
          }),
          !!n
        );
      }
      function rr(e, t, n) {
        var i = 0,
          r = null == e ? i : e.length;
        if ("number" == typeof t && t == t && r <= 2147483647) {
          for (; i < r; ) {
            var o = (i + r) >>> 1,
              s = e[o];
            null !== s && !aa(s) && (n ? s <= t : s < t) ? (i = o + 1) : (r = o);
          }
          return r;
        }
        return or(e, t, nl, n);
      }
      function or(e, t, n, r) {
        var o = 0,
          s = null == e ? 0 : e.length;
        if (0 === s) return 0;
        for (var a = (t = n(t)) != t, l = null === t, c = aa(t), d = t === i; o < s; ) {
          var u = pt((o + s) / 2),
            h = n(e[u]),
            g = h !== i,
            p = null === h,
            f = h == h,
            m = aa(h);
          if (a) var _ = r || f;
          else
            _ = d
              ? f && (r || g)
              : l
                ? f && g && (r || !p)
                : c
                  ? f && g && !p && (r || !m)
                  : !p && !m && (r ? h <= t : h < t);
          _ ? (o = u + 1) : (s = u);
        }
        return vn(s, 4294967294);
      }
      function sr(e, t) {
        for (var n = -1, i = e.length, r = 0, o = []; ++n < i; ) {
          var s = e[n],
            a = t ? t(s) : s;
          if (!n || !Bs(a, l)) {
            var l = a;
            o[r++] = 0 === s ? 0 : s;
          }
        }
        return o;
      }
      function ar(e) {
        return "number" == typeof e ? e : aa(e) ? h : +e;
      }
      function lr(e) {
        if ("string" == typeof e) return e;
        if (zs(e)) return Rt(e, lr) + "";
        if (aa(e)) return Fn ? Fn.call(e) : "";
        var t = e + "";
        return "0" == t && 1 / e == -1 / 0 ? "-0" : t;
      }
      function cr(e, t, n) {
        var i = -1,
          r = Tt,
          o = e.length,
          s = !0,
          a = [],
          l = a;
        if (n) ((s = !1), (r = It));
        else if (o >= 200) {
          var c = t ? null : Gr(e);
          if (c) return cn(c);
          ((s = !1), (r = Qt), (l = new Kn()));
        } else l = t ? [] : a;
        e: for (; ++i < o; ) {
          var d = e[i],
            u = t ? t(d) : d;
          if (((d = n || 0 !== d ? d : 0), s && u == u)) {
            for (var h = l.length; h--; ) if (l[h] === u) continue e;
            (t && l.push(u), a.push(d));
          } else r(l, u, n) || (l !== a && l.push(u), a.push(d));
        }
        return a;
      }
      function dr(e, t) {
        return null == (e = No(e, (t = vr(t, e)))) || delete e[Po(Zo(t))];
      }
      function ur(e, t, n, i) {
        return Qi(e, t, n(wi(e, t)), i);
      }
      function hr(e, t, n, i) {
        for (var r = e.length, o = i ? r : -1; (i ? o-- : ++o < r) && t(e[o], o, e); );
        return n ? nr(e, i ? 0 : o, i ? o + 1 : r) : nr(e, i ? o + 1 : 0, i ? r : o);
      }
      function gr(e, t) {
        var n = e;
        return (
          n instanceof zn && (n = n.value()),
          Mt(
            t,
            function (e, t) {
              return t.func.apply(t.thisArg, Ot([e], t.args));
            },
            n,
          )
        );
      }
      function pr(e, t, n) {
        var i = e.length;
        if (i < 2) return i ? cr(e[0]) : [];
        for (var r = -1, o = re(i); ++r < i; )
          for (var s = e[r], a = -1; ++a < i; ) a != r && (o[r] = di(o[r] || s, e[a], t, n));
        return cr(mi(o, 1), t, n);
      }
      function fr(e, t, n) {
        for (var r = -1, o = e.length, s = t.length, a = {}; ++r < o; ) {
          var l = r < s ? t[r] : i;
          n(a, e[r], l);
        }
        return a;
      }
      function mr(e) {
        return qs(e) ? e : [];
      }
      function _r(e) {
        return "function" == typeof e ? e : nl;
      }
      function vr(e, t) {
        return zs(e) ? e : yo(e, t) ? [e] : Ao(_a(e));
      }
      var br = Zi;
      function yr(e, t, n) {
        var r = e.length;
        return ((n = n === i ? r : n), !t && n >= r ? e : nr(e, t, n));
      }
      var xr =
        at ||
        function (e) {
          return ht.clearTimeout(e);
        };
      function wr(e, t) {
        if (t) return e.slice();
        var n = e.length,
          i = Ue ? Ue(n) : new e.constructor(n);
        return (e.copy(i), i);
      }
      function Cr(e) {
        var t = new e.constructor(e.byteLength);
        return (new ze(t).set(new ze(e)), t);
      }
      function Sr(e, t) {
        var n = t ? Cr(e.buffer) : e.buffer;
        return new e.constructor(n, e.byteOffset, e.length);
      }
      function kr(e, t) {
        if (e !== t) {
          var n = e !== i,
            r = null === e,
            o = e == e,
            s = aa(e),
            a = t !== i,
            l = null === t,
            c = t == t,
            d = aa(t);
          if (
            (!l && !d && !s && e > t) ||
            (s && a && c && !l && !d) ||
            (r && a && c) ||
            (!n && c) ||
            !o
          )
            return 1;
          if (
            (!r && !s && !d && e < t) ||
            (d && n && o && !r && !s) ||
            (l && n && o) ||
            (!a && o) ||
            !c
          )
            return -1;
        }
        return 0;
      }
      function Er(e, t, n, i) {
        for (
          var r = -1,
            o = e.length,
            s = n.length,
            a = -1,
            l = t.length,
            c = _n(o - s, 0),
            d = re(l + c),
            u = !i;
          ++a < l;
        )
          d[a] = t[a];
        for (; ++r < s; ) (u || r < o) && (d[n[r]] = e[r]);
        for (; c--; ) d[a++] = e[r++];
        return d;
      }
      function Nr(e, t, n, i) {
        for (
          var r = -1,
            o = e.length,
            s = -1,
            a = n.length,
            l = -1,
            c = t.length,
            d = _n(o - a, 0),
            u = re(d + c),
            h = !i;
          ++r < d;
        )
          u[r] = e[r];
        for (var g = r; ++l < c; ) u[g + l] = t[l];
        for (; ++s < a; ) (h || r < o) && (u[g + n[s]] = e[r++]);
        return u;
      }
      function Lr(e, t) {
        var n = -1,
          i = e.length;
        for (t || (t = re(i)); ++n < i; ) t[n] = e[n];
        return t;
      }
      function Dr(e, t, n, r) {
        var o = !n;
        n || (n = {});
        for (var s = -1, a = t.length; ++s < a; ) {
          var l = t[s],
            c = r ? r(n[l], e[l], l, n, e) : i;
          (c === i && (c = e[l]), o ? ri(n, l, c) : ei(n, l, c));
        }
        return n;
      }
      function Tr(e, t) {
        return function (n, i) {
          var r = zs(n) ? kt : ni,
            o = t ? t() : {};
          return r(n, e, ao(i, 2), o);
        };
      }
      function Ir(e) {
        return Zi(function (t, n) {
          var r = -1,
            o = n.length,
            s = o > 1 ? n[o - 1] : i,
            a = o > 2 ? n[2] : i;
          for (
            s = e.length > 3 && "function" == typeof s ? (o--, s) : i,
              a && bo(n[0], n[1], a) && ((s = o < 3 ? i : s), (o = 1)),
              t = ke(t);
            ++r < o;
          ) {
            var l = n[r];
            l && e(t, l, r, s);
          }
          return t;
        });
      }
      function Rr(e, t) {
        return function (n, i) {
          if (null == n) return n;
          if (!$s(n)) return e(n, i);
          for (
            var r = n.length, o = t ? r : -1, s = ke(n);
            (t ? o-- : ++o < r) && !1 !== i(s[o], o, s);
          );
          return n;
        };
      }
      function Or(e) {
        return function (t, n, i) {
          for (var r = -1, o = ke(t), s = i(t), a = s.length; a--; ) {
            var l = s[e ? a : ++r];
            if (!1 === n(o[l], l, o)) break;
          }
          return t;
        };
      }
      function Mr(e) {
        return function (t) {
          var n = on((t = _a(t))) ? hn(t) : i,
            r = n ? n[0] : t.charAt(0),
            o = n ? yr(n, 1).join("") : t.slice(1);
          return r[e]() + o;
        };
      }
      function Ar(e) {
        return function (t) {
          return Mt(Ya(Ha(t).replace(Xe, "")), e, "");
        };
      }
      function Pr(e) {
        return function () {
          var t = arguments;
          switch (t.length) {
            case 0:
              return new e();
            case 1:
              return new e(t[0]);
            case 2:
              return new e(t[0], t[1]);
            case 3:
              return new e(t[0], t[1], t[2]);
            case 4:
              return new e(t[0], t[1], t[2], t[3]);
            case 5:
              return new e(t[0], t[1], t[2], t[3], t[4]);
            case 6:
              return new e(t[0], t[1], t[2], t[3], t[4], t[5]);
            case 7:
              return new e(t[0], t[1], t[2], t[3], t[4], t[5], t[6]);
          }
          var n = Vn(e.prototype),
            i = e.apply(n, t);
          return Js(i) ? i : n;
        };
      }
      function jr(e) {
        return function (t, n, r) {
          var o = ke(t);
          if (!$s(t)) {
            var s = ao(n, 3);
            ((t = Ta(t)),
              (n = function (e) {
                return s(o[e], e, o);
              }));
          }
          var a = e(t, n, r);
          return a > -1 ? o[s ? t[a] : a] : i;
        };
      }
      function Fr(e) {
        return to(function (t) {
          var n = t.length,
            o = n,
            s = Hn.prototype.thru;
          for (e && t.reverse(); o--; ) {
            var a = t[o];
            if ("function" != typeof a) throw new Le(r);
            if (s && !l && "wrapper" == oo(a)) var l = new Hn([], !0);
          }
          for (o = l ? o : n; ++o < n; ) {
            var c = oo((a = t[o])),
              d = "wrapper" == c ? ro(a) : i;
            l =
              d && xo(d[0]) && 424 == d[1] && !d[4].length && 1 == d[9]
                ? l[oo(d[0])].apply(l, d[3])
                : 1 == a.length && xo(a)
                  ? l[c]()
                  : l.thru(a);
          }
          return function () {
            var e = arguments,
              i = e[0];
            if (l && 1 == e.length && zs(i)) return l.plant(i).value();
            for (var r = 0, o = n ? t[r].apply(this, e) : i; ++r < n; ) o = t[r].call(this, o);
            return o;
          };
        });
      }
      function Br(e, t, n, r, o, s, a, c, d, u) {
        var h = t & l,
          g = 1 & t,
          p = 2 & t,
          f = 24 & t,
          m = 512 & t,
          _ = p ? i : Pr(e);
        return function l() {
          for (var v = arguments.length, b = re(v), y = v; y--; ) b[y] = arguments[y];
          if (f)
            var x = so(l),
              w = (function (e, t) {
                for (var n = e.length, i = 0; n--; ) e[n] === t && ++i;
                return i;
              })(b, x);
          if ((r && (b = Er(b, r, o, f)), s && (b = Nr(b, s, a, f)), (v -= w), f && v < u)) {
            var C = ln(b, x);
            return qr(e, t, Br, l.placeholder, n, b, C, c, d, u - v);
          }
          var S = g ? n : this,
            k = p ? S[e] : e;
          return (
            (v = b.length),
            c
              ? (b = (function (e, t) {
                  var n = e.length,
                    r = vn(t.length, n),
                    o = Lr(e);
                  for (; r--; ) {
                    var s = t[r];
                    e[r] = vo(s, n) ? o[s] : i;
                  }
                  return e;
                })(b, c))
              : m && v > 1 && b.reverse(),
            h && d < v && (b.length = d),
            this && this !== ht && this instanceof l && (k = _ || Pr(k)),
            k.apply(S, b)
          );
        };
      }
      function Vr(e, t) {
        return function (n, i) {
          return (function (e, t, n, i) {
            return (
              bi(e, function (e, r, o) {
                t(i, n(e), r, o);
              }),
              i
            );
          })(n, e, t(i), {});
        };
      }
      function Wr(e, t) {
        return function (n, r) {
          var o;
          if (n === i && r === i) return t;
          if ((n !== i && (o = n), r !== i)) {
            if (o === i) return r;
            ("string" == typeof n || "string" == typeof r
              ? ((n = lr(n)), (r = lr(r)))
              : ((n = ar(n)), (r = ar(r))),
              (o = e(n, r)));
          }
          return o;
        };
      }
      function Hr(e) {
        return to(function (t) {
          return (
            (t = Rt(t, Yt(ao()))),
            Zi(function (n) {
              var i = this;
              return e(t, function (e) {
                return St(e, i, n);
              });
            })
          );
        });
      }
      function zr(e, t) {
        var n = (t = t === i ? " " : lr(t)).length;
        if (n < 2) return n ? Gi(t, e) : t;
        var r = Gi(t, gt(e / un(t)));
        return on(t) ? yr(hn(r), 0, e).join("") : r.slice(0, e);
      }
      function Ur(e) {
        return function (t, n, r) {
          return (
            r && "number" != typeof r && bo(t, n, r) && (n = r = i),
            (t = ha(t)),
            n === i ? ((n = t), (t = 0)) : (n = ha(n)),
            (function (e, t, n, i) {
              for (var r = -1, o = _n(gt((t - e) / (n || 1)), 0), s = re(o); o--; )
                ((s[i ? o : ++r] = e), (e += n));
              return s;
            })(t, n, (r = r === i ? (t < n ? 1 : -1) : ha(r)), e)
          );
        };
      }
      function $r(e) {
        return function (t, n) {
          return (
            ("string" == typeof t && "string" == typeof n) || ((t = fa(t)), (n = fa(n))),
            e(t, n)
          );
        };
      }
      function qr(e, t, n, r, o, s, l, c, d, u) {
        var h = 8 & t;
        ((t |= h ? a : 64), 4 & (t &= ~(h ? 64 : a)) || (t &= -4));
        var g = [e, t, o, h ? s : i, h ? l : i, h ? i : s, h ? i : l, c, d, u],
          p = n.apply(i, g);
        return (xo(e) && Do(p, g), (p.placeholder = r), Ro(p, e, t));
      }
      function Kr(e) {
        var t = Se[e];
        return function (e, n) {
          if (((e = fa(e)), (n = null == n ? 0 : vn(ga(n), 292)) && jt(e))) {
            var i = (_a(e) + "e").split("e");
            return +(
              (i = (_a(t(i[0] + "e" + (+i[1] + n))) + "e").split("e"))[0] +
              "e" +
              (+i[1] - n)
            );
          }
          return t(e);
        };
      }
      var Gr =
        En && 1 / cn(new En([, -0]))[1] == d
          ? function (e) {
              return new En(e);
            }
          : al;
      function Zr(e) {
        return function (t) {
          var n = po(t);
          return n == w
            ? sn(t)
            : n == N
              ? dn(t)
              : (function (e, t) {
                  return Rt(t, function (t) {
                    return [t, e[t]];
                  });
                })(t, e(t));
        };
      }
      function Yr(e, t, n, o, d, u, h, g) {
        var p = 2 & t;
        if (!p && "function" != typeof e) throw new Le(r);
        var f = o ? o.length : 0;
        if (
          (f || ((t &= -97), (o = d = i)),
          (h = h === i ? h : _n(ga(h), 0)),
          (g = g === i ? g : ga(g)),
          (f -= d ? d.length : 0),
          64 & t)
        ) {
          var m = o,
            _ = d;
          o = d = i;
        }
        var v = p ? i : ro(e),
          b = [e, t, n, o, d, m, _, u, h, g];
        if (
          (v &&
            (function (e, t) {
              var n = e[1],
                i = t[1],
                r = n | i,
                o = r < 131,
                a =
                  (i == l && 8 == n) ||
                  (i == l && n == c && e[7].length <= t[8]) ||
                  (384 == i && t[7].length <= t[8] && 8 == n);
              if (!o && !a) return e;
              1 & i && ((e[2] = t[2]), (r |= 1 & n ? 0 : 4));
              var d = t[3];
              if (d) {
                var u = e[3];
                ((e[3] = u ? Er(u, d, t[4]) : d), (e[4] = u ? ln(e[3], s) : t[4]));
              }
              (d = t[5]) &&
                ((u = e[5]), (e[5] = u ? Nr(u, d, t[6]) : d), (e[6] = u ? ln(e[5], s) : t[6]));
              (d = t[7]) && (e[7] = d);
              i & l && (e[8] = null == e[8] ? t[8] : vn(e[8], t[8]));
              null == e[9] && (e[9] = t[9]);
              ((e[0] = t[0]), (e[1] = r));
            })(b, v),
          (e = b[0]),
          (t = b[1]),
          (n = b[2]),
          (o = b[3]),
          (d = b[4]),
          !(g = b[9] = b[9] === i ? (p ? 0 : e.length) : _n(b[9] - f, 0)) && 24 & t && (t &= -25),
          t && 1 != t)
        )
          y =
            8 == t || 16 == t
              ? (function (e, t, n) {
                  var r = Pr(e);
                  return function o() {
                    for (var s = arguments.length, a = re(s), l = s, c = so(o); l--; )
                      a[l] = arguments[l];
                    var d = s < 3 && a[0] !== c && a[s - 1] !== c ? [] : ln(a, c);
                    return (s -= d.length) < n
                      ? qr(e, t, Br, o.placeholder, i, a, d, i, i, n - s)
                      : St(this && this !== ht && this instanceof o ? r : e, this, a);
                  };
                })(e, t, g)
              : (t != a && 33 != t) || d.length
                ? Br.apply(i, b)
                : (function (e, t, n, i) {
                    var r = 1 & t,
                      o = Pr(e);
                    return function t() {
                      for (
                        var s = -1,
                          a = arguments.length,
                          l = -1,
                          c = i.length,
                          d = re(c + a),
                          u = this && this !== ht && this instanceof t ? o : e;
                        ++l < c;
                      )
                        d[l] = i[l];
                      for (; a--; ) d[l++] = arguments[++s];
                      return St(u, r ? n : this, d);
                    };
                  })(e, t, n, o);
        else
          var y = (function (e, t, n) {
            var i = 1 & t,
              r = Pr(e);
            return function t() {
              return (this && this !== ht && this instanceof t ? r : e).apply(
                i ? n : this,
                arguments,
              );
            };
          })(e, t, n);
        return Ro((v ? Ji : Do)(y, b), e, t);
      }
      function Xr(e, t, n, r) {
        return e === i || (Bs(e, Ie[n]) && !Me.call(r, n)) ? t : e;
      }
      function Qr(e, t, n, r, o, s) {
        return (Js(e) && Js(t) && (s.set(t, e), Wi(e, t, i, Qr, s), s.delete(t)), e);
      }
      function Jr(e) {
        return ia(e) ? i : e;
      }
      function eo(e, t, n, r, o, s) {
        var a = 1 & n,
          l = e.length,
          c = t.length;
        if (l != c && !(a && c > l)) return !1;
        var d = s.get(e),
          u = s.get(t);
        if (d && u) return d == t && u == e;
        var h = -1,
          g = !0,
          p = 2 & n ? new Kn() : i;
        for (s.set(e, t), s.set(t, e); ++h < l; ) {
          var f = e[h],
            m = t[h];
          if (r) var _ = a ? r(m, f, h, t, e, s) : r(f, m, h, e, t, s);
          if (_ !== i) {
            if (_) continue;
            g = !1;
            break;
          }
          if (p) {
            if (
              !Pt(t, function (e, t) {
                if (!Qt(p, t) && (f === e || o(f, e, n, r, s))) return p.push(t);
              })
            ) {
              g = !1;
              break;
            }
          } else if (f !== m && !o(f, m, n, r, s)) {
            g = !1;
            break;
          }
        }
        return (s.delete(e), s.delete(t), g);
      }
      function to(e) {
        return Io(Eo(e, i, Uo), e + "");
      }
      function no(e) {
        return Ci(e, Ta, ho);
      }
      function io(e) {
        return Ci(e, Ia, go);
      }
      var ro = Dn
        ? function (e) {
            return Dn.get(e);
          }
        : al;
      function oo(e) {
        for (var t = e.name + "", n = Tn[t], i = Me.call(Tn, t) ? n.length : 0; i--; ) {
          var r = n[i],
            o = r.func;
          if (null == o || o == e) return r.name;
        }
        return t;
      }
      function so(e) {
        return (Me.call(Bn, "placeholder") ? Bn : e).placeholder;
      }
      function ao() {
        var e = Bn.iteratee || il;
        return ((e = e === il ? Mi : e), arguments.length ? e(arguments[0], arguments[1]) : e);
      }
      function lo(e, t) {
        var n,
          i,
          r = e.__data__;
        return (
          "string" == (i = typeof (n = t)) || "number" == i || "symbol" == i || "boolean" == i
            ? "__proto__" !== n
            : null === n
        )
          ? r["string" == typeof t ? "string" : "hash"]
          : r.map;
      }
      function co(e) {
        for (var t = Ta(e), n = t.length; n--; ) {
          var i = t[n],
            r = e[i];
          t[n] = [i, r, So(r)];
        }
        return t;
      }
      function uo(e, t) {
        var n = (function (e, t) {
          return null == e ? i : e[t];
        })(e, t);
        return Oi(n) ? n : i;
      }
      var ho = mt
          ? function (e) {
              return null == e
                ? []
                : ((e = ke(e)),
                  Dt(mt(e), function (t) {
                    return Ke.call(e, t);
                  }));
            }
          : pl,
        go = mt
          ? function (e) {
              for (var t = []; e; ) (Ot(t, ho(e)), (e = $e(e)));
              return t;
            }
          : pl,
        po = Si;
      function fo(e, t, n) {
        for (var i = -1, r = (t = vr(t, e)).length, o = !1; ++i < r; ) {
          var s = Po(t[i]);
          if (!(o = null != e && n(e, s))) break;
          e = e[s];
        }
        return o || ++i != r
          ? o
          : !!(r = null == e ? 0 : e.length) && Qs(r) && vo(s, r) && (zs(e) || Hs(e));
      }
      function mo(e) {
        return "function" != typeof e.constructor || Co(e) ? {} : Vn($e(e));
      }
      function _o(e) {
        return zs(e) || Hs(e) || !!(Ze && e && e[Ze]);
      }
      function vo(e, t) {
        var n = typeof e;
        return (
          !!(t = null == t ? u : t) &&
          ("number" == n || ("symbol" != n && _e.test(e))) &&
          e > -1 &&
          e % 1 == 0 &&
          e < t
        );
      }
      function bo(e, t, n) {
        if (!Js(n)) return !1;
        var i = typeof t;
        return (
          !!("number" == i ? $s(n) && vo(t, n.length) : "string" == i && t in n) && Bs(n[t], e)
        );
      }
      function yo(e, t) {
        if (zs(e)) return !1;
        var n = typeof e;
        return (
          !("number" != n && "symbol" != n && "boolean" != n && null != e && !aa(e)) ||
          J.test(e) ||
          !Q.test(e) ||
          (null != t && e in ke(t))
        );
      }
      function xo(e) {
        var t = oo(e),
          n = Bn[t];
        if ("function" != typeof n || !(t in zn.prototype)) return !1;
        if (e === n) return !0;
        var i = ro(n);
        return !!i && e === i[0];
      }
      ((Cn && po(new Cn(new ArrayBuffer(1))) != R) ||
        (Sn && po(new Sn()) != w) ||
        (kn && po(kn.resolve()) != k) ||
        (En && po(new En()) != N) ||
        (Nn && po(new Nn()) != T)) &&
        (po = function (e) {
          var t = Si(e),
            n = t == S ? e.constructor : i,
            r = n ? jo(n) : "";
          if (r)
            switch (r) {
              case In:
                return R;
              case Rn:
                return w;
              case On:
                return k;
              case Mn:
                return N;
              case An:
                return T;
            }
          return t;
        });
      var wo = Re ? Ys : fl;
      function Co(e) {
        var t = e && e.constructor;
        return e === (("function" == typeof t && t.prototype) || Ie);
      }
      function So(e) {
        return e == e && !Js(e);
      }
      function ko(e, t) {
        return function (n) {
          return null != n && n[e] === t && (t !== i || e in ke(n));
        };
      }
      function Eo(e, t, n) {
        return (
          (t = _n(t === i ? e.length - 1 : t, 0)),
          function () {
            for (var i = arguments, r = -1, o = _n(i.length - t, 0), s = re(o); ++r < o; )
              s[r] = i[t + r];
            r = -1;
            for (var a = re(t + 1); ++r < t; ) a[r] = i[r];
            return ((a[t] = n(s)), St(e, this, a));
          }
        );
      }
      function No(e, t) {
        return t.length < 2 ? e : wi(e, nr(t, 0, -1));
      }
      function Lo(e, t) {
        if (("constructor" !== t || "function" != typeof e[t]) && "__proto__" != t) return e[t];
      }
      var Do = Oo(Ji),
        To =
          ut ||
          function (e, t) {
            return ht.setTimeout(e, t);
          },
        Io = Oo(er);
      function Ro(e, t, n) {
        var i = t + "";
        return Io(
          e,
          (function (e, t) {
            var n = t.length;
            if (!n) return e;
            var i = n - 1;
            return (
              (t[i] = (n > 1 ? "& " : "") + t[i]),
              (t = t.join(n > 2 ? ", " : " ")),
              e.replace(oe, "{\n/* [wrapped with " + t + "] */\n")
            );
          })(
            i,
            (function (e, t) {
              return (
                Et(p, function (n) {
                  var i = "_." + n[0];
                  t & n[1] && !Tt(e, i) && e.push(i);
                }),
                e.sort()
              );
            })(
              (function (e) {
                var t = e.match(se);
                return t ? t[1].split(ae) : [];
              })(i),
              n,
            ),
          ),
        );
      }
      function Oo(e) {
        var t = 0,
          n = 0;
        return function () {
          var r = bn(),
            o = 16 - (r - n);
          if (((n = r), o > 0)) {
            if (++t >= 800) return arguments[0];
          } else t = 0;
          return e.apply(i, arguments);
        };
      }
      function Mo(e, t) {
        var n = -1,
          r = e.length,
          o = r - 1;
        for (t = t === i ? r : t; ++n < t; ) {
          var s = Ki(n, o),
            a = e[s];
          ((e[s] = e[n]), (e[n] = a));
        }
        return ((e.length = t), e);
      }
      var Ao = (function (e) {
        var t = Os(e, function (e) {
            return (500 === n.size && n.clear(), e);
          }),
          n = t.cache;
        return t;
      })(function (e) {
        var t = [];
        return (
          46 === e.charCodeAt(0) && t.push(""),
          e.replace(ee, function (e, n, i, r) {
            t.push(i ? r.replace(de, "$1") : n || e);
          }),
          t
        );
      });
      function Po(e) {
        if ("string" == typeof e || aa(e)) return e;
        var t = e + "";
        return "0" == t && 1 / e == -1 / 0 ? "-0" : t;
      }
      function jo(e) {
        if (null != e) {
          try {
            return Oe.call(e);
          } catch (spt) {}
          try {
            return e + "";
          } catch (spt) {}
        }
        return "";
      }
      function Fo(e) {
        if (e instanceof zn) return e.clone();
        var t = new Hn(e.__wrapped__, e.__chain__);
        return (
          (t.__actions__ = Lr(e.__actions__)),
          (t.__index__ = e.__index__),
          (t.__values__ = e.__values__),
          t
        );
      }
      var Bo = Zi(function (e, t) {
          return qs(e) ? di(e, mi(t, 1, qs, !0)) : [];
        }),
        Vo = Zi(function (e, t) {
          var n = Zo(t);
          return (qs(n) && (n = i), qs(e) ? di(e, mi(t, 1, qs, !0), ao(n, 2)) : []);
        }),
        Wo = Zi(function (e, t) {
          var n = Zo(t);
          return (qs(n) && (n = i), qs(e) ? di(e, mi(t, 1, qs, !0), i, n) : []);
        });
      function Ho(e, t, n) {
        var i = null == e ? 0 : e.length;
        if (!i) return -1;
        var r = null == n ? 0 : ga(n);
        return (r < 0 && (r = _n(i + r, 0)), Bt(e, ao(t, 3), r));
      }
      function zo(e, t, n) {
        var r = null == e ? 0 : e.length;
        if (!r) return -1;
        var o = r - 1;
        return (
          n !== i && ((o = ga(n)), (o = n < 0 ? _n(r + o, 0) : vn(o, r - 1))),
          Bt(e, ao(t, 3), o, !0)
        );
      }
      function Uo(e) {
        return (null == e ? 0 : e.length) ? mi(e, 1) : [];
      }
      function $o(e) {
        return e && e.length ? e[0] : i;
      }
      var qo = Zi(function (e) {
          var t = Rt(e, mr);
          return t.length && t[0] === e[0] ? Li(t) : [];
        }),
        Ko = Zi(function (e) {
          var t = Zo(e),
            n = Rt(e, mr);
          return (
            t === Zo(n) ? (t = i) : n.pop(),
            n.length && n[0] === e[0] ? Li(n, ao(t, 2)) : []
          );
        }),
        Go = Zi(function (e) {
          var t = Zo(e),
            n = Rt(e, mr);
          return (
            (t = "function" == typeof t ? t : i) && n.pop(),
            n.length && n[0] === e[0] ? Li(n, i, t) : []
          );
        });
      function Zo(e) {
        var t = null == e ? 0 : e.length;
        return t ? e[t - 1] : i;
      }
      var Yo = Zi(Xo);
      function Xo(e, t) {
        return e && e.length && t && t.length ? $i(e, t) : e;
      }
      var Qo = to(function (e, t) {
        var n = null == e ? 0 : e.length,
          i = oi(e, t);
        return (
          qi(
            e,
            Rt(t, function (e) {
              return vo(e, n) ? +e : e;
            }).sort(kr),
          ),
          i
        );
      });
      function Jo(e) {
        return null == e ? e : wn.call(e);
      }
      var es = Zi(function (e) {
          return cr(mi(e, 1, qs, !0));
        }),
        ts = Zi(function (e) {
          var t = Zo(e);
          return (qs(t) && (t = i), cr(mi(e, 1, qs, !0), ao(t, 2)));
        }),
        ns = Zi(function (e) {
          var t = Zo(e);
          return ((t = "function" == typeof t ? t : i), cr(mi(e, 1, qs, !0), i, t));
        });
      function is(e) {
        if (!e || !e.length) return [];
        var t = 0;
        return (
          (e = Dt(e, function (e) {
            if (qs(e)) return ((t = _n(e.length, t)), !0);
          })),
          Gt(t, function (t) {
            return Rt(e, Ut(t));
          })
        );
      }
      function rs(e, t) {
        if (!e || !e.length) return [];
        var n = is(e);
        return null == t
          ? n
          : Rt(n, function (e) {
              return St(t, i, e);
            });
      }
      var os = Zi(function (e, t) {
          return qs(e) ? di(e, t) : [];
        }),
        ss = Zi(function (e) {
          return pr(Dt(e, qs));
        }),
        as = Zi(function (e) {
          var t = Zo(e);
          return (qs(t) && (t = i), pr(Dt(e, qs), ao(t, 2)));
        }),
        ls = Zi(function (e) {
          var t = Zo(e);
          return ((t = "function" == typeof t ? t : i), pr(Dt(e, qs), i, t));
        }),
        cs = Zi(is);
      var ds = Zi(function (e) {
        var t = e.length,
          n = t > 1 ? e[t - 1] : i;
        return ((n = "function" == typeof n ? (e.pop(), n) : i), rs(e, n));
      });
      function us(e) {
        var t = Bn(e);
        return ((t.__chain__ = !0), t);
      }
      function hs(e, t) {
        return t(e);
      }
      var gs = to(function (e) {
        var t = e.length,
          n = t ? e[0] : 0,
          r = this.__wrapped__,
          o = function (t) {
            return oi(t, e);
          };
        return !(t > 1 || this.__actions__.length) && r instanceof zn && vo(n)
          ? ((r = r.slice(n, +n + (t ? 1 : 0))).__actions__.push({
              func: hs,
              args: [o],
              thisArg: i,
            }),
            new Hn(r, this.__chain__).thru(function (e) {
              return (t && !e.length && e.push(i), e);
            }))
          : this.thru(o);
      });
      var ps = Tr(function (e, t, n) {
        Me.call(e, n) ? ++e[n] : ri(e, n, 1);
      });
      var fs = jr(Ho),
        ms = jr(zo);
      function _s(e, t) {
        return (zs(e) ? Et : ui)(e, ao(t, 3));
      }
      function vs(e, t) {
        return (zs(e) ? Nt : hi)(e, ao(t, 3));
      }
      var bs = Tr(function (e, t, n) {
        Me.call(e, n) ? e[n].push(t) : ri(e, n, [t]);
      });
      var ys = Zi(function (e, t, n) {
          var i = -1,
            r = "function" == typeof t,
            o = $s(e) ? re(e.length) : [];
          return (
            ui(e, function (e) {
              o[++i] = r ? St(t, e, n) : Di(e, t, n);
            }),
            o
          );
        }),
        xs = Tr(function (e, t, n) {
          ri(e, n, t);
        });
      function ws(e, t) {
        return (zs(e) ? Rt : Fi)(e, ao(t, 3));
      }
      var Cs = Tr(
        function (e, t, n) {
          e[n ? 0 : 1].push(t);
        },
        function () {
          return [[], []];
        },
      );
      var Ss = Zi(function (e, t) {
          if (null == e) return [];
          var n = t.length;
          return (
            n > 1 && bo(e, t[0], t[1]) ? (t = []) : n > 2 && bo(t[0], t[1], t[2]) && (t = [t[0]]),
            zi(e, mi(t, 1), [])
          );
        }),
        ks =
          dt ||
          function () {
            return ht.Date.now();
          };
      function Es(e, t, n) {
        return ((t = n ? i : t), (t = e && null == t ? e.length : t), Yr(e, l, i, i, i, i, t));
      }
      function Ns(e, t) {
        var n;
        if ("function" != typeof t) throw new Le(r);
        return (
          (e = ga(e)),
          function () {
            return (--e > 0 && (n = t.apply(this, arguments)), e <= 1 && (t = i), n);
          }
        );
      }
      var Ls = Zi(function (e, t, n) {
          var i = 1;
          if (n.length) {
            var r = ln(n, so(Ls));
            i |= a;
          }
          return Yr(e, i, t, n, r);
        }),
        Ds = Zi(function (e, t, n) {
          var i = 3;
          if (n.length) {
            var r = ln(n, so(Ds));
            i |= a;
          }
          return Yr(t, i, e, n, r);
        });
      function Ts(e, t, n) {
        var o,
          s,
          a,
          l,
          c,
          d,
          u = 0,
          h = !1,
          g = !1,
          p = !0;
        if ("function" != typeof e) throw new Le(r);
        function f(t) {
          var n = o,
            r = s;
          return ((o = s = i), (u = t), (l = e.apply(r, n)));
        }
        function m(e) {
          var n = e - d;
          return d === i || n >= t || n < 0 || (g && e - u >= a);
        }
        function _() {
          var e = ks();
          if (m(e)) return v(e);
          c = To(
            _,
            (function (e) {
              var n = t - (e - d);
              return g ? vn(n, a - (e - u)) : n;
            })(e),
          );
        }
        function v(e) {
          return ((c = i), p && o ? f(e) : ((o = s = i), l));
        }
        function b() {
          var e = ks(),
            n = m(e);
          if (((o = arguments), (s = this), (d = e), n)) {
            if (c === i)
              return (function (e) {
                return ((u = e), (c = To(_, t)), h ? f(e) : l);
              })(d);
            if (g) return (xr(c), (c = To(_, t)), f(d));
          }
          return (c === i && (c = To(_, t)), l);
        }
        return (
          (t = fa(t) || 0),
          Js(n) &&
            ((h = !!n.leading),
            (a = (g = "maxWait" in n) ? _n(fa(n.maxWait) || 0, t) : a),
            (p = "trailing" in n ? !!n.trailing : p)),
          (b.cancel = function () {
            (c !== i && xr(c), (u = 0), (o = d = s = c = i));
          }),
          (b.flush = function () {
            return c === i ? l : v(ks());
          }),
          b
        );
      }
      var Is = Zi(function (e, t) {
          return ci(e, 1, t);
        }),
        Rs = Zi(function (e, t, n) {
          return ci(e, fa(t) || 0, n);
        });
      function Os(e, t) {
        if ("function" != typeof e || (null != t && "function" != typeof t)) throw new Le(r);
        var n = function () {
          var i = arguments,
            r = t ? t.apply(this, i) : i[0],
            o = n.cache;
          if (o.has(r)) return o.get(r);
          var s = e.apply(this, i);
          return ((n.cache = o.set(r, s) || o), s);
        };
        return ((n.cache = new (Os.Cache || qn)()), n);
      }
      function Ms(e) {
        if ("function" != typeof e) throw new Le(r);
        return function () {
          var t = arguments;
          switch (t.length) {
            case 0:
              return !e.call(this);
            case 1:
              return !e.call(this, t[0]);
            case 2:
              return !e.call(this, t[0], t[1]);
            case 3:
              return !e.call(this, t[0], t[1], t[2]);
          }
          return !e.apply(this, t);
        };
      }
      Os.Cache = qn;
      var As = br(function (e, t) {
          var n = (t = 1 == t.length && zs(t[0]) ? Rt(t[0], Yt(ao())) : Rt(mi(t, 1), Yt(ao())))
            .length;
          return Zi(function (i) {
            for (var r = -1, o = vn(i.length, n); ++r < o; ) i[r] = t[r].call(this, i[r]);
            return St(e, this, i);
          });
        }),
        Ps = Zi(function (e, t) {
          var n = ln(t, so(Ps));
          return Yr(e, a, i, t, n);
        }),
        js = Zi(function (e, t) {
          var n = ln(t, so(js));
          return Yr(e, 64, i, t, n);
        }),
        Fs = to(function (e, t) {
          return Yr(e, c, i, i, i, t);
        });
      function Bs(e, t) {
        return e === t || (e != e && t != t);
      }
      var Vs = $r(ki),
        Ws = $r(function (e, t) {
          return e >= t;
        }),
        Hs = Ti(
          (function () {
            return arguments;
          })(),
        )
          ? Ti
          : function (e) {
              return ea(e) && Me.call(e, "callee") && !Ke.call(e, "callee");
            },
        zs = re.isArray,
        Us = vt
          ? Yt(vt)
          : function (e) {
              return ea(e) && Si(e) == I;
            };
      function $s(e) {
        return null != e && Qs(e.length) && !Ys(e);
      }
      function qs(e) {
        return ea(e) && $s(e);
      }
      var Ks = _t || fl,
        Gs = bt
          ? Yt(bt)
          : function (e) {
              return ea(e) && Si(e) == v;
            };
      function Zs(e) {
        if (!ea(e)) return !1;
        var t = Si(e);
        return (
          t == b ||
          "[object DOMException]" == t ||
          ("string" == typeof e.message && "string" == typeof e.name && !ia(e))
        );
      }
      function Ys(e) {
        if (!Js(e)) return !1;
        var t = Si(e);
        return t == y || t == x || "[object AsyncFunction]" == t || "[object Proxy]" == t;
      }
      function Xs(e) {
        return "number" == typeof e && e == ga(e);
      }
      function Qs(e) {
        return "number" == typeof e && e > -1 && e % 1 == 0 && e <= u;
      }
      function Js(e) {
        var t = typeof e;
        return null != e && ("object" == t || "function" == t);
      }
      function ea(e) {
        return null != e && "object" == typeof e;
      }
      var ta = yt
        ? Yt(yt)
        : function (e) {
            return ea(e) && po(e) == w;
          };
      function na(e) {
        return "number" == typeof e || (ea(e) && Si(e) == C);
      }
      function ia(e) {
        if (!ea(e) || Si(e) != S) return !1;
        var t = $e(e);
        if (null === t) return !0;
        var n = Me.call(t, "constructor") && t.constructor;
        return "function" == typeof n && n instanceof n && Oe.call(n) == Fe;
      }
      var ra = xt
        ? Yt(xt)
        : function (e) {
            return ea(e) && Si(e) == E;
          };
      var oa = wt
        ? Yt(wt)
        : function (e) {
            return ea(e) && po(e) == N;
          };
      function sa(e) {
        return "string" == typeof e || (!zs(e) && ea(e) && Si(e) == L);
      }
      function aa(e) {
        return "symbol" == typeof e || (ea(e) && Si(e) == D);
      }
      var la = Ct
        ? Yt(Ct)
        : function (e) {
            return ea(e) && Qs(e.length) && !!ot[Si(e)];
          };
      var ca = $r(ji),
        da = $r(function (e, t) {
          return e <= t;
        });
      function ua(e) {
        if (!e) return [];
        if ($s(e)) return sa(e) ? hn(e) : Lr(e);
        if (Ye && e[Ye])
          return (function (e) {
            for (var t, n = []; !(t = e.next()).done; ) n.push(t.value);
            return n;
          })(e[Ye]());
        var t = po(e);
        return (t == w ? sn : t == N ? cn : Ba)(e);
      }
      function ha(e) {
        return e
          ? (e = fa(e)) === d || e === -1 / 0
            ? 17976931348623157e292 * (e < 0 ? -1 : 1)
            : e == e
              ? e
              : 0
          : 0 === e
            ? e
            : 0;
      }
      function ga(e) {
        var t = ha(e),
          n = t % 1;
        return t == t ? (n ? t - n : t) : 0;
      }
      function pa(e) {
        return e ? si(ga(e), 0, g) : 0;
      }
      function fa(e) {
        if ("number" == typeof e) return e;
        if (aa(e)) return h;
        if (Js(e)) {
          var t = "function" == typeof e.valueOf ? e.valueOf() : e;
          e = Js(t) ? t + "" : t;
        }
        if ("string" != typeof e) return 0 === e ? e : +e;
        e = Zt(e);
        var n = pe.test(e);
        return n || me.test(e) ? ct(e.slice(2), n ? 2 : 8) : ge.test(e) ? h : +e;
      }
      function ma(e) {
        return Dr(e, Ia(e));
      }
      function _a(e) {
        return null == e ? "" : lr(e);
      }
      var va = Ir(function (e, t) {
          if (Co(t) || $s(t)) Dr(t, Ta(t), e);
          else for (var n in t) Me.call(t, n) && ei(e, n, t[n]);
        }),
        ba = Ir(function (e, t) {
          Dr(t, Ia(t), e);
        }),
        ya = Ir(function (e, t, n, i) {
          Dr(t, Ia(t), e, i);
        }),
        xa = Ir(function (e, t, n, i) {
          Dr(t, Ta(t), e, i);
        }),
        wa = to(oi);
      var Ca = Zi(function (e, t) {
          e = ke(e);
          var n = -1,
            r = t.length,
            o = r > 2 ? t[2] : i;
          for (o && bo(t[0], t[1], o) && (r = 1); ++n < r; )
            for (var s = t[n], a = Ia(s), l = -1, c = a.length; ++l < c; ) {
              var d = a[l],
                u = e[d];
              (u === i || (Bs(u, Ie[d]) && !Me.call(e, d))) && (e[d] = s[d]);
            }
          return e;
        }),
        Sa = Zi(function (e) {
          return (e.push(i, Qr), St(Oa, i, e));
        });
      function ka(e, t, n) {
        var r = null == e ? i : wi(e, t);
        return r === i ? n : r;
      }
      function Ea(e, t) {
        return null != e && fo(e, t, Ni);
      }
      var Na = Vr(function (e, t, n) {
          (null != t && "function" != typeof t.toString && (t = je.call(t)), (e[t] = n));
        }, Ja(nl)),
        La = Vr(function (e, t, n) {
          (null != t && "function" != typeof t.toString && (t = je.call(t)),
            Me.call(e, t) ? e[t].push(n) : (e[t] = [n]));
        }, ao),
        Da = Zi(Di);
      function Ta(e) {
        return $s(e) ? Zn(e) : Ai(e);
      }
      function Ia(e) {
        return $s(e) ? Zn(e, !0) : Pi(e);
      }
      var Ra = Ir(function (e, t, n) {
          Wi(e, t, n);
        }),
        Oa = Ir(function (e, t, n, i) {
          Wi(e, t, n, i);
        }),
        Ma = to(function (e, t) {
          var n = {};
          if (null == e) return n;
          var i = !1;
          ((t = Rt(t, function (t) {
            return ((t = vr(t, e)), i || (i = t.length > 1), t);
          })),
            Dr(e, io(e), n),
            i && (n = ai(n, 7, Jr)));
          for (var r = t.length; r--; ) dr(n, t[r]);
          return n;
        });
      var Aa = to(function (e, t) {
        return null == e
          ? {}
          : (function (e, t) {
              return Ui(e, t, function (t, n) {
                return Ea(e, n);
              });
            })(e, t);
      });
      function Pa(e, t) {
        if (null == e) return {};
        var n = Rt(io(e), function (e) {
          return [e];
        });
        return (
          (t = ao(t)),
          Ui(e, n, function (e, n) {
            return t(e, n[0]);
          })
        );
      }
      var ja = Zr(Ta),
        Fa = Zr(Ia);
      function Ba(e) {
        return null == e ? [] : Xt(e, Ta(e));
      }
      var Va = Ar(function (e, t, n) {
        return ((t = t.toLowerCase()), e + (n ? Wa(t) : t));
      });
      function Wa(e) {
        return Za(_a(e).toLowerCase());
      }
      function Ha(e) {
        return (e = _a(e)) && e.replace(ve, tn).replace(Qe, "");
      }
      var za = Ar(function (e, t, n) {
          return e + (n ? "-" : "") + t.toLowerCase();
        }),
        Ua = Ar(function (e, t, n) {
          return e + (n ? " " : "") + t.toLowerCase();
        }),
        $a = Mr("toLowerCase");
      var qa = Ar(function (e, t, n) {
        return e + (n ? "_" : "") + t.toLowerCase();
      });
      var Ka = Ar(function (e, t, n) {
        return e + (n ? " " : "") + Za(t);
      });
      var Ga = Ar(function (e, t, n) {
          return e + (n ? " " : "") + t.toUpperCase();
        }),
        Za = Mr("toUpperCase");
      function Ya(e, t, n) {
        return (
          (e = _a(e)),
          (t = n ? i : t) === i
            ? (function (e) {
                return nt.test(e);
              })(e)
              ? (function (e) {
                  return e.match(et) || [];
                })(e)
              : (function (e) {
                  return e.match(le) || [];
                })(e)
            : e.match(t) || []
        );
      }
      var Xa = Zi(function (e, t) {
          try {
            return St(e, i, t);
          } catch (spt) {
            return Zs(spt) ? spt : new we(spt);
          }
        }),
        Qa = to(function (e, t) {
          return (
            Et(t, function (t) {
              ((t = Po(t)), ri(e, t, Ls(e[t], e)));
            }),
            e
          );
        });
      function Ja(e) {
        return function () {
          return e;
        };
      }
      var el = Fr(),
        tl = Fr(!0);
      function nl(e) {
        return e;
      }
      function il(e) {
        return Mi("function" == typeof e ? e : ai(e, 1));
      }
      var rl = Zi(function (e, t) {
          return function (n) {
            return Di(n, e, t);
          };
        }),
        ol = Zi(function (e, t) {
          return function (n) {
            return Di(e, n, t);
          };
        });
      function sl(e, t, n) {
        var i = Ta(t),
          r = xi(t, i);
        null != n ||
          (Js(t) && (r.length || !i.length)) ||
          ((n = t), (t = e), (e = this), (r = xi(t, Ta(t))));
        var o = !(Js(n) && "chain" in n && !n.chain),
          s = Ys(e);
        return (
          Et(r, function (n) {
            var i = t[n];
            ((e[n] = i),
              s &&
                (e.prototype[n] = function () {
                  var t = this.__chain__;
                  if (o || t) {
                    var n = e(this.__wrapped__);
                    return (
                      (n.__actions__ = Lr(this.__actions__)).push({
                        func: i,
                        args: arguments,
                        thisArg: e,
                      }),
                      (n.__chain__ = t),
                      n
                    );
                  }
                  return i.apply(e, Ot([this.value()], arguments));
                }));
          }),
          e
        );
      }
      function al() {}
      var ll = Hr(Rt),
        cl = Hr(Lt),
        dl = Hr(Pt);
      function ul(e) {
        return yo(e)
          ? Ut(Po(e))
          : (function (e) {
              return function (t) {
                return wi(t, e);
              };
            })(e);
      }
      var hl = Ur(),
        gl = Ur(!0);
      function pl() {
        return [];
      }
      function fl() {
        return !1;
      }
      var ml = Wr(function (e, t) {
          return e + t;
        }, 0),
        _l = Kr("ceil"),
        vl = Wr(function (e, t) {
          return e / t;
        }, 1),
        bl = Kr("floor");
      var yl,
        xl = Wr(function (e, t) {
          return e * t;
        }, 1),
        wl = Kr("round"),
        Cl = Wr(function (e, t) {
          return e - t;
        }, 0);
      return (
        (Bn.after = function (e, t) {
          if ("function" != typeof t) throw new Le(r);
          return (
            (e = ga(e)),
            function () {
              if (--e < 1) return t.apply(this, arguments);
            }
          );
        }),
        (Bn.ary = Es),
        (Bn.assign = va),
        (Bn.assignIn = ba),
        (Bn.assignInWith = ya),
        (Bn.assignWith = xa),
        (Bn.at = wa),
        (Bn.before = Ns),
        (Bn.bind = Ls),
        (Bn.bindAll = Qa),
        (Bn.bindKey = Ds),
        (Bn.castArray = function () {
          if (!arguments.length) return [];
          var e = arguments[0];
          return zs(e) ? e : [e];
        }),
        (Bn.chain = us),
        (Bn.chunk = function (e, t, n) {
          t = (n ? bo(e, t, n) : t === i) ? 1 : _n(ga(t), 0);
          var r = null == e ? 0 : e.length;
          if (!r || t < 1) return [];
          for (var o = 0, s = 0, a = re(gt(r / t)); o < r; ) a[s++] = nr(e, o, (o += t));
          return a;
        }),
        (Bn.compact = function (e) {
          for (var t = -1, n = null == e ? 0 : e.length, i = 0, r = []; ++t < n; ) {
            var o = e[t];
            o && (r[i++] = o);
          }
          return r;
        }),
        (Bn.concat = function () {
          var e = arguments.length;
          if (!e) return [];
          for (var t = re(e - 1), n = arguments[0], i = e; i--; ) t[i - 1] = arguments[i];
          return Ot(zs(n) ? Lr(n) : [n], mi(t, 1));
        }),
        (Bn.cond = function (e) {
          var t = null == e ? 0 : e.length,
            n = ao();
          return (
            (e = t
              ? Rt(e, function (e) {
                  if ("function" != typeof e[1]) throw new Le(r);
                  return [n(e[0]), e[1]];
                })
              : []),
            Zi(function (n) {
              for (var i = -1; ++i < t; ) {
                var r = e[i];
                if (St(r[0], this, n)) return St(r[1], this, n);
              }
            })
          );
        }),
        (Bn.conforms = function (e) {
          return (function (e) {
            var t = Ta(e);
            return function (n) {
              return li(n, e, t);
            };
          })(ai(e, 1));
        }),
        (Bn.constant = Ja),
        (Bn.countBy = ps),
        (Bn.create = function (e, t) {
          var n = Vn(e);
          return null == t ? n : ii(n, t);
        }),
        (Bn.curry = function e(t, n, r) {
          var o = Yr(t, 8, i, i, i, i, i, (n = r ? i : n));
          return ((o.placeholder = e.placeholder), o);
        }),
        (Bn.curryRight = function e(t, n, r) {
          var o = Yr(t, 16, i, i, i, i, i, (n = r ? i : n));
          return ((o.placeholder = e.placeholder), o);
        }),
        (Bn.debounce = Ts),
        (Bn.defaults = Ca),
        (Bn.defaultsDeep = Sa),
        (Bn.defer = Is),
        (Bn.delay = Rs),
        (Bn.difference = Bo),
        (Bn.differenceBy = Vo),
        (Bn.differenceWith = Wo),
        (Bn.drop = function (e, t, n) {
          var r = null == e ? 0 : e.length;
          return r ? nr(e, (t = n || t === i ? 1 : ga(t)) < 0 ? 0 : t, r) : [];
        }),
        (Bn.dropRight = function (e, t, n) {
          var r = null == e ? 0 : e.length;
          return r ? nr(e, 0, (t = r - (t = n || t === i ? 1 : ga(t))) < 0 ? 0 : t) : [];
        }),
        (Bn.dropRightWhile = function (e, t) {
          return e && e.length ? hr(e, ao(t, 3), !0, !0) : [];
        }),
        (Bn.dropWhile = function (e, t) {
          return e && e.length ? hr(e, ao(t, 3), !0) : [];
        }),
        (Bn.fill = function (e, t, n, r) {
          var o = null == e ? 0 : e.length;
          return o
            ? (n && "number" != typeof n && bo(e, t, n) && ((n = 0), (r = o)),
              (function (e, t, n, r) {
                var o = e.length;
                for (
                  (n = ga(n)) < 0 && (n = -n > o ? 0 : o + n),
                    (r = r === i || r > o ? o : ga(r)) < 0 && (r += o),
                    r = n > r ? 0 : pa(r);
                  n < r;
                )
                  e[n++] = t;
                return e;
              })(e, t, n, r))
            : [];
        }),
        (Bn.filter = function (e, t) {
          return (zs(e) ? Dt : fi)(e, ao(t, 3));
        }),
        (Bn.flatMap = function (e, t) {
          return mi(ws(e, t), 1);
        }),
        (Bn.flatMapDeep = function (e, t) {
          return mi(ws(e, t), d);
        }),
        (Bn.flatMapDepth = function (e, t, n) {
          return ((n = n === i ? 1 : ga(n)), mi(ws(e, t), n));
        }),
        (Bn.flatten = Uo),
        (Bn.flattenDeep = function (e) {
          return (null == e ? 0 : e.length) ? mi(e, d) : [];
        }),
        (Bn.flattenDepth = function (e, t) {
          return (null == e ? 0 : e.length) ? mi(e, (t = t === i ? 1 : ga(t))) : [];
        }),
        (Bn.flip = function (e) {
          return Yr(e, 512);
        }),
        (Bn.flow = el),
        (Bn.flowRight = tl),
        (Bn.fromPairs = function (e) {
          for (var t = -1, n = null == e ? 0 : e.length, i = {}; ++t < n; ) {
            var r = e[t];
            i[r[0]] = r[1];
          }
          return i;
        }),
        (Bn.functions = function (e) {
          return null == e ? [] : xi(e, Ta(e));
        }),
        (Bn.functionsIn = function (e) {
          return null == e ? [] : xi(e, Ia(e));
        }),
        (Bn.groupBy = bs),
        (Bn.initial = function (e) {
          return (null == e ? 0 : e.length) ? nr(e, 0, -1) : [];
        }),
        (Bn.intersection = qo),
        (Bn.intersectionBy = Ko),
        (Bn.intersectionWith = Go),
        (Bn.invert = Na),
        (Bn.invertBy = La),
        (Bn.invokeMap = ys),
        (Bn.iteratee = il),
        (Bn.keyBy = xs),
        (Bn.keys = Ta),
        (Bn.keysIn = Ia),
        (Bn.map = ws),
        (Bn.mapKeys = function (e, t) {
          var n = {};
          return (
            (t = ao(t, 3)),
            bi(e, function (e, i, r) {
              ri(n, t(e, i, r), e);
            }),
            n
          );
        }),
        (Bn.mapValues = function (e, t) {
          var n = {};
          return (
            (t = ao(t, 3)),
            bi(e, function (e, i, r) {
              ri(n, i, t(e, i, r));
            }),
            n
          );
        }),
        (Bn.matches = function (e) {
          return Bi(ai(e, 1));
        }),
        (Bn.matchesProperty = function (e, t) {
          return Vi(e, ai(t, 1));
        }),
        (Bn.memoize = Os),
        (Bn.merge = Ra),
        (Bn.mergeWith = Oa),
        (Bn.method = rl),
        (Bn.methodOf = ol),
        (Bn.mixin = sl),
        (Bn.negate = Ms),
        (Bn.nthArg = function (e) {
          return (
            (e = ga(e)),
            Zi(function (t) {
              return Hi(t, e);
            })
          );
        }),
        (Bn.omit = Ma),
        (Bn.omitBy = function (e, t) {
          return Pa(e, Ms(ao(t)));
        }),
        (Bn.once = function (e) {
          return Ns(2, e);
        }),
        (Bn.orderBy = function (e, t, n, r) {
          return null == e
            ? []
            : (zs(t) || (t = null == t ? [] : [t]),
              zs((n = r ? i : n)) || (n = null == n ? [] : [n]),
              zi(e, t, n));
        }),
        (Bn.over = ll),
        (Bn.overArgs = As),
        (Bn.overEvery = cl),
        (Bn.overSome = dl),
        (Bn.partial = Ps),
        (Bn.partialRight = js),
        (Bn.partition = Cs),
        (Bn.pick = Aa),
        (Bn.pickBy = Pa),
        (Bn.property = ul),
        (Bn.propertyOf = function (e) {
          return function (t) {
            return null == e ? i : wi(e, t);
          };
        }),
        (Bn.pull = Yo),
        (Bn.pullAll = Xo),
        (Bn.pullAllBy = function (e, t, n) {
          return e && e.length && t && t.length ? $i(e, t, ao(n, 2)) : e;
        }),
        (Bn.pullAllWith = function (e, t, n) {
          return e && e.length && t && t.length ? $i(e, t, i, n) : e;
        }),
        (Bn.pullAt = Qo),
        (Bn.range = hl),
        (Bn.rangeRight = gl),
        (Bn.rearg = Fs),
        (Bn.reject = function (e, t) {
          return (zs(e) ? Dt : fi)(e, Ms(ao(t, 3)));
        }),
        (Bn.remove = function (e, t) {
          var n = [];
          if (!e || !e.length) return n;
          var i = -1,
            r = [],
            o = e.length;
          for (t = ao(t, 3); ++i < o; ) {
            var s = e[i];
            t(s, i, e) && (n.push(s), r.push(i));
          }
          return (qi(e, r), n);
        }),
        (Bn.rest = function (e, t) {
          if ("function" != typeof e) throw new Le(r);
          return Zi(e, (t = t === i ? t : ga(t)));
        }),
        (Bn.reverse = Jo),
        (Bn.sampleSize = function (e, t, n) {
          return ((t = (n ? bo(e, t, n) : t === i) ? 1 : ga(t)), (zs(e) ? Xn : Xi)(e, t));
        }),
        (Bn.set = function (e, t, n) {
          return null == e ? e : Qi(e, t, n);
        }),
        (Bn.setWith = function (e, t, n, r) {
          return ((r = "function" == typeof r ? r : i), null == e ? e : Qi(e, t, n, r));
        }),
        (Bn.shuffle = function (e) {
          return (zs(e) ? Qn : tr)(e);
        }),
        (Bn.slice = function (e, t, n) {
          var r = null == e ? 0 : e.length;
          return r
            ? (n && "number" != typeof n && bo(e, t, n)
                ? ((t = 0), (n = r))
                : ((t = null == t ? 0 : ga(t)), (n = n === i ? r : ga(n))),
              nr(e, t, n))
            : [];
        }),
        (Bn.sortBy = Ss),
        (Bn.sortedUniq = function (e) {
          return e && e.length ? sr(e) : [];
        }),
        (Bn.sortedUniqBy = function (e, t) {
          return e && e.length ? sr(e, ao(t, 2)) : [];
        }),
        (Bn.split = function (e, t, n) {
          return (
            n && "number" != typeof n && bo(e, t, n) && (t = n = i),
            (n = n === i ? g : n >>> 0)
              ? (e = _a(e)) &&
                ("string" == typeof t || (null != t && !ra(t))) &&
                !(t = lr(t)) &&
                on(e)
                ? yr(hn(e), 0, n)
                : e.split(t, n)
              : []
          );
        }),
        (Bn.spread = function (e, t) {
          if ("function" != typeof e) throw new Le(r);
          return (
            (t = null == t ? 0 : _n(ga(t), 0)),
            Zi(function (n) {
              var i = n[t],
                r = yr(n, 0, t);
              return (i && Ot(r, i), St(e, this, r));
            })
          );
        }),
        (Bn.tail = function (e) {
          var t = null == e ? 0 : e.length;
          return t ? nr(e, 1, t) : [];
        }),
        (Bn.take = function (e, t, n) {
          return e && e.length ? nr(e, 0, (t = n || t === i ? 1 : ga(t)) < 0 ? 0 : t) : [];
        }),
        (Bn.takeRight = function (e, t, n) {
          var r = null == e ? 0 : e.length;
          return r ? nr(e, (t = r - (t = n || t === i ? 1 : ga(t))) < 0 ? 0 : t, r) : [];
        }),
        (Bn.takeRightWhile = function (e, t) {
          return e && e.length ? hr(e, ao(t, 3), !1, !0) : [];
        }),
        (Bn.takeWhile = function (e, t) {
          return e && e.length ? hr(e, ao(t, 3)) : [];
        }),
        (Bn.tap = function (e, t) {
          return (t(e), e);
        }),
        (Bn.throttle = function (e, t, n) {
          var i = !0,
            o = !0;
          if ("function" != typeof e) throw new Le(r);
          return (
            Js(n) &&
              ((i = "leading" in n ? !!n.leading : i), (o = "trailing" in n ? !!n.trailing : o)),
            Ts(e, t, { leading: i, maxWait: t, trailing: o })
          );
        }),
        (Bn.thru = hs),
        (Bn.toArray = ua),
        (Bn.toPairs = ja),
        (Bn.toPairsIn = Fa),
        (Bn.toPath = function (e) {
          return zs(e) ? Rt(e, Po) : aa(e) ? [e] : Lr(Ao(_a(e)));
        }),
        (Bn.toPlainObject = ma),
        (Bn.transform = function (e, t, n) {
          var i = zs(e),
            r = i || Ks(e) || la(e);
          if (((t = ao(t, 4)), null == n)) {
            var o = e && e.constructor;
            n = r ? (i ? new o() : []) : Js(e) && Ys(o) ? Vn($e(e)) : {};
          }
          return (
            (r ? Et : bi)(e, function (e, i, r) {
              return t(n, e, i, r);
            }),
            n
          );
        }),
        (Bn.unary = function (e) {
          return Es(e, 1);
        }),
        (Bn.union = es),
        (Bn.unionBy = ts),
        (Bn.unionWith = ns),
        (Bn.uniq = function (e) {
          return e && e.length ? cr(e) : [];
        }),
        (Bn.uniqBy = function (e, t) {
          return e && e.length ? cr(e, ao(t, 2)) : [];
        }),
        (Bn.uniqWith = function (e, t) {
          return ((t = "function" == typeof t ? t : i), e && e.length ? cr(e, i, t) : []);
        }),
        (Bn.unset = function (e, t) {
          return null == e || dr(e, t);
        }),
        (Bn.unzip = is),
        (Bn.unzipWith = rs),
        (Bn.update = function (e, t, n) {
          return null == e ? e : ur(e, t, _r(n));
        }),
        (Bn.updateWith = function (e, t, n, r) {
          return ((r = "function" == typeof r ? r : i), null == e ? e : ur(e, t, _r(n), r));
        }),
        (Bn.values = Ba),
        (Bn.valuesIn = function (e) {
          return null == e ? [] : Xt(e, Ia(e));
        }),
        (Bn.without = os),
        (Bn.words = Ya),
        (Bn.wrap = function (e, t) {
          return Ps(_r(t), e);
        }),
        (Bn.xor = ss),
        (Bn.xorBy = as),
        (Bn.xorWith = ls),
        (Bn.zip = cs),
        (Bn.zipObject = function (e, t) {
          return fr(e || [], t || [], ei);
        }),
        (Bn.zipObjectDeep = function (e, t) {
          return fr(e || [], t || [], Qi);
        }),
        (Bn.zipWith = ds),
        (Bn.entries = ja),
        (Bn.entriesIn = Fa),
        (Bn.extend = ba),
        (Bn.extendWith = ya),
        sl(Bn, Bn),
        (Bn.add = ml),
        (Bn.attempt = Xa),
        (Bn.camelCase = Va),
        (Bn.capitalize = Wa),
        (Bn.ceil = _l),
        (Bn.clamp = function (e, t, n) {
          return (
            n === i && ((n = t), (t = i)),
            n !== i && (n = (n = fa(n)) == n ? n : 0),
            t !== i && (t = (t = fa(t)) == t ? t : 0),
            si(fa(e), t, n)
          );
        }),
        (Bn.clone = function (e) {
          return ai(e, 4);
        }),
        (Bn.cloneDeep = function (e) {
          return ai(e, 5);
        }),
        (Bn.cloneDeepWith = function (e, t) {
          return ai(e, 5, (t = "function" == typeof t ? t : i));
        }),
        (Bn.cloneWith = function (e, t) {
          return ai(e, 4, (t = "function" == typeof t ? t : i));
        }),
        (Bn.conformsTo = function (e, t) {
          return null == t || li(e, t, Ta(t));
        }),
        (Bn.deburr = Ha),
        (Bn.defaultTo = function (e, t) {
          return null == e || e != e ? t : e;
        }),
        (Bn.divide = vl),
        (Bn.endsWith = function (e, t, n) {
          ((e = _a(e)), (t = lr(t)));
          var r = e.length,
            o = (n = n === i ? r : si(ga(n), 0, r));
          return (n -= t.length) >= 0 && e.slice(n, o) == t;
        }),
        (Bn.eq = Bs),
        (Bn.escape = function (e) {
          return (e = _a(e)) && G.test(e) ? e.replace(q, nn) : e;
        }),
        (Bn.escapeRegExp = function (e) {
          return (e = _a(e)) && ne.test(e) ? e.replace(te, "\\$&") : e;
        }),
        (Bn.every = function (e, t, n) {
          var r = zs(e) ? Lt : gi;
          return (n && bo(e, t, n) && (t = i), r(e, ao(t, 3)));
        }),
        (Bn.find = fs),
        (Bn.findIndex = Ho),
        (Bn.findKey = function (e, t) {
          return Ft(e, ao(t, 3), bi);
        }),
        (Bn.findLast = ms),
        (Bn.findLastIndex = zo),
        (Bn.findLastKey = function (e, t) {
          return Ft(e, ao(t, 3), yi);
        }),
        (Bn.floor = bl),
        (Bn.forEach = _s),
        (Bn.forEachRight = vs),
        (Bn.forIn = function (e, t) {
          return null == e ? e : _i(e, ao(t, 3), Ia);
        }),
        (Bn.forInRight = function (e, t) {
          return null == e ? e : vi(e, ao(t, 3), Ia);
        }),
        (Bn.forOwn = function (e, t) {
          return e && bi(e, ao(t, 3));
        }),
        (Bn.forOwnRight = function (e, t) {
          return e && yi(e, ao(t, 3));
        }),
        (Bn.get = ka),
        (Bn.gt = Vs),
        (Bn.gte = Ws),
        (Bn.has = function (e, t) {
          return null != e && fo(e, t, Ei);
        }),
        (Bn.hasIn = Ea),
        (Bn.head = $o),
        (Bn.identity = nl),
        (Bn.includes = function (e, t, n, i) {
          ((e = $s(e) ? e : Ba(e)), (n = n && !i ? ga(n) : 0));
          var r = e.length;
          return (
            n < 0 && (n = _n(r + n, 0)),
            sa(e) ? n <= r && e.indexOf(t, n) > -1 : !!r && Vt(e, t, n) > -1
          );
        }),
        (Bn.indexOf = function (e, t, n) {
          var i = null == e ? 0 : e.length;
          if (!i) return -1;
          var r = null == n ? 0 : ga(n);
          return (r < 0 && (r = _n(i + r, 0)), Vt(e, t, r));
        }),
        (Bn.inRange = function (e, t, n) {
          return (
            (t = ha(t)),
            n === i ? ((n = t), (t = 0)) : (n = ha(n)),
            (function (e, t, n) {
              return e >= vn(t, n) && e < _n(t, n);
            })((e = fa(e)), t, n)
          );
        }),
        (Bn.invoke = Da),
        (Bn.isArguments = Hs),
        (Bn.isArray = zs),
        (Bn.isArrayBuffer = Us),
        (Bn.isArrayLike = $s),
        (Bn.isArrayLikeObject = qs),
        (Bn.isBoolean = function (e) {
          return !0 === e || !1 === e || (ea(e) && Si(e) == _);
        }),
        (Bn.isBuffer = Ks),
        (Bn.isDate = Gs),
        (Bn.isElement = function (e) {
          return ea(e) && 1 === e.nodeType && !ia(e);
        }),
        (Bn.isEmpty = function (e) {
          if (null == e) return !0;
          if (
            $s(e) &&
            (zs(e) ||
              "string" == typeof e ||
              "function" == typeof e.splice ||
              Ks(e) ||
              la(e) ||
              Hs(e))
          )
            return !e.length;
          var t = po(e);
          if (t == w || t == N) return !e.size;
          if (Co(e)) return !Ai(e).length;
          for (var n in e) if (Me.call(e, n)) return !1;
          return !0;
        }),
        (Bn.isEqual = function (e, t) {
          return Ii(e, t);
        }),
        (Bn.isEqualWith = function (e, t, n) {
          var r = (n = "function" == typeof n ? n : i) ? n(e, t) : i;
          return r === i ? Ii(e, t, i, n) : !!r;
        }),
        (Bn.isError = Zs),
        (Bn.isFinite = function (e) {
          return "number" == typeof e && jt(e);
        }),
        (Bn.isFunction = Ys),
        (Bn.isInteger = Xs),
        (Bn.isLength = Qs),
        (Bn.isMap = ta),
        (Bn.isMatch = function (e, t) {
          return e === t || Ri(e, t, co(t));
        }),
        (Bn.isMatchWith = function (e, t, n) {
          return ((n = "function" == typeof n ? n : i), Ri(e, t, co(t), n));
        }),
        (Bn.isNaN = function (e) {
          return na(e) && e != +e;
        }),
        (Bn.isNative = function (e) {
          if (wo(e))
            throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");
          return Oi(e);
        }),
        (Bn.isNil = function (e) {
          return null == e;
        }),
        (Bn.isNull = function (e) {
          return null === e;
        }),
        (Bn.isNumber = na),
        (Bn.isObject = Js),
        (Bn.isObjectLike = ea),
        (Bn.isPlainObject = ia),
        (Bn.isRegExp = ra),
        (Bn.isSafeInteger = function (e) {
          return Xs(e) && e >= -9007199254740991 && e <= u;
        }),
        (Bn.isSet = oa),
        (Bn.isString = sa),
        (Bn.isSymbol = aa),
        (Bn.isTypedArray = la),
        (Bn.isUndefined = function (e) {
          return e === i;
        }),
        (Bn.isWeakMap = function (e) {
          return ea(e) && po(e) == T;
        }),
        (Bn.isWeakSet = function (e) {
          return ea(e) && "[object WeakSet]" == Si(e);
        }),
        (Bn.join = function (e, t) {
          return null == e ? "" : $t.call(e, t);
        }),
        (Bn.kebabCase = za),
        (Bn.last = Zo),
        (Bn.lastIndexOf = function (e, t, n) {
          var r = null == e ? 0 : e.length;
          if (!r) return -1;
          var o = r;
          return (
            n !== i && (o = (o = ga(n)) < 0 ? _n(r + o, 0) : vn(o, r - 1)),
            t == t
              ? (function (e, t, n) {
                  for (var i = n + 1; i--; ) if (e[i] === t) return i;
                  return i;
                })(e, t, o)
              : Bt(e, Ht, o, !0)
          );
        }),
        (Bn.lowerCase = Ua),
        (Bn.lowerFirst = $a),
        (Bn.lt = ca),
        (Bn.lte = da),
        (Bn.max = function (e) {
          return e && e.length ? pi(e, nl, ki) : i;
        }),
        (Bn.maxBy = function (e, t) {
          return e && e.length ? pi(e, ao(t, 2), ki) : i;
        }),
        (Bn.mean = function (e) {
          return zt(e, nl);
        }),
        (Bn.meanBy = function (e, t) {
          return zt(e, ao(t, 2));
        }),
        (Bn.min = function (e) {
          return e && e.length ? pi(e, nl, ji) : i;
        }),
        (Bn.minBy = function (e, t) {
          return e && e.length ? pi(e, ao(t, 2), ji) : i;
        }),
        (Bn.stubArray = pl),
        (Bn.stubFalse = fl),
        (Bn.stubObject = function () {
          return {};
        }),
        (Bn.stubString = function () {
          return "";
        }),
        (Bn.stubTrue = function () {
          return !0;
        }),
        (Bn.multiply = xl),
        (Bn.nth = function (e, t) {
          return e && e.length ? Hi(e, ga(t)) : i;
        }),
        (Bn.noConflict = function () {
          return (ht._ === this && (ht._ = Be), this);
        }),
        (Bn.noop = al),
        (Bn.now = ks),
        (Bn.pad = function (e, t, n) {
          e = _a(e);
          var i = (t = ga(t)) ? un(e) : 0;
          if (!t || i >= t) return e;
          var r = (t - i) / 2;
          return zr(pt(r), n) + e + zr(gt(r), n);
        }),
        (Bn.padEnd = function (e, t, n) {
          e = _a(e);
          var i = (t = ga(t)) ? un(e) : 0;
          return t && i < t ? e + zr(t - i, n) : e;
        }),
        (Bn.padStart = function (e, t, n) {
          e = _a(e);
          var i = (t = ga(t)) ? un(e) : 0;
          return t && i < t ? zr(t - i, n) + e : e;
        }),
        (Bn.parseInt = function (e, t, n) {
          return (n || null == t ? (t = 0) : t && (t = +t), yn(_a(e).replace(ie, ""), t || 0));
        }),
        (Bn.random = function (e, t, n) {
          if (
            (n && "boolean" != typeof n && bo(e, t, n) && (t = n = i),
            n === i &&
              ("boolean" == typeof t
                ? ((n = t), (t = i))
                : "boolean" == typeof e && ((n = e), (e = i))),
            e === i && t === i
              ? ((e = 0), (t = 1))
              : ((e = ha(e)), t === i ? ((t = e), (e = 0)) : (t = ha(t))),
            e > t)
          ) {
            var r = e;
            ((e = t), (t = r));
          }
          if (n || e % 1 || t % 1) {
            var o = xn();
            return vn(e + o * (t - e + lt("1e-" + ((o + "").length - 1))), t);
          }
          return Ki(e, t);
        }),
        (Bn.reduce = function (e, t, n) {
          var i = zs(e) ? Mt : qt,
            r = arguments.length < 3;
          return i(e, ao(t, 4), n, r, ui);
        }),
        (Bn.reduceRight = function (e, t, n) {
          var i = zs(e) ? At : qt,
            r = arguments.length < 3;
          return i(e, ao(t, 4), n, r, hi);
        }),
        (Bn.repeat = function (e, t, n) {
          return ((t = (n ? bo(e, t, n) : t === i) ? 1 : ga(t)), Gi(_a(e), t));
        }),
        (Bn.replace = function () {
          var e = arguments,
            t = _a(e[0]);
          return e.length < 3 ? t : t.replace(e[1], e[2]);
        }),
        (Bn.result = function (e, t, n) {
          var r = -1,
            o = (t = vr(t, e)).length;
          for (o || ((o = 1), (e = i)); ++r < o; ) {
            var s = null == e ? i : e[Po(t[r])];
            (s === i && ((r = o), (s = n)), (e = Ys(s) ? s.call(e) : s));
          }
          return e;
        }),
        (Bn.round = wl),
        (Bn.runInContext = e),
        (Bn.sample = function (e) {
          return (zs(e) ? Yn : Yi)(e);
        }),
        (Bn.size = function (e) {
          if (null == e) return 0;
          if ($s(e)) return sa(e) ? un(e) : e.length;
          var t = po(e);
          return t == w || t == N ? e.size : Ai(e).length;
        }),
        (Bn.snakeCase = qa),
        (Bn.some = function (e, t, n) {
          var r = zs(e) ? Pt : ir;
          return (n && bo(e, t, n) && (t = i), r(e, ao(t, 3)));
        }),
        (Bn.sortedIndex = function (e, t) {
          return rr(e, t);
        }),
        (Bn.sortedIndexBy = function (e, t, n) {
          return or(e, t, ao(n, 2));
        }),
        (Bn.sortedIndexOf = function (e, t) {
          var n = null == e ? 0 : e.length;
          if (n) {
            var i = rr(e, t);
            if (i < n && Bs(e[i], t)) return i;
          }
          return -1;
        }),
        (Bn.sortedLastIndex = function (e, t) {
          return rr(e, t, !0);
        }),
        (Bn.sortedLastIndexBy = function (e, t, n) {
          return or(e, t, ao(n, 2), !0);
        }),
        (Bn.sortedLastIndexOf = function (e, t) {
          if (null == e ? 0 : e.length) {
            var n = rr(e, t, !0) - 1;
            if (Bs(e[n], t)) return n;
          }
          return -1;
        }),
        (Bn.startCase = Ka),
        (Bn.startsWith = function (e, t, n) {
          return (
            (e = _a(e)),
            (n = null == n ? 0 : si(ga(n), 0, e.length)),
            (t = lr(t)),
            e.slice(n, n + t.length) == t
          );
        }),
        (Bn.subtract = Cl),
        (Bn.sum = function (e) {
          return e && e.length ? Kt(e, nl) : 0;
        }),
        (Bn.sumBy = function (e, t) {
          return e && e.length ? Kt(e, ao(t, 2)) : 0;
        }),
        (Bn.template = function (e, t, n) {
          var r = Bn.templateSettings;
          (n && bo(e, t, n) && (t = i), (e = _a(e)), (t = ya({}, t, r, Xr)));
          var o,
            s,
            a = ya({}, t.imports, r.imports, Xr),
            l = Ta(a),
            c = Xt(a, l),
            d = 0,
            u = t.interpolate || be,
            h = "__p += '",
            g = Ee(
              (t.escape || be).source +
                "|" +
                u.source +
                "|" +
                (u === X ? ue : be).source +
                "|" +
                (t.evaluate || be).source +
                "|$",
              "g",
            ),
            p =
              "//# sourceURL=" +
              (Me.call(t, "sourceURL")
                ? (t.sourceURL + "").replace(/\s/g, " ")
                : "lodash.templateSources[" + ++rt + "]") +
              "\n";
          (e.replace(g, function (t, n, i, r, a, l) {
            return (
              i || (i = r),
              (h += e.slice(d, l).replace(ye, rn)),
              n && ((o = !0), (h += "' +\n__e(" + n + ") +\n'")),
              a && ((s = !0), (h += "';\n" + a + ";\n__p += '")),
              i && (h += "' +\n((__t = (" + i + ")) == null ? '' : __t) +\n'"),
              (d = l + t.length),
              t
            );
          }),
            (h += "';\n"));
          var f = Me.call(t, "variable") && t.variable;
          if (f) {
            if (ce.test(f)) throw new we("Invalid `variable` option passed into `_.template`");
          } else h = "with (obj) {\n" + h + "\n}\n";
          ((h = (s ? h.replace(H, "") : h).replace(z, "$1").replace(U, "$1;")),
            (h =
              "function(" +
              (f || "obj") +
              ") {\n" +
              (f ? "" : "obj || (obj = {});\n") +
              "var __t, __p = ''" +
              (o ? ", __e = _.escape" : "") +
              (s
                ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n"
                : ";\n") +
              h +
              "return __p\n}"));
          var m = Xa(function () {
            return Ce(l, p + "return " + h).apply(i, c);
          });
          if (((m.source = h), Zs(m))) throw m;
          return m;
        }),
        (Bn.times = function (e, t) {
          if ((e = ga(e)) < 1 || e > u) return [];
          var n = g,
            i = vn(e, g);
          ((t = ao(t)), (e -= g));
          for (var r = Gt(i, t); ++n < e; ) t(n);
          return r;
        }),
        (Bn.toFinite = ha),
        (Bn.toInteger = ga),
        (Bn.toLength = pa),
        (Bn.toLower = function (e) {
          return _a(e).toLowerCase();
        }),
        (Bn.toNumber = fa),
        (Bn.toSafeInteger = function (e) {
          return e ? si(ga(e), -9007199254740991, u) : 0 === e ? e : 0;
        }),
        (Bn.toString = _a),
        (Bn.toUpper = function (e) {
          return _a(e).toUpperCase();
        }),
        (Bn.trim = function (e, t, n) {
          if ((e = _a(e)) && (n || t === i)) return Zt(e);
          if (!e || !(t = lr(t))) return e;
          var r = hn(e),
            o = hn(t);
          return yr(r, Jt(r, o), en(r, o) + 1).join("");
        }),
        (Bn.trimEnd = function (e, t, n) {
          if ((e = _a(e)) && (n || t === i)) return e.slice(0, gn(e) + 1);
          if (!e || !(t = lr(t))) return e;
          var r = hn(e);
          return yr(r, 0, en(r, hn(t)) + 1).join("");
        }),
        (Bn.trimStart = function (e, t, n) {
          if ((e = _a(e)) && (n || t === i)) return e.replace(ie, "");
          if (!e || !(t = lr(t))) return e;
          var r = hn(e);
          return yr(r, Jt(r, hn(t))).join("");
        }),
        (Bn.truncate = function (e, t) {
          var n = 30,
            r = "...";
          if (Js(t)) {
            var o = "separator" in t ? t.separator : o;
            ((n = "length" in t ? ga(t.length) : n), (r = "omission" in t ? lr(t.omission) : r));
          }
          var s = (e = _a(e)).length;
          if (on(e)) {
            var a = hn(e);
            s = a.length;
          }
          if (n >= s) return e;
          var l = n - un(r);
          if (l < 1) return r;
          var c = a ? yr(a, 0, l).join("") : e.slice(0, l);
          if (o === i) return c + r;
          if ((a && (l += c.length - l), ra(o))) {
            if (e.slice(l).search(o)) {
              var d,
                u = c;
              for (
                o.global || (o = Ee(o.source, _a(he.exec(o)) + "g")), o.lastIndex = 0;
                (d = o.exec(u));
              )
                var h = d.index;
              c = c.slice(0, h === i ? l : h);
            }
          } else if (e.indexOf(lr(o), l) != l) {
            var g = c.lastIndexOf(o);
            g > -1 && (c = c.slice(0, g));
          }
          return c + r;
        }),
        (Bn.unescape = function (e) {
          return (e = _a(e)) && K.test(e) ? e.replace($, pn) : e;
        }),
        (Bn.uniqueId = function (e) {
          var t = ++Ae;
          return _a(e) + t;
        }),
        (Bn.upperCase = Ga),
        (Bn.upperFirst = Za),
        (Bn.each = _s),
        (Bn.eachRight = vs),
        (Bn.first = $o),
        sl(
          Bn,
          ((yl = {}),
          bi(Bn, function (e, t) {
            Me.call(Bn.prototype, t) || (yl[t] = e);
          }),
          yl),
          { chain: !1 },
        ),
        (Bn.VERSION = "4.17.21"),
        Et(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function (e) {
          Bn[e].placeholder = Bn;
        }),
        Et(["drop", "take"], function (e, t) {
          ((zn.prototype[e] = function (n) {
            n = n === i ? 1 : _n(ga(n), 0);
            var r = this.__filtered__ && !t ? new zn(this) : this.clone();
            return (
              r.__filtered__
                ? (r.__takeCount__ = vn(n, r.__takeCount__))
                : r.__views__.push({ size: vn(n, g), type: e + (r.__dir__ < 0 ? "Right" : "") }),
              r
            );
          }),
            (zn.prototype[e + "Right"] = function (t) {
              return this.reverse()[e](t).reverse();
            }));
        }),
        Et(["filter", "map", "takeWhile"], function (e, t) {
          var n = t + 1,
            i = 1 == n || 3 == n;
          zn.prototype[e] = function (e) {
            var t = this.clone();
            return (
              t.__iteratees__.push({ iteratee: ao(e, 3), type: n }),
              (t.__filtered__ = t.__filtered__ || i),
              t
            );
          };
        }),
        Et(["head", "last"], function (e, t) {
          var n = "take" + (t ? "Right" : "");
          zn.prototype[e] = function () {
            return this[n](1).value()[0];
          };
        }),
        Et(["initial", "tail"], function (e, t) {
          var n = "drop" + (t ? "" : "Right");
          zn.prototype[e] = function () {
            return this.__filtered__ ? new zn(this) : this[n](1);
          };
        }),
        (zn.prototype.compact = function () {
          return this.filter(nl);
        }),
        (zn.prototype.find = function (e) {
          return this.filter(e).head();
        }),
        (zn.prototype.findLast = function (e) {
          return this.reverse().find(e);
        }),
        (zn.prototype.invokeMap = Zi(function (e, t) {
          return "function" == typeof e
            ? new zn(this)
            : this.map(function (n) {
                return Di(n, e, t);
              });
        })),
        (zn.prototype.reject = function (e) {
          return this.filter(Ms(ao(e)));
        }),
        (zn.prototype.slice = function (e, t) {
          e = ga(e);
          var n = this;
          return n.__filtered__ && (e > 0 || t < 0)
            ? new zn(n)
            : (e < 0 ? (n = n.takeRight(-e)) : e && (n = n.drop(e)),
              t !== i && (n = (t = ga(t)) < 0 ? n.dropRight(-t) : n.take(t - e)),
              n);
        }),
        (zn.prototype.takeRightWhile = function (e) {
          return this.reverse().takeWhile(e).reverse();
        }),
        (zn.prototype.toArray = function () {
          return this.take(g);
        }),
        bi(zn.prototype, function (e, t) {
          var n = /^(?:filter|find|map|reject)|While$/.test(t),
            r = /^(?:head|last)$/.test(t),
            o = Bn[r ? "take" + ("last" == t ? "Right" : "") : t],
            s = r || /^find/.test(t);
          o &&
            (Bn.prototype[t] = function () {
              var t = this.__wrapped__,
                a = r ? [1] : arguments,
                l = t instanceof zn,
                c = a[0],
                d = l || zs(t),
                u = function (e) {
                  var t = o.apply(Bn, Ot([e], a));
                  return r && h ? t[0] : t;
                };
              d && n && "function" == typeof c && 1 != c.length && (l = d = !1);
              var h = this.__chain__,
                g = !!this.__actions__.length,
                p = s && !h,
                f = l && !g;
              if (!s && d) {
                t = f ? t : new zn(this);
                var m = e.apply(t, a);
                return (m.__actions__.push({ func: hs, args: [u], thisArg: i }), new Hn(m, h));
              }
              return p && f
                ? e.apply(this, a)
                : ((m = this.thru(u)), p ? (r ? m.value()[0] : m.value()) : m);
            });
        }),
        Et(["pop", "push", "shift", "sort", "splice", "unshift"], function (e) {
          var t = De[e],
            n = /^(?:push|sort|unshift)$/.test(e) ? "tap" : "thru",
            i = /^(?:pop|shift)$/.test(e);
          Bn.prototype[e] = function () {
            var e = arguments;
            if (i && !this.__chain__) {
              var r = this.value();
              return t.apply(zs(r) ? r : [], e);
            }
            return this[n](function (n) {
              return t.apply(zs(n) ? n : [], e);
            });
          };
        }),
        bi(zn.prototype, function (e, t) {
          var n = Bn[t];
          if (n) {
            var i = n.name + "";
            (Me.call(Tn, i) || (Tn[i] = []), Tn[i].push({ name: t, func: n }));
          }
        }),
        (Tn[Br(i, 2).name] = [{ name: "wrapper", func: i }]),
        (zn.prototype.clone = function () {
          var e = new zn(this.__wrapped__);
          return (
            (e.__actions__ = Lr(this.__actions__)),
            (e.__dir__ = this.__dir__),
            (e.__filtered__ = this.__filtered__),
            (e.__iteratees__ = Lr(this.__iteratees__)),
            (e.__takeCount__ = this.__takeCount__),
            (e.__views__ = Lr(this.__views__)),
            e
          );
        }),
        (zn.prototype.reverse = function () {
          if (this.__filtered__) {
            var e = new zn(this);
            ((e.__dir__ = -1), (e.__filtered__ = !0));
          } else (e = this.clone()).__dir__ *= -1;
          return e;
        }),
        (zn.prototype.value = function () {
          var e = this.__wrapped__.value(),
            t = this.__dir__,
            n = zs(e),
            i = t < 0,
            r = n ? e.length : 0,
            o = (function (e, t, n) {
              var i = -1,
                r = n.length;
              for (; ++i < r; ) {
                var o = n[i],
                  s = o.size;
                switch (o.type) {
                  case "drop":
                    e += s;
                    break;
                  case "dropRight":
                    t -= s;
                    break;
                  case "take":
                    t = vn(t, e + s);
                    break;
                  case "takeRight":
                    e = _n(e, t - s);
                }
              }
              return { start: e, end: t };
            })(0, r, this.__views__),
            s = o.start,
            a = o.end,
            l = a - s,
            c = i ? a : s - 1,
            d = this.__iteratees__,
            u = d.length,
            h = 0,
            g = vn(l, this.__takeCount__);
          if (!n || (!i && r == l && g == l)) return gr(e, this.__actions__);
          var p = [];
          e: for (; l-- && h < g; ) {
            for (var f = -1, m = e[(c += t)]; ++f < u; ) {
              var _ = d[f],
                v = _.iteratee,
                b = _.type,
                y = v(m);
              if (2 == b) m = y;
              else if (!y) {
                if (1 == b) continue e;
                break e;
              }
            }
            p[h++] = m;
          }
          return p;
        }),
        (Bn.prototype.at = gs),
        (Bn.prototype.chain = function () {
          return us(this);
        }),
        (Bn.prototype.commit = function () {
          return new Hn(this.value(), this.__chain__);
        }),
        (Bn.prototype.next = function () {
          this.__values__ === i && (this.__values__ = ua(this.value()));
          var e = this.__index__ >= this.__values__.length;
          return { done: e, value: e ? i : this.__values__[this.__index__++] };
        }),
        (Bn.prototype.plant = function (e) {
          for (var t, n = this; n instanceof Wn; ) {
            var r = Fo(n);
            ((r.__index__ = 0), (r.__values__ = i), t ? (o.__wrapped__ = r) : (t = r));
            var o = r;
            n = n.__wrapped__;
          }
          return ((o.__wrapped__ = e), t);
        }),
        (Bn.prototype.reverse = function () {
          var e = this.__wrapped__;
          if (e instanceof zn) {
            var t = e;
            return (
              this.__actions__.length && (t = new zn(this)),
              (t = t.reverse()).__actions__.push({ func: hs, args: [Jo], thisArg: i }),
              new Hn(t, this.__chain__)
            );
          }
          return this.thru(Jo);
        }),
        (Bn.prototype.toJSON =
          Bn.prototype.valueOf =
          Bn.prototype.value =
            function () {
              return gr(this.__wrapped__, this.__actions__);
            }),
        (Bn.prototype.first = Bn.prototype.head),
        Ye &&
          (Bn.prototype[Ye] = function () {
            return this;
          }),
        Bn
      );
    })();
    pt ? (((pt.exports = fn)._ = fn), (gt._ = fn)) : (ht._ = fn);
  }).call(t);
})(ST, ST.exports);
var kT = ST.exports;
function ET(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function NT(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != typeof e || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != typeof i) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == typeof t ? t : t + "";
    })(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function LT(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function DT(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? LT(Object(n), !0).forEach(function (t) {
          NT(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : LT(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function TT(e, t, n) {
  return (
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function IT(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function RT(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? IT(Object(n), !0).forEach(function (t) {
          TT(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : IT(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function OT(e) {
  return function t() {
    for (var n = this, i = arguments.length, r = new Array(i), o = 0; o < i; o++)
      r[o] = arguments[o];
    return r.length >= e.length
      ? e.apply(this, r)
      : function () {
          for (var e = arguments.length, i = new Array(e), o = 0; o < e; o++) i[o] = arguments[o];
          return t.apply(n, [].concat(r, i));
        };
  };
}
function MT(e) {
  return {}.toString.call(e).includes("Object");
}
function AT(e) {
  return "function" == typeof e;
}
var PT = OT(function (e, t) {
    throw new Error(e[t] || e.default);
  })({
    initialIsRequired: "initial state is required",
    initialType: "initial state should be an object",
    initialContent: "initial state shouldn't be an empty object",
    handlerType: "handler should be an object or a function",
    handlersType: "all handlers should be a functions",
    selectorType: "selector should be a function",
    changeType: "provided value of changes should be an object",
    changeField:
      'it seams you want to change a field in the state which is not specified in the "initial" state',
    default: "an unknown error accured in `state-local` package",
  }),
  jT = {
    changes: function (e, t) {
      return (
        MT(t) || PT("changeType"),
        Object.keys(t).some(function (t) {
          return !(function (e, t) {
            return Object.prototype.hasOwnProperty.call(e, t);
          })(e, t);
        }) && PT("changeField"),
        t
      );
    },
    selector: function (e) {
      AT(e) || PT("selectorType");
    },
    handler: function (e) {
      (AT(e) || MT(e) || PT("handlerType"),
        MT(e) &&
          Object.values(e).some(function (e) {
            return !AT(e);
          }) &&
          PT("handlersType"));
    },
    initial: function (e) {
      var t;
      (e || PT("initialIsRequired"),
        MT(e) || PT("initialType"),
        (t = e),
        Object.keys(t).length || PT("initialContent"));
    },
  };
function FT(e, t) {
  return AT(t) ? t(e.current) : t;
}
function BT(e, t) {
  return ((e.current = RT(RT({}, e.current), t)), t);
}
function VT(e, t, n) {
  return (
    AT(t)
      ? t(e.current)
      : Object.keys(n).forEach(function (n) {
          var i;
          return null === (i = t[n]) || void 0 === i ? void 0 : i.call(t, e.current[n]);
        }),
    n
  );
}
var WT = {
  create: function (e) {
    var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    (jT.initial(e), jT.handler(t));
    var n = { current: e },
      i = OT(VT)(n, t),
      r = OT(BT)(n),
      o = OT(jT.changes)(e),
      s = OT(FT)(n);
    return [
      function () {
        var e =
          arguments.length > 0 && void 0 !== arguments[0]
            ? arguments[0]
            : function (e) {
                return e;
              };
        return (jT.selector(e), e(n.current));
      },
      function (e) {
        !(function () {
          for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
          return function (e) {
            return t.reduceRight(function (e, t) {
              return t(e);
            }, e);
          };
        })(
          i,
          r,
          o,
          s,
        )(e);
      },
    ];
  },
};
var HT,
  zT = ((HT = function (e, t) {
    throw new Error(e[t] || e.default);
  }),
  function e() {
    for (var t = this, n = arguments.length, i = new Array(n), r = 0; r < n; r++)
      i[r] = arguments[r];
    return i.length >= HT.length
      ? HT.apply(this, i)
      : function () {
          for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++) r[o] = arguments[o];
          return e.apply(t, [].concat(i, r));
        };
  })({
    configIsRequired: "the configuration object is required",
    configType: "the configuration object should be an object",
    default: "an unknown error accured in `@monaco-editor/loader` package",
    deprecation:
      "Deprecation warning!\n    You are using deprecated way of configuration.\n\n    Instead of using\n      monaco.config({ urls: { monacoBase: '...' } })\n    use\n      monaco.config({ paths: { vs: '...' } })\n\n    For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n  ",
  }),
  UT = {
    config: function (e) {
      var t;
      return (
        e || zT("configIsRequired"),
        (t = e),
        {}.toString.call(t).includes("Object") || zT("configType"),
        e.urls ? { paths: { vs: e.urls.monacoBase } } : e
      );
    },
  };
function $T(e, t) {
  return (
    Object.keys(t).forEach(function (n) {
      t[n] instanceof Object && e[n] && Object.assign(t[n], $T(e[n], t[n]));
    }),
    DT(DT({}, e), t)
  );
}
var qT = { type: "cancelation", msg: "operation is manually canceled" };
function KT(e) {
  var t = !1,
    n = new Promise(function (n, i) {
      (e.then(function (e) {
        return t ? i(qT) : n(e);
      }),
        e.catch(i));
    });
  return (
    (n.cancel = function () {
      return (t = !0);
    }),
    n
  );
}
var GT = ["monaco"],
  ZT = (function (e, t) {
    return (
      (function (e) {
        if (Array.isArray(e)) return e;
      })(e) ||
      (function (e, t) {
        var n =
          null == e
            ? null
            : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
        if (null != n) {
          var i,
            r,
            o,
            s,
            a = [],
            l = !0,
            c = !1;
          try {
            if (((o = (n = n.call(e)).next), 0 === t));
            else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
          } catch (e) {
            ((c = !0), (r = e));
          } finally {
            try {
              if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
            } finally {
              if (c) throw r;
            }
          }
          return a;
        }
      })(e, t) ||
      (function (e, t) {
        if (e) {
          if ("string" == typeof e) return ET(e, t);
          var n = {}.toString.call(e).slice(8, -1);
          return (
            "Object" === n && e.constructor && (n = e.constructor.name),
            "Map" === n || "Set" === n
              ? Array.from(e)
              : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
                ? ET(e, t)
                : void 0
          );
        }
      })(e, t) ||
      (function () {
        throw new TypeError(
          "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
        );
      })()
    );
  })(
    WT.create({
      config: { paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs" } },
      isInitialized: !1,
      resolve: null,
      reject: null,
      monaco: null,
    }),
    2,
  ),
  YT = ZT[0],
  XT = ZT[1];
function QT(e) {
  return document.body.appendChild(e);
}
function JT(e) {
  var t,
    n,
    i = YT(function (e) {
      return { config: e.config, reject: e.reject };
    }),
    r =
      ((t = "".concat(i.config.paths.vs, "/loader.js")),
      (n = document.createElement("script")),
      t && (n.src = t),
      n);
  return (
    (r.onload = function () {
      return e();
    }),
    (r.onerror = i.reject),
    r
  );
}
function eI() {
  var e = YT(function (e) {
      return { config: e.config, resolve: e.resolve, reject: e.reject };
    }),
    t = window.require;
  (t.config(e.config),
    t(
      ["vs/editor/editor.main"],
      function (t) {
        var n = t.m || t;
        (tI(n), e.resolve(n));
      },
      function (t) {
        e.reject(t);
      },
    ));
}
function tI(e) {
  YT().monaco || XT({ monaco: e });
}
var nI = new Promise(function (e, t) {
    return XT({ resolve: e, reject: t });
  }),
  iI = {
    config: function (e) {
      var t = UT.config(e),
        n = t.monaco,
        i = (function (e, t) {
          if (null == e) return {};
          var n,
            i,
            r = (function (e, t) {
              if (null == e) return {};
              var n = {};
              for (var i in e)
                if ({}.hasOwnProperty.call(e, i)) {
                  if (-1 !== t.indexOf(i)) continue;
                  n[i] = e[i];
                }
              return n;
            })(e, t);
          if (Object.getOwnPropertySymbols) {
            var o = Object.getOwnPropertySymbols(e);
            for (i = 0; i < o.length; i++)
              ((n = o[i]),
                -1 === t.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (r[n] = e[n]));
          }
          return r;
        })(t, GT);
      XT(function (e) {
        return { config: $T(e.config, i), monaco: n };
      });
    },
    init: function () {
      var e = YT(function (e) {
        return { monaco: e.monaco, isInitialized: e.isInitialized, resolve: e.resolve };
      });
      if (!e.isInitialized) {
        if ((XT({ isInitialized: !0 }), e.monaco)) return (e.resolve(e.monaco), KT(nI));
        if (window.monaco && window.monaco.editor)
          return (tI(window.monaco), e.resolve(window.monaco), KT(nI));
        !(function () {
          for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
          return function (e) {
            return t.reduceRight(function (e, t) {
              return t(e);
            }, e);
          };
        })(
          QT,
          JT,
        )(eI);
      }
      return KT(nI);
    },
    __getMonacoInstance: function () {
      return YT(function (e) {
        return e.monaco;
      });
    },
  },
  rI = {
    wrapper: { display: "flex", position: "relative", textAlign: "initial" },
    fullWidth: { width: "100%" },
    hide: { display: "none" },
  },
  oI = {
    container: {
      display: "flex",
      height: "100%",
      width: "100%",
      justifyContent: "center",
      alignItems: "center",
    },
  };
var sI = function ({ children: e }) {
    return z.createElement("div", { style: oI.container }, e);
  },
  aI = sI;
var lI = function ({
    width: e,
    height: t,
    isEditorReady: n,
    loading: i,
    _ref: r,
    className: o,
    wrapperProps: s,
  }) {
    return z.createElement(
      "section",
      { style: { ...rI.wrapper, width: e, height: t }, ...s },
      !n && z.createElement(aI, null, i),
      z.createElement("div", {
        ref: r,
        style: { ...rI.fullWidth, ...(!n && rI.hide) },
        className: o,
      }),
    );
  },
  cI = H.memo(lI);
var dI = function (e) {
  H.useEffect(e, []);
};
var uI = function (e, t, n = !0) {
  let i = H.useRef(!0);
  H.useEffect(
    i.current || !n
      ? () => {
          i.current = !1;
        }
      : e,
    t,
  );
};
function hI() {}
function gI(e, t, n, i) {
  return (
    (function (e, t) {
      return e.editor.getModel(pI(e, t));
    })(e, i) ||
    (function (e, t, n, i) {
      return e.editor.createModel(t, n, i ? pI(e, i) : void 0);
    })(e, t, n, i)
  );
}
function pI(e, t) {
  return e.Uri.parse(t);
}
var fI = function ({
  original: e,
  modified: t,
  language: n,
  originalLanguage: i,
  modifiedLanguage: r,
  originalModelPath: o,
  modifiedModelPath: s,
  keepCurrentOriginalModel: a = !1,
  keepCurrentModifiedModel: l = !1,
  theme: c = "light",
  loading: d = "Loading...",
  options: u = {},
  height: h = "100%",
  width: g = "100%",
  className: p,
  wrapperProps: f = {},
  beforeMount: m = hI,
  onMount: _ = hI,
}) {
  let [v, b] = H.useState(!1),
    [y, x] = H.useState(!0),
    w = H.useRef(null),
    C = H.useRef(null),
    S = H.useRef(null),
    k = H.useRef(_),
    E = H.useRef(m),
    N = H.useRef(!1);
  (dI(() => {
    let e = iI.init();
    return (
      e.then((e) => (C.current = e) && x(!1)).catch((e) => "cancelation" !== e?.type && void 0),
      () =>
        w.current
          ? (function () {
              let e = w.current?.getModel();
              (a || e?.original?.dispose(), l || e?.modified?.dispose(), w.current?.dispose());
            })()
          : e.cancel()
    );
  }),
    uI(
      () => {
        if (w.current && C.current) {
          let t = w.current.getOriginalEditor(),
            r = gI(C.current, e || "", i || n || "text", o || "");
          r !== t.getModel() && t.setModel(r);
        }
      },
      [o],
      v,
    ),
    uI(
      () => {
        if (w.current && C.current) {
          let e = w.current.getModifiedEditor(),
            i = gI(C.current, t || "", r || n || "text", s || "");
          i !== e.getModel() && e.setModel(i);
        }
      },
      [s],
      v,
    ),
    uI(
      () => {
        let e = w.current.getModifiedEditor();
        e.getOption(C.current.editor.EditorOption.readOnly)
          ? e.setValue(t || "")
          : t !== e.getValue() &&
            (e.executeEdits("", [
              { range: e.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 },
            ]),
            e.pushUndoStop());
      },
      [t],
      v,
    ),
    uI(
      () => {
        w.current?.getModel()?.original.setValue(e || "");
      },
      [e],
      v,
    ),
    uI(
      () => {
        let { original: e, modified: t } = w.current.getModel();
        (C.current.editor.setModelLanguage(e, i || n || "text"),
          C.current.editor.setModelLanguage(t, r || n || "text"));
      },
      [n, i, r],
      v,
    ),
    uI(
      () => {
        C.current?.editor.setTheme(c);
      },
      [c],
      v,
    ),
    uI(
      () => {
        w.current?.updateOptions(u);
      },
      [u],
      v,
    ));
  let L = H.useCallback(() => {
      if (!C.current) return;
      E.current(C.current);
      let a = gI(C.current, e || "", i || n || "text", o || ""),
        l = gI(C.current, t || "", r || n || "text", s || "");
      w.current?.setModel({ original: a, modified: l });
    }, [n, t, r, e, i, o, s]),
    D = H.useCallback(() => {
      !N.current &&
        S.current &&
        ((w.current = C.current.editor.createDiffEditor(S.current, { automaticLayout: !0, ...u })),
        L(),
        C.current?.editor.setTheme(c),
        b(!0),
        (N.current = !0));
    }, [u, c, L]);
  return (
    H.useEffect(() => {
      v && k.current(w.current, C.current);
    }, [v]),
    H.useEffect(() => {
      !y && !v && D();
    }, [y, v, D]),
    z.createElement(cI, {
      width: g,
      height: h,
      isEditorReady: v,
      loading: d,
      _ref: S,
      className: p,
      wrapperProps: f,
    })
  );
};
H.memo(fI);
var mI = function (e) {
    let t = H.useRef();
    return (
      H.useEffect(() => {
        t.current = e;
      }, [e]),
      t.current
    );
  },
  _I = new Map();
var vI = function ({
    defaultValue: e,
    defaultLanguage: t,
    defaultPath: n,
    value: i,
    language: r,
    path: o,
    theme: s = "light",
    line: a,
    loading: l = "Loading...",
    options: c = {},
    overrideServices: d = {},
    saveViewState: u = !0,
    keepCurrentModel: h = !1,
    width: g = "100%",
    height: p = "100%",
    className: f,
    wrapperProps: m = {},
    beforeMount: _ = hI,
    onMount: v = hI,
    onChange: b,
    onValidate: y = hI,
  }) {
    let [x, w] = H.useState(!1),
      [C, S] = H.useState(!0),
      k = H.useRef(null),
      E = H.useRef(null),
      N = H.useRef(null),
      L = H.useRef(v),
      D = H.useRef(_),
      T = H.useRef(),
      I = H.useRef(i),
      R = mI(o),
      O = H.useRef(!1),
      M = H.useRef(!1);
    (dI(() => {
      let e = iI.init();
      return (
        e.then((e) => (k.current = e) && S(!1)).catch((e) => "cancelation" !== e?.type && void 0),
        () =>
          E.current
            ? (T.current?.dispose(),
              h ? u && _I.set(o, E.current.saveViewState()) : E.current.getModel()?.dispose(),
              void E.current.dispose())
            : e.cancel()
      );
    }),
      uI(
        () => {
          let s = gI(k.current, e || i || "", t || r || "", o || n || "");
          s !== E.current?.getModel() &&
            (u && _I.set(R, E.current?.saveViewState()),
            E.current?.setModel(s),
            u && E.current?.restoreViewState(_I.get(o)));
        },
        [o],
        x,
      ),
      uI(
        () => {
          E.current?.updateOptions(c);
        },
        [c],
        x,
      ),
      uI(
        () => {
          !E.current ||
            void 0 === i ||
            (E.current.getOption(k.current.editor.EditorOption.readOnly)
              ? E.current.setValue(i)
              : i !== E.current.getValue() &&
                ((M.current = !0),
                E.current.executeEdits("", [
                  {
                    range: E.current.getModel().getFullModelRange(),
                    text: i,
                    forceMoveMarkers: !0,
                  },
                ]),
                E.current.pushUndoStop(),
                (M.current = !1)));
        },
        [i],
        x,
      ),
      uI(
        () => {
          let e = E.current?.getModel();
          e && r && k.current?.editor.setModelLanguage(e, r);
        },
        [r],
        x,
      ),
      uI(
        () => {
          void 0 !== a && E.current?.revealLine(a);
        },
        [a],
        x,
      ),
      uI(
        () => {
          k.current?.editor.setTheme(s);
        },
        [s],
        x,
      ));
    let A = H.useCallback(() => {
      if (N.current && k.current && !O.current) {
        D.current(k.current);
        let l = o || n,
          h = gI(k.current, i || e || "", t || r || "", l || "");
        ((E.current = k.current?.editor.create(
          N.current,
          { model: h, automaticLayout: !0, ...c },
          d,
        )),
          u && E.current.restoreViewState(_I.get(l)),
          k.current.editor.setTheme(s),
          void 0 !== a && E.current.revealLine(a),
          w(!0),
          (O.current = !0));
      }
    }, [e, t, n, i, r, o, c, d, u, s, a]);
    return (
      H.useEffect(() => {
        x && L.current(E.current, k.current);
      }, [x]),
      H.useEffect(() => {
        !C && !x && A();
      }, [C, x, A]),
      (I.current = i),
      H.useEffect(() => {
        x &&
          b &&
          (T.current?.dispose(),
          (T.current = E.current?.onDidChangeModelContent((e) => {
            M.current || b(E.current.getValue(), e);
          })));
      }, [x, b]),
      H.useEffect(() => {
        if (x) {
          let e = k.current.editor.onDidChangeMarkers((e) => {
            let t = E.current.getModel()?.uri;
            if (t && e.find((e) => e.path === t.path)) {
              let e = k.current.editor.getModelMarkers({ resource: t });
              y?.(e);
            }
          });
          return () => {
            e?.dispose();
          };
        }
        return () => {};
      }, [x, y]),
      z.createElement(cI, {
        width: g,
        height: p,
        isEditorReady: x,
        loading: l,
        _ref: N,
        className: f,
        wrapperProps: m,
      })
    );
  },
  bI = H.memo(vI);
function yI() {
  return globalThis._VSCODE_NLS_MESSAGES;
}
function xI() {
  return globalThis._VSCODE_NLS_LANGUAGE;
}
const wI =
  "pseudo" === xI() ||
  ("undefined" != typeof document &&
    document.location &&
    "string" == typeof document.location.hash &&
    document.location.hash.indexOf("pseudo=true") >= 0);
function CI(e, t) {
  let n;
  return (
    (n =
      0 === t.length
        ? e
        : e.replace(/\{(\d+)\}/g, (e, n) => {
            const i = n[0],
              r = t[i];
            let o = e;
            return (
              "string" == typeof r
                ? (o = r)
                : ("number" != typeof r && "boolean" != typeof r && null != r) || (o = String(r)),
              o
            );
          })),
    wI && (n = "［" + n.replace(/[aouei]/g, "$&$&") + "］"),
    n
  );
}
function SI(e, t, ...n) {
  return CI("number" == typeof e ? kI(e, t) : t, n);
}
function kI(e, t) {
  const n = yI()?.[e];
  if ("string" != typeof n) {
    if ("string" == typeof t) return t;
    throw new Error(`!!! NLS MISSING: ${e} !!!`);
  }
  return n;
}
function EI(e, t, ...n) {
  let i;
  i = "number" == typeof e ? kI(e, t) : t;
  const r = CI(i, n);
  return { value: r, original: t === i ? r : CI(t, n) };
}
const NI = window;
class LI {
  constructor() {
    this.mapWindowIdToZoomFactor = new Map();
  }
  static {
    this.INSTANCE = new LI();
  }
  getZoomFactor(e) {
    return this.mapWindowIdToZoomFactor.get(this.getWindowId(e)) ?? 1;
  }
  getWindowId(e) {
    return e.vscodeWindowId;
  }
}
function DI(e, t, n) {
  ("string" == typeof t && (t = e.matchMedia(t)), t.addEventListener("change", n));
}
function TI(e) {
  return LI.INSTANCE.getZoomFactor(e);
}
const II = navigator.userAgent,
  RI = II.indexOf("Firefox") >= 0,
  OI = II.indexOf("AppleWebKit") >= 0,
  MI = II.indexOf("Chrome") >= 0,
  AI = !MI && II.indexOf("Safari") >= 0,
  PI = !MI && !AI && OI;
II.indexOf("Electron/");
const jI = II.indexOf("Android") >= 0;
let FI = !1;
if ("function" == typeof NI.matchMedia) {
  const e = NI.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),
    t = NI.matchMedia("(display-mode: fullscreen)");
  ((FI = e.matches),
    DI(NI, e, ({ matches: e }) => {
      (FI && t.matches) || (FI = e);
    }));
}
function BI() {
  return globalThis.MonacoEnvironment;
}
const VI = new (class {
  constructor() {
    ((this.listeners = []),
      (this.unexpectedErrorHandler = function (e) {
        setTimeout(() => {
          if (e.stack) {
            if (XI.isErrorNoTelemetry(e)) throw new XI(e.message + "\n\n" + e.stack);
            throw new Error(e.message + "\n\n" + e.stack);
          }
          throw e;
        }, 0);
      }));
  }
  emit(e) {
    this.listeners.forEach((t) => {
      t(e);
    });
  }
  onUnexpectedError(e) {
    (this.unexpectedErrorHandler(e), this.emit(e));
  }
  onUnexpectedExternalError(e) {
    this.unexpectedErrorHandler(e);
  }
})();
function WI(e) {
  VI.onUnexpectedError(e);
}
function HI(e) {
  qI(e) || VI.onUnexpectedError(e);
}
function zI(e) {
  qI(e) || VI.onUnexpectedExternalError(e);
}
function UI(e) {
  if (e instanceof Error) {
    const { name: t, message: n, cause: i } = e;
    return {
      $isError: !0,
      name: t,
      message: n,
      stack: e.stacktrace || e.stack,
      noTelemetry: XI.isErrorNoTelemetry(e),
      cause: i ? UI(i) : void 0,
      code: e.code,
    };
  }
  return e;
}
const $I = "Canceled";
function qI(e) {
  return e instanceof KI || (e instanceof Error && e.name === $I && e.message === $I);
}
class KI extends Error {
  constructor() {
    (super($I), (this.name = this.message));
  }
}
function GI(e) {
  return e ? new Error(`Illegal argument: ${e}`) : new Error("Illegal argument");
}
function ZI(e) {
  return e ? new Error(`Illegal state: ${e}`) : new Error("Illegal state");
}
class YI extends Error {
  constructor(e) {
    (super("NotSupported"), e && (this.message = e));
  }
}
class XI extends Error {
  constructor(e) {
    (super(e), (this.name = "CodeExpectedError"));
  }
  static fromError(e) {
    if (e instanceof XI) return e;
    const t = new XI();
    return ((t.message = e.message), (t.stack = e.stack), t);
  }
  static isErrorNoTelemetry(e) {
    return "CodeExpectedError" === e.name;
  }
}
class QI extends Error {
  constructor(e) {
    (super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this, QI.prototype));
  }
}
function JI(e, t) {
  if (!e) throw new Error(t ? `Assertion failed (${t})` : "Assertion Failed");
}
function eR(e, t = "Unreachable") {
  throw new Error(t);
}
function tR(e, t = "unexpected state") {
  if (!e) {
    throw "string" == typeof t ? new QI(`Assertion Failed: ${t}`) : t;
  }
}
function nR(e, t = "Soft Assertion Failed") {
  e || HI(new QI(t));
}
function iR(e) {
  e() || (e(), HI(new QI("Assertion Failed")));
}
function rR(e, t) {
  let n = 0;
  for (; n < e.length - 1; ) {
    if (!t(e[n], e[n + 1])) return !1;
    n++;
  }
  return !0;
}
function oR(e) {
  return "string" == typeof e;
}
function sR(e) {
  return !(
    "object" != typeof e ||
    null === e ||
    Array.isArray(e) ||
    e instanceof RegExp ||
    e instanceof Date
  );
}
function aR(e) {
  const t = Object.getPrototypeOf(Uint8Array);
  return "object" == typeof e && e instanceof t;
}
function lR(e) {
  return "number" == typeof e && !isNaN(e);
}
function cR(e) {
  return !!e && "function" == typeof e[Symbol.iterator];
}
function dR(e) {
  return !0 === e || !1 === e;
}
function uR(e) {
  return void 0 === e;
}
function hR(e) {
  return !gR(e);
}
function gR(e) {
  return uR(e) || null === e;
}
function pR(e, t) {
  if (!e) throw new Error(t ? `Unexpected type, expected '${t}'` : "Unexpected type");
}
function fR(e) {
  return (tR(null != e, "Argument is `undefined` or `null`."), e);
}
function mR(e) {
  return "function" == typeof e;
}
function _R(e, t) {
  if (oR(t)) {
    if (typeof e !== t) throw new Error(`argument does not match constraint: typeof ${t}`);
  } else if (mR(t)) {
    try {
      if (e instanceof t) return;
    } catch {}
    if (!gR(e) && e.constructor === t) return;
    if (1 === t.length && !0 === t.call(void 0, e)) return;
    throw new Error(
      "argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true",
    );
  }
}
const vR = "en";
let bR,
  yR,
  xR,
  wR = !1,
  CR = !1,
  SR = !1,
  kR = !1,
  ER = !1,
  NR = !1,
  LR = !1,
  DR = vR,
  TR = vR;
const IR = globalThis;
let RR;
void 0 !== IR.vscode && void 0 !== IR.vscode.process
  ? (RR = IR.vscode.process)
  : "undefined" != typeof process && "string" == typeof process?.versions?.node && (RR = process);
const OR = "string" == typeof RR?.versions?.electron && "renderer" === RR?.type;
if ("object" == typeof RR) {
  ((wR = "win32" === RR.platform),
    (CR = "darwin" === RR.platform),
    (SR = "linux" === RR.platform),
    SR && RR.env.SNAP && RR.env.SNAP_REVISION,
    RR.env.CI || RR.env.BUILD_ARTIFACTSTAGINGDIRECTORY || RR.env.GITHUB_WORKSPACE,
    (bR = vR),
    (DR = vR));
  const e = RR.env.VSCODE_NLS_CONFIG;
  if (e)
    try {
      const t = JSON.parse(e);
      ((bR = t.userLocale),
        (TR = t.osLocale),
        (DR = t.resolvedLanguage || vR),
        (yR = t.languagePack?.translationsConfigFile));
    } catch (spt) {}
  kR = !0;
} else
  "object" != typeof navigator ||
    OR ||
    ((xR = navigator.userAgent),
    (wR = xR.indexOf("Windows") >= 0),
    (CR = xR.indexOf("Macintosh") >= 0),
    (NR =
      (xR.indexOf("Macintosh") >= 0 || xR.indexOf("iPad") >= 0 || xR.indexOf("iPhone") >= 0) &&
      !!navigator.maxTouchPoints &&
      navigator.maxTouchPoints > 0),
    (SR = xR.indexOf("Linux") >= 0),
    (LR = xR?.indexOf("Mobi") >= 0),
    (ER = !0),
    (DR = xI() || vR),
    (bR = navigator.language.toLowerCase()),
    (TR = bR));
let MR = 0;
CR ? (MR = 1) : wR ? (MR = 3) : SR && (MR = 2);
const AR = wR,
  PR = CR,
  jR = SR,
  FR = kR,
  BR = ER,
  VR = ER && "function" == typeof IR.importScripts ? IR.origin : void 0,
  WR = NR,
  HR = LR,
  zR = MR,
  UR = xR,
  $R = DR,
  qR = "function" == typeof IR.postMessage && !IR.importScripts,
  KR = (() => {
    if (qR) {
      const e = [];
      IR.addEventListener("message", (t) => {
        if (t.data && t.data.vscodeScheduleAsyncWork)
          for (let n = 0, i = e.length; n < i; n++) {
            const i = e[n];
            if (i.id === t.data.vscodeScheduleAsyncWork) return (e.splice(n, 1), void i.callback());
          }
      });
      let t = 0;
      return (n) => {
        const i = ++t;
        (e.push({ id: i, callback: n }), IR.postMessage({ vscodeScheduleAsyncWork: i }, "*"));
      };
    }
    return (e) => setTimeout(e);
  })(),
  GR = CR || NR ? 2 : wR ? 1 : 3;
let ZR = !0,
  YR = !1;
function XR() {
  if (!YR) {
    YR = !0;
    const e = new Uint8Array(2);
    ((e[0] = 1), (e[1] = 2));
    const t = new Uint16Array(e.buffer);
    ZR = 513 === t[0];
  }
  return ZR;
}
const QR = !!(UR && UR.indexOf("Chrome") >= 0),
  JR = !!(UR && UR.indexOf("Firefox") >= 0),
  eO = !!(!QR && UR && UR.indexOf("Safari") >= 0),
  tO = !!(UR && UR.indexOf("Edg/") >= 0),
  nO = !!(UR && UR.indexOf("Android") >= 0),
  iO =
    (FR ||
      (document.queryCommandSupported && document.queryCommandSupported("copy")) ||
      (navigator && navigator.clipboard && navigator.clipboard.writeText),
    FR || (navigator && navigator.clipboard && navigator.clipboard.readText),
    NI.PointerEvent && ("ontouchstart" in NI || navigator.maxTouchPoints > 0));
class rO {
  constructor() {
    ((this._keyCodeToStr = []), (this._strToKeyCode = Object.create(null)));
  }
  define(e, t) {
    ((this._keyCodeToStr[e] = t), (this._strToKeyCode[t.toLowerCase()] = e));
  }
  keyCodeToStr(e) {
    return this._keyCodeToStr[e];
  }
  strToKeyCode(e) {
    return this._strToKeyCode[e.toLowerCase()] || 0;
  }
}
const oO = new rO(),
  sO = new rO(),
  aO = new rO(),
  lO = new Array(230),
  cO = Object.create(null),
  dO = Object.create(null),
  uO = [];
for (let Set = 0; Set <= 193; Set++) uO[Set] = -1;
var hO;
function gO(e, t) {
  return (e | (((65535 & t) << 16) >>> 0)) >>> 0;
}
function pO(e, t) {
  if ("number" == typeof e) {
    if (0 === e) return null;
    const n = (65535 & e) >>> 0,
      i = (4294901760 & e) >>> 16;
    return new _O(0 !== i ? [fO(n, t), fO(i, t)] : [fO(n, t)]);
  }
  {
    const n = [];
    for (let i = 0; i < e.length; i++) n.push(fO(e[i], t));
    return new _O(n);
  }
}
function fO(e, t) {
  const n = !!(2048 & e),
    i = !!(256 & e);
  return new mO(2 === t ? i : n, !!(1024 & e), !!(512 & e), 2 === t ? n : i, 255 & e);
}
(!(function () {
  const e = "",
    t = [
      [1, 0, "None", 0, "unknown", 0, "VK_UNKNOWN", e, e],
      [1, 1, "Hyper", 0, e, 0, e, e, e],
      [1, 2, "Super", 0, e, 0, e, e, e],
      [1, 3, "Fn", 0, e, 0, e, e, e],
      [1, 4, "FnLock", 0, e, 0, e, e, e],
      [1, 5, "Suspend", 0, e, 0, e, e, e],
      [1, 6, "Resume", 0, e, 0, e, e, e],
      [1, 7, "Turbo", 0, e, 0, e, e, e],
      [1, 8, "Sleep", 0, e, 0, "VK_SLEEP", e, e],
      [1, 9, "WakeUp", 0, e, 0, e, e, e],
      [0, 10, "KeyA", 31, "A", 65, "VK_A", e, e],
      [0, 11, "KeyB", 32, "B", 66, "VK_B", e, e],
      [0, 12, "KeyC", 33, "C", 67, "VK_C", e, e],
      [0, 13, "KeyD", 34, "D", 68, "VK_D", e, e],
      [0, 14, "KeyE", 35, "E", 69, "VK_E", e, e],
      [0, 15, "KeyF", 36, "F", 70, "VK_F", e, e],
      [0, 16, "KeyG", 37, "G", 71, "VK_G", e, e],
      [0, 17, "KeyH", 38, "H", 72, "VK_H", e, e],
      [0, 18, "KeyI", 39, "I", 73, "VK_I", e, e],
      [0, 19, "KeyJ", 40, "J", 74, "VK_J", e, e],
      [0, 20, "KeyK", 41, "K", 75, "VK_K", e, e],
      [0, 21, "KeyL", 42, "L", 76, "VK_L", e, e],
      [0, 22, "KeyM", 43, "M", 77, "VK_M", e, e],
      [0, 23, "KeyN", 44, "N", 78, "VK_N", e, e],
      [0, 24, "KeyO", 45, "O", 79, "VK_O", e, e],
      [0, 25, "KeyP", 46, "P", 80, "VK_P", e, e],
      [0, 26, "KeyQ", 47, "Q", 81, "VK_Q", e, e],
      [0, 27, "KeyR", 48, "R", 82, "VK_R", e, e],
      [0, 28, "KeyS", 49, "S", 83, "VK_S", e, e],
      [0, 29, "KeyT", 50, "T", 84, "VK_T", e, e],
      [0, 30, "KeyU", 51, "U", 85, "VK_U", e, e],
      [0, 31, "KeyV", 52, "V", 86, "VK_V", e, e],
      [0, 32, "KeyW", 53, "W", 87, "VK_W", e, e],
      [0, 33, "KeyX", 54, "X", 88, "VK_X", e, e],
      [0, 34, "KeyY", 55, "Y", 89, "VK_Y", e, e],
      [0, 35, "KeyZ", 56, "Z", 90, "VK_Z", e, e],
      [0, 36, "Digit1", 22, "1", 49, "VK_1", e, e],
      [0, 37, "Digit2", 23, "2", 50, "VK_2", e, e],
      [0, 38, "Digit3", 24, "3", 51, "VK_3", e, e],
      [0, 39, "Digit4", 25, "4", 52, "VK_4", e, e],
      [0, 40, "Digit5", 26, "5", 53, "VK_5", e, e],
      [0, 41, "Digit6", 27, "6", 54, "VK_6", e, e],
      [0, 42, "Digit7", 28, "7", 55, "VK_7", e, e],
      [0, 43, "Digit8", 29, "8", 56, "VK_8", e, e],
      [0, 44, "Digit9", 30, "9", 57, "VK_9", e, e],
      [0, 45, "Digit0", 21, "0", 48, "VK_0", e, e],
      [1, 46, "Enter", 3, "Enter", 13, "VK_RETURN", e, e],
      [1, 47, "Escape", 9, "Escape", 27, "VK_ESCAPE", e, e],
      [1, 48, "Backspace", 1, "Backspace", 8, "VK_BACK", e, e],
      [1, 49, "Tab", 2, "Tab", 9, "VK_TAB", e, e],
      [1, 50, "Space", 10, "Space", 32, "VK_SPACE", e, e],
      [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, e, 0, e, e, e],
      [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", e, e],
      [1, 64, "F1", 59, "F1", 112, "VK_F1", e, e],
      [1, 65, "F2", 60, "F2", 113, "VK_F2", e, e],
      [1, 66, "F3", 61, "F3", 114, "VK_F3", e, e],
      [1, 67, "F4", 62, "F4", 115, "VK_F4", e, e],
      [1, 68, "F5", 63, "F5", 116, "VK_F5", e, e],
      [1, 69, "F6", 64, "F6", 117, "VK_F6", e, e],
      [1, 70, "F7", 65, "F7", 118, "VK_F7", e, e],
      [1, 71, "F8", 66, "F8", 119, "VK_F8", e, e],
      [1, 72, "F9", 67, "F9", 120, "VK_F9", e, e],
      [1, 73, "F10", 68, "F10", 121, "VK_F10", e, e],
      [1, 74, "F11", 69, "F11", 122, "VK_F11", e, e],
      [1, 75, "F12", 70, "F12", 123, "VK_F12", e, e],
      [1, 76, "PrintScreen", 0, e, 0, e, e, e],
      [1, 77, "ScrollLock", 84, "ScrollLock", 145, "VK_SCROLL", e, e],
      [1, 78, "Pause", 7, "PauseBreak", 19, "VK_PAUSE", e, e],
      [1, 79, "Insert", 19, "Insert", 45, "VK_INSERT", e, e],
      [1, 80, "Home", 14, "Home", 36, "VK_HOME", e, e],
      [1, 81, "PageUp", 11, "PageUp", 33, "VK_PRIOR", e, e],
      [1, 82, "Delete", 20, "Delete", 46, "VK_DELETE", e, e],
      [1, 83, "End", 13, "End", 35, "VK_END", e, e],
      [1, 84, "PageDown", 12, "PageDown", 34, "VK_NEXT", e, e],
      [1, 85, "ArrowRight", 17, "RightArrow", 39, "VK_RIGHT", "Right", e],
      [1, 86, "ArrowLeft", 15, "LeftArrow", 37, "VK_LEFT", "Left", e],
      [1, 87, "ArrowDown", 18, "DownArrow", 40, "VK_DOWN", "Down", e],
      [1, 88, "ArrowUp", 16, "UpArrow", 38, "VK_UP", "Up", e],
      [1, 89, "NumLock", 83, "NumLock", 144, "VK_NUMLOCK", e, e],
      [1, 90, "NumpadDivide", 113, "NumPad_Divide", 111, "VK_DIVIDE", e, e],
      [1, 91, "NumpadMultiply", 108, "NumPad_Multiply", 106, "VK_MULTIPLY", e, e],
      [1, 92, "NumpadSubtract", 111, "NumPad_Subtract", 109, "VK_SUBTRACT", e, e],
      [1, 93, "NumpadAdd", 109, "NumPad_Add", 107, "VK_ADD", e, e],
      [1, 94, "NumpadEnter", 3, e, 0, e, e, e],
      [1, 95, "Numpad1", 99, "NumPad1", 97, "VK_NUMPAD1", e, e],
      [1, 96, "Numpad2", 100, "NumPad2", 98, "VK_NUMPAD2", e, e],
      [1, 97, "Numpad3", 101, "NumPad3", 99, "VK_NUMPAD3", e, e],
      [1, 98, "Numpad4", 102, "NumPad4", 100, "VK_NUMPAD4", e, e],
      [1, 99, "Numpad5", 103, "NumPad5", 101, "VK_NUMPAD5", e, e],
      [1, 100, "Numpad6", 104, "NumPad6", 102, "VK_NUMPAD6", e, e],
      [1, 101, "Numpad7", 105, "NumPad7", 103, "VK_NUMPAD7", e, e],
      [1, 102, "Numpad8", 106, "NumPad8", 104, "VK_NUMPAD8", e, e],
      [1, 103, "Numpad9", 107, "NumPad9", 105, "VK_NUMPAD9", e, e],
      [1, 104, "Numpad0", 98, "NumPad0", 96, "VK_NUMPAD0", e, e],
      [1, 105, "NumpadDecimal", 112, "NumPad_Decimal", 110, "VK_DECIMAL", e, e],
      [0, 106, "IntlBackslash", 97, "OEM_102", 226, "VK_OEM_102", e, e],
      [1, 107, "ContextMenu", 58, "ContextMenu", 93, e, e, e],
      [1, 108, "Power", 0, e, 0, e, e, e],
      [1, 109, "NumpadEqual", 0, e, 0, e, e, e],
      [1, 110, "F13", 71, "F13", 124, "VK_F13", e, e],
      [1, 111, "F14", 72, "F14", 125, "VK_F14", e, e],
      [1, 112, "F15", 73, "F15", 126, "VK_F15", e, e],
      [1, 113, "F16", 74, "F16", 127, "VK_F16", e, e],
      [1, 114, "F17", 75, "F17", 128, "VK_F17", e, e],
      [1, 115, "F18", 76, "F18", 129, "VK_F18", e, e],
      [1, 116, "F19", 77, "F19", 130, "VK_F19", e, e],
      [1, 117, "F20", 78, "F20", 131, "VK_F20", e, e],
      [1, 118, "F21", 79, "F21", 132, "VK_F21", e, e],
      [1, 119, "F22", 80, "F22", 133, "VK_F22", e, e],
      [1, 120, "F23", 81, "F23", 134, "VK_F23", e, e],
      [1, 121, "F24", 82, "F24", 135, "VK_F24", e, e],
      [1, 122, "Open", 0, e, 0, e, e, e],
      [1, 123, "Help", 0, e, 0, e, e, e],
      [1, 124, "Select", 0, e, 0, e, e, e],
      [1, 125, "Again", 0, e, 0, e, e, e],
      [1, 126, "Undo", 0, e, 0, e, e, e],
      [1, 127, "Cut", 0, e, 0, e, e, e],
      [1, 128, "Copy", 0, e, 0, e, e, e],
      [1, 129, "Paste", 0, e, 0, e, e, e],
      [1, 130, "Find", 0, e, 0, e, e, e],
      [1, 131, "AudioVolumeMute", 117, "AudioVolumeMute", 173, "VK_VOLUME_MUTE", e, e],
      [1, 132, "AudioVolumeUp", 118, "AudioVolumeUp", 175, "VK_VOLUME_UP", e, e],
      [1, 133, "AudioVolumeDown", 119, "AudioVolumeDown", 174, "VK_VOLUME_DOWN", e, e],
      [1, 134, "NumpadComma", 110, "NumPad_Separator", 108, "VK_SEPARATOR", e, e],
      [0, 135, "IntlRo", 115, "ABNT_C1", 193, "VK_ABNT_C1", e, e],
      [1, 136, "KanaMode", 0, e, 0, e, e, e],
      [0, 137, "IntlYen", 0, e, 0, e, e, e],
      [1, 138, "Convert", 0, e, 0, e, e, e],
      [1, 139, "NonConvert", 0, e, 0, e, e, e],
      [1, 140, "Lang1", 0, e, 0, e, e, e],
      [1, 141, "Lang2", 0, e, 0, e, e, e],
      [1, 142, "Lang3", 0, e, 0, e, e, e],
      [1, 143, "Lang4", 0, e, 0, e, e, e],
      [1, 144, "Lang5", 0, e, 0, e, e, e],
      [1, 145, "Abort", 0, e, 0, e, e, e],
      [1, 146, "Props", 0, e, 0, e, e, e],
      [1, 147, "NumpadParenLeft", 0, e, 0, e, e, e],
      [1, 148, "NumpadParenRight", 0, e, 0, e, e, e],
      [1, 149, "NumpadBackspace", 0, e, 0, e, e, e],
      [1, 150, "NumpadMemoryStore", 0, e, 0, e, e, e],
      [1, 151, "NumpadMemoryRecall", 0, e, 0, e, e, e],
      [1, 152, "NumpadMemoryClear", 0, e, 0, e, e, e],
      [1, 153, "NumpadMemoryAdd", 0, e, 0, e, e, e],
      [1, 154, "NumpadMemorySubtract", 0, e, 0, e, e, e],
      [1, 155, "NumpadClear", 131, "Clear", 12, "VK_CLEAR", e, e],
      [1, 156, "NumpadClearEntry", 0, e, 0, e, e, e],
      [1, 0, e, 5, "Ctrl", 17, "VK_CONTROL", e, e],
      [1, 0, e, 4, "Shift", 16, "VK_SHIFT", e, e],
      [1, 0, e, 6, "Alt", 18, "VK_MENU", e, e],
      [1, 0, e, 57, "Meta", 91, "VK_COMMAND", e, e],
      [1, 157, "ControlLeft", 5, e, 0, "VK_LCONTROL", e, e],
      [1, 158, "ShiftLeft", 4, e, 0, "VK_LSHIFT", e, e],
      [1, 159, "AltLeft", 6, e, 0, "VK_LMENU", e, e],
      [1, 160, "MetaLeft", 57, e, 0, "VK_LWIN", e, e],
      [1, 161, "ControlRight", 5, e, 0, "VK_RCONTROL", e, e],
      [1, 162, "ShiftRight", 4, e, 0, "VK_RSHIFT", e, e],
      [1, 163, "AltRight", 6, e, 0, "VK_RMENU", e, e],
      [1, 164, "MetaRight", 57, e, 0, "VK_RWIN", e, e],
      [1, 165, "BrightnessUp", 0, e, 0, e, e, e],
      [1, 166, "BrightnessDown", 0, e, 0, e, e, e],
      [1, 167, "MediaPlay", 0, e, 0, e, e, e],
      [1, 168, "MediaRecord", 0, e, 0, e, e, e],
      [1, 169, "MediaFastForward", 0, e, 0, e, e, e],
      [1, 170, "MediaRewind", 0, e, 0, e, e, e],
      [1, 171, "MediaTrackNext", 124, "MediaTrackNext", 176, "VK_MEDIA_NEXT_TRACK", e, e],
      [1, 172, "MediaTrackPrevious", 125, "MediaTrackPrevious", 177, "VK_MEDIA_PREV_TRACK", e, e],
      [1, 173, "MediaStop", 126, "MediaStop", 178, "VK_MEDIA_STOP", e, e],
      [1, 174, "Eject", 0, e, 0, e, e, e],
      [1, 175, "MediaPlayPause", 127, "MediaPlayPause", 179, "VK_MEDIA_PLAY_PAUSE", e, e],
      [1, 176, "MediaSelect", 128, "LaunchMediaPlayer", 181, "VK_MEDIA_LAUNCH_MEDIA_SELECT", e, e],
      [1, 177, "LaunchMail", 129, "LaunchMail", 180, "VK_MEDIA_LAUNCH_MAIL", e, e],
      [1, 178, "LaunchApp2", 130, "LaunchApp2", 183, "VK_MEDIA_LAUNCH_APP2", e, e],
      [1, 179, "LaunchApp1", 0, e, 0, "VK_MEDIA_LAUNCH_APP1", e, e],
      [1, 180, "SelectTask", 0, e, 0, e, e, e],
      [1, 181, "LaunchScreenSaver", 0, e, 0, e, e, e],
      [1, 182, "BrowserSearch", 120, "BrowserSearch", 170, "VK_BROWSER_SEARCH", e, e],
      [1, 183, "BrowserHome", 121, "BrowserHome", 172, "VK_BROWSER_HOME", e, e],
      [1, 184, "BrowserBack", 122, "BrowserBack", 166, "VK_BROWSER_BACK", e, e],
      [1, 185, "BrowserForward", 123, "BrowserForward", 167, "VK_BROWSER_FORWARD", e, e],
      [1, 186, "BrowserStop", 0, e, 0, "VK_BROWSER_STOP", e, e],
      [1, 187, "BrowserRefresh", 0, e, 0, "VK_BROWSER_REFRESH", e, e],
      [1, 188, "BrowserFavorites", 0, e, 0, "VK_BROWSER_FAVORITES", e, e],
      [1, 189, "ZoomToggle", 0, e, 0, e, e, e],
      [1, 190, "MailReply", 0, e, 0, e, e, e],
      [1, 191, "MailForward", 0, e, 0, e, e, e],
      [1, 192, "MailSend", 0, e, 0, e, e, e],
      [1, 0, e, 114, "KeyInComposition", 229, e, e, e],
      [1, 0, e, 116, "ABNT_C2", 194, "VK_ABNT_C2", e, e],
      [1, 0, e, 96, "OEM_8", 223, "VK_OEM_8", e, e],
      [1, 0, e, 0, e, 0, "VK_KANA", e, e],
      [1, 0, e, 0, e, 0, "VK_HANGUL", e, e],
      [1, 0, e, 0, e, 0, "VK_JUNJA", e, e],
      [1, 0, e, 0, e, 0, "VK_FINAL", e, e],
      [1, 0, e, 0, e, 0, "VK_HANJA", e, e],
      [1, 0, e, 0, e, 0, "VK_KANJI", e, e],
      [1, 0, e, 0, e, 0, "VK_CONVERT", e, e],
      [1, 0, e, 0, e, 0, "VK_NONCONVERT", e, e],
      [1, 0, e, 0, e, 0, "VK_ACCEPT", e, e],
      [1, 0, e, 0, e, 0, "VK_MODECHANGE", e, e],
      [1, 0, e, 0, e, 0, "VK_SELECT", e, e],
      [1, 0, e, 0, e, 0, "VK_PRINT", e, e],
      [1, 0, e, 0, e, 0, "VK_EXECUTE", e, e],
      [1, 0, e, 0, e, 0, "VK_SNAPSHOT", e, e],
      [1, 0, e, 0, e, 0, "VK_HELP", e, e],
      [1, 0, e, 0, e, 0, "VK_APPS", e, e],
      [1, 0, e, 0, e, 0, "VK_PROCESSKEY", e, e],
      [1, 0, e, 0, e, 0, "VK_PACKET", e, e],
      [1, 0, e, 0, e, 0, "VK_DBE_SBCSCHAR", e, e],
      [1, 0, e, 0, e, 0, "VK_DBE_DBCSCHAR", e, e],
      [1, 0, e, 0, e, 0, "VK_ATTN", e, e],
      [1, 0, e, 0, e, 0, "VK_CRSEL", e, e],
      [1, 0, e, 0, e, 0, "VK_EXSEL", e, e],
      [1, 0, e, 0, e, 0, "VK_EREOF", e, e],
      [1, 0, e, 0, e, 0, "VK_PLAY", e, e],
      [1, 0, e, 0, e, 0, "VK_ZOOM", e, e],
      [1, 0, e, 0, e, 0, "VK_NONAME", e, e],
      [1, 0, e, 0, e, 0, "VK_PA1", e, e],
      [1, 0, e, 0, e, 0, "VK_OEM_CLEAR", e, e],
    ],
    n = [],
    i = [];
  for (const r of t) {
    const [e, t, o, s, a, l, c, d, u] = r;
    if ((i[t] || ((i[t] = !0), (cO[o] = t), (dO[o.toLowerCase()] = t), e && (uO[t] = s)), !n[s])) {
      if (((n[s] = !0), !a))
        throw new Error(`String representation missing for key code ${s} around scan code ${o}`);
      (oO.define(s, a), sO.define(s, d || a), aO.define(s, u || d || a));
    }
    l && (lO[l] = s);
  }
})(),
  (function (e) {
    ((e.toString = function (e) {
      return oO.keyCodeToStr(e);
    }),
      (e.fromString = function (e) {
        return oO.strToKeyCode(e);
      }),
      (e.toUserSettingsUS = function (e) {
        return sO.keyCodeToStr(e);
      }),
      (e.toUserSettingsGeneral = function (e) {
        return aO.keyCodeToStr(e);
      }),
      (e.fromUserSettings = function (e) {
        return sO.strToKeyCode(e) || aO.strToKeyCode(e);
      }),
      (e.toElectronAccelerator = function (e) {
        if (e >= 98 && e <= 113) return null;
        switch (e) {
          case 16:
            return "Up";
          case 18:
            return "Down";
          case 15:
            return "Left";
          case 17:
            return "Right";
        }
        return oO.keyCodeToStr(e);
      }));
  })(hO || (hO = {})));
class mO {
  constructor(e, t, n, i, r) {
    ((this.ctrlKey = e),
      (this.shiftKey = t),
      (this.altKey = n),
      (this.metaKey = i),
      (this.keyCode = r));
  }
  equals(e) {
    return (
      e instanceof mO &&
      this.ctrlKey === e.ctrlKey &&
      this.shiftKey === e.shiftKey &&
      this.altKey === e.altKey &&
      this.metaKey === e.metaKey &&
      this.keyCode === e.keyCode
    );
  }
  isModifierKey() {
    return (
      0 === this.keyCode ||
      5 === this.keyCode ||
      57 === this.keyCode ||
      6 === this.keyCode ||
      4 === this.keyCode
    );
  }
  isDuplicateModifierCase() {
    return (
      (this.ctrlKey && 5 === this.keyCode) ||
      (this.shiftKey && 4 === this.keyCode) ||
      (this.altKey && 6 === this.keyCode) ||
      (this.metaKey && 57 === this.keyCode)
    );
  }
}
class _O {
  constructor(e) {
    if (0 === e.length) throw GI("chords");
    this.chords = e;
  }
}
class vO {
  constructor(e, t, n, i, r, o) {
    ((this.ctrlKey = e),
      (this.shiftKey = t),
      (this.altKey = n),
      (this.metaKey = i),
      (this.keyLabel = r),
      (this.keyAriaLabel = o));
  }
}
class bO {}
const yO = PR ? 256 : 2048,
  xO = PR ? 2048 : 256;
class wO {
  constructor(e) {
    this._standardKeyboardEventBrand = !0;
    const t = e;
    ((this.browserEvent = t),
      (this.target = t.target),
      (this.ctrlKey = t.ctrlKey),
      (this.shiftKey = t.shiftKey),
      (this.altKey = t.altKey),
      (this.metaKey = t.metaKey),
      (this.altGraphKey = t.getModifierState?.("AltGraph")),
      (this.keyCode = (function (e) {
        if (e.charCode) {
          const t = String.fromCharCode(e.charCode).toUpperCase();
          return hO.fromString(t);
        }
        const t = e.keyCode;
        if (3 === t) return 7;
        if (RI)
          switch (t) {
            case 59:
              return 85;
            case 60:
              if (jR) return 97;
              break;
            case 61:
              return 86;
            case 107:
              return 109;
            case 109:
              return 111;
            case 173:
              return 88;
            case 224:
              if (PR) return 57;
          }
        else if (OI) {
          if (PR && 93 === t) return 57;
          if (!PR && 92 === t) return 57;
        }
        return lO[t] || 0;
      })(t)),
      (this.code = t.code),
      (this.ctrlKey = this.ctrlKey || 5 === this.keyCode),
      (this.altKey = this.altKey || 6 === this.keyCode),
      (this.shiftKey = this.shiftKey || 4 === this.keyCode),
      (this.metaKey = this.metaKey || 57 === this.keyCode),
      (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(e) {
    return this._asKeybinding === e;
  }
  _computeKeybinding() {
    let e = 0;
    5 !== this.keyCode &&
      4 !== this.keyCode &&
      6 !== this.keyCode &&
      57 !== this.keyCode &&
      (e = this.keyCode);
    let t = 0;
    return (
      this.ctrlKey && (t |= yO),
      this.altKey && (t |= 512),
      this.shiftKey && (t |= 1024),
      this.metaKey && (t |= xO),
      (t |= e),
      t
    );
  }
  _computeKeyCodeChord() {
    let e = 0;
    return (
      5 !== this.keyCode &&
        4 !== this.keyCode &&
        6 !== this.keyCode &&
        57 !== this.keyCode &&
        (e = this.keyCode),
      new mO(this.ctrlKey, this.shiftKey, this.altKey, this.metaKey, e)
    );
  }
}
const CO = new WeakMap();
function SO(e) {
  if (!e.parent || e.parent === e) return null;
  try {
    const t = e.location,
      n = e.parent.location;
    if ("null" !== t.origin && "null" !== n.origin && t.origin !== n.origin) return null;
  } catch (spt) {
    return null;
  }
  return e.parent;
}
class kO {
  static getSameOriginWindowChain(e) {
    let t = CO.get(e);
    if (!t) {
      ((t = []), CO.set(e, t));
      let n,
        i = e;
      do {
        ((n = SO(i)),
          n
            ? t.push({ window: new WeakRef(i), iframeElement: i.frameElement || null })
            : t.push({ window: new WeakRef(i), iframeElement: null }),
          (i = n));
      } while (i);
    }
    return t.slice(0);
  }
  static getPositionOfChildWindowRelativeToAncestorWindow(e, t) {
    if (!t || e === t) return { top: 0, left: 0 };
    let n = 0,
      i = 0;
    const r = this.getSameOriginWindowChain(e);
    for (const o of r) {
      const e = o.window.deref();
      if (((n += e?.scrollY ?? 0), (i += e?.scrollX ?? 0), e === t)) break;
      if (!o.iframeElement) break;
      const r = o.iframeElement.getBoundingClientRect();
      ((n += r.top), (i += r.left));
    }
    return { top: n, left: i };
  }
}
class EO {
  constructor(e, t) {
    ((this.timestamp = Date.now()),
      (this.browserEvent = t),
      (this.leftButton = 0 === t.button),
      (this.middleButton = 1 === t.button),
      (this.rightButton = 2 === t.button),
      (this.buttons = t.buttons),
      (this.defaultPrevented = t.defaultPrevented),
      (this.target = t.target),
      (this.detail = t.detail || 1),
      "dblclick" === t.type && (this.detail = 2),
      (this.ctrlKey = t.ctrlKey),
      (this.shiftKey = t.shiftKey),
      (this.altKey = t.altKey),
      (this.metaKey = t.metaKey),
      "number" == typeof t.pageX
        ? ((this.posx = t.pageX), (this.posy = t.pageY))
        : ((this.posx =
            t.clientX +
            this.target.ownerDocument.body.scrollLeft +
            this.target.ownerDocument.documentElement.scrollLeft),
          (this.posy =
            t.clientY +
            this.target.ownerDocument.body.scrollTop +
            this.target.ownerDocument.documentElement.scrollTop)));
    const n = kO.getPositionOfChildWindowRelativeToAncestorWindow(e, t.view);
    ((this.posx -= n.left), (this.posy -= n.top));
  }
  preventDefault() {
    this.browserEvent.preventDefault();
  }
  stopPropagation() {
    this.browserEvent.stopPropagation();
  }
}
class NO {
  constructor(e, t = 0, n = 0) {
    ((this.browserEvent = e || null),
      (this.target = e ? e.target || e.targetNode || e.srcElement : null),
      (this.deltaY = n),
      (this.deltaX = t));
    let i = !1;
    if (MI) {
      const e = navigator.userAgent.match(/Chrome\/(\d+)/);
      i = (e ? parseInt(e[1]) : 123) <= 122;
    }
    if (e) {
      const t = e,
        n = e,
        r = e.view?.devicePixelRatio || 1;
      if (void 0 !== t.wheelDeltaY)
        this.deltaY = i ? t.wheelDeltaY / (120 * r) : t.wheelDeltaY / 120;
      else if (void 0 !== n.VERTICAL_AXIS && n.axis === n.VERTICAL_AXIS)
        this.deltaY = -n.detail / 3;
      else if ("wheel" === e.type) {
        const t = e;
        t.deltaMode === t.DOM_DELTA_LINE
          ? (this.deltaY = RI && !PR ? -e.deltaY / 3 : -e.deltaY)
          : (this.deltaY = -e.deltaY / 40);
      }
      if (void 0 !== t.wheelDeltaX)
        this.deltaX =
          AI && AR ? -t.wheelDeltaX / 120 : i ? t.wheelDeltaX / (120 * r) : t.wheelDeltaX / 120;
      else if (void 0 !== n.HORIZONTAL_AXIS && n.axis === n.HORIZONTAL_AXIS)
        this.deltaX = -e.detail / 3;
      else if ("wheel" === e.type) {
        const t = e;
        t.deltaMode === t.DOM_DELTA_LINE
          ? (this.deltaX = RI && !PR ? -e.deltaX / 3 : -e.deltaX)
          : (this.deltaX = -e.deltaX / 40);
      }
      0 === this.deltaY &&
        0 === this.deltaX &&
        e.wheelDelta &&
        (this.deltaY = i ? e.wheelDelta / (120 * r) : e.wheelDelta / 120);
    }
  }
  preventDefault() {
    this.browserEvent?.preventDefault();
  }
  stopPropagation() {
    this.browserEvent?.stopPropagation();
  }
}
function LO(e, t) {
  const n = this;
  let i,
    r = !1;
  return function () {
    return (r || ((r = !0), (i = e.apply(n, arguments))), i);
  };
}
var DO;
function TO(e) {
  return (
    "object" == typeof e && null !== e && "function" == typeof e.dispose && 0 === e.dispose.length
  );
}
function IO(e) {
  if (DO.is(e)) {
    const t = [];
    for (const n of e)
      if (n)
        try {
          n.dispose();
        } catch (spt) {
          t.push(spt);
        }
    if (1 === t.length) throw t[0];
    if (t.length > 1) throw new AggregateError(t, "Encountered errors while disposing of store");
    return Array.isArray(e) ? [] : e;
  }
  if (e) return (e.dispose(), e);
}
function RO(...e) {
  return MO(() => IO(e));
}
!(function (e) {
  function t(e) {
    return !!e && "object" == typeof e && "function" == typeof e[Symbol.iterator];
  }
  e.is = t;
  const n = Object.freeze([]);
  function* i(e) {
    yield e;
  }
  ((e.empty = function () {
    return n;
  }),
    (e.single = i),
    (e.wrap = function (e) {
      return t(e) ? e : i(e);
    }),
    (e.from = function (e) {
      return e || n;
    }),
    (e.reverse = function* (e) {
      for (let t = e.length - 1; t >= 0; t--) yield e[t];
    }),
    (e.isEmpty = function (e) {
      return !e || !0 === e[Symbol.iterator]().next().done;
    }),
    (e.first = function (e) {
      return e[Symbol.iterator]().next().value;
    }),
    (e.some = function (e, t) {
      let n = 0;
      for (const i of e) if (t(i, n++)) return !0;
      return !1;
    }),
    (e.every = function (e, t) {
      let n = 0;
      for (const i of e) if (!t(i, n++)) return !1;
      return !0;
    }),
    (e.find = function (e, t) {
      for (const n of e) if (t(n)) return n;
    }),
    (e.filter = function* (e, t) {
      for (const n of e) t(n) && (yield n);
    }),
    (e.map = function* (e, t) {
      let n = 0;
      for (const i of e) yield t(i, n++);
    }),
    (e.flatMap = function* (e, t) {
      let n = 0;
      for (const i of e) yield* t(i, n++);
    }),
    (e.concat = function* (...e) {
      for (const t of e) cR(t) ? yield* t : yield t;
    }),
    (e.reduce = function (e, t, n) {
      let i = n;
      for (const r of e) i = t(i, r);
      return i;
    }),
    (e.length = function (e) {
      let t = 0;
      for (const n of e) t++;
      return t;
    }),
    (e.slice = function* (e, t, n = e.length) {
      for (
        t < -e.length && (t = 0),
          t < 0 && (t += e.length),
          n < 0 ? (n += e.length) : n > e.length && (n = e.length);
        t < n;
        t++
      )
        yield e[t];
    }),
    (e.consume = function (t, n = Number.POSITIVE_INFINITY) {
      const i = [];
      if (0 === n) return [i, t];
      const r = t[Symbol.iterator]();
      for (let o = 0; o < n; o++) {
        const t = r.next();
        if (t.done) return [i, e.empty()];
        i.push(t.value);
      }
      return [i, { [Symbol.iterator]: () => r }];
    }),
    (e.asyncToArray = async function (e) {
      const t = [];
      for await (const n of e) t.push(n);
      return t;
    }),
    (e.asyncToArrayFlat = async function (e) {
      let t = [];
      for await (const n of e) t = t.concat(n);
      return t;
    }));
})(DO || (DO = {}));
class OO {
  constructor(e) {
    ((this._isDisposed = !1), (this._fn = e));
  }
  dispose() {
    if (!this._isDisposed) {
      if (!this._fn)
        throw new Error(
          "Unbound disposable context: Need to use an arrow function to preserve the value of this",
        );
      ((this._isDisposed = !0), this._fn());
    }
  }
}
function MO(e) {
  return new OO(e);
}
let AO = class e {
    static {
      this.DISABLE_DISPOSED_WARNING = !1;
    }
    constructor() {
      ((this._toDispose = new Set()), (this._isDisposed = !1));
    }
    dispose() {
      this._isDisposed || ((this._isDisposed = !0), this.clear());
    }
    get isDisposed() {
      return this._isDisposed;
    }
    clear() {
      if (0 !== this._toDispose.size)
        try {
          IO(this._toDispose);
        } finally {
          this._toDispose.clear();
        }
    }
    add(t) {
      if (!t || t === PO.None) return t;
      if (t === this) throw new Error("Cannot register a disposable on itself!");
      return (this._isDisposed ? e.DISABLE_DISPOSED_WARNING : this._toDispose.add(t), t);
    }
    delete(e) {
      if (e) {
        if (e === this) throw new Error("Cannot dispose a disposable on itself!");
        (this._toDispose.delete(e), e.dispose());
      }
    }
  },
  PO = class {
    static {
      this.None = Object.freeze({ dispose() {} });
    }
    constructor() {
      ((this._store = new AO()), this._store);
    }
    dispose() {
      this._store.dispose();
    }
    _register(e) {
      if (e === this) throw new Error("Cannot register a disposable on itself!");
      return this._store.add(e);
    }
  };
class jO {
  constructor() {
    this._isDisposed = !1;
  }
  get value() {
    return this._isDisposed ? void 0 : this._value;
  }
  set value(e) {
    this._isDisposed || e === this._value || (this._value?.dispose(), (this._value = e));
  }
  clear() {
    this.value = void 0;
  }
  dispose() {
    ((this._isDisposed = !0), this._value?.dispose(), (this._value = void 0));
  }
}
class FO {
  constructor(e) {
    ((this._disposable = e), (this._counter = 1));
  }
  acquire() {
    return (this._counter++, this);
  }
  release() {
    return (0 === --this._counter && this._disposable.dispose(), this);
  }
}
class BO {
  constructor(e) {
    this.object = e;
  }
  dispose() {}
}
class VO {
  constructor() {
    ((this._store = new Map()), (this._isDisposed = !1));
  }
  dispose() {
    ((this._isDisposed = !0), this.clearAndDisposeAll());
  }
  clearAndDisposeAll() {
    if (this._store.size)
      try {
        IO(this._store.values());
      } finally {
        this._store.clear();
      }
  }
  get(e) {
    return this._store.get(e);
  }
  set(e, t, n = !1) {
    (this._isDisposed, n || this._store.get(e)?.dispose(), this._store.set(e, t));
  }
  deleteAndDispose(e) {
    (this._store.get(e)?.dispose(), this._store.delete(e));
  }
  values() {
    return this._store.values();
  }
  [Symbol.iterator]() {
    return this._store[Symbol.iterator]();
  }
}
let WO = class e {
  static {
    this.Undefined = new e(void 0);
  }
  constructor(t) {
    ((this.element = t), (this.next = e.Undefined), (this.prev = e.Undefined));
  }
};
class HO {
  constructor() {
    ((this._first = WO.Undefined), (this._last = WO.Undefined), (this._size = 0));
  }
  get size() {
    return this._size;
  }
  isEmpty() {
    return this._first === WO.Undefined;
  }
  clear() {
    let e = this._first;
    for (; e !== WO.Undefined; ) {
      const t = e.next;
      ((e.prev = WO.Undefined), (e.next = WO.Undefined), (e = t));
    }
    ((this._first = WO.Undefined), (this._last = WO.Undefined), (this._size = 0));
  }
  unshift(e) {
    return this._insert(e, !1);
  }
  push(e) {
    return this._insert(e, !0);
  }
  _insert(e, t) {
    const n = new WO(e);
    if (this._first === WO.Undefined) ((this._first = n), (this._last = n));
    else if (t) {
      const e = this._last;
      ((this._last = n), (n.prev = e), (e.next = n));
    } else {
      const e = this._first;
      ((this._first = n), (n.next = e), (e.prev = n));
    }
    this._size += 1;
    let i = !1;
    return () => {
      i || ((i = !0), this._remove(n));
    };
  }
  shift() {
    if (this._first !== WO.Undefined) {
      const e = this._first.element;
      return (this._remove(this._first), e);
    }
  }
  pop() {
    if (this._last !== WO.Undefined) {
      const e = this._last.element;
      return (this._remove(this._last), e);
    }
  }
  _remove(e) {
    if (e.prev !== WO.Undefined && e.next !== WO.Undefined) {
      const t = e.prev;
      ((t.next = e.next), (e.next.prev = t));
    } else
      e.prev === WO.Undefined && e.next === WO.Undefined
        ? ((this._first = WO.Undefined), (this._last = WO.Undefined))
        : e.next === WO.Undefined
          ? ((this._last = this._last.prev), (this._last.next = WO.Undefined))
          : e.prev === WO.Undefined &&
            ((this._first = this._first.next), (this._first.prev = WO.Undefined));
    this._size -= 1;
  }
  *[Symbol.iterator]() {
    let e = this._first;
    for (; e !== WO.Undefined; ) (yield e.element, (e = e.next));
  }
}
const zO = globalThis.performance.now.bind(globalThis.performance);
class UO {
  static create(e) {
    return new UO(e);
  }
  constructor(e) {
    ((this._now = !1 === e ? Date.now : zO),
      (this._startTime = this._now()),
      (this._stopTime = -1));
  }
  stop() {
    this._stopTime = this._now();
  }
  reset() {
    ((this._startTime = this._now()), (this._stopTime = -1));
  }
  elapsed() {
    return -1 !== this._stopTime ? this._stopTime - this._startTime : this._now() - this._startTime;
  }
}
var $O;
!(function (e) {
  function t(e) {
    return (t, n = null, i) => {
      let r,
        o = !1;
      return (
        (r = e(
          (e) => {
            if (!o) return (r ? r.dispose() : (o = !0), t.call(n, e));
          },
          null,
          i,
        )),
        o && r.dispose(),
        r
      );
    };
  }
  function n(e, t, n) {
    return r((n, i = null, r) => e((e) => n.call(i, t(e)), null, r), n);
  }
  function i(e, t, n) {
    return r((n, i = null, r) => e((e) => t(e) && n.call(i, e), null, r), n);
  }
  function r(e, t) {
    let n;
    const i = new QO({
      onWillAddFirstListener() {
        n = e(i.fire, i);
      },
      onDidRemoveLastListener() {
        n?.dispose();
      },
    });
    return (t?.add(i), i.event);
  }
  function o(e, t, n = 100, i = !1, r = !1, o, s) {
    let a,
      l,
      c,
      d,
      u = 0;
    const h = new QO({
      leakWarningThreshold: o,
      onWillAddFirstListener() {
        a = e((e) => {
          (u++,
            (l = t(l, e)),
            i && !c && (h.fire(l), (l = void 0)),
            (d = () => {
              const e = l;
              ((l = void 0), (c = void 0), (!i || u > 1) && h.fire(e), (u = 0));
            }),
            "number" == typeof n
              ? (c && clearTimeout(c), (c = setTimeout(d, n)))
              : void 0 === c && ((c = null), queueMicrotask(d)));
        });
      },
      onWillRemoveListener() {
        r && u > 0 && d?.();
      },
      onDidRemoveLastListener() {
        ((d = void 0), a.dispose());
      },
    });
    return (s?.add(h), h.event);
  }
  ((e.None = () => PO.None),
    (e.defer = function (e, t) {
      return o(e, () => {}, 0, void 0, !0, void 0, t);
    }),
    (e.once = t),
    (e.onceIf = function (t, n) {
      return e.once(e.filter(t, n));
    }),
    (e.map = n),
    (e.forEach = function (e, t, n) {
      return r(
        (n, i = null, r) =>
          e(
            (e) => {
              (t(e), n.call(i, e));
            },
            null,
            r,
          ),
        n,
      );
    }),
    (e.filter = i),
    (e.signal = function (e) {
      return e;
    }),
    (e.any = function (...e) {
      return (t, n = null, i) => {
        const r = RO(...e.map((e) => e((e) => t.call(n, e))));
        return (function (e, t) {
          t instanceof Array ? t.push(e) : t && t.add(e);
          return e;
        })(r, i);
      };
    }),
    (e.reduce = function (e, t, i, r) {
      let o = i;
      return n(e, (e) => ((o = t(o, e)), o), r);
    }),
    (e.debounce = o),
    (e.accumulate = function (t, n = 0, i) {
      return e.debounce(t, (e, t) => (e ? (e.push(t), e) : [t]), n, void 0, !0, void 0, i);
    }),
    (e.latch = function (e, t = (e, t) => e === t, n) {
      let r,
        o = !0;
      return i(
        e,
        (e) => {
          const n = o || !t(e, r);
          return ((o = !1), (r = e), n);
        },
        n,
      );
    }),
    (e.split = function (t, n, i) {
      return [e.filter(t, n, i), e.filter(t, (e) => !n(e), i)];
    }),
    (e.buffer = function (e, t = !1, n = [], i) {
      let r = n.slice(),
        o = e((e) => {
          r ? r.push(e) : a.fire(e);
        });
      i && i.add(o);
      const s = () => {
          (r?.forEach((e) => a.fire(e)), (r = null));
        },
        a = new QO({
          onWillAddFirstListener() {
            o || ((o = e((e) => a.fire(e))), i && i.add(o));
          },
          onDidAddFirstListener() {
            r && (t ? setTimeout(s) : s());
          },
          onDidRemoveLastListener() {
            (o && o.dispose(), (o = null));
          },
        });
      return (i && i.add(a), a.event);
    }),
    (e.chain = function (e, t) {
      return (n, i, r) => {
        const o = t(new a());
        return e(
          function (e) {
            const t = o.evaluate(e);
            t !== s && n.call(i, t);
          },
          void 0,
          r,
        );
      };
    }));
  const s = Symbol("HaltChainable");
  class a {
    constructor() {
      this.steps = [];
    }
    map(e) {
      return (this.steps.push(e), this);
    }
    forEach(e) {
      return (this.steps.push((t) => (e(t), t)), this);
    }
    filter(e) {
      return (this.steps.push((t) => (e(t) ? t : s)), this);
    }
    reduce(e, t) {
      let n = t;
      return (this.steps.push((t) => ((n = e(n, t)), n)), this);
    }
    latch(e = (e, t) => e === t) {
      let t,
        n = !0;
      return (
        this.steps.push((i) => {
          const r = n || !e(i, t);
          return ((n = !1), (t = i), r ? i : s);
        }),
        this
      );
    }
    evaluate(e) {
      for (const t of this.steps) if ((e = t(e)) === s) break;
      return e;
    }
  }
  ((e.fromNodeEventEmitter = function (e, t, n = (e) => e) {
    const i = (...e) => r.fire(n(...e)),
      r = new QO({
        onWillAddFirstListener: () => e.on(t, i),
        onDidRemoveLastListener: () => e.removeListener(t, i),
      });
    return r.event;
  }),
    (e.fromDOMEventEmitter = function (e, t, n = (e) => e) {
      const i = (...e) => r.fire(n(...e)),
        r = new QO({
          onWillAddFirstListener: () => e.addEventListener(t, i),
          onDidRemoveLastListener: () => e.removeEventListener(t, i),
        });
      return r.event;
    }),
    (e.toPromise = function (e, n) {
      let i;
      const r = new Promise((r, o) => {
        const s = t(e)(r, null, n);
        i = () => s.dispose();
      });
      return ((r.cancel = i), r);
    }),
    (e.forward = function (e, t) {
      return e((e) => t.fire(e));
    }),
    (e.runAndSubscribe = function (e, t, n) {
      return (t(n), e((e) => t(e)));
    }));
  class l {
    constructor(e, t) {
      ((this._observable = e), (this._counter = 0), (this._hasChanged = !1));
      const n = {
        onWillAddFirstListener: () => {
          (e.addObserver(this), this._observable.reportChanges());
        },
        onDidRemoveLastListener: () => {
          e.removeObserver(this);
        },
      };
      ((this.emitter = new QO(n)), t && t.add(this.emitter));
    }
    beginUpdate(e) {
      this._counter++;
    }
    handlePossibleChange(e) {}
    handleChange(e, t) {
      this._hasChanged = !0;
    }
    endUpdate(e) {
      (this._counter--,
        0 === this._counter &&
          (this._observable.reportChanges(),
          this._hasChanged &&
            ((this._hasChanged = !1), this.emitter.fire(this._observable.get()))));
    }
  }
  ((e.fromObservable = function (e, t) {
    return new l(e, t).emitter.event;
  }),
    (e.fromObservableLight = function (e) {
      return (t, n, i) => {
        let r = 0,
          o = !1;
        const s = {
          beginUpdate() {
            r++;
          },
          endUpdate() {
            (r--, 0 === r && (e.reportChanges(), o && ((o = !1), t.call(n))));
          },
          handlePossibleChange() {},
          handleChange() {
            o = !0;
          },
        };
        (e.addObserver(s), e.reportChanges());
        const a = {
          dispose() {
            e.removeObserver(s);
          },
        };
        return (i instanceof AO ? i.add(a) : Array.isArray(i) && i.push(a), a);
      };
    }));
})($O || ($O = {}));
class qO {
  static {
    this.all = new Set();
  }
  static {
    this._idPool = 0;
  }
  constructor(e) {
    ((this.listenerCount = 0),
      (this.invocationCount = 0),
      (this.elapsedOverall = 0),
      (this.durations = []),
      (this.name = `${e}_${qO._idPool++}`),
      qO.all.add(this));
  }
  start(e) {
    ((this._stopWatch = new UO()), (this.listenerCount = e));
  }
  stop() {
    if (this._stopWatch) {
      const e = this._stopWatch.elapsed();
      (this.durations.push(e),
        (this.elapsedOverall += e),
        (this.invocationCount += 1),
        (this._stopWatch = void 0));
    }
  }
}
class KO {
  static {
    this._idPool = 1;
  }
  constructor(e, t, n = (KO._idPool++).toString(16).padStart(3, "0")) {
    ((this._errorHandler = e), (this.threshold = t), (this.name = n), (this._warnCountdown = 0));
  }
  dispose() {
    this._stacks?.clear();
  }
  check(e, t) {
    const n = this.threshold;
    if (n <= 0 || t < n) return;
    this._stacks || (this._stacks = new Map());
    const i = this._stacks.get(e.value) || 0;
    if ((this._stacks.set(e.value, i + 1), (this._warnCountdown -= 1), this._warnCountdown <= 0)) {
      this._warnCountdown = 0.5 * n;
      const [e, i] = this.getMostFrequentStack(),
        r = `[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${i}):`,
        o = new ZO(r, e);
      this._errorHandler(o);
    }
    return () => {
      const t = this._stacks.get(e.value) || 0;
      this._stacks.set(e.value, t - 1);
    };
  }
  getMostFrequentStack() {
    if (!this._stacks) return;
    let e,
      t = 0;
    for (const [n, i] of this._stacks) (!e || t < i) && ((e = [n, i]), (t = i));
    return e;
  }
}
class GO {
  static create() {
    const e = new Error();
    return new GO(e.stack ?? "");
  }
  constructor(e) {
    this.value = e;
  }
  print() {}
}
class ZO extends Error {
  constructor(e, t) {
    (super(e), (this.name = "ListenerLeakError"), (this.stack = t));
  }
}
class YO extends Error {
  constructor(e, t) {
    (super(e), (this.name = "ListenerRefusalError"), (this.stack = t));
  }
}
class XO {
  constructor(e) {
    this.value = e;
  }
}
let QO = class {
  constructor(e) {
    ((this._size = 0),
      (this._options = e),
      (this._leakageMon = this._options?.leakWarningThreshold
        ? new KO(e?.onListenerError ?? HI, this._options?.leakWarningThreshold ?? -1)
        : void 0),
      (this._perfMon = this._options?._profName ? new qO(this._options._profName) : void 0),
      (this._deliveryQueue = this._options?.deliveryQueue));
  }
  dispose() {
    this._disposed ||
      ((this._disposed = !0),
      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 ??= (e, t, n) => {
        if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
          const e = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`,
            t = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1],
            n = new YO(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`, t[0]);
          return ((this._options?.onListenerError || HI)(n), PO.None);
        }
        if (this._disposed) return PO.None;
        t && (e = e.bind(t));
        const i = new XO(e);
        let r;
        (this._leakageMon &&
          this._size >= Math.ceil(0.2 * this._leakageMon.threshold) &&
          ((i.stack = GO.create()), (r = this._leakageMon.check(i.stack, this._size + 1))),
          this._listeners
            ? this._listeners instanceof XO
              ? ((this._deliveryQueue ??= new JO()), (this._listeners = [this._listeners, i]))
              : this._listeners.push(i)
            : (this._options?.onWillAddFirstListener?.(this),
              (this._listeners = i),
              this._options?.onDidAddFirstListener?.(this)),
          this._options?.onDidAddListener?.(this),
          this._size++);
        const o = MO(() => {
          (r?.(), this._removeListener(i));
        });
        return (n instanceof AO ? n.add(o) : Array.isArray(n) && n.push(o), o);
      }),
      this._event
    );
  }
  _removeListener(e) {
    if ((this._options?.onWillRemoveListener?.(this), !this._listeners)) return;
    if (1 === this._size)
      return (
        (this._listeners = void 0),
        this._options?.onDidRemoveLastListener?.(this),
        void (this._size = 0)
      );
    const t = this._listeners,
      n = t.indexOf(e);
    if (-1 === n) throw new Error("Attempted to dispose unknown listener");
    (this._size--, (t[n] = void 0));
    const i = this._deliveryQueue.current === this;
    if (2 * this._size <= t.length) {
      let e = 0;
      for (let n = 0; n < t.length; n++)
        t[n]
          ? (t[e++] = t[n])
          : i &&
            e < this._deliveryQueue.end &&
            (this._deliveryQueue.end--, e < this._deliveryQueue.i && this._deliveryQueue.i--);
      t.length = e;
    }
  }
  _deliver(e, t) {
    if (!e) return;
    const n = this._options?.onListenerError || HI;
    if (n)
      try {
        e.value(t);
      } catch (spt) {
        n(spt);
      }
    else e.value(t);
  }
  _deliverQueue(e) {
    const t = e.current._listeners;
    for (; e.i < e.end; ) this._deliver(t[e.i++], e.value);
    e.reset();
  }
  fire(e) {
    if (
      (this._deliveryQueue?.current &&
        (this._deliverQueue(this._deliveryQueue), this._perfMon?.stop()),
      this._perfMon?.start(this._size),
      this._listeners)
    )
      if (this._listeners instanceof XO) this._deliver(this._listeners, e);
      else {
        const t = this._deliveryQueue;
        (t.enqueue(this, e, this._listeners.length), this._deliverQueue(t));
      }
    else;
    this._perfMon?.stop();
  }
  hasListeners() {
    return this._size > 0;
  }
};
class JO {
  constructor() {
    ((this.i = -1), (this.end = 0));
  }
  enqueue(e, t, n) {
    ((this.i = 0), (this.end = n), (this.current = e), (this.value = t));
  }
  reset() {
    ((this.i = this.end), (this.current = void 0), (this.value = void 0));
  }
}
class eM extends QO {
  constructor(e) {
    (super(e), (this._isPaused = 0), (this._eventQueue = new HO()), (this._mergeFn = e?.merge));
  }
  pause() {
    this._isPaused++;
  }
  resume() {
    if (0 !== this._isPaused && 0 === --this._isPaused)
      if (this._mergeFn) {
        if (this._eventQueue.size > 0) {
          const e = Array.from(this._eventQueue);
          (this._eventQueue.clear(), super.fire(this._mergeFn(e)));
        }
      } else
        for (; !this._isPaused && 0 !== this._eventQueue.size; )
          super.fire(this._eventQueue.shift());
  }
  fire(e) {
    this._size && (0 !== this._isPaused ? this._eventQueue.push(e) : super.fire(e));
  }
}
class tM extends eM {
  constructor(e) {
    (super(e), (this._delay = e.delay ?? 100));
  }
  fire(e) {
    (this._handle ||
      (this.pause(),
      (this._handle = setTimeout(() => {
        ((this._handle = void 0), this.resume());
      }, this._delay))),
      super.fire(e));
  }
}
class nM extends QO {
  constructor(e) {
    (super(e), (this._queuedEvents = []), (this._mergeFn = e?.merge));
  }
  fire(e) {
    this.hasListeners() &&
      (this._queuedEvents.push(e),
      1 === this._queuedEvents.length &&
        queueMicrotask(() => {
          (this._mergeFn
            ? super.fire(this._mergeFn(this._queuedEvents))
            : this._queuedEvents.forEach((e) => super.fire(e)),
            (this._queuedEvents = []));
        }));
  }
}
class iM {
  constructor() {
    ((this.hasListeners = !1),
      (this.events = []),
      (this.emitter = new QO({
        onWillAddFirstListener: () => this.onFirstListenerAdd(),
        onDidRemoveLastListener: () => this.onLastListenerRemove(),
      })));
  }
  get event() {
    return this.emitter.event;
  }
  add(e) {
    const t = { event: e, listener: null };
    (this.events.push(t), this.hasListeners && this.hook(t));
    return MO(
      LO(() => {
        this.hasListeners && this.unhook(t);
        const e = this.events.indexOf(t);
        this.events.splice(e, 1);
      }),
    );
  }
  onFirstListenerAdd() {
    ((this.hasListeners = !0), this.events.forEach((e) => this.hook(e)));
  }
  onLastListenerRemove() {
    ((this.hasListeners = !1), this.events.forEach((e) => this.unhook(e)));
  }
  hook(e) {
    e.listener = e.event((e) => this.emitter.fire(e));
  }
  unhook(e) {
    (e.listener?.dispose(), (e.listener = null));
  }
  dispose() {
    this.emitter.dispose();
    for (const e of this.events) e.listener?.dispose();
    this.events = [];
  }
}
class rM {
  constructor() {
    this.data = [];
  }
  wrapEvent(e, t, n) {
    return (i, r, o) =>
      e(
        (e) => {
          const o = this.data[this.data.length - 1];
          if (!t) return void (o ? o.buffers.push(() => i.call(r, e)) : i.call(r, e));
          const s = o;
          s
            ? ((s.items ??= []),
              s.items.push(e),
              0 === s.buffers.length &&
                o.buffers.push(() => {
                  ((s.reducedResult ??= n ? s.items.reduce(t, n) : s.items.reduce(t)),
                    i.call(r, s.reducedResult));
                }))
            : i.call(r, t(n, e));
        },
        void 0,
        o,
      );
  }
  bufferEvents(e) {
    const t = { buffers: new Array() };
    this.data.push(t);
    const n = e();
    return (this.data.pop(), t.buffers.forEach((e) => e()), n);
  }
}
class oM {
  constructor() {
    ((this.listening = !1),
      (this.inputEvent = $O.None),
      (this.inputEventListener = PO.None),
      (this.emitter = new QO({
        onDidAddFirstListener: () => {
          ((this.listening = !0),
            (this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter)));
        },
        onDidRemoveLastListener: () => {
          ((this.listening = !1), this.inputEventListener.dispose());
        },
      })),
      (this.event = this.emitter.event));
  }
  set input(e) {
    ((this.inputEvent = e),
      this.listening &&
        (this.inputEventListener.dispose(),
        (this.inputEventListener = e(this.emitter.fire, this.emitter))));
  }
  dispose() {
    (this.inputEventListener.dispose(), this.emitter.dispose());
  }
}
const sM = Object.freeze(function (e, t) {
  const n = setTimeout(e.bind(t), 0);
  return {
    dispose() {
      clearTimeout(n);
    },
  };
});
var aM;
!(function (e) {
  ((e.isCancellationToken = function (t) {
    return (
      t === e.None ||
      t === e.Cancelled ||
      t instanceof lM ||
      (!(!t || "object" != typeof t) &&
        "boolean" == typeof t.isCancellationRequested &&
        "function" == typeof t.onCancellationRequested)
    );
  }),
    (e.None = Object.freeze({ isCancellationRequested: !1, onCancellationRequested: $O.None })),
    (e.Cancelled = Object.freeze({ isCancellationRequested: !0, onCancellationRequested: sM })));
})(aM || (aM = {}));
class lM {
  constructor() {
    ((this._isCancelled = !1), (this._emitter = null));
  }
  cancel() {
    this._isCancelled ||
      ((this._isCancelled = !0), this._emitter && (this._emitter.fire(void 0), this.dispose()));
  }
  get isCancellationRequested() {
    return this._isCancelled;
  }
  get onCancellationRequested() {
    return this._isCancelled
      ? sM
      : (this._emitter || (this._emitter = new QO()), this._emitter.event);
  }
  dispose() {
    this._emitter && (this._emitter.dispose(), (this._emitter = null));
  }
}
let cM = class {
  constructor(e) {
    ((this._token = void 0),
      (this._parentListener = void 0),
      (this._parentListener = e && e.onCancellationRequested(this.cancel, this)));
  }
  get token() {
    return (this._token || (this._token = new lM()), this._token);
  }
  cancel() {
    this._token ? this._token instanceof lM && this._token.cancel() : (this._token = aM.Cancelled);
  }
  dispose(e = !1) {
    (e && this.cancel(),
      this._parentListener?.dispose(),
      this._token ? this._token instanceof lM && this._token.dispose() : (this._token = aM.None));
  }
};
function dM(e) {
  const t = new cM();
  return (
    e.add({
      dispose() {
        t.cancel();
      },
    }),
    t.token
  );
}
const uM = Symbol("MicrotaskDelay");
function hM(e) {
  return !!e && "function" == typeof e.then;
}
function gM(e) {
  const t = new cM(),
    n = e(t.token);
  let i = !1;
  const r = new Promise((e, r) => {
    const o = t.token.onCancellationRequested(() => {
      ((i = !0), o.dispose(), r(new KI()));
    });
    Promise.resolve(n).then(
      (n) => {
        (o.dispose(), t.dispose(), i ? TO(n) && n.dispose() : e(n));
      },
      (e) => {
        (o.dispose(), t.dispose(), r(e));
      },
    );
  });
  return new (class {
    cancel() {
      (t.cancel(), t.dispose());
    }
    then(e, t) {
      return r.then(e, t);
    }
    catch(e) {
      return this.then(void 0, e);
    }
    finally(e) {
      return r.finally(e);
    }
  })();
}
function pM(e, t, n) {
  return new Promise((i, r) => {
    const o = t.onCancellationRequested(() => {
      (o.dispose(), i(n));
    });
    e.then(i, r).finally(() => o.dispose());
  });
}
let fM = class {
  constructor() {
    ((this.activePromise = null),
      (this.queuedPromise = null),
      (this.queuedPromiseFactory = null),
      (this.cancellationTokenSource = new cM()));
  }
  queue(e) {
    if (this.cancellationTokenSource.token.isCancellationRequested)
      return Promise.reject(new Error("Throttler is disposed"));
    if (this.activePromise) {
      if (((this.queuedPromiseFactory = e), !this.queuedPromise)) {
        const e = () => {
          if (
            ((this.queuedPromise = null),
            this.cancellationTokenSource.token.isCancellationRequested)
          )
            return;
          const e = this.queue(this.queuedPromiseFactory);
          return ((this.queuedPromiseFactory = null), e);
        };
        this.queuedPromise = new Promise((t) => {
          this.activePromise.then(e, e).then(t);
        });
      }
      return new Promise((e, t) => {
        this.queuedPromise.then(e, t);
      });
    }
    return (
      (this.activePromise = e(this.cancellationTokenSource.token)),
      new Promise((e, t) => {
        this.activePromise.then(
          (t) => {
            ((this.activePromise = null), e(t));
          },
          (e) => {
            ((this.activePromise = null), t(e));
          },
        );
      })
    );
  }
  dispose() {
    this.cancellationTokenSource.cancel();
  }
};
class mM {
  constructor(e) {
    ((this.defaultDelay = e),
      (this.deferred = null),
      (this.completionPromise = null),
      (this.doResolve = null),
      (this.doReject = null),
      (this.task = null));
  }
  trigger(e, t = this.defaultDelay) {
    ((this.task = e),
      this.cancelTimeout(),
      this.completionPromise ||
        (this.completionPromise = new Promise((e, t) => {
          ((this.doResolve = e), (this.doReject = t));
        }).then(() => {
          if (((this.completionPromise = null), (this.doResolve = null), this.task)) {
            const e = this.task;
            return ((this.task = null), e());
          }
        })));
    const n = () => {
      ((this.deferred = null), this.doResolve?.(null));
    };
    return (
      (this.deferred =
        t === uM
          ? ((e) => {
              let t = !0;
              return (
                queueMicrotask(() => {
                  t && ((t = !1), e());
                }),
                {
                  isTriggered: () => t,
                  dispose: () => {
                    t = !1;
                  },
                }
              );
            })(n)
          : ((e, t) => {
              let n = !0;
              const i = setTimeout(() => {
                ((n = !1), t());
              }, e);
              return {
                isTriggered: () => n,
                dispose: () => {
                  (clearTimeout(i), (n = !1));
                },
              };
            })(t, n)),
      this.completionPromise
    );
  }
  isTriggered() {
    return !!this.deferred?.isTriggered();
  }
  cancel() {
    (this.cancelTimeout(),
      this.completionPromise && (this.doReject?.(new KI()), (this.completionPromise = null)));
  }
  cancelTimeout() {
    (this.deferred?.dispose(), (this.deferred = null));
  }
  dispose() {
    this.cancel();
  }
}
class _M {
  constructor(e) {
    ((this.delayer = new mM(e)), (this.throttler = new fM()));
  }
  trigger(e, t) {
    return this.delayer.trigger(() => this.throttler.queue(e), t);
  }
  cancel() {
    this.delayer.cancel();
  }
  dispose() {
    (this.delayer.dispose(), this.throttler.dispose());
  }
}
function vM(e, t) {
  return t
    ? new Promise((n, i) => {
        const r = setTimeout(() => {
            (o.dispose(), n());
          }, e),
          o = t.onCancellationRequested(() => {
            (clearTimeout(r), o.dispose(), i(new KI()));
          });
      })
    : gM((t) => vM(e, t));
}
function bM(e, t = 0, n) {
  const i = setTimeout(() => {
      (e(), n && r.dispose());
    }, t),
    r = MO(() => {
      (clearTimeout(i), n?.delete(r));
    });
  return (n?.add(r), r);
}
function yM(e, t = (e) => !!e, n = null) {
  let i = 0;
  const r = e.length,
    o = () => {
      if (i >= r) return Promise.resolve(n);
      const s = e[i++];
      return Promise.resolve(s()).then((e) => (t(e) ? Promise.resolve(e) : o()));
    };
  return o();
}
let xM,
  wM,
  CM = class {
    constructor() {
      ((this._runningTask = void 0), (this._pendingTasks = []));
    }
    schedule(e) {
      const t = new DM();
      return (
        this._pendingTasks.push({ task: e, deferred: t, setUndefinedWhenCleared: !1 }),
        this._runIfNotRunning(),
        t.p
      );
    }
    _runIfNotRunning() {
      void 0 === this._runningTask && this._processQueue();
    }
    async _processQueue() {
      if (0 === this._pendingTasks.length) return;
      const e = this._pendingTasks.shift();
      if (e) {
        if (this._runningTask) throw new QI();
        this._runningTask = e.task;
        try {
          const t = await e.task();
          e.deferred.complete(t);
        } catch (spt) {
          e.deferred.error(spt);
        } finally {
          ((this._runningTask = void 0), this._processQueue());
        }
      }
    }
    clearPending() {
      const e = this._pendingTasks;
      this._pendingTasks = [];
      for (const t of e)
        t.setUndefinedWhenCleared ? t.deferred.complete(void 0) : t.deferred.error(new KI());
    }
  };
class SM {
  constructor(e, t) {
    ((this._isDisposed = !1),
      (this._token = void 0),
      "function" == typeof e && "number" == typeof t && this.setIfNotSet(e, t));
  }
  dispose() {
    (this.cancel(), (this._isDisposed = !0));
  }
  cancel() {
    void 0 !== this._token && (clearTimeout(this._token), (this._token = void 0));
  }
  cancelAndSet(e, t) {
    if (this._isDisposed) throw new QI("Calling 'cancelAndSet' on a disposed TimeoutTimer");
    (this.cancel(),
      (this._token = setTimeout(() => {
        ((this._token = void 0), e());
      }, t)));
  }
  setIfNotSet(e, t) {
    if (this._isDisposed) throw new QI("Calling 'setIfNotSet' on a disposed TimeoutTimer");
    void 0 === this._token &&
      (this._token = setTimeout(() => {
        ((this._token = void 0), e());
      }, t));
  }
}
class kM {
  constructor() {
    ((this.disposable = void 0), (this.isDisposed = !1));
  }
  cancel() {
    (this.disposable?.dispose(), (this.disposable = void 0));
  }
  cancelAndSet(e, t, n = globalThis) {
    if (this.isDisposed) throw new QI("Calling 'cancelAndSet' on a disposed IntervalTimer");
    this.cancel();
    const i = n.setInterval(() => {
      e();
    }, t);
    this.disposable = MO(() => {
      (n.clearInterval(i), (this.disposable = void 0));
    });
  }
  dispose() {
    (this.cancel(), (this.isDisposed = !0));
  }
}
class EM {
  constructor(e, t) {
    ((this.timeoutToken = void 0),
      (this.runner = e),
      (this.timeout = t),
      (this.timeoutHandler = this.onTimeout.bind(this)));
  }
  dispose() {
    (this.cancel(), (this.runner = null));
  }
  cancel() {
    this.isScheduled() && (clearTimeout(this.timeoutToken), (this.timeoutToken = void 0));
  }
  schedule(e = this.timeout) {
    (this.cancel(), (this.timeoutToken = setTimeout(this.timeoutHandler, e)));
  }
  get delay() {
    return this.timeout;
  }
  set delay(e) {
    this.timeout = e;
  }
  isScheduled() {
    return void 0 !== this.timeoutToken;
  }
  onTimeout() {
    ((this.timeoutToken = void 0), this.runner && this.doRun());
  }
  doRun() {
    this.runner?.();
  }
}
!(function () {
  const e = globalThis;
  ((wM =
    "function" != typeof e.requestIdleCallback || "function" != typeof e.cancelIdleCallback
      ? (e, t, n) => {
          KR(() => {
            if (i) return;
            const e = Date.now() + 15,
              n = { didTimeout: !0, timeRemaining: () => Math.max(0, e - Date.now()) };
            t(Object.freeze(n));
          });
          let i = !1;
          return {
            dispose() {
              i || (i = !0);
            },
          };
        }
      : (e, t, n) => {
          const i = e.requestIdleCallback(t, "number" == typeof n ? { timeout: n } : void 0);
          let r = !1;
          return {
            dispose() {
              r || ((r = !0), e.cancelIdleCallback(i));
            },
          };
        }),
    (xM = (e, t) => wM(globalThis, e, t)));
})();
class NM {
  constructor(e, t) {
    ((this._didRun = !1),
      (this._executor = () => {
        try {
          this._value = t();
        } catch (e) {
          this._error = e;
        } finally {
          this._didRun = !0;
        }
      }),
      (this._handle = wM(e, () => 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;
  }
}
class LM extends NM {
  constructor(e) {
    super(globalThis, e);
  }
}
class DM {
  get isRejected() {
    return 1 === this.outcome?.outcome;
  }
  get isSettled() {
    return !!this.outcome;
  }
  constructor() {
    this.p = new Promise((e, t) => {
      ((this.completeCallback = e), (this.errorCallback = t));
    });
  }
  complete(e) {
    return this.isSettled
      ? Promise.resolve()
      : new Promise((t) => {
          (this.completeCallback(e), (this.outcome = { outcome: 0, value: e }), t());
        });
  }
  error(e) {
    return this.isSettled
      ? Promise.resolve()
      : new Promise((t) => {
          (this.errorCallback(e), (this.outcome = { outcome: 1, value: e }), t());
        });
  }
  cancel() {
    return this.error(new KI());
  }
}
var TM, IM;
!(function (e) {
  ((e.settled = async function (e) {
    let t;
    const n = await Promise.all(
      e.map((e) =>
        e.then(
          (e) => e,
          (e) => {
            t || (t = e);
          },
        ),
      ),
    );
    if (void 0 !== t) throw t;
    return n;
  }),
    (e.withAsyncBody = function (e) {
      return new Promise(async (t, n) => {
        try {
          await e(t, n);
        } catch (D2t) {
          n(D2t);
        }
      });
    }));
})(TM || (TM = {}));
class RM {
  constructor() {
    ((this._unsatisfiedConsumers = []), (this._unconsumedValues = []));
  }
  get hasFinalValue() {
    return !!this._finalValue;
  }
  produce(e) {
    if ((this._ensureNoFinalValue(), this._unsatisfiedConsumers.length > 0)) {
      const t = this._unsatisfiedConsumers.shift();
      this._resolveOrRejectDeferred(t, e);
    } else this._unconsumedValues.push(e);
  }
  produceFinal(e) {
    (this._ensureNoFinalValue(), (this._finalValue = e));
    for (const t of this._unsatisfiedConsumers) this._resolveOrRejectDeferred(t, e);
    this._unsatisfiedConsumers.length = 0;
  }
  _ensureNoFinalValue() {
    if (this._finalValue)
      throw new QI("ProducerConsumer: cannot produce after final value has been set");
  }
  _resolveOrRejectDeferred(e, t) {
    t.ok ? e.complete(t.value) : e.error(t.error);
  }
  consume() {
    if (this._unconsumedValues.length > 0 || this._finalValue) {
      const e =
        this._unconsumedValues.length > 0 ? this._unconsumedValues.shift() : this._finalValue;
      return e.ok ? Promise.resolve(e.value) : Promise.reject(e.error);
    }
    {
      const e = new DM();
      return (this._unsatisfiedConsumers.push(e), e.p);
    }
  }
}
class OM {
  constructor(e, t) {
    ((this._onReturn = t),
      (this._producerConsumer = new RM()),
      (this._iterator = {
        next: () => this._producerConsumer.consume(),
        return: () => (this._onReturn?.(), Promise.resolve({ done: !0, value: void 0 })),
        throw: async (e) => (this._finishError(e), { done: !0, value: void 0 }),
      }),
      queueMicrotask(async () => {
        const t = e({
          emitOne: (e) => this._producerConsumer.produce({ ok: !0, value: { done: !1, value: e } }),
          emitMany: (e) => {
            for (const t of e)
              this._producerConsumer.produce({ ok: !0, value: { done: !1, value: t } });
          },
          reject: (e) => this._finishError(e),
        });
        if (!this._producerConsumer.hasFinalValue)
          try {
            (await t, this._finishOk());
          } catch (D2t) {
            this._finishError(D2t);
          }
      }));
  }
  static fromArray(e) {
    return new OM((t) => {
      t.emitMany(e);
    });
  }
  static fromPromise(e) {
    return new OM(async (t) => {
      t.emitMany(await e);
    });
  }
  static fromPromisesResolveOrder(e) {
    return new OM(async (t) => {
      await Promise.all(e.map(async (e) => t.emitOne(await e)));
    });
  }
  static merge(e) {
    return new OM(async (t) => {
      await Promise.all(
        e.map(async (e) => {
          for await (const n of e) t.emitOne(n);
        }),
      );
    });
  }
  static {
    this.EMPTY = OM.fromArray([]);
  }
  static map(e, t) {
    return new OM(async (n) => {
      for await (const i of e) n.emitOne(t(i));
    });
  }
  map(e) {
    return OM.map(this, e);
  }
  static coalesce(e) {
    return OM.filter(e, (e) => !!e);
  }
  coalesce() {
    return OM.coalesce(this);
  }
  static filter(e, t) {
    return new OM(async (n) => {
      for await (const i of e) t(i) && n.emitOne(i);
    });
  }
  filter(e) {
    return OM.filter(this, e);
  }
  _finishOk() {
    this._producerConsumer.hasFinalValue ||
      this._producerConsumer.produceFinal({ ok: !0, value: { done: !0, value: void 0 } });
  }
  _finishError(e) {
    this._producerConsumer.hasFinalValue ||
      this._producerConsumer.produceFinal({ ok: !1, error: e });
  }
  [Symbol.asyncIterator]() {
    return this._iterator;
  }
}
class MM extends OM {
  constructor(e, t) {
    (super(t), (this._source = e));
  }
  cancel() {
    this._source.cancel();
  }
}
function AM(e) {
  return e;
}
class PM {
  constructor(e, t) {
    ((this.lastCache = void 0),
      (this.lastArgKey = void 0),
      "function" == typeof e
        ? ((this._fn = e), (this._computeKey = AM))
        : ((this._fn = t), (this._computeKey = e.getCacheKey)));
  }
  get(e) {
    const t = this._computeKey(e);
    return (
      this.lastArgKey !== t && ((this.lastArgKey = t), (this.lastCache = this._fn(e))),
      this.lastCache
    );
  }
}
class jM {
  get cachedValues() {
    return this._map;
  }
  constructor(e, t) {
    ((this._map = new Map()),
      (this._map2 = new Map()),
      "function" == typeof e
        ? ((this._fn = e), (this._computeKey = AM))
        : ((this._fn = t), (this._computeKey = e.getCacheKey)));
  }
  get(e) {
    const t = this._computeKey(e);
    if (this._map2.has(t)) return this._map2.get(t);
    const n = this._fn(e);
    return (this._map.set(e, n), this._map2.set(t, n), n);
  }
}
!(function (e) {
  ((e[(e.Uninitialized = 0)] = "Uninitialized"),
    (e[(e.Running = 1)] = "Running"),
    (e[(e.Completed = 2)] = "Completed"));
})(IM || (IM = {}));
class FM {
  constructor(e) {
    ((this.executor = e), (this._state = IM.Uninitialized));
  }
  get value() {
    if (this._state === IM.Uninitialized) {
      this._state = IM.Running;
      try {
        this._value = this.executor();
      } catch (e) {
        this._error = e;
      } finally {
        this._state = IM.Completed;
      }
    } else if (this._state === IM.Running)
      throw new 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 BM(e) {
  return !e || "string" != typeof e || 0 === e.trim().length;
}
const VM = /{(\d+)}/g;
function WM(e, ...t) {
  return 0 === t.length
    ? e
    : e.replace(VM, function (e, n) {
        const i = parseInt(n, 10);
        return isNaN(i) || i < 0 || i >= t.length ? e : t[i];
      });
}
function HM(e) {
  return e.replace(/[<>&]/g, function (e) {
    switch (e) {
      case "<":
        return "&lt;";
      case ">":
        return "&gt;";
      case "&":
        return "&amp;";
      default:
        return e;
    }
  });
}
function zM(e) {
  return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, "\\$&");
}
function UM(e, t = " ") {
  return qM($M(e, t), t);
}
function $M(e, t) {
  if (!e || !t) return e;
  const n = t.length;
  if (0 === n || 0 === e.length) return e;
  let i = 0;
  for (; e.indexOf(t, i) === i; ) i += n;
  return e.substring(i);
}
function qM(e, t) {
  if (!e || !t) return e;
  const n = t.length,
    i = e.length;
  if (0 === n || 0 === i) return e;
  let r = i,
    o = -1;
  for (; (o = e.lastIndexOf(t, r - 1)), -1 !== o && o + n === r; ) {
    if (0 === o) return "";
    r = o;
  }
  return e.substring(0, r);
}
function KM(e, t, n = {}) {
  if (!e) throw new Error("Cannot create regex from empty string");
  (t || (e = zM(e)),
    n.wholeWord &&
      (/\B/.test(e.charAt(0)) || (e = "\\b" + e),
      /\B/.test(e.charAt(e.length - 1)) || (e += "\\b")));
  let i = "";
  return (
    n.global && (i += "g"),
    n.matchCase || (i += "i"),
    n.multiline && (i += "m"),
    n.unicode && (i += "u"),
    new RegExp(e, i)
  );
}
function GM(e) {
  if ("^" === e.source || "^$" === e.source || "$" === e.source || "^\\s*$" === e.source) return !1;
  return !(!e.exec("") || 0 !== e.lastIndex);
}
function ZM(e) {
  return e.split(/\r\n|\r|\n/);
}
function YM(e) {
  for (let t = 0, n = e.length; t < n; t++) {
    const n = e.charCodeAt(t);
    if (32 !== n && 9 !== n) return t;
  }
  return -1;
}
function XM(e, t = 0, n = e.length) {
  for (let i = t; i < n; i++) {
    const n = e.charCodeAt(i);
    if (32 !== n && 9 !== n) return e.substring(t, i);
  }
  return e.substring(t, n);
}
function QM(e, t = e.length - 1) {
  for (let n = t; n >= 0; n--) {
    const t = e.charCodeAt(n);
    if (32 !== t && 9 !== t) return n;
  }
  return -1;
}
function JM(e, t) {
  return e < t ? -1 : e > t ? 1 : 0;
}
function eA(e, t, n = 0, i = e.length, r = 0, o = t.length) {
  for (; n < i && r < o; n++, r++) {
    const i = e.charCodeAt(n),
      o = t.charCodeAt(r);
    if (i < o) return -1;
    if (i > o) return 1;
  }
  const s = i - n,
    a = o - r;
  return s < a ? -1 : s > a ? 1 : 0;
}
function tA(e, t) {
  return nA(e, t, 0, e.length, 0, t.length);
}
function nA(e, t, n = 0, i = e.length, r = 0, o = t.length) {
  for (; n < i && r < o; n++, r++) {
    let s = e.charCodeAt(n),
      a = t.charCodeAt(r);
    if (s === a) continue;
    if (s >= 128 || a >= 128) return eA(e.toLowerCase(), t.toLowerCase(), n, i, r, o);
    (rA(s) && (s -= 32), rA(a) && (a -= 32));
    const l = s - a;
    if (0 !== l) return l;
  }
  const s = i - n,
    a = o - r;
  return s < a ? -1 : s > a ? 1 : 0;
}
function iA(e) {
  return e >= 48 && e <= 57;
}
function rA(e) {
  return e >= 97 && e <= 122;
}
function oA(e) {
  return e >= 65 && e <= 90;
}
function sA(e, t) {
  return e.length === t.length && 0 === nA(e, t);
}
function aA(e, t) {
  const n = t.length;
  return n <= e.length && 0 === nA(e, t, 0, n);
}
function lA(e, t) {
  const n = e.length,
    i = n - t.length;
  return i >= 0 && 0 === nA(e, t, i, n);
}
function cA(e, t) {
  const n = Math.min(e.length, t.length);
  let i;
  for (i = 0; i < n; i++) if (e.charCodeAt(i) !== t.charCodeAt(i)) return i;
  return n;
}
function dA(e, t) {
  const n = Math.min(e.length, t.length);
  let i;
  const r = e.length - 1,
    o = t.length - 1;
  for (i = 0; i < n; i++) if (e.charCodeAt(r - i) !== t.charCodeAt(o - i)) return i;
  return n;
}
function uA(e) {
  return 55296 <= e && e <= 56319;
}
function hA(e) {
  return 56320 <= e && e <= 57343;
}
function gA(e, t) {
  return t - 56320 + ((e - 55296) << 10) + 65536;
}
function pA(e, t, n) {
  const i = e.charCodeAt(n);
  if (uA(i) && n + 1 < t) {
    const t = e.charCodeAt(n + 1);
    if (hA(t)) return gA(i, t);
  }
  return i;
}
class fA {
  get offset() {
    return this._offset;
  }
  constructor(e, t = 0) {
    ((this._str = e), (this._len = e.length), (this._offset = t));
  }
  setOffset(e) {
    this._offset = e;
  }
  prevCodePoint() {
    const e = (function (e, t) {
      const n = e.charCodeAt(t - 1);
      if (hA(n) && t > 1) {
        const i = e.charCodeAt(t - 2);
        if (uA(i)) return gA(i, n);
      }
      return n;
    })(this._str, this._offset);
    return ((this._offset -= e >= 65536 ? 2 : 1), e);
  }
  nextCodePoint() {
    const e = pA(this._str, this._len, this._offset);
    return ((this._offset += e >= 65536 ? 2 : 1), e);
  }
  eol() {
    return this._offset >= this._len;
  }
}
class mA {
  get offset() {
    return this._iterator.offset;
  }
  constructor(e, t = 0) {
    this._iterator = new fA(e, t);
  }
  nextGraphemeLength() {
    const e = IA.getInstance(),
      t = this._iterator,
      n = t.offset;
    let i = e.getGraphemeBreakType(t.nextCodePoint());
    for (; !t.eol(); ) {
      const n = t.offset,
        r = e.getGraphemeBreakType(t.nextCodePoint());
      if (TA(i, r)) {
        t.setOffset(n);
        break;
      }
      i = r;
    }
    return t.offset - n;
  }
  prevGraphemeLength() {
    const e = IA.getInstance(),
      t = this._iterator,
      n = t.offset;
    let i = e.getGraphemeBreakType(t.prevCodePoint());
    for (; t.offset > 0; ) {
      const n = t.offset,
        r = e.getGraphemeBreakType(t.prevCodePoint());
      if (TA(r, i)) {
        t.setOffset(n);
        break;
      }
      i = r;
    }
    return n - t.offset;
  }
  eol() {
    return this._iterator.eol();
  }
}
function _A(e, t) {
  return new mA(e, t).nextGraphemeLength();
}
function vA(e, t) {
  return new mA(e, t).prevGraphemeLength();
}
let bA;
function yA(e) {
  return (
    bA ||
      (bA =
        /(?:[\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])/),
    bA.test(e)
  );
}
const xA = /^[\t\n\r\x20-\x7E]*$/;
function wA(e) {
  return xA.test(e);
}
const CA = /[\u2028\u2029]/;
function SA(e) {
  return CA.test(e);
}
function kA(e) {
  return (e >= 11904 && e <= 55215) || (e >= 63744 && e <= 64255) || (e >= 65281 && e <= 65374);
}
function EA(e) {
  return (
    (e >= 127462 && e <= 127487) ||
    8986 === e ||
    8987 === e ||
    9200 === e ||
    9203 === e ||
    (e >= 9728 && e <= 10175) ||
    11088 === e ||
    11093 === e ||
    (e >= 127744 && e <= 128591) ||
    (e >= 128640 && e <= 128764) ||
    (e >= 128992 && e <= 129008) ||
    (e >= 129280 && e <= 129535) ||
    (e >= 129648 && e <= 129782)
  );
}
const NA = String.fromCharCode(65279);
function LA(e) {
  return !!(e && e.length > 0 && 65279 === e.charCodeAt(0));
}
function DA(e) {
  return (e %= 52) < 26 ? String.fromCharCode(97 + e) : String.fromCharCode(65 + e - 26);
}
function TA(e, t) {
  return 0 === e
    ? 5 !== t && 7 !== t
    : (2 !== e || 3 !== t) &&
        (4 === e ||
          2 === e ||
          3 === e ||
          4 === t ||
          2 === t ||
          3 === t ||
          ((8 !== e || (8 !== t && 9 !== t && 11 !== t && 12 !== t)) &&
            ((11 !== e && 9 !== e) || (9 !== t && 10 !== t)) &&
            ((12 !== e && 10 !== e) || 10 !== t) &&
            5 !== t &&
            13 !== t &&
            7 !== t &&
            1 !== e &&
            (13 !== e || 14 !== t) &&
            (6 !== e || 6 !== t)));
}
class IA {
  static {
    this._INSTANCE = null;
  }
  static getInstance() {
    return (IA._INSTANCE || (IA._INSTANCE = new IA()), IA._INSTANCE);
  }
  constructor() {
    this._data = 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]",
    );
  }
  getGraphemeBreakType(e) {
    if (e < 32) return 10 === e ? 3 : 13 === e ? 2 : 4;
    if (e < 127) return 0;
    const t = this._data,
      n = t.length / 3;
    let i = 1;
    for (; i <= n; )
      if (e < t[3 * i]) i *= 2;
      else {
        if (!(e > t[3 * i + 1])) return t[3 * i + 2];
        i = 2 * i + 1;
      }
    return 0;
  }
}
function RA(e, t) {
  if (0 === e) return 0;
  const n = (function (e, t) {
    const n = new fA(t, e);
    let i = n.prevCodePoint();
    for (; OA(i) || 65039 === i || 8419 === i; ) {
      if (0 === n.offset) return;
      i = n.prevCodePoint();
    }
    if (!EA(i)) return;
    let r = n.offset;
    if (r > 0) {
      8205 === n.prevCodePoint() && (r = n.offset);
    }
    return r;
  })(e, t);
  if (void 0 !== n) return n;
  const i = new fA(t, e);
  return (i.prevCodePoint(), i.offset);
}
function OA(e) {
  return 127995 <= e && e <= 127999;
}
class MA {
  static {
    this.ambiguousCharacterData = new FM(() =>
      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]}',
      ),
    );
  }
  static {
    this.cache = new PM({ getCacheKey: JSON.stringify }, (e) => {
      function t(e) {
        const t = new Map();
        for (let n = 0; n < e.length; n += 2) t.set(e[n], e[n + 1]);
        return t;
      }
      function n(e, t) {
        if (!e) return t;
        const n = new Map();
        for (const [i, r] of e) t.has(i) && n.set(i, r);
        return n;
      }
      const i = this.ambiguousCharacterData.value;
      let r,
        o = e.filter((e) => !e.startsWith("_") && Object.hasOwn(i, e));
      0 === o.length && (o = ["_default"]);
      for (const a of o) {
        r = n(r, t(i[a]));
      }
      const s = (function (e, t) {
        const n = new Map(e);
        for (const [i, r] of t) n.set(i, r);
        return n;
      })(t(i._common), r);
      return new MA(s);
    });
  }
  static getInstance(e) {
    return MA.cache.get(Array.from(e));
  }
  static {
    this._locales = new FM(() =>
      Object.keys(MA.ambiguousCharacterData.value).filter((e) => !e.startsWith("_")),
    );
  }
  static getLocales() {
    return MA._locales.value;
  }
  constructor(e) {
    this.confusableDictionary = e;
  }
  isAmbiguous(e) {
    return this.confusableDictionary.has(e);
  }
  getPrimaryConfusable(e) {
    return this.confusableDictionary.get(e);
  }
  getConfusableCodePoints() {
    return new Set(this.confusableDictionary.keys());
  }
}
class AA {
  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 {
    this._data = void 0;
  }
  static getData() {
    return (
      this._data || (this._data = new Set([...Object.values(AA.getRawData())].flat())),
      this._data
    );
  }
  static isInvisibleCharacter(e) {
    return AA.getData().has(e);
  }
  static get codePoints() {
    return AA.getData();
  }
}
var PA = {};
let jA;
const FA = globalThis.vscode;
if (void 0 !== FA && void 0 !== FA.process) {
  const e = FA.process;
  jA = {
    get platform() {
      return e.platform;
    },
    get arch() {
      return e.arch;
    },
    get env() {
      return e.env;
    },
    cwd: () => e.cwd(),
  };
} else
  jA =
    "undefined" != typeof process && "string" == typeof process?.versions?.node
      ? {
          get platform() {
            return process.platform;
          },
          get arch() {
            return process.arch;
          },
          get env() {
            return PA;
          },
          cwd: () => PA.VSCODE_CWD || process.cwd(),
        }
      : {
          get platform() {
            return AR ? "win32" : PR ? "darwin" : "linux";
          },
          get arch() {},
          get env() {
            return {};
          },
          cwd: () => "/",
        };
const BA = jA.cwd,
  VA = jA.env,
  WA = jA.platform,
  HA = 46,
  zA = 47,
  UA = 92,
  $A = 58;
class qA extends Error {
  constructor(e, t, n) {
    let i;
    "string" == typeof t && 0 === t.indexOf("not ")
      ? ((i = "must not be"), (t = t.replace(/^not /, "")))
      : (i = "must be");
    const r = -1 !== e.indexOf(".") ? "property" : "argument";
    let o = `The "${e}" ${r} ${i} of type ${t}`;
    ((o += ". Received type " + typeof n), super(o), (this.code = "ERR_INVALID_ARG_TYPE"));
  }
}
function KA(e, t) {
  if ("string" != typeof e) throw new qA(t, "string", e);
}
const GA = "win32" === WA;
function ZA(e) {
  return e === zA || e === UA;
}
function YA(e) {
  return e === zA;
}
function XA(e) {
  return (e >= 65 && e <= 90) || (e >= 97 && e <= 122);
}
function QA(e, t, n, i) {
  let r = "",
    o = 0,
    s = -1,
    a = 0,
    l = 0;
  for (let c = 0; c <= e.length; ++c) {
    if (c < e.length) l = e.charCodeAt(c);
    else {
      if (i(l)) break;
      l = zA;
    }
    if (i(l)) {
      if (s === c - 1 || 1 === a);
      else if (2 === a) {
        if (
          r.length < 2 ||
          2 !== o ||
          r.charCodeAt(r.length - 1) !== HA ||
          r.charCodeAt(r.length - 2) !== HA
        ) {
          if (r.length > 2) {
            const e = r.lastIndexOf(n);
            (-1 === e
              ? ((r = ""), (o = 0))
              : ((r = r.slice(0, e)), (o = r.length - 1 - r.lastIndexOf(n))),
              (s = c),
              (a = 0));
            continue;
          }
          if (0 !== r.length) {
            ((r = ""), (o = 0), (s = c), (a = 0));
            continue;
          }
        }
        t && ((r += r.length > 0 ? `${n}..` : ".."), (o = 2));
      } else
        (r.length > 0 ? (r += `${n}${e.slice(s + 1, c)}`) : (r = e.slice(s + 1, c)),
          (o = c - s - 1));
      ((s = c), (a = 0));
    } else l === HA && -1 !== a ? ++a : (a = -1);
  }
  return r;
}
function JA(e, t) {
  !(function (e, t) {
    if (null === e || "object" != typeof e) throw new qA(t, "Object", e);
  })(t, "pathObject");
  const n = t.dir || t.root,
    i = t.base || `${t.name || ""}${((r = t.ext), r ? `${"." === r[0] ? "" : "."}${r}` : "")}`;
  var r;
  return n ? (n === t.root ? `${n}${i}` : `${n}${e}${i}`) : i;
}
const eP = {
    resolve(...e) {
      let t = "",
        n = "",
        i = !1;
      for (let r = e.length - 1; r >= -1; r--) {
        let o;
        if (r >= 0) {
          if (((o = e[r]), KA(o, `paths[${r}]`), 0 === o.length)) continue;
        } else
          0 === t.length
            ? (o = BA())
            : ((o = VA[`=${t}`] || BA()),
              (void 0 === o ||
                (o.slice(0, 2).toLowerCase() !== t.toLowerCase() && o.charCodeAt(2) === UA)) &&
                (o = `${t}\\`));
        const s = o.length;
        let a = 0,
          l = "",
          c = !1;
        const d = o.charCodeAt(0);
        if (1 === s) ZA(d) && ((a = 1), (c = !0));
        else if (ZA(d))
          if (((c = !0), ZA(o.charCodeAt(1)))) {
            let e = 2,
              t = e;
            for (; e < s && !ZA(o.charCodeAt(e)); ) e++;
            if (e < s && e !== t) {
              const n = o.slice(t, e);
              for (t = e; e < s && ZA(o.charCodeAt(e)); ) e++;
              if (e < s && e !== t) {
                for (t = e; e < s && !ZA(o.charCodeAt(e)); ) e++;
                (e !== s && e === t) || ((l = `\\\\${n}\\${o.slice(t, e)}`), (a = e));
              }
            }
          } else a = 1;
        else
          XA(d) &&
            o.charCodeAt(1) === $A &&
            ((l = o.slice(0, 2)), (a = 2), s > 2 && ZA(o.charCodeAt(2)) && ((c = !0), (a = 3)));
        if (l.length > 0)
          if (t.length > 0) {
            if (l.toLowerCase() !== t.toLowerCase()) continue;
          } else t = l;
        if (i) {
          if (t.length > 0) break;
        } else if (((n = `${o.slice(a)}\\${n}`), (i = c), c && t.length > 0)) break;
      }
      return ((n = QA(n, !i, "\\", ZA)), i ? `${t}\\${n}` : `${t}${n}` || ".");
    },
    normalize(e) {
      KA(e, "path");
      const t = e.length;
      if (0 === t) return ".";
      let n,
        i = 0,
        r = !1;
      const o = e.charCodeAt(0);
      if (1 === t) return YA(o) ? "\\" : e;
      if (ZA(o))
        if (((r = !0), ZA(e.charCodeAt(1)))) {
          let r = 2,
            o = r;
          for (; r < t && !ZA(e.charCodeAt(r)); ) r++;
          if (r < t && r !== o) {
            const s = e.slice(o, r);
            for (o = r; r < t && ZA(e.charCodeAt(r)); ) r++;
            if (r < t && r !== o) {
              for (o = r; r < t && !ZA(e.charCodeAt(r)); ) r++;
              if (r === t) return `\\\\${s}\\${e.slice(o)}\\`;
              r !== o && ((n = `\\\\${s}\\${e.slice(o, r)}`), (i = r));
            }
          }
        } else i = 1;
      else
        XA(o) &&
          e.charCodeAt(1) === $A &&
          ((n = e.slice(0, 2)), (i = 2), t > 2 && ZA(e.charCodeAt(2)) && ((r = !0), (i = 3)));
      let s = i < t ? QA(e.slice(i), !r, "\\", ZA) : "";
      if (
        (0 !== s.length || r || (s = "."),
        s.length > 0 && ZA(e.charCodeAt(t - 1)) && (s += "\\"),
        !r && void 0 === n && e.includes(":"))
      ) {
        if (s.length >= 2 && XA(s.charCodeAt(0)) && s.charCodeAt(1) === $A) return `.\\${s}`;
        let n = e.indexOf(":");
        do {
          if (n === t - 1 || ZA(e.charCodeAt(n + 1))) return `.\\${s}`;
        } while (-1 !== (n = e.indexOf(":", n + 1)));
      }
      return void 0 === n ? (r ? `\\${s}` : s) : r ? `${n}\\${s}` : `${n}${s}`;
    },
    isAbsolute(e) {
      KA(e, "path");
      const t = e.length;
      if (0 === t) return !1;
      const n = e.charCodeAt(0);
      return ZA(n) || (t > 2 && XA(n) && e.charCodeAt(1) === $A && ZA(e.charCodeAt(2)));
    },
    join(...e) {
      if (0 === e.length) return ".";
      let t, n;
      for (let o = 0; o < e.length; ++o) {
        const i = e[o];
        (KA(i, "path"), i.length > 0 && (void 0 === t ? (t = n = i) : (t += `\\${i}`)));
      }
      if (void 0 === t) return ".";
      let i = !0,
        r = 0;
      if ("string" == typeof n && ZA(n.charCodeAt(0))) {
        ++r;
        const e = n.length;
        e > 1 && ZA(n.charCodeAt(1)) && (++r, e > 2 && (ZA(n.charCodeAt(2)) ? ++r : (i = !1)));
      }
      if (i) {
        for (; r < t.length && ZA(t.charCodeAt(r)); ) r++;
        r >= 2 && (t = `\\${t.slice(r)}`);
      }
      return eP.normalize(t);
    },
    relative(e, t) {
      if ((KA(e, "from"), KA(t, "to"), e === t)) return "";
      const n = eP.resolve(e),
        i = eP.resolve(t);
      if (n === i) return "";
      if ((e = n.toLowerCase()) === (t = i.toLowerCase())) return "";
      if (n.length !== e.length || i.length !== t.length) {
        const e = n.split("\\"),
          t = i.split("\\");
        ("" === e[e.length - 1] && e.pop(), "" === t[t.length - 1] && t.pop());
        const r = e.length,
          o = t.length,
          s = r < o ? r : o;
        let a;
        for (a = 0; a < s && e[a].toLowerCase() === t[a].toLowerCase(); a++);
        return 0 === a
          ? i
          : a === s
            ? o > s
              ? t.slice(a).join("\\")
              : r > s
                ? "..\\".repeat(r - 1 - a) + ".."
                : ""
            : "..\\".repeat(r - a) + t.slice(a).join("\\");
      }
      let r = 0;
      for (; r < e.length && e.charCodeAt(r) === UA; ) r++;
      let o = e.length;
      for (; o - 1 > r && e.charCodeAt(o - 1) === UA; ) o--;
      const s = o - r;
      let a = 0;
      for (; a < t.length && t.charCodeAt(a) === UA; ) a++;
      let l = t.length;
      for (; l - 1 > a && t.charCodeAt(l - 1) === UA; ) l--;
      const c = l - a,
        d = s < c ? s : c;
      let u = -1,
        h = 0;
      for (; h < d; h++) {
        const n = e.charCodeAt(r + h);
        if (n !== t.charCodeAt(a + h)) break;
        n === UA && (u = h);
      }
      if (h !== d) {
        if (-1 === u) return i;
      } else {
        if (c > d) {
          if (t.charCodeAt(a + h) === UA) return i.slice(a + h + 1);
          if (2 === h) return i.slice(a + h);
        }
        (s > d && (e.charCodeAt(r + h) === UA ? (u = h) : 2 === h && (u = 3)), -1 === u && (u = 0));
      }
      let g = "";
      for (h = r + u + 1; h <= o; ++h)
        (h !== o && e.charCodeAt(h) !== UA) || (g += 0 === g.length ? ".." : "\\..");
      return (
        (a += u),
        g.length > 0 ? `${g}${i.slice(a, l)}` : (i.charCodeAt(a) === UA && ++a, i.slice(a, l))
      );
    },
    toNamespacedPath(e) {
      if ("string" != typeof e || 0 === e.length) return e;
      const t = eP.resolve(e);
      if (t.length <= 2) return e;
      if (t.charCodeAt(0) === UA) {
        if (t.charCodeAt(1) === UA) {
          const e = t.charCodeAt(2);
          if (63 !== e && e !== HA) return `\\\\?\\UNC\\${t.slice(2)}`;
        }
      } else if (XA(t.charCodeAt(0)) && t.charCodeAt(1) === $A && t.charCodeAt(2) === UA)
        return `\\\\?\\${t}`;
      return t;
    },
    dirname(e) {
      KA(e, "path");
      const t = e.length;
      if (0 === t) return ".";
      let n = -1,
        i = 0;
      const r = e.charCodeAt(0);
      if (1 === t) return ZA(r) ? e : ".";
      if (ZA(r)) {
        if (((n = i = 1), ZA(e.charCodeAt(1)))) {
          let r = 2,
            o = r;
          for (; r < t && !ZA(e.charCodeAt(r)); ) r++;
          if (r < t && r !== o) {
            for (o = r; r < t && ZA(e.charCodeAt(r)); ) r++;
            if (r < t && r !== o) {
              for (o = r; r < t && !ZA(e.charCodeAt(r)); ) r++;
              if (r === t) return e;
              r !== o && (n = i = r + 1);
            }
          }
        }
      } else
        XA(r) && e.charCodeAt(1) === $A && ((n = t > 2 && ZA(e.charCodeAt(2)) ? 3 : 2), (i = n));
      let o = -1,
        s = !0;
      for (let a = t - 1; a >= i; --a)
        if (ZA(e.charCodeAt(a))) {
          if (!s) {
            o = a;
            break;
          }
        } else s = !1;
      if (-1 === o) {
        if (-1 === n) return ".";
        o = n;
      }
      return e.slice(0, o);
    },
    basename(e, t) {
      (void 0 !== t && KA(t, "suffix"), KA(e, "path"));
      let n,
        i = 0,
        r = -1,
        o = !0;
      if (
        (e.length >= 2 && XA(e.charCodeAt(0)) && e.charCodeAt(1) === $A && (i = 2),
        void 0 !== t && t.length > 0 && t.length <= e.length)
      ) {
        if (t === e) return "";
        let s = t.length - 1,
          a = -1;
        for (n = e.length - 1; n >= i; --n) {
          const l = e.charCodeAt(n);
          if (ZA(l)) {
            if (!o) {
              i = n + 1;
              break;
            }
          } else
            (-1 === a && ((o = !1), (a = n + 1)),
              s >= 0 && (l === t.charCodeAt(s) ? -1 === --s && (r = n) : ((s = -1), (r = a))));
        }
        return (i === r ? (r = a) : -1 === r && (r = e.length), e.slice(i, r));
      }
      for (n = e.length - 1; n >= i; --n)
        if (ZA(e.charCodeAt(n))) {
          if (!o) {
            i = n + 1;
            break;
          }
        } else -1 === r && ((o = !1), (r = n + 1));
      return -1 === r ? "" : e.slice(i, r);
    },
    extname(e) {
      KA(e, "path");
      let t = 0,
        n = -1,
        i = 0,
        r = -1,
        o = !0,
        s = 0;
      e.length >= 2 && e.charCodeAt(1) === $A && XA(e.charCodeAt(0)) && (t = i = 2);
      for (let a = e.length - 1; a >= t; --a) {
        const t = e.charCodeAt(a);
        if (ZA(t)) {
          if (!o) {
            i = a + 1;
            break;
          }
        } else
          (-1 === r && ((o = !1), (r = a + 1)),
            t === HA ? (-1 === n ? (n = a) : 1 !== s && (s = 1)) : -1 !== n && (s = -1));
      }
      return -1 === n || -1 === r || 0 === s || (1 === s && n === r - 1 && n === i + 1)
        ? ""
        : e.slice(n, r);
    },
    format: JA.bind(null, "\\"),
    parse(e) {
      KA(e, "path");
      const t = { root: "", dir: "", base: "", ext: "", name: "" };
      if (0 === e.length) return t;
      const n = e.length;
      let i = 0,
        r = e.charCodeAt(0);
      if (1 === n) return ZA(r) ? ((t.root = t.dir = e), t) : ((t.base = t.name = e), t);
      if (ZA(r)) {
        if (((i = 1), ZA(e.charCodeAt(1)))) {
          let t = 2,
            r = t;
          for (; t < n && !ZA(e.charCodeAt(t)); ) t++;
          if (t < n && t !== r) {
            for (r = t; t < n && ZA(e.charCodeAt(t)); ) t++;
            if (t < n && t !== r) {
              for (r = t; t < n && !ZA(e.charCodeAt(t)); ) t++;
              t === n ? (i = t) : t !== r && (i = t + 1);
            }
          }
        }
      } else if (XA(r) && e.charCodeAt(1) === $A) {
        if (n <= 2) return ((t.root = t.dir = e), t);
        if (((i = 2), ZA(e.charCodeAt(2)))) {
          if (3 === n) return ((t.root = t.dir = e), t);
          i = 3;
        }
      }
      i > 0 && (t.root = e.slice(0, i));
      let o = -1,
        s = i,
        a = -1,
        l = !0,
        c = e.length - 1,
        d = 0;
      for (; c >= i; --c)
        if (((r = e.charCodeAt(c)), ZA(r))) {
          if (!l) {
            s = c + 1;
            break;
          }
        } else
          (-1 === a && ((l = !1), (a = c + 1)),
            r === HA ? (-1 === o ? (o = c) : 1 !== d && (d = 1)) : -1 !== o && (d = -1));
      return (
        -1 !== a &&
          (-1 === o || 0 === d || (1 === d && o === a - 1 && o === s + 1)
            ? (t.base = t.name = e.slice(s, a))
            : ((t.name = e.slice(s, o)), (t.base = e.slice(s, a)), (t.ext = e.slice(o, a)))),
        (t.dir = s > 0 && s !== i ? e.slice(0, s - 1) : t.root),
        t
      );
    },
    sep: "\\",
    delimiter: ";",
    win32: null,
    posix: null,
  },
  tP = (() => {
    if (GA) {
      const e = /\\/g;
      return () => {
        const t = BA().replace(e, "/");
        return t.slice(t.indexOf("/"));
      };
    }
    return () => BA();
  })(),
  nP = {
    resolve(...e) {
      let t = "",
        n = !1;
      for (let i = e.length - 1; i >= 0 && !n; i--) {
        const r = e[i];
        (KA(r, `paths[${i}]`), 0 !== r.length && ((t = `${r}/${t}`), (n = r.charCodeAt(0) === zA)));
      }
      if (!n) {
        const e = tP();
        ((t = `${e}/${t}`), (n = e.charCodeAt(0) === zA));
      }
      return ((t = QA(t, !n, "/", YA)), n ? `/${t}` : t.length > 0 ? t : ".");
    },
    normalize(e) {
      if ((KA(e, "path"), 0 === e.length)) return ".";
      const t = e.charCodeAt(0) === zA,
        n = e.charCodeAt(e.length - 1) === zA;
      return 0 === (e = QA(e, !t, "/", YA)).length
        ? t
          ? "/"
          : n
            ? "./"
            : "."
        : (n && (e += "/"), t ? `/${e}` : e);
    },
    isAbsolute: (e) => (KA(e, "path"), e.length > 0 && e.charCodeAt(0) === zA),
    join(...e) {
      if (0 === e.length) return ".";
      const t = [];
      for (let n = 0; n < e.length; ++n) {
        const i = e[n];
        (KA(i, "path"), i.length > 0 && t.push(i));
      }
      return 0 === t.length ? "." : nP.normalize(t.join("/"));
    },
    relative(e, t) {
      if ((KA(e, "from"), KA(t, "to"), e === t)) return "";
      if ((e = nP.resolve(e)) === (t = nP.resolve(t))) return "";
      const n = e.length,
        i = n - 1,
        r = t.length - 1,
        o = i < r ? i : r;
      let s = -1,
        a = 0;
      for (; a < o; a++) {
        const n = e.charCodeAt(1 + a);
        if (n !== t.charCodeAt(1 + a)) break;
        n === zA && (s = a);
      }
      if (a === o)
        if (r > o) {
          if (t.charCodeAt(1 + a) === zA) return t.slice(1 + a + 1);
          if (0 === a) return t.slice(1 + a);
        } else i > o && (e.charCodeAt(1 + a) === zA ? (s = a) : 0 === a && (s = 0));
      let l = "";
      for (a = 1 + s + 1; a <= n; ++a)
        (a !== n && e.charCodeAt(a) !== zA) || (l += 0 === l.length ? ".." : "/..");
      return `${l}${t.slice(1 + s)}`;
    },
    toNamespacedPath: (e) => e,
    dirname(e) {
      if ((KA(e, "path"), 0 === e.length)) return ".";
      const t = e.charCodeAt(0) === zA;
      let n = -1,
        i = !0;
      for (let r = e.length - 1; r >= 1; --r)
        if (e.charCodeAt(r) === zA) {
          if (!i) {
            n = r;
            break;
          }
        } else i = !1;
      return -1 === n ? (t ? "/" : ".") : t && 1 === n ? "//" : e.slice(0, n);
    },
    basename(e, t) {
      (void 0 !== t && KA(t, "suffix"), KA(e, "path"));
      let n,
        i = 0,
        r = -1,
        o = !0;
      if (void 0 !== t && t.length > 0 && t.length <= e.length) {
        if (t === e) return "";
        let s = t.length - 1,
          a = -1;
        for (n = e.length - 1; n >= 0; --n) {
          const l = e.charCodeAt(n);
          if (l === zA) {
            if (!o) {
              i = n + 1;
              break;
            }
          } else
            (-1 === a && ((o = !1), (a = n + 1)),
              s >= 0 && (l === t.charCodeAt(s) ? -1 === --s && (r = n) : ((s = -1), (r = a))));
        }
        return (i === r ? (r = a) : -1 === r && (r = e.length), e.slice(i, r));
      }
      for (n = e.length - 1; n >= 0; --n)
        if (e.charCodeAt(n) === zA) {
          if (!o) {
            i = n + 1;
            break;
          }
        } else -1 === r && ((o = !1), (r = n + 1));
      return -1 === r ? "" : e.slice(i, r);
    },
    extname(e) {
      KA(e, "path");
      let t = -1,
        n = 0,
        i = -1,
        r = !0,
        o = 0;
      for (let s = e.length - 1; s >= 0; --s) {
        const a = e[s];
        if ("/" !== a)
          (-1 === i && ((r = !1), (i = s + 1)),
            "." === a ? (-1 === t ? (t = s) : 1 !== o && (o = 1)) : -1 !== t && (o = -1));
        else if (!r) {
          n = s + 1;
          break;
        }
      }
      return -1 === t || -1 === i || 0 === o || (1 === o && t === i - 1 && t === n + 1)
        ? ""
        : e.slice(t, i);
    },
    format: JA.bind(null, "/"),
    parse(e) {
      KA(e, "path");
      const t = { root: "", dir: "", base: "", ext: "", name: "" };
      if (0 === e.length) return t;
      const n = e.charCodeAt(0) === zA;
      let i;
      n ? ((t.root = "/"), (i = 1)) : (i = 0);
      let r = -1,
        o = 0,
        s = -1,
        a = !0,
        l = e.length - 1,
        c = 0;
      for (; l >= i; --l) {
        const t = e.charCodeAt(l);
        if (t !== zA)
          (-1 === s && ((a = !1), (s = l + 1)),
            t === HA ? (-1 === r ? (r = l) : 1 !== c && (c = 1)) : -1 !== r && (c = -1));
        else if (!a) {
          o = l + 1;
          break;
        }
      }
      if (-1 !== s) {
        const i = 0 === o && n ? 1 : o;
        -1 === r || 0 === c || (1 === c && r === s - 1 && r === o + 1)
          ? (t.base = t.name = e.slice(i, s))
          : ((t.name = e.slice(i, r)), (t.base = e.slice(i, s)), (t.ext = e.slice(r, s)));
      }
      return (o > 0 ? (t.dir = e.slice(0, o - 1)) : n && (t.dir = "/"), t);
    },
    sep: "/",
    delimiter: ":",
    win32: null,
    posix: null,
  };
((nP.win32 = eP.win32 = eP), (nP.posix = eP.posix = nP));
const iP = GA ? eP.normalize : nP.normalize,
  rP = GA ? eP.resolve : nP.resolve,
  oP = GA ? eP.relative : nP.relative,
  sP = GA ? eP.dirname : nP.dirname,
  aP = GA ? eP.basename : nP.basename,
  lP = GA ? eP.extname : nP.extname,
  cP = GA ? eP.sep : nP.sep,
  dP = /^\w[\w\d+.-]*$/,
  uP = /^\//,
  hP = /^\/\//;
const gP = "",
  pP = "/",
  fP = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
let mP = class e {
  static isUri(t) {
    return (
      t instanceof e ||
      (!(!t || "object" != typeof t) &&
        "string" == typeof t.authority &&
        "string" == typeof t.fragment &&
        "string" == typeof t.path &&
        "string" == typeof t.query &&
        "string" == typeof t.scheme &&
        "string" == typeof t.fsPath &&
        "function" == typeof t.with &&
        "function" == typeof t.toString)
    );
  }
  constructor(e, t, n, i, r, o = !1) {
    "object" == typeof e
      ? ((this.scheme = e.scheme || gP),
        (this.authority = e.authority || gP),
        (this.path = e.path || gP),
        (this.query = e.query || gP),
        (this.fragment = e.fragment || gP))
      : ((this.scheme = (function (e, t) {
          return e || t ? e : "file";
        })(e, o)),
        (this.authority = t || gP),
        (this.path = (function (e, t) {
          switch (e) {
            case "https":
            case "http":
            case "file":
              t ? t[0] !== pP && (t = pP + t) : (t = pP);
          }
          return t;
        })(this.scheme, n || gP)),
        (this.query = i || gP),
        (this.fragment = r || gP),
        (function (e, t) {
          if (!e.scheme && t)
            throw new Error(
              `[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`,
            );
          if (e.scheme && !dP.test(e.scheme))
            throw new Error("[UriError]: Scheme contains illegal characters.");
          if (e.path)
            if (e.authority) {
              if (!uP.test(e.path))
                throw new 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 (hP.test(e.path))
              throw new Error(
                '[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")',
              );
        })(this, o));
  }
  get fsPath() {
    return wP(this, !1);
  }
  with(e) {
    if (!e) return this;
    let { scheme: t, authority: n, path: i, query: r, fragment: o } = e;
    return (
      void 0 === t ? (t = this.scheme) : null === t && (t = gP),
      void 0 === n ? (n = this.authority) : null === n && (n = gP),
      void 0 === i ? (i = this.path) : null === i && (i = gP),
      void 0 === r ? (r = this.query) : null === r && (r = gP),
      void 0 === o ? (o = this.fragment) : null === o && (o = gP),
      t === this.scheme &&
      n === this.authority &&
      i === this.path &&
      r === this.query &&
      o === this.fragment
        ? this
        : new vP(t, n, i, r, o)
    );
  }
  static parse(e, t = !1) {
    const n = fP.exec(e);
    return n
      ? new vP(n[2] || gP, EP(n[4] || gP), EP(n[5] || gP), EP(n[7] || gP), EP(n[9] || gP), t)
      : new vP(gP, gP, gP, gP, gP);
  }
  static file(e) {
    let t = gP;
    if ((AR && (e = e.replace(/\\/g, pP)), e[0] === pP && e[1] === pP)) {
      const n = e.indexOf(pP, 2);
      -1 === n
        ? ((t = e.substring(2)), (e = pP))
        : ((t = e.substring(2, n)), (e = e.substring(n) || pP));
    }
    return new vP("file", t, e, gP, gP);
  }
  static from(e, t) {
    return new vP(e.scheme, e.authority, e.path, e.query, e.fragment, t);
  }
  static joinPath(t, ...n) {
    if (!t.path) throw new Error("[UriError]: cannot call joinPath on URI without path");
    let i;
    return (
      (i =
        AR && "file" === t.scheme ? e.file(eP.join(wP(t, !0), ...n)).path : nP.join(t.path, ...n)),
      t.with({ path: i })
    );
  }
  toString(e = !1) {
    return CP(this, e);
  }
  toJSON() {
    return this;
  }
  static revive(t) {
    if (t) {
      if (t instanceof e) return t;
      {
        const e = new vP(t);
        return (
          (e._formatted = t.external ?? null),
          (e._fsPath = t._sep === _P ? (t.fsPath ?? null) : null),
          e
        );
      }
    }
    return t;
  }
};
const _P = AR ? 1 : void 0;
let vP = class extends mP {
  constructor() {
    (super(...arguments), (this._formatted = null), (this._fsPath = null));
  }
  get fsPath() {
    return (this._fsPath || (this._fsPath = wP(this, !1)), this._fsPath);
  }
  toString(e = !1) {
    return e
      ? CP(this, !0)
      : (this._formatted || (this._formatted = CP(this, !1)), this._formatted);
  }
  toJSON() {
    const e = { $mid: 1 };
    return (
      this._fsPath && ((e.fsPath = this._fsPath), (e._sep = _P)),
      this._formatted && (e.external = this._formatted),
      this.path && (e.path = this.path),
      this.scheme && (e.scheme = this.scheme),
      this.authority && (e.authority = this.authority),
      this.query && (e.query = this.query),
      this.fragment && (e.fragment = this.fragment),
      e
    );
  }
};
const bP = {
  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 yP(e, t, n) {
  let i,
    r = -1;
  for (let o = 0; o < e.length; o++) {
    const s = e.charCodeAt(o);
    if (
      (s >= 97 && s <= 122) ||
      (s >= 65 && s <= 90) ||
      (s >= 48 && s <= 57) ||
      45 === s ||
      46 === s ||
      95 === s ||
      126 === s ||
      (t && 47 === s) ||
      (n && 91 === s) ||
      (n && 93 === s) ||
      (n && 58 === s)
    )
      (-1 !== r && ((i += encodeURIComponent(e.substring(r, o))), (r = -1)),
        void 0 !== i && (i += e.charAt(o)));
    else {
      void 0 === i && (i = e.substr(0, o));
      const t = bP[s];
      void 0 !== t
        ? (-1 !== r && ((i += encodeURIComponent(e.substring(r, o))), (r = -1)), (i += t))
        : -1 === r && (r = o);
    }
  }
  return (-1 !== r && (i += encodeURIComponent(e.substring(r))), void 0 !== i ? i : e);
}
function xP(e) {
  let t;
  for (let n = 0; n < e.length; n++) {
    const i = e.charCodeAt(n);
    35 === i || 63 === i
      ? (void 0 === t && (t = e.substr(0, n)), (t += bP[i]))
      : void 0 !== t && (t += e[n]);
  }
  return void 0 !== t ? t : e;
}
function wP(e, t) {
  let n;
  return (
    (n =
      e.authority && e.path.length > 1 && "file" === e.scheme
        ? `//${e.authority}${e.path}`
        : 47 === e.path.charCodeAt(0) &&
            ((e.path.charCodeAt(1) >= 65 && e.path.charCodeAt(1) <= 90) ||
              (e.path.charCodeAt(1) >= 97 && e.path.charCodeAt(1) <= 122)) &&
            58 === e.path.charCodeAt(2)
          ? t
            ? e.path.substr(1)
            : e.path[1].toLowerCase() + e.path.substr(2)
          : e.path),
    AR && (n = n.replace(/\//g, "\\")),
    n
  );
}
function CP(e, t) {
  const n = t ? xP : yP;
  let i = "",
    { scheme: r, authority: o, path: s, query: a, fragment: l } = e;
  if ((r && ((i += r), (i += ":")), (o || "file" === r) && ((i += pP), (i += pP)), o)) {
    let e = o.indexOf("@");
    if (-1 !== e) {
      const t = o.substr(0, e);
      ((o = o.substr(e + 1)),
        (e = t.lastIndexOf(":")),
        -1 === e
          ? (i += n(t, !1, !1))
          : ((i += n(t.substr(0, e), !1, !1)), (i += ":"), (i += n(t.substr(e + 1), !1, !0))),
        (i += "@"));
    }
    ((o = o.toLowerCase()),
      (e = o.lastIndexOf(":")),
      -1 === e ? (i += n(o, !1, !0)) : ((i += n(o.substr(0, e), !1, !0)), (i += o.substr(e))));
  }
  if (s) {
    if (s.length >= 3 && 47 === s.charCodeAt(0) && 58 === s.charCodeAt(2)) {
      const e = s.charCodeAt(1);
      e >= 65 && e <= 90 && (s = `/${String.fromCharCode(e + 32)}:${s.substr(3)}`);
    } else if (s.length >= 2 && 58 === s.charCodeAt(1)) {
      const e = s.charCodeAt(0);
      e >= 65 && e <= 90 && (s = `${String.fromCharCode(e + 32)}:${s.substr(2)}`);
    }
    i += n(s, !0, !1);
  }
  return (
    a && ((i += "?"), (i += n(a, !1, !1))),
    l && ((i += "#"), (i += t ? l : yP(l, !1, !1))),
    i
  );
}
function SP(e) {
  try {
    return decodeURIComponent(e);
  } catch {
    return e.length > 3 ? e.substr(0, 3) + SP(e.substr(3)) : e;
  }
}
const kP = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
function EP(e) {
  return e.match(kP) ? e.replace(kP, (e) => SP(e)) : e;
}
var NP;
function LP(e, t) {
  return mP.isUri(e) ? sA(e.scheme, t) : aA(e, t + ":");
}
function DP(e, ...t) {
  return t.some((t) => LP(e, t));
}
!(function (e) {
  ((e.inMemory = "inmemory"),
    (e.vscode = "vscode"),
    (e.internal = "private"),
    (e.walkThrough = "walkThrough"),
    (e.walkThroughSnippet = "walkThroughSnippet"),
    (e.http = "http"),
    (e.https = "https"),
    (e.file = "file"),
    (e.mailto = "mailto"),
    (e.untitled = "untitled"),
    (e.data = "data"),
    (e.command = "command"),
    (e.vscodeRemote = "vscode-remote"),
    (e.vscodeRemoteResource = "vscode-remote-resource"),
    (e.vscodeManagedRemoteResource = "vscode-managed-remote-resource"),
    (e.vscodeUserData = "vscode-userdata"),
    (e.vscodeCustomEditor = "vscode-custom-editor"),
    (e.vscodeNotebookCell = "vscode-notebook-cell"),
    (e.vscodeNotebookCellMetadata = "vscode-notebook-cell-metadata"),
    (e.vscodeNotebookCellMetadataDiff = "vscode-notebook-cell-metadata-diff"),
    (e.vscodeNotebookCellOutput = "vscode-notebook-cell-output"),
    (e.vscodeNotebookCellOutputDiff = "vscode-notebook-cell-output-diff"),
    (e.vscodeNotebookMetadata = "vscode-notebook-metadata"),
    (e.vscodeInteractiveInput = "vscode-interactive-input"),
    (e.vscodeSettings = "vscode-settings"),
    (e.vscodeWorkspaceTrust = "vscode-workspace-trust"),
    (e.vscodeTerminal = "vscode-terminal"),
    (e.vscodeChatCodeBlock = "vscode-chat-code-block"),
    (e.vscodeChatCodeCompareBlock = "vscode-chat-code-compare-block"),
    (e.vscodeChatEditor = "vscode-chat-editor"),
    (e.vscodeChatInput = "chatSessionInput"),
    (e.vscodeLocalChatSession = "vscode-chat-session"),
    (e.webviewPanel = "webview-panel"),
    (e.vscodeWebview = "vscode-webview"),
    (e.extension = "extension"),
    (e.vscodeFileResource = "vscode-file"),
    (e.tmp = "tmp"),
    (e.vsls = "vsls"),
    (e.vscodeSourceControl = "vscode-scm"),
    (e.commentsInput = "comment"),
    (e.codeSetting = "code-setting"),
    (e.outputChannel = "output"),
    (e.accessibleView = "accessible-view"),
    (e.chatEditingSnapshotScheme = "chat-editing-snapshot-text-model"),
    (e.chatEditingModel = "chat-editing-text-model"),
    (e.copilotPr = "copilot-pr"));
})(NP || (NP = {}));
const TP = new (class {
  constructor() {
    ((this._hosts = Object.create(null)),
      (this._ports = Object.create(null)),
      (this._connectionTokens = Object.create(null)),
      (this._preferredWebSchema = "http"),
      (this._delegate = null),
      (this._serverRootPath = "/"));
  }
  setPreferredWebSchema(e) {
    this._preferredWebSchema = e;
  }
  get _remoteResourcesPath() {
    return nP.join(this._serverRootPath, NP.vscodeRemoteResource);
  }
  rewrite(e) {
    if (this._delegate)
      try {
        return this._delegate(e);
      } catch (s) {
        return (HI(s), e);
      }
    const t = e.authority;
    let n = this._hosts[t];
    n && -1 !== n.indexOf(":") && -1 === n.indexOf("[") && (n = `[${n}]`);
    const i = this._ports[t],
      r = this._connectionTokens[t];
    let o = `path=${encodeURIComponent(e.path)}`;
    return (
      "string" == typeof r && (o += `&tkn=${encodeURIComponent(r)}`),
      mP.from({
        scheme: BR ? this._preferredWebSchema : NP.vscodeRemoteResource,
        authority: `${n}:${i}`,
        path: this._remoteResourcesPath,
        query: o,
      })
    );
  }
})();
class IP {
  static {
    this.FALLBACK_AUTHORITY = "vscode-app";
  }
  uriToBrowserUri(e) {
    return e.scheme === NP.vscodeRemote
      ? TP.rewrite(e)
      : e.scheme !== NP.file ||
          (!FR && VR !== `${NP.vscodeFileResource}://${IP.FALLBACK_AUTHORITY}`)
        ? e
        : e.with({
            scheme: NP.vscodeFileResource,
            authority: e.authority || IP.FALLBACK_AUTHORITY,
            query: null,
            fragment: null,
          });
  }
}
const RP = new IP();
var OP;
!(function (e) {
  const t = 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",
      },
    ],
  ]);
  e.CoopAndCoep = Object.freeze(t.get("3"));
  const n = "vscode-coi";
  ((e.getHeadersFromQuery = function (e) {
    let i;
    "string" == typeof e
      ? (i = new URL(e).searchParams)
      : e instanceof URL
        ? (i = e.searchParams)
        : mP.isUri(e) && (i = new URL(e.toString(!0)).searchParams);
    const r = i?.get(n);
    if (r) return t.get(r);
  }),
    (e.addSearchParam = function (e, t, i) {
      if (!globalThis.crossOriginIsolated) return;
      const r = t && i ? "3" : i ? "2" : "1";
      e instanceof URLSearchParams ? e.set(n, r) : (e[n] = r);
    }));
})(OP || (OP = {}));
const MP = "undefined" != typeof Buffer;
let AP;
new FM(() => new Uint8Array(256));
class PP {
  static wrap(e) {
    return (
      MP && !Buffer.isBuffer(e) && (e = Buffer.from(e.buffer, e.byteOffset, e.byteLength)),
      new PP(e)
    );
  }
  constructor(e) {
    ((this.buffer = e), (this.byteLength = this.buffer.byteLength));
  }
  toString() {
    return MP ? this.buffer.toString() : (AP || (AP = new TextDecoder()), AP.decode(this.buffer));
  }
}
function jP(e, t) {
  return ((e[t + 0] | 0) >>> 0) | ((e[t + 1] << 8) >>> 0);
}
function FP(e, t, n) {
  ((e[n + 0] = 255 & t), (t >>>= 8), (e[n + 1] = 255 & t));
}
function BP(e, t) {
  return e[t] * 2 ** 24 + 65536 * e[t + 1] + 256 * e[t + 2] + e[t + 3];
}
function VP(e, t, n) {
  ((e[n + 3] = t), (t >>>= 8), (e[n + 2] = t), (t >>>= 8), (e[n + 1] = t), (t >>>= 8), (e[n] = t));
}
function WP(e, t) {
  return e[t];
}
function HP(e, t, n) {
  e[n] = t;
}
const zP = "0123456789abcdef";
function UP(e) {
  return $P(e, 0);
}
function $P(e, t) {
  switch (typeof e) {
    case "object":
      return null === e
        ? qP(349, t)
        : Array.isArray(e)
          ? ((n = e), (i = qP(104579, (i = t))), n.reduce((e, t) => $P(t, e), i))
          : (function (e, t) {
              return (
                (t = qP(181387, t)),
                Object.keys(e)
                  .sort()
                  .reduce((t, n) => ((t = KP(n, t)), $P(e[n], t)), t)
              );
            })(e, t);
    case "string":
      return KP(e, t);
    case "boolean":
      return (function (e, t) {
        return qP(e ? 433 : 863, t);
      })(e, t);
    case "number":
      return qP(e, t);
    case "undefined":
      return qP(937, t);
    default:
      return qP(617, t);
  }
  var n, i;
}
function qP(e, t) {
  return ((t << 5) - t + e) | 0;
}
function KP(e, t) {
  t = qP(149417, t);
  for (let n = 0, i = e.length; n < i; n++) t = qP(e.charCodeAt(n), t);
  return t;
}
function GP(e, t, n = 32) {
  const i = n - t;
  return ((e << t) | ((~((1 << i) - 1) & e) >>> i)) >>> 0;
}
function ZP(e, t = 32) {
  return e instanceof ArrayBuffer
    ? (function ({ buffer: e }) {
        let t = "";
        for (let n = 0; n < e.length; n++) {
          const i = e[n];
          ((t += zP[i >>> 4]), (t += zP[15 & i]));
        }
        return t;
      })(PP.wrap(new Uint8Array(e)))
    : (e >>> 0).toString(16).padStart(t / 4, "0");
}
class YP {
  static {
    this._bigBlock32 = new DataView(new ArrayBuffer(320));
  }
  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 = !1));
  }
  update(e) {
    const t = e.length;
    if (0 === t) return;
    const n = this._buff;
    let i,
      r,
      o = this._buffLen,
      s = this._leftoverHighSurrogate;
    for (0 !== s ? ((i = s), (r = -1), (s = 0)) : ((i = e.charCodeAt(0)), (r = 0)); ; ) {
      let a = i;
      if (uA(i)) {
        if (!(r + 1 < t)) {
          s = i;
          break;
        }
        {
          const t = e.charCodeAt(r + 1);
          hA(t) ? (r++, (a = gA(i, t))) : (a = 65533);
        }
      } else hA(i) && (a = 65533);
      if (((o = this._push(n, o, a)), r++, !(r < t))) break;
      i = e.charCodeAt(r);
    }
    ((this._buffLen = o), (this._leftoverHighSurrogate = s));
  }
  _push(e, t, n) {
    return (
      n < 128
        ? (e[t++] = n)
        : n < 2048
          ? ((e[t++] = 192 | ((1984 & n) >>> 6)), (e[t++] = 128 | ((63 & n) >>> 0)))
          : n < 65536
            ? ((e[t++] = 224 | ((61440 & n) >>> 12)),
              (e[t++] = 128 | ((4032 & n) >>> 6)),
              (e[t++] = 128 | ((63 & n) >>> 0)))
            : ((e[t++] = 240 | ((1835008 & n) >>> 18)),
              (e[t++] = 128 | ((258048 & n) >>> 12)),
              (e[t++] = 128 | ((4032 & n) >>> 6)),
              (e[t++] = 128 | ((63 & n) >>> 0))),
      t >= 64 &&
        (this._step(),
        (t -= 64),
        (this._totalLen += 64),
        (e[0] = e[64]),
        (e[1] = e[65]),
        (e[2] = e[66])),
      t
    );
  }
  digest() {
    return (
      this._finished ||
        ((this._finished = !0),
        this._leftoverHighSurrogate &&
          ((this._leftoverHighSurrogate = 0),
          (this._buffLen = this._push(this._buff, this._buffLen, 65533))),
        (this._totalLen += this._buffLen),
        this._wrapUp()),
      ZP(this._h0) + ZP(this._h1) + ZP(this._h2) + ZP(this._h3) + ZP(this._h4)
    );
  }
  _wrapUp() {
    ((this._buff[this._buffLen++] = 128),
      this._buff.subarray(this._buffLen).fill(0),
      this._buffLen > 56 && (this._step(), this._buff.fill(0)));
    const e = 8 * this._totalLen;
    (this._buffDV.setUint32(56, Math.floor(e / 4294967296), !1),
      this._buffDV.setUint32(60, e % 4294967296, !1),
      this._step());
  }
  _step() {
    const e = YP._bigBlock32,
      t = this._buffDV;
    for (let d = 0; d < 64; d += 4) e.setUint32(d, t.getUint32(d, !1), !1);
    for (let d = 64; d < 320; d += 4)
      e.setUint32(
        d,
        GP(
          e.getUint32(d - 12, !1) ^
            e.getUint32(d - 32, !1) ^
            e.getUint32(d - 56, !1) ^
            e.getUint32(d - 64, !1),
          1,
        ),
        !1,
      );
    let n,
      i,
      r,
      o = this._h0,
      s = this._h1,
      a = this._h2,
      l = this._h3,
      c = this._h4;
    for (let d = 0; d < 80; d++)
      (d < 20
        ? ((n = (s & a) | (~s & l)), (i = 1518500249))
        : d < 40
          ? ((n = s ^ a ^ l), (i = 1859775393))
          : d < 60
            ? ((n = (s & a) | (s & l) | (a & l)), (i = 2400959708))
            : ((n = s ^ a ^ l), (i = 3395469782)),
        (r = (GP(o, 5) + n + c + i + e.getUint32(4 * d, !1)) & 4294967295),
        (c = l),
        (l = a),
        (a = GP(s, 30)),
        (s = o),
        (o = r));
    ((this._h0 = (this._h0 + o) & 4294967295),
      (this._h1 = (this._h1 + s) & 4294967295),
      (this._h2 = (this._h2 + a) & 4294967295),
      (this._h3 = (this._h3 + l) & 4294967295),
      (this._h4 = (this._h4 + c) & 4294967295));
  }
}
function XP(e, t, n = (e, t) => e === t) {
  if (e === t) return !0;
  if (!e || !t) return !1;
  if (e.length !== t.length) return !1;
  for (let i = 0, r = e.length; i < r; i++) if (!n(e[i], t[i])) return !1;
  return !0;
}
function QP(e, t, n) {
  return JP(e.length, (i) => n(e[i], t));
}
function JP(e, t) {
  let n = 0,
    i = e - 1;
  for (; n <= i; ) {
    const e = ((n + i) / 2) | 0,
      r = t(e);
    if (r < 0) n = e + 1;
    else {
      if (!(r > 0)) return e;
      i = e - 1;
    }
  }
  return -(n + 1);
}
function ej(e, t, n) {
  if ((e |= 0) >= t.length) throw new TypeError("invalid index");
  const i = t[Math.floor(t.length * Math.random())],
    r = [],
    o = [],
    s = [];
  for (const a of t) {
    const e = n(a, i);
    e < 0 ? r.push(a) : e > 0 ? o.push(a) : s.push(a);
  }
  return e < r.length
    ? ej(e, r, n)
    : e < r.length + s.length
      ? s[0]
      : ej(e - (r.length + s.length), o, n);
}
function tj(e, t) {
  const n = [];
  let i;
  for (const r of e.slice(0).sort(t)) i && 0 === t(i[0], r) ? i.push(r) : ((i = [r]), n.push(i));
  return n;
}
function* nj(e, t) {
  let n, i;
  for (const r of e) (void 0 !== i && t(i, r) ? n.push(r) : (n && (yield n), (n = [r])), (i = r));
  n && (yield n);
}
function ij(e, t) {
  for (let n = 0; n <= e.length; n++)
    t(0 === n ? void 0 : e[n - 1], n === e.length ? void 0 : e[n]);
}
function rj(e) {
  return e.filter((e) => !!e);
}
function oj(e) {
  let t = 0;
  for (let n = 0; n < e.length; n++) e[n] && ((e[t] = e[n]), (t += 1));
  e.length = t;
}
function sj(e) {
  return !Array.isArray(e) || 0 === e.length;
}
function aj(e) {
  return Array.isArray(e) && e.length > 0;
}
function lj(e, t = (e) => e) {
  const n = new Set();
  return e.filter((e) => {
    const i = t(e);
    return !n.has(i) && (n.add(i), !0);
  });
}
function cj(e, t) {
  let n = "number" == typeof t ? e : 0;
  "number" == typeof t ? (n = e) : ((n = 0), (t = e));
  const i = [];
  if (n <= t) for (let r = n; r < t; r++) i.push(r);
  else for (let r = n; r > t; r--) i.push(r);
  return i;
}
function dj(e, t, n) {
  const i = e.slice(0, t),
    r = e.slice(t);
  return i.concat(n, r);
}
function uj(e, t) {
  const n = e.indexOf(t);
  n > -1 && (e.splice(n, 1), e.unshift(t));
}
function hj(e, t) {
  const n = e.indexOf(t);
  n > -1 && (e.splice(n, 1), e.push(t));
}
function gj(e, t) {
  for (const n of t) e.push(n);
}
function pj(e, t) {
  const n = [];
  for (const i of e) {
    const e = t(i);
    void 0 !== e && n.push(e);
  }
  return n;
}
function fj(e) {
  return Array.isArray(e) ? e : [e];
}
function mj(e, t, n, i) {
  const r = _j(e, t);
  let o = e.splice(r, n);
  return (
    void 0 === o && (o = []),
    (function (e, t, n) {
      const i = _j(e, t),
        r = e.length,
        o = n.length;
      e.length = r + o;
      for (let s = r - 1; s >= i; s--) e[s + o] = e[s];
      for (let s = 0; s < o; s++) e[s + i] = n[s];
    })(e, r, i),
    o
  );
}
function _j(e, t) {
  return t < 0 ? Math.max(t + e.length, 0) : Math.min(t, e.length);
}
var vj;
function bj(e, t) {
  return (n, i) => t(e(n), e(i));
}
!(function (e) {
  ((e.isLessThan = function (e) {
    return e < 0;
  }),
    (e.isLessThanOrEqual = function (e) {
      return e <= 0;
    }),
    (e.isGreaterThan = function (e) {
      return e > 0;
    }),
    (e.isNeitherLessOrGreaterThan = function (e) {
      return 0 === e;
    }),
    (e.greaterThan = 1),
    (e.lessThan = -1),
    (e.neitherLessOrGreaterThan = 0));
})(vj || (vj = {}));
const yj = (e, t) => e - t,
  xj = (e, t) => yj(e ? 1 : 0, t ? 1 : 0);
function wj(e) {
  return (t, n) => -e(t, n);
}
class Cj {
  constructor(e) {
    ((this.firstIdx = 0), (this.items = e), (this.lastIdx = this.items.length - 1));
  }
  get length() {
    return this.lastIdx - this.firstIdx + 1;
  }
  takeWhile(e) {
    let t = this.firstIdx;
    for (; t < this.items.length && e(this.items[t]); ) t++;
    const n = t === this.firstIdx ? null : this.items.slice(this.firstIdx, t);
    return ((this.firstIdx = t), n);
  }
  takeFromEndWhile(e) {
    let t = this.lastIdx;
    for (; t >= 0 && e(this.items[t]); ) t--;
    const n = t === this.lastIdx ? null : this.items.slice(t + 1, this.lastIdx + 1);
    return ((this.lastIdx = t), n);
  }
  peek() {
    if (0 !== this.length) return this.items[this.firstIdx];
  }
  dequeue() {
    const e = this.items[this.firstIdx];
    return (this.firstIdx++, e);
  }
  takeCount(e) {
    const t = this.items.slice(this.firstIdx, this.firstIdx + e);
    return ((this.firstIdx += e), t);
  }
}
class Sj {
  static {
    this.empty = new Sj((e) => {});
  }
  constructor(e) {
    this.iterate = e;
  }
  toArray() {
    const e = [];
    return (this.iterate((t) => (e.push(t), !0)), e);
  }
  filter(e) {
    return new Sj((t) => this.iterate((n) => !e(n) || t(n)));
  }
  map(e) {
    return new Sj((t) => this.iterate((n) => t(e(n))));
  }
  findLast(e) {
    let t;
    return (this.iterate((n) => (e(n) && (t = n), !0)), t);
  }
  findLastMaxBy(e) {
    let t,
      n = !0;
    return (this.iterate((i) => ((n || vj.isGreaterThan(e(i, t))) && ((n = !1), (t = i)), !0)), t);
  }
}
class kj {
  constructor(e) {
    this._indexMap = e;
  }
  static createSortPermutation(e, t) {
    const n = Array.from(e.keys()).sort((n, i) => t(e[n], e[i]));
    return new kj(n);
  }
  apply(e) {
    return e.map((t, n) => e[this._indexMap[n]]);
  }
  inverse() {
    const e = this._indexMap.slice();
    for (let t = 0; t < this._indexMap.length; t++) e[this._indexMap[t]] = t;
    return new kj(e);
  }
}
function Ej(e) {
  return e.reduce((e, t) => e + t, 0);
}
let Nj;
function Lj() {
  return Nj;
}
class Dj {
  constructor(e) {
    this.loggers = e;
  }
  handleObservableCreated(e, t) {
    for (const n of this.loggers) n.handleObservableCreated(e, t);
  }
  handleOnListenerCountChanged(e, t) {
    for (const n of this.loggers) n.handleOnListenerCountChanged(e, t);
  }
  handleObservableUpdated(e, t) {
    for (const n of this.loggers) n.handleObservableUpdated(e, t);
  }
  handleAutorunCreated(e, t) {
    for (const n of this.loggers) n.handleAutorunCreated(e, t);
  }
  handleAutorunDisposed(e) {
    for (const t of this.loggers) t.handleAutorunDisposed(e);
  }
  handleAutorunDependencyChanged(e, t, n) {
    for (const i of this.loggers) i.handleAutorunDependencyChanged(e, t, n);
  }
  handleAutorunStarted(e) {
    for (const t of this.loggers) t.handleAutorunStarted(e);
  }
  handleAutorunFinished(e) {
    for (const t of this.loggers) t.handleAutorunFinished(e);
  }
  handleDerivedDependencyChanged(e, t, n) {
    for (const i of this.loggers) i.handleDerivedDependencyChanged(e, t, n);
  }
  handleDerivedCleared(e) {
    for (const t of this.loggers) t.handleDerivedCleared(e);
  }
  handleBeginTransaction(e) {
    for (const t of this.loggers) t.handleBeginTransaction(e);
  }
  handleEndTransaction(e) {
    for (const t of this.loggers) t.handleEndTransaction(e);
  }
}
var Tj;
!(function (e) {
  let t = !1;
  ((e.enable = function () {
    t = !0;
  }),
    (e.ofCaller = function () {
      if (!t) return;
      const e = Error,
        n = e.stackTraceLimit;
      e.stackTraceLimit = 3;
      const i = new Error().stack;
      return ((e.stackTraceLimit = n), Ij.fromStack(i, 2));
    }));
})(Tj || (Tj = {}));
class Ij {
  static fromStack(e, t) {
    const n = (function (e) {
      const t = e.match(/\((.*):(\d+):(\d+)\)/);
      if (t) return { fileName: t[1], line: parseInt(t[2]), column: parseInt(t[3]), id: e };
      const n = e.match(/at ([^\(\)]*):(\d+):(\d+)/);
      if (n) return { fileName: n[1], line: parseInt(n[2]), column: parseInt(n[3]), id: e };
      return;
    })(e.split("\n")[t + 1]);
    return n ? new Ij(n.fileName, n.line, n.column, n.id) : void 0;
  }
  constructor(e, t, n, i) {
    ((this.fileName = e), (this.line = t), (this.column = n), (this.id = i));
  }
}
const Rj = (e, t) => e === t;
function Oj(e = Rj) {
  return (t, n) => XP(t, n, e);
}
function Mj(e, t, n) {
  if (void 0 !== n) {
    const i = e;
    return null == i || null == t ? t === i : n(i, t);
  }
  {
    const t = e;
    return (e, n) => (null == e || null == n ? n === e : t(e, n));
  }
}
function Aj(e, t) {
  if (e === t) return !0;
  if (Array.isArray(e) && Array.isArray(t)) {
    if (e.length !== t.length) return !1;
    for (let n = 0; n < e.length; n++) if (!Aj(e[n], t[n])) return !1;
    return !0;
  }
  if (
    e &&
    "object" == typeof e &&
    t &&
    "object" == typeof t &&
    Object.getPrototypeOf(e) === Object.prototype &&
    Object.getPrototypeOf(t) === Object.prototype
  ) {
    const n = e,
      i = t,
      r = Object.keys(n),
      o = Object.keys(i),
      s = new Set(o);
    if (r.length !== o.length) return !1;
    for (const e of r) {
      if (!s.has(e)) return !1;
      if (!Aj(n[e], i[e])) return !1;
    }
    return !0;
  }
  return !1;
}
class Pj {
  constructor(e, t, n) {
    ((this.owner = e), (this.debugNameSource = t), (this.referenceFn = n));
  }
  getDebugName(e) {
    return (function (e, t) {
      const n = Fj.get(e);
      if (n) return n;
      const i = (function (e, t) {
        const n = Fj.get(e);
        if (n) return n;
        const i = t.owner
          ? (function (e) {
              const t = Vj.get(e);
              if (t) return t;
              const n = Wj(e) ?? "Object";
              let i = Bj.get(n) ?? 0;
              (i++, Bj.set(n, i));
              const r = 1 === i ? n : `${n}#${i}`;
              return (Vj.set(e, r), r);
            })(t.owner) + "."
          : "";
        let r;
        const o = t.debugNameSource;
        if (void 0 !== o) {
          if ("function" != typeof o) return i + o;
          if (((r = o()), void 0 !== r)) return i + r;
        }
        const s = t.referenceFn;
        if (void 0 !== s && ((r = Hj(s)), void 0 !== r)) return i + r;
        if (void 0 !== t.owner) {
          const n = (function (e, t) {
            for (const n in e) if (e[n] === t) return n;
            return;
          })(t.owner, e);
          if (void 0 !== n) return i + n;
        }
        return;
      })(e, t);
      if (i) {
        let t = jj.get(i) ?? 0;
        (t++, jj.set(i, t));
        const n = 1 === t ? i : `${i}#${t}`;
        return (Fj.set(e, n), n);
      }
      return;
    })(e, this);
  }
}
const jj = new Map(),
  Fj = new WeakMap();
const Bj = new Map(),
  Vj = new WeakMap();
function Wj(e) {
  const t = e.constructor;
  if (t) {
    if ("Object" === t.name) return;
    return t.name;
  }
}
function Hj(e) {
  const t = e.toString(),
    n = /\/\*\*\s*@description\s*([^*]*)\*\//.exec(t),
    i = n ? n[1] : void 0;
  return i?.trim();
}
let zj, Uj, $j;
class qj {
  get TChange() {
    return null;
  }
  reportChanges() {
    this.get();
  }
  read(e) {
    return e ? e.readObservable(this) : this.get();
  }
  map(e, t, n = Tj.ofCaller()) {
    const i = void 0 === t ? void 0 : e,
      r = void 0 === t ? e : t;
    return zj(
      {
        owner: i,
        debugName: () => {
          const e = Hj(r);
          if (void 0 !== e) return e;
          const t =
            /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(
              r.toString(),
            );
          return t ? `${this.debugName}.${t[2]}` : i ? void 0 : `${this.debugName} (mapped)`;
        },
        debugReferenceFn: r,
      },
      (e) => r(this.read(e), e),
      n,
    );
  }
  flatten() {
    return zj({ owner: void 0, debugName: () => `${this.debugName} (flattened)` }, (e) =>
      this.read(e).read(e),
    );
  }
  recomputeInitiallyAndOnChange(e, t) {
    return (e.add(Uj(this, t)), this);
  }
}
class Kj extends qj {
  constructor(e) {
    (super(), (this._observers = new Set()), Lj()?.handleObservableCreated(this, e));
  }
  addObserver(e) {
    const t = this._observers.size;
    (this._observers.add(e),
      0 === t && this.onFirstObserverAdded(),
      t !== this._observers.size && Lj()?.handleOnListenerCountChanged(this, this._observers.size));
  }
  removeObserver(e) {
    const t = this._observers.delete(e);
    (t && 0 === this._observers.size && this.onLastObserverRemoved(),
      t && Lj()?.handleOnListenerCountChanged(this, this._observers.size));
  }
  onFirstObserverAdded() {}
  onLastObserverRemoved() {}
  debugGetObservers() {
    return this._observers;
  }
}
function Gj(e) {
  switch (e) {
    case 0:
      return "initial";
    case 1:
      return "dependenciesMightHaveChanged";
    case 2:
      return "stale";
    case 3:
      return "upToDate";
    default:
      return "<unknown>";
  }
}
class Zj extends Kj {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? "(anonymous)";
  }
  constructor(e, t, n, i = void 0, r, o) {
    (super(o),
      (this._debugNameData = e),
      (this._computeFn = t),
      (this._changeTracker = n),
      (this._handleLastObserverRemoved = i),
      (this._equalityComparator = r),
      (this._state = 0),
      (this._value = void 0),
      (this._updateCount = 0),
      (this._dependencies = new Set()),
      (this._dependenciesToBeRemoved = new Set()),
      (this._changeSummary = void 0),
      (this._isUpdating = !1),
      (this._isComputing = !1),
      (this._didReportChange = !1),
      (this._isInBeforeUpdate = !1),
      (this._isReaderValid = !1),
      (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), Lj()?.handleDerivedCleared(this));
    for (const e of this._dependencies) e.removeObserver(this);
    (this._dependencies.clear(),
      void 0 !== this._store && (this._store.dispose(), (this._store = void 0)),
      void 0 !== this._delayedStore &&
        (this._delayedStore.dispose(), (this._delayedStore = void 0)),
      this._handleLastObserverRemoved?.());
  }
  get() {
    if ((this._isComputing, 0 === this._observers.size)) {
      let e;
      try {
        let t;
        ((this._isReaderValid = !0),
          this._changeTracker &&
            ((t = this._changeTracker.createChangeSummary(void 0)),
            this._changeTracker.beforeUpdate?.(this, t)),
          (e = this._computeFn(this, t)));
      } finally {
        this._isReaderValid = !1;
      }
      return (this.onLastObserverRemoved(), e);
    }
    do {
      if (1 === this._state)
        for (const e of this._dependencies) if ((e.reportChanges(), 2 === this._state)) break;
      (1 === this._state && (this._state = 3), 3 !== this._state && this._recompute());
    } while (3 !== this._state);
    return this._value;
  }
  _recompute() {
    let e = !1;
    ((this._isComputing = !0), (this._didReportChange = !1));
    const t = this._dependenciesToBeRemoved;
    ((this._dependenciesToBeRemoved = this._dependencies), (this._dependencies = t));
    try {
      const t = this._changeSummary;
      ((this._isReaderValid = !0),
        this._changeTracker &&
          ((this._isInBeforeUpdate = !0),
          this._changeTracker.beforeUpdate?.(this, t),
          (this._isInBeforeUpdate = !1),
          (this._changeSummary = this._changeTracker?.createChangeSummary(t))));
      const n = 0 !== this._state,
        i = this._value;
      this._state = 3;
      const r = this._delayedStore;
      void 0 !== r && (this._delayedStore = void 0);
      try {
        (void 0 !== this._store && (this._store.dispose(), (this._store = void 0)),
          (this._value = this._computeFn(this, t)));
      } finally {
        this._isReaderValid = !1;
        for (const e of this._dependenciesToBeRemoved) e.removeObserver(this);
        (this._dependenciesToBeRemoved.clear(), void 0 !== r && r.dispose());
      }
      ((e = this._didReportChange || (n && !this._equalityComparator(i, this._value))),
        Lj()?.handleObservableUpdated(this, {
          oldValue: i,
          newValue: this._value,
          change: void 0,
          didChange: e,
          hadValue: n,
        }));
    } catch (spt) {
      WI(spt);
    }
    if (((this._isComputing = !1), !this._didReportChange && e))
      for (const n of this._observers) n.handleChange(this, void 0);
    else this._didReportChange = !1;
  }
  toString() {
    return `LazyDerived<${this.debugName}>`;
  }
  beginUpdate(e) {
    if (this._isUpdating) throw new QI("Cyclic deriveds are not supported yet!");
    (this._updateCount++, (this._isUpdating = !0));
    try {
      const e = 1 === this._updateCount;
      if (3 === this._state && ((this._state = 1), !e))
        for (const t of this._observers) t.handlePossibleChange(this);
      if (e) for (const t of this._observers) t.beginUpdate(this);
    } finally {
      this._isUpdating = !1;
    }
  }
  endUpdate(e) {
    if ((this._updateCount--, 0 === this._updateCount)) {
      const e = [...this._observers];
      for (const t of e) t.endUpdate(this);
      if (this._removedObserverToCallEndUpdateOn) {
        const e = [...this._removedObserverToCallEndUpdateOn];
        this._removedObserverToCallEndUpdateOn = null;
        for (const t of e) t.endUpdate(this);
      }
    }
    iR(() => this._updateCount >= 0);
  }
  handlePossibleChange(e) {
    if (3 === this._state && this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e)) {
      this._state = 1;
      for (const e of this._observers) e.handlePossibleChange(this);
    }
  }
  handleChange(e, t) {
    if (
      (this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e)) ||
      this._isInBeforeUpdate
    ) {
      Lj()?.handleDerivedDependencyChanged(this, e, t);
      let n = !1;
      try {
        n =
          !this._changeTracker ||
          this._changeTracker.handleChange(
            { changedObservable: e, change: t, didChange: (t) => t === e },
            this._changeSummary,
          );
      } catch (spt) {
        WI(spt);
      }
      const i = 3 === this._state;
      if (n && (1 === this._state || i) && ((this._state = 2), i))
        for (const e of this._observers) e.handlePossibleChange(this);
    }
  }
  _ensureReaderValid() {
    if (!this._isReaderValid)
      throw new QI("The reader object cannot be used outside its compute function!");
  }
  readObservable(e) {
    (this._ensureReaderValid(), e.addObserver(this));
    const t = e.get();
    return (this._dependencies.add(e), this._dependenciesToBeRemoved.delete(e), t);
  }
  get store() {
    return (
      this._ensureReaderValid(),
      void 0 === this._store && (this._store = new AO()),
      this._store
    );
  }
  addObserver(e) {
    const t = !this._observers.has(e) && this._updateCount > 0;
    (super.addObserver(e),
      t &&
        (this._removedObserverToCallEndUpdateOn && this._removedObserverToCallEndUpdateOn.has(e)
          ? this._removedObserverToCallEndUpdateOn.delete(e)
          : e.beginUpdate(this)));
  }
  removeObserver(e) {
    (this._observers.has(e) &&
      this._updateCount > 0 &&
      (this._removedObserverToCallEndUpdateOn ||
        (this._removedObserverToCallEndUpdateOn = new Set()),
      this._removedObserverToCallEndUpdateOn.add(e)),
      super.removeObserver(e));
  }
  debugGetState() {
    return {
      state: this._state,
      stateStr: Gj(this._state),
      updateCount: this._updateCount,
      isComputing: this._isComputing,
      dependencies: this._dependencies,
      value: this._value,
    };
  }
  debugSetValue(e) {
    this._value = e;
  }
  debugRecompute() {
    this._isComputing ? (this._state = 2) : this._recompute();
  }
  setValue(e, t, n) {
    this._value = e;
    const i = this._observers;
    t.updateObserver(this, this);
    for (const r of i) r.handleChange(this, n);
  }
}
class Yj extends Zj {
  constructor(e, t, n, i = void 0, r, o, s) {
    (super(e, t, n, i, r, s), (this.set = o));
  }
}
function Xj(e, t, n = Tj.ofCaller()) {
  return void 0 !== t
    ? new Zj(new Pj(e, void 0, t), t, void 0, void 0, Rj, n)
    : new Zj(new Pj(void 0, void 0, e), e, void 0, void 0, Rj, n);
}
function Qj(e, t, n, i = Tj.ofCaller()) {
  return new Yj(new Pj(e, void 0, t), t, void 0, void 0, Rj, n, i);
}
function Jj(e, t, n = Tj.ofCaller()) {
  return new Zj(
    new Pj(e.owner, e.debugName, e.debugReferenceFn),
    t,
    void 0,
    e.onLastObserverRemoved,
    e.equalsFn ?? Rj,
    n,
  );
}
function eF(e, t, n = Tj.ofCaller()) {
  return new Zj(
    new Pj(e.owner, e.debugName, void 0),
    t,
    e.changeTracker,
    void 0,
    e.equalityComparer ?? Rj,
    n,
  );
}
function tF(e, t, n = Tj.ofCaller()) {
  let i, r, o;
  return (
    void 0 === t ? ((i = e), (r = void 0)) : ((r = e), (i = t)),
    new Zj(
      new Pj(r, void 0, i),
      (e) => {
        o ? o.clear() : (o = new AO());
        const t = i(e);
        return (t && o.add(t), t);
      },
      void 0,
      () => {
        o && (o.dispose(), (o = void 0));
      },
      Rj,
      n,
    )
  );
}
function nF(e) {
  switch (e) {
    case 1:
      return "dependenciesMightHaveChanged";
    case 2:
      return "stale";
    case 3:
      return "upToDate";
    default:
      return "<unknown>";
  }
}
!(function (e) {
  zj = e;
})(Jj);
class iF {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? "(anonymous)";
  }
  constructor(e, t, n, i) {
    ((this._debugNameData = e),
      (this._runFn = t),
      (this._changeTracker = n),
      (this._state = 2),
      (this._updateCount = 0),
      (this._disposed = !1),
      (this._dependencies = new Set()),
      (this._dependenciesToBeRemoved = new Set()),
      (this._isRunning = !1),
      (this._store = void 0),
      (this._delayedStore = void 0),
      (this._changeSummary = this._changeTracker?.createChangeSummary(void 0)),
      Lj()?.handleAutorunCreated(this, i),
      this._run());
  }
  dispose() {
    if (!this._disposed) {
      this._disposed = !0;
      for (const e of this._dependencies) e.removeObserver(this);
      (this._dependencies.clear(),
        void 0 !== this._store && this._store.dispose(),
        void 0 !== this._delayedStore && this._delayedStore.dispose(),
        Lj()?.handleAutorunDisposed(this));
    }
  }
  _run() {
    const e = this._dependenciesToBeRemoved;
    ((this._dependenciesToBeRemoved = this._dependencies),
      (this._dependencies = e),
      (this._state = 3));
    try {
      if (!this._disposed) {
        Lj()?.handleAutorunStarted(this);
        const e = this._changeSummary,
          t = this._delayedStore;
        void 0 !== t && (this._delayedStore = void 0);
        try {
          ((this._isRunning = !0),
            this._changeTracker &&
              (this._changeTracker.beforeUpdate?.(this, e),
              (this._changeSummary = this._changeTracker.createChangeSummary(e))),
            void 0 !== this._store && (this._store.dispose(), (this._store = void 0)),
            this._runFn(this, e));
        } catch (spt) {
          WI(spt);
        } finally {
          ((this._isRunning = !1), void 0 !== t && t.dispose());
        }
      }
    } finally {
      this._disposed || Lj()?.handleAutorunFinished(this);
      for (const e of this._dependenciesToBeRemoved) e.removeObserver(this);
      this._dependenciesToBeRemoved.clear();
    }
  }
  toString() {
    return `Autorun<${this.debugName}>`;
  }
  beginUpdate(e) {
    (3 === this._state && (this._state = 1), this._updateCount++);
  }
  endUpdate(e) {
    try {
      if (1 === this._updateCount)
        do {
          if (1 === this._state) {
            this._state = 3;
            for (const e of this._dependencies) if ((e.reportChanges(), 2 === this._state)) break;
          }
          3 !== this._state && this._run();
        } while (3 !== this._state);
    } finally {
      this._updateCount--;
    }
    iR(() => this._updateCount >= 0);
  }
  handlePossibleChange(e) {
    3 === this._state && this._isDependency(e) && (this._state = 1);
  }
  handleChange(e, t) {
    if (this._isDependency(e)) {
      Lj()?.handleAutorunDependencyChanged(this, e, t);
      try {
        const n =
          !this._changeTracker ||
          this._changeTracker.handleChange(
            { changedObservable: e, change: t, didChange: (t) => t === e },
            this._changeSummary,
          );
        n && (this._state = 2);
      } catch (spt) {
        WI(spt);
      }
    }
  }
  _isDependency(e) {
    return this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e);
  }
  _ensureNoRunning() {
    if (!this._isRunning)
      throw new QI("The reader object cannot be used outside its compute function!");
  }
  readObservable(e) {
    if ((this._ensureNoRunning(), this._disposed)) return e.get();
    e.addObserver(this);
    const t = e.get();
    return (this._dependencies.add(e), this._dependenciesToBeRemoved.delete(e), t);
  }
  get store() {
    if ((this._ensureNoRunning(), this._disposed))
      throw new QI("Cannot access store after dispose");
    return (void 0 === this._store && (this._store = new AO()), this._store);
  }
  debugGetState() {
    return {
      isRunning: this._isRunning,
      updateCount: this._updateCount,
      dependencies: this._dependencies,
      state: this._state,
      stateStr: nF(this._state),
    };
  }
  debugRerun() {
    this._isRunning ? (this._state = 2) : this._run();
  }
}
function rF(e, t = Tj.ofCaller()) {
  return new iF(new Pj(void 0, void 0, e), e, void 0, t);
}
function oF(e, t, n = Tj.ofCaller()) {
  return new iF(new Pj(e.owner, e.debugName, e.debugReferenceFn ?? t), t, void 0, n);
}
function sF(e, t, n = Tj.ofCaller()) {
  return new iF(new Pj(e.owner, e.debugName, e.debugReferenceFn ?? t), t, e.changeTracker, n);
}
function aF(e) {
  const t = new AO(),
    n = oF({ owner: void 0, debugName: void 0, debugReferenceFn: e }, (n) => {
      (t.clear(), e(n, t));
    });
  return MO(() => {
    (n.dispose(), t.dispose());
  });
}
function lF(e) {
  HI(new Error("BugIndicatingErrorRecovery: " + e));
}
function cF(e, t) {
  const n = new hF(e, t);
  try {
    e(n);
  } finally {
    n.finish();
  }
}
function dF(e) {
  if ($j) e($j);
  else {
    const t = new hF(e, void 0);
    $j = t;
    try {
      e(t);
    } finally {
      (t.finish(), ($j = void 0));
    }
  }
}
function uF(e, t, n) {
  e ? t(e) : cF(t, n);
}
class hF {
  constructor(e, t) {
    ((this._fn = e),
      (this._getDebugName = t),
      (this._updatingObservers = []),
      Lj()?.handleBeginTransaction(this));
  }
  getDebugName() {
    return this._getDebugName ? this._getDebugName() : Hj(this._fn);
  }
  updateObserver(e, t) {
    if (!this._updatingObservers)
      return (
        lF("Transaction already finished!"),
        void cF((n) => {
          n.updateObserver(e, t);
        })
      );
    (this._updatingObservers.push({ observer: e, observable: t }), e.beginUpdate(t));
  }
  finish() {
    const e = this._updatingObservers;
    if (e) {
      for (let t = 0; t < e.length; t++) {
        const { observer: n, observable: i } = e[t];
        n.endUpdate(i);
      }
      ((this._updatingObservers = null), Lj()?.handleEndTransaction(this));
    } else lF("transaction.finish() has already been called!");
  }
  debugGetUpdatingObservers() {
    return this._updatingObservers;
  }
}
function gF(...e) {
  let t, n, i, r;
  return (
    2 === e.length ? ([n, i] = e) : ([t, n, i, r] = e),
    new fF(new Pj(t, void 0, i), n, i, () => fF.globalTransaction, Rj, r ?? Tj.ofCaller())
  );
}
function pF(e, t, n, i = Tj.ofCaller()) {
  return new fF(
    new Pj(e.owner, e.debugName, e.debugReferenceFn ?? n),
    t,
    n,
    () => fF.globalTransaction,
    e.equalsFn ?? Rj,
    i,
  );
}
class fF extends Kj {
  constructor(e, t, n, i, r, o) {
    (super(o),
      (this._debugNameData = e),
      (this.event = t),
      (this._getValue = n),
      (this._getTransaction = i),
      (this._equalityComparator = r),
      (this._hasValue = !1),
      (this.handleEvent = (e) => {
        const t = this._getValue(e),
          n = this._value,
          i = !this._hasValue || !this._equalityComparator(n, t);
        let r = !1;
        (i &&
          ((this._value = t),
          this._hasValue &&
            ((r = !0),
            uF(
              this._getTransaction(),
              (e) => {
                Lj()?.handleObservableUpdated(this, {
                  oldValue: n,
                  newValue: t,
                  change: void 0,
                  didChange: i,
                  hadValue: this._hasValue,
                });
                for (const t of this._observers)
                  (e.updateObserver(t, this), t.handleChange(this, void 0));
              },
              () => {
                const e = this.getDebugName();
                return "Event fired" + (e ? `: ${e}` : "");
              },
            )),
          (this._hasValue = !0)),
          r ||
            Lj()?.handleObservableUpdated(this, {
              oldValue: n,
              newValue: t,
              change: void 0,
              didChange: i,
              hadValue: this._hasValue,
            }));
      }));
  }
  getDebugName() {
    return this._debugNameData.getDebugName(this);
  }
  get debugName() {
    const e = this.getDebugName();
    return "From Event" + (e ? `: ${e}` : "");
  }
  onFirstObserverAdded() {
    this._subscription = this.event(this.handleEvent);
  }
  onLastObserverRemoved() {
    (this._subscription.dispose(),
      (this._subscription = void 0),
      (this._hasValue = !1),
      (this._value = void 0));
  }
  get() {
    if (this._subscription) return (this._hasValue || this.handleEvent(void 0), this._value);
    return this._getValue(void 0);
  }
  debugSetValue(e) {
    this._value = e;
  }
  debugGetState() {
    return { value: this._value, hasValue: this._hasValue };
  }
}
function mF(e, t) {
  let n,
    i,
    r = !1;
  return gF(
    (o) => {
      const s = rF((s) => {
        const a = e.read(s);
        r
          ? (i && clearTimeout(i),
            (i = setTimeout(() => {
              ((n = a), o());
            }, t)))
          : ((r = !0), (n = a));
      });
      return {
        dispose() {
          (s.dispose(), (r = !1), (n = void 0));
        },
      };
    },
    () => (r ? n : e.get()),
  );
}
function _F(e, t) {
  const n = new vF(!0, t);
  e.addObserver(n);
  try {
    n.beginUpdate(e);
  } finally {
    n.endUpdate(e);
  }
  return MO(() => {
    e.removeObserver(n);
  });
}
(!(function (e) {
  ((e.Observer = fF),
    (e.batchEventsGlobally = function (e, t) {
      let n = !1;
      void 0 === fF.globalTransaction && ((fF.globalTransaction = e), (n = !0));
      try {
        t();
      } finally {
        n && (fF.globalTransaction = void 0);
      }
    }));
})(gF || (gF = {})),
  (function (e) {
    Uj = e;
  })(_F));
class vF {
  constructor(e, t) {
    ((this._forceRecompute = e), (this._handleValue = t), (this._counter = 0));
  }
  beginUpdate(e) {
    this._counter++;
  }
  endUpdate(e) {
    (1 === this._counter &&
      this._forceRecompute &&
      (this._handleValue ? this._handleValue(e.get()) : e.reportChanges()),
      this._counter--);
  }
  handlePossibleChange(e) {}
  handleChange(e, t) {}
}
function bF(e, t) {
  let n;
  return Jj({ owner: e, debugReferenceFn: t }, (e) => ((n = t(e, n)), n));
}
function yF(e, t, n, i) {
  let r = new xF(n, i);
  return Jj(
    {
      debugReferenceFn: n,
      owner: e,
      onLastObserverRemoved: () => {
        (r.dispose(), (r = new xF(n)));
      },
    },
    (e) => (r.setItems(t.read(e)), r.getItems()),
  );
}
let xF = class {
  constructor(e, t) {
    ((this._map = e), (this._keySelector = t), (this._cache = new Map()), (this._items = []));
  }
  dispose() {
    (this._cache.forEach((e) => e.store.dispose()), this._cache.clear());
  }
  setItems(e) {
    const t = [],
      n = new Set(this._cache.keys());
    for (const i of e) {
      const e = this._keySelector ? this._keySelector(i) : i;
      let r = this._cache.get(e);
      if (r) n.delete(e);
      else {
        const t = new AO();
        ((r = { out: this._map(i, t), store: t }), this._cache.set(e, r));
      }
      t.push(r.out);
    }
    for (const i of n) {
      (this._cache.get(i).store.dispose(), this._cache.delete(i));
    }
    this._items = t;
  }
  getItems() {
    return this._items;
  }
};
function wF(e, t) {
  switch (typeof e) {
    case "number":
    default:
      return "" + e;
    case "string":
      return e.length + 2 <= t ? `"${e}"` : `"${e.substr(0, t - 7)}"+...`;
    case "boolean":
      return e ? "true" : "false";
    case "undefined":
      return "undefined";
    case "object":
      return null === e
        ? "null"
        : Array.isArray(e)
          ? (function (e, t) {
              let n = "[ ",
                i = !0;
              for (const r of e) {
                if ((i || (n += ", "), n.length - 5 > t)) {
                  n += "...";
                  break;
                }
                ((i = !1), (n += `${wF(r, t - n.length)}`));
              }
              return ((n += " ]"), n);
            })(e, t)
          : (function (e, t) {
              if ("function" == typeof e.toString && e.toString !== Object.prototype.toString) {
                const n = e.toString();
                return n.length <= t ? n : n.substring(0, t - 3) + "...";
              }
              const n = Wj(e);
              let i = n ? n + "(" : "{ ",
                r = !0;
              for (const [o, s] of Object.entries(e)) {
                if ((r || (i += ", "), i.length - 5 > t)) {
                  i += "...";
                  break;
                }
                ((r = !1), (i += `${o}: ${wF(s, t - i.length)}`));
              }
              return ((i += n ? ")" : " }"), i);
            })(e, t);
    case "symbol":
      return e.toString();
    case "function":
      return `[[Function${e.name ? " " + e.name : ""}]]`;
  }
}
class CF {
  static createClient(e, t) {
    return new CF(e, t);
  }
  constructor(e, t) {
    ((this._channelFactory = e),
      (this._getHandler = t),
      (this._channel = this._channelFactory({
        handleNotification: (e) => {
          const t = e,
            n = this._getHandler().notifications[t[0]];
          if (!n) throw new Error(`Unknown notification "${t[0]}"!`);
          n(...t[1]);
        },
        handleRequest: (e) => {
          const t = e;
          try {
            return { type: "result", value: this._getHandler().requests[t[0]](...t[1]) };
          } catch (spt) {
            return { type: "error", value: spt };
          }
        },
      })));
    const n = new Proxy(
        {},
        {
          get:
            (e, t) =>
            async (...e) => {
              const n = await this._channel.sendRequest([t, e]);
              if ("error" === n.type) throw n.value;
              return n.value;
            },
        },
      ),
      i = new Proxy(
        {},
        {
          get:
            (e, t) =>
            (...e) => {
              this._channel.sendNotification([t, e]);
            },
        },
      );
    this.api = { notifications: i, requests: n };
  }
}
function SF(e, t) {
  const n = globalThis;
  let i,
    r = [];
  const { channel: o, handler: s } = (function (e) {
    let t;
    const n = (n) => (
      (t = n),
      {
        sendNotification: (t) => {
          e.sendNotification(t);
        },
        sendRequest: (e) => {
          throw new Error("not supported");
        },
      }
    );
    return {
      channel: n,
      handler: {
        handleRequest: (e) =>
          "notification" === e.type ? t?.handleNotification(e.data) : t?.handleRequest(e.data),
      },
    };
  })({
    sendNotification: (e) => {
      i ? i.sendNotification(e) : r.push(e);
    },
  });
  let a;
  return (
    ((n.$$debugValueEditor_debugChannels ?? (n.$$debugValueEditor_debugChannels = {}))[e] = (e) => {
      ((a = t()), (i = e));
      for (const t of r) e.sendNotification(t);
      return ((r = []), s);
    }),
    CF.createClient(o, () => {
      if (!a) throw new Error("Not supported");
      return a;
    })
  );
}
class kF {
  constructor() {
    this._timeout = void 0;
  }
  throttle(e, t) {
    void 0 === this._timeout &&
      (this._timeout = setTimeout(() => {
        ((this._timeout = void 0), e());
      }, t));
  }
  dispose() {
    void 0 !== this._timeout && clearTimeout(this._timeout);
  }
}
function EF(e, t) {
  for (const n in t)
    e[n] && "object" == typeof e[n] && t[n] && "object" == typeof t[n]
      ? EF(e[n], t[n])
      : (e[n] = t[n]);
}
function NF(e, t) {
  for (const n in t)
    null === t[n]
      ? delete e[n]
      : e[n] && "object" == typeof e[n] && t[n] && "object" == typeof t[n]
        ? NF(e[n], t[n])
        : (e[n] = t[n]);
}
function LF(e, t, n = Tj.ofCaller()) {
  let i;
  return (
    (i = "string" == typeof e ? new Pj(void 0, e, void 0) : new Pj(e, void 0, void 0)),
    new DF(i, t, Rj, n)
  );
}
class DF extends Kj {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? "ObservableValue";
  }
  constructor(e, t, n, i) {
    (super(i),
      (this._debugNameData = e),
      (this._equalityComparator = n),
      (this._value = t),
      Lj()?.handleObservableUpdated(this, {
        hadValue: !1,
        newValue: t,
        change: void 0,
        didChange: !0,
        oldValue: void 0,
      }));
  }
  get() {
    return this._value;
  }
  set(e, t, n) {
    if (void 0 === n && this._equalityComparator(this._value, e)) return;
    let i;
    t ||
      (t = i =
        new hF(
          () => {},
          () => `Setting ${this.debugName}`,
        ));
    try {
      const i = this._value;
      (this._setValue(e),
        Lj()?.handleObservableUpdated(this, {
          oldValue: i,
          newValue: e,
          change: n,
          didChange: !0,
          hadValue: !0,
        }));
      for (const e of this._observers) (t.updateObserver(e, this), e.handleChange(this, n));
    } finally {
      i && i.finish();
    }
  }
  toString() {
    return `${this.debugName}: ${this._value}`;
  }
  _setValue(e) {
    this._value = e;
  }
  debugGetState() {
    return { value: this._value };
  }
  debugSetValue(e) {
    this._value = e;
  }
}
function TF(e, t, n = Tj.ofCaller()) {
  let i;
  return (
    (i = "string" == typeof e ? new Pj(void 0, e, void 0) : new Pj(e, void 0, void 0)),
    new IF(i, t, Rj, n)
  );
}
class IF extends DF {
  _setValue(e) {
    this._value !== e && (this._value && this._value.dispose(), (this._value = e));
  }
  dispose() {
    this._value?.dispose();
  }
}
class RF {
  static {
    this._instance = void 0;
  }
  static getInstance() {
    return (void 0 === RF._instance && (RF._instance = new RF()), RF._instance);
  }
  getTransactionState() {
    const e = [],
      t = [...this._activeTransactions];
    if (0 === t.length) return;
    const n = t.flatMap((e) => e.debugGetUpdatingObservers() ?? []).map((e) => e.observer),
      i = new Set();
    for (; n.length > 0; ) {
      const t = n.shift();
      if (i.has(t)) continue;
      i.add(t);
      const r = this._getInfo(t, (e) => {
        i.has(e) || n.push(e);
      });
      r && e.push(r);
    }
    return { names: t.map((e) => e.getDebugName() ?? "tx"), affected: e };
  }
  _getObservableInfo(e) {
    const t = this._instanceInfos.get(e);
    if (t) return t;
    HI(new QI("No info found"));
  }
  _getAutorunInfo(e) {
    const t = this._instanceInfos.get(e);
    if (t) return t;
    HI(new QI("No info found"));
  }
  _getInfo(e, t) {
    if (e instanceof Zj) {
      const n = [...e.debugGetObservers()];
      for (const e of n) t(e);
      const i = this._getObservableInfo(e);
      if (!i) return;
      const r = e.debugGetState(),
        o = { name: e.debugName, instanceId: i.instanceId, updateCount: r.updateCount },
        s = [...i.changedObservables].map((e) => this._instanceInfos.get(e)?.instanceId).filter(hR);
      if (r.isComputing)
        return {
          ...o,
          type: "observable/derived",
          state: "updating",
          changedDependencies: s,
          initialComputation: !1,
        };
      switch (r.state) {
        case 0:
          return { ...o, type: "observable/derived", state: "noValue" };
        case 3:
          return { ...o, type: "observable/derived", state: "upToDate" };
        case 2:
          return { ...o, type: "observable/derived", state: "stale", changedDependencies: s };
        case 1:
          return { ...o, type: "observable/derived", state: "possiblyStale" };
      }
    } else if (e instanceof iF) {
      const t = this._getAutorunInfo(e);
      if (!t) return;
      const n = { name: e.debugName, instanceId: t.instanceId, updateCount: t.updateCount },
        i = [...t.changedObservables].map((e) => this._instanceInfos.get(e).instanceId);
      if (e.debugGetState().isRunning)
        return { ...n, type: "autorun", state: "updating", changedDependencies: i };
      switch (e.debugGetState().state) {
        case 3:
          return { ...n, type: "autorun", state: "upToDate" };
        case 2:
          return { ...n, type: "autorun", state: "stale", changedDependencies: i };
        case 1:
          return { ...n, type: "autorun", state: "possiblyStale" };
      }
    }
  }
  _formatObservable(e) {
    const t = this._getObservableInfo(e);
    if (t) return { name: e.debugName, instanceId: t.instanceId };
  }
  _formatObserver(e) {
    if (e instanceof Zj)
      return { name: e.toString(), instanceId: this._getObservableInfo(e)?.instanceId };
    const t = this._getAutorunInfo(e);
    return t ? { name: e.toString(), instanceId: t.instanceId } : void 0;
  }
  constructor() {
    ((this._declarationId = 0),
      (this._instanceId = 0),
      (this._declarations = new Map()),
      (this._instanceInfos = new WeakMap()),
      (this._aliveInstances = new Map()),
      (this._activeTransactions = new Set()),
      (this._channel = SF("observableDevTools", () => ({
        notifications: {
          setDeclarationIdFilter: (e) => {},
          logObservableValue: (e) => {},
          flushUpdates: () => {
            this._flushUpdates();
          },
          resetUpdates: () => {
            ((this._pendingChanges = null),
              this._channel.api.notifications.handleChange(this._fullState, !0));
          },
        },
        requests: {
          getDeclarations: () => {
            const e = {};
            for (const t of this._declarations.values()) e[t.id] = t;
            return { decls: e };
          },
          getSummarizedInstances: () => null,
          getObservableValueInfo: (e) => ({
            observers: [...this._aliveInstances.get(e).debugGetObservers()]
              .map((e) => this._formatObserver(e))
              .filter(hR),
          }),
          getDerivedInfo: (e) => {
            const t = this._aliveInstances.get(e);
            return {
              dependencies: [...t.debugGetState().dependencies]
                .map((e) => this._formatObservable(e))
                .filter(hR),
              observers: [...t.debugGetObservers()].map((e) => this._formatObserver(e)).filter(hR),
            };
          },
          getAutorunInfo: (e) => ({
            dependencies: [...this._aliveInstances.get(e).debugGetState().dependencies]
              .map((e) => this._formatObservable(e))
              .filter(hR),
          }),
          getTransactionState: () => this.getTransactionState(),
          setValue: (e, t) => {
            const n = this._aliveInstances.get(e);
            if (n instanceof Zj) n.debugSetValue(t);
            else if (n instanceof DF) n.debugSetValue(t);
            else {
              if (!(n instanceof fF)) throw new QI("Observable is not supported");
              n.debugSetValue(t);
            }
            const i = [...n.debugGetObservers()];
            for (const r of i) r.beginUpdate(n);
            for (const r of i) r.handleChange(n, void 0);
            for (const r of i) r.endUpdate(n);
          },
          getValue: (e) => {
            const t = this._aliveInstances.get(e);
            return t instanceof Zj || t instanceof DF ? wF(t.debugGetState().value, 200) : void 0;
          },
          logValue: (e) => {
            const t = this._aliveInstances.get(e);
            if (!t || !("get" in t)) throw new QI("Observable is not supported");
          },
          rerun: (e) => {
            const t = this._aliveInstances.get(e);
            if (t instanceof Zj) t.debugRecompute();
            else {
              if (!(t instanceof iF)) throw new QI("Observable is not supported");
              t.debugRerun();
            }
          },
        },
      }))),
      (this._pendingChanges = null),
      (this._changeThrottler = new kF()),
      (this._fullState = {}),
      (this._flushUpdates = () => {
        null !== this._pendingChanges &&
          (this._channel.api.notifications.handleChange(this._pendingChanges, !1),
          (this._pendingChanges = null));
      }),
      Tj.enable());
  }
  _handleChange(e) {
    (NF(this._fullState, e),
      null === this._pendingChanges ? (this._pendingChanges = e) : EF(this._pendingChanges, e),
      this._changeThrottler.throttle(this._flushUpdates, 10));
  }
  _getDeclarationId(e, t) {
    if (!t) return -1;
    let n = this._declarations.get(t.id);
    return (
      void 0 === n &&
        ((n = {
          id: this._declarationId++,
          type: e,
          url: t.fileName,
          line: t.line,
          column: t.column,
        }),
        this._declarations.set(t.id, n),
        this._handleChange({ decls: { [n.id]: n } })),
      n.id
    );
  }
  handleObservableCreated(e, t) {
    const n = {
      declarationId: this._getDeclarationId("observable/value", t),
      instanceId: this._instanceId++,
      listenerCount: 0,
      lastValue: void 0,
      updateCount: 0,
      changedObservables: new Set(),
    };
    this._instanceInfos.set(e, n);
  }
  handleOnListenerCountChanged(e, t) {
    const n = this._getObservableInfo(e);
    if (n) {
      if (0 === n.listenerCount && t > 0) {
        const t = e instanceof Zj ? "observable/derived" : "observable/value";
        (this._aliveInstances.set(n.instanceId, e),
          this._handleChange({
            instances: {
              [n.instanceId]: {
                instanceId: n.instanceId,
                declarationId: n.declarationId,
                formattedValue: n.lastValue,
                type: t,
                name: e.debugName,
              },
            },
          }));
      } else
        n.listenerCount > 0 &&
          0 === t &&
          (this._handleChange({ instances: { [n.instanceId]: null } }),
          this._aliveInstances.delete(n.instanceId));
      n.listenerCount = t;
    }
  }
  handleObservableUpdated(e, t) {
    if (e instanceof Zj) return void this._handleDerivedRecomputed(e, t);
    const n = this._getObservableInfo(e);
    n &&
      t.didChange &&
      ((n.lastValue = wF(t.newValue, 30)),
      n.listenerCount > 0 &&
        this._handleChange({ instances: { [n.instanceId]: { formattedValue: n.lastValue } } }));
  }
  handleAutorunCreated(e, t) {
    const n = {
      declarationId: this._getDeclarationId("autorun", t),
      instanceId: this._instanceId++,
      updateCount: 0,
      changedObservables: new Set(),
    };
    (this._instanceInfos.set(e, n),
      this._aliveInstances.set(n.instanceId, e),
      n &&
        this._handleChange({
          instances: {
            [n.instanceId]: {
              instanceId: n.instanceId,
              declarationId: n.declarationId,
              runCount: 0,
              type: "autorun",
              name: e.debugName,
            },
          },
        }));
  }
  handleAutorunDisposed(e) {
    const t = this._getAutorunInfo(e);
    t &&
      (this._handleChange({ instances: { [t.instanceId]: null } }),
      this._instanceInfos.delete(e),
      this._aliveInstances.delete(t.instanceId));
  }
  handleAutorunDependencyChanged(e, t, n) {
    const i = this._getAutorunInfo(e);
    i && i.changedObservables.add(t);
  }
  handleAutorunStarted(e) {}
  handleAutorunFinished(e) {
    const t = this._getAutorunInfo(e);
    t &&
      (t.changedObservables.clear(),
      t.updateCount++,
      this._handleChange({ instances: { [t.instanceId]: { runCount: t.updateCount } } }));
  }
  handleDerivedDependencyChanged(e, t, n) {
    const i = this._getObservableInfo(e);
    i && i.changedObservables.add(t);
  }
  _handleDerivedRecomputed(e, t) {
    const n = this._getObservableInfo(e);
    if (!n) return;
    const i = wF(t.newValue, 30);
    (n.updateCount++,
      n.changedObservables.clear(),
      (n.lastValue = i),
      n.listenerCount > 0 &&
        this._handleChange({
          instances: { [n.instanceId]: { formattedValue: i, recomputationCount: n.updateCount } },
        }));
  }
  handleDerivedCleared(e) {
    const t = this._getObservableInfo(e);
    t &&
      ((t.lastValue = void 0),
      t.changedObservables.clear(),
      t.listenerCount > 0 &&
        this._handleChange({ instances: { [t.instanceId]: { formattedValue: void 0 } } }));
  }
  handleBeginTransaction(e) {
    this._activeTransactions.add(e);
  }
  handleEndTransaction(e) {
    this._activeTransactions.delete(e);
  }
}
var OF;
VA &&
  VA.VSCODE_DEV_DEBUG_OBSERVABLES &&
  ((OF = RF.getInstance()),
  Nj ? (Nj instanceof Dj ? Nj.loggers.push(OF) : (Nj = new Dj([Nj, OF]))) : (Nj = OF));
const {
  getWindow: MF,
  getDocument: AF,
  getWindows: PF,
  getWindowsCount: jF,
  getWindowId: FF,
  getWindowById: BF,
  onDidRegisterWindow: VF,
  onWillUnregisterWindow: WF,
  onDidUnregisterWindow: HF,
} = (function () {
  const e = new Map();
  !(function (e, t) {
    const n = e;
    "number" != typeof n.vscodeWindowId &&
      Object.defineProperty(n, "vscodeWindowId", { get: () => t });
  })(NI, 1);
  const t = { window: NI, disposables: new AO() };
  e.set(NI.vscodeWindowId, t);
  const n = new QO(),
    i = new QO(),
    r = new QO();
  return {
    onDidRegisterWindow: n.event,
    onWillUnregisterWindow: r.event,
    onDidUnregisterWindow: i.event,
    registerWindow(t) {
      if (e.has(t.vscodeWindowId)) return PO.None;
      const o = new AO(),
        s = { window: t, disposables: o.add(new AO()) };
      return (
        e.set(t.vscodeWindowId, s),
        o.add(
          MO(() => {
            (e.delete(t.vscodeWindowId), i.fire(t));
          }),
        ),
        o.add(
          $F(t, DB.BEFORE_UNLOAD, () => {
            r.fire(t);
          }),
        ),
        n.fire(s),
        o
      );
    },
    getWindows: () => e.values(),
    getWindowsCount: () => e.size,
    getWindowId: (e) => e.vscodeWindowId,
    hasWindow: (t) => e.has(t),
    getWindowById: function (n, i) {
      return ("number" == typeof n ? e.get(n) : void 0) ?? (i ? t : void 0);
    },
    getWindow(e) {
      const t = e;
      if (t?.ownerDocument?.defaultView) return t.ownerDocument.defaultView.window;
      const n = e;
      return n?.view ? n.view.window : NI;
    },
    getDocument: (e) => MF(e).document,
  };
})();
function zF(e) {
  for (; e.firstChild; ) e.firstChild.remove();
}
class UF {
  constructor(e, t, n, i) {
    ((this._node = e),
      (this._type = t),
      (this._handler = n),
      (this._options = i || !1),
      this._node.addEventListener(this._type, this._handler, this._options));
  }
  dispose() {
    this._handler &&
      (this._node.removeEventListener(this._type, this._handler, this._options),
      (this._node = null),
      (this._handler = null));
  }
}
function $F(e, t, n, i) {
  return new UF(e, t, n, i);
}
function qF(e, t) {
  return function (n) {
    return t(new EO(e, n));
  };
}
const KF = function (e, t, n, i) {
  let r = n;
  return (
    "click" === t || "mousedown" === t || "contextmenu" === t
      ? (r = qF(MF(e), n))
      : ("keydown" !== t && "keypress" !== t && "keyup" !== t) ||
        (r = (function (e) {
          return function (t) {
            return e(new wO(t));
          };
        })(n)),
    $F(e, t, r, i)
  );
};
function GF(e, t, n) {
  return $F(e, WR && iO ? DB.POINTER_DOWN : DB.MOUSE_DOWN, t, n);
}
function ZF(e, t, n) {
  return $F(e, WR && iO ? DB.POINTER_UP : DB.MOUSE_UP, t, n);
}
function YF(e, t, n) {
  return wM(e, t, n);
}
class XF extends NM {
  constructor(e, t) {
    super(e, t);
  }
}
let QF, JF;
class eB extends kM {
  constructor(e) {
    (super(), (this.defaultTarget = e && MF(e)));
  }
  cancelAndSet(e, t, n) {
    return super.cancelAndSet(e, t, n ?? this.defaultTarget);
  }
}
class tB {
  constructor(e, t = 0) {
    ((this._runner = e), (this.priority = t), (this._canceled = !1));
  }
  dispose() {
    this._canceled = !0;
  }
  execute() {
    if (!this._canceled)
      try {
        this._runner();
      } catch (spt) {
        HI(spt);
      }
  }
  static sort(e, t) {
    return t.priority - e.priority;
  }
}
function nB(e) {
  return MF(e).getComputedStyle(e, null);
}
function iB(e, t, n) {
  const i = MF(e),
    r = i.document;
  if (e !== r.body) return new oB(e.clientWidth, e.clientHeight);
  if (WR && i?.visualViewport) return new oB(i.visualViewport.width, i.visualViewport.height);
  if (i?.innerWidth && i.innerHeight) return new oB(i.innerWidth, i.innerHeight);
  if (r.body && r.body.clientWidth && r.body.clientHeight)
    return new oB(r.body.clientWidth, r.body.clientHeight);
  if (r.documentElement && r.documentElement.clientWidth && r.documentElement.clientHeight)
    return new oB(r.documentElement.clientWidth, r.documentElement.clientHeight);
  throw new Error("Unable to figure out browser width and height");
}
!(function () {
  const e = new Map(),
    t = new Map(),
    n = new Map(),
    i = new Map();
  ((JF = (r, o, s = 0) => {
    const a = FF(r),
      l = new tB(o, s);
    let c = e.get(a);
    return (
      c || ((c = []), e.set(a, c)),
      c.push(l),
      n.get(a) ||
        (n.set(a, !0),
        r.requestAnimationFrame(() =>
          ((r) => {
            n.set(r, !1);
            const o = e.get(r) ?? [];
            for (t.set(r, o), e.set(r, []), i.set(r, !0); o.length > 0; )
              (o.sort(tB.sort), o.shift().execute());
            i.set(r, !1);
          })(a),
        )),
      l
    );
  }),
    (QF = (e, n, r) => {
      const o = FF(e);
      if (i.get(o)) {
        const e = new tB(n, r);
        let i = t.get(o);
        return (i || ((i = []), t.set(o, i)), i.push(e), e);
      }
      return JF(e, n, r);
    }));
})();
class rB {
  static convertToPixels(e, t) {
    return parseFloat(t) || 0;
  }
  static getDimension(e, t) {
    const n = nB(e),
      i = n ? n.getPropertyValue(t) : "0";
    return rB.convertToPixels(e, i);
  }
  static getBorderLeftWidth(e) {
    return rB.getDimension(e, "border-left-width");
  }
  static getBorderRightWidth(e) {
    return rB.getDimension(e, "border-right-width");
  }
  static getBorderTopWidth(e) {
    return rB.getDimension(e, "border-top-width");
  }
  static getBorderBottomWidth(e) {
    return rB.getDimension(e, "border-bottom-width");
  }
  static getPaddingLeft(e) {
    return rB.getDimension(e, "padding-left");
  }
  static getPaddingRight(e) {
    return rB.getDimension(e, "padding-right");
  }
  static getPaddingTop(e) {
    return rB.getDimension(e, "padding-top");
  }
  static getPaddingBottom(e) {
    return rB.getDimension(e, "padding-bottom");
  }
  static getMarginLeft(e) {
    return rB.getDimension(e, "margin-left");
  }
  static getMarginTop(e) {
    return rB.getDimension(e, "margin-top");
  }
  static getMarginRight(e) {
    return rB.getDimension(e, "margin-right");
  }
  static getMarginBottom(e) {
    return rB.getDimension(e, "margin-bottom");
  }
}
class oB {
  static {
    this.None = new oB(0, 0);
  }
  constructor(e, t) {
    ((this.width = e), (this.height = t));
  }
  with(e = this.width, t = this.height) {
    return e !== this.width || t !== this.height ? new oB(e, t) : this;
  }
  static is(e) {
    return "object" == typeof e && "number" == typeof e.height && "number" == typeof e.width;
  }
  static lift(e) {
    return e instanceof oB ? e : new oB(e.width, e.height);
  }
  static equals(e, t) {
    return e === t || (!(!e || !t) && e.width === t.width && e.height === t.height);
  }
}
function sB(e) {
  let t = e.offsetParent,
    n = e.offsetTop,
    i = e.offsetLeft;
  for (
    ;
    null !== (e = e.parentNode) &&
    e !== e.ownerDocument.body &&
    e !== e.ownerDocument.documentElement;
  ) {
    n -= e.scrollTop;
    const r = fB(e) ? null : nB(e);
    (r && (i -= "rtl" !== r.direction ? e.scrollLeft : -e.scrollLeft),
      e === t &&
        ((i += rB.getBorderLeftWidth(e)),
        (n += rB.getBorderTopWidth(e)),
        (n += e.offsetTop),
        (i += e.offsetLeft),
        (t = e.offsetParent)));
  }
  return { left: i, top: n };
}
function aB(e) {
  const t = e.getBoundingClientRect(),
    n = MF(e);
  return { left: t.left + n.scrollX, top: t.top + n.scrollY, width: t.width, height: t.height };
}
function lB(e) {
  let t = e,
    n = 1;
  do {
    const e = nB(t).zoom;
    (null != e && "1" !== e && (n *= e), (t = t.parentElement));
  } while (null !== t && t !== t.ownerDocument.documentElement);
  return n;
}
function cB(e) {
  const t = rB.getMarginLeft(e) + rB.getMarginRight(e);
  return e.offsetWidth + t;
}
function dB(e) {
  const t = rB.getBorderLeftWidth(e) + rB.getBorderRightWidth(e),
    n = rB.getPaddingLeft(e) + rB.getPaddingRight(e);
  return e.offsetWidth - t - n;
}
function uB(e) {
  const t = rB.getBorderTopWidth(e) + rB.getBorderBottomWidth(e),
    n = rB.getPaddingTop(e) + rB.getPaddingBottom(e);
  return e.offsetHeight - t - n;
}
function hB(e) {
  const t = rB.getMarginTop(e) + rB.getMarginBottom(e);
  return e.offsetHeight + t;
}
function gB(e, t) {
  return Boolean(t?.contains(e));
}
function pB(e, t, n) {
  return !!(function (e, t, n) {
    for (; e && e.nodeType === e.ELEMENT_NODE; ) {
      if (e.classList.contains(t)) return e;
      if (n)
        if ("string" == typeof n) {
          if (e.classList.contains(n)) return null;
        } else if (e === n) return null;
      e = e.parentNode;
    }
    return null;
  })(e, t, n);
}
function fB(e) {
  return e && !!e.host && !!e.mode;
}
function mB(e) {
  return !!_B(e);
}
function _B(e) {
  for (; e.parentNode; ) {
    if (e === e.ownerDocument?.body) return null;
    e = e.parentNode;
  }
  return fB(e) ? e : null;
}
function vB() {
  let e = xB().activeElement;
  for (; e?.shadowRoot; ) e = e.shadowRoot.activeElement;
  return e;
}
function bB(e) {
  return vB() === e;
}
function yB(e) {
  return gB(vB(), e);
}
function xB() {
  if (jF() <= 1) return NI.document;
  return (
    Array.from(PF())
      .map(({ window: e }) => e.document)
      .find((e) => e.hasFocus()) ?? NI.document
  );
}
function wB() {
  const e = xB();
  return e.defaultView?.window ?? NI;
}
const CB = new (class {
  constructor() {
    this.mutationObservers = new Map();
  }
  observe(e, t, n) {
    let i = this.mutationObservers.get(e);
    i || ((i = new Map()), this.mutationObservers.set(e, i));
    const r = UP(n);
    let o = i.get(r);
    if (o) o.users += 1;
    else {
      const s = new QO(),
        a = new MutationObserver((e) => s.fire(e));
      a.observe(e, n);
      const l = (o = { users: 1, observer: a, onDidMutate: s.event });
      (t.add(
        MO(() => {
          ((l.users -= 1),
            0 === l.users &&
              (s.dispose(),
              a.disconnect(),
              i?.delete(r),
              0 === i?.size && this.mutationObservers.delete(e)));
        }),
      ),
        i.set(r, o));
    }
    return o.onDidMutate;
  }
})();
function SB(e) {
  return e instanceof HTMLElement || e instanceof MF(e).HTMLElement;
}
function kB(e) {
  return e instanceof HTMLAnchorElement || e instanceof MF(e).HTMLAnchorElement;
}
function EB(e) {
  return e instanceof SVGElement || e instanceof MF(e).SVGElement;
}
function NB(e) {
  return e instanceof MouseEvent || e instanceof MF(e).MouseEvent;
}
function LB(e) {
  return e instanceof KeyboardEvent || e instanceof MF(e).KeyboardEvent;
}
const DB = {
  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 TB(e) {
  const t = e;
  return !(!t || "function" != typeof t.preventDefault || "function" != typeof t.stopPropagation);
}
const IB = (e, t) => (e.preventDefault(), t && e.stopPropagation(), e);
let RB = class e extends PO {
  get onDidFocus() {
    return this._onDidFocus.event;
  }
  get onDidBlur() {
    return this._onDidBlur.event;
  }
  static hasFocusWithin(e) {
    if (SB(e)) {
      const t = _B(e);
      return gB(t ? t.activeElement : e.ownerDocument.activeElement, e);
    }
    {
      const t = e;
      return gB(t.document.activeElement, t.document);
    }
  }
  constructor(t) {
    (super(),
      (this._onDidFocus = this._register(new QO())),
      (this._onDidBlur = this._register(new QO())));
    let n = e.hasFocusWithin(t),
      i = !1;
    const r = () => {
        ((i = !1), n || ((n = !0), this._onDidFocus.fire()));
      },
      o = () => {
        n &&
          ((i = !0),
          (SB(t) ? MF(t) : t).setTimeout(() => {
            i && ((i = !1), (n = !1), this._onDidBlur.fire());
          }, 0));
      };
    ((this._refreshStateHandler = () => {
      e.hasFocusWithin(t) !== n && (n ? o() : r());
    }),
      this._register($F(t, DB.FOCUS, r, !0)),
      this._register($F(t, DB.BLUR, o, !0)),
      SB(t) &&
        (this._register($F(t, DB.FOCUS_IN, () => this._refreshStateHandler())),
        this._register($F(t, DB.FOCUS_OUT, () => this._refreshStateHandler()))));
  }
};
function OB(e) {
  return new RB(e);
}
function MB(e, ...t) {
  if ((e.append(...t), 1 === t.length && "string" != typeof t[0])) return t[0];
}
function AB(e, t) {
  return (e.insertBefore(t, e.firstChild), t);
}
function PB(e, ...t) {
  ((e.textContent = ""), MB(e, ...t));
}
const jB = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;
var FB;
function BB(e, t, n, ...i) {
  const r = jB.exec(t);
  if (!r) throw new Error("Bad use of emmet");
  const o = r[1] || "div";
  let s;
  return (
    (s = e !== FB.HTML ? document.createElementNS(e, o) : document.createElement(o)),
    r[3] && (s.id = r[3]),
    r[4] && (s.className = r[4].replace(/\./g, " ").trim()),
    n &&
      Object.entries(n).forEach(([e, t]) => {
        void 0 !== t &&
          (/^on\w+$/.test(e)
            ? (s[e] = t)
            : "selected" === e
              ? t && s.setAttribute(e, "true")
              : s.setAttribute(e, t));
      }),
    s.append(...i),
    s
  );
}
function VB(e, t, ...n) {
  return BB(FB.HTML, e, t, ...n);
}
function WB(...e) {
  for (const t of e) ((t.style.display = ""), t.removeAttribute("aria-hidden"));
}
function HB(...e) {
  for (const t of e) ((t.style.display = "none"), t.setAttribute("aria-hidden", "true"));
}
function zB(e, t) {
  const n = e.devicePixelRatio * t;
  return Math.max(1, Math.floor(n)) / e.devicePixelRatio;
}
function UB(e) {
  NI.open(e, "_blank", "noopener");
}
(!(function (e) {
  ((e.HTML = "http://www.w3.org/1999/xhtml"), (e.SVG = "http://www.w3.org/2000/svg"));
})(FB || (FB = {})),
  (VB.SVG = function (e, t, ...n) {
    return BB(FB.SVG, e, t, ...n);
  }),
  TP.setPreferredWebSchema(/^https:/.test(NI.location.href) ? "https" : "http"));
class $B extends QO {
  constructor() {
    (super(),
      (this._subscriptions = new AO()),
      (this._keyStatus = { altKey: !1, shiftKey: !1, ctrlKey: !1, metaKey: !1 }),
      this._subscriptions.add(
        $O.runAndSubscribe(VF, ({ window: e, disposables: t }) => this.registerListeners(e, t), {
          window: NI,
          disposables: this._subscriptions,
        }),
      ));
  }
  registerListeners(e, t) {
    (t.add(
      $F(
        e,
        "keydown",
        (e) => {
          if (e.defaultPrevented) return;
          const t = new wO(e);
          if (6 !== t.keyCode || !e.repeat) {
            if (e.altKey && !this._keyStatus.altKey) this._keyStatus.lastKeyPressed = "alt";
            else if (e.ctrlKey && !this._keyStatus.ctrlKey) this._keyStatus.lastKeyPressed = "ctrl";
            else if (e.metaKey && !this._keyStatus.metaKey) this._keyStatus.lastKeyPressed = "meta";
            else if (e.shiftKey && !this._keyStatus.shiftKey)
              this._keyStatus.lastKeyPressed = "shift";
            else {
              if (6 === t.keyCode) return;
              this._keyStatus.lastKeyPressed = void 0;
            }
            ((this._keyStatus.altKey = e.altKey),
              (this._keyStatus.ctrlKey = e.ctrlKey),
              (this._keyStatus.metaKey = e.metaKey),
              (this._keyStatus.shiftKey = e.shiftKey),
              this._keyStatus.lastKeyPressed &&
                ((this._keyStatus.event = e), this.fire(this._keyStatus)));
          }
        },
        !0,
      ),
    ),
      t.add(
        $F(
          e,
          "keyup",
          (e) => {
            e.defaultPrevented ||
              (!e.altKey && this._keyStatus.altKey
                ? (this._keyStatus.lastKeyReleased = "alt")
                : !e.ctrlKey && this._keyStatus.ctrlKey
                  ? (this._keyStatus.lastKeyReleased = "ctrl")
                  : !e.metaKey && this._keyStatus.metaKey
                    ? (this._keyStatus.lastKeyReleased = "meta")
                    : !e.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 = e.altKey),
              (this._keyStatus.ctrlKey = e.ctrlKey),
              (this._keyStatus.metaKey = e.metaKey),
              (this._keyStatus.shiftKey = e.shiftKey),
              this._keyStatus.lastKeyReleased &&
                ((this._keyStatus.event = e), this.fire(this._keyStatus)));
          },
          !0,
        ),
      ),
      t.add(
        $F(
          e.document.body,
          "mousedown",
          () => {
            this._keyStatus.lastKeyPressed = void 0;
          },
          !0,
        ),
      ),
      t.add(
        $F(
          e.document.body,
          "mouseup",
          () => {
            this._keyStatus.lastKeyPressed = void 0;
          },
          !0,
        ),
      ),
      t.add(
        $F(
          e.document.body,
          "mousemove",
          (e) => {
            e.buttons && (this._keyStatus.lastKeyPressed = void 0);
          },
          !0,
        ),
      ),
      t.add(
        $F(e, "blur", () => {
          this.resetKeyStatus();
        }),
      ));
  }
  get keyStatus() {
    return this._keyStatus;
  }
  resetKeyStatus() {
    (this.doResetKeyStatus(), this.fire(this._keyStatus));
  }
  doResetKeyStatus() {
    this._keyStatus = { altKey: !1, shiftKey: !1, ctrlKey: !1, metaKey: !1 };
  }
  static getInstance() {
    return ($B.instance || ($B.instance = new $B()), $B.instance);
  }
  dispose() {
    (super.dispose(), this._subscriptions.dispose());
  }
}
class qB extends PO {
  constructor(e, t) {
    (super(),
      (this.element = e),
      (this.callbacks = t),
      (this.counter = 0),
      (this.dragStartTime = 0),
      this.registerListeners());
  }
  registerListeners() {
    (this.callbacks.onDragStart &&
      this._register(
        $F(this.element, DB.DRAG_START, (e) => {
          this.callbacks.onDragStart?.(e);
        }),
      ),
      this.callbacks.onDrag &&
        this._register(
          $F(this.element, DB.DRAG, (e) => {
            this.callbacks.onDrag?.(e);
          }),
        ),
      this._register(
        $F(this.element, DB.DRAG_ENTER, (e) => {
          (this.counter++, (this.dragStartTime = e.timeStamp), this.callbacks.onDragEnter?.(e));
        }),
      ),
      this._register(
        $F(this.element, DB.DRAG_OVER, (e) => {
          (e.preventDefault(), this.callbacks.onDragOver?.(e, e.timeStamp - this.dragStartTime));
        }),
      ),
      this._register(
        $F(this.element, DB.DRAG_LEAVE, (e) => {
          (this.counter--,
            0 === this.counter && ((this.dragStartTime = 0), this.callbacks.onDragLeave?.(e)));
        }),
      ),
      this._register(
        $F(this.element, DB.DRAG_END, (e) => {
          ((this.counter = 0), (this.dragStartTime = 0), this.callbacks.onDragEnd?.(e));
        }),
      ),
      this._register(
        $F(this.element, DB.DROP, (e) => {
          ((this.counter = 0), (this.dragStartTime = 0), this.callbacks.onDrop?.(e));
        }),
      ));
  }
}
const KB =
  /(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;
function GB(e, ...t) {
  let n, i;
  Array.isArray(t[0]) ? ((n = {}), (i = t[0])) : ((n = t[0] || {}), (i = t[1]));
  const r = KB.exec(e);
  if (!r || !r.groups) throw new Error("Bad use of h");
  const o = r.groups.tag || "div",
    s = document.createElement(o);
  r.groups.id && (s.id = r.groups.id);
  const a = [];
  if (r.groups.class) for (const c of r.groups.class.split(".")) "" !== c && a.push(c);
  if (void 0 !== n.className) for (const c of n.className.split(".")) "" !== c && a.push(c);
  a.length > 0 && (s.className = a.join(" "));
  const l = {};
  if ((r.groups.name && (l[r.groups.name] = s), i))
    for (const c of i)
      SB(c)
        ? s.appendChild(c)
        : "string" == typeof c
          ? s.append(c)
          : "root" in c && (Object.assign(l, c), s.appendChild(c.root));
  for (const [c, d] of Object.entries(n))
    if ("className" !== c)
      if ("style" === c)
        for (const [e, t] of Object.entries(d))
          s.style.setProperty(ZB(e), "number" == typeof t ? t + "px" : "" + t);
      else "tabIndex" === c ? (s.tabIndex = d) : s.setAttribute(ZB(c), d.toString());
  return ((l.root = s), l);
}
function ZB(e) {
  return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
}
function YB(e) {
  return (
    "input" === e.tagName.toLowerCase() ||
    "textarea" === e.tagName.toLowerCase() ||
    (SB(e) && !!e.editContext)
  );
}
var XB;
!(function (e) {
  function t(e = void 0) {
    return (t, n, i) => {
      const r = n.class;
      delete n.class;
      const o = n.ref;
      delete n.ref;
      const s = n.obsRef;
      return (delete n.obsRef, new sV(t, o, s, e, r, n, i));
    };
  }
  function n(e, n = void 0) {
    const i = t(n);
    return (t, n) => i(e, t, n);
  }
  ((e.div = n("div")),
    (e.elem = t(void 0)),
    (e.svg = n("svg", "http://www.w3.org/2000/svg")),
    (e.svgElem = t("http://www.w3.org/2000/svg")),
    (e.ref = function () {
      let e;
      const t = function (t) {
        e = t;
      };
      return (
        Object.defineProperty(t, "element", {
          get() {
            if (!e)
              throw new QI(
                "Make sure the ref is set before accessing the element. Maybe wrong initialization order?",
              );
            return e;
          },
        }),
        t
      );
    }));
})(XB || (XB = {}));
class QB {
  constructor(e, t, n, i, r, o, s) {
    ((this._deriveds = []),
      (this._element = i ? document.createElementNS(i, e) : document.createElement(e)),
      t && t(this._element),
      n &&
        this._deriveds.push(
          Xj((e) => {
            (n(this),
              e.store.add({
                dispose: () => {
                  n(null);
                },
              }));
          }),
        ),
      r &&
        (nV(r)
          ? this._deriveds.push(
              Xj(this, (e) => {
                JB(this._element, tV(r, e));
              }),
            )
          : JB(this._element, tV(r, void 0))));
    for (const [a, l] of Object.entries(o))
      if ("style" === a)
        for (const [c, d] of Object.entries(l)) {
          const u = ZB(c);
          lV(d)
            ? this._deriveds.push(
                Jj({ owner: this, debugName: () => `set.style.${u}` }, (e) => {
                  this._element.style.setProperty(u, iV(d.read(e)));
                }),
              )
            : this._element.style.setProperty(u, iV(d));
        }
      else
        "tabIndex" === a
          ? lV(l)
            ? this._deriveds.push(
                Xj(this, (e) => {
                  this._element.tabIndex = l.read(e);
                }),
              )
            : (this._element.tabIndex = l)
          : a.startsWith("on")
            ? (this._element[a] = l)
            : lV(l)
              ? this._deriveds.push(
                  Jj({ owner: this, debugName: () => `set.${a}` }, (e) => {
                    aV(this._element, a, l.read(e));
                  }),
                )
              : aV(this._element, a, l);
    if (s) {
      function h(e, t) {
        return lV(t)
          ? h(e, t.read(e))
          : Array.isArray(t)
            ? t.flatMap((t) => h(e, t))
            : t instanceof QB
              ? (e && t.readEffect(e), [t._element])
              : t
                ? [t]
                : [];
      }
      const g = Xj(this, (e) => {
        this._element.replaceChildren(...h(e, s));
      });
      (this._deriveds.push(g), rV(s) || g.get());
    }
  }
  readEffect(e) {
    for (const t of this._deriveds) t.read(e);
  }
  keepUpdated(e) {
    return (
      Xj((e) => {
        this.readEffect(e);
      }).recomputeInitiallyAndOnChange(e),
      this
    );
  }
  toDisposableLiveElement() {
    const e = new AO();
    return (this.keepUpdated(e), new oV(this._element, e));
  }
}
function JB(e, t) {
  EB(e) ? e.setAttribute("class", t) : (e.className = t);
}
function eV(e, t, n) {
  if (lV(e)) n(e.read(t));
  else if (Array.isArray(e)) for (const i of e) eV(i, t, n);
  else n(e);
}
function tV(e, t) {
  let n = "";
  return (
    eV(e, t, (e) => {
      e && (0 === n.length ? (n = e) : (n += " " + e));
    }),
    n
  );
}
function nV(e) {
  return !!lV(e) || (!!Array.isArray(e) && e.some((e) => nV(e)));
}
function iV(e) {
  return "number" == typeof e ? e + "px" : e;
}
function rV(e) {
  return !!lV(e) || (!!Array.isArray(e) && e.some((e) => rV(e)));
}
class oV {
  constructor(e, t) {
    ((this.element = e), (this._disposable = t));
  }
  dispose() {
    this._disposable.dispose();
  }
}
class sV extends QB {
  constructor() {
    (super(...arguments), (this._isHovered = void 0), (this._didMouseMoveDuringHover = void 0));
  }
  get element() {
    return this._element;
  }
  get isHovered() {
    if (!this._isHovered) {
      const e = LF("hovered", !1);
      (this._element.addEventListener("mouseenter", (t) => e.set(!0, void 0)),
        this._element.addEventListener("mouseleave", (t) => e.set(!1, void 0)),
        (this._isHovered = e));
    }
    return this._isHovered;
  }
  get didMouseMoveDuringHover() {
    if (!this._didMouseMoveDuringHover) {
      let e = !1;
      const t = LF("didMouseMoveDuringHover", !1);
      (this._element.addEventListener("mouseenter", (t) => {
        e = !0;
      }),
        this._element.addEventListener("mousemove", (n) => {
          e && t.set(!0, void 0);
        }),
        this._element.addEventListener("mouseleave", (n) => {
          ((e = !1), t.set(!1, void 0));
        }),
        (this._didMouseMoveDuringHover = t));
    }
    return this._didMouseMoveDuringHover;
  }
}
function aV(e, t, n) {
  null == n ? e.removeAttribute(ZB(t)) : e.setAttribute(ZB(t), String(n));
}
function lV(e) {
  return !!e && void 0 !== e.read && void 0 !== e.reportChanges;
}
let cV, dV, uV, hV, gV;
function pV(e) {
  cV && (dV.textContent !== e ? (zF(uV), mV(dV, e)) : (zF(dV), mV(uV, e)));
}
function fV(e) {
  cV && (hV.textContent !== e ? (zF(gV), mV(hV, e)) : (zF(hV), mV(gV, e)));
}
function mV(e, t) {
  (zF(e),
    t.length > 2e4 && (t = t.substr(0, 2e4)),
    (e.textContent = t),
    (e.style.visibility = "hidden"),
    (e.style.visibility = "visible"));
}
var _V;
!(function (e) {
  ((e.serviceIds = new Map()),
    (e.DI_TARGET = "$di$target"),
    (e.DI_DEPENDENCIES = "$di$dependencies"),
    (e.getServiceDependencies = function (t) {
      return t[e.DI_DEPENDENCIES] || [];
    }));
})(_V || (_V = {}));
const vV = bV("instantiationService");
function bV(e) {
  if (_V.serviceIds.has(e)) return _V.serviceIds.get(e);
  const t = function (e, n, i) {
    if (3 !== arguments.length)
      throw new Error("@IServiceName-decorator can only be used to decorate a parameter");
    !(function (e, t, n) {
      t[_V.DI_TARGET] === t
        ? t[_V.DI_DEPENDENCIES].push({ id: e, index: n })
        : ((t[_V.DI_DEPENDENCIES] = [{ id: e, index: n }]), (t[_V.DI_TARGET] = t));
    })(t, e, i);
  };
  return ((t.toString = () => e), _V.serviceIds.set(e, t), t);
}
const yV = bV("codeEditorService");
let xV = class e {
  constructor(e, t) {
    ((this.lineNumber = e), (this.column = t));
  }
  with(t = this.lineNumber, n = this.column) {
    return t === this.lineNumber && n === this.column ? this : new e(t, n);
  }
  delta(e = 0, t = 0) {
    return this.with(Math.max(1, this.lineNumber + e), Math.max(1, this.column + t));
  }
  equals(t) {
    return e.equals(this, t);
  }
  static equals(e, t) {
    return (!e && !t) || (!!e && !!t && e.lineNumber === t.lineNumber && e.column === t.column);
  }
  isBefore(t) {
    return e.isBefore(this, t);
  }
  static isBefore(e, t) {
    return e.lineNumber < t.lineNumber || (!(t.lineNumber < e.lineNumber) && e.column < t.column);
  }
  isBeforeOrEqual(t) {
    return e.isBeforeOrEqual(this, t);
  }
  static isBeforeOrEqual(e, t) {
    return e.lineNumber < t.lineNumber || (!(t.lineNumber < e.lineNumber) && e.column <= t.column);
  }
  static compare(e, t) {
    const n = 0 | e.lineNumber,
      i = 0 | t.lineNumber;
    if (n === i) {
      return (0 | e.column) - (0 | t.column);
    }
    return n - i;
  }
  clone() {
    return new e(this.lineNumber, this.column);
  }
  toString() {
    return "(" + this.lineNumber + "," + this.column + ")";
  }
  static lift(t) {
    return new e(t.lineNumber, t.column);
  }
  static isIPosition(e) {
    return !!e && "number" == typeof e.lineNumber && "number" == typeof e.column;
  }
  toJSON() {
    return { lineNumber: this.lineNumber, column: this.column };
  }
};
const wV = bV("modelService"),
  CV = bV("textModelService");
let SV = class extends PO {
  get onDidChange() {
    return this._onDidChange.event;
  }
  constructor(e, t = "", n = "", i = !0, r) {
    (super(),
      (this._onDidChange = this._register(new QO())),
      (this._enabled = !0),
      (this._id = e),
      (this._label = t),
      (this._cssClass = n),
      (this._enabled = i),
      (this._actionCallback = r));
  }
  get id() {
    return this._id;
  }
  get label() {
    return this._label;
  }
  set label(e) {
    this._setLabel(e);
  }
  _setLabel(e) {
    this._label !== e && ((this._label = e), this._onDidChange.fire({ label: e }));
  }
  get tooltip() {
    return this._tooltip || "";
  }
  set tooltip(e) {
    this._setTooltip(e);
  }
  _setTooltip(e) {
    this._tooltip !== e && ((this._tooltip = e), this._onDidChange.fire({ tooltip: e }));
  }
  get class() {
    return this._cssClass;
  }
  set class(e) {
    this._setClass(e);
  }
  _setClass(e) {
    this._cssClass !== e && ((this._cssClass = e), this._onDidChange.fire({ class: e }));
  }
  get enabled() {
    return this._enabled;
  }
  set enabled(e) {
    this._setEnabled(e);
  }
  _setEnabled(e) {
    this._enabled !== e && ((this._enabled = e), this._onDidChange.fire({ enabled: e }));
  }
  get checked() {
    return this._checked;
  }
  set checked(e) {
    this._setChecked(e);
  }
  _setChecked(e) {
    this._checked !== e && ((this._checked = e), this._onDidChange.fire({ checked: e }));
  }
  async run(e, t) {
    this._actionCallback && (await this._actionCallback(e));
  }
};
class kV extends PO {
  constructor() {
    (super(...arguments),
      (this._onWillRun = this._register(new QO())),
      (this._onDidRun = this._register(new QO())));
  }
  get onWillRun() {
    return this._onWillRun.event;
  }
  get onDidRun() {
    return this._onDidRun.event;
  }
  async run(e, t) {
    if (!e.enabled) return;
    let n;
    this._onWillRun.fire({ action: e });
    try {
      await this.runAction(e, t);
    } catch (spt) {
      n = spt;
    }
    this._onDidRun.fire({ action: e, error: n });
  }
  async runAction(e, t) {
    await e.run(t);
  }
}
let EV = class e {
  constructor() {
    ((this.id = e.ID),
      (this.label = ""),
      (this.tooltip = ""),
      (this.class = "separator"),
      (this.enabled = !1),
      (this.checked = !1));
  }
  static join(...t) {
    let n = [];
    for (const i of t) i.length && (n = n.length ? [...n, new e(), ...i] : i);
    return n;
  }
  static {
    this.ID = "vs.actions.separator";
  }
  async run() {}
};
class NV {
  get actions() {
    return this._actions;
  }
  constructor(e, t, n, i) {
    ((this.tooltip = ""),
      (this.enabled = !0),
      (this.checked = void 0),
      (this.id = e),
      (this.label = t),
      (this.class = i),
      (this._actions = n));
  }
  async run() {}
}
class LV extends SV {
  static {
    this.ID = "vs.actions.empty";
  }
  constructor() {
    super(LV.ID, SI(28, "(empty)"), void 0, !1);
  }
}
function DV(e) {
  return {
    id: e.id,
    label: e.label,
    tooltip: e.tooltip ?? e.label,
    class: e.class,
    enabled: e.enabled ?? !0,
    checked: e.checked,
    run: async (...t) => e.run(...t),
  };
}
const TV = Object.create(null);
function IV(e, t) {
  if (oR(t)) {
    const n = TV[t];
    if (void 0 === n) throw new Error(`${e} references an unknown codicon: ${t}`);
    t = n;
  }
  return ((TV[e] = t), { id: e });
}
function RV() {
  return TV;
}
const OV = {
  ...{
    add: IV("add", 6e4),
    plus: IV("plus", 6e4),
    gistNew: IV("gist-new", 6e4),
    repoCreate: IV("repo-create", 6e4),
    lightbulb: IV("lightbulb", 60001),
    lightBulb: IV("light-bulb", 60001),
    repo: IV("repo", 60002),
    repoDelete: IV("repo-delete", 60002),
    gistFork: IV("gist-fork", 60003),
    repoForked: IV("repo-forked", 60003),
    gitPullRequest: IV("git-pull-request", 60004),
    gitPullRequestAbandoned: IV("git-pull-request-abandoned", 60004),
    recordKeys: IV("record-keys", 60005),
    keyboard: IV("keyboard", 60005),
    tag: IV("tag", 60006),
    gitPullRequestLabel: IV("git-pull-request-label", 60006),
    tagAdd: IV("tag-add", 60006),
    tagRemove: IV("tag-remove", 60006),
    person: IV("person", 60007),
    personFollow: IV("person-follow", 60007),
    personOutline: IV("person-outline", 60007),
    personFilled: IV("person-filled", 60007),
    sourceControl: IV("source-control", 60008),
    mirror: IV("mirror", 60009),
    mirrorPublic: IV("mirror-public", 60009),
    star: IV("star", 60010),
    starAdd: IV("star-add", 60010),
    starDelete: IV("star-delete", 60010),
    starEmpty: IV("star-empty", 60010),
    comment: IV("comment", 60011),
    commentAdd: IV("comment-add", 60011),
    alert: IV("alert", 60012),
    warning: IV("warning", 60012),
    search: IV("search", 60013),
    searchSave: IV("search-save", 60013),
    logOut: IV("log-out", 60014),
    signOut: IV("sign-out", 60014),
    logIn: IV("log-in", 60015),
    signIn: IV("sign-in", 60015),
    eye: IV("eye", 60016),
    eyeUnwatch: IV("eye-unwatch", 60016),
    eyeWatch: IV("eye-watch", 60016),
    circleFilled: IV("circle-filled", 60017),
    primitiveDot: IV("primitive-dot", 60017),
    closeDirty: IV("close-dirty", 60017),
    debugBreakpoint: IV("debug-breakpoint", 60017),
    debugBreakpointDisabled: IV("debug-breakpoint-disabled", 60017),
    debugHint: IV("debug-hint", 60017),
    terminalDecorationSuccess: IV("terminal-decoration-success", 60017),
    primitiveSquare: IV("primitive-square", 60018),
    edit: IV("edit", 60019),
    pencil: IV("pencil", 60019),
    info: IV("info", 60020),
    issueOpened: IV("issue-opened", 60020),
    gistPrivate: IV("gist-private", 60021),
    gitForkPrivate: IV("git-fork-private", 60021),
    lock: IV("lock", 60021),
    mirrorPrivate: IV("mirror-private", 60021),
    close: IV("close", 60022),
    removeClose: IV("remove-close", 60022),
    x: IV("x", 60022),
    repoSync: IV("repo-sync", 60023),
    sync: IV("sync", 60023),
    clone: IV("clone", 60024),
    desktopDownload: IV("desktop-download", 60024),
    beaker: IV("beaker", 60025),
    microscope: IV("microscope", 60025),
    vm: IV("vm", 60026),
    deviceDesktop: IV("device-desktop", 60026),
    file: IV("file", 60027),
    more: IV("more", 60028),
    ellipsis: IV("ellipsis", 60028),
    kebabHorizontal: IV("kebab-horizontal", 60028),
    mailReply: IV("mail-reply", 60029),
    reply: IV("reply", 60029),
    organization: IV("organization", 60030),
    organizationFilled: IV("organization-filled", 60030),
    organizationOutline: IV("organization-outline", 60030),
    newFile: IV("new-file", 60031),
    fileAdd: IV("file-add", 60031),
    newFolder: IV("new-folder", 60032),
    fileDirectoryCreate: IV("file-directory-create", 60032),
    trash: IV("trash", 60033),
    trashcan: IV("trashcan", 60033),
    history: IV("history", 60034),
    clock: IV("clock", 60034),
    folder: IV("folder", 60035),
    fileDirectory: IV("file-directory", 60035),
    symbolFolder: IV("symbol-folder", 60035),
    logoGithub: IV("logo-github", 60036),
    markGithub: IV("mark-github", 60036),
    github: IV("github", 60036),
    terminal: IV("terminal", 60037),
    console: IV("console", 60037),
    repl: IV("repl", 60037),
    zap: IV("zap", 60038),
    symbolEvent: IV("symbol-event", 60038),
    error: IV("error", 60039),
    stop: IV("stop", 60039),
    variable: IV("variable", 60040),
    symbolVariable: IV("symbol-variable", 60040),
    array: IV("array", 60042),
    symbolArray: IV("symbol-array", 60042),
    symbolModule: IV("symbol-module", 60043),
    symbolPackage: IV("symbol-package", 60043),
    symbolNamespace: IV("symbol-namespace", 60043),
    symbolObject: IV("symbol-object", 60043),
    symbolMethod: IV("symbol-method", 60044),
    symbolFunction: IV("symbol-function", 60044),
    symbolConstructor: IV("symbol-constructor", 60044),
    symbolBoolean: IV("symbol-boolean", 60047),
    symbolNull: IV("symbol-null", 60047),
    symbolNumeric: IV("symbol-numeric", 60048),
    symbolNumber: IV("symbol-number", 60048),
    symbolStructure: IV("symbol-structure", 60049),
    symbolStruct: IV("symbol-struct", 60049),
    symbolParameter: IV("symbol-parameter", 60050),
    symbolTypeParameter: IV("symbol-type-parameter", 60050),
    symbolKey: IV("symbol-key", 60051),
    symbolText: IV("symbol-text", 60051),
    symbolReference: IV("symbol-reference", 60052),
    goToFile: IV("go-to-file", 60052),
    symbolEnum: IV("symbol-enum", 60053),
    symbolValue: IV("symbol-value", 60053),
    symbolRuler: IV("symbol-ruler", 60054),
    symbolUnit: IV("symbol-unit", 60054),
    activateBreakpoints: IV("activate-breakpoints", 60055),
    archive: IV("archive", 60056),
    arrowBoth: IV("arrow-both", 60057),
    arrowDown: IV("arrow-down", 60058),
    arrowLeft: IV("arrow-left", 60059),
    arrowRight: IV("arrow-right", 60060),
    arrowSmallDown: IV("arrow-small-down", 60061),
    arrowSmallLeft: IV("arrow-small-left", 60062),
    arrowSmallRight: IV("arrow-small-right", 60063),
    arrowSmallUp: IV("arrow-small-up", 60064),
    arrowUp: IV("arrow-up", 60065),
    bell: IV("bell", 60066),
    bold: IV("bold", 60067),
    book: IV("book", 60068),
    bookmark: IV("bookmark", 60069),
    debugBreakpointConditionalUnverified: IV("debug-breakpoint-conditional-unverified", 60070),
    debugBreakpointConditional: IV("debug-breakpoint-conditional", 60071),
    debugBreakpointConditionalDisabled: IV("debug-breakpoint-conditional-disabled", 60071),
    debugBreakpointDataUnverified: IV("debug-breakpoint-data-unverified", 60072),
    debugBreakpointData: IV("debug-breakpoint-data", 60073),
    debugBreakpointDataDisabled: IV("debug-breakpoint-data-disabled", 60073),
    debugBreakpointLogUnverified: IV("debug-breakpoint-log-unverified", 60074),
    debugBreakpointLog: IV("debug-breakpoint-log", 60075),
    debugBreakpointLogDisabled: IV("debug-breakpoint-log-disabled", 60075),
    briefcase: IV("briefcase", 60076),
    broadcast: IV("broadcast", 60077),
    browser: IV("browser", 60078),
    bug: IV("bug", 60079),
    calendar: IV("calendar", 60080),
    caseSensitive: IV("case-sensitive", 60081),
    check: IV("check", 60082),
    checklist: IV("checklist", 60083),
    chevronDown: IV("chevron-down", 60084),
    chevronLeft: IV("chevron-left", 60085),
    chevronRight: IV("chevron-right", 60086),
    chevronUp: IV("chevron-up", 60087),
    chromeClose: IV("chrome-close", 60088),
    chromeMaximize: IV("chrome-maximize", 60089),
    chromeMinimize: IV("chrome-minimize", 60090),
    chromeRestore: IV("chrome-restore", 60091),
    circleOutline: IV("circle-outline", 60092),
    circle: IV("circle", 60092),
    debugBreakpointUnverified: IV("debug-breakpoint-unverified", 60092),
    terminalDecorationIncomplete: IV("terminal-decoration-incomplete", 60092),
    circleSlash: IV("circle-slash", 60093),
    circuitBoard: IV("circuit-board", 60094),
    clearAll: IV("clear-all", 60095),
    clippy: IV("clippy", 60096),
    closeAll: IV("close-all", 60097),
    cloudDownload: IV("cloud-download", 60098),
    cloudUpload: IV("cloud-upload", 60099),
    code: IV("code", 60100),
    collapseAll: IV("collapse-all", 60101),
    colorMode: IV("color-mode", 60102),
    commentDiscussion: IV("comment-discussion", 60103),
    creditCard: IV("credit-card", 60105),
    dash: IV("dash", 60108),
    dashboard: IV("dashboard", 60109),
    database: IV("database", 60110),
    debugContinue: IV("debug-continue", 60111),
    debugDisconnect: IV("debug-disconnect", 60112),
    debugPause: IV("debug-pause", 60113),
    debugRestart: IV("debug-restart", 60114),
    debugStart: IV("debug-start", 60115),
    debugStepInto: IV("debug-step-into", 60116),
    debugStepOut: IV("debug-step-out", 60117),
    debugStepOver: IV("debug-step-over", 60118),
    debugStop: IV("debug-stop", 60119),
    debug: IV("debug", 60120),
    deviceCameraVideo: IV("device-camera-video", 60121),
    deviceCamera: IV("device-camera", 60122),
    deviceMobile: IV("device-mobile", 60123),
    diffAdded: IV("diff-added", 60124),
    diffIgnored: IV("diff-ignored", 60125),
    diffModified: IV("diff-modified", 60126),
    diffRemoved: IV("diff-removed", 60127),
    diffRenamed: IV("diff-renamed", 60128),
    diff: IV("diff", 60129),
    diffSidebyside: IV("diff-sidebyside", 60129),
    discard: IV("discard", 60130),
    editorLayout: IV("editor-layout", 60131),
    emptyWindow: IV("empty-window", 60132),
    exclude: IV("exclude", 60133),
    extensions: IV("extensions", 60134),
    eyeClosed: IV("eye-closed", 60135),
    fileBinary: IV("file-binary", 60136),
    fileCode: IV("file-code", 60137),
    fileMedia: IV("file-media", 60138),
    filePdf: IV("file-pdf", 60139),
    fileSubmodule: IV("file-submodule", 60140),
    fileSymlinkDirectory: IV("file-symlink-directory", 60141),
    fileSymlinkFile: IV("file-symlink-file", 60142),
    fileZip: IV("file-zip", 60143),
    files: IV("files", 60144),
    filter: IV("filter", 60145),
    flame: IV("flame", 60146),
    foldDown: IV("fold-down", 60147),
    foldUp: IV("fold-up", 60148),
    fold: IV("fold", 60149),
    folderActive: IV("folder-active", 60150),
    folderOpened: IV("folder-opened", 60151),
    gear: IV("gear", 60152),
    gift: IV("gift", 60153),
    gistSecret: IV("gist-secret", 60154),
    gist: IV("gist", 60155),
    gitCommit: IV("git-commit", 60156),
    gitCompare: IV("git-compare", 60157),
    compareChanges: IV("compare-changes", 60157),
    gitMerge: IV("git-merge", 60158),
    githubAction: IV("github-action", 60159),
    githubAlt: IV("github-alt", 60160),
    globe: IV("globe", 60161),
    grabber: IV("grabber", 60162),
    graph: IV("graph", 60163),
    gripper: IV("gripper", 60164),
    heart: IV("heart", 60165),
    home: IV("home", 60166),
    horizontalRule: IV("horizontal-rule", 60167),
    hubot: IV("hubot", 60168),
    inbox: IV("inbox", 60169),
    issueReopened: IV("issue-reopened", 60171),
    issues: IV("issues", 60172),
    italic: IV("italic", 60173),
    jersey: IV("jersey", 60174),
    json: IV("json", 60175),
    kebabVertical: IV("kebab-vertical", 60176),
    key: IV("key", 60177),
    law: IV("law", 60178),
    lightbulbAutofix: IV("lightbulb-autofix", 60179),
    linkExternal: IV("link-external", 60180),
    link: IV("link", 60181),
    listOrdered: IV("list-ordered", 60182),
    listUnordered: IV("list-unordered", 60183),
    liveShare: IV("live-share", 60184),
    loading: IV("loading", 60185),
    location: IV("location", 60186),
    mailRead: IV("mail-read", 60187),
    mail: IV("mail", 60188),
    markdown: IV("markdown", 60189),
    megaphone: IV("megaphone", 60190),
    mention: IV("mention", 60191),
    milestone: IV("milestone", 60192),
    gitPullRequestMilestone: IV("git-pull-request-milestone", 60192),
    mortarBoard: IV("mortar-board", 60193),
    move: IV("move", 60194),
    multipleWindows: IV("multiple-windows", 60195),
    mute: IV("mute", 60196),
    noNewline: IV("no-newline", 60197),
    note: IV("note", 60198),
    octoface: IV("octoface", 60199),
    openPreview: IV("open-preview", 60200),
    package: IV("package", 60201),
    paintcan: IV("paintcan", 60202),
    pin: IV("pin", 60203),
    play: IV("play", 60204),
    run: IV("run", 60204),
    plug: IV("plug", 60205),
    preserveCase: IV("preserve-case", 60206),
    preview: IV("preview", 60207),
    project: IV("project", 60208),
    pulse: IV("pulse", 60209),
    question: IV("question", 60210),
    quote: IV("quote", 60211),
    radioTower: IV("radio-tower", 60212),
    reactions: IV("reactions", 60213),
    references: IV("references", 60214),
    refresh: IV("refresh", 60215),
    regex: IV("regex", 60216),
    remoteExplorer: IV("remote-explorer", 60217),
    remote: IV("remote", 60218),
    remove: IV("remove", 60219),
    replaceAll: IV("replace-all", 60220),
    replace: IV("replace", 60221),
    repoClone: IV("repo-clone", 60222),
    repoForcePush: IV("repo-force-push", 60223),
    repoPull: IV("repo-pull", 60224),
    repoPush: IV("repo-push", 60225),
    report: IV("report", 60226),
    requestChanges: IV("request-changes", 60227),
    rocket: IV("rocket", 60228),
    rootFolderOpened: IV("root-folder-opened", 60229),
    rootFolder: IV("root-folder", 60230),
    rss: IV("rss", 60231),
    ruby: IV("ruby", 60232),
    saveAll: IV("save-all", 60233),
    saveAs: IV("save-as", 60234),
    save: IV("save", 60235),
    screenFull: IV("screen-full", 60236),
    screenNormal: IV("screen-normal", 60237),
    searchStop: IV("search-stop", 60238),
    server: IV("server", 60240),
    settingsGear: IV("settings-gear", 60241),
    settings: IV("settings", 60242),
    shield: IV("shield", 60243),
    smiley: IV("smiley", 60244),
    sortPrecedence: IV("sort-precedence", 60245),
    splitHorizontal: IV("split-horizontal", 60246),
    splitVertical: IV("split-vertical", 60247),
    squirrel: IV("squirrel", 60248),
    starFull: IV("star-full", 60249),
    starHalf: IV("star-half", 60250),
    symbolClass: IV("symbol-class", 60251),
    symbolColor: IV("symbol-color", 60252),
    symbolConstant: IV("symbol-constant", 60253),
    symbolEnumMember: IV("symbol-enum-member", 60254),
    symbolField: IV("symbol-field", 60255),
    symbolFile: IV("symbol-file", 60256),
    symbolInterface: IV("symbol-interface", 60257),
    symbolKeyword: IV("symbol-keyword", 60258),
    symbolMisc: IV("symbol-misc", 60259),
    symbolOperator: IV("symbol-operator", 60260),
    symbolProperty: IV("symbol-property", 60261),
    wrench: IV("wrench", 60261),
    wrenchSubaction: IV("wrench-subaction", 60261),
    symbolSnippet: IV("symbol-snippet", 60262),
    tasklist: IV("tasklist", 60263),
    telescope: IV("telescope", 60264),
    textSize: IV("text-size", 60265),
    threeBars: IV("three-bars", 60266),
    thumbsdown: IV("thumbsdown", 60267),
    thumbsup: IV("thumbsup", 60268),
    tools: IV("tools", 60269),
    triangleDown: IV("triangle-down", 60270),
    triangleLeft: IV("triangle-left", 60271),
    triangleRight: IV("triangle-right", 60272),
    triangleUp: IV("triangle-up", 60273),
    twitter: IV("twitter", 60274),
    unfold: IV("unfold", 60275),
    unlock: IV("unlock", 60276),
    unmute: IV("unmute", 60277),
    unverified: IV("unverified", 60278),
    verified: IV("verified", 60279),
    versions: IV("versions", 60280),
    vmActive: IV("vm-active", 60281),
    vmOutline: IV("vm-outline", 60282),
    vmRunning: IV("vm-running", 60283),
    watch: IV("watch", 60284),
    whitespace: IV("whitespace", 60285),
    wholeWord: IV("whole-word", 60286),
    window: IV("window", 60287),
    wordWrap: IV("word-wrap", 60288),
    zoomIn: IV("zoom-in", 60289),
    zoomOut: IV("zoom-out", 60290),
    listFilter: IV("list-filter", 60291),
    listFlat: IV("list-flat", 60292),
    listSelection: IV("list-selection", 60293),
    selection: IV("selection", 60293),
    listTree: IV("list-tree", 60294),
    debugBreakpointFunctionUnverified: IV("debug-breakpoint-function-unverified", 60295),
    debugBreakpointFunction: IV("debug-breakpoint-function", 60296),
    debugBreakpointFunctionDisabled: IV("debug-breakpoint-function-disabled", 60296),
    debugStackframeActive: IV("debug-stackframe-active", 60297),
    circleSmallFilled: IV("circle-small-filled", 60298),
    debugStackframeDot: IV("debug-stackframe-dot", 60298),
    terminalDecorationMark: IV("terminal-decoration-mark", 60298),
    debugStackframe: IV("debug-stackframe", 60299),
    debugStackframeFocused: IV("debug-stackframe-focused", 60299),
    debugBreakpointUnsupported: IV("debug-breakpoint-unsupported", 60300),
    symbolString: IV("symbol-string", 60301),
    debugReverseContinue: IV("debug-reverse-continue", 60302),
    debugStepBack: IV("debug-step-back", 60303),
    debugRestartFrame: IV("debug-restart-frame", 60304),
    debugAlt: IV("debug-alt", 60305),
    callIncoming: IV("call-incoming", 60306),
    callOutgoing: IV("call-outgoing", 60307),
    menu: IV("menu", 60308),
    expandAll: IV("expand-all", 60309),
    feedback: IV("feedback", 60310),
    gitPullRequestReviewer: IV("git-pull-request-reviewer", 60310),
    groupByRefType: IV("group-by-ref-type", 60311),
    ungroupByRefType: IV("ungroup-by-ref-type", 60312),
    account: IV("account", 60313),
    gitPullRequestAssignee: IV("git-pull-request-assignee", 60313),
    bellDot: IV("bell-dot", 60314),
    debugConsole: IV("debug-console", 60315),
    library: IV("library", 60316),
    output: IV("output", 60317),
    runAll: IV("run-all", 60318),
    syncIgnored: IV("sync-ignored", 60319),
    pinned: IV("pinned", 60320),
    githubInverted: IV("github-inverted", 60321),
    serverProcess: IV("server-process", 60322),
    serverEnvironment: IV("server-environment", 60323),
    pass: IV("pass", 60324),
    issueClosed: IV("issue-closed", 60324),
    stopCircle: IV("stop-circle", 60325),
    playCircle: IV("play-circle", 60326),
    record: IV("record", 60327),
    debugAltSmall: IV("debug-alt-small", 60328),
    vmConnect: IV("vm-connect", 60329),
    cloud: IV("cloud", 60330),
    merge: IV("merge", 60331),
    export: IV("export", 60332),
    graphLeft: IV("graph-left", 60333),
    magnet: IV("magnet", 60334),
    notebook: IV("notebook", 60335),
    redo: IV("redo", 60336),
    checkAll: IV("check-all", 60337),
    pinnedDirty: IV("pinned-dirty", 60338),
    passFilled: IV("pass-filled", 60339),
    circleLargeFilled: IV("circle-large-filled", 60340),
    circleLarge: IV("circle-large", 60341),
    circleLargeOutline: IV("circle-large-outline", 60341),
    combine: IV("combine", 60342),
    gather: IV("gather", 60342),
    table: IV("table", 60343),
    variableGroup: IV("variable-group", 60344),
    typeHierarchy: IV("type-hierarchy", 60345),
    typeHierarchySub: IV("type-hierarchy-sub", 60346),
    typeHierarchySuper: IV("type-hierarchy-super", 60347),
    gitPullRequestCreate: IV("git-pull-request-create", 60348),
    runAbove: IV("run-above", 60349),
    runBelow: IV("run-below", 60350),
    notebookTemplate: IV("notebook-template", 60351),
    debugRerun: IV("debug-rerun", 60352),
    workspaceTrusted: IV("workspace-trusted", 60353),
    workspaceUntrusted: IV("workspace-untrusted", 60354),
    workspaceUnknown: IV("workspace-unknown", 60355),
    terminalCmd: IV("terminal-cmd", 60356),
    terminalDebian: IV("terminal-debian", 60357),
    terminalLinux: IV("terminal-linux", 60358),
    terminalPowershell: IV("terminal-powershell", 60359),
    terminalTmux: IV("terminal-tmux", 60360),
    terminalUbuntu: IV("terminal-ubuntu", 60361),
    terminalBash: IV("terminal-bash", 60362),
    arrowSwap: IV("arrow-swap", 60363),
    copy: IV("copy", 60364),
    personAdd: IV("person-add", 60365),
    filterFilled: IV("filter-filled", 60366),
    wand: IV("wand", 60367),
    debugLineByLine: IV("debug-line-by-line", 60368),
    inspect: IV("inspect", 60369),
    layers: IV("layers", 60370),
    layersDot: IV("layers-dot", 60371),
    layersActive: IV("layers-active", 60372),
    compass: IV("compass", 60373),
    compassDot: IV("compass-dot", 60374),
    compassActive: IV("compass-active", 60375),
    azure: IV("azure", 60376),
    issueDraft: IV("issue-draft", 60377),
    gitPullRequestClosed: IV("git-pull-request-closed", 60378),
    gitPullRequestDraft: IV("git-pull-request-draft", 60379),
    debugAll: IV("debug-all", 60380),
    debugCoverage: IV("debug-coverage", 60381),
    runErrors: IV("run-errors", 60382),
    folderLibrary: IV("folder-library", 60383),
    debugContinueSmall: IV("debug-continue-small", 60384),
    beakerStop: IV("beaker-stop", 60385),
    graphLine: IV("graph-line", 60386),
    graphScatter: IV("graph-scatter", 60387),
    pieChart: IV("pie-chart", 60388),
    bracket: IV("bracket", 60175),
    bracketDot: IV("bracket-dot", 60389),
    bracketError: IV("bracket-error", 60390),
    lockSmall: IV("lock-small", 60391),
    azureDevops: IV("azure-devops", 60392),
    verifiedFilled: IV("verified-filled", 60393),
    newline: IV("newline", 60394),
    layout: IV("layout", 60395),
    layoutActivitybarLeft: IV("layout-activitybar-left", 60396),
    layoutActivitybarRight: IV("layout-activitybar-right", 60397),
    layoutPanelLeft: IV("layout-panel-left", 60398),
    layoutPanelCenter: IV("layout-panel-center", 60399),
    layoutPanelJustify: IV("layout-panel-justify", 60400),
    layoutPanelRight: IV("layout-panel-right", 60401),
    layoutPanel: IV("layout-panel", 60402),
    layoutSidebarLeft: IV("layout-sidebar-left", 60403),
    layoutSidebarRight: IV("layout-sidebar-right", 60404),
    layoutStatusbar: IV("layout-statusbar", 60405),
    layoutMenubar: IV("layout-menubar", 60406),
    layoutCentered: IV("layout-centered", 60407),
    target: IV("target", 60408),
    indent: IV("indent", 60409),
    recordSmall: IV("record-small", 60410),
    errorSmall: IV("error-small", 60411),
    terminalDecorationError: IV("terminal-decoration-error", 60411),
    arrowCircleDown: IV("arrow-circle-down", 60412),
    arrowCircleLeft: IV("arrow-circle-left", 60413),
    arrowCircleRight: IV("arrow-circle-right", 60414),
    arrowCircleUp: IV("arrow-circle-up", 60415),
    layoutSidebarRightOff: IV("layout-sidebar-right-off", 60416),
    layoutPanelOff: IV("layout-panel-off", 60417),
    layoutSidebarLeftOff: IV("layout-sidebar-left-off", 60418),
    blank: IV("blank", 60419),
    heartFilled: IV("heart-filled", 60420),
    map: IV("map", 60421),
    mapHorizontal: IV("map-horizontal", 60421),
    foldHorizontal: IV("fold-horizontal", 60421),
    mapFilled: IV("map-filled", 60422),
    mapHorizontalFilled: IV("map-horizontal-filled", 60422),
    foldHorizontalFilled: IV("fold-horizontal-filled", 60422),
    circleSmall: IV("circle-small", 60423),
    bellSlash: IV("bell-slash", 60424),
    bellSlashDot: IV("bell-slash-dot", 60425),
    commentUnresolved: IV("comment-unresolved", 60426),
    gitPullRequestGoToChanges: IV("git-pull-request-go-to-changes", 60427),
    gitPullRequestNewChanges: IV("git-pull-request-new-changes", 60428),
    searchFuzzy: IV("search-fuzzy", 60429),
    commentDraft: IV("comment-draft", 60430),
    send: IV("send", 60431),
    sparkle: IV("sparkle", 60432),
    insert: IV("insert", 60433),
    mic: IV("mic", 60434),
    thumbsdownFilled: IV("thumbsdown-filled", 60435),
    thumbsupFilled: IV("thumbsup-filled", 60436),
    coffee: IV("coffee", 60437),
    snake: IV("snake", 60438),
    game: IV("game", 60439),
    vr: IV("vr", 60440),
    chip: IV("chip", 60441),
    piano: IV("piano", 60442),
    music: IV("music", 60443),
    micFilled: IV("mic-filled", 60444),
    repoFetch: IV("repo-fetch", 60445),
    copilot: IV("copilot", 60446),
    lightbulbSparkle: IV("lightbulb-sparkle", 60447),
    robot: IV("robot", 60448),
    sparkleFilled: IV("sparkle-filled", 60449),
    diffSingle: IV("diff-single", 60450),
    diffMultiple: IV("diff-multiple", 60451),
    surroundWith: IV("surround-with", 60452),
    share: IV("share", 60453),
    gitStash: IV("git-stash", 60454),
    gitStashApply: IV("git-stash-apply", 60455),
    gitStashPop: IV("git-stash-pop", 60456),
    vscode: IV("vscode", 60457),
    vscodeInsiders: IV("vscode-insiders", 60458),
    codeOss: IV("code-oss", 60459),
    runCoverage: IV("run-coverage", 60460),
    runAllCoverage: IV("run-all-coverage", 60461),
    coverage: IV("coverage", 60462),
    githubProject: IV("github-project", 60463),
    mapVertical: IV("map-vertical", 60464),
    foldVertical: IV("fold-vertical", 60464),
    mapVerticalFilled: IV("map-vertical-filled", 60465),
    foldVerticalFilled: IV("fold-vertical-filled", 60465),
    goToSearch: IV("go-to-search", 60466),
    percentage: IV("percentage", 60467),
    sortPercentage: IV("sort-percentage", 60467),
    attach: IV("attach", 60468),
    goToEditingSession: IV("go-to-editing-session", 60469),
    editSession: IV("edit-session", 60470),
    codeReview: IV("code-review", 60471),
    copilotWarning: IV("copilot-warning", 60472),
    python: IV("python", 60473),
    copilotLarge: IV("copilot-large", 60474),
    copilotWarningLarge: IV("copilot-warning-large", 60475),
    keyboardTab: IV("keyboard-tab", 60476),
    copilotBlocked: IV("copilot-blocked", 60477),
    copilotNotConnected: IV("copilot-not-connected", 60478),
    flag: IV("flag", 60479),
    lightbulbEmpty: IV("lightbulb-empty", 60480),
    symbolMethodArrow: IV("symbol-method-arrow", 60481),
    copilotUnavailable: IV("copilot-unavailable", 60482),
    repoPinned: IV("repo-pinned", 60483),
    keyboardTabAbove: IV("keyboard-tab-above", 60484),
    keyboardTabBelow: IV("keyboard-tab-below", 60485),
    gitPullRequestDone: IV("git-pull-request-done", 60486),
    mcp: IV("mcp", 60487),
    extensionsLarge: IV("extensions-large", 60488),
    layoutPanelDock: IV("layout-panel-dock", 60489),
    layoutSidebarLeftDock: IV("layout-sidebar-left-dock", 60490),
    layoutSidebarRightDock: IV("layout-sidebar-right-dock", 60491),
    copilotInProgress: IV("copilot-in-progress", 60492),
    copilotError: IV("copilot-error", 60493),
    copilotSuccess: IV("copilot-success", 60494),
    chatSparkle: IV("chat-sparkle", 60495),
    searchSparkle: IV("search-sparkle", 60496),
    editSparkle: IV("edit-sparkle", 60497),
    copilotSnooze: IV("copilot-snooze", 60498),
    sendToRemoteAgent: IV("send-to-remote-agent", 60499),
    commentDiscussionSparkle: IV("comment-discussion-sparkle", 60500),
    chatSparkleWarning: IV("chat-sparkle-warning", 60501),
    chatSparkleError: IV("chat-sparkle-error", 60502),
    collection: IV("collection", 60503),
    newCollection: IV("new-collection", 60504),
    thinking: IV("thinking", 60505),
    build: IV("build", 60506),
    commentDiscussionQuote: IV("comment-discussion-quote", 60507),
    cursor: IV("cursor", 60508),
    eraser: IV("eraser", 60509),
    fileText: IV("file-text", 60510),
    gitLens: IV("git-lens", 60511),
    quotes: IV("quotes", 60512),
    rename: IV("rename", 60513),
    runWithDeps: IV("run-with-deps", 60514),
    debugConnected: IV("debug-connected", 60515),
    strikethrough: IV("strikethrough", 60516),
    openInProduct: IV("open-in-product", 60517),
    indexZero: IV("index-zero", 60518),
    agent: IV("agent", 60519),
    editCode: IV("edit-code", 60520),
    repoSelected: IV("repo-selected", 60521),
    skip: IV("skip", 60522),
    mergeInto: IV("merge-into", 60523),
    gitBranchChanges: IV("git-branch-changes", 60524),
    gitBranchStagedChanges: IV("git-branch-staged-changes", 60525),
    gitBranchConflicts: IV("git-branch-conflicts", 60526),
    gitBranch: IV("git-branch", 60527),
    gitBranchCreate: IV("git-branch-create", 60527),
    gitBranchDelete: IV("git-branch-delete", 60527),
    searchLarge: IV("search-large", 60528),
    terminalGitBash: IV("terminal-git-bash", 60529),
  },
  ...{
    dialogError: IV("dialog-error", "error"),
    dialogWarning: IV("dialog-warning", "warning"),
    dialogInfo: IV("dialog-info", "info"),
    dialogClose: IV("dialog-close", "close"),
    treeItemExpanded: IV("tree-item-expanded", "chevron-down"),
    treeFilterOnTypeOn: IV("tree-filter-on-type-on", "list-filter"),
    treeFilterOnTypeOff: IV("tree-filter-on-type-off", "list-selection"),
    treeFilterClear: IV("tree-filter-clear", "close"),
    treeItemLoading: IV("tree-item-loading", "loading"),
    menuSelection: IV("menu-selection", "check"),
    menuSubmenu: IV("menu-submenu", "chevron-right"),
    menuBarMore: IV("menubar-more", "more"),
    scrollbarButtonLeft: IV("scrollbar-button-left", "triangle-left"),
    scrollbarButtonRight: IV("scrollbar-button-right", "triangle-right"),
    scrollbarButtonUp: IV("scrollbar-button-up", "triangle-up"),
    scrollbarButtonDown: IV("scrollbar-button-down", "triangle-down"),
    toolBarMore: IV("toolbar-more", "more"),
    quickInputBack: IV("quick-input-back", "arrow-left"),
    dropDownButton: IV("drop-down-button", 60084),
    symbolCustomColor: IV("symbol-customcolor", 60252),
    exportIcon: IV("export", 60332),
    workspaceUnspecified: IV("workspace-unspecified", 60355),
    newLine: IV("newline", 60394),
    thumbsDownFilled: IV("thumbsdown-filled", 60435),
    thumbsUpFilled: IV("thumbsup-filled", 60436),
    gitFetch: IV("git-fetch", 60445),
    lightbulbSparkleAutofix: IV("lightbulb-sparkle-autofix", 60447),
    debugBreakpointPending: IV("debug-breakpoint-pending", 60377),
  },
};
var MV, AV;
(!(function (e) {
  e.isThemeColor = function (e) {
    return !!e && "object" == typeof e && "string" == typeof e.id;
  };
})(MV || (MV = {})),
  (function (e) {
    ((e.iconNameSegment = "[A-Za-z0-9]+"),
      (e.iconNameExpression = "[A-Za-z0-9-]+"),
      (e.iconModifierExpression = "~[A-Za-z]+"),
      (e.iconNameCharacter = "[A-Za-z0-9~-]"));
    const t = new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);
    function n(e) {
      const i = t.exec(e.id);
      if (!i) return n(OV.error);
      const [, r, o] = i,
        s = ["codicon", "codicon-" + r];
      return (o && s.push("codicon-modifier-" + o.substring(1)), s);
    }
    ((e.asClassNameArray = n),
      (e.asClassName = function (e) {
        return n(e).join(" ");
      }),
      (e.asCSSSelector = function (e) {
        return "." + n(e).join(".");
      }),
      (e.isThemeIcon = function (e) {
        return (
          !!e &&
          "object" == typeof e &&
          "string" == typeof e.id &&
          (void 0 === e.color || MV.isThemeColor(e.color))
        );
      }));
    const i = new RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);
    ((e.fromString = function (e) {
      const t = i.exec(e);
      if (!t) return;
      const [, n] = t;
      return { id: n };
    }),
      (e.fromId = function (e) {
        return { id: e };
      }),
      (e.modify = function (e, t) {
        let n = e.id;
        const i = n.lastIndexOf("~");
        return (-1 !== i && (n = n.substring(0, i)), t && (n = `${n}~${t}`), { id: n });
      }),
      (e.getModifier = function (e) {
        const t = e.id.lastIndexOf("~");
        if (-1 !== t) return e.id.substring(t + 1);
      }),
      (e.isEqual = function (e, t) {
        return e.id === t.id && e.color?.id === t.color?.id;
      }),
      (e.isFile = function (e) {
        return e?.id === OV.file.id;
      }),
      (e.isFolder = function (e) {
        return e?.id === OV.folder.id;
      }));
  })(AV || (AV = {})));
const PV = bV("commandService"),
  jV = new (class {
    constructor() {
      ((this._commands = new Map()),
        (this._onDidRegisterCommand = new QO()),
        (this.onDidRegisterCommand = this._onDidRegisterCommand.event));
    }
    registerCommand(e, t) {
      if (!e) throw new Error("invalid command");
      if ("string" == typeof e) {
        if (!t) throw new Error("invalid command");
        return this.registerCommand({ id: e, handler: t });
      }
      if (e.metadata && Array.isArray(e.metadata.args)) {
        const t = [];
        for (const i of e.metadata.args) t.push(i.constraint);
        const n = e.handler;
        e.handler = function (e, ...i) {
          return (
            (function (e, t) {
              const n = Math.min(e.length, t.length);
              for (let i = 0; i < n; i++) _R(e[i], t[i]);
            })(i, t),
            n(e, ...i)
          );
        };
      }
      const { id: n } = e;
      let i = this._commands.get(n);
      i || ((i = new HO()), this._commands.set(n, i));
      const r = i.unshift(e),
        o = MO(() => {
          r();
          const e = this._commands.get(n);
          e?.isEmpty() && this._commands.delete(n);
        });
      return (this._onDidRegisterCommand.fire(n), o);
    }
    registerCommandAlias(e, t) {
      return jV.registerCommand(e, (e, ...n) => e.get(PV).executeCommand(t, ...n));
    }
    getCommand(e) {
      const t = this._commands.get(e);
      if (t && !t.isEmpty()) return DO.first(t);
    }
    getCommands() {
      const e = new Map();
      for (const t of this._commands.keys()) {
        const n = this.getCommand(t);
        n && e.set(t, n);
      }
      return e;
    }
  })();
function FV(...e) {
  switch (e.length) {
    case 1:
      return SI(1693, "Did you mean {0}?", e[0]);
    case 2:
      return SI(1694, "Did you mean {0} or {1}?", e[0], e[1]);
    case 3:
      return SI(1695, "Did you mean {0}, {1} or {2}?", e[0], e[1], e[2]);
    default:
      return;
  }
}
jV.registerCommand("noop", () => {});
const BV = SI(1696, "Did you forget to open or close the quote?"),
  VV = SI(
    1697,
    "Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.",
  );
let WV = class e {
  constructor() {
    ((this._input = ""),
      (this._start = 0),
      (this._current = 0),
      (this._tokens = []),
      (this._errors = []),
      (this.stringRe = /[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy));
  }
  static getLexeme(e) {
    switch (e.type) {
      case 0:
        return "(";
      case 1:
        return ")";
      case 2:
        return "!";
      case 3:
        return e.isTripleEq ? "===" : "==";
      case 4:
        return e.isTripleEq ? "!==" : "!=";
      case 5:
        return "<";
      case 6:
        return "<=";
      case 7:
      case 8:
        return ">=";
      case 9:
        return "=~";
      case 10:
      case 17:
      case 18:
      case 19:
        return e.lexeme;
      case 11:
        return "true";
      case 12:
        return "false";
      case 13:
        return "in";
      case 14:
        return "not";
      case 15:
        return "&&";
      case 16:
        return "||";
      case 20:
        return "EOF";
      default:
        throw ZI(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`);
    }
  }
  static {
    this._regexFlags = new Set(["i", "g", "s", "m", "y", "u"].map((e) => e.charCodeAt(0)));
  }
  static {
    this._keywords = new Map([
      ["not", 14],
      ["in", 13],
      ["false", 12],
      ["true", 11],
    ]);
  }
  reset(e) {
    return (
      (this._input = e),
      (this._start = 0),
      (this._current = 0),
      (this._tokens = []),
      (this._errors = []),
      this
    );
  }
  scan() {
    for (; !this._isAtEnd(); ) {
      this._start = this._current;
      switch (this._advance()) {
        case 40:
          this._addToken(0);
          break;
        case 41:
          this._addToken(1);
          break;
        case 33:
          if (this._match(61)) {
            const e = this._match(61);
            this._tokens.push({ type: 4, offset: this._start, isTripleEq: e });
          } else this._addToken(2);
          break;
        case 39:
          this._quotedString();
          break;
        case 47:
          this._regex();
          break;
        case 61:
          if (this._match(61)) {
            const e = this._match(61);
            this._tokens.push({ type: 3, offset: this._start, isTripleEq: e });
          } else this._match(126) ? this._addToken(9) : this._error(FV("==", "=~"));
          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(FV("&&"));
          break;
        case 124:
          this._match(124) ? this._addToken(16) : this._error(FV("||"));
          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(e) {
    return !this._isAtEnd() && this._input.charCodeAt(this._current) === e && (this._current++, !0);
  }
  _advance() {
    return this._input.charCodeAt(this._current++);
  }
  _peek() {
    return this._isAtEnd() ? 0 : this._input.charCodeAt(this._current);
  }
  _addToken(e) {
    this._tokens.push({ type: e, offset: this._start });
  }
  _error(e) {
    const t = this._start,
      n = this._input.substring(this._start, this._current),
      i = { type: 19, offset: this._start, lexeme: n };
    (this._errors.push({ offset: t, lexeme: n, additionalInfo: e }), this._tokens.push(i));
  }
  _string() {
    this.stringRe.lastIndex = this._start;
    const t = this.stringRe.exec(this._input);
    if (t) {
      this._current = this._start + t[0].length;
      const n = this._input.substring(this._start, this._current),
        i = e._keywords.get(n);
      i ? this._addToken(i) : this._tokens.push({ type: 17, lexeme: n, offset: this._start });
    }
  }
  _quotedString() {
    for (; 39 !== this._peek() && !this._isAtEnd(); ) this._advance();
    this._isAtEnd()
      ? this._error(BV)
      : (this._advance(),
        this._tokens.push({
          type: 18,
          lexeme: this._input.substring(this._start + 1, this._current - 1),
          offset: this._start + 1,
        }));
  }
  _regex() {
    let t = this._current,
      n = !1,
      i = !1;
    for (;;) {
      if (t >= this._input.length) return ((this._current = t), void this._error(VV));
      const e = this._input.charCodeAt(t);
      if (n) n = !1;
      else {
        if (47 === e && !i) {
          t++;
          break;
        }
        91 === e ? (i = !0) : 92 === e ? (n = !0) : 93 === e && (i = !1);
      }
      t++;
    }
    for (; t < this._input.length && e._regexFlags.has(this._input.charCodeAt(t)); ) t++;
    this._current = t;
    const r = this._input.substring(this._start, this._current);
    this._tokens.push({ type: 10, lexeme: r, offset: this._start });
  }
  _isAtEnd() {
    return this._current >= this._input.length;
  }
};
const HV = new Map();
(HV.set("false", !1),
  HV.set("true", !0),
  HV.set("isMac", PR),
  HV.set("isLinux", jR),
  HV.set("isWindows", AR),
  HV.set("isWeb", BR),
  HV.set("isMacNative", PR && !BR),
  HV.set("isEdge", tO),
  HV.set("isFirefox", JR),
  HV.set("isChrome", QR),
  HV.set("isSafari", eO));
const zV = Object.prototype.hasOwnProperty,
  UV = { regexParsingWithErrorRecovery: !0 },
  $V = SI(1675, "Empty context key expression"),
  qV = SI(
    1676,
    "Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively.",
  ),
  KV = SI(1677, "'in' after 'not'."),
  GV = SI(1678, "closing parenthesis ')'"),
  ZV = SI(1679, "Unexpected token"),
  YV = SI(1680, "Did you forget to put && or || before the token?"),
  XV = SI(1681, "Unexpected end of expression"),
  QV = SI(1682, "Did you forget to put a context key?");
let JV = class e {
  static {
    this._parseError = new Error();
  }
  constructor(e = UV) {
    ((this._config = e),
      (this._scanner = new WV()),
      (this._tokens = []),
      (this._current = 0),
      (this._parsingErrors = []),
      (this._flagsGYRe = /g|y/g));
  }
  parse(t) {
    if ("" !== t) {
      ((this._tokens = this._scanner.reset(t).scan()),
        (this._current = 0),
        (this._parsingErrors = []));
      try {
        const t = this._expr();
        if (!this._isAtEnd()) {
          const t = this._peek(),
            n = 17 === t.type ? YV : void 0;
          throw (
            this._parsingErrors.push({
              message: ZV,
              offset: t.offset,
              lexeme: WV.getLexeme(t),
              additionalInfo: n,
            }),
            e._parseError
          );
        }
        return t;
      } catch (spt) {
        if (spt !== e._parseError) throw spt;
        return;
      }
    } else this._parsingErrors.push({ message: $V, offset: 0, lexeme: "", additionalInfo: qV });
  }
  _expr() {
    return this._or();
  }
  _or() {
    const e = [this._and()];
    for (; this._matchOne(16); ) {
      const t = this._and();
      e.push(t);
    }
    return 1 === e.length ? e[0] : eW.or(...e);
  }
  _and() {
    const e = [this._term()];
    for (; this._matchOne(15); ) {
      const t = this._term();
      e.push(t);
    }
    return 1 === e.length ? e[0] : eW.and(...e);
  }
  _term() {
    if (this._matchOne(2)) {
      const e = this._peek();
      switch (e.type) {
        case 11:
          return (this._advance(), nW.INSTANCE);
        case 12:
          return (this._advance(), iW.INSTANCE);
        case 0: {
          this._advance();
          const e = this._expr();
          return (this._consume(1, GV), e?.negate());
        }
        case 17:
          return (this._advance(), cW.create(e.lexeme));
        default:
          throw this._errExpectedButGot("KEY | true | false | '(' expression ')'", e);
      }
    }
    return this._primary();
  }
  _primary() {
    const t = this._peek();
    switch (t.type) {
      case 11:
        return (this._advance(), eW.true());
      case 12:
        return (this._advance(), eW.false());
      case 0: {
        this._advance();
        const e = this._expr();
        return (this._consume(1, GV), e);
      }
      case 17: {
        const e = t.lexeme;
        if ((this._advance(), this._matchOne(9))) {
          const t = this._peek();
          if (!this._config.regexParsingWithErrorRecovery) {
            if ((this._advance(), 10 !== t.type)) throw this._errExpectedButGot("REGEX", t);
            const n = t.lexeme,
              i = n.lastIndexOf("/"),
              r = i === n.length - 1 ? void 0 : this._removeFlagsGY(n.substring(i + 1));
            let o;
            try {
              o = new RegExp(n.substring(1, i), r);
            } catch (spt) {
              throw this._errExpectedButGot("REGEX", t);
            }
            return fW.create(e, o);
          }
          switch (t.type) {
            case 10:
            case 19: {
              const n = [t.lexeme];
              this._advance();
              let i = this._peek(),
                r = 0;
              for (let e = 0; e < t.lexeme.length; e++)
                40 === t.lexeme.charCodeAt(e) ? r++ : 41 === t.lexeme.charCodeAt(e) && r--;
              for (; !this._isAtEnd() && 15 !== i.type && 16 !== i.type; ) {
                switch (i.type) {
                  case 0:
                    r++;
                    break;
                  case 1:
                    r--;
                    break;
                  case 10:
                  case 18:
                    for (let e = 0; e < i.lexeme.length; e++)
                      40 === i.lexeme.charCodeAt(e) ? r++ : 41 === t.lexeme.charCodeAt(e) && r--;
                }
                if (r < 0) break;
                (n.push(WV.getLexeme(i)), this._advance(), (i = this._peek()));
              }
              const o = n.join(""),
                s = o.lastIndexOf("/"),
                a = s === o.length - 1 ? void 0 : this._removeFlagsGY(o.substring(s + 1));
              let l;
              try {
                l = new RegExp(o.substring(1, s), a);
              } catch (spt) {
                throw this._errExpectedButGot("REGEX", t);
              }
              return eW.regex(e, l);
            }
            case 18: {
              const n = t.lexeme;
              this._advance();
              let i = null;
              if (!BM(n)) {
                const e = n.indexOf("/"),
                  r = n.lastIndexOf("/");
                if (e !== r && e >= 0) {
                  const o = n.slice(e + 1, r),
                    s = "i" === n[r + 1] ? "i" : "";
                  try {
                    i = new RegExp(o, s);
                  } catch (MZe) {
                    throw this._errExpectedButGot("REGEX", t);
                  }
                }
              }
              if (null === i) throw this._errExpectedButGot("REGEX", t);
              return fW.create(e, i);
            }
            default:
              throw this._errExpectedButGot("REGEX", this._peek());
          }
        }
        if (this._matchOne(14)) {
          this._consume(13, KV);
          const t = this._value();
          return eW.notIn(e, t);
        }
        switch (this._peek().type) {
          case 3: {
            this._advance();
            const t = this._value();
            if (18 === this._previous().type) return eW.equals(e, t);
            switch (t) {
              case "true":
                return eW.has(e);
              case "false":
                return eW.not(e);
              default:
                return eW.equals(e, t);
            }
          }
          case 4: {
            this._advance();
            const t = this._value();
            if (18 === this._previous().type) return eW.notEquals(e, t);
            switch (t) {
              case "true":
                return eW.not(e);
              case "false":
                return eW.has(e);
              default:
                return eW.notEquals(e, t);
            }
          }
          case 5:
            return (this._advance(), gW.create(e, this._value()));
          case 6:
            return (this._advance(), pW.create(e, this._value()));
          case 7:
            return (this._advance(), uW.create(e, this._value()));
          case 8:
            return (this._advance(), hW.create(e, this._value()));
          case 13:
            return (this._advance(), eW.in(e, this._value()));
          default:
            return eW.has(e);
        }
      }
      case 20:
        throw (
          this._parsingErrors.push({
            message: XV,
            offset: t.offset,
            lexeme: "",
            additionalInfo: QV,
          }),
          e._parseError
        );
      default:
        throw this._errExpectedButGot(
          "true | false | KEY \n\t| KEY '=~' REGEX \n\t| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value",
          this._peek(),
        );
    }
  }
  _value() {
    const e = this._peek();
    switch (e.type) {
      case 17:
      case 18:
        return (this._advance(), e.lexeme);
      case 11:
        return (this._advance(), "true");
      case 12:
        return (this._advance(), "false");
      case 13:
        return (this._advance(), "in");
      default:
        return "";
    }
  }
  _removeFlagsGY(e) {
    return e.replaceAll(this._flagsGYRe, "");
  }
  _previous() {
    return this._tokens[this._current - 1];
  }
  _matchOne(e) {
    return !!this._check(e) && (this._advance(), !0);
  }
  _advance() {
    return (this._isAtEnd() || this._current++, this._previous());
  }
  _consume(e, t) {
    if (this._check(e)) return this._advance();
    throw this._errExpectedButGot(t, this._peek());
  }
  _errExpectedButGot(t, n, i) {
    const r = SI(1683, "Expected: {0}\nReceived: '{1}'.", t, WV.getLexeme(n)),
      o = n.offset,
      s = WV.getLexeme(n);
    return (
      this._parsingErrors.push({ message: r, offset: o, lexeme: s, additionalInfo: i }),
      e._parseError
    );
  }
  _check(e) {
    return this._peek().type === e;
  }
  _peek() {
    return this._tokens[this._current];
  }
  _isAtEnd() {
    return 20 === this._peek().type;
  }
};
class eW {
  static false() {
    return nW.INSTANCE;
  }
  static true() {
    return iW.INSTANCE;
  }
  static has(e) {
    return rW.create(e);
  }
  static equals(e, t) {
    return oW.create(e, t);
  }
  static notEquals(e, t) {
    return lW.create(e, t);
  }
  static regex(e, t) {
    return fW.create(e, t);
  }
  static in(e, t) {
    return sW.create(e, t);
  }
  static notIn(e, t) {
    return aW.create(e, t);
  }
  static not(e) {
    return cW.create(e);
  }
  static and(...e) {
    return vW.create(e, null, !0);
  }
  static or(...e) {
    return bW.create(e, null, !0);
  }
  static {
    this._parser = new JV({ regexParsingWithErrorRecovery: !1 });
  }
  static deserialize(e) {
    if (null == e) return;
    return this._parser.parse(e);
  }
}
function tW(e, t) {
  return e.cmp(t);
}
class nW {
  static {
    this.INSTANCE = new nW();
  }
  constructor() {
    this.type = 0;
  }
  cmp(e) {
    return this.type - e.type;
  }
  equals(e) {
    return e.type === this.type;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return !1;
  }
  serialize() {
    return "false";
  }
  keys() {
    return [];
  }
  negate() {
    return iW.INSTANCE;
  }
}
class iW {
  static {
    this.INSTANCE = new iW();
  }
  constructor() {
    this.type = 1;
  }
  cmp(e) {
    return this.type - e.type;
  }
  equals(e) {
    return e.type === this.type;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return !0;
  }
  serialize() {
    return "true";
  }
  keys() {
    return [];
  }
  negate() {
    return nW.INSTANCE;
  }
}
class rW {
  static create(e, t = null) {
    const n = HV.get(e);
    return "boolean" == typeof n ? (n ? iW.INSTANCE : nW.INSTANCE) : new rW(e, t);
  }
  constructor(e, t) {
    ((this.key = e), (this.negated = t), (this.type = 2));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : wW(this.key, e.key);
  }
  equals(e) {
    return e.type === this.type && this.key === e.key;
  }
  substituteConstants() {
    const e = HV.get(this.key);
    return "boolean" == typeof e ? (e ? iW.INSTANCE : nW.INSTANCE) : this;
  }
  evaluate(e) {
    return !!e.getValue(this.key);
  }
  serialize() {
    return this.key;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return (this.negated || (this.negated = cW.create(this.key, this)), this.negated);
  }
}
class oW {
  static create(e, t, n = null) {
    if ("boolean" == typeof t) return t ? rW.create(e, n) : cW.create(e, n);
    const i = HV.get(e);
    if ("boolean" == typeof i) {
      return t === (i ? "true" : "false") ? iW.INSTANCE : nW.INSTANCE;
    }
    return new oW(e, t, n);
  }
  constructor(e, t, n) {
    ((this.key = e), (this.value = t), (this.negated = n), (this.type = 4));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : CW(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type && this.key === e.key && this.value === e.value;
  }
  substituteConstants() {
    const e = HV.get(this.key);
    if ("boolean" == typeof e) {
      const t = e ? "true" : "false";
      return this.value === t ? iW.INSTANCE : nW.INSTANCE;
    }
    return this;
  }
  evaluate(e) {
    return e.getValue(this.key) == this.value;
  }
  serialize() {
    return `${this.key} == '${this.value}'`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return (this.negated || (this.negated = lW.create(this.key, this.value, this)), this.negated);
  }
}
class sW {
  static create(e, t) {
    return new sW(e, t);
  }
  constructor(e, t) {
    ((this.key = e), (this.valueKey = t), (this.type = 10), (this.negated = null));
  }
  cmp(e) {
    return e.type !== this.type
      ? this.type - e.type
      : CW(this.key, this.valueKey, e.key, e.valueKey);
  }
  equals(e) {
    return e.type === this.type && this.key === e.key && this.valueKey === e.valueKey;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    const t = e.getValue(this.valueKey),
      n = e.getValue(this.key);
    return Array.isArray(t)
      ? t.includes(n)
      : "string" == typeof n && "object" == typeof t && null !== t && zV.call(t, n);
  }
  serialize() {
    return `${this.key} in '${this.valueKey}'`;
  }
  keys() {
    return [this.key, this.valueKey];
  }
  negate() {
    return (this.negated || (this.negated = aW.create(this.key, this.valueKey)), this.negated);
  }
}
class aW {
  static create(e, t) {
    return new aW(e, t);
  }
  constructor(e, t) {
    ((this.key = e), (this.valueKey = t), (this.type = 11), (this._negated = sW.create(e, t)));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : this._negated.cmp(e._negated);
  }
  equals(e) {
    return e.type === this.type && this._negated.equals(e._negated);
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return !this._negated.evaluate(e);
  }
  serialize() {
    return `${this.key} not in '${this.valueKey}'`;
  }
  keys() {
    return this._negated.keys();
  }
  negate() {
    return this._negated;
  }
}
class lW {
  static create(e, t, n = null) {
    if ("boolean" == typeof t) return t ? cW.create(e, n) : rW.create(e, n);
    const i = HV.get(e);
    if ("boolean" == typeof i) {
      return t === (i ? "true" : "false") ? nW.INSTANCE : iW.INSTANCE;
    }
    return new lW(e, t, n);
  }
  constructor(e, t, n) {
    ((this.key = e), (this.value = t), (this.negated = n), (this.type = 5));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : CW(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type && this.key === e.key && this.value === e.value;
  }
  substituteConstants() {
    const e = HV.get(this.key);
    if ("boolean" == typeof e) {
      const t = e ? "true" : "false";
      return this.value === t ? nW.INSTANCE : iW.INSTANCE;
    }
    return this;
  }
  evaluate(e) {
    return e.getValue(this.key) != this.value;
  }
  serialize() {
    return `${this.key} != '${this.value}'`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return (this.negated || (this.negated = oW.create(this.key, this.value, this)), this.negated);
  }
}
class cW {
  static create(e, t = null) {
    const n = HV.get(e);
    return "boolean" == typeof n ? (n ? nW.INSTANCE : iW.INSTANCE) : new cW(e, t);
  }
  constructor(e, t) {
    ((this.key = e), (this.negated = t), (this.type = 3));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : wW(this.key, e.key);
  }
  equals(e) {
    return e.type === this.type && this.key === e.key;
  }
  substituteConstants() {
    const e = HV.get(this.key);
    return "boolean" == typeof e ? (e ? nW.INSTANCE : iW.INSTANCE) : this;
  }
  evaluate(e) {
    return !e.getValue(this.key);
  }
  serialize() {
    return `!${this.key}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return (this.negated || (this.negated = rW.create(this.key, this)), this.negated);
  }
}
function dW(e, t) {
  if ("string" == typeof e) {
    const t = parseFloat(e);
    isNaN(t) || (e = t);
  }
  return "string" == typeof e || "number" == typeof e ? t(e) : nW.INSTANCE;
}
class uW {
  static create(e, t, n = null) {
    return dW(t, (t) => new uW(e, t, n));
  }
  constructor(e, t, n) {
    ((this.key = e), (this.value = t), (this.negated = n), (this.type = 12));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : CW(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type && this.key === e.key && this.value === e.value;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return "string" != typeof this.value && parseFloat(e.getValue(this.key)) > this.value;
  }
  serialize() {
    return `${this.key} > ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return (this.negated || (this.negated = pW.create(this.key, this.value, this)), this.negated);
  }
}
class hW {
  static create(e, t, n = null) {
    return dW(t, (t) => new hW(e, t, n));
  }
  constructor(e, t, n) {
    ((this.key = e), (this.value = t), (this.negated = n), (this.type = 13));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : CW(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type && this.key === e.key && this.value === e.value;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return "string" != typeof this.value && parseFloat(e.getValue(this.key)) >= this.value;
  }
  serialize() {
    return `${this.key} >= ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return (this.negated || (this.negated = gW.create(this.key, this.value, this)), this.negated);
  }
}
class gW {
  static create(e, t, n = null) {
    return dW(t, (t) => new gW(e, t, n));
  }
  constructor(e, t, n) {
    ((this.key = e), (this.value = t), (this.negated = n), (this.type = 14));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : CW(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type && this.key === e.key && this.value === e.value;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return "string" != typeof this.value && parseFloat(e.getValue(this.key)) < this.value;
  }
  serialize() {
    return `${this.key} < ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return (this.negated || (this.negated = hW.create(this.key, this.value, this)), this.negated);
  }
}
class pW {
  static create(e, t, n = null) {
    return dW(t, (t) => new pW(e, t, n));
  }
  constructor(e, t, n) {
    ((this.key = e), (this.value = t), (this.negated = n), (this.type = 15));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : CW(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type && this.key === e.key && this.value === e.value;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return "string" != typeof this.value && parseFloat(e.getValue(this.key)) <= this.value;
  }
  serialize() {
    return `${this.key} <= ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return (this.negated || (this.negated = uW.create(this.key, this.value, this)), this.negated);
  }
}
class fW {
  static create(e, t) {
    return new fW(e, t);
  }
  constructor(e, t) {
    ((this.key = e), (this.regexp = t), (this.type = 7), (this.negated = null));
  }
  cmp(e) {
    if (e.type !== this.type) return this.type - e.type;
    if (this.key < e.key) return -1;
    if (this.key > e.key) return 1;
    const t = this.regexp ? this.regexp.source : "",
      n = e.regexp ? e.regexp.source : "";
    return t < n ? -1 : t > n ? 1 : 0;
  }
  equals(e) {
    if (e.type === this.type) {
      const t = this.regexp ? this.regexp.source : "",
        n = e.regexp ? e.regexp.source : "";
      return this.key === e.key && t === n;
    }
    return !1;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    const t = e.getValue(this.key);
    return !!this.regexp && this.regexp.test(t);
  }
  serialize() {
    const e = this.regexp ? `/${this.regexp.source}/${this.regexp.flags}` : "/invalid/";
    return `${this.key} =~ ${e}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return (this.negated || (this.negated = mW.create(this)), this.negated);
  }
}
class mW {
  static create(e) {
    return new mW(e);
  }
  constructor(e) {
    ((this._actual = e), (this.type = 8));
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : this._actual.cmp(e._actual);
  }
  equals(e) {
    return e.type === this.type && this._actual.equals(e._actual);
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return !this._actual.evaluate(e);
  }
  serialize() {
    return `!(${this._actual.serialize()})`;
  }
  keys() {
    return this._actual.keys();
  }
  negate() {
    return this._actual;
  }
}
function _W(e) {
  let t = null;
  for (let n = 0, i = e.length; n < i; n++) {
    const i = e[n].substituteConstants();
    if (e[n] !== i && null === t) {
      t = [];
      for (let i = 0; i < n; i++) t[i] = e[i];
    }
    null !== t && (t[n] = i);
  }
  return null === t ? e : t;
}
class vW {
  static create(e, t, n) {
    return vW._normalizeArr(e, t, n);
  }
  constructor(e, t) {
    ((this.expr = e), (this.negated = t), (this.type = 6));
  }
  cmp(e) {
    if (e.type !== this.type) return this.type - e.type;
    if (this.expr.length < e.expr.length) return -1;
    if (this.expr.length > e.expr.length) return 1;
    for (let t = 0, n = this.expr.length; t < n; t++) {
      const n = tW(this.expr[t], e.expr[t]);
      if (0 !== n) return n;
    }
    return 0;
  }
  equals(e) {
    if (e.type === this.type) {
      if (this.expr.length !== e.expr.length) return !1;
      for (let t = 0, n = this.expr.length; t < n; t++)
        if (!this.expr[t].equals(e.expr[t])) return !1;
      return !0;
    }
    return !1;
  }
  substituteConstants() {
    const e = _W(this.expr);
    return e === this.expr ? this : vW.create(e, this.negated, !1);
  }
  evaluate(e) {
    for (let t = 0, n = this.expr.length; t < n; t++) if (!this.expr[t].evaluate(e)) return !1;
    return !0;
  }
  static _normalizeArr(e, t, n) {
    const i = [];
    let r = !1;
    for (const o of e)
      if (o)
        if (1 !== o.type) {
          if (0 === o.type) return nW.INSTANCE;
          6 !== o.type ? i.push(o) : i.push(...o.expr);
        } else r = !0;
    if (0 === i.length && r) return iW.INSTANCE;
    if (0 !== i.length) {
      if (1 === i.length) return i[0];
      i.sort(tW);
      for (let e = 1; e < i.length; e++) i[e - 1].equals(i[e]) && (i.splice(e, 1), e--);
      if (1 === i.length) return i[0];
      for (; i.length > 1; ) {
        const e = i[i.length - 1];
        if (9 !== e.type) break;
        i.pop();
        const t = i.pop(),
          r = 0 === i.length,
          o = bW.create(
            e.expr.map((e) => vW.create([e, t], null, n)),
            null,
            r,
          );
        o && (i.push(o), i.sort(tW));
      }
      if (1 === i.length) return i[0];
      if (n) {
        for (let e = 0; e < i.length; e++)
          for (let t = e + 1; t < i.length; t++) if (i[e].negate().equals(i[t])) return nW.INSTANCE;
        if (1 === i.length) return i[0];
      }
      return new vW(i, t);
    }
  }
  serialize() {
    return this.expr.map((e) => e.serialize()).join(" && ");
  }
  keys() {
    const e = [];
    for (const t of this.expr) e.push(...t.keys());
    return e;
  }
  negate() {
    if (!this.negated) {
      const e = [];
      for (const t of this.expr) e.push(t.negate());
      this.negated = bW.create(e, this, !0);
    }
    return this.negated;
  }
}
class bW {
  static create(e, t, n) {
    return bW._normalizeArr(e, t, n);
  }
  constructor(e, t) {
    ((this.expr = e), (this.negated = t), (this.type = 9));
  }
  cmp(e) {
    if (e.type !== this.type) return this.type - e.type;
    if (this.expr.length < e.expr.length) return -1;
    if (this.expr.length > e.expr.length) return 1;
    for (let t = 0, n = this.expr.length; t < n; t++) {
      const n = tW(this.expr[t], e.expr[t]);
      if (0 !== n) return n;
    }
    return 0;
  }
  equals(e) {
    if (e.type === this.type) {
      if (this.expr.length !== e.expr.length) return !1;
      for (let t = 0, n = this.expr.length; t < n; t++)
        if (!this.expr[t].equals(e.expr[t])) return !1;
      return !0;
    }
    return !1;
  }
  substituteConstants() {
    const e = _W(this.expr);
    return e === this.expr ? this : bW.create(e, this.negated, !1);
  }
  evaluate(e) {
    for (let t = 0, n = this.expr.length; t < n; t++) if (this.expr[t].evaluate(e)) return !0;
    return !1;
  }
  static _normalizeArr(e, t, n) {
    let i = [],
      r = !1;
    if (e) {
      for (let t = 0, n = e.length; t < n; t++) {
        const n = e[t];
        if (n)
          if (0 !== n.type) {
            if (1 === n.type) return iW.INSTANCE;
            9 !== n.type ? i.push(n) : (i = i.concat(n.expr));
          } else r = !0;
      }
      if (0 === i.length && r) return nW.INSTANCE;
      i.sort(tW);
    }
    if (0 !== i.length) {
      if (1 === i.length) return i[0];
      for (let e = 1; e < i.length; e++) i[e - 1].equals(i[e]) && (i.splice(e, 1), e--);
      if (1 === i.length) return i[0];
      if (n) {
        for (let e = 0; e < i.length; e++)
          for (let t = e + 1; t < i.length; t++) if (i[e].negate().equals(i[t])) return iW.INSTANCE;
        if (1 === i.length) return i[0];
      }
      return new bW(i, t);
    }
  }
  serialize() {
    return this.expr.map((e) => e.serialize()).join(" || ");
  }
  keys() {
    const e = [];
    for (const t of this.expr) e.push(...t.keys());
    return e;
  }
  negate() {
    if (!this.negated) {
      const e = [];
      for (const t of this.expr) e.push(t.negate());
      for (; e.length > 1; ) {
        const t = e.shift(),
          n = e.shift(),
          i = [];
        for (const e of EW(t)) for (const t of EW(n)) i.push(vW.create([e, t], null, !1));
        e.unshift(bW.create(i, null, !1));
      }
      this.negated = bW.create(e, this, !0);
    }
    return this.negated;
  }
}
class yW extends rW {
  static {
    this._info = [];
  }
  static all() {
    return yW._info.values();
  }
  constructor(e, t, n) {
    (super(e, null),
      (this._defaultValue = t),
      "object" == typeof n
        ? yW._info.push({ ...n, key: e })
        : !0 !== n &&
          yW._info.push({ key: e, description: n, type: null != t ? typeof t : void 0 }));
  }
  bindTo(e) {
    return e.createKey(this.key, this._defaultValue);
  }
  getValue(e) {
    return e.getContextKeyValue(this.key);
  }
  toNegated() {
    return this.negate();
  }
  isEqualTo(e) {
    return oW.create(this.key, e);
  }
}
const xW = bV("contextKeyService");
function wW(e, t) {
  return e < t ? -1 : e > t ? 1 : 0;
}
function CW(e, t, n, i) {
  return e < n ? -1 : e > n ? 1 : t < i ? -1 : t > i ? 1 : 0;
}
function SW(e, t) {
  if (0 === e.type || 1 === t.type) return !0;
  if (9 === e.type) return 9 === t.type && kW(e.expr, t.expr);
  if (9 === t.type) {
    for (const n of t.expr) if (SW(e, n)) return !0;
    return !1;
  }
  if (6 === e.type) {
    if (6 === t.type) return kW(t.expr, e.expr);
    for (const n of e.expr) if (SW(n, t)) return !0;
    return !1;
  }
  return e.equals(t);
}
function kW(e, t) {
  let n = 0,
    i = 0;
  for (; n < e.length && i < t.length; ) {
    const r = e[n].cmp(t[i]);
    if (r < 0) return !1;
    0 === r ? (n++, i++) : i++;
  }
  return n === e.length;
}
function EW(e) {
  return 9 === e.type ? e.expr : [e];
}
const NW = new (class {
  constructor() {
    this.data = new Map();
  }
  add(e, t) {
    (JI(oR(e)),
      JI(sR(t)),
      JI(!this.data.has(e), "There is already an extension with this id"),
      this.data.set(e, t));
  }
  as(e) {
    return this.data.get(e) || null;
  }
  dispose() {
    (this.data.forEach((e) => {
      mR(e.dispose) && e.dispose();
    }),
      this.data.clear());
  }
})();
class LW {
  constructor() {
    ((this._coreKeybindings = new HO()),
      (this._extensionKeybindings = []),
      (this._cachedMergedKeybindings = null));
  }
  static bindToCurrentPlatform(e) {
    if (1 === GR) {
      if (e && e.win) return e.win;
    } else if (2 === GR) {
      if (e && e.mac) return e.mac;
    } else if (e && e.linux) return e.linux;
    return e;
  }
  registerKeybindingRule(e) {
    const t = LW.bindToCurrentPlatform(e),
      n = new AO();
    if (t && t.primary) {
      const i = pO(t.primary, GR);
      i && n.add(this._registerDefaultKeybinding(i, e.id, e.args, e.weight, 0, e.when));
    }
    if (t && Array.isArray(t.secondary))
      for (let i = 0, r = t.secondary.length; i < r; i++) {
        const r = pO(t.secondary[i], GR);
        r && n.add(this._registerDefaultKeybinding(r, e.id, e.args, e.weight, -i - 1, e.when));
      }
    return n;
  }
  registerCommandAndKeybindingRule(e) {
    return RO(this.registerKeybindingRule(e), jV.registerCommand(e));
  }
  _registerDefaultKeybinding(e, t, n, i, r, o) {
    const s = this._coreKeybindings.push({
      keybinding: e,
      command: t,
      commandArgs: n,
      when: o,
      weight1: i,
      weight2: r,
      extensionId: null,
      isBuiltinExtension: !1,
    });
    return (
      (this._cachedMergedKeybindings = null),
      MO(() => {
        (s(), (this._cachedMergedKeybindings = null));
      })
    );
  }
  getDefaultKeybindings() {
    return (
      this._cachedMergedKeybindings ||
        ((this._cachedMergedKeybindings = Array.from(this._coreKeybindings).concat(
          this._extensionKeybindings,
        )),
        this._cachedMergedKeybindings.sort(TW)),
      this._cachedMergedKeybindings.slice(0)
    );
  }
}
const DW = new LW();
function TW(e, t) {
  if (e.weight1 !== t.weight1) return e.weight1 - t.weight1;
  if (e.command && t.command) {
    if (e.command < t.command) return -1;
    if (e.command > t.command) return 1;
  }
  return e.weight2 - t.weight2;
}
NW.add("platform.keybindingsRegistry", DW);
var IW,
  RW = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
function OW(e) {
  return void 0 !== e.command;
}
class MW {
  static {
    this._instances = new Map();
  }
  static {
    this.CommandPalette = new MW("CommandPalette");
  }
  static {
    this.DebugBreakpointsContext = new MW("DebugBreakpointsContext");
  }
  static {
    this.DebugCallStackContext = new MW("DebugCallStackContext");
  }
  static {
    this.DebugConsoleContext = new MW("DebugConsoleContext");
  }
  static {
    this.DebugVariablesContext = new MW("DebugVariablesContext");
  }
  static {
    this.NotebookVariablesContext = new MW("NotebookVariablesContext");
  }
  static {
    this.DebugHoverContext = new MW("DebugHoverContext");
  }
  static {
    this.DebugWatchContext = new MW("DebugWatchContext");
  }
  static {
    this.DebugToolBar = new MW("DebugToolBar");
  }
  static {
    this.DebugToolBarStop = new MW("DebugToolBarStop");
  }
  static {
    this.DebugDisassemblyContext = new MW("DebugDisassemblyContext");
  }
  static {
    this.DebugCallStackToolbar = new MW("DebugCallStackToolbar");
  }
  static {
    this.DebugCreateConfiguration = new MW("DebugCreateConfiguration");
  }
  static {
    this.EditorContext = new MW("EditorContext");
  }
  static {
    this.SimpleEditorContext = new MW("SimpleEditorContext");
  }
  static {
    this.EditorContent = new MW("EditorContent");
  }
  static {
    this.EditorLineNumberContext = new MW("EditorLineNumberContext");
  }
  static {
    this.EditorContextCopy = new MW("EditorContextCopy");
  }
  static {
    this.EditorContextPeek = new MW("EditorContextPeek");
  }
  static {
    this.EditorContextShare = new MW("EditorContextShare");
  }
  static {
    this.EditorTitle = new MW("EditorTitle");
  }
  static {
    this.CompactWindowEditorTitle = new MW("CompactWindowEditorTitle");
  }
  static {
    this.EditorTitleRun = new MW("EditorTitleRun");
  }
  static {
    this.EditorTitleContext = new MW("EditorTitleContext");
  }
  static {
    this.EditorTitleContextShare = new MW("EditorTitleContextShare");
  }
  static {
    this.EmptyEditorGroup = new MW("EmptyEditorGroup");
  }
  static {
    this.EmptyEditorGroupContext = new MW("EmptyEditorGroupContext");
  }
  static {
    this.EditorTabsBarContext = new MW("EditorTabsBarContext");
  }
  static {
    this.EditorTabsBarShowTabsSubmenu = new MW("EditorTabsBarShowTabsSubmenu");
  }
  static {
    this.EditorTabsBarShowTabsZenModeSubmenu = new MW("EditorTabsBarShowTabsZenModeSubmenu");
  }
  static {
    this.EditorActionsPositionSubmenu = new MW("EditorActionsPositionSubmenu");
  }
  static {
    this.EditorSplitMoveSubmenu = new MW("EditorSplitMoveSubmenu");
  }
  static {
    this.ExplorerContext = new MW("ExplorerContext");
  }
  static {
    this.ExplorerContextShare = new MW("ExplorerContextShare");
  }
  static {
    this.ExtensionContext = new MW("ExtensionContext");
  }
  static {
    this.ExtensionEditorContextMenu = new MW("ExtensionEditorContextMenu");
  }
  static {
    this.GlobalActivity = new MW("GlobalActivity");
  }
  static {
    this.CommandCenter = new MW("CommandCenter");
  }
  static {
    this.CommandCenterCenter = new MW("CommandCenterCenter");
  }
  static {
    this.LayoutControlMenuSubmenu = new MW("LayoutControlMenuSubmenu");
  }
  static {
    this.LayoutControlMenu = new MW("LayoutControlMenu");
  }
  static {
    this.MenubarMainMenu = new MW("MenubarMainMenu");
  }
  static {
    this.MenubarAppearanceMenu = new MW("MenubarAppearanceMenu");
  }
  static {
    this.MenubarDebugMenu = new MW("MenubarDebugMenu");
  }
  static {
    this.MenubarEditMenu = new MW("MenubarEditMenu");
  }
  static {
    this.MenubarCopy = new MW("MenubarCopy");
  }
  static {
    this.MenubarFileMenu = new MW("MenubarFileMenu");
  }
  static {
    this.MenubarGoMenu = new MW("MenubarGoMenu");
  }
  static {
    this.MenubarHelpMenu = new MW("MenubarHelpMenu");
  }
  static {
    this.MenubarLayoutMenu = new MW("MenubarLayoutMenu");
  }
  static {
    this.MenubarNewBreakpointMenu = new MW("MenubarNewBreakpointMenu");
  }
  static {
    this.PanelAlignmentMenu = new MW("PanelAlignmentMenu");
  }
  static {
    this.PanelPositionMenu = new MW("PanelPositionMenu");
  }
  static {
    this.ActivityBarPositionMenu = new MW("ActivityBarPositionMenu");
  }
  static {
    this.MenubarPreferencesMenu = new MW("MenubarPreferencesMenu");
  }
  static {
    this.MenubarRecentMenu = new MW("MenubarRecentMenu");
  }
  static {
    this.MenubarSelectionMenu = new MW("MenubarSelectionMenu");
  }
  static {
    this.MenubarShare = new MW("MenubarShare");
  }
  static {
    this.MenubarSwitchEditorMenu = new MW("MenubarSwitchEditorMenu");
  }
  static {
    this.MenubarSwitchGroupMenu = new MW("MenubarSwitchGroupMenu");
  }
  static {
    this.MenubarTerminalMenu = new MW("MenubarTerminalMenu");
  }
  static {
    this.MenubarTerminalSuggestStatusMenu = new MW("MenubarTerminalSuggestStatusMenu");
  }
  static {
    this.MenubarViewMenu = new MW("MenubarViewMenu");
  }
  static {
    this.MenubarHomeMenu = new MW("MenubarHomeMenu");
  }
  static {
    this.OpenEditorsContext = new MW("OpenEditorsContext");
  }
  static {
    this.OpenEditorsContextShare = new MW("OpenEditorsContextShare");
  }
  static {
    this.ProblemsPanelContext = new MW("ProblemsPanelContext");
  }
  static {
    this.SCMInputBox = new MW("SCMInputBox");
  }
  static {
    this.SCMChangeContext = new MW("SCMChangeContext");
  }
  static {
    this.SCMResourceContext = new MW("SCMResourceContext");
  }
  static {
    this.SCMResourceContextShare = new MW("SCMResourceContextShare");
  }
  static {
    this.SCMResourceFolderContext = new MW("SCMResourceFolderContext");
  }
  static {
    this.SCMResourceGroupContext = new MW("SCMResourceGroupContext");
  }
  static {
    this.SCMSourceControl = new MW("SCMSourceControl");
  }
  static {
    this.SCMSourceControlInline = new MW("SCMSourceControlInline");
  }
  static {
    this.SCMSourceControlTitle = new MW("SCMSourceControlTitle");
  }
  static {
    this.SCMHistoryTitle = new MW("SCMHistoryTitle");
  }
  static {
    this.SCMHistoryItemContext = new MW("SCMHistoryItemContext");
  }
  static {
    this.SCMHistoryItemChangeContext = new MW("SCMHistoryItemChangeContext");
  }
  static {
    this.SCMHistoryItemRefContext = new MW("SCMHistoryItemRefContext");
  }
  static {
    this.SCMArtifactGroupContext = new MW("SCMArtifactGroupContext");
  }
  static {
    this.SCMArtifactContext = new MW("SCMArtifactContext");
  }
  static {
    this.SCMQuickDiffDecorations = new MW("SCMQuickDiffDecorations");
  }
  static {
    this.SCMTitle = new MW("SCMTitle");
  }
  static {
    this.SearchContext = new MW("SearchContext");
  }
  static {
    this.SearchActionMenu = new MW("SearchActionContext");
  }
  static {
    this.StatusBarWindowIndicatorMenu = new MW("StatusBarWindowIndicatorMenu");
  }
  static {
    this.StatusBarRemoteIndicatorMenu = new MW("StatusBarRemoteIndicatorMenu");
  }
  static {
    this.StickyScrollContext = new MW("StickyScrollContext");
  }
  static {
    this.TestItem = new MW("TestItem");
  }
  static {
    this.TestItemGutter = new MW("TestItemGutter");
  }
  static {
    this.TestProfilesContext = new MW("TestProfilesContext");
  }
  static {
    this.TestMessageContext = new MW("TestMessageContext");
  }
  static {
    this.TestMessageContent = new MW("TestMessageContent");
  }
  static {
    this.TestPeekElement = new MW("TestPeekElement");
  }
  static {
    this.TestPeekTitle = new MW("TestPeekTitle");
  }
  static {
    this.TestCallStack = new MW("TestCallStack");
  }
  static {
    this.TestCoverageFilterItem = new MW("TestCoverageFilterItem");
  }
  static {
    this.TouchBarContext = new MW("TouchBarContext");
  }
  static {
    this.TitleBar = new MW("TitleBar");
  }
  static {
    this.TitleBarContext = new MW("TitleBarContext");
  }
  static {
    this.TitleBarTitleContext = new MW("TitleBarTitleContext");
  }
  static {
    this.TunnelContext = new MW("TunnelContext");
  }
  static {
    this.TunnelPrivacy = new MW("TunnelPrivacy");
  }
  static {
    this.TunnelProtocol = new MW("TunnelProtocol");
  }
  static {
    this.TunnelPortInline = new MW("TunnelInline");
  }
  static {
    this.TunnelTitle = new MW("TunnelTitle");
  }
  static {
    this.TunnelLocalAddressInline = new MW("TunnelLocalAddressInline");
  }
  static {
    this.TunnelOriginInline = new MW("TunnelOriginInline");
  }
  static {
    this.ViewItemContext = new MW("ViewItemContext");
  }
  static {
    this.ViewContainerTitle = new MW("ViewContainerTitle");
  }
  static {
    this.ViewContainerTitleContext = new MW("ViewContainerTitleContext");
  }
  static {
    this.ViewTitle = new MW("ViewTitle");
  }
  static {
    this.ViewTitleContext = new MW("ViewTitleContext");
  }
  static {
    this.CommentEditorActions = new MW("CommentEditorActions");
  }
  static {
    this.CommentThreadTitle = new MW("CommentThreadTitle");
  }
  static {
    this.CommentThreadActions = new MW("CommentThreadActions");
  }
  static {
    this.CommentThreadAdditionalActions = new MW("CommentThreadAdditionalActions");
  }
  static {
    this.CommentThreadTitleContext = new MW("CommentThreadTitleContext");
  }
  static {
    this.CommentThreadCommentContext = new MW("CommentThreadCommentContext");
  }
  static {
    this.CommentTitle = new MW("CommentTitle");
  }
  static {
    this.CommentActions = new MW("CommentActions");
  }
  static {
    this.CommentsViewThreadActions = new MW("CommentsViewThreadActions");
  }
  static {
    this.InteractiveToolbar = new MW("InteractiveToolbar");
  }
  static {
    this.InteractiveCellTitle = new MW("InteractiveCellTitle");
  }
  static {
    this.InteractiveCellDelete = new MW("InteractiveCellDelete");
  }
  static {
    this.InteractiveCellExecute = new MW("InteractiveCellExecute");
  }
  static {
    this.InteractiveInputExecute = new MW("InteractiveInputExecute");
  }
  static {
    this.InteractiveInputConfig = new MW("InteractiveInputConfig");
  }
  static {
    this.ReplInputExecute = new MW("ReplInputExecute");
  }
  static {
    this.IssueReporter = new MW("IssueReporter");
  }
  static {
    this.NotebookToolbar = new MW("NotebookToolbar");
  }
  static {
    this.NotebookToolbarContext = new MW("NotebookToolbarContext");
  }
  static {
    this.NotebookStickyScrollContext = new MW("NotebookStickyScrollContext");
  }
  static {
    this.NotebookCellTitle = new MW("NotebookCellTitle");
  }
  static {
    this.NotebookCellDelete = new MW("NotebookCellDelete");
  }
  static {
    this.NotebookCellInsert = new MW("NotebookCellInsert");
  }
  static {
    this.NotebookCellBetween = new MW("NotebookCellBetween");
  }
  static {
    this.NotebookCellListTop = new MW("NotebookCellTop");
  }
  static {
    this.NotebookCellExecute = new MW("NotebookCellExecute");
  }
  static {
    this.NotebookCellExecuteGoTo = new MW("NotebookCellExecuteGoTo");
  }
  static {
    this.NotebookCellExecutePrimary = new MW("NotebookCellExecutePrimary");
  }
  static {
    this.NotebookDiffCellInputTitle = new MW("NotebookDiffCellInputTitle");
  }
  static {
    this.NotebookDiffDocumentMetadata = new MW("NotebookDiffDocumentMetadata");
  }
  static {
    this.NotebookDiffCellMetadataTitle = new MW("NotebookDiffCellMetadataTitle");
  }
  static {
    this.NotebookDiffCellOutputsTitle = new MW("NotebookDiffCellOutputsTitle");
  }
  static {
    this.NotebookOutputToolbar = new MW("NotebookOutputToolbar");
  }
  static {
    this.NotebookOutlineFilter = new MW("NotebookOutlineFilter");
  }
  static {
    this.NotebookOutlineActionMenu = new MW("NotebookOutlineActionMenu");
  }
  static {
    this.NotebookEditorLayoutConfigure = new MW("NotebookEditorLayoutConfigure");
  }
  static {
    this.NotebookKernelSource = new MW("NotebookKernelSource");
  }
  static {
    this.BulkEditTitle = new MW("BulkEditTitle");
  }
  static {
    this.BulkEditContext = new MW("BulkEditContext");
  }
  static {
    this.TimelineItemContext = new MW("TimelineItemContext");
  }
  static {
    this.TimelineTitle = new MW("TimelineTitle");
  }
  static {
    this.TimelineTitleContext = new MW("TimelineTitleContext");
  }
  static {
    this.TimelineFilterSubMenu = new MW("TimelineFilterSubMenu");
  }
  static {
    this.AccountsContext = new MW("AccountsContext");
  }
  static {
    this.SidebarTitle = new MW("SidebarTitle");
  }
  static {
    this.PanelTitle = new MW("PanelTitle");
  }
  static {
    this.AuxiliaryBarTitle = new MW("AuxiliaryBarTitle");
  }
  static {
    this.TerminalInstanceContext = new MW("TerminalInstanceContext");
  }
  static {
    this.TerminalEditorInstanceContext = new MW("TerminalEditorInstanceContext");
  }
  static {
    this.TerminalNewDropdownContext = new MW("TerminalNewDropdownContext");
  }
  static {
    this.TerminalTabContext = new MW("TerminalTabContext");
  }
  static {
    this.TerminalTabEmptyAreaContext = new MW("TerminalTabEmptyAreaContext");
  }
  static {
    this.TerminalStickyScrollContext = new MW("TerminalStickyScrollContext");
  }
  static {
    this.WebviewContext = new MW("WebviewContext");
  }
  static {
    this.InlineCompletionsActions = new MW("InlineCompletionsActions");
  }
  static {
    this.InlineEditsActions = new MW("InlineEditsActions");
  }
  static {
    this.NewFile = new MW("NewFile");
  }
  static {
    this.MergeInput1Toolbar = new MW("MergeToolbar1Toolbar");
  }
  static {
    this.MergeInput2Toolbar = new MW("MergeToolbar2Toolbar");
  }
  static {
    this.MergeBaseToolbar = new MW("MergeBaseToolbar");
  }
  static {
    this.MergeInputResultToolbar = new MW("MergeToolbarResultToolbar");
  }
  static {
    this.InlineSuggestionToolbar = new MW("InlineSuggestionToolbar");
  }
  static {
    this.InlineEditToolbar = new MW("InlineEditToolbar");
  }
  static {
    this.ChatContext = new MW("ChatContext");
  }
  static {
    this.ChatCodeBlock = new MW("ChatCodeblock");
  }
  static {
    this.ChatCompareBlock = new MW("ChatCompareBlock");
  }
  static {
    this.ChatMessageTitle = new MW("ChatMessageTitle");
  }
  static {
    this.ChatHistory = new MW("ChatHistory");
  }
  static {
    this.ChatWelcomeContext = new MW("ChatWelcomeContext");
  }
  static {
    this.ChatMessageFooter = new MW("ChatMessageFooter");
  }
  static {
    this.ChatExecute = new MW("ChatExecute");
  }
  static {
    this.ChatInput = new MW("ChatInput");
  }
  static {
    this.ChatInputSide = new MW("ChatInputSide");
  }
  static {
    this.ChatModePicker = new MW("ChatModePicker");
  }
  static {
    this.ChatEditingWidgetToolbar = new MW("ChatEditingWidgetToolbar");
  }
  static {
    this.ChatEditingEditorContent = new MW("ChatEditingEditorContent");
  }
  static {
    this.ChatEditingEditorHunk = new MW("ChatEditingEditorHunk");
  }
  static {
    this.ChatEditingDeletedNotebookCell = new MW("ChatEditingDeletedNotebookCell");
  }
  static {
    this.ChatInputAttachmentToolbar = new MW("ChatInputAttachmentToolbar");
  }
  static {
    this.ChatEditingWidgetModifiedFilesToolbar = new MW("ChatEditingWidgetModifiedFilesToolbar");
  }
  static {
    this.ChatInputResourceAttachmentContext = new MW("ChatInputResourceAttachmentContext");
  }
  static {
    this.ChatInputSymbolAttachmentContext = new MW("ChatInputSymbolAttachmentContext");
  }
  static {
    this.ChatInlineResourceAnchorContext = new MW("ChatInlineResourceAnchorContext");
  }
  static {
    this.ChatInlineSymbolAnchorContext = new MW("ChatInlineSymbolAnchorContext");
  }
  static {
    this.ChatMessageCheckpoint = new MW("ChatMessageCheckpoint");
  }
  static {
    this.ChatMessageRestoreCheckpoint = new MW("ChatMessageRestoreCheckpoint");
  }
  static {
    this.ChatNewMenu = new MW("ChatNewMenu");
  }
  static {
    this.ChatEditingCodeBlockContext = new MW("ChatEditingCodeBlockContext");
  }
  static {
    this.ChatTitleBarMenu = new MW("ChatTitleBarMenu");
  }
  static {
    this.ChatAttachmentsContext = new MW("ChatAttachmentsContext");
  }
  static {
    this.ChatToolOutputResourceToolbar = new MW("ChatToolOutputResourceToolbar");
  }
  static {
    this.ChatTextEditorMenu = new MW("ChatTextEditorMenu");
  }
  static {
    this.ChatToolOutputResourceContext = new MW("ChatToolOutputResourceContext");
  }
  static {
    this.ChatMultiDiffContext = new MW("ChatMultiDiffContext");
  }
  static {
    this.ChatSessionsMenu = new MW("ChatSessionsMenu");
  }
  static {
    this.ChatSessionsCreateSubMenu = new MW("ChatSessionsCreateSubMenu");
  }
  static {
    this.ChatConfirmationMenu = new MW("ChatConfirmationMenu");
  }
  static {
    this.ChatEditorInlineExecute = new MW("ChatEditorInputExecute");
  }
  static {
    this.ChatEditorInlineInputSide = new MW("ChatEditorInputSide");
  }
  static {
    this.AccessibleView = new MW("AccessibleView");
  }
  static {
    this.MultiDiffEditorFileToolbar = new MW("MultiDiffEditorFileToolbar");
  }
  static {
    this.DiffEditorHunkToolbar = new MW("DiffEditorHunkToolbar");
  }
  static {
    this.DiffEditorSelectionToolbar = new MW("DiffEditorSelectionToolbar");
  }
  constructor(e) {
    if (MW._instances.has(e))
      throw new TypeError(
        `MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`,
      );
    (MW._instances.set(e, this), (this.id = e));
  }
}
const AW = bV("menuService");
class PW {
  static {
    this._all = new Map();
  }
  static for(e) {
    let t = this._all.get(e);
    return (t || ((t = new PW(e)), this._all.set(e, t)), t);
  }
  static merge(e) {
    const t = new Set();
    for (const n of e) n instanceof PW && t.add(n.id);
    return t;
  }
  constructor(e) {
    ((this.id = e), (this.has = (t) => t === e));
  }
}
const jW = new (class {
  constructor() {
    ((this._commands = new Map()),
      (this._menuItems = new Map()),
      (this._onDidChangeMenu = new nM({ merge: PW.merge })),
      (this.onDidChangeMenu = this._onDidChangeMenu.event));
  }
  addCommand(e) {
    return (
      this._commands.set(e.id, e),
      this._onDidChangeMenu.fire(PW.for(MW.CommandPalette)),
      MO(() => {
        this._commands.delete(e.id) && this._onDidChangeMenu.fire(PW.for(MW.CommandPalette));
      })
    );
  }
  getCommand(e) {
    return this._commands.get(e);
  }
  getCommands() {
    const e = new Map();
    return (this._commands.forEach((t, n) => e.set(n, t)), e);
  }
  appendMenuItem(e, t) {
    let n = this._menuItems.get(e);
    n || ((n = new HO()), this._menuItems.set(e, n));
    const i = n.push(t);
    return (
      this._onDidChangeMenu.fire(PW.for(e)),
      MO(() => {
        (i(), this._onDidChangeMenu.fire(PW.for(e)));
      })
    );
  }
  appendMenuItems(e) {
    const t = new AO();
    for (const { id: n, item: i } of e) t.add(this.appendMenuItem(n, i));
    return t;
  }
  getMenuItems(e) {
    let t;
    return (
      (t = this._menuItems.has(e) ? [...this._menuItems.get(e)] : []),
      e === MW.CommandPalette && this._appendImplicitItems(t),
      t
    );
  }
  _appendImplicitItems(e) {
    const t = new Set();
    for (const n of e) OW(n) && (t.add(n.command.id), n.alt && t.add(n.alt.id));
    this._commands.forEach((n, i) => {
      t.has(i) || e.push({ command: n });
    });
  }
})();
class FW extends NV {
  constructor(e, t, n) {
    (super(
      `submenuitem.${e.submenu.id}`,
      "string" == typeof e.title ? e.title : e.title.value,
      n,
      "submenu",
    ),
      (this.item = e),
      (this.hideActions = t));
  }
}
let BW = (IW = class {
  static label(e, t) {
    return t?.renderShortTitle && e.shortTitle
      ? "string" == typeof e.shortTitle
        ? e.shortTitle
        : e.shortTitle.value
      : "string" == typeof e.title
        ? e.title
        : e.title.value;
  }
  constructor(e, t, n, i, r, o, s) {
    let a;
    if (
      ((this.hideActions = i),
      (this.menuKeybinding = r),
      (this._commandService = s),
      (this.id = e.id),
      (this.label = IW.label(e, n)),
      (this.tooltip = ("string" == typeof e.tooltip ? e.tooltip : e.tooltip?.value) ?? ""),
      (this.enabled = !e.precondition || o.contextMatchesRules(e.precondition)),
      (this.checked = void 0),
      e.toggled)
    ) {
      const t = e.toggled.condition ? e.toggled : { condition: e.toggled };
      ((this.checked = o.contextMatchesRules(t.condition)),
        this.checked &&
          t.tooltip &&
          (this.tooltip = "string" == typeof t.tooltip ? t.tooltip : t.tooltip.value),
        this.checked && AV.isThemeIcon(t.icon) && (a = t.icon),
        this.checked &&
          t.title &&
          (this.label = "string" == typeof t.title ? t.title : t.title.value));
    }
    (a || (a = AV.isThemeIcon(e.icon) ? e.icon : void 0),
      (this.item = e),
      (this.alt = t ? new IW(t, void 0, n, i, void 0, o, s) : void 0),
      (this._options = n),
      (this.class = a && AV.asClassName(a)));
  }
  run(...e) {
    let t = [];
    return (
      this._options?.arg && (t = [...t, this._options.arg]),
      this._options?.shouldForwardArgs && (t = [...t, ...e]),
      this._commandService.executeCommand(this.id, ...t)
    );
  }
});
BW = IW = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([RW(5, xW), RW(6, PV)], BW);
class VW {
  constructor(e) {
    this.desc = e;
  }
}
function WW(e) {
  const t = [],
    n = new e(),
    { f1: i, menu: r, keybinding: o, ...s } = n.desc;
  if (jV.getCommand(s.id))
    throw new Error(`Cannot register two commands with the same id: ${s.id}`);
  if (
    (t.push(
      jV.registerCommand({
        id: s.id,
        handler: (e, ...t) => n.run(e, ...t),
        metadata: s.metadata ?? { description: n.desc.title },
      }),
    ),
    Array.isArray(r))
  )
    for (const a of r)
      t.push(
        jW.appendMenuItem(a.id, {
          command: { ...s, precondition: null === a.precondition ? void 0 : s.precondition },
          ...a,
        }),
      );
  else
    r &&
      t.push(
        jW.appendMenuItem(r.id, {
          command: { ...s, precondition: null === r.precondition ? void 0 : s.precondition },
          ...r,
        }),
      );
  if (
    (i &&
      (t.push(jW.appendMenuItem(MW.CommandPalette, { command: s, when: s.precondition })),
      t.push(jW.addCommand(s))),
    Array.isArray(o))
  )
    for (const a of o)
      t.push(
        DW.registerKeybindingRule({
          ...a,
          id: s.id,
          when: s.precondition ? eW.and(s.precondition, a.when) : a.when,
        }),
      );
  else
    o &&
      t.push(
        DW.registerKeybindingRule({
          ...o,
          id: s.id,
          when: s.precondition ? eW.and(s.precondition, o.when) : o.when,
        }),
      );
  return {
    dispose() {
      IO(t);
    },
  };
}
const HW = bV("telemetryService");
var zW, UW, $W;
class qW {
  constructor(e, t) {
    ((this.uri = e), (this.value = t));
  }
}
class KW {
  static {
    this.defaultToKey = (e) => e.toString();
  }
  constructor(e, t) {
    if (((this[zW] = "ResourceMap"), e instanceof KW))
      ((this.map = new Map(e.map)), (this.toKey = t ?? KW.defaultToKey));
    else if (
      (function (e) {
        return Array.isArray(e);
      })(e)
    ) {
      ((this.map = new Map()), (this.toKey = t ?? KW.defaultToKey));
      for (const [t, n] of e) this.set(t, n);
    } else ((this.map = new Map()), (this.toKey = e ?? KW.defaultToKey));
  }
  set(e, t) {
    return (this.map.set(this.toKey(e), new qW(e, t)), this);
  }
  get(e) {
    return this.map.get(this.toKey(e))?.value;
  }
  has(e) {
    return this.map.has(this.toKey(e));
  }
  get size() {
    return this.map.size;
  }
  clear() {
    this.map.clear();
  }
  delete(e) {
    return this.map.delete(this.toKey(e));
  }
  forEach(e, t) {
    void 0 !== t && (e = e.bind(t));
    for (const [n, i] of this.map) e(i.value, i.uri, this);
  }
  *values() {
    for (const e of this.map.values()) yield e.value;
  }
  *keys() {
    for (const e of this.map.values()) yield e.uri;
  }
  *entries() {
    for (const e of this.map.values()) yield [e.uri, e.value];
  }
  *[((zW = Symbol.toStringTag), Symbol.iterator)]() {
    for (const [, e] of this.map) yield [e.uri, e.value];
  }
}
class GW {
  constructor(e, t) {
    ((this[UW] = "ResourceSet"),
      e && "function" != typeof e
        ? ((this._map = new KW(t)), e.forEach(this.add, this))
        : (this._map = new KW(e)));
  }
  get size() {
    return this._map.size;
  }
  add(e) {
    return (this._map.set(e, e), this);
  }
  clear() {
    this._map.clear();
  }
  delete(e) {
    return this._map.delete(e);
  }
  forEach(e, t) {
    this._map.forEach((n, i) => e.call(t, i, i, this));
  }
  has(e) {
    return this._map.has(e);
  }
  entries() {
    return this._map.entries();
  }
  keys() {
    return this._map.keys();
  }
  values() {
    return this._map.keys();
  }
  [((UW = Symbol.toStringTag), Symbol.iterator)]() {
    return this.keys();
  }
}
class ZW {
  constructor() {
    ((this[$W] = "LinkedMap"),
      (this._map = 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(e) {
    return this._map.has(e);
  }
  get(e, t = 0) {
    const n = this._map.get(e);
    if (n) return (0 !== t && this.touch(n, t), n.value);
  }
  set(e, t, n = 0) {
    let i = this._map.get(e);
    if (i) ((i.value = t), 0 !== n && this.touch(i, n));
    else {
      switch (((i = { key: e, value: t, next: void 0, previous: void 0 }), n)) {
        case 0:
        case 2:
        default:
          this.addItemLast(i);
          break;
        case 1:
          this.addItemFirst(i);
      }
      (this._map.set(e, i), this._size++);
    }
    return this;
  }
  delete(e) {
    return !!this.remove(e);
  }
  remove(e) {
    const t = this._map.get(e);
    if (t) return (this._map.delete(e), this.removeItem(t), this._size--, t.value);
  }
  shift() {
    if (!this._head && !this._tail) return;
    if (!this._head || !this._tail) throw new Error("Invalid list");
    const e = this._head;
    return (this._map.delete(e.key), this.removeItem(e), this._size--, e.value);
  }
  forEach(e, t) {
    const n = this._state;
    let i = this._head;
    for (; i; ) {
      if ((t ? e.bind(t)(i.value, i.key, this) : e(i.value, i.key, this), this._state !== n))
        throw new Error("LinkedMap got modified during iteration.");
      i = i.next;
    }
  }
  keys() {
    const e = this,
      t = this._state;
    let n = this._head;
    const i = {
      [Symbol.iterator]: () => i,
      next() {
        if (e._state !== t) throw new Error("LinkedMap got modified during iteration.");
        if (n) {
          const e = { value: n.key, done: !1 };
          return ((n = n.next), e);
        }
        return { value: void 0, done: !0 };
      },
    };
    return i;
  }
  values() {
    const e = this,
      t = this._state;
    let n = this._head;
    const i = {
      [Symbol.iterator]: () => i,
      next() {
        if (e._state !== t) throw new Error("LinkedMap got modified during iteration.");
        if (n) {
          const e = { value: n.value, done: !1 };
          return ((n = n.next), e);
        }
        return { value: void 0, done: !0 };
      },
    };
    return i;
  }
  entries() {
    const e = this,
      t = this._state;
    let n = this._head;
    const i = {
      [Symbol.iterator]: () => i,
      next() {
        if (e._state !== t) throw new Error("LinkedMap got modified during iteration.");
        if (n) {
          const e = { value: [n.key, n.value], done: !1 };
          return ((n = n.next), e);
        }
        return { value: void 0, done: !0 };
      },
    };
    return i;
  }
  [(($W = Symbol.toStringTag), Symbol.iterator)]() {
    return this.entries();
  }
  trimOld(e) {
    if (e >= this.size) return;
    if (0 === e) return void this.clear();
    let t = this._head,
      n = this.size;
    for (; t && n > e; ) (this._map.delete(t.key), (t = t.next), n--);
    ((this._head = t), (this._size = n), t && (t.previous = void 0), this._state++);
  }
  trimNew(e) {
    if (e >= this.size) return;
    if (0 === e) return void this.clear();
    let t = this._tail,
      n = this.size;
    for (; t && n > e; ) (this._map.delete(t.key), (t = t.previous), n--);
    ((this._tail = t), (this._size = n), t && (t.next = void 0), this._state++);
  }
  addItemFirst(e) {
    if (this._head || this._tail) {
      if (!this._head) throw new Error("Invalid list");
      ((e.next = this._head), (this._head.previous = e));
    } else this._tail = e;
    ((this._head = e), this._state++);
  }
  addItemLast(e) {
    if (this._head || this._tail) {
      if (!this._tail) throw new Error("Invalid list");
      ((e.previous = this._tail), (this._tail.next = e));
    } else this._head = e;
    ((this._tail = e), this._state++);
  }
  removeItem(e) {
    if (e === this._head && e === this._tail) ((this._head = void 0), (this._tail = void 0));
    else if (e === this._head) {
      if (!e.next) throw new Error("Invalid list");
      ((e.next.previous = void 0), (this._head = e.next));
    } else if (e === this._tail) {
      if (!e.previous) throw new Error("Invalid list");
      ((e.previous.next = void 0), (this._tail = e.previous));
    } else {
      const t = e.next,
        n = e.previous;
      if (!t || !n) throw new Error("Invalid list");
      ((t.previous = n), (n.next = t));
    }
    ((e.next = void 0), (e.previous = void 0), this._state++);
  }
  touch(e, t) {
    if (!this._head || !this._tail) throw new Error("Invalid list");
    if (1 === t || 2 === t)
      if (1 === t) {
        if (e === this._head) return;
        const t = e.next,
          n = e.previous;
        (e === this._tail
          ? ((n.next = void 0), (this._tail = n))
          : ((t.previous = n), (n.next = t)),
          (e.previous = void 0),
          (e.next = this._head),
          (this._head.previous = e),
          (this._head = e),
          this._state++);
      } else if (2 === t) {
        if (e === this._tail) return;
        const t = e.next,
          n = e.previous;
        (e === this._head
          ? ((t.previous = void 0), (this._head = t))
          : ((t.previous = n), (n.next = t)),
          (e.next = void 0),
          (e.previous = this._tail),
          (this._tail.next = e),
          (this._tail = e),
          this._state++);
      }
  }
  toJSON() {
    const e = [];
    return (
      this.forEach((t, n) => {
        e.push([n, t]);
      }),
      e
    );
  }
  fromJSON(e) {
    this.clear();
    for (const [t, n] of e) this.set(t, n);
  }
}
class YW extends ZW {
  constructor(e, t = 1) {
    (super(), (this._limit = e), (this._ratio = Math.min(Math.max(0, t), 1)));
  }
  get limit() {
    return this._limit;
  }
  set limit(e) {
    ((this._limit = e), this.checkTrim());
  }
  get(e, t = 2) {
    return super.get(e, t);
  }
  peek(e) {
    return super.get(e, 0);
  }
  set(e, t) {
    return (super.set(e, t, 2), this);
  }
  checkTrim() {
    this.size > this._limit && this.trim(Math.round(this._limit * this._ratio));
  }
}
class XW extends YW {
  constructor(e, t = 1) {
    super(e, t);
  }
  trim(e) {
    this.trimOld(e);
  }
  set(e, t) {
    return (super.set(e, t), this.checkTrim(), this);
  }
}
class QW {
  constructor(e) {
    if (((this._m1 = new Map()), (this._m2 = new Map()), e)) for (const [t, n] of e) this.set(t, n);
  }
  clear() {
    (this._m1.clear(), this._m2.clear());
  }
  set(e, t) {
    (this._m1.set(e, t), this._m2.set(t, e));
  }
  get(e) {
    return this._m1.get(e);
  }
  getKey(e) {
    return this._m2.get(e);
  }
  delete(e) {
    const t = this._m1.get(e);
    return void 0 !== t && (this._m1.delete(e), this._m2.delete(t), !0);
  }
  keys() {
    return this._m1.keys();
  }
  values() {
    return this._m1.values();
  }
}
class JW {
  constructor() {
    this.map = new Map();
  }
  add(e, t) {
    let n = this.map.get(e);
    (n || ((n = new Set()), this.map.set(e, n)), n.add(t));
  }
  delete(e, t) {
    const n = this.map.get(e);
    n && (n.delete(t), 0 === n.size && this.map.delete(e));
  }
  forEach(e, t) {
    const n = this.map.get(e);
    n && n.forEach(t);
  }
}
class eH {
  constructor() {
    this._data = new Map();
  }
  set(e, ...t) {
    let n = this._data;
    for (let i = 0; i < t.length - 1; i++)
      (n.has(t[i]) || n.set(t[i], new Map()), (n = n.get(t[i])));
    n.set(t[t.length - 1], e);
  }
  get(...e) {
    let t = this._data;
    for (let n = 0; n < e.length - 1; n++) {
      if (!t.has(e[n])) return;
      t = t.get(e[n]);
    }
    return t.get(e[e.length - 1]);
  }
  clear() {
    this._data.clear();
  }
  toString() {
    const e = (t, n) => {
      let i = "";
      for (const [r, o] of t)
        ((i += `${"  ".repeat(n)}${r}: `),
          o instanceof Map ? (i += "\n" + e(o, n + 1)) : (i += `${o}\n`));
      return i;
    };
    return e(this._data, 0);
  }
}
function tH(e) {
  return 47 === e || 92 === e;
}
function nH(e) {
  return e.replace(/[\\/]/g, nP.sep);
}
function iH(e, t = nP.sep) {
  if (!e) return "";
  const n = e.length,
    i = e.charCodeAt(0);
  if (tH(i)) {
    if (tH(e.charCodeAt(1)) && !tH(e.charCodeAt(2))) {
      let i = 3;
      const r = i;
      for (; i < n && !tH(e.charCodeAt(i)); i++);
      if (r !== i && !tH(e.charCodeAt(i + 1)))
        for (i += 1; i < n; i++)
          if (tH(e.charCodeAt(i))) return e.slice(0, i + 1).replace(/[\\/]/g, t);
    }
    return t;
  }
  if (oH(i) && 58 === e.charCodeAt(1))
    return tH(e.charCodeAt(2)) ? e.slice(0, 2) + t : e.slice(0, 2);
  let r = e.indexOf("://");
  if (-1 !== r) for (r += 3; r < n; r++) if (tH(e.charCodeAt(r))) return e.slice(0, r + 1);
  return "";
}
function rH(e, t, n, i = cP) {
  if (e === t) return !0;
  if (!e || !t) return !1;
  if (t.length > e.length) return !1;
  if (n) {
    if (!aA(e, t)) return !1;
    if (t.length === e.length) return !0;
    let n = t.length;
    return (t.charAt(t.length - 1) === i && n--, e.charAt(n) === i);
  }
  return (t.charAt(t.length - 1) !== i && (t += i), 0 === e.indexOf(t));
}
function oH(e) {
  return (e >= 65 && e <= 90) || (e >= 97 && e <= 122);
}
function sH(e) {
  return wP(e, !0);
}
const aH = new (class {
    constructor(e) {
      this._ignorePathCasing = e;
    }
    compare(e, t, n = !1) {
      return e === t ? 0 : JM(this.getComparisonKey(e, n), this.getComparisonKey(t, n));
    }
    isEqual(e, t, n = !1) {
      return (
        e === t || (!(!e || !t) && this.getComparisonKey(e, n) === this.getComparisonKey(t, n))
      );
    }
    getComparisonKey(e, t = !1) {
      return e
        .with({
          path: this._ignorePathCasing(e) ? e.path.toLowerCase() : void 0,
          fragment: t ? null : void 0,
        })
        .toString();
    }
    isEqualOrParent(e, t, n = !1) {
      if (e.scheme === t.scheme) {
        if (e.scheme === NP.file)
          return (
            rH(sH(e), sH(t), this._ignorePathCasing(e)) &&
            e.query === t.query &&
            (n || e.fragment === t.fragment)
          );
        if (_H(e.authority, t.authority))
          return (
            rH(e.path, t.path, this._ignorePathCasing(e), "/") &&
            e.query === t.query &&
            (n || e.fragment === t.fragment)
          );
      }
      return !1;
    }
    joinPath(e, ...t) {
      return mP.joinPath(e, ...t);
    }
    basenameOrAuthority(e) {
      return dH(e) || e.authority;
    }
    basename(e) {
      return nP.basename(e.path);
    }
    extname(e) {
      return nP.extname(e.path);
    }
    dirname(e) {
      if (0 === e.path.length) return e;
      let t;
      return (
        e.scheme === NP.file
          ? (t = mP.file(sP(sH(e))).path)
          : ((t = nP.dirname(e.path)),
            e.authority && t.length && 47 !== t.charCodeAt(0) && (t = "/")),
        e.with({ path: t })
      );
    }
    normalizePath(e) {
      if (!e.path.length) return e;
      let t;
      return (
        (t = e.scheme === NP.file ? mP.file(iP(sH(e))).path : nP.normalize(e.path)),
        e.with({ path: t })
      );
    }
    relativePath(e, t) {
      if (e.scheme !== t.scheme || !_H(e.authority, t.authority)) return;
      if (e.scheme === NP.file) {
        const n = oP(sH(e), sH(t));
        return AR ? nH(n) : n;
      }
      let n = e.path || "/";
      const i = t.path || "/";
      if (this._ignorePathCasing(e)) {
        let e = 0;
        for (
          const t = Math.min(n.length, i.length);
          e < t &&
          (n.charCodeAt(e) === i.charCodeAt(e) ||
            n.charAt(e).toLowerCase() === i.charAt(e).toLowerCase());
          e++
        );
        n = i.substr(0, e) + n.substr(e);
      }
      return nP.relative(n, i);
    }
    resolvePath(e, t) {
      if (e.scheme === NP.file) {
        const n = mP.file(rP(sH(e), t));
        return e.with({ authority: n.authority, path: n.path });
      }
      var n;
      return (
        -1 === (n = t).indexOf("/") && (n = nH(n)),
        /^[a-zA-Z]:(\/|$)/.test(n) && (n = "/" + n),
        (t = n),
        e.with({ path: nP.resolve(e.path, t) })
      );
    }
    isAbsolutePath(e) {
      return !!e.path && "/" === e.path[0];
    }
    isEqualAuthority(e, t) {
      return e === t || (void 0 !== e && void 0 !== t && sA(e, t));
    }
    hasTrailingPathSeparator(e, t = cP) {
      if (e.scheme === NP.file) {
        const n = sH(e);
        return n.length > iH(n).length && n[n.length - 1] === t;
      }
      {
        const t = e.path;
        return (
          t.length > 1 && 47 === t.charCodeAt(t.length - 1) && !/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)
        );
      }
    }
    removeTrailingPathSeparator(e, t = cP) {
      return vH(e, t) ? e.with({ path: e.path.substr(0, e.path.length - 1) }) : e;
    }
    addTrailingPathSeparator(e, t = cP) {
      let n = !1;
      if (e.scheme === NP.file) {
        const i = sH(e);
        n = void 0 !== i && i.length === iH(i).length && i[i.length - 1] === t;
      } else {
        t = "/";
        const i = e.path;
        n = 1 === i.length && 47 === i.charCodeAt(i.length - 1);
      }
      return n || vH(e, t) ? e : e.with({ path: e.path + "/" });
    }
  })(() => !1),
  lH = aH.isEqual.bind(aH);
(aH.isEqualOrParent.bind(aH), aH.getComparisonKey.bind(aH));
const cH = aH.basenameOrAuthority.bind(aH),
  dH = aH.basename.bind(aH),
  uH = aH.extname.bind(aH),
  hH = aH.dirname.bind(aH),
  gH = aH.joinPath.bind(aH),
  pH = aH.normalizePath.bind(aH),
  fH = aH.relativePath.bind(aH),
  mH = aH.resolvePath.bind(aH);
aH.isAbsolutePath.bind(aH);
const _H = aH.isEqualAuthority.bind(aH),
  vH = aH.hasTrailingPathSeparator.bind(aH);
var bH;
(aH.removeTrailingPathSeparator.bind(aH),
  aH.addTrailingPathSeparator.bind(aH),
  (function (e) {
    ((e.META_DATA_LABEL = "label"),
      (e.META_DATA_DESCRIPTION = "description"),
      (e.META_DATA_SIZE = "size"),
      (e.META_DATA_MIME = "mime"),
      (e.parseMetaData = function (t) {
        const n = new Map();
        t.path
          .substring(t.path.indexOf(";") + 1, t.path.lastIndexOf(";"))
          .split(";")
          .forEach((e) => {
            const [t, i] = e.split(":");
            t && i && n.set(t, i);
          });
        const i = t.path.substring(0, t.path.indexOf(";"));
        return (i && n.set(e.META_DATA_MIME, i), n);
      }));
  })(bH || (bH = {})));
const yH = bV("logService"),
  xH = bV("loggerService");
var wH;
!(function (e) {
  ((e[(e.Off = 0)] = "Off"),
    (e[(e.Trace = 1)] = "Trace"),
    (e[(e.Debug = 2)] = "Debug"),
    (e[(e.Info = 3)] = "Info"),
    (e[(e.Warning = 4)] = "Warning"),
    (e[(e.Error = 5)] = "Error"));
})(wH || (wH = {}));
const CH = wH.Info;
function SH(e, t) {
  return e !== wH.Off && e <= t;
}
class kH extends PO {
  constructor() {
    (super(...arguments),
      (this.level = CH),
      (this._onDidChangeLogLevel = this._register(new QO())));
  }
  get onDidChangeLogLevel() {
    return this._onDidChangeLogLevel.event;
  }
  setLevel(e) {
    this.level !== e && ((this.level = e), this._onDidChangeLogLevel.fire(this.level));
  }
  getLevel() {
    return this.level;
  }
  checkLogLevel(e) {
    return SH(this.level, e);
  }
  canLog(e) {
    return !this._store.isDisposed && this.checkLogLevel(e);
  }
}
class EH extends kH {
  constructor(e = CH, t = !0) {
    (super(), (this.useColors = t), this.setLevel(e));
  }
  trace(e, ...t) {
    this.canLog(wH.Trace) && this.useColors;
  }
  debug(e, ...t) {
    this.canLog(wH.Debug) && this.useColors;
  }
  info(e, ...t) {
    this.canLog(wH.Info) && this.useColors;
  }
  warn(e, ...t) {
    this.canLog(wH.Warning) && this.useColors;
  }
  error(e, ...t) {
    this.canLog(wH.Error) && this.useColors;
  }
}
class NH extends kH {
  constructor(e) {
    (super(), (this.loggers = e), e.length && this.setLevel(e[0].getLevel()));
  }
  setLevel(e) {
    for (const t of this.loggers) t.setLevel(e);
    super.setLevel(e);
  }
  trace(e, ...t) {
    for (const n of this.loggers) n.trace(e, ...t);
  }
  debug(e, ...t) {
    for (const n of this.loggers) n.debug(e, ...t);
  }
  info(e, ...t) {
    for (const n of this.loggers) n.info(e, ...t);
  }
  warn(e, ...t) {
    for (const n of this.loggers) n.warn(e, ...t);
  }
  error(e, ...t) {
    for (const n of this.loggers) n.error(e, ...t);
  }
  dispose() {
    for (const e of this.loggers) e.dispose();
    super.dispose();
  }
}
class LH extends PO {
  constructor(e, t, n) {
    if (
      (super(),
      (this.logLevel = e),
      (this.logsHome = t),
      (this._loggers = new KW()),
      (this._onDidChangeLoggers = this._register(new QO())),
      (this._onDidChangeVisibility = this._register(new QO())),
      n)
    )
      for (const i of n) this._loggers.set(i.resource, { logger: void 0, info: i });
  }
  getLoggerEntry(e) {
    return oR(e) ? [...this._loggers.values()].find((t) => t.info.id === e) : this._loggers.get(e);
  }
  createLogger(e, t) {
    const n = this.toResource(e),
      i = oR(e) ? e : (t?.id ?? UP(n.toString()).toString(16));
    let r = this._loggers.get(n)?.logger;
    const o = "always" === t?.logLevel ? wH.Trace : t?.logLevel;
    r || (r = this.doCreateLogger(n, o ?? this.getLogLevel(n) ?? this.logLevel, { ...t, id: i }));
    const s = {
      logger: r,
      info: {
        resource: n,
        id: i,
        logLevel: o,
        name: t?.name,
        hidden: t?.hidden,
        group: t?.group,
        extensionId: t?.extensionId,
        when: t?.when,
      },
    };
    return (this.registerLogger(s.info), this._loggers.set(n, s), r);
  }
  toResource(e) {
    return oR(e) ? gH(this.logsHome, `${e}.log`) : e;
  }
  setVisibility(e, t) {
    const n = this.getLoggerEntry(e);
    n &&
      t !== !n.info.hidden &&
      ((n.info.hidden = !t),
      this._loggers.set(n.info.resource, n),
      this._onDidChangeVisibility.fire([n.info.resource, t]));
  }
  getLogLevel(e) {
    let t;
    return (e && (t = this._loggers.get(e)?.info.logLevel), t ?? this.logLevel);
  }
  registerLogger(e) {
    const t = this._loggers.get(e.resource);
    t
      ? t.info.hidden !== e.hidden && this.setVisibility(e.resource, !e.hidden)
      : (this._loggers.set(e.resource, { info: e, logger: void 0 }),
        this._onDidChangeLoggers.fire({ added: [e], removed: [] }));
  }
  dispose() {
    (this._loggers.forEach((e) => e.logger?.dispose()), this._loggers.clear(), super.dispose());
  }
}
class DH {
  constructor() {
    this.onDidChangeLogLevel = new QO().event;
  }
  setLevel(e) {}
  getLevel() {
    return wH.Info;
  }
  trace(e, ...t) {}
  debug(e, ...t) {}
  info(e, ...t) {}
  warn(e, ...t) {}
  error(e, ...t) {}
  dispose() {}
}
new yW(
  "logLevel",
  (function (e) {
    switch (e) {
      case wH.Trace:
        return "trace";
      case wH.Debug:
        return "debug";
      case wH.Info:
        return "info";
      case wH.Warning:
        return "warn";
      case wH.Error:
        return "error";
      case wH.Off:
        return "off";
    }
  })(wH.Info),
);
class TH {
  static {
    this.REGISTERED_COMMANDS = new Set();
  }
  static getRegisteredCommands() {
    return [...TH.REGISTERED_COMMANDS];
  }
  static registerCommand(e) {
    TH.REGISTERED_COMMANDS.add(e);
  }
}
let IH = class {
  constructor(e) {
    ((this.id = e.id),
      (this.precondition = e.precondition),
      (this._kbOpts = e.kbOpts),
      (this._menuOpts = e.menuOpts),
      (this.metadata = e.metadata),
      (this.canTriggerInlineEdits = e.canTriggerInlineEdits));
  }
  register() {
    if (
      (Array.isArray(this._menuOpts)
        ? this._menuOpts.forEach(this._registerMenuItem, this)
        : this._menuOpts && this._registerMenuItem(this._menuOpts),
      this._kbOpts)
    ) {
      const e = Array.isArray(this._kbOpts) ? this._kbOpts : [this._kbOpts];
      for (const t of e) {
        let e = t.kbExpr;
        this.precondition && (e = e ? eW.and(e, this.precondition) : this.precondition);
        const n = {
          id: this.id,
          weight: t.weight,
          args: t.args,
          when: e,
          primary: t.primary,
          secondary: t.secondary,
          win: t.win,
          linux: t.linux,
          mac: t.mac,
        };
        DW.registerKeybindingRule(n);
      }
    }
    (jV.registerCommand({
      id: this.id,
      handler: (e, t) => this.runCommand(e, t),
      metadata: this.metadata,
    }),
      this.canTriggerInlineEdits && TH.registerCommand(this.id));
  }
  _registerMenuItem(e) {
    jW.appendMenuItem(e.menuId, {
      group: e.group,
      command: { id: this.id, title: e.title, icon: e.icon, precondition: this.precondition },
      when: e.when,
      order: e.order,
    });
  }
};
class RH extends IH {
  constructor() {
    (super(...arguments), (this._implementations = []));
  }
  addImplementation(e, t, n, i) {
    return (
      this._implementations.push({ priority: e, name: t, implementation: n, when: i }),
      this._implementations.sort((e, t) => t.priority - e.priority),
      {
        dispose: () => {
          for (let e = 0; e < this._implementations.length; e++)
            if (this._implementations[e].implementation === n)
              return void this._implementations.splice(e, 1);
        },
      }
    );
  }
  runCommand(e, t) {
    const n = e.get(yH),
      i = e.get(xW);
    n.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);
    for (const r of this._implementations) {
      if (r.when) {
        const e = i.getContext(vB());
        if (!r.when.evaluate(e)) continue;
      }
      const o = r.implementation(e, t);
      if (o) {
        if ((n.trace(`Command '${this.id}' was handled by '${r.name}'.`), "boolean" == typeof o))
          return;
        return o;
      }
    }
    n.trace(`The Command '${this.id}' was not handled by any implementation.`);
  }
}
class OH extends IH {
  constructor(e, t) {
    (super(t), (this.command = e));
  }
  runCommand(e, t) {
    return this.command.runCommand(e, t);
  }
}
class MH extends IH {
  static bindToContribution(e) {
    return class extends MH {
      constructor(e) {
        (super(e), (this._callback = e.handler));
      }
      runEditorCommand(t, n, i) {
        const r = e(n);
        r && this._callback(r, i);
      }
    };
  }
  static runEditorCommand(e, t, n, i) {
    const r = e.get(yV),
      o = r.getFocusedCodeEditor() || r.getActiveCodeEditor();
    if (o)
      return o.invokeWithinContext((e) => {
        if (e.get(xW).contextMatchesRules(n ?? void 0)) return i(e, o, t);
      });
  }
  runCommand(e, t) {
    return MH.runEditorCommand(e, t, this.precondition, (e, t, n) =>
      this.runEditorCommand(e, t, n),
    );
  }
}
class AH extends MH {
  static convertOptions(e) {
    let t;
    function n(t) {
      return (
        t.menuId || (t.menuId = MW.EditorContext),
        t.title || (t.title = "string" == typeof e.label ? e.label : e.label.value),
        (t.when = eW.and(e.precondition, t.when)),
        t
      );
    }
    return (
      (t = Array.isArray(e.menuOpts) ? e.menuOpts : e.menuOpts ? [e.menuOpts] : []),
      Array.isArray(e.contextMenuOpts)
        ? t.push(...e.contextMenuOpts.map(n))
        : e.contextMenuOpts && t.push(n(e.contextMenuOpts)),
      (e.menuOpts = t),
      e
    );
  }
  constructor(e) {
    (super(AH.convertOptions(e)),
      "string" == typeof e.label
        ? ((this.label = e.label), (this.alias = e.alias ?? e.label))
        : ((this.label = e.label.value), (this.alias = e.alias ?? e.label.original)));
  }
  runEditorCommand(e, t, n) {
    return (this.reportTelemetry(e, t), this.run(e, t, n || {}));
  }
  reportTelemetry(e, t) {
    e.get(HW).publicLog2("editorActionInvoked", { name: this.label, id: this.id });
  }
}
class PH extends AH {
  constructor() {
    (super(...arguments), (this._implementations = []));
  }
  addImplementation(e, t) {
    return (
      this._implementations.push([e, t]),
      this._implementations.sort((e, t) => t[0] - e[0]),
      {
        dispose: () => {
          for (let e = 0; e < this._implementations.length; e++)
            if (this._implementations[e][1] === t) return void this._implementations.splice(e, 1);
        },
      }
    );
  }
  run(e, t, n) {
    for (const i of this._implementations) {
      const r = i[1](e, t, n);
      if (r) {
        if ("boolean" == typeof r) return;
        return r;
      }
    }
  }
}
class jH extends VW {
  run(e, ...t) {
    const n = e.get(yV),
      i = n.getFocusedCodeEditor() || n.getActiveCodeEditor();
    if (i)
      return i.invokeWithinContext((e) => {
        const n = e.get(xW),
          r = e.get(yH);
        if (n.contextMatchesRules(this.desc.precondition ?? void 0))
          return this.runEditorCommand(e, i, ...t);
        r.debug(
          "[EditorAction2] NOT running command because its precondition is FALSE",
          this.desc.id,
          this.desc.precondition?.serialize(),
        );
      });
  }
}
function FH(e, t) {
  jV.registerCommand(e, function (e, ...n) {
    const i = e.get(vV),
      [r, o] = n;
    (pR(mP.isUri(r)), pR(xV.isIPosition(o)));
    const s = e.get(wV).getModel(r);
    if (s) {
      const e = xV.lift(o);
      return i.invokeFunction(t, s, e, ...n.slice(2));
    }
    return e
      .get(CV)
      .createModelReference(r)
      .then((e) =>
        new Promise((r, s) => {
          try {
            r(i.invokeFunction(t, e.object.textEditorModel, xV.lift(o), n.slice(2)));
          } catch (a) {
            s(a);
          }
        }).finally(() => {
          e.dispose();
        }),
      );
  });
}
function BH(e) {
  return ($H.INSTANCE.registerEditorCommand(e), e);
}
function VH(e) {
  const t = new e();
  return ($H.INSTANCE.registerEditorAction(t), t);
}
function WH(e) {
  return ($H.INSTANCE.registerEditorAction(e), e);
}
function HH(e) {
  $H.INSTANCE.registerEditorAction(e);
}
function zH(e, t, n) {
  $H.INSTANCE.registerEditorContribution(e, t, n);
}
var UH;
!(function (e) {
  ((e.getEditorCommand = function (e) {
    return $H.INSTANCE.getEditorCommand(e);
  }),
    (e.getEditorActions = function () {
      return $H.INSTANCE.getEditorActions();
    }),
    (e.getEditorContributions = function () {
      return $H.INSTANCE.getEditorContributions();
    }),
    (e.getSomeEditorContributions = function (e) {
      return $H.INSTANCE.getEditorContributions().filter((t) => e.indexOf(t.id) >= 0);
    }),
    (e.getDiffEditorContributions = function () {
      return $H.INSTANCE.getDiffEditorContributions();
    }));
})(UH || (UH = {}));
class $H {
  static {
    this.INSTANCE = new $H();
  }
  constructor() {
    ((this.editorContributions = []),
      (this.diffEditorContributions = []),
      (this.editorActions = []),
      (this.editorCommands = Object.create(null)));
  }
  registerEditorContribution(e, t, n) {
    this.editorContributions.push({ id: e, ctor: t, instantiation: n });
  }
  getEditorContributions() {
    return this.editorContributions.slice(0);
  }
  getDiffEditorContributions() {
    return this.diffEditorContributions.slice(0);
  }
  registerEditorAction(e) {
    (e.register(), this.editorActions.push(e));
  }
  getEditorActions() {
    return this.editorActions;
  }
  registerEditorCommand(e) {
    (e.register(), (this.editorCommands[e.id] = e));
  }
  getEditorCommand(e) {
    return this.editorCommands[e] || null;
  }
}
function qH(e) {
  return (e.register(), e);
}
NW.add("editor.contributions", $H.INSTANCE);
const KH = qH(
  new RH({
    id: "undo",
    precondition: void 0,
    kbOpts: { weight: 0, primary: 2104 },
    menuOpts: [
      { menuId: MW.MenubarEditMenu, group: "1_do", title: SI(69, "&&Undo"), order: 1 },
      { menuId: MW.CommandPalette, group: "", title: SI(70, "Undo"), order: 1 },
      { menuId: MW.SimpleEditorContext, group: "1_do", title: SI(71, "Undo"), order: 1 },
    ],
  }),
);
qH(new OH(KH, { id: "default:undo", precondition: void 0 }));
const GH = qH(
  new RH({
    id: "redo",
    precondition: void 0,
    kbOpts: { weight: 0, primary: 2103, secondary: [3128], mac: { primary: 3128 } },
    menuOpts: [
      { menuId: MW.MenubarEditMenu, group: "1_do", title: SI(72, "&&Redo"), order: 2 },
      { menuId: MW.CommandPalette, group: "", title: SI(73, "Redo"), order: 1 },
      { menuId: MW.SimpleEditorContext, group: "1_do", title: SI(74, "Redo"), order: 2 },
    ],
  }),
);
qH(new OH(GH, { id: "default:redo", precondition: void 0 }));
const ZH = qH(
  new RH({
    id: "editor.action.selectAll",
    precondition: void 0,
    kbOpts: { weight: 0, kbExpr: null, primary: 2079 },
    menuOpts: [
      {
        menuId: MW.MenubarSelectionMenu,
        group: "1_basic",
        title: SI(75, "&&Select All"),
        order: 1,
      },
      { menuId: MW.CommandPalette, group: "", title: SI(76, "Select All"), order: 1 },
      { menuId: MW.SimpleEditorContext, group: "9_select", title: SI(77, "Select All"), order: 1 },
    ],
  }),
);
let YH = class e {
    constructor(e, t, n, i) {
      e > n || (e === n && t > i)
        ? ((this.startLineNumber = n),
          (this.startColumn = i),
          (this.endLineNumber = e),
          (this.endColumn = t))
        : ((this.startLineNumber = e),
          (this.startColumn = t),
          (this.endLineNumber = n),
          (this.endColumn = i));
    }
    isEmpty() {
      return e.isEmpty(this);
    }
    static isEmpty(e) {
      return e.startLineNumber === e.endLineNumber && e.startColumn === e.endColumn;
    }
    containsPosition(t) {
      return e.containsPosition(this, t);
    }
    static containsPosition(e, t) {
      return (
        !(t.lineNumber < e.startLineNumber || t.lineNumber > e.endLineNumber) &&
        !(t.lineNumber === e.startLineNumber && t.column < e.startColumn) &&
        !(t.lineNumber === e.endLineNumber && t.column > e.endColumn)
      );
    }
    static strictContainsPosition(e, t) {
      return (
        !(t.lineNumber < e.startLineNumber || t.lineNumber > e.endLineNumber) &&
        !(t.lineNumber === e.startLineNumber && t.column <= e.startColumn) &&
        !(t.lineNumber === e.endLineNumber && t.column >= e.endColumn)
      );
    }
    containsRange(t) {
      return e.containsRange(this, t);
    }
    static containsRange(e, t) {
      return (
        !(t.startLineNumber < e.startLineNumber || t.endLineNumber < e.startLineNumber) &&
        !(t.startLineNumber > e.endLineNumber || t.endLineNumber > e.endLineNumber) &&
        !(t.startLineNumber === e.startLineNumber && t.startColumn < e.startColumn) &&
        !(t.endLineNumber === e.endLineNumber && t.endColumn > e.endColumn)
      );
    }
    strictContainsRange(t) {
      return e.strictContainsRange(this, t);
    }
    static strictContainsRange(e, t) {
      return (
        !(t.startLineNumber < e.startLineNumber || t.endLineNumber < e.startLineNumber) &&
        !(t.startLineNumber > e.endLineNumber || t.endLineNumber > e.endLineNumber) &&
        !(t.startLineNumber === e.startLineNumber && t.startColumn <= e.startColumn) &&
        !(t.endLineNumber === e.endLineNumber && t.endColumn >= e.endColumn)
      );
    }
    plusRange(t) {
      return e.plusRange(this, t);
    }
    static plusRange(t, n) {
      let i, r, o, s;
      return (
        n.startLineNumber < t.startLineNumber
          ? ((i = n.startLineNumber), (r = n.startColumn))
          : n.startLineNumber === t.startLineNumber
            ? ((i = n.startLineNumber), (r = Math.min(n.startColumn, t.startColumn)))
            : ((i = t.startLineNumber), (r = t.startColumn)),
        n.endLineNumber > t.endLineNumber
          ? ((o = n.endLineNumber), (s = n.endColumn))
          : n.endLineNumber === t.endLineNumber
            ? ((o = n.endLineNumber), (s = Math.max(n.endColumn, t.endColumn)))
            : ((o = t.endLineNumber), (s = t.endColumn)),
        new e(i, r, o, s)
      );
    }
    intersectRanges(t) {
      return e.intersectRanges(this, t);
    }
    static intersectRanges(t, n) {
      let i = t.startLineNumber,
        r = t.startColumn,
        o = t.endLineNumber,
        s = t.endColumn;
      const a = n.startLineNumber,
        l = n.startColumn,
        c = n.endLineNumber,
        d = n.endColumn;
      return (
        i < a ? ((i = a), (r = l)) : i === a && (r = Math.max(r, l)),
        o > c ? ((o = c), (s = d)) : o === c && (s = Math.min(s, d)),
        i > o || (i === o && r > s) ? null : new e(i, r, o, s)
      );
    }
    equalsRange(t) {
      return e.equalsRange(this, t);
    }
    static equalsRange(e, t) {
      return (
        (!e && !t) ||
        (!!e &&
          !!t &&
          e.startLineNumber === t.startLineNumber &&
          e.startColumn === t.startColumn &&
          e.endLineNumber === t.endLineNumber &&
          e.endColumn === t.endColumn)
      );
    }
    getEndPosition() {
      return e.getEndPosition(this);
    }
    static getEndPosition(e) {
      return new xV(e.endLineNumber, e.endColumn);
    }
    getStartPosition() {
      return e.getStartPosition(this);
    }
    static getStartPosition(e) {
      return new xV(e.startLineNumber, e.startColumn);
    }
    toString() {
      return (
        "[" +
        this.startLineNumber +
        "," +
        this.startColumn +
        " -> " +
        this.endLineNumber +
        "," +
        this.endColumn +
        "]"
      );
    }
    setEndPosition(t, n) {
      return new e(this.startLineNumber, this.startColumn, t, n);
    }
    setStartPosition(t, n) {
      return new e(t, n, this.endLineNumber, this.endColumn);
    }
    collapseToStart() {
      return e.collapseToStart(this);
    }
    static collapseToStart(t) {
      return new e(t.startLineNumber, t.startColumn, t.startLineNumber, t.startColumn);
    }
    collapseToEnd() {
      return e.collapseToEnd(this);
    }
    static collapseToEnd(t) {
      return new e(t.endLineNumber, t.endColumn, t.endLineNumber, t.endColumn);
    }
    delta(t) {
      return new e(
        this.startLineNumber + t,
        this.startColumn,
        this.endLineNumber + t,
        this.endColumn,
      );
    }
    isSingleLine() {
      return this.startLineNumber === this.endLineNumber;
    }
    static fromPositions(t, n = t) {
      return new e(t.lineNumber, t.column, n.lineNumber, n.column);
    }
    static lift(t) {
      return t ? new e(t.startLineNumber, t.startColumn, t.endLineNumber, t.endColumn) : null;
    }
    static isIRange(e) {
      return (
        !!e &&
        "number" == typeof e.startLineNumber &&
        "number" == typeof e.startColumn &&
        "number" == typeof e.endLineNumber &&
        "number" == typeof e.endColumn
      );
    }
    static areIntersectingOrTouching(e, t) {
      return (
        !(
          e.endLineNumber < t.startLineNumber ||
          (e.endLineNumber === t.startLineNumber && e.endColumn < t.startColumn)
        ) &&
        !(
          t.endLineNumber < e.startLineNumber ||
          (t.endLineNumber === e.startLineNumber && t.endColumn < e.startColumn)
        )
      );
    }
    static areIntersecting(e, t) {
      return (
        !(
          e.endLineNumber < t.startLineNumber ||
          (e.endLineNumber === t.startLineNumber && e.endColumn <= t.startColumn)
        ) &&
        !(
          t.endLineNumber < e.startLineNumber ||
          (t.endLineNumber === e.startLineNumber && t.endColumn <= e.startColumn)
        )
      );
    }
    static areOnlyIntersecting(e, t) {
      return (
        !(
          e.endLineNumber < t.startLineNumber - 1 ||
          (e.endLineNumber === t.startLineNumber && e.endColumn < t.startColumn - 1)
        ) &&
        !(
          t.endLineNumber < e.startLineNumber - 1 ||
          (t.endLineNumber === e.startLineNumber && t.endColumn < e.startColumn - 1)
        )
      );
    }
    static compareRangesUsingStarts(e, t) {
      if (e && t) {
        const n = 0 | e.startLineNumber,
          i = 0 | t.startLineNumber;
        if (n === i) {
          const n = 0 | e.startColumn,
            i = 0 | t.startColumn;
          if (n === i) {
            const n = 0 | e.endLineNumber,
              i = 0 | t.endLineNumber;
            if (n === i) {
              return (0 | e.endColumn) - (0 | t.endColumn);
            }
            return n - i;
          }
          return n - i;
        }
        return n - i;
      }
      return (e ? 1 : 0) - (t ? 1 : 0);
    }
    static compareRangesUsingEnds(e, t) {
      return e.endLineNumber === t.endLineNumber
        ? e.endColumn === t.endColumn
          ? e.startLineNumber === t.startLineNumber
            ? e.startColumn - t.startColumn
            : e.startLineNumber - t.startLineNumber
          : e.endColumn - t.endColumn
        : e.endLineNumber - t.endLineNumber;
    }
    static spansMultipleLines(e) {
      return e.endLineNumber > e.startLineNumber;
    }
    toJSON() {
      return this;
    }
  },
  XH = class e extends YH {
    constructor(e, t, n, i) {
      (super(e, t, n, i),
        (this.selectionStartLineNumber = e),
        (this.selectionStartColumn = t),
        (this.positionLineNumber = n),
        (this.positionColumn = i));
    }
    toString() {
      return (
        "[" +
        this.selectionStartLineNumber +
        "," +
        this.selectionStartColumn +
        " -> " +
        this.positionLineNumber +
        "," +
        this.positionColumn +
        "]"
      );
    }
    equalsSelection(t) {
      return e.selectionsEqual(this, t);
    }
    static selectionsEqual(e, t) {
      return (
        e.selectionStartLineNumber === t.selectionStartLineNumber &&
        e.selectionStartColumn === t.selectionStartColumn &&
        e.positionLineNumber === t.positionLineNumber &&
        e.positionColumn === t.positionColumn
      );
    }
    getDirection() {
      return this.selectionStartLineNumber === this.startLineNumber &&
        this.selectionStartColumn === this.startColumn
        ? 0
        : 1;
    }
    setEndPosition(t, n) {
      return 0 === this.getDirection()
        ? new e(this.startLineNumber, this.startColumn, t, n)
        : new e(t, n, this.startLineNumber, this.startColumn);
    }
    getPosition() {
      return new xV(this.positionLineNumber, this.positionColumn);
    }
    getSelectionStart() {
      return new xV(this.selectionStartLineNumber, this.selectionStartColumn);
    }
    setStartPosition(t, n) {
      return 0 === this.getDirection()
        ? new e(t, n, this.endLineNumber, this.endColumn)
        : new e(this.endLineNumber, this.endColumn, t, n);
    }
    static fromPositions(t, n = t) {
      return new e(t.lineNumber, t.column, n.lineNumber, n.column);
    }
    static fromRange(t, n) {
      return 0 === n
        ? new e(t.startLineNumber, t.startColumn, t.endLineNumber, t.endColumn)
        : new e(t.endLineNumber, t.endColumn, t.startLineNumber, t.startColumn);
    }
    static liftSelection(t) {
      return new e(
        t.selectionStartLineNumber,
        t.selectionStartColumn,
        t.positionLineNumber,
        t.positionColumn,
      );
    }
    static selectionsArrEqual(e, t) {
      if ((e && !t) || (!e && t)) return !1;
      if (!e && !t) return !0;
      if (e.length !== t.length) return !1;
      for (let n = 0, i = e.length; n < i; n++) if (!this.selectionsEqual(e[n], t[n])) return !1;
      return !0;
    }
    static isISelection(e) {
      return (
        !!e &&
        "number" == typeof e.selectionStartLineNumber &&
        "number" == typeof e.selectionStartColumn &&
        "number" == typeof e.positionLineNumber &&
        "number" == typeof e.positionColumn
      );
    }
    static createWithDirection(t, n, i, r, o) {
      return 0 === o ? new e(t, n, i, r) : new e(i, r, t, n);
    }
  };
function QH(e, t) {
  const n = e.getCount(),
    i = e.findTokenIndexAtOffset(t),
    r = e.getLanguageId(i);
  let o = i;
  for (; o + 1 < n && e.getLanguageId(o + 1) === r; ) o++;
  let s = i;
  for (; s > 0 && e.getLanguageId(s - 1) === r; ) s--;
  return new JH(e, r, s, o + 1, e.getStartOffset(s), e.getEndOffset(o));
}
class JH {
  constructor(e, t, n, i, r, o) {
    ((this._scopedLineTokensBrand = void 0),
      (this._actual = e),
      (this.languageId = t),
      (this._firstTokenIndex = n),
      (this._lastTokenIndex = i),
      (this.firstCharOffset = r),
      (this._lastCharOffset = o),
      (this.languageIdCodec = e.languageIdCodec));
  }
  getLineContent() {
    return this._actual.getLineContent().substring(this.firstCharOffset, this._lastCharOffset);
  }
  getLineLength() {
    return this._lastCharOffset - this.firstCharOffset;
  }
  getActualLineContentBefore(e) {
    return this._actual.getLineContent().substring(0, this.firstCharOffset + e);
  }
  getTokenCount() {
    return this._lastTokenIndex - this._firstTokenIndex;
  }
  findTokenIndexAtOffset(e) {
    return this._actual.findTokenIndexAtOffset(e + this.firstCharOffset) - this._firstTokenIndex;
  }
  getStandardTokenType(e) {
    return this._actual.getStandardTokenType(e + this._firstTokenIndex);
  }
  toIViewLineTokens() {
    return this._actual.sliceAndInflate(this.firstCharOffset, this._lastCharOffset, 0);
  }
}
function ez(e) {
  return !!(3 & e);
}
class tz {
  static _nextVisibleColumn(e, t, n) {
    return 9 === e ? tz.nextRenderTabStop(t, n) : kA(e) || EA(e) ? t + 2 : t + 1;
  }
  static visibleColumnFromColumn(e, t, n) {
    const i = Math.min(t - 1, e.length),
      r = e.substring(0, i),
      o = new mA(r);
    let s = 0;
    for (; !o.eol(); ) {
      const e = pA(r, i, o.offset);
      (o.nextGraphemeLength(), (s = this._nextVisibleColumn(e, s, n)));
    }
    return s;
  }
  static columnFromVisibleColumn(e, t, n) {
    if (t <= 0) return 1;
    const i = e.length,
      r = new mA(e);
    let o = 0,
      s = 1;
    for (; !r.eol(); ) {
      const a = pA(e, i, r.offset);
      r.nextGraphemeLength();
      const l = this._nextVisibleColumn(a, o, n),
        c = r.offset + 1;
      if (l >= t) {
        return l - t < t - o ? c : s;
      }
      ((o = l), (s = c));
    }
    return i + 1;
  }
  static nextRenderTabStop(e, t) {
    return e + t - (e % t);
  }
  static nextIndentTabStop(e, t) {
    return tz.nextRenderTabStop(e, t);
  }
  static prevRenderTabStop(e, t) {
    return Math.max(0, e - 1 - ((e - 1) % t));
  }
  static prevIndentTabStop(e, t) {
    return tz.prevRenderTabStop(e, t);
  }
}
function nz(e, t, n) {
  let i = YM(e);
  return (
    -1 === i && (i = e.length),
    (function (e, t, n) {
      let i = 0;
      for (let o = 0; o < e.length; o++)
        "\t" === e.charAt(o) ? (i = tz.nextIndentTabStop(i, t)) : i++;
      let r = "";
      if (!n) {
        const e = Math.floor(i / t);
        i %= t;
        for (let t = 0; t < e; t++) r += "\t";
      }
      for (let o = 0; o < i; o++) r += " ";
      return r;
    })(e.substring(0, i), t, n) + e.substring(i)
  );
}
const iz = new (class {
    constructor() {
      ((this._inputMode = "insert"),
        (this._onDidChangeInputMode = new QO()),
        (this.onDidChangeInputMode = this._onDidChangeInputMode.event));
    }
    getInputMode() {
      return this._inputMode;
    }
  })(),
  rz = () => !0,
  oz = () => !1,
  sz = (e) => " " === e || "\t" === e;
class az {
  static shouldRecreate(e) {
    return (
      e.hasChanged(165) ||
      e.hasChanged(148) ||
      e.hasChanged(45) ||
      e.hasChanged(85) ||
      e.hasChanged(88) ||
      e.hasChanged(89) ||
      e.hasChanged(10) ||
      e.hasChanged(11) ||
      e.hasChanged(15) ||
      e.hasChanged(13) ||
      e.hasChanged(14) ||
      e.hasChanged(20) ||
      e.hasChanged(145) ||
      e.hasChanged(141) ||
      e.hasChanged(59) ||
      e.hasChanged(104) ||
      e.hasChanged(147) ||
      e.hasChanged(93)
    );
  }
  constructor(e, t, n, i) {
    ((this.languageConfigurationService = i),
      (this._cursorMoveConfigurationBrand = void 0),
      (this._languageId = e));
    const r = n.options,
      o = r.get(165),
      s = r.get(59);
    ((this.readOnly = r.get(104)),
      (this.tabSize = t.tabSize),
      (this.indentSize = t.indentSize),
      (this.insertSpaces = t.insertSpaces),
      (this.stickyTabStops = r.get(132)),
      (this.lineHeight = s.lineHeight),
      (this.typicalHalfwidthCharacterWidth = s.typicalHalfwidthCharacterWidth),
      (this.pageSize = Math.max(1, Math.floor(o.height / this.lineHeight) - 2)),
      (this.useTabStops = r.get(145)),
      (this.trimWhitespaceOnDelete = r.get(141)),
      (this.wordSeparators = r.get(148)),
      (this.emptySelectionClipboard = r.get(45)),
      (this.copyWithSyntaxHighlighting = r.get(31)),
      (this.multiCursorMergeOverlapping = r.get(85)),
      (this.multiCursorPaste = r.get(88)),
      (this.multiCursorLimit = r.get(89)),
      (this.autoClosingBrackets = r.get(10)),
      (this.autoClosingComments = r.get(11)),
      (this.autoClosingQuotes = r.get(15)),
      (this.autoClosingDelete = r.get(13)),
      (this.autoClosingOvertype = r.get(14)),
      (this.autoSurround = r.get(20)),
      (this.autoIndent = r.get(16)),
      (this.wordSegmenterLocales = r.get(147)),
      (this.overtypeOnPaste = r.get(93)),
      (this.surroundingPairs = {}),
      (this._electricChars = null),
      (this.shouldAutoCloseBefore = {
        quote: this._getShouldAutoClose(e, this.autoClosingQuotes, !0),
        comment: this._getShouldAutoClose(e, this.autoClosingComments, !1),
        bracket: this._getShouldAutoClose(e, this.autoClosingBrackets, !1),
      }),
      (this.autoClosingPairs = this.languageConfigurationService
        .getLanguageConfiguration(e)
        .getAutoClosingPairs()));
    const a = this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();
    if (a) for (const c of a) this.surroundingPairs[c.open] = c.close;
    const l = this.languageConfigurationService.getLanguageConfiguration(e).comments;
    this.blockCommentStartToken = l?.blockCommentStartToken ?? null;
  }
  get electricChars() {
    if (!this._electricChars) {
      this._electricChars = {};
      const e = this.languageConfigurationService
        .getLanguageConfiguration(this._languageId)
        .electricCharacter?.getElectricCharacters();
      if (e) for (const t of e) this._electricChars[t] = !0;
    }
    return this._electricChars;
  }
  get inputMode() {
    return iz.getInputMode();
  }
  onElectricCharacter(e, t, n) {
    const i = QH(t, n - 1),
      r = this.languageConfigurationService.getLanguageConfiguration(
        i.languageId,
      ).electricCharacter;
    return r ? r.onElectricCharacter(e, i, n - i.firstCharOffset) : null;
  }
  normalizeIndentation(e) {
    return nz(e, this.indentSize, this.insertSpaces);
  }
  _getShouldAutoClose(e, t, n) {
    switch (t) {
      case "beforeWhitespace":
        return sz;
      case "languageDefined":
        return this._getLanguageDefinedShouldAutoClose(e, n);
      case "always":
        return rz;
      case "never":
        return oz;
    }
  }
  _getLanguageDefinedShouldAutoClose(e, t) {
    const n = this.languageConfigurationService
      .getLanguageConfiguration(e)
      .getAutoCloseBeforeSet(t);
    return (e) => -1 !== n.indexOf(e);
  }
  visibleColumnFromColumn(e, t) {
    return tz.visibleColumnFromColumn(e.getLineContent(t.lineNumber), t.column, this.tabSize);
  }
  columnFromVisibleColumn(e, t, n) {
    const i = tz.columnFromVisibleColumn(e.getLineContent(t), n, this.tabSize),
      r = e.getLineMinColumn(t);
    if (i < r) return r;
    const o = e.getLineMaxColumn(t);
    return i > o ? o : i;
  }
}
let lz = class e {
  static fromModelState(e) {
    return new cz(e);
  }
  static fromViewState(e) {
    return new dz(e);
  }
  static fromModelSelection(t) {
    const n = XH.liftSelection(t),
      i = new uz(YH.fromPositions(n.getSelectionStart()), 0, 0, n.getPosition(), 0);
    return e.fromModelState(i);
  }
  static fromModelSelections(e) {
    const t = [];
    for (let n = 0, i = e.length; n < i; n++) t[n] = this.fromModelSelection(e[n]);
    return t;
  }
  constructor(e, t) {
    ((this._cursorStateBrand = void 0), (this.modelState = e), (this.viewState = t));
  }
  equals(e) {
    return this.viewState.equals(e.viewState) && this.modelState.equals(e.modelState);
  }
};
class cz {
  constructor(e) {
    ((this.modelState = e), (this.viewState = null));
  }
}
class dz {
  constructor(e) {
    ((this.modelState = null), (this.viewState = e));
  }
}
class uz {
  constructor(e, t, n, i, r) {
    ((this.selectionStart = e),
      (this.selectionStartKind = t),
      (this.selectionStartLeftoverVisibleColumns = n),
      (this.position = i),
      (this.leftoverVisibleColumns = r),
      (this._singleCursorStateBrand = void 0),
      (this.selection = uz._computeSelection(this.selectionStart, this.position)));
  }
  equals(e) {
    return (
      this.selectionStartLeftoverVisibleColumns === e.selectionStartLeftoverVisibleColumns &&
      this.leftoverVisibleColumns === e.leftoverVisibleColumns &&
      this.selectionStartKind === e.selectionStartKind &&
      this.position.equals(e.position) &&
      this.selectionStart.equalsRange(e.selectionStart)
    );
  }
  hasSelection() {
    return !this.selection.isEmpty() || !this.selectionStart.isEmpty();
  }
  move(e, t, n, i) {
    return e
      ? new uz(
          this.selectionStart,
          this.selectionStartKind,
          this.selectionStartLeftoverVisibleColumns,
          new xV(t, n),
          i,
        )
      : new uz(new YH(t, n, t, n), 0, i, new xV(t, n), i);
  }
  static _computeSelection(e, t) {
    return e.isEmpty() || !t.isBeforeOrEqual(e.getStartPosition())
      ? XH.fromPositions(e.getStartPosition(), t)
      : XH.fromPositions(e.getEndPosition(), t);
  }
}
class hz {
  constructor(e, t, n) {
    ((this._editOperationResultBrand = void 0),
      (this.type = e),
      (this.commands = t),
      (this.shouldPushStackElementBefore = n.shouldPushStackElementBefore),
      (this.shouldPushStackElementAfter = n.shouldPushStackElementAfter));
  }
}
function gz(e) {
  return "'" === e || '"' === e || "`" === e;
}
class pz {
  static columnSelect(e, t, n, i, r, o) {
    const s = Math.abs(r - n) + 1,
      a = n > r,
      l = i > o,
      c = i < o,
      d = [];
    for (let u = 0; u < s; u++) {
      const r = n + (a ? -u : u),
        s = e.columnFromVisibleColumn(t, r, i),
        h = e.columnFromVisibleColumn(t, r, o),
        g = e.visibleColumnFromColumn(t, new xV(r, s)),
        p = e.visibleColumnFromColumn(t, new xV(r, h));
      if (c) {
        if (g > o) continue;
        if (p < i) continue;
      }
      if (l) {
        if (p > i) continue;
        if (g < o) continue;
      }
      d.push(new uz(new YH(r, s, r, s), 0, 0, new xV(r, h), 0));
    }
    if (0 === d.length)
      for (let u = 0; u < s; u++) {
        const e = n + (a ? -u : u),
          i = t.getLineMaxColumn(e);
        d.push(new uz(new YH(e, i, e, i), 0, 0, new xV(e, i), 0));
      }
    return {
      viewStates: d,
      reversed: a,
      fromLineNumber: n,
      fromVisualColumn: i,
      toLineNumber: r,
      toVisualColumn: o,
    };
  }
  static columnSelectLeft(e, t, n) {
    let i = n.toViewVisualColumn;
    return (
      i > 0 && i--,
      pz.columnSelect(e, t, n.fromViewLineNumber, n.fromViewVisualColumn, n.toViewLineNumber, i)
    );
  }
  static columnSelectRight(e, t, n) {
    let i = 0;
    const r = Math.min(n.fromViewLineNumber, n.toViewLineNumber),
      o = Math.max(n.fromViewLineNumber, n.toViewLineNumber);
    for (let a = r; a <= o; a++) {
      const n = t.getLineMaxColumn(a),
        r = e.visibleColumnFromColumn(t, new xV(a, n));
      i = Math.max(i, r);
    }
    let s = n.toViewVisualColumn;
    return (
      s < i && s++,
      this.columnSelect(e, t, n.fromViewLineNumber, n.fromViewVisualColumn, n.toViewLineNumber, s)
    );
  }
  static columnSelectUp(e, t, n, i) {
    const r = i ? e.pageSize : 1,
      o = Math.max(1, n.toViewLineNumber - r);
    return this.columnSelect(
      e,
      t,
      n.fromViewLineNumber,
      n.fromViewVisualColumn,
      o,
      n.toViewVisualColumn,
    );
  }
  static columnSelectDown(e, t, n, i) {
    const r = i ? e.pageSize : 1,
      o = Math.min(t.getLineCount(), n.toViewLineNumber + r);
    return this.columnSelect(
      e,
      t,
      n.fromViewLineNumber,
      n.fromViewVisualColumn,
      o,
      n.toViewVisualColumn,
    );
  }
}
class fz {
  constructor(e, t, n = !1) {
    ((this._range = e), (this._text = t), (this.insertsAutoWhitespace = n));
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations()[0].range;
    return XH.fromPositions(n.getEndPosition());
  }
}
class mz {
  constructor(e, t, n = !1) {
    ((this._range = e), (this._text = t), (this.insertsAutoWhitespace = n));
  }
  getEditOperations(e, t) {
    const n = this._range.getStartPosition(),
      i = this._range.getEndPosition(),
      r = i.lineNumber;
    let o = wz(e, i, this._text.length + (this._range.isEmpty() ? 0 : -1));
    o.lineNumber > r && (o = new xV(r, e.getLineMaxColumn(r)));
    const s = YH.fromPositions(n, o);
    t.addTrackedEditOperation(s, this._text);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations()[0].range;
    return XH.fromPositions(n.getEndPosition());
  }
}
class _z {
  constructor(e, t) {
    ((this._range = e), (this._text = t));
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations()[0].range;
    return XH.fromRange(n, 0);
  }
}
class vz {
  constructor(e, t, n = !1) {
    ((this._range = e), (this._text = t), (this.insertsAutoWhitespace = n));
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations()[0].range;
    return XH.fromPositions(n.getStartPosition());
  }
}
class bz {
  constructor(e, t, n, i, r = !1) {
    ((this._range = e),
      (this._text = t),
      (this._columnDeltaOffset = i),
      (this._lineNumberDeltaOffset = n),
      (this.insertsAutoWhitespace = r));
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations()[0].range;
    return XH.fromPositions(
      n.getEndPosition().delta(this._lineNumberDeltaOffset, this._columnDeltaOffset),
    );
  }
}
class yz {
  constructor(e) {
    this._range = e;
  }
  getEditOperations(e, t) {
    const n = e.getValueInRange(this._range),
      i = this._range.getEndPosition(),
      r = i.lineNumber;
    let o = wz(e, i, n.length);
    o.lineNumber > r && (o = new xV(r, e.getLineMaxColumn(r)));
    const s = YH.fromPositions(i, o);
    t.addTrackedEditOperation(s, "");
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations()[0].range;
    return XH.fromPositions(n.getEndPosition());
  }
}
class xz {
  constructor(e, t, n, i = !1) {
    ((this._range = e),
      (this._text = t),
      (this._initialSelection = n),
      (this._forceMoveMarkers = i),
      (this._selectionId = null));
  }
  getEditOperations(e, t) {
    (t.addTrackedEditOperation(this._range, this._text, this._forceMoveMarkers),
      (this._selectionId = t.trackSelection(this._initialSelection)));
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._selectionId);
  }
}
function wz(e, t, n) {
  if (n < 0) throw new Error("Unexpected negative delta");
  const i = e.getLineCount();
  let r = new xV(i, e.getLineMaxColumn(i));
  for (let o = t.lineNumber; o <= i; o++)
    if (o === t.lineNumber) {
      const i = n - e.getLineMaxColumn(t.lineNumber) + t.column;
      if (i <= 0) {
        r = new xV(t.lineNumber, t.column + n);
        break;
      }
      n = i;
    } else {
      const t = n - e.getLineMaxColumn(o);
      if (t <= 0) {
        r = new xV(o, n);
        break;
      }
      n = t;
    }
  return r;
}
class Cz {
  static whitespaceVisibleColumn(e, t, n) {
    const i = e.length;
    let r = 0,
      o = -1,
      s = -1;
    for (let a = 0; a < i; a++) {
      if (a === t) return [o, s, r];
      r % n === 0 && ((o = a), (s = r));
      switch (e.charCodeAt(a)) {
        case 32:
          r += 1;
          break;
        case 9:
          r = tz.nextRenderTabStop(r, n);
          break;
        default:
          return [-1, -1, -1];
      }
    }
    return t === i ? [o, s, r] : [-1, -1, -1];
  }
  static atomicPosition(e, t, n, i) {
    const r = e.length,
      [o, s, a] = Cz.whitespaceVisibleColumn(e, t, n);
    if (-1 === a) return -1;
    let l;
    switch (i) {
      case 0:
        l = !0;
        break;
      case 1:
        l = !1;
        break;
      case 2:
        if (a % n === 0) return t;
        l = a % n <= n / 2;
    }
    if (l) {
      if (-1 === o) return -1;
      let t = s;
      for (let i = o; i < r; ++i) {
        if (t === s + n) return o;
        switch (e.charCodeAt(i)) {
          case 32:
            t += 1;
            break;
          case 9:
            t = tz.nextRenderTabStop(t, n);
            break;
          default:
            return -1;
        }
      }
      return t === s + n ? o : -1;
    }
    const c = tz.nextRenderTabStop(a, n);
    let d = a;
    for (let u = t; u < r; u++) {
      if (d === c) return u;
      switch (e.charCodeAt(u)) {
        case 32:
          d += 1;
          break;
        case 9:
          d = tz.nextRenderTabStop(d, n);
          break;
        default:
          return -1;
      }
    }
    return d === c ? r : -1;
  }
}
class Sz {
  constructor(e, t, n) {
    ((this._cursorPositionBrand = void 0),
      (this.lineNumber = e),
      (this.column = t),
      (this.leftoverVisibleColumns = n));
  }
}
class kz {
  static leftPosition(e, t) {
    if (t.column > e.getLineMinColumn(t.lineNumber))
      return t.delta(void 0, -vA(e.getLineContent(t.lineNumber), t.column - 1));
    if (t.lineNumber > 1) {
      const n = t.lineNumber - 1;
      return new xV(n, e.getLineMaxColumn(n));
    }
    return t;
  }
  static leftPositionAtomicSoftTabs(e, t, n) {
    if (t.column <= e.getLineIndentColumn(t.lineNumber)) {
      const i = e.getLineMinColumn(t.lineNumber),
        r = e.getLineContent(t.lineNumber),
        o = Cz.atomicPosition(r, t.column - 1, n, 0);
      if (-1 !== o && o + 1 >= i) return new xV(t.lineNumber, o + 1);
    }
    return this.leftPosition(e, t);
  }
  static left(e, t, n) {
    const i = e.stickyTabStops
      ? kz.leftPositionAtomicSoftTabs(t, n, e.tabSize)
      : kz.leftPosition(t, n);
    return new Sz(i.lineNumber, i.column, 0);
  }
  static moveLeft(e, t, n, i, r) {
    let o, s;
    if (n.hasSelection() && !i) ((o = n.selection.startLineNumber), (s = n.selection.startColumn));
    else {
      const i = n.position.delta(void 0, -(r - 1)),
        a = t.normalizePosition(kz.clipPositionColumn(i, t), 0),
        l = kz.left(e, t, a);
      ((o = l.lineNumber), (s = l.column));
    }
    return n.move(i, o, s, 0);
  }
  static clipPositionColumn(e, t) {
    return new xV(
      e.lineNumber,
      kz.clipRange(e.column, t.getLineMinColumn(e.lineNumber), t.getLineMaxColumn(e.lineNumber)),
    );
  }
  static clipRange(e, t, n) {
    return e < t ? t : e > n ? n : e;
  }
  static rightPosition(e, t, n) {
    return (
      n < e.getLineMaxColumn(t)
        ? (n += _A(e.getLineContent(t), n - 1))
        : t < e.getLineCount() && ((t += 1), (n = e.getLineMinColumn(t))),
      new xV(t, n)
    );
  }
  static rightPositionAtomicSoftTabs(e, t, n, i, r) {
    if (n < e.getLineIndentColumn(t)) {
      const r = e.getLineContent(t),
        o = Cz.atomicPosition(r, n - 1, i, 1);
      if (-1 !== o) return new xV(t, o + 1);
    }
    return this.rightPosition(e, t, n);
  }
  static right(e, t, n) {
    const i = e.stickyTabStops
      ? kz.rightPositionAtomicSoftTabs(t, n.lineNumber, n.column, e.tabSize, e.indentSize)
      : kz.rightPosition(t, n.lineNumber, n.column);
    return new Sz(i.lineNumber, i.column, 0);
  }
  static moveRight(e, t, n, i, r) {
    let o, s;
    if (n.hasSelection() && !i) ((o = n.selection.endLineNumber), (s = n.selection.endColumn));
    else {
      const i = n.position.delta(void 0, r - 1),
        a = t.normalizePosition(kz.clipPositionColumn(i, t), 1),
        l = kz.right(e, t, a);
      ((o = l.lineNumber), (s = l.column));
    }
    return n.move(i, o, s, 0);
  }
  static vertical(e, t, n, i, r, o, s, a) {
    const l = tz.visibleColumnFromColumn(t.getLineContent(n), i, e.tabSize) + r,
      c = t.getLineCount(),
      d = 1 === n && 1 === i,
      u = n === c && i === t.getLineMaxColumn(n),
      h = o < n ? d : u;
    if (
      ((n = o) < 1
        ? ((n = 1), (i = s ? t.getLineMinColumn(n) : Math.min(t.getLineMaxColumn(n), i)))
        : n > c
          ? ((n = c), (i = s ? t.getLineMaxColumn(n) : Math.min(t.getLineMaxColumn(n), i)))
          : (i = e.columnFromVisibleColumn(t, n, l)),
      (r = h ? 0 : l - tz.visibleColumnFromColumn(t.getLineContent(n), i, e.tabSize)),
      void 0 !== a)
    ) {
      const e = new xV(n, i),
        o = t.normalizePosition(e, a);
      ((r += i - o.column), (n = o.lineNumber), (i = o.column));
    }
    return new Sz(n, i, r);
  }
  static down(e, t, n, i, r, o, s) {
    return this.vertical(e, t, n, i, r, n + o, s, 4);
  }
  static moveDown(e, t, n, i, r) {
    let o, s;
    n.hasSelection() && !i
      ? ((o = n.selection.endLineNumber), (s = n.selection.endColumn))
      : ((o = n.position.lineNumber), (s = n.position.column));
    let a,
      l = 0;
    do {
      a = kz.down(e, t, o + l, s, n.leftoverVisibleColumns, r, !0);
      if (t.normalizePosition(new xV(a.lineNumber, a.column), 2).lineNumber > o) break;
    } while (l++ < 10 && o + l < t.getLineCount());
    return n.move(i, a.lineNumber, a.column, a.leftoverVisibleColumns);
  }
  static translateDown(e, t, n) {
    const i = n.selection,
      r = kz.down(
        e,
        t,
        i.selectionStartLineNumber,
        i.selectionStartColumn,
        n.selectionStartLeftoverVisibleColumns,
        1,
        !1,
      ),
      o = kz.down(e, t, i.positionLineNumber, i.positionColumn, n.leftoverVisibleColumns, 1, !1);
    return new uz(
      new YH(r.lineNumber, r.column, r.lineNumber, r.column),
      0,
      r.leftoverVisibleColumns,
      new xV(o.lineNumber, o.column),
      o.leftoverVisibleColumns,
    );
  }
  static up(e, t, n, i, r, o, s) {
    return this.vertical(e, t, n, i, r, n - o, s, 3);
  }
  static moveUp(e, t, n, i, r) {
    let o, s;
    n.hasSelection() && !i
      ? ((o = n.selection.startLineNumber), (s = n.selection.startColumn))
      : ((o = n.position.lineNumber), (s = n.position.column));
    const a = kz.up(e, t, o, s, n.leftoverVisibleColumns, r, !0);
    return n.move(i, a.lineNumber, a.column, a.leftoverVisibleColumns);
  }
  static translateUp(e, t, n) {
    const i = n.selection,
      r = kz.up(
        e,
        t,
        i.selectionStartLineNumber,
        i.selectionStartColumn,
        n.selectionStartLeftoverVisibleColumns,
        1,
        !1,
      ),
      o = kz.up(e, t, i.positionLineNumber, i.positionColumn, n.leftoverVisibleColumns, 1, !1);
    return new uz(
      new YH(r.lineNumber, r.column, r.lineNumber, r.column),
      0,
      r.leftoverVisibleColumns,
      new xV(o.lineNumber, o.column),
      o.leftoverVisibleColumns,
    );
  }
  static _isBlankLine(e, t) {
    return 0 === e.getLineFirstNonWhitespaceColumn(t);
  }
  static moveToPrevBlankLine(e, t, n, i) {
    let r = n.position.lineNumber;
    for (; r > 1 && this._isBlankLine(t, r); ) r--;
    for (; r > 1 && !this._isBlankLine(t, r); ) r--;
    return n.move(i, r, t.getLineMinColumn(r), 0);
  }
  static moveToNextBlankLine(e, t, n, i) {
    const r = t.getLineCount();
    let o = n.position.lineNumber;
    for (; o < r && this._isBlankLine(t, o); ) o++;
    for (; o < r && !this._isBlankLine(t, o); ) o++;
    return n.move(i, o, t.getLineMinColumn(o), 0);
  }
  static moveToBeginningOfLine(e, t, n, i) {
    const r = n.position.lineNumber,
      o = t.getLineMinColumn(r),
      s = t.getLineFirstNonWhitespaceColumn(r) || o;
    let a;
    return ((a = n.position.column === s ? o : s), n.move(i, r, a, 0));
  }
  static moveToEndOfLine(e, t, n, i, r) {
    const o = n.position.lineNumber,
      s = t.getLineMaxColumn(o);
    return n.move(i, o, s, r ? 1073741824 - s : 0);
  }
  static moveToBeginningOfBuffer(e, t, n, i) {
    return n.move(i, 1, 1, 0);
  }
  static moveToEndOfBuffer(e, t, n, i) {
    const r = t.getLineCount(),
      o = t.getLineMaxColumn(r);
    return n.move(i, r, o, 0);
  }
}
class Ez {
  static deleteRight(e, t, n, i) {
    const r = [];
    let o = 3 !== e;
    for (let s = 0, a = i.length; s < a; s++) {
      const e = i[s],
        a = this.getDeleteRightRange(e, n, t);
      a.isEmpty()
        ? (r[s] = null)
        : (a.startLineNumber !== a.endLineNumber && (o = !0), (r[s] = new fz(a, "")));
    }
    return [o, r];
  }
  static getDeleteRightRange(e, t, n) {
    if (!e.isEmpty()) return e;
    const i = e.getPosition(),
      r = kz.right(n, t, i);
    if (n.trimWhitespaceOnDelete && r.lineNumber !== i.lineNumber) {
      const e = t.getLineFirstNonWhitespaceColumn(i.lineNumber) > 0,
        n = t.getLineFirstNonWhitespaceColumn(r.lineNumber);
      if (e && n > 0) return new YH(r.lineNumber, n, i.lineNumber, i.column);
    }
    return new YH(r.lineNumber, r.column, i.lineNumber, i.column);
  }
  static isAutoClosingPairDelete(e, t, n, i, r, o, s) {
    if ("never" === t && "never" === n) return !1;
    if ("never" === e) return !1;
    for (let a = 0, l = o.length; a < l; a++) {
      const l = o[a],
        c = l.getPosition();
      if (!l.isEmpty()) return !1;
      const d = r.getLineContent(c.lineNumber);
      if (c.column < 2 || c.column >= d.length + 1) return !1;
      const u = d.charAt(c.column - 2),
        h = i.get(u);
      if (!h) return !1;
      if (gz(u)) {
        if ("never" === n) return !1;
      } else if ("never" === t) return !1;
      const g = d.charAt(c.column - 1);
      let p = !1;
      for (const e of h) e.open === u && e.close === g && (p = !0);
      if (!p) return !1;
      if ("auto" === e) {
        let e = !1;
        for (let t = 0, n = s.length; t < n; t++) {
          const n = s[t];
          if (c.lineNumber === n.startLineNumber && c.column === n.startColumn) {
            e = !0;
            break;
          }
        }
        if (!e) return !1;
      }
    }
    return !0;
  }
  static _runAutoClosingPairDelete(e, t, n) {
    const i = [];
    for (let r = 0, o = n.length; r < o; r++) {
      const e = n[r].getPosition(),
        t = new YH(e.lineNumber, e.column - 1, e.lineNumber, e.column + 1);
      i[r] = new fz(t, "");
    }
    return [!0, i];
  }
  static deleteLeft(e, t, n, i, r) {
    if (
      this.isAutoClosingPairDelete(
        t.autoClosingDelete,
        t.autoClosingBrackets,
        t.autoClosingQuotes,
        t.autoClosingPairs.autoClosingPairsOpenByEnd,
        n,
        i,
        r,
      )
    )
      return this._runAutoClosingPairDelete(t, n, i);
    const o = [];
    let s = 2 !== e;
    for (let a = 0, l = i.length; a < l; a++) {
      const e = Ez.getDeleteLeftRange(i[a], n, t);
      e.isEmpty()
        ? (o[a] = null)
        : (e.startLineNumber !== e.endLineNumber && (s = !0), (o[a] = new fz(e, "")));
    }
    return [s, o];
  }
  static getDeleteLeftRange(e, t, n) {
    if (!e.isEmpty()) return e;
    const i = e.getPosition();
    if (n.useTabStops && i.column > 1) {
      const e = t.getLineContent(i.lineNumber),
        r = YM(e),
        o = -1 === r ? e.length + 1 : r + 1;
      if (i.column <= o) {
        const e = n.visibleColumnFromColumn(t, i),
          r = tz.prevIndentTabStop(e, n.indentSize),
          o = n.columnFromVisibleColumn(t, i.lineNumber, r);
        return new YH(i.lineNumber, o, i.lineNumber, i.column);
      }
    }
    return YH.fromPositions(Ez.getPositionAfterDeleteLeft(i, t), i);
  }
  static getPositionAfterDeleteLeft(e, t) {
    if (e.column > 1) {
      const n = RA(e.column - 1, t.getLineContent(e.lineNumber));
      return e.with(void 0, n + 1);
    }
    if (e.lineNumber > 1) {
      const n = e.lineNumber - 1;
      return new xV(n, t.getLineMaxColumn(n));
    }
    return e;
  }
  static cut(e, t, n) {
    const i = [];
    let r = null;
    n.sort((e, t) => xV.compare(e.getStartPosition(), t.getEndPosition()));
    for (let o = 0, s = n.length; o < s; o++) {
      const s = n[o];
      if (s.isEmpty())
        if (e.emptySelectionClipboard) {
          const e = s.getPosition();
          let n, a, l, c;
          e.lineNumber < t.getLineCount()
            ? ((n = e.lineNumber), (a = 1), (l = e.lineNumber + 1), (c = 1))
            : e.lineNumber > 1 && r?.endLineNumber !== e.lineNumber
              ? ((n = e.lineNumber - 1),
                (a = t.getLineMaxColumn(e.lineNumber - 1)),
                (l = e.lineNumber),
                (c = t.getLineMaxColumn(e.lineNumber)))
              : ((n = e.lineNumber),
                (a = 1),
                (l = e.lineNumber),
                (c = t.getLineMaxColumn(e.lineNumber)));
          const d = new YH(n, a, l, c);
          ((r = d), d.isEmpty() ? (i[o] = null) : (i[o] = new fz(d, "")));
        } else i[o] = null;
      else i[o] = new fz(s, "");
    }
    return new hz(0, i, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !0 });
  }
}
const Nz = {
  DateTimeFormat: (e, t) =>
    new FM(() => {
      try {
        return new Intl.DateTimeFormat(e, t);
      } catch {
        return new Intl.DateTimeFormat(void 0, t);
      }
    }),
  Collator: (e, t) =>
    new FM(() => {
      try {
        return new Intl.Collator(e, t);
      } catch {
        return new Intl.Collator(void 0, t);
      }
    }),
  Segmenter: (e, t) =>
    new FM(() => {
      try {
        return new Intl.Segmenter(e, t);
      } catch {
        return new Intl.Segmenter(void 0, t);
      }
    }),
  Locale: (e, t) =>
    new FM(() => {
      try {
        return new Intl.Locale(e, t);
      } catch {
        return new Intl.Locale(vR, t);
      }
    }),
  NumberFormat: (e, t) =>
    new FM(() => {
      try {
        return new Intl.NumberFormat(e, t);
      } catch {
        return new Intl.NumberFormat(void 0, t);
      }
    }),
};
function Lz(e) {
  return e < 0 ? 0 : e > 255 ? 255 : 0 | e;
}
function Dz(e) {
  return e < 0 ? 0 : e > 4294967295 ? 4294967295 : 0 | e;
}
class Tz {
  constructor(e) {
    const t = Lz(e);
    ((this._defaultValue = t), (this._asciiMap = Tz._createAsciiMap(t)), (this._map = new Map()));
  }
  static _createAsciiMap(e) {
    const t = new Uint8Array(256);
    return (t.fill(e), t);
  }
  set(e, t) {
    const n = Lz(t);
    e >= 0 && e < 256 ? (this._asciiMap[e] = n) : this._map.set(e, n);
  }
  get(e) {
    return e >= 0 && e < 256 ? this._asciiMap[e] : this._map.get(e) || this._defaultValue;
  }
  clear() {
    (this._asciiMap.fill(this._defaultValue), this._map.clear());
  }
}
class Iz {
  constructor() {
    this._actual = new Tz(0);
  }
  add(e) {
    this._actual.set(e, 1);
  }
  has(e) {
    return 1 === this._actual.get(e);
  }
  clear() {
    return this._actual.clear();
  }
}
class Rz extends Tz {
  constructor(e, t) {
    (super(0),
      (this._segmenter = null),
      (this._cachedLine = null),
      (this._cachedSegments = []),
      (this.intlSegmenterLocales = t),
      this.intlSegmenterLocales.length > 0
        ? (this._segmenter = Nz.Segmenter(this.intlSegmenterLocales, { granularity: "word" }))
        : (this._segmenter = null));
    for (let n = 0, i = e.length; n < i; n++) this.set(e.charCodeAt(n), 2);
    (this.set(32, 1), this.set(9, 1));
  }
  findPrevIntlWordBeforeOrAtOffset(e, t) {
    let n = null;
    for (const i of this._getIntlSegmenterWordsOnLine(e)) {
      if (i.index > t) break;
      n = i;
    }
    return n;
  }
  findNextIntlWordAtOrAfterOffset(e, t) {
    for (const n of this._getIntlSegmenterWordsOnLine(e)) if (!(n.index < t)) return n;
    return null;
  }
  _getIntlSegmenterWordsOnLine(e) {
    return this._segmenter
      ? (this._cachedLine === e ||
          ((this._cachedLine = e),
          (this._cachedSegments = this._filterWordSegments(this._segmenter.value.segment(e)))),
        this._cachedSegments)
      : [];
  }
  _filterWordSegments(e) {
    const t = [];
    for (const n of e) this._isWordLike(n) && t.push(n);
    return t;
  }
  _isWordLike(e) {
    return !!e.isWordLike;
  }
}
const Oz = new XW(10);
function Mz(e, t) {
  const n = `${e}/${t.join(",")}`;
  let i = Oz.get(n);
  return (i || ((i = new Rz(e, t)), Oz.set(n, i)), i);
}
class Az {
  static _createWord(e, t, n, i, r) {
    return { start: i, end: r, wordType: t, nextCharClass: n };
  }
  static _createIntlWord(e, t) {
    return { start: e.index, end: e.index + e.segment.length, wordType: 1, nextCharClass: t };
  }
  static _findPreviousWordOnLine(e, t, n) {
    const i = t.getLineContent(n.lineNumber);
    return this._doFindPreviousWordOnLine(i, e, n);
  }
  static _doFindPreviousWordOnLine(e, t, n) {
    let i = 0;
    const r = t.findPrevIntlWordBeforeOrAtOffset(e, n.column - 2);
    for (let o = n.column - 2; o >= 0; o--) {
      const n = e.charCodeAt(o),
        s = t.get(n);
      if (r && o === r.index) return this._createIntlWord(r, s);
      if (0 === s) {
        if (2 === i) return this._createWord(e, i, s, o + 1, this._findEndOfWord(e, t, i, o + 1));
        i = 1;
      } else if (2 === s) {
        if (1 === i) return this._createWord(e, i, s, o + 1, this._findEndOfWord(e, t, i, o + 1));
        i = 2;
      } else if (1 === s && 0 !== i)
        return this._createWord(e, i, s, o + 1, this._findEndOfWord(e, t, i, o + 1));
    }
    return 0 !== i ? this._createWord(e, i, 1, 0, this._findEndOfWord(e, t, i, 0)) : null;
  }
  static _findEndOfWord(e, t, n, i) {
    const r = t.findNextIntlWordAtOrAfterOffset(e, i),
      o = e.length;
    for (let s = i; s < o; s++) {
      const i = e.charCodeAt(s),
        o = t.get(i);
      if (r && s === r.index + r.segment.length) return s;
      if (1 === o) return s;
      if (1 === n && 2 === o) return s;
      if (2 === n && 0 === o) return s;
    }
    return o;
  }
  static _findNextWordOnLine(e, t, n) {
    const i = t.getLineContent(n.lineNumber);
    return this._doFindNextWordOnLine(i, e, n);
  }
  static _doFindNextWordOnLine(e, t, n) {
    let i = 0;
    const r = e.length,
      o = t.findNextIntlWordAtOrAfterOffset(e, n.column - 1);
    for (let s = n.column - 1; s < r; s++) {
      const n = e.charCodeAt(s),
        r = t.get(n);
      if (o && s === o.index) return this._createIntlWord(o, r);
      if (0 === r) {
        if (2 === i) return this._createWord(e, i, r, this._findStartOfWord(e, t, i, s - 1), s);
        i = 1;
      } else if (2 === r) {
        if (1 === i) return this._createWord(e, i, r, this._findStartOfWord(e, t, i, s - 1), s);
        i = 2;
      } else if (1 === r && 0 !== i)
        return this._createWord(e, i, r, this._findStartOfWord(e, t, i, s - 1), s);
    }
    return 0 !== i ? this._createWord(e, i, 1, this._findStartOfWord(e, t, i, r - 1), r) : null;
  }
  static _findStartOfWord(e, t, n, i) {
    const r = t.findPrevIntlWordBeforeOrAtOffset(e, i);
    for (let o = i; o >= 0; o--) {
      const i = e.charCodeAt(o),
        s = t.get(i);
      if (r && o === r.index) return o;
      if (1 === s) return o + 1;
      if (1 === n && 2 === s) return o + 1;
      if (2 === n && 0 === s) return o + 1;
    }
    return 0;
  }
  static moveWordLeft(e, t, n, i, r) {
    let o = n.lineNumber,
      s = n.column;
    1 === s && o > 1 && ((o -= 1), (s = t.getLineMaxColumn(o)));
    let a = Az._findPreviousWordOnLine(e, t, new xV(o, s));
    if (0 === i) return new xV(o, a ? a.start + 1 : 1);
    if (1 === i)
      return (
        !r &&
          a &&
          2 === a.wordType &&
          a.end - a.start === 1 &&
          0 === a.nextCharClass &&
          (a = Az._findPreviousWordOnLine(e, t, new xV(o, a.start + 1))),
        new xV(o, a ? a.start + 1 : 1)
      );
    if (3 === i) {
      for (; a && 2 === a.wordType; ) a = Az._findPreviousWordOnLine(e, t, new xV(o, a.start + 1));
      return new xV(o, a ? a.start + 1 : 1);
    }
    return (
      a && s <= a.end + 1 && (a = Az._findPreviousWordOnLine(e, t, new xV(o, a.start + 1))),
      new xV(o, a ? a.end + 1 : 1)
    );
  }
  static _moveWordPartLeft(e, t) {
    const n = t.lineNumber,
      i = e.getLineMaxColumn(n);
    if (1 === t.column) return n > 1 ? new xV(n - 1, e.getLineMaxColumn(n - 1)) : t;
    const r = e.getLineContent(n);
    for (let o = t.column - 1; o > 1; o--) {
      const e = r.charCodeAt(o - 2),
        t = r.charCodeAt(o - 1);
      if (95 === e && 95 !== t) return new xV(n, o);
      if (45 === e && 45 !== t) return new xV(n, o);
      if ((rA(e) || iA(e)) && oA(t)) return new xV(n, o);
      if (oA(e) && oA(t) && o + 1 < i) {
        const e = r.charCodeAt(o);
        if (rA(e) || iA(e)) return new xV(n, o);
      }
    }
    return new xV(n, 1);
  }
  static moveWordRight(e, t, n, i) {
    let r = n.lineNumber,
      o = n.column,
      s = !1;
    o === t.getLineMaxColumn(r) && r < t.getLineCount() && ((s = !0), (r += 1), (o = 1));
    let a = Az._findNextWordOnLine(e, t, new xV(r, o));
    if (2 === i)
      (a &&
        2 === a.wordType &&
        a.end - a.start === 1 &&
        0 === a.nextCharClass &&
        (a = Az._findNextWordOnLine(e, t, new xV(r, a.end + 1))),
        (o = a ? a.end + 1 : t.getLineMaxColumn(r)));
    else if (3 === i) {
      for (s && (o = 0); a && (2 === a.wordType || a.start + 1 <= o); )
        a = Az._findNextWordOnLine(e, t, new xV(r, a.end + 1));
      o = a ? a.start + 1 : t.getLineMaxColumn(r);
    } else
      (a && !s && o >= a.start + 1 && (a = Az._findNextWordOnLine(e, t, new xV(r, a.end + 1))),
        (o = a ? a.start + 1 : t.getLineMaxColumn(r)));
    return new xV(r, o);
  }
  static _moveWordPartRight(e, t) {
    const n = t.lineNumber,
      i = e.getLineMaxColumn(n);
    if (t.column === i) return n < e.getLineCount() ? new xV(n + 1, 1) : t;
    const r = e.getLineContent(n);
    for (let o = t.column + 1; o < i; o++) {
      const e = r.charCodeAt(o - 2),
        t = r.charCodeAt(o - 1);
      if (95 !== e && 95 === t) return new xV(n, o);
      if (45 !== e && 45 === t) return new xV(n, o);
      if ((rA(e) || iA(e)) && oA(t)) return new xV(n, o);
      if (oA(e) && oA(t) && o + 1 < i) {
        const e = r.charCodeAt(o);
        if (rA(e) || iA(e)) return new xV(n, o);
      }
    }
    return new xV(n, i);
  }
  static _deleteWordLeftWhitespace(e, t) {
    const n = e.getLineContent(t.lineNumber),
      i = t.column - 2,
      r = QM(n, i);
    return r + 1 < i ? new YH(t.lineNumber, r + 2, t.lineNumber, t.column) : null;
  }
  static deleteWordLeft(e, t) {
    const n = e.wordSeparators,
      i = e.model,
      r = e.selection,
      o = e.whitespaceHeuristics;
    if (!r.isEmpty()) return r;
    if (
      Ez.isAutoClosingPairDelete(
        e.autoClosingDelete,
        e.autoClosingBrackets,
        e.autoClosingQuotes,
        e.autoClosingPairs.autoClosingPairsOpenByEnd,
        e.model,
        [e.selection],
        e.autoClosedCharacters,
      )
    ) {
      const t = e.selection.getPosition();
      return new YH(t.lineNumber, t.column - 1, t.lineNumber, t.column + 1);
    }
    const s = new xV(r.positionLineNumber, r.positionColumn);
    let a = s.lineNumber,
      l = s.column;
    if (1 === a && 1 === l) return null;
    if (o) {
      const e = this._deleteWordLeftWhitespace(i, s);
      if (e) return e;
    }
    let c = Az._findPreviousWordOnLine(n, i, s);
    return (
      0 === t
        ? c
          ? (l = c.start + 1)
          : l > 1
            ? (l = 1)
            : (a--, (l = i.getLineMaxColumn(a)))
        : (c && l <= c.end + 1 && (c = Az._findPreviousWordOnLine(n, i, new xV(a, c.start + 1))),
          c ? (l = c.end + 1) : l > 1 ? (l = 1) : (a--, (l = i.getLineMaxColumn(a)))),
      new YH(a, l, s.lineNumber, s.column)
    );
  }
  static deleteInsideWord(e, t, n) {
    if (!n.isEmpty()) return n;
    const i = new xV(n.positionLineNumber, n.positionColumn),
      r = this._deleteInsideWordWhitespace(t, i);
    return r || this._deleteInsideWordDetermineDeleteRange(e, t, i);
  }
  static _charAtIsWhitespace(e, t) {
    const n = e.charCodeAt(t);
    return 32 === n || 9 === n;
  }
  static _deleteInsideWordWhitespace(e, t) {
    const n = e.getLineContent(t.lineNumber),
      i = n.length;
    if (0 === i) return null;
    let r = Math.max(t.column - 2, 0);
    if (!this._charAtIsWhitespace(n, r)) return null;
    let o = Math.min(t.column - 1, i - 1);
    if (!this._charAtIsWhitespace(n, o)) return null;
    for (; r > 0 && this._charAtIsWhitespace(n, r - 1); ) r--;
    for (; o + 1 < i && this._charAtIsWhitespace(n, o + 1); ) o++;
    return new YH(t.lineNumber, r + 1, t.lineNumber, o + 2);
  }
  static _deleteInsideWordDetermineDeleteRange(e, t, n) {
    const i = t.getLineContent(n.lineNumber),
      r = i.length;
    if (0 === r)
      return n.lineNumber > 1
        ? new YH(n.lineNumber - 1, t.getLineMaxColumn(n.lineNumber - 1), n.lineNumber, 1)
        : n.lineNumber < t.getLineCount()
          ? new YH(n.lineNumber, 1, n.lineNumber + 1, 1)
          : new YH(n.lineNumber, 1, n.lineNumber, 1);
    const o = (e) => e.start + 1 <= n.column && n.column <= e.end + 1,
      s = (e, t) => (
        (e = Math.min(e, n.column)),
        (t = Math.max(t, n.column)),
        new YH(n.lineNumber, e, n.lineNumber, t)
      ),
      a = (e) => {
        let t = e.start + 1,
          n = e.end + 1,
          o = !1;
        for (; n - 1 < r && this._charAtIsWhitespace(i, n - 1); ) ((o = !0), n++);
        if (!o) for (; t > 1 && this._charAtIsWhitespace(i, t - 2); ) t--;
        return s(t, n);
      },
      l = Az._findPreviousWordOnLine(e, t, n);
    if (l && o(l)) return a(l);
    const c = Az._findNextWordOnLine(e, t, n);
    return c && o(c)
      ? a(c)
      : l && c
        ? s(l.end + 1, c.start + 1)
        : l
          ? s(l.start + 1, l.end + 1)
          : c
            ? s(c.start + 1, c.end + 1)
            : s(1, r + 1);
  }
  static _deleteWordPartLeft(e, t) {
    if (!t.isEmpty()) return t;
    const n = t.getPosition(),
      i = Az._moveWordPartLeft(e, n);
    return new YH(n.lineNumber, n.column, i.lineNumber, i.column);
  }
  static _findFirstNonWhitespaceChar(e, t) {
    const n = e.length;
    for (let i = t; i < n; i++) {
      const t = e.charAt(i);
      if (" " !== t && "\t" !== t) return i;
    }
    return n;
  }
  static _deleteWordRightWhitespace(e, t) {
    const n = e.getLineContent(t.lineNumber),
      i = t.column - 1,
      r = this._findFirstNonWhitespaceChar(n, i);
    return i + 1 < r ? new YH(t.lineNumber, t.column, t.lineNumber, r + 1) : null;
  }
  static deleteWordRight(e, t) {
    const n = e.wordSeparators,
      i = e.model,
      r = e.selection,
      o = e.whitespaceHeuristics;
    if (!r.isEmpty()) return r;
    const s = new xV(r.positionLineNumber, r.positionColumn);
    let a = s.lineNumber,
      l = s.column;
    const c = i.getLineCount(),
      d = i.getLineMaxColumn(a);
    if (a === c && l === d) return null;
    if (o) {
      const e = this._deleteWordRightWhitespace(i, s);
      if (e) return e;
    }
    let u = Az._findNextWordOnLine(n, i, s);
    return (
      2 === t
        ? u
          ? (l = u.end + 1)
          : l < d || a === c
            ? (l = d)
            : (a++,
              (u = Az._findNextWordOnLine(n, i, new xV(a, 1))),
              (l = u ? u.start + 1 : i.getLineMaxColumn(a)))
        : (u && l >= u.start + 1 && (u = Az._findNextWordOnLine(n, i, new xV(a, u.end + 1))),
          u
            ? (l = u.start + 1)
            : l < d || a === c
              ? (l = d)
              : (a++,
                (u = Az._findNextWordOnLine(n, i, new xV(a, 1))),
                (l = u ? u.start + 1 : i.getLineMaxColumn(a)))),
      new YH(a, l, s.lineNumber, s.column)
    );
  }
  static _deleteWordPartRight(e, t) {
    if (!t.isEmpty()) return t;
    const n = t.getPosition(),
      i = Az._moveWordPartRight(e, n);
    return new YH(n.lineNumber, n.column, i.lineNumber, i.column);
  }
  static _createWordAtPosition(e, t, n) {
    const i = new YH(t, n.start + 1, t, n.end + 1);
    return { word: e.getValueInRange(i), startColumn: i.startColumn, endColumn: i.endColumn };
  }
  static getWordAtPosition(e, t, n, i) {
    const r = Mz(t, n),
      o = Az._findPreviousWordOnLine(r, e, i);
    if (o && 1 === o.wordType && o.start <= i.column - 1 && i.column - 1 <= o.end)
      return Az._createWordAtPosition(e, i.lineNumber, o);
    const s = Az._findNextWordOnLine(r, e, i);
    return s && 1 === s.wordType && s.start <= i.column - 1 && i.column - 1 <= s.end
      ? Az._createWordAtPosition(e, i.lineNumber, s)
      : null;
  }
  static word(e, t, n, i, r) {
    const o = Mz(e.wordSeparators, e.wordSegmenterLocales),
      s = Az._findPreviousWordOnLine(o, t, r),
      a = Az._findNextWordOnLine(o, t, r);
    if (!i) {
      let e, n;
      return (
        (s && 1 === s.wordType && s.start <= r.column - 1 && r.column - 1 <= s.end) ||
        (s && 2 === s.wordType && s.start <= r.column - 1 && r.column - 1 < s.end)
          ? ((e = s.start + 1), (n = s.end + 1))
          : (a && 1 === a.wordType && a.start <= r.column - 1 && r.column - 1 <= a.end) ||
              (a && 2 === a.wordType && a.start <= r.column - 1 && r.column - 1 < a.end)
            ? ((e = a.start + 1), (n = a.end + 1))
            : ((e = s ? s.end + 1 : 1), (n = a ? a.start + 1 : t.getLineMaxColumn(r.lineNumber))),
        new uz(new YH(r.lineNumber, e, r.lineNumber, n), 1, 0, new xV(r.lineNumber, n), 0)
      );
    }
    let l, c;
    s && 1 === s.wordType && s.start < r.column - 1 && r.column - 1 < s.end
      ? ((l = s.start + 1), (c = s.end + 1))
      : a && 1 === a.wordType && a.start < r.column - 1 && r.column - 1 < a.end
        ? ((l = a.start + 1), (c = a.end + 1))
        : ((l = r.column), (c = r.column));
    const d = r.lineNumber;
    let u;
    if (n.selectionStart.containsPosition(r)) u = n.selectionStart.endColumn;
    else if (r.isBeforeOrEqual(n.selectionStart.getStartPosition())) {
      u = l;
      const e = new xV(d, u);
      n.selectionStart.containsPosition(e) && (u = n.selectionStart.endColumn);
    } else {
      u = c;
      const e = new xV(d, u);
      n.selectionStart.containsPosition(e) && (u = n.selectionStart.startColumn);
    }
    return n.move(!0, d, u, 0);
  }
}
class Pz extends Az {
  static deleteWordPartLeft(e) {
    const t = jz([
      Az.deleteWordLeft(e, 0),
      Az.deleteWordLeft(e, 2),
      Az._deleteWordPartLeft(e.model, e.selection),
    ]);
    return (t.sort(YH.compareRangesUsingEnds), t[2]);
  }
  static deleteWordPartRight(e) {
    const t = jz([
      Az.deleteWordRight(e, 0),
      Az.deleteWordRight(e, 2),
      Az._deleteWordPartRight(e.model, e.selection),
    ]);
    return (t.sort(YH.compareRangesUsingStarts), t[0]);
  }
  static moveWordPartLeft(e, t, n, i) {
    const r = jz([
      Az.moveWordLeft(e, t, n, 0, i),
      Az.moveWordLeft(e, t, n, 2, i),
      Az._moveWordPartLeft(t, n),
    ]);
    return (r.sort(xV.compare), r[2]);
  }
  static moveWordPartRight(e, t, n) {
    const i = jz([
      Az.moveWordRight(e, t, n, 0),
      Az.moveWordRight(e, t, n, 2),
      Az._moveWordPartRight(t, n),
    ]);
    return (i.sort(xV.compare), i[0]);
  }
}
function jz(e) {
  return e.filter((e) => Boolean(e));
}
function Fz(e) {
  if (!e || "object" != typeof e) return e;
  if (e instanceof RegExp) return e;
  const t = Array.isArray(e) ? [] : {};
  return (
    Object.entries(e).forEach(([e, n]) => {
      t[e] = n && "object" == typeof n ? Fz(n) : n;
    }),
    t
  );
}
const Bz = Object.prototype.hasOwnProperty;
function Vz(e, t) {
  return Wz(e, t, new Set());
}
function Wz(e, t, n) {
  if (gR(e)) return e;
  const i = t(e);
  if (void 0 !== i) return i;
  if (Array.isArray(e)) {
    const i = [];
    for (const r of e) i.push(Wz(r, t, n));
    return i;
  }
  if (sR(e)) {
    if (n.has(e)) throw new Error("Cannot clone recursive data-structure");
    n.add(e);
    const i = {};
    for (const r in e) Bz.call(e, r) && (i[r] = Wz(e[r], t, n));
    return (n.delete(e), i);
  }
  return e;
}
function Hz(e, t, n = !0) {
  return sR(e)
    ? (sR(t) &&
        Object.keys(t).forEach((i) => {
          i in e ? n && (sR(e[i]) && sR(t[i]) ? Hz(e[i], t[i], n) : (e[i] = t[i])) : (e[i] = t[i]);
        }),
      e)
    : t;
}
function zz(e, t) {
  if (e === t) return !0;
  if (null == e || null == t) return !1;
  if (typeof e != typeof t) return !1;
  if ("object" != typeof e) return !1;
  if (Array.isArray(e) !== Array.isArray(t)) return !1;
  let n, i;
  if (Array.isArray(e)) {
    if (e.length !== t.length) return !1;
    for (n = 0; n < e.length; n++) if (!zz(e[n], t[n])) return !1;
  } else {
    const r = [];
    for (i in e) r.push(i);
    r.sort();
    const o = [];
    for (i in t) o.push(i);
    if ((o.sort(), !zz(r, o))) return !1;
    for (n = 0; n < r.length; n++) if (!zz(e[r[n]], t[r[n]])) return !1;
  }
  return !0;
}
var Uz, $z, qz, Kz, Gz, Zz;
(!(function (e) {
  ((e[(e.Left = 1)] = "Left"),
    (e[(e.Center = 2)] = "Center"),
    (e[(e.Right = 4)] = "Right"),
    (e[(e.Full = 7)] = "Full"));
})(Uz || (Uz = {})),
  (function (e) {
    ((e[(e.Left = 1)] = "Left"), (e[(e.Center = 2)] = "Center"), (e[(e.Right = 3)] = "Right"));
  })($z || ($z = {})),
  (function (e) {
    ((e[(e.LTR = 0)] = "LTR"), (e[(e.RTL = 1)] = "RTL"));
  })(qz || (qz = {})),
  (function (e) {
    ((e[(e.Both = 0)] = "Both"),
      (e[(e.Right = 1)] = "Right"),
      (e[(e.Left = 2)] = "Left"),
      (e[(e.None = 3)] = "None"));
  })(Kz || (Kz = {})));
class Yz {
  get originalIndentSize() {
    return this._indentSizeIsTabSize ? "tabSize" : this.indentSize;
  }
  constructor(e) {
    ((this._textModelResolvedOptionsBrand = void 0),
      (this.tabSize = Math.max(1, 0 | e.tabSize)),
      "tabSize" === e.indentSize
        ? ((this.indentSize = this.tabSize), (this._indentSizeIsTabSize = !0))
        : ((this.indentSize = Math.max(1, 0 | e.indentSize)), (this._indentSizeIsTabSize = !1)),
      (this.insertSpaces = Boolean(e.insertSpaces)),
      (this.defaultEOL = 0 | e.defaultEOL),
      (this.trimAutoWhitespace = Boolean(e.trimAutoWhitespace)),
      (this.bracketPairColorizationOptions = e.bracketPairColorizationOptions));
  }
  equals(e) {
    return (
      this.tabSize === e.tabSize &&
      this._indentSizeIsTabSize === e._indentSizeIsTabSize &&
      this.indentSize === e.indentSize &&
      this.insertSpaces === e.insertSpaces &&
      this.defaultEOL === e.defaultEOL &&
      this.trimAutoWhitespace === e.trimAutoWhitespace &&
      zz(this.bracketPairColorizationOptions, e.bracketPairColorizationOptions)
    );
  }
  createChangeEvent(e) {
    return {
      tabSize: this.tabSize !== e.tabSize,
      indentSize: this.indentSize !== e.indentSize,
      insertSpaces: this.insertSpaces !== e.insertSpaces,
      trimAutoWhitespace: this.trimAutoWhitespace !== e.trimAutoWhitespace,
    };
  }
}
class Xz {
  constructor(e, t) {
    ((this._findMatchBrand = void 0), (this.range = e), (this.matches = t));
  }
}
class Qz {
  constructor(e, t, n, i, r, o) {
    ((this.identifier = e),
      (this.range = t),
      (this.text = n),
      (this.forceMoveMarkers = i),
      (this.isAutoWhitespaceEdit = r),
      (this._isTracked = o));
  }
}
class Jz {
  constructor(e, t, n) {
    ((this.regex = e), (this.wordSeparators = t), (this.simpleSearch = n));
  }
}
class eU {
  constructor(e, t, n) {
    ((this.reverseEdits = e), (this.changes = t), (this.trimAutoWhitespaceLineNumbers = n));
  }
}
function tU(e) {
  return !e.isTooLargeForSyncing() && !e.isForSimpleWidget;
}
class nU {
  static addCursorDown(e, t, n) {
    const i = [];
    let r = 0;
    for (let o = 0, s = t.length; o < s; o++) {
      const s = t[o];
      ((i[r++] = new lz(s.modelState, s.viewState)),
        (i[r++] = n
          ? lz.fromModelState(kz.translateDown(e.cursorConfig, e.model, s.modelState))
          : lz.fromViewState(kz.translateDown(e.cursorConfig, e, s.viewState))));
    }
    return i;
  }
  static addCursorUp(e, t, n) {
    const i = [];
    let r = 0;
    for (let o = 0, s = t.length; o < s; o++) {
      const s = t[o];
      ((i[r++] = new lz(s.modelState, s.viewState)),
        (i[r++] = n
          ? lz.fromModelState(kz.translateUp(e.cursorConfig, e.model, s.modelState))
          : lz.fromViewState(kz.translateUp(e.cursorConfig, e, s.viewState))));
    }
    return i;
  }
  static moveToBeginningOfLine(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r];
      i[r] = this._moveToLineStart(e, o, n);
    }
    return i;
  }
  static _moveToLineStart(e, t, n) {
    const i = t.viewState.position.column,
      r = i === t.modelState.position.column,
      o = t.viewState.position.lineNumber,
      s = e.getLineFirstNonWhitespaceColumn(o);
    return r || i === s
      ? this._moveToLineStartByModel(e, t, n)
      : this._moveToLineStartByView(e, t, n);
  }
  static _moveToLineStartByView(e, t, n) {
    return lz.fromViewState(kz.moveToBeginningOfLine(e.cursorConfig, e, t.viewState, n));
  }
  static _moveToLineStartByModel(e, t, n) {
    return lz.fromModelState(kz.moveToBeginningOfLine(e.cursorConfig, e.model, t.modelState, n));
  }
  static moveToEndOfLine(e, t, n, i) {
    const r = [];
    for (let o = 0, s = t.length; o < s; o++) {
      const s = t[o];
      r[o] = this._moveToLineEnd(e, s, n, i);
    }
    return r;
  }
  static _moveToLineEnd(e, t, n, i) {
    const r = t.viewState.position,
      o = e.getLineMaxColumn(r.lineNumber),
      s = r.column === o,
      a = t.modelState.position,
      l = e.model.getLineMaxColumn(a.lineNumber),
      c = o - r.column === l - a.column;
    return s || c ? this._moveToLineEndByModel(e, t, n, i) : this._moveToLineEndByView(e, t, n, i);
  }
  static _moveToLineEndByView(e, t, n, i) {
    return lz.fromViewState(kz.moveToEndOfLine(e.cursorConfig, e, t.viewState, n, i));
  }
  static _moveToLineEndByModel(e, t, n, i) {
    return lz.fromModelState(kz.moveToEndOfLine(e.cursorConfig, e.model, t.modelState, n, i));
  }
  static expandLineSelection(e, t) {
    const n = [];
    for (let i = 0, r = t.length; i < r; i++) {
      const r = t[i],
        o = r.modelState.selection.startLineNumber,
        s = e.model.getLineCount();
      let a,
        l = r.modelState.selection.endLineNumber;
      (l === s ? (a = e.model.getLineMaxColumn(s)) : (l++, (a = 1)),
        (n[i] = lz.fromModelState(new uz(new YH(o, 1, o, 1), 0, 0, new xV(l, a), 0))));
    }
    return n;
  }
  static moveToBeginningOfBuffer(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r];
      i[r] = lz.fromModelState(
        kz.moveToBeginningOfBuffer(e.cursorConfig, e.model, o.modelState, n),
      );
    }
    return i;
  }
  static moveToEndOfBuffer(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r];
      i[r] = lz.fromModelState(kz.moveToEndOfBuffer(e.cursorConfig, e.model, o.modelState, n));
    }
    return i;
  }
  static selectAll(e, t) {
    const n = e.model.getLineCount(),
      i = e.model.getLineMaxColumn(n);
    return lz.fromModelState(new uz(new YH(1, 1, 1, 1), 0, 0, new xV(n, i), 0));
  }
  static line(e, t, n, i, r) {
    const o = e.model.validatePosition(i),
      s = r
        ? e.coordinatesConverter.validateViewPosition(new xV(r.lineNumber, r.column), o)
        : e.coordinatesConverter.convertModelPositionToViewPosition(o);
    if (!n) {
      const t = e.model.getLineCount();
      let n = o.lineNumber + 1,
        i = 1;
      return (
        n > t && ((n = t), (i = e.model.getLineMaxColumn(n))),
        lz.fromModelState(new uz(new YH(o.lineNumber, 1, n, i), 2, 0, new xV(n, i), 0))
      );
    }
    const a = t.modelState.selectionStart.getStartPosition().lineNumber;
    if (o.lineNumber < a) return lz.fromViewState(t.viewState.move(!0, s.lineNumber, 1, 0));
    if (o.lineNumber > a) {
      const n = e.getLineCount();
      let i = s.lineNumber + 1,
        r = 1;
      return (
        i > n && ((i = n), (r = e.getLineMaxColumn(i))),
        lz.fromViewState(t.viewState.move(!0, i, r, 0))
      );
    }
    {
      const e = t.modelState.selectionStart.getEndPosition();
      return lz.fromModelState(t.modelState.move(!0, e.lineNumber, e.column, 0));
    }
  }
  static word(e, t, n, i) {
    const r = e.model.validatePosition(i);
    return lz.fromModelState(Az.word(e.cursorConfig, e.model, t.modelState, n, r));
  }
  static cancelSelection(e, t) {
    if (!t.modelState.hasSelection()) return new lz(t.modelState, t.viewState);
    const n = t.viewState.position.lineNumber,
      i = t.viewState.position.column;
    return lz.fromViewState(new uz(new YH(n, i, n, i), 0, 0, new xV(n, i), 0));
  }
  static moveTo(e, t, n, i, r) {
    if (n) {
      if (1 === t.modelState.selectionStartKind) return this.word(e, t, n, i);
      if (2 === t.modelState.selectionStartKind) return this.line(e, t, n, i, r);
    }
    const o = e.model.validatePosition(i),
      s = r
        ? e.coordinatesConverter.validateViewPosition(new xV(r.lineNumber, r.column), o)
        : e.coordinatesConverter.convertModelPositionToViewPosition(o);
    return lz.fromViewState(t.viewState.move(n, s.lineNumber, s.column, 0));
  }
  static simpleMove(e, t, n, i, r, o) {
    switch (n) {
      case 0:
        return 4 === o ? this._moveHalfLineLeft(e, t, i) : this._moveLeft(e, t, i, r);
      case 1:
        return 4 === o ? this._moveHalfLineRight(e, t, i) : this._moveRight(e, t, i, r);
      case 2:
        return 2 === o ? this._moveUpByViewLines(e, t, i, r) : this._moveUpByModelLines(e, t, i, r);
      case 3:
        return 2 === o
          ? this._moveDownByViewLines(e, t, i, r)
          : this._moveDownByModelLines(e, t, i, r);
      case 4:
        return 2 === o
          ? t.map((t) =>
              lz.fromViewState(kz.moveToPrevBlankLine(e.cursorConfig, e, t.viewState, i)),
            )
          : t.map((t) =>
              lz.fromModelState(kz.moveToPrevBlankLine(e.cursorConfig, e.model, t.modelState, i)),
            );
      case 5:
        return 2 === o
          ? t.map((t) =>
              lz.fromViewState(kz.moveToNextBlankLine(e.cursorConfig, e, t.viewState, i)),
            )
          : t.map((t) =>
              lz.fromModelState(kz.moveToNextBlankLine(e.cursorConfig, e.model, t.modelState, i)),
            );
      case 6:
        return this._moveToViewMinColumn(e, t, i);
      case 7:
        return this._moveToViewFirstNonWhitespaceColumn(e, t, i);
      case 8:
        return this._moveToViewCenterColumn(e, t, i);
      case 9:
        return this._moveToViewMaxColumn(e, t, i);
      case 10:
        return this._moveToViewLastNonWhitespaceColumn(e, t, i);
      default:
        return null;
    }
  }
  static viewportMove(e, t, n, i, r) {
    const o = e.getCompletelyVisibleViewRange(),
      s = e.coordinatesConverter.convertViewRangeToModelRange(o);
    switch (n) {
      case 11: {
        const n = this._firstLineNumberInRange(e.model, s, r),
          o = e.model.getLineFirstNonWhitespaceColumn(n);
        return [this._moveToModelPosition(e, t[0], i, n, o)];
      }
      case 13: {
        const n = this._lastLineNumberInRange(e.model, s, r),
          o = e.model.getLineFirstNonWhitespaceColumn(n);
        return [this._moveToModelPosition(e, t[0], i, n, o)];
      }
      case 12: {
        const n = Math.round((s.startLineNumber + s.endLineNumber) / 2),
          r = e.model.getLineFirstNonWhitespaceColumn(n);
        return [this._moveToModelPosition(e, t[0], i, n, r)];
      }
      case 14: {
        const n = [];
        for (let r = 0, s = t.length; r < s; r++) {
          const s = t[r];
          n[r] = this.findPositionInViewportIfOutside(e, s, o, i);
        }
        return n;
      }
      default:
        return null;
    }
  }
  static findPositionInViewportIfOutside(e, t, n, i) {
    const r = t.viewState.position.lineNumber;
    if (n.startLineNumber <= r && r <= n.endLineNumber - 1)
      return new lz(t.modelState, t.viewState);
    {
      let o;
      o =
        r > n.endLineNumber - 1
          ? n.endLineNumber - 1
          : r < n.startLineNumber
            ? n.startLineNumber
            : r;
      const s = kz.vertical(
        e.cursorConfig,
        e,
        r,
        t.viewState.position.column,
        t.viewState.leftoverVisibleColumns,
        o,
        !1,
      );
      return lz.fromViewState(
        t.viewState.move(i, s.lineNumber, s.column, s.leftoverVisibleColumns),
      );
    }
  }
  static _firstLineNumberInRange(e, t, n) {
    let i = t.startLineNumber;
    return (t.startColumn !== e.getLineMinColumn(i) && i++, Math.min(t.endLineNumber, i + n - 1));
  }
  static _lastLineNumberInRange(e, t, n) {
    let i = t.startLineNumber;
    return (t.startColumn !== e.getLineMinColumn(i) && i++, Math.max(i, t.endLineNumber - n + 1));
  }
  static _moveLeft(e, t, n, i) {
    return t.map((t) => {
      const r = e.getTextDirection(t.viewState.position.lineNumber) === qz.RTL;
      return lz.fromViewState(
        r
          ? kz.moveRight(e.cursorConfig, e, t.viewState, n, i)
          : kz.moveLeft(e.cursorConfig, e, t.viewState, n, i),
      );
    });
  }
  static _moveHalfLineLeft(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r],
        s = o.viewState.position.lineNumber,
        a = Math.round(e.getLineLength(s) / 2);
      i[r] = lz.fromViewState(kz.moveLeft(e.cursorConfig, e, o.viewState, n, a));
    }
    return i;
  }
  static _moveRight(e, t, n, i) {
    return t.map((t) => {
      const r = e.getTextDirection(t.viewState.position.lineNumber) === qz.RTL;
      return lz.fromViewState(
        r
          ? kz.moveLeft(e.cursorConfig, e, t.viewState, n, i)
          : kz.moveRight(e.cursorConfig, e, t.viewState, n, i),
      );
    });
  }
  static _moveHalfLineRight(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r],
        s = o.viewState.position.lineNumber,
        a = Math.round(e.getLineLength(s) / 2);
      i[r] = lz.fromViewState(kz.moveRight(e.cursorConfig, e, o.viewState, n, a));
    }
    return i;
  }
  static _moveDownByViewLines(e, t, n, i) {
    const r = [];
    for (let o = 0, s = t.length; o < s; o++) {
      const s = t[o];
      r[o] = lz.fromViewState(kz.moveDown(e.cursorConfig, e, s.viewState, n, i));
    }
    return r;
  }
  static _moveDownByModelLines(e, t, n, i) {
    const r = [];
    for (let o = 0, s = t.length; o < s; o++) {
      const s = t[o];
      r[o] = lz.fromModelState(kz.moveDown(e.cursorConfig, e.model, s.modelState, n, i));
    }
    return r;
  }
  static _moveUpByViewLines(e, t, n, i) {
    const r = [];
    for (let o = 0, s = t.length; o < s; o++) {
      const s = t[o];
      r[o] = lz.fromViewState(kz.moveUp(e.cursorConfig, e, s.viewState, n, i));
    }
    return r;
  }
  static _moveUpByModelLines(e, t, n, i) {
    const r = [];
    for (let o = 0, s = t.length; o < s; o++) {
      const s = t[o];
      r[o] = lz.fromModelState(kz.moveUp(e.cursorConfig, e.model, s.modelState, n, i));
    }
    return r;
  }
  static _moveToViewPosition(e, t, n, i, r) {
    return lz.fromViewState(t.viewState.move(n, i, r, 0));
  }
  static _moveToModelPosition(e, t, n, i, r) {
    return lz.fromModelState(t.modelState.move(n, i, r, 0));
  }
  static _moveToViewMinColumn(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r],
        s = o.viewState.position.lineNumber,
        a = e.getLineMinColumn(s);
      i[r] = this._moveToViewPosition(e, o, n, s, a);
    }
    return i;
  }
  static _moveToViewFirstNonWhitespaceColumn(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r],
        s = o.viewState.position.lineNumber,
        a = e.getLineFirstNonWhitespaceColumn(s);
      i[r] = this._moveToViewPosition(e, o, n, s, a);
    }
    return i;
  }
  static _moveToViewCenterColumn(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r],
        s = o.viewState.position.lineNumber,
        a = Math.round((e.getLineMaxColumn(s) + e.getLineMinColumn(s)) / 2);
      i[r] = this._moveToViewPosition(e, o, n, s, a);
    }
    return i;
  }
  static _moveToViewMaxColumn(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r],
        s = o.viewState.position.lineNumber,
        a = e.getLineMaxColumn(s);
      i[r] = this._moveToViewPosition(e, o, n, s, a);
    }
    return i;
  }
  static _moveToViewLastNonWhitespaceColumn(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r],
        s = o.viewState.position.lineNumber,
        a = e.getLineLastNonWhitespaceColumn(s);
      i[r] = this._moveToViewPosition(e, o, n, s, a);
    }
    return i;
  }
}
(!(function (e) {
  ((e.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:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t\t* 'noHistory': If 'true' does not add the movement to navigation history. Default is 'false'.\n\t\t\t\t",
        constraint: function (e) {
          if (!sR(e)) return !1;
          const t = e;
          return (
            !!oR(t.to) &&
            !(!uR(t.select) && !dR(t.select)) &&
            !(!uR(t.by) && !oR(t.by)) &&
            !(!uR(t.value) && !lR(t.value)) &&
            !(!uR(t.noHistory) && !dR(t.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: !1 },
            noHistory: { type: "boolean", default: !1 },
          },
        },
      },
    ],
  }),
    (e.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",
    }),
    (e.RawUnit = {
      Line: "line",
      WrappedLine: "wrappedLine",
      Character: "character",
      HalfLine: "halfLine",
    }),
    (e.parse = function (t) {
      if (!t.to) return null;
      let n;
      switch (t.to) {
        case e.RawDirection.Left:
          n = 0;
          break;
        case e.RawDirection.Right:
          n = 1;
          break;
        case e.RawDirection.Up:
          n = 2;
          break;
        case e.RawDirection.Down:
          n = 3;
          break;
        case e.RawDirection.PrevBlankLine:
          n = 4;
          break;
        case e.RawDirection.NextBlankLine:
          n = 5;
          break;
        case e.RawDirection.WrappedLineStart:
          n = 6;
          break;
        case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:
          n = 7;
          break;
        case e.RawDirection.WrappedLineColumnCenter:
          n = 8;
          break;
        case e.RawDirection.WrappedLineEnd:
          n = 9;
          break;
        case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:
          n = 10;
          break;
        case e.RawDirection.ViewPortTop:
          n = 11;
          break;
        case e.RawDirection.ViewPortBottom:
          n = 13;
          break;
        case e.RawDirection.ViewPortCenter:
          n = 12;
          break;
        case e.RawDirection.ViewPortIfOutside:
          n = 14;
          break;
        default:
          return null;
      }
      let i = 0;
      switch (t.by) {
        case e.RawUnit.Line:
          i = 1;
          break;
        case e.RawUnit.WrappedLine:
          i = 2;
          break;
        case e.RawUnit.Character:
          i = 3;
          break;
        case e.RawUnit.HalfLine:
          i = 4;
      }
      return {
        direction: n,
        unit: i,
        select: !!t.select,
        value: t.value || 1,
        noHistory: !!t.noHistory,
      };
    }));
})(Gz || (Gz = {})),
  (function (e) {
    ((e[(e.None = 0)] = "None"),
      (e[(e.Indent = 1)] = "Indent"),
      (e[(e.IndentOutdent = 2)] = "IndentOutdent"),
      (e[(e.Outdent = 3)] = "Outdent"));
  })(Zz || (Zz = {})));
class iU {
  constructor(e) {
    if (
      ((this._neutralCharacter = null),
      (this._neutralCharacterSearched = !1),
      (this.open = e.open),
      (this.close = e.close),
      (this._inString = !0),
      (this._inComment = !0),
      (this._inRegEx = !0),
      Array.isArray(e.notIn))
    )
      for (let t = 0, n = e.notIn.length; t < n; t++) {
        switch (e.notIn[t]) {
          case "string":
            this._inString = !1;
            break;
          case "comment":
            this._inComment = !1;
            break;
          case "regex":
            this._inRegEx = !1;
        }
      }
  }
  isOK(e) {
    switch (e) {
      case 0:
        return !0;
      case 1:
        return this._inComment;
      case 2:
        return this._inString;
      case 3:
        return this._inRegEx;
    }
  }
  shouldAutoClose(e, t) {
    if (0 === e.getTokenCount()) return !0;
    const n = e.findTokenIndexAtOffset(t - 2),
      i = e.getStandardTokenType(n);
    return this.isOK(i);
  }
  _findNeutralCharacterInRange(e, t) {
    for (let n = e; n <= t; n++) {
      const e = String.fromCharCode(n);
      if (!this.open.includes(e) && !this.close.includes(e)) return e;
    }
    return null;
  }
  findNeutralCharacter() {
    return (
      this._neutralCharacterSearched ||
        ((this._neutralCharacterSearched = !0),
        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
    );
  }
}
class rU {
  constructor(e) {
    ((this.autoClosingPairsOpenByStart = new Map()),
      (this.autoClosingPairsOpenByEnd = new Map()),
      (this.autoClosingPairsCloseByStart = new Map()),
      (this.autoClosingPairsCloseByEnd = new Map()),
      (this.autoClosingPairsCloseSingleChar = new Map()));
    for (const t of e)
      (oU(this.autoClosingPairsOpenByStart, t.open.charAt(0), t),
        oU(this.autoClosingPairsOpenByEnd, t.open.charAt(t.open.length - 1), t),
        oU(this.autoClosingPairsCloseByStart, t.close.charAt(0), t),
        oU(this.autoClosingPairsCloseByEnd, t.close.charAt(t.close.length - 1), t),
        1 === t.close.length &&
          1 === t.open.length &&
          oU(this.autoClosingPairsCloseSingleChar, t.close, t));
  }
}
function oU(e, t, n) {
  e.has(t) ? e.get(t).push(n) : e.set(t, [n]);
}
const sU = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";
const aU = (function (e = "") {
  let t = "(-?\\d*\\.\\d\\w*)|([^";
  for (const n of sU) e.indexOf(n) >= 0 || (t += "\\" + n);
  return ((t += "\\s]+)"), new RegExp(t, "g"));
})();
function lU(e) {
  let t = aU;
  if (e && e instanceof RegExp)
    if (e.global) t = e;
    else {
      let n = "g";
      (e.ignoreCase && (n += "i"),
        e.multiline && (n += "m"),
        e.unicode && (n += "u"),
        (t = new RegExp(e.source, n)));
    }
  return ((t.lastIndex = 0), t);
}
const cU = new HO();
function dU(e, t, n, i, r) {
  if (((t = lU(t)), r || (r = DO.first(cU)), n.length > r.maxLen)) {
    let o = e - r.maxLen / 2;
    return (o < 0 ? (o = 0) : (i += o), dU(e, t, (n = n.substring(o, e + r.maxLen / 2)), i, r));
  }
  const o = Date.now(),
    s = e - 1 - i;
  let a = -1,
    l = null;
  for (let c = 1; !(Date.now() - o >= r.timeBudget); c++) {
    const e = s - r.windowSize * c;
    t.lastIndex = Math.max(0, e);
    const i = uU(t, n, s, a);
    if (!i && l) break;
    if (((l = i), e <= 0)) break;
    a = e;
  }
  if (l) {
    const e = {
      word: l[0],
      startColumn: i + 1 + l.index,
      endColumn: i + 1 + l.index + l[0].length,
    };
    return ((t.lastIndex = 0), e);
  }
  return null;
}
function uU(e, t, n, i) {
  let r;
  for (; (r = e.exec(t)); ) {
    const t = r.index || 0;
    if (t <= n && e.lastIndex >= n) return r;
    if (i > 0 && t > i) return null;
  }
  return null;
}
cU.unshift({ maxLen: 1e3, windowSize: 15, timeBudget: 150 });
class hU {
  static {
    this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES = ";:.,=}])> \n\t";
  }
  static {
    this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS = "'\"`;:.,=}])> \n\t";
  }
  constructor(e) {
    if (
      (e.autoClosingPairs
        ? (this._autoClosingPairs = e.autoClosingPairs.map((e) => new iU(e)))
        : e.brackets
          ? (this._autoClosingPairs = e.brackets.map((e) => new iU({ open: e[0], close: e[1] })))
          : (this._autoClosingPairs = []),
      e.__electricCharacterSupport && e.__electricCharacterSupport.docComment)
    ) {
      const t = e.__electricCharacterSupport.docComment;
      this._autoClosingPairs.push(new iU({ open: t.open, close: t.close || "" }));
    }
    ((this._autoCloseBeforeForQuotes =
      "string" == typeof e.autoCloseBefore
        ? e.autoCloseBefore
        : hU.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES),
      (this._autoCloseBeforeForBrackets =
        "string" == typeof e.autoCloseBefore
          ? e.autoCloseBefore
          : hU.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS),
      (this._surroundingPairs = e.surroundingPairs || this._autoClosingPairs));
  }
  getAutoClosingPairs() {
    return this._autoClosingPairs;
  }
  getAutoCloseBeforeSet(e) {
    return e ? this._autoCloseBeforeForQuotes : this._autoCloseBeforeForBrackets;
  }
  getSurroundingPairs() {
    return this._surroundingPairs;
  }
}
let gU, pU, fU;
function mU() {
  return (gU || (gU = new TextDecoder("UTF-16LE")), gU);
}
function _U() {
  return (fU || (fU = XR() ? mU() : (pU || (pU = new TextDecoder("UTF-16BE")), pU)), fU);
}
function vU(e, t, n) {
  const i = new Uint16Array(e.buffer, t, n);
  return n > 0 && (65279 === i[0] || 65534 === i[0])
    ? (function (e, t, n) {
        const i = [];
        let r = 0;
        for (let o = 0; o < n; o++) {
          const n = jP(e, t);
          ((t += 2), (i[r++] = String.fromCharCode(n)));
        }
        return i.join("");
      })(e, t, n)
    : mU().decode(i);
}
class bU {
  constructor(e) {
    ((this._capacity = 0 | e),
      (this._buffer = new Uint16Array(this._capacity)),
      (this._completedStrings = null),
      (this._bufferLength = 0));
  }
  reset() {
    ((this._completedStrings = null), (this._bufferLength = 0));
  }
  build() {
    return null !== this._completedStrings
      ? (this._flushBuffer(), this._completedStrings.join(""))
      : this._buildBuffer();
  }
  _buildBuffer() {
    if (0 === this._bufferLength) return "";
    const e = new Uint16Array(this._buffer.buffer, 0, this._bufferLength);
    return _U().decode(e);
  }
  _flushBuffer() {
    const e = this._buildBuffer();
    ((this._bufferLength = 0),
      null === this._completedStrings
        ? (this._completedStrings = [e])
        : (this._completedStrings[this._completedStrings.length] = e));
  }
  appendCharCode(e) {
    const t = this._capacity - this._bufferLength;
    (t <= 1 && (0 === t || uA(e)) && this._flushBuffer(), (this._buffer[this._bufferLength++] = e));
  }
  appendASCIICharCode(e) {
    (this._bufferLength === this._capacity && this._flushBuffer(),
      (this._buffer[this._bufferLength++] = e));
  }
  appendString(e) {
    const t = e.length;
    if (this._bufferLength + t >= this._capacity)
      return (
        this._flushBuffer(),
        void (this._completedStrings[this._completedStrings.length] = e)
      );
    for (let n = 0; n < t; n++) this._buffer[this._bufferLength++] = e.charCodeAt(n);
  }
}
class yU {
  constructor(e, t, n, i, r, o) {
    ((this._richEditBracketBrand = void 0),
      (this.languageId = e),
      (this.index = t),
      (this.open = n),
      (this.close = i),
      (this.forwardRegex = r),
      (this.reversedRegex = o),
      (this._openSet = yU._toSet(this.open)),
      (this._closeSet = yU._toSet(this.close)));
  }
  isOpen(e) {
    return this._openSet.has(e);
  }
  isClose(e) {
    return this._closeSet.has(e);
  }
  static _toSet(e) {
    const t = new Set();
    for (const n of e) t.add(n);
    return t;
  }
}
class xU {
  constructor(e, t) {
    this._richEditBracketsBrand = void 0;
    const n = (function (e) {
      const t = e.length;
      e = e.map((e) => [e[0].toLowerCase(), e[1].toLowerCase()]);
      const n = [];
      for (let s = 0; s < t; s++) n[s] = s;
      const i = (e, t) => {
          const [n, i] = e,
            [r, o] = t;
          return n === r || n === o || i === r || i === o;
        },
        r = (e, i) => {
          const r = Math.min(e, i),
            o = Math.max(e, i);
          for (let s = 0; s < t; s++) n[s] === o && (n[s] = r);
        };
      for (let s = 0; s < t; s++) {
        const o = e[s];
        for (let a = s + 1; a < t; a++) i(o, e[a]) && r(n[s], n[a]);
      }
      const o = [];
      for (let s = 0; s < t; s++) {
        const i = [],
          r = [];
        for (let o = 0; o < t; o++)
          if (n[o] === s) {
            const [t, n] = e[o];
            (i.push(t), r.push(n));
          }
        i.length > 0 && o.push({ open: i, close: r });
      }
      return o;
    })(t);
    ((this.brackets = n.map(
      (t, i) =>
        new yU(
          e,
          i,
          t.open,
          t.close,
          (function (e, t, n, i) {
            let r = [];
            ((r = r.concat(e)), (r = r.concat(t)));
            for (let o = 0, s = r.length; o < s; o++) wU(r[o], n, i, r);
            return ((r = SU(r)), r.sort(CU), r.reverse(), EU(r));
          })(t.open, t.close, n, i),
          (function (e, t, n, i) {
            let r = [];
            ((r = r.concat(e)), (r = r.concat(t)));
            for (let o = 0, s = r.length; o < s; o++) wU(r[o], n, i, r);
            return ((r = SU(r)), r.sort(CU), r.reverse(), EU(r.map(NU)));
          })(t.open, t.close, n, i),
        ),
    )),
      (this.forwardRegex = (function (e) {
        let t = [];
        for (const n of e) {
          for (const e of n.open) t.push(e);
          for (const e of n.close) t.push(e);
        }
        return ((t = SU(t)), EU(t));
      })(this.brackets)),
      (this.reversedRegex = (function (e) {
        let t = [];
        for (const n of e) {
          for (const e of n.open) t.push(e);
          for (const e of n.close) t.push(e);
        }
        return ((t = SU(t)), EU(t.map(NU)));
      })(this.brackets)),
      (this.textIsBracket = {}),
      (this.textIsOpenBracket = {}),
      (this.maxBracketLength = 0));
    for (const i of this.brackets) {
      for (const e of i.open)
        ((this.textIsBracket[e] = i),
          (this.textIsOpenBracket[e] = !0),
          (this.maxBracketLength = Math.max(this.maxBracketLength, e.length)));
      for (const e of i.close)
        ((this.textIsBracket[e] = i),
          (this.textIsOpenBracket[e] = !1),
          (this.maxBracketLength = Math.max(this.maxBracketLength, e.length)));
    }
  }
}
function wU(e, t, n, i) {
  for (let r = 0, o = t.length; r < o; r++) {
    if (r === n) continue;
    const o = t[r];
    for (const t of o.open) t.indexOf(e) >= 0 && i.push(t);
    for (const t of o.close) t.indexOf(e) >= 0 && i.push(t);
  }
}
function CU(e, t) {
  return e.length - t.length;
}
function SU(e) {
  if (e.length <= 1) return e;
  const t = [],
    n = new Set();
  for (const i of e) n.has(i) || (t.push(i), n.add(i));
  return t;
}
function kU(e) {
  const t = /^[\w ]+$/.test(e);
  return ((e = zM(e)), t ? `\\b${e}\\b` : e);
}
function EU(e, t) {
  return KM(`(${e.map(kU).join(")|(")})`, !0, t);
}
const NU = (function () {
  let e = null,
    t = null;
  return function (n) {
    return (
      e !== n &&
        ((e = n),
        (t = (function (e) {
          const t = new Uint16Array(e.length);
          let n = 0;
          for (let i = e.length - 1; i >= 0; i--) t[n++] = e.charCodeAt(i);
          return _U().decode(t);
        })(e))),
      t
    );
  };
})();
class LU {
  static _findPrevBracketInText(e, t, n, i) {
    const r = n.match(e);
    if (!r) return null;
    const o = n.length - (r.index || 0),
      s = r[0].length,
      a = i + o;
    return new YH(t, a - s + 1, t, a + 1);
  }
  static findPrevBracketInRange(e, t, n, i, r) {
    const o = NU(n).substring(n.length - r, n.length - i);
    return this._findPrevBracketInText(e, t, o, i);
  }
  static findNextBracketInText(e, t, n, i) {
    const r = n.match(e);
    if (!r) return null;
    const o = r.index || 0,
      s = r[0].length;
    if (0 === s) return null;
    const a = i + o;
    return new YH(t, a + 1, t, a + 1 + s);
  }
  static findNextBracketInRange(e, t, n, i, r) {
    const o = n.substring(i, r);
    return this.findNextBracketInText(e, t, o, i);
  }
}
class DU {
  constructor(e) {
    this._richEditBrackets = e;
  }
  getElectricCharacters() {
    const e = [];
    if (this._richEditBrackets)
      for (const t of this._richEditBrackets.brackets)
        for (const n of t.close) {
          const t = n.charAt(n.length - 1);
          e.push(t);
        }
    return lj(e);
  }
  onElectricCharacter(e, t, n) {
    if (!this._richEditBrackets || 0 === this._richEditBrackets.brackets.length) return null;
    const i = t.findTokenIndexAtOffset(n - 1);
    if (ez(t.getStandardTokenType(i))) return null;
    const r = this._richEditBrackets.reversedRegex,
      o = t.getLineContent().substring(0, n - 1) + e,
      s = LU.findPrevBracketInRange(r, 1, o, 0, o.length);
    if (!s) return null;
    const a = o.substring(s.startColumn - 1, s.endColumn - 1).toLowerCase();
    if (this._richEditBrackets.textIsOpenBracket[a]) return null;
    const l = t.getActualLineContentBefore(s.startColumn - 1);
    return /^\s*$/.test(l) ? { matchOpenBracket: a } : null;
  }
}
function TU(e) {
  return (e.global && (e.lastIndex = 0), !0);
}
class IU {
  constructor(e) {
    this._indentationRules = e;
  }
  shouldIncrease(e) {
    return !!(
      this._indentationRules &&
      this._indentationRules.increaseIndentPattern &&
      TU(this._indentationRules.increaseIndentPattern) &&
      this._indentationRules.increaseIndentPattern.test(e)
    );
  }
  shouldDecrease(e) {
    return !!(
      this._indentationRules &&
      this._indentationRules.decreaseIndentPattern &&
      TU(this._indentationRules.decreaseIndentPattern) &&
      this._indentationRules.decreaseIndentPattern.test(e)
    );
  }
  shouldIndentNextLine(e) {
    return !!(
      this._indentationRules &&
      this._indentationRules.indentNextLinePattern &&
      TU(this._indentationRules.indentNextLinePattern) &&
      this._indentationRules.indentNextLinePattern.test(e)
    );
  }
  shouldIgnore(e) {
    return !!(
      this._indentationRules &&
      this._indentationRules.unIndentedLinePattern &&
      TU(this._indentationRules.unIndentedLinePattern) &&
      this._indentationRules.unIndentedLinePattern.test(e)
    );
  }
  getIndentMetadata(e) {
    let t = 0;
    return (
      this.shouldIncrease(e) && (t += 1),
      this.shouldDecrease(e) && (t += 2),
      this.shouldIndentNextLine(e) && (t += 4),
      this.shouldIgnore(e) && (t += 8),
      t
    );
  }
}
class RU {
  constructor(e) {
    (((e = e || {}).brackets = e.brackets || [
      ["(", ")"],
      ["{", "}"],
      ["[", "]"],
    ]),
      (this._brackets = []),
      e.brackets.forEach((e) => {
        const t = RU._createOpenBracketRegExp(e[0]),
          n = RU._createCloseBracketRegExp(e[1]);
        t && n && this._brackets.push({ open: e[0], openRegExp: t, close: e[1], closeRegExp: n });
      }),
      (this._regExpRules = e.onEnterRules || []));
  }
  onEnter(e, t, n, i) {
    if (e >= 3)
      for (let r = 0, o = this._regExpRules.length; r < o; r++) {
        const e = this._regExpRules[r];
        if (
          [
            { reg: e.beforeText, text: n },
            { reg: e.afterText, text: i },
            { reg: e.previousLineText, text: t },
          ].every((e) => !e.reg || ((e.reg.lastIndex = 0), e.reg.test(e.text)))
        )
          return e.action;
      }
    if (e >= 2 && n.length > 0 && i.length > 0)
      for (let r = 0, o = this._brackets.length; r < o; r++) {
        const e = this._brackets[r];
        if (e.openRegExp.test(n) && e.closeRegExp.test(i))
          return { indentAction: Zz.IndentOutdent };
      }
    if (e >= 2 && n.length > 0)
      for (let r = 0, o = this._brackets.length; r < o; r++) {
        if (this._brackets[r].openRegExp.test(n)) return { indentAction: Zz.Indent };
      }
    return null;
  }
  static _createOpenBracketRegExp(e) {
    let t = zM(e);
    return (/\B/.test(t.charAt(0)) || (t = "\\b" + t), (t += "\\s*$"), RU._safeRegExp(t));
  }
  static _createCloseBracketRegExp(e) {
    let t = zM(e);
    return (
      /\B/.test(t.charAt(t.length - 1)) || (t += "\\b"),
      (t = "^\\s*" + t),
      RU._safeRegExp(t)
    );
  }
  static _safeRegExp(e) {
    try {
      return new RegExp(e);
    } catch (t) {
      return (HI(t), null);
    }
  }
}
const OU = bV("configurationService");
function MU(e, t) {
  const n = Object.create(null);
  for (const i in e) AU(n, i, e[i], t);
  return n;
}
function AU(e, t, n, i) {
  const r = t.split("."),
    o = r.pop();
  let s = e;
  for (let a = 0; a < r.length; a++) {
    const e = r[a];
    let n = s[e];
    switch (typeof n) {
      case "undefined":
        n = s[e] = Object.create(null);
        break;
      case "object":
        if (null === n) return void i(`Ignoring ${t} as ${r.slice(0, a + 1).join(".")} is null`);
        break;
      default:
        return void i(`Ignoring ${t} as ${r.slice(0, a + 1).join(".")} is ${JSON.stringify(n)}`);
    }
    s = n;
  }
  if ("object" == typeof s && null !== s)
    try {
      s[o] = n;
    } catch (spt) {
      i(`Ignoring ${t} as ${r.join(".")} is ${JSON.stringify(s)}`);
    }
  else i(`Ignoring ${t} as ${r.join(".")} is ${JSON.stringify(s)}`);
}
function PU(e, t) {
  jU(e, t.split("."));
}
function jU(e, t) {
  if (!e) return;
  const n = t.shift();
  if (0 !== t.length) {
    if (-1 !== Object.keys(e).indexOf(n)) {
      const i = e[n];
      "object" != typeof i ||
        Array.isArray(i) ||
        (jU(i, t), 0 === Object.keys(i).length && delete e[n]);
    }
  } else delete e[n];
}
function FU(e, t, n) {
  const i = (function (e, t) {
    let n = e;
    for (const i of t) {
      if ("object" != typeof n || null === n) return;
      n = n[i];
    }
    return n;
  })(e, t.split("."));
  return void 0 === i ? n : i;
}
const BU = bV("languageService");
class VU {
  constructor(e, t = [], n = !1) {
    ((this.ctor = e), (this.staticArguments = t), (this.supportsDelayedInstantiation = n));
  }
}
const WU = [];
function HU(e, t, n) {
  (t instanceof VU || (t = new VU(t, [], Boolean(n))), WU.push([e, t]));
}
function zU() {
  return WU;
}
const UU = 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",
  }),
  $U = "base.contributions.json";
const qU = new (class extends PO {
  constructor() {
    (super(...arguments),
      (this.schemasById = {}),
      (this._onDidChangeSchema = this._register(new QO())));
  }
  registerSchema(e, t, n) {
    const i = (function (e) {
      return e.length > 0 && "#" === e.charAt(e.length - 1) ? e.substring(0, e.length - 1) : e;
    })(e);
    ((this.schemasById[i] = t),
      this._onDidChangeSchema.fire(e),
      n &&
        n.add(
          MO(() => {
            (delete this.schemasById[i], this._onDidChangeSchema.fire(e));
          }),
        ));
  }
  notifySchemaChanged(e) {
    this._onDidChangeSchema.fire(e);
  }
})();
let KU;
NW.add($U, qU);
const GU = globalThis.vscode;
if (void 0 !== GU && void 0 !== GU.context) {
  const e = GU.context.configuration();
  if (!e) throw new Error("Sandbox: unable to resolve product configuration from preload script.");
  KU = e.product;
} else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
  if (
    ((KU = globalThis._VSCODE_PRODUCT_JSON),
    VA.VSCODE_DEV &&
      Object.assign(KU, {
        nameShort: `${KU.nameShort} Dev`,
        nameLong: `${KU.nameLong} Dev`,
        dataFolderName: `${KU.dataFolderName}-dev`,
        serverDataFolderName: KU.serverDataFolderName ? `${KU.serverDataFolderName}-dev` : void 0,
      }),
    !KU.version)
  ) {
    const e = globalThis._VSCODE_PACKAGE_JSON;
    Object.assign(KU, { version: e.version });
  }
} else
  ((KU = {}),
    0 === Object.keys(KU).length &&
      Object.assign(KU, {
        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 ZU = KU;
const YU = "base.contributions.configuration",
  XU = "vscode://schemas/settings/resourceLanguage",
  QU = NW.as($U);
const JU = "\\[([^\\]]+)\\]",
  e$ = new RegExp(JU, "g"),
  t$ = new RegExp(`^(${JU})+$`);
function n$(e) {
  const t = [];
  if (t$.test(e)) {
    let n = e$.exec(e);
    for (; n?.length; ) {
      const i = n[1].trim();
      (i && t.push(i), (n = e$.exec(e)));
    }
  }
  return lj(t);
}
const i$ = new (class extends PO {
  constructor() {
    (super(),
      (this.registeredConfigurationDefaults = []),
      (this.overrideIdentifiers = new Set()),
      (this._onDidSchemaChange = this._register(new QO())),
      (this._onDidUpdateConfiguration = this._register(new QO())),
      (this.configurationDefaultsOverrides = new Map()),
      (this.defaultLanguageConfigurationOverridesNode = {
        id: "defaultOverrides",
        title: SI(1664, "Default Language Configuration Overrides"),
        properties: {},
      }),
      (this.configurationContributors = [this.defaultLanguageConfigurationOverridesNode]),
      (this.resourceLanguageSettingsSchema = {
        properties: {},
        patternProperties: {},
        additionalProperties: !0,
        allowTrailingCommas: !0,
        allowComments: !0,
      }),
      (this.configurationProperties = {}),
      (this.policyConfigurations = new Map()),
      (this.excludedConfigurationProperties = {}),
      QU.registerSchema(XU, this.resourceLanguageSettingsSchema),
      this.registerOverridePropertyPatternKey());
  }
  registerConfiguration(e, t = !0) {
    return (this.registerConfigurations([e], t), e);
  }
  registerConfigurations(e, t = !0) {
    const n = new Set();
    (this.doRegisterConfigurations(e, t, n),
      QU.registerSchema(XU, this.resourceLanguageSettingsSchema),
      this._onDidSchemaChange.fire(),
      this._onDidUpdateConfiguration.fire({ properties: n }));
  }
  registerDefaultConfigurations(e) {
    const t = new Set();
    (this.doRegisterDefaultConfigurations(e, t),
      this._onDidSchemaChange.fire(),
      this._onDidUpdateConfiguration.fire({ properties: t, defaultsOverrides: !0 }));
  }
  doRegisterDefaultConfigurations(e, t) {
    this.registeredConfigurationDefaults.push(...e);
    const n = [];
    for (const { overrides: i, source: r } of e)
      for (const e in i) {
        t.add(e);
        const o =
            this.configurationDefaultsOverrides.get(e) ??
            this.configurationDefaultsOverrides
              .set(e, { configurationDefaultOverrides: [] })
              .get(e),
          s = i[e];
        if ((o.configurationDefaultOverrides.push({ value: s, source: r }), t$.test(e))) {
          const t = this.mergeDefaultConfigurationsForOverrideIdentifier(
            e,
            s,
            r,
            o.configurationDefaultOverrideValue,
          );
          if (!t) continue;
          ((o.configurationDefaultOverrideValue = t),
            this.updateDefaultOverrideProperty(e, t, r),
            n.push(...n$(e)));
        } else {
          const t = this.mergeDefaultConfigurationsForConfigurationProperty(
            e,
            s,
            r,
            o.configurationDefaultOverrideValue,
          );
          if (!t) continue;
          o.configurationDefaultOverrideValue = t;
          const n = this.configurationProperties[e];
          n && (this.updatePropertyDefaultValue(e, n), this.updateSchema(e, n));
        }
      }
    this.doRegisterOverrideIdentifiers(n);
  }
  updateDefaultOverrideProperty(e, t, n) {
    const i = {
      section: {
        id: this.defaultLanguageConfigurationOverridesNode.id,
        title: this.defaultLanguageConfigurationOverridesNode.title,
        order: this.defaultLanguageConfigurationOverridesNode.order,
        extensionInfo: this.defaultLanguageConfigurationOverridesNode.extensionInfo,
      },
      type: "object",
      default: t.value,
      description: SI(
        1665,
        "Configure settings to be overridden for {0}.",
        ((r = e), r.replace(/^\[/, "").replace(/]$/g, "").replace(/\]\[/g, ", ")),
      ),
      $ref: XU,
      defaultDefaultValue: t.value,
      source: n,
      defaultValueSource: n,
    };
    var r;
    ((this.configurationProperties[e] = i),
      (this.defaultLanguageConfigurationOverridesNode.properties[e] = i));
  }
  mergeDefaultConfigurationsForOverrideIdentifier(e, t, n, i) {
    const r = i?.value || {},
      o = i?.source ?? new Map();
    if (o instanceof Map) {
      for (const e of Object.keys(t)) {
        const i = t[e];
        if (sR(i) && (uR(r[e]) || sR(r[e]))) {
          if (((r[e] = { ...(r[e] ?? {}), ...i }), n)) for (const t in i) o.set(`${e}.${t}`, n);
        } else ((r[e] = i), n ? o.set(e, n) : o.delete(e));
      }
      return { value: r, source: o };
    }
  }
  mergeDefaultConfigurationsForConfigurationProperty(e, t, n, i) {
    const r = this.configurationProperties[e],
      o = i?.value ?? r?.defaultDefaultValue;
    let s = n;
    if (sR(t) && ((void 0 !== r && "object" === r.type) || (void 0 === r && (uR(o) || sR(o))))) {
      if (((s = i?.source ?? new Map()), !(s instanceof Map))) return;
      for (const i in t) n && s.set(`${e}.${i}`, n);
      t = { ...(sR(o) ? o : {}), ...t };
    }
    return { value: t, source: s };
  }
  registerOverrideIdentifiers(e) {
    (this.doRegisterOverrideIdentifiers(e), this._onDidSchemaChange.fire());
  }
  doRegisterOverrideIdentifiers(e) {
    for (const t of e) this.overrideIdentifiers.add(t);
    this.updateOverridePropertyPatternKey();
  }
  doRegisterConfigurations(e, t, n) {
    e.forEach((e) => {
      (this.validateAndRegisterProperties(e, t, e.extensionInfo, e.restrictedProperties, void 0, n),
        this.configurationContributors.push(e),
        this.registerJSONConfiguration(e));
    });
  }
  validateAndRegisterProperties(e, t = !0, n, i, r = 4, o) {
    r = gR(e.scope) ? r : e.scope;
    const s = e.properties;
    if (s)
      for (const l in s) {
        const a = s[l];
        if (
          ((a.section = {
            id: e.id,
            title: e.title,
            order: e.order,
            extensionInfo: e.extensionInfo,
          }),
          t && r$(l, a, n?.id))
        ) {
          delete s[l];
          continue;
        }
        ((a.source = n),
          (a.defaultDefaultValue = s[l].default),
          this.updatePropertyDefaultValue(l, a),
          t$.test(l)
            ? (a.scope = void 0)
            : ((a.scope = gR(a.scope) ? r : a.scope),
              (a.restricted = gR(a.restricted) ? !!i?.includes(l) : a.restricted)),
          a.experiment
            ? a.tags?.some((e) => "onexp" === e.toLowerCase()) ||
              ((a.tags = a.tags ?? []), a.tags.push("onExP"))
            : a.tags?.some((e) => "onexp" === e.toLowerCase()) &&
              (a.experiment = { mode: "startup" }));
        const c = s[l].hasOwnProperty("included") && !s[l].included,
          d = s[l].policy?.name;
        c
          ? ((this.excludedConfigurationProperties[l] = s[l]),
            d && (this.policyConfigurations.set(d, l), o.add(l)),
            delete s[l])
          : (o.add(l),
            d && this.policyConfigurations.set(d, l),
            (this.configurationProperties[l] = s[l]),
            !s[l].deprecationMessage &&
              s[l].markdownDeprecationMessage &&
              (s[l].deprecationMessage = s[l].markdownDeprecationMessage));
      }
    const a = e.allOf;
    if (a) for (const l of a) this.validateAndRegisterProperties(l, t, n, i, r, o);
  }
  getConfigurationProperties() {
    return this.configurationProperties;
  }
  getPolicyConfigurations() {
    return this.policyConfigurations;
  }
  getExcludedConfigurationProperties() {
    return this.excludedConfigurationProperties;
  }
  registerJSONConfiguration(e) {
    const t = (e) => {
      const n = e.properties;
      if (n) for (const t in n) this.updateSchema(t, n[t]);
      const i = e.allOf;
      i?.forEach(t);
    };
    t(e);
  }
  updateSchema(e, t) {
    switch (t.scope) {
      case 1:
      case 2:
      case 3:
      case 7:
      case 4:
      case 5:
        break;
      case 6:
        this.resourceLanguageSettingsSchema.properties[e] = t;
    }
  }
  updateOverridePropertyPatternKey() {
    for (const e of this.overrideIdentifiers.values()) {
      const t = `[${e}]`,
        n = {
          type: "object",
          description: SI(1666, "Configure editor settings to be overridden for a language."),
          errorMessage: SI(1667, "This setting does not support per-language configuration."),
          $ref: XU,
        };
      this.updatePropertyDefaultValue(t, n);
    }
  }
  registerOverridePropertyPatternKey() {
    (SI(1668, "Configure editor settings to be overridden for a language."),
      SI(1669, "This setting does not support per-language configuration."),
      this._onDidSchemaChange.fire());
  }
  updatePropertyDefaultValue(e, t) {
    const n = this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;
    let i, r;
    (!n || (t.disallowConfigurationDefault && n.source) || ((i = n.value), (r = n.source)),
      uR(i) && ((i = t.defaultDefaultValue), (r = void 0)),
      uR(i) &&
        (i = (function (e) {
          switch (Array.isArray(e) ? e[0] : e) {
            case "boolean":
              return !1;
            case "integer":
            case "number":
              return 0;
            case "string":
              return "";
            case "array":
              return [];
            case "object":
              return {};
            default:
              return null;
          }
        })(t.type)),
      (t.default = i),
      (t.defaultValueSource = r));
  }
})();
function r$(e, t, n) {
  return e.trim()
    ? t$.test(e)
      ? SI(
          1671,
          "Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",
          e,
        )
      : void 0 === i$.getConfigurationProperties()[e] || (n && o$.has(n.toLowerCase()))
        ? t.policy?.name && void 0 !== i$.getPolicyConfigurations().get(t.policy?.name)
          ? SI(
              1673,
              "Cannot register '{0}'. The associated policy {1} is already registered with {2}.",
              e,
              t.policy?.name,
              i$.getPolicyConfigurations().get(t.policy?.name),
            )
          : null
        : SI(1672, "Cannot register '{0}'. This property is already registered.", e)
    : SI(1670, "Cannot register an empty property");
}
NW.add(YU, i$);
const o$ = new Set(
  ZU.defaultChatAgent
    ? [ZU.defaultChatAgent.extensionId, ZU.defaultChatAgent.chatExtensionId].map((e) =>
        e.toLowerCase(),
      )
    : [],
);
const s$ = new (class extends PO {
  constructor() {
    (super(),
      (this._onDidChangeLanguages = this._register(new QO())),
      (this.onDidChangeLanguages = this._onDidChangeLanguages.event),
      (this._languages = []));
  }
  registerLanguage(e) {
    return (
      this._languages.push(e),
      this._onDidChangeLanguages.fire(void 0),
      {
        dispose: () => {
          for (let t = 0, n = this._languages.length; t < n; t++)
            if (this._languages[t] === e) return void this._languages.splice(t, 1);
        },
      }
    );
  }
  getLanguages() {
    return this._languages;
  }
})();
NW.add("editor.modesRegistry", s$);
const a$ = "plaintext";
(s$.registerLanguage({
  id: a$,
  extensions: [".txt"],
  aliases: [SI(784, "Plain Text"), "text"],
  mimetypes: [UU.text],
}),
  NW.as(YU).registerDefaultConfigurations([
    {
      overrides: {
        "[plaintext]": {
          "editor.unicodeHighlight.ambiguousCharacters": !1,
          "editor.unicodeHighlight.invisibleCharacters": !1,
        },
        "[go]": { "editor.insertSpaces": !1 },
        "[makefile]": { "editor.insertSpaces": !1 },
        "[shellscript]": { "files.eol": "\n" },
        "[yaml]": { "editor.insertSpaces": !0, "editor.tabSize": 2 },
      },
    },
  ]));
class l$ {
  constructor(e, t) {
    this.languageId = e;
    const n = t.brackets ? c$(t.brackets) : [],
      i = new jM((e) => {
        const t = new Set();
        return { info: new u$(this, e, t), closing: t };
      }),
      r = new jM((e) => {
        const t = new Set(),
          n = new Set();
        return { info: new h$(this, e, t, n), opening: t, openingColorized: n };
      });
    for (const [s, a] of n) {
      const e = i.get(s),
        t = r.get(a);
      (e.closing.add(t.info), t.opening.add(e.info));
    }
    const o = t.colorizedBracketPairs
      ? c$(t.colorizedBracketPairs)
      : n.filter((e) => !("<" === e[0] && ">" === e[1]));
    for (const [s, a] of o) {
      const e = i.get(s),
        t = r.get(a);
      (e.closing.add(t.info), t.openingColorized.add(e.info), t.opening.add(e.info));
    }
    ((this._openingBrackets = new Map([...i.cachedValues].map(([e, t]) => [e, t.info]))),
      (this._closingBrackets = new Map([...r.cachedValues].map(([e, t]) => [e, t.info]))));
  }
  get openingBrackets() {
    return [...this._openingBrackets.values()];
  }
  get closingBrackets() {
    return [...this._closingBrackets.values()];
  }
  getOpeningBracketInfo(e) {
    return this._openingBrackets.get(e);
  }
  getClosingBracketInfo(e) {
    return this._closingBrackets.get(e);
  }
  getBracketInfo(e) {
    return this.getOpeningBracketInfo(e) || this.getClosingBracketInfo(e);
  }
  getBracketRegExp(e) {
    return EU(Array.from([...this._openingBrackets.keys(), ...this._closingBrackets.keys()]), e);
  }
}
function c$(e) {
  return e.filter(([e, t]) => "" !== e && "" !== t);
}
class d$ {
  constructor(e, t) {
    ((this.config = e), (this.bracketText = t));
  }
  get languageId() {
    return this.config.languageId;
  }
}
class u$ extends d$ {
  constructor(e, t, n) {
    (super(e, t), (this.openedBrackets = n), (this.isOpeningBracket = !0));
  }
}
class h$ extends d$ {
  constructor(e, t, n, i) {
    (super(e, t),
      (this.openingBrackets = n),
      (this.openingColorizedBrackets = i),
      (this.isOpeningBracket = !1));
  }
  closes(e) {
    return e.config === this.config && this.openingBrackets.has(e);
  }
  closesColorized(e) {
    return e.config === this.config && this.openingColorizedBrackets.has(e);
  }
  getOpeningBrackets() {
    return [...this.openingBrackets];
  }
}
var g$ = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
class p$ {
  constructor(e) {
    this.languageId = e;
  }
  affects(e) {
    return !this.languageId || this.languageId === e;
  }
}
const f$ = bV("languageConfigurationService");
let m$ = class extends PO {
  constructor(e, t) {
    (super(),
      (this.configurationService = e),
      (this.languageService = t),
      (this._registry = this._register(new S$())),
      (this.onDidChangeEmitter = this._register(new QO())),
      (this.onDidChange = this.onDidChangeEmitter.event),
      (this.configurations = new Map()));
    const n = new Set(Object.values(_$));
    (this._register(
      this.configurationService.onDidChangeConfiguration((e) => {
        const t = e.change.keys.some((e) => n.has(e)),
          i = e.change.overrides.filter(([e, t]) => t.some((e) => n.has(e))).map(([e]) => e);
        if (t) (this.configurations.clear(), this.onDidChangeEmitter.fire(new p$(void 0)));
        else
          for (const n of i)
            this.languageService.isRegisteredLanguageId(n) &&
              (this.configurations.delete(n), this.onDidChangeEmitter.fire(new p$(n)));
      }),
    ),
      this._register(
        this._registry.onDidChange((e) => {
          (this.configurations.delete(e.languageId),
            this.onDidChangeEmitter.fire(new p$(e.languageId)));
        }),
      ));
  }
  register(e, t, n) {
    return this._registry.register(e, t, n);
  }
  getLanguageConfiguration(e) {
    let t = this.configurations.get(e);
    return (
      t ||
        ((t = (function (e, t, n, i) {
          let r = t.getLanguageConfiguration(e);
          if (!r) {
            if (!i.isRegisteredLanguageId(e)) return new k$(e, {});
            r = new k$(e, {});
          }
          const o = (function (e, t) {
              const n = t.getValue(_$.brackets, { overrideIdentifier: e }),
                i = t.getValue(_$.colorizedBracketPairs, { overrideIdentifier: e });
              return { brackets: v$(n), colorizedBracketPairs: v$(i) };
            })(r.languageId, n),
            s = x$([r.underlyingConfig, o]),
            a = new k$(r.languageId, s);
          return a;
        })(e, this._registry, this.configurationService, this.languageService)),
        this.configurations.set(e, t)),
      t
    );
  }
};
m$ = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([g$(0, OU), g$(1, BU)], m$);
const _$ = {
  brackets: "editor.language.brackets",
  colorizedBracketPairs: "editor.language.colorizedBracketPairs",
};
function v$(e) {
  if (Array.isArray(e))
    return e
      .map((e) => {
        if (Array.isArray(e) && 2 === e.length) return [e[0], e[1]];
      })
      .filter((e) => !!e);
}
function b$(e, t, n) {
  let i = XM(e.getLineContent(t));
  return (i.length > n - 1 && (i = i.substring(0, n - 1)), i);
}
class y$ {
  constructor(e) {
    ((this.languageId = e),
      (this._resolved = null),
      (this._entries = []),
      (this._order = 0),
      (this._resolved = null));
  }
  register(e, t) {
    const n = new w$(e, t, ++this._order);
    return (
      this._entries.push(n),
      (this._resolved = null),
      MO(() => {
        for (let e = 0; e < this._entries.length; e++)
          if (this._entries[e] === n) {
            (this._entries.splice(e, 1), (this._resolved = null));
            break;
          }
      })
    );
  }
  getResolvedConfiguration() {
    if (!this._resolved) {
      const e = this._resolve();
      e && (this._resolved = new k$(this.languageId, e));
    }
    return this._resolved;
  }
  _resolve() {
    return 0 === this._entries.length
      ? null
      : (this._entries.sort(w$.cmp), x$(this._entries.map((e) => e.configuration)));
  }
}
function x$(e) {
  let t = {
    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 (const n of e)
    t = {
      comments: n.comments || t.comments,
      brackets: n.brackets || t.brackets,
      wordPattern: n.wordPattern || t.wordPattern,
      indentationRules: n.indentationRules || t.indentationRules,
      onEnterRules: n.onEnterRules || t.onEnterRules,
      autoClosingPairs: n.autoClosingPairs || t.autoClosingPairs,
      surroundingPairs: n.surroundingPairs || t.surroundingPairs,
      autoCloseBefore: n.autoCloseBefore || t.autoCloseBefore,
      folding: n.folding || t.folding,
      colorizedBracketPairs: n.colorizedBracketPairs || t.colorizedBracketPairs,
      __electricCharacterSupport: n.__electricCharacterSupport || t.__electricCharacterSupport,
    };
  return t;
}
class w$ {
  constructor(e, t, n) {
    ((this.configuration = e), (this.priority = t), (this.order = n));
  }
  static cmp(e, t) {
    return e.priority === t.priority ? e.order - t.order : e.priority - t.priority;
  }
}
class C$ {
  constructor(e) {
    this.languageId = e;
  }
}
class S$ extends PO {
  constructor() {
    (super(),
      (this._entries = new Map()),
      (this._onDidChange = this._register(new QO())),
      (this.onDidChange = this._onDidChange.event),
      this._register(
        this.register(
          a$,
          {
            brackets: [
              ["(", ")"],
              ["[", "]"],
              ["{", "}"],
            ],
            surroundingPairs: [
              { open: "{", close: "}" },
              { open: "[", close: "]" },
              { open: "(", close: ")" },
              { open: "<", close: ">" },
              { open: '"', close: '"' },
              { open: "'", close: "'" },
              { open: "`", close: "`" },
            ],
            colorizedBracketPairs: [],
            folding: { offSide: !0 },
          },
          0,
        ),
      ));
  }
  register(e, t, n = 0) {
    let i = this._entries.get(e);
    i || ((i = new y$(e)), this._entries.set(e, i));
    const r = i.register(t, n);
    return (
      this._onDidChange.fire(new C$(e)),
      MO(() => {
        (r.dispose(), this._onDidChange.fire(new C$(e)));
      })
    );
  }
  getLanguageConfiguration(e) {
    const t = this._entries.get(e);
    return t?.getResolvedConfiguration() || null;
  }
}
class k$ {
  constructor(e, t) {
    ((this.languageId = e),
      (this.underlyingConfig = t),
      (this._brackets = null),
      (this._electricCharacter = null),
      (this._onEnterSupport =
        this.underlyingConfig.brackets ||
        this.underlyingConfig.indentationRules ||
        this.underlyingConfig.onEnterRules
          ? new RU(this.underlyingConfig)
          : null),
      (this.comments = k$._handleComments(this.underlyingConfig)),
      (this.characterPair = new hU(this.underlyingConfig)),
      (this.wordDefinition = this.underlyingConfig.wordPattern || aU),
      (this.indentationRules = this.underlyingConfig.indentationRules),
      this.underlyingConfig.indentationRules
        ? (this.indentRulesSupport = new IU(this.underlyingConfig.indentationRules))
        : (this.indentRulesSupport = null),
      (this.foldingRules = this.underlyingConfig.folding || {}),
      (this.bracketsNew = new l$(e, this.underlyingConfig)));
  }
  getWordDefinition() {
    return lU(this.wordDefinition);
  }
  get brackets() {
    return (
      !this._brackets &&
        this.underlyingConfig.brackets &&
        (this._brackets = new xU(this.languageId, this.underlyingConfig.brackets)),
      this._brackets
    );
  }
  get electricCharacter() {
    return (
      this._electricCharacter || (this._electricCharacter = new DU(this.brackets)),
      this._electricCharacter
    );
  }
  onEnter(e, t, n, i) {
    return this._onEnterSupport ? this._onEnterSupport.onEnter(e, t, n, i) : null;
  }
  getAutoClosingPairs() {
    return new rU(this.characterPair.getAutoClosingPairs());
  }
  getAutoCloseBeforeSet(e) {
    return this.characterPair.getAutoCloseBeforeSet(e);
  }
  getSurroundingPairs() {
    return this.characterPair.getSurroundingPairs();
  }
  static _handleComments(e) {
    const t = e.comments;
    if (!t) return null;
    const n = {};
    if (
      (t.lineComment &&
        ("string" == typeof t.lineComment
          ? (n.lineCommentToken = t.lineComment)
          : ((n.lineCommentToken = t.lineComment.comment),
            (n.lineCommentNoIndent = t.lineComment.noIndent))),
      t.blockComment)
    ) {
      const [e, i] = t.blockComment;
      ((n.blockCommentStartToken = e), (n.blockCommentEndToken = i));
    }
    return n;
  }
}
HU(f$, m$, 1);
class E$ {
  static getLanguageId(e) {
    return (255 & e) >>> 0;
  }
  static getTokenType(e) {
    return (768 & e) >>> 8;
  }
  static containsBalancedBrackets(e) {
    return !!(1024 & e);
  }
  static getFontStyle(e) {
    return (30720 & e) >>> 11;
  }
  static getForeground(e) {
    return (16744448 & e) >>> 15;
  }
  static getBackground(e) {
    return (4278190080 & e) >>> 24;
  }
  static getClassNameFromMetadata(e) {
    let t = "mtk" + this.getForeground(e);
    const n = this.getFontStyle(e);
    return (
      1 & n && (t += " mtki"),
      2 & n && (t += " mtkb"),
      4 & n && (t += " mtku"),
      8 & n && (t += " mtks"),
      t
    );
  }
  static getInlineStyleFromMetadata(e, t) {
    const n = this.getForeground(e),
      i = this.getFontStyle(e);
    let r = `color: ${t[n]};`;
    (1 & i && (r += "font-style: italic;"), 2 & i && (r += "font-weight: bold;"));
    let o = "";
    return (
      4 & i && (o += " underline"),
      8 & i && (o += " line-through"),
      o && (r += `text-decoration:${o};`),
      r
    );
  }
  static getPresentationFromMetadata(e) {
    const t = this.getForeground(e),
      n = this.getFontStyle(e);
    return {
      foreground: t,
      italic: Boolean(1 & n),
      bold: Boolean(2 & n),
      underline: Boolean(4 & n),
      strikethrough: Boolean(8 & n),
    };
  }
}
class N$ {
  static fromTo(e, t) {
    return new N$(e, t);
  }
  static addRange(e, t) {
    let n = 0;
    for (; n < t.length && t[n].endExclusive < e.start; ) n++;
    let i = n;
    for (; i < t.length && t[i].start <= e.endExclusive; ) i++;
    if (n === i) t.splice(n, 0, e);
    else {
      const r = Math.min(e.start, t[n].start),
        o = Math.max(e.endExclusive, t[i - 1].endExclusive);
      t.splice(n, i - n, new N$(r, o));
    }
  }
  static tryCreate(e, t) {
    if (!(e > t)) return new N$(e, t);
  }
  static ofLength(e) {
    return new N$(0, e);
  }
  static ofStartAndLength(e, t) {
    return new N$(e, e + t);
  }
  static emptyAt(e) {
    return new N$(e, e);
  }
  constructor(e, t) {
    if (((this.start = e), (this.endExclusive = t), e > t))
      throw new QI(`Invalid range: ${this.toString()}`);
  }
  get isEmpty() {
    return this.start === this.endExclusive;
  }
  delta(e) {
    return new N$(this.start + e, this.endExclusive + e);
  }
  deltaStart(e) {
    return new N$(this.start + e, this.endExclusive);
  }
  deltaEnd(e) {
    return new N$(this.start, this.endExclusive + e);
  }
  get length() {
    return this.endExclusive - this.start;
  }
  toString() {
    return `[${this.start}, ${this.endExclusive})`;
  }
  equals(e) {
    return this.start === e.start && this.endExclusive === e.endExclusive;
  }
  contains(e) {
    return this.start <= e && e < this.endExclusive;
  }
  join(e) {
    return new N$(Math.min(this.start, e.start), Math.max(this.endExclusive, e.endExclusive));
  }
  intersect(e) {
    const t = Math.max(this.start, e.start),
      n = Math.min(this.endExclusive, e.endExclusive);
    if (t <= n) return new N$(t, n);
  }
  intersectionLength(e) {
    const t = Math.max(this.start, e.start),
      n = Math.min(this.endExclusive, e.endExclusive);
    return Math.max(0, n - t);
  }
  intersects(e) {
    return Math.max(this.start, e.start) < Math.min(this.endExclusive, e.endExclusive);
  }
  intersectsOrTouches(e) {
    return Math.max(this.start, e.start) <= Math.min(this.endExclusive, e.endExclusive);
  }
  isBefore(e) {
    return this.endExclusive <= e.start;
  }
  isAfter(e) {
    return this.start >= e.endExclusive;
  }
  slice(e) {
    return e.slice(this.start, this.endExclusive);
  }
  substring(e) {
    return e.substring(this.start, this.endExclusive);
  }
  clip(e) {
    if (this.isEmpty) throw new QI(`Invalid clipping range: ${this.toString()}`);
    return Math.max(this.start, Math.min(this.endExclusive - 1, e));
  }
  clipCyclic(e) {
    if (this.isEmpty) throw new QI(`Invalid clipping range: ${this.toString()}`);
    return e < this.start
      ? this.endExclusive - ((this.start - e) % this.length)
      : e >= this.endExclusive
        ? this.start + ((e - this.start) % this.length)
        : e;
  }
  forEach(e) {
    for (let t = this.start; t < this.endExclusive; t++) e(t);
  }
  joinRightTouching(e) {
    if (this.endExclusive !== e.start)
      throw new QI(`Invalid join: ${this.toString()} and ${e.toString()}`);
    return new N$(this.start, e.endExclusive);
  }
}
class L$ {
  constructor() {
    this._sortedRanges = [];
  }
  addRange(e) {
    let t = 0;
    for (; t < this._sortedRanges.length && this._sortedRanges[t].endExclusive < e.start; ) t++;
    let n = t;
    for (; n < this._sortedRanges.length && this._sortedRanges[n].start <= e.endExclusive; ) n++;
    if (t === n) this._sortedRanges.splice(t, 0, e);
    else {
      const i = Math.min(e.start, this._sortedRanges[t].start),
        r = Math.max(e.endExclusive, this._sortedRanges[n - 1].endExclusive);
      this._sortedRanges.splice(t, n - t, new N$(i, r));
    }
  }
  toString() {
    return this._sortedRanges.map((e) => e.toString()).join(", ");
  }
  intersectsStrict(e) {
    let t = 0;
    for (; t < this._sortedRanges.length && this._sortedRanges[t].endExclusive <= e.start; ) t++;
    return t < this._sortedRanges.length && this._sortedRanges[t].start < e.endExclusive;
  }
  intersectWithRange(e) {
    const t = new L$();
    for (const n of this._sortedRanges) {
      const i = n.intersect(e);
      i && t.addRange(i);
    }
    return t;
  }
  intersectWithRangeLength(e) {
    return this.intersectWithRange(e).length;
  }
  get length() {
    return this._sortedRanges.reduce((e, t) => e + t.length, 0);
  }
}
class D$ {
  static createEmpty(e, t) {
    const n = D$.defaultTokenMetadata,
      i = new Uint32Array(2);
    return ((i[0] = e.length), (i[1] = n), new D$(i, e, t));
  }
  static createFromTextAndMetadata(e, t) {
    let n = 0,
      i = "";
    const r = new Array();
    for (const { text: o, metadata: s } of e) (r.push(n + o.length, s), (n += o.length), (i += o));
    return new D$(new Uint32Array(r), i, t);
  }
  static convertToEndOffset(e, t) {
    const n = (e.length >>> 1) - 1;
    for (let i = 0; i < n; i++) e[i << 1] = e[(i + 1) << 1];
    e[n << 1] = t;
  }
  static findIndexInTokensArray(e, t) {
    if (e.length <= 2) return 0;
    let n = 0,
      i = (e.length >>> 1) - 1;
    for (; n < i; ) {
      const r = n + Math.floor((i - n) / 2),
        o = e[r << 1];
      if (o === t) return r + 1;
      o < t ? (n = r + 1) : o > t && (i = r);
    }
    return n;
  }
  static {
    this.defaultTokenMetadata = 33587200;
  }
  constructor(e, t, n) {
    this._lineTokensBrand = void 0;
    ((e.length > 1 ? e[e.length - 2] : 0) !== t.length &&
      HI(new Error("Token length and text length do not match!")),
      (this._tokens = e),
      (this._tokensCount = this._tokens.length >>> 1),
      (this._text = t),
      (this.languageIdCodec = n));
  }
  getTextLength() {
    return this._text.length;
  }
  equals(e) {
    return e instanceof D$ && this.slicedEquals(e, 0, this._tokensCount);
  }
  slicedEquals(e, t, n) {
    if (this._text !== e._text) return !1;
    if (this._tokensCount !== e._tokensCount) return !1;
    const i = t << 1,
      r = i + (n << 1);
    for (let o = i; o < r; o++) if (this._tokens[o] !== e._tokens[o]) return !1;
    return !0;
  }
  getLineContent() {
    return this._text;
  }
  getCount() {
    return this._tokensCount;
  }
  getStartOffset(e) {
    return e > 0 ? this._tokens[(e - 1) << 1] : 0;
  }
  getMetadata(e) {
    return this._tokens[1 + (e << 1)];
  }
  getLanguageId(e) {
    const t = this._tokens[1 + (e << 1)],
      n = E$.getLanguageId(t);
    return this.languageIdCodec.decodeLanguageId(n);
  }
  getStandardTokenType(e) {
    const t = this._tokens[1 + (e << 1)];
    return E$.getTokenType(t);
  }
  getForeground(e) {
    const t = this._tokens[1 + (e << 1)];
    return E$.getForeground(t);
  }
  getClassName(e) {
    const t = this._tokens[1 + (e << 1)];
    return E$.getClassNameFromMetadata(t);
  }
  getInlineStyle(e, t) {
    const n = this._tokens[1 + (e << 1)];
    return E$.getInlineStyleFromMetadata(n, t);
  }
  getPresentation(e) {
    const t = this._tokens[1 + (e << 1)];
    return E$.getPresentationFromMetadata(t);
  }
  getEndOffset(e) {
    return this._tokens[e << 1];
  }
  findTokenIndexAtOffset(e) {
    return D$.findIndexInTokensArray(this._tokens, e);
  }
  inflate() {
    return this;
  }
  sliceAndInflate(e, t, n) {
    return new T$(this, e, t, n);
  }
  sliceZeroCopy(e) {
    return this.sliceAndInflate(e.start, e.endExclusive, 0);
  }
  withInserted(e) {
    if (0 === e.length) return this;
    let t = 0,
      n = 0,
      i = "";
    const r = new Array();
    let o = 0;
    for (;;) {
      const s = t < this._tokensCount ? this._tokens[t << 1] : -1,
        a = n < e.length ? e[n] : null;
      if (-1 !== s && (null === a || s <= a.offset)) {
        i += this._text.substring(o, s);
        const e = this._tokens[1 + (t << 1)];
        (r.push(i.length, e), t++, (o = s));
      } else {
        if (!a) break;
        if (a.offset > o) {
          i += this._text.substring(o, a.offset);
          const e = this._tokens[1 + (t << 1)];
          (r.push(i.length, e), (o = a.offset));
        }
        ((i += a.text), r.push(i.length, a.tokenMetadata), n++);
      }
    }
    return new D$(new Uint32Array(r), i, this.languageIdCodec);
  }
  getTokensInRange(e) {
    const t = new O$(),
      n = this.findTokenIndexAtOffset(e.start),
      i = this.findTokenIndexAtOffset(e.endExclusive);
    for (let r = n; r <= i; r++) {
      const n = new N$(this.getStartOffset(r), this.getEndOffset(r)).intersectionLength(e);
      n > 0 && t.add(n, this.getMetadata(r));
    }
    return t.build();
  }
  getTokenText(e) {
    const t = this.getStartOffset(e),
      n = this.getEndOffset(e);
    return this._text.substring(t, n);
  }
  forEach(e) {
    const t = this.getCount();
    for (let n = 0; n < t; n++) e(n);
  }
  toString() {
    let e = "";
    return (
      this.forEach((t) => {
        e += `[${this.getTokenText(t)}]{${this.getClassName(t)}}`;
      }),
      e
    );
  }
}
class T$ {
  constructor(e, t, n, i) {
    ((this._source = e),
      (this._startOffset = t),
      (this._endOffset = n),
      (this._deltaOffset = i),
      (this._firstTokenIndex = e.findTokenIndexAtOffset(t)),
      (this.languageIdCodec = e.languageIdCodec),
      (this._tokensCount = 0));
    for (let r = this._firstTokenIndex, o = e.getCount(); r < o; r++) {
      if (e.getStartOffset(r) >= n) break;
      this._tokensCount++;
    }
  }
  getMetadata(e) {
    return this._source.getMetadata(this._firstTokenIndex + e);
  }
  getLanguageId(e) {
    return this._source.getLanguageId(this._firstTokenIndex + e);
  }
  getLineContent() {
    return this._source.getLineContent().substring(this._startOffset, this._endOffset);
  }
  equals(e) {
    return (
      e instanceof T$ &&
      this._startOffset === e._startOffset &&
      this._endOffset === e._endOffset &&
      this._deltaOffset === e._deltaOffset &&
      this._source.slicedEquals(e._source, this._firstTokenIndex, this._tokensCount)
    );
  }
  getCount() {
    return this._tokensCount;
  }
  getStandardTokenType(e) {
    return this._source.getStandardTokenType(this._firstTokenIndex + e);
  }
  getForeground(e) {
    return this._source.getForeground(this._firstTokenIndex + e);
  }
  getEndOffset(e) {
    const t = this._source.getEndOffset(this._firstTokenIndex + e);
    return Math.min(this._endOffset, t) - this._startOffset + this._deltaOffset;
  }
  getClassName(e) {
    return this._source.getClassName(this._firstTokenIndex + e);
  }
  getInlineStyle(e, t) {
    return this._source.getInlineStyle(this._firstTokenIndex + e, t);
  }
  getPresentation(e) {
    return this._source.getPresentation(this._firstTokenIndex + e);
  }
  findTokenIndexAtOffset(e) {
    return (
      this._source.findTokenIndexAtOffset(e + this._startOffset - this._deltaOffset) -
      this._firstTokenIndex
    );
  }
  getTokenText(e) {
    const t = this._firstTokenIndex + e,
      n = this._source.getStartOffset(t),
      i = this._source.getEndOffset(t);
    let r = this._source.getTokenText(t);
    return (
      n < this._startOffset && (r = r.substring(this._startOffset - n)),
      i > this._endOffset && (r = r.substring(0, r.length - (i - this._endOffset))),
      r
    );
  }
  forEach(e) {
    for (let t = 0; t < this.getCount(); t++) e(t);
  }
}
class I$ {
  static fromLineTokens(e) {
    const t = [];
    for (let n = 0; n < e.getCount(); n++)
      t.push(new R$(e.getEndOffset(n) - e.getStartOffset(n), e.getMetadata(n)));
    return I$.create(t);
  }
  static create(e) {
    return new I$(e);
  }
  constructor(e) {
    this._tokenInfo = e;
  }
  toLineTokens(e, t) {
    return D$.createFromTextAndMetadata(
      this.map((t, n) => ({ text: t.substring(e), metadata: n.metadata })),
      t,
    );
  }
  forEach(e) {
    let t = 0;
    for (const n of this._tokenInfo) {
      (e(new N$(t, t + n.length), n), (t += n.length));
    }
  }
  map(e) {
    const t = [];
    let n = 0;
    for (const i of this._tokenInfo) {
      const r = new N$(n, n + i.length);
      (t.push(e(r, i)), (n += i.length));
    }
    return t;
  }
  slice(e) {
    const t = [];
    let n = 0;
    for (const i of this._tokenInfo) {
      const r = n,
        o = r + i.length;
      if (o > e.start) {
        if (r >= e.endExclusive) break;
        const n = Math.max(0, e.start - r),
          s = Math.max(0, o - e.endExclusive);
        t.push(new R$(i.length - n - s, i.metadata));
      }
      n += i.length;
    }
    return I$.create(t);
  }
}
class R$ {
  constructor(e, t) {
    ((this.length = e), (this.metadata = t));
  }
}
class O$ {
  constructor() {
    this._tokens = [];
  }
  add(e, t) {
    this._tokens.push(new R$(e, t));
  }
  build() {
    return I$.create(this._tokens);
  }
}
class M$ {
  constructor(e, t, n) {
    ((this._indentRulesSupport = t), (this._indentationLineProcessor = new P$(e, n)));
  }
  shouldIncrease(e, t) {
    const n = this._indentationLineProcessor.getProcessedLine(e, t);
    return this._indentRulesSupport.shouldIncrease(n);
  }
  shouldDecrease(e, t) {
    const n = this._indentationLineProcessor.getProcessedLine(e, t);
    return this._indentRulesSupport.shouldDecrease(n);
  }
  shouldIgnore(e, t) {
    const n = this._indentationLineProcessor.getProcessedLine(e, t);
    return this._indentRulesSupport.shouldIgnore(n);
  }
  shouldIndentNextLine(e, t) {
    const n = this._indentationLineProcessor.getProcessedLine(e, t);
    return this._indentRulesSupport.shouldIndentNextLine(n);
  }
}
class A$ {
  constructor(e, t) {
    ((this.model = e), (this.indentationLineProcessor = new P$(e, t)));
  }
  getProcessedTokenContextAroundRange(e) {
    return {
      beforeRangeProcessedTokens: this._getProcessedTokensBeforeRange(e),
      afterRangeProcessedTokens: this._getProcessedTokensAfterRange(e),
      previousLineProcessedTokens: this._getProcessedPreviousLineTokens(e),
    };
  }
  _getProcessedTokensBeforeRange(e) {
    this.model.tokenization.forceTokenization(e.startLineNumber);
    const t = this.model.tokenization.getLineTokens(e.startLineNumber),
      n = QH(t, e.startColumn - 1);
    let i;
    if (j$(this.model, e.getStartPosition())) {
      const r = e.startColumn - 1 - n.firstCharOffset,
        o = n.firstCharOffset,
        s = o + r;
      i = t.sliceAndInflate(o, s, 0);
    } else {
      const n = e.startColumn - 1;
      i = t.sliceAndInflate(0, n, 0);
    }
    return this.indentationLineProcessor.getProcessedTokens(i);
  }
  _getProcessedTokensAfterRange(e) {
    const t = e.isEmpty() ? e.getStartPosition() : e.getEndPosition();
    this.model.tokenization.forceTokenization(t.lineNumber);
    const n = this.model.tokenization.getLineTokens(t.lineNumber),
      i = QH(n, t.column - 1),
      r = t.column - 1 - i.firstCharOffset,
      o = i.firstCharOffset + r,
      s = i.firstCharOffset + i.getLineLength(),
      a = n.sliceAndInflate(o, s, 0);
    return this.indentationLineProcessor.getProcessedTokens(a);
  }
  _getProcessedPreviousLineTokens(e) {
    this.model.tokenization.forceTokenization(e.startLineNumber);
    const t = QH(this.model.tokenization.getLineTokens(e.startLineNumber), e.startColumn - 1),
      n = D$.createEmpty("", t.languageIdCodec),
      i = e.startLineNumber - 1;
    if (0 === i) return n;
    if (!(0 === t.firstCharOffset)) return n;
    const r = ((e) => {
      this.model.tokenization.forceTokenization(e);
      return QH(this.model.tokenization.getLineTokens(e), this.model.getLineMaxColumn(e) - 1);
    })(i);
    if (!(t.languageId === r.languageId)) return n;
    const o = r.toIViewLineTokens();
    return this.indentationLineProcessor.getProcessedTokens(o);
  }
}
class P$ {
  constructor(e, t) {
    ((this.model = e), (this.languageConfigurationService = t));
  }
  getProcessedLine(e, t) {
    this.model.tokenization.forceTokenization?.(e);
    const n = this.model.tokenization.getLineTokens(e);
    let i = this.getProcessedTokens(n).getLineContent();
    return (
      void 0 !== t &&
        (i = ((e, t) => {
          const n = XM(e);
          return t + e.substring(n.length);
        })(i, t)),
      i
    );
  }
  getProcessedTokens(e) {
    const t = e.getLanguageId(0),
      n = this.languageConfigurationService
        .getLanguageConfiguration(t)
        .bracketsNew.getBracketRegExp({ global: !0 }),
      i = [];
    e.forEach((t) => {
      const r = e.getStandardTokenType(t);
      let o = e.getTokenText(t);
      ((e) => 2 === e || 3 === e || 1 === e)(r) && (o = o.replace(n, ""));
      const s = e.getMetadata(t);
      i.push({ text: o, metadata: s });
    });
    return D$.createFromTextAndMetadata(i, e.languageIdCodec);
  }
}
function j$(e, t) {
  e.tokenization.forceTokenization(t.lineNumber);
  const n = e.tokenization.getLineTokens(t.lineNumber),
    i = QH(n, t.column - 1),
    r = 0 === i.firstCharOffset,
    o = n.getLanguageId(0) === i.languageId;
  return !r && !o;
}
function F$(e, t, n, i) {
  t.tokenization.forceTokenization(n.startLineNumber);
  const r = t.getLanguageIdAtPosition(n.startLineNumber, n.startColumn),
    o = i.getLanguageConfiguration(r);
  if (!o) return null;
  const s = new A$(t, i).getProcessedTokenContextAroundRange(n),
    a = s.previousLineProcessedTokens.getLineContent(),
    l = s.beforeRangeProcessedTokens.getLineContent(),
    c = s.afterRangeProcessedTokens.getLineContent(),
    d = o.onEnter(e, a, l, c);
  if (!d) return null;
  const u = d.indentAction;
  let h = d.appendText;
  const g = d.removeText || 0;
  h
    ? u === Zz.Indent && (h = "\t" + h)
    : (h = u === Zz.Indent || u === Zz.IndentOutdent ? "\t" : "");
  let p = b$(t, n.startLineNumber, n.startColumn);
  return (
    g && (p = p.substring(0, p.length - g)),
    { indentAction: u, appendText: h, removeText: g, indentation: p }
  );
}
var B$;
const V$ = Object.create(null);
function W$(e, t) {
  if (t <= 0) return "";
  V$[e] || (V$[e] = ["", e]);
  const n = V$[e];
  for (let i = n.length; i <= t; i++) n[i] = n[i - 1] + e;
  return n[t];
}
let H$ = (B$ = class {
  static unshiftIndent(e, t, n, i, r) {
    const o = tz.visibleColumnFromColumn(e, t, n);
    if (r) {
      const e = W$(" ", i);
      return W$(e, tz.prevIndentTabStop(o, i) / i);
    }
    return W$("\t", tz.prevRenderTabStop(o, n) / n);
  }
  static shiftIndent(e, t, n, i, r) {
    const o = tz.visibleColumnFromColumn(e, t, n);
    if (r) {
      const e = W$(" ", i);
      return W$(e, tz.nextIndentTabStop(o, i) / i);
    }
    return W$("\t", tz.nextRenderTabStop(o, n) / n);
  }
  constructor(e, t, n) {
    ((this._languageConfigurationService = n),
      (this._opts = t),
      (this._selection = e),
      (this._selectionId = null),
      (this._useLastEditRangeForCursorEndPosition = !1),
      (this._selectionStartColumnStaysPut = !1));
  }
  _addEditOperation(e, t, n) {
    this._useLastEditRangeForCursorEndPosition
      ? e.addTrackedEditOperation(t, n)
      : e.addEditOperation(t, n);
  }
  getEditOperations(e, t) {
    const n = this._selection.startLineNumber;
    let i = this._selection.endLineNumber;
    1 === this._selection.endColumn && n !== i && (i -= 1);
    const { tabSize: r, indentSize: o, insertSpaces: s } = this._opts,
      a = n === i;
    if (this._opts.useTabStops) {
      this._selection.isEmpty() &&
        /^\s*$/.test(e.getLineContent(n)) &&
        (this._useLastEditRangeForCursorEndPosition = !0);
      let l = 0,
        c = 0;
      for (let d = n; d <= i; d++, l = c) {
        c = 0;
        const i = e.getLineContent(d);
        let u,
          h = YM(i);
        if (
          (!this._opts.isUnshift || (0 !== i.length && 0 !== h)) &&
          (a || this._opts.isUnshift || 0 !== i.length)
        ) {
          if ((-1 === h && (h = i.length), d > 1)) {
            if (
              tz.visibleColumnFromColumn(i, h + 1, r) % o !== 0 &&
              e.tokenization.isCheapToTokenize(d - 1)
            ) {
              const t = F$(
                this._opts.autoIndent,
                e,
                new YH(d - 1, e.getLineMaxColumn(d - 1), d - 1, e.getLineMaxColumn(d - 1)),
                this._languageConfigurationService,
              );
              if (t) {
                if (((c = l), t.appendText))
                  for (
                    let e = 0, n = t.appendText.length;
                    e < n && c < o && 32 === t.appendText.charCodeAt(e);
                    e++
                  )
                    c++;
                t.removeText && (c = Math.max(0, c - t.removeText));
                for (let e = 0; e < c && 0 !== h && 32 === i.charCodeAt(h - 1); e++) h--;
              }
            }
          }
          (this._opts.isUnshift && 0 === h) ||
            ((u = this._opts.isUnshift
              ? B$.unshiftIndent(i, h + 1, r, o, s)
              : B$.shiftIndent(i, h + 1, r, o, s)),
            this._addEditOperation(t, new YH(d, 1, d, h + 1), u),
            d !== n ||
              this._selection.isEmpty() ||
              (this._selectionStartColumnStaysPut = this._selection.startColumn <= h + 1));
        }
      }
    } else {
      !this._opts.isUnshift &&
        this._selection.isEmpty() &&
        0 === e.getLineLength(n) &&
        (this._useLastEditRangeForCursorEndPosition = !0);
      const r = s ? W$(" ", o) : "\t";
      for (let s = n; s <= i; s++) {
        const i = e.getLineContent(s);
        let l = YM(i);
        if (
          (!this._opts.isUnshift || (0 !== i.length && 0 !== l)) &&
          (a || this._opts.isUnshift || 0 !== i.length) &&
          (-1 === l && (l = i.length), !this._opts.isUnshift || 0 !== l)
        )
          if (this._opts.isUnshift) {
            l = Math.min(l, o);
            for (let e = 0; e < l; e++) {
              if (9 === i.charCodeAt(e)) {
                l = e + 1;
                break;
              }
            }
            this._addEditOperation(t, new YH(s, 1, s, l + 1), "");
          } else
            (this._addEditOperation(t, new YH(s, 1, s, 1), r),
              s !== n ||
                this._selection.isEmpty() ||
                (this._selectionStartColumnStaysPut = 1 === this._selection.startColumn));
      }
    }
    this._selectionId = t.trackSelection(this._selection);
  }
  computeCursorState(e, t) {
    if (this._useLastEditRangeForCursorEndPosition) {
      const e = t.getInverseEditOperations()[0];
      return new XH(
        e.range.endLineNumber,
        e.range.endColumn,
        e.range.endLineNumber,
        e.range.endColumn,
      );
    }
    const n = t.getTrackedSelection(this._selectionId);
    if (this._selectionStartColumnStaysPut) {
      const e = this._selection.startColumn;
      return n.startColumn <= e
        ? n
        : 0 === n.getDirection()
          ? new XH(n.startLineNumber, e, n.endLineNumber, n.endColumn)
          : new XH(n.endLineNumber, n.endColumn, n.startLineNumber, e);
    }
    return n;
  }
});
var z$, U$, $$;
H$ = B$ = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    ((z$ = 2),
    (U$ = f$),
    function (e, t) {
      U$(e, t, z$);
    }),
  ],
  H$,
);
class q$ {
  constructor(e, t, n) {
    ((this._range = e), (this._charBeforeSelection = t), (this._charAfterSelection = n));
  }
  getEditOperations(e, t) {
    (t.addTrackedEditOperation(
      new YH(
        this._range.startLineNumber,
        this._range.startColumn,
        this._range.startLineNumber,
        this._range.startColumn,
      ),
      this._charBeforeSelection,
    ),
      t.addTrackedEditOperation(
        new YH(
          this._range.endLineNumber,
          this._range.endColumn,
          this._range.endLineNumber,
          this._range.endColumn,
        ),
        this._charAfterSelection || null,
      ));
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations(),
      i = n[0].range,
      r = n[1].range;
    return new XH(
      i.endLineNumber,
      i.endColumn,
      r.endLineNumber,
      r.endColumn - this._charAfterSelection.length,
    );
  }
}
class K$ {
  constructor(e, t, n) {
    ((this._position = e), (this._text = t), (this._charAfter = n));
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(
      new YH(
        this._position.lineNumber,
        this._position.column,
        this._position.lineNumber,
        this._position.column,
      ),
      this._text + this._charAfter,
    );
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations()[0].range;
    return new XH(
      n.endLineNumber,
      n.startColumn,
      n.endLineNumber,
      n.endColumn - this._charAfter.length,
    );
  }
}
function G$(e, t, n, i = !0, r) {
  if (e < 4) return null;
  const o = r.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;
  if (!o) return null;
  const s = new M$(t, o, r);
  if (n <= 1) return { indentation: "", action: null };
  for (let l = n - 1; l > 0 && "" === t.getLineContent(l); l--)
    if (1 === l) return { indentation: "", action: null };
  const a = (function (e, t, n) {
    const i = e.tokenization.getLanguageIdAtPosition(t, 0);
    if (t > 1) {
      let r,
        o = -1;
      for (r = t - 1; r >= 1; r--) {
        if (e.tokenization.getLanguageIdAtPosition(r, 0) !== i) return o;
        const t = e.getLineContent(r);
        if (!n.shouldIgnore(r) && !/^\s+$/.test(t) && "" !== t) return r;
        o = r;
      }
    }
    return -1;
  })(t, n, s);
  if (a < 0) return null;
  if (a < 1) return { indentation: "", action: null };
  if (s.shouldIncrease(a) || s.shouldIndentNextLine(a)) {
    return { indentation: XM(t.getLineContent(a)), action: Zz.Indent, line: a };
  }
  if (s.shouldDecrease(a)) {
    return { indentation: XM(t.getLineContent(a)), action: null, line: a };
  }
  {
    if (1 === a) return { indentation: XM(t.getLineContent(a)), action: null, line: a };
    const e = a - 1,
      n = o.getIndentMetadata(t.getLineContent(e));
    if (!(3 & n) && 4 & n) {
      let n = 0;
      for (let t = e - 1; t > 0; t--)
        if (!s.shouldIndentNextLine(t)) {
          n = t;
          break;
        }
      return { indentation: XM(t.getLineContent(n + 1)), action: null, line: n + 1 };
    }
    if (i) return { indentation: XM(t.getLineContent(a)), action: null, line: a };
    for (let i = a; i > 0; i--) {
      if (s.shouldIncrease(i))
        return { indentation: XM(t.getLineContent(i)), action: Zz.Indent, line: i };
      if (s.shouldIndentNextLine(i)) {
        let e = 0;
        for (let t = i - 1; t > 0; t--)
          if (!s.shouldIndentNextLine(i)) {
            e = t;
            break;
          }
        return { indentation: XM(t.getLineContent(e + 1)), action: null, line: e + 1 };
      }
      if (s.shouldDecrease(i))
        return { indentation: XM(t.getLineContent(i)), action: null, line: i };
    }
    return { indentation: XM(t.getLineContent(1)), action: null, line: 1 };
  }
}
function Z$(e, t, n, i, r, o) {
  if (e < 4) return null;
  const s = o.getLanguageConfiguration(n);
  if (!s) return null;
  const a = o.getLanguageConfiguration(n).indentRulesSupport;
  if (!a) return null;
  const l = new M$(t, a, o),
    c = G$(e, t, i, void 0, o);
  if (c) {
    const n = c.line;
    if (void 0 !== n) {
      let o = !0;
      for (let e = n; e < i - 1; e++)
        if (!/^\s*$/.test(t.getLineContent(e))) {
          o = !1;
          break;
        }
      if (o) {
        const o = s.onEnter(e, "", t.getLineContent(n), "");
        if (o) {
          let e = XM(t.getLineContent(n));
          return (
            o.removeText && (e = e.substring(0, e.length - o.removeText)),
            o.indentAction === Zz.Indent || o.indentAction === Zz.IndentOutdent
              ? (e = r.shiftIndent(e))
              : o.indentAction === Zz.Outdent && (e = r.unshiftIndent(e)),
            l.shouldDecrease(i) && (e = r.unshiftIndent(e)),
            o.appendText && (e += o.appendText),
            XM(e)
          );
        }
      }
    }
    return l.shouldDecrease(i)
      ? c.action === Zz.Indent
        ? c.indentation
        : r.unshiftIndent(c.indentation)
      : c.action === Zz.Indent
        ? r.shiftIndent(c.indentation)
        : c.indentation;
  }
  return null;
}
function Y$(e, t, n) {
  const i = n.getLanguageConfiguration(e.getLanguageId()).indentRulesSupport;
  return i
    ? t < 1 || t > e.getLineCount()
      ? null
      : i.getIndentMetadata(e.getLineContent(t))
    : null;
}
class X$ {
  static getEdits(e, t, n, i, r) {
    if (!r && this._isAutoIndentType(e, t, n)) {
      const r = [];
      for (const s of n) {
        const n = this._findActualIndentationForSelection(e, t, s, i);
        if (null === n) return;
        r.push({ selection: s, indentation: n });
      }
      const o = eq.getAutoClosingPairClose(e, t, n, i, !1);
      return this._getIndentationAndAutoClosingPairEdits(e, t, r, i, o);
    }
  }
  static _isAutoIndentType(e, t, n) {
    if (e.autoIndent < 4) return !1;
    for (let i = 0, r = n.length; i < r; i++)
      if (!t.tokenization.isCheapToTokenize(n[i].getEndPosition().lineNumber)) return !1;
    return !0;
  }
  static _findActualIndentationForSelection(e, t, n, i) {
    const r = (function (e, t, n, i, r, o) {
      const s = e.autoIndent;
      if (s < 4) return null;
      if (j$(t, n.getStartPosition())) return null;
      const a = t.getLanguageIdAtPosition(n.startLineNumber, n.startColumn),
        l = o.getLanguageConfiguration(a).indentRulesSupport;
      if (!l) return null;
      const c = new A$(t, o).getProcessedTokenContextAroundRange(n),
        d = c.beforeRangeProcessedTokens.getLineContent(),
        u = c.afterRangeProcessedTokens.getLineContent(),
        h = d + u,
        g = d + i + u;
      if (!l.shouldDecrease(h) && l.shouldDecrease(g)) {
        const e = G$(s, t, n.startLineNumber, !1, o);
        if (!e) return null;
        let i = e.indentation;
        return (e.action !== Zz.Indent && (i = r.unshiftIndent(i)), i);
      }
      const p = n.startLineNumber - 1;
      if (p > 0) {
        const a = t.getLineContent(p);
        if (l.shouldIndentNextLine(a) && l.shouldIncrease(g)) {
          const a = G$(s, t, n.startLineNumber, !1, o),
            l = a?.indentation;
          if (void 0 !== l) {
            const o = XM(t.getLineContent(n.startLineNumber)),
              s = r.shiftIndent(l) === o,
              a = /^\s*$/.test(h),
              c = e.autoClosingPairs.autoClosingPairsOpenByEnd.get(i),
              d = c && c.length > 0;
            if (s && d && a) return l;
          }
        }
      }
      return null;
    })(
      e,
      t,
      n,
      i,
      { shiftIndent: (t) => bq(e, t), unshiftIndent: (t) => yq(e, t) },
      e.languageConfigurationService,
    );
    if (null === r) return null;
    const o = b$(t, n.startLineNumber, n.startColumn);
    return r === e.normalizeIndentation(o) ? null : r;
  }
  static _getIndentationAndAutoClosingPairEdits(e, t, n, i, r) {
    const o = n.map(({ selection: n, indentation: o }) => {
      if (null !== r) {
        const s = this._getEditFromIndentationAndSelection(e, t, o, n, i, !1);
        return new hq(s, n, i, r);
      }
      {
        const r = this._getEditFromIndentationAndSelection(e, t, o, n, i, !0);
        return vq(r.range, r.text, !1);
      }
    });
    return new hz(4, o, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !1 });
  }
  static _getEditFromIndentationAndSelection(e, t, n, i, r, o = !0) {
    const s = i.startLineNumber,
      a = t.getLineFirstNonWhitespaceColumn(s);
    let l = e.normalizeIndentation(n);
    if (0 !== a) {
      l += t.getLineContent(s).substring(a - 1, i.startColumn - 1);
    }
    l += o ? r : "";
    return { range: new YH(s, 1, i.endLineNumber, i.endColumn), text: l };
  }
}
class Q$ {
  static getEdits(e, t, n, i, r, o) {
    if (_q(t, n, i, r, o)) return this._runAutoClosingOvertype(e, i, o);
  }
  static _runAutoClosingOvertype(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const e = t[r].getPosition(),
        o = new YH(e.lineNumber, e.column, e.lineNumber, e.column + 1);
      i[r] = new fz(o, n);
    }
    return new hz(4, i, {
      shouldPushStackElementBefore: pq(e, 4),
      shouldPushStackElementAfter: !1,
    });
  }
}
class J$ {
  static getEdits(e, t, n, i, r) {
    if (_q(e, t, n, i, r)) {
      const e = n.map(
        (e) =>
          new fz(
            new YH(
              e.positionLineNumber,
              e.positionColumn,
              e.positionLineNumber,
              e.positionColumn + 1,
            ),
            "",
            !1,
          ),
      );
      return new hz(4, e, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !1 });
    }
  }
}
class eq {
  static getEdits(e, t, n, i, r, o) {
    if (!o) {
      const o = this.getAutoClosingPairClose(e, t, n, i, r);
      if (null !== o) return this._runAutoClosingOpenCharType(n, i, r, o);
    }
  }
  static _runAutoClosingOpenCharType(e, t, n, i) {
    const r = [];
    for (let o = 0, s = e.length; o < s; o++) {
      const s = e[o];
      r[o] = new uq(s, t, !n, i);
    }
    return new hz(4, r, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !1 });
  }
  static getAutoClosingPairClose(e, t, n, i, r) {
    for (const h of n) if (!h.isEmpty()) return null;
    const o = n.map((e) => {
        const t = e.getPosition();
        return r
          ? { lineNumber: t.lineNumber, beforeColumn: t.column - i.length, afterColumn: t.column }
          : { lineNumber: t.lineNumber, beforeColumn: t.column, afterColumn: t.column };
      }),
      s = this._findAutoClosingPairOpen(
        e,
        t,
        o.map((e) => new xV(e.lineNumber, e.beforeColumn)),
        i,
      );
    if (!s) return null;
    let a, l;
    if (gz(i)) ((a = e.autoClosingQuotes), (l = e.shouldAutoCloseBefore.quote));
    else {
      !!e.blockCommentStartToken && s.open.includes(e.blockCommentStartToken)
        ? ((a = e.autoClosingComments), (l = e.shouldAutoCloseBefore.comment))
        : ((a = e.autoClosingBrackets), (l = e.shouldAutoCloseBefore.bracket));
    }
    if ("never" === a) return null;
    const c = this._findContainedAutoClosingPair(e, s),
      d = c ? c.close : "";
    let u = !0;
    for (const h of o) {
      const { lineNumber: n, beforeColumn: r, afterColumn: o } = h,
        c = t.getLineContent(n),
        g = c.substring(0, r - 1),
        p = c.substring(o - 1);
      if ((p.startsWith(d) || (u = !1), p.length > 0)) {
        const t = p.charAt(0);
        if (!this._isBeforeClosingBrace(e, p) && !l(t)) return null;
      }
      if (1 === s.open.length && ("'" === i || '"' === i) && "always" !== a) {
        const t = Mz(e.wordSeparators, []);
        if (g.length > 0) {
          const e = g.charCodeAt(g.length - 1);
          if (0 === t.get(e)) return null;
        }
      }
      if (!t.tokenization.isCheapToTokenize(n)) return null;
      t.tokenization.forceTokenization(n);
      const f = QH(t.tokenization.getLineTokens(n), r - 1);
      if (!s.shouldAutoClose(f, r - f.firstCharOffset)) return null;
      const m = s.findNeutralCharacter();
      if (m) {
        const e = t.tokenization.getTokenTypeIfInsertingCharacter(n, r, m);
        if (!s.isOK(e)) return null;
      }
    }
    return u ? s.close.substring(0, s.close.length - d.length) : s.close;
  }
  static _findContainedAutoClosingPair(e, t) {
    if (t.open.length <= 1) return null;
    const n = t.close.charAt(t.close.length - 1),
      i = e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n) || [];
    let r = null;
    for (const o of i)
      o.open !== t.open &&
        t.open.includes(o.open) &&
        t.close.endsWith(o.close) &&
        (!r || o.open.length > r.open.length) &&
        (r = o);
    return r;
  }
  static _findAutoClosingPairOpen(e, t, n, i) {
    const r = e.autoClosingPairs.autoClosingPairsOpenByEnd.get(i);
    if (!r) return null;
    let o = null;
    for (const s of r)
      if (null === o || s.open.length > o.open.length) {
        let e = !0;
        for (const r of n) {
          if (
            t.getValueInRange(
              new YH(r.lineNumber, r.column - s.open.length + 1, r.lineNumber, r.column),
            ) +
              i !==
            s.open
          ) {
            e = !1;
            break;
          }
        }
        e && (o = s);
      }
    return o;
  }
  static _isBeforeClosingBrace(e, t) {
    const n = t.charAt(0),
      i = e.autoClosingPairs.autoClosingPairsOpenByStart.get(n) || [],
      r = e.autoClosingPairs.autoClosingPairsCloseByStart.get(n) || [],
      o = i.some((e) => t.startsWith(e.open)),
      s = r.some((e) => t.startsWith(e.close));
    return !o && s;
  }
}
class tq {
  static getEdits(e, t) {
    if (!("overtype" === e.inputMode)) return null;
    const n = t.map((e) => new yz(e.insertedTextRange));
    return new hz(4, n, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !1 });
  }
}
class nq {
  static getEdits(e, t, n, i, r) {
    if (!r && this._isSurroundSelectionType(e, t, n, i))
      return this._runSurroundSelectionType(e, n, i);
  }
  static _runSurroundSelectionType(e, t, n) {
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r],
        s = e.surroundingPairs[n];
      i[r] = new q$(o, n, s);
    }
    return new hz(0, i, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !0 });
  }
  static _isSurroundSelectionType(e, t, n, i) {
    if (!xq(e, i) || !e.surroundingPairs.hasOwnProperty(i)) return !1;
    const r = gz(i);
    for (const o of n) {
      if (o.isEmpty()) return !1;
      let e = !0;
      for (let n = o.startLineNumber; n <= o.endLineNumber; n++) {
        const i = t.getLineContent(n),
          r = n === o.startLineNumber ? o.startColumn - 1 : 0,
          s = n === o.endLineNumber ? o.endColumn - 1 : i.length,
          a = i.substring(r, s);
        if (/[^ \t]/.test(a)) {
          e = !1;
          break;
        }
      }
      if (e) return !1;
      if (r && o.startLineNumber === o.endLineNumber && o.startColumn + 1 === o.endColumn) {
        if (gz(t.getValueInRange(o))) return !1;
      }
    }
    return !0;
  }
}
class iq {
  static getEdits(e, t, n, i, r, o) {
    if (!o && this._isTypeInterceptorElectricChar(t, n, i)) {
      const o = this._typeInterceptorElectricChar(e, t, n, i[0], r);
      if (o) return o;
    }
  }
  static _isTypeInterceptorElectricChar(e, t, n) {
    return !(1 !== n.length || !t.tokenization.isCheapToTokenize(n[0].getEndPosition().lineNumber));
  }
  static _typeInterceptorElectricChar(e, t, n, i, r) {
    if (!t.electricChars.hasOwnProperty(r) || !i.isEmpty()) return null;
    const o = i.getPosition();
    n.tokenization.forceTokenization(o.lineNumber);
    const s = n.tokenization.getLineTokens(o.lineNumber);
    let a;
    try {
      a = t.onElectricCharacter(r, s, o.column);
    } catch (spt) {
      return (HI(spt), null);
    }
    if (!a) return null;
    if (a.matchOpenBracket) {
      const i = (s.getLineContent() + r).lastIndexOf(a.matchOpenBracket) + 1,
        l = n.bracketPairs.findMatchingBracketUp(
          a.matchOpenBracket,
          { lineNumber: o.lineNumber, column: i },
          500,
        );
      if (l) {
        if (l.startLineNumber === o.lineNumber) return null;
        const i = XM(n.getLineContent(l.startLineNumber)),
          s = t.normalizeIndentation(i),
          a = n.getLineContent(o.lineNumber),
          c = n.getLineFirstNonWhitespaceColumn(o.lineNumber) || o.column,
          d = s + a.substring(c - 1, o.column - 1) + r,
          u = new YH(o.lineNumber, 1, o.lineNumber, o.column),
          h = new fz(u, d);
        return new hz(gq(d, e), [h], {
          shouldPushStackElementBefore: !1,
          shouldPushStackElementAfter: !0,
        });
      }
    }
    return null;
  }
}
class rq {
  static getEdits(e, t, n, i, r) {
    const o = [];
    for (let a = 0, l = n.length; a < l; a++) {
      const t = "overtype" !== e.inputMode || r ? fz : mz;
      o[a] = new t(n[a], i);
    }
    const s = gq(i, t);
    return new hz(s, o, {
      shouldPushStackElementBefore: pq(t, s),
      shouldPushStackElementAfter: !1,
    });
  }
}
class oq {
  static getEdits(e, t, n, i, r) {
    if (!r && "\n" === i) {
      const i = [];
      for (let r = 0, o = n.length; r < o; r++) i[r] = this._enter(e, t, !1, n[r]);
      return new hz(4, i, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !1 });
    }
  }
  static _enter(e, t, n, i) {
    if (0 === e.autoIndent) return vq(i, "\n", n);
    if (!t.tokenization.isCheapToTokenize(i.getStartPosition().lineNumber) || 1 === e.autoIndent) {
      const r = XM(t.getLineContent(i.startLineNumber)).substring(0, i.startColumn - 1);
      return vq(i, "\n" + e.normalizeIndentation(r), n);
    }
    const r = F$(e.autoIndent, t, i, e.languageConfigurationService);
    if (r) {
      if (r.indentAction === Zz.None)
        return vq(i, "\n" + e.normalizeIndentation(r.indentation + r.appendText), n);
      if (r.indentAction === Zz.Indent)
        return vq(i, "\n" + e.normalizeIndentation(r.indentation + r.appendText), n);
      if (r.indentAction === Zz.IndentOutdent) {
        const t = e.normalizeIndentation(r.indentation),
          o = e.normalizeIndentation(r.indentation + r.appendText),
          s = "\n" + o + "\n" + t;
        return n ? new vz(i, s, !0) : new bz(i, s, -1, o.length - t.length, !0);
      }
      if (r.indentAction === Zz.Outdent) {
        const t = yq(e, r.indentation);
        return vq(i, "\n" + e.normalizeIndentation(t + r.appendText), n);
      }
    }
    const o = XM(t.getLineContent(i.startLineNumber)).substring(0, i.startColumn - 1);
    if (e.autoIndent >= 4) {
      const r = (function (e, t, n, i, r) {
        if (e < 4) return null;
        const o = t.getLanguageIdAtPosition(n.startLineNumber, n.startColumn),
          s = r.getLanguageConfiguration(o).indentRulesSupport;
        if (!s) return null;
        t.tokenization.forceTokenization(n.startLineNumber);
        const a = new A$(t, r).getProcessedTokenContextAroundRange(n),
          l = a.afterRangeProcessedTokens,
          c = a.beforeRangeProcessedTokens,
          d = XM(c.getLineContent()),
          u = (function (e, t, n) {
            return {
              tokenization: {
                getLineTokens: (i) => (i === t ? n : e.tokenization.getLineTokens(i)),
                getLanguageId: () => e.getLanguageId(),
                getLanguageIdAtPosition: (t, n) => e.getLanguageIdAtPosition(t, n),
              },
              getLineContent: (i) => (i === t ? n.getLineContent() : e.getLineContent(i)),
            };
          })(t, n.startLineNumber, c),
          h = j$(t, n.getStartPosition()),
          g = XM(t.getLineContent(n.startLineNumber)),
          p = G$(e, u, n.startLineNumber + 1, void 0, r);
        if (!p) {
          const e = h ? g : d;
          return { beforeEnter: e, afterEnter: e };
        }
        let f = h ? g : p.indentation;
        return (
          p.action === Zz.Indent && (f = i.shiftIndent(f)),
          s.shouldDecrease(l.getLineContent()) && (f = i.unshiftIndent(f)),
          { beforeEnter: h ? g : d, afterEnter: f }
        );
      })(
        e.autoIndent,
        t,
        i,
        {
          unshiftIndent: (t) => yq(e, t),
          shiftIndent: (t) => bq(e, t),
          normalizeIndentation: (t) => e.normalizeIndentation(t),
        },
        e.languageConfigurationService,
      );
      if (r) {
        let o = e.visibleColumnFromColumn(t, i.getEndPosition());
        const s = i.endColumn,
          a = YM(t.getLineContent(i.endLineNumber));
        if (
          ((i =
            a >= 0
              ? i.setEndPosition(i.endLineNumber, Math.max(i.endColumn, a + 1))
              : i.setEndPosition(i.endLineNumber, t.getLineMaxColumn(i.endLineNumber))),
          n)
        )
          return new vz(i, "\n" + e.normalizeIndentation(r.afterEnter), !0);
        {
          let t = 0;
          return (
            s <= a + 1 &&
              (e.insertSpaces || (o = Math.ceil(o / e.indentSize)),
              (t = Math.min(o + 1 - e.normalizeIndentation(r.afterEnter).length - 1, 0))),
            new bz(i, "\n" + e.normalizeIndentation(r.afterEnter), 0, t, !0)
          );
        }
      }
    }
    return vq(i, "\n" + e.normalizeIndentation(o), n);
  }
  static lineInsertBefore(e, t, n) {
    if (null === t || null === n) return [];
    const i = [];
    for (let r = 0, o = n.length; r < o; r++) {
      let o = n[r].positionLineNumber;
      if (1 === o) i[r] = new vz(new YH(1, 1, 1, 1), "\n");
      else {
        o--;
        const n = t.getLineMaxColumn(o);
        i[r] = this._enter(e, t, !1, new YH(o, n, o, n));
      }
    }
    return i;
  }
  static lineInsertAfter(e, t, n) {
    if (null === t || null === n) return [];
    const i = [];
    for (let r = 0, o = n.length; r < o; r++) {
      const o = n[r].positionLineNumber,
        s = t.getLineMaxColumn(o);
      i[r] = this._enter(e, t, !1, new YH(o, s, o, s));
    }
    return i;
  }
  static lineBreakInsert(e, t, n) {
    const i = [];
    for (let r = 0, o = n.length; r < o; r++) i[r] = this._enter(e, t, !0, n[r]);
    return i;
  }
}
class sq {
  static getEdits(e, t, n, i, r, o) {
    const s = this._distributePasteToCursors(e, n, i, r, o);
    return s
      ? ((n = n.sort(YH.compareRangesUsingStarts)), this._distributedPaste(e, t, n, s))
      : this._simplePaste(e, t, n, i, r);
  }
  static _distributePasteToCursors(e, t, n, i, r) {
    if (i) return null;
    if (1 === t.length) return null;
    if (r && r.length === t.length) return r;
    if ("spread" === e.multiCursorPaste) {
      (10 === n.charCodeAt(n.length - 1) && (n = n.substring(0, n.length - 1)),
        13 === n.charCodeAt(n.length - 1) && (n = n.substring(0, n.length - 1)));
      const e = ZM(n);
      if (e.length === t.length) return e;
    }
    return null;
  }
  static _distributedPaste(e, t, n, i) {
    const r = [];
    for (let o = 0, s = n.length; o < s; o++) {
      const t = e.overtypeOnPaste && "overtype" === e.inputMode ? mz : fz;
      r[o] = new t(n[o], i[o]);
    }
    return new hz(0, r, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !0 });
  }
  static _simplePaste(e, t, n, i, r) {
    const o = [];
    for (let s = 0, a = n.length; s < a; s++) {
      const t = n[s],
        a = t.getPosition();
      if ((r && !t.isEmpty() && (r = !1), r && i.indexOf("\n") !== i.length - 1 && (r = !1), r)) {
        const e = new YH(a.lineNumber, 1, a.lineNumber, 1);
        o[s] = new xz(e, i, t, !0);
      } else {
        const n = e.overtypeOnPaste && "overtype" === e.inputMode ? mz : fz;
        o[s] = new n(t, i);
      }
    }
    return new hz(0, o, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !0 });
  }
}
class aq {
  static getEdits(e, t, n, i, r, o, s, a) {
    const l = i.map((e) => this._compositionType(n, e, r, o, s, a));
    return new hz(4, l, {
      shouldPushStackElementBefore: pq(e, 4),
      shouldPushStackElementAfter: !1,
    });
  }
  static _compositionType(e, t, n, i, r, o) {
    if (!t.isEmpty()) return null;
    const s = t.getPosition(),
      a = Math.max(1, s.column - i),
      l = Math.min(e.getLineMaxColumn(s.lineNumber), s.column + r),
      c = new YH(s.lineNumber, a, s.lineNumber, l);
    return new bz(c, n, 0, o);
  }
}
class lq {
  static getEdits(e, t, n) {
    const i = [];
    for (let o = 0, s = t.length; o < s; o++) i[o] = new fz(t[o], n);
    const r = gq(n, e);
    return new hz(r, i, {
      shouldPushStackElementBefore: pq(e, r),
      shouldPushStackElementAfter: !1,
    });
  }
}
class cq {
  static getCommands(e, t, n) {
    const i = [];
    for (let r = 0, o = n.length; r < o; r++) {
      const o = n[r];
      if (o.isEmpty()) {
        const n = t.getLineContent(o.startLineNumber);
        if (/^\s*$/.test(n) && t.tokenization.isCheapToTokenize(o.startLineNumber)) {
          let s = this._goodIndentForLine(e, t, o.startLineNumber);
          s = s || "\t";
          const a = e.normalizeIndentation(s);
          if (!n.startsWith(a)) {
            i[r] = new fz(new YH(o.startLineNumber, 1, o.startLineNumber, n.length + 1), a, !0);
            continue;
          }
        }
        i[r] = this._replaceJumpToNextIndent(e, t, o, !0);
      } else {
        if (o.startLineNumber === o.endLineNumber) {
          const n = t.getLineMaxColumn(o.startLineNumber);
          if (1 !== o.startColumn || o.endColumn !== n) {
            i[r] = this._replaceJumpToNextIndent(e, t, o, !1);
            continue;
          }
        }
        i[r] = new H$(
          o,
          {
            isUnshift: !1,
            tabSize: e.tabSize,
            indentSize: e.indentSize,
            insertSpaces: e.insertSpaces,
            useTabStops: e.useTabStops,
            autoIndent: e.autoIndent,
          },
          e.languageConfigurationService,
        );
      }
    }
    return i;
  }
  static _goodIndentForLine(e, t, n) {
    let i = null,
      r = "";
    const o = G$(e.autoIndent, t, n, !1, e.languageConfigurationService);
    if (o) ((i = o.action), (r = o.indentation));
    else if (n > 1) {
      let i;
      for (i = n - 1; i >= 1; i--) {
        if (QM(t.getLineContent(i)) >= 0) break;
      }
      if (i < 1) return null;
      const o = t.getLineMaxColumn(i),
        s = F$(e.autoIndent, t, new YH(i, o, i, o), e.languageConfigurationService);
      s && (r = s.indentation + s.appendText);
    }
    return (
      i &&
        (i === Zz.Indent && (r = bq(e, r)),
        i === Zz.Outdent && (r = yq(e, r)),
        (r = e.normalizeIndentation(r))),
      r || null
    );
  }
  static _replaceJumpToNextIndent(e, t, n, i) {
    let r = "";
    const o = n.getStartPosition();
    if (e.insertSpaces) {
      const n = e.visibleColumnFromColumn(t, o),
        i = e.indentSize,
        s = i - (n % i);
      for (let e = 0; e < s; e++) r += " ";
    } else r = "\t";
    return new fz(n, r, i);
  }
}
class dq extends bz {
  constructor(e, t, n, i, r, o) {
    (super(e, t, n, i),
      (this._openCharacter = r),
      (this._closeCharacter = o),
      (this.closeCharacterRange = null),
      (this.enclosingRange = null));
  }
  _computeCursorStateWithRange(e, t, n) {
    return (
      (this.closeCharacterRange = new YH(
        t.startLineNumber,
        t.endColumn - this._closeCharacter.length,
        t.endLineNumber,
        t.endColumn,
      )),
      (this.enclosingRange = new YH(
        t.startLineNumber,
        t.endColumn - this._openCharacter.length - this._closeCharacter.length,
        t.endLineNumber,
        t.endColumn,
      )),
      super.computeCursorState(e, n)
    );
  }
}
class uq extends dq {
  constructor(e, t, n, i) {
    super(e, (n ? t : "") + i, 0, -i.length, t, i);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations()[0].range;
    return this._computeCursorStateWithRange(e, n, t);
  }
}
class hq extends dq {
  constructor(e, t, n, i) {
    const r = n + i;
    (super(t, r, 0, n.length, n, i),
      (this._autoIndentationEdit = e),
      (this._autoClosingEdit = { range: t, text: r }));
  }
  getEditOperations(e, t) {
    (t.addTrackedEditOperation(this._autoIndentationEdit.range, this._autoIndentationEdit.text),
      t.addTrackedEditOperation(this._autoClosingEdit.range, this._autoClosingEdit.text));
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations();
    if (2 !== n.length) throw new Error("There should be two inverse edit operations!");
    const i = n[0].range,
      r = n[1].range,
      o = i.plusRange(r);
    return this._computeCursorStateWithRange(e, o, t);
  }
}
function gq(e, t) {
  return " " === e ? (5 === t || 6 === t ? 6 : 5) : 4;
}
function pq(e, t) {
  return !(!mq(e) || mq(t)) || (5 !== e && fq(e) !== fq(t));
}
function fq(e) {
  return 6 === e || 5 === e ? "space" : e;
}
function mq(e) {
  return 4 === e || 5 === e || 6 === e;
}
function _q(e, t, n, i, r) {
  if ("never" === e.autoClosingOvertype) return !1;
  if (!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(r)) return !1;
  for (let o = 0, s = n.length; o < s; o++) {
    const s = n[o];
    if (!s.isEmpty()) return !1;
    const a = s.getPosition(),
      l = t.getLineContent(a.lineNumber);
    if (l.charAt(a.column - 1) !== r) return !1;
    const c = gz(r);
    if (92 === (a.column > 2 ? l.charCodeAt(a.column - 2) : 0) && c) return !1;
    if ("auto" === e.autoClosingOvertype) {
      let e = !1;
      for (let t = 0, n = i.length; t < n; t++) {
        const n = i[t];
        if (a.lineNumber === n.startLineNumber && a.column === n.startColumn) {
          e = !0;
          break;
        }
      }
      if (!e) return !1;
    }
  }
  return !0;
}
function vq(e, t, n) {
  return n ? new vz(e, t, !0) : new fz(e, t, !0);
}
function bq(e, t, n) {
  return ((n = n || 1), H$.shiftIndent(t, t.length + n, e.tabSize, e.indentSize, e.insertSpaces));
}
function yq(e, t, n) {
  return ((n = n || 1), H$.unshiftIndent(t, t.length + n, e.tabSize, e.indentSize, e.insertSpaces));
}
function xq(e, t) {
  return gz(t)
    ? "quotes" === e.autoSurround || "languageDefined" === e.autoSurround
    : "brackets" === e.autoSurround || "languageDefined" === e.autoSurround;
}
class wq {
  static indent(e, t, n) {
    if (null === t || null === n) return [];
    const i = [];
    for (let r = 0, o = n.length; r < o; r++)
      i[r] = new H$(
        n[r],
        {
          isUnshift: !1,
          tabSize: e.tabSize,
          indentSize: e.indentSize,
          insertSpaces: e.insertSpaces,
          useTabStops: e.useTabStops,
          autoIndent: e.autoIndent,
        },
        e.languageConfigurationService,
      );
    return i;
  }
  static outdent(e, t, n) {
    const i = [];
    for (let r = 0, o = n.length; r < o; r++)
      i[r] = new H$(
        n[r],
        {
          isUnshift: !0,
          tabSize: e.tabSize,
          indentSize: e.indentSize,
          insertSpaces: e.insertSpaces,
          useTabStops: e.useTabStops,
          autoIndent: e.autoIndent,
        },
        e.languageConfigurationService,
      );
    return i;
  }
  static paste(e, t, n, i, r, o) {
    return sq.getEdits(e, t, n, i, r, o);
  }
  static tab(e, t, n) {
    return cq.getCommands(e, t, n);
  }
  static compositionType(e, t, n, i, r, o, s, a) {
    return aq.getEdits(e, t, n, i, r, o, s, a);
  }
  static compositionEndWithInterceptors(e, t, n, i, r, o) {
    if (!i) return null;
    let s = null;
    for (const u of i)
      if (null === s) s = u.insertedText;
      else if (s !== u.insertedText) return null;
    if (!s || 1 !== s.length) return tq.getEdits(t, i);
    const a = s;
    let l = !1;
    for (const u of i)
      if (0 !== u.deletedText.length) {
        l = !0;
        break;
      }
    if (l) {
      if (!xq(t, a) || !t.surroundingPairs.hasOwnProperty(a)) return null;
      const e = gz(a);
      for (const t of i) {
        if (0 !== t.deletedSelectionStart || t.deletedSelectionEnd !== t.deletedText.length)
          return null;
        if (/^[ \t]+$/.test(t.deletedText)) return null;
        if (e && gz(t.deletedText)) return null;
      }
      const n = [];
      for (const t of r) {
        if (!t.isEmpty()) return null;
        n.push(t.getPosition());
      }
      if (n.length !== i.length) return null;
      const o = [];
      for (let r = 0, s = n.length; r < s; r++)
        o.push(new K$(n[r], i[r].deletedText, t.surroundingPairs[a]));
      return new hz(4, o, { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !1 });
    }
    const c = J$.getEdits(t, n, r, o, a);
    if (void 0 !== c) return c;
    const d = eq.getEdits(t, n, r, a, !0, !1);
    return void 0 !== d ? d : tq.getEdits(t, i);
  }
  static typeWithInterceptors(e, t, n, i, r, o, s) {
    const a = oq.getEdits(n, i, r, s, e);
    if (void 0 !== a) return a;
    const l = X$.getEdits(n, i, r, s, e);
    if (void 0 !== l) return l;
    const c = Q$.getEdits(t, n, i, r, o, s);
    if (void 0 !== c) return c;
    const d = eq.getEdits(n, i, r, s, !1, e);
    if (void 0 !== d) return d;
    const u = nq.getEdits(n, i, r, s, e);
    if (void 0 !== u) return u;
    const h = iq.getEdits(t, n, i, r, s, e);
    return void 0 !== h ? h : rq.getEdits(n, t, r, s, e);
  }
  static typeWithoutInterceptors(e, t, n, i, r) {
    return lq.getEdits(e, i, r);
  }
}
class Cq {
  constructor(e, t, n, i, r, o, s) {
    ((this.deletedText = e),
      (this.deletedSelectionStart = t),
      (this.deletedSelectionEnd = n),
      (this.insertedText = i),
      (this.insertedSelectionStart = r),
      (this.insertedSelectionEnd = o),
      (this.insertedTextRange = s));
  }
}
!(function (e) {
  ((e.editorSimpleInput = new yW("editorSimpleInput", !1, !0)),
    (e.editorTextFocus = new yW(
      "editorTextFocus",
      !1,
      SI(681, "Whether the editor text has focus (cursor is blinking)"),
    )),
    (e.focus = new yW(
      "editorFocus",
      !1,
      SI(
        682,
        "Whether the editor or an editor widget has focus (e.g. focus is in the find widget)",
      ),
    )),
    (e.textInputFocus = new yW(
      "textInputFocus",
      !1,
      SI(683, "Whether an editor or a rich text input has focus (cursor is blinking)"),
    )),
    (e.readOnly = new yW("editorReadonly", !1, SI(684, "Whether the editor is read-only"))),
    (e.inDiffEditor = new yW("inDiffEditor", !1, SI(685, "Whether the context is a diff editor"))),
    (e.isEmbeddedDiffEditor = new yW(
      "isEmbeddedDiffEditor",
      !1,
      SI(686, "Whether the context is an embedded diff editor"),
    )),
    (e.inMultiDiffEditor = new yW(
      "inMultiDiffEditor",
      !1,
      SI(687, "Whether the context is a multi diff editor"),
    )),
    (e.multiDiffEditorAllCollapsed = new yW(
      "multiDiffEditorAllCollapsed",
      void 0,
      SI(688, "Whether all files in multi diff editor are collapsed"),
    )),
    (e.hasChanges = new yW(
      "diffEditorHasChanges",
      !1,
      SI(689, "Whether the diff editor has changes"),
    )),
    (e.comparingMovedCode = new yW(
      "comparingMovedCode",
      !1,
      SI(690, "Whether a moved code block is selected for comparison"),
    )),
    (e.accessibleDiffViewerVisible = new yW(
      "accessibleDiffViewerVisible",
      !1,
      SI(691, "Whether the accessible diff viewer is visible"),
    )),
    (e.diffEditorRenderSideBySideInlineBreakpointReached = new yW(
      "diffEditorRenderSideBySideInlineBreakpointReached",
      !1,
      SI(692, "Whether the diff editor render side by side inline breakpoint is reached"),
    )),
    (e.diffEditorInlineMode = new yW(
      "diffEditorInlineMode",
      !1,
      SI(693, "Whether inline mode is active"),
    )),
    (e.diffEditorOriginalWritable = new yW(
      "diffEditorOriginalWritable",
      !1,
      SI(694, "Whether modified is writable in the diff editor"),
    )),
    (e.diffEditorModifiedWritable = new yW(
      "diffEditorModifiedWritable",
      !1,
      SI(695, "Whether modified is writable in the diff editor"),
    )),
    (e.diffEditorOriginalUri = new yW(
      "diffEditorOriginalUri",
      "",
      SI(696, "The uri of the original document"),
    )),
    (e.diffEditorModifiedUri = new yW(
      "diffEditorModifiedUri",
      "",
      SI(697, "The uri of the modified document"),
    )),
    (e.columnSelection = new yW(
      "editorColumnSelection",
      !1,
      SI(698, "Whether `editor.columnSelection` is enabled"),
    )),
    (e.writable = e.readOnly.toNegated()),
    (e.hasNonEmptySelection = new yW(
      "editorHasSelection",
      !1,
      SI(699, "Whether the editor has text selected"),
    )),
    (e.hasOnlyEmptySelection = e.hasNonEmptySelection.toNegated()),
    (e.hasMultipleSelections = new yW(
      "editorHasMultipleSelections",
      !1,
      SI(700, "Whether the editor has multiple selections"),
    )),
    (e.hasSingleSelection = e.hasMultipleSelections.toNegated()),
    (e.tabMovesFocus = new yW(
      "editorTabMovesFocus",
      !1,
      SI(701, "Whether `Tab` will move focus out of the editor"),
    )),
    (e.tabDoesNotMoveFocus = e.tabMovesFocus.toNegated()),
    (e.isInEmbeddedEditor = new yW("isInEmbeddedEditor", !1, !0)),
    (e.canUndo = new yW("canUndo", !1, !0)),
    (e.canRedo = new yW("canRedo", !1, !0)),
    (e.hoverVisible = new yW(
      "editorHoverVisible",
      !1,
      SI(702, "Whether the editor hover is visible"),
    )),
    (e.hoverFocused = new yW(
      "editorHoverFocused",
      !1,
      SI(703, "Whether the editor hover is focused"),
    )),
    (e.stickyScrollFocused = new yW(
      "stickyScrollFocused",
      !1,
      SI(704, "Whether the sticky scroll is focused"),
    )),
    (e.stickyScrollVisible = new yW(
      "stickyScrollVisible",
      !1,
      SI(705, "Whether the sticky scroll is visible"),
    )),
    (e.standaloneColorPickerVisible = new yW(
      "standaloneColorPickerVisible",
      !1,
      SI(706, "Whether the standalone color picker is visible"),
    )),
    (e.standaloneColorPickerFocused = new yW(
      "standaloneColorPickerFocused",
      !1,
      SI(707, "Whether the standalone color picker is focused"),
    )),
    (e.inCompositeEditor = new yW(
      "inCompositeEditor",
      void 0,
      SI(708, "Whether the editor is part of a larger editor (e.g. notebooks)"),
    )),
    (e.notInCompositeEditor = e.inCompositeEditor.toNegated()),
    (e.languageId = new yW("editorLangId", "", SI(709, "The language identifier of the editor"))),
    (e.hasCompletionItemProvider = new yW(
      "editorHasCompletionItemProvider",
      !1,
      SI(710, "Whether the editor has a completion item provider"),
    )),
    (e.hasCodeActionsProvider = new yW(
      "editorHasCodeActionsProvider",
      !1,
      SI(711, "Whether the editor has a code actions provider"),
    )),
    (e.hasCodeLensProvider = new yW(
      "editorHasCodeLensProvider",
      !1,
      SI(712, "Whether the editor has a code lens provider"),
    )),
    (e.hasDefinitionProvider = new yW(
      "editorHasDefinitionProvider",
      !1,
      SI(713, "Whether the editor has a definition provider"),
    )),
    (e.hasDeclarationProvider = new yW(
      "editorHasDeclarationProvider",
      !1,
      SI(714, "Whether the editor has a declaration provider"),
    )),
    (e.hasImplementationProvider = new yW(
      "editorHasImplementationProvider",
      !1,
      SI(715, "Whether the editor has an implementation provider"),
    )),
    (e.hasTypeDefinitionProvider = new yW(
      "editorHasTypeDefinitionProvider",
      !1,
      SI(716, "Whether the editor has a type definition provider"),
    )),
    (e.hasHoverProvider = new yW(
      "editorHasHoverProvider",
      !1,
      SI(717, "Whether the editor has a hover provider"),
    )),
    (e.hasDocumentHighlightProvider = new yW(
      "editorHasDocumentHighlightProvider",
      !1,
      SI(718, "Whether the editor has a document highlight provider"),
    )),
    (e.hasDocumentSymbolProvider = new yW(
      "editorHasDocumentSymbolProvider",
      !1,
      SI(719, "Whether the editor has a document symbol provider"),
    )),
    (e.hasReferenceProvider = new yW(
      "editorHasReferenceProvider",
      !1,
      SI(720, "Whether the editor has a reference provider"),
    )),
    (e.hasRenameProvider = new yW(
      "editorHasRenameProvider",
      !1,
      SI(721, "Whether the editor has a rename provider"),
    )),
    (e.hasSignatureHelpProvider = new yW(
      "editorHasSignatureHelpProvider",
      !1,
      SI(722, "Whether the editor has a signature help provider"),
    )),
    (e.hasInlayHintsProvider = new yW(
      "editorHasInlayHintsProvider",
      !1,
      SI(723, "Whether the editor has an inline hints provider"),
    )),
    (e.hasDocumentFormattingProvider = new yW(
      "editorHasDocumentFormattingProvider",
      !1,
      SI(724, "Whether the editor has a document formatting provider"),
    )),
    (e.hasDocumentSelectionFormattingProvider = new yW(
      "editorHasDocumentSelectionFormattingProvider",
      !1,
      SI(725, "Whether the editor has a document selection formatting provider"),
    )),
    (e.hasMultipleDocumentFormattingProvider = new yW(
      "editorHasMultipleDocumentFormattingProvider",
      !1,
      SI(726, "Whether the editor has multiple document formatting providers"),
    )),
    (e.hasMultipleDocumentSelectionFormattingProvider = new yW(
      "editorHasMultipleDocumentSelectionFormattingProvider",
      !1,
      SI(727, "Whether the editor has multiple document selection formatting providers"),
    )));
})($$ || ($$ = {}));
class Sq extends MH {
  runEditorCommand(e, t, n) {
    const i = t._getViewModel();
    i && this.runCoreEditorCommand(i, n || {});
  }
}
var kq, Eq, Nq;
(!(function (e) {
  ((e.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\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",
        constraint: function (e) {
          if (!sR(e)) return !1;
          const t = e;
          return (
            !!oR(t.to) &&
            !(!uR(t.by) && !oR(t.by)) &&
            !(!uR(t.value) && !lR(t.value)) &&
            !(!uR(t.revealCursor) && !dR(t.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" },
          },
        },
      },
    ],
  }),
    (e.RawDirection = { Up: "up", Right: "right", Down: "down", Left: "left" }),
    (e.RawUnit = {
      Line: "line",
      WrappedLine: "wrappedLine",
      Page: "page",
      HalfPage: "halfPage",
      Editor: "editor",
      Column: "column",
    }),
    (e.parse = function (t) {
      let n, i;
      switch (t.to) {
        case e.RawDirection.Up:
          n = 1;
          break;
        case e.RawDirection.Right:
          n = 2;
          break;
        case e.RawDirection.Down:
          n = 3;
          break;
        case e.RawDirection.Left:
          n = 4;
          break;
        default:
          return null;
      }
      switch (t.by) {
        case e.RawUnit.Line:
          i = 1;
          break;
        case e.RawUnit.WrappedLine:
          i = 2;
          break;
        case e.RawUnit.Page:
          i = 3;
          break;
        case e.RawUnit.HalfPage:
          i = 4;
          break;
        case e.RawUnit.Editor:
          i = 5;
          break;
        case e.RawUnit.Column:
          i = 6;
          break;
        default:
          i = 2;
      }
      return {
        direction: n,
        unit: i,
        value: Math.floor(t.value || 1),
        revealCursor: !!t.revealCursor,
        select: !!t.select,
      };
    }));
})(kq || (kq = {})),
  (function (e) {
    ((e.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:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",
          constraint: function (e) {
            if (!sR(e)) return !1;
            const t = e;
            return !(!lR(t.lineNumber) && !oR(t.lineNumber)) && !(!uR(t.at) && !oR(t.at));
          },
          schema: {
            type: "object",
            required: ["lineNumber"],
            properties: {
              lineNumber: { type: ["number", "string"] },
              at: { type: "string", enum: ["top", "center", "bottom"] },
            },
          },
        },
      ],
    }),
      (e.RawAtArgument = { Top: "top", Center: "center", Bottom: "bottom" }));
  })(Eq || (Eq = {})));
class Lq {
  constructor(e) {
    (e.addImplementation(1e4, "code-editor", (e, t) => {
      const n = e.get(yV).getFocusedCodeEditor();
      return !(!n || !n.hasTextFocus()) && this._runEditorCommand(e, n, t);
    }),
      e.addImplementation(1e3, "generic-dom-input-textarea", (e, t) => {
        const n = vB();
        return !(!n || !YB(n)) && (this.runDOMCommand(n), !0);
      }),
      e.addImplementation(0, "generic-dom", (e, t) => {
        const n = e.get(yV).getActiveCodeEditor();
        return !!n && (n.focus(), this._runEditorCommand(e, n, t));
      }));
  }
  _runEditorCommand(e, t, n) {
    const i = this.runEditorCommand(e, t, n);
    return i || !0;
  }
}
!(function (e) {
  class t extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      if (!t.position) return;
      e.model.pushStackElement();
      e.setCursorStates(t.source, 3, [
        nU.moveTo(e, e.getPrimaryCursorState(), this._inSelectionMode, t.position, t.viewPosition),
      ]) &&
        2 !== t.revealType &&
        e.revealAllCursors(t.source, !0, !0);
    }
  }
  ((e.MoveTo = BH(new t({ id: "_moveTo", inSelectionMode: !1, precondition: void 0 }))),
    (e.MoveToSelect = BH(
      new t({ id: "_moveToSelect", inSelectionMode: !0, precondition: void 0 }),
    )));
  class n extends Sq {
    runCoreEditorCommand(e, t) {
      e.model.pushStackElement();
      const n = this._getColumnSelectResult(
        e,
        e.getPrimaryCursorState(),
        e.getCursorColumnSelectData(),
        t,
      );
      null !== n &&
        (e.setCursorStates(
          t.source,
          3,
          n.viewStates.map((e) => lz.fromViewState(e)),
        ),
        e.setCursorColumnSelectData({
          isReal: !0,
          fromViewLineNumber: n.fromLineNumber,
          fromViewVisualColumn: n.fromVisualColumn,
          toViewLineNumber: n.toLineNumber,
          toViewVisualColumn: n.toVisualColumn,
        }),
        n.reversed ? e.revealTopMostCursor(t.source) : e.revealBottomMostCursor(t.source));
    }
  }
  ((e.ColumnSelect = BH(
    new (class extends n {
      constructor() {
        super({ id: "columnSelect", precondition: void 0 });
      }
      _getColumnSelectResult(e, t, n, i) {
        if (void 0 === i.position || void 0 === i.viewPosition || void 0 === i.mouseColumn)
          return null;
        const r = e.model.validatePosition(i.position),
          o = e.coordinatesConverter.validateViewPosition(
            new xV(i.viewPosition.lineNumber, i.viewPosition.column),
            r,
          ),
          s = i.doColumnSelect ? n.fromViewLineNumber : o.lineNumber,
          a = i.doColumnSelect ? n.fromViewVisualColumn : i.mouseColumn - 1;
        return pz.columnSelect(e.cursorConfig, e, s, a, o.lineNumber, i.mouseColumn - 1);
      }
    })(),
  )),
    (e.CursorColumnSelectLeft = BH(
      new (class extends n {
        constructor() {
          super({
            id: "cursorColumnSelectLeft",
            precondition: void 0,
            kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 3599, linux: { primary: 0 } },
          });
        }
        _getColumnSelectResult(e, t, n, i) {
          return pz.columnSelectLeft(e.cursorConfig, e, n);
        }
      })(),
    )),
    (e.CursorColumnSelectRight = BH(
      new (class extends n {
        constructor() {
          super({
            id: "cursorColumnSelectRight",
            precondition: void 0,
            kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 3601, linux: { primary: 0 } },
          });
        }
        _getColumnSelectResult(e, t, n, i) {
          return pz.columnSelectRight(e.cursorConfig, e, n);
        }
      })(),
    )));
  class i extends n {
    constructor(e) {
      (super(e), (this._isPaged = e.isPaged));
    }
    _getColumnSelectResult(e, t, n, i) {
      return pz.columnSelectUp(e.cursorConfig, e, n, this._isPaged);
    }
  }
  ((e.CursorColumnSelectUp = BH(
    new i({
      isPaged: !1,
      id: "cursorColumnSelectUp",
      precondition: void 0,
      kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 3600, linux: { primary: 0 } },
    }),
  )),
    (e.CursorColumnSelectPageUp = BH(
      new i({
        isPaged: !0,
        id: "cursorColumnSelectPageUp",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 3595, linux: { primary: 0 } },
      }),
    )));
  class r extends n {
    constructor(e) {
      (super(e), (this._isPaged = e.isPaged));
    }
    _getColumnSelectResult(e, t, n, i) {
      return pz.columnSelectDown(e.cursorConfig, e, n, this._isPaged);
    }
  }
  ((e.CursorColumnSelectDown = BH(
    new r({
      isPaged: !1,
      id: "cursorColumnSelectDown",
      precondition: void 0,
      kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 3602, linux: { primary: 0 } },
    }),
  )),
    (e.CursorColumnSelectPageDown = BH(
      new r({
        isPaged: !0,
        id: "cursorColumnSelectPageDown",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 3596, linux: { primary: 0 } },
      }),
    )));
  class o extends Sq {
    constructor() {
      super({ id: "cursorMove", precondition: void 0, metadata: Gz.metadata });
    }
    runCoreEditorCommand(e, t) {
      const n = Gz.parse(t);
      n && this._runCursorMove(e, t.source, n);
    }
    _runCursorMove(e, t, n) {
      const i = n.noHistory ? "api" : t;
      (e.model.pushStackElement(),
        e.setCursorStates(i, 3, o._move(e, e.getCursorStates(), n)),
        e.revealAllCursors(i, !0));
    }
    static _move(e, t, n) {
      const i = n.select,
        r = n.value;
      switch (n.direction) {
        case 0:
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
        case 10:
          return nU.simpleMove(e, t, n.direction, i, r, n.unit);
        case 11:
        case 13:
        case 12:
        case 14:
          return nU.viewportMove(e, t, n.direction, i, r);
        default:
          return null;
      }
    }
  }
  ((e.CursorMoveImpl = o), (e.CursorMove = BH(new o())));
  class s extends Sq {
    constructor(e) {
      (super(e), (this._staticArgs = e.args));
    }
    runCoreEditorCommand(e, t) {
      let n = this._staticArgs;
      (-1 === this._staticArgs.value &&
        (n = {
          direction: this._staticArgs.direction,
          unit: this._staticArgs.unit,
          select: this._staticArgs.select,
          value: t.pageSize || e.cursorConfig.pageSize,
        }),
        e.model.pushStackElement(),
        e.setCursorStates(
          t.source,
          3,
          nU.simpleMove(e, e.getCursorStates(), n.direction, n.select, n.value, n.unit),
        ),
        e.revealAllCursors(t.source, !0));
    }
  }
  ((e.CursorLeft = BH(
    new s({
      args: { direction: 0, unit: 0, select: !1, value: 1 },
      id: "cursorLeft",
      precondition: void 0,
      kbOpts: {
        weight: 0,
        kbExpr: $$.textInputFocus,
        primary: 15,
        mac: { primary: 15, secondary: [288] },
      },
    }),
  )),
    (e.CursorLeftSelect = BH(
      new s({
        args: { direction: 0, unit: 0, select: !0, value: 1 },
        id: "cursorLeftSelect",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 1039 },
      }),
    )),
    (e.CursorRight = BH(
      new s({
        args: { direction: 1, unit: 0, select: !1, value: 1 },
        id: "cursorRight",
        precondition: void 0,
        kbOpts: {
          weight: 0,
          kbExpr: $$.textInputFocus,
          primary: 17,
          mac: { primary: 17, secondary: [292] },
        },
      }),
    )),
    (e.CursorRightSelect = BH(
      new s({
        args: { direction: 1, unit: 0, select: !0, value: 1 },
        id: "cursorRightSelect",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 1041 },
      }),
    )),
    (e.CursorUp = BH(
      new s({
        args: { direction: 2, unit: 2, select: !1, value: 1 },
        id: "cursorUp",
        precondition: void 0,
        kbOpts: {
          weight: 0,
          kbExpr: $$.textInputFocus,
          primary: 16,
          mac: { primary: 16, secondary: [302] },
        },
      }),
    )),
    (e.CursorUpSelect = BH(
      new s({
        args: { direction: 2, unit: 2, select: !0, value: 1 },
        id: "cursorUpSelect",
        precondition: void 0,
        kbOpts: {
          weight: 0,
          kbExpr: $$.textInputFocus,
          primary: 1040,
          secondary: [3088],
          mac: { primary: 1040 },
          linux: { primary: 1040 },
        },
      }),
    )),
    (e.CursorPageUp = BH(
      new s({
        args: { direction: 2, unit: 2, select: !1, value: -1 },
        id: "cursorPageUp",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 11 },
      }),
    )),
    (e.CursorPageUpSelect = BH(
      new s({
        args: { direction: 2, unit: 2, select: !0, value: -1 },
        id: "cursorPageUpSelect",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 1035 },
      }),
    )),
    (e.CursorDown = BH(
      new s({
        args: { direction: 3, unit: 2, select: !1, value: 1 },
        id: "cursorDown",
        precondition: void 0,
        kbOpts: {
          weight: 0,
          kbExpr: $$.textInputFocus,
          primary: 18,
          mac: { primary: 18, secondary: [300] },
        },
      }),
    )),
    (e.CursorDownSelect = BH(
      new s({
        args: { direction: 3, unit: 2, select: !0, value: 1 },
        id: "cursorDownSelect",
        precondition: void 0,
        kbOpts: {
          weight: 0,
          kbExpr: $$.textInputFocus,
          primary: 1042,
          secondary: [3090],
          mac: { primary: 1042 },
          linux: { primary: 1042 },
        },
      }),
    )),
    (e.CursorPageDown = BH(
      new s({
        args: { direction: 3, unit: 2, select: !1, value: -1 },
        id: "cursorPageDown",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 12 },
      }),
    )),
    (e.CursorPageDownSelect = BH(
      new s({
        args: { direction: 3, unit: 2, select: !0, value: -1 },
        id: "cursorPageDownSelect",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 1036 },
      }),
    )),
    (e.CreateCursor = BH(
      new (class extends Sq {
        constructor() {
          super({ id: "createCursor", precondition: void 0 });
        }
        runCoreEditorCommand(e, t) {
          if (!t.position) return;
          let n;
          n = t.wholeLine
            ? nU.line(e, e.getPrimaryCursorState(), !1, t.position, t.viewPosition)
            : nU.moveTo(e, e.getPrimaryCursorState(), !1, t.position, t.viewPosition);
          const i = e.getCursorStates();
          if (i.length > 1) {
            const r = n.modelState ? n.modelState.position : null,
              o = n.viewState ? n.viewState.position : null;
            for (let n = 0, s = i.length; n < s; n++) {
              const s = i[n];
              if (
                (!r || s.modelState.selection.containsPosition(r)) &&
                (!o || s.viewState.selection.containsPosition(o))
              )
                return (
                  i.splice(n, 1),
                  e.model.pushStackElement(),
                  void e.setCursorStates(t.source, 3, i)
                );
            }
          }
          (i.push(n), e.model.pushStackElement(), e.setCursorStates(t.source, 3, i));
        }
      })(),
    )),
    (e.LastCursorMoveToSelect = BH(
      new (class extends Sq {
        constructor() {
          super({ id: "_lastCursorMoveToSelect", precondition: void 0 });
        }
        runCoreEditorCommand(e, t) {
          if (!t.position) return;
          const n = e.getLastAddedCursorIndex(),
            i = e.getCursorStates(),
            r = i.slice(0);
          ((r[n] = nU.moveTo(e, i[n], !0, t.position, t.viewPosition)),
            e.model.pushStackElement(),
            e.setCursorStates(t.source, 3, r));
        }
      })(),
    )));
  class a extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      (e.model.pushStackElement(),
        e.setCursorStates(
          t.source,
          3,
          nU.moveToBeginningOfLine(e, e.getCursorStates(), this._inSelectionMode),
        ),
        e.revealAllCursors(t.source, !0));
    }
  }
  ((e.CursorHome = BH(
    new a({
      inSelectionMode: !1,
      id: "cursorHome",
      precondition: void 0,
      kbOpts: {
        weight: 0,
        kbExpr: $$.textInputFocus,
        primary: 14,
        mac: { primary: 14, secondary: [2063] },
      },
    }),
  )),
    (e.CursorHomeSelect = BH(
      new a({
        inSelectionMode: !0,
        id: "cursorHomeSelect",
        precondition: void 0,
        kbOpts: {
          weight: 0,
          kbExpr: $$.textInputFocus,
          primary: 1038,
          mac: { primary: 1038, secondary: [3087] },
        },
      }),
    )));
  class l extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      (e.model.pushStackElement(),
        e.setCursorStates(t.source, 3, this._exec(e.getCursorStates())),
        e.revealAllCursors(t.source, !0));
    }
    _exec(e) {
      const t = [];
      for (let n = 0, i = e.length; n < i; n++) {
        const i = e[n],
          r = i.modelState.position.lineNumber;
        t[n] = lz.fromModelState(i.modelState.move(this._inSelectionMode, r, 1, 0));
      }
      return t;
    }
  }
  ((e.CursorLineStart = BH(
    new l({
      inSelectionMode: !1,
      id: "cursorLineStart",
      precondition: void 0,
      kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 287 } },
    }),
  )),
    (e.CursorLineStartSelect = BH(
      new l({
        inSelectionMode: !0,
        id: "cursorLineStartSelect",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 1311 } },
      }),
    )));
  class c extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      (e.model.pushStackElement(),
        e.setCursorStates(
          t.source,
          3,
          nU.moveToEndOfLine(e, e.getCursorStates(), this._inSelectionMode, t.sticky || !1),
        ),
        e.revealAllCursors(t.source, !0));
    }
  }
  ((e.CursorEnd = BH(
    new c({
      inSelectionMode: !1,
      id: "cursorEnd",
      precondition: void 0,
      kbOpts: {
        args: { sticky: !1 },
        weight: 0,
        kbExpr: $$.textInputFocus,
        primary: 13,
        mac: { primary: 13, secondary: [2065] },
      },
      metadata: {
        description: "Go to End",
        args: [
          {
            name: "args",
            schema: {
              type: "object",
              properties: {
                sticky: {
                  description: SI(66, "Stick to the end even when going to longer lines"),
                  type: "boolean",
                  default: !1,
                },
              },
            },
          },
        ],
      },
    }),
  )),
    (e.CursorEndSelect = BH(
      new c({
        inSelectionMode: !0,
        id: "cursorEndSelect",
        precondition: void 0,
        kbOpts: {
          args: { sticky: !1 },
          weight: 0,
          kbExpr: $$.textInputFocus,
          primary: 1037,
          mac: { primary: 1037, secondary: [3089] },
        },
        metadata: {
          description: "Select to End",
          args: [
            {
              name: "args",
              schema: {
                type: "object",
                properties: {
                  sticky: {
                    description: SI(67, "Stick to the end even when going to longer lines"),
                    type: "boolean",
                    default: !1,
                  },
                },
              },
            },
          ],
        },
      }),
    )));
  class d extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      (e.model.pushStackElement(),
        e.setCursorStates(t.source, 3, this._exec(e, e.getCursorStates())),
        e.revealAllCursors(t.source, !0));
    }
    _exec(e, t) {
      const n = [];
      for (let i = 0, r = t.length; i < r; i++) {
        const r = t[i],
          o = r.modelState.position.lineNumber,
          s = e.model.getLineMaxColumn(o);
        n[i] = lz.fromModelState(r.modelState.move(this._inSelectionMode, o, s, 0));
      }
      return n;
    }
  }
  ((e.CursorLineEnd = BH(
    new d({
      inSelectionMode: !1,
      id: "cursorLineEnd",
      precondition: void 0,
      kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 291 } },
    }),
  )),
    (e.CursorLineEndSelect = BH(
      new d({
        inSelectionMode: !0,
        id: "cursorLineEndSelect",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 1315 } },
      }),
    )));
  class u extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      (e.model.pushStackElement(),
        e.setCursorStates(
          t.source,
          3,
          nU.moveToBeginningOfBuffer(e, e.getCursorStates(), this._inSelectionMode),
        ),
        e.revealAllCursors(t.source, !0));
    }
  }
  ((e.CursorTop = BH(
    new u({
      inSelectionMode: !1,
      id: "cursorTop",
      precondition: void 0,
      kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 2062, mac: { primary: 2064 } },
    }),
  )),
    (e.CursorTopSelect = BH(
      new u({
        inSelectionMode: !0,
        id: "cursorTopSelect",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 3086, mac: { primary: 3088 } },
      }),
    )));
  class h extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      (e.model.pushStackElement(),
        e.setCursorStates(
          t.source,
          3,
          nU.moveToEndOfBuffer(e, e.getCursorStates(), this._inSelectionMode),
        ),
        e.revealAllCursors(t.source, !0));
    }
  }
  ((e.CursorBottom = BH(
    new h({
      inSelectionMode: !1,
      id: "cursorBottom",
      precondition: void 0,
      kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 2061, mac: { primary: 2066 } },
    }),
  )),
    (e.CursorBottomSelect = BH(
      new h({
        inSelectionMode: !0,
        id: "cursorBottomSelect",
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 3085, mac: { primary: 3090 } },
      }),
    )));
  class g extends Sq {
    constructor() {
      super({ id: "editorScroll", precondition: void 0, metadata: kq.metadata });
    }
    determineScrollMethod(e) {
      return [6].includes(e.unit) && [4, 2].includes(e.direction)
        ? this._runHorizontalEditorScroll.bind(this)
        : [1, 2, 3, 4, 5, 6].includes(e.unit) && [1, 3].includes(e.direction)
          ? this._runVerticalEditorScroll.bind(this)
          : null;
    }
    runCoreEditorCommand(e, t) {
      const n = kq.parse(t);
      if (!n) return;
      const i = this.determineScrollMethod(n);
      i && i(e, t.source, n);
    }
    _runVerticalEditorScroll(e, t, n) {
      const i = this._computeDesiredScrollTop(e, n);
      if (n.revealCursor) {
        const r = e.getCompletelyVisibleViewRangeAtScrollTop(i);
        e.setCursorStates(t, 3, [
          nU.findPositionInViewportIfOutside(e, e.getPrimaryCursorState(), r, n.select),
        ]);
      }
      e.viewLayout.setScrollPosition({ scrollTop: i }, 0);
    }
    _computeDesiredScrollTop(e, t) {
      if (1 === t.unit) {
        const n = e.viewLayout.getFutureViewport(),
          i = e.getCompletelyVisibleViewRangeAtScrollTop(n.top),
          r = e.coordinatesConverter.convertViewRangeToModelRange(i);
        let o;
        o =
          1 === t.direction
            ? Math.max(1, r.startLineNumber - t.value)
            : Math.min(e.model.getLineCount(), r.startLineNumber + t.value);
        const s = e.coordinatesConverter.convertModelPositionToViewPosition(new xV(o, 1));
        return e.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);
      }
      if (5 === t.unit) {
        let n = 0;
        return (
          3 === t.direction && (n = e.model.getLineCount() - e.cursorConfig.pageSize),
          e.viewLayout.getVerticalOffsetForLineNumber(n)
        );
      }
      let n;
      n =
        3 === t.unit
          ? e.cursorConfig.pageSize * t.value
          : 4 === t.unit
            ? Math.round(e.cursorConfig.pageSize / 2) * t.value
            : t.value;
      const i = (1 === t.direction ? -1 : 1) * n;
      return e.viewLayout.getCurrentScrollTop() + i * e.cursorConfig.lineHeight;
    }
    _runHorizontalEditorScroll(e, t, n) {
      const i = this._computeDesiredScrollLeft(e, n);
      e.viewLayout.setScrollPosition({ scrollLeft: i }, 0);
    }
    _computeDesiredScrollLeft(e, t) {
      const n = (4 === t.direction ? -1 : 1) * t.value;
      return (
        e.viewLayout.getCurrentScrollLeft() + n * e.cursorConfig.typicalHalfwidthCharacterWidth
      );
    }
  }
  ((e.EditorScrollImpl = g),
    (e.EditorScroll = BH(new g())),
    (e.ScrollLineUp = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "scrollLineUp",
            precondition: void 0,
            kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 2064, mac: { primary: 267 } },
          });
        }
        runCoreEditorCommand(t, n) {
          e.EditorScroll.runCoreEditorCommand(t, {
            to: kq.RawDirection.Up,
            by: kq.RawUnit.WrappedLine,
            value: 1,
            revealCursor: !1,
            select: !1,
            source: n.source,
          });
        }
      })(),
    )),
    (e.ScrollPageUp = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "scrollPageUp",
            precondition: void 0,
            kbOpts: {
              weight: 0,
              kbExpr: $$.textInputFocus,
              primary: 2059,
              win: { primary: 523 },
              linux: { primary: 523 },
            },
          });
        }
        runCoreEditorCommand(t, n) {
          e.EditorScroll.runCoreEditorCommand(t, {
            to: kq.RawDirection.Up,
            by: kq.RawUnit.Page,
            value: 1,
            revealCursor: !1,
            select: !1,
            source: n.source,
          });
        }
      })(),
    )),
    (e.ScrollEditorTop = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "scrollEditorTop",
            precondition: void 0,
            kbOpts: { weight: 0, kbExpr: $$.textInputFocus },
          });
        }
        runCoreEditorCommand(t, n) {
          e.EditorScroll.runCoreEditorCommand(t, {
            to: kq.RawDirection.Up,
            by: kq.RawUnit.Editor,
            value: 1,
            revealCursor: !1,
            select: !1,
            source: n.source,
          });
        }
      })(),
    )),
    (e.ScrollLineDown = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "scrollLineDown",
            precondition: void 0,
            kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 2066, mac: { primary: 268 } },
          });
        }
        runCoreEditorCommand(t, n) {
          e.EditorScroll.runCoreEditorCommand(t, {
            to: kq.RawDirection.Down,
            by: kq.RawUnit.WrappedLine,
            value: 1,
            revealCursor: !1,
            select: !1,
            source: n.source,
          });
        }
      })(),
    )),
    (e.ScrollPageDown = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "scrollPageDown",
            precondition: void 0,
            kbOpts: {
              weight: 0,
              kbExpr: $$.textInputFocus,
              primary: 2060,
              win: { primary: 524 },
              linux: { primary: 524 },
            },
          });
        }
        runCoreEditorCommand(t, n) {
          e.EditorScroll.runCoreEditorCommand(t, {
            to: kq.RawDirection.Down,
            by: kq.RawUnit.Page,
            value: 1,
            revealCursor: !1,
            select: !1,
            source: n.source,
          });
        }
      })(),
    )),
    (e.ScrollEditorBottom = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "scrollEditorBottom",
            precondition: void 0,
            kbOpts: { weight: 0, kbExpr: $$.textInputFocus },
          });
        }
        runCoreEditorCommand(t, n) {
          e.EditorScroll.runCoreEditorCommand(t, {
            to: kq.RawDirection.Down,
            by: kq.RawUnit.Editor,
            value: 1,
            revealCursor: !1,
            select: !1,
            source: n.source,
          });
        }
      })(),
    )),
    (e.ScrollLeft = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "scrollLeft",
            precondition: void 0,
            kbOpts: { weight: 0, kbExpr: $$.textInputFocus },
          });
        }
        runCoreEditorCommand(t, n) {
          e.EditorScroll.runCoreEditorCommand(t, {
            to: kq.RawDirection.Left,
            by: kq.RawUnit.Column,
            value: 2,
            revealCursor: !1,
            select: !1,
            source: n.source,
          });
        }
      })(),
    )),
    (e.ScrollRight = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "scrollRight",
            precondition: void 0,
            kbOpts: { weight: 0, kbExpr: $$.textInputFocus },
          });
        }
        runCoreEditorCommand(t, n) {
          e.EditorScroll.runCoreEditorCommand(t, {
            to: kq.RawDirection.Right,
            by: kq.RawUnit.Column,
            value: 2,
            revealCursor: !1,
            select: !1,
            source: n.source,
          });
        }
      })(),
    )));
  class p extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      t.position &&
        (e.model.pushStackElement(),
        e.setCursorStates(t.source, 3, [
          nU.word(e, e.getPrimaryCursorState(), this._inSelectionMode, t.position),
        ]),
        2 !== t.revealType && e.revealAllCursors(t.source, !0, !0));
    }
  }
  ((e.WordSelect = BH(new p({ inSelectionMode: !1, id: "_wordSelect", precondition: void 0 }))),
    (e.WordSelectDrag = BH(
      new p({ inSelectionMode: !0, id: "_wordSelectDrag", precondition: void 0 }),
    )),
    (e.LastCursorWordSelect = BH(
      new (class extends Sq {
        constructor() {
          super({ id: "lastCursorWordSelect", precondition: void 0 });
        }
        runCoreEditorCommand(e, t) {
          if (!t.position) return;
          const n = e.getLastAddedCursorIndex(),
            i = e.getCursorStates(),
            r = i.slice(0),
            o = i[n];
          ((r[n] = nU.word(e, o, o.modelState.hasSelection(), t.position)),
            e.model.pushStackElement(),
            e.setCursorStates(t.source, 3, r));
        }
      })(),
    )));
  class f extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      t.position &&
        (e.model.pushStackElement(),
        e.setCursorStates(t.source, 3, [
          nU.line(e, e.getPrimaryCursorState(), this._inSelectionMode, t.position, t.viewPosition),
        ]),
        2 !== t.revealType && e.revealAllCursors(t.source, !1, !0));
    }
  }
  ((e.LineSelect = BH(new f({ inSelectionMode: !1, id: "_lineSelect", precondition: void 0 }))),
    (e.LineSelectDrag = BH(
      new f({ inSelectionMode: !0, id: "_lineSelectDrag", precondition: void 0 }),
    )));
  class m extends Sq {
    constructor(e) {
      (super(e), (this._inSelectionMode = e.inSelectionMode));
    }
    runCoreEditorCommand(e, t) {
      if (!t.position) return;
      const n = e.getLastAddedCursorIndex(),
        i = e.getCursorStates(),
        r = i.slice(0);
      ((r[n] = nU.line(e, i[n], this._inSelectionMode, t.position, t.viewPosition)),
        e.model.pushStackElement(),
        e.setCursorStates(t.source, 3, r));
    }
  }
  ((e.LastCursorLineSelect = BH(
    new m({ inSelectionMode: !1, id: "lastCursorLineSelect", precondition: void 0 }),
  )),
    (e.LastCursorLineSelectDrag = BH(
      new m({ inSelectionMode: !0, id: "lastCursorLineSelectDrag", precondition: void 0 }),
    )),
    (e.CancelSelection = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "cancelSelection",
            precondition: $$.hasNonEmptySelection,
            kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 9, secondary: [1033] },
          });
        }
        runCoreEditorCommand(e, t) {
          (e.model.pushStackElement(),
            e.setCursorStates(t.source, 3, [nU.cancelSelection(e, e.getPrimaryCursorState())]),
            e.revealAllCursors(t.source, !0));
        }
      })(),
    )),
    (e.RemoveSecondaryCursors = BH(
      new (class extends Sq {
        constructor() {
          super({
            id: "removeSecondaryCursors",
            precondition: $$.hasMultipleSelections,
            kbOpts: { weight: 1, kbExpr: $$.textInputFocus, primary: 9, secondary: [1033] },
          });
        }
        runCoreEditorCommand(e, t) {
          (e.model.pushStackElement(),
            e.setCursorStates(t.source, 3, [e.getPrimaryCursorState()]),
            e.revealAllCursors(t.source, !0),
            fV(SI(68, "Removed secondary cursors")));
        }
      })(),
    )),
    (e.RevealLine = BH(
      new (class extends Sq {
        constructor() {
          super({ id: "revealLine", precondition: void 0, metadata: Eq.metadata });
        }
        runCoreEditorCommand(e, t) {
          const n = t,
            i = n.lineNumber || 0;
          let r = "number" == typeof i ? i + 1 : parseInt(i) + 1;
          r < 1 && (r = 1);
          const o = e.model.getLineCount();
          r > o && (r = o);
          const s = new YH(r, 1, r, e.model.getLineMaxColumn(r));
          let a = 0;
          if (n.at)
            switch (n.at) {
              case Eq.RawAtArgument.Top:
                a = 3;
                break;
              case Eq.RawAtArgument.Center:
                a = 1;
                break;
              case Eq.RawAtArgument.Bottom:
                a = 4;
            }
          const l = e.coordinatesConverter.convertModelRangeToViewRange(s);
          e.revealRange(t.source, !1, l, a, 0);
        }
      })(),
    )),
    (e.SelectAll = new (class extends Lq {
      constructor() {
        super(ZH);
      }
      runDOMCommand(e) {
        (RI && (e.focus(), e.select()), e.ownerDocument.execCommand("selectAll"));
      }
      runEditorCommand(e, t, n) {
        const i = t._getViewModel();
        i && this.runCoreEditorCommand(i, n);
      }
      runCoreEditorCommand(e, t) {
        (e.model.pushStackElement(),
          e.setCursorStates("keyboard", 3, [nU.selectAll(e, e.getPrimaryCursorState())]));
      }
    })()),
    (e.SetSelection = BH(
      new (class extends Sq {
        constructor() {
          super({ id: "setSelection", precondition: void 0 });
        }
        runCoreEditorCommand(e, t) {
          t.selection &&
            (e.model.pushStackElement(),
            e.setCursorStates(t.source, 3, [lz.fromModelSelection(t.selection)]));
        }
      })(),
    )));
})(Nq || (Nq = {}));
const Dq = eW.and($$.textInputFocus, $$.columnSelection);
function Tq(e, t) {
  DW.registerKeybindingRule({ id: e, primary: t, when: Dq, weight: 1 });
}
function Iq(e) {
  return (e.register(), e);
}
var Rq;
(Tq(Nq.CursorColumnSelectLeft.id, 1039),
  Tq(Nq.CursorColumnSelectRight.id, 1041),
  Tq(Nq.CursorColumnSelectUp.id, 1040),
  Tq(Nq.CursorColumnSelectPageUp.id, 1035),
  Tq(Nq.CursorColumnSelectDown.id, 1042),
  Tq(Nq.CursorColumnSelectPageDown.id, 1036),
  (function (e) {
    class t extends MH {
      runEditorCommand(e, t, n) {
        const i = t._getViewModel();
        i && this.runCoreEditingCommand(t, i, n || {});
      }
    }
    ((e.CoreEditingCommand = t),
      (e.LineBreakInsert = BH(
        new (class extends t {
          constructor() {
            super({
              id: "lineBreakInsert",
              precondition: $$.writable,
              kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 301 } },
            });
          }
          runCoreEditingCommand(e, t, n) {
            (e.pushUndoStop(),
              e.executeCommands(
                this.id,
                oq.lineBreakInsert(
                  t.cursorConfig,
                  t.model,
                  t.getCursorStates().map((e) => e.modelState.selection),
                ),
              ));
          }
        })(),
      )),
      (e.Outdent = BH(
        new (class extends t {
          constructor() {
            super({
              id: "outdent",
              precondition: $$.writable,
              kbOpts: {
                weight: 0,
                kbExpr: eW.and($$.editorTextFocus, $$.tabDoesNotMoveFocus),
                primary: 1026,
              },
            });
          }
          runCoreEditingCommand(e, t, n) {
            (e.pushUndoStop(),
              e.executeCommands(
                this.id,
                wq.outdent(
                  t.cursorConfig,
                  t.model,
                  t.getCursorStates().map((e) => e.modelState.selection),
                ),
              ),
              e.pushUndoStop());
          }
        })(),
      )),
      (e.Tab = BH(
        new (class extends t {
          constructor() {
            super({
              id: "tab",
              precondition: $$.writable,
              kbOpts: {
                weight: 0,
                kbExpr: eW.and($$.editorTextFocus, $$.tabDoesNotMoveFocus),
                primary: 2,
              },
            });
          }
          runCoreEditingCommand(e, t, n) {
            (e.pushUndoStop(),
              e.executeCommands(
                this.id,
                wq.tab(
                  t.cursorConfig,
                  t.model,
                  t.getCursorStates().map((e) => e.modelState.selection),
                ),
              ),
              e.pushUndoStop());
          }
        })(),
      )),
      (e.DeleteLeft = BH(
        new (class extends t {
          constructor() {
            super({
              id: "deleteLeft",
              precondition: void 0,
              kbOpts: {
                weight: 0,
                kbExpr: $$.textInputFocus,
                primary: 1,
                secondary: [1025],
                mac: { primary: 1, secondary: [1025, 294, 257] },
              },
            });
          }
          runCoreEditingCommand(e, t, n) {
            const [i, r] = Ez.deleteLeft(
              t.getPrevEditOperationType(),
              t.cursorConfig,
              t.model,
              t.getCursorStates().map((e) => e.modelState.selection),
              t.getCursorAutoClosedCharacters(),
            );
            (i && e.pushUndoStop(), e.executeCommands(this.id, r), t.setPrevEditOperationType(2));
          }
        })(),
      )),
      (e.DeleteRight = BH(
        new (class extends t {
          constructor() {
            super({
              id: "deleteRight",
              precondition: void 0,
              kbOpts: {
                weight: 0,
                kbExpr: $$.textInputFocus,
                primary: 20,
                mac: { primary: 20, secondary: [290, 276] },
              },
            });
          }
          runCoreEditingCommand(e, t, n) {
            const [i, r] = Ez.deleteRight(
              t.getPrevEditOperationType(),
              t.cursorConfig,
              t.model,
              t.getCursorStates().map((e) => e.modelState.selection),
            );
            (i && e.pushUndoStop(), e.executeCommands(this.id, r), t.setPrevEditOperationType(3));
          }
        })(),
      )),
      (e.Undo = new (class extends Lq {
        constructor() {
          super(KH);
        }
        runDOMCommand(e) {
          e.ownerDocument.execCommand("undo");
        }
        runEditorCommand(e, t, n) {
          if (t.hasModel() && !0 !== t.getOption(104)) return t.getModel().undo();
        }
      })()),
      (e.Redo = new (class extends Lq {
        constructor() {
          super(GH);
        }
        runDOMCommand(e) {
          e.ownerDocument.execCommand("redo");
        }
        runEditorCommand(e, t, n) {
          if (t.hasModel() && !0 !== t.getOption(104)) return t.getModel().redo();
        }
      })()));
  })(Rq || (Rq = {})));
class Oq extends IH {
  constructor(e, t, n) {
    (super({ id: e, precondition: void 0, metadata: n }), (this._handlerId = t));
  }
  runCommand(e, t) {
    const n = e.get(yV).getFocusedCodeEditor();
    n && n.trigger("keyboard", this._handlerId, t);
  }
}
function Mq(e, t) {
  (Iq(new Oq("default:" + e, e)), Iq(new Oq(e, e, t)));
}
(Mq("type", {
  description: "Type",
  args: [
    {
      name: "args",
      schema: { type: "object", required: ["text"], properties: { text: { type: "string" } } },
    },
  ],
}),
  Mq("replacePreviousChar"),
  Mq("compositionType"),
  Mq("compositionStart"),
  Mq("compositionEnd"),
  Mq("paste"),
  Mq("cut"));
const Aq = bV("markerDecorationsService");
let Pq = class {
  static {
    this.ID = "editor.contrib.markerDecorations";
  }
  constructor(e, t) {}
  dispose() {}
};
((Pq = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, Aq),
  ],
  Pq,
)),
  zH(Pq.ID, Pq, 0));
class jq {
  constructor(e) {
    ((this.domNode = e),
      (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 = !1),
      (this._contain = "none"),
      (this._boxShadow = ""));
  }
  focus() {
    this.domNode.focus();
  }
  setMaxWidth(e) {
    const t = Fq(e);
    this._maxWidth !== t && ((this._maxWidth = t), (this.domNode.style.maxWidth = this._maxWidth));
  }
  setWidth(e) {
    const t = Fq(e);
    this._width !== t && ((this._width = t), (this.domNode.style.width = this._width));
  }
  setHeight(e) {
    const t = Fq(e);
    this._height !== t && ((this._height = t), (this.domNode.style.height = this._height));
  }
  setTop(e) {
    const t = Fq(e);
    this._top !== t && ((this._top = t), (this.domNode.style.top = this._top));
  }
  setLeft(e) {
    const t = Fq(e);
    this._left !== t && ((this._left = t), (this.domNode.style.left = this._left));
  }
  setBottom(e) {
    const t = Fq(e);
    this._bottom !== t && ((this._bottom = t), (this.domNode.style.bottom = this._bottom));
  }
  setRight(e) {
    const t = Fq(e);
    this._right !== t && ((this._right = t), (this.domNode.style.right = this._right));
  }
  setPaddingLeft(e) {
    const t = Fq(e);
    this._paddingLeft !== t &&
      ((this._paddingLeft = t), (this.domNode.style.paddingLeft = this._paddingLeft));
  }
  setFontFamily(e) {
    this._fontFamily !== e &&
      ((this._fontFamily = e), (this.domNode.style.fontFamily = this._fontFamily));
  }
  setFontWeight(e) {
    this._fontWeight !== e &&
      ((this._fontWeight = e), (this.domNode.style.fontWeight = this._fontWeight));
  }
  setFontSize(e) {
    const t = Fq(e);
    this._fontSize !== t && ((this._fontSize = t), (this.domNode.style.fontSize = this._fontSize));
  }
  setFontStyle(e) {
    this._fontStyle !== e &&
      ((this._fontStyle = e), (this.domNode.style.fontStyle = this._fontStyle));
  }
  setFontFeatureSettings(e) {
    this._fontFeatureSettings !== e &&
      ((this._fontFeatureSettings = e),
      (this.domNode.style.fontFeatureSettings = this._fontFeatureSettings));
  }
  setFontVariationSettings(e) {
    this._fontVariationSettings !== e &&
      ((this._fontVariationSettings = e),
      (this.domNode.style.fontVariationSettings = this._fontVariationSettings));
  }
  setTextDecoration(e) {
    this._textDecoration !== e &&
      ((this._textDecoration = e), (this.domNode.style.textDecoration = this._textDecoration));
  }
  setLineHeight(e) {
    const t = Fq(e);
    this._lineHeight !== t &&
      ((this._lineHeight = t), (this.domNode.style.lineHeight = this._lineHeight));
  }
  setLetterSpacing(e) {
    const t = Fq(e);
    this._letterSpacing !== t &&
      ((this._letterSpacing = t), (this.domNode.style.letterSpacing = this._letterSpacing));
  }
  setClassName(e) {
    this._className !== e && ((this._className = e), (this.domNode.className = this._className));
  }
  toggleClassName(e, t) {
    (this.domNode.classList.toggle(e, t), (this._className = this.domNode.className));
  }
  setDisplay(e) {
    this._display !== e && ((this._display = e), (this.domNode.style.display = this._display));
  }
  setPosition(e) {
    this._position !== e && ((this._position = e), (this.domNode.style.position = this._position));
  }
  setVisibility(e) {
    this._visibility !== e &&
      ((this._visibility = e), (this.domNode.style.visibility = this._visibility));
  }
  setColor(e) {
    this._color !== e && ((this._color = e), (this.domNode.style.color = this._color));
  }
  setBackgroundColor(e) {
    this._backgroundColor !== e &&
      ((this._backgroundColor = e), (this.domNode.style.backgroundColor = this._backgroundColor));
  }
  setLayerHinting(e) {
    this._layerHint !== e &&
      ((this._layerHint = e),
      (this.domNode.style.transform = this._layerHint ? "translate3d(0px, 0px, 0px)" : ""));
  }
  setBoxShadow(e) {
    this._boxShadow !== e && ((this._boxShadow = e), (this.domNode.style.boxShadow = e));
  }
  setContain(e) {
    this._contain !== e && ((this._contain = e), (this.domNode.style.contain = this._contain));
  }
  setAttribute(e, t) {
    this.domNode.setAttribute(e, t);
  }
  removeAttribute(e) {
    this.domNode.removeAttribute(e);
  }
  appendChild(e) {
    this.domNode.appendChild(e.domNode);
  }
  removeChild(e) {
    this.domNode.removeChild(e.domNode);
  }
}
function Fq(e) {
  return "number" == typeof e ? `${e}px` : e;
}
function Bq(e) {
  return new jq(e);
}
function Vq(e, t) {
  e instanceof jq
    ? (e.setFontFamily(t.getMassagedFontFamily()),
      e.setFontWeight(t.fontWeight),
      e.setFontSize(t.fontSize),
      e.setFontFeatureSettings(t.fontFeatureSettings),
      e.setFontVariationSettings(t.fontVariationSettings),
      e.setLineHeight(t.lineHeight),
      e.setLetterSpacing(t.letterSpacing))
    : ((e.style.fontFamily = t.getMassagedFontFamily()),
      (e.style.fontWeight = t.fontWeight),
      (e.style.fontSize = t.fontSize + "px"),
      (e.style.fontFeatureSettings = t.fontFeatureSettings),
      (e.style.fontVariationSettings = t.fontVariationSettings),
      (e.style.lineHeight = t.lineHeight + "px"),
      (e.style.letterSpacing = t.letterSpacing + "px"));
}
class Wq extends PO {
  constructor(e, t) {
    (super(),
      (this._onDidChange = this._register(new QO())),
      (this.onDidChange = this._onDidChange.event),
      (this._referenceDomElement = e),
      (this._width = -1),
      (this._height = -1),
      (this._resizeObserver = null),
      this.measureReferenceDomElement(!1, t));
  }
  dispose() {
    (this.stopObserving(), super.dispose());
  }
  getWidth() {
    return this._width;
  }
  getHeight() {
    return this._height;
  }
  startObserving() {
    if (!this._resizeObserver && this._referenceDomElement) {
      let e = null;
      const t = () => {
        e ? this.observe({ width: e.width, height: e.height }) : this.observe();
      };
      let n = !1,
        i = !1;
      const r = () => {
        if (n && !i)
          try {
            ((n = !1), (i = !0), t());
          } finally {
            JF(MF(this._referenceDomElement), () => {
              ((i = !1), r());
            });
          }
      };
      ((this._resizeObserver = new ResizeObserver((t) => {
        ((e =
          t && t[0] && t[0].contentRect
            ? { width: t[0].contentRect.width, height: t[0].contentRect.height }
            : null),
          (n = !0),
          r());
      })),
        this._resizeObserver.observe(this._referenceDomElement));
    }
  }
  stopObserving() {
    this._resizeObserver && (this._resizeObserver.disconnect(), (this._resizeObserver = null));
  }
  observe(e) {
    this.measureReferenceDomElement(!0, e);
  }
  measureReferenceDomElement(e, t) {
    let n = 0,
      i = 0;
    (t
      ? ((n = t.width), (i = t.height))
      : this._referenceDomElement &&
        ((n = this._referenceDomElement.clientWidth), (i = this._referenceDomElement.clientHeight)),
      (n = Math.max(5, n)),
      (i = Math.max(5, i)),
      (this._width === n && this._height === i) ||
        ((this._width = n), (this._height = i), e && this._onDidChange.fire()));
  }
}
class Hq extends PO {
  constructor(e) {
    (super(),
      (this._onDidChange = this._register(new QO())),
      (this.onDidChange = this._onDidChange.event),
      (this._listener = () => this._handleChange(e, !0)),
      (this._mediaQueryList = null),
      this._handleChange(e, !1));
  }
  _handleChange(e, t) {
    (this._mediaQueryList?.removeEventListener("change", this._listener),
      (this._mediaQueryList = e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`)),
      this._mediaQueryList.addEventListener("change", this._listener),
      t && this._onDidChange.fire());
  }
}
class zq extends PO {
  get value() {
    return this._value;
  }
  constructor(e) {
    (super(),
      (this._onDidChange = this._register(new QO())),
      (this.onDidChange = this._onDidChange.event),
      (this._value = this._getPixelRatio(e)));
    const t = this._register(new Hq(e));
    this._register(
      t.onDidChange(() => {
        ((this._value = this._getPixelRatio(e)), this._onDidChange.fire(this._value));
      }),
    );
  }
  _getPixelRatio(e) {
    const t = document.createElement("canvas").getContext("2d");
    return (
      (e.devicePixelRatio || 1) /
      (t.webkitBackingStorePixelRatio ||
        t.mozBackingStorePixelRatio ||
        t.msBackingStorePixelRatio ||
        t.oBackingStorePixelRatio ||
        t.backingStorePixelRatio ||
        1)
    );
  }
}
const Uq = new (class {
  constructor() {
    this.mapWindowIdToPixelRatioMonitor = new Map();
  }
  _getOrCreatePixelRatioMonitor(e) {
    const t = FF(e);
    let n = this.mapWindowIdToPixelRatioMonitor.get(t);
    return (
      n ||
        ((n = new zq(e)),
        this.mapWindowIdToPixelRatioMonitor.set(t, n),
        $O.once(HF)(({ vscodeWindowId: e }) => {
          e === t && (n?.dispose(), this.mapWindowIdToPixelRatioMonitor.delete(t));
        })),
      n
    );
  }
  getInstance(e) {
    return this._getOrCreatePixelRatioMonitor(e);
  }
})();
class $q {
  constructor(e, t) {
    ((this.chr = e), (this.type = t), (this.width = 0));
  }
  fulfill(e) {
    this.width = e;
  }
}
class qq {
  constructor(e, t) {
    ((this._bareFontInfo = e),
      (this._requests = t),
      (this._container = null),
      (this._testElements = null));
  }
  read(e) {
    (this._createDomElements(),
      e.document.body.appendChild(this._container),
      this._readFromDomElements(),
      this._container?.remove(),
      (this._container = null),
      (this._testElements = null));
  }
  _createDomElements() {
    const e = document.createElement("div");
    ((e.style.position = "absolute"), (e.style.top = "-50000px"), (e.style.width = "50000px"));
    const t = document.createElement("div");
    (Vq(t, this._bareFontInfo), e.appendChild(t));
    const n = document.createElement("div");
    (Vq(n, this._bareFontInfo), (n.style.fontWeight = "bold"), e.appendChild(n));
    const i = document.createElement("div");
    (Vq(i, this._bareFontInfo), (i.style.fontStyle = "italic"), e.appendChild(i));
    const r = [];
    for (const o of this._requests) {
      let e;
      (0 === o.type && (e = t),
        2 === o.type && (e = n),
        1 === o.type && (e = i),
        e.appendChild(document.createElement("br")));
      const s = document.createElement("span");
      (qq._render(s, o), e.appendChild(s), r.push(s));
    }
    ((this._container = e), (this._testElements = r));
  }
  static _render(e, t) {
    if (" " === t.chr) {
      let t = " ";
      for (let e = 0; e < 8; e++) t += t;
      e.innerText = t;
    } else {
      let n = t.chr;
      for (let e = 0; e < 8; e++) n += n;
      e.textContent = n;
    }
  }
  _readFromDomElements() {
    for (let e = 0, t = this._requests.length; e < t; e++) {
      const t = this._requests[e],
        n = this._testElements[e];
      t.fulfill(n.offsetWidth / 256);
    }
  }
}
const Kq = new (class {
    constructor() {
      ((this._zoomLevel = 0),
        (this._onDidChangeZoomLevel = new QO()),
        (this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event));
    }
    getZoomLevel() {
      return this._zoomLevel;
    }
    setZoomLevel(e) {
      ((e = Math.min(Math.max(-5, e), 20)),
        this._zoomLevel !== e &&
          ((this._zoomLevel = e), this._onDidChangeZoomLevel.fire(this._zoomLevel)));
    }
  })(),
  Gq = PR ? 1.5 : 1.35;
class Zq {
  static _create(e, t, n, i, r, o, s, a, l) {
    (0 === o ? (o = Gq * n) : o < 8 && (o *= n), (o = Math.round(o)) < 8 && (o = 8));
    const c = 1 + (l ? 0 : 0.1 * Kq.getZoomLevel());
    if (((n *= c), (o *= c), r === Qq))
      if ("normal" === t || "bold" === t) r = Xq;
      else {
        ((r = `'wght' ${parseInt(t, 10)}`), (t = "normal"));
      }
    return new Zq({
      pixelRatio: a,
      fontFamily: e,
      fontWeight: t,
      fontSize: n,
      fontFeatureSettings: i,
      fontVariationSettings: r,
      lineHeight: o,
      letterSpacing: s,
    });
  }
  constructor(e) {
    ((this._bareFontInfoBrand = void 0),
      (this.pixelRatio = e.pixelRatio),
      (this.fontFamily = String(e.fontFamily)),
      (this.fontWeight = String(e.fontWeight)),
      (this.fontSize = e.fontSize),
      (this.fontFeatureSettings = e.fontFeatureSettings),
      (this.fontVariationSettings = e.fontVariationSettings),
      (this.lineHeight = 0 | e.lineHeight),
      (this.letterSpacing = e.letterSpacing));
  }
  getId() {
    return `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`;
  }
  getMassagedFontFamily() {
    const e = Jq.fontFamily,
      t = Zq._wrapInQuotes(this.fontFamily);
    return this.fontFamily !== e ? `${t}, ${e}` : t;
  }
  static _wrapInQuotes(e) {
    return /[,"']/.test(e) ? e : /[+ ]/.test(e) ? `"${e}"` : e;
  }
}
class Yq extends Zq {
  constructor(e, t) {
    (super(e),
      (this._editorStylingBrand = void 0),
      (this.version = 2),
      (this.isTrusted = t),
      (this.isMonospace = e.isMonospace),
      (this.typicalHalfwidthCharacterWidth = e.typicalHalfwidthCharacterWidth),
      (this.typicalFullwidthCharacterWidth = e.typicalFullwidthCharacterWidth),
      (this.canUseHalfwidthRightwardsArrow = e.canUseHalfwidthRightwardsArrow),
      (this.spaceWidth = e.spaceWidth),
      (this.middotWidth = e.middotWidth),
      (this.wsmiddotWidth = e.wsmiddotWidth),
      (this.maxDigitWidth = e.maxDigitWidth));
  }
  equals(e) {
    return (
      this.fontFamily === e.fontFamily &&
      this.fontWeight === e.fontWeight &&
      this.fontSize === e.fontSize &&
      this.fontFeatureSettings === e.fontFeatureSettings &&
      this.fontVariationSettings === e.fontVariationSettings &&
      this.lineHeight === e.lineHeight &&
      this.letterSpacing === e.letterSpacing &&
      this.typicalHalfwidthCharacterWidth === e.typicalHalfwidthCharacterWidth &&
      this.typicalFullwidthCharacterWidth === e.typicalFullwidthCharacterWidth &&
      this.canUseHalfwidthRightwardsArrow === e.canUseHalfwidthRightwardsArrow &&
      this.spaceWidth === e.spaceWidth &&
      this.middotWidth === e.middotWidth &&
      this.wsmiddotWidth === e.wsmiddotWidth &&
      this.maxDigitWidth === e.maxDigitWidth
    );
  }
}
const Xq = "normal",
  Qq = "translate",
  Jq = {
    fontFamily: PR
      ? "Menlo, Monaco, 'Courier New', monospace"
      : AR
        ? "Consolas, 'Courier New', monospace"
        : "'Droid Sans Mono', 'monospace', monospace",
    fontWeight: "normal",
    fontSize: PR ? 12 : 14,
    lineHeight: 0,
    letterSpacing: 0,
  },
  eK = {
    tabSize: 4,
    indentSize: 4,
    insertSpaces: !0,
    detectIndentation: !0,
    trimAutoWhitespace: !0,
    largeFileOptimizations: !0,
    bracketPairColorizationOptions: { enabled: !0, independentColorPoolPerBracketType: !1 },
  };
class tK {
  constructor(e) {
    this._values = e;
  }
  hasChanged(e) {
    return this._values[e];
  }
}
class nK {
  constructor() {
    ((this.stableMinimapLayoutInput = null),
      (this.stableFitMaxMinimapScale = 0),
      (this.stableFitRemainingWidth = 0));
  }
}
class iK {
  constructor(e, t, n, i) {
    ((this.id = e), (this.name = t), (this.defaultValue = n), (this.schema = i));
  }
  applyUpdate(e, t) {
    return oK(e, t);
  }
  compute(e, t, n) {
    return n;
  }
}
class rK {
  constructor(e, t) {
    ((this.newValue = e), (this.didChange = t));
  }
}
function oK(e, t) {
  if ("object" != typeof e || "object" != typeof t || !e || !t) return new rK(t, e !== t);
  if (Array.isArray(e) || Array.isArray(t)) {
    const n = Array.isArray(e) && Array.isArray(t) && XP(e, t);
    return new rK(t, !n);
  }
  let n = !1;
  for (const i in t)
    if (t.hasOwnProperty(i)) {
      const r = oK(e[i], t[i]);
      r.didChange && ((e[i] = r.newValue), (n = !0));
    }
  return new rK(e, n);
}
class sK {
  constructor(e, t) {
    ((this.schema = void 0), (this.id = e), (this.name = "_never_"), (this.defaultValue = t));
  }
  applyUpdate(e, t) {
    return oK(e, t);
  }
  validate(e) {
    return this.defaultValue;
  }
}
class aK {
  constructor(e, t, n, i) {
    ((this.id = e), (this.name = t), (this.defaultValue = n), (this.schema = i));
  }
  applyUpdate(e, t) {
    return oK(e, t);
  }
  compute(e, t, n) {
    return n;
  }
}
function lK(e, t) {
  return void 0 === e ? t : "false" !== e && Boolean(e);
}
class cK extends aK {
  constructor(e, t, n, i = void 0) {
    (void 0 !== i && ((i.type = "boolean"), (i.default = n)), super(e, t, n, i));
  }
  validate(e) {
    return lK(e, this.defaultValue);
  }
}
function dK(e, t, n, i) {
  if (("string" == typeof e && (e = parseInt(e, 10)), "number" != typeof e || isNaN(e))) return t;
  let r = e;
  return ((r = Math.max(n, r)), (r = Math.min(i, r)), 0 | r);
}
class uK extends aK {
  static clampedInt(e, t, n, i) {
    return dK(e, t, n, i);
  }
  constructor(e, t, n, i, r, o = void 0) {
    (void 0 !== o && ((o.type = "integer"), (o.default = n), (o.minimum = i), (o.maximum = r)),
      super(e, t, n, o),
      (this.minimum = i),
      (this.maximum = r));
  }
  validate(e) {
    return uK.clampedInt(e, this.defaultValue, this.minimum, this.maximum);
  }
}
function hK(e, t, n, i) {
  if (void 0 === e) return t;
  const r = gK.float(e, t);
  return gK.clamp(r, n, i);
}
class gK extends aK {
  static clamp(e, t, n) {
    return e < t ? t : e > n ? n : e;
  }
  static float(e, t) {
    return ("string" == typeof e && (e = parseFloat(e)), "number" != typeof e || isNaN(e) ? t : e);
  }
  constructor(e, t, n, i, r, o, s) {
    (void 0 !== r && ((r.type = "number"), (r.default = n), (r.minimum = o), (r.maximum = s)),
      super(e, t, n, r),
      (this.validationFn = i),
      (this.minimum = o),
      (this.maximum = s));
  }
  validate(e) {
    return this.validationFn(gK.float(e, this.defaultValue));
  }
}
class pK extends aK {
  static string(e, t) {
    return "string" != typeof e ? t : e;
  }
  constructor(e, t, n, i = void 0) {
    (void 0 !== i && ((i.type = "string"), (i.default = n)), super(e, t, n, i));
  }
  validate(e) {
    return pK.string(e, this.defaultValue);
  }
}
function fK(e, t, n, i) {
  return "string" != typeof e ? t : i && e in i ? i[e] : -1 === n.indexOf(e) ? t : e;
}
class mK extends aK {
  constructor(e, t, n, i, r = void 0) {
    (void 0 !== r && ((r.type = "string"), (r.enum = i.slice(0)), (r.default = n)),
      super(e, t, n, r),
      (this._allowedValues = i));
  }
  validate(e) {
    return fK(e, this.defaultValue, this._allowedValues);
  }
}
class _K extends iK {
  constructor(e, t, n, i, r, o, s = void 0) {
    (void 0 !== s && ((s.type = "string"), (s.enum = r), (s.default = i)),
      super(e, t, n, s),
      (this._allowedValues = r),
      (this._convert = o));
  }
  validate(e) {
    return "string" != typeof e || -1 === this._allowedValues.indexOf(e)
      ? this.defaultValue
      : this._convert(e);
  }
}
var vK, bK;
function yK(e) {
  switch (e) {
    case "line":
      return vK.Line;
    case "block":
      return vK.Block;
    case "underline":
      return vK.Underline;
    case "line-thin":
      return vK.LineThin;
    case "block-outline":
      return vK.BlockOutline;
    case "underline-thin":
      return vK.UnderlineThin;
  }
}
!(function (e) {
  ((e[(e.Line = 1)] = "Line"),
    (e[(e.Block = 2)] = "Block"),
    (e[(e.Underline = 3)] = "Underline"),
    (e[(e.LineThin = 4)] = "LineThin"),
    (e[(e.BlockOutline = 5)] = "BlockOutline"),
    (e[(e.UnderlineThin = 6)] = "UnderlineThin"));
})(vK || (vK = {}));
class xK extends iK {
  static {
    this.OFF = '"liga" off, "calt" off';
  }
  static {
    this.ON = '"liga" on, "calt" on';
  }
  constructor() {
    super(60, "fontLigatures", xK.OFF, {
      anyOf: [
        {
          type: "boolean",
          description: SI(
            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: SI(
            228,
            "Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.",
          ),
        },
      ],
      description: SI(
        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: !1,
    });
  }
  validate(e) {
    return void 0 === e
      ? this.defaultValue
      : "string" == typeof e
        ? "false" === e || 0 === e.length
          ? xK.OFF
          : "true" === e
            ? xK.ON
            : e
        : Boolean(e)
          ? xK.ON
          : xK.OFF;
  }
}
class wK extends iK {
  static {
    this.OFF = Xq;
  }
  static {
    this.TRANSLATE = Qq;
  }
  constructor() {
    super(63, "fontVariations", wK.OFF, {
      anyOf: [
        {
          type: "boolean",
          description: SI(
            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: SI(
            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: SI(
        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: !1,
    });
  }
  validate(e) {
    return void 0 === e
      ? this.defaultValue
      : "string" == typeof e
        ? "false" === e
          ? wK.OFF
          : "true" === e
            ? wK.TRANSLATE
            : e
        : Boolean(e)
          ? wK.TRANSLATE
          : wK.OFF;
  }
  compute(e, t, n) {
    return e.fontInfo.fontVariationSettings;
  }
}
class CK extends iK {
  static {
    this.SUGGESTION_VALUES = [
      "normal",
      "bold",
      "100",
      "200",
      "300",
      "400",
      "500",
      "600",
      "700",
      "800",
      "900",
    ];
  }
  static {
    this.MINIMUM_VALUE = 1;
  }
  static {
    this.MAXIMUM_VALUE = 1e3;
  }
  constructor() {
    super(62, "fontWeight", Jq.fontWeight, {
      anyOf: [
        {
          type: "number",
          minimum: CK.MINIMUM_VALUE,
          maximum: CK.MAXIMUM_VALUE,
          errorMessage: SI(
            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: CK.SUGGESTION_VALUES },
      ],
      default: Jq.fontWeight,
      description: SI(
        235,
        'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.',
      ),
    });
  }
  validate(e) {
    return "normal" === e || "bold" === e
      ? e
      : String(uK.clampedInt(e, Jq.fontWeight, CK.MINIMUM_VALUE, CK.MAXIMUM_VALUE));
  }
}
class SK extends sK {
  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: !1,
        minimapIsSampling: !1,
        minimapScale: 1,
        minimapLineHeight: 1,
        minimapCanvasInnerWidth: 0,
        minimapCanvasInnerHeight: 0,
        minimapCanvasOuterWidth: 0,
        minimapCanvasOuterHeight: 0,
      },
      viewportColumn: 0,
      isWordWrapMinified: !1,
      isViewportWrapping: !1,
      wrappingColumn: -1,
      verticalScrollbarWidth: 0,
      horizontalScrollbarHeight: 0,
      overviewRuler: { top: 0, width: 0, height: 0, right: 0 },
    });
  }
  compute(e, t, n) {
    return SK.computeLayout(t, {
      memory: e.memory,
      outerWidth: e.outerWidth,
      outerHeight: e.outerHeight,
      isDominatedByLongLines: e.isDominatedByLongLines,
      lineHeight: e.fontInfo.lineHeight,
      viewLineCount: e.viewLineCount,
      lineNumbersDigitCount: e.lineNumbersDigitCount,
      typicalHalfwidthCharacterWidth: e.fontInfo.typicalHalfwidthCharacterWidth,
      maxDigitWidth: e.fontInfo.maxDigitWidth,
      pixelRatio: e.pixelRatio,
      glyphMarginDecorationLaneCount: e.glyphMarginDecorationLaneCount,
    });
  }
  static computeContainedMinimapLineCount(e) {
    const t = e.height / e.lineHeight,
      n = Math.floor(e.paddingTop / e.lineHeight);
    let i = Math.floor(e.paddingBottom / e.lineHeight);
    e.scrollBeyondLastLine && (i = Math.max(i, t - 1));
    const r = (n + e.viewLineCount + i) / (e.pixelRatio * e.height);
    return {
      typicalViewportLineCount: t,
      extraLinesBeforeFirstLine: n,
      extraLinesBeyondLastLine: i,
      desiredRatio: r,
      minimapLineCount: Math.floor(e.viewLineCount / r),
    };
  }
  static _computeMinimapLayout(e, t) {
    const n = e.outerWidth,
      i = e.outerHeight,
      r = e.pixelRatio;
    if (!e.minimap.enabled)
      return {
        renderMinimap: 0,
        minimapLeft: 0,
        minimapWidth: 0,
        minimapHeightIsEditorHeight: !1,
        minimapIsSampling: !1,
        minimapScale: 1,
        minimapLineHeight: 1,
        minimapCanvasInnerWidth: 0,
        minimapCanvasInnerHeight: Math.floor(r * i),
        minimapCanvasOuterWidth: 0,
        minimapCanvasOuterHeight: i,
      };
    const o = t.stableMinimapLayoutInput,
      s =
        o &&
        e.outerHeight === o.outerHeight &&
        e.lineHeight === o.lineHeight &&
        e.typicalHalfwidthCharacterWidth === o.typicalHalfwidthCharacterWidth &&
        e.pixelRatio === o.pixelRatio &&
        e.scrollBeyondLastLine === o.scrollBeyondLastLine &&
        e.paddingTop === o.paddingTop &&
        e.paddingBottom === o.paddingBottom &&
        e.minimap.enabled === o.minimap.enabled &&
        e.minimap.side === o.minimap.side &&
        e.minimap.size === o.minimap.size &&
        e.minimap.showSlider === o.minimap.showSlider &&
        e.minimap.renderCharacters === o.minimap.renderCharacters &&
        e.minimap.maxColumn === o.minimap.maxColumn &&
        e.minimap.scale === o.minimap.scale &&
        e.verticalScrollbarWidth === o.verticalScrollbarWidth &&
        e.isViewportWrapping === o.isViewportWrapping,
      a = e.lineHeight,
      l = e.typicalHalfwidthCharacterWidth,
      c = e.scrollBeyondLastLine,
      d = e.minimap.renderCharacters;
    let u = r >= 2 ? Math.round(2 * e.minimap.scale) : e.minimap.scale;
    const h = e.minimap.maxColumn,
      g = e.minimap.size,
      p = e.minimap.side,
      f = e.verticalScrollbarWidth,
      m = e.viewLineCount,
      _ = e.remainingWidth,
      v = e.isViewportWrapping,
      b = d ? 2 : 3;
    let y = Math.floor(r * i);
    const x = y / r;
    let w = !1,
      C = !1,
      S = b * u,
      k = u / r,
      E = 1;
    if ("fill" === g || "fit" === g) {
      const {
        typicalViewportLineCount: n,
        extraLinesBeforeFirstLine: o,
        extraLinesBeyondLastLine: l,
        desiredRatio: d,
        minimapLineCount: h,
      } = SK.computeContainedMinimapLineCount({
        viewLineCount: m,
        scrollBeyondLastLine: c,
        paddingTop: e.paddingTop,
        paddingBottom: e.paddingBottom,
        height: i,
        lineHeight: a,
        pixelRatio: r,
      });
      if (m / h > 1) ((w = !0), (C = !0), (u = 1), (S = 1), (k = u / r));
      else {
        let i = !1,
          c = u + 1;
        if ("fit" === g) {
          const e = Math.ceil((o + m + l) * S);
          v && s && _ <= t.stableFitRemainingWidth
            ? ((i = !0), (c = t.stableFitMaxMinimapScale))
            : (i = e > y);
        }
        if ("fill" === g || i) {
          w = !0;
          const i = u;
          ((S = Math.min(a * r, Math.max(1, Math.floor(1 / d)))),
            v && s && _ <= t.stableFitRemainingWidth && (c = t.stableFitMaxMinimapScale),
            (u = Math.min(c, Math.max(1, Math.floor(S / b)))),
            u > i && (E = Math.min(2, u / i)),
            (k = u / r / E),
            (y = Math.ceil(Math.max(n, o + m + l) * S)),
            v
              ? ((t.stableMinimapLayoutInput = e),
                (t.stableFitRemainingWidth = _),
                (t.stableFitMaxMinimapScale = u))
              : ((t.stableMinimapLayoutInput = null), (t.stableFitRemainingWidth = 0)));
        }
      }
    }
    const N = Math.floor(h * k),
      L = Math.min(N, Math.max(0, Math.floor(((_ - f - 2) * k) / (l + k))) + 8);
    let D = Math.floor(r * L);
    const T = D / r;
    D = Math.floor(D * E);
    return {
      renderMinimap: d ? 1 : 2,
      minimapLeft: "left" === p ? 0 : n - L - f,
      minimapWidth: L,
      minimapHeightIsEditorHeight: w,
      minimapIsSampling: C,
      minimapScale: u,
      minimapLineHeight: S,
      minimapCanvasInnerWidth: D,
      minimapCanvasInnerHeight: y,
      minimapCanvasOuterWidth: T,
      minimapCanvasOuterHeight: x,
    };
  }
  static computeLayout(e, t) {
    const n = 0 | t.outerWidth,
      i = 0 | t.outerHeight,
      r = 0 | t.lineHeight,
      o = 0 | t.lineNumbersDigitCount,
      s = t.typicalHalfwidthCharacterWidth,
      a = t.maxDigitWidth,
      l = t.pixelRatio,
      c = t.viewLineCount,
      d = e.get(154),
      u = "inherit" === d ? e.get(153) : d,
      h = "inherit" === u ? e.get(149) : u,
      g = e.get(152),
      p = t.isDominatedByLongLines,
      f = e.get(66),
      m = 0 !== e.get(76).renderType,
      _ = e.get(77),
      v = e.get(119),
      b = e.get(96),
      y = e.get(81),
      x = e.get(117),
      w = x.verticalScrollbarSize,
      C = x.verticalHasArrows,
      S = x.arrowSize,
      k = x.horizontalScrollbarSize,
      E = e.get(52),
      N = "never" !== e.get(126);
    let L = e.get(74);
    E && N && (L += 16);
    let D = 0;
    if (m) {
      const e = Math.max(o, _);
      D = Math.round(e * a);
    }
    let T = 0;
    f && (T = r * t.glyphMarginDecorationLaneCount);
    let I = 0,
      R = I + T,
      O = R + D,
      M = O + L;
    const A = n - T - D - L;
    let P = !1,
      j = !1,
      F = -1;
    2 === e.get(2) && "inherit" === u && p
      ? ((P = !0), (j = !0))
      : "on" === h || "bounded" === h
        ? (j = !0)
        : "wordWrapColumn" === h && (F = g);
    const B = SK._computeMinimapLayout(
      {
        outerWidth: n,
        outerHeight: i,
        lineHeight: r,
        typicalHalfwidthCharacterWidth: s,
        pixelRatio: l,
        scrollBeyondLastLine: v,
        paddingTop: b.top,
        paddingBottom: b.bottom,
        minimap: y,
        verticalScrollbarWidth: w,
        viewLineCount: c,
        remainingWidth: A,
        isViewportWrapping: j,
      },
      t.memory || new nK(),
    );
    0 !== B.renderMinimap &&
      0 === B.minimapLeft &&
      ((I += B.minimapWidth), (R += B.minimapWidth), (O += B.minimapWidth), (M += B.minimapWidth));
    const V = A - B.minimapWidth,
      W = Math.max(1, Math.floor((V - w - 2) / s)),
      H = C ? S : 0;
    return (
      j && ((F = Math.max(1, W)), "bounded" === h && (F = Math.min(F, g))),
      {
        width: n,
        height: i,
        glyphMarginLeft: I,
        glyphMarginWidth: T,
        glyphMarginDecorationLaneCount: t.glyphMarginDecorationLaneCount,
        lineNumbersLeft: R,
        lineNumbersWidth: D,
        decorationsLeft: O,
        decorationsWidth: L,
        contentLeft: M,
        contentWidth: V,
        minimap: B,
        viewportColumn: W,
        isWordWrapMinified: P,
        isViewportWrapping: j,
        wrappingColumn: F,
        verticalScrollbarWidth: w,
        horizontalScrollbarHeight: k,
        overviewRuler: { top: H, width: w, height: i - 2 * H, right: 0 },
      }
    );
  }
}
!(function (e) {
  ((e.Off = "off"), (e.OnCode = "onCode"), (e.On = "on"));
})(bK || (bK = {}));
function kK(e) {
  const t = e.get(112);
  return "editable" === t ? e.get(104) : "on" !== t;
}
function EK(e) {
  return !e.get(172);
}
function NK(e, t) {
  if ("string" != typeof e) return t;
  switch (e) {
    case "hidden":
      return 2;
    case "visible":
      return 3;
    default:
      return 1;
  }
}
const LK = "inUntrustedWorkspace",
  DK = "editor.unicodeHighlight.allowedCharacters",
  TK = "editor.unicodeHighlight.invisibleCharacters",
  IK = "editor.unicodeHighlight.nonBasicASCII",
  RK = "editor.unicodeHighlight.ambiguousCharacters",
  OK = "editor.unicodeHighlight.includeComments",
  MK = "editor.unicodeHighlight.includeStrings",
  AK = "editor.unicodeHighlight.allowedLocales";
function PK(e, t, n) {
  const i = n.indexOf(e);
  return -1 === i ? t : n[i];
}
const jK = [];
function FK(e) {
  return ((jK[e.id] = e), e);
}
const BK = {
  acceptSuggestionOnCommitCharacter: FK(
    new cK(0, "acceptSuggestionOnCommitCharacter", !0, {
      markdownDescription: SI(
        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: FK(
    new mK(1, "acceptSuggestionOnEnter", "on", ["on", "smart", "off"], {
      markdownEnumDescriptions: [
        "",
        SI(433, "Only accept a suggestion with `Enter` when it makes a textual change."),
        "",
      ],
      markdownDescription: SI(
        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: FK(
    new (class extends iK {
      constructor() {
        super(2, "accessibilitySupport", 0, {
          type: "string",
          enum: ["auto", "on", "off"],
          enumDescriptions: [
            SI(201, "Use platform APIs to detect when a Screen Reader is attached."),
            SI(202, "Optimize for usage with a Screen Reader."),
            SI(203, "Assume a screen reader is not attached."),
          ],
          default: "auto",
          tags: ["accessibility"],
          description: SI(
            204,
            "Controls if the UI should run in a mode where it is optimized for screen readers.",
          ),
        });
      }
      validate(e) {
        switch (e) {
          case "auto":
            return 0;
          case "off":
            return 1;
          case "on":
            return 2;
        }
        return this.defaultValue;
      }
      compute(e, t, n) {
        return 0 === n ? e.accessibilitySupport : n;
      }
    })(),
  ),
  accessibilityPageSize: FK(
    new uK(3, "accessibilityPageSize", 500, 1, 1073741824, {
      description: SI(
        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: FK(new cK(4, "allowOverflow", !0)),
  allowVariableLineHeights: FK(
    new cK(5, "allowVariableLineHeights", !0, {
      description: SI(436, "Controls whether to allow using variable line heights in the editor."),
    }),
  ),
  allowVariableFonts: FK(
    new cK(6, "allowVariableFonts", !0, {
      description: SI(437, "Controls whether to allow using variable fonts in the editor."),
    }),
  ),
  allowVariableFontsInAccessibilityMode: FK(
    new cK(7, "allowVariableFontsInAccessibilityMode", !1, {
      description: SI(
        438,
        "Controls whether to allow using variable fonts in the editor in the accessibility mode.",
      ),
      tags: ["accessibility"],
    }),
  ),
  ariaLabel: FK(new pK(8, "ariaLabel", SI(439, "Editor content"))),
  ariaRequired: FK(new cK(9, "ariaRequired", !1, void 0)),
  screenReaderAnnounceInlineSuggestion: FK(
    new cK(12, "screenReaderAnnounceInlineSuggestion", !0, {
      description: SI(440, "Control whether inline suggestions are announced by a screen reader."),
      tags: ["accessibility"],
    }),
  ),
  autoClosingBrackets: FK(
    new mK(
      10,
      "autoClosingBrackets",
      "languageDefined",
      ["always", "languageDefined", "beforeWhitespace", "never"],
      {
        enumDescriptions: [
          "",
          SI(441, "Use language configurations to determine when to autoclose brackets."),
          SI(442, "Autoclose brackets only when the cursor is to the left of whitespace."),
          "",
        ],
        description: SI(
          443,
          "Controls whether the editor should automatically close brackets after the user adds an opening bracket.",
        ),
      },
    ),
  ),
  autoClosingComments: FK(
    new mK(
      11,
      "autoClosingComments",
      "languageDefined",
      ["always", "languageDefined", "beforeWhitespace", "never"],
      {
        enumDescriptions: [
          "",
          SI(444, "Use language configurations to determine when to autoclose comments."),
          SI(445, "Autoclose comments only when the cursor is to the left of whitespace."),
          "",
        ],
        description: SI(
          446,
          "Controls whether the editor should automatically close comments after the user adds an opening comment.",
        ),
      },
    ),
  ),
  autoClosingDelete: FK(
    new mK(13, "autoClosingDelete", "auto", ["always", "auto", "never"], {
      enumDescriptions: [
        "",
        SI(
          447,
          "Remove adjacent closing quotes or brackets only if they were automatically inserted.",
        ),
        "",
      ],
      description: SI(
        448,
        "Controls whether the editor should remove adjacent closing quotes or brackets when deleting.",
      ),
    }),
  ),
  autoClosingOvertype: FK(
    new mK(14, "autoClosingOvertype", "auto", ["always", "auto", "never"], {
      enumDescriptions: [
        "",
        SI(449, "Type over closing quotes or brackets only if they were automatically inserted."),
        "",
      ],
      description: SI(
        450,
        "Controls whether the editor should type over closing quotes or brackets.",
      ),
    }),
  ),
  autoClosingQuotes: FK(
    new mK(
      15,
      "autoClosingQuotes",
      "languageDefined",
      ["always", "languageDefined", "beforeWhitespace", "never"],
      {
        enumDescriptions: [
          "",
          SI(451, "Use language configurations to determine when to autoclose quotes."),
          SI(452, "Autoclose quotes only when the cursor is to the left of whitespace."),
          "",
        ],
        description: SI(
          453,
          "Controls whether the editor should automatically close quotes after the user adds an opening quote.",
        ),
      },
    ),
  ),
  autoIndent: FK(
    new _K(
      16,
      "autoIndent",
      4,
      "full",
      ["none", "keep", "brackets", "advanced", "full"],
      function (e) {
        switch (e) {
          case "none":
            return 0;
          case "keep":
            return 1;
          case "brackets":
            return 2;
          case "advanced":
            return 3;
          case "full":
            return 4;
        }
      },
      {
        enumDescriptions: [
          SI(454, "The editor will not insert indentation automatically."),
          SI(455, "The editor will keep the current line's indentation."),
          SI(
            456,
            "The editor will keep the current line's indentation and honor language defined brackets.",
          ),
          SI(
            457,
            "The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages.",
          ),
          SI(
            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: SI(
          459,
          "Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.",
        ),
      },
    ),
  ),
  autoIndentOnPaste: FK(
    new cK(17, "autoIndentOnPaste", !1, {
      description: SI(
        460,
        "Controls whether the editor should automatically auto-indent the pasted content.",
      ),
    }),
  ),
  autoIndentOnPasteWithinString: FK(
    new cK(18, "autoIndentOnPasteWithinString", !0, {
      description: SI(
        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: FK(new cK(19, "automaticLayout", !1)),
  autoSurround: FK(
    new mK(
      20,
      "autoSurround",
      "languageDefined",
      ["languageDefined", "quotes", "brackets", "never"],
      {
        enumDescriptions: [
          SI(
            462,
            "Use language configurations to determine when to automatically surround selections.",
          ),
          SI(463, "Surround with quotes but not brackets."),
          SI(464, "Surround with brackets but not quotes."),
          "",
        ],
        description: SI(
          465,
          "Controls whether the editor should automatically surround selections when typing quotes or brackets.",
        ),
      },
    ),
  ),
  bracketPairColorization: FK(
    new (class extends iK {
      constructor() {
        const e = {
          enabled: eK.bracketPairColorizationOptions.enabled,
          independentColorPoolPerBracketType:
            eK.bracketPairColorizationOptions.independentColorPoolPerBracketType,
        };
        super(21, "bracketPairColorization", e, {
          "editor.bracketPairColorization.enabled": {
            type: "boolean",
            default: e.enabled,
            markdownDescription: SI(
              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: e.independentColorPoolPerBracketType,
            description: SI(
              353,
              "Controls whether each bracket type has its own independent color pool.",
            ),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          enabled: lK(t.enabled, this.defaultValue.enabled),
          independentColorPoolPerBracketType: lK(
            t.independentColorPoolPerBracketType,
            this.defaultValue.independentColorPoolPerBracketType,
          ),
        };
      }
    })(),
  ),
  bracketPairGuides: FK(
    new (class extends iK {
      constructor() {
        const e = {
          bracketPairs: !1,
          bracketPairsHorizontal: "active",
          highlightActiveBracketPair: !0,
          indentation: !0,
          highlightActiveIndentation: !0,
        };
        super(22, "guides", e, {
          "editor.guides.bracketPairs": {
            type: ["boolean", "string"],
            enum: [!0, "active", !1],
            enumDescriptions: [
              SI(354, "Enables bracket pair guides."),
              SI(355, "Enables bracket pair guides only for the active bracket pair."),
              SI(356, "Disables bracket pair guides."),
            ],
            default: e.bracketPairs,
            description: SI(357, "Controls whether bracket pair guides are enabled or not."),
          },
          "editor.guides.bracketPairsHorizontal": {
            type: ["boolean", "string"],
            enum: [!0, "active", !1],
            enumDescriptions: [
              SI(358, "Enables horizontal guides as addition to vertical bracket pair guides."),
              SI(359, "Enables horizontal guides only for the active bracket pair."),
              SI(360, "Disables horizontal bracket pair guides."),
            ],
            default: e.bracketPairsHorizontal,
            description: SI(
              361,
              "Controls whether horizontal bracket pair guides are enabled or not.",
            ),
          },
          "editor.guides.highlightActiveBracketPair": {
            type: "boolean",
            default: e.highlightActiveBracketPair,
            description: SI(
              362,
              "Controls whether the editor should highlight the active bracket pair.",
            ),
          },
          "editor.guides.indentation": {
            type: "boolean",
            default: e.indentation,
            description: SI(363, "Controls whether the editor should render indent guides."),
          },
          "editor.guides.highlightActiveIndentation": {
            type: ["boolean", "string"],
            enum: [!0, "always", !1],
            enumDescriptions: [
              SI(364, "Highlights the active indent guide."),
              SI(365, "Highlights the active indent guide even if bracket guides are highlighted."),
              SI(366, "Do not highlight the active indent guide."),
            ],
            default: e.highlightActiveIndentation,
            description: SI(
              367,
              "Controls whether the editor should highlight the active indent guide.",
            ),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          bracketPairs: PK(t.bracketPairs, this.defaultValue.bracketPairs, [!0, !1, "active"]),
          bracketPairsHorizontal: PK(
            t.bracketPairsHorizontal,
            this.defaultValue.bracketPairsHorizontal,
            [!0, !1, "active"],
          ),
          highlightActiveBracketPair: lK(
            t.highlightActiveBracketPair,
            this.defaultValue.highlightActiveBracketPair,
          ),
          indentation: lK(t.indentation, this.defaultValue.indentation),
          highlightActiveIndentation: PK(
            t.highlightActiveIndentation,
            this.defaultValue.highlightActiveIndentation,
            [!0, !1, "always"],
          ),
        };
      }
    })(),
  ),
  stickyTabStops: FK(
    new cK(132, "stickyTabStops", !1, {
      description: SI(
        466,
        "Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.",
      ),
    }),
  ),
  codeLens: FK(
    new cK(23, "codeLens", !0, {
      description: SI(467, "Controls whether the editor shows CodeLens."),
    }),
  ),
  codeLensFontFamily: FK(
    new pK(24, "codeLensFontFamily", "", {
      description: SI(468, "Controls the font family for CodeLens."),
    }),
  ),
  codeLensFontSize: FK(
    new uK(25, "codeLensFontSize", 0, 0, 100, {
      type: "number",
      default: 0,
      minimum: 0,
      maximum: 100,
      markdownDescription: SI(
        469,
        "Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.",
      ),
    }),
  ),
  colorDecorators: FK(
    new cK(26, "colorDecorators", !0, {
      description: SI(
        470,
        "Controls whether the editor should render the inline color decorators and color picker.",
      ),
    }),
  ),
  colorDecoratorActivatedOn: FK(
    new mK(
      168,
      "colorDecoratorsActivatedOn",
      "clickAndHover",
      ["clickAndHover", "hover", "click"],
      {
        enumDescriptions: [
          SI(471, "Make the color picker appear both on click and hover of the color decorator"),
          SI(472, "Make the color picker appear on hover of the color decorator"),
          SI(473, "Make the color picker appear on click of the color decorator"),
        ],
        description: SI(
          474,
          "Controls the condition to make a color picker appear from a color decorator.",
        ),
      },
    ),
  ),
  colorDecoratorsLimit: FK(
    new uK(27, "colorDecoratorsLimit", 500, 1, 1e6, {
      markdownDescription: SI(
        475,
        "Controls the max number of color decorators that can be rendered in an editor at once.",
      ),
    }),
  ),
  columnSelection: FK(
    new cK(28, "columnSelection", !1, {
      description: SI(
        476,
        "Enable that the selection with the mouse and keys is doing column selection.",
      ),
    }),
  ),
  comments: FK(
    new (class extends iK {
      constructor() {
        const e = { insertSpace: !0, ignoreEmptyLines: !0 };
        super(29, "comments", e, {
          "editor.comments.insertSpace": {
            type: "boolean",
            default: e.insertSpace,
            description: SI(205, "Controls whether a space character is inserted when commenting."),
          },
          "editor.comments.ignoreEmptyLines": {
            type: "boolean",
            default: e.ignoreEmptyLines,
            description: SI(
              206,
              "Controls if empty lines should be ignored with toggle, add or remove actions for line comments.",
            ),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          insertSpace: lK(t.insertSpace, this.defaultValue.insertSpace),
          ignoreEmptyLines: lK(t.ignoreEmptyLines, this.defaultValue.ignoreEmptyLines),
        };
      }
    })(),
  ),
  contextmenu: FK(new cK(30, "contextmenu", !0)),
  copyWithSyntaxHighlighting: FK(
    new cK(31, "copyWithSyntaxHighlighting", !0, {
      description: SI(
        477,
        "Controls whether syntax highlighting should be copied into the clipboard.",
      ),
    }),
  ),
  cursorBlinking: FK(
    new _K(
      32,
      "cursorBlinking",
      1,
      "blink",
      ["blink", "smooth", "phase", "expand", "solid"],
      function (e) {
        switch (e) {
          case "blink":
            return 1;
          case "smooth":
            return 2;
          case "phase":
            return 3;
          case "expand":
            return 4;
          case "solid":
            return 5;
        }
      },
      { description: SI(478, "Control the cursor animation style.") },
    ),
  ),
  cursorSmoothCaretAnimation: FK(
    new mK(33, "cursorSmoothCaretAnimation", "off", ["off", "explicit", "on"], {
      enumDescriptions: [
        SI(479, "Smooth caret animation is disabled."),
        SI(
          480,
          "Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture.",
        ),
        SI(481, "Smooth caret animation is always enabled."),
      ],
      description: SI(482, "Controls whether the smooth caret animation should be enabled."),
    }),
  ),
  cursorStyle: FK(
    new _K(
      34,
      "cursorStyle",
      vK.Line,
      "line",
      ["line", "block", "underline", "line-thin", "block-outline", "underline-thin"],
      yK,
      { description: SI(483, "Controls the cursor style in insert input mode.") },
    ),
  ),
  overtypeCursorStyle: FK(
    new _K(
      92,
      "overtypeCursorStyle",
      vK.Block,
      "block",
      ["line", "block", "underline", "line-thin", "block-outline", "underline-thin"],
      yK,
      { description: SI(484, "Controls the cursor style in overtype input mode.") },
    ),
  ),
  cursorSurroundingLines: FK(
    new uK(35, "cursorSurroundingLines", 0, 0, 1073741824, {
      description: SI(
        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: FK(
    new mK(36, "cursorSurroundingLinesStyle", "default", ["default", "all"], {
      enumDescriptions: [
        SI(
          486,
          "`cursorSurroundingLines` is enforced only when triggered via the keyboard or API.",
        ),
        SI(487, "`cursorSurroundingLines` is enforced always."),
      ],
      markdownDescription: SI(
        488,
        "Controls when `#editor.cursorSurroundingLines#` should be enforced.",
      ),
    }),
  ),
  cursorWidth: FK(
    new uK(37, "cursorWidth", 0, 0, 1073741824, {
      markdownDescription: SI(
        489,
        "Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.",
      ),
    }),
  ),
  cursorHeight: FK(
    new uK(38, "cursorHeight", 0, 0, 1073741824, {
      markdownDescription: SI(
        490,
        "Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.",
      ),
    }),
  ),
  disableLayerHinting: FK(new cK(39, "disableLayerHinting", !1)),
  disableMonospaceOptimizations: FK(new cK(40, "disableMonospaceOptimizations", !1)),
  domReadOnly: FK(new cK(41, "domReadOnly", !1)),
  dragAndDrop: FK(
    new cK(42, "dragAndDrop", !0, {
      description: SI(
        491,
        "Controls whether the editor should allow moving selections via drag and drop.",
      ),
    }),
  ),
  emptySelectionClipboard: FK(
    new (class extends cK {
      constructor() {
        super(45, "emptySelectionClipboard", !0, {
          description: SI(
            207,
            "Controls whether copying without a selection copies the current line.",
          ),
        });
      }
      compute(e, t, n) {
        return n && e.emptySelectionClipboard;
      }
    })(),
  ),
  dropIntoEditor: FK(
    new (class extends iK {
      constructor() {
        const e = { enabled: !0, showDropSelector: "afterDrop" };
        super(43, "dropIntoEditor", e, {
          "editor.dropIntoEditor.enabled": {
            type: "boolean",
            default: e.enabled,
            markdownDescription: SI(
              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: SI(
              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: [
              SI(426, "Show the drop selector widget after a file is dropped into the editor."),
              SI(
                427,
                "Never show the drop selector widget. Instead the default drop provider is always used.",
              ),
            ],
            default: "afterDrop",
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          enabled: lK(t.enabled, this.defaultValue.enabled),
          showDropSelector: fK(t.showDropSelector, this.defaultValue.showDropSelector, [
            "afterDrop",
            "never",
          ]),
        };
      }
    })(),
  ),
  editContext: FK(
    new cK(44, "editContext", !0, {
      description: SI(
        492,
        "Sets whether the EditContext API should be used instead of the text area to power input in the editor.",
      ),
      included: QR || tO || FR,
    }),
  ),
  renderRichScreenReaderContent: FK(
    new cK(107, "renderRichScreenReaderContent", !1, {
      markdownDescription: SI(
        493,
        "Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.",
      ),
    }),
  ),
  stickyScroll: FK(
    new (class extends iK {
      constructor() {
        const e = {
          enabled: !0,
          maxLineCount: 5,
          defaultModel: "outlineModel",
          scrollWithEditor: !0,
        };
        super(131, "stickyScroll", e, {
          "editor.stickyScroll.enabled": {
            type: "boolean",
            default: e.enabled,
            description: SI(
              262,
              "Shows the nested current scopes during the scroll at the top of the editor.",
            ),
          },
          "editor.stickyScroll.maxLineCount": {
            type: "number",
            default: e.maxLineCount,
            minimum: 1,
            maximum: 20,
            description: SI(263, "Defines the maximum number of sticky lines to show."),
          },
          "editor.stickyScroll.defaultModel": {
            type: "string",
            enum: ["outlineModel", "foldingProviderModel", "indentationModel"],
            default: e.defaultModel,
            description: SI(
              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: e.scrollWithEditor,
            description: SI(
              265,
              "Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.",
            ),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          enabled: lK(t.enabled, this.defaultValue.enabled),
          maxLineCount: uK.clampedInt(t.maxLineCount, this.defaultValue.maxLineCount, 1, 20),
          defaultModel: fK(t.defaultModel, this.defaultValue.defaultModel, [
            "outlineModel",
            "foldingProviderModel",
            "indentationModel",
          ]),
          scrollWithEditor: lK(t.scrollWithEditor, this.defaultValue.scrollWithEditor),
        };
      }
    })(),
  ),
  experimentalGpuAcceleration: FK(
    new mK(46, "experimentalGpuAcceleration", "off", ["off", "on"], {
      tags: ["experimental"],
      enumDescriptions: [
        SI(494, "Use regular DOM-based rendering."),
        SI(495, "Use GPU acceleration."),
      ],
      description: SI(
        496,
        "Controls whether to use the experimental GPU acceleration to render the editor.",
      ),
    }),
  ),
  experimentalWhitespaceRendering: FK(
    new mK(47, "experimentalWhitespaceRendering", "svg", ["svg", "font", "off"], {
      enumDescriptions: [
        SI(497, "Use a new rendering method with svgs."),
        SI(498, "Use a new rendering method with font characters."),
        SI(499, "Use the stable rendering method."),
      ],
      description: SI(
        500,
        "Controls whether whitespace is rendered with a new, experimental method.",
      ),
    }),
  ),
  extraEditorClassName: FK(new pK(48, "extraEditorClassName", "")),
  fastScrollSensitivity: FK(
    new gK(49, "fastScrollSensitivity", 5, (e) => (e <= 0 ? 5 : e), {
      markdownDescription: SI(501, "Scrolling speed multiplier when pressing `Alt`."),
    }),
  ),
  find: FK(
    new (class extends iK {
      constructor() {
        const e = {
          cursorMoveOnType: !0,
          findOnType: !0,
          seedSearchStringFromSelection: "always",
          autoFindInSelection: "never",
          globalFindClipboard: !1,
          addExtraSpaceOnTop: !0,
          loop: !0,
          history: "workspace",
          replaceHistory: "workspace",
        };
        super(50, "find", e, {
          "editor.find.cursorMoveOnType": {
            type: "boolean",
            default: e.cursorMoveOnType,
            description: SI(
              208,
              "Controls whether the cursor should jump to find matches while typing.",
            ),
          },
          "editor.find.seedSearchStringFromSelection": {
            type: "string",
            enum: ["never", "always", "selection"],
            default: e.seedSearchStringFromSelection,
            enumDescriptions: [
              SI(209, "Never seed search string from the editor selection."),
              SI(
                210,
                "Always seed search string from the editor selection, including word at cursor position.",
              ),
              SI(211, "Only seed search string from the editor selection."),
            ],
            description: SI(
              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: e.autoFindInSelection,
            enumDescriptions: [
              SI(213, "Never turn on Find in Selection automatically (default)."),
              SI(214, "Always turn on Find in Selection automatically."),
              SI(
                215,
                "Turn on Find in Selection automatically when multiple lines of content are selected.",
              ),
            ],
            description: SI(
              216,
              "Controls the condition for turning on Find in Selection automatically.",
            ),
          },
          "editor.find.globalFindClipboard": {
            type: "boolean",
            default: e.globalFindClipboard,
            description: SI(
              217,
              "Controls whether the Find Widget should read or modify the shared find clipboard on macOS.",
            ),
            included: PR,
          },
          "editor.find.addExtraSpaceOnTop": {
            type: "boolean",
            default: e.addExtraSpaceOnTop,
            description: SI(
              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: e.loop,
            description: SI(
              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: [
              SI(220, "Do not store search history from the find widget."),
              SI(221, "Store search history across the active workspace"),
            ],
            description: SI(222, "Controls how the find widget history should be stored"),
          },
          "editor.find.replaceHistory": {
            type: "string",
            enum: ["never", "workspace"],
            default: "workspace",
            enumDescriptions: [
              SI(223, "Do not store history from the replace widget."),
              SI(224, "Store replace history across the active workspace"),
            ],
            description: SI(225, "Controls how the replace widget history should be stored"),
          },
          "editor.find.findOnType": {
            type: "boolean",
            default: e.findOnType,
            description: SI(226, "Controls whether the Find Widget should search as you type."),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          cursorMoveOnType: lK(t.cursorMoveOnType, this.defaultValue.cursorMoveOnType),
          findOnType: lK(t.findOnType, this.defaultValue.findOnType),
          seedSearchStringFromSelection:
            "boolean" == typeof t.seedSearchStringFromSelection
              ? t.seedSearchStringFromSelection
                ? "always"
                : "never"
              : fK(
                  t.seedSearchStringFromSelection,
                  this.defaultValue.seedSearchStringFromSelection,
                  ["never", "always", "selection"],
                ),
          autoFindInSelection:
            "boolean" == typeof t.autoFindInSelection
              ? t.autoFindInSelection
                ? "always"
                : "never"
              : fK(t.autoFindInSelection, this.defaultValue.autoFindInSelection, [
                  "never",
                  "always",
                  "multiline",
                ]),
          globalFindClipboard: lK(t.globalFindClipboard, this.defaultValue.globalFindClipboard),
          addExtraSpaceOnTop: lK(t.addExtraSpaceOnTop, this.defaultValue.addExtraSpaceOnTop),
          loop: lK(t.loop, this.defaultValue.loop),
          history: fK(t.history, this.defaultValue.history, ["never", "workspace"]),
          replaceHistory: fK(t.replaceHistory, this.defaultValue.replaceHistory, [
            "never",
            "workspace",
          ]),
        };
      }
    })(),
  ),
  fixedOverflowWidgets: FK(new cK(51, "fixedOverflowWidgets", !1)),
  folding: FK(
    new cK(52, "folding", !0, {
      description: SI(502, "Controls whether the editor has code folding enabled."),
    }),
  ),
  foldingStrategy: FK(
    new mK(53, "foldingStrategy", "auto", ["auto", "indentation"], {
      enumDescriptions: [
        SI(
          503,
          "Use a language-specific folding strategy if available, else the indentation-based one.",
        ),
        SI(504, "Use the indentation-based folding strategy."),
      ],
      description: SI(505, "Controls the strategy for computing folding ranges."),
    }),
  ),
  foldingHighlight: FK(
    new cK(54, "foldingHighlight", !0, {
      description: SI(506, "Controls whether the editor should highlight folded ranges."),
    }),
  ),
  foldingImportsByDefault: FK(
    new cK(55, "foldingImportsByDefault", !1, {
      description: SI(507, "Controls whether the editor automatically collapses import ranges."),
    }),
  ),
  foldingMaximumRegions: FK(
    new uK(56, "foldingMaximumRegions", 5e3, 10, 65e3, {
      description: SI(
        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: FK(
    new cK(57, "unfoldOnClickAfterEndOfLine", !1, {
      description: SI(
        509,
        "Controls whether clicking on the empty content after a folded line will unfold the line.",
      ),
    }),
  ),
  fontFamily: FK(
    new pK(58, "fontFamily", Jq.fontFamily, { description: SI(510, "Controls the font family.") }),
  ),
  fontInfo: FK(
    new (class extends sK {
      constructor() {
        super(
          59,
          new Yq(
            {
              pixelRatio: 0,
              fontFamily: "",
              fontWeight: "",
              fontSize: 0,
              fontFeatureSettings: "",
              fontVariationSettings: "",
              lineHeight: 0,
              letterSpacing: 0,
              isMonospace: !1,
              typicalHalfwidthCharacterWidth: 0,
              typicalFullwidthCharacterWidth: 0,
              canUseHalfwidthRightwardsArrow: !1,
              spaceWidth: 0,
              middotWidth: 0,
              wsmiddotWidth: 0,
              maxDigitWidth: 0,
            },
            !1,
          ),
        );
      }
      compute(e, t, n) {
        return e.fontInfo;
      }
    })(),
  ),
  fontLigatures2: FK(new xK()),
  fontSize: FK(
    new (class extends aK {
      constructor() {
        super(61, "fontSize", Jq.fontSize, {
          type: "number",
          minimum: 6,
          maximum: 100,
          default: Jq.fontSize,
          description: SI(233, "Controls the font size in pixels."),
        });
      }
      validate(e) {
        const t = gK.float(e, this.defaultValue);
        return 0 === t ? Jq.fontSize : gK.clamp(t, 6, 100);
      }
      compute(e, t, n) {
        return e.fontInfo.fontSize;
      }
    })(),
  ),
  fontWeight: FK(new CK()),
  fontVariations: FK(new wK()),
  formatOnPaste: FK(
    new cK(64, "formatOnPaste", !1, {
      description: SI(
        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: FK(
    new cK(65, "formatOnType", !1, {
      description: SI(
        512,
        "Controls whether the editor should automatically format the line after typing.",
      ),
    }),
  ),
  glyphMargin: FK(
    new cK(66, "glyphMargin", !0, {
      description: SI(
        513,
        "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.",
      ),
    }),
  ),
  gotoLocation: FK(
    new (class extends iK {
      constructor() {
        const e = {
            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: "",
          },
          t = {
            type: "string",
            enum: ["peek", "gotoAndPeek", "goto"],
            default: e.multiple,
            enumDescriptions: [
              SI(236, "Show Peek view of the results (default)"),
              SI(237, "Go to the primary result and show a Peek view"),
              SI(238, "Go to the primary result and enable Peek-less navigation to others"),
            ],
          },
          n = [
            "",
            "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", e, {
          "editor.gotoLocation.multiple": {
            deprecationMessage: SI(
              239,
              "This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.",
            ),
          },
          "editor.gotoLocation.multipleDefinitions": {
            description: SI(
              240,
              "Controls the behavior the 'Go to Definition'-command when multiple target locations exist.",
            ),
            ...t,
          },
          "editor.gotoLocation.multipleTypeDefinitions": {
            description: SI(
              241,
              "Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.",
            ),
            ...t,
          },
          "editor.gotoLocation.multipleDeclarations": {
            description: SI(
              242,
              "Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.",
            ),
            ...t,
          },
          "editor.gotoLocation.multipleImplementations": {
            description: SI(
              243,
              "Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.",
            ),
            ...t,
          },
          "editor.gotoLocation.multipleReferences": {
            description: SI(
              244,
              "Controls the behavior the 'Go to References'-command when multiple target locations exist.",
            ),
            ...t,
          },
          "editor.gotoLocation.alternativeDefinitionCommand": {
            type: "string",
            default: e.alternativeDefinitionCommand,
            enum: n,
            description: SI(
              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: e.alternativeTypeDefinitionCommand,
            enum: n,
            description: SI(
              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: e.alternativeDeclarationCommand,
            enum: n,
            description: SI(
              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: e.alternativeImplementationCommand,
            enum: n,
            description: SI(
              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: e.alternativeReferenceCommand,
            enum: n,
            description: SI(
              249,
              "Alternative command id that is being executed when the result of 'Go to Reference' is the current location.",
            ),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          multiple: fK(t.multiple, this.defaultValue.multiple, ["peek", "gotoAndPeek", "goto"]),
          multipleDefinitions: fK(t.multipleDefinitions, "peek", ["peek", "gotoAndPeek", "goto"]),
          multipleTypeDefinitions: fK(t.multipleTypeDefinitions, "peek", [
            "peek",
            "gotoAndPeek",
            "goto",
          ]),
          multipleDeclarations: fK(t.multipleDeclarations, "peek", ["peek", "gotoAndPeek", "goto"]),
          multipleImplementations: fK(t.multipleImplementations, "peek", [
            "peek",
            "gotoAndPeek",
            "goto",
          ]),
          multipleReferences: fK(t.multipleReferences, "peek", ["peek", "gotoAndPeek", "goto"]),
          multipleTests: fK(t.multipleTests, "peek", ["peek", "gotoAndPeek", "goto"]),
          alternativeDefinitionCommand: pK.string(
            t.alternativeDefinitionCommand,
            this.defaultValue.alternativeDefinitionCommand,
          ),
          alternativeTypeDefinitionCommand: pK.string(
            t.alternativeTypeDefinitionCommand,
            this.defaultValue.alternativeTypeDefinitionCommand,
          ),
          alternativeDeclarationCommand: pK.string(
            t.alternativeDeclarationCommand,
            this.defaultValue.alternativeDeclarationCommand,
          ),
          alternativeImplementationCommand: pK.string(
            t.alternativeImplementationCommand,
            this.defaultValue.alternativeImplementationCommand,
          ),
          alternativeReferenceCommand: pK.string(
            t.alternativeReferenceCommand,
            this.defaultValue.alternativeReferenceCommand,
          ),
          alternativeTestsCommand: pK.string(
            t.alternativeTestsCommand,
            this.defaultValue.alternativeTestsCommand,
          ),
        };
      }
    })(),
  ),
  hideCursorInOverviewRuler: FK(
    new cK(68, "hideCursorInOverviewRuler", !1, {
      description: SI(514, "Controls whether the cursor should be hidden in the overview ruler."),
    }),
  ),
  hover: FK(
    new (class extends iK {
      constructor() {
        const e = { enabled: !0, delay: 300, hidingDelay: 300, sticky: !0, above: !0 };
        super(69, "hover", e, {
          "editor.hover.enabled": {
            type: "boolean",
            default: e.enabled,
            description: SI(250, "Controls whether the hover is shown."),
          },
          "editor.hover.delay": {
            type: "number",
            default: e.delay,
            minimum: 0,
            maximum: 1e4,
            description: SI(
              251,
              "Controls the delay in milliseconds after which the hover is shown.",
            ),
          },
          "editor.hover.sticky": {
            type: "boolean",
            default: e.sticky,
            description: SI(
              252,
              "Controls whether the hover should remain visible when mouse is moved over it.",
            ),
          },
          "editor.hover.hidingDelay": {
            type: "integer",
            minimum: 0,
            default: e.hidingDelay,
            markdownDescription: SI(
              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: e.above,
            description: SI(254, "Prefer showing hovers above the line, if there's space."),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          enabled: lK(t.enabled, this.defaultValue.enabled),
          delay: uK.clampedInt(t.delay, this.defaultValue.delay, 0, 1e4),
          sticky: lK(t.sticky, this.defaultValue.sticky),
          hidingDelay: uK.clampedInt(t.hidingDelay, this.defaultValue.hidingDelay, 0, 6e5),
          above: lK(t.above, this.defaultValue.above),
        };
      }
    })(),
  ),
  inDiffEditor: FK(new cK(70, "inDiffEditor", !1)),
  inertialScroll: FK(
    new cK(158, "inertialScroll", !1, {
      description: SI(515, "Make scrolling inertial - mostly useful with touchpad on linux."),
    }),
  ),
  letterSpacing: FK(
    new gK(72, "letterSpacing", Jq.letterSpacing, (e) => gK.clamp(e, -5, 20), {
      description: SI(516, "Controls the letter spacing in pixels."),
    }),
  ),
  lightbulb: FK(
    new (class extends iK {
      constructor() {
        const e = { enabled: bK.OnCode };
        super(73, "lightbulb", e, {
          "editor.lightbulb.enabled": {
            type: "string",
            enum: [bK.Off, bK.OnCode, bK.On],
            default: e.enabled,
            enumDescriptions: [
              SI(258, "Disable the code action menu."),
              SI(259, "Show the code action menu when the cursor is on lines with code."),
              SI(
                260,
                "Show the code action menu when the cursor is on lines with code or on empty lines.",
              ),
            ],
            description: SI(261, "Enables the Code Action lightbulb in the editor."),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        return { enabled: fK(e.enabled, this.defaultValue.enabled, [bK.Off, bK.OnCode, bK.On]) };
      }
    })(),
  ),
  lineDecorationsWidth: FK(
    new (class extends iK {
      constructor() {
        super(74, "lineDecorationsWidth", 10);
      }
      validate(e) {
        if ("string" == typeof e && /^\d+(\.\d+)?ch$/.test(e)) {
          return -parseFloat(e.substring(0, e.length - 2));
        }
        return uK.clampedInt(e, this.defaultValue, 0, 1e3);
      }
      compute(e, t, n) {
        return n < 0
          ? uK.clampedInt(-n * e.fontInfo.typicalHalfwidthCharacterWidth, this.defaultValue, 0, 1e3)
          : n;
      }
    })(),
  ),
  lineHeight: FK(
    new (class extends gK {
      constructor() {
        super(
          75,
          "lineHeight",
          Jq.lineHeight,
          (e) => gK.clamp(e, 0, 150),
          {
            markdownDescription: SI(
              275,
              "Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.",
            ),
          },
          0,
          150,
        );
      }
      compute(e, t, n) {
        return e.fontInfo.lineHeight;
      }
    })(),
  ),
  lineNumbers: FK(
    new (class extends iK {
      constructor() {
        super(
          76,
          "lineNumbers",
          { renderType: 1, renderFn: null },
          {
            type: "string",
            enum: ["off", "on", "relative", "interval"],
            enumDescriptions: [
              SI(306, "Line numbers are not rendered."),
              SI(307, "Line numbers are rendered as absolute number."),
              SI(308, "Line numbers are rendered as distance in lines to cursor position."),
              SI(309, "Line numbers are rendered every 10 lines."),
            ],
            default: "on",
            description: SI(310, "Controls the display of line numbers."),
          },
        );
      }
      validate(e) {
        let t = this.defaultValue.renderType,
          n = this.defaultValue.renderFn;
        return (
          void 0 !== e &&
            ("function" == typeof e
              ? ((t = 4), (n = e))
              : (t = "interval" === e ? 3 : "relative" === e ? 2 : "on" === e ? 1 : 0)),
          { renderType: t, renderFn: n }
        );
      }
    })(),
  ),
  lineNumbersMinChars: FK(new uK(77, "lineNumbersMinChars", 5, 1, 300)),
  linkedEditing: FK(
    new cK(78, "linkedEditing", !1, {
      description: SI(
        517,
        "Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.",
      ),
    }),
  ),
  links: FK(
    new cK(79, "links", !0, {
      description: SI(
        518,
        "Controls whether the editor should detect links and make them clickable.",
      ),
    }),
  ),
  matchBrackets: FK(
    new mK(80, "matchBrackets", "always", ["always", "near", "never"], {
      description: SI(519, "Highlight matching brackets."),
    }),
  ),
  minimap: FK(
    new (class extends iK {
      constructor() {
        const e = {
          enabled: !0,
          size: "proportional",
          side: "right",
          showSlider: "mouseover",
          autohide: "none",
          renderCharacters: !0,
          maxColumn: 120,
          scale: 1,
          showRegionSectionHeaders: !0,
          showMarkSectionHeaders: !0,
          markSectionHeaderRegex: "\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",
          sectionHeaderFontSize: 9,
          sectionHeaderLetterSpacing: 1,
        };
        super(81, "minimap", e, {
          "editor.minimap.enabled": {
            type: "boolean",
            default: e.enabled,
            description: SI(276, "Controls whether the minimap is shown."),
          },
          "editor.minimap.autohide": {
            type: "string",
            enum: ["none", "mouseover", "scroll"],
            enumDescriptions: [
              SI(277, "The minimap is always shown."),
              SI(
                278,
                "The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap.",
              ),
              SI(279, "The minimap is only shown when the editor is scrolled"),
            ],
            default: e.autohide,
            description: SI(280, "Controls whether the minimap is hidden automatically."),
          },
          "editor.minimap.size": {
            type: "string",
            enum: ["proportional", "fill", "fit"],
            enumDescriptions: [
              SI(281, "The minimap has the same size as the editor contents (and might scroll)."),
              SI(
                282,
                "The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling).",
              ),
              SI(
                283,
                "The minimap will shrink as necessary to never be larger than the editor (no scrolling).",
              ),
            ],
            default: e.size,
            description: SI(284, "Controls the size of the minimap."),
          },
          "editor.minimap.side": {
            type: "string",
            enum: ["left", "right"],
            default: e.side,
            description: SI(285, "Controls the side where to render the minimap."),
          },
          "editor.minimap.showSlider": {
            type: "string",
            enum: ["always", "mouseover"],
            default: e.showSlider,
            description: SI(286, "Controls when the minimap slider is shown."),
          },
          "editor.minimap.scale": {
            type: "number",
            default: e.scale,
            minimum: 1,
            maximum: 3,
            enum: [1, 2, 3],
            description: SI(287, "Scale of content drawn in the minimap: 1, 2 or 3."),
          },
          "editor.minimap.renderCharacters": {
            type: "boolean",
            default: e.renderCharacters,
            description: SI(
              288,
              "Render the actual characters on a line as opposed to color blocks.",
            ),
          },
          "editor.minimap.maxColumn": {
            type: "number",
            default: e.maxColumn,
            description: SI(
              289,
              "Limit the width of the minimap to render at most a certain number of columns.",
            ),
          },
          "editor.minimap.showRegionSectionHeaders": {
            type: "boolean",
            default: e.showRegionSectionHeaders,
            description: SI(
              290,
              "Controls whether named regions are shown as section headers in the minimap.",
            ),
          },
          "editor.minimap.showMarkSectionHeaders": {
            type: "boolean",
            default: e.showMarkSectionHeaders,
            description: SI(
              291,
              "Controls whether MARK: comments are shown as section headers in the minimap.",
            ),
          },
          "editor.minimap.markSectionHeaderRegex": {
            type: "string",
            default: e.markSectionHeaderRegex,
            description: SI(
              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: e.sectionHeaderFontSize,
            description: SI(293, "Controls the font size of section headers in the minimap."),
          },
          "editor.minimap.sectionHeaderLetterSpacing": {
            type: "number",
            default: e.sectionHeaderLetterSpacing,
            description: SI(
              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(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        let n = this.defaultValue.markSectionHeaderRegex;
        const i = t.markSectionHeaderRegex;
        if ("string" == typeof i)
          try {
            (new RegExp(i, "d"), (n = i));
          } catch {}
        return {
          enabled: lK(t.enabled, this.defaultValue.enabled),
          autohide: fK(t.autohide, this.defaultValue.autohide, ["none", "mouseover", "scroll"]),
          size: fK(t.size, this.defaultValue.size, ["proportional", "fill", "fit"]),
          side: fK(t.side, this.defaultValue.side, ["right", "left"]),
          showSlider: fK(t.showSlider, this.defaultValue.showSlider, ["always", "mouseover"]),
          renderCharacters: lK(t.renderCharacters, this.defaultValue.renderCharacters),
          scale: uK.clampedInt(t.scale, 1, 1, 3),
          maxColumn: uK.clampedInt(t.maxColumn, this.defaultValue.maxColumn, 1, 1e4),
          showRegionSectionHeaders: lK(
            t.showRegionSectionHeaders,
            this.defaultValue.showRegionSectionHeaders,
          ),
          showMarkSectionHeaders: lK(
            t.showMarkSectionHeaders,
            this.defaultValue.showMarkSectionHeaders,
          ),
          markSectionHeaderRegex: n,
          sectionHeaderFontSize: gK.clamp(
            gK.float(t.sectionHeaderFontSize, this.defaultValue.sectionHeaderFontSize),
            4,
            32,
          ),
          sectionHeaderLetterSpacing: gK.clamp(
            gK.float(t.sectionHeaderLetterSpacing, this.defaultValue.sectionHeaderLetterSpacing),
            0,
            5,
          ),
        };
      }
    })(),
  ),
  mouseStyle: FK(new mK(82, "mouseStyle", "text", ["text", "default", "copy"])),
  mouseWheelScrollSensitivity: FK(
    new gK(83, "mouseWheelScrollSensitivity", 1, (e) => (0 === e ? 1 : e), {
      markdownDescription: SI(
        520,
        "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.",
      ),
    }),
  ),
  mouseWheelZoom: FK(
    new cK(84, "mouseWheelZoom", !1, {
      markdownDescription: PR
        ? SI(521, "Zoom the font of the editor when using mouse wheel and holding `Cmd`.")
        : SI(522, "Zoom the font of the editor when using mouse wheel and holding `Ctrl`."),
    }),
  ),
  multiCursorMergeOverlapping: FK(
    new cK(85, "multiCursorMergeOverlapping", !0, {
      description: SI(523, "Merge multiple cursors when they are overlapping."),
    }),
  ),
  multiCursorModifier: FK(
    new _K(
      86,
      "multiCursorModifier",
      "altKey",
      "alt",
      ["ctrlCmd", "alt"],
      function (e) {
        return "ctrlCmd" === e ? (PR ? "metaKey" : "ctrlKey") : "altKey";
      },
      {
        markdownEnumDescriptions: [
          SI(524, "Maps to `Control` on Windows and Linux and to `Command` on macOS."),
          SI(525, "Maps to `Alt` on Windows and Linux and to `Option` on macOS."),
        ],
        markdownDescription: SI(
          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: FK(
    new mK(87, "mouseMiddleClickAction", "default", ["default", "openLink", "ctrlLeftClick"], {
      description: SI(
        527,
        "Controls what happens when middle mouse button is clicked in the editor.",
      ),
    }),
  ),
  multiCursorPaste: FK(
    new mK(88, "multiCursorPaste", "spread", ["spread", "full"], {
      markdownEnumDescriptions: [
        SI(528, "Each cursor pastes a single line of the text."),
        SI(529, "Each cursor pastes the full text."),
      ],
      markdownDescription: SI(
        530,
        "Controls pasting when the line count of the pasted text matches the cursor count.",
      ),
    }),
  ),
  multiCursorLimit: FK(
    new uK(89, "multiCursorLimit", 1e4, 1, 1e5, {
      markdownDescription: SI(
        531,
        "Controls the max number of cursors that can be in an active editor at once.",
      ),
    }),
  ),
  occurrencesHighlight: FK(
    new mK(90, "occurrencesHighlight", "singleFile", ["off", "singleFile", "multiFile"], {
      markdownEnumDescriptions: [
        SI(532, "Does not highlight occurrences."),
        SI(533, "Highlights occurrences only in the current file."),
        SI(534, "Experimental: Highlights occurrences across all valid open files."),
      ],
      markdownDescription: SI(
        535,
        "Controls whether occurrences should be highlighted across open files.",
      ),
    }),
  ),
  occurrencesHighlightDelay: FK(
    new uK(91, "occurrencesHighlightDelay", 0, 0, 2e3, {
      description: SI(
        536,
        "Controls the delay in milliseconds after which occurrences are highlighted.",
      ),
      tags: ["preview"],
    }),
  ),
  overtypeOnPaste: FK(
    new cK(93, "overtypeOnPaste", !0, {
      description: SI(537, "Controls whether pasting should overtype."),
    }),
  ),
  overviewRulerBorder: FK(
    new cK(94, "overviewRulerBorder", !0, {
      description: SI(538, "Controls whether a border should be drawn around the overview ruler."),
    }),
  ),
  overviewRulerLanes: FK(new uK(95, "overviewRulerLanes", 3, 0, 3)),
  padding: FK(
    new (class extends iK {
      constructor() {
        super(
          96,
          "padding",
          { top: 0, bottom: 0 },
          {
            "editor.padding.top": {
              type: "number",
              default: 0,
              minimum: 0,
              maximum: 1e3,
              description: SI(
                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: SI(
                296,
                "Controls the amount of space between the bottom edge of the editor and the last line.",
              ),
            },
          },
        );
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return { top: uK.clampedInt(t.top, 0, 0, 1e3), bottom: uK.clampedInt(t.bottom, 0, 0, 1e3) };
      }
    })(),
  ),
  pasteAs: FK(
    new (class extends iK {
      constructor() {
        const e = { enabled: !0, showPasteSelector: "afterPaste" };
        super(97, "pasteAs", e, {
          "editor.pasteAs.enabled": {
            type: "boolean",
            default: e.enabled,
            markdownDescription: SI(
              428,
              "Controls whether you can paste content in different ways.",
            ),
          },
          "editor.pasteAs.showPasteSelector": {
            type: "string",
            markdownDescription: SI(
              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: [
              SI(430, "Show the paste selector widget after content is pasted into the editor."),
              SI(
                431,
                "Never show the paste selector widget. Instead the default pasting behavior is always used.",
              ),
            ],
            default: "afterPaste",
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          enabled: lK(t.enabled, this.defaultValue.enabled),
          showPasteSelector: fK(t.showPasteSelector, this.defaultValue.showPasteSelector, [
            "afterPaste",
            "never",
          ]),
        };
      }
    })(),
  ),
  parameterHints: FK(
    new (class extends iK {
      constructor() {
        const e = { enabled: !0, cycle: !0 };
        super(98, "parameterHints", e, {
          "editor.parameterHints.enabled": {
            type: "boolean",
            default: e.enabled,
            description: SI(
              297,
              "Enables a pop-up that shows parameter documentation and type information as you type.",
            ),
          },
          "editor.parameterHints.cycle": {
            type: "boolean",
            default: e.cycle,
            description: SI(
              298,
              "Controls whether the parameter hints menu cycles or closes when reaching the end of the list.",
            ),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          enabled: lK(t.enabled, this.defaultValue.enabled),
          cycle: lK(t.cycle, this.defaultValue.cycle),
        };
      }
    })(),
  ),
  peekWidgetDefaultFocus: FK(
    new mK(99, "peekWidgetDefaultFocus", "tree", ["tree", "editor"], {
      enumDescriptions: [
        SI(539, "Focus the tree when opening peek"),
        SI(540, "Focus the editor when opening peek"),
      ],
      description: SI(
        541,
        "Controls whether to focus the inline editor or the tree in the peek widget.",
      ),
    }),
  ),
  placeholder: FK(
    new (class extends iK {
      constructor() {
        super(100, "placeholder", void 0);
      }
      validate(e) {
        return void 0 === e ? this.defaultValue : "string" == typeof e ? e : this.defaultValue;
      }
    })(),
  ),
  definitionLinkOpensInPeek: FK(
    new cK(101, "definitionLinkOpensInPeek", !1, {
      description: SI(
        542,
        "Controls whether the Go to Definition mouse gesture always opens the peek widget.",
      ),
    }),
  ),
  quickSuggestions: FK(
    new (class extends iK {
      constructor() {
        const e = { other: "on", comments: "off", strings: "off" },
          t = [
            { type: "boolean" },
            {
              type: "string",
              enum: ["on", "inline", "off"],
              enumDescriptions: [
                SI(299, "Quick suggestions show inside the suggest widget"),
                SI(300, "Quick suggestions show as ghost text"),
                SI(301, "Quick suggestions are disabled"),
              ],
            },
          ];
        (super(102, "quickSuggestions", e, {
          type: "object",
          additionalProperties: !1,
          properties: {
            strings: {
              anyOf: t,
              default: e.strings,
              description: SI(302, "Enable quick suggestions inside strings."),
            },
            comments: {
              anyOf: t,
              default: e.comments,
              description: SI(303, "Enable quick suggestions inside comments."),
            },
            other: {
              anyOf: t,
              default: e.other,
              description: SI(304, "Enable quick suggestions outside of strings and comments."),
            },
          },
          default: e,
          markdownDescription: SI(
            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 = e));
      }
      validate(e) {
        if ("boolean" == typeof e) {
          const t = e ? "on" : "off";
          return { comments: t, strings: t, other: t };
        }
        if (!e || "object" != typeof e) return this.defaultValue;
        const { other: t, comments: n, strings: i } = e,
          r = ["on", "inline", "off"];
        let o, s, a;
        return (
          (o = "boolean" == typeof t ? (t ? "on" : "off") : fK(t, this.defaultValue.other, r)),
          (s = "boolean" == typeof n ? (n ? "on" : "off") : fK(n, this.defaultValue.comments, r)),
          (a = "boolean" == typeof i ? (i ? "on" : "off") : fK(i, this.defaultValue.strings, r)),
          { other: o, comments: s, strings: a }
        );
      }
    })(),
  ),
  quickSuggestionsDelay: FK(
    new uK(103, "quickSuggestionsDelay", 10, 0, 1073741824, {
      description: SI(
        543,
        "Controls the delay in milliseconds after which quick suggestions will show up.",
      ),
      experiment: { mode: "auto" },
    }),
  ),
  readOnly: FK(new cK(104, "readOnly", !1)),
  readOnlyMessage: FK(
    new (class extends iK {
      constructor() {
        super(105, "readOnlyMessage", void 0);
      }
      validate(e) {
        return e && "object" == typeof e ? e : this.defaultValue;
      }
    })(),
  ),
  renameOnType: FK(
    new cK(106, "renameOnType", !1, {
      description: SI(544, "Controls whether the editor auto renames on type."),
      markdownDeprecationMessage: SI(545, "Deprecated, use `#editor.linkedEditing#` instead."),
    }),
  ),
  renderControlCharacters: FK(
    new cK(108, "renderControlCharacters", !0, {
      description: SI(546, "Controls whether the editor should render control characters."),
      restricted: !0,
    }),
  ),
  renderFinalNewline: FK(
    new mK(109, "renderFinalNewline", jR ? "dimmed" : "on", ["off", "on", "dimmed"], {
      description: SI(547, "Render last line number when the file ends with a newline."),
    }),
  ),
  renderLineHighlight: FK(
    new mK(110, "renderLineHighlight", "line", ["none", "gutter", "line", "all"], {
      enumDescriptions: ["", "", "", SI(548, "Highlights both the gutter and the current line.")],
      description: SI(549, "Controls how the editor should render the current line highlight."),
    }),
  ),
  renderLineHighlightOnlyWhenFocus: FK(
    new cK(111, "renderLineHighlightOnlyWhenFocus", !1, {
      description: SI(
        550,
        "Controls if the editor should render the current line highlight only when the editor is focused.",
      ),
    }),
  ),
  renderValidationDecorations: FK(
    new mK(112, "renderValidationDecorations", "editable", ["editable", "on", "off"]),
  ),
  renderWhitespace: FK(
    new mK(
      113,
      "renderWhitespace",
      "selection",
      ["none", "boundary", "selection", "trailing", "all"],
      {
        enumDescriptions: [
          "",
          SI(551, "Render whitespace characters except for single spaces between words."),
          SI(552, "Render whitespace characters only on selected text."),
          SI(553, "Render only trailing whitespace characters."),
          "",
        ],
        description: SI(554, "Controls how the editor should render whitespace characters."),
      },
    ),
  ),
  revealHorizontalRightPadding: FK(new uK(114, "revealHorizontalRightPadding", 15, 0, 1e3)),
  roundedSelection: FK(
    new cK(115, "roundedSelection", !0, {
      description: SI(555, "Controls whether selections should have rounded corners."),
    }),
  ),
  rulers: FK(
    new (class extends iK {
      constructor() {
        const e = [],
          t = {
            type: "number",
            description: SI(
              311,
              "Number of monospace characters at which this editor ruler will render.",
            ),
          };
        super(116, "rulers", e, {
          type: "array",
          items: {
            anyOf: [
              t,
              {
                type: ["object"],
                properties: {
                  column: t,
                  color: {
                    type: "string",
                    description: SI(312, "Color of this editor ruler."),
                    format: "color-hex",
                  },
                },
              },
            ],
          },
          default: e,
          description: SI(
            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(e) {
        if (Array.isArray(e)) {
          const t = [];
          for (const n of e)
            if ("number" == typeof n) t.push({ column: uK.clampedInt(n, 0, 0, 1e4), color: null });
            else if (n && "object" == typeof n) {
              const e = n;
              t.push({ column: uK.clampedInt(e.column, 0, 0, 1e4), color: e.color });
            }
          return (t.sort((e, t) => e.column - t.column), t);
        }
        return this.defaultValue;
      }
    })(),
  ),
  scrollbar: FK(
    new (class extends iK {
      constructor() {
        const e = {
          vertical: 1,
          horizontal: 1,
          arrowSize: 11,
          useShadows: !0,
          verticalHasArrows: !1,
          horizontalHasArrows: !1,
          horizontalScrollbarSize: 12,
          horizontalSliderSize: 12,
          verticalScrollbarSize: 14,
          verticalSliderSize: 14,
          handleMouseWheel: !0,
          alwaysConsumeMouseWheel: !0,
          scrollByPage: !1,
          ignoreHorizontalScrollbarInContentHeight: !1,
        };
        super(117, "scrollbar", e, {
          "editor.scrollbar.vertical": {
            type: "string",
            enum: ["auto", "visible", "hidden"],
            enumDescriptions: [
              SI(314, "The vertical scrollbar will be visible only when necessary."),
              SI(315, "The vertical scrollbar will always be visible."),
              SI(316, "The vertical scrollbar will always be hidden."),
            ],
            default: "auto",
            description: SI(317, "Controls the visibility of the vertical scrollbar."),
          },
          "editor.scrollbar.horizontal": {
            type: "string",
            enum: ["auto", "visible", "hidden"],
            enumDescriptions: [
              SI(318, "The horizontal scrollbar will be visible only when necessary."),
              SI(319, "The horizontal scrollbar will always be visible."),
              SI(320, "The horizontal scrollbar will always be hidden."),
            ],
            default: "auto",
            description: SI(321, "Controls the visibility of the horizontal scrollbar."),
          },
          "editor.scrollbar.verticalScrollbarSize": {
            type: "number",
            default: e.verticalScrollbarSize,
            description: SI(322, "The width of the vertical scrollbar."),
          },
          "editor.scrollbar.horizontalScrollbarSize": {
            type: "number",
            default: e.horizontalScrollbarSize,
            description: SI(323, "The height of the horizontal scrollbar."),
          },
          "editor.scrollbar.scrollByPage": {
            type: "boolean",
            default: e.scrollByPage,
            description: SI(
              324,
              "Controls whether clicks scroll by page or jump to click position.",
            ),
          },
          "editor.scrollbar.ignoreHorizontalScrollbarInContentHeight": {
            type: "boolean",
            default: e.ignoreHorizontalScrollbarInContentHeight,
            description: SI(
              325,
              "When set, the horizontal scrollbar will not increase the size of the editor's content.",
            ),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e,
          n = uK.clampedInt(
            t.horizontalScrollbarSize,
            this.defaultValue.horizontalScrollbarSize,
            0,
            1e3,
          ),
          i = uK.clampedInt(
            t.verticalScrollbarSize,
            this.defaultValue.verticalScrollbarSize,
            0,
            1e3,
          );
        return {
          arrowSize: uK.clampedInt(t.arrowSize, this.defaultValue.arrowSize, 0, 1e3),
          vertical: NK(t.vertical, this.defaultValue.vertical),
          horizontal: NK(t.horizontal, this.defaultValue.horizontal),
          useShadows: lK(t.useShadows, this.defaultValue.useShadows),
          verticalHasArrows: lK(t.verticalHasArrows, this.defaultValue.verticalHasArrows),
          horizontalHasArrows: lK(t.horizontalHasArrows, this.defaultValue.horizontalHasArrows),
          handleMouseWheel: lK(t.handleMouseWheel, this.defaultValue.handleMouseWheel),
          alwaysConsumeMouseWheel: lK(
            t.alwaysConsumeMouseWheel,
            this.defaultValue.alwaysConsumeMouseWheel,
          ),
          horizontalScrollbarSize: n,
          horizontalSliderSize: uK.clampedInt(t.horizontalSliderSize, n, 0, 1e3),
          verticalScrollbarSize: i,
          verticalSliderSize: uK.clampedInt(t.verticalSliderSize, i, 0, 1e3),
          scrollByPage: lK(t.scrollByPage, this.defaultValue.scrollByPage),
          ignoreHorizontalScrollbarInContentHeight: lK(
            t.ignoreHorizontalScrollbarInContentHeight,
            this.defaultValue.ignoreHorizontalScrollbarInContentHeight,
          ),
        };
      }
    })(),
  ),
  scrollBeyondLastColumn: FK(
    new uK(118, "scrollBeyondLastColumn", 4, 0, 1073741824, {
      description: SI(
        556,
        "Controls the number of extra characters beyond which the editor will scroll horizontally.",
      ),
    }),
  ),
  scrollBeyondLastLine: FK(
    new cK(119, "scrollBeyondLastLine", !0, {
      description: SI(557, "Controls whether the editor will scroll beyond the last line."),
    }),
  ),
  scrollOnMiddleClick: FK(
    new cK(171, "scrollOnMiddleClick", !1, {
      description: SI(
        558,
        "Controls whether the editor will scroll when the middle button is pressed.",
      ),
    }),
  ),
  scrollPredominantAxis: FK(
    new cK(120, "scrollPredominantAxis", !0, {
      description: SI(
        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: FK(
    new cK(121, "selectionClipboard", !0, {
      description: SI(560, "Controls whether the Linux primary clipboard should be supported."),
      included: jR,
    }),
  ),
  selectionHighlight: FK(
    new cK(122, "selectionHighlight", !0, {
      description: SI(
        561,
        "Controls whether the editor should highlight matches similar to the selection.",
      ),
    }),
  ),
  selectionHighlightMaxLength: FK(
    new uK(123, "selectionHighlightMaxLength", 200, 0, 1073741824, {
      description: SI(
        562,
        "Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.",
      ),
    }),
  ),
  selectionHighlightMultiline: FK(
    new cK(124, "selectionHighlightMultiline", !1, {
      description: SI(
        563,
        "Controls whether the editor should highlight selection matches that span multiple lines.",
      ),
    }),
  ),
  selectOnLineNumbers: FK(new cK(125, "selectOnLineNumbers", !0)),
  showFoldingControls: FK(
    new mK(126, "showFoldingControls", "mouseover", ["always", "never", "mouseover"], {
      enumDescriptions: [
        SI(564, "Always show the folding controls."),
        SI(565, "Never show the folding controls and reduce the gutter size."),
        SI(566, "Only show the folding controls when the mouse is over the gutter."),
      ],
      description: SI(567, "Controls when the folding controls on the gutter are shown."),
    }),
  ),
  showUnused: FK(
    new cK(127, "showUnused", !0, { description: SI(568, "Controls fading out of unused code.") }),
  ),
  showDeprecated: FK(
    new cK(157, "showDeprecated", !0, {
      description: SI(569, "Controls strikethrough deprecated variables."),
    }),
  ),
  inlayHints: FK(
    new (class extends iK {
      constructor() {
        const e = { enabled: "on", fontSize: 0, fontFamily: "", padding: !1, maximumLength: 43 };
        super(159, "inlayHints", e, {
          "editor.inlayHints.enabled": {
            type: "string",
            default: e.enabled,
            description: SI(266, "Enables the inlay hints in the editor."),
            enum: ["on", "onUnlessPressed", "offUnlessPressed", "off"],
            markdownEnumDescriptions: [
              SI(267, "Inlay hints are enabled"),
              SI(
                268,
                "Inlay hints are showing by default and hide when holding {0}",
                PR ? "Ctrl+Option" : "Ctrl+Alt",
              ),
              SI(
                269,
                "Inlay hints are hidden by default and show when holding {0}",
                PR ? "Ctrl+Option" : "Ctrl+Alt",
              ),
              SI(270, "Inlay hints are disabled"),
            ],
          },
          "editor.inlayHints.fontSize": {
            type: "number",
            default: e.fontSize,
            markdownDescription: SI(
              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: e.fontFamily,
            markdownDescription: SI(
              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: e.padding,
            description: SI(273, "Enables the padding around the inlay hints in the editor."),
          },
          "editor.inlayHints.maximumLength": {
            type: "number",
            default: e.maximumLength,
            markdownDescription: SI(
              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(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return (
          "boolean" == typeof t.enabled && (t.enabled = t.enabled ? "on" : "off"),
          {
            enabled: fK(t.enabled, this.defaultValue.enabled, [
              "on",
              "off",
              "offUnlessPressed",
              "onUnlessPressed",
            ]),
            fontSize: uK.clampedInt(t.fontSize, this.defaultValue.fontSize, 0, 100),
            fontFamily: pK.string(t.fontFamily, this.defaultValue.fontFamily),
            padding: lK(t.padding, this.defaultValue.padding),
            maximumLength: uK.clampedInt(
              t.maximumLength,
              this.defaultValue.maximumLength,
              0,
              Number.MAX_SAFE_INTEGER,
            ),
          }
        );
      }
    })(),
  ),
  snippetSuggestions: FK(
    new mK(128, "snippetSuggestions", "inline", ["top", "bottom", "inline", "none"], {
      enumDescriptions: [
        SI(570, "Show snippet suggestions on top of other suggestions."),
        SI(571, "Show snippet suggestions below other suggestions."),
        SI(572, "Show snippets suggestions with other suggestions."),
        SI(573, "Do not show snippet suggestions."),
      ],
      description: SI(
        574,
        "Controls whether snippets are shown with other suggestions and how they are sorted.",
      ),
    }),
  ),
  smartSelect: FK(
    new (class extends iK {
      constructor() {
        super(
          129,
          "smartSelect",
          { selectLeadingAndTrailingWhitespace: !0, selectSubwords: !0 },
          {
            "editor.smartSelect.selectLeadingAndTrailingWhitespace": {
              description: SI(
                416,
                "Whether leading and trailing whitespace should always be selected.",
              ),
              default: !0,
              type: "boolean",
            },
            "editor.smartSelect.selectSubwords": {
              description: SI(
                417,
                "Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected.",
              ),
              default: !0,
              type: "boolean",
            },
          },
        );
      }
      validate(e) {
        return e && "object" == typeof e
          ? {
              selectLeadingAndTrailingWhitespace: lK(
                e.selectLeadingAndTrailingWhitespace,
                this.defaultValue.selectLeadingAndTrailingWhitespace,
              ),
              selectSubwords: lK(e.selectSubwords, this.defaultValue.selectSubwords),
            }
          : this.defaultValue;
      }
    })(),
  ),
  smoothScrolling: FK(
    new cK(130, "smoothScrolling", !1, {
      description: SI(575, "Controls whether the editor will scroll using an animation."),
    }),
  ),
  stopRenderingLineAfter: FK(new uK(133, "stopRenderingLineAfter", 1e4, -1, 1073741824)),
  suggest: FK(
    new (class extends iK {
      constructor() {
        const e = {
          insertMode: "insert",
          filterGraceful: !0,
          snippetsPreventQuickSuggestions: !1,
          localityBonus: !1,
          shareSuggestSelections: !1,
          selectionMode: "always",
          showIcons: !0,
          showStatusBar: !1,
          preview: !1,
          previewMode: "subwordSmart",
          showInlineDetails: !0,
          showMethods: !0,
          showFunctions: !0,
          showConstructors: !0,
          showDeprecated: !0,
          matchOnWordStartOnly: !0,
          showFields: !0,
          showVariables: !0,
          showClasses: !0,
          showStructs: !0,
          showInterfaces: !0,
          showModules: !0,
          showProperties: !0,
          showEvents: !0,
          showOperators: !0,
          showUnits: !0,
          showValues: !0,
          showConstants: !0,
          showEnums: !0,
          showEnumMembers: !0,
          showKeywords: !0,
          showWords: !0,
          showColors: !0,
          showFiles: !0,
          showReferences: !0,
          showFolders: !0,
          showTypeParameters: !0,
          showSnippets: !0,
          showUsers: !0,
          showIssues: !0,
        };
        super(134, "suggest", e, {
          "editor.suggest.insertMode": {
            type: "string",
            enum: ["insert", "replace"],
            enumDescriptions: [
              SI(368, "Insert suggestion without overwriting text right of the cursor."),
              SI(369, "Insert suggestion and overwrite text right of the cursor."),
            ],
            default: e.insertMode,
            description: SI(
              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: e.filterGraceful,
            description: SI(
              371,
              "Controls whether filtering and sorting suggestions accounts for small typos.",
            ),
          },
          "editor.suggest.localityBonus": {
            type: "boolean",
            default: e.localityBonus,
            description: SI(
              372,
              "Controls whether sorting favors words that appear close to the cursor.",
            ),
          },
          "editor.suggest.shareSuggestSelections": {
            type: "boolean",
            default: e.shareSuggestSelections,
            markdownDescription: SI(
              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: [
              SI(374, "Always select a suggestion when automatically triggering IntelliSense."),
              SI(375, "Never select a suggestion when automatically triggering IntelliSense."),
              SI(
                376,
                "Select a suggestion only when triggering IntelliSense from a trigger character.",
              ),
              SI(377, "Select a suggestion only when triggering IntelliSense as you type."),
            ],
            default: e.selectionMode,
            markdownDescription: SI(
              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: e.snippetsPreventQuickSuggestions,
            description: SI(379, "Controls whether an active snippet prevents quick suggestions."),
          },
          "editor.suggest.showIcons": {
            type: "boolean",
            default: e.showIcons,
            description: SI(380, "Controls whether to show or hide icons in suggestions."),
          },
          "editor.suggest.showStatusBar": {
            type: "boolean",
            default: e.showStatusBar,
            description: SI(
              381,
              "Controls the visibility of the status bar at the bottom of the suggest widget.",
            ),
          },
          "editor.suggest.preview": {
            type: "boolean",
            default: e.preview,
            description: SI(
              382,
              "Controls whether to preview the suggestion outcome in the editor.",
            ),
          },
          "editor.suggest.showInlineDetails": {
            type: "boolean",
            default: e.showInlineDetails,
            description: SI(
              383,
              "Controls whether suggest details show inline with the label or only in the details widget.",
            ),
          },
          "editor.suggest.maxVisibleSuggestions": {
            type: "number",
            deprecationMessage: SI(
              384,
              "This setting is deprecated. The suggest widget can now be resized.",
            ),
          },
          "editor.suggest.filteredTypes": {
            type: "object",
            deprecationMessage: SI(
              385,
              "This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.",
            ),
          },
          "editor.suggest.showMethods": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(386, "When enabled IntelliSense shows `method`-suggestions."),
          },
          "editor.suggest.showFunctions": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(387, "When enabled IntelliSense shows `function`-suggestions."),
          },
          "editor.suggest.showConstructors": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(
              388,
              "When enabled IntelliSense shows `constructor`-suggestions.",
            ),
          },
          "editor.suggest.showDeprecated": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(
              389,
              "When enabled IntelliSense shows `deprecated`-suggestions.",
            ),
          },
          "editor.suggest.matchOnWordStartOnly": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(
              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: !0,
            markdownDescription: SI(391, "When enabled IntelliSense shows `field`-suggestions."),
          },
          "editor.suggest.showVariables": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(392, "When enabled IntelliSense shows `variable`-suggestions."),
          },
          "editor.suggest.showClasses": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(393, "When enabled IntelliSense shows `class`-suggestions."),
          },
          "editor.suggest.showStructs": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(394, "When enabled IntelliSense shows `struct`-suggestions."),
          },
          "editor.suggest.showInterfaces": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(
              395,
              "When enabled IntelliSense shows `interface`-suggestions.",
            ),
          },
          "editor.suggest.showModules": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(396, "When enabled IntelliSense shows `module`-suggestions."),
          },
          "editor.suggest.showProperties": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(397, "When enabled IntelliSense shows `property`-suggestions."),
          },
          "editor.suggest.showEvents": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(398, "When enabled IntelliSense shows `event`-suggestions."),
          },
          "editor.suggest.showOperators": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(399, "When enabled IntelliSense shows `operator`-suggestions."),
          },
          "editor.suggest.showUnits": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(400, "When enabled IntelliSense shows `unit`-suggestions."),
          },
          "editor.suggest.showValues": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(401, "When enabled IntelliSense shows `value`-suggestions."),
          },
          "editor.suggest.showConstants": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(402, "When enabled IntelliSense shows `constant`-suggestions."),
          },
          "editor.suggest.showEnums": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(403, "When enabled IntelliSense shows `enum`-suggestions."),
          },
          "editor.suggest.showEnumMembers": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(
              404,
              "When enabled IntelliSense shows `enumMember`-suggestions.",
            ),
          },
          "editor.suggest.showKeywords": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(405, "When enabled IntelliSense shows `keyword`-suggestions."),
          },
          "editor.suggest.showWords": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(406, "When enabled IntelliSense shows `text`-suggestions."),
          },
          "editor.suggest.showColors": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(407, "When enabled IntelliSense shows `color`-suggestions."),
          },
          "editor.suggest.showFiles": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(408, "When enabled IntelliSense shows `file`-suggestions."),
          },
          "editor.suggest.showReferences": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(
              409,
              "When enabled IntelliSense shows `reference`-suggestions.",
            ),
          },
          "editor.suggest.showCustomcolors": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(
              410,
              "When enabled IntelliSense shows `customcolor`-suggestions.",
            ),
          },
          "editor.suggest.showFolders": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(411, "When enabled IntelliSense shows `folder`-suggestions."),
          },
          "editor.suggest.showTypeParameters": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(
              412,
              "When enabled IntelliSense shows `typeParameter`-suggestions.",
            ),
          },
          "editor.suggest.showSnippets": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(413, "When enabled IntelliSense shows `snippet`-suggestions."),
          },
          "editor.suggest.showUsers": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(414, "When enabled IntelliSense shows `user`-suggestions."),
          },
          "editor.suggest.showIssues": {
            type: "boolean",
            default: !0,
            markdownDescription: SI(415, "When enabled IntelliSense shows `issues`-suggestions."),
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          insertMode: fK(t.insertMode, this.defaultValue.insertMode, ["insert", "replace"]),
          filterGraceful: lK(t.filterGraceful, this.defaultValue.filterGraceful),
          snippetsPreventQuickSuggestions: lK(
            t.snippetsPreventQuickSuggestions,
            this.defaultValue.filterGraceful,
          ),
          localityBonus: lK(t.localityBonus, this.defaultValue.localityBonus),
          shareSuggestSelections: lK(
            t.shareSuggestSelections,
            this.defaultValue.shareSuggestSelections,
          ),
          selectionMode: fK(t.selectionMode, this.defaultValue.selectionMode, [
            "always",
            "never",
            "whenQuickSuggestion",
            "whenTriggerCharacter",
          ]),
          showIcons: lK(t.showIcons, this.defaultValue.showIcons),
          showStatusBar: lK(t.showStatusBar, this.defaultValue.showStatusBar),
          preview: lK(t.preview, this.defaultValue.preview),
          previewMode: fK(t.previewMode, this.defaultValue.previewMode, [
            "prefix",
            "subword",
            "subwordSmart",
          ]),
          showInlineDetails: lK(t.showInlineDetails, this.defaultValue.showInlineDetails),
          showMethods: lK(t.showMethods, this.defaultValue.showMethods),
          showFunctions: lK(t.showFunctions, this.defaultValue.showFunctions),
          showConstructors: lK(t.showConstructors, this.defaultValue.showConstructors),
          showDeprecated: lK(t.showDeprecated, this.defaultValue.showDeprecated),
          matchOnWordStartOnly: lK(t.matchOnWordStartOnly, this.defaultValue.matchOnWordStartOnly),
          showFields: lK(t.showFields, this.defaultValue.showFields),
          showVariables: lK(t.showVariables, this.defaultValue.showVariables),
          showClasses: lK(t.showClasses, this.defaultValue.showClasses),
          showStructs: lK(t.showStructs, this.defaultValue.showStructs),
          showInterfaces: lK(t.showInterfaces, this.defaultValue.showInterfaces),
          showModules: lK(t.showModules, this.defaultValue.showModules),
          showProperties: lK(t.showProperties, this.defaultValue.showProperties),
          showEvents: lK(t.showEvents, this.defaultValue.showEvents),
          showOperators: lK(t.showOperators, this.defaultValue.showOperators),
          showUnits: lK(t.showUnits, this.defaultValue.showUnits),
          showValues: lK(t.showValues, this.defaultValue.showValues),
          showConstants: lK(t.showConstants, this.defaultValue.showConstants),
          showEnums: lK(t.showEnums, this.defaultValue.showEnums),
          showEnumMembers: lK(t.showEnumMembers, this.defaultValue.showEnumMembers),
          showKeywords: lK(t.showKeywords, this.defaultValue.showKeywords),
          showWords: lK(t.showWords, this.defaultValue.showWords),
          showColors: lK(t.showColors, this.defaultValue.showColors),
          showFiles: lK(t.showFiles, this.defaultValue.showFiles),
          showReferences: lK(t.showReferences, this.defaultValue.showReferences),
          showFolders: lK(t.showFolders, this.defaultValue.showFolders),
          showTypeParameters: lK(t.showTypeParameters, this.defaultValue.showTypeParameters),
          showSnippets: lK(t.showSnippets, this.defaultValue.showSnippets),
          showUsers: lK(t.showUsers, this.defaultValue.showUsers),
          showIssues: lK(t.showIssues, this.defaultValue.showIssues),
        };
      }
    })(),
  ),
  inlineSuggest: FK(
    new (class extends iK {
      constructor() {
        const e = {
          enabled: !0,
          mode: "subwordSmart",
          showToolbar: "onHover",
          suppressSuggestions: !1,
          keepOnBlur: !1,
          fontFamily: "default",
          syntaxHighlightingEnabled: !0,
          minShowDelay: 0,
          suppressInSnippetMode: !0,
          edits: {
            enabled: !0,
            showCollapsed: !1,
            renderSideBySide: "auto",
            allowCodeShifting: "always",
          },
          triggerCommandOnProviderChange: !1,
          experimental: {
            suppressInlineSuggestions: "",
            showOnSuggestConflict: "never",
            emptyResponseInformation: !0,
          },
        };
        super(71, "inlineSuggest", e, {
          "editor.inlineSuggest.enabled": {
            type: "boolean",
            default: e.enabled,
            description: SI(
              333,
              "Controls whether to automatically show inline suggestions in the editor.",
            ),
          },
          "editor.inlineSuggest.showToolbar": {
            type: "string",
            default: e.showToolbar,
            enum: ["always", "onHover", "never"],
            enumDescriptions: [
              SI(334, "Show the inline suggestion toolbar whenever an inline suggestion is shown."),
              SI(
                335,
                "Show the inline suggestion toolbar when hovering over an inline suggestion.",
              ),
              SI(336, "Never show the inline suggestion toolbar."),
            ],
            description: SI(337, "Controls when to show the inline suggestion toolbar."),
          },
          "editor.inlineSuggest.syntaxHighlightingEnabled": {
            type: "boolean",
            default: e.syntaxHighlightingEnabled,
            description: SI(
              338,
              "Controls whether to show syntax highlighting for inline suggestions in the editor.",
            ),
          },
          "editor.inlineSuggest.suppressSuggestions": {
            type: "boolean",
            default: e.suppressSuggestions,
            description: SI(
              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: e.suppressInSnippetMode,
            description: SI(
              340,
              "Controls whether inline suggestions are suppressed when in snippet mode.",
            ),
          },
          "editor.inlineSuggest.minShowDelay": {
            type: "number",
            default: 0,
            minimum: 0,
            maximum: 1e4,
            description: SI(
              341,
              "Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.",
            ),
          },
          "editor.inlineSuggest.experimental.suppressInlineSuggestions": {
            type: "string",
            default: e.experimental.suppressInlineSuggestions,
            tags: ["experimental"],
            description: SI(
              342,
              "Suppresses inline completions for specified extension IDs -- comma separated.",
            ),
            experiment: { mode: "auto" },
          },
          "editor.inlineSuggest.experimental.emptyResponseInformation": {
            type: "boolean",
            default: e.experimental.emptyResponseInformation,
            tags: ["experimental"],
            description: SI(
              343,
              "Controls whether to send request information from the inline suggestion provider.",
            ),
            experiment: { mode: "auto" },
          },
          "editor.inlineSuggest.triggerCommandOnProviderChange": {
            type: "boolean",
            default: e.triggerCommandOnProviderChange,
            tags: ["experimental"],
            description: SI(
              344,
              "Controls whether to trigger a command when the inline suggestion provider changes.",
            ),
            experiment: { mode: "auto" },
          },
          "editor.inlineSuggest.experimental.showOnSuggestConflict": {
            type: "string",
            default: e.experimental.showOnSuggestConflict,
            tags: ["experimental"],
            enum: ["always", "never", "whenSuggestListIsIncomplete"],
            description: SI(
              345,
              "Controls whether to show inline suggestions when there is a suggest conflict.",
            ),
            experiment: { mode: "auto" },
          },
          "editor.inlineSuggest.fontFamily": {
            type: "string",
            default: e.fontFamily,
            description: SI(346, "Controls the font family of the inline suggestions."),
          },
          "editor.inlineSuggest.edits.allowCodeShifting": {
            type: "string",
            default: e.edits.allowCodeShifting,
            description: SI(
              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: e.edits.renderSideBySide,
            description: SI(348, "Controls whether larger suggestions can be shown side by side."),
            enum: ["auto", "never"],
            enumDescriptions: [
              SI(
                349,
                "Larger suggestions will show side by side if there is enough space, otherwise they will be shown below.",
              ),
              SI(
                350,
                "Larger suggestions are never shown side by side and will always be shown below.",
              ),
            ],
            tags: ["nextEditSuggestions"],
          },
          "editor.inlineSuggest.edits.showCollapsed": {
            type: "boolean",
            default: e.edits.showCollapsed,
            description: SI(
              351,
              "Controls whether the suggestion will show as collapsed until jumping to it.",
            ),
            tags: ["nextEditSuggestions"],
          },
        });
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          enabled: lK(t.enabled, this.defaultValue.enabled),
          mode: fK(t.mode, this.defaultValue.mode, ["prefix", "subword", "subwordSmart"]),
          showToolbar: fK(t.showToolbar, this.defaultValue.showToolbar, [
            "always",
            "onHover",
            "never",
          ]),
          suppressSuggestions: lK(t.suppressSuggestions, this.defaultValue.suppressSuggestions),
          keepOnBlur: lK(t.keepOnBlur, this.defaultValue.keepOnBlur),
          fontFamily: pK.string(t.fontFamily, this.defaultValue.fontFamily),
          syntaxHighlightingEnabled: lK(
            t.syntaxHighlightingEnabled,
            this.defaultValue.syntaxHighlightingEnabled,
          ),
          minShowDelay: uK.clampedInt(t.minShowDelay, 0, 0, 1e4),
          suppressInSnippetMode: lK(
            t.suppressInSnippetMode,
            this.defaultValue.suppressInSnippetMode,
          ),
          edits: this._validateEdits(t.edits),
          triggerCommandOnProviderChange: lK(
            t.triggerCommandOnProviderChange,
            this.defaultValue.triggerCommandOnProviderChange,
          ),
          experimental: this._validateExperimental(t.experimental),
        };
      }
      _validateEdits(e) {
        if (!e || "object" != typeof e) return this.defaultValue.edits;
        const t = e;
        return {
          enabled: lK(t.enabled, this.defaultValue.edits.enabled),
          showCollapsed: lK(t.showCollapsed, this.defaultValue.edits.showCollapsed),
          allowCodeShifting: fK(t.allowCodeShifting, this.defaultValue.edits.allowCodeShifting, [
            "always",
            "horizontal",
            "never",
          ]),
          renderSideBySide: fK(t.renderSideBySide, this.defaultValue.edits.renderSideBySide, [
            "never",
            "auto",
          ]),
        };
      }
      _validateExperimental(e) {
        if (!e || "object" != typeof e) return this.defaultValue.experimental;
        const t = e;
        return {
          suppressInlineSuggestions: pK.string(
            t.suppressInlineSuggestions,
            this.defaultValue.experimental.suppressInlineSuggestions,
          ),
          showOnSuggestConflict: fK(
            t.showOnSuggestConflict,
            this.defaultValue.experimental.showOnSuggestConflict,
            ["always", "never", "whenSuggestListIsIncomplete"],
          ),
          emptyResponseInformation: lK(
            t.emptyResponseInformation,
            this.defaultValue.experimental.emptyResponseInformation,
          ),
        };
      }
    })(),
  ),
  inlineCompletionsAccessibilityVerbose: FK(
    new cK(169, "inlineCompletionsAccessibilityVerbose", !1, {
      description: SI(
        576,
        "Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.",
      ),
    }),
  ),
  suggestFontSize: FK(
    new uK(135, "suggestFontSize", 0, 0, 1e3, {
      markdownDescription: SI(
        577,
        "Font size for the suggest widget. When set to {0}, the value of {1} is used.",
        "`0`",
        "`#editor.fontSize#`",
      ),
    }),
  ),
  suggestLineHeight: FK(
    new uK(136, "suggestLineHeight", 0, 0, 1e3, {
      markdownDescription: SI(
        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: FK(
    new cK(137, "suggestOnTriggerCharacters", !0, {
      description: SI(
        579,
        "Controls whether suggestions should automatically show up when typing trigger characters.",
      ),
    }),
  ),
  suggestSelection: FK(
    new mK(138, "suggestSelection", "first", ["first", "recentlyUsed", "recentlyUsedByPrefix"], {
      markdownEnumDescriptions: [
        SI(580, "Always select the first suggestion."),
        SI(
          581,
          "Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently.",
        ),
        SI(
          582,
          "Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.",
        ),
      ],
      description: SI(
        583,
        "Controls how suggestions are pre-selected when showing the suggest list.",
      ),
    }),
  ),
  tabCompletion: FK(
    new mK(139, "tabCompletion", "off", ["on", "off", "onlySnippets"], {
      enumDescriptions: [
        SI(584, "Tab complete will insert the best matching suggestion when pressing tab."),
        SI(585, "Disable tab completions."),
        SI(
          586,
          "Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.",
        ),
      ],
      description: SI(587, "Enables tab completions."),
    }),
  ),
  tabIndex: FK(new uK(140, "tabIndex", 0, -1, 1073741824)),
  trimWhitespaceOnDelete: FK(
    new cK(141, "trimWhitespaceOnDelete", !1, {
      description: SI(
        588,
        "Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.",
      ),
    }),
  ),
  unicodeHighlight: FK(
    new (class extends iK {
      constructor() {
        const e = {
          nonBasicASCII: LK,
          invisibleCharacters: !0,
          ambiguousCharacters: !0,
          includeComments: LK,
          includeStrings: !0,
          allowedCharacters: {},
          allowedLocales: { _os: !0, _vscode: !0 },
        };
        super(142, "unicodeHighlight", e, {
          [IK]: {
            restricted: !0,
            type: ["boolean", "string"],
            enum: [!0, !1, LK],
            default: e.nonBasicASCII,
            description: SI(
              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.",
            ),
          },
          [TK]: {
            restricted: !0,
            type: "boolean",
            default: e.invisibleCharacters,
            description: SI(
              327,
              "Controls whether characters that just reserve space or have no width at all are highlighted.",
            ),
          },
          [RK]: {
            restricted: !0,
            type: "boolean",
            default: e.ambiguousCharacters,
            description: SI(
              328,
              "Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.",
            ),
          },
          [OK]: {
            restricted: !0,
            type: ["boolean", "string"],
            enum: [!0, !1, LK],
            default: e.includeComments,
            description: SI(
              329,
              "Controls whether characters in comments should also be subject to Unicode highlighting.",
            ),
          },
          [MK]: {
            restricted: !0,
            type: ["boolean", "string"],
            enum: [!0, !1, LK],
            default: e.includeStrings,
            description: SI(
              330,
              "Controls whether characters in strings should also be subject to Unicode highlighting.",
            ),
          },
          [DK]: {
            restricted: !0,
            type: "object",
            default: e.allowedCharacters,
            description: SI(331, "Defines allowed characters that are not being highlighted."),
            additionalProperties: { type: "boolean" },
          },
          [AK]: {
            restricted: !0,
            type: "object",
            additionalProperties: { type: "boolean" },
            default: e.allowedLocales,
            description: SI(
              332,
              "Unicode characters that are common in allowed locales are not being highlighted.",
            ),
          },
        });
      }
      applyUpdate(e, t) {
        let n = !1;
        (t.allowedCharacters &&
          e &&
          (zz(e.allowedCharacters, t.allowedCharacters) ||
            ((e = { ...e, allowedCharacters: t.allowedCharacters }), (n = !0))),
          t.allowedLocales &&
            e &&
            (zz(e.allowedLocales, t.allowedLocales) ||
              ((e = { ...e, allowedLocales: t.allowedLocales }), (n = !0))));
        const i = super.applyUpdate(e, t);
        return n ? new rK(i.newValue, !0) : i;
      }
      validate(e) {
        if (!e || "object" != typeof e) return this.defaultValue;
        const t = e;
        return {
          nonBasicASCII: PK(t.nonBasicASCII, LK, [!0, !1, LK]),
          invisibleCharacters: lK(t.invisibleCharacters, this.defaultValue.invisibleCharacters),
          ambiguousCharacters: lK(t.ambiguousCharacters, this.defaultValue.ambiguousCharacters),
          includeComments: PK(t.includeComments, LK, [!0, !1, LK]),
          includeStrings: PK(t.includeStrings, LK, [!0, !1, LK]),
          allowedCharacters: this.validateBooleanMap(
            t.allowedCharacters,
            this.defaultValue.allowedCharacters,
          ),
          allowedLocales: this.validateBooleanMap(
            t.allowedLocales,
            this.defaultValue.allowedLocales,
          ),
        };
      }
      validateBooleanMap(e, t) {
        if ("object" != typeof e || !e) return t;
        const n = {};
        for (const [i, r] of Object.entries(e)) !0 === r && (n[i] = !0);
        return n;
      }
    })(),
  ),
  unusualLineTerminators: FK(
    new mK(143, "unusualLineTerminators", "prompt", ["auto", "off", "prompt"], {
      enumDescriptions: [
        SI(589, "Unusual line terminators are automatically removed."),
        SI(590, "Unusual line terminators are ignored."),
        SI(591, "Unusual line terminators prompt to be removed."),
      ],
      description: SI(592, "Remove unusual line terminators that might cause problems."),
    }),
  ),
  useShadowDOM: FK(new cK(144, "useShadowDOM", !0)),
  useTabStops: FK(
    new cK(145, "useTabStops", !0, {
      description: SI(593, "Spaces and tabs are inserted and deleted in alignment with tab stops."),
    }),
  ),
  wordBreak: FK(
    new mK(146, "wordBreak", "normal", ["normal", "keepAll"], {
      markdownEnumDescriptions: [
        SI(594, "Use the default line break rule."),
        SI(
          595,
          "Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.",
        ),
      ],
      description: SI(
        596,
        "Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.",
      ),
    }),
  ),
  wordSegmenterLocales: FK(
    new (class extends iK {
      constructor() {
        const e = [];
        super(147, "wordSegmenterLocales", e, {
          anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
          description: SI(
            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: e,
        });
      }
      validate(e) {
        if (("string" == typeof e && (e = [e]), Array.isArray(e))) {
          const t = [];
          for (const n of e)
            if ("string" == typeof n)
              try {
                Intl.Segmenter.supportedLocalesOf(n).length > 0 && t.push(n);
              } catch {}
          return t;
        }
        return this.defaultValue;
      }
    })(),
  ),
  wordSeparators: FK(
    new pK(148, "wordSeparators", sU, {
      description: SI(
        597,
        "Characters that will be used as word separators when doing word related navigations or operations.",
      ),
    }),
  ),
  wordWrap: FK(
    new mK(149, "wordWrap", "off", ["off", "on", "wordWrapColumn", "bounded"], {
      markdownEnumDescriptions: [
        SI(598, "Lines will never wrap."),
        SI(599, "Lines will wrap at the viewport width."),
        SI(600, "Lines will wrap at `#editor.wordWrapColumn#`."),
        SI(601, "Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`."),
      ],
      description: SI(602, "Controls how lines should wrap."),
    }),
  ),
  wordWrapBreakAfterCharacters: FK(
    new pK(
      150,
      "wordWrapBreakAfterCharacters",
      " \t})]?|/&.,;¢°′″‰℃、。｡､￠，．：；？！％・･ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ｧｨｩｪｫｬｭｮｯｰ”〉》」』】〕）］｝｣",
    ),
  ),
  wordWrapBreakBeforeCharacters: FK(
    new pK(151, "wordWrapBreakBeforeCharacters", "([{‘“〈《「『【〔（［｛｢£¥＄￡￥+＋"),
  ),
  wordWrapColumn: FK(
    new uK(152, "wordWrapColumn", 80, 1, 1073741824, {
      markdownDescription: SI(
        603,
        "Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.",
      ),
    }),
  ),
  wordWrapOverride1: FK(new mK(153, "wordWrapOverride1", "inherit", ["off", "on", "inherit"])),
  wordWrapOverride2: FK(new mK(154, "wordWrapOverride2", "inherit", ["off", "on", "inherit"])),
  wrapOnEscapedLineFeeds: FK(
    new cK(160, "wrapOnEscapedLineFeeds", !1, {
      markdownDescription: SI(
        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: FK(
    new (class extends sK {
      constructor() {
        super(161, vK.Line);
      }
      compute(e, t, n) {
        return "overtype" === e.inputMode ? t.get(92) : t.get(34);
      }
    })(),
  ),
  editorClassName: FK(
    new (class extends sK {
      constructor() {
        super(162, "");
      }
      compute(e, t, n) {
        const i = ["monaco-editor"];
        return (
          t.get(48) && i.push(t.get(48)),
          e.extraEditorClassName && i.push(e.extraEditorClassName),
          "default" === t.get(82)
            ? i.push("mouse-default")
            : "copy" === t.get(82) && i.push("mouse-copy"),
          t.get(127) && i.push("showUnused"),
          t.get(157) && i.push("showDeprecated"),
          i.join(" ")
        );
      }
    })(),
  ),
  defaultColorDecorators: FK(
    new mK(167, "defaultColorDecorators", "auto", ["auto", "always", "never"], {
      enumDescriptions: [
        SI(605, "Show default color decorators only when no extension provides colors decorators."),
        SI(606, "Always show default color decorators."),
        SI(607, "Never show default color decorators."),
      ],
      description: SI(
        608,
        "Controls whether inline color decorations should be shown using the default document color provider.",
      ),
    }),
  ),
  pixelRatio: FK(
    new (class extends sK {
      constructor() {
        super(163, 1);
      }
      compute(e, t, n) {
        return e.pixelRatio;
      }
    })(),
  ),
  tabFocusMode: FK(
    new cK(164, "tabFocusMode", !1, {
      markdownDescription: SI(
        609,
        "Controls whether the editor receives tabs or defers them to the workbench for navigation.",
      ),
    }),
  ),
  layoutInfo: FK(new SK()),
  wrappingInfo: FK(
    new (class extends sK {
      constructor() {
        super(166, {
          isDominatedByLongLines: !1,
          isWordWrapMinified: !1,
          isViewportWrapping: !1,
          wrappingColumn: -1,
        });
      }
      compute(e, t, n) {
        const i = t.get(165);
        return {
          isDominatedByLongLines: e.isDominatedByLongLines,
          isWordWrapMinified: i.isWordWrapMinified,
          isViewportWrapping: i.isViewportWrapping,
          wrappingColumn: i.wrappingColumn,
        };
      }
    })(),
  ),
  wrappingIndent: FK(
    new (class extends iK {
      constructor() {
        super(155, "wrappingIndent", 1, {
          "editor.wrappingIndent": {
            type: "string",
            enum: ["none", "same", "indent", "deepIndent"],
            enumDescriptions: [
              SI(419, "No indentation. Wrapped lines begin at column 1."),
              SI(420, "Wrapped lines get the same indentation as the parent."),
              SI(421, "Wrapped lines get +1 indentation toward the parent."),
              SI(422, "Wrapped lines get +2 indentation toward the parent."),
            ],
            description: SI(423, "Controls the indentation of wrapped lines."),
            default: "same",
          },
        });
      }
      validate(e) {
        switch (e) {
          case "none":
            return 0;
          case "same":
            return 1;
          case "indent":
            return 2;
          case "deepIndent":
            return 3;
        }
        return 1;
      }
      compute(e, t, n) {
        return 2 === t.get(2) ? 0 : n;
      }
    })(),
  ),
  wrappingStrategy: FK(
    new (class extends iK {
      constructor() {
        super(156, "wrappingStrategy", "simple", {
          "editor.wrappingStrategy": {
            enumDescriptions: [
              SI(
                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.",
              ),
              SI(
                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: SI(
              257,
              "Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.",
            ),
          },
        });
      }
      validate(e) {
        return fK(e, "simple", ["simple", "advanced"]);
      }
      compute(e, t, n) {
        return 2 === t.get(2) ? "advanced" : n;
      }
    })(),
  ),
  effectiveEditContextEnabled: FK(
    new (class extends sK {
      constructor() {
        super(170, !1);
      }
      compute(e, t) {
        return e.editContextSupported && t.get(44);
      }
    })(),
  ),
  effectiveAllowVariableFonts: FK(
    new (class extends sK {
      constructor() {
        super(172, !1);
      }
      compute(e, t) {
        return 2 === e.accessibilitySupport ? t.get(7) : t.get(6);
      }
    })(),
  ),
};
class VK {
  constructor() {
    ((this._keys = Object.create(null)), (this._values = Object.create(null)));
  }
  has(e) {
    const t = e.getId();
    return !!this._values[t];
  }
  get(e) {
    const t = e.getId();
    return this._values[t];
  }
  put(e, t) {
    const n = e.getId();
    ((this._keys[n] = e), (this._values[n] = t));
  }
  remove(e) {
    const t = e.getId();
    (delete this._keys[t], delete this._values[t]);
  }
  getValues() {
    return Object.keys(this._keys).map((e) => this._values[e]);
  }
}
const WK = new (class extends PO {
  constructor() {
    (super(...arguments),
      (this._cache = new Map()),
      (this._evictUntrustedReadingsTimeout = -1),
      (this._onDidChange = this._register(new QO())),
      (this.onDidChange = this._onDidChange.event));
  }
  dispose() {
    (-1 !== this._evictUntrustedReadingsTimeout &&
      (clearTimeout(this._evictUntrustedReadingsTimeout),
      (this._evictUntrustedReadingsTimeout = -1)),
      super.dispose());
  }
  clearAllFontInfos() {
    (this._cache.clear(), this._onDidChange.fire());
  }
  _ensureCache(e) {
    const t = FF(e);
    let n = this._cache.get(t);
    return (n || ((n = new VK()), this._cache.set(t, n)), n);
  }
  _writeToCache(e, t, n) {
    (this._ensureCache(e).put(t, n),
      n.isTrusted ||
        -1 !== this._evictUntrustedReadingsTimeout ||
        (this._evictUntrustedReadingsTimeout = e.setTimeout(() => {
          ((this._evictUntrustedReadingsTimeout = -1), this._evictUntrustedReadings(e));
        }, 5e3)));
  }
  _evictUntrustedReadings(e) {
    const t = this._ensureCache(e),
      n = t.getValues();
    let i = !1;
    for (const r of n) r.isTrusted || ((i = !0), t.remove(r));
    i && this._onDidChange.fire();
  }
  readFontInfo(e, t) {
    const n = this._ensureCache(e);
    if (!n.has(t)) {
      let n = this._actualReadFontInfo(e, t);
      ((n.typicalHalfwidthCharacterWidth <= 2 ||
        n.typicalFullwidthCharacterWidth <= 2 ||
        n.spaceWidth <= 2 ||
        n.maxDigitWidth <= 2) &&
        (n = new Yq(
          {
            pixelRatio: Uq.getInstance(e).value,
            fontFamily: n.fontFamily,
            fontWeight: n.fontWeight,
            fontSize: n.fontSize,
            fontFeatureSettings: n.fontFeatureSettings,
            fontVariationSettings: n.fontVariationSettings,
            lineHeight: n.lineHeight,
            letterSpacing: n.letterSpacing,
            isMonospace: n.isMonospace,
            typicalHalfwidthCharacterWidth: Math.max(n.typicalHalfwidthCharacterWidth, 5),
            typicalFullwidthCharacterWidth: Math.max(n.typicalFullwidthCharacterWidth, 5),
            canUseHalfwidthRightwardsArrow: n.canUseHalfwidthRightwardsArrow,
            spaceWidth: Math.max(n.spaceWidth, 5),
            middotWidth: Math.max(n.middotWidth, 5),
            wsmiddotWidth: Math.max(n.wsmiddotWidth, 5),
            maxDigitWidth: Math.max(n.maxDigitWidth, 5),
          },
          !1,
        )),
        this._writeToCache(e, t, n));
    }
    return n.get(t);
  }
  _createRequest(e, t, n, i) {
    const r = new $q(e, t);
    return (n.push(r), i?.push(r), r);
  }
  _actualReadFontInfo(e, t) {
    const n = [],
      i = [],
      r = this._createRequest("n", 0, n, i),
      o = this._createRequest("ｍ", 0, n, null),
      s = this._createRequest(" ", 0, n, i),
      a = this._createRequest("0", 0, n, i),
      l = this._createRequest("1", 0, n, i),
      c = this._createRequest("2", 0, n, i),
      d = this._createRequest("3", 0, n, i),
      u = this._createRequest("4", 0, n, i),
      h = this._createRequest("5", 0, n, i),
      g = this._createRequest("6", 0, n, i),
      p = this._createRequest("7", 0, n, i),
      f = this._createRequest("8", 0, n, i),
      m = this._createRequest("9", 0, n, i),
      _ = this._createRequest("→", 0, n, i),
      v = this._createRequest("￫", 0, n, null),
      b = this._createRequest("·", 0, n, i),
      y = this._createRequest(String.fromCharCode(11825), 0, n, null),
      x = "|/-_ilm%";
    for (let E = 0, N = 8; E < N; E++)
      (this._createRequest(x.charAt(E), 0, n, i),
        this._createRequest(x.charAt(E), 1, n, i),
        this._createRequest(x.charAt(E), 2, n, i));
    !(function (e, t, n) {
      new qq(t, n).read(e);
    })(e, t, n);
    const w = Math.max(
      a.width,
      l.width,
      c.width,
      d.width,
      u.width,
      h.width,
      g.width,
      p.width,
      f.width,
      m.width,
    );
    let C = t.fontFeatureSettings === xK.OFF;
    const S = i[0].width;
    for (let E = 1, N = i.length; C && E < N; E++) {
      const e = S - i[E].width;
      if (e < -0.001 || e > 0.001) {
        C = !1;
        break;
      }
    }
    let k = !0;
    return (
      C && v.width !== S && (k = !1),
      v.width > _.width && (k = !1),
      new Yq(
        {
          pixelRatio: Uq.getInstance(e).value,
          fontFamily: t.fontFamily,
          fontWeight: t.fontWeight,
          fontSize: t.fontSize,
          fontFeatureSettings: t.fontFeatureSettings,
          fontVariationSettings: t.fontVariationSettings,
          lineHeight: t.lineHeight,
          letterSpacing: t.letterSpacing,
          isMonospace: C,
          typicalHalfwidthCharacterWidth: r.width,
          typicalFullwidthCharacterWidth: o.width,
          canUseHalfwidthRightwardsArrow: k,
          spaceWidth: s.width,
          middotWidth: b.width,
          wsmiddotWidth: y.width,
          maxDigitWidth: w,
        },
        !0,
      )
    );
  }
})();
class HK {
  static {
    this.items = [];
  }
  constructor(e, t) {
    ((this.key = e), (this.migrate = t));
  }
  apply(e) {
    const t = HK._read(e, this.key);
    this.migrate(
      t,
      (t) => HK._read(e, t),
      (t, n) => HK._write(e, t, n),
    );
  }
  static _read(e, t) {
    if (null == e) return;
    const n = t.indexOf(".");
    if (n >= 0) {
      const i = t.substring(0, n);
      return this._read(e[i], t.substring(n + 1));
    }
    return e[t];
  }
  static _write(e, t, n) {
    const i = t.indexOf(".");
    if (i >= 0) {
      const r = t.substring(0, i);
      return ((e[r] = e[r] || {}), void this._write(e[r], t.substring(i + 1), n));
    }
    e[t] = n;
  }
}
function zK(e, t) {
  HK.items.push(new HK(e, t));
}
function UK(e, t) {
  zK(e, (n, i, r) => {
    if (void 0 !== n) for (const [o, s] of t) if (n === o) return void r(e, s);
  });
}
(UK("wordWrap", [
  [!0, "on"],
  [!1, "off"],
]),
  UK("lineNumbers", [
    [!0, "on"],
    [!1, "off"],
  ]),
  UK("cursorBlinking", [["visible", "solid"]]),
  UK("renderWhitespace", [
    [!0, "boundary"],
    [!1, "none"],
  ]),
  UK("renderLineHighlight", [
    [!0, "line"],
    [!1, "none"],
  ]),
  UK("acceptSuggestionOnEnter", [
    [!0, "on"],
    [!1, "off"],
  ]),
  UK("tabCompletion", [
    [!1, "off"],
    [!0, "onlySnippets"],
  ]),
  UK("hover", [
    [!0, { enabled: !0 }],
    [!1, { enabled: !1 }],
  ]),
  UK("parameterHints", [
    [!0, { enabled: !0 }],
    [!1, { enabled: !1 }],
  ]),
  UK("autoIndent", [
    [!1, "advanced"],
    [!0, "full"],
  ]),
  UK("matchBrackets", [
    [!0, "always"],
    [!1, "never"],
  ]),
  UK("renderFinalNewline", [
    [!0, "on"],
    [!1, "off"],
  ]),
  UK("cursorSmoothCaretAnimation", [
    [!0, "on"],
    [!1, "off"],
  ]),
  UK("occurrencesHighlight", [
    [!0, "singleFile"],
    [!1, "off"],
  ]),
  UK("wordBasedSuggestions", [
    [!0, "matchingDocuments"],
    [!1, "off"],
  ]),
  UK("defaultColorDecorators", [
    [!0, "auto"],
    [!1, "never"],
  ]),
  UK("minimap.autohide", [
    [!0, "mouseover"],
    [!1, "none"],
  ]),
  zK("autoClosingBrackets", (e, t, n) => {
    !1 === e &&
      (n("autoClosingBrackets", "never"),
      void 0 === t("autoClosingQuotes") && n("autoClosingQuotes", "never"),
      void 0 === t("autoSurround") && n("autoSurround", "never"));
  }),
  zK("renderIndentGuides", (e, t, n) => {
    void 0 !== e &&
      (n("renderIndentGuides", void 0),
      void 0 === t("guides.indentation") && n("guides.indentation", !!e));
  }),
  zK("highlightActiveIndentGuide", (e, t, n) => {
    void 0 !== e &&
      (n("highlightActiveIndentGuide", void 0),
      void 0 === t("guides.highlightActiveIndentation") &&
        n("guides.highlightActiveIndentation", !!e));
  }));
const $K = {
  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",
};
(zK("suggest.filteredTypes", (e, t, n) => {
  if (e && "object" == typeof e) {
    for (const i of Object.entries($K)) {
      !1 === e[i[0]] && void 0 === t(`suggest.${i[1]}`) && n(`suggest.${i[1]}`, !1);
    }
    n("suggest.filteredTypes", void 0);
  }
}),
  zK("quickSuggestions", (e, t, n) => {
    if ("boolean" == typeof e) {
      const t = e ? "on" : "off";
      n("quickSuggestions", { comments: t, strings: t, other: t });
    }
  }),
  zK("experimental.stickyScroll.enabled", (e, t, n) => {
    "boolean" == typeof e &&
      (n("experimental.stickyScroll.enabled", void 0),
      void 0 === t("stickyScroll.enabled") && n("stickyScroll.enabled", e));
  }),
  zK("experimental.stickyScroll.maxLineCount", (e, t, n) => {
    "number" == typeof e &&
      (n("experimental.stickyScroll.maxLineCount", void 0),
      void 0 === t("stickyScroll.maxLineCount") && n("stickyScroll.maxLineCount", e));
  }),
  zK("editor.experimentalEditContextEnabled", (e, t, n) => {
    "boolean" == typeof e &&
      (n("editor.experimentalEditContextEnabled", void 0),
      void 0 === t("editor.editContext") && n("editor.editContext", e));
  }),
  zK("codeActionsOnSave", (e, t, n) => {
    if (e && "object" == typeof e) {
      let t = !1;
      const i = {};
      for (const n of Object.entries(e))
        "boolean" == typeof n[1]
          ? ((t = !0), (i[n[0]] = n[1] ? "explicit" : "never"))
          : (i[n[0]] = n[1]);
      t && n("codeActionsOnSave", i);
    }
  }),
  zK("codeActionWidget.includeNearbyQuickfixes", (e, t, n) => {
    "boolean" == typeof e &&
      (n("codeActionWidget.includeNearbyQuickfixes", void 0),
      void 0 === t("codeActionWidget.includeNearbyQuickFixes") &&
        n("codeActionWidget.includeNearbyQuickFixes", e));
  }),
  zK("lightbulb.enabled", (e, t, n) => {
    "boolean" == typeof e && n("lightbulb.enabled", e ? void 0 : "off");
  }),
  zK("inlineSuggest.edits.codeShifting", (e, t, n) => {
    "boolean" == typeof e &&
      (n("inlineSuggest.edits.codeShifting", void 0),
      n("inlineSuggest.edits.allowCodeShifting", e ? "always" : "never"));
  }));
const qK = new (class {
  constructor() {
    ((this._tabFocus = !1),
      (this._onDidChangeTabFocus = new QO()),
      (this.onDidChangeTabFocus = this._onDidChangeTabFocus.event));
  }
  getTabFocusMode() {
    return this._tabFocus;
  }
  setTabFocusMode(e) {
    ((this._tabFocus = e), this._onDidChangeTabFocus.fire(this._tabFocus));
  }
})();
const KK = bV("accessibilityService"),
  GK = new yW("accessibilityModeEnabled", !1);
let ZK = class extends PO {
  constructor(e, t, n, i, r) {
    (super(),
      (this._accessibilityService = r),
      (this._onDidChange = this._register(new QO())),
      (this.onDidChange = this._onDidChange.event),
      (this._onDidChangeFast = this._register(new QO())),
      (this.onDidChangeFast = this._onDidChangeFast.event),
      (this._isDominatedByLongLines = !1),
      (this._viewLineCount = 1),
      (this._lineNumbersDigitCount = 1),
      (this._reservedHeight = 0),
      (this._glyphMarginDecorationLaneCount = 1),
      (this._computeOptionsMemory = new nK()),
      (this.isSimpleWidget = e),
      (this.contextMenuId = t),
      (this._containerObserver = this._register(new Wq(i, n.dimension))),
      (this._targetWindowId = MF(i).vscodeWindowId),
      (this._rawOptions = eG(n)),
      (this._validatedOptions = JK.validateOptions(this._rawOptions)),
      (this.options = this._computeOptions()),
      this.options.get(19) && this._containerObserver.startObserving(),
      this._register(Kq.onDidChangeZoomLevel(() => this._recomputeOptions())),
      this._register(qK.onDidChangeTabFocus(() => this._recomputeOptions())),
      this._register(this._containerObserver.onDidChange(() => this._recomputeOptions())),
      this._register(WK.onDidChange(() => this._recomputeOptions())),
      this._register(Uq.getInstance(MF(i)).onDidChange(() => this._recomputeOptions())),
      this._register(
        this._accessibilityService.onDidChangeScreenReaderOptimized(() => this._recomputeOptions()),
      ),
      this._register(iz.onDidChangeInputMode(() => this._recomputeOptions())));
  }
  _recomputeOptions() {
    const e = this._computeOptions(),
      t = JK.checkEquals(this.options, e);
    null !== t && ((this.options = e), this._onDidChangeFast.fire(t), this._onDidChange.fire(t));
  }
  _computeOptions() {
    const e = this._readEnvConfiguration(),
      t = (function (e, t, n) {
        const i = e.get(58),
          r = e.get(62),
          o = e.get(61),
          s = e.get(60),
          a = e.get(63),
          l = e.get(75),
          c = e.get(72);
        return Zq._create(i, r, o, s, a, l, c, t, n);
      })(this._validatedOptions, e.pixelRatio, this.isSimpleWidget),
      n = this._readFontInfo(t),
      i = {
        memory: this._computeOptionsMemory,
        outerWidth: e.outerWidth,
        outerHeight: e.outerHeight - this._reservedHeight,
        fontInfo: n,
        extraEditorClassName: e.extraEditorClassName,
        isDominatedByLongLines: this._isDominatedByLongLines,
        viewLineCount: this._viewLineCount,
        lineNumbersDigitCount: this._lineNumbersDigitCount,
        emptySelectionClipboard: e.emptySelectionClipboard,
        pixelRatio: e.pixelRatio,
        tabFocusMode: this._validatedOptions.get(164) || qK.getTabFocusMode(),
        inputMode: iz.getInputMode(),
        accessibilitySupport: e.accessibilitySupport,
        glyphMarginDecorationLaneCount: this._glyphMarginDecorationLaneCount,
        editContextSupported: e.editContextSupported,
      };
    return JK.computeOptions(this._validatedOptions, i);
  }
  _readEnvConfiguration() {
    return {
      extraEditorClassName: YK(),
      outerWidth: this._containerObserver.getWidth(),
      outerHeight: this._containerObserver.getHeight(),
      emptySelectionClipboard: OI || RI,
      pixelRatio: Uq.getInstance(BF(this._targetWindowId, !0).window).value,
      editContextSupported: "function" == typeof globalThis.EditContext,
      accessibilitySupport: this._accessibilityService.isScreenReaderOptimized()
        ? 2
        : this._accessibilityService.getAccessibilitySupport(),
    };
  }
  _readFontInfo(e) {
    return WK.readFontInfo(BF(this._targetWindowId, !0).window, e);
  }
  getRawOptions() {
    return this._rawOptions;
  }
  updateOptions(e) {
    const t = eG(e);
    JK.applyUpdate(this._rawOptions, t) &&
      ((this._validatedOptions = JK.validateOptions(this._rawOptions)), this._recomputeOptions());
  }
  observeContainer(e) {
    this._containerObserver.observe(e);
  }
  setIsDominatedByLongLines(e) {
    this._isDominatedByLongLines !== e &&
      ((this._isDominatedByLongLines = e), this._recomputeOptions());
  }
  setModelLineCount(e) {
    const t = (function (e) {
      let t = 0;
      for (; e; ) ((e = Math.floor(e / 10)), t++);
      return t || 1;
    })(e);
    this._lineNumbersDigitCount !== t &&
      ((this._lineNumbersDigitCount = t), this._recomputeOptions());
  }
  setViewLineCount(e) {
    this._viewLineCount !== e && ((this._viewLineCount = e), this._recomputeOptions());
  }
  setReservedHeight(e) {
    this._reservedHeight !== e && ((this._reservedHeight = e), this._recomputeOptions());
  }
  setGlyphMarginDecorationLaneCount(e) {
    this._glyphMarginDecorationLaneCount !== e &&
      ((this._glyphMarginDecorationLaneCount = e), this._recomputeOptions());
  }
};
function YK() {
  let e = "";
  return (
    AI || PI
      ? ((e += "no-minimap-shadow "), (e += "enable-user-select "))
      : (e += "no-user-select "),
    PR && (e += "mac "),
    e
  );
}
ZK = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(4, KK),
  ],
  ZK,
);
class XK {
  constructor() {
    this._values = [];
  }
  _read(e) {
    return this._values[e];
  }
  get(e) {
    return this._values[e];
  }
  _write(e, t) {
    this._values[e] = t;
  }
}
class QK {
  constructor() {
    this._values = [];
  }
  _read(e) {
    if (e >= this._values.length) throw new Error("Cannot read uninitialized value");
    return this._values[e];
  }
  get(e) {
    return this._read(e);
  }
  _write(e, t) {
    this._values[e] = t;
  }
}
class JK {
  static validateOptions(e) {
    const t = new XK();
    for (const n of jK) {
      const i = "_never_" === n.name ? void 0 : e[n.name];
      t._write(n.id, n.validate(i));
    }
    return t;
  }
  static computeOptions(e, t) {
    const n = new QK();
    for (const i of jK) n._write(i.id, i.compute(t, n, e._read(i.id)));
    return n;
  }
  static _deepEquals(e, t) {
    if ("object" != typeof e || "object" != typeof t || !e || !t) return e === t;
    if (Array.isArray(e) || Array.isArray(t))
      return !(!Array.isArray(e) || !Array.isArray(t)) && XP(e, t);
    if (Object.keys(e).length !== Object.keys(t).length) return !1;
    for (const n in e) if (!JK._deepEquals(e[n], t[n])) return !1;
    return !0;
  }
  static checkEquals(e, t) {
    const n = [];
    let i = !1;
    for (const r of jK) {
      const o = !JK._deepEquals(e._read(r.id), t._read(r.id));
      ((n[r.id] = o), o && (i = !0));
    }
    return i ? new tK(n) : null;
  }
  static applyUpdate(e, t) {
    let n = !1;
    for (const i of jK)
      if (t.hasOwnProperty(i.name)) {
        const r = i.applyUpdate(e[i.name], t[i.name]);
        ((e[i.name] = r.newValue), (n = n || r.didChange));
      }
    return n;
  }
}
function eG(e) {
  const t = Fz(e);
  return (
    (function (e) {
      HK.items.forEach((t) => t.apply(e));
    })(t),
    t
  );
}
var tG;
!(function (e) {
  const t = { total: 0, min: Number.MAX_VALUE, max: 0 },
    n = { ...t },
    i = { ...t },
    r = { ...t };
  let o = 0;
  const s = { keydown: 0, input: 0, render: 0 };
  function a() {
    1 === s.keydown && (performance.mark("keydown/end"), (s.keydown = 2));
  }
  function l() {
    (performance.mark("input/start"), (s.input = 1), u());
  }
  function c() {
    1 === s.input && (performance.mark("input/end"), (s.input = 2));
  }
  function d() {
    1 === s.render && (performance.mark("render/end"), (s.render = 2));
  }
  function u() {
    setTimeout(h);
  }
  function h() {
    2 === s.keydown &&
      2 === s.input &&
      2 === s.render &&
      (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"),
      g("keydown", t),
      g("input", n),
      g("render", i),
      g("inputlatency", r),
      o++,
      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"),
      (s.keydown = 0),
      (s.input = 0),
      (s.render = 0));
  }
  function g(e, t) {
    const n = performance.getEntriesByName(e)[0].duration;
    ((t.total += n), (t.min = Math.min(t.min, n)), (t.max = Math.max(t.max, n)));
  }
  function p(e) {
    return { average: e.total / o, max: e.max, min: e.min };
  }
  function f(e) {
    ((e.total = 0), (e.min = Number.MAX_VALUE), (e.max = 0));
  }
  ((e.onKeyDown = function () {
    (h(),
      performance.mark("inputlatency/start"),
      performance.mark("keydown/start"),
      (s.keydown = 1),
      queueMicrotask(a));
  }),
    (e.onBeforeInput = l),
    (e.onInput = function () {
      (0 === s.input && l(), queueMicrotask(c));
    }),
    (e.onKeyUp = function () {
      h();
    }),
    (e.onSelectionChange = function () {
      h();
    }),
    (e.onRenderStart = function () {
      2 === s.keydown &&
        2 === s.input &&
        0 === s.render &&
        (performance.mark("render/start"), (s.render = 1), queueMicrotask(d), u());
    }),
    (e.getAndClearMeasurements = function () {
      if (0 === o) return;
      const e = { keydown: p(t), input: p(n), render: p(i), total: p(r), sampleCount: o };
      return (f(t), f(n), f(i), f(r), (o = 0), e);
    }));
})(tG || (tG = {}));
const nG = new Map();
class iG {
  constructor() {
    ((this._currentCssStyle = ""), (this._styleSheet = void 0));
  }
  setStyle(e) {
    e !== this._currentCssStyle &&
      ((this._currentCssStyle = e),
      this._styleSheet
        ? (this._styleSheet.textContent = e)
        : (this._styleSheet = rG(NI.document.head, (t) => (t.textContent = e))));
  }
  dispose() {
    this._styleSheet && (this._styleSheet.remove(), (this._styleSheet = void 0));
  }
}
function rG(e = NI.document.head, t, n) {
  const i = document.createElement("style");
  if (
    ((i.type = "text/css"),
    (i.media = "screen"),
    t?.(i),
    e.appendChild(i),
    n && n.add(MO(() => i.remove())),
    e === NI.document.head)
  ) {
    const e = new Set();
    (nG.set(i, e), n && n.add(MO(() => nG.delete(i))));
    for (const { window: t, disposables: r } of PF()) {
      if (t === NI) continue;
      const o = r.add(oG(i, e, t));
      n?.add(o);
    }
  }
  return i;
}
function oG(e, t, n) {
  const i = new AO(),
    r = e.cloneNode(!0);
  (n.document.head.appendChild(r), i.add(MO(() => r.remove())));
  for (const o of lG(e)) r.sheet?.insertRule(o.cssText, r.sheet?.cssRules.length);
  return (
    i.add(
      CB.observe(e, i, { childList: !0, subtree: RI, characterData: RI })(() => {
        r.textContent = e.textContent;
      }),
    ),
    t.add(r),
    i.add(MO(() => t.delete(r))),
    i
  );
}
let sG = null;
function aG() {
  return (sG || (sG = rG()), sG);
}
function lG(e) {
  return e?.sheet?.rules ? e.sheet.rules : e?.sheet?.cssRules ? e.sheet.cssRules : [];
}
function cG(e, t, n = aG()) {
  if (n && t) {
    n.sheet?.insertRule(`${e} {${t}}`, 0);
    for (const i of nG.get(n) ?? []) cG(e, t, i);
  }
}
function dG(e, t = aG()) {
  if (!t) return;
  const n = lG(t),
    i = [];
  for (let r = 0; r < n.length; r++) {
    const t = n[r];
    uG(t) && -1 !== t.selectorText.indexOf(e) && i.push(r);
  }
  for (let r = i.length - 1; r >= 0; r--) t.sheet?.deleteRule(i[r]);
  for (const r of nG.get(t) ?? []) dG(e, r);
}
function uG(e) {
  return "string" == typeof e.selectorText;
}
function hG(e) {
  const t = new AO(),
    n = t.add(new iG());
  return (
    t.add(
      rF((t) => {
        n.setStyle(e.read(t));
      }),
    ),
    t
  );
}
class gG {
  constructor() {
    ((this._hooks = new AO()), (this._pointerMoveCallback = null), (this._onStopCallback = null));
  }
  dispose() {
    (this.stopMonitoring(!1), this._hooks.dispose());
  }
  stopMonitoring(e, t) {
    if (!this.isMonitoring()) return;
    (this._hooks.clear(), (this._pointerMoveCallback = null));
    const n = this._onStopCallback;
    ((this._onStopCallback = null), e && n && n(t));
  }
  isMonitoring() {
    return !!this._pointerMoveCallback;
  }
  startMonitoring(e, t, n, i, r) {
    (this.isMonitoring() && this.stopMonitoring(!1),
      (this._pointerMoveCallback = i),
      (this._onStopCallback = r));
    let o = e;
    try {
      (e.setPointerCapture(t),
        this._hooks.add(
          MO(() => {
            try {
              e.releasePointerCapture(t);
            } catch (n) {}
          }),
        ));
    } catch (s) {
      o = MF(e);
    }
    (this._hooks.add(
      $F(o, DB.POINTER_MOVE, (e) => {
        e.buttons === n
          ? (e.preventDefault(), this._pointerMoveCallback(e))
          : this.stopMonitoring(!0);
      }),
    ),
      this._hooks.add($F(o, DB.POINTER_UP, (e) => this.stopMonitoring(!0))));
  }
}
function pG(e, t) {
  const n = Math.pow(10, t);
  return Math.round(e * n) / n;
}
class fG {
  constructor(e, t, n, i = 1) {
    ((this._rgbaBrand = void 0),
      (this.r = 0 | Math.min(255, Math.max(0, e))),
      (this.g = 0 | Math.min(255, Math.max(0, t))),
      (this.b = 0 | Math.min(255, Math.max(0, n))),
      (this.a = pG(Math.max(Math.min(1, i), 0), 3)));
  }
  static equals(e, t) {
    return e.r === t.r && e.g === t.g && e.b === t.b && e.a === t.a;
  }
}
class mG {
  constructor(e, t, n, i) {
    ((this._hslaBrand = void 0),
      (this.h = 0 | Math.max(Math.min(360, e), 0)),
      (this.s = pG(Math.max(Math.min(1, t), 0), 3)),
      (this.l = pG(Math.max(Math.min(1, n), 0), 3)),
      (this.a = pG(Math.max(Math.min(1, i), 0), 3)));
  }
  static equals(e, t) {
    return e.h === t.h && e.s === t.s && e.l === t.l && e.a === t.a;
  }
  static fromRGBA(e) {
    const t = e.r / 255,
      n = e.g / 255,
      i = e.b / 255,
      r = e.a,
      o = Math.max(t, n, i),
      s = Math.min(t, n, i);
    let a = 0,
      l = 0;
    const c = (s + o) / 2,
      d = o - s;
    if (d > 0) {
      switch (((l = Math.min(c <= 0.5 ? d / (2 * c) : d / (2 - 2 * c), 1)), o)) {
        case t:
          a = (n - i) / d + (n < i ? 6 : 0);
          break;
        case n:
          a = (i - t) / d + 2;
          break;
        case i:
          a = (t - n) / d + 4;
      }
      ((a *= 60), (a = Math.round(a)));
    }
    return new mG(a, l, c, r);
  }
  static _hue2rgb(e, t, n) {
    return (
      n < 0 && (n += 1),
      n > 1 && (n -= 1),
      n < 1 / 6 ? e + 6 * (t - e) * n : n < 0.5 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e
    );
  }
  static toRGBA(e) {
    const t = e.h / 360,
      { s: n, l: i, a: r } = e;
    let o, s, a;
    if (0 === n) o = s = a = i;
    else {
      const e = i < 0.5 ? i * (1 + n) : i + n - i * n,
        r = 2 * i - e;
      ((o = mG._hue2rgb(r, e, t + 1 / 3)),
        (s = mG._hue2rgb(r, e, t)),
        (a = mG._hue2rgb(r, e, t - 1 / 3)));
    }
    return new fG(Math.round(255 * o), Math.round(255 * s), Math.round(255 * a), r);
  }
}
class _G {
  constructor(e, t, n, i) {
    ((this._hsvaBrand = void 0),
      (this.h = 0 | Math.max(Math.min(360, e), 0)),
      (this.s = pG(Math.max(Math.min(1, t), 0), 3)),
      (this.v = pG(Math.max(Math.min(1, n), 0), 3)),
      (this.a = pG(Math.max(Math.min(1, i), 0), 3)));
  }
  static equals(e, t) {
    return e.h === t.h && e.s === t.s && e.v === t.v && e.a === t.a;
  }
  static fromRGBA(e) {
    const t = e.r / 255,
      n = e.g / 255,
      i = e.b / 255,
      r = Math.max(t, n, i),
      o = r - Math.min(t, n, i),
      s = 0 === r ? 0 : o / r;
    let a;
    return (
      (a =
        0 === o
          ? 0
          : r === t
            ? ((((n - i) / o) % 6) + 6) % 6
            : r === n
              ? (i - t) / o + 2
              : (t - n) / o + 4),
      new _G(Math.round(60 * a), s, r, e.a)
    );
  }
  static toRGBA(e) {
    const { h: t, s: n, v: i, a: r } = e,
      o = i * n,
      s = o * (1 - Math.abs(((t / 60) % 2) - 1)),
      a = i - o;
    let [l, c, d] = [0, 0, 0];
    return (
      t < 60
        ? ((l = o), (c = s))
        : t < 120
          ? ((l = s), (c = o))
          : t < 180
            ? ((c = o), (d = s))
            : t < 240
              ? ((c = s), (d = o))
              : t < 300
                ? ((l = s), (d = o))
                : t <= 360 && ((l = o), (d = s)),
      (l = Math.round(255 * (l + a))),
      (c = Math.round(255 * (c + a))),
      (d = Math.round(255 * (d + a))),
      new fG(l, c, d, r)
    );
  }
}
let vG = class e {
  static fromHex(t) {
    return e.Format.CSS.parseHex(t) || e.red;
  }
  static equals(e, t) {
    return (!e && !t) || (!(!e || !t) && e.equals(t));
  }
  get hsla() {
    return this._hsla ? this._hsla : mG.fromRGBA(this.rgba);
  }
  get hsva() {
    return this._hsva ? this._hsva : _G.fromRGBA(this.rgba);
  }
  constructor(e) {
    if (!e) throw new Error("Color needs a value");
    if (e instanceof fG) this.rgba = e;
    else if (e instanceof mG) ((this._hsla = e), (this.rgba = mG.toRGBA(e)));
    else {
      if (!(e instanceof _G)) throw new Error("Invalid color ctor argument");
      ((this._hsva = e), (this.rgba = _G.toRGBA(e)));
    }
  }
  equals(e) {
    return (
      !!e &&
      fG.equals(this.rgba, e.rgba) &&
      mG.equals(this.hsla, e.hsla) &&
      _G.equals(this.hsva, e.hsva)
    );
  }
  getRelativeLuminance() {
    return pG(
      0.2126 * e._relativeLuminanceForComponent(this.rgba.r) +
        0.7152 * e._relativeLuminanceForComponent(this.rgba.g) +
        0.0722 * e._relativeLuminanceForComponent(this.rgba.b),
      4,
    );
  }
  static _relativeLuminanceForComponent(e) {
    const t = e / 255;
    return t <= 0.03928 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
  }
  isLighter() {
    return (299 * this.rgba.r + 587 * this.rgba.g + 114 * this.rgba.b) / 1e3 >= 128;
  }
  isLighterThan(e) {
    return this.getRelativeLuminance() > e.getRelativeLuminance();
  }
  isDarkerThan(e) {
    return this.getRelativeLuminance() < e.getRelativeLuminance();
  }
  lighten(t) {
    return new e(new mG(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * t, this.hsla.a));
  }
  darken(t) {
    return new e(new mG(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * t, this.hsla.a));
  }
  transparent(t) {
    const { r: n, g: i, b: r, a: o } = this.rgba;
    return new e(new fG(n, i, r, o * t));
  }
  isTransparent() {
    return 0 === this.rgba.a;
  }
  isOpaque() {
    return 1 === this.rgba.a;
  }
  opposite() {
    return new e(new fG(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a));
  }
  mix(t, n = 0.5) {
    const i = Math.min(Math.max(n, 0), 1),
      r = this.rgba,
      o = t.rgba,
      s = r.r + (o.r - r.r) * i,
      a = r.g + (o.g - r.g) * i,
      l = r.b + (o.b - r.b) * i,
      c = r.a + (o.a - r.a) * i;
    return new e(new fG(s, a, l, c));
  }
  makeOpaque(t) {
    if (this.isOpaque() || 1 !== t.rgba.a) return this;
    const { r: n, g: i, b: r, a: o } = this.rgba;
    return new e(
      new fG(
        t.rgba.r - o * (t.rgba.r - n),
        t.rgba.g - o * (t.rgba.g - i),
        t.rgba.b - o * (t.rgba.b - r),
        1,
      ),
    );
  }
  toString() {
    return (this._toString || (this._toString = e.Format.CSS.format(this)), this._toString);
  }
  toNumber32Bit() {
    return (
      this._toNumber32Bit ||
        (this._toNumber32Bit =
          ((this.rgba.r << 24) | (this.rgba.g << 16) | (this.rgba.b << 8) | (255 * this.rgba.a)) >>>
          0),
      this._toNumber32Bit
    );
  }
  static getLighterColor(e, t, n) {
    if (e.isLighterThan(t)) return e;
    n = n || 0.5;
    const i = e.getRelativeLuminance(),
      r = t.getRelativeLuminance();
    return ((n = (n * (r - i)) / r), e.lighten(n));
  }
  static getDarkerColor(e, t, n) {
    if (e.isDarkerThan(t)) return e;
    n = n || 0.5;
    const i = e.getRelativeLuminance();
    return ((n = (n * (i - t.getRelativeLuminance())) / i), e.darken(n));
  }
  static {
    this.white = new e(new fG(255, 255, 255, 1));
  }
  static {
    this.black = new e(new fG(0, 0, 0, 1));
  }
  static {
    this.red = new e(new fG(255, 0, 0, 1));
  }
  static {
    this.blue = new e(new fG(0, 0, 255, 1));
  }
  static {
    this.green = new e(new fG(0, 255, 0, 1));
  }
  static {
    this.cyan = new e(new fG(0, 255, 255, 1));
  }
  static {
    this.lightgrey = new e(new fG(211, 211, 211, 1));
  }
  static {
    this.transparent = new e(new fG(0, 0, 0, 0));
  }
};
function bG(e) {
  return `--vscode-${e.replace(/\./g, "-")}`;
}
function yG(e) {
  return `var(${bG(e)})`;
}
function xG(e, t) {
  return `var(${bG(e)}, ${t})`;
}
!(function (e) {
  var t;
  (function (t) {
    function n(e) {
      const t = e.toString(16);
      return 2 !== t.length ? "0" + t : t;
    }
    function i(t) {
      const n = t.length;
      if (0 === n) return null;
      if (35 !== t.charCodeAt(0)) return null;
      if (7 === n) {
        const n = 16 * r(t.charCodeAt(1)) + r(t.charCodeAt(2)),
          i = 16 * r(t.charCodeAt(3)) + r(t.charCodeAt(4)),
          o = 16 * r(t.charCodeAt(5)) + r(t.charCodeAt(6));
        return new e(new fG(n, i, o, 1));
      }
      if (9 === n) {
        const n = 16 * r(t.charCodeAt(1)) + r(t.charCodeAt(2)),
          i = 16 * r(t.charCodeAt(3)) + r(t.charCodeAt(4)),
          o = 16 * r(t.charCodeAt(5)) + r(t.charCodeAt(6)),
          s = 16 * r(t.charCodeAt(7)) + r(t.charCodeAt(8));
        return new e(new fG(n, i, o, s / 255));
      }
      if (4 === n) {
        const n = r(t.charCodeAt(1)),
          i = r(t.charCodeAt(2)),
          o = r(t.charCodeAt(3));
        return new e(new fG(16 * n + n, 16 * i + i, 16 * o + o));
      }
      if (5 === n) {
        const n = r(t.charCodeAt(1)),
          i = r(t.charCodeAt(2)),
          o = r(t.charCodeAt(3)),
          s = r(t.charCodeAt(4));
        return new e(new fG(16 * n + n, 16 * i + i, 16 * o + o, (16 * s + s) / 255));
      }
      return null;
    }
    function r(e) {
      switch (e) {
        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:
        case 65:
          return 10;
        case 98:
        case 66:
          return 11;
        case 99:
        case 67:
          return 12;
        case 100:
        case 68:
          return 13;
        case 101:
        case 69:
          return 14;
        case 102:
        case 70:
          return 15;
      }
      return 0;
    }
    ((t.formatRGB = function (t) {
      return 1 === t.rgba.a
        ? `rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`
        : e.Format.CSS.formatRGBA(t);
    }),
      (t.formatRGBA = function (e) {
        return `rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`;
      }),
      (t.formatHSL = function (t) {
        return 1 === t.hsla.a
          ? `hsl(${t.hsla.h}, ${Math.round(100 * t.hsla.s)}%, ${Math.round(100 * t.hsla.l)}%)`
          : e.Format.CSS.formatHSLA(t);
      }),
      (t.formatHSLA = function (e) {
        return `hsla(${e.hsla.h}, ${Math.round(100 * e.hsla.s)}%, ${Math.round(100 * e.hsla.l)}%, ${e.hsla.a.toFixed(2)})`;
      }),
      (t.formatHex = function (e) {
        return `#${n(e.rgba.r)}${n(e.rgba.g)}${n(e.rgba.b)}`;
      }),
      (t.formatHexA = function (t, i = !1) {
        return i && 1 === t.rgba.a
          ? e.Format.CSS.formatHex(t)
          : `#${n(t.rgba.r)}${n(t.rgba.g)}${n(t.rgba.b)}${n(Math.round(255 * t.rgba.a))}`;
      }),
      (t.format = function (t) {
        return t.isOpaque() ? e.Format.CSS.formatHex(t) : e.Format.CSS.formatRGBA(t);
      }),
      (t.parse = function (t) {
        if ("transparent" === t) return e.transparent;
        if (t.startsWith("#")) return i(t);
        if (t.startsWith("rgba(")) {
          const n = t.match(
            /rgba\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+), *(?<a>(?:\+|-)?\d+(\.\d+)?)\)/,
          );
          if (!n) throw new Error("Invalid color format " + t);
          const i = parseInt(n.groups?.r ?? "0"),
            r = parseInt(n.groups?.g ?? "0"),
            o = parseInt(n.groups?.b ?? "0"),
            s = parseFloat(n.groups?.a ?? "0");
          return new e(new fG(i, r, o, s));
        }
        if (t.startsWith("rgb(")) {
          const n = t.match(/rgb\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+)\)/);
          if (!n) throw new Error("Invalid color format " + t);
          const i = parseInt(n.groups?.r ?? "0"),
            r = parseInt(n.groups?.g ?? "0"),
            o = parseInt(n.groups?.b ?? "0");
          return new e(new fG(i, r, o));
        }
        return (function (t) {
          switch (t) {
            case "aliceblue":
              return new e(new fG(240, 248, 255, 1));
            case "antiquewhite":
              return new e(new fG(250, 235, 215, 1));
            case "aqua":
            case "cyan":
              return new e(new fG(0, 255, 255, 1));
            case "aquamarine":
              return new e(new fG(127, 255, 212, 1));
            case "azure":
              return new e(new fG(240, 255, 255, 1));
            case "beige":
              return new e(new fG(245, 245, 220, 1));
            case "bisque":
              return new e(new fG(255, 228, 196, 1));
            case "black":
              return new e(new fG(0, 0, 0, 1));
            case "blanchedalmond":
              return new e(new fG(255, 235, 205, 1));
            case "blue":
              return new e(new fG(0, 0, 255, 1));
            case "blueviolet":
              return new e(new fG(138, 43, 226, 1));
            case "brown":
              return new e(new fG(165, 42, 42, 1));
            case "burlywood":
              return new e(new fG(222, 184, 135, 1));
            case "cadetblue":
              return new e(new fG(95, 158, 160, 1));
            case "chartreuse":
              return new e(new fG(127, 255, 0, 1));
            case "chocolate":
              return new e(new fG(210, 105, 30, 1));
            case "coral":
              return new e(new fG(255, 127, 80, 1));
            case "cornflowerblue":
              return new e(new fG(100, 149, 237, 1));
            case "cornsilk":
              return new e(new fG(255, 248, 220, 1));
            case "crimson":
              return new e(new fG(220, 20, 60, 1));
            case "darkblue":
              return new e(new fG(0, 0, 139, 1));
            case "darkcyan":
              return new e(new fG(0, 139, 139, 1));
            case "darkgoldenrod":
              return new e(new fG(184, 134, 11, 1));
            case "darkgray":
            case "darkgrey":
              return new e(new fG(169, 169, 169, 1));
            case "darkgreen":
              return new e(new fG(0, 100, 0, 1));
            case "darkkhaki":
              return new e(new fG(189, 183, 107, 1));
            case "darkmagenta":
              return new e(new fG(139, 0, 139, 1));
            case "darkolivegreen":
              return new e(new fG(85, 107, 47, 1));
            case "darkorange":
              return new e(new fG(255, 140, 0, 1));
            case "darkorchid":
              return new e(new fG(153, 50, 204, 1));
            case "darkred":
              return new e(new fG(139, 0, 0, 1));
            case "darksalmon":
              return new e(new fG(233, 150, 122, 1));
            case "darkseagreen":
              return new e(new fG(143, 188, 143, 1));
            case "darkslateblue":
              return new e(new fG(72, 61, 139, 1));
            case "darkslategray":
            case "darkslategrey":
              return new e(new fG(47, 79, 79, 1));
            case "darkturquoise":
              return new e(new fG(0, 206, 209, 1));
            case "darkviolet":
              return new e(new fG(148, 0, 211, 1));
            case "deeppink":
              return new e(new fG(255, 20, 147, 1));
            case "deepskyblue":
              return new e(new fG(0, 191, 255, 1));
            case "dimgray":
            case "dimgrey":
              return new e(new fG(105, 105, 105, 1));
            case "dodgerblue":
              return new e(new fG(30, 144, 255, 1));
            case "firebrick":
              return new e(new fG(178, 34, 34, 1));
            case "floralwhite":
              return new e(new fG(255, 250, 240, 1));
            case "forestgreen":
              return new e(new fG(34, 139, 34, 1));
            case "fuchsia":
            case "magenta":
              return new e(new fG(255, 0, 255, 1));
            case "gainsboro":
              return new e(new fG(220, 220, 220, 1));
            case "ghostwhite":
              return new e(new fG(248, 248, 255, 1));
            case "gold":
              return new e(new fG(255, 215, 0, 1));
            case "goldenrod":
              return new e(new fG(218, 165, 32, 1));
            case "gray":
            case "grey":
              return new e(new fG(128, 128, 128, 1));
            case "green":
              return new e(new fG(0, 128, 0, 1));
            case "greenyellow":
              return new e(new fG(173, 255, 47, 1));
            case "honeydew":
              return new e(new fG(240, 255, 240, 1));
            case "hotpink":
              return new e(new fG(255, 105, 180, 1));
            case "indianred":
              return new e(new fG(205, 92, 92, 1));
            case "indigo":
              return new e(new fG(75, 0, 130, 1));
            case "ivory":
              return new e(new fG(255, 255, 240, 1));
            case "khaki":
              return new e(new fG(240, 230, 140, 1));
            case "lavender":
              return new e(new fG(230, 230, 250, 1));
            case "lavenderblush":
              return new e(new fG(255, 240, 245, 1));
            case "lawngreen":
              return new e(new fG(124, 252, 0, 1));
            case "lemonchiffon":
              return new e(new fG(255, 250, 205, 1));
            case "lightblue":
              return new e(new fG(173, 216, 230, 1));
            case "lightcoral":
              return new e(new fG(240, 128, 128, 1));
            case "lightcyan":
              return new e(new fG(224, 255, 255, 1));
            case "lightgoldenrodyellow":
              return new e(new fG(250, 250, 210, 1));
            case "lightgray":
            case "lightgrey":
              return new e(new fG(211, 211, 211, 1));
            case "lightgreen":
              return new e(new fG(144, 238, 144, 1));
            case "lightpink":
              return new e(new fG(255, 182, 193, 1));
            case "lightsalmon":
              return new e(new fG(255, 160, 122, 1));
            case "lightseagreen":
              return new e(new fG(32, 178, 170, 1));
            case "lightskyblue":
              return new e(new fG(135, 206, 250, 1));
            case "lightslategray":
            case "lightslategrey":
              return new e(new fG(119, 136, 153, 1));
            case "lightsteelblue":
              return new e(new fG(176, 196, 222, 1));
            case "lightyellow":
              return new e(new fG(255, 255, 224, 1));
            case "lime":
              return new e(new fG(0, 255, 0, 1));
            case "limegreen":
              return new e(new fG(50, 205, 50, 1));
            case "linen":
              return new e(new fG(250, 240, 230, 1));
            case "maroon":
              return new e(new fG(128, 0, 0, 1));
            case "mediumaquamarine":
              return new e(new fG(102, 205, 170, 1));
            case "mediumblue":
              return new e(new fG(0, 0, 205, 1));
            case "mediumorchid":
              return new e(new fG(186, 85, 211, 1));
            case "mediumpurple":
              return new e(new fG(147, 112, 219, 1));
            case "mediumseagreen":
              return new e(new fG(60, 179, 113, 1));
            case "mediumslateblue":
              return new e(new fG(123, 104, 238, 1));
            case "mediumspringgreen":
              return new e(new fG(0, 250, 154, 1));
            case "mediumturquoise":
              return new e(new fG(72, 209, 204, 1));
            case "mediumvioletred":
              return new e(new fG(199, 21, 133, 1));
            case "midnightblue":
              return new e(new fG(25, 25, 112, 1));
            case "mintcream":
              return new e(new fG(245, 255, 250, 1));
            case "mistyrose":
              return new e(new fG(255, 228, 225, 1));
            case "moccasin":
              return new e(new fG(255, 228, 181, 1));
            case "navajowhite":
              return new e(new fG(255, 222, 173, 1));
            case "navy":
              return new e(new fG(0, 0, 128, 1));
            case "oldlace":
              return new e(new fG(253, 245, 230, 1));
            case "olive":
              return new e(new fG(128, 128, 0, 1));
            case "olivedrab":
              return new e(new fG(107, 142, 35, 1));
            case "orange":
              return new e(new fG(255, 165, 0, 1));
            case "orangered":
              return new e(new fG(255, 69, 0, 1));
            case "orchid":
              return new e(new fG(218, 112, 214, 1));
            case "palegoldenrod":
              return new e(new fG(238, 232, 170, 1));
            case "palegreen":
              return new e(new fG(152, 251, 152, 1));
            case "paleturquoise":
              return new e(new fG(175, 238, 238, 1));
            case "palevioletred":
              return new e(new fG(219, 112, 147, 1));
            case "papayawhip":
              return new e(new fG(255, 239, 213, 1));
            case "peachpuff":
              return new e(new fG(255, 218, 185, 1));
            case "peru":
              return new e(new fG(205, 133, 63, 1));
            case "pink":
              return new e(new fG(255, 192, 203, 1));
            case "plum":
              return new e(new fG(221, 160, 221, 1));
            case "powderblue":
              return new e(new fG(176, 224, 230, 1));
            case "purple":
              return new e(new fG(128, 0, 128, 1));
            case "rebeccapurple":
              return new e(new fG(102, 51, 153, 1));
            case "red":
              return new e(new fG(255, 0, 0, 1));
            case "rosybrown":
              return new e(new fG(188, 143, 143, 1));
            case "royalblue":
              return new e(new fG(65, 105, 225, 1));
            case "saddlebrown":
              return new e(new fG(139, 69, 19, 1));
            case "salmon":
              return new e(new fG(250, 128, 114, 1));
            case "sandybrown":
              return new e(new fG(244, 164, 96, 1));
            case "seagreen":
              return new e(new fG(46, 139, 87, 1));
            case "seashell":
              return new e(new fG(255, 245, 238, 1));
            case "sienna":
              return new e(new fG(160, 82, 45, 1));
            case "silver":
              return new e(new fG(192, 192, 192, 1));
            case "skyblue":
              return new e(new fG(135, 206, 235, 1));
            case "slateblue":
              return new e(new fG(106, 90, 205, 1));
            case "slategray":
            case "slategrey":
              return new e(new fG(112, 128, 144, 1));
            case "snow":
              return new e(new fG(255, 250, 250, 1));
            case "springgreen":
              return new e(new fG(0, 255, 127, 1));
            case "steelblue":
              return new e(new fG(70, 130, 180, 1));
            case "tan":
              return new e(new fG(210, 180, 140, 1));
            case "teal":
              return new e(new fG(0, 128, 128, 1));
            case "thistle":
              return new e(new fG(216, 191, 216, 1));
            case "tomato":
              return new e(new fG(255, 99, 71, 1));
            case "turquoise":
              return new e(new fG(64, 224, 208, 1));
            case "violet":
              return new e(new fG(238, 130, 238, 1));
            case "wheat":
              return new e(new fG(245, 222, 179, 1));
            case "white":
              return new e(new fG(255, 255, 255, 1));
            case "whitesmoke":
              return new e(new fG(245, 245, 245, 1));
            case "yellow":
              return new e(new fG(255, 255, 0, 1));
            case "yellowgreen":
              return new e(new fG(154, 205, 50, 1));
            default:
              return null;
          }
        })(t);
      }),
      (t.parseHex = i));
  })((t = e.Format || (e.Format = {})).CSS || (t.CSS = {}));
})(vG || (vG = {}));
const wG = "base.contributions.colors";
const CG = new (class extends PO {
  constructor() {
    (super(),
      (this._onDidChangeSchema = this._register(new QO())),
      (this.onDidChangeSchema = this._onDidChangeSchema.event),
      (this.colorSchema = { type: "object", properties: {} }),
      (this.colorReferenceSchema = { type: "string", enum: [], enumDescriptions: [] }),
      (this.colorsById = {}));
  }
  registerColor(e, t, n, i = !1, r) {
    const o = { id: e, description: n, defaults: t, needsTransparency: i, deprecationMessage: r };
    this.colorsById[e] = o;
    const s = { type: "string", format: "color-hex", defaultSnippets: [{ body: "${1:#ff0000}" }] };
    return (
      r && (s.deprecationMessage = r),
      i &&
        ((s.pattern =
          "^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$"),
        (s.patternErrorMessage = SI(
          2022,
          "This color must be transparent or it will obscure content",
        ))),
      (this.colorSchema.properties[e] = {
        description: n,
        oneOf: [
          s,
          { type: "string", const: "default", description: SI(2023, "Use the default color.") },
        ],
      }),
      this.colorReferenceSchema.enum.push(e),
      this.colorReferenceSchema.enumDescriptions.push(n),
      this._onDidChangeSchema.fire(),
      e
    );
  }
  getColors() {
    return Object.keys(this.colorsById).map((e) => this.colorsById[e]);
  }
  resolveDefaultColor(e, t) {
    const n = this.colorsById[e];
    if (n?.defaults) {
      return TG(
        null !== (i = n.defaults) && "object" == typeof i && "light" in i && "dark" in i
          ? n.defaults[t.type]
          : n.defaults,
        t,
      );
    }
    var i;
  }
  getColorSchema() {
    return this.colorSchema;
  }
  toString() {
    return Object.keys(this.colorsById)
      .sort((e, t) => {
        const n = -1 === e.indexOf(".") ? 0 : 1,
          i = -1 === t.indexOf(".") ? 0 : 1;
        return n !== i ? n - i : e.localeCompare(t);
      })
      .map((e) => `- \`${e}\`: ${this.colorsById[e].description}`)
      .join("\n");
  }
})();
function SG(e, t, n, i, r) {
  return CG.registerColor(e, t, n, i, r);
}
function kG(e, t) {
  return { op: 0, value: e, factor: t };
}
function EG(e, t) {
  return { op: 1, value: e, factor: t };
}
function NG(e, t) {
  return { op: 2, value: e, factor: t };
}
function LG(...e) {
  return { op: 4, values: e };
}
function DG(e, t, n, i) {
  return { op: 5, value: e, background: t, factor: n, transparency: i };
}
function TG(e, t) {
  if (null !== e)
    return "string" == typeof e
      ? "#" === e[0]
        ? vG.fromHex(e)
        : t.getColor(e)
      : e instanceof vG
        ? e
        : "object" == typeof e
          ? (function (e, t) {
              switch (e.op) {
                case 0:
                  return TG(e.value, t)?.darken(e.factor);
                case 1:
                  return TG(e.value, t)?.lighten(e.factor);
                case 2:
                  return TG(e.value, t)?.transparent(e.factor);
                case 7: {
                  const n = TG(e.color, t) || vG.transparent,
                    i = TG(e.with, t) || vG.transparent;
                  return n.mix(i, e.ratio);
                }
                case 3: {
                  const n = TG(e.background, t);
                  return n ? TG(e.value, t)?.makeOpaque(n) : TG(e.value, t);
                }
                case 4:
                  for (const n of e.values) {
                    const e = TG(n, t);
                    if (e) return e;
                  }
                  return;
                case 6:
                  return TG(t.defines(e.if) ? e.then : e.else, t);
                case 5: {
                  const n = TG(e.value, t);
                  if (!n) return;
                  const i = TG(e.background, t);
                  return i
                    ? n.isDarkerThan(i)
                      ? vG.getLighterColor(n, i, e.factor).transparent(e.transparency)
                      : vG.getDarkerColor(n, i, e.factor).transparent(e.transparency)
                    : n.transparent(e.factor * e.transparency);
                }
                default:
                  throw eR();
              }
            })(e, t)
          : void 0;
}
NW.add(wG, CG);
const IG = "vscode://schemas/workbench-colors",
  RG = NW.as($U);
RG.registerSchema(IG, CG.getColorSchema());
const OG = new EM(() => RG.notifySchemaChanged(IG), 200);
CG.onDidChangeSchema(() => {
  OG.isScheduled() || OG.schedule();
});
const MG = SG(
  "foreground",
  { dark: "#CCCCCC", light: "#616161", hcDark: "#FFFFFF", hcLight: "#292929" },
  SI(1773, "Overall foreground color. This color is only used if not overridden by a component."),
);
(SG(
  "disabledForeground",
  { dark: "#CCCCCC80", light: "#61616180", hcDark: "#A5A5A5", hcLight: "#7F7F7F" },
  SI(
    1774,
    "Overall foreground for disabled elements. This color is only used if not overridden by a component.",
  ),
),
  SG(
    "errorForeground",
    { dark: "#F48771", light: "#A1260D", hcDark: "#F48771", hcLight: "#B5200D" },
    SI(
      1775,
      "Overall foreground color for error messages. This color is only used if not overridden by a component.",
    ),
  ));
const AG = SG(
    "descriptionForeground",
    { light: "#717171", dark: NG(MG, 0.7), hcDark: NG(MG, 0.7), hcLight: NG(MG, 0.7) },
    SI(
      1776,
      "Foreground color for description text providing additional information, for example for a label.",
    ),
  ),
  PG = SG(
    "icon.foreground",
    { dark: "#C5C5C5", light: "#424242", hcDark: "#FFFFFF", hcLight: "#292929" },
    SI(1777, "The default color for icons in the workbench."),
  ),
  jG = SG(
    "focusBorder",
    { dark: "#007FD4", light: "#0090F1", hcDark: "#F38518", hcLight: "#006BBD" },
    SI(
      1778,
      "Overall border color for focused elements. This color is only used if not overridden by a component.",
    ),
  ),
  FG = SG(
    "contrastBorder",
    { light: null, dark: null, hcDark: "#6FC3DF", hcLight: "#0F4A85" },
    SI(1779, "An extra border around elements to separate them from others for greater contrast."),
  ),
  BG = SG(
    "contrastActiveBorder",
    { light: null, dark: null, hcDark: jG, hcLight: jG },
    SI(
      1780,
      "An extra border around active elements to separate them from others for greater contrast.",
    ),
  );
SG(
  "selection.background",
  null,
  SI(
    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.",
  ),
);
const VG = SG(
  "textLink.foreground",
  { light: "#006AB1", dark: "#3794FF", hcDark: "#21A6FF", hcLight: "#0F4A85" },
  SI(1782, "Foreground color for links in text."),
);
(SG(
  "textLink.activeForeground",
  { light: "#006AB1", dark: "#3794FF", hcDark: "#21A6FF", hcLight: "#0F4A85" },
  SI(1783, "Foreground color for links in text when clicked on and on mouse hover."),
),
  SG(
    "textSeparator.foreground",
    { light: "#0000002e", dark: "#ffffff2e", hcDark: vG.black, hcLight: "#292929" },
    SI(1784, "Color for text separators."),
  ),
  SG(
    "textPreformat.foreground",
    { light: "#A31515", dark: "#D7BA7D", hcDark: "#000000", hcLight: "#FFFFFF" },
    SI(1785, "Foreground color for preformatted text segments."),
  ),
  SG(
    "textPreformat.background",
    { light: "#0000001A", dark: "#FFFFFF1A", hcDark: "#FFFFFF", hcLight: "#09345f" },
    SI(1786, "Background color for preformatted text segments."),
  ),
  SG(
    "textBlockQuote.background",
    { light: "#f2f2f2", dark: "#222222", hcDark: null, hcLight: "#F2F2F2" },
    SI(1787, "Background color for block quotes in text."),
  ),
  SG(
    "textBlockQuote.border",
    { light: "#007acc80", dark: "#007acc80", hcDark: vG.white, hcLight: "#292929" },
    SI(1788, "Border color for block quotes in text."),
  ),
  SG(
    "textCodeBlock.background",
    { light: "#dcdcdc66", dark: "#0a0a0a66", hcDark: vG.black, hcLight: "#F2F2F2" },
    SI(1789, "Background color for code blocks in text."),
  ),
  SG("sash.hoverBorder", jG, SI(1994, "Border color of active sashes.")));
const WG = SG(
    "badge.background",
    { dark: "#4D4D4D", light: "#C4C4C4", hcDark: vG.black, hcLight: "#0F4A85" },
    SI(
      1995,
      "Badge background color. Badges are small information labels, e.g. for search results count.",
    ),
  ),
  HG = SG(
    "badge.foreground",
    { dark: vG.white, light: "#333", hcDark: vG.white, hcLight: vG.white },
    SI(
      1996,
      "Badge foreground color. Badges are small information labels, e.g. for search results count.",
    ),
  );
(SG(
  "activityWarningBadge.foreground",
  { dark: vG.black.lighten(0.2), light: vG.white, hcDark: null, hcLight: vG.black.lighten(0.2) },
  SI(1997, "Foreground color of the warning activity badge"),
),
  SG(
    "activityWarningBadge.background",
    { dark: "#CCA700", light: "#BF8803", hcDark: null, hcLight: "#CCA700" },
    SI(1998, "Background color of the warning activity badge"),
  ),
  SG(
    "activityErrorBadge.foreground",
    { dark: vG.black.lighten(0.2), light: vG.white, hcDark: null, hcLight: vG.black.lighten(0.2) },
    SI(1999, "Foreground color of the error activity badge"),
  ),
  SG(
    "activityErrorBadge.background",
    { dark: "#F14C4C", light: "#E51400", hcDark: null, hcLight: "#F14C4C" },
    SI(2e3, "Background color of the error activity badge"),
  ));
const zG = SG(
    "scrollbar.shadow",
    { dark: "#000000", light: "#DDDDDD", hcDark: null, hcLight: null },
    SI(2001, "Scrollbar shadow to indicate that the view is scrolled."),
  ),
  UG = SG(
    "scrollbarSlider.background",
    {
      dark: vG.fromHex("#797979").transparent(0.4),
      light: vG.fromHex("#646464").transparent(0.4),
      hcDark: NG(FG, 0.6),
      hcLight: NG(FG, 0.4),
    },
    SI(2002, "Scrollbar slider background color."),
  ),
  $G = SG(
    "scrollbarSlider.hoverBackground",
    {
      dark: vG.fromHex("#646464").transparent(0.7),
      light: vG.fromHex("#646464").transparent(0.7),
      hcDark: NG(FG, 0.8),
      hcLight: NG(FG, 0.8),
    },
    SI(2003, "Scrollbar slider background color when hovering."),
  ),
  qG = SG(
    "scrollbarSlider.activeBackground",
    {
      dark: vG.fromHex("#BFBFBF").transparent(0.4),
      light: vG.fromHex("#000000").transparent(0.6),
      hcDark: FG,
      hcLight: FG,
    },
    SI(2004, "Scrollbar slider background color when clicked on."),
  );
SG("scrollbar.background", null, SI(2005, "Scrollbar track background color."));
const KG = SG(
  "progressBar.background",
  { dark: vG.fromHex("#0E70C0"), light: vG.fromHex("#0E70C0"), hcDark: FG, hcLight: FG },
  SI(2006, "Background color of the progress bar that can show for long running operations."),
);
(SG(
  "chart.line",
  { dark: "#236B8E", light: "#236B8E", hcDark: "#236B8E", hcLight: "#236B8E" },
  SI(2007, "Line color for the chart."),
),
  SG(
    "chart.axis",
    {
      dark: vG.fromHex("#BFBFBF").transparent(0.4),
      light: vG.fromHex("#000000").transparent(0.6),
      hcDark: FG,
      hcLight: FG,
    },
    SI(2008, "Axis color for the chart."),
  ),
  SG(
    "chart.guide",
    {
      dark: vG.fromHex("#BFBFBF").transparent(0.2),
      light: vG.fromHex("#000000").transparent(0.2),
      hcDark: FG,
      hcLight: FG,
    },
    SI(2009, "Guide line for the chart."),
  ));
const GG = SG(
    "editor.background",
    { light: "#ffffff", dark: "#1E1E1E", hcDark: vG.black, hcLight: vG.white },
    SI(1798, "Editor background color."),
  ),
  ZG = SG(
    "editor.foreground",
    { light: "#333333", dark: "#BBBBBB", hcDark: vG.white, hcLight: MG },
    SI(1799, "Editor default foreground color."),
  );
(SG(
  "editorStickyScroll.background",
  GG,
  SI(1800, "Background color of sticky scroll in the editor"),
),
  SG(
    "editorStickyScrollGutter.background",
    GG,
    SI(1801, "Background color of the gutter part of sticky scroll in the editor"),
  ),
  SG(
    "editorStickyScrollHover.background",
    {
      dark: "#2A2D2E",
      light: "#F0F0F0",
      hcDark: null,
      hcLight: vG.fromHex("#0F4A85").transparent(0.1),
    },
    SI(1802, "Background color of sticky scroll on hover in the editor"),
  ),
  SG(
    "editorStickyScroll.border",
    { dark: null, light: null, hcDark: FG, hcLight: FG },
    SI(1803, "Border color of sticky scroll in the editor"),
  ),
  SG("editorStickyScroll.shadow", zG, SI(1804, " Shadow color of sticky scroll in the editor")));
const YG = SG(
    "editorWidget.background",
    { dark: "#252526", light: "#F3F3F3", hcDark: "#0C141F", hcLight: vG.white },
    SI(1805, "Background color of editor widgets, such as find/replace."),
  ),
  XG = SG(
    "editorWidget.foreground",
    MG,
    SI(1806, "Foreground color of editor widgets, such as find/replace."),
  ),
  QG = SG(
    "editorWidget.border",
    { dark: "#454545", light: "#C8C8C8", hcDark: FG, hcLight: FG },
    SI(
      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.",
    ),
  );
(SG(
  "editorWidget.resizeBorder",
  null,
  SI(
    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.",
  ),
),
  SG(
    "editorError.background",
    null,
    SI(
      1809,
      "Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ));
const JG = SG(
    "editorError.foreground",
    { dark: "#F14C4C", light: "#E51400", hcDark: "#F48771", hcLight: "#B5200D" },
    SI(1810, "Foreground color of error squigglies in the editor."),
  ),
  eZ = SG(
    "editorError.border",
    { dark: null, light: null, hcDark: vG.fromHex("#E47777").transparent(0.8), hcLight: "#B5200D" },
    SI(1811, "If set, color of double underlines for errors in the editor."),
  ),
  tZ = SG(
    "editorWarning.background",
    null,
    SI(
      1812,
      "Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  nZ = SG(
    "editorWarning.foreground",
    { dark: "#CCA700", light: "#BF8803", hcDark: "#FFD370", hcLight: "#895503" },
    SI(1813, "Foreground color of warning squigglies in the editor."),
  ),
  iZ = SG(
    "editorWarning.border",
    {
      dark: null,
      light: null,
      hcDark: vG.fromHex("#FFCC00").transparent(0.8),
      hcLight: vG.fromHex("#FFCC00").transparent(0.8),
    },
    SI(1814, "If set, color of double underlines for warnings in the editor."),
  );
SG(
  "editorInfo.background",
  null,
  SI(
    1815,
    "Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
);
const rZ = SG(
    "editorInfo.foreground",
    { dark: "#3794FF", light: "#1a85ff", hcDark: "#3794FF", hcLight: "#1a85ff" },
    SI(1816, "Foreground color of info squigglies in the editor."),
  ),
  oZ = SG(
    "editorInfo.border",
    { dark: null, light: null, hcDark: vG.fromHex("#3794FF").transparent(0.8), hcLight: "#292929" },
    SI(1817, "If set, color of double underlines for infos in the editor."),
  ),
  sZ = SG(
    "editorHint.foreground",
    { dark: vG.fromHex("#eeeeee").transparent(0.7), light: "#6c6c6c", hcDark: null, hcLight: null },
    SI(1818, "Foreground color of hint squigglies in the editor."),
  );
SG(
  "editorHint.border",
  { dark: null, light: null, hcDark: vG.fromHex("#eeeeee").transparent(0.8), hcLight: "#292929" },
  SI(1819, "If set, color of double underlines for hints in the editor."),
);
const aZ = SG(
    "editorLink.activeForeground",
    { dark: "#4E94CE", light: vG.blue, hcDark: vG.cyan, hcLight: "#292929" },
    SI(1820, "Color of active links."),
  ),
  lZ = SG(
    "editor.selectionBackground",
    { light: "#ADD6FF", dark: "#264F78", hcDark: "#f3f518", hcLight: "#0F4A85" },
    SI(1821, "Color of the editor selection."),
  ),
  cZ = SG(
    "editor.selectionForeground",
    { light: null, dark: null, hcDark: "#000000", hcLight: vG.white },
    SI(1822, "Color of the selected text for high contrast."),
  ),
  dZ = SG(
    "editor.inactiveSelectionBackground",
    { light: NG(lZ, 0.5), dark: NG(lZ, 0.5), hcDark: NG(lZ, 0.7), hcLight: NG(lZ, 0.5) },
    SI(
      1823,
      "Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  uZ = SG(
    "editor.selectionHighlightBackground",
    { light: DG(lZ, GG, 0.3, 0.6), dark: DG(lZ, GG, 0.3, 0.6), hcDark: null, hcLight: null },
    SI(
      1824,
      "Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  );
(SG(
  "editor.selectionHighlightBorder",
  { light: null, dark: null, hcDark: BG, hcLight: BG },
  SI(1825, "Border color for regions with the same content as the selection."),
),
  SG(
    "editor.compositionBorder",
    { light: "#000000", dark: "#ffffff", hcLight: "#000000", hcDark: "#ffffff" },
    SI(1826, "The border color for an IME composition."),
  ),
  SG(
    "editor.findMatchBackground",
    { light: "#A8AC94", dark: "#515C6A", hcDark: null, hcLight: null },
    SI(1827, "Color of the current search match."),
  ));
const hZ = SG(
    "editor.findMatchForeground",
    null,
    SI(1828, "Text color of the current search match."),
  ),
  gZ = SG(
    "editor.findMatchHighlightBackground",
    { light: "#EA5C0055", dark: "#EA5C0055", hcDark: null, hcLight: null },
    SI(
      1829,
      "Color of the other search matches. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  pZ = SG(
    "editor.findMatchHighlightForeground",
    null,
    SI(1830, "Foreground color of the other search matches."),
    !0,
  );
(SG(
  "editor.findRangeHighlightBackground",
  { dark: "#3a3d4166", light: "#b4b4b44d", hcDark: null, hcLight: null },
  SI(
    1831,
    "Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
),
  SG(
    "editor.findMatchBorder",
    { light: null, dark: null, hcDark: BG, hcLight: BG },
    SI(1832, "Border color of the current search match."),
  ));
const fZ = SG(
    "editor.findMatchHighlightBorder",
    { light: null, dark: null, hcDark: BG, hcLight: BG },
    SI(1833, "Border color of the other search matches."),
  ),
  mZ = SG(
    "editor.findRangeHighlightBorder",
    { dark: null, light: null, hcDark: NG(BG, 0.4), hcLight: NG(BG, 0.4) },
    SI(
      1834,
      "Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  );
SG(
  "editor.hoverHighlightBackground",
  { light: "#ADD6FF26", dark: "#264f7840", hcDark: "#ADD6FF26", hcLight: null },
  SI(
    1835,
    "Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
);
const _Z = SG(
    "editorHoverWidget.background",
    YG,
    SI(1836, "Background color of the editor hover."),
  ),
  vZ = SG("editorHoverWidget.foreground", XG, SI(1837, "Foreground color of the editor hover.")),
  bZ = SG("editorHoverWidget.border", QG, SI(1838, "Border color of the editor hover."));
SG(
  "editorHoverWidget.statusBarBackground",
  { dark: EG(_Z, 0.2), light: kG(_Z, 0.05), hcDark: YG, hcLight: YG },
  SI(1839, "Background color of the editor hover status bar."),
);
const yZ = SG(
    "editorInlayHint.foreground",
    { dark: "#969696", light: "#969696", hcDark: vG.white, hcLight: vG.black },
    SI(1840, "Foreground color of inline hints"),
  ),
  xZ = SG(
    "editorInlayHint.background",
    { dark: NG(WG, 0.1), light: NG(WG, 0.1), hcDark: NG(vG.white, 0.1), hcLight: NG(WG, 0.1) },
    SI(1841, "Background color of inline hints"),
  ),
  wZ = SG(
    "editorInlayHint.typeForeground",
    yZ,
    SI(1842, "Foreground color of inline hints for types"),
  ),
  CZ = SG(
    "editorInlayHint.typeBackground",
    xZ,
    SI(1843, "Background color of inline hints for types"),
  ),
  SZ = SG(
    "editorInlayHint.parameterForeground",
    yZ,
    SI(1844, "Foreground color of inline hints for parameters"),
  ),
  kZ = SG(
    "editorInlayHint.parameterBackground",
    xZ,
    SI(1845, "Background color of inline hints for parameters"),
  ),
  EZ = SG(
    "editorLightBulb.foreground",
    { dark: "#FFCC00", light: "#DDB100", hcDark: "#FFCC00", hcLight: "#007ACC" },
    SI(1846, "The color used for the lightbulb actions icon."),
  );
(SG(
  "editorLightBulbAutoFix.foreground",
  { dark: "#75BEFF", light: "#007ACC", hcDark: "#75BEFF", hcLight: "#007ACC" },
  SI(1847, "The color used for the lightbulb auto fix actions icon."),
),
  SG("editorLightBulbAi.foreground", EZ, SI(1848, "The color used for the lightbulb AI icon.")),
  SG(
    "editor.snippetTabstopHighlightBackground",
    {
      dark: new vG(new fG(124, 124, 124, 0.3)),
      light: new vG(new fG(10, 50, 100, 0.2)),
      hcDark: new vG(new fG(124, 124, 124, 0.3)),
      hcLight: new vG(new fG(10, 50, 100, 0.2)),
    },
    SI(1849, "Highlight background color of a snippet tabstop."),
  ),
  SG(
    "editor.snippetTabstopHighlightBorder",
    null,
    SI(1850, "Highlight border color of a snippet tabstop."),
  ),
  SG(
    "editor.snippetFinalTabstopHighlightBackground",
    null,
    SI(1851, "Highlight background color of the final tabstop of a snippet."),
  ),
  SG(
    "editor.snippetFinalTabstopHighlightBorder",
    {
      dark: "#525252",
      light: new vG(new fG(10, 50, 100, 0.5)),
      hcDark: "#525252",
      hcLight: "#292929",
    },
    SI(1852, "Highlight border color of the final tabstop of a snippet."),
  ));
const NZ = new vG(new fG(155, 185, 85, 0.2)),
  LZ = new vG(new fG(255, 0, 0, 0.2)),
  DZ = SG(
    "diffEditor.insertedTextBackground",
    { dark: "#9ccc2c33", light: "#9ccc2c40", hcDark: null, hcLight: null },
    SI(
      1853,
      "Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  TZ = SG(
    "diffEditor.removedTextBackground",
    { dark: "#ff000033", light: "#ff000033", hcDark: null, hcLight: null },
    SI(
      1854,
      "Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  IZ = SG(
    "diffEditor.insertedLineBackground",
    { dark: NZ, light: NZ, hcDark: null, hcLight: null },
    SI(
      1855,
      "Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  );
(SG(
  "diffEditor.removedLineBackground",
  { dark: LZ, light: LZ, hcDark: null, hcLight: null },
  SI(
    1856,
    "Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
),
  SG(
    "diffEditorGutter.insertedLineBackground",
    null,
    SI(1857, "Background color for the margin where lines got inserted."),
  ),
  SG(
    "diffEditorGutter.removedLineBackground",
    null,
    SI(1858, "Background color for the margin where lines got removed."),
  ));
const RZ = SG(
    "diffEditorOverview.insertedForeground",
    null,
    SI(1859, "Diff overview ruler foreground for inserted content."),
  ),
  OZ = SG(
    "diffEditorOverview.removedForeground",
    null,
    SI(1860, "Diff overview ruler foreground for removed content."),
  );
(SG(
  "diffEditor.insertedTextBorder",
  { dark: null, light: null, hcDark: "#33ff2eff", hcLight: "#374E06" },
  SI(1861, "Outline color for the text that got inserted."),
),
  SG(
    "diffEditor.removedTextBorder",
    { dark: null, light: null, hcDark: "#FF008F", hcLight: "#AD0707" },
    SI(1862, "Outline color for text that got removed."),
  ),
  SG(
    "diffEditor.border",
    { dark: null, light: null, hcDark: FG, hcLight: FG },
    SI(1863, "Border color between the two text editors."),
  ),
  SG(
    "diffEditor.diagonalFill",
    { dark: "#cccccc33", light: "#22222233", hcDark: null, hcLight: null },
    SI(
      1864,
      "Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.",
    ),
  ),
  SG(
    "diffEditor.unchangedRegionBackground",
    "sideBar.background",
    SI(1865, "The background color of unchanged blocks in the diff editor."),
  ),
  SG(
    "diffEditor.unchangedRegionForeground",
    "foreground",
    SI(1866, "The foreground color of unchanged blocks in the diff editor."),
  ),
  SG(
    "diffEditor.unchangedCodeBackground",
    { dark: "#74747429", light: "#b8b8b829", hcDark: null, hcLight: null },
    SI(1867, "The background color of unchanged code in the diff editor."),
  ));
const MZ = SG(
    "widget.shadow",
    { dark: NG(vG.black, 0.36), light: NG(vG.black, 0.16), hcDark: null, hcLight: null },
    SI(1868, "Shadow color of widgets such as find/replace inside the editor."),
  ),
  AZ = SG(
    "widget.border",
    { dark: null, light: null, hcDark: FG, hcLight: FG },
    SI(1869, "Border color of widgets such as find/replace inside the editor."),
  ),
  PZ = SG(
    "toolbar.hoverBackground",
    { dark: "#5a5d5e50", light: "#b8b8b850", hcDark: null, hcLight: null },
    SI(1870, "Toolbar background when hovering over actions using the mouse"),
  );
(SG(
  "toolbar.hoverOutline",
  { dark: null, light: null, hcDark: BG, hcLight: BG },
  SI(1871, "Toolbar outline when hovering over actions using the mouse"),
),
  SG(
    "toolbar.activeBackground",
    { dark: EG(PZ, 0.1), light: kG(PZ, 0.1), hcDark: null, hcLight: null },
    SI(1872, "Toolbar background when holding the mouse over actions"),
  ));
const jZ = SG("breadcrumb.foreground", NG(MG, 0.8), SI(1873, "Color of focused breadcrumb items.")),
  FZ = SG("breadcrumb.background", GG, SI(1874, "Background color of breadcrumb items.")),
  BZ = SG(
    "breadcrumb.focusForeground",
    { light: kG(MG, 0.2), dark: EG(MG, 0.1), hcDark: EG(MG, 0.1), hcLight: EG(MG, 0.1) },
    SI(1875, "Color of focused breadcrumb items."),
  ),
  VZ = SG(
    "breadcrumb.activeSelectionForeground",
    { light: kG(MG, 0.2), dark: EG(MG, 0.1), hcDark: EG(MG, 0.1), hcLight: EG(MG, 0.1) },
    SI(1876, "Color of selected breadcrumb items."),
  );
SG("breadcrumbPicker.background", YG, SI(1877, "Background color of breadcrumb item picker."));
const WZ = vG.fromHex("#40C8AE").transparent(0.5),
  HZ = vG.fromHex("#40A6FF").transparent(0.5),
  zZ = vG.fromHex("#606060").transparent(0.4),
  UZ = SG(
    "merge.currentHeaderBackground",
    { dark: WZ, light: WZ, hcDark: null, hcLight: null },
    SI(
      1878,
      "Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  );
SG(
  "merge.currentContentBackground",
  NG(UZ, 0.4),
  SI(
    1879,
    "Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
);
const $Z = SG(
  "merge.incomingHeaderBackground",
  { dark: HZ, light: HZ, hcDark: null, hcLight: null },
  SI(
    1880,
    "Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
);
SG(
  "merge.incomingContentBackground",
  NG($Z, 0.4),
  SI(
    1881,
    "Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
);
const qZ = SG(
  "merge.commonHeaderBackground",
  { dark: zZ, light: zZ, hcDark: null, hcLight: null },
  SI(
    1882,
    "Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
);
SG(
  "merge.commonContentBackground",
  NG(qZ, 0.4),
  SI(
    1883,
    "Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
);
const KZ = SG(
  "merge.border",
  { dark: null, light: null, hcDark: "#C3DF6F", hcLight: "#007ACC" },
  SI(1884, "Border color on headers and the splitter in inline merge-conflicts."),
);
(SG(
  "editorOverviewRuler.currentContentForeground",
  { dark: NG(UZ, 1), light: NG(UZ, 1), hcDark: KZ, hcLight: KZ },
  SI(1885, "Current overview ruler foreground for inline merge-conflicts."),
),
  SG(
    "editorOverviewRuler.incomingContentForeground",
    { dark: NG($Z, 1), light: NG($Z, 1), hcDark: KZ, hcLight: KZ },
    SI(1886, "Incoming overview ruler foreground for inline merge-conflicts."),
  ),
  SG(
    "editorOverviewRuler.commonContentForeground",
    { dark: NG(qZ, 1), light: NG(qZ, 1), hcDark: KZ, hcLight: KZ },
    SI(1887, "Common ancestor overview ruler foreground for inline merge-conflicts."),
  ));
const GZ = SG(
    "editorOverviewRuler.findMatchForeground",
    { dark: "#d186167e", light: "#d186167e", hcDark: "#AB5A00", hcLight: "#AB5A00" },
    SI(
      1888,
      "Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  ZZ = SG(
    "editorOverviewRuler.selectionHighlightForeground",
    "#A0A0A0CC",
    SI(
      1889,
      "Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  YZ = SG(
    "problemsErrorIcon.foreground",
    JG,
    SI(1890, "The color used for the problems error icon."),
  ),
  XZ = SG(
    "problemsWarningIcon.foreground",
    nZ,
    SI(1891, "The color used for the problems warning icon."),
  ),
  QZ = SG(
    "problemsInfoIcon.foreground",
    rZ,
    SI(1892, "The color used for the problems info icon."),
  ),
  JZ = SG(
    "minimap.findMatchHighlight",
    { light: "#d18616", dark: "#d18616", hcDark: "#AB5A00", hcLight: "#0F4A85" },
    SI(1983, "Minimap marker color for find matches."),
    !0,
  ),
  eY = SG(
    "minimap.selectionOccurrenceHighlight",
    { light: "#c9c9c9", dark: "#676767", hcDark: "#ffffff", hcLight: "#0F4A85" },
    SI(1984, "Minimap marker color for repeating editor selections."),
    !0,
  ),
  tY = SG(
    "minimap.selectionHighlight",
    { light: "#ADD6FF", dark: "#264F78", hcDark: "#ffffff", hcLight: "#0F4A85" },
    SI(1985, "Minimap marker color for the editor selection."),
    !0,
  ),
  nY = SG(
    "minimap.infoHighlight",
    { dark: rZ, light: rZ, hcDark: oZ, hcLight: oZ },
    SI(1986, "Minimap marker color for infos."),
  ),
  iY = SG(
    "minimap.warningHighlight",
    { dark: nZ, light: nZ, hcDark: iZ, hcLight: iZ },
    SI(1987, "Minimap marker color for warnings."),
  ),
  rY = SG(
    "minimap.errorHighlight",
    {
      dark: new vG(new fG(255, 18, 18, 0.7)),
      light: new vG(new fG(255, 18, 18, 0.7)),
      hcDark: new vG(new fG(255, 50, 50, 1)),
      hcLight: "#B5200D",
    },
    SI(1988, "Minimap marker color for errors."),
  ),
  oY = SG("minimap.background", null, SI(1989, "Minimap background color.")),
  sY = SG(
    "minimap.foregroundOpacity",
    vG.fromHex("#000f"),
    SI(
      1990,
      'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.',
    ),
  );
(SG("minimapSlider.background", NG(UG, 0.5), SI(1991, "Minimap slider background color.")),
  SG(
    "minimapSlider.hoverBackground",
    NG($G, 0.5),
    SI(1992, "Minimap slider background color when hovering."),
  ),
  SG(
    "minimapSlider.activeBackground",
    NG(qG, 0.5),
    SI(1993, "Minimap slider background color when clicked on."),
  ),
  SG("charts.foreground", MG, SI(1790, "The foreground color used in charts.")),
  SG("charts.lines", NG(MG, 0.5), SI(1791, "The color used for horizontal lines in charts.")),
  SG("charts.red", JG, SI(1792, "The red color used in chart visualizations.")),
  SG("charts.blue", rZ, SI(1793, "The blue color used in chart visualizations.")),
  SG("charts.yellow", nZ, SI(1794, "The yellow color used in chart visualizations.")),
  SG("charts.orange", JZ, SI(1795, "The orange color used in chart visualizations.")),
  SG(
    "charts.green",
    { dark: "#89D185", light: "#388A34", hcDark: "#89D185", hcLight: "#374e06" },
    SI(1796, "The green color used in chart visualizations."),
  ),
  SG(
    "charts.purple",
    { dark: "#B180D7", light: "#652D90", hcDark: "#B180D7", hcLight: "#652D90" },
    SI(1797, "The purple color used in chart visualizations."),
  ));
const aY = SG(
    "input.background",
    { dark: "#3C3C3C", light: vG.white, hcDark: vG.black, hcLight: vG.white },
    SI(1893, "Input box background."),
  ),
  lY = SG("input.foreground", MG, SI(1894, "Input box foreground.")),
  cY = SG(
    "input.border",
    { dark: null, light: null, hcDark: FG, hcLight: FG },
    SI(1895, "Input box border."),
  ),
  dY = SG(
    "inputOption.activeBorder",
    { dark: "#007ACC", light: "#007ACC", hcDark: FG, hcLight: FG },
    SI(1896, "Border color of activated options in input fields."),
  ),
  uY = SG(
    "inputOption.hoverBackground",
    { dark: "#5a5d5e80", light: "#b8b8b850", hcDark: null, hcLight: null },
    SI(1897, "Background color of activated options in input fields."),
  ),
  hY = SG(
    "inputOption.activeBackground",
    { dark: NG(jG, 0.4), light: NG(jG, 0.2), hcDark: vG.transparent, hcLight: vG.transparent },
    SI(1898, "Background hover color of options in input fields."),
  ),
  gY = SG(
    "inputOption.activeForeground",
    { dark: vG.white, light: vG.black, hcDark: MG, hcLight: MG },
    SI(1899, "Foreground color of activated options in input fields."),
  );
SG(
  "input.placeholderForeground",
  { light: NG(MG, 0.5), dark: NG(MG, 0.5), hcDark: NG(MG, 0.7), hcLight: NG(MG, 0.7) },
  SI(1900, "Input box foreground color for placeholder text."),
);
const pY = SG(
    "inputValidation.infoBackground",
    { dark: "#063B49", light: "#D6ECF2", hcDark: vG.black, hcLight: vG.white },
    SI(1901, "Input validation background color for information severity."),
  ),
  fY = SG(
    "inputValidation.infoForeground",
    { dark: null, light: null, hcDark: null, hcLight: MG },
    SI(1902, "Input validation foreground color for information severity."),
  ),
  mY = SG(
    "inputValidation.infoBorder",
    { dark: "#007acc", light: "#007acc", hcDark: FG, hcLight: FG },
    SI(1903, "Input validation border color for information severity."),
  ),
  _Y = SG(
    "inputValidation.warningBackground",
    { dark: "#352A05", light: "#F6F5D2", hcDark: vG.black, hcLight: vG.white },
    SI(1904, "Input validation background color for warning severity."),
  ),
  vY = SG(
    "inputValidation.warningForeground",
    { dark: null, light: null, hcDark: null, hcLight: MG },
    SI(1905, "Input validation foreground color for warning severity."),
  ),
  bY = SG(
    "inputValidation.warningBorder",
    { dark: "#B89500", light: "#B89500", hcDark: FG, hcLight: FG },
    SI(1906, "Input validation border color for warning severity."),
  ),
  yY = SG(
    "inputValidation.errorBackground",
    { dark: "#5A1D1D", light: "#F2DEDE", hcDark: vG.black, hcLight: vG.white },
    SI(1907, "Input validation background color for error severity."),
  ),
  xY = SG(
    "inputValidation.errorForeground",
    { dark: null, light: null, hcDark: null, hcLight: MG },
    SI(1908, "Input validation foreground color for error severity."),
  ),
  wY = SG(
    "inputValidation.errorBorder",
    { dark: "#BE1100", light: "#BE1100", hcDark: FG, hcLight: FG },
    SI(1909, "Input validation border color for error severity."),
  ),
  CY = SG(
    "dropdown.background",
    { dark: "#3C3C3C", light: vG.white, hcDark: vG.black, hcLight: vG.white },
    SI(1910, "Dropdown background."),
  ),
  SY = SG(
    "dropdown.listBackground",
    { dark: null, light: null, hcDark: vG.black, hcLight: vG.white },
    SI(1911, "Dropdown list background."),
  ),
  kY = SG(
    "dropdown.foreground",
    { dark: "#F0F0F0", light: MG, hcDark: vG.white, hcLight: MG },
    SI(1912, "Dropdown foreground."),
  ),
  EY = SG(
    "dropdown.border",
    { dark: CY, light: "#CECECE", hcDark: FG, hcLight: FG },
    SI(1913, "Dropdown border."),
  ),
  NY = SG("button.foreground", vG.white, SI(1914, "Button foreground color.")),
  LY = SG("button.separator", NG(NY, 0.4), SI(1915, "Button separator color.")),
  DY = SG(
    "button.background",
    { dark: "#0E639C", light: "#007ACC", hcDark: vG.black, hcLight: "#0F4A85" },
    SI(1916, "Button background color."),
  ),
  TY = SG(
    "button.hoverBackground",
    { dark: EG(DY, 0.2), light: kG(DY, 0.2), hcDark: DY, hcLight: DY },
    SI(1917, "Button background color when hovering."),
  ),
  IY = SG("button.border", FG, SI(1918, "Button border color.")),
  RY = SG(
    "button.secondaryForeground",
    { dark: vG.white, light: vG.white, hcDark: vG.white, hcLight: MG },
    SI(1919, "Secondary button foreground color."),
  ),
  OY = SG(
    "button.secondaryBackground",
    { dark: "#3A3D41", light: "#5F6A79", hcDark: null, hcLight: vG.white },
    SI(1920, "Secondary button background color."),
  ),
  MY = SG(
    "button.secondaryHoverBackground",
    { dark: EG(OY, 0.2), light: kG(OY, 0.2), hcDark: null, hcLight: null },
    SI(1921, "Secondary button background color when hovering."),
  ),
  AY = SG("radio.activeForeground", gY, SI(1922, "Foreground color of active radio option.")),
  PY = SG("radio.activeBackground", hY, SI(1923, "Background color of active radio option.")),
  jY = SG("radio.activeBorder", dY, SI(1924, "Border color of the active radio option.")),
  FY = SG("radio.inactiveForeground", null, SI(1925, "Foreground color of inactive radio option.")),
  BY = SG("radio.inactiveBackground", null, SI(1926, "Background color of inactive radio option.")),
  VY = SG(
    "radio.inactiveBorder",
    { light: NG(AY, 0.2), dark: NG(AY, 0.2), hcDark: NG(AY, 0.4), hcLight: NG(AY, 0.2) },
    SI(1927, "Border color of the inactive radio option."),
  ),
  WY = SG(
    "radio.inactiveHoverBackground",
    uY,
    SI(1928, "Background color of inactive active radio option when hovering."),
  ),
  HY = SG("checkbox.background", CY, SI(1929, "Background color of checkbox widget."));
SG(
  "checkbox.selectBackground",
  YG,
  SI(1930, "Background color of checkbox widget when the element it's in is selected."),
);
const zY = SG("checkbox.foreground", kY, SI(1931, "Foreground color of checkbox widget.")),
  UY = SG("checkbox.border", EY, SI(1932, "Border color of checkbox widget."));
SG(
  "checkbox.selectBorder",
  PG,
  SI(1933, "Border color of checkbox widget when the element it's in is selected."),
);
const $Y = SG(
    "checkbox.disabled.background",
    { op: 7, color: HY, with: zY, ratio: 0.33 },
    SI(1934, "Background of a disabled checkbox."),
  ),
  qY = SG(
    "checkbox.disabled.foreground",
    { op: 7, color: zY, with: HY, ratio: 0.33 },
    SI(1935, "Foreground of a disabled checkbox."),
  ),
  KY = SG(
    "keybindingLabel.background",
    {
      dark: new vG(new fG(128, 128, 128, 0.17)),
      light: new vG(new fG(221, 221, 221, 0.4)),
      hcDark: vG.transparent,
      hcLight: vG.transparent,
    },
    SI(
      1936,
      "Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.",
    ),
  ),
  GY = SG(
    "keybindingLabel.foreground",
    { dark: vG.fromHex("#CCCCCC"), light: vG.fromHex("#555555"), hcDark: vG.white, hcLight: MG },
    SI(
      1937,
      "Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.",
    ),
  ),
  ZY = SG(
    "keybindingLabel.border",
    {
      dark: new vG(new fG(51, 51, 51, 0.6)),
      light: new vG(new fG(204, 204, 204, 0.4)),
      hcDark: new vG(new fG(111, 195, 223)),
      hcLight: FG,
    },
    SI(
      1938,
      "Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.",
    ),
  ),
  YY = SG(
    "keybindingLabel.bottomBorder",
    {
      dark: new vG(new fG(68, 68, 68, 0.6)),
      light: new vG(new fG(187, 187, 187, 0.4)),
      hcDark: new vG(new fG(111, 195, 223)),
      hcLight: MG,
    },
    SI(
      1939,
      "Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.",
    ),
  ),
  XY = SG(
    "list.focusBackground",
    null,
    SI(
      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.",
    ),
  ),
  QY = SG(
    "list.focusForeground",
    null,
    SI(
      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.",
    ),
  ),
  JY = SG(
    "list.focusOutline",
    { dark: jG, light: jG, hcDark: BG, hcLight: BG },
    SI(
      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.",
    ),
  ),
  eX = SG(
    "list.focusAndSelectionOutline",
    null,
    SI(
      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.",
    ),
  ),
  tX = SG(
    "list.activeSelectionBackground",
    {
      dark: "#04395E",
      light: "#0060C0",
      hcDark: null,
      hcLight: vG.fromHex("#0F4A85").transparent(0.1),
    },
    SI(
      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.",
    ),
  ),
  nX = SG(
    "list.activeSelectionForeground",
    { dark: vG.white, light: vG.white, hcDark: null, hcLight: null },
    SI(
      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.",
    ),
  ),
  iX = SG(
    "list.activeSelectionIconForeground",
    null,
    SI(
      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.",
    ),
  ),
  rX = SG(
    "list.inactiveSelectionBackground",
    {
      dark: "#37373D",
      light: "#E4E6F1",
      hcDark: null,
      hcLight: vG.fromHex("#0F4A85").transparent(0.1),
    },
    SI(
      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.",
    ),
  ),
  oX = SG(
    "list.inactiveSelectionForeground",
    null,
    SI(
      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.",
    ),
  ),
  sX = SG(
    "list.inactiveSelectionIconForeground",
    null,
    SI(
      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.",
    ),
  ),
  aX = SG(
    "list.inactiveFocusBackground",
    null,
    SI(
      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.",
    ),
  ),
  lX = SG(
    "list.inactiveFocusOutline",
    null,
    SI(
      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.",
    ),
  ),
  cX = SG(
    "list.hoverBackground",
    {
      dark: "#2A2D2E",
      light: "#F0F0F0",
      hcDark: vG.white.transparent(0.1),
      hcLight: vG.fromHex("#0F4A85").transparent(0.1),
    },
    SI(1952, "List/Tree background when hovering over items using the mouse."),
  ),
  dX = SG(
    "list.hoverForeground",
    null,
    SI(1953, "List/Tree foreground when hovering over items using the mouse."),
  ),
  uX = SG(
    "list.dropBackground",
    { dark: "#062F4A", light: "#D6EBFF", hcDark: null, hcLight: null },
    SI(
      1954,
      "List/Tree drag and drop background when moving items over other items when using the mouse.",
    ),
  ),
  hX = SG(
    "list.dropBetweenBackground",
    { dark: PG, light: PG, hcDark: null, hcLight: null },
    SI(
      1955,
      "List/Tree drag and drop border color when moving items between items when using the mouse.",
    ),
  ),
  gX = SG(
    "list.highlightForeground",
    { dark: "#2AAAFF", light: "#0066BF", hcDark: jG, hcLight: jG },
    SI(
      1956,
      "List/Tree foreground color of the match highlights when searching inside the list/tree.",
    ),
  ),
  pX = SG(
    "list.focusHighlightForeground",
    {
      dark: gX,
      light: ((fX = tX), (mX = gX), (_X = "#BBE7FF"), { op: 6, if: fX, then: mX, else: _X }),
      hcDark: gX,
      hcLight: gX,
    },
    SI(
      1957,
      "List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.",
    ),
  );
var fX, mX, _X;
(SG(
  "list.invalidItemForeground",
  { dark: "#B89500", light: "#B89500", hcDark: "#B89500", hcLight: "#B5200D" },
  SI(
    1958,
    "List/Tree foreground color for invalid items, for example an unresolved root in explorer.",
  ),
),
  SG(
    "list.errorForeground",
    { dark: "#F88070", light: "#B01011", hcDark: null, hcLight: null },
    SI(1959, "Foreground color of list items containing errors."),
  ),
  SG(
    "list.warningForeground",
    { dark: "#CCA700", light: "#855F00", hcDark: null, hcLight: null },
    SI(1960, "Foreground color of list items containing warnings."),
  ));
const vX = SG(
    "listFilterWidget.background",
    { light: kG(YG, 0), dark: EG(YG, 0), hcDark: YG, hcLight: YG },
    SI(1961, "Background color of the type filter widget in lists and trees."),
  ),
  bX = SG(
    "listFilterWidget.outline",
    { dark: vG.transparent, light: vG.transparent, hcDark: "#f38518", hcLight: "#007ACC" },
    SI(1962, "Outline color of the type filter widget in lists and trees."),
  ),
  yX = SG(
    "listFilterWidget.noMatchesOutline",
    { dark: "#BE1100", light: "#BE1100", hcDark: FG, hcLight: FG },
    SI(
      1963,
      "Outline color of the type filter widget in lists and trees, when there are no matches.",
    ),
  ),
  xX = SG(
    "listFilterWidget.shadow",
    MZ,
    SI(1964, "Shadow color of the type filter widget in lists and trees."),
  );
(SG(
  "list.filterMatchBackground",
  { dark: gZ, light: gZ, hcDark: null, hcLight: null },
  SI(1965, "Background color of the filtered match."),
),
  SG(
    "list.filterMatchBorder",
    { dark: fZ, light: fZ, hcDark: FG, hcLight: BG },
    SI(1966, "Border color of the filtered match."),
  ),
  SG(
    "list.deemphasizedForeground",
    { dark: "#8C8C8C", light: "#8E8E90", hcDark: "#A7A8A9", hcLight: "#666666" },
    SI(1967, "List/Tree foreground color for items that are deemphasized."),
  ));
const wX = SG(
    "tree.indentGuidesStroke",
    { dark: "#585858", light: "#a9a9a9", hcDark: "#a9a9a9", hcLight: "#a5a5a5" },
    SI(1968, "Tree stroke color for the indentation guides."),
  ),
  CX = SG(
    "tree.inactiveIndentGuidesStroke",
    NG(wX, 0.4),
    SI(1969, "Tree stroke color for the indentation guides that are not active."),
  ),
  SX = SG(
    "tree.tableColumnsBorder",
    { dark: "#CCCCCC20", light: "#61616120", hcDark: null, hcLight: null },
    SI(1970, "Table border color between columns."),
  ),
  kX = SG(
    "tree.tableOddRowsBackground",
    { dark: NG(MG, 0.04), light: NG(MG, 0.04), hcDark: null, hcLight: null },
    SI(1971, "Background color for odd table rows."),
  );
SG("editorActionList.background", YG, SI(1972, "Action List background color."));
const EX = SG("editorActionList.foreground", XG, SI(1973, "Action List foreground color."));
(SG(
  "editorActionList.focusForeground",
  nX,
  SI(1974, "Action List foreground color for the focused item."),
),
  SG(
    "editorActionList.focusBackground",
    tX,
    SI(1975, "Action List background color for the focused item."),
  ));
const NX = SG(
    "menu.border",
    { dark: null, light: null, hcDark: FG, hcLight: FG },
    SI(1976, "Border color of menus."),
  ),
  LX = SG("menu.foreground", kY, SI(1977, "Foreground color of menu items.")),
  DX = SG("menu.background", CY, SI(1978, "Background color of menu items.")),
  TX = SG(
    "menu.selectionForeground",
    nX,
    SI(1979, "Foreground color of the selected menu item in menus."),
  ),
  IX = SG(
    "menu.selectionBackground",
    tX,
    SI(1980, "Background color of the selected menu item in menus."),
  ),
  RX = SG(
    "menu.selectionBorder",
    { dark: null, light: null, hcDark: BG, hcLight: BG },
    SI(1981, "Border color of the selected menu item in menus."),
  ),
  OX = SG(
    "menu.separatorBackground",
    { dark: "#606060", light: "#D4D4D4", hcDark: FG, hcLight: FG },
    SI(1982, "Color of a separator menu item in menus."),
  ),
  MX = SG(
    "quickInput.background",
    YG,
    SI(
      2010,
      "Quick picker background color. The quick picker widget is the container for pickers like the command palette.",
    ),
  ),
  AX = SG(
    "quickInput.foreground",
    XG,
    SI(
      2011,
      "Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.",
    ),
  ),
  PX = SG(
    "quickInputTitle.background",
    {
      dark: new vG(new fG(255, 255, 255, 0.105)),
      light: new vG(new fG(0, 0, 0, 0.06)),
      hcDark: "#000000",
      hcLight: vG.white,
    },
    SI(
      2012,
      "Quick picker title background color. The quick picker widget is the container for pickers like the command palette.",
    ),
  ),
  jX = SG(
    "pickerGroup.foreground",
    { dark: "#3794FF", light: "#0066BF", hcDark: vG.white, hcLight: "#0F4A85" },
    SI(2013, "Quick picker color for grouping labels."),
  ),
  FX = SG(
    "pickerGroup.border",
    { dark: "#3F3F46", light: "#CCCEDB", hcDark: vG.white, hcLight: "#0F4A85" },
    SI(2014, "Quick picker color for grouping borders."),
  ),
  BX = SG(
    "quickInput.list.focusBackground",
    null,
    "",
    void 0,
    SI(2015, "Please use quickInputList.focusBackground instead"),
  ),
  VX = SG(
    "quickInputList.focusForeground",
    nX,
    SI(2016, "Quick picker foreground color for the focused item."),
  ),
  WX = SG(
    "quickInputList.focusIconForeground",
    iX,
    SI(2017, "Quick picker icon foreground color for the focused item."),
  ),
  HX = SG(
    "quickInputList.focusBackground",
    { dark: LG(BX, tX), light: LG(BX, tX), hcDark: null, hcLight: null },
    SI(2018, "Quick picker background color for the focused item."),
  );
(SG(
  "search.resultsInfoForeground",
  { light: MG, dark: NG(MG, 0.65), hcDark: MG, hcLight: MG },
  SI(2019, "Color of the text in the search viewlet's completion message."),
),
  SG(
    "searchEditor.findMatchBackground",
    { light: NG(gZ, 0.66), dark: NG(gZ, 0.66), hcDark: gZ, hcLight: gZ },
    SI(2020, "Color of the Search Editor query matches."),
  ),
  SG(
    "searchEditor.findMatchBorder",
    { light: NG(fZ, 0.66), dark: NG(fZ, 0.66), hcDark: fZ, hcLight: fZ },
    SI(2021, "Border color of the Search Editor query matches."),
  ));
class zX {
  constructor(e, t) {
    ((this.x = e), (this.y = t), (this._pageCoordinatesBrand = void 0));
  }
  toClientCoordinates(e) {
    return new UX(this.x - e.scrollX, this.y - e.scrollY);
  }
}
class UX {
  constructor(e, t) {
    ((this.clientX = e), (this.clientY = t), (this._clientCoordinatesBrand = void 0));
  }
  toPageCoordinates(e) {
    return new zX(this.clientX + e.scrollX, this.clientY + e.scrollY);
  }
}
class $X {
  constructor(e, t, n, i) {
    ((this.x = e),
      (this.y = t),
      (this.width = n),
      (this.height = i),
      (this._editorPagePositionBrand = void 0));
  }
}
class qX {
  constructor(e, t) {
    ((this.x = e), (this.y = t), (this._positionRelativeToEditorBrand = void 0));
  }
}
function KX(e) {
  const t = aB(e);
  return new $X(t.left, t.top, t.width, t.height);
}
function GX(e, t, n) {
  const i = t.width / e.offsetWidth,
    r = t.height / e.offsetHeight,
    o = (n.x - t.x) / i,
    s = (n.y - t.y) / r;
  return new qX(o, s);
}
class ZX extends EO {
  constructor(e, t, n) {
    (super(MF(n), e),
      (this._editorMouseEventBrand = void 0),
      (this.isFromPointerCapture = t),
      (this.pos = new zX(this.posx, this.posy)),
      (this.editorPos = KX(n)),
      (this.relativePos = GX(n, this.editorPos, this.pos)));
  }
}
class YX {
  constructor(e) {
    this._editorViewDomNode = e;
  }
  _create(e) {
    return new ZX(e, !1, this._editorViewDomNode);
  }
  onContextMenu(e, t) {
    return $F(e, DB.CONTEXT_MENU, (e) => {
      t(this._create(e));
    });
  }
  onMouseUp(e, t) {
    return $F(e, DB.MOUSE_UP, (e) => {
      t(this._create(e));
    });
  }
  onMouseDown(e, t) {
    return $F(e, DB.MOUSE_DOWN, (e) => {
      t(this._create(e));
    });
  }
  onPointerDown(e, t) {
    return $F(e, DB.POINTER_DOWN, (e) => {
      t(this._create(e), e.pointerId);
    });
  }
  onMouseLeave(e, t) {
    return $F(e, DB.MOUSE_LEAVE, (e) => {
      t(this._create(e));
    });
  }
  onMouseMove(e, t) {
    return $F(e, DB.MOUSE_MOVE, (e) => t(this._create(e)));
  }
}
class XX {
  constructor(e) {
    this._editorViewDomNode = e;
  }
  _create(e) {
    return new ZX(e, !1, this._editorViewDomNode);
  }
  onPointerUp(e, t) {
    return $F(e, "pointerup", (e) => {
      t(this._create(e));
    });
  }
  onPointerDown(e, t) {
    return $F(e, DB.POINTER_DOWN, (e) => {
      t(this._create(e), e.pointerId);
    });
  }
  onPointerLeave(e, t) {
    return $F(e, DB.POINTER_LEAVE, (e) => {
      t(this._create(e));
    });
  }
  onPointerMove(e, t) {
    return $F(e, "pointermove", (e) => t(this._create(e)));
  }
}
class QX extends PO {
  constructor(e) {
    (super(),
      (this._editorViewDomNode = e),
      (this._globalPointerMoveMonitor = this._register(new gG())),
      (this._keydownListener = null));
  }
  startMonitoring(e, t, n, i, r) {
    ((this._keydownListener = KF(
      e.ownerDocument,
      "keydown",
      (e) => {
        e.toKeyCodeChord().isModifierKey() ||
          this._globalPointerMoveMonitor.stopMonitoring(!0, e.browserEvent);
      },
      !0,
    )),
      this._globalPointerMoveMonitor.startMonitoring(
        e,
        t,
        n,
        (e) => {
          i(new ZX(e, !0, this._editorViewDomNode));
        },
        (e) => {
          (this._keydownListener.dispose(), r(e));
        },
      ));
  }
  stopMonitoring() {
    this._globalPointerMoveMonitor.stopMonitoring(!0);
  }
}
class JX {
  static {
    this._idPool = 0;
  }
  constructor(e) {
    ((this._editor = e),
      (this._instanceId = ++JX._idPool),
      (this._counter = 0),
      (this._rules = new VO()),
      (this._garbageCollectionScheduler = new EM(() => this.garbageCollect(), 1e3)));
  }
  dispose() {
    (this._rules.dispose(), this._garbageCollectionScheduler.dispose());
  }
  createClassNameRef(e) {
    const t = this.getOrCreateRule(e);
    return (
      t.increaseRefCount(),
      {
        className: t.className,
        dispose: () => {
          (t.decreaseRefCount(), this._garbageCollectionScheduler.schedule());
        },
      }
    );
  }
  getOrCreateRule(e) {
    const t = this.computeUniqueKey(e);
    let n = this._rules.get(t);
    if (!n) {
      const i = this._counter++;
      ((n = new eQ(
        t,
        `dyn-rule-${this._instanceId}-${i}`,
        mB(this._editor.getContainerDomNode()) ? this._editor.getContainerDomNode() : void 0,
        e,
      )),
        this._rules.set(t, n));
    }
    return n;
  }
  computeUniqueKey(e) {
    return JSON.stringify(e);
  }
  garbageCollect() {
    for (const e of this._rules.values()) e.hasReferences() || this._rules.deleteAndDispose(e.key);
  }
}
class eQ {
  constructor(e, t, n, i) {
    ((this.key = e),
      (this.className = t),
      (this.properties = i),
      (this._referenceCount = 0),
      (this._styleElementDisposables = new AO()),
      (this._styleElement = rG(n, void 0, this._styleElementDisposables)),
      (this._styleElement.textContent = this.getCssText(this.className, this.properties)));
  }
  getCssText(e, t) {
    let n = `.${e} {`;
    for (const i in t) {
      const e = t[i];
      let r;
      r = "object" == typeof e ? yG(e.id) : e;
      n += `\n\t${tQ(i)}: ${r};`;
    }
    return ((n += "\n}"), n);
  }
  dispose() {
    (this._styleElementDisposables.dispose(), (this._styleElement = void 0));
  }
  increaseRefCount() {
    this._referenceCount++;
  }
  decreaseRefCount() {
    this._referenceCount--;
  }
  hasReferences() {
    return this._referenceCount > 0;
  }
}
function tQ(e) {
  return e
    .replace(/(^[A-Z])/, ([e]) => e.toLowerCase())
    .replace(/([A-Z])/g, ([e]) => `-${e.toLowerCase()}`);
}
class nQ extends PO {
  constructor() {
    (super(), (this._shouldRender = !0));
  }
  shouldRender() {
    return this._shouldRender;
  }
  forceShouldRender() {
    this._shouldRender = !0;
  }
  setShouldRender() {
    this._shouldRender = !0;
  }
  onDidRender() {
    this._shouldRender = !1;
  }
  onCompositionStart(e) {
    return !1;
  }
  onCompositionEnd(e) {
    return !1;
  }
  onConfigurationChanged(e) {
    return !1;
  }
  onCursorStateChanged(e) {
    return !1;
  }
  onDecorationsChanged(e) {
    return !1;
  }
  onFlushed(e) {
    return !1;
  }
  onFocusChanged(e) {
    return !1;
  }
  onLanguageConfigurationChanged(e) {
    return !1;
  }
  onLineMappingChanged(e) {
    return !1;
  }
  onLinesChanged(e) {
    return !1;
  }
  onLinesDeleted(e) {
    return !1;
  }
  onLinesInserted(e) {
    return !1;
  }
  onRevealRangeRequest(e) {
    return !1;
  }
  onScrollChanged(e) {
    return !1;
  }
  onThemeChanged(e) {
    return !1;
  }
  onTokensChanged(e) {
    return !1;
  }
  onTokensColorsChanged(e) {
    return !1;
  }
  onZonesChanged(e) {
    return !1;
  }
  handleEvents(e) {
    let t = !1;
    for (let n = 0, i = e.length; n < i; n++) {
      const i = e[n];
      switch (i.type) {
        case 0:
          this.onCompositionStart(i) && (t = !0);
          break;
        case 1:
          this.onCompositionEnd(i) && (t = !0);
          break;
        case 2:
          this.onConfigurationChanged(i) && (t = !0);
          break;
        case 3:
          this.onCursorStateChanged(i) && (t = !0);
          break;
        case 4:
          this.onDecorationsChanged(i) && (t = !0);
          break;
        case 5:
          this.onFlushed(i) && (t = !0);
          break;
        case 6:
          this.onFocusChanged(i) && (t = !0);
          break;
        case 7:
          this.onLanguageConfigurationChanged(i) && (t = !0);
          break;
        case 8:
          this.onLineMappingChanged(i) && (t = !0);
          break;
        case 9:
          this.onLinesChanged(i) && (t = !0);
          break;
        case 10:
          this.onLinesDeleted(i) && (t = !0);
          break;
        case 11:
          this.onLinesInserted(i) && (t = !0);
          break;
        case 12:
          this.onRevealRangeRequest(i) && (t = !0);
          break;
        case 13:
          this.onScrollChanged(i) && (t = !0);
          break;
        case 15:
          this.onTokensChanged(i) && (t = !0);
          break;
        case 14:
          this.onThemeChanged(i) && (t = !0);
          break;
        case 16:
          this.onTokensColorsChanged(i) && (t = !0);
          break;
        case 17:
          this.onZonesChanged(i) && (t = !0);
      }
    }
    t && (this._shouldRender = !0);
  }
}
class iQ extends nQ {
  constructor(e) {
    (super(), (this._context = e), this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), super.dispose());
  }
}
class rQ {
  static write(e, t) {
    e.setAttribute("data-mprt", String(t));
  }
  static read(e) {
    const t = e.getAttribute("data-mprt");
    return null === t ? 0 : parseInt(t, 10);
  }
  static collect(e, t) {
    const n = [];
    let i = 0;
    for (; e && e !== e.ownerDocument.body && e !== t; )
      (e.nodeType === e.ELEMENT_NODE && (n[i++] = this.read(e)), (e = e.parentElement));
    const r = new Uint8Array(i);
    for (let o = 0; o < i; o++) r[o] = n[i - o - 1];
    return r;
  }
}
class oQ {
  constructor(e, t) {
    ((this._restrictedRenderingContextBrand = void 0),
      (this._viewLayout = e),
      (this.viewportData = t),
      (this.scrollWidth = this._viewLayout.getScrollWidth()),
      (this.scrollHeight = this._viewLayout.getScrollHeight()),
      (this.visibleRange = this.viewportData.visibleRange),
      (this.bigNumbersDelta = this.viewportData.bigNumbersDelta));
    const n = this._viewLayout.getCurrentViewport();
    ((this.scrollTop = n.top),
      (this.scrollLeft = n.left),
      (this.viewportWidth = n.width),
      (this.viewportHeight = n.height));
  }
  getScrolledTopFromAbsoluteTop(e) {
    return e - this.scrollTop;
  }
  getVerticalOffsetForLineNumber(e, t) {
    return this._viewLayout.getVerticalOffsetForLineNumber(e, t);
  }
  getVerticalOffsetAfterLineNumber(e, t) {
    return this._viewLayout.getVerticalOffsetAfterLineNumber(e, t);
  }
  getLineHeightForLineNumber(e) {
    return this._viewLayout.getLineHeightForLineNumber(e);
  }
  getDecorationsInViewport() {
    return this.viewportData.getDecorationsInViewport();
  }
}
class sQ extends oQ {
  constructor(e, t, n, i) {
    (super(e, t),
      (this._renderingContextBrand = void 0),
      (this._viewLines = n),
      (this._viewLinesGpu = i));
  }
  linesVisibleRangesForRange(e, t) {
    const n = this._viewLines.linesVisibleRangesForRange(e, t);
    if (!this._viewLinesGpu) return n ?? null;
    const i = this._viewLinesGpu.linesVisibleRangesForRange(e, t);
    return n ? (i ? n.concat(i).sort((e, t) => e.lineNumber - t.lineNumber) : n) : i;
  }
  visibleRangeForPosition(e) {
    return (
      this._viewLines.visibleRangeForPosition(e) ??
      this._viewLinesGpu?.visibleRangeForPosition(e) ??
      null
    );
  }
}
class aQ {
  constructor(e, t, n, i) {
    ((this.outsideRenderedLine = e),
      (this.lineNumber = t),
      (this.ranges = n),
      (this.continuesOnNextLine = i));
  }
}
class lQ {
  static from(e) {
    const t = new Array(e.length);
    for (let n = 0, i = e.length; n < i; n++) {
      const i = e[n];
      t[n] = new lQ(i.left, i.width);
    }
    return t;
  }
  constructor(e, t) {
    ((this._horizontalRangeBrand = void 0),
      (this.left = Math.round(e)),
      (this.width = Math.round(t)));
  }
  toString() {
    return `[${this.left},${this.width}]`;
  }
}
class cQ {
  constructor(e, t) {
    ((this._floatHorizontalRangeBrand = void 0), (this.left = e), (this.width = t));
  }
  toString() {
    return `[${this.left},${this.width}]`;
  }
  static compare(e, t) {
    return e.left - t.left;
  }
}
class dQ {
  constructor(e, t) {
    ((this.outsideRenderedLine = e),
      (this.originalLeft = t),
      (this.left = Math.round(this.originalLeft)));
  }
}
class uQ {
  constructor(e, t) {
    ((this.outsideRenderedLine = e), (this.ranges = t));
  }
}
class hQ {
  static _createRange() {
    return (
      this._handyReadyRange || (this._handyReadyRange = document.createRange()),
      this._handyReadyRange
    );
  }
  static _detachRange(e, t) {
    e.selectNodeContents(t);
  }
  static _readClientRects(e, t, n, i, r) {
    const o = this._createRange();
    try {
      return (o.setStart(e, t), o.setEnd(n, i), o.getClientRects());
    } catch (spt) {
      return null;
    } finally {
      this._detachRange(o, r);
    }
  }
  static _mergeAdjacentRanges(e) {
    if (1 === e.length) return e;
    e.sort(cQ.compare);
    const t = [];
    let n = 0,
      i = e[0];
    for (let r = 1, o = e.length; r < o; r++) {
      const o = e[r];
      i.left + i.width + 0.9 >= o.left
        ? (i.width = Math.max(i.width, o.left + o.width - i.left))
        : ((t[n++] = i), (i = o));
    }
    return ((t[n++] = i), t);
  }
  static _createHorizontalRangesFromClientRects(e, t, n) {
    if (!e || 0 === e.length) return null;
    const i = [];
    for (let r = 0, o = e.length; r < o; r++) {
      const o = e[r];
      i[r] = new cQ(Math.max(0, (o.left - t) / n), o.width / n);
    }
    return this._mergeAdjacentRanges(i);
  }
  static readHorizontalRanges(e, t, n, i, r, o) {
    const s = e.children.length - 1;
    if (0 > s) return null;
    if (
      (t = Math.min(s, Math.max(0, t))) === (i = Math.min(s, Math.max(0, i))) &&
      n === r &&
      0 === n &&
      !e.children[t].firstChild
    ) {
      const n = e.children[t].getClientRects();
      return (
        o.markDidDomLayout(),
        this._createHorizontalRangesFromClientRects(n, o.clientRectDeltaLeft, o.clientRectScale)
      );
    }
    t !== i && i > 0 && 0 === r && (i--, (r = 1073741824));
    let a = e.children[t].firstChild,
      l = e.children[i].firstChild;
    if (
      ((a && l) ||
        (!a && 0 === n && t > 0 && ((a = e.children[t - 1].firstChild), (n = 1073741824)),
        !l && 0 === r && i > 0 && ((l = e.children[i - 1].firstChild), (r = 1073741824))),
      !a || !l)
    )
      return null;
    ((n = Math.min(a.textContent.length, Math.max(0, n))),
      (r = Math.min(l.textContent.length, Math.max(0, r))));
    const c = this._readClientRects(a, n, l, r, o.endNode);
    return (
      o.markDidDomLayout(),
      this._createHorizontalRangesFromClientRects(c, o.clientRectDeltaLeft, o.clientRectScale)
    );
  }
}
class gQ {
  constructor(e, t, n, i) {
    ((this.startColumn = e),
      (this.endColumn = t),
      (this.className = n),
      (this.type = i),
      (this._lineDecorationBrand = void 0));
  }
  static _equals(e, t) {
    return (
      e.startColumn === t.startColumn &&
      e.endColumn === t.endColumn &&
      e.className === t.className &&
      e.type === t.type
    );
  }
  static equalsArr(e, t) {
    const n = e.length;
    if (n !== t.length) return !1;
    for (let i = 0; i < n; i++) if (!gQ._equals(e[i], t[i])) return !1;
    return !0;
  }
  static extractWrapped(e, t, n) {
    if (0 === e.length) return e;
    const i = t + 1,
      r = n + 1,
      o = n - t,
      s = [];
    let a = 0;
    for (const l of e)
      l.endColumn <= i ||
        l.startColumn >= r ||
        (s[a++] = new gQ(
          Math.max(1, l.startColumn - i + 1),
          Math.min(o + 1, l.endColumn - i + 1),
          l.className,
          l.type,
        ));
    return s;
  }
  static filter(e, t, n, i) {
    if (0 === e.length) return [];
    const r = [];
    let o = 0;
    for (let s = 0, a = e.length; s < a; s++) {
      const a = e[s],
        l = a.range;
      if (l.endLineNumber < t || l.startLineNumber > t) continue;
      if (l.isEmpty() && (0 === a.type || 3 === a.type)) continue;
      const c = l.startLineNumber === t ? l.startColumn : n,
        d = l.endLineNumber === t ? l.endColumn : i;
      r[o++] = new gQ(c, d, a.inlineClassName, a.type);
    }
    return r;
  }
  static _typeCompare(e, t) {
    const n = [2, 0, 1, 3];
    return n[e] - n[t];
  }
  static compare(e, t) {
    if (e.startColumn !== t.startColumn) return e.startColumn - t.startColumn;
    if (e.endColumn !== t.endColumn) return e.endColumn - t.endColumn;
    const n = gQ._typeCompare(e.type, t.type);
    return 0 !== n ? n : e.className !== t.className ? (e.className < t.className ? -1 : 1) : 0;
  }
}
class pQ {
  constructor(e, t, n, i) {
    ((this.startOffset = e), (this.endOffset = t), (this.className = n), (this.metadata = i));
  }
}
let fQ = class e {
  constructor() {
    ((this.stopOffsets = []), (this.classNames = []), (this.metadata = []), (this.count = 0));
  }
  static _metadata(e) {
    let t = 0;
    for (let n = 0, i = e.length; n < i; n++) t |= e[n];
    return t;
  }
  consumeLowerThan(t, n, i) {
    for (; this.count > 0 && this.stopOffsets[0] < t; ) {
      let t = 0;
      for (; t + 1 < this.count && this.stopOffsets[t] === this.stopOffsets[t + 1]; ) t++;
      (i.push(
        new pQ(n, this.stopOffsets[t], this.classNames.join(" "), e._metadata(this.metadata)),
      ),
        (n = this.stopOffsets[t] + 1),
        this.stopOffsets.splice(0, t + 1),
        this.classNames.splice(0, t + 1),
        this.metadata.splice(0, t + 1),
        (this.count -= t + 1));
    }
    return (
      this.count > 0 &&
        n < t &&
        (i.push(new pQ(n, t - 1, this.classNames.join(" "), e._metadata(this.metadata))), (n = t)),
      n
    );
  }
  insert(e, t, n) {
    if (0 === this.count || this.stopOffsets[this.count - 1] <= e)
      (this.stopOffsets.push(e), this.classNames.push(t), this.metadata.push(n));
    else
      for (let i = 0; i < this.count; i++)
        if (this.stopOffsets[i] >= e) {
          (this.stopOffsets.splice(i, 0, e),
            this.classNames.splice(i, 0, t),
            this.metadata.splice(i, 0, n));
          break;
        }
    this.count++;
  }
};
class mQ {
  static normalize(e, t) {
    if (0 === t.length) return [];
    const n = [],
      i = new fQ();
    let r = 0;
    for (let o = 0, s = t.length; o < s; o++) {
      const s = t[o];
      let a = s.startColumn,
        l = s.endColumn;
      const c = s.className,
        d = 1 === s.type ? 2 : 2 === s.type ? 4 : 0;
      if (a > 1) {
        uA(e.charCodeAt(a - 2)) && a--;
      }
      if (l > 1) {
        uA(e.charCodeAt(l - 2)) && l--;
      }
      const u = a - 1,
        h = l - 2;
      ((r = i.consumeLowerThan(u, r, n)), 0 === i.count && (r = u), i.insert(h, c, d));
    }
    return (i.consumeLowerThan(1073741824, r, n), n);
  }
}
class _Q {
  constructor(e, t, n, i) {
    ((this.endIndex = e),
      (this.type = t),
      (this.metadata = n),
      (this.containsRTL = i),
      (this._linePartBrand = void 0));
  }
  isWhitespace() {
    return !!(1 & this.metadata);
  }
  isPseudoAfter() {
    return !!(4 & this.metadata);
  }
}
class vQ {
  get isLTR() {
    return !this.containsRTL && this.textDirection !== qz.RTL;
  }
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h, g, p, f, m, _, v, b, y, x = !1) {
    ((this.useMonospaceOptimizations = e),
      (this.canUseHalfwidthRightwardsArrow = t),
      (this.lineContent = n),
      (this.continuesWithWrappedLine = i),
      (this.isBasicASCII = r),
      (this.containsRTL = o),
      (this.fauxIndentLength = s),
      (this.lineTokens = a),
      (this.lineDecorations = l.sort(gQ.compare)),
      (this.tabSize = c),
      (this.startVisibleColumn = d),
      (this.spaceWidth = u),
      (this.stopRenderingLineAfter = p),
      (this.renderWhitespace =
        "all" === f ? 4 : "boundary" === f ? 1 : "selection" === f ? 2 : "trailing" === f ? 3 : 0),
      (this.renderControlCharacters = m),
      (this.fontLigatures = _),
      (this.selectionsOnLine = v && v.sort((e, t) => (e.start < t.start ? -1 : 1))),
      (this.renderNewLineWhenEmpty = x),
      (this.textDirection = b),
      (this.verticalScrollbarSize = y));
    Math.abs(g - u) < Math.abs(h - u)
      ? ((this.renderSpaceWidth = g), (this.renderSpaceCharCode = 11825))
      : ((this.renderSpaceWidth = h), (this.renderSpaceCharCode = 183));
  }
  sameSelection(e) {
    if (null === this.selectionsOnLine) return null === e;
    if (null === e) return !1;
    if (e.length !== this.selectionsOnLine.length) return !1;
    for (let t = 0; t < this.selectionsOnLine.length; t++)
      if (!this.selectionsOnLine[t].equals(e[t])) return !1;
    return !0;
  }
  equals(e) {
    return (
      this.useMonospaceOptimizations === e.useMonospaceOptimizations &&
      this.canUseHalfwidthRightwardsArrow === e.canUseHalfwidthRightwardsArrow &&
      this.lineContent === e.lineContent &&
      this.continuesWithWrappedLine === e.continuesWithWrappedLine &&
      this.isBasicASCII === e.isBasicASCII &&
      this.containsRTL === e.containsRTL &&
      this.fauxIndentLength === e.fauxIndentLength &&
      this.tabSize === e.tabSize &&
      this.startVisibleColumn === e.startVisibleColumn &&
      this.spaceWidth === e.spaceWidth &&
      this.renderSpaceWidth === e.renderSpaceWidth &&
      this.renderSpaceCharCode === e.renderSpaceCharCode &&
      this.stopRenderingLineAfter === e.stopRenderingLineAfter &&
      this.renderWhitespace === e.renderWhitespace &&
      this.renderControlCharacters === e.renderControlCharacters &&
      this.fontLigatures === e.fontLigatures &&
      gQ.equalsArr(this.lineDecorations, e.lineDecorations) &&
      this.lineTokens.equals(e.lineTokens) &&
      this.sameSelection(e.selectionsOnLine) &&
      this.textDirection === e.textDirection &&
      this.verticalScrollbarSize === e.verticalScrollbarSize &&
      this.renderNewLineWhenEmpty === e.renderNewLineWhenEmpty
    );
  }
}
class bQ {
  constructor(e, t) {
    ((this.partIndex = e), (this.charIndex = t));
  }
}
class yQ {
  static getPartIndex(e) {
    return (4294901760 & e) >>> 16;
  }
  static getCharIndex(e) {
    return (65535 & e) >>> 0;
  }
  constructor(e, t) {
    ((this.length = e),
      (this._data = new Uint32Array(this.length)),
      (this._horizontalOffset = new Uint32Array(this.length)));
  }
  setColumnInfo(e, t, n, i) {
    const r = ((t << 16) | n) >>> 0;
    ((this._data[e - 1] = r), (this._horizontalOffset[e - 1] = i));
  }
  getHorizontalOffset(e) {
    return 0 === this._horizontalOffset.length ? 0 : this._horizontalOffset[e - 1];
  }
  charOffsetToPartData(e) {
    return 0 === this.length
      ? 0
      : e < 0
        ? this._data[0]
        : e >= this.length
          ? this._data[this.length - 1]
          : this._data[e];
  }
  getDomPosition(e) {
    const t = this.charOffsetToPartData(e - 1),
      n = yQ.getPartIndex(t),
      i = yQ.getCharIndex(t);
    return new bQ(n, i);
  }
  getColumn(e, t) {
    return this.partDataToCharOffset(e.partIndex, t, e.charIndex) + 1;
  }
  partDataToCharOffset(e, t, n) {
    if (0 === this.length) return 0;
    const i = ((e << 16) | n) >>> 0;
    let r = 0,
      o = this.length - 1;
    for (; r + 1 < o; ) {
      const e = (r + o) >>> 1,
        t = this._data[e];
      if (t === i) return e;
      t > i ? (o = e) : (r = e);
    }
    if (r === o) return r;
    const s = this._data[r],
      a = this._data[o];
    if (s === i) return r;
    if (a === i) return o;
    const l = yQ.getPartIndex(s),
      c = yQ.getCharIndex(s);
    let d;
    d = l !== yQ.getPartIndex(a) ? t : yQ.getCharIndex(a);
    return n - c <= d - n ? r : o;
  }
}
class xQ {
  constructor(e, t) {
    ((this._renderLineOutputBrand = void 0),
      (this.characterMapping = e),
      (this.containsForeignElements = t));
  }
}
function wQ(e, t) {
  if (0 === e.lineContent.length) {
    if (e.lineDecorations.length > 0) {
      t.appendString("<span>");
      let n = 0,
        i = 0,
        r = 0;
      for (const s of e.lineDecorations)
        (1 !== s.type && 2 !== s.type) ||
          (t.appendString('<span class="'),
          t.appendString(s.className),
          t.appendString('"></span>'),
          1 === s.type && ((r |= 1), n++),
          2 === s.type && ((r |= 2), i++));
      t.appendString("</span>");
      const o = new yQ(1, n + i);
      return (o.setColumnInfo(1, n, 0, 0), new xQ(o, r));
    }
    return (
      e.renderNewLineWhenEmpty
        ? t.appendString("<span><span>\n</span></span>")
        : t.appendString("<span><span></span></span>"),
      new xQ(new yQ(0, 0), 0)
    );
  }
  return (function (e, t) {
    const n = e.fontIsMonospace,
      i = e.canUseHalfwidthRightwardsArrow,
      r = e.containsForeignElements,
      o = e.lineContent,
      s = e.len,
      a = e.isOverflowing,
      l = e.overflowingCharCount,
      c = e.parts,
      d = e.fauxIndentLength,
      u = e.tabSize,
      h = e.startVisibleColumn,
      g = e.spaceWidth,
      p = e.renderSpaceCharCode,
      f = e.renderWhitespace,
      m = e.renderControlCharacters,
      _ = new yQ(s + 1, c.length);
    let v = !1,
      b = 0,
      y = h,
      x = 0,
      w = 0,
      C = 0;
    t.appendString("<span>");
    for (let S = 0, k = c.length; S < k; S++) {
      const e = c[S],
        a = e.endIndex,
        l = e.type,
        h = e.containsRTL,
        k = 0 !== f && e.isWhitespace(),
        E = k && !n && ("mtkw" === l || !r),
        N = b === a && e.isPseudoAfter();
      if (
        ((x = 0),
        t.appendString("<span "),
        h && t.appendString('dir="rtl" style="unicode-bidi:isolate" '),
        t.appendString('class="'),
        t.appendString(E ? "mtkz" : l),
        t.appendASCIICharCode(34),
        k)
      ) {
        let e = 0;
        {
          let t = b,
            n = y;
          for (; t < a; t++) {
            const i = 0 | (9 === o.charCodeAt(t) ? u - (n % u) : 1);
            ((e += i), t >= d && (n += i));
          }
        }
        for (
          E &&
            (t.appendString(' style="width:'),
            t.appendString(String(g * e)),
            t.appendString('px"')),
            t.appendASCIICharCode(62);
          b < a;
          b++
        ) {
          (_.setColumnInfo(b + 1, S - C, x, w), (C = 0));
          let e, n;
          if (9 === o.charCodeAt(b)) {
            ((e = (u - (y % u)) | 0),
              (n = e),
              !i || n > 1 ? t.appendCharCode(8594) : t.appendCharCode(65515));
            for (let e = 2; e <= n; e++) t.appendCharCode(160);
          } else ((e = 2), (n = 1), t.appendCharCode(p), t.appendCharCode(8204));
          ((x += e), (w += n), b >= d && (y += n));
        }
      } else
        for (t.appendASCIICharCode(62); b < a; b++) {
          (_.setColumnInfo(b + 1, S - C, x, w), (C = 0));
          const e = o.charCodeAt(b);
          let n = 1,
            i = 1;
          switch (e) {
            case 9:
              ((n = u - (y % u)), (i = n));
              for (let e = 1; e <= n; e++) t.appendCharCode(160);
              break;
            case 32:
              t.appendCharCode(160);
              break;
            case 60:
              t.appendString("&lt;");
              break;
            case 62:
              t.appendString("&gt;");
              break;
            case 38:
              t.appendString("&amp;");
              break;
            case 0:
              m ? t.appendCharCode(9216) : t.appendString("&#00;");
              break;
            case 65279:
            case 8232:
            case 8233:
            case 133:
              t.appendCharCode(65533);
              break;
            default:
              (kA(e) && i++,
                m && e < 32
                  ? t.appendCharCode(9216 + e)
                  : m && 127 === e
                    ? t.appendCharCode(9249)
                    : m && EQ(e)
                      ? (t.appendString("[U+"),
                        t.appendString(NQ(e)),
                        t.appendString("]"),
                        (n = 8),
                        (i = n))
                      : t.appendCharCode(e));
          }
          ((x += n), (w += i), b >= d && (y += i));
        }
      (N ? C++ : (C = 0),
        b >= s && !v && e.isPseudoAfter() && ((v = !0), _.setColumnInfo(b + 1, S, x, w)),
        t.appendString("</span>"));
    }
    v || _.setColumnInfo(s + 1, c.length - 1, x, w);
    a &&
      (t.appendString('<span class="mtkoverflow">'),
      t.appendString(
        SI(
          796,
          "Show more ({0})",
          (function (e) {
            if (e < 1024) return SI(797, "{0} chars", e);
            if (e < 1048576) return `${(e / 1024).toFixed(1)} KB`;
            return `${(e / 1024 / 1024).toFixed(1)} MB`;
          })(l),
        ),
      ),
      t.appendString("</span>"));
    return (t.appendString("</span>"), new xQ(_, r));
  })(
    (function (e) {
      const t = e.lineContent;
      let n, i, r;
      -1 !== e.stopRenderingLineAfter && e.stopRenderingLineAfter < t.length
        ? ((n = !0), (i = t.length - e.stopRenderingLineAfter), (r = e.stopRenderingLineAfter))
        : ((n = !1), (i = 0), (r = t.length));
      let o = (function (e, t, n, i, r) {
        const o = [];
        let s = 0;
        i > 0 && (o[s++] = new _Q(i, "", 0, !1));
        let a = i;
        for (let l = 0, c = n.getCount(); l < c; l++) {
          const c = n.getEndOffset(l);
          if (c <= i) continue;
          const d = n.getClassName(l);
          if (c >= r) {
            const n = !!t && yA(e.substring(a, r));
            o[s++] = new _Q(r, d, 0, n);
            break;
          }
          const u = !!t && yA(e.substring(a, c));
          ((o[s++] = new _Q(c, d, 0, u)), (a = c));
        }
        return o;
      })(t, e.containsRTL, e.lineTokens, e.fauxIndentLength, r);
      e.renderControlCharacters &&
        !e.isBasicASCII &&
        (o = (function (e, t) {
          const n = [];
          let i = new _Q(0, "", 0, !1),
            r = 0;
          for (const o of t) {
            const t = o.endIndex;
            for (; r < t; r++) {
              EQ(e.charCodeAt(r)) &&
                (r > i.endIndex && ((i = new _Q(r, o.type, o.metadata, o.containsRTL)), n.push(i)),
                (i = new _Q(r + 1, "mtkcontrol", o.metadata, !1)),
                n.push(i));
            }
            r > i.endIndex && ((i = new _Q(t, o.type, o.metadata, o.containsRTL)), n.push(i));
          }
          return n;
        })(t, o));
      (4 === e.renderWhitespace ||
        1 === e.renderWhitespace ||
        (2 === e.renderWhitespace && e.selectionsOnLine) ||
        (3 === e.renderWhitespace && !e.continuesWithWrappedLine)) &&
        (o = (function (e, t, n, i) {
          const r = e.continuesWithWrappedLine,
            o = e.fauxIndentLength,
            s = e.tabSize,
            a = e.startVisibleColumn,
            l = e.useMonospaceOptimizations,
            c = e.selectionsOnLine,
            d = 1 === e.renderWhitespace,
            u = 3 === e.renderWhitespace,
            h = e.renderSpaceWidth !== e.spaceWidth,
            g = [];
          let p = 0,
            f = 0,
            m = i[f].type,
            _ = i[f].containsRTL,
            v = i[f].endIndex;
          const b = i.length;
          let y,
            x = !1,
            w = YM(t);
          -1 === w ? ((x = !0), (w = n), (y = n)) : (y = QM(t));
          let C = !1,
            S = 0,
            k = c && c[S],
            E = a % s;
          for (let L = o; L < n; L++) {
            const e = t.charCodeAt(L);
            let r;
            if ((k && k.endExclusive <= L && (S++, (k = c && c[S])), L < w || L > y)) r = !0;
            else if (9 === e) r = !0;
            else if (32 === e)
              if (d)
                if (C) r = !0;
                else {
                  const e = L + 1 < n ? t.charCodeAt(L + 1) : 0;
                  r = 32 === e || 9 === e;
                }
              else r = !0;
            else r = !1;
            if (
              (r && c && (r = !!k && k.start <= L && L < k.endExclusive),
              r && u && (r = x || L > y),
              r && _ && L >= w && L <= y && (r = !1),
              C)
            ) {
              if (!r || (!l && E >= s)) {
                if (h) {
                  for (let e = (p > 0 ? g[p - 1].endIndex : o) + 1; e <= L; e++)
                    g[p++] = new _Q(e, "mtkw", 1, !1);
                } else g[p++] = new _Q(L, "mtkw", 1, !1);
                E %= s;
              }
            } else (L === v || (r && L > o)) && ((g[p++] = new _Q(L, m, 0, _)), (E %= s));
            for (9 === e ? (E = s) : kA(e) ? (E += 2) : E++, C = r; L === v && (f++, f < b); )
              ((m = i[f].type), (_ = i[f].containsRTL), (v = i[f].endIndex));
          }
          let N = !1;
          if (C)
            if (r && d) {
              const e = n > 0 ? t.charCodeAt(n - 1) : 0,
                i = n > 1 ? t.charCodeAt(n - 2) : 0;
              (32 === e && 32 !== i && 9 !== i) || (N = !0);
            } else N = !0;
          if (N)
            if (h) {
              for (let e = (p > 0 ? g[p - 1].endIndex : o) + 1; e <= n; e++)
                g[p++] = new _Q(e, "mtkw", 1, !1);
            } else g[p++] = new _Q(n, "mtkw", 1, !1);
          else g[p++] = new _Q(n, m, 0, _);
          return g;
        })(e, t, r, o));
      let s = 0;
      if (e.lineDecorations.length > 0) {
        for (let t = 0, n = e.lineDecorations.length; t < n; t++) {
          const n = e.lineDecorations[t];
          3 === n.type || 1 === n.type ? (s |= 1) : 2 === n.type && (s |= 2);
        }
        o = (function (e, t, n, i) {
          i.sort(gQ.compare);
          const r = mQ.normalize(e, i),
            o = r.length;
          let s = 0;
          const a = [];
          let l = 0,
            c = 0;
          for (let u = 0, h = n.length; u < h; u++) {
            const e = n[u],
              t = e.endIndex,
              i = e.type,
              d = e.metadata,
              h = e.containsRTL;
            for (; s < o && r[s].startOffset < t; ) {
              const e = r[s];
              if (
                (e.startOffset > c && ((c = e.startOffset), (a[l++] = new _Q(c, i, d, h))),
                !(e.endOffset + 1 <= t))
              ) {
                ((c = t), (a[l++] = new _Q(c, i + " " + e.className, d | e.metadata, h)));
                break;
              }
              ((c = e.endOffset + 1),
                (a[l++] = new _Q(c, i + " " + e.className, d | e.metadata, h)),
                s++);
            }
            t > c && ((c = t), (a[l++] = new _Q(c, i, d, h)));
          }
          const d = n[n.length - 1].endIndex;
          if (s < o && r[s].startOffset === d)
            for (; s < o && r[s].startOffset === d; ) {
              const e = r[s];
              ((a[l++] = new _Q(c, e.className, e.metadata, !1)), s++);
            }
          return a;
        })(t, 0, o, e.lineDecorations);
      }
      o = e.containsRTL
        ? (function (e, t) {
            if (0 === t.length) return t;
            const n = t[0];
            if (!n.containsRTL) return t;
            const i = n.endIndex;
            let r = 0;
            for (let s = 0; s < i; s++) {
              const t = e.charCodeAt(s);
              if (32 !== t && 9 !== t) {
                r = s;
                break;
              }
            }
            if (0 === r) return t;
            const o = [];
            (o.push(new _Q(r, n.type, n.metadata, !1)),
              o.push(new _Q(i, n.type, n.metadata, n.containsRTL)));
            for (let s = 1; s < t.length; s++) o.push(t[s]);
            return o;
          })(t, o)
        : (function (e, t, n) {
            let i = 0;
            const r = [];
            let o = 0;
            if (n)
              for (let s = 0, a = t.length; s < a; s++) {
                const n = t[s],
                  a = n.endIndex;
                if (i + 50 < a) {
                  const t = n.type,
                    s = n.metadata,
                    l = n.containsRTL;
                  let c = -1,
                    d = i;
                  for (let n = i; n < a; n++)
                    (32 === e.charCodeAt(n) && (c = n),
                      -1 !== c &&
                        n - d >= 50 &&
                        ((r[o++] = new _Q(c + 1, t, s, l)), (d = c + 1), (c = -1)));
                  d !== a && (r[o++] = new _Q(a, t, s, l));
                } else r[o++] = n;
                i = a;
              }
            else
              for (let s = 0, a = t.length; s < a; s++) {
                const e = t[s],
                  n = e.endIndex,
                  a = n - i;
                if (a > 50) {
                  const t = e.type,
                    s = e.metadata,
                    l = e.containsRTL,
                    c = Math.ceil(a / 50);
                  for (let e = 1; e < c; e++) {
                    const n = i + 50 * e;
                    r[o++] = new _Q(n, t, s, l);
                  }
                  r[o++] = new _Q(n, t, s, l);
                } else r[o++] = e;
                i = n;
              }
            return r;
          })(t, o, !e.isBasicASCII || e.fontLigatures);
      return new kQ(
        e.useMonospaceOptimizations,
        e.canUseHalfwidthRightwardsArrow,
        t,
        r,
        n,
        i,
        o,
        s,
        e.fauxIndentLength,
        e.tabSize,
        e.startVisibleColumn,
        e.spaceWidth,
        e.renderSpaceCharCode,
        e.renderWhitespace,
        e.renderControlCharacters,
      );
    })(e),
    t,
  );
}
class CQ {
  constructor(e, t, n) {
    ((this.characterMapping = e), (this.html = t), (this.containsForeignElements = n));
  }
}
function SQ(e) {
  const t = new bU(1e4),
    n = wQ(e, t);
  return new CQ(n.characterMapping, t.build(), n.containsForeignElements);
}
class kQ {
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h, g, p) {
    ((this.fontIsMonospace = e),
      (this.canUseHalfwidthRightwardsArrow = t),
      (this.lineContent = n),
      (this.len = i),
      (this.isOverflowing = r),
      (this.overflowingCharCount = o),
      (this.parts = s),
      (this.containsForeignElements = a),
      (this.fauxIndentLength = l),
      (this.tabSize = c),
      (this.startVisibleColumn = d),
      (this.spaceWidth = u),
      (this.renderSpaceCharCode = h),
      (this.renderWhitespace = g),
      (this.renderControlCharacters = p));
  }
}
function EQ(e) {
  return e < 32
    ? 9 !== e
    : 127 === e ||
        (e >= 8234 && e <= 8238) ||
        (e >= 8294 && e <= 8297) ||
        (e >= 8206 && e <= 8207) ||
        1564 === e;
}
function NQ(e) {
  return e.toString(16).toUpperCase().padStart(4, "0");
}
var LQ, DQ;
function TQ(e) {
  return e === LQ.HIGH_CONTRAST_DARK || e === LQ.HIGH_CONTRAST_LIGHT;
}
function IQ(e) {
  return e === LQ.DARK || e === LQ.HIGH_CONTRAST_DARK;
}
(!(function (e) {
  ((e.DARK = "dark"),
    (e.LIGHT = "light"),
    (e.HIGH_CONTRAST_DARK = "hcDark"),
    (e.HIGH_CONTRAST_LIGHT = "hcLight"));
})(LQ || (LQ = {})),
  (function (e) {
    ((e.VS = "vs"), (e.VS_DARK = "vs-dark"), (e.HC_BLACK = "hc-black"), (e.HC_LIGHT = "hc-light"));
  })(DQ || (DQ = {})));
const RQ = !!FR || !(jR || RI || AI);
let OQ = !0;
class MQ {
  static {
    this.CLASS_NAME = "view-line";
  }
  constructor(e, t) {
    ((this._viewGpuContext = e),
      (this._options = t),
      (this._isMaybeInvalid = !0),
      (this._renderedViewLine = null));
  }
  getDomNode() {
    return this._renderedViewLine && this._renderedViewLine.domNode
      ? this._renderedViewLine.domNode.domNode
      : null;
  }
  setDomNode(e) {
    if (!this._renderedViewLine)
      throw new Error("I have no rendered view line to set the dom node to...");
    this._renderedViewLine.domNode = Bq(e);
  }
  onContentChanged() {
    this._isMaybeInvalid = !0;
  }
  onTokensChanged() {
    this._isMaybeInvalid = !0;
  }
  onDecorationsChanged() {
    this._isMaybeInvalid = !0;
  }
  onOptionsChanged(e) {
    ((this._isMaybeInvalid = !0), (this._options = e));
  }
  onSelectionChanged() {
    return (
      !(!TQ(this._options.themeType) && 2 !== this._renderedViewLine?.input.renderWhitespace) &&
      ((this._isMaybeInvalid = !0), !0)
    );
  }
  renderLine(e, t, n, i, r) {
    if (this._options.useGpu && this._viewGpuContext?.canRender(this._options, i, e))
      return (
        this._renderedViewLine?.domNode?.domNode.remove(),
        (this._renderedViewLine = null),
        !1
      );
    if (!1 === this._isMaybeInvalid) return !1;
    this._isMaybeInvalid = !1;
    const o = i.getViewLineRenderingData(e),
      s = this._options,
      a = gQ.filter(o.inlineDecorations, e, o.minColumn, o.maxColumn),
      l =
        o.hasVariableFonts || "off" === s.experimentalWhitespaceRendering
          ? s.renderWhitespace
          : "none",
      c = !o.hasVariableFonts;
    let d = null;
    if (TQ(s.themeType) || "selection" === l) {
      const t = i.selections;
      for (const n of t) {
        if (n.endLineNumber < e || n.startLineNumber > e) continue;
        const t = n.startLineNumber === e ? n.startColumn : o.minColumn,
          i = n.endLineNumber === e ? n.endColumn : o.maxColumn;
        t < i &&
          (TQ(s.themeType) && a.push(new gQ(t, i, "inline-selected-text", 0)),
          "selection" === l && (d || (d = []), d.push(new N$(t - 1, i - 1))));
      }
    }
    const u = new vQ(
      s.useMonospaceOptimizations,
      s.canUseHalfwidthRightwardsArrow,
      o.content,
      o.continuesWithWrappedLine,
      o.isBasicASCII,
      o.containsRTL,
      o.minColumn - 1,
      o.tokens,
      a,
      o.tabSize,
      o.startVisibleColumn,
      s.spaceWidth,
      s.middotWidth,
      s.wsmiddotWidth,
      s.stopRenderingLineAfter,
      l,
      s.renderControlCharacters,
      s.fontLigatures !== xK.OFF,
      d,
      o.textDirection,
      s.verticalScrollbarSize,
    );
    if (this._renderedViewLine && this._renderedViewLine.input.equals(u)) return !1;
    (r.appendString("<div "),
      o.textDirection === qz.RTL
        ? r.appendString('dir="rtl" ')
        : o.containsRTL && r.appendString('dir="ltr" '),
      r.appendString('style="top:'),
      r.appendString(String(t)),
      r.appendString("px;height:"),
      r.appendString(String(n)),
      r.appendString("px;line-height:"),
      r.appendString(String(n)),
      o.textDirection === qz.RTL &&
        (r.appendString("px;padding-right:"), r.appendString(String(s.verticalScrollbarSize))),
      r.appendString('px;" class="'),
      r.appendString(MQ.CLASS_NAME),
      r.appendString('">'));
    const h = wQ(u, r);
    r.appendString("</div>");
    let g = null;
    return (
      c &&
        OQ &&
        RQ &&
        o.isBasicASCII &&
        u.isLTR &&
        s.useMonospaceOptimizations &&
        0 === h.containsForeignElements &&
        (g = new AQ(
          this._renderedViewLine ? this._renderedViewLine.domNode : null,
          u,
          h.characterMapping,
        )),
      g ||
        (g = FQ(
          this._renderedViewLine ? this._renderedViewLine.domNode : null,
          u,
          h.characterMapping,
          h.containsForeignElements,
        )),
      (this._renderedViewLine = g),
      !0
    );
  }
  layoutLine(e, t, n) {
    this._renderedViewLine &&
      this._renderedViewLine.domNode &&
      (this._renderedViewLine.domNode.setTop(t),
      this._renderedViewLine.domNode.setHeight(n),
      this._renderedViewLine.domNode.setLineHeight(n));
  }
  isRenderedRTL() {
    return !!this._renderedViewLine && this._renderedViewLine.input.textDirection === qz.RTL;
  }
  getWidth(e) {
    return this._renderedViewLine ? this._renderedViewLine.getWidth(e) : 0;
  }
  getWidthIsFast() {
    return !this._renderedViewLine || this._renderedViewLine.getWidthIsFast();
  }
  needsMonospaceFontCheck() {
    return !!this._renderedViewLine && this._renderedViewLine instanceof AQ;
  }
  monospaceAssumptionsAreValid() {
    return this._renderedViewLine && this._renderedViewLine instanceof AQ
      ? this._renderedViewLine.monospaceAssumptionsAreValid()
      : OQ;
  }
  onMonospaceAssumptionsInvalidated() {
    this._renderedViewLine &&
      this._renderedViewLine instanceof AQ &&
      (this._renderedViewLine = this._renderedViewLine.toSlowRenderedLine());
  }
  getVisibleRangesForRange(e, t, n, i) {
    if (!this._renderedViewLine) return null;
    ((t = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, t))),
      (n = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, n))));
    const r = this._renderedViewLine.input.stopRenderingLineAfter;
    if (-1 !== r && t > r + 1 && n > r + 1) return new uQ(!0, [new cQ(this.getWidth(i), 0)]);
    (-1 !== r && t > r + 1 && (t = r + 1), -1 !== r && n > r + 1 && (n = r + 1));
    const o = this._renderedViewLine.getVisibleRangesForRange(e, t, n, i);
    return o && o.length > 0 ? new uQ(!1, o) : null;
  }
  getColumnOfNodeOffset(e, t) {
    return this._renderedViewLine ? this._renderedViewLine.getColumnOfNodeOffset(e, t) : 1;
  }
}
class AQ {
  constructor(e, t, n) {
    ((this._cachedWidth = -1), (this.domNode = e), (this.input = t));
    const i = Math.floor(t.lineContent.length / 300);
    if (i > 0) {
      this._keyColumnPixelOffsetCache = new Float32Array(i);
      for (let e = 0; e < i; e++) this._keyColumnPixelOffsetCache[e] = -1;
    } else this._keyColumnPixelOffsetCache = null;
    ((this._characterMapping = n), (this._charWidth = t.spaceWidth));
  }
  getWidth(e) {
    if (!this.domNode || this.input.lineContent.length < 300) {
      const e = this._characterMapping.getHorizontalOffset(this._characterMapping.length);
      return Math.round(this._charWidth * e);
    }
    return (
      -1 === this._cachedWidth &&
        ((this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth),
        e?.markDidDomLayout()),
      this._cachedWidth
    );
  }
  getWidthIsFast() {
    return this.input.lineContent.length < 300 || -1 !== this._cachedWidth;
  }
  monospaceAssumptionsAreValid() {
    if (!this.domNode) return OQ;
    if (this.input.lineContent.length < 300) {
      const e = this.getWidth(null),
        t = this.domNode.domNode.firstChild.offsetWidth;
      Math.abs(e - t) >= 2 && (OQ = !1);
    }
    return OQ;
  }
  toSlowRenderedLine() {
    return FQ(this.domNode, this.input, this._characterMapping, 0);
  }
  getVisibleRangesForRange(e, t, n, i) {
    const r = this._getColumnPixelOffset(e, t, i),
      o = this._getColumnPixelOffset(e, n, i);
    return [new cQ(r, o - r)];
  }
  _getColumnPixelOffset(e, t, n) {
    if (t <= 300) {
      const e = this._characterMapping.getHorizontalOffset(t);
      return this._charWidth * e;
    }
    const i = Math.floor((t - 1) / 300) - 1,
      r = 300 * (i + 1) + 1;
    let o = -1;
    if (
      (this._keyColumnPixelOffsetCache &&
        ((o = this._keyColumnPixelOffsetCache[i]),
        -1 === o &&
          ((o = this._actualReadPixelOffset(e, r, n)), (this._keyColumnPixelOffsetCache[i] = o))),
      -1 === o)
    ) {
      const e = this._characterMapping.getHorizontalOffset(t);
      return this._charWidth * e;
    }
    const s = this._characterMapping.getHorizontalOffset(r),
      a = this._characterMapping.getHorizontalOffset(t);
    return o + this._charWidth * (a - s);
  }
  _getReadingTarget(e) {
    return e.domNode.firstChild;
  }
  _actualReadPixelOffset(e, t, n) {
    if (!this.domNode) return -1;
    const i = this._characterMapping.getDomPosition(t),
      r = hQ.readHorizontalRanges(
        this._getReadingTarget(this.domNode),
        i.partIndex,
        i.charIndex,
        i.partIndex,
        i.charIndex,
        n,
      );
    return r && 0 !== r.length ? r[0].left : -1;
  }
  getColumnOfNodeOffset(e, t) {
    return WQ(this._characterMapping, e, t);
  }
}
class PQ {
  constructor(e, t, n, i) {
    if (
      ((this.domNode = e),
      (this.input = t),
      (this._characterMapping = n),
      (this._isWhitespaceOnly = /^\s*$/.test(t.lineContent)),
      (this._containsForeignElements = i),
      (this._cachedWidth = -1),
      (this._pixelOffsetCache = null),
      t.isLTR)
    ) {
      this._pixelOffsetCache = new Float32Array(Math.max(2, this._characterMapping.length + 1));
      for (let e = 0, t = this._characterMapping.length; e <= t; e++)
        this._pixelOffsetCache[e] = -1;
    }
  }
  _getReadingTarget(e) {
    return e.domNode.firstChild;
  }
  getWidth(e) {
    return this.domNode
      ? (-1 === this._cachedWidth &&
          ((this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth),
          e?.markDidDomLayout()),
        this._cachedWidth)
      : 0;
  }
  getWidthIsFast() {
    return -1 !== this._cachedWidth;
  }
  getVisibleRangesForRange(e, t, n, i) {
    if (!this.domNode) return null;
    if (null !== this._pixelOffsetCache) {
      const r = this._readPixelOffset(this.domNode, e, t, i);
      if (-1 === r) return null;
      const o = this._readPixelOffset(this.domNode, e, n, i);
      return -1 === o ? null : [new cQ(r, o - r)];
    }
    return this._readVisibleRangesForRange(this.domNode, e, t, n, i);
  }
  _readVisibleRangesForRange(e, t, n, i, r) {
    if (n === i) {
      const i = this._readPixelOffset(e, t, n, r);
      return -1 === i ? null : [new cQ(i, 0)];
    }
    return this._readRawVisibleRangesForRange(e, n, i, r);
  }
  _readPixelOffset(e, t, n, i) {
    if (this.input.isLTR && 0 === this._characterMapping.length) {
      if (0 === this._containsForeignElements) return 0;
      if (2 === this._containsForeignElements) return 0;
      if (1 === this._containsForeignElements) return this.getWidth(i);
      const t = this._getReadingTarget(e);
      return t.firstChild ? (i.markDidDomLayout(), t.firstChild.offsetWidth) : 0;
    }
    if (null !== this._pixelOffsetCache) {
      const r = this._pixelOffsetCache[n];
      if (-1 !== r) return r;
      const o = this._actualReadPixelOffset(e, t, n, i);
      return ((this._pixelOffsetCache[n] = o), o);
    }
    return this._actualReadPixelOffset(e, t, n, i);
  }
  _actualReadPixelOffset(e, t, n, i) {
    if (0 === this._characterMapping.length) {
      const t = hQ.readHorizontalRanges(this._getReadingTarget(e), 0, 0, 0, 0, i);
      return t && 0 !== t.length ? t[0].left : -1;
    }
    if (
      this.input.isLTR &&
      n === this._characterMapping.length &&
      this._isWhitespaceOnly &&
      0 === this._containsForeignElements
    )
      return this.getWidth(i);
    const r = this._characterMapping.getDomPosition(n),
      o = hQ.readHorizontalRanges(
        this._getReadingTarget(e),
        r.partIndex,
        r.charIndex,
        r.partIndex,
        r.charIndex,
        i,
      );
    if (!o || 0 === o.length) return -1;
    const s = o[0].left;
    if (this.input.isBasicASCII) {
      const e = this._characterMapping.getHorizontalOffset(n),
        t = Math.round(this.input.spaceWidth * e);
      if (Math.abs(t - s) <= 1) return t;
    }
    return s;
  }
  _readRawVisibleRangesForRange(e, t, n, i) {
    if (this.input.isLTR && 1 === t && n === this._characterMapping.length)
      return [new cQ(0, this.getWidth(i))];
    const r = this._characterMapping.getDomPosition(t),
      o = this._characterMapping.getDomPosition(n);
    return hQ.readHorizontalRanges(
      this._getReadingTarget(e),
      r.partIndex,
      r.charIndex,
      o.partIndex,
      o.charIndex,
      i,
    );
  }
  getColumnOfNodeOffset(e, t) {
    return WQ(this._characterMapping, e, t);
  }
}
class jQ extends PQ {
  _readVisibleRangesForRange(e, t, n, i, r) {
    const o = super._readVisibleRangesForRange(e, t, n, i, r);
    if (!o || 0 === o.length || n === i || (1 === n && i === this._characterMapping.length))
      return o;
    if (this.input.isLTR) {
      const n = this._readPixelOffset(e, t, i, r);
      if (-1 !== n) {
        const e = o[o.length - 1];
        e.left < n && (e.width = n - e.left);
      }
    }
    return o;
  }
}
const FQ = OI ? BQ : VQ;
function BQ(e, t, n, i) {
  return new jQ(e, t, n, i);
}
function VQ(e, t, n, i) {
  return new PQ(e, t, n, i);
}
function WQ(e, t, n) {
  const i = t.textContent.length;
  let r = -1;
  for (; t; ) ((t = t.previousSibling), r++);
  return e.getColumn(new bQ(r, n), i);
}
class HQ {
  constructor(e = null) {
    ((this.hitTarget = e), (this.type = 0));
  }
}
class zQ {
  get hitTarget() {
    return this.spanNode;
  }
  constructor(e, t, n) {
    ((this.position = e), (this.spanNode = t), (this.injectedText = n), (this.type = 1));
  }
}
var UQ;
!(function (e) {
  e.createFromDOMInfo = function (e, t, n) {
    const i = e.getPositionFromDOMInfo(t, n);
    return i ? new zQ(i, t, null) : new HQ(t);
  };
})(UQ || (UQ = {}));
class $Q {
  constructor(e, t) {
    ((this.lastViewCursorsRenderData = e), (this.lastTextareaPosition = t));
  }
}
class qQ {
  static _deduceRage(e, t = null) {
    return !t && e ? new YH(e.lineNumber, e.column, e.lineNumber, e.column) : (t ?? null);
  }
  static createUnknown(e, t, n) {
    return { type: 0, element: e, mouseColumn: t, position: n, range: this._deduceRage(n) };
  }
  static createTextarea(e, t) {
    return { type: 1, element: e, mouseColumn: t, position: null, range: null };
  }
  static createMargin(e, t, n, i, r, o) {
    return { type: e, element: t, mouseColumn: n, position: i, range: r, detail: o };
  }
  static createViewZone(e, t, n, i, r) {
    return {
      type: e,
      element: t,
      mouseColumn: n,
      position: i,
      range: this._deduceRage(i),
      detail: r,
    };
  }
  static createContentText(e, t, n, i, r) {
    return {
      type: 6,
      element: e,
      mouseColumn: t,
      position: n,
      range: this._deduceRage(n, i),
      detail: r,
    };
  }
  static createContentEmpty(e, t, n, i) {
    return {
      type: 7,
      element: e,
      mouseColumn: t,
      position: n,
      range: this._deduceRage(n),
      detail: i,
    };
  }
  static createContentWidget(e, t, n) {
    return { type: 9, element: e, mouseColumn: t, position: null, range: null, detail: n };
  }
  static createScrollbar(e, t, n) {
    return { type: 11, element: e, mouseColumn: t, position: n, range: this._deduceRage(n) };
  }
  static createOverlayWidget(e, t, n) {
    return { type: 12, element: e, mouseColumn: t, position: null, range: null, detail: n };
  }
  static createOutsideEditor(e, t, n, i) {
    return {
      type: 13,
      element: null,
      mouseColumn: e,
      position: t,
      range: this._deduceRage(t),
      outsidePosition: n,
      outsideDistance: i,
    };
  }
  static _typeToString(e) {
    return 1 === e
      ? "TEXTAREA"
      : 2 === e
        ? "GUTTER_GLYPH_MARGIN"
        : 3 === e
          ? "GUTTER_LINE_NUMBERS"
          : 4 === e
            ? "GUTTER_LINE_DECORATIONS"
            : 5 === e
              ? "GUTTER_VIEW_ZONE"
              : 6 === e
                ? "CONTENT_TEXT"
                : 7 === e
                  ? "CONTENT_EMPTY"
                  : 8 === e
                    ? "CONTENT_VIEW_ZONE"
                    : 9 === e
                      ? "CONTENT_WIDGET"
                      : 10 === e
                        ? "OVERVIEW_RULER"
                        : 11 === e
                          ? "SCROLLBAR"
                          : 12 === e
                            ? "OVERLAY_WIDGET"
                            : "UNKNOWN";
  }
  static toString(e) {
    return (
      this._typeToString(e.type) +
      ": " +
      e.position +
      " - " +
      e.range +
      " - " +
      JSON.stringify(e.detail)
    );
  }
}
class KQ {
  static isTextArea(e) {
    return 2 === e.length && 3 === e[0] && 7 === e[1];
  }
  static isChildOfViewLines(e) {
    return e.length >= 4 && 3 === e[0] && 8 === e[3];
  }
  static isStrictChildOfViewLines(e) {
    return e.length > 4 && 3 === e[0] && 8 === e[3];
  }
  static isChildOfScrollableElement(e) {
    return e.length >= 2 && 3 === e[0] && 6 === e[1];
  }
  static isChildOfMinimap(e) {
    return e.length >= 2 && 3 === e[0] && 9 === e[1];
  }
  static isChildOfContentWidgets(e) {
    return e.length >= 4 && 3 === e[0] && 1 === e[3];
  }
  static isChildOfOverflowGuard(e) {
    return e.length >= 1 && 3 === e[0];
  }
  static isChildOfOverflowingContentWidgets(e) {
    return e.length >= 1 && 2 === e[0];
  }
  static isChildOfOverlayWidgets(e) {
    return e.length >= 2 && 3 === e[0] && 4 === e[1];
  }
  static isChildOfOverflowingOverlayWidgets(e) {
    return e.length >= 1 && 5 === e[0];
  }
}
class GQ {
  constructor(e, t, n) {
    this.viewModel = e.viewModel;
    const i = e.configuration.options;
    ((this.layoutInfo = i.get(165)),
      (this.viewDomNode = t.viewDomNode),
      (this.viewLinesGpu = t.viewLinesGpu),
      (this.lineHeight = i.get(75)),
      (this.stickyTabStops = i.get(132)),
      (this.typicalHalfwidthCharacterWidth = i.get(59).typicalHalfwidthCharacterWidth),
      (this.lastRenderData = n),
      (this._context = e),
      (this._viewHelper = t));
  }
  getZoneAtCoord(e) {
    return GQ.getZoneAtCoord(this._context, e);
  }
  static getZoneAtCoord(e, t) {
    const n = e.viewLayout.getWhitespaceAtVerticalOffset(t);
    if (n) {
      const i = n.verticalOffset + n.height / 2,
        r = e.viewModel.getLineCount();
      let o,
        s = null,
        a = null;
      return (
        n.afterLineNumber !== r && (a = new xV(n.afterLineNumber + 1, 1)),
        n.afterLineNumber > 0 &&
          (s = new xV(n.afterLineNumber, e.viewModel.getLineMaxColumn(n.afterLineNumber))),
        (o = null === a ? s : null === s ? a : t < i ? s : a),
        {
          viewZoneId: n.id,
          afterLineNumber: n.afterLineNumber,
          positionBefore: s,
          positionAfter: a,
          position: o,
        }
      );
    }
    return null;
  }
  getFullLineRangeAtCoord(e) {
    if (this._context.viewLayout.isAfterLines(e)) {
      const e = this._context.viewModel.getLineCount(),
        t = this._context.viewModel.getLineMaxColumn(e);
      return { range: new YH(e, t, e, t), isAfterLines: !0 };
    }
    const t = this._context.viewLayout.getLineNumberAtVerticalOffset(e),
      n = this._context.viewModel.getLineMaxColumn(t);
    return { range: new YH(t, 1, t, n), isAfterLines: !1 };
  }
  getLineNumberAtVerticalOffset(e) {
    return this._context.viewLayout.getLineNumberAtVerticalOffset(e);
  }
  isAfterLines(e) {
    return this._context.viewLayout.isAfterLines(e);
  }
  isInTopPadding(e) {
    return this._context.viewLayout.isInTopPadding(e);
  }
  isInBottomPadding(e) {
    return this._context.viewLayout.isInBottomPadding(e);
  }
  getVerticalOffsetForLineNumber(e) {
    return this._context.viewLayout.getVerticalOffsetForLineNumber(e);
  }
  findAttribute(e, t) {
    return GQ._findAttribute(e, t, this._viewHelper.viewDomNode);
  }
  static _findAttribute(e, t, n) {
    for (; e && e !== e.ownerDocument.body; ) {
      if (e.hasAttribute && e.hasAttribute(t)) return e.getAttribute(t);
      if (e === n) return null;
      e = e.parentNode;
    }
    return null;
  }
  getLineWidth(e) {
    return this._viewHelper.getLineWidth(e);
  }
  isRtl(e) {
    return this.viewModel.getTextDirection(e) === qz.RTL;
  }
  visibleRangeForPosition(e, t) {
    return this._viewHelper.visibleRangeForPosition(e, t);
  }
  getPositionFromDOMInfo(e, t) {
    return this._viewHelper.getPositionFromDOMInfo(e, t);
  }
  getCurrentScrollTop() {
    return this._context.viewLayout.getCurrentScrollTop();
  }
  getCurrentScrollLeft() {
    return this._context.viewLayout.getCurrentScrollLeft();
  }
}
class ZQ {
  constructor(e, t, n, i) {
    ((this.editorPos = t),
      (this.pos = n),
      (this.relativePos = i),
      (this.mouseVerticalOffset = Math.max(0, e.getCurrentScrollTop() + this.relativePos.y)),
      (this.mouseContentHorizontalOffset =
        e.getCurrentScrollLeft() + this.relativePos.x - e.layoutInfo.contentLeft),
      (this.isInMarginArea =
        this.relativePos.x < e.layoutInfo.contentLeft &&
        this.relativePos.x >= e.layoutInfo.glyphMarginLeft),
      (this.isInContentArea = !this.isInMarginArea),
      (this.mouseColumn = Math.max(
        0,
        JQ._getMouseColumn(this.mouseContentHorizontalOffset, e.typicalHalfwidthCharacterWidth),
      )));
  }
}
class YQ extends ZQ {
  get target() {
    return this._useHitTestTarget ? this.hitTestResult.value.hitTarget : this._eventTarget;
  }
  get targetPath() {
    return (
      this._targetPathCacheElement !== this.target &&
        ((this._targetPathCacheElement = this.target),
        (this._targetPathCacheValue = rQ.collect(this.target, this._ctx.viewDomNode))),
      this._targetPathCacheValue
    );
  }
  constructor(e, t, n, i, r) {
    (super(e, t, n, i),
      (this.hitTestResult = new FM(() => JQ.doHitTest(this._ctx, this))),
      (this._targetPathCacheElement = null),
      (this._targetPathCacheValue = new Uint8Array(0)),
      (this._ctx = e),
      (this._eventTarget = r));
    const o = Boolean(this._eventTarget);
    this._useHitTestTarget = !o;
  }
  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}\n\ttarget: ${this.target ? this.target.outerHTML : null}`;
  }
  get wouldBenefitFromHitTestTargetSwitch() {
    return (
      !this._useHitTestTarget &&
      null !== this.hitTestResult.value.hitTarget &&
      this.target !== this.hitTestResult.value.hitTarget
    );
  }
  switchToHitTestTarget() {
    this._useHitTestTarget = !0;
  }
  _getMouseColumn(e = null) {
    return e && e.column < this._ctx.viewModel.getLineMaxColumn(e.lineNumber)
      ? tz.visibleColumnFromColumn(
          this._ctx.viewModel.getLineContent(e.lineNumber),
          e.column,
          this._ctx.viewModel.model.getOptions().tabSize,
        ) + 1
      : this.mouseColumn;
  }
  fulfillUnknown(e = null) {
    return qQ.createUnknown(this.target, this._getMouseColumn(e), e);
  }
  fulfillTextarea() {
    return qQ.createTextarea(this.target, this._getMouseColumn());
  }
  fulfillMargin(e, t, n, i) {
    return qQ.createMargin(e, this.target, this._getMouseColumn(t), t, n, i);
  }
  fulfillViewZone(e, t, n) {
    return qQ.createViewZone(e, this.target, this._getMouseColumn(), t, n);
  }
  fulfillContentText(e, t, n) {
    return qQ.createContentText(this.target, this._getMouseColumn(e), e, t, n);
  }
  fulfillContentEmpty(e, t) {
    return qQ.createContentEmpty(this.target, this._getMouseColumn(e), e, t);
  }
  fulfillContentWidget(e) {
    return qQ.createContentWidget(this.target, this._getMouseColumn(), e);
  }
  fulfillScrollbar(e) {
    return qQ.createScrollbar(this.target, this._getMouseColumn(e), e);
  }
  fulfillOverlayWidget(e) {
    return qQ.createOverlayWidget(this.target, this._getMouseColumn(), e);
  }
}
const XQ = { isAfterLines: !0 };
function QQ(e) {
  return { isAfterLines: !1, horizontalDistanceToText: e };
}
class JQ {
  constructor(e, t) {
    ((this._context = e), (this._viewHelper = t));
  }
  mouseTargetIsWidget(e) {
    const t = e.target,
      n = rQ.collect(t, this._viewHelper.viewDomNode);
    return (
      !(!KQ.isChildOfContentWidgets(n) && !KQ.isChildOfOverflowingContentWidgets(n)) ||
      !(!KQ.isChildOfOverlayWidgets(n) && !KQ.isChildOfOverflowingOverlayWidgets(n))
    );
  }
  createMouseTarget(e, t, n, i, r) {
    const o = new GQ(this._context, this._viewHelper, e),
      s = new YQ(o, t, n, i, r);
    try {
      const e = JQ._createMouseTarget(o, s);
      if (6 === e.type && o.stickyTabStops && null !== e.position) {
        const t = JQ._snapToSoftTabBoundary(e.position, o.viewModel),
          n = YH.fromPositions(t, t).plusRange(e.range);
        return s.fulfillContentText(t, n, e.detail);
      }
      return e;
    } catch (a) {
      return s.fulfillUnknown();
    }
  }
  static _createMouseTarget(e, t) {
    if (null === t.target) return t.fulfillUnknown();
    const n = t;
    let i = null;
    return (
      KQ.isChildOfOverflowGuard(t.targetPath) ||
        KQ.isChildOfOverflowingContentWidgets(t.targetPath) ||
        KQ.isChildOfOverflowingOverlayWidgets(t.targetPath) ||
        (i = i || t.fulfillUnknown()),
      (i = i || JQ._hitTestContentWidget(e, n)),
      (i = i || JQ._hitTestOverlayWidget(e, n)),
      (i = i || JQ._hitTestMinimap(e, n)),
      (i = i || JQ._hitTestScrollbarSlider(e, n)),
      (i = i || JQ._hitTestViewZone(e, n)),
      (i = i || JQ._hitTestMargin(e, n)),
      (i = i || JQ._hitTestViewCursor(e, n)),
      (i = i || JQ._hitTestTextArea(e, n)),
      (i = i || JQ._hitTestViewLines(e, n)),
      (i = i || JQ._hitTestScrollbar(e, n)),
      i || t.fulfillUnknown()
    );
  }
  static _hitTestContentWidget(e, t) {
    if (
      KQ.isChildOfContentWidgets(t.targetPath) ||
      KQ.isChildOfOverflowingContentWidgets(t.targetPath)
    ) {
      const n = e.findAttribute(t.target, "widgetId");
      return n ? t.fulfillContentWidget(n) : t.fulfillUnknown();
    }
    return null;
  }
  static _hitTestOverlayWidget(e, t) {
    if (
      KQ.isChildOfOverlayWidgets(t.targetPath) ||
      KQ.isChildOfOverflowingOverlayWidgets(t.targetPath)
    ) {
      const n = e.findAttribute(t.target, "widgetId");
      return n ? t.fulfillOverlayWidget(n) : t.fulfillUnknown();
    }
    return null;
  }
  static _hitTestViewCursor(e, t) {
    if (t.target) {
      const n = e.lastRenderData.lastViewCursorsRenderData;
      for (const e of n)
        if (t.target === e.domNode)
          return t.fulfillContentText(e.position, null, {
            mightBeForeignElement: !1,
            injectedText: null,
          });
    }
    if (t.isInContentArea) {
      const n = e.lastRenderData.lastViewCursorsRenderData,
        i = t.mouseContentHorizontalOffset,
        r = t.mouseVerticalOffset;
      for (const o of n) {
        if (i < o.contentLeft) continue;
        if (i > o.contentLeft + o.width) continue;
        const n = e.getVerticalOffsetForLineNumber(o.position.lineNumber);
        if (n <= r && r <= n + o.height)
          return t.fulfillContentText(o.position, null, {
            mightBeForeignElement: !1,
            injectedText: null,
          });
      }
    }
    return null;
  }
  static _hitTestViewZone(e, t) {
    const n = e.getZoneAtCoord(t.mouseVerticalOffset);
    if (n) {
      const e = t.isInContentArea ? 8 : 5;
      return t.fulfillViewZone(e, n.position, n);
    }
    return null;
  }
  static _hitTestTextArea(e, t) {
    return KQ.isTextArea(t.targetPath)
      ? e.lastRenderData.lastTextareaPosition
        ? t.fulfillContentText(e.lastRenderData.lastTextareaPosition, null, {
            mightBeForeignElement: !1,
            injectedText: null,
          })
        : t.fulfillTextarea()
      : null;
  }
  static _hitTestMargin(e, t) {
    if (t.isInMarginArea) {
      const n = e.getFullLineRangeAtCoord(t.mouseVerticalOffset),
        i = n.range.getStartPosition();
      let r = Math.abs(t.relativePos.x);
      const o = {
        isAfterLines: n.isAfterLines,
        glyphMarginLeft: e.layoutInfo.glyphMarginLeft,
        glyphMarginWidth: e.layoutInfo.glyphMarginWidth,
        lineNumbersWidth: e.layoutInfo.lineNumbersWidth,
        offsetX: r,
      };
      if (((r -= e.layoutInfo.glyphMarginLeft), r <= e.layoutInfo.glyphMarginWidth)) {
        const s = e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(
            n.range.getStartPosition(),
          ),
          a = e.viewModel.glyphLanes.getLanesAtLine(s.lineNumber);
        return (
          (o.glyphMarginLane = a[Math.floor(r / e.lineHeight)]),
          t.fulfillMargin(2, i, n.range, o)
        );
      }
      return (
        (r -= e.layoutInfo.glyphMarginWidth),
        r <= e.layoutInfo.lineNumbersWidth
          ? t.fulfillMargin(3, i, n.range, o)
          : ((r -= e.layoutInfo.lineNumbersWidth), t.fulfillMargin(4, i, n.range, o))
      );
    }
    return null;
  }
  static _hitTestViewLines(e, t) {
    if (!KQ.isChildOfViewLines(t.targetPath)) return null;
    if (e.isInTopPadding(t.mouseVerticalOffset)) return t.fulfillContentEmpty(new xV(1, 1), XQ);
    if (e.isAfterLines(t.mouseVerticalOffset) || e.isInBottomPadding(t.mouseVerticalOffset)) {
      const n = e.viewModel.getLineCount(),
        i = e.viewModel.getLineMaxColumn(n);
      return t.fulfillContentEmpty(new xV(n, i), XQ);
    }
    if (KQ.isStrictChildOfViewLines(t.targetPath)) {
      const n = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),
        i = e.viewModel.getLineLength(n),
        r = e.getLineWidth(n);
      if (0 === i) {
        const e = QQ(t.mouseContentHorizontalOffset - r);
        return t.fulfillContentEmpty(new xV(n, 1), e);
      }
      if (e.isRtl(n)) {
        if (
          t.mouseContentHorizontalOffset + r <=
          e.layoutInfo.contentWidth - e.layoutInfo.verticalScrollbarWidth
        ) {
          const i = QQ(t.mouseContentHorizontalOffset - r),
            o = new xV(n, e.viewModel.getLineMaxColumn(n));
          return t.fulfillContentEmpty(o, i);
        }
      } else if (t.mouseContentHorizontalOffset >= r) {
        const i = QQ(t.mouseContentHorizontalOffset - r),
          o = new xV(n, e.viewModel.getLineMaxColumn(n));
        return t.fulfillContentEmpty(o, i);
      }
    } else if (e.viewLinesGpu) {
      const n = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);
      if (0 === e.viewModel.getLineLength(n)) {
        const i = e.getLineWidth(n),
          r = QQ(t.mouseContentHorizontalOffset - i);
        return t.fulfillContentEmpty(new xV(n, 1), r);
      }
      const i = e.getLineWidth(n);
      if (e.isRtl(n)) {
        if (
          t.mouseContentHorizontalOffset + i <=
          e.layoutInfo.contentWidth - e.layoutInfo.verticalScrollbarWidth
        ) {
          const r = QQ(t.mouseContentHorizontalOffset - i),
            o = new xV(n, e.viewModel.getLineMaxColumn(n));
          return t.fulfillContentEmpty(o, r);
        }
      } else if (t.mouseContentHorizontalOffset >= i) {
        const r = QQ(t.mouseContentHorizontalOffset - i),
          o = new xV(n, e.viewModel.getLineMaxColumn(n));
        return t.fulfillContentEmpty(o, r);
      }
      const r = e.viewLinesGpu.getPositionAtCoordinate(n, t.mouseContentHorizontalOffset);
      if (r) {
        const e = { injectedText: null, mightBeForeignElement: !1 };
        return t.fulfillContentText(r, YH.fromPositions(r, r), e);
      }
    }
    const n = t.hitTestResult.value;
    return 1 === n.type
      ? JQ.createMouseTargetFromHitTestPosition(e, t, n.spanNode, n.position, n.injectedText)
      : t.wouldBenefitFromHitTestTargetSwitch
        ? (t.switchToHitTestTarget(), this._createMouseTarget(e, t))
        : t.fulfillUnknown();
  }
  static _hitTestMinimap(e, t) {
    if (KQ.isChildOfMinimap(t.targetPath)) {
      const n = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),
        i = e.viewModel.getLineMaxColumn(n);
      return t.fulfillScrollbar(new xV(n, i));
    }
    return null;
  }
  static _hitTestScrollbarSlider(e, t) {
    if (KQ.isChildOfScrollableElement(t.targetPath) && t.target && 1 === t.target.nodeType) {
      const n = t.target.className;
      if (n && /\b(slider|scrollbar)\b/.test(n)) {
        const n = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),
          i = e.viewModel.getLineMaxColumn(n);
        return t.fulfillScrollbar(new xV(n, i));
      }
    }
    return null;
  }
  static _hitTestScrollbar(e, t) {
    if (KQ.isChildOfScrollableElement(t.targetPath)) {
      const n = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),
        i = e.viewModel.getLineMaxColumn(n);
      return t.fulfillScrollbar(new xV(n, i));
    }
    return null;
  }
  getMouseColumn(e) {
    const t = this._context.configuration.options,
      n = t.get(165),
      i = this._context.viewLayout.getCurrentScrollLeft() + e.x - n.contentLeft;
    return JQ._getMouseColumn(i, t.get(59).typicalHalfwidthCharacterWidth);
  }
  static _getMouseColumn(e, t) {
    if (e < 0) return 1;
    return Math.round(e / t) + 1;
  }
  static createMouseTargetFromHitTestPosition(e, t, n, i, r) {
    const o = i.lineNumber,
      s = i.column,
      a = e.getLineWidth(o);
    if (t.mouseContentHorizontalOffset > a) {
      const e = QQ(t.mouseContentHorizontalOffset - a);
      return t.fulfillContentEmpty(i, e);
    }
    const l = e.visibleRangeForPosition(o, s);
    if (!l) return t.fulfillUnknown(i);
    const c = l.left;
    if (Math.abs(t.mouseContentHorizontalOffset - c) < 1)
      return t.fulfillContentText(i, null, { mightBeForeignElement: !!r, injectedText: r });
    const d = [];
    if ((d.push({ offset: l.left, column: s }), s > 1)) {
      const t = e.visibleRangeForPosition(o, s - 1);
      t && d.push({ offset: t.left, column: s - 1 });
    }
    if (s < e.viewModel.getLineMaxColumn(o)) {
      const t = e.visibleRangeForPosition(o, s + 1);
      t && d.push({ offset: t.left, column: s + 1 });
    }
    d.sort((e, t) => e.offset - t.offset);
    const u = t.pos.toClientCoordinates(MF(e.viewDomNode)),
      h = n.getBoundingClientRect(),
      g = h.left <= u.clientX && u.clientX <= h.right;
    let p = null;
    for (let f = 1; f < d.length; f++) {
      const e = d[f - 1],
        n = d[f];
      if (
        e.offset <= t.mouseContentHorizontalOffset &&
        t.mouseContentHorizontalOffset <= n.offset
      ) {
        p = new YH(o, e.column, o, n.column);
        const r = Math.abs(e.offset - t.mouseContentHorizontalOffset),
          s = Math.abs(n.offset - t.mouseContentHorizontalOffset);
        i = new xV(o, r < s ? e.column : n.column);
        break;
      }
    }
    return t.fulfillContentText(i, p, { mightBeForeignElement: !g || !!r, injectedText: r });
  }
  static _doHitTestWithCaretRangeFromPoint(e, t) {
    const n = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),
      i = e.getVerticalOffsetForLineNumber(n),
      r = i + e.lineHeight;
    if (!(n === e.viewModel.getLineCount() && t.mouseVerticalOffset > r)) {
      const n = Math.floor((i + r) / 2);
      let o = t.pos.y + (n - t.mouseVerticalOffset);
      (o <= t.editorPos.y && (o = t.editorPos.y + 1),
        o >= t.editorPos.y + t.editorPos.height && (o = t.editorPos.y + t.editorPos.height - 1));
      const s = new zX(t.pos.x, o),
        a = this._actualDoHitTestWithCaretRangeFromPoint(
          e,
          s.toClientCoordinates(MF(e.viewDomNode)),
        );
      if (1 === a.type) return a;
    }
    return this._actualDoHitTestWithCaretRangeFromPoint(
      e,
      t.pos.toClientCoordinates(MF(e.viewDomNode)),
    );
  }
  static _actualDoHitTestWithCaretRangeFromPoint(e, t) {
    const n = _B(e.viewDomNode);
    let i;
    if (
      ((i = n
        ? void 0 === n.caretRangeFromPoint
          ? (function (e, t, n) {
              const i = document.createRange();
              let r = e.elementFromPoint(t, n);
              if (r?.hasChildNodes()) {
                for (
                  ;
                  r &&
                  r.firstChild &&
                  r.firstChild.nodeType !== r.firstChild.TEXT_NODE &&
                  r.lastChild &&
                  r.lastChild.firstChild;
                )
                  r = r.lastChild;
                const e = r.getBoundingClientRect(),
                  n = MF(r),
                  o = `${n.getComputedStyle(r, null).getPropertyValue("font-style")} ${n.getComputedStyle(r, null).getPropertyValue("font-variant")} ${n.getComputedStyle(r, null).getPropertyValue("font-weight")} ${n.getComputedStyle(r, null).getPropertyValue("font-size")}/${n.getComputedStyle(r, null).getPropertyValue("line-height")} ${n.getComputedStyle(r, null).getPropertyValue("font-family")}`,
                  s = r.innerText;
                let a,
                  l = e.left,
                  c = 0;
                if (t > e.left + e.width) c = s.length;
                else {
                  const e = eJ.getInstance();
                  for (let n = 0; n < s.length + 1; n++) {
                    if (((a = e.getCharWidth(s.charAt(n), o) / 2), (l += a), t < l)) {
                      c = n;
                      break;
                    }
                    l += a;
                  }
                }
                (i.setStart(r.firstChild, c), i.setEnd(r.firstChild, c));
              }
              return i;
            })(n, t.clientX, t.clientY)
          : n.caretRangeFromPoint(t.clientX, t.clientY)
        : e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX, t.clientY)),
      !i || !i.startContainer)
    )
      return new HQ();
    const r = i.startContainer;
    if (r.nodeType === r.TEXT_NODE) {
      const t = r.parentNode,
        n = t ? t.parentNode : null,
        o = n ? n.parentNode : null;
      return (o && o.nodeType === o.ELEMENT_NODE ? o.className : null) === MQ.CLASS_NAME
        ? UQ.createFromDOMInfo(e, t, i.startOffset)
        : new HQ(r.parentNode);
    }
    if (r.nodeType === r.ELEMENT_NODE) {
      const t = r.parentNode,
        n = t ? t.parentNode : null;
      return (n && n.nodeType === n.ELEMENT_NODE ? n.className : null) === MQ.CLASS_NAME
        ? UQ.createFromDOMInfo(e, r, r.textContent.length)
        : new HQ(r);
    }
    return new HQ();
  }
  static _doHitTestWithCaretPositionFromPoint(e, t) {
    const n = e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX, t.clientY);
    if (n.offsetNode.nodeType === n.offsetNode.TEXT_NODE) {
      const t = n.offsetNode.parentNode,
        i = t ? t.parentNode : null,
        r = i ? i.parentNode : null;
      return (r && r.nodeType === r.ELEMENT_NODE ? r.className : null) === MQ.CLASS_NAME
        ? UQ.createFromDOMInfo(e, n.offsetNode.parentNode, n.offset)
        : new HQ(n.offsetNode.parentNode);
    }
    if (n.offsetNode.nodeType === n.offsetNode.ELEMENT_NODE) {
      const t = n.offsetNode.parentNode,
        i = t && t.nodeType === t.ELEMENT_NODE ? t.className : null,
        r = t ? t.parentNode : null,
        o = r && r.nodeType === r.ELEMENT_NODE ? r.className : null;
      if (i === MQ.CLASS_NAME) {
        const t = n.offsetNode.childNodes[Math.min(n.offset, n.offsetNode.childNodes.length - 1)];
        if (t) return UQ.createFromDOMInfo(e, t, 0);
      } else if (o === MQ.CLASS_NAME) return UQ.createFromDOMInfo(e, n.offsetNode, 0);
    }
    return new HQ(n.offsetNode);
  }
  static _snapToSoftTabBoundary(e, t) {
    const n = t.getLineContent(e.lineNumber),
      { tabSize: i } = t.model.getOptions(),
      r = Cz.atomicPosition(n, e.column - 1, i, 2);
    return -1 !== r ? new xV(e.lineNumber, r + 1) : e;
  }
  static doHitTest(e, t) {
    let n = new HQ();
    if (
      ("function" == typeof e.viewDomNode.ownerDocument.caretRangeFromPoint
        ? (n = this._doHitTestWithCaretRangeFromPoint(e, t))
        : e.viewDomNode.ownerDocument.caretPositionFromPoint &&
          (n = this._doHitTestWithCaretPositionFromPoint(
            e,
            t.pos.toClientCoordinates(MF(e.viewDomNode)),
          )),
      1 === n.type)
    ) {
      const t = e.viewModel.getInjectedTextAt(n.position),
        i = e.viewModel.normalizePosition(n.position, 2);
      (!t && i.equals(n.position)) || (n = new zQ(i, n.spanNode, t));
    }
    return n;
  }
}
class eJ {
  static {
    this._INSTANCE = null;
  }
  static getInstance() {
    return (eJ._INSTANCE || (eJ._INSTANCE = new eJ()), eJ._INSTANCE);
  }
  constructor() {
    ((this._cache = {}), (this._canvas = document.createElement("canvas")));
  }
  getCharWidth(e, t) {
    const n = e + t;
    if (this._cache[n]) return this._cache[n];
    const i = this._canvas.getContext("2d");
    i.font = t;
    const r = i.measureText(e).width;
    return ((this._cache[n] = r), r);
  }
}
function tJ(e, t, n) {
  let i = null,
    r = null;
  if (
    ("function" == typeof n.value
      ? ((i = "value"), (r = n.value), r.length)
      : "function" == typeof n.get && ((i = "get"), (r = n.get)),
    !r)
  )
    throw new Error("not supported");
  const o = `$memoize$${t}`;
  n[i] = function (...e) {
    return (
      this.hasOwnProperty(o) ||
        Object.defineProperty(this, o, {
          configurable: !1,
          enumerable: !1,
          writable: !1,
          value: r.apply(this, e),
        }),
      this[o]
    );
  };
}
var nJ;
!(function (e) {
  ((e.Tap = "-monaco-gesturetap"),
    (e.Change = "-monaco-gesturechange"),
    (e.Start = "-monaco-gesturestart"),
    (e.End = "-monaco-gesturesend"),
    (e.Contextmenu = "-monaco-gesturecontextmenu"));
})(nJ || (nJ = {}));
class iJ extends PO {
  static {
    this.SCROLL_FRICTION = -0.005;
  }
  static {
    this.HOLD_DELAY = 700;
  }
  static {
    this.CLEAR_TAP_COUNT_TIME = 400;
  }
  constructor() {
    (super(),
      (this.dispatched = !1),
      (this.targets = new HO()),
      (this.ignoreTargets = new HO()),
      (this.activeTouches = {}),
      (this.handle = null),
      (this._lastSetTapCountTime = 0),
      this._register(
        $O.runAndSubscribe(
          VF,
          ({ window: e, disposables: t }) => {
            (t.add($F(e.document, "touchstart", (e) => this.onTouchStart(e), { passive: !1 })),
              t.add($F(e.document, "touchend", (t) => this.onTouchEnd(e, t))),
              t.add($F(e.document, "touchmove", (e) => this.onTouchMove(e), { passive: !1 })));
          },
          { window: NI, disposables: this._store },
        ),
      ));
  }
  static addTarget(e) {
    if (!iJ.isTouchDevice()) return PO.None;
    iJ.INSTANCE || (iJ.INSTANCE = new iJ());
    return MO(iJ.INSTANCE.targets.push(e));
  }
  static ignoreTarget(e) {
    if (!iJ.isTouchDevice()) return PO.None;
    iJ.INSTANCE || (iJ.INSTANCE = new iJ());
    return MO(iJ.INSTANCE.ignoreTargets.push(e));
  }
  static isTouchDevice() {
    return "ontouchstart" in NI || navigator.maxTouchPoints > 0;
  }
  dispose() {
    (this.handle && (this.handle.dispose(), (this.handle = null)), super.dispose());
  }
  onTouchStart(e) {
    const t = Date.now();
    this.handle && (this.handle.dispose(), (this.handle = null));
    for (let n = 0, i = e.targetTouches.length; n < i; n++) {
      const i = e.targetTouches.item(n);
      this.activeTouches[i.identifier] = {
        id: i.identifier,
        initialTarget: i.target,
        initialTimeStamp: t,
        initialPageX: i.pageX,
        initialPageY: i.pageY,
        rollingTimestamps: [t],
        rollingPageX: [i.pageX],
        rollingPageY: [i.pageY],
      };
      const r = this.newGestureEvent(nJ.Start, i.target);
      ((r.pageX = i.pageX), (r.pageY = i.pageY), this.dispatchEvent(r));
    }
    this.dispatched && (e.preventDefault(), e.stopPropagation(), (this.dispatched = !1));
  }
  onTouchEnd(e, t) {
    const n = Date.now(),
      i = Object.keys(this.activeTouches).length;
    for (let r = 0, o = t.changedTouches.length; r < o; r++) {
      const o = t.changedTouches.item(r);
      if (!this.activeTouches.hasOwnProperty(String(o.identifier))) continue;
      const s = this.activeTouches[o.identifier],
        a = Date.now() - s.initialTimeStamp;
      if (
        a < iJ.HOLD_DELAY &&
        Math.abs(s.initialPageX - s.rollingPageX.at(-1)) < 30 &&
        Math.abs(s.initialPageY - s.rollingPageY.at(-1)) < 30
      ) {
        const e = this.newGestureEvent(nJ.Tap, s.initialTarget);
        ((e.pageX = s.rollingPageX.at(-1)),
          (e.pageY = s.rollingPageY.at(-1)),
          this.dispatchEvent(e));
      } else if (
        a >= iJ.HOLD_DELAY &&
        Math.abs(s.initialPageX - s.rollingPageX.at(-1)) < 30 &&
        Math.abs(s.initialPageY - s.rollingPageY.at(-1)) < 30
      ) {
        const e = this.newGestureEvent(nJ.Contextmenu, s.initialTarget);
        ((e.pageX = s.rollingPageX.at(-1)),
          (e.pageY = s.rollingPageY.at(-1)),
          this.dispatchEvent(e));
      } else if (1 === i) {
        const t = s.rollingPageX.at(-1),
          i = s.rollingPageY.at(-1),
          r = s.rollingTimestamps.at(-1) - s.rollingTimestamps[0],
          o = t - s.rollingPageX[0],
          a = i - s.rollingPageY[0],
          l = [...this.targets].filter(
            (e) => s.initialTarget instanceof Node && e.contains(s.initialTarget),
          );
        this.inertia(
          e,
          l,
          n,
          Math.abs(o) / r,
          o > 0 ? 1 : -1,
          t,
          Math.abs(a) / r,
          a > 0 ? 1 : -1,
          i,
        );
      }
      (this.dispatchEvent(this.newGestureEvent(nJ.End, s.initialTarget)),
        delete this.activeTouches[o.identifier]);
    }
    this.dispatched && (t.preventDefault(), t.stopPropagation(), (this.dispatched = !1));
  }
  newGestureEvent(e, t) {
    const n = document.createEvent("CustomEvent");
    return (n.initEvent(e, !1, !0), (n.initialTarget = t), (n.tapCount = 0), n);
  }
  dispatchEvent(e) {
    if (e.type === nJ.Tap) {
      const t = new Date().getTime();
      let n = 0;
      ((n = t - this._lastSetTapCountTime > iJ.CLEAR_TAP_COUNT_TIME ? 1 : 2),
        (this._lastSetTapCountTime = t),
        (e.tapCount = n));
    } else (e.type !== nJ.Change && e.type !== nJ.Contextmenu) || (this._lastSetTapCountTime = 0);
    if (e.initialTarget instanceof Node) {
      for (const n of this.ignoreTargets) if (n.contains(e.initialTarget)) return;
      const t = [];
      for (const n of this.targets)
        if (n.contains(e.initialTarget)) {
          let i = 0,
            r = e.initialTarget;
          for (; r && r !== n; ) (i++, (r = r.parentElement));
          t.push([i, n]);
        }
      t.sort((e, t) => e[0] - t[0]);
      for (const [n, i] of t) (i.dispatchEvent(e), (this.dispatched = !0));
    }
  }
  inertia(e, t, n, i, r, o, s, a, l) {
    this.handle = JF(e, () => {
      const c = Date.now(),
        d = c - n;
      let u = 0,
        h = 0,
        g = !0;
      ((i += iJ.SCROLL_FRICTION * d),
        (s += iJ.SCROLL_FRICTION * d),
        i > 0 && ((g = !1), (u = r * i * d)),
        s > 0 && ((g = !1), (h = a * s * d)));
      const p = this.newGestureEvent(nJ.Change);
      ((p.translationX = u),
        (p.translationY = h),
        t.forEach((e) => e.dispatchEvent(p)),
        g || this.inertia(e, t, c, i, r, o + u, s, a, l + h));
    });
  }
  onTouchMove(e) {
    const t = Date.now();
    for (let n = 0, i = e.changedTouches.length; n < i; n++) {
      const i = e.changedTouches.item(n);
      if (!this.activeTouches.hasOwnProperty(String(i.identifier))) continue;
      const r = this.activeTouches[i.identifier],
        o = this.newGestureEvent(nJ.Change, r.initialTarget);
      ((o.translationX = i.pageX - r.rollingPageX.at(-1)),
        (o.translationY = i.pageY - r.rollingPageY.at(-1)),
        (o.pageX = i.pageX),
        (o.pageY = i.pageY),
        this.dispatchEvent(o),
        r.rollingPageX.length > 3 &&
          (r.rollingPageX.shift(), r.rollingPageY.shift(), r.rollingTimestamps.shift()),
        r.rollingPageX.push(i.pageX),
        r.rollingPageY.push(i.pageY),
        r.rollingTimestamps.push(t));
    }
    this.dispatched && (e.preventDefault(), e.stopPropagation(), (this.dispatched = !1));
  }
}
!(function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  o > 3 && s && Object.defineProperty(t, n, s);
})([tJ], iJ, "isTouchDevice", null);
let rJ = class extends PO {
  onclick(e, t) {
    this._register($F(e, DB.CLICK, (n) => t(new EO(MF(e), n))));
  }
  onmousedown(e, t) {
    this._register($F(e, DB.MOUSE_DOWN, (n) => t(new EO(MF(e), n))));
  }
  onmouseover(e, t) {
    this._register($F(e, DB.MOUSE_OVER, (n) => t(new EO(MF(e), n))));
  }
  onmouseleave(e, t) {
    this._register($F(e, DB.MOUSE_LEAVE, (n) => t(new EO(MF(e), n))));
  }
  onkeydown(e, t) {
    this._register($F(e, DB.KEY_DOWN, (e) => t(new wO(e))));
  }
  onkeyup(e, t) {
    this._register($F(e, DB.KEY_UP, (e) => t(new wO(e))));
  }
  oninput(e, t) {
    this._register($F(e, DB.INPUT, t));
  }
  onblur(e, t) {
    this._register($F(e, DB.BLUR, t));
  }
  onfocus(e, t) {
    this._register($F(e, DB.FOCUS, t));
  }
  ignoreGesture(e) {
    return iJ.ignoreTarget(e);
  }
};
const oJ = 11;
class sJ extends rJ {
  constructor(e) {
    (super(),
      (this._onActivate = e.onActivate),
      (this.bgDomNode = document.createElement("div")),
      (this.bgDomNode.className = "arrow-background"),
      (this.bgDomNode.style.position = "absolute"),
      (this.bgDomNode.style.width = e.bgWidth + "px"),
      (this.bgDomNode.style.height = e.bgHeight + "px"),
      void 0 !== e.top && (this.bgDomNode.style.top = "0px"),
      void 0 !== e.left && (this.bgDomNode.style.left = "0px"),
      void 0 !== e.bottom && (this.bgDomNode.style.bottom = "0px"),
      void 0 !== e.right && (this.bgDomNode.style.right = "0px"),
      (this.domNode = document.createElement("div")),
      (this.domNode.className = e.className),
      this.domNode.classList.add(...AV.asClassNameArray(e.icon)),
      (this.domNode.style.position = "absolute"),
      (this.domNode.style.width = "11px"),
      (this.domNode.style.height = "11px"),
      void 0 !== e.top && (this.domNode.style.top = e.top + "px"),
      void 0 !== e.left && (this.domNode.style.left = e.left + "px"),
      void 0 !== e.bottom && (this.domNode.style.bottom = e.bottom + "px"),
      void 0 !== e.right && (this.domNode.style.right = e.right + "px"),
      (this._pointerMoveMonitor = this._register(new gG())),
      this._register(KF(this.bgDomNode, DB.POINTER_DOWN, (e) => this._arrowPointerDown(e))),
      this._register(KF(this.domNode, DB.POINTER_DOWN, (e) => this._arrowPointerDown(e))),
      (this._pointerdownRepeatTimer = this._register(new eB())),
      (this._pointerdownScheduleRepeatTimer = this._register(new SM())));
  }
  _arrowPointerDown(e) {
    if (!(e.target && e.target instanceof Element)) return;
    (this._onActivate(),
      this._pointerdownRepeatTimer.cancel(),
      this._pointerdownScheduleRepeatTimer.cancelAndSet(() => {
        this._pointerdownRepeatTimer.cancelAndSet(() => this._onActivate(), 1e3 / 24, MF(e));
      }, 200),
      this._pointerMoveMonitor.startMonitoring(
        e.target,
        e.pointerId,
        e.buttons,
        (e) => {},
        () => {
          (this._pointerdownRepeatTimer.cancel(), this._pointerdownScheduleRepeatTimer.cancel());
        },
      ),
      e.preventDefault());
  }
}
class aJ extends PO {
  constructor(e, t, n) {
    (super(),
      (this._visibility = e),
      (this._visibleClassName = t),
      (this._invisibleClassName = n),
      (this._domNode = null),
      (this._isVisible = !1),
      (this._isNeeded = !1),
      (this._rawShouldBeVisible = !1),
      (this._shouldBeVisible = !1),
      (this._revealTimer = this._register(new SM())));
  }
  setVisibility(e) {
    this._visibility !== e && ((this._visibility = e), this._updateShouldBeVisible());
  }
  setShouldBeVisible(e) {
    ((this._rawShouldBeVisible = e), this._updateShouldBeVisible());
  }
  _applyVisibilitySetting() {
    return 2 !== this._visibility && (3 === this._visibility || this._rawShouldBeVisible);
  }
  _updateShouldBeVisible() {
    const e = this._applyVisibilitySetting();
    this._shouldBeVisible !== e && ((this._shouldBeVisible = e), this.ensureVisibility());
  }
  setIsNeeded(e) {
    this._isNeeded !== e && ((this._isNeeded = e), this.ensureVisibility());
  }
  setDomNode(e) {
    ((this._domNode = e),
      this._domNode.setClassName(this._invisibleClassName),
      this.setShouldBeVisible(!1));
  }
  ensureVisibility() {
    this._isNeeded ? (this._shouldBeVisible ? this._reveal() : this._hide(!0)) : this._hide(!1);
  }
  _reveal() {
    this._isVisible ||
      ((this._isVisible = !0),
      this._revealTimer.setIfNotSet(() => {
        this._domNode?.setClassName(this._visibleClassName);
      }, 0));
  }
  _hide(e) {
    (this._revealTimer.cancel(),
      this._isVisible &&
        ((this._isVisible = !1),
        this._domNode?.setClassName(this._invisibleClassName + (e ? " fade" : ""))));
  }
}
class lJ extends rJ {
  constructor(e) {
    (super(),
      (this._lazyRender = e.lazyRender),
      (this._host = e.host),
      (this._scrollable = e.scrollable),
      (this._scrollByPage = e.scrollByPage),
      (this._scrollbarState = e.scrollbarState),
      (this._visibilityController = this._register(
        new aJ(
          e.visibility,
          "visible scrollbar " + e.extraScrollbarClassName,
          "invisible scrollbar " + e.extraScrollbarClassName,
        ),
      )),
      this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),
      (this._pointerMoveMonitor = this._register(new gG())),
      (this._shouldRender = !0),
      (this.domNode = Bq(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(
        $F(this.domNode.domNode, DB.POINTER_DOWN, (e) => this._domNodePointerDown(e)),
      ));
  }
  _createArrow(e) {
    const t = this._register(new sJ(e));
    (this.domNode.domNode.appendChild(t.bgDomNode), this.domNode.domNode.appendChild(t.domNode));
  }
  _createSlider(e, t, n, i) {
    ((this.slider = Bq(document.createElement("div"))),
      this.slider.setClassName("slider"),
      this.slider.setPosition("absolute"),
      this.slider.setTop(e),
      this.slider.setLeft(t),
      "number" == typeof n && this.slider.setWidth(n),
      "number" == typeof i && this.slider.setHeight(i),
      this.slider.setLayerHinting(!0),
      this.slider.setContain("strict"),
      this.domNode.domNode.appendChild(this.slider.domNode),
      this._register(
        $F(this.slider.domNode, DB.POINTER_DOWN, (e) => {
          0 === e.button && (e.preventDefault(), this._sliderPointerDown(e));
        }),
      ),
      this.onclick(this.slider.domNode, (e) => {
        e.leftButton && e.stopPropagation();
      }));
  }
  _onElementSize(e) {
    return (
      this._scrollbarState.setVisibleSize(e) &&
        (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),
        (this._shouldRender = !0),
        this._lazyRender || this.render()),
      this._shouldRender
    );
  }
  _onElementScrollSize(e) {
    return (
      this._scrollbarState.setScrollSize(e) &&
        (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),
        (this._shouldRender = !0),
        this._lazyRender || this.render()),
      this._shouldRender
    );
  }
  _onElementScrollPosition(e) {
    return (
      this._scrollbarState.setScrollPosition(e) &&
        (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),
        (this._shouldRender = !0),
        this._lazyRender || this.render()),
      this._shouldRender
    );
  }
  beginReveal() {
    this._visibilityController.setShouldBeVisible(!0);
  }
  beginHide() {
    this._visibilityController.setShouldBeVisible(!1);
  }
  render() {
    this._shouldRender &&
      ((this._shouldRender = !1),
      this._renderDomNode(
        this._scrollbarState.getRectangleLargeSize(),
        this._scrollbarState.getRectangleSmallSize(),
      ),
      this._updateSlider(
        this._scrollbarState.getSliderSize(),
        this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition(),
      ));
  }
  _domNodePointerDown(e) {
    e.target === this.domNode.domNode && this._onPointerDown(e);
  }
  delegatePointerDown(e) {
    const t = this.domNode.domNode.getClientRects()[0].top,
      n = t + this._scrollbarState.getSliderPosition(),
      i = t + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize(),
      r = this._sliderPointerPosition(e);
    n <= r && r <= i
      ? 0 === e.button && (e.preventDefault(), this._sliderPointerDown(e))
      : this._onPointerDown(e);
  }
  _onPointerDown(e) {
    let t, n;
    if (
      e.target === this.domNode.domNode &&
      "number" == typeof e.offsetX &&
      "number" == typeof e.offsetY
    )
      ((t = e.offsetX), (n = e.offsetY));
    else {
      const i = aB(this.domNode.domNode);
      ((t = e.pageX - i.left), (n = e.pageY - i.top));
    }
    const i = "mouse" === e.pointerType,
      r = 0 === e.button;
    if (r || !i) {
      const e = this._pointerDownRelativePosition(t, n);
      this._setDesiredScrollPositionNow(
        this._scrollByPage
          ? this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(e)
          : this._scrollbarState.getDesiredScrollPositionFromOffset(e),
      );
    }
    r && (e.preventDefault(), this._sliderPointerDown(e));
  }
  _sliderPointerDown(e) {
    if (!(e.target && e.target instanceof Element)) return;
    const t = this._sliderPointerPosition(e),
      n = this._sliderOrthogonalPointerPosition(e),
      i = this._scrollbarState.clone();
    (this.slider.toggleClassName("active", !0),
      this._pointerMoveMonitor.startMonitoring(
        e.target,
        e.pointerId,
        e.buttons,
        (e) => {
          const r = this._sliderOrthogonalPointerPosition(e),
            o = Math.abs(r - n);
          if (AR && o > 140) return void this._setDesiredScrollPositionNow(i.getScrollPosition());
          const s = this._sliderPointerPosition(e) - t;
          this._setDesiredScrollPositionNow(i.getDesiredScrollPositionFromDelta(s));
        },
        () => {
          (this.slider.toggleClassName("active", !1), this._host.onDragEnd());
        },
      ),
      this._host.onDragStart());
  }
  _setDesiredScrollPositionNow(e) {
    const t = {};
    (this.writeScrollPosition(t, e), this._scrollable.setScrollPositionNow(t));
  }
  updateScrollbarSize(e) {
    (this._updateScrollbarSize(e),
      this._scrollbarState.setScrollbarSize(e),
      (this._shouldRender = !0),
      this._lazyRender || this.render());
  }
  isNeeded() {
    return this._scrollbarState.isNeeded();
  }
}
class cJ {
  constructor(e, t, n, i, r, o) {
    ((this._scrollbarSize = Math.round(t)),
      (this._oppositeScrollbarSize = Math.round(n)),
      (this._arrowSize = Math.round(e)),
      (this._visibleSize = i),
      (this._scrollSize = r),
      (this._scrollPosition = o),
      (this._computedAvailableSize = 0),
      (this._computedIsNeeded = !1),
      (this._computedSliderSize = 0),
      (this._computedSliderRatio = 0),
      (this._computedSliderPosition = 0),
      this._refreshComputedValues());
  }
  clone() {
    return new cJ(
      this._arrowSize,
      this._scrollbarSize,
      this._oppositeScrollbarSize,
      this._visibleSize,
      this._scrollSize,
      this._scrollPosition,
    );
  }
  setVisibleSize(e) {
    const t = Math.round(e);
    return this._visibleSize !== t && ((this._visibleSize = t), this._refreshComputedValues(), !0);
  }
  setScrollSize(e) {
    const t = Math.round(e);
    return this._scrollSize !== t && ((this._scrollSize = t), this._refreshComputedValues(), !0);
  }
  setScrollPosition(e) {
    const t = Math.round(e);
    return (
      this._scrollPosition !== t && ((this._scrollPosition = t), this._refreshComputedValues(), !0)
    );
  }
  setScrollbarSize(e) {
    this._scrollbarSize = Math.round(e);
  }
  setOppositeScrollbarSize(e) {
    this._oppositeScrollbarSize = Math.round(e);
  }
  static _computeValues(e, t, n, i, r) {
    const o = Math.max(0, n - e),
      s = Math.max(0, o - 2 * t),
      a = i > 0 && i > n;
    if (!a)
      return {
        computedAvailableSize: Math.round(o),
        computedIsNeeded: a,
        computedSliderSize: Math.round(s),
        computedSliderRatio: 0,
        computedSliderPosition: 0,
      };
    const l = Math.round(Math.max(20, Math.floor((n * s) / i))),
      c = (s - l) / (i - n),
      d = r * c;
    return {
      computedAvailableSize: Math.round(o),
      computedIsNeeded: a,
      computedSliderSize: Math.round(l),
      computedSliderRatio: c,
      computedSliderPosition: Math.round(d),
    };
  }
  _refreshComputedValues() {
    const e = cJ._computeValues(
      this._oppositeScrollbarSize,
      this._arrowSize,
      this._visibleSize,
      this._scrollSize,
      this._scrollPosition,
    );
    ((this._computedAvailableSize = e.computedAvailableSize),
      (this._computedIsNeeded = e.computedIsNeeded),
      (this._computedSliderSize = e.computedSliderSize),
      (this._computedSliderRatio = e.computedSliderRatio),
      (this._computedSliderPosition = e.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(e) {
    if (!this._computedIsNeeded) return 0;
    const t = e - this._arrowSize - this._computedSliderSize / 2;
    return Math.round(t / this._computedSliderRatio);
  }
  getDesiredScrollPositionFromOffsetPaged(e) {
    if (!this._computedIsNeeded) return 0;
    const t = e - this._arrowSize;
    let n = this._scrollPosition;
    return (
      t < this._computedSliderPosition ? (n -= this._visibleSize) : (n += this._visibleSize),
      n
    );
  }
  getDesiredScrollPositionFromDelta(e) {
    if (!this._computedIsNeeded) return 0;
    const t = this._computedSliderPosition + e;
    return Math.round(t / this._computedSliderRatio);
  }
}
class dJ extends lJ {
  constructor(e, t, n) {
    const i = e.getScrollDimensions(),
      r = e.getCurrentScrollPosition();
    if (
      (super({
        lazyRender: t.lazyRender,
        host: n,
        scrollbarState: new cJ(
          t.horizontalHasArrows ? t.arrowSize : 0,
          2 === t.horizontal ? 0 : t.horizontalScrollbarSize,
          2 === t.vertical ? 0 : t.verticalScrollbarSize,
          i.width,
          i.scrollWidth,
          r.scrollLeft,
        ),
        visibility: t.horizontal,
        extraScrollbarClassName: "horizontal",
        scrollable: e,
        scrollByPage: t.scrollByPage,
      }),
      t.horizontalHasArrows)
    ) {
      const e = (t.arrowSize - oJ) / 2,
        n = (t.horizontalScrollbarSize - oJ) / 2;
      (this._createArrow({
        className: "scra",
        icon: OV.scrollbarButtonLeft,
        top: n,
        left: e,
        bottom: void 0,
        right: void 0,
        bgWidth: t.arrowSize,
        bgHeight: t.horizontalScrollbarSize,
        onActivate: () => this._host.onMouseWheel(new NO(null, 1, 0)),
      }),
        this._createArrow({
          className: "scra",
          icon: OV.scrollbarButtonRight,
          top: n,
          left: void 0,
          bottom: void 0,
          right: e,
          bgWidth: t.arrowSize,
          bgHeight: t.horizontalScrollbarSize,
          onActivate: () => this._host.onMouseWheel(new NO(null, -1, 0)),
        }));
    }
    this._createSlider(
      Math.floor((t.horizontalScrollbarSize - t.horizontalSliderSize) / 2),
      0,
      void 0,
      t.horizontalSliderSize,
    );
  }
  _updateSlider(e, t) {
    (this.slider.setWidth(e), this.slider.setLeft(t));
  }
  _renderDomNode(e, t) {
    (this.domNode.setWidth(e),
      this.domNode.setHeight(t),
      this.domNode.setLeft(0),
      this.domNode.setBottom(0));
  }
  onDidScroll(e) {
    return (
      (this._shouldRender = this._onElementScrollSize(e.scrollWidth) || this._shouldRender),
      (this._shouldRender = this._onElementScrollPosition(e.scrollLeft) || this._shouldRender),
      (this._shouldRender = this._onElementSize(e.width) || this._shouldRender),
      this._shouldRender
    );
  }
  _pointerDownRelativePosition(e, t) {
    return e;
  }
  _sliderPointerPosition(e) {
    return e.pageX;
  }
  _sliderOrthogonalPointerPosition(e) {
    return e.pageY;
  }
  _updateScrollbarSize(e) {
    this.slider.setHeight(e);
  }
  writeScrollPosition(e, t) {
    e.scrollLeft = t;
  }
  updateOptions(e) {
    (this.updateScrollbarSize(2 === e.horizontal ? 0 : e.horizontalScrollbarSize),
      this._scrollbarState.setOppositeScrollbarSize(2 === e.vertical ? 0 : e.verticalScrollbarSize),
      this._visibilityController.setVisibility(e.horizontal),
      (this._scrollByPage = e.scrollByPage));
  }
}
class uJ extends lJ {
  constructor(e, t, n) {
    const i = e.getScrollDimensions(),
      r = e.getCurrentScrollPosition();
    if (
      (super({
        lazyRender: t.lazyRender,
        host: n,
        scrollbarState: new cJ(
          t.verticalHasArrows ? t.arrowSize : 0,
          2 === t.vertical ? 0 : t.verticalScrollbarSize,
          0,
          i.height,
          i.scrollHeight,
          r.scrollTop,
        ),
        visibility: t.vertical,
        extraScrollbarClassName: "vertical",
        scrollable: e,
        scrollByPage: t.scrollByPage,
      }),
      t.verticalHasArrows)
    ) {
      const e = (t.arrowSize - oJ) / 2,
        n = (t.verticalScrollbarSize - oJ) / 2;
      (this._createArrow({
        className: "scra",
        icon: OV.scrollbarButtonUp,
        top: e,
        left: n,
        bottom: void 0,
        right: void 0,
        bgWidth: t.verticalScrollbarSize,
        bgHeight: t.arrowSize,
        onActivate: () => this._host.onMouseWheel(new NO(null, 0, 1)),
      }),
        this._createArrow({
          className: "scra",
          icon: OV.scrollbarButtonDown,
          top: void 0,
          left: n,
          bottom: e,
          right: void 0,
          bgWidth: t.verticalScrollbarSize,
          bgHeight: t.arrowSize,
          onActivate: () => this._host.onMouseWheel(new NO(null, 0, -1)),
        }));
    }
    this._createSlider(
      0,
      Math.floor((t.verticalScrollbarSize - t.verticalSliderSize) / 2),
      t.verticalSliderSize,
      void 0,
    );
  }
  _updateSlider(e, t) {
    (this.slider.setHeight(e), this.slider.setTop(t));
  }
  _renderDomNode(e, t) {
    (this.domNode.setWidth(t),
      this.domNode.setHeight(e),
      this.domNode.setRight(0),
      this.domNode.setTop(0));
  }
  onDidScroll(e) {
    return (
      (this._shouldRender = this._onElementScrollSize(e.scrollHeight) || this._shouldRender),
      (this._shouldRender = this._onElementScrollPosition(e.scrollTop) || this._shouldRender),
      (this._shouldRender = this._onElementSize(e.height) || this._shouldRender),
      this._shouldRender
    );
  }
  _pointerDownRelativePosition(e, t) {
    return t;
  }
  _sliderPointerPosition(e) {
    return e.pageY;
  }
  _sliderOrthogonalPointerPosition(e) {
    return e.pageX;
  }
  _updateScrollbarSize(e) {
    this.slider.setWidth(e);
  }
  writeScrollPosition(e, t) {
    e.scrollTop = t;
  }
  updateOptions(e) {
    (this.updateScrollbarSize(2 === e.vertical ? 0 : e.verticalScrollbarSize),
      this._scrollbarState.setOppositeScrollbarSize(0),
      this._visibilityController.setVisibility(e.vertical),
      (this._scrollByPage = e.scrollByPage));
  }
}
class hJ {
  constructor(e, t, n, i, r, o, s) {
    ((this._forceIntegerValues = e),
      (this._scrollStateBrand = void 0),
      this._forceIntegerValues && ((t |= 0), (n |= 0), (i |= 0), (r |= 0), (o |= 0), (s |= 0)),
      (this.rawScrollLeft = i),
      (this.rawScrollTop = s),
      t < 0 && (t = 0),
      i + t > n && (i = n - t),
      i < 0 && (i = 0),
      r < 0 && (r = 0),
      s + r > o && (s = o - r),
      s < 0 && (s = 0),
      (this.width = t),
      (this.scrollWidth = n),
      (this.scrollLeft = i),
      (this.height = r),
      (this.scrollHeight = o),
      (this.scrollTop = s));
  }
  equals(e) {
    return (
      this.rawScrollLeft === e.rawScrollLeft &&
      this.rawScrollTop === e.rawScrollTop &&
      this.width === e.width &&
      this.scrollWidth === e.scrollWidth &&
      this.scrollLeft === e.scrollLeft &&
      this.height === e.height &&
      this.scrollHeight === e.scrollHeight &&
      this.scrollTop === e.scrollTop
    );
  }
  withScrollDimensions(e, t) {
    return new hJ(
      this._forceIntegerValues,
      void 0 !== e.width ? e.width : this.width,
      void 0 !== e.scrollWidth ? e.scrollWidth : this.scrollWidth,
      t ? this.rawScrollLeft : this.scrollLeft,
      void 0 !== e.height ? e.height : this.height,
      void 0 !== e.scrollHeight ? e.scrollHeight : this.scrollHeight,
      t ? this.rawScrollTop : this.scrollTop,
    );
  }
  withScrollPosition(e) {
    return new hJ(
      this._forceIntegerValues,
      this.width,
      this.scrollWidth,
      void 0 !== e.scrollLeft ? e.scrollLeft : this.rawScrollLeft,
      this.height,
      this.scrollHeight,
      void 0 !== e.scrollTop ? e.scrollTop : this.rawScrollTop,
    );
  }
  createScrollEvent(e, t) {
    const n = this.width !== e.width,
      i = this.scrollWidth !== e.scrollWidth,
      r = this.scrollLeft !== e.scrollLeft,
      o = this.height !== e.height,
      s = this.scrollHeight !== e.scrollHeight,
      a = this.scrollTop !== e.scrollTop;
    return {
      inSmoothScrolling: t,
      oldWidth: e.width,
      oldScrollWidth: e.scrollWidth,
      oldScrollLeft: e.scrollLeft,
      width: this.width,
      scrollWidth: this.scrollWidth,
      scrollLeft: this.scrollLeft,
      oldHeight: e.height,
      oldScrollHeight: e.scrollHeight,
      oldScrollTop: e.scrollTop,
      height: this.height,
      scrollHeight: this.scrollHeight,
      scrollTop: this.scrollTop,
      widthChanged: n,
      scrollWidthChanged: i,
      scrollLeftChanged: r,
      heightChanged: o,
      scrollHeightChanged: s,
      scrollTopChanged: a,
    };
  }
}
class gJ extends PO {
  constructor(e) {
    (super(),
      (this._scrollableBrand = void 0),
      (this._onScroll = this._register(new QO())),
      (this.onScroll = this._onScroll.event),
      (this._smoothScrollDuration = e.smoothScrollDuration),
      (this._scheduleAtNextAnimationFrame = e.scheduleAtNextAnimationFrame),
      (this._state = new hJ(e.forceIntegerValues, 0, 0, 0, 0, 0, 0)),
      (this._smoothScrolling = null));
  }
  dispose() {
    (this._smoothScrolling && (this._smoothScrolling.dispose(), (this._smoothScrolling = null)),
      super.dispose());
  }
  setSmoothScrollDuration(e) {
    this._smoothScrollDuration = e;
  }
  validateScrollPosition(e) {
    return this._state.withScrollPosition(e);
  }
  getScrollDimensions() {
    return this._state;
  }
  setScrollDimensions(e, t) {
    const n = this._state.withScrollDimensions(e, t);
    (this._setState(n, Boolean(this._smoothScrolling)),
      this._smoothScrolling?.acceptScrollDimensions(this._state));
  }
  getFutureScrollPosition() {
    return this._smoothScrolling ? this._smoothScrolling.to : this._state;
  }
  getCurrentScrollPosition() {
    return this._state;
  }
  setScrollPositionNow(e) {
    const t = this._state.withScrollPosition(e);
    (this._smoothScrolling && (this._smoothScrolling.dispose(), (this._smoothScrolling = null)),
      this._setState(t, !1));
  }
  setScrollPositionSmooth(e, t) {
    if (0 === this._smoothScrollDuration) return this.setScrollPositionNow(e);
    if (this._smoothScrolling) {
      e = {
        scrollLeft: void 0 === e.scrollLeft ? this._smoothScrolling.to.scrollLeft : e.scrollLeft,
        scrollTop: void 0 === e.scrollTop ? this._smoothScrolling.to.scrollTop : e.scrollTop,
      };
      const n = this._state.withScrollPosition(e);
      if (
        this._smoothScrolling.to.scrollLeft === n.scrollLeft &&
        this._smoothScrolling.to.scrollTop === n.scrollTop
      )
        return;
      let i;
      ((i = t
        ? new mJ(
            this._smoothScrolling.from,
            n,
            this._smoothScrolling.startTime,
            this._smoothScrolling.duration,
          )
        : this._smoothScrolling.combine(this._state, n, this._smoothScrollDuration)),
        this._smoothScrolling.dispose(),
        (this._smoothScrolling = i));
    } else {
      const t = this._state.withScrollPosition(e);
      this._smoothScrolling = mJ.start(this._state, t, this._smoothScrollDuration);
    }
    this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {
      this._smoothScrolling &&
        ((this._smoothScrolling.animationFrameDisposable = null), this._performSmoothScrolling());
    });
  }
  hasPendingScrollAnimation() {
    return Boolean(this._smoothScrolling);
  }
  _performSmoothScrolling() {
    if (!this._smoothScrolling) return;
    const e = this._smoothScrolling.tick(),
      t = this._state.withScrollPosition(e);
    return (
      this._setState(t, !0),
      this._smoothScrolling
        ? e.isDone
          ? (this._smoothScrolling.dispose(), void (this._smoothScrolling = null))
          : void (this._smoothScrolling.animationFrameDisposable =
              this._scheduleAtNextAnimationFrame(() => {
                this._smoothScrolling &&
                  ((this._smoothScrolling.animationFrameDisposable = null),
                  this._performSmoothScrolling());
              }))
        : void 0
    );
  }
  _setState(e, t) {
    const n = this._state;
    n.equals(e) || ((this._state = e), this._onScroll.fire(this._state.createScrollEvent(n, t)));
  }
}
class pJ {
  constructor(e, t, n) {
    ((this.scrollLeft = e), (this.scrollTop = t), (this.isDone = n));
  }
}
function fJ(e, t) {
  const n = t - e;
  return function (t) {
    return (
      e +
      n *
        (function (e) {
          return (
            1 -
            (function (e) {
              return Math.pow(e, 3);
            })(1 - e)
          );
        })(t)
    );
  };
}
class mJ {
  constructor(e, t, n, i) {
    ((this.from = e),
      (this.to = t),
      (this.duration = i),
      (this.startTime = n),
      (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(e, t, n) {
    if (Math.abs(e - t) > 2.5 * n) {
      let i, r;
      return (
        e < t ? ((i = e + 0.75 * n), (r = t - 0.75 * n)) : ((i = e - 0.75 * n), (r = t + 0.75 * n)),
        (function (e, t, n) {
          return function (i) {
            return i < n ? e(i / n) : t((i - n) / (1 - n));
          };
        })(fJ(e, i), fJ(r, t), 0.33)
      );
    }
    return fJ(e, t);
  }
  dispose() {
    null !== this.animationFrameDisposable &&
      (this.animationFrameDisposable.dispose(), (this.animationFrameDisposable = null));
  }
  acceptScrollDimensions(e) {
    ((this.to = e.withScrollPosition(this.to)), this._initAnimations());
  }
  tick() {
    return this._tick(Date.now());
  }
  _tick(e) {
    const t = (e - this.startTime) / this.duration;
    if (t < 1) {
      const e = this.scrollLeft(t),
        n = this.scrollTop(t);
      return new pJ(e, n, !1);
    }
    return new pJ(this.to.scrollLeft, this.to.scrollTop, !0);
  }
  combine(e, t, n) {
    return mJ.start(e, t, n);
  }
  static start(e, t, n) {
    n += 10;
    const i = Date.now() - 10;
    return new mJ(e, t, i, n);
  }
}
class _J {
  constructor(e, t, n) {
    ((this.timestamp = e), (this.deltaX = t), (this.deltaY = n), (this.score = 0));
  }
}
class vJ {
  static {
    this.INSTANCE = new vJ();
  }
  constructor() {
    ((this._capacity = 5), (this._memory = []), (this._front = -1), (this._rear = -1));
  }
  isPhysicalMouseWheel() {
    if (-1 === this._front && -1 === this._rear) return !1;
    let e = 1,
      t = 0,
      n = 1,
      i = this._rear;
    for (;;) {
      const r = i === this._front ? e : Math.pow(2, -n);
      if (((e -= r), (t += this._memory[i].score * r), i === this._front)) break;
      ((i = (this._capacity + i - 1) % this._capacity), n++);
    }
    return t <= 0.5;
  }
  acceptStandardWheelEvent(e) {
    if (MI) {
      const t = TI(MF(e.browserEvent));
      this.accept(Date.now(), e.deltaX * t, e.deltaY * t);
    } else this.accept(Date.now(), e.deltaX, e.deltaY);
  }
  accept(e, t, n) {
    let i = null;
    const r = new _J(e, t, n);
    (-1 === this._front && -1 === this._rear
      ? ((this._memory[0] = r), (this._front = 0), (this._rear = 0))
      : ((i = 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] = r)),
      (r.score = this._computeScore(r, i)));
  }
  _computeScore(e, t) {
    if (Math.abs(e.deltaX) > 0 && Math.abs(e.deltaY) > 0) return 1;
    let n = 0.5;
    if (((this._isAlmostInt(e.deltaX) && this._isAlmostInt(e.deltaY)) || (n += 0.25), t)) {
      const i = Math.abs(e.deltaX),
        r = Math.abs(e.deltaY),
        o = Math.abs(t.deltaX),
        s = Math.abs(t.deltaY),
        a = Math.max(Math.min(i, o), 1),
        l = Math.max(Math.min(r, s), 1),
        c = Math.max(i, o),
        d = Math.max(r, s);
      c % a === 0 && d % l === 0 && (n -= 0.5);
    }
    return Math.min(Math.max(n, 0), 1);
  }
  _isAlmostInt(e) {
    const t = 100 * Number.EPSILON;
    return Math.abs(Math.round(e) - e) < 0.01 + t;
  }
}
class bJ extends rJ {
  get onScroll() {
    return this._onScroll.event;
  }
  get options() {
    return this._options;
  }
  constructor(e, t, n) {
    (super(),
      (this._inertialTimeout = null),
      (this._inertialSpeed = { X: 0, Y: 0 }),
      (this._onScroll = this._register(new QO())),
      (this._onWillScroll = this._register(new QO())),
      (e.style.overflow = "hidden"),
      (this._options = (function (e) {
        const t = {
          lazyRender: void 0 !== e.lazyRender && e.lazyRender,
          className: void 0 !== e.className ? e.className : "",
          useShadows: void 0 === e.useShadows || e.useShadows,
          handleMouseWheel: void 0 === e.handleMouseWheel || e.handleMouseWheel,
          flipAxes: void 0 !== e.flipAxes && e.flipAxes,
          consumeMouseWheelIfScrollbarIsNeeded:
            void 0 !== e.consumeMouseWheelIfScrollbarIsNeeded &&
            e.consumeMouseWheelIfScrollbarIsNeeded,
          alwaysConsumeMouseWheel:
            void 0 !== e.alwaysConsumeMouseWheel && e.alwaysConsumeMouseWheel,
          scrollYToX: void 0 !== e.scrollYToX && e.scrollYToX,
          mouseWheelScrollSensitivity:
            void 0 !== e.mouseWheelScrollSensitivity ? e.mouseWheelScrollSensitivity : 1,
          fastScrollSensitivity: void 0 !== e.fastScrollSensitivity ? e.fastScrollSensitivity : 5,
          scrollPredominantAxis: void 0 === e.scrollPredominantAxis || e.scrollPredominantAxis,
          mouseWheelSmoothScroll: void 0 === e.mouseWheelSmoothScroll || e.mouseWheelSmoothScroll,
          inertialScroll: void 0 !== e.inertialScroll && e.inertialScroll,
          arrowSize: void 0 !== e.arrowSize ? e.arrowSize : 11,
          listenOnDomNode: void 0 !== e.listenOnDomNode ? e.listenOnDomNode : null,
          horizontal: void 0 !== e.horizontal ? e.horizontal : 1,
          horizontalScrollbarSize:
            void 0 !== e.horizontalScrollbarSize ? e.horizontalScrollbarSize : 10,
          horizontalSliderSize: void 0 !== e.horizontalSliderSize ? e.horizontalSliderSize : 0,
          horizontalHasArrows: void 0 !== e.horizontalHasArrows && e.horizontalHasArrows,
          vertical: void 0 !== e.vertical ? e.vertical : 1,
          verticalScrollbarSize: void 0 !== e.verticalScrollbarSize ? e.verticalScrollbarSize : 10,
          verticalHasArrows: void 0 !== e.verticalHasArrows && e.verticalHasArrows,
          verticalSliderSize: void 0 !== e.verticalSliderSize ? e.verticalSliderSize : 0,
          scrollByPage: void 0 !== e.scrollByPage && e.scrollByPage,
        };
        ((t.horizontalSliderSize =
          void 0 !== e.horizontalSliderSize ? e.horizontalSliderSize : t.horizontalScrollbarSize),
          (t.verticalSliderSize =
            void 0 !== e.verticalSliderSize ? e.verticalSliderSize : t.verticalScrollbarSize),
          PR && (t.className += " mac"));
        return t;
      })(t)),
      (this._scrollable = n),
      this._register(
        this._scrollable.onScroll((e) => {
          (this._onWillScroll.fire(e), this._onDidScroll(e), this._onScroll.fire(e));
        }),
      ));
    const i = {
      onMouseWheel: (e) => this._onMouseWheel(e),
      onDragStart: () => this._onDragStart(),
      onDragEnd: () => this._onDragEnd(),
    };
    ((this._verticalScrollbar = this._register(new uJ(this._scrollable, this._options, i))),
      (this._horizontalScrollbar = this._register(new dJ(this._scrollable, this._options, i))),
      (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(e),
      this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),
      this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),
      this._options.useShadows
        ? ((this._leftShadowDomNode = Bq(document.createElement("div"))),
          this._leftShadowDomNode.setClassName("shadow"),
          this._domNode.appendChild(this._leftShadowDomNode.domNode),
          (this._topShadowDomNode = Bq(document.createElement("div"))),
          this._topShadowDomNode.setClassName("shadow"),
          this._domNode.appendChild(this._topShadowDomNode.domNode),
          (this._topLeftShadowDomNode = Bq(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, (e) => this._onMouseOver(e)),
      this.onmouseleave(this._listenOnDomNode, (e) => this._onMouseLeave(e)),
      (this._hideTimeout = this._register(new SM())),
      (this._isDragging = !1),
      (this._mouseIsOver = !1),
      (this._shouldRender = !0),
      (this._revealOnScroll = !0));
  }
  dispose() {
    ((this._mouseWheelToDispose = IO(this._mouseWheelToDispose)),
      this._inertialTimeout && (this._inertialTimeout.dispose(), (this._inertialTimeout = null)),
      super.dispose());
  }
  getDomNode() {
    return this._domNode;
  }
  getOverviewRulerLayoutInfo() {
    return { parent: this._domNode, insertBefore: this._verticalScrollbar.domNode.domNode };
  }
  delegateVerticalScrollbarPointerDown(e) {
    this._verticalScrollbar.delegatePointerDown(e);
  }
  getScrollDimensions() {
    return this._scrollable.getScrollDimensions();
  }
  setScrollDimensions(e) {
    this._scrollable.setScrollDimensions(e, !1);
  }
  updateClassName(e) {
    ((this._options.className = e),
      PR && (this._options.className += " mac"),
      (this._domNode.className = "monaco-scrollable-element " + this._options.className));
  }
  updateOptions(e) {
    (void 0 !== e.handleMouseWheel &&
      ((this._options.handleMouseWheel = e.handleMouseWheel),
      this._setListeningToMouseWheel(this._options.handleMouseWheel)),
      void 0 !== e.mouseWheelScrollSensitivity &&
        (this._options.mouseWheelScrollSensitivity = e.mouseWheelScrollSensitivity),
      void 0 !== e.fastScrollSensitivity &&
        (this._options.fastScrollSensitivity = e.fastScrollSensitivity),
      void 0 !== e.scrollPredominantAxis &&
        (this._options.scrollPredominantAxis = e.scrollPredominantAxis),
      void 0 !== e.horizontal && (this._options.horizontal = e.horizontal),
      void 0 !== e.vertical && (this._options.vertical = e.vertical),
      void 0 !== e.horizontalScrollbarSize &&
        (this._options.horizontalScrollbarSize = e.horizontalScrollbarSize),
      void 0 !== e.verticalScrollbarSize &&
        (this._options.verticalScrollbarSize = e.verticalScrollbarSize),
      void 0 !== e.scrollByPage && (this._options.scrollByPage = e.scrollByPage),
      this._horizontalScrollbar.updateOptions(this._options),
      this._verticalScrollbar.updateOptions(this._options),
      this._options.lazyRender || this._render());
  }
  delegateScrollFromMouseWheelEvent(e) {
    this._onMouseWheel(new NO(e));
  }
  async _periodicSync() {
    let e = !1;
    ((0 === this._inertialSpeed.X && 0 === this._inertialSpeed.Y) ||
      (this._scrollable.setScrollPositionNow({
        scrollTop:
          this._scrollable.getCurrentScrollPosition().scrollTop - 100 * this._inertialSpeed.Y,
        scrollLeft:
          this._scrollable.getCurrentScrollPosition().scrollLeft - 100 * this._inertialSpeed.X,
      }),
      (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),
      (e = 0 !== this._inertialSpeed.X || 0 !== this._inertialSpeed.Y)),
      e
        ? (this._inertialTimeout || (this._inertialTimeout = new SM()),
          this._inertialTimeout.cancelAndSet(() => this._periodicSync(), 1e3 / 60))
        : (this._inertialTimeout?.dispose(), (this._inertialTimeout = null)));
  }
  _setListeningToMouseWheel(e) {
    if (
      this._mouseWheelToDispose.length > 0 !== e &&
      ((this._mouseWheelToDispose = IO(this._mouseWheelToDispose)), e)
    ) {
      const e = (e) => {
        this._onMouseWheel(new NO(e));
      };
      this._mouseWheelToDispose.push($F(this._listenOnDomNode, DB.MOUSE_WHEEL, e, { passive: !1 }));
    }
  }
  _onMouseWheel(e) {
    if (e.browserEvent?.defaultPrevented) return;
    const t = vJ.INSTANCE;
    t.acceptStandardWheelEvent(e);
    let n = !1;
    if (e.deltaY || e.deltaX) {
      let i = e.deltaY * this._options.mouseWheelScrollSensitivity,
        r = e.deltaX * this._options.mouseWheelScrollSensitivity;
      (this._options.scrollPredominantAxis &&
        (this._options.scrollYToX && r + i === 0
          ? (r = i = 0)
          : Math.abs(i) >= Math.abs(r)
            ? (r = 0)
            : (i = 0)),
        this._options.flipAxes && ([i, r] = [r, i]));
      const o = !PR && e.browserEvent && e.browserEvent.shiftKey;
      ((!this._options.scrollYToX && !o) || r || ((r = i), (i = 0)),
        e.browserEvent &&
          e.browserEvent.altKey &&
          ((r *= this._options.fastScrollSensitivity), (i *= this._options.fastScrollSensitivity)));
      const s = this._scrollable.getFutureScrollPosition();
      let a = {};
      if (i) {
        const e = 50 * i,
          t = s.scrollTop - (e < 0 ? Math.floor(e) : Math.ceil(e));
        this._verticalScrollbar.writeScrollPosition(a, t);
      }
      if (r) {
        const e = 50 * r,
          t = s.scrollLeft - (e < 0 ? Math.floor(e) : Math.ceil(e));
        this._horizontalScrollbar.writeScrollPosition(a, t);
      }
      if (
        ((a = this._scrollable.validateScrollPosition(a)),
        this._options.inertialScroll && (r || i) && !t.isPhysicalMouseWheel())
      ) {
        let e = !1;
        (0 === this._inertialSpeed.X && 0 === this._inertialSpeed.Y && (e = !0),
          (this._inertialSpeed.Y = (i < 0 ? -1 : 1) * Math.abs(i) ** 1.02),
          (this._inertialSpeed.X = (r < 0 ? -1 : 1) * Math.abs(r) ** 1.02),
          e && this._periodicSync());
      }
      if (s.scrollLeft !== a.scrollLeft || s.scrollTop !== a.scrollTop) {
        (this._options.mouseWheelSmoothScroll && t.isPhysicalMouseWheel()
          ? this._scrollable.setScrollPositionSmooth(a)
          : this._scrollable.setScrollPositionNow(a),
          (n = !0));
      }
    }
    let i = n;
    (!i && this._options.alwaysConsumeMouseWheel && (i = !0),
      !i &&
        this._options.consumeMouseWheelIfScrollbarIsNeeded &&
        (this._verticalScrollbar.isNeeded() || this._horizontalScrollbar.isNeeded()) &&
        (i = !0),
      i && (e.preventDefault(), e.stopPropagation()));
  }
  _onDidScroll(e) {
    ((this._shouldRender = this._horizontalScrollbar.onDidScroll(e) || this._shouldRender),
      (this._shouldRender = this._verticalScrollbar.onDidScroll(e) || this._shouldRender),
      this._options.useShadows && (this._shouldRender = !0),
      this._revealOnScroll && this._reveal(),
      this._options.lazyRender || this._render());
  }
  renderNow() {
    if (!this._options.lazyRender)
      throw new Error("Please use `lazyRender` together with `renderNow`!");
    this._render();
  }
  _render() {
    if (
      this._shouldRender &&
      ((this._shouldRender = !1),
      this._horizontalScrollbar.render(),
      this._verticalScrollbar.render(),
      this._options.useShadows)
    ) {
      const e = this._scrollable.getCurrentScrollPosition(),
        t = e.scrollTop > 0,
        n = e.scrollLeft > 0,
        i = n ? " left" : "",
        r = t ? " top" : "",
        o = n || t ? " top-left-corner" : "";
      (this._leftShadowDomNode.setClassName(`shadow${i}`),
        this._topShadowDomNode.setClassName(`shadow${r}`),
        this._topLeftShadowDomNode.setClassName(`shadow${o}${r}${i}`));
    }
  }
  _onDragStart() {
    ((this._isDragging = !0), this._reveal());
  }
  _onDragEnd() {
    ((this._isDragging = !1), this._hide());
  }
  _onMouseLeave(e) {
    ((this._mouseIsOver = !1), this._hide());
  }
  _onMouseOver(e) {
    ((this._mouseIsOver = !0), 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(), 500);
  }
}
class yJ extends bJ {
  constructor(e, t) {
    (t = t || {}).mouseWheelSmoothScroll = !1;
    const n = new gJ({
      forceIntegerValues: !0,
      smoothScrollDuration: 0,
      scheduleAtNextAnimationFrame: (t) => JF(MF(e), t),
    });
    (super(e, t, n), this._register(n));
  }
  setScrollPosition(e) {
    this._scrollable.setScrollPositionNow(e);
  }
}
class xJ extends bJ {
  constructor(e, t, n) {
    super(e, t, n);
  }
  setScrollPosition(e) {
    e.reuseAnimation
      ? this._scrollable.setScrollPositionSmooth(e, e.reuseAnimation)
      : this._scrollable.setScrollPositionNow(e);
  }
  getScrollPosition() {
    return this._scrollable.getCurrentScrollPosition();
  }
}
class wJ extends bJ {
  constructor(e, t) {
    (t = t || {}).mouseWheelSmoothScroll = !1;
    const n = new gJ({
      forceIntegerValues: !1,
      smoothScrollDuration: 0,
      scheduleAtNextAnimationFrame: (t) => JF(MF(e), t),
    });
    (super(e, t, n),
      this._register(n),
      (this._element = e),
      this._register(
        this.onScroll((e) => {
          (e.scrollTopChanged && (this._element.scrollTop = e.scrollTop),
            e.scrollLeftChanged && (this._element.scrollLeft = e.scrollLeft));
        }),
      ),
      this.scanDomNode());
  }
  setScrollPosition(e) {
    this._scrollable.setScrollPositionNow(e);
  }
  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,
      }));
  }
}
class CJ extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._context = e),
      (this._viewHelper = t),
      (this._mouseTargetFactory = n),
      (this._dispatchMouse = i),
      (this._operation = null));
  }
  dispose() {
    (super.dispose(), this.stop());
  }
  start(e, t) {
    this._operation
      ? this._operation.setPosition(e, t)
      : (this._operation = this._createDragScrollingOperation(e, t));
  }
  stop() {
    this._operation && (this._operation.dispose(), (this._operation = null));
  }
}
class SJ extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._context = e),
      (this._viewHelper = t),
      (this._mouseTargetFactory = n),
      (this._dispatchMouse = i),
      (this._position = r),
      (this._mouseEvent = o),
      (this._lastTime = Date.now()),
      (this._animationFrameDisposable = JF(MF(o.browserEvent), () => this._execute())));
  }
  dispose() {
    (this._animationFrameDisposable.dispose(), super.dispose());
  }
  setPosition(e, t) {
    ((this._position = e), (this._mouseEvent = t));
  }
  _tick() {
    const e = Date.now(),
      t = e - this._lastTime;
    return ((this._lastTime = e), t);
  }
}
class kJ extends CJ {
  _createDragScrollingOperation(e, t) {
    return new EJ(
      this._context,
      this._viewHelper,
      this._mouseTargetFactory,
      this._dispatchMouse,
      e,
      t,
    );
  }
}
class EJ extends SJ {
  _getScrollSpeed() {
    const e = this._context.configuration.options.get(75),
      t = this._context.configuration.options.get(165).height / e,
      n = this._position.outsideDistance / e;
    return n <= 1.5
      ? Math.max(30, t * (1 + n))
      : n <= 3
        ? Math.max(60, t * (2 + n))
        : Math.max(200, t * (7 + n));
  }
  _execute() {
    const e = this._context.configuration.options.get(75),
      t = this._getScrollSpeed() * (this._tick() / 1e3) * e,
      n = "above" === this._position.outsidePosition ? -t : t;
    (this._context.viewModel.viewLayout.deltaScrollNow(0, n), this._viewHelper.renderNow());
    const i = this._context.viewLayout.getLinesViewportData(),
      r = "above" === this._position.outsidePosition ? i.startLineNumber : i.endLineNumber;
    let o;
    {
      const e = KX(this._viewHelper.viewDomNode),
        t = this._context.configuration.options.get(165).horizontalScrollbarHeight,
        n = new zX(this._mouseEvent.pos.x, e.y + e.height - t - 0.1),
        i = GX(this._viewHelper.viewDomNode, e, n);
      o = this._mouseTargetFactory.createMouseTarget(
        this._viewHelper.getLastRenderData(),
        e,
        n,
        i,
        null,
      );
    }
    ((o.position && o.position.lineNumber === r) ||
      (o =
        "above" === this._position.outsidePosition
          ? qQ.createOutsideEditor(
              this._position.mouseColumn,
              new xV(r, 1),
              "above",
              this._position.outsideDistance,
            )
          : qQ.createOutsideEditor(
              this._position.mouseColumn,
              new xV(r, this._context.viewModel.getLineMaxColumn(r)),
              "below",
              this._position.outsideDistance,
            )),
      this._dispatchMouse(o, !0, 2),
      (this._animationFrameDisposable = JF(MF(o.element), () => this._execute())));
  }
}
class NJ extends CJ {
  _createDragScrollingOperation(e, t) {
    return new LJ(
      this._context,
      this._viewHelper,
      this._mouseTargetFactory,
      this._dispatchMouse,
      e,
      t,
    );
  }
}
class LJ extends SJ {
  _getScrollSpeed() {
    const e = this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,
      t = this._context.configuration.options.get(165).contentWidth / e,
      n = this._position.outsideDistance / e;
    return n <= 1.5
      ? Math.max(30, t * (1 + n))
      : n <= 3
        ? Math.max(60, t * (2 + n))
        : Math.max(200, t * (7 + n));
  }
  _execute() {
    const e = this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,
      t = this._getScrollSpeed() * (this._tick() / 1e3) * e * 0.5,
      n = "left" === this._position.outsidePosition ? -t : t;
    if (
      (this._context.viewModel.viewLayout.deltaScrollNow(n, 0),
      this._viewHelper.renderNow(),
      !this._position.position)
    )
      return;
    const i = this._position.position.lineNumber;
    let r;
    {
      const e = KX(this._viewHelper.viewDomNode),
        t = this._context.configuration.options.get(165).horizontalScrollbarHeight,
        n = new zX(this._mouseEvent.pos.x, e.y + e.height - t - 0.1),
        i = GX(this._viewHelper.viewDomNode, e, n);
      r = this._mouseTargetFactory.createMouseTarget(
        this._viewHelper.getLastRenderData(),
        e,
        n,
        i,
        null,
      );
    }
    ((r =
      "left" === this._position.outsidePosition
        ? qQ.createOutsideEditor(
            r.mouseColumn,
            new xV(i, r.mouseColumn),
            "left",
            this._position.outsideDistance,
          )
        : qQ.createOutsideEditor(
            r.mouseColumn,
            new xV(i, r.mouseColumn),
            "right",
            this._position.outsideDistance,
          )),
      this._dispatchMouse(r, !0, 2),
      (this._animationFrameDisposable = JF(MF(r.element), () => this._execute())));
  }
}
class DJ extends nQ {
  constructor(e, t, n) {
    (super(),
      (this._mouseLeaveMonitor = null),
      (this._context = e),
      (this.viewController = t),
      (this.viewHelper = n),
      (this.mouseTargetFactory = new JQ(this._context, n)),
      (this._mouseDownOperation = this._register(
        new TJ(
          this._context,
          this.viewController,
          this.viewHelper,
          this.mouseTargetFactory,
          (e, t) => this._createMouseTarget(e, t),
          (e) => this._getMouseColumn(e),
        ),
      )),
      (this.lastMouseLeaveTime = -1),
      (this._height = this._context.configuration.options.get(165).height));
    const i = new YX(this.viewHelper.viewDomNode);
    (this._register(
      i.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, !0)),
    ),
      this._register(
        i.onMouseMove(this.viewHelper.viewDomNode, (e) => {
          (this._onMouseMove(e),
            this._mouseLeaveMonitor ||
              (this._mouseLeaveMonitor = $F(
                this.viewHelper.viewDomNode.ownerDocument,
                "mousemove",
                (e) => {
                  this.viewHelper.viewDomNode.contains(e.target) ||
                    this._onMouseLeave(new ZX(e, !1, this.viewHelper.viewDomNode));
                },
              )));
        }),
      ),
      this._register(i.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e))),
      this._register(i.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e))));
    let r = 0;
    (this._register(
      i.onPointerDown(this.viewHelper.viewDomNode, (e, t) => {
        r = t;
      }),
    ),
      this._register(
        $F(this.viewHelper.viewDomNode, DB.POINTER_UP, (e) => {
          this._mouseDownOperation.onPointerUp();
        }),
      ),
      this._register(i.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e, r))),
      this._setupMouseWheelZoomListener(),
      this._context.addEventHandler(this));
  }
  _setupMouseWheelZoomListener() {
    const e = vJ.INSTANCE;
    let t = 0,
      n = Kq.getZoomLevel(),
      i = !1,
      r = 0;
    function o(e) {
      return PR
        ? (e.metaKey || e.ctrlKey) && !e.shiftKey && !e.altKey
        : e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey;
    }
    this._register(
      $F(
        this.viewHelper.viewDomNode,
        DB.MOUSE_WHEEL,
        (s) => {
          if ((this.viewController.emitMouseWheel(s), !this._context.configuration.options.get(84)))
            return;
          const a = new NO(s);
          if ((e.acceptStandardWheelEvent(a), e.isPhysicalMouseWheel())) {
            if (o(s)) {
              const e = Kq.getZoomLevel(),
                t = a.deltaY > 0 ? 1 : -1;
              (Kq.setZoomLevel(e + t), a.preventDefault(), a.stopPropagation());
            }
          } else
            (Date.now() - t > 50 && ((n = Kq.getZoomLevel()), (i = o(s)), (r = 0)),
              (t = Date.now()),
              (r += a.deltaY),
              i && (Kq.setZoomLevel(n + r / 5), a.preventDefault(), a.stopPropagation()));
        },
        { capture: !0, passive: !1 },
      ),
    );
  }
  dispose() {
    (this._context.removeEventHandler(this),
      this._mouseLeaveMonitor &&
        (this._mouseLeaveMonitor.dispose(), (this._mouseLeaveMonitor = null)),
      super.dispose());
  }
  onConfigurationChanged(e) {
    if (e.hasChanged(165)) {
      const e = this._context.configuration.options.get(165).height;
      this._height !== e && ((this._height = e), this._mouseDownOperation.onHeightChanged());
    }
    return !1;
  }
  onCursorStateChanged(e) {
    return (this._mouseDownOperation.onCursorStateChanged(e), !1);
  }
  onFocusChanged(e) {
    return !1;
  }
  getTargetAtClientPoint(e, t) {
    const n = new UX(e, t).toPageCoordinates(MF(this.viewHelper.viewDomNode)),
      i = KX(this.viewHelper.viewDomNode);
    if (n.y < i.y || n.y > i.y + i.height || n.x < i.x || n.x > i.x + i.width) return null;
    const r = GX(this.viewHelper.viewDomNode, i, n);
    return this.mouseTargetFactory.createMouseTarget(
      this.viewHelper.getLastRenderData(),
      i,
      n,
      r,
      null,
    );
  }
  _createMouseTarget(e, t) {
    let n = e.target;
    if (!this.viewHelper.viewDomNode.contains(n)) {
      const t = _B(this.viewHelper.viewDomNode);
      if (t) {
        const i =
          t
            .elementsFromPoint(e.posx, e.posy)
            .find((e) => this.viewHelper.viewDomNode.contains(e)) ?? null;
        n = i;
      }
    }
    return this.mouseTargetFactory.createMouseTarget(
      this.viewHelper.getLastRenderData(),
      e.editorPos,
      e.pos,
      e.relativePos,
      t ? n : null,
    );
  }
  _getMouseColumn(e) {
    return this.mouseTargetFactory.getMouseColumn(e.relativePos);
  }
  _onContextMenu(e, t) {
    this.viewController.emitContextMenu({ event: e, target: this._createMouseTarget(e, t) });
  }
  _onMouseMove(e) {
    if (
      (this.mouseTargetFactory.mouseTargetIsWidget(e) || e.preventDefault(),
      this._mouseDownOperation.isActive())
    )
      return;
    e.timestamp < this.lastMouseLeaveTime ||
      this.viewController.emitMouseMove({ event: e, target: this._createMouseTarget(e, !0) });
  }
  _onMouseLeave(e) {
    (this._mouseLeaveMonitor &&
      (this._mouseLeaveMonitor.dispose(), (this._mouseLeaveMonitor = null)),
      (this.lastMouseLeaveTime = new Date().getTime()),
      this.viewController.emitMouseLeave({ event: e, target: null }));
  }
  _onMouseUp(e) {
    this.viewController.emitMouseUp({ event: e, target: this._createMouseTarget(e, !0) });
  }
  _onMouseDown(e, t) {
    const n = this._createMouseTarget(e, !0),
      i = 6 === n.type || 7 === n.type,
      r = 2 === n.type || 3 === n.type || 4 === n.type,
      o = 3 === n.type,
      s = this._context.configuration.options.get(125),
      a = 8 === n.type || 5 === n.type,
      l = 9 === n.type;
    let c = e.leftButton || e.middleButton;
    PR && e.leftButton && e.ctrlKey && (c = !1);
    const d = () => {
      (e.preventDefault(), this.viewHelper.focusTextArea());
    };
    if (c && (i || (o && s))) (d(), this._mouseDownOperation.start(n.type, e, t));
    else if (r) e.preventDefault();
    else if (a) {
      const i = n.detail;
      c &&
        this.viewHelper.shouldSuppressMouseDownOnViewZone(i.viewZoneId) &&
        (d(), this._mouseDownOperation.start(n.type, e, t), e.preventDefault());
    } else
      l && this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail) && (d(), e.preventDefault());
    this.viewController.emitMouseDown({ event: e, target: n });
  }
}
class TJ extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._context = e),
      (this._viewController = t),
      (this._viewHelper = n),
      (this._mouseTargetFactory = i),
      (this._createMouseTarget = r),
      (this._getMouseColumn = o),
      (this._mouseMoveMonitor = this._register(new QX(this._viewHelper.viewDomNode))),
      (this._topBottomDragScrolling = this._register(
        new kJ(this._context, this._viewHelper, this._mouseTargetFactory, (e, t, n) =>
          this._dispatchMouse(e, t, n),
        ),
      )),
      (this._leftRightDragScrolling = this._register(
        new NJ(this._context, this._viewHelper, this._mouseTargetFactory, (e, t, n) =>
          this._dispatchMouse(e, t, n),
        ),
      )),
      (this._mouseState = new IJ()),
      (this._currentSelection = new XH(1, 1, 1, 1)),
      (this._isActive = !1),
      (this._lastMouseEvent = null));
  }
  dispose() {
    super.dispose();
  }
  isActive() {
    return this._isActive;
  }
  _onMouseDownThenMove(e) {
    ((this._lastMouseEvent = e), this._mouseState.setModifiers(e));
    const t = this._findMousePosition(e, !1);
    t &&
      (this._mouseState.isDragAndDrop
        ? this._viewController.emitMouseDrag({ event: e, target: t })
        : 13 === t.type
          ? "above" === t.outsidePosition || "below" === t.outsidePosition
            ? (this._topBottomDragScrolling.start(t, e), this._leftRightDragScrolling.stop())
            : (this._leftRightDragScrolling.start(t, e), this._topBottomDragScrolling.stop())
          : (this._topBottomDragScrolling.stop(),
            this._leftRightDragScrolling.stop(),
            this._dispatchMouse(t, !0, 1)));
  }
  start(e, t, n) {
    ((this._lastMouseEvent = t),
      this._mouseState.setStartedOnLineNumbers(3 === e),
      this._mouseState.setStartButtons(t),
      this._mouseState.setModifiers(t));
    const i = this._findMousePosition(t, !0);
    if (!i || !i.position) return;
    (this._mouseState.trySetCount(t.detail, i.position), (t.detail = this._mouseState.count));
    const r = this._context.configuration.options;
    if (
      !r.get(104) &&
      r.get(42) &&
      !r.get(28) &&
      !this._mouseState.altKey &&
      t.detail < 2 &&
      !this._isActive &&
      !this._currentSelection.isEmpty() &&
      6 === i.type &&
      i.position &&
      this._currentSelection.containsPosition(i.position)
    )
      return (
        (this._mouseState.isDragAndDrop = !0),
        (this._isActive = !0),
        void this._mouseMoveMonitor.startMonitoring(
          this._viewHelper.viewLinesDomNode,
          n,
          t.buttons,
          (e) => this._onMouseDownThenMove(e),
          (e) => {
            const t = this._findMousePosition(this._lastMouseEvent, !1);
            (LB(e)
              ? this._viewController.emitMouseDropCanceled()
              : this._viewController.emitMouseDrop({
                  event: this._lastMouseEvent,
                  target: t ? this._createMouseTarget(this._lastMouseEvent, !0) : null,
                }),
              this._stop());
          },
        )
      );
    ((this._mouseState.isDragAndDrop = !1),
      this._dispatchMouse(i, t.shiftKey, 1),
      this._isActive ||
        ((this._isActive = !0),
        this._mouseMoveMonitor.startMonitoring(
          this._viewHelper.viewLinesDomNode,
          n,
          t.buttons,
          (e) => this._onMouseDownThenMove(e),
          () => this._stop(),
        )));
  }
  _stop() {
    ((this._isActive = !1),
      this._topBottomDragScrolling.stop(),
      this._leftRightDragScrolling.stop());
  }
  onHeightChanged() {
    this._mouseMoveMonitor.stopMonitoring();
  }
  onPointerUp() {
    this._mouseMoveMonitor.stopMonitoring();
  }
  onCursorStateChanged(e) {
    this._currentSelection = e.selections[0];
  }
  _getPositionOutsideEditor(e) {
    const t = e.editorPos,
      n = this._context.viewModel,
      i = this._context.viewLayout,
      r = this._getMouseColumn(e);
    if (e.posy < t.y) {
      const n = t.y - e.posy,
        o = Math.max(i.getCurrentScrollTop() - n, 0),
        s = GQ.getZoneAtCoord(this._context, o);
      if (s) {
        const e = this._helpPositionJumpOverViewZone(s);
        if (e) return qQ.createOutsideEditor(r, e, "above", n);
      }
      const a = i.getLineNumberAtVerticalOffset(o);
      return qQ.createOutsideEditor(r, new xV(a, 1), "above", n);
    }
    if (e.posy > t.y + t.height) {
      const o = e.posy - t.y - t.height,
        s = i.getCurrentScrollTop() + e.relativePos.y,
        a = GQ.getZoneAtCoord(this._context, s);
      if (a) {
        const e = this._helpPositionJumpOverViewZone(a);
        if (e) return qQ.createOutsideEditor(r, e, "below", o);
      }
      const l = i.getLineNumberAtVerticalOffset(s);
      return qQ.createOutsideEditor(r, new xV(l, n.getLineMaxColumn(l)), "below", o);
    }
    const o = i.getLineNumberAtVerticalOffset(i.getCurrentScrollTop() + e.relativePos.y),
      s = this._context.configuration.options.get(165),
      a = s.contentLeft;
    if (e.relativePos.x <= a) {
      const t = a - e.relativePos.x;
      return qQ.createOutsideEditor(r, new xV(o, 1), "left", t);
    }
    const l =
      0 === s.minimap.minimapLeft ? s.width - s.verticalScrollbarWidth : s.minimap.minimapLeft;
    if (e.relativePos.x >= l) {
      const t = e.relativePos.x - l;
      return qQ.createOutsideEditor(r, new xV(o, n.getLineMaxColumn(o)), "right", t);
    }
    return null;
  }
  _findMousePosition(e, t) {
    const n = this._getPositionOutsideEditor(e);
    if (n) return n;
    const i = this._createMouseTarget(e, t);
    if (!i.position) return null;
    if (8 === i.type || 5 === i.type) {
      const e = this._helpPositionJumpOverViewZone(i.detail);
      if (e) return qQ.createViewZone(i.type, i.element, i.mouseColumn, e, i.detail);
    }
    return i;
  }
  _helpPositionJumpOverViewZone(e) {
    const t = new xV(
        this._currentSelection.selectionStartLineNumber,
        this._currentSelection.selectionStartColumn,
      ),
      n = e.positionBefore,
      i = e.positionAfter;
    return n && i ? (n.isBefore(t) ? n : i) : null;
  }
  _dispatchMouse(e, t, n) {
    e.position &&
      this._viewController.dispatchMouse({
        position: e.position,
        mouseColumn: e.mouseColumn,
        startedOnLineNumbers: this._mouseState.startedOnLineNumbers,
        revealType: n,
        inSelectionMode: t,
        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: 6 === e.type && null !== e.detail.injectedText,
      });
  }
}
class IJ {
  static {
    this.CLEAR_MOUSE_DOWN_COUNT_TIME = 400;
  }
  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 = !1),
      (this._ctrlKey = !1),
      (this._metaKey = !1),
      (this._shiftKey = !1),
      (this._leftButton = !1),
      (this._middleButton = !1),
      (this._startedOnLineNumbers = !1),
      (this._lastMouseDownPosition = null),
      (this._lastMouseDownPositionEqualCount = 0),
      (this._lastMouseDownCount = 0),
      (this._lastSetMouseDownCountTime = 0),
      (this.isDragAndDrop = !1));
  }
  get count() {
    return this._lastMouseDownCount;
  }
  setModifiers(e) {
    ((this._altKey = e.altKey),
      (this._ctrlKey = e.ctrlKey),
      (this._metaKey = e.metaKey),
      (this._shiftKey = e.shiftKey));
  }
  setStartButtons(e) {
    ((this._leftButton = e.leftButton), (this._middleButton = e.middleButton));
  }
  setStartedOnLineNumbers(e) {
    this._startedOnLineNumbers = e;
  }
  trySetCount(e, t) {
    const n = new Date().getTime();
    (n - this._lastSetMouseDownCountTime > IJ.CLEAR_MOUSE_DOWN_COUNT_TIME && (e = 1),
      (this._lastSetMouseDownCountTime = n),
      e > this._lastMouseDownCount + 1 && (e = this._lastMouseDownCount + 1),
      this._lastMouseDownPosition && this._lastMouseDownPosition.equals(t)
        ? this._lastMouseDownPositionEqualCount++
        : (this._lastMouseDownPositionEqualCount = 1),
      (this._lastMouseDownPosition = t),
      (this._lastMouseDownCount = Math.min(e, this._lastMouseDownPositionEqualCount)));
  }
}
class RJ {
  get event() {
    return this.emitter.event;
  }
  constructor(e, t, n) {
    const i = (e) => this.emitter.fire(e);
    this.emitter = new QO({
      onWillAddFirstListener: () => e.addEventListener(t, i, n),
      onDidRemoveLastListener: () => e.removeEventListener(t, i, n),
    });
  }
  dispose() {
    this.emitter.dispose();
  }
}
function OJ(e, t, n, i) {
  const r = e.getPlainTextToCopy(t, n, AR),
    o = e.model.getEOL(),
    s = n && 1 === t.length && t[0].isEmpty(),
    a = Array.isArray(r) ? r : null,
    l = Array.isArray(r) ? r.join(o) : r;
  let c,
    d = null;
  if (AJ.forceCopyWithSyntaxHighlighting || (i && l.length < 65536)) {
    const i = e.getRichTextToCopy(t, n);
    i && ((c = i.html), (d = i.mode));
  }
  return { isFromEmptySelection: s, multicursorText: a, text: l, html: c, mode: d };
}
class MJ {
  static {
    this.INSTANCE = new MJ();
  }
  constructor() {
    this._lastState = null;
  }
  set(e, t) {
    this._lastState = { lastCopiedValue: e, data: t };
  }
  get(e) {
    return this._lastState && this._lastState.lastCopiedValue === e
      ? this._lastState.data
      : ((this._lastState = null), null);
  }
}
const AJ = { forceCopyWithSyntaxHighlighting: !1 },
  PJ = {
    getTextData(e) {
      const t = e.getData(UU.text);
      let n = null;
      const i = e.getData("vscode-editor-data");
      if ("string" == typeof i)
        try {
          ((n = JSON.parse(i)), 1 !== n.version && (n = null));
        } catch (r) {}
      if (0 === t.length && null === n && e.files.length > 0) {
        return [
          Array.prototype.slice
            .call(e.files, 0)
            .map((e) => e.name)
            .join("\n"),
          null,
        ];
      }
      return [t, n];
    },
    setTextData(e, t, n, i) {
      (e.setData(UU.text, t),
        "string" == typeof n && e.setData("text/html", n),
        e.setData("vscode-editor-data", JSON.stringify(i)));
    },
  };
class jJ {
  static {
    this.EMPTY = new jJ("", 0, 0, null, void 0);
  }
  constructor(e, t, n, i, r) {
    ((this.value = e),
      (this.selectionStart = t),
      (this.selectionEnd = n),
      (this.selection = i),
      (this.newlineCountBeforeSelection = r));
  }
  toString() {
    return `[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`;
  }
  static readFromTextArea(e, t) {
    const n = e.getValue(),
      i = e.getSelectionStart(),
      r = e.getSelectionEnd();
    let o;
    if (t) {
      n.substring(0, i) === t.value.substring(0, t.selectionStart) &&
        (o = t.newlineCountBeforeSelection);
    }
    return new jJ(n, i, r, null, o);
  }
  collapseSelection() {
    return this.selectionStart === this.value.length
      ? this
      : new jJ(this.value, this.value.length, this.value.length, null, void 0);
  }
  isWrittenToTextArea(e, t) {
    const n = this.value === e.getValue();
    if (!t) return n;
    return (
      this.selectionStart === e.getSelectionStart() &&
      this.selectionEnd === e.getSelectionEnd() &&
      n
    );
  }
  writeToTextArea(e, t, n) {
    (t.setValue(e, this.value),
      n && t.setSelectionRange(e, this.selectionStart, this.selectionEnd));
  }
  deduceEditorPosition(e) {
    if (e <= this.selectionStart) {
      const t = this.value.substring(e, this.selectionStart);
      return this._finishDeduceEditorPosition(this.selection?.getStartPosition() ?? null, t, -1);
    }
    if (e >= this.selectionEnd) {
      const t = this.value.substring(this.selectionEnd, e);
      return this._finishDeduceEditorPosition(this.selection?.getEndPosition() ?? null, t, 1);
    }
    const t = this.value.substring(this.selectionStart, e);
    if (-1 === t.indexOf(String.fromCharCode(8230)))
      return this._finishDeduceEditorPosition(this.selection?.getStartPosition() ?? null, t, 1);
    const n = this.value.substring(e, this.selectionEnd);
    return this._finishDeduceEditorPosition(this.selection?.getEndPosition() ?? null, n, -1);
  }
  _finishDeduceEditorPosition(e, t, n) {
    let i = 0,
      r = -1;
    for (; -1 !== (r = t.indexOf("\n", r + 1)); ) i++;
    return [e, n * t.length, i];
  }
  static deduceInput(e, t, n) {
    if (!e) return { text: "", replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 };
    const i = Math.min(cA(e.value, t.value), e.selectionStart, t.selectionStart),
      r = Math.min(
        dA(e.value, t.value),
        e.value.length - e.selectionEnd,
        t.value.length - t.selectionEnd,
      );
    e.value.substring(i, e.value.length - r);
    const o = t.value.substring(i, t.value.length - r),
      s = e.selectionStart - i,
      a = e.selectionEnd - i;
    if (t.selectionStart - i === t.selectionEnd - i) {
      return {
        text: o,
        replacePrevCharCnt: e.selectionStart - i,
        replaceNextCharCnt: 0,
        positionDelta: 0,
      };
    }
    return { text: o, replacePrevCharCnt: a - s, replaceNextCharCnt: 0, positionDelta: 0 };
  }
  static deduceAndroidCompositionInput(e, t) {
    if (!e) return { text: "", replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 };
    if (e.value === t.value)
      return {
        text: "",
        replacePrevCharCnt: 0,
        replaceNextCharCnt: 0,
        positionDelta: t.selectionEnd - e.selectionEnd,
      };
    const n = Math.min(cA(e.value, t.value), e.selectionEnd),
      i = Math.min(dA(e.value, t.value), e.value.length - e.selectionEnd),
      r = e.value.substring(n, e.value.length - i),
      o = t.value.substring(n, t.value.length - i);
    e.selectionStart;
    const s = e.selectionEnd - n;
    t.selectionStart;
    const a = t.selectionEnd - n;
    return {
      text: o,
      replacePrevCharCnt: s,
      replaceNextCharCnt: r.length - s,
      positionDelta: a - o.length,
    };
  }
  static fromScreenReaderContentState(e) {
    return new jJ(
      e.value,
      e.selectionStart,
      e.selectionEnd,
      e.selection,
      e.newlineCountBeforeSelection,
    );
  }
}
const FJ = (function () {
  if ("function" == typeof crypto.randomUUID) return crypto.randomUUID.bind(crypto);
  const e = new Uint8Array(16),
    t = [];
  for (let n = 0; n < 256; n++) t.push(n.toString(16).padStart(2, "0"));
  return function () {
    (crypto.getRandomValues(e), (e[6] = (15 & e[6]) | 64), (e[8] = (63 & e[8]) | 128));
    let n = 0,
      i = "";
    return (
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += "-"),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += "-"),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += "-"),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += "-"),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      (i += t[e[n++]]),
      i
    );
  };
})();
function BJ(e) {
  return `${e}-${FJ()}`;
}
var VJ,
  WJ = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
!(function (e) {
  e.Tap = "-monaco-textarea-synthetic-tap";
})(VJ || (VJ = {}));
class HJ {
  constructor() {
    this._lastTypeTextLength = 0;
  }
  handleCompositionUpdate(e) {
    const t = {
      text: (e = e || ""),
      replacePrevCharCnt: this._lastTypeTextLength,
      replaceNextCharCnt: 0,
      positionDelta: 0,
    };
    return ((this._lastTypeTextLength = e.length), t);
  }
}
let zJ = class extends PO {
  get textAreaState() {
    return this._textAreaState;
  }
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._host = e),
      (this._textArea = t),
      (this._OS = n),
      (this._browser = i),
      (this._accessibilityService = r),
      (this._logService = o),
      (this._onFocus = this._register(new QO())),
      (this.onFocus = this._onFocus.event),
      (this._onBlur = this._register(new QO())),
      (this.onBlur = this._onBlur.event),
      (this._onKeyDown = this._register(new QO())),
      (this.onKeyDown = this._onKeyDown.event),
      (this._onKeyUp = this._register(new QO())),
      (this.onKeyUp = this._onKeyUp.event),
      (this._onCut = this._register(new QO())),
      (this.onCut = this._onCut.event),
      (this._onPaste = this._register(new QO())),
      (this.onPaste = this._onPaste.event),
      (this._onType = this._register(new QO())),
      (this.onType = this._onType.event),
      (this._onCompositionStart = this._register(new QO())),
      (this.onCompositionStart = this._onCompositionStart.event),
      (this._onCompositionUpdate = this._register(new QO())),
      (this.onCompositionUpdate = this._onCompositionUpdate.event),
      (this._onCompositionEnd = this._register(new QO())),
      (this.onCompositionEnd = this._onCompositionEnd.event),
      (this._onSelectionChangeRequest = this._register(new QO())),
      (this.onSelectionChangeRequest = this._onSelectionChangeRequest.event),
      (this._asyncFocusGainWriteScreenReaderContent = this._register(new jO())),
      (this._asyncTriggerCut = this._register(new EM(() => this._onCut.fire(), 0))),
      (this._textAreaState = jJ.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 EM(() => this.writeNativeTextAreaContent("asyncFocusGain"), 0),
              ))
            : this._asyncFocusGainWriteScreenReaderContent.clear();
        }),
      ),
      (this._hasFocus = !1),
      (this._currentComposition = null));
    let s = null;
    (this._register(
      this._textArea.onKeyDown((e) => {
        const t = new wO(e);
        ((114 === t.keyCode || (this._currentComposition && 1 === t.keyCode)) &&
          t.stopPropagation(),
          t.equals(9) && t.preventDefault(),
          (s = t),
          this._onKeyDown.fire(t));
      }),
    ),
      this._register(
        this._textArea.onKeyUp((e) => {
          const t = new wO(e);
          this._onKeyUp.fire(t);
        }),
      ),
      this._register(
        this._textArea.onCompositionStart((e) => {
          const t = new HJ();
          if (this._currentComposition) this._currentComposition = t;
          else {
            if (
              ((this._currentComposition = t),
              2 === this._OS &&
                s &&
                s.equals(114) &&
                this._textAreaState.selectionStart === this._textAreaState.selectionEnd &&
                this._textAreaState.selectionStart > 0 &&
                this._textAreaState.value.substr(this._textAreaState.selectionStart - 1, 1) ===
                  e.data &&
                ("ArrowRight" === s.code || "ArrowLeft" === s.code))
            )
              return (
                t.handleCompositionUpdate("x"),
                void this._onCompositionStart.fire({ data: e.data })
              );
            (this._browser.isAndroid, this._onCompositionStart.fire({ data: e.data }));
          }
        }),
      ),
      this._register(
        this._textArea.onCompositionUpdate((e) => {
          const t = this._currentComposition;
          if (!t) return;
          if (this._browser.isAndroid) {
            const t = jJ.readFromTextArea(this._textArea, this._textAreaState),
              n = jJ.deduceAndroidCompositionInput(this._textAreaState, t);
            return (
              (this._textAreaState = t),
              this._onType.fire(n),
              void this._onCompositionUpdate.fire(e)
            );
          }
          const n = t.handleCompositionUpdate(e.data);
          ((this._textAreaState = jJ.readFromTextArea(this._textArea, this._textAreaState)),
            this._onType.fire(n),
            this._onCompositionUpdate.fire(e));
        }),
      ),
      this._register(
        this._textArea.onCompositionEnd((e) => {
          const t = this._currentComposition;
          if (!t) return;
          if (((this._currentComposition = null), this._browser.isAndroid)) {
            const e = jJ.readFromTextArea(this._textArea, this._textAreaState),
              t = jJ.deduceAndroidCompositionInput(this._textAreaState, e);
            return (
              (this._textAreaState = e),
              this._onType.fire(t),
              void this._onCompositionEnd.fire()
            );
          }
          const n = t.handleCompositionUpdate(e.data);
          ((this._textAreaState = jJ.readFromTextArea(this._textArea, this._textAreaState)),
            this._onType.fire(n),
            this._onCompositionEnd.fire());
        }),
      ),
      this._register(
        this._textArea.onInput((e) => {
          if (
            (this._textArea.setIgnoreSelectionChangeTime("received input event"),
            this._currentComposition)
          )
            return;
          const t = jJ.readFromTextArea(this._textArea, this._textAreaState),
            n = jJ.deduceInput(this._textAreaState, t, 2 === this._OS);
          (0 !== n.replacePrevCharCnt ||
            1 !== n.text.length ||
            (!uA(n.text.charCodeAt(0)) && 127 !== n.text.charCodeAt(0))) &&
            ((this._textAreaState = t),
            ("" === n.text &&
              0 === n.replacePrevCharCnt &&
              0 === n.replaceNextCharCnt &&
              0 === n.positionDelta) ||
              ("insertFromPaste" === e.inputType
                ? this._onPaste.fire({ text: n.text, metadata: MJ.INSTANCE.get(n.text) })
                : this._onType.fire(n)));
        }),
      ),
      this._register(
        this._textArea.onCut((e) => {
          (this._logService.trace("TextAreaInput#onCut", e),
            this._textArea.setIgnoreSelectionChangeTime("received cut event"),
            this._ensureClipboardGetsEditorSelection(e),
            this._asyncTriggerCut.schedule());
        }),
      ),
      this._register(
        this._textArea.onCopy((e) => {
          (this._logService.trace("TextAreaInput#onCopy", e),
            this._ensureClipboardGetsEditorSelection(e));
        }),
      ),
      this._register(
        this._textArea.onPaste((e) => {
          if (
            (this._logService.trace("TextAreaInput#onPaste", e),
            this._textArea.setIgnoreSelectionChangeTime("received paste event"),
            e.preventDefault(),
            !e.clipboardData)
          )
            return;
          let [t, n] = PJ.getTextData(e.clipboardData);
          (this._logService.trace(
            "TextAreaInput#onPaste with id : ",
            n?.id,
            " with text.length: ",
            t.length,
          ),
            t &&
              ((n = n || MJ.INSTANCE.get(t)),
              this._logService.trace("TextAreaInput#onPaste (before onPaste)"),
              this._onPaste.fire({ text: t, metadata: n })));
        }),
      ),
      this._register(
        this._textArea.onFocus(() => {
          const e = this._hasFocus;
          (this._setHasFocus(!0),
            this._accessibilityService.isScreenReaderOptimized() &&
              this._browser.isSafari &&
              !e &&
              this._hasFocus &&
              (this._asyncFocusGainWriteScreenReaderContent.value ||
                (this._asyncFocusGainWriteScreenReaderContent.value = new EM(
                  () => 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(!1));
        }),
      ),
      this._register(
        this._textArea.onSyntheticTap(() => {
          this._browser.isAndroid &&
            this._currentComposition &&
            ((this._currentComposition = null),
            this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),
            this._onCompositionEnd.fire());
        }),
      ));
  }
  _installSelectionChangeListener() {
    let e = 0;
    return $F(this._textArea.ownerDocument, "selectionchange", (t) => {
      if ((tG.onSelectionChange(), !this._hasFocus)) return;
      if (this._currentComposition) return;
      if (!this._browser.isChrome) return;
      const n = Date.now(),
        i = n - e;
      if (((e = n), i < 5)) return;
      const r = n - this._textArea.getIgnoreSelectionChangeTime();
      if ((this._textArea.resetSelectionChangeTime(), r < 100)) return;
      if (!this._textAreaState.selection) return;
      const o = this._textArea.getValue();
      if (this._textAreaState.value !== o) return;
      const s = this._textArea.getSelectionStart(),
        a = this._textArea.getSelectionEnd();
      if (this._textAreaState.selectionStart === s && this._textAreaState.selectionEnd === a)
        return;
      const l = this._textAreaState.deduceEditorPosition(s),
        c = this._host.deduceModelPosition(l[0], l[1], l[2]),
        d = this._textAreaState.deduceEditorPosition(a),
        u = this._host.deduceModelPosition(d[0], d[1], d[2]),
        h = new XH(c.lineNumber, c.column, u.lineNumber, u.column);
      this._onSelectionChangeRequest.fire(h);
    });
  }
  dispose() {
    (super.dispose(),
      this._selectionChangeListener &&
        (this._selectionChangeListener.dispose(), (this._selectionChangeListener = null)));
  }
  focusTextArea() {
    (this._setHasFocus(!0), this.refreshFocusState());
  }
  isFocused() {
    return this._hasFocus;
  }
  refreshFocusState() {
    this._setHasFocus(this._textArea.hasFocus());
  }
  _setHasFocus(e) {
    this._hasFocus !== e &&
      ((this._hasFocus = e),
      this._selectionChangeListener &&
        (this._selectionChangeListener.dispose(), (this._selectionChangeListener = null)),
      this._hasFocus && (this._selectionChangeListener = this._installSelectionChangeListener()),
      this._hasFocus && this.writeNativeTextAreaContent("focusgain"),
      this._hasFocus ? this._onFocus.fire() : this._onBlur.fire());
  }
  _setAndWriteTextAreaState(e, t) {
    (this._hasFocus || (t = t.collapseSelection()),
      t.isWrittenToTextArea(this._textArea, this._hasFocus) ||
        this._logService.trace(`writeTextAreaState(reason: ${e})`),
      t.writeToTextArea(e, this._textArea, this._hasFocus),
      (this._textAreaState = t));
  }
  writeNativeTextAreaContent(e) {
    (!this._accessibilityService.isScreenReaderOptimized() && "render" === e) ||
      this._currentComposition ||
      this._setAndWriteTextAreaState(e, this._host.getScreenReaderContent());
  }
  _ensureClipboardGetsEditorSelection(e) {
    const t = this._host.getDataToCopy();
    let n;
    this._logService.getLevel() === wH.Trace && (n = FJ());
    const i = {
      version: 1,
      id: n,
      isFromEmptySelection: t.isFromEmptySelection,
      multicursorText: t.multicursorText,
      mode: t.mode,
    };
    (MJ.INSTANCE.set(this._browser.isFirefox ? t.text.replace(/\r\n/g, "\n") : t.text, i),
      e.preventDefault(),
      e.clipboardData && PJ.setTextData(e.clipboardData, t.text, t.html, i),
      this._logService.trace(
        "TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ",
        n,
        " with text.length: ",
        t.text.length,
      ));
  }
};
zJ = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([WJ(4, KK), WJ(5, yH)], zJ);
class UJ extends PO {
  get ownerDocument() {
    return this._actual.ownerDocument;
  }
  constructor(e) {
    (super(),
      (this._actual = e),
      (this._onSyntheticTap = this._register(new QO())),
      (this.onSyntheticTap = this._onSyntheticTap.event),
      (this._ignoreSelectionChangeTime = 0),
      (this.onKeyDown = this._register(new RJ(this._actual, "keydown")).event),
      (this.onKeyPress = this._register(new RJ(this._actual, "keypress")).event),
      (this.onKeyUp = this._register(new RJ(this._actual, "keyup")).event),
      (this.onCompositionStart = this._register(new RJ(this._actual, "compositionstart")).event),
      (this.onCompositionUpdate = this._register(new RJ(this._actual, "compositionupdate")).event),
      (this.onCompositionEnd = this._register(new RJ(this._actual, "compositionend")).event),
      (this.onBeforeInput = this._register(new RJ(this._actual, "beforeinput")).event),
      (this.onInput = this._register(new RJ(this._actual, "input")).event),
      (this.onCut = this._register(new RJ(this._actual, "cut")).event),
      (this.onCopy = this._register(new RJ(this._actual, "copy")).event),
      (this.onPaste = this._register(new RJ(this._actual, "paste")).event),
      (this.onFocus = this._register(new RJ(this._actual, "focus")).event),
      (this.onBlur = this._register(new RJ(this._actual, "blur")).event),
      this._register(this.onKeyDown(() => tG.onKeyDown())),
      this._register(this.onBeforeInput(() => tG.onBeforeInput())),
      this._register(this.onInput(() => tG.onInput())),
      this._register(this.onKeyUp(() => tG.onKeyUp())),
      this._register($F(this._actual, VJ.Tap, () => this._onSyntheticTap.fire())));
  }
  hasFocus() {
    const e = _B(this._actual);
    return e
      ? e.activeElement === this._actual
      : !!this._actual.isConnected && vB() === this._actual;
  }
  setIgnoreSelectionChangeTime(e) {
    this._ignoreSelectionChangeTime = Date.now();
  }
  getIgnoreSelectionChangeTime() {
    return this._ignoreSelectionChangeTime;
  }
  resetSelectionChangeTime() {
    this._ignoreSelectionChangeTime = 0;
  }
  getValue() {
    return this._actual.value;
  }
  setValue(e, t) {
    const n = this._actual;
    n.value !== t && (this.setIgnoreSelectionChangeTime("setValue"), (n.value = t));
  }
  getSelectionStart() {
    return "backward" === this._actual.selectionDirection
      ? this._actual.selectionEnd
      : this._actual.selectionStart;
  }
  getSelectionEnd() {
    return "backward" === this._actual.selectionDirection
      ? this._actual.selectionStart
      : this._actual.selectionEnd;
  }
  setSelectionRange(e, t, n) {
    const i = this._actual;
    let r = null;
    const o = _B(i);
    r = o ? o.activeElement : vB();
    const s = MF(r),
      a = r === i,
      l = i.selectionStart,
      c = i.selectionEnd;
    if (a && l === t && c === n) RI && s.parent !== s && i.focus();
    else {
      if (a)
        return (
          this.setIgnoreSelectionChangeTime("setSelectionRange"),
          i.setSelectionRange(t, n),
          void (RI && s.parent !== s && i.focus())
        );
      try {
        const e = (function (e) {
          const t = [];
          for (let n = 0; e && e.nodeType === e.ELEMENT_NODE; n++)
            ((t[n] = e.scrollTop), (e = e.parentNode));
          return t;
        })(i);
        (this.setIgnoreSelectionChangeTime("setSelectionRange"),
          i.focus(),
          i.setSelectionRange(t, n),
          (function (e, t) {
            for (let n = 0; e && e.nodeType === e.ELEMENT_NODE; n++)
              (e.scrollTop !== t[n] && (e.scrollTop = t[n]), (e = e.parentNode));
          })(i, e));
      } catch (spt) {}
    }
  }
}
class $J extends DJ {
  constructor(e, t, n) {
    (super(e, t, n),
      this._register(iJ.addTarget(this.viewHelper.linesContentDomNode)),
      this._register($F(this.viewHelper.linesContentDomNode, nJ.Tap, (e) => this.onTap(e))),
      this._register($F(this.viewHelper.linesContentDomNode, nJ.Change, (e) => this.onChange(e))),
      this._register(
        $F(this.viewHelper.linesContentDomNode, nJ.Contextmenu, (e) =>
          this._onContextMenu(new ZX(e, !1, this.viewHelper.viewDomNode), !1),
        ),
      ),
      (this._lastPointerType = "mouse"),
      this._register(
        $F(this.viewHelper.linesContentDomNode, "pointerdown", (e) => {
          const t = e.pointerType;
          this._lastPointerType = "mouse" !== t ? ("touch" === t ? "touch" : "pen") : "mouse";
        }),
      ));
    const i = new XX(this.viewHelper.viewDomNode);
    (this._register(i.onPointerMove(this.viewHelper.viewDomNode, (e) => this._onMouseMove(e))),
      this._register(i.onPointerUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e))),
      this._register(i.onPointerLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e))),
      this._register(
        i.onPointerDown(this.viewHelper.viewDomNode, (e, t) => this._onMouseDown(e, t)),
      ));
  }
  onTap(e) {
    e.initialTarget &&
      this.viewHelper.linesContentDomNode.contains(e.initialTarget) &&
      (e.preventDefault(), this.viewHelper.focusTextArea(), this._dispatchGesture(e, !1));
  }
  onChange(e) {
    ("touch" === this._lastPointerType &&
      this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX, -e.translationY),
      "pen" === this._lastPointerType && this._dispatchGesture(e, !0));
  }
  _dispatchGesture(e, t) {
    const n = this._createMouseTarget(new ZX(e, !1, this.viewHelper.viewDomNode), !1);
    n.position &&
      this.viewController.dispatchMouse({
        position: n.position,
        mouseColumn: n.position.column,
        startedOnLineNumbers: !1,
        revealType: 1,
        mouseDownCount: e.tapCount,
        inSelectionMode: t,
        altKey: !1,
        ctrlKey: !1,
        metaKey: !1,
        shiftKey: !1,
        leftButton: !1,
        middleButton: !1,
        onInjectedText: 6 === n.type && null !== n.detail.injectedText,
      });
  }
  _onMouseDown(e, t) {
    "touch" !== e.browserEvent.pointerType && super._onMouseDown(e, t);
  }
}
class qJ extends DJ {
  constructor(e, t, n) {
    (super(e, t, n),
      this._register(iJ.addTarget(this.viewHelper.linesContentDomNode)),
      this._register($F(this.viewHelper.linesContentDomNode, nJ.Tap, (e) => this.onTap(e))),
      this._register($F(this.viewHelper.linesContentDomNode, nJ.Change, (e) => this.onChange(e))),
      this._register(
        $F(this.viewHelper.linesContentDomNode, nJ.Contextmenu, (e) =>
          this._onContextMenu(new ZX(e, !1, this.viewHelper.viewDomNode), !1),
        ),
      ));
  }
  onTap(e) {
    (e.preventDefault(), this.viewHelper.focusTextArea());
    const t = this._createMouseTarget(new ZX(e, !1, this.viewHelper.viewDomNode), !1);
    if (t.position) {
      const e = document.createEvent("CustomEvent");
      (e.initEvent(VJ.Tap, !1, !0),
        this.viewHelper.dispatchTextAreaEvent(e),
        this.viewController.moveTo(t.position, 1));
    }
  }
  onChange(e) {
    this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX, -e.translationY);
  }
}
class KJ extends PO {
  constructor(e, t, n) {
    super();
    (WR || (nO && HR)) && iO
      ? (this.handler = this._register(new $J(e, t, n)))
      : NI.TouchEvent
        ? (this.handler = this._register(new qJ(e, t, n)))
        : (this.handler = this._register(new DJ(e, t, n)));
  }
  getTargetAtClientPoint(e, t) {
    return this.handler.getTargetAtClientPoint(e, t);
  }
}
class GJ {
  constructor(e, t, n, i) {
    ((this.configuration = e),
      (this.viewModel = t),
      (this.userInputEvents = n),
      (this.commandDelegate = i));
  }
  paste(e, t, n, i) {
    this.commandDelegate.paste(e, t, n, i);
  }
  type(e) {
    this.commandDelegate.type(e);
  }
  compositionType(e, t, n, i) {
    this.commandDelegate.compositionType(e, t, n, i);
  }
  compositionStart() {
    this.commandDelegate.startComposition();
  }
  compositionEnd() {
    this.commandDelegate.endComposition();
  }
  cut() {
    this.commandDelegate.cut();
  }
  setSelection(e) {
    Nq.SetSelection.runCoreEditorCommand(this.viewModel, { source: "keyboard", selection: e });
  }
  _validateViewColumn(e) {
    const t = this.viewModel.getLineMinColumn(e.lineNumber);
    return e.column < t ? new xV(e.lineNumber, t) : e;
  }
  _hasMulticursorModifier(e) {
    switch (this.configuration.options.get(86)) {
      case "altKey":
        return e.altKey;
      case "ctrlKey":
        return e.ctrlKey;
      case "metaKey":
        return e.metaKey;
      default:
        return !1;
    }
  }
  _hasNonMulticursorModifier(e) {
    switch (this.configuration.options.get(86)) {
      case "altKey":
        return e.ctrlKey || e.metaKey;
      case "ctrlKey":
        return e.altKey || e.metaKey;
      case "metaKey":
        return e.ctrlKey || e.altKey;
      default:
        return !1;
    }
  }
  dispatchMouse(e) {
    const t = this.configuration.options,
      n = jR && t.get(121),
      i = t.get(28),
      r = t.get(171);
    e.middleButton && !n
      ? r || this._columnSelect(e.position, e.mouseColumn, e.inSelectionMode)
      : e.startedOnLineNumbers
        ? this._hasMulticursorModifier(e)
          ? e.inSelectionMode
            ? this._lastCursorLineSelect(e.position, e.revealType)
            : this._createCursor(e.position, !0)
          : e.inSelectionMode
            ? this._lineSelectDrag(e.position, e.revealType)
            : this._lineSelect(e.position, e.revealType)
        : e.mouseDownCount >= 4
          ? this._selectAll()
          : 3 === e.mouseDownCount
            ? this._hasMulticursorModifier(e)
              ? e.inSelectionMode
                ? this._lastCursorLineSelectDrag(e.position, e.revealType)
                : this._lastCursorLineSelect(e.position, e.revealType)
              : e.inSelectionMode
                ? this._lineSelectDrag(e.position, e.revealType)
                : this._lineSelect(e.position, e.revealType)
            : 2 === e.mouseDownCount
              ? e.onInjectedText ||
                (this._hasMulticursorModifier(e)
                  ? this._lastCursorWordSelect(e.position, e.revealType)
                  : e.inSelectionMode
                    ? this._wordSelectDrag(e.position, e.revealType)
                    : this._wordSelect(e.position, e.revealType))
              : this._hasMulticursorModifier(e)
                ? this._hasNonMulticursorModifier(e) ||
                  (e.shiftKey
                    ? this._columnSelect(e.position, e.mouseColumn, !0)
                    : e.inSelectionMode
                      ? this._lastCursorMoveToSelect(e.position, e.revealType)
                      : this._createCursor(e.position, !1))
                : e.inSelectionMode
                  ? e.altKey || i
                    ? this._columnSelect(e.position, e.mouseColumn, !0)
                    : this._moveToSelect(e.position, e.revealType)
                  : this.moveTo(e.position, e.revealType);
  }
  _usualArgs(e, t) {
    return (
      (e = this._validateViewColumn(e)),
      {
        source: "mouse",
        position: this._convertViewToModelPosition(e),
        viewPosition: e,
        revealType: t,
      }
    );
  }
  moveTo(e, t) {
    Nq.MoveTo.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _moveToSelect(e, t) {
    Nq.MoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _columnSelect(e, t, n) {
    ((e = this._validateViewColumn(e)),
      Nq.ColumnSelect.runCoreEditorCommand(this.viewModel, {
        source: "mouse",
        position: this._convertViewToModelPosition(e),
        viewPosition: e,
        mouseColumn: t,
        doColumnSelect: n,
      }));
  }
  _createCursor(e, t) {
    ((e = this._validateViewColumn(e)),
      Nq.CreateCursor.runCoreEditorCommand(this.viewModel, {
        source: "mouse",
        position: this._convertViewToModelPosition(e),
        viewPosition: e,
        wholeLine: t,
      }));
  }
  _lastCursorMoveToSelect(e, t) {
    Nq.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _wordSelect(e, t) {
    Nq.WordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _wordSelectDrag(e, t) {
    Nq.WordSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lastCursorWordSelect(e, t) {
    Nq.LastCursorWordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lineSelect(e, t) {
    Nq.LineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lineSelectDrag(e, t) {
    Nq.LineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lastCursorLineSelect(e, t) {
    Nq.LastCursorLineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lastCursorLineSelectDrag(e, t) {
    Nq.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _selectAll() {
    Nq.SelectAll.runCoreEditorCommand(this.viewModel, { source: "mouse" });
  }
  _convertViewToModelPosition(e) {
    return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e);
  }
  emitKeyDown(e) {
    this.userInputEvents.emitKeyDown(e);
  }
  emitKeyUp(e) {
    this.userInputEvents.emitKeyUp(e);
  }
  emitContextMenu(e) {
    this.userInputEvents.emitContextMenu(e);
  }
  emitMouseMove(e) {
    this.userInputEvents.emitMouseMove(e);
  }
  emitMouseLeave(e) {
    this.userInputEvents.emitMouseLeave(e);
  }
  emitMouseUp(e) {
    this.userInputEvents.emitMouseUp(e);
  }
  emitMouseDown(e) {
    this.userInputEvents.emitMouseDown(e);
  }
  emitMouseDrag(e) {
    this.userInputEvents.emitMouseDrag(e);
  }
  emitMouseDrop(e) {
    this.userInputEvents.emitMouseDrop(e);
  }
  emitMouseDropCanceled() {
    this.userInputEvents.emitMouseDropCanceled();
  }
  emitMouseWheel(e) {
    this.userInputEvents.emitMouseWheel(e);
  }
}
function ZJ(e, t) {
  const n = BI();
  if (n?.createTrustedTypesPolicy)
    try {
      return n.createTrustedTypesPolicy(e, t);
    } catch (i) {
      return void HI(i);
    }
  try {
    return globalThis.trustedTypes?.createPolicy(e, t);
  } catch (i) {
    return void HI(i);
  }
}
class YJ {
  constructor(e) {
    ((this._lineFactory = e), this._set(1, []));
  }
  flush() {
    this._set(1, []);
  }
  _set(e, t) {
    ((this._lines = t), (this._rendLineNumberStart = e));
  }
  _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(e) {
    const t = e - this._rendLineNumberStart;
    if (t < 0 || t >= this._lines.length) throw new QI("Illegal value for lineNumber");
    return this._lines[t];
  }
  onLinesDeleted(e, t) {
    if (0 === this.getCount()) return null;
    const n = this.getStartLineNumber(),
      i = this.getEndLineNumber();
    if (t < n) {
      const n = t - e + 1;
      return ((this._rendLineNumberStart -= n), null);
    }
    if (e > i) return null;
    let r = 0,
      o = 0;
    for (let s = n; s <= i; s++) {
      const n = s - this._rendLineNumberStart;
      e <= s && s <= t && (0 === o ? ((r = n), (o = 1)) : o++);
    }
    if (e < n) {
      let i = 0;
      ((i = t < n ? t - e + 1 : n - e), (this._rendLineNumberStart -= i));
    }
    return this._lines.splice(r, o);
  }
  onLinesChanged(e, t) {
    const n = e + t - 1;
    if (0 === this.getCount()) return !1;
    const i = this.getStartLineNumber(),
      r = this.getEndLineNumber();
    let o = !1;
    for (let s = e; s <= n; s++)
      s >= i && s <= r && (this._lines[s - this._rendLineNumberStart].onContentChanged(), (o = !0));
    return o;
  }
  onLinesInserted(e, t) {
    if (0 === this.getCount()) return null;
    const n = t - e + 1,
      i = this.getStartLineNumber(),
      r = this.getEndLineNumber();
    if (e <= i) return ((this._rendLineNumberStart += n), null);
    if (e > r) return null;
    if (n + e > r) {
      return this._lines.splice(e - this._rendLineNumberStart, r - e + 1);
    }
    const o = [];
    for (let d = 0; d < n; d++) o[d] = this._lineFactory.createLine();
    const s = e - this._rendLineNumberStart,
      a = this._lines.slice(0, s),
      l = this._lines.slice(s, this._lines.length - n),
      c = this._lines.slice(this._lines.length - n, this._lines.length);
    return ((this._lines = a.concat(o).concat(l)), c);
  }
  onTokensChanged(e) {
    if (0 === this.getCount()) return !1;
    const t = this.getStartLineNumber(),
      n = this.getEndLineNumber();
    let i = !1;
    for (let r = 0, o = e.length; r < o; r++) {
      const o = e[r];
      if (o.toLineNumber < t || o.fromLineNumber > n) continue;
      const s = Math.max(t, o.fromLineNumber),
        a = Math.min(n, o.toLineNumber);
      for (let e = s; e <= a; e++) {
        const t = e - this._rendLineNumberStart;
        (this._lines[t].onTokensChanged(), (i = !0));
      }
    }
    return i;
  }
}
class XJ {
  constructor(e, t) {
    ((this._viewContext = e),
      (this._lineFactory = t),
      (this.domNode = this._createDomNode()),
      (this._linesCollection = new YJ(this._lineFactory)));
  }
  _createDomNode() {
    const e = Bq(document.createElement("div"));
    return (
      e.setClassName("view-layer"),
      e.setPosition("absolute"),
      e.domNode.setAttribute("role", "presentation"),
      e.domNode.setAttribute("aria-hidden", "true"),
      e
    );
  }
  onConfigurationChanged(e) {
    return !!e.hasChanged(165);
  }
  onFlushed(e, t) {
    if (t) {
      const e = this._linesCollection.getStartLineNumber(),
        t = this._linesCollection.getEndLineNumber();
      for (let n = e; n <= t; n++) this._linesCollection.getLine(n).getDomNode()?.remove();
    }
    return (this._linesCollection.flush(), !0);
  }
  onLinesChanged(e) {
    return this._linesCollection.onLinesChanged(e.fromLineNumber, e.count);
  }
  onLinesDeleted(e) {
    const t = this._linesCollection.onLinesDeleted(e.fromLineNumber, e.toLineNumber);
    if (t)
      for (let n = 0, i = t.length; n < i; n++) {
        const e = t[n].getDomNode();
        e?.remove();
      }
    return !0;
  }
  onLinesInserted(e) {
    const t = this._linesCollection.onLinesInserted(e.fromLineNumber, e.toLineNumber);
    if (t)
      for (let n = 0, i = t.length; n < i; n++) {
        const e = t[n].getDomNode();
        e?.remove();
      }
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onTokensChanged(e) {
    return this._linesCollection.onTokensChanged(e.ranges);
  }
  onZonesChanged(e) {
    return !0;
  }
  getStartLineNumber() {
    return this._linesCollection.getStartLineNumber();
  }
  getEndLineNumber() {
    return this._linesCollection.getEndLineNumber();
  }
  getVisibleLine(e) {
    return this._linesCollection.getLine(e);
  }
  renderLines(e) {
    const t = this._linesCollection._get(),
      n = new QJ(this.domNode.domNode, this._lineFactory, e, this._viewContext),
      i = {
        rendLineNumberStart: t.rendLineNumberStart,
        lines: t.lines,
        linesLength: t.lines.length,
      },
      r = n.render(i, e.startLineNumber, e.endLineNumber, e.relativeVerticalOffset);
    this._linesCollection._set(r.rendLineNumberStart, r.lines);
  }
}
class QJ {
  static {
    this._ttPolicy = ZJ("editorViewLayer", { createHTML: (e) => e });
  }
  constructor(e, t, n, i) {
    ((this._domNode = e),
      (this._lineFactory = t),
      (this._viewportData = n),
      (this._viewContext = i));
  }
  render(e, t, n, i) {
    const r = {
      rendLineNumberStart: e.rendLineNumberStart,
      lines: e.lines.slice(0),
      linesLength: e.linesLength,
    };
    if (r.rendLineNumberStart + r.linesLength - 1 < t || n < r.rendLineNumberStart) {
      ((r.rendLineNumberStart = t), (r.linesLength = n - t + 1), (r.lines = []));
      for (let e = t; e <= n; e++) r.lines[e - t] = this._lineFactory.createLine();
      return (this._finishRendering(r, !0, i), r);
    }
    if (
      (this._renderUntouchedLines(
        r,
        Math.max(t - r.rendLineNumberStart, 0),
        Math.min(n - r.rendLineNumberStart, r.linesLength - 1),
        i,
        t,
      ),
      r.rendLineNumberStart > t)
    ) {
      const e = t,
        o = Math.min(n, r.rendLineNumberStart - 1);
      e <= o && (this._insertLinesBefore(r, e, o, i, t), (r.linesLength += o - e + 1));
    } else if (r.rendLineNumberStart < t) {
      const e = Math.min(r.linesLength, t - r.rendLineNumberStart);
      e > 0 && (this._removeLinesBefore(r, e), (r.linesLength -= e));
    }
    if (((r.rendLineNumberStart = t), r.rendLineNumberStart + r.linesLength - 1 < n)) {
      const e = r.rendLineNumberStart + r.linesLength,
        o = n;
      e <= o && (this._insertLinesAfter(r, e, o, i, t), (r.linesLength += o - e + 1));
    } else if (r.rendLineNumberStart + r.linesLength - 1 > n) {
      const e = Math.max(0, n - r.rendLineNumberStart + 1),
        t = r.linesLength - 1 - e + 1;
      t > 0 && (this._removeLinesAfter(r, t), (r.linesLength -= t));
    }
    return (this._finishRendering(r, !1, i), r);
  }
  _renderUntouchedLines(e, t, n, i, r) {
    const o = e.rendLineNumberStart,
      s = e.lines;
    for (let a = t; a <= n; a++) {
      const e = o + a;
      s[a].layoutLine(e, i[e - r], this._lineHeightForLineNumber(e));
    }
  }
  _insertLinesBefore(e, t, n, i, r) {
    const o = [];
    let s = 0;
    for (let a = t; a <= n; a++) o[s++] = this._lineFactory.createLine();
    e.lines = o.concat(e.lines);
  }
  _removeLinesBefore(e, t) {
    for (let n = 0; n < t; n++) {
      const t = e.lines[n].getDomNode();
      t?.remove();
    }
    e.lines.splice(0, t);
  }
  _insertLinesAfter(e, t, n, i, r) {
    const o = [];
    let s = 0;
    for (let a = t; a <= n; a++) o[s++] = this._lineFactory.createLine();
    e.lines = e.lines.concat(o);
  }
  _removeLinesAfter(e, t) {
    const n = e.linesLength - t;
    for (let i = 0; i < t; i++) {
      const t = e.lines[n + i].getDomNode();
      t?.remove();
    }
    e.lines.splice(n, t);
  }
  _finishRenderingNewLines(e, t, n, i) {
    QJ._ttPolicy && (n = QJ._ttPolicy.createHTML(n));
    const r = this._domNode.lastChild;
    t || !r ? (this._domNode.innerHTML = n) : r.insertAdjacentHTML("afterend", n);
    let o = this._domNode.lastChild;
    for (let s = e.linesLength - 1; s >= 0; s--) {
      const t = e.lines[s];
      i[s] && (t.setDomNode(o), (o = o.previousSibling));
    }
  }
  _finishRenderingInvalidLines(e, t, n) {
    const i = document.createElement("div");
    (QJ._ttPolicy && (t = QJ._ttPolicy.createHTML(t)), (i.innerHTML = t));
    for (let r = 0; r < e.linesLength; r++) {
      const t = e.lines[r];
      if (n[r]) {
        const e = i.firstChild;
        (t.getDomNode().replaceWith(e), t.setDomNode(e));
      }
    }
  }
  static {
    this._sb = new bU(1e5);
  }
  _finishRendering(e, t, n) {
    const i = QJ._sb,
      r = e.linesLength,
      o = e.lines,
      s = e.rendLineNumberStart,
      a = [];
    {
      i.reset();
      let l = !1;
      for (let e = 0; e < r; e++) {
        const t = o[e];
        a[e] = !1;
        if (t.getDomNode()) continue;
        const r = e + s;
        t.renderLine(r, n[e], this._lineHeightForLineNumber(r), this._viewportData, i) &&
          ((a[e] = !0), (l = !0));
      }
      l && this._finishRenderingNewLines(e, t, i.build(), a);
    }
    {
      i.reset();
      let t = !1;
      const l = [];
      for (let e = 0; e < r; e++) {
        const r = o[e];
        if (((l[e] = !1), a[e])) continue;
        const c = e + s;
        r.renderLine(c, n[e], this._lineHeightForLineNumber(c), this._viewportData, i) &&
          ((l[e] = !0), (t = !0));
      }
      t && this._finishRenderingInvalidLines(e, i.build(), l);
    }
  }
  _lineHeightForLineNumber(e) {
    return this._viewContext.viewLayout.getLineHeightForLineNumber(e);
  }
}
class JJ extends iQ {
  constructor(e) {
    (super(e),
      (this._dynamicOverlays = []),
      (this._isFocused = !1),
      (this._visibleLines = new XJ(this._context, {
        createLine: () => new e0(this._dynamicOverlays),
      })),
      (this.domNode = this._visibleLines.domNode));
    const t = this._context.configuration.options.get(59);
    (Vq(this.domNode, t), this.domNode.setClassName("view-overlays"));
  }
  shouldRender() {
    if (super.shouldRender()) return !0;
    for (let e = 0, t = this._dynamicOverlays.length; e < t; e++) {
      if (this._dynamicOverlays[e].shouldRender()) return !0;
    }
    return !1;
  }
  dispose() {
    super.dispose();
    for (let e = 0, t = this._dynamicOverlays.length; e < t; e++) {
      this._dynamicOverlays[e].dispose();
    }
    this._dynamicOverlays = [];
  }
  getDomNode() {
    return this.domNode;
  }
  addDynamicOverlay(e) {
    this._dynamicOverlays.push(e);
  }
  onConfigurationChanged(e) {
    this._visibleLines.onConfigurationChanged(e);
    const t = this._context.configuration.options.get(59);
    return (Vq(this.domNode, t), !0);
  }
  onFlushed(e) {
    return this._visibleLines.onFlushed(e);
  }
  onFocusChanged(e) {
    return ((this._isFocused = e.isFocused), !0);
  }
  onLinesChanged(e) {
    return this._visibleLines.onLinesChanged(e);
  }
  onLinesDeleted(e) {
    return this._visibleLines.onLinesDeleted(e);
  }
  onLinesInserted(e) {
    return this._visibleLines.onLinesInserted(e);
  }
  onScrollChanged(e) {
    return this._visibleLines.onScrollChanged(e) || !0;
  }
  onTokensChanged(e) {
    return this._visibleLines.onTokensChanged(e);
  }
  onZonesChanged(e) {
    return this._visibleLines.onZonesChanged(e);
  }
  prepareRender(e) {
    const t = this._dynamicOverlays.filter((e) => e.shouldRender());
    for (let n = 0, i = t.length; n < i; n++) {
      const i = t[n];
      (i.prepareRender(e), i.onDidRender());
    }
  }
  render(e) {
    (this._viewOverlaysRender(e), this.domNode.toggleClassName("focused", this._isFocused));
  }
  _viewOverlaysRender(e) {
    this._visibleLines.renderLines(e.viewportData);
  }
}
class e0 {
  constructor(e) {
    ((this._dynamicOverlays = e), (this._domNode = null), (this._renderedContent = null));
  }
  getDomNode() {
    return this._domNode ? this._domNode.domNode : null;
  }
  setDomNode(e) {
    this._domNode = Bq(e);
  }
  onContentChanged() {}
  onTokensChanged() {}
  renderLine(e, t, n, i, r) {
    let o = "";
    for (let s = 0, a = this._dynamicOverlays.length; s < a; s++) {
      o += this._dynamicOverlays[s].render(i.startLineNumber, e);
    }
    return (
      this._renderedContent !== o &&
      ((this._renderedContent = o),
      r.appendString('<div style="top:'),
      r.appendString(String(t)),
      r.appendString("px;height:"),
      r.appendString(String(n)),
      r.appendString("px;line-height:"),
      r.appendString(String(n)),
      r.appendString('px;">'),
      r.appendString(o),
      r.appendString("</div>"),
      !0)
    );
  }
  layoutLine(e, t, n) {
    this._domNode &&
      (this._domNode.setTop(t), this._domNode.setHeight(n), this._domNode.setLineHeight(n));
  }
}
class t0 extends JJ {
  constructor(e) {
    super(e);
    const t = this._context.configuration.options.get(165);
    ((this._contentWidth = t.contentWidth), this.domNode.setHeight(0));
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options.get(165);
    return ((this._contentWidth = t.contentWidth), super.onConfigurationChanged(e) || !0);
  }
  onScrollChanged(e) {
    return super.onScrollChanged(e) || e.scrollWidthChanged;
  }
  _viewOverlaysRender(e) {
    (super._viewOverlaysRender(e),
      this.domNode.setWidth(Math.max(e.scrollWidth, this._contentWidth)));
  }
}
class n0 extends JJ {
  constructor(e) {
    super(e);
    const t = this._context.configuration.options,
      n = t.get(165);
    ((this._contentLeft = n.contentLeft),
      this.domNode.setClassName("margin-view-overlays"),
      this.domNode.setWidth(1),
      Vq(this.domNode, t.get(59)));
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    Vq(this.domNode, t.get(59));
    const n = t.get(165);
    return ((this._contentLeft = n.contentLeft), super.onConfigurationChanged(e) || !0);
  }
  onScrollChanged(e) {
    return super.onScrollChanged(e) || e.scrollHeightChanged;
  }
  _viewOverlaysRender(e) {
    super._viewOverlaysRender(e);
    const t = Math.min(e.scrollHeight, 1e6);
    (this.domNode.setHeight(t), this.domNode.setWidth(this._contentLeft));
  }
}
class i0 {
  constructor(e) {
    ((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 = e));
  }
  emitKeyDown(e) {
    this.onKeyDown?.(e);
  }
  emitKeyUp(e) {
    this.onKeyUp?.(e);
  }
  emitContextMenu(e) {
    this.onContextMenu?.(this._convertViewToModelMouseEvent(e));
  }
  emitMouseMove(e) {
    this.onMouseMove?.(this._convertViewToModelMouseEvent(e));
  }
  emitMouseLeave(e) {
    this.onMouseLeave?.(this._convertViewToModelMouseEvent(e));
  }
  emitMouseDown(e) {
    this.onMouseDown?.(this._convertViewToModelMouseEvent(e));
  }
  emitMouseUp(e) {
    this.onMouseUp?.(this._convertViewToModelMouseEvent(e));
  }
  emitMouseDrag(e) {
    this.onMouseDrag?.(this._convertViewToModelMouseEvent(e));
  }
  emitMouseDrop(e) {
    this.onMouseDrop?.(this._convertViewToModelMouseEvent(e));
  }
  emitMouseDropCanceled() {
    this.onMouseDropCanceled?.();
  }
  emitMouseWheel(e) {
    this.onMouseWheel?.(e);
  }
  _convertViewToModelMouseEvent(e) {
    return e.target ? { event: e.event, target: this._convertViewToModelMouseTarget(e.target) } : e;
  }
  _convertViewToModelMouseTarget(e) {
    return i0.convertViewToModelMouseTarget(e, this._coordinatesConverter);
  }
  static convertViewToModelMouseTarget(e, t) {
    const n = { ...e };
    return (
      n.position && (n.position = t.convertViewPositionToModelPosition(n.position)),
      n.range && (n.range = t.convertViewRangeToModelRange(n.range)),
      (5 !== n.type && 8 !== n.type) ||
        (n.detail = this.convertViewToModelViewZoneData(n.detail, t)),
      n
    );
  }
  static convertViewToModelViewZoneData(e, t) {
    return {
      viewZoneId: e.viewZoneId,
      positionBefore: e.positionBefore
        ? t.convertViewPositionToModelPosition(e.positionBefore)
        : e.positionBefore,
      positionAfter: e.positionAfter
        ? t.convertViewPositionToModelPosition(e.positionAfter)
        : e.positionAfter,
      position: t.convertViewPositionToModelPosition(e.position),
      afterLineNumber: t.convertViewPositionToModelPosition(new xV(e.afterLineNumber, 1))
        .lineNumber,
    };
  }
}
class r0 extends iQ {
  constructor(e) {
    (super(e),
      (this.blocks = []),
      (this.contentWidth = -1),
      (this.contentLeft = 0),
      (this.domNode = Bq(document.createElement("div"))),
      this.domNode.setAttribute("role", "presentation"),
      this.domNode.setAttribute("aria-hidden", "true"),
      this.domNode.setClassName("blockDecorations-container"),
      this.update());
  }
  update() {
    let e = !1;
    const t = this._context.configuration.options.get(165),
      n = t.contentWidth - t.verticalScrollbarWidth;
    this.contentWidth !== n && ((this.contentWidth = n), (e = !0));
    const i = t.contentLeft;
    return (this.contentLeft !== i && ((this.contentLeft = i), (e = !0)), e);
  }
  dispose() {
    super.dispose();
  }
  onConfigurationChanged(e) {
    return this.update();
  }
  onScrollChanged(e) {
    return e.scrollTopChanged || e.scrollLeftChanged;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  prepareRender(e) {}
  render(e) {
    let t = 0;
    const n = e.getDecorationsInViewport();
    for (const i of n) {
      if (!i.options.blockClassName) continue;
      let n,
        r,
        o = this.blocks[t];
      (o || ((o = this.blocks[t] = Bq(document.createElement("div"))), this.domNode.appendChild(o)),
        i.options.blockIsAfterEnd
          ? ((n = e.getVerticalOffsetAfterLineNumber(i.range.endLineNumber, !1)),
            (r = e.getVerticalOffsetAfterLineNumber(i.range.endLineNumber, !0)))
          : ((n = e.getVerticalOffsetForLineNumber(i.range.startLineNumber, !0)),
            (r =
              i.range.isEmpty() && !i.options.blockDoesNotCollapse
                ? e.getVerticalOffsetForLineNumber(i.range.startLineNumber, !1)
                : e.getVerticalOffsetAfterLineNumber(i.range.endLineNumber, !0))));
      const [s, a, l, c] = i.options.blockPadding ?? [0, 0, 0, 0];
      (o.setClassName("blockDecorations-block " + i.options.blockClassName),
        o.setLeft(this.contentLeft - c),
        o.setWidth(this.contentWidth + c + a),
        o.setTop(n - e.scrollTop - s),
        o.setHeight(r - n + s + l),
        t++);
    }
    for (let i = t; i < this.blocks.length; i++) this.blocks[i].domNode.remove();
    this.blocks.length = t;
  }
}
class o0 extends iQ {
  constructor(e, t) {
    (super(e),
      (this._viewDomNode = t),
      (this._widgets = {}),
      (this.domNode = Bq(document.createElement("div"))),
      rQ.write(this.domNode, 1),
      this.domNode.setClassName("contentWidgets"),
      this.domNode.setPosition("absolute"),
      this.domNode.setTop(0),
      (this.overflowingContentWidgetsDomNode = Bq(document.createElement("div"))),
      rQ.write(this.overflowingContentWidgetsDomNode, 2),
      this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets"));
  }
  dispose() {
    (super.dispose(), (this._widgets = {}));
  }
  onConfigurationChanged(e) {
    const t = Object.keys(this._widgets);
    for (const n of t) this._widgets[n].onConfigurationChanged(e);
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLineMappingChanged(e) {
    return (this._updateAnchorsViewPositions(), !0);
  }
  onLinesChanged(e) {
    return (this._updateAnchorsViewPositions(), !0);
  }
  onLinesDeleted(e) {
    return (this._updateAnchorsViewPositions(), !0);
  }
  onLinesInserted(e) {
    return (this._updateAnchorsViewPositions(), !0);
  }
  onScrollChanged(e) {
    return !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  _updateAnchorsViewPositions() {
    const e = Object.keys(this._widgets);
    for (const t of e) this._widgets[t].updateAnchorViewPosition();
  }
  addWidget(e) {
    const t = new s0(this._context, this._viewDomNode, e);
    ((this._widgets[t.id] = t),
      t.allowEditorOverflow
        ? this.overflowingContentWidgetsDomNode.appendChild(t.domNode)
        : this.domNode.appendChild(t.domNode),
      this.setShouldRender());
  }
  setWidgetPosition(e, t, n, i, r) {
    (this._widgets[e.getId()].setPosition(t, n, i, r), this.setShouldRender());
  }
  removeWidget(e) {
    const t = e.getId();
    if (this._widgets.hasOwnProperty(t)) {
      const e = this._widgets[t];
      delete this._widgets[t];
      const n = e.domNode.domNode;
      (n.remove(), n.removeAttribute("monaco-visible-content-widget"), this.setShouldRender());
    }
  }
  shouldSuppressMouseDownOnWidget(e) {
    return !!this._widgets.hasOwnProperty(e) && this._widgets[e].suppressMouseDown;
  }
  onBeforeRender(e) {
    const t = Object.keys(this._widgets);
    for (const n of t) this._widgets[n].onBeforeRender(e);
  }
  prepareRender(e) {
    const t = Object.keys(this._widgets);
    for (const n of t) this._widgets[n].prepareRender(e);
  }
  render(e) {
    const t = Object.keys(this._widgets);
    for (const n of t) this._widgets[n].render(e);
  }
}
class s0 {
  constructor(e, t, n) {
    ((this._primaryAnchor = new a0(null, null)),
      (this._secondaryAnchor = new a0(null, null)),
      (this._context = e),
      (this._viewDomNode = t),
      (this._actual = n));
    const i = this._context.configuration.options,
      r = i.get(165),
      o = i.get(4);
    ((this.domNode = Bq(this._actual.getDomNode())),
      (this.id = this._actual.getId()),
      (this.allowEditorOverflow = !!this._actual.allowEditorOverflow && o),
      (this.suppressMouseDown = this._actual.suppressMouseDown || !1),
      (this._fixedOverflowWidgets = i.get(51)),
      (this._contentWidth = r.contentWidth),
      (this._contentLeft = r.contentLeft),
      (this._affinity = null),
      (this._preference = []),
      (this._cachedDomNodeOffsetWidth = -1),
      (this._cachedDomNodeOffsetHeight = -1),
      (this._maxWidth = this._getMaxWidth()),
      (this._isVisible = !1),
      (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(e) {
    const t = this._context.configuration.options;
    if (e.hasChanged(165)) {
      const e = t.get(165);
      ((this._contentLeft = e.contentLeft),
        (this._contentWidth = e.contentWidth),
        (this._maxWidth = this._getMaxWidth()));
    }
  }
  updateAnchorViewPosition() {
    this._setPosition(
      this._affinity,
      this._primaryAnchor.modelPosition,
      this._secondaryAnchor.modelPosition,
    );
  }
  _setPosition(e, t, n) {
    function i(e, t, n) {
      if (!e) return new a0(null, null);
      const i = t.model.validatePosition(e);
      if (t.coordinatesConverter.modelPositionIsVisible(i)) {
        const r = t.coordinatesConverter.convertModelPositionToViewPosition(i, n ?? void 0);
        return new a0(e, r);
      }
      return new a0(e, null);
    }
    ((this._affinity = e),
      (this._primaryAnchor = i(t, this._context.viewModel, this._affinity)),
      (this._secondaryAnchor = i(n, this._context.viewModel, this._affinity)));
  }
  _getMaxWidth() {
    const e = this.domNode.domNode.ownerDocument,
      t = e.defaultView;
    return this.allowEditorOverflow
      ? t?.innerWidth || e.documentElement.offsetWidth || e.body.offsetWidth
      : this._contentWidth;
  }
  setPosition(e, t, n, i) {
    (this._setPosition(i, e, t),
      (this._preference = n),
      this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0
        ? this.domNode.setDisplay("block")
        : this.domNode.setDisplay("none"),
      (this._cachedDomNodeOffsetWidth = -1),
      (this._cachedDomNodeOffsetHeight = -1));
  }
  _layoutBoxInViewport(e, t, n, i) {
    const r = e.top,
      o = r,
      s = e.top + e.height,
      a = r - n,
      l = o >= n,
      c = s,
      d = i.viewportHeight - s >= n;
    let u = e.left;
    return (
      u + t > i.scrollLeft + i.viewportWidth && (u = i.scrollLeft + i.viewportWidth - t),
      u < i.scrollLeft && (u = i.scrollLeft),
      { fitsAbove: l, aboveTop: a, fitsBelow: d, belowTop: c, left: u }
    );
  }
  _layoutHorizontalSegmentInPage(e, t, n, i) {
    const r = Math.max(15, t.left - i),
      o = Math.min(t.left + t.width + i, e.width - 15),
      s = this._viewDomNode.domNode.ownerDocument.defaultView;
    let a = t.left + n - (s?.scrollX ?? 0);
    if (a + i > o) {
      const e = a - (o - i);
      ((a -= e), (n -= e));
    }
    if (a < r) {
      const e = a - r;
      ((a -= e), (n -= e));
    }
    return [n, a];
  }
  _layoutBoxInPage(e, t, n, i) {
    const r = e.top - n,
      o = e.top + e.height,
      s = aB(this._viewDomNode.domNode),
      a = this._viewDomNode.domNode.ownerDocument,
      l = a.defaultView,
      c = s.top + r - (l?.scrollY ?? 0),
      d = s.top + o - (l?.scrollY ?? 0),
      u = iB(a.body),
      [h, g] = this._layoutHorizontalSegmentInPage(
        u,
        s,
        e.left - i.scrollLeft + this._contentLeft,
        t,
      ),
      p = c >= 22,
      f = d + n <= u.height - 22;
    return this._fixedOverflowWidgets
      ? { fitsAbove: p, aboveTop: Math.max(c, 22), fitsBelow: f, belowTop: d, left: g }
      : { fitsAbove: p, aboveTop: r, fitsBelow: f, belowTop: o, left: h };
  }
  _prepareRenderWidgetAtExactPositionOverflowing(e) {
    return new l0(e.top, e.left + this._contentLeft);
  }
  _getAnchorsCoordinates(e) {
    return {
      primary: t(this._primaryAnchor.viewPosition, this._affinity),
      secondary: t(
        this._secondaryAnchor.viewPosition?.lineNumber ===
          this._primaryAnchor.viewPosition?.lineNumber
          ? this._secondaryAnchor.viewPosition
          : null,
        this._affinity,
      ),
    };
    function t(t, n) {
      if (!t) return null;
      const i = e.visibleRangeForPosition(t);
      if (!i) return null;
      const r = 1 === t.column && 3 === n ? 0 : i.left,
        o = e.getVerticalOffsetForLineNumber(t.lineNumber) - e.scrollTop,
        s = e.getLineHeightForLineNumber(t.lineNumber);
      return new c0(o, r, s);
    }
  }
  _reduceAnchorCoordinates(e, t, n) {
    if (!t) return e;
    const i = this._context.configuration.options.get(59);
    let r = t.left;
    return (
      (r =
        r < e.left
          ? Math.max(r, e.left - n + i.typicalFullwidthCharacterWidth)
          : Math.min(r, e.left + n - i.typicalFullwidthCharacterWidth)),
      new c0(e.top, r, e.height)
    );
  }
  _prepareRenderWidget(e) {
    if (!this._preference || 0 === this._preference.length) return null;
    const { primary: t, secondary: n } = this._getAnchorsCoordinates(e);
    if (!t)
      return {
        kind: "offViewport",
        preserveFocus: this.domNode.domNode.contains(
          this.domNode.domNode.ownerDocument.activeElement,
        ),
      };
    if (-1 === this._cachedDomNodeOffsetWidth || -1 === this._cachedDomNodeOffsetHeight) {
      let e = null;
      if (
        ("function" == typeof this._actual.beforeRender &&
          (e = d0(this._actual.beforeRender, this._actual)),
        e)
      )
        ((this._cachedDomNodeOffsetWidth = e.width), (this._cachedDomNodeOffsetHeight = e.height));
      else {
        const e = this.domNode.domNode.getBoundingClientRect();
        ((this._cachedDomNodeOffsetWidth = Math.round(e.width)),
          (this._cachedDomNodeOffsetHeight = Math.round(e.height)));
      }
    }
    const i = this._reduceAnchorCoordinates(t, n, this._cachedDomNodeOffsetWidth);
    let r;
    r = this.allowEditorOverflow
      ? this._layoutBoxInPage(i, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, e)
      : this._layoutBoxInViewport(
          i,
          this._cachedDomNodeOffsetWidth,
          this._cachedDomNodeOffsetHeight,
          e,
        );
    for (let o = 1; o <= 2; o++)
      for (const e of this._preference)
        if (1 === e) {
          if (!r) return null;
          if (2 === o || r.fitsAbove)
            return { kind: "inViewport", coordinate: new l0(r.aboveTop, r.left), position: 1 };
        } else {
          if (2 !== e)
            return this.allowEditorOverflow
              ? {
                  kind: "inViewport",
                  coordinate: this._prepareRenderWidgetAtExactPositionOverflowing(
                    new l0(i.top, i.left),
                  ),
                  position: 0,
                }
              : { kind: "inViewport", coordinate: new l0(i.top, i.left), position: 0 };
          if (!r) return null;
          if (2 === o || r.fitsBelow)
            return { kind: "inViewport", coordinate: new l0(r.belowTop, r.left), position: 2 };
        }
    return null;
  }
  onBeforeRender(e) {
    this._primaryAnchor.viewPosition &&
      this._preference &&
      (this._primaryAnchor.viewPosition.lineNumber < e.startLineNumber ||
        this._primaryAnchor.viewPosition.lineNumber > e.endLineNumber ||
        this.domNode.setMaxWidth(this._maxWidth));
  }
  prepareRender(e) {
    this._renderData = this._prepareRenderWidget(e);
  }
  render(e) {
    if (!this._renderData || "offViewport" === this._renderData.kind)
      return (
        this._isVisible &&
          (this.domNode.removeAttribute("monaco-visible-content-widget"),
          (this._isVisible = !1),
          "offViewport" === this._renderData?.kind && this._renderData.preserveFocus
            ? this.domNode.setTop(-1e3)
            : this.domNode.setVisibility("hidden")),
        void (
          "function" == typeof this._actual.afterRender &&
          d0(this._actual.afterRender, this._actual, null, null)
        )
      );
    (this.allowEditorOverflow
      ? (this.domNode.setTop(this._renderData.coordinate.top),
        this.domNode.setLeft(this._renderData.coordinate.left))
      : (this.domNode.setTop(this._renderData.coordinate.top + e.scrollTop - e.bigNumbersDelta),
        this.domNode.setLeft(this._renderData.coordinate.left)),
      this._isVisible ||
        (this.domNode.setVisibility("inherit"),
        this.domNode.setAttribute("monaco-visible-content-widget", "true"),
        (this._isVisible = !0)),
      "function" == typeof this._actual.afterRender &&
        d0(
          this._actual.afterRender,
          this._actual,
          this._renderData.position,
          this._renderData.coordinate,
        ));
  }
}
class a0 {
  constructor(e, t) {
    ((this.modelPosition = e), (this.viewPosition = t));
  }
}
class l0 {
  constructor(e, t) {
    ((this.top = e), (this.left = t), (this._coordinateBrand = void 0));
  }
}
class c0 {
  constructor(e, t, n) {
    ((this.top = e), (this.left = t), (this.height = n), (this._anchorCoordinateBrand = void 0));
  }
}
function d0(e, t, ...n) {
  try {
    return e.call(t, ...n);
  } catch {
    return null;
  }
}
class u0 extends nQ {}
const h0 = bV("themeService");
function g0(e) {
  return { id: e };
}
function p0(e) {
  switch (e) {
    case LQ.DARK:
      return DQ.VS_DARK;
    case LQ.HIGH_CONTRAST_DARK:
      return DQ.HC_BLACK;
    case LQ.HIGH_CONTRAST_LIGHT:
      return DQ.HC_LIGHT;
    default:
      return DQ.VS;
  }
}
const f0 = "base.contributions.theming";
const m0 = new (class extends PO {
  constructor() {
    (super(),
      (this.themingParticipants = []),
      (this.themingParticipants = []),
      (this.onThemingParticipantAddedEmitter = this._register(new QO())));
  }
  onColorThemeChange(e) {
    return (
      this.themingParticipants.push(e),
      this.onThemingParticipantAddedEmitter.fire(e),
      MO(() => {
        const t = this.themingParticipants.indexOf(e);
        this.themingParticipants.splice(t, 1);
      })
    );
  }
  getThemingParticipants() {
    return this.themingParticipants;
  }
})();
function _0(e) {
  return m0.onColorThemeChange(e);
}
NW.add(f0, m0);
class v0 extends PO {
  constructor(e) {
    (super(),
      (this.themeService = e),
      (this.theme = e.getColorTheme()),
      this._register(this.themeService.onDidColorThemeChange((e) => this.onThemeChange(e))));
  }
  onThemeChange(e) {
    ((this.theme = e), this.updateStyles());
  }
  updateStyles() {}
}
const b0 = SG(
    "editor.lineHighlightBackground",
    null,
    SI(610, "Background color for the highlight of line at the cursor position."),
  ),
  y0 = SG(
    "editor.lineHighlightBorder",
    { dark: "#282828", light: "#eeeeee", hcDark: "#f38518", hcLight: FG },
    SI(611, "Background color for the border around the line at the cursor position."),
  );
(SG(
  "editor.rangeHighlightBackground",
  { dark: "#ffffff0b", light: "#fdff0033", hcDark: null, hcLight: null },
  SI(
    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.",
  ),
  !0,
),
  SG(
    "editor.rangeHighlightBorder",
    { dark: null, light: null, hcDark: BG, hcLight: BG },
    SI(613, "Background color of the border around highlighted ranges."),
  ),
  SG(
    "editor.symbolHighlightBackground",
    { dark: gZ, light: gZ, hcDark: null, hcLight: null },
    SI(
      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.",
    ),
    !0,
  ),
  SG(
    "editor.symbolHighlightBorder",
    { dark: null, light: null, hcDark: BG, hcLight: BG },
    SI(615, "Background color of the border around highlighted symbols."),
  ));
const x0 = SG(
    "editorCursor.foreground",
    { dark: "#AEAFAD", light: vG.black, hcDark: vG.white, hcLight: "#0F4A85" },
    SI(616, "Color of the editor cursor."),
  ),
  w0 = SG(
    "editorCursor.background",
    null,
    SI(
      617,
      "The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.",
    ),
  ),
  C0 = SG(
    "editorMultiCursor.primary.foreground",
    x0,
    SI(618, "Color of the primary editor cursor when multiple cursors are present."),
  ),
  S0 = SG(
    "editorMultiCursor.primary.background",
    w0,
    SI(
      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.",
    ),
  ),
  k0 = SG(
    "editorMultiCursor.secondary.foreground",
    x0,
    SI(620, "Color of secondary editor cursors when multiple cursors are present."),
  ),
  E0 = SG(
    "editorMultiCursor.secondary.background",
    w0,
    SI(
      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.",
    ),
  ),
  N0 = SG(
    "editorWhitespace.foreground",
    { dark: "#e3e4e229", light: "#33333333", hcDark: "#e3e4e229", hcLight: "#CCCCCC" },
    SI(622, "Color of whitespace characters in the editor."),
  ),
  L0 = SG(
    "editorLineNumber.foreground",
    { dark: "#858585", light: "#237893", hcDark: vG.white, hcLight: "#292929" },
    SI(623, "Color of editor line numbers."),
  ),
  D0 = SG(
    "editorIndentGuide.background",
    N0,
    SI(624, "Color of the editor indentation guides."),
    !1,
    SI(
      625,
      "'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.",
    ),
  ),
  T0 = SG(
    "editorIndentGuide.activeBackground",
    N0,
    SI(626, "Color of the active editor indentation guides."),
    !1,
    SI(
      627,
      "'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.",
    ),
  ),
  I0 = SG(
    "editorIndentGuide.background1",
    D0,
    SI(628, "Color of the editor indentation guides (1)."),
  ),
  R0 = SG(
    "editorIndentGuide.background2",
    "#00000000",
    SI(629, "Color of the editor indentation guides (2)."),
  ),
  O0 = SG(
    "editorIndentGuide.background3",
    "#00000000",
    SI(630, "Color of the editor indentation guides (3)."),
  ),
  M0 = SG(
    "editorIndentGuide.background4",
    "#00000000",
    SI(631, "Color of the editor indentation guides (4)."),
  ),
  A0 = SG(
    "editorIndentGuide.background5",
    "#00000000",
    SI(632, "Color of the editor indentation guides (5)."),
  ),
  P0 = SG(
    "editorIndentGuide.background6",
    "#00000000",
    SI(633, "Color of the editor indentation guides (6)."),
  ),
  j0 = SG(
    "editorIndentGuide.activeBackground1",
    T0,
    SI(634, "Color of the active editor indentation guides (1)."),
  ),
  F0 = SG(
    "editorIndentGuide.activeBackground2",
    "#00000000",
    SI(635, "Color of the active editor indentation guides (2)."),
  ),
  B0 = SG(
    "editorIndentGuide.activeBackground3",
    "#00000000",
    SI(636, "Color of the active editor indentation guides (3)."),
  ),
  V0 = SG(
    "editorIndentGuide.activeBackground4",
    "#00000000",
    SI(637, "Color of the active editor indentation guides (4)."),
  ),
  W0 = SG(
    "editorIndentGuide.activeBackground5",
    "#00000000",
    SI(638, "Color of the active editor indentation guides (5)."),
  ),
  H0 = SG(
    "editorIndentGuide.activeBackground6",
    "#00000000",
    SI(639, "Color of the active editor indentation guides (6)."),
  ),
  z0 = SG(
    "editorActiveLineNumber.foreground",
    { dark: "#c6c6c6", light: "#0B216F", hcDark: BG, hcLight: BG },
    SI(640, "Color of editor active line number"),
    !1,
    SI(641, "Id is deprecated. Use 'editorLineNumber.activeForeground' instead."),
  );
SG("editorLineNumber.activeForeground", z0, SI(642, "Color of editor active line number"));
const U0 = SG(
    "editorLineNumber.dimmedForeground",
    null,
    SI(643, "Color of the final editor line when editor.renderFinalNewline is set to dimmed."),
  ),
  $0 = SG(
    "editorRuler.foreground",
    { dark: "#5A5A5A", light: vG.lightgrey, hcDark: vG.white, hcLight: "#292929" },
    SI(644, "Color of the editor rulers."),
  );
(SG(
  "editorCodeLens.foreground",
  { dark: "#999999", light: "#919191", hcDark: "#999999", hcLight: "#292929" },
  SI(645, "Foreground color of editor CodeLens"),
),
  SG(
    "editorBracketMatch.background",
    { dark: "#0064001a", light: "#0064001a", hcDark: "#0064001a", hcLight: "#0000" },
    SI(646, "Background color behind matching brackets"),
  ),
  SG(
    "editorBracketMatch.border",
    { dark: "#888", light: "#B9B9B9", hcDark: FG, hcLight: FG },
    SI(647, "Color for matching brackets boxes"),
  ));
const q0 = SG(
    "editorOverviewRuler.border",
    { dark: "#7f7f7f4d", light: "#7f7f7f4d", hcDark: "#7f7f7f4d", hcLight: "#666666" },
    SI(648, "Color of the overview ruler border."),
  ),
  K0 = SG(
    "editorOverviewRuler.background",
    null,
    SI(649, "Background color of the editor overview ruler."),
  );
(SG(
  "editorGutter.background",
  GG,
  SI(
    650,
    "Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.",
  ),
),
  SG(
    "editorUnnecessaryCode.border",
    { dark: null, light: null, hcDark: vG.fromHex("#fff").transparent(0.8), hcLight: FG },
    SI(651, "Border color of unnecessary (unused) source code in the editor."),
  ));
const G0 = SG(
  "editorUnnecessaryCode.opacity",
  { dark: vG.fromHex("#000a"), light: vG.fromHex("#0007"), hcDark: null, hcLight: null },
  SI(
    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.",
  ),
);
SG(
  "editorGhostText.border",
  {
    dark: null,
    light: null,
    hcDark: vG.fromHex("#fff").transparent(0.8),
    hcLight: vG.fromHex("#292929").transparent(0.8),
  },
  SI(653, "Border color of ghost text in the editor."),
);
const Z0 = SG(
  "editorGhostText.foreground",
  { dark: vG.fromHex("#ffffff56"), light: vG.fromHex("#0007"), hcDark: null, hcLight: null },
  SI(654, "Foreground color of the ghost text in the editor."),
);
SG(
  "editorGhostText.background",
  null,
  SI(655, "Background color of the ghost text in the editor."),
);
const Y0 = SG(
    "editorOverviewRuler.rangeHighlightForeground",
    new vG(new fG(0, 122, 204, 0.6)),
    SI(
      656,
      "Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  X0 = SG(
    "editorOverviewRuler.errorForeground",
    {
      dark: new vG(new fG(255, 18, 18, 0.7)),
      light: new vG(new fG(255, 18, 18, 0.7)),
      hcDark: new vG(new fG(255, 50, 50, 1)),
      hcLight: "#B5200D",
    },
    SI(657, "Overview ruler marker color for errors."),
  ),
  Q0 = SG(
    "editorOverviewRuler.warningForeground",
    { dark: nZ, light: nZ, hcDark: iZ, hcLight: iZ },
    SI(658, "Overview ruler marker color for warnings."),
  ),
  J0 = SG(
    "editorOverviewRuler.infoForeground",
    { dark: rZ, light: rZ, hcDark: oZ, hcLight: oZ },
    SI(659, "Overview ruler marker color for infos."),
  ),
  e1 = SG(
    "editorBracketHighlight.foreground1",
    { dark: "#FFD700", light: "#0431FAFF", hcDark: "#FFD700", hcLight: "#0431FAFF" },
    SI(660, "Foreground color of brackets (1). Requires enabling bracket pair colorization."),
  ),
  t1 = SG(
    "editorBracketHighlight.foreground2",
    { dark: "#DA70D6", light: "#319331FF", hcDark: "#DA70D6", hcLight: "#319331FF" },
    SI(661, "Foreground color of brackets (2). Requires enabling bracket pair colorization."),
  ),
  n1 = SG(
    "editorBracketHighlight.foreground3",
    { dark: "#179FFF", light: "#7B3814FF", hcDark: "#87CEFA", hcLight: "#7B3814FF" },
    SI(662, "Foreground color of brackets (3). Requires enabling bracket pair colorization."),
  ),
  i1 = SG(
    "editorBracketHighlight.foreground4",
    "#00000000",
    SI(663, "Foreground color of brackets (4). Requires enabling bracket pair colorization."),
  ),
  r1 = SG(
    "editorBracketHighlight.foreground5",
    "#00000000",
    SI(664, "Foreground color of brackets (5). Requires enabling bracket pair colorization."),
  ),
  o1 = SG(
    "editorBracketHighlight.foreground6",
    "#00000000",
    SI(665, "Foreground color of brackets (6). Requires enabling bracket pair colorization."),
  ),
  s1 = SG(
    "editorBracketHighlight.unexpectedBracket.foreground",
    {
      dark: new vG(new fG(255, 18, 18, 0.8)),
      light: new vG(new fG(255, 18, 18, 0.8)),
      hcDark: new vG(new fG(255, 50, 50, 1)),
      hcLight: "#B5200D",
    },
    SI(666, "Foreground color of unexpected brackets."),
  ),
  a1 = SG(
    "editorBracketPairGuide.background1",
    "#00000000",
    SI(
      667,
      "Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.",
    ),
  ),
  l1 = SG(
    "editorBracketPairGuide.background2",
    "#00000000",
    SI(
      668,
      "Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.",
    ),
  ),
  c1 = SG(
    "editorBracketPairGuide.background3",
    "#00000000",
    SI(
      669,
      "Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.",
    ),
  ),
  d1 = SG(
    "editorBracketPairGuide.background4",
    "#00000000",
    SI(
      670,
      "Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.",
    ),
  ),
  u1 = SG(
    "editorBracketPairGuide.background5",
    "#00000000",
    SI(
      671,
      "Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.",
    ),
  ),
  h1 = SG(
    "editorBracketPairGuide.background6",
    "#00000000",
    SI(
      672,
      "Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.",
    ),
  ),
  g1 = SG(
    "editorBracketPairGuide.activeBackground1",
    "#00000000",
    SI(
      673,
      "Background color of active bracket pair guides (1). Requires enabling bracket pair guides.",
    ),
  ),
  p1 = SG(
    "editorBracketPairGuide.activeBackground2",
    "#00000000",
    SI(
      674,
      "Background color of active bracket pair guides (2). Requires enabling bracket pair guides.",
    ),
  ),
  f1 = SG(
    "editorBracketPairGuide.activeBackground3",
    "#00000000",
    SI(
      675,
      "Background color of active bracket pair guides (3). Requires enabling bracket pair guides.",
    ),
  ),
  m1 = SG(
    "editorBracketPairGuide.activeBackground4",
    "#00000000",
    SI(
      676,
      "Background color of active bracket pair guides (4). Requires enabling bracket pair guides.",
    ),
  ),
  _1 = SG(
    "editorBracketPairGuide.activeBackground5",
    "#00000000",
    SI(
      677,
      "Background color of active bracket pair guides (5). Requires enabling bracket pair guides.",
    ),
  ),
  v1 = SG(
    "editorBracketPairGuide.activeBackground6",
    "#00000000",
    SI(
      678,
      "Background color of active bracket pair guides (6). Requires enabling bracket pair guides.",
    ),
  );
(SG(
  "editorUnicodeHighlight.border",
  nZ,
  SI(679, "Border color used to highlight unicode characters."),
),
  SG(
    "editorUnicodeHighlight.background",
    tZ,
    SI(680, "Background color used to highlight unicode characters."),
  ),
  _0((e, t) => {
    const n = e.getColor(GG),
      i = e.getColor(b0),
      r = i && !i.isTransparent() ? i : n;
    r && t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`);
  }));
class b1 extends u0 {
  constructor(e) {
    (super(), (this._context = e));
    const t = this._context.configuration.options,
      n = t.get(165);
    ((this._renderLineHighlight = t.get(110)),
      (this._renderLineHighlightOnlyWhenFocus = t.get(111)),
      (this._wordWrap = n.isViewportWrapping),
      (this._contentLeft = n.contentLeft),
      (this._contentWidth = n.contentWidth),
      (this._selectionIsEmpty = !0),
      (this._focused = !1),
      (this._cursorLineNumbers = [1]),
      (this._selections = [new XH(1, 1, 1, 1)]),
      (this._renderData = null),
      this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), super.dispose());
  }
  _readFromSelections() {
    let e = !1;
    const t = new Set();
    for (const r of this._selections) t.add(r.positionLineNumber);
    const n = Array.from(t);
    (n.sort((e, t) => e - t),
      XP(this._cursorLineNumbers, n) || ((this._cursorLineNumbers = n), (e = !0)));
    const i = this._selections.every((e) => e.isEmpty());
    return (this._selectionIsEmpty !== i && ((this._selectionIsEmpty = i), (e = !0)), e);
  }
  onThemeChanged(e) {
    return this._readFromSelections();
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options,
      n = t.get(165);
    return (
      (this._renderLineHighlight = t.get(110)),
      (this._renderLineHighlightOnlyWhenFocus = t.get(111)),
      (this._wordWrap = n.isViewportWrapping),
      (this._contentLeft = n.contentLeft),
      (this._contentWidth = n.contentWidth),
      !0
    );
  }
  onCursorStateChanged(e) {
    return ((this._selections = e.selections), this._readFromSelections());
  }
  onFlushed(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollWidthChanged || e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onFocusChanged(e) {
    return !!this._renderLineHighlightOnlyWhenFocus && ((this._focused = e.isFocused), !0);
  }
  prepareRender(e) {
    if (!this._shouldRenderThis()) return void (this._renderData = null);
    const t = e.visibleRange.startLineNumber,
      n = e.visibleRange.endLineNumber,
      i = [];
    for (let o = t; o <= n; o++) {
      i[o - t] = "";
    }
    if (this._wordWrap) {
      const r = this._renderOne(e, !1);
      for (const e of this._cursorLineNumbers) {
        const o = this._context.viewModel.coordinatesConverter,
          s = o.convertViewPositionToModelPosition(new xV(e, 1)).lineNumber,
          a = o.convertModelPositionToViewPosition(new xV(s, 1)).lineNumber,
          l = o.convertModelPositionToViewPosition(
            new xV(s, this._context.viewModel.model.getLineMaxColumn(s)),
          ).lineNumber,
          c = Math.max(a, t),
          d = Math.min(l, n);
        for (let e = c; e <= d; e++) {
          i[e - t] = r;
        }
      }
    }
    const r = this._renderOne(e, !0);
    for (const o of this._cursorLineNumbers) {
      if (o < t || o > n) continue;
      i[o - t] = r;
    }
    this._renderData = i;
  }
  render(e, t) {
    if (!this._renderData) return "";
    const n = t - e;
    return n >= this._renderData.length ? "" : this._renderData[n];
  }
  _shouldRenderInMargin() {
    return (
      ("gutter" === this._renderLineHighlight || "all" === this._renderLineHighlight) &&
      (!this._renderLineHighlightOnlyWhenFocus || this._focused)
    );
  }
  _shouldRenderInContent() {
    return (
      ("line" === this._renderLineHighlight || "all" === this._renderLineHighlight) &&
      this._selectionIsEmpty &&
      (!this._renderLineHighlightOnlyWhenFocus || this._focused)
    );
  }
}
class y1 extends b1 {
  _renderOne(e, t) {
    return `<div class="${"current-line" + (this._shouldRenderInMargin() ? " current-line-both" : "") + (t ? " current-line-exact" : "")}" style="width:${Math.max(e.scrollWidth, this._contentWidth)}px;"></div>`;
  }
  _shouldRenderThis() {
    return this._shouldRenderInContent();
  }
  _shouldRenderOther() {
    return this._shouldRenderInMargin();
  }
}
class x1 extends b1 {
  _renderOne(e, t) {
    return `<div class="${"current-line" + (this._shouldRenderInMargin() ? " current-line-margin" : "") + (this._shouldRenderOther() ? " current-line-margin-both" : "") + (this._shouldRenderInMargin() && t ? " current-line-exact-margin" : "")}" style="width:${this._contentLeft}px"></div>`;
  }
  _shouldRenderThis() {
    return !0;
  }
  _shouldRenderOther() {
    return this._shouldRenderInContent();
  }
}
_0((e, t) => {
  const n = e.getColor(b0);
  if (
    (n &&
      (t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${n}; }`),
      t.addRule(
        `.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${n}; border: none; }`,
      )),
    !n || n.isTransparent() || e.defines(y0))
  ) {
    const n = e.getColor(y0);
    n &&
      (t.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n}; }`),
      t.addRule(
        `.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n}; }`,
      ),
      TQ(e.type) &&
        (t.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),
        t.addRule(
          ".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }",
        )));
  }
});
class w1 extends u0 {
  constructor(e) {
    (super(), (this._context = e));
    const t = this._context.configuration.options;
    ((this._typicalHalfwidthCharacterWidth = t.get(59).typicalHalfwidthCharacterWidth),
      (this._renderResult = null),
      this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), (this._renderResult = null), super.dispose());
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    return ((this._typicalHalfwidthCharacterWidth = t.get(59).typicalHalfwidthCharacterWidth), !0);
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged || e.scrollWidthChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  prepareRender(e) {
    const t = e.getDecorationsInViewport();
    let n = [],
      i = 0;
    for (let a = 0, l = t.length; a < l; a++) {
      const e = t[a];
      e.options.className && (n[i++] = e);
    }
    n = n.sort((e, t) => {
      if (e.options.zIndex < t.options.zIndex) return -1;
      if (e.options.zIndex > t.options.zIndex) return 1;
      const n = e.options.className,
        i = t.options.className;
      return n < i ? -1 : n > i ? 1 : YH.compareRangesUsingStarts(e.range, t.range);
    });
    const r = e.visibleRange.startLineNumber,
      o = e.visibleRange.endLineNumber,
      s = [];
    for (let a = r; a <= o; a++) {
      s[a - r] = "";
    }
    (this._renderWholeLineDecorations(e, n, s),
      this._renderNormalDecorations(e, n, s),
      (this._renderResult = s));
  }
  _renderWholeLineDecorations(e, t, n) {
    const i = e.visibleRange.startLineNumber,
      r = e.visibleRange.endLineNumber;
    for (let o = 0, s = t.length; o < s; o++) {
      const e = t[o];
      if (!e.options.isWholeLine) continue;
      const s = '<div class="cdr ' + e.options.className + '" style="left:0;width:100%;"></div>',
        a = Math.max(e.range.startLineNumber, i),
        l = Math.min(e.range.endLineNumber, r);
      for (let t = a; t <= l; t++) {
        n[t - i] += s;
      }
    }
  }
  _renderNormalDecorations(e, t, n) {
    const i = e.visibleRange.startLineNumber;
    let r = null,
      o = !1,
      s = null,
      a = !1;
    for (let l = 0, c = t.length; l < c; l++) {
      const c = t[l];
      if (c.options.isWholeLine) continue;
      const d = c.options.className,
        u = Boolean(c.options.showIfCollapsed);
      let h = c.range;
      (u &&
        1 === h.endColumn &&
        h.endLineNumber !== h.startLineNumber &&
        (h = new YH(
          h.startLineNumber,
          h.startColumn,
          h.endLineNumber - 1,
          this._context.viewModel.getLineMaxColumn(h.endLineNumber - 1),
        )),
        r === d && o === u && YH.areIntersectingOrTouching(s, h)
          ? (s = YH.plusRange(s, h))
          : (null !== r && this._renderNormalDecoration(e, s, r, a, o, i, n),
            (r = d),
            (o = u),
            (s = h),
            (a = c.options.shouldFillLineOnLineBreak ?? !1)));
    }
    null !== r && this._renderNormalDecoration(e, s, r, a, o, i, n);
  }
  _renderNormalDecoration(e, t, n, i, r, o, s) {
    const a = e.linesVisibleRangesForRange(t, "findMatch" === n);
    if (a)
      for (let l = 0, c = a.length; l < c; l++) {
        const e = a[l];
        if (e.outsideRenderedLine) continue;
        const t = e.lineNumber - o;
        if (r && 1 === e.ranges.length) {
          const t = e.ranges[0];
          if (t.width < this._typicalHalfwidthCharacterWidth) {
            const n = Math.round(t.left + t.width / 2),
              i = Math.max(0, Math.round(n - this._typicalHalfwidthCharacterWidth / 2));
            e.ranges[0] = new lQ(i, this._typicalHalfwidthCharacterWidth);
          }
        }
        for (let r = 0, o = e.ranges.length; r < o; r++) {
          const a = i && e.continuesOnNextLine && 1 === o,
            l = e.ranges[r],
            c =
              '<div class="cdr ' +
              n +
              '" style="left:' +
              String(l.left) +
              "px;width:" +
              (a ? "100%;" : String(l.width) + "px;") +
              '"></div>';
          s[t] += c;
        }
      }
  }
  render(e, t) {
    if (!this._renderResult) return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
}
class C1 extends iQ {
  constructor(e, t, n, i) {
    super(e);
    const r = this._context.configuration.options,
      o = r.get(117),
      s = r.get(83),
      a = r.get(49),
      l = r.get(120),
      c = r.get(158),
      d = {
        listenOnDomNode: n.domNode,
        className: "editor-scrollable " + p0(e.theme.type),
        useShadows: !1,
        lazyRender: !0,
        vertical: o.vertical,
        horizontal: o.horizontal,
        verticalHasArrows: o.verticalHasArrows,
        horizontalHasArrows: o.horizontalHasArrows,
        verticalScrollbarSize: o.verticalScrollbarSize,
        verticalSliderSize: o.verticalSliderSize,
        horizontalScrollbarSize: o.horizontalScrollbarSize,
        horizontalSliderSize: o.horizontalSliderSize,
        handleMouseWheel: o.handleMouseWheel,
        alwaysConsumeMouseWheel: o.alwaysConsumeMouseWheel,
        arrowSize: o.arrowSize,
        mouseWheelScrollSensitivity: s,
        fastScrollSensitivity: a,
        scrollPredominantAxis: l,
        scrollByPage: o.scrollByPage,
        inertialScroll: c,
      };
    ((this.scrollbar = this._register(
      new xJ(t.domNode, d, this._context.viewLayout.getScrollable()),
    )),
      rQ.write(this.scrollbar.getDomNode(), 6),
      (this.scrollbarDomNode = Bq(this.scrollbar.getDomNode())),
      this.scrollbarDomNode.setPosition("absolute"),
      this._setLayout());
    const u = (e, t, n) => {
      const i = {};
      {
        const t = e.scrollTop;
        t &&
          ((i.scrollTop = this._context.viewLayout.getCurrentScrollTop() + t), (e.scrollTop = 0));
      }
      if (n) {
        const t = e.scrollLeft;
        t &&
          ((i.scrollLeft = this._context.viewLayout.getCurrentScrollLeft() + t),
          (e.scrollLeft = 0));
      }
      this._context.viewModel.viewLayout.setScrollPosition(i, 1);
    };
    (this._register($F(n.domNode, "scroll", (e) => u(n.domNode, 0, !0))),
      this._register($F(t.domNode, "scroll", (e) => u(t.domNode, 0, !1))),
      this._register($F(i.domNode, "scroll", (e) => u(i.domNode, 0, !1))),
      this._register(
        $F(this.scrollbarDomNode.domNode, "scroll", (e) => u(this.scrollbarDomNode.domNode, 0, !1)),
      ));
  }
  dispose() {
    super.dispose();
  }
  _setLayout() {
    const e = this._context.configuration.options,
      t = e.get(165);
    this.scrollbarDomNode.setLeft(t.contentLeft);
    ("right" === e.get(81).side
      ? this.scrollbarDomNode.setWidth(t.contentWidth + t.minimap.minimapWidth)
      : this.scrollbarDomNode.setWidth(t.contentWidth),
      this.scrollbarDomNode.setHeight(t.height));
  }
  getOverviewRulerLayoutInfo() {
    return this.scrollbar.getOverviewRulerLayoutInfo();
  }
  getDomNode() {
    return this.scrollbarDomNode;
  }
  delegateVerticalScrollbarPointerDown(e) {
    this.scrollbar.delegateVerticalScrollbarPointerDown(e);
  }
  delegateScrollFromMouseWheelEvent(e) {
    this.scrollbar.delegateScrollFromMouseWheelEvent(e);
  }
  onConfigurationChanged(e) {
    if (e.hasChanged(117) || e.hasChanged(83) || e.hasChanged(49)) {
      const e = this._context.configuration.options,
        t = e.get(117),
        n = e.get(83),
        i = e.get(49),
        r = e.get(120),
        o = {
          vertical: t.vertical,
          horizontal: t.horizontal,
          verticalScrollbarSize: t.verticalScrollbarSize,
          horizontalScrollbarSize: t.horizontalScrollbarSize,
          scrollByPage: t.scrollByPage,
          handleMouseWheel: t.handleMouseWheel,
          mouseWheelScrollSensitivity: n,
          fastScrollSensitivity: i,
          scrollPredominantAxis: r,
        };
      this.scrollbar.updateOptions(o);
    }
    return (e.hasChanged(165) && this._setLayout(), !0);
  }
  onScrollChanged(e) {
    return !0;
  }
  onThemeChanged(e) {
    return (
      this.scrollbar.updateClassName("editor-scrollable " + p0(this._context.theme.type)),
      !0
    );
  }
  prepareRender(e) {}
  render(e) {
    this.scrollbar.renderNow();
  }
}
class S1 {
  constructor(e, t, n, i, r) {
    ((this.startLineNumber = e),
      (this.endLineNumber = t),
      (this.className = n),
      (this.tooltip = i),
      (this._decorationToRenderBrand = void 0),
      (this.zIndex = r ?? 0));
  }
}
class k1 {
  constructor(e, t, n) {
    ((this.className = e), (this.zIndex = t), (this.tooltip = n));
  }
}
class E1 {
  constructor() {
    this.decorations = [];
  }
  add(e) {
    this.decorations.push(e);
  }
  getDecorations() {
    return this.decorations;
  }
}
class N1 extends u0 {
  _render(e, t, n) {
    const i = [];
    for (let s = e; s <= t; s++) {
      i[s - e] = new E1();
    }
    if (0 === n.length) return i;
    n.sort((e, t) =>
      e.className === t.className
        ? e.startLineNumber === t.startLineNumber
          ? e.endLineNumber - t.endLineNumber
          : e.startLineNumber - t.startLineNumber
        : e.className < t.className
          ? -1
          : 1,
    );
    let r = null,
      o = 0;
    for (let s = 0, a = n.length; s < a; s++) {
      const a = n[s],
        l = a.className,
        c = a.zIndex;
      let d = Math.max(a.startLineNumber, e) - e;
      const u = Math.min(a.endLineNumber, t) - e;
      r === l ? ((d = Math.max(o + 1, d)), (o = Math.max(o, u))) : ((r = l), (o = u));
      for (let e = d; e <= o; e++) i[e].add(new k1(l, c, a.tooltip));
    }
    return i;
  }
}
class L1 extends iQ {
  constructor(e) {
    (super(e), (this._widgets = {}), (this._context = e));
    const t = this._context.configuration.options,
      n = t.get(165);
    ((this.domNode = Bq(document.createElement("div"))),
      this.domNode.setClassName("glyph-margin-widgets"),
      this.domNode.setPosition("absolute"),
      this.domNode.setTop(0),
      (this._lineHeight = t.get(75)),
      (this._glyphMargin = t.get(66)),
      (this._glyphMarginLeft = n.glyphMarginLeft),
      (this._glyphMarginWidth = n.glyphMarginWidth),
      (this._glyphMarginDecorationLaneCount = n.glyphMarginDecorationLaneCount),
      (this._managedDomNodes = []),
      (this._decorationGlyphsToRender = []));
  }
  dispose() {
    ((this._managedDomNodes = []),
      (this._decorationGlyphsToRender = []),
      (this._widgets = {}),
      super.dispose());
  }
  getWidgets() {
    return Object.values(this._widgets);
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options,
      n = t.get(165);
    return (
      (this._lineHeight = t.get(75)),
      (this._glyphMargin = t.get(66)),
      (this._glyphMarginLeft = n.glyphMarginLeft),
      (this._glyphMarginWidth = n.glyphMarginWidth),
      (this._glyphMarginDecorationLaneCount = n.glyphMarginDecorationLaneCount),
      !0
    );
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  addWidget(e) {
    const t = Bq(e.getDomNode());
    ((this._widgets[e.getId()] = {
      widget: e,
      preference: e.getPosition(),
      domNode: t,
      renderInfo: null,
    }),
      t.setPosition("absolute"),
      t.setDisplay("none"),
      t.setAttribute("widgetId", e.getId()),
      this.domNode.appendChild(t),
      this.setShouldRender());
  }
  setWidgetPosition(e, t) {
    const n = this._widgets[e.getId()];
    return (
      (n.preference.lane !== t.lane ||
        n.preference.zIndex !== t.zIndex ||
        !YH.equalsRange(n.preference.range, t.range)) &&
      ((n.preference = t), this.setShouldRender(), !0)
    );
  }
  removeWidget(e) {
    const t = e.getId();
    if (this._widgets[t]) {
      const e = this._widgets[t].domNode.domNode;
      (delete this._widgets[t], e.remove(), this.setShouldRender());
    }
  }
  _collectDecorationBasedGlyphRenderRequest(e, t) {
    const n = e.visibleRange.startLineNumber,
      i = e.visibleRange.endLineNumber,
      r = e.getDecorationsInViewport();
    for (const o of r) {
      const e = o.options.glyphMarginClassName;
      if (!e) continue;
      const r = Math.max(o.range.startLineNumber, n),
        s = Math.min(o.range.endLineNumber, i),
        a = o.options.glyphMargin?.position ?? $z.Center,
        l = o.options.zIndex ?? 0;
      for (let n = r; n <= s; n++) {
        const i = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(
            new xV(n, 0),
          ),
          r = this._context.viewModel.glyphLanes.getLanesAtLine(i.lineNumber).indexOf(a);
        t.push(new D1(n, r, l, e));
      }
    }
  }
  _collectWidgetBasedGlyphRenderRequest(e, t) {
    const n = e.visibleRange.startLineNumber,
      i = e.visibleRange.endLineNumber;
    for (const r of Object.values(this._widgets)) {
      const e = r.preference.range,
        { startLineNumber: o, endLineNumber: s } =
          this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(YH.lift(e));
      if (!o || !s || s < n || o > i) continue;
      const a = Math.max(o, n),
        l = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(
          new xV(a, 0),
        ),
        c = this._context.viewModel.glyphLanes
          .getLanesAtLine(l.lineNumber)
          .indexOf(r.preference.lane);
      t.push(new T1(a, c, r.preference.zIndex, r));
    }
  }
  _collectSortedGlyphRenderRequests(e) {
    const t = [];
    return (
      this._collectDecorationBasedGlyphRenderRequest(e, t),
      this._collectWidgetBasedGlyphRenderRequest(e, t),
      t.sort((e, t) =>
        e.lineNumber === t.lineNumber
          ? e.laneIndex === t.laneIndex
            ? e.zIndex === t.zIndex
              ? t.type === e.type
                ? 0 === e.type && 0 === t.type
                  ? e.className < t.className
                    ? -1
                    : 1
                  : 0
                : t.type - e.type
              : t.zIndex - e.zIndex
            : e.laneIndex - t.laneIndex
          : e.lineNumber - t.lineNumber,
      ),
      t
    );
  }
  prepareRender(e) {
    if (!this._glyphMargin) return void (this._decorationGlyphsToRender = []);
    for (const i of Object.values(this._widgets)) i.renderInfo = null;
    const t = new Cj(this._collectSortedGlyphRenderRequests(e)),
      n = [];
    for (; t.length > 0; ) {
      const e = t.peek();
      if (!e) break;
      const i = t.takeWhile((t) => t.lineNumber === e.lineNumber && t.laneIndex === e.laneIndex);
      if (!i || 0 === i.length) break;
      const r = i[0];
      if (0 === r.type) {
        const e = [];
        for (const t of i) {
          if (t.zIndex !== r.zIndex || t.type !== r.type) break;
          (0 !== e.length && e[e.length - 1] === t.className) || e.push(t.className);
        }
        n.push(r.accept(e.join(" ")));
      } else r.widget.renderInfo = { lineNumber: r.lineNumber, laneIndex: r.laneIndex };
    }
    this._decorationGlyphsToRender = n;
  }
  render(e) {
    if (!this._glyphMargin) {
      for (const e of Object.values(this._widgets)) e.domNode.setDisplay("none");
      for (; this._managedDomNodes.length > 0; ) {
        const e = this._managedDomNodes.pop();
        e?.domNode.remove();
      }
      return;
    }
    const t = Math.round(this._glyphMarginWidth / this._glyphMarginDecorationLaneCount);
    for (const n of Object.values(this._widgets))
      if (n.renderInfo) {
        const i =
            e.viewportData.relativeVerticalOffset[
              n.renderInfo.lineNumber - e.viewportData.startLineNumber
            ],
          r = this._glyphMarginLeft + n.renderInfo.laneIndex * this._lineHeight;
        (n.domNode.setDisplay("block"),
          n.domNode.setTop(i),
          n.domNode.setLeft(r),
          n.domNode.setWidth(t),
          n.domNode.setHeight(this._lineHeight));
      } else n.domNode.setDisplay("none");
    for (let n = 0; n < this._decorationGlyphsToRender.length; n++) {
      const i = this._decorationGlyphsToRender[n],
        r = i.lineNumber,
        o = e.viewportData.relativeVerticalOffset[r - e.viewportData.startLineNumber],
        s = this._glyphMarginLeft + i.laneIndex * this._lineHeight;
      let a;
      n < this._managedDomNodes.length
        ? (a = this._managedDomNodes[n])
        : ((a = Bq(document.createElement("div"))),
          this._managedDomNodes.push(a),
          this.domNode.appendChild(a));
      const l = this._context.viewLayout.getLineHeightForLineNumber(r);
      (a.setClassName("cgmr codicon " + i.combinedClassName),
        a.setPosition("absolute"),
        a.setTop(o),
        a.setLeft(s),
        a.setWidth(t),
        a.setHeight(l));
    }
    for (; this._managedDomNodes.length > this._decorationGlyphsToRender.length; ) {
      const e = this._managedDomNodes.pop();
      e?.domNode.remove();
    }
  }
}
class D1 {
  constructor(e, t, n, i) {
    ((this.lineNumber = e),
      (this.laneIndex = t),
      (this.zIndex = n),
      (this.className = i),
      (this.type = 0));
  }
  accept(e) {
    return new I1(this.lineNumber, this.laneIndex, e);
  }
}
class T1 {
  constructor(e, t, n, i) {
    ((this.lineNumber = e),
      (this.laneIndex = t),
      (this.zIndex = n),
      (this.widget = i),
      (this.type = 1));
  }
}
class I1 {
  constructor(e, t, n) {
    ((this.lineNumber = e), (this.laneIndex = t), (this.combinedClassName = n));
  }
}
function R1(e, t, n = e.length - 1) {
  const i = (function (e, t, n = e.length - 1) {
    for (let i = n; i >= 0; i--) {
      if (t(e[i], i)) return i;
    }
    return -1;
  })(e, t, n);
  if (-1 !== i) return e[i];
}
function O1(e, t) {
  const n = M1(e, t);
  return -1 === n ? void 0 : e[n];
}
function M1(e, t, n = 0, i = e.length) {
  let r = n,
    o = i;
  for (; r < o; ) {
    const n = Math.floor((r + o) / 2);
    t(e[n]) ? (r = n + 1) : (o = n);
  }
  return r - 1;
}
function A1(e, t, n = 0, i = e.length) {
  let r = n,
    o = i;
  for (; r < o; ) {
    const n = Math.floor((r + o) / 2);
    t(e[n]) ? (o = n) : (r = n + 1);
  }
  return r;
}
class P1 {
  static {
    this.assertInvariants = !1;
  }
  constructor(e) {
    ((this._array = e), (this._findLastMonotonousLastIdx = 0));
  }
  findLastMonotonous(e) {
    if (P1.assertInvariants) {
      if (this._prevFindLastPredicate)
        for (const t of this._array)
          if (this._prevFindLastPredicate(t) && !e(t))
            throw new Error(
              "MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.",
            );
      this._prevFindLastPredicate = e;
    }
    const t = M1(this._array, e, this._findLastMonotonousLastIdx);
    return ((this._findLastMonotonousLastIdx = t + 1), -1 === t ? void 0 : this._array[t]);
  }
}
function j1(e, t) {
  if (0 === e.length) return;
  let n = e[0];
  for (let i = 1; i < e.length; i++) {
    const r = e[i];
    t(r, n) > 0 && (n = r);
  }
  return n;
}
function F1(e, t) {
  if (0 === e.length) return;
  let n = e[0];
  for (let i = 1; i < e.length; i++) {
    const r = e[i];
    t(r, n) >= 0 && (n = r);
  }
  return n;
}
function B1(e, t) {
  return j1(e, (e, n) => -t(e, n));
}
function V1(e, t) {
  if (0 === e.length) return -1;
  let n = 0;
  for (let i = 1; i < e.length; i++) {
    t(e[i], e[n]) > 0 && (n = i);
  }
  return n;
}
class W1 extends PO {
  constructor() {
    (super(...arguments), (this._isDisposed = !1));
  }
  dispose() {
    (super.dispose(), (this._isDisposed = !0));
  }
  assertNotDisposed() {
    if (this._isDisposed) throw new Error("TextModelPart is disposed!");
  }
}
function H1(e, t) {
  let n = 0,
    i = 0;
  const r = e.length;
  for (; i < r; ) {
    const r = e.charCodeAt(i);
    if (32 === r) n++;
    else {
      if (9 !== r) break;
      n = n - (n % t) + t;
    }
    i++;
  }
  return i === r ? -1 : n;
}
var z1;
!(function (e) {
  ((e[(e.Disabled = 0)] = "Disabled"),
    (e[(e.EnabledForActive = 1)] = "EnabledForActive"),
    (e[(e.Enabled = 2)] = "Enabled"));
})(z1 || (z1 = {}));
class U1 {
  constructor(e, t, n, i, r, o) {
    if (
      ((this.visibleColumn = e),
      (this.column = t),
      (this.className = n),
      (this.horizontalLine = i),
      (this.forWrappedLinesAfterColumn = r),
      (this.forWrappedLinesBeforeOrAtColumn = o),
      (-1 !== e) == (-1 !== t))
    )
      throw new Error();
  }
}
class $1 {
  constructor(e, t) {
    ((this.top = e), (this.endColumn = t));
  }
}
class q1 extends W1 {
  constructor(e, t) {
    (super(), (this.textModel = e), (this.languageConfigurationService = t));
  }
  getLanguageConfiguration(e) {
    return this.languageConfigurationService.getLanguageConfiguration(e);
  }
  _computeIndentLevel(e) {
    return H1(this.textModel.getLineContent(e + 1), this.textModel.getOptions().tabSize);
  }
  getActiveIndentGuide(e, t, n) {
    this.assertNotDisposed();
    const i = this.textModel.getLineCount();
    if (e < 1 || e > i) throw new QI("Illegal value for lineNumber");
    const r = this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,
      o = Boolean(r && r.offSide);
    let s = -2,
      a = -1,
      l = -2,
      c = -1;
    const d = (e) => {
      if (-1 !== s && (-2 === s || s > e - 1)) {
        ((s = -1), (a = -1));
        for (let t = e - 2; t >= 0; t--) {
          const e = this._computeIndentLevel(t);
          if (e >= 0) {
            ((s = t), (a = e));
            break;
          }
        }
      }
      if (-2 === l) {
        ((l = -1), (c = -1));
        for (let t = e; t < i; t++) {
          const e = this._computeIndentLevel(t);
          if (e >= 0) {
            ((l = t), (c = e));
            break;
          }
        }
      }
    };
    let u = -2,
      h = -1,
      g = -2,
      p = -1;
    const f = (e) => {
      if (-2 === u) {
        ((u = -1), (h = -1));
        for (let t = e - 2; t >= 0; t--) {
          const e = this._computeIndentLevel(t);
          if (e >= 0) {
            ((u = t), (h = e));
            break;
          }
        }
      }
      if (-1 !== g && (-2 === g || g < e - 1)) {
        ((g = -1), (p = -1));
        for (let t = e; t < i; t++) {
          const e = this._computeIndentLevel(t);
          if (e >= 0) {
            ((g = t), (p = e));
            break;
          }
        }
      }
    };
    let m = 0,
      _ = !0,
      v = 0,
      b = !0,
      y = 0,
      x = 0;
    for (let w = 0; _ || b; w++) {
      const r = e - w,
        s = e + w;
      (w > 1 && (r < 1 || r < t) && (_ = !1),
        w > 1 && (s > i || s > n) && (b = !1),
        w > 5e4 && ((_ = !1), (b = !1)));
      let g = -1;
      if (_ && r >= 1) {
        const e = this._computeIndentLevel(r - 1);
        e >= 0
          ? ((l = r - 1), (c = e), (g = Math.ceil(e / this.textModel.getOptions().indentSize)))
          : (d(r), (g = this._getIndentLevelForWhitespaceLine(o, a, c)));
      }
      let C = -1;
      if (b && s <= i) {
        const e = this._computeIndentLevel(s - 1);
        e >= 0
          ? ((u = s - 1), (h = e), (C = Math.ceil(e / this.textModel.getOptions().indentSize)))
          : (f(s), (C = this._getIndentLevelForWhitespaceLine(o, h, p)));
      }
      if (0 !== w) {
        if (1 === w) {
          if (s <= i && C >= 0 && x + 1 === C) {
            ((_ = !1), (m = s), (v = s), (y = C));
            continue;
          }
          if (r >= 1 && g >= 0 && g - 1 === x) {
            ((b = !1), (m = r), (v = r), (y = g));
            continue;
          }
          if (((m = e), (v = e), (y = x), 0 === y))
            return { startLineNumber: m, endLineNumber: v, indent: y };
        }
        (_ && (g >= y ? (m = r) : (_ = !1)), b && (C >= y ? (v = s) : (b = !1)));
      } else x = g;
    }
    return { startLineNumber: m, endLineNumber: v, indent: y };
  }
  getLinesBracketGuides(e, t, n, i) {
    const r = [];
    for (let c = e; c <= t; c++) r.push([]);
    const o = this.textModel.bracketPairs
      .getBracketPairsInRangeWithMinIndentation(new YH(e, 1, t, this.textModel.getLineMaxColumn(t)))
      .toArray();
    let s;
    if (n && o.length > 0) {
      const i = (
        e <= n.lineNumber && n.lineNumber <= t
          ? o
          : this.textModel.bracketPairs.getBracketPairsInRange(YH.fromPositions(n)).toArray()
      ).filter((e) => YH.strictContainsPosition(e.range, n));
      s = R1(i, (e) => true)?.range;
    }
    const a =
        this.textModel.getOptions().bracketPairColorizationOptions
          .independentColorPoolPerBracketType,
      l = new K1();
    for (const c of o) {
      if (!c.closingBracketRange) continue;
      const n = s && c.range.equalsRange(s);
      if (!n && !i.includeInactive) continue;
      const o =
          l.getInlineClassName(c.nestingLevel, c.nestingLevelOfEqualBracketType, a) +
          (i.highlightActive && n ? " " + l.activeClassName : ""),
        d = c.openingBracketRange.getStartPosition(),
        u = c.closingBracketRange.getStartPosition(),
        h = i.horizontalGuides === z1.Enabled || (i.horizontalGuides === z1.EnabledForActive && n);
      if (c.range.startLineNumber === c.range.endLineNumber) {
        h &&
          r[c.range.startLineNumber - e].push(
            new U1(
              -1,
              c.openingBracketRange.getEndPosition().column,
              o,
              new $1(!1, u.column),
              -1,
              -1,
            ),
          );
        continue;
      }
      const g = this.getVisibleColumnFromPosition(u),
        p = this.getVisibleColumnFromPosition(c.openingBracketRange.getStartPosition()),
        f = Math.min(p, g, c.minVisibleColumnIndentation + 1);
      let m = !1;
      YM(this.textModel.getLineContent(c.closingBracketRange.startLineNumber)) <
        c.closingBracketRange.startColumn - 1 && (m = !0);
      const _ = Math.max(d.lineNumber, e),
        v = Math.min(u.lineNumber, t),
        b = m ? 1 : 0;
      for (let t = _; t < v + b; t++)
        r[t - e].push(
          new U1(
            f,
            -1,
            o,
            null,
            t === d.lineNumber ? d.column : -1,
            t === u.lineNumber ? u.column : -1,
          ),
        );
      h &&
        (d.lineNumber >= e &&
          p > f &&
          r[d.lineNumber - e].push(new U1(f, -1, o, new $1(!1, d.column), -1, -1)),
        u.lineNumber <= t &&
          g > f &&
          r[u.lineNumber - e].push(new U1(f, -1, o, new $1(!m, u.column), -1, -1)));
    }
    for (const c of r) c.sort((e, t) => e.visibleColumn - t.visibleColumn);
    return r;
  }
  getVisibleColumnFromPosition(e) {
    return (
      tz.visibleColumnFromColumn(
        this.textModel.getLineContent(e.lineNumber),
        e.column,
        this.textModel.getOptions().tabSize,
      ) + 1
    );
  }
  getLinesIndentGuides(e, t) {
    this.assertNotDisposed();
    const n = this.textModel.getLineCount();
    if (e < 1 || e > n) throw new Error("Illegal value for startLineNumber");
    if (t < 1 || t > n) throw new Error("Illegal value for endLineNumber");
    const i = this.textModel.getOptions(),
      r = this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,
      o = Boolean(r && r.offSide),
      s = new Array(t - e + 1);
    let a = -2,
      l = -1,
      c = -2,
      d = -1;
    for (let u = e; u <= t; u++) {
      const t = u - e,
        r = this._computeIndentLevel(u - 1);
      if (r >= 0) ((a = u - 1), (l = r), (s[t] = Math.ceil(r / i.indentSize)));
      else {
        if (-2 === a) {
          ((a = -1), (l = -1));
          for (let e = u - 2; e >= 0; e--) {
            const t = this._computeIndentLevel(e);
            if (t >= 0) {
              ((a = e), (l = t));
              break;
            }
          }
        }
        if (-1 !== c && (-2 === c || c < u - 1)) {
          ((c = -1), (d = -1));
          for (let e = u; e < n; e++) {
            const t = this._computeIndentLevel(e);
            if (t >= 0) {
              ((c = e), (d = t));
              break;
            }
          }
        }
        s[t] = this._getIndentLevelForWhitespaceLine(o, l, d);
      }
    }
    return s;
  }
  _getIndentLevelForWhitespaceLine(e, t, n) {
    const i = this.textModel.getOptions();
    return -1 === t || -1 === n
      ? 0
      : t < n
        ? 1 + Math.floor(t / i.indentSize)
        : t === n || e
          ? Math.ceil(n / i.indentSize)
          : 1 + Math.floor(n / i.indentSize);
  }
}
class K1 {
  constructor() {
    this.activeClassName = "indent-active";
  }
  getInlineClassName(e, t, n) {
    return this.getInlineClassNameOfLevel(n ? t : e);
  }
  getInlineClassNameOfLevel(e) {
    return "bracket-indent-guide lvl-" + (e % 30);
  }
}
class G1 extends u0 {
  constructor(e) {
    (super(), (this._context = e), (this._primaryPosition = null));
    const t = this._context.configuration.options,
      n = t.get(166),
      i = t.get(59);
    ((this._spaceWidth = i.spaceWidth),
      (this._maxIndentLeft =
        -1 === n.wrappingColumn ? -1 : n.wrappingColumn * i.typicalHalfwidthCharacterWidth),
      (this._bracketPairGuideOptions = t.get(22)),
      (this._renderResult = null),
      this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), (this._renderResult = null), super.dispose());
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options,
      n = t.get(166),
      i = t.get(59);
    return (
      (this._spaceWidth = i.spaceWidth),
      (this._maxIndentLeft =
        -1 === n.wrappingColumn ? -1 : n.wrappingColumn * i.typicalHalfwidthCharacterWidth),
      (this._bracketPairGuideOptions = t.get(22)),
      !0
    );
  }
  onCursorStateChanged(e) {
    const t = e.selections[0].getPosition();
    return !this._primaryPosition?.equals(t) && ((this._primaryPosition = t), !0);
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onLanguageConfigurationChanged(e) {
    return !0;
  }
  prepareRender(e) {
    if (
      !this._bracketPairGuideOptions.indentation &&
      !1 === this._bracketPairGuideOptions.bracketPairs
    )
      return void (this._renderResult = null);
    const t = e.visibleRange.startLineNumber,
      n = e.visibleRange.endLineNumber,
      i = e.scrollWidth,
      r = this._primaryPosition,
      o = this.getGuidesByLine(t, Math.min(n + 1, this._context.viewModel.getLineCount()), r),
      s = [];
    for (let a = t; a <= n; a++) {
      const n = a - t,
        r = o[n];
      let l = "";
      const c = e.visibleRangeForPosition(new xV(a, 1))?.left ?? 0;
      for (const t of r) {
        const n =
          -1 === t.column
            ? c + (t.visibleColumn - 1) * this._spaceWidth
            : e.visibleRangeForPosition(new xV(a, t.column)).left;
        if (n > i || (this._maxIndentLeft > 0 && n > this._maxIndentLeft)) break;
        const r = t.horizontalLine
            ? t.horizontalLine.top
              ? "horizontal-top"
              : "horizontal-bottom"
            : "vertical",
          o = t.horizontalLine
            ? (e.visibleRangeForPosition(new xV(a, t.horizontalLine.endColumn))?.left ??
                n + this._spaceWidth) - n
            : this._spaceWidth;
        l += `<div class="core-guide ${t.className} ${r}" style="left:${n}px;width:${o}px"></div>`;
      }
      s[n] = l;
    }
    this._renderResult = s;
  }
  getGuidesByLine(e, t, n) {
    const i =
        !1 !== this._bracketPairGuideOptions.bracketPairs
          ? this._context.viewModel.getBracketGuidesInRangeByLine(e, t, n, {
              highlightActive: this._bracketPairGuideOptions.highlightActiveBracketPair,
              horizontalGuides:
                !0 === this._bracketPairGuideOptions.bracketPairsHorizontal
                  ? z1.Enabled
                  : "active" === this._bracketPairGuideOptions.bracketPairsHorizontal
                    ? z1.EnabledForActive
                    : z1.Disabled,
              includeInactive: !0 === this._bracketPairGuideOptions.bracketPairs,
            })
          : null,
      r = this._bracketPairGuideOptions.indentation
        ? this._context.viewModel.getLinesIndentGuides(e, t)
        : null;
    let o = 0,
      s = 0,
      a = 0;
    if (!1 !== this._bracketPairGuideOptions.highlightActiveIndentation && n) {
      const i = this._context.viewModel.getActiveIndentGuide(n.lineNumber, e, t);
      ((o = i.startLineNumber), (s = i.endLineNumber), (a = i.indent));
    }
    const { indentSize: l } = this._context.viewModel.model.getOptions(),
      c = [];
    for (let d = e; d <= t; d++) {
      const t = new Array();
      c.push(t);
      const n = i ? i[d - e] : [],
        u = new Cj(n),
        h = r ? r[d - e] : 0;
      for (let e = 1; e <= h; e++) {
        const i = (e - 1) * l + 1,
          r =
            ("always" === this._bracketPairGuideOptions.highlightActiveIndentation ||
              0 === n.length) &&
            o <= d &&
            d <= s &&
            e === a;
        t.push(...(u.takeWhile((e) => e.visibleColumn < i) || []));
        const c = u.peek();
        (c && c.visibleColumn === i && !c.horizontalLine) ||
          t.push(
            new U1(
              i,
              -1,
              "core-guide-indent lvl-" + ((e - 1) % 30) + (r ? " indent-active" : ""),
              null,
              -1,
              -1,
            ),
          );
      }
      t.push(...(u.takeWhile((e) => !0) || []));
    }
    return c;
  }
  render(e, t) {
    if (!this._renderResult) return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
}
function Z1(e) {
  if (!e || !e.isTransparent()) return e;
}
_0((e, t) => {
  const n = [
      { bracketColor: e1, guideColor: a1, guideColorActive: g1 },
      { bracketColor: t1, guideColor: l1, guideColorActive: p1 },
      { bracketColor: n1, guideColor: c1, guideColorActive: f1 },
      { bracketColor: i1, guideColor: d1, guideColorActive: m1 },
      { bracketColor: r1, guideColor: u1, guideColorActive: _1 },
      { bracketColor: o1, guideColor: h1, guideColorActive: v1 },
    ],
    i = new K1(),
    r = [
      { indentColor: I0, indentColorActive: j0 },
      { indentColor: R0, indentColorActive: F0 },
      { indentColor: O0, indentColorActive: B0 },
      { indentColor: M0, indentColorActive: V0 },
      { indentColor: A0, indentColorActive: W0 },
      { indentColor: P0, indentColorActive: H0 },
    ],
    o = n
      .map((t) => {
        const n = e.getColor(t.bracketColor),
          i = e.getColor(t.guideColor),
          r = e.getColor(t.guideColorActive),
          o = Z1(Z1(i) ?? n?.transparent(0.3)),
          s = Z1(Z1(r) ?? n);
        if (o && s) return { guideColor: o, guideColorActive: s };
      })
      .filter(hR),
    s = r
      .map((t) => {
        const n = e.getColor(t.indentColor),
          i = e.getColor(t.indentColorActive),
          r = Z1(n),
          o = Z1(i);
        if (r && o) return { indentColor: r, indentColorActive: o };
      })
      .filter(hR);
  if (o.length > 0) {
    for (let e = 0; e < 30; e++) {
      const n = o[e % o.length];
      t.addRule(
        `.monaco-editor .${i.getInlineClassNameOfLevel(e).replace(/ /g, ".")} { --guide-color: ${n.guideColor}; --guide-color-active: ${n.guideColorActive}; }`,
      );
    }
    (t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),
      t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),
      t.addRule(
        ".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }",
      ),
      t.addRule(
        `.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`,
      ),
      t.addRule(
        `.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`,
      ),
      t.addRule(
        `.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`,
      ));
  }
  if (s.length > 0) {
    for (let e = 0; e < 30; e++) {
      const n = s[e % s.length];
      t.addRule(
        `.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${n.indentColor}; --indent-color-active: ${n.indentColorActive}; }`,
      );
    }
    (t.addRule(
      ".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }",
    ),
      t.addRule(
        ".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }",
      ));
  }
});
class Y1 extends u0 {
  static {
    this.CLASS_NAME = "line-numbers";
  }
  constructor(e) {
    (super(),
      (this._context = e),
      this._readConfig(),
      (this._lastCursorModelPosition = new xV(1, 1)),
      (this._renderResult = null),
      (this._activeModelLineNumber = 1),
      this._context.addEventHandler(this));
  }
  _readConfig() {
    const e = this._context.configuration.options;
    this._lineHeight = e.get(75);
    const t = e.get(76);
    ((this._renderLineNumbers = t.renderType),
      (this._renderCustomLineNumbers = t.renderFn),
      (this._renderFinalNewline = e.get(109)));
    const n = e.get(165);
    ((this._lineNumbersLeft = n.lineNumbersLeft), (this._lineNumbersWidth = n.lineNumbersWidth));
  }
  dispose() {
    (this._context.removeEventHandler(this), (this._renderResult = null), super.dispose());
  }
  onConfigurationChanged(e) {
    return (this._readConfig(), !0);
  }
  onCursorStateChanged(e) {
    const t = e.selections[0].getPosition();
    this._lastCursorModelPosition =
      this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);
    let n = !1;
    return (
      this._activeModelLineNumber !== this._lastCursorModelPosition.lineNumber &&
        ((this._activeModelLineNumber = this._lastCursorModelPosition.lineNumber), (n = !0)),
      (2 !== this._renderLineNumbers && 3 !== this._renderLineNumbers) || (n = !0),
      n
    );
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return e.affectsLineNumber;
  }
  _getLineRenderLineNumber(e) {
    const t = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(
      new xV(e, 1),
    );
    if (1 !== t.column) return "";
    const n = t.lineNumber;
    if (this._renderCustomLineNumbers) return this._renderCustomLineNumbers(n);
    if (2 === this._renderLineNumbers) {
      const e = Math.abs(this._lastCursorModelPosition.lineNumber - n);
      return 0 === e ? '<span class="relative-current-line-number">' + n + "</span>" : String(e);
    }
    if (3 === this._renderLineNumbers) {
      if (this._lastCursorModelPosition.lineNumber === n) return String(n);
      if (n % 10 == 0) return String(n);
      return n === this._context.viewModel.getLineCount() ? String(n) : "";
    }
    return String(n);
  }
  prepareRender(e) {
    if (0 === this._renderLineNumbers) return void (this._renderResult = null);
    const t = jR ? (this._lineHeight % 2 == 0 ? " lh-even" : " lh-odd") : "",
      n = e.visibleRange.startLineNumber,
      i = e.visibleRange.endLineNumber,
      r = this._context.viewModel
        .getDecorationsInViewport(e.visibleRange)
        .filter((e) => !!e.options.lineNumberClassName);
    r.sort((e, t) => YH.compareRangesUsingEnds(e.range, t.range));
    let o = 0;
    const s = this._context.viewModel.getLineCount(),
      a = [];
    for (let l = n; l <= i; l++) {
      const e = l - n,
        i = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(
          new xV(l, 1),
        ).lineNumber;
      let c = this._getLineRenderLineNumber(l),
        d = "";
      for (; o < r.length && r[o].range.endLineNumber < l; ) o++;
      for (let t = o; t < r.length; t++) {
        const { range: e, options: n } = r[t];
        e.startLineNumber <= l && (d += " " + n.lineNumberClassName);
      }
      c || d
        ? (l === s &&
            0 === this._context.viewModel.getLineLength(l) &&
            ("off" === this._renderFinalNewline && (c = ""),
            "dimmed" === this._renderFinalNewline && (d += " dimmed-line-number")),
          i === this._activeModelLineNumber && (d += " active-line-number"),
          (a[e] =
            `<div class="${Y1.CLASS_NAME}${t}${d}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${c}</div>`))
        : (a[e] = "");
    }
    this._renderResult = a;
  }
  render(e, t) {
    if (!this._renderResult) return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
}
_0((e, t) => {
  const n = e.getColor(L0),
    i = e.getColor(U0);
  i
    ? t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`)
    : n &&
      t.addRule(
        `.monaco-editor .line-numbers.dimmed-line-number { color: ${n.transparent(0.4)}; }`,
      );
});
const X1 = "monaco-mouse-cursor-text";
class Q1 {
  get didDomLayout() {
    return this._didDomLayout;
  }
  readClientRect() {
    if (!this._clientRectRead) {
      this._clientRectRead = !0;
      const e = this._domNode.getBoundingClientRect();
      (this.markDidDomLayout(),
        (this._clientRectDeltaLeft = e.left),
        (this._clientRectScale = e.width / this._domNode.offsetWidth));
    }
  }
  get clientRectDeltaLeft() {
    return (this._clientRectRead || this.readClientRect(), this._clientRectDeltaLeft);
  }
  get clientRectScale() {
    return (this._clientRectRead || this.readClientRect(), this._clientRectScale);
  }
  constructor(e, t) {
    ((this._domNode = e),
      (this.endNode = t),
      (this._didDomLayout = !1),
      (this._clientRectDeltaLeft = 0),
      (this._clientRectScale = 1),
      (this._clientRectRead = !1));
  }
  markDidDomLayout() {
    this._didDomLayout = !0;
  }
}
class J1 {
  constructor(e, t) {
    this.themeType = t;
    const n = e.options,
      i = n.get(59);
    ((this.renderWhitespace = n.get(113)),
      (this.experimentalWhitespaceRendering = n.get(47)),
      (this.renderControlCharacters = n.get(108)),
      (this.spaceWidth = i.spaceWidth),
      (this.middotWidth = i.middotWidth),
      (this.wsmiddotWidth = i.wsmiddotWidth),
      (this.useMonospaceOptimizations = i.isMonospace && !n.get(40)),
      (this.canUseHalfwidthRightwardsArrow = i.canUseHalfwidthRightwardsArrow),
      (this.lineHeight = n.get(75)),
      (this.stopRenderingLineAfter = n.get(133)),
      (this.fontLigatures = n.get(60)),
      (this.verticalScrollbarSize = n.get(117).verticalScrollbarSize),
      (this.useGpu = "on" === n.get(46)));
  }
  equals(e) {
    return (
      this.themeType === e.themeType &&
      this.renderWhitespace === e.renderWhitespace &&
      this.experimentalWhitespaceRendering === e.experimentalWhitespaceRendering &&
      this.renderControlCharacters === e.renderControlCharacters &&
      this.spaceWidth === e.spaceWidth &&
      this.middotWidth === e.middotWidth &&
      this.wsmiddotWidth === e.wsmiddotWidth &&
      this.useMonospaceOptimizations === e.useMonospaceOptimizations &&
      this.canUseHalfwidthRightwardsArrow === e.canUseHalfwidthRightwardsArrow &&
      this.lineHeight === e.lineHeight &&
      this.stopRenderingLineAfter === e.stopRenderingLineAfter &&
      this.fontLigatures === e.fontLigatures &&
      this.verticalScrollbarSize === e.verticalScrollbarSize &&
      this.useGpu === e.useGpu
    );
  }
}
class e2 {
  constructor() {
    this._currentVisibleRange = new YH(1, 1, 1, 1);
  }
  getCurrentVisibleRange() {
    return this._currentVisibleRange;
  }
  setCurrentVisibleRange(e) {
    this._currentVisibleRange = e;
  }
}
class t2 {
  constructor(e, t, n, i, r, o, s) {
    ((this.minimalReveal = e),
      (this.lineNumber = t),
      (this.startColumn = n),
      (this.endColumn = i),
      (this.startScrollTop = r),
      (this.stopScrollTop = o),
      (this.scrollType = s),
      (this.type = "range"),
      (this.minLineNumber = t),
      (this.maxLineNumber = t));
  }
}
class n2 {
  constructor(e, t, n, i, r) {
    ((this.minimalReveal = e),
      (this.selections = t),
      (this.startScrollTop = n),
      (this.stopScrollTop = i),
      (this.scrollType = r),
      (this.type = "selections"));
    let o = t[0].startLineNumber,
      s = t[0].endLineNumber;
    for (let a = 1, l = t.length; a < l; a++) {
      const e = t[a];
      ((o = Math.min(o, e.startLineNumber)), (s = Math.max(s, e.endLineNumber)));
    }
    ((this.minLineNumber = o), (this.maxLineNumber = s));
  }
}
class i2 extends iQ {
  static {
    this.HORIZONTAL_EXTRA_PX = 30;
  }
  constructor(e, t, n) {
    super(e);
    const i = this._context.configuration,
      r = this._context.configuration.options,
      o = r.get(59),
      s = r.get(166);
    ((this._lineHeight = r.get(75)),
      (this._typicalHalfwidthCharacterWidth = o.typicalHalfwidthCharacterWidth),
      (this._isViewportWrapping = s.isViewportWrapping),
      (this._revealHorizontalRightPadding = r.get(114)),
      (this._cursorSurroundingLines = r.get(35)),
      (this._cursorSurroundingLinesStyle = r.get(36)),
      (this._canUseLayerHinting = !r.get(39)),
      (this._viewLineOptions = new J1(i, this._context.theme.type)),
      (this._linesContent = n),
      (this._textRangeRestingSpot = document.createElement("div")),
      (this._visibleLines = new XJ(this._context, {
        createLine: () => new MQ(t, this._viewLineOptions),
      })),
      (this.domNode = this._visibleLines.domNode),
      rQ.write(this.domNode, 8),
      this.domNode.setClassName(`view-lines ${X1}`),
      Vq(this.domNode, o),
      (this._maxLineWidth = 0),
      (this._asyncUpdateLineWidths = new EM(() => {
        this._updateLineWidthsSlow();
      }, 200)),
      (this._asyncCheckMonospaceFontAssumptions = new EM(() => {
        this._checkMonospaceFontAssumptions();
      }, 2e3)),
      (this._lastRenderedData = new e2()),
      (this._horizontalRevealRequest = null),
      (this._stickyScrollEnabled = r.get(131).enabled),
      (this._maxNumberStickyLines = r.get(131).maxLineCount));
  }
  dispose() {
    (this._asyncUpdateLineWidths.dispose(),
      this._asyncCheckMonospaceFontAssumptions.dispose(),
      super.dispose());
  }
  getDomNode() {
    return this.domNode;
  }
  onConfigurationChanged(e) {
    (this._visibleLines.onConfigurationChanged(e), e.hasChanged(166) && (this._maxLineWidth = 0));
    const t = this._context.configuration.options,
      n = t.get(59),
      i = t.get(166);
    return (
      (this._lineHeight = t.get(75)),
      (this._typicalHalfwidthCharacterWidth = n.typicalHalfwidthCharacterWidth),
      (this._isViewportWrapping = i.isViewportWrapping),
      (this._revealHorizontalRightPadding = t.get(114)),
      (this._cursorSurroundingLines = t.get(35)),
      (this._cursorSurroundingLinesStyle = t.get(36)),
      (this._canUseLayerHinting = !t.get(39)),
      (this._stickyScrollEnabled = t.get(131).enabled),
      (this._maxNumberStickyLines = t.get(131).maxLineCount),
      Vq(this.domNode, n),
      this._onOptionsMaybeChanged(),
      e.hasChanged(165) && (this._maxLineWidth = 0),
      !0
    );
  }
  _onOptionsMaybeChanged() {
    const e = this._context.configuration,
      t = new J1(e, this._context.theme.type);
    if (!this._viewLineOptions.equals(t)) {
      this._viewLineOptions = t;
      const e = this._visibleLines.getStartLineNumber(),
        n = this._visibleLines.getEndLineNumber();
      for (let t = e; t <= n; t++) {
        this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);
      }
      return !0;
    }
    return !1;
  }
  onCursorStateChanged(e) {
    const t = this._visibleLines.getStartLineNumber(),
      n = this._visibleLines.getEndLineNumber();
    let i = !1;
    for (let r = t; r <= n; r++) i = this._visibleLines.getVisibleLine(r).onSelectionChanged() || i;
    return i;
  }
  onDecorationsChanged(e) {
    {
      const e = this._visibleLines.getStartLineNumber(),
        t = this._visibleLines.getEndLineNumber();
      for (let n = e; n <= t; n++) this._visibleLines.getVisibleLine(n).onDecorationsChanged();
    }
    return !0;
  }
  onFlushed(e) {
    const t = this._visibleLines.onFlushed(e, this._viewLineOptions.useGpu);
    return ((this._maxLineWidth = 0), t);
  }
  onLinesChanged(e) {
    return this._visibleLines.onLinesChanged(e);
  }
  onLinesDeleted(e) {
    return this._visibleLines.onLinesDeleted(e);
  }
  onLinesInserted(e) {
    return this._visibleLines.onLinesInserted(e);
  }
  onRevealRangeRequest(e) {
    const t = this._computeScrollTopToRevealRange(
      this._context.viewLayout.getFutureViewport(),
      e.source,
      e.minimalReveal,
      e.range,
      e.selections,
      e.verticalType,
    );
    if (-1 === t) return !1;
    let n = this._context.viewLayout.validateScrollPosition({ scrollTop: t });
    e.revealHorizontal
      ? e.range && e.range.startLineNumber !== e.range.endLineNumber
        ? (n = { scrollTop: n.scrollTop, scrollLeft: 0 })
        : e.range
          ? (this._horizontalRevealRequest = new t2(
              e.minimalReveal,
              e.range.startLineNumber,
              e.range.startColumn,
              e.range.endColumn,
              this._context.viewLayout.getCurrentScrollTop(),
              n.scrollTop,
              e.scrollType,
            ))
          : e.selections &&
            e.selections.length > 0 &&
            (this._horizontalRevealRequest = new n2(
              e.minimalReveal,
              e.selections,
              this._context.viewLayout.getCurrentScrollTop(),
              n.scrollTop,
              e.scrollType,
            ))
      : (this._horizontalRevealRequest = null);
    const i =
      Math.abs(this._context.viewLayout.getCurrentScrollTop() - n.scrollTop) <= this._lineHeight
        ? 1
        : e.scrollType;
    return (this._context.viewModel.viewLayout.setScrollPosition(n, i), !0);
  }
  onScrollChanged(e) {
    if (
      (this._horizontalRevealRequest &&
        e.scrollLeftChanged &&
        (this._horizontalRevealRequest = null),
      this._horizontalRevealRequest && e.scrollTopChanged)
    ) {
      const t = Math.min(
          this._horizontalRevealRequest.startScrollTop,
          this._horizontalRevealRequest.stopScrollTop,
        ),
        n = Math.max(
          this._horizontalRevealRequest.startScrollTop,
          this._horizontalRevealRequest.stopScrollTop,
        );
      (e.scrollTop < t || e.scrollTop > n) && (this._horizontalRevealRequest = null);
    }
    return (this.domNode.setWidth(e.scrollWidth), this._visibleLines.onScrollChanged(e) || !0);
  }
  onTokensChanged(e) {
    return this._visibleLines.onTokensChanged(e);
  }
  onZonesChanged(e) {
    return (
      this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),
      this._visibleLines.onZonesChanged(e)
    );
  }
  onThemeChanged(e) {
    return this._onOptionsMaybeChanged();
  }
  getPositionFromDOMInfo(e, t) {
    const n = this._getViewLineDomNode(e);
    if (null === n) return null;
    const i = this._getLineNumberFor(n);
    if (-1 === i) return null;
    if (i < 1 || i > this._context.viewModel.getLineCount()) return null;
    if (1 === this._context.viewModel.getLineMaxColumn(i)) return new xV(i, 1);
    const r = this._visibleLines.getStartLineNumber(),
      o = this._visibleLines.getEndLineNumber();
    if (i < r || i > o) return null;
    let s = this._visibleLines.getVisibleLine(i).getColumnOfNodeOffset(e, t);
    const a = this._context.viewModel.getLineMinColumn(i);
    return (s < a && (s = a), new xV(i, s));
  }
  _getViewLineDomNode(e) {
    for (; e && 1 === e.nodeType; ) {
      if (e.className === MQ.CLASS_NAME) return e;
      e = e.parentElement;
    }
    return null;
  }
  _getLineNumberFor(e) {
    const t = this._visibleLines.getStartLineNumber(),
      n = this._visibleLines.getEndLineNumber();
    for (let i = t; i <= n; i++) {
      if (e === this._visibleLines.getVisibleLine(i).getDomNode()) return i;
    }
    return -1;
  }
  getLineWidth(e) {
    const t = this._visibleLines.getStartLineNumber(),
      n = this._visibleLines.getEndLineNumber();
    if (e < t || e > n) return -1;
    const i = new Q1(this.domNode.domNode, this._textRangeRestingSpot),
      r = this._visibleLines.getVisibleLine(e).getWidth(i);
    return (this._updateLineWidthsSlowIfDomDidLayout(i), r);
  }
  linesVisibleRangesForRange(e, t) {
    if (this.shouldRender()) return null;
    const n = e.endLineNumber,
      i = YH.intersectRanges(e, this._lastRenderedData.getCurrentVisibleRange());
    if (!i) return null;
    const r = [];
    let o = 0;
    const s = new Q1(this.domNode.domNode, this._textRangeRestingSpot);
    let a = 0;
    t &&
      (a = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(
        new xV(i.startLineNumber, 1),
      ).lineNumber);
    const l = this._visibleLines.getStartLineNumber(),
      c = this._visibleLines.getEndLineNumber();
    for (let d = i.startLineNumber; d <= i.endLineNumber; d++) {
      if (d < l || d > c) continue;
      const e = d === i.startLineNumber ? i.startColumn : 1,
        u = d !== n,
        h = u ? this._context.viewModel.getLineMaxColumn(d) : i.endColumn,
        g = this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d, e, h, s);
      if (g) {
        if (t && d < n) {
          const e = a;
          if (
            ((a = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(
              new xV(d + 1, 1),
            ).lineNumber),
            e !== a)
          ) {
            const t = g.ranges[g.ranges.length - 1];
            ((t.width += this._typicalHalfwidthCharacterWidth),
              this._context.viewModel.getTextDirection(e) === qz.RTL &&
                (t.left -= this._typicalHalfwidthCharacterWidth));
          }
        }
        r[o++] = new aQ(g.outsideRenderedLine, d, lQ.from(g.ranges), u);
      }
    }
    return (this._updateLineWidthsSlowIfDomDidLayout(s), 0 === o ? null : r);
  }
  _visibleRangesForLineRange(e, t, n) {
    if (this.shouldRender()) return null;
    if (e < this._visibleLines.getStartLineNumber() || e > this._visibleLines.getEndLineNumber())
      return null;
    const i = new Q1(this.domNode.domNode, this._textRangeRestingSpot),
      r = this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e, t, n, i);
    return (this._updateLineWidthsSlowIfDomDidLayout(i), r);
  }
  _lineIsRenderedRTL(e) {
    if (e < this._visibleLines.getStartLineNumber() || e > this._visibleLines.getEndLineNumber())
      return !1;
    return this._visibleLines.getVisibleLine(e).isRenderedRTL();
  }
  visibleRangeForPosition(e) {
    const t = this._visibleRangesForLineRange(e.lineNumber, e.column, e.column);
    return t ? new dQ(t.outsideRenderedLine, t.ranges[0].left) : null;
  }
  _updateLineWidthsFast() {
    return this._updateLineWidths(!0);
  }
  _updateLineWidthsSlow() {
    this._updateLineWidths(!1);
  }
  _updateLineWidthsSlowIfDomDidLayout(e) {
    e.didDomLayout &&
      (this._asyncUpdateLineWidths.isScheduled() ||
        (this._asyncUpdateLineWidths.cancel(), this._updateLineWidthsSlow()));
  }
  _updateLineWidths(e) {
    const t = this._visibleLines.getStartLineNumber(),
      n = this._visibleLines.getEndLineNumber();
    let i = 1,
      r = !0;
    for (let o = t; o <= n; o++) {
      const t = this._visibleLines.getVisibleLine(o);
      !e || t.getWidthIsFast() ? (i = Math.max(i, t.getWidth(null))) : (r = !1);
    }
    return (
      r && 1 === t && n === this._context.viewModel.getLineCount() && (this._maxLineWidth = 0),
      this._ensureMaxLineWidth(i),
      r
    );
  }
  _checkMonospaceFontAssumptions() {
    let e = -1,
      t = -1;
    const n = this._visibleLines.getStartLineNumber(),
      i = this._visibleLines.getEndLineNumber();
    for (let r = n; r <= i; r++) {
      const n = this._visibleLines.getVisibleLine(r);
      if (n.needsMonospaceFontCheck()) {
        const i = n.getWidth(null);
        i > t && ((t = i), (e = r));
      }
    }
    if (-1 !== e && !this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())
      for (let r = n; r <= i; r++) {
        this._visibleLines.getVisibleLine(r).onMonospaceAssumptionsInvalidated();
      }
  }
  prepareRender() {
    throw new Error("Not supported");
  }
  render() {
    throw new Error("Not supported");
  }
  renderText(e) {
    if (
      (this._visibleLines.renderLines(e),
      this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),
      this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),
      this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(), 1e6)),
      this._horizontalRevealRequest)
    ) {
      const t = this._horizontalRevealRequest;
      if (e.startLineNumber <= t.minLineNumber && t.maxLineNumber <= e.endLineNumber) {
        ((this._horizontalRevealRequest = null), this.onDidRender());
        const e = this._computeScrollLeftToReveal(t);
        e &&
          (this._isViewportWrapping || e.hasRTL || this._ensureMaxLineWidth(e.maxHorizontalOffset),
          this._context.viewModel.viewLayout.setScrollPosition(
            { scrollLeft: e.scrollLeft },
            t.scrollType,
          ));
      }
    }
    if (
      (this._updateLineWidthsFast()
        ? this._asyncUpdateLineWidths.cancel()
        : this._asyncUpdateLineWidths.schedule(),
      jR && !this._asyncCheckMonospaceFontAssumptions.isScheduled())
    ) {
      const e = this._visibleLines.getStartLineNumber(),
        t = this._visibleLines.getEndLineNumber();
      for (let n = e; n <= t; n++) {
        if (this._visibleLines.getVisibleLine(n).needsMonospaceFontCheck()) {
          this._asyncCheckMonospaceFontAssumptions.schedule();
          break;
        }
      }
    }
    (this._linesContent.setLayerHinting(this._canUseLayerHinting),
      this._linesContent.setContain("strict"));
    const t = this._context.viewLayout.getCurrentScrollTop() - e.bigNumbersDelta;
    (this._linesContent.setTop(-t),
      this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft()));
  }
  _ensureMaxLineWidth(e) {
    const t = Math.ceil(e);
    this._maxLineWidth < t &&
      ((this._maxLineWidth = t),
      this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth));
  }
  _computeScrollTopToRevealRange(e, t, n, i, r, o) {
    const s = e.top,
      a = e.height,
      l = s + a;
    let c, d, u;
    if (r && r.length > 0) {
      let e = r[0].startLineNumber,
        t = r[0].endLineNumber;
      for (let n = 1, i = r.length; n < i; n++) {
        const i = r[n];
        ((e = Math.min(e, i.startLineNumber)), (t = Math.max(t, i.endLineNumber)));
      }
      ((c = !1),
        (d = this._context.viewLayout.getVerticalOffsetForLineNumber(e)),
        (u = this._context.viewLayout.getVerticalOffsetForLineNumber(t) + this._lineHeight));
    } else {
      if (!i) return -1;
      ((c = !0),
        (d = this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber)),
        (u =
          this._context.viewLayout.getVerticalOffsetForLineNumber(i.endLineNumber) +
          this._lineHeight));
    }
    let h,
      g = 0,
      p = 0;
    if (("mouse" === t || n) && "default" === this._cursorSurroundingLinesStyle)
      n || (g = this._lineHeight);
    else {
      const e = a / this._lineHeight,
        t = Math.max(
          this._cursorSurroundingLines,
          this._stickyScrollEnabled ? this._maxNumberStickyLines : 0,
        ),
        n = Math.min(e / 2, t);
      ((g = n * this._lineHeight), (p = Math.max(0, n - 1) * this._lineHeight));
    }
    if ((n || (0 !== o && 4 !== o) || (p += this._lineHeight), (d -= g), (u += p), u - d > a)) {
      if (!c) return -1;
      h = d;
    } else if (5 === o || 6 === o)
      if (6 === o && s <= d && u <= l) h = s;
      else {
        const e = d - Math.max(5 * this._lineHeight, 0.2 * a),
          t = u - a;
        h = Math.max(t, e);
      }
    else if (1 === o || 2 === o)
      if (2 === o && s <= d && u <= l) h = s;
      else {
        const e = (d + u) / 2;
        h = Math.max(0, e - a / 2);
      }
    else h = this._computeMinimumScrolling(s, l, d, u, 3 === o, 4 === o);
    return h;
  }
  _computeScrollLeftToReveal(e) {
    const t = this._context.viewLayout.getCurrentViewport(),
      n = this._context.configuration.options.get(165),
      i = t.left,
      r = i + t.width - n.verticalScrollbarWidth;
    let o = 1073741824,
      s = 0,
      a = !1;
    if ("range" === e.type) {
      a = this._lineIsRenderedRTL(e.lineNumber);
      const t = this._visibleRangesForLineRange(e.lineNumber, e.startColumn, e.endColumn);
      if (!t) return null;
      for (const e of t.ranges)
        ((o = Math.min(o, Math.round(e.left))), (s = Math.max(s, Math.round(e.left + e.width))));
    } else
      for (const l of e.selections) {
        if (l.startLineNumber !== l.endLineNumber) return null;
        const e = this._visibleRangesForLineRange(l.startLineNumber, l.startColumn, l.endColumn);
        if (((a ||= this._lineIsRenderedRTL(l.startLineNumber)), !e)) return null;
        for (const t of e.ranges)
          ((o = Math.min(o, Math.round(t.left))), (s = Math.max(s, Math.round(t.left + t.width))));
      }
    if (
      (e.minimalReveal ||
        ((o = Math.max(0, o - i2.HORIZONTAL_EXTRA_PX)), (s += this._revealHorizontalRightPadding)),
      "selections" === e.type && s - o > t.width)
    )
      return null;
    return {
      scrollLeft: this._computeMinimumScrolling(i, r, o, s),
      maxHorizontalOffset: s,
      hasRTL: a,
    };
  }
  _computeMinimumScrolling(e, t, n, i, r, o) {
    ((r = !!r), (o = !!o));
    const s = (t |= 0) - (e |= 0);
    return (i |= 0) - (n |= 0) < s
      ? r
        ? n
        : o
          ? Math.max(0, i - s)
          : n < e
            ? n
            : i > t
              ? Math.max(0, i - s)
              : e
      : n;
  }
}
class r2 extends N1 {
  constructor(e) {
    (super(), (this._context = e));
    const t = this._context.configuration.options.get(165);
    ((this._decorationsLeft = t.decorationsLeft),
      (this._decorationsWidth = t.decorationsWidth),
      (this._renderResult = null),
      this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), (this._renderResult = null), super.dispose());
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options.get(165);
    return (
      (this._decorationsLeft = t.decorationsLeft),
      (this._decorationsWidth = t.decorationsWidth),
      !0
    );
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  _getDecorations(e) {
    const t = e.getDecorationsInViewport(),
      n = [];
    let i = 0;
    for (let r = 0, o = t.length; r < o; r++) {
      const e = t[r],
        o = e.options.linesDecorationsClassName,
        s = e.options.zIndex;
      o &&
        (n[i++] = new S1(
          e.range.startLineNumber,
          e.range.endLineNumber,
          o,
          e.options.linesDecorationsTooltip ?? null,
          s,
        ));
      const a = e.options.firstLineDecorationClassName;
      a &&
        (n[i++] = new S1(
          e.range.startLineNumber,
          e.range.startLineNumber,
          a,
          e.options.linesDecorationsTooltip ?? null,
          s,
        ));
    }
    return n;
  }
  prepareRender(e) {
    const t = e.visibleRange.startLineNumber,
      n = e.visibleRange.endLineNumber,
      i = this._render(t, n, this._getDecorations(e)),
      r =
        '" style="left:' +
        this._decorationsLeft.toString() +
        "px;width:" +
        this._decorationsWidth.toString() +
        'px;"></div>',
      o = [];
    for (let s = t; s <= n; s++) {
      const e = s - t,
        n = i[e].getDecorations();
      let a = "";
      for (const t of n) {
        let e = '<div class="cldr ' + t.className;
        (null !== t.tooltip && (e += '" title="' + t.tooltip), (e += r), (a += e));
      }
      o[e] = a;
    }
    this._renderResult = o;
  }
  render(e, t) {
    return this._renderResult ? this._renderResult[t - e] : "";
  }
}
class o2 extends iQ {
  static {
    this.CLASS_NAME = "glyph-margin";
  }
  static {
    this.OUTER_CLASS_NAME = "margin";
  }
  constructor(e) {
    super(e);
    const t = this._context.configuration.options,
      n = t.get(165);
    ((this._canUseLayerHinting = !t.get(39)),
      (this._contentLeft = n.contentLeft),
      (this._glyphMarginLeft = n.glyphMarginLeft),
      (this._glyphMarginWidth = n.glyphMarginWidth),
      (this._domNode = Bq(document.createElement("div"))),
      this._domNode.setClassName(o2.OUTER_CLASS_NAME),
      this._domNode.setPosition("absolute"),
      this._domNode.setAttribute("role", "presentation"),
      this._domNode.setAttribute("aria-hidden", "true"),
      (this._glyphMarginBackgroundDomNode = Bq(document.createElement("div"))),
      this._glyphMarginBackgroundDomNode.setClassName(o2.CLASS_NAME),
      this._domNode.appendChild(this._glyphMarginBackgroundDomNode));
  }
  dispose() {
    super.dispose();
  }
  getDomNode() {
    return this._domNode;
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options,
      n = t.get(165);
    return (
      (this._canUseLayerHinting = !t.get(39)),
      (this._contentLeft = n.contentLeft),
      (this._glyphMarginLeft = n.glyphMarginLeft),
      (this._glyphMarginWidth = n.glyphMarginWidth),
      !0
    );
  }
  onScrollChanged(e) {
    return super.onScrollChanged(e) || e.scrollTopChanged;
  }
  prepareRender(e) {}
  render(e) {
    (this._domNode.setLayerHinting(this._canUseLayerHinting), this._domNode.setContain("strict"));
    const t = e.scrollTop - e.bigNumbersDelta;
    this._domNode.setTop(-t);
    const n = Math.min(e.scrollHeight, 1e6);
    (this._domNode.setHeight(n),
      this._domNode.setWidth(this._contentLeft),
      this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),
      this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),
      this._glyphMarginBackgroundDomNode.setHeight(n));
  }
}
class s2 extends N1 {
  constructor(e) {
    (super(),
      (this._context = e),
      (this._renderResult = null),
      this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), (this._renderResult = null), super.dispose());
  }
  onConfigurationChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  _getDecorations(e) {
    const t = e.getDecorationsInViewport(),
      n = [];
    let i = 0;
    for (let r = 0, o = t.length; r < o; r++) {
      const e = t[r],
        o = e.options.marginClassName,
        s = e.options.zIndex;
      o && (n[i++] = new S1(e.range.startLineNumber, e.range.endLineNumber, o, null, s));
    }
    return n;
  }
  prepareRender(e) {
    const t = e.visibleRange.startLineNumber,
      n = e.visibleRange.endLineNumber,
      i = this._render(t, n, this._getDecorations(e)),
      r = [];
    for (let o = t; o <= n; o++) {
      const e = o - t,
        n = i[e].getDecorations();
      let s = "";
      for (const t of n) s += '<div class="cmdr ' + t.className + '" style=""></div>';
      r[e] = s;
    }
    this._renderResult = r;
  }
  render(e, t) {
    return this._renderResult ? this._renderResult[t - e] : "";
  }
}
class a2 {
  static {
    this.Empty = new a2(0, 0, 0, 0);
  }
  constructor(e, t, n, i) {
    ((this._rgba8Brand = void 0),
      (this.r = a2._clamp(e)),
      (this.g = a2._clamp(t)),
      (this.b = a2._clamp(n)),
      (this.a = a2._clamp(i)));
  }
  equals(e) {
    return this.r === e.r && this.g === e.g && this.b === e.b && this.a === e.a;
  }
  static _clamp(e) {
    return e < 0 ? 0 : e > 255 ? 255 : 0 | e;
  }
}
class l2 extends PO {
  get isResolved() {
    return this._isResolved;
  }
  constructor(e, t, n) {
    (super(),
      (this._registry = e),
      (this._languageId = t),
      (this._factory = n),
      (this._isDisposed = !1),
      (this._resolvePromise = null),
      (this._isResolved = !1));
  }
  dispose() {
    ((this._isDisposed = !0), super.dispose());
  }
  async resolve() {
    return (this._resolvePromise || (this._resolvePromise = this._create()), this._resolvePromise);
  }
  async _create() {
    const e = await this._factory.tokenizationSupport;
    ((this._isResolved = !0),
      e && !this._isDisposed && this._register(this._registry.register(this._languageId, e)));
  }
}
let c2 = class {
  constructor(e, t, n) {
    ((this.offset = e), (this.type = t), (this.language = n), (this._tokenBrand = void 0));
  }
  toString() {
    return "(" + this.offset + ", " + this.type + ")";
  }
};
class d2 {
  constructor(e, t) {
    ((this.tokens = e), (this.endState = t), (this._tokenizationResultBrand = void 0));
  }
}
class u2 {
  constructor(e, t) {
    ((this.tokens = e), (this.endState = t), (this._encodedTokenizationResultBrand = void 0));
  }
}
var h2, g2, p2, f2, m2, _2, v2, b2;
(!(function (e) {
  ((e[(e.Increase = 0)] = "Increase"), (e[(e.Decrease = 1)] = "Decrease"));
})(h2 || (h2 = {})),
  (function (e) {
    const t = new Map();
    (t.set(0, OV.symbolMethod),
      t.set(1, OV.symbolFunction),
      t.set(2, OV.symbolConstructor),
      t.set(3, OV.symbolField),
      t.set(4, OV.symbolVariable),
      t.set(5, OV.symbolClass),
      t.set(6, OV.symbolStruct),
      t.set(7, OV.symbolInterface),
      t.set(8, OV.symbolModule),
      t.set(9, OV.symbolProperty),
      t.set(10, OV.symbolEvent),
      t.set(11, OV.symbolOperator),
      t.set(12, OV.symbolUnit),
      t.set(13, OV.symbolValue),
      t.set(15, OV.symbolEnum),
      t.set(14, OV.symbolConstant),
      t.set(15, OV.symbolEnum),
      t.set(16, OV.symbolEnumMember),
      t.set(17, OV.symbolKeyword),
      t.set(28, OV.symbolSnippet),
      t.set(18, OV.symbolText),
      t.set(19, OV.symbolColor),
      t.set(20, OV.symbolFile),
      t.set(21, OV.symbolReference),
      t.set(22, OV.symbolCustomColor),
      t.set(23, OV.symbolFolder),
      t.set(24, OV.symbolTypeParameter),
      t.set(25, OV.account),
      t.set(26, OV.issues),
      t.set(27, OV.tools),
      (e.toIcon = function (e) {
        let n = t.get(e);
        return (n || (n = OV.symbolProperty), n);
      }),
      (e.toLabel = function (e) {
        switch (e) {
          case 0:
            return SI(728, "Method");
          case 1:
            return SI(729, "Function");
          case 2:
            return SI(730, "Constructor");
          case 3:
            return SI(731, "Field");
          case 4:
            return SI(732, "Variable");
          case 5:
            return SI(733, "Class");
          case 6:
            return SI(734, "Struct");
          case 7:
            return SI(735, "Interface");
          case 8:
            return SI(736, "Module");
          case 9:
            return SI(737, "Property");
          case 10:
            return SI(738, "Event");
          case 11:
            return SI(739, "Operator");
          case 12:
            return SI(740, "Unit");
          case 13:
            return SI(741, "Value");
          case 14:
            return SI(742, "Constant");
          case 15:
            return SI(743, "Enum");
          case 16:
            return SI(744, "Enum Member");
          case 17:
            return SI(745, "Keyword");
          case 18:
            return SI(746, "Text");
          case 19:
            return SI(747, "Color");
          case 20:
            return SI(748, "File");
          case 21:
            return SI(749, "Reference");
          case 22:
            return SI(750, "Custom Color");
          case 23:
            return SI(751, "Folder");
          case 24:
            return SI(752, "Type Parameter");
          case 25:
            return SI(753, "User");
          case 26:
            return SI(754, "Issue");
          case 27:
            return SI(755, "Tool");
          case 28:
            return SI(756, "Snippet");
          default:
            return "";
        }
      }));
    const n = new Map();
    (n.set("method", 0),
      n.set("function", 1),
      n.set("constructor", 2),
      n.set("field", 3),
      n.set("variable", 4),
      n.set("class", 5),
      n.set("struct", 6),
      n.set("interface", 7),
      n.set("module", 8),
      n.set("property", 9),
      n.set("event", 10),
      n.set("operator", 11),
      n.set("unit", 12),
      n.set("value", 13),
      n.set("constant", 14),
      n.set("enum", 15),
      n.set("enum-member", 16),
      n.set("enumMember", 16),
      n.set("keyword", 17),
      n.set("snippet", 28),
      n.set("text", 18),
      n.set("color", 19),
      n.set("file", 20),
      n.set("reference", 21),
      n.set("customcolor", 22),
      n.set("folder", 23),
      n.set("type-parameter", 24),
      n.set("typeParameter", 24),
      n.set("account", 25),
      n.set("issue", 26),
      n.set("tool", 27),
      (e.fromString = function (e, t) {
        let i = n.get(e);
        return (void 0 !== i || t || (i = 9), i);
      }));
  })(g2 || (g2 = {})),
  (function (e) {
    ((e[(e.Automatic = 0)] = "Automatic"), (e[(e.Explicit = 1)] = "Explicit"));
  })(p2 || (p2 = {})));
class y2 {
  constructor(e, t, n, i) {
    ((this.range = e), (this.text = t), (this.completionKind = n), (this.isSnippetText = i));
  }
  equals(e) {
    return (
      YH.lift(this.range).equalsRange(e.range) &&
      this.text === e.text &&
      this.completionKind === e.completionKind &&
      this.isSnippetText === e.isSnippetText
    );
  }
}
!(function (e) {
  ((e[(e.Code = 1)] = "Code"), (e[(e.Label = 2)] = "Label"));
})(f2 || (f2 = {}));
class x2 {
  static fromExtensionId(e) {
    return new x2(e, void 0, void 0);
  }
  constructor(e, t, n) {
    ((this.extensionId = e), (this.extensionVersion = t), (this.providerId = n));
  }
  toString() {
    let e = "";
    return (
      this.extensionId && (e += this.extensionId),
      this.extensionVersion && (e += `@${this.extensionVersion}`),
      this.providerId && (e += `:${this.providerId}`),
      0 === e.length && (e = "unknown"),
      e
    );
  }
  toStringWithoutVersion() {
    let e = "";
    return (
      this.extensionId && (e += this.extensionId),
      this.providerId && (e += `:${this.providerId}`),
      e
    );
  }
}
(!(function (e) {
  ((e[(e.Accepted = 0)] = "Accepted"),
    (e[(e.Rejected = 1)] = "Rejected"),
    (e[(e.Ignored = 2)] = "Ignored"));
})(m2 || (m2 = {})),
  (function (e) {
    ((e[(e.Automatic = 0)] = "Automatic"), (e[(e.PasteAs = 1)] = "PasteAs"));
  })(_2 || (_2 = {})),
  (function (e) {
    ((e[(e.Invoke = 1)] = "Invoke"),
      (e[(e.TriggerCharacter = 2)] = "TriggerCharacter"),
      (e[(e.ContentChange = 3)] = "ContentChange"));
  })(v2 || (v2 = {})),
  (function (e) {
    ((e[(e.Text = 0)] = "Text"), (e[(e.Read = 1)] = "Read"), (e[(e.Write = 2)] = "Write"));
  })(b2 || (b2 = {})));
const w2 = {
  17: SI(757, "array"),
  16: SI(758, "boolean"),
  4: SI(759, "class"),
  13: SI(760, "constant"),
  8: SI(761, "constructor"),
  9: SI(762, "enumeration"),
  21: SI(763, "enumeration member"),
  23: SI(764, "event"),
  7: SI(765, "field"),
  0: SI(766, "file"),
  11: SI(767, "function"),
  10: SI(768, "interface"),
  19: SI(769, "key"),
  5: SI(770, "method"),
  1: SI(771, "module"),
  2: SI(772, "namespace"),
  20: SI(773, "null"),
  15: SI(774, "number"),
  18: SI(775, "object"),
  24: SI(776, "operator"),
  3: SI(777, "package"),
  6: SI(778, "property"),
  14: SI(779, "string"),
  22: SI(780, "struct"),
  25: SI(781, "type parameter"),
  12: SI(782, "variable"),
};
function C2(e, t) {
  return SI(783, "{0} ({1})", e, w2[t]);
}
var S2;
!(function (e) {
  const t = new Map();
  (t.set(0, OV.symbolFile),
    t.set(1, OV.symbolModule),
    t.set(2, OV.symbolNamespace),
    t.set(3, OV.symbolPackage),
    t.set(4, OV.symbolClass),
    t.set(5, OV.symbolMethod),
    t.set(6, OV.symbolProperty),
    t.set(7, OV.symbolField),
    t.set(8, OV.symbolConstructor),
    t.set(9, OV.symbolEnum),
    t.set(10, OV.symbolInterface),
    t.set(11, OV.symbolFunction),
    t.set(12, OV.symbolVariable),
    t.set(13, OV.symbolConstant),
    t.set(14, OV.symbolString),
    t.set(15, OV.symbolNumber),
    t.set(16, OV.symbolBoolean),
    t.set(17, OV.symbolArray),
    t.set(18, OV.symbolObject),
    t.set(19, OV.symbolKey),
    t.set(20, OV.symbolNull),
    t.set(21, OV.symbolEnumMember),
    t.set(22, OV.symbolStruct),
    t.set(23, OV.symbolEvent),
    t.set(24, OV.symbolOperator),
    t.set(25, OV.symbolTypeParameter),
    (e.toIcon = function (e) {
      let n = t.get(e);
      return (n || (n = OV.symbolProperty), n);
    }));
  const n = new Map();
  (n.set(0, 20),
    n.set(1, 8),
    n.set(2, 8),
    n.set(3, 8),
    n.set(4, 5),
    n.set(5, 0),
    n.set(6, 9),
    n.set(7, 3),
    n.set(8, 2),
    n.set(9, 15),
    n.set(10, 7),
    n.set(11, 1),
    n.set(12, 4),
    n.set(13, 14),
    n.set(14, 18),
    n.set(15, 13),
    n.set(16, 13),
    n.set(17, 13),
    n.set(18, 13),
    n.set(19, 17),
    n.set(20, 13),
    n.set(21, 16),
    n.set(22, 6),
    n.set(23, 10),
    n.set(24, 11),
    n.set(25, 24),
    (e.toCompletionKind = function (e) {
      let t = n.get(e);
      return (void 0 === t && (t = 20), t);
    }));
})(S2 || (S2 = {}));
let k2 = class e {
  static {
    this.Comment = new e("comment");
  }
  static {
    this.Imports = new e("imports");
  }
  static {
    this.Region = new e("region");
  }
  static fromValue(t) {
    switch (t) {
      case "comment":
        return e.Comment;
      case "imports":
        return e.Imports;
      case "region":
        return e.Region;
    }
    return new e(t);
  }
  constructor(e) {
    this.value = e;
  }
};
var E2, N2, L2, D2;
(!(function (e) {
  e[(e.AIGenerated = 1)] = "AIGenerated";
})(E2 || (E2 = {})),
  (function (e) {
    ((e[(e.Invoke = 0)] = "Invoke"), (e[(e.Automatic = 1)] = "Automatic"));
  })(N2 || (N2 = {})),
  ((L2 || (L2 = {})).is = function (e) {
    return !(!e || "object" != typeof e) && "string" == typeof e.id && "string" == typeof e.title;
  }),
  (function (e) {
    ((e[(e.Type = 1)] = "Type"), (e[(e.Parameter = 2)] = "Parameter"));
  })(D2 || (D2 = {})));
class T2 {
  constructor(e) {
    ((this.createSupport = e), (this._tokenizationSupport = null));
  }
  dispose() {
    this._tokenizationSupport &&
      this._tokenizationSupport.then((e) => {
        e && e.dispose();
      });
  }
  get tokenizationSupport() {
    return (
      this._tokenizationSupport || (this._tokenizationSupport = this.createSupport()),
      this._tokenizationSupport
    );
  }
}
const I2 = new (class {
  constructor() {
    ((this._tokenizationSupports = new Map()),
      (this._factories = new Map()),
      (this._onDidChange = new QO()),
      (this.onDidChange = this._onDidChange.event),
      (this._colorMap = null));
  }
  handleChange(e) {
    this._onDidChange.fire({ changedLanguages: e, changedColorMap: !1 });
  }
  register(e, t) {
    return (
      this._tokenizationSupports.set(e, t),
      this.handleChange([e]),
      MO(() => {
        this._tokenizationSupports.get(e) === t &&
          (this._tokenizationSupports.delete(e), this.handleChange([e]));
      })
    );
  }
  get(e) {
    return this._tokenizationSupports.get(e) || null;
  }
  registerFactory(e, t) {
    this._factories.get(e)?.dispose();
    const n = new l2(this, e, t);
    return (
      this._factories.set(e, n),
      MO(() => {
        const t = this._factories.get(e);
        t && t === n && (this._factories.delete(e), t.dispose());
      })
    );
  }
  async getOrCreate(e) {
    const t = this.get(e);
    if (t) return t;
    const n = this._factories.get(e);
    return !n || n.isResolved ? null : (await n.resolve(), this.get(e));
  }
  isResolved(e) {
    if (this.get(e)) return !0;
    const t = this._factories.get(e);
    return !(t && !t.isResolved);
  }
  setColorMap(e) {
    ((this._colorMap = e),
      this._onDidChange.fire({
        changedLanguages: Array.from(this._tokenizationSupports.keys()),
        changedColorMap: !0,
      }));
  }
  getColorMap() {
    return this._colorMap;
  }
  getDefaultBackground() {
    return this._colorMap && this._colorMap.length > 2 ? this._colorMap[2] : null;
  }
})();
class R2 extends PO {
  static {
    this._INSTANCE = null;
  }
  static getInstance() {
    return (this._INSTANCE || (this._INSTANCE = new R2()), this._INSTANCE);
  }
  constructor() {
    (super(),
      (this._onDidChange = new QO()),
      (this.onDidChange = this._onDidChange.event),
      this._updateColorMap(),
      this._register(
        I2.onDidChange((e) => {
          e.changedColorMap && this._updateColorMap();
        }),
      ));
  }
  _updateColorMap() {
    const e = I2.getColorMap();
    if (!e) return ((this._colors = [a2.Empty]), void (this._backgroundIsLight = !0));
    this._colors = [a2.Empty];
    for (let n = 1; n < e.length; n++) {
      const t = e[n].rgba;
      this._colors[n] = new a2(t.r, t.g, t.b, Math.round(255 * t.a));
    }
    const t = e[2].getRelativeLuminance();
    ((this._backgroundIsLight = t >= 0.5), this._onDidChange.fire(void 0));
  }
  getColor(e) {
    return ((e < 1 || e >= this._colors.length) && (e = 2), this._colors[e]);
  }
  backgroundIsLight() {
    return this._backgroundIsLight;
  }
}
const O2 = (() => {
  const e = [];
  for (let t = 32; t <= 126; t++) e.push(t);
  return (e.push(65533), e);
})();
class M2 {
  constructor(e, t) {
    ((this.scale = t),
      (this._minimapCharRendererBrand = void 0),
      (this.charDataNormal = M2.soften(e, 0.8)),
      (this.charDataLight = M2.soften(e, 50 / 60)));
  }
  static soften(e, t) {
    const n = new Uint8ClampedArray(e.length);
    for (let i = 0, r = e.length; i < r; i++) n[i] = Lz(e[i] * t);
    return n;
  }
  renderChar(e, t, n, i, r, o, s, a, l, c, d) {
    const u = 1 * this.scale,
      h = 2 * this.scale,
      g = d ? 1 : h;
    if (t + u > e.width || n + g > e.height) return;
    const p = c ? this.charDataLight : this.charDataNormal,
      f = ((e, t) => ((e -= 32) < 0 || e > 96 ? (t <= 2 ? (e + 96) % 96 : 95) : e))(i, l),
      m = 4 * e.width,
      _ = s.r,
      v = s.g,
      b = s.b,
      y = r.r - _,
      x = r.g - v,
      w = r.b - b,
      C = Math.max(o, a),
      S = e.data;
    let k = f * u * h,
      E = n * m + 4 * t;
    for (let N = 0; N < g; N++) {
      let e = E;
      for (let t = 0; t < u; t++) {
        const t = (p[k++] / 255) * (o / 255);
        ((S[e++] = _ + y * t), (S[e++] = v + x * t), (S[e++] = b + w * t), (S[e++] = C));
      }
      E += m;
    }
  }
  blockRenderChar(e, t, n, i, r, o, s, a) {
    const l = 1 * this.scale,
      c = 2 * this.scale,
      d = a ? 1 : c;
    if (t + l > e.width || n + d > e.height) return;
    const u = 4 * e.width,
      h = (r / 255) * 0.5,
      g = o.r,
      p = o.g,
      f = o.b,
      m = g + (i.r - g) * h,
      _ = p + (i.g - p) * h,
      v = f + (i.b - f) * h,
      b = Math.max(r, s),
      y = e.data;
    let x = n * u + 4 * t;
    for (let w = 0; w < d; w++) {
      let e = x;
      for (let t = 0; t < l; t++) ((y[e++] = m), (y[e++] = _), (y[e++] = v), (y[e++] = b));
      x += u;
    }
  }
}
const A2 = {
    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,
  },
  P2 = (e) => {
    const t = new Uint8ClampedArray(e.length / 2);
    for (let n = 0; n < e.length; n += 2) t[n >> 1] = (A2[e[n]] << 4) | (15 & A2[e[n + 1]]);
    return t;
  },
  j2 = {
    1: LO(() =>
      P2(
        "0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792",
      ),
    ),
    2: LO(() =>
      P2(
        "000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126",
      ),
    ),
  };
class F2 {
  static create(e, t) {
    if (this.lastCreated && e === this.lastCreated.scale && t === this.lastFontFamily)
      return this.lastCreated;
    let n;
    return (
      (n = j2[e] ? new M2(j2[e](), e) : F2.createFromSampleData(F2.createSampleData(t).data, e)),
      (this.lastFontFamily = t),
      (this.lastCreated = n),
      n
    );
  }
  static createSampleData(e) {
    const t = document.createElement("canvas"),
      n = t.getContext("2d");
    ((t.style.height = "16px"),
      (t.height = 16),
      (t.width = 960),
      (t.style.width = "960px"),
      (n.fillStyle = "#ffffff"),
      (n.font = `bold 16px ${e}`),
      (n.textBaseline = "middle"));
    let i = 0;
    for (const r of O2) (n.fillText(String.fromCharCode(r), i, 8), (i += 10));
    return n.getImageData(0, 0, 960, 16);
  }
  static createFromSampleData(e, t) {
    if (61440 !== e.length) throw new Error("Unexpected source in MinimapCharRenderer");
    const n = F2._downsample(e, t);
    return new M2(n, t);
  }
  static _downsampleChar(e, t, n, i, r) {
    const o = 1 * r,
      s = 2 * r;
    let a = i,
      l = 0;
    for (let c = 0; c < s; c++) {
      const i = (c / s) * 16,
        r = ((c + 1) / s) * 16;
      for (let s = 0; s < o; s++) {
        const c = (s / o) * 10,
          d = ((s + 1) / o) * 10;
        let u = 0,
          h = 0;
        for (let n = i; n < r; n++) {
          const i = t + 3840 * Math.floor(n),
            r = 1 - (n - Math.floor(n));
          for (let t = c; t < d; t++) {
            const n = 1 - (t - Math.floor(t)),
              o = i + 4 * Math.floor(t),
              s = n * r;
            ((h += s), (u += ((e[o] * e[o + 3]) / 255) * s));
          }
        }
        const g = u / h;
        ((l = Math.max(l, g)), (n[a++] = Lz(g)));
      }
    }
    return l;
  }
  static _downsample(e, t) {
    const n = 2 * t * 1 * t,
      i = 96 * n,
      r = new Uint8ClampedArray(i);
    let o = 0,
      s = 0,
      a = 0;
    for (let l = 0; l < 96; l++)
      ((a = Math.max(a, this._downsampleChar(e, s, r, o, t))), (o += n), (s += 40));
    if (a > 0) {
      const e = 255 / a;
      for (let t = 0; t < i; t++) r[t] *= e;
    }
    return r;
  }
}
const B2 = AR
  ? '"Segoe WPC", "Segoe UI", sans-serif'
  : PR
    ? "-apple-system, BlinkMacSystemFont, sans-serif"
    : 'system-ui, "Ubuntu", "Droid Sans", sans-serif';
class V2 {
  constructor(e, t) {
    ((this._viewModelDecorationBrand = void 0), (this.range = e), (this.options = t));
  }
}
function W2(e, t) {
  return (
    (!t.options.hideInCommentTokens || !H2(e, t)) && (!t.options.hideInStringTokens || !z2(e, t))
  );
}
function H2(e, t) {
  return U2(e, t.range, (e) => 1 === e);
}
function z2(e, t) {
  return U2(e, t.range, (e) => 2 === e);
}
function U2(e, t, n) {
  for (let i = t.startLineNumber; i <= t.endLineNumber; i++) {
    const r = e.tokenization.getLineTokens(i),
      o = i === t.startLineNumber,
      s = i === t.endLineNumber;
    let a = o ? r.findTokenIndexAtOffset(t.startColumn - 1) : 0;
    for (; a < r.getCount(); ) {
      if (s) {
        if (r.getStartOffset(a) > t.endColumn - 1) break;
      }
      if (!n(r.getStandardTokenType(a))) return !1;
      a++;
    }
  }
  return !0;
}
class $2 {
  constructor(e, t, n) {
    const i = e.options,
      r = i.get(163),
      o = i.get(165),
      s = o.minimap,
      a = i.get(59),
      l = i.get(81);
    ((this.renderMinimap = s.renderMinimap),
      (this.size = l.size),
      (this.minimapHeightIsEditorHeight = s.minimapHeightIsEditorHeight),
      (this.scrollBeyondLastLine = i.get(119)),
      (this.paddingTop = i.get(96).top),
      (this.paddingBottom = i.get(96).bottom),
      (this.showSlider = l.showSlider),
      (this.autohide = l.autohide),
      (this.pixelRatio = r),
      (this.typicalHalfwidthCharacterWidth = a.typicalHalfwidthCharacterWidth),
      (this.lineHeight = i.get(75)),
      (this.minimapLeft = s.minimapLeft),
      (this.minimapWidth = s.minimapWidth),
      (this.minimapHeight = o.height),
      (this.canvasInnerWidth = s.minimapCanvasInnerWidth),
      (this.canvasInnerHeight = s.minimapCanvasInnerHeight),
      (this.canvasOuterWidth = s.minimapCanvasOuterWidth),
      (this.canvasOuterHeight = s.minimapCanvasOuterHeight),
      (this.isSampling = s.minimapIsSampling),
      (this.editorHeight = o.height),
      (this.fontScale = s.minimapScale),
      (this.minimapLineHeight = s.minimapLineHeight),
      (this.minimapCharWidth = 1 * this.fontScale),
      (this.sectionHeaderFontFamily = B2),
      (this.sectionHeaderFontSize = l.sectionHeaderFontSize * r),
      (this.sectionHeaderLetterSpacing = l.sectionHeaderLetterSpacing),
      (this.sectionHeaderFontColor = $2._getSectionHeaderColor(t, n.getColor(1))),
      (this.charRenderer = LO(() => F2.create(this.fontScale, a.fontFamily))),
      (this.defaultBackgroundColor = n.getColor(2)),
      (this.backgroundColor = $2._getMinimapBackground(t, this.defaultBackgroundColor)),
      (this.foregroundAlpha = $2._getMinimapForegroundOpacity(t)));
  }
  static _getMinimapBackground(e, t) {
    const n = e.getColor(oY);
    return n ? new a2(n.rgba.r, n.rgba.g, n.rgba.b, Math.round(255 * n.rgba.a)) : t;
  }
  static _getMinimapForegroundOpacity(e) {
    const t = e.getColor(sY);
    return t ? a2._clamp(Math.round(255 * t.rgba.a)) : 255;
  }
  static _getSectionHeaderColor(e, t) {
    const n = e.getColor(ZG);
    return n ? new a2(n.rgba.r, n.rgba.g, n.rgba.b, Math.round(255 * n.rgba.a)) : t;
  }
  equals(e) {
    return (
      this.renderMinimap === e.renderMinimap &&
      this.size === e.size &&
      this.minimapHeightIsEditorHeight === e.minimapHeightIsEditorHeight &&
      this.scrollBeyondLastLine === e.scrollBeyondLastLine &&
      this.paddingTop === e.paddingTop &&
      this.paddingBottom === e.paddingBottom &&
      this.showSlider === e.showSlider &&
      this.autohide === e.autohide &&
      this.pixelRatio === e.pixelRatio &&
      this.typicalHalfwidthCharacterWidth === e.typicalHalfwidthCharacterWidth &&
      this.lineHeight === e.lineHeight &&
      this.minimapLeft === e.minimapLeft &&
      this.minimapWidth === e.minimapWidth &&
      this.minimapHeight === e.minimapHeight &&
      this.canvasInnerWidth === e.canvasInnerWidth &&
      this.canvasInnerHeight === e.canvasInnerHeight &&
      this.canvasOuterWidth === e.canvasOuterWidth &&
      this.canvasOuterHeight === e.canvasOuterHeight &&
      this.isSampling === e.isSampling &&
      this.editorHeight === e.editorHeight &&
      this.fontScale === e.fontScale &&
      this.minimapLineHeight === e.minimapLineHeight &&
      this.minimapCharWidth === e.minimapCharWidth &&
      this.sectionHeaderFontSize === e.sectionHeaderFontSize &&
      this.sectionHeaderLetterSpacing === e.sectionHeaderLetterSpacing &&
      this.defaultBackgroundColor &&
      this.defaultBackgroundColor.equals(e.defaultBackgroundColor) &&
      this.backgroundColor &&
      this.backgroundColor.equals(e.backgroundColor) &&
      this.foregroundAlpha === e.foregroundAlpha
    );
  }
}
class q2 {
  constructor(e, t, n, i, r, o, s, a, l) {
    ((this.scrollTop = e),
      (this.scrollHeight = t),
      (this.sliderNeeded = n),
      (this._computedSliderRatio = i),
      (this.sliderTop = r),
      (this.sliderHeight = o),
      (this.topPaddingLineCount = s),
      (this.startLineNumber = a),
      (this.endLineNumber = l));
  }
  getDesiredScrollTopFromDelta(e) {
    return Math.round(this.scrollTop + e / this._computedSliderRatio);
  }
  getDesiredScrollTopFromTouchLocation(e) {
    return Math.round((e - this.sliderHeight / 2) / this._computedSliderRatio);
  }
  intersectWithViewport(e) {
    const t = Math.max(this.startLineNumber, e.startLineNumber),
      n = Math.min(this.endLineNumber, e.endLineNumber);
    return t > n ? null : [t, n];
  }
  getYForLineNumber(e, t) {
    return +(e - this.startLineNumber + this.topPaddingLineCount) * t;
  }
  static create(e, t, n, i, r, o, s, a, l, c, d) {
    const u = e.pixelRatio,
      h = e.minimapLineHeight,
      g = Math.floor(e.canvasInnerHeight / h),
      p = e.lineHeight;
    if (e.minimapHeightIsEditorHeight) {
      let t = a * e.lineHeight + e.paddingTop + e.paddingBottom;
      e.scrollBeyondLastLine && (t += Math.max(0, r - e.lineHeight - e.paddingBottom));
      const n = Math.max(1, Math.floor((r * r) / t)),
        i = Math.max(0, e.minimapHeight - n),
        o = i / (c - r),
        d = l * o,
        u = i > 0,
        h = Math.floor(e.canvasInnerHeight / e.minimapLineHeight),
        g = Math.floor(e.paddingTop / e.lineHeight);
      return new q2(l, c, u, o, d, n, g, 1, Math.min(s, h));
    }
    let f;
    if (o && n !== s) {
      const e = n - t + 1;
      f = Math.floor((e * h) / u);
    } else {
      const e = r / p;
      f = Math.floor((e * h) / u);
    }
    const m = Math.floor(e.paddingTop / p);
    let _,
      v = Math.floor(e.paddingBottom / p);
    if (e.scrollBeyondLastLine) {
      const e = r / p;
      v = Math.max(v, e - 1);
    }
    if (v > 0) {
      _ = ((m + s + v - r / p - 1) * h) / u;
    } else _ = Math.max(0, ((m + s) * h) / u - f);
    _ = Math.min(e.minimapHeight - f, _);
    const b = _ / (c - r),
      y = l * b;
    if (g >= m + s + v) {
      return new q2(l, c, _ > 0, b, y, f, m, 1, s);
    }
    {
      let n, r;
      n = t > 1 ? t + m : Math.max(1, l / p);
      let o = Math.max(1, Math.floor(n - (y * u) / h));
      (o < m ? ((r = m - o + 1), (o = 1)) : ((r = 0), (o = Math.max(1, o - m))),
        d &&
          d.scrollHeight === c &&
          (d.scrollTop > l &&
            ((o = Math.min(o, d.startLineNumber)), (r = Math.max(r, d.topPaddingLineCount))),
          d.scrollTop < l &&
            ((o = Math.max(o, d.startLineNumber)), (r = Math.min(r, d.topPaddingLineCount)))));
      const a = Math.min(s, o - r + g - 1),
        _ = (l - i) / p;
      let v;
      return (
        (v =
          l >= e.paddingTop ? ((t - o + r + _) * h) / u : ((l / e.paddingTop) * (r + _) * h) / u),
        new q2(l, c, !0, b, v, f, r, o, a)
      );
    }
  }
}
class K2 {
  static {
    this.INVALID = new K2(-1);
  }
  constructor(e) {
    this.dy = e;
  }
  onContentChanged() {
    this.dy = -1;
  }
  onTokensChanged() {
    this.dy = -1;
  }
}
class G2 {
  constructor(e, t, n) {
    ((this.renderedLayout = e),
      (this._imageData = t),
      (this._renderedLines = new YJ({ createLine: () => K2.INVALID })),
      this._renderedLines._set(e.startLineNumber, n));
  }
  linesEquals(e) {
    if (!this.scrollEquals(e)) return !1;
    const t = this._renderedLines._get().lines;
    for (let n = 0, i = t.length; n < i; n++) if (-1 === t[n].dy) return !1;
    return !0;
  }
  scrollEquals(e) {
    return (
      this.renderedLayout.startLineNumber === e.startLineNumber &&
      this.renderedLayout.endLineNumber === e.endLineNumber
    );
  }
  _get() {
    const e = this._renderedLines._get();
    return {
      imageData: this._imageData,
      rendLineNumberStart: e.rendLineNumberStart,
      lines: e.lines,
    };
  }
  onLinesChanged(e, t) {
    return this._renderedLines.onLinesChanged(e, t);
  }
  onLinesDeleted(e, t) {
    this._renderedLines.onLinesDeleted(e, t);
  }
  onLinesInserted(e, t) {
    this._renderedLines.onLinesInserted(e, t);
  }
  onTokensChanged(e) {
    return this._renderedLines.onTokensChanged(e);
  }
}
class Z2 {
  constructor(e, t, n, i) {
    ((this._backgroundFillData = Z2._createBackgroundFillData(t, n, i)),
      (this._buffers = [e.createImageData(t, n), e.createImageData(t, n)]),
      (this._lastUsedBuffer = 0));
  }
  getBuffer() {
    this._lastUsedBuffer = 1 - this._lastUsedBuffer;
    const e = this._buffers[this._lastUsedBuffer];
    return (e.data.set(this._backgroundFillData), e);
  }
  static _createBackgroundFillData(e, t, n) {
    const i = n.r,
      r = n.g,
      o = n.b,
      s = n.a,
      a = new Uint8ClampedArray(e * t * 4);
    let l = 0;
    for (let c = 0; c < t; c++)
      for (let t = 0; t < e; t++)
        ((a[l] = i), (a[l + 1] = r), (a[l + 2] = o), (a[l + 3] = s), (l += 4));
    return a;
  }
}
class Y2 {
  static compute(e, t, n) {
    if (0 === e.renderMinimap || !e.isSampling) return [null, []];
    const { minimapLineCount: i } = SK.computeContainedMinimapLineCount({
        viewLineCount: t,
        scrollBeyondLastLine: e.scrollBeyondLastLine,
        paddingTop: e.paddingTop,
        paddingBottom: e.paddingBottom,
        height: e.editorHeight,
        lineHeight: e.lineHeight,
        pixelRatio: e.pixelRatio,
      }),
      r = t / i,
      o = r / 2;
    if (!n || 0 === n.minimapLines.length) {
      const e = [];
      if (((e[0] = 1), i > 1)) {
        for (let t = 0, n = i - 1; t < n; t++) e[t] = Math.round(t * r + o);
        e[i - 1] = t;
      }
      return [new Y2(r, e), []];
    }
    const s = n.minimapLines,
      a = s.length,
      l = [];
    let c = 0,
      d = 0,
      u = 1;
    let h = [],
      g = null;
    for (let p = 0; p < i; p++) {
      const e = Math.max(u, Math.round(p * r)),
        n = Math.max(e, Math.round((p + 1) * r));
      for (; c < a && s[c] < e; ) {
        if (h.length < 10) {
          const e = c + 1 + d;
          (g && "deleted" === g.type && g._oldIndex === c - 1
            ? g.deleteToLineNumber++
            : ((g = {
                type: "deleted",
                _oldIndex: c,
                deleteFromLineNumber: e,
                deleteToLineNumber: e,
              }),
              h.push(g)),
            d--);
        }
        c++;
      }
      let f;
      if (c < a && s[c] <= n) ((f = s[c]), c++);
      else if (((f = 0 === p ? 1 : p + 1 === i ? t : Math.round(p * r + o)), h.length < 10)) {
        const e = c + 1 + d;
        (g && "inserted" === g.type && g._i === p - 1
          ? g.insertToLineNumber++
          : ((g = { type: "inserted", _i: p, insertFromLineNumber: e, insertToLineNumber: e }),
            h.push(g)),
          d++);
      }
      ((l[p] = f), (u = f));
    }
    if (h.length < 10)
      for (; c < a; ) {
        const e = c + 1 + d;
        (g && "deleted" === g.type && g._oldIndex === c - 1
          ? g.deleteToLineNumber++
          : ((g = {
              type: "deleted",
              _oldIndex: c,
              deleteFromLineNumber: e,
              deleteToLineNumber: e,
            }),
            h.push(g)),
          d--,
          c++);
      }
    else h = [{ type: "flush" }];
    return [new Y2(r, l), h];
  }
  constructor(e, t) {
    ((this.samplingRatio = e), (this.minimapLines = t));
  }
  modelLineToMinimapLine(e) {
    return Math.min(this.minimapLines.length, Math.max(1, Math.round(e / this.samplingRatio)));
  }
  modelLineRangeToMinimapLineRange(e, t) {
    let n = this.modelLineToMinimapLine(e) - 1;
    for (; n > 0 && this.minimapLines[n - 1] >= e; ) n--;
    let i = this.modelLineToMinimapLine(t) - 1;
    for (; i + 1 < this.minimapLines.length && this.minimapLines[i + 1] <= t; ) i++;
    if (n === i) {
      const i = this.minimapLines[n];
      if (i < e || i > t) return null;
    }
    return [n + 1, i + 1];
  }
  decorationLineRangeToMinimapLineRange(e, t) {
    let n = this.modelLineToMinimapLine(e),
      i = this.modelLineToMinimapLine(t);
    return (e !== t && i === n && (i === this.minimapLines.length ? n > 1 && n-- : i++), [n, i]);
  }
  onLinesDeleted(e) {
    const t = e.toLineNumber - e.fromLineNumber + 1;
    let n = this.minimapLines.length,
      i = 0;
    for (
      let r = this.minimapLines.length - 1;
      r >= 0 && !(this.minimapLines[r] < e.fromLineNumber);
      r--
    )
      this.minimapLines[r] <= e.toLineNumber
        ? ((this.minimapLines[r] = Math.max(1, e.fromLineNumber - 1)),
          (n = Math.min(n, r)),
          (i = Math.max(i, r)))
        : (this.minimapLines[r] -= t);
    return [n, i];
  }
  onLinesInserted(e) {
    const t = e.toLineNumber - e.fromLineNumber + 1;
    for (
      let n = this.minimapLines.length - 1;
      n >= 0 && !(this.minimapLines[n] < e.fromLineNumber);
      n--
    )
      this.minimapLines[n] += t;
  }
}
class X2 extends iQ {
  constructor(e) {
    (super(e),
      (this._sectionHeaderCache = new XW(10, 1.5)),
      (this.tokensColorTracker = R2.getInstance()),
      (this._selections = []),
      (this._minimapSelections = null),
      (this.options = new $2(
        this._context.configuration,
        this._context.theme,
        this.tokensColorTracker,
      )));
    const [t] = Y2.compute(this.options, this._context.viewModel.getLineCount(), null);
    ((this._samplingState = t),
      (this._shouldCheckSampling = !1),
      (this._actual = new Q2(e.theme, this)));
  }
  dispose() {
    (this._actual.dispose(), super.dispose());
  }
  getDomNode() {
    return this._actual.getDomNode();
  }
  _onOptionsMaybeChanged() {
    const e = new $2(this._context.configuration, this._context.theme, this.tokensColorTracker);
    return (
      !this.options.equals(e) &&
      ((this.options = e), this._recreateLineSampling(), this._actual.onDidChangeOptions(), !0)
    );
  }
  onConfigurationChanged(e) {
    return this._onOptionsMaybeChanged();
  }
  onCursorStateChanged(e) {
    return (
      (this._selections = e.selections),
      (this._minimapSelections = null),
      this._actual.onSelectionChanged()
    );
  }
  onDecorationsChanged(e) {
    return !!e.affectsMinimap && this._actual.onDecorationsChanged();
  }
  onFlushed(e) {
    return (this._samplingState && (this._shouldCheckSampling = !0), this._actual.onFlushed());
  }
  onLinesChanged(e) {
    if (this._samplingState) {
      const t = this._samplingState.modelLineRangeToMinimapLineRange(
        e.fromLineNumber,
        e.fromLineNumber + e.count - 1,
      );
      return !!t && this._actual.onLinesChanged(t[0], t[1] - t[0] + 1);
    }
    return this._actual.onLinesChanged(e.fromLineNumber, e.count);
  }
  onLinesDeleted(e) {
    if (this._samplingState) {
      const [t, n] = this._samplingState.onLinesDeleted(e);
      return (
        t <= n && this._actual.onLinesChanged(t + 1, n - t + 1),
        (this._shouldCheckSampling = !0),
        !0
      );
    }
    return this._actual.onLinesDeleted(e.fromLineNumber, e.toLineNumber);
  }
  onLinesInserted(e) {
    return this._samplingState
      ? (this._samplingState.onLinesInserted(e), (this._shouldCheckSampling = !0), !0)
      : this._actual.onLinesInserted(e.fromLineNumber, e.toLineNumber);
  }
  onScrollChanged(e) {
    return this._actual.onScrollChanged(e);
  }
  onThemeChanged(e) {
    return (this._actual.onThemeChanged(), this._onOptionsMaybeChanged(), !0);
  }
  onTokensChanged(e) {
    if (this._samplingState) {
      const t = [];
      for (const n of e.ranges) {
        const e = this._samplingState.modelLineRangeToMinimapLineRange(
          n.fromLineNumber,
          n.toLineNumber,
        );
        e && t.push({ fromLineNumber: e[0], toLineNumber: e[1] });
      }
      return !!t.length && this._actual.onTokensChanged(t);
    }
    return this._actual.onTokensChanged(e.ranges);
  }
  onTokensColorsChanged(e) {
    return (this._onOptionsMaybeChanged(), this._actual.onTokensColorsChanged());
  }
  onZonesChanged(e) {
    return this._actual.onZonesChanged();
  }
  prepareRender(e) {
    this._shouldCheckSampling && ((this._shouldCheckSampling = !1), this._recreateLineSampling());
  }
  render(e) {
    let t = e.visibleRange.startLineNumber,
      n = e.visibleRange.endLineNumber;
    this._samplingState &&
      ((t = this._samplingState.modelLineToMinimapLine(t)),
      (n = this._samplingState.modelLineToMinimapLine(n)));
    const i = {
      viewportContainsWhitespaceGaps: e.viewportData.whitespaceViewportData.length > 0,
      scrollWidth: e.scrollWidth,
      scrollHeight: e.scrollHeight,
      viewportStartLineNumber: t,
      viewportEndLineNumber: n,
      viewportStartLineNumberVerticalOffset: e.getVerticalOffsetForLineNumber(t),
      scrollTop: e.scrollTop,
      scrollLeft: e.scrollLeft,
      viewportWidth: e.viewportWidth,
      viewportHeight: e.viewportHeight,
    };
    this._actual.render(i);
  }
  _recreateLineSampling() {
    this._minimapSelections = null;
    const e = Boolean(this._samplingState),
      [t, n] = Y2.compute(
        this.options,
        this._context.viewModel.getLineCount(),
        this._samplingState,
      );
    if (((this._samplingState = t), e && this._samplingState))
      for (const i of n)
        switch (i.type) {
          case "deleted":
            this._actual.onLinesDeleted(i.deleteFromLineNumber, i.deleteToLineNumber);
            break;
          case "inserted":
            this._actual.onLinesInserted(i.insertFromLineNumber, i.insertToLineNumber);
            break;
          case "flush":
            this._actual.onFlushed();
        }
  }
  getLineCount() {
    return this._samplingState
      ? this._samplingState.minimapLines.length
      : this._context.viewModel.getLineCount();
  }
  getRealLineCount() {
    return this._context.viewModel.getLineCount();
  }
  getLineContent(e) {
    return this._samplingState
      ? this._context.viewModel.getLineContent(this._samplingState.minimapLines[e - 1])
      : this._context.viewModel.getLineContent(e);
  }
  getLineMaxColumn(e) {
    return this._samplingState
      ? this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e - 1])
      : this._context.viewModel.getLineMaxColumn(e);
  }
  getMinimapLinesRenderingData(e, t, n) {
    if (this._samplingState) {
      const i = [];
      for (let r = 0, o = t - e + 1; r < o; r++)
        n[r]
          ? (i[r] = this._context.viewModel.getViewLineData(
              this._samplingState.minimapLines[e + r - 1],
            ))
          : (i[r] = null);
      return i;
    }
    return this._context.viewModel.getMinimapLinesRenderingData(e, t, n).data;
  }
  getSelections() {
    if (null === this._minimapSelections)
      if (this._samplingState) {
        this._minimapSelections = [];
        for (const e of this._selections) {
          const [t, n] = this._samplingState.decorationLineRangeToMinimapLineRange(
            e.startLineNumber,
            e.endLineNumber,
          );
          this._minimapSelections.push(new XH(t, e.startColumn, n, e.endColumn));
        }
      } else this._minimapSelections = this._selections;
    return this._minimapSelections;
  }
  getMinimapDecorationsInViewport(e, t) {
    return this._getMinimapDecorationsInViewport(e, t).filter(
      (e) => !e.options.minimap?.sectionHeaderStyle,
    );
  }
  getSectionHeaderDecorationsInViewport(e, t) {
    const n = this.options.sectionHeaderFontSize / this.options.minimapLineHeight;
    return (
      (e = Math.floor(Math.max(1, e - n))),
      this._getMinimapDecorationsInViewport(e, t).filter(
        (e) => !!e.options.minimap?.sectionHeaderStyle,
      )
    );
  }
  _getMinimapDecorationsInViewport(e, t) {
    let n;
    if (this._samplingState) {
      const i = this._samplingState.minimapLines[e - 1],
        r = this._samplingState.minimapLines[t - 1];
      n = new YH(i, 1, r, this._context.viewModel.getLineMaxColumn(r));
    } else n = new YH(e, 1, t, this._context.viewModel.getLineMaxColumn(t));
    const i = this._context.viewModel.getMinimapDecorationsInRange(n);
    if (this._samplingState) {
      const e = [];
      for (const t of i) {
        if (!t.options.minimap) continue;
        const n = t.range,
          i = this._samplingState.modelLineToMinimapLine(n.startLineNumber),
          r = this._samplingState.modelLineToMinimapLine(n.endLineNumber);
        e.push(new V2(new YH(i, n.startColumn, r, n.endColumn), t.options));
      }
      return e;
    }
    return i;
  }
  getSectionHeaderText(e, t) {
    const n = e.options.minimap?.sectionHeaderText;
    if (!n) return null;
    const i = this._sectionHeaderCache.get(n);
    if (i) return i;
    const r = t(n);
    return (this._sectionHeaderCache.set(n, r), r);
  }
  getOptions() {
    return this._context.viewModel.model.getOptions();
  }
  revealLineNumber(e) {
    (this._samplingState && (e = this._samplingState.minimapLines[e - 1]),
      this._context.viewModel.revealRange("mouse", !1, new YH(e, 1, e, 1), 1, 0));
  }
  setScrollTop(e) {
    this._context.viewModel.viewLayout.setScrollPosition({ scrollTop: e }, 1);
  }
}
class Q2 extends PO {
  constructor(e, t) {
    (super(),
      (this._renderDecorations = !1),
      (this._gestureInProgress = !1),
      (this._isMouseOverMinimap = !1),
      (this._theme = e),
      (this._model = t),
      (this._lastRenderData = null),
      (this._buffers = null),
      (this._selectionColor = this._theme.getColor(tY)),
      (this._domNode = Bq(document.createElement("div"))),
      rQ.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 = Bq(document.createElement("div"))),
      this._shadow.setClassName("minimap-shadow-hidden"),
      this._domNode.appendChild(this._shadow),
      (this._canvas = Bq(document.createElement("canvas"))),
      this._canvas.setPosition("absolute"),
      this._canvas.setLeft(0),
      this._domNode.appendChild(this._canvas),
      (this._decorationsCanvas = Bq(document.createElement("canvas"))),
      this._decorationsCanvas.setPosition("absolute"),
      this._decorationsCanvas.setClassName("minimap-decorations-layer"),
      this._decorationsCanvas.setLeft(0),
      this._domNode.appendChild(this._decorationsCanvas),
      (this._slider = Bq(document.createElement("div"))),
      this._slider.setPosition("absolute"),
      this._slider.setClassName("minimap-slider"),
      this._slider.setLayerHinting(!0),
      this._slider.setContain("strict"),
      this._domNode.appendChild(this._slider),
      (this._sliderHorizontal = Bq(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 EM(() => this._hideImmediatelyIfMouseIsOutside(), 500),
      )),
      this._register(
        KF(this._domNode.domNode, DB.MOUSE_OVER, () => {
          this._isMouseOverMinimap = !0;
        }),
      ),
      this._register(
        KF(this._domNode.domNode, DB.MOUSE_LEAVE, () => {
          this._isMouseOverMinimap = !1;
        }),
      ),
      (this._pointerDownListener = KF(this._domNode.domNode, DB.POINTER_DOWN, (e) => {
        e.preventDefault();
        const t = "mouse" === e.pointerType,
          n = 0 === e.button;
        if (0 !== this._model.options.renderMinimap && this._lastRenderData)
          if ("proportional" === this._model.options.size) {
            if (n || !t) {
              const t = this._model.options.minimapLineHeight,
                n =
                  (this._model.options.canvasInnerHeight / this._model.options.canvasOuterHeight) *
                  e.offsetY;
              let i =
                Math.floor(n / t) +
                this._lastRenderData.renderedLayout.startLineNumber -
                this._lastRenderData.renderedLayout.topPaddingLineCount;
              ((i = Math.min(i, this._model.getLineCount())), this._model.revealLineNumber(i));
            }
          } else if (n && this._lastRenderData) {
            const t = aB(this._slider.domNode),
              n = t.top + t.height / 2;
            this._startSliderDragging(e, n, this._lastRenderData.renderedLayout);
          }
      })),
      (this._sliderPointerMoveMonitor = new gG()),
      (this._sliderPointerDownListener = KF(this._slider.domNode, DB.POINTER_DOWN, (e) => {
        (e.preventDefault(),
          e.stopPropagation(),
          0 === e.button &&
            this._lastRenderData &&
            this._startSliderDragging(e, e.pageY, this._lastRenderData.renderedLayout));
      })),
      (this._gestureDisposable = iJ.addTarget(this._domNode.domNode)),
      (this._sliderTouchStartListener = $F(
        this._domNode.domNode,
        nJ.Start,
        (e) => {
          (e.preventDefault(),
            e.stopPropagation(),
            this._lastRenderData &&
              (this._slider.toggleClassName("active", !0),
              (this._gestureInProgress = !0),
              this.scrollDueToTouchEvent(e)));
        },
        { passive: !1 },
      )),
      (this._sliderTouchMoveListener = $F(
        this._domNode.domNode,
        nJ.Change,
        (e) => {
          (e.preventDefault(),
            e.stopPropagation(),
            this._lastRenderData && this._gestureInProgress && this.scrollDueToTouchEvent(e));
        },
        { passive: !1 },
      )),
      (this._sliderTouchEndListener = KF(this._domNode.domNode, nJ.End, (e) => {
        (e.preventDefault(),
          e.stopPropagation(),
          (this._gestureInProgress = !1),
          this._slider.toggleClassName("active", !1));
      })));
  }
  _hideSoon() {
    (this._hideDelayedScheduler.cancel(), this._hideDelayedScheduler.schedule());
  }
  _hideImmediatelyIfMouseIsOutside() {
    this._isMouseOverMinimap ? this._hideSoon() : this._domNode.toggleClassName("active", !1);
  }
  _startSliderDragging(e, t, n) {
    if (!(e.target && e.target instanceof Element)) return;
    const i = e.pageX;
    this._slider.toggleClassName("active", !0);
    const r = (e, r) => {
      const o = aB(this._domNode.domNode),
        s = Math.min(Math.abs(r - i), Math.abs(r - o.left), Math.abs(r - o.left - o.width));
      if (AR && s > 140) return void this._model.setScrollTop(n.scrollTop);
      const a = e - t;
      this._model.setScrollTop(n.getDesiredScrollTopFromDelta(a));
    };
    (e.pageY !== t && r(e.pageY, i),
      this._sliderPointerMoveMonitor.startMonitoring(
        e.target,
        e.pointerId,
        e.buttons,
        (e) => r(e.pageY, e.pageX),
        () => {
          this._slider.toggleClassName("active", !1);
        },
      ));
  }
  scrollDueToTouchEvent(e) {
    const t = this._domNode.domNode.getBoundingClientRect().top,
      n = this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY - t);
    this._model.setScrollTop(n);
  }
  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() {
    const e = ["minimap"];
    return (
      "always" === this._model.options.showSlider
        ? e.push("slider-always")
        : e.push("slider-mouseover"),
      "mouseover" === this._model.options.autohide
        ? e.push("minimap-autohide-mouseover")
        : "scroll" === this._model.options.autohide && e.push("minimap-autohide-scroll"),
      e.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 Z2(
            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 = !0), !0);
  }
  onDecorationsChanged() {
    return ((this._renderDecorations = !0), !0);
  }
  onFlushed() {
    return ((this._lastRenderData = null), !0);
  }
  onLinesChanged(e, t) {
    return !!this._lastRenderData && this._lastRenderData.onLinesChanged(e, t);
  }
  onLinesDeleted(e, t) {
    return (this._lastRenderData?.onLinesDeleted(e, t), !0);
  }
  onLinesInserted(e, t) {
    return (this._lastRenderData?.onLinesInserted(e, t), !0);
  }
  onScrollChanged(e) {
    return (
      "scroll" === this._model.options.autohide &&
        (e.scrollTopChanged || e.scrollHeightChanged) &&
        (this._domNode.toggleClassName("active", !0), this._hideSoon()),
      (this._renderDecorations = !0),
      !0
    );
  }
  onThemeChanged() {
    return ((this._selectionColor = this._theme.getColor(tY)), (this._renderDecorations = !0), !0);
  }
  onTokensChanged(e) {
    return !!this._lastRenderData && this._lastRenderData.onTokensChanged(e);
  }
  onTokensColorsChanged() {
    return ((this._lastRenderData = null), (this._buffers = null), !0);
  }
  onZonesChanged() {
    return ((this._lastRenderData = null), !0);
  }
  render(e) {
    if (0 === this._model.options.renderMinimap)
      return (
        this._shadow.setClassName("minimap-shadow-hidden"),
        this._sliderHorizontal.setWidth(0),
        void this._sliderHorizontal.setHeight(0)
      );
    e.scrollLeft + e.viewportWidth >= e.scrollWidth
      ? this._shadow.setClassName("minimap-shadow-hidden")
      : this._shadow.setClassName("minimap-shadow-visible");
    const t = q2.create(
      this._model.options,
      e.viewportStartLineNumber,
      e.viewportEndLineNumber,
      e.viewportStartLineNumberVerticalOffset,
      e.viewportHeight,
      e.viewportContainsWhitespaceGaps,
      this._model.getLineCount(),
      this._model.getRealLineCount(),
      e.scrollTop,
      e.scrollHeight,
      this._lastRenderData ? this._lastRenderData.renderedLayout : null,
    );
    (this._slider.setDisplay(t.sliderNeeded ? "block" : "none"),
      this._slider.setTop(t.sliderTop),
      this._slider.setHeight(t.sliderHeight),
      this._sliderHorizontal.setLeft(0),
      this._sliderHorizontal.setWidth(this._model.options.minimapWidth),
      this._sliderHorizontal.setTop(0),
      this._sliderHorizontal.setHeight(t.sliderHeight),
      this.renderDecorations(t),
      (this._lastRenderData = this.renderLines(t)));
  }
  renderDecorations(e) {
    if (this._renderDecorations) {
      this._renderDecorations = !1;
      const t = this._model.getSelections();
      t.sort(YH.compareRangesUsingStarts);
      const n = this._model.getMinimapDecorationsInViewport(e.startLineNumber, e.endLineNumber);
      n.sort((e, t) => (e.options.zIndex || 0) - (t.options.zIndex || 0));
      const { canvasInnerWidth: i, canvasInnerHeight: r } = this._model.options,
        o = this._model.options.minimapLineHeight,
        s = this._model.options.minimapCharWidth,
        a = this._model.getOptions().tabSize,
        l = this._decorationsCanvas.domNode.getContext("2d");
      l.clearRect(0, 0, i, r);
      const c = new J2(e.startLineNumber, e.endLineNumber, !1);
      (this._renderSelectionLineHighlights(l, t, c, e, o),
        this._renderDecorationsLineHighlights(l, n, c, e, o));
      const d = new J2(e.startLineNumber, e.endLineNumber, null);
      (this._renderSelectionsHighlights(l, t, d, e, o, a, s, i),
        this._renderDecorationsHighlights(l, n, d, e, o, a, s, i),
        this._renderSectionHeaders(e));
    }
  }
  _renderSelectionLineHighlights(e, t, n, i, r) {
    if (!this._selectionColor || this._selectionColor.isTransparent()) return;
    e.fillStyle = this._selectionColor.transparent(0.5).toString();
    let o = 0,
      s = 0;
    for (const a of t) {
      const t = i.intersectWithViewport(a);
      if (!t) continue;
      const [l, c] = t;
      for (let e = l; e <= c; e++) n.set(e, !0);
      const d = i.getYForLineNumber(l, r),
        u = i.getYForLineNumber(c, r);
      (s >= d || (s > o && e.fillRect(8, o, e.canvas.width, s - o), (o = d)), (s = u));
    }
    s > o && e.fillRect(8, o, e.canvas.width, s - o);
  }
  _renderDecorationsLineHighlights(e, t, n, i, r) {
    const o = new Map();
    for (let s = t.length - 1; s >= 0; s--) {
      const a = t[s],
        l = a.options.minimap;
      if (!l || 1 !== l.position) continue;
      const c = i.intersectWithViewport(a.range);
      if (!c) continue;
      const [d, u] = c,
        h = l.getColor(this._theme.value);
      if (!h || h.isTransparent()) continue;
      let g = o.get(h.toString());
      (g || ((g = h.transparent(0.5).toString()), o.set(h.toString(), g)), (e.fillStyle = g));
      for (let t = d; t <= u; t++) {
        if (n.has(t)) continue;
        n.set(t, !0);
        const o = i.getYForLineNumber(d, r);
        e.fillRect(8, o, e.canvas.width, r);
      }
    }
  }
  _renderSelectionsHighlights(e, t, n, i, r, o, s, a) {
    if (this._selectionColor && !this._selectionColor.isTransparent())
      for (const l of t) {
        const t = i.intersectWithViewport(l);
        if (!t) continue;
        const [c, d] = t;
        for (let u = c; u <= d; u++)
          this.renderDecorationOnLine(e, n, l, this._selectionColor, i, u, r, r, o, s, a);
      }
  }
  _renderDecorationsHighlights(e, t, n, i, r, o, s, a) {
    for (const l of t) {
      const t = l.options.minimap;
      if (!t) continue;
      const c = i.intersectWithViewport(l.range);
      if (!c) continue;
      const [d, u] = c,
        h = t.getColor(this._theme.value);
      if (h && !h.isTransparent())
        for (let g = d; g <= u; g++)
          switch (t.position) {
            case 1:
              this.renderDecorationOnLine(e, n, l.range, h, i, g, r, r, o, s, a);
              continue;
            case 2: {
              const t = i.getYForLineNumber(g, r),
                n = 2;
              this.renderDecoration(e, h, n, t, 2, r);
              continue;
            }
          }
    }
  }
  renderDecorationOnLine(e, t, n, i, r, o, s, a, l, c, d) {
    const u = r.getYForLineNumber(o, a);
    if (u + s < 0 || u > this._model.options.canvasInnerHeight) return;
    const { startLineNumber: h, endLineNumber: g } = n,
      p = h === o ? n.startColumn : 1,
      f = g === o ? n.endColumn : this._model.getLineMaxColumn(o),
      m = this.getXOffsetForPosition(t, o, p, l, c, d),
      _ = this.getXOffsetForPosition(t, o, f, l, c, d);
    this.renderDecoration(e, i, m, u, _ - m, s);
  }
  getXOffsetForPosition(e, t, n, i, r, o) {
    if (1 === n) return 8;
    if ((n - 1) * r >= o) return o;
    let s = e.get(t);
    if (!s) {
      const n = this._model.getLineContent(t);
      s = [8];
      let a = 8;
      for (let e = 1; e < n.length + 1; e++) {
        const t = n.charCodeAt(e - 1),
          l = a + (9 === t ? i * r : kA(t) ? 2 * r : r);
        if (l >= o) {
          s[e] = o;
          break;
        }
        ((s[e] = l), (a = l));
      }
      e.set(t, s);
    }
    return n - 1 < s.length ? s[n - 1] : o;
  }
  renderDecoration(e, t, n, i, r, o) {
    ((e.fillStyle = (t && t.toString()) || ""), e.fillRect(n, i, r, o));
  }
  _renderSectionHeaders(e) {
    const t = this._model.options.minimapLineHeight,
      n = this._model.options.sectionHeaderFontSize,
      i = this._model.options.sectionHeaderLetterSpacing,
      r = 1.5 * n,
      { canvasInnerWidth: o } = this._model.options,
      s = this._model.options.backgroundColor,
      a = `rgb(${s.r} ${s.g} ${s.b} / .7)`,
      l = this._model.options.sectionHeaderFontColor,
      c = `rgb(${l.r} ${l.g} ${l.b})`,
      d = c,
      u = this._decorationsCanvas.domNode.getContext("2d");
    ((u.letterSpacing = i + "px"),
      (u.font = "500 " + n + "px " + this._model.options.sectionHeaderFontFamily),
      (u.strokeStyle = d),
      (u.lineWidth = 0.4));
    const h = this._model.getSectionHeaderDecorationsInViewport(e.startLineNumber, e.endLineNumber);
    h.sort((e, t) => e.range.startLineNumber - t.range.startLineNumber);
    const g = Q2._fitSectionHeader.bind(null, u, o - 8);
    for (const p of h) {
      const i = e.getYForLineNumber(p.range.startLineNumber, t) + n,
        s = i - n,
        l = s + 2,
        d = this._model.getSectionHeaderText(p, g);
      Q2._renderSectionLabel(
        u,
        d,
        2 === p.options.minimap?.sectionHeaderStyle,
        a,
        c,
        o,
        s,
        r,
        i,
        l,
      );
    }
  }
  static _fitSectionHeader(e, t, n) {
    if (!n) return n;
    const i = e.measureText(n).width,
      r = e.measureText("…").width;
    if (i <= t || i <= r) return n;
    const o = n.length,
      s = i / n.length,
      a = Math.floor((t - r) / s) - 1;
    let l = Math.ceil(a / 2);
    for (; l > 0 && /\s/.test(n[l - 1]); ) --l;
    return n.substring(0, l) + "…" + n.substring(o - (a - l));
  }
  static _renderSectionLabel(e, t, n, i, r, o, s, a, l, c) {
    (t && ((e.fillStyle = i), e.fillRect(0, s, o, a), (e.fillStyle = r), e.fillText(t, 8, l)),
      n && (e.beginPath(), e.moveTo(0, c), e.lineTo(o, c), e.closePath(), e.stroke()));
  }
  renderLines(e) {
    const t = e.startLineNumber,
      n = e.endLineNumber,
      i = this._model.options.minimapLineHeight;
    if (this._lastRenderData && this._lastRenderData.linesEquals(e)) {
      const t = this._lastRenderData._get();
      return new G2(e, t.imageData, t.lines);
    }
    const r = this._getBuffer();
    if (!r) return null;
    const [o, s, a] = Q2._renderUntouchedLines(
        r,
        e.topPaddingLineCount,
        t,
        n,
        i,
        this._lastRenderData,
      ),
      l = this._model.getMinimapLinesRenderingData(t, n, a),
      c = this._model.getOptions().tabSize,
      d = this._model.options.defaultBackgroundColor,
      u = this._model.options.backgroundColor,
      h = this._model.options.foregroundAlpha,
      g = this._model.tokensColorTracker,
      p = g.backgroundIsLight(),
      f = this._model.options.renderMinimap,
      m = this._model.options.charRenderer(),
      _ = this._model.options.fontScale,
      v = this._model.options.minimapCharWidth,
      b = (1 === f ? 2 : 3) * _,
      y = i > b ? Math.floor((i - b) / 2) : 0,
      x = u.a / 255,
      w = new a2(
        Math.round((u.r - d.r) * x + d.r),
        Math.round((u.g - d.g) * x + d.g),
        Math.round((u.b - d.b) * x + d.b),
        255,
      );
    let C = e.topPaddingLineCount * i;
    const S = [];
    for (let N = 0, L = n - t + 1; N < L; N++)
      (a[N] && Q2._renderLine(r, w, u.a, p, f, v, g, h, m, C, y, c, l[N], _, i),
        (S[N] = new K2(C)),
        (C += i));
    const k = -1 === o ? 0 : o,
      E = (-1 === s ? r.height : s) - k;
    return (
      this._canvas.domNode.getContext("2d").putImageData(r, 0, 0, 0, k, r.width, E),
      new G2(e, r, S)
    );
  }
  static _renderUntouchedLines(e, t, n, i, r, o) {
    const s = [];
    if (!o) {
      for (let e = 0, t = i - n + 1; e < t; e++) s[e] = !0;
      return [-1, -1, s];
    }
    const a = o._get(),
      l = a.imageData.data,
      c = a.rendLineNumberStart,
      d = a.lines,
      u = d.length,
      h = e.width,
      g = e.data,
      p = (i - n + 1) * r * h * 4;
    let f = -1,
      m = -1,
      _ = -1,
      v = -1,
      b = -1,
      y = -1,
      x = t * r;
    for (let w = n; w <= i; w++) {
      const e = w - n,
        t = w - c,
        i = t >= 0 && t < u ? d[t].dy : -1;
      if (-1 === i) {
        ((s[e] = !0), (x += r));
        continue;
      }
      const o = i * h * 4,
        a = (i + r) * h * 4,
        C = x * h * 4,
        S = (x + r) * h * 4;
      (v === o && y === C
        ? ((v = a), (y = S))
        : (-1 !== _ &&
            (g.set(l.subarray(_, v), b),
            -1 === f && 0 === _ && _ === b && (f = v),
            -1 === m && v === p && _ === b && (m = _)),
          (_ = o),
          (v = a),
          (b = C),
          (y = S)),
        (s[e] = !1),
        (x += r));
    }
    -1 !== _ &&
      (g.set(l.subarray(_, v), b),
      -1 === f && 0 === _ && _ === b && (f = v),
      -1 === m && v === p && _ === b && (m = _));
    return [-1 === f ? -1 : f / (4 * h), -1 === m ? -1 : m / (4 * h), s];
  }
  static _renderLine(e, t, n, i, r, o, s, a, l, c, d, u, h, g, p) {
    const f = h.content,
      m = h.tokens,
      _ = e.width - o,
      v = 1 === p;
    let b = 8,
      y = 0,
      x = 0;
    for (let w = 0, C = m.getCount(); w < C; w++) {
      const h = m.getEndOffset(w),
        p = m.getForeground(w),
        C = s.getColor(p);
      for (; y < h; y++) {
        if (b > _) return;
        const s = f.charCodeAt(y);
        if (9 === s) {
          const e = u - ((y + x) % u);
          ((x += e - 1), (b += e * o));
        } else if (32 === s) b += o;
        else {
          const u = kA(s) ? 2 : 1;
          for (let h = 0; h < u; h++)
            if (
              (2 === r
                ? l.blockRenderChar(e, b, c + d, C, a, t, n, v)
                : l.renderChar(e, b, c + d, s, C, a, t, n, g, i, v),
              (b += o),
              b > _)
            )
              return;
        }
      }
    }
  }
}
class J2 {
  constructor(e, t, n) {
    ((this._startLineNumber = e),
      (this._endLineNumber = t),
      (this._defaultValue = n),
      (this._values = []));
    for (let i = 0, r = this._endLineNumber - this._startLineNumber + 1; i < r; i++)
      this._values[i] = n;
  }
  has(e) {
    return this.get(e) !== this._defaultValue;
  }
  set(e, t) {
    e < this._startLineNumber ||
      e > this._endLineNumber ||
      (this._values[e - this._startLineNumber] = t);
  }
  get(e) {
    return e < this._startLineNumber || e > this._endLineNumber
      ? this._defaultValue
      : this._values[e - this._startLineNumber];
  }
}
class e4 extends iQ {
  constructor(e, t) {
    (super(e), (this._viewDomNode = t));
    const n = this._context.configuration.options.get(165);
    ((this._widgets = {}),
      (this._verticalScrollbarWidth = n.verticalScrollbarWidth),
      (this._minimapWidth = n.minimap.minimapWidth),
      (this._horizontalScrollbarHeight = n.horizontalScrollbarHeight),
      (this._editorHeight = n.height),
      (this._editorWidth = n.width),
      (this._viewDomNodeRect = { top: 0, left: 0, width: 0, height: 0 }),
      (this._domNode = Bq(document.createElement("div"))),
      rQ.write(this._domNode, 4),
      this._domNode.setClassName("overlayWidgets"),
      (this.overflowingOverlayWidgetsDomNode = Bq(document.createElement("div"))),
      rQ.write(this.overflowingOverlayWidgetsDomNode, 5),
      this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets"));
  }
  dispose() {
    (super.dispose(), (this._widgets = {}));
  }
  getDomNode() {
    return this._domNode;
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options.get(165);
    return (
      (this._verticalScrollbarWidth = t.verticalScrollbarWidth),
      (this._minimapWidth = t.minimap.minimapWidth),
      (this._horizontalScrollbarHeight = t.horizontalScrollbarHeight),
      (this._editorHeight = t.height),
      (this._editorWidth = t.width),
      !0
    );
  }
  _widgetCanOverflow(e) {
    const t = this._context.configuration.options.get(4);
    return !!e.allowEditorOverflow && t;
  }
  addWidget(e) {
    const t = Bq(e.getDomNode());
    ((this._widgets[e.getId()] = { widget: e, preference: null, domNode: t }),
      t.setPosition("absolute"),
      t.setAttribute("widgetId", e.getId()),
      this._widgetCanOverflow(e)
        ? this.overflowingOverlayWidgetsDomNode.appendChild(t)
        : this._domNode.appendChild(t),
      this.setShouldRender(),
      this._updateMaxMinWidth());
  }
  setWidgetPosition(e, t) {
    const n = this._widgets[e.getId()],
      i = t ? t.preference : null,
      r = t?.stackOridinal;
    return n.preference === i && n.stack === r
      ? (this._updateMaxMinWidth(), !1)
      : ((n.preference = i), (n.stack = r), this.setShouldRender(), this._updateMaxMinWidth(), !0);
  }
  removeWidget(e) {
    const t = e.getId();
    if (this._widgets.hasOwnProperty(t)) {
      const e = this._widgets[t].domNode.domNode;
      (delete this._widgets[t], e.remove(), this.setShouldRender(), this._updateMaxMinWidth());
    }
  }
  _updateMaxMinWidth() {
    let e = 0;
    const t = Object.keys(this._widgets);
    for (let n = 0, i = t.length; n < i; n++) {
      const i = t[n],
        r = this._widgets[i],
        o = r.widget.getMinContentWidthInPx?.();
      void 0 !== o && (e = Math.max(e, o));
    }
    this._context.viewLayout.setOverlayWidgetsMinWidth(e);
  }
  _renderWidget(e, t) {
    const n = e.domNode;
    if (null === e.preference) return void n.setTop("");
    const i = 2 * this._verticalScrollbarWidth + this._minimapWidth;
    if (0 === e.preference || 1 === e.preference) {
      if (1 === e.preference) {
        const e = n.domNode.clientHeight;
        n.setTop(this._editorHeight - e - 2 * this._horizontalScrollbarHeight);
      } else n.setTop(0);
      void 0 !== e.stack
        ? (n.setTop(t[e.preference]), (t[e.preference] += n.domNode.clientWidth))
        : n.setRight(i);
    } else if (2 === e.preference)
      ((n.domNode.style.right = "50%"),
        void 0 !== e.stack ? (n.setTop(t[2]), (t[2] += n.domNode.clientHeight)) : n.setTop(0));
    else {
      const { top: t, left: i } = e.preference;
      if (this._context.configuration.options.get(51) && this._widgetCanOverflow(e.widget)) {
        const e = this._viewDomNodeRect;
        (n.setTop(t + e.top), n.setLeft(i + e.left), n.setPosition("fixed"));
      } else (n.setTop(t), n.setLeft(i), n.setPosition("absolute"));
    }
  }
  prepareRender(e) {
    this._viewDomNodeRect = aB(this._viewDomNode.domNode);
  }
  render(e) {
    this._domNode.setWidth(this._editorWidth);
    const t = Object.keys(this._widgets),
      n = Array.from({ length: 3 }, () => 0);
    t.sort((e, t) => (this._widgets[e].stack || 0) - (this._widgets[t].stack || 0));
    for (let i = 0, r = t.length; i < r; i++) {
      const e = t[i];
      this._renderWidget(this._widgets[e], n);
    }
  }
}
let t4 = class {
  constructor(e, t, n, i) {
    ((this._viewportBrand = void 0),
      (this.top = 0 | e),
      (this.left = 0 | t),
      (this.width = 0 | n),
      (this.height = 0 | i));
  }
};
class n4 {
  constructor(e, t) {
    ((this.tabSize = e), (this.data = t));
  }
}
class i4 {
  constructor(e, t, n, i, r, o, s) {
    ((this._viewLineDataBrand = void 0),
      (this.content = e),
      (this.continuesWithWrappedLine = t),
      (this.minColumn = n),
      (this.maxColumn = i),
      (this.startVisibleColumn = r),
      (this.tokens = o),
      (this.inlineDecorations = s));
  }
}
class r4 {
  constructor(e, t, n, i, r, o, s, a, l, c, d, u) {
    ((this.minColumn = e),
      (this.maxColumn = t),
      (this.content = n),
      (this.continuesWithWrappedLine = i),
      (this.isBasicASCII = r4.isBasicASCII(n, o)),
      (this.containsRTL = r4.containsRTL(n, this.isBasicASCII, r)),
      (this.tokens = s),
      (this.inlineDecorations = a),
      (this.tabSize = l),
      (this.startVisibleColumn = c),
      (this.textDirection = d),
      (this.hasVariableFonts = u));
  }
  static isBasicASCII(e, t) {
    return !t || wA(e);
  }
  static containsRTL(e, t, n) {
    return !(t || !n) && yA(e);
  }
}
class o4 {
  constructor(e, t, n) {
    ((this.color = e), (this.zIndex = t), (this.data = n));
  }
  static compareByRenderingProps(e, t) {
    return e.zIndex === t.zIndex
      ? e.color < t.color
        ? -1
        : e.color > t.color
          ? 1
          : 0
      : e.zIndex - t.zIndex;
  }
  static equals(e, t) {
    return e.color === t.color && e.zIndex === t.zIndex && XP(e.data, t.data);
  }
  static equalsArr(e, t) {
    return XP(e, t, o4.equals);
  }
}
let s4 = class {
  constructor(e, t) {
    const n = e.options;
    ((this.lineHeight = n.get(75)),
      (this.pixelRatio = n.get(163)),
      (this.overviewRulerLanes = n.get(95)),
      (this.renderBorder = n.get(94)));
    const i = t.getColor(q0);
    ((this.borderColor = i ? i.toString() : null), (this.hideCursor = n.get(68)));
    const r = t.getColor(x0);
    this.cursorColorSingle = r ? r.transparent(0.7).toString() : null;
    const o = t.getColor(C0);
    this.cursorColorPrimary = o ? o.transparent(0.7).toString() : null;
    const s = t.getColor(k0);
    ((this.cursorColorSecondary = s ? s.transparent(0.7).toString() : null),
      (this.themeType = t.type));
    const a = n.get(81),
      l = a.enabled,
      c = a.side,
      d = t.getColor(K0),
      u = I2.getDefaultBackground();
    this.backgroundColor = d || (l && "right" === c ? u : null);
    const h = n.get(165).overviewRuler;
    ((this.top = h.top),
      (this.right = h.right),
      (this.domWidth = h.width),
      (this.domHeight = h.height),
      0 === this.overviewRulerLanes
        ? ((this.canvasWidth = 0), (this.canvasHeight = 0))
        : ((this.canvasWidth = (this.domWidth * this.pixelRatio) | 0),
          (this.canvasHeight = (this.domHeight * this.pixelRatio) | 0)));
    const [g, p] = this._initLanes(1, this.canvasWidth, this.overviewRulerLanes);
    ((this.x = g), (this.w = p));
  }
  _initLanes(e, t, n) {
    const i = t - e;
    if (n >= 3) {
      const t = Math.floor(i / 3),
        n = Math.floor(i / 3),
        r = i - t - n,
        o = e + t;
      return [
        [0, e, o, e, e + t + r, e, o, e],
        [0, t, r, t + r, n, t + r + n, r + n, t + r + n],
      ];
    }
    if (2 === n) {
      const t = Math.floor(i / 2),
        n = i - t;
      return [
        [0, e, e, e, e + t, e, e, e],
        [0, t, t, t, n, t + n, t + n, t + n],
      ];
    }
    return [
      [0, e, e, e, e, e, e, e],
      [0, i, i, i, i, i, i, i],
    ];
  }
  equals(e) {
    return (
      this.lineHeight === e.lineHeight &&
      this.pixelRatio === e.pixelRatio &&
      this.overviewRulerLanes === e.overviewRulerLanes &&
      this.renderBorder === e.renderBorder &&
      this.borderColor === e.borderColor &&
      this.hideCursor === e.hideCursor &&
      this.cursorColorSingle === e.cursorColorSingle &&
      this.cursorColorPrimary === e.cursorColorPrimary &&
      this.cursorColorSecondary === e.cursorColorSecondary &&
      this.themeType === e.themeType &&
      vG.equals(this.backgroundColor, e.backgroundColor) &&
      this.top === e.top &&
      this.right === e.right &&
      this.domWidth === e.domWidth &&
      this.domHeight === e.domHeight &&
      this.canvasWidth === e.canvasWidth &&
      this.canvasHeight === e.canvasHeight
    );
  }
};
class a4 extends iQ {
  constructor(e) {
    (super(e),
      (this._actualShouldRender = 0),
      (this._renderedDecorations = []),
      (this._renderedCursorPositions = []),
      (this._domNode = Bq(document.createElement("canvas"))),
      this._domNode.setClassName("decorationsOverviewRuler"),
      this._domNode.setPosition("absolute"),
      this._domNode.setLayerHinting(!0),
      this._domNode.setContain("strict"),
      this._domNode.setAttribute("aria-hidden", "true"),
      this._updateSettings(!1),
      (this._tokensColorTrackerListener = I2.onDidChange((e) => {
        e.changedColorMap && this._updateSettings(!0);
      })),
      (this._cursorPositions = [
        { position: new xV(1, 1), color: this._settings.cursorColorSingle },
      ]));
  }
  dispose() {
    (super.dispose(), this._tokensColorTrackerListener.dispose());
  }
  _updateSettings(e) {
    const t = new s4(this._context.configuration, this._context.theme);
    return (
      (!this._settings || !this._settings.equals(t)) &&
      ((this._settings = t),
      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),
      e && this._render(),
      !0)
    );
  }
  _markRenderingIsNeeded() {
    return ((this._actualShouldRender = 2), !0);
  }
  _markRenderingIsMaybeNeeded() {
    return ((this._actualShouldRender = 1), !0);
  }
  onConfigurationChanged(e) {
    return !!this._updateSettings(!1) && this._markRenderingIsNeeded();
  }
  onCursorStateChanged(e) {
    this._cursorPositions = [];
    for (let t = 0, n = e.selections.length; t < n; t++) {
      let i = this._settings.cursorColorSingle;
      (n > 1 &&
        (i = 0 === t ? this._settings.cursorColorPrimary : this._settings.cursorColorSecondary),
        this._cursorPositions.push({ position: e.selections[t].getPosition(), color: i }));
    }
    return (
      this._cursorPositions.sort((e, t) => xV.compare(e.position, t.position)),
      this._markRenderingIsMaybeNeeded()
    );
  }
  onDecorationsChanged(e) {
    return !!e.affectsOverviewRuler && this._markRenderingIsMaybeNeeded();
  }
  onFlushed(e) {
    return this._markRenderingIsNeeded();
  }
  onScrollChanged(e) {
    return !!e.scrollHeightChanged && this._markRenderingIsNeeded();
  }
  onZonesChanged(e) {
    return this._markRenderingIsNeeded();
  }
  onThemeChanged(e) {
    return !!this._updateSettings(!1) && this._markRenderingIsNeeded();
  }
  getDomNode() {
    return this._domNode.domNode;
  }
  prepareRender(e) {}
  render(e) {
    (this._render(), (this._actualShouldRender = 0));
  }
  _render() {
    const e = this._settings.backgroundColor;
    if (0 === this._settings.overviewRulerLanes)
      return (
        this._domNode.setBackgroundColor(e ? vG.Format.CSS.formatHexA(e) : ""),
        void this._domNode.setDisplay("none")
      );
    const t = this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);
    if (
      (t.sort(o4.compareByRenderingProps),
      1 !== this._actualShouldRender ||
        o4.equalsArr(this._renderedDecorations, t) ||
        (this._actualShouldRender = 2),
      1 !== this._actualShouldRender ||
        XP(
          this._renderedCursorPositions,
          this._cursorPositions,
          (e, t) => e.position.lineNumber === t.position.lineNumber && e.color === t.color,
        ) ||
        (this._actualShouldRender = 2),
      1 === this._actualShouldRender)
    )
      return;
    ((this._renderedDecorations = t),
      (this._renderedCursorPositions = this._cursorPositions),
      this._domNode.setDisplay("block"));
    const n = this._settings.canvasWidth,
      i = this._settings.canvasHeight,
      r = this._settings.lineHeight,
      o = this._context.viewLayout,
      s = i / this._context.viewLayout.getScrollHeight(),
      a = (6 * this._settings.pixelRatio) | 0,
      l = (a / 2) | 0,
      c = this._domNode.domNode.getContext("2d");
    e
      ? e.isOpaque()
        ? ((c.fillStyle = vG.Format.CSS.formatHexA(e)), c.fillRect(0, 0, n, i))
        : (c.clearRect(0, 0, n, i),
          (c.fillStyle = vG.Format.CSS.formatHexA(e)),
          c.fillRect(0, 0, n, i))
      : c.clearRect(0, 0, n, i);
    const d = this._settings.x,
      u = this._settings.w;
    for (const h of t) {
      const e = h.color,
        t = h.data;
      c.fillStyle = e;
      let n = 0,
        g = 0,
        p = 0;
      for (let h = 0, f = t.length / 3; h < f; h++) {
        const e = t[3 * h],
          f = t[3 * h + 1],
          m = t[3 * h + 2];
        let _ = (o.getVerticalOffsetForLineNumber(f) * s) | 0,
          v = ((o.getVerticalOffsetForLineNumber(m) + r) * s) | 0;
        if (v - _ < a) {
          let e = ((_ + v) / 2) | 0;
          (e < l ? (e = l) : e + l > i && (e = i - l), (_ = e - l), (v = e + l));
        }
        _ > p + 1 || e !== n
          ? (0 !== h && c.fillRect(d[n], g, u[n], p - g), (n = e), (g = _), (p = v))
          : v > p && (p = v);
      }
      c.fillRect(d[n], g, u[n], p - g);
    }
    if (!this._settings.hideCursor) {
      const e = (2 * this._settings.pixelRatio) | 0,
        t = (e / 2) | 0,
        n = this._settings.x[7],
        r = this._settings.w[7];
      let a = -100,
        l = -100,
        d = null;
      for (let u = 0, h = this._cursorPositions.length; u < h; u++) {
        const h = this._cursorPositions[u].color;
        if (!h) continue;
        const g = this._cursorPositions[u].position;
        let p = (o.getVerticalOffsetForLineNumber(g.lineNumber) * s) | 0;
        p < t ? (p = t) : p + t > i && (p = i - t);
        const f = p - t,
          m = f + e;
        (f > l + 1 || h !== d
          ? (0 !== u && d && c.fillRect(n, a, r, l - a), (a = f), (l = m))
          : m > l && (l = m),
          (d = h),
          (c.fillStyle = h));
      }
      d && c.fillRect(n, a, r, l - a);
    }
    this._settings.renderBorder &&
      this._settings.borderColor &&
      this._settings.overviewRulerLanes > 0 &&
      (c.beginPath(),
      (c.lineWidth = 1),
      (c.strokeStyle = this._settings.borderColor),
      c.moveTo(0, 0),
      c.lineTo(0, i),
      c.moveTo(1, 0),
      c.lineTo(n, 0),
      c.stroke());
  }
}
class l4 {
  constructor(e, t, n) {
    ((this._colorZoneBrand = void 0),
      (this.from = 0 | e),
      (this.to = 0 | t),
      (this.colorId = 0 | n));
  }
  static compare(e, t) {
    return e.colorId === t.colorId
      ? e.from === t.from
        ? e.to - t.to
        : e.from - t.from
      : e.colorId - t.colorId;
  }
}
class c4 {
  constructor(e, t, n, i) {
    ((this._overviewRulerZoneBrand = void 0),
      (this.startLineNumber = e),
      (this.endLineNumber = t),
      (this.heightInLines = n),
      (this.color = i),
      (this._colorZone = null));
  }
  static compare(e, t) {
    return e.color === t.color
      ? e.startLineNumber === t.startLineNumber
        ? e.heightInLines === t.heightInLines
          ? e.endLineNumber - t.endLineNumber
          : e.heightInLines - t.heightInLines
        : e.startLineNumber - t.startLineNumber
      : e.color < t.color
        ? -1
        : 1;
  }
  setColorZone(e) {
    this._colorZone = e;
  }
  getColorZones() {
    return this._colorZone;
  }
}
class d4 {
  constructor(e) {
    ((this._getVerticalOffsetForLine = e),
      (this._zones = []),
      (this._colorZonesInvalid = !1),
      (this._lineHeight = 0),
      (this._domWidth = 0),
      (this._domHeight = 0),
      (this._outerHeight = 0),
      (this._pixelRatio = 1),
      (this._lastAssignedId = 0),
      (this._color2Id = Object.create(null)),
      (this._id2Color = []));
  }
  getId2Color() {
    return this._id2Color;
  }
  setZones(e) {
    ((this._zones = e), this._zones.sort(c4.compare));
  }
  setLineHeight(e) {
    return this._lineHeight !== e && ((this._lineHeight = e), (this._colorZonesInvalid = !0), !0);
  }
  setPixelRatio(e) {
    ((this._pixelRatio = e), (this._colorZonesInvalid = !0));
  }
  getDOMWidth() {
    return this._domWidth;
  }
  getCanvasWidth() {
    return this._domWidth * this._pixelRatio;
  }
  setDOMWidth(e) {
    return this._domWidth !== e && ((this._domWidth = e), (this._colorZonesInvalid = !0), !0);
  }
  getDOMHeight() {
    return this._domHeight;
  }
  getCanvasHeight() {
    return this._domHeight * this._pixelRatio;
  }
  setDOMHeight(e) {
    return this._domHeight !== e && ((this._domHeight = e), (this._colorZonesInvalid = !0), !0);
  }
  getOuterHeight() {
    return this._outerHeight;
  }
  setOuterHeight(e) {
    return this._outerHeight !== e && ((this._outerHeight = e), (this._colorZonesInvalid = !0), !0);
  }
  resolveColorZones() {
    const e = this._colorZonesInvalid,
      t = Math.floor(this._lineHeight),
      n = Math.floor(this.getCanvasHeight()),
      i = n / Math.floor(this._outerHeight),
      r = Math.floor((4 * this._pixelRatio) / 2),
      o = [];
    for (let s = 0, a = this._zones.length; s < a; s++) {
      const a = this._zones[s];
      if (!e) {
        const e = a.getColorZones();
        if (e) {
          o.push(e);
          continue;
        }
      }
      const l = this._getVerticalOffsetForLine(a.startLineNumber),
        c =
          0 === a.heightInLines
            ? this._getVerticalOffsetForLine(a.endLineNumber) + t
            : l + a.heightInLines * t,
        d = Math.floor(i * l),
        u = Math.floor(i * c);
      let h = Math.floor((d + u) / 2),
        g = u - h;
      (g < r && (g = r), h - g < 0 && (h = g), h + g > n && (h = n - g));
      const p = a.color;
      let f = this._color2Id[p];
      f || ((f = ++this._lastAssignedId), (this._color2Id[p] = f), (this._id2Color[f] = p));
      const m = new l4(h - g, h + g, f);
      (a.setColorZone(m), o.push(m));
    }
    return ((this._colorZonesInvalid = !1), o.sort(l4.compare), o);
  }
}
class u4 extends nQ {
  constructor(e, t) {
    (super(), (this._context = e));
    const n = this._context.configuration.options;
    ((this._domNode = Bq(document.createElement("canvas"))),
      this._domNode.setClassName(t),
      this._domNode.setPosition("absolute"),
      this._domNode.setLayerHinting(!0),
      this._domNode.setContain("strict"),
      (this._zoneManager = new d4((e) =>
        this._context.viewLayout.getVerticalOffsetForLineNumber(e),
      )),
      this._zoneManager.setDOMWidth(0),
      this._zoneManager.setDOMHeight(0),
      this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),
      this._zoneManager.setLineHeight(n.get(75)),
      this._zoneManager.setPixelRatio(n.get(163)),
      this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), super.dispose());
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    return (
      e.hasChanged(75) && (this._zoneManager.setLineHeight(t.get(75)), this._render()),
      e.hasChanged(163) &&
        (this._zoneManager.setPixelRatio(t.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()),
      !0
    );
  }
  onFlushed(e) {
    return (this._render(), !0);
  }
  onScrollChanged(e) {
    return (
      e.scrollHeightChanged && (this._zoneManager.setOuterHeight(e.scrollHeight), this._render()),
      !0
    );
  }
  onZonesChanged(e) {
    return (this._render(), !0);
  }
  getDomNode() {
    return this._domNode.domNode;
  }
  setLayout(e) {
    (this._domNode.setTop(e.top), this._domNode.setRight(e.right));
    let t = !1;
    ((t = this._zoneManager.setDOMWidth(e.width) || t),
      (t = this._zoneManager.setDOMHeight(e.height) || t),
      t &&
        (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(e) {
    (this._zoneManager.setZones(e), this._render());
  }
  _render() {
    if (0 === this._zoneManager.getOuterHeight()) return !1;
    const e = this._zoneManager.getCanvasWidth(),
      t = this._zoneManager.getCanvasHeight(),
      n = this._zoneManager.resolveColorZones(),
      i = this._zoneManager.getId2Color(),
      r = this._domNode.domNode.getContext("2d");
    return (r.clearRect(0, 0, e, t), n.length > 0 && this._renderOneLane(r, n, i, e), !0);
  }
  _renderOneLane(e, t, n, i) {
    let r = 0,
      o = 0,
      s = 0;
    for (const a of t) {
      const t = a.colorId,
        l = a.from,
        c = a.to;
      t !== r
        ? (e.fillRect(0, o, i, s - o), (r = t), (e.fillStyle = n[r]), (o = l), (s = c))
        : s >= l
          ? (s = Math.max(s, c))
          : (e.fillRect(0, o, i, s - o), (o = l), (s = c));
    }
    e.fillRect(0, o, i, s - o);
  }
}
class h4 extends iQ {
  constructor(e) {
    (super(e),
      (this.domNode = Bq(document.createElement("div"))),
      this.domNode.setAttribute("role", "presentation"),
      this.domNode.setAttribute("aria-hidden", "true"),
      this.domNode.setClassName("view-rulers"),
      (this._renderedRulers = []));
    const t = this._context.configuration.options;
    ((this._rulers = t.get(116)),
      (this._typicalHalfwidthCharacterWidth = t.get(59).typicalHalfwidthCharacterWidth));
  }
  dispose() {
    super.dispose();
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    return (
      (this._rulers = t.get(116)),
      (this._typicalHalfwidthCharacterWidth = t.get(59).typicalHalfwidthCharacterWidth),
      !0
    );
  }
  onScrollChanged(e) {
    return e.scrollHeightChanged;
  }
  prepareRender(e) {}
  _ensureRulersCount() {
    const e = this._renderedRulers.length,
      t = this._rulers.length;
    if (e === t) return;
    if (e < t) {
      const { tabSize: n } = this._context.viewModel.model.getOptions(),
        i = n;
      let r = t - e;
      for (; r > 0; ) {
        const e = Bq(document.createElement("div"));
        (e.setClassName("view-ruler"),
          e.setWidth(i),
          this.domNode.appendChild(e),
          this._renderedRulers.push(e),
          r--);
      }
      return;
    }
    let n = e - t;
    for (; n > 0; ) {
      const e = this._renderedRulers.pop();
      (this.domNode.removeChild(e), n--);
    }
  }
  render(e) {
    this._ensureRulersCount();
    for (let t = 0, n = this._rulers.length; t < n; t++) {
      const n = this._renderedRulers[t],
        i = this._rulers[t];
      (n.setBoxShadow(i.color ? `1px 0 0 0 ${i.color} inset` : ""),
        n.setHeight(Math.min(e.scrollHeight, 1e6)),
        n.setLeft(i.column * this._typicalHalfwidthCharacterWidth));
    }
  }
}
class g4 extends iQ {
  constructor(e) {
    (super(e),
      (this._scrollTop = 0),
      (this._width = 0),
      this._updateWidth(),
      (this._shouldShow = !1));
    const t = this._context.configuration.options.get(117);
    ((this._useShadows = t.useShadows),
      (this._domNode = Bq(document.createElement("div"))),
      this._domNode.setAttribute("role", "presentation"),
      this._domNode.setAttribute("aria-hidden", "true"));
  }
  dispose() {
    super.dispose();
  }
  _updateShouldShow() {
    const e = this._useShadows && this._scrollTop > 0;
    return this._shouldShow !== e && ((this._shouldShow = e), !0);
  }
  getDomNode() {
    return this._domNode;
  }
  _updateWidth() {
    const e = this._context.configuration.options.get(165);
    0 === e.minimap.renderMinimap || (e.minimap.minimapWidth > 0 && 0 === e.minimap.minimapLeft)
      ? (this._width = e.width)
      : (this._width = e.width - e.verticalScrollbarWidth);
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options.get(117);
    return ((this._useShadows = t.useShadows), this._updateWidth(), this._updateShouldShow(), !0);
  }
  onScrollChanged(e) {
    return ((this._scrollTop = e.scrollTop), this._updateShouldShow());
  }
  prepareRender(e) {}
  render(e) {
    (this._domNode.setWidth(this._width),
      this._domNode.setClassName(this._shouldShow ? "scroll-decoration" : ""));
  }
}
class p4 {
  constructor(e) {
    ((this.left = e.left),
      (this.width = e.width),
      (this.startStyle = null),
      (this.endStyle = null));
  }
}
class f4 {
  constructor(e, t) {
    ((this.lineNumber = e), (this.ranges = t));
  }
}
function m4(e) {
  return new p4(e);
}
function _4(e) {
  return new f4(e.lineNumber, e.ranges.map(m4));
}
class v4 extends u0 {
  static {
    this.SELECTION_CLASS_NAME = "selected-text";
  }
  static {
    this.SELECTION_TOP_LEFT = "top-left-radius";
  }
  static {
    this.SELECTION_BOTTOM_LEFT = "bottom-left-radius";
  }
  static {
    this.SELECTION_TOP_RIGHT = "top-right-radius";
  }
  static {
    this.SELECTION_BOTTOM_RIGHT = "bottom-right-radius";
  }
  static {
    this.EDITOR_BACKGROUND_CLASS_NAME = "monaco-editor-background";
  }
  static {
    this.ROUNDED_PIECE_WIDTH = 10;
  }
  constructor(e) {
    (super(), (this._previousFrameVisibleRangesWithStyle = []), (this._context = e));
    const t = this._context.configuration.options;
    ((this._roundedSelection = t.get(115)),
      (this._typicalHalfwidthCharacterWidth = t.get(59).typicalHalfwidthCharacterWidth),
      (this._selections = []),
      (this._renderResult = null),
      this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), (this._renderResult = null), super.dispose());
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    return (
      (this._roundedSelection = t.get(115)),
      (this._typicalHalfwidthCharacterWidth = t.get(59).typicalHalfwidthCharacterWidth),
      !0
    );
  }
  onCursorStateChanged(e) {
    return ((this._selections = e.selections.slice(0)), !0);
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  _visibleRangesHaveGaps(e) {
    for (let t = 0, n = e.length; t < n; t++) {
      if (e[t].ranges.length > 1) return !0;
    }
    return !1;
  }
  _enrichVisibleRangesWithStyle(e, t, n) {
    const i = this._typicalHalfwidthCharacterWidth / 4;
    let r = null,
      o = null;
    if (n && n.length > 0 && t.length > 0) {
      const i = t[0].lineNumber;
      if (i === e.startLineNumber)
        for (let e = 0; !r && e < n.length; e++) n[e].lineNumber === i && (r = n[e].ranges[0]);
      const s = t[t.length - 1].lineNumber;
      if (s === e.endLineNumber)
        for (let e = n.length - 1; !o && e >= 0; e--) n[e].lineNumber === s && (o = n[e].ranges[0]);
      (r && !r.startStyle && (r = null), o && !o.startStyle && (o = null));
    }
    for (let s = 0, a = t.length; s < a; s++) {
      const e = t[s].ranges[0],
        n = e.left,
        l = e.left + e.width,
        c = { top: 0, bottom: 0 },
        d = { top: 0, bottom: 0 };
      if (s > 0) {
        const e = t[s - 1].ranges[0].left,
          r = t[s - 1].ranges[0].left + t[s - 1].ranges[0].width;
        (b4(n - e) < i ? (c.top = 2) : n > e && (c.top = 1),
          b4(l - r) < i ? (d.top = 2) : e < l && l < r && (d.top = 1));
      } else r && ((c.top = r.startStyle.top), (d.top = r.endStyle.top));
      if (s + 1 < a) {
        const e = t[s + 1].ranges[0].left,
          r = t[s + 1].ranges[0].left + t[s + 1].ranges[0].width;
        (b4(n - e) < i ? (c.bottom = 2) : e < n && n < r && (c.bottom = 1),
          b4(l - r) < i ? (d.bottom = 2) : l < r && (d.bottom = 1));
      } else o && ((c.bottom = o.startStyle.bottom), (d.bottom = o.endStyle.bottom));
      ((e.startStyle = c), (e.endStyle = d));
    }
  }
  _getVisibleRangesWithStyle(e, t, n) {
    const i = (t.linesVisibleRangesForRange(e, !0) || []).map(_4);
    return (
      !this._visibleRangesHaveGaps(i) &&
        this._roundedSelection &&
        this._enrichVisibleRangesWithStyle(t.visibleRange, i, n),
      i
    );
  }
  _createSelectionPiece(e, t, n, i, r) {
    return (
      '<div class="cslr ' +
      n +
      '" style="top:' +
      e.toString() +
      "px;bottom:" +
      t.toString() +
      "px;left:" +
      i.toString() +
      "px;width:" +
      r.toString() +
      'px;"></div>'
    );
  }
  _actualRenderOneSelection(e, t, n, i) {
    if (0 === i.length) return;
    const r = !!i[0].ranges[0].startStyle,
      o = i[0].lineNumber,
      s = i[i.length - 1].lineNumber;
    for (let a = 0, l = i.length; a < l; a++) {
      const l = i[a],
        c = l.lineNumber,
        d = c - t,
        u = n && c === o ? 1 : 0,
        h = n && c !== o && c === s ? 1 : 0;
      let g = "",
        p = "";
      for (let e = 0, t = l.ranges.length; e < t; e++) {
        const t = l.ranges[e];
        if (r) {
          const e = t.startStyle,
            n = t.endStyle;
          if (1 === e.top || 1 === e.bottom) {
            g += this._createSelectionPiece(
              u,
              h,
              v4.SELECTION_CLASS_NAME,
              t.left - v4.ROUNDED_PIECE_WIDTH,
              v4.ROUNDED_PIECE_WIDTH,
            );
            let n = v4.EDITOR_BACKGROUND_CLASS_NAME;
            (1 === e.top && (n += " " + v4.SELECTION_TOP_RIGHT),
              1 === e.bottom && (n += " " + v4.SELECTION_BOTTOM_RIGHT),
              (g += this._createSelectionPiece(
                u,
                h,
                n,
                t.left - v4.ROUNDED_PIECE_WIDTH,
                v4.ROUNDED_PIECE_WIDTH,
              )));
          }
          if (1 === n.top || 1 === n.bottom) {
            g += this._createSelectionPiece(
              u,
              h,
              v4.SELECTION_CLASS_NAME,
              t.left + t.width,
              v4.ROUNDED_PIECE_WIDTH,
            );
            let e = v4.EDITOR_BACKGROUND_CLASS_NAME;
            (1 === n.top && (e += " " + v4.SELECTION_TOP_LEFT),
              1 === n.bottom && (e += " " + v4.SELECTION_BOTTOM_LEFT),
              (g += this._createSelectionPiece(u, h, e, t.left + t.width, v4.ROUNDED_PIECE_WIDTH)));
          }
        }
        let n = v4.SELECTION_CLASS_NAME;
        if (r) {
          const e = t.startStyle,
            i = t.endStyle;
          (0 === e.top && (n += " " + v4.SELECTION_TOP_LEFT),
            0 === e.bottom && (n += " " + v4.SELECTION_BOTTOM_LEFT),
            0 === i.top && (n += " " + v4.SELECTION_TOP_RIGHT),
            0 === i.bottom && (n += " " + v4.SELECTION_BOTTOM_RIGHT));
        }
        p += this._createSelectionPiece(u, h, n, t.left, t.width);
      }
      ((e[d][0] += g), (e[d][1] += p));
    }
  }
  prepareRender(e) {
    const t = [],
      n = e.visibleRange.startLineNumber,
      i = e.visibleRange.endLineNumber;
    for (let o = n; o <= i; o++) {
      t[o - n] = ["", ""];
    }
    const r = [];
    for (let o = 0, s = this._selections.length; o < s; o++) {
      const i = this._selections[o];
      if (i.isEmpty()) {
        r[o] = null;
        continue;
      }
      const s = this._getVisibleRangesWithStyle(i, e, this._previousFrameVisibleRangesWithStyle[o]);
      ((r[o] = s), this._actualRenderOneSelection(t, n, this._selections.length > 1, s));
    }
    ((this._previousFrameVisibleRangesWithStyle = r),
      (this._renderResult = t.map(([e, t]) => e + t)));
  }
  render(e, t) {
    if (!this._renderResult) return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
}
function b4(e) {
  return e < 0 ? -e : e;
}
_0((e, t) => {
  const n = e.getColor(cZ);
  n &&
    !n.isTransparent() &&
    t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${n}; }`);
});
class y4 {
  constructor(e, t, n, i, r, o, s) {
    ((this.top = e),
      (this.left = t),
      (this.paddingLeft = n),
      (this.width = i),
      (this.height = r),
      (this.textContent = o),
      (this.textContentClassName = s));
  }
}
var x4;
!(function (e) {
  ((e[(e.Single = 0)] = "Single"),
    (e[(e.MultiPrimary = 1)] = "MultiPrimary"),
    (e[(e.MultiSecondary = 2)] = "MultiSecondary"));
})(x4 || (x4 = {}));
class w4 {
  constructor(e, t) {
    this._context = e;
    const n = this._context.configuration.options,
      i = n.get(59);
    ((this._cursorStyle = n.get(161)),
      (this._typicalHalfwidthCharacterWidth = i.typicalHalfwidthCharacterWidth),
      (this._lineCursorWidth = Math.min(n.get(37), this._typicalHalfwidthCharacterWidth)),
      (this._lineCursorHeight = n.get(38)),
      (this._isVisible = !0),
      (this._domNode = Bq(document.createElement("div"))),
      this._domNode.setClassName(`cursor ${X1}`),
      this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)),
      this._domNode.setTop(0),
      this._domNode.setLeft(0),
      Vq(this._domNode, i),
      this._domNode.setDisplay("none"),
      (this._position = new xV(1, 1)),
      (this._pluralityClass = ""),
      this.setPlurality(t),
      (this._lastRenderedContent = ""),
      (this._renderData = null));
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return this._position;
  }
  setPlurality(e) {
    switch (e) {
      default:
      case x4.Single:
        this._pluralityClass = "";
        break;
      case x4.MultiPrimary:
        this._pluralityClass = "cursor-primary";
        break;
      case x4.MultiSecondary:
        this._pluralityClass = "cursor-secondary";
    }
  }
  show() {
    this._isVisible || (this._domNode.setVisibility("inherit"), (this._isVisible = !0));
  }
  hide() {
    this._isVisible && (this._domNode.setVisibility("hidden"), (this._isVisible = !1));
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options,
      n = t.get(59);
    return (
      (this._cursorStyle = t.get(161)),
      (this._typicalHalfwidthCharacterWidth = n.typicalHalfwidthCharacterWidth),
      (this._lineCursorWidth = Math.min(t.get(37), this._typicalHalfwidthCharacterWidth)),
      (this._lineCursorHeight = t.get(38)),
      Vq(this._domNode, n),
      !0
    );
  }
  onCursorPositionChanged(e, t) {
    return (
      (this._domNode.domNode.style.transitionProperty = t ? "none" : ""),
      (this._position = e),
      !0
    );
  }
  _getGraphemeAwarePosition() {
    const { lineNumber: e, column: t } = this._position,
      n = this._context.viewModel.getLineContent(e),
      [i, r] = (function (e, t) {
        t > 0 && hA(e.charCodeAt(t)) && t--;
        const n = t + _A(e, t);
        return [n - vA(e, n), n];
      })(n, t - 1);
    return [new xV(e, i + 1), n.substring(i, r)];
  }
  _prepareRender(e) {
    let t = "",
      n = "";
    const [i, r] = this._getGraphemeAwarePosition(),
      o = this._context.viewLayout.getLineHeightForLineNumber(i.lineNumber),
      s = 0 === this._lineCursorHeight ? o : Math.min(o, this._lineCursorHeight),
      a = (o - s) / 2;
    if (this._cursorStyle === vK.Line || this._cursorStyle === vK.LineThin) {
      const o = e.visibleRangeForPosition(i);
      if (!o || o.outsideRenderedLine) return null;
      const l = MF(this._domNode.domNode);
      let c;
      this._cursorStyle === vK.Line
        ? ((c = zB(l, this._lineCursorWidth > 0 ? this._lineCursorWidth : 2)),
          c > 2 && ((t = r), (n = this._getTokenClassName(i))))
        : (c = zB(l, 1));
      let d = o.left,
        u = 0;
      c >= 2 && d >= 1 && ((u = 1), (d -= u));
      const h = e.getVerticalOffsetForLineNumber(i.lineNumber) - e.bigNumbersDelta + a;
      return new y4(h, d, u, c, s, t, n);
    }
    const l = e.linesVisibleRangesForRange(
      new YH(i.lineNumber, i.column, i.lineNumber, i.column + r.length),
      !1,
    );
    if (!l || 0 === l.length) return null;
    const c = l[0];
    if (c.outsideRenderedLine || 0 === c.ranges.length) return null;
    const d = c.ranges[0],
      u = "\t" === r || d.width < 1 ? this._typicalHalfwidthCharacterWidth : d.width;
    this._cursorStyle === vK.Block && ((t = r), (n = this._getTokenClassName(i)));
    let h = e.getVerticalOffsetForLineNumber(i.lineNumber) - e.bigNumbersDelta,
      g = o;
    return (
      (this._cursorStyle !== vK.Underline && this._cursorStyle !== vK.UnderlineThin) ||
        ((h += o - 2), (g = 2)),
      new y4(h, d.left, 0, u, g, t, n)
    );
  }
  _getTokenClassName(e) {
    const t = this._context.viewModel.getViewLineData(e.lineNumber),
      n = t.tokens.findTokenIndexAtOffset(e.column - 1);
    return t.tokens.getClassName(n);
  }
  prepareRender(e) {
    this._renderData = this._prepareRender(e);
  }
  render(e) {
    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} ${X1} ${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);
  }
}
class C4 extends iQ {
  static {
    this.BLINK_INTERVAL = 500;
  }
  constructor(e) {
    super(e);
    const t = this._context.configuration.options;
    ((this._readOnly = t.get(104)),
      (this._cursorBlinking = t.get(32)),
      (this._cursorStyle = t.get(161)),
      (this._cursorSmoothCaretAnimation = t.get(33)),
      (this._editContextEnabled = t.get(170)),
      (this._selectionIsEmpty = !0),
      (this._isComposingInput = !1),
      (this._isVisible = !1),
      (this._primaryCursor = new w4(this._context, x4.Single)),
      (this._secondaryCursors = []),
      (this._renderData = []),
      (this._domNode = Bq(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 SM()),
      (this._cursorFlatBlinkInterval = new eB()),
      (this._blinkingEnabled = !1),
      (this._editorHasFocus = !1),
      this._updateBlinking());
  }
  dispose() {
    (super.dispose(),
      this._startCursorBlinkAnimation.dispose(),
      this._cursorFlatBlinkInterval.dispose());
  }
  getDomNode() {
    return this._domNode;
  }
  onCompositionStart(e) {
    return ((this._isComposingInput = !0), this._updateBlinking(), !0);
  }
  onCompositionEnd(e) {
    return ((this._isComposingInput = !1), this._updateBlinking(), !0);
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    ((this._readOnly = t.get(104)),
      (this._cursorBlinking = t.get(32)),
      (this._cursorStyle = t.get(161)),
      (this._cursorSmoothCaretAnimation = t.get(33)),
      (this._editContextEnabled = t.get(170)),
      this._updateBlinking(),
      this._updateDomClassName(),
      this._primaryCursor.onConfigurationChanged(e));
    for (let n = 0, i = this._secondaryCursors.length; n < i; n++)
      this._secondaryCursors[n].onConfigurationChanged(e);
    return !0;
  }
  _onCursorPositionChanged(e, t, n) {
    const i =
      this._secondaryCursors.length !== t.length ||
      ("explicit" === this._cursorSmoothCaretAnimation && 3 !== n);
    if (
      (this._primaryCursor.setPlurality(t.length ? x4.MultiPrimary : x4.Single),
      this._primaryCursor.onCursorPositionChanged(e, i),
      this._updateBlinking(),
      this._secondaryCursors.length < t.length)
    ) {
      const e = t.length - this._secondaryCursors.length;
      for (let t = 0; t < e; t++) {
        const e = new w4(this._context, x4.MultiSecondary);
        (this._domNode.domNode.insertBefore(
          e.getDomNode().domNode,
          this._primaryCursor.getDomNode().domNode.nextSibling,
        ),
          this._secondaryCursors.push(e));
      }
    } else if (this._secondaryCursors.length > t.length) {
      const e = this._secondaryCursors.length - t.length;
      for (let t = 0; t < e; t++)
        (this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),
          this._secondaryCursors.splice(0, 1));
    }
    for (let r = 0; r < t.length; r++) this._secondaryCursors[r].onCursorPositionChanged(t[r], i);
  }
  onCursorStateChanged(e) {
    const t = [];
    for (let i = 0, r = e.selections.length; i < r; i++) t[i] = e.selections[i].getPosition();
    this._onCursorPositionChanged(t[0], t.slice(1), e.reason);
    const n = e.selections[0].isEmpty();
    return (
      this._selectionIsEmpty !== n && ((this._selectionIsEmpty = n), this._updateDomClassName()),
      !0
    );
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onFocusChanged(e) {
    return ((this._editorHasFocus = e.isFocused), this._updateBlinking(), !1);
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return !0;
  }
  onTokensChanged(e) {
    const t = (t) => {
      for (let n = 0, i = e.ranges.length; n < i; n++)
        if (e.ranges[n].fromLineNumber <= t.lineNumber && t.lineNumber <= e.ranges[n].toLineNumber)
          return !0;
      return !1;
    };
    if (t(this._primaryCursor.getPosition())) return !0;
    for (const n of this._secondaryCursors) if (t(n.getPosition())) return !0;
    return !1;
  }
  onZonesChanged(e) {
    return !0;
  }
  _getCursorBlinking() {
    return this._isComposingInput && !this._editContextEnabled
      ? 0
      : this._editorHasFocus
        ? this._readOnly
          ? 5
          : this._cursorBlinking
        : 0;
  }
  _updateBlinking() {
    (this._startCursorBlinkAnimation.cancel(), this._cursorFlatBlinkInterval.cancel());
    const e = this._getCursorBlinking(),
      t = 0 === e,
      n = 5 === e;
    (t ? this._hide() : this._show(),
      (this._blinkingEnabled = !1),
      this._updateDomClassName(),
      t ||
        n ||
        (1 === e
          ? this._cursorFlatBlinkInterval.cancelAndSet(
              () => {
                this._isVisible ? this._hide() : this._show();
              },
              C4.BLINK_INTERVAL,
              MF(this._domNode.domNode),
            )
          : this._startCursorBlinkAnimation.setIfNotSet(() => {
              ((this._blinkingEnabled = !0), this._updateDomClassName());
            }, C4.BLINK_INTERVAL)));
  }
  _updateDomClassName() {
    this._domNode.setClassName(this._getClassName());
  }
  _getClassName() {
    let e = "cursors-layer";
    switch ((this._selectionIsEmpty || (e += " has-selection"), this._cursorStyle)) {
      case vK.Line:
        e += " cursor-line-style";
        break;
      case vK.Block:
        e += " cursor-block-style";
        break;
      case vK.Underline:
        e += " cursor-underline-style";
        break;
      case vK.LineThin:
        e += " cursor-line-thin-style";
        break;
      case vK.BlockOutline:
        e += " cursor-block-outline-style";
        break;
      case vK.UnderlineThin:
        e += " cursor-underline-thin-style";
        break;
      default:
        e += " cursor-line-style";
    }
    if (this._blinkingEnabled)
      switch (this._getCursorBlinking()) {
        case 1:
          e += " cursor-blink";
          break;
        case 2:
          e += " cursor-smooth";
          break;
        case 3:
          e += " cursor-phase";
          break;
        case 4:
          e += " cursor-expand";
          break;
        default:
          e += " cursor-solid";
      }
    else e += " cursor-solid";
    return (
      ("on" !== this._cursorSmoothCaretAnimation &&
        "explicit" !== this._cursorSmoothCaretAnimation) ||
        (e += " cursor-smooth-caret-animation"),
      e
    );
  }
  _show() {
    this._primaryCursor.show();
    for (let e = 0, t = this._secondaryCursors.length; e < t; e++) this._secondaryCursors[e].show();
    this._isVisible = !0;
  }
  _hide() {
    this._primaryCursor.hide();
    for (let e = 0, t = this._secondaryCursors.length; e < t; e++) this._secondaryCursors[e].hide();
    this._isVisible = !1;
  }
  prepareRender(e) {
    this._primaryCursor.prepareRender(e);
    for (let t = 0, n = this._secondaryCursors.length; t < n; t++)
      this._secondaryCursors[t].prepareRender(e);
  }
  render(e) {
    const t = [];
    let n = 0;
    const i = this._primaryCursor.render(e);
    i && (t[n++] = i);
    for (let r = 0, o = this._secondaryCursors.length; r < o; r++) {
      const i = this._secondaryCursors[r].render(e);
      i && (t[n++] = i);
    }
    this._renderData = t;
  }
  getLastRenderData() {
    return this._renderData;
  }
}
_0((e, t) => {
  const n = [
    { class: ".cursor", foreground: x0, background: w0 },
    { class: ".cursor-primary", foreground: C0, background: S0 },
    { class: ".cursor-secondary", foreground: k0, background: E0 },
  ];
  for (const i of n) {
    const n = e.getColor(i.foreground);
    if (n) {
      let r = e.getColor(i.background);
      (r || (r = n.opposite()),
        t.addRule(
          `.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${r}; }`,
        ),
        TQ(e.type) &&
          t.addRule(
            `.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${r}; border-right: 1px solid ${r}; }`,
          ));
    }
  }
});
const S4 = () => {
  throw new Error("Invalid change accessor");
};
class k4 extends iQ {
  constructor(e) {
    super(e);
    const t = this._context.configuration.options,
      n = t.get(165);
    ((this._lineHeight = t.get(75)),
      (this._contentWidth = n.contentWidth),
      (this._contentLeft = n.contentLeft),
      (this.domNode = Bq(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 = Bq(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() {
    const e = this._context.viewLayout.getWhitespaces(),
      t = new Map();
    for (const i of e) t.set(i.id, i);
    let n = !1;
    return (
      this._context.viewModel.changeWhitespace((e) => {
        const i = Object.keys(this._zones);
        for (let r = 0, o = i.length; r < o; r++) {
          const o = i[r],
            s = this._zones[o],
            a = this._computeWhitespaceProps(s.delegate);
          s.isInHiddenArea = a.isInHiddenArea;
          const l = t.get(o);
          !l ||
            (l.afterLineNumber === a.afterViewLineNumber && l.height === a.heightInPx) ||
            (e.changeOneWhitespace(o, a.afterViewLineNumber, a.heightInPx),
            this._safeCallOnComputedHeight(s.delegate, a.heightInPx),
            (n = !0));
        }
      }),
      n
    );
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options,
      n = t.get(165);
    return (
      (this._lineHeight = t.get(75)),
      (this._contentWidth = n.contentWidth),
      (this._contentLeft = n.contentLeft),
      e.hasChanged(75) && this._recomputeWhitespacesProps(),
      !0
    );
  }
  onLineMappingChanged(e) {
    return this._recomputeWhitespacesProps();
  }
  onLinesDeleted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged || e.scrollWidthChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  _getZoneOrdinal(e) {
    return e.ordinal ?? e.afterColumn ?? 1e4;
  }
  _computeWhitespaceProps(e) {
    if (0 === e.afterLineNumber)
      return {
        isInHiddenArea: !1,
        afterViewLineNumber: 0,
        heightInPx: this._heightInPixels(e),
        minWidthInPx: this._minWidthInPixels(e),
      };
    let t, n;
    if (void 0 !== e.afterColumn)
      t = this._context.viewModel.model.validatePosition({
        lineNumber: e.afterLineNumber,
        column: e.afterColumn,
      });
    else {
      const n = this._context.viewModel.model.validatePosition({
        lineNumber: e.afterLineNumber,
        column: 1,
      }).lineNumber;
      t = new xV(n, this._context.viewModel.model.getLineMaxColumn(n));
    }
    n =
      t.column === this._context.viewModel.model.getLineMaxColumn(t.lineNumber)
        ? this._context.viewModel.model.validatePosition({
            lineNumber: t.lineNumber + 1,
            column: 1,
          })
        : this._context.viewModel.model.validatePosition({
            lineNumber: t.lineNumber,
            column: t.column + 1,
          });
    const i = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(
        t,
        e.afterColumnAffinity,
        !0,
      ),
      r =
        e.showInHiddenAreas ||
        this._context.viewModel.coordinatesConverter.modelPositionIsVisible(n);
    return {
      isInHiddenArea: !r,
      afterViewLineNumber: i.lineNumber,
      heightInPx: r ? this._heightInPixels(e) : 0,
      minWidthInPx: this._minWidthInPixels(e),
    };
  }
  changeViewZones(e) {
    let t = !1;
    return (
      this._context.viewModel.changeWhitespace((n) => {
        const i = {
          addZone: (e) => ((t = !0), this._addZone(n, e)),
          removeZone: (e) => {
            e && (t = this._removeZone(n, e) || t);
          },
          layoutZone: (e) => {
            e && (t = this._layoutZone(n, e) || t);
          },
        };
        (!(function (e, t) {
          try {
            return e(t);
          } catch (spt) {
            return void HI(spt);
          }
        })(e, i),
          (i.addZone = S4),
          (i.removeZone = S4),
          (i.layoutZone = S4));
      }),
      t
    );
  }
  _addZone(e, t) {
    const n = this._computeWhitespaceProps(t),
      i = {
        whitespaceId: e.insertWhitespace(
          n.afterViewLineNumber,
          this._getZoneOrdinal(t),
          n.heightInPx,
          n.minWidthInPx,
        ),
        delegate: t,
        isInHiddenArea: n.isInHiddenArea,
        isVisible: !1,
        domNode: Bq(t.domNode),
        marginDomNode: t.marginDomNode ? Bq(t.marginDomNode) : null,
      };
    return (
      this._safeCallOnComputedHeight(i.delegate, n.heightInPx),
      i.domNode.setPosition("absolute"),
      (i.domNode.domNode.style.width = "100%"),
      i.domNode.setDisplay("none"),
      i.domNode.setAttribute("monaco-view-zone", i.whitespaceId),
      this.domNode.appendChild(i.domNode),
      i.marginDomNode &&
        (i.marginDomNode.setPosition("absolute"),
        (i.marginDomNode.domNode.style.width = "100%"),
        i.marginDomNode.setDisplay("none"),
        i.marginDomNode.setAttribute("monaco-view-zone", i.whitespaceId),
        this.marginDomNode.appendChild(i.marginDomNode)),
      (this._zones[i.whitespaceId] = i),
      this.setShouldRender(),
      i.whitespaceId
    );
  }
  _removeZone(e, t) {
    if (this._zones.hasOwnProperty(t)) {
      const n = this._zones[t];
      return (
        delete this._zones[t],
        e.removeWhitespace(n.whitespaceId),
        n.domNode.removeAttribute("monaco-visible-view-zone"),
        n.domNode.removeAttribute("monaco-view-zone"),
        n.domNode.domNode.remove(),
        n.marginDomNode &&
          (n.marginDomNode.removeAttribute("monaco-visible-view-zone"),
          n.marginDomNode.removeAttribute("monaco-view-zone"),
          n.marginDomNode.domNode.remove()),
        this.setShouldRender(),
        !0
      );
    }
    return !1;
  }
  _layoutZone(e, t) {
    if (this._zones.hasOwnProperty(t)) {
      const n = this._zones[t],
        i = this._computeWhitespaceProps(n.delegate);
      return (
        (n.isInHiddenArea = i.isInHiddenArea),
        e.changeOneWhitespace(n.whitespaceId, i.afterViewLineNumber, i.heightInPx),
        this._safeCallOnComputedHeight(n.delegate, i.heightInPx),
        this.setShouldRender(),
        !0
      );
    }
    return !1;
  }
  shouldSuppressMouseDownOnViewZone(e) {
    if (this._zones.hasOwnProperty(e)) {
      const t = this._zones[e];
      return Boolean(t.delegate.suppressMouseDown);
    }
    return !1;
  }
  _heightInPixels(e) {
    return "number" == typeof e.heightInPx
      ? e.heightInPx
      : "number" == typeof e.heightInLines
        ? this._lineHeight * e.heightInLines
        : this._lineHeight;
  }
  _minWidthInPixels(e) {
    return "number" == typeof e.minWidthInPx ? e.minWidthInPx : 0;
  }
  _safeCallOnComputedHeight(e, t) {
    if ("function" == typeof e.onComputedHeight)
      try {
        e.onComputedHeight(t);
      } catch (spt) {
        HI(spt);
      }
  }
  _safeCallOnDomNodeTop(e, t) {
    if ("function" == typeof e.onDomNodeTop)
      try {
        e.onDomNodeTop(t);
      } catch (spt) {
        HI(spt);
      }
  }
  prepareRender(e) {}
  render(e) {
    const t = e.viewportData.whitespaceViewportData,
      n = {};
    let i = !1;
    for (const o of t) this._zones[o.id].isInHiddenArea || ((n[o.id] = o), (i = !0));
    const r = Object.keys(this._zones);
    for (let o = 0, s = r.length; o < s; o++) {
      const t = r[o],
        i = this._zones[t];
      let s = 0,
        a = 0,
        l = "none";
      (n.hasOwnProperty(t)
        ? ((s = n[t].verticalOffset - e.bigNumbersDelta),
          (a = n[t].height),
          (l = "block"),
          i.isVisible ||
            (i.domNode.setAttribute("monaco-visible-view-zone", "true"), (i.isVisible = !0)),
          this._safeCallOnDomNodeTop(
            i.delegate,
            e.getScrolledTopFromAbsoluteTop(n[t].verticalOffset),
          ))
        : (i.isVisible &&
            (i.domNode.removeAttribute("monaco-visible-view-zone"), (i.isVisible = !1)),
          this._safeCallOnDomNodeTop(i.delegate, e.getScrolledTopFromAbsoluteTop(-1e6))),
        i.domNode.setTop(s),
        i.domNode.setHeight(a),
        i.domNode.setDisplay(l),
        i.marginDomNode &&
          (i.marginDomNode.setTop(s), i.marginDomNode.setHeight(a), i.marginDomNode.setDisplay(l)));
    }
    i &&
      (this.domNode.setWidth(Math.max(e.scrollWidth, this._contentWidth)),
      this.marginDomNode.setWidth(this._contentLeft));
  }
}
class E4 extends u0 {
  constructor(e) {
    (super(),
      (this._context = e),
      (this._options = new N4(this._context.configuration)),
      (this._selection = []),
      (this._renderResult = null),
      this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), (this._renderResult = null), super.dispose());
  }
  onConfigurationChanged(e) {
    const t = new N4(this._context.configuration);
    return this._options.equals(t) ? e.hasChanged(165) : ((this._options = t), !0);
  }
  onCursorStateChanged(e) {
    return ((this._selection = e.selections), "selection" === this._options.renderWhitespace);
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  prepareRender(e) {
    if ("none" === this._options.renderWhitespace) return void (this._renderResult = null);
    const t = e.visibleRange.startLineNumber,
      n = e.visibleRange.endLineNumber - t + 1,
      i = new Array(n);
    for (let r = 0; r < n; r++) i[r] = !0;
    this._renderResult = [];
    for (let r = e.viewportData.startLineNumber; r <= e.viewportData.endLineNumber; r++) {
      const t = r - e.viewportData.startLineNumber,
        n = this._context.viewModel.getViewLineRenderingData(r);
      let i = null;
      if ("selection" === this._options.renderWhitespace) {
        const e = this._selection;
        for (const t of e) {
          if (t.endLineNumber < r || t.startLineNumber > r) continue;
          const e = t.startLineNumber === r ? t.startColumn : n.minColumn,
            o = t.endLineNumber === r ? t.endColumn : n.maxColumn;
          e < o && (i || (i = []), i.push(new N$(e - 1, o - 1)));
        }
      }
      this._renderResult[t] = this._applyRenderWhitespace(e, r, i, n);
    }
  }
  _applyRenderWhitespace(e, t, n, i) {
    if (i.hasVariableFonts) return "";
    if ("selection" === this._options.renderWhitespace && !n) return "";
    if ("trailing" === this._options.renderWhitespace && i.continuesWithWrappedLine) return "";
    const r = this._context.theme.getColor(N0),
      o = this._options.renderWithSVG,
      s = i.content,
      a =
        -1 === this._options.stopRenderingLineAfter
          ? s.length
          : Math.min(this._options.stopRenderingLineAfter, s.length),
      l = i.continuesWithWrappedLine,
      c = i.minColumn - 1,
      d = "boundary" === this._options.renderWhitespace,
      u = "trailing" === this._options.renderWhitespace,
      h = e.getLineHeightForLineNumber(t),
      g = this._options.middotWidth,
      p = this._options.wsmiddotWidth,
      f = this._options.spaceWidth,
      m = Math.abs(p - f) < Math.abs(g - f) ? 11825 : 183,
      _ = this._options.canUseHalfwidthRightwardsArrow;
    let v,
      b = "",
      y = !1,
      x = YM(s);
    -1 === x ? ((y = !0), (x = a), (v = a)) : (v = QM(s));
    let w = 0,
      C = n && n[w],
      S = 0;
    for (let k = c; k < a; k++) {
      const i = s.charCodeAt(k);
      if ((C && C.endExclusive <= k && (w++, (C = n && n[w])), 9 !== i && 32 !== i)) continue;
      if (u && !y && k <= v) continue;
      if (d && k >= x && k <= v && 32 === i) {
        const e = k - 1 >= 0 ? s.charCodeAt(k - 1) : 0,
          t = k + 1 < a ? s.charCodeAt(k + 1) : 0;
        if (32 !== e && 32 !== t) continue;
      }
      if (d && l && k === a - 1) {
        const e = k - 1 >= 0 ? s.charCodeAt(k - 1) : 0;
        if (32 === i && 32 !== e && 9 !== e) continue;
      }
      if (n && !(C && C.start <= k && k < C.endExclusive)) continue;
      const r = e.visibleRangeForPosition(new xV(t, k + 1));
      r &&
        (o
          ? ((S = Math.max(S, r.left)),
            (b +=
              9 === i
                ? this._renderArrow(h, f, r.left)
                : `<circle cx="${(r.left + f / 2).toFixed(2)}" cy="${(h / 2).toFixed(2)}" r="${(f / 7).toFixed(2)}" />`))
          : (b +=
              9 === i
                ? `<div class="mwh" style="left:${r.left}px;height:${h}px;">${_ ? String.fromCharCode(65515) : String.fromCharCode(8594)}</div>`
                : `<div class="mwh" style="left:${r.left}px;height:${h}px;">${String.fromCharCode(m)}</div>`));
    }
    return o
      ? ((S = Math.round(S + f)),
        `<svg style="bottom:0;position:absolute;width:${S}px;height:${h}px" viewBox="0 0 ${S} ${h}" xmlns="http://www.w3.org/2000/svg" fill="${r}">` +
          b +
          "</svg>")
      : b;
  }
  _renderArrow(e, t, n) {
    const i = e / 2,
      r = n,
      o = { x: 0, y: t / 7 / 2 },
      s = { x: 0.8 * t, y: o.y },
      a = { x: s.x - 0.2 * s.x, y: s.y + 0.2 * s.x },
      l = { x: a.x + 0.1 * s.x, y: a.y + 0.1 * s.x },
      c = { x: l.x + 0.35 * s.x, y: l.y - 0.35 * s.x };
    return `<path d="M ${[o, s, a, l, c, { x: c.x, y: -c.y }, { x: l.x, y: -l.y }, { x: a.x, y: -a.y }, { x: s.x, y: -s.y }, { x: o.x, y: -o.y }].map((e) => `${(r + e.x).toFixed(2)} ${(i + e.y).toFixed(2)}`).join(" L ")}" />`;
  }
  render(e, t) {
    if (!this._renderResult) return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
}
class N4 {
  constructor(e) {
    const t = e.options,
      n = t.get(59),
      i = t.get(47);
    ("off" === i
      ? ((this.renderWhitespace = "none"), (this.renderWithSVG = !1))
      : "svg" === i
        ? ((this.renderWhitespace = t.get(113)), (this.renderWithSVG = !0))
        : ((this.renderWhitespace = t.get(113)), (this.renderWithSVG = !1)),
      (this.spaceWidth = n.spaceWidth),
      (this.middotWidth = n.middotWidth),
      (this.wsmiddotWidth = n.wsmiddotWidth),
      (this.canUseHalfwidthRightwardsArrow = n.canUseHalfwidthRightwardsArrow),
      (this.lineHeight = t.get(75)),
      (this.stopRenderingLineAfter = t.get(133)));
  }
  equals(e) {
    return (
      this.renderWhitespace === e.renderWhitespace &&
      this.renderWithSVG === e.renderWithSVG &&
      this.spaceWidth === e.spaceWidth &&
      this.middotWidth === e.middotWidth &&
      this.wsmiddotWidth === e.wsmiddotWidth &&
      this.canUseHalfwidthRightwardsArrow === e.canUseHalfwidthRightwardsArrow &&
      this.lineHeight === e.lineHeight &&
      this.stopRenderingLineAfter === e.stopRenderingLineAfter
    );
  }
}
class L4 {
  constructor(e, t, n, i) {
    ((this.selections = e),
      (this.startLineNumber = 0 | t.startLineNumber),
      (this.endLineNumber = 0 | t.endLineNumber),
      (this.relativeVerticalOffset = t.relativeVerticalOffset),
      (this.bigNumbersDelta = 0 | t.bigNumbersDelta),
      (this.lineHeight = 0 | t.lineHeight),
      (this.whitespaceViewportData = n),
      (this._model = i),
      (this.visibleRange = new YH(
        t.startLineNumber,
        this._model.getLineMinColumn(t.startLineNumber),
        t.endLineNumber,
        this._model.getLineMaxColumn(t.endLineNumber),
      )));
  }
  getViewLineRenderingData(e) {
    return this._model.getViewportViewLineRenderingData(this.visibleRange, e);
  }
  getDecorationsInViewport() {
    return this._model.getDecorationsInViewport(this.visibleRange);
  }
}
class D4 {
  get type() {
    return this._theme.type;
  }
  get value() {
    return this._theme;
  }
  constructor(e) {
    this._theme = e;
  }
  update(e) {
    this._theme = e;
  }
  getColor(e) {
    return this._theme.getColor(e);
  }
}
class T4 {
  constructor(e, t, n) {
    ((this.configuration = e),
      (this.theme = new D4(t)),
      (this.viewModel = n),
      (this.viewLayout = n.viewLayout));
  }
  addEventHandler(e) {
    this.viewModel.addViewEventHandler(e);
  }
  removeEventHandler(e) {
    this.viewModel.removeViewEventHandler(e);
  }
}
const I4 = new Float32Array([1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0]);
function R4(e) {
  if (!e) throw new Error(`Value "${e}" cannot be null`);
  return e;
}
function O4(e, t, n) {
  let i = new t.ResizeObserver((t) => {
    const r = t.find((t) => t.target === e);
    if (!r) return;
    if (!("devicePixelContentBoxSize" in r)) return (i?.disconnect(), void (i = void 0));
    const o = r.devicePixelContentBoxSize[0].inlineSize,
      s = r.devicePixelContentBoxSize[0].blockSize;
    o > 0 && s > 0 && n(o, s);
  });
  try {
    i.observe(e, { box: ["device-pixel-content-box"] });
  } catch {
    throw (i.disconnect(), (i = void 0), new QI("Could not observe device pixel dimensions"));
  }
  return MO(() => i?.disconnect());
}
let M4 = 0;
class A4 extends PO {
  get cacheKey() {
    return `${this.fontFamily}_${this.fontSize}px`;
  }
  constructor(e, t, n, i) {
    (super(),
      (this.fontSize = e),
      (this.fontFamily = t),
      (this.devicePixelRatio = n),
      (this._decorationStyleCache = i),
      (this.id = M4++),
      (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 = PR ? "greyscale" : "subpixel"));
    const r = Math.ceil(this.fontSize * n);
    ((this._canvas = new OffscreenCanvas(3 * r, 3 * r)),
      (this._ctx = R4(
        this._canvas.getContext("2d", {
          willReadFrequently: !0,
          alpha: "greyscale" === this._antiAliasing,
        }),
      )),
      (this._ctx.textBaseline = "top"),
      (this._ctx.fillStyle = "#FFFFFF"),
      (this._ctx.font = `${r}px ${this.fontFamily}`),
      (this._textMetrics = this._ctx.measureText("A")));
  }
  rasterizeGlyph(e, t, n, i) {
    return "" === e
      ? {
          source: this._canvas,
          boundingBox: { top: 0, left: 0, bottom: -1, right: -1 },
          originOffset: { x: 0, y: 0 },
          fontBoundingBoxAscent: 0,
          fontBoundingBoxDescent: 0,
        }
      : this._workGlyphConfig.chars === e &&
          this._workGlyphConfig.tokenMetadata === t &&
          this._workGlyphConfig.decorationStyleSetId === n
        ? this._workGlyph
        : ((this._workGlyphConfig.chars = e),
          (this._workGlyphConfig.tokenMetadata = t),
          (this._workGlyphConfig.decorationStyleSetId = n),
          this._rasterizeGlyph(e, t, n, i));
  }
  _rasterizeGlyph(e, t, n, i) {
    const r = Math.ceil(this.fontSize * this.devicePixelRatio),
      o = 3 * r;
    (this._canvas.width !== o && ((this._canvas.width = o), (this._canvas.height = o)),
      this._ctx.save());
    const s = (15 & t) / 10,
      a = i[E$.getBackground(t)],
      l = this._decorationStyleCache.getStyleSet(n);
    "subpixel" === this._antiAliasing
      ? ((this._ctx.fillStyle = a),
        this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height))
      : this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);
    const c = new bU(200),
      d = E$.getFontStyle(t);
    (1 & d && c.appendString("italic "),
      void 0 !== l?.bold ? l.bold && c.appendString("bold ") : 2 & d && c.appendString("bold "),
      c.appendString(`${r}px ${this.fontFamily}`),
      (this._ctx.font = c.build()));
    const u = r,
      h = r;
    ((this._ctx.fillStyle =
      void 0 !== l?.color ? `#${l.color.toString(16).padStart(8, "0")}` : i[E$.getForeground(t)]),
      (this._ctx.textBaseline = "top"),
      void 0 !== l?.opacity && (this._ctx.globalAlpha = l.opacity),
      this._ctx.fillText(e, u + s, h),
      this._ctx.restore());
    const g = this._ctx.getImageData(0, 0, this._canvas.width, this._canvas.height);
    if ("subpixel" === this._antiAliasing) {
      const e = parseInt(a.substring(1, 3), 16),
        t = parseInt(a.substring(3, 5), 16),
        n = parseInt(a.substring(5, 7), 16);
      (this._clearColor(g, e, t, n), this._ctx.putImageData(g, 0, 0));
    }
    return (
      this._findGlyphBoundingBox(g, this._workGlyph.boundingBox),
      (this._workGlyph.source = this._canvas),
      (this._workGlyph.originOffset.x = this._workGlyph.boundingBox.left - u),
      (this._workGlyph.originOffset.y = this._workGlyph.boundingBox.top - h),
      (this._workGlyph.fontBoundingBoxAscent = this._textMetrics.fontBoundingBoxAscent),
      (this._workGlyph.fontBoundingBoxDescent = this._textMetrics.fontBoundingBoxDescent),
      this._workGlyph
    );
  }
  _clearColor(e, t, n, i) {
    for (let r = 0; r < e.data.length; r += 4)
      e.data[r] === t && e.data[r + 1] === n && e.data[r + 2] === i && (e.data[r + 3] = 0);
  }
  _findGlyphBoundingBox(e, t) {
    const n = this._canvas.height,
      i = this._canvas.width;
    let r = !1;
    for (let o = 0; o < n; o++) {
      for (let n = 0; n < i; n++) {
        const s = o * i * 4 + 4 * n + 3;
        if (0 !== e.data[s]) {
          ((t.top = o), (r = !0));
          break;
        }
      }
      if (r) break;
    }
    ((t.left = 0), (r = !1));
    for (let o = 0; o < i; o++) {
      for (let s = 0; s < n; s++) {
        const n = s * i * 4 + 4 * o + 3;
        if (0 !== e.data[n]) {
          ((t.left = o), (r = !0));
          break;
        }
      }
      if (r) break;
    }
    ((t.right = i), (r = !1));
    for (let o = i - 1; o >= t.left; o--) {
      for (let s = 0; s < n; s++) {
        const n = s * i * 4 + 4 * o + 3;
        if (0 !== e.data[n]) {
          ((t.right = o), (r = !0));
          break;
        }
      }
      if (r) break;
    }
    ((t.bottom = t.top), (r = !1));
    for (let o = n - 1; o >= 0; o--) {
      for (let n = 0; n < i; n++) {
        const s = o * i * 4 + 4 * n + 3;
        if (0 !== e.data[s]) {
          ((t.bottom = o), (r = !0));
          break;
        }
      }
      if (r) break;
    }
  }
  getTextMetrics(e) {
    return this._ctx.measureText(e);
  }
}
!(function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  o > 3 && s && Object.defineProperty(t, n, s);
})([tJ], A4.prototype, "cacheKey", null);
let P4 = class extends PO {
  constructor(e) {
    (super(),
      (this._logService = e),
      (this._tasks = []),
      (this._i = 0),
      this._register(MO(() => this.clear())));
  }
  enqueue(e) {
    (this._tasks.push(e), this._start());
  }
  clear() {
    (this._idleCallback &&
      (this._cancelCallback(this._idleCallback), (this._idleCallback = void 0)),
      (this._i = 0),
      (this._tasks.length = 0));
  }
  _start() {
    this._idleCallback || (this._idleCallback = this._requestCallback(this._process.bind(this)));
  }
  _process(e) {
    this._idleCallback = void 0;
    let t = 0,
      n = 0,
      i = e.timeRemaining(),
      r = 0;
    for (; this._i < this._tasks.length; ) {
      if (
        ((t = Date.now()),
        this._tasks[this._i]() || this._i++,
        (t = Math.max(1, Date.now() - t)),
        (n = Math.max(t, n)),
        (r = e.timeRemaining()),
        1.5 * n > r)
      )
        return (
          i - t < -20 &&
            this._logService.warn(
              `task queue exceeded allotted deadline by ${Math.abs(Math.round(i - t))}ms`,
            ),
          void this._start()
        );
      i = r;
    }
    this.clear();
  }
};
P4 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, yH),
  ],
  P4,
);
const j4 =
  "requestIdleCallback" in wB()
    ? class extends P4 {
        _requestCallback(e) {
          return wB().requestIdleCallback(e);
        }
        _cancelCallback(e) {
          wB().cancelIdleCallback(e);
        }
      }
    : class extends P4 {
        _requestCallback(e) {
          return wB().setTimeout(() => e(this._createDeadline(16)));
        }
        _cancelCallback(e) {
          wB().clearTimeout(e);
        }
        _createDeadline(e) {
          const t = Date.now() + e;
          return { timeRemaining: () => Math.max(0, t - Date.now()) };
        }
      };
class F4 {
  constructor(e, t) {
    ((this._canvas = e),
      (this._textureIndex = t),
      (this._currentRow = { x: 0, y: 0, h: 0 }),
      (this._allocatedGlyphs = new Set()),
      (this._nextIndex = 0),
      (this._ctx = R4(this._canvas.getContext("2d", { willReadFrequently: !0 }))));
  }
  allocate(e) {
    const t = e.boundingBox.right - e.boundingBox.left + 1,
      n = e.boundingBox.bottom - e.boundingBox.top + 1;
    if (t > this._canvas.width || n > this._canvas.height)
      throw new QI("Glyph is too large for the atlas page");
    if (
      (e.boundingBox.right - e.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 + e.boundingBox.bottom - e.boundingBox.top + 1 > this._canvas.height)
    )
      return;
    this._ctx.drawImage(
      e.source,
      e.boundingBox.left,
      e.boundingBox.top,
      t,
      n,
      this._currentRow.x,
      this._currentRow.y,
      t,
      n,
    );
    const i = {
      pageIndex: this._textureIndex,
      glyphIndex: this._nextIndex++,
      x: this._currentRow.x,
      y: this._currentRow.y,
      w: t,
      h: n,
      originOffsetX: e.originOffset.x,
      originOffsetY: e.originOffset.y,
      fontBoundingBoxAscent: e.fontBoundingBoxAscent,
      fontBoundingBoxDescent: e.fontBoundingBoxDescent,
    };
    return (
      (this._currentRow.x += t),
      (this._currentRow.h = Math.max(this._currentRow.h, n)),
      this._allocatedGlyphs.add(i),
      i
    );
  }
  getUsagePreview() {
    const e = this._canvas.width,
      t = this._canvas.height,
      n = new OffscreenCanvas(e, t),
      i = R4(n.getContext("2d"));
    ((i.fillStyle = "#808080"), i.fillRect(0, 0, e, t));
    const r = new Map(),
      o = new Map();
    for (const s of this._allocatedGlyphs)
      (r.set(s.y, Math.max(r.get(s.y) ?? 0, s.h)),
        o.set(s.y, Math.max(o.get(s.y) ?? 0, s.x + s.w)));
    for (const s of this._allocatedGlyphs)
      ((i.fillStyle = "#4040FF"),
        i.fillRect(s.x, s.y, s.w, s.h),
        (i.fillStyle = "#FF0000"),
        i.fillRect(s.x, s.y + s.h, s.w, r.get(s.y) - s.h));
    for (const [s, a] of o.entries())
      s !== this._currentRow.y && ((i.fillStyle = "#FF0000"), i.fillRect(a, s, e - a, r.get(s)));
    return n.convertToBlob();
  }
  getStats() {
    const e = this._canvas.width,
      t = this._canvas.height;
    let n = 0,
      i = 0;
    const r = e * t,
      o = new Map(),
      s = new Map();
    for (const a of this._allocatedGlyphs)
      (o.set(a.y, Math.max(o.get(a.y) ?? 0, a.h)),
        s.set(a.y, Math.max(s.get(a.y) ?? 0, a.x + a.w)));
    for (const a of this._allocatedGlyphs) ((n += a.w * a.h), (i += a.w * (o.get(a.y) - a.h)));
    for (const [a, l] of s.entries()) a !== this._currentRow.y && (i += (e - l) * o.get(a));
    return [
      `page${this._textureIndex}:`,
      `     Total: ${r} (${e}x${t})`,
      `      Used: ${n} (${((n / r) * 100).toPrecision(2)}%)`,
      `    Wasted: ${i} (${((i / r) * 100).toPrecision(2)}%)`,
      `Efficiency: ${((n / (n + i)) * 100).toPrecision(2)}%`,
    ].join("\n");
  }
}
class B4 {
  constructor(e, t, n) {
    ((this._canvas = e),
      (this._textureIndex = t),
      (this._slabs = []),
      (this._activeSlabsByDims = new eH()),
      (this._unusedRects = []),
      (this._openRegionsByHeight = new Map()),
      (this._openRegionsByWidth = new Map()),
      (this._allocatedGlyphs = new Set()),
      (this._nextIndex = 0),
      (this._ctx = R4(this._canvas.getContext("2d", { willReadFrequently: !0 }))),
      (this._slabW = Math.min(
        n?.slabW ?? 64 << Math.max(Math.floor(wB().devicePixelRatio) - 1, 0),
        this._canvas.width,
      )),
      (this._slabH = Math.min(n?.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(e) {
    const t = e.boundingBox.right - e.boundingBox.left + 1,
      n = e.boundingBox.bottom - e.boundingBox.top + 1;
    if (t > this._canvas.width || n > this._canvas.height)
      throw new QI("Glyph is too large for the atlas page");
    if (t > this._slabW || n > this._slabH) {
      if (this._allocatedGlyphs.size > 0) return;
      let e = this._canvas.width;
      for (; t < e / 2 && n < e / 2; ) e /= 2;
      ((this._slabW = e),
        (this._slabH = e),
        (this._slabsPerRow = Math.floor(this._canvas.width / this._slabW)),
        (this._slabsPerColumn = Math.floor(this._canvas.height / this._slabH)));
    }
    const i = { w: t, h: n };
    let r,
      o,
      s = this._activeSlabsByDims.get(i.w, i.h);
    if (s) {
      const e = Math.floor(this._slabW / s.entryW) * Math.floor(this._slabH / s.entryH);
      s.count >= e && (s = void 0);
    }
    if (!s)
      if (t < n) {
        const e = this._openRegionsByWidth.get(t);
        if (e?.length)
          for (let i = e.length - 1; i >= 0; i--) {
            const s = e[i];
            if (s.w >= t && s.h >= n) {
              ((r = s.x),
                (o = s.y),
                t < s.w && this._unusedRects.push({ x: s.x + t, y: s.y, w: s.w - t, h: n }),
                (s.y += n),
                (s.h -= n),
                0 === s.h && (i === e.length - 1 ? e.pop() : this._unusedRects.splice(i, 1)));
              break;
            }
          }
      } else {
        const e = this._openRegionsByHeight.get(n);
        if (e?.length)
          for (let i = e.length - 1; i >= 0; i--) {
            const s = e[i];
            if (s.w >= t && s.h >= n) {
              ((r = s.x),
                (o = s.y),
                n < s.h && this._unusedRects.push({ x: s.x, y: s.y + n, w: t, h: s.h - n }),
                (s.x += t),
                (s.w -= t),
                0 === s.h && (i === e.length - 1 ? e.pop() : this._unusedRects.splice(i, 1)));
              break;
            }
          }
      }
    if (void 0 === r || void 0 === o) {
      if (!s) {
        if (this._slabs.length >= this._slabsPerRow * this._slabsPerColumn) return;
        s = {
          x: Math.floor(this._slabs.length % this._slabsPerRow) * this._slabW,
          y: Math.floor(this._slabs.length / this._slabsPerRow) * this._slabH,
          entryW: i.w,
          entryH: i.h,
          count: 0,
        };
        const e = this._slabW % s.entryW,
          t = this._slabH % s.entryH;
        (e &&
          V4(this._openRegionsByWidth, e, {
            x: s.x + this._slabW - e,
            w: e,
            y: s.y,
            h: this._slabH - (t ?? 0),
          }),
          t &&
            V4(this._openRegionsByHeight, t, {
              x: s.x,
              w: this._slabW,
              y: s.y + this._slabH - t,
              h: t,
            }),
          this._slabs.push(s),
          this._activeSlabsByDims.set(s, i.w, i.h));
      }
      const e = Math.floor(this._slabW / s.entryW);
      ((r = s.x + Math.floor(s.count % e) * s.entryW),
        (o = s.y + Math.floor(s.count / e) * s.entryH),
        s.count++);
    }
    this._ctx.drawImage(e.source, e.boundingBox.left, e.boundingBox.top, t, n, r, o, t, n);
    const a = {
      pageIndex: this._textureIndex,
      glyphIndex: this._nextIndex++,
      x: r,
      y: o,
      w: t,
      h: n,
      originOffsetX: e.originOffset.x,
      originOffsetY: e.originOffset.y,
      fontBoundingBoxAscent: e.fontBoundingBoxAscent,
      fontBoundingBoxDescent: e.fontBoundingBoxDescent,
    };
    return (this._allocatedGlyphs.add(a), a);
  }
  getUsagePreview() {
    const e = this._canvas.width,
      t = this._canvas.height,
      n = new OffscreenCanvas(e, t),
      i = R4(n.getContext("2d"));
    ((i.fillStyle = "#808080"), i.fillRect(0, 0, e, t));
    let r = 0,
      o = 0,
      s = 0;
    const a = 64 << (Math.floor(wB().devicePixelRatio) - 1),
      l = a;
    for (const d of this._slabs) {
      let e = 0,
        t = 0;
      for (let n = 0; n < d.count; n++)
        (e + d.entryW > a && ((e = 0), (t += d.entryH)),
          (i.fillStyle = "#FF0000"),
          i.fillRect(d.x + e, d.y + t, d.entryW, d.entryH),
          (r += d.entryW * d.entryH),
          (e += d.entryW));
      (Math.floor(a / d.entryW), Math.floor(l / d.entryH));
      (d.entryW, d.entryH);
    }
    for (const d of this._allocatedGlyphs)
      ((o += d.w * d.h), (i.fillStyle = "#4040FF"), i.fillRect(d.x, d.y, d.w, d.h));
    const c = Array.from(this._openRegionsByWidth.values())
      .flat()
      .concat(Array.from(this._openRegionsByHeight.values()).flat());
    for (const d of c)
      ((i.fillStyle = "#FF000088"), i.fillRect(d.x, d.y, d.w, d.h), (s += d.w * d.h));
    return (
      (i.globalAlpha = 0.5),
      i.drawImage(this._canvas, 0, 0),
      (i.globalAlpha = 1),
      n.convertToBlob()
    );
  }
  getStats() {
    const e = this._canvas.width,
      t = this._canvas.height;
    let n = 0,
      i = 0,
      r = 0,
      o = 0,
      s = 0;
    const a = e * t,
      l = 64 << (Math.floor(wB().devicePixelRatio) - 1),
      c = l;
    for (const h of this._slabs) {
      let e = 0,
        t = 0;
      for (let r = 0; r < h.count; r++)
        (e + h.entryW > l && ((e = 0), (t += h.entryH)),
          (n += h.entryW * h.entryH),
          (e += h.entryW));
      const i = Math.floor(l / h.entryW),
        o = Math.floor(c / h.entryH);
      r += l * c - h.entryW * i * h.entryH * o;
    }
    for (const h of this._allocatedGlyphs) i += h.w * h.h;
    const d = Array.from(this._openRegionsByWidth.values())
      .flat()
      .concat(Array.from(this._openRegionsByHeight.values()).flat());
    for (const h of d) s += h.w * h.h;
    o = n - (i - (r - s));
    const u = i / (i + o + s);
    return [
      `page[${this._textureIndex}]:`,
      `     Total: ${a}px (${e}x${t})`,
      `      Used: ${i}px (${((i / a) * 100).toFixed(2)}%)`,
      `    Wasted: ${o}px (${((o / a) * 100).toFixed(2)}%)`,
      `Restricted: ${s}px (${((s / a) * 100).toFixed(2)}%) (hard to allocate)`,
      `Efficiency: ${1 === u ? "100" : (100 * u).toFixed(2)}%`,
      `     Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width / l) * Math.floor(this._canvas.height / c)}`,
    ].join("\n");
  }
}
function V4(e, t, n) {
  let i = e.get(t);
  (i || ((i = []), e.set(t, i)), i.push(n));
}
var W4,
  H4 = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let z4 = class extends PO {
  static {
    W4 = this;
  }
  get version() {
    return this._version;
  }
  static {
    this.maximumGlyphCount = 5e3;
  }
  get usedArea() {
    return this._usedArea;
  }
  get source() {
    return this._canvas;
  }
  get glyphs() {
    return this._glyphInOrderSet.values();
  }
  constructor(e, t, n, i, r) {
    switch (
      (super(),
      (this._logService = i),
      (this._version = 0),
      (this._usedArea = { left: 0, top: 0, right: 0, bottom: 0 }),
      (this._glyphMap = new eH()),
      (this._glyphInOrderSet = new Set()),
      (this._canvas = new OffscreenCanvas(t, t)),
      (this._colorMap = r.getColorTheme().tokenColorMap),
      n)
    ) {
      case "shelf":
        this._allocator = new F4(this._canvas, e);
        break;
      case "slab":
        this._allocator = new B4(this._canvas, e);
        break;
      default:
        this._allocator = n(this._canvas, e);
    }
    this._register(
      MO(() => {
        ((this._canvas.width = 1), (this._canvas.height = 1));
      }),
    );
  }
  getGlyph(e, t, n, i) {
    return this._glyphMap.get(t, n, i, e.cacheKey) ?? this._createGlyph(e, t, n, i);
  }
  _createGlyph(e, t, n, i) {
    if (this._glyphInOrderSet.size >= W4.maximumGlyphCount) return;
    const r = e.rasterizeGlyph(t, n, i, this._colorMap),
      o = this._allocator.allocate(r);
    return void 0 !== o
      ? (this._glyphMap.set(o, t, n, i, e.cacheKey),
        this._glyphInOrderSet.add(o),
        this._version++,
        (this._usedArea.right = Math.max(this._usedArea.right, o.x + o.w - 1)),
        (this._usedArea.bottom = Math.max(this._usedArea.bottom, o.y + o.h - 1)),
        this._logService.getLevel() === wH.Trace &&
          this._logService.trace("New glyph", {
            chars: t,
            tokenMetadata: n,
            decorationStyleSetId: i,
            rasterizedGlyph: r,
            glyph: o,
          }),
        o)
      : void 0;
  }
  getUsagePreview() {
    return this._allocator.getUsagePreview();
  }
  getStats() {
    return this._allocator.getStats();
  }
};
z4 = W4 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([H4(3, yH), H4(4, h0)], z4);
var U4,
  $4 = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let q4 = class extends PO {
  static {
    U4 = this;
  }
  static {
    this.maximumPageCount = 16;
  }
  get pages() {
    return this._pages;
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this._maxTextureSize = e),
      (this._decorationStyleCache = n),
      (this._themeService = i),
      (this._instantiationService = r),
      (this._warmUpTask = this._register(new jO())),
      (this._warmedUpRasterizers = new Set()),
      (this._pages = []),
      (this._glyphPageIndex = new eH()),
      (this._onDidDeleteGlyphs = this._register(new QO())),
      (this.onDidDeleteGlyphs = this._onDidDeleteGlyphs.event),
      (this._allocatorType = t?.allocatorType ?? "slab"),
      this._register(
        $O.runAndSubscribe(this._themeService.onDidColorThemeChange, () => {
          (this._colorMap && this.clear(),
            (this._colorMap = this._themeService.getColorTheme().tokenColorMap));
        }),
      ));
    const o = Math.max(1, Math.floor(wB().devicePixelRatio));
    ((this.pageSize = Math.min(1024 * o, this._maxTextureSize)),
      this._initFirstPage(),
      this._register(MO(() => IO(this._pages))));
  }
  _initFirstPage() {
    const e = this._instantiationService.createInstance(z4, 0, this.pageSize, this._allocatorType);
    this._pages.push(e);
    const t = new A4(1, "", 1, this._decorationStyleCache);
    (e.getGlyph(t, "", 0, 0), t.dispose());
  }
  clear() {
    for (const e of this._pages) e.dispose();
    ((this._pages.length = 0),
      this._glyphPageIndex.clear(),
      this._warmedUpRasterizers.clear(),
      this._warmUpTask.clear(),
      this._initFirstPage(),
      this._onDidDeleteGlyphs.fire());
  }
  getGlyph(e, t, n, i, r) {
    return (
      (n &= -2048),
      (n |= Math.floor((r % 1) * 10)),
      this._warmedUpRasterizers.has(e.id) ||
        (this._warmUpAtlas(e), this._warmedUpRasterizers.add(e.id)),
      this._tryGetGlyph(this._glyphPageIndex.get(t, n, i, e.cacheKey) ?? 0, e, t, n, i)
    );
  }
  _tryGetGlyph(e, t, n, i, r) {
    return (
      this._glyphPageIndex.set(e, n, i, r, t.cacheKey),
      this._pages[e].getGlyph(t, n, i, r) ??
        (e + 1 < this._pages.length ? this._tryGetGlyph(e + 1, t, n, i, r) : void 0) ??
        this._getGlyphFromNewPage(t, n, i, r)
    );
  }
  _getGlyphFromNewPage(e, t, n, i) {
    if (this._pages.length >= U4.maximumPageCount)
      throw new Error(
        `Attempt to create a texture atlas page past the limit ${U4.maximumPageCount}`,
      );
    return (
      this._pages.push(
        this._instantiationService.createInstance(
          z4,
          this._pages.length,
          this.pageSize,
          this._allocatorType,
        ),
      ),
      this._glyphPageIndex.set(this._pages.length - 1, t, n, i, e.cacheKey),
      this._pages[this._pages.length - 1].getGlyph(e, t, n, i)
    );
  }
  getStats() {
    return this._pages.map((e) => e.getStats());
  }
  _warmUpAtlas(e) {
    const t = this._colorMap;
    if (!t) throw new QI("Cannot warm atlas without color map");
    this._warmUpTask.value?.clear();
    const n = (this._warmUpTask.value = this._instantiationService.createInstance(j4));
    for (let i = 65; i <= 90; i++)
      for (const r of t.keys())
        n.enqueue(() => {
          for (let t = 0; t < 1; t += 0.1)
            this.getGlyph(e, String.fromCharCode(i), (r << 15) & 16744448, 0, t);
        });
    for (let i = 97; i <= 122; i++)
      for (const r of t.keys())
        n.enqueue(() => {
          for (let t = 0; t < 1; t += 0.1)
            this.getGlyph(e, String.fromCharCode(i), (r << 15) & 16744448, 0, t);
        });
    for (let i = 33; i <= 126; i++)
      for (const r of t.keys())
        n.enqueue(() => {
          for (let t = 0; t < 1; t += 0.1)
            this.getGlyph(e, String.fromCharCode(i), (r << 15) & 16744448, 0, t);
        });
  }
};
var K4;
((q4 = U4 =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })([$4(3, h0), $4(4, vV)], q4)),
  (function (e) {
    ((e[(e.Ignore = 0)] = "Ignore"),
      (e[(e.Info = 1)] = "Info"),
      (e[(e.Warning = 2)] = "Warning"),
      (e[(e.Error = 3)] = "Error"));
  })(K4 || (K4 = {})),
  (function (e) {
    const t = "error",
      n = "warning",
      i = "info";
    ((e.fromValue = function (r) {
      return r
        ? sA(t, r)
          ? e.Error
          : sA(n, r) || sA("warn", r)
            ? e.Warning
            : sA(i, r)
              ? e.Info
              : e.Ignore
        : e.Ignore;
    }),
      (e.toString = function (r) {
        switch (r) {
          case e.Error:
            return t;
          case e.Warning:
            return n;
          case e.Info:
            return i;
          default:
            return "ignore";
        }
      }));
  })(K4 || (K4 = {})));
var G4 = K4,
  Z4 = G4;
const Y4 = bV("notificationService");
class X4 {}
var Q4;
function J4(e) {
  return { object: e, dispose: () => e.destroy() };
}
!(function (e) {
  ((e.requestDevice = async function (e) {
    try {
      if (!navigator.gpu) throw new Error("This browser does not support WebGPU");
      const e = await navigator.gpu.requestAdapter();
      if (!e) throw new Error("This browser supports WebGPU but it appears to be disabled");
      return J4(await e.requestDevice());
    } catch (spt) {
      throw (e && e(spt.message), spt);
    }
  }),
    (e.createBuffer = function (e, t, n) {
      const i = e.createBuffer(t);
      return (n && e.queue.writeBuffer(i, 0, mR(n) ? n() : n), J4(i));
    }),
    (e.createTexture = function (e, t) {
      return J4(e.createTexture(t));
    }));
})(Q4 || (Q4 = {}));
class e5 {
  get dataOffset() {
    return this._startIndex;
  }
  get dirtySize() {
    if (void 0 !== this._startIndex && void 0 !== this._endIndex)
      return this._endIndex - this._startIndex + 1;
  }
  get isDirty() {
    return void 0 !== this._startIndex;
  }
  flag(e, t = 1) {
    return (this._flag(e), t > 1 && this._flag(e + t - 1), e);
  }
  _flag(e) {
    ((void 0 === this._startIndex || e < this._startIndex) && (this._startIndex = e),
      (void 0 === this._endIndex || e > this._endIndex) && (this._endIndex = e));
  }
  clear() {
    ((this._startIndex = void 0), (this._endIndex = void 0));
  }
}
class t5 extends PO {
  get entryCount() {
    return this._entries.size;
  }
  get dirtyTracker() {
    return this._dirtyTracker;
  }
  constructor(e, t) {
    (super(),
      (this.propertySpecs = e),
      (this.capacity = t),
      (this._dirtyTracker = new e5()),
      (this._propertySpecsMap = new Map()),
      (this._entries = new HO()),
      (this._onDidChange = this._register(new QO())),
      (this._onDidChangeBuffer = this._register(new QO())),
      (this.onDidChangeBuffer = this._onDidChangeBuffer.event),
      (this.view = new Float32Array(t * e.length)),
      (this.buffer = this.view.buffer),
      (this._entrySize = e.length));
    for (let n = 0; n < e.length; n++) {
      const t = { offset: n, ...e[n] };
      this._propertySpecsMap.set(t.name, t);
    }
    this._register(MO(() => IO(this._entries)));
  }
  createEntry(e) {
    this._entries.size === this.capacity && (this._expandBuffer(), this._onDidChangeBuffer.fire());
    const t = new n5(this.view, this._propertySpecsMap, this._dirtyTracker, this._entries.size, e),
      n = this._entries.push(t),
      i = [];
    return (
      i.push($O.forward(t.onDidChange, this._onDidChange)),
      i.push(
        t.onWillDispose(() => {
          const e = t.i;
          (n(),
            this.view.set(
              this.view.subarray(e * this._entrySize + 2, this._entries.size * this._entrySize + 2),
              e * this._entrySize,
            ));
          for (const t of this._entries) t.i > e && t.i--;
          (this._dirtyTracker.flag(e, (this._entries.size - e) * this._entrySize), IO(i));
        }),
      ),
      t
    );
  }
  _expandBuffer() {
    this.capacity *= 2;
    const e = new Float32Array(this.capacity * this._entrySize);
    (e.set(this.view), (this.view = e), (this.buffer = this.view.buffer));
  }
}
class n5 extends PO {
  constructor(e, t, n, i, r) {
    (super(),
      (this._view = e),
      (this._propertySpecsMap = t),
      (this._dirtyTracker = n),
      (this.i = i),
      (this._onDidChange = this._register(new QO())),
      (this.onDidChange = this._onDidChange.event),
      (this._onWillDispose = this._register(new QO())),
      (this.onWillDispose = this._onWillDispose.event));
    for (const o of this._propertySpecsMap.values())
      this._view[this.i * this._propertySpecsMap.size + o.offset] = r[o.name];
    this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size);
  }
  dispose() {
    (this._onWillDispose.fire(), super.dispose());
  }
  setRaw(e) {
    if (e.length !== this._propertySpecsMap.size)
      throw new Error(
        `Data length ${e.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`,
      );
    (this._view.set(e, this.i * this._propertySpecsMap.size),
      this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size));
  }
}
class i5 extends nQ {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._context = e),
      (this._contentLeft = t),
      (this._devicePixelRatio = n),
      (this._canvas = i),
      (this._ctx = r),
      (this._shapeBindBuffer = this._register(new jO())),
      (this._initialized = !1),
      (this._shapeCollection = this._register(
        new t5(
          [
            { name: "x" },
            { name: "y" },
            { name: "width" },
            { name: "height" },
            { name: "red" },
            { name: "green" },
            { name: "blue" },
            { name: "alpha" },
          ],
          32,
        ),
      )),
      this._context.addEventHandler(this),
      this._initWebgpu(o));
  }
  async _initWebgpu(e) {
    if (((this._device = await e), this._store.isDisposed)) return;
    const t = navigator.gpu.getPreferredCanvasFormat();
    let n;
    (this._ctx.configure({ device: this._device, format: t, alphaMode: "premultiplied" }),
      (this._renderPassColorAttachment = { view: null, loadOp: "load", storeOp: "store" }),
      (this._renderPassDescriptor = {
        label: "Monaco rectangle renderer render pass",
        colorAttachments: [this._renderPassColorAttachment],
      }));
    {
      const e = new Float32Array(6),
        t = (t = this._canvas.width, n = this._canvas.height) => (
          (e[0] = t),
          (e[1] = n),
          (e[2] = Math.ceil(
            this._context.configuration.options.get(165).contentLeft * wB().devicePixelRatio,
          )),
          (e[3] = 0),
          (e[4] = e[0] - e[2]),
          (e[5] = e[1] - e[3]),
          e
        );
      ((n = this._register(
        Q4.createBuffer(
          this._device,
          {
            label: "Monaco rectangle renderer uniform buffer",
            size: 24,
            usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
          },
          () => t(),
        ),
      ).object),
        this._register(
          O4(this._canvas, wB(), (e, i) => {
            this._device.queue.writeBuffer(n, 0, t(e, i));
          }),
        ));
    }
    ((this._scrollOffsetBindBuffer = this._register(
      Q4.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)));
    const i = () =>
      Q4.createBuffer(this._device, {
        label: "Monaco rectangle renderer shape buffer",
        size: this._shapeCollection.buffer.byteLength,
        usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
      });
    ((this._shapeBindBuffer.value = i()),
      this._register(
        $O.runAndSubscribe(this._shapeCollection.onDidChangeBuffer, () => {
          ((this._shapeBindBuffer.value = i()),
            this._pipeline && this._updateBindGroup(this._pipeline, n));
        }),
      ),
      (this._vertexBuffer = this._register(
        Q4.createBuffer(
          this._device,
          {
            label: "Monaco rectangle renderer vertex buffer",
            size: I4.byteLength,
            usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,
          },
          I4,
        ),
      ).object));
    const r = this._device.createShaderModule({
      label: "Monaco rectangle renderer shader module",
      code: "\n\nstruct Vertex {\n\t@location(0) position: vec2f,\n};\n\nstruct LayoutInfo {\n\tcanvasDims: vec2f,\n\tviewportOffset: vec2f,\n\tviewportDims: vec2f,\n}\n\nstruct ScrollOffset {\n\toffset: vec2f,\n}\n\nstruct Shape {\n\tposition: vec2f,\n\tsize: vec2f,\n\tcolor: vec4f,\n};\n\nstruct VSOutput {\n\t@builtin(position) position: vec4f,\n\t@location(1)       color:    vec4f,\n};\n\n// Uniforms\n@group(0) @binding(1) var<uniform>       layoutInfo:      LayoutInfo;\n\n// Storage buffers\n@group(0) @binding(0)            var<storage, read> shapes:          array<Shape>;\n@group(0) @binding(2)      var<uniform>       scrollOffset:    ScrollOffset;\n\n@vertex fn vs(\n\tvert: Vertex,\n\t@builtin(instance_index) instanceIndex: u32,\n\t@builtin(vertex_index) vertexIndex : u32\n) -> VSOutput {\n\tlet shape = shapes[instanceIndex];\n\n\tvar vsOut: VSOutput;\n\tvsOut.position = vec4f(\n\t\t(\n\t\t\t// Top left corner\n\t\t\tvec2f(-1,  1) +\n\t\t\t// Convert pixel position to clipspace\n\t\t\tvec2f( 2, -2) / layoutInfo.canvasDims *\n\t\t\t// Shape position and size\n\t\t\t(layoutInfo.viewportOffset - scrollOffset.offset + shape.position + vert.position * shape.size)\n\t\t),\n\t\t0.0,\n\t\t1.0\n\t);\n\tvsOut.color = shape.color;\n\treturn vsOut;\n}\n\n@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {\n\treturn vsOut.color;\n}\n",
    });
    ((this._pipeline = this._device.createRenderPipeline({
      label: "Monaco rectangle renderer render pipeline",
      layout: "auto",
      vertex: {
        module: r,
        buffers: [
          {
            arrayStride: 2 * Float32Array.BYTES_PER_ELEMENT,
            attributes: [{ shaderLocation: 0, offset: 0, format: "float32x2" }],
          },
        ],
      },
      fragment: {
        module: r,
        targets: [
          {
            format: t,
            blend: {
              color: { srcFactor: "src-alpha", dstFactor: "one-minus-src-alpha" },
              alpha: { srcFactor: "src-alpha", dstFactor: "one-minus-src-alpha" },
            },
          },
        ],
      },
    })),
      this._updateBindGroup(this._pipeline, n),
      (this._initialized = !0));
  }
  _updateBindGroup(e, t) {
    this._bindGroup = this._device.createBindGroup({
      label: "Monaco rectangle renderer bind group",
      layout: e.getBindGroupLayout(0),
      entries: [
        { binding: 0, resource: { buffer: this._shapeBindBuffer.value.object } },
        { binding: 1, resource: { buffer: t } },
        { binding: 2, resource: { buffer: this._scrollOffsetBindBuffer } },
      ],
    });
  }
  register(e, t, n, i, r, o, s, a) {
    return this._shapeCollection.createEntry({
      x: e,
      y: t,
      width: n,
      height: i,
      red: r,
      green: o,
      blue: s,
      alpha: a,
    });
  }
  onScrollChanged(e) {
    if (this._device) {
      const e = wB().devicePixelRatio;
      ((this._scrollOffsetValueBuffer[0] = this._context.viewLayout.getCurrentScrollLeft() * e),
        (this._scrollOffsetValueBuffer[1] = this._context.viewLayout.getCurrentScrollTop() * e),
        this._device.queue.writeBuffer(
          this._scrollOffsetBindBuffer,
          0,
          this._scrollOffsetValueBuffer,
        ));
    }
    return !0;
  }
  _update() {
    if (!this._device) return;
    const e = this._shapeCollection;
    e.dirtyTracker.isDirty &&
      (this._device.queue.writeBuffer(
        this._shapeBindBuffer.value.object,
        0,
        e.buffer,
        e.dirtyTracker.dataOffset,
        e.dirtyTracker.dirtySize * e.view.BYTES_PER_ELEMENT,
      ),
      e.dirtyTracker.clear());
  }
  draw(e) {
    if (!this._initialized) return;
    this._update();
    const t = this._device.createCommandEncoder({
      label: "Monaco rectangle renderer command encoder",
    });
    this._renderPassColorAttachment.view = this._ctx.getCurrentTexture().createView();
    const n = t.beginRenderPass(this._renderPassDescriptor);
    (n.setPipeline(this._pipeline),
      n.setVertexBuffer(0, this._vertexBuffer),
      n.setBindGroup(0, this._bindGroup));
    const i = Math.ceil(this._contentLeft.get() * this._devicePixelRatio.get());
    (n.setScissorRect(i, 0, this._canvas.width - i, this._canvas.height),
      n.draw(I4.length / 2, this._shapeCollection.entryCount),
      n.end());
    const r = t.finish();
    this._device.queue.submit([r]);
  }
}
class r5 extends PO {
  constructor() {
    (super(),
      (this._ruleCache = new Map()),
      (this._container = VB("div.monaco-decoration-css-rule-extractor")),
      (this._dummyElement = VB("span")),
      this._container.appendChild(this._dummyElement),
      this._register(MO(() => this._container.remove())));
  }
  getStyleRules(e, t) {
    const n = this._ruleCache.get(t);
    if (n) return n;
    ((this._dummyElement.className = t), e.appendChild(this._container));
    const i = this._getStyleRules(t);
    return (this._ruleCache.set(t, i), e.removeChild(this._container), i);
  }
  _getStyleRules(e) {
    const t = [],
      n = [...xB().styleSheets];
    for (let i = 0; i < n.length; i++) {
      const r = n[i];
      for (const i of r.cssRules)
        if (i instanceof CSSImportRule) i.styleSheet && n.push(i.styleSheet);
        else if (i instanceof CSSStyleRule) {
          const n = `.${e}`,
            r = i.selectorText.indexOf(n);
          if (-1 !== r) {
            const e = r + n.length;
            (i.selectorText.length === e || i.selectorText.substring(e, e + 1).match(/[ :]/)) &&
              t.push(i);
          }
        }
    }
    return t;
  }
}
class o5 {
  constructor() {
    ((this._nextId = 1), (this._cacheById = new Map()), (this._cacheByStyle = new eH()));
  }
  getOrCreateEntry(e, t, n) {
    if (void 0 === e && void 0 === t && void 0 === n) return 0;
    const i = this._cacheByStyle.get(e ?? 0, t ? 1 : 0, void 0 === n ? "" : n.toFixed(2));
    if (i) return i.id;
    const r = this._nextId++,
      o = { id: r, color: e, bold: t, opacity: n };
    return (
      this._cacheById.set(r, o),
      this._cacheByStyle.set(o, e ?? 0, t ? 1 : 0, void 0 === n ? "" : n.toFixed(2)),
      r
    );
  }
  getStyleSet(e) {
    if (0 !== e) return this._cacheById.get(e);
  }
}
function s5(e, t) {
  let n,
    i = !0;
  return (function (e, t) {
    const n = new AO(),
      i = sF(
        {
          owner: e.owner,
          debugName: e.debugName,
          debugReferenceFn: e.debugReferenceFn ?? t,
          changeTracker: e.changeTracker,
        },
        (e, i) => {
          (n.clear(), t(e, i, n));
        },
      );
    return MO(() => {
      (i.dispose(), n.dispose());
    });
  })(
    {
      changeTracker: {
        createChangeSummary: () => ({ deltas: [], didChange: !1 }),
        handleChange: (t, n) => {
          if (t.didChange(e)) {
            const e = t.change;
            (void 0 !== e && n.deltas.push(e), (n.didChange = !0));
          }
          return !0;
        },
      },
    },
    (r, o) => {
      const s = e.read(r),
        a = n;
      (o.didChange && ((n = s), t(s, a, o.deltas)), i && ((i = !1), (n = s)));
    },
  );
}
function a5(e, t) {
  const n = new AO(),
    i = s5(e, (e, i, r) => {
      (n.clear(), t(e, i, r, n));
    });
  return {
    dispose() {
      (i.dispose(), n.dispose());
    },
  };
}
var l5,
  c5 = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let d5 = class extends PO {
  static {
    l5 = this;
  }
  static {
    this._decorationCssRuleExtractor = new r5();
  }
  static get decorationCssRuleExtractor() {
    return l5._decorationCssRuleExtractor;
  }
  static {
    this._decorationStyleCache = new o5();
  }
  static get decorationStyleCache() {
    return l5._decorationStyleCache;
  }
  static get atlas() {
    if (!l5._atlas)
      throw new QI("Cannot call ViewGpuContext.textureAtlas before device is resolved");
    return l5._atlas;
  }
  get atlas() {
    return l5.atlas;
  }
  constructor(e, t, n, i) {
    (super(),
      (this._instantiationService = t),
      (this._notificationService = n),
      (this.configurationService = i),
      (this.maxGpuCols = 2e3),
      (this.canvas = Bq(document.createElement("canvas"))),
      this.canvas.setClassName("editorCanvas"),
      this._register(
        $O.runAndSubscribe(i.onDidChangeConfiguration, (e) => {
          if (!e || e.affectsConfiguration("editor.scrollbar.verticalScrollbarSize")) {
            const e = i.getValue("editor").scrollbar?.verticalScrollbarSize ?? 14;
            ((this.canvas.domNode.style.boxSizing = "border-box"),
              (this.canvas.domNode.style.paddingRight = `${e}px`));
          }
        }),
      ),
      (this.ctx = R4(this.canvas.domNode.getContext("webgpu"))),
      l5.device ||
        (l5.device = Q4.requestDevice((e) => {
          const t = [
            {
              label: SI(78, "Use DOM-based rendering"),
              run: () =>
                this.configurationService.updateValue("editor.experimentalGpuAcceleration", "off"),
            },
          ];
          this._notificationService.prompt(Z4.Warning, e, t);
        }).then(
          (e) => (
            (l5.deviceSync = e.object),
            l5._atlas ||
              (l5._atlas = this._instantiationService.createInstance(
                q4,
                e.object.limits.maxTextureDimension2D,
                void 0,
                l5.decorationStyleCache,
              )),
            e.object
          ),
        )));
    const r = LF(this, wB().devicePixelRatio);
    (this._register(
      $F(wB(), "resize", () => {
        r.set(wB().devicePixelRatio, void 0);
      }),
    ),
      (this.devicePixelRatio = r),
      this._register(s5(this.devicePixelRatio, () => l5.atlas?.clear())));
    const o = LF(this, { width: this.canvas.domNode.width, height: this.canvas.domNode.height });
    (this._register(
      O4(this.canvas.domNode, wB(), (e, t) => {
        ((this.canvas.domNode.width = e),
          (this.canvas.domNode.height = t),
          o.set({ width: e, height: t }, void 0));
      }),
    ),
      (this.canvasDevicePixelDimensions = o));
    const s = LF(this, 0);
    (this._register(
      this.configurationService.onDidChangeConfiguration((t) => {
        s.set(e.configuration.options.get(165).contentLeft, void 0);
      }),
    ),
      (this.contentLeft = s),
      (this.rectangleRenderer = this._instantiationService.createInstance(
        i5,
        e,
        this.contentLeft,
        this.devicePixelRatio,
        this.canvas.domNode,
        this.ctx,
        l5.device,
      )));
  }
  canRender(e, t, n) {
    const i = t.getViewLineRenderingData(n);
    if (i.containsRTL || i.maxColumn > this.maxGpuCols) return !1;
    if (i.inlineDecorations.length > 0) {
      let e = !0;
      for (const t of i.inlineDecorations) {
        if (0 !== t.type) {
          e = !1;
          break;
        }
        const n = l5._decorationCssRuleExtractor.getStyleRules(
          this.canvas.domNode,
          t.inlineClassName,
        );
        if (
          ((e &&= n.every((e) => {
            if (e.selectorText.includes(":")) return !1;
            for (const t of e.style) if (!h5(t, e.style)) return !1;
            return !0;
          })),
          !e)
        )
          break;
      }
      return e;
    }
    return !0;
  }
  canRenderDetailed(e, t, n) {
    const i = t.getViewLineRenderingData(n),
      r = [];
    if (
      (i.containsRTL && r.push("containsRTL"),
      i.maxColumn > this.maxGpuCols && r.push("maxColumn > maxGpuCols"),
      i.inlineDecorations.length > 0)
    ) {
      let e = !0;
      const t = [],
        n = [],
        o = [];
      for (const r of i.inlineDecorations) {
        if (0 !== r.type) {
          (t.push(r.type), (e = !1));
          continue;
        }
        const i = l5._decorationCssRuleExtractor.getStyleRules(
          this.canvas.domNode,
          r.inlineClassName,
        );
        e &&= i.every((e) => {
          if (e.selectorText.includes(":")) return (n.push(e.selectorText), !1);
          for (const t of e.style) if (!h5(t, e.style)) return (o.push(`${t}: ${e.style[t]}`), !1);
          return !0;
        });
      }
      (t.length > 0 &&
        r.push(`inlineDecorations with unsupported types (${t.map((e) => `\`${e}\``).join(", ")})`),
        o.length > 0 &&
          r.push(
            `inlineDecorations with unsupported CSS rules (${o.map((e) => `\`${e}\``).join(", ")})`,
          ),
        n.length > 0 &&
          r.push(
            `inlineDecorations with unsupported CSS selectors (${n.map((e) => `\`${e}\``).join(", ")})`,
          ));
    }
    return r;
  }
};
d5 = l5 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([c5(1, vV), c5(2, Y4), c5(3, OU)], d5);
const u5 = ["color", "font-weight", "opacity"];
function h5(e, t) {
  return !!u5.includes(e);
}
function g5(e, t) {
  return e.isBasicASCII && t.useMonospaceOptimizations ? new p5(e) : new f5(e);
}
class p5 {
  constructor(e) {
    this._content = e.content;
  }
  getSegmentAtIndex(e) {
    return this._content[e];
  }
}
class f5 {
  constructor(e) {
    this._segments = [];
    const t = e.content,
      n = Nz.Segmenter(void 0, { granularity: "grapheme" }).value,
      i = Array.from(n.segment(t));
    let r = 0;
    for (let o = 0; o < t.length; o++) {
      const e = i[r];
      if (!e) break;
      e.index === o ? (r++, this._segments.push(e)) : this._segments.push(void 0);
    }
  }
  getSegmentAtIndex(e) {
    return this._segments[e]?.segment;
  }
}
class m5 extends nQ {
  get glyphRasterizer() {
    return this._glyphRasterizer.value;
  }
  constructor(e, t, n, i) {
    (super(),
      (this._context = e),
      (this._viewGpuContext = t),
      (this._device = n),
      (this._glyphRasterizer = i),
      this._context.addEventHandler(this));
  }
}
const _5 = `\nstruct GlyphInfo {\n\tposition: vec2f,\n\tsize: vec2f,\n\torigin: vec2f,\n};\n\nstruct Vertex {\n\t@location(0) position: vec2f,\n};\n\nstruct Cell {\n\tposition: vec2f,\n\tunused1: vec2f,\n\tglyphIndex: f32,\n\ttextureIndex: f32\n};\n\nstruct LayoutInfo {\n\tcanvasDims: vec2f,\n\tviewportOffset: vec2f,\n\tviewportDims: vec2f,\n}\n\nstruct ScrollOffset {\n\toffset: vec2f\n}\n\nstruct VSOutput {\n\t@builtin(position) position:   vec4f,\n\t@location(1)       layerIndex: f32,\n\t@location(0)       texcoord:   vec2f,\n};\n\n// Uniforms\n@group(0) @binding(4)       var<uniform>       layoutInfo:      LayoutInfo;\n@group(0) @binding(5)  var<uniform>       atlasDims:       vec2f;\n@group(0) @binding(6)            var<uniform>       scrollOffset:    ScrollOffset;\n\n// Storage buffers\n@group(0) @binding(0)               var<storage, read> glyphInfo:       array<array<GlyphInfo, ${z4.maximumGlyphCount}>, ${q4.maximumPageCount}>;\n@group(0) @binding(1)                   var<storage, read> cells:           array<Cell>;\n\n@vertex fn vs(\n\tvert: Vertex,\n\t@builtin(instance_index) instanceIndex: u32,\n\t@builtin(vertex_index) vertexIndex : u32\n) -> VSOutput {\n\tlet cell = cells[instanceIndex];\n\tvar glyph = glyphInfo[u32(cell.textureIndex)][u32(cell.glyphIndex)];\n\n\tvar vsOut: VSOutput;\n\t// Multiple vert.position by 2,-2 to get it into clipspace which ranged from -1 to 1\n\tvsOut.position = vec4f(\n\t\t// Make everything relative to top left instead of center\n\t\tvec2f(-1, 1) +\n\t\t((vert.position * vec2f(2, -2)) / layoutInfo.canvasDims) * glyph.size +\n\t\t((cell.position * vec2f(2, -2)) / layoutInfo.canvasDims) +\n\t\t((glyph.origin * vec2f(2, -2)) / layoutInfo.canvasDims) +\n\t\t(((layoutInfo.viewportOffset - scrollOffset.offset * vec2(1, -1)) * 2) / layoutInfo.canvasDims),\n\t\t0.0,\n\t\t1.0\n\t);\n\n\tvsOut.layerIndex = cell.textureIndex;\n\t// Textures are flipped from natural direction on the y-axis, so flip it back\n\tvsOut.texcoord = vert.position;\n\tvsOut.texcoord = (\n\t\t// Glyph offset (0-1)\n\t\t(glyph.position / atlasDims) +\n\t\t// Glyph coordinate (0-1)\n\t\t(vsOut.texcoord * (glyph.size / atlasDims))\n\t);\n\n\treturn vsOut;\n}\n\n@group(0) @binding(2) var ourSampler: sampler;\n@group(0) @binding(3)        var ourTexture: texture_2d_array<f32>;\n\n@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {\n\treturn textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex));\n}\n`;
class v5 extends m5 {
  static {
    this.maxSupportedColumns = 2e3;
  }
  get bindGroupEntries() {
    return [
      { binding: 1, resource: { buffer: this._cellBindBuffer } },
      { binding: 6, resource: { buffer: this._scrollOffsetBindBuffer } },
    ];
  }
  constructor(e, t, n, i) {
    (super(e, t, n, i),
      (this.type = "viewport"),
      (this.wgsl = _5),
      (this._cellBindBufferLineCapacity = 63),
      (this._activeDoubleBufferIndex = 0),
      (this._visibleObjectCount = 0),
      (this._scrollInitialized = !1),
      (this._onDidChangeBindGroupEntries = this._register(new QO())),
      (this.onDidChangeBindGroupEntries = this._onDidChangeBindGroupEntries.event),
      this._rebuildCellBuffer(this._cellBindBufferLineCapacity));
    ((this._scrollOffsetBindBuffer = this._register(
      Q4.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(e) {
    this._cellBindBuffer?.destroy();
    const t = 32 * (Math.floor(e / 32) + 1),
      n = t * v5.maxSupportedColumns * 6 * Float32Array.BYTES_PER_ELEMENT;
    ((this._cellBindBuffer = this._register(
      Q4.createBuffer(this._device, {
        label: "Monaco full file cell buffer",
        size: n,
        usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
      }),
    ).object),
      (this._cellValueBuffers = [new ArrayBuffer(n), new ArrayBuffer(n)]),
      (this._cellBindBufferLineCapacity = t),
      this._onDidChangeBindGroupEntries.fire());
  }
  onConfigurationChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onTokensChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onScrollChanged(e) {
    const t = wB().devicePixelRatio;
    return (
      (this._scrollOffsetValueBuffer[0] =
        (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * t),
      (this._scrollOffsetValueBuffer[1] =
        (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * t),
      this._device.queue.writeBuffer(
        this._scrollOffsetBindBuffer,
        0,
        this._scrollOffsetValueBuffer,
      ),
      !0
    );
  }
  onThemeChanged(e) {
    return !0;
  }
  onLineMappingChanged(e) {
    return !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  reset() {
    for (const e of [0, 1]) {
      const t = new Float32Array(this._cellValueBuffers[e]);
      (t.fill(0, 0, t.length),
        this._device.queue.writeBuffer(this._cellBindBuffer, 0, t.buffer, 0, t.byteLength));
    }
  }
  update(e, t) {
    let n,
      i,
      r,
      o,
      s,
      a,
      l,
      c,
      d = "",
      u = 0,
      h = 0,
      g = 0,
      p = 0,
      f = 0,
      m = 0,
      _ = 0,
      v = 0,
      b = 0,
      y = 0,
      x = 0,
      w = 0;
    const C = wB().devicePixelRatio;
    let S;
    (this._scrollInitialized || (this.onScrollChanged(), (this._scrollInitialized = !0)),
      this._cellBindBufferLineCapacity < e.endLineNumber - e.startLineNumber + 1 &&
        this._rebuildCellBuffer(e.endLineNumber - e.startLineNumber + 1));
    const k = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);
    k.fill(0);
    const E = 6 * v5.maxSupportedColumns;
    for (h = e.startLineNumber; h <= e.endLineNumber; h++)
      if (this._viewGpuContext.canRender(t, e, h)) {
        ((a = e.getViewLineRenderingData(h)),
          (m = 0),
          (S = g5(a, t)),
          (u = t.spaceWidth * C),
          (p = 0),
          (c = a.tokens),
          (v = a.minColumn - 1),
          (b = 0));
        for (let x = 0, w = c.getCount(); x < w; x++)
          if (((b = c.getEndOffset(x)), !(b <= v))) {
            for (y = c.getMetadata(x), g = v; g < b && !(g > v5.maxSupportedColumns); g++) {
              if (((n = S.getSegmentAtIndex(g)), void 0 === n)) continue;
              for (l of ((d = n),
              (a.isBasicASCII && t.useMonospaceOptimizations) ||
                (u = this.glyphRasterizer.getTextMetrics(d).width),
              (o = void 0),
              (r = void 0),
              (s = void 0),
              a.inlineDecorations)) {
                if (
                  h < l.range.startLineNumber ||
                  h > l.range.endLineNumber ||
                  (h === l.range.startLineNumber && g < l.range.startColumn - 1) ||
                  (h === l.range.endLineNumber && g >= l.range.endColumn - 1)
                )
                  continue;
                const e = d5.decorationCssRuleExtractor.getStyleRules(
                  this._viewGpuContext.canvas.domNode,
                  l.inlineClassName,
                );
                for (const t of e)
                  for (const e of t.style) {
                    const n = t.styleMap.get(e)?.toString() ?? "";
                    switch (e) {
                      case "color": {
                        const e = vG.Format.CSS.parse(n);
                        if (!e) throw new QI("Invalid color format " + n);
                        o = e.toNumber32Bit();
                        break;
                      }
                      case "font-weight":
                        r = b5(n) >= 400;
                        break;
                      case "opacity":
                        s = y5(n);
                        break;
                      default:
                        throw new QI("Unexpected inline decoration style");
                    }
                  }
              }
              if (" " === d || "\t" === d) {
                if (
                  ((_ = 6 * ((h - 1) * v5.maxSupportedColumns + g)),
                  k.fill(0, _, _ + 6),
                  "\t" === d)
                ) {
                  const e = g + m;
                  ((m = tz.nextRenderTabStop(g + m, a.tabSize)), (p += u * (m - e)), (m -= g + 1));
                } else p += u;
                continue;
              }
              const c = d5.decorationStyleCache.getOrCreateEntry(o, r, s);
              ((i = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, d, y, c, p)),
                (f = Math.round(
                  e.relativeVerticalOffset[h - e.startLineNumber] * C +
                    Math.floor(
                      (e.lineHeight * C - (i.fontBoundingBoxAscent + i.fontBoundingBoxDescent)) / 2,
                    ) +
                    i.fontBoundingBoxAscent,
                )),
                (_ = 6 * ((h - e.startLineNumber) * v5.maxSupportedColumns + g)),
                (k[_ + 0] = Math.floor(p)),
                (k[_ + 1] = f),
                (k[_ + 4] = i.glyphIndex),
                (k[_ + 5] = i.pageIndex),
                (p += u));
            }
            v = b;
          }
        ((x = 6 * ((h - e.startLineNumber) * v5.maxSupportedColumns + b)),
          (w = (h - e.startLineNumber) * v5.maxSupportedColumns * 6),
          k.fill(0, x, w));
      }
    const N = (e.endLineNumber - e.startLineNumber + 1) * E;
    return (
      this._device.queue.writeBuffer(
        this._cellBindBuffer,
        0,
        k.buffer,
        0,
        (e.endLineNumber - e.startLineNumber) * E * Float32Array.BYTES_PER_ELEMENT,
      ),
      (this._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1),
      (this._visibleObjectCount = N),
      N
    );
  }
  draw(e, t) {
    if (this._visibleObjectCount <= 0) throw new QI("Attempt to draw 0 objects");
    e.draw(I4.length / 2, this._visibleObjectCount);
  }
}
function b5(e) {
  switch (e) {
    case "lighter":
    case "normal":
      return 400;
    case "bolder":
    case "bold":
      return 700;
  }
  return parseInt(e);
}
function y5(e) {
  return e.endsWith("%")
    ? parseFloat(e.substring(0, e.length - 1)) / 100
    : e.match(/^\d+(?:\.\d*)/)
      ? parseFloat(e)
      : 1;
}
class x5 extends m5 {
  static {
    this.maxSupportedLines = 3e3;
  }
  static {
    this.maxSupportedColumns = 200;
  }
  get bindGroupEntries() {
    return [
      { binding: 1, resource: { buffer: this._cellBindBuffer } },
      { binding: 6, resource: { buffer: this._scrollOffsetBindBuffer } },
    ];
  }
  constructor(e, t, n, i) {
    (super(e, t, n, i),
      (this.type = "fullfile"),
      (this.wgsl = _5),
      (this._activeDoubleBufferIndex = 0),
      (this._upToDateLines = [new Set(), new Set()]),
      (this._visibleObjectCount = 0),
      (this._finalRenderedLine = 0),
      (this._scrollInitialized = !1),
      (this._queuedBufferUpdates = [[], []]));
    const r = x5.maxSupportedLines * x5.maxSupportedColumns * 6 * Float32Array.BYTES_PER_ELEMENT;
    ((this._cellBindBuffer = this._register(
      Q4.createBuffer(this._device, {
        label: "Monaco full file cell buffer",
        size: r,
        usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
      }),
    ).object),
      (this._cellValueBuffers = [new ArrayBuffer(r), new ArrayBuffer(r)]));
    ((this._scrollOffsetBindBuffer = this._register(
      Q4.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(e) {
    return (this._invalidateAllLines(), this._queueBufferUpdate(e), !0);
  }
  onDecorationsChanged(e) {
    return (this._invalidateAllLines(), !0);
  }
  onTokensChanged(e) {
    for (const t of e.ranges) this._invalidateLineRange(t.fromLineNumber, t.toLineNumber);
    return !0;
  }
  onLinesDeleted(e) {
    return (this._invalidateLinesFrom(e.fromLineNumber), this._queueBufferUpdate(e), !0);
  }
  onLinesInserted(e) {
    return (this._invalidateLinesFrom(e.fromLineNumber), !0);
  }
  onLinesChanged(e) {
    return (this._invalidateLineRange(e.fromLineNumber, e.fromLineNumber + e.count), !0);
  }
  onScrollChanged(e) {
    const t = wB().devicePixelRatio;
    return (
      (this._scrollOffsetValueBuffer[0] =
        (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * t),
      (this._scrollOffsetValueBuffer[1] =
        (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * t),
      this._device.queue.writeBuffer(
        this._scrollOffsetBindBuffer,
        0,
        this._scrollOffsetValueBuffer,
      ),
      !0
    );
  }
  onThemeChanged(e) {
    return (this._invalidateAllLines(), !0);
  }
  onLineMappingChanged(e) {
    return (this._invalidateAllLines(), this._queueBufferUpdate(e), !0);
  }
  onZonesChanged(e) {
    return (this._invalidateAllLines(), this._queueBufferUpdate(e), !0);
  }
  _invalidateAllLines() {
    (this._upToDateLines[0].clear(), this._upToDateLines[1].clear());
  }
  _invalidateLinesFrom(e) {
    for (const t of [0, 1]) {
      const n = this._upToDateLines[t];
      for (const t of n) t >= e && n.delete(t);
    }
  }
  _invalidateLineRange(e, t) {
    for (let n = e; n <= t; n++)
      (this._upToDateLines[0].delete(n), this._upToDateLines[1].delete(n));
  }
  reset() {
    this._invalidateAllLines();
    for (const e of [0, 1]) {
      const t = new Float32Array(this._cellValueBuffers[e]);
      (t.fill(0, 0, t.length),
        this._device.queue.writeBuffer(this._cellBindBuffer, 0, t.buffer, 0, t.byteLength));
    }
    this._finalRenderedLine = 0;
  }
  update(e, t) {
    let n,
      i,
      r,
      o,
      s,
      a,
      l,
      c,
      d = "",
      u = 0,
      h = 0,
      g = 0,
      p = 0,
      f = 0,
      m = 0,
      _ = 0,
      v = 0,
      b = 0,
      y = 0,
      x = 0,
      w = 0;
    const C = wB().devicePixelRatio;
    let S;
    this._scrollInitialized || (this.onScrollChanged(), (this._scrollInitialized = !0));
    const k = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]),
      E = 6 * x5.maxSupportedColumns,
      N = this._upToDateLines[this._activeDoubleBufferIndex];
    let L = 3e3,
      D = 0;
    const T = this._queuedBufferUpdates[this._activeDoubleBufferIndex];
    for (; T.length; ) {
      const e = T.shift();
      switch (e.type) {
        case 2:
        case 8:
        case 17:
          (k.fill(0),
            (L = 1),
            (D = Math.max(D, this._finalRenderedLine)),
            (this._finalRenderedLine = 0));
          break;
        case 10: {
          const t = (e.fromLineNumber - 1) * x5.maxSupportedColumns * 6,
            n = e.toLineNumber * x5.maxSupportedColumns * 6,
            i =
              (this._finalRenderedLine - (e.toLineNumber - e.fromLineNumber + 1)) *
              x5.maxSupportedColumns *
              6;
          (k.set(k.subarray(n), t),
            k.fill(0, i),
            (L = Math.min(L, e.fromLineNumber)),
            (D = Math.max(D, this._finalRenderedLine)),
            (this._finalRenderedLine -= e.toLineNumber - e.fromLineNumber + 1));
          break;
        }
      }
    }
    for (h = e.startLineNumber; h <= e.endLineNumber; h++)
      if (this._viewGpuContext.canRender(t, e, h)) {
        if (!N.has(h)) {
          ((L = Math.min(L, h)),
            (D = Math.max(D, h)),
            (a = e.getViewLineRenderingData(h)),
            (m = 0),
            (S = g5(a, t)),
            (u = t.spaceWidth * C),
            (p = 0),
            (c = a.tokens),
            (v = a.minColumn - 1),
            (b = 0));
          for (let x = 0, w = c.getCount(); x < w; x++)
            if (((b = c.getEndOffset(x)), !(b <= v))) {
              for (y = c.getMetadata(x), g = v; g < b && !(g > x5.maxSupportedColumns); g++) {
                if (((n = S.getSegmentAtIndex(g)), void 0 === n)) continue;
                for (l of ((d = n),
                (a.isBasicASCII && t.useMonospaceOptimizations) ||
                  (u = this.glyphRasterizer.getTextMetrics(d).width),
                (o = void 0),
                (r = void 0),
                (s = void 0),
                a.inlineDecorations)) {
                  if (
                    h < l.range.startLineNumber ||
                    h > l.range.endLineNumber ||
                    (h === l.range.startLineNumber && g < l.range.startColumn - 1) ||
                    (h === l.range.endLineNumber && g >= l.range.endColumn - 1)
                  )
                    continue;
                  const e = d5.decorationCssRuleExtractor.getStyleRules(
                    this._viewGpuContext.canvas.domNode,
                    l.inlineClassName,
                  );
                  for (const t of e)
                    for (const e of t.style) {
                      const n = t.styleMap.get(e)?.toString() ?? "";
                      switch (e) {
                        case "color": {
                          const e = vG.Format.CSS.parse(n);
                          if (!e) throw new QI("Invalid color format " + n);
                          o = e.toNumber32Bit();
                          break;
                        }
                        case "font-weight":
                          r = w5(n) >= 400;
                          break;
                        case "opacity":
                          s = C5(n);
                          break;
                        default:
                          throw new QI("Unexpected inline decoration style");
                      }
                    }
                }
                if (" " === d || "\t" === d) {
                  if (
                    ((_ = 6 * ((h - 1) * x5.maxSupportedColumns + g)),
                    k.fill(0, _, _ + 6),
                    "\t" === d)
                  ) {
                    const e = g + m;
                    ((m = tz.nextRenderTabStop(g + m, a.tabSize)),
                      (p += u * (m - e)),
                      (m -= g + 1));
                  } else p += u;
                  continue;
                }
                const c = d5.decorationStyleCache.getOrCreateEntry(o, r, s);
                ((i = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, d, y, c, p)),
                  (f = Math.round(
                    e.relativeVerticalOffset[h - e.startLineNumber] * C +
                      Math.floor(
                        (e.lineHeight * C - (i.fontBoundingBoxAscent + i.fontBoundingBoxDescent)) /
                          2,
                      ) +
                      i.fontBoundingBoxAscent,
                  )),
                  (_ = 6 * ((h - 1) * x5.maxSupportedColumns + g)),
                  (k[_ + 0] = Math.floor(p)),
                  (k[_ + 1] = f),
                  (k[_ + 4] = i.glyphIndex),
                  (k[_ + 5] = i.pageIndex),
                  (p += u));
              }
              v = b;
            }
          ((x = 6 * ((h - 1) * x5.maxSupportedColumns + b)),
            (w = h * x5.maxSupportedColumns * 6),
            k.fill(0, x, w),
            N.add(h));
        }
      } else
        ((x = (h - 1) * x5.maxSupportedColumns * 6),
          (w = h * x5.maxSupportedColumns * 6),
          k.fill(0, x, w),
          (L = Math.min(L, h)),
          (D = Math.max(D, h)));
    const I = (e.endLineNumber - e.startLineNumber + 1) * E;
    return (
      (L = Math.min(L, x5.maxSupportedLines)),
      (D = Math.min(D, x5.maxSupportedLines)),
      L <= D &&
        this._device.queue.writeBuffer(
          this._cellBindBuffer,
          (L - 1) * E * Float32Array.BYTES_PER_ELEMENT,
          k.buffer,
          (L - 1) * E * Float32Array.BYTES_PER_ELEMENT,
          (D - L + 1) * E * Float32Array.BYTES_PER_ELEMENT,
        ),
      (this._finalRenderedLine = Math.max(this._finalRenderedLine, D)),
      (this._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1),
      (this._visibleObjectCount = I),
      I
    );
  }
  draw(e, t) {
    if (this._visibleObjectCount <= 0) throw new QI("Attempt to draw 0 objects");
    e.draw(
      I4.length / 2,
      this._visibleObjectCount,
      void 0,
      (t.startLineNumber - 1) * x5.maxSupportedColumns,
    );
  }
  _queueBufferUpdate(e) {
    (this._queuedBufferUpdates[0].push(e), this._queuedBufferUpdates[1].push(e));
  }
}
function w5(e) {
  switch (e) {
    case "lighter":
    case "normal":
      return 400;
    case "bolder":
    case "bold":
      return 700;
  }
  return parseInt(e);
}
function C5(e) {
  return e.endsWith("%")
    ? parseFloat(e.substring(0, e.length - 1)) / 100
    : e.match(/^\d+(?:\.\d*)/)
      ? parseFloat(e)
      : 1;
}
var S5 = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let k5 = class extends iQ {
  constructor(e, t, n, i) {
    (super(e),
      (this._viewGpuContext = t),
      (this._instantiationService = n),
      (this._logService = i),
      (this._atlasGpuTextureVersions = []),
      (this._initialized = !1),
      (this._glyphRasterizer = this._register(new jO())),
      (this._renderStrategy = this._register(new jO())),
      (this.canvas = this._viewGpuContext.canvas.domNode),
      this._register(
        rF((e) => {
          this._viewGpuContext.canvasDevicePixelDimensions.read(e);
          const t = this._lastViewportData;
          t &&
            setTimeout(() => {
              t === this._lastViewportData && this.renderText(t);
            });
        }),
      ),
      this.initWebgpu());
  }
  async initWebgpu() {
    if (((this._device = d5.deviceSync || (await d5.device)), this._store.isDisposed)) return;
    const e = d5.atlas;
    this._register(
      e.onDidDeleteGlyphs(() => {
        ((this._atlasGpuTextureVersions.length = 0),
          (this._atlasGpuTextureVersions[0] = 0),
          (this._atlasGpuTextureVersions[1] = 0),
          this._renderStrategy.value.reset());
      }),
    );
    const t = navigator.gpu.getPreferredCanvasFormat();
    let n, i;
    (this._viewGpuContext.ctx.configure({
      device: this._device,
      format: t,
      alphaMode: "premultiplied",
    }),
      (this._renderPassColorAttachment = { view: null, loadOp: "load", storeOp: "store" }),
      (this._renderPassDescriptor = {
        label: "Monaco render pass",
        colorAttachments: [this._renderPassColorAttachment],
      }));
    {
      const e = new Float32Array(6),
        t = (t = this.canvas.width, n = this.canvas.height) => (
          (e[0] = t),
          (e[1] = n),
          (e[2] = Math.ceil(
            this._context.configuration.options.get(165).contentLeft * wB().devicePixelRatio,
          )),
          (e[3] = 0),
          (e[4] = e[0] - e[2]),
          (e[5] = e[1] - e[3]),
          e
        );
      ((n = this._register(
        Q4.createBuffer(
          this._device,
          {
            label: "Monaco uniform buffer",
            size: 24,
            usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
          },
          () => t(),
        ),
      ).object),
        this._register(
          s5(this._viewGpuContext.canvasDevicePixelDimensions, ({ width: e, height: i }) => {
            this._device.queue.writeBuffer(n, 0, t(e, i));
          }),
        ),
        this._register(
          s5(this._viewGpuContext.contentLeft, () => {
            this._device.queue.writeBuffer(n, 0, t());
          }),
        ));
    }
    i = this._register(
      Q4.createBuffer(
        this._device,
        {
          label: "Monaco atlas info uniform buffer",
          size: 8,
          usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
        },
        () => {
          const t = new Float32Array(2);
          return ((t[0] = e.pageSize), (t[1] = e.pageSize), t);
        },
      ),
    ).object;
    const r = this._context.configuration.options.get(58),
      o = this._context.configuration.options.get(61);
    ((this._glyphRasterizer.value = this._register(
      new A4(o, r, this._viewGpuContext.devicePixelRatio.get(), d5.decorationStyleCache),
    )),
      this._register(
        s5(this._viewGpuContext.devicePixelRatio, () => {
          this._refreshGlyphRasterizer();
        }),
      ),
      (this._renderStrategy.value = this._instantiationService.createInstance(
        x5,
        this._context,
        this._viewGpuContext,
        this._device,
        this._glyphRasterizer,
      )),
      (this._glyphStorageBuffer = this._register(
        Q4.createBuffer(this._device, {
          label: "Monaco glyph storage buffer",
          size: q4.maximumPageCount * (24 * z4.maximumGlyphCount),
          usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
        }),
      ).object),
      (this._atlasGpuTextureVersions[0] = 0),
      (this._atlasGpuTextureVersions[1] = 0),
      (this._atlasGpuTexture = this._register(
        Q4.createTexture(this._device, {
          label: "Monaco atlas texture",
          format: "rgba8unorm",
          size: { width: e.pageSize, height: e.pageSize, depthOrArrayLayers: q4.maximumPageCount },
          dimension: "2d",
          usage:
            GPUTextureUsage.TEXTURE_BINDING |
            GPUTextureUsage.COPY_DST |
            GPUTextureUsage.RENDER_ATTACHMENT,
        }),
      ).object),
      this._updateAtlasStorageBufferAndTexture(),
      (this._vertexBuffer = this._register(
        Q4.createBuffer(
          this._device,
          {
            label: "Monaco vertex buffer",
            size: I4.byteLength,
            usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,
          },
          I4,
        ),
      ).object));
    const s = 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: s,
          buffers: [
            {
              arrayStride: 2 * Float32Array.BYTES_PER_ELEMENT,
              attributes: [{ shaderLocation: 0, offset: 0, format: "float32x2" }],
            },
          ],
        },
        fragment: {
          module: s,
          targets: [
            {
              format: t,
              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: n } },
            { binding: 5, resource: { buffer: i } },
            ...this._renderStrategy.value.bindGroupEntries,
          ],
        });
      }),
      this._rebuildBindGroup(),
      (this._initialized = !0),
      this._initViewportData)
    ) {
      for (const e of this._initViewportData) this.renderText(e);
      this._initViewportData = void 0;
    }
  }
  _refreshRenderStrategy(e) {
    if ("viewport" === this._renderStrategy.value?.type) return;
    if (
      e.endLineNumber < x5.maxSupportedLines &&
      this._viewportMaxColumn(e) < x5.maxSupportedColumns
    )
      return;
    this._logService.trace(
      `File is larger than ${x5.maxSupportedLines} lines or ${x5.maxSupportedColumns} columns, switching to viewport render strategy`,
    );
    const t = this._instantiationService.createInstance(
      v5,
      this._context,
      this._viewGpuContext,
      this._device,
      this._glyphRasterizer,
    );
    ((this._renderStrategy.value = t),
      this._register(t.onDidChangeBindGroupEntries(() => this._rebuildBindGroup?.())),
      this._rebuildBindGroup?.());
  }
  _viewportMaxColumn(e) {
    let t,
      n = 0;
    for (let i = e.startLineNumber; i <= e.endLineNumber; i++)
      ((t = e.getViewLineRenderingData(i)), (n = Math.max(n, t.maxColumn)));
    return n;
  }
  _updateAtlasStorageBufferAndTexture() {
    for (const [e, t] of d5.atlas.pages.entries()) {
      if (e >= q4.maximumPageCount) continue;
      if (t.version === this._atlasGpuTextureVersions[e]) continue;
      this._logService.trace(
        "Updating atlas page[",
        e,
        "] from version ",
        this._atlasGpuTextureVersions[e],
        " to version ",
        t.version,
      );
      const n = 6 * z4.maximumGlyphCount,
        i = new Float32Array(n);
      let r = 0;
      for (const e of t.glyphs)
        ((i[r + 0] = e.x),
          (i[r + 0 + 1] = e.y),
          (i[r + 2] = e.w),
          (i[r + 2 + 1] = e.h),
          (i[r + 4] = e.originOffsetX),
          (i[r + 4 + 1] = e.originOffsetY),
          (r += 6));
      if (r / 6 > z4.maximumGlyphCount)
        throw new Error(
          `Attempting to write more glyphs (${r / 6}) than the GPUBuffer can hold (${z4.maximumGlyphCount})`,
        );
      (this._device.queue.writeBuffer(
        this._glyphStorageBuffer,
        6 * e * z4.maximumGlyphCount * Float32Array.BYTES_PER_ELEMENT,
        i,
        0,
        6 * z4.maximumGlyphCount,
      ),
        t.usedArea.right - t.usedArea.left > 0 &&
          t.usedArea.bottom - t.usedArea.top > 0 &&
          this._device.queue.copyExternalImageToTexture(
            { source: t.source },
            {
              texture: this._atlasGpuTexture,
              origin: { x: t.usedArea.left, y: t.usedArea.top, z: e },
            },
            {
              width: t.usedArea.right - t.usedArea.left + 1,
              height: t.usedArea.bottom - t.usedArea.top + 1,
            },
          ),
        (this._atlasGpuTextureVersions[e] = t.version));
    }
  }
  prepareRender(e) {
    throw new QI("Should not be called");
  }
  render(e) {
    throw new QI("Should not be called");
  }
  onConfigurationChanged(e) {
    return (this._refreshGlyphRasterizer(), !0);
  }
  onCursorStateChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onLineMappingChanged(e) {
    return !0;
  }
  onRevealRangeRequest(e) {
    return !0;
  }
  onScrollChanged(e) {
    return !0;
  }
  onThemeChanged(e) {
    return !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  _refreshGlyphRasterizer() {
    const e = this._glyphRasterizer.value;
    if (!e) return;
    const t = this._context.configuration.options.get(58),
      n = this._context.configuration.options.get(61),
      i = this._viewGpuContext.devicePixelRatio.get();
    (e.fontFamily === t && e.fontSize === n && e.devicePixelRatio === i) ||
      (this._glyphRasterizer.value = new A4(n, t, i, d5.decorationStyleCache));
  }
  renderText(e) {
    if (this._initialized) return (this._refreshRenderStrategy(e), this._renderText(e));
    ((this._initViewportData = this._initViewportData ?? []), this._initViewportData.push(e));
  }
  _renderText(e) {
    this._viewGpuContext.rectangleRenderer.draw(e);
    const t = new J1(this._context.configuration, this._context.theme.type);
    (this._renderStrategy.value.update(e, t), this._updateAtlasStorageBufferAndTexture());
    const n = this._device.createCommandEncoder({ label: "Monaco command encoder" });
    this._renderPassColorAttachment.view = this._viewGpuContext.ctx
      .getCurrentTexture()
      .createView({ label: "Monaco canvas texture view" });
    const i = n.beginRenderPass(this._renderPassDescriptor);
    (i.setPipeline(this._pipeline), i.setVertexBuffer(0, this._vertexBuffer));
    const r = Math.ceil(
      this._viewGpuContext.contentLeft.get() * this._viewGpuContext.devicePixelRatio.get(),
    );
    (i.setScissorRect(r, 0, this.canvas.width - r, this.canvas.height),
      i.setBindGroup(0, this._bindGroup),
      this._renderStrategy.value.draw(i, e),
      i.end());
    const o = n.finish();
    (this._device.queue.submit([o]), (this._lastViewportData = e), (this._lastViewLineOptions = t));
  }
  linesVisibleRangesForRange(e, t) {
    if (!this._lastViewportData) return null;
    const n = e.endLineNumber,
      i = YH.intersectRanges(e, this._lastViewportData.visibleRange);
    if (!i) return null;
    const r = this._lastViewportData.startLineNumber,
      o = this._lastViewportData.endLineNumber,
      s = this._lastViewportData,
      a = this._lastViewLineOptions;
    if (!s || !a) return null;
    const l = [];
    let c = 0;
    t &&
      (c = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(
        new xV(i.startLineNumber, 1),
      ).lineNumber);
    for (let d = i.startLineNumber; d <= i.endLineNumber; d++) {
      if (d < r || d > o) continue;
      const e = d === i.startLineNumber ? i.startColumn : 1,
        s = d !== n,
        u = s ? this._context.viewModel.getLineMaxColumn(d) : i.endColumn,
        h = this._visibleRangesForLineRange(d, e, u);
      if (h) {
        if (t && d < n) {
          const e = c;
          ((c = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(
            new xV(d + 1, 1),
          ).lineNumber),
            e !== c && (h.ranges[h.ranges.length - 1].width += a.spaceWidth));
        }
        l.push(new aQ(h.outsideRenderedLine, d, lQ.from(h.ranges), s));
      }
    }
    return 0 === l.length ? null : l;
  }
  _visibleRangesForLineRange(e, t, n) {
    if (this.shouldRender()) return null;
    const i = this._lastViewportData,
      r = this._lastViewLineOptions;
    if (!i || !r || e < i.startLineNumber || e > i.endLineNumber) return null;
    const o = i.getViewLineRenderingData(e),
      s = o.content;
    let a;
    (o.isBasicASCII && r.useMonospaceOptimizations) || (a = g5(o, r));
    let l = "",
      c = 0,
      d = 0;
    for (let g = 0; g < t - 1; g++) {
      if (o.isBasicASCII && r.useMonospaceOptimizations) l = s.charAt(g);
      else {
        if (((l = a.getSegmentAtIndex(g)), void 0 === l)) continue;
        d +=
          this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width /
            wB().devicePixelRatio -
          r.spaceWidth;
      }
      "\t" === l ? (c = tz.nextRenderTabStop(c, o.tabSize)) : c++;
    }
    let u = c,
      h = 0;
    for (let g = t - 1; g < n - 1; g++) {
      if (o.isBasicASCII && r.useMonospaceOptimizations) l = s.charAt(g);
      else {
        if (((l = a.getSegmentAtIndex(g)), void 0 === l)) continue;
        h +=
          this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width /
            wB().devicePixelRatio -
          r.spaceWidth;
      }
      "\t" === l ? (u = tz.nextRenderTabStop(u, o.tabSize)) : u++;
    }
    return new uQ(!1, [new cQ(c * r.spaceWidth + d, (u - c) * r.spaceWidth + h)]);
  }
  visibleRangeForPosition(e) {
    const t = this._visibleRangesForLineRange(e.lineNumber, e.column, e.column);
    return t ? new dQ(t.outsideRenderedLine, t.ranges[0].left) : null;
  }
  getLineWidth(e) {
    if (!this._lastViewportData || !this._lastViewLineOptions) return;
    if (!this._viewGpuContext.canRender(this._lastViewLineOptions, this._lastViewportData, e))
      return;
    const t = this._lastViewportData.getViewLineRenderingData(e),
      n = this._visibleRangesForLineRange(e, 1, t.maxColumn),
      i = n?.ranges.at(-1);
    return i ? i.width : void 0;
  }
  getPositionAtCoordinate(e, t) {
    if (!this._lastViewportData || !this._lastViewLineOptions) return;
    if (!this._viewGpuContext.canRender(this._lastViewLineOptions, this._lastViewportData, e))
      return;
    const n = this._lastViewportData.getViewLineRenderingData(e),
      i = n.content,
      r = wB().devicePixelRatio,
      o = t * r,
      s = this._lastViewLineOptions.spaceWidth * r,
      a = g5(n, this._lastViewLineOptions);
    let l = 0,
      c = 0,
      d = 0,
      u = 0;
    for (let h = 0; h < i.length; h++) {
      const e = a.getSegmentAtIndex(h);
      if (void 0 !== e) {
        if ("\t" === e) {
          const e = h + d;
          ((d = tz.nextRenderTabStop(h + d, n.tabSize)), (c = s * (d - e)), (d -= h + 1));
        } else
          c =
            n.isBasicASCII && this._lastViewLineOptions.useMonospaceOptimizations
              ? s
              : this._renderStrategy.value.glyphRasterizer.getTextMetrics(e).width;
        if (o < l + c / 2) break;
        ((l += c), u++);
      } else u++;
    }
    return new xV(e, u + 1);
  }
};
k5 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([S5(2, vV), S5(3, yH)], k5);
const E5 = new (class {
    constructor() {
      ((this._onDidChange = new QO()),
        (this.onDidChange = this._onDidChange.event),
        (this._enabled = !0));
    }
    get enabled() {
      return this._enabled;
    }
    enable() {
      ((this._enabled = !0), this._onDidChange.fire());
    }
    disable() {
      ((this._enabled = !1), this._onDidChange.fire());
    }
  })(),
  N5 = bV("keybindingService");
class L5 extends iQ {}
class D5 {
  _getPageOfLine(e, t) {
    return Math.floor((e - 1) / t);
  }
  _getRangeForPage(e, t) {
    const n = e * t;
    return new YH(n + 1, 1, n + t + 1, 1);
  }
  fromEditorSelection(e, t, n, i) {
    const r = 500,
      o = this._getPageOfLine(t.startLineNumber, n),
      s = this._getRangeForPage(o, n),
      a = this._getPageOfLine(t.endLineNumber, n),
      l = this._getRangeForPage(a, n);
    let c = s.intersectRanges(new YH(1, 1, t.startLineNumber, t.startColumn));
    if (i && e.getValueLengthInRange(c, 1) > r) {
      const t = e.modifyPosition(c.getEndPosition(), -500);
      c = YH.fromPositions(t, c.getEndPosition());
    }
    const d = e.getValueInRange(c, 1),
      u = e.getLineCount(),
      h = e.getLineMaxColumn(u);
    let g = l.intersectRanges(new YH(t.endLineNumber, t.endColumn, u, h));
    if (i && e.getValueLengthInRange(g, 1) > r) {
      const t = e.modifyPosition(g.getStartPosition(), r);
      g = YH.fromPositions(g.getStartPosition(), t);
    }
    const p = e.getValueInRange(g, 1);
    let f, m, _;
    if (o === a || o + 1 === a) f = e.getValueInRange(t, 1);
    else {
      const n = s.intersectRanges(t),
        i = l.intersectRanges(t);
      f = e.getValueInRange(n, 1) + String.fromCharCode(8230) + e.getValueInRange(i, 1);
    }
    return (
      i &&
        f.length > 1e3 &&
        (f = f.substring(0, r) + String.fromCharCode(8230) + f.substring(f.length - r, f.length)),
      0 === t.getDirection()
        ? ((m = d.length), (_ = d.length + f.length))
        : ((_ = d.length), (m = d.length + f.length)),
      {
        value: d + f + p,
        selection: t,
        selectionStart: m,
        selectionEnd: _,
        startPositionWithinEditor: c.getStartPosition(),
        newlineCountBeforeSelection: c.endLineNumber - c.startLineNumber,
      }
    );
  }
}
function T5(e, t) {
  if (1 === e.get(2)) {
    const e = t
        .lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")
        ?.getAriaLabel(),
      n = t.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),
      i = t.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),
      r = SI(61, "The editor is not accessible at this time.");
    return e
      ? SI(62, "{0} To enable screen reader optimized mode, use {1}", r, e)
      : n
        ? SI(
            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.",
            r,
            n,
          )
        : i
          ? SI(
              64,
              "{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",
              r,
              i,
            )
          : r;
  }
  return e.get(8);
}
function I5(e) {
  let t = 0,
    n = -1;
  for (;;) {
    if (((n = e.indexOf("\n", n + 1)), -1 === n)) break;
    t++;
  }
  return t;
}
var R5 = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
class O5 {
  constructor(e, t, n, i, r) {
    ((this._context = e),
      (this.modelLineNumber = t),
      (this.distanceToModelLineStart = n),
      (this.widthOfHiddenLineTextBefore = i),
      (this.distanceToModelLineEnd = r),
      (this._visibleTextAreaBrand = void 0),
      (this.startPosition = null),
      (this.endPosition = null),
      (this.visibleTextareaStart = null),
      (this.visibleTextareaEnd = null),
      (this._previousPresentation = null));
  }
  prepareRender(e) {
    const t = new xV(this.modelLineNumber, this.distanceToModelLineStart + 1),
      n = new xV(
        this.modelLineNumber,
        this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber) -
          this.distanceToModelLineEnd,
      );
    ((this.startPosition =
      this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t)),
      (this.endPosition =
        this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n)),
      this.startPosition.lineNumber === this.endPosition.lineNumber
        ? ((this.visibleTextareaStart = e.visibleRangeForPosition(this.startPosition)),
          (this.visibleTextareaEnd = e.visibleRangeForPosition(this.endPosition)))
        : ((this.visibleTextareaStart = null), (this.visibleTextareaEnd = null)));
  }
  definePresentation(e) {
    return (
      this._previousPresentation ||
        (this._previousPresentation = e || {
          foreground: 1,
          italic: !1,
          bold: !1,
          underline: !1,
          strikethrough: !1,
        }),
      this._previousPresentation
    );
  }
}
const M5 = RI;
let A5 = class extends L5 {
  constructor(e, t, n, i, r, o) {
    (super(e),
      (this._keybindingService = r),
      (this._instantiationService = o),
      (this._primaryCursorPosition = new xV(1, 1)),
      (this._primaryCursorVisibleRange = null),
      (this._viewController = n),
      (this._visibleRangeProvider = i),
      (this._scrollLeft = 0),
      (this._scrollTop = 0));
    const s = this._context.configuration.options,
      a = s.get(165);
    (this._setAccessibilityOptions(s),
      (this._contentLeft = a.contentLeft),
      (this._contentWidth = a.contentWidth),
      (this._contentHeight = a.height),
      (this._fontInfo = s.get(59)),
      (this._emptySelectionClipboard = s.get(45)),
      (this._copyWithSyntaxHighlighting = s.get(31)),
      (this._visibleTextArea = null),
      (this._selections = [new XH(1, 1, 1, 1)]),
      (this._modelSelections = [new XH(1, 1, 1, 1)]),
      (this._lastRenderPosition = null),
      (this.textArea = Bq(document.createElement("textarea"))),
      rQ.write(this.textArea, 7),
      this.textArea.setClassName(`inputarea ${X1}`),
      this.textArea.setAttribute(
        "wrap",
        this._textAreaWrapping && !this._visibleTextArea ? "on" : "off",
      ));
    const { tabSize: l } = this._context.viewModel.model.getOptions();
    ((this.textArea.domNode.style.tabSize = l * 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", T5(s, this._keybindingService)),
      this.textArea.setAttribute("aria-required", s.get(9) ? "true" : "false"),
      this.textArea.setAttribute("tabindex", String(s.get(140))),
      this.textArea.setAttribute("role", "textbox"),
      this.textArea.setAttribute("aria-roledescription", SI(65, "editor")),
      this.textArea.setAttribute("aria-multiline", "true"),
      this.textArea.setAttribute("aria-autocomplete", s.get(104) ? "none" : "both"),
      this._ensureReadOnlyAttribute(),
      (this.textAreaCover = Bq(document.createElement("div"))),
      this.textAreaCover.setPosition("absolute"),
      t.appendChild(this.textArea),
      t.appendChild(this.textAreaCover));
    const c = new D5(),
      d = {
        getDataToCopy: () =>
          OJ(
            this._context.viewModel,
            this._modelSelections,
            this._emptySelectionClipboard,
            this._copyWithSyntaxHighlighting,
          ),
        getScreenReaderContent: () => {
          if (1 === this._accessibilitySupport) {
            const e = this._selections[0];
            if (PR && e.isEmpty()) {
              const t = e.getStartPosition();
              let n = this._getWordBeforePosition(t);
              if ((0 === n.length && (n = this._getCharacterBeforePosition(t)), n.length > 0))
                return new jJ(n, n.length, n.length, YH.fromPositions(t), 0);
            }
            const t = 500;
            if (PR && !e.isEmpty() && this._context.viewModel.getValueLengthInRange(e, 0) < t) {
              const t = this._context.viewModel.getValueInRange(e, 0);
              return new jJ(t, 0, t.length, e, 0);
            }
            if (AI && !e.isEmpty()) {
              const e = "vscode-placeholder";
              return new jJ(e, 0, e.length, null, void 0);
            }
            return jJ.EMPTY;
          }
          if (jI) {
            const e = this._selections[0];
            if (e.isEmpty()) {
              const t = e.getStartPosition(),
                [n, i] = this._getAndroidWordAtPosition(t);
              if (n.length > 0) return new jJ(n, i, i, YH.fromPositions(t), 0);
            }
            return jJ.EMPTY;
          }
          const e = c.fromEditorSelection(
            this._context.viewModel,
            this._selections[0],
            this._accessibilityPageSize,
            0 === this._accessibilitySupport,
          );
          return jJ.fromScreenReaderContentState(e);
        },
        deduceModelPosition: (e, t, n) =>
          this._context.viewModel.deduceModelPositionRelativeToViewPosition(e, t, n),
      },
      u = this._register(new UJ(this.textArea.domNode));
    ((this._textAreaInput = this._register(
      this._instantiationService.createInstance(zJ, d, u, GR, {
        isAndroid: jI,
        isChrome: MI,
        isFirefox: RI,
        isSafari: AI,
      }),
    )),
      this._register(
        this._textAreaInput.onKeyDown((e) => {
          this._viewController.emitKeyDown(e);
        }),
      ),
      this._register(
        this._textAreaInput.onKeyUp((e) => {
          this._viewController.emitKeyUp(e);
        }),
      ),
      this._register(
        this._textAreaInput.onPaste((e) => {
          let t = !1,
            n = null,
            i = null;
          (e.metadata &&
            ((t = this._emptySelectionClipboard && !!e.metadata.isFromEmptySelection),
            (n = void 0 !== e.metadata.multicursorText ? e.metadata.multicursorText : null),
            (i = e.metadata.mode)),
            this._viewController.paste(e.text, t, n, i));
        }),
      ),
      this._register(
        this._textAreaInput.onCut(() => {
          this._viewController.cut();
        }),
      ),
      this._register(
        this._textAreaInput.onType((e) => {
          e.replacePrevCharCnt || e.replaceNextCharCnt || e.positionDelta
            ? this._viewController.compositionType(
                e.text,
                e.replacePrevCharCnt,
                e.replaceNextCharCnt,
                e.positionDelta,
              )
            : this._viewController.type(e.text);
        }),
      ),
      this._register(
        this._textAreaInput.onSelectionChangeRequest((e) => {
          this._viewController.setSelection(e);
        }),
      ),
      this._register(
        this._textAreaInput.onCompositionStart((e) => {
          const t = this.textArea.domNode,
            n = this._modelSelections[0],
            { distanceToModelLineStart: i, widthOfHiddenTextBefore: r } = (() => {
              const e = t.value.substring(0, Math.min(t.selectionStart, t.selectionEnd)),
                i = e.lastIndexOf("\n"),
                r = e.substring(i + 1),
                o = r.lastIndexOf("\t"),
                s = r.length - o - 1,
                a = n.getStartPosition(),
                l = Math.min(a.column - 1, s),
                c = a.column - 1 - l,
                d = r.substring(0, r.length - l),
                { tabSize: u } = this._context.viewModel.model.getOptions(),
                h = (function (e, t, n, i) {
                  if (0 === t.length) return 0;
                  const r = e.createElement("div");
                  ((r.style.position = "absolute"),
                    (r.style.top = "-50000px"),
                    (r.style.width = "50000px"));
                  const o = e.createElement("span");
                  (Vq(o, n),
                    (o.style.whiteSpace = "pre"),
                    (o.style.tabSize = i * n.spaceWidth + "px"),
                    o.append(t),
                    r.appendChild(o),
                    e.body.appendChild(r));
                  const s = o.offsetWidth;
                  return (r.remove(), s);
                })(this.textArea.domNode.ownerDocument, d, this._fontInfo, u);
              return { distanceToModelLineStart: c, widthOfHiddenTextBefore: h };
            })(),
            { distanceToModelLineEnd: o } = (() => {
              const e = t.value.substring(Math.max(t.selectionStart, t.selectionEnd)),
                i = e.indexOf("\n"),
                r = -1 === i ? e : e.substring(0, i),
                o = r.indexOf("\t"),
                s = -1 === o ? r.length : r.length - o - 1,
                a = n.getEndPosition(),
                l = Math.min(
                  this._context.viewModel.model.getLineMaxColumn(a.lineNumber) - a.column,
                  s,
                );
              return {
                distanceToModelLineEnd:
                  this._context.viewModel.model.getLineMaxColumn(a.lineNumber) - a.column - l,
              };
            })();
          (this._context.viewModel.revealRange(
            "keyboard",
            !0,
            YH.fromPositions(this._selections[0].getStartPosition()),
            0,
            1,
          ),
            (this._visibleTextArea = new O5(this._context, n.startLineNumber, i, r, o)),
            this.textArea.setAttribute(
              "wrap",
              this._textAreaWrapping && !this._visibleTextArea ? "on" : "off",
            ),
            this._visibleTextArea.prepareRender(this._visibleRangeProvider),
            this._render(),
            this.textArea.setClassName(`inputarea ${X1} ime-input`),
            this._viewController.compositionStart(),
            this._context.viewModel.onCompositionStart());
        }),
      ),
      this._register(
        this._textAreaInput.onCompositionUpdate((e) => {
          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 ${X1}`),
            this._viewController.compositionEnd(),
            this._context.viewModel.onCompositionEnd());
        }),
      ),
      this._register(
        this._textAreaInput.onFocus(() => {
          this._context.viewModel.setHasFocus(!0);
        }),
      ),
      this._register(
        this._textAreaInput.onBlur(() => {
          this._context.viewModel.setHasFocus(!1);
        }),
      ),
      this._register(
        E5.onDidChange(() => {
          this._ensureReadOnlyAttribute();
        }),
      ));
  }
  get domNode() {
    return this.textArea;
  }
  writeScreenReaderContent(e) {
    this._textAreaInput.writeNativeTextAreaContent(e);
  }
  dispose() {
    (super.dispose(), this.textArea.domNode.remove(), this.textAreaCover.domNode.remove());
  }
  _getAndroidWordAtPosition(e) {
    const t = this._context.viewModel.getLineContent(e.lineNumber),
      n = Mz('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?', []);
    let i = !0,
      r = e.column,
      o = !0,
      s = e.column,
      a = 0;
    for (; a < 50 && (i || o); ) {
      if ((i && r <= 1 && (i = !1), i)) {
        const e = t.charCodeAt(r - 2);
        0 !== n.get(e) ? (i = !1) : r--;
      }
      if ((o && s > t.length && (o = !1), o)) {
        const e = t.charCodeAt(s - 1);
        0 !== n.get(e) ? (o = !1) : s++;
      }
      a++;
    }
    return [t.substring(r - 1, s - 1), e.column - r];
  }
  _getWordBeforePosition(e) {
    const t = this._context.viewModel.getLineContent(e.lineNumber),
      n = Mz(this._context.configuration.options.get(148), []);
    let i = e.column,
      r = 0;
    for (; i > 1; ) {
      const o = t.charCodeAt(i - 2);
      if (0 !== n.get(o) || r > 50) return t.substring(i - 1, e.column - 1);
      (r++, i--);
    }
    return t.substring(0, e.column - 1);
  }
  _getCharacterBeforePosition(e) {
    if (e.column > 1) {
      const t = this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column - 2);
      if (!uA(t.charCodeAt(0))) return t;
    }
    return "";
  }
  _setAccessibilityOptions(e) {
    this._accessibilitySupport = e.get(2);
    const t = e.get(3);
    2 === this._accessibilitySupport && t === BK.accessibilityPageSize.defaultValue
      ? (this._accessibilityPageSize = 500)
      : (this._accessibilityPageSize = t);
    const n = e.get(165).wrappingColumn;
    if (-1 !== n && 1 !== this._accessibilitySupport) {
      const t = e.get(59);
      ((this._textAreaWrapping = !0),
        (this._textAreaWidth = Math.round(n * t.typicalHalfwidthCharacterWidth)));
    } else ((this._textAreaWrapping = !1), (this._textAreaWidth = M5 ? 0 : 1));
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options,
      n = t.get(165);
    (this._setAccessibilityOptions(t),
      (this._contentLeft = n.contentLeft),
      (this._contentWidth = n.contentWidth),
      (this._contentHeight = n.height),
      (this._fontInfo = t.get(59)),
      (this._emptySelectionClipboard = t.get(45)),
      (this._copyWithSyntaxHighlighting = t.get(31)),
      this.textArea.setAttribute(
        "wrap",
        this._textAreaWrapping && !this._visibleTextArea ? "on" : "off",
      ));
    const { tabSize: i } = this._context.viewModel.model.getOptions();
    return (
      (this.textArea.domNode.style.tabSize = i * this._fontInfo.spaceWidth + "px"),
      this.textArea.setAttribute("aria-label", T5(t, this._keybindingService)),
      this.textArea.setAttribute("aria-required", t.get(9) ? "true" : "false"),
      this.textArea.setAttribute("tabindex", String(t.get(140))),
      (e.hasChanged(41) || e.hasChanged(104)) && this._ensureReadOnlyAttribute(),
      e.hasChanged(2) && this._textAreaInput.writeNativeTextAreaContent("strategy changed"),
      !0
    );
  }
  onCursorStateChanged(e) {
    return (
      (this._selections = e.selections.slice(0)),
      (this._modelSelections = e.modelSelections.slice(0)),
      this._textAreaInput.writeNativeTextAreaContent("selection changed"),
      !0
    );
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return ((this._scrollLeft = e.scrollLeft), (this._scrollTop = e.scrollTop), !0);
  }
  onZonesChanged(e) {
    return !0;
  }
  isFocused() {
    return this._textAreaInput.isFocused();
  }
  focus() {
    this._textAreaInput.focusTextArea();
  }
  refreshFocusState() {
    this._textAreaInput.refreshFocusState();
  }
  getLastRenderData() {
    return this._lastRenderPosition;
  }
  setAriaOptions(e) {
    (e.activeDescendant
      ? (this.textArea.setAttribute("aria-haspopup", "true"),
        this.textArea.setAttribute("aria-autocomplete", "list"),
        this.textArea.setAttribute("aria-activedescendant", e.activeDescendant))
      : (this.textArea.setAttribute("aria-haspopup", "false"),
        this.textArea.setAttribute("aria-autocomplete", "both"),
        this.textArea.removeAttribute("aria-activedescendant")),
      e.role && this.textArea.setAttribute("role", e.role));
  }
  _ensureReadOnlyAttribute() {
    const e = this._context.configuration.options;
    !E5.enabled || (e.get(41) && e.get(104))
      ? this.textArea.setAttribute("readonly", "true")
      : this.textArea.removeAttribute("readonly");
  }
  prepareRender(e) {
    ((this._primaryCursorPosition = new xV(
      this._selections[0].positionLineNumber,
      this._selections[0].positionColumn,
    )),
      (this._primaryCursorVisibleRange = e.visibleRangeForPosition(this._primaryCursorPosition)),
      this._visibleTextArea?.prepareRender(e));
  }
  render(e) {
    (this._textAreaInput.writeNativeTextAreaContent("render"), this._render());
  }
  _render() {
    if (this._visibleTextArea) {
      const e = this._visibleTextArea.visibleTextareaStart,
        t = this._visibleTextArea.visibleTextareaEnd,
        n = this._visibleTextArea.startPosition,
        i = this._visibleTextArea.endPosition;
      if (
        n &&
        i &&
        e &&
        t &&
        t.left >= this._scrollLeft &&
        e.left <= this._scrollLeft + this._contentWidth
      ) {
        const r =
            this._context.viewLayout.getVerticalOffsetForLineNumber(
              this._primaryCursorPosition.lineNumber,
            ) - this._scrollTop,
          o = I5(this.textArea.domNode.value.substr(0, this.textArea.domNode.selectionStart));
        let s = this._visibleTextArea.widthOfHiddenLineTextBefore,
          a = this._contentLeft + e.left - this._scrollLeft,
          l = t.left - e.left + 1;
        if (a < this._contentLeft) {
          const e = this._contentLeft - a;
          ((a += e), (s += e), (l -= e));
        }
        l > this._contentWidth && (l = this._contentWidth);
        const c = this._context.viewLayout.getLineHeightForLineNumber(n.lineNumber),
          d = this._context.viewModel.getFontSizeAtPosition(this._primaryCursorPosition),
          u = this._context.viewModel.getViewLineData(n.lineNumber),
          h = u.tokens.findTokenIndexAtOffset(n.column - 1),
          g = h === u.tokens.findTokenIndexAtOffset(i.column - 1),
          p = this._visibleTextArea.definePresentation(g ? u.tokens.getPresentation(h) : null);
        ((this.textArea.domNode.scrollTop = o * c),
          (this.textArea.domNode.scrollLeft = s),
          this._doRender({
            lastRenderPosition: null,
            top: r,
            left: a,
            width: l,
            height: c,
            useCover: !1,
            color: (I2.getColorMap() || [])[p.foreground],
            italic: p.italic,
            bold: p.bold,
            underline: p.underline,
            strikethrough: p.strikethrough,
            fontSize: d,
          }));
      }
      return;
    }
    if (!this._primaryCursorVisibleRange) return void this._renderAtTopLeft();
    const e = this._contentLeft + this._primaryCursorVisibleRange.left - this._scrollLeft;
    if (e < this._contentLeft || e > this._contentLeft + this._contentWidth)
      return void this._renderAtTopLeft();
    const t =
      this._context.viewLayout.getVerticalOffsetForLineNumber(
        this._selections[0].positionLineNumber,
      ) - this._scrollTop;
    if (t < 0 || t > this._contentHeight) this._renderAtTopLeft();
    else {
      if (PR || 2 === this._accessibilitySupport) {
        const n = this._primaryCursorPosition.lineNumber,
          i = this._context.viewLayout.getLineHeightForLineNumber(n);
        (this._doRender({
          lastRenderPosition: this._primaryCursorPosition,
          top: t,
          left: this._textAreaWrapping ? this._contentLeft : e,
          width: this._textAreaWidth,
          height: i,
          useCover: !1,
        }),
          (this.textArea.domNode.scrollLeft = this._primaryCursorVisibleRange.left));
        const r =
          this._textAreaInput.textAreaState.newlineCountBeforeSelection ??
          I5(this.textArea.domNode.value.substring(0, this.textArea.domNode.selectionStart));
        return void (this.textArea.domNode.scrollTop = r * i);
      }
      this._doRender({
        lastRenderPosition: this._primaryCursorPosition,
        top: t,
        left: this._textAreaWrapping ? this._contentLeft : e,
        width: this._textAreaWidth,
        height: M5 ? 0 : 1,
        useCover: !1,
      });
    }
  }
  _renderAtTopLeft() {
    this._doRender({
      lastRenderPosition: null,
      top: 0,
      left: 0,
      width: this._textAreaWidth,
      height: M5 ? 0 : 1,
      useCover: !0,
    });
  }
  _doRender(e) {
    this._lastRenderPosition = e.lastRenderPosition;
    const t = this.textArea,
      n = this.textAreaCover;
    (Vq(t, this._fontInfo),
      t.setTop(e.top),
      t.setLeft(e.left),
      t.setWidth(e.width),
      t.setHeight(e.height),
      t.setLineHeight(e.height),
      t.setFontSize(e.fontSize ?? this._fontInfo.fontSize),
      t.setColor(e.color ? vG.Format.CSS.formatHex(e.color) : ""),
      t.setFontStyle(e.italic ? "italic" : ""),
      e.bold && t.setFontWeight("bold"),
      t.setTextDecoration(
        `${e.underline ? " underline" : ""}${e.strikethrough ? " line-through" : ""}`,
      ),
      n.setTop(e.useCover ? e.top : 0),
      n.setLeft(e.useCover ? e.left : 0),
      n.setWidth(e.useCover ? e.width : 0),
      n.setHeight(e.useCover ? e.height : 0));
    const i = this._context.configuration.options;
    i.get(66)
      ? n.setClassName("monaco-editor-background textAreaCover " + o2.OUTER_CLASS_NAME)
      : 0 !== i.get(76).renderType
        ? n.setClassName("monaco-editor-background textAreaCover " + Y1.CLASS_NAME)
        : n.setClassName("monaco-editor-background textAreaCover");
  }
};
A5 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([R5(4, N5), R5(5, vV)], A5);
let P5 = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this._domNode = t),
      (this._onFocusChange = n),
      (this._isFocused = !1),
      (this._isPaused = !1),
      this._register(
        $F(this._domNode, "focus", () => {
          (e.trace("NativeEditContext.focus"), this._isPaused || this.refreshFocusState());
        }),
      ),
      this._register(
        $F(this._domNode, "blur", () => {
          (e.trace("NativeEditContext.blur"), this._isPaused || this._handleFocusedChanged(!1));
        }),
      ));
  }
  pause() {
    this._isPaused = !0;
  }
  resume() {
    ((this._isPaused = !1), this.refreshFocusState());
  }
  _handleFocusedChanged(e) {
    this._isFocused !== e && ((this._isFocused = e), this._onFocusChange(this._isFocused));
  }
  focus() {
    (this._domNode.focus(), this.refreshFocusState());
  }
  refreshFocusState() {
    const e = _B(this._domNode),
      t = e ? e.activeElement : vB(),
      n = this._domNode === t;
    this._handleFocusedChanged(n);
  }
  get isFocused() {
    return this._isFocused;
  }
};
function j5(e, t, n, i) {
  return (
    e.addEventListener(t, n, i),
    {
      dispose() {
        e.removeEventListener(t, n);
      },
    }
  );
}
P5 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, yH),
  ],
  P5,
);
const F5 = ZJ("richScreenReaderContent", { createHTML: (e) => e }),
  B5 = "data-line-number";
let V5 = class extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._domNode = e),
      (this._context = t),
      (this._viewController = n),
      (this._accessibilityService = i),
      (this._selectionChangeListener = this._register(new jO())),
      (this._accessibilityPageSize = 1),
      (this._ignoreSelectionChangeTime = 0),
      (this._state = z5.NULL),
      (this._strategy = new U5()),
      (this._renderedLines = new Map()),
      (this._renderedSelection = new XH(1, 1, 1, 1)),
      this.onConfigurationChanged(this._context.configuration.options));
  }
  updateScreenReaderContent(e) {
    const t = wB().document.activeElement;
    if (!t || t !== this._domNode.domNode) return;
    if (this._accessibilityService.isScreenReaderOptimized()) {
      const t = this._getScreenReaderContentLineIntervals(e);
      (this._state.equals(t) ||
        ((this._state = t), (this._renderedLines = this._renderScreenReaderContent(t))),
        this._renderedSelection.equalsSelection(e) ||
          ((this._renderedSelection = e),
          this._setSelectionOnScreenReaderContent(this._context, this._renderedLines, e)));
    } else
      ((this._state = z5.NULL),
        this._setIgnoreSelectionChangeTime("setValue"),
        (this._domNode.domNode.textContent = ""));
  }
  updateScrollTop(e) {
    const t = this._state.intervals;
    if (!t.length) return;
    const n = this._context.viewModel.viewLayout,
      i = t[0].startLine,
      r = n.getVerticalOffsetForLineNumber(i),
      o = n.getVerticalOffsetForLineNumber(e.positionLineNumber);
    this._domNode.domNode.scrollTop = o - r;
  }
  onFocusChange(e) {
    this._selectionChangeListener.value = e ? this._setSelectionChangeListener() : void 0;
  }
  onConfigurationChanged(e) {
    this._accessibilityPageSize = e.get(3);
  }
  onWillCut() {
    this._setIgnoreSelectionChangeTime("onCut");
  }
  onWillPaste() {
    this._setIgnoreSelectionChangeTime("onWillPaste");
  }
  _setIgnoreSelectionChangeTime(e) {
    this._ignoreSelectionChangeTime = Date.now();
  }
  _setSelectionChangeListener() {
    let e = 0;
    return $F(this._domNode.domNode.ownerDocument, "selectionchange", () => {
      if (!(wB().document.activeElement === this._domNode.domNode)) return;
      if (!this._accessibilityService.isScreenReaderOptimized() || !E5.enabled) return;
      const t = Date.now(),
        n = t - e;
      if (((e = t), n < 5)) return;
      const i = t - this._ignoreSelectionChangeTime;
      if (((this._ignoreSelectionChangeTime = 0), i < 100)) return;
      const r = this._getEditorSelectionFromDomRange();
      r && this._viewController.setSelection(r);
    });
  }
  _renderScreenReaderContent(e) {
    const t = [],
      n = new Map();
    for (const i of e.intervals)
      for (let e = i.startLine; e <= i.endLine; e++) {
        const i = this._renderLine(e);
        (n.set(e, i), t.push(i.domNode));
      }
    return (
      this._setIgnoreSelectionChangeTime("setValue"),
      this._domNode.domNode.replaceChildren(...t),
      n
    );
  }
  _renderLine(e) {
    const t = this._context.viewModel,
      n = t.getViewLineRenderingData(e),
      i = this._context.configuration.options,
      r = i.get(59),
      o = i.get(133),
      s = i.get(108),
      a = i.get(60),
      l = i.get(40),
      c = gQ.filter(n.inlineDecorations, e, n.minColumn, n.maxColumn),
      d = r.isMonospace && !l,
      u = a !== xK.OFF;
    let h;
    h = "off" === i.get(47) ? i.get(113) : "none";
    const g = new vQ(
        d,
        r.canUseHalfwidthRightwardsArrow,
        n.content,
        n.continuesWithWrappedLine,
        n.isBasicASCII,
        n.containsRTL,
        n.minColumn - 1,
        n.tokens,
        c,
        n.tabSize,
        n.startVisibleColumn,
        r.spaceWidth,
        r.middotWidth,
        r.wsmiddotWidth,
        o,
        h,
        s,
        u,
        null,
        null,
        0,
        !0,
      ),
      p = new bU(1e4),
      f = wQ(g, p),
      m = p.build(),
      _ = F5?.createHTML(m) ?? m,
      v = t.viewLayout.getLineHeightForLineNumber(e) + "px",
      b = document.createElement("div");
    return (
      (b.innerHTML = _),
      (b.style.lineHeight = v),
      (b.style.height = v),
      b.setAttribute(B5, e.toString()),
      new W5(b, f.characterMapping)
    );
  }
  _setSelectionOnScreenReaderContent(e, t, n) {
    const i = wB().document.getSelection();
    if (!i) return;
    const r = n.startLineNumber,
      o = n.endLineNumber,
      s = t.get(r),
      a = t.get(o);
    if (!s || !a) return;
    const l = e.viewModel,
      c = l.model,
      d = l.coordinatesConverter,
      u = new YH(r, 1, r, n.selectionStartColumn),
      h = d.convertViewRangeToModelRange(u),
      g = c.getCharacterCountInRange(h),
      p = new YH(o, 1, o, n.positionColumn),
      f = d.convertViewRangeToModelRange(p),
      m = c.getCharacterCountInRange(f),
      _ = s.characterMapping.getDomPosition(g),
      v = a.characterMapping.getDomPosition(m),
      b = s.domNode.firstChild,
      y = a.domNode.firstChild,
      x = b.childNodes,
      w = y.childNodes,
      C = x.item(_.partIndex),
      S = w.item(v.partIndex);
    C.firstChild &&
      S.firstChild &&
      (this._setIgnoreSelectionChangeTime("setRange"),
      i.setBaseAndExtent(
        C.firstChild,
        1 === n.startColumn ? 0 : _.charIndex + 1,
        S.firstChild,
        1 === n.endColumn ? 0 : v.charIndex + 1,
      ));
  }
  _getScreenReaderContentLineIntervals(e) {
    return this._strategy.fromEditorSelection(
      this._context.viewModel,
      e,
      this._accessibilityPageSize,
    );
  }
  _getEditorSelectionFromDomRange() {
    if (!this._renderedLines) return;
    const e = wB().document.getSelection();
    if (!e) return;
    if (0 === e.rangeCount) return;
    const t = e.getRangeAt(0),
      n = t.startContainer,
      i = t.endContainer,
      r = n.parentElement,
      o = i.parentElement;
    if (!(r && SB(r) && o && SB(o))) return;
    const s = r.parentElement?.parentElement,
      a = o.parentElement?.parentElement;
    if (!s || !a) return;
    const l = s.getAttribute(B5),
      c = a.getAttribute(B5);
    if (!l || !c) return;
    const d = parseInt(l),
      u = parseInt(c),
      h = this._renderedLines.get(d)?.characterMapping,
      g = this._renderedLines.get(u)?.characterMapping;
    if (!h || !g) return;
    const p = WQ(h, r, t.startOffset),
      f = WQ(g, o, t.endOffset);
    return "forward" === e.direction ? new XH(d, p, u, f) : new XH(u, f, d, p);
  }
};
V5 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(3, KK),
  ],
  V5,
);
class W5 {
  constructor(e, t) {
    ((this.domNode = e), (this.characterMapping = t));
  }
}
class H5 {
  constructor(e, t) {
    ((this.startLine = e), (this.endLine = t));
  }
}
class z5 {
  constructor(e, t) {
    this.intervals = t;
    let n = "";
    for (const i of t)
      for (let t = i.startLine; t <= i.endLine; t++) n += e.getLineContent(t) + "\n";
    this.value = n;
  }
  equals(e) {
    return this.value === e.value;
  }
  static get NULL() {
    return new z5(
      {
        getLineContent: () => "",
        getLineCount: () => 1,
        getLineMaxColumn: () => 1,
        getValueInRange: () => "",
        getValueLengthInRange: () => 0,
        modifyPosition: (e, t) => e,
      },
      [],
    );
  }
}
class U5 {
  constructor() {}
  _getPageOfLine(e, t) {
    return Math.floor((e - 1) / t);
  }
  _getRangeForPage(e, t, n) {
    const i = t * n,
      r = i + 1,
      o = Math.min(i + n, e.getLineCount());
    return new H5(r, o);
  }
  fromEditorSelection(e, t, n) {
    const i = this._getPageOfLine(t.startLineNumber, n),
      r = this._getRangeForPage(e, i, n),
      o = this._getPageOfLine(t.endLineNumber, n),
      s = this._getRangeForPage(e, o, n),
      a = [{ startLine: r.startLine, endLine: r.endLine }];
    return (i + 1 < o && a.push({ startLine: s.startLine, endLine: s.endLine }), new z5(e, a));
  }
}
class $5 {
  constructor(e) {
    this.replacements = e;
    let t = -1;
    for (const n of e) {
      if (!(n.replaceRange.start >= t))
        throw new QI(`Edits must be disjoint and sorted. Found ${n} after ${t}`);
      t = n.replaceRange.endExclusive;
    }
  }
  toString() {
    const e = this.replacements.map((e) => e.toString()).join(", ");
    return `[${e}]`;
  }
  normalize() {
    const e = [];
    let t;
    for (const n of this.replacements)
      if (0 !== n.getNewLength() || 0 !== n.replaceRange.length) {
        if (t && t.replaceRange.endExclusive === n.replaceRange.start) {
          const e = t.tryJoinTouching(n);
          if (e) {
            t = e;
            continue;
          }
        }
        (t && e.push(t), (t = n));
      }
    return (t && e.push(t), this._createNew(e));
  }
  compose(e) {
    const t = this.normalize(),
      n = e.normalize();
    if (t.isEmpty()) return n;
    if (n.isEmpty()) return t;
    const i = [...t.replacements],
      r = [];
    let o = 0;
    for (const s of n.replacements) {
      for (;;) {
        const e = i[0];
        if (!e || e.replaceRange.start + o + e.getNewLength() >= s.replaceRange.start) break;
        (i.shift(), r.push(e), (o += e.getNewLength() - e.replaceRange.length));
      }
      const e = o;
      let t, n;
      for (;;) {
        const e = i[0];
        if (!e || e.replaceRange.start + o > s.replaceRange.endExclusive) break;
        (t || (t = e), (n = e), i.shift(), (o += e.getNewLength() - e.replaceRange.length));
      }
      if (t) {
        const a = Math.min(t.replaceRange.start, s.replaceRange.start - e),
          l = s.replaceRange.start - (t.replaceRange.start + e);
        if (l > 0) {
          const e = t.slice(N$.emptyAt(a), new N$(0, l));
          r.push(e);
        }
        if (!n) throw new QI("Invariant violation: lastIntersecting is undefined");
        const c = n.replaceRange.endExclusive + o - s.replaceRange.endExclusive;
        if (c > 0) {
          const e = n.slice(
            N$.ofStartAndLength(n.replaceRange.endExclusive, 0),
            new N$(n.getNewLength() - c, n.getNewLength()),
          );
          (i.unshift(e), (o -= e.getNewLength() - e.replaceRange.length));
        }
        const d = new N$(a, s.replaceRange.endExclusive - o),
          u = s.slice(d, new N$(0, s.getNewLength()));
        r.push(u);
      } else r.push(s.delta(-o));
    }
    for (;;) {
      const e = i.shift();
      if (!e) break;
      r.push(e);
    }
    return this._createNew(r).normalize();
  }
  getNewRanges() {
    const e = [];
    let t = 0;
    for (const n of this.replacements)
      (e.push(N$.ofStartAndLength(n.replaceRange.start + t, n.getNewLength())),
        (t += n.getLengthDelta()));
    return e;
  }
  isEmpty() {
    return 0 === this.replacements.length;
  }
}
class q5 {
  constructor(e) {
    this.replaceRange = e;
  }
  delta(e) {
    return this.slice(this.replaceRange.delta(e), new N$(0, this.getNewLength()));
  }
  getLengthDelta() {
    return this.getNewLength() - this.replaceRange.length;
  }
  toString() {
    return `{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`;
  }
  get isEmpty() {
    return 0 === this.getNewLength() && 0 === this.replaceRange.length;
  }
  getRangeAfterReplace() {
    return new N$(this.replaceRange.start, this.replaceRange.start + this.getNewLength());
  }
}
class K5 extends $5 {
  apply(e) {
    const t = [];
    let n = 0;
    for (const i of this.replacements)
      (t.push(e.substring(n, i.replaceRange.start)),
        t.push(i.newText),
        (n = i.replaceRange.endExclusive));
    return (t.push(e.substring(n)), t.join(""));
  }
}
class G5 extends q5 {
  constructor(e, t) {
    (super(e), (this.newText = t));
  }
  getNewLength() {
    return this.newText.length;
  }
  toString() {
    return `${this.replaceRange} -> ${JSON.stringify(this.newText)}`;
  }
  replace(e) {
    return (
      e.substring(0, this.replaceRange.start) +
      this.newText +
      e.substring(this.replaceRange.endExclusive)
    );
  }
  removeCommonSuffixPrefix(e) {
    const t = e.substring(this.replaceRange.start, this.replaceRange.endExclusive),
      n = cA(t, this.newText),
      i = Math.min(t.length - n, this.newText.length - n, dA(t, this.newText)),
      r = new N$(this.replaceRange.start + n, this.replaceRange.endExclusive - i),
      o = this.newText.substring(n, this.newText.length - i);
    return new Y5(r, o);
  }
  removeCommonSuffixAndPrefix(e) {
    return this.removeCommonSuffix(e).removeCommonPrefix(e);
  }
  removeCommonPrefix(e) {
    const t = cA(this.replaceRange.substring(e), this.newText);
    return 0 === t
      ? this
      : this.slice(this.replaceRange.deltaStart(t), new N$(t, this.newText.length));
  }
  removeCommonSuffix(e) {
    const t = dA(this.replaceRange.substring(e), this.newText);
    return 0 === t
      ? this
      : this.slice(this.replaceRange.deltaEnd(-t), new N$(0, this.newText.length - t));
  }
  toJson() {
    return { txt: this.newText, pos: this.replaceRange.start, len: this.replaceRange.length };
  }
}
class Z5 extends K5 {
  static {
    this.empty = new Z5([]);
  }
  static compose(e) {
    if (0 === e.length) return Z5.empty;
    let t = e[0];
    for (let n = 1; n < e.length; n++) t = t.compose(e[n]);
    return t;
  }
  constructor(e) {
    super(e);
  }
  _createNew(e) {
    return new Z5(e);
  }
}
class Y5 extends G5 {
  static insert(e, t) {
    return new Y5(N$.emptyAt(e), t);
  }
  static replace(e, t) {
    return new Y5(e, t);
  }
  equals(e) {
    return this.replaceRange.equals(e.replaceRange) && this.newText === e.newText;
  }
  tryJoinTouching(e) {
    return new Y5(this.replaceRange.joinRightTouching(e.replaceRange), this.newText + e.newText);
  }
  slice(e, t) {
    return new Y5(e, t ? t.substring(this.newText) : this.newText);
  }
}
function X5(e, t) {
  e = e.slice();
  const n = [];
  let i = 0;
  for (const r of t.replacements) {
    for (;;) {
      const t = e[0];
      if (!t || t.endExclusive >= r.replaceRange.start) break;
      (e.shift(), n.push(t.delta(i)));
    }
    const t = [];
    for (;;) {
      const n = e[0];
      if (!n || !n.intersectsOrTouches(r.replaceRange)) break;
      (e.shift(), t.push(n));
    }
    for (let n = t.length - 1; n >= 0; n--) {
      let i = t[n];
      const o = i.intersect(r.replaceRange).length;
      i = i.deltaEnd(-o + (0 === n ? r.newText.length : 0));
      const s = i.start - r.replaceRange.start;
      (s > 0 && (i = i.delta(-s)),
        0 !== n && (i = i.delta(r.newText.length)),
        (i = i.delta(-(r.newText.length - r.replaceRange.length))),
        e.unshift(i));
    }
    i += r.newText.length - r.replaceRange.length;
  }
  for (;;) {
    const t = e[0];
    if (!t) break;
    (e.shift(), n.push(t.delta(i)));
  }
  return n;
}
class Q5 {
  static ofLength(e, t) {
    return new Q5(e, e + t);
  }
  static fromRange(e) {
    return new Q5(e.startLineNumber, e.endLineNumber);
  }
  static fromRangeInclusive(e) {
    return new Q5(e.startLineNumber, e.endLineNumber + 1);
  }
  static {
    this.compareByStart = bj((e) => e.startLineNumber, yj);
  }
  static joinMany(e) {
    if (0 === e.length) return [];
    let t = new J5(e[0].slice());
    for (let n = 1; n < e.length; n++) t = t.getUnion(new J5(e[n].slice()));
    return t.ranges;
  }
  static join(e) {
    if (0 === e.length) throw new QI("lineRanges cannot be empty");
    let t = e[0].startLineNumber,
      n = e[0].endLineNumberExclusive;
    for (let i = 1; i < e.length; i++)
      ((t = Math.min(t, e[i].startLineNumber)), (n = Math.max(n, e[i].endLineNumberExclusive)));
    return new Q5(t, n);
  }
  static deserialize(e) {
    return new Q5(e[0], e[1]);
  }
  constructor(e, t) {
    if (e > t) throw new QI(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);
    ((this.startLineNumber = e), (this.endLineNumberExclusive = t));
  }
  contains(e) {
    return this.startLineNumber <= e && e < this.endLineNumberExclusive;
  }
  get isEmpty() {
    return this.startLineNumber === this.endLineNumberExclusive;
  }
  delta(e) {
    return new Q5(this.startLineNumber + e, this.endLineNumberExclusive + e);
  }
  deltaLength(e) {
    return new Q5(this.startLineNumber, this.endLineNumberExclusive + e);
  }
  get length() {
    return this.endLineNumberExclusive - this.startLineNumber;
  }
  join(e) {
    return new Q5(
      Math.min(this.startLineNumber, e.startLineNumber),
      Math.max(this.endLineNumberExclusive, e.endLineNumberExclusive),
    );
  }
  toString() {
    return `[${this.startLineNumber},${this.endLineNumberExclusive})`;
  }
  intersect(e) {
    const t = Math.max(this.startLineNumber, e.startLineNumber),
      n = Math.min(this.endLineNumberExclusive, e.endLineNumberExclusive);
    if (t <= n) return new Q5(t, n);
  }
  intersectsStrict(e) {
    return (
      this.startLineNumber < e.endLineNumberExclusive &&
      e.startLineNumber < this.endLineNumberExclusive
    );
  }
  intersectsOrTouches(e) {
    return (
      this.startLineNumber <= e.endLineNumberExclusive &&
      e.startLineNumber <= this.endLineNumberExclusive
    );
  }
  equals(e) {
    return (
      this.startLineNumber === e.startLineNumber &&
      this.endLineNumberExclusive === e.endLineNumberExclusive
    );
  }
  toInclusiveRange() {
    return this.isEmpty
      ? null
      : new YH(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER);
  }
  toExclusiveRange() {
    return new YH(this.startLineNumber, 1, this.endLineNumberExclusive, 1);
  }
  mapToLineArray(e) {
    const t = [];
    for (let n = this.startLineNumber; n < this.endLineNumberExclusive; n++) t.push(e(n));
    return t;
  }
  forEach(e) {
    for (let t = this.startLineNumber; t < this.endLineNumberExclusive; t++) e(t);
  }
  serialize() {
    return [this.startLineNumber, this.endLineNumberExclusive];
  }
  toOffsetRange() {
    return new N$(this.startLineNumber - 1, this.endLineNumberExclusive - 1);
  }
  addMargin(e, t) {
    return new Q5(this.startLineNumber - e, this.endLineNumberExclusive + t);
  }
}
class J5 {
  constructor(e = []) {
    this._normalizedRanges = e;
  }
  get ranges() {
    return this._normalizedRanges;
  }
  addRange(e) {
    if (0 === e.length) return;
    const t = A1(this._normalizedRanges, (t) => t.endLineNumberExclusive >= e.startLineNumber),
      n = M1(this._normalizedRanges, (t) => t.startLineNumber <= e.endLineNumberExclusive) + 1;
    if (t === n) this._normalizedRanges.splice(t, 0, e);
    else if (t === n - 1) {
      const n = this._normalizedRanges[t];
      this._normalizedRanges[t] = n.join(e);
    } else {
      const i = this._normalizedRanges[t].join(this._normalizedRanges[n - 1]).join(e);
      this._normalizedRanges.splice(t, n - t, i);
    }
  }
  contains(e) {
    const t = O1(this._normalizedRanges, (t) => t.startLineNumber <= e);
    return !!t && t.endLineNumberExclusive > e;
  }
  intersects(e) {
    const t = O1(this._normalizedRanges, (t) => t.startLineNumber < e.endLineNumberExclusive);
    return !!t && t.endLineNumberExclusive > e.startLineNumber;
  }
  getUnion(e) {
    if (0 === this._normalizedRanges.length) return e;
    if (0 === e._normalizedRanges.length) return this;
    const t = [];
    let n = 0,
      i = 0,
      r = null;
    for (; n < this._normalizedRanges.length || i < e._normalizedRanges.length; ) {
      let o = null;
      if (n < this._normalizedRanges.length && i < e._normalizedRanges.length) {
        const t = this._normalizedRanges[n],
          r = e._normalizedRanges[i];
        t.startLineNumber < r.startLineNumber ? ((o = t), n++) : ((o = r), i++);
      } else
        n < this._normalizedRanges.length
          ? ((o = this._normalizedRanges[n]), n++)
          : ((o = e._normalizedRanges[i]), i++);
      null === r
        ? (r = o)
        : r.endLineNumberExclusive >= o.startLineNumber
          ? (r = new Q5(
              r.startLineNumber,
              Math.max(r.endLineNumberExclusive, o.endLineNumberExclusive),
            ))
          : (t.push(r), (r = o));
    }
    return (null !== r && t.push(r), new J5(t));
  }
  subtractFrom(e) {
    const t = A1(this._normalizedRanges, (t) => t.endLineNumberExclusive >= e.startLineNumber),
      n = M1(this._normalizedRanges, (t) => t.startLineNumber <= e.endLineNumberExclusive) + 1;
    if (t === n) return new J5([e]);
    const i = [];
    let r = e.startLineNumber;
    for (let o = t; o < n; o++) {
      const e = this._normalizedRanges[o];
      (e.startLineNumber > r && i.push(new Q5(r, e.startLineNumber)),
        (r = e.endLineNumberExclusive));
    }
    return (r < e.endLineNumberExclusive && i.push(new Q5(r, e.endLineNumberExclusive)), new J5(i));
  }
  toString() {
    return this._normalizedRanges.map((e) => e.toString()).join(", ");
  }
  getIntersection(e) {
    const t = [];
    let n = 0,
      i = 0;
    for (; n < this._normalizedRanges.length && i < e._normalizedRanges.length; ) {
      const r = this._normalizedRanges[n],
        o = e._normalizedRanges[i],
        s = r.intersect(o);
      (s && !s.isEmpty && t.push(s),
        r.endLineNumberExclusive < o.endLineNumberExclusive ? n++ : i++);
    }
    return new J5(t);
  }
  getWithDelta(e) {
    return new J5(this._normalizedRanges.map((t) => t.delta(e)));
  }
}
class e3 {
  static {
    this.zero = new e3(0, 0);
  }
  static betweenPositions(e, t) {
    return e.lineNumber === t.lineNumber
      ? new e3(0, t.column - e.column)
      : new e3(t.lineNumber - e.lineNumber, t.column - 1);
  }
  static fromPosition(e) {
    return new e3(e.lineNumber - 1, e.column - 1);
  }
  static ofRange(e) {
    return e3.betweenPositions(e.getStartPosition(), e.getEndPosition());
  }
  static ofText(e) {
    let t = 0,
      n = 0;
    for (const i of e) "\n" === i ? (t++, (n = 0)) : n++;
    return new e3(t, n);
  }
  constructor(e, t) {
    ((this.lineCount = e), (this.columnCount = t));
  }
  isGreaterThanOrEqualTo(e) {
    return this.lineCount !== e.lineCount
      ? this.lineCount > e.lineCount
      : this.columnCount >= e.columnCount;
  }
  add(e) {
    return 0 === e.lineCount
      ? new e3(this.lineCount, this.columnCount + e.columnCount)
      : new e3(this.lineCount + e.lineCount, e.columnCount);
  }
  createRange(e) {
    return 0 === this.lineCount
      ? new YH(e.lineNumber, e.column, e.lineNumber, e.column + this.columnCount)
      : new YH(e.lineNumber, e.column, e.lineNumber + this.lineCount, this.columnCount + 1);
  }
  toRange() {
    return new YH(1, 1, this.lineCount + 1, this.columnCount + 1);
  }
  toLineRange() {
    return Q5.ofLength(1, this.lineCount + 1);
  }
  addToPosition(e) {
    return 0 === this.lineCount
      ? new xV(e.lineNumber, e.column + this.columnCount)
      : new xV(e.lineNumber + this.lineCount, this.columnCount + 1);
  }
  toString() {
    return `${this.lineCount},${this.columnCount}`;
  }
}
class t3 {
  getOffsetRange(e) {
    return new N$(this.getOffset(e.getStartPosition()), this.getOffset(e.getEndPosition()));
  }
  getRange(e) {
    return YH.fromPositions(this.getPosition(e.start), this.getPosition(e.endExclusive));
  }
  getStringReplacement(e) {
    return new n3.deps.StringReplacement(this.getOffsetRange(e.range), e.text);
  }
  getTextReplacement(e) {
    return new n3.deps.TextReplacement(this.getRange(e.replaceRange), e.newText);
  }
  getTextEdit(e) {
    const t = e.replacements.map((e) => this.getTextReplacement(e));
    return new n3.deps.TextEdit(t);
  }
}
class n3 {
  static {
    this._deps = void 0;
  }
  static get deps() {
    if (!this._deps) throw new Error("Dependencies not set. Call _setDependencies first.");
    return this._deps;
  }
}
class i3 extends t3 {
  constructor(e) {
    (super(),
      (this.text = e),
      (this.lineStartOffsetByLineIdx = []),
      (this.lineEndOffsetByLineIdx = []),
      this.lineStartOffsetByLineIdx.push(0));
    for (let t = 0; t < e.length; t++)
      "\n" === e.charAt(t) &&
        (this.lineStartOffsetByLineIdx.push(t + 1),
        t > 0 && "\r" === e.charAt(t - 1)
          ? this.lineEndOffsetByLineIdx.push(t - 1)
          : this.lineEndOffsetByLineIdx.push(t));
    this.lineEndOffsetByLineIdx.push(e.length);
  }
  getOffset(e) {
    const t = this._validatePosition(e);
    return this.lineStartOffsetByLineIdx[t.lineNumber - 1] + t.column - 1;
  }
  _validatePosition(e) {
    if (e.lineNumber < 1) return new xV(1, 1);
    const t = this.textLength.lineCount + 1;
    if (e.lineNumber > t) {
      const e = this.getLineLength(t);
      return new xV(t, e + 1);
    }
    if (e.column < 1) return new xV(e.lineNumber, 1);
    const n = this.getLineLength(e.lineNumber);
    return e.column - 1 > n ? new xV(e.lineNumber, n + 1) : e;
  }
  getPosition(e) {
    const t = M1(this.lineStartOffsetByLineIdx, (t) => t <= e),
      n = t + 1,
      i = e - this.lineStartOffsetByLineIdx[t] + 1;
    return new xV(n, i);
  }
  get textLength() {
    const e = this.lineStartOffsetByLineIdx.length - 1;
    return new n3.deps.TextLength(e, this.text.length - this.lineStartOffsetByLineIdx[e]);
  }
  getLineLength(e) {
    return this.lineEndOffsetByLineIdx[e - 1] - this.lineStartOffsetByLineIdx[e - 1];
  }
}
class r3 {
  constructor() {
    this._transformer = void 0;
  }
  get endPositionExclusive() {
    return this.length.addToPosition(new xV(1, 1));
  }
  get lineRange() {
    return this.length.toLineRange();
  }
  getValue() {
    return this.getValueOfRange(this.length.toRange());
  }
  getValueOfOffsetRange(e) {
    return this.getValueOfRange(this.getTransformer().getRange(e));
  }
  getLineLength(e) {
    return this.getValueOfRange(new YH(e, 1, e, Number.MAX_SAFE_INTEGER)).length;
  }
  getTransformer() {
    return (this._transformer || (this._transformer = new i3(this.getValue())), this._transformer);
  }
  getLineAt(e) {
    return this.getValueOfRange(new YH(e, 1, e, Number.MAX_SAFE_INTEGER));
  }
}
class o3 extends r3 {
  constructor(e, t) {
    (tR(t >= 1), super(), (this._getLineContent = e), (this._lineCount = t));
  }
  getValueOfRange(e) {
    if (e.startLineNumber === e.endLineNumber)
      return this._getLineContent(e.startLineNumber).substring(e.startColumn - 1, e.endColumn - 1);
    let t = this._getLineContent(e.startLineNumber).substring(e.startColumn - 1);
    for (let n = e.startLineNumber + 1; n < e.endLineNumber; n++)
      t += "\n" + this._getLineContent(n);
    return ((t += "\n" + this._getLineContent(e.endLineNumber).substring(0, e.endColumn - 1)), t);
  }
  getLineLength(e) {
    return this._getLineContent(e).length;
  }
  get length() {
    const e = this._getLineContent(this._lineCount);
    return new e3(this._lineCount - 1, e.length);
  }
}
class s3 extends o3 {
  constructor(e) {
    super((t) => e[t - 1], e.length);
  }
}
class a3 extends r3 {
  constructor(e) {
    (super(), (this.value = e), (this._t = new i3(this.value)));
  }
  getValueOfRange(e) {
    return this._t.getOffsetRange(e).substring(this.value);
  }
  get length() {
    return this._t.textLength;
  }
  getTransformer() {
    return this._t;
  }
}
let l3 = class e {
  static fromStringEdit(t, n) {
    const i = t.replacements.map((e) => c3.fromStringReplacement(e, n));
    return new e(i);
  }
  static fromParallelReplacementsUnsorted(t) {
    const n = t.slice().sort(bj((e) => e.range, YH.compareRangesUsingStarts));
    return new e(n);
  }
  constructor(e) {
    ((this.replacements = e),
      iR(() =>
        rR(e, (e, t) => e.range.getEndPosition().isBeforeOrEqual(t.range.getStartPosition())),
      ));
  }
  mapPosition(e) {
    let t = 0,
      n = 0,
      i = 0;
    for (const r of this.replacements) {
      const o = r.range.getStartPosition();
      if (e.isBeforeOrEqual(o)) break;
      const s = r.range.getEndPosition(),
        a = e3.ofText(r.text);
      if (e.isBefore(s)) {
        const e = new xV(o.lineNumber + t, o.column + (o.lineNumber + t === n ? i : 0));
        return d3(e, a.addToPosition(e));
      }
      (o.lineNumber + t !== n && (i = 0),
        (t += a.lineCount - (r.range.endLineNumber - r.range.startLineNumber)),
        0 === a.lineCount
          ? s.lineNumber !== o.lineNumber
            ? (i += a.columnCount - (s.column - 1))
            : (i += a.columnCount - (s.column - o.column))
          : (i = a.columnCount),
        (n = s.lineNumber + t));
    }
    return new xV(e.lineNumber + t, e.column + (e.lineNumber + t === n ? i : 0));
  }
  mapRange(e) {
    const t = (function (e) {
        return e instanceof xV ? e : e.getStartPosition();
      })(this.mapPosition(e.getStartPosition())),
      n = (function (e) {
        return e instanceof xV ? e : e.getEndPosition();
      })(this.mapPosition(e.getEndPosition()));
    return d3(t, n);
  }
  apply(e) {
    let t = "",
      n = new xV(1, 1);
    for (const r of this.replacements) {
      const i = r.range,
        o = i.getStartPosition(),
        s = i.getEndPosition(),
        a = d3(n, o);
      (a.isEmpty() || (t += e.getValueOfRange(a)), (t += r.text), (n = s));
    }
    const i = d3(n, e.endPositionExclusive);
    return (i.isEmpty() || (t += e.getValueOfRange(i)), t);
  }
  applyToString(e) {
    const t = new a3(e);
    return this.apply(t);
  }
  getNewRanges() {
    const e = [];
    let t = 0,
      n = 0,
      i = 0;
    for (const r of this.replacements) {
      const o = e3.ofText(r.text),
        s = xV.lift({
          lineNumber: r.range.startLineNumber + n,
          column: r.range.startColumn + (r.range.startLineNumber === t ? i : 0),
        }),
        a = o.createRange(s);
      (e.push(a),
        (n = a.endLineNumber - r.range.endLineNumber),
        (i = a.endColumn - r.range.endColumn),
        (t = r.range.endLineNumber));
    }
    return e;
  }
  toReplacement(e) {
    if (0 === this.replacements.length) throw new QI();
    if (1 === this.replacements.length) return this.replacements[0];
    const t = this.replacements[0].range.getStartPosition(),
      n = this.replacements[this.replacements.length - 1].range.getEndPosition();
    let i = "";
    for (let r = 0; r < this.replacements.length; r++) {
      const t = this.replacements[r];
      if (((i += t.text), r < this.replacements.length - 1)) {
        const n = this.replacements[r + 1],
          o = YH.fromPositions(t.range.getEndPosition(), n.range.getStartPosition());
        i += e.getValueOfRange(o);
      }
    }
    return new c3(YH.fromPositions(t, n), i);
  }
  toString(e) {
    return void 0 === e
      ? this.replacements.map((e) => e.toString()).join("\n")
      : "string" == typeof e
        ? this.toString(new a3(e))
        : 0 === this.replacements.length
          ? ""
          : this.replacements
              .map((t) => {
                const n = 10,
                  i = e.getValueOfRange(t.range),
                  r = YH.fromPositions(
                    new xV(Math.max(1, t.range.startLineNumber - 1), 1),
                    t.range.getStartPosition(),
                  );
                let o = e.getValueOfRange(r);
                o.length > n && (o = "..." + o.substring(o.length - n));
                const s = YH.fromPositions(
                  t.range.getEndPosition(),
                  new xV(t.range.endLineNumber + 1, 1),
                );
                let a = e.getValueOfRange(s);
                a.length > n && (a = a.substring(0, n) + "...");
                let l = i;
                if (l.length > n) {
                  const e = Math.floor(5);
                  l = l.substring(0, e) + "..." + l.substring(l.length - e);
                }
                let c = t.text;
                if (c.length > n) {
                  const e = Math.floor(5);
                  c = c.substring(0, e) + "..." + c.substring(c.length - e);
                }
                return 0 === l.length ? `${o}❰${c}❱${a}` : `${o}❰${l}↦${c}❱${a}`;
              })
              .join("\n");
  }
};
class c3 {
  static joinReplacements(e, t) {
    if (0 === e.length) throw new QI();
    if (1 === e.length) return e[0];
    const n = e[0].range.getStartPosition(),
      i = e[e.length - 1].range.getEndPosition();
    let r = "";
    for (let o = 0; o < e.length; o++) {
      const n = e[o];
      if (((r += n.text), o < e.length - 1)) {
        const i = e[o + 1],
          s = YH.fromPositions(n.range.getEndPosition(), i.range.getStartPosition());
        r += t.getValueOfRange(s);
      }
    }
    return new c3(YH.fromPositions(n, i), r);
  }
  static fromStringReplacement(e, t) {
    return new c3(t.getTransformer().getRange(e.replaceRange), e.newText);
  }
  static delete(e) {
    return new c3(e, "");
  }
  constructor(e, t) {
    ((this.range = e), (this.text = t));
  }
  get isEmpty() {
    return this.range.isEmpty() && 0 === this.text.length;
  }
  static equals(e, t) {
    return e.range.equalsRange(t.range) && e.text === t.text;
  }
  equals(e) {
    return c3.equals(this, e);
  }
  removeCommonPrefixAndSuffix(e) {
    return this.removeCommonPrefix(e).removeCommonSuffix(e);
  }
  removeCommonPrefix(e) {
    const t = e.getValueOfRange(this.range).replaceAll("\r\n", "\n"),
      n = this.text.replaceAll("\r\n", "\n"),
      i = cA(t, n),
      r = e3.ofText(t.substring(0, i)).addToPosition(this.range.getStartPosition()),
      o = n.substring(i),
      s = YH.fromPositions(r, this.range.getEndPosition());
    return new c3(s, o);
  }
  removeCommonSuffix(e) {
    const t = e.getValueOfRange(this.range).replaceAll("\r\n", "\n"),
      n = this.text.replaceAll("\r\n", "\n"),
      i = dA(t, n),
      r = e3.ofText(t.substring(0, t.length - i)).addToPosition(this.range.getStartPosition()),
      o = n.substring(0, n.length - i),
      s = YH.fromPositions(this.range.getStartPosition(), r);
    return new c3(s, o);
  }
  toString() {
    const e = this.range.getStartPosition(),
      t = this.range.getEndPosition();
    return `(${e.lineNumber},${e.column} -> ${t.lineNumber},${t.column}): "${this.text}"`;
  }
}
function d3(e, t) {
  if (e.lineNumber === t.lineNumber && e.column === Number.MAX_SAFE_INTEGER)
    return YH.fromPositions(t, t);
  if (!e.isBeforeOrEqual(t)) throw new QI("start must be before end");
  return new YH(e.lineNumber, e.column, t.lineNumber, t.column);
}
var u3;
((u3 = {
  StringEdit: Z5,
  StringReplacement: Y5,
  TextReplacement: c3,
  TextEdit: l3,
  TextLength: e3,
}),
  (n3._deps = u3));
let h3 = class extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._domNode = e),
      (this._context = t),
      (this._viewController = n),
      (this._accessibilityService = i),
      (this._selectionChangeListener = this._register(new jO())),
      (this._accessibilityPageSize = 1),
      (this._ignoreSelectionChangeTime = 0),
      (this._strategy = new D5()),
      this.onConfigurationChanged(this._context.configuration.options));
  }
  updateScreenReaderContent(e) {
    const t = this._domNode.domNode,
      n = wB().document.activeElement;
    if (!n || n !== t) return;
    if (this._accessibilityService.isScreenReaderOptimized()) {
      ((this._state = this._getScreenReaderContentState(e)),
        t.textContent !== this._state.value &&
          (this._setIgnoreSelectionChangeTime("setValue"), (t.textContent = this._state.value)));
      const n = wB().document.getSelection();
      if (!n) return;
      const i = this._getScreenReaderRange(this._state.selectionStart, this._state.selectionEnd);
      if (!i) return;
      (this._setIgnoreSelectionChangeTime("setRange"),
        n.setBaseAndExtent(i.anchorNode, i.anchorOffset, i.focusNode, i.focusOffset));
    } else
      ((this._state = void 0),
        this._setIgnoreSelectionChangeTime("setValue"),
        (this._domNode.domNode.textContent = ""));
  }
  updateScrollTop(e) {
    if (!this._state) return;
    const t = this._context.viewModel.viewLayout,
      n = this._state.startPositionWithinEditor.lineNumber,
      i = t.getVerticalOffsetForLineNumber(n),
      r = t.getVerticalOffsetForLineNumber(e.positionLineNumber);
    this._domNode.domNode.scrollTop = r - i;
  }
  onFocusChange(e) {
    this._selectionChangeListener.value = e ? this._setSelectionChangeListener() : void 0;
  }
  onConfigurationChanged(e) {
    this._accessibilityPageSize = e.get(3);
  }
  onWillCut() {
    this._setIgnoreSelectionChangeTime("onCut");
  }
  onWillPaste() {
    this._setIgnoreSelectionChangeTime("onWillPaste");
  }
  _setIgnoreSelectionChangeTime(e) {
    this._ignoreSelectionChangeTime = Date.now();
  }
  _setSelectionChangeListener() {
    let e = 0;
    return $F(this._domNode.domNode.ownerDocument, "selectionchange", () => {
      const t = this._accessibilityService.isScreenReaderOptimized();
      if (!this._state || !t || !E5.enabled) return;
      if (!(wB().document.activeElement === this._domNode.domNode)) return;
      const n = wB().document.getSelection();
      if (!n) return;
      if (0 === n.rangeCount) return;
      const i = n.getRangeAt(0),
        r = Date.now(),
        o = r - e;
      if (((e = r), o < 5)) return;
      const s = r - this._ignoreSelectionChangeTime;
      ((this._ignoreSelectionChangeTime = 0),
        s < 100 ||
          this._viewController.setSelection(
            this._getEditorSelectionFromDomRange(this._context, this._state, n.direction, i),
          ));
    });
  }
  _getScreenReaderContentState(e) {
    const t = this._strategy.fromEditorSelection(
        this._context.viewModel,
        e,
        this._accessibilityPageSize,
        0 === this._accessibilityService.getAccessibilitySupport(),
      ),
      n = this._context.viewModel.model.getPositionAt(1 / 0);
    let i = t.value;
    return (1 === n.column && e.getEndPosition().equals(n) && (i += "\n"), (t.value = i), t);
  }
  _getScreenReaderRange(e, t) {
    const n = this._domNode.domNode.firstChild;
    if (!n) return;
    const i = new globalThis.Range();
    return (
      i.setStart(n, e),
      i.setEnd(n, t),
      { anchorNode: n, anchorOffset: e, focusNode: n, focusOffset: t }
    );
  }
  _getEditorSelectionFromDomRange(e, t, n, i) {
    const r = e.viewModel,
      o = r.model,
      s = r.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor),
      a = o.getOffsetAt(s);
    let l = i.startOffset + a,
      c = i.endOffset + a;
    if (1 === o.getEndOfLineSequence()) {
      const e = t.value,
        n = new i3(e),
        r = n.getPosition(i.startOffset),
        o = n.getPosition(i.endOffset);
      ((l += r.lineNumber - 1), (c += o.lineNumber - 1));
    }
    const d = o.getPositionAt(l),
      u = o.getPositionAt(c),
      h = "forward" === n ? d : u,
      g = "forward" === n ? u : d;
    return XH.fromPositions(h, g);
  }
};
h3 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(3, KK),
  ],
  h3,
);
var g3 = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let p3 = class extends PO {
  constructor(e, t, n, i, r) {
    (super(),
      (this._domNode = e),
      (this._context = t),
      (this._viewController = n),
      (this._keybindingService = i),
      (this._accessibilityService = r),
      (this._contentLeft = 1),
      (this._contentWidth = 1),
      (this._contentHeight = 1),
      (this._divWidth = 1),
      (this._primarySelection = new XH(1, 1, 1, 1)),
      (this._primaryCursorVisibleRange = null),
      (this._state = this._register(new jO())),
      this._instantiateScreenReaderContent(),
      this._updateConfigurationSettings(),
      this._updateDomAttributes());
  }
  onWillPaste() {
    this._state.value?.onWillPaste();
  }
  onWillCut() {
    this._state.value?.onWillCut();
  }
  handleFocusChange(e) {
    (this._state.value?.onFocusChange(e), this.writeScreenReaderContent());
  }
  onConfigurationChanged(e) {
    (this._instantiateScreenReaderContent(),
      this._updateConfigurationSettings(),
      this._updateDomAttributes(),
      e.hasChanged(2) && this.writeScreenReaderContent());
  }
  _instantiateScreenReaderContent() {
    const e = this._context.configuration.options.get(107);
    this._renderRichContent !== e &&
      ((this._renderRichContent = e), (this._state.value = this._createScreenReaderContent(e)));
  }
  _createScreenReaderContent(e) {
    return e
      ? new V5(this._domNode, this._context, this._viewController, this._accessibilityService)
      : new h3(this._domNode, this._context, this._viewController, this._accessibilityService);
  }
  _updateConfigurationSettings() {
    const e = this._context.configuration.options,
      t = e.get(165),
      n = t.wrappingColumn;
    ((this._contentLeft = t.contentLeft),
      (this._contentWidth = t.contentWidth),
      (this._contentHeight = t.height),
      (this._fontInfo = e.get(59)),
      (this._divWidth = Math.round(n * this._fontInfo.typicalHalfwidthCharacterWidth)),
      this._state.value?.onConfigurationChanged(e));
  }
  _updateDomAttributes() {
    const e = this._context.configuration.options;
    (this._domNode.domNode.setAttribute("role", "textbox"),
      this._domNode.domNode.setAttribute("aria-required", e.get(9) ? "true" : "false"),
      this._domNode.domNode.setAttribute("aria-multiline", "true"),
      this._domNode.domNode.setAttribute("aria-autocomplete", e.get(104) ? "none" : "both"),
      this._domNode.domNode.setAttribute("aria-roledescription", SI(60, "editor")),
      this._domNode.domNode.setAttribute("aria-label", T5(e, this._keybindingService)));
    const t = this._context.viewModel.model.getOptions().tabSize,
      n = e.get(59).spaceWidth;
    this._domNode.domNode.style.tabSize = t * n + "px";
    const i = e.get(154),
      r = "inherit" === i ? e.get(153) : i,
      o = "inherit" === r ? e.get(149) : r;
    this._domNode.domNode.style.textWrap = "off" === o ? "nowrap" : "wrap";
  }
  onCursorStateChanged(e) {
    this._primarySelection = e.selections[0] ?? new XH(1, 1, 1, 1);
  }
  prepareRender(e) {
    (this.writeScreenReaderContent(),
      (this._primaryCursorVisibleRange = e.visibleRangeForPosition(
        this._primarySelection.getPosition(),
      )));
  }
  render(e) {
    if (!this._primaryCursorVisibleRange) return void this._renderAtTopLeft();
    const t = this._context.viewLayout.getCurrentScrollLeft(),
      n = this._contentLeft + this._primaryCursorVisibleRange.left - t;
    if (n < this._contentLeft || n > this._contentLeft + this._contentWidth)
      return void this._renderAtTopLeft();
    const i = this._context.viewLayout.getCurrentScrollTop(),
      r = this._primarySelection.positionLineNumber,
      o = this._context.viewLayout.getVerticalOffsetForLineNumber(r) - i;
    if (o < 0 || o > this._contentHeight) return void this._renderAtTopLeft();
    const s = this._context.viewLayout.getLineHeightForLineNumber(r);
    (this._doRender(o, this._contentLeft, this._divWidth, s),
      this._state.value?.updateScrollTop(this._primarySelection));
  }
  _renderAtTopLeft() {
    this._doRender(0, 0, this._contentWidth, 1);
  }
  _doRender(e, t, n, i) {
    (Vq(this._domNode, this._fontInfo),
      this._domNode.setTop(e),
      this._domNode.setLeft(t),
      this._domNode.setWidth(n),
      this._domNode.setHeight(i),
      this._domNode.setLineHeight(i));
  }
  setAriaOptions(e) {
    (e.activeDescendant
      ? (this._domNode.setAttribute("aria-haspopup", "true"),
        this._domNode.setAttribute("aria-autocomplete", "list"),
        this._domNode.setAttribute("aria-activedescendant", e.activeDescendant))
      : (this._domNode.setAttribute("aria-haspopup", "false"),
        this._domNode.setAttribute("aria-autocomplete", "both"),
        this._domNode.removeAttribute("aria-activedescendant")),
      e.role && this._domNode.setAttribute("role", e.role));
  }
  writeScreenReaderContent() {
    this._state.value?.updateScreenReaderContent(this._primarySelection);
  }
};
var f3;
((p3 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([g3(3, N5), g3(4, KK)], p3)),
  (function (e) {
    e.create = function (e, t) {
      return new e.EditContext(t);
    };
  })(f3 || (f3 = {})));
const m3 = new (class {
  constructor() {
    this._nativeEditContextMapping = new Map();
  }
  register(e, t) {
    return (
      this._nativeEditContextMapping.set(e, t),
      {
        dispose: () => {
          this._nativeEditContextMapping.delete(e);
        },
      }
    );
  }
  get(e) {
    return this._nativeEditContextMapping.get(e);
  }
})();
var _3,
  v3 = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
!(function (e) {
  ((e.NONE = "edit-context-composition-none"),
    (e.SECONDARY = "edit-context-composition-secondary"),
    (e.PRIMARY = "edit-context-composition-primary"));
})(_3 || (_3 = {}));
let b3 = class extends L5 {
  constructor(e, t, n, i, r, o, s) {
    (super(t),
      (this._viewController = i),
      (this._visibleRangeProvider = r),
      (this.logService = s),
      (this._previousEditContextSelection = new N$(0, 0)),
      (this._editContextPrimarySelection = new XH(1, 1, 1, 1)),
      (this._decorations = []),
      (this._primarySelection = new XH(1, 1, 1, 1)),
      (this._targetWindowId = -1),
      (this._scrollTop = 0),
      (this._scrollLeft = 0),
      (this._linesVisibleRanges = null),
      (this.domNode = new jq(document.createElement("div"))),
      this.domNode.setClassName("native-edit-context"),
      (this._imeTextArea = new jq(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(),
      n.appendChild(this.domNode),
      n.appendChild(this._imeTextArea),
      (this._parent = n.domNode),
      (this._focusTracker = this._register(
        new P5(s, this.domNode.domNode, (e) => {
          (s.trace("NativeEditContext#handleFocusChange : ", e),
            this._screenReaderSupport.handleFocusChange(e),
            this._context.viewModel.setHasFocus(e));
        }),
      )));
    const a = MF(this.domNode.domNode);
    let l;
    ((this._editContext = f3.create(a)),
      this.setEditContextOnDomNode(),
      (this._screenReaderSupport = this._register(
        o.createInstance(p3, this.domNode, t, this._viewController),
      )),
      this._register(
        $F(this.domNode.domNode, "copy", (e) => {
          (this.logService.trace("NativeEditContext#copy"),
            this._ensureClipboardGetsEditorSelection(e));
        }),
      ),
      this._register(
        $F(this.domNode.domNode, "cut", (e) => {
          (this.logService.trace("NativeEditContext#cut"),
            this._screenReaderSupport.onWillCut(),
            this._ensureClipboardGetsEditorSelection(e),
            this.logService.trace("NativeEditContext#cut (before viewController.cut)"),
            this._viewController.cut());
        }),
      ),
      this._register($F(this.domNode.domNode, "keyup", (e) => this._onKeyUp(e))),
      this._register($F(this.domNode.domNode, "keydown", async (e) => this._onKeyDown(e))),
      this._register($F(this._imeTextArea.domNode, "keyup", (e) => this._onKeyUp(e))),
      this._register($F(this._imeTextArea.domNode, "keydown", async (e) => this._onKeyDown(e))),
      this._register(
        $F(this.domNode.domNode, "beforeinput", async (e) => {
          ("insertParagraph" !== e.inputType && "insertLineBreak" !== e.inputType) ||
            this._onType(this._viewController, {
              text: "\n",
              replacePrevCharCnt: 0,
              replaceNextCharCnt: 0,
              positionDelta: 0,
            });
        }),
      ),
      this._register(
        $F(this.domNode.domNode, "paste", (e) => {
          if (
            (this.logService.trace("NativeEditContext#paste"), e.preventDefault(), !e.clipboardData)
          )
            return;
          let [t, n] = PJ.getTextData(e.clipboardData);
          if (
            (this.logService.trace(
              "NativeEditContext#paste with id : ",
              n?.id,
              " with text.length: ",
              t.length,
            ),
            !t)
          )
            return;
          n = n || MJ.INSTANCE.get(t);
          let i = !1,
            r = null,
            o = null;
          if (n) {
            ((i = this._context.configuration.options.get(45) && !!n.isFromEmptySelection),
              (r = void 0 !== n.multicursorText ? n.multicursorText : null),
              (o = n.mode));
          }
          (this.logService.trace("NativeEditContext#paste (before viewController.paste)"),
            this._viewController.paste(t, i, r, o));
        }),
      ),
      this._register(
        j5(this._editContext, "textformatupdate", (e) => this._handleTextFormatUpdate(e)),
      ),
      this._register(
        j5(this._editContext, "characterboundsupdate", (e) => this._updateCharacterBounds(e)),
      ),
      this._register(
        j5(this._editContext, "textupdate", (e) => {
          const t = e.text;
          if (1 === t.length) {
            const n = t.charCodeAt(0);
            if (uA(n)) return void (l = t);
            if (hA(n) && l) {
              const n = {
                text: l + t,
                selectionEnd: e.selectionEnd,
                selectionStart: e.selectionStart,
                updateRangeStart: e.updateRangeStart - 1,
                updateRangeEnd: e.updateRangeEnd - 1,
              };
              return ((l = void 0), void this._emitTypeEvent(this._viewController, n));
            }
          }
          this._emitTypeEvent(this._viewController, e);
        }),
      ),
      this._register(
        j5(this._editContext, "compositionstart", (e) => {
          (this._updateEditContext(),
            this._viewController.compositionStart(),
            this._context.viewModel.onCompositionStart());
        }),
      ),
      this._register(
        j5(this._editContext, "compositionend", (e) => {
          (this._updateEditContext(),
            this._viewController.compositionEnd(),
            this._context.viewModel.onCompositionEnd());
        }),
      ));
    let c = !1;
    (this._register(
      E5.onDidChange(() => {
        (E5.enabled && c && (this._focusTracker.resume(), this.domNode.focus(), (c = !1)),
          !E5.enabled &&
            this.isFocused() &&
            (this._focusTracker.pause(), this._imeTextArea.focus(), (c = !0)));
      }),
    ),
      this._register(m3.register(e, this)));
  }
  dispose() {
    ((this.domNode.domNode.editContext = void 0),
      this.domNode.domNode.blur(),
      this.domNode.domNode.remove(),
      this._imeTextArea.domNode.remove(),
      super.dispose());
  }
  setAriaOptions(e) {
    this._screenReaderSupport.setAriaOptions(e);
  }
  getLastRenderData() {
    return this._primarySelection.getPosition();
  }
  prepareRender(e) {
    (this._screenReaderSupport.prepareRender(e), this._updateSelectionAndControlBoundsData(e));
  }
  onDidRender() {
    this._updateSelectionAndControlBoundsAfterRender();
  }
  render(e) {
    this._screenReaderSupport.render(e);
  }
  onCursorStateChanged(e) {
    return (
      (this._primarySelection = e.modelSelections[0] ?? new XH(1, 1, 1, 1)),
      this._screenReaderSupport.onCursorStateChanged(e),
      this._updateEditContext(),
      !0
    );
  }
  onConfigurationChanged(e) {
    return (this._screenReaderSupport.onConfigurationChanged(e), this._updateDomAttributes(), !0);
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return (
      this._updateEditContextOnLineChange(e.fromLineNumber, e.fromLineNumber + e.count - 1),
      !0
    );
  }
  onLinesDeleted(e) {
    return (this._updateEditContextOnLineChange(e.fromLineNumber, e.toLineNumber), !0);
  }
  onLinesInserted(e) {
    return (this._updateEditContextOnLineChange(e.fromLineNumber, e.toLineNumber), !0);
  }
  _updateEditContextOnLineChange(e, t) {
    this._editContextPrimarySelection.endLineNumber < e ||
      this._editContextPrimarySelection.startLineNumber > t ||
      this._updateEditContext();
  }
  onScrollChanged(e) {
    return ((this._scrollLeft = e.scrollLeft), (this._scrollTop = e.scrollTop), !0);
  }
  onZonesChanged(e) {
    return !0;
  }
  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 === vB()));
  }
  writeScreenReaderContent() {
    this._screenReaderSupport.writeScreenReaderContent();
  }
  isFocused() {
    return this._focusTracker.isFocused;
  }
  focus() {
    (this._focusTracker.focus(), this.refreshFocusState());
  }
  refreshFocusState() {
    this._focusTracker.refreshFocusState();
  }
  setEditContextOnDomNode() {
    const e = MF(this.domNode.domNode),
      t = FF(e);
    this._targetWindowId !== t &&
      ((this.domNode.domNode.editContext = this._editContext), (this._targetWindowId = t));
  }
  _onKeyUp(e) {
    this._viewController.emitKeyUp(new wO(e));
  }
  _onKeyDown(e) {
    const t = new wO(e);
    (114 === t.keyCode && t.stopPropagation(), this._viewController.emitKeyDown(t));
  }
  _updateDomAttributes() {
    const e = this._context.configuration.options;
    this.domNode.domNode.setAttribute("tabindex", String(e.get(140)));
  }
  _updateEditContext() {
    const e = this._getNewEditContextState();
    e &&
      (this._editContext.updateText(0, Number.MAX_SAFE_INTEGER, e.text ?? " "),
      this._editContext.updateSelection(e.selectionStartOffset, e.selectionEndOffset),
      (this._editContextPrimarySelection = e.editContextPrimarySelection),
      (this._previousEditContextSelection = new N$(e.selectionStartOffset, e.selectionEndOffset)));
  }
  _emitTypeEvent(e, t) {
    if (!this._editContext) return;
    const n = this._previousEditContextSelection.endExclusive,
      i = this._previousEditContextSelection.start;
    this._previousEditContextSelection = new N$(t.selectionStart, t.selectionEnd);
    let r = 0,
      o = 0;
    (t.updateRangeEnd > n && (r = t.updateRangeEnd - n),
      t.updateRangeStart < i && (o = i - t.updateRangeStart));
    let s = "";
    (i < t.updateRangeStart && (s += this._editContext.text.substring(i, t.updateRangeStart)),
      (s += t.text),
      n > t.updateRangeEnd && (s += this._editContext.text.substring(t.updateRangeEnd, n)));
    let a = 0;
    t.selectionStart === t.selectionEnd &&
      i === n &&
      (a = t.selectionStart - (t.updateRangeStart + t.text.length));
    const l = { text: s, replacePrevCharCnt: o, replaceNextCharCnt: r, positionDelta: a };
    this._onType(e, l);
  }
  _onType(e, t) {
    t.replacePrevCharCnt || t.replaceNextCharCnt || t.positionDelta
      ? e.compositionType(t.text, t.replacePrevCharCnt, t.replaceNextCharCnt, t.positionDelta)
      : e.type(t.text);
  }
  _getNewEditContextState() {
    const e = this._primarySelection,
      t = this._context.viewModel.model;
    if (!t.isValidRange(e)) return;
    const n = e.startLineNumber,
      i = e.endLineNumber,
      r = t.getLineMaxColumn(i),
      o = new YH(n, 1, i, r),
      s = t.getValueInRange(o, 0);
    return {
      text: s,
      selectionStartOffset: e.startColumn - 1,
      selectionEndOffset: s.length + e.endColumn - r,
      editContextPrimarySelection: e,
    };
  }
  _editContextStartPosition() {
    return new xV(this._editContextPrimarySelection.startLineNumber, 1);
  }
  _handleTextFormatUpdate(e) {
    if (!this._editContext) return;
    const t = e.getTextFormats(),
      n = this._editContextStartPosition(),
      i = [];
    (t.forEach((e) => {
      const t = this._context.viewModel.model,
        r = t.getOffsetAt(n),
        o = t.getPositionAt(r + e.rangeStart),
        s = t.getPositionAt(r + e.rangeEnd),
        a = YH.fromPositions(o, s),
        l = e.underlineThickness.toLowerCase();
      let c = _3.NONE;
      switch (l) {
        case "thin":
          c = _3.SECONDARY;
          break;
        case "thick":
          c = _3.PRIMARY;
      }
      i.push({ range: a, options: { description: "textFormatDecoration", inlineClassName: c } });
    }),
      (this._decorations = this._context.viewModel.model.deltaDecorations(this._decorations, i)));
  }
  _updateSelectionAndControlBoundsData(e) {
    const t = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(
      this._primarySelection,
    );
    if (this._primarySelection.isEmpty()) {
      const n = e.visibleRangeForPosition(t.getStartPosition());
      this._linesVisibleRanges = n;
    } else this._linesVisibleRanges = null;
  }
  _updateSelectionAndControlBoundsAfterRender() {
    const e = this._context.configuration.options.get(165).contentLeft,
      t = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(
        this._primarySelection,
      ),
      n = this._context.viewLayout.getVerticalOffsetForLineNumber(t.startLineNumber),
      i = this._context.viewLayout.getVerticalOffsetAfterLineNumber(t.endLineNumber),
      r = this._parent.getBoundingClientRect(),
      o = r.top + n - this._scrollTop,
      s = i - n;
    let a,
      l = r.left + e - this._scrollLeft;
    this._primarySelection.isEmpty()
      ? (this._linesVisibleRanges && (l += this._linesVisibleRanges.left), (a = 0))
      : (a = r.width - e);
    const c = new DOMRect(l, o, a, s);
    (this._editContext.updateSelectionBounds(c), this._editContext.updateControlBounds(c));
  }
  _updateCharacterBounds(e) {
    const t = this._context.configuration.options,
      n = t.get(59).typicalHalfwidthCharacterWidth,
      i = t.get(165).contentLeft,
      r = this._parent.getBoundingClientRect(),
      o = [],
      s = new i3(this._editContext.text);
    for (let a = e.rangeStart; a < e.rangeEnd; a++) {
      const e = s.getPosition(a),
        t = this._editContextPrimarySelection.startLineNumber - 1,
        l = new xV(t + e.lineNumber, e.column),
        c = l.delta(0, 1),
        d = YH.fromPositions(l, c),
        u = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(d),
        h = this._visibleRangeProvider.linesVisibleRangesForRange(u, !0) ?? [],
        g = u.startLineNumber,
        p = this._context.viewLayout.getVerticalOffsetForLineNumber(g),
        f = r.top + p - this._scrollTop;
      let m = 0,
        _ = n;
      if (h.length > 0)
        for (const n of h[0].ranges) {
          ((m = n.left), (_ = n.width));
          break;
        }
      const v = this._context.viewLayout.getLineHeightForLineNumber(g);
      o.push(new DOMRect(r.left + i + m - this._scrollLeft, f, _, v));
    }
    this._editContext.updateCharacterBounds(e.rangeStart, o);
  }
  _ensureClipboardGetsEditorSelection(e) {
    const t = this._context.configuration.options,
      n = t.get(45),
      i = t.get(31),
      r = this._context.viewModel.getCursorStates().map((e) => e.modelState.selection),
      o = OJ(this._context.viewModel, r, n, i);
    let s;
    this.logService.getLevel() === wH.Trace && (s = FJ());
    const a = {
      version: 1,
      id: s,
      isFromEmptySelection: o.isFromEmptySelection,
      multicursorText: o.multicursorText,
      mode: o.mode,
    };
    (MJ.INSTANCE.set(RI ? o.text.replace(/\r\n/g, "\n") : o.text, a),
      e.preventDefault(),
      e.clipboardData && PJ.setTextData(e.clipboardData, o.text, o.html, a),
      this.logService.trace(
        "NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ",
        s,
        " with text.length: ",
        o.text.length,
      ));
  }
};
b3 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([v3(5, vV), v3(6, yH)], b3);
class y3 extends iQ {
  constructor(e, t) {
    (super(e),
      (this._viewGpuContext = t),
      (this._gpuShapes = []),
      this._register(rF((e) => this._updateEntries(e))));
  }
  onConfigurationChanged(e) {
    return (this._updateEntries(void 0), !0);
  }
  prepareRender(e) {}
  render(e) {}
  _updateEntries(e) {
    const t = this._context.configuration.options,
      n = t.get(116),
      i = t.get(59).typicalHalfwidthCharacterWidth,
      r = this._viewGpuContext.devicePixelRatio.read(e);
    for (let o = 0, s = n.length; o < s; o++) {
      const e = n[o],
        t = this._gpuShapes[o],
        s = e.color ? vG.fromHex(e.color) : (this._context.theme.getColor($0) ?? vG.white),
        a = [
          e.column * i * r,
          0,
          Math.max(1, Math.ceil(r)),
          Number.MAX_SAFE_INTEGER,
          s.rgba.r / 255,
          s.rgba.g / 255,
          s.rgba.b / 255,
          s.rgba.a,
        ];
      t
        ? t.setRaw(a)
        : (this._gpuShapes[o] = this._viewGpuContext.rectangleRenderer.register(...a));
    }
    for (; this._gpuShapes.length > n.length; ) this._gpuShapes.splice(-1, 1)[0].dispose();
  }
}
class x3 extends u0 {
  static {
    this.CLASS_NAME = "gpu-mark";
  }
  constructor(e, t) {
    (super(),
      (this._viewGpuContext = t),
      (this._context = e),
      (this._renderResult = null),
      this._context.addEventHandler(this));
  }
  dispose() {
    (this._context.removeEventHandler(this), (this._renderResult = null), super.dispose());
  }
  onConfigurationChanged(e) {
    return !0;
  }
  onCursorStateChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  prepareRender(e) {
    const t = e.visibleRange.startLineNumber,
      n = e.visibleRange.endLineNumber,
      i = e.viewportData,
      r = new J1(this._context.configuration, this._context.theme.type),
      o = [];
    for (let s = t; s <= n; s++) {
      const e = s - t,
        n = this._viewGpuContext.canRenderDetailed(r, i, s);
      o[e] = n.length
        ? `<div class="${x3.CLASS_NAME}" title="Cannot render on GPU: ${n.join(", ")}"></div>`
        : "";
    }
    this._renderResult = o;
  }
  render(e, t) {
    if (!this._renderResult) return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
}
let w3 = class extends nQ {
  constructor(e, t, n, i, r, o, s, a, l) {
    (super(),
      (this._instantiationService = l),
      (this._shouldRecomputeGlyphMarginLanes = !1),
      (this._ownerID = t),
      (this._widgetFocusTracker = this._register(new k3(e, a))),
      this._register(
        this._widgetFocusTracker.onChange(() => {
          this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus());
        }),
      ),
      (this._selections = [new XH(1, 1, 1, 1)]),
      (this._renderAnimationFrame = null),
      (this._overflowGuardContainer = Bq(document.createElement("div"))),
      rQ.write(this._overflowGuardContainer, 3),
      this._overflowGuardContainer.setClassName("overflow-guard"),
      (this._viewController = new GJ(i, o, s, n)),
      (this._context = new T4(i, r, o)),
      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 = Bq(document.createElement("div"))),
      this._linesContent.setClassName("lines-content monaco-editor-background"),
      this._linesContent.setPosition("absolute"),
      (this.domNode = Bq(document.createElement("div"))),
      this.domNode.setClassName(this._getEditorClassName()),
      this.domNode.setAttribute("role", "code"),
      "on" === this._context.configuration.options.get(46) &&
        (this._viewGpuContext = this._instantiationService.createInstance(d5, this._context)),
      (this._scrollbar = new C1(
        this._context,
        this._linesContent,
        this.domNode,
        this._overflowGuardContainer,
      )),
      this._viewParts.push(this._scrollbar),
      (this._viewLines = new i2(this._context, this._viewGpuContext, this._linesContent)),
      this._viewGpuContext &&
        (this._viewLinesGpu = this._instantiationService.createInstance(
          k5,
          this._context,
          this._viewGpuContext,
        )),
      (this._viewZones = new k4(this._context)),
      this._viewParts.push(this._viewZones));
    const c = new a4(this._context);
    this._viewParts.push(c);
    const d = new g4(this._context);
    this._viewParts.push(d);
    const u = new t0(this._context);
    (this._viewParts.push(u),
      u.addDynamicOverlay(new y1(this._context)),
      u.addDynamicOverlay(new v4(this._context)),
      u.addDynamicOverlay(new G1(this._context)),
      u.addDynamicOverlay(new w1(this._context)),
      u.addDynamicOverlay(new E4(this._context)));
    const h = new n0(this._context);
    (this._viewParts.push(h),
      h.addDynamicOverlay(new x1(this._context)),
      h.addDynamicOverlay(new s2(this._context)),
      h.addDynamicOverlay(new r2(this._context)),
      h.addDynamicOverlay(new Y1(this._context)),
      this._viewGpuContext && h.addDynamicOverlay(new x3(this._context, this._viewGpuContext)),
      (this._glyphMarginWidgets = new L1(this._context)),
      this._viewParts.push(this._glyphMarginWidgets));
    const g = new o2(this._context);
    (g.getDomNode().appendChild(this._viewZones.marginDomNode),
      g.getDomNode().appendChild(h.getDomNode()),
      g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),
      this._viewParts.push(g),
      (this._contentWidgets = new o0(this._context, this.domNode)),
      this._viewParts.push(this._contentWidgets),
      (this._viewCursors = new C4(this._context)),
      this._viewParts.push(this._viewCursors),
      (this._overlayWidgets = new e4(this._context, this.domNode)),
      this._viewParts.push(this._overlayWidgets));
    const p = this._viewGpuContext
      ? new y3(this._context, this._viewGpuContext)
      : new h4(this._context);
    this._viewParts.push(p);
    const f = new r0(this._context);
    this._viewParts.push(f);
    const m = new X2(this._context);
    if ((this._viewParts.push(m), c)) {
      const e = this._scrollbar.getOverviewRulerLayoutInfo();
      e.parent.insertBefore(c.getDomNode(), e.insertBefore);
    }
    (this._linesContent.appendChild(u.getDomNode()),
      "domNode" in p && this._linesContent.appendChild(p.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(g.getDomNode()),
      this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),
      this._viewGpuContext && this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas),
      this._overflowGuardContainer.appendChild(d.getDomNode()),
      this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),
      this._overflowGuardContainer.appendChild(m.getDomNode()),
      this._overflowGuardContainer.appendChild(f.domNode),
      this.domNode.appendChild(this._overflowGuardContainer),
      a
        ? (a.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),
          a.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode))
        : (this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),
          this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),
      this._applyLayout(),
      (this._pointerHandler = this._register(
        new KJ(this._context, this._viewController, this._createPointerHandlerHelper()),
      )));
  }
  _instantiateEditContext() {
    return this._context.configuration.options.get(170)
      ? this._instantiationService.createInstance(
          b3,
          this._ownerID,
          this._context,
          this._overflowGuardContainer,
          this._viewController,
          this._createTextAreaHandlerHelper(),
        )
      : this._instantiationService.createInstance(
          A5,
          this._context,
          this._overflowGuardContainer,
          this._viewController,
          this._createTextAreaHandlerHelper(),
        );
  }
  _updateEditContext() {
    const e = this._context.configuration.options.get(170),
      t = this._context.configuration.options.get(2);
    if (this._editContextEnabled === e && this._accessibilitySupport === t) return;
    ((this._editContextEnabled = e), (this._accessibilitySupport = t));
    const n = this._editContext.isFocused(),
      i = this._viewParts.indexOf(this._editContext);
    (this._editContext.dispose(),
      (this._editContext = this._instantiateEditContext()),
      n && this._editContext.focus(),
      -1 !== i && this._viewParts.splice(i, 1, this._editContext));
  }
  _computeGlyphMarginLanes() {
    const e = this._context.viewModel.model,
      t = this._context.viewModel.glyphLanes;
    let n = [],
      i = 0;
    ((n = n.concat(
      e.getAllMarginDecorations().map((e) => {
        const t = e.options.glyphMargin?.position ?? $z.Center;
        return (
          (i = Math.max(i, e.range.endLineNumber)),
          { range: e.range, lane: t, persist: e.options.glyphMargin?.persistLane }
        );
      }),
    )),
      (n = n.concat(
        this._glyphMarginWidgets.getWidgets().map((t) => {
          const n = e.validateRange(t.preference.range);
          return ((i = Math.max(i, n.endLineNumber)), { range: n, lane: t.preference.lane });
        }),
      )),
      n.sort((e, t) => YH.compareRangesUsingStarts(e.range, t.range)),
      t.reset(i));
    for (const r of n) t.push(r.lane, r.range, r.persist);
    return t;
  }
  _createPointerHandlerHelper() {
    return {
      viewDomNode: this.domNode.domNode,
      linesContentDomNode: this._linesContent.domNode,
      viewLinesDomNode: this._viewLines.getDomNode().domNode,
      viewLinesGpu: this._viewLinesGpu,
      focusTextArea: () => {
        this.focus();
      },
      dispatchTextAreaEvent: (e) => {
        this._editContext.domNode.domNode.dispatchEvent(e);
      },
      getLastRenderData: () => {
        const e = this._viewCursors.getLastRenderData() || [],
          t = this._editContext.getLastRenderData();
        return new $Q(e, t);
      },
      renderNow: () => {
        this.render(!0, !1);
      },
      shouldSuppressMouseDownOnViewZone: (e) =>
        this._viewZones.shouldSuppressMouseDownOnViewZone(e),
      shouldSuppressMouseDownOnWidget: (e) =>
        this._contentWidgets.shouldSuppressMouseDownOnWidget(e),
      getPositionFromDOMInfo: (e, t) => (
        this._flushAccumulatedAndRenderNow(),
        this._viewLines.getPositionFromDOMInfo(e, t)
      ),
      visibleRangeForPosition: (e, t) => {
        this._flushAccumulatedAndRenderNow();
        const n = new xV(e, t);
        return (
          this._viewLines.visibleRangeForPosition(n) ??
          this._viewLinesGpu?.visibleRangeForPosition(n) ??
          null
        );
      },
      getLineWidth: (e) => {
        if ((this._flushAccumulatedAndRenderNow(), this._viewLinesGpu)) {
          const t = this._viewLinesGpu.getLineWidth(e);
          if (void 0 !== t) return t;
        }
        return this._viewLines.getLineWidth(e);
      },
    };
  }
  _createTextAreaHandlerHelper() {
    return {
      visibleRangeForPosition: (e) => (
        this._flushAccumulatedAndRenderNow(),
        this._viewLines.visibleRangeForPosition(e)
      ),
      linesVisibleRangesForRange: (e, t) => (
        this._flushAccumulatedAndRenderNow(),
        this._viewLines.linesVisibleRangesForRange(e, t)
      ),
    };
  }
  _applyLayout() {
    const e = this._context.configuration.options.get(165);
    (this.domNode.setWidth(e.width),
      this.domNode.setHeight(e.height),
      this._overflowGuardContainer.setWidth(e.width),
      this._overflowGuardContainer.setHeight(e.height),
      this._linesContent.setWidth(16777216),
      this._linesContent.setHeight(16777216));
  }
  _getEditorClassName() {
    const e = this._editContext.isFocused() ? " focused" : "";
    return this._context.configuration.options.get(162) + " " + p0(this._context.theme.type) + e;
  }
  handleEvents(e) {
    (super.handleEvents(e), this._scheduleRender());
  }
  onConfigurationChanged(e) {
    return (
      this.domNode.setClassName(this._getEditorClassName()),
      this._updateEditContext(),
      this._applyLayout(),
      !1
    );
  }
  onCursorStateChanged(e) {
    return ((this._selections = e.selections), !1);
  }
  onDecorationsChanged(e) {
    return (e.affectsGlyphMargin && (this._shouldRecomputeGlyphMarginLanes = !0), !1);
  }
  onFocusChanged(e) {
    return (this.domNode.setClassName(this._getEditorClassName()), !1);
  }
  onThemeChanged(e) {
    return (
      this._context.theme.update(e.theme),
      this.domNode.setClassName(this._getEditorClassName()),
      !1
    );
  }
  dispose() {
    (null !== this._renderAnimationFrame &&
      (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 (const e of this._viewParts) e.dispose();
    super.dispose();
  }
  _scheduleRender() {
    if (this._store.isDisposed) throw new QI();
    if (null === this._renderAnimationFrame) {
      this._editContext instanceof b3 && this._editContext.setEditContextOnDomNode();
      const e = this._createCoordinatedRendering();
      this._renderAnimationFrame = S3.INSTANCE.scheduleCoordinatedRendering({
        window: MF(this.domNode?.domNode),
        prepareRenderText: () => {
          if (this._store.isDisposed) throw new QI();
          try {
            return e.prepareRenderText();
          } finally {
            this._renderAnimationFrame = null;
          }
        },
        renderText: () => {
          if (this._store.isDisposed) throw new QI();
          return e.renderText();
        },
        prepareRender: (t, n) => {
          if (this._store.isDisposed) throw new QI();
          return e.prepareRender(t, n);
        },
        render: (t, n) => {
          if (this._store.isDisposed) throw new QI();
          return e.render(t, n);
        },
      });
    }
  }
  _flushAccumulatedAndRenderNow() {
    const e = this._createCoordinatedRendering();
    C3(() => e.prepareRenderText());
    const t = C3(() => e.renderText());
    if (t) {
      const [n, i] = t;
      (C3(() => e.prepareRender(n, i)), C3(() => e.render(n, i)));
    }
  }
  _getViewPartsToRender() {
    const e = [];
    let t = 0;
    for (const n of this._viewParts) n.shouldRender() && (e[t++] = n);
    return e;
  }
  _createCoordinatedRendering() {
    return {
      prepareRenderText: () => {
        if (this._shouldRecomputeGlyphMarginLanes) {
          this._shouldRecomputeGlyphMarginLanes = !1;
          const e = this._computeGlyphMarginLanes();
          this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes);
        }
        tG.onRenderStart();
      },
      renderText: () => {
        if (!this.domNode.domNode.isConnected) return null;
        let e = this._getViewPartsToRender();
        if (!this._viewLines.shouldRender() && 0 === e.length) return null;
        const t = this._context.viewLayout.getLinesViewportData();
        this._context.viewModel.setViewport(
          t.startLineNumber,
          t.endLineNumber,
          t.centeredLineNumber,
        );
        const n = new L4(
          this._selections,
          t,
          this._context.viewLayout.getWhitespaceViewportData(),
          this._context.viewModel,
        );
        return (
          this._contentWidgets.shouldRender() && this._contentWidgets.onBeforeRender(n),
          this._viewLines.shouldRender() &&
            (this._viewLines.renderText(n),
            this._viewLines.onDidRender(),
            (e = this._getViewPartsToRender())),
          this._viewLinesGpu?.shouldRender() &&
            (this._viewLinesGpu.renderText(n), this._viewLinesGpu.onDidRender()),
          [e, new sQ(this._context.viewLayout, n, this._viewLines, this._viewLinesGpu)]
        );
      },
      prepareRender: (e, t) => {
        for (const n of e) n.prepareRender(t);
      },
      render: (e, t) => {
        for (const n of e) (n.render(t), n.onDidRender());
      },
    };
  }
  delegateVerticalScrollbarPointerDown(e) {
    this._scrollbar.delegateVerticalScrollbarPointerDown(e);
  }
  delegateScrollFromMouseWheelEvent(e) {
    this._scrollbar.delegateScrollFromMouseWheelEvent(e);
  }
  restoreState(e) {
    (this._context.viewModel.viewLayout.setScrollPosition(
      { scrollTop: e.scrollTop, scrollLeft: e.scrollLeft },
      1,
    ),
      this._context.viewModel.visibleLinesStabilized());
  }
  getOffsetForColumn(e, t) {
    const n = this._context.viewModel.model.validatePosition({ lineNumber: e, column: t }),
      i = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);
    this._flushAccumulatedAndRenderNow();
    const r = this._viewLines.visibleRangeForPosition(new xV(i.lineNumber, i.column));
    return r ? r.left : -1;
  }
  getTargetAtClientPoint(e, t) {
    const n = this._pointerHandler.getTargetAtClientPoint(e, t);
    return n
      ? i0.convertViewToModelMouseTarget(n, this._context.viewModel.coordinatesConverter)
      : null;
  }
  createOverviewRuler(e) {
    return new u4(this._context, e);
  }
  change(e) {
    (this._viewZones.changeViewZones(e), this._scheduleRender());
  }
  render(e, t) {
    if (t) {
      this._viewLines.forceShouldRender();
      for (const e of this._viewParts) e.forceShouldRender();
    }
    e ? this._flushAccumulatedAndRenderNow() : this._scheduleRender();
  }
  writeScreenReaderContent(e) {
    this._editContext.writeScreenReaderContent(e);
  }
  focus() {
    this._editContext.focus();
  }
  isFocused() {
    return this._editContext.isFocused();
  }
  isWidgetFocused() {
    return this._widgetFocusTracker.hasFocus();
  }
  setAriaOptions(e) {
    this._editContext.setAriaOptions(e);
  }
  addContentWidget(e) {
    (this._contentWidgets.addWidget(e.widget), this.layoutContentWidget(e), this._scheduleRender());
  }
  layoutContentWidget(e) {
    (this._contentWidgets.setWidgetPosition(
      e.widget,
      e.position?.position ?? null,
      e.position?.secondaryPosition ?? null,
      e.position?.preference ?? null,
      e.position?.positionAffinity ?? null,
    ),
      this._scheduleRender());
  }
  removeContentWidget(e) {
    (this._contentWidgets.removeWidget(e.widget), this._scheduleRender());
  }
  addOverlayWidget(e) {
    (this._overlayWidgets.addWidget(e.widget), this.layoutOverlayWidget(e), this._scheduleRender());
  }
  layoutOverlayWidget(e) {
    this._overlayWidgets.setWidgetPosition(e.widget, e.position) && this._scheduleRender();
  }
  removeOverlayWidget(e) {
    (this._overlayWidgets.removeWidget(e.widget), this._scheduleRender());
  }
  addGlyphMarginWidget(e) {
    (this._glyphMarginWidgets.addWidget(e.widget),
      (this._shouldRecomputeGlyphMarginLanes = !0),
      this._scheduleRender());
  }
  layoutGlyphMarginWidget(e) {
    const t = e.position;
    this._glyphMarginWidgets.setWidgetPosition(e.widget, t) &&
      ((this._shouldRecomputeGlyphMarginLanes = !0), this._scheduleRender());
  }
  removeGlyphMarginWidget(e) {
    (this._glyphMarginWidgets.removeWidget(e.widget),
      (this._shouldRecomputeGlyphMarginLanes = !0),
      this._scheduleRender());
  }
};
function C3(e) {
  try {
    return e();
  } catch (spt) {
    return (HI(spt), null);
  }
}
w3 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(8, vV),
  ],
  w3,
);
class S3 {
  static {
    this.INSTANCE = new S3();
  }
  constructor() {
    ((this._coordinatedRenderings = []), (this._animationFrameRunners = new Map()));
  }
  scheduleCoordinatedRendering(e) {
    return (
      this._coordinatedRenderings.push(e),
      this._scheduleRender(e.window),
      {
        dispose: () => {
          const t = this._coordinatedRenderings.indexOf(e);
          if (
            -1 !== t &&
            (this._coordinatedRenderings.splice(t, 1), 0 === this._coordinatedRenderings.length)
          ) {
            for (const [e, t] of this._animationFrameRunners) t.dispose();
            this._animationFrameRunners.clear();
          }
        },
      }
    );
  }
  _scheduleRender(e) {
    if (!this._animationFrameRunners.has(e)) {
      const t = () => {
        (this._animationFrameRunners.delete(e), this._onRenderScheduled());
      };
      this._animationFrameRunners.set(e, QF(e, t, 100));
    }
  }
  _onRenderScheduled() {
    const e = this._coordinatedRenderings.slice(0);
    this._coordinatedRenderings = [];
    for (const n of e) C3(() => n.prepareRenderText());
    const t = [];
    for (let n = 0, i = e.length; n < i; n++) {
      const i = e[n];
      t[n] = C3(() => i.renderText());
    }
    for (let n = 0, i = e.length; n < i; n++) {
      const i = e[n],
        r = t[n];
      if (!r) continue;
      const [o, s] = r;
      C3(() => i.prepareRender(o, s));
    }
    for (let n = 0, i = e.length; n < i; n++) {
      const i = e[n],
        r = t[n];
      if (!r) continue;
      const [o, s] = r;
      C3(() => i.render(o, s));
    }
  }
}
class k3 extends PO {
  constructor(e, t) {
    (super(),
      (this._onChange = this._register(new QO())),
      (this.onChange = this._onChange.event),
      (this._hadFocus = void 0),
      (this._hasDomElementFocus = !1),
      (this._domFocusTracker = this._register(OB(e))),
      (this._overflowWidgetsDomNodeHasFocus = !1),
      this._register(
        this._domFocusTracker.onDidFocus(() => {
          ((this._hasDomElementFocus = !0), this._update());
        }),
      ),
      this._register(
        this._domFocusTracker.onDidBlur(() => {
          ((this._hasDomElementFocus = !1), this._update());
        }),
      ),
      t &&
        ((this._overflowWidgetsDomNode = this._register(OB(t))),
        this._register(
          this._overflowWidgetsDomNode.onDidFocus(() => {
            ((this._overflowWidgetsDomNodeHasFocus = !0), this._update());
          }),
        ),
        this._register(
          this._overflowWidgetsDomNode.onDidBlur(() => {
            ((this._overflowWidgetsDomNodeHasFocus = !1), this._update());
          }),
        )));
  }
  _update() {
    const e = this._hasDomElementFocus || this._overflowWidgetsDomNodeHasFocus;
    this._hadFocus !== e && ((this._hadFocus = e), this._onChange.fire(void 0));
  }
  hasFocus() {
    return this._hadFocus ?? !1;
  }
}
class E3 {
  constructor(e, t, n, i, r) {
    ((this.injectionOffsets = e),
      (this.injectionOptions = t),
      (this.breakOffsets = n),
      (this.breakOffsetsVisibleColumn = i),
      (this.wrappedTextIndentLength = r));
  }
  getOutputLineCount() {
    return this.breakOffsets.length;
  }
  getMinOutputOffset(e) {
    return e > 0 ? this.wrappedTextIndentLength : 0;
  }
  getLineLength(e) {
    const t = e > 0 ? this.breakOffsets[e - 1] : 0;
    let n = this.breakOffsets[e] - t;
    return (e > 0 && (n += this.wrappedTextIndentLength), n);
  }
  getMaxOutputOffset(e) {
    return this.getLineLength(e);
  }
  translateToInputOffset(e, t) {
    e > 0 && (t = Math.max(0, t - this.wrappedTextIndentLength));
    let n = 0 === e ? t : this.breakOffsets[e - 1] + t;
    if (null !== this.injectionOffsets)
      for (let i = 0; i < this.injectionOffsets.length && n > this.injectionOffsets[i]; i++)
        n < this.injectionOffsets[i] + this.injectionOptions[i].content.length
          ? (n = this.injectionOffsets[i])
          : (n -= this.injectionOptions[i].content.length);
    return n;
  }
  translateToOutputPosition(e, t = 2) {
    let n = e;
    if (null !== this.injectionOffsets)
      for (
        let i = 0;
        i < this.injectionOffsets.length &&
        !(e < this.injectionOffsets[i]) &&
        (1 === t || e !== this.injectionOffsets[i]);
        i++
      )
        n += this.injectionOptions[i].content.length;
    return this.offsetInInputWithInjectionsToOutputPosition(n, t);
  }
  offsetInInputWithInjectionsToOutputPosition(e, t = 2) {
    let n = 0,
      i = this.breakOffsets.length - 1,
      r = 0,
      o = 0;
    for (; n <= i; ) {
      r = (n + (i - n) / 2) | 0;
      const s = this.breakOffsets[r];
      if (((o = r > 0 ? this.breakOffsets[r - 1] : 0), 0 === t))
        if (e <= o) i = r - 1;
        else {
          if (!(e > s)) break;
          n = r + 1;
        }
      else if (e < o) i = r - 1;
      else {
        if (!(e >= s)) break;
        n = r + 1;
      }
    }
    let s = e - o;
    return (r > 0 && (s += this.wrappedTextIndentLength), new D3(r, s));
  }
  normalizeOutputPosition(e, t, n) {
    if (null !== this.injectionOffsets) {
      const i = this.outputPositionToOffsetInInputWithInjections(e, t),
        r = this.normalizeOffsetInInputWithInjectionsAroundInjections(i, n);
      if (r !== i) return this.offsetInInputWithInjectionsToOutputPosition(r, n);
    }
    if (0 === n) {
      if (e > 0 && t === this.getMinOutputOffset(e))
        return new D3(e - 1, this.getMaxOutputOffset(e - 1));
    } else if (1 === n) {
      if (e < this.getOutputLineCount() - 1 && t === this.getMaxOutputOffset(e))
        return new D3(e + 1, this.getMinOutputOffset(e + 1));
    }
    return new D3(e, t);
  }
  outputPositionToOffsetInInputWithInjections(e, t) {
    e > 0 && (t = Math.max(0, t - this.wrappedTextIndentLength));
    return (e > 0 ? this.breakOffsets[e - 1] : 0) + t;
  }
  normalizeOffsetInInputWithInjectionsAroundInjections(e, t) {
    const n = this.getInjectedTextAtOffset(e);
    if (!n) return e;
    if (2 === t) {
      if (
        e === n.offsetInInputWithInjections + n.length &&
        N3(this.injectionOptions[n.injectedTextIndex].cursorStops)
      )
        return n.offsetInInputWithInjections + n.length;
      {
        let e = n.offsetInInputWithInjections;
        if (L3(this.injectionOptions[n.injectedTextIndex].cursorStops)) return e;
        let t = n.injectedTextIndex - 1;
        for (
          ;
          t >= 0 &&
          this.injectionOffsets[t] === this.injectionOffsets[n.injectedTextIndex] &&
          !N3(this.injectionOptions[t].cursorStops) &&
          ((e -= this.injectionOptions[t].content.length),
          !L3(this.injectionOptions[t].cursorStops));
        )
          t--;
        return e;
      }
    }
    if (1 === t || 4 === t) {
      let e = n.offsetInInputWithInjections + n.length,
        t = n.injectedTextIndex;
      for (
        ;
        t + 1 < this.injectionOffsets.length &&
        this.injectionOffsets[t + 1] === this.injectionOffsets[t];
      )
        ((e += this.injectionOptions[t + 1].content.length), t++);
      return e;
    }
    if (0 === t || 3 === t) {
      let e = n.offsetInInputWithInjections,
        t = n.injectedTextIndex;
      for (; t - 1 >= 0 && this.injectionOffsets[t - 1] === this.injectionOffsets[t]; )
        ((e -= this.injectionOptions[t - 1].content.length), t--);
      return e;
    }
    eR();
  }
  getInjectedText(e, t) {
    const n = this.outputPositionToOffsetInInputWithInjections(e, t),
      i = this.getInjectedTextAtOffset(n);
    return i ? { options: this.injectionOptions[i.injectedTextIndex] } : null;
  }
  getInjectedTextAtOffset(e) {
    const t = this.injectionOffsets,
      n = this.injectionOptions;
    if (null !== t) {
      let i = 0;
      for (let r = 0; r < t.length; r++) {
        const o = n[r].content.length,
          s = t[r] + i,
          a = t[r] + i + o;
        if (s > e) break;
        if (e <= a) return { injectedTextIndex: r, offsetInInputWithInjections: s, length: o };
        i += o;
      }
    }
  }
}
function N3(e) {
  return null == e || e === Kz.Right || e === Kz.Both;
}
function L3(e) {
  return null == e || e === Kz.Left || e === Kz.Both;
}
class D3 {
  constructor(e, t) {
    ((this.outputLineIndex = e), (this.outputOffset = t));
  }
  toString() {
    return `${this.outputLineIndex}:${this.outputOffset}`;
  }
  toPosition(e) {
    return new xV(e + this.outputLineIndex, this.outputOffset + 1);
  }
}
class T3 {
  constructor() {
    this.changeType = 1;
  }
}
class I3 {
  static applyInjectedText(e, t) {
    if (!t || 0 === t.length) return e;
    let n = "",
      i = 0;
    for (const r of t)
      ((n += e.substring(i, r.column - 1)), (i = r.column - 1), (n += r.options.content));
    return ((n += e.substring(i)), n);
  }
  static fromDecorations(e) {
    const t = [];
    for (const n of e)
      (n.options.before &&
        n.options.before.content.length > 0 &&
        t.push(
          new I3(n.ownerId, n.range.startLineNumber, n.range.startColumn, n.options.before, 0),
        ),
        n.options.after &&
          n.options.after.content.length > 0 &&
          t.push(new I3(n.ownerId, n.range.endLineNumber, n.range.endColumn, n.options.after, 1)));
    return (
      t.sort((e, t) =>
        e.lineNumber === t.lineNumber
          ? e.column === t.column
            ? e.order - t.order
            : e.column - t.column
          : e.lineNumber - t.lineNumber,
      ),
      t
    );
  }
  constructor(e, t, n, i, r) {
    ((this.ownerId = e),
      (this.lineNumber = t),
      (this.column = n),
      (this.options = i),
      (this.order = r));
  }
}
class R3 {
  constructor(e, t, n) {
    ((this.changeType = 2), (this.lineNumber = e), (this.detail = t), (this.injectedText = n));
  }
}
class O3 {
  constructor(e, t, n, i) {
    ((this.ownerId = e), (this.decorationId = t), (this.lineNumber = n), (this.lineHeight = i));
  }
}
class M3 {
  constructor(e, t) {
    ((this.ownerId = e), (this.lineNumber = t));
  }
}
class A3 {
  constructor(e, t) {
    ((this.changeType = 3), (this.fromLineNumber = e), (this.toLineNumber = t));
  }
}
class P3 {
  constructor(e, t, n, i) {
    ((this.changeType = 4),
      (this.injectedTexts = i),
      (this.fromLineNumber = e),
      (this.toLineNumber = t),
      (this.detail = n));
  }
}
class j3 {
  constructor() {
    this.changeType = 5;
  }
}
class F3 {
  constructor(e, t, n, i) {
    ((this.changes = e),
      (this.versionId = t),
      (this.isUndoing = n),
      (this.isRedoing = i),
      (this.resultingSelection = null));
  }
  containsEvent(e) {
    for (let t = 0, n = this.changes.length; t < n; t++) {
      if (this.changes[t].changeType === e) return !0;
    }
    return !1;
  }
  static merge(e, t) {
    const n = [].concat(e.changes).concat(t.changes),
      i = t.versionId,
      r = e.isUndoing || t.isUndoing,
      o = e.isRedoing || t.isRedoing;
    return new F3(n, i, r, o);
  }
}
class B3 {
  constructor(e) {
    this.changes = e;
  }
}
let V3 = class {
    constructor(e) {
      this.changes = e;
    }
  },
  W3 = class {
    constructor(e) {
      this.changes = e;
    }
  };
class H3 {
  constructor(e, t) {
    ((this.rawContentChangedEvent = e), (this.contentChangedEvent = t));
  }
  merge(e) {
    const t = F3.merge(this.rawContentChangedEvent, e.rawContentChangedEvent),
      n = H3._mergeChangeEvents(this.contentChangedEvent, e.contentChangedEvent);
    return new H3(t, n);
  }
  static _mergeChangeEvents(e, t) {
    const n = [].concat(e.changes).concat(t.changes),
      i = t.eol,
      r = t.versionId,
      o = e.isUndoing || t.isUndoing,
      s = e.isRedoing || t.isRedoing,
      a = e.isFlush || t.isFlush;
    return {
      changes: n,
      eol: i,
      isEolChange: e.isEolChange && t.isEolChange,
      versionId: r,
      isUndoing: o,
      isRedoing: s,
      isFlush: a,
      detailedReasons: e.detailedReasons.concat(t.detailedReasons),
      detailedReasonsChangeLengths: e.detailedReasonsChangeLengths.concat(
        t.detailedReasonsChangeLengths,
      ),
    };
  }
}
const z3 = ZJ("domLineBreaksComputer", { createHTML: (e) => e });
class U3 {
  static create(e) {
    return new U3(new WeakRef(e));
  }
  constructor(e) {
    this.targetWindow = e;
  }
  createLineBreaksComputer(e, t, n, i, r, o) {
    const s = [],
      a = [];
    return {
      addRequest: (e, t, n) => {
        (s.push(e), a.push(t));
      },
      finalize: () =>
        (function (e, t, n, i, r, o, s, a) {
          function l(e) {
            const n = a[e];
            if (n) {
              const i = I3.applyInjectedText(t[e], n),
                r = n.map((e) => e.options),
                o = n.map((e) => e.column - 1);
              return new E3(o, r, [i.length], [], 0);
            }
            return null;
          }
          if (-1 === r) {
            const e = [];
            for (let n = 0, i = t.length; n < i; n++) e[n] = l(n);
            return e;
          }
          const c = Math.round(r * n.typicalHalfwidthCharacterWidth),
            d = 3 === o ? 2 : 2 === o ? 1 : 0,
            u = Math.round(i * d),
            h = Math.ceil(n.spaceWidth * u),
            g = document.createElement("div");
          Vq(g, n);
          const p = new bU(1e4),
            f = [],
            m = [],
            _ = [],
            v = [],
            b = [];
          for (let k = 0; k < t.length; k++) {
            const e = I3.applyInjectedText(t[k], a[k]);
            let r = 0,
              s = 0,
              l = c;
            if (0 !== o)
              if (((r = YM(e)), -1 === r)) r = 0;
              else {
                for (let n = 0; n < r; n++) {
                  s += 9 === e.charCodeAt(n) ? i - (s % i) : 1;
                }
                const t = Math.ceil(n.spaceWidth * s);
                t + n.typicalFullwidthCharacterWidth > c ? ((r = 0), (s = 0)) : (l = c - t);
              }
            const d = e.substr(r),
              u = $3(d, s, i, l, p, h);
            ((f[k] = r), (m[k] = s), (_[k] = d), (v[k] = u[0]), (b[k] = u[1]));
          }
          const y = p.build(),
            x = z3?.createHTML(y) ?? y;
          ((g.innerHTML = x),
            (g.style.position = "absolute"),
            (g.style.top = "10000"),
            "keepAll" === s
              ? ((g.style.wordBreak = "keep-all"), (g.style.overflowWrap = "anywhere"))
              : ((g.style.wordBreak = "inherit"), (g.style.overflowWrap = "break-word")));
          e.document.body.appendChild(g);
          const w = document.createRange(),
            C = Array.prototype.slice.call(g.children, 0),
            S = [];
          for (let k = 0; k < t.length; k++) {
            const e = q3(w, C[k], _[k], v[k]);
            if (null === e) {
              S[k] = l(k);
              continue;
            }
            const t = f[k],
              n = m[k] + u,
              i = b[k],
              r = [];
            for (let a = 0, l = e.length; a < l; a++) r[a] = i[e[a]];
            if (0 !== t) for (let a = 0, l = e.length; a < l; a++) e[a] += t;
            let o, s;
            const c = a[k];
            (c
              ? ((o = c.map((e) => e.options)), (s = c.map((e) => e.column - 1)))
              : ((o = null), (s = null)),
              (S[k] = new E3(s, o, e, r, n)));
          }
          return (g.remove(), S);
        })(fR(this.targetWindow.deref()), s, e, t, n, i, r, a),
    };
  }
}
function $3(e, t, n, i, r, o) {
  if (0 !== o) {
    const e = String(o);
    (r.appendString('<div style="text-indent: -'),
      r.appendString(e),
      r.appendString("px; padding-left: "),
      r.appendString(e),
      r.appendString("px; box-sizing: border-box; width:"));
  } else r.appendString('<div style="width:');
  (r.appendString(String(i)), r.appendString('px;">'));
  const s = e.length;
  let a = t,
    l = 0;
  const c = [],
    d = [];
  let u = 0 < s ? e.charCodeAt(0) : 0;
  r.appendString("<span>");
  for (let h = 0; h < s; h++) {
    (0 !== h && h % 16384 == 0 && r.appendString("</span><span>"), (c[h] = l), (d[h] = a));
    const t = u;
    u = h + 1 < s ? e.charCodeAt(h + 1) : 0;
    let i = 1,
      o = 1;
    switch (t) {
      case 9:
        ((i = n - (a % n)), (o = i));
        for (let e = 1; e <= i; e++) e < i ? r.appendCharCode(160) : r.appendASCIICharCode(32);
        break;
      case 32:
        32 === u ? r.appendCharCode(160) : r.appendASCIICharCode(32);
        break;
      case 60:
        r.appendString("&lt;");
        break;
      case 62:
        r.appendString("&gt;");
        break;
      case 38:
        r.appendString("&amp;");
        break;
      case 0:
        r.appendString("&#00;");
        break;
      case 65279:
      case 8232:
      case 8233:
      case 133:
        r.appendCharCode(65533);
        break;
      default:
        (kA(t) && o++, t < 32 ? r.appendCharCode(9216 + t) : r.appendCharCode(t));
    }
    ((l += i), (a += o));
  }
  return (
    r.appendString("</span>"),
    (c[e.length] = l),
    (d[e.length] = a),
    r.appendString("</div>"),
    [c, d]
  );
}
function q3(e, t, n, i) {
  if (n.length <= 1) return null;
  const r = Array.prototype.slice.call(t.children, 0),
    o = [];
  try {
    K3(e, r, i, 0, null, n.length - 1, null, o);
  } catch (s) {
    return null;
  }
  return 0 === o.length ? null : (o.push(n.length), o);
}
function K3(e, t, n, i, r, o, s, a) {
  if (i === o) return;
  if (
    ((r = r || G3(e, t, n[i], n[i + 1])),
    (s = s || G3(e, t, n[o], n[o + 1])),
    Math.abs(r[0].top - s[0].top) <= 0.1)
  )
    return;
  if (i + 1 === o) return void a.push(o);
  const l = (i + (o - i) / 2) | 0,
    c = G3(e, t, n[l], n[l + 1]);
  (K3(e, t, n, i, r, l, c, a), K3(e, t, n, l, c, o, s, a));
}
function G3(e, t, n, i) {
  return (
    e.setStart(t[(n / 16384) | 0].firstChild, n % 16384),
    e.setEnd(t[(i / 16384) | 0].firstChild, i % 16384),
    e.getClientRects()
  );
}
class Z3 extends PO {
  constructor() {
    (super(),
      (this._editor = null),
      (this._instantiationService = null),
      (this._instances = this._register(new VO())),
      (this._pending = new Map()),
      (this._finishedInstantiation = []),
      (this._finishedInstantiation[0] = !1),
      (this._finishedInstantiation[1] = !1),
      (this._finishedInstantiation[2] = !1),
      (this._finishedInstantiation[3] = !1));
  }
  initialize(e, t, n) {
    ((this._editor = e), (this._instantiationService = n));
    for (const i of t)
      this._pending.has(i.id)
        ? HI(new Error(`Cannot have two contributions with the same id ${i.id}`))
        : this._pending.set(i.id, i);
    (this._instantiateSome(0),
      this._register(
        YF(MF(this._editor.getDomNode()), () => {
          this._instantiateSome(1);
        }),
      ),
      this._register(
        YF(MF(this._editor.getDomNode()), () => {
          this._instantiateSome(2);
        }),
      ),
      this._register(
        YF(
          MF(this._editor.getDomNode()),
          () => {
            this._instantiateSome(3);
          },
          5e3,
        ),
      ));
  }
  saveViewState() {
    const e = {};
    for (const [t, n] of this._instances)
      "function" == typeof n.saveViewState && (e[t] = n.saveViewState());
    return e;
  }
  restoreViewState(e) {
    for (const [t, n] of this._instances)
      "function" == typeof n.restoreViewState && n.restoreViewState(e[t]);
  }
  get(e) {
    return (this._instantiateById(e), this._instances.get(e) || null);
  }
  onBeforeInteractionEvent() {
    this._instantiateSome(2);
  }
  onAfterModelAttached() {
    return YF(
      MF(this._editor?.getDomNode()),
      () => {
        this._instantiateSome(1);
      },
      50,
    );
  }
  _instantiateSome(e) {
    if (this._finishedInstantiation[e]) return;
    this._finishedInstantiation[e] = !0;
    const t = this._findPendingContributionsByInstantiation(e);
    for (const n of t) this._instantiateById(n.id);
  }
  _findPendingContributionsByInstantiation(e) {
    const t = [];
    for (const [, n] of this._pending) n.instantiation === e && t.push(n);
    return t;
  }
  _instantiateById(e) {
    const t = this._pending.get(e);
    if (t) {
      if ((this._pending.delete(e), !this._instantiationService || !this._editor))
        throw new Error("Cannot instantiate contributions before being initialized!");
      try {
        const e = this._instantiationService.createInstance(t.ctor, this._editor);
        (this._instances.set(t.id, e), "function" == typeof e.restoreViewState && t.instantiation);
      } catch (n) {
        HI(n);
      }
    }
  }
}
class Y3 {
  constructor(e, t, n, i, r, o, s) {
    ((this.id = e),
      (this.label = t),
      (this.alias = n),
      (this.metadata = i),
      (this._precondition = r),
      (this._run = o),
      (this._contextKeyService = s));
  }
  isSupported() {
    return this._contextKeyService.contextMatchesRules(this._precondition);
  }
  run(e) {
    return this.isSupported() ? this._run(e) : Promise.resolve(void 0);
  }
}
const X3 = { ICodeEditor: "vs.editor.ICodeEditor", IDiffEditor: "vs.editor.IDiffEditor" };
function Q3(e) {
  let t = 0,
    n = 0,
    i = 0,
    r = 0;
  for (let o = 0, s = e.length; o < s; o++) {
    const a = e.charCodeAt(o);
    13 === a
      ? (0 === t && (n = o),
        t++,
        o + 1 < s && 10 === e.charCodeAt(o + 1) ? ((r |= 2), o++) : (r |= 3),
        (i = o + 1))
      : 10 === a && ((r |= 1), 0 === t && (n = o), t++, (i = o + 1));
  }
  return (0 === t && (n = e.length), [t, n, e.length - i, r]);
}
class J3 {
  constructor(e, t, n, i) {
    ((this.range = e),
      (this.nestingLevel = t),
      (this.nestingLevelOfEqualBracketType = n),
      (this.isInvalid = i));
  }
}
class e6 {
  constructor(e, t, n, i, r, o) {
    ((this.range = e),
      (this.openingBracketRange = t),
      (this.closingBracketRange = n),
      (this.nestingLevel = i),
      (this.nestingLevelOfEqualBracketType = r),
      (this.bracketPairNode = o));
  }
  get openingBracketInfo() {
    return this.bracketPairNode.openingBracket.bracketInfo;
  }
}
class t6 extends e6 {
  constructor(e, t, n, i, r, o, s) {
    (super(e, t, n, i, r, o), (this.minVisibleColumnIndentation = s));
  }
}
function n6(e) {
  return 0 === e;
}
const i6 = 2 ** 26;
function r6(e, t) {
  return e * i6 + t;
}
function o6(e) {
  const t = e,
    n = Math.floor(t / i6);
  return new e3(n, t - n * i6);
}
function s6(e) {
  return e;
}
function a6(e, t) {
  let n = e + t;
  return (t >= i6 && (n -= e % i6), n);
}
function l6(e, t) {
  return e.reduce((e, n) => a6(e, t(n)), 0);
}
function c6(e, t) {
  return e === t;
}
function d6(e, t) {
  const n = e,
    i = t;
  if (i - n <= 0) return 0;
  const r = Math.floor(n / i6),
    o = Math.floor(i / i6),
    s = i - o * i6;
  if (r === o) {
    return r6(0, s - (n - r * i6));
  }
  return r6(o - r, s);
}
function u6(e, t) {
  return e < t;
}
function h6(e, t) {
  return e <= t;
}
function g6(e, t) {
  return e >= t;
}
function p6(e) {
  return r6(e.lineNumber - 1, e.column - 1);
}
function f6(e, t) {
  const n = e,
    i = Math.floor(n / i6),
    r = n - i * i6,
    o = t,
    s = Math.floor(o / i6);
  return new YH(i + 1, r + 1, s + 1, o - s * i6 + 1);
}
class m6 {
  static fromModelContentChanges(e) {
    const t = e
      .map((e) => {
        const t = YH.lift(e.range);
        return new m6(
          p6(t.getStartPosition()),
          p6(t.getEndPosition()),
          (function (e) {
            const t = ZM(e);
            return r6(t.length - 1, t[t.length - 1].length);
          })(e.text),
        );
      })
      .reverse();
    return t;
  }
  constructor(e, t, n) {
    ((this.startOffset = e), (this.endOffset = t), (this.newLength = n));
  }
  toString() {
    return `[${o6(this.startOffset)}...${o6(this.endOffset)}) -> ${o6(this.newLength)}`;
  }
}
class _6 {
  constructor(e) {
    ((this.nextEditIdx = 0),
      (this.deltaOldToNewLineCount = 0),
      (this.deltaOldToNewColumnCount = 0),
      (this.deltaLineIdxInOld = -1),
      (this.edits = e.map((e) => v6.from(e))));
  }
  getOffsetBeforeChange(e) {
    return (this.adjustNextEdit(e), this.translateCurToOld(e));
  }
  getDistanceToNextChange(e) {
    this.adjustNextEdit(e);
    const t = this.edits[this.nextEditIdx],
      n = t ? this.translateOldToCur(t.offsetObj) : null;
    return null === n ? null : d6(e, n);
  }
  translateOldToCur(e) {
    return e.lineCount === this.deltaLineIdxInOld
      ? r6(e.lineCount + this.deltaOldToNewLineCount, e.columnCount + this.deltaOldToNewColumnCount)
      : r6(e.lineCount + this.deltaOldToNewLineCount, e.columnCount);
  }
  translateCurToOld(e) {
    const t = o6(e);
    return t.lineCount - this.deltaOldToNewLineCount === this.deltaLineIdxInOld
      ? r6(t.lineCount - this.deltaOldToNewLineCount, t.columnCount - this.deltaOldToNewColumnCount)
      : r6(t.lineCount - this.deltaOldToNewLineCount, t.columnCount);
  }
  adjustNextEdit(e) {
    for (; this.nextEditIdx < this.edits.length; ) {
      const t = this.edits[this.nextEditIdx],
        n = this.translateOldToCur(t.endOffsetAfterObj);
      if (!h6(n, e)) break;
      {
        this.nextEditIdx++;
        const e = o6(n),
          i = o6(this.translateOldToCur(t.endOffsetBeforeObj)),
          r = e.lineCount - i.lineCount;
        this.deltaOldToNewLineCount += r;
        const o =
            this.deltaLineIdxInOld === t.endOffsetBeforeObj.lineCount
              ? this.deltaOldToNewColumnCount
              : 0,
          s = e.columnCount - i.columnCount;
        ((this.deltaOldToNewColumnCount = o + s),
          (this.deltaLineIdxInOld = t.endOffsetBeforeObj.lineCount));
      }
    }
  }
}
class v6 {
  static from(e) {
    return new v6(e.startOffset, e.endOffset, e.newLength);
  }
  constructor(e, t, n) {
    ((this.endOffsetBeforeObj = o6(t)),
      (this.endOffsetAfterObj = o6(a6(e, n))),
      (this.offsetObj = o6(e)));
  }
}
const b6 = [];
class y6 {
  static {
    this.cache = new Array(129);
  }
  static create(e, t) {
    if (e <= 128 && 0 === t.length) {
      let n = y6.cache[e];
      return (n || ((n = new y6(e, t)), (y6.cache[e] = n)), n);
    }
    return new y6(e, t);
  }
  static {
    this.empty = y6.create(0, b6);
  }
  static getEmpty() {
    return this.empty;
  }
  constructor(e, t) {
    ((this.items = e), (this.additionalItems = t));
  }
  add(e, t) {
    const n = t.getKey(e);
    let i = n >> 5;
    if (0 === i) {
      const e = (1 << n) | this.items;
      return e === this.items ? this : y6.create(e, this.additionalItems);
    }
    i--;
    const r = this.additionalItems.slice(0);
    for (; r.length < i; ) r.push(0);
    return ((r[i] |= 1 << (31 & n)), y6.create(this.items, r));
  }
  merge(e) {
    const t = this.items | e.items;
    if (this.additionalItems === b6 && e.additionalItems === b6)
      return t === this.items ? this : t === e.items ? e : y6.create(t, b6);
    const n = [];
    for (let i = 0; i < Math.max(this.additionalItems.length, e.additionalItems.length); i++) {
      const t = this.additionalItems[i] || 0,
        r = e.additionalItems[i] || 0;
      n.push(t | r);
    }
    return y6.create(t, n);
  }
  intersects(e) {
    if (0 !== (this.items & e.items)) return !0;
    for (let t = 0; t < Math.min(this.additionalItems.length, e.additionalItems.length); t++)
      if (0 !== (this.additionalItems[t] & e.additionalItems[t])) return !0;
    return !1;
  }
}
const x6 = { getKey: (e) => e };
class w6 {
  constructor() {
    this.items = new Map();
  }
  getKey(e) {
    let t = this.items.get(e);
    return (void 0 === t && ((t = this.items.size), this.items.set(e, t)), t);
  }
}
class C6 {
  get length() {
    return this._length;
  }
  constructor(e) {
    this._length = e;
  }
}
class S6 extends C6 {
  static create(e, t, n) {
    let i = e.length;
    return (
      t && (i = a6(i, t.length)),
      n && (i = a6(i, n.length)),
      new S6(i, e, t, n, t ? t.missingOpeningBracketIds : y6.getEmpty())
    );
  }
  get kind() {
    return 2;
  }
  get listHeight() {
    return 0;
  }
  get childrenLength() {
    return 3;
  }
  getChild(e) {
    switch (e) {
      case 0:
        return this.openingBracket;
      case 1:
        return this.child;
      case 2:
        return this.closingBracket;
    }
    throw new Error("Invalid child index");
  }
  get children() {
    const e = [];
    return (
      e.push(this.openingBracket),
      this.child && e.push(this.child),
      this.closingBracket && e.push(this.closingBracket),
      e
    );
  }
  constructor(e, t, n, i, r) {
    (super(e),
      (this.openingBracket = t),
      (this.child = n),
      (this.closingBracket = i),
      (this.missingOpeningBracketIds = r));
  }
  canBeReused(e) {
    return null !== this.closingBracket && !e.intersects(this.missingOpeningBracketIds);
  }
  deepClone() {
    return new S6(
      this.length,
      this.openingBracket.deepClone(),
      this.child && this.child.deepClone(),
      this.closingBracket && this.closingBracket.deepClone(),
      this.missingOpeningBracketIds,
    );
  }
  computeMinIndentation(e, t) {
    return this.child
      ? this.child.computeMinIndentation(a6(e, this.openingBracket.length), t)
      : Number.MAX_SAFE_INTEGER;
  }
}
class k6 extends C6 {
  static create23(e, t, n, i = !1) {
    let r = e.length,
      o = e.missingOpeningBracketIds;
    if (e.listHeight !== t.listHeight) throw new Error("Invalid list heights");
    if (((r = a6(r, t.length)), (o = o.merge(t.missingOpeningBracketIds)), n)) {
      if (e.listHeight !== n.listHeight) throw new Error("Invalid list heights");
      ((r = a6(r, n.length)), (o = o.merge(n.missingOpeningBracketIds)));
    }
    return i ? new N6(r, e.listHeight + 1, e, t, n, o) : new E6(r, e.listHeight + 1, e, t, n, o);
  }
  static getEmpty() {
    return new D6(0, 0, [], y6.getEmpty());
  }
  get kind() {
    return 4;
  }
  get missingOpeningBracketIds() {
    return this._missingOpeningBracketIds;
  }
  constructor(e, t, n) {
    (super(e),
      (this.listHeight = t),
      (this._missingOpeningBracketIds = n),
      (this.cachedMinIndentation = -1));
  }
  throwIfImmutable() {}
  makeLastElementMutable() {
    this.throwIfImmutable();
    const e = this.childrenLength;
    if (0 === e) return;
    const t = this.getChild(e - 1),
      n = 4 === t.kind ? t.toMutable() : t;
    return (t !== n && this.setChild(e - 1, n), n);
  }
  makeFirstElementMutable() {
    this.throwIfImmutable();
    if (0 === this.childrenLength) return;
    const e = this.getChild(0),
      t = 4 === e.kind ? e.toMutable() : e;
    return (e !== t && this.setChild(0, t), t);
  }
  canBeReused(e) {
    if (e.intersects(this.missingOpeningBracketIds)) return !1;
    if (0 === this.childrenLength) return !1;
    let t = this;
    for (; 4 === t.kind; ) {
      const e = t.childrenLength;
      if (0 === e) throw new QI();
      t = t.getChild(e - 1);
    }
    return t.canBeReused(e);
  }
  handleChildrenChanged() {
    this.throwIfImmutable();
    const e = this.childrenLength;
    let t = this.getChild(0).length,
      n = this.getChild(0).missingOpeningBracketIds;
    for (let i = 1; i < e; i++) {
      const e = this.getChild(i);
      ((t = a6(t, e.length)), (n = n.merge(e.missingOpeningBracketIds)));
    }
    ((this._length = t), (this._missingOpeningBracketIds = n), (this.cachedMinIndentation = -1));
  }
  computeMinIndentation(e, t) {
    if (-1 !== this.cachedMinIndentation) return this.cachedMinIndentation;
    let n = Number.MAX_SAFE_INTEGER,
      i = e;
    for (let r = 0; r < this.childrenLength; r++) {
      const e = this.getChild(r);
      e && ((n = Math.min(n, e.computeMinIndentation(i, t))), (i = a6(i, e.length)));
    }
    return ((this.cachedMinIndentation = n), n);
  }
}
class E6 extends k6 {
  get childrenLength() {
    return null !== this._item3 ? 3 : 2;
  }
  getChild(e) {
    switch (e) {
      case 0:
        return this._item1;
      case 1:
        return this._item2;
      case 2:
        return this._item3;
    }
    throw new Error("Invalid child index");
  }
  setChild(e, t) {
    switch (e) {
      case 0:
        return void (this._item1 = t);
      case 1:
        return void (this._item2 = t);
      case 2:
        return void (this._item3 = t);
    }
    throw new 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(e, t, n, i, r, o) {
    (super(e, t, o), (this._item1 = n), (this._item2 = i), (this._item3 = r));
  }
  deepClone() {
    return new E6(
      this.length,
      this.listHeight,
      this._item1.deepClone(),
      this._item2.deepClone(),
      this._item3 ? this._item3.deepClone() : null,
      this.missingOpeningBracketIds,
    );
  }
  appendChildOfSameHeight(e) {
    if (this._item3) throw new Error("Cannot append to a full (2,3) tree node");
    (this.throwIfImmutable(), (this._item3 = e), this.handleChildrenChanged());
  }
  unappendChild() {
    if (!this._item3) throw new Error("Cannot remove from a non-full (2,3) tree node");
    this.throwIfImmutable();
    const e = this._item3;
    return ((this._item3 = null), this.handleChildrenChanged(), e);
  }
  prependChildOfSameHeight(e) {
    if (this._item3) throw new Error("Cannot prepend to a full (2,3) tree node");
    (this.throwIfImmutable(),
      (this._item3 = this._item2),
      (this._item2 = this._item1),
      (this._item1 = e),
      this.handleChildrenChanged());
  }
  unprependChild() {
    if (!this._item3) throw new Error("Cannot remove from a non-full (2,3) tree node");
    this.throwIfImmutable();
    const e = this._item1;
    return (
      (this._item1 = this._item2),
      (this._item2 = this._item3),
      (this._item3 = null),
      this.handleChildrenChanged(),
      e
    );
  }
  toMutable() {
    return this;
  }
}
class N6 extends E6 {
  toMutable() {
    return new E6(
      this.length,
      this.listHeight,
      this.item1,
      this.item2,
      this.item3,
      this.missingOpeningBracketIds,
    );
  }
  throwIfImmutable() {
    throw new Error("this instance is immutable");
  }
}
class L6 extends k6 {
  get childrenLength() {
    return this._children.length;
  }
  getChild(e) {
    return this._children[e];
  }
  setChild(e, t) {
    this._children[e] = t;
  }
  get children() {
    return this._children;
  }
  constructor(e, t, n, i) {
    (super(e, t, i), (this._children = n));
  }
  deepClone() {
    const e = new Array(this._children.length);
    for (let t = 0; t < this._children.length; t++) e[t] = this._children[t].deepClone();
    return new L6(this.length, this.listHeight, e, this.missingOpeningBracketIds);
  }
  appendChildOfSameHeight(e) {
    (this.throwIfImmutable(), this._children.push(e), this.handleChildrenChanged());
  }
  unappendChild() {
    this.throwIfImmutable();
    const e = this._children.pop();
    return (this.handleChildrenChanged(), e);
  }
  prependChildOfSameHeight(e) {
    (this.throwIfImmutable(), this._children.unshift(e), this.handleChildrenChanged());
  }
  unprependChild() {
    this.throwIfImmutable();
    const e = this._children.shift();
    return (this.handleChildrenChanged(), e);
  }
  toMutable() {
    return this;
  }
}
class D6 extends L6 {
  toMutable() {
    return new L6(this.length, this.listHeight, [...this.children], this.missingOpeningBracketIds);
  }
  throwIfImmutable() {
    throw new Error("this instance is immutable");
  }
}
const T6 = [];
class I6 extends C6 {
  get listHeight() {
    return 0;
  }
  get childrenLength() {
    return 0;
  }
  getChild(e) {
    return null;
  }
  get children() {
    return T6;
  }
  deepClone() {
    return this;
  }
}
class R6 extends I6 {
  get kind() {
    return 0;
  }
  get missingOpeningBracketIds() {
    return y6.getEmpty();
  }
  canBeReused(e) {
    return !0;
  }
  computeMinIndentation(e, t) {
    const n = o6(e),
      i = (0 === n.columnCount ? n.lineCount : n.lineCount + 1) + 1,
      r = ((o = a6(e, this.length)), Math.floor(o / i6) + 1);
    var o;
    let s = Number.MAX_SAFE_INTEGER;
    for (let a = i; a <= r; a++) {
      const e = t.getLineFirstNonWhitespaceColumn(a),
        n = t.getLineContent(a);
      if (0 === e) continue;
      const i = tz.visibleColumnFromColumn(n, e, t.getOptions().tabSize);
      s = Math.min(s, i);
    }
    return s;
  }
}
class O6 extends I6 {
  static create(e, t, n) {
    return new O6(e, t, n);
  }
  get kind() {
    return 1;
  }
  get missingOpeningBracketIds() {
    return y6.getEmpty();
  }
  constructor(e, t, n) {
    (super(e), (this.bracketInfo = t), (this.bracketIds = n));
  }
  get text() {
    return this.bracketInfo.bracketText;
  }
  get languageId() {
    return this.bracketInfo.languageId;
  }
  canBeReused(e) {
    return !1;
  }
  computeMinIndentation(e, t) {
    return Number.MAX_SAFE_INTEGER;
  }
}
class M6 extends I6 {
  get kind() {
    return 3;
  }
  constructor(e, t) {
    (super(t), (this.missingOpeningBracketIds = e));
  }
  canBeReused(e) {
    return !e.intersects(this.missingOpeningBracketIds);
  }
  computeMinIndentation(e, t) {
    return Number.MAX_SAFE_INTEGER;
  }
}
let A6 = class {
  constructor(e, t, n, i, r) {
    ((this.length = e),
      (this.kind = t),
      (this.bracketId = n),
      (this.bracketIds = i),
      (this.astNode = r));
  }
};
class P6 {
  constructor(e, t) {
    ((this.textModel = e),
      (this.bracketTokens = t),
      (this.reader = new j6(this.textModel, this.bracketTokens)),
      (this._offset = 0),
      (this.didPeek = !1),
      (this.peeked = null),
      (this.textBufferLineCount = e.getLineCount()),
      (this.textBufferLastLineLength = e.getLineLength(this.textBufferLineCount)));
  }
  get offset() {
    return this._offset;
  }
  get length() {
    return r6(this.textBufferLineCount - 1, this.textBufferLastLineLength);
  }
  skip(e) {
    ((this.didPeek = !1), (this._offset = a6(this._offset, e)));
    const t = o6(this._offset);
    this.reader.setPosition(t.lineCount, t.columnCount);
  }
  read() {
    let e;
    return (
      this.peeked ? ((this.didPeek = !1), (e = this.peeked)) : (e = this.reader.read()),
      e && (this._offset = a6(this._offset, e.length)),
      e
    );
  }
  peek() {
    return (this.didPeek || ((this.peeked = this.reader.read()), (this.didPeek = !0)), this.peeked);
  }
}
class j6 {
  constructor(e, t) {
    ((this.textModel = e),
      (this.bracketTokens = t),
      (this.lineIdx = 0),
      (this.line = null),
      (this.lineCharOffset = 0),
      (this.lineTokens = null),
      (this.lineTokenOffset = 0),
      (this.peekedToken = null),
      (this.textBufferLineCount = e.getLineCount()),
      (this.textBufferLastLineLength = e.getLineLength(this.textBufferLineCount)));
  }
  setPosition(e, t) {
    (e === this.lineIdx
      ? ((this.lineCharOffset = t),
        null !== this.line &&
          (this.lineTokenOffset =
            0 === this.lineCharOffset
              ? 0
              : this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset)))
      : ((this.lineIdx = e), (this.lineCharOffset = t), (this.line = null)),
      (this.peekedToken = null));
  }
  read() {
    if (this.peekedToken) {
      const e = this.peekedToken;
      return ((this.peekedToken = null), (this.lineCharOffset += e.length), e);
    }
    if (
      this.lineIdx > this.textBufferLineCount - 1 ||
      (this.lineIdx === this.textBufferLineCount - 1 &&
        this.lineCharOffset >= this.textBufferLastLineLength)
    )
      return null;
    null === this.line &&
      ((this.lineTokens = this.textModel.tokenization.getLineTokens(this.lineIdx + 1)),
      (this.line = this.lineTokens.getLineContent()),
      (this.lineTokenOffset =
        0 === this.lineCharOffset
          ? 0
          : this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset)));
    const e = this.lineIdx,
      t = this.lineCharOffset;
    let n = 0;
    for (;;) {
      const i = this.lineTokens,
        r = i.getCount();
      let o = null;
      if (this.lineTokenOffset < r) {
        const s = i.getMetadata(this.lineTokenOffset);
        for (; this.lineTokenOffset + 1 < r && s === i.getMetadata(this.lineTokenOffset + 1); )
          this.lineTokenOffset++;
        const a = 0 === E$.getTokenType(s),
          l = E$.containsBalancedBrackets(s),
          c = i.getEndOffset(this.lineTokenOffset);
        if (l && a && this.lineCharOffset < c) {
          const e = i.getLanguageId(this.lineTokenOffset),
            t = this.line.substring(this.lineCharOffset, c),
            n = this.bracketTokens.getSingleLanguageBracketTokens(e),
            r = n.regExpGlobal;
          if (r) {
            r.lastIndex = 0;
            const e = r.exec(t);
            e && ((o = n.getToken(e[0])), o && (this.lineCharOffset += e.index));
          }
        }
        if (((n += c - this.lineCharOffset), o)) {
          if (e !== this.lineIdx || t !== this.lineCharOffset) {
            this.peekedToken = o;
            break;
          }
          return ((this.lineCharOffset += s6(o.length)), o);
        }
        (this.lineTokenOffset++, (this.lineCharOffset = c));
      } else {
        if (this.lineIdx === this.textBufferLineCount - 1) break;
        if (
          (this.lineIdx++,
          (this.lineTokens = this.textModel.tokenization.getLineTokens(this.lineIdx + 1)),
          (this.lineTokenOffset = 0),
          (this.line = this.lineTokens.getLineContent()),
          (this.lineCharOffset = 0),
          (n += 33),
          n > 1e3)
        )
          break;
      }
      if (n > 1500) break;
    }
    const i =
      ((r = e),
      (o = t),
      (s = this.lineIdx),
      (a = this.lineCharOffset),
      r !== s ? r6(s - r, a) : r6(0, a - o));
    var r, o, s, a;
    return new A6(i, 0, -1, y6.getEmpty(), new R6(i));
  }
}
class F6 {
  constructor(e, t) {
    ((this.text = e), (this._offset = 0), (this.idx = 0));
    const n = t.getRegExpStr(),
      i = n ? new RegExp(n + "|\n", "gi") : null,
      r = [];
    let o,
      s = 0,
      a = 0,
      l = 0,
      c = 0;
    const d = [];
    for (let g = 0; g < 60; g++) d.push(new A6(r6(0, g), 0, -1, y6.getEmpty(), new R6(r6(0, g))));
    const u = [];
    for (let g = 0; g < 60; g++) u.push(new A6(r6(1, g), 0, -1, y6.getEmpty(), new R6(r6(1, g))));
    if (i)
      for (i.lastIndex = 0; null !== (o = i.exec(e)); ) {
        const e = o.index,
          n = o[0];
        if ("\n" === n) (s++, (a = e + 1));
        else {
          if (l !== e) {
            let t;
            if (c === s) {
              const n = e - l;
              if (n < d.length) t = d[n];
              else {
                const e = r6(0, n);
                t = new A6(e, 0, -1, y6.getEmpty(), new R6(e));
              }
            } else {
              const n = s - c,
                i = e - a;
              if (1 === n && i < u.length) t = u[i];
              else {
                const e = r6(n, i);
                t = new A6(e, 0, -1, y6.getEmpty(), new R6(e));
              }
            }
            r.push(t);
          }
          (r.push(t.getToken(n)), (l = e + n.length), (c = s));
        }
      }
    const h = e.length;
    if (l !== h) {
      const e = c === s ? r6(0, h - l) : r6(s - c, h - a);
      r.push(new A6(e, 0, -1, y6.getEmpty(), new R6(e)));
    }
    ((this.length = r6(s, h - a)), (this.tokens = r));
  }
  get offset() {
    return this._offset;
  }
  read() {
    return this.tokens[this.idx++] || null;
  }
  peek() {
    return this.tokens[this.idx] || null;
  }
  skip(e) {
    throw new YI();
  }
}
class B6 {
  static createFromLanguage(e, t) {
    function n(e) {
      return t.getKey(`${e.languageId}:::${e.bracketText}`);
    }
    const i = new Map();
    for (const r of e.bracketsNew.openingBrackets) {
      const e = r6(0, r.bracketText.length),
        t = n(r),
        o = y6.getEmpty().add(t, x6);
      i.set(r.bracketText, new A6(e, 1, t, o, O6.create(e, r, o)));
    }
    for (const r of e.bracketsNew.closingBrackets) {
      const e = r6(0, r.bracketText.length);
      let t = y6.getEmpty();
      const o = r.getOpeningBrackets();
      for (const i of o) t = t.add(n(i), x6);
      i.set(r.bracketText, new A6(e, 2, n(o[0]), t, O6.create(e, r, t)));
    }
    return new B6(i);
  }
  constructor(e) {
    ((this.map = e), (this.hasRegExp = !1), (this._regExpGlobal = null));
  }
  getRegExpStr() {
    if (this.isEmpty) return null;
    {
      const e = [...this.map.keys()];
      return (
        e.sort(),
        e.reverse(),
        e
          .map((e) =>
            (function (e) {
              let t = zM(e);
              /^[\w ]+/.test(e) && (t = `\\b${t}`);
              /[\w ]+$/.test(e) && (t = `${t}\\b`);
              return t;
            })(e),
          )
          .join("|")
      );
    }
  }
  get regExpGlobal() {
    if (!this.hasRegExp) {
      const e = this.getRegExpStr();
      ((this._regExpGlobal = e ? new RegExp(e, "gi") : null), (this.hasRegExp = !0));
    }
    return this._regExpGlobal;
  }
  getToken(e) {
    return this.map.get(e.toLowerCase());
  }
  findClosingTokenText(e) {
    for (const [t, n] of this.map) if (2 === n.kind && n.bracketIds.intersects(e)) return t;
  }
  get isEmpty() {
    return 0 === this.map.size;
  }
}
class V6 {
  constructor(e, t) {
    ((this.denseKeyProvider = e),
      (this.getLanguageConfiguration = t),
      (this.languageIdToBracketTokens = new Map()));
  }
  didLanguageChange(e) {
    return this.languageIdToBracketTokens.has(e);
  }
  getSingleLanguageBracketTokens(e) {
    let t = this.languageIdToBracketTokens.get(e);
    return (
      t ||
        ((t = B6.createFromLanguage(this.getLanguageConfiguration(e), this.denseKeyProvider)),
        this.languageIdToBracketTokens.set(e, t)),
      t
    );
  }
}
function W6(e, t = !1) {
  if (0 === e.length) return null;
  if (1 === e.length) return e[0];
  let n = e.length;
  for (; n > 3; ) {
    const i = n >> 1;
    for (let r = 0; r < i; r++) {
      const i = r << 1;
      e[r] = k6.create23(e[i], e[i + 1], i + 3 === n ? e[i + 2] : null, t);
    }
    n = i;
  }
  return k6.create23(e[0], e[1], n >= 3 ? e[2] : null, t);
}
function H6(e, t) {
  return Math.abs(e.listHeight - t.listHeight);
}
function z6(e, t) {
  return e.listHeight === t.listHeight
    ? k6.create23(e, t, null, !1)
    : e.listHeight > t.listHeight
      ? (function (e, t) {
          e = e.toMutable();
          let n = e;
          const i = [];
          let r;
          for (;;) {
            if (t.listHeight === n.listHeight) {
              r = t;
              break;
            }
            if (4 !== n.kind) throw new Error("unexpected");
            (i.push(n), (n = n.makeLastElementMutable()));
          }
          for (let o = i.length - 1; o >= 0; o--) {
            const e = i[o];
            r
              ? e.childrenLength >= 3
                ? (r = k6.create23(e.unappendChild(), r, null, !1))
                : (e.appendChildOfSameHeight(r), (r = void 0))
              : e.handleChildrenChanged();
          }
          return r ? k6.create23(e, r, null, !1) : e;
        })(e, t)
      : (function (e, t) {
          e = e.toMutable();
          let n = e;
          const i = [];
          for (; t.listHeight !== n.listHeight; ) {
            if (4 !== n.kind) throw new Error("unexpected");
            (i.push(n), (n = n.makeFirstElementMutable()));
          }
          let r = t;
          for (let o = i.length - 1; o >= 0; o--) {
            const e = i[o];
            r
              ? e.childrenLength >= 3
                ? (r = k6.create23(r, e.unprependChild(), null, !1))
                : (e.prependChildOfSameHeight(r), (r = void 0))
              : e.handleChildrenChanged();
          }
          return r ? k6.create23(r, e, null, !1) : e;
        })(t, e);
}
class U6 {
  constructor(e) {
    ((this.lastOffset = 0), (this.nextNodes = [e]), (this.offsets = [0]), (this.idxs = []));
  }
  readLongestNodeAt(e, t) {
    if (u6(e, this.lastOffset)) throw new Error("Invalid offset");
    for (this.lastOffset = e; ; ) {
      const n = q6(this.nextNodes);
      if (!n) return;
      const i = q6(this.offsets);
      if (u6(e, i)) return;
      if (u6(i, e))
        if (a6(i, n.length) <= e) this.nextNodeAfterCurrent();
        else {
          const e = $6(n);
          -1 !== e
            ? (this.nextNodes.push(n.getChild(e)), this.offsets.push(i), this.idxs.push(e))
            : this.nextNodeAfterCurrent();
        }
      else {
        if (t(n)) return (this.nextNodeAfterCurrent(), n);
        {
          const e = $6(n);
          if (-1 === e) return void this.nextNodeAfterCurrent();
          (this.nextNodes.push(n.getChild(e)), this.offsets.push(i), this.idxs.push(e));
        }
      }
    }
  }
  nextNodeAfterCurrent() {
    for (;;) {
      const e = q6(this.offsets),
        t = q6(this.nextNodes);
      if ((this.nextNodes.pop(), this.offsets.pop(), 0 === this.idxs.length)) break;
      const n = q6(this.nextNodes),
        i = $6(n, this.idxs[this.idxs.length - 1]);
      if (-1 !== i) {
        (this.nextNodes.push(n.getChild(i)),
          this.offsets.push(a6(e, t.length)),
          (this.idxs[this.idxs.length - 1] = i));
        break;
      }
      this.idxs.pop();
    }
  }
}
function $6(e, t = -1) {
  for (;;) {
    if (++t >= e.childrenLength) return -1;
    if (e.getChild(t)) return t;
  }
}
function q6(e) {
  return e.length > 0 ? e[e.length - 1] : void 0;
}
function K6(e, t, n, i) {
  return new G6(e, t, n, i).parseDocument();
}
class G6 {
  constructor(e, t, n, i) {
    if (
      ((this.tokenizer = e),
      (this.createImmutableLists = i),
      (this._itemsConstructed = 0),
      (this._itemsFromCache = 0),
      n && i)
    )
      throw new Error("Not supported");
    ((this.oldNodeReader = n ? new U6(n) : void 0), (this.positionMapper = new _6(t)));
  }
  parseDocument() {
    ((this._itemsConstructed = 0), (this._itemsFromCache = 0));
    let e = this.parseList(y6.getEmpty(), 0);
    return (e || (e = k6.getEmpty()), e);
  }
  parseList(e, t) {
    const n = [];
    for (;;) {
      let i = this.tryReadChildFromCache(e);
      if (!i) {
        const n = this.tokenizer.peek();
        if (!n || (2 === n.kind && n.bracketIds.intersects(e))) break;
        i = this.parseChild(e, t + 1);
      }
      (4 === i.kind && 0 === i.childrenLength) || n.push(i);
    }
    const i = this.oldNodeReader
      ? (function (e) {
          if (0 === e.length) return null;
          if (1 === e.length) return e[0];
          let t = 0;
          function n() {
            if (t >= e.length) return null;
            const n = t,
              i = e[n].listHeight;
            for (t++; t < e.length && e[t].listHeight === i; ) t++;
            return t - n >= 2 ? W6(0 === n && t === e.length ? e : e.slice(n, t), !1) : e[n];
          }
          let i = n(),
            r = n();
          if (!r) return i;
          for (let o = n(); o; o = n())
            H6(i, r) <= H6(r, o) ? ((i = z6(i, r)), (r = o)) : (r = z6(r, o));
          return z6(i, r);
        })(n)
      : W6(n, this.createImmutableLists);
    return i;
  }
  tryReadChildFromCache(e) {
    if (this.oldNodeReader) {
      const t = this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);
      if (null === t || !n6(t)) {
        const n = this.oldNodeReader.readLongestNodeAt(
          this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),
          (n) => {
            if (null !== t && !u6(n.length, t)) return !1;
            return n.canBeReused(e);
          },
        );
        if (n) return (this._itemsFromCache++, this.tokenizer.skip(n.length), n);
      }
    }
  }
  parseChild(e, t) {
    this._itemsConstructed++;
    const n = this.tokenizer.read();
    switch (n.kind) {
      case 2:
        return new M6(n.bracketIds, n.length);
      case 0:
        return n.astNode;
      case 1: {
        if (t > 300) return new R6(n.length);
        const i = e.merge(n.bracketIds),
          r = this.parseList(i, t + 1),
          o = this.tokenizer.peek();
        return o &&
          2 === o.kind &&
          (o.bracketId === n.bracketId || o.bracketIds.intersects(n.bracketIds))
          ? (this.tokenizer.read(), S6.create(n.astNode, r, o.astNode))
          : S6.create(n.astNode, r, null);
      }
      default:
        throw new Error("unexpected");
    }
  }
}
function Z6(e, t) {
  if (0 === e.length) return t;
  if (0 === t.length) return e;
  const n = new Cj(X6(e)),
    i = X6(t);
  i.push({ modified: !1, lengthBefore: void 0, lengthAfter: void 0 });
  let r = n.dequeue();
  function o(e) {
    if (void 0 === e) {
      const e = n.takeWhile((e) => !0) || [];
      return (r && e.unshift(r), e);
    }
    const t = [];
    for (; r && !n6(e); ) {
      const [i, o] = r.splitAt(e);
      (t.push(i), (e = d6(i.lengthAfter, e)), (r = o ?? n.dequeue()));
    }
    return (n6(e) || t.push(new Y6(!1, e, e)), t);
  }
  const s = [];
  function a(e, t, n) {
    if (s.length > 0 && c6(s[s.length - 1].endOffset, e)) {
      const e = s[s.length - 1];
      s[s.length - 1] = new m6(e.startOffset, t, a6(e.newLength, n));
    } else s.push({ startOffset: e, endOffset: t, newLength: n });
  }
  let l = 0;
  for (const c of i) {
    const e = o(c.lengthBefore);
    if (c.modified) {
      const t = l6(e, (e) => e.lengthBefore),
        n = a6(l, t);
      (a(l, n, c.lengthAfter), (l = n));
    } else
      for (const t of e) {
        const e = l;
        ((l = a6(l, t.lengthBefore)), t.modified && a(e, l, t.lengthAfter));
      }
  }
  return s;
}
class Y6 {
  constructor(e, t, n) {
    ((this.modified = e), (this.lengthBefore = t), (this.lengthAfter = n));
  }
  splitAt(e) {
    const t = d6(e, this.lengthAfter);
    return c6(t, 0)
      ? [this, void 0]
      : this.modified
        ? [new Y6(this.modified, this.lengthBefore, e), new Y6(this.modified, 0, t)]
        : [new Y6(this.modified, e, e), new Y6(this.modified, t, t)];
  }
  toString() {
    return `${this.modified ? "M" : "U"}:${o6(this.lengthBefore)} -> ${o6(this.lengthAfter)}`;
  }
}
function X6(e) {
  const t = [];
  let n = 0;
  for (const i of e) {
    const e = d6(n, i.startOffset);
    n6(e) || t.push(new Y6(!1, e, e));
    const r = d6(i.startOffset, i.endOffset);
    (t.push(new Y6(!0, r, i.newLength)), (n = i.endOffset));
  }
  return t;
}
class Q6 extends PO {
  didLanguageChange(e) {
    return this.brackets.didLanguageChange(e);
  }
  constructor(e, t) {
    if (
      (super(),
      (this.textModel = e),
      (this.getLanguageConfiguration = t),
      (this.didChangeEmitter = new QO()),
      (this.denseKeyProvider = new w6()),
      (this.brackets = new V6(this.denseKeyProvider, this.getLanguageConfiguration)),
      (this.onDidChange = this.didChangeEmitter.event),
      (this.queuedTextEditsForInitialAstWithoutTokens = []),
      (this.queuedTextEdits = []),
      e.tokenization.hasTokens)
    )
      2 === e.tokenization.backgroundTokenizationState
        ? ((this.initialAstWithoutTokens = void 0),
          (this.astWithTokens = this.parseDocumentFromTextBuffer([], void 0, !1)))
        : ((this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer([], void 0, !0)),
          (this.astWithTokens = this.initialAstWithoutTokens));
    else {
      const e = this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),
        t = new F6(this.textModel.getValue(), e);
      ((this.initialAstWithoutTokens = K6(t, [], void 0, !0)),
        (this.astWithTokens = this.initialAstWithoutTokens));
    }
  }
  handleDidChangeBackgroundTokenizationState() {
    if (2 === this.textModel.tokenization.backgroundTokenizationState) {
      const e = void 0 === this.initialAstWithoutTokens;
      ((this.initialAstWithoutTokens = void 0), e || this.didChangeEmitter.fire());
    }
  }
  handleDidChangeTokens({ ranges: e }) {
    const t = e.map(
      (e) =>
        new m6(
          r6(e.fromLineNumber - 1, 0),
          r6(e.toLineNumber, 0),
          r6(e.toLineNumber - e.fromLineNumber + 1, 0),
        ),
    );
    (this.handleEdits(t, !0), this.initialAstWithoutTokens || this.didChangeEmitter.fire());
  }
  handleContentChanged(e) {
    const t = m6.fromModelContentChanges(e.changes);
    this.handleEdits(t, !1);
  }
  handleEdits(e, t) {
    const n = Z6(this.queuedTextEdits, e);
    ((this.queuedTextEdits = n),
      this.initialAstWithoutTokens &&
        !t &&
        (this.queuedTextEditsForInitialAstWithoutTokens = Z6(
          this.queuedTextEditsForInitialAstWithoutTokens,
          e,
        )));
  }
  flushQueue() {
    (this.queuedTextEdits.length > 0 &&
      ((this.astWithTokens = this.parseDocumentFromTextBuffer(
        this.queuedTextEdits,
        this.astWithTokens,
        !1,
      )),
      (this.queuedTextEdits = [])),
      this.queuedTextEditsForInitialAstWithoutTokens.length > 0 &&
        (this.initialAstWithoutTokens &&
          (this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer(
            this.queuedTextEditsForInitialAstWithoutTokens,
            this.initialAstWithoutTokens,
            !1,
          )),
        (this.queuedTextEditsForInitialAstWithoutTokens = [])));
  }
  parseDocumentFromTextBuffer(e, t, n) {
    const i = t;
    return K6(new P6(this.textModel, this.brackets), e, i, n);
  }
  getBracketsInRange(e, t) {
    this.flushQueue();
    const n = r6(e.startLineNumber - 1, e.startColumn - 1),
      i = r6(e.endLineNumber - 1, e.endColumn - 1);
    return new Sj((e) => {
      const r = this.initialAstWithoutTokens || this.astWithTokens;
      t8(r, 0, r.length, n, i, e, 0, 0, new Map(), t);
    });
  }
  getBracketPairsInRange(e, t) {
    this.flushQueue();
    const n = p6(e.getStartPosition()),
      i = p6(e.getEndPosition());
    return new Sj((e) => {
      const r = this.initialAstWithoutTokens || this.astWithTokens,
        o = new n8(e, t, this.textModel);
      i8(r, 0, r.length, n, i, o, 0, new Map());
    });
  }
  getFirstBracketAfter(e) {
    this.flushQueue();
    const t = this.initialAstWithoutTokens || this.astWithTokens;
    return e8(t, 0, t.length, p6(e));
  }
  getFirstBracketBefore(e) {
    this.flushQueue();
    const t = this.initialAstWithoutTokens || this.astWithTokens;
    return J6(t, 0, t.length, p6(e));
  }
}
function J6(e, t, n, i) {
  if (4 === e.kind || 2 === e.kind) {
    const r = [];
    for (const i of e.children)
      ((n = a6(t, i.length)), r.push({ nodeOffsetStart: t, nodeOffsetEnd: n }), (t = n));
    for (let t = r.length - 1; t >= 0; t--) {
      const { nodeOffsetStart: n, nodeOffsetEnd: o } = r[t];
      if (u6(n, i)) {
        const r = J6(e.children[t], n, o, i);
        if (r) return r;
      }
    }
    return null;
  }
  if (3 === e.kind) return null;
  if (1 === e.kind) {
    const i = f6(t, n);
    return { bracketInfo: e.bracketInfo, range: i };
  }
  return null;
}
function e8(e, t, n, i) {
  if (4 === e.kind || 2 === e.kind) {
    for (const r of e.children) {
      if (u6(i, (n = a6(t, r.length)))) {
        const e = e8(r, t, n, i);
        if (e) return e;
      }
      t = n;
    }
    return null;
  }
  if (3 === e.kind) return null;
  if (1 === e.kind) {
    const i = f6(t, n);
    return { bracketInfo: e.bracketInfo, range: i };
  }
  return null;
}
function t8(e, t, n, i, r, o, s, a, l, c, d = !1) {
  if (s > 200) return !0;
  e: for (;;)
    switch (e.kind) {
      case 4: {
        const a = e.childrenLength;
        for (let d = 0; d < a; d++) {
          const a = e.getChild(d);
          if (a) {
            if (((n = a6(t, a.length)), h6(t, r) && g6(n, i))) {
              if (g6(n, r)) {
                e = a;
                continue e;
              }
              if (!t8(a, t, n, i, r, o, s, 0, l, c)) return !1;
            }
            t = n;
          }
        }
        return !0;
      }
      case 2: {
        const d =
          !c ||
          !e.closingBracket ||
          e.closingBracket.bracketInfo.closesColorized(e.openingBracket.bracketInfo);
        let u = 0;
        if (l) {
          let t = l.get(e.openingBracket.text);
          (void 0 === t && (t = 0), (u = t), d && (t++, l.set(e.openingBracket.text, t)));
        }
        const h = e.childrenLength;
        for (let g = 0; g < h; g++) {
          const h = e.getChild(g);
          if (h) {
            if (((n = a6(t, h.length)), h6(t, r) && g6(n, i))) {
              if (g6(n, r) && 1 !== h.kind) {
                ((e = h), d ? (s++, (a = u + 1)) : (a = u));
                continue e;
              }
              if (d || 1 !== h.kind || !e.closingBracket) {
                if (!t8(h, t, n, i, r, o, d ? s + 1 : s, d ? u + 1 : u, l, c, !e.closingBracket))
                  return !1;
              }
            }
            t = n;
          }
        }
        return (l?.set(e.openingBracket.text, u), !0);
      }
      case 3: {
        const e = f6(t, n);
        return o(new J3(e, s - 1, 0, !0));
      }
      case 1: {
        const e = f6(t, n);
        return o(new J3(e, s - 1, a - 1, d));
      }
      case 0:
        return !0;
    }
}
class n8 {
  constructor(e, t, n) {
    ((this.push = e), (this.includeMinIndentation = t), (this.textModel = n));
  }
}
function i8(e, t, n, i, r, o, s, a) {
  if (s > 200) return !0;
  let l = !0;
  if (2 === e.kind) {
    let c = 0;
    if (a) {
      let t = a.get(e.openingBracket.text);
      (void 0 === t && (t = 0), (c = t), t++, a.set(e.openingBracket.text, t));
    }
    const d = a6(t, e.openingBracket.length);
    let u = -1;
    if (
      (o.includeMinIndentation && (u = e.computeMinIndentation(t, o.textModel)),
      (l = o.push(
        new t6(
          f6(t, n),
          f6(t, d),
          e.closingBracket ? f6(a6(d, e.child?.length || 0), n) : void 0,
          s,
          c,
          e,
          u,
        ),
      )),
      (t = d),
      l && e.child)
    ) {
      const c = e.child;
      if (
        ((n = a6(t, c.length)), h6(t, r) && g6(n, i) && ((l = i8(c, t, n, i, r, o, s + 1, a)), !l))
      )
        return !1;
    }
    a?.set(e.openingBracket.text, c);
  } else {
    let n = t;
    for (const t of e.children) {
      const e = n;
      if (((n = a6(n, t.length)), h6(e, r) && h6(i, n) && ((l = i8(t, e, n, i, r, o, s, a)), !l)))
        return !1;
    }
  }
  return l;
}
class r8 extends PO {
  get canBuildAST() {
    return this.textModel.getValueLength() <= 5e6;
  }
  constructor(e, t) {
    (super(),
      (this.textModel = e),
      (this.languageConfigurationService = t),
      (this.bracketPairsTree = this._register(new jO())),
      (this.onDidChangeEmitter = new QO()),
      (this.onDidChange = this.onDidChangeEmitter.event),
      (this.bracketsRequested = !1));
  }
  handleLanguageConfigurationServiceChange(e) {
    (e.languageId && !this.bracketPairsTree.value?.object.didLanguageChange(e.languageId)) ||
      (this.bracketPairsTree.clear(), this.updateBracketPairsTree());
  }
  handleDidChangeOptions(e) {
    (this.bracketPairsTree.clear(), this.updateBracketPairsTree());
  }
  handleDidChangeLanguage(e) {
    (this.bracketPairsTree.clear(), this.updateBracketPairsTree());
  }
  handleDidChangeContent(e) {
    this.bracketPairsTree.value?.object.handleContentChanged(e);
  }
  handleDidChangeBackgroundTokenizationState() {
    this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState();
  }
  handleDidChangeTokens(e) {
    this.bracketPairsTree.value?.object.handleDidChangeTokens(e);
  }
  updateBracketPairsTree() {
    if (this.bracketsRequested && this.canBuildAST) {
      if (!this.bracketPairsTree.value) {
        const e = new AO();
        ((this.bracketPairsTree.value = (function (e, t) {
          return { object: e, dispose: () => t?.dispose() };
        })(
          e.add(
            new Q6(this.textModel, (e) =>
              this.languageConfigurationService.getLanguageConfiguration(e),
            ),
          ),
          e,
        )),
          e.add(
            this.bracketPairsTree.value.object.onDidChange((e) => this.onDidChangeEmitter.fire(e)),
          ),
          this.onDidChangeEmitter.fire());
      }
    } else
      this.bracketPairsTree.value &&
        (this.bracketPairsTree.clear(), this.onDidChangeEmitter.fire());
  }
  getBracketPairsInRange(e) {
    return (
      (this.bracketsRequested = !0),
      this.updateBracketPairsTree(),
      this.bracketPairsTree.value?.object.getBracketPairsInRange(e, !1) || Sj.empty
    );
  }
  getBracketPairsInRangeWithMinIndentation(e) {
    return (
      (this.bracketsRequested = !0),
      this.updateBracketPairsTree(),
      this.bracketPairsTree.value?.object.getBracketPairsInRange(e, !0) || Sj.empty
    );
  }
  getBracketsInRange(e, t = !1) {
    return (
      (this.bracketsRequested = !0),
      this.updateBracketPairsTree(),
      this.bracketPairsTree.value?.object.getBracketsInRange(e, t) || Sj.empty
    );
  }
  findMatchingBracketUp(e, t, n) {
    const i = this.textModel.validatePosition(t),
      r = this.textModel.getLanguageIdAtPosition(i.lineNumber, i.column);
    if (this.canBuildAST) {
      const n = this.languageConfigurationService
        .getLanguageConfiguration(r)
        .bracketsNew.getClosingBracketInfo(e);
      if (!n) return null;
      const i = this.getBracketPairsInRange(YH.fromPositions(t, t)).findLast((e) =>
        n.closes(e.openingBracketInfo),
      );
      return i ? i.openingBracketRange : null;
    }
    {
      const t = e.toLowerCase(),
        o = this.languageConfigurationService.getLanguageConfiguration(r).brackets;
      if (!o) return null;
      const s = o.textIsBracket[t];
      return s ? a8(this._findMatchingBracketUp(s, i, o8(n))) : null;
    }
  }
  matchBracket(e, t) {
    if (this.canBuildAST) {
      const t = this.getBracketPairsInRange(YH.fromPositions(e, e))
        .filter(
          (t) =>
            void 0 !== t.closingBracketRange &&
            (t.openingBracketRange.containsPosition(e) ||
              t.closingBracketRange.containsPosition(e)),
        )
        .findLastMaxBy(
          bj(
            (t) =>
              t.openingBracketRange.containsPosition(e)
                ? t.openingBracketRange
                : t.closingBracketRange,
            YH.compareRangesUsingStarts,
          ),
        );
      return t ? [t.openingBracketRange, t.closingBracketRange] : null;
    }
    {
      const n = o8(t);
      return this._matchBracket(this.textModel.validatePosition(e), n);
    }
  }
  _establishBracketSearchOffsets(e, t, n, i) {
    const r = t.getCount(),
      o = t.getLanguageId(i);
    let s = Math.max(0, e.column - 1 - n.maxBracketLength);
    for (let l = i - 1; l >= 0; l--) {
      const e = t.getEndOffset(l);
      if (e <= s) break;
      if (ez(t.getStandardTokenType(l)) || t.getLanguageId(l) !== o) {
        s = e;
        break;
      }
    }
    let a = Math.min(t.getLineContent().length, e.column - 1 + n.maxBracketLength);
    for (let l = i + 1; l < r; l++) {
      const e = t.getStartOffset(l);
      if (e >= a) break;
      if (ez(t.getStandardTokenType(l)) || t.getLanguageId(l) !== o) {
        a = e;
        break;
      }
    }
    return { searchStartOffset: s, searchEndOffset: a };
  }
  _matchBracket(e, t) {
    const n = e.lineNumber,
      i = this.textModel.tokenization.getLineTokens(n),
      r = this.textModel.getLineContent(n),
      o = i.findTokenIndexAtOffset(e.column - 1);
    if (o < 0) return null;
    const s = this.languageConfigurationService.getLanguageConfiguration(
      i.getLanguageId(o),
    ).brackets;
    if (s && !ez(i.getStandardTokenType(o))) {
      let { searchStartOffset: a, searchEndOffset: l } = this._establishBracketSearchOffsets(
          e,
          i,
          s,
          o,
        ),
        c = null;
      for (;;) {
        const i = LU.findNextBracketInRange(s.forwardRegex, n, r, a, l);
        if (!i) break;
        if (i.startColumn <= e.column && e.column <= i.endColumn) {
          const e = r.substring(i.startColumn - 1, i.endColumn - 1).toLowerCase(),
            n = this._matchFoundBracket(i, s.textIsBracket[e], s.textIsOpenBracket[e], t);
          if (n) {
            if (n instanceof s8) return null;
            c = n;
          }
        }
        a = i.endColumn - 1;
      }
      if (c) return c;
    }
    if (o > 0 && i.getStartOffset(o) === e.column - 1) {
      const s = o - 1,
        a = this.languageConfigurationService.getLanguageConfiguration(i.getLanguageId(s)).brackets;
      if (a && !ez(i.getStandardTokenType(s))) {
        const { searchStartOffset: o, searchEndOffset: l } = this._establishBracketSearchOffsets(
            e,
            i,
            a,
            s,
          ),
          c = LU.findPrevBracketInRange(a.reversedRegex, n, r, o, l);
        if (c && c.startColumn <= e.column && e.column <= c.endColumn) {
          const e = r.substring(c.startColumn - 1, c.endColumn - 1).toLowerCase(),
            n = this._matchFoundBracket(c, a.textIsBracket[e], a.textIsOpenBracket[e], t);
          if (n) return n instanceof s8 ? null : n;
        }
      }
    }
    return null;
  }
  _matchFoundBracket(e, t, n, i) {
    if (!t) return null;
    const r = n
      ? this._findMatchingBracketDown(t, e.getEndPosition(), i)
      : this._findMatchingBracketUp(t, e.getStartPosition(), i);
    return r ? (r instanceof s8 ? r : [e, r]) : null;
  }
  _findMatchingBracketUp(e, t, n) {
    const i = e.languageId,
      r = e.reversedRegex;
    let o = -1,
      s = 0;
    const a = (t, i, a, l) => {
      for (;;) {
        if (n && ++s % 100 == 0 && !n()) return s8.INSTANCE;
        const c = LU.findPrevBracketInRange(r, t, i, a, l);
        if (!c) break;
        const d = i.substring(c.startColumn - 1, c.endColumn - 1).toLowerCase();
        if ((e.isOpen(d) ? o++ : e.isClose(d) && o--, 0 === o)) return c;
        l = c.startColumn - 1;
      }
      return null;
    };
    for (let l = t.lineNumber; l >= 1; l--) {
      const e = this.textModel.tokenization.getLineTokens(l),
        n = e.getCount(),
        r = this.textModel.getLineContent(l);
      let o = n - 1,
        s = r.length,
        c = r.length;
      l === t.lineNumber &&
        ((o = e.findTokenIndexAtOffset(t.column - 1)), (s = t.column - 1), (c = t.column - 1));
      let d = !0;
      for (; o >= 0; o--) {
        const t = e.getLanguageId(o) === i && !ez(e.getStandardTokenType(o));
        if (t) d ? (s = e.getStartOffset(o)) : ((s = e.getStartOffset(o)), (c = e.getEndOffset(o)));
        else if (d && s !== c) {
          const e = a(l, r, s, c);
          if (e) return e;
        }
        d = t;
      }
      if (d && s !== c) {
        const e = a(l, r, s, c);
        if (e) return e;
      }
    }
    return null;
  }
  _findMatchingBracketDown(e, t, n) {
    const i = e.languageId,
      r = e.forwardRegex;
    let o = 1,
      s = 0;
    const a = (t, i, a, l) => {
        for (;;) {
          if (n && ++s % 100 == 0 && !n()) return s8.INSTANCE;
          const c = LU.findNextBracketInRange(r, t, i, a, l);
          if (!c) break;
          const d = i.substring(c.startColumn - 1, c.endColumn - 1).toLowerCase();
          if ((e.isOpen(d) ? o++ : e.isClose(d) && o--, 0 === o)) return c;
          a = c.endColumn - 1;
        }
        return null;
      },
      l = this.textModel.getLineCount();
    for (let c = t.lineNumber; c <= l; c++) {
      const e = this.textModel.tokenization.getLineTokens(c),
        n = e.getCount(),
        r = this.textModel.getLineContent(c);
      let o = 0,
        s = 0,
        l = 0;
      c === t.lineNumber &&
        ((o = e.findTokenIndexAtOffset(t.column - 1)), (s = t.column - 1), (l = t.column - 1));
      let d = !0;
      for (; o < n; o++) {
        const t = e.getLanguageId(o) === i && !ez(e.getStandardTokenType(o));
        if (t) (d || (s = e.getStartOffset(o)), (l = e.getEndOffset(o)));
        else if (d && s !== l) {
          const e = a(c, r, s, l);
          if (e) return e;
        }
        d = t;
      }
      if (d && s !== l) {
        const e = a(c, r, s, l);
        if (e) return e;
      }
    }
    return null;
  }
  findPrevBracket(e) {
    const t = this.textModel.validatePosition(e);
    if (this.canBuildAST)
      return (
        (this.bracketsRequested = !0),
        this.updateBracketPairsTree(),
        this.bracketPairsTree.value?.object.getFirstBracketBefore(t) || null
      );
    let n = null,
      i = null,
      r = null;
    for (let o = t.lineNumber; o >= 1; o--) {
      const e = this.textModel.tokenization.getLineTokens(o),
        s = e.getCount(),
        a = this.textModel.getLineContent(o);
      let l = s - 1,
        c = a.length,
        d = a.length;
      if (o === t.lineNumber) {
        ((l = e.findTokenIndexAtOffset(t.column - 1)), (c = t.column - 1), (d = t.column - 1));
        const o = e.getLanguageId(l);
        n !== o &&
          ((n = o),
          (i = this.languageConfigurationService.getLanguageConfiguration(n).brackets),
          (r = this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew));
      }
      let u = !0;
      for (; l >= 0; l--) {
        const t = e.getLanguageId(l);
        if (n !== t) {
          if (i && r && u && c !== d) {
            const e = LU.findPrevBracketInRange(i.reversedRegex, o, a, c, d);
            if (e) return this._toFoundBracket(r, e);
            u = !1;
          }
          ((n = t),
            (i = this.languageConfigurationService.getLanguageConfiguration(n).brackets),
            (r = this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew));
        }
        const s = !!i && !ez(e.getStandardTokenType(l));
        if (s) u ? (c = e.getStartOffset(l)) : ((c = e.getStartOffset(l)), (d = e.getEndOffset(l)));
        else if (r && i && u && c !== d) {
          const e = LU.findPrevBracketInRange(i.reversedRegex, o, a, c, d);
          if (e) return this._toFoundBracket(r, e);
        }
        u = s;
      }
      if (r && i && u && c !== d) {
        const e = LU.findPrevBracketInRange(i.reversedRegex, o, a, c, d);
        if (e) return this._toFoundBracket(r, e);
      }
    }
    return null;
  }
  findNextBracket(e) {
    const t = this.textModel.validatePosition(e);
    if (this.canBuildAST)
      return (
        (this.bracketsRequested = !0),
        this.updateBracketPairsTree(),
        this.bracketPairsTree.value?.object.getFirstBracketAfter(t) || null
      );
    const n = this.textModel.getLineCount();
    let i = null,
      r = null,
      o = null;
    for (let s = t.lineNumber; s <= n; s++) {
      const e = this.textModel.tokenization.getLineTokens(s),
        n = e.getCount(),
        a = this.textModel.getLineContent(s);
      let l = 0,
        c = 0,
        d = 0;
      if (s === t.lineNumber) {
        ((l = e.findTokenIndexAtOffset(t.column - 1)), (c = t.column - 1), (d = t.column - 1));
        const n = e.getLanguageId(l);
        i !== n &&
          ((i = n),
          (r = this.languageConfigurationService.getLanguageConfiguration(i).brackets),
          (o = this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew));
      }
      let u = !0;
      for (; l < n; l++) {
        const t = e.getLanguageId(l);
        if (i !== t) {
          if (o && r && u && c !== d) {
            const e = LU.findNextBracketInRange(r.forwardRegex, s, a, c, d);
            if (e) return this._toFoundBracket(o, e);
            u = !1;
          }
          ((i = t),
            (r = this.languageConfigurationService.getLanguageConfiguration(i).brackets),
            (o = this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew));
        }
        const n = !!r && !ez(e.getStandardTokenType(l));
        if (n) (u || (c = e.getStartOffset(l)), (d = e.getEndOffset(l)));
        else if (o && r && u && c !== d) {
          const e = LU.findNextBracketInRange(r.forwardRegex, s, a, c, d);
          if (e) return this._toFoundBracket(o, e);
        }
        u = n;
      }
      if (o && r && u && c !== d) {
        const e = LU.findNextBracketInRange(r.forwardRegex, s, a, c, d);
        if (e) return this._toFoundBracket(o, e);
      }
    }
    return null;
  }
  findEnclosingBrackets(e, t) {
    const n = this.textModel.validatePosition(e);
    if (this.canBuildAST) {
      const e = YH.fromPositions(n),
        t = this.getBracketPairsInRange(YH.fromPositions(n, n)).findLast(
          (t) => void 0 !== t.closingBracketRange && t.range.strictContainsRange(e),
        );
      return t ? [t.openingBracketRange, t.closingBracketRange] : null;
    }
    const i = o8(t),
      r = this.textModel.getLineCount(),
      o = new Map();
    let s = [];
    const a = (e, t) => {
      if (!o.has(e)) {
        const n = [];
        for (let e = 0, i = t ? t.brackets.length : 0; e < i; e++) n[e] = 0;
        o.set(e, n);
      }
      s = o.get(e);
    };
    let l = 0;
    const c = (e, t, n, r, o) => {
      for (;;) {
        if (i && ++l % 100 == 0 && !i()) return s8.INSTANCE;
        const a = LU.findNextBracketInRange(e.forwardRegex, t, n, r, o);
        if (!a) break;
        const c = n.substring(a.startColumn - 1, a.endColumn - 1).toLowerCase(),
          d = e.textIsBracket[c];
        if (d && (d.isOpen(c) ? s[d.index]++ : d.isClose(c) && s[d.index]--, -1 === s[d.index]))
          return this._matchFoundBracket(a, d, !1, i);
        r = a.endColumn - 1;
      }
      return null;
    };
    let d = null,
      u = null;
    for (let h = n.lineNumber; h <= r; h++) {
      const e = this.textModel.tokenization.getLineTokens(h),
        t = e.getCount(),
        i = this.textModel.getLineContent(h);
      let r = 0,
        o = 0,
        s = 0;
      if (h === n.lineNumber) {
        ((r = e.findTokenIndexAtOffset(n.column - 1)), (o = n.column - 1), (s = n.column - 1));
        const t = e.getLanguageId(r);
        d !== t &&
          ((d = t),
          (u = this.languageConfigurationService.getLanguageConfiguration(d).brackets),
          a(d, u));
      }
      let l = !0;
      for (; r < t; r++) {
        const t = e.getLanguageId(r);
        if (d !== t) {
          if (u && l && o !== s) {
            const e = c(u, h, i, o, s);
            if (e) return a8(e);
            l = !1;
          }
          ((d = t),
            (u = this.languageConfigurationService.getLanguageConfiguration(d).brackets),
            a(d, u));
        }
        const n = !!u && !ez(e.getStandardTokenType(r));
        if (n) (l || (o = e.getStartOffset(r)), (s = e.getEndOffset(r)));
        else if (u && l && o !== s) {
          const e = c(u, h, i, o, s);
          if (e) return a8(e);
        }
        l = n;
      }
      if (u && l && o !== s) {
        const e = c(u, h, i, o, s);
        if (e) return a8(e);
      }
    }
    return null;
  }
  _toFoundBracket(e, t) {
    if (!t) return null;
    let n = this.textModel.getValueInRange(t);
    n = n.toLowerCase();
    const i = e.getBracketInfo(n);
    return i ? { range: t, bracketInfo: i } : null;
  }
}
function o8(e) {
  if (void 0 === e) return () => !0;
  {
    const t = Date.now();
    return () => Date.now() - t <= e;
  }
}
class s8 {
  static {
    this.INSTANCE = new s8();
  }
  constructor() {
    this._searchCanceledBrand = void 0;
  }
}
function a8(e) {
  return e instanceof s8 ? null : e;
}
class l8 extends PO {
  constructor(e) {
    (super(),
      (this.textModel = e),
      (this.colorProvider = new c8()),
      (this.onDidChangeEmitter = new QO()),
      (this.onDidChange = this.onDidChangeEmitter.event),
      (this.colorizationOptions = e.getOptions().bracketPairColorizationOptions),
      this._register(
        e.bracketPairs.onDidChange((e) => {
          this.onDidChangeEmitter.fire();
        }),
      ));
  }
  handleDidChangeOptions(e) {
    this.colorizationOptions = this.textModel.getOptions().bracketPairColorizationOptions;
  }
  getDecorationsInRange(e, t, n, i) {
    if (i) return [];
    if (void 0 === t) return [];
    if (!this.colorizationOptions.enabled) return [];
    return this.textModel.bracketPairs
      .getBracketsInRange(e, !0)
      .map((e) => ({
        id: `bracket${e.range.toString()}-${e.nestingLevel}`,
        options: {
          description: "BracketPairColorization",
          inlineClassName: this.colorProvider.getInlineClassName(
            e,
            this.colorizationOptions.independentColorPoolPerBracketType,
          ),
        },
        ownerId: 0,
        range: e.range,
      }))
      .toArray();
  }
  getAllDecorations(e, t) {
    return void 0 === e
      ? []
      : this.colorizationOptions.enabled
        ? this.getDecorationsInRange(new YH(1, 1, this.textModel.getLineCount(), 1), e, t)
        : [];
  }
}
class c8 {
  constructor() {
    this.unexpectedClosingBracketClassName = "unexpected-closing-bracket";
  }
  getInlineClassName(e, t) {
    return e.isInvalid
      ? this.unexpectedClosingBracketClassName
      : this.getInlineClassNameOfLevel(t ? e.nestingLevelOfEqualBracketType : e.nestingLevel);
  }
  getInlineClassNameOfLevel(e) {
    return "bracket-highlighting-" + (e % 30);
  }
}
function d8(e) {
  return e.replace(/\n/g, "\\n").replace(/\r/g, "\\r");
}
_0((e, t) => {
  const n = [e1, t1, n1, i1, r1, o1],
    i = new c8();
  t.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${e.getColor(s1)}; }`);
  const r = n
    .map((t) => e.getColor(t))
    .filter((e) => !!e)
    .filter((e) => !e.isTransparent());
  for (let o = 0; o < 30; o++) {
    const e = r[o % r.length];
    t.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${e}; }`);
  }
});
class u8 {
  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(e, t, n, i) {
    ((this.oldPosition = e), (this.oldText = t), (this.newPosition = n), (this.newText = i));
  }
  toString() {
    return 0 === this.oldText.length
      ? `(insert@${this.oldPosition} "${d8(this.newText)}")`
      : 0 === this.newText.length
        ? `(delete@${this.oldPosition} "${d8(this.oldText)}")`
        : `(replace@${this.oldPosition} "${d8(this.oldText)}" with "${d8(this.newText)}")`;
  }
  static _writeStringSize(e) {
    return 4 + 2 * e.length;
  }
  static _writeString(e, t, n) {
    const i = t.length;
    (VP(e, i, n), (n += 4));
    for (let r = 0; r < i; r++) (FP(e, t.charCodeAt(r), n), (n += 2));
    return n;
  }
  static _readString(e, t) {
    const n = BP(e, t);
    return vU(e, (t += 4), n);
  }
  writeSize() {
    return 8 + u8._writeStringSize(this.oldText) + u8._writeStringSize(this.newText);
  }
  write(e, t) {
    return (
      VP(e, this.oldPosition, t),
      (t += 4),
      VP(e, this.newPosition, t),
      (t += 4),
      (t = u8._writeString(e, this.oldText, t)),
      (t = u8._writeString(e, this.newText, t))
    );
  }
  static read(e, t, n) {
    const i = BP(e, t),
      r = BP(e, (t += 4));
    t += 4;
    const o = u8._readString(e, t);
    t += u8._writeStringSize(o);
    const s = u8._readString(e, t);
    return ((t += u8._writeStringSize(s)), n.push(new u8(i, o, r, s)), t);
  }
}
class h8 {
  constructor(e, t) {
    ((this._prevEdits = e),
      (this._currEdits = t),
      (this._result = []),
      (this._resultLen = 0),
      (this._prevLen = this._prevEdits.length),
      (this._prevDeltaOffset = 0),
      (this._currLen = this._currEdits.length),
      (this._currDeltaOffset = 0));
  }
  compress() {
    let e = 0,
      t = 0,
      n = this._getPrev(e),
      i = this._getCurr(t);
    for (; e < this._prevLen || t < this._currLen; ) {
      if (null === n) {
        (this._acceptCurr(i), (i = this._getCurr(++t)));
        continue;
      }
      if (null === i) {
        (this._acceptPrev(n), (n = this._getPrev(++e)));
        continue;
      }
      if (i.oldEnd <= n.newPosition) {
        (this._acceptCurr(i), (i = this._getCurr(++t)));
        continue;
      }
      if (n.newEnd <= i.oldPosition) {
        (this._acceptPrev(n), (n = this._getPrev(++e)));
        continue;
      }
      if (i.oldPosition < n.newPosition) {
        const [e, t] = h8._splitCurr(i, n.newPosition - i.oldPosition);
        (this._acceptCurr(e), (i = t));
        continue;
      }
      if (n.newPosition < i.oldPosition) {
        const [e, t] = h8._splitPrev(n, i.oldPosition - n.newPosition);
        (this._acceptPrev(e), (n = t));
        continue;
      }
      let r, o;
      if (i.oldEnd === n.newEnd)
        ((r = n), (o = i), (n = this._getPrev(++e)), (i = this._getCurr(++t)));
      else if (i.oldEnd < n.newEnd) {
        const [e, s] = h8._splitPrev(n, i.oldLength);
        ((r = e), (o = i), (n = s), (i = this._getCurr(++t)));
      } else {
        const [t, s] = h8._splitCurr(i, n.newLength);
        ((r = n), (o = t), (n = this._getPrev(++e)), (i = s));
      }
      ((this._result[this._resultLen++] = new u8(
        r.oldPosition,
        r.oldText,
        o.newPosition,
        o.newText,
      )),
        (this._prevDeltaOffset += r.newLength - r.oldLength),
        (this._currDeltaOffset += o.newLength - o.oldLength));
    }
    const r = h8._merge(this._result);
    return h8._removeNoOps(r);
  }
  _acceptCurr(e) {
    ((this._result[this._resultLen++] = h8._rebaseCurr(this._prevDeltaOffset, e)),
      (this._currDeltaOffset += e.newLength - e.oldLength));
  }
  _getCurr(e) {
    return e < this._currLen ? this._currEdits[e] : null;
  }
  _acceptPrev(e) {
    ((this._result[this._resultLen++] = h8._rebasePrev(this._currDeltaOffset, e)),
      (this._prevDeltaOffset += e.newLength - e.oldLength));
  }
  _getPrev(e) {
    return e < this._prevLen ? this._prevEdits[e] : null;
  }
  static _rebaseCurr(e, t) {
    return new u8(t.oldPosition - e, t.oldText, t.newPosition, t.newText);
  }
  static _rebasePrev(e, t) {
    return new u8(t.oldPosition, t.oldText, t.newPosition + e, t.newText);
  }
  static _splitPrev(e, t) {
    const n = e.newText.substr(0, t),
      i = e.newText.substr(t);
    return [
      new u8(e.oldPosition, e.oldText, e.newPosition, n),
      new u8(e.oldEnd, "", e.newPosition + t, i),
    ];
  }
  static _splitCurr(e, t) {
    const n = e.oldText.substr(0, t),
      i = e.oldText.substr(t);
    return [
      new u8(e.oldPosition, n, e.newPosition, e.newText),
      new u8(e.oldPosition + t, i, e.newEnd, ""),
    ];
  }
  static _merge(e) {
    if (0 === e.length) return e;
    const t = [];
    let n = 0,
      i = e[0];
    for (let r = 1; r < e.length; r++) {
      const o = e[r];
      i.oldEnd === o.oldPosition
        ? (i = new u8(i.oldPosition, i.oldText + o.oldText, i.newPosition, i.newText + o.newText))
        : ((t[n++] = i), (i = o));
    }
    return ((t[n++] = i), t);
  }
  static _removeNoOps(e) {
    if (0 === e.length) return e;
    const t = [];
    let n = 0;
    for (let i = 0; i < e.length; i++) {
      const r = e[i];
      r.oldText !== r.newText && (t[n++] = r);
    }
    return t;
  }
}
const g8 = Symbol("TextModelEditSource");
class p8 {
  constructor(e, t) {
    this.metadata = e;
  }
  toString() {
    return `${this.metadata.source}`;
  }
  getType() {
    const e = this.metadata;
    switch (e.source) {
      case "cursor":
        return e.kind;
      case "inlineCompletionAccept":
        return e.source + (e.$nes ? ":nes" : "");
      case "unknown":
        return e.name || "unknown";
      default:
        return e.source;
    }
  }
  toKey(e, t = {}) {
    const n = this.metadata;
    return Object.entries(n)
      .filter(([n, i]) => {
        const r = t[n];
        if (void 0 !== r) return r;
        return (n.match(/\$/g) || []).length <= e && null != i && "" !== i;
      })
      .map(([e, t]) => `${e}:${t}`)
      .join("-");
  }
}
function f8(e) {
  return new p8(e, g8);
}
const m8 = {
  unknown: (e) => f8({ source: "unknown", name: e.name }),
  rename: () => f8({ source: "rename" }),
  chatApplyEdits: (e) =>
    f8({
      source: "Chat.applyEdits",
      $modelId: v8(e.modelId),
      $extensionId: e.extensionId?.extensionId,
      $extensionVersion: e.extensionId?.version,
      $$languageId: e.languageId,
      $$sessionId: e.sessionId,
      $$requestId: e.requestId,
      $$mode: e.mode,
      $$codeBlockSuggestionId: e.codeBlockSuggestionId,
    }),
  chatUndoEdits: () => f8({ source: "Chat.undoEdits" }),
  chatReset: () => f8({ source: "Chat.reset" }),
  inlineCompletionAccept: (e) =>
    f8({
      source: "inlineCompletionAccept",
      $nes: e.nes,
      ..._8(e.providerId),
      $$requestUuid: e.requestUuid,
      $$languageId: e.languageId,
    }),
  inlineCompletionPartialAccept: (e) =>
    f8({
      source: "inlineCompletionPartialAccept",
      type: e.type,
      $nes: e.nes,
      ..._8(e.providerId),
      $$requestUuid: e.requestUuid,
      $$languageId: e.languageId,
    }),
  inlineChatApplyEdit: (e) =>
    f8({
      source: "inlineChat.applyEdits",
      $modelId: v8(e.modelId),
      $extensionId: e.extensionId?.extensionId,
      $extensionVersion: e.extensionId?.version,
      $$sessionId: e.sessionId,
      $$requestId: e.requestId,
      $$languageId: e.languageId,
    }),
  reloadFromDisk: () => f8({ source: "reloadFromDisk" }),
  cursor: (e) => f8({ source: "cursor", kind: e.kind, detailedSource: e.detailedSource }),
  setValue: () => f8({ source: "setValue" }),
  eolChange: () => f8({ source: "eolChange" }),
  applyEdits: () => f8({ source: "applyEdits" }),
  snippet: () => f8({ source: "snippet" }),
  suggest: (e) => f8({ source: "suggest", ..._8(e.providerId) }),
  codeAction: (e) => f8({ source: "codeAction", $kind: e.kind, ..._8(e.providerId) }),
};
function _8(e) {
  return e
    ? {
        $extensionId: e.extensionId,
        $extensionVersion: e.extensionVersion,
        $providerId: e.providerId,
      }
    : {};
}
function v8(e) {
  if (void 0 !== e) return e.replaceAll("/", "|");
}
class b8 {
  static fromText(e) {
    const t = e3.ofText(e).lineCount,
      n = e.length;
    return new b8(t, 0, n, 0);
  }
  static tryCreate(e, t, n, i) {
    if (void 0 !== e && void 0 !== t && void 0 !== n && void 0 !== i) return new b8(e, t, n, i);
  }
  constructor(e, t, n, i) {
    ((this.linesAdded = e),
      (this.linesRemoved = t),
      (this.charsAdded = n),
      (this.charsRemoved = i));
  }
}
var y8;
function x8(e) {
  return e.toString();
}
!(function (e) {
  e.newId = function (e) {
    return e ? e("sgt") : BJ("sgt");
  };
})(y8 || (y8 = {}));
class w8 {
  static create(e, t) {
    const n = e.getAlternativeVersionId(),
      i = k8(e);
    return new w8(n, n, i, i, t, t, []);
  }
  constructor(e, t, n, i, r, o, s) {
    ((this.beforeVersionId = e),
      (this.afterVersionId = t),
      (this.beforeEOL = n),
      (this.afterEOL = i),
      (this.beforeCursorState = r),
      (this.afterCursorState = o),
      (this.changes = s));
  }
  append(e, t, n, i, r) {
    var o, s;
    (t.length > 0 &&
      (this.changes =
        ((o = this.changes), (s = t), null === o || 0 === o.length ? s : new h8(o, s).compress())),
      (this.afterEOL = n),
      (this.afterVersionId = i),
      (this.afterCursorState = r));
  }
  static _writeSelectionsSize(e) {
    return 4 + 16 * (e ? e.length : 0);
  }
  static _writeSelections(e, t, n) {
    if ((VP(e, t ? t.length : 0, n), (n += 4), t))
      for (const i of t)
        (VP(e, i.selectionStartLineNumber, n),
          (n += 4),
          VP(e, i.selectionStartColumn, n),
          (n += 4),
          VP(e, i.positionLineNumber, n),
          (n += 4),
          VP(e, i.positionColumn, n),
          (n += 4));
    return n;
  }
  static _readSelections(e, t, n) {
    const i = BP(e, t);
    t += 4;
    for (let r = 0; r < i; r++) {
      const i = BP(e, t),
        r = BP(e, (t += 4)),
        o = BP(e, (t += 4)),
        s = BP(e, (t += 4));
      ((t += 4), n.push(new XH(i, r, o, s)));
    }
    return t;
  }
  serialize() {
    let e =
      10 +
      w8._writeSelectionsSize(this.beforeCursorState) +
      w8._writeSelectionsSize(this.afterCursorState) +
      4;
    for (const i of this.changes) e += i.writeSize();
    const t = new Uint8Array(e);
    let n = 0;
    (VP(t, this.beforeVersionId, n),
      (n += 4),
      VP(t, this.afterVersionId, n),
      (n += 4),
      HP(t, this.beforeEOL, n),
      (n += 1),
      HP(t, this.afterEOL, n),
      (n += 1),
      (n = w8._writeSelections(t, this.beforeCursorState, n)),
      (n = w8._writeSelections(t, this.afterCursorState, n)),
      VP(t, this.changes.length, n),
      (n += 4));
    for (const i of this.changes) n = i.write(t, n);
    return t.buffer;
  }
  static deserialize(e) {
    const t = new Uint8Array(e);
    let n = 0;
    const i = BP(t, n);
    n += 4;
    const r = BP(t, n);
    n += 4;
    const o = WP(t, n);
    n += 1;
    const s = WP(t, n);
    n += 1;
    const a = [];
    n = w8._readSelections(t, n, a);
    const l = [];
    n = w8._readSelections(t, n, l);
    const c = BP(t, n);
    n += 4;
    const d = [];
    for (let u = 0; u < c; u++) n = u8.read(t, n, d);
    return new w8(i, r, o, s, a, l, d);
  }
}
class C8 {
  get type() {
    return 0;
  }
  get resource() {
    return mP.isUri(this.model) ? this.model : this.model.uri;
  }
  constructor(e, t, n, i) {
    ((this.label = e), (this.code = t), (this.model = n), (this._data = w8.create(n, i)));
  }
  toString() {
    return (this._data instanceof w8 ? this._data : w8.deserialize(this._data)).changes
      .map((e) => e.toString())
      .join(", ");
  }
  matchesResource(e) {
    return (mP.isUri(this.model) ? this.model : this.model.uri).toString() === e.toString();
  }
  setModel(e) {
    this.model = e;
  }
  canAppend(e) {
    return this.model === e && this._data instanceof w8;
  }
  append(e, t, n, i, r) {
    this._data instanceof w8 && this._data.append(e, t, n, i, r);
  }
  close() {
    this._data instanceof w8 && (this._data = this._data.serialize());
  }
  open() {
    this._data instanceof w8 || (this._data = w8.deserialize(this._data));
  }
  undo() {
    if (mP.isUri(this.model)) throw new Error("Invalid SingleModelEditStackElement");
    this._data instanceof w8 && (this._data = this._data.serialize());
    const e = w8.deserialize(this._data);
    this.model._applyUndo(e.changes, e.beforeEOL, e.beforeVersionId, e.beforeCursorState);
  }
  redo() {
    if (mP.isUri(this.model)) throw new Error("Invalid SingleModelEditStackElement");
    this._data instanceof w8 && (this._data = this._data.serialize());
    const e = w8.deserialize(this._data);
    this.model._applyRedo(e.changes, e.afterEOL, e.afterVersionId, e.afterCursorState);
  }
  heapSize() {
    return (
      this._data instanceof w8 && (this._data = this._data.serialize()),
      this._data.byteLength + 168
    );
  }
}
class S8 {
  get resources() {
    return this._editStackElementsArr.map((e) => e.resource);
  }
  constructor(e, t, n) {
    ((this.label = e),
      (this.code = t),
      (this.type = 1),
      (this._isOpen = !0),
      (this._editStackElementsArr = n.slice(0)),
      (this._editStackElementsMap = new Map()));
    for (const i of this._editStackElementsArr) {
      const e = x8(i.resource);
      this._editStackElementsMap.set(e, i);
    }
    this._delegate = null;
  }
  prepareUndoRedo() {
    if (this._delegate) return this._delegate.prepareUndoRedo(this);
  }
  matchesResource(e) {
    const t = x8(e);
    return this._editStackElementsMap.has(t);
  }
  setModel(e) {
    const t = x8(mP.isUri(e) ? e : e.uri);
    this._editStackElementsMap.has(t) && this._editStackElementsMap.get(t).setModel(e);
  }
  canAppend(e) {
    if (!this._isOpen) return !1;
    const t = x8(e.uri);
    if (this._editStackElementsMap.has(t)) {
      return this._editStackElementsMap.get(t).canAppend(e);
    }
    return !1;
  }
  append(e, t, n, i, r) {
    const o = x8(e.uri);
    this._editStackElementsMap.get(o).append(e, t, n, i, r);
  }
  close() {
    this._isOpen = !1;
  }
  open() {}
  undo() {
    this._isOpen = !1;
    for (const e of this._editStackElementsArr) e.undo();
  }
  redo() {
    for (const e of this._editStackElementsArr) e.redo();
  }
  heapSize(e) {
    const t = x8(e);
    if (this._editStackElementsMap.has(t)) {
      return this._editStackElementsMap.get(t).heapSize();
    }
    return 0;
  }
  split() {
    return this._editStackElementsArr;
  }
  toString() {
    const e = [];
    for (const t of this._editStackElementsArr) e.push(`${dH(t.resource)}: ${t}`);
    return `{${e.join(", ")}}`;
  }
}
function k8(e) {
  return "\n" === e.getEOL() ? 0 : 1;
}
function E8(e) {
  return !!e && (e instanceof C8 || e instanceof S8);
}
class N8 {
  constructor(e, t) {
    ((this._model = e), (this._undoRedoService = t));
  }
  pushStackElement() {
    const e = this._undoRedoService.getLastElement(this._model.uri);
    E8(e) && e.close();
  }
  popStackElement() {
    const e = this._undoRedoService.getLastElement(this._model.uri);
    E8(e) && e.open();
  }
  clear() {
    this._undoRedoService.removeElements(this._model.uri);
  }
  _getOrCreateEditStackElement(e, t) {
    const n = this._undoRedoService.getLastElement(this._model.uri);
    if (E8(n) && n.canAppend(this._model)) return n;
    const i = new C8(SI(785, "Typing"), "undoredo.textBufferEdit", this._model, e);
    return (this._undoRedoService.pushElement(i, t), i);
  }
  pushEOL(e) {
    const t = this._getOrCreateEditStackElement(null, void 0);
    (this._model.setEOL(e),
      t.append(this._model, [], k8(this._model), this._model.getAlternativeVersionId(), null));
  }
  pushEditOperation(e, t, n, i, r = m8.unknown({ name: "pushEditOperation" })) {
    const o = this._getOrCreateEditStackElement(e, i),
      s = this._model.applyEdits(t, !0, r),
      a = N8._computeCursorState(n, s),
      l = s.map((e, t) => ({ index: t, textChange: e.textChange }));
    return (
      l.sort((e, t) =>
        e.textChange.oldPosition === t.textChange.oldPosition
          ? e.index - t.index
          : e.textChange.oldPosition - t.textChange.oldPosition,
      ),
      o.append(
        this._model,
        l.map((e) => e.textChange),
        k8(this._model),
        this._model.getAlternativeVersionId(),
        a,
      ),
      a
    );
  }
  static _computeCursorState(e, t) {
    try {
      return e ? e(t) : null;
    } catch (spt) {
      return (HI(spt), null);
    }
  }
}
class L8 {
  constructor() {
    ((this.spacesDiff = 0), (this.looksLikeAlignment = !1));
  }
}
function D8(e, t, n, i, r) {
  let o;
  for (r.spacesDiff = 0, r.looksLikeAlignment = !1, o = 0; o < t && o < i; o++) {
    if (e.charCodeAt(o) !== n.charCodeAt(o)) break;
  }
  let s = 0,
    a = 0;
  for (let h = o; h < t; h++) {
    32 === e.charCodeAt(h) ? s++ : a++;
  }
  let l = 0,
    c = 0;
  for (let h = o; h < i; h++) {
    32 === n.charCodeAt(h) ? l++ : c++;
  }
  if (s > 0 && a > 0) return;
  if (l > 0 && c > 0) return;
  const d = Math.abs(a - c),
    u = Math.abs(s - l);
  if (0 === d)
    return (
      (r.spacesDiff = u),
      void (
        u > 0 &&
        0 <= l - 1 &&
        l - 1 < e.length &&
        l < n.length &&
        32 !== n.charCodeAt(l) &&
        32 === e.charCodeAt(l - 1) &&
        44 === e.charCodeAt(e.length - 1) &&
        (r.looksLikeAlignment = !0)
      )
    );
  u % d !== 0 || (r.spacesDiff = u / d);
}
function T8(e, t, n) {
  const i = Math.min(e.getLineCount(), 1e4);
  let r = 0,
    o = 0,
    s = "",
    a = 0;
  const l = [2, 4, 6, 8, 3, 5, 7],
    c = [0, 0, 0, 0, 0, 0, 0, 0, 0],
    d = new L8();
  for (let g = 1; g <= i; g++) {
    const i = e.getLineLength(g),
      l = e.getLineContent(g),
      u = i <= 65536;
    let h = !1,
      p = 0,
      f = 0,
      m = 0;
    for (let t = 0, n = i; t < n; t++) {
      const n = u ? l.charCodeAt(t) : e.getLineCharCode(g, t);
      if (9 === n) m++;
      else {
        if (32 !== n) {
          ((h = !0), (p = t));
          break;
        }
        f++;
      }
    }
    if (!h) continue;
    if (
      (m > 0 ? r++ : f > 1 && o++,
      D8(s, a, l, p, d),
      d.looksLikeAlignment && (!n || t !== d.spacesDiff))
    )
      continue;
    const _ = d.spacesDiff;
    (_ <= 8 && c[_]++, (s = l), (a = p));
  }
  let u = n;
  r !== o && (u = r < o);
  let h = t;
  if (u) {
    let e = u ? 0 : 0.1 * i;
    (l.forEach((t) => {
      const n = c[t];
      n > e && ((e = n), (h = t));
    }),
      4 === h && c[4] > 0 && c[2] > 0 && c[2] >= c[4] / 2 && (h = 2));
  }
  return { insertSpaces: u, tabSize: h };
}
function I8(e) {
  return (1 & e.metadata) >>> 0;
}
function R8(e, t) {
  e.metadata = (254 & e.metadata) | t;
}
function O8(e) {
  return (2 & e.metadata) >>> 1 == 1;
}
function M8(e, t) {
  e.metadata = (253 & e.metadata) | ((t ? 1 : 0) << 1);
}
function A8(e) {
  return (4 & e.metadata) >>> 2 == 1;
}
function P8(e, t) {
  e.metadata = (251 & e.metadata) | ((t ? 1 : 0) << 2);
}
function j8(e) {
  return (64 & e.metadata) >>> 6 == 1;
}
function F8(e, t) {
  e.metadata = (191 & e.metadata) | ((t ? 1 : 0) << 6);
}
function B8(e) {
  return (128 & e.metadata) >>> 7 == 1;
}
function V8(e, t) {
  e.metadata = (127 & e.metadata) | ((t ? 1 : 0) << 7);
}
function W8(e, t) {
  e.metadata = (231 & e.metadata) | (t << 3);
}
function H8(e, t) {
  e.metadata = (223 & e.metadata) | ((t ? 1 : 0) << 5);
}
class z8 {
  constructor(e, t, n) {
    ((this.metadata = 0),
      (this.parent = this),
      (this.left = this),
      (this.right = this),
      R8(this, 1),
      (this.start = t),
      (this.end = n),
      (this.delta = 0),
      (this.maxEnd = n),
      (this.id = e),
      (this.ownerId = 0),
      (this.options = null),
      P8(this, !1),
      F8(this, !1),
      W8(this, 1),
      H8(this, !1),
      V8(this, !1),
      (this.cachedVersionId = 0),
      (this.cachedAbsoluteStart = t),
      (this.cachedAbsoluteEnd = n),
      (this.range = null),
      M8(this, !1));
  }
  reset(e, t, n, i) {
    ((this.start = t),
      (this.end = n),
      (this.maxEnd = n),
      (this.cachedVersionId = e),
      (this.cachedAbsoluteStart = t),
      (this.cachedAbsoluteEnd = n),
      (this.range = i));
  }
  setOptions(e) {
    this.options = e;
    const t = this.options.className;
    (P8(this, "squiggly-error" === t || "squiggly-warning" === t || "squiggly-info" === t),
      F8(this, null !== this.options.glyphMarginClassName),
      W8(this, this.options.stickiness),
      H8(this, this.options.collapseOnReplaceEdit),
      V8(this, this.options.affectsFont ?? !1));
  }
  setCachedOffsets(e, t, n) {
    (this.cachedVersionId !== n && (this.range = null),
      (this.cachedVersionId = n),
      (this.cachedAbsoluteStart = e),
      (this.cachedAbsoluteEnd = t));
  }
  detach() {
    ((this.parent = null), (this.left = null), (this.right = null));
  }
}
const U8 = new z8(null, 0, 0);
((U8.parent = U8), (U8.left = U8), (U8.right = U8), R8(U8, 0));
class $8 {
  constructor() {
    ((this.root = U8), (this.requestNormalizeDelta = !1));
  }
  intervalSearch(e, t, n, i, r, o, s) {
    return this.root === U8
      ? []
      : (function (e, t, n, i, r, o, s, a) {
          let l = e.root,
            c = 0,
            d = 0,
            u = 0,
            h = 0;
          const g = [];
          let p = 0;
          for (; l !== U8; )
            if (O8(l))
              (M8(l.left, !1),
                M8(l.right, !1),
                l === l.parent.right && (c -= l.parent.delta),
                (l = l.parent));
            else {
              if (!O8(l.left)) {
                if (((d = c + l.maxEnd), d < t)) {
                  M8(l, !0);
                  continue;
                }
                if (l.left !== U8) {
                  l = l.left;
                  continue;
                }
              }
              if (((u = c + l.start), u > n)) M8(l, !0);
              else {
                if (((h = c + l.end), h >= t)) {
                  l.setCachedOffsets(u, h, s);
                  let e = !0;
                  (i && l.ownerId && l.ownerId !== i && (e = !1),
                    r && A8(l) && (e = !1),
                    o && B8(l) && (e = !1),
                    a && !j8(l) && (e = !1),
                    e && (g[p++] = l));
                }
                (M8(l, !0), l.right === U8 || O8(l.right) || ((c += l.delta), (l = l.right)));
              }
            }
          return (M8(e.root, !1), g);
        })(this, e, t, n, i, r, o, s);
  }
  search(e, t, n, i, r) {
    return this.root === U8
      ? []
      : (function (e, t, n, i, r, o) {
          let s = e.root,
            a = 0,
            l = 0,
            c = 0;
          const d = [];
          let u = 0;
          for (; s !== U8; ) {
            if (O8(s)) {
              (M8(s.left, !1),
                M8(s.right, !1),
                s === s.parent.right && (a -= s.parent.delta),
                (s = s.parent));
              continue;
            }
            if (s.left !== U8 && !O8(s.left)) {
              s = s.left;
              continue;
            }
            ((l = a + s.start), (c = a + s.end), s.setCachedOffsets(l, c, r));
            let e = !0;
            (t && s.ownerId && s.ownerId !== t && (e = !1),
              n && A8(s) && (e = !1),
              i && B8(s) && (e = !1),
              o && !j8(s) && (e = !1),
              e && (d[u++] = s),
              M8(s, !0),
              s.right === U8 || O8(s.right) || ((a += s.delta), (s = s.right)));
          }
          return (M8(e.root, !1), d);
        })(this, e, t, n, i, r);
  }
  collectNodesFromOwner(e) {
    return (function (e, t) {
      let n = e.root;
      const i = [];
      let r = 0;
      for (; n !== U8; )
        O8(n)
          ? (M8(n.left, !1), M8(n.right, !1), (n = n.parent))
          : n.left === U8 || O8(n.left)
            ? (n.ownerId === t && (i[r++] = n),
              M8(n, !0),
              n.right === U8 || O8(n.right) || (n = n.right))
            : (n = n.left);
      return (M8(e.root, !1), i);
    })(this, e);
  }
  collectNodesPostOrder() {
    return (function (e) {
      let t = e.root;
      const n = [];
      let i = 0;
      for (; t !== U8; )
        O8(t)
          ? (M8(t.left, !1), M8(t.right, !1), (t = t.parent))
          : t.left === U8 || O8(t.left)
            ? t.right === U8 || O8(t.right)
              ? ((n[i++] = t), M8(t, !0))
              : (t = t.right)
            : (t = t.left);
      return (M8(e.root, !1), n);
    })(this);
  }
  insert(e) {
    (G8(this, e), this._normalizeDeltaIfNecessary());
  }
  delete(e) {
    (Z8(this, e), this._normalizeDeltaIfNecessary());
  }
  resolveNode(e, t) {
    const n = e;
    let i = 0;
    for (; e !== this.root; ) (e === e.parent.right && (i += e.parent.delta), (e = e.parent));
    const r = n.start + i,
      o = n.end + i;
    n.setCachedOffsets(r, o, t);
  }
  acceptReplace(e, t, n, i) {
    const r = (function (e, t, n) {
      let i = e.root,
        r = 0,
        o = 0,
        s = 0,
        a = 0;
      const l = [];
      let c = 0;
      for (; i !== U8; )
        if (O8(i))
          (M8(i.left, !1),
            M8(i.right, !1),
            i === i.parent.right && (r -= i.parent.delta),
            (i = i.parent));
        else {
          if (!O8(i.left)) {
            if (((o = r + i.maxEnd), o < t)) {
              M8(i, !0);
              continue;
            }
            if (i.left !== U8) {
              i = i.left;
              continue;
            }
          }
          ((s = r + i.start),
            s > n
              ? M8(i, !0)
              : ((a = r + i.end),
                a >= t && (i.setCachedOffsets(s, a, 0), (l[c++] = i)),
                M8(i, !0),
                i.right === U8 || O8(i.right) || ((r += i.delta), (i = i.right))));
        }
      return (M8(e.root, !1), l);
    })(this, e, e + t);
    for (let o = 0, s = r.length; o < s; o++) {
      Z8(this, r[o]);
    }
    (this._normalizeDeltaIfNecessary(),
      (function (e, t, n, i) {
        let r = e.root,
          o = 0,
          s = 0,
          a = 0;
        const l = i - (n - t);
        for (; r !== U8; )
          if (O8(r))
            (M8(r.left, !1),
              M8(r.right, !1),
              r === r.parent.right && (o -= r.parent.delta),
              e9(r),
              (r = r.parent));
          else {
            if (!O8(r.left)) {
              if (((s = o + r.maxEnd), s < t)) {
                M8(r, !0);
                continue;
              }
              if (r.left !== U8) {
                r = r.left;
                continue;
              }
            }
            ((a = o + r.start),
              a > n
                ? ((r.start += l),
                  (r.end += l),
                  (r.delta += l),
                  (r.delta < -1073741824 || r.delta > 1073741824) && (e.requestNormalizeDelta = !0),
                  M8(r, !0))
                : (M8(r, !0), r.right === U8 || O8(r.right) || ((o += r.delta), (r = r.right))));
          }
        M8(e.root, !1);
      })(this, e, e + t, n),
      this._normalizeDeltaIfNecessary());
    for (let o = 0, s = r.length; o < s; o++) {
      const s = r[o];
      ((s.start = s.cachedAbsoluteStart),
        (s.end = s.cachedAbsoluteEnd),
        K8(s, e, e + t, n, i),
        (s.maxEnd = s.end),
        G8(this, s));
    }
    this._normalizeDeltaIfNecessary();
  }
  _normalizeDeltaIfNecessary() {
    this.requestNormalizeDelta &&
      ((this.requestNormalizeDelta = !1),
      (function (e) {
        let t = e.root,
          n = 0;
        for (; t !== U8; )
          t.left === U8 || O8(t.left)
            ? t.right === U8 || O8(t.right)
              ? ((t.start = n + t.start),
                (t.end = n + t.end),
                (t.delta = 0),
                e9(t),
                M8(t, !0),
                M8(t.left, !1),
                M8(t.right, !1),
                t === t.parent.right && (n -= t.parent.delta),
                (t = t.parent))
              : ((n += t.delta), (t = t.right))
            : (t = t.left);
        M8(e.root, !1);
      })(this));
  }
}
function q8(e, t, n, i) {
  return e < n || (!(e > n) && 1 !== i && (2 === i || t));
}
function K8(e, t, n, i, r) {
  const o = (function (e) {
      return (24 & e.metadata) >>> 3;
    })(e),
    s = 0 === o || 2 === o,
    a = 1 === o || 2 === o,
    l = n - t,
    c = i,
    d = Math.min(l, c),
    u = e.start;
  let h = !1;
  const g = e.end;
  let p = !1;
  t <= u &&
    g <= n &&
    (function (e) {
      return (32 & e.metadata) >>> 5 == 1;
    })(e) &&
    ((e.start = t), (h = !0), (e.end = t), (p = !0));
  {
    const e = r ? 1 : l > 0 ? 2 : 0;
    (!h && q8(u, s, t, e) && (h = !0), !p && q8(g, a, t, e) && (p = !0));
  }
  if (d > 0 && !r) {
    const e = l > c ? 2 : 0;
    (!h && q8(u, s, t + d, e) && (h = !0), !p && q8(g, a, t + d, e) && (p = !0));
  }
  {
    const i = r ? 1 : 0;
    (!h && q8(u, s, n, i) && ((e.start = t + c), (h = !0)),
      !p && q8(g, a, n, i) && ((e.end = t + c), (p = !0)));
  }
  const f = c - l;
  (h || (e.start = Math.max(0, u + f)),
    p || (e.end = Math.max(0, g + f)),
    e.start > e.end && (e.end = e.start));
}
function G8(e, t) {
  if (e.root === U8)
    return ((t.parent = U8), (t.left = U8), (t.right = U8), R8(t, 0), (e.root = t), e.root);
  (!(function (e, t) {
    let n = 0,
      i = e.root;
    const r = t.start,
      o = t.end;
    for (;;) {
      if (n9(r, o, i.start + n, i.end + n) < 0) {
        if (i.left === U8) {
          ((t.start -= n), (t.end -= n), (t.maxEnd -= n), (i.left = t));
          break;
        }
        i = i.left;
      } else {
        if (i.right === U8) {
          ((t.start -= n + i.delta),
            (t.end -= n + i.delta),
            (t.maxEnd -= n + i.delta),
            (i.right = t));
          break;
        }
        ((n += i.delta), (i = i.right));
      }
    }
    ((t.parent = i), (t.left = U8), (t.right = U8), R8(t, 1));
  })(e, t),
    t9(t.parent));
  let n = t;
  for (; n !== e.root && 1 === I8(n.parent); )
    if (n.parent === n.parent.parent.left) {
      const t = n.parent.parent.right;
      1 === I8(t)
        ? (R8(n.parent, 0), R8(t, 0), R8(n.parent.parent, 1), (n = n.parent.parent))
        : (n === n.parent.right && ((n = n.parent), X8(e, n)),
          R8(n.parent, 0),
          R8(n.parent.parent, 1),
          Q8(e, n.parent.parent));
    } else {
      const t = n.parent.parent.left;
      1 === I8(t)
        ? (R8(n.parent, 0), R8(t, 0), R8(n.parent.parent, 1), (n = n.parent.parent))
        : (n === n.parent.left && ((n = n.parent), Q8(e, n)),
          R8(n.parent, 0),
          R8(n.parent.parent, 1),
          X8(e, n.parent.parent));
    }
  return (R8(e.root, 0), t);
}
function Z8(e, t) {
  let n, i;
  if (
    (t.left === U8
      ? ((n = t.right),
        (i = t),
        (n.delta += t.delta),
        (n.delta < -1073741824 || n.delta > 1073741824) && (e.requestNormalizeDelta = !0),
        (n.start += t.delta),
        (n.end += t.delta))
      : t.right === U8
        ? ((n = t.left), (i = t))
        : ((i = (function (e) {
            for (; e.left !== U8; ) e = e.left;
            return e;
          })(t.right)),
          (n = i.right),
          (n.start += i.delta),
          (n.end += i.delta),
          (n.delta += i.delta),
          (n.delta < -1073741824 || n.delta > 1073741824) && (e.requestNormalizeDelta = !0),
          (i.start += t.delta),
          (i.end += t.delta),
          (i.delta = t.delta),
          (i.delta < -1073741824 || i.delta > 1073741824) && (e.requestNormalizeDelta = !0)),
    i === e.root)
  )
    return ((e.root = n), R8(n, 0), t.detach(), Y8(), e9(n), void (e.root.parent = U8));
  const r = 1 === I8(i);
  if (
    (i === i.parent.left ? (i.parent.left = n) : (i.parent.right = n),
    i === t
      ? (n.parent = i.parent)
      : (i.parent === t ? (n.parent = i) : (n.parent = i.parent),
        (i.left = t.left),
        (i.right = t.right),
        (i.parent = t.parent),
        R8(i, I8(t)),
        t === e.root
          ? (e.root = i)
          : t === t.parent.left
            ? (t.parent.left = i)
            : (t.parent.right = i),
        i.left !== U8 && (i.left.parent = i),
        i.right !== U8 && (i.right.parent = i)),
    t.detach(),
    r)
  )
    return (t9(n.parent), i !== t && (t9(i), t9(i.parent)), void Y8());
  let o;
  for (t9(n), t9(n.parent), i !== t && (t9(i), t9(i.parent)); n !== e.root && 0 === I8(n); )
    n === n.parent.left
      ? ((o = n.parent.right),
        1 === I8(o) && (R8(o, 0), R8(n.parent, 1), X8(e, n.parent), (o = n.parent.right)),
        0 === I8(o.left) && 0 === I8(o.right)
          ? (R8(o, 1), (n = n.parent))
          : (0 === I8(o.right) && (R8(o.left, 0), R8(o, 1), Q8(e, o), (o = n.parent.right)),
            R8(o, I8(n.parent)),
            R8(n.parent, 0),
            R8(o.right, 0),
            X8(e, n.parent),
            (n = e.root)))
      : ((o = n.parent.left),
        1 === I8(o) && (R8(o, 0), R8(n.parent, 1), Q8(e, n.parent), (o = n.parent.left)),
        0 === I8(o.left) && 0 === I8(o.right)
          ? (R8(o, 1), (n = n.parent))
          : (0 === I8(o.left) && (R8(o.right, 0), R8(o, 1), X8(e, o), (o = n.parent.left)),
            R8(o, I8(n.parent)),
            R8(n.parent, 0),
            R8(o.left, 0),
            Q8(e, n.parent),
            (n = e.root)));
  (R8(n, 0), Y8());
}
function Y8() {
  ((U8.parent = U8), (U8.delta = 0), (U8.start = 0), (U8.end = 0));
}
function X8(e, t) {
  const n = t.right;
  ((n.delta += t.delta),
    (n.delta < -1073741824 || n.delta > 1073741824) && (e.requestNormalizeDelta = !0),
    (n.start += t.delta),
    (n.end += t.delta),
    (t.right = n.left),
    n.left !== U8 && (n.left.parent = t),
    (n.parent = t.parent),
    t.parent === U8
      ? (e.root = n)
      : t === t.parent.left
        ? (t.parent.left = n)
        : (t.parent.right = n),
    (n.left = t),
    (t.parent = n),
    e9(t),
    e9(n));
}
function Q8(e, t) {
  const n = t.left;
  ((t.delta -= n.delta),
    (t.delta < -1073741824 || t.delta > 1073741824) && (e.requestNormalizeDelta = !0),
    (t.start -= n.delta),
    (t.end -= n.delta),
    (t.left = n.right),
    n.right !== U8 && (n.right.parent = t),
    (n.parent = t.parent),
    t.parent === U8
      ? (e.root = n)
      : t === t.parent.right
        ? (t.parent.right = n)
        : (t.parent.left = n),
    (n.right = t),
    (t.parent = n),
    e9(t),
    e9(n));
}
function J8(e) {
  let t = e.end;
  if (e.left !== U8) {
    const n = e.left.maxEnd;
    n > t && (t = n);
  }
  if (e.right !== U8) {
    const n = e.right.maxEnd + e.delta;
    n > t && (t = n);
  }
  return t;
}
function e9(e) {
  e.maxEnd = J8(e);
}
function t9(e) {
  for (; e !== U8; ) {
    const t = J8(e);
    if (e.maxEnd === t) return;
    ((e.maxEnd = t), (e = e.parent));
  }
}
function n9(e, t, n, i) {
  return e === n ? t - i : e - n;
}
class i9 {
  constructor(e, t) {
    ((this.piece = e),
      (this.color = t),
      (this.size_left = 0),
      (this.lf_left = 0),
      (this.parent = this),
      (this.left = this),
      (this.right = this));
  }
  next() {
    if (this.right !== r9) return o9(this.right);
    let e = this;
    for (; e.parent !== r9 && e.parent.left !== e; ) e = e.parent;
    return e.parent === r9 ? r9 : e.parent;
  }
  prev() {
    if (this.left !== r9) return s9(this.left);
    let e = this;
    for (; e.parent !== r9 && e.parent.right !== e; ) e = e.parent;
    return e.parent === r9 ? r9 : e.parent;
  }
  detach() {
    ((this.parent = null), (this.left = null), (this.right = null));
  }
}
const r9 = new i9(null, 0);
function o9(e) {
  for (; e.left !== r9; ) e = e.left;
  return e;
}
function s9(e) {
  for (; e.right !== r9; ) e = e.right;
  return e;
}
function a9(e) {
  return e === r9 ? 0 : e.size_left + e.piece.length + a9(e.right);
}
function l9(e) {
  return e === r9 ? 0 : e.lf_left + e.piece.lineFeedCnt + l9(e.right);
}
function c9() {
  r9.parent = r9;
}
function d9(e, t) {
  const n = t.right;
  ((n.size_left += t.size_left + (t.piece ? t.piece.length : 0)),
    (n.lf_left += t.lf_left + (t.piece ? t.piece.lineFeedCnt : 0)),
    (t.right = n.left),
    n.left !== r9 && (n.left.parent = t),
    (n.parent = t.parent),
    t.parent === r9
      ? (e.root = n)
      : t.parent.left === t
        ? (t.parent.left = n)
        : (t.parent.right = n),
    (n.left = t),
    (t.parent = n));
}
function u9(e, t) {
  const n = t.left;
  ((t.left = n.right),
    n.right !== r9 && (n.right.parent = t),
    (n.parent = t.parent),
    (t.size_left -= n.size_left + (n.piece ? n.piece.length : 0)),
    (t.lf_left -= n.lf_left + (n.piece ? n.piece.lineFeedCnt : 0)),
    t.parent === r9
      ? (e.root = n)
      : t === t.parent.right
        ? (t.parent.right = n)
        : (t.parent.left = n),
    (n.right = t),
    (t.parent = n));
}
function h9(e, t) {
  let n, i;
  if (
    (t.left === r9
      ? ((i = t), (n = i.right))
      : t.right === r9
        ? ((i = t), (n = i.left))
        : ((i = o9(t.right)), (n = i.right)),
    i === e.root)
  )
    return ((e.root = n), (n.color = 0), t.detach(), c9(), void (e.root.parent = r9));
  const r = 1 === i.color;
  if (
    (i === i.parent.left ? (i.parent.left = n) : (i.parent.right = n),
    i === t
      ? ((n.parent = i.parent), f9(e, n))
      : (i.parent === t ? (n.parent = i) : (n.parent = i.parent),
        f9(e, n),
        (i.left = t.left),
        (i.right = t.right),
        (i.parent = t.parent),
        (i.color = t.color),
        t === e.root
          ? (e.root = i)
          : t === t.parent.left
            ? (t.parent.left = i)
            : (t.parent.right = i),
        i.left !== r9 && (i.left.parent = i),
        i.right !== r9 && (i.right.parent = i),
        (i.size_left = t.size_left),
        (i.lf_left = t.lf_left),
        f9(e, i)),
    t.detach(),
    n.parent.left === n)
  ) {
    const t = a9(n),
      i = l9(n);
    if (t !== n.parent.size_left || i !== n.parent.lf_left) {
      const r = t - n.parent.size_left,
        o = i - n.parent.lf_left;
      ((n.parent.size_left = t), (n.parent.lf_left = i), p9(e, n.parent, r, o));
    }
  }
  if ((f9(e, n.parent), r)) return void c9();
  let o;
  for (; n !== e.root && 0 === n.color; )
    n === n.parent.left
      ? ((o = n.parent.right),
        1 === o.color &&
          ((o.color = 0), (n.parent.color = 1), d9(e, n.parent), (o = n.parent.right)),
        0 === o.left.color && 0 === o.right.color
          ? ((o.color = 1), (n = n.parent))
          : (0 === o.right.color &&
              ((o.left.color = 0), (o.color = 1), u9(e, o), (o = n.parent.right)),
            (o.color = n.parent.color),
            (n.parent.color = 0),
            (o.right.color = 0),
            d9(e, n.parent),
            (n = e.root)))
      : ((o = n.parent.left),
        1 === o.color &&
          ((o.color = 0), (n.parent.color = 1), u9(e, n.parent), (o = n.parent.left)),
        0 === o.left.color && 0 === o.right.color
          ? ((o.color = 1), (n = n.parent))
          : (0 === o.left.color &&
              ((o.right.color = 0), (o.color = 1), d9(e, o), (o = n.parent.left)),
            (o.color = n.parent.color),
            (n.parent.color = 0),
            (o.left.color = 0),
            u9(e, n.parent),
            (n = e.root)));
  ((n.color = 0), c9());
}
function g9(e, t) {
  for (f9(e, t); t !== e.root && 1 === t.parent.color; )
    if (t.parent === t.parent.parent.left) {
      const n = t.parent.parent.right;
      1 === n.color
        ? ((t.parent.color = 0), (n.color = 0), (t.parent.parent.color = 1), (t = t.parent.parent))
        : (t === t.parent.right && d9(e, (t = t.parent)),
          (t.parent.color = 0),
          (t.parent.parent.color = 1),
          u9(e, t.parent.parent));
    } else {
      const n = t.parent.parent.left;
      1 === n.color
        ? ((t.parent.color = 0), (n.color = 0), (t.parent.parent.color = 1), (t = t.parent.parent))
        : (t === t.parent.left && u9(e, (t = t.parent)),
          (t.parent.color = 0),
          (t.parent.parent.color = 1),
          d9(e, t.parent.parent));
    }
  e.root.color = 0;
}
function p9(e, t, n, i) {
  for (; t !== e.root && t !== r9; )
    (t.parent.left === t && ((t.parent.size_left += n), (t.parent.lf_left += i)), (t = t.parent));
}
function f9(e, t) {
  let n = 0,
    i = 0;
  if (t !== e.root) {
    for (; t !== e.root && t === t.parent.right; ) t = t.parent;
    if (t !== e.root)
      for (
        n = a9((t = t.parent).left) - t.size_left,
          i = l9(t.left) - t.lf_left,
          t.size_left += n,
          t.lf_left += i;
        t !== e.root && (0 !== n || 0 !== i);
      )
        (t.parent.left === t && ((t.parent.size_left += n), (t.parent.lf_left += i)),
          (t = t.parent));
  }
}
((r9.parent = r9), (r9.left = r9), (r9.right = r9), (r9.color = 0));
class m9 {
  constructor(e, t, n, i) {
    ((this.searchString = e), (this.isRegex = t), (this.matchCase = n), (this.wordSeparators = i));
  }
  parseSearchRequest() {
    if ("" === this.searchString) return null;
    let e;
    e = this.isRegex ? _9(this.searchString) : this.searchString.indexOf("\n") >= 0;
    let t = null;
    try {
      t = KM(this.searchString, this.isRegex, {
        matchCase: this.matchCase,
        wholeWord: !1,
        multiline: e,
        global: !0,
        unicode: !0,
      });
    } catch (i) {
      return null;
    }
    if (!t) return null;
    let n = !this.isRegex && !e;
    return (
      n &&
        this.searchString.toLowerCase() !== this.searchString.toUpperCase() &&
        (n = this.matchCase),
      new Jz(
        t,
        this.wordSeparators ? Mz(this.wordSeparators, []) : null,
        n ? this.searchString : null,
      )
    );
  }
}
function _9(e) {
  if (!e || 0 === e.length) return !1;
  for (let t = 0, n = e.length; t < n; t++) {
    const i = e.charCodeAt(t);
    if (10 === i) return !0;
    if (92 === i) {
      if ((t++, t >= n)) break;
      const i = e.charCodeAt(t);
      if (110 === i || 114 === i || 87 === i) return !0;
    }
  }
  return !1;
}
function v9(e, t, n) {
  if (!n) return new Xz(e, null);
  const i = [];
  for (let r = 0, o = t.length; r < o; r++) i[r] = t[r];
  return new Xz(e, i);
}
class b9 {
  constructor(e) {
    const t = [];
    let n = 0;
    for (let i = 0, r = e.length; i < r; i++) 10 === e.charCodeAt(i) && (t[n++] = i);
    this._lineFeedsOffsets = t;
  }
  findLineFeedCountBeforeOffset(e) {
    const t = this._lineFeedsOffsets;
    let n = 0,
      i = t.length - 1;
    if (-1 === i) return 0;
    if (e <= t[0]) return 0;
    for (; n < i; ) {
      const r = n + (((i - n) / 2) | 0);
      t[r] >= e ? (i = r - 1) : t[r + 1] >= e ? ((n = r), (i = r)) : (n = r + 1);
    }
    return n + 1;
  }
}
class y9 {
  static findMatches(e, t, n, i, r) {
    const o = t.parseSearchRequest();
    return o
      ? o.regex.multiline
        ? this._doFindMatchesMultiline(e, n, new w9(o.wordSeparators, o.regex), i, r)
        : this._doFindMatchesLineByLine(e, n, o, i, r)
      : [];
  }
  static _getMultilineMatchRange(e, t, n, i, r, o) {
    let s,
      a,
      l = 0;
    if ((i ? ((l = i.findLineFeedCountBeforeOffset(r)), (s = t + r + l)) : (s = t + r), i)) {
      const e = i.findLineFeedCountBeforeOffset(r + o.length) - l;
      a = s + o.length + e;
    } else a = s + o.length;
    const c = e.getPositionAt(s),
      d = e.getPositionAt(a);
    return new YH(c.lineNumber, c.column, d.lineNumber, d.column);
  }
  static _doFindMatchesMultiline(e, t, n, i, r) {
    const o = e.getOffsetAt(t.getStartPosition()),
      s = e.getValueInRange(t, 1),
      a = "\r\n" === e.getEOL() ? new b9(s) : null,
      l = [];
    let c,
      d = 0;
    for (n.reset(0); (c = n.next(s)); )
      if (((l[d++] = v9(this._getMultilineMatchRange(e, o, s, a, c.index, c[0]), c, i)), d >= r))
        return l;
    return l;
  }
  static _doFindMatchesLineByLine(e, t, n, i, r) {
    const o = [];
    let s = 0;
    if (t.startLineNumber === t.endLineNumber) {
      const a = e.getLineContent(t.startLineNumber).substring(t.startColumn - 1, t.endColumn - 1);
      return (
        (s = this._findMatchesInLine(n, a, t.startLineNumber, t.startColumn - 1, s, o, i, r)),
        o
      );
    }
    const a = e.getLineContent(t.startLineNumber).substring(t.startColumn - 1);
    s = this._findMatchesInLine(n, a, t.startLineNumber, t.startColumn - 1, s, o, i, r);
    for (let l = t.startLineNumber + 1; l < t.endLineNumber && s < r; l++)
      s = this._findMatchesInLine(n, e.getLineContent(l), l, 0, s, o, i, r);
    if (s < r) {
      const a = e.getLineContent(t.endLineNumber).substring(0, t.endColumn - 1);
      s = this._findMatchesInLine(n, a, t.endLineNumber, 0, s, o, i, r);
    }
    return o;
  }
  static _findMatchesInLine(e, t, n, i, r, o, s, a) {
    const l = e.wordSeparators;
    if (!s && e.simpleSearch) {
      const s = e.simpleSearch,
        c = s.length,
        d = t.length;
      let u = -c;
      for (; -1 !== (u = t.indexOf(s, u + c)); )
        if (
          (!l || x9(l, t, d, u, c)) &&
          ((o[r++] = new Xz(new YH(n, u + 1 + i, n, u + 1 + c + i), null)), r >= a)
        )
          return r;
      return r;
    }
    const c = new w9(e.wordSeparators, e.regex);
    let d;
    c.reset(0);
    do {
      if (
        ((d = c.next(t)),
        d &&
          ((o[r++] = v9(new YH(n, d.index + 1 + i, n, d.index + 1 + d[0].length + i), d, s)),
          r >= a))
      )
        return r;
    } while (d);
    return r;
  }
  static findNextMatch(e, t, n, i) {
    const r = t.parseSearchRequest();
    if (!r) return null;
    const o = new w9(r.wordSeparators, r.regex);
    return r.regex.multiline
      ? this._doFindNextMatchMultiline(e, n, o, i)
      : this._doFindNextMatchLineByLine(e, n, o, i);
  }
  static _doFindNextMatchMultiline(e, t, n, i) {
    const r = new xV(t.lineNumber, 1),
      o = e.getOffsetAt(r),
      s = e.getLineCount(),
      a = e.getValueInRange(new YH(r.lineNumber, r.column, s, e.getLineMaxColumn(s)), 1),
      l = "\r\n" === e.getEOL() ? new b9(a) : null;
    n.reset(t.column - 1);
    const c = n.next(a);
    return c
      ? v9(this._getMultilineMatchRange(e, o, a, l, c.index, c[0]), c, i)
      : 1 !== t.lineNumber || 1 !== t.column
        ? this._doFindNextMatchMultiline(e, new xV(1, 1), n, i)
        : null;
  }
  static _doFindNextMatchLineByLine(e, t, n, i) {
    const r = e.getLineCount(),
      o = t.lineNumber,
      s = e.getLineContent(o),
      a = this._findFirstMatchInLine(n, s, o, t.column, i);
    if (a) return a;
    for (let l = 1; l <= r; l++) {
      const t = (o + l - 1) % r,
        s = e.getLineContent(t + 1),
        a = this._findFirstMatchInLine(n, s, t + 1, 1, i);
      if (a) return a;
    }
    return null;
  }
  static _findFirstMatchInLine(e, t, n, i, r) {
    e.reset(i - 1);
    const o = e.next(t);
    return o ? v9(new YH(n, o.index + 1, n, o.index + 1 + o[0].length), o, r) : null;
  }
  static findPreviousMatch(e, t, n, i) {
    const r = t.parseSearchRequest();
    if (!r) return null;
    const o = new w9(r.wordSeparators, r.regex);
    return r.regex.multiline
      ? this._doFindPreviousMatchMultiline(e, n, o, i)
      : this._doFindPreviousMatchLineByLine(e, n, o, i);
  }
  static _doFindPreviousMatchMultiline(e, t, n, i) {
    const r = this._doFindMatchesMultiline(e, new YH(1, 1, t.lineNumber, t.column), n, i, 9990);
    if (r.length > 0) return r[r.length - 1];
    const o = e.getLineCount();
    return t.lineNumber !== o || t.column !== e.getLineMaxColumn(o)
      ? this._doFindPreviousMatchMultiline(e, new xV(o, e.getLineMaxColumn(o)), n, i)
      : null;
  }
  static _doFindPreviousMatchLineByLine(e, t, n, i) {
    const r = e.getLineCount(),
      o = t.lineNumber,
      s = e.getLineContent(o).substring(0, t.column - 1),
      a = this._findLastMatchInLine(n, s, o, i);
    if (a) return a;
    for (let l = 1; l <= r; l++) {
      const t = (r + o - l - 1) % r,
        s = e.getLineContent(t + 1),
        a = this._findLastMatchInLine(n, s, t + 1, i);
      if (a) return a;
    }
    return null;
  }
  static _findLastMatchInLine(e, t, n, i) {
    let r,
      o = null;
    for (e.reset(0); (r = e.next(t)); )
      o = v9(new YH(n, r.index + 1, n, r.index + 1 + r[0].length), r, i);
    return o;
  }
}
function x9(e, t, n, i, r) {
  return (
    (function (e, t, n, i, r) {
      if (0 === i) return !0;
      const o = t.charCodeAt(i - 1);
      if (0 !== e.get(o)) return !0;
      if (13 === o || 10 === o) return !0;
      if (r > 0) {
        const n = t.charCodeAt(i);
        if (0 !== e.get(n)) return !0;
      }
      return !1;
    })(e, t, 0, i, r) &&
    (function (e, t, n, i, r) {
      if (i + r === n) return !0;
      const o = t.charCodeAt(i + r);
      if (0 !== e.get(o)) return !0;
      if (13 === o || 10 === o) return !0;
      if (r > 0) {
        const n = t.charCodeAt(i + r - 1);
        if (0 !== e.get(n)) return !0;
      }
      return !1;
    })(e, t, n, i, r)
  );
}
class w9 {
  constructor(e, t) {
    ((this._wordSeparators = e),
      (this._searchRegex = t),
      (this._prevMatchStartIndex = -1),
      (this._prevMatchLength = 0));
  }
  reset(e) {
    ((this._searchRegex.lastIndex = e),
      (this._prevMatchStartIndex = -1),
      (this._prevMatchLength = 0));
  }
  next(e) {
    const t = e.length;
    let n;
    do {
      if (this._prevMatchStartIndex + this._prevMatchLength === t) return null;
      if (((n = this._searchRegex.exec(e)), !n)) return null;
      const i = n.index,
        r = n[0].length;
      if (i === this._prevMatchStartIndex && r === this._prevMatchLength) {
        if (0 === r) {
          pA(e, t, this._searchRegex.lastIndex) > 65535
            ? (this._searchRegex.lastIndex += 2)
            : (this._searchRegex.lastIndex += 1);
          continue;
        }
        return null;
      }
      if (
        ((this._prevMatchStartIndex = i),
        (this._prevMatchLength = r),
        !this._wordSeparators || x9(this._wordSeparators, e, t, i, r))
      )
        return n;
    } while (n);
    return null;
  }
}
const C9 = 65535;
function S9(e) {
  let t;
  return (
    (t = e[e.length - 1] < 65536 ? new Uint16Array(e.length) : new Uint32Array(e.length)),
    t.set(e, 0),
    t
  );
}
class k9 {
  constructor(e, t, n, i, r) {
    ((this.lineStarts = e), (this.cr = t), (this.lf = n), (this.crlf = i), (this.isBasicASCII = r));
  }
}
function E9(e, t = !0) {
  const n = [0];
  let i = 1;
  for (let r = 0, o = e.length; r < o; r++) {
    const t = e.charCodeAt(r);
    13 === t
      ? r + 1 < o && 10 === e.charCodeAt(r + 1)
        ? ((n[i++] = r + 2), r++)
        : (n[i++] = r + 1)
      : 10 === t && (n[i++] = r + 1);
  }
  return t ? S9(n) : n;
}
class N9 {
  constructor(e, t, n, i, r) {
    ((this.bufferIndex = e),
      (this.start = t),
      (this.end = n),
      (this.lineFeedCnt = i),
      (this.length = r));
  }
}
class L9 {
  constructor(e, t) {
    ((this.buffer = e), (this.lineStarts = t));
  }
}
class D9 {
  constructor(e, t) {
    ((this._pieces = []),
      (this._tree = e),
      (this._BOM = t),
      (this._index = 0),
      e.root !== r9 && e.iterate(e.root, (e) => (e !== r9 && this._pieces.push(e.piece), !0)));
  }
  read() {
    return 0 === this._pieces.length
      ? 0 === this._index
        ? (this._index++, this._BOM)
        : null
      : this._index > this._pieces.length - 1
        ? null
        : 0 === this._index
          ? this._BOM + this._tree.getPieceContent(this._pieces[this._index++])
          : this._tree.getPieceContent(this._pieces[this._index++]);
  }
}
class T9 {
  constructor(e) {
    ((this._limit = e), (this._cache = []));
  }
  get(e) {
    for (let t = this._cache.length - 1; t >= 0; t--) {
      const n = this._cache[t];
      if (n.nodeStartOffset <= e && n.nodeStartOffset + n.node.piece.length >= e) return n;
    }
    return null;
  }
  get2(e) {
    for (let t = this._cache.length - 1; t >= 0; t--) {
      const n = this._cache[t];
      if (
        n.nodeStartLineNumber &&
        n.nodeStartLineNumber < e &&
        n.nodeStartLineNumber + n.node.piece.lineFeedCnt >= e
      )
        return n;
    }
    return null;
  }
  set(e) {
    (this._cache.length >= this._limit && this._cache.shift(), this._cache.push(e));
  }
  validate(e) {
    let t = !1;
    const n = this._cache;
    for (let i = 0; i < n.length; i++) {
      const r = n[i];
      (null === r.node.parent || r.nodeStartOffset >= e) && ((n[i] = null), (t = !0));
    }
    if (t) {
      const e = [];
      for (const t of n) null !== t && e.push(t);
      this._cache = e;
    }
  }
}
class I9 {
  constructor(e, t, n) {
    this.create(e, t, n);
  }
  create(e, t, n) {
    ((this._buffers = [new L9("", [0])]),
      (this._lastChangeBufferPos = { line: 0, column: 0 }),
      (this.root = r9),
      (this._lineCnt = 1),
      (this._length = 0),
      (this._EOL = t),
      (this._EOLLength = t.length),
      (this._EOLNormalized = n));
    let i = null;
    for (let r = 0, o = e.length; r < o; r++)
      if (e[r].buffer.length > 0) {
        e[r].lineStarts || (e[r].lineStarts = E9(e[r].buffer));
        const t = new N9(
          r + 1,
          { line: 0, column: 0 },
          {
            line: e[r].lineStarts.length - 1,
            column: e[r].buffer.length - e[r].lineStarts[e[r].lineStarts.length - 1],
          },
          e[r].lineStarts.length - 1,
          e[r].buffer.length,
        );
        (this._buffers.push(e[r]), (i = this.rbInsertRight(i, t)));
      }
    ((this._searchCache = new T9(1)),
      (this._lastVisitedLine = { lineNumber: 0, value: "" }),
      this.computeBufferMetadata());
  }
  normalizeEOL(e) {
    const t = C9,
      n = t - Math.floor(21845),
      i = 2 * n;
    let r = "",
      o = 0;
    const s = [];
    if (
      (this.iterate(this.root, (t) => {
        const a = this.getNodeContent(t),
          l = a.length;
        if (o <= n || o + l < i) return ((r += a), (o += l), !0);
        const c = r.replace(/\r\n|\r|\n/g, e);
        return (s.push(new L9(c, E9(c))), (r = a), (o = l), !0);
      }),
      o > 0)
    ) {
      const t = r.replace(/\r\n|\r|\n/g, e);
      s.push(new L9(t, E9(t)));
    }
    this.create(s, e, !0);
  }
  getEOL() {
    return this._EOL;
  }
  setEOL(e) {
    ((this._EOL = e), (this._EOLLength = this._EOL.length), this.normalizeEOL(e));
  }
  createSnapshot(e) {
    return new D9(this, e);
  }
  getOffsetAt(e, t) {
    let n = 0,
      i = this.root;
    for (; i !== r9; )
      if (i.left !== r9 && i.lf_left + 1 >= e) i = i.left;
      else {
        if (i.lf_left + i.piece.lineFeedCnt + 1 >= e) {
          n += i.size_left;
          return n + (this.getAccumulatedValue(i, e - i.lf_left - 2) + t - 1);
        }
        ((e -= i.lf_left + i.piece.lineFeedCnt),
          (n += i.size_left + i.piece.length),
          (i = i.right));
      }
    return n;
  }
  getPositionAt(e) {
    ((e = Math.floor(e)), (e = Math.max(0, e)));
    let t = this.root,
      n = 0;
    const i = e;
    for (; t !== r9; )
      if (0 !== t.size_left && t.size_left >= e) t = t.left;
      else {
        if (t.size_left + t.piece.length >= e) {
          const r = this.getIndexOf(t, e - t.size_left);
          if (((n += t.lf_left + r.index), 0 === r.index)) {
            const e = this.getOffsetAt(n + 1, 1);
            return new xV(n + 1, i - e + 1);
          }
          return new xV(n + 1, r.remainder + 1);
        }
        if (
          ((e -= t.size_left + t.piece.length),
          (n += t.lf_left + t.piece.lineFeedCnt),
          t.right === r9)
        ) {
          const t = this.getOffsetAt(n + 1, 1);
          return new xV(n + 1, i - e - t + 1);
        }
        t = t.right;
      }
    return new xV(1, 1);
  }
  getValueInRange(e, t) {
    if (e.startLineNumber === e.endLineNumber && e.startColumn === e.endColumn) return "";
    const n = this.nodeAt2(e.startLineNumber, e.startColumn),
      i = this.nodeAt2(e.endLineNumber, e.endColumn),
      r = this.getValueInRange2(n, i);
    return t
      ? t === this._EOL && this._EOLNormalized && t === this.getEOL() && this._EOLNormalized
        ? r
        : r.replace(/\r\n|\r|\n/g, t)
      : r;
  }
  getValueInRange2(e, t) {
    if (e.node === t.node) {
      const n = e.node,
        i = this._buffers[n.piece.bufferIndex].buffer,
        r = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
      return i.substring(r + e.remainder, r + t.remainder);
    }
    let n = e.node;
    const i = this._buffers[n.piece.bufferIndex].buffer,
      r = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
    let o = i.substring(r + e.remainder, r + n.piece.length);
    for (n = n.next(); n !== r9; ) {
      const e = this._buffers[n.piece.bufferIndex].buffer,
        i = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
      if (n === t.node) {
        o += e.substring(i, i + t.remainder);
        break;
      }
      ((o += e.substr(i, n.piece.length)), (n = n.next()));
    }
    return o;
  }
  getLinesContent() {
    const e = [];
    let t = 0,
      n = "",
      i = !1;
    return (
      this.iterate(this.root, (r) => {
        if (r === r9) return !0;
        const o = r.piece;
        let s = o.length;
        if (0 === s) return !0;
        const a = this._buffers[o.bufferIndex].buffer,
          l = this._buffers[o.bufferIndex].lineStarts,
          c = o.start.line,
          d = o.end.line;
        let u = l[c] + o.start.column;
        if (i && (10 === a.charCodeAt(u) && (u++, s--), (e[t++] = n), (n = ""), (i = !1), 0 === s))
          return !0;
        if (c === d)
          return (
            this._EOLNormalized || 13 !== a.charCodeAt(u + s - 1)
              ? (n += a.substr(u, s))
              : ((i = !0), (n += a.substr(u, s - 1))),
            !0
          );
        ((n += this._EOLNormalized
          ? a.substring(u, Math.max(u, l[c + 1] - this._EOLLength))
          : a.substring(u, l[c + 1]).replace(/(\r\n|\r|\n)$/, "")),
          (e[t++] = n));
        for (let i = c + 1; i < d; i++)
          ((n = this._EOLNormalized
            ? a.substring(l[i], l[i + 1] - this._EOLLength)
            : a.substring(l[i], l[i + 1]).replace(/(\r\n|\r|\n)$/, "")),
            (e[t++] = n));
        return (
          this._EOLNormalized || 13 !== a.charCodeAt(l[d] + o.end.column - 1)
            ? (n = a.substr(l[d], o.end.column))
            : ((i = !0), 0 === o.end.column ? t-- : (n = a.substr(l[d], o.end.column - 1))),
          !0
        );
      }),
      i && ((e[t++] = n), (n = "")),
      (e[t++] = n),
      e
    );
  }
  getLength() {
    return this._length;
  }
  getLineCount() {
    return this._lineCnt;
  }
  getLineContent(e) {
    return (
      this._lastVisitedLine.lineNumber === e ||
        ((this._lastVisitedLine.lineNumber = e),
        e === this._lineCnt
          ? (this._lastVisitedLine.value = this.getLineRawContent(e))
          : this._EOLNormalized
            ? (this._lastVisitedLine.value = this.getLineRawContent(e, this._EOLLength))
            : (this._lastVisitedLine.value = this.getLineRawContent(e).replace(
                /(\r\n|\r|\n)$/,
                "",
              ))),
      this._lastVisitedLine.value
    );
  }
  _getCharCode(e) {
    if (e.remainder === e.node.piece.length) {
      const t = e.node.next();
      if (!t) return 0;
      const n = this._buffers[t.piece.bufferIndex],
        i = this.offsetInBuffer(t.piece.bufferIndex, t.piece.start);
      return n.buffer.charCodeAt(i);
    }
    {
      const t = this._buffers[e.node.piece.bufferIndex],
        n = this.offsetInBuffer(e.node.piece.bufferIndex, e.node.piece.start) + e.remainder;
      return t.buffer.charCodeAt(n);
    }
  }
  getLineCharCode(e, t) {
    const n = this.nodeAt2(e, t + 1);
    return this._getCharCode(n);
  }
  getLineLength(e) {
    if (e === this.getLineCount()) {
      const t = this.getOffsetAt(e, 1);
      return this.getLength() - t;
    }
    return this.getOffsetAt(e + 1, 1) - this.getOffsetAt(e, 1) - this._EOLLength;
  }
  getNearestChunk(e) {
    const t = this.nodeAt(e);
    if (t.remainder === t.node.piece.length) {
      const e = t.node.next();
      if (!e || e === r9) return "";
      const n = this._buffers[e.piece.bufferIndex],
        i = this.offsetInBuffer(e.piece.bufferIndex, e.piece.start);
      return n.buffer.substring(i, i + e.piece.length);
    }
    {
      const e = this._buffers[t.node.piece.bufferIndex],
        n = this.offsetInBuffer(t.node.piece.bufferIndex, t.node.piece.start),
        i = n + t.remainder,
        r = n + t.node.piece.length;
      return e.buffer.substring(i, r);
    }
  }
  findMatchesInNode(e, t, n, i, r, o, s, a, l, c, d) {
    const u = this._buffers[e.piece.bufferIndex],
      h = this.offsetInBuffer(e.piece.bufferIndex, e.piece.start),
      g = this.offsetInBuffer(e.piece.bufferIndex, r),
      p = this.offsetInBuffer(e.piece.bufferIndex, o);
    let f;
    const m = { line: 0, column: 0 };
    let _, v;
    t._wordSeparators
      ? ((_ = u.buffer.substring(g, p)), (v = (e) => e + g), t.reset(0))
      : ((_ = u.buffer), (v = (e) => e), t.reset(g));
    do {
      if (((f = t.next(_)), f)) {
        if (v(f.index) >= p) return c;
        this.positionInBuffer(e, v(f.index) - h, m);
        const t = this.getLineFeedCnt(e.piece.bufferIndex, r, m),
          o = m.line === r.line ? m.column - r.column + i : m.column + 1,
          s = o + f[0].length;
        if (((d[c++] = v9(new YH(n + t, o, n + t, s), f, a)), v(f.index) + f[0].length >= p))
          return c;
        if (c >= l) return c;
      }
    } while (f);
    return c;
  }
  findMatchesLineByLine(e, t, n, i) {
    const r = [];
    let o = 0;
    const s = new w9(t.wordSeparators, t.regex);
    let a = this.nodeAt2(e.startLineNumber, e.startColumn);
    if (null === a) return [];
    const l = this.nodeAt2(e.endLineNumber, e.endColumn);
    if (null === l) return [];
    let c = this.positionInBuffer(a.node, a.remainder);
    const d = this.positionInBuffer(l.node, l.remainder);
    if (a.node === l.node)
      return (
        this.findMatchesInNode(a.node, s, e.startLineNumber, e.startColumn, c, d, t, n, i, o, r),
        r
      );
    let u = e.startLineNumber,
      h = a.node;
    for (; h !== l.node; ) {
      const l = this.getLineFeedCnt(h.piece.bufferIndex, c, h.piece.end);
      if (l >= 1) {
        const a = this._buffers[h.piece.bufferIndex].lineStarts,
          d = this.offsetInBuffer(h.piece.bufferIndex, h.piece.start),
          g = a[c.line + l],
          p = u === e.startLineNumber ? e.startColumn : 1;
        if (
          ((o = this.findMatchesInNode(
            h,
            s,
            u,
            p,
            c,
            this.positionInBuffer(h, g - d),
            t,
            n,
            i,
            o,
            r,
          )),
          o >= i)
        )
          return r;
        u += l;
      }
      const d = u === e.startLineNumber ? e.startColumn - 1 : 0;
      if (u === e.endLineNumber) {
        const a = this.getLineContent(u).substring(d, e.endColumn - 1);
        return ((o = this._findMatchesInLine(t, s, a, e.endLineNumber, d, o, r, n, i)), r);
      }
      if (
        ((o = this._findMatchesInLine(t, s, this.getLineContent(u).substr(d), u, d, o, r, n, i)),
        o >= i)
      )
        return r;
      (u++,
        (a = this.nodeAt2(u, 1)),
        (h = a.node),
        (c = this.positionInBuffer(a.node, a.remainder)));
    }
    if (u === e.endLineNumber) {
      const a = u === e.startLineNumber ? e.startColumn - 1 : 0,
        l = this.getLineContent(u).substring(a, e.endColumn - 1);
      return ((o = this._findMatchesInLine(t, s, l, e.endLineNumber, a, o, r, n, i)), r);
    }
    const g = u === e.startLineNumber ? e.startColumn : 1;
    return ((o = this.findMatchesInNode(l.node, s, u, g, c, d, t, n, i, o, r)), r);
  }
  _findMatchesInLine(e, t, n, i, r, o, s, a, l) {
    const c = e.wordSeparators;
    if (!a && e.simpleSearch) {
      const t = e.simpleSearch,
        a = t.length,
        d = n.length;
      let u = -a;
      for (; -1 !== (u = n.indexOf(t, u + a)); )
        if (
          (!c || x9(c, n, d, u, a)) &&
          ((s[o++] = new Xz(new YH(i, u + 1 + r, i, u + 1 + a + r), null)), o >= l)
        )
          return o;
      return o;
    }
    let d;
    t.reset(0);
    do {
      if (
        ((d = t.next(n)),
        d &&
          ((s[o++] = v9(new YH(i, d.index + 1 + r, i, d.index + 1 + d[0].length + r), d, a)),
          o >= l))
      )
        return o;
    } while (d);
    return o;
  }
  insert(e, t, n = !1) {
    if (
      ((this._EOLNormalized = this._EOLNormalized && n),
      (this._lastVisitedLine.lineNumber = 0),
      (this._lastVisitedLine.value = ""),
      this.root !== r9)
    ) {
      const { node: n, remainder: i, nodeStartOffset: r } = this.nodeAt(e),
        o = n.piece,
        s = o.bufferIndex,
        a = this.positionInBuffer(n, i);
      if (
        0 === n.piece.bufferIndex &&
        o.end.line === this._lastChangeBufferPos.line &&
        o.end.column === this._lastChangeBufferPos.column &&
        r + o.length === e &&
        t.length < C9
      )
        return (this.appendToNode(n, t), void this.computeBufferMetadata());
      if (r === e) (this.insertContentToNodeLeft(t, n), this._searchCache.validate(e));
      else if (r + n.piece.length > e) {
        const e = [];
        let r = new N9(
          o.bufferIndex,
          a,
          o.end,
          this.getLineFeedCnt(o.bufferIndex, a, o.end),
          this.offsetInBuffer(s, o.end) - this.offsetInBuffer(s, a),
        );
        if (this.shouldCheckCRLF() && this.endWithCR(t)) {
          if (10 === this.nodeCharCodeAt(n, i)) {
            const e = { line: r.start.line + 1, column: 0 };
            ((r = new N9(
              r.bufferIndex,
              e,
              r.end,
              this.getLineFeedCnt(r.bufferIndex, e, r.end),
              r.length - 1,
            )),
              (t += "\n"));
          }
        }
        if (this.shouldCheckCRLF() && this.startWithLF(t)) {
          if (13 === this.nodeCharCodeAt(n, i - 1)) {
            const r = this.positionInBuffer(n, i - 1);
            (this.deleteNodeTail(n, r), (t = "\r" + t), 0 === n.piece.length && e.push(n));
          } else this.deleteNodeTail(n, a);
        } else this.deleteNodeTail(n, a);
        const l = this.createNewPieces(t);
        r.length > 0 && this.rbInsertRight(n, r);
        let c = n;
        for (let t = 0; t < l.length; t++) c = this.rbInsertRight(c, l[t]);
        this.deleteNodes(e);
      } else this.insertContentToNodeRight(t, n);
    } else {
      const e = this.createNewPieces(t);
      let n = this.rbInsertLeft(null, e[0]);
      for (let t = 1; t < e.length; t++) n = this.rbInsertRight(n, e[t]);
    }
    this.computeBufferMetadata();
  }
  delete(e, t) {
    if (
      ((this._lastVisitedLine.lineNumber = 0),
      (this._lastVisitedLine.value = ""),
      t <= 0 || this.root === r9)
    )
      return;
    const n = this.nodeAt(e),
      i = this.nodeAt(e + t),
      r = n.node,
      o = i.node;
    if (r === o) {
      const o = this.positionInBuffer(r, n.remainder),
        s = this.positionInBuffer(r, i.remainder);
      if (n.nodeStartOffset === e) {
        if (t === r.piece.length) {
          const e = r.next();
          return (h9(this, r), this.validateCRLFWithPrevNode(e), void this.computeBufferMetadata());
        }
        return (
          this.deleteNodeHead(r, s),
          this._searchCache.validate(e),
          this.validateCRLFWithPrevNode(r),
          void this.computeBufferMetadata()
        );
      }
      return n.nodeStartOffset + r.piece.length === e + t
        ? (this.deleteNodeTail(r, o),
          this.validateCRLFWithNextNode(r),
          void this.computeBufferMetadata())
        : (this.shrinkNode(r, o, s), void this.computeBufferMetadata());
    }
    const s = [],
      a = this.positionInBuffer(r, n.remainder);
    (this.deleteNodeTail(r, a), this._searchCache.validate(e), 0 === r.piece.length && s.push(r));
    const l = this.positionInBuffer(o, i.remainder);
    (this.deleteNodeHead(o, l), 0 === o.piece.length && s.push(o));
    for (let d = r.next(); d !== r9 && d !== o; d = d.next()) s.push(d);
    const c = 0 === r.piece.length ? r.prev() : r;
    (this.deleteNodes(s), this.validateCRLFWithNextNode(c), this.computeBufferMetadata());
  }
  insertContentToNodeLeft(e, t) {
    const n = [];
    if (this.shouldCheckCRLF() && this.endWithCR(e) && this.startWithLF(t)) {
      const i = t.piece,
        r = { line: i.start.line + 1, column: 0 },
        o = new N9(
          i.bufferIndex,
          r,
          i.end,
          this.getLineFeedCnt(i.bufferIndex, r, i.end),
          i.length - 1,
        );
      ((t.piece = o), (e += "\n"), p9(this, t, -1, -1), 0 === t.piece.length && n.push(t));
    }
    const i = this.createNewPieces(e);
    let r = this.rbInsertLeft(t, i[i.length - 1]);
    for (let o = i.length - 2; o >= 0; o--) r = this.rbInsertLeft(r, i[o]);
    (this.validateCRLFWithPrevNode(r), this.deleteNodes(n));
  }
  insertContentToNodeRight(e, t) {
    this.adjustCarriageReturnFromNext(e, t) && (e += "\n");
    const n = this.createNewPieces(e),
      i = this.rbInsertRight(t, n[0]);
    let r = i;
    for (let o = 1; o < n.length; o++) r = this.rbInsertRight(r, n[o]);
    this.validateCRLFWithPrevNode(i);
  }
  positionInBuffer(e, t, n) {
    const i = e.piece,
      r = e.piece.bufferIndex,
      o = this._buffers[r].lineStarts,
      s = o[i.start.line] + i.start.column + t;
    let a = i.start.line,
      l = i.end.line,
      c = 0,
      d = 0,
      u = 0;
    for (; a <= l && ((c = (a + (l - a) / 2) | 0), (u = o[c]), c !== l); )
      if (((d = o[c + 1]), s < u)) l = c - 1;
      else {
        if (!(s >= d)) break;
        a = c + 1;
      }
    return n ? ((n.line = c), (n.column = s - u), null) : { line: c, column: s - u };
  }
  getLineFeedCnt(e, t, n) {
    if (0 === n.column) return n.line - t.line;
    const i = this._buffers[e].lineStarts;
    if (n.line === i.length - 1) return n.line - t.line;
    const r = i[n.line + 1],
      o = i[n.line] + n.column;
    if (r > o + 1) return n.line - t.line;
    const s = o - 1;
    return 13 === this._buffers[e].buffer.charCodeAt(s) ? n.line - t.line + 1 : n.line - t.line;
  }
  offsetInBuffer(e, t) {
    return this._buffers[e].lineStarts[t.line] + t.column;
  }
  deleteNodes(e) {
    for (let t = 0; t < e.length; t++) h9(this, e[t]);
  }
  createNewPieces(e) {
    if (e.length > C9) {
      const t = [];
      for (; e.length > C9; ) {
        const n = e.charCodeAt(65534);
        let i;
        13 === n || (n >= 55296 && n <= 56319)
          ? ((i = e.substring(0, 65534)), (e = e.substring(65534)))
          : ((i = e.substring(0, C9)), (e = e.substring(C9)));
        const r = E9(i);
        (t.push(
          new N9(
            this._buffers.length,
            { line: 0, column: 0 },
            { line: r.length - 1, column: i.length - r[r.length - 1] },
            r.length - 1,
            i.length,
          ),
        ),
          this._buffers.push(new L9(i, r)));
      }
      const n = E9(e);
      return (
        t.push(
          new N9(
            this._buffers.length,
            { line: 0, column: 0 },
            { line: n.length - 1, column: e.length - n[n.length - 1] },
            n.length - 1,
            e.length,
          ),
        ),
        this._buffers.push(new L9(e, n)),
        t
      );
    }
    let t = this._buffers[0].buffer.length;
    const n = E9(e, !1);
    let i = this._lastChangeBufferPos;
    if (
      this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 1] === t &&
      0 !== t &&
      this.startWithLF(e) &&
      this.endWithCR(this._buffers[0].buffer)
    ) {
      ((this._lastChangeBufferPos = {
        line: this._lastChangeBufferPos.line,
        column: this._lastChangeBufferPos.column + 1,
      }),
        (i = this._lastChangeBufferPos));
      for (let e = 0; e < n.length; e++) n[e] += t + 1;
      ((this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(n.slice(1))),
        (this._buffers[0].buffer += "_" + e),
        (t += 1));
    } else {
      if (0 !== t) for (let e = 0; e < n.length; e++) n[e] += t;
      ((this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(n.slice(1))),
        (this._buffers[0].buffer += e));
    }
    const r = this._buffers[0].buffer.length,
      o = this._buffers[0].lineStarts.length - 1,
      s = { line: o, column: r - this._buffers[0].lineStarts[o] },
      a = new N9(0, i, s, this.getLineFeedCnt(0, i, s), r - t);
    return ((this._lastChangeBufferPos = s), [a]);
  }
  getLineRawContent(e, t = 0) {
    let n = this.root,
      i = "";
    const r = this._searchCache.get2(e);
    if (r) {
      n = r.node;
      const o = this.getAccumulatedValue(n, e - r.nodeStartLineNumber - 1),
        s = this._buffers[n.piece.bufferIndex].buffer,
        a = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
      if (r.nodeStartLineNumber + n.piece.lineFeedCnt !== e) {
        const i = this.getAccumulatedValue(n, e - r.nodeStartLineNumber);
        return s.substring(a + o, a + i - t);
      }
      i = s.substring(a + o, a + n.piece.length);
    } else {
      let r = 0;
      const o = e;
      for (; n !== r9; )
        if (n.left !== r9 && n.lf_left >= e - 1) n = n.left;
        else {
          if (n.lf_left + n.piece.lineFeedCnt > e - 1) {
            const i = this.getAccumulatedValue(n, e - n.lf_left - 2),
              s = this.getAccumulatedValue(n, e - n.lf_left - 1),
              a = this._buffers[n.piece.bufferIndex].buffer,
              l = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
            return (
              (r += n.size_left),
              this._searchCache.set({
                node: n,
                nodeStartOffset: r,
                nodeStartLineNumber: o - (e - 1 - n.lf_left),
              }),
              a.substring(l + i, l + s - t)
            );
          }
          if (n.lf_left + n.piece.lineFeedCnt === e - 1) {
            const t = this.getAccumulatedValue(n, e - n.lf_left - 2),
              r = this._buffers[n.piece.bufferIndex].buffer,
              o = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
            i = r.substring(o + t, o + n.piece.length);
            break;
          }
          ((e -= n.lf_left + n.piece.lineFeedCnt),
            (r += n.size_left + n.piece.length),
            (n = n.right));
        }
    }
    for (n = n.next(); n !== r9; ) {
      const e = this._buffers[n.piece.bufferIndex].buffer;
      if (n.piece.lineFeedCnt > 0) {
        const r = this.getAccumulatedValue(n, 0),
          o = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
        return ((i += e.substring(o, o + r - t)), i);
      }
      {
        const t = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
        i += e.substr(t, n.piece.length);
      }
      n = n.next();
    }
    return i;
  }
  computeBufferMetadata() {
    let e = this.root,
      t = 1,
      n = 0;
    for (; e !== r9; )
      ((t += e.lf_left + e.piece.lineFeedCnt), (n += e.size_left + e.piece.length), (e = e.right));
    ((this._lineCnt = t), (this._length = n), this._searchCache.validate(this._length));
  }
  getIndexOf(e, t) {
    const n = e.piece,
      i = this.positionInBuffer(e, t),
      r = i.line - n.start.line;
    if (
      this.offsetInBuffer(n.bufferIndex, n.end) - this.offsetInBuffer(n.bufferIndex, n.start) ===
      t
    ) {
      const t = this.getLineFeedCnt(e.piece.bufferIndex, n.start, i);
      if (t !== r) return { index: t, remainder: 0 };
    }
    return { index: r, remainder: i.column };
  }
  getAccumulatedValue(e, t) {
    if (t < 0) return 0;
    const n = e.piece,
      i = this._buffers[n.bufferIndex].lineStarts,
      r = n.start.line + t + 1;
    return r > n.end.line
      ? i[n.end.line] + n.end.column - i[n.start.line] - n.start.column
      : i[r] - i[n.start.line] - n.start.column;
  }
  deleteNodeTail(e, t) {
    const n = e.piece,
      i = n.lineFeedCnt,
      r = this.offsetInBuffer(n.bufferIndex, n.end),
      o = t,
      s = this.offsetInBuffer(n.bufferIndex, o),
      a = this.getLineFeedCnt(n.bufferIndex, n.start, o),
      l = a - i,
      c = s - r,
      d = n.length + c;
    ((e.piece = new N9(n.bufferIndex, n.start, o, a, d)), p9(this, e, c, l));
  }
  deleteNodeHead(e, t) {
    const n = e.piece,
      i = n.lineFeedCnt,
      r = this.offsetInBuffer(n.bufferIndex, n.start),
      o = t,
      s = this.getLineFeedCnt(n.bufferIndex, o, n.end),
      a = s - i,
      l = r - this.offsetInBuffer(n.bufferIndex, o),
      c = n.length + l;
    ((e.piece = new N9(n.bufferIndex, o, n.end, s, c)), p9(this, e, l, a));
  }
  shrinkNode(e, t, n) {
    const i = e.piece,
      r = i.start,
      o = i.end,
      s = i.length,
      a = i.lineFeedCnt,
      l = t,
      c = this.getLineFeedCnt(i.bufferIndex, i.start, l),
      d = this.offsetInBuffer(i.bufferIndex, t) - this.offsetInBuffer(i.bufferIndex, r);
    ((e.piece = new N9(i.bufferIndex, i.start, l, c, d)), p9(this, e, d - s, c - a));
    const u = new N9(
        i.bufferIndex,
        n,
        o,
        this.getLineFeedCnt(i.bufferIndex, n, o),
        this.offsetInBuffer(i.bufferIndex, o) - this.offsetInBuffer(i.bufferIndex, n),
      ),
      h = this.rbInsertRight(e, u);
    this.validateCRLFWithPrevNode(h);
  }
  appendToNode(e, t) {
    this.adjustCarriageReturnFromNext(t, e) && (t += "\n");
    const n = this.shouldCheckCRLF() && this.startWithLF(t) && this.endWithCR(e),
      i = this._buffers[0].buffer.length;
    this._buffers[0].buffer += t;
    const r = E9(t, !1);
    for (let u = 0; u < r.length; u++) r[u] += i;
    if (n) {
      const e = this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 2];
      (this._buffers[0].lineStarts.pop(),
        (this._lastChangeBufferPos = { line: this._lastChangeBufferPos.line - 1, column: i - e }));
    }
    this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(r.slice(1));
    const o = this._buffers[0].lineStarts.length - 1,
      s = { line: o, column: this._buffers[0].buffer.length - this._buffers[0].lineStarts[o] },
      a = e.piece.length + t.length,
      l = e.piece.lineFeedCnt,
      c = this.getLineFeedCnt(0, e.piece.start, s),
      d = c - l;
    ((e.piece = new N9(e.piece.bufferIndex, e.piece.start, s, c, a)),
      (this._lastChangeBufferPos = s),
      p9(this, e, t.length, d));
  }
  nodeAt(e) {
    let t = this.root;
    const n = this._searchCache.get(e);
    if (n)
      return { node: n.node, nodeStartOffset: n.nodeStartOffset, remainder: e - n.nodeStartOffset };
    let i = 0;
    for (; t !== r9; )
      if (t.size_left > e) t = t.left;
      else {
        if (t.size_left + t.piece.length >= e) {
          i += t.size_left;
          const n = { node: t, remainder: e - t.size_left, nodeStartOffset: i };
          return (this._searchCache.set(n), n);
        }
        ((e -= t.size_left + t.piece.length), (i += t.size_left + t.piece.length), (t = t.right));
      }
    return null;
  }
  nodeAt2(e, t) {
    let n = this.root,
      i = 0;
    for (; n !== r9; )
      if (n.left !== r9 && n.lf_left >= e - 1) n = n.left;
      else {
        if (n.lf_left + n.piece.lineFeedCnt > e - 1) {
          const r = this.getAccumulatedValue(n, e - n.lf_left - 2),
            o = this.getAccumulatedValue(n, e - n.lf_left - 1);
          return (
            (i += n.size_left),
            { node: n, remainder: Math.min(r + t - 1, o), nodeStartOffset: i }
          );
        }
        if (n.lf_left + n.piece.lineFeedCnt === e - 1) {
          const r = this.getAccumulatedValue(n, e - n.lf_left - 2);
          if (r + t - 1 <= n.piece.length)
            return { node: n, remainder: r + t - 1, nodeStartOffset: i };
          t -= n.piece.length - r;
          break;
        }
        ((e -= n.lf_left + n.piece.lineFeedCnt),
          (i += n.size_left + n.piece.length),
          (n = n.right));
      }
    for (n = n.next(); n !== r9; ) {
      if (n.piece.lineFeedCnt > 0) {
        const e = this.getAccumulatedValue(n, 0),
          i = this.offsetOfNode(n);
        return { node: n, remainder: Math.min(t - 1, e), nodeStartOffset: i };
      }
      if (n.piece.length >= t - 1) {
        return { node: n, remainder: t - 1, nodeStartOffset: this.offsetOfNode(n) };
      }
      ((t -= n.piece.length), (n = n.next()));
    }
    return null;
  }
  nodeCharCodeAt(e, t) {
    if (e.piece.lineFeedCnt < 1) return -1;
    const n = this._buffers[e.piece.bufferIndex],
      i = this.offsetInBuffer(e.piece.bufferIndex, e.piece.start) + t;
    return n.buffer.charCodeAt(i);
  }
  offsetOfNode(e) {
    if (!e) return 0;
    let t = e.size_left;
    for (; e !== this.root; )
      (e.parent.right === e && (t += e.parent.size_left + e.parent.piece.length), (e = e.parent));
    return t;
  }
  shouldCheckCRLF() {
    return !(this._EOLNormalized && "\n" === this._EOL);
  }
  startWithLF(e) {
    if ("string" == typeof e) return 10 === e.charCodeAt(0);
    if (e === r9 || 0 === e.piece.lineFeedCnt) return !1;
    const t = e.piece,
      n = this._buffers[t.bufferIndex].lineStarts,
      i = t.start.line,
      r = n[i] + t.start.column;
    if (i === n.length - 1) return !1;
    return !(n[i + 1] > r + 1) && 10 === this._buffers[t.bufferIndex].buffer.charCodeAt(r);
  }
  endWithCR(e) {
    return "string" == typeof e
      ? 13 === e.charCodeAt(e.length - 1)
      : e !== r9 && 0 !== e.piece.lineFeedCnt && 13 === this.nodeCharCodeAt(e, e.piece.length - 1);
  }
  validateCRLFWithPrevNode(e) {
    if (this.shouldCheckCRLF() && this.startWithLF(e)) {
      const t = e.prev();
      this.endWithCR(t) && this.fixCRLF(t, e);
    }
  }
  validateCRLFWithNextNode(e) {
    if (this.shouldCheckCRLF() && this.endWithCR(e)) {
      const t = e.next();
      this.startWithLF(t) && this.fixCRLF(e, t);
    }
  }
  fixCRLF(e, t) {
    const n = [],
      i = this._buffers[e.piece.bufferIndex].lineStarts;
    let r;
    r =
      0 === e.piece.end.column
        ? { line: e.piece.end.line - 1, column: i[e.piece.end.line] - i[e.piece.end.line - 1] - 1 }
        : { line: e.piece.end.line, column: e.piece.end.column - 1 };
    const o = e.piece.length - 1,
      s = e.piece.lineFeedCnt - 1;
    ((e.piece = new N9(e.piece.bufferIndex, e.piece.start, r, s, o)),
      p9(this, e, -1, -1),
      0 === e.piece.length && n.push(e));
    const a = { line: t.piece.start.line + 1, column: 0 },
      l = t.piece.length - 1,
      c = this.getLineFeedCnt(t.piece.bufferIndex, a, t.piece.end);
    ((t.piece = new N9(t.piece.bufferIndex, a, t.piece.end, c, l)),
      p9(this, t, -1, -1),
      0 === t.piece.length && n.push(t));
    const d = this.createNewPieces("\r\n");
    this.rbInsertRight(e, d[0]);
    for (let u = 0; u < n.length; u++) h9(this, n[u]);
  }
  adjustCarriageReturnFromNext(e, t) {
    if (this.shouldCheckCRLF() && this.endWithCR(e)) {
      const n = t.next();
      if (this.startWithLF(n)) {
        if (((e += "\n"), 1 === n.piece.length)) h9(this, n);
        else {
          const e = n.piece,
            t = { line: e.start.line + 1, column: 0 },
            i = e.length - 1,
            r = this.getLineFeedCnt(e.bufferIndex, t, e.end);
          ((n.piece = new N9(e.bufferIndex, t, e.end, r, i)), p9(this, n, -1, -1));
        }
        return !0;
      }
    }
    return !1;
  }
  iterate(e, t) {
    if (e === r9) return t(r9);
    const n = this.iterate(e.left, t);
    return n ? t(e) && this.iterate(e.right, t) : n;
  }
  getNodeContent(e) {
    if (e === r9) return "";
    const t = this._buffers[e.piece.bufferIndex],
      n = e.piece,
      i = this.offsetInBuffer(n.bufferIndex, n.start),
      r = this.offsetInBuffer(n.bufferIndex, n.end);
    return t.buffer.substring(i, r);
  }
  getPieceContent(e) {
    const t = this._buffers[e.bufferIndex],
      n = this.offsetInBuffer(e.bufferIndex, e.start),
      i = this.offsetInBuffer(e.bufferIndex, e.end);
    return t.buffer.substring(n, i);
  }
  rbInsertRight(e, t) {
    const n = new i9(t, 1);
    ((n.left = r9), (n.right = r9), (n.parent = r9), (n.size_left = 0), (n.lf_left = 0));
    if (this.root === r9) ((this.root = n), (n.color = 0));
    else if (e.right === r9) ((e.right = n), (n.parent = e));
    else {
      const t = o9(e.right);
      ((t.left = n), (n.parent = t));
    }
    return (g9(this, n), n);
  }
  rbInsertLeft(e, t) {
    const n = new i9(t, 1);
    if (
      ((n.left = r9),
      (n.right = r9),
      (n.parent = r9),
      (n.size_left = 0),
      (n.lf_left = 0),
      this.root === r9)
    )
      ((this.root = n), (n.color = 0));
    else if (e.left === r9) ((e.left = n), (n.parent = e));
    else {
      const t = s9(e.left);
      ((t.right = n), (n.parent = t));
    }
    return (g9(this, n), n);
  }
}
class R9 extends PO {
  constructor(e, t, n, i, r, o, s) {
    (super(),
      (this._onDidChangeContent = this._register(new QO())),
      (this._BOM = t),
      (this._mightContainNonBasicASCII = !o),
      (this._mightContainRTL = i),
      (this._mightContainUnusualLineTerminators = r),
      (this._pieceTree = new I9(e, n, s)));
  }
  mightContainRTL() {
    return this._mightContainRTL;
  }
  mightContainUnusualLineTerminators() {
    return this._mightContainUnusualLineTerminators;
  }
  resetMightContainUnusualLineTerminators() {
    this._mightContainUnusualLineTerminators = !1;
  }
  mightContainNonBasicASCII() {
    return this._mightContainNonBasicASCII;
  }
  getBOM() {
    return this._BOM;
  }
  getEOL() {
    return this._pieceTree.getEOL();
  }
  createSnapshot(e) {
    return this._pieceTree.createSnapshot(e ? this._BOM : "");
  }
  getOffsetAt(e, t) {
    return this._pieceTree.getOffsetAt(e, t);
  }
  getPositionAt(e) {
    return this._pieceTree.getPositionAt(e);
  }
  getRangeAt(e, t) {
    const n = e + t,
      i = this.getPositionAt(e),
      r = this.getPositionAt(n);
    return new YH(i.lineNumber, i.column, r.lineNumber, r.column);
  }
  getValueInRange(e, t = 0) {
    if (e.isEmpty()) return "";
    const n = this._getEndOfLine(t);
    return this._pieceTree.getValueInRange(e, n);
  }
  getValueLengthInRange(e, t = 0) {
    if (e.isEmpty()) return 0;
    if (e.startLineNumber === e.endLineNumber) return e.endColumn - e.startColumn;
    const n = this.getOffsetAt(e.startLineNumber, e.startColumn),
      i = this.getOffsetAt(e.endLineNumber, e.endColumn);
    let r = 0;
    const o = this._getEndOfLine(t),
      s = this.getEOL();
    if (o.length !== s.length) {
      r = (o.length - s.length) * (e.endLineNumber - e.startLineNumber);
    }
    return i - n + r;
  }
  getCharacterCountInRange(e, t = 0) {
    if (this._mightContainNonBasicASCII) {
      let n = 0;
      const i = e.startLineNumber,
        r = e.endLineNumber;
      for (let t = i; t <= r; t++) {
        const o = this.getLineContent(t),
          s = t === i ? e.startColumn - 1 : 0,
          a = t === r ? e.endColumn - 1 : o.length;
        for (let e = s; e < a; e++) uA(o.charCodeAt(e)) ? ((n += 1), (e += 1)) : (n += 1);
      }
      return ((n += this._getEndOfLine(t).length * (r - i)), n);
    }
    return this.getValueLengthInRange(e, t);
  }
  getNearestChunk(e) {
    return this._pieceTree.getNearestChunk(e);
  }
  getLength() {
    return this._pieceTree.getLength();
  }
  getLineCount() {
    return this._pieceTree.getLineCount();
  }
  getLinesContent() {
    return this._pieceTree.getLinesContent();
  }
  getLineContent(e) {
    return this._pieceTree.getLineContent(e);
  }
  getLineCharCode(e, t) {
    return this._pieceTree.getLineCharCode(e, t);
  }
  getLineLength(e) {
    return this._pieceTree.getLineLength(e);
  }
  getLineFirstNonWhitespaceColumn(e) {
    const t = YM(this.getLineContent(e));
    return -1 === t ? 0 : t + 1;
  }
  getLineLastNonWhitespaceColumn(e) {
    const t = QM(this.getLineContent(e));
    return -1 === t ? 0 : t + 2;
  }
  _getEndOfLine(e) {
    switch (e) {
      case 1:
        return "\n";
      case 2:
        return "\r\n";
      case 0:
        return this.getEOL();
      default:
        throw new Error("Unknown EOL preference");
    }
  }
  setEOL(e) {
    this._pieceTree.setEOL(e);
  }
  applyEdits(e, t, n) {
    let i = this._mightContainRTL,
      r = this._mightContainUnusualLineTerminators,
      o = this._mightContainNonBasicASCII,
      s = !0,
      a = [];
    for (let p = 0; p < e.length; p++) {
      const t = e[p];
      s && t._isTracked && (s = !1);
      const n = t.range;
      if (t.text) {
        let e = !0;
        (o || ((e = !wA(t.text)), (o = e)),
          !i && e && (i = yA(t.text)),
          !r && e && (r = SA(t.text)));
      }
      let l = "",
        c = 0,
        d = 0,
        u = 0;
      if (t.text) {
        let e;
        [c, d, u, e] = Q3(t.text);
        const n = this.getEOL();
        l = 0 === e || e === ("\r\n" === n ? 2 : 1) ? t.text : t.text.replace(/\r\n|\r|\n/g, n);
      }
      a[p] = {
        sortIndex: p,
        identifier: t.identifier || null,
        range: n,
        rangeOffset: this.getOffsetAt(n.startLineNumber, n.startColumn),
        rangeLength: this.getValueLengthInRange(n),
        text: l,
        eolCount: c,
        firstLineLength: d,
        lastLineLength: u,
        forceMoveMarkers: Boolean(t.forceMoveMarkers),
        isAutoWhitespaceEdit: t.isAutoWhitespaceEdit || !1,
      };
    }
    a.sort(R9._sortOpsAscending);
    let l = !1;
    for (let p = 0, f = a.length - 1; p < f; p++) {
      const e = a[p].range.getEndPosition(),
        t = a[p + 1].range.getStartPosition();
      if (t.isBeforeOrEqual(e)) {
        if (t.isBefore(e)) throw new Error("Overlapping ranges are not allowed!");
        l = !0;
      }
    }
    s && (a = this._reduceOperations(a));
    const c = n || t ? R9._getInverseEditRanges(a) : [],
      d = [];
    if (t)
      for (let p = 0; p < a.length; p++) {
        const e = a[p],
          t = c[p];
        if (e.isAutoWhitespaceEdit && e.range.isEmpty())
          for (let n = t.startLineNumber; n <= t.endLineNumber; n++) {
            let i = "";
            (n === t.startLineNumber &&
              ((i = this.getLineContent(e.range.startLineNumber)), -1 !== YM(i))) ||
              d.push({ lineNumber: n, oldContent: i });
          }
      }
    let u = null;
    if (n) {
      let e = 0;
      u = [];
      for (let t = 0; t < a.length; t++) {
        const n = a[t],
          i = c[t],
          r = this.getValueInRange(n.range),
          o = n.rangeOffset + e;
        ((e += n.text.length - r.length),
          (u[t] = {
            sortIndex: n.sortIndex,
            identifier: n.identifier,
            range: i,
            text: r,
            textChange: new u8(n.rangeOffset, r, o, n.text),
          }));
      }
      l || u.sort((e, t) => e.sortIndex - t.sortIndex);
    }
    ((this._mightContainRTL = i),
      (this._mightContainUnusualLineTerminators = r),
      (this._mightContainNonBasicASCII = o));
    const h = this._doApplyEdits(a);
    let g = null;
    if (t && d.length > 0) {
      (d.sort((e, t) => t.lineNumber - e.lineNumber), (g = []));
      for (let e = 0, t = d.length; e < t; e++) {
        const t = d[e].lineNumber;
        if (e > 0 && d[e - 1].lineNumber === t) continue;
        const n = d[e].oldContent,
          i = this.getLineContent(t);
        0 !== i.length && i !== n && -1 === YM(i) && g.push(t);
      }
    }
    return (this._onDidChangeContent.fire(), new eU(u, h, g));
  }
  _reduceOperations(e) {
    return e.length < 1e3 ? e : [this._toSingleEditOperation(e)];
  }
  _toSingleEditOperation(e) {
    let t = !1;
    const n = e[0].range,
      i = e[e.length - 1].range,
      r = new YH(n.startLineNumber, n.startColumn, i.endLineNumber, i.endColumn);
    let o = n.startLineNumber,
      s = n.startColumn;
    const a = [];
    for (let h = 0, g = e.length; h < g; h++) {
      const n = e[h],
        i = n.range;
      ((t = t || n.forceMoveMarkers),
        a.push(this.getValueInRange(new YH(o, s, i.startLineNumber, i.startColumn))),
        n.text.length > 0 && a.push(n.text),
        (o = i.endLineNumber),
        (s = i.endColumn));
    }
    const l = a.join(""),
      [c, d, u] = Q3(l);
    return {
      sortIndex: 0,
      identifier: e[0].identifier,
      range: r,
      rangeOffset: this.getOffsetAt(r.startLineNumber, r.startColumn),
      rangeLength: this.getValueLengthInRange(r, 0),
      text: l,
      eolCount: c,
      firstLineLength: d,
      lastLineLength: u,
      forceMoveMarkers: t,
      isAutoWhitespaceEdit: !1,
    };
  }
  _doApplyEdits(e) {
    e.sort(R9._sortOpsDescending);
    const t = [];
    for (let n = 0; n < e.length; n++) {
      const i = e[n],
        r = i.range.startLineNumber,
        o = i.range.startColumn,
        s = i.range.endLineNumber,
        a = i.range.endColumn;
      if (r === s && o === a && 0 === i.text.length) continue;
      i.text
        ? (this._pieceTree.delete(i.rangeOffset, i.rangeLength),
          this._pieceTree.insert(i.rangeOffset, i.text, !0))
        : this._pieceTree.delete(i.rangeOffset, i.rangeLength);
      const l = new YH(r, o, s, a);
      t.push({
        range: l,
        rangeLength: i.rangeLength,
        text: i.text,
        rangeOffset: i.rangeOffset,
        forceMoveMarkers: i.forceMoveMarkers,
      });
    }
    return t;
  }
  findMatchesLineByLine(e, t, n, i) {
    return this._pieceTree.findMatchesLineByLine(e, t, n, i);
  }
  static _getInverseEditRanges(e) {
    const t = [];
    let n = 0,
      i = 0,
      r = null;
    for (let o = 0, s = e.length; o < s; o++) {
      const s = e[o];
      let a, l, c;
      if (
        (r
          ? r.range.endLineNumber === s.range.startLineNumber
            ? ((a = n), (l = i + (s.range.startColumn - r.range.endColumn)))
            : ((a = n + (s.range.startLineNumber - r.range.endLineNumber)),
              (l = s.range.startColumn))
          : ((a = s.range.startLineNumber), (l = s.range.startColumn)),
        s.text.length > 0)
      ) {
        const e = s.eolCount + 1;
        c =
          1 === e
            ? new YH(a, l, a, l + s.firstLineLength)
            : new YH(a, l, a + e - 1, s.lastLineLength + 1);
      } else c = new YH(a, l, a, l);
      ((n = c.endLineNumber), (i = c.endColumn), t.push(c), (r = s));
    }
    return t;
  }
  static _sortOpsAscending(e, t) {
    const n = YH.compareRangesUsingEnds(e.range, t.range);
    return 0 === n ? e.sortIndex - t.sortIndex : n;
  }
  static _sortOpsDescending(e, t) {
    const n = YH.compareRangesUsingEnds(e.range, t.range);
    return 0 === n ? t.sortIndex - e.sortIndex : -n;
  }
}
class O9 {
  constructor(e, t, n, i, r, o, s, a, l) {
    ((this._chunks = e),
      (this._bom = t),
      (this._cr = n),
      (this._lf = i),
      (this._crlf = r),
      (this._containsRTL = o),
      (this._containsUnusualLineTerminators = s),
      (this._isBasicASCII = a),
      (this._normalizeEOL = l));
  }
  _getEOL(e) {
    const t = this._cr + this._lf + this._crlf,
      n = this._cr + this._crlf;
    return 0 === t ? (1 === e ? "\n" : "\r\n") : n > t / 2 ? "\r\n" : "\n";
  }
  create(e) {
    const t = this._getEOL(e),
      n = this._chunks;
    if (
      this._normalizeEOL &&
      (("\r\n" === t && (this._cr > 0 || this._lf > 0)) ||
        ("\n" === t && (this._cr > 0 || this._crlf > 0)))
    )
      for (let r = 0, o = n.length; r < o; r++) {
        const e = n[r].buffer.replace(/\r\n|\r|\n/g, t),
          i = E9(e);
        n[r] = new L9(e, i);
      }
    const i = new R9(
      n,
      this._bom,
      t,
      this._containsRTL,
      this._containsUnusualLineTerminators,
      this._isBasicASCII,
      this._normalizeEOL,
    );
    return { textBuffer: i, disposable: i };
  }
}
class M9 {
  constructor() {
    ((this.chunks = []),
      (this.BOM = ""),
      (this._hasPreviousChar = !1),
      (this._previousChar = 0),
      (this._tmpLineStarts = []),
      (this.cr = 0),
      (this.lf = 0),
      (this.crlf = 0),
      (this.containsRTL = !1),
      (this.containsUnusualLineTerminators = !1),
      (this.isBasicASCII = !0));
  }
  acceptChunk(e) {
    if (0 === e.length) return;
    0 === this.chunks.length && LA(e) && ((this.BOM = NA), (e = e.substr(1)));
    const t = e.charCodeAt(e.length - 1);
    13 === t || (t >= 55296 && t <= 56319)
      ? (this._acceptChunk1(e.substr(0, e.length - 1), !1),
        (this._hasPreviousChar = !0),
        (this._previousChar = t))
      : (this._acceptChunk1(e, !1), (this._hasPreviousChar = !1), (this._previousChar = t));
  }
  _acceptChunk1(e, t) {
    (t || 0 !== e.length) &&
      (this._hasPreviousChar
        ? this._acceptChunk2(String.fromCharCode(this._previousChar) + e)
        : this._acceptChunk2(e));
  }
  _acceptChunk2(e) {
    const t = (function (e, t) {
      ((e.length = 0), (e[0] = 0));
      let n = 1,
        i = 0,
        r = 0,
        o = 0,
        s = !0;
      for (let l = 0, c = t.length; l < c; l++) {
        const a = t.charCodeAt(l);
        13 === a
          ? l + 1 < c && 10 === t.charCodeAt(l + 1)
            ? (o++, (e[n++] = l + 2), l++)
            : (i++, (e[n++] = l + 1))
          : 10 === a
            ? (r++, (e[n++] = l + 1))
            : s && 9 !== a && (a < 32 || a > 126) && (s = !1);
      }
      const a = new k9(S9(e), i, r, o, s);
      return ((e.length = 0), a);
    })(this._tmpLineStarts, e);
    (this.chunks.push(new L9(e, t.lineStarts)),
      (this.cr += t.cr),
      (this.lf += t.lf),
      (this.crlf += t.crlf),
      t.isBasicASCII ||
        ((this.isBasicASCII = !1),
        this.containsRTL || (this.containsRTL = yA(e)),
        this.containsUnusualLineTerminators || (this.containsUnusualLineTerminators = SA(e))));
  }
  finish(e = !0) {
    return (
      this._finish(),
      new O9(
        this.chunks,
        this.BOM,
        this.cr,
        this.lf,
        this.crlf,
        this.containsRTL,
        this.containsUnusualLineTerminators,
        this.isBasicASCII,
        e,
      )
    );
  }
  _finish() {
    if ((0 === this.chunks.length && this._acceptChunk1("", !0), this._hasPreviousChar)) {
      this._hasPreviousChar = !1;
      const e = this.chunks[this.chunks.length - 1];
      e.buffer += String.fromCharCode(this._previousChar);
      const t = E9(e.buffer);
      ((e.lineStarts = t), 13 === this._previousChar && this.cr++);
    }
  }
}
function A9(e, t = Tj.ofCaller()) {
  return "string" == typeof e ? new P9(e, void 0, t) : new P9(void 0, e, t);
}
class P9 extends Kj {
  get debugName() {
    return new Pj(this._owner, this._debugName, void 0).getDebugName(this) ?? "Observable Signal";
  }
  toString() {
    return this.debugName;
  }
  constructor(e, t, n) {
    (super(n), (this._debugName = e), (this._owner = t));
  }
  trigger(e, t) {
    if (e) for (const n of this._observers) (e.updateObserver(n, this), n.handleChange(this, t));
    else
      cF(
        (e) => {
          this.trigger(e, t);
        },
        () => `Trigger signal ${this.debugName}`,
      );
  }
  get() {}
}
class j9 extends Kj {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? "LazyObservableValue";
  }
  constructor(e, t, n, i) {
    (super(i),
      (this._debugNameData = e),
      (this._equalityComparator = n),
      (this._isUpToDate = !0),
      (this._deltas = []),
      (this._updateCounter = 0),
      (this._value = t));
  }
  get() {
    return (this._update(), this._value);
  }
  _update() {
    if (!this._isUpToDate)
      if (((this._isUpToDate = !0), this._deltas.length > 0)) {
        for (const e of this._deltas) {
          Lj()?.handleObservableUpdated(this, {
            change: e,
            didChange: !0,
            oldValue: "(unknown)",
            newValue: this._value,
            hadValue: !0,
          });
          for (const t of this._observers) t.handleChange(this, e);
        }
        this._deltas.length = 0;
      } else {
        Lj()?.handleObservableUpdated(this, {
          change: void 0,
          didChange: !0,
          oldValue: "(unknown)",
          newValue: this._value,
          hadValue: !0,
        });
        for (const e of this._observers) e.handleChange(this, void 0);
      }
  }
  _beginUpdate() {
    if ((this._updateCounter++, 1 === this._updateCounter))
      for (const e of this._observers) e.beginUpdate(this);
  }
  _endUpdate() {
    if ((this._updateCounter--, 0 === this._updateCounter)) {
      this._update();
      const e = [...this._observers];
      for (const t of e) t.endUpdate(this);
    }
  }
  addObserver(e) {
    const t = !this._observers.has(e) && this._updateCounter > 0;
    (super.addObserver(e), t && e.beginUpdate(this));
  }
  removeObserver(e) {
    const t = this._observers.has(e) && this._updateCounter > 0;
    (super.removeObserver(e), t && e.endUpdate(this));
  }
  set(e, t, n) {
    if (void 0 === n && this._equalityComparator(this._value, e)) return;
    let i;
    t ||
      (t = i =
        new hF(
          () => {},
          () => `Setting ${this.debugName}`,
        ));
    try {
      if (
        ((this._isUpToDate = !1),
        this._setValue(e),
        void 0 !== n && this._deltas.push(n),
        t.updateObserver(
          {
            beginUpdate: () => this._beginUpdate(),
            endUpdate: () => this._endUpdate(),
            handleChange: (e, t) => {},
            handlePossibleChange: (e) => {},
          },
          this,
        ),
        this._updateCounter > 1)
      )
        for (const e of this._observers) e.handlePossibleChange(this);
    } finally {
      i && i.finish();
    }
  }
  toString() {
    return `${this.debugName}: ${this._value}`;
  }
  _setValue(e) {
    this._value = e;
  }
}
function F9(e, t, n = Tj.ofCaller()) {
  return e.lazy
    ? new j9(new Pj(e.owner, e.debugName, void 0), t, e.equalsFn ?? Rj, n)
    : new DF(new Pj(e.owner, e.debugName, void 0), t, e.equalsFn ?? Rj, n);
}
class B9 {
  constructor() {
    ((this._onDidChangeVisibleRanges = new QO()),
      (this.onDidChangeVisibleRanges = this._onDidChangeVisibleRanges.event),
      (this._views = new Set()),
      (this._viewsChanged = A9(this)),
      (this.visibleLineRanges = Jj({ owner: this, equalsFn: Oj((e, t) => e.equals(t)) }, (e) => {
        this._viewsChanged.read(e);
        return Q5.joinMany([...this._views].map((t) => t.state.read(e)?.visibleLineRanges ?? []));
      })));
  }
  attachView() {
    const e = new W9((t) => {
      this._onDidChangeVisibleRanges.fire({ view: e, state: t });
    });
    return (this._views.add(e), this._viewsChanged.trigger(void 0), e);
  }
  detachView(e) {
    (this._views.delete(e),
      this._onDidChangeVisibleRanges.fire({ view: e, state: void 0 }),
      this._viewsChanged.trigger(void 0));
  }
}
class V9 {
  constructor(e, t) {
    ((this.visibleLineRanges = e), (this.stabilized = t));
  }
  equals(e) {
    return (
      this === e ||
      (!!XP(this.visibleLineRanges, e.visibleLineRanges, (e, t) => e.equals(t)) &&
        this.stabilized === e.stabilized)
    );
  }
}
class W9 {
  get state() {
    return this._state;
  }
  constructor(e) {
    ((this.handleStateChange = e),
      (this._state = F9({ owner: this, equalsFn: Mj((e, t) => e.equals(t)) }, void 0)));
  }
  setVisibleLines(e, t) {
    const n = e.map((e) => new Q5(e.startLineNumber, e.endLineNumber + 1)),
      i = new V9(n, t);
    (this._state.set(i, void 0, void 0), this.handleStateChange(i));
  }
}
class H9 extends PO {
  get lineRanges() {
    return this._lineRanges;
  }
  constructor(e) {
    (super(),
      (this._refreshTokens = e),
      (this.runner = this._register(new EM(() => this.update(), 50))),
      (this._computedLineRanges = []),
      (this._lineRanges = []));
  }
  update() {
    XP(this._computedLineRanges, this._lineRanges, (e, t) => e.equals(t)) ||
      ((this._computedLineRanges = this._lineRanges), this._refreshTokens());
  }
  handleStateChange(e) {
    ((this._lineRanges = e.visibleLineRanges),
      e.stabilized ? (this.runner.cancel(), this.update()) : this.runner.schedule());
  }
}
class z9 extends PO {
  get backgroundTokenizationState() {
    return this._backgroundTokenizationState;
  }
  constructor(e, t) {
    (super(),
      (this._languageIdCodec = e),
      (this._textModel = t),
      (this._onDidChangeTokens = this._register(new QO())),
      (this.onDidChangeTokens = this._onDidChangeTokens.event));
  }
  tokenizeIfCheap(e) {
    this.isCheapToTokenize(e) && this.forceTokenization(e);
  }
}
function U9(e, t) {
  const n = e.gotoNextSibling(),
    i = t.gotoNextSibling();
  if (n !== i) throw new Error("Trees are out of sync");
  return n && i;
}
function $9(e, t) {
  const n = e.gotoParent(),
    i = t.gotoParent();
  if (n !== i) throw new Error("Trees are out of sync");
  return n && i;
}
function q9(e, t, n) {
  const i = e.gotoFirstChild(),
    r = t.gotoFirstChild();
  if (i !== r) throw new Error("Trees are out of sync");
  if (0 === n) return i && r;
  for (let o = 1; o <= n; o++) {
    const n = e.gotoNextSibling(),
      i = t.gotoNextSibling();
    if (n !== i) throw new Error("Trees are out of sync");
    if (!n || !i) return !1;
  }
  return i && r;
}
function K9(e, t) {
  do {
    if (e.currentNode.nextSibling) return U9(e, t);
    e.currentNode.parent && $9(e, t);
  } while (e.currentNode.nextSibling || e.currentNode.parent);
  return !1;
}
function G9(e, t) {
  const n = t.walk();
  n.resetTo(e);
  const i = e.currentNode;
  do {
    if (n.currentNode.previousSibling && n.currentNode.endIndex - n.currentNode.startIndex !== 0)
      n.gotoPreviousSibling();
    else {
      for (; !n.currentNode.previousSibling && n.currentNode.parent; ) n.gotoParent();
      n.gotoPreviousSibling();
    }
  } while (
    n.currentNode.endIndex > i.startIndex &&
    (n.currentNode.parent || n.currentNode.previousSibling) &&
    n.currentNode.id !== i.id
  );
  return n.currentNode.id !== i.id && n.currentNode.endIndex <= i.startIndex
    ? n.currentNode
    : void 0;
}
var Z9 = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let Y9 = class extends PO {
  constructor(e, t, n, i, r, o, s) {
    (super(),
      (this.languageId = e),
      (this._ranges = t),
      (this._parser = n),
      (this._parserClass = i),
      (this.textModel = r),
      (this._logService = o),
      (this._telemetryService = s),
      (this._tree = LF(this, void 0)),
      (this.tree = this._tree),
      (this._treeLastParsedVersion = LF(this, -1)),
      (this.treeLastParsedVersion = this._treeLastParsedVersion),
      (this._onDidChangeContentQueue = new CM()),
      (this._tree = LF(this, void 0)),
      (this.tree = this._tree),
      this._register(
        MO(() => {
          (this._tree.get()?.delete(),
            this._lastFullyParsed?.delete(),
            this._lastFullyParsedWithEdits?.delete(),
            this._parser.delete());
        }),
      ),
      this.handleContentChange(void 0, this._ranges));
  }
  handleContentChange(e, t) {
    const n = this.textModel.getVersionId();
    let i = [];
    (t && (i = this._setRanges(t)),
      e && this._applyEdits(e.changes),
      this._onDidChangeContentQueue.clearPending(),
      this._onDidChangeContentQueue.schedule(async () => {
        if (this._store.isDisposed) return;
        const e = this._lastFullyParsed;
        let t;
        this._lastFullyParsedWithEdits &&
          this._lastFullyParsed &&
          (t = this._findChangedNodes(this._lastFullyParsedWithEdits, this._lastFullyParsed));
        const r = await this._parseAndUpdateTree(n);
        if (r) {
          let o;
          (t
            ? e && t && (o = this._findTreeChanges(r, t, i))
            : this._ranges &&
              (o = this._ranges.map((e) => ({
                newRange: new YH(
                  e.startPosition.row + 1,
                  e.startPosition.column + 1,
                  e.endPosition.row + 1,
                  e.endPosition.column + 1,
                ),
                oldRangeLength: e.endIndex - e.startIndex,
                newRangeStartOffset: e.startIndex,
                newRangeEndOffset: e.endIndex,
              }))),
            o ||
              (o = [
                {
                  newRange: this.textModel.getFullModelRange(),
                  newRangeStartOffset: 0,
                  newRangeEndOffset: this.textModel.getValueLength(),
                },
              ]));
          const s = this._tree.get();
          (cF((e) => {
            (this._tree.set(r, e, { ranges: o, versionId: n }),
              this._treeLastParsedVersion.set(n, e));
          }),
            s?.delete());
        }
      }));
  }
  _applyEdits(e) {
    for (const t of e) {
      const e = e3.ofRange(YH.lift(t.range)),
        n = e3.ofText(t.text),
        i = 0 === t.text.length ? n : e.add(n),
        r = {
          startIndex: t.rangeOffset,
          oldEndIndex: t.rangeOffset + t.rangeLength,
          newEndIndex: t.rangeOffset + t.text.length,
          startPosition: { row: t.range.startLineNumber - 1, column: t.range.startColumn - 1 },
          oldEndPosition: { row: t.range.endLineNumber - 1, column: t.range.endColumn - 1 },
          newEndPosition: {
            row: t.range.startLineNumber + i.lineCount - 1,
            column: i.lineCount ? i.columnCount : t.range.endColumn + i.columnCount,
          },
        };
      (this._tree.get()?.edit(r), this._lastFullyParsedWithEdits?.edit(r));
    }
  }
  _findChangedNodes(e, t) {
    if (
      (this._ranges &&
        this._ranges.every((t) => t.startPosition.row !== e.rootNode.startPosition.row)) ||
      0 !== e.rootNode.startPosition.row
    )
      return [];
    const n = e.walk(),
      i = t.walk(),
      r = [];
    let o = !0;
    do {
      if (n.currentNode.hasChanges) {
        const t = n.currentNode.children,
          s = [],
          a = t.filter(
            (e, t) => !!(e?.hasChanges || i.currentNode.children.length <= t) && (s.push(t), !0),
          );
        if (0 === a.length || n.currentNode.hasError !== i.currentNode.hasError) {
          for (; n.currentNode.parent && o && !n.currentNode.isNamed; ) o = $9(n, i);
          const t = n.currentNode,
            s = G9(n, e) ?? t;
          (r.push({
            startIndex: s.startIndex,
            endIndex: t.endIndex,
            startPosition: s.startPosition,
            endPosition: t.endPosition,
          }),
            (o = K9(n, i)));
        } else a.length >= 1 && (o = q9(n, i, s[0]));
      } else o = K9(n, i);
    } while (o);
    return (n.delete(), i.delete(), r);
  }
  _findTreeChanges(e, t, n) {
    let i = 0;
    const r = [];
    for (let o = 0; o < t.length; o++) {
      const s = t[o];
      if (
        r.length > 0 &&
        s.startIndex >= r[r.length - 1].newRangeStartOffset &&
        s.endIndex <= r[r.length - 1].newRangeEndOffset
      )
        continue;
      const a = e.walk(),
        l = () => a.startIndex < s.startIndex && a.endIndex > s.endIndex;
      for (; l(); ) {
        let e = a.gotoFirstChild(),
          t = !1;
        for (; e; ) {
          if (l() && a.currentNode.isNamed) {
            t = !0;
            break;
          }
          e = a.gotoNextSibling();
        }
        if (!t) {
          a.gotoParent();
          break;
        }
        if (0 === a.currentNode.childCount) break;
      }
      const c = a.currentNode.startPosition,
        d = a.currentNode.endPosition,
        u = a.currentNode.startIndex,
        h = a.currentNode.endIndex,
        g = {
          newRange: new YH(c.row + 1, c.column + 1, d.row + 1, d.column + 1),
          newRangeStartOffset: u,
          newRangeEndOffset: h,
        };
      (i < n.length && Q9(n[i], { startIndex: u, endIndex: h })
        ? (n[i].startIndex < g.newRangeStartOffset &&
            ((g.newRange = g.newRange.setStartPosition(
              n[i].startPosition.row + 1,
              n[i].startPosition.column + 1,
            )),
            (g.newRangeStartOffset = n[i].startIndex)),
          n[i].endIndex > g.newRangeEndOffset &&
            ((g.newRange = g.newRange.setEndPosition(
              n[i].endPosition.row + 1,
              n[i].endPosition.column + 1,
            )),
            (g.newRangeEndOffset = n[i].endIndex)),
          i++)
        : i < n.length &&
          n[i].endIndex < g.newRangeStartOffset &&
          r.push({
            newRange: new YH(
              n[i].startPosition.row + 1,
              n[i].startPosition.column + 1,
              n[i].endPosition.row + 1,
              n[i].endPosition.column + 1,
            ),
            newRangeStartOffset: n[i].startIndex,
            newRangeEndOffset: n[i].endIndex,
          }),
        r.length > 0 && r[r.length - 1].newRangeEndOffset >= g.newRangeStartOffset
          ? ((r[r.length - 1].newRange = YH.fromPositions(
              r[r.length - 1].newRange.getStartPosition(),
              g.newRange.getEndPosition(),
            )),
            (r[r.length - 1].newRangeEndOffset = g.newRangeEndOffset))
          : r.push(g));
    }
    return this._constrainRanges(r);
  }
  _constrainRanges(e) {
    if (!this._ranges) return e;
    const t = [];
    let n = 0,
      i = 0;
    for (; n < e.length && i < this._ranges.length; ) {
      const r = e[n],
        o = this._ranges[i];
      if (r.newRangeEndOffset < o.startIndex) n++;
      else if (r.newRangeStartOffset > o.endIndex) i++;
      else {
        const e = Math.max(r.newRangeStartOffset, o.startIndex),
          i = Math.min(r.newRangeEndOffset, o.endIndex),
          s = r.newRange.intersectRanges(
            new YH(
              o.startPosition.row + 1,
              o.startPosition.column + 1,
              o.endPosition.row + 1,
              o.endPosition.column + 1,
            ),
          );
        (t.push({ newRange: s, newRangeEndOffset: i, newRangeStartOffset: e }),
          i < r.newRangeEndOffset
            ? ((r.newRange = YH.fromPositions(s.getEndPosition(), r.newRange.getEndPosition())),
              (r.newRangeStartOffset = i + 1))
            : n++);
      }
    }
    return t;
  }
  async _parseAndUpdateTree(e) {
    const t = await this._parse();
    if (t)
      return (
        this._lastFullyParsed?.delete(),
        (this._lastFullyParsed = t.copy()),
        this._lastFullyParsedWithEdits?.delete(),
        (this._lastFullyParsedWithEdits = t.copy()),
        t
      );
    this._tree.get() || this._parser.reset();
  }
  _parse() {
    let e = "fullParse";
    return (this._tree.get() && (e = "incrementalParse"), this._parseAndYield(e));
  }
  async _parseAndYield(e) {
    let t = 0,
      n = 0;
    const i = this.textModel.getVersionId();
    let r;
    const o = (function () {
      let e = performance.now();
      return function (t) {
        const n = performance.now();
        return n - e > 50 && ((e = n), !0);
      };
    })();
    do {
      const e = performance.now();
      ((r = this._parser.parse((e, t) => this._parseCallback(e), this._tree.get(), {
        progressCallback: o,
        includedRanges: this._ranges,
      })),
        (t += performance.now() - e),
        n++,
        await new Promise((e) => KR(e)));
    } while (!this._store.isDisposed && !r && i === this.textModel.getVersionId());
    return (
      this._sendParseTimeTelemetry(e, t, n),
      r && i === this.textModel.getVersionId() ? r : void 0
    );
  }
  _parseCallback(e) {
    try {
      return this.textModel.getTextBuffer().getNearestChunk(e);
    } catch (spt) {
      this._logService.debug("Error getting chunk for tree-sitter parsing", spt);
    }
  }
  _setRanges(e) {
    const t = [];
    if (this._ranges)
      for (const n of e) {
        let e = !1;
        for (let t = 0; t < this._ranges.length; t++) {
          const i = this._ranges[t];
          if (X9(i, n) || Q9(i, n)) {
            e = !0;
            break;
          }
        }
        e || t.push(n);
      }
    else t.push(...e);
    return ((this._ranges = e), t);
  }
  _sendParseTimeTelemetry(e, t, n) {
    (this._logService.debug(`Tree parsing (${e}) took ${t} ms and ${n} passes.`),
      "fullParse" === e
        ? this._telemetryService.publicLog2("treeSitter.fullParse", {
            languageId: this.languageId,
            time: t,
            passes: n,
          })
        : this._telemetryService.publicLog2("treeSitter.incrementalParse", {
            languageId: this.languageId,
            time: t,
            passes: n,
          }));
  }
  createParsedTreeSync(e) {
    const t = new this._parserClass();
    t.setLanguage(this._parser.language);
    const n = t.parse(e);
    return (t.delete(), n ?? void 0);
  }
};
function X9(e, t) {
  return (
    e.startPosition.row === t.startPosition.row &&
    e.startPosition.column === t.startPosition.column &&
    e.endPosition.row === t.endPosition.row &&
    e.endPosition.column === t.endPosition.column &&
    e.startIndex === t.startIndex &&
    e.endIndex === t.endIndex
  );
}
function Q9(e, t) {
  return (
    (e.startIndex <= t.startIndex && e.endIndex >= t.startIndex) ||
    (t.startIndex <= e.startIndex && t.endIndex >= e.startIndex)
  );
}
Y9 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Z9(5, yH), Z9(6, HW)], Y9);
const J9 = new (class {
  clone() {
    return this;
  }
  equals(e) {
    return this === e;
  }
})();
function e7(e, t) {
  return new d2([new c2(0, "", e)], t);
}
function t7(e, t) {
  const n = new Uint32Array(2);
  return ((n[0] = 0), (n[1] = (32768 | e | (2 << 24)) >>> 0), new u2(n, null === t ? J9 : t));
}
class n7 {
  constructor(e) {
    ((this._default = e), (this._store = []));
  }
  get(e) {
    return e < this._store.length ? this._store[e] : this._default;
  }
  set(e, t) {
    for (; e >= this._store.length; ) this._store[this._store.length] = this._default;
    this._store[e] = t;
  }
  replace(e, t, n) {
    if (e >= this._store.length) return;
    if (0 === t) return void this.insert(e, n);
    if (0 === n) return void this.delete(e, t);
    const i = this._store.slice(0, e),
      r = this._store.slice(e + t),
      o = (function (e, t) {
        const n = [];
        for (let i = 0; i < e; i++) n[i] = t;
        return n;
      })(n, this._default);
    this._store = i.concat(o, r);
  }
  delete(e, t) {
    0 === t || e >= this._store.length || this._store.splice(e, t);
  }
  insert(e, t) {
    if (0 === t || e >= this._store.length) return;
    const n = [];
    for (let i = 0; i < t; i++) n[i] = this._default;
    this._store = dj(this._store, e, n);
  }
}
class i7 {
  get startLineNumber() {
    return this._startLineNumber;
  }
  get endLineNumber() {
    return this._startLineNumber + this._tokens.length - 1;
  }
  constructor(e, t) {
    ((this._startLineNumber = e), (this._tokens = t));
  }
  getLineTokens(e) {
    return this._tokens[e - this._startLineNumber];
  }
  appendLineTokens(e) {
    this._tokens.push(e);
  }
}
class r7 {
  constructor() {
    this._tokens = [];
  }
  add(e, t) {
    if (this._tokens.length > 0) {
      const n = this._tokens[this._tokens.length - 1];
      if (n.endLineNumber + 1 === e) return void n.appendLineTokens(t);
    }
    this._tokens.push(new i7(e, [t]));
  }
  finalize() {
    return this._tokens;
  }
}
class o7 {
  constructor(e, t) {
    ((this.tokenizationSupport = t),
      (this.initialState = this.tokenizationSupport.getInitialState()),
      (this.store = new l7(e)));
  }
  getStartState(e) {
    return this.store.getStartState(e, this.initialState);
  }
  getFirstInvalidLine() {
    return this.store.getFirstInvalidLine(this.initialState);
  }
}
class s7 extends o7 {
  constructor(e, t, n, i) {
    (super(e, t), (this._textModel = n), (this._languageIdCodec = i));
  }
  updateTokensUntilLine(e, t) {
    const n = this._textModel.getLanguageId();
    for (;;) {
      const i = this.getFirstInvalidLine();
      if (!i || i.lineNumber > t) break;
      const r = this._textModel.getLineContent(i.lineNumber),
        o = u7(this._languageIdCodec, n, this.tokenizationSupport, r, !0, i.startState);
      (e.add(i.lineNumber, o.tokens), this.store.setEndState(i.lineNumber, o.endState));
    }
  }
  getTokenTypeIfInsertingCharacter(e, t) {
    const n = this.getStartState(e.lineNumber);
    if (!n) return 0;
    const i = this._textModel.getLanguageId(),
      r = this._textModel.getLineContent(e.lineNumber),
      o = r.substring(0, e.column - 1) + t + r.substring(e.column - 1),
      s = u7(this._languageIdCodec, i, this.tokenizationSupport, o, !0, n),
      a = new D$(s.tokens, o, this._languageIdCodec);
    if (0 === a.getCount()) return 0;
    const l = a.findTokenIndexAtOffset(e.column - 1);
    return a.getStandardTokenType(l);
  }
  tokenizeLinesAt(e, t) {
    const n = this.getStartState(e);
    if (!n) return null;
    const i = this._textModel.getLanguageId(),
      r = [];
    let o = n;
    for (const s of t) {
      const e = u7(this._languageIdCodec, i, this.tokenizationSupport, s, !0, o);
      (r.push(new D$(e.tokens, s, this._languageIdCodec)), (o = e.endState));
    }
    return r;
  }
  hasAccurateTokensForLine(e) {
    return e < this.store.getFirstInvalidEndStateLineNumberOrMax();
  }
  isCheapToTokenize(e) {
    const t = this.store.getFirstInvalidEndStateLineNumberOrMax();
    return e < t || (e === t && this._textModel.getLineLength(e) < 2048);
  }
  tokenizeHeuristically(e, t, n) {
    if (n <= this.store.getFirstInvalidEndStateLineNumberOrMax()) return { heuristicTokens: !1 };
    if (t <= this.store.getFirstInvalidEndStateLineNumberOrMax())
      return (this.updateTokensUntilLine(e, n), { heuristicTokens: !1 });
    let i = this.guessStartState(t);
    const r = this._textModel.getLanguageId();
    for (let o = t; o <= n; o++) {
      const t = this._textModel.getLineContent(o),
        n = u7(this._languageIdCodec, r, this.tokenizationSupport, t, !0, i);
      (e.add(o, n.tokens), (i = n.endState));
    }
    return { heuristicTokens: !0 };
  }
  guessStartState(e) {
    let { likelyRelevantLines: t, initialState: n } = a7(this._textModel, e, this);
    n || (n = this.tokenizationSupport.getInitialState());
    const i = this._textModel.getLanguageId();
    let r = n;
    for (const o of t) {
      r = u7(this._languageIdCodec, i, this.tokenizationSupport, o, !1, r).endState;
    }
    return r;
  }
}
function a7(e, t, n) {
  let i = e.getLineFirstNonWhitespaceColumn(t);
  const r = [];
  let o = null;
  for (let s = t - 1; i > 1 && s >= 1; s--) {
    const t = e.getLineFirstNonWhitespaceColumn(s);
    if (0 !== t && t < i && (r.push(e.getLineContent(s)), (i = t), (o = n?.getStartState(s)), o))
      break;
  }
  return (r.reverse(), { likelyRelevantLines: r, initialState: o ?? void 0 });
}
class l7 {
  constructor(e) {
    ((this.lineCount = e),
      (this._tokenizationStateStore = new c7()),
      (this._invalidEndStatesLineNumbers = new d7()),
      this._invalidEndStatesLineNumbers.addRange(new N$(1, e + 1)));
  }
  getEndState(e) {
    return this._tokenizationStateStore.getEndState(e);
  }
  setEndState(e, t) {
    if (!t) throw new QI("Cannot set null/undefined state");
    this._invalidEndStatesLineNumbers.delete(e);
    const n = this._tokenizationStateStore.setEndState(e, t);
    return (
      n && e < this.lineCount && this._invalidEndStatesLineNumbers.addRange(new N$(e + 1, e + 2)),
      n
    );
  }
  acceptChange(e, t) {
    ((this.lineCount += t - e.length),
      this._tokenizationStateStore.acceptChange(e, t),
      this._invalidEndStatesLineNumbers.addRangeAndResize(
        new N$(e.startLineNumber, e.endLineNumberExclusive),
        t,
      ));
  }
  acceptChanges(e) {
    for (const t of e) {
      const [e] = Q3(t.text);
      this.acceptChange(new Q5(t.range.startLineNumber, t.range.endLineNumber + 1), e + 1);
    }
  }
  invalidateEndStateRange(e) {
    this._invalidEndStatesLineNumbers.addRange(new N$(e.startLineNumber, e.endLineNumberExclusive));
  }
  getFirstInvalidEndStateLineNumber() {
    return this._invalidEndStatesLineNumbers.min;
  }
  getFirstInvalidEndStateLineNumberOrMax() {
    return this.getFirstInvalidEndStateLineNumber() || Number.MAX_SAFE_INTEGER;
  }
  allStatesValid() {
    return null === this._invalidEndStatesLineNumbers.min;
  }
  getStartState(e, t) {
    return 1 === e ? t : this.getEndState(e - 1);
  }
  getFirstInvalidLine(e) {
    const t = this.getFirstInvalidEndStateLineNumber();
    if (null === t) return null;
    const n = this.getStartState(t, e);
    if (!n) throw new QI("Start state must be defined");
    return { lineNumber: t, startState: n };
  }
}
class c7 {
  constructor() {
    this._lineEndStates = new n7(null);
  }
  getEndState(e) {
    return this._lineEndStates.get(e);
  }
  setEndState(e, t) {
    const n = this._lineEndStates.get(e);
    return (!n || !n.equals(t)) && (this._lineEndStates.set(e, t), !0);
  }
  acceptChange(e, t) {
    let n = e.length;
    (t > 0 && n > 0 && (n--, t--), this._lineEndStates.replace(e.startLineNumber, n, t));
  }
}
class d7 {
  constructor() {
    this._ranges = [];
  }
  get min() {
    return 0 === this._ranges.length ? null : this._ranges[0].start;
  }
  delete(e) {
    const t = this._ranges.findIndex((t) => t.contains(e));
    if (-1 !== t) {
      const n = this._ranges[t];
      n.start === e
        ? n.endExclusive === e + 1
          ? this._ranges.splice(t, 1)
          : (this._ranges[t] = new N$(e + 1, n.endExclusive))
        : n.endExclusive === e + 1
          ? (this._ranges[t] = new N$(n.start, e))
          : this._ranges.splice(t, 1, new N$(n.start, e), new N$(e + 1, n.endExclusive));
    }
  }
  addRange(e) {
    N$.addRange(e, this._ranges);
  }
  addRangeAndResize(e, t) {
    let n = 0;
    for (; !(n >= this._ranges.length || e.start <= this._ranges[n].endExclusive); ) n++;
    let i = n;
    for (; !(i >= this._ranges.length || e.endExclusive < this._ranges[i].start); ) i++;
    const r = t - e.length;
    for (let o = i; o < this._ranges.length; o++) this._ranges[o] = this._ranges[o].delta(r);
    if (n === i) {
      const i = new N$(e.start, e.start + t);
      i.isEmpty || this._ranges.splice(n, 0, i);
    } else {
      const t = Math.min(e.start, this._ranges[n].start),
        o = Math.max(e.endExclusive, this._ranges[i - 1].endExclusive),
        s = new N$(t, o + r);
      s.isEmpty ? this._ranges.splice(n, i - n) : this._ranges.splice(n, i - n, s);
    }
  }
  toString() {
    return this._ranges.map((e) => e.toString()).join(" + ");
  }
}
function u7(e, t, n, i, r, o) {
  let s = null;
  if (n)
    try {
      s = n.tokenizeEncoded(i, r, o.clone());
    } catch (spt) {
      HI(spt);
    }
  return (s || (s = t7(e.encodeLanguageId(t), o)), D$.convertToEndOffset(s.tokens, i.length), s);
}
class h7 {
  constructor(e, t) {
    ((this._tokenizerWithStateStore = e),
      (this._backgroundTokenStore = t),
      (this._isDisposed = !1),
      (this._isScheduled = !1));
  }
  dispose() {
    this._isDisposed = !0;
  }
  handleChanges() {
    this._beginBackgroundTokenization();
  }
  _beginBackgroundTokenization() {
    !this._isScheduled &&
      this._tokenizerWithStateStore._textModel.isAttachedToEditor() &&
      this._hasLinesToTokenize() &&
      ((this._isScheduled = !0),
      xM((e) => {
        ((this._isScheduled = !1), this._backgroundTokenizeWithDeadline(e));
      }));
  }
  _backgroundTokenizeWithDeadline(e) {
    const t = Date.now() + e.timeRemaining(),
      n = () => {
        !this._isDisposed &&
          this._tokenizerWithStateStore._textModel.isAttachedToEditor() &&
          this._hasLinesToTokenize() &&
          (this._backgroundTokenizeForAtLeast1ms(),
          Date.now() < t ? KR(n) : this._beginBackgroundTokenization());
      };
    n();
  }
  _backgroundTokenizeForAtLeast1ms() {
    const e = this._tokenizerWithStateStore._textModel.getLineCount(),
      t = new r7(),
      n = UO.create(!1);
    do {
      if (n.elapsed() > 1) break;
      if (this._tokenizeOneInvalidLine(t) >= e) break;
    } while (this._hasLinesToTokenize());
    (this._backgroundTokenStore.setTokens(t.finalize()), this.checkFinished());
  }
  _hasLinesToTokenize() {
    return !!this._tokenizerWithStateStore && !this._tokenizerWithStateStore.store.allStatesValid();
  }
  _tokenizeOneInvalidLine(e) {
    const t = this._tokenizerWithStateStore?.getFirstInvalidLine();
    return t
      ? (this._tokenizerWithStateStore.updateTokensUntilLine(e, t.lineNumber), t.lineNumber)
      : this._tokenizerWithStateStore._textModel.getLineCount() + 1;
  }
  checkFinished() {
    this._isDisposed ||
      (this._tokenizerWithStateStore.store.allStatesValid() &&
        this._backgroundTokenStore.backgroundTokenizationFinished());
  }
  requestTokens(e, t) {
    this._tokenizerWithStateStore.store.invalidateEndStateRange(new Q5(e, t));
  }
}
class g7 {
  get children() {
    return this._children;
  }
  get length() {
    return this._length;
  }
  constructor(e) {
    ((this.height = e), (this._children = []), (this._length = 0));
  }
  static create(e, t) {
    const n = new g7(e.height + 1);
    return (n.appendChild(e), n.appendChild(t), n);
  }
  canAppendChild() {
    return this._children.length < 3;
  }
  appendChild(e) {
    if (!this.canAppendChild()) throw new Error("Cannot insert more than 3 children in a ListNode");
    (this._children.push(e),
      (this._length += e.length),
      this._updateParentLength(e.length),
      f7(e) || (e.parent = this));
  }
  _updateParentLength(e) {
    let t = this.parent;
    for (; t; ) ((t._length += e), (t = t.parent));
  }
  unappendChild() {
    const e = this._children.pop();
    return ((this._length -= e.length), this._updateParentLength(-e.length), e);
  }
  prependChild(e) {
    if (this._children.length >= 3)
      throw new Error("Cannot prepend more than 3 children in a ListNode");
    (this._children.unshift(e),
      (this._length += e.length),
      this._updateParentLength(e.length),
      f7(e) || (e.parent = this));
  }
  unprependChild() {
    const e = this._children.shift();
    return ((this._length -= e.length), this._updateParentLength(-e.length), e);
  }
  lastChild() {
    return this._children[this._children.length - 1];
  }
  dispose() {
    this._children.splice(0, this._children.length);
  }
}
var p7;
function f7(e) {
  return void 0 !== e.token;
}
function m7(e, t) {
  let n = e;
  const i = [];
  let r;
  for (;;) {
    if (t.height === n.height) {
      r = t;
      break;
    }
    if (f7(n)) throw new Error("unexpected");
    (i.push(n), (n = n.lastChild()));
  }
  for (let o = i.length - 1; o >= 0; o--) {
    const e = i[o];
    if (r)
      if (e.children.length >= 3) {
        r = g7.create(e.unappendChild(), r);
      } else (e.appendChild(r), (r = void 0));
  }
  if (r) {
    const t = new g7(r.height + 1);
    return (t.appendChild(e), t.appendChild(r), t);
  }
  return e;
}
function _7(e, t) {
  return e.height === t.height
    ? g7.create(e, t)
    : e.height > t.height
      ? m7(e, t)
      : (function (e, t) {
          let n = e;
          const i = [];
          for (; t.height !== n.height; ) {
            if (f7(n)) throw new Error("unexpected");
            (i.push(n), (n = n.children[0]));
          }
          let r = t;
          for (let o = i.length - 1; o >= 0; o--) {
            const e = i[o];
            r &&
              (e.children.length >= 3
                ? (r = g7.create(r, e.unprependChild()))
                : (e.prependChild(r), (r = void 0)));
          }
          return r ? g7.create(r, e) : e;
        })(t, e);
}
!(function (e) {
  ((e[(e.None = 0)] = "None"),
    (e[(e.ViewportGuess = 1)] = "ViewportGuess"),
    (e[(e.EditGuess = 2)] = "EditGuess"),
    (e[(e.Accurate = 3)] = "Accurate"));
})(p7 || (p7 = {}));
class v7 {
  constructor(e) {
    ((this._textModel = e), (this._root = this.createEmptyRoot()));
  }
  createEmptyRoot() {
    return { length: this._textModel.getValueLength(), token: 0, height: 0, tokenQuality: p7.None };
  }
  buildStore(e, t) {
    this._root = this.createFromUpdates(e, t);
  }
  createFromUpdates(e, t) {
    if (0 === e.length) return this.createEmptyRoot();
    let n = { length: e[0].length, token: e[0].token, height: 0, tokenQuality: t };
    for (let i = 1; i < e.length; i++)
      n = m7(n, { length: e[i].length, token: e[i].token, height: 0, tokenQuality: t });
    return n;
  }
  update(e, t, n) {
    0 !== t.length && this.replace(e, t[0].startOffsetInclusive, t, n);
  }
  delete(e, t) {
    this.replace(e, t, [], p7.EditGuess);
  }
  replace(e, t, n, i) {
    const r = t + e,
      o = [],
      s = [],
      a = [{ node: this._root, offset: 0 }];
    for (; a.length > 0; ) {
      const e = a.pop(),
        n = e.offset;
      if (n < t && n + e.node.length <= t) (f7(e.node) || (e.node.parent = void 0), o.push(e.node));
      else if (
        (f7(e.node) &&
          n < t &&
          o.push({
            length: t - n,
            token: e.node.token,
            height: 0,
            tokenQuality: e.node.tokenQuality,
          }),
        !(t <= n && n + e.node.length <= r))
      )
        if (n >= r) (f7(e.node) || (e.node.parent = void 0), s.push(e.node));
        else if (f7(e.node) && n + e.node.length > r)
          s.push({
            length: n + e.node.length - r,
            token: e.node.token,
            height: 0,
            tokenQuality: e.node.tokenQuality,
          });
        else if (!f7(e.node)) {
          let t = n + e.node.length;
          for (let n = e.node.children.length - 1; n >= 0; n--)
            ((t -= e.node.children[n].length), a.push({ node: e.node.children[n], offset: t }));
        }
    }
    let l;
    l = n.length > 0 ? o.concat(this.createFromUpdates(n, i), s) : o.concat(s);
    let c = l[0];
    for (let d = 1; d < l.length; d++) c = _7(c, l[d]);
    this._root = c ?? this.createEmptyRoot();
  }
  traverseInOrderInRange(e, t, n) {
    const i = [{ node: this._root, offset: 0 }];
    for (; i.length > 0; ) {
      const { node: r, offset: o } = i.pop();
      if (!(o + r.length <= e || o >= t)) {
        if (n(r, o)) return;
        if (!f7(r)) {
          let e = o + r.length;
          for (let t = r.children.length - 1; t >= 0; t--)
            ((e -= r.children[t].length), i.push({ node: r.children[t], offset: e }));
        }
      }
    }
  }
  getTokenAt(e) {
    let t;
    return (
      this.traverseInOrderInRange(
        e,
        this._root.length,
        (e, n) =>
          !!f7(e) && ((t = { token: e.token, startOffsetInclusive: n, length: e.length }), !0),
      ),
      t
    );
  }
  getTokensInRange(e, t) {
    const n = [];
    return (
      this.traverseInOrderInRange(e, t, (i, r) => {
        if (f7(i)) {
          let o = i.length,
            s = r;
          (r < e && r + i.length > t
            ? ((s = e), (o = t - e))
            : r < e
              ? ((o -= e - r), (s = e))
              : r + i.length > t && (o -= r + i.length - t),
            n.push({ token: i.token, startOffsetInclusive: s, length: o }));
        }
        return !1;
      }),
      n
    );
  }
  markForRefresh(e, t) {
    this.traverseInOrderInRange(e, t, (e) => (f7(e) && (e.tokenQuality = p7.None), !1));
  }
  rangeHasTokens(e, t, n) {
    let i = !0;
    return (
      this.traverseInOrderInRange(e, t, (e) => (f7(e) && e.tokenQuality < n && (i = !1), !1)),
      i
    );
  }
  rangeNeedsRefresh(e, t) {
    let n = !1;
    return (
      this.traverseInOrderInRange(
        e,
        t,
        (e) => (f7(e) && e.tokenQuality !== p7.Accurate && (n = !0), !1),
      ),
      n
    );
  }
  getNeedsRefresh() {
    const e = [];
    return (
      this.traverseInOrderInRange(
        0,
        this._textModel.getValueLength(),
        (t, n) => (
          f7(t) &&
            t.tokenQuality !== p7.Accurate &&
            (e.length > 0 && e[e.length - 1].endOffset === n
              ? (e[e.length - 1].endOffset += t.length)
              : e.push({ startOffset: n, endOffset: n + t.length })),
          !1
        ),
      ),
      e
    );
  }
  dispose() {
    const e = [[this._root, !1]];
    for (; e.length > 0; ) {
      const [t, n] = e.pop();
      if (f7(t));
      else if (n) (t.dispose(), (t.parent = void 0));
      else {
        e.push([t, !0]);
        for (let n = t.children.length - 1; n >= 0; n--) e.push([t.children[n], !1]);
      }
    }
    this._root = void 0;
  }
}
const b7 = bV("treeSitterThemeService");
function y7(e) {
  let t;
  return {
    createChangeSummary: (e) => ({ changes: [] }),
    handleChange(n, i) {
      t || (t = e());
      for (const e in t) n.didChange(t[e]) && i.changes.push({ key: e, change: n.change });
      return !0;
    },
    beforeUpdate(n, i) {
      t || (t = e());
      for (const e in t) {
        if ("changes" === e)
          throw new QI('property name "changes" is reserved for change tracking');
        i[e] = t[e].read(n);
      }
    },
  };
}
let x7 = class extends PO {
  get _textModel() {
    return this._tree.textModel;
  }
  constructor(e, t, n, i, r) {
    var o;
    (super(),
      (this._tree = e),
      (this._highlightingQueries = t),
      (this._languageIdCodec = n),
      (this._visibleLineRanges = i),
      (this._treeSitterThemeService = r),
      (this._onDidChangeTokens = this._register(new QO())),
      (this.onDidChangeTokens = this._onDidChangeTokens.event),
      (this._onDidCompleteBackgroundTokenization = this._register(new QO())),
      (this.onDidChangeBackgroundTokenization = this._onDidCompleteBackgroundTokenization.event),
      (this._encodedLanguageId = this._languageIdCodec.encodeLanguageId(this._tree.languageId)),
      this._register(
        s5(this._treeSitterThemeService.onChange, () => {
          this._updateTheme();
        }),
      ),
      (this._tokenStore = this._register(new v7(this._textModel))),
      (this._accurateVersion = this._textModel.getVersionId()),
      (this._guessVersion = this._textModel.getVersionId()),
      this._tokenStore.buildStore(this._createEmptyTokens(), p7.None),
      this._register(
        rF((e) => {
          const t = this._visibleLineRanges.read(e);
          this._parseAndTokenizeViewPort(t);
        }),
      ),
      this._register(
        sF(
          {
            owner: this,
            changeTracker:
              ((o = { tree: this._tree.tree }),
              {
                createChangeSummary: (e) => ({ changes: [] }),
                handleChange(e, t) {
                  for (const n in o)
                    e.didChange(o[n]) && t.changes.push({ key: n, change: e.change });
                  return !0;
                },
                beforeUpdate(e, t) {
                  for (const n in o) {
                    if ("changes" === n)
                      throw new QI('property name "changes" is reserved for change tracking');
                    t[n] = o[n].read(e);
                  }
                },
              }),
          },
          (e, t) => {
            const n = t.changes.at(0)?.change;
            if (t.changes.length > 1)
              throw new QI(
                "The tree changed twice in one transaction. This is currently not supported and should not happen.",
              );
            if (n) {
              if (this.hasTokens()) for (const e of n.ranges) this._markForRefresh(e.newRange);
              this.hasTokens()
                ? this._handleTreeUpdate(n.ranges, n.versionId)
                : this._firstTreeUpdate(n.versionId);
            } else t.tree && this._firstTreeUpdate(this._tree.treeLastParsedVersion.read(e));
          },
        ),
      ));
  }
  handleContentChanged(e) {
    this._guessVersion = e.versionId;
    for (const t of e.changes)
      if (t.text.length > t.rangeLength) {
        const e = t.rangeOffset > 0 ? t.rangeOffset - 1 : t.rangeOffset,
          n = this._tokenStore.getTokenAt(e);
        let i;
        (n
          ? ((i = {
              startOffsetInclusive: n.startOffsetInclusive,
              length: n.length + t.text.length - t.rangeLength,
              token: n.token,
            }),
            this._tokenStore.markForRefresh(
              e,
              t.rangeOffset + (t.text.length > t.rangeLength ? t.text.length : t.rangeLength),
            ))
          : (i = { startOffsetInclusive: e, length: t.text.length, token: 0 }),
          this._tokenStore.update(n?.length ?? 0, [i], p7.EditGuess));
      } else if (t.text.length < t.rangeLength) {
        const e = t.rangeLength - t.text.length;
        this._tokenStore.delete(e, t.rangeOffset);
      }
  }
  getLineTokens(e) {
    const t = this._textModel.getLineContent(e),
      n = this.getTokens(e);
    return new D$(n, t, this._languageIdCodec);
  }
  _createEmptyTokens() {
    const e = this._emptyToken(),
      t = this._textModel.getValueLength();
    return [this._emptyTokensForOffsetAndLength(0, t, e)];
  }
  _emptyToken() {
    return this._treeSitterThemeService.findMetadata([], this._encodedLanguageId, !1, void 0);
  }
  _emptyTokensForOffsetAndLength(e, t, n) {
    return { token: n, length: e + t, startOffsetInclusive: 0 };
  }
  hasAccurateTokensForLine(e) {
    return this.hasTokens(new YH(e, 1, e, this._textModel.getLineMaxColumn(e)));
  }
  tokenizeLinesAt(e, t) {
    const n = this._guessTokensForLinesContent(e, t),
      i = [];
    if (!n) return null;
    for (let r = 0; r < n.length; r++) i.push(new D$(n[r], t[r], this._languageIdCodec));
    return i;
  }
  _rangeHasTokens(e, t) {
    return this._tokenStore.rangeHasTokens(
      this._textModel.getOffsetAt(e.getStartPosition()),
      this._textModel.getOffsetAt(e.getEndPosition()),
      t,
    );
  }
  hasTokens(e) {
    return (
      !e ||
      this._guessVersion === this._accurateVersion ||
      !this._tokenStore.rangeNeedsRefresh(
        this._textModel.getOffsetAt(e.getStartPosition()),
        this._textModel.getOffsetAt(e.getEndPosition()),
      )
    );
  }
  getTokens(e) {
    const t = this._textModel.getOffsetAt({ lineNumber: e, column: 1 }),
      n = this._textModel.getOffsetAt({
        lineNumber: e,
        column: this._textModel.getLineLength(e) + 1,
      }),
      i = this._tokenStore.getTokensInRange(t, n),
      r = new Uint32Array(2 * i.length);
    for (let o = 0; o < i.length; o++)
      ((r[2 * o] = i[o].startOffsetInclusive - t + i[o].length), (r[2 * o + 1] = i[o].token));
    return r;
  }
  getTokensInRange(e, t, n, i) {
    const r = i ? this._tokenizeCapturesWithMetadata(i, t, n) : this._tokenize(e, t, n);
    if (r?.endOffsetsAndMetadata) return this._rangeTokensAsUpdates(t, r.endOffsetsAndMetadata);
  }
  _updateTokensInStore(e, t, n) {
    this._accurateVersion = e;
    for (const i of t) {
      const t = i.newTokens.length > 0 ? i.newTokens[i.newTokens.length - 1] : void 0;
      let r;
      ((r =
        t && this._guessVersion >= e
          ? t.startOffsetInclusive + t.length - i.newTokens[0].startOffsetInclusive
          : i.oldRangeLength
            ? i.oldRangeLength
            : 0),
        this._tokenStore.update(r, i.newTokens, n));
    }
  }
  _markForRefresh(e) {
    this._tokenStore.markForRefresh(
      this._textModel.getOffsetAt(e.getStartPosition()),
      this._textModel.getOffsetAt(e.getEndPosition()),
    );
  }
  _getNeedsRefresh() {
    const e = this._tokenStore.getNeedsRefresh();
    return e
      ? e.map((e) => ({
          range: YH.fromPositions(
            this._textModel.getPositionAt(e.startOffset),
            this._textModel.getPositionAt(e.endOffset),
          ),
          startOffset: e.startOffset,
          endOffset: e.endOffset,
        }))
      : [];
  }
  _parseAndTokenizeViewPort(e) {
    const t = e.map((e) => e.toInclusiveRange()).filter(hR);
    for (const n of t) {
      const e = this._textModel.getOffsetAt(n.getStartPosition()),
        t = this._textModel.getOffsetAt(n.getEndPosition()),
        i = this._textModel.getVersionId();
      if (this._rangeHasTokens(n, p7.ViewportGuess)) continue;
      const r = this._textModel.getValueInRange(n),
        o = this._forceParseAndTokenizeContent(n, e, t, r, !0);
      if (!o || this._rangeHasTokens(n, p7.ViewportGuess)) continue;
      if (0 === o.length) continue;
      const s = o[o.length - 1],
        a = s.startOffsetInclusive + s.length - o[0].startOffsetInclusive;
      (this._updateTokensInStore(i, [{ newTokens: o, oldRangeLength: a }], p7.ViewportGuess),
        this._onDidChangeTokens.fire({
          changes: {
            semanticTokensApplied: !1,
            ranges: [{ fromLineNumber: n.startLineNumber, toLineNumber: n.endLineNumber }],
          },
        }));
    }
  }
  _guessTokensForLinesContent(e, t) {
    if (0 === t.length) return;
    const n = t.join(this._textModel.getEOL()),
      i = new YH(1, 1, e + t.length, t[t.length - 1].length + 1),
      r = this._textModel.getOffsetAt({ lineNumber: e, column: 1 }),
      o = this._forceParseAndTokenizeContent(i, r, r + n.length, n, !1);
    if (!o) return;
    const s = new Array(t.length);
    let a = 0,
      l = 0,
      c = 0;
    for (let d = 0; d < t.length; d++) {
      const e = [];
      let n = !1;
      for (let i = a; !n && i < o.length; i++) {
        const r = o[i],
          s = r.endOffset - c,
          u = l - c;
        if (s <= t[d].length) (e.push({ endOffset: s, metadata: r.metadata }), a++);
        else if (u < t[d].length) {
          const i = { endOffset: t[d].length, metadata: r.metadata };
          (e.push(i), (n = !0));
        } else n = !0;
        l = r.endOffset;
      }
      ((s[d] = this._endOffsetTokensToUint32Array(e)),
        (c += t[d].length + this._textModel.getEOL().length));
    }
    return s;
  }
  _forceParseAndTokenizeContent(e, t, n, i, r) {
    const o = a7(this._textModel, e.startLineNumber).likelyRelevantLines,
      s = o.join(this._textModel.getEOL()),
      a = this._tree.createParsedTreeSync(`${s}${i}`);
    if (!a) return;
    const l = new YH(1, 1, e.endLineNumber - e.startLineNumber + 1 + o.length, e.endColumn),
      c = this.captureAtRange(l),
      d = this._tokenizeCapturesWithMetadata(c, s.length, n - t + s.length);
    return (
      a.delete(),
      d
        ? r
          ? this._rangeTokensAsUpdates(t, d.endOffsetsAndMetadata, s.length)
          : d.endOffsetsAndMetadata
        : void 0
    );
  }
  _firstTreeUpdate(e) {
    return this._setViewPortTokens(e);
  }
  _setViewPortTokens(e) {
    const t = this._visibleLineRanges
      .get()
      .map((e) => {
        const t = e.toInclusiveRange();
        if (!t) return;
        const n = this._textModel.getOffsetAt(t.getStartPosition()),
          i = this._textModel.getOffsetAt(t.getEndPosition());
        return { newRange: t, newRangeEndOffset: i, newRangeStartOffset: n };
      })
      .filter(hR);
    return this._handleTreeUpdate(t, e);
  }
  _handleTreeUpdate(e, t) {
    const n = [],
      i = 1e3;
    for (let o = 0; o < e.length; o++) {
      if (e[o].newRange.endLineNumber - e[o].newRange.startLineNumber > i) {
        const t = e[o].newRange.endLineNumber;
        let r = e[o].newRange.startLineNumber,
          s = e[o].newRange.startColumn,
          a = r + i;
        do {
          const l = new xV(r, s),
            c =
              a === e[o].newRange.endLineNumber
                ? e[o].newRange.endColumn
                : this._textModel.getLineMaxColumn(a),
            d = new xV(a, c),
            u = YH.fromPositions(l, d);
          (n.push({
            range: u,
            startOffset: this._textModel.getOffsetAt(u.getStartPosition()),
            endOffset: this._textModel.getOffsetAt(u.getEndPosition()),
          }),
            (r = a + 1),
            (s = 1),
            a < t && a + i > t ? (a = t) : (a += i));
        } while (a <= t);
      } else if (0 === o || n[o - 1].endOffset < e[o].newRangeStartOffset)
        n.push({
          range: e[o].newRange,
          startOffset: e[o].newRangeStartOffset,
          endOffset: e[o].newRangeEndOffset,
        });
      else if (n[o - 1].endOffset < e[o].newRangeEndOffset) {
        const t = this._textModel.getPositionAt(n[o - 1].endOffset + 1),
          i = new YH(t.lineNumber, t.column, e[o].newRange.endLineNumber, e[o].newRange.endColumn);
        n.push({
          range: i,
          startOffset: n[o - 1].endOffset + 1,
          endOffset: e[o].newRangeEndOffset,
        });
      }
    }
    const r = n.map((e) => this._getCaptures(e.range));
    return this._updateTreeForRanges(n, t, r).then(() => {
      this._textModel.isDisposed() ||
        this._tree.treeLastParsedVersion.get() !== this._textModel.getVersionId() ||
        this._refreshNeedsRefresh(t);
    });
  }
  async _updateTreeForRanges(e, t, n) {
    let i;
    for (
      let r = 0;
      r < e.length && (this._textModel.isDisposed() || t === this._textModel.getVersionId());
      r++
    ) {
      const o = n[r],
        s = e[r],
        a = this.getTokensInRange(s.range, s.startOffset, s.endOffset, o);
      ((i = a ? { newTokens: a } : { newTokens: [] }),
        this._updateTokensInStore(t, [i], p7.Accurate),
        this._onDidChangeTokens.fire({
          changes: {
            semanticTokensApplied: !1,
            ranges: [
              {
                fromLineNumber: s.range.getStartPosition().lineNumber,
                toLineNumber: s.range.getEndPosition().lineNumber,
              },
            ],
          },
        }),
        await new Promise((e) => KR(e)));
    }
    this._onDidCompleteBackgroundTokenization.fire();
  }
  _refreshNeedsRefresh(e) {
    const t = this._getNeedsRefresh();
    if (0 === t.length) return;
    const n = new Array(t.length);
    for (let i = 0; i < t.length; i++) {
      const e = t[i];
      n[i] = {
        newRange: e.range,
        newRangeStartOffset: e.startOffset,
        newRangeEndOffset: e.endOffset,
      };
    }
    this._handleTreeUpdate(n, e);
  }
  _rangeTokensAsUpdates(e, t, n) {
    const i = [];
    let r = 0;
    for (const o of t) {
      if (o.endOffset <= r || (n && o.endOffset < n)) continue;
      let t;
      ((t =
        n && r < n
          ? { startOffsetInclusive: e + n, length: o.endOffset - n, token: o.metadata }
          : { startOffsetInclusive: e + r, length: o.endOffset - r, token: o.metadata }),
        i.push(t),
        (r = o.endOffset));
    }
    return i;
  }
  _updateTheme() {
    const e = this._textModel.getFullModelRange();
    (this._markForRefresh(e), this._parseAndTokenizeViewPort(this._visibleLineRanges.get()));
  }
  captureAtRange(e) {
    const t = this._tree.tree.get();
    return t
      ? this._highlightingQueries
          .captures(t.rootNode, {
            startPosition: { row: e.startLineNumber - 1, column: e.startColumn - 1 },
            endPosition: { row: e.endLineNumber - 1, column: e.endColumn - 1 },
          })
          .map((e) => ({
            name: e.name,
            text: e.node.text,
            node: {
              startIndex: e.node.startIndex,
              endIndex: e.node.endIndex,
              startPosition: {
                lineNumber: e.node.startPosition.row + 1,
                column: e.node.startPosition.column + 1,
              },
              endPosition: {
                lineNumber: e.node.endPosition.row + 1,
                column: e.node.endPosition.column + 1,
              },
            },
            encodedLanguageId: this._encodedLanguageId,
          }))
      : [];
  }
  captureAtRangeWithInjections(e) {
    const t = this.captureAtRange(e);
    for (let n = 0; n < t.length; n++) {
      const i = t[n],
        r = i.node.startPosition.lineNumber,
        o = i.node.endPosition.lineNumber,
        s = i.node.startPosition.column,
        a = i.node.endPosition.column,
        l = r > e.startLineNumber && r < e.endLineNumber ? r : e.startLineNumber,
        c = o > e.startLineNumber && o < e.endLineNumber ? o : e.endLineNumber,
        d =
          r === e.startLineNumber
            ? s < e.startColumn
              ? e.startColumn
              : s
            : r < e.startLineNumber
              ? e.startColumn
              : s,
        u =
          o === e.endLineNumber
            ? a > e.endColumn
              ? e.endColumn
              : a
            : o > e.endLineNumber
              ? e.endColumn
              : a,
        h = new YH(l, d, c, u),
        g = this._getInjectionCaptures(i, h);
      g && g.length > 0 && (t.splice(n + 1, 0, ...g), (n += g.length));
    }
    return t;
  }
  tokenizeEncoded(e) {
    const t = this._tokenizeEncoded(e);
    if (!t) return;
    const n = this._rangeTokensAsUpdates(
      this._textModel.getOffsetAt({ lineNumber: e, column: 1 }),
      t.result,
    );
    t.versionId === this._textModel.getVersionId() &&
      this._updateTokensInStore(
        t.versionId,
        [{ newTokens: n, oldRangeLength: this._textModel.getLineLength(e) }],
        p7.Accurate,
      );
  }
  _getCaptures(e) {
    return this.captureAtRangeWithInjections(e);
  }
  _tokenize(e, t, n) {
    const i = this._getCaptures(e),
      r = this._tokenizeCapturesWithMetadata(i, t, n);
    if (r) return { ...r, versionId: this._tree.treeLastParsedVersion.get() };
  }
  _createTokensFromCaptures(e, t, n) {
    const i = this._tree.tree.get(),
      r = UO.create(),
      o = n - t,
      s = this._languageIdCodec.encodeLanguageId(this._tree.languageId),
      a = w7[this._tree.languageId] || "source";
    if (0 === e.length) {
      if (i) {
        r.stop();
        return {
          endOffsets: [{ endOffset: o, scopes: [], encodedLanguageId: s }],
          captureTime: r.elapsed(),
        };
      }
      return;
    }
    const l = Array(e.length);
    l.fill({ endOffset: 0, scopes: [a], encodedLanguageId: s });
    let c = 0;
    const d = () => {
        l.push({ endOffset: 0, scopes: [a], encodedLanguageId: s });
      },
      u = (e, t) =>
        e.name.includes("punctuation") && e.text
          ? Array.from(e.text.matchAll(C7)).map((e) => t + e.index)
          : void 0,
      h = (e, t, n, i) => {
        if (void 0 !== i) {
          const r = l[i].scopes;
          let o = l[i].bracket;
          if ((i > 0 ? l[i - 1].endOffset : 0) !== t) {
            let s;
            if (o && o.length > 0) {
              s = [];
              const e = [];
              for (let i = 0; i < o.length; i++) {
                const r = o[i];
                r < t ? s.push(r) : r > n && e.push(r);
              }
              (0 === s.length && (s = void 0), (o = 0 === e.length ? void 0 : e));
            }
            (l.splice(i, 0, {
              endOffset: t,
              scopes: [...r],
              bracket: s,
              encodedLanguageId: e.encodedLanguageId,
            }),
              i++,
              d(),
              c++);
          }
          (l.splice(i, 0, {
            endOffset: n,
            scopes: [...r, e.name],
            bracket: u(e, t),
            encodedLanguageId: e.encodedLanguageId,
          }),
            (l[c].bracket = o));
        } else
          l[c] = {
            endOffset: n,
            scopes: [a, e.name],
            bracket: u(e, t),
            encodedLanguageId: e.encodedLanguageId,
          };
        c++;
      };
    for (let p = 0; p < e.length; p++) {
      const i = e[p],
        r = i.node.endIndex < n ? (i.node.endIndex < t ? t : i.node.endIndex) : n,
        o = i.node.startIndex < t ? t : i.node.startIndex,
        s = r - t;
      let g;
      const f = r - o;
      g = p > 0 ? l[c - 1].endOffset : o - t - 1;
      const m = s - f;
      if (
        (g >= 0 &&
          g < m &&
          ((l[c] = { endOffset: m, scopes: [a], encodedLanguageId: this._encodedLanguageId }),
          c++,
          d()),
        !(f < 0))
      )
        if (g >= s) {
          let e = c - 1,
            t = l[e].endOffset,
            n = e >= 2 ? l[e - 1].endOffset : 0;
          do {
            if (n + f === t) {
              if (n === m) {
                l[e].scopes.push(i.name);
                const t = l[e].bracket;
                l[e].bracket = t && t.length > 0 ? t : u(i, m);
              }
            } else if (n <= m) {
              h(i, m, s, e);
              break;
            }
            (e--, (n = e >= 1 ? l[e - 1].endOffset : 0), (t = e >= 0 ? l[e].endOffset : 0));
          } while (t > m);
        } else h(i, m, s);
    }
    l[c - 1].endOffset < o &&
      o - l[c - 1].endOffset > 0 &&
      (d(),
      (l[c] = { endOffset: o, scopes: l[c].scopes, encodedLanguageId: this._encodedLanguageId }),
      c++);
    for (let p = 0; p < l.length; p++) {
      if (0 === l[p].endOffset && 0 !== p) {
        l.splice(p, l.length - p);
        break;
      }
    }
    const g = r.elapsed();
    return { endOffsets: l, captureTime: g };
  }
  _getInjectionCaptures(e, t) {
    return [];
  }
  _tokenizeCapturesWithMetadata(e, t, n) {
    const i = UO.create(),
      r = this._createTokensFromCaptures(e, t, n);
    if (!r) return;
    const o = r.endOffsets;
    for (let a = 0; a < o.length; a++) {
      const e = o[a];
      e.metadata = this._treeSitterThemeService.findMetadata(
        e.scopes,
        e.encodedLanguageId,
        !!e.bracket && e.bracket.length > 0,
        void 0,
      );
    }
    const s = i.elapsed();
    return { endOffsetsAndMetadata: o, captureTime: r.captureTime, metadataTime: s };
  }
  _tokenizeEncoded(e) {
    const t = this._textModel.getOffsetAt({ lineNumber: e, column: 1 }),
      n =
        e + 1 <= this._textModel.getLineCount()
          ? this._textModel.getOffsetAt({ lineNumber: e + 1, column: 1 })
          : this._textModel.getValueLength(),
      i = n - t,
      r = this._tokenize(new YH(e, 1, e, i + 1), t, n);
    if (r)
      return {
        result: r.endOffsetsAndMetadata,
        captureTime: r.captureTime,
        metadataTime: r.metadataTime,
        versionId: r.versionId,
      };
  }
  _endOffsetTokensToUint32Array(e) {
    const t = new Uint32Array(2 * e.length);
    for (let n = 0; n < e.length; n++)
      ((t[2 * n] = e[n].endOffset), (t[2 * n + 1] = e[n].metadata));
    return t;
  }
};
x7 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(4, b7),
  ],
  x7,
);
const w7 = { css: "source.css", typescript: "source.ts", ini: "source.ini", regex: "source.regex" },
  C7 = /[\{\}\[\]\<\>\(\)]/g,
  S7 = bV("treeSitterLibraryService");
class k7 {
  constructor(e) {
    ((this._value = LF(this, void 0)),
      (this.promiseResult = this._value),
      (this.promise = e.then(
        (e) => (
          cF((t) => {
            this._value.set(new E7(e, void 0), t);
          }),
          e
        ),
        (e) => {
          throw (
            cF((t) => {
              this._value.set(new E7(void 0, e), t);
            }),
            e
          );
        },
      )));
  }
}
class E7 {
  constructor(e, t) {
    ((this.data = e), (this.error = t));
  }
  getDataOrThrow() {
    if (this.error) throw this.error;
    return this.data;
  }
}
var N7 = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let L7 = class extends z9 {
  constructor(e, t, n, i, r, o) {
    (super(t, n),
      (this._languageIdObs = e),
      (this._treeSitterLibraryService = r),
      (this._instantiationService = o),
      (this._backgroundTokenizationState = 1),
      (this._onDidChangeBackgroundTokenizationState = this._register(new QO())),
      (this.onDidChangeBackgroundTokenizationState =
        this._onDidChangeBackgroundTokenizationState.event));
    const s = new k7(this._treeSitterLibraryService.getParserClass()),
      a = Xj(this, (e) => {
        const t = s.promiseResult?.read(e)?.getDataOrThrow();
        return t;
      });
    ((this._tree = Xj(this, (e) => {
      const t = a.read(e);
      if (!t) return;
      const n = this._languageIdObs.read(e),
        i = this._treeSitterLibraryService.getLanguage(n, !1, e);
      if (!i) return;
      const r = new t();
      (e.store.add(
        MO(() => {
          r.delete();
        }),
      ),
        r.setLanguage(i));
      return void 0 !== this._treeSitterLibraryService.getInjectionQueries(n, e)
        ? e.store.add(
            this._instantiationService.createInstance(Y9, n, void 0, r, t, this._textModel),
          )
        : void 0;
    })),
      (this._tokenizationImpl = Xj(this, (e) => {
        const t = this._tree.read(e);
        if (!t) return;
        const n = this._treeSitterLibraryService.getHighlightingQueries(t.languageId, e);
        return n
          ? e.store.add(
              this._instantiationService.createInstance(x7, t, n, this._languageIdCodec, i),
            )
          : void 0;
      })),
      this._register(
        rF((e) => {
          const t = this._tokenizationImpl.read(e);
          t &&
            (e.store.add(
              t.onDidChangeTokens((e) => {
                this._onDidChangeTokens.fire(e.changes);
              }),
            ),
            e.store.add(
              t.onDidChangeBackgroundTokenization((e) => {
                ((this._backgroundTokenizationState = 2),
                  this._onDidChangeBackgroundTokenizationState.fire());
              }),
            ));
        }),
      ));
  }
  getLineTokens(e) {
    const t = this._tokenizationImpl.get();
    if (!t) {
      const t = this._textModel.getLineContent(e);
      return D$.createEmpty(t, this._languageIdCodec);
    }
    return t.getLineTokens(e);
  }
  todo_resetTokenization(e = !0) {
    e &&
      this._onDidChangeTokens.fire({
        semanticTokensApplied: !1,
        ranges: [{ fromLineNumber: 1, toLineNumber: this._textModel.getLineCount() }],
      });
  }
  handleDidChangeAttached() {}
  handleDidChangeContent(e) {
    if (e.isFlush) this.todo_resetTokenization(!1);
    else {
      const t = this._tokenizationImpl.get();
      t?.handleContentChanged(e);
    }
    const t = this._tree.get();
    t?.handleContentChange(e);
  }
  forceTokenization(e) {
    const t = this._tokenizationImpl.get();
    t && (t.hasAccurateTokensForLine(e) || t.tokenizeEncoded(e));
  }
  hasAccurateTokensForLine(e) {
    const t = this._tokenizationImpl.get();
    return !!t && t.hasAccurateTokensForLine(e);
  }
  isCheapToTokenize(e) {
    return !0;
  }
  getTokenTypeIfInsertingCharacter(e, t, n) {
    return 0;
  }
  tokenizeLinesAt(e, t) {
    const n = this._tokenizationImpl.get();
    return n ? n.tokenizeLinesAt(e, t) : null;
  }
  get hasTokens() {
    const e = this._tokenizationImpl.get();
    return !!e && e.hasTokens();
  }
};
L7 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([N7(4, S7), N7(5, vV)], L7);
class D7 {
  constructor(e) {
    ((this._pieces = []), (this._isComplete = !1), (this._languageIdCodec = e));
  }
  flush() {
    ((this._pieces = []), (this._isComplete = !1));
  }
  isEmpty() {
    return 0 === this._pieces.length;
  }
  set(e, t, n = void 0) {
    if (((this._pieces = e || []), (this._isComplete = t), n))
      for (const i of this._pieces) i.reportIfInvalid(n);
  }
  setPartial(e, t) {
    let n = e;
    if (t.length > 0) {
      const i = t[0].getRange(),
        r = t[t.length - 1].getRange();
      if (!i || !r) return e;
      n = e.plusRange(i).plusRange(r);
    }
    let i = null;
    for (let r = 0, o = this._pieces.length; r < o; r++) {
      const e = this._pieces[r];
      if (e.endLineNumber < n.startLineNumber) continue;
      if (e.startLineNumber > n.endLineNumber) {
        i = i || { index: r };
        break;
      }
      if ((e.removeTokens(n), e.isEmpty())) {
        (this._pieces.splice(r, 1), r--, o--);
        continue;
      }
      if (e.endLineNumber < n.startLineNumber) continue;
      if (e.startLineNumber > n.endLineNumber) {
        i = i || { index: r };
        continue;
      }
      const [t, s] = e.split(n);
      t.isEmpty()
        ? (i = i || { index: r })
        : s.isEmpty() || (this._pieces.splice(r, 1, t, s), r++, o++, (i = i || { index: r }));
    }
    return (
      (i = i || { index: this._pieces.length }),
      t.length > 0 && (this._pieces = dj(this._pieces, i.index, t)),
      n
    );
  }
  isComplete() {
    return this._isComplete;
  }
  addSparseTokens(e, t) {
    if (0 === t.getTextLength()) return t;
    const n = this._pieces;
    if (0 === n.length) return t;
    const i = n[D7._findFirstPieceWithLine(n, e)].getLineTokens(e);
    if (!i) return t;
    const r = t.getCount(),
      o = i.getCount();
    let s = 0;
    const a = [];
    let l = 0,
      c = 0;
    const d = (e, t) => {
      e !== c && ((c = e), (a[l++] = e), (a[l++] = t));
    };
    for (let u = 0; u < o; u++) {
      const e = Math.min(i.getStartCharacter(u), t.getTextLength()),
        n = Math.min(i.getEndCharacter(u), t.getTextLength()),
        o = i.getMetadata(u),
        a =
          ((1 & o ? 2048 : 0) |
            (2 & o ? 4096 : 0) |
            (4 & o ? 8192 : 0) |
            (8 & o ? 16384 : 0) |
            (16 & o ? 16744448 : 0) |
            (32 & o ? 4278190080 : 0)) >>>
          0,
        l = ~a >>> 0;
      for (; s < r && t.getEndOffset(s) <= e; ) (d(t.getEndOffset(s), t.getMetadata(s)), s++);
      for (
        s < r && t.getStartOffset(s) < e && d(e, t.getMetadata(s));
        s < r && t.getEndOffset(s) < n;
      )
        (d(t.getEndOffset(s), (t.getMetadata(s) & l) | (o & a)), s++);
      if (s < r) (d(n, (t.getMetadata(s) & l) | (o & a)), t.getEndOffset(s) === n && s++);
      else {
        const e = Math.min(Math.max(0, s - 1), r - 1);
        d(n, (t.getMetadata(e) & l) | (o & a));
      }
    }
    for (; s < r; ) (d(t.getEndOffset(s), t.getMetadata(s)), s++);
    return new D$(new Uint32Array(a), t.getLineContent(), this._languageIdCodec);
  }
  static _findFirstPieceWithLine(e, t) {
    let n = 0,
      i = e.length - 1;
    for (; n < i; ) {
      let r = n + Math.floor((i - n) / 2);
      if (e[r].endLineNumber < t) n = r + 1;
      else {
        if (!(e[r].startLineNumber > t)) {
          for (; r > n && e[r - 1].startLineNumber <= t && t <= e[r - 1].endLineNumber; ) r--;
          return r;
        }
        i = r - 1;
      }
    }
    return n;
  }
  acceptEdit(e, t, n, i, r) {
    for (let o = 0; o < this._pieces.length; o++) {
      const s = this._pieces[o];
      (s.acceptEdit(e, t, n, i, r), s.isEmpty() && (this._pieces.splice(o, 1), o--));
    }
  }
}
const T7 = new Uint32Array(0).buffer;
class I7 {
  static deleteBeginning(e, t) {
    return null === e || e === T7 ? e : I7.delete(e, 0, t);
  }
  static deleteEnding(e, t) {
    if (null === e || e === T7) return e;
    const n = R7(e),
      i = n[n.length - 2];
    return I7.delete(e, t, i);
  }
  static delete(e, t, n) {
    if (null === e || e === T7 || t === n) return e;
    const i = R7(e),
      r = i.length >>> 1;
    if (0 === t && i[i.length - 2] === n) return T7;
    const o = D$.findIndexInTokensArray(i, t),
      s = o > 0 ? i[(o - 1) << 1] : 0;
    if (n < i[o << 1]) {
      const s = n - t;
      for (let e = o; e < r; e++) i[e << 1] -= s;
      return e;
    }
    let a, l;
    s !== t ? ((i[o << 1] = t), (a = (o + 1) << 1), (l = t)) : ((a = o << 1), (l = s));
    const c = n - t;
    for (let u = o + 1; u < r; u++) {
      const e = i[u << 1] - c;
      e > l && ((i[a++] = e), (i[a++] = i[1 + (u << 1)]), (l = e));
    }
    if (a === i.length) return e;
    const d = new Uint32Array(a);
    return (d.set(i.subarray(0, a), 0), d.buffer);
  }
  static append(e, t) {
    if (t === T7) return e;
    if (e === T7) return t;
    if (null === e) return e;
    if (null === t) return null;
    const n = R7(e),
      i = R7(t),
      r = i.length >>> 1,
      o = new Uint32Array(n.length + i.length);
    o.set(n, 0);
    let s = n.length;
    const a = n[n.length - 2];
    for (let l = 0; l < r; l++) ((o[s++] = i[l << 1] + a), (o[s++] = i[1 + (l << 1)]));
    return o.buffer;
  }
  static insert(e, t, n) {
    if (null === e || e === T7) return e;
    const i = R7(e),
      r = i.length >>> 1;
    let o = D$.findIndexInTokensArray(i, t);
    if (o > 0) {
      i[(o - 1) << 1] === t && o--;
    }
    for (let s = o; s < r; s++) i[s << 1] += n;
    return e;
  }
}
function R7(e) {
  return e instanceof Uint32Array ? e : new Uint32Array(e);
}
class O7 {
  constructor(e) {
    ((this._lineTokens = []), (this._len = 0), (this._languageIdCodec = e));
  }
  flush() {
    ((this._lineTokens = []), (this._len = 0));
  }
  get hasTokens() {
    return this._lineTokens.length > 0;
  }
  getTokens(e, t, n) {
    let i = null;
    if ((t < this._len && (i = this._lineTokens[t]), null !== i && i !== T7))
      return new D$(R7(i), n, this._languageIdCodec);
    const r = new Uint32Array(2);
    return (
      (r[0] = n.length),
      (r[1] = M7(this._languageIdCodec.encodeLanguageId(e))),
      new D$(r, n, this._languageIdCodec)
    );
  }
  static _massageTokens(e, t, n) {
    const i = n ? R7(n) : null;
    if (0 === t) {
      let t = !1;
      if ((i && i.length > 1 && (t = E$.getLanguageId(i[1]) !== e), !t)) return T7;
    }
    if (!i || 0 === i.length) {
      const n = new Uint32Array(2);
      return ((n[0] = t), (n[1] = M7(e)), n.buffer);
    }
    return (
      (i[i.length - 2] = t),
      0 === i.byteOffset && i.byteLength === i.buffer.byteLength ? i.buffer : i
    );
  }
  _ensureLine(e) {
    for (; e >= this._len; ) ((this._lineTokens[this._len] = null), this._len++);
  }
  _deleteLines(e, t) {
    0 !== t &&
      (e + t > this._len && (t = this._len - e), this._lineTokens.splice(e, t), (this._len -= t));
  }
  _insertLines(e, t) {
    if (0 === t) return;
    const n = [];
    for (let i = 0; i < t; i++) n[i] = null;
    ((this._lineTokens = dj(this._lineTokens, e, n)), (this._len += t));
  }
  setTokens(e, t, n, i, r) {
    const o = O7._massageTokens(this._languageIdCodec.encodeLanguageId(e), n, i);
    this._ensureLine(t);
    const s = this._lineTokens[t];
    return ((this._lineTokens[t] = o), !!r && !O7._equals(s, o));
  }
  static _equals(e, t) {
    if (!e || !t) return !e && !t;
    const n = R7(e),
      i = R7(t);
    if (n.length !== i.length) return !1;
    for (let r = 0, o = n.length; r < o; r++) if (n[r] !== i[r]) return !1;
    return !0;
  }
  acceptEdit(e, t, n) {
    (this._acceptDeleteRange(e),
      this._acceptInsertText(new xV(e.startLineNumber, e.startColumn), t, n));
  }
  _acceptDeleteRange(e) {
    const t = e.startLineNumber - 1;
    if (t >= this._len) return;
    if (e.startLineNumber === e.endLineNumber) {
      if (e.startColumn === e.endColumn) return;
      return void (this._lineTokens[t] = I7.delete(
        this._lineTokens[t],
        e.startColumn - 1,
        e.endColumn - 1,
      ));
    }
    this._lineTokens[t] = I7.deleteEnding(this._lineTokens[t], e.startColumn - 1);
    const n = e.endLineNumber - 1;
    let i = null;
    (n < this._len && (i = I7.deleteBeginning(this._lineTokens[n], e.endColumn - 1)),
      (this._lineTokens[t] = I7.append(this._lineTokens[t], i)),
      this._deleteLines(e.startLineNumber, e.endLineNumber - e.startLineNumber));
  }
  _acceptInsertText(e, t, n) {
    if (0 === t && 0 === n) return;
    const i = e.lineNumber - 1;
    i >= this._len ||
      (0 !== t
        ? ((this._lineTokens[i] = I7.deleteEnding(this._lineTokens[i], e.column - 1)),
          (this._lineTokens[i] = I7.insert(this._lineTokens[i], e.column - 1, n)),
          this._insertLines(e.lineNumber, t))
        : (this._lineTokens[i] = I7.insert(this._lineTokens[i], e.column - 1, n)));
  }
  setMultilineTokens(e, t) {
    if (0 === e.length) return { changes: [] };
    const n = [];
    for (let i = 0, r = e.length; i < r; i++) {
      const r = e[i];
      let o = 0,
        s = 0,
        a = !1;
      for (let e = r.startLineNumber; e <= r.endLineNumber; e++)
        if (a)
          (this.setTokens(t.getLanguageId(), e - 1, t.getLineLength(e), r.getLineTokens(e), !1),
            (s = e));
        else {
          this.setTokens(t.getLanguageId(), e - 1, t.getLineLength(e), r.getLineTokens(e), !0) &&
            ((a = !0), (o = e), (s = e));
        }
      a && n.push({ fromLineNumber: o, toLineNumber: s });
    }
    return { changes: n };
  }
}
function M7(e) {
  return (32768 | e | (2 << 24) | 1024) >>> 0;
}
class A7 extends z9 {
  constructor(e, t, n, i) {
    (super(e, t),
      (this.getLanguageId = n),
      (this._tokenizer = null),
      (this._backgroundTokenizationState = 1),
      (this._onDidChangeBackgroundTokenizationState = this._register(new QO())),
      (this.onDidChangeBackgroundTokenizationState =
        this._onDidChangeBackgroundTokenizationState.event),
      (this._defaultBackgroundTokenizer = null),
      (this._backgroundTokenizer = this._register(new jO())),
      (this._tokens = new O7(this._languageIdCodec)),
      (this._debugBackgroundTokenizer = this._register(new jO())),
      (this._attachedViewStates = this._register(new VO())),
      this._register(
        I2.onDidChange((e) => {
          const t = this.getLanguageId();
          -1 !== e.changedLanguages.indexOf(t) && this.todo_resetTokenization();
        }),
      ),
      this.todo_resetTokenization(),
      this._register(
        i.onDidChangeVisibleRanges(({ view: e, state: t }) => {
          if (t) {
            let n = this._attachedViewStates.get(e);
            (n ||
              ((n = new H9(() => this.refreshRanges(n.lineRanges))),
              this._attachedViewStates.set(e, n)),
              n.handleStateChange(t));
          } else this._attachedViewStates.deleteAndDispose(e);
        }),
      ));
  }
  todo_resetTokenization(e = !0) {
    (this._tokens.flush(),
      this._debugBackgroundTokens?.flush(),
      this._debugBackgroundStates &&
        (this._debugBackgroundStates = new l7(this._textModel.getLineCount())),
      e &&
        this._onDidChangeTokens.fire({
          semanticTokensApplied: !1,
          ranges: [{ fromLineNumber: 1, toLineNumber: this._textModel.getLineCount() }],
        }));
    const [t, n] = (() => {
      if (this._textModel.isTooLargeForTokenization()) return [null, null];
      const e = I2.get(this.getLanguageId());
      if (!e) return [null, null];
      let t;
      try {
        t = e.getInitialState();
      } catch (spt) {
        return (HI(spt), [null, null]);
      }
      return [e, t];
    })();
    if (
      ((this._tokenizer =
        t && n
          ? new s7(this._textModel.getLineCount(), t, this._textModel, this._languageIdCodec)
          : null),
      this._backgroundTokenizer.clear(),
      (this._defaultBackgroundTokenizer = null),
      this._tokenizer)
    ) {
      const e = {
        setTokens: (e) => {
          this.setTokens(e);
        },
        backgroundTokenizationFinished: () => {
          if (2 === this._backgroundTokenizationState) return;
          ((this._backgroundTokenizationState = 2),
            this._onDidChangeBackgroundTokenizationState.fire());
        },
        setEndState: (e, t) => {
          if (!this._tokenizer) return;
          const n = this._tokenizer.store.getFirstInvalidEndStateLineNumber();
          null !== n && e >= n && this._tokenizer?.store.setEndState(e, t);
        },
      };
      (t &&
        t.createBackgroundTokenizer &&
        !t.backgroundTokenizerShouldOnlyVerifyTokens &&
        (this._backgroundTokenizer.value = t.createBackgroundTokenizer(this._textModel, e)),
        this._backgroundTokenizer.value ||
          this._textModel.isTooLargeForTokenization() ||
          ((this._backgroundTokenizer.value = this._defaultBackgroundTokenizer =
            new h7(this._tokenizer, e)),
          this._defaultBackgroundTokenizer.handleChanges()),
        t?.backgroundTokenizerShouldOnlyVerifyTokens && t.createBackgroundTokenizer
          ? ((this._debugBackgroundTokens = new O7(this._languageIdCodec)),
            (this._debugBackgroundStates = new l7(this._textModel.getLineCount())),
            this._debugBackgroundTokenizer.clear(),
            (this._debugBackgroundTokenizer.value = t.createBackgroundTokenizer(this._textModel, {
              setTokens: (e) => {
                this._debugBackgroundTokens?.setMultilineTokens(e, this._textModel);
              },
              backgroundTokenizationFinished() {},
              setEndState: (e, t) => {
                this._debugBackgroundStates?.setEndState(e, t);
              },
            })))
          : ((this._debugBackgroundTokens = void 0),
            (this._debugBackgroundStates = void 0),
            (this._debugBackgroundTokenizer.value = void 0)));
    }
    this.refreshAllVisibleLineTokens();
  }
  handleDidChangeAttached() {
    this._defaultBackgroundTokenizer?.handleChanges();
  }
  handleDidChangeContent(e) {
    if (e.isFlush) this.todo_resetTokenization(!1);
    else if (!e.isEolChange) {
      for (const t of e.changes) {
        const [e, n] = Q3(t.text);
        (this._tokens.acceptEdit(t.range, e, n),
          this._debugBackgroundTokens?.acceptEdit(t.range, e, n));
      }
      (this._debugBackgroundStates?.acceptChanges(e.changes),
        this._tokenizer && this._tokenizer.store.acceptChanges(e.changes),
        this._defaultBackgroundTokenizer?.handleChanges());
    }
  }
  setTokens(e) {
    const { changes: t } = this._tokens.setMultilineTokens(e, this._textModel);
    return (
      t.length > 0 && this._onDidChangeTokens.fire({ semanticTokensApplied: !1, ranges: t }),
      { changes: t }
    );
  }
  refreshAllVisibleLineTokens() {
    const e = Q5.joinMany([...this._attachedViewStates].map(([e, t]) => t.lineRanges));
    this.refreshRanges(e);
  }
  refreshRanges(e) {
    for (const t of e) this.refreshRange(t.startLineNumber, t.endLineNumberExclusive - 1);
  }
  refreshRange(e, t) {
    if (!this._tokenizer) return;
    ((e = Math.max(1, Math.min(this._textModel.getLineCount(), e))),
      (t = Math.min(this._textModel.getLineCount(), t)));
    const n = new r7(),
      { heuristicTokens: i } = this._tokenizer.tokenizeHeuristically(n, e, t),
      r = this.setTokens(n.finalize());
    if (i)
      for (const o of r.changes)
        this._backgroundTokenizer.value?.requestTokens(o.fromLineNumber, o.toLineNumber + 1);
    this._defaultBackgroundTokenizer?.checkFinished();
  }
  forceTokenization(e) {
    const t = new r7();
    (this._tokenizer?.updateTokensUntilLine(t, e),
      this.setTokens(t.finalize()),
      this._defaultBackgroundTokenizer?.checkFinished());
  }
  hasAccurateTokensForLine(e) {
    return !this._tokenizer || this._tokenizer.hasAccurateTokensForLine(e);
  }
  isCheapToTokenize(e) {
    return !this._tokenizer || this._tokenizer.isCheapToTokenize(e);
  }
  getLineTokens(e) {
    const t = this._textModel.getLineContent(e),
      n = this._tokens.getTokens(this._textModel.getLanguageId(), e - 1, t);
    if (
      this._debugBackgroundTokens &&
      this._debugBackgroundStates &&
      this._tokenizer &&
      this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax() > e &&
      this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax() > e
    ) {
      const i = this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(), e - 1, t);
      !n.equals(i) &&
        this._debugBackgroundTokenizer.value?.reportMismatchingTokens &&
        this._debugBackgroundTokenizer.value.reportMismatchingTokens(e);
    }
    return n;
  }
  getTokenTypeIfInsertingCharacter(e, t, n) {
    if (!this._tokenizer) return 0;
    const i = this._textModel.validatePosition(new xV(e, t));
    return (
      this.forceTokenization(i.lineNumber),
      this._tokenizer.getTokenTypeIfInsertingCharacter(i, n)
    );
  }
  tokenizeLinesAt(e, t) {
    return this._tokenizer
      ? (this.forceTokenization(e), this._tokenizer.tokenizeLinesAt(e, t))
      : null;
  }
  get hasTokens() {
    return this._tokens.hasTokens;
  }
}
var P7,
  j7 = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let F7 = (P7 = class extends W1 {
  constructor(e, t, n, i, r, o, s, a) {
    (super(),
      (this._textModel = e),
      (this._bracketPairsTextModelPart = t),
      (this._languageId = n),
      (this._attachedViews = i),
      (this._languageService = r),
      (this._languageConfigurationService = o),
      (this._instantiationService = s),
      (this._treeSitterLibraryService = a),
      (this._languageIdObs = LF(this, this._languageId)),
      (this._useTreeSitter = Xj(this, (e) => {
        const t = this._languageIdObs.read(e);
        return this._treeSitterLibraryService.supportsLanguage(t, e);
      })),
      (this.tokens = Xj(this, (e) => {
        let t;
        return (
          (t = this._useTreeSitter.read(e)
            ? e.store.add(
                this._instantiationService.createInstance(
                  L7,
                  this._languageIdObs,
                  this._languageService.languageIdCodec,
                  this._textModel,
                  this._attachedViews.visibleLineRanges,
                ),
              )
            : e.store.add(
                new A7(
                  this._languageService.languageIdCodec,
                  this._textModel,
                  () => this._languageId,
                  this._attachedViews,
                ),
              )),
          e.store.add(
            t.onDidChangeTokens((e) => {
              this._emitModelTokensChangedEvent(e);
            }),
          ),
          e.store.add(
            t.onDidChangeBackgroundTokenizationState((e) => {
              this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState();
            }),
          ),
          t
        );
      })));
    let l = !1;
    (this.tokens.recomputeInitiallyAndOnChange(this._store, (e) => {
      (l && e.todo_resetTokenization(), (l = !0));
    }),
      (this._semanticTokens = new D7(this._languageService.languageIdCodec)),
      (this._onDidChangeLanguage = this._register(new QO())),
      (this.onDidChangeLanguage = this._onDidChangeLanguage.event),
      (this._onDidChangeLanguageConfiguration = this._register(new QO())),
      (this.onDidChangeLanguageConfiguration = this._onDidChangeLanguageConfiguration.event),
      (this._onDidChangeTokens = this._register(new QO())),
      (this.onDidChangeTokens = this._onDidChangeTokens.event));
  }
  handleLanguageConfigurationServiceChange(e) {
    e.affects(this._languageId) && this._onDidChangeLanguageConfiguration.fire({});
  }
  handleDidChangeContent(e) {
    if (e.isFlush) this._semanticTokens.flush();
    else if (!e.isEolChange)
      for (const t of e.changes) {
        const [e, n, i] = Q3(t.text);
        this._semanticTokens.acceptEdit(
          t.range,
          e,
          n,
          i,
          t.text.length > 0 ? t.text.charCodeAt(0) : 0,
        );
      }
    this.tokens.get().handleDidChangeContent(e);
  }
  handleDidChangeAttached() {
    this.tokens.get().handleDidChangeAttached();
  }
  getLineTokens(e) {
    this.validateLineNumber(e);
    const t = this.tokens.get().getLineTokens(e);
    return this._semanticTokens.addSparseTokens(e, t);
  }
  _emitModelTokensChangedEvent(e) {
    this._textModel._isDisposing() ||
      (this._bracketPairsTextModelPart.handleDidChangeTokens(e), this._onDidChangeTokens.fire(e));
  }
  validateLineNumber(e) {
    if (e < 1 || e > this._textModel.getLineCount()) throw new QI("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(e) {
    (this.validateLineNumber(e), this.tokens.get().forceTokenization(e));
  }
  hasAccurateTokensForLine(e) {
    return (this.validateLineNumber(e), this.tokens.get().hasAccurateTokensForLine(e));
  }
  isCheapToTokenize(e) {
    return (this.validateLineNumber(e), this.tokens.get().isCheapToTokenize(e));
  }
  tokenizeIfCheap(e) {
    (this.validateLineNumber(e), this.tokens.get().tokenizeIfCheap(e));
  }
  getTokenTypeIfInsertingCharacter(e, t, n) {
    return this.tokens.get().getTokenTypeIfInsertingCharacter(e, t, n);
  }
  tokenizeLinesAt(e, t) {
    return this.tokens.get().tokenizeLinesAt(e, t);
  }
  setSemanticTokens(e, t) {
    (this._semanticTokens.set(e, t, this._textModel),
      this._emitModelTokensChangedEvent({
        semanticTokensApplied: null !== e,
        ranges: [{ fromLineNumber: 1, toLineNumber: this._textModel.getLineCount() }],
      }));
  }
  hasCompleteSemanticTokens() {
    return this._semanticTokens.isComplete();
  }
  hasSomeSemanticTokens() {
    return !this._semanticTokens.isEmpty();
  }
  setPartialSemanticTokens(e, t) {
    if (this.hasCompleteSemanticTokens()) return;
    const n = this._textModel.validateRange(this._semanticTokens.setPartial(e, t));
    this._emitModelTokensChangedEvent({
      semanticTokensApplied: !0,
      ranges: [{ fromLineNumber: n.startLineNumber, toLineNumber: n.endLineNumber }],
    });
  }
  getWordAtPosition(e) {
    this.assertNotDisposed();
    const t = this._textModel.validatePosition(e),
      n = this._textModel.getLineContent(t.lineNumber),
      i = this.getLineTokens(t.lineNumber),
      r = i.findTokenIndexAtOffset(t.column - 1),
      [o, s] = P7._findLanguageBoundaries(i, r),
      a = dU(
        t.column,
        this.getLanguageConfiguration(i.getLanguageId(r)).getWordDefinition(),
        n.substring(o, s),
        o,
      );
    if (a && a.startColumn <= e.column && e.column <= a.endColumn) return a;
    if (r > 0 && o === t.column - 1) {
      const [o, s] = P7._findLanguageBoundaries(i, r - 1),
        a = dU(
          t.column,
          this.getLanguageConfiguration(i.getLanguageId(r - 1)).getWordDefinition(),
          n.substring(o, s),
          o,
        );
      if (a && a.startColumn <= e.column && e.column <= a.endColumn) return a;
    }
    return null;
  }
  getLanguageConfiguration(e) {
    return this._languageConfigurationService.getLanguageConfiguration(e);
  }
  static _findLanguageBoundaries(e, t) {
    const n = e.getLanguageId(t);
    let i = 0;
    for (let o = t; o >= 0 && e.getLanguageId(o) === n; o--) i = e.getStartOffset(o);
    let r = e.getLineContent().length;
    for (let o = t, s = e.getCount(); o < s && e.getLanguageId(o) === n; o++) r = e.getEndOffset(o);
    return [i, r];
  }
  getWordUntilPosition(e) {
    const t = this.getWordAtPosition(e);
    return t
      ? {
          word: t.word.substr(0, e.column - t.startColumn),
          startColumn: t.startColumn,
          endColumn: e.column,
        }
      : { word: "", startColumn: e.column, endColumn: e.column };
  }
  getLanguageId() {
    return this._languageId;
  }
  getLanguageIdAtPosition(e, t) {
    const n = this._textModel.validatePosition(new xV(e, t)),
      i = this.getLineTokens(n.lineNumber);
    return i.getLanguageId(i.findTokenIndexAtOffset(n.column - 1));
  }
  setLanguageId(e, t = "api") {
    if (this._languageId === e) return;
    const n = { oldLanguage: this._languageId, newLanguage: e, source: t };
    ((this._languageId = e),
      this._languageIdObs.set(e, void 0),
      this._bracketPairsTextModelPart.handleDidChangeLanguage(n),
      this._onDidChangeLanguage.fire(n),
      this._onDidChangeLanguageConfiguration.fire({}));
  }
});
F7 = P7 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([j7(4, BU), j7(5, f$), j7(6, vV), j7(7, S7)], F7);
const B7 = bV("undoRedoService");
class V7 {
  constructor(e, t) {
    ((this.resource = e), (this.elements = t));
  }
}
class W7 {
  static {
    this._ID = 0;
  }
  constructor() {
    ((this.id = W7._ID++), (this.order = 1));
  }
  nextOrder() {
    return 0 === this.id ? 0 : this.order++;
  }
  static {
    this.None = new W7();
  }
}
class H7 {
  static {
    this._ID = 0;
  }
  constructor() {
    ((this.id = H7._ID++), (this.order = 1));
  }
  nextOrder() {
    return 0 === this.id ? 0 : this.order++;
  }
  static {
    this.None = new H7();
  }
}
var z7;
function U7(e, t) {
  const n = new Set();
  for (const i of t) e.has(i) && n.add(i);
  return n;
}
class $7 {
  static {
    z7 = Symbol.toStringTag;
  }
  constructor(e, t) {
    ((this.toKey = t), (this._map = new Map()), (this[z7] = "SetWithKey"));
    for (const n of e) this.add(n);
  }
  get size() {
    return this._map.size;
  }
  add(e) {
    const t = this.toKey(e);
    return (this._map.set(t, e), this);
  }
  delete(e) {
    return this._map.delete(this.toKey(e));
  }
  has(e) {
    return this._map.has(this.toKey(e));
  }
  *entries() {
    for (const e of this._map.values()) yield [e, e];
  }
  keys() {
    return this.values();
  }
  *values() {
    for (const e of this._map.values()) yield e;
  }
  clear() {
    this._map.clear();
  }
  forEach(e, t) {
    this._map.forEach((n) => e.call(t, n, n, this));
  }
  [Symbol.iterator]() {
    return this.values();
  }
}
var q7,
  K7 = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
function G7(e, t) {
  let n;
  var i;
  return (
    "string" == typeof e
      ? (n = (function (e) {
          const t = new M9();
          return (t.acceptChunk(e), t.finish());
        })(e))
      : (n =
          (i = e) && "function" == typeof i.read
            ? (function (e) {
                const t = new M9();
                let n;
                for (; "string" == typeof (n = e.read()); ) t.acceptChunk(n);
                return t.finish();
              })(e)
            : e),
    n.create(t)
  );
}
let Z7 = 0;
class Y7 {
  constructor(e) {
    ((this._source = e), (this._eos = !1));
  }
  read() {
    if (this._eos) return null;
    const e = [];
    let t = 0,
      n = 0;
    for (;;) {
      const i = this._source.read();
      if (null === i) return ((this._eos = !0), 0 === t ? null : e.join(""));
      if ((i.length > 0 && ((e[t++] = i), (n += i.length)), n >= 65536)) return e.join("");
    }
  }
}
const X7 = () => {
  throw new Error("Invalid change accessor");
};
let Q7 = class extends PO {
  static {
    q7 = this;
  }
  static {
    this._MODEL_SYNC_LIMIT = 52428800;
  }
  static {
    this.LARGE_FILE_SIZE_THRESHOLD = 20971520;
  }
  static {
    this.LARGE_FILE_LINE_COUNT_THRESHOLD = 3e5;
  }
  static {
    this.LARGE_FILE_HEAP_OPERATION_THRESHOLD = 268435456;
  }
  static {
    this.DEFAULT_CREATION_OPTIONS = {
      isForSimpleWidget: !1,
      tabSize: eK.tabSize,
      indentSize: eK.indentSize,
      insertSpaces: eK.insertSpaces,
      detectIndentation: !1,
      defaultEOL: 1,
      trimAutoWhitespace: eK.trimAutoWhitespace,
      largeFileOptimizations: eK.largeFileOptimizations,
      bracketPairColorizationOptions: eK.bracketPairColorizationOptions,
    };
  }
  static resolveOptions(e, t) {
    if (t.detectIndentation) {
      const n = T8(e, t.tabSize, t.insertSpaces);
      return new Yz({
        tabSize: n.tabSize,
        indentSize: "tabSize",
        insertSpaces: n.insertSpaces,
        trimAutoWhitespace: t.trimAutoWhitespace,
        defaultEOL: t.defaultEOL,
        bracketPairColorizationOptions: t.bracketPairColorizationOptions,
      });
    }
    return new Yz(t);
  }
  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(e) {
    return this._eventEmitter.slowEvent((t) => e(t.contentChangedEvent));
  }
  onDidChangeContentOrInjectedText(e) {
    return RO(
      this._eventEmitter.fastEvent((t) => e(t)),
      this._onDidChangeInjectedText.event((t) => e(t)),
    );
  }
  _isDisposing() {
    return this.__isDisposing;
  }
  get tokenization() {
    return this._tokenizationTextModelPart;
  }
  get bracketPairs() {
    return this._bracketPairs;
  }
  get guides() {
    return this._guidesTextModelPart;
  }
  constructor(e, t, n, i = null, r, o, s, a) {
    (super(),
      (this._undoRedoService = r),
      (this._languageService = o),
      (this._languageConfigurationService = s),
      (this.instantiationService = a),
      (this._onWillDispose = this._register(new QO())),
      (this.onWillDispose = this._onWillDispose.event),
      (this._onDidChangeDecorations = this._register(
        new pee((e, t, n) => this.handleBeforeFireDecorationsChangedEvent(e, t, n)),
      )),
      (this.onDidChangeDecorations = this._onDidChangeDecorations.event),
      (this._onDidChangeOptions = this._register(new QO())),
      (this._onDidChangeAttached = this._register(new QO())),
      (this._onDidChangeInjectedText = this._register(new QO())),
      (this._onDidChangeLineHeight = this._register(new QO())),
      (this._onDidChangeFont = this._register(new QO())),
      (this._eventEmitter = this._register(new fee())),
      (this._languageSelectionListener = this._register(new jO())),
      (this._deltaDecorationCallCnt = 0),
      (this._attachedViews = new B9()),
      Z7++,
      (this.id = "$model" + Z7),
      (this.isForSimpleWidget = n.isForSimpleWidget),
      (this._associatedResource = null == i ? mP.parse("inmemory://model/" + Z7) : i),
      (this._attachedEditorCount = 0));
    const { textBuffer: l, disposable: c } = G7(e, n.defaultEOL);
    ((this._buffer = l), (this._bufferDisposable = c));
    const d = this._buffer.getLineCount(),
      u = this._buffer.getValueLengthInRange(new YH(1, 1, d, this._buffer.getLineLength(d) + 1), 0);
    (n.largeFileOptimizations
      ? ((this._isTooLargeForTokenization =
          u > q7.LARGE_FILE_SIZE_THRESHOLD || d > q7.LARGE_FILE_LINE_COUNT_THRESHOLD),
        (this._isTooLargeForHeapOperation = u > q7.LARGE_FILE_HEAP_OPERATION_THRESHOLD))
      : ((this._isTooLargeForTokenization = !1), (this._isTooLargeForHeapOperation = !1)),
      (this._options = q7.resolveOptions(this._buffer, n)));
    const h = "string" == typeof t ? t : t.languageId;
    ("string" != typeof t &&
      (this._languageSelectionListener.value = t.onDidChange(() =>
        this._setLanguage(t.languageId),
      )),
      (this._bracketPairs = this._register(new r8(this, this._languageConfigurationService))),
      (this._guidesTextModelPart = this._register(
        new q1(this, this._languageConfigurationService),
      )),
      (this._decorationProvider = this._register(new l8(this))),
      (this._tokenizationTextModelPart = this.instantiationService.createInstance(
        F7,
        this,
        this._bracketPairs,
        h,
        this._attachedViews,
      )),
      (this._isTooLargeForSyncing = u > q7._MODEL_SYNC_LIMIT),
      (this._versionId = 1),
      (this._alternativeVersionId = 1),
      (this._initialUndoRedoSnapshot = null),
      (this._isDisposed = !1),
      (this.__isDisposing = !1),
      (this._instanceId = DA(Z7)),
      (this._lastDecorationId = 0),
      (this._decorations = Object.create(null)),
      (this._decorationsTree = new nee()),
      (this._commandManager = new N8(this, this._undoRedoService)),
      (this._isUndoing = !1),
      (this._isRedoing = !1),
      (this._trimAutoWhitespaceLines = null),
      this._register(
        this._decorationProvider.onDidChange(() => {
          (this._onDidChangeDecorations.beginDeferredEmit(),
            this._onDidChangeDecorations.fire(),
            this._onDidChangeDecorations.endDeferredEmit());
        }),
      ),
      this._languageService.requestRichLanguageFeatures(h),
      this._register(
        this._languageConfigurationService.onDidChange((e) => {
          (this._bracketPairs.handleLanguageConfigurationServiceChange(e),
            this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(e));
        }),
      ));
  }
  dispose() {
    ((this.__isDisposing = !0),
      this._onWillDispose.fire(),
      this._tokenizationTextModelPart.dispose(),
      (this._isDisposed = !0),
      super.dispose(),
      this._bufferDisposable.dispose(),
      (this.__isDisposing = !1));
    const e = new R9([], "", "\n", !1, !1, !0, !0);
    (e.dispose(), (this._buffer = e), (this._bufferDisposable = PO.None));
  }
  _assertNotDisposed() {
    if (this._isDisposed) throw new QI("Model is disposed!");
  }
  getTextBuffer() {
    return (this._assertNotDisposed(), this._buffer);
  }
  _emitContentChangedEvent(e, t) {
    this.__isDisposing ||
      (this._tokenizationTextModelPart.handleDidChangeContent(t),
      this._bracketPairs.handleDidChangeContent(t),
      this._eventEmitter.fire(new H3(e, t)));
  }
  setValue(e, t = m8.setValue()) {
    if ((this._assertNotDisposed(), null == e)) throw GI();
    const { textBuffer: n, disposable: i } = G7(e, this._options.defaultEOL);
    this._setValueFromTextBuffer(n, i, t);
  }
  _createContentChanged2(e, t, n, i, r, o, s, a, l, c) {
    return {
      changes: [{ range: e, rangeOffset: t, rangeLength: n, text: r }],
      eol: this._buffer.getEOL(),
      isEolChange: l,
      versionId: this.getVersionId(),
      isUndoing: o,
      isRedoing: s,
      isFlush: a,
      detailedReasons: [c],
      detailedReasonsChangeLengths: [1],
    };
  }
  _setValueFromTextBuffer(e, t, n) {
    this._assertNotDisposed();
    const i = this.getFullModelRange(),
      r = this.getValueLengthInRange(i),
      o = this.getLineCount(),
      s = this.getLineMaxColumn(o);
    ((this._buffer = e),
      this._bufferDisposable.dispose(),
      (this._bufferDisposable = t),
      this._increaseVersionId(),
      (this._decorations = Object.create(null)),
      (this._decorationsTree = new nee()),
      this._commandManager.clear(),
      (this._trimAutoWhitespaceLines = null),
      this._emitContentChangedEvent(
        new F3([new T3()], this._versionId, !1, !1),
        this._createContentChanged2(
          new YH(1, 1, o, s),
          0,
          r,
          new xV(o, s),
          this.getValue(),
          !1,
          !1,
          !0,
          !1,
          n,
        ),
      ));
  }
  setEOL(e) {
    this._assertNotDisposed();
    const t = 1 === e ? "\r\n" : "\n";
    if (this._buffer.getEOL() === t) return;
    const n = this.getFullModelRange(),
      i = this.getValueLengthInRange(n),
      r = this.getLineCount(),
      o = this.getLineMaxColumn(r);
    (this._onBeforeEOLChange(),
      this._buffer.setEOL(t),
      this._increaseVersionId(),
      this._onAfterEOLChange(),
      this._emitContentChangedEvent(
        new F3([new j3()], this._versionId, !1, !1),
        this._createContentChanged2(
          new YH(1, 1, r, o),
          0,
          i,
          new xV(r, o),
          this.getValue(),
          !1,
          !1,
          !1,
          !0,
          m8.eolChange(),
        ),
      ));
  }
  _onBeforeEOLChange() {
    this._decorationsTree.ensureAllNodesHaveRanges(this);
  }
  _onAfterEOLChange() {
    const e = this.getVersionId(),
      t = this._decorationsTree.collectNodesPostOrder();
    for (let n = 0, i = t.length; n < i; n++) {
      const i = t[n],
        r = i.range,
        o = i.cachedAbsoluteStart - i.start,
        s = this._buffer.getOffsetAt(r.startLineNumber, r.startColumn),
        a = this._buffer.getOffsetAt(r.endLineNumber, r.endColumn);
      ((i.cachedAbsoluteStart = s),
        (i.cachedAbsoluteEnd = a),
        (i.cachedVersionId = e),
        (i.start = s - o),
        (i.end = a - o),
        e9(i));
    }
  }
  onBeforeAttached() {
    return (
      this._attachedEditorCount++,
      1 === this._attachedEditorCount &&
        (this._tokenizationTextModelPart.handleDidChangeAttached(),
        this._onDidChangeAttached.fire(void 0)),
      this._attachedViews.attachView()
    );
  }
  onBeforeDetached(e) {
    (this._attachedEditorCount--,
      0 === this._attachedEditorCount &&
        (this._tokenizationTextModelPart.handleDidChangeAttached(),
        this._onDidChangeAttached.fire(void 0)),
      this._attachedViews.detachView(e));
  }
  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 !1;
    let e = 0,
      t = 0;
    const n = this._buffer.getLineCount();
    for (let i = 1; i <= n; i++) {
      const n = this._buffer.getLineLength(i);
      n >= 1e4 ? (t += n) : (e += n);
    }
    return t > e;
  }
  get uri() {
    return this._associatedResource;
  }
  getOptions() {
    return (this._assertNotDisposed(), this._options);
  }
  getFormattingOptions() {
    return { tabSize: this._options.indentSize, insertSpaces: this._options.insertSpaces };
  }
  updateOptions(e) {
    this._assertNotDisposed();
    const t = void 0 !== e.tabSize ? e.tabSize : this._options.tabSize,
      n = void 0 !== e.indentSize ? e.indentSize : this._options.originalIndentSize,
      i = void 0 !== e.insertSpaces ? e.insertSpaces : this._options.insertSpaces,
      r = void 0 !== e.trimAutoWhitespace ? e.trimAutoWhitespace : this._options.trimAutoWhitespace,
      o =
        void 0 !== e.bracketColorizationOptions
          ? e.bracketColorizationOptions
          : this._options.bracketPairColorizationOptions,
      s = new Yz({
        tabSize: t,
        indentSize: n,
        insertSpaces: i,
        defaultEOL: this._options.defaultEOL,
        trimAutoWhitespace: r,
        bracketPairColorizationOptions: o,
      });
    if (this._options.equals(s)) return;
    const a = this._options.createChangeEvent(s);
    ((this._options = s),
      this._bracketPairs.handleDidChangeOptions(a),
      this._decorationProvider.handleDidChangeOptions(a),
      this._onDidChangeOptions.fire(a));
  }
  detectIndentation(e, t) {
    this._assertNotDisposed();
    const n = T8(this._buffer, t, e);
    this.updateOptions({ insertSpaces: n.insertSpaces, tabSize: n.tabSize, indentSize: n.tabSize });
  }
  normalizeIndentation(e) {
    return (this._assertNotDisposed(), nz(e, this._options.indentSize, this._options.insertSpaces));
  }
  getVersionId() {
    return (this._assertNotDisposed(), this._versionId);
  }
  mightContainRTL() {
    return this._buffer.mightContainRTL();
  }
  mightContainUnusualLineTerminators() {
    return this._buffer.mightContainUnusualLineTerminators();
  }
  removeUnusualLineTerminators(e = null) {
    const t = this.findMatches(CA.source, !1, !0, !1, null, !1, 1073741824);
    (this._buffer.resetMightContainUnusualLineTerminators(),
      this.pushEditOperations(
        e,
        t.map((e) => ({ range: e.range, text: null })),
        () => null,
      ));
  }
  mightContainNonBasicASCII() {
    return this._buffer.mightContainNonBasicASCII();
  }
  getAlternativeVersionId() {
    return (this._assertNotDisposed(), this._alternativeVersionId);
  }
  getInitialUndoRedoSnapshot() {
    return (this._assertNotDisposed(), this._initialUndoRedoSnapshot);
  }
  getOffsetAt(e) {
    this._assertNotDisposed();
    const t = this._validatePosition(e.lineNumber, e.column, 0);
    return this._buffer.getOffsetAt(t.lineNumber, t.column);
  }
  getPositionAt(e) {
    this._assertNotDisposed();
    const t = Math.min(this._buffer.getLength(), Math.max(0, e));
    return this._buffer.getPositionAt(t);
  }
  _increaseVersionId() {
    ((this._versionId = this._versionId + 1), (this._alternativeVersionId = this._versionId));
  }
  _overwriteVersionId(e) {
    this._versionId = e;
  }
  _overwriteAlternativeVersionId(e) {
    this._alternativeVersionId = e;
  }
  _overwriteInitialUndoRedoSnapshot(e) {
    this._initialUndoRedoSnapshot = e;
  }
  getValue(e, t = !1) {
    if ((this._assertNotDisposed(), this.isTooLargeForHeapOperation()))
      throw new QI("Operation would exceed heap memory limits");
    const n = this.getFullModelRange(),
      i = this.getValueInRange(n, e);
    return t ? this._buffer.getBOM() + i : i;
  }
  createSnapshot(e = !1) {
    return new Y7(this._buffer.createSnapshot(e));
  }
  getValueLength(e, t = !1) {
    this._assertNotDisposed();
    const n = this.getFullModelRange(),
      i = this.getValueLengthInRange(n, e);
    return t ? this._buffer.getBOM().length + i : i;
  }
  getValueInRange(e, t = 0) {
    return (this._assertNotDisposed(), this._buffer.getValueInRange(this.validateRange(e), t));
  }
  getValueLengthInRange(e, t = 0) {
    return (
      this._assertNotDisposed(),
      this._buffer.getValueLengthInRange(this.validateRange(e), t)
    );
  }
  getCharacterCountInRange(e, t = 0) {
    return (
      this._assertNotDisposed(),
      this._buffer.getCharacterCountInRange(this.validateRange(e), t)
    );
  }
  getLineCount() {
    return (this._assertNotDisposed(), this._buffer.getLineCount());
  }
  getLineContent(e) {
    if ((this._assertNotDisposed(), e < 1 || e > this.getLineCount()))
      throw new QI("Illegal value for lineNumber");
    return this._buffer.getLineContent(e);
  }
  getLineLength(e) {
    if ((this._assertNotDisposed(), e < 1 || e > this.getLineCount()))
      throw new QI("Illegal value for lineNumber");
    return this._buffer.getLineLength(e);
  }
  getLinesContent() {
    if ((this._assertNotDisposed(), this.isTooLargeForHeapOperation()))
      throw new QI("Operation would exceed heap memory limits");
    return this._buffer.getLinesContent();
  }
  getEOL() {
    return (this._assertNotDisposed(), this._buffer.getEOL());
  }
  getEndOfLineSequence() {
    return (this._assertNotDisposed(), "\n" === this._buffer.getEOL() ? 0 : 1);
  }
  getLineMinColumn(e) {
    return (this._assertNotDisposed(), 1);
  }
  getLineMaxColumn(e) {
    if ((this._assertNotDisposed(), e < 1 || e > this.getLineCount()))
      throw new QI("Illegal value for lineNumber");
    return this._buffer.getLineLength(e) + 1;
  }
  getLineFirstNonWhitespaceColumn(e) {
    if ((this._assertNotDisposed(), e < 1 || e > this.getLineCount()))
      throw new QI("Illegal value for lineNumber");
    return this._buffer.getLineFirstNonWhitespaceColumn(e);
  }
  getLineLastNonWhitespaceColumn(e) {
    if ((this._assertNotDisposed(), e < 1 || e > this.getLineCount()))
      throw new QI("Illegal value for lineNumber");
    return this._buffer.getLineLastNonWhitespaceColumn(e);
  }
  _validateRangeRelaxedNoAllocations(e) {
    const t = this._buffer.getLineCount(),
      n = e.startLineNumber,
      i = e.startColumn;
    let r = Math.floor("number" != typeof n || isNaN(n) ? 1 : n),
      o = Math.floor("number" != typeof i || isNaN(i) ? 1 : i);
    if (r < 1) ((r = 1), (o = 1));
    else if (r > t) ((r = t), (o = this.getLineMaxColumn(r)));
    else if (o <= 1) o = 1;
    else {
      const e = this.getLineMaxColumn(r);
      o >= e && (o = e);
    }
    const s = e.endLineNumber,
      a = e.endColumn;
    let l = Math.floor("number" != typeof s || isNaN(s) ? 1 : s),
      c = Math.floor("number" != typeof a || isNaN(a) ? 1 : a);
    if (l < 1) ((l = 1), (c = 1));
    else if (l > t) ((l = t), (c = this.getLineMaxColumn(l)));
    else if (c <= 1) c = 1;
    else {
      const e = this.getLineMaxColumn(l);
      c >= e && (c = e);
    }
    return n === r && i === o && s === l && a === c && e instanceof YH && !(e instanceof XH)
      ? e
      : new YH(r, o, l, c);
  }
  _isValidPosition(e, t, n) {
    if ("number" != typeof e || "number" != typeof t) return !1;
    if (isNaN(e) || isNaN(t)) return !1;
    if (e < 1 || t < 1) return !1;
    if ((0 | e) !== e || (0 | t) !== t) return !1;
    if (e > this._buffer.getLineCount()) return !1;
    if (1 === t) return !0;
    if (t > this.getLineMaxColumn(e)) return !1;
    if (1 === n) {
      if (uA(this._buffer.getLineCharCode(e, t - 2))) return !1;
    }
    return !0;
  }
  _validatePosition(e, t, n) {
    const i = Math.floor("number" != typeof e || isNaN(e) ? 1 : e),
      r = Math.floor("number" != typeof t || isNaN(t) ? 1 : t),
      o = this._buffer.getLineCount();
    if (i < 1) return new xV(1, 1);
    if (i > o) return new xV(o, this.getLineMaxColumn(o));
    if (r <= 1) return new xV(i, 1);
    const s = this.getLineMaxColumn(i);
    if (r >= s) return new xV(i, s);
    if (1 === n) {
      if (uA(this._buffer.getLineCharCode(i, r - 2))) return new xV(i, r - 1);
    }
    return new xV(i, r);
  }
  validatePosition(e) {
    return (
      this._assertNotDisposed(),
      e instanceof xV && this._isValidPosition(e.lineNumber, e.column, 1)
        ? e
        : this._validatePosition(e.lineNumber, e.column, 1)
    );
  }
  isValidRange(e) {
    return this._isValidRange(e, 1);
  }
  _isValidRange(e, t) {
    const n = e.startLineNumber,
      i = e.startColumn,
      r = e.endLineNumber,
      o = e.endColumn;
    if (!this._isValidPosition(n, i, 0)) return !1;
    if (!this._isValidPosition(r, o, 0)) return !1;
    if (1 === t) {
      const e = i > 1 ? this._buffer.getLineCharCode(n, i - 2) : 0,
        t =
          o > 1 && o <= this._buffer.getLineLength(r) ? this._buffer.getLineCharCode(r, o - 2) : 0,
        s = uA(e),
        a = uA(t);
      return !s && !a;
    }
    return !0;
  }
  validateRange(e) {
    if (
      (this._assertNotDisposed(), e instanceof YH && !(e instanceof XH) && this._isValidRange(e, 1))
    )
      return e;
    const t = this._validatePosition(e.startLineNumber, e.startColumn, 0),
      n = this._validatePosition(e.endLineNumber, e.endColumn, 0),
      i = t.lineNumber,
      r = t.column,
      o = n.lineNumber,
      s = n.column;
    {
      const e = r > 1 ? this._buffer.getLineCharCode(i, r - 2) : 0,
        t =
          s > 1 && s <= this._buffer.getLineLength(o) ? this._buffer.getLineCharCode(o, s - 2) : 0,
        n = uA(e),
        a = uA(t);
      return n || a
        ? i === o && r === s
          ? new YH(i, r - 1, o, s - 1)
          : n && a
            ? new YH(i, r - 1, o, s + 1)
            : n
              ? new YH(i, r - 1, o, s)
              : new YH(i, r, o, s + 1)
        : new YH(i, r, o, s);
    }
  }
  modifyPosition(e, t) {
    this._assertNotDisposed();
    const n = this.getOffsetAt(e) + t;
    return this.getPositionAt(Math.min(this._buffer.getLength(), Math.max(0, n)));
  }
  getFullModelRange() {
    this._assertNotDisposed();
    const e = this.getLineCount();
    return new YH(1, 1, e, this.getLineMaxColumn(e));
  }
  findMatchesLineByLine(e, t, n, i) {
    return this._buffer.findMatchesLineByLine(e, t, n, i);
  }
  findMatches(e, t, n, i, r, o, s = 999) {
    this._assertNotDisposed();
    let a = null;
    (null !== t &&
      "boolean" != typeof t &&
      (Array.isArray(t) || (t = [t]),
      t.every((e) => YH.isIRange(e)) && (a = t.map((e) => this.validateRange(e)))),
      null === a && (a = [this.getFullModelRange()]),
      (a = a.sort(
        (e, t) => e.startLineNumber - t.startLineNumber || e.startColumn - t.startColumn,
      )));
    const l = [];
    let c;
    if (
      (l.push(a.reduce((e, t) => (YH.areIntersecting(e, t) ? e.plusRange(t) : (l.push(e), t)))),
      !n && e.indexOf("\n") < 0)
    ) {
      const t = new m9(e, n, i, r).parseSearchRequest();
      if (!t) return [];
      c = (e) => this.findMatchesLineByLine(e, t, o, s);
    } else c = (t) => y9.findMatches(this, new m9(e, n, i, r), t, o, s);
    return l.map(c).reduce((e, t) => e.concat(t), []);
  }
  findNextMatch(e, t, n, i, r, o) {
    this._assertNotDisposed();
    const s = this.validatePosition(t);
    if (!n && e.indexOf("\n") < 0) {
      const t = new m9(e, n, i, r).parseSearchRequest();
      if (!t) return null;
      const a = this.getLineCount();
      let l = new YH(s.lineNumber, s.column, a, this.getLineMaxColumn(a)),
        c = this.findMatchesLineByLine(l, t, o, 1);
      return (
        y9.findNextMatch(this, new m9(e, n, i, r), s, o),
        c.length > 0
          ? c[0]
          : ((l = new YH(1, 1, s.lineNumber, this.getLineMaxColumn(s.lineNumber))),
            (c = this.findMatchesLineByLine(l, t, o, 1)),
            c.length > 0 ? c[0] : null)
      );
    }
    return y9.findNextMatch(this, new m9(e, n, i, r), s, o);
  }
  findPreviousMatch(e, t, n, i, r, o) {
    this._assertNotDisposed();
    const s = this.validatePosition(t);
    return y9.findPreviousMatch(this, new m9(e, n, i, r), s, o);
  }
  pushStackElement() {
    this._commandManager.pushStackElement();
  }
  popStackElement() {
    this._commandManager.popStackElement();
  }
  pushEOL(e) {
    if (("\n" === this.getEOL() ? 0 : 1) !== e)
      try {
        (this._onDidChangeDecorations.beginDeferredEmit(),
          this._eventEmitter.beginDeferredEmit(),
          null === this._initialUndoRedoSnapshot &&
            (this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri)),
          this._commandManager.pushEOL(e));
      } finally {
        (this._eventEmitter.endDeferredEmit(), this._onDidChangeDecorations.endDeferredEmit());
      }
  }
  _validateEditOperation(e) {
    return e instanceof Qz
      ? e
      : new Qz(
          e.identifier || null,
          this.validateRange(e.range),
          e.text,
          e.forceMoveMarkers || !1,
          e.isAutoWhitespaceEdit || !1,
          e._isTracked || !1,
        );
  }
  _validateEditOperations(e) {
    const t = [];
    for (let n = 0, i = e.length; n < i; n++) t[n] = this._validateEditOperation(e[n]);
    return t;
  }
  pushEditOperations(e, t, n, i, r) {
    try {
      return (
        this._onDidChangeDecorations.beginDeferredEmit(),
        this._eventEmitter.beginDeferredEmit(),
        this._pushEditOperations(e, this._validateEditOperations(t), n, i, r)
      );
    } finally {
      (this._eventEmitter.endDeferredEmit(), this._onDidChangeDecorations.endDeferredEmit());
    }
  }
  _pushEditOperations(e, t, n, i, r) {
    if (this._options.trimAutoWhitespace && this._trimAutoWhitespaceLines) {
      const n = t.map((e) => ({ range: this.validateRange(e.range), text: e.text }));
      let i = !0;
      if (e)
        for (let t = 0, r = e.length; t < r; t++) {
          const r = e[t];
          let o = !1;
          for (let e = 0, t = n.length; e < t; e++) {
            const t = n[e].range,
              i = t.startLineNumber > r.endLineNumber,
              s = r.startLineNumber > t.endLineNumber;
            if (!i && !s) {
              o = !0;
              break;
            }
          }
          if (!o) {
            i = !1;
            break;
          }
        }
      if (i)
        for (let e = 0, r = this._trimAutoWhitespaceLines.length; e < r; e++) {
          const i = this._trimAutoWhitespaceLines[e],
            r = this.getLineMaxColumn(i);
          let o = !0;
          for (let e = 0, t = n.length; e < t; e++) {
            const t = n[e].range,
              s = n[e].text;
            if (
              !(i < t.startLineNumber || i > t.endLineNumber) &&
              !(
                (i === t.startLineNumber &&
                  t.startColumn === r &&
                  t.isEmpty() &&
                  s &&
                  s.length > 0 &&
                  "\n" === s.charAt(0)) ||
                (i === t.startLineNumber &&
                  1 === t.startColumn &&
                  t.isEmpty() &&
                  s &&
                  s.length > 0 &&
                  "\n" === s.charAt(s.length - 1))
              )
            ) {
              o = !1;
              break;
            }
          }
          if (o) {
            const e = new YH(i, 1, i, r);
            t.push(new Qz(null, e, null, !1, !1, !1));
          }
        }
      this._trimAutoWhitespaceLines = null;
    }
    return (
      null === this._initialUndoRedoSnapshot &&
        (this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri)),
      this._commandManager.pushEditOperation(e, t, n, i, r)
    );
  }
  _applyUndo(e, t, n, i) {
    const r = e.map((e) => {
      const t = this.getPositionAt(e.newPosition),
        n = this.getPositionAt(e.newEnd);
      return { range: new YH(t.lineNumber, t.column, n.lineNumber, n.column), text: e.oldText };
    });
    this._applyUndoRedoEdits(r, t, !0, !1, n, i);
  }
  _applyRedo(e, t, n, i) {
    const r = e.map((e) => {
      const t = this.getPositionAt(e.oldPosition),
        n = this.getPositionAt(e.oldEnd);
      return { range: new YH(t.lineNumber, t.column, n.lineNumber, n.column), text: e.newText };
    });
    this._applyUndoRedoEdits(r, t, !1, !0, n, i);
  }
  _applyUndoRedoEdits(e, t, n, i, r, o) {
    try {
      (this._onDidChangeDecorations.beginDeferredEmit(),
        this._eventEmitter.beginDeferredEmit(),
        (this._isUndoing = n),
        (this._isRedoing = i),
        this.applyEdits(e, !1),
        this.setEOL(t),
        this._overwriteAlternativeVersionId(r));
    } finally {
      ((this._isUndoing = !1),
        (this._isRedoing = !1),
        this._eventEmitter.endDeferredEmit(o),
        this._onDidChangeDecorations.endDeferredEmit());
    }
  }
  applyEdits(e, t, n) {
    try {
      (this._onDidChangeDecorations.beginDeferredEmit(), this._eventEmitter.beginDeferredEmit());
      const i = this._validateEditOperations(e);
      return this._doApplyEdits(i, t ?? !1, n ?? m8.applyEdits());
    } finally {
      (this._eventEmitter.endDeferredEmit(), this._onDidChangeDecorations.endDeferredEmit());
    }
  }
  _doApplyEdits(e, t, n) {
    const i = this._buffer.getLineCount(),
      r = this._buffer.applyEdits(e, this._options.trimAutoWhitespace, t),
      o = this._buffer.getLineCount(),
      s = r.changes;
    if (((this._trimAutoWhitespaceLines = r.trimAutoWhitespaceLineNumbers), 0 !== s.length)) {
      for (let n = 0, i = s.length; n < i; n++) {
        const e = s[n];
        this._decorationsTree.acceptReplace(
          e.rangeOffset,
          e.rangeLength,
          e.text.length,
          e.forceMoveMarkers,
        );
      }
      const e = [];
      this._increaseVersionId();
      let t = i;
      for (let n = 0, i = s.length; n < i; n++) {
        const i = s[n],
          [r] = Q3(i.text);
        this._onDidChangeDecorations.fire();
        const a = i.range.startLineNumber,
          l = i.range.endLineNumber,
          c = l - a,
          d = r,
          u = Math.min(c, d),
          h = d - c,
          g = o - t - h + a,
          p = g,
          f = g + d,
          m = this._decorationsTree.getInjectedTextInInterval(
            this,
            this.getOffsetAt(new xV(p, 1)),
            this.getOffsetAt(new xV(f, this.getLineMaxColumn(f))),
            0,
          ),
          _ = I3.fromDecorations(m),
          v = new Cj(_);
        for (let t = u; t >= 0; t--) {
          const n = a + t,
            i = g + t;
          v.takeFromEndWhile((e) => e.lineNumber > i);
          const r = v.takeFromEndWhile((e) => e.lineNumber === i);
          e.push(new R3(n, this.getLineContent(i), r));
        }
        if (u < c) {
          const t = a + u;
          e.push(new A3(t + 1, l));
        }
        if (u < d) {
          const n = new Cj(_),
            i = a + u,
            r = d - u,
            s = o - t - r + i + 1,
            l = [],
            c = [];
          for (let e = 0; e < r; e++) {
            const t = s + e;
            ((c[e] = this.getLineContent(t)),
              n.takeWhile((e) => e.lineNumber < t),
              (l[e] = n.takeWhile((e) => e.lineNumber === t)));
          }
          e.push(new P3(i + 1, a + d, c, l));
        }
        t += h;
      }
      this._emitContentChangedEvent(
        new F3(e, this.getVersionId(), this._isUndoing, this._isRedoing),
        {
          changes: s,
          eol: this._buffer.getEOL(),
          isEolChange: !1,
          versionId: this.getVersionId(),
          isUndoing: this._isUndoing,
          isRedoing: this._isRedoing,
          isFlush: !1,
          detailedReasons: [n],
          detailedReasonsChangeLengths: [s.length],
        },
      );
    }
    return null === r.reverseEdits ? void 0 : r.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(e, t, n) {
    if (e && e.size > 0) {
      const t = Array.from(e).map(
        (e) => new R3(e, this.getLineContent(e), this._getInjectedTextInLine(e)),
      );
      this._onDidChangeInjectedText.fire(new B3(t));
    }
    if (t && t.size > 0) {
      const e = Array.from(t).map(
        (e) => new O3(e.ownerId, e.decorationId, e.lineNumber, e.lineHeight),
      );
      this._onDidChangeLineHeight.fire(new V3(e));
    }
    if (n && n.size > 0) {
      const e = Array.from(n).map((e) => new M3(e.ownerId, e.lineNumber));
      this._onDidChangeFont.fire(new W3(e));
    }
  }
  changeDecorations(e, t = 0) {
    this._assertNotDisposed();
    try {
      return (this._onDidChangeDecorations.beginDeferredEmit(), this._changeDecorations(t, e));
    } finally {
      this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  _changeDecorations(e, t) {
    const n = {
      addDecoration: (t, n) => this._deltaDecorationsImpl(e, [], [{ range: t, options: n }])[0],
      changeDecoration: (t, n) => {
        this._changeDecorationImpl(e, t, n);
      },
      changeDecorationOptions: (t, n) => {
        this._changeDecorationOptionsImpl(e, t, uee(n));
      },
      removeDecoration: (t) => {
        this._deltaDecorationsImpl(e, [t], []);
      },
      deltaDecorations: (t, n) =>
        0 === t.length && 0 === n.length ? [] : this._deltaDecorationsImpl(e, t, n),
    };
    let i = null;
    try {
      i = t(n);
    } catch (spt) {
      HI(spt);
    }
    return (
      (n.addDecoration = X7),
      (n.changeDecoration = X7),
      (n.changeDecorationOptions = X7),
      (n.removeDecoration = X7),
      (n.deltaDecorations = X7),
      i
    );
  }
  deltaDecorations(e, t, n = 0) {
    if ((this._assertNotDisposed(), e || (e = []), 0 === e.length && 0 === t.length)) return [];
    try {
      return (
        this._deltaDecorationCallCnt++,
        this._deltaDecorationCallCnt > 1 &&
          HI(new Error("Invoking deltaDecorations recursively could lead to leaking decorations.")),
        this._onDidChangeDecorations.beginDeferredEmit(),
        this._deltaDecorationsImpl(n, e, t)
      );
    } finally {
      (this._onDidChangeDecorations.endDeferredEmit(), this._deltaDecorationCallCnt--);
    }
  }
  _getTrackedRange(e) {
    return this.getDecorationRange(e);
  }
  _setTrackedRange(e, t, n) {
    const i = e ? this._decorations[e] : null;
    if (!i)
      return t ? this._deltaDecorationsImpl(0, [], [{ range: t, options: dee[n] }], !0)[0] : null;
    if (!t) return (this._decorationsTree.delete(i), delete this._decorations[i.id], null);
    const r = this._validateRangeRelaxedNoAllocations(t),
      o = this._buffer.getOffsetAt(r.startLineNumber, r.startColumn),
      s = this._buffer.getOffsetAt(r.endLineNumber, r.endColumn);
    return (
      this._decorationsTree.delete(i),
      i.reset(this.getVersionId(), o, s, r),
      i.setOptions(dee[n]),
      this._decorationsTree.insert(i),
      i.id
    );
  }
  removeAllDecorationsWithOwnerId(e) {
    if (this._isDisposed) return;
    const t = this._decorationsTree.collectNodesFromOwner(e);
    for (let n = 0, i = t.length; n < i; n++) {
      const e = t[n];
      (this._decorationsTree.delete(e), delete this._decorations[e.id]);
    }
  }
  getDecorationOptions(e) {
    const t = this._decorations[e];
    return t ? t.options : null;
  }
  getDecorationRange(e) {
    const t = this._decorations[e];
    return t ? this._decorationsTree.getNodeRange(this, t) : null;
  }
  getLineDecorations(e, t = 0, n = !1, i = !1) {
    return e < 1 || e > this.getLineCount() ? [] : this.getLinesDecorations(e, e, t, n, i);
  }
  getLinesDecorations(e, t, n = 0, i = !1, r = !1, o = !1) {
    const s = this.getLineCount(),
      a = Math.min(s, Math.max(1, e)),
      l = Math.min(s, Math.max(1, t)),
      c = this.getLineMaxColumn(l),
      d = new YH(a, 1, l, c),
      u = this._getDecorationsInRange(d, n, i, r, o);
    return (gj(u, this._decorationProvider.getDecorationsInRange(d, n, i)), u);
  }
  getDecorationsInRange(e, t = 0, n = !1, i = !1, r = !1, o = !1) {
    const s = this.validateRange(e),
      a = this._getDecorationsInRange(s, t, n, i, o);
    return (gj(a, this._decorationProvider.getDecorationsInRange(s, t, n, r)), a);
  }
  getOverviewRulerDecorations(e = 0, t = !1, n = !1) {
    return this._decorationsTree.getAll(this, e, t, n, !0, !1);
  }
  getInjectedTextDecorations(e = 0) {
    return this._decorationsTree.getAllInjectedText(this, e);
  }
  getCustomLineHeightsDecorations(e = 0) {
    return this._decorationsTree.getAllCustomLineHeights(this, e);
  }
  _getInjectedTextInLine(e) {
    const t = this._buffer.getOffsetAt(e, 1),
      n = t + this._buffer.getLineLength(e),
      i = this._decorationsTree.getInjectedTextInInterval(this, t, n, 0);
    return I3.fromDecorations(i).filter((t) => t.lineNumber === e);
  }
  getFontDecorationsInRange(e, t = 0) {
    const n = this._buffer.getOffsetAt(e.startLineNumber, e.startColumn),
      i = this._buffer.getOffsetAt(e.endLineNumber, e.endColumn);
    return this._decorationsTree.getFontDecorationsInInterval(this, n, i, t);
  }
  getAllDecorations(e = 0, t = !1, n = !1) {
    let i = this._decorationsTree.getAll(this, e, t, n, !1, !1);
    return ((i = i.concat(this._decorationProvider.getAllDecorations(e, t))), i);
  }
  getAllMarginDecorations(e = 0) {
    return this._decorationsTree.getAll(this, e, !1, !1, !1, !0);
  }
  _getDecorationsInRange(e, t, n, i, r) {
    const o = this._buffer.getOffsetAt(e.startLineNumber, e.startColumn),
      s = this._buffer.getOffsetAt(e.endLineNumber, e.endColumn);
    return this._decorationsTree.getAllInInterval(this, o, s, t, n, i, r);
  }
  getRangeAt(e, t) {
    return this._buffer.getRangeAt(e, t - e);
  }
  _changeDecorationImpl(e, t, n) {
    const i = this._decorations[t];
    if (!i) return;
    if (i.options.after) {
      const e = this.getDecorationRange(t);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber);
    }
    if (i.options.before) {
      const e = this.getDecorationRange(t);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber);
    }
    if (null !== i.options.lineHeight) {
      const n = this.getDecorationRange(t);
      this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(
        e,
        t,
        n.startLineNumber,
        null,
      );
    }
    if (i.options.affectsFont) {
      const n = this.getDecorationRange(t);
      this._onDidChangeDecorations.recordLineAffectedByFontChange(e, i.id, n.startLineNumber);
    }
    const r = this._validateRangeRelaxedNoAllocations(n),
      o = this._buffer.getOffsetAt(r.startLineNumber, r.startColumn),
      s = this._buffer.getOffsetAt(r.endLineNumber, r.endColumn);
    (this._decorationsTree.delete(i),
      i.reset(this.getVersionId(), o, s, r),
      this._decorationsTree.insert(i),
      this._onDidChangeDecorations.checkAffectedAndFire(i.options),
      i.options.after &&
        this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber),
      i.options.before &&
        this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber),
      null !== i.options.lineHeight &&
        this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(
          e,
          t,
          r.startLineNumber,
          i.options.lineHeight,
        ),
      i.options.affectsFont &&
        this._onDidChangeDecorations.recordLineAffectedByFontChange(e, i.id, r.startLineNumber));
  }
  _changeDecorationOptionsImpl(e, t, n) {
    const i = this._decorations[t];
    if (!i) return;
    const r = !(!i.options.overviewRuler || !i.options.overviewRuler.color),
      o = !(!n.overviewRuler || !n.overviewRuler.color);
    if (
      (this._onDidChangeDecorations.checkAffectedAndFire(i.options),
      this._onDidChangeDecorations.checkAffectedAndFire(n),
      i.options.after || n.after)
    ) {
      const e = this._decorationsTree.getNodeRange(this, i);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber);
    }
    if (i.options.before || n.before) {
      const e = this._decorationsTree.getNodeRange(this, i);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber);
    }
    if (null !== i.options.lineHeight || null !== n.lineHeight) {
      const r = this._decorationsTree.getNodeRange(this, i);
      this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(
        e,
        t,
        r.startLineNumber,
        n.lineHeight,
      );
    }
    if (i.options.affectsFont || n.affectsFont) {
      const n = this._decorationsTree.getNodeRange(this, i);
      this._onDidChangeDecorations.recordLineAffectedByFontChange(e, t, n.startLineNumber);
    }
    const s = r !== o,
      a =
        (function (e) {
          return !!e.after || !!e.before;
        })(n) !== tee(i);
    s || a
      ? (this._decorationsTree.delete(i), i.setOptions(n), this._decorationsTree.insert(i))
      : i.setOptions(n);
  }
  _deltaDecorationsImpl(e, t, n, i = !1) {
    const r = this.getVersionId(),
      o = t.length;
    let s = 0;
    const a = n.length;
    let l = 0;
    this._onDidChangeDecorations.beginDeferredEmit();
    try {
      const c = new Array(a);
      for (; s < o || l < a; ) {
        let d = null;
        if (s < o) {
          let n;
          do {
            ((n = t[s++]), (d = this._decorations[n]));
          } while (!d && s < o);
          if (d) {
            if (d.options.after) {
              const e = this._decorationsTree.getNodeRange(this, d);
              this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber);
            }
            if (d.options.before) {
              const e = this._decorationsTree.getNodeRange(this, d);
              this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber);
            }
            if (null !== d.options.lineHeight) {
              const t = this._decorationsTree.getNodeRange(this, d);
              this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(
                e,
                n,
                t.startLineNumber,
                null,
              );
            }
            if (d.options.affectsFont) {
              const t = this._decorationsTree.getNodeRange(this, d);
              this._onDidChangeDecorations.recordLineAffectedByFontChange(e, n, t.startLineNumber);
            }
            (this._decorationsTree.delete(d),
              i || this._onDidChangeDecorations.checkAffectedAndFire(d.options));
          }
        }
        if (l < a) {
          if (!d) {
            const e = ++this._lastDecorationId,
              t = `${this._instanceId};${e}`;
            ((d = new z8(t, 0, 0)), (this._decorations[t] = d));
          }
          const t = n[l],
            o = this._validateRangeRelaxedNoAllocations(t.range),
            s = uee(t.options),
            a = this._buffer.getOffsetAt(o.startLineNumber, o.startColumn),
            u = this._buffer.getOffsetAt(o.endLineNumber, o.endColumn);
          ((d.ownerId = e),
            d.reset(r, a, u, o),
            d.setOptions(s),
            d.options.after &&
              this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),
            d.options.before &&
              this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber),
            null !== d.options.lineHeight &&
              this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(
                e,
                d.id,
                o.startLineNumber,
                d.options.lineHeight,
              ),
            d.options.affectsFont &&
              this._onDidChangeDecorations.recordLineAffectedByFontChange(
                e,
                d.id,
                o.startLineNumber,
              ),
            i || this._onDidChangeDecorations.checkAffectedAndFire(s),
            this._decorationsTree.insert(d),
            (c[l] = d.id),
            l++);
        } else d && delete this._decorations[d.id];
      }
      return c;
    } finally {
      this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  getLanguageId() {
    return this.tokenization.getLanguageId();
  }
  setLanguage(e, t) {
    "string" == typeof e
      ? (this._languageSelectionListener.clear(), this._setLanguage(e, t))
      : ((this._languageSelectionListener.value = e.onDidChange(() =>
          this._setLanguage(e.languageId, t),
        )),
        this._setLanguage(e.languageId, t));
  }
  _setLanguage(e, t) {
    (this.tokenization.setLanguageId(e, t), this._languageService.requestRichLanguageFeatures(e));
  }
  getLanguageIdAtPosition(e, t) {
    return this.tokenization.getLanguageIdAtPosition(e, t);
  }
  getWordAtPosition(e) {
    return this._tokenizationTextModelPart.getWordAtPosition(e);
  }
  getWordUntilPosition(e) {
    return this._tokenizationTextModelPart.getWordUntilPosition(e);
  }
  normalizePosition(e, t) {
    return e;
  }
  getLineIndentColumn(e) {
    return J7(this.getLineContent(e)) + 1;
  }
  toString() {
    return `TextModel(${this.uri.toString()})`;
  }
};
function J7(e) {
  let t = 0;
  for (const n of e) {
    if (" " !== n && "\t" !== n) break;
    t++;
  }
  return t;
}
function eee(e) {
  return !(!e.options.overviewRuler || !e.options.overviewRuler.color);
}
function tee(e) {
  return !!e.options.after || !!e.options.before;
}
Q7 = q7 = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([K7(4, B7), K7(5, BU), K7(6, f$), K7(7, vV)], Q7);
class nee {
  constructor() {
    ((this._decorationsTree0 = new $8()),
      (this._decorationsTree1 = new $8()),
      (this._injectedTextDecorationsTree = new $8()));
  }
  ensureAllNodesHaveRanges(e) {
    this.getAll(e, 0, !1, !1, !1, !1);
  }
  _ensureNodesHaveRanges(e, t) {
    for (const n of t)
      null === n.range && (n.range = e.getRangeAt(n.cachedAbsoluteStart, n.cachedAbsoluteEnd));
    return t;
  }
  getAllInInterval(e, t, n, i, r, o, s) {
    const a = e.getVersionId(),
      l = this._intervalSearch(t, n, i, r, o, a, s);
    return this._ensureNodesHaveRanges(e, l);
  }
  _intervalSearch(e, t, n, i, r, o, s) {
    const a = this._decorationsTree0.intervalSearch(e, t, n, i, r, o, s),
      l = this._decorationsTree1.intervalSearch(e, t, n, i, r, o, s),
      c = this._injectedTextDecorationsTree.intervalSearch(e, t, n, i, r, o, s);
    return a.concat(l).concat(c);
  }
  getInjectedTextInInterval(e, t, n, i) {
    const r = e.getVersionId(),
      o = this._injectedTextDecorationsTree.intervalSearch(t, n, i, !1, !1, r, !1);
    return this._ensureNodesHaveRanges(e, o).filter(
      (e) => e.options.showIfCollapsed || !e.range.isEmpty(),
    );
  }
  getFontDecorationsInInterval(e, t, n, i) {
    const r = e.getVersionId(),
      o = this._decorationsTree0.intervalSearch(t, n, i, !1, !1, r, !1);
    return this._ensureNodesHaveRanges(e, o).filter((e) => e.options.affectsFont);
  }
  getAllInjectedText(e, t) {
    const n = e.getVersionId(),
      i = this._injectedTextDecorationsTree.search(t, !1, !1, n, !1);
    return this._ensureNodesHaveRanges(e, i).filter(
      (e) => e.options.showIfCollapsed || !e.range.isEmpty(),
    );
  }
  getAllCustomLineHeights(e, t) {
    const n = e.getVersionId(),
      i = this._search(t, !1, !1, !1, n, !1);
    return this._ensureNodesHaveRanges(e, i).filter((e) => "number" == typeof e.options.lineHeight);
  }
  getAll(e, t, n, i, r, o) {
    const s = e.getVersionId(),
      a = this._search(t, n, i, r, s, o);
    return this._ensureNodesHaveRanges(e, a);
  }
  _search(e, t, n, i, r, o) {
    if (i) return this._decorationsTree1.search(e, t, n, r, o);
    {
      const i = this._decorationsTree0.search(e, t, n, r, o),
        s = this._decorationsTree1.search(e, t, n, r, o),
        a = this._injectedTextDecorationsTree.search(e, t, n, r, o);
      return i.concat(s).concat(a);
    }
  }
  collectNodesFromOwner(e) {
    const t = this._decorationsTree0.collectNodesFromOwner(e),
      n = this._decorationsTree1.collectNodesFromOwner(e),
      i = this._injectedTextDecorationsTree.collectNodesFromOwner(e);
    return t.concat(n).concat(i);
  }
  collectNodesPostOrder() {
    const e = this._decorationsTree0.collectNodesPostOrder(),
      t = this._decorationsTree1.collectNodesPostOrder(),
      n = this._injectedTextDecorationsTree.collectNodesPostOrder();
    return e.concat(t).concat(n);
  }
  insert(e) {
    tee(e)
      ? this._injectedTextDecorationsTree.insert(e)
      : eee(e)
        ? this._decorationsTree1.insert(e)
        : this._decorationsTree0.insert(e);
  }
  delete(e) {
    tee(e)
      ? this._injectedTextDecorationsTree.delete(e)
      : eee(e)
        ? this._decorationsTree1.delete(e)
        : this._decorationsTree0.delete(e);
  }
  getNodeRange(e, t) {
    const n = e.getVersionId();
    return (
      t.cachedVersionId !== n && this._resolveNode(t, n),
      null === t.range && (t.range = e.getRangeAt(t.cachedAbsoluteStart, t.cachedAbsoluteEnd)),
      t.range
    );
  }
  _resolveNode(e, t) {
    tee(e)
      ? this._injectedTextDecorationsTree.resolveNode(e, t)
      : eee(e)
        ? this._decorationsTree1.resolveNode(e, t)
        : this._decorationsTree0.resolveNode(e, t);
  }
  acceptReplace(e, t, n, i) {
    (this._decorationsTree0.acceptReplace(e, t, n, i),
      this._decorationsTree1.acceptReplace(e, t, n, i),
      this._injectedTextDecorationsTree.acceptReplace(e, t, n, i));
  }
}
function iee(e) {
  return e.replace(/[^a-z0-9\-_]/gi, " ");
}
class ree {
  constructor(e) {
    ((this.color = e.color || ""), (this.darkColor = e.darkColor || ""));
  }
}
class oee extends ree {
  constructor(e) {
    (super(e),
      (this._resolvedColor = null),
      (this.position = "number" == typeof e.position ? e.position : Uz.Center));
  }
  getColor(e) {
    return (
      this._resolvedColor ||
        (IQ(e.type) && this.darkColor
          ? (this._resolvedColor = this._resolveColor(this.darkColor, e))
          : (this._resolvedColor = this._resolveColor(this.color, e))),
      this._resolvedColor
    );
  }
  invalidateCachedColor() {
    this._resolvedColor = null;
  }
  _resolveColor(e, t) {
    if ("string" == typeof e) return e;
    const n = e ? t.getColor(e.id) : null;
    return n ? n.toString() : "";
  }
}
class see {
  constructor(e) {
    ((this.position = e?.position ?? $z.Center), (this.persistLane = e?.persistLane));
  }
}
class aee extends ree {
  constructor(e) {
    (super(e),
      (this.position = e.position),
      (this.sectionHeaderStyle = e.sectionHeaderStyle ?? null),
      (this.sectionHeaderText = e.sectionHeaderText ?? null));
  }
  getColor(e) {
    return (
      this._resolvedColor ||
        (IQ(e.type) && this.darkColor
          ? (this._resolvedColor = this._resolveColor(this.darkColor, e))
          : (this._resolvedColor = this._resolveColor(this.color, e))),
      this._resolvedColor
    );
  }
  invalidateCachedColor() {
    this._resolvedColor = void 0;
  }
  _resolveColor(e, t) {
    return "string" == typeof e ? vG.fromHex(e) : t.getColor(e.id);
  }
}
class lee {
  static from(e) {
    return e instanceof lee ? e : new lee(e);
  }
  constructor(e) {
    ((this.content = e.content || ""),
      (this.tokens = e.tokens ?? null),
      (this.inlineClassName = e.inlineClassName || null),
      (this.inlineClassNameAffectsLetterSpacing = e.inlineClassNameAffectsLetterSpacing || !1),
      (this.attachedData = e.attachedData || null),
      (this.cursorStops = e.cursorStops || null));
  }
}
class cee {
  static register(e) {
    return new cee(e);
  }
  static createDynamic(e) {
    return new cee(e);
  }
  constructor(e) {
    ((this.description = e.description),
      (this.blockClassName = e.blockClassName ? iee(e.blockClassName) : null),
      (this.blockDoesNotCollapse = e.blockDoesNotCollapse ?? null),
      (this.blockIsAfterEnd = e.blockIsAfterEnd ?? null),
      (this.blockPadding = e.blockPadding ?? null),
      (this.stickiness = e.stickiness || 0),
      (this.zIndex = e.zIndex || 0),
      (this.className = e.className ? iee(e.className) : null),
      (this.shouldFillLineOnLineBreak = e.shouldFillLineOnLineBreak ?? null),
      (this.hoverMessage = e.hoverMessage || null),
      (this.glyphMarginHoverMessage = e.glyphMarginHoverMessage || null),
      (this.lineNumberHoverMessage = e.lineNumberHoverMessage || null),
      (this.isWholeLine = e.isWholeLine || !1),
      (this.lineHeight = e.lineHeight ? Math.min(e.lineHeight, 300) : null),
      (this.fontSize = e.fontSize || null),
      (this.affectsFont = !!(e.fontSize || e.fontFamily || e.fontWeight || e.fontStyle)),
      (this.showIfCollapsed = e.showIfCollapsed || !1),
      (this.collapseOnReplaceEdit = e.collapseOnReplaceEdit || !1),
      (this.overviewRuler = e.overviewRuler ? new oee(e.overviewRuler) : null),
      (this.minimap = e.minimap ? new aee(e.minimap) : null),
      (this.glyphMargin = e.glyphMarginClassName ? new see(e.glyphMargin) : null),
      (this.glyphMarginClassName = e.glyphMarginClassName ? iee(e.glyphMarginClassName) : null),
      (this.linesDecorationsClassName = e.linesDecorationsClassName
        ? iee(e.linesDecorationsClassName)
        : null),
      (this.lineNumberClassName = e.lineNumberClassName ? iee(e.lineNumberClassName) : null),
      (this.linesDecorationsTooltip = e.linesDecorationsTooltip
        ? e.linesDecorationsTooltip.replace(/[<>"'&]/g, (e) => {
            switch (e) {
              case "<":
                return "&lt;";
              case ">":
                return "&gt;";
              case '"':
                return "&quot;";
              case "'":
                return "&apos;";
              case "&":
                return "&amp;";
            }
            return e;
          })
        : null),
      (this.firstLineDecorationClassName = e.firstLineDecorationClassName
        ? iee(e.firstLineDecorationClassName)
        : null),
      (this.marginClassName = e.marginClassName ? iee(e.marginClassName) : null),
      (this.inlineClassName = e.inlineClassName ? iee(e.inlineClassName) : null),
      (this.inlineClassNameAffectsLetterSpacing = e.inlineClassNameAffectsLetterSpacing || !1),
      (this.beforeContentClassName = e.beforeContentClassName
        ? iee(e.beforeContentClassName)
        : null),
      (this.afterContentClassName = e.afterContentClassName ? iee(e.afterContentClassName) : null),
      (this.after = e.after ? lee.from(e.after) : null),
      (this.before = e.before ? lee.from(e.before) : null),
      (this.hideInCommentTokens = e.hideInCommentTokens ?? !1),
      (this.hideInStringTokens = e.hideInStringTokens ?? !1),
      (this.textDirection = e.textDirection ?? null));
  }
}
cee.EMPTY = cee.register({ description: "empty" });
const dee = [
  cee.register({ description: "tracked-range-always-grows-when-typing-at-edges", stickiness: 0 }),
  cee.register({ description: "tracked-range-never-grows-when-typing-at-edges", stickiness: 1 }),
  cee.register({ description: "tracked-range-grows-only-when-typing-before", stickiness: 2 }),
  cee.register({ description: "tracked-range-grows-only-when-typing-after", stickiness: 3 }),
];
function uee(e) {
  return e instanceof cee ? e : cee.createDynamic(e);
}
class hee {
  static toKey(e) {
    return `${e.ownerId};${e.decorationId};${e.lineNumber}`;
  }
  constructor(e, t, n, i) {
    ((this.ownerId = e), (this.decorationId = t), (this.lineNumber = n), (this.lineHeight = i));
  }
}
class gee {
  static toKey(e) {
    return `${e.ownerId};${e.decorationId};${e.lineNumber}`;
  }
  constructor(e, t, n) {
    ((this.ownerId = e), (this.decorationId = t), (this.lineNumber = n));
  }
}
class pee extends PO {
  constructor(e) {
    (super(),
      (this.handleBeforeFire = e),
      (this._actual = this._register(new QO())),
      (this.event = this._actual.event),
      (this._affectedInjectedTextLines = null),
      (this._affectedLineHeights = null),
      (this._affectedFontLines = null),
      (this._deferredCnt = 0),
      (this._shouldFireDeferred = !1),
      (this._affectsMinimap = !1),
      (this._affectsOverviewRuler = !1),
      (this._affectsGlyphMargin = !1),
      (this._affectsLineNumber = !1));
  }
  beginDeferredEmit() {
    this._deferredCnt++;
  }
  endDeferredEmit() {
    (this._deferredCnt--,
      0 === this._deferredCnt &&
        (this._shouldFireDeferred && this.doFire(),
        this._affectedInjectedTextLines?.clear(),
        (this._affectedInjectedTextLines = null),
        this._affectedLineHeights?.clear(),
        (this._affectedLineHeights = null),
        this._affectedFontLines?.clear(),
        (this._affectedFontLines = null)));
  }
  recordLineAffectedByInjectedText(e) {
    (this._affectedInjectedTextLines || (this._affectedInjectedTextLines = new Set()),
      this._affectedInjectedTextLines.add(e));
  }
  recordLineAffectedByLineHeightChange(e, t, n, i) {
    (this._affectedLineHeights || (this._affectedLineHeights = new $7([], hee.toKey)),
      this._affectedLineHeights.add(new hee(e, t, n, i)));
  }
  recordLineAffectedByFontChange(e, t, n) {
    (this._affectedFontLines || (this._affectedFontLines = new $7([], gee.toKey)),
      this._affectedFontLines.add(new gee(e, t, n)));
  }
  checkAffectedAndFire(e) {
    ((this._affectsMinimap ||= !!e.minimap?.position),
      (this._affectsOverviewRuler ||= !!e.overviewRuler?.color),
      (this._affectsGlyphMargin ||= !!e.glyphMarginClassName),
      (this._affectsLineNumber ||= !!e.lineNumberClassName),
      this.tryFire());
  }
  fire() {
    ((this._affectsMinimap = !0),
      (this._affectsOverviewRuler = !0),
      (this._affectsGlyphMargin = !0),
      this.tryFire());
  }
  tryFire() {
    0 === this._deferredCnt ? this.doFire() : (this._shouldFireDeferred = !0);
  }
  doFire() {
    this.handleBeforeFire(
      this._affectedInjectedTextLines,
      this._affectedLineHeights,
      this._affectedFontLines,
    );
    const e = {
      affectsMinimap: this._affectsMinimap,
      affectsOverviewRuler: this._affectsOverviewRuler,
      affectsGlyphMargin: this._affectsGlyphMargin,
      affectsLineNumber: this._affectsLineNumber,
    };
    ((this._shouldFireDeferred = !1),
      (this._affectsMinimap = !1),
      (this._affectsOverviewRuler = !1),
      (this._affectsGlyphMargin = !1),
      this._actual.fire(e));
  }
}
class fee extends PO {
  constructor() {
    (super(),
      (this._fastEmitter = this._register(new QO())),
      (this.fastEvent = this._fastEmitter.event),
      (this._slowEmitter = this._register(new QO())),
      (this.slowEvent = this._slowEmitter.event),
      (this._deferredCnt = 0),
      (this._deferredEvent = null));
  }
  beginDeferredEmit() {
    this._deferredCnt++;
  }
  endDeferredEmit(e = null) {
    if ((this._deferredCnt--, 0 === this._deferredCnt && null !== this._deferredEvent)) {
      this._deferredEvent.rawContentChangedEvent.resultingSelection = e;
      const t = this._deferredEvent;
      ((this._deferredEvent = null), this._fastEmitter.fire(t), this._slowEmitter.fire(t));
    }
  }
  fire(e) {
    this._deferredCnt > 0
      ? this._deferredEvent
        ? (this._deferredEvent = this._deferredEvent.merge(e))
        : (this._deferredEvent = e)
      : (this._fastEmitter.fire(e), this._slowEmitter.fire(e));
  }
}
const mee = bV("ILanguageFeaturesService");
class _ee {
  static create(e) {
    return new _ee(e.get(151), e.get(150));
  }
  constructor(e, t) {
    this.classifier = new vee(e, t);
  }
  createLineBreaksComputer(e, t, n, i, r, o) {
    const s = [],
      a = [],
      l = [];
    return {
      addRequest: (e, t, n) => {
        (s.push(e), a.push(t), l.push(n));
      },
      finalize: () => {
        const c = e.typicalFullwidthCharacterWidth / e.typicalHalfwidthCharacterWidth,
          d = [];
        for (let e = 0, u = s.length; e < u; e++) {
          const u = a[e],
            h = l[e],
            g = s[e],
            p = o && g.includes('"') && g.includes("\\n");
          !h || h.injectionOptions || u || p
            ? (d[e] = wee(this.classifier, g, u, t, n, c, i, r, p))
            : (d[e] = xee(this.classifier, h, g, t, n, c, i, r));
        }
        return ((bee.length = 0), (yee.length = 0), d);
      },
    };
  }
}
class vee extends Tz {
  constructor(e, t) {
    super(0);
    for (let n = 0; n < e.length; n++) this.set(e.charCodeAt(n), 1);
    for (let n = 0; n < t.length; n++) this.set(t.charCodeAt(n), 2);
  }
  get(e) {
    return e >= 0 && e < 256
      ? this._asciiMap[e]
      : (e >= 12352 && e <= 12543) || (e >= 13312 && e <= 19903) || (e >= 19968 && e <= 40959)
        ? 3
        : this._map.get(e) || this._defaultValue;
  }
}
let bee = [],
  yee = [];
function xee(e, t, n, i, r, o, s, a) {
  if (-1 === r) return null;
  const l = n.length;
  if (l <= 1) return null;
  const c = "keepAll" === a,
    d = t.breakOffsets,
    u = t.breakOffsetsVisibleColumn,
    h = Nee(n, i, r, o, s),
    g = r - h,
    p = bee,
    f = yee;
  let m = 0,
    _ = 0,
    v = 0,
    b = r;
  const y = d.length;
  let x = 0;
  if (x >= 0) {
    let e = Math.abs(u[x] - b);
    for (; x + 1 < y; ) {
      const t = Math.abs(u[x + 1] - b);
      if (t >= e) break;
      ((e = t), x++);
    }
  }
  for (; x < y; ) {
    let t = x < 0 ? 0 : d[x],
      r = x < 0 ? 0 : u[x];
    _ > t && ((t = _), (r = v));
    let s = 0,
      a = 0,
      h = 0,
      w = 0;
    if (r <= b) {
      let v = r,
        y = 0 === t ? 0 : n.charCodeAt(t - 1),
        x = 0 === t ? 0 : e.get(y),
        C = !0;
      for (let r = t; r < l; r++) {
        const t = r,
          l = n.charCodeAt(r);
        let d, u;
        if (
          (uA(l) ? (r++, (d = 0), (u = 2)) : ((d = e.get(l)), (u = Cee(l, v, i, o))),
          t > _ && Eee(y, x, l, d, c) && ((s = t), (a = v)),
          (v += u),
          v > b)
        ) {
          (t > _ ? ((h = t), (w = v - u)) : ((h = r + 1), (w = v)), v - a > g && (s = 0), (C = !1));
          break;
        }
        ((y = l), (x = d));
      }
      if (C) {
        m > 0 && ((p[m] = d[d.length - 1]), (f[m] = u[d.length - 1]), m++);
        break;
      }
    }
    if (0 === s) {
      let l = r,
        d = n.charCodeAt(t),
        u = e.get(d),
        p = !1;
      for (let i = t - 1; i >= _; i--) {
        const t = i + 1,
          r = n.charCodeAt(i);
        if (9 === r) {
          p = !0;
          break;
        }
        let f, m;
        if ((hA(r) ? (i--, (f = 0), (m = 2)) : ((f = e.get(r)), (m = kA(r) ? o : 1)), l <= b)) {
          if ((0 === h && ((h = t), (w = l)), l <= b - g)) break;
          if (Eee(r, f, d, u, c)) {
            ((s = t), (a = l));
            break;
          }
        }
        ((l -= m), (d = r), (u = f));
      }
      if (0 !== s) {
        const e = g - (w - a);
        if (e <= i) {
          const t = n.charCodeAt(h);
          let r;
          ((r = uA(t) ? 2 : Cee(t, w, i, o)), e - r < 0 && (s = 0));
        }
      }
      if (p) {
        x--;
        continue;
      }
    }
    if ((0 === s && ((s = h), (a = w)), s <= _)) {
      const e = n.charCodeAt(_);
      uA(e) ? ((s = _ + 2), (a = v + 2)) : ((s = _ + 1), (a = v + Cee(e, v, i, o)));
    }
    for (_ = s, p[m] = s, v = a, f[m] = a, m++, b = a + g; x < 0 || (x < y && u[x] < a); ) x++;
    let C = Math.abs(u[x] - b);
    for (; x + 1 < y; ) {
      const e = Math.abs(u[x + 1] - b);
      if (e >= C) break;
      ((C = e), x++);
    }
  }
  return 0 === m
    ? null
    : ((p.length = m),
      (f.length = m),
      (bee = t.breakOffsets),
      (yee = t.breakOffsetsVisibleColumn),
      (t.breakOffsets = p),
      (t.breakOffsetsVisibleColumn = f),
      (t.wrappedTextIndentLength = h),
      t);
}
function wee(e, t, n, i, r, o, s, a, l) {
  const c = I3.applyInjectedText(t, n);
  let d, u;
  if (
    (n && n.length > 0
      ? ((d = n.map((e) => e.options)), (u = n.map((e) => e.column - 1)))
      : ((d = null), (u = null)),
    -1 === r)
  )
    return d ? new E3(u, d, [c.length], [], 0) : null;
  const h = c.length;
  if (h <= 1) return d ? new E3(u, d, [c.length], [], 0) : null;
  const g = "keepAll" === a,
    p = Nee(c, i, r, o, s),
    f = r - p,
    m = [],
    _ = [];
  let v = 0,
    b = 0,
    y = 0,
    x = r,
    w = c.charCodeAt(0),
    C = e.get(w),
    S = Cee(w, 0, i, o),
    k = 1;
  uA(w) && ((S += 1), (w = c.charCodeAt(1)), (C = e.get(w)), k++);
  for (let E = k; E < h; E++) {
    const t = E,
      n = c.charCodeAt(E);
    let r,
      s,
      a = !1;
    (uA(n) ? (E++, (r = 0), (s = 2)) : ((r = e.get(n)), (s = Cee(n, S, i, o))),
      l && kee(c, E) ? ((b = t), (y = S), (a = !0)) : Eee(w, C, n, r, g) && ((b = t), (y = S)),
      (S += s),
      (S > x || a) &&
        ((0 === b || S - y > f) && ((b = t), (y = S - s)),
        (m[v] = b),
        (_[v] = y),
        v++,
        (x = y + f),
        (b = 0)),
      (w = n),
      (C = r));
  }
  return 0 !== v || (n && 0 !== n.length) ? ((m[v] = h), (_[v] = S), new E3(u, d, m, _, p)) : null;
}
function Cee(e, t, n, i) {
  return 9 === e ? n - (t % n) : kA(e) || e < 32 ? i : 1;
}
function See(e, t) {
  return t - (e % t);
}
function kee(e, t) {
  if (t >= 2 && "n" === e.charAt(t - 1)) {
    let n = 0;
    for (let i = t - 2; i >= 0; i--) {
      if ("\\" !== e.charAt(i)) return n % 2 == 1;
      n++;
    }
  }
  return !1;
}
function Eee(e, t, n, i, r) {
  return (
    32 !== n &&
    ((2 === t && 2 !== i) ||
      (1 !== t && 1 === i) ||
      (!r && 3 === t && 2 !== i) ||
      (!r && 3 === i && 1 !== t))
  );
}
function Nee(e, t, n, i, r) {
  let o = 0;
  if (0 !== r) {
    const s = YM(e);
    if (-1 !== s) {
      for (let n = 0; n < s; n++) {
        o += 9 === e.charCodeAt(n) ? See(o, t) : 1;
      }
      const a = 3 === r ? 2 : 2 === r ? 1 : 0;
      for (let e = 0; e < a; e++) {
        o += See(o, t);
      }
      o + i > n && (o = 0);
    }
  }
  return o;
}
let Lee = class e {
  constructor(e) {
    ((this._selTrackedRange = null),
      (this._trackSelection = !0),
      this._setState(
        e,
        new uz(new YH(1, 1, 1, 1), 0, 0, new xV(1, 1), 0),
        new uz(new YH(1, 1, 1, 1), 0, 0, new xV(1, 1), 0),
      ));
  }
  dispose(e) {
    this._removeTrackedRange(e);
  }
  startTrackingSelection(e) {
    ((this._trackSelection = !0), this._updateTrackedRange(e));
  }
  stopTrackingSelection(e) {
    ((this._trackSelection = !1), this._removeTrackedRange(e));
  }
  _updateTrackedRange(e) {
    this._trackSelection &&
      (this._selTrackedRange = e.model._setTrackedRange(
        this._selTrackedRange,
        this.modelState.selection,
        0,
      ));
  }
  _removeTrackedRange(e) {
    this._selTrackedRange = e.model._setTrackedRange(this._selTrackedRange, null, 0);
  }
  asCursorState() {
    return new lz(this.modelState, this.viewState);
  }
  readSelectionFromMarkers(e) {
    const t = e.model._getTrackedRange(this._selTrackedRange);
    return this.modelState.selection.isEmpty() && !t.isEmpty()
      ? XH.fromRange(t.collapseToEnd(), this.modelState.selection.getDirection())
      : XH.fromRange(t, this.modelState.selection.getDirection());
  }
  ensureValidState(e) {
    this._setState(e, this.modelState, this.viewState);
  }
  setState(e, t, n) {
    this._setState(e, t, n);
  }
  static _validatePositionWithCache(e, t, n, i) {
    return t.equals(n) ? i : e.normalizePosition(t, 2);
  }
  static _validateViewState(e, t) {
    const n = t.position,
      i = t.selectionStart.getStartPosition(),
      r = t.selectionStart.getEndPosition(),
      o = e.normalizePosition(n, 2),
      s = this._validatePositionWithCache(e, i, n, o),
      a = this._validatePositionWithCache(e, r, i, s);
    return n.equals(o) && i.equals(s) && r.equals(a)
      ? t
      : new uz(
          YH.fromPositions(s, a),
          t.selectionStartKind,
          t.selectionStartLeftoverVisibleColumns + i.column - s.column,
          o,
          t.leftoverVisibleColumns + n.column - o.column,
        );
  }
  _setState(t, n, i) {
    if ((i && (i = e._validateViewState(t.viewModel, i)), n)) {
      const e = t.model.validateRange(n.selectionStart),
        i = n.selectionStart.equalsRange(e) ? n.selectionStartLeftoverVisibleColumns : 0,
        r = t.model.validatePosition(n.position),
        o = n.position.equals(r) ? n.leftoverVisibleColumns : 0;
      n = new uz(e, n.selectionStartKind, i, r, o);
    } else {
      if (!i) return;
      const e = t.model.validateRange(
          t.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart),
        ),
        r = t.model.validatePosition(
          t.coordinatesConverter.convertViewPositionToModelPosition(i.position),
        );
      n = new uz(
        e,
        i.selectionStartKind,
        i.selectionStartLeftoverVisibleColumns,
        r,
        i.leftoverVisibleColumns,
      );
    }
    if (i) {
      const e = t.coordinatesConverter.validateViewRange(i.selectionStart, n.selectionStart),
        r = t.coordinatesConverter.validateViewPosition(i.position, n.position);
      i = new uz(
        e,
        n.selectionStartKind,
        n.selectionStartLeftoverVisibleColumns,
        r,
        n.leftoverVisibleColumns,
      );
    } else {
      const e = t.coordinatesConverter.convertModelPositionToViewPosition(
          new xV(n.selectionStart.startLineNumber, n.selectionStart.startColumn),
        ),
        r = t.coordinatesConverter.convertModelPositionToViewPosition(
          new xV(n.selectionStart.endLineNumber, n.selectionStart.endColumn),
        ),
        o = new YH(e.lineNumber, e.column, r.lineNumber, r.column),
        s = t.coordinatesConverter.convertModelPositionToViewPosition(n.position);
      i = new uz(
        o,
        n.selectionStartKind,
        n.selectionStartLeftoverVisibleColumns,
        s,
        n.leftoverVisibleColumns,
      );
    }
    ((this.modelState = n), (this.viewState = i), this._updateTrackedRange(t));
  }
};
class Dee {
  constructor(e) {
    ((this.context = e), (this.cursors = [new Lee(e)]), (this.lastAddedCursorIndex = 0));
  }
  dispose() {
    for (const e of this.cursors) e.dispose(this.context);
  }
  startTrackingSelections() {
    for (const e of this.cursors) e.startTrackingSelection(this.context);
  }
  stopTrackingSelections() {
    for (const e of this.cursors) e.stopTrackingSelection(this.context);
  }
  updateContext(e) {
    this.context = e;
  }
  ensureValidState() {
    for (const e of this.cursors) e.ensureValidState(this.context);
  }
  readSelectionFromMarkers() {
    return this.cursors.map((e) => e.readSelectionFromMarkers(this.context));
  }
  getAll() {
    return this.cursors.map((e) => e.asCursorState());
  }
  getViewPositions() {
    return this.cursors.map((e) => e.viewState.position);
  }
  getTopMostViewPosition() {
    return B1(
      this.cursors,
      bj((e) => e.viewState.position, xV.compare),
    ).viewState.position;
  }
  getBottomMostViewPosition() {
    return F1(
      this.cursors,
      bj((e) => e.viewState.position, xV.compare),
    ).viewState.position;
  }
  getSelections() {
    return this.cursors.map((e) => e.modelState.selection);
  }
  getViewSelections() {
    return this.cursors.map((e) => e.viewState.selection);
  }
  setSelections(e) {
    this.setStates(lz.fromModelSelections(e));
  }
  getPrimaryCursor() {
    return this.cursors[0].asCursorState();
  }
  setStates(e) {
    null !== e &&
      (this.cursors[0].setState(this.context, e[0].modelState, e[0].viewState),
      this._setSecondaryStates(e.slice(1)));
  }
  _setSecondaryStates(e) {
    const t = this.cursors.length - 1,
      n = e.length;
    if (t < n) {
      const e = n - t;
      for (let t = 0; t < e; t++) this._addSecondaryCursor();
    } else if (t > n) {
      const e = t - n;
      for (let t = 0; t < e; t++) this._removeSecondaryCursor(this.cursors.length - 2);
    }
    for (let i = 0; i < n; i++)
      this.cursors[i + 1].setState(this.context, e[i].modelState, e[i].viewState);
  }
  killSecondaryCursors() {
    this._setSecondaryStates([]);
  }
  _addSecondaryCursor() {
    (this.cursors.push(new Lee(this.context)),
      (this.lastAddedCursorIndex = this.cursors.length - 1));
  }
  getLastAddedCursorIndex() {
    return 1 === this.cursors.length || 0 === this.lastAddedCursorIndex
      ? 0
      : this.lastAddedCursorIndex;
  }
  _removeSecondaryCursor(e) {
    (this.lastAddedCursorIndex >= e + 1 && this.lastAddedCursorIndex--,
      this.cursors[e + 1].dispose(this.context),
      this.cursors.splice(e + 1, 1));
  }
  normalize() {
    if (1 === this.cursors.length) return;
    const e = this.cursors.slice(0),
      t = [];
    for (let n = 0, i = e.length; n < i; n++)
      t.push({ index: n, selection: e[n].modelState.selection });
    t.sort(bj((e) => e.selection, YH.compareRangesUsingStarts));
    for (let n = 0; n < t.length - 1; n++) {
      const i = t[n],
        r = t[n + 1],
        o = i.selection,
        s = r.selection;
      if (!this.context.cursorConfig.multiCursorMergeOverlapping) continue;
      let a;
      if (
        ((a =
          s.isEmpty() || o.isEmpty()
            ? s.getStartPosition().isBeforeOrEqual(o.getEndPosition())
            : s.getStartPosition().isBefore(o.getEndPosition())),
        a)
      ) {
        const o = i.index < r.index ? n : n + 1,
          s = i.index < r.index ? n + 1 : n,
          a = t[s].index,
          l = t[o].index,
          c = t[s].selection,
          d = t[o].selection;
        if (!c.equalsSelection(d)) {
          const n = c.plusRange(d),
            i =
              c.selectionStartLineNumber === c.startLineNumber &&
              c.selectionStartColumn === c.startColumn,
            r =
              d.selectionStartLineNumber === d.startLineNumber &&
              d.selectionStartColumn === d.startColumn;
          let s, u;
          (a === this.lastAddedCursorIndex ? ((s = i), (this.lastAddedCursorIndex = l)) : (s = r),
            (u = s
              ? new XH(n.startLineNumber, n.startColumn, n.endLineNumber, n.endColumn)
              : new XH(n.endLineNumber, n.endColumn, n.startLineNumber, n.startColumn)),
            (t[o].selection = u));
          const h = lz.fromModelSelection(u);
          e[l].setState(this.context, h.modelState, h.viewState);
        }
        for (const e of t) e.index > a && e.index--;
        (e.splice(a, 1), t.splice(s, 1), this._removeSecondaryCursor(a - 1), n--);
      }
    }
  }
}
class Tee {
  constructor(e, t, n, i) {
    ((this._cursorContextBrand = void 0),
      (this.model = e),
      (this.viewModel = t),
      (this.coordinatesConverter = n),
      (this.cursorConfig = i));
  }
}
class Iee {
  constructor() {
    this.type = 0;
  }
}
class Ree {
  constructor() {
    this.type = 1;
  }
}
class Oee {
  constructor(e) {
    ((this.type = 2), (this._source = e));
  }
  hasChanged(e) {
    return this._source.hasChanged(e);
  }
}
class Mee {
  constructor(e, t, n) {
    ((this.selections = e), (this.modelSelections = t), (this.reason = n), (this.type = 3));
  }
}
class Aee {
  constructor(e) {
    ((this.type = 4),
      e
        ? ((this.affectsMinimap = e.affectsMinimap),
          (this.affectsOverviewRuler = e.affectsOverviewRuler),
          (this.affectsGlyphMargin = e.affectsGlyphMargin),
          (this.affectsLineNumber = e.affectsLineNumber))
        : ((this.affectsMinimap = !0),
          (this.affectsOverviewRuler = !0),
          (this.affectsGlyphMargin = !0),
          (this.affectsLineNumber = !0)));
  }
}
class Pee {
  constructor() {
    this.type = 5;
  }
}
class jee {
  constructor(e) {
    ((this.type = 6), (this.isFocused = e));
  }
}
class Fee {
  constructor() {
    this.type = 7;
  }
}
class Bee {
  constructor() {
    this.type = 8;
  }
}
class Vee {
  constructor(e, t) {
    ((this.fromLineNumber = e), (this.count = t), (this.type = 9));
  }
}
class Wee {
  constructor(e, t) {
    ((this.type = 10), (this.fromLineNumber = e), (this.toLineNumber = t));
  }
}
class Hee {
  constructor(e, t) {
    ((this.type = 11), (this.fromLineNumber = e), (this.toLineNumber = t));
  }
}
class zee {
  constructor(e, t, n, i, r, o, s) {
    ((this.source = e),
      (this.minimalReveal = t),
      (this.range = n),
      (this.selections = i),
      (this.verticalType = r),
      (this.revealHorizontal = o),
      (this.scrollType = s),
      (this.type = 12));
  }
}
class Uee {
  constructor(e) {
    ((this.type = 13),
      (this.scrollWidth = e.scrollWidth),
      (this.scrollLeft = e.scrollLeft),
      (this.scrollHeight = e.scrollHeight),
      (this.scrollTop = e.scrollTop),
      (this.scrollWidthChanged = e.scrollWidthChanged),
      (this.scrollLeftChanged = e.scrollLeftChanged),
      (this.scrollHeightChanged = e.scrollHeightChanged),
      (this.scrollTopChanged = e.scrollTopChanged));
  }
}
class $ee {
  constructor(e) {
    ((this.theme = e), (this.type = 14));
  }
}
class qee {
  constructor(e) {
    ((this.type = 15), (this.ranges = e));
  }
}
class Kee {
  constructor() {
    this.type = 16;
  }
}
let Gee = class {
  constructor() {
    this.type = 17;
  }
};
class Zee extends PO {
  constructor() {
    (super(),
      (this._onEvent = this._register(new QO())),
      (this.onEvent = this._onEvent.event),
      (this._eventHandlers = []),
      (this._viewEventQueue = null),
      (this._isConsumingViewEventQueue = !1),
      (this._collector = null),
      (this._collectorCnt = 0),
      (this._outgoingEvents = []));
  }
  emitOutgoingEvent(e) {
    (this._addOutgoingEvent(e), this._emitOutgoingEvents());
  }
  _addOutgoingEvent(e) {
    for (let t = 0, n = this._outgoingEvents.length; t < n; t++) {
      const n =
        this._outgoingEvents[t].kind === e.kind ? this._outgoingEvents[t].attemptToMerge(e) : null;
      if (n) return void (this._outgoingEvents[t] = n);
    }
    this._outgoingEvents.push(e);
  }
  _emitOutgoingEvents() {
    for (; this._outgoingEvents.length > 0; ) {
      if (this._collector || this._isConsumingViewEventQueue) return;
      const e = this._outgoingEvents.shift();
      e.isNoOp() || this._onEvent.fire(e);
    }
  }
  addViewEventHandler(e) {
    for (let t = 0, n = this._eventHandlers.length; t < n; t++) this._eventHandlers[t];
    this._eventHandlers.push(e);
  }
  removeViewEventHandler(e) {
    for (let t = 0; t < this._eventHandlers.length; t++)
      if (this._eventHandlers[t] === e) {
        this._eventHandlers.splice(t, 1);
        break;
      }
  }
  beginEmitViewEvents() {
    return (
      this._collectorCnt++,
      1 === this._collectorCnt && (this._collector = new Yee()),
      this._collector
    );
  }
  endEmitViewEvents() {
    if ((this._collectorCnt--, 0 === this._collectorCnt)) {
      const e = this._collector.outgoingEvents,
        t = this._collector.viewEvents;
      this._collector = null;
      for (const n of e) this._addOutgoingEvent(n);
      t.length > 0 && this._emitMany(t);
    }
    this._emitOutgoingEvents();
  }
  emitSingleViewEvent(e) {
    try {
      this.beginEmitViewEvents().emitViewEvent(e);
    } finally {
      this.endEmitViewEvents();
    }
  }
  _emitMany(e) {
    (this._viewEventQueue
      ? (this._viewEventQueue = this._viewEventQueue.concat(e))
      : (this._viewEventQueue = e),
      this._isConsumingViewEventQueue || this._consumeViewEventQueue());
  }
  _consumeViewEventQueue() {
    try {
      ((this._isConsumingViewEventQueue = !0), this._doConsumeQueue());
    } finally {
      this._isConsumingViewEventQueue = !1;
    }
  }
  _doConsumeQueue() {
    for (; this._viewEventQueue; ) {
      const e = this._viewEventQueue;
      this._viewEventQueue = null;
      const t = this._eventHandlers.slice(0);
      for (const n of t) n.handleEvents(e);
    }
  }
}
class Yee {
  constructor() {
    ((this.viewEvents = []), (this.outgoingEvents = []));
  }
  emitViewEvent(e) {
    this.viewEvents.push(e);
  }
  emitOutgoingEvent(e) {
    this.outgoingEvents.push(e);
  }
}
class Xee {
  constructor(e, t, n, i) {
    ((this.kind = 0),
      (this._oldContentWidth = e),
      (this._oldContentHeight = t),
      (this.contentWidth = n),
      (this.contentHeight = i),
      (this.contentWidthChanged = this._oldContentWidth !== this.contentWidth),
      (this.contentHeightChanged = this._oldContentHeight !== this.contentHeight));
  }
  isNoOp() {
    return !this.contentWidthChanged && !this.contentHeightChanged;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind
      ? null
      : new Xee(this._oldContentWidth, this._oldContentHeight, e.contentWidth, e.contentHeight);
  }
}
class Qee {
  constructor(e, t) {
    ((this.kind = 1), (this.oldHasFocus = e), (this.hasFocus = t));
  }
  isNoOp() {
    return this.oldHasFocus === this.hasFocus;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : new Qee(this.oldHasFocus, e.hasFocus);
  }
}
class Jee {
  constructor(e, t) {
    ((this.kind = 2), (this.oldHasFocus = e), (this.hasFocus = t));
  }
  isNoOp() {
    return this.oldHasFocus === this.hasFocus;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : new Qee(this.oldHasFocus, e.hasFocus);
  }
}
class ete {
  constructor(e, t, n, i, r, o, s, a) {
    ((this.kind = 3),
      (this._oldScrollWidth = e),
      (this._oldScrollLeft = t),
      (this._oldScrollHeight = n),
      (this._oldScrollTop = i),
      (this.scrollWidth = r),
      (this.scrollLeft = o),
      (this.scrollHeight = s),
      (this.scrollTop = a),
      (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(e) {
    return e.kind !== this.kind
      ? null
      : new ete(
          this._oldScrollWidth,
          this._oldScrollLeft,
          this._oldScrollHeight,
          this._oldScrollTop,
          e.scrollWidth,
          e.scrollLeft,
          e.scrollHeight,
          e.scrollTop,
        );
  }
}
class tte {
  constructor() {
    this.kind = 4;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : this;
  }
}
class nte {
  constructor() {
    this.kind = 5;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : this;
  }
}
class ite {
  constructor(e, t, n, i, r, o, s) {
    ((this.kind = 7),
      (this.oldSelections = e),
      (this.selections = t),
      (this.oldModelVersionId = n),
      (this.modelVersionId = i),
      (this.source = r),
      (this.reason = o),
      (this.reachedMaxCursorCount = s));
  }
  static _selectionsAreEqual(e, t) {
    if (!e && !t) return !0;
    if (!e || !t) return !1;
    const n = e.length;
    if (n !== t.length) return !1;
    for (let i = 0; i < n; i++) if (!e[i].equalsSelection(t[i])) return !1;
    return !0;
  }
  isNoOp() {
    return (
      ite._selectionsAreEqual(this.oldSelections, this.selections) &&
      this.oldModelVersionId === this.modelVersionId
    );
  }
  attemptToMerge(e) {
    return e.kind !== this.kind
      ? null
      : new ite(
          this.oldSelections,
          e.selections,
          this.oldModelVersionId,
          e.modelVersionId,
          e.source,
          e.reason,
          this.reachedMaxCursorCount || e.reachedMaxCursorCount,
        );
  }
}
class rte {
  constructor() {
    this.kind = 6;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : this;
  }
}
class ote {
  constructor(e) {
    ((this.event = e), (this.kind = 8));
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class ste {
  constructor(e) {
    ((this.event = e), (this.kind = 9));
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class ate {
  constructor(e) {
    ((this.event = e), (this.kind = 10));
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class lte {
  constructor(e) {
    ((this.event = e), (this.kind = 11));
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class cte {
  constructor(e) {
    ((this.event = e), (this.kind = 12));
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class dte {
  constructor(e) {
    ((this.event = e), (this.kind = 13));
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class ute {
  constructor(e) {
    ((this.event = e), (this.kind = 14));
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class hte {
  constructor(e) {
    ((this.event = e), (this.kind = 15));
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class gte extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._model = e),
      (this._knownModelVersionId = this._model.getVersionId()),
      (this._viewModel = t),
      (this._coordinatesConverter = n),
      (this.context = new Tee(this._model, this._viewModel, this._coordinatesConverter, i)),
      (this._cursors = new Dee(this.context)),
      (this._hasFocus = !1),
      (this._isHandling = !1),
      (this._compositionState = null),
      (this._columnSelectData = null),
      (this._autoClosedActions = []),
      (this._prevEditOperationType = 0));
  }
  dispose() {
    (this._cursors.dispose(),
      (this._autoClosedActions = IO(this._autoClosedActions)),
      super.dispose());
  }
  updateConfiguration(e) {
    ((this.context = new Tee(this._model, this._viewModel, this._coordinatesConverter, e)),
      this._cursors.updateContext(this.context));
  }
  onLineMappingChanged(e) {
    this._knownModelVersionId === this._model.getVersionId() &&
      this.setStates(e, "viewModel", 0, this.getCursorStates());
  }
  setHasFocus(e) {
    this._hasFocus = e;
  }
  _validateAutoClosedActions() {
    if (this._autoClosedActions.length > 0) {
      const e = this._cursors.getSelections();
      for (let t = 0; t < this._autoClosedActions.length; t++) {
        const n = this._autoClosedActions[t];
        n.isValid(e) || (n.dispose(), this._autoClosedActions.splice(t, 1), t--);
      }
    }
  }
  getPrimaryCursorState() {
    return this._cursors.getPrimaryCursor();
  }
  getLastAddedCursorIndex() {
    return this._cursors.getLastAddedCursorIndex();
  }
  getCursorStates() {
    return this._cursors.getAll();
  }
  setStates(e, t, n, i) {
    let r = !1;
    const o = this.context.cursorConfig.multiCursorLimit;
    null !== i && i.length > o && ((i = i.slice(0, o)), (r = !0));
    const s = pte.from(this._model, this);
    return (
      this._cursors.setStates(i),
      this._cursors.normalize(),
      (this._columnSelectData = null),
      this._validateAutoClosedActions(),
      this._emitStateChangedIfNecessary(e, t, n, s, r)
    );
  }
  setCursorColumnSelectData(e) {
    this._columnSelectData = e;
  }
  revealAll(e, t, n, i, r, o) {
    const s = this._cursors.getViewPositions();
    let a = null,
      l = null;
    (s.length > 1 ? (l = this._cursors.getViewSelections()) : (a = YH.fromPositions(s[0], s[0])),
      e.emitViewEvent(new zee(t, n, a, l, i, r, o)));
  }
  revealPrimary(e, t, n, i, r, o) {
    const s = [this._cursors.getPrimaryCursor().viewState.selection];
    e.emitViewEvent(new zee(t, n, null, s, i, r, o));
  }
  saveState() {
    const e = [],
      t = this._cursors.getSelections();
    for (let n = 0, i = t.length; n < i; n++) {
      const i = t[n];
      e.push({
        inSelectionMode: !i.isEmpty(),
        selectionStart: { lineNumber: i.selectionStartLineNumber, column: i.selectionStartColumn },
        position: { lineNumber: i.positionLineNumber, column: i.positionColumn },
      });
    }
    return e;
  }
  restoreState(e, t) {
    const n = [];
    for (let i = 0, r = t.length; i < r; i++) {
      const e = t[i];
      let r = 1,
        o = 1;
      (e.position && e.position.lineNumber && (r = e.position.lineNumber),
        e.position && e.position.column && (o = e.position.column));
      let s = r,
        a = o;
      (e.selectionStart && e.selectionStart.lineNumber && (s = e.selectionStart.lineNumber),
        e.selectionStart && e.selectionStart.column && (a = e.selectionStart.column),
        n.push({
          selectionStartLineNumber: s,
          selectionStartColumn: a,
          positionLineNumber: r,
          positionColumn: o,
        }));
    }
    (this.setStates(e, "restoreState", 0, lz.fromModelSelections(n)),
      this.revealAll(e, "restoreState", !1, 0, !0, 1));
  }
  onModelContentChanged(e, t) {
    if (t instanceof B3) {
      if (this._isHandling) return;
      this._isHandling = !0;
      try {
        this.setStates(e, "modelChange", 0, this.getCursorStates());
      } finally {
        this._isHandling = !1;
      }
    } else {
      const n = t.rawContentChangedEvent;
      if (((this._knownModelVersionId = n.versionId), this._isHandling)) return;
      const i = n.containsEvent(1);
      if (((this._prevEditOperationType = 0), i))
        (this._cursors.dispose(),
          (this._cursors = new Dee(this.context)),
          this._validateAutoClosedActions(),
          this._emitStateChangedIfNecessary(e, "model", 1, null, !1));
      else if (this._hasFocus && n.resultingSelection && n.resultingSelection.length > 0) {
        const t = lz.fromModelSelections(n.resultingSelection);
        this.setStates(e, "modelChange", n.isUndoing ? 5 : n.isRedoing ? 6 : 2, t) &&
          this.revealAll(e, "modelChange", !1, 0, !0, 0);
      } else {
        const t = this._cursors.readSelectionFromMarkers();
        this.setStates(e, "modelChange", 2, lz.fromModelSelections(t));
      }
    }
  }
  getSelection() {
    return this._cursors.getPrimaryCursor().modelState.selection;
  }
  getTopMostViewPosition() {
    return this._cursors.getTopMostViewPosition();
  }
  getBottomMostViewPosition() {
    return this._cursors.getBottomMostViewPosition();
  }
  getCursorColumnSelectData() {
    if (this._columnSelectData) return this._columnSelectData;
    const e = this._cursors.getPrimaryCursor(),
      t = e.viewState.selectionStart.getStartPosition(),
      n = e.viewState.position;
    return {
      isReal: !1,
      fromViewLineNumber: t.lineNumber,
      fromViewVisualColumn: this.context.cursorConfig.visibleColumnFromColumn(this._viewModel, t),
      toViewLineNumber: n.lineNumber,
      toViewVisualColumn: this.context.cursorConfig.visibleColumnFromColumn(this._viewModel, n),
    };
  }
  getSelections() {
    return this._cursors.getSelections();
  }
  setSelections(e, t, n, i) {
    this.setStates(e, t, i, lz.fromModelSelections(n));
  }
  getPrevEditOperationType() {
    return this._prevEditOperationType;
  }
  setPrevEditOperationType(e) {
    this._prevEditOperationType = e;
  }
  _pushAutoClosedAction(e, t) {
    const n = [],
      i = [];
    for (let s = 0, a = e.length; s < a; s++)
      (n.push({
        range: e[s],
        options: {
          description: "auto-closed-character",
          inlineClassName: "auto-closed-character",
          stickiness: 1,
        },
      }),
        i.push({ range: t[s], options: { description: "auto-closed-enclosing", stickiness: 1 } }));
    const r = this._model.deltaDecorations([], n),
      o = this._model.deltaDecorations([], i);
    this._autoClosedActions.push(new fte(this._model, r, o));
  }
  _executeEditOperation(e, t) {
    if (!e) return;
    e.shouldPushStackElementBefore && this._model.pushStackElement();
    const n = mte.executeCommands(this._model, this._cursors.getSelections(), e.commands, t);
    if (n) {
      this._interpretCommandResult(n);
      const t = [],
        i = [];
      for (let n = 0; n < e.commands.length; n++) {
        const r = e.commands[n];
        r instanceof dq &&
          r.enclosingRange &&
          r.closeCharacterRange &&
          (t.push(r.closeCharacterRange), i.push(r.enclosingRange));
      }
      (t.length > 0 && this._pushAutoClosedAction(t, i), (this._prevEditOperationType = e.type));
    }
    e.shouldPushStackElementAfter && this._model.pushStackElement();
  }
  _interpretCommandResult(e) {
    ((e && 0 !== e.length) || (e = this._cursors.readSelectionFromMarkers()),
      (this._columnSelectData = null),
      this._cursors.setSelections(e),
      this._cursors.normalize());
  }
  _emitStateChangedIfNecessary(e, t, n, i, r) {
    const o = pte.from(this._model, this);
    if (o.equals(i)) return !1;
    const s = this._cursors.getSelections(),
      a = this._cursors.getViewSelections();
    if (
      (e.emitViewEvent(new Mee(a, s, n)),
      !i ||
        i.cursorState.length !== o.cursorState.length ||
        o.cursorState.some((e, t) => !e.modelState.equals(i.cursorState[t].modelState)))
    ) {
      const a = i ? i.cursorState.map((e) => e.modelState.selection) : null,
        l = i ? i.modelVersionId : 0;
      e.emitOutgoingEvent(new ite(a, s, l, o.modelVersionId, t || "keyboard", n, r));
    }
    return !0;
  }
  _findAutoClosingPairs(e) {
    if (!e.length) return null;
    const t = [];
    for (let n = 0, i = e.length; n < i; n++) {
      const i = e[n];
      if (!i.text || i.text.indexOf("\n") >= 0) return null;
      const r = i.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);
      if (!r) return null;
      const o = r[1],
        s = this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(o);
      if (!s || 1 !== s.length) return null;
      const a = s[0].open,
        l = i.text.length - r[2].length - 1,
        c = i.text.lastIndexOf(a, l - 1);
      if (-1 === c) return null;
      t.push([c, l]);
    }
    return t;
  }
  executeEdits(e, t, n, i, r) {
    let o = null;
    ("snippet" === t && (o = this._findAutoClosingPairs(n)), o && (n[0]._isTracked = !0));
    const s = [],
      a = [],
      l = this._model.pushEditOperations(
        this.getSelections(),
        n,
        (e) => {
          if (o)
            for (let n = 0, i = o.length; n < i; n++) {
              const [t, i] = o[n],
                r = e[n],
                l = r.range.startLineNumber,
                c = r.range.startColumn - 1 + t,
                d = r.range.startColumn - 1 + i;
              (s.push(new YH(l, d + 1, l, d + 2)), a.push(new YH(l, c + 1, l, d + 2)));
            }
          const t = i(e);
          return (t && (this._isHandling = !0), t);
        },
        void 0,
        r,
      );
    (l && ((this._isHandling = !1), this.setSelections(e, t, l, 0)),
      s.length > 0 && this._pushAutoClosedAction(s, a));
  }
  _executeEdit(e, t, n, i = 0) {
    if (this.context.cursorConfig.readOnly) return;
    const r = pte.from(this._model, this);
    (this._cursors.stopTrackingSelections(), (this._isHandling = !0));
    try {
      (this._cursors.ensureValidState(), e());
    } catch (o) {
      HI(o);
    }
    ((this._isHandling = !1),
      this._cursors.startTrackingSelections(),
      this._validateAutoClosedActions(),
      this._emitStateChangedIfNecessary(t, n, i, r, !1) && this.revealAll(t, n, !1, 0, !0, 0));
  }
  getAutoClosedCharacters() {
    return fte.getAllAutoClosedCharacters(this._autoClosedActions);
  }
  startComposition(e) {
    this._compositionState = new vte(this._model, this.getSelections());
  }
  endComposition(e, t) {
    const n = m8.cursor({ kind: "compositionEnd", detailedSource: t }),
      i = this._compositionState
        ? this._compositionState.deduceOutcome(this._model, this.getSelections())
        : null;
    ((this._compositionState = null),
      this._executeEdit(
        () => {
          "keyboard" === t &&
            this._executeEditOperation(
              wq.compositionEndWithInterceptors(
                this._prevEditOperationType,
                this.context.cursorConfig,
                this._model,
                i,
                this.getSelections(),
                this.getAutoClosedCharacters(),
              ),
              n,
            );
        },
        e,
        t,
      ));
  }
  type(e, t, n) {
    const i = m8.cursor({ kind: "type", detailedSource: n });
    this._executeEdit(
      () => {
        if ("keyboard" === n) {
          const e = t.length;
          let n = 0;
          for (; n < e; ) {
            const e = _A(t, n),
              r = t.substr(n, e);
            (this._executeEditOperation(
              wq.typeWithInterceptors(
                !!this._compositionState,
                this._prevEditOperationType,
                this.context.cursorConfig,
                this._model,
                this.getSelections(),
                this.getAutoClosedCharacters(),
                r,
              ),
              i,
            ),
              (n += e));
          }
        } else
          this._executeEditOperation(
            wq.typeWithoutInterceptors(
              this._prevEditOperationType,
              this.context.cursorConfig,
              this._model,
              this.getSelections(),
              t,
            ),
            i,
          );
      },
      e,
      n,
    );
  }
  compositionType(e, t, n, i, r, o) {
    const s = m8.cursor({ kind: "compositionType", detailedSource: o });
    if (0 !== t.length || 0 !== n || 0 !== i)
      this._executeEdit(
        () => {
          this._executeEditOperation(
            wq.compositionType(
              this._prevEditOperationType,
              this.context.cursorConfig,
              this._model,
              this.getSelections(),
              t,
              n,
              i,
              r,
            ),
            s,
          );
        },
        e,
        o,
      );
    else if (0 !== r) {
      const t = this.getSelections().map((e) => {
        const t = e.getPosition();
        return new XH(t.lineNumber, t.column + r, t.lineNumber, t.column + r);
      });
      this.setSelections(e, o, t, 0);
    }
  }
  paste(e, t, n, i, r) {
    const o = m8.cursor({ kind: "paste", detailedSource: r });
    this._executeEdit(
      () => {
        this._executeEditOperation(
          wq.paste(this.context.cursorConfig, this._model, this.getSelections(), t, n, i || []),
          o,
        );
      },
      e,
      r,
      4,
    );
  }
  cut(e, t) {
    const n = m8.cursor({ kind: "cut", detailedSource: t });
    this._executeEdit(
      () => {
        this._executeEditOperation(
          Ez.cut(this.context.cursorConfig, this._model, this.getSelections()),
          n,
        );
      },
      e,
      t,
    );
  }
  executeCommand(e, t, n) {
    const i = m8.cursor({ kind: "executeCommand", detailedSource: n });
    this._executeEdit(
      () => {
        (this._cursors.killSecondaryCursors(),
          this._executeEditOperation(
            new hz(0, [t], { shouldPushStackElementBefore: !1, shouldPushStackElementAfter: !1 }),
            i,
          ));
      },
      e,
      n,
    );
  }
  executeCommands(e, t, n) {
    const i = m8.cursor({ kind: "executeCommands", detailedSource: n });
    this._executeEdit(
      () => {
        this._executeEditOperation(
          new hz(0, t, { shouldPushStackElementBefore: !1, shouldPushStackElementAfter: !1 }),
          i,
        );
      },
      e,
      n,
    );
  }
}
class pte {
  static from(e, t) {
    return new pte(e.getVersionId(), t.getCursorStates());
  }
  constructor(e, t) {
    ((this.modelVersionId = e), (this.cursorState = t));
  }
  equals(e) {
    if (!e) return !1;
    if (this.modelVersionId !== e.modelVersionId) return !1;
    if (this.cursorState.length !== e.cursorState.length) return !1;
    for (let t = 0, n = this.cursorState.length; t < n; t++)
      if (!this.cursorState[t].equals(e.cursorState[t])) return !1;
    return !0;
  }
}
class fte {
  static getAllAutoClosedCharacters(e) {
    let t = [];
    for (const n of e) t = t.concat(n.getAutoClosedCharactersRanges());
    return t;
  }
  constructor(e, t, n) {
    ((this._model = e),
      (this._autoClosedCharactersDecorations = t),
      (this._autoClosedEnclosingDecorations = n));
  }
  dispose() {
    ((this._autoClosedCharactersDecorations = this._model.deltaDecorations(
      this._autoClosedCharactersDecorations,
      [],
    )),
      (this._autoClosedEnclosingDecorations = this._model.deltaDecorations(
        this._autoClosedEnclosingDecorations,
        [],
      )));
  }
  getAutoClosedCharactersRanges() {
    const e = [];
    for (let t = 0; t < this._autoClosedCharactersDecorations.length; t++) {
      const n = this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);
      n && e.push(n);
    }
    return e;
  }
  isValid(e) {
    const t = [];
    for (let n = 0; n < this._autoClosedEnclosingDecorations.length; n++) {
      const e = this._model.getDecorationRange(this._autoClosedEnclosingDecorations[n]);
      if (e && (t.push(e), e.startLineNumber !== e.endLineNumber)) return !1;
    }
    (t.sort(YH.compareRangesUsingStarts), e.sort(YH.compareRangesUsingStarts));
    for (let n = 0; n < e.length; n++) {
      if (n >= t.length) return !1;
      if (!t[n].strictContainsRange(e[n])) return !1;
    }
    return !0;
  }
}
class mte {
  static executeCommands(e, t, n, i = m8.unknown({ name: "executeCommands" })) {
    const r = { model: e, selectionsBefore: t, trackedRanges: [], trackedRangesDirection: [] },
      o = this._innerExecuteCommands(r, n, i);
    for (let s = 0, a = r.trackedRanges.length; s < a; s++)
      r.model._setTrackedRange(r.trackedRanges[s], null, 0);
    return o;
  }
  static _innerExecuteCommands(e, t, n) {
    if (this._arrayIsEmpty(t)) return null;
    const i = this._getEditOperations(e, t);
    if (0 === i.operations.length) return null;
    const r = i.operations,
      o = this._getLoserCursorMap(r);
    if (o.hasOwnProperty("0")) return null;
    const s = [];
    for (let c = 0, d = r.length; c < d; c++)
      o.hasOwnProperty(r[c].identifier.major.toString()) || s.push(r[c]);
    i.hadTrackedEditOperation && s.length > 0 && (s[0]._isTracked = !0);
    let a = e.model.pushEditOperations(
      e.selectionsBefore,
      s,
      (n) => {
        const i = [];
        for (let t = 0; t < e.selectionsBefore.length; t++) i[t] = [];
        for (const e of n) e.identifier && i[e.identifier.major].push(e);
        const r = (e, t) => e.identifier.minor - t.identifier.minor,
          o = [];
        for (let s = 0; s < e.selectionsBefore.length; s++)
          i[s].length > 0
            ? (i[s].sort(r),
              (o[s] = t[s].computeCursorState(e.model, {
                getInverseEditOperations: () => i[s],
                getTrackedSelection: (t) => {
                  const n = parseInt(t, 10),
                    i = e.model._getTrackedRange(e.trackedRanges[n]);
                  return 0 === e.trackedRangesDirection[n]
                    ? new XH(i.startLineNumber, i.startColumn, i.endLineNumber, i.endColumn)
                    : new XH(i.endLineNumber, i.endColumn, i.startLineNumber, i.startColumn);
                },
              })))
            : (o[s] = e.selectionsBefore[s]);
        return o;
      },
      void 0,
      n,
    );
    a || (a = e.selectionsBefore);
    const l = [];
    for (const c in o) o.hasOwnProperty(c) && l.push(parseInt(c, 10));
    l.sort((e, t) => t - e);
    for (const c of l) a.splice(c, 1);
    return a;
  }
  static _arrayIsEmpty(e) {
    for (let t = 0, n = e.length; t < n; t++) if (e[t]) return !1;
    return !0;
  }
  static _getEditOperations(e, t) {
    let n = [],
      i = !1;
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r];
      if (o) {
        const t = this._getEditOperationsFromCommand(e, r, o);
        ((n = n.concat(t.operations)), (i = i || t.hadTrackedEditOperation));
      }
    }
    return { operations: n, hadTrackedEditOperation: i };
  }
  static _getEditOperationsFromCommand(e, t, n) {
    const i = [];
    let r = 0;
    const o = (e, o, s = !1) => {
      (YH.isEmpty(e) && "" === o) ||
        i.push({
          identifier: { major: t, minor: r++ },
          range: e,
          text: o,
          forceMoveMarkers: s,
          isAutoWhitespaceEdit: n.insertsAutoWhitespace,
        });
    };
    let s = !1;
    const a = {
      addEditOperation: o,
      addTrackedEditOperation: (e, t, n) => {
        ((s = !0), o(e, t, n));
      },
      trackSelection: (t, n) => {
        const i = XH.liftSelection(t);
        let r;
        if (i.isEmpty())
          if ("boolean" == typeof n) r = n ? 2 : 3;
          else {
            const t = e.model.getLineMaxColumn(i.startLineNumber);
            r = i.startColumn === t ? 2 : 3;
          }
        else r = 1;
        const o = e.trackedRanges.length,
          s = e.model._setTrackedRange(null, i, r);
        return (
          (e.trackedRanges[o] = s),
          (e.trackedRangesDirection[o] = i.getDirection()),
          o.toString()
        );
      },
    };
    try {
      n.getEditOperations(e.model, a);
    } catch (spt) {
      return (HI(spt), { operations: [], hadTrackedEditOperation: !1 });
    }
    return { operations: i, hadTrackedEditOperation: s };
  }
  static _getLoserCursorMap(e) {
    (e = e.slice(0)).sort((e, t) => -YH.compareRangesUsingEnds(e.range, t.range));
    const t = {};
    for (let n = 1; n < e.length; n++) {
      const i = e[n - 1],
        r = e[n];
      if (YH.getStartPosition(i.range).isBefore(YH.getEndPosition(r.range))) {
        let o;
        ((o = i.identifier.major > r.identifier.major ? i.identifier.major : r.identifier.major),
          (t[o.toString()] = !0));
        for (let t = 0; t < e.length; t++)
          e[t].identifier.major === o && (e.splice(t, 1), t < n && n--, t--);
        n > 0 && n--;
      }
    }
    return t;
  }
}
class _te {
  constructor(e, t, n, i) {
    ((this.text = e),
      (this.lineNumber = t),
      (this.startSelectionOffset = n),
      (this.endSelectionOffset = i));
  }
}
class vte {
  static _capture(e, t) {
    const n = [];
    for (const i of t) {
      if (i.startLineNumber !== i.endLineNumber) return null;
      const t = i.startLineNumber;
      n.push(new _te(e.getLineContent(t), t, i.startColumn - 1, i.endColumn - 1));
    }
    return n;
  }
  constructor(e, t) {
    this._original = vte._capture(e, t);
  }
  deduceOutcome(e, t) {
    if (!this._original) return null;
    const n = vte._capture(e, t);
    if (!n) return null;
    if (this._original.length !== n.length) return null;
    const i = [];
    for (let r = 0, o = this._original.length; r < o; r++)
      i.push(vte._deduceOutcome(this._original[r], n[r]));
    return i;
  }
  static _deduceOutcome(e, t) {
    const n = Math.min(e.startSelectionOffset, t.startSelectionOffset, cA(e.text, t.text)),
      i = Math.min(
        e.text.length - e.endSelectionOffset,
        t.text.length - t.endSelectionOffset,
        dA(e.text, t.text),
      ),
      r = e.text.substring(n, e.text.length - i),
      o = n,
      s = t.text.length - i,
      a = t.text.substring(o, s),
      l = new YH(t.lineNumber, o + 1, t.lineNumber, s + 1);
    return new Cq(
      r,
      e.startSelectionOffset - n,
      e.endSelectionOffset - n,
      a,
      t.startSelectionOffset - n,
      t.endSelectionOffset - n,
      l,
    );
  }
}
const bte = { getInitialState: () => J9, tokenizeEncoded: (e, t, n) => t7(0, n) };
function yte(e, t, n, i, r, o, s) {
  let a = "<div>",
    l = 0,
    c = 0,
    d = !0;
  for (let u = 0, h = t.getCount(); u < h; u++) {
    const h = t.getEndOffset(u);
    let g = "";
    for (; l < h && l < r; l++) {
      const t = e.charCodeAt(l),
        n = 9 === t;
      if (((c += kA(t) ? 2 : n ? 0 : 1), l < i)) {
        if (n) {
          const e = c % o;
          c += 0 === e ? o : o - e;
        }
      } else
        switch (t) {
          case 9: {
            const e = c % o,
              t = 0 === e ? o : o - e;
            c += t;
            let n = t;
            for (; n > 0; ) (s && d ? ((g += "&#160;"), (d = !1)) : ((g += " "), (d = !0)), n--);
            break;
          }
          case 60:
            ((g += "&lt;"), (d = !1));
            break;
          case 62:
            ((g += "&gt;"), (d = !1));
            break;
          case 38:
            ((g += "&amp;"), (d = !1));
            break;
          case 0:
            ((g += "&#00;"), (d = !1));
            break;
          case 65279:
          case 8232:
          case 8233:
          case 133:
            ((g += "�"), (d = !1));
            break;
          case 13:
            ((g += "&#8203"), (d = !1));
            break;
          case 32:
            s && d ? ((g += "&#160;"), (d = !1)) : ((g += " "), (d = !0));
            break;
          default:
            ((g += String.fromCharCode(t)), (d = !1));
        }
    }
    if (
      !(h <= i) &&
      ((a += `<span style="${t.getInlineStyle(u, n)}">${g}</span>`), h > r || l >= r || i >= r)
    )
      break;
  }
  return ((a += "</div>"), a);
}
function xte(e, t, n) {
  let i = '<div class="monaco-tokenized-source">';
  const r = ZM(e);
  let o = n.getInitialState();
  for (let s = 0, a = r.length; s < a; s++) {
    const e = r[s];
    s > 0 && (i += "<br/>");
    const a = n.tokenizeEncoded(e, !0, o);
    D$.convertToEndOffset(a.tokens, e.length);
    const l = new D$(a.tokens, e, t).inflate();
    let c = 0;
    for (let t = 0, n = l.getCount(); t < n; t++) {
      const n = l.getClassName(t),
        r = l.getEndOffset(t);
      ((i += `<span class="${n}">${HM(e.substring(c, r))}</span>`), (c = r));
    }
    o = a.endState;
  }
  return ((i += "</div>"), i);
}
class wte {
  constructor(e, t, n, i, r) {
    ((this.decorationId = e),
      (this.index = t),
      (this.lineNumber = n),
      (this.specialHeight = i),
      (this.prefixSum = r),
      (this.maximumSpecialHeight = i),
      (this.deleted = !1));
  }
}
class Cte {
  constructor(e, t) {
    if (
      ((this._decorationIDToCustomLine = new Ste()),
      (this._orderedCustomLines = []),
      (this._pendingSpecialLinesToInsert = []),
      (this._invalidIndex = 0),
      (this._hasPending = !1),
      (this._defaultLineHeight = e),
      t.length > 0)
    ) {
      for (const e of t)
        this.insertOrChangeCustomLineHeight(
          e.decorationId,
          e.startLineNumber,
          e.endLineNumber,
          e.lineHeight,
        );
      this.commit();
    }
  }
  set defaultLineHeight(e) {
    this._defaultLineHeight = e;
  }
  get defaultLineHeight() {
    return this._defaultLineHeight;
  }
  removeCustomLineHeight(e) {
    const t = this._decorationIDToCustomLine.get(e);
    if (t) {
      this._decorationIDToCustomLine.delete(e);
      for (const e of t)
        ((e.deleted = !0), (this._invalidIndex = Math.min(this._invalidIndex, e.index)));
      this._hasPending = !0;
    }
  }
  insertOrChangeCustomLineHeight(e, t, n, i) {
    this.removeCustomLineHeight(e);
    for (let r = t; r <= n; r++) {
      const t = new wte(e, -1, r, i, 0);
      this._pendingSpecialLinesToInsert.push(t);
    }
    this._hasPending = !0;
  }
  heightForLineNumber(e) {
    const t = this._binarySearchOverOrderedCustomLinesArray(e);
    return t >= 0 ? this._orderedCustomLines[t].maximumSpecialHeight : this._defaultLineHeight;
  }
  getAccumulatedLineHeightsIncludingLineNumber(e) {
    const t = this._binarySearchOverOrderedCustomLinesArray(e);
    if (t >= 0)
      return (
        this._orderedCustomLines[t].prefixSum + this._orderedCustomLines[t].maximumSpecialHeight
      );
    if (-1 === t) return this._defaultLineHeight * e;
    const n = -(t + 1),
      i = this._orderedCustomLines[n - 1];
    return i.prefixSum + i.maximumSpecialHeight + this._defaultLineHeight * (e - i.lineNumber);
  }
  onLinesDeleted(e, t) {
    const n = t - e + 1,
      i = this._orderedCustomLines.length,
      r = this._binarySearchOverOrderedCustomLinesArray(e);
    let o;
    if (r >= 0) {
      o = r;
      for (let t = r - 1; t >= 0 && this._orderedCustomLines[t].lineNumber === e; t--) o--;
    } else o = r === -(i + 1) && -1 !== r ? i - 1 : -(r + 1);
    const s = this._binarySearchOverOrderedCustomLinesArray(t);
    let a;
    if (s >= 0) {
      a = s;
      for (let e = s + 1; e < i && this._orderedCustomLines[e].lineNumber === t; e++) a++;
    } else a = s === -(i + 1) && -1 !== s ? i - 1 : -(s + 1);
    const l = a > o,
      c =
        a === o &&
        this._orderedCustomLines[o] &&
        this._orderedCustomLines[o].lineNumber >= e &&
        this._orderedCustomLines[o].lineNumber <= t;
    if (l || c) {
      let i = 0;
      for (let e = o; e <= a; e++)
        i = Math.max(i, this._orderedCustomLines[e].maximumSpecialHeight);
      let r = 0;
      if (o > 0) {
        const t = this._orderedCustomLines[o - 1];
        r = t.prefixSum + t.maximumSpecialHeight + this._defaultLineHeight * (e - t.lineNumber - 1);
      } else r = e > 0 ? (e - 1) * this._defaultLineHeight : 0;
      const s = this._orderedCustomLines[o],
        l = this._orderedCustomLines[a],
        c = this._orderedCustomLines[a + 1],
        d = c && c.lineNumber === t + 1 ? c.maximumSpecialHeight : this._defaultLineHeight,
        u =
          l.prefixSum +
          l.maximumSpecialHeight -
          s.prefixSum +
          this._defaultLineHeight * (t - l.lineNumber) +
          this._defaultLineHeight * (s.lineNumber - e) +
          d -
          i,
        h = new Set(),
        g = [],
        p = new Ste();
      let f = 0;
      for (let t = 0; t < this._orderedCustomLines.length; t++) {
        const s = this._orderedCustomLines[t];
        if (t < o) (g.push(s), p.add(s.decorationId, s));
        else if (t >= o && t <= a) {
          const t = s.decorationId;
          h.has(t)
            ? f++
            : ((s.index -= f),
              (s.lineNumber = e),
              (s.prefixSum = r),
              (s.maximumSpecialHeight = i),
              g.push(s),
              p.add(s.decorationId, s));
        } else
          t > a &&
            ((s.index -= f),
            (s.lineNumber -= n),
            (s.prefixSum -= u),
            g.push(s),
            p.add(s.decorationId, s));
        h.add(s.decorationId);
      }
      ((this._orderedCustomLines = g), (this._decorationIDToCustomLine = p));
    } else {
      const e = n * this._defaultLineHeight;
      for (let i = a; i < this._orderedCustomLines.length; i++) {
        const r = this._orderedCustomLines[i];
        r.lineNumber > t && ((r.lineNumber -= n), (r.prefixSum -= e));
      }
    }
  }
  onLinesInserted(e, t) {
    const n = t - e + 1,
      i = this._binarySearchOverOrderedCustomLinesArray(e);
    let r;
    if (i >= 0) {
      r = i;
      for (let t = i - 1; t >= 0 && this._orderedCustomLines[t].lineNumber === e; t--) r--;
    } else r = -(i + 1);
    const o = [],
      s = new Set();
    for (let c = r; c < this._orderedCustomLines.length; c++)
      this._orderedCustomLines[c].lineNumber === e &&
        s.add(this._orderedCustomLines[c].decorationId);
    const a = new Set();
    for (let c = r - 1; c >= 0; c--)
      this._orderedCustomLines[c].lineNumber === e - 1 &&
        a.add(this._orderedCustomLines[c].decorationId);
    const l = U7(a, s);
    for (let c = r; c < this._orderedCustomLines.length; c++)
      ((this._orderedCustomLines[c].lineNumber += n),
        (this._orderedCustomLines[c].prefixSum += this._defaultLineHeight * n));
    if (l.size > 0) {
      for (const t of l) {
        const n = this._decorationIDToCustomLine.get(t);
        if (n) {
          const i = n.reduce((e, t) => Math.min(e, t.lineNumber), e),
            r = n.reduce((e, t) => Math.max(e, t.lineNumber), e),
            s = n.reduce((e, t) => Math.max(e, t.specialHeight), 0);
          o.push({ decorationId: t, startLineNumber: i, endLineNumber: r, lineHeight: s });
        }
      }
      for (const e of o)
        this.insertOrChangeCustomLineHeight(
          e.decorationId,
          e.startLineNumber,
          e.endLineNumber,
          e.lineHeight,
        );
      this.commit();
    }
  }
  commit() {
    if (!this._hasPending) return;
    for (const r of this._pendingSpecialLinesToInsert) {
      const e = this._binarySearchOverOrderedCustomLinesArray(r.lineNumber),
        t = e >= 0 ? e : -(e + 1);
      (this._orderedCustomLines.splice(t, 0, r),
        (this._invalidIndex = Math.min(this._invalidIndex, t)));
    }
    this._pendingSpecialLinesToInsert = [];
    const e = new Ste(),
      t = [];
    for (let r = 0; r < this._invalidIndex; r++) {
      const n = this._orderedCustomLines[r];
      (t.push(n), e.add(n.decorationId, n));
    }
    let n = 0,
      i = this._invalidIndex > 0 ? t[this._invalidIndex - 1] : void 0;
    for (let r = this._invalidIndex; r < this._orderedCustomLines.length; r++) {
      const o = this._orderedCustomLines[r];
      if (o.deleted) n++;
      else {
        if (((o.index = r - n), i && i.lineNumber === o.lineNumber))
          ((o.maximumSpecialHeight = i.maximumSpecialHeight), (o.prefixSum = i.prefixSum));
        else {
          let e,
            t = o.specialHeight;
          for (let n = r; n < this._orderedCustomLines.length; n++) {
            const e = this._orderedCustomLines[n];
            if (!e.deleted) {
              if (e.lineNumber !== o.lineNumber) break;
              t = Math.max(t, e.specialHeight);
            }
          }
          ((o.maximumSpecialHeight = t),
            (e = i
              ? i.prefixSum +
                i.maximumSpecialHeight +
                this._defaultLineHeight * (o.lineNumber - i.lineNumber - 1)
              : this._defaultLineHeight * (o.lineNumber - 1)),
            (o.prefixSum = e));
        }
        ((i = o), t.push(o), e.add(o.decorationId, o));
      }
    }
    ((this._orderedCustomLines = t),
      (this._decorationIDToCustomLine = e),
      (this._invalidIndex = 1 / 0),
      (this._hasPending = !1));
  }
  _binarySearchOverOrderedCustomLinesArray(e) {
    return JP(this._orderedCustomLines.length, (t) => {
      const n = this._orderedCustomLines[t];
      return n.lineNumber === e ? 0 : n.lineNumber < e ? -1 : 1;
    });
  }
}
class Ste {
  constructor() {
    this._map = new Map();
  }
  add(e, t) {
    const n = this._map.get(e);
    n ? n.push(t) : this._map.set(e, [t]);
  }
  get(e) {
    return this._map.get(e);
  }
  delete(e) {
    this._map.delete(e);
  }
}
class kte {
  constructor() {
    ((this._hasPending = !1), (this._inserts = []), (this._changes = []), (this._removes = []));
  }
  insert(e) {
    ((this._hasPending = !0), this._inserts.push(e));
  }
  change(e) {
    ((this._hasPending = !0), this._changes.push(e));
  }
  remove(e) {
    ((this._hasPending = !0), this._removes.push(e));
  }
  commit(e) {
    if (!this._hasPending) return;
    const t = this._inserts,
      n = this._changes,
      i = this._removes;
    ((this._hasPending = !1),
      (this._inserts = []),
      (this._changes = []),
      (this._removes = []),
      e._commitPendingChanges(t, n, i));
  }
}
class Ete {
  constructor(e, t, n, i, r) {
    ((this.id = e),
      (this.afterLineNumber = t),
      (this.ordinal = n),
      (this.height = i),
      (this.minWidth = r),
      (this.prefixSum = 0));
  }
}
let Nte = class e {
  static {
    this.INSTANCE_COUNT = 0;
  }
  constructor(t, n, i, r, o) {
    ((this._instanceId = DA(++e.INSTANCE_COUNT)),
      (this._pendingChanges = new kte()),
      (this._lastWhitespaceId = 0),
      (this._arr = []),
      (this._prefixSumValidIndex = -1),
      (this._minWidth = -1),
      (this._lineCount = t),
      (this._paddingTop = i),
      (this._paddingBottom = r),
      (this._lineHeightsManager = new Cte(n, o)));
  }
  static findInsertionIndex(e, t, n) {
    let i = 0,
      r = e.length;
    for (; i < r; ) {
      const o = (i + r) >>> 1;
      t === e[o].afterLineNumber
        ? n < e[o].ordinal
          ? (r = o)
          : (i = o + 1)
        : t < e[o].afterLineNumber
          ? (r = o)
          : (i = o + 1);
    }
    return i;
  }
  setDefaultLineHeight(e) {
    this._lineHeightsManager.defaultLineHeight = e;
  }
  setPadding(e, t) {
    ((this._paddingTop = e), (this._paddingBottom = t));
  }
  onFlushed(e, t) {
    ((this._lineCount = e),
      (this._lineHeightsManager = new Cte(this._lineHeightsManager.defaultLineHeight, t)));
  }
  changeLineHeights(e) {
    let t = !1;
    try {
      e({
        insertOrChangeCustomLineHeight: (e, n, i, r) => {
          ((t = !0), this._lineHeightsManager.insertOrChangeCustomLineHeight(e, n, i, r));
        },
        removeCustomLineHeight: (e) => {
          ((t = !0), this._lineHeightsManager.removeCustomLineHeight(e));
        },
      });
    } finally {
      this._lineHeightsManager.commit();
    }
    return t;
  }
  changeWhitespace(e) {
    let t = !1;
    try {
      const n = {
        insertWhitespace: (e, n, i, r) => {
          ((t = !0), (e |= 0), (n |= 0), (i |= 0), (r |= 0));
          const o = this._instanceId + ++this._lastWhitespaceId;
          return (this._pendingChanges.insert(new Ete(o, e, n, i, r)), o);
        },
        changeOneWhitespace: (e, n, i) => {
          ((t = !0),
            (n |= 0),
            (i |= 0),
            this._pendingChanges.change({ id: e, newAfterLineNumber: n, newHeight: i }));
        },
        removeWhitespace: (e) => {
          ((t = !0), this._pendingChanges.remove({ id: e }));
        },
      };
      e(n);
    } finally {
      this._pendingChanges.commit(this);
    }
    return t;
  }
  _commitPendingChanges(e, t, n) {
    if (
      ((e.length > 0 || n.length > 0) && (this._minWidth = -1), e.length + t.length + n.length <= 1)
    ) {
      for (const t of e) this._insertWhitespace(t);
      for (const e of t) this._changeOneWhitespace(e.id, e.newAfterLineNumber, e.newHeight);
      for (const e of n) {
        const t = this._findWhitespaceIndex(e.id);
        -1 !== t && this._removeWhitespace(t);
      }
      return;
    }
    const i = new Set();
    for (const a of n) i.add(a.id);
    const r = new Map();
    for (const a of t) r.set(a.id, a);
    const o = (e) => {
        const t = [];
        for (const n of e)
          if (!i.has(n.id)) {
            if (r.has(n.id)) {
              const e = r.get(n.id);
              ((n.afterLineNumber = e.newAfterLineNumber), (n.height = e.newHeight));
            }
            t.push(n);
          }
        return t;
      },
      s = o(this._arr).concat(o(e));
    (s.sort((e, t) =>
      e.afterLineNumber === t.afterLineNumber
        ? e.ordinal - t.ordinal
        : e.afterLineNumber - t.afterLineNumber,
    ),
      (this._arr = s),
      (this._prefixSumValidIndex = -1));
  }
  _insertWhitespace(t) {
    const n = e.findInsertionIndex(this._arr, t.afterLineNumber, t.ordinal);
    (this._arr.splice(n, 0, t),
      (this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, n - 1)));
  }
  _findWhitespaceIndex(e) {
    const t = this._arr;
    for (let n = 0, i = t.length; n < i; n++) if (t[n].id === e) return n;
    return -1;
  }
  _changeOneWhitespace(e, t, n) {
    const i = this._findWhitespaceIndex(e);
    if (
      -1 !== i &&
      (this._arr[i].height !== n &&
        ((this._arr[i].height = n),
        (this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, i - 1))),
      this._arr[i].afterLineNumber !== t)
    ) {
      const e = this._arr[i];
      (this._removeWhitespace(i), (e.afterLineNumber = t), this._insertWhitespace(e));
    }
  }
  _removeWhitespace(e) {
    (this._arr.splice(e, 1),
      (this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, e - 1)));
  }
  onLinesDeleted(e, t) {
    ((e |= 0), (t |= 0), (this._lineCount -= t - e + 1));
    for (let n = 0, i = this._arr.length; n < i; n++) {
      const i = this._arr[n].afterLineNumber;
      e <= i && i <= t
        ? (this._arr[n].afterLineNumber = e - 1)
        : i > t && (this._arr[n].afterLineNumber -= t - e + 1);
    }
    this._lineHeightsManager.onLinesDeleted(e, t);
  }
  onLinesInserted(e, t) {
    ((e |= 0), (t |= 0), (this._lineCount += t - e + 1));
    for (let n = 0, i = this._arr.length; n < i; n++) {
      e <= this._arr[n].afterLineNumber && (this._arr[n].afterLineNumber += t - e + 1);
    }
    this._lineHeightsManager.onLinesInserted(e, t);
  }
  getWhitespacesTotalHeight() {
    return 0 === this._arr.length ? 0 : this.getWhitespacesAccumulatedHeight(this._arr.length - 1);
  }
  getWhitespacesAccumulatedHeight(e) {
    e |= 0;
    let t = Math.max(0, this._prefixSumValidIndex + 1);
    0 === t && ((this._arr[0].prefixSum = this._arr[0].height), t++);
    for (let n = t; n <= e; n++)
      this._arr[n].prefixSum = this._arr[n - 1].prefixSum + this._arr[n].height;
    return (
      (this._prefixSumValidIndex = Math.max(this._prefixSumValidIndex, e)),
      this._arr[e].prefixSum
    );
  }
  getLinesTotalHeight() {
    return (
      this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(this._lineCount) +
      this.getWhitespacesTotalHeight() +
      this._paddingTop +
      this._paddingBottom
    );
  }
  getWhitespaceAccumulatedHeightBeforeLineNumber(e) {
    e |= 0;
    const t = this._findLastWhitespaceBeforeLineNumber(e);
    return -1 === t ? 0 : this.getWhitespacesAccumulatedHeight(t);
  }
  _findLastWhitespaceBeforeLineNumber(e) {
    e |= 0;
    const t = this._arr;
    let n = 0,
      i = t.length - 1;
    for (; n <= i; ) {
      const r = (n + ((((i - n) | 0) / 2) | 0)) | 0;
      if (t[r].afterLineNumber < e) {
        if (r + 1 >= t.length || t[r + 1].afterLineNumber >= e) return r;
        n = (r + 1) | 0;
      } else i = (r - 1) | 0;
    }
    return -1;
  }
  _findFirstWhitespaceAfterLineNumber(e) {
    e |= 0;
    const t = this._findLastWhitespaceBeforeLineNumber(e) + 1;
    return t < this._arr.length ? t : -1;
  }
  getFirstWhitespaceIndexAfterLineNumber(e) {
    return ((e |= 0), this._findFirstWhitespaceAfterLineNumber(e));
  }
  getVerticalOffsetForLineNumber(e, t = !1) {
    let n;
    n =
      (e |= 0) > 1
        ? this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e - 1)
        : 0;
    return (
      n + this.getWhitespaceAccumulatedHeightBeforeLineNumber(e - (t ? 1 : 0)) + this._paddingTop
    );
  }
  getLineHeightForLineNumber(e) {
    return this._lineHeightsManager.heightForLineNumber(e);
  }
  getVerticalOffsetAfterLineNumber(e, t = !1) {
    e |= 0;
    return (
      this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e) +
      this.getWhitespaceAccumulatedHeightBeforeLineNumber(e + (t ? 1 : 0)) +
      this._paddingTop
    );
  }
  getWhitespaceMinWidth() {
    if (-1 === this._minWidth) {
      let e = 0;
      for (let t = 0, n = this._arr.length; t < n; t++) e = Math.max(e, this._arr[t].minWidth);
      this._minWidth = e;
    }
    return this._minWidth;
  }
  isAfterLines(e) {
    return e > this.getLinesTotalHeight();
  }
  isInTopPadding(e) {
    return 0 !== this._paddingTop && e < this._paddingTop;
  }
  isInBottomPadding(e) {
    if (0 === this._paddingBottom) return !1;
    return e >= this.getLinesTotalHeight() - this._paddingBottom;
  }
  getLineNumberAtOrAfterVerticalOffset(e) {
    if ((e |= 0) < 0) return 1;
    const t = 0 | this._lineCount;
    let n = 1,
      i = t;
    for (; n < i; ) {
      const t = ((n + i) / 2) | 0,
        r = this.getLineHeightForLineNumber(t),
        o = 0 | this.getVerticalOffsetForLineNumber(t);
      if (e >= o + r) n = t + 1;
      else {
        if (e >= o) return t;
        i = t;
      }
    }
    return n > t ? t : n;
  }
  getLinesViewportData(e, t) {
    ((e |= 0), (t |= 0));
    const n = 0 | this.getLineNumberAtOrAfterVerticalOffset(e),
      i = 0 | this.getVerticalOffsetForLineNumber(n);
    let r = 0 | this._lineCount,
      o = 0 | this.getFirstWhitespaceIndexAfterLineNumber(n);
    const s = 0 | this.getWhitespacesCount();
    let a, l;
    -1 === o
      ? ((o = s), (l = r + 1), (a = 0))
      : ((l = 0 | this.getAfterLineNumberForWhitespaceIndex(o)),
        (a = 0 | this.getHeightForWhitespaceIndex(o)));
    let c = i,
      d = c;
    const u = 5e5;
    let h = 0;
    i >= u &&
      ((h = Math.floor(i / u) * u),
      (h =
        Math.floor(h / this._lineHeightsManager.defaultLineHeight) *
        this._lineHeightsManager.defaultLineHeight),
      (d -= h));
    const g = [],
      p = e + (t - e) / 2;
    let f = -1;
    for (let b = n; b <= r; b++) {
      const e = this.getLineHeightForLineNumber(b);
      if (-1 === f) {
        ((c <= p && p < c + e) || c > p) && (f = b);
      }
      for (c += e, g[b - n] = d, d += e; l === b; )
        ((d += a),
          (c += a),
          o++,
          o >= s
            ? (l = r + 1)
            : ((l = 0 | this.getAfterLineNumberForWhitespaceIndex(o)),
              (a = 0 | this.getHeightForWhitespaceIndex(o))));
      if (c >= t) {
        r = b;
        break;
      }
    }
    -1 === f && (f = r);
    const m = 0 | this.getVerticalOffsetForLineNumber(r);
    let _ = n,
      v = r;
    if ((_ < v && i < e && _++, _ < v)) {
      m + this.getLineHeightForLineNumber(r) > t && v--;
    }
    return {
      bigNumbersDelta: h,
      startLineNumber: n,
      endLineNumber: r,
      relativeVerticalOffset: g,
      centeredLineNumber: f,
      completelyVisibleStartLineNumber: _,
      completelyVisibleEndLineNumber: v,
      lineHeight: this._lineHeightsManager.defaultLineHeight,
    };
  }
  getVerticalOffsetForWhitespaceIndex(e) {
    e |= 0;
    const t = this.getAfterLineNumberForWhitespaceIndex(e);
    let n, i;
    return (
      (n = t >= 1 ? this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(t) : 0),
      (i = e > 0 ? this.getWhitespacesAccumulatedHeight(e - 1) : 0),
      n + i + this._paddingTop
    );
  }
  getWhitespaceIndexAtOrAfterVerticallOffset(e) {
    e |= 0;
    let t = 0,
      n = this.getWhitespacesCount() - 1;
    if (n < 0) return -1;
    if (e >= this.getVerticalOffsetForWhitespaceIndex(n) + this.getHeightForWhitespaceIndex(n))
      return -1;
    for (; t < n; ) {
      const i = Math.floor((t + n) / 2),
        r = this.getVerticalOffsetForWhitespaceIndex(i);
      if (e >= r + this.getHeightForWhitespaceIndex(i)) t = i + 1;
      else {
        if (e >= r) return i;
        n = i;
      }
    }
    return t;
  }
  getWhitespaceAtVerticalOffset(e) {
    e |= 0;
    const t = this.getWhitespaceIndexAtOrAfterVerticallOffset(e);
    if (t < 0) return null;
    if (t >= this.getWhitespacesCount()) return null;
    const n = this.getVerticalOffsetForWhitespaceIndex(t);
    if (n > e) return null;
    const i = this.getHeightForWhitespaceIndex(t);
    return {
      id: this.getIdForWhitespaceIndex(t),
      afterLineNumber: this.getAfterLineNumberForWhitespaceIndex(t),
      verticalOffset: n,
      height: i,
    };
  }
  getWhitespaceViewportData(e, t) {
    ((e |= 0), (t |= 0));
    const n = this.getWhitespaceIndexAtOrAfterVerticallOffset(e),
      i = this.getWhitespacesCount() - 1;
    if (n < 0) return [];
    const r = [];
    for (let o = n; o <= i; o++) {
      const e = this.getVerticalOffsetForWhitespaceIndex(o),
        n = this.getHeightForWhitespaceIndex(o);
      if (e >= t) break;
      r.push({
        id: this.getIdForWhitespaceIndex(o),
        afterLineNumber: this.getAfterLineNumberForWhitespaceIndex(o),
        verticalOffset: e,
        height: n,
      });
    }
    return r;
  }
  getWhitespaces() {
    return this._arr.slice(0);
  }
  getWhitespacesCount() {
    return this._arr.length;
  }
  getIdForWhitespaceIndex(e) {
    return ((e |= 0), this._arr[e].id);
  }
  getAfterLineNumberForWhitespaceIndex(e) {
    return ((e |= 0), this._arr[e].afterLineNumber);
  }
  getHeightForWhitespaceIndex(e) {
    return ((e |= 0), this._arr[e].height);
  }
};
class Lte {
  constructor(e, t, n, i) {
    ((e |= 0) < 0 && (e = 0),
      (t |= 0) < 0 && (t = 0),
      (n |= 0) < 0 && (n = 0),
      (i |= 0) < 0 && (i = 0),
      (this.width = e),
      (this.contentWidth = t),
      (this.scrollWidth = Math.max(e, t)),
      (this.height = n),
      (this.contentHeight = i),
      (this.scrollHeight = Math.max(n, i)));
  }
  equals(e) {
    return (
      this.width === e.width &&
      this.contentWidth === e.contentWidth &&
      this.height === e.height &&
      this.contentHeight === e.contentHeight
    );
  }
}
class Dte extends PO {
  constructor(e, t) {
    (super(),
      (this._onDidContentSizeChange = this._register(new QO())),
      (this.onDidContentSizeChange = this._onDidContentSizeChange.event),
      (this._dimensions = new Lte(0, 0, 0, 0)),
      (this._scrollable = this._register(
        new gJ({
          forceIntegerValues: !0,
          smoothScrollDuration: e,
          scheduleAtNextAnimationFrame: t,
        }),
      )),
      (this.onDidScroll = this._scrollable.onScroll));
  }
  getScrollable() {
    return this._scrollable;
  }
  setSmoothScrollDuration(e) {
    this._scrollable.setSmoothScrollDuration(e);
  }
  validateScrollPosition(e) {
    return this._scrollable.validateScrollPosition(e);
  }
  getScrollDimensions() {
    return this._dimensions;
  }
  setScrollDimensions(e) {
    if (this._dimensions.equals(e)) return;
    const t = this._dimensions;
    ((this._dimensions = e),
      this._scrollable.setScrollDimensions(
        {
          width: e.width,
          scrollWidth: e.scrollWidth,
          height: e.height,
          scrollHeight: e.scrollHeight,
        },
        !0,
      ));
    const n = t.contentWidth !== e.contentWidth,
      i = t.contentHeight !== e.contentHeight;
    (n || i) &&
      this._onDidContentSizeChange.fire(
        new Xee(t.contentWidth, t.contentHeight, e.contentWidth, e.contentHeight),
      );
  }
  getFutureScrollPosition() {
    return this._scrollable.getFutureScrollPosition();
  }
  getCurrentScrollPosition() {
    return this._scrollable.getCurrentScrollPosition();
  }
  setScrollPositionNow(e) {
    this._scrollable.setScrollPositionNow(e);
  }
  setScrollPositionSmooth(e) {
    this._scrollable.setScrollPositionSmooth(e);
  }
  hasPendingScrollAnimation() {
    return this._scrollable.hasPendingScrollAnimation();
  }
}
class Tte extends PO {
  constructor(e, t, n, i) {
    (super(), (this._configuration = e));
    const r = this._configuration.options,
      o = r.get(165),
      s = r.get(96);
    ((this._linesLayout = new Nte(t, r.get(75), s.top, s.bottom, n)),
      (this._maxLineWidth = 0),
      (this._overlayWidgetsMinWidth = 0),
      (this._scrollable = this._register(new Dte(0, i))),
      this._configureSmoothScrollDuration(),
      this._scrollable.setScrollDimensions(new Lte(o.contentWidth, 0, o.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) ? 125 : 0);
  }
  onConfigurationChanged(e) {
    const t = this._configuration.options;
    if ((e.hasChanged(75) && this._linesLayout.setDefaultLineHeight(t.get(75)), e.hasChanged(96))) {
      const e = t.get(96);
      this._linesLayout.setPadding(e.top, e.bottom);
    }
    if (e.hasChanged(165)) {
      const e = t.get(165),
        n = e.contentWidth,
        i = e.height,
        r = this._scrollable.getScrollDimensions(),
        o = r.contentWidth;
      this._scrollable.setScrollDimensions(
        new Lte(n, r.contentWidth, i, this._getContentHeight(n, i, o)),
      );
    } else this._updateHeight();
    e.hasChanged(130) && this._configureSmoothScrollDuration();
  }
  onFlushed(e, t) {
    this._linesLayout.onFlushed(e, t);
  }
  onLinesDeleted(e, t) {
    this._linesLayout.onLinesDeleted(e, t);
  }
  onLinesInserted(e, t) {
    this._linesLayout.onLinesInserted(e, t);
  }
  _getHorizontalScrollbarHeight(e, t) {
    const n = this._configuration.options.get(117);
    return 2 === n.horizontal || e >= t ? 0 : n.horizontalScrollbarSize;
  }
  _getContentHeight(e, t, n) {
    const i = this._configuration.options;
    let r = this._linesLayout.getLinesTotalHeight();
    return (
      i.get(119)
        ? (r += Math.max(0, t - i.get(75) - i.get(96).bottom))
        : i.get(117).ignoreHorizontalScrollbarInContentHeight ||
          (r += this._getHorizontalScrollbarHeight(e, n)),
      r
    );
  }
  _updateHeight() {
    const e = this._scrollable.getScrollDimensions(),
      t = e.width,
      n = e.height,
      i = e.contentWidth;
    this._scrollable.setScrollDimensions(
      new Lte(t, e.contentWidth, n, this._getContentHeight(t, n, i)),
    );
  }
  getCurrentViewport() {
    const e = this._scrollable.getScrollDimensions(),
      t = this._scrollable.getCurrentScrollPosition();
    return new t4(t.scrollTop, t.scrollLeft, e.width, e.height);
  }
  getFutureViewport() {
    const e = this._scrollable.getScrollDimensions(),
      t = this._scrollable.getFutureScrollPosition();
    return new t4(t.scrollTop, t.scrollLeft, e.width, e.height);
  }
  _computeContentWidth() {
    const e = this._configuration.options,
      t = this._maxLineWidth,
      n = e.get(166),
      i = e.get(59),
      r = e.get(165);
    if (n.isViewportWrapping) {
      const n = e.get(81);
      return t > r.contentWidth + i.typicalHalfwidthCharacterWidth &&
        n.enabled &&
        "right" === n.side
        ? t + r.verticalScrollbarWidth
        : t;
    }
    {
      const n = e.get(118) * i.typicalHalfwidthCharacterWidth,
        o = this._linesLayout.getWhitespaceMinWidth();
      return Math.max(t + n + r.verticalScrollbarWidth, o, this._overlayWidgetsMinWidth);
    }
  }
  setMaxLineWidth(e) {
    ((this._maxLineWidth = e), this._updateContentWidth());
  }
  setOverlayWidgetsMinWidth(e) {
    ((this._overlayWidgetsMinWidth = e), this._updateContentWidth());
  }
  _updateContentWidth() {
    const e = this._scrollable.getScrollDimensions();
    (this._scrollable.setScrollDimensions(
      new Lte(e.width, this._computeContentWidth(), e.height, e.contentHeight),
    ),
      this._updateHeight());
  }
  saveState() {
    const e = this._scrollable.getFutureScrollPosition(),
      t = e.scrollTop,
      n = this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);
    return {
      scrollTop: t,
      scrollTopWithoutViewZones:
        t - this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n),
      scrollLeft: e.scrollLeft,
    };
  }
  changeWhitespace(e) {
    const t = this._linesLayout.changeWhitespace(e);
    return (t && this.onHeightMaybeChanged(), t);
  }
  changeSpecialLineHeights(e) {
    const t = this._linesLayout.changeLineHeights(e);
    return (t && this.onHeightMaybeChanged(), t);
  }
  getVerticalOffsetForLineNumber(e, t = !1) {
    return this._linesLayout.getVerticalOffsetForLineNumber(e, t);
  }
  getVerticalOffsetAfterLineNumber(e, t = !1) {
    return this._linesLayout.getVerticalOffsetAfterLineNumber(e, t);
  }
  getLineHeightForLineNumber(e) {
    return this._linesLayout.getLineHeightForLineNumber(e);
  }
  isAfterLines(e) {
    return this._linesLayout.isAfterLines(e);
  }
  isInTopPadding(e) {
    return this._linesLayout.isInTopPadding(e);
  }
  isInBottomPadding(e) {
    return this._linesLayout.isInBottomPadding(e);
  }
  getLineNumberAtVerticalOffset(e) {
    return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e);
  }
  getWhitespaceAtVerticalOffset(e) {
    return this._linesLayout.getWhitespaceAtVerticalOffset(e);
  }
  getLinesViewportData() {
    const e = this.getCurrentViewport();
    return this._linesLayout.getLinesViewportData(e.top, e.top + e.height);
  }
  getLinesViewportDataAtScrollTop(e) {
    const t = this._scrollable.getScrollDimensions();
    return (
      e + t.height > t.scrollHeight && (e = t.scrollHeight - t.height),
      e < 0 && (e = 0),
      this._linesLayout.getLinesViewportData(e, e + t.height)
    );
  }
  getWhitespaceViewportData() {
    const e = this.getCurrentViewport();
    return this._linesLayout.getWhitespaceViewportData(e.top, e.top + e.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(e) {
    return this._scrollable.validateScrollPosition(e);
  }
  setScrollPosition(e, t) {
    1 === t
      ? this._scrollable.setScrollPositionNow(e)
      : this._scrollable.setScrollPositionSmooth(e);
  }
  hasPendingScrollAnimation() {
    return this._scrollable.hasPendingScrollAnimation();
  }
  deltaScrollNow(e, t) {
    const n = this._scrollable.getCurrentScrollPosition();
    this._scrollable.setScrollPositionNow({
      scrollLeft: n.scrollLeft + e,
      scrollTop: n.scrollTop + t,
    });
  }
}
class Ite {
  constructor(e, t, n) {
    ((this.range = e), (this.inlineClassName = t), (this.type = n));
  }
}
class Rte {
  constructor(e, t, n, i) {
    ((this.startOffset = e),
      (this.endOffset = t),
      (this.inlineClassName = n),
      (this.inlineClassNameAffectsLetterSpacing = i));
  }
  toInlineDecoration(e) {
    return new Ite(
      new YH(e, this.startOffset + 1, e, this.endOffset + 1),
      this.inlineClassName,
      this.inlineClassNameAffectsLetterSpacing ? 3 : 0,
    );
  }
}
class Ote {
  constructor(e, t, n, i, r) {
    ((this.editorId = e),
      (this.model = t),
      (this.configuration = n),
      (this._linesCollection = i),
      (this._coordinatesConverter = r),
      (this._decorationsCache = Object.create(null)),
      (this._cachedModelDecorationsResolver = null),
      (this._cachedModelDecorationsResolverViewRange = null));
  }
  _clearCachedModelDecorationsResolver() {
    ((this._cachedModelDecorationsResolver = null),
      (this._cachedModelDecorationsResolverViewRange = null));
  }
  dispose() {
    ((this._decorationsCache = Object.create(null)), this._clearCachedModelDecorationsResolver());
  }
  reset() {
    ((this._decorationsCache = Object.create(null)), this._clearCachedModelDecorationsResolver());
  }
  onModelDecorationsChanged() {
    ((this._decorationsCache = Object.create(null)), this._clearCachedModelDecorationsResolver());
  }
  onLineMappingChanged() {
    ((this._decorationsCache = Object.create(null)), this._clearCachedModelDecorationsResolver());
  }
  _getOrCreateViewModelDecoration(e) {
    const t = e.id;
    let n = this._decorationsCache[t];
    if (!n) {
      const i = e.range,
        r = e.options;
      let o;
      if (r.isWholeLine) {
        const e = this._coordinatesConverter.convertModelPositionToViewPosition(
            new xV(i.startLineNumber, 1),
            0,
            !1,
            !0,
          ),
          t = this._coordinatesConverter.convertModelPositionToViewPosition(
            new xV(i.endLineNumber, this.model.getLineMaxColumn(i.endLineNumber)),
            1,
          );
        o = new YH(e.lineNumber, e.column, t.lineNumber, t.column);
      } else o = this._coordinatesConverter.convertModelRangeToViewRange(i, 1);
      ((n = new V2(o, r)), (this._decorationsCache[t] = n));
    }
    return n;
  }
  getMinimapDecorationsInRange(e) {
    return this._getDecorationsInRange(e, !0, !1).decorations;
  }
  getDecorationsViewportData(e) {
    let t = null !== this._cachedModelDecorationsResolver;
    return (
      (t = t && e.equalsRange(this._cachedModelDecorationsResolverViewRange)),
      t ||
        ((this._cachedModelDecorationsResolver = this._getDecorationsInRange(e, !1, !1)),
        (this._cachedModelDecorationsResolverViewRange = e)),
      this._cachedModelDecorationsResolver
    );
  }
  getDecorationsOnLine(e, t = !1, n = !1) {
    const i = new YH(
      e,
      this._linesCollection.getViewLineMinColumn(e),
      e,
      this._linesCollection.getViewLineMaxColumn(e),
    );
    return this._getDecorationsInRange(i, t, n);
  }
  _getDecorationsInRange(e, t, n) {
    const i = this._linesCollection.getDecorationsInRange(
        e,
        this.editorId,
        kK(this.configuration.options),
        EK(this.configuration.options),
        t,
        n,
      ),
      r = e.startLineNumber,
      o = e.endLineNumber,
      s = [];
    let a = 0;
    const l = [];
    for (let d = r; d <= o; d++) l[d - r] = [];
    let c = !1;
    for (let d = 0, u = i.length; d < u; d++) {
      const e = i[d],
        t = e.options;
      if (!W2(this.model, e)) continue;
      const n = this._getOrCreateViewModelDecoration(e),
        u = n.range;
      if (((s[a++] = n), t.inlineClassName)) {
        const e = new Ite(u, t.inlineClassName, t.inlineClassNameAffectsLetterSpacing ? 3 : 0),
          n = Math.max(r, u.startLineNumber),
          i = Math.min(o, u.endLineNumber);
        for (let t = n; t <= i; t++) l[t - r].push(e);
      }
      if (t.beforeContentClassName && r <= u.startLineNumber && u.startLineNumber <= o) {
        const e = new Ite(
          new YH(u.startLineNumber, u.startColumn, u.startLineNumber, u.startColumn),
          t.beforeContentClassName,
          1,
        );
        l[u.startLineNumber - r].push(e);
      }
      if (t.afterContentClassName && r <= u.endLineNumber && u.endLineNumber <= o) {
        const e = new Ite(
          new YH(u.endLineNumber, u.endColumn, u.endLineNumber, u.endColumn),
          t.afterContentClassName,
          2,
        );
        l[u.endLineNumber - r].push(e);
      }
      t.affectsFont && (c = !0);
    }
    return { decorations: s, inlineDecorations: l, hasVariableFonts: c };
  }
}
function Mte(e, t) {
  return null === e ? (t ? Pte.INSTANCE : jte.INSTANCE) : new Ate(e, t);
}
class Ate {
  constructor(e, t) {
    ((this._projectionData = e), (this._isVisible = t));
  }
  isVisible() {
    return this._isVisible;
  }
  setVisible(e) {
    return ((this._isVisible = e), this);
  }
  getProjectionData() {
    return this._projectionData;
  }
  getViewLineCount() {
    return this._isVisible ? this._projectionData.getOutputLineCount() : 0;
  }
  getViewLineContent(e, t, n) {
    this._assertVisible();
    const i = n > 0 ? this._projectionData.breakOffsets[n - 1] : 0,
      r = this._projectionData.breakOffsets[n];
    let o;
    if (null !== this._projectionData.injectionOffsets) {
      const n = this._projectionData.injectionOffsets.map(
        (e, t) => new I3(0, 0, e + 1, this._projectionData.injectionOptions[t], 0),
      );
      o = I3.applyInjectedText(e.getLineContent(t), n).substring(i, r);
    } else
      o = e.getValueInRange({
        startLineNumber: t,
        startColumn: i + 1,
        endLineNumber: t,
        endColumn: r + 1,
      });
    return (n > 0 && (o = Bte(this._projectionData.wrappedTextIndentLength) + o), o);
  }
  getViewLineLength(e, t, n) {
    return (this._assertVisible(), this._projectionData.getLineLength(n));
  }
  getViewLineMinColumn(e, t, n) {
    return (this._assertVisible(), this._projectionData.getMinOutputOffset(n) + 1);
  }
  getViewLineMaxColumn(e, t, n) {
    return (this._assertVisible(), this._projectionData.getMaxOutputOffset(n) + 1);
  }
  getViewLineData(e, t, n) {
    const i = new Array();
    return (this.getViewLinesData(e, t, n, 1, 0, [!0], i), i[0]);
  }
  getViewLinesData(e, t, n, i, r, o, s) {
    this._assertVisible();
    const a = this._projectionData,
      l = a.injectionOffsets,
      c = a.injectionOptions;
    let d,
      u = null;
    if (l) {
      u = [];
      let e = 0,
        t = 0;
      for (let n = 0; n < a.getOutputLineCount(); n++) {
        const i = new Array();
        u[n] = i;
        const r = n > 0 ? a.breakOffsets[n - 1] : 0,
          o = a.breakOffsets[n];
        for (; t < l.length; ) {
          const s = c[t].content.length,
            d = l[t] + e,
            u = d + s;
          if (d > o) break;
          if (r < u) {
            const e = c[t];
            if (e.inlineClassName) {
              const t = n > 0 ? a.wrappedTextIndentLength : 0,
                s = t + Math.max(d - r, 0),
                l = t + Math.min(u - r, o - r);
              s !== l &&
                i.push(new Rte(s, l, e.inlineClassName, e.inlineClassNameAffectsLetterSpacing));
            }
          }
          if (!(u <= o)) break;
          ((e += s), t++);
        }
      }
    }
    if (l) {
      const n = [];
      for (let e = 0; e < l.length; e++) {
        const t = l[e],
          i = c[e].tokens;
        i
          ? i.forEach((i, r) => {
              n.push({ offset: t, text: i.substring(c[e].content), tokenMetadata: r.metadata });
            })
          : n.push({ offset: t, text: c[e].content, tokenMetadata: D$.defaultTokenMetadata });
      }
      d = e.tokenization.getLineTokens(t).withInserted(n);
    } else d = e.tokenization.getLineTokens(t);
    for (let h = n; h < n + i; h++) {
      const e = r + h - n;
      o[e] ? (s[e] = this._getViewLineData(d, u ? u[h] : null, h)) : (s[e] = null);
    }
  }
  _getViewLineData(e, t, n) {
    this._assertVisible();
    const i = this._projectionData,
      r = n > 0 ? i.wrappedTextIndentLength : 0,
      o = n > 0 ? i.breakOffsets[n - 1] : 0,
      s = i.breakOffsets[n],
      a = e.sliceAndInflate(o, s, r);
    let l = a.getLineContent();
    n > 0 && (l = Bte(i.wrappedTextIndentLength) + l);
    const c = this._projectionData.getMinOutputOffset(n) + 1,
      d = l.length + 1,
      u = n + 1 < this.getViewLineCount(),
      h = 0 === n ? 0 : i.breakOffsetsVisibleColumn[n - 1];
    return new i4(l, u, c, d, h, a, t);
  }
  getModelColumnOfViewPosition(e, t) {
    return (this._assertVisible(), this._projectionData.translateToInputOffset(e, t - 1) + 1);
  }
  getViewPositionOfModelPosition(e, t, n = 2) {
    this._assertVisible();
    return this._projectionData.translateToOutputPosition(t - 1, n).toPosition(e);
  }
  getViewLineNumberOfModelPosition(e, t) {
    this._assertVisible();
    return e + this._projectionData.translateToOutputPosition(t - 1).outputLineIndex;
  }
  normalizePosition(e, t, n) {
    const i = t.lineNumber - e;
    return this._projectionData.normalizeOutputPosition(e, t.column - 1, n).toPosition(i);
  }
  getInjectedTextAt(e, t) {
    return this._projectionData.getInjectedText(e, t - 1);
  }
  _assertVisible() {
    if (!this._isVisible) throw new Error("Not supported");
  }
}
class Pte {
  static {
    this.INSTANCE = new Pte();
  }
  constructor() {}
  isVisible() {
    return !0;
  }
  setVisible(e) {
    return e ? this : jte.INSTANCE;
  }
  getProjectionData() {
    return null;
  }
  getViewLineCount() {
    return 1;
  }
  getViewLineContent(e, t, n) {
    return e.getLineContent(t);
  }
  getViewLineLength(e, t, n) {
    return e.getLineLength(t);
  }
  getViewLineMinColumn(e, t, n) {
    return e.getLineMinColumn(t);
  }
  getViewLineMaxColumn(e, t, n) {
    return e.getLineMaxColumn(t);
  }
  getViewLineData(e, t, n) {
    const i = e.tokenization.getLineTokens(t),
      r = i.getLineContent();
    return new i4(r, !1, 1, r.length + 1, 0, i.inflate(), null);
  }
  getViewLinesData(e, t, n, i, r, o, s) {
    o[r] ? (s[r] = this.getViewLineData(e, t, 0)) : (s[r] = null);
  }
  getModelColumnOfViewPosition(e, t) {
    return t;
  }
  getViewPositionOfModelPosition(e, t) {
    return new xV(e, t);
  }
  getViewLineNumberOfModelPosition(e, t) {
    return e;
  }
  normalizePosition(e, t, n) {
    return t;
  }
  getInjectedTextAt(e, t) {
    return null;
  }
}
class jte {
  static {
    this.INSTANCE = new jte();
  }
  constructor() {}
  isVisible() {
    return !1;
  }
  setVisible(e) {
    return e ? Pte.INSTANCE : this;
  }
  getProjectionData() {
    return null;
  }
  getViewLineCount() {
    return 0;
  }
  getViewLineContent(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLineLength(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLineMinColumn(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLineMaxColumn(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLineData(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLinesData(e, t, n, i, r, o, s) {
    throw new Error("Not supported");
  }
  getModelColumnOfViewPosition(e, t) {
    throw new Error("Not supported");
  }
  getViewPositionOfModelPosition(e, t) {
    throw new Error("Not supported");
  }
  getViewLineNumberOfModelPosition(e, t) {
    throw new Error("Not supported");
  }
  normalizePosition(e, t, n) {
    throw new Error("Not supported");
  }
  getInjectedTextAt(e, t) {
    throw new Error("Not supported");
  }
}
const Fte = [""];
function Bte(e) {
  if (e >= Fte.length) for (let t = 1; t <= e; t++) Fte[t] = Vte(t);
  return Fte[e];
}
function Vte(e) {
  return new Array(e + 1).join(" ");
}
class Wte {
  constructor(e) {
    ((this.values = e),
      (this.prefixSum = new Uint32Array(e.length)),
      (this.prefixSumValidIndex = new Int32Array(1)),
      (this.prefixSumValidIndex[0] = -1));
  }
  insertValues(e, t) {
    e = Dz(e);
    const n = this.values,
      i = this.prefixSum,
      r = t.length;
    return (
      0 !== r &&
      ((this.values = new Uint32Array(n.length + r)),
      this.values.set(n.subarray(0, e), 0),
      this.values.set(n.subarray(e), e + r),
      this.values.set(t, e),
      e - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e - 1),
      (this.prefixSum = new Uint32Array(this.values.length)),
      this.prefixSumValidIndex[0] >= 0 &&
        this.prefixSum.set(i.subarray(0, this.prefixSumValidIndex[0] + 1)),
      !0)
    );
  }
  setValue(e, t) {
    return (
      (e = Dz(e)),
      (t = Dz(t)),
      this.values[e] !== t &&
        ((this.values[e] = t),
        e - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e - 1),
        !0)
    );
  }
  removeValues(e, t) {
    ((e = Dz(e)), (t = Dz(t)));
    const n = this.values,
      i = this.prefixSum;
    if (e >= n.length) return !1;
    const r = n.length - e;
    return (
      t >= r && (t = r),
      0 !== t &&
        ((this.values = new Uint32Array(n.length - t)),
        this.values.set(n.subarray(0, e), 0),
        this.values.set(n.subarray(e + t), e),
        (this.prefixSum = new Uint32Array(this.values.length)),
        e - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e - 1),
        this.prefixSumValidIndex[0] >= 0 &&
          this.prefixSum.set(i.subarray(0, this.prefixSumValidIndex[0] + 1)),
        !0)
    );
  }
  getTotalSum() {
    return 0 === this.values.length ? 0 : this._getPrefixSum(this.values.length - 1);
  }
  getPrefixSum(e) {
    return e < 0 ? 0 : ((e = Dz(e)), this._getPrefixSum(e));
  }
  _getPrefixSum(e) {
    if (e <= this.prefixSumValidIndex[0]) return this.prefixSum[e];
    let t = this.prefixSumValidIndex[0] + 1;
    (0 === t && ((this.prefixSum[0] = this.values[0]), t++),
      e >= this.values.length && (e = this.values.length - 1));
    for (let n = t; n <= e; n++) this.prefixSum[n] = this.prefixSum[n - 1] + this.values[n];
    return (
      (this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], e)),
      this.prefixSum[e]
    );
  }
  getIndexOf(e) {
    ((e = Math.floor(e)), this.getTotalSum());
    let t = 0,
      n = this.values.length - 1,
      i = 0,
      r = 0,
      o = 0;
    for (; t <= n; )
      if (((i = (t + (n - t) / 2) | 0), (r = this.prefixSum[i]), (o = r - this.values[i]), e < o))
        n = i - 1;
      else {
        if (!(e >= r)) break;
        t = i + 1;
      }
    return new zte(i, e - o);
  }
}
class Hte {
  constructor(e) {
    ((this._values = e),
      (this._isValid = !1),
      (this._validEndIndex = -1),
      (this._prefixSum = []),
      (this._indexBySum = []));
  }
  getTotalSum() {
    return (this._ensureValid(), this._indexBySum.length);
  }
  getPrefixSum(e) {
    return (this._ensureValid(), 0 === e ? 0 : this._prefixSum[e - 1]);
  }
  getIndexOf(e) {
    this._ensureValid();
    const t = this._indexBySum[e],
      n = t > 0 ? this._prefixSum[t - 1] : 0;
    return new zte(t, e - n);
  }
  removeValues(e, t) {
    (this._values.splice(e, t), this._invalidate(e));
  }
  insertValues(e, t) {
    ((this._values = dj(this._values, e, t)), this._invalidate(e));
  }
  _invalidate(e) {
    ((this._isValid = !1), (this._validEndIndex = Math.min(this._validEndIndex, e - 1)));
  }
  _ensureValid() {
    if (!this._isValid) {
      for (let e = this._validEndIndex + 1, t = this._values.length; e < t; e++) {
        const t = this._values[e],
          n = e > 0 ? this._prefixSum[e - 1] : 0;
        this._prefixSum[e] = n + t;
        for (let i = 0; i < t; i++) this._indexBySum[n + i] = e;
      }
      ((this._prefixSum.length = this._values.length),
        (this._indexBySum.length = this._prefixSum[this._prefixSum.length - 1]),
        (this._isValid = !0),
        (this._validEndIndex = this._values.length - 1));
    }
  }
  setValue(e, t) {
    this._values[e] !== t && ((this._values[e] = t), this._invalidate(e));
  }
}
class zte {
  constructor(e, t) {
    ((this.index = e),
      (this.remainder = t),
      (this._prefixSumIndexOfResultBrand = void 0),
      (this.index = e),
      (this.remainder = t));
  }
}
class Ute {
  constructor(e) {
    this._model = e;
  }
  _validPosition(e) {
    return this._model.validatePosition(e);
  }
  _validRange(e) {
    return this._model.validateRange(e);
  }
  convertViewPositionToModelPosition(e) {
    return this._validPosition(e);
  }
  convertViewRangeToModelRange(e) {
    return this._validRange(e);
  }
  validateViewPosition(e, t) {
    return this._validPosition(t);
  }
  validateViewRange(e, t) {
    return this._validRange(t);
  }
  convertModelPositionToViewPosition(e) {
    return this._validPosition(e);
  }
  convertModelRangeToViewRange(e) {
    return this._validRange(e);
  }
  modelPositionIsVisible(e) {
    const t = this._model.getLineCount();
    return !(e.lineNumber < 1 || e.lineNumber > t);
  }
  getModelLineViewLineCount(e) {
    return 1;
  }
  getViewLineNumberOfModelPosition(e, t) {
    return e;
  }
}
class $te {
  constructor(e, t, n, i, r, o, s, a, l, c, d) {
    ((this._editorId = e),
      (this.model = t),
      (this._validModelVersionId = -1),
      (this._domLineBreaksComputerFactory = n),
      (this._monospaceLineBreaksComputerFactory = i),
      (this.fontInfo = r),
      (this.tabSize = o),
      (this.wrappingStrategy = s),
      (this.wrappingColumn = a),
      (this.wrappingIndent = l),
      (this.wordBreak = c),
      (this.wrapOnEscapedLineFeeds = d),
      this._constructLines(!0, null));
  }
  dispose() {
    this.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, []);
  }
  createCoordinatesConverter() {
    return new Gte(this);
  }
  _constructLines(e, t) {
    ((this.modelLineProjections = []),
      e &&
        (this.hiddenAreasDecorationIds = this.model.deltaDecorations(
          this.hiddenAreasDecorationIds,
          [],
        )));
    const n = this.model.getLinesContent(),
      i = this.model.getInjectedTextDecorations(this._editorId),
      r = n.length,
      o = this.createLineBreaksComputer(),
      s = new Cj(I3.fromDecorations(i));
    for (let p = 0; p < r; p++) {
      const e = s.takeWhile((e) => e.lineNumber === p + 1);
      o.addRequest(n[p], e, t ? t[p] : null);
    }
    const a = o.finalize(),
      l = [],
      c = this.hiddenAreasDecorationIds
        .map((e) => this.model.getDecorationRange(e))
        .sort(YH.compareRangesUsingStarts);
    let d = 1,
      u = 0,
      h = -1,
      g = h + 1 < c.length ? u + 1 : r + 2;
    for (let p = 0; p < r; p++) {
      const e = p + 1;
      e === g &&
        (h++,
        (d = c[h].startLineNumber),
        (u = c[h].endLineNumber),
        (g = h + 1 < c.length ? u + 1 : r + 2));
      const t = e >= d && e <= u,
        n = Mte(a[p], !t);
      ((l[p] = n.getViewLineCount()), (this.modelLineProjections[p] = n));
    }
    ((this._validModelVersionId = this.model.getVersionId()),
      (this.projectedModelLineLineCounts = new Hte(l)));
  }
  getHiddenAreas() {
    return this.hiddenAreasDecorationIds.map((e) => this.model.getDecorationRange(e));
  }
  setHiddenAreas(e) {
    const t = e.map((e) => this.model.validateRange(e)),
      n = (function (e) {
        if (0 === e.length) return [];
        const t = e.slice();
        t.sort(YH.compareRangesUsingStarts);
        const n = [];
        let i = t[0].startLineNumber,
          r = t[0].endLineNumber;
        for (let o = 1, s = t.length; o < s; o++) {
          const e = t[o];
          e.startLineNumber > r + 1
            ? (n.push(new YH(i, 1, r, 1)), (i = e.startLineNumber), (r = e.endLineNumber))
            : e.endLineNumber > r && (r = e.endLineNumber);
        }
        return (n.push(new YH(i, 1, r, 1)), n);
      })(t),
      i = this.hiddenAreasDecorationIds
        .map((e) => this.model.getDecorationRange(e))
        .sort(YH.compareRangesUsingStarts);
    if (n.length === i.length) {
      let e = !1;
      for (let t = 0; t < n.length; t++)
        if (!n[t].equalsRange(i[t])) {
          e = !0;
          break;
        }
      if (!e) return !1;
    }
    const r = n.map((e) => ({ range: e, options: cee.EMPTY }));
    this.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, r);
    const o = n;
    let s = 1,
      a = 0,
      l = -1,
      c = l + 1 < o.length ? a + 1 : this.modelLineProjections.length + 2,
      d = !1;
    for (let u = 0; u < this.modelLineProjections.length; u++) {
      const e = u + 1;
      e === c &&
        (l++,
        (s = o[l].startLineNumber),
        (a = o[l].endLineNumber),
        (c = l + 1 < o.length ? a + 1 : this.modelLineProjections.length + 2));
      let t = !1;
      if (
        (e >= s && e <= a
          ? this.modelLineProjections[u].isVisible() &&
            ((this.modelLineProjections[u] = this.modelLineProjections[u].setVisible(!1)), (t = !0))
          : ((d = !0),
            this.modelLineProjections[u].isVisible() ||
              ((this.modelLineProjections[u] = this.modelLineProjections[u].setVisible(!0)),
              (t = !0))),
        t)
      ) {
        const e = this.modelLineProjections[u].getViewLineCount();
        this.projectedModelLineLineCounts.setValue(u, e);
      }
    }
    return (d || this.setHiddenAreas([]), !0);
  }
  modelPositionIsVisible(e, t) {
    return (
      !(e < 1 || e > this.modelLineProjections.length) &&
      this.modelLineProjections[e - 1].isVisible()
    );
  }
  getModelLineViewLineCount(e) {
    return e < 1 || e > this.modelLineProjections.length
      ? 1
      : this.modelLineProjections[e - 1].getViewLineCount();
  }
  setTabSize(e) {
    return this.tabSize !== e && ((this.tabSize = e), this._constructLines(!1, null), !0);
  }
  setWrappingSettings(e, t, n, i, r) {
    const o = this.fontInfo.equals(e),
      s = this.wrappingStrategy === t,
      a = this.wrappingColumn === n,
      l = this.wrappingIndent === i,
      c = this.wordBreak === r;
    if (o && s && a && l && c) return !1;
    const d = o && s && !a && l && c;
    ((this.fontInfo = e),
      (this.wrappingStrategy = t),
      (this.wrappingColumn = n),
      (this.wrappingIndent = i),
      (this.wordBreak = r));
    let u = null;
    if (d) {
      u = [];
      for (let e = 0, t = this.modelLineProjections.length; e < t; e++)
        u[e] = this.modelLineProjections[e].getProjectionData();
    }
    return (this._constructLines(!1, u), !0);
  }
  createLineBreaksComputer() {
    return (
      "advanced" === this.wrappingStrategy
        ? this._domLineBreaksComputerFactory
        : this._monospaceLineBreaksComputerFactory
    ).createLineBreaksComputer(
      this.fontInfo,
      this.tabSize,
      this.wrappingColumn,
      this.wrappingIndent,
      this.wordBreak,
      this.wrapOnEscapedLineFeeds,
    );
  }
  onModelFlushed() {
    this._constructLines(!0, null);
  }
  onModelLinesDeleted(e, t, n) {
    if (!e || e <= this._validModelVersionId) return null;
    const i = 1 === t ? 1 : this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1,
      r = this.projectedModelLineLineCounts.getPrefixSum(n);
    return (
      this.modelLineProjections.splice(t - 1, n - t + 1),
      this.projectedModelLineLineCounts.removeValues(t - 1, n - t + 1),
      new Wee(i, r)
    );
  }
  onModelLinesInserted(e, t, n, i) {
    if (!e || e <= this._validModelVersionId) return null;
    const r = t > 2 && !this.modelLineProjections[t - 2].isVisible(),
      o = 1 === t ? 1 : this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1;
    let s = 0;
    const a = [],
      l = [];
    for (let c = 0, d = i.length; c < d; c++) {
      const e = Mte(i[c], !r);
      a.push(e);
      const t = e.getViewLineCount();
      ((s += t), (l[c] = t));
    }
    return (
      (this.modelLineProjections = this.modelLineProjections
        .slice(0, t - 1)
        .concat(a)
        .concat(this.modelLineProjections.slice(t - 1))),
      this.projectedModelLineLineCounts.insertValues(t - 1, l),
      new Hee(o, o + s - 1)
    );
  }
  onModelLineChanged(e, t, n) {
    if (null !== e && e <= this._validModelVersionId) return [!1, null, null, null];
    const i = t - 1,
      r = this.modelLineProjections[i].getViewLineCount(),
      o = Mte(n, this.modelLineProjections[i].isVisible());
    this.modelLineProjections[i] = o;
    const s = this.modelLineProjections[i].getViewLineCount();
    let a = !1,
      l = 0,
      c = -1,
      d = 0,
      u = -1,
      h = 0,
      g = -1;
    (r > s
      ? ((l = this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1),
        (c = l + s - 1),
        (h = c + 1),
        (g = h + (r - s) - 1),
        (a = !0))
      : r < s
        ? ((l = this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1),
          (c = l + r - 1),
          (d = c + 1),
          (u = d + (s - r) - 1),
          (a = !0))
        : ((l = this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1), (c = l + s - 1)),
      this.projectedModelLineLineCounts.setValue(i, s));
    return [
      a,
      l <= c ? new Vee(l, c - l + 1) : null,
      d <= u ? new Hee(d, u) : null,
      h <= g ? new Wee(h, g) : null,
    ];
  }
  acceptVersionId(e) {
    ((this._validModelVersionId = e),
      1 !== this.modelLineProjections.length ||
        this.modelLineProjections[0].isVisible() ||
        this.setHiddenAreas([]));
  }
  getViewLineCount() {
    return this.projectedModelLineLineCounts.getTotalSum();
  }
  _toValidViewLineNumber(e) {
    if (e < 1) return 1;
    const t = this.getViewLineCount();
    return e > t ? t : 0 | e;
  }
  getActiveIndentGuide(e, t, n) {
    ((e = this._toValidViewLineNumber(e)),
      (t = this._toValidViewLineNumber(t)),
      (n = this._toValidViewLineNumber(n)));
    const i = this.convertViewPositionToModelPosition(e, this.getViewLineMinColumn(e)),
      r = this.convertViewPositionToModelPosition(t, this.getViewLineMinColumn(t)),
      o = this.convertViewPositionToModelPosition(n, this.getViewLineMinColumn(n)),
      s = this.model.guides.getActiveIndentGuide(i.lineNumber, r.lineNumber, o.lineNumber),
      a = this.convertModelPositionToViewPosition(s.startLineNumber, 1),
      l = this.convertModelPositionToViewPosition(
        s.endLineNumber,
        this.model.getLineMaxColumn(s.endLineNumber),
      );
    return { startLineNumber: a.lineNumber, endLineNumber: l.lineNumber, indent: s.indent };
  }
  getViewLineInfo(e) {
    e = this._toValidViewLineNumber(e);
    const t = this.projectedModelLineLineCounts.getIndexOf(e - 1),
      n = t.index,
      i = t.remainder;
    return new qte(n + 1, i);
  }
  getMinColumnOfViewLine(e) {
    return this.modelLineProjections[e.modelLineNumber - 1].getViewLineMinColumn(
      this.model,
      e.modelLineNumber,
      e.modelLineWrappedLineIdx,
    );
  }
  getMaxColumnOfViewLine(e) {
    return this.modelLineProjections[e.modelLineNumber - 1].getViewLineMaxColumn(
      this.model,
      e.modelLineNumber,
      e.modelLineWrappedLineIdx,
    );
  }
  getModelStartPositionOfViewLine(e) {
    const t = this.modelLineProjections[e.modelLineNumber - 1],
      n = t.getViewLineMinColumn(this.model, e.modelLineNumber, e.modelLineWrappedLineIdx),
      i = t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx, n);
    return new xV(e.modelLineNumber, i);
  }
  getModelEndPositionOfViewLine(e) {
    const t = this.modelLineProjections[e.modelLineNumber - 1],
      n = t.getViewLineMaxColumn(this.model, e.modelLineNumber, e.modelLineWrappedLineIdx),
      i = t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx, n);
    return new xV(e.modelLineNumber, i);
  }
  getViewLineInfosGroupedByModelRanges(e, t) {
    const n = this.getViewLineInfo(e),
      i = this.getViewLineInfo(t),
      r = new Array();
    let o = this.getModelStartPositionOfViewLine(n),
      s = new Array();
    for (let a = n.modelLineNumber; a <= i.modelLineNumber; a++) {
      const e = this.modelLineProjections[a - 1];
      if (e.isVisible()) {
        const t = a === n.modelLineNumber ? n.modelLineWrappedLineIdx : 0,
          r = a === i.modelLineNumber ? i.modelLineWrappedLineIdx + 1 : e.getViewLineCount();
        for (let e = t; e < r; e++) s.push(new qte(a, e));
      }
      if (!e.isVisible() && o) {
        const e = new xV(a - 1, this.model.getLineMaxColumn(a - 1) + 1),
          t = YH.fromPositions(o, e);
        (r.push(new Kte(t, s)), (s = []), (o = null));
      } else e.isVisible() && !o && (o = new xV(a, 1));
    }
    if (o) {
      const e = YH.fromPositions(o, this.getModelEndPositionOfViewLine(i));
      r.push(new Kte(e, s));
    }
    return r;
  }
  getViewLinesBracketGuides(e, t, n, i) {
    const r = n ? this.convertViewPositionToModelPosition(n.lineNumber, n.column) : null,
      o = [];
    for (const s of this.getViewLineInfosGroupedByModelRanges(e, t)) {
      const e = s.modelRange.startLineNumber,
        t = this.model.guides.getLinesBracketGuides(e, s.modelRange.endLineNumber, r, i);
      for (const n of s.viewLines) {
        const i = t[n.modelLineNumber - e].map((e) => {
          if (-1 !== e.forWrappedLinesAfterColumn) {
            if (
              this.modelLineProjections[n.modelLineNumber - 1].getViewPositionOfModelPosition(
                0,
                e.forWrappedLinesAfterColumn,
              ).lineNumber >= n.modelLineWrappedLineIdx
            )
              return;
          }
          if (-1 !== e.forWrappedLinesBeforeOrAtColumn) {
            if (
              this.modelLineProjections[n.modelLineNumber - 1].getViewPositionOfModelPosition(
                0,
                e.forWrappedLinesBeforeOrAtColumn,
              ).lineNumber < n.modelLineWrappedLineIdx
            )
              return;
          }
          if (!e.horizontalLine) return e;
          let t = -1;
          if (-1 !== e.column) {
            const i = this.modelLineProjections[
              n.modelLineNumber - 1
            ].getViewPositionOfModelPosition(0, e.column);
            if (i.lineNumber === n.modelLineWrappedLineIdx) t = i.column;
            else if (i.lineNumber < n.modelLineWrappedLineIdx) t = this.getMinColumnOfViewLine(n);
            else if (i.lineNumber > n.modelLineWrappedLineIdx) return;
          }
          const i = this.convertModelPositionToViewPosition(
              n.modelLineNumber,
              e.horizontalLine.endColumn,
            ),
            r = this.modelLineProjections[n.modelLineNumber - 1].getViewPositionOfModelPosition(
              0,
              e.horizontalLine.endColumn,
            );
          return r.lineNumber === n.modelLineWrappedLineIdx
            ? new U1(
                e.visibleColumn,
                t,
                e.className,
                new $1(e.horizontalLine.top, i.column),
                -1,
                -1,
              )
            : r.lineNumber < n.modelLineWrappedLineIdx || -1 !== e.visibleColumn
              ? void 0
              : new U1(
                  e.visibleColumn,
                  t,
                  e.className,
                  new $1(e.horizontalLine.top, this.getMaxColumnOfViewLine(n)),
                  -1,
                  -1,
                );
        });
        o.push(i.filter((e) => !!e));
      }
    }
    return o;
  }
  getViewLinesIndentGuides(e, t) {
    ((e = this._toValidViewLineNumber(e)), (t = this._toValidViewLineNumber(t)));
    const n = this.convertViewPositionToModelPosition(e, this.getViewLineMinColumn(e)),
      i = this.convertViewPositionToModelPosition(t, this.getViewLineMaxColumn(t));
    let r = [];
    const o = [],
      s = [],
      a = n.lineNumber - 1,
      l = i.lineNumber - 1;
    let c = null;
    for (let g = a; g <= l; g++) {
      const e = this.modelLineProjections[g];
      if (e.isVisible()) {
        const t = e.getViewLineNumberOfModelPosition(0, g === a ? n.column : 1),
          i = e.getViewLineNumberOfModelPosition(0, this.model.getLineMaxColumn(g + 1)),
          r = i - t + 1;
        let l = 0;
        (r > 1 && 1 === e.getViewLineMinColumn(this.model, g + 1, i) && (l = 0 === t ? 1 : 2),
          o.push(r),
          s.push(l),
          null === c && (c = new xV(g + 1, 0)));
      } else
        null !== c &&
          ((r = r.concat(this.model.guides.getLinesIndentGuides(c.lineNumber, g))), (c = null));
    }
    null !== c &&
      ((r = r.concat(this.model.guides.getLinesIndentGuides(c.lineNumber, i.lineNumber))),
      (c = null));
    const d = t - e + 1,
      u = new Array(d);
    let h = 0;
    for (let g = 0, p = r.length; g < p; g++) {
      let e = r[g];
      const t = Math.min(d - h, o[g]),
        n = s[g];
      let i;
      i = 2 === n ? 0 : 1 === n ? 1 : t;
      for (let r = 0; r < t; r++) (r === i && (e = 0), (u[h++] = e));
    }
    return u;
  }
  getViewLineContent(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineContent(
      this.model,
      t.modelLineNumber,
      t.modelLineWrappedLineIdx,
    );
  }
  getViewLineLength(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineLength(
      this.model,
      t.modelLineNumber,
      t.modelLineWrappedLineIdx,
    );
  }
  getViewLineMinColumn(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineMinColumn(
      this.model,
      t.modelLineNumber,
      t.modelLineWrappedLineIdx,
    );
  }
  getViewLineMaxColumn(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineMaxColumn(
      this.model,
      t.modelLineNumber,
      t.modelLineWrappedLineIdx,
    );
  }
  getViewLineData(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineData(
      this.model,
      t.modelLineNumber,
      t.modelLineWrappedLineIdx,
    );
  }
  getViewLinesData(e, t, n) {
    ((e = this._toValidViewLineNumber(e)), (t = this._toValidViewLineNumber(t)));
    const i = this.projectedModelLineLineCounts.getIndexOf(e - 1);
    let r = e;
    const o = i.index,
      s = i.remainder,
      a = [];
    for (let l = o, c = this.model.getLineCount(); l < c; l++) {
      const i = this.modelLineProjections[l];
      if (!i.isVisible()) continue;
      const c = l === o ? s : 0;
      let d = i.getViewLineCount() - c,
        u = !1;
      if (
        (r + d > t && ((u = !0), (d = t - r + 1)),
        i.getViewLinesData(this.model, l + 1, c, d, r - e, n, a),
        (r += d),
        u)
      )
        break;
    }
    return a;
  }
  validateViewPosition(e, t, n) {
    e = this._toValidViewLineNumber(e);
    const i = this.projectedModelLineLineCounts.getIndexOf(e - 1),
      r = i.index,
      o = i.remainder,
      s = this.modelLineProjections[r],
      a = s.getViewLineMinColumn(this.model, r + 1, o),
      l = s.getViewLineMaxColumn(this.model, r + 1, o);
    (t < a && (t = a), t > l && (t = l));
    const c = s.getModelColumnOfViewPosition(o, t);
    return this.model.validatePosition(new xV(r + 1, c)).equals(n)
      ? new xV(e, t)
      : this.convertModelPositionToViewPosition(n.lineNumber, n.column);
  }
  validateViewRange(e, t) {
    const n = this.validateViewPosition(e.startLineNumber, e.startColumn, t.getStartPosition()),
      i = this.validateViewPosition(e.endLineNumber, e.endColumn, t.getEndPosition());
    return new YH(n.lineNumber, n.column, i.lineNumber, i.column);
  }
  convertViewPositionToModelPosition(e, t) {
    const n = this.getViewLineInfo(e),
      i = this.modelLineProjections[n.modelLineNumber - 1].getModelColumnOfViewPosition(
        n.modelLineWrappedLineIdx,
        t,
      );
    return this.model.validatePosition(new xV(n.modelLineNumber, i));
  }
  convertViewRangeToModelRange(e) {
    const t = this.convertViewPositionToModelPosition(e.startLineNumber, e.startColumn),
      n = this.convertViewPositionToModelPosition(e.endLineNumber, e.endColumn);
    return new YH(t.lineNumber, t.column, n.lineNumber, n.column);
  }
  convertModelPositionToViewPosition(e, t, n = 2, i = !1, r = !1) {
    const o = this.model.validatePosition(new xV(e, t)),
      s = o.lineNumber,
      a = o.column;
    let l = s - 1,
      c = !1;
    if (r)
      for (; l < this.modelLineProjections.length && !this.modelLineProjections[l].isVisible(); )
        (l++, (c = !0));
    else for (; l > 0 && !this.modelLineProjections[l].isVisible(); ) (l--, (c = !0));
    if (0 === l && !this.modelLineProjections[l].isVisible()) return new xV(i ? 0 : 1, 1);
    const d = 1 + this.projectedModelLineLineCounts.getPrefixSum(l);
    let u;
    return (
      (u = c
        ? r
          ? this.modelLineProjections[l].getViewPositionOfModelPosition(d, 1, n)
          : this.modelLineProjections[l].getViewPositionOfModelPosition(
              d,
              this.model.getLineMaxColumn(l + 1),
              n,
            )
        : this.modelLineProjections[s - 1].getViewPositionOfModelPosition(d, a, n)),
      u
    );
  }
  convertModelRangeToViewRange(e, t = 0) {
    if (e.isEmpty()) {
      const n = this.convertModelPositionToViewPosition(e.startLineNumber, e.startColumn, t);
      return YH.fromPositions(n);
    }
    {
      const t = this.convertModelPositionToViewPosition(e.startLineNumber, e.startColumn, 1),
        n = this.convertModelPositionToViewPosition(e.endLineNumber, e.endColumn, 0);
      return new YH(t.lineNumber, t.column, n.lineNumber, n.column);
    }
  }
  getViewLineNumberOfModelPosition(e, t) {
    let n = e - 1;
    if (this.modelLineProjections[n].isVisible()) {
      const e = 1 + this.projectedModelLineLineCounts.getPrefixSum(n);
      return this.modelLineProjections[n].getViewLineNumberOfModelPosition(e, t);
    }
    for (; n > 0 && !this.modelLineProjections[n].isVisible(); ) n--;
    if (0 === n && !this.modelLineProjections[n].isVisible()) return 1;
    const i = 1 + this.projectedModelLineLineCounts.getPrefixSum(n);
    return this.modelLineProjections[n].getViewLineNumberOfModelPosition(
      i,
      this.model.getLineMaxColumn(n + 1),
    );
  }
  getDecorationsInRange(e, t, n, i, r, o) {
    const s = this.convertViewPositionToModelPosition(e.startLineNumber, e.startColumn),
      a = this.convertViewPositionToModelPosition(e.endLineNumber, e.endColumn);
    if (a.lineNumber - s.lineNumber <= e.endLineNumber - e.startLineNumber)
      return this.model.getDecorationsInRange(
        new YH(s.lineNumber, 1, a.lineNumber, a.column),
        t,
        n,
        i,
        r,
        o,
      );
    let l = [];
    const c = s.lineNumber - 1,
      d = a.lineNumber - 1;
    let u = null;
    for (let f = c; f <= d; f++) {
      if (this.modelLineProjections[f].isVisible())
        null === u && (u = new xV(f + 1, f === c ? s.column : 1));
      else if (null !== u) {
        const e = this.model.getLineMaxColumn(f);
        ((l = l.concat(
          this.model.getDecorationsInRange(new YH(u.lineNumber, u.column, f, e), t, n, i, r),
        )),
          (u = null));
      }
    }
    (null !== u &&
      ((l = l.concat(
        this.model.getDecorationsInRange(
          new YH(u.lineNumber, u.column, a.lineNumber, a.column),
          t,
          n,
          i,
          r,
        ),
      )),
      (u = null)),
      l.sort((e, t) => {
        const n = YH.compareRangesUsingStarts(e.range, t.range);
        return 0 === n ? (e.id < t.id ? -1 : e.id > t.id ? 1 : 0) : n;
      }));
    const h = [];
    let g = 0,
      p = null;
    for (const f of l) {
      const e = f.id;
      p !== e && ((p = e), (h[g++] = f));
    }
    return h;
  }
  getInjectedTextAt(e) {
    const t = this.getViewLineInfo(e.lineNumber);
    return this.modelLineProjections[t.modelLineNumber - 1].getInjectedTextAt(
      t.modelLineWrappedLineIdx,
      e.column,
    );
  }
  normalizePosition(e, t) {
    const n = this.getViewLineInfo(e.lineNumber);
    return this.modelLineProjections[n.modelLineNumber - 1].normalizePosition(
      n.modelLineWrappedLineIdx,
      e,
      t,
    );
  }
  getLineIndentColumn(e) {
    const t = this.getViewLineInfo(e);
    return 0 === t.modelLineWrappedLineIdx ? this.model.getLineIndentColumn(t.modelLineNumber) : 0;
  }
}
class qte {
  constructor(e, t) {
    ((this.modelLineNumber = e), (this.modelLineWrappedLineIdx = t));
  }
}
class Kte {
  constructor(e, t) {
    ((this.modelRange = e), (this.viewLines = t));
  }
}
class Gte {
  constructor(e) {
    this._lines = e;
  }
  convertViewPositionToModelPosition(e) {
    return this._lines.convertViewPositionToModelPosition(e.lineNumber, e.column);
  }
  convertViewRangeToModelRange(e) {
    return this._lines.convertViewRangeToModelRange(e);
  }
  validateViewPosition(e, t) {
    return this._lines.validateViewPosition(e.lineNumber, e.column, t);
  }
  validateViewRange(e, t) {
    return this._lines.validateViewRange(e, t);
  }
  convertModelPositionToViewPosition(e, t, n, i) {
    return this._lines.convertModelPositionToViewPosition(e.lineNumber, e.column, t, n, i);
  }
  convertModelRangeToViewRange(e, t) {
    return this._lines.convertModelRangeToViewRange(e, t);
  }
  modelPositionIsVisible(e) {
    return this._lines.modelPositionIsVisible(e.lineNumber, e.column);
  }
  getModelLineViewLineCount(e) {
    return this._lines.getModelLineViewLineCount(e);
  }
  getViewLineNumberOfModelPosition(e, t) {
    return this._lines.getViewLineNumberOfModelPosition(e, t);
  }
}
class Zte {
  constructor(e) {
    this.model = e;
  }
  dispose() {}
  createCoordinatesConverter() {
    return new Ute(this.model);
  }
  getHiddenAreas() {
    return [];
  }
  setHiddenAreas(e) {
    return !1;
  }
  setTabSize(e) {
    return !1;
  }
  setWrappingSettings(e, t, n, i) {
    return !1;
  }
  createLineBreaksComputer() {
    const e = [];
    return {
      addRequest: (t, n, i) => {
        e.push(null);
      },
      finalize: () => e,
    };
  }
  onModelFlushed() {}
  onModelLinesDeleted(e, t, n) {
    return new Wee(t, n);
  }
  onModelLinesInserted(e, t, n, i) {
    return new Hee(t, n);
  }
  onModelLineChanged(e, t, n) {
    return [!1, new Vee(t, 1), null, null];
  }
  acceptVersionId(e) {}
  getViewLineCount() {
    return this.model.getLineCount();
  }
  getActiveIndentGuide(e, t, n) {
    return { startLineNumber: e, endLineNumber: e, indent: 0 };
  }
  getViewLinesBracketGuides(e, t, n) {
    return new Array(t - e + 1).fill([]);
  }
  getViewLinesIndentGuides(e, t) {
    const n = t - e + 1,
      i = new Array(n);
    for (let r = 0; r < n; r++) i[r] = 0;
    return i;
  }
  getViewLineContent(e) {
    return this.model.getLineContent(e);
  }
  getViewLineLength(e) {
    return this.model.getLineLength(e);
  }
  getViewLineMinColumn(e) {
    return this.model.getLineMinColumn(e);
  }
  getViewLineMaxColumn(e) {
    return this.model.getLineMaxColumn(e);
  }
  getViewLineData(e) {
    const t = this.model.tokenization.getLineTokens(e),
      n = t.getLineContent();
    return new i4(n, !1, 1, n.length + 1, 0, t.inflate(), null);
  }
  getViewLinesData(e, t, n) {
    const i = this.model.getLineCount();
    ((e = Math.min(Math.max(1, e), i)), (t = Math.min(Math.max(1, t), i)));
    const r = [];
    for (let o = e; o <= t; o++) {
      const t = o - e;
      r[t] = n[t] ? this.getViewLineData(o) : null;
    }
    return r;
  }
  getDecorationsInRange(e, t, n, i, r, o) {
    return this.model.getDecorationsInRange(e, t, n, i, r, o);
  }
  normalizePosition(e, t) {
    return this.model.normalizePosition(e, t);
  }
  getLineIndentColumn(e) {
    return this.model.getLineIndentColumn(e);
  }
  getInjectedTextAt(e) {
    return null;
  }
}
const Yte = $z.Right;
class Xte {
  constructor(e) {
    ((this.persist = 0),
      (this._requiredLanes = 1),
      (this.lanes = new Uint8Array(Math.ceil(((e + 1) * Yte) / 8))));
  }
  reset(e) {
    const t = Math.ceil(((e + 1) * Yte) / 8);
    (this.lanes.length < t ? (this.lanes = new Uint8Array(t)) : this.lanes.fill(0),
      (this._requiredLanes = 1));
  }
  get requiredLanes() {
    return this._requiredLanes;
  }
  push(e, t, n) {
    n && (this.persist |= 1 << (e - 1));
    for (let i = t.startLineNumber; i <= t.endLineNumber; i++) {
      const t = Yte * i + (e - 1);
      ((this.lanes[t >>> 3] |= 1 << (t % 8)),
        (this._requiredLanes = Math.max(this._requiredLanes, this.countAtLine(i))));
    }
  }
  getLanesAtLine(e) {
    const t = [];
    let n = Yte * e;
    for (let i = 0; i < Yte; i++)
      ((this.persist & (1 << i) || this.lanes[n >>> 3] & (1 << (n % 8))) && t.push(i + 1), n++);
    return t.length ? t : [$z.Center];
  }
  countAtLine(e) {
    let t = Yte * e,
      n = 0;
    for (let i = 0; i < Yte; i++)
      ((this.persist & (1 << i) || this.lanes[t >>> 3] & (1 << (t % 8))) && n++, t++);
    return n;
  }
}
let Qte = class extends PO {
  constructor(e, t, n, i, r, o, s, a, l, c) {
    if (
      (super(),
      (this.languageConfigurationService = s),
      (this._themeService = a),
      (this._attachedView = l),
      (this._transactionalTarget = c),
      (this.hiddenAreasModel = new tne()),
      (this.previousHiddenAreas = []),
      (this._editorId = e),
      (this._configuration = t),
      (this.model = n),
      (this._eventDispatcher = new Zee()),
      (this.onEvent = this._eventDispatcher.onEvent),
      (this.cursorConfig = new az(
        this.model.getLanguageId(),
        this.model.getOptions(),
        this._configuration,
        this.languageConfigurationService,
      )),
      (this._updateConfigurationViewLineCount = this._register(
        new EM(() => this._updateConfigurationViewLineCountNow(), 0),
      )),
      (this._hasFocus = !1),
      (this._viewportStart = Jte.create(this.model)),
      (this.glyphLanes = new Xte(0)),
      this.model.isTooLargeForTokenization())
    )
      this._lines = new Zte(this.model);
    else {
      const e = this._configuration.options,
        t = e.get(59),
        n = e.get(156),
        o = e.get(166),
        s = e.get(155),
        a = e.get(146),
        l = e.get(160);
      this._lines = new $te(
        this._editorId,
        this.model,
        i,
        r,
        t,
        this.model.getOptions().tabSize,
        n,
        o.wrappingColumn,
        s,
        a,
        l,
      );
    }
    ((this.coordinatesConverter = this._lines.createCoordinatesConverter()),
      (this._cursor = this._register(
        new gte(n, this, this.coordinatesConverter, this.cursorConfig),
      )),
      (this.viewLayout = this._register(
        new Tte(this._configuration, this.getLineCount(), this._getCustomLineHeights(), o),
      )),
      this._register(
        this.viewLayout.onDidScroll((e) => {
          (e.scrollTopChanged && this._handleVisibleLinesChanged(),
            e.scrollTopChanged && this._viewportStart.invalidate(),
            this._eventDispatcher.emitSingleViewEvent(new Uee(e)),
            this._eventDispatcher.emitOutgoingEvent(
              new ete(
                e.oldScrollWidth,
                e.oldScrollLeft,
                e.oldScrollHeight,
                e.oldScrollTop,
                e.scrollWidth,
                e.scrollLeft,
                e.scrollHeight,
                e.scrollTop,
              ),
            ));
        }),
      ),
      this._register(
        this.viewLayout.onDidContentSizeChange((e) => {
          this._eventDispatcher.emitOutgoingEvent(e);
        }),
      ),
      (this._decorations = new Ote(
        this._editorId,
        this.model,
        this._configuration,
        this._lines,
        this.coordinatesConverter,
      )),
      this._registerModelEvents(),
      this._register(
        this._configuration.onDidChangeFast((e) => {
          try {
            const t = this._eventDispatcher.beginEmitViewEvents();
            this._onConfigurationChanged(t, e);
          } finally {
            this._eventDispatcher.endEmitViewEvents();
          }
        }),
      ),
      this._register(
        R2.getInstance().onDidChange(() => {
          this._eventDispatcher.emitSingleViewEvent(new Kee());
        }),
      ),
      this._register(
        this._themeService.onDidColorThemeChange((e) => {
          (this._invalidateDecorationsColorCache(),
            this._eventDispatcher.emitSingleViewEvent(new $ee(e)));
        }),
      ),
      this._updateConfigurationViewLineCountNow());
  }
  dispose() {
    (super.dispose(),
      this._decorations.dispose(),
      this._lines.dispose(),
      this._viewportStart.dispose(),
      this._eventDispatcher.dispose());
  }
  createLineBreaksComputer() {
    return this._lines.createLineBreaksComputer();
  }
  addViewEventHandler(e) {
    this._eventDispatcher.addViewEventHandler(e);
  }
  removeViewEventHandler(e) {
    this._eventDispatcher.removeViewEventHandler(e);
  }
  _getCustomLineHeights() {
    if (!this._configuration.options.get(5)) return [];
    return this.model.getCustomLineHeightsDecorations(this._editorId).map((e) => {
      const t = e.range.startLineNumber,
        n = this.coordinatesConverter.convertModelRangeToViewRange(
          new YH(t, 1, t, this.model.getLineMaxColumn(t)),
        );
      return {
        decorationId: e.id,
        startLineNumber: n.startLineNumber,
        endLineNumber: n.endLineNumber,
        lineHeight: e.options.lineHeight || 0,
      };
    });
  }
  _updateConfigurationViewLineCountNow() {
    this._configuration.setViewLineCount(this._lines.getViewLineCount());
  }
  getModelVisibleRanges() {
    const e = this.viewLayout.getLinesViewportData(),
      t = new YH(
        e.startLineNumber,
        this.getLineMinColumn(e.startLineNumber),
        e.endLineNumber,
        this.getLineMaxColumn(e.endLineNumber),
      );
    return this._toModelVisibleRanges(t);
  }
  visibleLinesStabilized() {
    const e = this.getModelVisibleRanges();
    this._attachedView.setVisibleLines(e, !0);
  }
  _handleVisibleLinesChanged() {
    const e = this.getModelVisibleRanges();
    this._attachedView.setVisibleLines(e, !1);
  }
  setHasFocus(e) {
    ((this._hasFocus = e),
      this._cursor.setHasFocus(e),
      this._eventDispatcher.emitSingleViewEvent(new jee(e)),
      this._eventDispatcher.emitOutgoingEvent(new Qee(!e, e)));
  }
  setHasWidgetFocus(e) {
    this._eventDispatcher.emitOutgoingEvent(new Jee(!e, e));
  }
  onCompositionStart() {
    this._eventDispatcher.emitSingleViewEvent(new Iee());
  }
  onCompositionEnd() {
    this._eventDispatcher.emitSingleViewEvent(new Ree());
  }
  _captureStableViewport() {
    if (this._viewportStart.isValid && this.viewLayout.getCurrentScrollTop() > 0) {
      const e = new xV(
          this._viewportStart.viewLineNumber,
          this.getLineMinColumn(this._viewportStart.viewLineNumber),
        ),
        t = this.coordinatesConverter.convertViewPositionToModelPosition(e);
      return new ine(t, this._viewportStart.startLineDelta);
    }
    return new ine(null, 0);
  }
  _onConfigurationChanged(e, t) {
    const n = this._captureStableViewport(),
      i = this._configuration.options,
      r = i.get(59),
      o = i.get(156),
      s = i.get(166),
      a = i.get(155),
      l = i.get(146);
    (this._lines.setWrappingSettings(r, o, s.wrappingColumn, a, l) &&
      (e.emitViewEvent(new Pee()),
      e.emitViewEvent(new Bee()),
      e.emitViewEvent(new Aee(null)),
      this._cursor.onLineMappingChanged(e),
      this._decorations.onLineMappingChanged(),
      this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()),
      this._updateConfigurationViewLineCount.schedule()),
      t.hasChanged(104) && (this._decorations.reset(), e.emitViewEvent(new Aee(null))),
      t.hasChanged(112) && (this._decorations.reset(), e.emitViewEvent(new Aee(null))),
      e.emitViewEvent(new Oee(t)),
      this.viewLayout.onConfigurationChanged(t),
      n.recoverViewportStart(this.coordinatesConverter, this.viewLayout),
      az.shouldRecreate(t) &&
        ((this.cursorConfig = new az(
          this.model.getLanguageId(),
          this.model.getOptions(),
          this._configuration,
          this.languageConfigurationService,
        )),
        this._cursor.updateConfiguration(this.cursorConfig)));
  }
  _registerModelEvents() {
    this._register(
      this.model.onDidChangeContentOrInjectedText((e) => {
        try {
          const t = this._eventDispatcher.beginEmitViewEvents();
          let n = !1,
            i = !1;
          const r = e instanceof H3 ? e.rawContentChangedEvent.changes : e.changes,
            o = e instanceof H3 ? e.rawContentChangedEvent.versionId : null,
            s = this._lines.createLineBreaksComputer();
          for (const e of r)
            switch (e.changeType) {
              case 4:
                for (let t = 0; t < e.detail.length; t++) {
                  const n = e.detail[t];
                  let i = e.injectedTexts[t];
                  (i && (i = i.filter((e) => !e.ownerId || e.ownerId === this._editorId)),
                    s.addRequest(n, i, null));
                }
                break;
              case 2: {
                let t = null;
                (e.injectedText &&
                  (t = e.injectedText.filter((e) => !e.ownerId || e.ownerId === this._editorId)),
                  s.addRequest(e.detail, t, null));
                break;
              }
            }
          const a = s.finalize(),
            l = new Cj(a);
          for (const e of r)
            switch (e.changeType) {
              case 1:
                (this._lines.onModelFlushed(),
                  t.emitViewEvent(new Pee()),
                  this._decorations.reset(),
                  this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()),
                  (n = !0));
                break;
              case 3: {
                const i = this._lines.onModelLinesDeleted(o, e.fromLineNumber, e.toLineNumber);
                (null !== i &&
                  (t.emitViewEvent(i),
                  this.viewLayout.onLinesDeleted(i.fromLineNumber, i.toLineNumber)),
                  (n = !0));
                break;
              }
              case 4: {
                const i = l.takeCount(e.detail.length),
                  r = this._lines.onModelLinesInserted(o, e.fromLineNumber, e.toLineNumber, i);
                (null !== r &&
                  (t.emitViewEvent(r),
                  this.viewLayout.onLinesInserted(r.fromLineNumber, r.toLineNumber)),
                  (n = !0));
                break;
              }
              case 2: {
                const n = l.dequeue(),
                  [r, s, a, c] = this._lines.onModelLineChanged(o, e.lineNumber, n);
                ((i = r),
                  s && t.emitViewEvent(s),
                  a &&
                    (t.emitViewEvent(a),
                    this.viewLayout.onLinesInserted(a.fromLineNumber, a.toLineNumber)),
                  c &&
                    (t.emitViewEvent(c),
                    this.viewLayout.onLinesDeleted(c.fromLineNumber, c.toLineNumber)));
                break;
              }
            }
          (null !== o && this._lines.acceptVersionId(o),
            this.viewLayout.onHeightMaybeChanged(),
            !n &&
              i &&
              (t.emitViewEvent(new Bee()),
              t.emitViewEvent(new Aee(null)),
              this._cursor.onLineMappingChanged(t),
              this._decorations.onLineMappingChanged()));
        } finally {
          this._eventDispatcher.endEmitViewEvents();
        }
        const t = this._viewportStart.isValid;
        if (
          (this._viewportStart.invalidate(),
          this._configuration.setModelLineCount(this.model.getLineCount()),
          this._updateConfigurationViewLineCountNow(),
          !this._hasFocus && this.model.getAttachedEditorCount() >= 2 && t)
        ) {
          const e = this.model._getTrackedRange(this._viewportStart.modelTrackedRange);
          if (e) {
            const t = this.coordinatesConverter.convertModelPositionToViewPosition(
                e.getStartPosition(),
              ),
              n = this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);
            this.viewLayout.setScrollPosition(
              { scrollTop: n + this._viewportStart.startLineDelta },
              1,
            );
          }
        }
        try {
          const t = this._eventDispatcher.beginEmitViewEvents();
          (e instanceof H3 && t.emitOutgoingEvent(new lte(e.contentChangedEvent)),
            this._cursor.onModelContentChanged(t, e));
        } finally {
          this._eventDispatcher.endEmitViewEvents();
        }
        this._handleVisibleLinesChanged();
      }),
    );
    this._configuration.options.get(5) &&
      this._register(
        this.model.onDidChangeLineHeight((e) => {
          const t = e.changes.filter((e) => e.ownerId === this._editorId || 0 === e.ownerId);
          if (
            (this.viewLayout.changeSpecialLineHeights((e) => {
              for (const n of t) {
                const { decorationId: t, lineNumber: i, lineHeight: r } = n,
                  o = this.coordinatesConverter.convertModelRangeToViewRange(
                    new YH(i, 1, i, this.model.getLineMaxColumn(i)),
                  );
                null !== r
                  ? e.insertOrChangeCustomLineHeight(t, o.startLineNumber, o.endLineNumber, r)
                  : e.removeCustomLineHeight(t);
              }
            }),
            t.length > 0)
          ) {
            const e = new V3(t);
            this._eventDispatcher.emitOutgoingEvent(new ute(e));
          }
        }),
      );
    (this._configuration.options.get(172) &&
      this._register(
        this.model.onDidChangeFont((e) => {
          const t = e.changes.filter((e) => e.ownerId === this._editorId || 0 === e.ownerId);
          if (t.length > 0) {
            const e = new W3(t);
            this._eventDispatcher.emitOutgoingEvent(new hte(e));
          }
        }),
      ),
      this._register(
        this.model.onDidChangeTokens((e) => {
          const t = [];
          for (let n = 0, i = e.ranges.length; n < i; n++) {
            const i = e.ranges[n],
              r = this.coordinatesConverter.convertModelPositionToViewPosition(
                new xV(i.fromLineNumber, 1),
              ).lineNumber,
              o = this.coordinatesConverter.convertModelPositionToViewPosition(
                new xV(i.toLineNumber, this.model.getLineMaxColumn(i.toLineNumber)),
              ).lineNumber;
            t[n] = { fromLineNumber: r, toLineNumber: o };
          }
          (this._eventDispatcher.emitSingleViewEvent(new qee(t)),
            this._eventDispatcher.emitOutgoingEvent(new dte(e)));
        }),
      ),
      this._register(
        this.model.onDidChangeLanguageConfiguration((e) => {
          (this._eventDispatcher.emitSingleViewEvent(new Fee()),
            (this.cursorConfig = new az(
              this.model.getLanguageId(),
              this.model.getOptions(),
              this._configuration,
              this.languageConfigurationService,
            )),
            this._cursor.updateConfiguration(this.cursorConfig),
            this._eventDispatcher.emitOutgoingEvent(new ate(e)));
        }),
      ),
      this._register(
        this.model.onDidChangeLanguage((e) => {
          ((this.cursorConfig = new az(
            this.model.getLanguageId(),
            this.model.getOptions(),
            this._configuration,
            this.languageConfigurationService,
          )),
            this._cursor.updateConfiguration(this.cursorConfig),
            this._eventDispatcher.emitOutgoingEvent(new ste(e)));
        }),
      ),
      this._register(
        this.model.onDidChangeOptions((e) => {
          if (this._lines.setTabSize(this.model.getOptions().tabSize)) {
            try {
              const e = this._eventDispatcher.beginEmitViewEvents();
              (e.emitViewEvent(new Pee()),
                e.emitViewEvent(new Bee()),
                e.emitViewEvent(new Aee(null)),
                this._cursor.onLineMappingChanged(e),
                this._decorations.onLineMappingChanged(),
                this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()));
            } finally {
              this._eventDispatcher.endEmitViewEvents();
            }
            this._updateConfigurationViewLineCount.schedule();
          }
          ((this.cursorConfig = new az(
            this.model.getLanguageId(),
            this.model.getOptions(),
            this._configuration,
            this.languageConfigurationService,
          )),
            this._cursor.updateConfiguration(this.cursorConfig),
            this._eventDispatcher.emitOutgoingEvent(new cte(e)));
        }),
      ),
      this._register(
        this.model.onDidChangeDecorations((e) => {
          (this._decorations.onModelDecorationsChanged(),
            this._eventDispatcher.emitSingleViewEvent(new Aee(e)),
            this._eventDispatcher.emitOutgoingEvent(new ote(e)));
        }),
      ));
  }
  getFontSizeAtPosition(e) {
    if (!this._configuration.options.get(172)) return null;
    const t = this.model.getFontDecorationsInRange(YH.fromPositions(e), this._editorId);
    let n = this._configuration.options.get(59).fontSize + "px";
    for (const i of t)
      if (i.options.fontSize) {
        n = i.options.fontSize;
        break;
      }
    return n;
  }
  setHiddenAreas(e, t, n) {
    this.hiddenAreasModel.setHiddenAreas(t, e);
    const i = this.hiddenAreasModel.getMergedRanges();
    if (i === this.previousHiddenAreas && !n) return;
    this.previousHiddenAreas = i;
    const r = this._captureStableViewport();
    let o = !1;
    try {
      const e = this._eventDispatcher.beginEmitViewEvents();
      ((o = this._lines.setHiddenAreas(i)),
        o &&
          (e.emitViewEvent(new Pee()),
          e.emitViewEvent(new Bee()),
          e.emitViewEvent(new Aee(null)),
          this._cursor.onLineMappingChanged(e),
          this._decorations.onLineMappingChanged(),
          this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()),
          this.viewLayout.onHeightMaybeChanged()));
      const t = r.viewportStartModelPosition?.lineNumber,
        n = t && i.some((e) => e.startLineNumber <= t && t <= e.endLineNumber);
      n || r.recoverViewportStart(this.coordinatesConverter, this.viewLayout);
    } finally {
      this._eventDispatcher.endEmitViewEvents();
    }
    (this._updateConfigurationViewLineCount.schedule(),
      o && this._eventDispatcher.emitOutgoingEvent(new nte()));
  }
  getVisibleRangesPlusViewportAboveBelow() {
    const e = this._configuration.options.get(165),
      t = this._configuration.options.get(75),
      n = Math.max(20, Math.round(e.height / t)),
      i = this.viewLayout.getLinesViewportData(),
      r = Math.max(1, i.completelyVisibleStartLineNumber - n),
      o = Math.min(this.getLineCount(), i.completelyVisibleEndLineNumber + n);
    return this._toModelVisibleRanges(
      new YH(r, this.getLineMinColumn(r), o, this.getLineMaxColumn(o)),
    );
  }
  getVisibleRanges() {
    const e = this.getCompletelyVisibleViewRange();
    return this._toModelVisibleRanges(e);
  }
  getHiddenAreas() {
    return this._lines.getHiddenAreas();
  }
  _toModelVisibleRanges(e) {
    const t = this.coordinatesConverter.convertViewRangeToModelRange(e),
      n = this._lines.getHiddenAreas();
    if (0 === n.length) return [t];
    const i = [];
    let r = 0,
      o = t.startLineNumber,
      s = t.startColumn;
    const a = t.endLineNumber,
      l = t.endColumn;
    for (let c = 0, d = n.length; c < d; c++) {
      const e = n[c].startLineNumber,
        t = n[c].endLineNumber;
      t < o ||
        e > a ||
        (o < e && (i[r++] = new YH(o, s, e - 1, this.model.getLineMaxColumn(e - 1))),
        (o = t + 1),
        (s = 1));
    }
    return ((o < a || (o === a && s < l)) && (i[r++] = new YH(o, s, a, l)), i);
  }
  getCompletelyVisibleViewRange() {
    const e = this.viewLayout.getLinesViewportData(),
      t = e.completelyVisibleStartLineNumber,
      n = e.completelyVisibleEndLineNumber;
    return new YH(t, this.getLineMinColumn(t), n, this.getLineMaxColumn(n));
  }
  getCompletelyVisibleViewRangeAtScrollTop(e) {
    const t = this.viewLayout.getLinesViewportDataAtScrollTop(e),
      n = t.completelyVisibleStartLineNumber,
      i = t.completelyVisibleEndLineNumber;
    return new YH(n, this.getLineMinColumn(n), i, this.getLineMaxColumn(i));
  }
  saveState() {
    const e = this.viewLayout.saveState(),
      t = e.scrollTop,
      n = this.viewLayout.getLineNumberAtVerticalOffset(t),
      i = this.coordinatesConverter.convertViewPositionToModelPosition(
        new xV(n, this.getLineMinColumn(n)),
      ),
      r = this.viewLayout.getVerticalOffsetForLineNumber(n) - t;
    return { scrollLeft: e.scrollLeft, firstPosition: i, firstPositionDeltaTop: r };
  }
  reduceRestoreState(e) {
    if (void 0 === e.firstPosition) return this._reduceRestoreStateCompatibility(e);
    const t = this.model.validatePosition(e.firstPosition),
      n = this.coordinatesConverter.convertModelPositionToViewPosition(t),
      i = this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber) - e.firstPositionDeltaTop;
    return { scrollLeft: e.scrollLeft, scrollTop: i };
  }
  _reduceRestoreStateCompatibility(e) {
    return { scrollLeft: e.scrollLeft, scrollTop: e.scrollTopWithoutViewZones };
  }
  getTabSize() {
    return this.model.getOptions().tabSize;
  }
  getLineCount() {
    return this._lines.getViewLineCount();
  }
  setViewport(e, t, n) {
    this._viewportStart.update(this, e);
  }
  getActiveIndentGuide(e, t, n) {
    return this._lines.getActiveIndentGuide(e, t, n);
  }
  getLinesIndentGuides(e, t) {
    return this._lines.getViewLinesIndentGuides(e, t);
  }
  getBracketGuidesInRangeByLine(e, t, n, i) {
    return this._lines.getViewLinesBracketGuides(e, t, n, i);
  }
  getLineContent(e) {
    return this._lines.getViewLineContent(e);
  }
  getLineLength(e) {
    return this._lines.getViewLineLength(e);
  }
  getLineMinColumn(e) {
    return this._lines.getViewLineMinColumn(e);
  }
  getLineMaxColumn(e) {
    return this._lines.getViewLineMaxColumn(e);
  }
  getLineFirstNonWhitespaceColumn(e) {
    const t = YM(this.getLineContent(e));
    return -1 === t ? 0 : t + 1;
  }
  getLineLastNonWhitespaceColumn(e) {
    const t = QM(this.getLineContent(e));
    return -1 === t ? 0 : t + 2;
  }
  getMinimapDecorationsInRange(e) {
    return this._decorations.getMinimapDecorationsInRange(e);
  }
  getDecorationsInViewport(e) {
    return this._decorations.getDecorationsViewportData(e).decorations;
  }
  getInjectedTextAt(e) {
    return this._lines.getInjectedTextAt(e);
  }
  _getTextDirection(e, t) {
    let n = 0;
    for (const i of t) {
      const t = i.range;
      if (t.startLineNumber > e || t.endLineNumber < e) continue;
      const r = i.options.textDirection;
      r === qz.RTL ? n++ : r === qz.LTR && n--;
    }
    return n > 0 ? qz.RTL : qz.LTR;
  }
  getTextDirection(e) {
    const t = this._decorations.getDecorationsOnLine(e);
    return this._getTextDirection(e, t.decorations);
  }
  getViewportViewLineRenderingData(e, t) {
    const n = this._decorations.getDecorationsViewportData(e),
      i = n.inlineDecorations[t - e.startLineNumber];
    return this._getViewLineRenderingData(t, i, n.hasVariableFonts, n.decorations);
  }
  getViewLineRenderingData(e) {
    const t = this._decorations.getDecorationsOnLine(e);
    return this._getViewLineRenderingData(
      e,
      t.inlineDecorations[0],
      t.hasVariableFonts,
      t.decorations,
    );
  }
  _getViewLineRenderingData(e, t, n, i) {
    const r = this.model.mightContainRTL(),
      o = this.model.mightContainNonBasicASCII(),
      s = this.getTabSize(),
      a = this._lines.getViewLineData(e);
    return (
      a.inlineDecorations &&
        (t = [...t, ...a.inlineDecorations.map((t) => t.toInlineDecoration(e))]),
      new r4(
        a.minColumn,
        a.maxColumn,
        a.content,
        a.continuesWithWrappedLine,
        r,
        o,
        a.tokens,
        t,
        s,
        a.startVisibleColumn,
        this._getTextDirection(e, i),
        n,
      )
    );
  }
  getViewLineData(e) {
    return this._lines.getViewLineData(e);
  }
  getMinimapLinesRenderingData(e, t, n) {
    const i = this._lines.getViewLinesData(e, t, n);
    return new n4(this.getTabSize(), i);
  }
  getAllOverviewRulerDecorations(e) {
    const t = this.model.getOverviewRulerDecorations(
        this._editorId,
        kK(this._configuration.options),
        EK(this._configuration.options),
      ),
      n = new ene();
    for (const i of t) {
      const t = i.options,
        r = t.overviewRuler;
      if (!r) continue;
      const o = r.position;
      if (0 === o) continue;
      const s = r.getColor(e.value),
        a = this.coordinatesConverter.getViewLineNumberOfModelPosition(
          i.range.startLineNumber,
          i.range.startColumn,
        ),
        l = this.coordinatesConverter.getViewLineNumberOfModelPosition(
          i.range.endLineNumber,
          i.range.endColumn,
        );
      n.accept(s, t.zIndex, a, l, o);
    }
    return n.asArray;
  }
  _invalidateDecorationsColorCache() {
    const e = this.model.getOverviewRulerDecorations();
    for (const t of e) {
      const e = t.options.overviewRuler;
      e?.invalidateCachedColor();
      const n = t.options.minimap;
      n?.invalidateCachedColor();
    }
  }
  getValueInRange(e, t) {
    const n = this.coordinatesConverter.convertViewRangeToModelRange(e);
    return this.model.getValueInRange(n, t);
  }
  getValueLengthInRange(e, t) {
    const n = this.coordinatesConverter.convertViewRangeToModelRange(e);
    return this.model.getValueLengthInRange(n, t);
  }
  modifyPosition(e, t) {
    const n = this.coordinatesConverter.convertViewPositionToModelPosition(e),
      i = this.model.modifyPosition(n, t);
    return this.coordinatesConverter.convertModelPositionToViewPosition(i);
  }
  deduceModelPositionRelativeToViewPosition(e, t, n) {
    const i = this.coordinatesConverter.convertViewPositionToModelPosition(e);
    2 === this.model.getEOL().length && (t < 0 ? (t -= n) : (t += n));
    const r = this.model.getOffsetAt(i) + t;
    return this.model.getPositionAt(r);
  }
  getPlainTextToCopy(e, t, n) {
    const i = n ? "\r\n" : this.model.getEOL();
    (e = e.slice(0)).sort(YH.compareRangesUsingStarts);
    let r = !1,
      o = !1;
    for (const a of e) a.isEmpty() ? (r = !0) : (o = !0);
    if (!o) {
      if (!t) return "";
      const n = e.map((e) => e.startLineNumber);
      let r = "";
      for (let e = 0; e < n.length; e++)
        (e > 0 && n[e - 1] === n[e]) || (r += this.model.getLineContent(n[e]) + i);
      return r;
    }
    if (r && t) {
      const t = [];
      let i = 0;
      for (const r of e) {
        const e = r.startLineNumber;
        (r.isEmpty()
          ? e !== i && t.push(this.model.getLineContent(e))
          : t.push(this.model.getValueInRange(r, n ? 2 : 0)),
          (i = e));
      }
      return 1 === t.length ? t[0] : t;
    }
    const s = [];
    for (const a of e) a.isEmpty() || s.push(this.model.getValueInRange(a, n ? 2 : 0));
    return 1 === s.length ? s[0] : s;
  }
  getRichTextToCopy(e, t) {
    const n = this.model.getLanguageId();
    if (n === a$) return null;
    if (1 !== e.length) return null;
    let i = e[0];
    if (i.isEmpty()) {
      if (!t) return null;
      const e = i.startLineNumber;
      i = new YH(e, this.model.getLineMinColumn(e), e, this.model.getLineMaxColumn(e));
    }
    const r = this._configuration.options.get(59),
      o = this._getColorMap();
    let s;
    if (/[:;\\\/<>]/.test(r.fontFamily) || r.fontFamily === Jq.fontFamily) s = Jq.fontFamily;
    else {
      ((s = r.fontFamily), (s = s.replace(/"/g, "'")));
      if (!/[,']/.test(s)) {
        /[+ ]/.test(s) && (s = `'${s}'`);
      }
      s = `${s}, ${Jq.fontFamily}`;
    }
    return {
      mode: n,
      html:
        `<div style="color: ${o[1]};background-color: ${o[2]};font-family: ${s};font-weight: ${r.fontWeight};font-size: ${r.fontSize}px;line-height: ${r.lineHeight}px;white-space: pre;">` +
        this._getHTMLToCopy(i, o) +
        "</div>",
    };
  }
  _getHTMLToCopy(e, t) {
    const n = e.startLineNumber,
      i = e.startColumn,
      r = e.endLineNumber,
      o = e.endColumn,
      s = this.getTabSize();
    let a = "";
    for (let l = n; l <= r; l++) {
      const e = this.model.tokenization.getLineTokens(l),
        c = e.getLineContent(),
        d = l === n ? i - 1 : 0,
        u = l === r ? o - 1 : c.length;
      a += "" === c ? "<br>" : yte(c, e.inflate(), t, d, u, s, AR);
    }
    return a;
  }
  _getColorMap() {
    const e = I2.getColorMap(),
      t = ["#000000"];
    if (e) for (let n = 1, i = e.length; n < i; n++) t[n] = vG.Format.CSS.formatHex(e[n]);
    return t;
  }
  getPrimaryCursorState() {
    return this._cursor.getPrimaryCursorState();
  }
  getLastAddedCursorIndex() {
    return this._cursor.getLastAddedCursorIndex();
  }
  getCursorStates() {
    return this._cursor.getCursorStates();
  }
  setCursorStates(e, t, n) {
    return this._withViewEventsCollector((i) => this._cursor.setStates(i, e, t, n));
  }
  getCursorColumnSelectData() {
    return this._cursor.getCursorColumnSelectData();
  }
  getCursorAutoClosedCharacters() {
    return this._cursor.getAutoClosedCharacters();
  }
  setCursorColumnSelectData(e) {
    this._cursor.setCursorColumnSelectData(e);
  }
  getPrevEditOperationType() {
    return this._cursor.getPrevEditOperationType();
  }
  setPrevEditOperationType(e) {
    this._cursor.setPrevEditOperationType(e);
  }
  getSelection() {
    return this._cursor.getSelection();
  }
  getSelections() {
    return this._cursor.getSelections();
  }
  getPosition() {
    return this._cursor.getPrimaryCursorState().modelState.position;
  }
  setSelections(e, t, n = 0) {
    this._withViewEventsCollector((i) => this._cursor.setSelections(i, e, t, n));
  }
  saveCursorState() {
    return this._cursor.saveState();
  }
  restoreCursorState(e) {
    this._withViewEventsCollector((t) => this._cursor.restoreState(t, e));
  }
  _executeCursorEdit(e) {
    this._cursor.context.cursorConfig.readOnly
      ? this._eventDispatcher.emitOutgoingEvent(new rte())
      : this._withViewEventsCollector(e);
  }
  executeEdits(e, t, n, i) {
    this._executeCursorEdit((r) => this._cursor.executeEdits(r, e, t, n, i));
  }
  startComposition() {
    this._executeCursorEdit((e) => this._cursor.startComposition(e));
  }
  endComposition(e) {
    this._executeCursorEdit((t) => this._cursor.endComposition(t, e));
  }
  type(e, t) {
    this._executeCursorEdit((n) => this._cursor.type(n, e, t));
  }
  compositionType(e, t, n, i, r) {
    this._executeCursorEdit((o) => this._cursor.compositionType(o, e, t, n, i, r));
  }
  paste(e, t, n, i) {
    this._executeCursorEdit((r) => this._cursor.paste(r, e, t, n, i));
  }
  cut(e) {
    this._executeCursorEdit((t) => this._cursor.cut(t, e));
  }
  executeCommand(e, t) {
    this._executeCursorEdit((n) => this._cursor.executeCommand(n, e, t));
  }
  executeCommands(e, t) {
    this._executeCursorEdit((n) => this._cursor.executeCommands(n, e, t));
  }
  revealAllCursors(e, t, n = !1) {
    this._withViewEventsCollector((i) => this._cursor.revealAll(i, e, n, 0, t, 0));
  }
  revealPrimaryCursor(e, t, n = !1) {
    this._withViewEventsCollector((i) => this._cursor.revealPrimary(i, e, n, 0, t, 0));
  }
  revealTopMostCursor(e) {
    const t = this._cursor.getTopMostViewPosition(),
      n = new YH(t.lineNumber, t.column, t.lineNumber, t.column);
    this._withViewEventsCollector((t) => t.emitViewEvent(new zee(e, !1, n, null, 0, !0, 0)));
  }
  revealBottomMostCursor(e) {
    const t = this._cursor.getBottomMostViewPosition(),
      n = new YH(t.lineNumber, t.column, t.lineNumber, t.column);
    this._withViewEventsCollector((t) => t.emitViewEvent(new zee(e, !1, n, null, 0, !0, 0)));
  }
  revealRange(e, t, n, i, r) {
    this._withViewEventsCollector((o) => o.emitViewEvent(new zee(e, !1, n, null, i, t, r)));
  }
  changeWhitespace(e) {
    this.viewLayout.changeWhitespace(e) &&
      (this._eventDispatcher.emitSingleViewEvent(new Gee()),
      this._eventDispatcher.emitOutgoingEvent(new tte()));
  }
  _withViewEventsCollector(e) {
    return this._transactionalTarget.batchChanges(() => {
      try {
        const t = this._eventDispatcher.beginEmitViewEvents();
        return e(t);
      } finally {
        this._eventDispatcher.endEmitViewEvents();
      }
    });
  }
  batchEvents(e) {
    this._withViewEventsCollector(() => {
      e();
    });
  }
  normalizePosition(e, t) {
    return this._lines.normalizePosition(e, t);
  }
  getLineIndentColumn(e) {
    return this._lines.getLineIndentColumn(e);
  }
};
class Jte {
  static create(e) {
    const t = e._setTrackedRange(null, new YH(1, 1, 1, 1), 1);
    return new Jte(e, 1, !1, t, 0);
  }
  get viewLineNumber() {
    return this._viewLineNumber;
  }
  get isValid() {
    return this._isValid;
  }
  get modelTrackedRange() {
    return this._modelTrackedRange;
  }
  get startLineDelta() {
    return this._startLineDelta;
  }
  constructor(e, t, n, i, r) {
    ((this._model = e),
      (this._viewLineNumber = t),
      (this._isValid = n),
      (this._modelTrackedRange = i),
      (this._startLineDelta = r));
  }
  dispose() {
    this._model._setTrackedRange(this._modelTrackedRange, null, 1);
  }
  update(e, t) {
    const n = e.coordinatesConverter.convertViewPositionToModelPosition(
        new xV(t, e.getLineMinColumn(t)),
      ),
      i = e.model._setTrackedRange(
        this._modelTrackedRange,
        new YH(n.lineNumber, n.column, n.lineNumber, n.column),
        1,
      ),
      r = e.viewLayout.getVerticalOffsetForLineNumber(t),
      o = e.viewLayout.getCurrentScrollTop();
    ((this._viewLineNumber = t),
      (this._isValid = !0),
      (this._modelTrackedRange = i),
      (this._startLineDelta = o - r));
  }
  invalidate() {
    this._isValid = !1;
  }
}
class ene {
  constructor() {
    ((this._asMap = Object.create(null)), (this.asArray = []));
  }
  accept(e, t, n, i, r) {
    const o = this._asMap[e];
    if (o) {
      const e = o.data,
        t = e[e.length - 3],
        s = e[e.length - 1];
      if (t === r && s + 1 >= n) return void (i > s && (e[e.length - 1] = i));
      e.push(r, n, i);
    } else {
      const o = new o4(e, t, [r, n, i]);
      ((this._asMap[e] = o), this.asArray.push(o));
    }
  }
}
class tne {
  constructor() {
    ((this.hiddenAreas = new Map()), (this.shouldRecompute = !1), (this.ranges = []));
  }
  setHiddenAreas(e, t) {
    const n = this.hiddenAreas.get(e);
    (n && nne(n, t)) || (this.hiddenAreas.set(e, t), (this.shouldRecompute = !0));
  }
  getMergedRanges() {
    if (!this.shouldRecompute) return this.ranges;
    this.shouldRecompute = !1;
    const e = Array.from(this.hiddenAreas.values()).reduce(
      (e, t) =>
        (function (e, t) {
          const n = [];
          let i = 0,
            r = 0;
          for (; i < e.length && r < t.length; ) {
            const o = e[i],
              s = t[r];
            if (o.endLineNumber < s.startLineNumber - 1) n.push(e[i++]);
            else if (s.endLineNumber < o.startLineNumber - 1) n.push(t[r++]);
            else {
              const e = Math.min(o.startLineNumber, s.startLineNumber),
                t = Math.max(o.endLineNumber, s.endLineNumber);
              (n.push(new YH(e, 1, t, 1)), i++, r++);
            }
          }
          for (; i < e.length; ) n.push(e[i++]);
          for (; r < t.length; ) n.push(t[r++]);
          return n;
        })(e, t),
      [],
    );
    return (nne(this.ranges, e) || (this.ranges = e), this.ranges);
  }
}
function nne(e, t) {
  if (e.length !== t.length) return !1;
  for (let n = 0; n < e.length; n++) if (!e[n].equalsRange(t[n])) return !1;
  return !0;
}
class ine {
  constructor(e, t) {
    ((this.viewportStartModelPosition = e), (this.startLineDelta = t));
  }
  recoverViewportStart(e, t) {
    if (!this.viewportStartModelPosition) return;
    const n = e.convertModelPositionToViewPosition(this.viewportStartModelPosition),
      i = t.getVerticalOffsetForLineNumber(n.lineNumber);
    t.setScrollPosition({ scrollTop: i + this.startLineDelta }, 1);
  }
}
class rne {
  constructor(...e) {
    this._entries = new Map();
    for (const [t, n] of e) this.set(t, n);
  }
  set(e, t) {
    const n = this._entries.get(e);
    return (this._entries.set(e, t), n);
  }
  get(e) {
    return this._entries.get(e);
  }
}
var one,
  sne = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let ane = class extends PO {
  static {
    one = this;
  }
  static {
    this.dropIntoEditorDecorationOptions = cee.register({
      description: "workbench-dnd-target",
      className: "dnd-target",
    });
  }
  get isSimpleWidget() {
    return this._configuration.isSimpleWidget;
  }
  get contextMenuId() {
    return this._configuration.contextMenuId;
  }
  get contextKeyService() {
    return this._contextKeyService;
  }
  constructor(e, t, n, i, r, o, s, a, l, c, d, u) {
    (super(),
      (this.languageConfigurationService = d),
      (this._deliveryQueue = new JO()),
      (this._contributions = this._register(new Z3())),
      (this._onDidDispose = this._register(new QO())),
      (this.onDidDispose = this._onDidDispose.event),
      (this._onDidChangeModelContent = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeModelContent = this._onDidChangeModelContent.event),
      (this._onDidChangeModelLanguage = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeModelLanguage = this._onDidChangeModelLanguage.event),
      (this._onDidChangeModelLanguageConfiguration = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeModelLanguageConfiguration =
        this._onDidChangeModelLanguageConfiguration.event),
      (this._onDidChangeModelOptions = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeModelOptions = this._onDidChangeModelOptions.event),
      (this._onDidChangeModelDecorations = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeModelDecorations = this._onDidChangeModelDecorations.event),
      (this._onDidChangeLineHeight = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeLineHeight = this._onDidChangeLineHeight.event),
      (this._onDidChangeFont = this._register(new QO({ deliveryQueue: this._deliveryQueue }))),
      (this.onDidChangeFont = this._onDidChangeFont.event),
      (this._onDidChangeModelTokens = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeModelTokens = this._onDidChangeModelTokens.event),
      (this._onDidChangeConfiguration = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeConfiguration = this._onDidChangeConfiguration.event),
      (this._onWillChangeModel = this._register(new QO({ deliveryQueue: this._deliveryQueue }))),
      (this.onWillChangeModel = this._onWillChangeModel.event),
      (this._onDidChangeModel = this._register(new QO({ deliveryQueue: this._deliveryQueue }))),
      (this.onDidChangeModel = this._onDidChangeModel.event),
      (this._onDidChangeCursorPosition = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeCursorPosition = this._onDidChangeCursorPosition.event),
      (this._onDidChangeCursorSelection = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeCursorSelection = this._onDidChangeCursorSelection.event),
      (this._onDidAttemptReadOnlyEdit = this._register(
        new une(this._contributions, this._deliveryQueue),
      )),
      (this.onDidAttemptReadOnlyEdit = this._onDidAttemptReadOnlyEdit.event),
      (this._onDidLayoutChange = this._register(new QO({ deliveryQueue: this._deliveryQueue }))),
      (this.onDidLayoutChange = this._onDidLayoutChange.event),
      (this._editorTextFocus = this._register(new dne({ deliveryQueue: this._deliveryQueue }))),
      (this.onDidFocusEditorText = this._editorTextFocus.onDidChangeToTrue),
      (this.onDidBlurEditorText = this._editorTextFocus.onDidChangeToFalse),
      (this._editorWidgetFocus = this._register(new dne({ deliveryQueue: this._deliveryQueue }))),
      (this.onDidFocusEditorWidget = this._editorWidgetFocus.onDidChangeToTrue),
      (this.onDidBlurEditorWidget = this._editorWidgetFocus.onDidChangeToFalse),
      (this._onWillType = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onWillType = this._onWillType.event),
      (this._onDidType = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onDidType = this._onDidType.event),
      (this._onDidCompositionStart = this._register(
        new une(this._contributions, this._deliveryQueue),
      )),
      (this.onDidCompositionStart = this._onDidCompositionStart.event),
      (this._onDidCompositionEnd = this._register(
        new une(this._contributions, this._deliveryQueue),
      )),
      (this.onDidCompositionEnd = this._onDidCompositionEnd.event),
      (this._onDidPaste = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onDidPaste = this._onDidPaste.event),
      (this._onMouseUp = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onMouseUp = this._onMouseUp.event),
      (this._onMouseDown = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onMouseDown = this._onMouseDown.event),
      (this._onMouseDrag = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onMouseDrag = this._onMouseDrag.event),
      (this._onMouseDrop = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onMouseDrop = this._onMouseDrop.event),
      (this._onMouseDropCanceled = this._register(
        new une(this._contributions, this._deliveryQueue),
      )),
      (this.onMouseDropCanceled = this._onMouseDropCanceled.event),
      (this._onDropIntoEditor = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onDropIntoEditor = this._onDropIntoEditor.event),
      (this._onContextMenu = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onContextMenu = this._onContextMenu.event),
      (this._onMouseMove = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onMouseMove = this._onMouseMove.event),
      (this._onMouseLeave = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onMouseLeave = this._onMouseLeave.event),
      (this._onMouseWheel = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onMouseWheel = this._onMouseWheel.event),
      (this._onKeyUp = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onKeyUp = this._onKeyUp.event),
      (this._onKeyDown = this._register(new une(this._contributions, this._deliveryQueue))),
      (this.onKeyDown = this._onKeyDown.event),
      (this._onDidContentSizeChange = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidContentSizeChange = this._onDidContentSizeChange.event),
      (this._onDidScrollChange = this._register(new QO({ deliveryQueue: this._deliveryQueue }))),
      (this.onDidScrollChange = this._onDidScrollChange.event),
      (this._onDidChangeViewZones = this._register(new QO({ deliveryQueue: this._deliveryQueue }))),
      (this.onDidChangeViewZones = this._onDidChangeViewZones.event),
      (this._onDidChangeHiddenAreas = this._register(
        new QO({ deliveryQueue: this._deliveryQueue }),
      )),
      (this.onDidChangeHiddenAreas = this._onDidChangeHiddenAreas.event),
      (this._updateCounter = 0),
      (this._onWillTriggerEditorOperationEvent = this._register(new QO())),
      (this._onBeginUpdate = this._register(new QO())),
      (this.onBeginUpdate = this._onBeginUpdate.event),
      (this._onEndUpdate = this._register(new QO())),
      (this.onEndUpdate = this._onEndUpdate.event),
      (this._onBeforeExecuteEdit = this._register(new QO())),
      (this.onBeforeExecuteEdit = this._onBeforeExecuteEdit.event),
      (this._actions = new Map()),
      (this._bannerDomNode = null),
      (this._dropIntoEditorDecorations = this.createDecorationsCollection()),
      (this.inComposition = !1),
      r.willCreateCodeEditor());
    const h = { ...t };
    if (
      ((this._domElement = e),
      (this._overflowWidgetsDomNode = h.overflowWidgetsDomNode),
      delete h.overflowWidgetsDomNode,
      (this._id = ++lne),
      (this._decorationTypeKeysToIds = {}),
      (this._decorationTypeSubtypes = {}),
      (this._telemetryData = n.telemetryData),
      (this._configuration = this._register(
        this._createConfiguration(
          n.isSimpleWidget || !1,
          n.contextMenuId ?? (n.isSimpleWidget ? MW.SimpleEditorContext : MW.EditorContext),
          h,
          c,
        ),
      )),
      this._register(
        this._configuration.onDidChange((e) => {
          this._onDidChangeConfiguration.fire(e);
          const t = this._configuration.options;
          if (e.hasChanged(165)) {
            const e = t.get(165);
            this._onDidLayoutChange.fire(e);
          }
        }),
      ),
      (this._contextKeyService = this._register(s.createScoped(this._domElement))),
      n.contextKeyValues)
    )
      for (const [f, m] of Object.entries(n.contextKeyValues))
        this._contextKeyService.createKey(f, m);
    let g;
    ((this._notificationService = l),
      (this._codeEditorService = r),
      (this._commandService = o),
      (this._themeService = a),
      this._register(new hne(this, this._contextKeyService)),
      this._register(new gne(this, this._contextKeyService, u)),
      (this._instantiationService = this._register(
        i.createChild(new rne([xW, this._contextKeyService])),
      )),
      (this._modelData = null),
      (this._contentWidgets = {}),
      (this._overlayWidgets = {}),
      (this._glyphMarginWidgets = {}),
      (g = Array.isArray(n.contributions) ? n.contributions : UH.getEditorContributions()),
      this._contributions.initialize(this, g, this._instantiationService));
    for (const f of UH.getEditorActions()) {
      if (this._actions.has(f.id)) {
        HI(new Error(`Cannot have two actions with the same id ${f.id}`));
        continue;
      }
      const e = new Y3(
        f.id,
        f.label,
        f.alias,
        f.metadata,
        f.precondition ?? void 0,
        (e) =>
          this._instantiationService.invokeFunction((t) =>
            Promise.resolve(f.runEditorCommand(t, this, e)),
          ),
        this._contextKeyService,
      );
      this._actions.set(e.id, e);
    }
    const p = () =>
      !this._configuration.options.get(104) && this._configuration.options.get(43).enabled;
    (this._register(
      new qB(this._domElement, {
        onDragOver: (e) => {
          if (!p()) return;
          const t = this.getTargetAtClientPoint(e.clientX, e.clientY);
          t?.position && this.showDropIndicatorAt(t.position);
        },
        onDrop: async (e) => {
          if (!p()) return;
          if ((this.removeDropIndicator(), !e.dataTransfer)) return;
          const t = this.getTargetAtClientPoint(e.clientX, e.clientY);
          t?.position && this._onDropIntoEditor.fire({ position: t.position, event: e });
        },
        onDragLeave: () => {
          this.removeDropIndicator();
        },
        onDragEnd: () => {
          this.removeDropIndicator();
        },
      }),
    ),
      this._codeEditorService.addCodeEditor(this));
  }
  writeScreenReaderContent(e) {
    this._modelData?.view.writeScreenReaderContent(e);
  }
  _createConfiguration(e, t, n, i) {
    return new ZK(e, t, n, this._domElement, i);
  }
  getId() {
    return this.getEditorType() + ":" + this._id;
  }
  getEditorType() {
    return X3.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(e) {
    return this._instantiationService.invokeFunction(e);
  }
  updateOptions(e) {
    this._configuration.updateOptions(e || {});
  }
  getOptions() {
    return this._configuration.options;
  }
  getOption(e) {
    return this._configuration.options.get(e);
  }
  getRawOptions() {
    return this._configuration.getRawOptions();
  }
  getOverflowWidgetsDomNode() {
    return this._overflowWidgetsDomNode;
  }
  getConfiguredWordAtPosition(e) {
    return this._modelData
      ? Az.getWordAtPosition(
          this._modelData.model,
          this._configuration.options.get(148),
          this._configuration.options.get(147),
          e,
        )
      : null;
  }
  getValue(e = null) {
    if (!this._modelData) return "";
    const t = !(!e || !e.preserveBOM);
    let n = 0;
    return (
      e && e.lineEnding && "\n" === e.lineEnding
        ? (n = 1)
        : e && e.lineEnding && "\r\n" === e.lineEnding && (n = 2),
      this._modelData.model.getValue(n, t)
    );
  }
  setValue(e) {
    try {
      if ((this._beginUpdate(), !this._modelData)) return;
      this._modelData.model.setValue(e);
    } finally {
      this._endUpdate();
    }
  }
  getModel() {
    return this._modelData ? this._modelData.model : null;
  }
  setModel(e = null) {
    try {
      this._beginUpdate();
      const t = e;
      if (null === this._modelData && null === t) return;
      if (this._modelData && this._modelData.model === t) return;
      const n = { oldModelUrl: this._modelData?.model.uri || null, newModelUrl: t?.uri || null };
      this._onWillChangeModel.fire(n);
      const i = this.hasTextFocus(),
        r = this._detachModel();
      (this._attachModel(t),
        this.hasModel()
          ? i && this.focus()
          : (this._editorTextFocus.setValue(!1), this._editorWidgetFocus.setValue(!1)),
        this._removeDecorationTypes(),
        this._onDidChangeModel.fire(n),
        this._postDetachModelCleanup(r),
        (this._contributionsDisposable = this._contributions.onAfterModelAttached()));
    } finally {
      this._endUpdate();
    }
  }
  _removeDecorationTypes() {
    if (((this._decorationTypeKeysToIds = {}), this._decorationTypeSubtypes)) {
      for (const e in this._decorationTypeSubtypes) {
        const t = this._decorationTypeSubtypes[e];
        for (const n in t) this._removeDecorationType(e + "-" + n);
      }
      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(e, t, n, i) {
    const r = e.model.validatePosition({ lineNumber: t, column: n }),
      o = e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);
    return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber, i);
  }
  getTopForLineNumber(e, t = !1) {
    return this._modelData ? one._getVerticalOffsetForPosition(this._modelData, e, 1, t) : -1;
  }
  getTopForPosition(e, t) {
    return this._modelData ? one._getVerticalOffsetForPosition(this._modelData, e, t, !1) : -1;
  }
  static _getVerticalOffsetForPosition(e, t, n, i = !1) {
    const r = e.model.validatePosition({ lineNumber: t, column: n }),
      o = e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);
    return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber, i);
  }
  getBottomForLineNumber(e, t = !1) {
    if (!this._modelData) return -1;
    const n = this._modelData.model.getLineMaxColumn(e);
    return one._getVerticalOffsetAfterPosition(this._modelData, e, n, t);
  }
  getLineHeightForPosition(e) {
    if (!this._modelData) return -1;
    const t = this._modelData.viewModel,
      n = t.coordinatesConverter,
      i = xV.lift(e);
    if (n.modelPositionIsVisible(i)) {
      const e = n.convertModelPositionToViewPosition(i);
      return t.viewLayout.getLineHeightForLineNumber(e.lineNumber);
    }
    return 0;
  }
  setHiddenAreas(e, t, n) {
    this._modelData?.viewModel.setHiddenAreas(
      e.map((e) => YH.lift(e)),
      t,
      n,
    );
  }
  getVisibleColumnFromPosition(e) {
    if (!this._modelData) return e.column;
    const t = this._modelData.model.validatePosition(e),
      n = this._modelData.model.getOptions().tabSize;
    return (
      tz.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber), t.column, n) +
      1
    );
  }
  getPosition() {
    return this._modelData ? this._modelData.viewModel.getPosition() : null;
  }
  setPosition(e, t = "api") {
    if (this._modelData) {
      if (!xV.isIPosition(e)) throw new Error("Invalid arguments");
      this._modelData.viewModel.setSelections(t, [
        {
          selectionStartLineNumber: e.lineNumber,
          selectionStartColumn: e.column,
          positionLineNumber: e.lineNumber,
          positionColumn: e.column,
        },
      ]);
    }
  }
  _sendRevealRange(e, t, n, i) {
    if (!this._modelData) return;
    if (!YH.isIRange(e)) throw new Error("Invalid arguments");
    const r = this._modelData.model.validateRange(e),
      o = this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(r);
    this._modelData.viewModel.revealRange("api", n, o, t, i);
  }
  revealLine(e, t = 0) {
    this._revealLine(e, 0, t);
  }
  revealLineInCenter(e, t = 0) {
    this._revealLine(e, 1, t);
  }
  revealLineInCenterIfOutsideViewport(e, t = 0) {
    this._revealLine(e, 2, t);
  }
  revealLineNearTop(e, t = 0) {
    this._revealLine(e, 5, t);
  }
  _revealLine(e, t, n) {
    if ("number" != typeof e) throw new Error("Invalid arguments");
    this._sendRevealRange(new YH(e, 1, e, 1), t, !1, n);
  }
  revealPosition(e, t = 0) {
    this._revealPosition(e, 0, !0, t);
  }
  revealPositionInCenter(e, t = 0) {
    this._revealPosition(e, 1, !0, t);
  }
  revealPositionInCenterIfOutsideViewport(e, t = 0) {
    this._revealPosition(e, 2, !0, t);
  }
  revealPositionNearTop(e, t = 0) {
    this._revealPosition(e, 5, !0, t);
  }
  _revealPosition(e, t, n, i) {
    if (!xV.isIPosition(e)) throw new Error("Invalid arguments");
    this._sendRevealRange(new YH(e.lineNumber, e.column, e.lineNumber, e.column), t, n, i);
  }
  getSelection() {
    return this._modelData ? this._modelData.viewModel.getSelection() : null;
  }
  getSelections() {
    return this._modelData ? this._modelData.viewModel.getSelections() : null;
  }
  setSelection(e, t = "api") {
    const n = XH.isISelection(e),
      i = YH.isIRange(e);
    if (!n && !i) throw new Error("Invalid arguments");
    if (n) this._setSelectionImpl(e, t);
    else if (i) {
      const n = {
        selectionStartLineNumber: e.startLineNumber,
        selectionStartColumn: e.startColumn,
        positionLineNumber: e.endLineNumber,
        positionColumn: e.endColumn,
      };
      this._setSelectionImpl(n, t);
    }
  }
  _setSelectionImpl(e, t) {
    if (!this._modelData) return;
    const n = new XH(
      e.selectionStartLineNumber,
      e.selectionStartColumn,
      e.positionLineNumber,
      e.positionColumn,
    );
    this._modelData.viewModel.setSelections(t, [n]);
  }
  revealLines(e, t, n = 0) {
    this._revealLines(e, t, 0, n);
  }
  revealLinesInCenter(e, t, n = 0) {
    this._revealLines(e, t, 1, n);
  }
  revealLinesInCenterIfOutsideViewport(e, t, n = 0) {
    this._revealLines(e, t, 2, n);
  }
  revealLinesNearTop(e, t, n = 0) {
    this._revealLines(e, t, 5, n);
  }
  _revealLines(e, t, n, i) {
    if ("number" != typeof e || "number" != typeof t) throw new Error("Invalid arguments");
    this._sendRevealRange(new YH(e, 1, t, 1), n, !1, i);
  }
  revealRange(e, t = 0, n = !1, i = !0) {
    this._revealRange(e, n ? 1 : 0, i, t);
  }
  revealRangeInCenter(e, t = 0) {
    this._revealRange(e, 1, !0, t);
  }
  revealRangeInCenterIfOutsideViewport(e, t = 0) {
    this._revealRange(e, 2, !0, t);
  }
  revealRangeNearTop(e, t = 0) {
    this._revealRange(e, 5, !0, t);
  }
  revealRangeNearTopIfOutsideViewport(e, t = 0) {
    this._revealRange(e, 6, !0, t);
  }
  revealRangeAtTop(e, t = 0) {
    this._revealRange(e, 3, !0, t);
  }
  _revealRange(e, t, n, i) {
    if (!YH.isIRange(e)) throw new Error("Invalid arguments");
    this._sendRevealRange(YH.lift(e), t, n, i);
  }
  setSelections(e, t = "api", n = 0) {
    if (this._modelData) {
      if (!e || 0 === e.length) throw new Error("Invalid arguments");
      for (let t = 0, n = e.length; t < n; t++)
        if (!XH.isISelection(e[t])) throw new Error("Invalid arguments");
      this._modelData.viewModel.setSelections(t, e, n);
    }
  }
  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(e, t = 1) {
    if (this._modelData) {
      if ("number" != typeof e) throw new Error("Invalid arguments");
      this._modelData.viewModel.viewLayout.setScrollPosition({ scrollLeft: e }, t);
    }
  }
  setScrollTop(e, t = 1) {
    if (this._modelData) {
      if ("number" != typeof e) throw new Error("Invalid arguments");
      this._modelData.viewModel.viewLayout.setScrollPosition({ scrollTop: e }, t);
    }
  }
  setScrollPosition(e, t = 1) {
    this._modelData && this._modelData.viewModel.viewLayout.setScrollPosition(e, t);
  }
  hasPendingScrollAnimation() {
    return !!this._modelData && this._modelData.viewModel.viewLayout.hasPendingScrollAnimation();
  }
  saveViewState() {
    if (!this._modelData) return null;
    const e = this._contributions.saveViewState();
    return {
      cursorState: this._modelData.viewModel.saveCursorState(),
      viewState: this._modelData.viewModel.saveState(),
      contributionsState: e,
    };
  }
  restoreViewState(e) {
    if (!this._modelData || !this._modelData.hasRealView) return;
    const t = e;
    if (t && t.cursorState && t.viewState) {
      const e = t.cursorState;
      (Array.isArray(e)
        ? e.length > 0 && this._modelData.viewModel.restoreCursorState(e)
        : this._modelData.viewModel.restoreCursorState([e]),
        this._contributions.restoreViewState(t.contributionsState || {}));
      const n = this._modelData.viewModel.reduceRestoreState(t.viewState);
      this._modelData.view.restoreState(n);
    }
  }
  handleInitialized() {
    this._getViewModel()?.visibleLinesStabilized();
  }
  getContribution(e) {
    return this._contributions.get(e);
  }
  getActions() {
    return Array.from(this._actions.values());
  }
  getSupportedActions() {
    let e = this.getActions();
    return ((e = e.filter((e) => e.isSupported())), e);
  }
  getAction(e) {
    return this._actions.get(e) || null;
  }
  trigger(e, t, n) {
    n = n || {};
    try {
      switch (
        (this._onWillTriggerEditorOperationEvent.fire({ source: e, handlerId: t, payload: n }),
        this._beginUpdate(),
        t)
      ) {
        case "compositionStart":
          return void this._startComposition();
        case "compositionEnd":
          return void this._endComposition(e);
        case "type": {
          const t = n;
          return void this._type(e, t.text || "");
        }
        case "replacePreviousChar": {
          const t = n;
          return void this._compositionType(e, t.text || "", t.replaceCharCnt || 0, 0, 0);
        }
        case "compositionType": {
          const t = n;
          return void this._compositionType(
            e,
            t.text || "",
            t.replacePrevCharCnt || 0,
            t.replaceNextCharCnt || 0,
            t.positionDelta || 0,
          );
        }
        case "paste": {
          const t = n;
          return void this._paste(
            e,
            t.text || "",
            t.pasteOnNewLine || !1,
            t.multicursorText || null,
            t.mode || null,
            t.clipboardEvent,
          );
        }
        case "cut":
          return void this._cut(e);
      }
      const i = this.getAction(t);
      if (i) return void Promise.resolve(i.run(n)).then(void 0, HI);
      if (!this._modelData) return;
      if (this._triggerEditorCommand(e, t, n)) return;
      this._triggerCommand(t, n);
    } finally {
      this._endUpdate();
    }
  }
  _triggerCommand(e, t) {
    this._commandService.executeCommand(e, t);
  }
  _startComposition() {
    this._modelData &&
      ((this.inComposition = !0),
      this._modelData.viewModel.startComposition(),
      this._onDidCompositionStart.fire());
  }
  _endComposition(e) {
    this._modelData &&
      ((this.inComposition = !1),
      this._modelData.viewModel.endComposition(e),
      this._onDidCompositionEnd.fire());
  }
  _type(e, t) {
    this._modelData &&
      0 !== t.length &&
      ("keyboard" === e && this._onWillType.fire(t),
      this._modelData.viewModel.type(t, e),
      "keyboard" === e && this._onDidType.fire(t));
  }
  _compositionType(e, t, n, i, r) {
    this._modelData && this._modelData.viewModel.compositionType(t, n, i, r, e);
  }
  _paste(e, t, n, i, r, o) {
    if (!this._modelData) return;
    const s = this._modelData.viewModel,
      a = s.getSelection().getStartPosition();
    s.paste(t, n, i, e);
    const l = s.getSelection().getStartPosition();
    "keyboard" === e &&
      this._onDidPaste.fire({
        clipboardEvent: o,
        range: new YH(a.lineNumber, a.column, l.lineNumber, l.column),
        languageId: r,
      });
  }
  _cut(e) {
    this._modelData && this._modelData.viewModel.cut(e);
  }
  _triggerEditorCommand(e, t, n) {
    const i = UH.getEditorCommand(t);
    return (
      !!i &&
      (sR((n = n || {})) && (n.source = e),
      this._instantiationService.invokeFunction((e) => {
        Promise.resolve(i.runEditorCommand(e, this, n)).then(void 0, HI);
      }),
      !0)
    );
  }
  _getViewModel() {
    return this._modelData ? this._modelData.viewModel : null;
  }
  pushUndoStop() {
    return (
      !!this._modelData &&
      !this._configuration.options.get(104) &&
      (this._modelData.model.pushStackElement(), !0)
    );
  }
  popUndoStop() {
    return (
      !!this._modelData &&
      !this._configuration.options.get(104) &&
      (this._modelData.model.popStackElement(), !0)
    );
  }
  edit(e, t) {
    return this.executeEdits(
      t,
      e.replacements.map((e) => ({ range: e.range, text: e.text })),
      void 0,
    );
  }
  executeEdits(e, t, n) {
    if (!this._modelData) return !1;
    if (this._configuration.options.get(104)) return !1;
    let i, r, o;
    return (
      (i = n ? (Array.isArray(n) ? () => n : n) : () => null),
      e instanceof p8
        ? ((o = e), (r = e.metadata.source))
        : ((o = m8.unknown({ name: r })), (r = e)),
      this._onBeforeExecuteEdit.fire({ source: r ?? void 0 }),
      this._modelData.viewModel.executeEdits(r, t, i, o),
      !0
    );
  }
  executeCommand(e, t) {
    this._modelData && this._modelData.viewModel.executeCommand(t, e);
  }
  executeCommands(e, t) {
    this._modelData && this._modelData.viewModel.executeCommands(t, e);
  }
  createDecorationsCollection(e) {
    return new pne(this, e);
  }
  changeDecorations(e) {
    return this._modelData ? this._modelData.model.changeDecorations(e, this._id) : null;
  }
  getLineDecorations(e) {
    if (!this._modelData) return null;
    const t = this._configuration.options;
    return this._modelData.model.getLineDecorations(e, this._id, kK(t), EK(t));
  }
  getDecorationsInRange(e) {
    if (!this._modelData) return null;
    const t = this._configuration.options;
    return this._modelData.model.getDecorationsInRange(e, this._id, kK(t), EK(t));
  }
  getFontSizeAtPosition(e) {
    return this._modelData ? this._modelData.viewModel.getFontSizeAtPosition(e) : null;
  }
  deltaDecorations(e, t) {
    return this._modelData
      ? 0 === e.length && 0 === t.length
        ? e
        : this._modelData.model.deltaDecorations(e, t, this._id)
      : [];
  }
  removeDecorations(e) {
    this._modelData &&
      0 !== e.length &&
      this._modelData.model.changeDecorations((t) => {
        t.deltaDecorations(e, []);
      });
  }
  removeDecorationsByType(e) {
    const t = this._decorationTypeKeysToIds[e];
    (t && this.changeDecorations((e) => e.deltaDecorations(t, [])),
      this._decorationTypeKeysToIds.hasOwnProperty(e) && delete this._decorationTypeKeysToIds[e],
      this._decorationTypeSubtypes.hasOwnProperty(e) && delete this._decorationTypeSubtypes[e]);
  }
  getLayoutInfo() {
    return this._configuration.options.get(165);
  }
  createOverviewRuler(e) {
    return this._modelData && this._modelData.hasRealView
      ? this._modelData.view.createOverviewRuler(e)
      : null;
  }
  getContainerDomNode() {
    return this._domElement;
  }
  getDomNode() {
    return this._modelData && this._modelData.hasRealView
      ? this._modelData.view.domNode.domNode
      : null;
  }
  delegateVerticalScrollbarPointerDown(e) {
    this._modelData &&
      this._modelData.hasRealView &&
      this._modelData.view.delegateVerticalScrollbarPointerDown(e);
  }
  delegateScrollFromMouseWheelEvent(e) {
    this._modelData &&
      this._modelData.hasRealView &&
      this._modelData.view.delegateScrollFromMouseWheelEvent(e);
  }
  layout(e, t = !1) {
    (this._configuration.observeContainer(e), t || this.render());
  }
  focus() {
    this._modelData && this._modelData.hasRealView && this._modelData.view.focus();
  }
  hasTextFocus() {
    return !(!this._modelData || !this._modelData.hasRealView) && this._modelData.view.isFocused();
  }
  hasWidgetFocus() {
    return (
      !(!this._modelData || !this._modelData.hasRealView) && this._modelData.view.isWidgetFocused()
    );
  }
  addContentWidget(e) {
    const t = { widget: e, position: e.getPosition() };
    (this._contentWidgets.hasOwnProperty(e.getId()),
      (this._contentWidgets[e.getId()] = t),
      this._modelData && this._modelData.hasRealView && this._modelData.view.addContentWidget(t));
  }
  layoutContentWidget(e) {
    const t = e.getId();
    if (this._contentWidgets.hasOwnProperty(t)) {
      const n = this._contentWidgets[t];
      ((n.position = e.getPosition()),
        this._modelData &&
          this._modelData.hasRealView &&
          this._modelData.view.layoutContentWidget(n));
    }
  }
  removeContentWidget(e) {
    const t = e.getId();
    if (this._contentWidgets.hasOwnProperty(t)) {
      const e = this._contentWidgets[t];
      (delete this._contentWidgets[t],
        this._modelData &&
          this._modelData.hasRealView &&
          this._modelData.view.removeContentWidget(e));
    }
  }
  addOverlayWidget(e) {
    const t = { widget: e, position: e.getPosition() };
    (this._overlayWidgets.hasOwnProperty(e.getId()),
      (this._overlayWidgets[e.getId()] = t),
      this._modelData && this._modelData.hasRealView && this._modelData.view.addOverlayWidget(t));
  }
  layoutOverlayWidget(e) {
    const t = e.getId();
    if (this._overlayWidgets.hasOwnProperty(t)) {
      const n = this._overlayWidgets[t];
      ((n.position = e.getPosition()),
        this._modelData &&
          this._modelData.hasRealView &&
          this._modelData.view.layoutOverlayWidget(n));
    }
  }
  removeOverlayWidget(e) {
    const t = e.getId();
    if (this._overlayWidgets.hasOwnProperty(t)) {
      const e = this._overlayWidgets[t];
      (delete this._overlayWidgets[t],
        this._modelData &&
          this._modelData.hasRealView &&
          this._modelData.view.removeOverlayWidget(e));
    }
  }
  addGlyphMarginWidget(e) {
    const t = { widget: e, position: e.getPosition() };
    (this._glyphMarginWidgets.hasOwnProperty(e.getId()),
      (this._glyphMarginWidgets[e.getId()] = t),
      this._modelData &&
        this._modelData.hasRealView &&
        this._modelData.view.addGlyphMarginWidget(t));
  }
  layoutGlyphMarginWidget(e) {
    const t = e.getId();
    if (this._glyphMarginWidgets.hasOwnProperty(t)) {
      const n = this._glyphMarginWidgets[t];
      ((n.position = e.getPosition()),
        this._modelData &&
          this._modelData.hasRealView &&
          this._modelData.view.layoutGlyphMarginWidget(n));
    }
  }
  removeGlyphMarginWidget(e) {
    const t = e.getId();
    if (this._glyphMarginWidgets.hasOwnProperty(t)) {
      const e = this._glyphMarginWidgets[t];
      (delete this._glyphMarginWidgets[t],
        this._modelData &&
          this._modelData.hasRealView &&
          this._modelData.view.removeGlyphMarginWidget(e));
    }
  }
  changeViewZones(e) {
    this._modelData && this._modelData.hasRealView && this._modelData.view.change(e);
  }
  getTargetAtClientPoint(e, t) {
    return this._modelData && this._modelData.hasRealView
      ? this._modelData.view.getTargetAtClientPoint(e, t)
      : null;
  }
  getScrolledVisiblePosition(e) {
    if (!this._modelData || !this._modelData.hasRealView) return null;
    const t = this._modelData.model.validatePosition(e),
      n = this._configuration.options.get(165);
    return {
      top:
        one._getVerticalOffsetForPosition(this._modelData, t.lineNumber, t.column) -
        this.getScrollTop(),
      left:
        this._modelData.view.getOffsetForColumn(t.lineNumber, t.column) +
        n.glyphMarginWidth +
        n.lineNumbersWidth +
        n.decorationsWidth -
        this.getScrollLeft(),
      height: this.getLineHeightForPosition(t),
    };
  }
  getOffsetForColumn(e, t) {
    return this._modelData && this._modelData.hasRealView
      ? this._modelData.view.getOffsetForColumn(e, t)
      : -1;
  }
  render(e = !1) {
    this._modelData &&
      this._modelData.hasRealView &&
      this._modelData.viewModel.batchEvents(() => {
        this._modelData.view.render(!0, e);
      });
  }
  setAriaOptions(e) {
    this._modelData && this._modelData.hasRealView && this._modelData.view.setAriaOptions(e);
  }
  applyFontInfo(e) {
    Vq(e, this._configuration.options.get(59));
  }
  setBanner(e, t) {
    (this._bannerDomNode &&
      this._domElement.contains(this._bannerDomNode) &&
      this._bannerDomNode.remove(),
      (this._bannerDomNode = e),
      this._configuration.setReservedHeight(e ? t : 0),
      this._bannerDomNode && this._domElement.prepend(this._bannerDomNode));
  }
  _attachModel(e) {
    if (!e) return void (this._modelData = null);
    const t = [];
    (this._domElement.setAttribute("data-mode-id", e.getLanguageId()),
      this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),
      this._configuration.setModelLineCount(e.getLineCount()));
    const n = e.onBeforeAttached(),
      i = new Qte(
        this._id,
        this._configuration,
        e,
        U3.create(MF(this._domElement)),
        _ee.create(this._configuration.options),
        (e) => JF(MF(this._domElement), e),
        this.languageConfigurationService,
        this._themeService,
        n,
        {
          batchChanges: (e) => {
            try {
              return (this._beginUpdate(), e());
            } finally {
              this._endUpdate();
            }
          },
        },
      );
    (t.push(e.onWillDispose(() => this.setModel(null))),
      t.push(
        i.onEvent((t) => {
          switch (t.kind) {
            case 0:
              this._onDidContentSizeChange.fire(t);
              break;
            case 1:
              this._editorTextFocus.setValue(t.hasFocus);
              break;
            case 2:
              this._editorWidgetFocus.setValue(t.hasFocus);
              break;
            case 3:
              this._onDidScrollChange.fire(t);
              break;
            case 4:
              this._onDidChangeViewZones.fire();
              break;
            case 5:
              this._onDidChangeHiddenAreas.fire();
              break;
            case 6:
              this._onDidAttemptReadOnlyEdit.fire();
              break;
            case 7: {
              if (t.reachedMaxCursorCount) {
                const e = SI(
                  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(Z4.Warning, e, [
                  {
                    label: "Find and Replace",
                    run: () => {
                      this._commandService.executeCommand("editor.action.startFindReplaceAction");
                    },
                  },
                  {
                    label: SI(84, "Increase Multi Cursor Limit"),
                    run: () => {
                      this._commandService.executeCommand("workbench.action.openSettings2", {
                        query: "editor.multiCursorLimit",
                      });
                    },
                  },
                ]);
              }
              const e = [];
              for (let r = 0, o = t.selections.length; r < o; r++)
                e[r] = t.selections[r].getPosition();
              const n = {
                position: e[0],
                secondaryPositions: e.slice(1),
                reason: t.reason,
                source: t.source,
              };
              this._onDidChangeCursorPosition.fire(n);
              const i = {
                selection: t.selections[0],
                secondarySelections: t.selections.slice(1),
                modelVersionId: t.modelVersionId,
                oldSelections: t.oldSelections,
                oldModelVersionId: t.oldModelVersionId,
                source: t.source,
                reason: t.reason,
              };
              this._onDidChangeCursorSelection.fire(i);
              break;
            }
            case 8:
              this._onDidChangeModelDecorations.fire(t.event);
              break;
            case 9:
              (this._domElement.setAttribute("data-mode-id", e.getLanguageId()),
                this._onDidChangeModelLanguage.fire(t.event));
              break;
            case 10:
              this._onDidChangeModelLanguageConfiguration.fire(t.event);
              break;
            case 11:
              this._onDidChangeModelContent.fire(t.event);
              break;
            case 12:
              this._onDidChangeModelOptions.fire(t.event);
              break;
            case 13:
              this._onDidChangeModelTokens.fire(t.event);
              break;
            case 14:
              this._onDidChangeLineHeight.fire(t.event);
              break;
            case 15:
              this._onDidChangeFont.fire(t.event);
          }
        }),
      ));
    const [r, o] = this._createView(i);
    if (o) {
      this._domElement.appendChild(r.domNode.domNode);
      let t = Object.keys(this._contentWidgets);
      for (let e = 0, n = t.length; e < n; e++) {
        const n = t[e];
        r.addContentWidget(this._contentWidgets[n]);
      }
      t = Object.keys(this._overlayWidgets);
      for (let e = 0, n = t.length; e < n; e++) {
        const n = t[e];
        r.addOverlayWidget(this._overlayWidgets[n]);
      }
      t = Object.keys(this._glyphMarginWidgets);
      for (let e = 0, n = t.length; e < n; e++) {
        const n = t[e];
        r.addGlyphMarginWidget(this._glyphMarginWidgets[n]);
      }
      (r.render(!1, !0), r.domNode.domNode.setAttribute("data-uri", e.uri.toString()));
    }
    this._modelData = new cne(e, i, r, o, t, n);
  }
  _createView(e) {
    let t;
    t = this.isSimpleWidget
      ? {
          paste: (e, t, n, i) => {
            this._paste("keyboard", e, t, n, i);
          },
          type: (e) => {
            this._type("keyboard", e);
          },
          compositionType: (e, t, n, i) => {
            this._compositionType("keyboard", e, t, n, i);
          },
          startComposition: () => {
            this._startComposition();
          },
          endComposition: () => {
            this._endComposition("keyboard");
          },
          cut: () => {
            this._cut("keyboard");
          },
        }
      : {
          paste: (e, t, n, i) => {
            const r = { text: e, pasteOnNewLine: t, multicursorText: n, mode: i };
            this._commandService.executeCommand("paste", r);
          },
          type: (e) => {
            const t = { text: e };
            this._commandService.executeCommand("type", t);
          },
          compositionType: (e, t, n, i) => {
            if (n || i) {
              const r = { text: e, replacePrevCharCnt: t, replaceNextCharCnt: n, positionDelta: i };
              this._commandService.executeCommand("compositionType", r);
            } else {
              const n = { text: e, replaceCharCnt: t };
              this._commandService.executeCommand("replacePreviousChar", n);
            }
          },
          startComposition: () => {
            this._commandService.executeCommand("compositionStart", {});
          },
          endComposition: () => {
            this._commandService.executeCommand("compositionEnd", {});
          },
          cut: () => {
            this._commandService.executeCommand("cut", {});
          },
        };
    const n = new i0(e.coordinatesConverter);
    ((n.onKeyDown = (e) => this._onKeyDown.fire(e)),
      (n.onKeyUp = (e) => this._onKeyUp.fire(e)),
      (n.onContextMenu = (e) => this._onContextMenu.fire(e)),
      (n.onMouseMove = (e) => this._onMouseMove.fire(e)),
      (n.onMouseLeave = (e) => this._onMouseLeave.fire(e)),
      (n.onMouseDown = (e) => this._onMouseDown.fire(e)),
      (n.onMouseUp = (e) => this._onMouseUp.fire(e)),
      (n.onMouseDrag = (e) => this._onMouseDrag.fire(e)),
      (n.onMouseDrop = (e) => this._onMouseDrop.fire(e)),
      (n.onMouseDropCanceled = (e) => this._onMouseDropCanceled.fire(e)),
      (n.onMouseWheel = (e) => this._onMouseWheel.fire(e)));
    return [
      new w3(
        this._domElement,
        this.getId(),
        t,
        this._configuration,
        this._themeService.getColorTheme(),
        e,
        n,
        this._overflowWidgetsDomNode,
        this._instantiationService,
      ),
      !0,
    ];
  }
  _postDetachModelCleanup(e) {
    e?.removeAllDecorationsWithOwnerId(this._id);
  }
  _detachModel() {
    if (
      (this._contributionsDisposable?.dispose(),
      (this._contributionsDisposable = void 0),
      !this._modelData)
    )
      return null;
    const e = this._modelData.model,
      t = this._modelData.hasRealView ? this._modelData.view.domNode.domNode : null;
    return (
      this._modelData.dispose(),
      (this._modelData = null),
      this._domElement.removeAttribute("data-mode-id"),
      t && this._domElement.contains(t) && t.remove(),
      this._bannerDomNode &&
        this._domElement.contains(this._bannerDomNode) &&
        this._bannerDomNode.remove(),
      e
    );
  }
  _removeDecorationType(e) {
    this._codeEditorService.removeDecorationType(e);
  }
  hasModel() {
    return null !== this._modelData;
  }
  showDropIndicatorAt(e) {
    const t = [
      {
        range: new YH(e.lineNumber, e.column, e.lineNumber, e.column),
        options: one.dropIntoEditorDecorationOptions,
      },
    ];
    (this._dropIntoEditorDecorations.set(t), this.revealPosition(e, 1));
  }
  removeDropIndicator() {
    this._dropIntoEditorDecorations.clear();
  }
  _beginUpdate() {
    (this._updateCounter++, 1 === this._updateCounter && this._onBeginUpdate.fire());
  }
  _endUpdate() {
    (this._updateCounter--, 0 === this._updateCounter && this._onEndUpdate.fire());
  }
};
ane = one = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    sne(3, vV),
    sne(4, yV),
    sne(5, PV),
    sne(6, xW),
    sne(7, h0),
    sne(8, Y4),
    sne(9, KK),
    sne(10, f$),
    sne(11, mee),
  ],
  ane,
);
let lne = 0,
  cne = class {
    constructor(e, t, n, i, r, o) {
      ((this.model = e),
        (this.viewModel = t),
        (this.view = n),
        (this.hasRealView = i),
        (this.listenersToRemove = r),
        (this.attachedView = o));
    }
    dispose() {
      (IO(this.listenersToRemove),
        this.model.onBeforeDetached(this.attachedView),
        this.hasRealView && this.view.dispose(),
        this.viewModel.dispose());
    }
  };
class dne extends PO {
  constructor(e) {
    (super(),
      (this._emitterOptions = e),
      (this._onDidChangeToTrue = this._register(new QO(this._emitterOptions))),
      (this.onDidChangeToTrue = this._onDidChangeToTrue.event),
      (this._onDidChangeToFalse = this._register(new QO(this._emitterOptions))),
      (this.onDidChangeToFalse = this._onDidChangeToFalse.event),
      (this._value = 0));
  }
  setValue(e) {
    const t = e ? 2 : 1;
    this._value !== t &&
      ((this._value = t),
      2 === this._value
        ? this._onDidChangeToTrue.fire()
        : 1 === this._value && this._onDidChangeToFalse.fire());
  }
}
class une extends QO {
  constructor(e, t) {
    (super({ deliveryQueue: t }), (this._contributions = e));
  }
  fire(e) {
    (this._contributions.onBeforeInteractionEvent(), super.fire(e));
  }
}
class hne extends PO {
  constructor(e, t) {
    (super(),
      (this._editor = e),
      t.createKey("editorId", e.getId()),
      (this._editorSimpleInput = $$.editorSimpleInput.bindTo(t)),
      (this._editorFocus = $$.focus.bindTo(t)),
      (this._textInputFocus = $$.textInputFocus.bindTo(t)),
      (this._editorTextFocus = $$.editorTextFocus.bindTo(t)),
      (this._tabMovesFocus = $$.tabMovesFocus.bindTo(t)),
      (this._editorReadonly = $$.readOnly.bindTo(t)),
      (this._inDiffEditor = $$.inDiffEditor.bindTo(t)),
      (this._editorColumnSelection = $$.columnSelection.bindTo(t)),
      (this._hasMultipleSelections = $$.hasMultipleSelections.bindTo(t)),
      (this._hasNonEmptySelection = $$.hasNonEmptySelection.bindTo(t)),
      (this._canUndo = $$.canUndo.bindTo(t)),
      (this._canRedo = $$.canRedo.bindTo(t)),
      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(qK.onDidChangeTabFocus((e) => this._tabMovesFocus.set(e))),
      this._updateFromConfig(),
      this._updateFromSelection(),
      this._updateFromFocus(),
      this._updateFromModel(),
      this._editorSimpleInput.set(this._editor.isSimpleWidget));
  }
  _updateFromConfig() {
    const e = this._editor.getOptions();
    (this._tabMovesFocus.set(e.get(164) || qK.getTabFocusMode()),
      this._editorReadonly.set(e.get(104)),
      this._inDiffEditor.set(e.get(70)),
      this._editorColumnSelection.set(e.get(28)));
  }
  _updateFromSelection() {
    const e = this._editor.getSelections();
    e
      ? (this._hasMultipleSelections.set(e.length > 1),
        this._hasNonEmptySelection.set(e.some((e) => !e.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() {
    const e = this._editor.getModel();
    (this._canUndo.set(Boolean(e && e.canUndo())), this._canRedo.set(Boolean(e && e.canRedo())));
  }
}
class gne extends PO {
  constructor(e, t, n) {
    (super(),
      (this._editor = e),
      (this._contextKeyService = t),
      (this._languageFeaturesService = n),
      (this._langId = $$.languageId.bindTo(t)),
      (this._hasCompletionItemProvider = $$.hasCompletionItemProvider.bindTo(t)),
      (this._hasCodeActionsProvider = $$.hasCodeActionsProvider.bindTo(t)),
      (this._hasCodeLensProvider = $$.hasCodeLensProvider.bindTo(t)),
      (this._hasDefinitionProvider = $$.hasDefinitionProvider.bindTo(t)),
      (this._hasDeclarationProvider = $$.hasDeclarationProvider.bindTo(t)),
      (this._hasImplementationProvider = $$.hasImplementationProvider.bindTo(t)),
      (this._hasTypeDefinitionProvider = $$.hasTypeDefinitionProvider.bindTo(t)),
      (this._hasHoverProvider = $$.hasHoverProvider.bindTo(t)),
      (this._hasDocumentHighlightProvider = $$.hasDocumentHighlightProvider.bindTo(t)),
      (this._hasDocumentSymbolProvider = $$.hasDocumentSymbolProvider.bindTo(t)),
      (this._hasReferenceProvider = $$.hasReferenceProvider.bindTo(t)),
      (this._hasRenameProvider = $$.hasRenameProvider.bindTo(t)),
      (this._hasSignatureHelpProvider = $$.hasSignatureHelpProvider.bindTo(t)),
      (this._hasInlayHintsProvider = $$.hasInlayHintsProvider.bindTo(t)),
      (this._hasDocumentFormattingProvider = $$.hasDocumentFormattingProvider.bindTo(t)),
      (this._hasDocumentSelectionFormattingProvider =
        $$.hasDocumentSelectionFormattingProvider.bindTo(t)),
      (this._hasMultipleDocumentFormattingProvider =
        $$.hasMultipleDocumentFormattingProvider.bindTo(t)),
      (this._hasMultipleDocumentSelectionFormattingProvider =
        $$.hasMultipleDocumentSelectionFormattingProvider.bindTo(t)),
      (this._isInEmbeddedEditor = $$.isInEmbeddedEditor.bindTo(t)));
    const i = () => this._update();
    (this._register(e.onDidChangeModel(i)),
      this._register(e.onDidChangeModelLanguage(i)),
      this._register(n.completionProvider.onDidChange(i)),
      this._register(n.codeActionProvider.onDidChange(i)),
      this._register(n.codeLensProvider.onDidChange(i)),
      this._register(n.definitionProvider.onDidChange(i)),
      this._register(n.declarationProvider.onDidChange(i)),
      this._register(n.implementationProvider.onDidChange(i)),
      this._register(n.typeDefinitionProvider.onDidChange(i)),
      this._register(n.hoverProvider.onDidChange(i)),
      this._register(n.documentHighlightProvider.onDidChange(i)),
      this._register(n.documentSymbolProvider.onDidChange(i)),
      this._register(n.referenceProvider.onDidChange(i)),
      this._register(n.renameProvider.onDidChange(i)),
      this._register(n.documentFormattingEditProvider.onDidChange(i)),
      this._register(n.documentRangeFormattingEditProvider.onDidChange(i)),
      this._register(n.signatureHelpProvider.onDidChange(i)),
      this._register(n.inlayHintsProvider.onDidChange(i)),
      i());
  }
  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() {
    const e = this._editor.getModel();
    e
      ? this._contextKeyService.bufferChangeEvents(() => {
          (this._langId.set(e.getLanguageId()),
            this._hasCompletionItemProvider.set(
              this._languageFeaturesService.completionProvider.has(e),
            ),
            this._hasCodeActionsProvider.set(
              this._languageFeaturesService.codeActionProvider.has(e),
            ),
            this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),
            this._hasDefinitionProvider.set(
              this._languageFeaturesService.definitionProvider.has(e),
            ),
            this._hasDeclarationProvider.set(
              this._languageFeaturesService.declarationProvider.has(e),
            ),
            this._hasImplementationProvider.set(
              this._languageFeaturesService.implementationProvider.has(e),
            ),
            this._hasTypeDefinitionProvider.set(
              this._languageFeaturesService.typeDefinitionProvider.has(e),
            ),
            this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),
            this._hasDocumentHighlightProvider.set(
              this._languageFeaturesService.documentHighlightProvider.has(e),
            ),
            this._hasDocumentSymbolProvider.set(
              this._languageFeaturesService.documentSymbolProvider.has(e),
            ),
            this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),
            this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),
            this._hasSignatureHelpProvider.set(
              this._languageFeaturesService.signatureHelpProvider.has(e),
            ),
            this._hasInlayHintsProvider.set(
              this._languageFeaturesService.inlayHintsProvider.has(e),
            ),
            this._hasDocumentFormattingProvider.set(
              this._languageFeaturesService.documentFormattingEditProvider.has(e) ||
                this._languageFeaturesService.documentRangeFormattingEditProvider.has(e),
            ),
            this._hasDocumentSelectionFormattingProvider.set(
              this._languageFeaturesService.documentRangeFormattingEditProvider.has(e),
            ),
            this._hasMultipleDocumentFormattingProvider.set(
              this._languageFeaturesService.documentFormattingEditProvider.all(e).length +
                this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length >
                1,
            ),
            this._hasMultipleDocumentSelectionFormattingProvider.set(
              this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length > 1,
            ),
            this._isInEmbeddedEditor.set(
              e.uri.scheme === NP.walkThroughSnippet || e.uri.scheme === NP.vscodeChatCodeBlock,
            ));
        })
      : this.reset();
  }
}
class pne {
  get length() {
    return this._decorationIds.length;
  }
  constructor(e, t) {
    ((this._editor = e),
      (this._decorationIds = []),
      (this._isChangingDecorations = !1),
      Array.isArray(t) && t.length > 0 && this.set(t));
  }
  onDidChange(e, t, n) {
    return this._editor.onDidChangeModelDecorations((n) => {
      this._isChangingDecorations || e.call(t, n);
    }, n);
  }
  getRange(e) {
    return this._editor.hasModel()
      ? e >= this._decorationIds.length
        ? null
        : this._editor.getModel().getDecorationRange(this._decorationIds[e])
      : null;
  }
  getRanges() {
    if (!this._editor.hasModel()) return [];
    const e = this._editor.getModel(),
      t = [];
    for (const n of this._decorationIds) {
      const i = e.getDecorationRange(n);
      i && t.push(i);
    }
    return t;
  }
  has(e) {
    return this._decorationIds.includes(e.id);
  }
  clear() {
    0 !== this._decorationIds.length && this.set([]);
  }
  set(e) {
    try {
      ((this._isChangingDecorations = !0),
        this._editor.changeDecorations((t) => {
          this._decorationIds = t.deltaDecorations(this._decorationIds, e);
        }));
    } finally {
      this._isChangingDecorations = !1;
    }
    return this._decorationIds;
  }
  append(e) {
    let t = [];
    try {
      ((this._isChangingDecorations = !0),
        this._editor.changeDecorations((n) => {
          ((t = n.deltaDecorations([], e)), (this._decorationIds = this._decorationIds.concat(t)));
        }));
    } finally {
      this._isChangingDecorations = !1;
    }
    return t;
  }
}
const fne = encodeURIComponent(
    "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='",
  ),
  mne = encodeURIComponent(
    "'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>",
  );
function _ne(e) {
  return fne + encodeURIComponent(e.toString()) + mne;
}
const vne = encodeURIComponent(
    '<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="',
  ),
  bne = encodeURIComponent(
    '"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>',
  );
function yne(e) {
  return vne + encodeURIComponent(e.toString()) + bne;
}
function xne(e) {
  return new wne(e);
}
_0((e, t) => {
  const n = e.getColor(JG);
  n &&
    (t.addRule(
      `.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${_ne(n)}") repeat-x bottom left; }`,
    ),
    t.addRule(`:root { --monaco-editor-error-decoration: url("data:image/svg+xml,${_ne(n)}"); }`));
  const i = e.getColor(nZ);
  i &&
    (t.addRule(
      `.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${_ne(i)}") repeat-x bottom left; }`,
    ),
    t.addRule(
      `:root { --monaco-editor-warning-decoration: url("data:image/svg+xml,${_ne(i)}"); }`,
    ));
  const r = e.getColor(rZ);
  r &&
    (t.addRule(
      `.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${_ne(r)}") repeat-x bottom left; }`,
    ),
    t.addRule(`:root { --monaco-editor-info-decoration: url("data:image/svg+xml,${_ne(r)}"); }`));
  const o = e.getColor(sZ);
  o &&
    (t.addRule(
      `.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${yne(o)}") no-repeat bottom left; }`,
    ),
    t.addRule(`:root { --monaco-editor-hint-decoration: url("data:image/svg+xml,${yne(o)}"); }`));
  const s = e.getColor(G0);
  s &&
    (t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`),
    t.addRule(`:root { --monaco-editor-unnecessary-decoration-opacity: ${s.rgba.a}; }`));
});
class wne extends qj {
  constructor(e) {
    (super(), (this.value = e));
  }
  get debugName() {
    return this.toString();
  }
  get() {
    return this.value;
  }
  addObserver(e) {}
  removeObserver(e) {}
  toString() {
    return `Const: ${this.value}`;
  }
}
function Cne(e, t) {
  return e;
}
function Sne(e) {
  return xne(e);
}
const kne = bV("accessibilitySignalService");
class Ene {
  static register(e) {
    return new Ene(e.fileName);
  }
  static {
    this.error = Ene.register({ fileName: "error.mp3" });
  }
  static {
    this.warning = Ene.register({ fileName: "warning.mp3" });
  }
  static {
    this.success = Ene.register({ fileName: "success.mp3" });
  }
  static {
    this.foldedArea = Ene.register({ fileName: "foldedAreas.mp3" });
  }
  static {
    this.break = Ene.register({ fileName: "break.mp3" });
  }
  static {
    this.quickFixes = Ene.register({ fileName: "quickFixes.mp3" });
  }
  static {
    this.taskCompleted = Ene.register({ fileName: "taskCompleted.mp3" });
  }
  static {
    this.taskFailed = Ene.register({ fileName: "taskFailed.mp3" });
  }
  static {
    this.terminalBell = Ene.register({ fileName: "terminalBell.mp3" });
  }
  static {
    this.diffLineInserted = Ene.register({ fileName: "diffLineInserted.mp3" });
  }
  static {
    this.diffLineDeleted = Ene.register({ fileName: "diffLineDeleted.mp3" });
  }
  static {
    this.diffLineModified = Ene.register({ fileName: "diffLineModified.mp3" });
  }
  static {
    this.requestSent = Ene.register({ fileName: "requestSent.mp3" });
  }
  static {
    this.responseReceived1 = Ene.register({ fileName: "responseReceived1.mp3" });
  }
  static {
    this.responseReceived2 = Ene.register({ fileName: "responseReceived2.mp3" });
  }
  static {
    this.responseReceived3 = Ene.register({ fileName: "responseReceived3.mp3" });
  }
  static {
    this.responseReceived4 = Ene.register({ fileName: "responseReceived4.mp3" });
  }
  static {
    this.clear = Ene.register({ fileName: "clear.mp3" });
  }
  static {
    this.save = Ene.register({ fileName: "save.mp3" });
  }
  static {
    this.format = Ene.register({ fileName: "format.mp3" });
  }
  static {
    this.voiceRecordingStarted = Ene.register({ fileName: "voiceRecordingStarted.mp3" });
  }
  static {
    this.voiceRecordingStopped = Ene.register({ fileName: "voiceRecordingStopped.mp3" });
  }
  static {
    this.progress = Ene.register({ fileName: "progress.mp3" });
  }
  static {
    this.chatEditModifiedFile = Ene.register({ fileName: "chatEditModifiedFile.mp3" });
  }
  static {
    this.editsKept = Ene.register({ fileName: "editsKept.mp3" });
  }
  static {
    this.editsUndone = Ene.register({ fileName: "editsUndone.mp3" });
  }
  static {
    this.nextEditSuggestion = Ene.register({ fileName: "nextEditSuggestion.mp3" });
  }
  static {
    this.terminalCommandSucceeded = Ene.register({ fileName: "terminalCommandSucceeded.mp3" });
  }
  static {
    this.chatUserActionRequired = Ene.register({ fileName: "chatUserActionRequired.mp3" });
  }
  static {
    this.codeActionTriggered = Ene.register({ fileName: "codeActionTriggered.mp3" });
  }
  static {
    this.codeActionApplied = Ene.register({ fileName: "codeActionApplied.mp3" });
  }
  constructor(e) {
    this.fileName = e;
  }
}
class Nne {
  constructor(e) {
    this.randomOneOf = e;
  }
}
class Lne {
  constructor(e, t, n, i, r, o, s = !1) {
    ((this.sound = e),
      (this.name = t),
      (this.legacySoundSettingsKey = n),
      (this.settingsKey = i),
      (this.legacyAnnouncementSettingsKey = r),
      (this.announcementMessage = o),
      (this.managesOwnEnablement = s));
  }
  static {
    this._signals = new Set();
  }
  static register(e) {
    const t = new Nne("randomOneOf" in e.sound ? e.sound.randomOneOf : [e.sound]),
      n = new Lne(
        t,
        e.name,
        e.legacySoundSettingsKey,
        e.settingsKey,
        e.legacyAnnouncementSettingsKey,
        e.announcementMessage,
        e.managesOwnEnablement,
      );
    return (Lne._signals.add(n), n);
  }
  static {
    this.errorAtPosition = Lne.register({
      name: SI(1576, "Error at Position"),
      sound: Ene.error,
      announcementMessage: SI(1577, "Error"),
      settingsKey: "accessibility.signals.positionHasError",
      delaySettingsKey: "accessibility.signalOptions.delays.errorAtPosition",
    });
  }
  static {
    this.warningAtPosition = Lne.register({
      name: SI(1578, "Warning at Position"),
      sound: Ene.warning,
      announcementMessage: SI(1579, "Warning"),
      settingsKey: "accessibility.signals.positionHasWarning",
      delaySettingsKey: "accessibility.signalOptions.delays.warningAtPosition",
    });
  }
  static {
    this.errorOnLine = Lne.register({
      name: SI(1580, "Error on Line"),
      sound: Ene.error,
      legacySoundSettingsKey: "audioCues.lineHasError",
      legacyAnnouncementSettingsKey: "accessibility.alert.error",
      announcementMessage: SI(1581, "Error on Line"),
      settingsKey: "accessibility.signals.lineHasError",
    });
  }
  static {
    this.warningOnLine = Lne.register({
      name: SI(1582, "Warning on Line"),
      sound: Ene.warning,
      legacySoundSettingsKey: "audioCues.lineHasWarning",
      legacyAnnouncementSettingsKey: "accessibility.alert.warning",
      announcementMessage: SI(1583, "Warning on Line"),
      settingsKey: "accessibility.signals.lineHasWarning",
    });
  }
  static {
    this.foldedArea = Lne.register({
      name: SI(1584, "Folded Area on Line"),
      sound: Ene.foldedArea,
      legacySoundSettingsKey: "audioCues.lineHasFoldedArea",
      legacyAnnouncementSettingsKey: "accessibility.alert.foldedArea",
      announcementMessage: SI(1585, "Folded"),
      settingsKey: "accessibility.signals.lineHasFoldedArea",
    });
  }
  static {
    this.break = Lne.register({
      name: SI(1586, "Breakpoint on Line"),
      sound: Ene.break,
      legacySoundSettingsKey: "audioCues.lineHasBreakpoint",
      legacyAnnouncementSettingsKey: "accessibility.alert.breakpoint",
      announcementMessage: SI(1587, "Breakpoint"),
      settingsKey: "accessibility.signals.lineHasBreakpoint",
    });
  }
  static {
    this.inlineSuggestion = Lne.register({
      name: SI(1588, "Inline Suggestion on Line"),
      sound: Ene.quickFixes,
      legacySoundSettingsKey: "audioCues.lineHasInlineSuggestion",
      settingsKey: "accessibility.signals.lineHasInlineSuggestion",
    });
  }
  static {
    this.nextEditSuggestion = Lne.register({
      name: SI(1589, "Next Edit Suggestion on Line"),
      sound: Ene.nextEditSuggestion,
      legacySoundSettingsKey: "audioCues.nextEditSuggestion",
      settingsKey: "accessibility.signals.nextEditSuggestion",
      announcementMessage: SI(1590, "Next Edit Suggestion"),
    });
  }
  static {
    this.terminalQuickFix = Lne.register({
      name: SI(1591, "Terminal Quick Fix"),
      sound: Ene.quickFixes,
      legacySoundSettingsKey: "audioCues.terminalQuickFix",
      legacyAnnouncementSettingsKey: "accessibility.alert.terminalQuickFix",
      announcementMessage: SI(1592, "Quick Fix"),
      settingsKey: "accessibility.signals.terminalQuickFix",
    });
  }
  static {
    this.onDebugBreak = Lne.register({
      name: SI(1593, "Debugger Stopped on Breakpoint"),
      sound: Ene.break,
      legacySoundSettingsKey: "audioCues.onDebugBreak",
      legacyAnnouncementSettingsKey: "accessibility.alert.onDebugBreak",
      announcementMessage: SI(1594, "Breakpoint"),
      settingsKey: "accessibility.signals.onDebugBreak",
    });
  }
  static {
    this.noInlayHints = Lne.register({
      name: SI(1595, "No Inlay Hints on Line"),
      sound: Ene.error,
      legacySoundSettingsKey: "audioCues.noInlayHints",
      legacyAnnouncementSettingsKey: "accessibility.alert.noInlayHints",
      announcementMessage: SI(1596, "No Inlay Hints"),
      settingsKey: "accessibility.signals.noInlayHints",
    });
  }
  static {
    this.taskCompleted = Lne.register({
      name: SI(1597, "Task Completed"),
      sound: Ene.taskCompleted,
      legacySoundSettingsKey: "audioCues.taskCompleted",
      legacyAnnouncementSettingsKey: "accessibility.alert.taskCompleted",
      announcementMessage: SI(1598, "Task Completed"),
      settingsKey: "accessibility.signals.taskCompleted",
    });
  }
  static {
    this.taskFailed = Lne.register({
      name: SI(1599, "Task Failed"),
      sound: Ene.taskFailed,
      legacySoundSettingsKey: "audioCues.taskFailed",
      legacyAnnouncementSettingsKey: "accessibility.alert.taskFailed",
      announcementMessage: SI(1600, "Task Failed"),
      settingsKey: "accessibility.signals.taskFailed",
    });
  }
  static {
    this.terminalCommandFailed = Lne.register({
      name: SI(1601, "Terminal Command Failed"),
      sound: Ene.error,
      legacySoundSettingsKey: "audioCues.terminalCommandFailed",
      legacyAnnouncementSettingsKey: "accessibility.alert.terminalCommandFailed",
      announcementMessage: SI(1602, "Command Failed"),
      settingsKey: "accessibility.signals.terminalCommandFailed",
    });
  }
  static {
    this.terminalCommandSucceeded = Lne.register({
      name: SI(1603, "Terminal Command Succeeded"),
      sound: Ene.terminalCommandSucceeded,
      announcementMessage: SI(1604, "Command Succeeded"),
      settingsKey: "accessibility.signals.terminalCommandSucceeded",
    });
  }
  static {
    this.terminalBell = Lne.register({
      name: SI(1605, "Terminal Bell"),
      sound: Ene.terminalBell,
      legacySoundSettingsKey: "audioCues.terminalBell",
      legacyAnnouncementSettingsKey: "accessibility.alert.terminalBell",
      announcementMessage: SI(1606, "Terminal Bell"),
      settingsKey: "accessibility.signals.terminalBell",
    });
  }
  static {
    this.notebookCellCompleted = Lne.register({
      name: SI(1607, "Notebook Cell Completed"),
      sound: Ene.taskCompleted,
      legacySoundSettingsKey: "audioCues.notebookCellCompleted",
      legacyAnnouncementSettingsKey: "accessibility.alert.notebookCellCompleted",
      announcementMessage: SI(1608, "Notebook Cell Completed"),
      settingsKey: "accessibility.signals.notebookCellCompleted",
    });
  }
  static {
    this.notebookCellFailed = Lne.register({
      name: SI(1609, "Notebook Cell Failed"),
      sound: Ene.taskFailed,
      legacySoundSettingsKey: "audioCues.notebookCellFailed",
      legacyAnnouncementSettingsKey: "accessibility.alert.notebookCellFailed",
      announcementMessage: SI(1610, "Notebook Cell Failed"),
      settingsKey: "accessibility.signals.notebookCellFailed",
    });
  }
  static {
    this.diffLineInserted = Lne.register({
      name: SI(1611, "Diff Line Inserted"),
      sound: Ene.diffLineInserted,
      legacySoundSettingsKey: "audioCues.diffLineInserted",
      settingsKey: "accessibility.signals.diffLineInserted",
    });
  }
  static {
    this.diffLineDeleted = Lne.register({
      name: SI(1612, "Diff Line Deleted"),
      sound: Ene.diffLineDeleted,
      legacySoundSettingsKey: "audioCues.diffLineDeleted",
      settingsKey: "accessibility.signals.diffLineDeleted",
    });
  }
  static {
    this.diffLineModified = Lne.register({
      name: SI(1613, "Diff Line Modified"),
      sound: Ene.diffLineModified,
      legacySoundSettingsKey: "audioCues.diffLineModified",
      settingsKey: "accessibility.signals.diffLineModified",
    });
  }
  static {
    this.chatEditModifiedFile = Lne.register({
      name: SI(1614, "Chat Edit Modified File"),
      sound: Ene.chatEditModifiedFile,
      announcementMessage: SI(1615, "File Modified from Chat Edits"),
      settingsKey: "accessibility.signals.chatEditModifiedFile",
    });
  }
  static {
    this.chatRequestSent = Lne.register({
      name: SI(1616, "Chat Request Sent"),
      sound: Ene.requestSent,
      legacySoundSettingsKey: "audioCues.chatRequestSent",
      legacyAnnouncementSettingsKey: "accessibility.alert.chatRequestSent",
      announcementMessage: SI(1617, "Chat Request Sent"),
      settingsKey: "accessibility.signals.chatRequestSent",
    });
  }
  static {
    this.chatResponseReceived = Lne.register({
      name: SI(1618, "Chat Response Received"),
      legacySoundSettingsKey: "audioCues.chatResponseReceived",
      sound: {
        randomOneOf: [
          Ene.responseReceived1,
          Ene.responseReceived2,
          Ene.responseReceived3,
          Ene.responseReceived4,
        ],
      },
      settingsKey: "accessibility.signals.chatResponseReceived",
    });
  }
  static {
    this.codeActionTriggered = Lne.register({
      name: SI(1619, "Code Action Request Triggered"),
      sound: Ene.codeActionTriggered,
      legacySoundSettingsKey: "audioCues.codeActionRequestTriggered",
      legacyAnnouncementSettingsKey: "accessibility.alert.codeActionRequestTriggered",
      announcementMessage: SI(1620, "Code Action Request Triggered"),
      settingsKey: "accessibility.signals.codeActionTriggered",
    });
  }
  static {
    this.codeActionApplied = Lne.register({
      name: SI(1621, "Code Action Applied"),
      legacySoundSettingsKey: "audioCues.codeActionApplied",
      sound: Ene.codeActionApplied,
      settingsKey: "accessibility.signals.codeActionApplied",
    });
  }
  static {
    this.progress = Lne.register({
      name: SI(1622, "Progress"),
      sound: Ene.progress,
      legacySoundSettingsKey: "audioCues.chatResponsePending",
      legacyAnnouncementSettingsKey: "accessibility.alert.progress",
      announcementMessage: SI(1623, "Progress"),
      settingsKey: "accessibility.signals.progress",
    });
  }
  static {
    this.clear = Lne.register({
      name: SI(1624, "Clear"),
      sound: Ene.clear,
      legacySoundSettingsKey: "audioCues.clear",
      legacyAnnouncementSettingsKey: "accessibility.alert.clear",
      announcementMessage: SI(1625, "Clear"),
      settingsKey: "accessibility.signals.clear",
    });
  }
  static {
    this.save = Lne.register({
      name: SI(1626, "Save"),
      sound: Ene.save,
      legacySoundSettingsKey: "audioCues.save",
      legacyAnnouncementSettingsKey: "accessibility.alert.save",
      announcementMessage: SI(1627, "Save"),
      settingsKey: "accessibility.signals.save",
    });
  }
  static {
    this.format = Lne.register({
      name: SI(1628, "Format"),
      sound: Ene.format,
      legacySoundSettingsKey: "audioCues.format",
      legacyAnnouncementSettingsKey: "accessibility.alert.format",
      announcementMessage: SI(1629, "Format"),
      settingsKey: "accessibility.signals.format",
    });
  }
  static {
    this.voiceRecordingStarted = Lne.register({
      name: SI(1630, "Voice Recording Started"),
      sound: Ene.voiceRecordingStarted,
      legacySoundSettingsKey: "audioCues.voiceRecordingStarted",
      settingsKey: "accessibility.signals.voiceRecordingStarted",
    });
  }
  static {
    this.voiceRecordingStopped = Lne.register({
      name: SI(1631, "Voice Recording Stopped"),
      sound: Ene.voiceRecordingStopped,
      legacySoundSettingsKey: "audioCues.voiceRecordingStopped",
      settingsKey: "accessibility.signals.voiceRecordingStopped",
    });
  }
  static {
    this.editsKept = Lne.register({
      name: SI(1632, "Edits Kept"),
      sound: Ene.editsKept,
      announcementMessage: SI(1633, "Edits Kept"),
      settingsKey: "accessibility.signals.editsKept",
    });
  }
  static {
    this.editsUndone = Lne.register({
      name: SI(1634, "Undo Edits"),
      sound: Ene.editsUndone,
      announcementMessage: SI(1635, "Edits Undone"),
      settingsKey: "accessibility.signals.editsUndone",
    });
  }
  static {
    this.chatUserActionRequired = Lne.register({
      name: SI(1636, "Chat User Action Required"),
      sound: Ene.chatUserActionRequired,
      announcementMessage: SI(1637, "Chat User Action Required"),
      settingsKey: "accessibility.signals.chatUserActionRequired",
      managesOwnEnablement: !0,
    });
  }
}
function Dne(e, t, n, i = Tj.ofCaller()) {
  return pF(
    { debugName: () => `Configuration Key "${e}"` },
    (t) =>
      n.onDidChangeConfiguration((n) => {
        n.affectsConfiguration(e) && t(n);
      }),
    () => n.getValue(e) ?? t,
    i,
  );
}
function Tne(e, t, n, i = Tj.ofCaller()) {
  const r = e.bindTo(t),
    o = new AO();
  return (
    Jj(
      { debugName: () => `Set Context Key "${e.key}"` },
      (e) => {
        const t = n(e);
        return (r.set(t), t);
      },
      i,
    ).recomputeInitiallyAndOnChange(o),
    o
  );
}
const Ine = bV("progressService");
let Rne = class {
  static {
    this.None = Object.freeze({ report() {} });
  }
  constructor(e) {
    this.callback = e;
  }
  report(e) {
    ((this._value = e), this.callback(this._value));
  }
};
const One = bV("editorProgressService");
class Mne {
  static capture(e) {
    if (0 === e.getScrollTop() || e.hasPendingScrollAnimation())
      return new Mne(e.getScrollTop(), e.getContentHeight(), null, 0, null);
    let t = null,
      n = 0;
    const i = e.getVisibleRanges();
    if (i.length > 0) {
      t = i[0].getStartPosition();
      const r = e.getTopForPosition(t.lineNumber, t.column);
      n = e.getScrollTop() - r;
    }
    return new Mne(e.getScrollTop(), e.getContentHeight(), t, n, e.getPosition());
  }
  constructor(e, t, n, i, r) {
    ((this._initialScrollTop = e),
      (this._initialContentHeight = t),
      (this._visiblePosition = n),
      (this._visiblePositionScrollDelta = i),
      (this._cursorPosition = r));
  }
  restore(e) {
    if (
      (this._initialContentHeight !== e.getContentHeight() ||
        this._initialScrollTop !== e.getScrollTop()) &&
      this._visiblePosition
    ) {
      const t = e.getTopForPosition(this._visiblePosition.lineNumber, this._visiblePosition.column);
      e.setScrollTop(t + this._visiblePositionScrollDelta);
    }
  }
  restoreRelativeVerticalPositionOfCursor(e) {
    if (
      this._initialContentHeight === e.getContentHeight() &&
      this._initialScrollTop === e.getScrollTop()
    )
      return;
    const t = e.getPosition();
    if (!this._cursorPosition || !t) return;
    const n =
      e.getTopForLineNumber(t.lineNumber) - e.getTopForLineNumber(this._cursorPosition.lineNumber);
    e.setScrollTop(e.getScrollTop() + n, 1);
  }
}
const Ane = {
  RESOURCES: "ResourceURLs",
  TEXT: UU.text,
  INTERNAL_URI_LIST: "application/vnd.code.uri-list",
};
let Pne = () => ({
  get delay() {
    return -1;
  },
  dispose: () => {},
  showHover: () => {},
});
const jne = new FM(() => Pne("mouse", !1)),
  Fne = new FM(() => Pne("element", !1));
function Bne(e) {
  return "element" === e ? Fne.value : jne.value;
}
function Vne() {
  return Pne("element", !0);
}
function Wne(e, t) {
  if (void 0 !== e) {
    const n = e.match(/^\s*var\((.+)\)$/);
    if (n) {
      const e = n[1].split(",", 2);
      return (2 === e.length && (t = Wne(e[1].trim(), t)), `var(${e[0]}, ${t})`);
    }
    return e;
  }
  return t;
}
function Hne(e) {
  const t = e.replaceAll(/[^_\-a-z0-9]/gi, "");
  return t;
}
function zne(e) {
  return `'${e.replaceAll(/'/g, "\\000027")}'`;
}
function Une(e) {
  return e ? qne`url('${CSS.escape(RP.uriToBrowserUri(e).toString(!0))}')` : "url('')";
}
function $ne(e, t = !1) {
  const n = CSS.escape(e);
  return n;
}
function qne(e, ...t) {
  return e.reduce((e, n, i) => e + n + (t[i] || ""), "");
}
class Kne {
  constructor() {
    this._parts = [];
  }
  push(...e) {
    this._parts.push(...e);
  }
  join(e = "\n") {
    return this._parts.join(e);
  }
}
function Gne(e) {
  const t = (function (e) {
    if (((Zne = 0), Xne(e, Qne, 4352), Zne > 0)) return Yne.subarray(0, Zne);
    if ((Xne(e, Jne, 4449), Zne > 0)) return Yne.subarray(0, Zne);
    if ((Xne(e, eie, 4520), Zne > 0)) return Yne.subarray(0, Zne);
    if ((Xne(e, tie, 12593), Zne)) return Yne.subarray(0, Zne);
    if (e >= 44032 && e <= 55203) {
      const t = e - 44032,
        n = t % 588,
        i = Math.floor(t / 588),
        r = Math.floor(n / 28),
        o = (n % 28) - 1;
      if (
        (i < Qne.length
          ? Xne(i, Qne, 0)
          : 4352 + i - 12593 < tie.length && Xne(4352 + i, tie, 12593),
        r < Jne.length
          ? Xne(r, Jne, 0)
          : 4449 + r - 12593 < tie.length && Xne(4449 + r - 12593, tie, 12593),
        o >= 0 &&
          (o < eie.length
            ? Xne(o, eie, 0)
            : 4520 + o - 12593 < tie.length && Xne(4520 + o - 12593, tie, 12593)),
        Zne > 0)
      )
        return Yne.subarray(0, Zne);
    }
    return;
  })(e);
  if (t && t.length > 0) return new Uint32Array(t);
}
let Zne = 0;
const Yne = new Uint32Array(10);
function Xne(e, t, n) {
  e >= n &&
    e < n + t.length &&
    (function (e) {
      if (0 === e) return;
      ((Yne[Zne++] = 255 & e), e >> 8 && (Yne[Zne++] = (e >> 8) & 255));
      e >> 16 && (Yne[Zne++] = (e >> 16) & 255);
    })(t[e - n]);
}
const Qne = new Uint8Array([
    114, 82, 115, 101, 69, 102, 97, 113, 81, 116, 84, 100, 119, 87, 99, 122, 120, 118, 103,
  ]),
  Jne = new Uint16Array([
    107, 111, 105, 79, 106, 112, 117, 80, 104, 27496, 28520, 27752, 121, 110, 27246, 28782, 27758,
    98, 109, 27757, 108,
  ]),
  eie = 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,
  ]),
  tie = 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 nie(...e) {
  return function (t, n) {
    for (let i = 0, r = e.length; i < r; i++) {
      const r = e[i](t, n);
      if (r) return r;
    }
    return null;
  };
}
rie.bind(void 0, !1);
const iie = rie.bind(void 0, !0);
function rie(e, t, n) {
  if (!n || n.length < t.length) return null;
  let i;
  return (
    (i = e ? aA(n, t) : 0 === n.indexOf(t)),
    i ? (t.length > 0 ? [{ start: 0, end: t.length }] : []) : null
  );
}
function oie(e, t) {
  const n = t.toLowerCase().indexOf(e.toLowerCase());
  return -1 === n ? null : [{ start: n, end: n + e.length }];
}
function sie(e, t) {
  return aie(e.toLowerCase(), t.toLowerCase(), 0, 0);
}
function aie(e, t, n, i) {
  if (n === e.length) return [];
  if (i === t.length) return null;
  if (e[n] === t[i]) {
    let r = null;
    return (r = aie(e, t, n + 1, i + 1)) ? vie({ start: i, end: i + 1 }, r) : null;
  }
  return aie(e, t, n, i + 1);
}
function lie(e) {
  return 97 <= e && e <= 122;
}
function cie(e) {
  return 65 <= e && e <= 90;
}
function die(e) {
  return 48 <= e && e <= 57;
}
function uie(e) {
  return 32 === e || 9 === e || 10 === e || 13 === e;
}
const hie = new Set();
function gie(e) {
  return uie(e) || hie.has(e);
}
function pie(e, t) {
  return e === t || (gie(e) && gie(t));
}
"()[]{}<>`'\"-/;:,.?!".split("").forEach((e) => hie.add(e.charCodeAt(0)));
const fie = new Map();
function mie(e) {
  if (fie.has(e)) return fie.get(e);
  let t;
  const n = Gne(e);
  return (n && (t = n), fie.set(e, t), t);
}
function _ie(e) {
  return lie(e) || cie(e) || die(e);
}
function vie(e, t) {
  return (
    0 === t.length ? (t = [e]) : e.end === t[0].start ? (t[0].start = e.start) : t.unshift(e),
    t
  );
}
function bie(e, t) {
  for (let n = t; n < e.length; n++) {
    const t = e.charCodeAt(n);
    if (cie(t) || die(t) || (n > 0 && !_ie(e.charCodeAt(n - 1)))) return n;
  }
  return e.length;
}
function yie(e, t, n, i) {
  if (n === e.length) return [];
  if (i === t.length) return null;
  if (e[n] !== t[i].toLowerCase()) return null;
  {
    let r = null,
      o = i + 1;
    for (r = yie(e, t, n + 1, i + 1); !r && (o = bie(t, o)) < t.length; )
      ((r = yie(e, t, n + 1, o)), o++);
    return null === r ? null : vie({ start: i, end: i + 1 }, r);
  }
}
function xie(e, t) {
  if (!t) return null;
  if (0 === (t = t.trim()).length) return null;
  if (
    !(function (e) {
      let t = 0,
        n = 0,
        i = 0,
        r = 0;
      for (let o = 0; o < e.length; o++)
        ((i = e.charCodeAt(o)), cie(i) && t++, lie(i) && n++, uie(i) && r++);
      return (0 !== t && 0 !== n) || 0 !== r ? t <= 5 : e.length <= 30;
    })(e)
  )
    return null;
  t.length > 60 && (t = t.substring(0, 60));
  const n = (function (e) {
    let t = 0,
      n = 0,
      i = 0,
      r = 0,
      o = 0;
    for (let s = 0; s < e.length; s++)
      ((o = e.charCodeAt(s)), cie(o) && t++, lie(o) && n++, _ie(o) && i++, die(o) && r++);
    return {
      upperPercent: t / e.length,
      lowerPercent: n / e.length,
      alphaPercent: i / e.length,
      numericPercent: r / e.length,
    };
  })(t);
  if (
    !(function (e) {
      const { upperPercent: t, lowerPercent: n, alphaPercent: i, numericPercent: r } = e;
      return n > 0.2 && t < 0.8 && i > 0.6 && r < 0.2;
    })(n)
  ) {
    if (
      !(function (e) {
        const { upperPercent: t, lowerPercent: n } = e;
        return 0 === n && t > 0.6;
      })(n)
    )
      return null;
    t = t.toLowerCase();
  }
  let i = null,
    r = 0;
  for (e = e.toLowerCase(); r < t.length && null === (i = yie(e, t, 0, r)); ) r = bie(t, r + 1);
  return i;
}
function wie(e, t, n = !1) {
  if (!t || 0 === t.length) return null;
  let i = null,
    r = 0;
  for (
    e = e.toLowerCase(), t = t.toLowerCase();
    r < t.length && ((i = Cie(e, t, 0, r, n)), null === i);
  )
    r = Sie(t, r + 1);
  return i;
}
function Cie(e, t, n, i, r) {
  let o = 0;
  if (n === e.length) return [];
  if (i === t.length) return null;
  if (!pie(e.charCodeAt(n), t.charCodeAt(i))) {
    const r = mie(e.charCodeAt(n));
    if (!r) return null;
    for (let e = 0; e < r.length; e++) if (!pie(r[e], t.charCodeAt(i + e))) return null;
    o += r.length - 1;
  }
  let s = null,
    a = i + o + 1;
  if (((s = Cie(e, t, n + 1, a, r)), !r))
    for (; !s && (a = Sie(t, a)) < t.length; ) ((s = Cie(e, t, n + 1, a, r)), a++);
  if (!s) return null;
  if (e.charCodeAt(n) !== t.charCodeAt(i)) {
    const r = mie(e.charCodeAt(n));
    if (!r) return s;
    for (let e = 0; e < r.length; e++) if (r[e] !== t.charCodeAt(i + e)) return s;
  }
  return vie({ start: i, end: i + o + 1 }, s);
}
function Sie(e, t) {
  for (let n = t; n < e.length; n++)
    if (gie(e.charCodeAt(n)) || (n > 0 && gie(e.charCodeAt(n - 1)))) return n;
  return e.length;
}
const kie = nie(iie, xie, oie),
  Eie = nie(iie, xie, sie),
  Nie = new XW(1e4);
function Lie(e, t, n = !1) {
  if ("string" != typeof e || "string" != typeof t) return null;
  let i = Nie.get(e);
  i ||
    ((i = new RegExp(
      e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, "\\$&").replace(/[\*]/g, ".*"),
      "i",
    )),
    Nie.set(e, i));
  const r = i.exec(t);
  return r ? [{ start: r.index, end: r.index + r[0].length }] : n ? Eie(e, t) : kie(e, t);
}
function Die(e, t) {
  const n = $ie(e, e.toLowerCase(), 0, t, t.toLowerCase(), 0, {
    firstMatchCanBeWeak: !0,
    boostFullMatch: !0,
  });
  return n ? Iie(n) : null;
}
function Tie(e, t, n, i, r, o) {
  const s = Math.min(13, e.length);
  for (; n < s; n++) {
    const s = $ie(e, t, n, i, r, o, { firstMatchCanBeWeak: !0, boostFullMatch: !0 });
    if (s) return s;
  }
  return [0, o];
}
function Iie(e) {
  if (void 0 === e) return [];
  const t = [],
    n = e[1];
  for (let i = e.length - 1; i > 1; i--) {
    const r = e[i] + n,
      o = t[t.length - 1];
    o && o.end === r ? (o.end = r + 1) : t.push({ start: r, end: r + 1 });
  }
  return t;
}
const Rie = 128;
function Oie() {
  const e = [],
    t = [];
  for (let n = 0; n <= Rie; n++) t[n] = 0;
  for (let n = 0; n <= Rie; n++) e.push(t.slice(0));
  return e;
}
function Mie(e) {
  const t = [];
  for (let n = 0; n <= e; n++) t[n] = 0;
  return t;
}
const Aie = Mie(2 * Rie),
  Pie = Mie(2 * Rie),
  jie = Oie(),
  Fie = Oie(),
  Bie = Oie();
function Vie(e, t) {
  if (t < 0 || t >= e.length) return !1;
  const n = e.codePointAt(t);
  switch (n) {
    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 !0;
    case void 0:
      return !1;
    default:
      return !!EA(n);
  }
}
function Wie(e, t) {
  if (t < 0 || t >= e.length) return !1;
  switch (e.charCodeAt(t)) {
    case 32:
    case 9:
      return !0;
    default:
      return !1;
  }
}
function Hie(e, t, n) {
  return t[e] !== n[e];
}
var zie;
!(function (e) {
  ((e.Default = [-100, 0]),
    (e.isDefault = function (e) {
      return !e || (2 === e.length && -100 === e[0] && 0 === e[1]);
    }));
})(zie || (zie = {}));
class Uie {
  static {
    this.default = { boostFullMatch: !0, firstMatchCanBeWeak: !1 };
  }
  constructor(e, t) {
    ((this.firstMatchCanBeWeak = e), (this.boostFullMatch = t));
  }
}
function $ie(e, t, n, i, r, o, s = Uie.default) {
  const a = e.length > Rie ? Rie : e.length,
    l = i.length > Rie ? Rie : i.length;
  if (n >= a || o >= l || a - n > l - o) return;
  if (
    !(function (e, t, n, i, r, o, s = !1) {
      for (; t < n && r < o; ) (e[t] === i[r] && (s && (Aie[t] = r), (t += 1)), (r += 1));
      return t === n;
    })(t, n, a, r, o, l, !0)
  )
    return;
  !(function (e, t, n, i, r, o) {
    let s = e - 1,
      a = t - 1;
    for (; s >= n && a >= i; ) (r[s] === o[a] && ((Pie[s] = a), s--), a--);
  })(a, l, n, o, t, r);
  let c = 1,
    d = 1,
    u = n,
    h = o;
  const g = [!1];
  for (c = 1, u = n; u < a; c++, u++) {
    const s = Aie[u],
      p = Pie[u],
      f = u + 1 < a ? Pie[u + 1] : l;
    for (d = s - o + 1, h = s; h < f; d++, h++) {
      let a = Number.MIN_SAFE_INTEGER,
        f = !1;
      h <= p && (a = qie(e, t, u, n, i, r, h, l, o, 0 === jie[c - 1][d - 1], g));
      let m = 0;
      a !== Number.MIN_SAFE_INTEGER && ((f = !0), (m = a + Fie[c - 1][d - 1]));
      const _ = h > s,
        v = _ ? Fie[c][d - 1] + (jie[c][d - 1] > 0 ? -5 : 0) : 0,
        b = h > s + 1 && jie[c][d - 1] > 0,
        y = b ? Fie[c][d - 2] + (jie[c][d - 2] > 0 ? -5 : 0) : 0;
      if (b && (!_ || y >= v) && (!f || y >= m))
        ((Fie[c][d] = y), (Bie[c][d] = 3), (jie[c][d] = 0));
      else if (_ && (!f || v >= m)) ((Fie[c][d] = v), (Bie[c][d] = 2), (jie[c][d] = 0));
      else {
        if (!f) throw new Error("not possible");
        ((Fie[c][d] = m), (Bie[c][d] = 1), (jie[c][d] = jie[c - 1][d - 1] + 1));
      }
    }
  }
  if (!g[0] && !s.firstMatchCanBeWeak) return;
  (c--, d--);
  const p = [Fie[c][d], o];
  let f = 0,
    m = 0;
  for (; c >= 1; ) {
    let e = d;
    do {
      const t = Bie[c][e];
      if (3 === t) e -= 2;
      else {
        if (2 !== t) break;
        e -= 1;
      }
    } while (e >= 1);
    (f > 1 &&
      t[n + c - 1] === r[o + d - 1] &&
      !Hie(e + o - 1, i, r) &&
      f + 1 > jie[c][e] &&
      (e = d),
      e === d ? f++ : (f = 1),
      m || (m = e),
      c--,
      (d = e - 1),
      p.push(d));
  }
  l - o === a && s.boostFullMatch && (p[0] += 2);
  const _ = m - a;
  return ((p[0] -= _), p);
}
function qie(e, t, n, i, r, o, s, a, l, c, d) {
  if (t[n] !== o[s]) return Number.MIN_SAFE_INTEGER;
  let u = 1,
    h = !1;
  return (
    s === n - i
      ? (u = e[n] === r[s] ? 7 : 5)
      : !Hie(s, r, o) || (0 !== s && Hie(s - 1, r, o))
        ? !Vie(o, s) || (0 !== s && Vie(o, s - 1))
          ? (Vie(o, s - 1) || Wie(o, s - 1)) && ((u = 5), (h = !0))
          : (u = 5)
        : ((u = e[n] === r[s] ? 7 : 5), (h = !0)),
    u > 1 && n === i && (d[0] = !0),
    h || (h = Hie(s, r, o) || Vie(o, s - 1) || Wie(o, s - 1)),
    n === i ? s > l && (u -= h ? 3 : 5) : (u += c ? (h ? 2 : 0) : h ? 0 : 1),
    s + 1 === a && (u -= h ? 3 : 5),
    u
  );
}
function Kie(e, t, n, i, r, o, s) {
  return (function (e, t, n, i, r, o, s, a) {
    let l = $ie(e, t, n, i, r, o, a);
    0;
    if (e.length >= 3) {
      const t = Math.min(7, e.length - 1);
      for (let s = n + 1; s < t; s++) {
        const t = Gie(e, s);
        if (t) {
          const e = $ie(t, t.toLowerCase(), n, i, r, o, a);
          e && ((e[0] -= 3), (!l || e[0] > l[0]) && (l = e));
        }
      }
    }
    return l;
  })(e, t, n, i, r, o, 0, s);
}
function Gie(e, t) {
  if (t + 1 >= e.length) return;
  const n = e[t],
    i = e[t + 1];
  return n !== i ? e.slice(0, t) + i + n + e.slice(t + 2) : void 0;
}
const Zie = new RegExp(`\\$\\(${AV.iconNameExpression}(?:${AV.iconModifierExpression})?\\)`, "g"),
  Yie = new RegExp(`(\\\\)?${Zie.source}`, "g");
const Xie = new RegExp(`\\\\${Zie.source}`, "g");
const Qie = new RegExp(`(\\s)?(\\\\)?${Zie.source}(\\s)?`, "g");
function Jie(e) {
  return -1 === e.indexOf("$(") ? e : e.replace(Qie, (e, t, n, i) => (n ? e : t || i || ""));
}
function ere(e) {
  return e ? e.replace(/\$\((.*?)\)/g, (e, t) => ` ${t} `).trim() : "";
}
const tre = new RegExp(`\\$\\(${AV.iconNameCharacter}+\\)`, "g");
function nre(e) {
  tre.lastIndex = 0;
  let t = "";
  const n = [];
  let i = 0;
  for (;;) {
    const r = tre.lastIndex,
      o = tre.exec(e),
      s = e.substring(r, o?.index);
    if (s.length > 0) {
      t += s;
      for (let e = 0; e < s.length; e++) n.push(i);
    }
    if (!o) break;
    i += o[0].length;
  }
  return { text: t, iconOffsets: n };
}
function ire(e, t, n = !1) {
  const { text: i, iconOffsets: r } = t;
  if (!r || 0 === r.length) return Lie(e, i, n);
  const o = $M(i, " "),
    s = i.length - o.length,
    a = Lie(e, o, n);
  if (a)
    for (const l of a) {
      const e = r[l.start + s] + s;
      ((l.start += e), (l.end += e));
    }
  return a;
}
class rre {
  constructor(e = "", t = !1) {
    if (((this.value = e), "string" != typeof this.value)) throw GI("value");
    "boolean" == typeof t
      ? ((this.isTrusted = t),
        (this.supportThemeIcons = !1),
        (this.supportHtml = !1),
        (this.supportAlertSyntax = !1))
      : ((this.isTrusted = t.isTrusted ?? void 0),
        (this.supportThemeIcons = t.supportThemeIcons ?? !1),
        (this.supportHtml = t.supportHtml ?? !1),
        (this.supportAlertSyntax = t.supportAlertSyntax ?? !1));
  }
  appendText(e, t = 0) {
    return (
      (this.value += (function (e) {
        return e.replace(/[\\`*_{}[\]()#+\-!~]/g, "\\$&");
      })(
        this.supportThemeIcons
          ? (function (e) {
              return e.replace(Yie, (e, t) => (t ? e : `\\${e}`));
            })(e)
          : e,
      )
        .replace(/([ \t]+)/g, (e, t) => "&nbsp;".repeat(t.length))
        .replace(/\>/gm, "\\>")
        .replace(/\n/g, 1 === t ? "\\\n" : "\n\n")),
      this
    );
  }
  appendMarkdown(e) {
    return ((this.value += e), this);
  }
  appendCodeblock(e, t) {
    return (
      (this.value += `\n${(function (e, t) {
        const n = e.match(/^`+/gm)?.reduce((e, t) => (e.length > t.length ? e : t)).length ?? 0,
          i = n >= 3 ? n + 1 : 3;
        return [`${"`".repeat(i)}${t}`, e, `${"`".repeat(i)}`].join("\n");
      })(t, e)}\n`),
      this
    );
  }
  appendLink(e, t, n) {
    return (
      (this.value += "["),
      (this.value += this._escape(t, "]")),
      (this.value += "]("),
      (this.value += this._escape(String(e), ")")),
      n && (this.value += ` "${this._escape(this._escape(n, '"'), ")")}"`),
      (this.value += ")"),
      this
    );
  }
  _escape(e, t) {
    const n = new RegExp(zM(t), "g");
    return e.replace(n, (t, n) => ("\\" !== e.charAt(n - 1) ? `\\${t}` : t));
  }
}
function ore(e) {
  return sre(e) ? !e.value : !Array.isArray(e) || e.every(ore);
}
function sre(e) {
  return (
    e instanceof rre ||
    (!(!e || "object" != typeof e) &&
      !(
        "string" != typeof e.value ||
        ("boolean" != typeof e.isTrusted &&
          "object" != typeof e.isTrusted &&
          void 0 !== e.isTrusted) ||
        ("boolean" != typeof e.supportThemeIcons && void 0 !== e.supportThemeIcons) ||
        ("boolean" != typeof e.supportAlertSyntax && void 0 !== e.supportAlertSyntax)
      ))
  );
}
function are(e) {
  return e.replace(/"/g, "&quot;");
}
function lre(e) {
  return e ? e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g, "$1") : e;
}
function cre(e, ...t) {
  return mP.from({
    scheme: NP.command,
    path: e,
    query: t.length ? encodeURIComponent(JSON.stringify(t)) : void 0,
  });
}
class dre {
  constructor(e) {
    ((this._prefix = e), (this._lastId = 0));
  }
  nextId() {
    return this._prefix + ++this._lastId;
  }
}
const ure = new dre("id#");
function hre() {
  return {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null,
  };
}
let gre = {
  async: !1,
  breaks: !1,
  extensions: null,
  gfm: !0,
  hooks: null,
  pedantic: !1,
  renderer: null,
  silent: !1,
  tokenizer: null,
  walkTokens: null,
};
function pre(e) {
  gre = e;
}
const fre = /[&<>"']/,
  mre = new RegExp(fre.source, "g"),
  _re = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
  vre = new RegExp(_re.source, "g"),
  bre = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" },
  yre = (e) => bre[e];
function xre(e, t) {
  if (t) {
    if (fre.test(e)) return e.replace(mre, yre);
  } else if (_re.test(e)) return e.replace(vre, yre);
  return e;
}
const wre = /(^|[^\[])\^/g;
function Cre(e, t) {
  let n = "string" == typeof e ? e : e.source;
  t = t || "";
  const i = {
    replace: (e, t) => {
      let r = "string" == typeof t ? t : t.source;
      return ((r = r.replace(wre, "$1")), (n = n.replace(e, r)), i);
    },
    getRegex: () => new RegExp(n, t),
  };
  return i;
}
function Sre(e) {
  try {
    e = encodeURI(e).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return e;
}
const kre = { exec: () => null };
function Ere(e, t) {
  const n = e.replace(/\|/g, (e, t, n) => {
      let i = !1,
        r = t;
      for (; --r >= 0 && "\\" === n[r]; ) i = !i;
      return i ? "|" : " |";
    }),
    i = n.split(/ \|/);
  let r = 0;
  if ((i[0].trim() || i.shift(), i.length > 0 && !i[i.length - 1].trim() && i.pop(), t))
    if (i.length > t) i.splice(t);
    else for (; i.length < t; ) i.push("");
  for (; r < i.length; r++) i[r] = i[r].trim().replace(/\\\|/g, "|");
  return i;
}
function Nre(e, t, n) {
  const i = e.length;
  if (0 === i) return "";
  let r = 0;
  for (; r < i; ) {
    if (e.charAt(i - r - 1) !== t) break;
    r++;
  }
  return e.slice(0, i - r);
}
function Lre(e, t, n, i) {
  const r = t.href,
    o = t.title ? xre(t.title) : null,
    s = e[1].replace(/\\([\[\]])/g, "$1");
  if ("!" !== e[0].charAt(0)) {
    i.state.inLink = !0;
    const e = { type: "link", raw: n, href: r, title: o, text: s, tokens: i.inlineTokens(s) };
    return ((i.state.inLink = !1), e);
  }
  return { type: "image", raw: n, href: r, title: o, text: xre(s) };
}
let Dre = class {
  options;
  rules;
  lexer;
  constructor(e) {
    this.options = e || gre;
  }
  space(e) {
    const t = this.rules.block.newline.exec(e);
    if (t && t[0].length > 0) return { type: "space", raw: t[0] };
  }
  code(e) {
    const t = this.rules.block.code.exec(e);
    if (t) {
      const e = t[0].replace(/^ {1,4}/gm, "");
      return {
        type: "code",
        raw: t[0],
        codeBlockStyle: "indented",
        text: this.options.pedantic ? e : Nre(e, "\n"),
      };
    }
  }
  fences(e) {
    const t = this.rules.block.fences.exec(e);
    if (t) {
      const e = t[0],
        n = (function (e, t) {
          const n = e.match(/^(\s+)(?:```)/);
          if (null === n) return t;
          const i = n[1];
          return t
            .split("\n")
            .map((e) => {
              const t = e.match(/^\s+/);
              if (null === t) return e;
              const [n] = t;
              return n.length >= i.length ? e.slice(i.length) : e;
            })
            .join("\n");
        })(e, t[3] || "");
      return {
        type: "code",
        raw: e,
        lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
        text: n,
      };
    }
  }
  heading(e) {
    const t = this.rules.block.heading.exec(e);
    if (t) {
      let e = t[2].trim();
      if (/#$/.test(e)) {
        const t = Nre(e, "#");
        this.options.pedantic ? (e = t.trim()) : (t && !/ $/.test(t)) || (e = t.trim());
      }
      return {
        type: "heading",
        raw: t[0],
        depth: t[1].length,
        text: e,
        tokens: this.lexer.inline(e),
      };
    }
  }
  hr(e) {
    const t = this.rules.block.hr.exec(e);
    if (t) return { type: "hr", raw: Nre(t[0], "\n") };
  }
  blockquote(e) {
    const t = this.rules.block.blockquote.exec(e);
    if (t) {
      let e = Nre(t[0], "\n").split("\n"),
        n = "",
        i = "";
      const r = [];
      for (; e.length > 0; ) {
        let t = !1;
        const o = [];
        let s;
        for (s = 0; s < e.length; s++)
          if (/^ {0,3}>/.test(e[s])) (o.push(e[s]), (t = !0));
          else {
            if (t) break;
            o.push(e[s]);
          }
        e = e.slice(s);
        const a = o.join("\n"),
          l = a
            .replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, "\n    $1")
            .replace(/^ {0,3}>[ \t]?/gm, "");
        ((n = n ? `${n}\n${a}` : a), (i = i ? `${i}\n${l}` : l));
        const c = this.lexer.state.top;
        if (
          ((this.lexer.state.top = !0),
          this.lexer.blockTokens(l, r, !0),
          (this.lexer.state.top = c),
          0 === e.length)
        )
          break;
        const d = r[r.length - 1];
        if ("code" === d?.type) break;
        if ("blockquote" === d?.type) {
          const t = d,
            o = t.raw + "\n" + e.join("\n"),
            s = this.blockquote(o);
          ((r[r.length - 1] = s),
            (n = n.substring(0, n.length - t.raw.length) + s.raw),
            (i = i.substring(0, i.length - t.text.length) + s.text));
          break;
        }
        if ("list" === d?.type) {
          const t = d,
            o = t.raw + "\n" + e.join("\n"),
            s = this.list(o);
          ((r[r.length - 1] = s),
            (n = n.substring(0, n.length - d.raw.length) + s.raw),
            (i = i.substring(0, i.length - t.raw.length) + s.raw),
            (e = o.substring(r[r.length - 1].raw.length).split("\n")));
          continue;
        }
      }
      return { type: "blockquote", raw: n, tokens: r, text: i };
    }
  }
  list(e) {
    let t = this.rules.block.list.exec(e);
    if (t) {
      let n = t[1].trim();
      const i = n.length > 1,
        r = {
          type: "list",
          raw: "",
          ordered: i,
          start: i ? +n.slice(0, -1) : "",
          loose: !1,
          items: [],
        };
      ((n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`),
        this.options.pedantic && (n = i ? n : "[*+-]"));
      const o = new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);
      let s = !1;
      for (; e; ) {
        let n = !1,
          i = "",
          a = "";
        if (!(t = o.exec(e))) break;
        if (this.rules.block.hr.test(e)) break;
        ((i = t[0]), (e = e.substring(i.length)));
        let l = t[2].split("\n", 1)[0].replace(/^\t+/, (e) => " ".repeat(3 * e.length)),
          c = e.split("\n", 1)[0],
          d = !l.trim(),
          u = 0;
        if (
          (this.options.pedantic
            ? ((u = 2), (a = l.trimStart()))
            : d
              ? (u = t[1].length + 1)
              : ((u = t[2].search(/[^ ]/)),
                (u = u > 4 ? 1 : u),
                (a = l.slice(u)),
                (u += t[1].length)),
          d && /^ *$/.test(c) && ((i += c + "\n"), (e = e.substring(c.length + 1)), (n = !0)),
          !n)
        ) {
          const t = new RegExp(
              `^ {0,${Math.min(3, u - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`,
            ),
            n = new RegExp(
              `^ {0,${Math.min(3, u - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`,
            ),
            r = new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:\`\`\`|~~~)`),
            o = new RegExp(`^ {0,${Math.min(3, u - 1)}}#`);
          for (; e; ) {
            const s = e.split("\n", 1)[0];
            if (
              ((c = s),
              this.options.pedantic && (c = c.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")),
              r.test(c))
            )
              break;
            if (o.test(c)) break;
            if (t.test(c)) break;
            if (n.test(e)) break;
            if (c.search(/[^ ]/) >= u || !c.trim()) a += "\n" + c.slice(u);
            else {
              if (d) break;
              if (l.search(/[^ ]/) >= 4) break;
              if (r.test(l)) break;
              if (o.test(l)) break;
              if (n.test(l)) break;
              a += "\n" + c;
            }
            (d || c.trim() || (d = !0),
              (i += s + "\n"),
              (e = e.substring(s.length + 1)),
              (l = c.slice(u)));
          }
        }
        r.loose || (s ? (r.loose = !0) : /\n *\n *$/.test(i) && (s = !0));
        let h,
          g = null;
        (this.options.gfm &&
          ((g = /^\[[ xX]\] /.exec(a)),
          g && ((h = "[ ] " !== g[0]), (a = a.replace(/^\[[ xX]\] +/, "")))),
          r.items.push({
            type: "list_item",
            raw: i,
            task: !!g,
            checked: h,
            loose: !1,
            text: a,
            tokens: [],
          }),
          (r.raw += i));
      }
      ((r.items[r.items.length - 1].raw = r.items[r.items.length - 1].raw.trimEnd()),
        (r.items[r.items.length - 1].text = r.items[r.items.length - 1].text.trimEnd()),
        (r.raw = r.raw.trimEnd()));
      for (let e = 0; e < r.items.length; e++)
        if (
          ((this.lexer.state.top = !1),
          (r.items[e].tokens = this.lexer.blockTokens(r.items[e].text, [])),
          !r.loose)
        ) {
          const t = r.items[e].tokens.filter((e) => "space" === e.type),
            n = t.length > 0 && t.some((e) => /\n.*\n/.test(e.raw));
          r.loose = n;
        }
      if (r.loose) for (let e = 0; e < r.items.length; e++) r.items[e].loose = !0;
      return r;
    }
  }
  html(e) {
    const t = this.rules.block.html.exec(e);
    if (t) {
      return {
        type: "html",
        block: !0,
        raw: t[0],
        pre: "pre" === t[1] || "script" === t[1] || "style" === t[1],
        text: t[0],
      };
    }
  }
  def(e) {
    const t = this.rules.block.def.exec(e);
    if (t) {
      const e = t[1].toLowerCase().replace(/\s+/g, " "),
        n = t[2]
          ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1")
          : "",
        i = t[3]
          ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1")
          : t[3];
      return { type: "def", tag: e, raw: t[0], href: n, title: i };
    }
  }
  table(e) {
    const t = this.rules.block.table.exec(e);
    if (!t) return;
    if (!/[:|]/.test(t[2])) return;
    const n = Ere(t[1]),
      i = t[2].replace(/^\||\| *$/g, "").split("|"),
      r = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split("\n") : [],
      o = { type: "table", raw: t[0], header: [], align: [], rows: [] };
    if (n.length === i.length) {
      for (const e of i)
        /^ *-+: *$/.test(e)
          ? o.align.push("right")
          : /^ *:-+: *$/.test(e)
            ? o.align.push("center")
            : /^ *:-+ *$/.test(e)
              ? o.align.push("left")
              : o.align.push(null);
      for (let e = 0; e < n.length; e++)
        o.header.push({
          text: n[e],
          tokens: this.lexer.inline(n[e]),
          header: !0,
          align: o.align[e],
        });
      for (const e of r)
        o.rows.push(
          Ere(e, o.header.length).map((e, t) => ({
            text: e,
            tokens: this.lexer.inline(e),
            header: !1,
            align: o.align[t],
          })),
        );
      return o;
    }
  }
  lheading(e) {
    const t = this.rules.block.lheading.exec(e);
    if (t)
      return {
        type: "heading",
        raw: t[0],
        depth: "=" === t[2].charAt(0) ? 1 : 2,
        text: t[1],
        tokens: this.lexer.inline(t[1]),
      };
  }
  paragraph(e) {
    const t = this.rules.block.paragraph.exec(e);
    if (t) {
      const e = "\n" === t[1].charAt(t[1].length - 1) ? t[1].slice(0, -1) : t[1];
      return { type: "paragraph", raw: t[0], text: e, tokens: this.lexer.inline(e) };
    }
  }
  text(e) {
    const t = this.rules.block.text.exec(e);
    if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
  }
  escape(e) {
    const t = this.rules.inline.escape.exec(e);
    if (t) return { type: "escape", raw: t[0], text: xre(t[1]) };
  }
  tag(e) {
    const t = this.rules.inline.tag.exec(e);
    if (t)
      return (
        !this.lexer.state.inLink && /^<a /i.test(t[0])
          ? (this.lexer.state.inLink = !0)
          : this.lexer.state.inLink && /^<\/a>/i.test(t[0]) && (this.lexer.state.inLink = !1),
        !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0])
          ? (this.lexer.state.inRawBlock = !0)
          : this.lexer.state.inRawBlock &&
            /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) &&
            (this.lexer.state.inRawBlock = !1),
        {
          type: "html",
          raw: t[0],
          inLink: this.lexer.state.inLink,
          inRawBlock: this.lexer.state.inRawBlock,
          block: !1,
          text: t[0],
        }
      );
  }
  link(e) {
    const t = this.rules.inline.link.exec(e);
    if (t) {
      const e = t[2].trim();
      if (!this.options.pedantic && /^</.test(e)) {
        if (!/>$/.test(e)) return;
        const t = Nre(e.slice(0, -1), "\\");
        if ((e.length - t.length) % 2 == 0) return;
      } else {
        const e = (function (e, t) {
          if (-1 === e.indexOf(t[1])) return -1;
          let n = 0;
          for (let i = 0; i < e.length; i++)
            if ("\\" === e[i]) i++;
            else if (e[i] === t[0]) n++;
            else if (e[i] === t[1] && (n--, n < 0)) return i;
          return -1;
        })(t[2], "()");
        if (e > -1) {
          const n = (0 === t[0].indexOf("!") ? 5 : 4) + t[1].length + e;
          ((t[2] = t[2].substring(0, e)), (t[0] = t[0].substring(0, n).trim()), (t[3] = ""));
        }
      }
      let n = t[2],
        i = "";
      if (this.options.pedantic) {
        const e = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);
        e && ((n = e[1]), (i = e[3]));
      } else i = t[3] ? t[3].slice(1, -1) : "";
      return (
        (n = n.trim()),
        /^</.test(n) && (n = this.options.pedantic && !/>$/.test(e) ? n.slice(1) : n.slice(1, -1)),
        Lre(
          t,
          {
            href: n ? n.replace(this.rules.inline.anyPunctuation, "$1") : n,
            title: i ? i.replace(this.rules.inline.anyPunctuation, "$1") : i,
          },
          t[0],
          this.lexer,
        )
      );
    }
  }
  reflink(e, t) {
    let n;
    if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
      const e = t[(n[2] || n[1]).replace(/\s+/g, " ").toLowerCase()];
      if (!e) {
        const e = n[0].charAt(0);
        return { type: "text", raw: e, text: e };
      }
      return Lre(n, e, n[0], this.lexer);
    }
  }
  emStrong(e, t, n = "") {
    let i = this.rules.inline.emStrongLDelim.exec(e);
    if (!i) return;
    if (i[3] && n.match(/[\p{L}\p{N}]/u)) return;
    if (!(i[1] || i[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
      const n = [...i[0]].length - 1;
      let r,
        o,
        s = n,
        a = 0;
      const l =
        "*" === i[0][0] ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (l.lastIndex = 0, t = t.slice(-1 * e.length + n); null != (i = l.exec(t)); ) {
        if (((r = i[1] || i[2] || i[3] || i[4] || i[5] || i[6]), !r)) continue;
        if (((o = [...r].length), i[3] || i[4])) {
          s += o;
          continue;
        }
        if ((i[5] || i[6]) && n % 3 && !((n + o) % 3)) {
          a += o;
          continue;
        }
        if (((s -= o), s > 0)) continue;
        o = Math.min(o, o + s + a);
        const t = [...i[0]][0].length,
          l = e.slice(0, n + i.index + t + o);
        if (Math.min(n, o) % 2) {
          const e = l.slice(1, -1);
          return { type: "em", raw: l, text: e, tokens: this.lexer.inlineTokens(e) };
        }
        const c = l.slice(2, -2);
        return { type: "strong", raw: l, text: c, tokens: this.lexer.inlineTokens(c) };
      }
    }
  }
  codespan(e) {
    const t = this.rules.inline.code.exec(e);
    if (t) {
      let e = t[2].replace(/\n/g, " ");
      const n = /[^ ]/.test(e),
        i = /^ /.test(e) && / $/.test(e);
      return (
        n && i && (e = e.substring(1, e.length - 1)),
        (e = xre(e, !0)),
        { type: "codespan", raw: t[0], text: e }
      );
    }
  }
  br(e) {
    const t = this.rules.inline.br.exec(e);
    if (t) return { type: "br", raw: t[0] };
  }
  del(e) {
    const t = this.rules.inline.del.exec(e);
    if (t) return { type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2]) };
  }
  autolink(e) {
    const t = this.rules.inline.autolink.exec(e);
    if (t) {
      let e, n;
      return (
        "@" === t[2] ? ((e = xre(t[1])), (n = "mailto:" + e)) : ((e = xre(t[1])), (n = e)),
        { type: "link", raw: t[0], text: e, href: n, tokens: [{ type: "text", raw: e, text: e }] }
      );
    }
  }
  url(e) {
    let t;
    if ((t = this.rules.inline.url.exec(e))) {
      let e, n;
      if ("@" === t[2]) ((e = xre(t[0])), (n = "mailto:" + e));
      else {
        let i;
        do {
          ((i = t[0]), (t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? ""));
        } while (i !== t[0]);
        ((e = xre(t[0])), (n = "www." === t[1] ? "http://" + t[0] : t[0]));
      }
      return {
        type: "link",
        raw: t[0],
        text: e,
        href: n,
        tokens: [{ type: "text", raw: e, text: e }],
      };
    }
  }
  inlineText(e) {
    const t = this.rules.inline.text.exec(e);
    if (t) {
      let e;
      return (
        (e = this.lexer.state.inRawBlock ? t[0] : xre(t[0])),
        { type: "text", raw: t[0], text: e }
      );
    }
  }
};
const Tre = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
  Ire = /(?:[*+-]|\d{1,9}[.)])/,
  Rre = Cre(
    /^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
  )
    .replace(/bull/g, Ire)
    .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(),
  Ore = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
  Mre = /(?!\s*\])(?:\\.|[^\[\]\\])+/,
  Are = Cre(
    /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
  )
    .replace("label", Mre)
    .replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/)
    .getRegex(),
  Pre = Cre(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/)
    .replace(/bull/g, Ire)
    .getRegex(),
  jre =
    "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",
  Fre = /<!--(?:-?>|[\s\S]*?(?:-->|$))/,
  Bre = Cre(
    "^ {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", Fre)
    .replace("tag", jre)
    .replace(
      "attribute",
      / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/,
    )
    .getRegex(),
  Vre = Cre(Ore)
    .replace("hr", Tre)
    .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", jre)
    .getRegex(),
  Wre = {
    blockquote: Cre(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/)
      .replace("paragraph", Vre)
      .getRegex(),
    code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
    def: Are,
    fences:
      /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
    heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
    hr: Tre,
    html: Bre,
    lheading: Rre,
    list: Pre,
    newline: /^(?: *(?:\n|$))+/,
    paragraph: Vre,
    table: kre,
    text: /^[^\n]+/,
  },
  Hre = Cre(
    "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",
  )
    .replace("hr", Tre)
    .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", jre)
    .getRegex(),
  zre = {
    ...Wre,
    table: Hre,
    paragraph: Cre(Ore)
      .replace("hr", Tre)
      .replace("heading", " {0,3}#{1,6}(?:\\s|$)")
      .replace("|lheading", "")
      .replace("table", Hre)
      .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", jre)
      .getRegex(),
  },
  Ure = {
    ...Wre,
    html: Cre(
      "^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))",
    )
      .replace("comment", Fre)
      .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: kre,
    lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
    paragraph: Cre(Ore)
      .replace("hr", Tre)
      .replace("heading", " *#{1,6} *[^\n]")
      .replace("lheading", Rre)
      .replace("|table", "")
      .replace("blockquote", " {0,3}>")
      .replace("|fences", "")
      .replace("|list", "")
      .replace("|html", "")
      .replace("|tag", "")
      .getRegex(),
  },
  $re = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
  qre = /^( {2,}|\\)\n(?!\s*$)/,
  Kre = "\\p{P}\\p{S}",
  Gre = Cre(/^((?![*_])[\spunctuation])/, "u")
    .replace(/punctuation/g, Kre)
    .getRegex(),
  Zre = Cre(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u")
    .replace(/punct/g, Kre)
    .getRegex(),
  Yre = Cre(
    "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])",
    "gu",
  )
    .replace(/punct/g, Kre)
    .getRegex(),
  Xre = Cre(
    "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])",
    "gu",
  )
    .replace(/punct/g, Kre)
    .getRegex(),
  Qre = Cre(/\\([punct])/, "gu")
    .replace(/punct/g, Kre)
    .getRegex(),
  Jre = Cre(/^<(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(),
  eoe = Cre(Fre).replace("(?:--\x3e|$)", "--\x3e").getRegex(),
  toe = Cre(
    "^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", eoe)
    .replace(
      "attribute",
      /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,
    )
    .getRegex(),
  noe = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,
  ioe = Cre(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/)
    .replace("label", noe)
    .replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/)
    .replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/)
    .getRegex(),
  roe = Cre(/^!?\[(label)\]\[(ref)\]/)
    .replace("label", noe)
    .replace("ref", Mre)
    .getRegex(),
  ooe = Cre(/^!?\[(ref)\](?:\[\])?/)
    .replace("ref", Mre)
    .getRegex(),
  soe = {
    _backpedal: kre,
    anyPunctuation: Qre,
    autolink: Jre,
    blockSkip: /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,
    br: qre,
    code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
    del: kre,
    emStrongLDelim: Zre,
    emStrongRDelimAst: Yre,
    emStrongRDelimUnd: Xre,
    escape: $re,
    link: ioe,
    nolink: ooe,
    punctuation: Gre,
    reflink: roe,
    reflinkSearch: Cre("reflink|nolink(?!\\()", "g")
      .replace("reflink", roe)
      .replace("nolink", ooe)
      .getRegex(),
    tag: toe,
    text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
    url: kre,
  },
  aoe = {
    ...soe,
    link: Cre(/^!?\[(label)\]\((.*?)\)/)
      .replace("label", noe)
      .getRegex(),
    reflink: Cre(/^!?\[(label)\]\s*\[([^\]]*)\]/)
      .replace("label", noe)
      .getRegex(),
  },
  loe = {
    ...soe,
    escape: Cre($re).replace("])", "~|])").getRegex(),
    url: Cre(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/,
  },
  coe = {
    ...loe,
    br: Cre(qre).replace("{2,}", "*").getRegex(),
    text: Cre(loe.text)
      .replace("\\b_", "\\b_| {2,}\\n")
      .replace(/\{2,\}/g, "*")
      .getRegex(),
  },
  doe = { normal: Wre, gfm: zre, pedantic: Ure },
  uoe = { normal: soe, gfm: loe, breaks: coe, pedantic: aoe };
let hoe = class e {
    tokens;
    options;
    state;
    tokenizer;
    inlineQueue;
    constructor(e) {
      ((this.tokens = []),
        (this.tokens.links = Object.create(null)),
        (this.options = e || gre),
        (this.options.tokenizer = this.options.tokenizer || new Dre()),
        (this.tokenizer = this.options.tokenizer),
        (this.tokenizer.options = this.options),
        (this.tokenizer.lexer = this),
        (this.inlineQueue = []),
        (this.state = { inLink: !1, inRawBlock: !1, top: !0 }));
      const t = { block: doe.normal, inline: uoe.normal };
      (this.options.pedantic
        ? ((t.block = doe.pedantic), (t.inline = uoe.pedantic))
        : this.options.gfm &&
          ((t.block = doe.gfm),
          this.options.breaks ? (t.inline = uoe.breaks) : (t.inline = uoe.gfm)),
        (this.tokenizer.rules = t));
    }
    static get rules() {
      return { block: doe, inline: uoe };
    }
    static lex(t, n) {
      return new e(n).lex(t);
    }
    static lexInline(t, n) {
      return new e(n).inlineTokens(t);
    }
    lex(e) {
      ((e = e.replace(/\r\n|\r/g, "\n")), this.blockTokens(e, this.tokens));
      for (let t = 0; t < this.inlineQueue.length; t++) {
        const e = this.inlineQueue[t];
        this.inlineTokens(e.src, e.tokens);
      }
      return ((this.inlineQueue = []), this.tokens);
    }
    blockTokens(e, t = [], n = !1) {
      let i, r, o;
      for (
        e = this.options.pedantic
          ? e.replace(/\t/g, "    ").replace(/^ +$/gm, "")
          : e.replace(/^( *)(\t+)/gm, (e, t, n) => t + "    ".repeat(n.length));
        e;
      )
        if (
          !(
            this.options.extensions &&
            this.options.extensions.block &&
            this.options.extensions.block.some(
              (n) =>
                !!(i = n.call({ lexer: this }, e, t)) &&
                ((e = e.substring(i.raw.length)), t.push(i), !0),
            )
          )
        )
          if ((i = this.tokenizer.space(e)))
            ((e = e.substring(i.raw.length)),
              1 === i.raw.length && t.length > 0 ? (t[t.length - 1].raw += "\n") : t.push(i));
          else if ((i = this.tokenizer.code(e)))
            ((e = e.substring(i.raw.length)),
              (r = t[t.length - 1]),
              !r || ("paragraph" !== r.type && "text" !== r.type)
                ? t.push(i)
                : ((r.raw += "\n" + i.raw),
                  (r.text += "\n" + i.text),
                  (this.inlineQueue[this.inlineQueue.length - 1].src = r.text)));
          else if ((i = this.tokenizer.fences(e))) ((e = e.substring(i.raw.length)), t.push(i));
          else if ((i = this.tokenizer.heading(e))) ((e = e.substring(i.raw.length)), t.push(i));
          else if ((i = this.tokenizer.hr(e))) ((e = e.substring(i.raw.length)), t.push(i));
          else if ((i = this.tokenizer.blockquote(e))) ((e = e.substring(i.raw.length)), t.push(i));
          else if ((i = this.tokenizer.list(e))) ((e = e.substring(i.raw.length)), t.push(i));
          else if ((i = this.tokenizer.html(e))) ((e = e.substring(i.raw.length)), t.push(i));
          else if ((i = this.tokenizer.def(e)))
            ((e = e.substring(i.raw.length)),
              (r = t[t.length - 1]),
              !r || ("paragraph" !== r.type && "text" !== r.type)
                ? this.tokens.links[i.tag] ||
                  (this.tokens.links[i.tag] = { href: i.href, title: i.title })
                : ((r.raw += "\n" + i.raw),
                  (r.text += "\n" + i.raw),
                  (this.inlineQueue[this.inlineQueue.length - 1].src = r.text)));
          else if ((i = this.tokenizer.table(e))) ((e = e.substring(i.raw.length)), t.push(i));
          else if ((i = this.tokenizer.lheading(e))) ((e = e.substring(i.raw.length)), t.push(i));
          else {
            if (((o = e), this.options.extensions && this.options.extensions.startBlock)) {
              let t = 1 / 0;
              const n = e.slice(1);
              let i;
              (this.options.extensions.startBlock.forEach((e) => {
                ((i = e.call({ lexer: this }, n)),
                  "number" == typeof i && i >= 0 && (t = Math.min(t, i)));
              }),
                t < 1 / 0 && t >= 0 && (o = e.substring(0, t + 1)));
            }
            if (this.state.top && (i = this.tokenizer.paragraph(o)))
              ((r = t[t.length - 1]),
                n && "paragraph" === r?.type
                  ? ((r.raw += "\n" + i.raw),
                    (r.text += "\n" + i.text),
                    this.inlineQueue.pop(),
                    (this.inlineQueue[this.inlineQueue.length - 1].src = r.text))
                  : t.push(i),
                (n = o.length !== e.length),
                (e = e.substring(i.raw.length)));
            else if ((i = this.tokenizer.text(e)))
              ((e = e.substring(i.raw.length)),
                (r = t[t.length - 1]),
                r && "text" === r.type
                  ? ((r.raw += "\n" + i.raw),
                    (r.text += "\n" + i.text),
                    this.inlineQueue.pop(),
                    (this.inlineQueue[this.inlineQueue.length - 1].src = r.text))
                  : t.push(i));
            else if (e) {
              const t = "Infinite loop on byte: " + e.charCodeAt(0);
              if (this.options.silent) break;
              throw new Error(t);
            }
          }
      return ((this.state.top = !0), t);
    }
    inline(e, t = []) {
      return (this.inlineQueue.push({ src: e, tokens: t }), t);
    }
    inlineTokens(e, t = []) {
      let n,
        i,
        r,
        o,
        s,
        a,
        l = e;
      if (this.tokens.links) {
        const e = Object.keys(this.tokens.links);
        if (e.length > 0)
          for (; null != (o = this.tokenizer.rules.inline.reflinkSearch.exec(l)); )
            e.includes(o[0].slice(o[0].lastIndexOf("[") + 1, -1)) &&
              (l =
                l.slice(0, o.index) +
                "[" +
                "a".repeat(o[0].length - 2) +
                "]" +
                l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
      }
      for (; null != (o = this.tokenizer.rules.inline.blockSkip.exec(l)); )
        l =
          l.slice(0, o.index) +
          "[" +
          "a".repeat(o[0].length - 2) +
          "]" +
          l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
      for (; null != (o = this.tokenizer.rules.inline.anyPunctuation.exec(l)); )
        l =
          l.slice(0, o.index) +
          "++" +
          l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
      for (; e; )
        if (
          (s || (a = ""),
          (s = !1),
          !(
            this.options.extensions &&
            this.options.extensions.inline &&
            this.options.extensions.inline.some(
              (i) =>
                !!(n = i.call({ lexer: this }, e, t)) &&
                ((e = e.substring(n.raw.length)), t.push(n), !0),
            )
          ))
        )
          if ((n = this.tokenizer.escape(e))) ((e = e.substring(n.raw.length)), t.push(n));
          else if ((n = this.tokenizer.tag(e)))
            ((e = e.substring(n.raw.length)),
              (i = t[t.length - 1]),
              i && "text" === n.type && "text" === i.type
                ? ((i.raw += n.raw), (i.text += n.text))
                : t.push(n));
          else if ((n = this.tokenizer.link(e))) ((e = e.substring(n.raw.length)), t.push(n));
          else if ((n = this.tokenizer.reflink(e, this.tokens.links)))
            ((e = e.substring(n.raw.length)),
              (i = t[t.length - 1]),
              i && "text" === n.type && "text" === i.type
                ? ((i.raw += n.raw), (i.text += n.text))
                : t.push(n));
          else if ((n = this.tokenizer.emStrong(e, l, a)))
            ((e = e.substring(n.raw.length)), t.push(n));
          else if ((n = this.tokenizer.codespan(e))) ((e = e.substring(n.raw.length)), t.push(n));
          else if ((n = this.tokenizer.br(e))) ((e = e.substring(n.raw.length)), t.push(n));
          else if ((n = this.tokenizer.del(e))) ((e = e.substring(n.raw.length)), t.push(n));
          else if ((n = this.tokenizer.autolink(e))) ((e = e.substring(n.raw.length)), t.push(n));
          else if (this.state.inLink || !(n = this.tokenizer.url(e))) {
            if (((r = e), this.options.extensions && this.options.extensions.startInline)) {
              let t = 1 / 0;
              const n = e.slice(1);
              let i;
              (this.options.extensions.startInline.forEach((e) => {
                ((i = e.call({ lexer: this }, n)),
                  "number" == typeof i && i >= 0 && (t = Math.min(t, i)));
              }),
                t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)));
            }
            if ((n = this.tokenizer.inlineText(r)))
              ((e = e.substring(n.raw.length)),
                "_" !== n.raw.slice(-1) && (a = n.raw.slice(-1)),
                (s = !0),
                (i = t[t.length - 1]),
                i && "text" === i.type ? ((i.raw += n.raw), (i.text += n.text)) : t.push(n));
            else if (e) {
              const t = "Infinite loop on byte: " + e.charCodeAt(0);
              if (this.options.silent) break;
              throw new Error(t);
            }
          } else ((e = e.substring(n.raw.length)), t.push(n));
      return t;
    }
  },
  goe = class {
    options;
    parser;
    constructor(e) {
      this.options = e || gre;
    }
    space(e) {
      return "";
    }
    code({ text: e, lang: t, escaped: n }) {
      const i = (t || "").match(/^\S*/)?.[0],
        r = e.replace(/\n$/, "") + "\n";
      return i
        ? '<pre><code class="language-' + xre(i) + '">' + (n ? r : xre(r, !0)) + "</code></pre>\n"
        : "<pre><code>" + (n ? r : xre(r, !0)) + "</code></pre>\n";
    }
    blockquote({ tokens: e }) {
      return `<blockquote>\n${this.parser.parse(e)}</blockquote>\n`;
    }
    html({ text: e }) {
      return e;
    }
    heading({ tokens: e, depth: t }) {
      return `<h${t}>${this.parser.parseInline(e)}</h${t}>\n`;
    }
    hr(e) {
      return "<hr>\n";
    }
    list(e) {
      const t = e.ordered,
        n = e.start;
      let i = "";
      for (let o = 0; o < e.items.length; o++) {
        const t = e.items[o];
        i += this.listitem(t);
      }
      const r = t ? "ol" : "ul";
      return "<" + r + (t && 1 !== n ? ' start="' + n + '"' : "") + ">\n" + i + "</" + r + ">\n";
    }
    listitem(e) {
      let t = "";
      if (e.task) {
        const n = this.checkbox({ checked: !!e.checked });
        e.loose
          ? e.tokens.length > 0 && "paragraph" === e.tokens[0].type
            ? ((e.tokens[0].text = n + " " + e.tokens[0].text),
              e.tokens[0].tokens &&
                e.tokens[0].tokens.length > 0 &&
                "text" === e.tokens[0].tokens[0].type &&
                (e.tokens[0].tokens[0].text = n + " " + e.tokens[0].tokens[0].text))
            : e.tokens.unshift({ type: "text", raw: n + " ", text: n + " " })
          : (t += n + " ");
      }
      return ((t += this.parser.parse(e.tokens, !!e.loose)), `<li>${t}</li>\n`);
    }
    checkbox({ checked: e }) {
      return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
    }
    paragraph({ tokens: e }) {
      return `<p>${this.parser.parseInline(e)}</p>\n`;
    }
    table(e) {
      let t = "",
        n = "";
      for (let r = 0; r < e.header.length; r++) n += this.tablecell(e.header[r]);
      t += this.tablerow({ text: n });
      let i = "";
      for (let r = 0; r < e.rows.length; r++) {
        const t = e.rows[r];
        n = "";
        for (let e = 0; e < t.length; e++) n += this.tablecell(t[e]);
        i += this.tablerow({ text: n });
      }
      return (
        i && (i = `<tbody>${i}</tbody>`),
        "<table>\n<thead>\n" + t + "</thead>\n" + i + "</table>\n"
      );
    }
    tablerow({ text: e }) {
      return `<tr>\n${e}</tr>\n`;
    }
    tablecell(e) {
      const t = this.parser.parseInline(e.tokens),
        n = e.header ? "th" : "td";
      return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>\n`;
    }
    strong({ tokens: e }) {
      return `<strong>${this.parser.parseInline(e)}</strong>`;
    }
    em({ tokens: e }) {
      return `<em>${this.parser.parseInline(e)}</em>`;
    }
    codespan({ text: e }) {
      return `<code>${e}</code>`;
    }
    br(e) {
      return "<br>";
    }
    del({ tokens: e }) {
      return `<del>${this.parser.parseInline(e)}</del>`;
    }
    link({ href: e, title: t, tokens: n }) {
      const i = this.parser.parseInline(n),
        r = Sre(e);
      if (null === r) return i;
      let o = '<a href="' + (e = r) + '"';
      return (t && (o += ' title="' + t + '"'), (o += ">" + i + "</a>"), o);
    }
    image({ href: e, title: t, text: n }) {
      const i = Sre(e);
      if (null === i) return n;
      let r = `<img src="${(e = i)}" alt="${n}"`;
      return (t && (r += ` title="${t}"`), (r += ">"), r);
    }
    text(e) {
      return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : e.text;
    }
  },
  poe = class {
    strong({ text: e }) {
      return e;
    }
    em({ text: e }) {
      return e;
    }
    codespan({ text: e }) {
      return e;
    }
    del({ text: e }) {
      return e;
    }
    html({ text: e }) {
      return e;
    }
    text({ text: e }) {
      return e;
    }
    link({ text: e }) {
      return "" + e;
    }
    image({ text: e }) {
      return "" + e;
    }
    br() {
      return "";
    }
  },
  foe = class e {
    options;
    renderer;
    textRenderer;
    constructor(e) {
      ((this.options = e || gre),
        (this.options.renderer = this.options.renderer || new goe()),
        (this.renderer = this.options.renderer),
        (this.renderer.options = this.options),
        (this.renderer.parser = this),
        (this.textRenderer = new poe()));
    }
    static parse(t, n) {
      return new e(n).parse(t);
    }
    static parseInline(t, n) {
      return new e(n).parseInline(t);
    }
    parse(e, t = !0) {
      let n = "";
      for (let i = 0; i < e.length; i++) {
        const r = e[i];
        if (
          this.options.extensions &&
          this.options.extensions.renderers &&
          this.options.extensions.renderers[r.type]
        ) {
          const e = r,
            t = this.options.extensions.renderers[e.type].call({ parser: this }, e);
          if (
            !1 !== t ||
            ![
              "space",
              "hr",
              "heading",
              "code",
              "table",
              "blockquote",
              "list",
              "html",
              "paragraph",
              "text",
            ].includes(e.type)
          ) {
            n += t || "";
            continue;
          }
        }
        const o = r;
        switch (o.type) {
          case "space":
            n += this.renderer.space(o);
            continue;
          case "hr":
            n += this.renderer.hr(o);
            continue;
          case "heading":
            n += this.renderer.heading(o);
            continue;
          case "code":
            n += this.renderer.code(o);
            continue;
          case "table":
            n += this.renderer.table(o);
            continue;
          case "blockquote":
            n += this.renderer.blockquote(o);
            continue;
          case "list":
            n += this.renderer.list(o);
            continue;
          case "html":
            n += this.renderer.html(o);
            continue;
          case "paragraph":
            n += this.renderer.paragraph(o);
            continue;
          case "text": {
            let r = o,
              s = this.renderer.text(r);
            for (; i + 1 < e.length && "text" === e[i + 1].type; )
              ((r = e[++i]), (s += "\n" + this.renderer.text(r)));
            n += t
              ? this.renderer.paragraph({
                  type: "paragraph",
                  raw: s,
                  text: s,
                  tokens: [{ type: "text", raw: s, text: s }],
                })
              : s;
            continue;
          }
          default: {
            const e = 'Token with "' + o.type + '" type was not found.';
            if (this.options.silent) return "";
            throw new Error(e);
          }
        }
      }
      return n;
    }
    parseInline(e, t) {
      t = t || this.renderer;
      let n = "";
      for (let i = 0; i < e.length; i++) {
        const r = e[i];
        if (
          this.options.extensions &&
          this.options.extensions.renderers &&
          this.options.extensions.renderers[r.type]
        ) {
          const e = this.options.extensions.renderers[r.type].call({ parser: this }, r);
          if (
            !1 !== e ||
            ![
              "escape",
              "html",
              "link",
              "image",
              "strong",
              "em",
              "codespan",
              "br",
              "del",
              "text",
            ].includes(r.type)
          ) {
            n += e || "";
            continue;
          }
        }
        const o = r;
        switch (o.type) {
          case "escape":
          case "text":
            n += t.text(o);
            break;
          case "html":
            n += t.html(o);
            break;
          case "link":
            n += t.link(o);
            break;
          case "image":
            n += t.image(o);
            break;
          case "strong":
            n += t.strong(o);
            break;
          case "em":
            n += t.em(o);
            break;
          case "codespan":
            n += t.codespan(o);
            break;
          case "br":
            n += t.br(o);
            break;
          case "del":
            n += t.del(o);
            break;
          default: {
            const e = 'Token with "' + o.type + '" type was not found.';
            if (this.options.silent) return "";
            throw new Error(e);
          }
        }
      }
      return n;
    }
  },
  moe = class {
    options;
    constructor(e) {
      this.options = e || gre;
    }
    static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens"]);
    preprocess(e) {
      return e;
    }
    postprocess(e) {
      return e;
    }
    processAllTokens(e) {
      return e;
    }
  },
  _oe = class {
    defaults = {
      async: !1,
      breaks: !1,
      extensions: null,
      gfm: !0,
      hooks: null,
      pedantic: !1,
      renderer: null,
      silent: !1,
      tokenizer: null,
      walkTokens: null,
    };
    options = this.setOptions;
    parse = this.parseMarkdown(hoe.lex, foe.parse);
    parseInline = this.parseMarkdown(hoe.lexInline, foe.parseInline);
    Parser = foe;
    Renderer = goe;
    TextRenderer = poe;
    Lexer = hoe;
    Tokenizer = Dre;
    Hooks = moe;
    constructor(...e) {
      this.use(...e);
    }
    walkTokens(e, t) {
      let n = [];
      for (const i of e)
        switch (((n = n.concat(t.call(this, i))), i.type)) {
          case "table": {
            const e = i;
            for (const i of e.header) n = n.concat(this.walkTokens(i.tokens, t));
            for (const i of e.rows) for (const e of i) n = n.concat(this.walkTokens(e.tokens, t));
            break;
          }
          case "list": {
            const e = i;
            n = n.concat(this.walkTokens(e.items, t));
            break;
          }
          default: {
            const e = i;
            this.defaults.extensions?.childTokens?.[e.type]
              ? this.defaults.extensions.childTokens[e.type].forEach((i) => {
                  const r = e[i].flat(1 / 0);
                  n = n.concat(this.walkTokens(r, t));
                })
              : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
          }
        }
      return n;
    }
    use(...e) {
      const t = this.defaults.extensions || { renderers: {}, childTokens: {} };
      return (
        e.forEach((e) => {
          const n = { ...e };
          if (
            ((n.async = this.defaults.async || n.async || !1),
            e.extensions &&
              (e.extensions.forEach((e) => {
                if (!e.name) throw new Error("extension name required");
                if ("renderer" in e) {
                  const n = t.renderers[e.name];
                  t.renderers[e.name] = n
                    ? function (...t) {
                        let i = e.renderer.apply(this, t);
                        return (!1 === i && (i = n.apply(this, t)), i);
                      }
                    : e.renderer;
                }
                if ("tokenizer" in e) {
                  if (!e.level || ("block" !== e.level && "inline" !== e.level))
                    throw new Error("extension level must be 'block' or 'inline'");
                  const n = t[e.level];
                  (n ? n.unshift(e.tokenizer) : (t[e.level] = [e.tokenizer]),
                    e.start &&
                      ("block" === e.level
                        ? t.startBlock
                          ? t.startBlock.push(e.start)
                          : (t.startBlock = [e.start])
                        : "inline" === e.level &&
                          (t.startInline
                            ? t.startInline.push(e.start)
                            : (t.startInline = [e.start]))));
                }
                "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
              }),
              (n.extensions = t)),
            e.renderer)
          ) {
            const t = this.defaults.renderer || new goe(this.defaults);
            for (const n in e.renderer) {
              if (!(n in t)) throw new Error(`renderer '${n}' does not exist`);
              if (["options", "parser"].includes(n)) continue;
              const i = n,
                r = e.renderer[i],
                o = t[i];
              t[i] = (...e) => {
                let n = r.apply(t, e);
                return (!1 === n && (n = o.apply(t, e)), n || "");
              };
            }
            n.renderer = t;
          }
          if (e.tokenizer) {
            const t = this.defaults.tokenizer || new Dre(this.defaults);
            for (const n in e.tokenizer) {
              if (!(n in t)) throw new Error(`tokenizer '${n}' does not exist`);
              if (["options", "rules", "lexer"].includes(n)) continue;
              const i = n,
                r = e.tokenizer[i],
                o = t[i];
              t[i] = (...e) => {
                let n = r.apply(t, e);
                return (!1 === n && (n = o.apply(t, e)), n);
              };
            }
            n.tokenizer = t;
          }
          if (e.hooks) {
            const t = this.defaults.hooks || new moe();
            for (const n in e.hooks) {
              if (!(n in t)) throw new Error(`hook '${n}' does not exist`);
              if ("options" === n) continue;
              const i = n,
                r = e.hooks[i],
                o = t[i];
              moe.passThroughHooks.has(n)
                ? (t[i] = (e) => {
                    if (this.defaults.async)
                      return Promise.resolve(r.call(t, e)).then((e) => o.call(t, e));
                    const n = r.call(t, e);
                    return o.call(t, n);
                  })
                : (t[i] = (...e) => {
                    let n = r.apply(t, e);
                    return (!1 === n && (n = o.apply(t, e)), n);
                  });
            }
            n.hooks = t;
          }
          if (e.walkTokens) {
            const t = this.defaults.walkTokens,
              i = e.walkTokens;
            n.walkTokens = function (e) {
              let n = [];
              return (n.push(i.call(this, e)), t && (n = n.concat(t.call(this, e))), n);
            };
          }
          this.defaults = { ...this.defaults, ...n };
        }),
        this
      );
    }
    setOptions(e) {
      return ((this.defaults = { ...this.defaults, ...e }), this);
    }
    lexer(e, t) {
      return hoe.lex(e, t ?? this.defaults);
    }
    parser(e, t) {
      return foe.parse(e, t ?? this.defaults);
    }
    parseMarkdown(e, t) {
      return (n, i) => {
        const r = { ...i },
          o = { ...this.defaults, ...r },
          s = this.onError(!!o.silent, !!o.async);
        if (!0 === this.defaults.async && !1 === r.async)
          return s(
            new 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 (null == n) return s(new Error("marked(): input parameter is undefined or null"));
        if ("string" != typeof n)
          return s(
            new Error(
              "marked(): input parameter is of type " +
                Object.prototype.toString.call(n) +
                ", string expected",
            ),
          );
        if ((o.hooks && (o.hooks.options = o), o.async))
          return Promise.resolve(o.hooks ? o.hooks.preprocess(n) : n)
            .then((t) => e(t, o))
            .then((e) => (o.hooks ? o.hooks.processAllTokens(e) : e))
            .then((e) =>
              o.walkTokens ? Promise.all(this.walkTokens(e, o.walkTokens)).then(() => e) : e,
            )
            .then((e) => t(e, o))
            .then((e) => (o.hooks ? o.hooks.postprocess(e) : e))
            .catch(s);
        try {
          o.hooks && (n = o.hooks.preprocess(n));
          let i = e(n, o);
          (o.hooks && (i = o.hooks.processAllTokens(i)),
            o.walkTokens && this.walkTokens(i, o.walkTokens));
          let r = t(i, o);
          return (o.hooks && (r = o.hooks.postprocess(r)), r);
        } catch (spt) {
          return s(spt);
        }
      };
    }
    onError(e, t) {
      return (n) => {
        if (((n.message += "\nPlease report this to https://github.com/markedjs/marked."), e)) {
          const e = "<p>An error occurred:</p><pre>" + xre(n.message + "", !0) + "</pre>";
          return t ? Promise.resolve(e) : e;
        }
        if (t) return Promise.reject(n);
        throw n;
      };
    }
  };
const voe = new _oe();
function boe(e, t) {
  return voe.parse(e, t);
}
((boe.options = boe.setOptions =
  function (e) {
    return (voe.setOptions(e), (boe.defaults = voe.defaults), pre(boe.defaults), boe);
  }),
  (boe.getDefaults = hre),
  (boe.defaults = gre),
  (boe.use = function (...e) {
    return (voe.use(...e), (boe.defaults = voe.defaults), pre(boe.defaults), boe);
  }),
  (boe.walkTokens = function (e, t) {
    return voe.walkTokens(e, t);
  }),
  (boe.parseInline = voe.parseInline),
  (boe.Parser = foe),
  (boe.parser = foe.parse),
  (boe.Renderer = goe),
  (boe.TextRenderer = poe),
  (boe.Lexer = hoe),
  (boe.lexer = hoe.lex),
  (boe.Tokenizer = Dre),
  (boe.Hooks = moe),
  (boe.parse = boe),
  boe.options,
  boe.setOptions,
  boe.use,
  boe.walkTokens,
  boe.parseInline);
const yoe = boe;
foe.parse;
const xoe = hoe.lex;
function woe(e) {
  let t = JSON.parse(e);
  return ((t = Soe(t)), t);
}
function Coe(e, t) {
  return t instanceof RegExp ? { $mid: 2, source: t.source, flags: t.flags } : t;
}
function Soe(e, t = 0) {
  if (!e || t > 200) return e;
  if ("object" == typeof e) {
    switch (e.$mid) {
      case 1:
        return mP.revive(e);
      case 2:
        return new RegExp(e.source, e.flags);
      case 17:
        return new Date(e.source);
    }
    if (e instanceof PP || e instanceof Uint8Array) return e;
    if (Array.isArray(e)) for (let n = 0; n < e.length; ++n) e[n] = Soe(e[n], t + 1);
    else for (const n in e) Object.hasOwnProperty.call(e, n) && (e[n] = Soe(e[n], t + 1));
  }
  return e;
}
/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */ const {
  entries: koe,
  setPrototypeOf: Eoe,
  isFrozen: Noe,
  getPrototypeOf: Loe,
  getOwnPropertyDescriptor: Doe,
} = Object;
let { freeze: Toe, seal: Ioe, create: Roe } = Object,
  { apply: Ooe, construct: Moe } = "undefined" != typeof Reflect && Reflect;
(Toe ||
  (Toe = function (e) {
    return e;
  }),
  Ioe ||
    (Ioe = function (e) {
      return e;
    }),
  Ooe ||
    (Ooe = function (e, t) {
      for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), r = 2; r < n; r++)
        i[r - 2] = arguments[r];
      return e.apply(t, i);
    }),
  Moe ||
    (Moe = function (e) {
      for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
        n[i - 1] = arguments[i];
      return new e(...n);
    }));
const Aoe = Yoe(Array.prototype.forEach),
  Poe = Yoe(Array.prototype.lastIndexOf),
  joe = Yoe(Array.prototype.pop),
  Foe = Yoe(Array.prototype.push),
  Boe = Yoe(Array.prototype.splice),
  Voe = Yoe(String.prototype.toLowerCase),
  Woe = Yoe(String.prototype.toString),
  Hoe = Yoe(String.prototype.match),
  zoe = Yoe(String.prototype.replace),
  Uoe = Yoe(String.prototype.indexOf),
  $oe = Yoe(String.prototype.trim),
  qoe = Yoe(Object.prototype.hasOwnProperty),
  Koe = Yoe(RegExp.prototype.test),
  Goe =
    ((Zoe = TypeError),
    function () {
      for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
      return Moe(Zoe, t);
    });
var Zoe;
function Yoe(e) {
  return function (t) {
    t instanceof RegExp && (t.lastIndex = 0);
    for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++)
      i[r - 1] = arguments[r];
    return Ooe(e, t, i);
  };
}
function Xoe(e, t) {
  let n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Voe;
  Eoe && Eoe(e, null);
  let i = t.length;
  for (; i--; ) {
    let r = t[i];
    if ("string" == typeof r) {
      const e = n(r);
      e !== r && (Noe(t) || (t[i] = e), (r = e));
    }
    e[r] = !0;
  }
  return e;
}
function Qoe(e) {
  for (let t = 0; t < e.length; t++) {
    qoe(e, t) || (e[t] = null);
  }
  return e;
}
function Joe(e) {
  const t = Roe(null);
  for (const [n, i] of koe(e)) {
    qoe(e, n) &&
      (Array.isArray(i)
        ? (t[n] = Qoe(i))
        : i && "object" == typeof i && i.constructor === Object
          ? (t[n] = Joe(i))
          : (t[n] = i));
  }
  return t;
}
function ese(e, t) {
  for (; null !== e; ) {
    const n = Doe(e, t);
    if (n) {
      if (n.get) return Yoe(n.get);
      if ("function" == typeof n.value) return Yoe(n.value);
    }
    e = Loe(e);
  }
  return function () {
    return null;
  };
}
const tse = Toe([
    "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",
  ]),
  nse = Toe([
    "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",
  ]),
  ise = Toe([
    "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",
  ]),
  rse = Toe([
    "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",
  ]),
  ose = Toe([
    "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",
  ]),
  sse = Toe([
    "maction",
    "maligngroup",
    "malignmark",
    "mlongdiv",
    "mscarries",
    "mscarry",
    "msgroup",
    "mstack",
    "msline",
    "msrow",
    "semantics",
    "annotation",
    "annotation-xml",
    "mprescripts",
    "none",
  ]),
  ase = Toe(["#text"]),
  lse = Toe([
    "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",
  ]),
  cse = Toe([
    "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",
  ]),
  dse = Toe([
    "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",
  ]),
  use = Toe(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]),
  hse = Ioe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),
  gse = Ioe(/<%[\w\W]*|[\w\W]*%>/gm),
  pse = Ioe(/\$\{[\w\W]*/gm),
  fse = Ioe(/^data-[\-\w.\u00B7-\uFFFF]+$/),
  mse = Ioe(/^aria-[\-\w]+$/),
  _se = Ioe(
    /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,
  ),
  vse = Ioe(/^(?:\w+script|data):/i),
  bse = Ioe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),
  yse = Ioe(/^html$/i),
  xse = Ioe(/^[a-z][.\w]*(-[.\w]+)+$/i);
var wse = Object.freeze({
  __proto__: null,
  ARIA_ATTR: mse,
  ATTR_WHITESPACE: bse,
  CUSTOM_ELEMENT: xse,
  DATA_ATTR: fse,
  DOCTYPE_NAME: yse,
  ERB_EXPR: gse,
  IS_ALLOWED_URI: _se,
  IS_SCRIPT_OR_DATA: vse,
  MUSTACHE_EXPR: hse,
  TMPLIT_EXPR: pse,
});
const Cse = 1,
  Sse = 3,
  kse = 7,
  Ese = 8,
  Nse = 9,
  Lse = function () {
    return "undefined" == typeof window ? null : window;
  };
var Dse = (function e() {
  let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : Lse();
  const n = (t) => e(t);
  if (
    ((n.version = "3.2.7"),
    (n.removed = []),
    !t || !t.document || t.document.nodeType !== Nse || !t.Element)
  )
    return ((n.isSupported = !1), n);
  let { document: i } = t;
  const r = i,
    o = r.currentScript,
    {
      DocumentFragment: s,
      HTMLTemplateElement: a,
      Node: l,
      Element: c,
      NodeFilter: d,
      NamedNodeMap: u = t.NamedNodeMap || t.MozNamedAttrMap,
      HTMLFormElement: h,
      DOMParser: g,
      trustedTypes: p,
    } = t,
    f = c.prototype,
    m = ese(f, "cloneNode"),
    _ = ese(f, "remove"),
    v = ese(f, "nextSibling"),
    b = ese(f, "childNodes"),
    y = ese(f, "parentNode");
  if ("function" == typeof a) {
    const e = i.createElement("template");
    e.content && e.content.ownerDocument && (i = e.content.ownerDocument);
  }
  let x,
    w = "";
  const {
      implementation: C,
      createNodeIterator: S,
      createDocumentFragment: k,
      getElementsByTagName: E,
    } = i,
    { importNode: N } = r;
  let L = {
    afterSanitizeAttributes: [],
    afterSanitizeElements: [],
    afterSanitizeShadowDOM: [],
    beforeSanitizeAttributes: [],
    beforeSanitizeElements: [],
    beforeSanitizeShadowDOM: [],
    uponSanitizeAttribute: [],
    uponSanitizeElement: [],
    uponSanitizeShadowNode: [],
  };
  n.isSupported =
    "function" == typeof koe && "function" == typeof y && C && void 0 !== C.createHTMLDocument;
  const {
    MUSTACHE_EXPR: D,
    ERB_EXPR: T,
    TMPLIT_EXPR: I,
    DATA_ATTR: R,
    ARIA_ATTR: O,
    IS_SCRIPT_OR_DATA: M,
    ATTR_WHITESPACE: A,
    CUSTOM_ELEMENT: P,
  } = wse;
  let { IS_ALLOWED_URI: j } = wse,
    F = null;
  const B = Xoe({}, [...tse, ...nse, ...ise, ...ose, ...ase]);
  let V = null;
  const W = Xoe({}, [...lse, ...cse, ...dse, ...use]);
  let H = Object.seal(
      Roe(null, {
        tagNameCheck: { writable: !0, configurable: !1, enumerable: !0, value: null },
        attributeNameCheck: { writable: !0, configurable: !1, enumerable: !0, value: null },
        allowCustomizedBuiltInElements: {
          writable: !0,
          configurable: !1,
          enumerable: !0,
          value: !1,
        },
      }),
    ),
    z = null,
    U = null,
    $ = !0,
    q = !0,
    K = !1,
    G = !0,
    Z = !1,
    Y = !0,
    X = !1,
    Q = !1,
    J = !1,
    ee = !1,
    te = !1,
    ne = !1,
    ie = !0,
    re = !1,
    oe = !0,
    se = !1,
    ae = {},
    le = null;
  const ce = Xoe({}, [
    "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",
  ]);
  let de = null;
  const ue = Xoe({}, ["audio", "video", "img", "source", "image", "track"]);
  let he = null;
  const ge = Xoe({}, [
      "alt",
      "class",
      "for",
      "id",
      "label",
      "name",
      "pattern",
      "placeholder",
      "role",
      "summary",
      "title",
      "value",
      "style",
      "xmlns",
    ]),
    pe = "http://www.w3.org/1998/Math/MathML",
    fe = "http://www.w3.org/2000/svg",
    me = "http://www.w3.org/1999/xhtml";
  let _e = me,
    ve = !1,
    be = null;
  const ye = Xoe({}, [pe, fe, me], Woe);
  let xe = Xoe({}, ["mi", "mo", "mn", "ms", "mtext"]),
    we = Xoe({}, ["annotation-xml"]);
  const Ce = Xoe({}, ["title", "style", "font", "a", "script"]);
  let Se = null;
  const ke = ["application/xhtml+xml", "text/html"];
  let Ee = null,
    Ne = null;
  const Le = i.createElement("form"),
    De = function (e) {
      return e instanceof RegExp || e instanceof Function;
    },
    Te = function () {
      let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
      if (!Ne || Ne !== e) {
        if (
          ((e && "object" == typeof e) || (e = {}),
          (e = Joe(e)),
          (Se = -1 === ke.indexOf(e.PARSER_MEDIA_TYPE) ? "text/html" : e.PARSER_MEDIA_TYPE),
          (Ee = "application/xhtml+xml" === Se ? Woe : Voe),
          (F = qoe(e, "ALLOWED_TAGS") ? Xoe({}, e.ALLOWED_TAGS, Ee) : B),
          (V = qoe(e, "ALLOWED_ATTR") ? Xoe({}, e.ALLOWED_ATTR, Ee) : W),
          (be = qoe(e, "ALLOWED_NAMESPACES") ? Xoe({}, e.ALLOWED_NAMESPACES, Woe) : ye),
          (he = qoe(e, "ADD_URI_SAFE_ATTR") ? Xoe(Joe(ge), e.ADD_URI_SAFE_ATTR, Ee) : ge),
          (de = qoe(e, "ADD_DATA_URI_TAGS") ? Xoe(Joe(ue), e.ADD_DATA_URI_TAGS, Ee) : ue),
          (le = qoe(e, "FORBID_CONTENTS") ? Xoe({}, e.FORBID_CONTENTS, Ee) : ce),
          (z = qoe(e, "FORBID_TAGS") ? Xoe({}, e.FORBID_TAGS, Ee) : Joe({})),
          (U = qoe(e, "FORBID_ATTR") ? Xoe({}, e.FORBID_ATTR, Ee) : Joe({})),
          (ae = !!qoe(e, "USE_PROFILES") && e.USE_PROFILES),
          ($ = !1 !== e.ALLOW_ARIA_ATTR),
          (q = !1 !== e.ALLOW_DATA_ATTR),
          (K = e.ALLOW_UNKNOWN_PROTOCOLS || !1),
          (G = !1 !== e.ALLOW_SELF_CLOSE_IN_ATTR),
          (Z = e.SAFE_FOR_TEMPLATES || !1),
          (Y = !1 !== e.SAFE_FOR_XML),
          (X = e.WHOLE_DOCUMENT || !1),
          (ee = e.RETURN_DOM || !1),
          (te = e.RETURN_DOM_FRAGMENT || !1),
          (ne = e.RETURN_TRUSTED_TYPE || !1),
          (J = e.FORCE_BODY || !1),
          (ie = !1 !== e.SANITIZE_DOM),
          (re = e.SANITIZE_NAMED_PROPS || !1),
          (oe = !1 !== e.KEEP_CONTENT),
          (se = e.IN_PLACE || !1),
          (j = e.ALLOWED_URI_REGEXP || _se),
          (_e = e.NAMESPACE || me),
          (xe = e.MATHML_TEXT_INTEGRATION_POINTS || xe),
          (we = e.HTML_INTEGRATION_POINTS || we),
          (H = e.CUSTOM_ELEMENT_HANDLING || {}),
          e.CUSTOM_ELEMENT_HANDLING &&
            De(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) &&
            (H.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),
          e.CUSTOM_ELEMENT_HANDLING &&
            De(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) &&
            (H.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),
          e.CUSTOM_ELEMENT_HANDLING &&
            "boolean" == typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&
            (H.allowCustomizedBuiltInElements =
              e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),
          Z && (q = !1),
          te && (ee = !0),
          ae &&
            ((F = Xoe({}, ase)),
            (V = []),
            !0 === ae.html && (Xoe(F, tse), Xoe(V, lse)),
            !0 === ae.svg && (Xoe(F, nse), Xoe(V, cse), Xoe(V, use)),
            !0 === ae.svgFilters && (Xoe(F, ise), Xoe(V, cse), Xoe(V, use)),
            !0 === ae.mathMl && (Xoe(F, ose), Xoe(V, dse), Xoe(V, use))),
          e.ADD_TAGS && (F === B && (F = Joe(F)), Xoe(F, e.ADD_TAGS, Ee)),
          e.ADD_ATTR && (V === W && (V = Joe(V)), Xoe(V, e.ADD_ATTR, Ee)),
          e.ADD_URI_SAFE_ATTR && Xoe(he, e.ADD_URI_SAFE_ATTR, Ee),
          e.FORBID_CONTENTS && (le === ce && (le = Joe(le)), Xoe(le, e.FORBID_CONTENTS, Ee)),
          oe && (F["#text"] = !0),
          X && Xoe(F, ["html", "head", "body"]),
          F.table && (Xoe(F, ["tbody"]), delete z.tbody),
          e.TRUSTED_TYPES_POLICY)
        ) {
          if ("function" != typeof e.TRUSTED_TYPES_POLICY.createHTML)
            throw Goe(
              'TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.',
            );
          if ("function" != typeof e.TRUSTED_TYPES_POLICY.createScriptURL)
            throw Goe(
              'TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.',
            );
          ((x = e.TRUSTED_TYPES_POLICY), (w = x.createHTML("")));
        } else
          (void 0 === x &&
            (x = (function (e, t) {
              if ("object" != typeof e || "function" != typeof e.createPolicy) return null;
              let n = null;
              const i = "data-tt-policy-suffix";
              t && t.hasAttribute(i) && (n = t.getAttribute(i));
              const r = "dompurify" + (n ? "#" + n : "");
              try {
                return e.createPolicy(r, { createHTML: (e) => e, createScriptURL: (e) => e });
              } catch (Ndt) {
                return null;
              }
            })(p, o)),
            null !== x && "string" == typeof w && (w = x.createHTML("")));
        (Toe && Toe(e), (Ne = e));
      }
    },
    Ie = Xoe({}, [...nse, ...ise, ...rse]),
    Re = Xoe({}, [...ose, ...sse]),
    Oe = function (e) {
      Foe(n.removed, { element: e });
      try {
        y(e).removeChild(e);
      } catch (Ndt) {
        _(e);
      }
    },
    Me = function (e, t) {
      try {
        Foe(n.removed, { attribute: t.getAttributeNode(e), from: t });
      } catch (Ndt) {
        Foe(n.removed, { attribute: null, from: t });
      }
      if ((t.removeAttribute(e), "is" === e))
        if (ee || te)
          try {
            Oe(t);
          } catch (Ndt) {}
        else
          try {
            t.setAttribute(e, "");
          } catch (Ndt) {}
    },
    Ae = function (e) {
      let t = null,
        n = null;
      if (J) e = "<remove></remove>" + e;
      else {
        const t = Hoe(e, /^[\r\n\t ]+/);
        n = t && t[0];
      }
      "application/xhtml+xml" === Se &&
        _e === me &&
        (e =
          '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
      const r = x ? x.createHTML(e) : e;
      if (_e === me)
        try {
          t = new g().parseFromString(r, Se);
        } catch (Ndt) {}
      if (!t || !t.documentElement) {
        t = C.createDocument(_e, "template", null);
        try {
          t.documentElement.innerHTML = ve ? w : r;
        } catch (Ndt) {}
      }
      const o = t.body || t.documentElement;
      return (
        e && n && o.insertBefore(i.createTextNode(n), o.childNodes[0] || null),
        _e === me ? E.call(t, X ? "html" : "body")[0] : X ? t.documentElement : o
      );
    },
    Pe = function (e) {
      return S.call(
        e.ownerDocument || e,
        e,
        d.SHOW_ELEMENT |
          d.SHOW_COMMENT |
          d.SHOW_TEXT |
          d.SHOW_PROCESSING_INSTRUCTION |
          d.SHOW_CDATA_SECTION,
        null,
      );
    },
    je = function (e) {
      return (
        e instanceof h &&
        ("string" != typeof e.nodeName ||
          "string" != typeof e.textContent ||
          "function" != typeof e.removeChild ||
          !(e.attributes instanceof u) ||
          "function" != typeof e.removeAttribute ||
          "function" != typeof e.setAttribute ||
          "string" != typeof e.namespaceURI ||
          "function" != typeof e.insertBefore ||
          "function" != typeof e.hasChildNodes)
      );
    },
    Fe = function (e) {
      return "function" == typeof l && e instanceof l;
    };
  function Be(e, t, i) {
    Aoe(e, (e) => {
      e.call(n, t, i, Ne);
    });
  }
  const Ve = function (e) {
      let t = null;
      if ((Be(L.beforeSanitizeElements, e, null), je(e))) return (Oe(e), !0);
      const i = Ee(e.nodeName);
      if (
        (Be(L.uponSanitizeElement, e, { tagName: i, allowedTags: F }),
        Y &&
          e.hasChildNodes() &&
          !Fe(e.firstElementChild) &&
          Koe(/<[/\w!]/g, e.innerHTML) &&
          Koe(/<[/\w!]/g, e.textContent))
      )
        return (Oe(e), !0);
      if (e.nodeType === kse) return (Oe(e), !0);
      if (Y && e.nodeType === Ese && Koe(/<[/\w]/g, e.data)) return (Oe(e), !0);
      if (!F[i] || z[i]) {
        if (!z[i] && He(i)) {
          if (H.tagNameCheck instanceof RegExp && Koe(H.tagNameCheck, i)) return !1;
          if (H.tagNameCheck instanceof Function && H.tagNameCheck(i)) return !1;
        }
        if (oe && !le[i]) {
          const t = y(e) || e.parentNode,
            n = b(e) || e.childNodes;
          if (n && t) {
            for (let i = n.length - 1; i >= 0; --i) {
              const r = m(n[i], !0);
              ((r.__removalCount = (e.__removalCount || 0) + 1), t.insertBefore(r, v(e)));
            }
          }
        }
        return (Oe(e), !0);
      }
      return e instanceof c &&
        !(function (e) {
          let t = y(e);
          (t && t.tagName) || (t = { namespaceURI: _e, tagName: "template" });
          const n = Voe(e.tagName),
            i = Voe(t.tagName);
          return (
            !!be[e.namespaceURI] &&
            (e.namespaceURI === fe
              ? t.namespaceURI === me
                ? "svg" === n
                : t.namespaceURI === pe
                  ? "svg" === n && ("annotation-xml" === i || xe[i])
                  : Boolean(Ie[n])
              : e.namespaceURI === pe
                ? t.namespaceURI === me
                  ? "math" === n
                  : t.namespaceURI === fe
                    ? "math" === n && we[i]
                    : Boolean(Re[n])
                : e.namespaceURI === me
                  ? !(t.namespaceURI === fe && !we[i]) &&
                    !(t.namespaceURI === pe && !xe[i]) &&
                    !Re[n] &&
                    (Ce[n] || !Ie[n])
                  : !("application/xhtml+xml" !== Se || !be[e.namespaceURI]))
          );
        })(e)
        ? (Oe(e), !0)
        : ("noscript" !== i && "noembed" !== i && "noframes" !== i) ||
            !Koe(/<\/no(script|embed|frames)/i, e.innerHTML)
          ? (Z &&
              e.nodeType === Sse &&
              ((t = e.textContent),
              Aoe([D, T, I], (e) => {
                t = zoe(t, e, " ");
              }),
              e.textContent !== t &&
                (Foe(n.removed, { element: e.cloneNode() }), (e.textContent = t))),
            Be(L.afterSanitizeElements, e, null),
            !1)
          : (Oe(e), !0);
    },
    We = function (e, t, n) {
      if (ie && ("id" === t || "name" === t) && (n in i || n in Le)) return !1;
      if (q && !U[t] && Koe(R, t));
      else if ($ && Koe(O, t));
      else if (!V[t] || U[t]) {
        if (
          !(
            (He(e) &&
              ((H.tagNameCheck instanceof RegExp && Koe(H.tagNameCheck, e)) ||
                (H.tagNameCheck instanceof Function && H.tagNameCheck(e))) &&
              ((H.attributeNameCheck instanceof RegExp && Koe(H.attributeNameCheck, t)) ||
                (H.attributeNameCheck instanceof Function && H.attributeNameCheck(t, e)))) ||
            ("is" === t &&
              H.allowCustomizedBuiltInElements &&
              ((H.tagNameCheck instanceof RegExp && Koe(H.tagNameCheck, n)) ||
                (H.tagNameCheck instanceof Function && H.tagNameCheck(n))))
          )
        )
          return !1;
      } else if (he[t]);
      else if (Koe(j, zoe(n, A, "")));
      else if (
        ("src" !== t && "xlink:href" !== t && "href" !== t) ||
        "script" === e ||
        0 !== Uoe(n, "data:") ||
        !de[e]
      ) {
        if (K && !Koe(M, zoe(n, A, "")));
        else if (n) return !1;
      } else;
      return !0;
    },
    He = function (e) {
      return "annotation-xml" !== e && Hoe(e, P);
    },
    ze = function (e) {
      Be(L.beforeSanitizeAttributes, e, null);
      const { attributes: t } = e;
      if (!t || je(e)) return;
      const i = {
        attrName: "",
        attrValue: "",
        keepAttr: !0,
        allowedAttributes: V,
        forceKeepAttr: void 0,
      };
      let r = t.length;
      for (; r--; ) {
        const o = t[r],
          { name: s, namespaceURI: a, value: l } = o,
          c = Ee(s),
          d = l;
        let u = "value" === s ? d : $oe(d);
        if (
          ((i.attrName = c),
          (i.attrValue = u),
          (i.keepAttr = !0),
          (i.forceKeepAttr = void 0),
          Be(L.uponSanitizeAttribute, e, i),
          (u = i.attrValue),
          !re || ("id" !== c && "name" !== c) || (Me(s, e), (u = "user-content-" + u)),
          Y && Koe(/((--!?|])>)|<\/(style|title|textarea)/i, u))
        ) {
          Me(s, e);
          continue;
        }
        if ("attributename" === c && Hoe(u, "href")) {
          Me(s, e);
          continue;
        }
        if (i.forceKeepAttr) continue;
        if (!i.keepAttr) {
          Me(s, e);
          continue;
        }
        if (!G && Koe(/\/>/i, u)) {
          Me(s, e);
          continue;
        }
        Z &&
          Aoe([D, T, I], (e) => {
            u = zoe(u, e, " ");
          });
        const h = Ee(e.nodeName);
        if (We(h, c, u)) {
          if (x && "object" == typeof p && "function" == typeof p.getAttributeType)
            if (a);
            else
              switch (p.getAttributeType(h, c)) {
                case "TrustedHTML":
                  u = x.createHTML(u);
                  break;
                case "TrustedScriptURL":
                  u = x.createScriptURL(u);
              }
          if (u !== d)
            try {
              (a ? e.setAttributeNS(a, s, u) : e.setAttribute(s, u),
                je(e) ? Oe(e) : joe(n.removed));
            } catch (Ndt) {
              Me(s, e);
            }
        } else Me(s, e);
      }
      Be(L.afterSanitizeAttributes, e, null);
    },
    Ue = function e(t) {
      let n = null;
      const i = Pe(t);
      for (Be(L.beforeSanitizeShadowDOM, t, null); (n = i.nextNode()); )
        (Be(L.uponSanitizeShadowNode, n, null),
          Ve(n),
          ze(n),
          n.content instanceof s && e(n.content));
      Be(L.afterSanitizeShadowDOM, t, null);
    };
  return (
    (n.sanitize = function (e) {
      let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
        i = null,
        o = null,
        a = null,
        c = null;
      if (((ve = !e), ve && (e = "\x3c!--\x3e"), "string" != typeof e && !Fe(e))) {
        if ("function" != typeof e.toString) throw Goe("toString is not a function");
        if ("string" != typeof (e = e.toString())) throw Goe("dirty is not a string, aborting");
      }
      if (!n.isSupported) return e;
      if ((Q || Te(t), (n.removed = []), "string" == typeof e && (se = !1), se)) {
        if (e.nodeName) {
          const t = Ee(e.nodeName);
          if (!F[t] || z[t]) throw Goe("root node is forbidden and cannot be sanitized in-place");
        }
      } else if (e instanceof l)
        ((i = Ae("\x3c!----\x3e")),
          (o = i.ownerDocument.importNode(e, !0)),
          (o.nodeType === Cse && "BODY" === o.nodeName) || "HTML" === o.nodeName
            ? (i = o)
            : i.appendChild(o));
      else {
        if (!ee && !Z && !X && -1 === e.indexOf("<")) return x && ne ? x.createHTML(e) : e;
        if (((i = Ae(e)), !i)) return ee ? null : ne ? w : "";
      }
      i && J && Oe(i.firstChild);
      const d = Pe(se ? e : i);
      for (; (a = d.nextNode()); ) (Ve(a), ze(a), a.content instanceof s && Ue(a.content));
      if (se) return e;
      if (ee) {
        if (te) for (c = k.call(i.ownerDocument); i.firstChild; ) c.appendChild(i.firstChild);
        else c = i;
        return ((V.shadowroot || V.shadowrootmode) && (c = N.call(r, c, !0)), c);
      }
      let u = X ? i.outerHTML : i.innerHTML;
      return (
        X &&
          F["!doctype"] &&
          i.ownerDocument &&
          i.ownerDocument.doctype &&
          i.ownerDocument.doctype.name &&
          Koe(yse, i.ownerDocument.doctype.name) &&
          (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u),
        Z &&
          Aoe([D, T, I], (e) => {
            u = zoe(u, e, " ");
          }),
        x && ne ? x.createHTML(u) : u
      );
    }),
    (n.setConfig = function () {
      (Te(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}), (Q = !0));
    }),
    (n.clearConfig = function () {
      ((Ne = null), (Q = !1));
    }),
    (n.isValidAttribute = function (e, t, n) {
      Ne || Te({});
      const i = Ee(e),
        r = Ee(t);
      return We(i, r, n);
    }),
    (n.addHook = function (e, t) {
      "function" == typeof t && Foe(L[e], t);
    }),
    (n.removeHook = function (e, t) {
      if (void 0 !== t) {
        const n = Poe(L[e], t);
        return -1 === n ? void 0 : Boe(L[e], n, 1)[0];
      }
      return joe(L[e]);
    }),
    (n.removeHooks = function (e) {
      L[e] = [];
    }),
    (n.removeAllHooks = function () {
      L = {
        afterSanitizeAttributes: [],
        afterSanitizeElements: [],
        afterSanitizeShadowDOM: [],
        beforeSanitizeAttributes: [],
        beforeSanitizeElements: [],
        beforeSanitizeShadowDOM: [],
        uponSanitizeAttribute: [],
        uponSanitizeElement: [],
        uponSanitizeShadowNode: [],
      };
    }),
    n
  );
})();
const Tse = 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",
  ]),
  Ise = Object.freeze([
    "href",
    "target",
    "src",
    "alt",
    "title",
    "for",
    "name",
    "role",
    "tabindex",
    "x-dispatch",
    "required",
    "checked",
    "placeholder",
    "type",
    "start",
    "width",
    "height",
    "align",
  ]),
  Rse = "vscode-relative-path";
function Ose(e, t) {
  if ("*" === t.override) return !0;
  try {
    const n = new URL(e, Rse + "://");
    return (
      !!t.override.includes(n.protocol.replace(/:$/, "")) ||
      !(!t.allowRelativePaths || n.protocol !== Rse + ":" || e.trim().toLowerCase().startsWith(Rse))
    );
  } catch (spt) {
    return !1;
  }
}
const Mse = Object.freeze({
  ALLOWED_TAGS: [...Tse],
  ALLOWED_ATTR: [...Ise],
  ALLOW_UNKNOWN_PROTOCOLS: !0,
});
function Ase(e, t, n) {
  try {
    const o = { ...Mse };
    t?.allowedTags &&
      (t.allowedTags.override && (o.ALLOWED_TAGS = [...t.allowedTags.override]),
      t.allowedTags.augment &&
        (o.ALLOWED_TAGS = [...(o.ALLOWED_TAGS ?? []), ...t.allowedTags.augment]));
    let s = [...Ise];
    (t?.allowedAttributes &&
      (t.allowedAttributes.override && (s = [...t.allowedAttributes.override]),
      t.allowedAttributes.augment && (s = [...s, ...t.allowedAttributes.augment])),
      (s = s.map((e) =>
        "string" == typeof e
          ? e.toLowerCase()
          : { attributeName: e.attributeName.toLowerCase(), shouldKeep: e.shouldKeep },
      )));
    const a = new Set(s.map((e) => ("string" == typeof e ? e : e.attributeName))),
      l = new Map();
    for (const e of s) "string" == typeof e ? l.delete(e) : l.set(e.attributeName, e);
    return (
      (o.ALLOWED_ATTR = Array.from(a)),
      (i = {
        override: t?.allowedLinkProtocols?.override ?? [NP.http, NP.https],
        allowRelativePaths: t?.allowRelativeLinkPaths ?? !1,
      }),
      (r = {
        override: t?.allowedMediaProtocols?.override ?? [NP.http, NP.https],
        allowRelativePaths: t?.allowRelativeMediaPaths ?? !1,
      }),
      Dse.addHook("afterSanitizeAttributes", (e) => {
        for (const t of ["href", "src"])
          if (e.hasAttribute(t)) {
            const n = e.getAttribute(t);
            "href" === t
              ? n.startsWith("#") || Ose(n, i) || e.removeAttribute(t)
              : Ose(n, r) || e.removeAttribute(t);
          }
      }),
      t?.replaceWithPlaintext && Dse.addHook("uponSanitizeElement", jse),
      l.size &&
        Dse.addHook("uponSanitizeAttribute", (e, t) => {
          const n = l.get(t.attrName);
          if (n) {
            const i = n.shouldKeep(e, t);
            "string" == typeof i ? ((t.keepAttr = !0), (t.attrValue = i)) : (t.keepAttr = i);
          } else t.keepAttr = a.has(t.attrName);
        }),
      "dom" === n
        ? Dse.sanitize(e, { ...o, RETURN_DOM_FRAGMENT: !0 })
        : Dse.sanitize(e, { ...o, RETURN_TRUSTED_TYPE: !0 })
    );
  } finally {
    Dse.removeAllHooks();
  }
  var i, r;
}
const Pse = [
    "area",
    "base",
    "br",
    "col",
    "command",
    "embed",
    "hr",
    "img",
    "input",
    "keygen",
    "link",
    "meta",
    "param",
    "source",
    "track",
    "wbr",
  ],
  jse = (e, t, n) => {
    if (!t.allowedTags[t.tagName] && "body" !== t.tagName) {
      const t = Fse(e);
      t &&
        (e.nodeType === Node.COMMENT_NODE
          ? e.parentElement?.insertBefore(t, e)
          : e.parentElement?.replaceChild(t, e));
    }
  };
function Fse(e) {
  if (!e.ownerDocument) return;
  let t, n;
  if (e.nodeType === Node.COMMENT_NODE) t = `\x3c!--${e.textContent}--\x3e`;
  else {
    if (!(e instanceof Element)) return;
    {
      const i = e.tagName.toLowerCase(),
        r = Pse.includes(i);
      ((t = `<${i}${
        e.attributes.length
          ? " " +
            Array.from(e.attributes)
              .map((e) => `${e.name}="${e.value}"`)
              .join(" ")
          : ""
      }>`),
        r || (n = `</${i}>`));
    }
  }
  const i = document.createDocumentFragment(),
    r = e.ownerDocument.createTextNode(t);
  for (i.appendChild(r); e.firstChild; ) i.appendChild(e.firstChild);
  const o = n ? e.ownerDocument.createTextNode(n) : void 0;
  return (o && i.appendChild(o), i);
}
function Bse(e, t, n) {
  PB(e, Ase(t, n, "dom"));
}
const Vse = new RegExp(
  `(\\\\)?\\$\\((${AV.iconNameExpression}(?:${AV.iconModifierExpression})?)\\)`,
  "g",
);
function Wse(e) {
  const t = new Array();
  let n,
    i = 0,
    r = 0;
  for (; null !== (n = Vse.exec(e)); ) {
    ((r = n.index || 0), i < r && t.push(e.substring(i, r)), (i = (n.index || 0) + n[0].length));
    const [, o, s] = n;
    t.push(o ? `$(${s})` : Hse({ id: s }));
  }
  return (i < e.length && t.push(e.substring(i)), t);
}
function Hse(e) {
  const t = VB("span");
  return (t.classList.add(...AV.asClassNameArray(e)), t);
}
const zse = Object.freeze({
  image: ({ href: e, title: t, text: n }) => {
    let i = [],
      r = [];
    return (
      e &&
        (({ href: e, dimensions: i } = (function (e) {
          const t = [],
            n = e.split("|").map((e) => e.trim());
          e = n[0];
          const i = n[1];
          if (i) {
            const e = /height=(\d+)/.exec(i),
              n = /width=(\d+)/.exec(i),
              r = e ? e[1] : "",
              o = n ? n[1] : "",
              s = isFinite(parseInt(o)),
              a = isFinite(parseInt(r));
            (s && t.push(`width="${o}"`), a && t.push(`height="${r}"`));
          }
          return { href: e, dimensions: t };
        })(e)),
        r.push(`src="${are(e)}"`)),
      n && r.push(`alt="${are(n)}"`),
      t && r.push(`title="${are(t)}"`),
      i.length && (r = r.concat(i)),
      "<img " + r.join(" ") + ">"
    );
  },
  paragraph({ tokens: e }) {
    return `<p>${this.parser.parseInline(e)}</p>`;
  },
  link({ href: e, title: t, tokens: n }) {
    let i = this.parser.parseInline(n);
    return "string" != typeof e
      ? ""
      : (e === i && (i = lre(i)),
        (t = "string" == typeof t ? are(lre(t)) : ""),
        `<a href="${(e = (e = lre(e)).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"))}" title="${t || e}" draggable="false">${i}</a>`);
  },
});
function Use(e, t = {}, n) {
  const i = new AO();
  let r = !1;
  const o = new _oe(...(t.markedExtensions ?? [])),
    {
      renderer: s,
      codeBlocks: a,
      syncCodeBlocks: l,
    } = (function (e, t, n) {
      const i = new e.Renderer(t.markedOptions);
      ((i.image = zse.image),
        (i.link = zse.link),
        (i.paragraph = zse.paragraph),
        n.supportAlertSyntax &&
          (i.blockquote =
            ((r = i.blockquote),
            function (e) {
              const { tokens: t } = e,
                n = t[0];
              if ("paragraph" !== n?.type) return r.call(this, e);
              const i = n.tokens;
              if (!i || 0 === i.length) return r.call(this, e);
              const o = i[0];
              if ("text" !== o?.type) return r.call(this, e);
              const s = /^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i,
                a = o.raw.match(s);
              if (!a) return r.call(this, e);
              ((o.raw = o.raw.replace(s, "")), (o.text = o.text.replace(s, "")));
              const l = a[1],
                c = l.charAt(0).toUpperCase() + l.slice(1).toLowerCase(),
                d = l.toLowerCase();
              return `<blockquote data-severity="${d}"><p><span>${Hse({ id: { note: "info", tip: "light-bulb", important: "comment", warning: "alert", caution: "stop" }[d] }).outerHTML}${c}</span>${this.parser.parse(t).substring(3)}</blockquote>\n`;
            })));
      var r;
      const o = [],
        s = [];
      t.codeBlockRendererSync
        ? (i.code = ({ text: e, lang: n, raw: i }) => {
            const r = ure.nextId(),
              o = t.codeBlockRendererSync(Gse(n), e, i);
            return (s.push([r, o]), `<div class="code" data-code="${r}">${HM(e)}</div>`);
          })
        : t.codeBlockRenderer &&
          (i.code = ({ text: e, lang: n }) => {
            const i = ure.nextId(),
              r = t.codeBlockRenderer(Gse(n), e);
            return (
              o.push(r.then((e) => [i, e])),
              `<div class="code" data-code="${i}">${HM(e)}</div>`
            );
          });
      n.supportHtml ||
        (i.html = ({ text: e }) => {
          if (t.sanitizerConfig?.replaceWithPlaintext) return HM(e);
          return (n.isTrusted ? e.match(/^(<span[^>]+>)|(<\/\s*span>)$/) : void 0) ? e : "";
        });
      return { renderer: i, codeBlocks: o, syncCodeBlocks: s };
    })(o, t, e),
    c = (function (e) {
      let t = e.value;
      t.length > 1e5 && (t = `${t.substr(0, 1e5)}…`);
      e.supportThemeIcons &&
        (t = (function (e) {
          return e.replace(Xie, (e) => `\\${e}`);
        })(t));
      return t;
    })(e);
  let d;
  if (t.fillInIncompleteTokens) {
    const e = { ...o.defaults, ...t.markedOptions, renderer: s },
      n = (function (e) {
        for (let t = 0; t < aae; t++) {
          const t = lae(e);
          if (!t) break;
          e = t;
        }
        return e;
      })(o.lexer(c, e));
    d = o.parser(n, e);
  } else d = o.parse(c, { ...t?.markedOptions, renderer: s, async: !1 });
  if (e.supportThemeIcons) {
    d = Wse(d)
      .map((e) => ("string" == typeof e ? e : e.outerHTML))
      .join("");
  }
  const u = document.createElement("div");
  let h;
  if (
    (Bse(u, d, Jse(e, t.sanitizerConfig ?? {})),
    (function (e, t, n) {
      for (const r of n.querySelectorAll("img, audio, video, source")) {
        const n = r.getAttribute("src");
        if (n) {
          let o = n;
          try {
            e.baseUri && (o = Zse(mP.from(e.baseUri), o));
          } catch (i) {}
          if ((r.setAttribute("src", Kse(e, o, !0)), t.sanitizerConfig?.remoteImageIsAllowed)) {
            const e = mP.parse(o);
            e.scheme === NP.file ||
              e.scheme === NP.data ||
              t.sanitizerConfig.remoteImageIsAllowed(e) ||
              r.replaceWith(VB("", void 0, r.outerHTML));
          }
        }
      }
      for (const r of n.querySelectorAll("a")) {
        const t = r.getAttribute("href");
        if (
          (r.setAttribute("href", ""),
          !t ||
            /^data:|javascript:/i.test(t) ||
            (/^command:/i.test(t) && !e.isTrusted) ||
            /^command:(\/\/\/)?_workbench\.downloadResource/i.test(t))
        )
          r.replaceWith(...r.childNodes);
        else {
          let n = Kse(e, t, !1);
          (e.baseUri && (n = Zse(mP.from(e.baseUri), t)), (r.dataset.href = n));
        }
      }
    })(e, t, u),
    n ? ((h = n), PB(n, ...u.children)) : (h = u),
    a.length > 0)
  )
    Promise.all(a).then((e) => {
      if (r) return;
      const n = new Map(e),
        i = h.querySelectorAll("div[data-code]");
      for (const t of i) {
        const e = n.get(t.dataset.code ?? "");
        e && PB(t, e);
      }
      t.asyncRenderCallback?.();
    });
  else if (l.length > 0) {
    const e = new Map(l),
      t = h.querySelectorAll("div[data-code]");
    for (const n of t) {
      const t = e.get(n.dataset.code ?? "");
      t && PB(n, t);
    }
  }
  if (t.asyncRenderCallback)
    for (const g of h.getElementsByTagName("img")) {
      const e = i.add(
        $F(g, "load", () => {
          (e.dispose(), t.asyncRenderCallback());
        }),
      );
    }
  if (t.actionHandler) {
    const n = (n) => {
      const i = new EO(MF(h), n);
      (i.leftButton || i.middleButton) && $se(e, t, i);
    };
    (i.add($F(h, "click", n)),
      i.add($F(h, "auxclick", n)),
      i.add(
        $F(h, "keydown", (n) => {
          const i = new wO(n);
          (i.equals(10) || i.equals(3)) && $se(e, t, i);
        }),
      ));
  }
  for (const g of [...h.getElementsByTagName("input")])
    if ("checkbox" === g.attributes.getNamedItem("type")?.value) g.setAttribute("disabled", "");
    else if (t.sanitizerConfig?.replaceWithPlaintext) {
      const e = Fse(g);
      e ? g.parentElement?.replaceChild(e, g) : g.remove();
    } else g.remove();
  return {
    element: h,
    dispose: () => {
      ((r = !0), i.dispose());
    },
  };
}
function $se(e, t, n) {
  const i = n.target.closest("a[data-href]");
  if (SB(i))
    try {
      let n = i.dataset.href;
      n && (e.baseUri && (n = Zse(mP.from(e.baseUri), n)), t.actionHandler?.(n, e));
    } catch (r) {
      HI(r);
    } finally {
      n.preventDefault();
    }
}
function qse(e, t) {
  let n;
  try {
    n = woe(decodeURIComponent(t));
  } catch (spt) {}
  return n
    ? ((n = Vz(n, (t) => (e.uris && e.uris[t] ? mP.revive(e.uris[t]) : void 0))),
      encodeURIComponent(JSON.stringify(n)))
    : t;
}
function Kse(e, t, n) {
  const i = e.uris && e.uris[t];
  let r = mP.revive(i);
  return n
    ? t.startsWith(NP.data + ":")
      ? t
      : (r || (r = mP.parse(t)), RP.uriToBrowserUri(r).toString(!0))
    : r
      ? mP.parse(t).toString() === r.toString()
        ? t
        : (r.query && (r = r.with({ query: qse(e, r.query) })), r.toString())
      : t;
}
function Gse(e) {
  if (!e) return "";
  const t = e.split(/[\s+|:|,|\{|\?]/, 1);
  return t.length ? t[0] : e;
}
function Zse(e, t) {
  return /^\w[\w\d+.-]*:/.test(t)
    ? t
    : e.path.endsWith("/")
      ? mH(e, t).toString()
      : mH(hH(e), t).toString();
}
function Yse(e, t, n = {}) {
  return (function (e, t) {
    return Ase(e, t, "trusted");
  })(e, Jse(t, n));
}
const Xse = Object.freeze([...Tse, "input"]),
  Qse = 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: (e, t) =>
        "SPAN" === e.tagName &&
        "style" === t.attrName &&
        /^(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(
          t.attrValue,
        ),
    },
    {
      attributeName: "class",
      shouldKeep: (e, t) =>
        "SPAN" === e.tagName &&
        "class" === t.attrName &&
        /^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue),
    },
  ]);
function Jse(e, t) {
  const n = e.isTrusted ?? !1,
    i = [
      NP.http,
      NP.https,
      NP.mailto,
      NP.file,
      NP.vscodeFileResource,
      NP.vscodeRemote,
      NP.vscodeRemoteResource,
      NP.vscodeNotebookCell,
    ];
  return (
    n && i.push(NP.command),
    t.allowedLinkSchemes?.augment && i.push(...t.allowedLinkSchemes.augment),
    {
      allowedTags: { override: t.allowedTags?.override ?? Xse },
      allowedAttributes: { override: t.allowedAttributes?.override ?? Qse },
      allowedLinkProtocols: { override: i },
      allowRelativeLinkPaths: !!e.baseUri,
      allowedMediaProtocols: {
        override: [
          NP.http,
          NP.https,
          NP.data,
          NP.file,
          NP.vscodeFileResource,
          NP.vscodeRemote,
          NP.vscodeRemoteResource,
        ],
      },
      allowRelativeMediaPaths: !!e.baseUri,
      replaceWithPlaintext: t.replaceWithPlaintext,
    }
  );
}
const eae = new Map([
  ["&quot;", '"'],
  ["&nbsp;", " "],
  ["&amp;", "&"],
  ["&#39;", "'"],
  ["&lt;", "<"],
  ["&gt;", ">"],
]);
function tae() {
  const e = new goe();
  return (
    (e.code = ({ text: e }) => HM(e)),
    (e.blockquote = ({ text: e }) => e + "\n"),
    (e.html = (e) => ""),
    (e.heading = function ({ tokens: e }) {
      return this.parser.parseInline(e) + "\n";
    }),
    (e.hr = () => ""),
    (e.list = function ({ items: e }) {
      return e.map((e) => this.listitem(e)).join("\n") + "\n";
    }),
    (e.listitem = ({ text: e }) => e + "\n"),
    (e.paragraph = function ({ tokens: e }) {
      return this.parser.parseInline(e) + "\n";
    }),
    (e.table = function ({ header: e, rows: t }) {
      return (
        e.map((e) => this.tablecell(e)).join(" ") +
        "\n" +
        t.map((e) => e.map((e) => this.tablecell(e)).join(" ")).join("\n") +
        "\n"
      );
    }),
    (e.tablerow = ({ text: e }) => e),
    (e.tablecell = function ({ tokens: e }) {
      return this.parser.parseInline(e);
    }),
    (e.strong = ({ text: e }) => e),
    (e.em = ({ text: e }) => e),
    (e.codespan = ({ text: e }) => HM(e)),
    (e.br = (e) => "\n"),
    (e.del = ({ text: e }) => e),
    (e.image = (e) => ""),
    (e.text = ({ text: e }) => e),
    (e.link = ({ text: e }) => e),
    e
  );
}
const nae = new FM(tae);
function iae(e) {
  let t = "";
  return (
    e.forEach((e) => {
      t += e.raw;
    }),
    t
  );
}
function rae(e) {
  if (e.tokens)
    for (let t = e.tokens.length - 1; t >= 0; t--) {
      const n = e.tokens[t];
      if ("text" === n.type) {
        const i = n.raw.split("\n"),
          r = i[i.length - 1];
        if (r.includes("`")) return cae(e);
        if (r.includes("**")) return fae(e);
        if (r.match(/\*\w/)) return dae(e);
        if (r.match(/(^|\s)__\w/)) return mae(e);
        if (r.match(/(^|\s)_\w/)) return uae(e);
        if (
          oae(r) ||
          (sae(r) &&
            e.tokens.slice(0, t).some((e) => "text" === e.type && e.raw.match(/\[[^\]]*$/)))
        ) {
          const n = e.tokens.slice(t + 1);
          return ("link" === n[0]?.type && "text" === n[1]?.type && n[1].raw.match(/^ *"[^"]*$/)) ||
            r.match(/^[^"]* +"[^"]*$/)
            ? gae(e)
            : hae(e);
        }
        if (r.match(/(^|\s)\[\w*[^\]]*$/)) return pae(e);
      }
    }
}
function oae(e) {
  return !!e.match(/(^|\s)\[.*\]\(\w*/);
}
function sae(e) {
  return !!e.match(/^[^\[]*\]\([^\)]*$/);
}
new FM(() => {
  const e = tae();
  return ((e.code = ({ text: e }) => `\n\`\`\`\n${HM(e)}\n\`\`\`\n`), e);
});
const aae = 3;
function lae(e) {
  let t, n;
  for (t = 0; t < e.length; t++) {
    const i = e[t];
    if ("paragraph" === i.type && i.raw.match(/(\n|^)\|/)) {
      n = vae(e.slice(t));
      break;
    }
  }
  const i = e.at(-1);
  if (!n && "list" === i?.type) {
    const r = (function (e) {
      const t = e.items[e.items.length - 1],
        n = t.tokens ? t.tokens[t.tokens.length - 1] : void 0,
        i = (e) => {
          const t = e.items.at(-1),
            n = t?.tokens.at(-1);
          return "heading" === n?.type || ("list" === n?.type && i(n));
        };
      let r;
      if ("text" !== n?.type || "inRawBlock" in t) {
        if (i(e)) {
          const t = xoe(e.raw.trim() + " &nbsp;")[0];
          if ("list" !== t.type) return;
          return t;
        }
      } else r = rae(n);
      if (!r || "paragraph" !== r.type) return;
      const o = iae(e.items.slice(0, -1)),
        s = t.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];
      if (!s) return;
      const a = s + iae(t.tokens.slice(0, -1)) + r.raw,
        l = xoe(o + a)[0];
      return "list" === l.type ? l : void 0;
    })(i);
    r && ((n = [r]), (t = e.length - 1));
  }
  if (!n && "paragraph" === i?.type) {
    const r = rae(i);
    r && ((n = [r]), (t = e.length - 1));
  }
  if (n) {
    const i = [...e.slice(0, t), ...n];
    return ((i.links = e.links), i);
  }
  if ("heading" === i?.type) {
    const t = (function (e, t) {
      if (e.raw.match(/-\s*$/)) return xoe(t + " &nbsp;");
    })(i, iae(e));
    if (t) return t;
  }
  return null;
}
function cae(e) {
  return _ae(e, "`");
}
function dae(e) {
  return _ae(e, "*");
}
function uae(e) {
  return _ae(e, "_");
}
function hae(e) {
  return _ae(e, ")", !1);
}
function gae(e) {
  return _ae(e, '")', !1);
}
function pae(e) {
  return _ae(e, "](https://microsoft.com)", !1);
}
function fae(e) {
  return _ae(e, "**");
}
function mae(e) {
  return _ae(e, "__");
}
function _ae(e, t, n = !0) {
  const i = iae(Array.isArray(e) ? e : [e]),
    r = n ? i.trimEnd() : i;
  return xoe(r + t)[0];
}
function vae(e) {
  const t = iae(e),
    n = t.split("\n");
  let i,
    r = !1;
  for (let o = 0; o < n.length; o++) {
    const e = n[o].trim();
    if (void 0 === i && e.match(/^\s*\|/)) {
      const t = e.match(/(\|[^\|]+)(?=\||$)/g);
      t && (i = t.length);
    } else if ("number" == typeof i) {
      if (!e.match(/^\s*\|/)) return;
      if (o !== n.length - 1) return;
      r = !0;
    }
  }
  if ("number" == typeof i && i > 0) {
    const e = r ? n.slice(0, -1).join("\n") : t,
      o = !!e.match(/\|\s*$/),
      s = e + (o ? "" : "|") + `\n|${" --- |".repeat(i)}`;
    return xoe(s);
  }
}
let bae = {
  showInstantHover: () => {},
  showDelayedHover: () => {},
  setupDelayedHover: () => PO.None,
  setupDelayedHoverAtMouse: () => PO.None,
  hideHover: () => {},
  showAndFocusLastHover: () => {},
  setupManagedHover: () => ({
    dispose: () => {},
    show: () => {},
    hide: () => {},
    update: () => {},
  }),
  showManagedHover: () => {},
};
function yae() {
  return bae;
}
class xae {
  constructor(e) {
    this.spliceables = e;
  }
  splice(e, t, n) {
    this.spliceables.forEach((i) => i.splice(e, t, n));
  }
}
function wae(e, t, n) {
  return Math.min(Math.max(e, t), n);
}
class Cae {
  constructor() {
    ((this._n = 1), (this._val = 0));
  }
  update(e) {
    return ((this._val = this._val + (e - this._val) / this._n), (this._n += 1), this._val);
  }
  get value() {
    return this._val;
  }
}
class Sae {
  constructor(e) {
    ((this._n = 0),
      (this._val = 0),
      (this._values = []),
      (this._index = 0),
      (this._sum = 0),
      (this._values = new Array(e)),
      this._values.fill(0, 0, e));
  }
  update(e) {
    const t = this._values[this._index];
    return (
      (this._values[this._index] = e),
      (this._index = (this._index + 1) % this._values.length),
      (this._sum -= t),
      (this._sum += e),
      this._n < this._values.length && (this._n += 1),
      (this._val = this._sum / this._n),
      this._val
    );
  }
  get value() {
    return this._val;
  }
}
class kae extends Error {
  constructor(e, t) {
    super(`ListError [${e}] ${t}`);
  }
}
var Eae;
function Nae(e, t) {
  const n = [];
  for (const i of t) {
    if (e.start >= i.range.end) continue;
    if (e.end < i.range.start) break;
    const t = Eae.intersect(e, i.range);
    Eae.isEmpty(t) || n.push({ range: t, size: i.size });
  }
  return n;
}
function Lae({ start: e, end: t }, n) {
  return { start: e + n, end: t + n };
}
!(function (e) {
  function t(e, t) {
    if (e.start >= t.end || t.start >= e.end) return { start: 0, end: 0 };
    const n = Math.max(e.start, t.start),
      i = Math.min(e.end, t.end);
    return i - n <= 0 ? { start: 0, end: 0 } : { start: n, end: i };
  }
  function n(e) {
    return e.end - e.start <= 0;
  }
  ((e.intersect = t),
    (e.isEmpty = n),
    (e.intersects = function (e, i) {
      return !n(t(e, i));
    }),
    (e.relativeComplement = function (e, t) {
      const i = [],
        r = { start: e.start, end: Math.min(t.start, e.end) },
        o = { start: Math.max(t.end, e.start), end: e.end };
      return (n(r) || i.push(r), n(o) || i.push(o), i);
    }));
})(Eae || (Eae = {}));
class Dae {
  get paddingTop() {
    return this._paddingTop;
  }
  set paddingTop(e) {
    ((this._size = this._size + e - this._paddingTop), (this._paddingTop = e));
  }
  constructor(e) {
    ((this.groups = []),
      (this._size = 0),
      (this._paddingTop = 0),
      (this._paddingTop = e ?? 0),
      (this._size = this._paddingTop));
  }
  splice(e, t, n = []) {
    const i = n.length - t,
      r = Nae({ start: 0, end: e }, this.groups),
      o = Nae({ start: e + t, end: Number.POSITIVE_INFINITY }, this.groups).map((e) => ({
        range: Lae(e.range, i),
        size: e.size,
      })),
      s = n.map((t, n) => ({ range: { start: e + n, end: e + n + 1 }, size: t.size }));
    ((this.groups = (function (...e) {
      return (function (e) {
        const t = [];
        let n = null;
        for (const i of e) {
          const e = i.range.start,
            r = i.range.end,
            o = i.size;
          n && o === n.size
            ? (n.range.end = r)
            : ((n = { range: { start: e, end: r }, size: o }), t.push(n));
        }
        return t;
      })(e.reduce((e, t) => e.concat(t), []));
    })(r, s, o)),
      (this._size =
        this._paddingTop +
        this.groups.reduce((e, t) => e + t.size * (t.range.end - t.range.start), 0)));
  }
  get count() {
    const e = this.groups.length;
    return e ? this.groups[e - 1].range.end : 0;
  }
  get size() {
    return this._size;
  }
  indexAt(e) {
    if (e < 0) return -1;
    if (e < this._paddingTop) return 0;
    let t = 0,
      n = this._paddingTop;
    for (const i of this.groups) {
      const r = i.range.end - i.range.start,
        o = n + r * i.size;
      if (e < o) return t + Math.floor((e - n) / i.size);
      ((t += r), (n = o));
    }
    return t;
  }
  indexAfter(e) {
    return Math.min(this.indexAt(e) + 1, this.count);
  }
  positionAt(e) {
    if (e < 0) return -1;
    let t = 0,
      n = 0;
    for (const i of this.groups) {
      const r = i.range.end - i.range.start,
        o = n + r;
      if (e < o) return this._paddingTop + t + (e - n) * i.size;
      ((t += r * i.size), (n = o));
    }
    return -1;
  }
}
class Tae {
  constructor(e) {
    ((this.renderers = e),
      (this.cache = new Map()),
      (this.transactionNodesPendingRemoval = new Set()),
      (this.inTransaction = !1));
  }
  alloc(e) {
    let t = this.getTemplateCache(e).pop(),
      n = !1;
    if (t)
      ((n = this.transactionNodesPendingRemoval.has(t.domNode)),
        n && this.transactionNodesPendingRemoval.delete(t.domNode));
    else {
      const n = VB(".monaco-list-row");
      t = { domNode: n, templateId: e, templateData: this.getRenderer(e).renderTemplate(n) };
    }
    return { row: t, isReusingConnectedDomNode: n };
  }
  release(e) {
    e && this.releaseRow(e);
  }
  transact(e) {
    if (this.inTransaction) throw new Error("Already in transaction");
    this.inTransaction = !0;
    try {
      e();
    } finally {
      for (const e of this.transactionNodesPendingRemoval) this.doRemoveNode(e);
      (this.transactionNodesPendingRemoval.clear(), (this.inTransaction = !1));
    }
  }
  releaseRow(e) {
    const { domNode: t, templateId: n } = e;
    t && (this.inTransaction ? this.transactionNodesPendingRemoval.add(t) : this.doRemoveNode(t));
    this.getTemplateCache(n).push(e);
  }
  doRemoveNode(e) {
    (e.classList.remove("scrolling"), e.remove());
  }
  getTemplateCache(e) {
    let t = this.cache.get(e);
    return (t || ((t = []), this.cache.set(e, t)), t);
  }
  dispose() {
    (this.cache.forEach((e, t) => {
      for (const n of e) {
        (this.getRenderer(t).disposeTemplate(n.templateData), (n.templateData = null));
      }
    }),
      this.cache.clear(),
      this.transactionNodesPendingRemoval.clear());
  }
  getRenderer(e) {
    const t = this.renderers.get(e);
    if (!t) throw new Error(`No renderer found for ${e}`);
    return t;
  }
}
var Iae = function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
};
const Rae = { CurrentDragAndDropData: void 0 },
  Oae = {
    useShadows: !0,
    verticalScrollMode: 1,
    setRowLineHeight: !0,
    setRowHeight: !0,
    supportDynamicHeights: !1,
    dnd: {
      getDragElements: (e) => [e],
      getDragURI: () => null,
      onDragStart() {},
      onDragOver: () => !1,
      drop() {},
      dispose() {},
    },
    horizontalScrolling: !1,
    transformOptimization: !0,
    alwaysConsumeMouseWheel: !0,
  };
class Mae {
  constructor(e) {
    this.elements = e;
  }
  update() {}
  getData() {
    return this.elements;
  }
}
class Aae {
  constructor(e) {
    this.elements = e;
  }
  update() {}
  getData() {
    return this.elements;
  }
}
class Pae {
  constructor() {
    ((this.types = []), (this.files = []));
  }
  update(e) {
    if ((e.types && this.types.splice(0, this.types.length, ...e.types), e.files)) {
      this.files.splice(0, this.files.length);
      for (let t = 0; t < e.files.length; t++) {
        const n = e.files.item(t);
        n && (n.size || n.type) && this.files.push(n);
      }
    }
  }
  getData() {
    return { types: this.types, files: this.files };
  }
}
class jae {
  constructor(e) {
    ((this.getSetSize = e?.getSetSize ? e.getSetSize.bind(e) : (e, t, n) => n),
      (this.getPosInSet = e?.getPosInSet ? e.getPosInSet.bind(e) : (e, t) => t + 1),
      (this.getRole = e?.getRole ? e.getRole.bind(e) : (e) => "listitem"),
      (this.isChecked = e?.isChecked ? e.isChecked.bind(e) : (e) => {}));
  }
}
class Fae {
  static {
    this.InstanceCount = 0;
  }
  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(e) {
    if (e !== this._horizontalScrolling) {
      if (e && this.supportDynamicHeights)
        throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");
      if (
        ((this._horizontalScrolling = e),
        this.domNode.classList.toggle("horizontal-scrolling", this._horizontalScrolling),
        this._horizontalScrolling)
      ) {
        for (const e of this.items) this.measureItemWidth(e);
        (this.updateScrollWidth(),
          this.scrollableElement.setScrollDimensions({ width: dB(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(e, t, n, i = Oae) {
    if (
      ((this.virtualDelegate = t),
      (this.domId = "list_id_" + ++Fae.InstanceCount),
      (this.renderers = new Map()),
      (this.renderWidth = 0),
      (this._scrollHeight = 0),
      (this.scrollableElementUpdateDisposable = null),
      (this.scrollableElementWidthDelayer = new mM(50)),
      (this.splicing = !1),
      (this.dragOverAnimationStopDisposable = PO.None),
      (this.dragOverMouseY = 0),
      (this.canDrop = !1),
      (this.currentDragFeedbackDisposable = PO.None),
      (this.onDragLeaveTimeout = PO.None),
      (this.currentSelectionDisposable = PO.None),
      (this.disposables = new AO()),
      (this._onDidChangeContentHeight = new QO()),
      (this._onDidChangeContentWidth = new QO()),
      (this.onDidChangeContentHeight = $O.latch(
        this._onDidChangeContentHeight.event,
        void 0,
        this.disposables,
      )),
      (this._horizontalScrolling = !1),
      i.horizontalScrolling && i.supportDynamicHeights)
    )
      throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");
    ((this.items = []),
      (this.itemId = 0),
      (this.rangeMap = this.createRangeMap(i.paddingTop ?? 0)));
    for (const r of n) this.renderers.set(r.templateId, r);
    ((this.cache = this.disposables.add(new Tae(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",
        "boolean" != typeof i.mouseSupport || i.mouseSupport,
      ),
      (this._horizontalScrolling = i.horizontalScrolling ?? Oae.horizontalScrolling),
      this.domNode.classList.toggle("horizontal-scrolling", this._horizontalScrolling),
      (this.paddingBottom = void 0 === i.paddingBottom ? 0 : i.paddingBottom),
      (this.accessibilityProvider = new jae(i.accessibilityProvider)),
      (this.rowsContainer = document.createElement("div")),
      (this.rowsContainer.className = "monaco-list-rows"));
    if (
      ((i.transformOptimization ?? Oae.transformOptimization) &&
        ((this.rowsContainer.style.transform = "translate3d(0px, 0px, 0px)"),
        (this.rowsContainer.style.overflow = "hidden"),
        (this.rowsContainer.style.contain = "strict")),
      this.disposables.add(iJ.addTarget(this.rowsContainer)),
      (this.scrollable = this.disposables.add(
        new gJ({
          forceIntegerValues: !0,
          smoothScrollDuration: i.smoothScrolling ? 125 : 0,
          scheduleAtNextAnimationFrame: (e) => JF(MF(this.domNode), e),
        }),
      )),
      (this.scrollableElement = this.disposables.add(
        new xJ(
          this.rowsContainer,
          {
            alwaysConsumeMouseWheel: i.alwaysConsumeMouseWheel ?? Oae.alwaysConsumeMouseWheel,
            horizontal: 1,
            vertical: i.verticalScrollMode ?? Oae.verticalScrollMode,
            useShadows: i.useShadows ?? Oae.useShadows,
            mouseWheelScrollSensitivity: i.mouseWheelScrollSensitivity,
            fastScrollSensitivity: i.fastScrollSensitivity,
            scrollByPage: i.scrollByPage,
          },
          this.scrollable,
        ),
      )),
      this.domNode.appendChild(this.scrollableElement.getDomNode()),
      e.appendChild(this.domNode),
      this.scrollableElement.onScroll(this.onScroll, this, this.disposables),
      this.disposables.add($F(this.rowsContainer, nJ.Change, (e) => this.onTouchChange(e))),
      this.disposables.add(
        $F(this.scrollableElement.getDomNode(), "scroll", (e) => {
          const t = e.target,
            n = t.scrollTop;
          ((t.scrollTop = 0), i.scrollToActiveElement && this.setScrollTop(this.scrollTop + n));
        }),
      ),
      this.disposables.add(
        $F(this.domNode, "dragover", (e) => this.onDragOver(this.toDragEvent(e))),
      ),
      this.disposables.add($F(this.domNode, "drop", (e) => this.onDrop(this.toDragEvent(e)))),
      this.disposables.add(
        $F(this.domNode, "dragleave", (e) => this.onDragLeave(this.toDragEvent(e))),
      ),
      this.disposables.add($F(this.domNode, "dragend", (e) => this.onDragEnd(e))),
      i.userSelection)
    ) {
      if (i.dnd) throw new Error("DND and user selection cannot be used simultaneously");
      this.disposables.add($F(this.domNode, "mousedown", (e) => this.onPotentialSelectionStart(e)));
    }
    ((this.setRowLineHeight = i.setRowLineHeight ?? Oae.setRowLineHeight),
      (this.setRowHeight = i.setRowHeight ?? Oae.setRowHeight),
      (this.supportDynamicHeights = i.supportDynamicHeights ?? Oae.supportDynamicHeights),
      (this.dnd = i.dnd ?? this.disposables.add(Oae.dnd)),
      this.layout(i.initialSize?.height, i.initialSize?.width),
      i.scrollToActiveElement && this._setupFocusObserver(e));
  }
  _setupFocusObserver(e) {
    this.disposables.add(
      $F(
        e,
        "focus",
        () => {
          const t = vB();
          this.activeElement !== t &&
            null !== t &&
            ((this.activeElement = t), this._scrollToActiveElement(this.activeElement, e));
        },
        !0,
      ),
    );
  }
  _scrollToActiveElement(e, t) {
    const n = t.getBoundingClientRect(),
      i = e.getBoundingClientRect().top - n.top;
    i < 0 && this.setScrollTop(this.scrollTop + i);
  }
  updateOptions(e) {
    let t;
    if (
      (void 0 !== e.paddingBottom &&
        ((this.paddingBottom = e.paddingBottom),
        this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight })),
      void 0 !== e.smoothScrolling &&
        this.scrollable.setSmoothScrollDuration(e.smoothScrolling ? 125 : 0),
      void 0 !== e.horizontalScrolling && (this.horizontalScrolling = e.horizontalScrolling),
      void 0 !== e.scrollByPage && (t = { ...(t ?? {}), scrollByPage: e.scrollByPage }),
      void 0 !== e.mouseWheelScrollSensitivity &&
        (t = { ...(t ?? {}), mouseWheelScrollSensitivity: e.mouseWheelScrollSensitivity }),
      void 0 !== e.fastScrollSensitivity &&
        (t = { ...(t ?? {}), fastScrollSensitivity: e.fastScrollSensitivity }),
      t && this.scrollableElement.updateOptions(t),
      void 0 !== e.paddingTop && e.paddingTop !== this.rangeMap.paddingTop)
    ) {
      const t = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight),
        n = e.paddingTop - this.rangeMap.paddingTop;
      ((this.rangeMap.paddingTop = e.paddingTop),
        this.render(
          t,
          Math.max(0, this.lastRenderTop + n),
          this.lastRenderHeight,
          void 0,
          void 0,
          !0,
        ),
        this.setScrollTop(this.lastRenderTop),
        this.eventuallyUpdateScrollDimensions(),
        this.supportDynamicHeights && this._rerender(this.lastRenderTop, this.lastRenderHeight));
    }
  }
  createRangeMap(e) {
    return new Dae(e);
  }
  splice(e, t, n = []) {
    if (this.splicing) throw new Error("Can't run recursive splices.");
    this.splicing = !0;
    try {
      return this._splice(e, t, n);
    } finally {
      ((this.splicing = !1), this._onDidChangeContentHeight.fire(this.contentHeight));
    }
  }
  _splice(e, t, n = []) {
    const i = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight),
      r = { start: e, end: e + t },
      o = Eae.intersect(i, r),
      s = new Map();
    for (let b = o.end - 1; b >= o.start; b--) {
      const e = this.items[b];
      if ((e.dragStartDisposable.dispose(), e.checkedDisposable.dispose(), e.row)) {
        let t = s.get(e.templateId);
        t || ((t = []), s.set(e.templateId, t));
        const n = this.renderers.get(e.templateId);
        (n &&
          n.disposeElement &&
          n.disposeElement(e.element, b, e.row.templateData, { height: e.size }),
          t.unshift(e.row));
      }
      ((e.row = null), (e.stale = !0));
    }
    const a = { start: e + t, end: this.items.length },
      l = Eae.intersect(a, i),
      c = Eae.relativeComplement(a, i),
      d = n.map((e) => ({
        id: String(this.itemId++),
        element: e,
        templateId: this.virtualDelegate.getTemplateId(e),
        size: this.virtualDelegate.getHeight(e),
        width: void 0,
        hasDynamicHeight:
          !!this.virtualDelegate.hasDynamicHeight && this.virtualDelegate.hasDynamicHeight(e),
        lastDynamicHeightWidth: void 0,
        row: null,
        uri: void 0,
        dropTarget: !1,
        dragStartDisposable: PO.None,
        checkedDisposable: PO.None,
        stale: !1,
      }));
    let u;
    0 === e && t >= this.items.length
      ? ((this.rangeMap = this.createRangeMap(this.rangeMap.paddingTop)),
        this.rangeMap.splice(0, 0, d),
        (u = this.items),
        (this.items = d))
      : (this.rangeMap.splice(e, t, d), (u = mj(this.items, e, t, d)));
    const h = n.length - t,
      g = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight),
      p = Lae(l, h),
      f = Eae.intersect(g, p);
    for (let b = f.start; b < f.end; b++) this.updateItemInDOM(this.items[b], b);
    const m = Eae.relativeComplement(p, g);
    for (const b of m) for (let e = b.start; e < b.end; e++) this.removeItemFromDOM(e);
    const _ = c.map((e) => Lae(e, h)),
      v = [{ start: e, end: e + n.length }, ..._].map((e) => Eae.intersect(g, e)).reverse();
    for (const b of v)
      for (let e = b.end - 1; e >= b.start; e--) {
        const t = this.items[e],
          n = s.get(t.templateId),
          i = n?.pop();
        this.insertItemInDOM(e, i);
      }
    for (const b of s.values()) for (const e of b) this.cache.release(e);
    return (
      this.eventuallyUpdateScrollDimensions(),
      this.supportDynamicHeights && this._rerender(this.scrollTop, this.renderHeight),
      u.map((e) => e.element)
    );
  }
  eventuallyUpdateScrollDimensions() {
    ((this._scrollHeight = this.contentHeight),
      (this.rowsContainer.style.height = `${this._scrollHeight}px`),
      this.scrollableElementUpdateDisposable ||
        (this.scrollableElementUpdateDisposable = JF(MF(this.domNode), () => {
          (this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }),
            this.updateScrollWidth(),
            (this.scrollableElementUpdateDisposable = null));
        })));
  }
  eventuallyUpdateScrollWidth() {
    this.horizontalScrolling
      ? this.scrollableElementWidthDelayer.trigger(() => this.updateScrollWidth())
      : this.scrollableElementWidthDelayer.cancel();
  }
  updateScrollWidth() {
    if (!this.horizontalScrolling) return;
    let e = 0;
    for (const t of this.items) void 0 !== t.width && (e = Math.max(e, t.width));
    ((this.scrollWidth = e),
      this.scrollableElement.setScrollDimensions({ scrollWidth: 0 === e ? 0 : e + 10 }),
      this._onDidChangeContentWidth.fire(this.scrollWidth));
  }
  rerender() {
    if (this.supportDynamicHeights) {
      for (const e of this.items) e.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(e) {
    return this.items[e].element;
  }
  indexOf(e) {
    return this.items.findIndex((t) => t.element === e);
  }
  domElement(e) {
    const t = this.items[e].row;
    return t && t.domNode;
  }
  elementHeight(e) {
    return this.items[e].size;
  }
  elementTop(e) {
    return this.rangeMap.positionAt(e);
  }
  indexAt(e) {
    return this.rangeMap.indexAt(e);
  }
  indexAfter(e) {
    return this.rangeMap.indexAfter(e);
  }
  layout(e, t) {
    const n = { height: "number" == typeof e ? e : uB(this.domNode) };
    (this.scrollableElementUpdateDisposable &&
      (this.scrollableElementUpdateDisposable.dispose(),
      (this.scrollableElementUpdateDisposable = null),
      (n.scrollHeight = this.scrollHeight)),
      this.scrollableElement.setScrollDimensions(n),
      void 0 !== t &&
        ((this.renderWidth = t),
        this.supportDynamicHeights && this._rerender(this.scrollTop, this.renderHeight)),
      this.horizontalScrolling &&
        this.scrollableElement.setScrollDimensions({
          width: "number" == typeof t ? t : dB(this.domNode),
        }));
  }
  render(e, t, n, i, r, o = !1, s = !1) {
    const a = this.getRenderRange(t, n),
      l = Eae.relativeComplement(a, e).reverse(),
      c = Eae.relativeComplement(e, a);
    if (o) {
      const t = Eae.intersect(e, a);
      for (let e = t.start; e < t.end; e++) this.updateItemInDOM(this.items[e], e);
    }
    (this.cache.transact(() => {
      for (const e of c) for (let t = e.start; t < e.end; t++) this.removeItemFromDOM(t, s);
      for (const e of l) for (let t = e.end - 1; t >= e.start; t--) this.insertItemInDOM(t);
    }),
      void 0 !== i && (this.rowsContainer.style.left = `-${i}px`),
      (this.rowsContainer.style.top = `-${t}px`),
      this.horizontalScrolling &&
        void 0 !== r &&
        (this.rowsContainer.style.width = `${Math.max(r, this.renderWidth)}px`),
      (this.lastRenderTop = t),
      (this.lastRenderHeight = n));
  }
  insertItemInDOM(e, t) {
    const n = this.items[e];
    if (!n.row)
      if (t) ((n.row = t), (n.stale = !0));
      else {
        const e = this.cache.alloc(n.templateId);
        ((n.row = e.row), (n.stale ||= e.isReusingConnectedDomNode));
      }
    const i = this.accessibilityProvider.getRole(n.element) || "listitem";
    n.row.domNode.setAttribute("role", i);
    const r = this.accessibilityProvider.isChecked(n.element),
      o = (e) => ("mixed" === e ? "mixed" : String(!!e));
    if ("boolean" == typeof r || "mixed" === r) n.row.domNode.setAttribute("aria-checked", o(r));
    else if (r) {
      const e = (e) => n.row.domNode.setAttribute("aria-checked", o(e));
      (e(r.value), (n.checkedDisposable = r.onDidChange(() => e(r.value))));
    }
    if (n.stale || !n.row.domNode.parentElement) {
      const t = this.items.at(e + 1)?.row?.domNode ?? null;
      ((n.row.domNode.parentElement === this.rowsContainer &&
        n.row.domNode.nextElementSibling === t) ||
        this.rowsContainer.insertBefore(n.row.domNode, t),
        (n.stale = !1));
    }
    this.updateItemInDOM(n, e);
    const s = this.renderers.get(n.templateId);
    if (!s) throw new Error(`No renderer found for template id ${n.templateId}`);
    s?.renderElement(n.element, e, n.row.templateData, { height: n.size });
    const a = this.dnd.getDragURI(n.element);
    (n.dragStartDisposable.dispose(),
      (n.row.domNode.draggable = !!a),
      a &&
        (n.dragStartDisposable = $F(n.row.domNode, "dragstart", (e) =>
          this.onDragStart(n.element, a, e),
        )),
      this.horizontalScrolling && (this.measureItemWidth(n), this.eventuallyUpdateScrollWidth()));
  }
  measureItemWidth(e) {
    if (!e.row || !e.row.domNode) return;
    ((e.row.domNode.style.width = "fit-content"), (e.width = dB(e.row.domNode)));
    const t = MF(e.row.domNode).getComputedStyle(e.row.domNode);
    (t.paddingLeft && (e.width += parseFloat(t.paddingLeft)),
      t.paddingRight && (e.width += parseFloat(t.paddingRight)),
      (e.row.domNode.style.width = ""));
  }
  updateItemInDOM(e, t) {
    ((e.row.domNode.style.top = `${this.elementTop(t)}px`),
      this.setRowHeight && (e.row.domNode.style.height = `${e.size}px`),
      this.setRowLineHeight && (e.row.domNode.style.lineHeight = `${e.size}px`),
      e.row.domNode.setAttribute("data-index", `${t}`),
      e.row.domNode.setAttribute("data-last-element", t === this.length - 1 ? "true" : "false"),
      e.row.domNode.setAttribute("data-parity", t % 2 == 0 ? "even" : "odd"),
      e.row.domNode.setAttribute(
        "aria-setsize",
        String(this.accessibilityProvider.getSetSize(e.element, t, this.length)),
      ),
      e.row.domNode.setAttribute(
        "aria-posinset",
        String(this.accessibilityProvider.getPosInSet(e.element, t)),
      ),
      e.row.domNode.setAttribute("id", this.getElementDomId(t)),
      e.row.domNode.classList.toggle("drop-target", e.dropTarget));
  }
  removeItemFromDOM(e, t) {
    const n = this.items[e];
    if ((n.dragStartDisposable.dispose(), n.checkedDisposable.dispose(), n.row)) {
      const i = this.renderers.get(n.templateId);
      (i &&
        i.disposeElement &&
        i.disposeElement(n.element, e, n.row.templateData, { height: n.size, onScroll: t }),
        this.cache.release(n.row),
        (n.row = null));
    }
    this.horizontalScrolling && this.eventuallyUpdateScrollWidth();
  }
  getScrollTop() {
    return this.scrollableElement.getScrollPosition().scrollTop;
  }
  setScrollTop(e, t) {
    (this.scrollableElementUpdateDisposable &&
      (this.scrollableElementUpdateDisposable.dispose(),
      (this.scrollableElementUpdateDisposable = null),
      this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight })),
      this.scrollableElement.setScrollPosition({ scrollTop: e, reuseAnimation: t }));
  }
  get scrollTop() {
    return this.getScrollTop();
  }
  set scrollTop(e) {
    this.setScrollTop(e);
  }
  get scrollHeight() {
    return this._scrollHeight + (this.horizontalScrolling ? 10 : 0) + this.paddingBottom;
  }
  get onMouseClick() {
    return $O.map(
      this.disposables.add(new RJ(this.domNode, "click")).event,
      (e) => this.toMouseEvent(e),
      this.disposables,
    );
  }
  get onMouseDblClick() {
    return $O.map(
      this.disposables.add(new RJ(this.domNode, "dblclick")).event,
      (e) => this.toMouseEvent(e),
      this.disposables,
    );
  }
  get onMouseMiddleClick() {
    return $O.filter(
      $O.map(
        this.disposables.add(new RJ(this.domNode, "auxclick")).event,
        (e) => this.toMouseEvent(e),
        this.disposables,
      ),
      (e) => 1 === e.browserEvent.button,
      this.disposables,
    );
  }
  get onMouseDown() {
    return $O.map(
      this.disposables.add(new RJ(this.domNode, "mousedown")).event,
      (e) => this.toMouseEvent(e),
      this.disposables,
    );
  }
  get onMouseOver() {
    return $O.map(
      this.disposables.add(new RJ(this.domNode, "mouseover")).event,
      (e) => this.toMouseEvent(e),
      this.disposables,
    );
  }
  get onMouseOut() {
    return $O.map(
      this.disposables.add(new RJ(this.domNode, "mouseout")).event,
      (e) => this.toMouseEvent(e),
      this.disposables,
    );
  }
  get onContextMenu() {
    return $O.any(
      $O.map(
        this.disposables.add(new RJ(this.domNode, "contextmenu")).event,
        (e) => this.toMouseEvent(e),
        this.disposables,
      ),
      $O.map(
        this.disposables.add(new RJ(this.domNode, nJ.Contextmenu)).event,
        (e) => this.toGestureEvent(e),
        this.disposables,
      ),
    );
  }
  get onTouchStart() {
    return $O.map(
      this.disposables.add(new RJ(this.domNode, "touchstart")).event,
      (e) => this.toTouchEvent(e),
      this.disposables,
    );
  }
  get onTap() {
    return $O.map(
      this.disposables.add(new RJ(this.rowsContainer, nJ.Tap)).event,
      (e) => this.toGestureEvent(e),
      this.disposables,
    );
  }
  toMouseEvent(e) {
    const t = this.getItemIndexFromEventTarget(e.target || null),
      n = void 0 === t ? void 0 : this.items[t];
    return { browserEvent: e, index: t, element: n && n.element };
  }
  toTouchEvent(e) {
    const t = this.getItemIndexFromEventTarget(e.target || null),
      n = void 0 === t ? void 0 : this.items[t];
    return { browserEvent: e, index: t, element: n && n.element };
  }
  toGestureEvent(e) {
    const t = this.getItemIndexFromEventTarget(e.initialTarget || null),
      n = void 0 === t ? void 0 : this.items[t];
    return { browserEvent: e, index: t, element: n && n.element };
  }
  toDragEvent(e) {
    const t = this.getItemIndexFromEventTarget(e.target || null),
      n = void 0 === t ? void 0 : this.items[t];
    return {
      browserEvent: e,
      index: t,
      element: n && n.element,
      sector: this.getTargetSector(e, t),
    };
  }
  onScroll(e) {
    try {
      const t = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
      (this.render(t, e.scrollTop, e.height, e.scrollLeft, e.scrollWidth, void 0, !0),
        this.supportDynamicHeights && this._rerender(e.scrollTop, e.height, e.inSmoothScrolling));
    } catch (t) {
      throw t;
    }
  }
  onTouchChange(e) {
    (e.preventDefault(), e.stopPropagation(), (this.scrollTop -= e.translationY));
  }
  onDragStart(e, t, n) {
    if (!n.dataTransfer) return;
    const i = this.dnd.getDragElements(e);
    let r;
    ((n.dataTransfer.effectAllowed = "copyMove"),
      n.dataTransfer.setData(Ane.TEXT, t),
      this.dnd.getDragLabel && (r = this.dnd.getDragLabel(i, n)),
      void 0 === r && (r = String(i.length)),
      (function (e, t, n, i = []) {
        if (!e.dataTransfer) return;
        const r = VB(".monaco-drag-image");
        ((r.textContent = n), r.classList.add(...i));
        const o = ((e) => {
          for (; e && !e.classList.contains("monaco-workbench"); ) e = e.parentElement;
          return e || t.ownerDocument.body;
        })(t);
        (o.appendChild(r),
          e.dataTransfer.setDragImage(r, -10, -10),
          setTimeout(() => r.remove(), 0));
      })(n, this.domNode, r, [this.domId]),
      this.domNode.classList.add("dragging"),
      (this.currentDragData = new Mae(i)),
      (Rae.CurrentDragAndDropData = new Aae(i)),
      this.dnd.onDragStart?.(this.currentDragData, n));
  }
  onPotentialSelectionStart(e) {
    this.currentSelectionDisposable.dispose();
    const t = AF(this.domNode),
      n = (this.currentSelectionDisposable = new AO()),
      i = n.add(new AO());
    (i.add(
      $F(this.domNode, "selectstart", () => {
        (i.add(
          $F(t, "mousemove", (e) => {
            !1 === t.getSelection()?.isCollapsed && this.setupDragAndDropScrollTopAnimation(e);
          }),
        ),
          n.add(
            MO(() => {
              const e = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
              ((this.currentSelectionBounds = void 0),
                this.render(e, this.lastRenderTop, this.lastRenderHeight, void 0, void 0));
            }),
          ),
          n.add(
            $F(t, "selectionchange", () => {
              const e = t.getSelection();
              if (!e || e.isCollapsed) return void (i.isDisposed && n.dispose());
              let r = this.getIndexOfListElement(e.anchorNode),
                o = this.getIndexOfListElement(e.focusNode);
              void 0 !== r &&
                void 0 !== o &&
                (o < r && ([r, o] = [o, r]), (this.currentSelectionBounds = { start: r, end: o }));
            }),
          ));
      }),
    ),
      i.add(
        $F(t, "mouseup", () => {
          (i.dispose(),
            this.teardownDragAndDropScrollTopAnimation(),
            !1 !== t.getSelection()?.isCollapsed && n.dispose());
        }),
      ));
  }
  getIndexOfListElement(e) {
    if (e && this.domNode.contains(e))
      for (; e && e !== this.domNode; ) {
        if (e.dataset?.index) return Number(e.dataset.index);
        e = e.parentElement;
      }
  }
  onDragOver(e) {
    if (
      (e.browserEvent.preventDefault(),
      this.onDragLeaveTimeout.dispose(),
      Rae.CurrentDragAndDropData && "vscode-ui" === Rae.CurrentDragAndDropData.getData())
    )
      return !1;
    if ((this.setupDragAndDropScrollTopAnimation(e.browserEvent), !e.browserEvent.dataTransfer))
      return !1;
    if (!this.currentDragData)
      if (Rae.CurrentDragAndDropData) this.currentDragData = Rae.CurrentDragAndDropData;
      else {
        if (!e.browserEvent.dataTransfer.types) return !1;
        this.currentDragData = new Pae();
      }
    const t = this.dnd.onDragOver(
      this.currentDragData,
      e.element,
      e.index,
      e.sector,
      e.browserEvent,
    );
    if (((this.canDrop = "boolean" == typeof t ? t : t.accept), !this.canDrop))
      return (
        (this.currentDragFeedback = void 0),
        this.currentDragFeedbackDisposable.dispose(),
        !1
      );
    let n;
    ((e.browserEvent.dataTransfer.dropEffect =
      "boolean" != typeof t && 0 === t.effect?.type ? "copy" : "move"),
      (n =
        "boolean" != typeof t && t.feedback ? t.feedback : void 0 === e.index ? [-1] : [e.index]),
      (n = lj(n)
        .filter((e) => e >= -1 && e < this.length)
        .sort((e, t) => e - t)),
      (n = -1 === n[0] ? [-1] : n));
    let i =
      "boolean" != typeof t && t.effect && t.effect.position ? t.effect.position : "drop-target";
    if (
      ((r = this.currentDragFeedback),
      (o = n),
      (Array.isArray(r) && Array.isArray(o) ? XP(r, o) : r === o) &&
        this.currentDragFeedbackPosition === i)
    )
      return !0;
    var r, o;
    if (
      ((this.currentDragFeedback = n),
      (this.currentDragFeedbackPosition = i),
      this.currentDragFeedbackDisposable.dispose(),
      -1 === n[0])
    )
      (this.domNode.classList.add(i),
        this.rowsContainer.classList.add(i),
        (this.currentDragFeedbackDisposable = MO(() => {
          (this.domNode.classList.remove(i), this.rowsContainer.classList.remove(i));
        })));
    else {
      if (n.length > 1 && "drop-target" !== i)
        throw new Error("Can't use multiple feedbacks with position different than 'over'");
      "drop-target-after" === i &&
        n[0] < this.length - 1 &&
        ((n[0] += 1), (i = "drop-target-before"));
      for (const e of n) {
        const t = this.items[e];
        ((t.dropTarget = !0), t.row?.domNode.classList.add(i));
      }
      this.currentDragFeedbackDisposable = MO(() => {
        for (const e of n) {
          const t = this.items[e];
          ((t.dropTarget = !1), t.row?.domNode.classList.remove(i));
        }
      });
    }
    return !0;
  }
  onDragLeave(e) {
    (this.onDragLeaveTimeout.dispose(),
      (this.onDragLeaveTimeout = bM(() => this.clearDragOverFeedback(), 100, this.disposables)),
      this.currentDragData &&
        this.dnd.onDragLeave?.(this.currentDragData, e.element, e.index, e.browserEvent));
  }
  onDrop(e) {
    if (!this.canDrop) return;
    const t = this.currentDragData;
    (this.teardownDragAndDropScrollTopAnimation(),
      this.clearDragOverFeedback(),
      this.domNode.classList.remove("dragging"),
      (this.currentDragData = void 0),
      (Rae.CurrentDragAndDropData = void 0),
      t &&
        e.browserEvent.dataTransfer &&
        (e.browserEvent.preventDefault(),
        t.update(e.browserEvent.dataTransfer),
        this.dnd.drop(t, e.element, e.index, e.sector, e.browserEvent)));
  }
  onDragEnd(e) {
    ((this.canDrop = !1),
      this.teardownDragAndDropScrollTopAnimation(),
      this.clearDragOverFeedback(),
      this.domNode.classList.remove("dragging"),
      (this.currentDragData = void 0),
      (Rae.CurrentDragAndDropData = void 0),
      this.dnd.onDragEnd?.(e));
  }
  clearDragOverFeedback() {
    ((this.currentDragFeedback = void 0),
      (this.currentDragFeedbackPosition = void 0),
      this.currentDragFeedbackDisposable.dispose(),
      (this.currentDragFeedbackDisposable = PO.None));
  }
  setupDragAndDropScrollTopAnimation(e) {
    if (!this.dragOverAnimationDisposable) {
      const e = sB(this.domNode).top;
      this.dragOverAnimationDisposable = (function (e, t) {
        const n = () => {
          (t(), (i = JF(e, n)));
        };
        let i = JF(e, n);
        return MO(() => i.dispose());
      })(MF(this.domNode), this.animateDragAndDropScrollTop.bind(this, e));
    }
    (this.dragOverAnimationStopDisposable.dispose(),
      (this.dragOverAnimationStopDisposable = bM(
        () => {
          this.dragOverAnimationDisposable &&
            (this.dragOverAnimationDisposable.dispose(),
            (this.dragOverAnimationDisposable = void 0));
        },
        1e3,
        this.disposables,
      )),
      (this.dragOverMouseY = e.pageY));
  }
  animateDragAndDropScrollTop(e) {
    if (void 0 === this.dragOverMouseY) return;
    const t = this.dragOverMouseY - e,
      n = this.renderHeight - 35;
    t < 35
      ? (this.scrollTop += Math.max(-14, Math.floor(0.3 * (t - 35))))
      : t > n && (this.scrollTop += Math.min(14, Math.floor(0.3 * (t - n))));
  }
  teardownDragAndDropScrollTopAnimation() {
    (this.dragOverAnimationStopDisposable.dispose(),
      this.dragOverAnimationDisposable &&
        (this.dragOverAnimationDisposable.dispose(), (this.dragOverAnimationDisposable = void 0)));
  }
  getTargetSector(e, t) {
    if (void 0 === t) return;
    const n = e.offsetY / this.items[t].size;
    return wae(Math.floor(n / 0.25), 0, 3);
  }
  getItemIndexFromEventTarget(e) {
    const t = this.scrollableElement.getDomNode();
    let n = e;
    for (; (SB(n) || EB(n)) && n !== this.rowsContainer && t.contains(n); ) {
      const e = n.getAttribute("data-index");
      if (e) {
        const t = Number(e);
        if (!isNaN(t)) return t;
      }
      n = n.parentElement;
    }
  }
  getVisibleRange(e, t) {
    return { start: this.rangeMap.indexAt(e), end: this.rangeMap.indexAfter(e + t - 1) };
  }
  getRenderRange(e, t) {
    const n = this.getVisibleRange(e, t);
    if (this.currentSelectionBounds) {
      const e = this.rangeMap.count;
      ((n.start = Math.min(n.start, this.currentSelectionBounds.start, e)),
        (n.end = Math.min(Math.max(n.end, this.currentSelectionBounds.end + 1), e)));
    }
    return n;
  }
  _rerender(e, t, n) {
    const i = this.getRenderRange(e, t);
    let r, o;
    e === this.elementTop(i.start)
      ? ((r = i.start), (o = 0))
      : i.end - i.start > 1 && ((r = i.start + 1), (o = this.elementTop(r) - e));
    let s = 0;
    for (;;) {
      const a = this.getRenderRange(e, t);
      let l = !1;
      for (let e = a.start; e < a.end; e++) {
        const t = this.probeDynamicHeight(e);
        (0 !== t && this.rangeMap.splice(e, 1, [this.items[e]]), (s += t), (l = l || 0 !== t));
      }
      if (!l) {
        0 !== s && this.eventuallyUpdateScrollDimensions();
        const t = Eae.relativeComplement(i, a);
        for (const e of t)
          for (let t = e.start; t < e.end; t++) this.items[t].row && this.removeItemFromDOM(t);
        const l = Eae.relativeComplement(a, i).reverse();
        for (const e of l) for (let t = e.end - 1; t >= e.start; t--) this.insertItemInDOM(t);
        for (let e = a.start; e < a.end; e++)
          this.items[e].row && this.updateItemInDOM(this.items[e], e);
        if ("number" == typeof r) {
          const t = this.scrollable.getFutureScrollPosition().scrollTop - e,
            i = this.elementTop(r) - o + t;
          this.setScrollTop(i, n);
        }
        return void this._onDidChangeContentHeight.fire(this.contentHeight);
      }
    }
  }
  probeDynamicHeight(e) {
    const t = this.items[e];
    if (this.virtualDelegate.getDynamicHeight) {
      const e = this.virtualDelegate.getDynamicHeight(t.element);
      if (null !== e) {
        const n = t.size;
        return ((t.size = e), (t.lastDynamicHeightWidth = this.renderWidth), e - n);
      }
    }
    if (!t.hasDynamicHeight || t.lastDynamicHeightWidth === this.renderWidth) return 0;
    if (this.virtualDelegate.hasDynamicHeight && !this.virtualDelegate.hasDynamicHeight(t.element))
      return 0;
    const n = t.size;
    if (t.row)
      return (
        (t.row.domNode.style.height = ""),
        (t.size = t.row.domNode.offsetHeight),
        0 === t.size && gB(t.row.domNode, MF(t.row.domNode).document.body),
        (t.lastDynamicHeightWidth = this.renderWidth),
        t.size - n
      );
    const { row: i } = this.cache.alloc(t.templateId);
    ((i.domNode.style.height = ""), this.rowsContainer.appendChild(i.domNode));
    const r = this.renderers.get(t.templateId);
    if (!r) throw new QI("Missing renderer for templateId: " + t.templateId);
    return (
      r.renderElement(t.element, e, i.templateData),
      (t.size = i.domNode.offsetHeight),
      r.disposeElement?.(t.element, e, i.templateData),
      this.virtualDelegate.setDynamicHeight?.(t.element, t.size),
      (t.lastDynamicHeightWidth = this.renderWidth),
      i.domNode.remove(),
      this.cache.release(i),
      t.size - n
    );
  }
  getElementDomId(e) {
    return `${this.domId}_${e}`;
  }
  dispose() {
    for (const e of this.items)
      if ((e.dragStartDisposable.dispose(), e.checkedDisposable.dispose(), e.row)) {
        const t = this.renderers.get(e.row.templateId);
        t &&
          (t.disposeElement?.(e.element, -1, e.row.templateData, void 0),
          t.disposeTemplate(e.row.templateData));
      }
    ((this.items = []),
      this.domNode?.remove(),
      this.dragOverAnimationDisposable?.dispose(),
      this.disposables.dispose());
  }
}
(Iae([tJ], Fae.prototype, "onMouseClick", null),
  Iae([tJ], Fae.prototype, "onMouseDblClick", null),
  Iae([tJ], Fae.prototype, "onMouseMiddleClick", null),
  Iae([tJ], Fae.prototype, "onMouseDown", null),
  Iae([tJ], Fae.prototype, "onMouseOver", null),
  Iae([tJ], Fae.prototype, "onMouseOut", null),
  Iae([tJ], Fae.prototype, "onContextMenu", null),
  Iae([tJ], Fae.prototype, "onTouchStart", null),
  Iae([tJ], Fae.prototype, "onTap", null));
var Bae = function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
};
class Vae {
  constructor(e) {
    ((this.trait = e), (this.renderedElements = []));
  }
  get templateId() {
    return `template:${this.trait.name}`;
  }
  renderTemplate(e) {
    return e;
  }
  renderElement(e, t, n) {
    const i = this.renderedElements.findIndex((e) => e.templateData === n);
    if (i >= 0) {
      const e = this.renderedElements[i];
      (this.trait.unrender(n), (e.index = t));
    } else {
      const e = { index: t, templateData: n };
      this.renderedElements.push(e);
    }
    this.trait.renderIndex(t, n);
  }
  splice(e, t, n) {
    const i = [];
    for (const r of this.renderedElements)
      r.index < e
        ? i.push(r)
        : r.index >= e + t && i.push({ index: r.index + n - t, templateData: r.templateData });
    this.renderedElements = i;
  }
  renderIndexes(e) {
    for (const { index: t, templateData: n } of this.renderedElements)
      e.indexOf(t) > -1 && this.trait.renderIndex(t, n);
  }
  disposeTemplate(e) {
    const t = this.renderedElements.findIndex((t) => t.templateData === e);
    t < 0 || this.renderedElements.splice(t, 1);
  }
}
let Wae = class {
  get onChange() {
    return this._onChange.event;
  }
  get name() {
    return this._trait;
  }
  get renderer() {
    return new Vae(this);
  }
  constructor(e) {
    ((this._trait = e),
      (this.indexes = []),
      (this.sortedIndexes = []),
      (this._onChange = new QO()));
  }
  splice(e, t, n) {
    const i = n.length - t,
      r = e + t,
      o = [];
    let s = 0;
    for (; s < this.sortedIndexes.length && this.sortedIndexes[s] < e; )
      o.push(this.sortedIndexes[s++]);
    for (let a = 0; a < n.length; a++) n[a] && o.push(a + e);
    for (; s < this.sortedIndexes.length && this.sortedIndexes[s] >= r; )
      o.push(this.sortedIndexes[s++] + i);
    (this.renderer.splice(e, t, n.length), this._set(o, o));
  }
  renderIndex(e, t) {
    t.classList.toggle(this._trait, this.contains(e));
  }
  unrender(e) {
    e.classList.remove(this._trait);
  }
  set(e, t) {
    return this._set(e, [...e].sort(cle), t);
  }
  _set(e, t, n) {
    const i = this.indexes,
      r = this.sortedIndexes;
    ((this.indexes = e), (this.sortedIndexes = t));
    const o = lle(r, e);
    return (
      this.renderer.renderIndexes(o),
      this._onChange.fire({ indexes: e, browserEvent: n }),
      i
    );
  }
  get() {
    return this.indexes;
  }
  contains(e) {
    return QP(this.sortedIndexes, e, cle) >= 0;
  }
  dispose() {
    IO(this._onChange);
  }
};
Bae([tJ], Wae.prototype, "renderer", null);
class Hae extends Wae {
  constructor(e) {
    (super("selected"), (this.setAriaSelected = e));
  }
  renderIndex(e, t) {
    (super.renderIndex(e, t),
      this.setAriaSelected &&
        (this.contains(e)
          ? t.setAttribute("aria-selected", "true")
          : t.setAttribute("aria-selected", "false")));
  }
}
class zae {
  constructor(e, t, n) {
    ((this.trait = e), (this.view = t), (this.identityProvider = n));
  }
  splice(e, t, n) {
    if (!this.identityProvider) return this.trait.splice(e, t, new Array(n.length).fill(!1));
    const i = this.trait
      .get()
      .map((e) => this.identityProvider.getId(this.view.element(e)).toString());
    if (0 === i.length) return this.trait.splice(e, t, new Array(n.length).fill(!1));
    const r = new Set(i),
      o = n.map((e) => r.has(this.identityProvider.getId(e).toString()));
    this.trait.splice(e, t, o);
  }
}
function Uae(e, t) {
  return (
    !!e.classList.contains(t) ||
    (!e.classList.contains("monaco-list") && !!e.parentElement && Uae(e.parentElement, t))
  );
}
function $ae(e) {
  return Uae(e, "monaco-editor");
}
function qae(e) {
  return Uae(e, "monaco-tree-sticky-row");
}
function Kae(e) {
  return e.classList.contains("monaco-tree-sticky-container");
}
function Gae(e) {
  return (
    !!(
      ("A" === e.tagName && e.classList.contains("monaco-button")) ||
      ("DIV" === e.tagName && e.classList.contains("monaco-button-dropdown"))
    ) ||
    (!e.classList.contains("monaco-list") && !!e.parentElement && Gae(e.parentElement))
  );
}
class Zae {
  get onKeyDown() {
    return $O.chain(this.disposables.add(new RJ(this.view.domNode, "keydown")).event, (e) =>
      e.filter((e) => !YB(e.target)).map((e) => new wO(e)),
    );
  }
  constructor(e, t, n) {
    ((this.list = e),
      (this.view = t),
      (this.disposables = new AO()),
      (this.multipleSelectionDisposables = new AO()),
      (this.multipleSelectionSupport = n.multipleSelectionSupport),
      this.disposables.add(
        this.onKeyDown((e) => {
          switch (e.keyCode) {
            case 3:
              return this.onEnter(e);
            case 16:
              return this.onUpArrow(e);
            case 18:
              return this.onDownArrow(e);
            case 11:
              return this.onPageUpArrow(e);
            case 12:
              return this.onPageDownArrow(e);
            case 9:
              return this.onEscape(e);
            case 31:
              this.multipleSelectionSupport && (PR ? e.metaKey : e.ctrlKey) && this.onCtrlA(e);
          }
        }),
      ));
  }
  updateOptions(e) {
    void 0 !== e.multipleSelectionSupport &&
      (this.multipleSelectionSupport = e.multipleSelectionSupport);
  }
  onEnter(e) {
    (e.preventDefault(),
      e.stopPropagation(),
      this.list.setSelection(this.list.getFocus(), e.browserEvent));
  }
  onUpArrow(e) {
    (e.preventDefault(), e.stopPropagation(), this.list.focusPrevious(1, !1, e.browserEvent));
    const t = this.list.getFocus()[0];
    (this.list.setAnchor(t), this.list.reveal(t), this.view.domNode.focus());
  }
  onDownArrow(e) {
    (e.preventDefault(), e.stopPropagation(), this.list.focusNext(1, !1, e.browserEvent));
    const t = this.list.getFocus()[0];
    (this.list.setAnchor(t), this.list.reveal(t), this.view.domNode.focus());
  }
  onPageUpArrow(e) {
    (e.preventDefault(), e.stopPropagation(), this.list.focusPreviousPage(e.browserEvent));
    const t = this.list.getFocus()[0];
    (this.list.setAnchor(t), this.list.reveal(t), this.view.domNode.focus());
  }
  onPageDownArrow(e) {
    (e.preventDefault(), e.stopPropagation(), this.list.focusNextPage(e.browserEvent));
    const t = this.list.getFocus()[0];
    (this.list.setAnchor(t), this.list.reveal(t), this.view.domNode.focus());
  }
  onCtrlA(e) {
    (e.preventDefault(),
      e.stopPropagation(),
      this.list.setSelection(cj(this.list.length), e.browserEvent),
      this.list.setAnchor(void 0),
      this.view.domNode.focus());
  }
  onEscape(e) {
    this.list.getSelection().length &&
      (e.preventDefault(),
      e.stopPropagation(),
      this.list.setSelection([], e.browserEvent),
      this.list.setAnchor(void 0),
      this.view.domNode.focus());
  }
  dispose() {
    (this.disposables.dispose(), this.multipleSelectionDisposables.dispose());
  }
}
var Yae, Xae;
(Bae([tJ], Zae.prototype, "onKeyDown", null),
  (function (e) {
    ((e[(e.Automatic = 0)] = "Automatic"), (e[(e.Trigger = 1)] = "Trigger"));
  })(Yae || (Yae = {})),
  (function (e) {
    ((e[(e.Idle = 0)] = "Idle"), (e[(e.Typing = 1)] = "Typing"));
  })(Xae || (Xae = {})));
const Qae = new (class {
  mightProducePrintableCharacter(e) {
    return (
      !(e.ctrlKey || e.metaKey || e.altKey) &&
      ((e.keyCode >= 31 && e.keyCode <= 56) ||
        (e.keyCode >= 21 && e.keyCode <= 30) ||
        (e.keyCode >= 98 && e.keyCode <= 107) ||
        (e.keyCode >= 85 && e.keyCode <= 95))
    );
  }
})();
class Jae {
  constructor(e, t, n, i, r) {
    ((this.list = e),
      (this.view = t),
      (this.keyboardNavigationLabelProvider = n),
      (this.keyboardNavigationEventFilter = i),
      (this.delegate = r),
      (this.enabled = !1),
      (this.state = Xae.Idle),
      (this.mode = Yae.Automatic),
      (this.triggered = !1),
      (this.previouslyFocused = -1),
      (this.enabledDisposables = new AO()),
      (this.disposables = new AO()),
      this.updateOptions(e.options));
  }
  updateOptions(e) {
    ((e.typeNavigationEnabled ?? 1) ? this.enable() : this.disable(),
      (this.mode = e.typeNavigationMode ?? Yae.Automatic));
  }
  enable() {
    if (this.enabled) return;
    let e = !1;
    const t = $O.chain(
        this.enabledDisposables.add(new RJ(this.view.domNode, "keydown")).event,
        (t) =>
          t
            .filter((e) => !YB(e.target))
            .filter(() => this.mode === Yae.Automatic || this.triggered)
            .map((e) => new wO(e))
            .filter((t) => e || this.keyboardNavigationEventFilter(t))
            .filter((e) => this.delegate.mightProducePrintableCharacter(e))
            .forEach((e) => IB(e, !0))
            .map((e) => e.browserEvent.key),
      ),
      n = $O.debounce(t, () => null, 800, void 0, void 0, void 0, this.enabledDisposables),
      i = $O.reduce(
        $O.any(t, n),
        (e, t) => (null === t ? null : (e || "") + t),
        void 0,
        this.enabledDisposables,
      );
    (i(this.onInput, this, this.enabledDisposables),
      n(this.onClear, this, this.enabledDisposables),
      t(() => (e = !0), void 0, this.enabledDisposables),
      n(() => (e = !1), void 0, this.enabledDisposables),
      (this.enabled = !0),
      (this.triggered = !1));
  }
  disable() {
    this.enabled && (this.enabledDisposables.clear(), (this.enabled = !1), (this.triggered = !1));
  }
  onClear() {
    const e = this.list.getFocus();
    if (e.length > 0 && e[0] === this.previouslyFocused) {
      const t = this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));
      "string" == typeof t ? pV(t) : t && pV(t.get());
    }
    this.previouslyFocused = -1;
  }
  onInput(e) {
    if (!e) return ((this.state = Xae.Idle), void (this.triggered = !1));
    const t = this.list.getFocus(),
      n = t.length > 0 ? t[0] : 0,
      i = this.state === Xae.Idle ? 1 : 0;
    this.state = Xae.Typing;
    for (let r = 0; r < this.list.length; r++) {
      const t = (n + r + i) % this.list.length,
        o = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(t)),
        s = o && o.toString();
      if (this.list.options.typeNavigationEnabled) {
        if (void 0 !== s) {
          if (iie(e, s))
            return (
              (this.previouslyFocused = n),
              this.list.setFocus([t]),
              void this.list.reveal(t)
            );
          const i = Die(e, s);
          if (i) {
            if (i[0].end - i[0].start > 1 && 1 === i.length)
              return (
                (this.previouslyFocused = n),
                this.list.setFocus([t]),
                void this.list.reveal(t)
              );
          }
        }
      } else if (void 0 === s || iie(e, s))
        return ((this.previouslyFocused = n), this.list.setFocus([t]), void this.list.reveal(t));
    }
  }
  dispose() {
    (this.disable(), this.enabledDisposables.dispose(), this.disposables.dispose());
  }
}
class ele {
  constructor(e, t) {
    ((this.list = e), (this.view = t), (this.disposables = new AO()));
    const n = $O.chain(this.disposables.add(new RJ(t.domNode, "keydown")).event, (e) =>
        e.filter((e) => !YB(e.target)).map((e) => new wO(e)),
      ),
      i = $O.chain(n, (e) =>
        e.filter((e) => !(2 !== e.keyCode || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey)),
      );
    i(this.onTab, this, this.disposables);
  }
  onTab(e) {
    if (e.target !== this.view.domNode) return;
    const t = this.list.getFocus();
    if (0 === t.length) return;
    const n = this.view.domElement(t[0]);
    if (!n) return;
    const i = n.querySelector("[tabIndex]");
    if (!i || !SB(i) || -1 === i.tabIndex) return;
    const r = MF(i).getComputedStyle(i);
    "hidden" !== r.visibility &&
      "none" !== r.display &&
      (e.preventDefault(), e.stopPropagation(), i.focus());
  }
  dispose() {
    this.disposables.dispose();
  }
}
function tle(e) {
  return PR ? e.browserEvent.metaKey : e.browserEvent.ctrlKey;
}
function nle(e) {
  return e.browserEvent.shiftKey;
}
const ile = { isSelectionSingleChangeEvent: tle, isSelectionRangeChangeEvent: nle };
class rle {
  get onPointer() {
    return this._onPointer.event;
  }
  constructor(e) {
    ((this.list = e),
      (this.disposables = new AO()),
      (this._onPointer = this.disposables.add(new QO())),
      !1 !== e.options.multipleSelectionSupport &&
        (this.multipleSelectionController = this.list.options.multipleSelectionController || ile),
      (this.mouseSupport = void 0 === e.options.mouseSupport || !!e.options.mouseSupport),
      this.mouseSupport &&
        (e.onMouseDown(this.onMouseDown, this, this.disposables),
        e.onContextMenu(this.onContextMenu, this, this.disposables),
        e.onMouseDblClick(this.onDoubleClick, this, this.disposables),
        e.onTouchStart(this.onMouseDown, this, this.disposables),
        this.disposables.add(iJ.addTarget(e.getHTMLElement()))),
      $O.any(e.onMouseClick, e.onMouseMiddleClick, e.onTap)(
        this.onViewPointer,
        this,
        this.disposables,
      ));
  }
  updateOptions(e) {
    void 0 !== e.multipleSelectionSupport &&
      ((this.multipleSelectionController = void 0),
      e.multipleSelectionSupport &&
        (this.multipleSelectionController = this.list.options.multipleSelectionController || ile));
  }
  isSelectionSingleChangeEvent(e) {
    return (
      !!this.multipleSelectionController &&
      this.multipleSelectionController.isSelectionSingleChangeEvent(e)
    );
  }
  isSelectionRangeChangeEvent(e) {
    return (
      !!this.multipleSelectionController &&
      this.multipleSelectionController.isSelectionRangeChangeEvent(e)
    );
  }
  isSelectionChangeEvent(e) {
    return this.isSelectionSingleChangeEvent(e) || this.isSelectionRangeChangeEvent(e);
  }
  onMouseDown(e) {
    $ae(e.browserEvent.target) || (vB() !== e.browserEvent.target && this.list.domFocus());
  }
  onContextMenu(e) {
    if (YB(e.browserEvent.target) || $ae(e.browserEvent.target)) return;
    const t = void 0 === e.index ? [] : [e.index];
    this.list.setFocus(t, e.browserEvent);
  }
  onViewPointer(e) {
    if (!this.mouseSupport) return;
    if (YB(e.browserEvent.target) || $ae(e.browserEvent.target)) return;
    if (e.browserEvent.isHandledByList) return;
    e.browserEvent.isHandledByList = !0;
    const t = e.index;
    return void 0 === t
      ? (this.list.setFocus([], e.browserEvent),
        this.list.setSelection([], e.browserEvent),
        void this.list.setAnchor(void 0))
      : this.isSelectionChangeEvent(e)
        ? this.changeSelection(e)
        : (this.list.setFocus([t], e.browserEvent),
          this.list.setAnchor(t),
          (NB((n = e.browserEvent)) && 2 === n.button) ||
            this.list.setSelection([t], e.browserEvent),
          void this._onPointer.fire(e));
    var n;
  }
  onDoubleClick(e) {
    if (YB(e.browserEvent.target) || $ae(e.browserEvent.target)) return;
    if (this.isSelectionChangeEvent(e)) return;
    if (e.browserEvent.isHandledByList) return;
    e.browserEvent.isHandledByList = !0;
    const t = this.list.getFocus();
    this.list.setSelection(t, e.browserEvent);
  }
  changeSelection(e) {
    const t = e.index;
    let n = this.list.getAnchor();
    if (this.isSelectionRangeChangeEvent(e)) {
      if (void 0 === n) {
        ((n = this.list.getFocus()[0] ?? t), this.list.setAnchor(n));
      }
      const i = cj(Math.min(n, t), Math.max(n, t) + 1),
        r = this.list.getSelection(),
        o = (function (e, t) {
          const n = e.indexOf(t);
          if (-1 === n) return [];
          const i = [];
          let r = n - 1;
          for (; r >= 0 && e[r] === t - (n - r); ) i.push(e[r--]);
          (i.reverse(), (r = n));
          for (; r < e.length && e[r] === t + (r - n); ) i.push(e[r++]);
          return i;
        })(lle(r, [n]), n);
      if (0 === o.length) return;
      const s = lle(
        i,
        (function (e, t) {
          const n = [];
          let i = 0,
            r = 0;
          for (; i < e.length || r < t.length; )
            if (i >= e.length) n.push(t[r++]);
            else if (r >= t.length) n.push(e[i++]);
            else {
              if (e[i] === t[r]) {
                (i++, r++);
                continue;
              }
              e[i] < t[r] ? n.push(e[i++]) : r++;
            }
          return n;
        })(r, o),
      );
      (this.list.setSelection(s, e.browserEvent), this.list.setFocus([t], e.browserEvent));
    } else if (this.isSelectionSingleChangeEvent(e)) {
      const n = this.list.getSelection(),
        i = n.filter((e) => e !== t);
      (this.list.setFocus([t]),
        this.list.setAnchor(t),
        n.length === i.length
          ? this.list.setSelection([...i, t], e.browserEvent)
          : this.list.setSelection(i, e.browserEvent));
    }
  }
  dispose() {
    this.disposables.dispose();
  }
}
class ole {
  constructor(e, t) {
    ((this.styleElement = e), (this.selectorSuffix = t));
  }
  style(e) {
    const t = this.selectorSuffix && `.${this.selectorSuffix}`,
      n = [];
    (e.listBackground &&
      n.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),
      e.listFocusBackground &&
        (n.push(
          `.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`,
        ),
        n.push(
          `.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`,
        )),
      e.listFocusForeground &&
        n.push(
          `.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`,
        ),
      e.listActiveSelectionBackground &&
        (n.push(
          `.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`,
        ),
        n.push(
          `.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`,
        )),
      e.listActiveSelectionForeground &&
        n.push(
          `.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`,
        ),
      e.listActiveSelectionIconForeground &&
        n.push(
          `.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`,
        ),
      e.listFocusAndSelectionBackground &&
        n.push(
          `\n\t\t\t\t.monaco-drag-image${t},\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`,
        ),
      e.listFocusAndSelectionForeground &&
        n.push(
          `\n\t\t\t\t.monaco-drag-image${t},\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`,
        ),
      e.listInactiveFocusForeground &&
        (n.push(
          `.monaco-list${t} .monaco-list-row.focused { color:  ${e.listInactiveFocusForeground}; }`,
        ),
        n.push(
          `.monaco-list${t} .monaco-list-row.focused:hover { color:  ${e.listInactiveFocusForeground}; }`,
        )),
      e.listInactiveSelectionIconForeground &&
        n.push(
          `.monaco-list${t} .monaco-list-row.focused .codicon { color:  ${e.listInactiveSelectionIconForeground}; }`,
        ),
      e.listInactiveFocusBackground &&
        (n.push(
          `.monaco-list${t} .monaco-list-row.focused { background-color:  ${e.listInactiveFocusBackground}; }`,
        ),
        n.push(
          `.monaco-list${t} .monaco-list-row.focused:hover { background-color:  ${e.listInactiveFocusBackground}; }`,
        )),
      e.listInactiveSelectionBackground &&
        (n.push(
          `.monaco-list${t} .monaco-list-row.selected { background-color:  ${e.listInactiveSelectionBackground}; }`,
        ),
        n.push(
          `.monaco-list${t} .monaco-list-row.selected:hover { background-color:  ${e.listInactiveSelectionBackground}; }`,
        )),
      e.listInactiveSelectionForeground &&
        n.push(
          `.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`,
        ),
      e.listHoverBackground &&
        n.push(
          `.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`,
        ),
      e.listHoverForeground &&
        n.push(
          `.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color:  ${e.listHoverForeground}; }`,
        ));
    const i = Wne(
      e.listFocusAndSelectionOutline,
      Wne(e.listSelectionOutline, e.listFocusOutline ?? ""),
    );
    (i &&
      n.push(
        `.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${i}; outline-offset: -1px;}`,
      ),
      e.listFocusOutline &&
        n.push(
          `\n\t\t\t\t.monaco-drag-image${t},\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.focused,\n\t\t\t\t.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`,
        ));
    const r = Wne(e.listSelectionOutline, e.listInactiveFocusOutline ?? "");
    (r &&
      n.push(
        `.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${r}; outline-offset: -1px; }`,
      ),
      e.listSelectionOutline &&
        n.push(
          `.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`,
        ),
      e.listInactiveFocusOutline &&
        n.push(
          `.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`,
        ),
      e.listHoverOutline &&
        n.push(
          `.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`,
        ),
      e.listDropOverBackground &&
        n.push(
          `\n\t\t\t\t.monaco-list${t}.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }\n\t\t\t`,
        ),
      e.listDropBetweenBackground &&
        (n.push(
          `\n\t\t\t.monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,\n\t\t\t.monaco-list${t} .monaco-list-row.drop-target-before::before {\n\t\t\t\tcontent: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;\n\t\t\t\tbackground-color: ${e.listDropBetweenBackground};\n\t\t\t}`,
        ),
        n.push(
          `\n\t\t\t.monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,\n\t\t\t.monaco-list${t} .monaco-list-row.drop-target-after::after {\n\t\t\t\tcontent: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;\n\t\t\t\tbackground-color: ${e.listDropBetweenBackground};\n\t\t\t}`,
        )),
      e.tableColumnsBorder &&
        n.push(
          `\n\t\t\t\t.monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n\t\t\t\t.monaco-enable-motion .monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-enable-motion .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t\t}\n\n\t\t\t\t.monaco-enable-motion .monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-enable-motion .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: transparent;\n\t\t\t\t}\n\t\t\t`,
        ),
      e.tableOddRowsBackgroundColor &&
        n.push(
          `\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`,
        ),
      (this.styleElement.textContent = n.join("\n")));
  }
}
const sle = {
    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: vG.fromHex("#a9a9a9").transparent(0.4).toString(),
    tableColumnsBorder: vG.fromHex("#cccccc").transparent(0.2).toString(),
    tableOddRowsBackgroundColor: vG.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,
  },
  ale = {
    keyboardSupport: !0,
    mouseSupport: !0,
    multipleSelectionSupport: !0,
    dnd: {
      getDragURI: () => null,
      onDragStart() {},
      onDragOver: () => !1,
      drop() {},
      dispose() {},
    },
  };
function lle(e, t) {
  const n = [];
  let i = 0,
    r = 0;
  for (; i < e.length || r < t.length; )
    if (i >= e.length) n.push(t[r++]);
    else if (r >= t.length) n.push(e[i++]);
    else {
      if (e[i] === t[r]) {
        (n.push(e[i]), i++, r++);
        continue;
      }
      e[i] < t[r] ? n.push(e[i++]) : n.push(t[r++]);
    }
  return n;
}
const cle = (e, t) => e - t;
class dle {
  constructor(e, t) {
    ((this._templateId = e), (this.renderers = t));
  }
  get templateId() {
    return this._templateId;
  }
  renderTemplate(e) {
    return this.renderers.map((t) => t.renderTemplate(e));
  }
  renderElement(e, t, n, i) {
    let r = 0;
    for (const o of this.renderers) o.renderElement(e, t, n[r++], i);
  }
  disposeElement(e, t, n, i) {
    let r = 0;
    for (const o of this.renderers) (o.disposeElement?.(e, t, n[r], i), (r += 1));
  }
  disposeTemplate(e) {
    let t = 0;
    for (const n of this.renderers) n.disposeTemplate(e[t++]);
  }
}
class ule {
  constructor(e) {
    ((this.accessibilityProvider = e), (this.templateId = "a18n"));
  }
  renderTemplate(e) {
    return { container: e, disposables: new AO() };
  }
  renderElement(e, t, n) {
    const i = this.accessibilityProvider.getAriaLabel(e),
      r = i && "string" != typeof i ? i : xne(i);
    n.disposables.add(
      rF((e) => {
        this.setAriaLabel(e.readObservable(r), n.container);
      }),
    );
    const o = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(e);
    "number" == typeof o
      ? n.container.setAttribute("aria-level", `${o}`)
      : n.container.removeAttribute("aria-level");
  }
  setAriaLabel(e, t) {
    e ? t.setAttribute("aria-label", e) : t.removeAttribute("aria-label");
  }
  disposeElement(e, t, n) {
    n.disposables.clear();
  }
  disposeTemplate(e) {
    e.disposables.dispose();
  }
}
class hle {
  constructor(e, t) {
    ((this.list = e), (this.dnd = t));
  }
  getDragElements(e) {
    const t = this.list.getSelectedElements();
    return t.indexOf(e) > -1 ? t : [e];
  }
  getDragURI(e) {
    return this.dnd.getDragURI(e);
  }
  getDragLabel(e, t) {
    if (this.dnd.getDragLabel) return this.dnd.getDragLabel(e, t);
  }
  onDragStart(e, t) {
    this.dnd.onDragStart?.(e, t);
  }
  onDragOver(e, t, n, i, r) {
    return this.dnd.onDragOver(e, t, n, i, r);
  }
  onDragLeave(e, t, n, i) {
    this.dnd.onDragLeave?.(e, t, n, i);
  }
  onDragEnd(e) {
    this.dnd.onDragEnd?.(e);
  }
  drop(e, t, n, i, r) {
    this.dnd.drop(e, t, n, i, r);
  }
  dispose() {
    this.dnd.dispose();
  }
}
class gle {
  get onDidChangeFocus() {
    return $O.map(
      this.eventBufferer.wrapEvent(this.focus.onChange),
      (e) => this.toListEvent(e),
      this.disposables,
    );
  }
  get onDidChangeSelection() {
    return $O.map(
      this.eventBufferer.wrapEvent(this.selection.onChange),
      (e) => this.toListEvent(e),
      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 e = !1;
    const t = $O.chain(this.disposables.add(new RJ(this.view.domNode, "keydown")).event, (t) =>
        t
          .map((e) => new wO(e))
          .filter((t) => (e = 58 === t.keyCode || (t.shiftKey && 68 === t.keyCode)))
          .map((e) => IB(e, !0))
          .filter(() => !1),
      ),
      n = $O.chain(this.disposables.add(new RJ(this.view.domNode, "keyup")).event, (t) =>
        t
          .forEach(() => (e = !1))
          .map((e) => new wO(e))
          .filter((e) => 58 === e.keyCode || (e.shiftKey && 68 === e.keyCode))
          .map((e) => IB(e, !0))
          .map(({ browserEvent: e }) => {
            const t = this.getFocus(),
              n = t.length ? t[0] : void 0;
            return {
              index: n,
              element: void 0 !== n ? this.view.element(n) : void 0,
              anchor: void 0 !== n ? this.view.domElement(n) : this.view.domNode,
              browserEvent: e,
            };
          }),
      ),
      i = $O.chain(this.view.onContextMenu, (t) =>
        t
          .filter((t) => !e)
          .map(({ element: e, index: t, browserEvent: n }) => ({
            element: e,
            index: t,
            anchor: new EO(MF(this.view.domNode), n),
            browserEvent: n,
          })),
      );
    return $O.any(t, n, i);
  }
  get onKeyDown() {
    return this.disposables.add(new RJ(this.view.domNode, "keydown")).event;
  }
  get onDidFocus() {
    return $O.signal(this.disposables.add(new RJ(this.view.domNode, "focus", !0)).event);
  }
  get onDidBlur() {
    return $O.signal(this.disposables.add(new RJ(this.view.domNode, "blur", !0)).event);
  }
  constructor(e, t, n, i, r = ale) {
    ((this.user = e),
      (this._options = r),
      (this.focus = new Wae("focused")),
      (this.anchor = new Wae("anchor")),
      (this.eventBufferer = new rM()),
      (this._ariaLabel = ""),
      (this.disposables = new AO()),
      (this._onDidDispose = new QO()),
      (this.onDidDispose = this._onDidDispose.event));
    const o =
      this._options.accessibilityProvider && this._options.accessibilityProvider.getWidgetRole
        ? this._options.accessibilityProvider?.getWidgetRole()
        : "list";
    this.selection = new Hae("listbox" !== o);
    const s = [this.focus.renderer, this.selection.renderer];
    ((this.accessibilityProvider = r.accessibilityProvider),
      this.accessibilityProvider &&
        (s.push(new ule(this.accessibilityProvider)),
        this.accessibilityProvider.onDidChangeActiveDescendant?.(
          this.onDidChangeActiveDescendant,
          this,
          this.disposables,
        )),
      (i = i.map((e) => new dle(e.templateId, [...s, e]))));
    const a = { ...r, dnd: r.dnd && new hle(this, r.dnd) };
    if (
      ((this.view = this.createListView(t, n, i, a)),
      this.view.domNode.setAttribute("role", o),
      r.styleController)
    )
      this.styleController = r.styleController(this.view.domId);
    else {
      const e = rG(this.view.domNode);
      this.styleController = new ole(e, this.view.domId);
    }
    if (
      ((this.spliceable = new xae([
        new zae(this.focus, this.view, r.identityProvider),
        new zae(this.selection, this.view, r.identityProvider),
        new zae(this.anchor, this.view, r.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 ele(this, this.view)),
      ("boolean" != typeof r.keyboardSupport || r.keyboardSupport) &&
        ((this.keyboardController = new Zae(this, this.view, r)),
        this.disposables.add(this.keyboardController)),
      r.keyboardNavigationLabelProvider)
    ) {
      const e = r.keyboardNavigationDelegate || Qae;
      ((this.typeNavigationController = new Jae(
        this,
        this.view,
        r.keyboardNavigationLabelProvider,
        r.keyboardNavigationEventFilter ?? (() => !0),
        e,
      )),
        this.disposables.add(this.typeNavigationController));
    }
    if (
      ((this.mouseController = this.createMouseController(r)),
      this.disposables.add(this.mouseController),
      this.onDidChangeFocus(this._onFocusChange, this, this.disposables),
      this.onDidChangeSelection(this._onSelectionChange, this, this.disposables),
      this.accessibilityProvider)
    ) {
      const e = this.accessibilityProvider.getWidgetAriaLabel(),
        t = e && "string" != typeof e ? e : xne(e);
      this.disposables.add(
        rF((e) => {
          this.ariaLabel = e.readObservable(t);
        }),
      );
    }
    !1 !== this._options.multipleSelectionSupport &&
      this.view.domNode.setAttribute("aria-multiselectable", "true");
  }
  createListView(e, t, n, i) {
    return new Fae(e, t, n, i);
  }
  createMouseController(e) {
    return new rle(this);
  }
  updateOptions(e = {}) {
    ((this._options = { ...this._options, ...e }),
      this.typeNavigationController?.updateOptions(this._options),
      void 0 !== this._options.multipleSelectionController &&
        (this._options.multipleSelectionSupport
          ? this.view.domNode.setAttribute("aria-multiselectable", "true")
          : this.view.domNode.removeAttribute("aria-multiselectable")),
      this.mouseController.updateOptions(e),
      this.keyboardController?.updateOptions(e),
      this.view.updateOptions(e));
  }
  get options() {
    return this._options;
  }
  splice(e, t, n = []) {
    if (e < 0 || e > this.view.length) throw new kae(this.user, `Invalid start index: ${e}`);
    if (t < 0) throw new kae(this.user, `Invalid delete count: ${t}`);
    (0 === t && 0 === n.length) ||
      this.eventBufferer.bufferEvents(() => this.spliceable.splice(e, t, n));
  }
  rerender() {
    this.view.rerender();
  }
  element(e) {
    return this.view.element(e);
  }
  indexOf(e) {
    return this.view.indexOf(e);
  }
  indexAt(e) {
    return this.view.indexAt(e);
  }
  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(e) {
    this.view.setScrollTop(e);
  }
  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(e) {
    ((this._ariaLabel = e), this.view.domNode.setAttribute("aria-label", e));
  }
  domFocus() {
    this.view.domNode.focus({ preventScroll: !0 });
  }
  layout(e, t) {
    this.view.layout(e, t);
  }
  setSelection(e, t) {
    for (const n of e)
      if (n < 0 || n >= this.length) throw new kae(this.user, `Invalid index ${n}`);
    this.selection.set(e, t);
  }
  getSelection() {
    return this.selection.get();
  }
  getSelectedElements() {
    return this.getSelection().map((e) => this.view.element(e));
  }
  setAnchor(e) {
    if (void 0 !== e) {
      if (e < 0 || e >= this.length) throw new kae(this.user, `Invalid index ${e}`);
      this.anchor.set([e]);
    } else this.anchor.set([]);
  }
  getAnchor() {
    return this.anchor.get().at(0);
  }
  getAnchorElement() {
    const e = this.getAnchor();
    return void 0 === e ? void 0 : this.element(e);
  }
  setFocus(e, t) {
    for (const n of e)
      if (n < 0 || n >= this.length) throw new kae(this.user, `Invalid index ${n}`);
    this.focus.set(e, t);
  }
  focusNext(e = 1, t = !1, n, i) {
    if (0 === this.length) return;
    const r = this.focus.get(),
      o = this.findNextIndex(r.length > 0 ? r[0] + e : 0, t, i);
    o > -1 && this.setFocus([o], n);
  }
  focusPrevious(e = 1, t = !1, n, i) {
    if (0 === this.length) return;
    const r = this.focus.get(),
      o = this.findPreviousIndex(r.length > 0 ? r[0] - e : 0, t, i);
    o > -1 && this.setFocus([o], n);
  }
  async focusNextPage(e, t) {
    let n = this.view.indexAt(this.view.getScrollTop() + this.view.renderHeight);
    n = 0 === n ? 0 : n - 1;
    const i = this.getFocus()[0];
    if (i !== n && (void 0 === i || n > i)) {
      const r = this.findPreviousIndex(n, !1, t);
      r > -1 && i !== r ? this.setFocus([r], e) : this.setFocus([n], e);
    } else {
      const r = this.view.getScrollTop();
      let o = r + this.view.renderHeight;
      (n > i && (o -= this.view.elementHeight(n)),
        this.view.setScrollTop(o),
        this.view.getScrollTop() !== r &&
          (this.setFocus([]), await vM(0), await this.focusNextPage(e, t)));
    }
  }
  async focusPreviousPage(e, t, n = () => 0) {
    let i;
    const r = n(),
      o = this.view.getScrollTop() + r;
    i = 0 === o ? this.view.indexAt(o) : this.view.indexAfter(o - 1);
    const s = this.getFocus()[0];
    if (s !== i && (void 0 === s || s >= i)) {
      const n = this.findNextIndex(i, !1, t);
      n > -1 && s !== n ? this.setFocus([n], e) : this.setFocus([i], e);
    } else {
      const i = o;
      (this.view.setScrollTop(o - this.view.renderHeight - r),
        this.view.getScrollTop() + n() !== i &&
          (this.setFocus([]), await vM(0), await this.focusPreviousPage(e, t, n)));
    }
  }
  focusLast(e, t) {
    if (0 === this.length) return;
    const n = this.findPreviousIndex(this.length - 1, !1, t);
    n > -1 && this.setFocus([n], e);
  }
  focusFirst(e, t) {
    this.focusNth(0, e, t);
  }
  focusNth(e, t, n) {
    if (0 === this.length) return;
    const i = this.findNextIndex(e, !1, n);
    i > -1 && this.setFocus([i], t);
  }
  findNextIndex(e, t = !1, n) {
    for (let i = 0; i < this.length; i++) {
      if (e >= this.length && !t) return -1;
      if (((e %= this.length), !n || n(this.element(e)))) return e;
      e++;
    }
    return -1;
  }
  findPreviousIndex(e, t = !1, n) {
    for (let i = 0; i < this.length; i++) {
      if (e < 0 && !t) return -1;
      if (((e = (this.length + (e % this.length)) % this.length), !n || n(this.element(e))))
        return e;
      e--;
    }
    return -1;
  }
  getFocus() {
    return this.focus.get();
  }
  getFocusedElements() {
    return this.getFocus().map((e) => this.view.element(e));
  }
  reveal(e, t, n = 0) {
    if (e < 0 || e >= this.length) throw new kae(this.user, `Invalid index ${e}`);
    const i = this.view.getScrollTop(),
      r = this.view.elementTop(e),
      o = this.view.elementHeight(e);
    if (lR(t)) {
      const e = o - this.view.renderHeight + n;
      this.view.setScrollTop(e * wae(t, 0, 1) + r - n);
    } else {
      const e = r + o,
        t = i + this.view.renderHeight;
      (r < i + n && e >= t) ||
        (r < i + n || (e >= t && o >= this.view.renderHeight)
          ? this.view.setScrollTop(r - n)
          : e >= t && this.view.setScrollTop(e - this.view.renderHeight));
    }
  }
  getRelativeTop(e, t = 0) {
    if (e < 0 || e >= this.length) throw new kae(this.user, `Invalid index ${e}`);
    const n = this.view.getScrollTop(),
      i = this.view.elementTop(e),
      r = this.view.elementHeight(e);
    if (i < n + t || i + r > n + this.view.renderHeight) return null;
    const o = r - this.view.renderHeight + t;
    return Math.abs((n + t - i) / o);
  }
  getHTMLElement() {
    return this.view.domNode;
  }
  getScrollableElement() {
    return this.view.scrollableElementDomNode;
  }
  getElementID(e) {
    return this.view.getElementDomId(e);
  }
  getElementTop(e) {
    return this.view.elementTop(e);
  }
  style(e) {
    this.styleController.style(e);
  }
  toListEvent({ indexes: e, browserEvent: t }) {
    return { indexes: e, elements: e.map((e) => this.view.element(e)), browserEvent: t };
  }
  _onFocusChange() {
    const e = this.focus.get();
    (this.view.domNode.classList.toggle("element-focused", e.length > 0),
      this.onDidChangeActiveDescendant());
  }
  onDidChangeActiveDescendant() {
    const e = this.focus.get();
    if (e.length > 0) {
      let t;
      (this.accessibilityProvider?.getActiveDescendantId &&
        (t = this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),
        this.view.domNode.setAttribute(
          "aria-activedescendant",
          t || this.view.getElementDomId(e[0]),
        ));
    } else this.view.domNode.removeAttribute("aria-activedescendant");
  }
  _onSelectionChange() {
    const e = this.selection.get();
    (this.view.domNode.classList.toggle("selection-none", 0 === e.length),
      this.view.domNode.classList.toggle("selection-single", 1 === e.length),
      this.view.domNode.classList.toggle("selection-multiple", e.length > 1));
  }
  dispose() {
    (this._onDidDispose.fire(), this.disposables.dispose(), this._onDidDispose.dispose());
  }
}
(Bae([tJ], gle.prototype, "onDidChangeFocus", null),
  Bae([tJ], gle.prototype, "onDidChangeSelection", null),
  Bae([tJ], gle.prototype, "onContextMenu", null),
  Bae([tJ], gle.prototype, "onKeyDown", null),
  Bae([tJ], gle.prototype, "onDidFocus", null),
  Bae([tJ], gle.prototype, "onDidBlur", null));
const ple = VB,
  fle = "selectOption.entry.template";
class mle {
  get templateId() {
    return fle;
  }
  renderTemplate(e) {
    const t = Object.create(null);
    return (
      (t.root = e),
      (t.text = MB(e, ple(".option-text"))),
      (t.detail = MB(e, ple(".option-detail"))),
      (t.decoratorRight = MB(e, ple(".option-decorator-right"))),
      t
    );
  }
  renderElement(e, t, n) {
    const i = n,
      r = e.text,
      o = e.detail,
      s = e.decoratorRight,
      a = e.isDisabled;
    ((i.text.textContent = r),
      (i.detail.textContent = o || ""),
      (i.decoratorRight.textContent = s || ""),
      a ? i.root.classList.add("option-disabled") : i.root.classList.remove("option-disabled"));
  }
  disposeTemplate(e) {}
}
class _le extends PO {
  static {
    this.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN = 32;
  }
  static {
    this.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN = 2;
  }
  static {
    this.DEFAULT_MINIMUM_VISIBLE_OPTIONS = 3;
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this.options = []),
      (this._currentSelection = 0),
      (this._hasDetails = !1),
      (this._selectionDetailsDisposables = this._register(new AO())),
      (this._skipLayout = !1),
      (this._sticky = !1),
      (this._isVisible = !1),
      (this.styles = i),
      (this.selectBoxOptions = r || Object.create(null)),
      "number" != typeof this.selectBoxOptions.minBottomMargin
        ? (this.selectBoxOptions.minBottomMargin = _le.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN)
        : this.selectBoxOptions.minBottomMargin < 0 && (this.selectBoxOptions.minBottomMargin = 0),
      (this.selectElement = document.createElement("select")),
      (this.selectElement.className = "monaco-select-box monaco-select-box-dropdown-padding"),
      "string" == typeof this.selectBoxOptions.ariaLabel &&
        this.selectElement.setAttribute("aria-label", this.selectBoxOptions.ariaLabel),
      "string" == typeof this.selectBoxOptions.ariaDescription &&
        this.selectElement.setAttribute("aria-description", this.selectBoxOptions.ariaDescription),
      (this._onDidSelect = new QO()),
      this._register(this._onDidSelect),
      this.registerListeners(),
      this.constructSelectDropDown(n),
      (this.selected = t || 0),
      e && this.setOptions(e, t),
      this.initStyleSheet());
  }
  setTitle(e) {
    !this._hover && e
      ? (this._hover = this._register(yae().setupManagedHover(Bne("mouse"), this.selectElement, e)))
      : this._hover && this._hover.update(e);
  }
  getHeight() {
    return 22;
  }
  getTemplateId() {
    return fle;
  }
  constructSelectDropDown(e) {
    ((this.contextViewProvider = e),
      (this.selectDropDownContainer = VB(".monaco-select-box-dropdown-container")),
      this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),
      (this.selectionDetailsPane = MB(
        this.selectDropDownContainer,
        ple(".select-box-details-pane"),
      )));
    const t = MB(this.selectDropDownContainer, ple(".select-box-dropdown-container-width-control")),
      n = MB(t, ple(".width-control-div"));
    ((this.widthControlElement = document.createElement("span")),
      (this.widthControlElement.className = "option-text-width-control"),
      MB(n, this.widthControlElement),
      (this._dropDownPosition = 0),
      (this.styleElement = rG(this.selectDropDownContainer)),
      this.selectDropDownContainer.setAttribute("draggable", "true"),
      this._register(
        $F(this.selectDropDownContainer, DB.DRAG_START, (e) => {
          IB(e, !0);
        }),
      ));
  }
  registerListeners() {
    let e;
    (this._register(
      KF(this.selectElement, "change", (e) => {
        ((this.selected = e.target.selectedIndex),
          this._onDidSelect.fire({ index: e.target.selectedIndex, selected: e.target.value }),
          this.options[this.selected] &&
            this.options[this.selected].text &&
            this.setTitle(this.options[this.selected].text));
      }),
    ),
      this._register(
        $F(this.selectElement, DB.CLICK, (e) => {
          (IB(e), this._isVisible ? this.hideSelectDropDown(!0) : this.showSelectDropDown());
        }),
      ),
      this._register(
        $F(this.selectElement, DB.MOUSE_DOWN, (e) => {
          IB(e);
        }),
      ),
      this._register(
        $F(this.selectElement, "touchstart", (t) => {
          e = this._isVisible;
        }),
      ),
      this._register(
        $F(this.selectElement, "touchend", (t) => {
          (IB(t), e ? this.hideSelectDropDown(!0) : this.showSelectDropDown());
        }),
      ),
      this._register(
        $F(this.selectElement, DB.KEY_DOWN, (e) => {
          const t = new wO(e);
          let n = !1;
          (PR
            ? (18 !== t.keyCode && 16 !== t.keyCode && 10 !== t.keyCode && 3 !== t.keyCode) ||
              (n = !0)
            : ((18 === t.keyCode && t.altKey) ||
                (16 === t.keyCode && t.altKey) ||
                10 === t.keyCode ||
                3 === t.keyCode) &&
              (n = !0),
            n && (this.showSelectDropDown(), IB(e, !0)));
        }),
      ));
  }
  get onDidSelect() {
    return this._onDidSelect.event;
  }
  setOptions(e, t) {
    (XP(this.options, e) ||
      ((this.options = e),
      (this.selectElement.options.length = 0),
      (this._hasDetails = !1),
      (this._cachedMaxDetailsHeight = void 0),
      this.options.forEach((e, t) => {
        (this.selectElement.add(this.createOption(e.text, t, e.isDisabled)),
          "string" == typeof e.description && (this._hasDetails = !0));
      })),
      void 0 !== t && (this.select(t), (this._currentSelection = this.selected)));
  }
  setOptionsList() {
    this.selectList?.splice(0, this.selectList.length, this.options);
  }
  select(e) {
    (e >= 0 && e < this.options.length
      ? (this.selected = e)
      : e > 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(e) {
    this.selectElement.tabIndex = e ? 0 : -1;
  }
  render(e) {
    ((this.container = e),
      e.classList.add("select-container"),
      e.appendChild(this.selectElement),
      this.styleSelectElement());
  }
  initStyleSheet() {
    const e = [];
    (this.styles.listFocusBackground &&
      e.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 &&
        e.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 &&
        e.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
        ? (e.push(
            `.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `,
          ),
          e.push(
            `.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `,
          ),
          e.push(
            `.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `,
          ))
        : this.styles.selectListBorder &&
          (e.push(
            `.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `,
          ),
          e.push(
            `.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `,
          )),
      this.styles.listHoverForeground &&
        e.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 &&
        e.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 &&
        e.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 &&
        e.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; }`,
        ),
      e.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; }",
      ),
      e.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 = e.join("\n")));
  }
  styleSelectElement() {
    const e = this.styles.selectBackground ?? "",
      t = this.styles.selectForeground ?? "",
      n = this.styles.selectBorder ?? "";
    ((this.selectElement.style.backgroundColor = e),
      (this.selectElement.style.color = t),
      (this.selectElement.style.borderColor = n));
  }
  styleList() {
    const e = this.styles.selectBackground ?? "",
      t = Wne(this.styles.selectListBackground, e);
    ((this.selectDropDownListContainer.style.backgroundColor = t),
      (this.selectionDetailsPane.style.backgroundColor = t));
    const n = this.styles.focusBorder ?? "";
    ((this.selectDropDownContainer.style.outlineColor = n),
      (this.selectDropDownContainer.style.outlineOffset = "-1px"),
      this.selectList.style(this.styles));
  }
  createOption(e, t, n) {
    const i = document.createElement("option");
    return ((i.value = e), (i.text = e), (i.disabled = !!n), i);
  }
  showSelectDropDown() {
    ((this.selectionDetailsPane.textContent = ""),
      this.contextViewProvider &&
        !this._isVisible &&
        (this.createSelectList(this.selectDropDownContainer),
        this.setOptionsList(),
        this.contextViewProvider.showContextView(
          {
            getAnchor: () => this.selectElement,
            render: (e) => this.renderSelectDropDown(e, !0),
            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 = !0),
        this.hideSelectDropDown(!1),
        this.contextViewProvider.showContextView(
          {
            getAnchor: () => this.selectElement,
            render: (e) => this.renderSelectDropDown(e),
            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 = !0),
        this.selectElement.setAttribute("aria-expanded", "true")));
  }
  hideSelectDropDown(e) {
    this.contextViewProvider &&
      this._isVisible &&
      ((this._isVisible = !1),
      this.selectElement.setAttribute("aria-expanded", "false"),
      e && this.selectElement.focus(),
      this.contextViewProvider.hideContextView());
  }
  renderSelectDropDown(e, t) {
    return (
      e.appendChild(this.selectDropDownContainer),
      this.layoutSelectDropDown(t),
      {
        dispose: () => {
          this.selectDropDownContainer.remove();
        },
      }
    );
  }
  measureMaxDetailsHeight() {
    let e = 0;
    return (
      this.options.forEach((t, n) => {
        (this.updateDetail(n),
          this.selectionDetailsPane.offsetHeight > e &&
            (e = this.selectionDetailsPane.offsetHeight));
      }),
      e
    );
  }
  layoutSelectDropDown(e) {
    if (this._skipLayout) return !1;
    if (this.selectList) {
      this.selectDropDownContainer.classList.add("visible");
      const t = MF(this.selectElement),
        n = aB(this.selectElement),
        i = MF(this.selectElement).getComputedStyle(this.selectElement),
        r =
          parseFloat(i.getPropertyValue("--dropdown-padding-top")) +
          parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),
        o = t.innerHeight - n.top - n.height - (this.selectBoxOptions.minBottomMargin || 0),
        s = n.top - _le.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,
        a = this.selectElement.offsetWidth,
        l = this.setWidthControlElement(this.widthControlElement),
        c = Math.max(l, Math.round(a)).toString() + "px";
      ((this.selectDropDownContainer.style.width = c),
        (this.selectList.getHTMLElement().style.height = ""),
        this.selectList.layout());
      let d = this.selectList.contentHeight;
      this._hasDetails &&
        void 0 === this._cachedMaxDetailsHeight &&
        (this._cachedMaxDetailsHeight = this.measureMaxDetailsHeight());
      const u = this._hasDetails ? this._cachedMaxDetailsHeight : 0,
        h = d + r + u,
        g = Math.floor((o - r - u) / this.getHeight()),
        p = Math.floor((s - r - u) / this.getHeight());
      if (e)
        return (
          !(
            n.top + n.height > t.innerHeight - 22 ||
            n.top < _le.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN ||
            (g < 1 && p < 1)
          ) &&
          (g < _le.DEFAULT_MINIMUM_VISIBLE_OPTIONS && p > g && this.options.length > g
            ? ((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")),
          !0)
        );
      if (
        n.top + n.height > t.innerHeight - 22 ||
        n.top < _le.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN ||
        (0 === this._dropDownPosition && g < 1) ||
        (1 === this._dropDownPosition && p < 1)
      )
        return (this.hideSelectDropDown(!0), !1);
      if (0 === this._dropDownPosition) {
        if (this._isVisible && g + p < 1) return (this.hideSelectDropDown(!0), !1);
        h > o && (d = g * this.getHeight());
      } else h > s && (d = p * this.getHeight());
      return (
        this.selectList.layout(d),
        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 = d + r + "px"),
            (this.selectDropDownContainer.style.height = ""))
          : (this.selectDropDownContainer.style.height = d + r + "px"),
        this.updateDetail(this.selected),
        (this.selectDropDownContainer.style.width = c),
        this.selectDropDownListContainer.setAttribute("tabindex", "0"),
        this.selectElement.classList.add("synthetic-focus"),
        this.selectDropDownContainer.classList.add("synthetic-focus"),
        !0
      );
    }
    return !1;
  }
  setWidthControlElement(e) {
    let t = 0;
    if (e) {
      let n = 0,
        i = 0;
      (this.options.forEach((e, t) => {
        const r = e.detail ? e.detail.length : 0,
          o = e.decoratorRight ? e.decoratorRight.length : 0,
          s = e.text.length + r + o;
        s > i && ((n = t), (i = s));
      }),
        (e.textContent =
          this.options[n].text +
          (this.options[n].decoratorRight ? this.options[n].decoratorRight + " " : "")),
        (t = cB(e)));
    }
    return t;
  }
  createSelectList(e) {
    if (this.selectList) return;
    ((this.selectDropDownListContainer = MB(e, ple(".select-box-dropdown-list-container"))),
      (this.listRenderer = new mle()),
      (this.selectList = this._register(
        new gle("SelectBoxCustom", this.selectDropDownListContainer, this, [this.listRenderer], {
          useShadows: !1,
          verticalScrollMode: 3,
          keyboardSupport: !1,
          mouseSupport: !1,
          accessibilityProvider: {
            getAriaLabel: (e) => {
              let t = e.text;
              return (
                e.detail && (t += `. ${e.detail}`),
                e.decoratorRight && (t += `. ${e.decoratorRight}`),
                e.description && (t += `. ${e.description}`),
                t
              );
            },
            getWidgetAriaLabel: () => SI(16, "Select Box"),
            getRole: () => (PR ? "" : "option"),
            getWidgetRole: () => "listbox",
          },
        }),
      )),
      this.selectBoxOptions.ariaLabel &&
        (this.selectList.ariaLabel = this.selectBoxOptions.ariaLabel));
    const t = this._register(new RJ(this.selectDropDownListContainer, "keydown")),
      n = $O.chain(t.event, (e) =>
        e.filter(() => this.selectList.length > 0).map((e) => new wO(e)),
      );
    (this._register($O.chain(n, (e) => e.filter((e) => 3 === e.keyCode))(this.onEnter, this)),
      this._register($O.chain(n, (e) => e.filter((e) => 2 === e.keyCode))(this.onEnter, this)),
      this._register($O.chain(n, (e) => e.filter((e) => 9 === e.keyCode))(this.onEscape, this)),
      this._register($O.chain(n, (e) => e.filter((e) => 16 === e.keyCode))(this.onUpArrow, this)),
      this._register($O.chain(n, (e) => e.filter((e) => 18 === e.keyCode))(this.onDownArrow, this)),
      this._register($O.chain(n, (e) => e.filter((e) => 12 === e.keyCode))(this.onPageDown, this)),
      this._register($O.chain(n, (e) => e.filter((e) => 11 === e.keyCode))(this.onPageUp, this)),
      this._register($O.chain(n, (e) => e.filter((e) => 14 === e.keyCode))(this.onHome, this)),
      this._register($O.chain(n, (e) => e.filter((e) => 13 === e.keyCode))(this.onEnd, this)),
      this._register(
        $O.chain(n, (e) =>
          e.filter(
            (e) => (e.keyCode >= 21 && e.keyCode <= 56) || (e.keyCode >= 85 && e.keyCode <= 113),
          ),
        )(this.onCharacter, this),
      ),
      this._register(
        $F(this.selectList.getHTMLElement(), DB.POINTER_UP, (e) => this.onPointerUp(e)),
      ),
      this._register(
        this.selectList.onMouseOver(
          (e) => void 0 !== e.index && this.selectList.setFocus([e.index]),
        ),
      ),
      this._register(this.selectList.onDidChangeFocus((e) => this.onListFocus(e))),
      this._register(
        $F(this.selectDropDownContainer, DB.FOCUS_OUT, (e) => {
          this._isVisible &&
            !gB(e.relatedTarget, this.selectDropDownContainer) &&
            this.onListBlur();
        }),
      ),
      this.selectList
        .getHTMLElement()
        .setAttribute("aria-label", this.selectBoxOptions.ariaLabel || ""),
      this.selectList.getHTMLElement().setAttribute("aria-expanded", "true"),
      this.styleList());
  }
  onPointerUp(e) {
    if (!this.selectList.length) return;
    IB(e);
    const t = e.target;
    if (!t) return;
    if (t.classList.contains("slider")) return;
    const n = t.closest(".monaco-list-row");
    if (!n) return;
    const i = Number(n.getAttribute("data-index")),
      r = n.classList.contains("option-disabled");
    i >= 0 &&
      i < this.options.length &&
      !r &&
      ((this.selected = i),
      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(!0));
  }
  onListBlur() {
    this._sticky ||
      (this.selected !== this._currentSelection && this.select(this._currentSelection),
      this.hideSelectDropDown(!1));
  }
  renderDescriptionMarkdown(e, t) {
    const n = (e) => {
        for (let t = 0; t < e.childNodes.length; t++) {
          const i = e.childNodes.item(t);
          "img" === (i.tagName && i.tagName.toLowerCase()) ? i.remove() : n(i);
        }
      },
      i = Use({ value: e, supportThemeIcons: !0 }, { actionHandler: t });
    return (i.element.classList.add("select-box-description-markdown"), n(i.element), i);
  }
  onListFocus(e) {
    this._isVisible && this._hasDetails && this.updateDetail(e.indexes[0]);
  }
  updateDetail(e) {
    (this._selectionDetailsDisposables.clear(), (this.selectionDetailsPane.textContent = ""));
    const t = this.options[e],
      n = t?.description ?? "";
    if (n) {
      if (t?.descriptionIsMarkdown ?? !1) {
        const e = t.descriptionMarkdownActionHandler,
          i = this._selectionDetailsDisposables.add(this.renderDescriptionMarkdown(n, e));
        this.selectionDetailsPane.appendChild(i.element);
      } else this.selectionDetailsPane.textContent = n;
      this.selectionDetailsPane.style.display = "block";
    } else this.selectionDetailsPane.style.display = "none";
    ((this._skipLayout = !0), this.contextViewProvider.layout(), (this._skipLayout = !1));
  }
  onEscape(e) {
    (IB(e), this.select(this._currentSelection), this.hideSelectDropDown(!0));
  }
  onEnter(e) {
    (IB(e),
      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(!0));
  }
  onDownArrow(e) {
    if (this.selected < this.options.length - 1) {
      IB(e, !0);
      const t = this.options[this.selected + 1].isDisabled;
      if (t && this.options.length > this.selected + 2) this.selected += 2;
      else {
        if (t) return;
        this.selected++;
      }
      (this.select(this.selected),
        this.selectList.setFocus([this.selected]),
        this.selectList.reveal(this.selectList.getFocus()[0]));
    }
  }
  onUpArrow(e) {
    if (this.selected > 0) {
      IB(e, !0);
      (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(e) {
    (IB(e),
      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(e) {
    (IB(e),
      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(e) {
    (IB(e),
      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(e) {
    (IB(e),
      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(e) {
    const t = hO.toString(e.keyCode);
    let n = -1;
    for (let i = 0; i < this.options.length - 1; i++)
      if (
        ((n = (i + this.selected + 1) % this.options.length),
        this.options[n].text.charAt(0).toUpperCase() === t && !this.options[n].isDisabled)
      ) {
        (this.select(n),
          this.selectList.setFocus([n]),
          this.selectList.reveal(this.selectList.getFocus()[0]),
          IB(e));
        break;
      }
  }
  dispose() {
    (this.hideSelectDropDown(!1), super.dispose());
  }
}
class vle extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this.selected = 0),
      (this.selectBoxOptions = i || Object.create(null)),
      (this.options = []),
      (this.selectElement = document.createElement("select")),
      (this.selectElement.className = "monaco-select-box"),
      "string" == typeof this.selectBoxOptions.ariaLabel &&
        this.selectElement.setAttribute("aria-label", this.selectBoxOptions.ariaLabel),
      "string" == typeof this.selectBoxOptions.ariaDescription &&
        this.selectElement.setAttribute("aria-description", this.selectBoxOptions.ariaDescription),
      (this._onDidSelect = this._register(new QO())),
      (this.styles = n),
      this.registerListeners(),
      this.setOptions(e, t));
  }
  registerListeners() {
    (this._register(iJ.addTarget(this.selectElement)),
      [nJ.Tap].forEach((e) => {
        this._register(
          $F(this.selectElement, e, (e) => {
            this.selectElement.focus();
          }),
        );
      }),
      this._register(
        KF(this.selectElement, "click", (e) => {
          IB(e, !0);
        }),
      ),
      this._register(
        KF(this.selectElement, "change", (e) => {
          ((this.selectElement.title = e.target.value),
            this._onDidSelect.fire({ index: e.target.selectedIndex, selected: e.target.value }));
        }),
      ),
      this._register(
        KF(this.selectElement, "keydown", (e) => {
          let t = !1;
          (PR
            ? (18 !== e.keyCode && 16 !== e.keyCode && 10 !== e.keyCode) || (t = !0)
            : ((18 === e.keyCode && e.altKey) || 10 === e.keyCode || 3 === e.keyCode) && (t = !0),
            t && e.stopPropagation());
        }),
      ));
  }
  get onDidSelect() {
    return this._onDidSelect.event;
  }
  setOptions(e, t) {
    ((this.options && XP(this.options, e)) ||
      ((this.options = e),
      (this.selectElement.options.length = 0),
      this.options.forEach((e, t) => {
        this.selectElement.add(this.createOption(e.text, t, e.isDisabled));
      })),
      void 0 !== t && this.select(t));
  }
  select(e) {
    (0 === this.options.length
      ? (this.selected = 0)
      : e >= 0 && e < this.options.length
        ? (this.selected = e)
        : e > 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 && "string" == typeof this.options[this.selected].text
        ? (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(e) {
    this.selectElement.tabIndex = e ? 0 : -1;
  }
  render(e) {
    (e.classList.add("select-container"),
      e.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(e, t, n) {
    const i = document.createElement("option");
    return ((i.value = e), (i.text = e), (i.disabled = !!n), i);
  }
}
class ble extends rJ {
  constructor(e, t, n, i, r) {
    (super(),
      (this.selectBoxDelegate =
        PR && !r?.useCustomDrawn ? new vle(e, t, i, r) : new _le(e, t, n, i, r)),
      this._register(this.selectBoxDelegate));
  }
  get onDidSelect() {
    return this.selectBoxDelegate.onDidSelect;
  }
  setOptions(e, t) {
    this.selectBoxDelegate.setOptions(e, t);
  }
  select(e) {
    this.selectBoxDelegate.select(e);
  }
  focus() {
    this.selectBoxDelegate.focus();
  }
  blur() {
    this.selectBoxDelegate.blur();
  }
  setFocusable(e) {
    this.selectBoxDelegate.setFocusable(e);
  }
  render(e) {
    this.selectBoxDelegate.render(e);
  }
}
class yle extends PO {
  get action() {
    return this._action;
  }
  constructor(e, t, n = {}) {
    (super(),
      (this.options = n),
      (this._context = e || this),
      (this._action = t),
      t instanceof SV &&
        this._register(
          t.onDidChange((e) => {
            this.element && this.handleActionChangeEvent(e);
          }),
        ));
  }
  handleActionChangeEvent(e) {
    (void 0 !== e.enabled && this.updateEnabled(),
      void 0 !== e.checked && this.updateChecked(),
      void 0 !== e.class && this.updateClass(),
      void 0 !== e.label && (this.updateLabel(), this.updateTooltip()),
      void 0 !== e.tooltip && this.updateTooltip());
  }
  get actionRunner() {
    return (
      this._actionRunner || (this._actionRunner = this._register(new kV())),
      this._actionRunner
    );
  }
  set actionRunner(e) {
    this._actionRunner = e;
  }
  isEnabled() {
    return this._action.enabled;
  }
  setActionContext(e) {
    this._context = e;
  }
  render(e) {
    const t = (this.element = e);
    this._register(iJ.addTarget(e));
    const n = this.options && this.options.draggable;
    (n &&
      ((e.draggable = !0),
      RI &&
        this._register(
          $F(e, DB.DRAG_START, (e) => e.dataTransfer?.setData(Ane.TEXT, this._action.label)),
        )),
      this._register($F(t, nJ.Tap, (e) => this.onClick(e, !0))),
      this._register(
        $F(t, DB.MOUSE_DOWN, (e) => {
          (n || IB(e, !0), this._action.enabled && 0 === e.button && t.classList.add("active"));
        }),
      ),
      PR &&
        this._register(
          $F(t, DB.CONTEXT_MENU, (e) => {
            0 === e.button && !0 === e.ctrlKey && this.onClick(e);
          }),
        ),
      this._register(
        $F(t, DB.CLICK, (e) => {
          (IB(e, !0), (this.options && this.options.isMenu) || this.onClick(e));
        }),
      ),
      this._register(
        $F(t, DB.DBLCLICK, (e) => {
          IB(e, !0);
        }),
      ),
      [DB.MOUSE_UP, DB.MOUSE_OUT].forEach((e) => {
        this._register(
          $F(t, e, (e) => {
            (IB(e), t.classList.remove("active"));
          }),
        );
      }));
  }
  onClick(e, t = !1) {
    IB(e, !0);
    const n = gR(this._context)
      ? this.options?.useEventAsContext
        ? e
        : { preserveFocus: t }
      : this._context;
    this.actionRunner.run(this._action, n);
  }
  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(e) {
    this.element && (this.element.tabIndex = e ? 0 : -1);
  }
  get trapsArrowNavigation() {
    return !1;
  }
  updateEnabled() {}
  updateLabel() {}
  getClass() {
    return this.action.class;
  }
  getTooltip() {
    return this.action.tooltip;
  }
  getHoverContents() {
    return this.getTooltip();
  }
  updateTooltip() {
    if (!this.element) return;
    const e = this.getHoverContents() ?? "";
    if ((this.updateAriaLabel(), this.customHover || "" === e))
      this.customHover && this.customHover.update(e);
    else {
      const t = this.options.hoverDelegate ?? Bne("element");
      this.customHover = this._store.add(yae().setupManagedHover(t, this.element, e));
    }
  }
  updateAriaLabel() {
    if (this.element) {
      const e = this.getTooltip() ?? "";
      this.element.setAttribute("aria-label", e);
    }
  }
  updateClass() {}
  updateChecked() {}
  dispose() {
    (this.element && (this.element.remove(), (this.element = void 0)),
      (this._context = void 0),
      super.dispose());
  }
}
class xle extends yle {
  constructor(e, t, n) {
    (super(
      e,
      t,
      (n = { ...n, icon: void 0 !== n.icon && n.icon, label: void 0 === n.label || n.label }),
    ),
      (this.options = n),
      (this.cssClass = ""));
  }
  render(e) {
    (super.render(e), pR(this.element));
    const t = document.createElement("a");
    if (
      (t.classList.add("action-label"),
      t.setAttribute("role", this.getDefaultAriaRole()),
      (this.label = t),
      this.element.appendChild(t),
      this.options.label && this.options.keybinding && !this.options.keybindingNotRenderedWithLabel)
    ) {
      const e = document.createElement("span");
      (e.classList.add("keybinding"),
        (e.textContent = this.options.keybinding),
        this.element.appendChild(e));
    }
    (this.updateClass(),
      this.updateLabel(),
      this.updateTooltip(),
      this.updateEnabled(),
      this.updateChecked());
  }
  getDefaultAriaRole() {
    return this._action.id === EV.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(e) {
    this.label && (this.label.tabIndex = e ? 0 : -1);
  }
  updateLabel() {
    this.options.label && this.label && (this.label.textContent = this.action.label);
  }
  getTooltip() {
    let e = null;
    return (
      this.action.tooltip
        ? (e = this.action.tooltip)
        : this.action.label &&
          ((e = this.action.label),
          this.options.keybinding && (e = SI(0, "{0} ({1})", e, this.options.keybinding))),
      e ?? 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) {
      const e = this.getTooltip() ?? "";
      this.label.setAttribute("aria-label", e);
    }
  }
  updateChecked() {
    this.label &&
      (void 0 !== this.action.checked
        ? (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")))
        : (this.label.classList.remove("checked"),
          this.label.removeAttribute(this.options.isTabList ? "aria-selected" : "aria-checked"),
          this.label.setAttribute("role", this.getDefaultAriaRole())));
  }
}
class wle extends yle {
  constructor(e, t, n, i, r, o, s) {
    (super(e, t),
      (this.selectBox = new ble(n, i, r, o, s)),
      this.selectBox.setFocusable(!1),
      this._register(this.selectBox),
      this.registerListeners());
  }
  select(e) {
    this.selectBox.select(e);
  }
  registerListeners() {
    this._register(this.selectBox.onDidSelect((e) => this.runAction(e.selected, e.index)));
  }
  runAction(e, t) {
    this.actionRunner.run(this._action, this.getActionContext(e, t));
  }
  getActionContext(e, t) {
    return e;
  }
  setFocusable(e) {
    this.selectBox.setFocusable(e);
  }
  focus() {
    this.selectBox?.focus();
  }
  blur() {
    this.selectBox?.blur();
  }
  render(e) {
    this.selectBox.render(e);
  }
}
class Cle extends PO {
  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(e, t = {}) {
    let n, i;
    switch (
      (super(),
      (this._actionRunnerDisposables = this._register(new AO())),
      (this.viewItemDisposables = this._register(new VO())),
      (this.triggerKeyDown = !1),
      (this.focusable = !0),
      (this._onDidBlur = this._register(new QO())),
      (this._onDidCancel = this._register(
        new QO({ onWillAddFirstListener: () => (this.cancelHasListener = !0) }),
      )),
      (this.cancelHasListener = !1),
      (this._onDidRun = this._register(new QO())),
      (this._onWillRun = this._register(new QO())),
      (this.options = t),
      (this._context = t.context ?? null),
      (this._orientation = this.options.orientation ?? 0),
      (this._triggerKeys = {
        keyDown: this.options.triggerKeys?.keyDown ?? !1,
        keys: this.options.triggerKeys?.keys ?? [3, 10],
      }),
      (this._hoverDelegate = t.hoverDelegate ?? this._register(Vne())),
      this.options.actionRunner
        ? (this._actionRunner = this.options.actionRunner)
        : ((this._actionRunner = new kV()), this._actionRunnerDisposables.add(this._actionRunner)),
      this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e) => this._onDidRun.fire(e))),
      this._actionRunnerDisposables.add(
        this._actionRunner.onWillRun((e) => this._onWillRun.fire(e)),
      ),
      (this.viewItems = []),
      (this.focusedItem = void 0),
      (this.domNode = document.createElement("div")),
      (this.domNode.className = "monaco-action-bar"),
      this._orientation)
    ) {
      case 0:
        ((n = [15]), (i = [17]));
        break;
      case 1:
        ((n = [16]), (i = [18]), (this.domNode.className += " vertical"));
    }
    (this._register(
      $F(this.domNode, DB.KEY_DOWN, (e) => {
        const t = new wO(e);
        let r = !0;
        const o = "number" == typeof this.focusedItem ? this.viewItems[this.focusedItem] : void 0;
        (n && (t.equals(n[0]) || t.equals(n[1]))
          ? (r = this.focusPrevious())
          : i && (t.equals(i[0]) || t.equals(i[1]))
            ? (r = this.focusNext())
            : t.equals(9) && this.cancelHasListener
              ? this._onDidCancel.fire()
              : t.equals(14)
                ? (r = this.focusFirst())
                : t.equals(13)
                  ? (r = this.focusLast())
                  : t.equals(2) && o instanceof yle && o.trapsArrowNavigation
                    ? (r = this.focusNext(void 0, !0))
                    : this.isTriggerKeyEvent(t)
                      ? this._triggerKeys.keyDown
                        ? this.doTrigger(t)
                        : (this.triggerKeyDown = !0)
                      : (r = !1),
          r && (t.preventDefault(), t.stopPropagation()));
      }),
    ),
      this._register(
        $F(this.domNode, DB.KEY_UP, (e) => {
          const t = new wO(e);
          this.isTriggerKeyEvent(t)
            ? (!this._triggerKeys.keyDown &&
                this.triggerKeyDown &&
                ((this.triggerKeyDown = !1), this.doTrigger(t)),
              t.preventDefault(),
              t.stopPropagation())
            : (t.equals(2) ||
                t.equals(1026) ||
                t.equals(16) ||
                t.equals(18) ||
                t.equals(15) ||
                t.equals(17)) &&
              this.updateFocusedItem();
        }),
      ),
      (this.focusTracker = this._register(OB(this.domNode))),
      this._register(
        this.focusTracker.onDidBlur(() => {
          (vB() !== this.domNode && gB(vB(), this.domNode)) ||
            (this._onDidBlur.fire(),
            (this.previouslyFocusedItem = this.focusedItem),
            (this.focusedItem = void 0),
            (this.triggerKeyDown = !1));
        }),
      ),
      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),
      e.appendChild(this.domNode));
  }
  refreshRole() {
    this.length() >= 1
      ? this.actionsList.setAttribute("role", this.options.ariaRole || "toolbar")
      : this.actionsList.setAttribute("role", "presentation");
  }
  setFocusable(e) {
    if (((this.focusable = e), this.focusable)) {
      const e = this.viewItems.find((e) => e instanceof yle && e.isEnabled());
      e instanceof yle && e.setFocusable(!0);
    } else
      this.viewItems.forEach((e) => {
        e instanceof yle && e.setFocusable(!1);
      });
  }
  isTriggerKeyEvent(e) {
    let t = !1;
    return (
      this._triggerKeys.keys.forEach((n) => {
        t = t || e.equals(n);
      }),
      t
    );
  }
  updateFocusedItem() {
    for (let e = 0; e < this.actionsList.children.length; e++) {
      const t = this.actionsList.children[e];
      if (gB(vB(), t)) {
        ((this.focusedItem = e), this.viewItems[this.focusedItem]?.showHover?.());
        break;
      }
    }
  }
  get context() {
    return this._context;
  }
  set context(e) {
    ((this._context = e), this.viewItems.forEach((t) => t.setActionContext(e)));
  }
  get actionRunner() {
    return this._actionRunner;
  }
  set actionRunner(e) {
    ((this._actionRunner = e),
      this._actionRunnerDisposables.clear(),
      this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e) => this._onDidRun.fire(e))),
      this._actionRunnerDisposables.add(
        this._actionRunner.onWillRun((e) => this._onWillRun.fire(e)),
      ),
      this.viewItems.forEach((t) => (t.actionRunner = e)));
  }
  getContainer() {
    return this.domNode;
  }
  getAction(e) {
    if ("number" == typeof e) return this.viewItems[e]?.action;
    if (SB(e)) {
      for (; e.parentElement !== this.actionsList; ) {
        if (!e.parentElement) return;
        e = e.parentElement;
      }
      for (let t = 0; t < this.actionsList.childNodes.length; t++)
        if (this.actionsList.childNodes[t] === e) return this.viewItems[t].action;
    }
  }
  push(e, t = {}) {
    const n = Array.isArray(e) ? e : [e];
    let i = lR(t.index) ? t.index : null;
    if (
      (n.forEach((e) => {
        const n = document.createElement("li");
        let r;
        ((n.className = "action-item"), n.setAttribute("role", "presentation"));
        const o = {
          hoverDelegate: this._hoverDelegate,
          ...t,
          isTabList: "tablist" === this.options.ariaRole,
        };
        (this.options.actionViewItemProvider && (r = this.options.actionViewItemProvider(e, o)),
          r || (r = new xle(this.context, e, o)),
          this.options.allowContextMenu ||
            this.viewItemDisposables.set(
              r,
              $F(n, DB.CONTEXT_MENU, (e) => {
                IB(e, !0);
              }),
            ),
          (r.actionRunner = this._actionRunner),
          r.setActionContext(this.context),
          r.render(n),
          null === i || i < 0 || i >= this.actionsList.children.length
            ? (this.actionsList.appendChild(n), this.viewItems.push(r))
            : (this.actionsList.insertBefore(n, this.actionsList.children[i]),
              this.viewItems.splice(i, 0, r),
              i++));
      }),
      this.focusable)
    ) {
      let e = !1;
      for (const t of this.viewItems) {
        if (!(t instanceof yle)) continue;
        let n;
        ((n =
          !e && t.action.id !== EV.ID && !(!t.isEnabled() && this.options.focusOnlyEnabledItems)),
          n ? (t.setFocusable(!0), (e = !0)) : t.setFocusable(!1));
      }
    }
    ("number" == typeof this.focusedItem && this.focus(this.focusedItem), this.refreshRole());
  }
  getWidth(e) {
    if (e >= 0 && e < this.actionsList.children.length) {
      const t = this.actionsList.children.item(e);
      if (t) return t.clientWidth;
    }
    return 0;
  }
  pull(e) {
    e >= 0 &&
      e < this.viewItems.length &&
      (this.actionsList.childNodes[e].remove(),
      this.viewItemDisposables.deleteAndDispose(this.viewItems[e]),
      IO(this.viewItems.splice(e, 1)),
      this.refreshRole());
  }
  clear() {
    this.isEmpty() ||
      ((this.viewItems = IO(this.viewItems)),
      this.viewItemDisposables.clearAndDisposeAll(),
      zF(this.actionsList),
      this.refreshRole());
  }
  length() {
    return this.viewItems.length;
  }
  isEmpty() {
    return 0 === this.viewItems.length;
  }
  focus(e) {
    let t,
      n = !1;
    if (
      (void 0 === e ? (n = !0) : "number" == typeof e ? (t = e) : "boolean" == typeof e && (n = e),
      n && void 0 === this.focusedItem)
    ) {
      const e = this.viewItems.findIndex((e) => e.isEnabled());
      ((this.focusedItem = -1 === e ? void 0 : e), this.updateFocus(void 0, void 0, !0));
    } else (void 0 !== t && (this.focusedItem = t), this.updateFocus(void 0, void 0, !0));
  }
  focusFirst() {
    return ((this.focusedItem = this.length() - 1), this.focusNext(!0));
  }
  focusLast() {
    return ((this.focusedItem = 0), this.focusPrevious(!0));
  }
  focusNext(e, t) {
    if (void 0 === this.focusedItem) this.focusedItem = this.viewItems.length - 1;
    else if (this.viewItems.length <= 1) return !1;
    const n = this.focusedItem;
    let i;
    do {
      if (!e && this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length)
        return ((this.focusedItem = n), !1);
      ((this.focusedItem = (this.focusedItem + 1) % this.viewItems.length),
        (i = this.viewItems[this.focusedItem]));
    } while (
      this.focusedItem !== n &&
      ((this.options.focusOnlyEnabledItems && !i.isEnabled()) || i.action.id === EV.ID)
    );
    return (this.updateFocus(void 0, void 0, t), !0);
  }
  focusPrevious(e) {
    if (void 0 === this.focusedItem) this.focusedItem = 0;
    else if (this.viewItems.length <= 1) return !1;
    const t = this.focusedItem;
    let n;
    do {
      if (((this.focusedItem = this.focusedItem - 1), this.focusedItem < 0)) {
        if (!e && this.options.preventLoopNavigation) return ((this.focusedItem = t), !1);
        this.focusedItem = this.viewItems.length - 1;
      }
      n = this.viewItems[this.focusedItem];
    } while (
      this.focusedItem !== t &&
      ((this.options.focusOnlyEnabledItems && !n.isEnabled()) || n.action.id === EV.ID)
    );
    return (this.updateFocus(!0), !0);
  }
  updateFocus(e, t, n = !1) {
    (void 0 === this.focusedItem && this.actionsList.focus({ preventScroll: t }),
      void 0 !== this.previouslyFocusedItem &&
        this.previouslyFocusedItem !== this.focusedItem &&
        this.viewItems[this.previouslyFocusedItem]?.blur());
    const i = void 0 !== this.focusedItem ? this.viewItems[this.focusedItem] : void 0;
    if (i) {
      let r = !0;
      (mR(i.focus) || (r = !1),
        this.options.focusOnlyEnabledItems && mR(i.isEnabled) && !i.isEnabled() && (r = !1),
        i.action.id === EV.ID && (r = !1),
        r
          ? (n || this.previouslyFocusedItem !== this.focusedItem) &&
            (i.focus(e), (this.previouslyFocusedItem = this.focusedItem))
          : (this.actionsList.focus({ preventScroll: t }), (this.previouslyFocusedItem = void 0)),
        r && i.showHover?.());
    }
  }
  doTrigger(e) {
    if (void 0 === this.focusedItem) return;
    const t = this.viewItems[this.focusedItem];
    if (t instanceof yle) {
      const n = null === t._context || void 0 === t._context ? e : t._context;
      this.run(t._action, n);
    }
  }
  async run(e, t) {
    await this._actionRunner.run(e, t);
  }
  dispose() {
    ((this._context = void 0),
      (this.viewItems = IO(this.viewItems)),
      this.getContainer().remove(),
      super.dispose());
  }
}
function Sle(e, t) {
  const n = new AO(),
    i = e.createDecorationsCollection();
  return (
    n.add(
      oF({ debugName: () => `Apply decorations from ${t.debugName}` }, (e) => {
        const n = t.read(e);
        i.set(n);
      }),
    ),
    n.add({
      dispose: () => {
        i.clear();
      },
    }),
    n
  );
}
function kle(e, t) {
  return (
    e.appendChild(t),
    MO(() => {
      t.remove();
    })
  );
}
class Ele extends PO {
  get width() {
    return this._width;
  }
  get height() {
    return this._height;
  }
  get automaticLayout() {
    return this._automaticLayout;
  }
  constructor(e, t) {
    (super(),
      (this._automaticLayout = !1),
      (this.elementSizeObserver = this._register(new Wq(e, t))),
      (this._width = LF(this, this.elementSizeObserver.getWidth())),
      (this._height = LF(this, this.elementSizeObserver.getHeight())),
      this._register(
        this.elementSizeObserver.onDidChange((e) =>
          cF((e) => {
            (this._width.set(this.elementSizeObserver.getWidth(), e),
              this._height.set(this.elementSizeObserver.getHeight(), e));
          }),
        ),
      ));
  }
  observe(e) {
    this.elementSizeObserver.observe(e);
  }
  setAutomaticLayout(e) {
    ((this._automaticLayout = e),
      e ? this.elementSizeObserver.startObserving() : this.elementSizeObserver.stopObserving());
  }
}
function Nle(e, t, n) {
  let i = t.get(),
    r = i,
    o = i;
  const s = LF("animatedValue", i);
  let a = -1;
  let l;
  function c() {
    const t = Date.now() - a;
    ((o = Math.floor(
      (function (e, t, n, i) {
        return e === i ? t + n : n * (1 - Math.pow(2, (-10 * e) / i)) + t;
      })(t, r, i - r, 300),
    )),
      t < 300 ? (l = e.requestAnimationFrame(c)) : (o = i),
      s.set(o, void 0));
  }
  return (
    n.add(
      sF(
        {
          changeTracker: {
            createChangeSummary: () => ({ animate: !1 }),
            handleChange: (e, n) => (e.didChange(t) && (n.animate = n.animate || e.change), !0),
          },
        },
        (n, s) => {
          (void 0 !== l && (e.cancelAnimationFrame(l), (l = void 0)),
            (r = o),
            (i = t.read(n)),
            (a = Date.now() - (s.animate ? 0 : 300)),
            c());
        },
      ),
    ),
    s
  );
}
class Lle extends PO {
  constructor(e, t, n) {
    (super(),
      this._register(new Tle(e, n)),
      this._register(Ile(n, { height: t.actualHeight, top: t.actualTop })));
  }
}
class Dle {
  get afterLineNumber() {
    return this._afterLineNumber.get();
  }
  constructor(e, t) {
    ((this._afterLineNumber = e),
      (this.heightInPx = t),
      (this.domNode = document.createElement("div")),
      (this._actualTop = LF(this, void 0)),
      (this._actualHeight = LF(this, void 0)),
      (this.actualTop = this._actualTop),
      (this.actualHeight = this._actualHeight),
      (this.showInHiddenAreas = !0),
      (this.onChange = this._afterLineNumber),
      (this.onDomNodeTop = (e) => {
        this._actualTop.set(e, void 0);
      }),
      (this.onComputedHeight = (e) => {
        this._actualHeight.set(e, void 0);
      }));
  }
}
class Tle {
  static {
    this._counter = 0;
  }
  constructor(e, t) {
    ((this._editor = e),
      (this._domElement = t),
      (this._overlayWidgetId = "managedOverlayWidget-" + Tle._counter++),
      (this._overlayWidget = {
        getId: () => this._overlayWidgetId,
        getDomNode: () => this._domElement,
        getPosition: () => null,
      }),
      this._editor.addOverlayWidget(this._overlayWidget));
  }
  dispose() {
    this._editor.removeOverlayWidget(this._overlayWidget);
  }
}
function Ile(e, t) {
  return rF((n) => {
    for (let [i, r] of Object.entries(t))
      (r && "object" == typeof r && "read" in r && (r = r.read(n)),
        "number" == typeof r && (r = `${r}px`),
        (i = i.replace(/[A-Z]/g, (e) => "-" + e.toLowerCase())),
        (e.style[i] = r));
  });
}
function Rle(e, t, n, i) {
  const r = new AO(),
    o = [];
  return (
    r.add(
      aF((r, s) => {
        const a = t.read(r),
          l = new Map(),
          c = new Map();
        (n && n(!0),
          e.changeViewZones((e) => {
            for (const t of o) (e.removeZone(t), i?.delete(t));
            o.length = 0;
            for (const t of a) {
              const n = e.addZone(t);
              (t.setZoneId && t.setZoneId(n), o.push(n), i?.add(n), l.set(t, n));
            }
          }),
          n && n(!1),
          s.add(
            sF(
              {
                changeTracker: {
                  createChangeSummary: () => ({ zoneIds: [] }),
                  handleChange(e, t) {
                    const n = c.get(e.changedObservable);
                    return (void 0 !== n && t.zoneIds.push(n), !0);
                  },
                },
              },
              (t, i) => {
                for (const e of a) e.onChange && (c.set(e.onChange, l.get(e)), e.onChange.read(t));
                (n && n(!0),
                  e.changeViewZones((e) => {
                    for (const t of i.zoneIds) e.layoutZone(t);
                  }),
                  n && n(!1));
              },
            ),
          ));
      }),
    ),
    r.add({
      dispose() {
        (n && n(!0),
          e.changeViewZones((e) => {
            for (const t of o) e.removeZone(t);
          }),
          i?.clear(),
          n && n(!1));
      },
    }),
    r
  );
}
class Ole extends cM {
  dispose() {
    super.dispose(!0);
  }
}
function Mle(e, t) {
  const n = R1(t, (t) => t.original.startLineNumber <= e.lineNumber);
  if (!n) return YH.fromPositions(e);
  if (n.original.endLineNumberExclusive <= e.lineNumber) {
    const t = e.lineNumber - n.original.endLineNumberExclusive + n.modified.endLineNumberExclusive;
    return YH.fromPositions(new xV(t, e.column));
  }
  if (!n.innerChanges) return YH.fromPositions(new xV(n.modified.startLineNumber, 1));
  const i = R1(n.innerChanges, (t) => t.originalRange.getStartPosition().isBeforeOrEqual(e));
  if (!i) {
    const t = e.lineNumber - n.original.startLineNumber + n.modified.startLineNumber;
    return YH.fromPositions(new xV(t, e.column));
  }
  if (i.originalRange.containsPosition(e)) return i.modifiedRange;
  {
    const t =
      ((r = i.originalRange.getEndPosition()),
      (o = e),
      r.lineNumber === o.lineNumber
        ? new e3(0, o.column - r.column)
        : new e3(o.lineNumber - r.lineNumber, o.column - 1));
    return YH.fromPositions(t.addToPosition(i.modifiedRange.getEndPosition()));
  }
  var r, o;
}
class Ale {
  static create(e, t = void 0) {
    return new Ple(e, e, t);
  }
  static createWithDisposable(e, t, n = void 0) {
    const i = new AO();
    return (i.add(t), i.add(e), new Ple(e, i, n));
  }
}
class Ple extends Ale {
  constructor(e, t, n) {
    (super(),
      (this.object = e),
      (this._disposable = t),
      (this._debugOwner = n),
      (this._refCount = 1),
      (this._isDisposed = !1),
      (this._owners = []),
      n && this._addOwner(n));
  }
  _addOwner(e) {
    e && this._owners.push(e);
  }
  createNewRef(e) {
    return (this._refCount++, e && this._addOwner(e), new jle(this, e));
  }
  dispose() {
    this._isDisposed || ((this._isDisposed = !0), this._decreaseRefCount(this._debugOwner));
  }
  _decreaseRefCount(e) {
    if ((this._refCount--, 0 === this._refCount && this._disposable.dispose(), e)) {
      const t = this._owners.indexOf(e);
      -1 !== t && this._owners.splice(t, 1);
    }
  }
}
class jle extends Ale {
  constructor(e, t) {
    (super(), (this._base = e), (this._debugOwner = t), (this._isDisposed = !1));
  }
  get object() {
    return this._base.object;
  }
  createNewRef(e) {
    return this._base.createNewRef(e);
  }
  dispose() {
    this._isDisposed || ((this._isDisposed = !0), this._base._decreaseRefCount(this._debugOwner));
  }
}
class Fle {
  static inverse(e, t, n) {
    const i = [];
    let r = 1,
      o = 1;
    for (const a of e) {
      const e = new Fle(
        new Q5(r, a.original.startLineNumber),
        new Q5(o, a.modified.startLineNumber),
      );
      (e.modified.isEmpty || i.push(e),
        (r = a.original.endLineNumberExclusive),
        (o = a.modified.endLineNumberExclusive));
    }
    const s = new Fle(new Q5(r, t + 1), new Q5(o, n + 1));
    return (s.modified.isEmpty || i.push(s), i);
  }
  static clip(e, t, n) {
    const i = [];
    for (const r of e) {
      const e = r.original.intersect(t),
        o = r.modified.intersect(n);
      e && !e.isEmpty && o && !o.isEmpty && i.push(new Fle(e, o));
    }
    return i;
  }
  constructor(e, t) {
    ((this.original = e), (this.modified = t));
  }
  toString() {
    return `{${this.original.toString()}->${this.modified.toString()}}`;
  }
  flip() {
    return new Fle(this.modified, this.original);
  }
  join(e) {
    return new Fle(this.original.join(e.original), this.modified.join(e.modified));
  }
  toRangeMapping() {
    const e = this.original.toInclusiveRange(),
      t = this.modified.toInclusiveRange();
    if (e && t) return new Hle(e, t);
    if (1 === this.original.startLineNumber || 1 === this.modified.startLineNumber) {
      if (1 !== this.modified.startLineNumber || 1 !== this.original.startLineNumber)
        throw new QI("not a valid diff");
      return new Hle(
        new YH(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1),
        new YH(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1),
      );
    }
    return new Hle(
      new YH(
        this.original.startLineNumber - 1,
        Number.MAX_SAFE_INTEGER,
        this.original.endLineNumberExclusive - 1,
        Number.MAX_SAFE_INTEGER,
      ),
      new YH(
        this.modified.startLineNumber - 1,
        Number.MAX_SAFE_INTEGER,
        this.modified.endLineNumberExclusive - 1,
        Number.MAX_SAFE_INTEGER,
      ),
    );
  }
  toRangeMapping2(e, t) {
    if (
      Vle(this.original.endLineNumberExclusive, e) &&
      Vle(this.modified.endLineNumberExclusive, t)
    )
      return new Hle(
        new YH(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1),
        new YH(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1),
      );
    if (!this.original.isEmpty && !this.modified.isEmpty)
      return new Hle(
        YH.fromPositions(
          new xV(this.original.startLineNumber, 1),
          Ble(new xV(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), e),
        ),
        YH.fromPositions(
          new xV(this.modified.startLineNumber, 1),
          Ble(new xV(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), t),
        ),
      );
    if (this.original.startLineNumber > 1 && this.modified.startLineNumber > 1)
      return new Hle(
        YH.fromPositions(
          Ble(new xV(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER), e),
          Ble(new xV(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), e),
        ),
        YH.fromPositions(
          Ble(new xV(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER), t),
          Ble(new xV(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), t),
        ),
      );
    throw new QI();
  }
}
function Ble(e, t) {
  if (e.lineNumber < 1) return new xV(1, 1);
  if (e.lineNumber > t.length) return new xV(t.length, t[t.length - 1].length + 1);
  const n = t[e.lineNumber - 1];
  return e.column > n.length + 1 ? new xV(e.lineNumber, n.length + 1) : e;
}
function Vle(e, t) {
  return e >= 1 && e <= t.length;
}
class Wle extends Fle {
  static fromRangeMappings(e) {
    const t = Q5.join(e.map((e) => Q5.fromRangeInclusive(e.originalRange))),
      n = Q5.join(e.map((e) => Q5.fromRangeInclusive(e.modifiedRange)));
    return new Wle(t, n, e);
  }
  constructor(e, t, n) {
    (super(e, t), (this.innerChanges = n));
  }
  flip() {
    return new Wle(
      this.modified,
      this.original,
      this.innerChanges?.map((e) => e.flip()),
    );
  }
  withInnerChangesFromLineRanges() {
    return new Wle(this.original, this.modified, [this.toRangeMapping()]);
  }
}
class Hle {
  static fromEdit(e) {
    const t = e.getNewRanges(),
      n = e.replacements.map((e, n) => new Hle(e.range, t[n]));
    return n;
  }
  static assertSorted(e) {
    for (let t = 1; t < e.length; t++) {
      const n = e[t - 1],
        i = e[t];
      if (
        !n.originalRange.getEndPosition().isBeforeOrEqual(i.originalRange.getStartPosition()) ||
        !n.modifiedRange.getEndPosition().isBeforeOrEqual(i.modifiedRange.getStartPosition())
      )
        throw new QI("Range mappings must be sorted");
    }
  }
  constructor(e, t) {
    ((this.originalRange = e), (this.modifiedRange = t));
  }
  toString() {
    return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`;
  }
  flip() {
    return new Hle(this.modifiedRange, this.originalRange);
  }
  toTextEdit(e) {
    const t = e.getValueOfRange(this.modifiedRange);
    return new c3(this.originalRange, t);
  }
}
function zle(e, t, n, i = !1) {
  const r = [];
  for (const o of nj(
    e.map((e) =>
      (function (e, t, n) {
        let i = 0,
          r = 0;
        1 === e.modifiedRange.endColumn &&
          1 === e.originalRange.endColumn &&
          e.originalRange.startLineNumber + i <= e.originalRange.endLineNumber &&
          e.modifiedRange.startLineNumber + i <= e.modifiedRange.endLineNumber &&
          (r = -1);
        e.modifiedRange.startColumn - 1 >= n.getLineLength(e.modifiedRange.startLineNumber) &&
          e.originalRange.startColumn - 1 >= t.getLineLength(e.originalRange.startLineNumber) &&
          e.originalRange.startLineNumber <= e.originalRange.endLineNumber + r &&
          e.modifiedRange.startLineNumber <= e.modifiedRange.endLineNumber + r &&
          (i = 1);
        const o = new Q5(
            e.originalRange.startLineNumber + i,
            e.originalRange.endLineNumber + 1 + r,
          ),
          s = new Q5(e.modifiedRange.startLineNumber + i, e.modifiedRange.endLineNumber + 1 + r);
        return new Wle(o, s, [e]);
      })(e, t, n),
    ),
    (e, t) =>
      e.original.intersectsOrTouches(t.original) || e.modified.intersectsOrTouches(t.modified),
  )) {
    const e = o[0],
      t = o[o.length - 1];
    r.push(
      new Wle(
        e.original.join(t.original),
        e.modified.join(t.modified),
        o.map((e) => e.innerChanges[0]),
      ),
    );
  }
  return (
    iR(() => {
      if (!i && r.length > 0) {
        if (r[0].modified.startLineNumber !== r[0].original.startLineNumber) return !1;
        if (
          n.length.lineCount - r[r.length - 1].modified.endLineNumberExclusive !==
          t.length.lineCount - r[r.length - 1].original.endLineNumberExclusive
        )
          return !1;
      }
      return rR(
        r,
        (e, t) =>
          t.original.startLineNumber - e.original.endLineNumberExclusive ===
            t.modified.startLineNumber - e.modified.endLineNumberExclusive &&
          e.original.endLineNumberExclusive < t.original.startLineNumber &&
          e.modified.endLineNumberExclusive < t.modified.startLineNumber,
      );
    }),
    r
  );
}
var Ule, $le;
(!(function (e) {
  e.getDefinition = function (e, t) {
    let n = e.defaults;
    for (; AV.isThemeIcon(n); ) {
      const e = Gle.getIcon(n.id);
      if (!e) return;
      n = e.defaults;
    }
    return n;
  };
})(Ule || (Ule = {})),
  (function (e) {
    ((e.toJSONObject = function (e) {
      return {
        weight: e.weight,
        style: e.style,
        src: e.src.map((e) => ({ format: e.format, location: e.location.toString() })),
      };
    }),
      (e.fromJSONObject = function (e) {
        const t = (e) => (oR(e) ? e : void 0);
        if (e && Array.isArray(e.src) && e.src.every((e) => oR(e.format) && oR(e.location)))
          return {
            weight: t(e.weight),
            style: t(e.style),
            src: e.src.map((e) => ({ format: e.format, location: mP.parse(e.location) })),
          };
      }));
  })($le || ($le = {})));
const qle = /^([\w_-]+)$/,
  Kle = SI(2024, "The font ID must only contain letters, numbers, underscores and dashes.");
const Gle = new (class extends PO {
  constructor() {
    (super(),
      (this._onDidChange = this._register(new QO())),
      (this.onDidChange = this._onDidChange.event),
      (this.iconSchema = {
        definitions: {
          icons: {
            type: "object",
            properties: {
              fontId: {
                type: "string",
                description: SI(
                  2025,
                  "The id of the font to use. If not set, the font that is defined first is used.",
                ),
                pattern: qle.source,
                patternErrorMessage: Kle,
              },
              fontCharacter: {
                type: "string",
                description: SI(2026, "The font character associated with the icon definition."),
              },
            },
            additionalProperties: !1,
            defaultSnippets: [{ body: { fontCharacter: "\\\\e030" } }],
          },
        },
        type: "object",
        properties: {},
      }),
      (this.iconReferenceSchema = {
        type: "string",
        pattern: `^${AV.iconNameExpression}$`,
        enum: [],
        enumDescriptions: [],
      }),
      (this.iconsById = {}),
      (this.iconFontsById = {}));
  }
  registerIcon(e, t, n, i) {
    const r = this.iconsById[e];
    if (r) {
      if (n && !r.description) {
        ((r.description = n), (this.iconSchema.properties[e].markdownDescription = `${n} $(${e})`));
        const t = this.iconReferenceSchema.enum.indexOf(e);
        (-1 !== t && (this.iconReferenceSchema.enumDescriptions[t] = n), this._onDidChange.fire());
      }
      return r;
    }
    const o = { id: e, description: n, defaults: t, deprecationMessage: i };
    this.iconsById[e] = o;
    const s = { $ref: "#/definitions/icons" };
    return (
      i && (s.deprecationMessage = i),
      n && (s.markdownDescription = `${n}: $(${e})`),
      (this.iconSchema.properties[e] = s),
      this.iconReferenceSchema.enum.push(e),
      this.iconReferenceSchema.enumDescriptions.push(n || ""),
      this._onDidChange.fire(),
      { id: e }
    );
  }
  getIcons() {
    return Object.keys(this.iconsById).map((e) => this.iconsById[e]);
  }
  getIcon(e) {
    return this.iconsById[e];
  }
  getIconSchema() {
    return this.iconSchema;
  }
  toString() {
    const e = (e, t) => e.id.localeCompare(t.id),
      t = (e) => {
        for (; AV.isThemeIcon(e.defaults); ) e = this.iconsById[e.defaults.id];
        return `codicon codicon-${e ? e.id : ""}`;
      },
      n = [];
    (n.push(
      "| preview     | identifier                        | default codicon ID                | description",
    ),
      n.push(
        "| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |",
      ));
    const i = Object.keys(this.iconsById).map((e) => this.iconsById[e]);
    for (const r of i.filter((e) => !!e.description).sort(e))
      n.push(
        `|<i class="${t(r)}"></i>|${r.id}|${AV.isThemeIcon(r.defaults) ? r.defaults.id : r.id}|${r.description || ""}|`,
      );
    (n.push("| preview     | identifier                        "),
      n.push("| ----------- | --------------------------------- |"));
    for (const r of i.filter((e) => !AV.isThemeIcon(e.defaults)).sort(e))
      n.push(`|<i class="${t(r)}"></i>|${r.id}|`);
    return n.join("\n");
  }
})();
function Zle(e, t, n, i) {
  return Gle.registerIcon(e, t, n, i);
}
function Yle() {
  return Gle;
}
(NW.add("base.contributions.icons", Gle),
  (function () {
    const e = RV();
    for (const t in e) {
      const n = "\\" + e[t].toString(16);
      Gle.registerIcon(t, { fontCharacter: n });
    }
  })());
const Xle = "vscode://schemas/icons",
  Qle = NW.as($U);
Qle.registerSchema(Xle, Gle.getIconSchema());
const Jle = new EM(() => Qle.notifySchemaChanged(Xle), 200);
Gle.onDidChange(() => {
  Jle.isScheduled() || Jle.schedule();
});
const ece = Zle("widget-close", OV.close, SI(2027, "Icon for the close action in widgets."));
(Zle("goto-previous-location", OV.arrowUp, SI(2028, "Icon for goto previous editor location.")),
  Zle("goto-next-location", OV.arrowDown, SI(2029, "Icon for goto next editor location.")),
  AV.modify(OV.sync, "spin"),
  AV.modify(OV.loading, "spin"));
var tce = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  nce = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const ice = Zle(
    "diff-review-insert",
    OV.add,
    SI(97, "Icon for 'Insert' in accessible diff viewer."),
  ),
  rce = Zle(
    "diff-review-remove",
    OV.remove,
    SI(98, "Icon for 'Remove' in accessible diff viewer."),
  ),
  oce = Zle("diff-review-close", OV.close, SI(99, "Icon for 'Close' in accessible diff viewer."));
let sce = class extends PO {
  static {
    this._ttPolicy = ZJ("diffReview", { createHTML: (e) => e });
  }
  constructor(e, t, n, i, r, o, s, a, l) {
    (super(),
      (this._parentNode = e),
      (this._visible = t),
      (this._setVisible = n),
      (this._canClose = i),
      (this._width = r),
      (this._height = o),
      (this._diffs = s),
      (this._models = a),
      (this._instantiationService = l),
      (this._state = Xj(this, (e) => {
        const t = this._visible.read(e);
        if (((this._parentNode.style.visibility = t ? "visible" : "hidden"), !t)) return null;
        const n = e.store.add(
          this._instantiationService.createInstance(
            ace,
            this._diffs,
            this._models,
            this._setVisible,
            this._canClose,
          ),
        );
        return {
          model: n,
          view: e.store.add(
            this._instantiationService.createInstance(
              fce,
              this._parentNode,
              n,
              this._width,
              this._height,
              this._models,
            ),
          ),
        };
      }).recomputeInitiallyAndOnChange(this._store)));
  }
  next() {
    cF((e) => {
      const t = this._visible.get();
      (this._setVisible(!0, e), t && this._state.get().model.nextGroup(e));
    });
  }
  prev() {
    cF((e) => {
      (this._setVisible(!0, e), this._state.get().model.previousGroup(e));
    });
  }
  close() {
    cF((e) => {
      this._setVisible(!1, e);
    });
  }
};
sce = tce([nce(8, vV)], sce);
let ace = class extends PO {
  constructor(e, t, n, i, r) {
    (super(),
      (this._diffs = e),
      (this._models = t),
      (this._setVisible = n),
      (this.canClose = i),
      (this._accessibilitySignalService = r),
      (this._groups = LF(this, [])),
      (this._currentGroupIdx = LF(this, 0)),
      (this._currentElementIdx = LF(this, 0)),
      (this.groups = this._groups),
      (this.currentGroup = this._currentGroupIdx.map((e, t) => this._groups.read(t)[e])),
      (this.currentGroupIndex = this._currentGroupIdx),
      (this.currentElement = this._currentElementIdx.map(
        (e, t) => this.currentGroup.read(t)?.lines[e],
      )),
      this._register(
        rF((e) => {
          const t = this._diffs.read(e);
          if (!t) return void this._groups.set([], void 0);
          const n = (function (e, t, n) {
            const i = [];
            for (const r of nj(
              e,
              (e, t) => t.modified.startLineNumber - e.modified.endLineNumberExclusive < 2 * lce,
            )) {
              const e = [];
              e.push(new uce());
              const o = new Q5(
                  Math.max(1, r[0].original.startLineNumber - lce),
                  Math.min(r[r.length - 1].original.endLineNumberExclusive + lce, t + 1),
                ),
                s = new Q5(
                  Math.max(1, r[0].modified.startLineNumber - lce),
                  Math.min(r[r.length - 1].modified.endLineNumberExclusive + lce, n + 1),
                );
              ij(r, (t, n) => {
                const i = new Q5(
                    t ? t.original.endLineNumberExclusive : o.startLineNumber,
                    n ? n.original.startLineNumber : o.endLineNumberExclusive,
                  ),
                  r = new Q5(
                    t ? t.modified.endLineNumberExclusive : s.startLineNumber,
                    n ? n.modified.startLineNumber : s.endLineNumberExclusive,
                  );
                (i.forEach((t) => {
                  e.push(new pce(t, r.startLineNumber + (t - i.startLineNumber)));
                }),
                  n &&
                    (n.original.forEach((t) => {
                      e.push(new hce(n, t));
                    }),
                    n.modified.forEach((t) => {
                      e.push(new gce(n, t));
                    })));
              });
              const a = r[0].modified.join(r[r.length - 1].modified),
                l = r[0].original.join(r[r.length - 1].original);
              i.push(new dce(new Fle(a, l), e));
            }
            return i;
          })(
            t,
            this._models.getOriginalModel().getLineCount(),
            this._models.getModifiedModel().getLineCount(),
          );
          cF((e) => {
            const t = this._models.getModifiedPosition();
            if (t) {
              const i = n.findIndex((e) => t?.lineNumber < e.range.modified.endLineNumberExclusive);
              -1 !== i && this._currentGroupIdx.set(i, e);
            }
            this._groups.set(n, e);
          });
        }),
      ),
      this._register(
        rF((e) => {
          const t = this.currentElement.read(e);
          t?.type === cce.Deleted
            ? this._accessibilitySignalService.playSignal(Lne.diffLineDeleted, {
                source: "accessibleDiffViewer.currentElementChanged",
              })
            : t?.type === cce.Added &&
              this._accessibilitySignalService.playSignal(Lne.diffLineInserted, {
                source: "accessibleDiffViewer.currentElementChanged",
              });
        }),
      ),
      this._register(
        rF((e) => {
          const t = this.currentElement.read(e);
          if (t && t.type !== cce.Header) {
            const e = t.modifiedLineNumber ?? t.diff.modified.startLineNumber;
            this._models.modifiedSetSelection(YH.fromPositions(new xV(e, 1)));
          }
        }),
      ));
  }
  _goToGroupDelta(e, t) {
    const n = this.groups.get();
    !n ||
      n.length <= 1 ||
      uF(t, (t) => {
        (this._currentGroupIdx.set(
          N$.ofLength(n.length).clipCyclic(this._currentGroupIdx.get() + e),
          t,
        ),
          this._currentElementIdx.set(0, t));
      });
  }
  nextGroup(e) {
    this._goToGroupDelta(1, e);
  }
  previousGroup(e) {
    this._goToGroupDelta(-1, e);
  }
  _goToLineDelta(e) {
    const t = this.currentGroup.get();
    !t ||
      t.lines.length <= 1 ||
      cF((n) => {
        this._currentElementIdx.set(
          N$.ofLength(t.lines.length).clip(this._currentElementIdx.get() + e),
          n,
        );
      });
  }
  goToNextLine() {
    this._goToLineDelta(1);
  }
  goToPreviousLine() {
    this._goToLineDelta(-1);
  }
  goToLine(e) {
    const t = this.currentGroup.get();
    if (!t) return;
    const n = t.lines.indexOf(e);
    -1 !== n &&
      cF((e) => {
        this._currentElementIdx.set(n, e);
      });
  }
  revealCurrentElementInEditor() {
    if (!this.canClose.get()) return;
    this._setVisible(!1, void 0);
    const e = this.currentElement.get();
    e &&
      (e.type === cce.Deleted
        ? this._models.originalReveal(YH.fromPositions(new xV(e.originalLineNumber, 1)))
        : this._models.modifiedReveal(
            e.type !== cce.Header ? YH.fromPositions(new xV(e.modifiedLineNumber, 1)) : void 0,
          ));
  }
  close() {
    this.canClose.get() && (this._setVisible(!1, void 0), this._models.modifiedFocus());
  }
};
ace = tce([nce(4, kne)], ace);
const lce = 3;
var cce;
!(function (e) {
  ((e[(e.Header = 0)] = "Header"),
    (e[(e.Unchanged = 1)] = "Unchanged"),
    (e[(e.Deleted = 2)] = "Deleted"),
    (e[(e.Added = 3)] = "Added"));
})(cce || (cce = {}));
class dce {
  constructor(e, t) {
    ((this.range = e), (this.lines = t));
  }
}
class uce {
  constructor() {
    this.type = cce.Header;
  }
}
class hce {
  constructor(e, t) {
    ((this.diff = e),
      (this.originalLineNumber = t),
      (this.type = cce.Deleted),
      (this.modifiedLineNumber = void 0));
  }
}
class gce {
  constructor(e, t) {
    ((this.diff = e),
      (this.modifiedLineNumber = t),
      (this.type = cce.Added),
      (this.originalLineNumber = void 0));
  }
}
class pce {
  constructor(e, t) {
    ((this.originalLineNumber = e), (this.modifiedLineNumber = t), (this.type = cce.Unchanged));
  }
}
let fce = class extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._element = e),
      (this._model = t),
      (this._width = n),
      (this._height = i),
      (this._models = r),
      (this._languageService = o),
      (this.domNode = this._element),
      (this.domNode.className = "monaco-component diff-review monaco-editor-background"));
    const s = document.createElement("div");
    ((s.className = "diff-review-actions"),
      (this._actionBar = this._register(new Cle(s))),
      this._register(
        rF((e) => {
          (this._actionBar.clear(),
            this._model.canClose.read(e) &&
              this._actionBar.push(
                DV({
                  id: "diffreview.close",
                  label: SI(100, "Close"),
                  class: "close-diff-review " + AV.asClassName(oce),
                  enabled: !0,
                  run: async () => t.close(),
                }),
                { label: !1, icon: !0 },
              ));
        }),
      ),
      (this._content = document.createElement("div")),
      (this._content.className = "diff-review-content"),
      this._content.setAttribute("role", "code"),
      (this._scrollbar = this._register(new wJ(this._content, {}))),
      PB(this.domNode, this._scrollbar.getDomNode(), s),
      this._register(
        rF((e) => {
          (this._height.read(e), this._width.read(e), this._scrollbar.scanDomNode());
        }),
      ),
      this._register(
        MO(() => {
          PB(this.domNode);
        }),
      ),
      this._register(Ile(this.domNode, { width: this._width, height: this._height })),
      this._register(Ile(this._content, { width: this._width, height: this._height })),
      this._register(
        aF((e, t) => {
          (this._model.currentGroup.read(e), this._render(t));
        }),
      ),
      this._register(
        KF(this.domNode, "keydown", (e) => {
          ((e.equals(18) || e.equals(2066) || e.equals(530)) &&
            (e.preventDefault(), this._model.goToNextLine()),
            (e.equals(16) || e.equals(2064) || e.equals(528)) &&
              (e.preventDefault(), this._model.goToPreviousLine()),
            (e.equals(9) || e.equals(2057) || e.equals(521) || e.equals(1033)) &&
              (e.preventDefault(), this._model.close()),
            (e.equals(10) || e.equals(3)) &&
              (e.preventDefault(), this._model.revealCurrentElementInEditor()));
        }),
      ));
  }
  _render(e) {
    const t = this._models.getOriginalOptions(),
      n = this._models.getModifiedOptions(),
      i = document.createElement("div");
    ((i.className = "diff-review-table"),
      i.setAttribute("role", "list"),
      i.setAttribute(
        "aria-label",
        SI(101, "Accessible Diff Viewer. Use arrow up and down to navigate."),
      ),
      Vq(i, n.get(59)),
      PB(this._content, i));
    const r = this._models.getOriginalModel(),
      o = this._models.getModifiedModel();
    if (!r || !o) return;
    const s = r.getOptions(),
      a = o.getOptions(),
      l = n.get(75),
      c = this._model.currentGroup.get();
    for (const d of c?.lines || []) {
      if (!c) break;
      let u;
      if (d.type === cce.Header) {
        const e = document.createElement("div");
        ((e.className = "diff-review-row"), e.setAttribute("role", "listitem"));
        const t = c.range,
          n = this._model.currentGroupIndex.get(),
          i = this._model.groups.get().length,
          r = (e) =>
            0 === e
              ? SI(102, "no lines changed")
              : 1 === e
                ? SI(103, "1 line changed")
                : SI(104, "{0} lines changed", e),
          o = r(t.original.length),
          s = r(t.modified.length);
        e.setAttribute(
          "aria-label",
          SI(
            105,
            "Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",
            n + 1,
            i,
            t.original.startLineNumber,
            o,
            t.modified.startLineNumber,
            s,
          ),
        );
        const a = document.createElement("div");
        ((a.className = "diff-review-cell diff-review-summary"),
          a.appendChild(
            document.createTextNode(
              `${n + 1}/${i}: @@ -${t.original.startLineNumber},${t.original.length} +${t.modified.startLineNumber},${t.modified.length} @@`,
            ),
          ),
          e.appendChild(a),
          (u = e));
      } else u = this._createRow(d, l, this._width.get(), t, r, s, n, o, a);
      i.appendChild(u);
      const h = Xj((e) => this._model.currentElement.read(e) === d);
      (e.add(
        rF((e) => {
          const t = h.read(e);
          ((u.tabIndex = t ? 0 : -1), t && u.focus());
        }),
      ),
        e.add(
          $F(u, "focus", () => {
            this._model.goToLine(d);
          }),
        ));
    }
    this._scrollbar.scanDomNode();
  }
  _createRow(e, t, n, i, r, o, s, a, l) {
    const c = i.get(165),
      d = c.glyphMarginWidth + c.lineNumbersWidth,
      u = s.get(165),
      h = 10 + u.glyphMarginWidth + u.lineNumbersWidth;
    let g = "diff-review-row",
      p = "";
    let f = null;
    switch (e.type) {
      case cce.Added:
        ((g = "diff-review-row line-insert"), (p = " char-insert"), (f = ice));
        break;
      case cce.Deleted:
        ((g = "diff-review-row line-delete"), (p = " char-delete"), (f = rce));
    }
    const m = document.createElement("div");
    ((m.style.minWidth = n + "px"),
      (m.className = g),
      m.setAttribute("role", "listitem"),
      (m.ariaLevel = ""));
    const _ = document.createElement("div");
    ((_.className = "diff-review-cell"), (_.style.height = `${t}px`), m.appendChild(_));
    const v = document.createElement("span");
    ((v.style.width = d + "px"),
      (v.style.minWidth = d + "px"),
      (v.className = "diff-review-line-number" + p),
      void 0 !== e.originalLineNumber
        ? v.appendChild(document.createTextNode(String(e.originalLineNumber)))
        : (v.innerText = " "),
      _.appendChild(v));
    const b = document.createElement("span");
    ((b.style.width = h + "px"),
      (b.style.minWidth = h + "px"),
      (b.style.paddingRight = "10px"),
      (b.className = "diff-review-line-number" + p),
      void 0 !== e.modifiedLineNumber
        ? b.appendChild(document.createTextNode(String(e.modifiedLineNumber)))
        : (b.innerText = " "),
      _.appendChild(b));
    const y = document.createElement("span");
    if (((y.className = "diff-review-spacer"), f)) {
      const e = document.createElement("span");
      ((e.className = AV.asClassName(f)), (e.innerText = "  "), y.appendChild(e));
    } else y.innerText = "  ";
    let x;
    if ((_.appendChild(y), void 0 !== e.modifiedLineNumber)) {
      let t = this._getLineHtml(
        a,
        s,
        l.tabSize,
        e.modifiedLineNumber,
        this._languageService.languageIdCodec,
      );
      (sce._ttPolicy && (t = sce._ttPolicy.createHTML(t)),
        _.insertAdjacentHTML("beforeend", t),
        (x = a.getLineContent(e.modifiedLineNumber)));
    } else {
      let t = this._getLineHtml(
        r,
        i,
        o.tabSize,
        e.originalLineNumber,
        this._languageService.languageIdCodec,
      );
      (sce._ttPolicy && (t = sce._ttPolicy.createHTML(t)),
        _.insertAdjacentHTML("beforeend", t),
        (x = r.getLineContent(e.originalLineNumber)));
    }
    0 === x.length && (x = SI(106, "blank"));
    let w = "";
    switch (e.type) {
      case cce.Unchanged:
        w =
          e.originalLineNumber === e.modifiedLineNumber
            ? SI(107, "{0} unchanged line {1}", x, e.originalLineNumber)
            : SI(
                108,
                "{0} original line {1} modified line {2}",
                x,
                e.originalLineNumber,
                e.modifiedLineNumber,
              );
        break;
      case cce.Added:
        w = SI(109, "+ {0} modified line {1}", x, e.modifiedLineNumber);
        break;
      case cce.Deleted:
        w = SI(110, "- {0} original line {1}", x, e.originalLineNumber);
    }
    return (m.setAttribute("aria-label", w), m);
  }
  _getLineHtml(e, t, n, i, r) {
    const o = e.getLineContent(i),
      s = t.get(59),
      a = t.get(117).verticalScrollbarSize,
      l = D$.createEmpty(o, r),
      c = r4.isBasicASCII(o, e.mightContainNonBasicASCII()),
      d = r4.containsRTL(o, c, e.mightContainRTL());
    return SQ(
      new vQ(
        s.isMonospace && !t.get(40),
        s.canUseHalfwidthRightwardsArrow,
        o,
        !1,
        c,
        d,
        0,
        l,
        [],
        n,
        0,
        s.spaceWidth,
        s.middotWidth,
        s.wsmiddotWidth,
        t.get(133),
        t.get(113),
        t.get(108),
        t.get(60) !== xK.OFF,
        null,
        null,
        a,
      ),
    ).html;
  }
};
fce = tce([nce(5, BU)], fce);
class mce {
  constructor(e) {
    this.editors = e;
  }
  getOriginalModel() {
    return this.editors.original.getModel();
  }
  getOriginalOptions() {
    return this.editors.original.getOptions();
  }
  originalReveal(e) {
    (this.editors.original.revealRange(e),
      this.editors.original.setSelection(e),
      this.editors.original.focus());
  }
  getModifiedModel() {
    return this.editors.modified.getModel();
  }
  getModifiedOptions() {
    return this.editors.modified.getOptions();
  }
  modifiedReveal(e) {
    (e && (this.editors.modified.revealRange(e), this.editors.modified.setSelection(e)),
      this.editors.modified.focus());
  }
  modifiedSetSelection(e) {
    this.editors.modified.setSelection(e);
  }
  modifiedFocus() {
    this.editors.modified.focus();
  }
  getModifiedPosition() {
    return this.editors.modified.getPosition() ?? void 0;
  }
}
(SG(
  "diffEditor.move.border",
  "#8b8b8b9c",
  SI(137, "The border color for text that got moved in the diff editor."),
),
  SG(
    "diffEditor.moveActive.border",
    "#FFA500",
    SI(138, "The active border color for text that got moved in the diff editor."),
  ),
  SG(
    "diffEditor.unchangedRegionShadow",
    { dark: "#000000", light: "#737373BF", hcDark: "#000000", hcLight: "#737373BF" },
    SI(139, "The color of the shadow around unchanged region widgets."),
  ));
const _ce = Zle("diff-insert", OV.add, SI(140, "Line decoration for inserts in the diff editor.")),
  vce = Zle("diff-remove", OV.remove, SI(141, "Line decoration for removals in the diff editor.")),
  bce = cee.register({
    className: "line-insert",
    description: "line-insert",
    isWholeLine: !0,
    linesDecorationsClassName: "insert-sign " + AV.asClassName(_ce),
    marginClassName: "gutter-insert",
  }),
  yce = cee.register({
    className: "line-delete",
    description: "line-delete",
    isWholeLine: !0,
    linesDecorationsClassName: "delete-sign " + AV.asClassName(vce),
    marginClassName: "gutter-delete",
  }),
  xce = cee.register({
    className: "line-insert",
    description: "line-insert",
    isWholeLine: !0,
    marginClassName: "gutter-insert",
  }),
  wce = cee.register({
    className: "line-delete",
    description: "line-delete",
    isWholeLine: !0,
    marginClassName: "gutter-delete",
  }),
  Cce = cee.register({
    className: "char-insert",
    description: "char-insert",
    shouldFillLineOnLineBreak: !0,
  }),
  Sce = cee.register({ className: "char-insert", description: "char-insert", isWholeLine: !0 }),
  kce = cee.register({
    className: "char-insert diff-range-empty",
    description: "char-insert diff-range-empty",
  }),
  Ece = cee.register({
    className: "char-delete",
    description: "char-delete",
    shouldFillLineOnLineBreak: !0,
  }),
  Nce = cee.register({ className: "char-delete", description: "char-delete", isWholeLine: !0 }),
  Lce = cee.register({
    className: "char-delete diff-range-empty",
    description: "char-delete diff-range-empty",
  }),
  Dce = bV("editorWorkerService");
var Tce,
  Ice = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Rce = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const Oce = bV("diffProviderFactoryService");
let Mce = class {
  constructor(e) {
    this.instantiationService = e;
  }
  createDiffProvider(e) {
    return this.instantiationService.createInstance(Ace, e);
  }
};
((Mce = Ice([Rce(0, vV)], Mce)), HU(Oce, Mce, 1));
let Ace = class {
  static {
    Tce = this;
  }
  static {
    this.diffCache = new Map();
  }
  constructor(e, t, n) {
    ((this.editorWorkerService = t),
      (this.telemetryService = n),
      (this.onDidChangeEventEmitter = new QO()),
      (this.onDidChange = this.onDidChangeEventEmitter.event),
      (this.diffAlgorithm = "advanced"),
      (this.diffAlgorithmOnDidChangeSubscription = void 0),
      this.setOptions(e));
  }
  dispose() {
    this.diffAlgorithmOnDidChangeSubscription?.dispose();
  }
  async computeDiff(e, t, n, i) {
    if ("string" != typeof this.diffAlgorithm) return this.diffAlgorithm.computeDiff(e, t, n, i);
    if (e.isDisposed() || t.isDisposed())
      return { changes: [], identical: !0, quitEarly: !1, moves: [] };
    if (1 === e.getLineCount() && 1 === e.getLineMaxColumn(1))
      return 1 === t.getLineCount() && 1 === t.getLineMaxColumn(1)
        ? { changes: [], identical: !0, quitEarly: !1, moves: [] }
        : {
            changes: [
              new Wle(new Q5(1, 2), new Q5(1, t.getLineCount() + 1), [
                new Hle(e.getFullModelRange(), t.getFullModelRange()),
              ]),
            ],
            identical: !1,
            quitEarly: !1,
            moves: [],
          };
    const r = JSON.stringify([e.uri.toString(), t.uri.toString()]),
      o = JSON.stringify([
        e.id,
        t.id,
        e.getAlternativeVersionId(),
        t.getAlternativeVersionId(),
        JSON.stringify(n),
      ]),
      s = Tce.diffCache.get(r);
    if (s && s.context === o) return s.result;
    const a = UO.create(),
      l = await this.editorWorkerService.computeDiff(e.uri, t.uri, n, this.diffAlgorithm),
      c = a.elapsed();
    if (
      (this.telemetryService.publicLog2("diffEditor.computeDiff", {
        timeMs: c,
        timedOut: l?.quitEarly ?? !0,
        detectedMoves: n.computeMoves ? (l?.moves.length ?? 0) : -1,
      }),
      i.isCancellationRequested)
    )
      return { changes: [], identical: !1, quitEarly: !0, moves: [] };
    if (!l) throw new Error("no diff result available");
    return (
      Tce.diffCache.size > 10 && Tce.diffCache.delete(Tce.diffCache.keys().next().value),
      Tce.diffCache.set(r, { result: l, context: o }),
      l
    );
  }
  setOptions(e) {
    let t = !1;
    (e.diffAlgorithm &&
      this.diffAlgorithm !== e.diffAlgorithm &&
      (this.diffAlgorithmOnDidChangeSubscription?.dispose(),
      (this.diffAlgorithmOnDidChangeSubscription = void 0),
      (this.diffAlgorithm = e.diffAlgorithm),
      "string" != typeof e.diffAlgorithm &&
        (this.diffAlgorithmOnDidChangeSubscription = e.diffAlgorithm.onDidChange(() =>
          this.onDidChangeEventEmitter.fire(),
        )),
      (t = !0)),
      t && this.onDidChangeEventEmitter.fire());
  }
};
Ace = Tce = Ice([Rce(1, Dce), Rce(2, HW)], Ace);
class Pce {
  static trivial(e, t) {
    return new Pce([new jce(N$.ofLength(e.length), N$.ofLength(t.length))], !1);
  }
  static trivialTimedOut(e, t) {
    return new Pce([new jce(N$.ofLength(e.length), N$.ofLength(t.length))], !0);
  }
  constructor(e, t) {
    ((this.diffs = e), (this.hitTimeout = t));
  }
}
class jce {
  static invert(e, t) {
    const n = [];
    return (
      ij(e, (e, i) => {
        n.push(
          jce.fromOffsetPairs(
            e ? e.getEndExclusives() : Fce.zero,
            i
              ? i.getStarts()
              : new Fce(t, (e ? e.seq2Range.endExclusive - e.seq1Range.endExclusive : 0) + t),
          ),
        );
      }),
      n
    );
  }
  static fromOffsetPairs(e, t) {
    return new jce(new N$(e.offset1, t.offset1), new N$(e.offset2, t.offset2));
  }
  static assertSorted(e) {
    let t;
    for (const n of e) {
      if (
        t &&
        !(
          t.seq1Range.endExclusive <= n.seq1Range.start &&
          t.seq2Range.endExclusive <= n.seq2Range.start
        )
      )
        throw new QI("Sequence diffs must be sorted");
      t = n;
    }
  }
  constructor(e, t) {
    ((this.seq1Range = e), (this.seq2Range = t));
  }
  swap() {
    return new jce(this.seq2Range, this.seq1Range);
  }
  toString() {
    return `${this.seq1Range} <-> ${this.seq2Range}`;
  }
  join(e) {
    return new jce(this.seq1Range.join(e.seq1Range), this.seq2Range.join(e.seq2Range));
  }
  delta(e) {
    return 0 === e ? this : new jce(this.seq1Range.delta(e), this.seq2Range.delta(e));
  }
  deltaStart(e) {
    return 0 === e ? this : new jce(this.seq1Range.deltaStart(e), this.seq2Range.deltaStart(e));
  }
  deltaEnd(e) {
    return 0 === e ? this : new jce(this.seq1Range.deltaEnd(e), this.seq2Range.deltaEnd(e));
  }
  intersect(e) {
    const t = this.seq1Range.intersect(e.seq1Range),
      n = this.seq2Range.intersect(e.seq2Range);
    if (t && n) return new jce(t, n);
  }
  getStarts() {
    return new Fce(this.seq1Range.start, this.seq2Range.start);
  }
  getEndExclusives() {
    return new Fce(this.seq1Range.endExclusive, this.seq2Range.endExclusive);
  }
}
class Fce {
  static {
    this.zero = new Fce(0, 0);
  }
  static {
    this.max = new Fce(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
  }
  constructor(e, t) {
    ((this.offset1 = e), (this.offset2 = t));
  }
  toString() {
    return `${this.offset1} <-> ${this.offset2}`;
  }
  delta(e) {
    return 0 === e ? this : new Fce(this.offset1 + e, this.offset2 + e);
  }
  equals(e) {
    return this.offset1 === e.offset1 && this.offset2 === e.offset2;
  }
}
class Bce {
  static {
    this.instance = new Bce();
  }
  isValid() {
    return !0;
  }
}
class Vce {
  constructor(e) {
    if (((this.timeout = e), (this.startTime = Date.now()), (this.valid = !0), e <= 0))
      throw new QI("timeout must be positive");
  }
  isValid() {
    return (
      !(Date.now() - this.startTime < this.timeout) && this.valid && (this.valid = !1),
      this.valid
    );
  }
}
class Wce {
  constructor(e, t) {
    ((this.width = e), (this.height = t), (this.array = []), (this.array = new Array(e * t)));
  }
  get(e, t) {
    return this.array[e + t * this.width];
  }
  set(e, t, n) {
    this.array[e + t * this.width] = n;
  }
}
function Hce(e) {
  return 32 === e || 9 === e;
}
class zce {
  static {
    this.chrKeys = new Map();
  }
  static getKey(e) {
    let t = this.chrKeys.get(e);
    return (void 0 === t && ((t = this.chrKeys.size), this.chrKeys.set(e, t)), t);
  }
  constructor(e, t, n) {
    ((this.range = e), (this.lines = t), (this.source = n), (this.histogram = []));
    let i = 0;
    for (let r = e.startLineNumber - 1; r < e.endLineNumberExclusive - 1; r++) {
      const e = t[r];
      for (let t = 0; t < e.length; t++) {
        i++;
        const n = e[t],
          r = zce.getKey(n);
        this.histogram[r] = (this.histogram[r] || 0) + 1;
      }
      i++;
      const n = zce.getKey("\n");
      this.histogram[n] = (this.histogram[n] || 0) + 1;
    }
    this.totalCount = i;
  }
  computeSimilarity(e) {
    let t = 0;
    const n = Math.max(this.histogram.length, e.histogram.length);
    for (let i = 0; i < n; i++) t += Math.abs((this.histogram[i] ?? 0) - (e.histogram[i] ?? 0));
    return 1 - t / (this.totalCount + e.totalCount);
  }
}
function Uce(e, t, n, i) {
  return (
    t || (t = (e) => null != e),
    new Promise((r, o) => {
      let s = !0,
        a = !1;
      const l = e.map((e) => ({ isFinished: t(e), error: !!n && n(e), state: e })),
        c = rF((e) => {
          const { isFinished: t, error: n, state: i } = l.read(e);
          (t || n) && (s ? (a = !0) : c.dispose(), n ? o(!0 === n ? i : n) : r(i));
        });
      if (i) {
        const e = i.onCancellationRequested(() => {
          (c.dispose(), e.dispose(), o(new KI()));
        });
        if (i.isCancellationRequested) return (c.dispose(), e.dispose(), void o(new KI()));
      }
      ((s = !1), a && c.dispose());
    })
  );
}
function $ce(e, t, n = Tj.ofCaller()) {
  return new qce("string" == typeof e ? e : new Pj(e, void 0, void 0), t, n);
}
class qce extends Kj {
  constructor(e, t, n) {
    (super(n),
      (this.event = t),
      (this.handleEvent = () => {
        cF(
          (e) => {
            for (const t of this._observers)
              (e.updateObserver(t, this), t.handleChange(this, void 0));
          },
          () => this.debugName,
        );
      }),
      (this.debugName =
        "string" == typeof e ? e : (e.getDebugName(this) ?? "Observable Signal From Event")));
  }
  onFirstObserverAdded() {
    this.subscription = this.event(this.handleEvent);
  }
  onLastObserverRemoved() {
    (this.subscription.dispose(), (this.subscription = void 0));
  }
  get() {}
}
let Kce = class extends PO {
  setActiveMovedText(e) {
    this._activeMovedText.set(e, void 0);
  }
  constructor(e, t, n) {
    (super(),
      (this.model = e),
      (this._options = t),
      (this._diffProviderFactoryService = n),
      (this._isDiffUpToDate = LF(this, !1)),
      (this.isDiffUpToDate = this._isDiffUpToDate),
      (this._diff = LF(this, void 0)),
      (this.diff = this._diff),
      (this._unchangedRegions = LF(this, void 0)),
      (this.unchangedRegions = Xj(this, (e) =>
        this._options.hideUnchangedRegions.read(e)
          ? (this._unchangedRegions.read(e)?.regions ?? [])
          : (cF((e) => {
              for (const t of this._unchangedRegions.read(void 0)?.regions || []) t.collapseAll(e);
            }),
            []),
      )),
      (this.movedTextToCompare = LF(this, void 0)),
      (this._activeMovedText = LF(this, void 0)),
      (this._hoveredMovedText = LF(this, void 0)),
      (this.activeMovedText = Xj(
        this,
        (e) =>
          this.movedTextToCompare.read(e) ??
          this._hoveredMovedText.read(e) ??
          this._activeMovedText.read(e),
      )),
      (this._cancellationTokenSource = new cM()),
      (this._diffProvider = Xj(this, (e) => {
        const t = this._diffProviderFactoryService.createDiffProvider({
          diffAlgorithm: this._options.diffAlgorithm.read(e),
        });
        return { diffProvider: t, onChangeSignal: $ce("onDidChange", t.onDidChange) };
      })),
      this._register(MO(() => this._cancellationTokenSource.cancel())));
    const i = A9("contentChangedSignal"),
      r = this._register(new EM(() => i.trigger(void 0), 200));
    this._register(
      rF((t) => {
        const n = this._unchangedRegions.read(t);
        if (!n || n.regions.some((e) => e.isDragged.read(t))) return;
        const i = n.originalDecorationIds
            .map((t) => e.original.getDecorationRange(t))
            .map((e) => (e ? Q5.fromRangeInclusive(e) : void 0)),
          r = n.modifiedDecorationIds
            .map((t) => e.modified.getDecorationRange(t))
            .map((e) => (e ? Q5.fromRangeInclusive(e) : void 0)),
          o = n.regions
            .map((e, n) =>
              i[n] && r[n]
                ? new Yce(
                    i[n].startLineNumber,
                    r[n].startLineNumber,
                    i[n].length,
                    e.visibleLineCountTop.read(t),
                    e.visibleLineCountBottom.read(t),
                  )
                : void 0,
            )
            .filter(hR),
          s = [];
        let a = !1;
        for (const e of nj(
          o,
          (e, n) =>
            e.getHiddenModifiedRange(t).endLineNumberExclusive ===
            n.getHiddenModifiedRange(t).startLineNumber,
        ))
          if (e.length > 1) {
            a = !0;
            const t = e.reduce((e, t) => e + t.lineCount, 0),
              n = new Yce(
                e[0].originalLineNumber,
                e[0].modifiedLineNumber,
                t,
                e[0].visibleLineCountTop.read(void 0),
                e[e.length - 1].visibleLineCountBottom.read(void 0),
              );
            s.push(n);
          } else s.push(e[0]);
        if (a) {
          const t = e.original.deltaDecorations(
              n.originalDecorationIds,
              s.map((e) => ({
                range: e.originalUnchangedRange.toInclusiveRange(),
                options: { description: "unchanged" },
              })),
            ),
            i = e.modified.deltaDecorations(
              n.modifiedDecorationIds,
              s.map((e) => ({
                range: e.modifiedUnchangedRange.toInclusiveRange(),
                options: { description: "unchanged" },
              })),
            );
          cF((e) => {
            this._unchangedRegions.set(
              { regions: s, originalDecorationIds: t, modifiedDecorationIds: i },
              e,
            );
          });
        }
      }),
    );
    const o = (t, n, i) => {
      const r = Yce.fromDiffs(
        t.changes,
        e.original.getLineCount(),
        e.modified.getLineCount(),
        this._options.hideUnchangedRegionsMinimumLineCount.read(i),
        this._options.hideUnchangedRegionsContextLineCount.read(i),
      );
      let o;
      const s = this._unchangedRegions.get();
      if (s) {
        const t = s.originalDecorationIds
            .map((t) => e.original.getDecorationRange(t))
            .map((e) => (e ? Q5.fromRangeInclusive(e) : void 0)),
          n = s.modifiedDecorationIds
            .map((t) => e.modified.getDecorationRange(t))
            .map((e) => (e ? Q5.fromRangeInclusive(e) : void 0)),
          r = (function (e, t) {
            let n;
            return e.filter((e) => {
              const i = t(e, n);
              return ((n = e), i);
            });
          })(
            s.regions
              .map((e, i) => {
                if (!t[i] || !n[i]) return;
                const r = t[i].length;
                return new Yce(
                  t[i].startLineNumber,
                  n[i].startLineNumber,
                  r,
                  Math.min(e.visibleLineCountTop.get(), r),
                  Math.min(e.visibleLineCountBottom.get(), r - e.visibleLineCountTop.get()),
                );
              })
              .filter(hR),
            (e, t) =>
              !t ||
              (e.modifiedLineNumber >= t.modifiedLineNumber + t.lineCount &&
                e.originalLineNumber >= t.originalLineNumber + t.lineCount),
          );
        let a = r.map((e) => new Fle(e.getHiddenOriginalRange(i), e.getHiddenModifiedRange(i)));
        ((a = Fle.clip(
          a,
          Q5.ofLength(1, e.original.getLineCount()),
          Q5.ofLength(1, e.modified.getLineCount()),
        )),
          (o = Fle.inverse(a, e.original.getLineCount(), e.modified.getLineCount())));
      }
      const a = [];
      if (o)
        for (const e of r) {
          const t = o.filter(
            (t) =>
              t.original.intersectsStrict(e.originalUnchangedRange) &&
              t.modified.intersectsStrict(e.modifiedUnchangedRange),
          );
          a.push(...e.setVisibleRanges(t, n));
        }
      else a.push(...r);
      const l = e.original.deltaDecorations(
          s?.originalDecorationIds || [],
          a.map((e) => ({
            range: e.originalUnchangedRange.toInclusiveRange(),
            options: { description: "unchanged" },
          })),
        ),
        c = e.modified.deltaDecorations(
          s?.modifiedDecorationIds || [],
          a.map((e) => ({
            range: e.modifiedUnchangedRange.toInclusiveRange(),
            options: { description: "unchanged" },
          })),
        );
      this._unchangedRegions.set(
        { regions: a, originalDecorationIds: l, modifiedDecorationIds: c },
        n,
      );
    };
    (this._register(
      e.modified.onDidChangeContent((t) => {
        if (this._diff.get()) {
          const n = m6.fromModelContentChanges(t.changes);
          Qce(this._lastDiff, n, e.original, e.modified);
        }
        (this._isDiffUpToDate.set(!1, void 0), r.schedule());
      }),
    ),
      this._register(
        e.original.onDidChangeContent((t) => {
          if (this._diff.get()) {
            const n = m6.fromModelContentChanges(t.changes);
            Xce(this._lastDiff, n, e.original, e.modified);
          }
          (this._isDiffUpToDate.set(!1, void 0), r.schedule());
        }),
      ),
      this._register(
        aF(async (t, n) => {
          (this._options.hideUnchangedRegionsMinimumLineCount.read(t),
            this._options.hideUnchangedRegionsContextLineCount.read(t),
            r.cancel(),
            i.read(t));
          const s = this._diffProvider.read(t);
          (s.onChangeSignal.read(t), this._isDiffUpToDate.set(!1, void 0));
          let a = [];
          n.add(
            e.original.onDidChangeContent((e) => {
              const t = m6.fromModelContentChanges(e.changes);
              a = Z6(a, t);
            }),
          );
          let l = [];
          n.add(
            e.modified.onDidChangeContent((e) => {
              const t = m6.fromModelContentChanges(e.changes);
              l = Z6(l, t);
            }),
          );
          let c = await s.diffProvider.computeDiff(
            e.original,
            e.modified,
            {
              ignoreTrimWhitespace: this._options.ignoreTrimWhitespace.read(t),
              maxComputationTimeMs: this._options.maxComputationTimeMs.read(t),
              computeMoves: this._options.showMoves.read(t),
            },
            this._cancellationTokenSource.token,
          );
          var d, u, h;
          this._cancellationTokenSource.token.isCancellationRequested ||
            e.original.isDisposed() ||
            e.modified.isDisposed() ||
            ((d = c),
            (u = e.original),
            (h = e.modified),
            (c = {
              changes: d.changes.map(
                (e) =>
                  new Wle(
                    e.original,
                    e.modified,
                    e.innerChanges
                      ? e.innerChanges.map((e) =>
                          (function (e, t, n) {
                            let i = e.originalRange,
                              r = e.modifiedRange;
                            return (
                              1 === i.startColumn &&
                                1 === r.startColumn &&
                                (1 !== i.endColumn || 1 !== r.endColumn) &&
                                i.endColumn === t.getLineMaxColumn(i.endLineNumber) &&
                                r.endColumn === n.getLineMaxColumn(r.endLineNumber) &&
                                i.endLineNumber < t.getLineCount() &&
                                r.endLineNumber < n.getLineCount() &&
                                ((i = i.setEndPosition(i.endLineNumber + 1, 1)),
                                (r = r.setEndPosition(r.endLineNumber + 1, 1))),
                              new Hle(i, r)
                            );
                          })(e, u, h),
                        )
                      : void 0,
                  ),
              ),
              moves: d.moves,
              identical: d.identical,
              quitEarly: d.quitEarly,
            }),
            (c = Xce(c, a, e.original, e.modified) ?? c),
            (c = Qce(c, l, e.original, e.modified) ?? c),
            cF((e) => {
              (o(c, e), (this._lastDiff = c));
              const t = Gce.fromDiffResult(c);
              (this._diff.set(t, e), this._isDiffUpToDate.set(!0, e));
              const n = this.movedTextToCompare.read(void 0);
              this.movedTextToCompare.set(
                n
                  ? this._lastDiff.moves.find((e) =>
                      e.lineRangeMapping.modified.intersect(n.lineRangeMapping.modified),
                    )
                  : void 0,
                e,
              );
            }));
        }),
      ));
  }
  ensureModifiedLineIsVisible(e, t, n) {
    if (0 === this.diff.get()?.mappings.length) return;
    const i = this._unchangedRegions.get()?.regions || [];
    for (const r of i)
      if (r.getHiddenModifiedRange(void 0).contains(e)) return void r.showModifiedLine(e, t, n);
  }
  ensureOriginalLineIsVisible(e, t, n) {
    if (0 === this.diff.get()?.mappings.length) return;
    const i = this._unchangedRegions.get()?.regions || [];
    for (const r of i)
      if (r.getHiddenOriginalRange(void 0).contains(e)) return void r.showOriginalLine(e, t, n);
  }
  async waitForDiff() {
    await Uce(this.isDiffUpToDate, (e) => e);
  }
  serializeState() {
    const e = this._unchangedRegions.get();
    return {
      collapsedRegions: e?.regions.map((e) => ({
        range: e.getHiddenModifiedRange(void 0).serialize(),
      })),
    };
  }
  restoreSerializedState(e) {
    const t = e.collapsedRegions?.map((e) => Q5.deserialize(e.range)),
      n = this._unchangedRegions.get();
    n &&
      t &&
      cF((e) => {
        for (const i of n.regions)
          for (const n of t)
            if (i.modifiedUnchangedRange.intersect(n)) {
              i.setHiddenModifiedRange(n, e);
              break;
            }
      });
  }
};
Kce = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(2, Oce),
  ],
  Kce,
);
class Gce {
  static fromDiffResult(e) {
    return new Gce(
      e.changes.map((e) => new Zce(e)),
      e.moves || [],
      e.identical,
      e.quitEarly,
    );
  }
  constructor(e, t, n, i) {
    ((this.mappings = e), (this.movedTexts = t), (this.identical = n), (this.quitEarly = i));
  }
}
class Zce {
  constructor(e) {
    this.lineRangeMapping = e;
  }
}
class Yce {
  static fromDiffs(e, t, n, i, r) {
    const o = Wle.inverse(e, t, n),
      s = [];
    for (const a of o) {
      let e = a.original.startLineNumber,
        o = a.modified.startLineNumber,
        l = a.original.length;
      const c = 1 === e && 1 === o,
        d = e + l === t + 1 && o + l === n + 1;
      (c || d) && l >= r + i
        ? (c && !d && (l -= r),
          d && !c && ((e += r), (o += r), (l -= r)),
          s.push(new Yce(e, o, l, 0, 0)))
        : l >= 2 * r + i && ((e += r), (o += r), (l -= 2 * r), s.push(new Yce(e, o, l, 0, 0)));
    }
    return s;
  }
  get originalUnchangedRange() {
    return Q5.ofLength(this.originalLineNumber, this.lineCount);
  }
  get modifiedUnchangedRange() {
    return Q5.ofLength(this.modifiedLineNumber, this.lineCount);
  }
  constructor(e, t, n, i, r) {
    ((this.originalLineNumber = e),
      (this.modifiedLineNumber = t),
      (this.lineCount = n),
      (this._visibleLineCountTop = LF(this, 0)),
      (this.visibleLineCountTop = this._visibleLineCountTop),
      (this._visibleLineCountBottom = LF(this, 0)),
      (this.visibleLineCountBottom = this._visibleLineCountBottom),
      (this._shouldHideControls = Xj(
        this,
        (e) =>
          this.visibleLineCountTop.read(e) + this.visibleLineCountBottom.read(e) ===
            this.lineCount && !this.isDragged.read(e),
      )),
      (this.isDragged = LF(this, void 0)));
    const o = Math.max(Math.min(i, this.lineCount), 0),
      s = Math.max(Math.min(r, this.lineCount - i), 0);
    (nR(i === o),
      nR(r === s),
      this._visibleLineCountTop.set(o, void 0),
      this._visibleLineCountBottom.set(s, void 0));
  }
  setVisibleRanges(e, t) {
    const n = [],
      i = new J5(e.map((e) => e.modified)).subtractFrom(this.modifiedUnchangedRange);
    let r = this.originalLineNumber,
      o = this.modifiedLineNumber;
    const s = this.modifiedLineNumber + this.lineCount;
    if (0 === i.ranges.length) (this.showAll(t), n.push(this));
    else {
      let e = 0;
      for (const a of i.ranges) {
        const l = e === i.ranges.length - 1;
        e++;
        const c = (l ? s : a.endLineNumberExclusive) - o,
          d = new Yce(r, o, c, 0, 0);
        (d.setHiddenModifiedRange(a, t),
          n.push(d),
          (r = d.originalUnchangedRange.endLineNumberExclusive),
          (o = d.modifiedUnchangedRange.endLineNumberExclusive));
      }
    }
    return n;
  }
  shouldHideControls(e) {
    return this._shouldHideControls.read(e);
  }
  getHiddenOriginalRange(e) {
    return Q5.ofLength(
      this.originalLineNumber + this._visibleLineCountTop.read(e),
      this.lineCount - this._visibleLineCountTop.read(e) - this._visibleLineCountBottom.read(e),
    );
  }
  getHiddenModifiedRange(e) {
    return Q5.ofLength(
      this.modifiedLineNumber + this._visibleLineCountTop.read(e),
      this.lineCount - this._visibleLineCountTop.read(e) - this._visibleLineCountBottom.read(e),
    );
  }
  setHiddenModifiedRange(e, t) {
    const n = e.startLineNumber - this.modifiedLineNumber,
      i = this.modifiedLineNumber + this.lineCount - e.endLineNumberExclusive;
    this.setState(n, i, t);
  }
  getMaxVisibleLineCountTop() {
    return this.lineCount - this._visibleLineCountBottom.get();
  }
  getMaxVisibleLineCountBottom() {
    return this.lineCount - this._visibleLineCountTop.get();
  }
  showMoreAbove(e = 10, t) {
    const n = this.getMaxVisibleLineCountTop();
    this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get() + e, n), t);
  }
  showMoreBelow(e = 10, t) {
    const n = this.lineCount - this._visibleLineCountTop.get();
    this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get() + e, n), t);
  }
  showAll(e) {
    this._visibleLineCountBottom.set(this.lineCount - this._visibleLineCountTop.get(), e);
  }
  showModifiedLine(e, t, n) {
    const i = e + 1 - (this.modifiedLineNumber + this._visibleLineCountTop.get()),
      r = this.modifiedLineNumber - this._visibleLineCountBottom.get() + this.lineCount - e;
    (0 === t && i < r) || 1 === t
      ? this._visibleLineCountTop.set(this._visibleLineCountTop.get() + i, n)
      : this._visibleLineCountBottom.set(this._visibleLineCountBottom.get() + r, n);
  }
  showOriginalLine(e, t, n) {
    const i = e - this.originalLineNumber,
      r = this.originalLineNumber + this.lineCount - e;
    (0 === t && i < r) || 1 === t
      ? this._visibleLineCountTop.set(
          Math.min(this._visibleLineCountTop.get() + r - i, this.getMaxVisibleLineCountTop()),
          n,
        )
      : this._visibleLineCountBottom.set(
          Math.min(this._visibleLineCountBottom.get() + i - r, this.getMaxVisibleLineCountBottom()),
          n,
        );
  }
  collapseAll(e) {
    (this._visibleLineCountTop.set(0, e), this._visibleLineCountBottom.set(0, e));
  }
  setState(e, t, n) {
    ((e = Math.max(Math.min(e, this.lineCount), 0)),
      (t = Math.max(Math.min(t, this.lineCount - e), 0)),
      this._visibleLineCountTop.set(e, n),
      this._visibleLineCountBottom.set(t, n));
  }
}
function Xce(e, t, n, i) {}
function Qce(e, t, n, i) {}
class Jce extends PO {
  get visibility() {
    return this._visibility;
  }
  set visibility(e) {
    this._visibility !== e &&
      ((this._visibility = e), (this._diffActions.style.visibility = e ? "visible" : "hidden"));
  }
  constructor(e, t, n, i, r, o, s, a, l, c) {
    (super(),
      (this._getViewZoneId = e),
      (this._marginDomNode = t),
      (this._deletedCodeDomNode = n),
      (this._modifiedEditor = i),
      (this._diff = r),
      (this._editor = o),
      (this._renderLinesResult = s),
      (this._originalTextModel = a),
      (this._contextMenuService = l),
      (this._clipboardService = c),
      (this._visibility = !1),
      (this._marginDomNode.style.zIndex = "10"),
      (this._diffActions = document.createElement("div")),
      (this._diffActions.className = AV.asClassName(OV.lightBulb) + " lightbulb-glyph"),
      (this._diffActions.style.position = "absolute"));
    const d = this._modifiedEditor.getOption(75);
    ((this._diffActions.style.right = "0px"),
      (this._diffActions.style.visibility = "hidden"),
      (this._diffActions.style.height = `${d}px`),
      (this._diffActions.style.lineHeight = `${d}px`),
      this._marginDomNode.appendChild(this._diffActions));
    let u = 0;
    const h = i.getOption(144) && !WR,
      g = (e, t, n) => {
        this._contextMenuService.showContextMenu({
          domForShadowRoot: h ? (i.getDomNode() ?? void 0) : void 0,
          getAnchor: () => e,
          onHide: n,
          getActions: () => {
            const e = [],
              t = r.modified.isEmpty;
            (e.push(
              new SV(
                "diff.clipboard.copyDeletedContent",
                t
                  ? r.original.length > 1
                    ? SI(112, "Copy deleted lines")
                    : SI(113, "Copy deleted line")
                  : r.original.length > 1
                    ? SI(114, "Copy changed lines")
                    : SI(115, "Copy changed line"),
                void 0,
                !0,
                async () => {
                  const e = this._originalTextModel.getValueInRange(r.original.toExclusiveRange());
                  await this._clipboardService.writeText(e);
                },
              ),
            ),
              r.original.length > 1 &&
                e.push(
                  new SV(
                    "diff.clipboard.copyDeletedLineContent",
                    t
                      ? SI(116, "Copy deleted line ({0})", r.original.startLineNumber + u)
                      : SI(117, "Copy changed line ({0})", r.original.startLineNumber + u),
                    void 0,
                    !0,
                    async () => {
                      let e = this._originalTextModel.getLineContent(
                        r.original.startLineNumber + u,
                      );
                      if ("" === e) {
                        e = 0 === this._originalTextModel.getEndOfLineSequence() ? "\n" : "\r\n";
                      }
                      await this._clipboardService.writeText(e);
                    },
                  ),
                ));
            return (
              i.getOption(104) ||
                e.push(
                  new SV(
                    "diff.inline.revertChange",
                    SI(118, "Revert this change"),
                    void 0,
                    !0,
                    async () => {
                      this._editor.revert(this._diff);
                    },
                  ),
                ),
              e
            );
          },
          autoSelectFirstItem: !0,
        });
      };
    (this._register(
      KF(this._diffActions, "mousedown", (e) => {
        if (!e.leftButton) return;
        const { top: t, height: n } = aB(this._diffActions),
          i = Math.floor(d / 3);
        (e.preventDefault(), g({ x: e.posx, y: t + n + i }));
      }),
    ),
      this._register(
        i.onMouseMove((e) => {
          (8 !== e.target.type && 5 !== e.target.type) ||
          e.target.detail.viewZoneId !== this._getViewZoneId()
            ? (this.visibility = !1)
            : ((u = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, d)),
              (this.visibility = !0));
        }),
      ),
      this._register(
        (function (e) {
          const {
              domNode: t,
              renderLinesResult: n,
              diffEntry: i,
              originalModel: r,
              clipboardService: o,
            } = e,
            s = new AO();
          return (
            s.add(
              $F(t, "copy", (e) => {
                e.preventDefault();
                const s = t.ownerDocument.getSelection();
                if (!s || 0 === s.rangeCount) return;
                const a = s.getRangeAt(0);
                if (!a || a.collapsed) return;
                const l =
                    a.startContainer.nodeType === Node.TEXT_NODE
                      ? a.startContainer.parentElement
                      : a.startContainer,
                  c =
                    a.endContainer.nodeType === Node.TEXT_NODE
                      ? a.endContainer.parentElement
                      : a.endContainer;
                if (!l || !c) return;
                const d = n.getModelPositionAt(l, a.startOffset),
                  u = n.getModelPositionAt(c, a.endOffset);
                if (!d || !u) return;
                const h = d.delta(i.original.startLineNumber - 1),
                  g = u.delta(i.original.startLineNumber - 1),
                  p = g.isBefore(h) ? YH.fromPositions(g, h) : YH.fromPositions(h, g),
                  f = r.getValueInRange(p);
                o.writeText(f);
              }),
            ),
            s
          );
        })({
          domNode: this._deletedCodeDomNode,
          diffEntry: r,
          originalModel: this._originalTextModel,
          renderLinesResult: this._renderLinesResult,
          clipboardService: c,
        }),
      ));
  }
  _updateLightBulbPosition(e, t, n) {
    const { top: i } = aB(e),
      r = t - i,
      o = Math.floor(r / n),
      s = o * n;
    if (((this._diffActions.style.top = `${s}px`), this._renderLinesResult.viewLineCounts)) {
      let e = 0;
      for (let t = 0; t < this._renderLinesResult.viewLineCounts.length; t++)
        if (((e += this._renderLinesResult.viewLineCounts[t]), o < e)) return t;
    }
    return o;
  }
}
const ede = ZJ("diffEditorWidget", { createHTML: (e) => e });
function tde(e, t, n, i, r = !1) {
  Vq(i, t.fontInfo);
  const o = n.length > 0,
    s = new bU(1e4);
  let a = 0,
    l = 0;
  const c = [],
    d = [];
  for (let p = 0; p < e.lineTokens.length; p++) {
    const i = p + 1,
      u = e.lineTokens[p],
      h = e.lineBreakData[p],
      g = gQ.filter(n, i, 1, Number.MAX_SAFE_INTEGER);
    if (h) {
      let n = 0;
      for (const i of h.breakOffsets) {
        const c = sde(
          l,
          u.sliceAndInflate(n, i, 0),
          gQ.extractWrapped(g, n, i),
          o,
          e.mightContainNonBasicASCII,
          e.mightContainRTL,
          t,
          s,
          r,
        );
        ((a = Math.max(a, c.maxCharWidth)),
          d.push(new ode(c.output.characterMapping, c.output.containsForeignElements, n)),
          l++,
          (n = i));
      }
      c.push(h.breakOffsets.length);
    } else {
      c.push(1);
      const n = sde(l, u, g, o, e.mightContainNonBasicASCII, e.mightContainRTL, t, s, r);
      ((a = Math.max(a, n.maxCharWidth)),
        d.push(new ode(n.output.characterMapping, n.output.containsForeignElements, 0)),
        l++);
    }
  }
  a += t.scrollBeyondLastColumn;
  const u = s.build(),
    h = ede ? ede.createHTML(u) : u;
  i.innerHTML = h;
  const g = a * t.typicalHalfwidthCharacterWidth;
  return new rde(l, g, c, d, e);
}
class nde {
  constructor(e, t = e.map((e) => null), n = !0, i = !0) {
    ((this.lineTokens = e),
      (this.lineBreakData = t),
      (this.mightContainNonBasicASCII = n),
      (this.mightContainRTL = i));
  }
}
class ide {
  static fromEditor(e) {
    const t = e.getOptions(),
      n = t.get(59),
      i = t.get(165);
    return new ide(
      e.getModel()?.getOptions().tabSize || 0,
      n,
      t.get(40),
      n.typicalHalfwidthCharacterWidth,
      t.get(118),
      t.get(75),
      i.decorationsWidth,
      t.get(133),
      t.get(113),
      t.get(108),
      t.get(60),
      t.get(117).verticalScrollbarSize,
    );
  }
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h = !0) {
    ((this.tabSize = e),
      (this.fontInfo = t),
      (this.disableMonospaceOptimizations = n),
      (this.typicalHalfwidthCharacterWidth = i),
      (this.scrollBeyondLastColumn = r),
      (this.lineHeight = o),
      (this.lineDecorationsWidth = s),
      (this.stopRenderingLineAfter = a),
      (this.renderWhitespace = l),
      (this.renderControlCharacters = c),
      (this.fontLigatures = d),
      (this.verticalScrollbarSize = u),
      (this.setWidth = h));
  }
  withSetWidth(e) {
    return new ide(
      this.tabSize,
      this.fontInfo,
      this.disableMonospaceOptimizations,
      this.typicalHalfwidthCharacterWidth,
      this.scrollBeyondLastColumn,
      this.lineHeight,
      this.lineDecorationsWidth,
      this.stopRenderingLineAfter,
      this.renderWhitespace,
      this.renderControlCharacters,
      this.fontLigatures,
      this.verticalScrollbarSize,
      e,
    );
  }
  withScrollBeyondLastColumn(e) {
    return new ide(
      this.tabSize,
      this.fontInfo,
      this.disableMonospaceOptimizations,
      this.typicalHalfwidthCharacterWidth,
      e,
      this.lineHeight,
      this.lineDecorationsWidth,
      this.stopRenderingLineAfter,
      this.renderWhitespace,
      this.renderControlCharacters,
      this.fontLigatures,
      this.verticalScrollbarSize,
      this.setWidth,
    );
  }
}
class rde {
  constructor(e, t, n, i, r) {
    ((this.heightInLines = e),
      (this.minWidthInPx = t),
      (this.viewLineCounts = n),
      (this._renderOutputs = i),
      (this._source = r));
  }
  getModelPositionAt(e, t) {
    let n = e;
    for (; n && !n.classList.contains("view-line"); ) n = n.parentElement;
    if (!n) return;
    const i = n.parentElement;
    if (!i) return;
    const r = i.querySelectorAll(".view-line");
    let o = -1;
    for (let d = 0; d < r.length; d++)
      if (r[d] === n) {
        o = d;
        break;
      }
    if (-1 === o || o >= this._renderOutputs.length) return;
    let s = 1,
      a = o;
    for (let d = 0; d < this.viewLineCounts.length; d++) {
      if (a < this.viewLineCounts[d]) {
        s = d + 1;
        break;
      }
      a -= this.viewLineCounts[d];
    }
    if (s > this._source.lineTokens.length) return;
    const l = this._renderOutputs[o];
    if (!l) return;
    const c = WQ(l.characterMapping, e, t) + l.offset;
    return new xV(s, c);
  }
}
class ode extends xQ {
  constructor(e, t, n) {
    (super(e, t), (this.offset = n));
  }
}
function sde(e, t, n, i, r, o, s, a, l) {
  (a.appendString('<div class="view-line'),
    l || i || a.appendString(" char-delete"),
    a.appendString('" style="top:'),
    a.appendString(String(e * s.lineHeight)),
    s.setWidth ? a.appendString('px;width:1000000px;">') : a.appendString('px;">'));
  const c = t.getLineContent(),
    d = r4.isBasicASCII(c, r),
    u = r4.containsRTL(c, d, o),
    h = wQ(
      new vQ(
        s.fontInfo.isMonospace && !s.disableMonospaceOptimizations,
        s.fontInfo.canUseHalfwidthRightwardsArrow,
        c,
        !1,
        d,
        u,
        0,
        t,
        n,
        s.tabSize,
        0,
        s.fontInfo.spaceWidth,
        s.fontInfo.middotWidth,
        s.fontInfo.wsmiddotWidth,
        s.stopRenderingLineAfter,
        s.renderWhitespace,
        s.renderControlCharacters,
        s.fontLigatures !== xK.OFF,
        null,
        null,
        s.verticalScrollbarSize,
      ),
      a,
    );
  a.appendString("</div>");
  const g = h.characterMapping.getHorizontalOffset(h.characterMapping.length);
  return { output: h, maxCharWidth: g };
}
const ade = bV("clipboardService"),
  lde = bV("contextViewService"),
  cde = bV("contextMenuService");
var dde = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let ude = class extends PO {
  constructor(e, t, n, i, r, o, s, a, l, c) {
    (super(),
      (this._targetWindow = e),
      (this._editors = t),
      (this._diffModel = n),
      (this._options = i),
      (this._diffEditorWidget = r),
      (this._canIgnoreViewZoneUpdateEvent = o),
      (this._origViewZonesToIgnore = s),
      (this._modViewZonesToIgnore = a),
      (this._clipboardService = l),
      (this._contextMenuService = c),
      (this._originalTopPadding = LF(this, 0)),
      (this._originalScrollOffset = LF(this, 0)),
      (this._originalScrollOffsetAnimated = Nle(
        this._targetWindow,
        this._originalScrollOffset,
        this._store,
      )),
      (this._modifiedTopPadding = LF(this, 0)),
      (this._modifiedScrollOffset = LF(this, 0)),
      (this._modifiedScrollOffsetAnimated = Nle(
        this._targetWindow,
        this._modifiedScrollOffset,
        this._store,
      )));
    const d = LF("invalidateAlignmentsState", 0),
      u = this._register(
        new EM(() => {
          d.set(d.get() + 1, void 0);
        }, 0),
      );
    (this._register(
      this._editors.original.onDidChangeViewZones((e) => {
        this._canIgnoreViewZoneUpdateEvent() || u.schedule();
      }),
    ),
      this._register(
        this._editors.modified.onDidChangeViewZones((e) => {
          this._canIgnoreViewZoneUpdateEvent() || u.schedule();
        }),
      ),
      this._register(
        this._editors.original.onDidChangeConfiguration((e) => {
          (e.hasChanged(166) || e.hasChanged(75)) && u.schedule();
        }),
      ),
      this._register(
        this._editors.modified.onDidChangeConfiguration((e) => {
          (e.hasChanged(166) || e.hasChanged(75)) && u.schedule();
        }),
      ));
    const h = this._diffModel
        .map((e) =>
          e
            ? gF(
                this,
                e.model.original.onDidChangeTokens,
                () => 2 === e.model.original.tokenization.backgroundTokenizationState,
              )
            : void 0,
        )
        .map((e, t) => e?.read(t)),
      g = Xj((e) => {
        const t = this._diffModel.read(e),
          n = t?.diff.read(e);
        if (!t || !n) return null;
        d.read(e);
        const i = this._options.renderSideBySide.read(e);
        return hde(
          this._editors.original,
          this._editors.modified,
          n.mappings,
          this._origViewZonesToIgnore,
          this._modViewZonesToIgnore,
          i,
        );
      }),
      p = Xj((e) => {
        const t = this._diffModel.read(e)?.movedTextToCompare.read(e);
        if (!t) return null;
        d.read(e);
        const n = t.changes.map((e) => new Zce(e));
        return hde(
          this._editors.original,
          this._editors.modified,
          n,
          this._origViewZonesToIgnore,
          this._modViewZonesToIgnore,
          !0,
        );
      });
    function f() {
      const e = document.createElement("div");
      return ((e.className = "diagonal-fill"), e);
    }
    const m = this._register(new AO());
    this.viewZones = Xj(this, (e) => {
      m.clear();
      const t = g.read(e) || [],
        n = [],
        i = [],
        o = this._modifiedTopPadding.read(e);
      o > 0 &&
        i.push({
          afterLineNumber: 0,
          domNode: document.createElement("div"),
          heightInPx: o,
          showInHiddenAreas: !0,
          suppressMouseDown: !0,
        });
      const s = this._originalTopPadding.read(e);
      s > 0 &&
        n.push({
          afterLineNumber: 0,
          domNode: document.createElement("div"),
          heightInPx: s,
          showInHiddenAreas: !0,
          suppressMouseDown: !0,
        });
      const a = this._options.renderSideBySide.read(e),
        l = a ? void 0 : this._editors.modified._getViewModel()?.createLineBreaksComputer();
      if (l) {
        const x = this._editors.original.getModel();
        for (const w of t)
          if (w.diff)
            for (
              let C = w.originalRange.startLineNumber;
              C < w.originalRange.endLineNumberExclusive;
              C++
            ) {
              if (C > x.getLineCount()) return { orig: n, mod: i };
              l?.addRequest(x.getLineContent(C), null, null);
            }
      }
      const c = l?.finalize() ?? [];
      let d = 0;
      const u = this._editors.modified.getOption(75),
        _ = this._diffModel.read(e)?.movedTextToCompare.read(e),
        v = this._editors.original.getModel()?.mightContainNonBasicASCII() ?? !1,
        b = this._editors.original.getModel()?.mightContainRTL() ?? !1,
        y = ide.fromEditor(this._editors.modified);
      for (const S of t)
        if (!S.diff || a || (this._options.useTrueInlineDiffRendering.read(e) && pde(S.diff))) {
          const k = S.modifiedHeightInPx - S.originalHeightInPx;
          if (k > 0) {
            if (
              _?.lineRangeMapping.original
                .delta(-1)
                .deltaLength(2)
                .contains(S.originalRange.endLineNumberExclusive - 1)
            )
              continue;
            n.push({
              afterLineNumber: S.originalRange.endLineNumberExclusive - 1,
              domNode: f(),
              heightInPx: k,
              showInHiddenAreas: !0,
              suppressMouseDown: !0,
            });
          } else {
            if (
              _?.lineRangeMapping.modified
                .delta(-1)
                .deltaLength(2)
                .contains(S.modifiedRange.endLineNumberExclusive - 1)
            )
              continue;
            function E() {
              const t = document.createElement("div");
              return (
                (t.className = "arrow-revert-change " + AV.asClassName(OV.arrowRight)),
                e.store.add($F(t, "mousedown", (e) => e.stopPropagation())),
                e.store.add(
                  $F(t, "click", (e) => {
                    (e.stopPropagation(), r.revert(S.diff));
                  }),
                ),
                VB("div", {}, t)
              );
            }
            let N;
            (S.diff &&
              S.diff.modified.isEmpty &&
              this._options.shouldRenderOldRevertArrows.read(e) &&
              (N = E()),
              i.push({
                afterLineNumber: S.modifiedRange.endLineNumberExclusive - 1,
                domNode: f(),
                heightInPx: -k,
                marginDomNode: N,
                showInHiddenAreas: !0,
                suppressMouseDown: !0,
              }));
          }
        } else {
          if (!S.originalRange.isEmpty) {
            h.read(e);
            const D = document.createElement("div");
            D.classList.add(
              "view-lines",
              "line-delete",
              "line-delete-selectable",
              "monaco-mouse-cursor-text",
            );
            const T = this._editors.original.getModel();
            if (S.originalRange.endLineNumberExclusive - 1 > T.getLineCount())
              return { orig: n, mod: i };
            const I = new nde(
                S.originalRange.mapToLineArray((e) => T.tokenization.getLineTokens(e)),
                S.originalRange.mapToLineArray((e) => c[d++]),
                v,
                b,
              ),
              R = [];
            for (const P of S.diff.innerChanges || [])
              R.push(
                new Ite(
                  P.originalRange.delta(-(S.diff.original.startLineNumber - 1)),
                  Ece.className,
                  0,
                ),
              );
            const O = tde(I, y, R, D),
              M = document.createElement("div");
            if (
              ((M.className = "inline-deleted-margin-view-zone"),
              Vq(M, y.fontInfo),
              this._options.renderIndicators.read(e))
            )
              for (let j = 0; j < O.heightInLines; j++) {
                const F = document.createElement("div");
                ((F.className = `delete-sign ${AV.asClassName(vce)}`),
                  F.setAttribute(
                    "style",
                    `position:absolute;top:${j * u}px;width:${y.lineDecorationsWidth}px;height:${u}px;right:0;`,
                  ),
                  M.appendChild(F));
              }
            let A;
            m.add(
              new Jce(
                () => fR(A),
                M,
                D,
                this._editors.modified,
                S.diff,
                this._diffEditorWidget,
                O,
                this._editors.original.getModel(),
                this._contextMenuService,
                this._clipboardService,
              ),
            );
            for (let B = 0; B < O.viewLineCounts.length; B++) {
              const V = O.viewLineCounts[B];
              V > 1 &&
                n.push({
                  afterLineNumber: S.originalRange.startLineNumber + B,
                  domNode: f(),
                  heightInPx: (V - 1) * u,
                  showInHiddenAreas: !0,
                  suppressMouseDown: !0,
                });
            }
            i.push({
              afterLineNumber: S.modifiedRange.startLineNumber - 1,
              domNode: D,
              heightInPx: O.heightInLines * u,
              minWidthInPx: O.minWidthInPx,
              marginDomNode: M,
              setZoneId(e) {
                A = e;
              },
              showInHiddenAreas: !0,
              suppressMouseDown: !1,
            });
          }
          const L = document.createElement("div");
          ((L.className = "gutter-delete"),
            n.push({
              afterLineNumber: S.originalRange.endLineNumberExclusive - 1,
              domNode: f(),
              heightInPx: S.modifiedHeightInPx,
              marginDomNode: L,
              showInHiddenAreas: !0,
              suppressMouseDown: !0,
            }));
        }
      for (const W of p.read(e) ?? []) {
        if (
          !_?.lineRangeMapping.original.intersect(W.originalRange) ||
          !_?.lineRangeMapping.modified.intersect(W.modifiedRange)
        )
          continue;
        const H = W.modifiedHeightInPx - W.originalHeightInPx;
        H > 0
          ? n.push({
              afterLineNumber: W.originalRange.endLineNumberExclusive - 1,
              domNode: f(),
              heightInPx: H,
              showInHiddenAreas: !0,
              suppressMouseDown: !0,
            })
          : i.push({
              afterLineNumber: W.modifiedRange.endLineNumberExclusive - 1,
              domNode: f(),
              heightInPx: -H,
              showInHiddenAreas: !0,
              suppressMouseDown: !0,
            });
      }
      return { orig: n, mod: i };
    });
    let _ = !1;
    (this._register(
      this._editors.original.onDidScrollChange((e) => {
        e.scrollLeftChanged &&
          !_ &&
          ((_ = !0), this._editors.modified.setScrollLeft(e.scrollLeft), (_ = !1));
      }),
    ),
      this._register(
        this._editors.modified.onDidScrollChange((e) => {
          e.scrollLeftChanged &&
            !_ &&
            ((_ = !0), this._editors.original.setScrollLeft(e.scrollLeft), (_ = !1));
        }),
      ),
      (this._originalScrollTop = gF(this._editors.original.onDidScrollChange, () =>
        this._editors.original.getScrollTop(),
      )),
      (this._modifiedScrollTop = gF(this._editors.modified.onDidScrollChange, () =>
        this._editors.modified.getScrollTop(),
      )),
      this._register(
        rF((e) => {
          const t =
            this._originalScrollTop.read(e) -
            (this._originalScrollOffsetAnimated.read(void 0) -
              this._modifiedScrollOffsetAnimated.read(e)) -
            (this._originalTopPadding.read(void 0) - this._modifiedTopPadding.read(e));
          t !== this._editors.modified.getScrollTop() && this._editors.modified.setScrollTop(t, 1);
        }),
      ),
      this._register(
        rF((e) => {
          const t =
            this._modifiedScrollTop.read(e) -
            (this._modifiedScrollOffsetAnimated.read(void 0) -
              this._originalScrollOffsetAnimated.read(e)) -
            (this._modifiedTopPadding.read(void 0) - this._originalTopPadding.read(e));
          t !== this._editors.original.getScrollTop() && this._editors.original.setScrollTop(t, 1);
        }),
      ),
      this._register(
        rF((e) => {
          const t = this._diffModel.read(e)?.movedTextToCompare.read(e);
          let n = 0;
          if (t) {
            const e =
              this._editors.original.getTopForLineNumber(
                t.lineRangeMapping.original.startLineNumber,
                !0,
              ) - this._originalTopPadding.read(void 0);
            n =
              this._editors.modified.getTopForLineNumber(
                t.lineRangeMapping.modified.startLineNumber,
                !0,
              ) -
              this._modifiedTopPadding.read(void 0) -
              e;
          }
          (n > 0
            ? (this._modifiedTopPadding.set(0, void 0), this._originalTopPadding.set(n, void 0))
            : n < 0
              ? (this._modifiedTopPadding.set(-n, 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) - n,
                  void 0,
                  !0,
                )
              : this._modifiedScrollOffset.set(
                  this._originalScrollOffset.read(void 0) + n,
                  void 0,
                  !0,
                ));
        }),
      ));
  }
};
function hde(e, t, n, i, r, o) {
  const s = new Cj(gde(e, i)),
    a = new Cj(gde(t, r)),
    l = e.getOption(75),
    c = t.getOption(75),
    d = [];
  let u = 0,
    h = 0;
  function g(e, t) {
    for (;;) {
      let n = s.peek(),
        i = a.peek();
      if (
        (n && n.lineNumber >= e && (n = void 0), i && i.lineNumber >= t && (i = void 0), !n && !i)
      )
        break;
      const r = n ? n.lineNumber - u : Number.MAX_VALUE,
        o = i ? i.lineNumber - h : Number.MAX_VALUE;
      (r < o
        ? (s.dequeue(), (i = { lineNumber: n.lineNumber - u + h, heightInPx: 0 }))
        : r > o
          ? (a.dequeue(), (n = { lineNumber: i.lineNumber - h + u, heightInPx: 0 }))
          : (s.dequeue(), a.dequeue()),
        d.push({
          originalRange: Q5.ofLength(n.lineNumber, 1),
          modifiedRange: Q5.ofLength(i.lineNumber, 1),
          originalHeightInPx: l + n.heightInPx,
          modifiedHeightInPx: c + i.heightInPx,
          diff: void 0,
        }));
    }
  }
  for (const p of n) {
    const f = p.lineRangeMapping;
    g(f.original.startLineNumber, f.modified.startLineNumber);
    let m = !0,
      _ = f.modified.startLineNumber,
      v = f.original.startLineNumber;
    function b(e, t, n = !1) {
      if (e < v || t < _) return;
      if (m) m = !1;
      else if (!n && (e === v || t === _)) return;
      const i = new Q5(v, e),
        r = new Q5(_, t);
      if (i.isEmpty && r.isEmpty) return;
      const o = s.takeWhile((t) => t.lineNumber < e)?.reduce((e, t) => e + t.heightInPx, 0) ?? 0,
        u = a.takeWhile((e) => e.lineNumber < t)?.reduce((e, t) => e + t.heightInPx, 0) ?? 0;
      (d.push({
        originalRange: i,
        modifiedRange: r,
        originalHeightInPx: i.length * l + o,
        modifiedHeightInPx: r.length * c + u,
        diff: p.lineRangeMapping,
      }),
        (v = e),
        (_ = t));
    }
    if (o)
      for (const y of f.innerChanges || []) {
        y.originalRange.startColumn > 1 &&
          y.modifiedRange.startColumn > 1 &&
          b(y.originalRange.startLineNumber, y.modifiedRange.startLineNumber);
        const x = e.getModel(),
          w =
            y.originalRange.endLineNumber <= x.getLineCount()
              ? x.getLineMaxColumn(y.originalRange.endLineNumber)
              : Number.MAX_SAFE_INTEGER;
        y.originalRange.endColumn < w &&
          b(y.originalRange.endLineNumber, y.modifiedRange.endLineNumber);
      }
    (b(f.original.endLineNumberExclusive, f.modified.endLineNumberExclusive, !0),
      (u = f.original.endLineNumberExclusive),
      (h = f.modified.endLineNumberExclusive));
  }
  return (g(Number.MAX_VALUE, Number.MAX_VALUE), d);
}
function gde(e, t) {
  const n = [],
    i = [],
    r = -1 !== e.getOption(166).wrappingColumn,
    o = e._getViewModel().coordinatesConverter,
    s = e.getOption(75);
  if (r)
    for (let l = 1; l <= e.getModel().getLineCount(); l++) {
      const e = o.getModelLineViewLineCount(l);
      e > 1 && i.push({ lineNumber: l, heightInPx: s * (e - 1) });
    }
  for (const l of e.getWhitespaces()) {
    if (t.has(l.id)) continue;
    const e =
      0 === l.afterLineNumber
        ? 0
        : o.convertViewPositionToModelPosition(new xV(l.afterLineNumber, 1)).lineNumber;
    n.push({ lineNumber: e, heightInPx: l.height });
  }
  const a = (function (e, t, n, i) {
    if (0 === e.length) return t;
    if (0 === t.length) return e;
    const r = [];
    let o = 0,
      s = 0;
    for (; o < e.length && s < t.length; ) {
      const a = e[o],
        l = t[s],
        c = n(a),
        d = n(l);
      c < d ? (r.push(a), o++) : c > d ? (r.push(l), s++) : (r.push(i(a, l)), o++, s++);
    }
    for (; o < e.length; ) (r.push(e[o]), o++);
    for (; s < t.length; ) (r.push(t[s]), s++);
    return r;
  })(
    n,
    i,
    (e) => e.lineNumber,
    (e, t) => ({ lineNumber: e.lineNumber, heightInPx: e.heightInPx + t.heightInPx }),
  );
  return a;
}
function pde(e) {
  return (
    !!e.innerChanges &&
    e.innerChanges.every(
      (e) =>
        (fde(e.modifiedRange) && fde(e.originalRange)) ||
        e.originalRange.equalsRange(new YH(1, 1, 1, 1)),
    )
  );
}
function fde(e) {
  return e.startLineNumber === e.endLineNumber;
}
ude = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([dde(8, ade), dde(9, cde)], ude);
class mde extends PO {
  static {
    this.movedCodeBlockPadding = 4;
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this._rootElement = e),
      (this._diffModel = t),
      (this._originalEditorLayoutInfo = n),
      (this._modifiedEditorLayoutInfo = i),
      (this._editors = r),
      (this._originalScrollTop = gF(this, this._editors.original.onDidScrollChange, () =>
        this._editors.original.getScrollTop(),
      )),
      (this._modifiedScrollTop = gF(this, this._editors.modified.onDidScrollChange, () =>
        this._editors.modified.getScrollTop(),
      )),
      (this._viewZonesChanged = $ce(
        "onDidChangeViewZones",
        this._editors.modified.onDidChangeViewZones,
      )),
      (this.width = LF(this, 0)),
      (this._modifiedViewZonesChangedSignal = $ce(
        "modified.onDidChangeViewZones",
        this._editors.modified.onDidChangeViewZones,
      )),
      (this._originalViewZonesChangedSignal = $ce(
        "original.onDidChangeViewZones",
        this._editors.original.onDidChangeViewZones,
      )),
      (this._state = Xj(this, (e) => {
        this._element.replaceChildren();
        const t = this._diffModel.read(e),
          n = t?.diff.read(e)?.movedTexts;
        if (!n || 0 === n.length) return void this.width.set(0, void 0);
        this._viewZonesChanged.read(e);
        const i = this._originalEditorLayoutInfo.read(e),
          r = this._modifiedEditorLayoutInfo.read(e);
        if (!i || !r) return void this.width.set(0, void 0);
        (this._modifiedViewZonesChangedSignal.read(e),
          this._originalViewZonesChangedSignal.read(e));
        const o = n.map((t) => {
          function n(e, t) {
            return (
              (t.getTopForLineNumber(e.startLineNumber, !0) +
                t.getTopForLineNumber(e.endLineNumberExclusive, !0)) /
              2
            );
          }
          const i = n(t.lineRangeMapping.original, this._editors.original),
            r = this._originalScrollTop.read(e),
            o = n(t.lineRangeMapping.modified, this._editors.modified),
            s = i - r,
            a = o - this._modifiedScrollTop.read(e),
            l = Math.min(i, o),
            c = Math.max(i, o);
          return {
            range: new N$(l, c),
            from: s,
            to: a,
            fromWithoutScroll: i,
            toWithoutScroll: o,
            move: t,
          };
        });
        o.sort(
          (function (...e) {
            return (t, n) => {
              for (const i of e) {
                const e = i(t, n);
                if (!vj.isNeitherLessOrGreaterThan(e)) return e;
              }
              return vj.neitherLessOrGreaterThan;
            };
          })(
            bj((e) => e.fromWithoutScroll > e.toWithoutScroll, xj),
            bj(
              (e) =>
                e.fromWithoutScroll > e.toWithoutScroll ? e.fromWithoutScroll : -e.toWithoutScroll,
              yj,
            ),
          ),
        );
        const s = _de.compute(o.map((e) => e.range)),
          a = i.verticalScrollbarWidth,
          l = 10 * (s.getTrackCount() - 1) + 20,
          c = a + l + (r.contentLeft - mde.movedCodeBlockPadding);
        let d = 0;
        for (const u of o) {
          const n = a + 10 + 10 * s.getTrack(d),
            i = 15,
            o = 15,
            l = c,
            h = r.glyphMarginWidth + r.lineNumbersWidth,
            g = 18,
            p = document.createElementNS("http://www.w3.org/2000/svg", "rect");
          (p.classList.add("arrow-rectangle"),
            p.setAttribute("x", "" + (l - h)),
            p.setAttribute("y", "" + (u.to - g / 2)),
            p.setAttribute("width", `${h}`),
            p.setAttribute("height", `${g}`),
            this._element.appendChild(p));
          const f = document.createElementNS("http://www.w3.org/2000/svg", "g"),
            m = document.createElementNS("http://www.w3.org/2000/svg", "path");
          (m.setAttribute("d", `M 0 ${u.from} L ${n} ${u.from} L ${n} ${u.to} L ${l - o} ${u.to}`),
            m.setAttribute("fill", "none"),
            f.appendChild(m));
          const _ = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
          (_.classList.add("arrow"),
            e.store.add(
              rF((e) => {
                (m.classList.toggle("currentMove", u.move === t.activeMovedText.read(e)),
                  _.classList.toggle("currentMove", u.move === t.activeMovedText.read(e)));
              }),
            ),
            _.setAttribute(
              "points",
              `${l - o},${u.to - i / 2} ${l},${u.to} ${l - o},${u.to + i / 2}`,
            ),
            f.appendChild(_),
            this._element.appendChild(f),
            d++);
        }
        this.width.set(l, 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(MO(() => this._element.remove())),
      this._register(
        rF((e) => {
          const t = this._originalEditorLayoutInfo.read(e),
            n = this._modifiedEditorLayoutInfo.read(e);
          t &&
            n &&
            ((this._element.style.left = t.width - t.verticalScrollbarWidth + "px"),
            (this._element.style.height = `${t.height}px`),
            (this._element.style.width = `${t.verticalScrollbarWidth + t.contentLeft - mde.movedCodeBlockPadding + this.width.read(e)}px`));
        }),
      ),
      this._register(_F(this._state)));
    const o = Xj((e) => {
      const t = this._diffModel.read(e),
        n = t?.diff.read(e);
      return n
        ? n.movedTexts.map((e) => ({
            move: e,
            original: new Dle(xne(e.lineRangeMapping.original.startLineNumber - 1), 18),
            modified: new Dle(xne(e.lineRangeMapping.modified.startLineNumber - 1), 18),
          }))
        : [];
    });
    (this._register(
      Rle(
        this._editors.original,
        o.map((e) => e.map((e) => e.original)),
      ),
    ),
      this._register(
        Rle(
          this._editors.modified,
          o.map((e) => e.map((e) => e.modified)),
        ),
      ),
      this._register(
        aF((e, t) => {
          const n = o.read(e);
          for (const i of n)
            (t.add(
              new vde(
                this._editors.original,
                i.original,
                i.move,
                "original",
                this._diffModel.get(),
              ),
            ),
              t.add(
                new vde(
                  this._editors.modified,
                  i.modified,
                  i.move,
                  "modified",
                  this._diffModel.get(),
                ),
              ));
        }),
      ));
    const s = $ce("original.onDidFocusEditorWidget", (e) =>
        this._editors.original.onDidFocusEditorWidget(() => setTimeout(() => e(void 0), 0)),
      ),
      a = $ce("modified.onDidFocusEditorWidget", (e) =>
        this._editors.modified.onDidFocusEditorWidget(() => setTimeout(() => e(void 0), 0)),
      );
    let l = "modified";
    this._register(
      sF(
        {
          changeTracker: {
            createChangeSummary: () => {},
            handleChange: (e, t) => (
              e.didChange(s) && (l = "original"),
              e.didChange(a) && (l = "modified"),
              !0
            ),
          },
        },
        (e) => {
          (s.read(e), a.read(e));
          const t = this._diffModel.read(e);
          if (!t) return;
          const n = t.diff.read(e);
          let i;
          if (n && "original" === l) {
            const t = this._editors.originalCursor.read(e);
            t && (i = n.movedTexts.find((e) => e.lineRangeMapping.original.contains(t.lineNumber)));
          }
          if (n && "modified" === l) {
            const t = this._editors.modifiedCursor.read(e);
            t && (i = n.movedTexts.find((e) => e.lineRangeMapping.modified.contains(t.lineNumber)));
          }
          (i !== t.movedTextToCompare.read(void 0) && t.movedTextToCompare.set(void 0, void 0),
            t.setActiveMovedText(i));
        },
      ),
    );
  }
}
class _de {
  static compute(e) {
    const t = [],
      n = [];
    for (const i of e) {
      let e = t.findIndex((e) => !e.intersectsStrict(i));
      if (-1 === e) {
        const n = 6;
        t.length >= n
          ? (e = V1(
              t,
              bj((e) => e.intersectWithRangeLength(i), yj),
            ))
          : ((e = t.length), t.push(new L$()));
      }
      (t[e].addRange(i), n.push(e));
    }
    return new _de(t.length, n);
  }
  constructor(e, t) {
    ((this._trackCount = e), (this.trackPerLineIdx = t));
  }
  getTrack(e) {
    return this.trackPerLineIdx[e];
  }
  getTrackCount() {
    return this._trackCount;
  }
}
class vde extends Lle {
  constructor(e, t, n, i, r) {
    const o = GB("div.diff-hidden-lines-widget");
    (super(e, t, o.root),
      (this._editor = e),
      (this._move = n),
      (this._kind = i),
      (this._diffModel = r),
      (this._nodes = GB("div.diff-moved-code-block", { style: { marginRight: "4px" } }, [
        GB("div.text-content@textContent"),
        GB("div.action-bar@actionBar"),
      ])),
      o.root.appendChild(this._nodes.root));
    const s = gF(this._editor.onDidLayoutChange, () => this._editor.getLayoutInfo());
    let a;
    (this._register(
      Ile(this._nodes.root, { paddingRight: s.map((e) => e.verticalScrollbarWidth) }),
    ),
      (a =
        n.changes.length > 0
          ? "original" === this._kind
            ? SI(
                131,
                "Code moved with changes to line {0}-{1}",
                this._move.lineRangeMapping.modified.startLineNumber,
                this._move.lineRangeMapping.modified.endLineNumberExclusive - 1,
              )
            : SI(
                132,
                "Code moved with changes from line {0}-{1}",
                this._move.lineRangeMapping.original.startLineNumber,
                this._move.lineRangeMapping.original.endLineNumberExclusive - 1,
              )
          : "original" === this._kind
            ? SI(
                133,
                "Code moved to line {0}-{1}",
                this._move.lineRangeMapping.modified.startLineNumber,
                this._move.lineRangeMapping.modified.endLineNumberExclusive - 1,
              )
            : SI(
                134,
                "Code moved from line {0}-{1}",
                this._move.lineRangeMapping.original.startLineNumber,
                this._move.lineRangeMapping.original.endLineNumberExclusive - 1,
              )));
    const l = this._register(new Cle(this._nodes.actionBar, { highlightToggledItems: !0 })),
      c = new SV("", a, "", !1);
    l.push(c, { icon: !1, label: !0 });
    const d = new SV("", "Compare", AV.asClassName(OV.compareChanges), !0, () => {
      (this._editor.focus(),
        this._diffModel.movedTextToCompare.set(
          this._diffModel.movedTextToCompare.get() === n ? void 0 : this._move,
          void 0,
        ));
    });
    (this._register(
      rF((e) => {
        const t = this._diffModel.movedTextToCompare.read(e) === n;
        d.checked = t;
      }),
    ),
      l.push(d, { icon: !1, label: !0 }));
  }
}
class bde extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._editors = e),
      (this._diffModel = t),
      (this._options = n),
      (this._decorations = Xj(this, (e) => {
        const t = this._diffModel.read(e),
          n = t?.diff.read(e);
        if (!n) return null;
        const i = this._diffModel.read(e).movedTextToCompare.read(e),
          r = this._options.renderIndicators.read(e),
          o = this._options.showEmptyDecorations.read(e),
          s = [],
          a = [];
        if (!i)
          for (const c of n.mappings)
            if (
              (c.lineRangeMapping.original.isEmpty ||
                s.push({
                  range: c.lineRangeMapping.original.toInclusiveRange(),
                  options: r ? yce : wce,
                }),
              c.lineRangeMapping.modified.isEmpty ||
                a.push({
                  range: c.lineRangeMapping.modified.toInclusiveRange(),
                  options: r ? bce : xce,
                }),
              c.lineRangeMapping.modified.isEmpty || c.lineRangeMapping.original.isEmpty)
            )
              (c.lineRangeMapping.original.isEmpty ||
                s.push({ range: c.lineRangeMapping.original.toInclusiveRange(), options: Nce }),
                c.lineRangeMapping.modified.isEmpty ||
                  a.push({ range: c.lineRangeMapping.modified.toInclusiveRange(), options: Sce }));
            else {
              const n = this._options.useTrueInlineDiffRendering.read(e) && pde(c.lineRangeMapping);
              for (const e of c.lineRangeMapping.innerChanges || [])
                if (
                  (c.lineRangeMapping.original.contains(e.originalRange.startLineNumber) &&
                    s.push({
                      range: e.originalRange,
                      options: e.originalRange.isEmpty() && o ? Lce : Ece,
                    }),
                  c.lineRangeMapping.modified.contains(e.modifiedRange.startLineNumber) &&
                    a.push({
                      range: e.modifiedRange,
                      options: e.modifiedRange.isEmpty() && o && !n ? kce : Cce,
                    }),
                  n)
                ) {
                  const n = t.model.original.getValueInRange(e.originalRange);
                  a.push({
                    range: e.modifiedRange,
                    options: {
                      description: "deleted-text",
                      before: { content: n, inlineClassName: "inline-deleted-text" },
                      zIndex: 1e5,
                      showIfCollapsed: !0,
                    },
                  });
                }
            }
        if (i)
          for (const c of i.changes) {
            const e = c.original.toInclusiveRange();
            e && s.push({ range: e, options: r ? yce : wce });
            const t = c.modified.toInclusiveRange();
            t && a.push({ range: t, options: r ? bce : xce });
            for (const n of c.innerChanges || [])
              (s.push({ range: n.originalRange, options: Ece }),
                a.push({ range: n.modifiedRange, options: Cce }));
          }
        const l = this._diffModel.read(e).activeMovedText.read(e);
        for (const c of n.movedTexts)
          (s.push({
            range: c.lineRangeMapping.original.toInclusiveRange(),
            options: {
              description: "moved",
              blockClassName: "movedOriginal" + (c === l ? " currentMove" : ""),
              blockPadding: [
                mde.movedCodeBlockPadding,
                0,
                mde.movedCodeBlockPadding,
                mde.movedCodeBlockPadding,
              ],
            },
          }),
            a.push({
              range: c.lineRangeMapping.modified.toInclusiveRange(),
              options: {
                description: "moved",
                blockClassName: "movedModified" + (c === l ? " currentMove" : ""),
                blockPadding: [4, 0, 4, 4],
              },
            }));
        return { originalDecorations: s, modifiedDecorations: a };
      })),
      this._register(
        Sle(
          this._editors.original,
          this._decorations.map((e) => e?.originalDecorations || []),
        ),
      ),
      this._register(
        Sle(
          this._editors.modified,
          this._decorations.map((e) => e?.modifiedDecorations || []),
        ),
      ));
  }
}
class yde {
  static equals(e, t) {
    return e.x === t.x && e.y === t.y;
  }
  constructor(e, t) {
    ((this.x = e), (this.y = t));
  }
  add(e) {
    return new yde(this.x + e.x, this.y + e.y);
  }
  deltaX(e) {
    return new yde(this.x + e, this.y);
  }
  deltaY(e) {
    return new yde(this.x, this.y + e);
  }
  toString() {
    return `(${this.x},${this.y})`;
  }
  subtract(e) {
    return new yde(this.x - e.x, this.y - e.y);
  }
  scale(e) {
    return new yde(this.x * e, this.y * e);
  }
  mapComponents(e) {
    return new yde(e(this.x), e(this.y));
  }
  isZero() {
    return 0 === this.x && 0 === this.y;
  }
  withThreshold(e) {
    return this.mapComponents((t) => (t > e ? t - e : t < -e ? t + e : 0));
  }
}
function xde(e) {
  return wde.get(e);
}
class wde extends PO {
  static {
    this._map = new Map();
  }
  static get(e) {
    let t = wde._map.get(e);
    if (!t) {
      ((t = new wde(e)), wde._map.set(e, t));
      const n = e.onDidDispose(() => {
        const t = wde._map.get(e);
        t && (wde._map.delete(e), t.dispose(), n.dispose());
      });
    }
    return t;
  }
  _beginUpdate() {
    (this._updateCounter++,
      1 === this._updateCounter && (this._currentTransaction = new hF(() => {})));
  }
  _endUpdate() {
    if ((this._updateCounter--, 0 === this._updateCounter)) {
      const e = this._currentTransaction;
      ((this._currentTransaction = void 0), e.finish());
    }
  }
  constructor(e) {
    (super(),
      (this.editor = e),
      (this._updateCounter = 0),
      (this._currentTransaction = void 0),
      (this._model = LF(this, this.editor.getModel())),
      (this.model = this._model),
      (this.isReadonly = gF(this, this.editor.onDidChangeConfiguration, () =>
        this.editor.getOption(104),
      )),
      (this._versionId = F9(
        { owner: this, lazy: !0 },
        this.editor.getModel()?.getVersionId() ?? null,
      )),
      (this.versionId = this._versionId),
      (this._selections = F9(
        { owner: this, equalsFn: Mj(Oj(XH.selectionsEqual)), lazy: !0 },
        this.editor.getSelections() ?? null,
      )),
      (this.selections = this._selections),
      (this.positions = Jj(
        { owner: this, equalsFn: Mj(Oj(xV.equals)) },
        (e) => this.selections.read(e)?.map((e) => e.getStartPosition()) ?? null,
      )),
      (this.isFocused = gF(
        this,
        (e) => {
          const t = this.editor.onDidFocusEditorWidget(e),
            n = this.editor.onDidBlurEditorWidget(e);
          return {
            dispose() {
              (t.dispose(), n.dispose());
            },
          };
        },
        () => this.editor.hasWidgetFocus(),
      )),
      (this.isTextFocused = gF(
        this,
        (e) => {
          const t = this.editor.onDidFocusEditorText(e),
            n = this.editor.onDidBlurEditorText(e);
          return {
            dispose() {
              (t.dispose(), n.dispose());
            },
          };
        },
        () => this.editor.hasTextFocus(),
      )),
      (this.inComposition = gF(
        this,
        (e) => {
          const t = this.editor.onDidCompositionStart(() => {
              e(void 0);
            }),
            n = this.editor.onDidCompositionEnd(() => {
              e(void 0);
            });
          return {
            dispose() {
              (t.dispose(), n.dispose());
            },
          };
        },
        () => this.editor.inComposition,
      )),
      (this.value = Qj(
        this,
        (e) => (this.versionId.read(e), this.model.read(e)?.getValue() ?? ""),
        (e, t) => {
          const n = this.model.get();
          null !== n && e !== n.getValue() && n.setValue(e);
        },
      )),
      (this.valueIsEmpty = Xj(
        this,
        (e) => (this.versionId.read(e), 0 === this.editor.getModel()?.getValueLength()),
      )),
      (this.cursorSelection = Jj(
        { owner: this, equalsFn: Mj(XH.selectionsEqual) },
        (e) => this.selections.read(e)?.[0] ?? null,
      )),
      (this.cursorPosition = Jj(
        { owner: this, equalsFn: xV.equals },
        (e) => this.selections.read(e)?.[0]?.getPosition() ?? null,
      )),
      (this.cursorLineNumber = Xj(this, (e) => this.cursorPosition.read(e)?.lineNumber ?? null)),
      (this.onDidType = A9(this)),
      (this.onDidPaste = A9(this)),
      (this.scrollTop = gF(this.editor.onDidScrollChange, () => this.editor.getScrollTop())),
      (this.scrollLeft = gF(this.editor.onDidScrollChange, () => this.editor.getScrollLeft())),
      (this.layoutInfo = gF(this.editor.onDidLayoutChange, () => this.editor.getLayoutInfo())),
      (this.layoutInfoContentLeft = this.layoutInfo.map((e) => e.contentLeft)),
      (this.layoutInfoDecorationsLeft = this.layoutInfo.map((e) => e.decorationsLeft)),
      (this.layoutInfoWidth = this.layoutInfo.map((e) => e.width)),
      (this.layoutInfoHeight = this.layoutInfo.map((e) => e.height)),
      (this.layoutInfoMinimap = this.layoutInfo.map((e) => e.minimap)),
      (this.layoutInfoVerticalScrollbarWidth = this.layoutInfo.map(
        (e) => e.verticalScrollbarWidth,
      )),
      (this.contentWidth = gF(this.editor.onDidContentSizeChange, () =>
        this.editor.getContentWidth(),
      )),
      (this.contentHeight = gF(this.editor.onDidContentSizeChange, () =>
        this.editor.getContentHeight(),
      )),
      (this._widgetCounter = 0),
      (this.openedPeekWidgets = LF(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((e) => {
          this._beginUpdate();
          try {
            (this._forceUpdate(), this.onDidType.trigger(this._currentTransaction, e));
          } finally {
            this._endUpdate();
          }
        }),
      ),
      this._register(
        this.editor.onDidPaste((e) => {
          this._beginUpdate();
          try {
            (this._forceUpdate(), this.onDidPaste.trigger(this._currentTransaction, e));
          } finally {
            this._endUpdate();
          }
        }),
      ),
      this._register(
        this.editor.onDidChangeModelContent((e) => {
          this._beginUpdate();
          try {
            (this._versionId.set(
              this.editor.getModel()?.getVersionId() ?? null,
              this._currentTransaction,
              e,
            ),
              this._forceUpdate());
          } finally {
            this._endUpdate();
          }
        }),
      ),
      this._register(
        this.editor.onDidChangeCursorSelection((e) => {
          this._beginUpdate();
          try {
            (this._selections.set(this.editor.getSelections(), this._currentTransaction, e),
              this._forceUpdate());
          } finally {
            this._endUpdate();
          }
        }),
      ),
      (this.domNode = Xj((e) => (this.model.read(e), this.editor.getDomNode()))));
  }
  forceUpdate(e) {
    this._beginUpdate();
    try {
      if ((this._forceUpdate(), !e)) return;
      return e(this._currentTransaction);
    } 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(e, t = Tj.ofCaller()) {
    return gF(
      this,
      (t) =>
        this.editor.onDidChangeConfiguration((n) => {
          n.hasChanged(e) && t(void 0);
        }),
      () => this.editor.getOption(e),
      t,
    );
  }
  setDecorations(e) {
    const t = new AO(),
      n = this.editor.createDecorationsCollection();
    return (
      t.add(
        oF({ owner: this, debugName: () => `Apply decorations from ${e.debugName}` }, (t) => {
          const i = e.read(t);
          n.set(i);
        }),
      ),
      t.add({
        dispose: () => {
          n.clear();
        },
      }),
      t
    );
  }
  createOverlayWidget(e) {
    const t = "observableOverlayWidget" + this._widgetCounter++,
      n = {
        getDomNode: () => e.domNode,
        getPosition: () => e.position.get(),
        getId: () => t,
        allowEditorOverflow: e.allowEditorOverflow,
        getMinContentWidthInPx: () => e.minContentWidthInPx.get(),
      };
    this.editor.addOverlayWidget(n);
    const i = rF((t) => {
      (e.position.read(t), e.minContentWidthInPx.read(t), this.editor.layoutOverlayWidget(n));
    });
    return MO(() => {
      (i.dispose(), this.editor.removeOverlayWidget(n));
    });
  }
  createContentWidget(e) {
    const t = "observableContentWidget" + this._widgetCounter++,
      n = {
        getDomNode: () => e.domNode,
        getPosition: () => e.position.get(),
        getId: () => t,
        allowEditorOverflow: e.allowEditorOverflow,
      };
    this.editor.addContentWidget(n);
    const i = rF((t) => {
      (e.position.read(t), this.editor.layoutContentWidget(n));
    });
    return MO(() => {
      (i.dispose(), this.editor.removeContentWidget(n));
    });
  }
  observeLineOffsetRange(e, t) {
    const n = this.observePosition(
        e.map((e) => new xV(e.startLineNumber, 1)),
        t,
      ),
      i = this.observePosition(
        e.map((e) => new xV(e.endLineNumberExclusive + 1, 1)),
        t,
      );
    return Xj((t) => {
      (n.read(t), i.read(t));
      const r = e.read(t),
        o = this.model.read(t)?.getLineCount(),
        s =
          (void 0 !== o && r.startLineNumber > o
            ? this.editor.getBottomForLineNumber(o)
            : this.editor.getTopForLineNumber(r.startLineNumber)) - this.scrollTop.read(t),
        a = r.isEmpty
          ? s
          : this.editor.getBottomForLineNumber(r.endLineNumberExclusive - 1) -
            this.scrollTop.read(t);
      return new N$(s, a);
    });
  }
  observePosition(e, t) {
    let n = e.get();
    const i = F9(
        {
          owner: this,
          debugName: () => `topLeftOfPosition${n?.toString()}`,
          equalsFn: Mj(yde.equals),
        },
        new yde(0, 0),
      ),
      r = "observablePositionWidget" + this._widgetCounter++,
      o = document.createElement("div"),
      s = {
        getDomNode: () => o,
        getPosition: () => (n ? { preference: [0], position: e.get() } : null),
        getId: () => r,
        allowEditorOverflow: !1,
        afterRender: (e, t) => {
          const r = this._model.get();
          r && n && n.lineNumber > r.getLineCount()
            ? i.set(
                new yde(
                  0,
                  this.editor.getBottomForLineNumber(r.getLineCount()) - this.scrollTop.get(),
                ),
                void 0,
              )
            : i.set(t ? new yde(t.left, t.top) : null, void 0);
        },
      };
    return (
      this.editor.addContentWidget(s),
      t.add(
        rF((t) => {
          ((n = e.read(t)), this.editor.layoutContentWidget(s));
        }),
      ),
      t.add(
        MO(() => {
          this.editor.removeContentWidget(s);
        }),
      ),
      i
    );
  }
  isTargetHovered(e, t) {
    const n = LF("isInjectedTextHovered", !1);
    return (
      t.add(
        this.editor.onMouseMove((t) => {
          const i = e(t);
          n.set(i, void 0);
        }),
      ),
      t.add(
        this.editor.onMouseLeave((e) => {
          n.set(!1, void 0);
        }),
      ),
      n
    );
  }
  observeLineHeightForPosition(e) {
    return Xj((t) => {
      const n = e instanceof xV ? e : e.read(t);
      return null === n
        ? null
        : (this.getOption(75).read(t), this.editor.getLineHeightForPosition(n));
    });
  }
  observeLineHeightForLine(e) {
    return "number" == typeof e
      ? this.observeLineHeightForPosition(new xV(e, 1))
      : Xj((t) => {
          const n = e.read(t);
          return null === n ? null : this.observeLineHeightForPosition(new xV(n, 1)).read(t);
        });
  }
  observeLineHeightsForLineRange(e) {
    return Xj((t) => {
      const n = e instanceof Q5 ? e : e.read(t),
        i = [];
      for (let e = n.startLineNumber; e < n.endLineNumberExclusive; e++)
        i.push(this.observeLineHeightForLine(e).read(t));
      return i;
    });
  }
}
var Cde;
let Sde = class extends PO {
  static {
    Cde = this;
  }
  static {
    this.ONE_OVERVIEW_WIDTH = 15;
  }
  static {
    this.ENTIRE_DIFF_OVERVIEW_WIDTH = 2 * this.ONE_OVERVIEW_WIDTH;
  }
  constructor(e, t, n, i, r, o, s) {
    (super(),
      (this._editors = e),
      (this._rootElement = t),
      (this._diffModel = n),
      (this._rootWidth = i),
      (this._rootHeight = r),
      (this._modifiedEditorLayoutInfo = o),
      (this._themeService = s),
      (this.width = Cde.ENTIRE_DIFF_OVERVIEW_WIDTH));
    const a = gF(this._themeService.onDidColorThemeChange, () =>
        this._themeService.getColorTheme(),
      ),
      l = Xj((e) => {
        const t = a.read(e);
        return {
          insertColor: t.getColor(RZ) || (t.getColor(DZ) || NZ).transparent(2),
          removeColor: t.getColor(OZ) || (t.getColor(TZ) || LZ).transparent(2),
        };
      }),
      c = Bq(document.createElement("div"));
    (c.setClassName("diffViewport"), c.setPosition("absolute"));
    const d = GB("div.diffOverview", {
      style: { position: "absolute", top: "0px", width: Cde.ENTIRE_DIFF_OVERVIEW_WIDTH + "px" },
    }).root;
    (this._register(kle(d, c.domNode)),
      this._register(
        KF(d, DB.POINTER_DOWN, (e) => {
          this._editors.modified.delegateVerticalScrollbarPointerDown(e);
        }),
      ),
      this._register(
        $F(
          d,
          DB.MOUSE_WHEEL,
          (e) => {
            this._editors.modified.delegateScrollFromMouseWheelEvent(e);
          },
          { passive: !1 },
        ),
      ),
      this._register(kle(this._rootElement, d)),
      this._register(
        aF((e, t) => {
          const n = this._diffModel.read(e),
            i = this._editors.original.createOverviewRuler("original diffOverviewRuler");
          i && (t.add(i), t.add(kle(d, i.getDomNode())));
          const r = this._editors.modified.createOverviewRuler("modified diffOverviewRuler");
          if ((r && (t.add(r), t.add(kle(d, r.getDomNode()))), !i || !r)) return;
          const o = $ce("viewZoneChanged", this._editors.original.onDidChangeViewZones),
            s = $ce("viewZoneChanged", this._editors.modified.onDidChangeViewZones),
            a = $ce("hiddenRangesChanged", this._editors.original.onDidChangeHiddenAreas),
            u = $ce("hiddenRangesChanged", this._editors.modified.onDidChangeHiddenAreas);
          (t.add(
            rF((e) => {
              (o.read(e), s.read(e), a.read(e), u.read(e));
              const t = l.read(e),
                c = n?.diff.read(e)?.mappings;
              function d(e, t, n) {
                const i = n._getViewModel();
                return i
                  ? e
                      .filter((e) => e.length > 0)
                      .map((e) => {
                        const n = i.coordinatesConverter.convertModelPositionToViewPosition(
                            new xV(e.startLineNumber, 1),
                          ),
                          r = i.coordinatesConverter.convertModelPositionToViewPosition(
                            new xV(e.endLineNumberExclusive, 1),
                          ),
                          o = r.lineNumber - n.lineNumber;
                        return new c4(n.lineNumber, r.lineNumber, o, t.toString());
                      })
                  : [];
              }
              const h = d(
                  (c || []).map((e) => e.lineRangeMapping.original),
                  t.removeColor,
                  this._editors.original,
                ),
                g = d(
                  (c || []).map((e) => e.lineRangeMapping.modified),
                  t.insertColor,
                  this._editors.modified,
                );
              (i?.setZones(h), r?.setZones(g));
            }),
          ),
            t.add(
              rF((e) => {
                const t = this._rootHeight.read(e),
                  n = this._rootWidth.read(e),
                  o = this._modifiedEditorLayoutInfo.read(e);
                if (o) {
                  const n = Cde.ENTIRE_DIFF_OVERVIEW_WIDTH - 2 * Cde.ONE_OVERVIEW_WIDTH;
                  (i.setLayout({
                    top: 0,
                    height: t,
                    right: n + Cde.ONE_OVERVIEW_WIDTH,
                    width: Cde.ONE_OVERVIEW_WIDTH,
                  }),
                    r.setLayout({ top: 0, height: t, right: 0, width: Cde.ONE_OVERVIEW_WIDTH }));
                  const s = this._editors.modifiedScrollTop.read(e),
                    a = this._editors.modifiedScrollHeight.read(e),
                    l = this._editors.modified.getOption(117),
                    d = new cJ(
                      l.verticalHasArrows ? l.arrowSize : 0,
                      l.verticalScrollbarSize,
                      0,
                      o.height,
                      a,
                      s,
                    );
                  (c.setTop(d.getSliderPosition()), c.setHeight(d.getSliderSize()));
                } else (c.setTop(0), c.setHeight(0));
                ((d.style.height = t + "px"),
                  (d.style.left = n - Cde.ENTIRE_DIFF_OVERVIEW_WIDTH + "px"),
                  c.setWidth(Cde.ENTIRE_DIFF_OVERVIEW_WIDTH));
              }),
            ));
        }),
      ));
  }
};
Sde = Cde = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(6, h0),
  ],
  Sde,
);
var kde = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let Ede = class extends PO {
  get onDidContentSizeChange() {
    return this._onDidContentSizeChange.event;
  }
  constructor(e, t, n, i, r, o, s, a) {
    (super(),
      (this.originalEditorElement = e),
      (this.modifiedEditorElement = t),
      (this._options = n),
      (this._argCodeEditorWidgetOptions = i),
      (this._createInnerEditor = r),
      (this._contextKeyService = o),
      (this._instantiationService = s),
      (this._keybindingService = a),
      (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 QO())),
      (this.modifiedScrollTop = gF(this, this.modified.onDidScrollChange, () =>
        this.modified.getScrollTop(),
      )),
      (this.modifiedScrollHeight = gF(this, this.modified.onDidScrollChange, () =>
        this.modified.getScrollHeight(),
      )),
      (this.modifiedObs = xde(this.modified)),
      (this.originalObs = xde(this.original)),
      (this.modifiedModel = this.modifiedObs.model),
      (this.modifiedSelections = gF(
        this,
        this.modified.onDidChangeCursorSelection,
        () => this.modified.getSelections() ?? [],
      )),
      (this.modifiedCursor = Jj(
        { owner: this, equalsFn: xV.equals },
        (e) => this.modifiedSelections.read(e)[0]?.getPosition() ?? new xV(1, 1),
      )),
      (this.originalCursor = gF(
        this,
        this.original.onDidChangeCursorPosition,
        () => this.original.getPosition() ?? new xV(1, 1),
      )),
      (this.isOriginalFocused = xde(this.original).isFocused),
      (this.isModifiedFocused = xde(this.modified).isFocused),
      (this.isFocused = Xj(
        this,
        (e) => this.isOriginalFocused.read(e) || this.isModifiedFocused.read(e),
      )),
      (this._argCodeEditorWidgetOptions = null),
      this._register(
        sF(
          {
            changeTracker: {
              createChangeSummary: () => ({}),
              handleChange: (e, t) => (
                e.didChange(n.editorOptions) && Object.assign(t, e.change.changedOptions),
                !0
              ),
            },
          },
          (e, t) => {
            (n.editorOptions.read(e),
              this._options.renderSideBySide.read(e),
              this.modified.updateOptions(this._adjustOptionsForRightHandSide(e, t)),
              this.original.updateOptions(this._adjustOptionsForLeftHandSide(e, t)));
          },
        ),
      ));
  }
  _createLeftHandSideEditor(e, t) {
    const n = this._adjustOptionsForLeftHandSide(void 0, e),
      i = this._constructInnerEditor(this._instantiationService, this.originalEditorElement, n, t),
      r = this._contextKeyService.createKey("isInDiffLeftEditor", i.hasWidgetFocus());
    return (
      this._register(i.onDidFocusEditorWidget(() => r.set(!0))),
      this._register(i.onDidBlurEditorWidget(() => r.set(!1))),
      i
    );
  }
  _createRightHandSideEditor(e, t) {
    const n = this._adjustOptionsForRightHandSide(void 0, e),
      i = this._constructInnerEditor(this._instantiationService, this.modifiedEditorElement, n, t),
      r = this._contextKeyService.createKey("isInDiffRightEditor", i.hasWidgetFocus());
    return (
      this._register(i.onDidFocusEditorWidget(() => r.set(!0))),
      this._register(i.onDidBlurEditorWidget(() => r.set(!1))),
      i
    );
  }
  _constructInnerEditor(e, t, n, i) {
    const r = this._createInnerEditor(e, t, n, i);
    return (
      this._register(
        r.onDidContentSizeChange((e) => {
          const t =
              this.original.getContentWidth() +
              this.modified.getContentWidth() +
              Sde.ENTIRE_DIFF_OVERVIEW_WIDTH,
            n = Math.max(this.modified.getContentHeight(), this.original.getContentHeight());
          this._onDidContentSizeChange.fire({
            contentHeight: n,
            contentWidth: t,
            contentHeightChanged: e.contentHeightChanged,
            contentWidthChanged: e.contentWidthChanged,
          });
        }),
      ),
      r
    );
  }
  _adjustOptionsForLeftHandSide(e, t) {
    const n = this._adjustOptionsForSubEditor(t);
    return (
      this._options.renderSideBySide.get()
        ? ((n.unicodeHighlight = this._options.editorOptions.get().unicodeHighlight || {}),
          (n.wordWrapOverride1 = this._options.diffWordWrap.get()))
        : ((n.wordWrapOverride1 = "off"),
          (n.wordWrapOverride2 = "off"),
          (n.stickyScroll = { enabled: !1 }),
          (n.unicodeHighlight = {
            nonBasicASCII: !1,
            ambiguousCharacters: !1,
            invisibleCharacters: !1,
          })),
      (n.glyphMargin = this._options.renderSideBySide.get()),
      t.originalAriaLabel && (n.ariaLabel = t.originalAriaLabel),
      (n.ariaLabel = this._updateAriaLabel(n.ariaLabel)),
      (n.readOnly = !this._options.originalEditable.get()),
      (n.dropIntoEditor = { enabled: !n.readOnly }),
      (n.extraEditorClassName = "original-in-monaco-diff-editor"),
      n
    );
  }
  _adjustOptionsForRightHandSide(e, t) {
    const n = this._adjustOptionsForSubEditor(t);
    return (
      t.modifiedAriaLabel && (n.ariaLabel = t.modifiedAriaLabel),
      (n.ariaLabel = this._updateAriaLabel(n.ariaLabel)),
      (n.wordWrapOverride1 = this._options.diffWordWrap.get()),
      (n.revealHorizontalRightPadding =
        BK.revealHorizontalRightPadding.defaultValue + Sde.ENTIRE_DIFF_OVERVIEW_WIDTH),
      (n.scrollbar.verticalHasArrows = !1),
      (n.extraEditorClassName = "modified-in-monaco-diff-editor"),
      n
    );
  }
  _adjustOptionsForSubEditor(e) {
    const t = { ...e, dimension: { height: 0, width: 0 } };
    return (
      (t.inDiffEditor = !0),
      (t.automaticLayout = !1),
      (t.allowVariableLineHeights = !1),
      (t.allowVariableFonts = !1),
      (t.allowVariableFontsInAccessibilityMode = !1),
      (t.scrollbar = { ...(t.scrollbar || {}) }),
      (t.folding = !1),
      (t.codeLens = this._options.diffCodeLens.get()),
      (t.fixedOverflowWidgets = !0),
      (t.minimap = { ...(t.minimap || {}) }),
      (t.minimap.enabled = !1),
      this._options.hideUnchangedRegions.get()
        ? (t.stickyScroll = { enabled: !1 })
        : (t.stickyScroll = this._options.editorOptions.get().stickyScroll),
      t
    );
  }
  _updateAriaLabel(e) {
    e || (e = "");
    const t = SI(
      111,
      " use {0} to open the accessibility help.",
      this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel(),
    );
    return this._options.accessibilityVerbose.get() ? e + t : e ? e.replaceAll(t, "") : "";
  }
};
Ede = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([kde(5, xW), kde(6, vV), kde(7, N5)], Ede);
var Nde = function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
};
var Lde;
!(function (e) {
  ((e.North = "north"), (e.South = "south"), (e.East = "east"), (e.West = "west"));
})(Lde || (Lde = {}));
const Dde = new QO();
const Tde = new QO();
class Ide {
  constructor(e) {
    ((this.el = e), (this.disposables = new AO()));
  }
  get onPointerMove() {
    return this.disposables.add(new RJ(MF(this.el), "mousemove")).event;
  }
  get onPointerUp() {
    return this.disposables.add(new RJ(MF(this.el), "mouseup")).event;
  }
  dispose() {
    this.disposables.dispose();
  }
}
(Nde([tJ], Ide.prototype, "onPointerMove", null), Nde([tJ], Ide.prototype, "onPointerUp", null));
class Rde {
  get onPointerMove() {
    return this.disposables.add(new RJ(this.el, nJ.Change)).event;
  }
  get onPointerUp() {
    return this.disposables.add(new RJ(this.el, nJ.End)).event;
  }
  constructor(e) {
    ((this.el = e), (this.disposables = new AO()));
  }
  dispose() {
    this.disposables.dispose();
  }
}
(Nde([tJ], Rde.prototype, "onPointerMove", null), Nde([tJ], Rde.prototype, "onPointerUp", null));
class Ode {
  get onPointerMove() {
    return this.factory.onPointerMove;
  }
  get onPointerUp() {
    return this.factory.onPointerUp;
  }
  constructor(e) {
    this.factory = e;
  }
  dispose() {}
}
(Nde([tJ], Ode.prototype, "onPointerMove", null), Nde([tJ], Ode.prototype, "onPointerUp", null));
const Mde = "pointer-events-disabled";
class Ade extends PO {
  get state() {
    return this._state;
  }
  get orthogonalStartSash() {
    return this._orthogonalStartSash;
  }
  get orthogonalEndSash() {
    return this._orthogonalEndSash;
  }
  set state(e) {
    this._state !== e &&
      (this.el.classList.toggle("disabled", 0 === e),
      this.el.classList.toggle("minimum", 1 === e),
      this.el.classList.toggle("maximum", 2 === e),
      (this._state = e),
      this.onDidEnablementChange.fire(e));
  }
  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(e) {
    if (this._orthogonalStartSash !== e) {
      if (
        (this.orthogonalStartDragHandleDisposables.clear(),
        this.orthogonalStartSashDisposables.clear(),
        e)
      ) {
        const t = (t) => {
          (this.orthogonalStartDragHandleDisposables.clear(),
            0 !== t &&
              ((this._orthogonalStartDragHandle = MB(this.el, VB(".orthogonal-drag-handle.start"))),
              this.orthogonalStartDragHandleDisposables.add(
                MO(() => this._orthogonalStartDragHandle.remove()),
              ),
              this.orthogonalStartDragHandleDisposables.add(
                $F(this._orthogonalStartDragHandle, "mouseenter", () => Ade.onMouseEnter(e)),
              ),
              this.orthogonalStartDragHandleDisposables.add(
                $F(this._orthogonalStartDragHandle, "mouseleave", () => Ade.onMouseLeave(e)),
              )));
        };
        (this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t, this)),
          t(e.state));
      }
      this._orthogonalStartSash = e;
    }
  }
  set orthogonalEndSash(e) {
    if (this._orthogonalEndSash !== e) {
      if (
        (this.orthogonalEndDragHandleDisposables.clear(),
        this.orthogonalEndSashDisposables.clear(),
        e)
      ) {
        const t = (t) => {
          (this.orthogonalEndDragHandleDisposables.clear(),
            0 !== t &&
              ((this._orthogonalEndDragHandle = MB(this.el, VB(".orthogonal-drag-handle.end"))),
              this.orthogonalEndDragHandleDisposables.add(
                MO(() => this._orthogonalEndDragHandle.remove()),
              ),
              this.orthogonalEndDragHandleDisposables.add(
                $F(this._orthogonalEndDragHandle, "mouseenter", () => Ade.onMouseEnter(e)),
              ),
              this.orthogonalEndDragHandleDisposables.add(
                $F(this._orthogonalEndDragHandle, "mouseleave", () => Ade.onMouseLeave(e)),
              )));
        };
        (this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t, this)), t(e.state));
      }
      this._orthogonalEndSash = e;
    }
  }
  constructor(e, t, n) {
    let i;
    (super(),
      (this.hoverDelay = 300),
      (this.hoverDelayer = this._register(new mM(this.hoverDelay))),
      (this._state = 3),
      (this.onDidEnablementChange = this._register(new QO())),
      (this._onDidStart = this._register(new QO())),
      (this._onDidChange = this._register(new QO())),
      (this._onDidReset = this._register(new QO())),
      (this._onDidEnd = this._register(new QO())),
      (this.orthogonalStartSashDisposables = this._register(new AO())),
      (this.orthogonalStartDragHandleDisposables = this._register(new AO())),
      (this.orthogonalEndSashDisposables = this._register(new AO())),
      (this.orthogonalEndDragHandleDisposables = this._register(new AO())),
      (this.linkedSash = void 0),
      (this.el = MB(e, VB(".monaco-sash"))),
      n.orthogonalEdge && this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),
      PR && this.el.classList.add("mac"),
      this._register($F(this.el, "mousedown", (t) => this.onPointerStart(t, new Ide(e)))),
      this._register($F(this.el, "dblclick", (e) => this.onPointerDoublePress(e))),
      this._register($F(this.el, "mouseenter", () => Ade.onMouseEnter(this))),
      this._register($F(this.el, "mouseleave", () => Ade.onMouseLeave(this))),
      this._register(iJ.addTarget(this.el)),
      this._register($F(this.el, nJ.Start, (e) => this.onPointerStart(e, new Rde(this.el)))),
      this._register(
        $F(this.el, nJ.Tap, (e) => {
          if (i) return (clearTimeout(i), (i = void 0), void this.onPointerDoublePress(e));
          (clearTimeout(i), (i = setTimeout(() => (i = void 0), 250)));
        }),
      ),
      "number" == typeof n.size
        ? ((this.size = n.size),
          0 === n.orientation
            ? (this.el.style.width = `${this.size}px`)
            : (this.el.style.height = `${this.size}px`))
        : ((this.size = 4),
          this._register(
            Dde.event((e) => {
              ((this.size = e), this.layout());
            }),
          )),
      this._register(Tde.event((e) => (this.hoverDelay = e))),
      (this.layoutProvider = t),
      (this.orthogonalStartSash = n.orthogonalStartSash),
      (this.orthogonalEndSash = n.orthogonalEndSash),
      (this.orientation = n.orientation || 0),
      1 === this.orientation
        ? (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", false),
      this.layout());
  }
  onPointerStart(e, t) {
    IB(e);
    let n = !1;
    if (!e.__orthogonalSashEvent) {
      const i = this.getOrthogonalSash(e);
      i && ((n = !0), (e.__orthogonalSashEvent = !0), i.onPointerStart(e, new Ode(t)));
    }
    if (
      (this.linkedSash &&
        !e.__linkedSashEvent &&
        ((e.__linkedSashEvent = !0), this.linkedSash.onPointerStart(e, new Ode(t))),
      !this.state)
    )
      return;
    const i = this.el.ownerDocument.getElementsByTagName("iframe");
    for (const u of i) u.classList.add(Mde);
    const r = e.pageX,
      o = e.pageY,
      s = e.altKey,
      a = { startX: r, currentX: r, startY: o, currentY: o, altKey: s };
    (this.el.classList.add("active"), this._onDidStart.fire(a));
    const l = rG(this.el),
      c = () => {
        let e = "";
        ((e = n
          ? "all-scroll"
          : 1 === this.orientation
            ? 1 === this.state
              ? "s-resize"
              : 2 === this.state
                ? "n-resize"
                : PR
                  ? "row-resize"
                  : "ns-resize"
            : 1 === this.state
              ? "e-resize"
              : 2 === this.state
                ? "w-resize"
                : PR
                  ? "col-resize"
                  : "ew-resize"),
          (l.textContent = `* { cursor: ${e} !important; }`));
      },
      d = new AO();
    (c(), n || this.onDidEnablementChange.event(c, null, d));
    (t.onPointerMove(
      (e) => {
        IB(e, !1);
        const t = { startX: r, currentX: e.pageX, startY: o, currentY: e.pageY, altKey: s };
        this._onDidChange.fire(t);
      },
      null,
      d,
    ),
      t.onPointerUp(
        (e) => {
          (IB(e, !1),
            l.remove(),
            this.el.classList.remove("active"),
            this._onDidEnd.fire(),
            d.dispose());
          for (const t of i) t.classList.remove(Mde);
        },
        null,
        d,
      ),
      d.add(t));
  }
  onPointerDoublePress(e) {
    const t = this.getOrthogonalSash(e);
    (t && t._onDidReset.fire(),
      this.linkedSash && this.linkedSash._onDidReset.fire(),
      this._onDidReset.fire());
  }
  static onMouseEnter(e, t = !1) {
    (e.el.classList.contains("active")
      ? (e.hoverDelayer.cancel(), e.el.classList.add("hover"))
      : e.hoverDelayer
          .trigger(() => e.el.classList.add("hover"), e.hoverDelay)
          .then(void 0, () => {}),
      !t && e.linkedSash && Ade.onMouseEnter(e.linkedSash, !0));
  }
  static onMouseLeave(e, t = !1) {
    (e.hoverDelayer.cancel(),
      e.el.classList.remove("hover"),
      !t && e.linkedSash && Ade.onMouseLeave(e.linkedSash, !0));
  }
  clearSashHoverState() {
    Ade.onMouseLeave(this);
  }
  layout() {
    if (0 === this.orientation) {
      const e = this.layoutProvider;
      ((this.el.style.left = e.getVerticalSashLeft(this) - this.size / 2 + "px"),
        e.getVerticalSashTop && (this.el.style.top = e.getVerticalSashTop(this) + "px"),
        e.getVerticalSashHeight && (this.el.style.height = e.getVerticalSashHeight(this) + "px"));
    } else {
      const e = this.layoutProvider;
      ((this.el.style.top = e.getHorizontalSashTop(this) - this.size / 2 + "px"),
        e.getHorizontalSashLeft && (this.el.style.left = e.getHorizontalSashLeft(this) + "px"),
        e.getHorizontalSashWidth && (this.el.style.width = e.getHorizontalSashWidth(this) + "px"));
    }
  }
  getOrthogonalSash(e) {
    const t = e.initialTarget ?? e.target;
    if (t && SB(t))
      return t.classList.contains("orthogonal-drag-handle")
        ? t.classList.contains("start")
          ? this.orthogonalStartSash
          : this.orthogonalEndSash
        : void 0;
  }
  dispose() {
    (super.dispose(), this.el.remove());
  }
}
class Pde {
  resetSash() {
    this._sashRatio.set(void 0, void 0);
  }
  constructor(e, t) {
    ((this._options = e),
      (this.dimensions = t),
      (this.sashLeft = Qj(
        this,
        (e) => {
          const t = this._sashRatio.read(e) ?? this._options.splitViewDefaultRatio.read(e);
          return this._computeSashLeft(t, e);
        },
        (e, t) => {
          const n = this.dimensions.width.get();
          this._sashRatio.set(e / n, t);
        },
      )),
      (this._sashRatio = LF(this, void 0)));
  }
  _computeSashLeft(e, t) {
    const n = this.dimensions.width.read(t),
      i = Math.floor(this._options.splitViewDefaultRatio.read(t) * n),
      r = this._options.enableSplitViewResizing.read(t) ? Math.floor(e * n) : i,
      o = 100;
    return n <= 200 ? i : r < o ? o : r > n - o ? n - o : r;
  }
}
class jde extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._domNode = e),
      (this._dimensions = t),
      (this._enabled = n),
      (this._boundarySashes = i),
      (this.sashLeft = r),
      (this._resetSash = o),
      (this._sash = this._register(
        new Ade(
          this._domNode,
          {
            getVerticalSashTop: (e) => 0,
            getVerticalSashLeft: (e) => this.sashLeft.get(),
            getVerticalSashHeight: (e) => 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((e) => {
          this.sashLeft.set(this._startSashPosition + (e.currentX - e.startX), void 0);
        }),
      ),
      this._register(this._sash.onDidEnd(() => this._sash.layout())),
      this._register(this._sash.onDidReset(() => this._resetSash())),
      this._register(
        rF((e) => {
          const t = this._boundarySashes.read(e);
          t && (this._sash.orthogonalEndSash = t.bottom);
        }),
      ),
      this._register(
        rF((e) => {
          const t = this._enabled.read(e);
          ((this._sash.state = t ? 3 : 0),
            this.sashLeft.read(e),
            this._dimensions.height.read(e),
            this._sash.layout());
        }),
      ));
  }
}
class Fde extends PO {
  constructor() {
    (super(...arguments),
      (this._id = ++Fde.idCounter),
      (this._onDidDispose = this._register(new QO())),
      (this.onDidDispose = this._onDidDispose.event));
  }
  static {
    this.idCounter = 0;
  }
  getId() {
    return this.getEditorType() + ":v2:" + this._id;
  }
  getVisibleColumnFromPosition(e) {
    return this._targetEditor.getVisibleColumnFromPosition(e);
  }
  getPosition() {
    return this._targetEditor.getPosition();
  }
  setPosition(e, t = "api") {
    this._targetEditor.setPosition(e, t);
  }
  revealLine(e, t = 0) {
    this._targetEditor.revealLine(e, t);
  }
  revealLineInCenter(e, t = 0) {
    this._targetEditor.revealLineInCenter(e, t);
  }
  revealLineInCenterIfOutsideViewport(e, t = 0) {
    this._targetEditor.revealLineInCenterIfOutsideViewport(e, t);
  }
  revealLineNearTop(e, t = 0) {
    this._targetEditor.revealLineNearTop(e, t);
  }
  revealPosition(e, t = 0) {
    this._targetEditor.revealPosition(e, t);
  }
  revealPositionInCenter(e, t = 0) {
    this._targetEditor.revealPositionInCenter(e, t);
  }
  revealPositionInCenterIfOutsideViewport(e, t = 0) {
    this._targetEditor.revealPositionInCenterIfOutsideViewport(e, t);
  }
  revealPositionNearTop(e, t = 0) {
    this._targetEditor.revealPositionNearTop(e, t);
  }
  getSelection() {
    return this._targetEditor.getSelection();
  }
  getSelections() {
    return this._targetEditor.getSelections();
  }
  setSelection(e, t = "api") {
    this._targetEditor.setSelection(e, t);
  }
  setSelections(e, t = "api") {
    this._targetEditor.setSelections(e, t);
  }
  revealLines(e, t, n = 0) {
    this._targetEditor.revealLines(e, t, n);
  }
  revealLinesInCenter(e, t, n = 0) {
    this._targetEditor.revealLinesInCenter(e, t, n);
  }
  revealLinesInCenterIfOutsideViewport(e, t, n = 0) {
    this._targetEditor.revealLinesInCenterIfOutsideViewport(e, t, n);
  }
  revealLinesNearTop(e, t, n = 0) {
    this._targetEditor.revealLinesNearTop(e, t, n);
  }
  revealRange(e, t = 0, n = !1, i = !0) {
    this._targetEditor.revealRange(e, t, n, i);
  }
  revealRangeInCenter(e, t = 0) {
    this._targetEditor.revealRangeInCenter(e, t);
  }
  revealRangeInCenterIfOutsideViewport(e, t = 0) {
    this._targetEditor.revealRangeInCenterIfOutsideViewport(e, t);
  }
  revealRangeNearTop(e, t = 0) {
    this._targetEditor.revealRangeNearTop(e, t);
  }
  revealRangeNearTopIfOutsideViewport(e, t = 0) {
    this._targetEditor.revealRangeNearTopIfOutsideViewport(e, t);
  }
  revealRangeAtTop(e, t = 0) {
    this._targetEditor.revealRangeAtTop(e, t);
  }
  getSupportedActions() {
    return this._targetEditor.getSupportedActions();
  }
  focus() {
    this._targetEditor.focus();
  }
  trigger(e, t, n) {
    this._targetEditor.trigger(e, t, n);
  }
  createDecorationsCollection(e) {
    return this._targetEditor.createDecorationsCollection(e);
  }
  changeDecorations(e) {
    return this._targetEditor.changeDecorations(e);
  }
}
const Bde = {
  enableSplitViewResizing: !0,
  renderSideBySide: !0,
  renderMarginRevertIcon: !0,
  renderGutterMenu: !0,
  maxComputationTime: 5e3,
  maxFileSize: 50,
  ignoreTrimWhitespace: !0,
  renderIndicators: !0,
  originalEditable: !1,
  diffCodeLens: !1,
  renderOverviewRuler: !0,
  diffWordWrap: "inherit",
  diffAlgorithm: "advanced",
  accessibilityVerbose: !1,
  experimental: { showMoves: !1, showEmptyDecorations: !0, useTrueInlineView: !1 },
  hideUnchangedRegions: {
    enabled: !1,
    contextLineCount: 3,
    minimumLineCount: 3,
    revealLineCount: 20,
  },
  isInEmbeddedEditor: !1,
  onlyShowAccessibleDiffViewer: !1,
  renderSideBySideInlineBreakpoint: 900,
  useInlineViewWhenSpaceIsLimited: !0,
  compactMode: !1,
};
let Vde = class {
  get editorOptions() {
    return this._options;
  }
  constructor(e, t) {
    ((this._accessibilityService = t),
      (this._diffEditorWidth = LF(this, 0)),
      (this._screenReaderMode = gF(
        this,
        this._accessibilityService.onDidChangeScreenReaderOptimized,
        () => this._accessibilityService.isScreenReaderOptimized(),
      )),
      (this.couldShowInlineViewBecauseOfSize = Xj(
        this,
        (e) =>
          this._options.read(e).renderSideBySide &&
          this._diffEditorWidth.read(e) <= this._options.read(e).renderSideBySideInlineBreakpoint,
      )),
      (this.renderOverviewRuler = Xj(this, (e) => this._options.read(e).renderOverviewRuler)),
      (this.renderSideBySide = Xj(
        this,
        (e) =>
          (!this.compactMode.read(e) || !this.shouldRenderInlineViewInSmartMode.read(e)) &&
          this._options.read(e).renderSideBySide &&
          !(
            this._options.read(e).useInlineViewWhenSpaceIsLimited &&
            this.couldShowInlineViewBecauseOfSize.read(e) &&
            !this._screenReaderMode.read(e)
          ),
      )),
      (this.readOnly = Xj(this, (e) => this._options.read(e).readOnly)),
      (this.shouldRenderOldRevertArrows = Xj(
        this,
        (e) =>
          !!this._options.read(e).renderMarginRevertIcon &&
          !!this.renderSideBySide.read(e) &&
          !this.readOnly.read(e) &&
          !this.shouldRenderGutterMenu.read(e),
      )),
      (this.shouldRenderGutterMenu = Xj(this, (e) => this._options.read(e).renderGutterMenu)),
      (this.renderIndicators = Xj(this, (e) => this._options.read(e).renderIndicators)),
      (this.enableSplitViewResizing = Xj(
        this,
        (e) => this._options.read(e).enableSplitViewResizing,
      )),
      (this.splitViewDefaultRatio = Xj(this, (e) => this._options.read(e).splitViewDefaultRatio)),
      (this.ignoreTrimWhitespace = Xj(this, (e) => this._options.read(e).ignoreTrimWhitespace)),
      (this.maxComputationTimeMs = Xj(this, (e) => this._options.read(e).maxComputationTime)),
      (this.showMoves = Xj(
        this,
        (e) => this._options.read(e).experimental.showMoves && this.renderSideBySide.read(e),
      )),
      (this.isInEmbeddedEditor = Xj(this, (e) => this._options.read(e).isInEmbeddedEditor)),
      (this.diffWordWrap = Xj(this, (e) => this._options.read(e).diffWordWrap)),
      (this.originalEditable = Xj(this, (e) => this._options.read(e).originalEditable)),
      (this.diffCodeLens = Xj(this, (e) => this._options.read(e).diffCodeLens)),
      (this.accessibilityVerbose = Xj(this, (e) => this._options.read(e).accessibilityVerbose)),
      (this.diffAlgorithm = Xj(this, (e) => this._options.read(e).diffAlgorithm)),
      (this.showEmptyDecorations = Xj(
        this,
        (e) => this._options.read(e).experimental.showEmptyDecorations,
      )),
      (this.onlyShowAccessibleDiffViewer = Xj(
        this,
        (e) => this._options.read(e).onlyShowAccessibleDiffViewer,
      )),
      (this.compactMode = Xj(this, (e) => this._options.read(e).compactMode)),
      (this.trueInlineDiffRenderingEnabled = Xj(
        this,
        (e) => this._options.read(e).experimental.useTrueInlineView,
      )),
      (this.useTrueInlineDiffRendering = Xj(
        this,
        (e) => !this.renderSideBySide.read(e) && this.trueInlineDiffRenderingEnabled.read(e),
      )),
      (this.hideUnchangedRegions = Xj(
        this,
        (e) => this._options.read(e).hideUnchangedRegions.enabled,
      )),
      (this.hideUnchangedRegionsRevealLineCount = Xj(
        this,
        (e) => this._options.read(e).hideUnchangedRegions.revealLineCount,
      )),
      (this.hideUnchangedRegionsContextLineCount = Xj(
        this,
        (e) => this._options.read(e).hideUnchangedRegions.contextLineCount,
      )),
      (this.hideUnchangedRegionsMinimumLineCount = Xj(
        this,
        (e) => this._options.read(e).hideUnchangedRegions.minimumLineCount,
      )),
      (this._model = LF(this, void 0)),
      (this.shouldRenderInlineViewInSmartMode = this._model
        .map(this, (e) =>
          (function (e, t) {
            return bF(e, (e, n) => n ?? t(e));
          })(this, (t) => {
            const n = e?.diff.read(t);
            return n
              ? ((i = n),
                (r = this.trueInlineDiffRenderingEnabled.read(t)),
                i.mappings.every(
                  (e) =>
                    0 === e.lineRangeMapping.original.length ||
                    (function (e) {
                      return 0 === e.modified.length;
                    })(e.lineRangeMapping) ||
                    (r && pde(e.lineRangeMapping)),
                ))
              : void 0;
            var i, r;
          }),
        )
        .flatten()
        .map(this, (e) => !!e)),
      (this.inlineViewHideOriginalLineNumbers = this.compactMode));
    const n = { ...e, ...Wde(e, Bde) };
    this._options = LF(this, n);
  }
  updateOptions(e) {
    const t = Wde(e, this._options.get()),
      n = { ...this._options.get(), ...e, ...t };
    this._options.set(n, void 0, { changedOptions: e });
  }
  setWidth(e) {
    this._diffEditorWidth.set(e, void 0);
  }
  setModel(e) {
    this._model.set(e, void 0);
  }
};
function Wde(e, t) {
  return {
    enableSplitViewResizing: lK(e.enableSplitViewResizing, t.enableSplitViewResizing),
    splitViewDefaultRatio: hK(e.splitViewDefaultRatio, 0.5, 0.1, 0.9),
    renderSideBySide: lK(e.renderSideBySide, t.renderSideBySide),
    renderMarginRevertIcon: lK(e.renderMarginRevertIcon, t.renderMarginRevertIcon),
    maxComputationTime: dK(e.maxComputationTime, t.maxComputationTime, 0, 1073741824),
    maxFileSize: dK(e.maxFileSize, t.maxFileSize, 0, 1073741824),
    ignoreTrimWhitespace: lK(e.ignoreTrimWhitespace, t.ignoreTrimWhitespace),
    renderIndicators: lK(e.renderIndicators, t.renderIndicators),
    originalEditable: lK(e.originalEditable, t.originalEditable),
    diffCodeLens: lK(e.diffCodeLens, t.diffCodeLens),
    renderOverviewRuler: lK(e.renderOverviewRuler, t.renderOverviewRuler),
    diffWordWrap: fK(e.diffWordWrap, t.diffWordWrap, ["off", "on", "inherit"]),
    diffAlgorithm: fK(e.diffAlgorithm, t.diffAlgorithm, ["legacy", "advanced"], {
      smart: "legacy",
      experimental: "advanced",
    }),
    accessibilityVerbose: lK(e.accessibilityVerbose, t.accessibilityVerbose),
    experimental: {
      showMoves: lK(e.experimental?.showMoves, t.experimental.showMoves),
      showEmptyDecorations: lK(
        e.experimental?.showEmptyDecorations,
        t.experimental.showEmptyDecorations,
      ),
      useTrueInlineView: lK(e.experimental?.useTrueInlineView, t.experimental.useTrueInlineView),
    },
    hideUnchangedRegions: {
      enabled: lK(
        e.hideUnchangedRegions?.enabled ?? e.experimental?.collapseUnchangedRegions,
        t.hideUnchangedRegions.enabled,
      ),
      contextLineCount: dK(
        e.hideUnchangedRegions?.contextLineCount,
        t.hideUnchangedRegions.contextLineCount,
        0,
        1073741824,
      ),
      minimumLineCount: dK(
        e.hideUnchangedRegions?.minimumLineCount,
        t.hideUnchangedRegions.minimumLineCount,
        0,
        1073741824,
      ),
      revealLineCount: dK(
        e.hideUnchangedRegions?.revealLineCount,
        t.hideUnchangedRegions.revealLineCount,
        0,
        1073741824,
      ),
    },
    isInEmbeddedEditor: lK(e.isInEmbeddedEditor, t.isInEmbeddedEditor),
    onlyShowAccessibleDiffViewer: lK(
      e.onlyShowAccessibleDiffViewer,
      t.onlyShowAccessibleDiffViewer,
    ),
    renderSideBySideInlineBreakpoint: dK(
      e.renderSideBySideInlineBreakpoint,
      t.renderSideBySideInlineBreakpoint,
      0,
      1073741824,
    ),
    useInlineViewWhenSpaceIsLimited: lK(
      e.useInlineViewWhenSpaceIsLimited,
      t.useInlineViewWhenSpaceIsLimited,
    ),
    renderGutterMenu: lK(e.renderGutterMenu, t.renderGutterMenu),
    compactMode: lK(e.compactMode, t.compactMode),
  };
}
Vde = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, KK),
  ],
  Vde,
);
class Hde extends kV {
  constructor(e, t) {
    (super(),
      (this._onDidChangeVisibility = this._register(new QO())),
      (this.onDidChangeVisibility = this._onDidChangeVisibility.event),
      (this._element = MB(e, VB(".monaco-dropdown"))),
      (this._label = MB(this._element, VB(".dropdown-label"))));
    let n = t.labelRenderer;
    n || (n = (e) => ((e.textContent = t.label || ""), null));
    for (const r of [DB.CLICK, DB.MOUSE_DOWN, nJ.Tap])
      this._register($F(this.element, r, (e) => IB(e, !0)));
    for (const r of [DB.MOUSE_DOWN, nJ.Tap])
      this._register(
        $F(this._label, r, (e) => {
          (NB(e) && 0 !== e.button) || (this.visible ? this.hide() : this.show());
        }),
      );
    this._register(
      $F(this._label, DB.KEY_DOWN, (e) => {
        const t = new wO(e);
        (t.equals(3) || t.equals(10)) && (IB(e, !0), this.visible ? this.hide() : this.show());
      }),
    );
    const i = n(this._label);
    (i && this._register(i), this._register(iJ.addTarget(this._label)));
  }
  get element() {
    return this._element;
  }
  show() {
    this.visible || ((this.visible = !0), this._onDidChangeVisibility.fire(!0));
  }
  hide() {
    this.visible && ((this.visible = !1), this._onDidChangeVisibility.fire(!1));
  }
  dispose() {
    (super.dispose(),
      this.hide(),
      this.boxContainer && (this.boxContainer.remove(), (this.boxContainer = void 0)),
      this.contents && (this.contents.remove(), (this.contents = void 0)),
      this._label && (this._label.remove(), (this._label = void 0)));
  }
}
let zde = class extends Hde {
  constructor(e, t) {
    (super(e, t), (this._options = t), (this._actions = []), (this.actions = t.actions || []));
  }
  set menuOptions(e) {
    this._menuOptions = e;
  }
  get menuOptions() {
    return this._menuOptions;
  }
  get actions() {
    return this._options.actionProvider ? this._options.actionProvider.getActions() : this._actions;
  }
  set actions(e) {
    this._actions = e;
  }
  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: (e, t) =>
          this.menuOptions && this.menuOptions.actionViewItemProvider
            ? this.menuOptions.actionViewItemProvider(e, t)
            : void 0,
        getKeyBinding: (e) =>
          this.menuOptions && this.menuOptions.getKeyBinding
            ? this.menuOptions.getKeyBinding(e)
            : 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"));
  }
};
class Ude extends yle {
  get onDidChangeVisibility() {
    return this._onDidChangeVisibility.event;
  }
  constructor(e, t, n, i = Object.create(null)) {
    (super(null, e, i),
      (this.actionItem = null),
      (this._onDidChangeVisibility = this._register(new QO())),
      (this.menuActionsOrProvider = t),
      (this.contextMenuProvider = n),
      (this.options = i),
      this.options.actionRunner && (this.actionRunner = this.options.actionRunner));
  }
  render(e) {
    this.actionItem = e;
    const t = Array.isArray(this.menuActionsOrProvider),
      n = {
        contextMenuProvider: this.contextMenuProvider,
        labelRenderer: (e) => (
          (this.element = MB(e, VB("a.action-label"))),
          this.renderLabel(this.element)
        ),
        menuAsChild: this.options.menuAsChild,
        actions: t ? this.menuActionsOrProvider : void 0,
        actionProvider: t ? void 0 : this.menuActionsOrProvider,
        skipTelemetry: this.options.skipTelemetry,
      };
    if (
      ((this.dropdownMenu = this._register(new zde(e, n))),
      this._register(
        this.dropdownMenu.onDidChangeVisibility((e) => {
          (this.element?.setAttribute("aria-expanded", `${e}`),
            this._onDidChangeVisibility.fire(e));
        }),
      ),
      (this.dropdownMenu.menuOptions = {
        actionViewItemProvider: this.options.actionViewItemProvider,
        actionRunner: this.actionRunner,
        getKeyBinding: this.options.keybindingProvider,
        context: this._context,
      }),
      this.options.anchorAlignmentProvider)
    ) {
      const e = this;
      this.dropdownMenu.menuOptions = {
        ...this.dropdownMenu.menuOptions,
        get anchorAlignment() {
          return e.options.anchorAlignmentProvider();
        },
      };
    }
    (this.updateTooltip(), this.updateEnabled());
  }
  renderLabel(e) {
    let t = [];
    return (
      "string" == typeof this.options.classNames
        ? (t = this.options.classNames.split(/\s+/g).filter((e) => !!e))
        : this.options.classNames && (t = this.options.classNames),
      t.find((e) => "icon" === e) || t.push("codicon"),
      e.classList.add(...t),
      this._action.label &&
        this._register(
          yae().setupManagedHover(
            this.options.hoverDelegate ?? Bne("mouse"),
            e,
            this._action.label,
          ),
        ),
      null
    );
  }
  getTooltip() {
    let e = null;
    return (
      this.action.tooltip
        ? (e = this.action.tooltip)
        : this.action.label && (e = this.action.label),
      e ?? void 0
    );
  }
  setActionContext(e) {
    (super.setActionContext(e),
      this.dropdownMenu &&
        (this.dropdownMenu.menuOptions
          ? (this.dropdownMenu.menuOptions.context = e)
          : (this.dropdownMenu.menuOptions = { context: e })));
  }
  show() {
    this.dropdownMenu?.show();
  }
  updateEnabled() {
    const e = !this.action.enabled;
    (this.actionItem?.classList.toggle("disabled", e),
      this.element?.classList.toggle("disabled", e));
  }
}
let $de = class extends PO {
  get onDidChangeDropdownVisibility() {
    return this._onDidChangeDropdownVisibility.event;
  }
  constructor(e, t, n = { orientation: 0 }) {
    if (
      (super(),
      (this.submenuActionViewItems = []),
      (this.hasSecondaryActions = !1),
      (this._onDidChangeDropdownVisibility = this._register(new iM())),
      (this.originalPrimaryActions = []),
      (this.originalSecondaryActions = []),
      (this.hiddenActions = []),
      (this.disposables = this._register(new AO())),
      (n.hoverDelegate = n.hoverDelegate ?? this._register(Vne())),
      (this.options = n),
      (this.toggleMenuAction = this._register(
        new qde(() => this.toggleMenuActionViewItem?.show(), n.toggleMenuTitle),
      )),
      (this.element = document.createElement("div")),
      (this.element.className = "monaco-toolbar"),
      e.appendChild(this.element),
      (this.actionBar = this._register(
        new Cle(this.element, {
          orientation: n.orientation,
          ariaLabel: n.ariaLabel,
          actionRunner: n.actionRunner,
          allowContextMenu: n.allowContextMenu,
          highlightToggledItems: n.highlightToggledItems,
          hoverDelegate: n.hoverDelegate,
          actionViewItemProvider: (e, i) => {
            if (e.id === qde.ID)
              return (
                (this.toggleMenuActionViewItem = new Ude(
                  e,
                  { getActions: () => this.toggleMenuAction.menuActions },
                  t,
                  {
                    actionViewItemProvider: this.options.actionViewItemProvider,
                    actionRunner: this.actionRunner,
                    keybindingProvider: this.options.getKeyBinding,
                    classNames: AV.asClassNameArray(n.moreIcon ?? OV.toolBarMore),
                    anchorAlignmentProvider: this.options.anchorAlignmentProvider,
                    menuAsChild: !!this.options.renderDropdownAsChildElement,
                    skipTelemetry: this.options.skipTelemetry,
                    isMenu: !0,
                    hoverDelegate: this.options.hoverDelegate,
                  },
                )),
                this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),
                this.disposables.add(
                  this._onDidChangeDropdownVisibility.add(
                    this.toggleMenuActionViewItem.onDidChangeVisibility,
                  ),
                ),
                this.toggleMenuActionViewItem
              );
            if (n.actionViewItemProvider) {
              const t = n.actionViewItemProvider(e, i);
              if (t) return t;
            }
            if (e instanceof NV) {
              const n = new Ude(e, e.actions, t, {
                actionViewItemProvider: this.options.actionViewItemProvider,
                actionRunner: this.actionRunner,
                keybindingProvider: this.options.getKeyBinding,
                classNames: e.class,
                anchorAlignmentProvider: this.options.anchorAlignmentProvider,
                menuAsChild: !!this.options.renderDropdownAsChildElement,
                skipTelemetry: this.options.skipTelemetry,
                hoverDelegate: this.options.hoverDelegate,
              });
              return (
                n.setActionContext(this.actionBar.context),
                this.submenuActionViewItems.push(n),
                this.disposables.add(
                  this._onDidChangeDropdownVisibility.add(n.onDidChangeVisibility),
                ),
                n
              );
            }
          },
        }),
      )),
      this.options.responsive)
    ) {
      this.element.classList.add("responsive");
      const e = new ResizeObserver(() => {
        this.setToolbarMaxWidth(this.element.getBoundingClientRect().width);
      });
      (e.observe(this.element), this._store.add(MO(() => e.disconnect())));
    }
  }
  set actionRunner(e) {
    this.actionBar.actionRunner = e;
  }
  get actionRunner() {
    return this.actionBar.actionRunner;
  }
  set context(e) {
    ((this.actionBar.context = e), this.toggleMenuActionViewItem?.setActionContext(e));
    for (const t of this.submenuActionViewItems) t.setActionContext(e);
  }
  getElement() {
    return this.element;
  }
  getItemAction(e) {
    return this.actionBar.getAction(e);
  }
  getItemWidth(e) {
    return this.actionBar.getWidth(e);
  }
  setActions(e, t) {
    (this.clear(),
      (this.originalPrimaryActions = e ? e.slice(0) : []),
      (this.originalSecondaryActions = t ? t.slice(0) : []));
    const n = e ? e.slice(0) : [];
    ((this.hasSecondaryActions = !!(t && t.length > 0)),
      this.hasSecondaryActions &&
        t &&
        ((this.toggleMenuAction.menuActions = t.slice(0)), n.push(this.toggleMenuAction)),
      n.length > 0 && this.options.trailingSeparator && n.push(new EV()),
      n.forEach((e) => {
        this.actionBar.push(e, {
          icon: this.options.icon ?? !0,
          label: this.options.label ?? !1,
          keybinding: this.getKeybindingLabel(e),
        });
      }),
      this.options.responsive &&
        ((this.hiddenActions.length = 0),
        this.setToolbarMaxWidth(this.element.getBoundingClientRect().width)));
  }
  getKeybindingLabel(e) {
    const t = this.options.getKeyBinding?.(e);
    return t?.getLabel() ?? void 0;
  }
  getItemsWidthResponsive() {
    return 24 * this.actionBar.length();
  }
  setToolbarMaxWidth(e) {
    if (
      this.actionBar.isEmpty() ||
      (this.getItemsWidthResponsive() <= e && 0 === this.hiddenActions.length)
    )
      return;
    if (this.getItemsWidthResponsive() > e)
      for (; this.getItemsWidthResponsive() > e && this.actionBar.length() > 0; ) {
        const e = this.originalPrimaryActions.length - this.hiddenActions.length - 1;
        if (e < 0) break;
        const t = Math.min(24, this.getItemWidth(e)),
          n = this.originalPrimaryActions[e];
        (this.hiddenActions.unshift({ action: n, size: t }),
          this.actionBar.pull(e),
          0 === this.originalSecondaryActions.length &&
            1 === this.hiddenActions.length &&
            this.actionBar.push(this.toggleMenuAction, {
              icon: this.options.icon ?? !0,
              label: this.options.label ?? !1,
              keybinding: this.getKeybindingLabel(this.toggleMenuAction),
            }));
      }
    else
      for (; this.hiddenActions.length > 0; ) {
        const t = this.hiddenActions.shift();
        if (this.getItemsWidthResponsive() + t.size > e) {
          this.hiddenActions.unshift(t);
          break;
        }
        (this.actionBar.push(t.action, {
          icon: this.options.icon ?? !0,
          label: this.options.label ?? !1,
          keybinding: this.getKeybindingLabel(t.action),
          index: this.originalPrimaryActions.length - this.hiddenActions.length - 1,
        }),
          0 === this.originalSecondaryActions.length &&
            1 === this.hiddenActions.length &&
            ((this.toggleMenuAction.menuActions = []),
            this.actionBar.pull(this.actionBar.length() - 1)));
      }
    const t = this.hiddenActions.map((e) => e.action);
    if (this.originalSecondaryActions.length > 0 || t.length > 0) {
      const e = this.originalSecondaryActions.slice(0);
      this.toggleMenuAction.menuActions = EV.join(t, e);
    }
  }
  clear() {
    ((this.submenuActionViewItems = []), this.disposables.clear(), this.actionBar.clear());
  }
  dispose() {
    (this.clear(), this.disposables.dispose(), super.dispose());
  }
};
class qde extends SV {
  static {
    this.ID = "toolbar.toggle.more";
  }
  constructor(e, t) {
    ((t = t || SI(17, "More Actions...")),
      super(qde.ID, t, void 0, !0),
      (this._menuActions = []),
      (this.toggleDropdownMenu = e));
  }
  async run() {
    this.toggleDropdownMenu();
  }
  get menuActions() {
    return this._menuActions;
  }
  set menuActions(e) {
    this._menuActions = e;
  }
}
class Kde {
  constructor(e, t, n = t) {
    ((this.modifierLabels = [null]),
      (this.modifierLabels[2] = e),
      (this.modifierLabels[1] = t),
      (this.modifierLabels[3] = n));
  }
  toLabel(e, t, n) {
    if (0 === t.length) return null;
    const i = [];
    for (let r = 0, o = t.length; r < o; r++) {
      const o = t[r],
        s = n(o);
      if (null === s) return null;
      i[r] = Qde(o, s, this.modifierLabels[e]);
    }
    return i.join(" ");
  }
}
const Gde = new Kde(
    { ctrlKey: "⌃", shiftKey: "⇧", altKey: "⌥", metaKey: "⌘", separator: "" },
    {
      ctrlKey: SI(35, "Ctrl"),
      shiftKey: SI(36, "Shift"),
      altKey: SI(37, "Alt"),
      metaKey: SI(38, "Windows"),
      separator: "+",
    },
    {
      ctrlKey: SI(39, "Ctrl"),
      shiftKey: SI(40, "Shift"),
      altKey: SI(41, "Alt"),
      metaKey: SI(42, "Super"),
      separator: "+",
    },
  ),
  Zde = new Kde(
    {
      ctrlKey: SI(43, "Control"),
      shiftKey: SI(44, "Shift"),
      altKey: SI(45, "Option"),
      metaKey: SI(46, "Command"),
      separator: "+",
    },
    {
      ctrlKey: SI(47, "Control"),
      shiftKey: SI(48, "Shift"),
      altKey: SI(49, "Alt"),
      metaKey: SI(50, "Windows"),
      separator: "+",
    },
    {
      ctrlKey: SI(51, "Control"),
      shiftKey: SI(52, "Shift"),
      altKey: SI(53, "Alt"),
      metaKey: SI(54, "Super"),
      separator: "+",
    },
  ),
  Yde = new Kde(
    { ctrlKey: "Ctrl", shiftKey: "Shift", altKey: "Alt", metaKey: "Cmd", separator: "+" },
    { ctrlKey: "Ctrl", shiftKey: "Shift", altKey: "Alt", metaKey: "Super", separator: "+" },
  ),
  Xde = new Kde(
    { 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 Qde(e, t, n) {
  if (null === t) return "";
  const i = [];
  return (
    e.ctrlKey && i.push(n.ctrlKey),
    e.shiftKey && i.push(n.shiftKey),
    e.altKey && i.push(n.altKey),
    e.metaKey && i.push(n.metaKey),
    "" !== t && i.push(t),
    i.join(n.separator)
  );
}
function Jde(e) {
  return !!e && "object" == typeof e && "string" == typeof e.original && "string" == typeof e.value;
}
var eue, tue;
(!(function (e) {
  ((e[(e.STORAGE_DOES_NOT_EXIST = 0)] = "STORAGE_DOES_NOT_EXIST"),
    (e[(e.STORAGE_IN_MEMORY = 1)] = "STORAGE_IN_MEMORY"));
})(eue || (eue = {})),
  (function (e) {
    ((e[(e.None = 0)] = "None"),
      (e[(e.Initialized = 1)] = "Initialized"),
      (e[(e.Closed = 2)] = "Closed"));
  })(tue || (tue = {})));
class nue extends PO {
  static {
    this.DEFAULT_FLUSH_DELAY = 100;
  }
  constructor(e, t = Object.create(null)) {
    (super(),
      (this.database = e),
      (this.options = t),
      (this._onDidChangeStorage = this._register(new eM())),
      (this.onDidChangeStorage = this._onDidChangeStorage.event),
      (this.state = tue.None),
      (this.cache = new Map()),
      (this.flushDelayer = this._register(new _M(nue.DEFAULT_FLUSH_DELAY))),
      (this.pendingDeletes = new Set()),
      (this.pendingInserts = new Map()),
      (this.pendingClose = void 0),
      (this.whenFlushedCallbacks = []),
      this.registerListeners());
  }
  registerListeners() {
    this._register(this.database.onDidChangeItemsExternal((e) => this.onDidChangeItemsExternal(e)));
  }
  onDidChangeItemsExternal(e) {
    this._onDidChangeStorage.pause();
    try {
      (e.changed?.forEach((e, t) => this.acceptExternal(t, e)),
        e.deleted?.forEach((e) => this.acceptExternal(e, void 0)));
    } finally {
      this._onDidChangeStorage.resume();
    }
  }
  acceptExternal(e, t) {
    if (this.state === tue.Closed) return;
    let n = !1;
    if (gR(t)) n = this.cache.delete(e);
    else {
      this.cache.get(e) !== t && (this.cache.set(e, t), (n = !0));
    }
    n && this._onDidChangeStorage.fire({ key: e, external: !0 });
  }
  get(e, t) {
    const n = this.cache.get(e);
    return gR(n) ? t : n;
  }
  getBoolean(e, t) {
    const n = this.get(e);
    return gR(n) ? t : "true" === n;
  }
  getNumber(e, t) {
    const n = this.get(e);
    return gR(n) ? t : parseInt(n, 10);
  }
  async set(e, t, n = !1) {
    if (this.state === tue.Closed) return;
    if (gR(t)) return this.delete(e, n);
    const i = sR(t) || Array.isArray(t) ? ((r = t), JSON.stringify(r, Coe)) : String(t);
    var r;
    return this.cache.get(e) !== i
      ? (this.cache.set(e, i),
        this.pendingInserts.set(e, i),
        this.pendingDeletes.delete(e),
        this._onDidChangeStorage.fire({ key: e, external: n }),
        this.doFlush())
      : void 0;
  }
  async delete(e, t = !1) {
    if (this.state === tue.Closed) return;
    return this.cache.delete(e)
      ? (this.pendingDeletes.has(e) || this.pendingDeletes.add(e),
        this.pendingInserts.delete(e),
        this._onDidChangeStorage.fire({ key: e, external: t }),
        this.doFlush())
      : void 0;
  }
  get hasPending() {
    return this.pendingInserts.size > 0 || this.pendingDeletes.size > 0;
  }
  async flushPending() {
    if (!this.hasPending) return;
    const e = { insert: this.pendingInserts, delete: this.pendingDeletes };
    return (
      (this.pendingDeletes = new Set()),
      (this.pendingInserts = new Map()),
      this.database.updateItems(e).finally(() => {
        if (!this.hasPending)
          for (; this.whenFlushedCallbacks.length; ) this.whenFlushedCallbacks.pop()?.();
      })
    );
  }
  async flush(e) {
    if (this.state !== tue.Closed && !this.pendingClose) return this.doFlush(e);
  }
  async doFlush(e) {
    return this.options.hint === eue.STORAGE_IN_MEMORY
      ? this.flushPending()
      : this.flushDelayer.trigger(() => this.flushPending(), e);
  }
  async whenFlushed() {
    if (this.hasPending) return new Promise((e) => this.whenFlushedCallbacks.push(e));
  }
}
class iue {
  constructor() {
    ((this.onDidChangeItemsExternal = $O.None), (this.items = new Map()));
  }
  async updateItems(e) {
    (e.insert?.forEach((e, t) => this.items.set(t, e)),
      e.delete?.forEach((e) => this.items.delete(e)));
  }
}
const rue = "__$__targetStorageMarker",
  oue = bV("storageService");
var sue;
!(function (e) {
  ((e[(e.NONE = 0)] = "NONE"), (e[(e.SHUTDOWN = 1)] = "SHUTDOWN"));
})(sue || (sue = {}));
class aue extends PO {
  static {
    this.DEFAULT_FLUSH_INTERVAL = 6e4;
  }
  constructor(e = { flushInterval: aue.DEFAULT_FLUSH_INTERVAL }) {
    (super(),
      (this._onDidChangeValue = this._register(new eM())),
      (this._onDidChangeTarget = this._register(new eM())),
      (this._onWillSaveState = this._register(new QO())),
      (this.onWillSaveState = this._onWillSaveState.event),
      (this.runFlushWhenIdle = this._register(new jO())),
      (this._workspaceKeyTargets = void 0),
      (this._profileKeyTargets = void 0),
      (this._applicationKeyTargets = void 0),
      (this.flushWhenIdleScheduler = this._register(
        new EM(() => this.doFlushWhenIdle(), e.flushInterval),
      )));
  }
  onDidChangeValue(e, t, n) {
    return $O.filter(
      this._onDidChangeValue.event,
      (n) => n.scope === e && (void 0 === t || n.key === t),
      n,
    );
  }
  doFlushWhenIdle() {
    this.runFlushWhenIdle.value = xM(() => {
      (this.shouldFlushWhenIdle() && this.flush(), this.flushWhenIdleScheduler.schedule());
    });
  }
  shouldFlushWhenIdle() {
    return !0;
  }
  emitDidChangeValue(e, t) {
    const { key: n, external: i } = t;
    if (n === rue) {
      switch (e) {
        case -1:
          this._applicationKeyTargets = void 0;
          break;
        case 0:
          this._profileKeyTargets = void 0;
          break;
        case 1:
          this._workspaceKeyTargets = void 0;
      }
      this._onDidChangeTarget.fire({ scope: e });
    } else
      this._onDidChangeValue.fire({
        scope: e,
        key: n,
        target: this.getKeyTargets(e)[n],
        external: i,
      });
  }
  get(e, t, n) {
    return this.getStorage(t)?.get(e, n);
  }
  getBoolean(e, t, n) {
    return this.getStorage(t)?.getBoolean(e, n);
  }
  getNumber(e, t, n) {
    return this.getStorage(t)?.getNumber(e, n);
  }
  store(e, t, n, i, r = !1) {
    gR(t)
      ? this.remove(e, n, r)
      : this.withPausedEmitters(() => {
          (this.updateKeyTarget(e, n, i), this.getStorage(n)?.set(e, t, r));
        });
  }
  remove(e, t, n = !1) {
    this.withPausedEmitters(() => {
      (this.updateKeyTarget(e, t, void 0), this.getStorage(t)?.delete(e, n));
    });
  }
  withPausedEmitters(e) {
    (this._onDidChangeValue.pause(), this._onDidChangeTarget.pause());
    try {
      e();
    } finally {
      (this._onDidChangeValue.resume(), this._onDidChangeTarget.resume());
    }
  }
  updateKeyTarget(e, t, n, i = !1) {
    const r = this.getKeyTargets(t);
    "number" == typeof n
      ? r[e] !== n && ((r[e] = n), this.getStorage(t)?.set(rue, JSON.stringify(r), i))
      : "number" == typeof r[e] &&
        (delete r[e], this.getStorage(t)?.set(rue, JSON.stringify(r), i));
  }
  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(e) {
    switch (e) {
      case -1:
        return this.applicationKeyTargets;
      case 0:
        return this.profileKeyTargets;
      default:
        return this.workspaceKeyTargets;
    }
  }
  loadKeyTargets(e) {
    const t = this.getStorage(e);
    return t
      ? (function (e) {
          const t = e.get(rue);
          if (t)
            try {
              return JSON.parse(t);
            } catch (D2t) {}
          return Object.create(null);
        })(t)
      : Object.create(null);
  }
  async flush(e = sue.NONE) {
    this._onWillSaveState.fire({ reason: e });
    const t = this.getStorage(-1),
      n = this.getStorage(0),
      i = this.getStorage(1);
    switch (e) {
      case sue.NONE:
        await TM.settled([
          t?.whenFlushed() ?? Promise.resolve(),
          n?.whenFlushed() ?? Promise.resolve(),
          i?.whenFlushed() ?? Promise.resolve(),
        ]);
        break;
      case sue.SHUTDOWN:
        await TM.settled([
          t?.flush(0) ?? Promise.resolve(),
          n?.flush(0) ?? Promise.resolve(),
          i?.flush(0) ?? Promise.resolve(),
        ]);
    }
  }
}
const lue = {
    keybindingLabelBackground: yG(KY),
    keybindingLabelForeground: yG(GY),
    keybindingLabelBorder: yG(ZY),
    keybindingLabelBottomBorder: yG(YY),
    keybindingLabelShadow: yG(MZ),
  },
  cue = {
    buttonForeground: yG(NY),
    buttonSeparator: yG(LY),
    buttonBackground: yG(DY),
    buttonHoverBackground: yG(TY),
    buttonSecondaryForeground: yG(RY),
    buttonSecondaryBackground: yG(OY),
    buttonSecondaryHoverBackground: yG(MY),
    buttonBorder: yG(IY),
  },
  due = { progressBarBackground: yG(KG) },
  uue = {
    inputActiveOptionBorder: yG(dY),
    inputActiveOptionForeground: yG(gY),
    inputActiveOptionBackground: yG(hY),
  };
(yG(AY), yG(PY), yG(jY), yG(FY), yG(BY), yG(VY), yG(WY));
const hue = {
  checkboxBackground: yG(HY),
  checkboxBorder: yG(UY),
  checkboxForeground: yG(zY),
  checkboxDisabledBackground: yG($Y),
  checkboxDisabledForeground: yG(qY),
};
(yG(YG), yG(XG), yG(MZ), yG(AZ), yG(YZ), yG(XZ), yG(QZ), yG(VG));
const gue = {
    inputBackground: yG(aY),
    inputForeground: yG(lY),
    inputBorder: yG(cY),
    inputValidationInfoBorder: yG(mY),
    inputValidationInfoBackground: yG(pY),
    inputValidationInfoForeground: yG(fY),
    inputValidationWarningBorder: yG(bY),
    inputValidationWarningBackground: yG(_Y),
    inputValidationWarningForeground: yG(vY),
    inputValidationErrorBorder: yG(wY),
    inputValidationErrorBackground: yG(yY),
    inputValidationErrorForeground: yG(xY),
  },
  pue = {
    listFilterWidgetBackground: yG(vX),
    listFilterWidgetOutline: yG(bX),
    listFilterWidgetNoMatchesOutline: yG(yX),
    listFilterWidgetShadow: yG(xX),
    inputBoxStyles: gue,
    toggleStyles: uue,
  },
  fue = { badgeBackground: yG(WG), badgeForeground: yG(HG), badgeBorder: yG(FG) };
(yG(FZ), yG(jZ), yG(BZ), yG(BZ), yG(VZ));
const mue = {
  listBackground: void 0,
  listInactiveFocusForeground: void 0,
  listFocusBackground: yG(XY),
  listFocusForeground: yG(QY),
  listFocusOutline: yG(JY),
  listActiveSelectionBackground: yG(tX),
  listActiveSelectionForeground: yG(nX),
  listActiveSelectionIconForeground: yG(iX),
  listFocusAndSelectionOutline: yG(eX),
  listFocusAndSelectionBackground: yG(tX),
  listFocusAndSelectionForeground: yG(nX),
  listInactiveSelectionBackground: yG(rX),
  listInactiveSelectionIconForeground: yG(sX),
  listInactiveSelectionForeground: yG(oX),
  listInactiveFocusBackground: yG(aX),
  listInactiveFocusOutline: yG(lX),
  listHoverBackground: yG(cX),
  listHoverForeground: yG(dX),
  listDropOverBackground: yG(uX),
  listDropBetweenBackground: yG(hX),
  listSelectionOutline: yG(BG),
  listHoverOutline: yG(BG),
  treeIndentGuidesStroke: yG(wX),
  treeInactiveIndentGuidesStroke: yG(CX),
  treeStickyScrollBackground: void 0,
  treeStickyScrollBorder: void 0,
  treeStickyScrollShadow: yG(zG),
  tableColumnsBorder: yG(SX),
  tableOddRowsBackgroundColor: yG(kX),
};
function _ue(e) {
  return (function (e, t) {
    const n = { ...t };
    for (const i in e) {
      const t = e[i];
      n[i] = void 0 !== t ? yG(t) : void 0;
    }
    return n;
  })(e, mue);
}
const vue = {
    selectBackground: yG(CY),
    selectListBackground: yG(SY),
    selectForeground: yG(kY),
    decoratorRightForeground: yG(jX),
    selectBorder: yG(EY),
    focusBorder: yG(jG),
    listFocusBackground: yG(HX),
    listInactiveSelectionIconForeground: yG(WX),
    listFocusForeground: yG(VX),
    listFocusOutline: xG(BG, vG.transparent.toString()),
    listHoverBackground: yG(cX),
    listHoverForeground: yG(dX),
    listHoverOutline: yG(BG),
    selectListBorder: yG(QG),
    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,
  },
  bue = {
    shadowColor: yG(MZ),
    borderColor: yG(NX),
    foregroundColor: yG(LX),
    backgroundColor: yG(DX),
    selectionForegroundColor: yG(TX),
    selectionBackgroundColor: yG(IX),
    selectionBorderColor: yG(RX),
    separatorColor: yG(OX),
    scrollbarShadow: yG(zG),
    scrollbarSliderBackground: yG(UG),
    scrollbarSliderHoverBackground: yG($G),
    scrollbarSliderActiveBackground: yG(qG),
  };
function yue(e, t) {
  if (BR) return !1;
  const n = (function (e, t) {
      t || (t = xue(e));
      return "native" === t;
    })(e, t),
    i = e.getValue("window");
  return "native" === i?.menuStyle ? !(!PR && !n) : "custom" !== i?.menuStyle && n;
}
function xue(e) {
  if (BR) return "custom";
  const t = e.getValue("window");
  if (t) {
    if (PR && !0 === t.nativeTabs) return "native";
    if (PR && !1 === t.nativeFullScreen) return "native";
    const e = t.titleBarStyle;
    if ("native" === e || "custom" === e) return e;
  }
  return "custom";
}
var wue = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Cue = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
function Sue(e, t) {
  const n = [];
  return (
    (function (e, t) {
      const n = $B.getInstance(),
        i = n.keyStatus.altKey || ((AR || jR) && n.keyStatus.shiftKey);
      Nue(e, t, i, (e) => "navigation" === e);
    })(e, n),
    n
  );
}
function kue(e, t, n, i) {
  const r = { primary: [], secondary: [] };
  return (Eue(e, r, t, n, i), r);
}
function Eue(e, t, n, i, r) {
  Nue(e, t, !1, "string" == typeof n ? (e) => e === n : n, i, r);
}
function Nue(e, t, n, i = (e) => "navigation" === e, r = () => !1, o = !1) {
  let s, a;
  Array.isArray(t) ? ((s = t), (a = t)) : ((s = t.primary), (a = t.secondary));
  const l = new Set();
  for (const [c, d] of e) {
    let e;
    i(c)
      ? ((e = s), e.length > 0 && o && e.push(new EV()))
      : ((e = a), e.length > 0 && e.push(new EV()));
    for (let t of d) {
      n && (t = t instanceof BW && t.alt ? t.alt : t);
      const i = e.push(t);
      t instanceof NV && l.add({ group: c, action: t, index: i - 1 });
    }
  }
  for (const { group: c, action: d, index: u } of l) {
    const e = i(c) ? s : a,
      t = d.actions;
    r(d, c, e.length) && e.splice(u, 1, ...t);
  }
}
let Lue = class extends xle {
  constructor(e, t, n, i, r, o, s, a) {
    (super(void 0, e, {
      icon: !(!e.class && !e.item.icon),
      label: !e.class && !e.item.icon,
      draggable: t?.draggable,
      keybinding: t?.keybinding,
      hoverDelegate: t?.hoverDelegate,
      keybindingNotRenderedWithLabel: t?.keybindingNotRenderedWithLabel,
    }),
      (this._options = t),
      (this._keybindingService = n),
      (this._notificationService = i),
      (this._contextKeyService = r),
      (this._themeService = o),
      (this._contextMenuService = s),
      (this._accessibilityService = a),
      (this._wantsAltCommand = !1),
      (this._itemClassDispose = this._register(new jO())),
      (this._altKey = $B.getInstance()));
  }
  get _menuItemAction() {
    return this._action;
  }
  get _commandAction() {
    return (this._wantsAltCommand && this._menuItemAction.alt) || this._menuItemAction;
  }
  async onClick(e) {
    (e.preventDefault(), e.stopPropagation());
    try {
      await this.actionRunner.run(this._commandAction, this._context);
    } catch (t) {
      this._notificationService.error(t);
    }
  }
  render(e) {
    if (
      (super.render(e),
      e.classList.add("menu-entry"),
      this.options.icon && this._updateItemClass(this._menuItemAction.item),
      this._menuItemAction.alt)
    ) {
      let t = !1;
      const n = () => {
        const e =
          !!this._menuItemAction.alt?.enabled &&
          (!this._accessibilityService.isMotionReduced() || t) &&
          (this._altKey.keyStatus.altKey || (this._altKey.keyStatus.shiftKey && t));
        e !== this._wantsAltCommand &&
          ((this._wantsAltCommand = e),
          this.updateLabel(),
          this.updateTooltip(),
          this.updateClass());
      };
      (this._register(this._altKey.event(n)),
        this._register(
          $F(e, "mouseleave", (e) => {
            ((t = !1), n());
          }),
        ),
        this._register(
          $F(e, "mouseenter", (e) => {
            ((t = !0), n());
          }),
        ),
        n());
    }
  }
  updateLabel() {
    this.options.label && this.label && (this.label.textContent = this._commandAction.label);
  }
  getTooltip() {
    const e = this._keybindingService.lookupKeybinding(
        this._commandAction.id,
        this._contextKeyService,
      ),
      t = e && e.getLabel(),
      n = this._commandAction.tooltip || this._commandAction.label;
    let i = t ? SI(1644, "{0} ({1})", n, t) : n;
    if (!this._wantsAltCommand && this._menuItemAction.alt?.enabled) {
      const e = this._menuItemAction.alt.tooltip || this._menuItemAction.alt.label,
        t = this._keybindingService.lookupKeybinding(
          this._menuItemAction.alt.id,
          this._contextKeyService,
        ),
        n = t && t.getLabel(),
        r = n ? SI(1645, "{0} ({1})", e, n) : e;
      i = SI(1646, "{0}\n[{1}] {2}", i, Gde.modifierLabels[GR].altKey, r);
    }
    return i;
  }
  updateClass() {
    this.options.icon &&
      (this._commandAction !== this._menuItemAction
        ? this._menuItemAction.alt && this._updateItemClass(this._menuItemAction.alt.item)
        : this._updateItemClass(this._menuItemAction.item));
  }
  _updateItemClass(e) {
    this._itemClassDispose.value = void 0;
    const { element: t, label: n } = this;
    if (!t || !n) return;
    const i =
      this._commandAction.checked && (r = e.toggled) && void 0 !== r.condition && e.toggled.icon
        ? e.toggled.icon
        : e.icon;
    var r;
    if (i)
      if (AV.isThemeIcon(i)) {
        const e = AV.asClassNameArray(i);
        (n.classList.add(...e),
          (this._itemClassDispose.value = MO(() => {
            n.classList.remove(...e);
          })));
      } else
        ((n.style.backgroundImage = IQ(this._themeService.getColorTheme().type)
          ? Une(i.dark)
          : Une(i.light)),
          n.classList.add("icon"),
          (this._itemClassDispose.value = RO(
            MO(() => {
              ((n.style.backgroundImage = ""), n.classList.remove("icon"));
            }),
            this._themeService.onDidColorThemeChange(() => {
              this.updateClass();
            }),
          )));
  }
};
Lue = wue([Cue(2, N5), Cue(3, Y4), Cue(4, xW), Cue(5, h0), Cue(6, cde), Cue(7, KK)], Lue);
class Due extends Lue {
  render(e) {
    ((this.options.label = !0),
      (this.options.icon = !1),
      super.render(e),
      e.classList.add("text-only"),
      e.classList.toggle("use-comma", this._options?.useComma ?? !1));
  }
  updateLabel() {
    const e = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService);
    if (!e) return super.updateLabel();
    if (this.label) {
      const t = Due._symbolPrintEnter(e);
      this._options?.conversational
        ? (this.label.textContent = SI(1647, "{1} to {0}", this._action.label, t))
        : (this.label.textContent = SI(1648, "{0} ({1})", this._action.label, t));
    }
  }
  static _symbolPrintEnter(e) {
    return e
      .getLabel()
      ?.replace(/\benter\b/gi, "⏎")
      .replace(/\bEscape\b/gi, "Esc");
  }
}
let Tue = class extends Ude {
  constructor(e, t, n, i, r) {
    const o = {
      ...t,
      menuAsChild: t?.menuAsChild ?? !1,
      classNames:
        t?.classNames ?? (AV.isThemeIcon(e.item.icon) ? AV.asClassName(e.item.icon) : void 0),
      keybindingProvider: t?.keybindingProvider ?? ((e) => n.lookupKeybinding(e.id)),
    };
    (super(e, { getActions: () => e.actions }, i, o),
      (this._keybindingService = n),
      (this._contextMenuService = i),
      (this._themeService = r));
  }
  render(e) {
    (super.render(e), pR(this.element), e.classList.add("menu-entry"));
    const t = this._action,
      { icon: n } = t.item;
    if (n && !AV.isThemeIcon(n)) {
      this.element.classList.add("icon");
      const e = () => {
        this.element &&
          (this.element.style.backgroundImage = IQ(this._themeService.getColorTheme().type)
            ? Une(n.dark)
            : Une(n.light));
      };
      (e(),
        this._register(
          this._themeService.onDidColorThemeChange(() => {
            e();
          }),
        ));
    }
  }
};
Tue = wue([Cue(2, N5), Cue(3, cde), Cue(4, h0)], Tue);
let Iue = class extends yle {
  constructor(e, t, n, i, r, o, s, a) {
    let l;
    (super(null, e),
      (this._keybindingService = n),
      (this._notificationService = i),
      (this._contextMenuService = r),
      (this._menuService = o),
      (this._instaService = s),
      (this._storageService = a),
      (this._defaultActionDisposables = this._register(new AO())),
      (this._container = null),
      (this._options = t),
      (this._storageKey = `${e.item.submenu.id}_lastActionId`));
    const c = t?.togglePrimaryAction ? a.get(this._storageKey, 1) : void 0;
    (c && (l = e.actions.find((e) => c === e.id)),
      l || (l = e.actions[0]),
      (this._defaultAction = this._defaultActionDisposables.add(
        this._instaService.createInstance(Lue, l, {
          keybinding: this._getDefaultActionKeybindingLabel(l),
        }),
      )));
    const d = {
      keybindingProvider: (e) => this._keybindingService.lookupKeybinding(e.id),
      ...t,
      menuAsChild: t?.menuAsChild ?? !0,
      classNames: t?.classNames ?? ["codicon", "codicon-chevron-down"],
      actionRunner: t?.actionRunner ?? this._register(new kV()),
    };
    ((this._dropdown = this._register(new Ude(e, e.actions, this._contextMenuService, d))),
      t?.togglePrimaryAction &&
        this._register(
          this._dropdown.actionRunner.onDidRun((e) => {
            e.action instanceof BW && this.update(e.action);
          }),
        ));
  }
  update(e) {
    (this._options?.togglePrimaryAction && this._storageService.store(this._storageKey, e.id, 1, 1),
      this._defaultActionDisposables.clear(),
      (this._defaultAction = this._defaultActionDisposables.add(
        this._instaService.createInstance(Lue, e, {
          keybinding: this._getDefaultActionKeybindingLabel(e),
        }),
      )),
      (this._defaultAction.actionRunner = this._defaultActionDisposables.add(
        new (class extends kV {
          async runAction(e, t) {
            await e.run(void 0);
          }
        })(),
      )),
      this._container && this._defaultAction.render(AB(this._container, VB(".action-container"))));
  }
  _getDefaultActionKeybindingLabel(e) {
    let t;
    if (this._options?.renderKeybindingWithDefaultActionLabel) {
      const n = this._keybindingService.lookupKeybinding(e.id);
      n && (t = `(${n.getLabel()})`);
    }
    return t;
  }
  setActionContext(e) {
    (super.setActionContext(e),
      this._defaultAction.setActionContext(e),
      this._dropdown.setActionContext(e));
  }
  set actionRunner(e) {
    ((super.actionRunner = e),
      (this._defaultAction.actionRunner = e),
      (this._dropdown.actionRunner = e));
  }
  get actionRunner() {
    return super.actionRunner;
  }
  render(e) {
    ((this._container = e),
      super.render(this._container),
      this._container.classList.add("monaco-dropdown-with-default"));
    const t = VB(".action-container");
    (this._defaultAction.render(MB(this._container, t)),
      this._register(
        $F(t, DB.KEY_DOWN, (e) => {
          const t = new wO(e);
          t.equals(17) &&
            ((this._defaultAction.element.tabIndex = -1),
            this._dropdown.focus(),
            t.stopPropagation());
        }),
      ));
    const n = VB(".dropdown-action-container");
    (this._dropdown.render(MB(this._container, n)),
      this._register(
        $F(n, DB.KEY_DOWN, (e) => {
          const t = new wO(e);
          t.equals(15) &&
            ((this._defaultAction.element.tabIndex = 0),
            this._dropdown.setFocusable(!1),
            this._defaultAction.element?.focus(),
            t.stopPropagation());
        }),
      ));
  }
  focus(e) {
    e
      ? 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(e) {
    e
      ? (this._defaultAction.element.tabIndex = 0)
      : ((this._defaultAction.element.tabIndex = -1), this._dropdown.setFocusable(!1));
  }
};
Iue = wue([Cue(2, N5), Cue(3, Y4), Cue(4, cde), Cue(5, AW), Cue(6, vV), Cue(7, oue)], Iue);
let Rue = class extends wle {
  constructor(e, t, n) {
    (super(
      null,
      e,
      e.actions.map((e) => ({
        text: e.id === EV.ID ? "─────────" : e.label,
        isDisabled: !e.enabled,
      })),
      0,
      t,
      vue,
      { ariaLabel: e.tooltip, optionsAsChildren: !0, useCustomDrawn: !yue(n) },
    ),
      this.select(
        Math.max(
          0,
          e.actions.findIndex((e) => e.checked),
        ),
      ));
  }
  render(e) {
    (super.render(e), (e.style.borderColor = yG(EY)));
  }
  runAction(e, t) {
    const n = this.action.actions[t];
    n && this.actionRunner.run(n);
  }
};
function Oue(e, t, n) {
  return t instanceof BW
    ? e.createInstance(Lue, t, n)
    : t instanceof FW
      ? t.item.isSelection
        ? e.createInstance(Rue, t)
        : t.item.isSplitButton
          ? e.createInstance(Iue, t, {
              ...n,
              togglePrimaryAction:
                "boolean" != typeof t.item.isSplitButton &&
                t.item.isSplitButton.togglePrimaryAction,
            })
          : e.createInstance(Tue, t, n)
      : void 0;
}
Rue = wue([Cue(1, lde), Cue(2, OU)], Rue);
var Mue,
  Aue,
  Pue = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  jue = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Fue = class {
  constructor(e, t, n) {
    ((this._commandService = e), (this._keybindingService = t), (this._hiddenStates = new Bue(n)));
  }
  createMenu(e, t, n) {
    return new Hue(
      e,
      this._hiddenStates,
      { emitEventsForSubmenuChanges: !1, eventDebounceDelay: 50, ...n },
      this._commandService,
      this._keybindingService,
      t,
    );
  }
  getMenuActions(e, t, n) {
    const i = new Hue(
        e,
        this._hiddenStates,
        { emitEventsForSubmenuChanges: !1, eventDebounceDelay: 50, ...n },
        this._commandService,
        this._keybindingService,
        t,
      ),
      r = i.getActions(n);
    return (i.dispose(), r);
  }
  resetHiddenStates(e) {
    this._hiddenStates.reset(e);
  }
};
Fue = Pue([jue(0, PV), jue(1, N5), jue(2, oue)], Fue);
let Bue = class {
  static {
    Mue = this;
  }
  static {
    this._key = "menu.hiddenCommands";
  }
  constructor(e) {
    ((this._storageService = e),
      (this._disposables = new AO()),
      (this._onDidChange = new QO()),
      (this.onDidChange = this._onDidChange.event),
      (this._ignoreChangeEvent = !1),
      (this._hiddenByDefaultCache = new Map()));
    try {
      const t = e.get(Mue._key, 0, "{}");
      this._data = JSON.parse(t);
    } catch (t) {
      this._data = Object.create(null);
    }
    this._disposables.add(
      e.onDidChangeValue(
        0,
        Mue._key,
        this._disposables,
      )(() => {
        if (!this._ignoreChangeEvent)
          try {
            const t = e.get(Mue._key, 0, "{}");
            this._data = JSON.parse(t);
          } catch (t) {}
        this._onDidChange.fire();
      }),
    );
  }
  dispose() {
    (this._onDidChange.dispose(), this._disposables.dispose());
  }
  _isHiddenByDefault(e, t) {
    return this._hiddenByDefaultCache.get(`${e.id}/${t}`) ?? !1;
  }
  setDefaultState(e, t, n) {
    this._hiddenByDefaultCache.set(`${e.id}/${t}`, n);
  }
  isHidden(e, t) {
    const n = this._isHiddenByDefault(e, t),
      i = this._data[e.id]?.includes(t) ?? !1;
    return n ? !i : i;
  }
  updateHidden(e, t, n) {
    this._isHiddenByDefault(e, t) && (n = !n);
    const i = this._data[e.id];
    if (n)
      if (i) {
        i.indexOf(t) < 0 && i.push(t);
      } else this._data[e.id] = [t];
    else if (i) {
      const n = i.indexOf(t);
      (n >= 0 &&
        (function (e, t) {
          const n = e.length - 1;
          (t < n && (e[t] = e[n]), e.pop());
        })(i, n),
        0 === i.length && delete this._data[e.id]);
    }
    this._persist();
  }
  reset(e) {
    if (void 0 === e) ((this._data = Object.create(null)), this._persist());
    else {
      for (const { id: t } of e) this._data[t] && delete this._data[t];
      this._persist();
    }
  }
  _persist() {
    try {
      this._ignoreChangeEvent = !0;
      const e = JSON.stringify(this._data);
      this._storageService.store(Mue._key, e, 0, 0);
    } finally {
      this._ignoreChangeEvent = !1;
    }
  }
};
Bue = Mue = Pue([jue(0, oue)], Bue);
class Vue {
  constructor(e, t) {
    ((this._id = e),
      (this._collectContextKeysForSubmenus = t),
      (this._menuGroups = []),
      (this._allMenuIds = new Set()),
      (this._structureContextKeys = new Set()),
      (this._preconditionContextKeys = new Set()),
      (this._toggledContextKeys = 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());
    const e = this._sort(jW.getMenuItems(this._id));
    let t;
    for (const n of e) {
      const e = n.group || "";
      ((t && t[0] === e) || ((t = [e, []]), this._menuGroups.push(t)),
        t[1].push(n),
        this._collectContextKeysAndSubmenuIds(n));
    }
    this._allMenuIds.add(this._id);
  }
  _sort(e) {
    return e;
  }
  _collectContextKeysAndSubmenuIds(e) {
    if ((Vue._fillInKbExprKeys(e.when, this._structureContextKeys), OW(e))) {
      if (
        (e.command.precondition &&
          Vue._fillInKbExprKeys(e.command.precondition, this._preconditionContextKeys),
        e.command.toggled)
      ) {
        const t = e.command.toggled.condition || e.command.toggled;
        Vue._fillInKbExprKeys(t, this._toggledContextKeys);
      }
    } else
      this._collectContextKeysForSubmenus &&
        (jW.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds, this),
        this._allMenuIds.add(e.submenu));
  }
  static _fillInKbExprKeys(e, t) {
    if (e) for (const n of e.keys()) t.add(n);
  }
}
let Wue = (Aue = class extends Vue {
  constructor(e, t, n, i, r, o) {
    (super(e, n),
      (this._hiddenStates = t),
      (this._commandService = i),
      (this._keybindingService = r),
      (this._contextKeyService = o),
      this.refresh());
  }
  createActionGroups(e) {
    const t = [];
    for (const n of this._menuGroups) {
      const [i, r] = n;
      let o;
      for (const t of r)
        if (this._contextKeyService.contextMatchesRules(t.when)) {
          const n = OW(t);
          n && this._hiddenStates.setDefaultState(this._id, t.command.id, !!t.isHiddenByDefault);
          const i = zue(this._id, n ? t.command : t, this._hiddenStates);
          if (n) {
            const n = Uue(this._commandService, this._keybindingService, t.command.id, t.when);
            (o ??= []).push(
              new BW(t.command, t.alt, e, i, n, this._contextKeyService, this._commandService),
            );
          } else {
            const n = new Aue(
                t.submenu,
                this._hiddenStates,
                this._collectContextKeysForSubmenus,
                this._commandService,
                this._keybindingService,
                this._contextKeyService,
              ).createActionGroups(e),
              r = EV.join(...n.map((e) => e[1]));
            r.length > 0 && (o ??= []).push(new FW(t, i, r));
          }
        }
      o && o.length > 0 && t.push([i, o]);
    }
    return t;
  }
  _sort(e) {
    return e.sort(Aue._compareMenuItems);
  }
  static _compareMenuItems(e, t) {
    const n = e.group,
      i = t.group;
    if (n !== i) {
      if (!n) return 1;
      if (!i) return -1;
      if ("navigation" === n) return -1;
      if ("navigation" === i) return 1;
      const e = n.localeCompare(i);
      if (0 !== e) return e;
    }
    const r = e.order || 0,
      o = t.order || 0;
    return r < o
      ? -1
      : r > o
        ? 1
        : Aue._compareTitles(OW(e) ? e.command.title : e.title, OW(t) ? t.command.title : t.title);
  }
  static _compareTitles(e, t) {
    const n = "string" == typeof e ? e : e.original,
      i = "string" == typeof t ? t : t.original;
    return n.localeCompare(i);
  }
});
Wue = Aue = Pue([jue(3, PV), jue(4, N5), jue(5, xW)], Wue);
let Hue = class {
  constructor(e, t, n, i, r, o) {
    ((this._disposables = new AO()),
      (this._menuInfo = new Wue(e, t, n.emitEventsForSubmenuChanges, i, r, o)));
    const s = new EM(() => {
      (this._menuInfo.refresh(),
        this._onDidChange.fire({
          menu: this,
          isStructuralChange: !0,
          isEnablementChange: !0,
          isToggleChange: !0,
        }));
    }, n.eventDebounceDelay);
    (this._disposables.add(s),
      this._disposables.add(
        jW.onDidChangeMenu((e) => {
          for (const t of this._menuInfo.allMenuIds)
            if (e.has(t)) {
              s.schedule();
              break;
            }
        }),
      ));
    const a = this._disposables.add(new AO());
    ((this._onDidChange = new tM({
      onWillAddFirstListener: () => {
        (a.add(
          o.onDidChangeContext((e) => {
            const t = e.affectsSome(this._menuInfo.structureContextKeys),
              n = e.affectsSome(this._menuInfo.preconditionContextKeys),
              i = e.affectsSome(this._menuInfo.toggledContextKeys);
            (t || n || i) &&
              this._onDidChange.fire({
                menu: this,
                isStructuralChange: t,
                isEnablementChange: n,
                isToggleChange: i,
              });
          }),
        ),
          a.add(
            t.onDidChange((e) => {
              this._onDidChange.fire({
                menu: this,
                isStructuralChange: !0,
                isEnablementChange: !1,
                isToggleChange: !1,
              });
            }),
          ));
      },
      onDidRemoveLastListener: a.clear.bind(a),
      delay: n.eventDebounceDelay,
      merge: (e) => {
        let t = !1,
          n = !1,
          i = !1;
        for (const r of e)
          if (
            ((t = t || r.isStructuralChange),
            (n = n || r.isEnablementChange),
            (i = i || r.isToggleChange),
            t && n && i)
          )
            break;
        return { menu: this, isStructuralChange: t, isEnablementChange: n, isToggleChange: i };
      },
    })),
      (this.onDidChange = this._onDidChange.event));
  }
  getActions(e) {
    return this._menuInfo.createActionGroups(e);
  }
  dispose() {
    (this._disposables.dispose(), this._onDidChange.dispose());
  }
};
function zue(e, t, n) {
  const i = void 0 !== t.submenu ? t.submenu.id : t.id;
  const r = "string" == typeof t.title ? t.title : t.title.value,
    o = DV({
      id: `hide/${e.id}/${i}`,
      label: SI(1651, "Hide '{0}'", r),
      run() {
        n.updateHidden(e, i, !0);
      },
    }),
    s = DV({
      id: `toggle/${e.id}/${i}`,
      label: r,
      get checked() {
        return !n.isHidden(e, i);
      },
      run() {
        n.updateHidden(e, i, !!this.checked);
      },
    });
  return {
    hide: o,
    toggle: s,
    get isHidden() {
      return !s.checked;
    },
  };
}
function Uue(e, t, n, i = void 0, r = !0) {
  return DV({
    id: `configureKeybinding/${n}`,
    label: SI(1652, "Configure Keybinding"),
    enabled: r,
    run() {
      const r = !!!t.lookupKeybinding(n) && i ? i.serialize() : void 0;
      e.executeCommand(
        "workbench.action.openGlobalKeybindings",
        `@command:${n}` + (r ? ` +when:${r}` : ""),
      );
    },
  });
}
Hue = Pue([jue(3, PV), jue(4, N5), jue(5, xW)], Hue);
const $ue = bV("IActionViewItemService");
HU(
  $ue,
  class {
    constructor() {
      ((this._providers = new Map()),
        (this._onDidChange = new QO()),
        (this.onDidChange = this._onDidChange.event));
    }
    dispose() {
      this._onDidChange.dispose();
    }
    lookUp(e, t) {
      return this._providers.get(this._makeKey(e, t));
    }
    _makeKey(e, t) {
      return `${e.id}/${t instanceof MW ? t.id : t}`;
    }
  },
  1,
);
var que = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Kue = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Gue = class extends $de {
  constructor(e, t, n, i, r, o, s, a) {
    (super(e, r, {
      getKeyBinding: (e) => o.lookupKeybinding(e.id) ?? void 0,
      ...t,
      allowContextMenu: !0,
      skipTelemetry: "string" == typeof t?.telemetrySource,
    }),
      (this._options = t),
      (this._menuService = n),
      (this._contextKeyService = i),
      (this._contextMenuService = r),
      (this._keybindingService = o),
      (this._commandService = s),
      (this._sessionDisposables = this._store.add(new AO())));
    const l = t?.telemetrySource;
    l &&
      this._store.add(
        this.actionBar.onDidRun((e) =>
          a.publicLog2("workbenchActionExecuted", { id: e.action.id, from: l }),
        ),
      );
  }
  setActions(e, t = [], n) {
    this._sessionDisposables.clear();
    const i = e.slice(),
      r = t.slice(),
      o = [];
    let s = 0;
    const a = [];
    let l = !1;
    if (-1 !== this._options?.hiddenItemStrategy)
      for (let c = 0; c < i.length; c++) {
        const e = i[c];
        (e instanceof BW || e instanceof FW) &&
          e.hideActions &&
          (o.push(e.hideActions.toggle),
          e.hideActions.toggle.checked && s++,
          e.hideActions.isHidden &&
            ((l = !0), (i[c] = void 0), 0 !== this._options?.hiddenItemStrategy && (a[c] = e)));
      }
    if (void 0 !== this._options?.overflowBehavior) {
      const e = U7(
          new Set(this._options.overflowBehavior.exempted),
          DO.map(i, (e) => e?.id),
        ),
        t = this._options.overflowBehavior.maxItems - e.size;
      let n = 0;
      for (let r = 0; r < i.length; r++) {
        const o = i[r];
        o && (n++, e.has(o.id) || (n >= t && ((i[r] = void 0), (a[r] = o))));
      }
    }
    (oj(i),
      oj(a),
      super.setActions(i, EV.join(a, r)),
      (o.length > 0 || i.length > 0) &&
        this._sessionDisposables.add(
          $F(this.getElement(), "contextmenu", (e) => {
            const t = new EO(MF(this.getElement()), e),
              i = this.getItemAction(t.target);
            if (!i) return;
            (t.preventDefault(), t.stopPropagation());
            const r = [];
            if (i instanceof BW && i.menuKeybinding) r.push(i.menuKeybinding);
            else if (!(i instanceof FW || i instanceof qde)) {
              const e = !!this._keybindingService.lookupKeybinding(i.id);
              r.push(Uue(this._commandService, this._keybindingService, i.id, void 0, e));
            }
            if (o.length > 0) {
              let e = !1;
              if (1 === s && 0 === this._options?.hiddenItemStrategy) {
                e = !0;
                for (let e = 0; e < o.length; e++)
                  if (o[e].checked) {
                    o[e] = DV({ id: i.id, label: i.label, checked: !0, enabled: !1, run() {} });
                    break;
                  }
              }
              if (!e && (i instanceof BW || i instanceof FW)) {
                if (!i.hideActions) return;
                r.push(i.hideActions.hide);
              } else r.push(DV({ id: "label", label: SI(1649, "Hide"), enabled: !1, run() {} }));
            }
            const a = EV.join(r, o);
            (this._options?.resetMenu && !n && (n = [this._options.resetMenu]),
              l &&
                n &&
                (a.push(new EV()),
                a.push(
                  DV({
                    id: "resetThisMenu",
                    label: SI(1650, "Reset Menu"),
                    run: () => this._menuService.resetHiddenStates(n),
                  }),
                )),
              0 !== a.length &&
                this._contextMenuService.showContextMenu({
                  getAnchor: () => t,
                  getActions: () => a,
                  menuId: this._options?.contextMenu,
                  menuActionOptions: { renderShortTitle: !0, ...this._options?.menuOptions },
                  skipTelemetry: "string" == typeof this._options?.telemetrySource,
                  contextKeyService: this._contextKeyService,
                }));
          }),
        ));
  }
};
Gue = que([Kue(2, AW), Kue(3, xW), Kue(4, cde), Kue(5, N5), Kue(6, PV), Kue(7, HW)], Gue);
let Zue = class extends Gue {
  get onDidChangeMenuItems() {
    return this._onDidChangeMenuItems.event;
  }
  constructor(e, t, n, i, r, o, s, a, l, c, d) {
    (super(
      e,
      {
        resetMenu: t,
        ...n,
        actionViewItemProvider: (i, r) => {
          let o = c.lookUp(t, i instanceof FW ? i.item.submenu.id : i.id);
          o || (o = n?.actionViewItemProvider);
          const s = o?.(i, r, d, MF(e).vscodeWindowId);
          return s || Oue(d, i, r);
        },
      },
      i,
      r,
      o,
      s,
      a,
      l,
    ),
      (this._onDidChangeMenuItems = this._store.add(new QO())));
    const u = this._store.add(
        i.createMenu(t, r, {
          emitEventsForSubmenuChanges: !0,
          eventDebounceDelay: n?.eventDebounceDelay,
        }),
      ),
      h = () => {
        const { primary: t, secondary: i } = kue(
          u.getActions(n?.menuOptions),
          n?.toolbarOptions?.primaryGroup,
          n?.toolbarOptions?.shouldInlineSubmenu,
          n?.toolbarOptions?.useSeparatorsInPrimaryActions,
        );
        (e.classList.toggle("has-no-actions", 0 === t.length && 0 === i.length),
          super.setActions(t, i));
      };
    (this._store.add(
      u.onDidChange(() => {
        (h(), this._onDidChangeMenuItems.fire(this));
      }),
    ),
      this._store.add(
        c.onDidChange((e) => {
          e === t && h();
        }),
      ),
      h());
  }
  setActions() {
    throw new QI("This toolbar is populated from a menu.");
  }
};
Zue = que(
  [
    Kue(3, AW),
    Kue(4, xW),
    Kue(5, cde),
    Kue(6, N5),
    Kue(7, PV),
    Kue(8, HW),
    Kue(9, $ue),
    Kue(10, vV),
  ],
  Zue,
);
var Yue = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const Xue = bV("hoverService");
let Que = class extends PO {
  get delay() {
    return this.isInstantlyHovering()
      ? 0
      : this.hoverOptions?.dynamicDelay
        ? (e) => this.hoverOptions?.dynamicDelay?.(e) ?? this._delay
        : this._delay;
  }
  constructor(e, t, n = {}, i, r) {
    (super(),
      (this.placement = e),
      (this.hoverOptions = t),
      (this.overrideOptions = n),
      (this.configurationService = i),
      (this.hoverService = r),
      (this.lastHoverHideTime = 0),
      (this.timeLimit = 200),
      (this.hoverDisposables = this._register(new AO())),
      (this._delay = this.configurationService.getValue("workbench.hover.delay")),
      this._register(
        this.configurationService.onDidChangeConfiguration((e) => {
          e.affectsConfiguration("workbench.hover.delay") &&
            (this._delay = this.configurationService.getValue("workbench.hover.delay"));
        }),
      ));
  }
  showHover(e, t) {
    const n =
      "function" == typeof this.overrideOptions ? this.overrideOptions(e, t) : this.overrideOptions;
    this.hoverDisposables.clear();
    const i = SB(e.target) ? [e.target] : e.target.targetElements;
    for (const o of i)
      this.hoverDisposables.add(
        KF(o, "keydown", (e) => {
          e.equals(9) && this.hoverService.hideHover();
        }),
      );
    const r = SB(e.content)
      ? void 0
      : "string" == typeof e.content
        ? e.content.toString()
        : e.content.value;
    return this.hoverService.showInstantHover(
      {
        ...e,
        ...n,
        persistence: { hideOnKeyDown: !0, ...n.persistence },
        id: r,
        appearance: {
          ...e.appearance,
          compact: !0,
          skipFadeInAnimation: this.isInstantlyHovering(),
          ...n.appearance,
        },
      },
      t,
    );
  }
  isInstantlyHovering() {
    return (
      !!this.hoverOptions?.instantHover && Date.now() - this.lastHoverHideTime < this.timeLimit
    );
  }
  onDidHideHover() {
    (this.hoverDisposables.clear(),
      this.hoverOptions?.instantHover && (this.lastHoverHideTime = Date.now()));
  }
};
Que = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Yue(3, OU), Yue(4, Xue)], Que);
const Jue = {
  showHover: function () {
    throw new Error("Native hover function not implemented.");
  },
  delay: 0,
  showNativeHover: !0,
};
class ehe extends r3 {
  constructor(e) {
    (super(), (this._textModel = e));
  }
  getValueOfRange(e) {
    return this._textModel.getValueInRange(e);
  }
  getLineLength(e) {
    return this._textModel.getLineLength(e);
  }
  get length() {
    const e = this._textModel.getLineCount(),
      t = this._textModel.getLineLength(e);
    return new e3(e - 1, t);
  }
}
class the extends kV {
  constructor(e) {
    (super(), (this._getContext = e));
  }
  runAction(e, t) {
    const n = this._getContext();
    return super.runAction(e, n);
  }
}
class nhe extends PO {
  constructor(e, t, n) {
    (super(),
      (this._editor = e),
      (this._domNode = t),
      (this.itemProvider = n),
      (this.scrollTop = gF(this, this._editor.onDidScrollChange, (e) =>
        this._editor.getScrollTop(),
      )),
      (this.isScrollTopZero = this.scrollTop.map((e) => 0 === e)),
      (this.modelAttached = gF(this, this._editor.onDidChangeModel, (e) =>
        this._editor.hasModel(),
      )),
      (this.editorOnDidChangeViewZones = $ce(
        "onDidChangeViewZones",
        this._editor.onDidChangeViewZones,
      )),
      (this.editorOnDidContentSizeChange = $ce(
        "onDidContentSizeChange",
        this._editor.onDidContentSizeChange,
      )),
      (this.domNodeSizeChanged = A9("domNodeSizeChanged")),
      (this.views = new Map()),
      (this._domNode.className = "gutter monaco-editor"));
    const i = this._domNode.appendChild(
        GB("div.scroll-decoration", {
          role: "presentation",
          ariaHidden: "true",
          style: { width: "100%" },
        }).root,
      ),
      r = new ResizeObserver(() => {
        cF((e) => {
          this.domNodeSizeChanged.trigger(e);
        });
      });
    (r.observe(this._domNode),
      this._register(MO(() => r.disconnect())),
      this._register(
        rF((e) => {
          i.className = this.isScrollTopZero.read(e) ? "" : "scroll-decoration";
        }),
      ),
      this._register(rF((e) => this.render(e))));
  }
  dispose() {
    (super.dispose(), PB(this._domNode));
  }
  render(e) {
    if (!this.modelAttached.read(e)) return;
    (this.domNodeSizeChanged.read(e),
      this.editorOnDidChangeViewZones.read(e),
      this.editorOnDidContentSizeChange.read(e));
    const t = this.scrollTop.read(e),
      n = this._editor.getVisibleRanges(),
      i = new Set(this.views.keys()),
      r = N$.ofStartAndLength(0, this._domNode.clientHeight);
    if (!r.isEmpty)
      for (const o of n) {
        const n = new Q5(o.startLineNumber, o.endLineNumber + 1),
          s = this.itemProvider.getIntersectingGutterItems(n, e);
        cF((e) => {
          for (const o of s) {
            if (!o.range.intersect(n)) continue;
            i.delete(o.id);
            let s = this.views.get(o.id);
            if (s) s.item.set(o, e);
            else {
              const e = document.createElement("div");
              this._domNode.appendChild(e);
              const t = LF("item", o),
                n = this.itemProvider.createView(t, e);
              ((s = new ihe(t, n, e)), this.views.set(o.id, s));
            }
            const a =
                o.range.startLineNumber <= this._editor.getModel().getLineCount()
                  ? this._editor.getTopForLineNumber(o.range.startLineNumber, !0) - t
                  : o.range.startLineNumber > 1
                    ? this._editor.getBottomForLineNumber(o.range.startLineNumber - 1, !1) - t
                    : 0,
              l =
                (1 === o.range.endLineNumberExclusive
                  ? Math.max(a, this._editor.getTopForLineNumber(o.range.startLineNumber, !1) - t)
                  : Math.max(
                      a,
                      this._editor.getBottomForLineNumber(o.range.endLineNumberExclusive - 1, !0) -
                        t,
                    )) - a;
            ((s.domNode.style.top = `${a}px`),
              (s.domNode.style.height = `${l}px`),
              s.gutterItemView.layout(N$.ofStartAndLength(a, l), r));
          }
        });
      }
    for (const o of i) {
      const e = this.views.get(o);
      (e.gutterItemView.dispose(), e.domNode.remove(), this.views.delete(o));
    }
  }
}
class ihe {
  constructor(e, t, n) {
    ((this.item = e), (this.gutterItemView = t), (this.domNode = n));
  }
}
var rhe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  ohe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const she = [];
let ahe = class extends PO {
  constructor(e, t, n, i, r, o, s, a, l) {
    var c, d;
    (super(),
      (this._diffModel = t),
      (this._editors = n),
      (this._options = i),
      (this._sashLayout = r),
      (this._boundarySashes = o),
      (this._instantiationService = s),
      (this._contextKeyService = a),
      (this._menuService = l),
      (this._menu = this._register(
        this._menuService.createMenu(MW.DiffEditorHunkToolbar, this._contextKeyService),
      )),
      (this._actions = gF(this, this._menu.onDidChange, () => this._menu.getActions())),
      (this._hasActions = this._actions.map((e) => e.length > 0)),
      (this._showSash = Xj(
        this,
        (e) => this._options.renderSideBySide.read(e) && this._hasActions.read(e),
      )),
      (this.width = Xj(this, (e) => (this._hasActions.read(e) ? 35 : 0))),
      (this.elements = GB(
        "div.gutter@gutter",
        { style: { position: "absolute", height: "100%", width: "35px" } },
        [],
      )),
      (this._currentDiff = Xj(this, (e) => {
        const t = this._diffModel.read(e);
        if (!t) return;
        const n = t.diff.read(e)?.mappings,
          i = this._editors.modifiedCursor.read(e);
        return i ? n?.find((e) => e.lineRangeMapping.modified.contains(i.lineNumber)) : void 0;
      })),
      (this._selectedDiffs = Xj(this, (e) => {
        const t = this._diffModel.read(e),
          n = t?.diff.read(e);
        if (!n) return she;
        const i = this._editors.modifiedSelections.read(e);
        if (i.every((e) => e.isEmpty())) return she;
        const r = new J5(i.map((e) => Q5.fromRangeInclusive(e))),
          o = n.mappings.filter(
            (e) => e.lineRangeMapping.innerChanges && r.intersects(e.lineRangeMapping.modified),
          ),
          s = o.map((e) => ({
            mapping: e,
            rangeMappings: e.lineRangeMapping.innerChanges.filter((e) =>
              i.some((t) => YH.areIntersecting(e.modifiedRange, t)),
            ),
          }));
        return 0 === s.length || s.every((e) => 0 === e.rangeMappings.length) ? she : s;
      })),
      this._register(
        ((c = e),
        (d = this.elements.root),
        c.prepend(d),
        MO(() => {
          d.remove();
        })),
      ),
      this._register(
        $F(this.elements.root, "click", () => {
          this._editors.modified.focus();
        }),
      ),
      this._register(
        Ile(this.elements.root, { display: this._hasActions.map((e) => (e ? "block" : "none")) }),
      ),
      tF(this, (t) =>
        this._showSash.read(t)
          ? new jde(
              e,
              this._sashLayout.dimensions,
              this._options.enableSplitViewResizing,
              this._boundarySashes,
              Qj(
                this,
                (e) => this._sashLayout.sashLeft.read(e) - 35,
                (e, t) => this._sashLayout.sashLeft.set(e + 35, t),
              ),
              () => this._sashLayout.resetSash(),
            )
          : void 0,
      ).recomputeInitiallyAndOnChange(this._store));
    const u = Xj(this, (e) => {
      const t = this._diffModel.read(e);
      if (!t) return [];
      const n = t.diff.read(e);
      if (!n) return [];
      const i = this._selectedDiffs.read(e);
      if (i.length > 0) {
        const e = Wle.fromRangeMappings(i.flatMap((e) => e.rangeMappings));
        return [
          new lhe(
            e,
            !0,
            MW.DiffEditorSelectionToolbar,
            void 0,
            t.model.original.uri,
            t.model.modified.uri,
          ),
        ];
      }
      const r = this._currentDiff.read(e);
      return n.mappings.map(
        (e) =>
          new lhe(
            e.lineRangeMapping.withInnerChangesFromLineRanges(),
            e.lineRangeMapping === r?.lineRangeMapping,
            MW.DiffEditorHunkToolbar,
            void 0,
            t.model.original.uri,
            t.model.modified.uri,
          ),
      );
    });
    (this._register(
      new nhe(this._editors.modified, this.elements.root, {
        getIntersectingGutterItems: (e, t) => u.read(t),
        createView: (e, t) => this._instantiationService.createInstance(che, e, t, this),
      }),
    ),
      this._register(
        $F(
          this.elements.gutter,
          DB.MOUSE_WHEEL,
          (e) => {
            this._editors.modified.getOption(117).handleMouseWheel &&
              this._editors.modified.delegateScrollFromMouseWheelEvent(e);
          },
          { passive: !1 },
        ),
      ));
  }
  computeStagedValue(e) {
    const t = e.innerChanges ?? [],
      n = new ehe(this._editors.modifiedModel.get()),
      i = new ehe(this._editors.original.getModel()),
      r = new l3(t.map((e) => e.toTextEdit(n)));
    return r.apply(i);
  }
  layout(e) {
    this.elements.gutter.style.left = e + "px";
  }
};
ahe = rhe([ohe(6, vV), ohe(7, xW), ohe(8, AW)], ahe);
class lhe {
  constructor(e, t, n, i, r, o) {
    ((this.mapping = e),
      (this.showAlways = t),
      (this.menuId = n),
      (this.rangeOverride = i),
      (this.originalUri = r),
      (this.modifiedUri = o));
  }
  get id() {
    return this.mapping.modified.toString();
  }
  get range() {
    return this.rangeOverride ?? this.mapping.modified;
  }
}
let che = class extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._item = e),
      (this._elements = GB("div.gutterItem", { style: { height: "20px", width: "34px" } }, [
        GB("div.background@background", {}, []),
        GB("div.buttons@buttons", {}, []),
      ])),
      (this._showAlways = this._item.map(this, (e) => e.showAlways)),
      (this._menuId = this._item.map(this, (e) => e.menuId)),
      (this._isSmall = LF(this, !1)),
      (this._lastItemRange = void 0),
      (this._lastViewRange = void 0));
    const r = this._register(
      i.createInstance(Que, "element", { instantHover: !0 }, { position: { hoverPosition: 1 } }),
    );
    (this._register(kle(t, this._elements.root)),
      this._register(
        rF((e) => {
          const t = this._showAlways.read(e);
          (this._elements.root.classList.toggle("noTransition", !0),
            this._elements.root.classList.toggle("showAlways", t),
            setTimeout(() => {
              this._elements.root.classList.toggle("noTransition", !1);
            }, 0));
        }),
      ),
      this._register(
        aF((e, t) => {
          this._elements.buttons.replaceChildren();
          const o = t.add(
            i.createInstance(Zue, this._elements.buttons, this._menuId.read(e), {
              orientation: 1,
              hoverDelegate: r,
              toolbarOptions: { primaryGroup: (e) => e.startsWith("primary") },
              overflowBehavior: { maxItems: this._isSmall.read(e) ? 1 : 3 },
              hiddenItemStrategy: 0,
              actionRunner: t.add(
                new the(() => {
                  const e = this._item.read(void 0),
                    t = e.mapping;
                  return {
                    mapping: t,
                    originalWithModifiedChanges: n.computeStagedValue(t),
                    originalUri: e.originalUri,
                    modifiedUri: e.modifiedUri,
                  };
                }),
              ),
              menuOptions: { shouldForwardArgs: !0 },
            }),
          );
          t.add(
            o.onDidChangeMenuItems(() => {
              this._lastItemRange && this.layout(this._lastItemRange, this._lastViewRange);
            }),
          );
        }),
      ));
  }
  layout(e, t) {
    ((this._lastItemRange = e), (this._lastViewRange = t));
    let n = this._elements.buttons.clientHeight;
    (this._isSmall.set(
      1 === this._item.get().mapping.original.startLineNumber && e.length < 30,
      void 0,
    ),
      (n = this._elements.buttons.clientHeight));
    const i = e.length / 2 - n / 2,
      r = n;
    let o = e.start + i;
    const s = N$.tryCreate(r, t.endExclusive - r - n),
      a = N$.tryCreate(e.start + r, e.endExclusive - n - r);
    (a && s && a.start < a.endExclusive && ((o = s.clip(o)), (o = a.clip(o))),
      (this._elements.buttons.style.top = o - e.start + "px"));
  }
};
che = rhe([ohe(3, vV)], che);
var dhe;
let uhe = class extends PO {
  static {
    dhe = this;
  }
  static {
    this._breadcrumbsSourceFactory = LF(this, () => ({
      dispose() {},
      getBreadcrumbItems: (e, t) => [],
    }));
  }
  static setBreadcrumbsSourceFactory(e) {
    this._breadcrumbsSourceFactory.set(e, void 0);
  }
  get isUpdatingHiddenAreas() {
    return this._isUpdatingHiddenAreas;
  }
  constructor(e, t, n, i) {
    (super(),
      (this._editors = e),
      (this._diffModel = t),
      (this._options = n),
      (this._instantiationService = i),
      (this._modifiedOutlineSource = tF(this, (e) => {
        const t = this._editors.modifiedModel.read(e),
          n = dhe._breadcrumbsSourceFactory.read(e);
        return t && n ? n(t, this._instantiationService) : void 0;
      })),
      (this._isUpdatingHiddenAreas = !1),
      this._register(
        this._editors.original.onDidChangeCursorPosition((e) => {
          if (1 === e.reason) return;
          const t = this._diffModel.get();
          cF((e) => {
            for (const n of this._editors.original.getSelections() || [])
              (t?.ensureOriginalLineIsVisible(n.getStartPosition().lineNumber, 0, e),
                t?.ensureOriginalLineIsVisible(n.getEndPosition().lineNumber, 0, e));
          });
        }),
      ),
      this._register(
        this._editors.modified.onDidChangeCursorPosition((e) => {
          if (1 === e.reason) return;
          const t = this._diffModel.get();
          cF((e) => {
            for (const n of this._editors.modified.getSelections() || [])
              (t?.ensureModifiedLineIsVisible(n.getStartPosition().lineNumber, 0, e),
                t?.ensureModifiedLineIsVisible(n.getEndPosition().lineNumber, 0, e));
          });
        }),
      ));
    const r = this._diffModel.map((e, t) => {
      const n = e?.unchangedRegions.read(t) ?? [];
      return 1 === n.length &&
        1 === n[0].modifiedLineNumber &&
        n[0].lineCount === this._editors.modifiedModel.read(t)?.getLineCount()
        ? []
        : n;
    });
    this.viewZones = Xj(this, (e) => {
      const t = this._modifiedOutlineSource.read(e);
      if (!t) return { origViewZones: [], modViewZones: [] };
      const n = [],
        i = [],
        o = this._options.renderSideBySide.read(e),
        s = this._options.compactMode.read(e),
        a = r.read(e);
      for (let r = 0; r < a.length; r++) {
        const l = a[r];
        if (!l.shouldHideControls(e) && (!s || (0 !== r && r !== a.length - 1)))
          if (s) {
            {
              const t = Xj(this, (e) => l.getHiddenOriginalRange(e).startLineNumber - 1),
                i = new Dle(t, 12);
              (n.push(i), e.store.add(new hhe(this._editors.original, i, l, !o)));
            }
            {
              const t = Xj(this, (e) => l.getHiddenModifiedRange(e).startLineNumber - 1),
                n = new Dle(t, 12);
              (i.push(n), e.store.add(new hhe(this._editors.modified, n, l)));
            }
          } else {
            {
              const i = Xj(this, (e) => l.getHiddenOriginalRange(e).startLineNumber - 1),
                r = new Dle(i, 24);
              (n.push(r),
                e.store.add(
                  new ghe(
                    this._editors.original,
                    r,
                    l,
                    l.originalUnchangedRange,
                    !o,
                    t,
                    (e) => this._diffModel.get().ensureModifiedLineIsVisible(e, 2, void 0),
                    this._options,
                  ),
                ));
            }
            {
              const n = Xj(this, (e) => l.getHiddenModifiedRange(e).startLineNumber - 1),
                r = new Dle(n, 24);
              (i.push(r),
                e.store.add(
                  new ghe(
                    this._editors.modified,
                    r,
                    l,
                    l.modifiedUnchangedRange,
                    !1,
                    t,
                    (e) => this._diffModel.get().ensureModifiedLineIsVisible(e, 2, void 0),
                    this._options,
                  ),
                ));
            }
          }
      }
      return { origViewZones: n, modViewZones: i };
    });
    const o = {
        description: "unchanged lines",
        className: "diff-unchanged-lines",
        isWholeLine: !0,
      },
      s = {
        description: "Fold Unchanged",
        glyphMarginHoverMessage: new rre(void 0, {
          isTrusted: !0,
          supportThemeIcons: !0,
        }).appendMarkdown(SI(124, "Fold Unchanged Region")),
        glyphMarginClassName: "fold-unchanged " + AV.asClassName(OV.fold),
        zIndex: 10001,
      };
    (this._register(
      Sle(
        this._editors.original,
        Xj(this, (e) => {
          const t = r.read(e),
            n = t.map((e) => ({ range: e.originalUnchangedRange.toInclusiveRange(), options: o }));
          for (const i of t)
            i.shouldHideControls(e) &&
              n.push({ range: YH.fromPositions(new xV(i.originalLineNumber, 1)), options: s });
          return n;
        }),
      ),
    ),
      this._register(
        Sle(
          this._editors.modified,
          Xj(this, (e) => {
            const t = r.read(e),
              n = t.map((e) => ({
                range: e.modifiedUnchangedRange.toInclusiveRange(),
                options: o,
              }));
            for (const i of t)
              i.shouldHideControls(e) &&
                n.push({
                  range: Q5.ofLength(i.modifiedLineNumber, 1).toInclusiveRange(),
                  options: s,
                });
            return n;
          }),
        ),
      ),
      this._register(
        rF((e) => {
          const t = r.read(e);
          this._isUpdatingHiddenAreas = !0;
          try {
            (this._editors.original.setHiddenAreas(
              t.map((t) => t.getHiddenOriginalRange(e).toInclusiveRange()).filter(hR),
            ),
              this._editors.modified.setHiddenAreas(
                t.map((t) => t.getHiddenModifiedRange(e).toInclusiveRange()).filter(hR),
              ));
          } finally {
            this._isUpdatingHiddenAreas = !1;
          }
        }),
      ),
      this._register(
        this._editors.modified.onMouseUp((e) => {
          if (
            !e.event.rightButton &&
            e.target.position &&
            e.target.element?.className.includes("fold-unchanged")
          ) {
            const t = e.target.position.lineNumber,
              n = this._diffModel.get();
            if (!n) return;
            const i = n.unchangedRegions.get().find((e) => e.modifiedUnchangedRange.contains(t));
            if (!i) return;
            (i.collapseAll(void 0), e.event.stopPropagation(), e.event.preventDefault());
          }
        }),
      ),
      this._register(
        this._editors.original.onMouseUp((e) => {
          if (
            !e.event.rightButton &&
            e.target.position &&
            e.target.element?.className.includes("fold-unchanged")
          ) {
            const t = e.target.position.lineNumber,
              n = this._diffModel.get();
            if (!n) return;
            const i = n.unchangedRegions.get().find((e) => e.originalUnchangedRange.contains(t));
            if (!i) return;
            (i.collapseAll(void 0), e.event.stopPropagation(), e.event.preventDefault());
          }
        }),
      ));
  }
};
uhe = dhe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(3, vV),
  ],
  uhe,
);
class hhe extends Lle {
  constructor(e, t, n, i = !1) {
    const r = GB("div.diff-hidden-lines-widget");
    (super(e, t, r.root),
      (this._unchangedRegion = n),
      (this._hide = i),
      (this._nodes = GB("div.diff-hidden-lines-compact", [
        GB("div.line-left", []),
        GB("div.text@text", []),
        GB("div.line-right", []),
      ])),
      r.root.appendChild(this._nodes.root),
      this._hide && this._nodes.root.replaceChildren(),
      this._register(
        rF((e) => {
          if (!this._hide) {
            const t = SI(
              125,
              "{0} hidden lines",
              this._unchangedRegion.getHiddenModifiedRange(e).length,
            );
            this._nodes.text.innerText = t;
          }
        }),
      ));
  }
}
class ghe extends Lle {
  constructor(e, t, n, i, r, o, s, a) {
    const l = GB("div.diff-hidden-lines-widget");
    (super(e, t, l.root),
      (this._editor = e),
      (this._unchangedRegion = n),
      (this._unchangedRegionRange = i),
      (this._hide = r),
      (this._modifiedOutlineSource = o),
      (this._revealModifiedHiddenLine = s),
      (this._options = a),
      (this._nodes = GB("div.diff-hidden-lines", [
        GB("div.top@top", { title: SI(126, "Click or drag to show more above") }),
        GB("div.center@content", { style: { display: "flex" } }, [
          GB(
            "div@first",
            {
              style: {
                display: "flex",
                justifyContent: "center",
                alignItems: "center",
                flexShrink: "0",
              },
            },
            [
              VB(
                "a",
                {
                  title: SI(127, "Show Unchanged Region"),
                  role: "button",
                  onclick: () => {
                    this._unchangedRegion.showAll(void 0);
                  },
                },
                ...Wse("$(unfold)"),
              ),
            ],
          ),
          GB("div@others", {
            style: { display: "flex", justifyContent: "center", alignItems: "center" },
          }),
        ]),
        GB("div.bottom@bottom", {
          title: SI(128, "Click or drag to show more below"),
          role: "button",
        }),
      ])),
      l.root.appendChild(this._nodes.root),
      this._hide
        ? PB(this._nodes.first)
        : this._register(
            Ile(this._nodes.first, { width: xde(this._editor).layoutInfoContentLeft }),
          ),
      this._register(
        rF((e) => {
          const t =
            this._unchangedRegion.visibleLineCountTop.read(e) +
              this._unchangedRegion.visibleLineCountBottom.read(e) ===
            this._unchangedRegion.lineCount;
          (this._nodes.bottom.classList.toggle("canMoveTop", !t),
            this._nodes.bottom.classList.toggle(
              "canMoveBottom",
              this._unchangedRegion.visibleLineCountBottom.read(e) > 0,
            ),
            this._nodes.top.classList.toggle(
              "canMoveTop",
              this._unchangedRegion.visibleLineCountTop.read(e) > 0,
            ),
            this._nodes.top.classList.toggle("canMoveBottom", !t));
          const n = this._unchangedRegion.isDragged.read(e),
            i = this._editor.getDomNode();
          i &&
            (i.classList.toggle("draggingUnchangedRegion", !!n),
            "top" === n
              ? (i.classList.toggle(
                  "canMoveTop",
                  this._unchangedRegion.visibleLineCountTop.read(e) > 0,
                ),
                i.classList.toggle("canMoveBottom", !t))
              : "bottom" === n
                ? (i.classList.toggle("canMoveTop", !t),
                  i.classList.toggle(
                    "canMoveBottom",
                    this._unchangedRegion.visibleLineCountBottom.read(e) > 0,
                  ))
                : (i.classList.toggle("canMoveTop", !1), i.classList.toggle("canMoveBottom", !1)));
        }),
      ));
    const c = this._editor;
    (this._register(
      $F(this._nodes.top, "mousedown", (e) => {
        if (0 !== e.button) return;
        (this._nodes.top.classList.toggle("dragging", !0),
          this._nodes.root.classList.toggle("dragging", !0),
          e.preventDefault());
        const t = e.clientY;
        let n = !1;
        const i = this._unchangedRegion.visibleLineCountTop.get();
        this._unchangedRegion.isDragged.set("top", void 0);
        const r = MF(this._nodes.top),
          o = $F(r, "mousemove", (e) => {
            const r = e.clientY - t;
            n = n || Math.abs(r) > 2;
            const o = Math.round(r / c.getOption(75)),
              s = Math.max(0, Math.min(i + o, this._unchangedRegion.getMaxVisibleLineCountTop()));
            this._unchangedRegion.visibleLineCountTop.set(s, void 0);
          }),
          s = $F(r, "mouseup", (e) => {
            (n ||
              this._unchangedRegion.showMoreAbove(
                this._options.hideUnchangedRegionsRevealLineCount.get(),
                void 0,
              ),
              this._nodes.top.classList.toggle("dragging", !1),
              this._nodes.root.classList.toggle("dragging", !1),
              this._unchangedRegion.isDragged.set(void 0, void 0),
              o.dispose(),
              s.dispose());
          });
      }),
    ),
      this._register(
        $F(this._nodes.bottom, "mousedown", (e) => {
          if (0 !== e.button) return;
          (this._nodes.bottom.classList.toggle("dragging", !0),
            this._nodes.root.classList.toggle("dragging", !0),
            e.preventDefault());
          const t = e.clientY;
          let n = !1;
          const i = this._unchangedRegion.visibleLineCountBottom.get();
          this._unchangedRegion.isDragged.set("bottom", void 0);
          const r = MF(this._nodes.bottom),
            o = $F(r, "mousemove", (e) => {
              const r = e.clientY - t;
              n = n || Math.abs(r) > 2;
              const o = Math.round(r / c.getOption(75)),
                s = Math.max(
                  0,
                  Math.min(i - o, this._unchangedRegion.getMaxVisibleLineCountBottom()),
                ),
                a =
                  this._unchangedRegionRange.endLineNumberExclusive > c.getModel().getLineCount()
                    ? c.getContentHeight()
                    : c.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
              this._unchangedRegion.visibleLineCountBottom.set(s, void 0);
              const l =
                this._unchangedRegionRange.endLineNumberExclusive > c.getModel().getLineCount()
                  ? c.getContentHeight()
                  : c.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
              c.setScrollTop(c.getScrollTop() + (l - a));
            }),
            s = $F(r, "mouseup", (e) => {
              if ((this._unchangedRegion.isDragged.set(void 0, void 0), !n)) {
                const e = c.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
                this._unchangedRegion.showMoreBelow(
                  this._options.hideUnchangedRegionsRevealLineCount.get(),
                  void 0,
                );
                const t = c.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
                c.setScrollTop(c.getScrollTop() + (t - e));
              }
              (this._nodes.bottom.classList.toggle("dragging", !1),
                this._nodes.root.classList.toggle("dragging", !1),
                o.dispose(),
                s.dispose());
            });
        }),
      ),
      this._register(
        rF((e) => {
          const t = [];
          if (!this._hide) {
            const i = SI(129, "{0} hidden lines", n.getHiddenModifiedRange(e).length),
              r = VB("span", { title: SI(130, "Double click to unfold") }, i);
            (r.addEventListener("dblclick", (e) => {
              0 === e.button && (e.preventDefault(), this._unchangedRegion.showAll(void 0));
            }),
              t.push(r));
            const o = this._unchangedRegion.getHiddenModifiedRange(e),
              s = this._modifiedOutlineSource.getBreadcrumbItems(o, e);
            if (s.length > 0) {
              t.push(VB("span", void 0, "  |  "));
              for (let e = 0; e < s.length; e++) {
                const n = s[e],
                  i = GB(
                    "div.breadcrumb-item",
                    { style: { display: "flex", alignItems: "center" } },
                    [
                      Hse(S2.toIcon(n.kind)),
                      " ",
                      n.name,
                      ...(e === s.length - 1 ? [] : [Hse(OV.chevronRight)]),
                    ],
                  ).root;
                (t.push(i),
                  (i.onclick = () => {
                    this._revealModifiedHiddenLine(n.startLineNumber);
                  }));
              }
            }
          }
          PB(this._nodes.others, ...t);
        }),
      ));
  }
}
const phe = [];
class fhe extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._editors = e),
      (this._diffModel = t),
      (this._options = n),
      (this._widget = i),
      (this._selectedDiffs = Xj(this, (e) => {
        const t = this._diffModel.read(e),
          n = t?.diff.read(e);
        if (!n) return phe;
        const i = this._editors.modifiedSelections.read(e);
        if (i.every((e) => e.isEmpty())) return phe;
        const r = new J5(i.map((e) => Q5.fromRangeInclusive(e))),
          o = n.mappings.filter(
            (e) => e.lineRangeMapping.innerChanges && r.intersects(e.lineRangeMapping.modified),
          ),
          s = o.map((e) => ({
            mapping: e,
            rangeMappings: e.lineRangeMapping.innerChanges.filter((e) =>
              i.some((t) => YH.areIntersecting(e.modifiedRange, t)),
            ),
          }));
        return 0 === s.length || s.every((e) => 0 === e.rangeMappings.length) ? phe : s;
      })),
      this._register(
        aF((e, t) => {
          if (!this._options.shouldRenderOldRevertArrows.read(e)) return;
          const n = this._diffModel.read(e),
            i = n?.diff.read(e);
          if (!n || !i) return;
          if (n.movedTextToCompare.read(e)) return;
          const r = [],
            o = this._selectedDiffs.read(e),
            s = new Set(o.map((e) => e.mapping));
          if (o.length > 0) {
            const n = this._editors.modifiedSelections.read(e),
              i = t.add(
                new mhe(
                  n[n.length - 1].positionLineNumber,
                  this._widget,
                  o.flatMap((e) => e.rangeMappings),
                  !0,
                ),
              );
            (this._editors.modified.addGlyphMarginWidget(i), r.push(i));
          }
          for (const a of i.mappings)
            if (
              !s.has(a) &&
              !a.lineRangeMapping.modified.isEmpty &&
              a.lineRangeMapping.innerChanges
            ) {
              const e = t.add(
                new mhe(
                  a.lineRangeMapping.modified.startLineNumber,
                  this._widget,
                  a.lineRangeMapping,
                  !1,
                ),
              );
              (this._editors.modified.addGlyphMarginWidget(e), r.push(e));
            }
          t.add(
            MO(() => {
              for (const e of r) this._editors.modified.removeGlyphMarginWidget(e);
            }),
          );
        }),
      ));
  }
}
class mhe extends PO {
  static {
    this.counter = 0;
  }
  getId() {
    return this._id;
  }
  constructor(e, t, n, i) {
    (super(),
      (this._lineNumber = e),
      (this._widget = t),
      (this._diffs = n),
      (this._revertSelection = i),
      (this._id = "revertButton" + mhe.counter++),
      (this._domNode = GB(
        "div.revertButton",
        {
          title: this._revertSelection
            ? SI(135, "Revert Selected Changes")
            : SI(136, "Revert Change"),
        },
        [Hse(OV.arrowRight)],
      ).root),
      this._register(
        $F(this._domNode, DB.MOUSE_DOWN, (e) => {
          2 !== e.button && (e.stopPropagation(), e.preventDefault());
        }),
      ),
      this._register(
        $F(this._domNode, DB.MOUSE_UP, (e) => {
          (e.stopPropagation(), e.preventDefault());
        }),
      ),
      this._register(
        $F(this._domNode, DB.CLICK, (e) => {
          (this._diffs instanceof Fle
            ? this._widget.revert(this._diffs)
            : this._widget.revertRangeMappings(this._diffs),
            e.stopPropagation(),
            e.preventDefault());
        }),
      ));
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return {
      lane: $z.Right,
      range: {
        startColumn: 1,
        startLineNumber: this._lineNumber,
        endColumn: 1,
        endLineNumber: this._lineNumber,
      },
      zIndex: 10001,
    };
  }
}
var _he = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let vhe = class extends Fde {
  get onDidContentSizeChange() {
    return this._editors.onDidContentSizeChange;
  }
  constructor(e, t, n, i, r, o, s, a) {
    (super(),
      (this._domElement = e),
      (this._parentContextKeyService = i),
      (this._parentInstantiationService = r),
      (this._codeEditorService = o),
      (this._accessibilitySignalService = s),
      (this._editorProgressService = a),
      (this.elements = GB(
        "div.monaco-diff-editor.side-by-side",
        { style: { position: "relative", height: "100%" } },
        [
          GB("div.editor.original@original", { style: { position: "absolute", height: "100%" } }),
          GB("div.editor.modified@modified", { style: { position: "absolute", height: "100%" } }),
          GB("div.accessibleDiffViewer@accessibleDiffViewer", {
            style: { position: "absolute", height: "100%" },
          }),
        ],
      )),
      (this._diffModelSrc = this._register(TF(this, void 0))),
      (this._diffModel = Xj(this, (e) => this._diffModelSrc.read(e)?.object)),
      (this.onDidChangeModel = $O.fromObservableLight(this._diffModel)),
      (this._contextKeyService = this._register(
        this._parentContextKeyService.createScoped(this._domElement),
      )),
      (this._instantiationService = this._register(
        this._parentInstantiationService.createChild(new rne([xW, this._contextKeyService])),
      )),
      (this._boundarySashes = LF(this, void 0)),
      (this._accessibleDiffViewerShouldBeVisible = LF(this, !1)),
      (this._accessibleDiffViewerVisible = Xj(
        this,
        (e) =>
          !!this._options.onlyShowAccessibleDiffViewer.read(e) ||
          this._accessibleDiffViewerShouldBeVisible.read(e),
      )),
      (this._movedBlocksLinesPart = LF(this, void 0)),
      (this._layoutInfo = Xj(this, (e) => {
        const t = this._rootSizeObserver.width.read(e),
          n = this._rootSizeObserver.height.read(e);
        this._rootSizeObserver.automaticLayout
          ? (this.elements.root.style.height = "100%")
          : (this.elements.root.style.height = n + "px");
        const i = this._sash.read(e),
          r = this._gutter.read(e),
          o = r?.width.read(e) ?? 0,
          s = this._overviewRulerPart.read(e)?.width ?? 0;
        let a, l, c, d, u;
        if (!!i) {
          const n = i.sashLeft.read(e);
          ((a = 0),
            (l = n - o - (this._movedBlocksLinesPart.read(e)?.width.read(e) ?? 0)),
            (u = n - o),
            (c = n),
            (d = t - c - s));
        } else {
          u = 0;
          ((a = o),
            (l = this._options.inlineViewHideOriginalLineNumbers.read(e)
              ? 0
              : Math.max(5, this._editors.originalObs.layoutInfoDecorationsLeft.read(e))),
            (c = o + l),
            (d = t - c - s));
        }
        return (
          (this.elements.original.style.left = a + "px"),
          (this.elements.original.style.width = l + "px"),
          this._editors.original.layout({ width: l, height: n }, !0),
          r?.layout(u),
          (this.elements.modified.style.left = c + "px"),
          (this.elements.modified.style.width = d + "px"),
          this._editors.modified.layout({ width: d, height: n }, !0),
          {
            modifiedEditor: this._editors.modified.getLayoutInfo(),
            originalEditor: this._editors.original.getLayoutInfo(),
          }
        );
      })),
      (this._diffValue = this._diffModel.map((e, t) => e?.diff.read(t))),
      (this.onDidUpdateDiff = $O.fromObservableLight(this._diffValue)),
      this._codeEditorService.willCreateDiffEditor(),
      this._contextKeyService.createKey("isInDiffEditor", !0),
      this._domElement.appendChild(this.elements.root),
      this._register(MO(() => this.elements.root.remove())),
      (this._rootSizeObserver = this._register(new Ele(this.elements.root, t.dimension))),
      this._rootSizeObserver.setAutomaticLayout(t.automaticLayout ?? !1),
      (this._options = this._instantiationService.createInstance(Vde, t)),
      this._register(
        rF((e) => {
          this._options.setWidth(this._rootSizeObserver.width.read(e));
        }),
      ),
      this._contextKeyService.createKey($$.isEmbeddedDiffEditor.key, !1),
      this._register(
        Tne($$.isEmbeddedDiffEditor, this._contextKeyService, (e) =>
          this._options.isInEmbeddedEditor.read(e),
        ),
      ),
      this._register(
        Tne(
          $$.comparingMovedCode,
          this._contextKeyService,
          (e) => !!this._diffModel.read(e)?.movedTextToCompare.read(e),
        ),
      ),
      this._register(
        Tne($$.diffEditorRenderSideBySideInlineBreakpointReached, this._contextKeyService, (e) =>
          this._options.couldShowInlineViewBecauseOfSize.read(e),
        ),
      ),
      this._register(
        Tne(
          $$.diffEditorInlineMode,
          this._contextKeyService,
          (e) => !this._options.renderSideBySide.read(e),
        ),
      ),
      this._register(
        Tne(
          $$.hasChanges,
          this._contextKeyService,
          (e) => (this._diffModel.read(e)?.diff.read(e)?.mappings.length ?? 0) > 0,
        ),
      ),
      (this._editors = this._register(
        this._instantiationService.createInstance(
          Ede,
          this.elements.original,
          this.elements.modified,
          this._options,
          n,
          (e, t, n, i) => this._createInnerEditor(e, t, n, i),
        ),
      )),
      this._register(
        Tne($$.diffEditorOriginalWritable, this._contextKeyService, (e) =>
          this._options.originalEditable.read(e),
        ),
      ),
      this._register(
        Tne(
          $$.diffEditorModifiedWritable,
          this._contextKeyService,
          (e) => !this._options.readOnly.read(e),
        ),
      ),
      this._register(
        Tne(
          $$.diffEditorOriginalUri,
          this._contextKeyService,
          (e) => this._diffModel.read(e)?.model.original.uri.toString() ?? "",
        ),
      ),
      this._register(
        Tne(
          $$.diffEditorModifiedUri,
          this._contextKeyService,
          (e) => this._diffModel.read(e)?.model.modified.uri.toString() ?? "",
        ),
      ),
      (this._overviewRulerPart = tF(this, (e) =>
        this._options.renderOverviewRuler.read(e)
          ? this._instantiationService.createInstance(
              Cne(Sde),
              this._editors,
              this.elements.root,
              this._diffModel,
              this._rootSizeObserver.width,
              this._rootSizeObserver.height,
              this._layoutInfo.map((e) => e.modifiedEditor),
            )
          : void 0,
      ).recomputeInitiallyAndOnChange(this._store)));
    const l = {
      height: this._rootSizeObserver.height,
      width: this._rootSizeObserver.width.map(
        (e, t) => e - (this._overviewRulerPart.read(t)?.width ?? 0),
      ),
    };
    ((this._sashLayout = new Pde(this._options, l)),
      (this._sash = tF(this, (e) => {
        const t = this._options.renderSideBySide.read(e);
        return (
          this.elements.root.classList.toggle("side-by-side", t),
          t
            ? new jde(
                this.elements.root,
                l,
                this._options.enableSplitViewResizing,
                this._boundarySashes,
                this._sashLayout.sashLeft,
                () => this._sashLayout.resetSash(),
              )
            : void 0
        );
      }).recomputeInitiallyAndOnChange(this._store)));
    const c = tF(this, (e) =>
      this._instantiationService.createInstance(
        Cne(uhe),
        this._editors,
        this._diffModel,
        this._options,
      ),
    ).recomputeInitiallyAndOnChange(this._store);
    tF(this, (e) =>
      this._instantiationService.createInstance(
        Cne(bde),
        this._editors,
        this._diffModel,
        this._options,
        this,
      ),
    ).recomputeInitiallyAndOnChange(this._store);
    const d = new Set(),
      u = new Set();
    let h = !1;
    const g = tF(this, (e) =>
        this._instantiationService.createInstance(
          Cne(ude),
          MF(this._domElement),
          this._editors,
          this._diffModel,
          this._options,
          this,
          () => h || c.read(void 0).isUpdatingHiddenAreas,
          d,
          u,
        ),
      ).recomputeInitiallyAndOnChange(this._store),
      p = Xj(this, (e) => {
        const t = g.read(e).viewZones.read(e).orig,
          n = c.read(e).viewZones.read(e).origViewZones;
        return t.concat(n);
      }),
      f = Xj(this, (e) => {
        const t = g.read(e).viewZones.read(e).mod,
          n = c.read(e).viewZones.read(e).modViewZones;
        return t.concat(n);
      });
    let m;
    (this._register(
      Rle(
        this._editors.original,
        p,
        (e) => {
          h = e;
        },
        d,
      ),
    ),
      this._register(
        Rle(
          this._editors.modified,
          f,
          (e) => {
            ((h = e),
              h
                ? (m = Mne.capture(this._editors.modified))
                : (m?.restore(this._editors.modified), (m = void 0)));
          },
          u,
        ),
      ),
      (this._accessibleDiffViewer = tF(this, (e) =>
        this._instantiationService.createInstance(
          Cne(sce),
          this.elements.accessibleDiffViewer,
          this._accessibleDiffViewerVisible,
          (e, t) => this._accessibleDiffViewerShouldBeVisible.set(e, t),
          this._options.onlyShowAccessibleDiffViewer.map((e) => !e),
          this._rootSizeObserver.width,
          this._rootSizeObserver.height,
          this._diffModel.map((e, t) => e?.diff.read(t)?.mappings.map((e) => e.lineRangeMapping)),
          new mce(this._editors),
        ),
      ).recomputeInitiallyAndOnChange(this._store)));
    const _ = this._accessibleDiffViewerVisible.map((e) => (e ? "hidden" : "visible"));
    (this._register(Ile(this.elements.modified, { visibility: _ })),
      this._register(Ile(this.elements.original, { visibility: _ })),
      this._createDiffEditorContributions(),
      this._codeEditorService.addDiffEditor(this),
      this._register(
        MO(() => {
          this._codeEditorService.removeDiffEditor(this);
        }),
      ),
      (this._gutter = tF(this, (e) =>
        this._options.shouldRenderGutterMenu.read(e)
          ? this._instantiationService.createInstance(
              Cne(ahe),
              this.elements.root,
              this._diffModel,
              this._editors,
              this._options,
              this._sashLayout,
              this._boundarySashes,
            )
          : void 0,
      )),
      this._register(_F(this._layoutInfo)),
      tF(
        this,
        (e) =>
          new (Cne(mde))(
            this.elements.root,
            this._diffModel,
            this._layoutInfo.map((e) => e.originalEditor),
            this._layoutInfo.map((e) => e.modifiedEditor),
            this._editors,
          ),
      ).recomputeInitiallyAndOnChange(this._store, (e) => {
        this._movedBlocksLinesPart.set(e, void 0);
      }),
      this._register(
        $O.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, (e) =>
          this._handleCursorPositionChange(e, !0),
        ),
      ),
      this._register(
        $O.runAndSubscribe(this._editors.original.onDidChangeCursorPosition, (e) =>
          this._handleCursorPositionChange(e, !1),
        ),
      ));
    const v = this._diffModel.map(this, (e, t) => {
      if (e) return void 0 === e.diff.read(t) && !e.isDiffUpToDate.read(t);
    });
    (this._register(
      aF((e, t) => {
        if (!0 === v.read(e)) {
          const e = this._editorProgressService.show(!0, 1e3);
          t.add(MO(() => e.done()));
        }
      }),
    ),
      this._register(
        aF((e, t) => {
          t.add(new (Cne(fhe))(this._editors, this._diffModel, this._options, this));
        }),
      ),
      this._register(
        aF((e, t) => {
          const n = this._diffModel.read(e);
          if (n)
            for (const i of [n.model.original, n.model.modified])
              t.add(
                i.onWillDispose((e) => {
                  (HI(new QI("TextModel got disposed before DiffEditorWidget model got reset")),
                    this.setModel(null));
                }),
              );
        }),
      ),
      this._register(
        rF((e) => {
          this._options.setModel(this._diffModel.read(e));
        }),
      ));
  }
  _createInnerEditor(e, t, n, i) {
    return e.createInstance(ane, t, n, i);
  }
  _createDiffEditorContributions() {
    const e = UH.getDiffEditorContributions();
    for (const n of e)
      try {
        this._register(this._instantiationService.createInstance(n.ctor, this));
      } catch (t) {
        HI(t);
      }
  }
  get _targetEditor() {
    return this._editors.modified;
  }
  getEditorType() {
    return X3.IDiffEditor;
  }
  layout(e) {
    this._rootSizeObserver.observe(e);
  }
  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(e) {
    if (e && e.original && e.modified) {
      const t = e;
      (this._editors.original.restoreViewState(t.original),
        this._editors.modified.restoreViewState(t.modified),
        t.modelState && this._diffModel.get()?.restoreSerializedState(t.modelState));
    }
  }
  handleInitialized() {
    (this._editors.original.handleInitialized(), this._editors.modified.handleInitialized());
  }
  createViewModel(e) {
    return this._instantiationService.createInstance(Kce, e, this._options);
  }
  getModel() {
    return this._diffModel.get()?.model ?? null;
  }
  setModel(e) {
    const t = e
      ? "model" in e
        ? Ale.create(e).createNewRef(this)
        : Ale.create(this.createViewModel(e), this)
      : null;
    this.setDiffModel(t);
  }
  setDiffModel(e, t) {
    const n = this._diffModel.get();
    (!e && n && this._accessibleDiffViewer.get().close(),
      this._diffModel.get() !== e?.object &&
        uF(t, (t) => {
          const n = e?.object;
          gF.batchEventsGlobally(t, () => {
            (this._editors.original.setModel(n ? n.model.original : null),
              this._editors.modified.setModel(n ? n.model.modified : null));
          });
          const i = this._diffModelSrc.get()?.createNewRef(this);
          (this._diffModelSrc.set(e?.createNewRef(this), t),
            setTimeout(() => {
              i?.dispose();
            }, 0));
        }));
  }
  updateOptions(e) {
    this._options.updateOptions(e);
  }
  getContainerDomNode() {
    return this._domElement;
  }
  getOriginalEditor() {
    return this._editors.original;
  }
  getModifiedEditor() {
    return this._editors.modified;
  }
  getLineChanges() {
    const e = this._diffModel.get()?.diff.get();
    return e
      ? e.mappings.map((e) => {
          const t = e.lineRangeMapping;
          let n,
            i,
            r,
            o,
            s = t.innerChanges;
          return (
            t.original.isEmpty
              ? ((n = t.original.startLineNumber - 1), (i = 0), (s = void 0))
              : ((n = t.original.startLineNumber), (i = t.original.endLineNumberExclusive - 1)),
            t.modified.isEmpty
              ? ((r = t.modified.startLineNumber - 1), (o = 0), (s = void 0))
              : ((r = t.modified.startLineNumber), (o = t.modified.endLineNumberExclusive - 1)),
            {
              originalStartLineNumber: n,
              originalEndLineNumber: i,
              modifiedStartLineNumber: r,
              modifiedEndLineNumber: o,
              charChanges: s?.map((e) => ({
                originalStartLineNumber: e.originalRange.startLineNumber,
                originalStartColumn: e.originalRange.startColumn,
                originalEndLineNumber: e.originalRange.endLineNumber,
                originalEndColumn: e.originalRange.endColumn,
                modifiedStartLineNumber: e.modifiedRange.startLineNumber,
                modifiedStartColumn: e.modifiedRange.startColumn,
                modifiedEndLineNumber: e.modifiedRange.endLineNumber,
                modifiedEndColumn: e.modifiedRange.endColumn,
              })),
            }
          );
        })
      : null;
  }
  getDiffComputationResult() {
    const e = this._diffModel.get()?.diff.get();
    return e
      ? {
          changes: this.getLineChanges(),
          changes2: e.mappings.map((e) => e.lineRangeMapping),
          identical: e.identical,
          quitEarly: e.quitEarly,
        }
      : null;
  }
  revert(e) {
    const t = this._diffModel.get();
    t &&
      t.isDiffUpToDate.get() &&
      (this._editors.modified.pushUndoStop(),
      this._editors.modified.executeEdits("diffEditor", [
        {
          range: e.modified.toExclusiveRange(),
          text: t.model.original.getValueInRange(e.original.toExclusiveRange()),
        },
      ]),
      this._editors.modified.pushUndoStop());
  }
  revertRangeMappings(e) {
    const t = this._diffModel.get();
    if (!t || !t.isDiffUpToDate.get()) return;
    const n = e.map((e) => ({
      range: e.modifiedRange,
      text: t.model.original.getValueInRange(e.originalRange),
    }));
    (this._editors.modified.pushUndoStop(),
      this._editors.modified.executeEdits("diffEditor", n),
      this._editors.modified.pushUndoStop());
  }
  revertFocusedRangeMappings() {
    const e = this._diffModel.get();
    if (!e || !e.isDiffUpToDate.get()) return;
    const t = this._diffModel.get()?.diff.get()?.mappings;
    if (!t || 0 === t.length) return;
    const n = this._editors.modified;
    if (!n.hasTextFocus()) return;
    const i = n.getPosition().lineNumber,
      r = n.getSelection(),
      o = Q5.fromRange(r || new YH(i, 0, i, 0)),
      s = t.filter((e) => e.lineRangeMapping.modified.intersect(o));
    (n.pushUndoStop(),
      n.executeEdits(
        "diffEditor",
        s.map((t) => ({
          range: t.lineRangeMapping.modified.toExclusiveRange(),
          text: e.model.original.getValueInRange(t.lineRangeMapping.original.toExclusiveRange()),
        })),
      ),
      n.pushUndoStop());
  }
  _goTo(e) {
    (this._editors.modified.setPosition(new xV(e.lineRangeMapping.modified.startLineNumber, 1)),
      this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange()));
  }
  goToDiff(e) {
    const t = this._diffModel.get()?.diff.get()?.mappings;
    if (!t || 0 === t.length) return;
    const n = this._editors.modified.getPosition().lineNumber;
    let i;
    if ("next" === e) {
      i =
        this._editors.modified.getModel().getLineCount() === n
          ? t[0]
          : (t.find((e) => e.lineRangeMapping.modified.startLineNumber > n) ?? t[0]);
    } else i = R1(t, (e) => e.lineRangeMapping.modified.startLineNumber < n) ?? t[t.length - 1];
    (this._goTo(i),
      i.lineRangeMapping.modified.isEmpty
        ? this._accessibilitySignalService.playSignal(Lne.diffLineDeleted, {
            source: "diffEditor.goToDiff",
          })
        : i.lineRangeMapping.original.isEmpty
          ? this._accessibilitySignalService.playSignal(Lne.diffLineInserted, {
              source: "diffEditor.goToDiff",
            })
          : i &&
            this._accessibilitySignalService.playSignal(Lne.diffLineModified, {
              source: "diffEditor.goToDiff",
            }));
  }
  revealFirstDiff() {
    const e = this._diffModel.get();
    e &&
      this.waitForDiff().then(() => {
        const t = e.diff.get()?.mappings;
        t && 0 !== t.length && this._goTo(t[0]);
      });
  }
  accessibleDiffViewerNext() {
    this._accessibleDiffViewer.get().next();
  }
  accessibleDiffViewerPrev() {
    this._accessibleDiffViewer.get().prev();
  }
  async waitForDiff() {
    const e = this._diffModel.get();
    e && (await e.waitForDiff());
  }
  mapToOtherSide() {
    const e = this._editors.modified.hasWidgetFocus(),
      t = e ? this._editors.modified : this._editors.original,
      n = e ? this._editors.original : this._editors.modified;
    let i;
    const r = t.getSelection();
    if (r) {
      const t = this._diffModel
        .get()
        ?.diff.get()
        ?.mappings.map((t) => (e ? t.lineRangeMapping.flip() : t.lineRangeMapping));
      if (t) {
        const e = Mle(r.getStartPosition(), t),
          n = Mle(r.getEndPosition(), t);
        i = YH.plusRange(e, n);
      }
    }
    return { destination: n, destinationSelection: i };
  }
  switchSide() {
    const { destination: e, destinationSelection: t } = this.mapToOtherSide();
    (e.focus(), t && e.setSelection(t));
  }
  exitCompareMove() {
    const e = this._diffModel.get();
    e && e.movedTextToCompare.set(void 0, void 0);
  }
  collapseAllUnchangedRegions() {
    const e = this._diffModel.get()?.unchangedRegions.get();
    e &&
      cF((t) => {
        for (const n of e) n.collapseAll(t);
      });
  }
  showAllUnchangedRegions() {
    const e = this._diffModel.get()?.unchangedRegions.get();
    e &&
      cF((t) => {
        for (const n of e) n.showAll(t);
      });
  }
  _handleCursorPositionChange(e, t) {
    if (3 === e?.reason) {
      const n = this._diffModel
        .get()
        ?.diff.get()
        ?.mappings.find((n) =>
          t
            ? n.lineRangeMapping.modified.contains(e.position.lineNumber)
            : n.lineRangeMapping.original.contains(e.position.lineNumber),
        );
      n?.lineRangeMapping.modified.isEmpty
        ? this._accessibilitySignalService.playSignal(Lne.diffLineDeleted, {
            source: "diffEditor.cursorPositionChanged",
          })
        : n?.lineRangeMapping.original.isEmpty
          ? this._accessibilitySignalService.playSignal(Lne.diffLineInserted, {
              source: "diffEditor.cursorPositionChanged",
            })
          : n &&
            this._accessibilitySignalService.playSignal(Lne.diffLineModified, {
              source: "diffEditor.cursorPositionChanged",
            });
    }
  }
};
vhe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([_he(3, xW), _he(4, vV), _he(5, yV), _he(6, kne), _he(7, One)], vhe);
class bhe extends VW {
  constructor() {
    super({
      id: "diffEditor.toggleShowMovedCodeBlocks",
      title: EI(86, "Toggle Show Moved Code Blocks"),
      precondition: eW.has("isInDiffEditor"),
    });
  }
  run(e, ...t) {
    const n = e.get(OU),
      i = !n.getValue("diffEditor.experimental.showMoves");
    n.updateValue("diffEditor.experimental.showMoves", i);
  }
}
class yhe extends VW {
  constructor() {
    super({
      id: "diffEditor.toggleUseInlineViewWhenSpaceIsLimited",
      title: EI(87, "Toggle Use Inline View When Space Is Limited"),
      precondition: eW.has("isInDiffEditor"),
    });
  }
  run(e, ...t) {
    const n = e.get(OU),
      i = !n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");
    n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited", i);
  }
}
const xhe = EI(88, "Diff Editor");
class whe extends VW {
  constructor() {
    super({
      id: "diffEditor.revert",
      title: EI(93, "Revert"),
      f1: !0,
      category: xhe,
      precondition: eW.has("isInDiffEditor"),
    });
  }
  run(e, t) {
    return t ? this.runViaToolbarContext(e, t) : this.runViaCursorOrSelection(e);
  }
  runViaCursorOrSelection(e) {
    const t = Ehe(e);
    t instanceof vhe && t.revertFocusedRangeMappings();
  }
  runViaToolbarContext(e, t) {
    const n = (function (e, t, n) {
      const i = e.get(yV);
      return (
        i.listDiffEditors().find((e) => {
          const i = e.getModifiedEditor(),
            r = e.getOriginalEditor();
          return (
            i &&
            i.getModel()?.uri.toString() === n.toString() &&
            r &&
            r.getModel()?.uri.toString() === t.toString()
          );
        }) || null
      );
    })(e, t.originalUri, t.modifiedUri);
    n instanceof vhe && n.revertRangeMappings(t.mapping.innerChanges ?? []);
  }
}
const Che = EI(94, "Accessible Diff Viewer");
class She extends VW {
  static {
    this.id = "editor.action.accessibleDiffViewer.next";
  }
  constructor() {
    super({
      id: She.id,
      title: EI(95, "Go to Next Difference"),
      category: Che,
      precondition: eW.has("isInDiffEditor"),
      keybinding: { primary: 65, weight: 100 },
      f1: !0,
    });
  }
  run(e) {
    const t = Ehe(e);
    t?.accessibleDiffViewerNext();
  }
}
class khe extends VW {
  static {
    this.id = "editor.action.accessibleDiffViewer.prev";
  }
  constructor() {
    super({
      id: khe.id,
      title: EI(96, "Go to Previous Difference"),
      category: Che,
      precondition: eW.has("isInDiffEditor"),
      keybinding: { primary: 1089, weight: 100 },
      f1: !0,
    });
  }
  run(e) {
    const t = Ehe(e);
    t?.accessibleDiffViewerPrev();
  }
}
function Ehe(e) {
  const t = e.get(yV).listDiffEditors(),
    n = vB();
  if (n)
    for (const i of t) {
      if (i.getContainerDomNode().contains(n)) return i;
    }
  return null;
}
(WW(
  class extends VW {
    constructor() {
      super({
        id: "diffEditor.toggleCollapseUnchangedRegions",
        title: EI(85, "Toggle Collapse Unchanged Regions"),
        icon: OV.map,
        toggled: eW.has("config.diffEditor.hideUnchangedRegions.enabled"),
        precondition: eW.has("isInDiffEditor"),
        menu: {
          when: eW.has("isInDiffEditor"),
          id: MW.EditorTitle,
          order: 22,
          group: "navigation",
        },
      });
    }
    run(e, ...t) {
      const n = e.get(OU),
        i = !n.getValue("diffEditor.hideUnchangedRegions.enabled");
      n.updateValue("diffEditor.hideUnchangedRegions.enabled", i);
    }
  },
),
  WW(bhe),
  WW(yhe),
  jW.appendMenuItem(MW.EditorTitle, {
    command: {
      id: new yhe().desc.id,
      title: SI(119, "Use Inline View When Space Is Limited"),
      toggled: eW.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),
      precondition: eW.has("isInDiffEditor"),
    },
    order: 11,
    group: "1_diff",
    when: eW.and($$.diffEditorRenderSideBySideInlineBreakpointReached, eW.has("isInDiffEditor")),
  }),
  jW.appendMenuItem(MW.EditorTitle, {
    command: {
      id: new bhe().desc.id,
      title: SI(120, "Show Moved Code Blocks"),
      icon: OV.move,
      toggled: oW.create("config.diffEditor.experimental.showMoves", !0),
      precondition: eW.has("isInDiffEditor"),
    },
    order: 10,
    group: "1_diff",
    when: eW.has("isInDiffEditor"),
  }),
  WW(whe));
for (const Set of [
  { icon: OV.arrowRight, key: $$.diffEditorInlineMode.toNegated() },
  { icon: OV.discard, key: $$.diffEditorInlineMode },
])
  (jW.appendMenuItem(MW.DiffEditorHunkToolbar, {
    command: { id: new whe().desc.id, title: SI(121, "Revert Block"), icon: Set.icon },
    when: eW.and($$.diffEditorModifiedWritable, Set.key),
    order: 5,
    group: "primary",
  }),
    jW.appendMenuItem(MW.DiffEditorSelectionToolbar, {
      command: { id: new whe().desc.id, title: SI(122, "Revert Selection"), icon: Set.icon },
      when: eW.and($$.diffEditorModifiedWritable, Set.key),
      order: 5,
      group: "primary",
    }));
(WW(
  class extends jH {
    constructor() {
      super({
        id: "diffEditor.switchSide",
        title: EI(89, "Switch Side"),
        icon: OV.arrowSwap,
        precondition: eW.has("isInDiffEditor"),
        f1: !0,
        category: xhe,
      });
    }
    runEditorCommand(e, t, n) {
      const i = Ehe(e);
      if (i instanceof vhe) {
        if (n && n.dryRun) return { destinationSelection: i.mapToOtherSide().destinationSelection };
        i.switchSide();
      }
    }
  },
),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "diffEditor.exitCompareMove",
          title: EI(90, "Exit Compare Move"),
          icon: OV.close,
          precondition: $$.comparingMovedCode,
          f1: !1,
          category: xhe,
          keybinding: { weight: 1e4, primary: 9 },
        });
      }
      runEditorCommand(e, t, ...n) {
        const i = Ehe(e);
        i instanceof vhe && i.exitCompareMove();
      }
    },
  ),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "diffEditor.collapseAllUnchangedRegions",
          title: EI(91, "Collapse All Unchanged Regions"),
          icon: OV.fold,
          precondition: eW.has("isInDiffEditor"),
          f1: !0,
          category: xhe,
        });
      }
      runEditorCommand(e, t, ...n) {
        const i = Ehe(e);
        i instanceof vhe && i.collapseAllUnchangedRegions();
      }
    },
  ),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "diffEditor.showAllUnchangedRegions",
          title: EI(92, "Show All Unchanged Regions"),
          icon: OV.unfold,
          precondition: eW.has("isInDiffEditor"),
          f1: !0,
          category: xhe,
        });
      }
      runEditorCommand(e, t, ...n) {
        const i = Ehe(e);
        i instanceof vhe && i.showAllUnchangedRegions();
      }
    },
  ),
  jW.appendMenuItem(MW.EditorTitle, {
    command: {
      id: She.id,
      title: SI(123, "Open Accessible Diff Viewer"),
      precondition: eW.has("isInDiffEditor"),
    },
    order: 10,
    group: "2_diff",
    when: eW.and($$.accessibleDiffViewerVisible.negate(), eW.has("isInDiffEditor")),
  }),
  jV.registerCommandAlias("editor.action.diffReview.next", She.id),
  WW(She),
  jV.registerCommandAlias("editor.action.diffReview.prev", khe.id),
  WW(khe));
var Nhe;
const Lhe = new yW("selectionAnchorSet", !1);
let Dhe = class {
  static {
    Nhe = this;
  }
  static {
    this.ID = "editor.contrib.selectionAnchorController";
  }
  static get(e) {
    return e.getContribution(Nhe.ID);
  }
  constructor(e, t) {
    ((this.editor = e),
      (this.selectionAnchorSetContextKey = Lhe.bindTo(t)),
      (this.modelChangeListener = e.onDidChangeModel(() =>
        this.selectionAnchorSetContextKey.reset(),
      )));
  }
  setSelectionAnchor() {
    if (this.editor.hasModel()) {
      const e = this.editor.getPosition();
      (this.editor.changeDecorations((t) => {
        (this.decorationId && t.removeDecoration(this.decorationId),
          (this.decorationId = t.addDecoration(XH.fromPositions(e, e), {
            description: "selection-anchor",
            stickiness: 1,
            hoverMessage: new rre().appendText(SI(798, "Selection Anchor")),
            className: "selection-anchor",
          })));
      }),
        this.selectionAnchorSetContextKey.set(!!this.decorationId),
        pV(SI(799, "Anchor set at {0}:{1}", e.lineNumber, e.column)));
    }
  }
  goToSelectionAnchor() {
    if (this.editor.hasModel() && this.decorationId) {
      const e = this.editor.getModel().getDecorationRange(this.decorationId);
      e && this.editor.setPosition(e.getStartPosition());
    }
  }
  selectFromAnchorToCursor() {
    if (this.editor.hasModel() && this.decorationId) {
      const e = this.editor.getModel().getDecorationRange(this.decorationId);
      if (e) {
        const t = this.editor.getPosition();
        (this.editor.setSelection(XH.fromPositions(e.getStartPosition(), t)),
          this.cancelSelectionAnchor());
      }
    }
  }
  cancelSelectionAnchor() {
    if (this.decorationId) {
      const e = this.decorationId;
      (this.editor.changeDecorations((t) => {
        (t.removeDecoration(e), (this.decorationId = void 0));
      }),
        this.selectionAnchorSetContextKey.set(!1));
    }
  }
  dispose() {
    (this.cancelSelectionAnchor(), this.modelChangeListener.dispose());
  }
};
Dhe = Nhe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, xW),
  ],
  Dhe,
);
(zH(Dhe.ID, Dhe, 4),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.setSelectionAnchor",
          label: EI(800, "Set Selection Anchor"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2080), weight: 100 },
        });
      }
      async run(e, t) {
        Dhe.get(t)?.setSelectionAnchor();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.goToSelectionAnchor",
          label: EI(801, "Go to Selection Anchor"),
          precondition: Lhe,
        });
      }
      async run(e, t) {
        Dhe.get(t)?.goToSelectionAnchor();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.selectFromAnchorToCursor",
          label: EI(802, "Select from Anchor to Cursor"),
          precondition: Lhe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2089), weight: 100 },
        });
      }
      async run(e, t) {
        Dhe.get(t)?.selectFromAnchorToCursor();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.cancelSelectionAnchor",
          label: EI(803, "Cancel Selection Anchor"),
          precondition: Lhe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 9, weight: 100 },
        });
      }
      async run(e, t) {
        Dhe.get(t)?.cancelSelectionAnchor();
      }
    },
  ));
const The = SG(
  "editorOverviewRuler.bracketMatchForeground",
  "#A0A0A0",
  SI(804, "Overview ruler marker color for matching brackets."),
);
class Ihe {
  constructor(e, t, n) {
    ((this.position = e), (this.brackets = t), (this.options = n));
  }
}
class Rhe extends PO {
  static {
    this.ID = "editor.contrib.bracketMatchingController";
  }
  static get(e) {
    return e.getContribution(Rhe.ID);
  }
  constructor(e) {
    (super(),
      (this._editor = e),
      (this._lastBracketsData = []),
      (this._lastVersionId = 0),
      (this._decorations = this._editor.createDecorationsCollection()),
      (this._updateBracketsSoon = this._register(new EM(() => this._updateBrackets(), 50))),
      (this._matchBrackets = this._editor.getOption(80)),
      this._updateBracketsSoon.schedule(),
      this._register(
        e.onDidChangeCursorPosition((e) => {
          "never" !== this._matchBrackets && this._updateBracketsSoon.schedule();
        }),
      ),
      this._register(
        e.onDidChangeModelContent((e) => {
          this._updateBracketsSoon.schedule();
        }),
      ),
      this._register(
        e.onDidChangeModel((e) => {
          ((this._lastBracketsData = []), this._updateBracketsSoon.schedule());
        }),
      ),
      this._register(
        e.onDidChangeModelLanguageConfiguration((e) => {
          ((this._lastBracketsData = []), this._updateBracketsSoon.schedule());
        }),
      ),
      this._register(
        e.onDidChangeConfiguration((e) => {
          e.hasChanged(80) &&
            ((this._matchBrackets = this._editor.getOption(80)),
            this._decorations.clear(),
            (this._lastBracketsData = []),
            (this._lastVersionId = 0),
            this._updateBracketsSoon.schedule());
        }),
      ),
      this._register(
        e.onDidBlurEditorWidget(() => {
          this._updateBracketsSoon.schedule();
        }),
      ),
      this._register(
        e.onDidFocusEditorWidget(() => {
          this._updateBracketsSoon.schedule();
        }),
      ));
  }
  jumpToBracket() {
    if (!this._editor.hasModel()) return;
    const e = this._editor.getModel(),
      t = this._editor.getSelections().map((t) => {
        const n = t.getStartPosition(),
          i = e.bracketPairs.matchBracket(n);
        let r = null;
        if (i)
          i[0].containsPosition(n) && !i[1].containsPosition(n)
            ? (r = i[1].getStartPosition())
            : i[1].containsPosition(n) && (r = i[0].getStartPosition());
        else {
          const t = e.bracketPairs.findEnclosingBrackets(n);
          if (t) r = t[1].getStartPosition();
          else {
            const t = e.bracketPairs.findNextBracket(n);
            t && t.range && (r = t.range.getStartPosition());
          }
        }
        return r
          ? new XH(r.lineNumber, r.column, r.lineNumber, r.column)
          : new XH(n.lineNumber, n.column, n.lineNumber, n.column);
      });
    (this._editor.setSelections(t), this._editor.revealRange(t[0]));
  }
  selectToBracket(e) {
    if (!this._editor.hasModel()) return;
    const t = this._editor.getModel(),
      n = [];
    (this._editor.getSelections().forEach((i) => {
      const r = i.getStartPosition();
      let o = t.bracketPairs.matchBracket(r);
      if (!o && ((o = t.bracketPairs.findEnclosingBrackets(r)), !o)) {
        const e = t.bracketPairs.findNextBracket(r);
        e && e.range && (o = t.bracketPairs.matchBracket(e.range.getStartPosition()));
      }
      let s = null,
        a = null;
      if (o) {
        o.sort(YH.compareRangesUsingStarts);
        const [t, n] = o;
        if (
          ((s = e ? t.getStartPosition() : t.getEndPosition()),
          (a = e ? n.getEndPosition() : n.getStartPosition()),
          n.containsPosition(r))
        ) {
          const e = s;
          ((s = a), (a = e));
        }
      }
      s && a && n.push(new XH(s.lineNumber, s.column, a.lineNumber, a.column));
    }),
      n.length > 0 && (this._editor.setSelections(n), this._editor.revealRange(n[0])));
  }
  removeBrackets(e) {
    if (!this._editor.hasModel()) return;
    const t = this._editor.getModel();
    this._editor.getSelections().forEach((n) => {
      const i = n.getPosition();
      let r = t.bracketPairs.matchBracket(i);
      (r || (r = t.bracketPairs.findEnclosingBrackets(i)),
        r &&
          (this._editor.pushUndoStop(),
          this._editor.executeEdits(e, [
            { range: r[0], text: "" },
            { range: r[1], text: "" },
          ]),
          this._editor.pushUndoStop()));
    });
  }
  static {
    this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER = cee.register({
      description: "bracket-match-overview",
      stickiness: 1,
      className: "bracket-match",
      overviewRuler: { color: g0(The), position: Uz.Center },
    });
  }
  static {
    this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER = cee.register({
      description: "bracket-match-no-overview",
      stickiness: 1,
      className: "bracket-match",
    });
  }
  _updateBrackets() {
    if ("never" === this._matchBrackets) return;
    this._recomputeBrackets();
    const e = [];
    let t = 0;
    for (const n of this._lastBracketsData) {
      const i = n.brackets;
      i &&
        ((e[t++] = { range: i[0], options: n.options }),
        (e[t++] = { range: i[1], options: n.options }));
    }
    this._decorations.set(e);
  }
  _recomputeBrackets() {
    if (!this._editor.hasModel() || !this._editor.hasWidgetFocus())
      return ((this._lastBracketsData = []), void (this._lastVersionId = 0));
    const e = this._editor.getSelections();
    if (e.length > 100) return ((this._lastBracketsData = []), void (this._lastVersionId = 0));
    const t = this._editor.getModel(),
      n = t.getVersionId();
    let i = [];
    this._lastVersionId === n && (i = this._lastBracketsData);
    const r = [];
    let o = 0;
    for (let d = 0, u = e.length; d < u; d++) {
      const t = e[d];
      t.isEmpty() && (r[o++] = t.getStartPosition());
    }
    r.length > 1 && r.sort(xV.compare);
    const s = [];
    let a = 0,
      l = 0;
    const c = i.length;
    for (let d = 0, u = r.length; d < u; d++) {
      const e = r[d];
      for (; l < c && i[l].position.isBefore(e); ) l++;
      if (l < c && i[l].position.equals(e)) s[a++] = i[l];
      else {
        let n = t.bracketPairs.matchBracket(e, 20),
          i = Rhe._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;
        (n ||
          "always" !== this._matchBrackets ||
          ((n = t.bracketPairs.findEnclosingBrackets(e, 20)),
          (i = Rhe._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER)),
          (s[a++] = new Ihe(e, n, i)));
      }
    }
    ((this._lastBracketsData = s), (this._lastVersionId = n));
  }
}
(zH(Rhe.ID, Rhe, 1),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.selectToBracket",
          label: EI(807, "Select to Bracket"),
          precondition: void 0,
          metadata: {
            description: EI(
              808,
              "Select the text inside and including the brackets or curly braces",
            ),
            args: [
              {
                name: "args",
                schema: {
                  type: "object",
                  properties: { selectBrackets: { type: "boolean", default: !0 } },
                },
              },
            ],
          },
        });
      }
      run(e, t, n) {
        let i = !0;
        (n && !1 === n.selectBrackets && (i = !1), Rhe.get(t)?.selectToBracket(i));
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.jumpToBracket",
          label: EI(806, "Go to Bracket"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 3165, weight: 100 },
        });
      }
      run(e, t) {
        Rhe.get(t)?.jumpToBracket();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.removeBrackets",
          label: EI(809, "Remove Brackets"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 2561, weight: 100 },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        Rhe.get(t)?.removeBrackets(this.id);
      }
    },
  ),
  jW.appendMenuItem(MW.MenubarGoMenu, {
    group: "5_infile_nav",
    command: { id: "editor.action.jumpToBracket", title: SI(805, "Go to &&Bracket") },
    order: 2,
  }));
class Ohe {
  constructor(e, t) {
    ((this._selection = e), (this._isMovingLeft = t));
  }
  getEditOperations(e, t) {
    if (
      this._selection.startLineNumber !== this._selection.endLineNumber ||
      this._selection.isEmpty()
    )
      return;
    const n = this._selection.startLineNumber,
      i = this._selection.startColumn,
      r = this._selection.endColumn;
    if ((!this._isMovingLeft || 1 !== i) && (this._isMovingLeft || r !== e.getLineMaxColumn(n)))
      if (this._isMovingLeft) {
        const o = new YH(n, i - 1, n, i),
          s = e.getValueInRange(o);
        (t.addEditOperation(o, null), t.addEditOperation(new YH(n, r, n, r), s));
      } else {
        const o = new YH(n, r, n, r + 1),
          s = e.getValueInRange(o);
        (t.addEditOperation(o, null), t.addEditOperation(new YH(n, i, n, i), s));
      }
  }
  computeCursorState(e, t) {
    return this._isMovingLeft
      ? new XH(
          this._selection.startLineNumber,
          this._selection.startColumn - 1,
          this._selection.endLineNumber,
          this._selection.endColumn - 1,
        )
      : new XH(
          this._selection.startLineNumber,
          this._selection.startColumn + 1,
          this._selection.endLineNumber,
          this._selection.endColumn + 1,
        );
  }
}
class Mhe extends AH {
  constructor(e, t) {
    (super(t), (this.left = e));
  }
  run(e, t) {
    if (!t.hasModel()) return;
    const n = [],
      i = t.getSelections();
    for (const r of i) n.push(new Ohe(r, this.left));
    (t.pushUndoStop(), t.executeCommands(this.id, n), t.pushUndoStop());
  }
}
(VH(
  class extends Mhe {
    constructor() {
      super(!0, {
        id: "editor.action.moveCarretLeftAction",
        label: EI(810, "Move Selected Text Left"),
        precondition: $$.writable,
      });
    }
  },
),
  VH(
    class extends Mhe {
      constructor() {
        super(!1, {
          id: "editor.action.moveCarretRightAction",
          label: EI(811, "Move Selected Text Right"),
          precondition: $$.writable,
        });
      }
    },
  ));
VH(
  class extends AH {
    constructor() {
      super({
        id: "editor.action.transposeLetters",
        label: EI(812, "Transpose Letters"),
        precondition: $$.writable,
        kbOpts: { kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 306 }, weight: 100 },
      });
    }
    run(e, t) {
      if (!t.hasModel()) return;
      const n = t.getModel(),
        i = [],
        r = t.getSelections();
      for (const o of r) {
        if (!o.isEmpty()) continue;
        const e = o.startLineNumber,
          t = o.startColumn,
          r = n.getLineMaxColumn(e);
        if (1 === e && (1 === t || (2 === t && 2 === r))) continue;
        const s =
            t === r
              ? o.getPosition()
              : kz.rightPosition(n, o.getPosition().lineNumber, o.getPosition().column),
          a = kz.leftPosition(n, s),
          l = kz.leftPosition(n, a),
          c = n.getValueInRange(YH.fromPositions(l, a)),
          d = n.getValueInRange(YH.fromPositions(a, s)),
          u = YH.fromPositions(l, s);
        i.push(new fz(u, d + c));
      }
      i.length > 0 && (t.pushUndoStop(), t.executeCommands(this.id, i), t.pushUndoStop());
    }
  },
);
const Ahe = bV("productService");
function Phe(e, t) {
  return {
    id: t,
    asString: async () => e,
    asFile: () => {},
    value: "string" == typeof e ? e : void 0,
  };
}
class jhe {
  constructor() {
    this._entries = new Map();
  }
  get size() {
    let e = 0;
    for (const t of this._entries) e++;
    return e;
  }
  has(e) {
    return this._entries.has(this.toKey(e));
  }
  matches(e) {
    const t = [...this._entries.keys()];
    return (DO.some(this, ([e, t]) => t.asFile()) && t.push("files"), Vhe(Fhe(e), t));
  }
  get(e) {
    return this._entries.get(this.toKey(e))?.[0];
  }
  append(e, t) {
    const n = this._entries.get(e);
    n ? n.push(t) : this._entries.set(this.toKey(e), [t]);
  }
  replace(e, t) {
    this._entries.set(this.toKey(e), [t]);
  }
  delete(e) {
    this._entries.delete(this.toKey(e));
  }
  *[Symbol.iterator]() {
    for (const [e, t] of this._entries) for (const n of t) yield [e, n];
  }
  toKey(e) {
    return Fhe(e);
  }
}
function Fhe(e) {
  return e.toLowerCase();
}
function Bhe(e, t) {
  return Vhe(Fhe(e), t.map(Fhe));
}
function Vhe(e, t) {
  if ("*/*" === e) return t.length > 0;
  if (t.includes(e)) return !0;
  const n = e.match(/^([a-z]+)\/([a-z]+|\*)$/i);
  if (!n) return !1;
  const [i, r, o] = n;
  return "*" === o && t.some((e) => e.startsWith(r + "/"));
}
const Whe = Object.freeze({
  create: (e) => lj(e.map((e) => e.toString())).join("\r\n"),
  split: (e) => e.split("\r\n"),
  parse: (e) => Whe.split(e).filter((e) => !e.startsWith("#")),
});
class Hhe {
  static {
    this.sep = ".";
  }
  static {
    this.None = new Hhe("@@none@@");
  }
  static {
    this.Empty = new Hhe("");
  }
  constructor(e) {
    this.value = e;
  }
  equals(e) {
    return this.value === e.value;
  }
  contains(e) {
    return this.equals(e) || "" === this.value || e.value.startsWith(this.value + Hhe.sep);
  }
  intersects(e) {
    return this.contains(e) || e.contains(this);
  }
  append(...e) {
    return new Hhe((this.value ? [this.value, ...e] : e).join(Hhe.sep));
  }
}
const zhe = { ctrlCmd: !1, alt: !1 };
var Uhe, $he, qhe, Khe;
(!(function (e) {
  ((e[(e.Blur = 1)] = "Blur"), (e[(e.Gesture = 2)] = "Gesture"), (e[(e.Other = 3)] = "Other"));
})(Uhe || (Uhe = {})),
  (function (e) {
    ((e[(e.NONE = 0)] = "NONE"),
      (e[(e.FIRST = 1)] = "FIRST"),
      (e[(e.SECOND = 2)] = "SECOND"),
      (e[(e.LAST = 3)] = "LAST"));
  })($he || ($he = {})),
  (function (e) {
    ((e[(e.First = 1)] = "First"),
      (e[(e.Second = 2)] = "Second"),
      (e[(e.Last = 3)] = "Last"),
      (e[(e.Next = 4)] = "Next"),
      (e[(e.Previous = 5)] = "Previous"),
      (e[(e.NextPage = 6)] = "NextPage"),
      (e[(e.PreviousPage = 7)] = "PreviousPage"),
      (e[(e.NextSeparator = 8)] = "NextSeparator"),
      (e[(e.PreviousSeparator = 9)] = "PreviousSeparator"));
  })(qhe || (qhe = {})),
  (function (e) {
    ((e[(e.Title = 1)] = "Title"), (e[(e.Inline = 2)] = "Inline"), (e[(e.Input = 3)] = "Input"));
  })(Khe || (Khe = {})));
const Ghe = bV("quickInputService"),
  Zhe = "CodeEditors",
  Yhe = "CodeFiles";
NW.add("workbench.contributions.dragAndDrop", new (class {})());
class Xhe {
  static {
    this.INSTANCE = new Xhe();
  }
  constructor() {}
  static getInstance() {
    return Xhe.INSTANCE;
  }
  hasData(e) {
    return e && e === this.proto;
  }
  getData(e) {
    if (this.hasData(e)) return this.data;
  }
}
function Qhe(e) {
  if (FR && "function" == typeof globalThis.vscode?.webUtils?.getPathForFile)
    return globalThis.vscode?.webUtils?.getPathForFile(e);
}
function Jhe(e) {
  const t = new jhe();
  for (const n of e.items) {
    const e = n.type;
    if ("string" === n.kind) {
      const i = new Promise((e) => n.getAsString(e));
      t.append(e, Phe(i));
    } else if ("file" === n.kind) {
      const i = n.getAsFile();
      i && t.append(e, ege(i));
    }
  }
  return t;
}
function ege(e) {
  const t = Qhe(e),
    n = t ? mP.parse(t) : void 0;
  return (function (e, t, n, i) {
    const r = { id: FJ(), name: e, uri: t, data: n };
    return { id: i, asString: async () => "", asFile: () => r, value: void 0 };
  })(e.name, n, async () => new Uint8Array(await e.arrayBuffer()));
}
const tge = Object.freeze([Zhe, Yhe, Ane.RESOURCES, Ane.INTERNAL_URI_LIST]);
function nge(e, t = !1) {
  const n = Jhe(e),
    i = n.get(Ane.INTERNAL_URI_LIST);
  if (i) n.replace(UU.uriList, i);
  else if (t || !n.has(UU.uriList)) {
    const t = [];
    for (const n of e.items) {
      const e = n.getAsFile();
      if (e) {
        const n = Qhe(e);
        try {
          n ? t.push(mP.file(n).toString()) : t.push(mP.parse(e.name, !0).toString());
        } catch {}
      }
    }
    t.length && n.replace(UU.uriList, Phe(Whe.create(t)));
  }
  for (const r of tge) n.delete(r);
  return n;
}
const ige = bV("IWorkspaceEditService");
class rge {
  constructor(e) {
    this.metadata = e;
  }
  static convert(e) {
    return e.edits.map((e) => {
      if (oge.is(e)) return oge.lift(e);
      if (sge.is(e)) return sge.lift(e);
      throw new Error("Unsupported edit");
    });
  }
}
class oge extends rge {
  static is(e) {
    return e instanceof oge || (sR(e) && mP.isUri(e.resource) && sR(e.textEdit));
  }
  static lift(e) {
    return e instanceof oge ? e : new oge(e.resource, e.textEdit, e.versionId, e.metadata);
  }
  constructor(e, t, n = void 0, i) {
    (super(i), (this.resource = e), (this.textEdit = t), (this.versionId = n));
  }
}
class sge extends rge {
  static is(e) {
    return e instanceof sge || (sR(e) && (Boolean(e.newResource) || Boolean(e.oldResource)));
  }
  static lift(e) {
    return e instanceof sge ? e : new sge(e.oldResource, e.newResource, e.options, e.metadata);
  }
  constructor(e, t, n = {}, i) {
    (super(i), (this.oldResource = e), (this.newResource = t), (this.options = n));
  }
}
const age = bV("IEditorCancelService"),
  lge = new yW(
    "cancellableOperation",
    !1,
    SI(939, "Whether the editor runs a cancellable operation, e.g. like 'Peek References'"),
  );
HU(
  age,
  class {
    constructor() {
      this._tokens = new WeakMap();
    }
    add(e, t) {
      let n,
        i = this._tokens.get(e);
      return (
        i ||
          ((i = e.invokeWithinContext((e) => ({ key: lge.bindTo(e.get(xW)), tokens: new HO() }))),
          this._tokens.set(e, i)),
        i.key.set(!0),
        (n = i.tokens.push(t)),
        () => {
          n && (n(), i.key.set(!i.tokens.isEmpty()), (n = void 0));
        }
      );
    }
    cancel(e) {
      const t = this._tokens.get(e);
      if (!t) return;
      const n = t.tokens.pop();
      n && (n.cancel(), t.key.set(!t.tokens.isEmpty()));
    }
  },
  1,
);
class cge extends cM {
  constructor(e, t) {
    (super(t),
      (this.editor = e),
      (this._unregister = e.invokeWithinContext((t) => t.get(age).add(e, this))));
  }
  dispose() {
    (this._unregister(), super.dispose());
  }
}
BH(
  new (class extends MH {
    constructor() {
      super({
        id: "editor.cancelOperation",
        kbOpts: { weight: 100, primary: 9 },
        precondition: lge,
      });
    }
    runEditorCommand(e, t) {
      e.get(age).cancel(t);
    }
  })(),
);
let dge = class e {
  constructor(e, t) {
    if (((this.flags = t), 1 & this.flags)) {
      const t = e.getModel();
      this.modelVersionId = t ? WM("{0}#{1}", t.uri.toString(), t.getVersionId()) : null;
    } else this.modelVersionId = null;
    (4 & this.flags ? (this.position = e.getPosition()) : (this.position = null),
      2 & this.flags ? (this.selection = e.getSelection()) : (this.selection = null),
      8 & this.flags
        ? ((this.scrollLeft = e.getScrollLeft()), (this.scrollTop = e.getScrollTop()))
        : ((this.scrollLeft = -1), (this.scrollTop = -1)));
  }
  _equals(t) {
    if (!(t instanceof e)) return !1;
    const n = t;
    return (
      this.modelVersionId === n.modelVersionId &&
      this.scrollLeft === n.scrollLeft &&
      this.scrollTop === n.scrollTop &&
      !(
        (!this.position && n.position) ||
        (this.position && !n.position) ||
        (this.position && n.position && !this.position.equals(n.position))
      ) &&
      !(
        (!this.selection && n.selection) ||
        (this.selection && !n.selection) ||
        (this.selection && n.selection && !this.selection.equalsRange(n.selection))
      )
    );
  }
  validate(t) {
    return this._equals(new e(t, this.flags));
  }
};
class uge extends cge {
  constructor(e, t, n, i) {
    (super(e, i),
      (this._listener = new AO()),
      4 & t &&
        this._listener.add(
          e.onDidChangeCursorPosition((e) => {
            (n && YH.containsPosition(n, e.position)) || this.cancel();
          }),
        ),
      2 & t &&
        this._listener.add(
          e.onDidChangeCursorSelection((e) => {
            (n && YH.containsRange(n, e.selection)) || this.cancel();
          }),
        ),
      8 & t && this._listener.add(e.onDidScrollChange((e) => this.cancel())),
      1 & t &&
        (this._listener.add(e.onDidChangeModel((e) => this.cancel())),
        this._listener.add(e.onDidChangeModelContent((e) => this.cancel()))));
  }
  dispose() {
    (this._listener.dispose(), super.dispose());
  }
}
class hge extends cM {
  constructor(e, t) {
    (super(t), (this._listener = e.onDidChangeContent(() => this.cancel())));
  }
  dispose() {
    (this._listener.dispose(), super.dispose());
  }
}
const gge = cee.register({
  description: "inline-progress-widget",
  stickiness: 1,
  showIfCollapsed: !0,
  after: {
    content: " ",
    inlineClassName: "inline-editor-progress-decoration",
    inlineClassNameAffectsLetterSpacing: !0,
  },
});
class pge extends PO {
  static {
    this.baseId = "editor.widget.inlineProgressWidget";
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this.typeId = e),
      (this.editor = t),
      (this.range = n),
      (this.delegate = r),
      (this.allowEditorOverflow = !1),
      (this.suppressMouseDown = !0),
      this.create(i),
      this.editor.addContentWidget(this),
      this.editor.layoutContentWidget(this));
  }
  create(e) {
    ((this.domNode = VB(".inline-progress-widget")),
      (this.domNode.role = "button"),
      (this.domNode.title = e));
    const t = VB("span.icon");
    (this.domNode.append(t),
      t.classList.add(...AV.asClassNameArray(OV.loading), "codicon-modifier-spin"));
    const n = () => {
      const e = this.editor.getOption(75);
      ((this.domNode.style.height = `${e}px`),
        (this.domNode.style.width = `${Math.ceil(0.8 * e)}px`));
    };
    (n(),
      this._register(
        this.editor.onDidChangeConfiguration((e) => {
          (e.hasChanged(61) || e.hasChanged(75)) && n();
        }),
      ),
      this._register(
        $F(this.domNode, DB.CLICK, (e) => {
          this.delegate.cancel();
        }),
      ));
  }
  getId() {
    return pge.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));
  }
}
let fge = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this.id = e),
      (this._editor = t),
      (this._instantiationService = n),
      (this._showDelay = 500),
      (this._showPromise = this._register(new jO())),
      (this._currentWidget = this._register(new jO())),
      (this._operationIdPool = 0),
      (this._currentDecorations = t.createDecorationsCollection()));
  }
  dispose() {
    (super.dispose(), this._currentDecorations.clear());
  }
  async showWhile(e, t, n, i, r) {
    const o = this._operationIdPool++;
    ((this._currentOperation = o),
      this.clear(),
      (this._showPromise.value = bM(() => {
        const n = YH.fromPositions(e);
        this._currentDecorations.set([{ range: n, options: gge }]).length > 0 &&
          (this._currentWidget.value = this._instantiationService.createInstance(
            pge,
            this.id,
            this._editor,
            n,
            t,
            i,
          ));
      }, r ?? this._showDelay)));
    try {
      return await n;
    } finally {
      this._currentOperation === o && (this.clear(), (this._currentOperation = void 0));
    }
  }
  clear() {
    (this._showPromise.clear(), this._currentDecorations.clear(), this._currentWidget.clear());
  }
};
fge = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(2, vV),
  ],
  fge,
);
const mge = bV("openerService");
const _ge = bV("markdownRendererService");
let vge = class {
  constructor(e) {
    this._openerService = e;
  }
  render(e, t, n) {
    const i = { ...t };
    (i.actionHandler || (i.actionHandler = (e, t) => bge(this._openerService, e, t.isTrusted)),
      i.codeBlockRenderer ||
        (i.codeBlockRenderer = (e, t) =>
          this._defaultCodeBlockRenderer?.renderCodeBlock(e, t, i ?? {}) ??
          Promise.resolve(document.createElement("span"))));
    const r = Use(e, i, n);
    return (r.element.classList.add("rendered-markdown"), r);
  }
  setDefaultCodeBlockRenderer(e) {
    this._defaultCodeBlockRenderer = e;
  }
};
async function bge(e, t, n, i) {
  try {
    return await e.open(t, {
      fromUserGesture: !0,
      allowContributedOpeners: !0,
      allowCommands: yge(n),
      skipValidation: i,
    });
  } catch (spt) {
    return (HI(spt), !1);
  }
}
function yge(e) {
  return !0 === e || (!(!e || !Array.isArray(e.enabledCommands)) && e.enabledCommands);
}
((vge = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, mge),
  ],
  vge,
)),
  HU(_ge, vge, 1));
var xge,
  wge = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Cge = class {
  static {
    xge = this;
  }
  static {
    this.ID = "editor.contrib.messageController";
  }
  static {
    this.MESSAGE_VISIBLE = new yW(
      "messageVisible",
      !1,
      SI(1287, "Whether the editor is currently showing an inline message"),
    );
  }
  static get(e) {
    return e.getContribution(xge.ID);
  }
  constructor(e, t, n) {
    ((this._openerService = n),
      (this._messageWidget = new jO()),
      (this._messageListeners = new AO()),
      (this._mouseOverMessage = !1),
      (this._editor = e),
      (this._visible = xge.MESSAGE_VISIBLE.bindTo(t)));
  }
  dispose() {
    (this._messageListeners.dispose(), this._messageWidget.dispose(), this._visible.reset());
  }
  showMessage(e, t) {
    if (
      (pV(sre(e) ? e.value : e),
      this._visible.set(!0),
      this._messageWidget.clear(),
      this._messageListeners.clear(),
      sre(e))
    ) {
      const n = this._messageListeners.add(
        Use(e, {
          actionHandler: (e, t) => {
            (this.closeMessage(), bge(this._openerService, e, t.isTrusted));
          },
        }),
      );
      this._messageWidget.value = new Sge(this._editor, t, n.element);
    } else this._messageWidget.value = new Sge(this._editor, t, e);
    let n;
    (this._messageListeners.add(
      $O.debounce(
        this._editor.onDidBlurEditorText,
        (e, t) => t,
        0,
      )(() => {
        this._mouseOverMessage ||
          (this._messageWidget.value && gB(vB(), 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(
        $F(
          this._messageWidget.value.getDomNode(),
          DB.MOUSE_ENTER,
          () => (this._mouseOverMessage = !0),
          !0,
        ),
      ),
      this._messageListeners.add(
        $F(
          this._messageWidget.value.getDomNode(),
          DB.MOUSE_LEAVE,
          () => (this._mouseOverMessage = !1),
          !0,
        ),
      ),
      this._messageListeners.add(
        this._editor.onMouseMove((e) => {
          e.target.position &&
            (n
              ? n.containsPosition(e.target.position) || this.closeMessage()
              : (n = new YH(t.lineNumber - 3, 1, e.target.position.lineNumber + 3, 1)));
        }),
      ));
  }
  closeMessage() {
    (this._visible.reset(),
      this._messageListeners.clear(),
      this._messageWidget.value &&
        this._messageListeners.add(Sge.fadeOut(this._messageWidget.value)));
  }
};
Cge = xge = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([wge(1, xW), wge(2, mge)], Cge);
BH(
  new (MH.bindToContribution(Cge.get))({
    id: "leaveEditorMessage",
    precondition: Cge.MESSAGE_VISIBLE,
    handler: (e) => e.closeMessage(),
    kbOpts: { weight: 130, primary: 9 },
  }),
);
let Sge = class {
  static fadeOut(e) {
    const t = () => {
        (e.dispose(), clearTimeout(n), e.getDomNode().removeEventListener("animationend", t));
      },
      n = setTimeout(t, 110);
    return (
      e.getDomNode().addEventListener("animationend", t),
      e.getDomNode().classList.add("fadeOut"),
      { dispose: t }
    );
  }
  constructor(e, { lineNumber: t, column: n }, i) {
    ((this.allowEditorOverflow = !0),
      (this.suppressMouseDown = !1),
      (this._editor = e),
      this._editor.revealLinesInCenterIfOutsideViewport(t, t, 0),
      (this._position = { lineNumber: t, column: n }),
      (this._domNode = document.createElement("div")),
      this._domNode.classList.add("monaco-editor-overlaymessage"),
      (this._domNode.style.marginLeft = "-6px"));
    const r = document.createElement("div");
    (r.classList.add("anchor", "top"), this._domNode.appendChild(r));
    const o = document.createElement("div");
    ("string" == typeof i
      ? (o.classList.add("message"), (o.textContent = i))
      : (i.classList.add("message"), o.appendChild(i)),
      this._domNode.appendChild(o));
    const s = document.createElement("div");
    (s.classList.add("anchor", "below"),
      this._domNode.appendChild(s),
      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(e) {
    this._domNode.classList.toggle("below", 2 === e);
  }
};
zH(Cge.ID, Cge, 4);
class kge {
  constructor() {
    ((this._value = ""), (this._pos = 0));
  }
  reset(e) {
    return ((this._value = e), (this._pos = 0), this);
  }
  next() {
    return ((this._pos += 1), this);
  }
  hasNext() {
    return this._pos < this._value.length - 1;
  }
  cmp(e) {
    return e.charCodeAt(0) - this._value.charCodeAt(this._pos);
  }
  value() {
    return this._value[this._pos];
  }
}
class Ege {
  constructor(e = !0) {
    this._caseSensitive = e;
  }
  reset(e) {
    return ((this._value = e), (this._from = 0), (this._to = 0), this.next());
  }
  hasNext() {
    return this._to < this._value.length;
  }
  next() {
    this._from = this._to;
    let e = !0;
    for (; this._to < this._value.length; this._to++) {
      if (46 === this._value.charCodeAt(this._to)) {
        if (!e) break;
        this._from++;
      } else e = !1;
    }
    return this;
  }
  cmp(e) {
    return this._caseSensitive
      ? eA(e, this._value, 0, e.length, this._from, this._to)
      : nA(e, this._value, 0, e.length, this._from, this._to);
  }
  value() {
    return this._value.substring(this._from, this._to);
  }
}
class Nge {
  constructor(e = !0, t = !0) {
    ((this._splitOnBackslash = e), (this._caseSensitive = t));
  }
  reset(e) {
    ((this._from = 0), (this._to = 0), (this._value = e), (this._valueLen = e.length));
    for (let t = e.length - 1; t >= 0; t--, this._valueLen--) {
      const e = this._value.charCodeAt(t);
      if (!(47 === e || (this._splitOnBackslash && 92 === e))) break;
    }
    return this.next();
  }
  hasNext() {
    return this._to < this._valueLen;
  }
  next() {
    this._from = this._to;
    let e = !0;
    for (; this._to < this._valueLen; this._to++) {
      const t = this._value.charCodeAt(this._to);
      if (47 === t || (this._splitOnBackslash && 92 === t)) {
        if (!e) break;
        this._from++;
      } else e = !1;
    }
    return this;
  }
  cmp(e) {
    return this._caseSensitive
      ? eA(e, this._value, 0, e.length, this._from, this._to)
      : nA(e, this._value, 0, e.length, this._from, this._to);
  }
  value() {
    return this._value.substring(this._from, this._to);
  }
}
class Lge {
  constructor(e, t) {
    ((this._ignorePathCasing = e),
      (this._ignoreQueryAndFragment = t),
      (this._states = []),
      (this._stateIdx = 0));
  }
  reset(e) {
    return (
      (this._value = e),
      (this._states = []),
      this._value.scheme && this._states.push(1),
      this._value.authority && this._states.push(2),
      this._value.path &&
        ((this._pathIterator = new Nge(!1, !this._ignorePathCasing(e))),
        this._pathIterator.reset(e.path),
        this._pathIterator.value() && this._states.push(3)),
      this._ignoreQueryAndFragment(e) ||
        (this._value.query && this._states.push(4), this._value.fragment && this._states.push(5)),
      (this._stateIdx = 0),
      this
    );
  }
  next() {
    return (
      3 === this._states[this._stateIdx] && this._pathIterator.hasNext()
        ? this._pathIterator.next()
        : (this._stateIdx += 1),
      this
    );
  }
  hasNext() {
    return (
      (3 === this._states[this._stateIdx] && this._pathIterator.hasNext()) ||
      this._stateIdx < this._states.length - 1
    );
  }
  cmp(e) {
    if (1 === this._states[this._stateIdx]) return tA(e, this._value.scheme);
    if (2 === this._states[this._stateIdx]) return tA(e, this._value.authority);
    if (3 === this._states[this._stateIdx]) return this._pathIterator.cmp(e);
    if (4 === this._states[this._stateIdx]) return JM(e, this._value.query);
    if (5 === this._states[this._stateIdx]) return JM(e, this._value.fragment);
    throw new Error();
  }
  value() {
    if (1 === this._states[this._stateIdx]) return this._value.scheme;
    if (2 === this._states[this._stateIdx]) return this._value.authority;
    if (3 === this._states[this._stateIdx]) return this._pathIterator.value();
    if (4 === this._states[this._stateIdx]) return this._value.query;
    if (5 === this._states[this._stateIdx]) return this._value.fragment;
    throw new Error();
  }
}
class Dge {
  static {
    this.Val = Symbol("undefined_placeholder");
  }
  static wrap(e) {
    return void 0 === e ? Dge.Val : e;
  }
  static unwrap(e) {
    return e === Dge.Val ? void 0 : e;
  }
}
class Tge {
  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() {
    const e = this.right;
    return ((this.right = e.left), (e.left = this), this.updateHeight(), e.updateHeight(), e);
  }
  rotateRight() {
    const e = this.left;
    return ((this.left = e.right), (e.right = this), this.updateHeight(), e.updateHeight(), e);
  }
  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;
  }
}
class Ige {
  static forUris(e = () => !1, t = () => !1) {
    return new Ige(new Lge(e, t));
  }
  static forStrings() {
    return new Ige(new kge());
  }
  static forConfigKeys() {
    return new Ige(new Ege());
  }
  constructor(e) {
    this._iter = e;
  }
  clear() {
    this._root = void 0;
  }
  set(e, t) {
    const n = this._iter.reset(e);
    let i;
    this._root || ((this._root = new Tge()), (this._root.segment = n.value()));
    const r = [];
    for (i = this._root; ; ) {
      const e = n.cmp(i.segment);
      if (e > 0)
        (i.left || ((i.left = new Tge()), (i.left.segment = n.value())),
          r.push([-1, i]),
          (i = i.left));
      else if (e < 0)
        (i.right || ((i.right = new Tge()), (i.right.segment = n.value())),
          r.push([1, i]),
          (i = i.right));
      else {
        if (!n.hasNext()) break;
        (n.next(),
          i.mid || ((i.mid = new Tge()), (i.mid.segment = n.value())),
          r.push([0, i]),
          (i = i.mid));
      }
    }
    const o = Dge.unwrap(i.value);
    ((i.value = Dge.wrap(t)), (i.key = e));
    for (let s = r.length - 1; s >= 0; s--) {
      const e = r[s][1];
      e.updateHeight();
      const t = e.balanceFactor();
      if (t < -1 || t > 1) {
        const t = r[s][0],
          n = r[s + 1][0];
        if (1 === t && 1 === n) r[s][1] = e.rotateLeft();
        else if (-1 === t && -1 === n) r[s][1] = e.rotateRight();
        else if (1 === t && -1 === n)
          ((e.right = r[s + 1][1] = r[s + 1][1].rotateRight()), (r[s][1] = e.rotateLeft()));
        else {
          if (-1 !== t || 1 !== n) throw new Error();
          ((e.left = r[s + 1][1] = r[s + 1][1].rotateLeft()), (r[s][1] = e.rotateRight()));
        }
        if (s > 0)
          switch (r[s - 1][0]) {
            case -1:
              r[s - 1][1].left = r[s][1];
              break;
            case 1:
              r[s - 1][1].right = r[s][1];
              break;
            case 0:
              r[s - 1][1].mid = r[s][1];
          }
        else this._root = r[0][1];
      }
    }
    return o;
  }
  get(e) {
    return Dge.unwrap(this._getNode(e)?.value);
  }
  _getNode(e) {
    const t = this._iter.reset(e);
    let n = this._root;
    for (; n; ) {
      const e = t.cmp(n.segment);
      if (e > 0) n = n.left;
      else if (e < 0) n = n.right;
      else {
        if (!t.hasNext()) break;
        (t.next(), (n = n.mid));
      }
    }
    return n;
  }
  has(e) {
    const t = this._getNode(e);
    return !(void 0 === t?.value && void 0 === t?.mid);
  }
  delete(e) {
    return this._delete(e, !1);
  }
  deleteSuperstr(e) {
    return this._delete(e, !0);
  }
  _delete(e, t) {
    const n = this._iter.reset(e),
      i = [];
    let r = this._root;
    for (; r; ) {
      const e = n.cmp(r.segment);
      if (e > 0) (i.push([-1, r]), (r = r.left));
      else if (e < 0) (i.push([1, r]), (r = r.right));
      else {
        if (!n.hasNext()) break;
        (n.next(), i.push([0, r]), (r = r.mid));
      }
    }
    if (r) {
      if (
        (t
          ? ((r.left = void 0), (r.mid = void 0), (r.right = void 0), (r.height = 1))
          : ((r.key = void 0), (r.value = void 0)),
        !r.mid && !r.value)
      )
        if (r.left && r.right) {
          const e = [[1, r]],
            t = this._min(r.right, e);
          if (t.key) {
            ((r.key = t.key), (r.value = t.value), (r.segment = t.segment));
            const n = t.right;
            if (e.length > 1) {
              const [t, i] = e[e.length - 1];
              switch (t) {
                case -1:
                  i.left = n;
                  break;
                case 0:
                  tR(!1);
                case 1:
                  tR(!1);
              }
            } else r.right = n;
            const o = this._balanceByStack(e);
            if (i.length > 0) {
              const [e, t] = i[i.length - 1];
              switch (e) {
                case -1:
                  t.left = o;
                  break;
                case 0:
                  t.mid = o;
                  break;
                case 1:
                  t.right = o;
              }
            } else this._root = o;
          }
        } else {
          const e = r.left ?? r.right;
          if (i.length > 0) {
            const [t, n] = i[i.length - 1];
            switch (t) {
              case -1:
                n.left = e;
                break;
              case 0:
                n.mid = e;
                break;
              case 1:
                n.right = e;
            }
          } else this._root = e;
        }
      this._root = this._balanceByStack(i) ?? this._root;
    }
  }
  _min(e, t) {
    for (; e.left; ) (t.push([-1, e]), (e = e.left));
    return e;
  }
  _balanceByStack(e) {
    for (let t = e.length - 1; t >= 0; t--) {
      const n = e[t][1];
      n.updateHeight();
      const i = n.balanceFactor();
      if (
        (i > 1
          ? (n.right.balanceFactor() >= 0 || (n.right = n.right.rotateRight()),
            (e[t][1] = n.rotateLeft()))
          : i < -1 &&
            (n.left.balanceFactor() <= 0 || (n.left = n.left.rotateLeft()),
            (e[t][1] = n.rotateRight())),
        !(t > 0))
      )
        return e[0][1];
      switch (e[t - 1][0]) {
        case -1:
          e[t - 1][1].left = e[t][1];
          break;
        case 1:
          e[t - 1][1].right = e[t][1];
          break;
        case 0:
          e[t - 1][1].mid = e[t][1];
      }
    }
  }
  findSubstr(e) {
    const t = this._iter.reset(e);
    let n,
      i = this._root;
    for (; i; ) {
      const e = t.cmp(i.segment);
      if (e > 0) i = i.left;
      else if (e < 0) i = i.right;
      else {
        if (!t.hasNext()) break;
        (t.next(), (n = Dge.unwrap(i.value) || n), (i = i.mid));
      }
    }
    return (i && Dge.unwrap(i.value)) || n;
  }
  findSuperstr(e) {
    return this._findSuperstrOrElement(e, !1);
  }
  _findSuperstrOrElement(e, t) {
    const n = this._iter.reset(e);
    let i = this._root;
    for (; i; ) {
      const e = n.cmp(i.segment);
      if (e > 0) i = i.left;
      else if (e < 0) i = i.right;
      else {
        if (!n.hasNext()) return i.mid ? this._entries(i.mid) : t ? Dge.unwrap(i.value) : void 0;
        (n.next(), (i = i.mid));
      }
    }
  }
  forEach(e) {
    for (const [t, n] of this) e(n, t);
  }
  *[Symbol.iterator]() {
    yield* this._entries(this._root);
  }
  _entries(e) {
    const t = [];
    return (this._dfsEntries(e, t), t[Symbol.iterator]());
  }
  _dfsEntries(e, t) {
    e &&
      (e.left && this._dfsEntries(e.left, t),
      void 0 !== e.value && t.push([e.key, Dge.unwrap(e.value)]),
      e.mid && this._dfsEntries(e.mid, t),
      e.right && this._dfsEntries(e.right, t));
  }
}
const Rge = bV("contextService");
function Oge(e) {
  const t = e;
  return "string" == typeof t?.id && mP.isUri(t.uri);
}
function Mge(e) {
  const t = e;
  return (
    "string" == typeof t?.id &&
    !Oge(e) &&
    !(function (e) {
      const t = e;
      return "string" == typeof t?.id && mP.isUri(t.configPath);
    })(e)
  );
}
const Age = { id: "empty-window" };
let Pge = class {
  constructor(e, t) {
    ((this.raw = t), (this.uri = e.uri), (this.index = e.index), (this.name = e.name));
  }
  toJSON() {
    return { uri: this.uri, name: this.name, index: this.index };
  }
};
const jge = "code-workspace";
SI(2050, "Code Workspace");
const Fge = "4064f6ec-cb38-4ad0-af64-ee6467e63c82";
var Bge = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Vge = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class Wge {
  constructor(e) {
    ((this.copyMimeTypes = []),
      (this.kind = e),
      (this.providedDropEditKinds = [this.kind]),
      (this.providedPasteEditKinds = [this.kind]));
  }
  async provideDocumentPasteEdits(e, t, n, i, r) {
    const o = await this.getEdit(n, r);
    if (o)
      return {
        edits: [
          {
            insertText: o.insertText,
            title: o.title,
            kind: o.kind,
            handledMimeType: o.handledMimeType,
            yieldTo: o.yieldTo,
          },
        ],
        dispose() {},
      };
  }
  async provideDocumentDropEdits(e, t, n, i) {
    const r = await this.getEdit(n, i);
    if (r)
      return {
        edits: [
          {
            insertText: r.insertText,
            title: r.title,
            kind: r.kind,
            handledMimeType: r.handledMimeType,
            yieldTo: r.yieldTo,
          },
        ],
        dispose() {},
      };
  }
}
class Hge extends Wge {
  static {
    this.id = "text";
  }
  constructor() {
    (super(Hhe.Empty.append("text", "plain")),
      (this.id = Hge.id),
      (this.dropMimeTypes = [UU.text]),
      (this.pasteMimeTypes = [UU.text]));
  }
  async getEdit(e, t) {
    const n = e.get(UU.text);
    if (!n) return;
    if (e.has(UU.uriList)) return;
    const i = await n.asString();
    return {
      handledMimeType: UU.text,
      title: SI(926, "Insert Plain Text"),
      insertText: i,
      kind: this.kind,
    };
  }
}
class zge extends Wge {
  constructor() {
    (super(Hhe.Empty.append("uri", "path", "absolute")),
      (this.dropMimeTypes = [UU.uriList]),
      (this.pasteMimeTypes = [UU.uriList]));
  }
  async getEdit(e, t) {
    const n = await qge(e);
    if (!n.length || t.isCancellationRequested) return;
    let i = 0;
    const r = n
      .map(({ uri: e, originalText: t }) => (e.scheme === NP.file ? e.fsPath : (i++, t)))
      .join(" ");
    let o;
    return (
      (o =
        i > 0
          ? n.length > 1
            ? SI(927, "Insert Uris")
            : SI(928, "Insert Uri")
          : n.length > 1
            ? SI(929, "Insert Paths")
            : SI(930, "Insert Path")),
      { handledMimeType: UU.uriList, insertText: r, title: o, kind: this.kind }
    );
  }
}
let Uge = class extends Wge {
  constructor(e) {
    (super(Hhe.Empty.append("uri", "path", "relative")),
      (this._workspaceContextService = e),
      (this.dropMimeTypes = [UU.uriList]),
      (this.pasteMimeTypes = [UU.uriList]));
  }
  async getEdit(e, t) {
    const n = await qge(e);
    if (!n.length || t.isCancellationRequested) return;
    const i = rj(
      n.map(({ uri: e }) => {
        const t = this._workspaceContextService.getWorkspaceFolder(e);
        return t ? fH(t.uri, e) : void 0;
      }),
    );
    return i.length
      ? {
          handledMimeType: UU.uriList,
          insertText: i.join(" "),
          title: n.length > 1 ? SI(931, "Insert Relative Paths") : SI(932, "Insert Relative Path"),
          kind: this.kind,
        }
      : void 0;
  }
};
Uge = Bge([Vge(0, Rge)], Uge);
class $ge {
  constructor() {
    ((this.kind = new Hhe("html")),
      (this.providedPasteEditKinds = [this.kind]),
      (this.copyMimeTypes = []),
      (this.pasteMimeTypes = ["text/html"]),
      (this._yieldTo = [{ mimeType: UU.text }]));
  }
  async provideDocumentPasteEdits(e, t, n, i, r) {
    if (i.triggerKind !== _2.PasteAs && !i.only?.contains(this.kind)) return;
    const o = n.get("text/html"),
      s = await o?.asString();
    return s && !r.isCancellationRequested
      ? {
          dispose() {},
          edits: [
            {
              insertText: s,
              yieldTo: this._yieldTo,
              title: SI(933, "Insert HTML"),
              kind: this.kind,
            },
          ],
        }
      : void 0;
  }
}
async function qge(e) {
  const t = e.get(UU.uriList);
  if (!t) return [];
  const n = await t.asString(),
    i = [];
  for (const r of Whe.parse(n))
    try {
      i.push({ uri: mP.parse(r), originalText: r });
    } catch {}
  return i;
}
const Kge = { scheme: "*", hasAccessToAllModels: !0 };
let Gge = class extends PO {
  constructor(e, t) {
    (super(),
      this._register(e.documentDropEditProvider.register(Kge, new Hge())),
      this._register(e.documentDropEditProvider.register(Kge, new zge())),
      this._register(e.documentDropEditProvider.register(Kge, new Uge(t))));
  }
};
Gge = Bge([Vge(0, mee), Vge(1, Rge)], Gge);
let Zge = class extends PO {
  constructor(e, t) {
    (super(),
      this._register(e.documentPasteEditProvider.register(Kge, new Hge())),
      this._register(e.documentPasteEditProvider.register(Kge, new zge())),
      this._register(e.documentPasteEditProvider.register(Kge, new Uge(t))),
      this._register(e.documentPasteEditProvider.register(Kge, new $ge())));
  }
};
Zge = Bge([Vge(0, mee), Vge(1, Rge)], Zge);
class Yge {
  constructor() {
    ((this.value = ""), (this.pos = 0));
  }
  static {
    this._table = {
      36: 0,
      58: 1,
      44: 2,
      123: 3,
      125: 4,
      92: 5,
      47: 6,
      124: 7,
      43: 11,
      45: 12,
      63: 13,
    };
  }
  static isDigitCharacter(e) {
    return e >= 48 && e <= 57;
  }
  static isVariableCharacter(e) {
    return 95 === e || (e >= 97 && e <= 122) || (e >= 65 && e <= 90);
  }
  text(e) {
    ((this.value = e), (this.pos = 0));
  }
  tokenText(e) {
    return this.value.substr(e.pos, e.len);
  }
  next() {
    if (this.pos >= this.value.length) return { type: 14, pos: this.pos, len: 0 };
    const e = this.pos;
    let t,
      n = 0,
      i = this.value.charCodeAt(e);
    if (((t = Yge._table[i]), "number" == typeof t))
      return ((this.pos += 1), { type: t, pos: e, len: 1 });
    if (Yge.isDigitCharacter(i)) {
      t = 8;
      do {
        ((n += 1), (i = this.value.charCodeAt(e + n)));
      } while (Yge.isDigitCharacter(i));
      return ((this.pos += n), { type: t, pos: e, len: n });
    }
    if (Yge.isVariableCharacter(i)) {
      t = 9;
      do {
        i = this.value.charCodeAt(e + ++n);
      } while (Yge.isVariableCharacter(i) || Yge.isDigitCharacter(i));
      return ((this.pos += n), { type: t, pos: e, len: n });
    }
    t = 10;
    do {
      ((n += 1), (i = this.value.charCodeAt(e + n)));
    } while (
      !isNaN(i) &&
      void 0 === Yge._table[i] &&
      !Yge.isDigitCharacter(i) &&
      !Yge.isVariableCharacter(i)
    );
    return ((this.pos += n), { type: t, pos: e, len: n });
  }
}
class Xge {
  constructor() {
    this._children = [];
  }
  appendChild(e) {
    return (
      e instanceof Qge && this._children[this._children.length - 1] instanceof Qge
        ? (this._children[this._children.length - 1].value += e.value)
        : ((e.parent = this), this._children.push(e)),
      this
    );
  }
  replace(e, t) {
    const { parent: n } = e,
      i = n.children.indexOf(e),
      r = n.children.slice(0);
    (r.splice(i, 1, ...t),
      (n._children = r),
      (function e(t, n) {
        for (const i of t) ((i.parent = n), e(i.children, i));
      })(t, n));
  }
  get children() {
    return this._children;
  }
  get rightMostDescendant() {
    return this._children.length > 0
      ? this._children[this._children.length - 1].rightMostDescendant
      : this;
  }
  get snippet() {
    let e = this;
    for (;;) {
      if (!e) return;
      if (e instanceof spe) return e;
      e = e.parent;
    }
  }
  toString() {
    return this.children.reduce((e, t) => e + t.toString(), "");
  }
  len() {
    return 0;
  }
}
let Qge = class e extends Xge {
  constructor(e) {
    (super(), (this.value = e));
  }
  toString() {
    return this.value;
  }
  len() {
    return this.value.length;
  }
  clone() {
    return new e(this.value);
  }
};
class Jge extends Xge {}
class epe extends Jge {
  static compareByIndex(e, t) {
    return e.index === t.index
      ? 0
      : e.isFinalTabstop
        ? 1
        : t.isFinalTabstop || e.index < t.index
          ? -1
          : e.index > t.index
            ? 1
            : 0;
  }
  constructor(e) {
    (super(), (this.index = e));
  }
  get isFinalTabstop() {
    return 0 === this.index;
  }
  get choice() {
    return 1 === this._children.length && this._children[0] instanceof tpe
      ? this._children[0]
      : void 0;
  }
  clone() {
    const e = new epe(this.index);
    return (
      this.transform && (e.transform = this.transform.clone()),
      (e._children = this.children.map((e) => e.clone())),
      e
    );
  }
}
class tpe extends Xge {
  constructor() {
    (super(...arguments), (this.options = []));
  }
  appendChild(e) {
    return (e instanceof Qge && ((e.parent = this), this.options.push(e)), this);
  }
  toString() {
    return this.options[0].value;
  }
  len() {
    return this.options[0].len();
  }
  clone() {
    const e = new tpe();
    return (this.options.forEach(e.appendChild, e), e);
  }
}
class npe extends Xge {
  constructor() {
    (super(...arguments), (this.regexp = new RegExp("")));
  }
  resolve(e) {
    const t = this;
    let n = !1,
      i = e.replace(this.regexp, function () {
        return ((n = !0), t._replace(Array.prototype.slice.call(arguments, 0, -2)));
      });
    return (
      !n &&
        this._children.some((e) => e instanceof ipe && Boolean(e.elseValue)) &&
        (i = this._replace([])),
      i
    );
  }
  _replace(e) {
    let t = "";
    for (const n of this._children)
      if (n instanceof ipe) {
        let i = e[n.index] || "";
        ((i = n.resolve(i)), (t += i));
      } else t += n.toString();
    return t;
  }
  toString() {
    return "";
  }
  clone() {
    const e = new npe();
    return (
      (e.regexp = new RegExp(
        this.regexp.source,
        (this.regexp.ignoreCase ? "i" : "") + (this.regexp.global ? "g" : ""),
      )),
      (e._children = this.children.map((e) => e.clone())),
      e
    );
  }
}
class ipe extends Xge {
  constructor(e, t, n, i) {
    (super(), (this.index = e), (this.shorthandName = t), (this.ifValue = n), (this.elseValue = i));
  }
  resolve(e) {
    return "upcase" === this.shorthandName
      ? e
        ? e.toLocaleUpperCase()
        : ""
      : "downcase" === this.shorthandName
        ? e
          ? e.toLocaleLowerCase()
          : ""
        : "capitalize" === this.shorthandName
          ? e
            ? e[0].toLocaleUpperCase() + e.substr(1)
            : ""
          : "pascalcase" === this.shorthandName
            ? e
              ? this._toPascalCase(e)
              : ""
            : "camelcase" === this.shorthandName
              ? e
                ? this._toCamelCase(e)
                : ""
              : Boolean(e) && "string" == typeof this.ifValue
                ? this.ifValue
                : Boolean(e) || "string" != typeof this.elseValue
                  ? e || ""
                  : this.elseValue;
  }
  _toPascalCase(e) {
    const t = e.match(/[a-z0-9]+/gi);
    return t ? t.map((e) => e.charAt(0).toUpperCase() + e.substr(1)).join("") : e;
  }
  _toCamelCase(e) {
    const t = e.match(/[a-z0-9]+/gi);
    return t
      ? t
          .map((e, t) =>
            0 === t
              ? e.charAt(0).toLowerCase() + e.substr(1)
              : e.charAt(0).toUpperCase() + e.substr(1),
          )
          .join("")
      : e;
  }
  clone() {
    return new ipe(this.index, this.shorthandName, this.ifValue, this.elseValue);
  }
}
class rpe extends Jge {
  constructor(e) {
    (super(), (this.name = e));
  }
  resolve(e) {
    let t = e.resolve(this);
    return (
      this.transform && (t = this.transform.resolve(t || "")),
      void 0 !== t && ((this._children = [new Qge(t)]), !0)
    );
  }
  clone() {
    const e = new rpe(this.name);
    return (
      this.transform && (e.transform = this.transform.clone()),
      (e._children = this.children.map((e) => e.clone())),
      e
    );
  }
}
function ope(e, t) {
  const n = [...e];
  for (; n.length > 0; ) {
    const e = n.shift();
    if (!t(e)) break;
    n.unshift(...e.children);
  }
}
class spe extends Xge {
  get placeholderInfo() {
    if (!this._placeholders) {
      const e = [];
      let t;
      (this.walk(function (n) {
        return (n instanceof epe && (e.push(n), (t = !t || t.index < n.index ? n : t)), !0);
      }),
        (this._placeholders = { all: e, last: t }));
    }
    return this._placeholders;
  }
  get placeholders() {
    const { all: e } = this.placeholderInfo;
    return e;
  }
  offset(e) {
    let t = 0,
      n = !1;
    return (this.walk((i) => (i === e ? ((n = !0), !1) : ((t += i.len()), !0))), n ? t : -1);
  }
  fullLen(e) {
    let t = 0;
    return (ope([e], (e) => ((t += e.len()), !0)), t);
  }
  enclosingPlaceholders(e) {
    const t = [];
    let { parent: n } = e;
    for (; n; ) (n instanceof epe && t.push(n), (n = n.parent));
    return t;
  }
  resolveVariables(e) {
    return (
      this.walk((t) => (t instanceof rpe && t.resolve(e) && (this._placeholders = void 0), !0)),
      this
    );
  }
  appendChild(e) {
    return ((this._placeholders = void 0), super.appendChild(e));
  }
  replace(e, t) {
    return ((this._placeholders = void 0), super.replace(e, t));
  }
  clone() {
    const e = new spe();
    return ((this._children = this.children.map((e) => e.clone())), e);
  }
  walk(e) {
    ope(this.children, e);
  }
}
class ape {
  constructor() {
    ((this._scanner = new Yge()), (this._token = { type: 14, pos: 0, len: 0 }));
  }
  static escape(e) {
    return e.replace(/\$|}|\\/g, "\\$&");
  }
  static guessNeedsClipboard(e) {
    return /\${?CLIPBOARD/.test(e);
  }
  parse(e, t, n) {
    const i = new spe();
    return (this.parseFragment(e, i), this.ensureFinalTabstop(i, n ?? !1, t ?? !1), i);
  }
  parseFragment(e, t) {
    const n = t.children.length;
    for (this._scanner.text(e), this._token = this._scanner.next(); this._parse(t); );
    const i = new Map(),
      r = [];
    t.walk(
      (e) => (
        e instanceof epe &&
          (e.isFinalTabstop
            ? i.set(0, void 0)
            : !i.has(e.index) && e.children.length > 0
              ? i.set(e.index, e.children)
              : r.push(e)),
        !0
      ),
    );
    const o = (e, n) => {
        const r = i.get(e.index);
        if (!r) return;
        const s = new epe(e.index);
        s.transform = e.transform;
        for (const t of r) {
          const e = t.clone();
          (s.appendChild(e),
            e instanceof epe &&
              i.has(e.index) &&
              !n.has(e.index) &&
              (n.add(e.index), o(e, n), n.delete(e.index)));
        }
        t.replace(e, [s]);
      },
      s = new Set();
    for (const a of r) o(a, s);
    return t.children.slice(n);
  }
  ensureFinalTabstop(e, t, n) {
    if (t || (n && e.placeholders.length > 0)) {
      const t = e.placeholders.find((e) => 0 === e.index);
      t || e.appendChild(new epe(0));
    }
  }
  _accept(e, t) {
    if (void 0 === e || this._token.type === e) {
      const e = !t || this._scanner.tokenText(this._token);
      return ((this._token = this._scanner.next()), e);
    }
    return !1;
  }
  _backTo(e) {
    return ((this._scanner.pos = e.pos + e.len), (this._token = e), !1);
  }
  _until(e) {
    const t = this._token;
    for (; this._token.type !== e; ) {
      if (14 === this._token.type) return !1;
      if (5 === this._token.type) {
        const e = this._scanner.next();
        if (0 !== e.type && 4 !== e.type && 5 !== e.type) return !1;
      }
      this._token = this._scanner.next();
    }
    const n = this._scanner.value.substring(t.pos, this._token.pos).replace(/\\(\$|}|\\)/g, "$1");
    return ((this._token = this._scanner.next()), n);
  }
  _parse(e) {
    return (
      this._parseEscaped(e) ||
      this._parseTabstopOrVariableName(e) ||
      this._parseComplexPlaceholder(e) ||
      this._parseComplexVariable(e) ||
      this._parseAnything(e)
    );
  }
  _parseEscaped(e) {
    let t;
    return (
      !!(t = this._accept(5, !0)) &&
      ((t = this._accept(0, !0) || this._accept(4, !0) || this._accept(5, !0) || t),
      e.appendChild(new Qge(t)),
      !0)
    );
  }
  _parseTabstopOrVariableName(e) {
    let t;
    const n = this._token;
    return this._accept(0) && (t = this._accept(9, !0) || this._accept(8, !0))
      ? (e.appendChild(/^\d+$/.test(t) ? new epe(Number(t)) : new rpe(t)), !0)
      : this._backTo(n);
  }
  _parseComplexPlaceholder(e) {
    let t;
    const n = this._token;
    if (!(this._accept(0) && this._accept(3) && (t = this._accept(8, !0)))) return this._backTo(n);
    const i = new epe(Number(t));
    if (this._accept(1))
      for (;;) {
        if (this._accept(4)) return (e.appendChild(i), !0);
        if (!this._parse(i))
          return (e.appendChild(new Qge("${" + t + ":")), i.children.forEach(e.appendChild, e), !0);
      }
    else {
      if (!(i.index > 0 && this._accept(7)))
        return this._accept(6)
          ? this._parseTransform(i)
            ? (e.appendChild(i), !0)
            : (this._backTo(n), !1)
          : this._accept(4)
            ? (e.appendChild(i), !0)
            : this._backTo(n);
      {
        const t = new tpe();
        for (;;) {
          if (this._parseChoiceElement(t)) {
            if (this._accept(2)) continue;
            if (this._accept(7) && (i.appendChild(t), this._accept(4)))
              return (e.appendChild(i), !0);
          }
          return (this._backTo(n), !1);
        }
      }
    }
  }
  _parseChoiceElement(e) {
    const t = this._token,
      n = [];
    for (; 2 !== this._token.type && 7 !== this._token.type; ) {
      let e;
      if (
        ((e = (e = this._accept(5, !0))
          ? this._accept(2, !0) || this._accept(7, !0) || this._accept(5, !0) || e
          : this._accept(void 0, !0)),
        !e)
      )
        return (this._backTo(t), !1);
      n.push(e);
    }
    return 0 === n.length ? (this._backTo(t), !1) : (e.appendChild(new Qge(n.join(""))), !0);
  }
  _parseComplexVariable(e) {
    let t;
    const n = this._token;
    if (!(this._accept(0) && this._accept(3) && (t = this._accept(9, !0)))) return this._backTo(n);
    const i = new rpe(t);
    if (!this._accept(1))
      return this._accept(6)
        ? this._parseTransform(i)
          ? (e.appendChild(i), !0)
          : (this._backTo(n), !1)
        : this._accept(4)
          ? (e.appendChild(i), !0)
          : this._backTo(n);
    for (;;) {
      if (this._accept(4)) return (e.appendChild(i), !0);
      if (!this._parse(i))
        return (e.appendChild(new Qge("${" + t + ":")), i.children.forEach(e.appendChild, e), !0);
    }
  }
  _parseTransform(e) {
    const t = new npe();
    let n = "",
      i = "";
    for (; !this._accept(6); ) {
      let e;
      if ((e = this._accept(5, !0))) ((e = this._accept(6, !0) || e), (n += e));
      else {
        if (14 === this._token.type) return !1;
        n += this._accept(void 0, !0);
      }
    }
    for (; !this._accept(6); ) {
      let e;
      if ((e = this._accept(5, !0)))
        ((e = this._accept(5, !0) || this._accept(6, !0) || e), t.appendChild(new Qge(e)));
      else if (!this._parseFormatString(t) && !this._parseAnything(t)) return !1;
    }
    for (; !this._accept(4); ) {
      if (14 === this._token.type) return !1;
      i += this._accept(void 0, !0);
    }
    try {
      t.regexp = new RegExp(n, i);
    } catch (spt) {
      return !1;
    }
    return ((e.transform = t), !0);
  }
  _parseFormatString(e) {
    const t = this._token;
    if (!this._accept(0)) return !1;
    let n = !1;
    this._accept(3) && (n = !0);
    const i = this._accept(8, !0);
    if (!i) return (this._backTo(t), !1);
    if (!n) return (e.appendChild(new ipe(Number(i))), !0);
    if (this._accept(4)) return (e.appendChild(new ipe(Number(i))), !0);
    if (!this._accept(1)) return (this._backTo(t), !1);
    if (this._accept(6)) {
      const n = this._accept(9, !0);
      return n && this._accept(4)
        ? (e.appendChild(new ipe(Number(i), n)), !0)
        : (this._backTo(t), !1);
    }
    if (this._accept(11)) {
      const t = this._until(4);
      if (t) return (e.appendChild(new ipe(Number(i), void 0, t, void 0)), !0);
    } else if (this._accept(12)) {
      const t = this._until(4);
      if (t) return (e.appendChild(new ipe(Number(i), void 0, void 0, t)), !0);
    } else if (this._accept(13)) {
      const t = this._until(1);
      if (t) {
        const n = this._until(4);
        if (n) return (e.appendChild(new ipe(Number(i), void 0, t, n)), !0);
      }
    } else {
      const t = this._until(4);
      if (t) return (e.appendChild(new ipe(Number(i), void 0, void 0, t)), !0);
    }
    return (this._backTo(t), !1);
  }
  _parseAnything(e) {
    return (
      14 !== this._token.type &&
      (e.appendChild(new Qge(this._scanner.tokenText(this._token))), this._accept(void 0), !0)
    );
  }
}
function lpe(e, t, n) {
  return ("string" == typeof n.insertText ? "" === n.insertText : "" === n.insertText.snippet)
    ? { edits: n.additionalEdit?.edits ?? [] }
    : {
        edits: [
          ...t.map(
            (t) =>
              new oge(e, {
                range: t,
                text:
                  "string" == typeof n.insertText
                    ? ape.escape(n.insertText) + "$0"
                    : n.insertText.snippet,
                insertAsSnippet: !0,
              }),
          ),
          ...(n.additionalEdit?.edits ?? []),
        ],
      };
}
function cpe(e) {
  function t(e, t) {
    return "mimeType" in e ? e.mimeType === t.handledMimeType : !!t.kind && e.kind.contains(t.kind);
  }
  const n = new Map();
  for (const o of e)
    for (const i of o.yieldTo ?? [])
      for (const r of e)
        if (r !== o && t(i, r)) {
          let e = n.get(o);
          (e || ((e = []), n.set(o, e)), e.push(r));
        }
  if (!n.size) return Array.from(e);
  const i = new Set(),
    r = [];
  return (function e(t) {
    if (!t.length) return [];
    const o = t[0];
    if (r.includes(o)) return t;
    if (i.has(o)) return e(t.slice(1));
    let s = [];
    const a = n.get(o);
    return (a && (r.push(o), (s = e(a)), r.pop()), i.add(o), [...s, o, ...e(t.slice(1))]);
  })(Array.from(e));
}
(vG.white.toString(), vG.white.toString());
const dpe = Object.freeze({
  allowedTags: { override: ["b", "i", "u", "code", "span"] },
  allowedAttributes: { override: ["class"] },
});
let upe = class extends PO {
  get onDidClick() {
    return this._onDidClick.event;
  }
  constructor(e, t) {
    (super(),
      (this._label = ""),
      (this._onDidClick = this._register(new QO())),
      (this._onDidEscape = this._register(new QO())),
      (this.options = t),
      (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", !!t.secondary));
    const n = t.secondary ? t.buttonSecondaryBackground : t.buttonBackground,
      i = t.secondary ? t.buttonSecondaryForeground : t.buttonForeground;
    ((this._element.style.color = i || ""),
      (this._element.style.backgroundColor = n || ""),
      t.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")),
      "string" == typeof t.title && this.setTitle(t.title),
      "string" == typeof t.ariaLabel && this._element.setAttribute("aria-label", t.ariaLabel),
      e.appendChild(this._element),
      (this.enabled = !t.disabled),
      this._register(iJ.addTarget(this._element)),
      [DB.CLICK, nJ.Tap].forEach((e) => {
        this._register(
          $F(this._element, e, (e) => {
            this.enabled ? this._onDidClick.fire(e) : IB(e);
          }),
        );
      }),
      this._register(
        $F(this._element, DB.KEY_DOWN, (e) => {
          const t = new wO(e);
          let n = !1;
          (this.enabled && (t.equals(3) || t.equals(10))
            ? (this._onDidClick.fire(e), (n = !0))
            : t.equals(9) && (this._onDidEscape.fire(e), this._element.blur(), (n = !0)),
            n && IB(t, !0));
        }),
      ),
      this._register(
        $F(this._element, DB.MOUSE_OVER, (e) => {
          this._element.classList.contains("disabled") || this.updateBackground(!0);
        }),
      ),
      this._register(
        $F(this._element, DB.MOUSE_OUT, (e) => {
          this.updateBackground(!1);
        }),
      ),
      (this.focusTracker = this._register(OB(this._element))),
      this._register(
        this.focusTracker.onDidFocus(() => {
          this.enabled && this.updateBackground(!0);
        }),
      ),
      this._register(
        this.focusTracker.onDidBlur(() => {
          this.enabled && this.updateBackground(!1);
        }),
      ));
  }
  dispose() {
    (super.dispose(), this._element.remove());
  }
  getContentElements(e) {
    const t = [];
    for (let n of Wse(e))
      if ("string" == typeof n) {
        if (((n = n.trim()), "" === n)) continue;
        const e = document.createElement("span");
        ((e.textContent = n), t.push(e));
      } else t.push(n);
    return t;
  }
  updateBackground(e) {
    let t;
    ((t = this.options.secondary
      ? e
        ? this.options.buttonSecondaryHoverBackground
        : this.options.buttonSecondaryBackground
      : e
        ? this.options.buttonHoverBackground
        : this.options.buttonBackground),
      t && (this._element.style.backgroundColor = t));
  }
  get element() {
    return this._element;
  }
  set label(e) {
    if (this._label === e) return;
    if (
      sre(this._label) &&
      sre(e) &&
      (function (e, t) {
        return (
          e === t ||
          (!(!e || !t) &&
            e.value === t.value &&
            e.isTrusted === t.isTrusted &&
            e.supportThemeIcons === t.supportThemeIcons &&
            e.supportHtml === t.supportHtml &&
            e.supportAlertSyntax === t.supportAlertSyntax &&
            (e.baseUri === t.baseUri ||
              (!!e.baseUri && !!t.baseUri && lH(mP.from(e.baseUri), mP.from(t.baseUri)))))
        );
      })(this._label, e)
    )
      return;
    this._element.classList.add("monaco-text-button");
    const t = this.options.supportShortLabel ? this._labelElement : this._element;
    if (sre(e)) {
      const n = Use(e, void 0, document.createElement("span"));
      n.dispose();
      const i = n.element.querySelector("p")?.innerHTML;
      i ? Bse(t, i, dpe) : PB(t);
    } else this.options.supportIcons ? PB(t, ...this.getContentElements(e)) : (t.textContent = e);
    let n = "";
    ("string" == typeof this.options.title
      ? (n = this.options.title)
      : this.options.title &&
        (n = (function (e) {
          if ("string" == typeof e) return e;
          let t = e.value ?? "";
          return (
            t.length > 1e5 && (t = `${t.substr(0, 1e5)}…`),
            Yse(yoe(t, { async: !1, renderer: nae.value }), { isTrusted: !1 }, {})
              .toString()
              .replace(/&(#\d+|[a-zA-Z]+);/g, (e) => eae.get(e) ?? e)
              .trim()
          );
        })(e)),
      this.setTitle(n),
      this._setAriaLabel(),
      (this._label = e));
  }
  get label() {
    return this._label;
  }
  _setAriaLabel() {
    "string" == typeof this.options.ariaLabel
      ? this._element.setAttribute("aria-label", this.options.ariaLabel)
      : "string" == typeof this.options.title &&
        this._element.setAttribute("aria-label", this.options.title);
  }
  set icon(e) {
    this._setAriaLabel();
    const t = Array.from(this._element.classList).filter((e) => e.startsWith("codicon-"));
    (this._element.classList.remove(...t), this._element.classList.add(...AV.asClassNameArray(e)));
  }
  set enabled(e) {
    e
      ? (this._element.classList.remove("disabled"),
        this._element.setAttribute("aria-disabled", String(!1)),
        (this._element.tabIndex = 0))
      : (this._element.classList.add("disabled"),
        this._element.setAttribute("aria-disabled", String(!0)));
  }
  get enabled() {
    return !this._element.classList.contains("disabled");
  }
  setTitle(e) {
    this._hover || "" === e
      ? this._hover && this._hover.update(e)
      : (this._hover = this._register(
          yae().setupManagedHover(this.options.hoverDelegate ?? Bne("element"), this._element, e),
        ));
  }
};
function hpe(e, t) {
  return t && (e.stack || e.stacktrace)
    ? SI(29, "{0}: {1}", ppe(e), gpe(e.stack) || gpe(e.stacktrace))
    : ppe(e);
}
function gpe(e) {
  return Array.isArray(e) ? e.join("\n") : e;
}
function ppe(e) {
  return "ERR_UNC_HOST_NOT_ALLOWED" === e.code
    ? `${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`
    : "string" == typeof e.code && "number" == typeof e.errno && "string" == typeof e.syscall
      ? SI(30, "A system error occurred ({0})", e.message)
      : e.message || SI(31, "An unknown error occurred. Please consult the log for more details.");
}
function fpe(e = null, t = !1) {
  if (!e) return SI(32, "An unknown error occurred. Please consult the log for more details.");
  if (Array.isArray(e)) {
    const n = rj(e),
      i = fpe(n[0], t);
    return n.length > 1 ? SI(33, "{0} ({1} errors in total)", i, n.length) : i;
  }
  if (oR(e)) return e;
  if (e.detail) {
    const n = e.detail;
    if (n.error) return hpe(n.error, t);
    if (n.exception) return hpe(n.exception, t);
  }
  return e.stack
    ? hpe(e, t)
    : e.message
      ? e.message
      : SI(34, "An unknown error occurred. Please consult the log for more details.");
}
const mpe = VB,
  _pe = {
    keybindingLabelBackground: void 0,
    keybindingLabelForeground: void 0,
    keybindingLabelBorder: void 0,
    keybindingLabelBottomBorder: void 0,
    keybindingLabelShadow: void 0,
  };
class vpe extends PO {
  constructor(e, t, n) {
    (super(),
      (this.os = t),
      (this.keyElements = new Set()),
      (this.options = n || Object.create(null)));
    const i = this.options.keybindingLabelForeground;
    ((this.domNode = MB(e, mpe(".monaco-keybinding"))),
      i && (this.domNode.style.color = i),
      (this.hover = this._register(yae().setupManagedHover(Bne("mouse"), this.domNode, ""))),
      (this.didEverRender = !1),
      e.appendChild(this.domNode));
  }
  set(e, t) {
    (this.didEverRender && this.keybinding === e && vpe.areSame(this.matches, t)) ||
      ((this.keybinding = e), (this.matches = t), this.render());
  }
  render() {
    if ((this.clear(), this.keybinding)) {
      const e = this.keybinding.getChords();
      e[0] && this.renderChord(this.domNode, e[0], this.matches ? this.matches.firstPart : null);
      for (let n = 1; n < e.length; n++)
        (MB(this.domNode, mpe("span.monaco-keybinding-key-chord-separator", void 0, " ")),
          this.renderChord(this.domNode, e[n], this.matches ? this.matches.chordPart : null));
      const t = this.options.disableTitle ? void 0 : this.keybinding.getAriaLabel() || void 0;
      (this.hover.update(t), this.domNode.setAttribute("aria-label", t || ""));
    } else
      this.options && this.options.renderUnboundKeybindings && this.renderUnbound(this.domNode);
    this.didEverRender = !0;
  }
  clear() {
    (zF(this.domNode), this.keyElements.clear());
  }
  renderChord(e, t, n) {
    const i = Gde.modifierLabels[this.os];
    (t.ctrlKey && this.renderKey(e, i.ctrlKey, Boolean(n?.ctrlKey), i.separator),
      t.shiftKey && this.renderKey(e, i.shiftKey, Boolean(n?.shiftKey), i.separator),
      t.altKey && this.renderKey(e, i.altKey, Boolean(n?.altKey), i.separator),
      t.metaKey && this.renderKey(e, i.metaKey, Boolean(n?.metaKey), i.separator));
    const r = t.keyLabel;
    r && this.renderKey(e, r, Boolean(n?.keyCode), "");
  }
  renderKey(e, t, n, i) {
    (MB(e, this.createKeyElement(t, n ? ".highlight" : "")),
      i && MB(e, mpe("span.monaco-keybinding-key-separator", void 0, i)));
  }
  renderUnbound(e) {
    MB(e, this.createKeyElement(SI(15, "Unbound")));
  }
  createKeyElement(e, t = "") {
    const n = mpe("span.monaco-keybinding-key" + t, void 0, e);
    return (
      this.keyElements.add(n),
      this.options.keybindingLabelBackground &&
        (n.style.backgroundColor = this.options.keybindingLabelBackground),
      this.options.keybindingLabelBorder &&
        (n.style.borderColor = this.options.keybindingLabelBorder),
      this.options.keybindingLabelBottomBorder &&
        (n.style.borderBottomColor = this.options.keybindingLabelBottomBorder),
      this.options.keybindingLabelShadow &&
        (n.style.boxShadow = `inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),
      n
    );
  }
  static areSame(e, t) {
    return (
      e === t ||
      (!e && !t) ||
      (!!e && !!t && zz(e.firstPart, t.firstPart) && zz(e.chordPart, t.chordPart))
    );
  }
}
const bpe = bV("layoutService");
var ype = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  xpe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const wpe = "acceptSelectedCodeAction",
  Cpe = "previewSelectedCodeAction";
class Spe {
  get templateId() {
    return "header";
  }
  renderTemplate(e) {
    e.classList.add("group-header");
    const t = document.createElement("span");
    return (e.append(t), { container: e, text: t });
  }
  renderElement(e, t, n) {
    n.text.textContent = e.group?.title ?? e.label ?? "";
  }
  disposeTemplate(e) {}
}
class kpe {
  get templateId() {
    return "separator";
  }
  renderTemplate(e) {
    e.classList.add("separator");
    const t = document.createElement("span");
    return (e.append(t), { container: e, text: t });
  }
  renderElement(e, t, n) {
    n.text.textContent = e.label ?? "";
  }
  disposeTemplate(e) {}
}
let Epe = class {
  get templateId() {
    return "action";
  }
  constructor(e, t) {
    ((this._supportsPreview = e), (this._keybindingService = t));
  }
  renderTemplate(e) {
    e.classList.add(this.templateId);
    const t = document.createElement("div");
    ((t.className = "icon"), e.append(t));
    const n = document.createElement("span");
    ((n.className = "title"), e.append(n));
    const i = document.createElement("span");
    ((i.className = "description"), e.append(i));
    return { container: e, icon: t, text: n, description: i, keybinding: new vpe(e, GR) };
  }
  renderElement(e, t, n) {
    if (
      (e.group?.icon
        ? ((n.icon.className = AV.asClassName(e.group.icon)),
          e.group.icon.color && (n.icon.style.color = yG(e.group.icon.color.id)))
        : ((n.icon.className = AV.asClassName(OV.lightBulb)),
          (n.icon.style.color = "var(--vscode-editorLightBulb-foreground)")),
      !e.item || !e.label)
    )
      return;
    (!(function (e, ...t) {
      e ? WB(...t) : HB(...t);
    })(!e.hideIcon, n.icon),
      (n.text.textContent = Ipe(e.label)),
      e.keybinding
        ? ((n.description.textContent = e.keybinding.getLabel()),
          (n.description.style.display = "inline"),
          (n.description.style.letterSpacing = "0.5px"))
        : e.description
          ? ((n.description.textContent = Ipe(e.description)),
            (n.description.style.display = "inline"))
          : ((n.description.textContent = ""), (n.description.style.display = "none")));
    const i = this._keybindingService.lookupKeybinding(wpe)?.getLabel(),
      r = this._keybindingService.lookupKeybinding(Cpe)?.getLabel();
    (n.container.classList.toggle("option-disabled", e.disabled),
      e.tooltip
        ? (n.container.title = e.tooltip)
        : e.disabled
          ? (n.container.title = e.label)
          : i && r
            ? this._supportsPreview && e.canPreview
              ? (n.container.title = SI(1653, "{0} to Apply, {1} to Preview", i, r))
              : (n.container.title = SI(1654, "{0} to Apply", i))
            : (n.container.title = ""));
  }
  disposeTemplate(e) {
    e.keybinding.dispose();
  }
};
Epe = ype([xpe(1, N5)], Epe);
class Npe extends UIEvent {
  constructor() {
    super("acceptSelectedAction");
  }
}
class Lpe extends UIEvent {
  constructor() {
    super("previewSelectedAction");
  }
}
function Dpe(e) {
  if ("action" === e.kind) return e.label;
}
let Tpe = class extends PO {
  constructor(e, t, n, i, r, o, s, a) {
    (super(),
      (this._delegate = i),
      (this._contextViewService = o),
      (this._keybindingService = s),
      (this._layoutService = a),
      (this._actionLineHeight = 28),
      (this._headerLineHeight = 28),
      (this._separatorLineHeight = 8),
      (this.cts = this._register(new cM())),
      (this.domNode = document.createElement("div")),
      this.domNode.classList.add("actionList"));
    const l = {
      getHeight: (e) => {
        switch (e.kind) {
          case "header":
            return this._headerLineHeight;
          case "separator":
            return this._separatorLineHeight;
          default:
            return this._actionLineHeight;
        }
      },
      getTemplateId: (e) => e.kind,
    };
    ((this._list = this._register(
      new gle(e, this.domNode, l, [new Epe(t, this._keybindingService), new Spe(), new kpe()], {
        keyboardSupport: !1,
        typeNavigationEnabled: !0,
        keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: Dpe },
        accessibilityProvider: {
          getAriaLabel: (e) => {
            if ("action" === e.kind) {
              let t = e.label ? Ipe(e?.label) : "";
              return (
                e.description && (t = t + ", " + Ipe(e.description)),
                e.disabled && (t = SI(1655, "{0}, Disabled Reason: {1}", t, e.disabled)),
                t
              );
            }
            return null;
          },
          getWidgetAriaLabel: () => SI(1656, "Action Widget"),
          getRole: (e) => ("action" === e.kind ? "option" : "separator"),
          getWidgetRole: () => "listbox",
          ...r,
        },
      }),
    )),
      this._list.style(mue),
      this._register(this._list.onMouseClick((e) => this.onListClick(e))),
      this._register(this._list.onMouseOver((e) => this.onListHover(e))),
      this._register(this._list.onDidChangeFocus(() => this.onFocus())),
      this._register(this._list.onDidChangeSelection((e) => this.onListSelection(e))),
      (this._allMenuItems = n),
      this._list.splice(0, this._list.length, this._allMenuItems),
      this._list.length && this.focusNext());
  }
  focusCondition(e) {
    return !e.disabled && "action" === e.kind;
  }
  hide(e) {
    (this._delegate.onHide(e), this.cts.cancel(), this._contextViewService.hideContextView());
  }
  layout(e) {
    const t = this._allMenuItems.filter((e) => "header" === e.kind).length,
      n = this._allMenuItems.filter((e) => "separator" === e.kind).length,
      i =
        this._allMenuItems.length * this._actionLineHeight +
        t * this._headerLineHeight -
        t * this._actionLineHeight +
        n * this._separatorLineHeight -
        n * this._actionLineHeight;
    this._list.layout(i);
    let r = e;
    if (this._allMenuItems.length >= 50) r = 380;
    else {
      const t = this._allMenuItems.map((e, t) => {
        const n = this.domNode.ownerDocument.getElementById(this._list.getElementID(t));
        if (n) {
          n.style.width = "auto";
          const e = n.getBoundingClientRect().width;
          return ((n.style.width = ""), e);
        }
        return 0;
      });
      r = Math.max(...t, e);
    }
    const o = Math.min(i, 0.7 * this._layoutService.getContainer(MF(this.domNode)).clientHeight);
    return (
      this._list.layout(o, r),
      (this.domNode.style.height = `${o}px`),
      this._list.domFocus(),
      r
    );
  }
  focusPrevious() {
    this._list.focusPrevious(1, !0, void 0, this.focusCondition);
  }
  focusNext() {
    this._list.focusNext(1, !0, void 0, this.focusCondition);
  }
  acceptSelected(e) {
    const t = this._list.getFocus();
    if (0 === t.length) return;
    const n = t[0],
      i = this._list.element(n);
    if (!this.focusCondition(i)) return;
    const r = e ? new Lpe() : new Npe();
    this._list.setSelection([n], r);
  }
  onListSelection(e) {
    if (!e.elements.length) return;
    const t = e.elements[0];
    t.item && this.focusCondition(t)
      ? this._delegate.onSelect(t.item, e.browserEvent instanceof Lpe)
      : this._list.setSelection([]);
  }
  onFocus() {
    const e = this._list.getFocus();
    if (0 === e.length) return;
    const t = e[0],
      n = this._list.element(t);
    this._delegate.onFocus?.(n.item);
  }
  async onListHover(e) {
    const t = e.element;
    if (t && t.item && this.focusCondition(t)) {
      if (this._delegate.onHover && !t.disabled && "action" === t.kind) {
        const e = await this._delegate.onHover(t.item, this.cts.token);
        t.canPreview = e ? e.canPreview : void 0;
      }
      e.index && this._list.splice(e.index, 1, [t]);
    }
    this._list.setFocus("number" == typeof e.index ? [e.index] : []);
  }
  onListClick(e) {
    e.element && this.focusCondition(e.element) && this._list.setFocus([]);
  }
};
function Ipe(e) {
  return e.replace(/\r\n|\r|\n/g, " ");
}
Tpe = ype([xpe(5, lde), xpe(6, N5), xpe(7, bpe)], Tpe);
var Rpe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
SG(
  "actionBar.toggledBackground",
  hY,
  SI(1657, "Background color for toggled action items in action bar."),
);
const Ope = {
    Visible: new yW(
      "codeActionMenuVisible",
      !1,
      SI(1658, "Whether the action widget list is visible"),
    ),
  },
  Mpe = bV("actionWidgetService");
let Ape = class extends PO {
  get isVisible() {
    return Ope.Visible.getValue(this._contextKeyService) || !1;
  }
  constructor(e, t, n) {
    (super(),
      (this._contextViewService = e),
      (this._contextKeyService = t),
      (this._instantiationService = n),
      (this._list = this._register(new jO())));
  }
  show(e, t, n, i, r, o, s, a) {
    const l = Ope.Visible.bindTo(this._contextKeyService),
      c = this._instantiationService.createInstance(Tpe, e, t, n, i, a);
    this._contextViewService.showContextView(
      {
        getAnchor: () => r,
        render: (e) => (l.set(!0), this._renderWidget(e, c, s ?? [])),
        onHide: (e) => {
          (l.reset(), this._onWidgetClosed(e));
        },
      },
      o,
      !1,
    );
  }
  acceptSelected(e) {
    this._list.value?.acceptSelected(e);
  }
  focusPrevious() {
    this._list?.value?.focusPrevious();
  }
  focusNext() {
    this._list?.value?.focusNext();
  }
  hide(e) {
    (this._list.value?.hide(e), this._list.clear());
  }
  _renderWidget(e, t, n) {
    const i = document.createElement("div");
    if (
      (i.classList.add("action-widget"),
      e.appendChild(i),
      (this._list.value = t),
      !this._list.value)
    )
      throw new Error("List has no value");
    i.appendChild(this._list.value.domNode);
    const r = new AO(),
      o = document.createElement("div"),
      s = e.appendChild(o);
    (s.classList.add("context-view-block"),
      r.add($F(s, DB.MOUSE_DOWN, (e) => e.stopPropagation())));
    const a = document.createElement("div"),
      l = e.appendChild(a);
    (l.classList.add("context-view-pointerBlock"),
      r.add($F(l, DB.POINTER_MOVE, () => l.remove())),
      r.add($F(l, DB.MOUSE_DOWN, () => l.remove())));
    let c = 0;
    if (n.length) {
      const e = this._createActionBar(".action-widget-action-bar", n);
      e &&
        (i.appendChild(e.getContainer().parentElement),
        r.add(e),
        (c = e.getContainer().offsetWidth));
    }
    const d = this._list.value?.layout(c);
    i.style.width = `${d}px`;
    const u = r.add(OB(e));
    return (r.add(u.onDidBlur(() => this.hide(!0))), r);
  }
  _createActionBar(e, t) {
    if (!t.length) return;
    const n = VB(e),
      i = new Cle(n);
    return (i.push(t, { icon: !1, label: !0 }), i);
  }
  _onWidgetClosed(e) {
    this._list.value?.hide(e);
  }
};
((Ape = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Rpe(0, lde), Rpe(1, xW), Rpe(2, vV)], Ape)),
  HU(Mpe, Ape, 1));
const Ppe = 1100;
(WW(
  class extends VW {
    constructor() {
      super({
        id: "hideCodeActionWidget",
        title: EI(1659, "Hide action widget"),
        precondition: Ope.Visible,
        keybinding: { weight: Ppe, primary: 9, secondary: [1033] },
      });
    }
    run(e) {
      e.get(Mpe).hide(!0);
    }
  },
),
  WW(
    class extends VW {
      constructor() {
        super({
          id: "selectPrevCodeAction",
          title: EI(1660, "Select previous action"),
          precondition: Ope.Visible,
          keybinding: {
            weight: Ppe,
            primary: 16,
            secondary: [2064],
            mac: { primary: 16, secondary: [2064, 302] },
          },
        });
      }
      run(e) {
        const t = e.get(Mpe);
        t instanceof Ape && t.focusPrevious();
      }
    },
  ),
  WW(
    class extends VW {
      constructor() {
        super({
          id: "selectNextCodeAction",
          title: EI(1661, "Select next action"),
          precondition: Ope.Visible,
          keybinding: {
            weight: Ppe,
            primary: 18,
            secondary: [2066],
            mac: { primary: 18, secondary: [2066, 300] },
          },
        });
      }
      run(e) {
        const t = e.get(Mpe);
        t instanceof Ape && t.focusNext();
      }
    },
  ),
  WW(
    class extends VW {
      constructor() {
        super({
          id: wpe,
          title: EI(1662, "Accept selected action"),
          precondition: Ope.Visible,
          keybinding: { weight: Ppe, primary: 3, secondary: [2137] },
        });
      }
      run(e) {
        const t = e.get(Mpe);
        t instanceof Ape && t.acceptSelected();
      }
    },
  ),
  WW(
    class extends VW {
      constructor() {
        super({
          id: Cpe,
          title: EI(1663, "Preview selected action"),
          precondition: Ope.Visible,
          keybinding: { weight: Ppe, primary: 2051 },
        });
      }
      run(e) {
        const t = e.get(Mpe);
        t instanceof Ape && t.acceptSelected(!0);
      }
    },
  ));
var jpe,
  Fpe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Bpe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Vpe = class extends PO {
  static {
    jpe = this;
  }
  static {
    this.baseId = "editor.widget.postEditWidget";
  }
  constructor(e, t, n, i, r, o, s, a, l, c, d) {
    (super(),
      (this.typeId = e),
      (this.editor = t),
      (this.showCommand = i),
      (this.range = r),
      (this.edits = o),
      (this.onSelectNewEdit = s),
      (this.additionalActions = a),
      (this._keybindingService = c),
      (this._actionWidgetService = d),
      (this.allowEditorOverflow = !0),
      (this.suppressMouseDown = !0),
      this.create(),
      (this.visibleContext = n.bindTo(l)),
      this.visibleContext.set(!0),
      this._register(MO(() => this.visibleContext.reset())),
      this.editor.addContentWidget(this),
      this.editor.layoutContentWidget(this),
      this._register(MO(() => this.editor.removeContentWidget(this))),
      this._register(
        this.editor.onDidChangeCursorPosition((e) => {
          this.dispose();
        }),
      ),
      this._register(
        $O.runAndSubscribe(c.onDidUpdateKeybindings, () => {
          this._updateButtonTitle();
        }),
      ));
  }
  _updateButtonTitle() {
    const e = this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();
    this.button.element.title = this.showCommand.label + (e ? ` (${e})` : "");
  }
  create() {
    ((this.domNode = VB(".post-edit-widget")),
      (this.button = this._register(new upe(this.domNode, { supportIcons: !0 }))),
      (this.button.label = "$(insert)"),
      this._register($F(this.domNode, DB.CLICK, () => this.showSelector())));
  }
  getId() {
    return jpe.baseId + "." + this.typeId;
  }
  getDomNode() {
    return this.domNode;
  }
  getPosition() {
    return { position: this.range.getEndPosition(), preference: [2] };
  }
  showSelector() {
    const e = aB(this.button.element),
      t = { x: e.left + e.width, y: e.top + e.height };
    this._actionWidgetService.show(
      "postEditWidget",
      !1,
      this.edits.allEdits.map((e, t) => ({
        kind: "action",
        item: e,
        label: e.title,
        disabled: !1,
        canPreview: !1,
        group: {
          title: "",
          icon: AV.fromId(t === this.edits.activeEditIndex ? OV.check.id : OV.blank.id),
        },
      })),
      {
        onHide: () => {
          this.editor.focus();
        },
        onSelect: (e) => {
          this._actionWidgetService.hide(!1);
          const t = this.edits.allEdits.findIndex((t) => t === e);
          if (t !== this.edits.activeEditIndex) return this.onSelectNewEdit(t);
        },
      },
      t,
      this.editor.getDomNode() ?? void 0,
      this.additionalActions,
    );
  }
};
Vpe = jpe = Fpe([Bpe(8, xW), Bpe(9, N5), Bpe(10, Mpe)], Vpe);
let Wpe = class extends PO {
  constructor(e, t, n, i, r, o, s, a) {
    (super(),
      (this._id = e),
      (this._editor = t),
      (this._visibleContext = n),
      (this._showCommand = i),
      (this._getAdditionalActions = r),
      (this._instantiationService = o),
      (this._bulkEditService = s),
      (this._notificationService = a),
      (this._currentWidget = this._register(new jO())),
      this._register($O.any(t.onDidChangeModel, t.onDidChangeModelContent)(() => this.clear())));
  }
  async applyEditAndShowIfNeeded(e, t, n, i, r) {
    if (!e.length || !this._editor.hasModel()) return;
    const o = this._editor.getModel(),
      s = t.allEdits.at(t.activeEditIndex);
    if (!s) return;
    const a = async (o) => {
        const s = this._editor.getModel();
        s &&
          (await s.undo(),
          this.applyEditAndShowIfNeeded(e, { activeEditIndex: o, allEdits: t.allEdits }, n, i, r));
      },
      l = (i, r) => {
        qI(i) || (this._notificationService.error(r), n && this.show(e[0], t, a));
      },
      c = new uge(this._editor, 3, void 0, r);
    let d;
    try {
      d = await (function (e, t) {
        return new Promise((n, i) => {
          const r = t.onCancellationRequested(() => {
            (r.dispose(), i(new KI()));
          });
          e.then(n, i).finally(() => r.dispose());
        });
      })(i(s, c.token), c.token);
    } catch (spt) {
      return l(spt, SI(937, "Error resolving edit '{0}':\n{1}", s.title, fpe(spt)));
    } finally {
      c.dispose();
    }
    if (r.isCancellationRequested) return;
    const u = lpe(o.uri, e, d),
      h = e[0],
      g = o.deltaDecorations(
        [],
        [{ range: h, options: { description: "paste-line-suffix", stickiness: 0 } }],
      );
    let p, f;
    this._editor.focus();
    try {
      ((p = await this._bulkEditService.apply(u, { editor: this._editor, token: r })),
        (f = o.getDecorationRange(g[0])));
    } catch (spt) {
      return l(spt, SI(938, "Error applying edit '{0}':\n{1}", s.title, fpe(spt)));
    } finally {
      o.deltaDecorations(g, []);
    }
    r.isCancellationRequested ||
      (n && p.isApplied && t.allEdits.length > 1 && this.show(f ?? h, t, a));
  }
  show(e, t, n) {
    (this.clear(),
      this._editor.hasModel() &&
        (this._currentWidget.value = this._instantiationService.createInstance(
          Vpe,
          this._id,
          this._editor,
          this._visibleContext,
          this._showCommand,
          e,
          t,
          n,
          this._getAdditionalActions(),
        )));
  }
  clear() {
    this._currentWidget.clear();
  }
  tryShowSelector() {
    this._currentWidget.value?.showSelector();
  }
};
Wpe = Fpe([Bpe(5, vV), Bpe(6, ige), Bpe(7, Y4)], Wpe);
var Hpe,
  zpe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const Upe = "editor.changePasteType",
  $pe = new yW("pasteWidgetVisible", !1, SI(917, "Whether the paste widget is showing")),
  qpe = "application/vnd.code.copymetadata";
let Kpe = class extends PO {
  static {
    Hpe = this;
  }
  static {
    this.ID = "editor.contrib.copyPasteActionController";
  }
  static get(e) {
    return e.getContribution(Hpe.ID);
  }
  constructor(e, t, n, i, r, o, s, a, l, c) {
    (super(),
      (this._logService = n),
      (this._bulkEditService = i),
      (this._clipboardService = r),
      (this._commandService = o),
      (this._configService = s),
      (this._languageFeaturesService = a),
      (this._quickInputService = l),
      (this._progressService = c),
      (this._editor = e));
    const d = e.getContainerDomNode();
    (this._register($F(d, "copy", (e) => this.handleCopy(e))),
      this._register($F(d, "cut", (e) => this.handleCopy(e))),
      this._register($F(d, "paste", (e) => this.handlePaste(e), !0)),
      (this._pasteProgressManager = this._register(new fge("pasteIntoEditor", e, t))),
      (this._postPasteWidgetManager = this._register(
        t.createInstance(
          Wpe,
          "pasteIntoEditor",
          e,
          $pe,
          { id: Upe, label: SI(918, "Show paste options...") },
          () => (Hpe._configureDefaultAction ? [Hpe._configureDefaultAction] : []),
        ),
      )));
  }
  changePasteType() {
    this._postPasteWidgetManager.tryShowSelector();
  }
  async pasteAs(e) {
    (this._logService.trace("CopyPasteController.pasteAs"), this._editor.focus());
    try {
      (this._logService.trace("Before calling editor.action.clipboardPasteAction"),
        (this._pasteAsActionContext = { preferred: e }),
        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(e) {
    let t = null;
    if (e.clipboardData) {
      const [n, i] = PJ.getTextData(e.clipboardData),
        r = i || MJ.INSTANCE.get(n);
      ((t = r?.id || null),
        this._logService.trace(
          "CopyPasteController#handleCopy for id : ",
          t,
          " with text.length : ",
          n.length,
        ));
    } else this._logService.trace("CopyPasteController#handleCopy");
    if (!this._editor.hasTextFocus()) return;
    if (
      (this._clipboardService.clearInternalState?.(), !e.clipboardData || !this.isPasteAsEnabled())
    )
      return;
    const n = this._editor.getModel(),
      i = this._editor.getSelections();
    if (!n || !i?.length) return;
    const r = this._editor.getOption(45);
    let o = i;
    const s = 1 === i.length && i[0].isEmpty();
    if (s) {
      if (!r) return;
      o = [
        new YH(
          o[0].startLineNumber,
          1,
          o[0].startLineNumber,
          1 + n.getLineLength(o[0].startLineNumber),
        ),
      ];
    }
    const a = this._editor._getViewModel()?.getPlainTextToCopy(i, r, AR),
      l = { multicursorText: Array.isArray(a) ? a : null, pasteOnNewLine: s, mode: null },
      c = this._languageFeaturesService.documentPasteEditProvider
        .ordered(n)
        .filter((e) => !!e.prepareDocumentPaste);
    if (!c.length) return void this.setCopyMetadata(e.clipboardData, { defaultPastePayload: l });
    const d = Jhe(e.clipboardData),
      u = c.flatMap((e) => e.copyMimeTypes ?? []),
      h = t ?? FJ();
    this.setCopyMetadata(e.clipboardData, {
      id: h,
      providerCopyMimeTypes: u,
      defaultPastePayload: l,
    });
    const g = c.map((e) => ({
      providerMimeTypes: e.copyMimeTypes,
      operation: gM((t) => e.prepareDocumentPaste(n, o, d, t).catch((e) => {})),
    }));
    (Hpe._currentCopyOperation?.operations.forEach((e) => e.operation.cancel()),
      (Hpe._currentCopyOperation = { handle: h, operations: g }));
  }
  async handlePaste(e) {
    if (e.clipboardData) {
      const [t, n] = PJ.getTextData(e.clipboardData),
        i = n || MJ.INSTANCE.get(t);
      this._logService.trace("CopyPasteController#handlePaste for id : ", i?.id);
    } else this._logService.trace("CopyPasteController#handlePaste");
    if (!e.clipboardData || !this._editor.hasTextFocus()) return;
    (Cge.get(this._editor)?.closeMessage(),
      this._currentPasteOperation?.cancel(),
      (this._currentPasteOperation = void 0));
    const t = this._editor.getModel(),
      n = this._editor.getSelections();
    if (!n?.length || !t) return;
    if (this._editor.getOption(104) || (!this.isPasteAsEnabled() && !this._pasteAsActionContext))
      return;
    const i = this.fetchCopyMetadata(e);
    this._logService.trace(
      "CopyPasteController#handlePaste with metadata : ",
      i?.id,
      " and text.length : ",
      e.clipboardData.getData("text/plain").length,
    );
    const r = nge(e.clipboardData);
    r.delete(qpe);
    const o = Array.from(e.clipboardData.files).map((e) => e.type),
      s = [...e.clipboardData.types, ...o, ...(i?.providerCopyMimeTypes ?? []), UU.uriList],
      a = this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter((e) => {
        const t = this._pasteAsActionContext?.preferred;
        return (
          !(t && !this.providerMatchesPreference(e, t)) && e.pasteMimeTypes?.some((e) => Bhe(e, s))
        );
      });
    a.length
      ? (e.preventDefault(),
        e.stopImmediatePropagation(),
        this._pasteAsActionContext
          ? this.showPasteAsPick(this._pasteAsActionContext.preferred, a, n, r, i)
          : this.doPasteInline(a, n, r, i, e))
      : this._pasteAsActionContext?.preferred &&
        (this.showPasteAsNoEditMessage(n, this._pasteAsActionContext.preferred),
        e.preventDefault(),
        e.stopImmediatePropagation());
  }
  showPasteAsNoEditMessage(e, t) {
    const n =
      "only" in t
        ? t.only.value
        : "preferences" in t
          ? t.preferences.length
            ? t.preferences.map((e) => e.value).join(", ")
            : SI(919, "empty")
          : t.providerId;
    Cge.get(this._editor)?.showMessage(
      SI(920, "No paste edits for '{0}' found", n),
      e[0].getStartPosition(),
    );
  }
  doPasteInline(e, t, n, i, r) {
    this._logService.trace("CopyPasteController#doPasteInline");
    const o = this._editor;
    if (!o.hasModel()) return;
    const s = new uge(o, 3, void 0),
      a = gM(async (o) => {
        const l = this._editor;
        if (!l.hasModel()) return;
        const c = l.getModel(),
          d = new AO(),
          u = d.add(new cM(o));
        d.add(s.token.onCancellationRequested(() => u.cancel()));
        const h = u.token;
        try {
          if ((await this.mergeInDataFromCopy(e, n, i, h), h.isCancellationRequested)) return;
          const o = e.filter((e) => this.isSupportedPasteProvider(e, n));
          if (!o.length || (1 === o.length && o[0] instanceof Hge))
            return this.applyDefaultPasteHandler(n, i, h, r);
          const s = { triggerKind: _2.Automatic },
            a = await this.getPasteEdits(o, n, c, t, s, h);
          if ((d.add(a), h.isCancellationRequested)) return;
          if (1 === a.edits.length && a.edits[0].provider instanceof Hge)
            return this.applyDefaultPasteHandler(n, i, h, r);
          if (a.edits.length) {
            const e = "afterPaste" === l.getOption(97).showPasteSelector;
            return this._postPasteWidgetManager.applyEditAndShowIfNeeded(
              t,
              { activeEditIndex: this.getInitialActiveEditIndex(c, a.edits), allEdits: a.edits },
              e,
              async (e, n) => {
                if (!e.provider.resolveDocumentPasteEdit) return e;
                const i = e.provider.resolveDocumentPasteEdit(e, n),
                  r = new DM(),
                  o = await this._pasteProgressManager.showWhile(
                    t[0].getEndPosition(),
                    SI(921, "Resolving paste edit for '{0}'. Click to cancel", e.title),
                    pM(Promise.race([r.p, i]), n),
                    { cancel: () => r.cancel() },
                    0,
                  );
                return (
                  o && ((e.insertText = o.insertText), (e.additionalEdit = o.additionalEdit)),
                  e
                );
              },
              h,
            );
          }
          await this.applyDefaultPasteHandler(n, i, h, r);
        } finally {
          (d.dispose(),
            this._currentPasteOperation === a && (this._currentPasteOperation = void 0));
        }
      });
    (this._pasteProgressManager
      .showWhile(
        t[0].getEndPosition(),
        SI(922, "Running paste handlers. Click to cancel and do basic paste"),
        a,
        {
          cancel: async () => {
            (a.cancel(),
              s.token.isCancellationRequested ||
                (await this.applyDefaultPasteHandler(n, i, s.token, r)));
          },
        },
      )
      .finally(() => {
        s.dispose();
      }),
      (this._currentPasteOperation = a));
  }
  showPasteAsPick(e, t, n, i, r) {
    this._logService.trace("CopyPasteController#showPasteAsPick");
    const o = gM(async (s) => {
      const a = this._editor;
      if (!a.hasModel()) return;
      const l = a.getModel(),
        c = new AO(),
        d = c.add(new uge(a, 3, void 0, s));
      try {
        if ((await this.mergeInDataFromCopy(t, i, r, d.token), d.token.isCancellationRequested))
          return;
        let o = t.filter((t) => this.isSupportedPasteProvider(t, i, e));
        e && (o = o.filter((t) => this.providerMatchesPreference(t, e)));
        const s = { triggerKind: _2.PasteAs, only: e && "only" in e ? e.only : void 0 };
        let a,
          u = c.add(await this.getPasteEdits(o, i, l, n, s, d.token));
        if (d.token.isCancellationRequested) return;
        if (
          (e &&
            (u = {
              edits: u.edits.filter((t) =>
                "only" in e
                  ? e.only.contains(t.kind)
                  : "preferences" in e
                    ? e.preferences.some((e) => e.contains(t.kind))
                    : e.providerId === t.provider.id,
              ),
              dispose: u.dispose,
            }),
          !u.edits.length)
        )
          return void (e && this.showPasteAsNoEditMessage(n, e));
        if (e) a = u.edits.at(0);
        else {
          const e = {
              id: "editor.pasteAs.default",
              label: SI(923, "Configure default paste action"),
              edit: void 0,
            },
            t = await this._quickInputService.pick(
              [
                ...u.edits.map((e) => ({ label: e.title, description: e.kind?.value, edit: e })),
                ...(Hpe._configureDefaultAction
                  ? [
                      { type: "separator" },
                      { label: Hpe._configureDefaultAction.label, edit: void 0 },
                    ]
                  : []),
              ],
              { placeHolder: SI(924, "Select Paste Action") },
            );
          if (t === e) return void Hpe._configureDefaultAction?.run();
          a = t?.edit;
        }
        if (!a) return;
        const h = lpe(l.uri, n, a);
        await this._bulkEditService.apply(h, { editor: this._editor });
      } finally {
        (c.dispose(), this._currentPasteOperation === o && (this._currentPasteOperation = void 0));
      }
    });
    this._progressService.withProgress(
      { location: 10, title: SI(925, "Running paste handlers") },
      () => o,
    );
  }
  setCopyMetadata(e, t) {
    (this._logService.trace("CopyPasteController#setCopyMetadata new id : ", t.id),
      e.setData(qpe, JSON.stringify(t)));
  }
  fetchCopyMetadata(e) {
    if ((this._logService.trace("CopyPasteController#fetchCopyMetadata"), !e.clipboardData)) return;
    const t = e.clipboardData.getData(qpe);
    if (t)
      try {
        return JSON.parse(t);
      } catch {
        return;
      }
    const [n, i] = PJ.getTextData(e.clipboardData);
    return i
      ? {
          defaultPastePayload: {
            mode: i.mode,
            multicursorText: i.multicursorText ?? null,
            pasteOnNewLine: !!i.isFromEmptySelection,
          },
        }
      : void 0;
  }
  async mergeInDataFromCopy(e, t, n, i) {
    if (
      (this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ", n?.id),
      n?.id && Hpe._currentCopyOperation?.handle === n.id)
    ) {
      const n = Hpe._currentCopyOperation.operations
          .filter((t) => e.some((e) => e.pasteMimeTypes.some((e) => Bhe(e, t.providerMimeTypes))))
          .map((e) => e.operation),
        r = await Promise.all(n);
      if (i.isCancellationRequested) return;
      for (const e of r.reverse()) if (e) for (const [n, i] of e) t.replace(n, i);
    }
    if (!t.has(UU.uriList)) {
      const e = await this._clipboardService.readResources();
      if (i.isCancellationRequested) return;
      e.length && t.append(UU.uriList, Phe(Whe.create(e)));
    }
  }
  async getPasteEdits(e, t, n, i, r, o) {
    const s = new AO(),
      a = await pM(
        Promise.all(
          e.map(async (e) => {
            try {
              const a = await e.provideDocumentPasteEdits?.(n, i, t, r, o);
              return (a && s.add(a), a?.edits?.map((t) => ({ ...t, provider: e })));
            } catch (a) {
              return void qI(a);
            }
          }),
        ),
        o,
      ),
      l = rj(a ?? [])
        .flat()
        .filter((e) => !r.only || r.only.contains(e.kind));
    return { edits: cpe(l), dispose: () => s.dispose() };
  }
  async applyDefaultPasteHandler(e, t, n, i) {
    const r = e.get(UU.text) ?? e.get("text"),
      o = (await r?.asString()) ?? "";
    if (n.isCancellationRequested) return;
    const s = {
      clipboardEvent: i,
      text: o,
      pasteOnNewLine: t?.defaultPastePayload.pasteOnNewLine ?? !1,
      multicursorText: t?.defaultPastePayload.multicursorText ?? null,
      mode: null,
    };
    (this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ", t?.id),
      this._editor.trigger("keyboard", "paste", s));
  }
  isSupportedPasteProvider(e, t, n) {
    return (
      !!e.pasteMimeTypes?.some((e) => t.matches(e)) && (!n || this.providerMatchesPreference(e, n))
    );
  }
  providerMatchesPreference(e, t) {
    return "only" in t
      ? e.providedPasteEditKinds.some((e) => t.only.contains(e))
      : "preferences" in t
        ? t.preferences.some((e) => t.preferences.some((t) => t.contains(e)))
        : e.id === t.providerId;
  }
  getInitialActiveEditIndex(e, t) {
    const n = this._configService.getValue("editor.pasteAs.preferences", { resource: e.uri });
    for (const i of Array.isArray(n) ? n : []) {
      const e = new Hhe(i),
        n = t.findIndex((t) => e.contains(t.kind));
      if (n >= 0) return n;
    }
    return 0;
  }
};
Kpe = Hpe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    zpe(1, vV),
    zpe(2, yH),
    zpe(3, ige),
    zpe(4, ade),
    zpe(5, PV),
    zpe(6, OU),
    zpe(7, mee),
    zpe(8, Ghe),
    zpe(9, Ine),
  ],
  Kpe,
);
const Gpe = "9_cutcopypaste",
  Zpe = FR || document.queryCommandSupported("cut"),
  Ype = FR || document.queryCommandSupported("copy"),
  Xpe = (void 0 !== navigator.clipboard && !RI) || document.queryCommandSupported("paste");
function Qpe(e) {
  return (e.register(), e);
}
const Jpe = Zpe
    ? Qpe(
        new RH({
          id: "editor.action.clipboardCutAction",
          precondition: void 0,
          kbOpts: FR
            ? { primary: 2102, win: { primary: 2102, secondary: [1044] }, weight: 100 }
            : void 0,
          menuOpts: [
            { menuId: MW.MenubarEditMenu, group: "2_ccp", title: SI(813, "Cu&&t"), order: 1 },
            {
              menuId: MW.EditorContext,
              group: Gpe,
              title: SI(814, "Cut"),
              when: $$.writable,
              order: 1,
            },
            { menuId: MW.CommandPalette, group: "", title: SI(815, "Cut"), order: 1 },
            {
              menuId: MW.SimpleEditorContext,
              group: Gpe,
              title: SI(816, "Cut"),
              when: $$.writable,
              order: 1,
            },
          ],
        }),
      )
    : void 0,
  efe = Ype
    ? Qpe(
        new RH({
          id: "editor.action.clipboardCopyAction",
          precondition: void 0,
          kbOpts: FR
            ? { primary: 2081, win: { primary: 2081, secondary: [2067] }, weight: 100 }
            : void 0,
          menuOpts: [
            { menuId: MW.MenubarEditMenu, group: "2_ccp", title: SI(817, "&&Copy"), order: 2 },
            { menuId: MW.EditorContext, group: Gpe, title: SI(818, "Copy"), order: 2 },
            { menuId: MW.CommandPalette, group: "", title: SI(819, "Copy"), order: 1 },
            { menuId: MW.SimpleEditorContext, group: Gpe, title: SI(820, "Copy"), order: 2 },
          ],
        }),
      )
    : void 0;
(jW.appendMenuItem(MW.MenubarEditMenu, {
  submenu: MW.MenubarCopy,
  title: EI(825, "Copy As"),
  group: "2_ccp",
  order: 3,
}),
  jW.appendMenuItem(MW.EditorContext, {
    submenu: MW.EditorContextCopy,
    title: EI(826, "Copy As"),
    group: Gpe,
    order: 3,
  }),
  jW.appendMenuItem(MW.EditorContext, {
    submenu: MW.EditorContextShare,
    title: EI(827, "Share"),
    group: "11_share",
    order: -1,
    when: eW.and(eW.notEquals("resourceScheme", "output"), $$.editorTextFocus),
  }),
  jW.appendMenuItem(MW.ExplorerContext, {
    submenu: MW.ExplorerContextShare,
    title: EI(828, "Share"),
    group: "11_share",
    order: -1,
  }));
const tfe = Xpe
  ? Qpe(
      new RH({
        id: "editor.action.clipboardPasteAction",
        precondition: void 0,
        kbOpts: FR
          ? {
              primary: 2100,
              win: { primary: 2100, secondary: [1043] },
              linux: { primary: 2100, secondary: [1043] },
              weight: 100,
            }
          : void 0,
        menuOpts: [
          { menuId: MW.MenubarEditMenu, group: "2_ccp", title: SI(821, "&&Paste"), order: 4 },
          {
            menuId: MW.EditorContext,
            group: Gpe,
            title: SI(822, "Paste"),
            when: $$.writable,
            order: 4,
          },
          { menuId: MW.CommandPalette, group: "", title: SI(823, "Paste"), order: 1 },
          {
            menuId: MW.SimpleEditorContext,
            group: Gpe,
            title: SI(824, "Paste"),
            when: $$.writable,
            order: 4,
          },
        ],
      }),
    )
  : void 0;
class nfe extends AH {
  constructor() {
    super({
      id: "editor.action.clipboardCopyWithSyntaxHighlightingAction",
      label: EI(829, "Copy with Syntax Highlighting"),
      precondition: void 0,
      kbOpts: { kbExpr: $$.textInputFocus, primary: 0, weight: 100 },
    });
  }
  run(e, t) {
    const n = e.get(yH);
    if ((n.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"), !t.hasModel())) return;
    (!t.getOption(45) && t.getSelection().isEmpty()) ||
      ((AJ.forceCopyWithSyntaxHighlighting = !0),
      t.focus(),
      n.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),
      t.getContainerDomNode().ownerDocument.execCommand("copy"),
      n.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),
      (AJ.forceCopyWithSyntaxHighlighting = !1));
  }
}
function ife(e, t) {
  e &&
    (e.addImplementation(1e4, "code-editor", (e, n) => {
      const i = e.get(yH);
      i.trace("registerExecCommandImpl (addImplementation code-editor for : ", t, ")");
      const r = e.get(yV).getFocusedCodeEditor();
      if (r && r.hasTextFocus()) {
        const e = r.getOption(45),
          n = r.getSelection();
        return (
          (n && n.isEmpty() && !e) ||
            (r.getOption(170) && "cut" === t
              ? (rfe(r),
                i.trace("registerExecCommandImpl (before execCommand copy)"),
                r.getContainerDomNode().ownerDocument.execCommand("copy"),
                r.trigger(void 0, "cut", void 0),
                i.trace("registerExecCommandImpl (after execCommand copy)"))
              : (rfe(r),
                i.trace("registerExecCommandImpl (before execCommand " + t + ")"),
                r.getContainerDomNode().ownerDocument.execCommand(t),
                i.trace("registerExecCommandImpl (after execCommand " + t + ")"))),
          !0
        );
      }
      return !1;
    }),
    e.addImplementation(0, "generic-dom", (e, n) => {
      const i = e.get(yH);
      return (
        i.trace("registerExecCommandImpl (addImplementation generic-dom for : ", t, ")"),
        i.trace("registerExecCommandImpl (before execCommand " + t + ")"),
        xB().execCommand(t),
        i.trace("registerExecCommandImpl (after execCommand " + t + ")"),
        !0
      );
    }));
}
function rfe(e) {
  if (e.getOption(170)) {
    const t = m3.get(e.getId());
    t && t.onWillCopy();
  }
}
(ife(Jpe, "cut"),
  ife(efe, "copy"),
  tfe &&
    (tfe.addImplementation(1e4, "code-editor", (e, t) => {
      const n = e.get(yH);
      n.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");
      const i = e.get(yV),
        r = e.get(ade),
        o = e.get(HW),
        s = e.get(Ahe),
        a = i.getFocusedCodeEditor();
      if (a && a.hasModel() && a.hasTextFocus()) {
        if (a.getOption(170)) {
          const e = m3.get(a.getId());
          e && e.onWillPaste();
        }
        const e = UO.create(!0);
        n.trace("registerExecCommandImpl (before triggerPaste)");
        const t = r.triggerPaste(wB().vscodeWindowId);
        return t
          ? (n.trace("registerExecCommandImpl (triggerPaste defined)"),
            t.then(async () => {
              if (
                (n.trace("registerExecCommandImpl (after triggerPaste)"), "stable" !== s.quality)
              ) {
                const t = e.elapsed();
                o.publicLog2("editorAsyncPaste", { duration: t });
              }
              return Kpe.get(a)?.finishedPaste() ?? Promise.resolve();
            }))
          : (n.trace("registerExecCommandImpl (triggerPaste undefined)"),
            !BR ||
              (n.trace("registerExecCommandImpl (Paste handling on web)"),
              (async () => {
                const e = await r.readText();
                if ("" !== e) {
                  const t = MJ.INSTANCE.get(e);
                  let i = !1,
                    r = null,
                    o = null;
                  (t &&
                    ((i = a.getOption(45) && !!t.isFromEmptySelection),
                    (r = void 0 !== t.multicursorText ? t.multicursorText : null),
                    (o = t.mode)),
                    n.trace(
                      "registerExecCommandImpl (clipboardText.length : ",
                      e.length,
                      " id : ",
                      t?.id,
                      ")",
                    ),
                    a.trigger("keyboard", "paste", {
                      text: e,
                      pasteOnNewLine: i,
                      multicursorText: r,
                      mode: o,
                    }));
                }
              })()));
      }
      return !1;
    }),
    tfe.addImplementation(0, "generic-dom", (e, t) => {
      e.get(yH).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)");
      return e.get(ade).triggerPaste(wB().vscodeWindowId) ?? !1;
    })),
  Ype && VH(nfe));
const ofe = Object.freeze({
    id: "editor",
    order: 5,
    type: "object",
    title: SI(147, "Editor"),
    scope: 6,
  }),
  sfe = {
    ...ofe,
    properties: {
      "editor.tabSize": {
        type: "number",
        default: eK.tabSize,
        minimum: 1,
        maximum: 100,
        markdownDescription: SI(
          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: SI(
          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: eK.insertSpaces,
        markdownDescription: SI(
          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: eK.detectIndentation,
        markdownDescription: SI(
          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: eK.trimAutoWhitespace,
        description: SI(152, "Remove trailing auto inserted whitespace."),
      },
      "editor.largeFileOptimizations": {
        type: "boolean",
        default: eK.largeFileOptimizations,
        description: SI(
          153,
          "Special handling for large files to disable certain memory intensive features.",
        ),
      },
      "editor.wordBasedSuggestions": {
        enum: ["off", "currentDocument", "matchingDocuments", "allDocuments"],
        default: "matchingDocuments",
        enumDescriptions: [
          SI(154, "Turn off Word Based Suggestions."),
          SI(155, "Only suggest words from the active document."),
          SI(156, "Suggest words from all open documents of the same language."),
          SI(157, "Suggest words from all open documents."),
        ],
        description: SI(
          158,
          "Controls whether completions should be computed based on words in the document and from which documents they are computed.",
        ),
      },
      "editor.semanticHighlighting.enabled": {
        enum: [!0, !1, "configuredByTheme"],
        enumDescriptions: [
          SI(159, "Semantic highlighting enabled for all color themes."),
          SI(160, "Semantic highlighting disabled for all color themes."),
          SI(
            161,
            "Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.",
          ),
        ],
        default: "configuredByTheme",
        description: SI(
          162,
          "Controls whether the semanticHighlighting is shown for the languages that support it.",
        ),
      },
      "editor.stablePeek": {
        type: "boolean",
        default: !1,
        markdownDescription: SI(
          163,
          "Keep peek editors open even when double-clicking their content or when hitting `Escape`.",
        ),
      },
      "editor.maxTokenizationLineLength": {
        type: "integer",
        default: 2e4,
        description: SI(
          164,
          "Lines above this length will not be tokenized for performance reasons",
        ),
      },
      "editor.experimental.asyncTokenization": {
        type: "boolean",
        default: !0,
        description: SI(
          165,
          "Controls whether the tokenization should happen asynchronously on a web worker.",
        ),
        tags: ["experimental"],
      },
      "editor.experimental.asyncTokenizationLogging": {
        type: "boolean",
        default: !1,
        description: SI(
          166,
          "Controls whether async tokenization should be logged. For debugging only.",
        ),
      },
      "editor.experimental.asyncTokenizationVerification": {
        type: "boolean",
        default: !1,
        description: SI(
          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: !1,
        markdownDescription: SI(
          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: !1,
        markdownDescription: SI(
          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: !1,
        markdownDescription: SI(
          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: !1,
        markdownDescription: SI(
          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: !1,
        markdownDescription: SI(
          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: SI(
          173,
          "Defines the bracket symbols that increase or decrease the indentation.",
        ),
        items: {
          type: "array",
          items: [
            {
              type: "string",
              description: SI(174, "The opening bracket character or string sequence."),
            },
            {
              type: "string",
              description: SI(175, "The closing bracket character or string sequence."),
            },
          ],
        },
      },
      "editor.language.colorizedBracketPairs": {
        type: ["array", "null"],
        default: null,
        description: SI(
          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: SI(177, "The opening bracket character or string sequence."),
            },
            {
              type: "string",
              description: SI(178, "The closing bracket character or string sequence."),
            },
          ],
        },
      },
      "diffEditor.maxComputationTime": {
        type: "number",
        default: Bde.maxComputationTime,
        description: SI(
          179,
          "Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.",
        ),
      },
      "diffEditor.maxFileSize": {
        type: "number",
        default: Bde.maxFileSize,
        description: SI(
          180,
          "Maximum file size in MB for which to compute diffs. Use 0 for no limit.",
        ),
      },
      "diffEditor.renderSideBySide": {
        type: "boolean",
        default: Bde.renderSideBySide,
        description: SI(
          181,
          "Controls whether the diff editor shows the diff side by side or inline.",
        ),
      },
      "diffEditor.renderSideBySideInlineBreakpoint": {
        type: "number",
        default: Bde.renderSideBySideInlineBreakpoint,
        description: SI(
          182,
          "If the diff editor width is smaller than this value, the inline view is used.",
        ),
      },
      "diffEditor.useInlineViewWhenSpaceIsLimited": {
        type: "boolean",
        default: Bde.useInlineViewWhenSpaceIsLimited,
        description: SI(
          183,
          "If enabled and the editor width is too small, the inline view is used.",
        ),
      },
      "diffEditor.renderMarginRevertIcon": {
        type: "boolean",
        default: Bde.renderMarginRevertIcon,
        description: SI(
          184,
          "When enabled, the diff editor shows arrows in its glyph margin to revert changes.",
        ),
      },
      "diffEditor.renderGutterMenu": {
        type: "boolean",
        default: Bde.renderGutterMenu,
        description: SI(
          185,
          "When enabled, the diff editor shows a special gutter for revert and stage actions.",
        ),
      },
      "diffEditor.ignoreTrimWhitespace": {
        type: "boolean",
        default: Bde.ignoreTrimWhitespace,
        description: SI(
          186,
          "When enabled, the diff editor ignores changes in leading or trailing whitespace.",
        ),
      },
      "diffEditor.renderIndicators": {
        type: "boolean",
        default: Bde.renderIndicators,
        description: SI(
          187,
          "Controls whether the diff editor shows +/- indicators for added/removed changes.",
        ),
      },
      "diffEditor.codeLens": {
        type: "boolean",
        default: Bde.diffCodeLens,
        description: SI(188, "Controls whether the editor shows CodeLens."),
      },
      "diffEditor.wordWrap": {
        type: "string",
        enum: ["off", "on", "inherit"],
        default: Bde.diffWordWrap,
        markdownEnumDescriptions: [
          SI(189, "Lines will never wrap."),
          SI(190, "Lines will wrap at the viewport width."),
          SI(191, "Lines will wrap according to the {0} setting.", "`#editor.wordWrap#`"),
        ],
      },
      "diffEditor.diffAlgorithm": {
        type: "string",
        enum: ["legacy", "advanced"],
        default: Bde.diffAlgorithm,
        markdownEnumDescriptions: [
          SI(192, "Uses the legacy diffing algorithm."),
          SI(193, "Uses the advanced diffing algorithm."),
        ],
      },
      "diffEditor.hideUnchangedRegions.enabled": {
        type: "boolean",
        default: Bde.hideUnchangedRegions.enabled,
        markdownDescription: SI(194, "Controls whether the diff editor shows unchanged regions."),
      },
      "diffEditor.hideUnchangedRegions.revealLineCount": {
        type: "integer",
        default: Bde.hideUnchangedRegions.revealLineCount,
        markdownDescription: SI(195, "Controls how many lines are used for unchanged regions."),
        minimum: 1,
      },
      "diffEditor.hideUnchangedRegions.minimumLineCount": {
        type: "integer",
        default: Bde.hideUnchangedRegions.minimumLineCount,
        markdownDescription: SI(
          196,
          "Controls how many lines are used as a minimum for unchanged regions.",
        ),
        minimum: 1,
      },
      "diffEditor.hideUnchangedRegions.contextLineCount": {
        type: "integer",
        default: Bde.hideUnchangedRegions.contextLineCount,
        markdownDescription: SI(
          197,
          "Controls how many lines are used as context when comparing unchanged regions.",
        ),
        minimum: 1,
      },
      "diffEditor.experimental.showMoves": {
        type: "boolean",
        default: Bde.experimental.showMoves,
        markdownDescription: SI(
          198,
          "Controls whether the diff editor should show detected code moves.",
        ),
      },
      "diffEditor.experimental.showEmptyDecorations": {
        type: "boolean",
        default: Bde.experimental.showEmptyDecorations,
        description: SI(
          199,
          "Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.",
        ),
      },
      "diffEditor.experimental.useTrueInlineView": {
        type: "boolean",
        default: Bde.experimental.useTrueInlineView,
        description: SI(
          200,
          "If enabled and the editor uses the inline view, word changes are rendered inline.",
        ),
      },
    },
  };
function afe(e) {
  return void 0 !== e.type || void 0 !== e.anyOf;
}
for (const Set of jK) {
  const e = Set.schema;
  if (void 0 !== e)
    if (afe(e)) sfe.properties[`editor.${Set.name}`] = e;
    else for (const t in e) Object.hasOwnProperty.call(e, t) && (sfe.properties[t] = e[t]);
}
let lfe = null;
function cfe() {
  return (
    null === lfe &&
      ((lfe = Object.create(null)),
      Object.keys(sfe.properties).forEach((e) => {
        lfe[e] = !0;
      })),
    lfe
  );
}
NW.as(YU).registerConfiguration(sfe);
const dfe = new (class {
  constructor() {
    ((this.QuickFix = new Hhe("quickfix")),
      (this.Refactor = new Hhe("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 Hhe("notebook")),
      (this.Source = new Hhe("source")),
      (this.SourceOrganizeImports = this.Source.append("organizeImports")),
      (this.SourceFixAll = this.Source.append("fixAll")),
      (this.SurroundWith = this.Refactor.append("surround")));
  }
})();
var ufe;
function hfe(e, t, n) {
  return !!t.contains(e) && (!n || !t.contains(n));
}
!(function (e) {
  ((e.Refactor = "refactor"),
    (e.RefactorPreview = "refactor preview"),
    (e.Lightbulb = "lightbulb"),
    (e.Default = "other (default)"),
    (e.SourceAction = "source action"),
    (e.QuickFix = "quick fix action"),
    (e.FixAll = "fix all"),
    (e.OrganizeImports = "organize imports"),
    (e.AutoFix = "auto fix"),
    (e.QuickFixHover = "quick fix hover window"),
    (e.OnSave = "save participants"),
    (e.ProblemsView = "problems view"));
})(ufe || (ufe = {}));
class gfe {
  static fromUser(e, t) {
    return e && "object" == typeof e
      ? new gfe(
          gfe.getKindFromUser(e, t.kind),
          gfe.getApplyFromUser(e, t.apply),
          gfe.getPreferredUser(e),
        )
      : new gfe(t.kind, t.apply, !1);
  }
  static getApplyFromUser(e, t) {
    switch ("string" == typeof e.apply ? e.apply.toLowerCase() : "") {
      case "first":
        return "first";
      case "never":
        return "never";
      case "ifsingle":
        return "ifSingle";
      default:
        return t;
    }
  }
  static getKindFromUser(e, t) {
    return "string" == typeof e.kind ? new Hhe(e.kind) : t;
  }
  static getPreferredUser(e) {
    return "boolean" == typeof e.preferred && e.preferred;
  }
  constructor(e, t, n) {
    ((this.kind = e), (this.apply = t), (this.preferred = n));
  }
}
class pfe {
  constructor(e, t, n) {
    ((this.action = e), (this.provider = t), (this.highlightRange = n));
  }
  async resolve(e) {
    if (this.provider?.resolveCodeAction && !this.action.edit) {
      let n;
      try {
        n = await this.provider.resolveCodeAction(this.action, e);
      } catch (t) {
        zI(t);
      }
      n && (this.action.edit = n.edit);
    }
    return this;
  }
}
const ffe = "editor.action.codeAction",
  mfe = "editor.action.quickFix",
  _fe = "editor.action.autoFix",
  vfe = "editor.action.refactor",
  bfe = "editor.action.sourceAction",
  yfe = "editor.action.organizeImports",
  xfe = "editor.action.fixAll";
class wfe extends PO {
  static codeActionsPreferredComparator(e, t) {
    return e.isPreferred && !t.isPreferred ? -1 : !e.isPreferred && t.isPreferred ? 1 : 0;
  }
  static codeActionsComparator({ action: e }, { action: t }) {
    return e.isAI && !t.isAI
      ? 1
      : !e.isAI && t.isAI
        ? -1
        : aj(e.diagnostics)
          ? aj(t.diagnostics)
            ? wfe.codeActionsPreferredComparator(e, t)
            : -1
          : aj(t.diagnostics)
            ? 1
            : wfe.codeActionsPreferredComparator(e, t);
  }
  constructor(e, t, n) {
    (super(),
      (this.documentation = t),
      this._register(n),
      (this.allActions = [...e].sort(wfe.codeActionsComparator)),
      (this.validActions = this.allActions.filter(({ action: e }) => !e.disabled)));
  }
  get hasAutoFix() {
    return this.validActions.some(
      ({ action: e }) => !!e.kind && dfe.QuickFix.contains(new Hhe(e.kind)) && !!e.isPreferred,
    );
  }
  get hasAIFix() {
    return this.validActions.some(({ action: e }) => !!e.isAI);
  }
  get allAIFixes() {
    return this.validActions.every(({ action: e }) => !!e.isAI);
  }
}
const Cfe = { actions: [], documentation: void 0 };
async function Sfe(e, t, n, i, r, o) {
  const s = i.filter || {},
    a = { ...s, excludes: [...(s.excludes || []), dfe.Notebook] },
    l = { only: s.include?.value, trigger: i.type },
    c = new hge(t, o),
    d = 2 === i.type,
    u = (function (e, t, n) {
      return e.all(t).filter(
        (e) =>
          !e.providedCodeActionKinds ||
          e.providedCodeActionKinds.some((e) =>
            (function (e, t) {
              return !(
                (e.include && !e.include.intersects(t)) ||
                (e.excludes && e.excludes.some((n) => hfe(t, n, e.include))) ||
                (!e.includeSourceActions && dfe.Source.contains(t))
              );
            })(n, new Hhe(e)),
          ),
      );
    })(e, t, d ? a : s),
    h = new AO(),
    g = u.map(async (e) => {
      const i = setTimeout(() => r.report(e), 1250);
      try {
        const i = await e.provideCodeActions(t, n, l, c.token);
        if (c.token.isCancellationRequested) return (i?.dispose(), Cfe);
        i && h.add(i);
        const r = (i?.actions || []).filter(
            (e) =>
              e &&
              (function (e, t) {
                const n = t.kind ? new Hhe(t.kind) : void 0;
                return !(
                  !(!e.include || (n && e.include.contains(n))) ||
                  (e.excludes && n && e.excludes.some((t) => hfe(n, t, e.include))) ||
                  (!e.includeSourceActions && n && dfe.Source.contains(n)) ||
                  (e.onlyIncludePreferredActions && !t.isPreferred)
                );
              })(s, e),
          ),
          o = (function (e, t, n) {
            if (!e.documentation) return;
            const i = e.documentation.map((e) => ({ kind: new Hhe(e.kind), command: e.command }));
            if (n) {
              let e;
              for (const t of i)
                t.kind.contains(n) && (e ? e.kind.contains(t.kind) && (e = t) : (e = t));
              if (e) return e?.command;
            }
            for (const r of t)
              if (r.kind) for (const e of i) if (e.kind.contains(new Hhe(r.kind))) return e.command;
            return;
          })(e, r, s.include);
        return { actions: r.map((t) => new pfe(t, e)), documentation: o };
      } catch (o) {
        if (qI(o)) throw o;
        return (zI(o), Cfe);
      } finally {
        clearTimeout(i);
      }
    }),
    p = e.onDidChange(() => {
      XP(e.all(t), u) || c.cancel();
    });
  try {
    const n = await Promise.all(g),
      r = n.map((e) => e.actions).flat(),
      o = [...rj(n.map((e) => e.documentation)), ...kfe(e, t, i, r)],
      s = new wfe(r, o, h);
    return (h.add(s), s);
  } catch (f) {
    throw (h.dispose(), f);
  } finally {
    (p.dispose(), c.dispose());
  }
}
function* kfe(e, t, n, i) {
  if (t && i.length)
    for (const r of e.all(t))
      r._getAdditionalMenuItems &&
        (yield* r._getAdditionalMenuItems?.(
          { trigger: n.type, only: n.filter?.include?.value },
          i.map((e) => e.action),
        ));
}
var Efe, Nfe, Lfe;
async function Dfe(e, t, n, i, r = aM.None) {
  const o = e.get(ige),
    s = e.get(PV),
    a = e.get(HW),
    l = e.get(Y4),
    c = e.get(kne);
  if (
    (a.publicLog2("codeAction.applyCodeAction", {
      codeActionTitle: t.action.title,
      codeActionKind: t.action.kind,
      codeActionIsPreferred: !!t.action.isPreferred,
      reason: n,
    }),
    c.playSignal(Lne.codeActionTriggered),
    await t.resolve(r),
    !r.isCancellationRequested)
  ) {
    if (t.action.edit?.edits.length) {
      if (
        !(
          await o.apply(t.action.edit, {
            editor: i?.editor,
            label: t.action.title,
            quotableLabel: t.action.title,
            code: "undoredo.codeAction",
            respectAutoSaveConfig: n !== Efe.OnSave,
            showPreview: i?.preview,
            reason: m8.codeAction({
              kind: t.action.kind,
              providerId: x2.fromExtensionId(t.provider?.extensionId),
            }),
          })
        ).isApplied
      )
        return;
    }
    if (t.action.command)
      try {
        await s.executeCommand(t.action.command.id, ...(t.action.command.arguments || []));
      } catch (d) {
        const e = (function (e) {
          return "string" == typeof e
            ? e
            : e instanceof Error && "string" == typeof e.message
              ? e.message
              : void 0;
        })(d);
        l.error(
          "string" == typeof e
            ? e
            : SI(830, "An unknown error occurred while applying the code action"),
        );
      }
    setTimeout(() => c.playSignal(Lne.codeActionApplied), 1e3);
  }
}
(!(function (e) {
  ((e.OnSave = "onSave"),
    (e.FromProblemsView = "fromProblemsView"),
    (e.FromCodeActions = "fromCodeActions"),
    (e.FromAILightbulb = "fromAILightbulb"),
    (e.FromProblemsHover = "fromProblemsHover"));
})(Efe || (Efe = {})),
  jV.registerCommand("_executeCodeActionProvider", async function (e, t, n, i, r) {
    if (!(t instanceof mP)) throw GI();
    const { codeActionProvider: o } = e.get(mee),
      s = e.get(wV).getModel(t);
    if (!s) throw GI();
    const a = XH.isISelection(n)
      ? XH.liftSelection(n)
      : YH.isIRange(n)
        ? s.validateRange(n)
        : void 0;
    if (!a) throw GI();
    const l = "string" == typeof i ? new Hhe(i) : void 0,
      c = await Sfe(
        o,
        s,
        a,
        { type: 1, triggerAction: ufe.Default, filter: { includeSourceActions: !0, include: l } },
        Rne.None,
        aM.None,
      ),
      d = [],
      u = Math.min(c.validActions.length, "number" == typeof r ? r : 0);
    for (let h = 0; h < u; h++) d.push(c.validActions[h].resolve(aM.None));
    try {
      return (await Promise.all(d), c.validActions.map((e) => e.action));
    } finally {
      setTimeout(() => c.dispose(), 100);
    }
  }),
  (function (e) {
    ((e[(e.Hint = 1)] = "Hint"),
      (e[(e.Info = 2)] = "Info"),
      (e[(e.Warning = 4)] = "Warning"),
      (e[(e.Error = 8)] = "Error"));
  })(Nfe || (Nfe = {})),
  (function (e) {
    e.compare = function (e, t) {
      return t - e;
    };
    const t = Object.create(null);
    ((t[e.Error] = SI(1732, "Error")),
      (t[e.Warning] = SI(1733, "Warning")),
      (t[e.Info] = SI(1734, "Info")),
      (e.toString = function (e) {
        return t[e] || "";
      }));
    const n = Object.create(null);
    ((n[e.Error] = SI(1735, "Errors")),
      (n[e.Warning] = SI(1736, "Warnings")),
      (n[e.Info] = SI(1737, "Infos")),
      (e.toStringPlural = function (e) {
        return n[e] || "";
      }),
      (e.fromSeverity = function (t) {
        switch (t) {
          case G4.Error:
            return e.Error;
          case G4.Warning:
            return e.Warning;
          case G4.Info:
            return e.Info;
          case G4.Ignore:
            return e.Hint;
        }
      }),
      (e.toSeverity = function (t) {
        switch (t) {
          case e.Error:
            return G4.Error;
          case e.Warning:
            return G4.Warning;
          case e.Info:
            return G4.Info;
          case e.Hint:
            return G4.Ignore;
        }
      }));
  })(Nfe || (Nfe = {})),
  (function (e) {
    const t = "";
    function n(e, n) {
      const i = [t];
      return (
        e.source ? i.push(e.source.replace("¦", "\\¦")) : i.push(t),
        e.code
          ? "string" == typeof e.code
            ? i.push(e.code.replace("¦", "\\¦"))
            : i.push(e.code.value.replace("¦", "\\¦"))
          : i.push(t),
        void 0 !== e.severity && null !== e.severity ? i.push(Nfe.toString(e.severity)) : i.push(t),
        e.message && n ? i.push(e.message.replace("¦", "\\¦")) : i.push(t),
        void 0 !== e.startLineNumber && null !== e.startLineNumber
          ? i.push(e.startLineNumber.toString())
          : i.push(t),
        void 0 !== e.startColumn && null !== e.startColumn
          ? i.push(e.startColumn.toString())
          : i.push(t),
        void 0 !== e.endLineNumber && null !== e.endLineNumber
          ? i.push(e.endLineNumber.toString())
          : i.push(t),
        void 0 !== e.endColumn && null !== e.endColumn ? i.push(e.endColumn.toString()) : i.push(t),
        i.push(t),
        i.join("¦")
      );
    }
    ((e.makeKey = function (e) {
      return n(e, !0);
    }),
      (e.makeKeyOptionalMessage = n));
  })(Lfe || (Lfe = {})));
const Tfe = bV("markerService");
var Ife;
let Rfe = class {
  static {
    Ife = this;
  }
  static {
    this.codeActionCommands = [vfe, ffe, bfe, yfe, xfe];
  }
  constructor(e) {
    this.keybindingService = e;
  }
  getResolver() {
    const e = new FM(() =>
      this.keybindingService
        .getKeybindings()
        .filter((e) => Ife.codeActionCommands.indexOf(e.command) >= 0)
        .filter((e) => e.resolvedKeybinding)
        .map((e) => {
          let t = e.commandArgs;
          return (
            e.command === yfe
              ? (t = { kind: dfe.SourceOrganizeImports.value })
              : e.command === xfe && (t = { kind: dfe.SourceFixAll.value }),
            {
              resolvedKeybinding: e.resolvedKeybinding,
              ...gfe.fromUser(t, { kind: Hhe.None, apply: "never" }),
            }
          );
        }),
    );
    return (t) => {
      if (t.kind) {
        const n = this.bestKeybindingForCodeAction(t, e.value);
        return n?.resolvedKeybinding;
      }
    };
  }
  bestKeybindingForCodeAction(e, t) {
    if (!e.kind) return;
    const n = new Hhe(e.kind);
    return t
      .filter((e) => e.kind.contains(n))
      .filter((t) => !t.preferred || e.isPreferred)
      .reduceRight((e, t) => (e ? (e.kind.contains(t.kind) ? t : e) : t), void 0);
  }
};
((Rfe = Ife =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })(
    [
      (function (e, t) {
        return function (n, i) {
          t(n, i, e);
        };
      })(0, N5),
    ],
    Rfe,
  )),
  SG(
    "symbolIcon.arrayForeground",
    MG,
    SI(
      1495,
      "The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.booleanForeground",
    MG,
    SI(
      1496,
      "The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.classForeground",
    { dark: "#EE9D28", light: "#D67E00", hcDark: "#EE9D28", hcLight: "#D67E00" },
    SI(
      1497,
      "The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.colorForeground",
    MG,
    SI(
      1498,
      "The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.constantForeground",
    MG,
    SI(
      1499,
      "The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.constructorForeground",
    { dark: "#B180D7", light: "#652D90", hcDark: "#B180D7", hcLight: "#652D90" },
    SI(
      1500,
      "The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.enumeratorForeground",
    { dark: "#EE9D28", light: "#D67E00", hcDark: "#EE9D28", hcLight: "#D67E00" },
    SI(
      1501,
      "The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.enumeratorMemberForeground",
    { dark: "#75BEFF", light: "#007ACC", hcDark: "#75BEFF", hcLight: "#007ACC" },
    SI(
      1502,
      "The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.eventForeground",
    { dark: "#EE9D28", light: "#D67E00", hcDark: "#EE9D28", hcLight: "#D67E00" },
    SI(
      1503,
      "The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.fieldForeground",
    { dark: "#75BEFF", light: "#007ACC", hcDark: "#75BEFF", hcLight: "#007ACC" },
    SI(
      1504,
      "The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.fileForeground",
    MG,
    SI(
      1505,
      "The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.folderForeground",
    MG,
    SI(
      1506,
      "The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.functionForeground",
    { dark: "#B180D7", light: "#652D90", hcDark: "#B180D7", hcLight: "#652D90" },
    SI(
      1507,
      "The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.interfaceForeground",
    { dark: "#75BEFF", light: "#007ACC", hcDark: "#75BEFF", hcLight: "#007ACC" },
    SI(
      1508,
      "The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.keyForeground",
    MG,
    SI(
      1509,
      "The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.keywordForeground",
    MG,
    SI(
      1510,
      "The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.methodForeground",
    { dark: "#B180D7", light: "#652D90", hcDark: "#B180D7", hcLight: "#652D90" },
    SI(
      1511,
      "The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.moduleForeground",
    MG,
    SI(
      1512,
      "The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.namespaceForeground",
    MG,
    SI(
      1513,
      "The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.nullForeground",
    MG,
    SI(
      1514,
      "The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.numberForeground",
    MG,
    SI(
      1515,
      "The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.objectForeground",
    MG,
    SI(
      1516,
      "The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.operatorForeground",
    MG,
    SI(
      1517,
      "The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.packageForeground",
    MG,
    SI(
      1518,
      "The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.propertyForeground",
    MG,
    SI(
      1519,
      "The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.referenceForeground",
    MG,
    SI(
      1520,
      "The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.snippetForeground",
    MG,
    SI(
      1521,
      "The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.stringForeground",
    MG,
    SI(
      1522,
      "The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.structForeground",
    MG,
    SI(
      1523,
      "The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.textForeground",
    MG,
    SI(
      1524,
      "The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.typeParameterForeground",
    MG,
    SI(
      1525,
      "The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.unitForeground",
    MG,
    SI(
      1526,
      "The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ),
  SG(
    "symbolIcon.variableForeground",
    { dark: "#75BEFF", light: "#007ACC", hcDark: "#75BEFF", hcLight: "#007ACC" },
    SI(
      1527,
      "The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.",
    ),
  ));
const Ofe = Object.freeze({ kind: Hhe.Empty, title: SI(866, "More Actions...") }),
  Mfe = Object.freeze([
    { kind: dfe.QuickFix, title: SI(867, "Quick Fix") },
    { kind: dfe.RefactorExtract, title: SI(868, "Extract"), icon: OV.wrench },
    { kind: dfe.RefactorInline, title: SI(869, "Inline"), icon: OV.wrench },
    { kind: dfe.RefactorRewrite, title: SI(870, "Rewrite"), icon: OV.wrench },
    { kind: dfe.RefactorMove, title: SI(871, "Move"), icon: OV.wrench },
    { kind: dfe.SurroundWith, title: SI(872, "Surround With"), icon: OV.surroundWith },
    { kind: dfe.Source, title: SI(873, "Source Action"), icon: OV.symbolFile },
    Ofe,
  ]);
const Afe = new yW("supportedCodeAction", ""),
  Pfe = "_typescript.applyFixAllCodeAction";
class jfe extends PO {
  constructor(e, t, n, i = 250) {
    (super(),
      (this._editor = e),
      (this._markerService = t),
      (this._signalChange = n),
      (this._delay = i),
      (this._autoTriggerTimer = this._register(new SM())),
      this._register(this._markerService.onMarkerChanged((e) => this._onMarkerChanges(e))),
      this._register(this._editor.onDidChangeCursorPosition(() => this._tryAutoTrigger())));
  }
  trigger(e) {
    const t = this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);
    this._signalChange(t ? { trigger: e, selection: t } : void 0);
  }
  _onMarkerChanges(e) {
    const t = this._editor.getModel();
    t && e.some((e) => lH(e, t.uri)) && this._tryAutoTrigger();
  }
  _tryAutoTrigger() {
    this._autoTriggerTimer.cancelAndSet(() => {
      this.trigger({ type: 2, triggerAction: ufe.Default });
    }, this._delay);
  }
  _getRangeOfSelectionUnlessWhitespaceEnclosed(e) {
    if (!this._editor.hasModel()) return;
    const t = this._editor.getSelection();
    if (1 === e.type) return t;
    const n = this._editor.getOption(73).enabled;
    if (n !== bK.Off) {
      if (n === bK.On) return t;
      if (n === bK.OnCode) {
        if (!t.isEmpty()) return t;
        const e = this._editor.getModel(),
          { lineNumber: n, column: i } = t.getPosition(),
          r = e.getLineContent(n);
        if (0 === r.length) return;
        if (1 === i) {
          if (/\s/.test(r[0])) return;
        } else if (i === e.getLineMaxColumn(n)) {
          if (/\s/.test(r[r.length - 1])) return;
        } else if (/\s/.test(r[i - 2]) && /\s/.test(r[i - 1])) return;
      }
      return t;
    }
  }
}
var Ffe;
!(function (e) {
  e.Empty = { type: 0 };
  e.Triggered = class {
    constructor(e, t, n) {
      ((this.trigger = e),
        (this.position = t),
        (this._cancellablePromise = n),
        (this.type = 1),
        (this.actions = n.catch((e) => {
          if (qI(e)) return Bfe;
          throw e;
        })));
    }
    cancel() {
      this._cancellablePromise.cancel();
    }
  };
})(Ffe || (Ffe = {}));
const Bfe = Object.freeze({
  allActions: [],
  validActions: [],
  dispose: () => {},
  documentation: [],
  hasAutoFix: !1,
  hasAIFix: !1,
  allAIFixes: !1,
});
class Vfe extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._editor = e),
      (this._registry = t),
      (this._markerService = n),
      (this._progressService = r),
      (this._configurationService = o),
      (this._codeActionOracle = this._register(new jO())),
      (this._state = Ffe.Empty),
      (this._onDidChangeState = this._register(new QO())),
      (this.onDidChangeState = this._onDidChangeState.event),
      (this.codeActionsDisposable = this._register(new jO())),
      (this._disposed = !1),
      (this._supportedCodeActions = Afe.bindTo(i)),
      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((e) => {
          e.hasChanged(73) && this._update();
        }),
      ),
      this._update());
  }
  dispose() {
    this._disposed || ((this._disposed = !0), super.dispose(), this.setState(Ffe.Empty, !0));
  }
  _settingEnabledNearbyQuickfixes() {
    const e = this._editor?.getModel();
    return (
      !!this._configurationService &&
      this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes", {
        resource: e?.uri,
      })
    );
  }
  _update() {
    if (this._disposed) return;
    ((this._codeActionOracle.value = void 0), this.setState(Ffe.Empty));
    const e = this._editor.getModel();
    if (e && this._registry.has(e) && !this._editor.getOption(104)) {
      const t = this._registry.all(e).flatMap((e) => e.providedCodeActionKinds ?? []);
      (this._supportedCodeActions.set(t.join(" ")),
        (this._codeActionOracle.value = new jfe(
          this._editor,
          this._markerService,
          (t) => {
            if (!t) return void this.setState(Ffe.Empty);
            const n = t.selection.getStartPosition(),
              i = gM(async (n) => {
                if (
                  this._settingEnabledNearbyQuickfixes() &&
                  1 === t.trigger.type &&
                  (t.trigger.triggerAction === ufe.QuickFix ||
                    t.trigger.filter?.include?.contains(dfe.QuickFix))
                ) {
                  const i = await Sfe(this._registry, e, t.selection, t.trigger, Rne.None, n);
                  this.codeActionsDisposable.value = i;
                  const r = [...i.allActions];
                  if (n.isCancellationRequested) return (i.dispose(), Bfe);
                  const o = i.validActions?.some(
                      (e) =>
                        e.action.kind &&
                        dfe.QuickFix.contains(new Hhe(e.action.kind)) &&
                        !e.action.isAI,
                    ),
                    s = this._markerService.read({ resource: e.uri });
                  if (o) {
                    for (const e of i.validActions)
                      e.action.command?.arguments?.some(
                        (e) => "string" == typeof e && e.includes(Pfe),
                      ) && (e.action.diagnostics = [...s.filter((e) => e.relatedInformation)]);
                    return {
                      validActions: i.validActions,
                      allActions: r,
                      documentation: i.documentation,
                      hasAutoFix: i.hasAutoFix,
                      hasAIFix: i.hasAIFix,
                      allAIFixes: i.allAIFixes,
                      dispose: () => {
                        this.codeActionsDisposable.value = i;
                      },
                    };
                  }
                  if (!o && s.length > 0) {
                    const o = t.selection.getPosition();
                    let a = o,
                      l = Number.MAX_VALUE;
                    const c = [...i.validActions];
                    for (const u of s) {
                      const d = u.endColumn,
                        h = u.endLineNumber,
                        g = u.startLineNumber;
                      if (h === o.lineNumber || g === o.lineNumber) {
                        a = new xV(h, d);
                        const u = {
                            type: t.trigger.type,
                            triggerAction: t.trigger.triggerAction,
                            filter: {
                              include: t.trigger.filter?.include
                                ? t.trigger.filter?.include
                                : dfe.QuickFix,
                            },
                            autoApply: t.trigger.autoApply,
                            context: {
                              notAvailableMessage: t.trigger.context?.notAvailableMessage || "",
                              position: a,
                            },
                          },
                          g = new XH(a.lineNumber, a.column, a.lineNumber, a.column),
                          p = await Sfe(this._registry, e, g, u, Rne.None, n);
                        if (n.isCancellationRequested) return (p.dispose(), Bfe);
                        if (0 !== p.validActions.length) {
                          for (const e of p.validActions)
                            e.action.command?.arguments?.some(
                              (e) => "string" == typeof e && e.includes(Pfe),
                            ) &&
                              (e.action.diagnostics = [...s.filter((e) => e.relatedInformation)]);
                          (0 === i.allActions.length && r.push(...p.allActions),
                            Math.abs(o.column - d) < l
                              ? c.unshift(...p.validActions)
                              : c.push(...p.validActions));
                        }
                        l = Math.abs(o.column - d);
                      }
                    }
                    const d = c.filter(
                      (e, t, n) => n.findIndex((t) => t.action.title === e.action.title) === t,
                    );
                    return (
                      d.sort((e, t) =>
                        e.action.isPreferred && !t.action.isPreferred
                          ? -1
                          : (!e.action.isPreferred && t.action.isPreferred) ||
                              (e.action.isAI && !t.action.isAI)
                            ? 1
                            : !e.action.isAI && t.action.isAI
                              ? -1
                              : 0,
                      ),
                      {
                        validActions: d,
                        allActions: r,
                        documentation: i.documentation,
                        hasAutoFix: i.hasAutoFix,
                        hasAIFix: i.hasAIFix,
                        allAIFixes: i.allAIFixes,
                        dispose: () => {
                          this.codeActionsDisposable.value = i;
                        },
                      }
                    );
                  }
                }
                if (1 === t.trigger.type) {
                  const i = await Sfe(this._registry, e, t.selection, t.trigger, Rne.None, n);
                  return ((this.codeActionsDisposable.value = i), i);
                }
                const i = await Sfe(this._registry, e, t.selection, t.trigger, Rne.None, n);
                return ((this.codeActionsDisposable.value = i), i);
              });
            1 === t.trigger.type && this._progressService?.showWhile(i, 250);
            const r = new Ffe.Triggered(t.trigger, n, i);
            let o = !1;
            (1 === this._state.type &&
              (o =
                1 === this._state.trigger.type &&
                1 === r.type &&
                2 === r.trigger.type &&
                this._state.position !== r.position),
              o
                ? setTimeout(() => {
                    this.setState(r);
                  }, 500)
                : this.setState(r));
          },
          void 0,
        )),
        this._codeActionOracle.value.trigger({ type: 2, triggerAction: ufe.Default }));
    } else this._supportedCodeActions.reset();
  }
  trigger(e) {
    (this._codeActionOracle.value?.trigger(e), this.codeActionsDisposable.dispose());
  }
  setState(e, t) {
    e !== this._state &&
      (1 === this._state.type && this._state.cancel(),
      (this._state = e),
      t || this._disposed || this._onDidChangeState.fire(e));
  }
}
var Wfe;
const Hfe = Zle(
    "gutter-lightbulb",
    OV.lightBulb,
    SI(
      874,
      "Icon which spawns code actions menu from the gutter when there is no space in the editor.",
    ),
  ),
  zfe = Zle(
    "gutter-lightbulb-auto-fix",
    OV.lightbulbAutofix,
    SI(
      875,
      "Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.",
    ),
  ),
  Ufe = Zle(
    "gutter-lightbulb-sparkle",
    OV.lightbulbSparkle,
    SI(
      876,
      "Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.",
    ),
  ),
  $fe = Zle(
    "gutter-lightbulb-aifix-auto-fix",
    OV.lightbulbSparkleAutofix,
    SI(
      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.",
    ),
  ),
  qfe = Zle(
    "gutter-lightbulb-sparkle-filled",
    OV.sparkleFilled,
    SI(
      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.",
    ),
  );
var Kfe;
!(function (e) {
  e.Hidden = { type: 0 };
  e.Showing = class {
    constructor(e, t, n, i) {
      ((this.actions = e),
        (this.trigger = t),
        (this.editorPosition = n),
        (this.widgetPosition = i),
        (this.type = 1));
    }
  };
})(Kfe || (Kfe = {}));
let Gfe = class extends PO {
  static {
    Wfe = this;
  }
  static {
    this.GUTTER_DECORATION = cee.register({
      description: "codicon-gutter-lightbulb-decoration",
      glyphMarginClassName: AV.asClassName(OV.lightBulb),
      glyphMargin: { position: $z.Left },
      stickiness: 1,
    });
  }
  static {
    this.ID = "editor.contrib.lightbulbWidget";
  }
  static {
    this._posPref = [0];
  }
  constructor(e, t) {
    var n, i, r;
    (super(),
      (this._editor = e),
      (this._keybindingService = t),
      (this._onClick = this._register(new QO())),
      (this.onClick = this._onClick.event),
      (this._state = Kfe.Hidden),
      (this._gutterState = Kfe.Hidden),
      (this._iconClasses = []),
      (this.lightbulbClasses = [
        "codicon-" + Hfe.id,
        "codicon-" + $fe.id,
        "codicon-" + zfe.id,
        "codicon-" + Ufe.id,
        "codicon-" + qfe.id,
      ]),
      (this.gutterDecoration = Wfe.GUTTER_DECORATION),
      (this._domNode = VB("div.lightBulbWidget")),
      (this._domNode.role = "listbox"),
      this._register(iJ.ignoreTarget(this._domNode)),
      this._editor.addContentWidget(this),
      this._register(
        this._editor.onDidChangeModelContent((e) => {
          const t = this._editor.getModel();
          ((1 !== this.state.type ||
            !t ||
            this.state.editorPosition.lineNumber >= t.getLineCount()) &&
            this.hide(),
            (1 !== this.gutterState.type ||
              !t ||
              this.gutterState.editorPosition.lineNumber >= t.getLineCount()) &&
              this.gutterHide());
        }),
      ),
      this._register(
        ((n = this._domNode),
        (i = (e) => {
          if (1 !== this.state.type) return;
          (this._editor.focus(), e.preventDefault());
          const { top: t, height: n } = aB(this._domNode),
            i = this._editor.getOption(75);
          let r = Math.floor(i / 3);
          (null !== this.state.widgetPosition.position &&
            this.state.widgetPosition.position.lineNumber < this.state.editorPosition.lineNumber &&
            (r += i),
            this._onClick.fire({
              x: e.posx,
              y: t + n + r,
              actions: this.state.actions,
              trigger: this.state.trigger,
            }));
        }),
        GF(n, qF(MF(n), i), r)),
      ),
      this._register(
        $F(this._domNode, "mouseenter", (e) => {
          1 & ~e.buttons || this.hide();
        }),
      ),
      this._register(
        $O.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings, () => {
          ((this._preferredKbLabel =
            this._keybindingService.lookupKeybinding(_fe)?.getLabel() ?? void 0),
            (this._quickFixKbLabel =
              this._keybindingService.lookupKeybinding(mfe)?.getLabel() ?? void 0),
            this._updateLightBulbTitleAndIcon());
        }),
      ),
      this._register(
        this._editor.onMouseDown(async (e) => {
          if (
            !e.target.element ||
            !this.lightbulbClasses.some(
              (t) => e.target.element && e.target.element.classList.contains(t),
            )
          )
            return;
          if (1 !== this.gutterState.type) return;
          this._editor.focus();
          const { top: t, height: n } = aB(e.target.element),
            i = this._editor.getOption(75);
          let r = Math.floor(i / 3);
          (null !== this.gutterState.widgetPosition.position &&
            this.gutterState.widgetPosition.position.lineNumber <
              this.gutterState.editorPosition.lineNumber &&
            (r += i),
            this._onClick.fire({
              x: e.event.posx,
              y: t + n + r,
              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 1 === this._state.type ? this._state.widgetPosition : null;
  }
  update(e, t, n) {
    if (e.validActions.length <= 0) return (this.gutterHide(), this.hide());
    if (!this._editor.hasTextFocus()) return (this.gutterHide(), this.hide());
    if (!this._editor.getOptions().get(73).enabled) return (this.gutterHide(), this.hide());
    const i = this._editor.getModel();
    if (!i) return (this.gutterHide(), this.hide());
    const { lineNumber: r, column: o } = i.validatePosition(n),
      s = i.getOptions().tabSize,
      a = this._editor.getOptions().get(59),
      l = H1(i.getLineContent(r), s),
      c = a.spaceWidth * l > 22,
      d = (e) =>
        e > 2 && this._editor.getTopForLineNumber(e) === this._editor.getTopForLineNumber(e - 1),
      u = this._editor.getLineDecorations(r);
    let h = !1;
    if (u)
      for (const _ of u) {
        const e = _.options.glyphMarginClassName;
        if (e && !this.lightbulbClasses.some((t) => e.includes(t))) {
          h = !0;
          break;
        }
      }
    let g = r,
      p = 1;
    if (!c) {
      const s = (e) => {
        const t = i.getLineContent(e);
        return /^\s*$|^\s+/.test(t) || t.length <= p;
      };
      if (r > 1 && !d(r - 1)) {
        const o = r === i.getLineCount(),
          a = r > 1 && s(r - 1),
          l = !o && s(r + 1),
          c = s(r),
          d = !l && !a;
        if (!(l || a || h))
          return (
            (this.gutterState = new Kfe.Showing(e, t, n, {
              position: { lineNumber: g, column: p },
              preference: Wfe._posPref,
            })),
            this.renderGutterLightbub(),
            this.hide()
          );
        a || o || (a && !c) ? (g -= 1) : (l || (d && c)) && (g += 1);
      } else if (1 !== r || (r !== i.getLineCount() && (s(r + 1) || s(r)))) {
        if (r < i.getLineCount() && !d(r + 1)) g += 1;
        else if (o * a.spaceWidth < 22) return this.hide();
      } else {
        if (
          ((this.gutterState = new Kfe.Showing(e, t, n, {
            position: { lineNumber: g, column: p },
            preference: Wfe._posPref,
          })),
          !h)
        )
          return (this.renderGutterLightbub(), this.hide());
        this.gutterHide();
      }
      p = /^\S\s*$/.test(i.getLineContent(g)) ? 2 : 1;
    }
    ((this.state = new Kfe.Showing(e, t, n, {
      position: { lineNumber: g, column: p },
      preference: Wfe._posPref,
    })),
      this._gutterDecorationID &&
        (this._removeGutterDecoration(this._gutterDecorationID), this.gutterHide()));
    const f = e.validActions,
      m = e.validActions[0].action.kind;
    (f.length, this._editor.layoutContentWidget(this));
  }
  hide() {
    this.state !== Kfe.Hidden &&
      ((this.state = Kfe.Hidden), this._editor.layoutContentWidget(this));
  }
  gutterHide() {
    this.gutterState !== Kfe.Hidden &&
      (this._gutterDecorationID && this._removeGutterDecoration(this._gutterDecorationID),
      (this.gutterState = Kfe.Hidden));
  }
  get state() {
    return this._state;
  }
  set state(e) {
    ((this._state = e), this._updateLightBulbTitleAndIcon());
  }
  get gutterState() {
    return this._gutterState;
  }
  set gutterState(e) {
    ((this._gutterState = e), this._updateGutterLightBulbTitleAndIcon());
  }
  _updateLightBulbTitleAndIcon() {
    if (
      (this._domNode.classList.remove(...this._iconClasses),
      (this._iconClasses = []),
      1 !== this.state.type)
    )
      return;
    let e,
      t = !1;
    (this.state.actions.allAIFixes
      ? ((e = OV.sparkleFilled), 1 === this.state.actions.validActions.length && (t = !0))
      : (e = this.state.actions.hasAutoFix
          ? this.state.actions.hasAIFix
            ? OV.lightbulbSparkleAutofix
            : OV.lightbulbAutofix
          : this.state.actions.hasAIFix
            ? OV.lightbulbSparkle
            : OV.lightBulb),
      this._updateLightbulbTitle(this.state.actions.hasAutoFix, t),
      (this._iconClasses = AV.asClassNameArray(e)),
      this._domNode.classList.add(...this._iconClasses));
  }
  _updateGutterLightBulbTitleAndIcon() {
    if (1 !== this.gutterState.type) return;
    let e,
      t = !1;
    (this.gutterState.actions.allAIFixes
      ? ((e = qfe), 1 === this.gutterState.actions.validActions.length && (t = !0))
      : (e = this.gutterState.actions.hasAutoFix
          ? this.gutterState.actions.hasAIFix
            ? $fe
            : zfe
          : this.gutterState.actions.hasAIFix
            ? Ufe
            : Hfe),
      this._updateLightbulbTitle(this.gutterState.actions.hasAutoFix, t));
    const n = cee.register({
      description: "codicon-gutter-lightbulb-decoration",
      glyphMarginClassName: AV.asClassName(e),
      glyphMargin: { position: $z.Left },
      stickiness: 1,
    });
    this.gutterDecoration = n;
  }
  renderGutterLightbub() {
    const e = this._editor.getSelection();
    e &&
      (void 0 === this._gutterDecorationID
        ? this._addGutterDecoration(e.startLineNumber)
        : this._updateGutterDecoration(this._gutterDecorationID, e.startLineNumber));
  }
  _addGutterDecoration(e) {
    this._editor.changeDecorations((t) => {
      this._gutterDecorationID = t.addDecoration(new YH(e, 0, e, 0), this.gutterDecoration);
    });
  }
  _removeGutterDecoration(e) {
    this._editor.changeDecorations((t) => {
      (t.removeDecoration(e), (this._gutterDecorationID = void 0));
    });
  }
  _updateGutterDecoration(e, t) {
    this._editor.changeDecorations((n) => {
      (n.changeDecoration(e, new YH(t, 0, t, 0)),
        n.changeDecorationOptions(e, this.gutterDecoration));
    });
  }
  _updateLightbulbTitle(e, t) {
    1 === this.state.type &&
      (t
        ? (this.title = SI(879, "Run: {0}", this.state.actions.validActions[0].action.title))
        : e && this._preferredKbLabel
          ? (this.title = SI(
              880,
              "Show Code Actions. Preferred Quick Fix Available ({0})",
              this._preferredKbLabel,
            ))
          : !e && this._quickFixKbLabel
            ? (this.title = SI(881, "Show Code Actions ({0})", this._quickFixKbLabel))
            : e || (this.title = SI(882, "Show Code Actions")));
  }
  set title(e) {
    this._domNode.title = e;
  }
};
Gfe = Wfe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, N5),
  ],
  Gfe,
);
var Zfe,
  Yfe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Xfe = class extends PO {
  static {
    Zfe = this;
  }
  static {
    this.ID = "editor.contrib.codeActionController";
  }
  static get(e) {
    return e.getContribution(Zfe.ID);
  }
  constructor(e, t, n, i, r, o, s, a, l, c, d) {
    (super(),
      (this._commandService = s),
      (this._configurationService = a),
      (this._actionWidgetService = l),
      (this._instantiationService = c),
      (this._progressService = d),
      (this._activeCodeActions = this._register(new jO())),
      (this._showDisabled = !1),
      (this._disposed = !1),
      (this._editor = e),
      (this._model = this._register(new Vfe(this._editor, r.codeActionProvider, t, n, o, a))),
      this._register(this._model.onDidChangeState((e) => this.update(e))),
      (this._lightBulbWidget = new FM(() => {
        const e = this._editor.getContribution(Gfe.ID);
        return (
          e && this._register(e.onClick((e) => this.showCodeActionsFromLightbulb(e.actions, e))),
          e
        );
      })),
      (this._resolver = i.createInstance(Rfe)),
      this._register(this._editor.onDidLayoutChange(() => this._actionWidgetService.hide())));
  }
  dispose() {
    ((this._disposed = !0), super.dispose());
  }
  async showCodeActionsFromLightbulb(e, t) {
    if (e.allAIFixes && 1 === e.validActions.length) {
      const t = e.validActions[0],
        n = t.action.command;
      return (
        n &&
          "inlineChat.start" === n.id &&
          n.arguments &&
          n.arguments.length >= 1 &&
          n.arguments[0] &&
          (n.arguments[0] = { ...n.arguments[0], autoSend: !1 }),
        void (await this.applyCodeAction(t, !1, !1, Efe.FromAILightbulb))
      );
    }
    await this.showCodeActionList(e, t, { includeDisabledActions: !1, fromLightbulb: !0 });
  }
  showCodeActions(e, t, n) {
    return this.showCodeActionList(t, n, { includeDisabledActions: !1, fromLightbulb: !1 });
  }
  manualTriggerAtCurrentPosition(e, t, n, i) {
    if (!this._editor.hasModel()) return;
    Cge.get(this._editor)?.closeMessage();
    const r = this._editor.getPosition();
    this._trigger({
      type: 1,
      triggerAction: t,
      filter: n,
      autoApply: i,
      context: { notAvailableMessage: e, position: r },
    });
  }
  _trigger(e) {
    return this._model.trigger(e);
  }
  async applyCodeAction(e, t, n, i) {
    const r = this._progressService.show(!0, 500);
    try {
      await this._instantiationService.invokeFunction(Dfe, e, i, {
        preview: n,
        editor: this._editor,
      });
    } finally {
      (t && this._trigger({ type: 2, triggerAction: ufe.QuickFix, filter: {} }), r.done());
    }
  }
  hideLightBulbWidget() {
    (this._lightBulbWidget.rawValue?.hide(), this._lightBulbWidget.rawValue?.gutterHide());
  }
  async update(e) {
    if (1 !== e.type) return void this.hideLightBulbWidget();
    let t;
    try {
      t = await e.actions;
    } catch (spt) {
      return void HI(spt);
    }
    if (this._disposed) return;
    const n = this._editor.getSelection();
    if (n?.startLineNumber === e.position.lineNumber)
      if ((this._lightBulbWidget.value?.update(t, e.trigger, e.position), 1 === e.trigger.type)) {
        if (e.trigger.filter?.include) {
          const n = this.tryGetValidActionToApply(e.trigger, t);
          if (n) {
            try {
              (this.hideLightBulbWidget(),
                await this.applyCodeAction(n, !1, !1, Efe.FromCodeActions));
            } finally {
              t.dispose();
            }
            return;
          }
          if (e.trigger.context) {
            const n = this.getInvalidActionThatWouldHaveBeenApplied(e.trigger, t);
            if (n && n.action.disabled)
              return (
                Cge.get(this._editor)?.showMessage(n.action.disabled, e.trigger.context.position),
                void t.dispose()
              );
          }
        }
        const n = !!e.trigger.filter?.include;
        if (e.trigger.context && (!t.allActions.length || (!n && !t.validActions.length)))
          return (
            Cge.get(this._editor)?.showMessage(
              e.trigger.context.notAvailableMessage,
              e.trigger.context.position,
            ),
            (this._activeCodeActions.value = t),
            void t.dispose()
          );
        ((this._activeCodeActions.value = t),
          this.showCodeActionList(t, this.toCoords(e.position), {
            includeDisabledActions: n,
            fromLightbulb: !1,
          }));
      } else
        this._actionWidgetService.isVisible ? t.dispose() : (this._activeCodeActions.value = t);
  }
  getInvalidActionThatWouldHaveBeenApplied(e, t) {
    if (t.allActions.length)
      return ("first" === e.autoApply && 0 === t.validActions.length) ||
        ("ifSingle" === e.autoApply && 1 === t.allActions.length)
        ? t.allActions.find(({ action: e }) => e.disabled)
        : void 0;
  }
  tryGetValidActionToApply(e, t) {
    if (t.validActions.length)
      return ("first" === e.autoApply && t.validActions.length > 0) ||
        ("ifSingle" === e.autoApply && 1 === t.validActions.length)
        ? t.validActions[0]
        : void 0;
  }
  static {
    this.DECORATION = cee.register({
      description: "quickfix-highlight",
      className: "quickfix-edit-highlight",
    });
  }
  async showCodeActionList(e, t, n) {
    const i = this._editor.createDecorationsCollection(),
      r = this._editor.getDomNode();
    if (!r) return;
    const o =
      n.includeDisabledActions && (this._showDisabled || 0 === e.validActions.length)
        ? e.allActions
        : e.validActions;
    if (!o.length) return;
    const s = xV.isIPosition(t) ? this.toCoords(t) : t,
      a = {
        onSelect: async (e, t) => {
          (this.applyCodeAction(
            e,
            !0,
            !!t,
            n.fromLightbulb ? Efe.FromAILightbulb : Efe.FromCodeActions,
          ),
            this._actionWidgetService.hide(!1),
            i.clear());
        },
        onHide: (e) => {
          (this._editor?.focus(), i.clear());
        },
        onHover: async (e, t) => {
          if (t.isCancellationRequested) return;
          let n = !1;
          const i = e.action.kind;
          if (i) {
            const e = new Hhe(i);
            n = [
              dfe.RefactorExtract,
              dfe.RefactorInline,
              dfe.RefactorRewrite,
              dfe.RefactorMove,
              dfe.Source,
            ].some((t) => t.contains(e));
          }
          return { canPreview: n || !!e.action.edit?.edits.length };
        },
        onFocus: (e) => {
          if (e && e.action) {
            const t = e.action.ranges,
              n = e.action.diagnostics;
            if ((i.clear(), t && t.length > 0)) {
              const e =
                n && n?.length > 1
                  ? n.map((e) => ({ range: e, options: Zfe.DECORATION }))
                  : t.map((e) => ({ range: e, options: Zfe.DECORATION }));
              i.set(e);
            } else if (n && n.length > 0) {
              const e = n.map((e) => ({ range: e, options: Zfe.DECORATION }));
              i.set(e);
              const t = n[0];
              if (t.startLineNumber && t.startColumn) {
                const e = this._editor
                  .getModel()
                  ?.getWordAtPosition({
                    lineNumber: t.startLineNumber,
                    column: t.startColumn,
                  })?.word;
                fV(
                  SI(
                    863,
                    "Context: {0} at line {1} and column {2}.",
                    e,
                    t.startLineNumber,
                    t.startColumn,
                  ),
                );
              }
            }
          } else i.clear();
        },
      };
    this._actionWidgetService.show(
      "codeActionWidget",
      !0,
      (function (e, t, n) {
        if (!t)
          return e.map((e) => ({
            kind: "action",
            item: e,
            group: Ofe,
            disabled: !!e.action.disabled,
            label: e.action.disabled || e.action.title,
            canPreview: !!e.action.edit?.edits.length,
          }));
        const i = Mfe.map((e) => ({ group: e, actions: [] }));
        for (const o of e) {
          const e = o.action.kind ? new Hhe(o.action.kind) : Hhe.None;
          for (const t of i)
            if (t.group.kind.contains(e)) {
              t.actions.push(o);
              break;
            }
        }
        const r = [];
        for (const o of i)
          if (o.actions.length) {
            r.push({ kind: "header", group: o.group });
            for (const e of o.actions) {
              const t = o.group;
              r.push({
                kind: "action",
                item: e,
                group: e.action.isAI ? { title: t.title, kind: t.kind, icon: OV.sparkle } : t,
                label: e.action.title,
                disabled: !!e.action.disabled,
                keybinding: n(e.action),
              });
            }
          }
        return r;
      })(o, this._shouldShowHeaders(), this._resolver.getResolver()),
      a,
      s,
      r,
      this._getActionBarActions(e, t, n),
    );
  }
  toCoords(e) {
    if (!this._editor.hasModel()) return { x: 0, y: 0 };
    (this._editor.revealPosition(e, 1), this._editor.render());
    const t = this._editor.getScrolledVisiblePosition(e),
      n = aB(this._editor.getDomNode());
    return { x: n.left + t.left, y: n.top + t.top + t.height };
  }
  _shouldShowHeaders() {
    const e = this._editor?.getModel();
    return this._configurationService.getValue("editor.codeActionWidget.showHeaders", {
      resource: e?.uri,
    });
  }
  _getActionBarActions(e, t, n) {
    if (n.fromLightbulb) return [];
    const i = e.documentation.map((e) => ({
      id: e.id,
      label: e.title,
      tooltip: e.tooltip ?? "",
      class: void 0,
      enabled: !0,
      run: () => this._commandService.executeCommand(e.id, ...(e.arguments ?? [])),
    }));
    return (
      n.includeDisabledActions &&
        e.validActions.length > 0 &&
        e.allActions.length !== e.validActions.length &&
        i.push(
          this._showDisabled
            ? {
                id: "hideMoreActions",
                label: SI(864, "Hide Disabled"),
                enabled: !0,
                tooltip: "",
                class: void 0,
                run: () => ((this._showDisabled = !1), this.showCodeActionList(e, t, n)),
              }
            : {
                id: "showMoreActions",
                label: SI(865, "Show Disabled"),
                enabled: !0,
                tooltip: "",
                class: void 0,
                run: () => ((this._showDisabled = !0), this.showCodeActionList(e, t, n)),
              },
        ),
      i
    );
  }
};
function Qfe(e) {
  return eW.regex(Afe.keys()[0], new RegExp("(\\s|^)" + zM(e.value) + "\\b"));
}
((Xfe = Zfe =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })(
    [
      Yfe(1, Tfe),
      Yfe(2, xW),
      Yfe(3, vV),
      Yfe(4, mee),
      Yfe(5, One),
      Yfe(6, PV),
      Yfe(7, OU),
      Yfe(8, Mpe),
      Yfe(9, vV),
      Yfe(10, One),
    ],
    Xfe,
  )),
  _0((e, t) => {
    ((e, n) => {
      n && t.addRule(`.monaco-editor ${e} { background-color: ${n}; }`);
    })(".quickfix-edit-highlight", e.getColor(gZ));
    const n = e.getColor(fZ);
    n &&
      t.addRule(
        `.monaco-editor .quickfix-edit-highlight { border: 1px ${TQ(e.type) ? "dotted" : "solid"} ${n}; box-sizing: border-box; }`,
      );
  }));
const Jfe = {
  type: "object",
  defaultSnippets: [{ body: { kind: "" } }],
  properties: {
    kind: { type: "string", description: SI(831, "Kind of the code action to run.") },
    apply: {
      type: "string",
      description: SI(832, "Controls when the returned actions are applied."),
      default: "ifSingle",
      enum: ["first", "ifSingle", "never"],
      enumDescriptions: [
        SI(833, "Always apply the first returned code action."),
        SI(834, "Apply the first returned code action if it is the only one."),
        SI(835, "Do not apply the returned code actions."),
      ],
    },
    preferred: {
      type: "boolean",
      default: !1,
      description: SI(836, "Controls if only preferred code actions should be returned."),
    },
  },
};
function eme(e, t, n, i, r = ufe.Default) {
  if (e.hasModel()) {
    const o = Xfe.get(e);
    o?.manualTriggerAtCurrentPosition(t, r, n, i);
  }
}
(zH(Xfe.ID, Xfe, 3),
  zH(Gfe.ID, Gfe, 4),
  VH(
    class extends AH {
      constructor() {
        super({
          id: mfe,
          label: EI(853, "Quick Fix..."),
          precondition: eW.and($$.writable, $$.hasCodeActionsProvider),
          kbOpts: { kbExpr: $$.textInputFocus, primary: 2137, weight: 100 },
        });
      }
      run(e, t) {
        return eme(t, SI(837, "No code actions available"), void 0, void 0, ufe.QuickFix);
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: vfe,
          label: EI(854, "Refactor..."),
          precondition: eW.and($$.writable, $$.hasCodeActionsProvider),
          kbOpts: { kbExpr: $$.textInputFocus, primary: 3120, mac: { primary: 1328 }, weight: 100 },
          contextMenuOpts: {
            group: "1_modification",
            order: 2,
            when: eW.and($$.writable, Qfe(dfe.Refactor)),
          },
          metadata: { description: "Refactor...", args: [{ name: "args", schema: Jfe }] },
        });
      }
      run(e, t, n) {
        const i = gfe.fromUser(n, { kind: dfe.Refactor, apply: "never" });
        return eme(
          t,
          "string" == typeof n?.kind
            ? i.preferred
              ? SI(842, "No preferred refactorings for '{0}' available", n.kind)
              : SI(843, "No refactorings for '{0}' available", n.kind)
            : i.preferred
              ? SI(844, "No preferred refactorings available")
              : SI(845, "No refactorings available"),
          {
            include: dfe.Refactor.contains(i.kind) ? i.kind : Hhe.None,
            onlyIncludePreferredActions: i.preferred,
          },
          i.apply,
          ufe.Refactor,
        );
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: bfe,
          label: EI(855, "Source Action..."),
          precondition: eW.and($$.writable, $$.hasCodeActionsProvider),
          contextMenuOpts: {
            group: "1_modification",
            order: 2.1,
            when: eW.and($$.writable, Qfe(dfe.Source)),
          },
          metadata: { description: "Source Action...", args: [{ name: "args", schema: Jfe }] },
        });
      }
      run(e, t, n) {
        const i = gfe.fromUser(n, { kind: dfe.Source, apply: "never" });
        return eme(
          t,
          "string" == typeof n?.kind
            ? i.preferred
              ? SI(846, "No preferred source actions for '{0}' available", n.kind)
              : SI(847, "No source actions for '{0}' available", n.kind)
            : i.preferred
              ? SI(848, "No preferred source actions available")
              : SI(849, "No source actions available"),
          {
            include: dfe.Source.contains(i.kind) ? i.kind : Hhe.None,
            includeSourceActions: !0,
            onlyIncludePreferredActions: i.preferred,
          },
          i.apply,
          ufe.SourceAction,
        );
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: yfe,
          label: EI(856, "Organize Imports"),
          precondition: eW.and($$.writable, Qfe(dfe.SourceOrganizeImports)),
          kbOpts: { kbExpr: $$.textInputFocus, primary: 1581, weight: 100 },
          metadata: {
            description: EI(
              857,
              "Organize imports in the current file. Also called 'Optimize Imports' by some tools",
            ),
          },
        });
      }
      run(e, t) {
        return eme(
          t,
          SI(850, "No organize imports action available"),
          { include: dfe.SourceOrganizeImports, includeSourceActions: !0 },
          "ifSingle",
          ufe.OrganizeImports,
        );
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: _fe,
          label: EI(859, "Auto Fix..."),
          precondition: eW.and($$.writable, Qfe(dfe.QuickFix)),
          kbOpts: { kbExpr: $$.textInputFocus, primary: 1625, mac: { primary: 2649 }, weight: 100 },
        });
      }
      run(e, t) {
        return eme(
          t,
          SI(852, "No auto fixes available"),
          { include: dfe.QuickFix, onlyIncludePreferredActions: !0 },
          "ifSingle",
          ufe.AutoFix,
        );
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: xfe,
          label: EI(858, "Fix All"),
          precondition: eW.and($$.writable, Qfe(dfe.SourceFixAll)),
        });
      }
      run(e, t) {
        return eme(
          t,
          SI(851, "No fix all action available"),
          { include: dfe.SourceFixAll, includeSourceActions: !0 },
          "ifSingle",
          ufe.FixAll,
        );
      }
    },
  ),
  BH(
    new (class extends MH {
      constructor() {
        super({
          id: ffe,
          precondition: eW.and($$.writable, $$.hasCodeActionsProvider),
          metadata: { description: "Trigger a code action", args: [{ name: "args", schema: Jfe }] },
        });
      }
      runEditorCommand(e, t, n) {
        const i = gfe.fromUser(n, { kind: Hhe.Empty, apply: "ifSingle" });
        return eme(
          t,
          "string" == typeof n?.kind
            ? i.preferred
              ? SI(838, "No preferred code actions for '{0}' available", n.kind)
              : SI(839, "No code actions for '{0}' available", n.kind)
            : i.preferred
              ? SI(840, "No preferred code actions available")
              : SI(841, "No code actions available"),
          { include: i.kind, includeSourceActions: !0, onlyIncludePreferredActions: i.preferred },
          i.apply,
        );
      }
    })(),
  ),
  NW.as(YU).registerConfiguration({
    ...ofe,
    properties: {
      "editor.codeActionWidget.showHeaders": {
        type: "boolean",
        scope: 6,
        description: SI(860, "Enable/disable showing group headers in the Code Action menu."),
        default: !0,
      },
    },
  }),
  NW.as(YU).registerConfiguration({
    ...ofe,
    properties: {
      "editor.codeActionWidget.includeNearbyQuickFixes": {
        type: "boolean",
        scope: 6,
        description: SI(
          861,
          "Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.",
        ),
        default: !0,
      },
    },
  }),
  NW.as(YU).registerConfiguration({
    ...ofe,
    properties: {
      "editor.codeActions.triggerOnFocusChange": {
        type: "boolean",
        scope: 6,
        markdownDescription: SI(
          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: !1,
      },
    },
  }));
class tme {
  constructor() {
    this.lenses = [];
  }
  static {
    this.Empty = new tme();
  }
  dispose() {
    this._store?.dispose();
  }
  get isDisposed() {
    return this._store?.isDisposed ?? !1;
  }
  add(e, t) {
    TO(e) && ((this._store ??= new AO()), this._store.add(e));
    for (const n of e.lenses) this.lenses.push({ symbol: n, provider: t });
  }
}
async function nme(e, t, n) {
  const i = e.ordered(t),
    r = new Map(),
    o = new tme(),
    s = i.map(async (e, i) => {
      r.set(e, i);
      try {
        const i = await Promise.resolve(e.provideCodeLenses(t, n));
        i && o.add(i, e);
      } catch (s) {
        zI(s);
      }
    });
  return (
    await Promise.all(s),
    n.isCancellationRequested
      ? (o.dispose(), tme.Empty)
      : ((o.lenses = o.lenses.sort((e, t) =>
          e.symbol.range.startLineNumber < t.symbol.range.startLineNumber
            ? -1
            : e.symbol.range.startLineNumber > t.symbol.range.startLineNumber
              ? 1
              : r.get(e.provider) < r.get(t.provider)
                ? -1
                : r.get(e.provider) > r.get(t.provider)
                  ? 1
                  : e.symbol.range.startColumn < t.symbol.range.startColumn
                    ? -1
                    : e.symbol.range.startColumn > t.symbol.range.startColumn
                      ? 1
                      : 0,
        )),
        o)
  );
}
jV.registerCommand("_executeCodeLensProvider", function (e, ...t) {
  let [n, i] = t;
  (pR(mP.isUri(n)), pR("number" == typeof i || !i));
  const { codeLensProvider: r } = e.get(mee),
    o = e.get(wV).getModel(n);
  if (!o) throw GI();
  const s = [],
    a = new AO();
  return nme(r, o, aM.None)
    .then((e) => {
      a.add(e);
      const t = [];
      for (const n of e.lenses)
        null == i || Boolean(n.symbol.command)
          ? s.push(n.symbol)
          : i-- > 0 &&
            n.provider.resolveCodeLens &&
            t.push(
              Promise.resolve(n.provider.resolveCodeLens(o, n.symbol, aM.None)).then((e) =>
                s.push(e || n.symbol),
              ),
            );
      return Promise.all(t);
    })
    .then(() => s)
    .finally(() => {
      setTimeout(() => a.dispose(), 100);
    });
});
const ime = bV("ICodeLensCache");
class rme {
  constructor(e, t) {
    ((this.lineCount = e), (this.data = t));
  }
}
let ome = class {
  constructor(e) {
    ((this._fakeProvider = new (class {
      provideCodeLenses() {
        throw new Error("not supported");
      }
    })()),
      (this._cache = new XW(20, 0.75)));
    YF(NI, () => e.remove("codelens/cache", 1));
    const t = "codelens/cache2",
      n = e.get(t, 1, "{}");
    this._deserialize(n);
    const i = $O.filter(e.onWillSaveState, (e) => e.reason === sue.SHUTDOWN);
    $O.once(i)((n) => {
      e.store(t, this._serialize(), 1, 1);
    });
  }
  put(e, t) {
    const n = t.lenses.map((e) => ({
        range: e.symbol.range,
        command: e.symbol.command && { id: "", title: e.symbol.command?.title },
      })),
      i = new tme();
    i.add({ lenses: n }, this._fakeProvider);
    const r = new rme(e.getLineCount(), i);
    this._cache.set(e.uri.toString(), r);
  }
  get(e) {
    const t = this._cache.get(e.uri.toString());
    return t && t.lineCount === e.getLineCount() ? t.data : void 0;
  }
  delete(e) {
    this._cache.delete(e.uri.toString());
  }
  _serialize() {
    const e = Object.create(null);
    for (const [t, n] of this._cache) {
      const i = new Set();
      for (const e of n.data.lenses) i.add(e.symbol.range.startLineNumber);
      e[t] = { lineCount: n.lineCount, lines: [...i.values()] };
    }
    return JSON.stringify(e);
  }
  _deserialize(e) {
    try {
      const t = JSON.parse(e);
      for (const e in t) {
        const n = t[e],
          i = [];
        for (const e of n.lines) i.push({ range: new YH(e, 1, e, 11) });
        const r = new tme();
        (r.add({ lenses: i }, this._fakeProvider), this._cache.set(e, new rme(n.lineCount, r)));
      }
    } catch {}
  }
};
((ome = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, oue),
  ],
  ome,
)),
  HU(ime, ome, 1));
class sme {
  constructor(e, t, n) {
    ((this.afterColumn = 1073741824),
      (this.afterLineNumber = e),
      (this.heightInPx = t),
      (this._onHeight = n),
      (this.suppressMouseDown = !0),
      (this.domNode = document.createElement("div")));
  }
  onComputedHeight(e) {
    void 0 === this._lastHeight
      ? (this._lastHeight = e)
      : this._lastHeight !== e && ((this._lastHeight = e), this._onHeight());
  }
  isVisible() {
    return 0 !== this._lastHeight && this.domNode.hasAttribute("monaco-visible-view-zone");
  }
}
class ame {
  static {
    this._idPool = 0;
  }
  constructor(e, t) {
    ((this.allowEditorOverflow = !1),
      (this.suppressMouseDown = !0),
      (this._commands = new Map()),
      (this._isEmpty = !0),
      (this._editor = e),
      (this._id = "codelens.widget-" + ame._idPool++),
      this.updatePosition(t),
      (this._domNode = document.createElement("span")),
      (this._domNode.className = "codelens-decoration"));
  }
  withCommands(e, t) {
    this._commands.clear();
    const n = [];
    let i = !1;
    for (let r = 0; r < e.length; r++) {
      const t = e[r];
      if (t && ((i = !0), t.command)) {
        const i = Wse(t.command.title.trim());
        if (t.command.id) {
          const e = "c" + ame._idPool++;
          (n.push(VB("a", { id: e, title: t.command.tooltip, role: "button" }, ...i)),
            this._commands.set(e, t.command));
        } else n.push(VB("span", { title: t.command.tooltip }, ...i));
        r + 1 < e.length && n.push(VB("span", void 0, " | "));
      }
    }
    i
      ? (PB(this._domNode, ...n),
        this._isEmpty && t && this._domNode.classList.add("fadein"),
        (this._isEmpty = !1))
      : PB(this._domNode, VB("span", void 0, "no commands"));
  }
  getCommand(e) {
    return e.parentElement === this._domNode ? this._commands.get(e.id) : void 0;
  }
  getId() {
    return this._id;
  }
  getDomNode() {
    return this._domNode;
  }
  updatePosition(e) {
    const t = this._editor.getModel().getLineFirstNonWhitespaceColumn(e);
    this._widgetPosition = { position: { lineNumber: e, column: t }, preference: [1] };
  }
  getPosition() {
    return this._widgetPosition || null;
  }
}
class lme {
  constructor() {
    ((this._removeDecorations = []),
      (this._addDecorations = []),
      (this._addDecorationsCallbacks = []));
  }
  addDecoration(e, t) {
    (this._addDecorations.push(e), this._addDecorationsCallbacks.push(t));
  }
  removeDecoration(e) {
    this._removeDecorations.push(e);
  }
  commit(e) {
    const t = e.deltaDecorations(this._removeDecorations, this._addDecorations);
    for (let n = 0, i = t.length; n < i; n++) this._addDecorationsCallbacks[n](t[n]);
  }
}
const cme = cee.register({ collapseOnReplaceEdit: !0, description: "codelens" });
class dme {
  constructor(e, t, n, i, r, o) {
    let s;
    ((this._isDisposed = !1), (this._editor = t), (this._data = e), (this._decorationIds = []));
    const a = [];
    (this._data.forEach((e, t) => {
      (e.symbol.command && a.push(e.symbol),
        n.addDecoration(
          { range: e.symbol.range, options: cme },
          (e) => (this._decorationIds[t] = e),
        ),
        (s = s ? YH.plusRange(s, e.symbol.range) : YH.lift(e.symbol.range)));
    }),
      (this._viewZone = new sme(s.startLineNumber - 1, r, o)),
      (this._viewZoneId = i.addZone(this._viewZone)),
      a.length > 0 &&
        (this._createContentWidgetIfNecessary(), this._contentWidget.withCommands(a, !1)));
  }
  _createContentWidgetIfNecessary() {
    this._contentWidget
      ? this._editor.layoutContentWidget(this._contentWidget)
      : ((this._contentWidget = new ame(this._editor, this._viewZone.afterLineNumber + 1)),
        this._editor.addContentWidget(this._contentWidget));
  }
  dispose(e, t) {
    (this._decorationIds.forEach(e.removeDecoration, e),
      (this._decorationIds = []),
      t?.removeZone(this._viewZoneId),
      this._contentWidget &&
        (this._editor.removeContentWidget(this._contentWidget), (this._contentWidget = void 0)),
      (this._isDisposed = !0));
  }
  isDisposed() {
    return this._isDisposed;
  }
  isValid() {
    return this._decorationIds.some((e, t) => {
      const n = this._editor.getModel().getDecorationRange(e),
        i = this._data[t].symbol;
      return !(!n || YH.isEmpty(i.range) !== n.isEmpty());
    });
  }
  updateCodeLensSymbols(e, t) {
    (this._decorationIds.forEach(t.removeDecoration, t),
      (this._decorationIds = []),
      (this._data = e),
      this._data.forEach((e, n) => {
        t.addDecoration(
          { range: e.symbol.range, options: cme },
          (e) => (this._decorationIds[n] = e),
        );
      }));
  }
  updateHeight(e, t) {
    ((this._viewZone.heightInPx = e),
      t.layoutZone(this._viewZoneId),
      this._contentWidget && this._editor.layoutContentWidget(this._contentWidget));
  }
  computeIfNecessary(e) {
    if (!this._viewZone.isVisible()) return null;
    for (let t = 0; t < this._decorationIds.length; t++) {
      const n = e.getDecorationRange(this._decorationIds[t]);
      n && (this._data[t].symbol.range = n);
    }
    return this._data;
  }
  updateCommands(e) {
    (this._createContentWidgetIfNecessary(), this._contentWidget.withCommands(e, !0));
    for (let t = 0; t < this._data.length; t++) {
      const n = e[t];
      if (n) {
        const { symbol: e } = this._data[t];
        e.command = n.command || e.command;
      }
    }
  }
  getCommand(e) {
    return this._contentWidget?.getCommand(e);
  }
  getLineNumber() {
    const e = this._editor.getModel().getDecorationRange(this._decorationIds[0]);
    return e ? e.startLineNumber : -1;
  }
  update(e) {
    if (this.isValid()) {
      const t = this._editor.getModel().getDecorationRange(this._decorationIds[0]);
      t &&
        ((this._viewZone.afterLineNumber = t.startLineNumber - 1),
        e.layoutZone(this._viewZoneId),
        this._contentWidget &&
          (this._contentWidget.updatePosition(t.startLineNumber),
          this._editor.layoutContentWidget(this._contentWidget)));
    }
  }
}
const ume = bV("environmentService");
var hme = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const gme = bV("ILanguageFeatureDebounceService");
var pme;
!(function (e) {
  const t = new WeakMap();
  let n = 0;
  e.of = function (e) {
    let i = t.get(e);
    return (void 0 === i && ((i = ++n), t.set(e, i)), i);
  };
})(pme || (pme = {}));
class fme {
  constructor(e) {
    this._default = e;
  }
  get(e) {
    return this._default;
  }
  update(e, t) {
    return this._default;
  }
  default() {
    return this._default;
  }
}
class mme {
  constructor(e, t, n, i, r, o) {
    ((this._logService = e),
      (this._name = t),
      (this._registry = n),
      (this._default = i),
      (this._min = r),
      (this._max = o),
      (this._cache = new XW(50, 0.7)));
  }
  _key(e) {
    return e.id + this._registry.all(e).reduce((e, t) => $P(pme.of(t), e), 0);
  }
  get(e) {
    const t = this._key(e),
      n = this._cache.get(t);
    return n ? wae(n.value, this._min, this._max) : this.default();
  }
  update(e, t) {
    const n = this._key(e);
    let i = this._cache.get(n);
    i || ((i = new Sae(6)), this._cache.set(n, i));
    const r = wae(i.update(t), this._min, this._max);
    return (
      LP(e.uri, "output") ||
        this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${r}ms`),
      r
    );
  }
  _overall() {
    const e = new Cae();
    for (const [, t] of this._cache) e.update(t.value);
    return e.value;
  }
  default() {
    return wae(0 | this._overall() || this._default, this._min, this._max);
  }
}
let _me = class {
  constructor(e, t) {
    ((this._logService = e),
      (this._data = new Map()),
      (this._isDev = t.isExtensionDevelopment || !t.isBuilt));
  }
  for(e, t, n) {
    const i = n?.min ?? 50,
      r = n?.max ?? i ** 2,
      o = n?.key ?? void 0,
      s = `${pme.of(e)},${i}${o ? "," + o : ""}`;
    let a = this._data.get(s);
    return (
      a ||
        (this._isDev
          ? (this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),
            (a = new fme(1.5 * i)))
          : (a = new mme(this._logService, t, e, 0 | this._overallAverage() || 1.5 * i, i, r)),
        this._data.set(s, a)),
      a
    );
  }
  _overallAverage() {
    const e = new Cae();
    for (const t of this._data.values()) e.update(t.default());
    return e.value;
  }
};
((_me = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([hme(0, yH), hme(1, ume)], _me)),
  HU(gme, _me, 1));
var vme = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let bme = class {
  static {
    this.ID = "css.editor.codeLens";
  }
  constructor(e, t, n, i, r, o) {
    ((this._editor = e),
      (this._languageFeaturesService = t),
      (this._commandService = i),
      (this._notificationService = r),
      (this._codeLensCache = o),
      (this._disposables = new AO()),
      (this._localToDispose = new AO()),
      (this._lenses = []),
      (this._oldCodeLensModels = new AO()),
      (this._provideCodeLensDebounce = n.for(t.codeLensProvider, "CodeLensProvide", { min: 250 })),
      (this._resolveCodeLensesDebounce = n.for(t.codeLensProvider, "CodeLensResolve", {
        min: 250,
        salt: "resolve",
      })),
      (this._resolveCodeLensesScheduler = new EM(
        () => 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((e) => {
          ((e.hasChanged(59) || e.hasChanged(25) || e.hasChanged(24)) && this._updateLensStyle(),
            e.hasChanged(23) && this._onModelChange());
        }),
      ),
      this._disposables.add(t.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() {
    const e = Math.max(1.3, this._editor.getOption(75) / this._editor.getOption(61));
    let t = this._editor.getOption(25);
    return (
      (!t || t < 5) && (t = (0.9 * this._editor.getOption(61)) | 0),
      { fontSize: t, codeLensHeight: (t * e) | 0 }
    );
  }
  _updateLensStyle() {
    const { codeLensHeight: e, fontSize: t } = this._getLayoutInfo(),
      n = this._editor.getOption(24),
      i = this._editor.getOption(59),
      { style: r } = this._editor.getContainerDomNode();
    (r.setProperty("--vscode-editorCodeLens-lineHeight", `${e}px`),
      r.setProperty("--vscode-editorCodeLens-fontSize", `${t}px`),
      r.setProperty("--vscode-editorCodeLens-fontFeatureSettings", i.fontFeatureSettings),
      n &&
        (r.setProperty("--vscode-editorCodeLens-fontFamily", n),
        r.setProperty("--vscode-editorCodeLens-fontFamilyDefault", Jq.fontFamily)),
      this._editor.changeViewZones((t) => {
        for (const n of this._lenses) n.updateHeight(e, t);
      }));
  }
  _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();
    const e = this._editor.getModel();
    if (!e) return;
    if (!this._editor.getOption(23) || e.isTooLargeForTokenization()) return;
    const t = this._codeLensCache.get(e);
    if (
      (t && this._renderCodeLensSymbols(t), !this._languageFeaturesService.codeLensProvider.has(e))
    )
      return void (
        t &&
        bM(
          () => {
            const n = this._codeLensCache.get(e);
            t === n && (this._codeLensCache.delete(e), this._onModelChange());
          },
          3e4,
          this._localToDispose,
        )
      );
    for (const i of this._languageFeaturesService.codeLensProvider.all(e))
      if ("function" == typeof i.onDidChange) {
        const e = i.onDidChange(() => n.schedule());
        this._localToDispose.add(e);
      }
    const n = new EM(() => {
      const t = Date.now();
      (this._getCodeLensModelPromise?.cancel(),
        (this._getCodeLensModelPromise = gM((t) =>
          nme(this._languageFeaturesService.codeLensProvider, e, t),
        )),
        this._getCodeLensModelPromise.then((i) => {
          (this._currentCodeLensModel && this._oldCodeLensModels.add(this._currentCodeLensModel),
            (this._currentCodeLensModel = i),
            this._codeLensCache.put(e, i));
          const r = this._provideCodeLensDebounce.update(e, Date.now() - t);
          ((n.delay = r), this._renderCodeLensSymbols(i), this._resolveCodeLensesInViewportSoon());
        }, HI));
    }, this._provideCodeLensDebounce.get(e));
    (this._localToDispose.add(n),
      this._localToDispose.add(MO(() => this._resolveCodeLensesScheduler.cancel())),
      this._localToDispose.add(
        this._editor.onDidChangeModelContent(() => {
          (this._editor.changeDecorations((e) => {
            this._editor.changeViewZones((t) => {
              const n = [];
              let i = -1;
              this._lenses.forEach((e) => {
                e.isValid() && i !== e.getLineNumber()
                  ? (e.update(t), (i = e.getLineNumber()))
                  : n.push(e);
              });
              const r = new lme();
              (n.forEach((e) => {
                (e.dispose(r, t), this._lenses.splice(this._lenses.indexOf(e), 1));
              }),
                r.commit(e));
            });
          }),
            n.schedule(),
            this._resolveCodeLensesScheduler.cancel(),
            this._resolveCodeLensesPromise?.cancel(),
            (this._resolveCodeLensesPromise = void 0));
        }),
      ),
      this._localToDispose.add(
        this._editor.onDidFocusEditorText(() => {
          n.schedule();
        }),
      ),
      this._localToDispose.add(
        this._editor.onDidBlurEditorText(() => {
          n.cancel();
        }),
      ),
      this._localToDispose.add(
        this._editor.onDidScrollChange((e) => {
          e.scrollTopChanged && this._lenses.length > 0 && this._resolveCodeLensesInViewportSoon();
        }),
      ),
      this._localToDispose.add(
        this._editor.onDidLayoutChange(() => {
          this._resolveCodeLensesInViewportSoon();
        }),
      ),
      this._localToDispose.add(
        MO(() => {
          if (this._editor.getModel()) {
            const e = Mne.capture(this._editor);
            (this._editor.changeDecorations((e) => {
              this._editor.changeViewZones((t) => {
                this._disposeAllLenses(e, t);
              });
            }),
              e.restore(this._editor));
          } else this._disposeAllLenses(void 0, void 0);
        }),
      ),
      this._localToDispose.add(
        this._editor.onMouseDown((e) => {
          if (9 !== e.target.type) return;
          let t = e.target.element;
          if (("SPAN" === t?.tagName && (t = t.parentElement), "A" === t?.tagName))
            for (const n of this._lenses) {
              const e = n.getCommand(t);
              if (e) {
                this._commandService
                  .executeCommand(e.id, ...(e.arguments || []))
                  .catch((e) => this._notificationService.error(e));
                break;
              }
            }
        }),
      ),
      n.schedule());
  }
  _disposeAllLenses(e, t) {
    const n = new lme();
    for (const i of this._lenses) i.dispose(n, t);
    (e && n.commit(e), (this._lenses.length = 0));
  }
  _renderCodeLensSymbols(e) {
    if (!this._editor.hasModel()) return;
    const t = this._editor.getModel().getLineCount(),
      n = [];
    let i;
    for (const s of e.lenses) {
      const e = s.symbol.range.startLineNumber;
      e < 1 ||
        e > t ||
        (i && i[i.length - 1].symbol.range.startLineNumber === e
          ? i.push(s)
          : ((i = [s]), n.push(i)));
    }
    if (!n.length && !this._lenses.length) return;
    const r = Mne.capture(this._editor),
      o = this._getLayoutInfo();
    (this._editor.changeDecorations((e) => {
      this._editor.changeViewZones((t) => {
        const i = new lme();
        let r = 0,
          s = 0;
        for (; s < n.length && r < this._lenses.length; ) {
          const e = n[s][0].symbol.range.startLineNumber,
            a = this._lenses[r].getLineNumber();
          a < e
            ? (this._lenses[r].dispose(i, t), this._lenses.splice(r, 1))
            : a === e
              ? (this._lenses[r].updateCodeLensSymbols(n[s], i), s++, r++)
              : (this._lenses.splice(
                  r,
                  0,
                  new dme(n[s], this._editor, i, t, o.codeLensHeight, () =>
                    this._resolveCodeLensesInViewportSoon(),
                  ),
                ),
                r++,
                s++);
        }
        for (; r < this._lenses.length; )
          (this._lenses[r].dispose(i, t), this._lenses.splice(r, 1));
        for (; s < n.length; )
          (this._lenses.push(
            new dme(n[s], this._editor, i, t, o.codeLensHeight, () =>
              this._resolveCodeLensesInViewportSoon(),
            ),
          ),
            s++);
        i.commit(e);
      });
    }),
      r.restore(this._editor));
  }
  _resolveCodeLensesInViewportSoon() {
    this._editor.getModel() && this._resolveCodeLensesScheduler.schedule();
  }
  _resolveCodeLensesInViewport() {
    (this._resolveCodeLensesPromise?.cancel(), (this._resolveCodeLensesPromise = void 0));
    const e = this._editor.getModel();
    if (!e) return;
    const t = [],
      n = [];
    if (
      (this._lenses.forEach((i) => {
        const r = i.computeIfNecessary(e);
        r && (t.push(r), n.push(i));
      }),
      0 === t.length)
    )
      return void this._oldCodeLensModels.clear();
    const i = Date.now(),
      r = gM((i) => {
        const r = t.map((t, r) => {
          const o = new Array(t.length),
            s = t.map((t, n) =>
              t.symbol.command || "function" != typeof t.provider.resolveCodeLens
                ? ((o[n] = t.symbol), Promise.resolve(void 0))
                : Promise.resolve(t.provider.resolveCodeLens(e, t.symbol, i)).then((e) => {
                    o[n] = e;
                  }, zI),
            );
          return Promise.all(s).then(() => {
            i.isCancellationRequested || n[r].isDisposed() || n[r].updateCommands(o);
          });
        });
        return Promise.all(r);
      });
    ((this._resolveCodeLensesPromise = r),
      this._resolveCodeLensesPromise.then(
        () => {
          const t = this._resolveCodeLensesDebounce.update(e, Date.now() - i);
          ((this._resolveCodeLensesScheduler.delay = t),
            this._currentCodeLensModel && this._codeLensCache.put(e, this._currentCodeLensModel),
            this._oldCodeLensModels.clear(),
            r === this._resolveCodeLensesPromise && (this._resolveCodeLensesPromise = void 0));
        },
        (e) => {
          (HI(e),
            r === this._resolveCodeLensesPromise && (this._resolveCodeLensesPromise = void 0));
        },
      ));
  }
  async getModel() {
    return (
      await this._getCodeLensModelPromise,
      await this._resolveCodeLensesPromise,
      this._currentCodeLensModel?.isDisposed ? void 0 : this._currentCodeLensModel
    );
  }
};
((bme = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([vme(1, mee), vme(2, gme), vme(3, PV), vme(4, Y4), vme(5, ime)], bme)),
  zH(bme.ID, bme, 1),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "codelens.showLensesInCurrentLine",
          precondition: $$.hasCodeLensProvider,
          label: EI(884, "Show CodeLens Commands for Current Line"),
        });
      }
      async run(e, t) {
        if (!t.hasModel()) return;
        const n = e.get(Ghe),
          i = e.get(PV),
          r = e.get(Y4),
          o = t.getSelection().positionLineNumber,
          s = t.getContribution(bme.ID);
        if (!s) return;
        const a = await s.getModel();
        if (!a) return;
        const l = [];
        for (const h of a.lenses)
          h.symbol.command &&
            h.symbol.range.startLineNumber === o &&
            l.push({ label: h.symbol.command.title, command: h.symbol.command });
        if (0 === l.length) return;
        const c = await n.pick(l, { canPickMany: !1, placeHolder: SI(883, "Select a command") });
        if (!c) return;
        let d = c.command;
        if (a.isDisposed) {
          const e = await s.getModel(),
            t = e?.lenses.find(
              (e) => e.symbol.range.startLineNumber === o && e.symbol.command?.title === d.title,
            );
          if (!t || !t.symbol.command) return;
          d = t.symbol.command;
        }
        try {
          await i.executeCommand(d.id, ...(d.arguments || []));
        } catch (u) {
          r.error(u);
        }
      }
    },
  ));
const yme = [];
function xme(e) {
  yme.push(e);
}
function wme() {
  return yme.slice(0);
}
class Cme {
  constructor(e, t, n, i) {
    ((this.priority = e),
      (this.range = t),
      (this.initialMousePosX = n),
      (this.initialMousePosY = i),
      (this.type = 1));
  }
  equals(e) {
    return 1 === e.type && this.range.equalsRange(e.range);
  }
  canAdoptVisibleHover(e, t) {
    return 1 === e.type && t.lineNumber === this.range.startLineNumber;
  }
}
class Sme {
  constructor(e, t, n, i, r, o) {
    ((this.priority = e),
      (this.owner = t),
      (this.range = n),
      (this.initialMousePosX = i),
      (this.initialMousePosY = r),
      (this.supportsMarkerHover = o),
      (this.type = 2));
  }
  equals(e) {
    return 2 === e.type && this.owner === e.owner;
  }
  canAdoptVisibleHover(e, t) {
    return 2 === e.type && this.owner === e.owner;
  }
}
class kme {
  constructor(e, t) {
    ((this.renderedHoverParts = e), (this.disposables = t));
  }
  dispose() {
    for (const e of this.renderedHoverParts) e.dispose();
    this.disposables?.dispose();
  }
}
const Eme = new (class {
  constructor() {
    this._participants = [];
  }
  register(e) {
    this._participants.push(e);
  }
  getAll() {
    return this._participants;
  }
})();
var Nme = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Lme = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Dme = class {
  constructor(e) {
    this._editorWorkerService = e;
  }
  async provideDocumentColors(e, t) {
    return this._editorWorkerService.computeDefaultDocumentColors(e.uri);
  }
  provideColorPresentations(e, t, n) {
    const i = t.range,
      r = t.color,
      o = r.alpha,
      s = new vG(
        new fG(Math.round(255 * r.red), Math.round(255 * r.green), Math.round(255 * r.blue), o),
      ),
      a = o ? vG.Format.CSS.formatRGBA(s) : vG.Format.CSS.formatRGB(s),
      l = o ? vG.Format.CSS.formatHSLA(s) : vG.Format.CSS.formatHSL(s),
      c = o ? vG.Format.CSS.formatHexA(s) : vG.Format.CSS.formatHex(s),
      d = [];
    return (
      d.push({ label: a, textEdit: { range: i, text: a } }),
      d.push({ label: l, textEdit: { range: i, text: l } }),
      d.push({ label: c, textEdit: { range: i, text: c } }),
      d
    );
  }
};
Dme = Nme([Lme(0, Dce)], Dme);
let Tme = class extends PO {
  constructor(e, t) {
    (super(), this._register(e.colorProvider.register("*", new Dme(t))));
  }
};
async function Ime(e, t, n, i = "auto") {
  return Pme(new Ome(), e, t, n, i);
}
function Rme(e, t, n, i) {
  return Promise.resolve(n.provideColorPresentations(e, t, i));
}
Tme = Nme([Lme(0, mee), Lme(1, Dce)], Tme);
class Ome {
  constructor() {}
  async compute(e, t, n, i) {
    const r = await e.provideDocumentColors(t, n);
    if (Array.isArray(r)) for (const o of r) i.push({ colorInfo: o, provider: e });
    return Array.isArray(r);
  }
}
class Mme {
  constructor() {}
  async compute(e, t, n, i) {
    const r = await e.provideDocumentColors(t, n);
    if (Array.isArray(r))
      for (const o of r)
        i.push({
          range: o.range,
          color: [o.color.red, o.color.green, o.color.blue, o.color.alpha],
        });
    return Array.isArray(r);
  }
}
class Ame {
  constructor(e) {
    this.colorInfo = e;
  }
  async compute(e, t, n, i) {
    const r = await e.provideColorPresentations(t, this.colorInfo, aM.None);
    return (Array.isArray(r) && i.push(...r), Array.isArray(r));
  }
}
async function Pme(e, t, n, i, r) {
  let o,
    s = !1;
  const a = [],
    l = t.ordered(n);
  for (let c = l.length - 1; c >= 0; c--) {
    const t = l[c];
    if ("always" !== r && t instanceof Dme) o = t;
    else
      try {
        (await e.compute(t, n, i, a)) && (s = !0);
      } catch (spt) {
        zI(spt);
      }
  }
  return s ? a : o && "never" !== r ? (await e.compute(o, n, i, a), a) : [];
}
function jme(e, t) {
  const { colorProvider: n } = e.get(mee),
    i = e.get(wV).getModel(t);
  if (!i) throw GI();
  return {
    model: i,
    colorProviderRegistry: n,
    defaultColorDecoratorsEnablement: e
      .get(OU)
      .getValue("editor.defaultColorDecorators", { resource: t }),
  };
}
var Fme,
  Bme = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const Vme = Object.create({});
let Wme = class extends PO {
  static {
    Fme = this;
  }
  static {
    this.ID = "editor.contrib.colorDetector";
  }
  static {
    this.RECOMPUTE_TIME = 1e3;
  }
  constructor(e, t, n, i) {
    (super(),
      (this._editor = e),
      (this._configurationService = t),
      (this._languageFeaturesService = n),
      (this._localToDispose = this._register(new AO())),
      (this._decorationsIds = []),
      (this._colorDatas = new Map()),
      (this._decoratorLimitReporter = this._register(new Hme())),
      (this._colorDecorationClassRefs = this._register(new AO())),
      (this._colorDecoratorIds = this._editor.createDecorationsCollection()),
      (this._ruleFactory = this._register(new JX(this._editor))),
      (this._debounceInformation = i.for(n.colorProvider, "Document Colors", {
        min: Fme.RECOMPUTE_TIME,
      })),
      this._register(
        e.onDidChangeModel(() => {
          ((this._isColorDecoratorsEnabled = this.isEnabled()), this.updateColors());
        }),
      ),
      this._register(e.onDidChangeModelLanguage(() => this.updateColors())),
      this._register(n.colorProvider.onDidChange(() => this.updateColors())),
      this._register(
        e.onDidChangeConfiguration((e) => {
          const t = this._isColorDecoratorsEnabled;
          ((this._isColorDecoratorsEnabled = this.isEnabled()),
            (this._defaultColorDecoratorsEnablement = this._editor.getOption(167)));
          const n = t !== this._isColorDecoratorsEnabled || e.hasChanged(27),
            i = e.hasChanged(167);
          (n || i) &&
            (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() {
    const e = this._editor.getModel();
    if (!e) return !1;
    const t = e.getLanguageId(),
      n = this._configurationService.getValue(t);
    if (n && "object" == typeof n) {
      const e = n.colorDecorators;
      if (e && void 0 !== e.enable && !e.enable) return e.enable;
    }
    return this._editor.getOption(26);
  }
  static get(e) {
    return e.getContribution(this.ID);
  }
  dispose() {
    (this.stop(), this.removeAllDecorations(), super.dispose());
  }
  updateColors() {
    if ((this.stop(), !this._isColorDecoratorsEnabled)) return;
    const e = this._editor.getModel();
    e &&
      this._languageFeaturesService.colorProvider.has(e) &&
      (this._localToDispose.add(
        this._editor.onDidChangeModelContent(() => {
          this._timeoutTimer ||
            ((this._timeoutTimer = new SM()),
            this._timeoutTimer.cancelAndSet(() => {
              ((this._timeoutTimer = null), this.beginCompute());
            }, this._debounceInformation.get(e)));
        }),
      ),
      this.beginCompute());
  }
  async beginCompute() {
    this._computePromise = gM(async (e) => {
      const t = this._editor.getModel();
      if (!t) return [];
      const n = new UO(!1),
        i = await Ime(
          this._languageFeaturesService.colorProvider,
          t,
          e,
          this._defaultColorDecoratorsEnablement,
        );
      return (this._debounceInformation.update(t, n.elapsed()), i);
    });
    try {
      const e = await this._computePromise;
      (this.updateDecorations(e), this.updateColorDecorators(e), (this._computePromise = null));
    } catch (spt) {
      HI(spt);
    }
  }
  stop() {
    (this._timeoutTimer && (this._timeoutTimer.cancel(), (this._timeoutTimer = null)),
      this._computePromise && (this._computePromise.cancel(), (this._computePromise = null)),
      this._localToDispose.clear());
  }
  updateDecorations(e) {
    const t = e.map((e) => ({
      range: {
        startLineNumber: e.colorInfo.range.startLineNumber,
        startColumn: e.colorInfo.range.startColumn,
        endLineNumber: e.colorInfo.range.endLineNumber,
        endColumn: e.colorInfo.range.endColumn,
      },
      options: cee.EMPTY,
    }));
    this._editor.changeDecorations((n) => {
      ((this._decorationsIds = n.deltaDecorations(this._decorationsIds, t)),
        (this._colorDatas = new Map()),
        this._decorationsIds.forEach((t, n) => this._colorDatas.set(t, e[n])));
    });
  }
  updateColorDecorators(e) {
    this._colorDecorationClassRefs.clear();
    const t = [],
      n = this._editor.getOption(27);
    for (let r = 0; r < e.length && t.length < n; r++) {
      const { red: n, green: i, blue: o, alpha: s } = e[r].colorInfo.color,
        a = new fG(Math.round(255 * n), Math.round(255 * i), Math.round(255 * o), s),
        l = `rgba(${a.r}, ${a.g}, ${a.b}, ${a.a})`,
        c = this._colorDecorationClassRefs.add(
          this._ruleFactory.createClassNameRef({ backgroundColor: l }),
        );
      t.push({
        range: {
          startLineNumber: e[r].colorInfo.range.startLineNumber,
          startColumn: e[r].colorInfo.range.startColumn,
          endLineNumber: e[r].colorInfo.range.endLineNumber,
          endColumn: e[r].colorInfo.range.endColumn,
        },
        options: {
          description: "colorDetector",
          before: {
            content: " ",
            inlineClassName: `${c.className} colorpicker-color-decoration`,
            inlineClassNameAffectsLetterSpacing: !0,
            attachedData: Vme,
          },
        },
      });
    }
    const i = n < e.length && n;
    (this._decoratorLimitReporter.update(e.length, i), this._colorDecoratorIds.set(t));
  }
  removeAllDecorations() {
    (this._editor.removeDecorations(this._decorationsIds),
      (this._decorationsIds = []),
      this._colorDecoratorIds.clear(),
      this._colorDecorationClassRefs.clear());
  }
  getColorData(e) {
    const t = this._editor.getModel();
    if (!t) return null;
    const n = t
      .getDecorationsInRange(YH.fromPositions(e, e))
      .filter((e) => this._colorDatas.has(e.id));
    return 0 === n.length ? null : this._colorDatas.get(n[0].id);
  }
  isColorDecoration(e) {
    return this._colorDecoratorIds.has(e);
  }
};
Wme = Fme = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Bme(1, OU), Bme(2, mee), Bme(3, gme)], Wme);
class Hme extends PO {
  constructor() {
    (super(...arguments),
      (this._onDidChange = this._register(new QO())),
      (this._computed = 0),
      (this._limited = !1));
  }
  update(e, t) {
    (e === this._computed && t === this._limited) ||
      ((this._computed = e), (this._limited = t), this._onDidChange.fire());
  }
}
const zme = "editor.action.showHover",
  Ume = "editor.action.increaseHoverVerbosityLevel",
  $me = SI(1102, "Increase Hover Verbosity Level"),
  qme = "editor.action.decreaseHoverVerbosityLevel",
  Kme = SI(1103, "Decrease Hover Verbosity Level"),
  Gme = "editor.action.inlineSuggest.commit",
  Zme = "editor.action.inlineSuggest.showPrevious",
  Yme = "editor.action.inlineSuggest.showNext",
  Xme = "editor.action.inlineSuggest.hide",
  Qme = "editor.action.inlineSuggest.toggleShowCollapsed";
var Jme,
  e_e = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  t_e = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let n_e = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this.editor = e),
      (this.model = t),
      (this.instantiationService = n),
      (this.alwaysShowToolbar = gF(
        this,
        this.editor.onDidChangeConfiguration,
        () => "always" === this.editor.getOption(71).showToolbar,
      )),
      (this.sessionPosition = void 0),
      (this.position = Xj(this, (e) => {
        const t = this.model.read(e)?.primaryGhostText.read(e);
        if (!this.alwaysShowToolbar.read(e) || !t || 0 === t.parts.length)
          return ((this.sessionPosition = void 0), null);
        const n = t.parts[0].column;
        this.sessionPosition &&
          this.sessionPosition.lineNumber !== t.lineNumber &&
          (this.sessionPosition = void 0);
        const i = new xV(
          t.lineNumber,
          Math.min(n, this.sessionPosition?.column ?? Number.MAX_SAFE_INTEGER),
        );
        return ((this.sessionPosition = i), i);
      })),
      this._register(
        aF((t, n) => {
          const i = this.model.read(t);
          if (!i || !this.alwaysShowToolbar.read(t)) return;
          const r = Xj((t) => {
              const n = t.store.add(
                this.instantiationService.createInstance(
                  o_e.hot.read(t),
                  this.editor,
                  !0,
                  this.position,
                  i.selectedInlineCompletionIndex,
                  i.inlineCompletionsCount,
                  i.activeCommands,
                  i.warning,
                  () => {},
                ),
              );
              return (
                e.addContentWidget(n),
                t.store.add(MO(() => e.removeContentWidget(n))),
                t.store.add(
                  rF((e) => {
                    this.position.read(e) &&
                      i.lastTriggerKind.read(e) !== p2.Explicit &&
                      i.triggerExplicitly();
                  }),
                ),
                n
              );
            }),
            o = bF(this, (e, t) => !!this.position.read(e) || !!t);
          n.add(
            rF((e) => {
              o.read(e) && r.read(e);
            }),
          );
        }),
      ));
  }
};
n_e = e_e([t_e(2, vV)], n_e);
const i_e = Zle(
    "inline-suggestion-hints-next",
    OV.chevronRight,
    SI(1207, "Icon for show next parameter hint."),
  ),
  r_e = Zle(
    "inline-suggestion-hints-previous",
    OV.chevronLeft,
    SI(1208, "Icon for show previous parameter hint."),
  );
let o_e = class extends PO {
  static {
    Jme = this;
  }
  static {
    this.hot = Sne(this);
  }
  static {
    this._dropDownVisible = !1;
  }
  static get dropDownVisible() {
    return this._dropDownVisible;
  }
  static {
    this.id = 0;
  }
  createCommandAction(e, t, n) {
    const i = new SV(e, t, n, !0, () => this._commandService.executeCommand(e)),
      r = this.keybindingService.lookupKeybinding(e, this._contextKeyService);
    let o = t;
    return (r && (o = SI(1209, "{0} ({1})", t, r.getLabel())), (i.tooltip = o), i);
  }
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h) {
    (super(),
      (this.editor = e),
      (this.withBorder = t),
      (this._position = n),
      (this._currentSuggestionIdx = i),
      (this._suggestionCount = r),
      (this._extraCommands = o),
      (this._warning = s),
      (this._relayout = a),
      (this._commandService = l),
      (this.keybindingService = d),
      (this._contextKeyService = u),
      (this._menuService = h),
      (this.id = "InlineSuggestionHintsContentWidget" + Jme.id++),
      (this.allowEditorOverflow = !0),
      (this.suppressMouseDown = !1),
      (this._warningMessageContentNode = Xj((e) => {
        const t = this._warning.read(e);
        if (!t) return;
        if ("string" == typeof t.message) return t.message;
        return e.store.add(Use(t.message)).element;
      })),
      (this._warningMessageNode = XB.div(
        {
          class: "warningMessage",
          style: {
            maxWidth: 400,
            margin: 4,
            marginBottom: 4,
            display: Xj((e) => (this._warning.read(e) ? "block" : "none")),
          },
        },
        [this._warningMessageContentNode],
      ).keepUpdated(this._store)),
      (this.nodes = GB(
        "div.inlineSuggestionsHints",
        { className: this.withBorder ? "monaco-hover monaco-hover-content" : "" },
        [this._warningMessageNode.element, GB("div@toolBar")],
      )),
      (this.previousAction = this._register(
        this.createCommandAction(Zme, SI(1210, "Previous"), AV.asClassName(r_e)),
      )),
      (this.availableSuggestionCountAction = this._register(
        new SV("inlineSuggestionHints.availableSuggestionCount", "", void 0, !1),
      )),
      (this.nextAction = this._register(
        this.createCommandAction(Yme, SI(1211, "Next"), AV.asClassName(i_e)),
      )),
      (this.inlineCompletionsActionsMenus = this._register(
        this._menuService.createMenu(MW.InlineCompletionsActions, this._contextKeyService),
      )),
      (this.clearAvailableSuggestionCountLabelDebounced = this._register(
        new EM(() => {
          this.availableSuggestionCountAction.label = "";
        }, 100),
      )),
      (this.disableButtonsDebounced = this._register(
        new EM(() => {
          this.previousAction.enabled = this.nextAction.enabled = !1;
        }, 100),
      )),
      this._register(
        rF((e) => {
          (this._warningMessageContentNode.read(e),
            this._warningMessageNode.readEffect(e),
            this._relayout());
        }),
      ),
      (this.toolBar = this._register(
        c.createInstance(l_e, this.nodes.toolBar, MW.InlineSuggestionToolbar, {
          menuOptions: { renderShortTitle: !0 },
          toolbarOptions: { primaryGroup: (e) => e.startsWith("primary") },
          actionViewItemProvider: (e, t) => {
            if (e instanceof BW) return c.createInstance(a_e, e, void 0);
            if (e === this.availableSuggestionCountAction) {
              const t = new s_e(void 0, e, { label: !0, icon: !1 });
              return (t.setClass("availableSuggestionCount"), t);
            }
          },
          telemetrySource: "InlineSuggestionToolbar",
        }),
      )),
      this.toolBar.setPrependedPrimaryActions([
        this.previousAction,
        this.availableSuggestionCountAction,
        this.nextAction,
      ]),
      this._register(
        this.toolBar.onDidChangeDropdownVisibility((e) => {
          Jme._dropDownVisible = e;
        }),
      ),
      this._register(
        rF((e) => {
          (this._position.read(e), this.editor.layoutContentWidget(this));
        }),
      ),
      this._register(
        rF((e) => {
          const t = this._suggestionCount.read(e),
            n = this._currentSuggestionIdx.read(e);
          (void 0 !== t
            ? (this.clearAvailableSuggestionCountLabelDebounced.cancel(),
              (this.availableSuggestionCountAction.label = `${n + 1}/${t}`))
            : this.clearAvailableSuggestionCountLabelDebounced.schedule(),
            void 0 !== t && t > 1
              ? (this.disableButtonsDebounced.cancel(),
                (this.previousAction.enabled = this.nextAction.enabled = !0))
              : this.disableButtonsDebounced.schedule());
        }),
      ),
      this._register(
        rF((e) => {
          const t = this._extraCommands
            .read(e)
            .map((e) => ({
              class: void 0,
              id: e.command.id,
              enabled: !0,
              tooltip: e.command.tooltip || "",
              label: e.command.title,
              run: (t) => this._commandService.executeCommand(e.command.id),
            }));
          for (const [n, i] of this.inlineCompletionsActionsMenus.getActions())
            for (const e of i) e instanceof BW && t.push(e);
          (t.length > 0 && t.unshift(new EV()), this.toolBar.setAdditionalSecondaryActions(t));
        }),
      ));
  }
  getId() {
    return this.id;
  }
  getDomNode() {
    return this.nodes.root;
  }
  getPosition() {
    return { position: this._position.get(), preference: [1, 2], positionAffinity: 3 };
  }
};
o_e = Jme = e_e([t_e(8, PV), t_e(9, vV), t_e(10, N5), t_e(11, xW), t_e(12, AW)], o_e);
class s_e extends xle {
  constructor() {
    (super(...arguments), (this._className = void 0));
  }
  setClass(e) {
    this._className = e;
  }
  render(e) {
    (super.render(e), this._className && e.classList.add(this._className));
  }
  updateTooltip() {}
}
class a_e extends Lue {
  updateLabel() {
    const e = this._keybindingService.lookupKeybinding(
      this._action.id,
      this._contextKeyService,
      !0,
    );
    if (!e) return super.updateLabel();
    if (this.label) {
      const t = GB("div.keybinding").root;
      (this._register(new vpe(t, GR, { disableTitle: !0, ..._pe })).set(e),
        (this.label.textContent = this._action.label),
        this.label.appendChild(t),
        this.label.classList.add("inlineSuggestionStatusBarItemLabel"));
    }
  }
  updateTooltip() {}
}
let l_e = class extends Gue {
  constructor(e, t, n, i, r, o, s, a, l) {
    (super(e, { resetMenu: t, ...n }, i, r, o, s, a, l),
      (this.menuId = t),
      (this.options2 = n),
      (this.menuService = i),
      (this.contextKeyService = r),
      (this.menu = this._store.add(
        this.menuService.createMenu(this.menuId, this.contextKeyService, {
          emitEventsForSubmenuChanges: !0,
        }),
      )),
      (this.additionalActions = []),
      (this.prependedPrimaryActions = []),
      (this.additionalPrimaryActions = []),
      this._store.add(this.menu.onDidChange(() => this.updateToolbar())),
      this.updateToolbar());
  }
  updateToolbar() {
    const { primary: e, secondary: t } = kue(
      this.menu.getActions(this.options2?.menuOptions),
      this.options2?.toolbarOptions?.primaryGroup,
      this.options2?.toolbarOptions?.shouldInlineSubmenu,
      this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions,
    );
    (t.push(...this.additionalActions),
      e.unshift(...this.prependedPrimaryActions),
      e.push(...this.additionalPrimaryActions),
      this.setActions(e, t));
  }
  setPrependedPrimaryActions(e) {
    XP(this.prependedPrimaryActions, e, (e, t) => e === t) ||
      ((this.prependedPrimaryActions = e), this.updateToolbar());
  }
  setAdditionalSecondaryActions(e) {
    XP(this.additionalActions, e, (e, t) => e === t) ||
      ((this.additionalActions = e), this.updateToolbar());
  }
};
function c_e(e, t, n) {
  const i = aB(e);
  return !(t < i.left || t > i.left + i.width || n < i.top || n > i.top + i.height);
}
l_e = e_e([t_e(3, AW), t_e(4, xW), t_e(5, cde), t_e(6, N5), t_e(7, PV), t_e(8, HW)], l_e);
class d_e {
  constructor(e, t, n, i) {
    ((this.value = e), (this.isComplete = t), (this.hasLoadingMessage = n), (this.options = i));
  }
}
class u_e extends PO {
  constructor(e, t) {
    (super(),
      (this._editor = e),
      (this._computer = t),
      (this._onResult = this._register(new QO())),
      (this.onResult = this._onResult.event),
      (this._asyncComputationScheduler = this._register(
        new h_e((e) => this._triggerAsyncComputation(e), 0),
      )),
      (this._syncComputationScheduler = this._register(
        new h_e((e) => this._triggerSyncComputation(e), 0),
      )),
      (this._loadingMessageScheduler = this._register(
        new h_e((e) => this._triggerLoadingMessage(e), 0),
      )),
      (this._state = 0),
      (this._asyncIterable = null),
      (this._asyncIterableDone = !1),
      (this._result = []));
  }
  dispose() {
    (this._asyncIterable && (this._asyncIterable.cancel(), (this._asyncIterable = 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(e, t) {
    ((this._options = t), (this._state = e), this._fireResult(t));
  }
  _triggerAsyncComputation(e) {
    (this._setState(2, e),
      this._syncComputationScheduler.schedule(e, this._secondWaitTime),
      this._computer.computeAsync
        ? ((this._asyncIterableDone = !1),
          (this._asyncIterable = (function (e) {
            const t = new cM(),
              n = e(t.token);
            return new MM(t, async (e) => {
              const i = t.token.onCancellationRequested(() => {
                (i.dispose(), t.dispose(), e.reject(new KI()));
              });
              try {
                for await (const i of n) {
                  if (t.token.isCancellationRequested) return;
                  e.emitOne(i);
                }
                (i.dispose(), t.dispose());
              } catch (r) {
                (i.dispose(), t.dispose(), e.reject(r));
              }
            });
          })((t) => this._computer.computeAsync(e, t))),
          (async () => {
            try {
              for await (const t of this._asyncIterable)
                t && (this._result.push(t), this._fireResult(e));
              ((this._asyncIterableDone = !0),
                (3 !== this._state && 4 !== this._state) || this._setState(0, e));
            } catch (spt) {
              HI(spt);
            }
          })())
        : (this._asyncIterableDone = !0));
  }
  _triggerSyncComputation(e) {
    (this._computer.computeSync &&
      (this._result = this._result.concat(this._computer.computeSync(e))),
      this._setState(this._asyncIterableDone ? 0 : 3, e));
  }
  _triggerLoadingMessage(e) {
    3 === this._state && this._setState(4, e);
  }
  _fireResult(e) {
    if (1 === this._state || 2 === this._state) return;
    const t = 0 === this._state,
      n = 4 === this._state;
    this._onResult.fire(new d_e(this._result.slice(0), t, n, e));
  }
  start(e, t) {
    if (0 === e)
      0 === this._state &&
        (this._setState(1, t),
        this._asyncComputationScheduler.schedule(t, this._firstWaitTime),
        this._loadingMessageScheduler.schedule(t, this._loadingMessageTime));
    else
      switch (this._state) {
        case 0:
          (this._triggerAsyncComputation(t),
            this._syncComputationScheduler.cancel(),
            this._triggerSyncComputation(t));
          break;
        case 2:
          (this._syncComputationScheduler.cancel(), this._triggerSyncComputation(t));
      }
  }
  cancel() {
    (this._asyncComputationScheduler.cancel(),
      this._syncComputationScheduler.cancel(),
      this._loadingMessageScheduler.cancel(),
      this._asyncIterable && (this._asyncIterable.cancel(), (this._asyncIterable = null)),
      (this._result = []),
      (this._options = void 0),
      (this._state = 0));
  }
  get options() {
    return this._options;
  }
}
class h_e extends PO {
  constructor(e, t) {
    (super(), (this._scheduler = this._register(new EM(() => e(this._options), t))));
  }
  schedule(e, t) {
    ((this._options = e), this._scheduler.schedule(t));
  }
  cancel() {
    this._scheduler.cancel();
  }
}
class g_e {
  get onDidWillResize() {
    return this._onDidWillResize.event;
  }
  get onDidResize() {
    return this._onDidResize.event;
  }
  constructor() {
    let e;
    ((this._onDidWillResize = new QO()),
      (this._onDidResize = new QO()),
      (this._sashListener = new AO()),
      (this._size = new oB(0, 0)),
      (this._minSize = new oB(0, 0)),
      (this._maxSize = new oB(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)),
      (this.domNode = document.createElement("div")),
      (this._eastSash = new Ade(
        this.domNode,
        { getVerticalSashLeft: () => this._size.width },
        { orientation: 0 },
      )),
      (this._westSash = new Ade(
        this.domNode,
        { getVerticalSashLeft: () => 0 },
        { orientation: 0 },
      )),
      (this._northSash = new Ade(
        this.domNode,
        { getHorizontalSashTop: () => 0 },
        { orientation: 1, orthogonalEdge: Lde.North },
      )),
      (this._southSash = new Ade(
        this.domNode,
        { getHorizontalSashTop: () => this._size.height },
        { orientation: 1, orthogonalEdge: Lde.South },
      )),
      (this._northSash.orthogonalStartSash = this._westSash),
      (this._northSash.orthogonalEndSash = this._eastSash),
      (this._southSash.orthogonalStartSash = this._westSash),
      (this._southSash.orthogonalEndSash = this._eastSash));
    let t = 0,
      n = 0;
    (this._sashListener.add(
      $O.any(
        this._northSash.onDidStart,
        this._eastSash.onDidStart,
        this._southSash.onDidStart,
        this._westSash.onDidStart,
      )(() => {
        void 0 === e && (this._onDidWillResize.fire(), (e = this._size), (t = 0), (n = 0));
      }),
    ),
      this._sashListener.add(
        $O.any(
          this._northSash.onDidEnd,
          this._eastSash.onDidEnd,
          this._southSash.onDidEnd,
          this._westSash.onDidEnd,
        )(() => {
          void 0 !== e &&
            ((e = void 0),
            (t = 0),
            (n = 0),
            this._onDidResize.fire({ dimension: this._size, done: !0 }));
        }),
      ),
      this._sashListener.add(
        this._eastSash.onDidChange((i) => {
          e &&
            ((n = i.currentX - i.startX),
            this.layout(e.height + t, e.width + n),
            this._onDidResize.fire({ dimension: this._size, done: !1, east: !0 }));
        }),
      ),
      this._sashListener.add(
        this._westSash.onDidChange((i) => {
          e &&
            ((n = -(i.currentX - i.startX)),
            this.layout(e.height + t, e.width + n),
            this._onDidResize.fire({ dimension: this._size, done: !1, west: !0 }));
        }),
      ),
      this._sashListener.add(
        this._northSash.onDidChange((i) => {
          e &&
            ((t = -(i.currentY - i.startY)),
            this.layout(e.height + t, e.width + n),
            this._onDidResize.fire({ dimension: this._size, done: !1, north: !0 }));
        }),
      ),
      this._sashListener.add(
        this._southSash.onDidChange((i) => {
          e &&
            ((t = i.currentY - i.startY),
            this.layout(e.height + t, e.width + n),
            this._onDidResize.fire({ dimension: this._size, done: !1, south: !0 }));
        }),
      ),
      this._sashListener.add(
        $O.any(
          this._eastSash.onDidReset,
          this._westSash.onDidReset,
        )((e) => {
          this._preferredSize &&
            (this.layout(this._size.height, this._preferredSize.width),
            this._onDidResize.fire({ dimension: this._size, done: !0 }));
        }),
      ),
      this._sashListener.add(
        $O.any(
          this._northSash.onDidReset,
          this._southSash.onDidReset,
        )((e) => {
          this._preferredSize &&
            (this.layout(this._preferredSize.height, this._size.width),
            this._onDidResize.fire({ dimension: this._size, done: !0 }));
        }),
      ));
  }
  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(e, t, n, i) {
    ((this._northSash.state = e ? 3 : 0),
      (this._eastSash.state = t ? 3 : 0),
      (this._southSash.state = n ? 3 : 0),
      (this._westSash.state = i ? 3 : 0));
  }
  layout(e = this.size.height, t = this.size.width) {
    const { height: n, width: i } = this._minSize,
      { height: r, width: o } = this._maxSize;
    ((e = Math.max(n, Math.min(r, e))), (t = Math.max(i, Math.min(o, t))));
    const s = new oB(t, e);
    oB.equals(s, this._size) ||
      ((this.domNode.style.height = e + "px"),
      (this.domNode.style.width = t + "px"),
      (this._size = s),
      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(e) {
    this._maxSize = e;
  }
  get maxSize() {
    return this._maxSize;
  }
  set minSize(e) {
    this._minSize = e;
  }
  get minSize() {
    return this._minSize;
  }
  set preferredSize(e) {
    this._preferredSize = e;
  }
  get preferredSize() {
    return this._preferredSize;
  }
}
class p_e extends PO {
  constructor(e, t = new oB(10, 10)) {
    (super(),
      (this._editor = e),
      (this.allowEditorOverflow = !0),
      (this.suppressMouseDown = !1),
      (this._resizableNode = this._register(new g_e())),
      (this._contentPosition = null),
      (this._isResizing = !1),
      (this._resizableNode.domNode.style.position = "absolute"),
      (this._resizableNode.minSize = oB.lift(t)),
      this._resizableNode.layout(t.height, t.width),
      this._resizableNode.enableSashes(!0, !0, !0, !0),
      this._register(
        this._resizableNode.onDidResize((e) => {
          (this._resize(new oB(e.dimension.width, e.dimension.height)),
            e.done && (this._isResizing = !1));
        }),
      ),
      this._register(
        this._resizableNode.onDidWillResize(() => {
          this._isResizing = !0;
        }),
      ));
  }
  get isResizing() {
    return this._isResizing;
  }
  getDomNode() {
    return this._resizableNode.domNode;
  }
  getPosition() {
    return this._contentPosition;
  }
  get position() {
    return this._contentPosition?.position ? xV.lift(this._contentPosition.position) : void 0;
  }
  _availableVerticalSpaceAbove(e) {
    const t = this._editor.getDomNode(),
      n = this._editor.getScrolledVisiblePosition(e);
    if (!t || !n) return;
    return aB(t).top + n.top - 30;
  }
  _availableVerticalSpaceBelow(e) {
    const t = this._editor.getDomNode(),
      n = this._editor.getScrolledVisiblePosition(e);
    if (!t || !n) return;
    const i = aB(t),
      r = iB(t.ownerDocument.body),
      o = i.top + n.top + n.height;
    return r.height - o - 24;
  }
  _findPositionPreference(e, t) {
    const n = Math.min(this._availableVerticalSpaceBelow(t) ?? 1 / 0, e),
      i = Math.min(this._availableVerticalSpaceAbove(t) ?? 1 / 0, e),
      r = Math.min(Math.max(i, n), e),
      o = Math.min(e, r);
    let s;
    return (
      (s = this._editor.getOption(69).above ? (o <= i ? 1 : 2) : o <= n ? 2 : 1),
      1 === s
        ? this._resizableNode.enableSashes(!0, !0, !1, !1)
        : this._resizableNode.enableSashes(!1, !0, !0, !1),
      s
    );
  }
  _resize(e) {
    this._resizableNode.layout(e.height, e.width);
  }
}
const f_e = VB;
let m_e = class extends PO {
  constructor(e) {
    (super(),
      (this.containerDomNode = document.createElement("div")),
      (this.containerDomNode.className = "monaco-hover"),
      this.containerDomNode.classList.toggle("fade-in", !!e),
      (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 wJ(this.contentsDomNode, { consumeMouseWheelIfScrollbarIsNeeded: !0 }),
      )),
      this.containerDomNode.appendChild(this.scrollbar.getDomNode()));
  }
  onContentsChanged() {
    this.scrollbar.scanDomNode();
  }
};
class __e extends PO {
  static render(e, t, n) {
    return new __e(e, t, n);
  }
  constructor(e, t, n) {
    if (
      (super(),
      (this.actionLabel = t.label),
      (this.actionKeybindingLabel = n),
      (this.actionContainer = MB(e, f_e("div.action-container"))),
      this.actionContainer.setAttribute("tabindex", "0"),
      (this.action = MB(this.actionContainer, f_e("a.action"))),
      this.action.setAttribute("role", "button"),
      t.iconClass)
    ) {
      MB(this.action, f_e("span.icon")).classList.add(...t.iconClass.split(" "));
    }
    this.actionRenderedLabel = n ? `${t.label} (${n})` : t.label;
    ((MB(this.action, f_e("span")).textContent = this.actionRenderedLabel),
      this._store.add(new b_e(this.actionContainer, t.run)),
      this._store.add(new y_e(this.actionContainer, t.run, [3, 10])),
      this.setEnabled(!0));
  }
  setEnabled(e) {
    e
      ? (this.actionContainer.classList.remove("disabled"),
        this.actionContainer.removeAttribute("aria-disabled"))
      : (this.actionContainer.classList.add("disabled"),
        this.actionContainer.setAttribute("aria-disabled", "true"));
  }
}
function v_e(e, t) {
  return e && t
    ? SI(7, "Inspect this in the accessible view with {0}.", t)
    : e
      ? SI(
          8,
          "Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding.",
        )
      : "";
}
class b_e extends PO {
  constructor(e, t) {
    (super(),
      this._register(
        $F(e, DB.CLICK, (n) => {
          (n.stopPropagation(), n.preventDefault(), t(e));
        }),
      ));
  }
}
class y_e extends PO {
  constructor(e, t, n) {
    (super(),
      this._register(
        $F(e, DB.KEY_DOWN, (i) => {
          const r = new wO(i);
          n.some((e) => r.equals(e)) && (i.stopPropagation(), i.preventDefault(), t(e));
        }),
      ));
  }
}
var x_e,
  w_e = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let C_e = class extends p_e {
  static {
    x_e = this;
  }
  static {
    this.ID = "editor.contrib.resizableContentHoverWidget";
  }
  static {
    this._lastDimensions = new oB(0, 0);
  }
  get isVisibleFromKeyboard() {
    return 2 === this._renderedHover?.source;
  }
  get isVisible() {
    return this._hoverVisibleKey.get() ?? !1;
  }
  get isFocused() {
    return this._hoverFocusedKey.get() ?? !1;
  }
  constructor(e, t, n, i, r) {
    const o = e.getOption(75) + 8,
      s = new oB(150, o);
    (super(e, s),
      (this._configurationService = n),
      (this._accessibilityService = i),
      (this._keybindingService = r),
      (this._hover = this._register(new m_e(!0))),
      (this._onDidResize = this._register(new QO())),
      (this.onDidResize = this._onDidResize.event),
      (this._onDidScroll = this._register(new QO())),
      (this.onDidScroll = this._onDidScroll.event),
      (this._onContentsChanged = this._register(new QO())),
      (this.onContentsChanged = this._onContentsChanged.event),
      (this._minimumSize = s),
      (this._hoverVisibleKey = $$.hoverVisible.bindTo(t)),
      (this._hoverFocusedKey = $$.hoverFocused.bindTo(t)),
      MB(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((e) => {
          e.hasChanged(59) && this._updateFont();
        }),
      ));
    const a = this._register(OB(this._resizableNode.domNode));
    (this._register(
      a.onDidFocus(() => {
        this._hoverFocusedKey.set(!0);
      }),
    ),
      this._register(
        a.onDidBlur(() => {
          this._hoverFocusedKey.set(!1);
        }),
      ),
      this._register(
        this._hover.scrollbar.onScroll((e) => {
          this._onDidScroll.fire(e);
        }),
      ),
      this._setRenderedHover(void 0),
      this._editor.addContentWidget(this));
  }
  dispose() {
    (super.dispose(), this._renderedHover?.dispose(), this._editor.removeContentWidget(this));
  }
  getId() {
    return x_e.ID;
  }
  static _applyDimensions(e, t, n) {
    const i = "number" == typeof t ? `${t}px` : t,
      r = "number" == typeof n ? `${n}px` : n;
    ((e.style.width = i), (e.style.height = r));
  }
  _setContentsDomNodeDimensions(e, t) {
    const n = this._hover.contentsDomNode;
    return x_e._applyDimensions(n, e, t);
  }
  _setContainerDomNodeDimensions(e, t) {
    const n = this._hover.containerDomNode;
    return x_e._applyDimensions(n, e, t);
  }
  _setScrollableElementDimensions(e, t) {
    const n = this._hover.scrollbar.getDomNode();
    return x_e._applyDimensions(n, e, t);
  }
  _setHoverWidgetDimensions(e, t) {
    (this._setContainerDomNodeDimensions(e, t),
      this._setScrollableElementDimensions(e, t),
      this._setContentsDomNodeDimensions(e, t),
      this._layoutContentWidget());
  }
  static _applyMaxDimensions(e, t, n) {
    const i = "number" == typeof t ? `${t}px` : t,
      r = "number" == typeof n ? `${n}px` : n;
    ((e.style.maxWidth = i), (e.style.maxHeight = r));
  }
  _setHoverWidgetMaxDimensions(e, t) {
    (x_e._applyMaxDimensions(this._hover.contentsDomNode, e, t),
      x_e._applyMaxDimensions(this._hover.scrollbar.getDomNode(), e, t),
      x_e._applyMaxDimensions(this._hover.containerDomNode, e, t),
      this._hover.containerDomNode.style.setProperty(
        "--vscode-hover-maxWidth",
        "number" == typeof e ? `${e}px` : e,
      ),
      this._layoutContentWidget());
  }
  _setAdjustedHoverWidgetDimensions(e) {
    (this._setHoverWidgetMaxDimensions("none", "none"),
      this._setHoverWidgetDimensions(e.width, e.height));
  }
  _updateResizableNodeMaxDimensions() {
    const e = this._findMaximumRenderingWidth() ?? 1 / 0,
      t = this._findMaximumRenderingHeight() ?? 1 / 0;
    ((this._resizableNode.maxSize = new oB(e, t)), this._setHoverWidgetMaxDimensions(e, t));
  }
  _resize(e) {
    ((x_e._lastDimensions = new oB(e.width, e.height)),
      this._setAdjustedHoverWidgetDimensions(e),
      this._resizableNode.layout(e.height, e.width),
      this._updateResizableNodeMaxDimensions(),
      this._hover.scrollbar.scanDomNode(),
      this._editor.layoutContentWidget(this),
      this._onDidResize.fire());
  }
  _findAvailableSpaceVertically() {
    const e = this._renderedHover?.showAtPosition;
    if (e)
      return 1 === this._positionPreference
        ? this._availableVerticalSpaceAbove(e)
        : this._availableVerticalSpaceBelow(e);
  }
  _findMaximumRenderingHeight() {
    const e = this._findAvailableSpaceVertically();
    if (!e) return;
    let t = this._hover.contentsDomNode.children.length - 1;
    return (
      Array.from(this._hover.contentsDomNode.children).forEach((e) => {
        t += e.clientHeight;
      }),
      Math.min(e, t)
    );
  }
  _isHoverTextOverflowing() {
    (this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace", "nowrap"),
      this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace", "nowrap"));
    const e = Array.from(this._hover.contentsDomNode.children).some(
      (e) => e.scrollWidth > e.clientWidth,
    );
    return (
      this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),
      this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),
      e
    );
  }
  _findMaximumRenderingWidth() {
    if (!this._editor || !this._editor.hasModel()) return;
    const e = this._isHoverTextOverflowing(),
      t = void 0 === this._contentWidth ? 0 : this._contentWidth;
    if (e || this._hover.containerDomNode.clientWidth < t) {
      return iB(this._hover.containerDomNode.ownerDocument.body).width - 14;
    }
    return this._hover.containerDomNode.clientWidth;
  }
  isMouseGettingCloser(e, t) {
    if (!this._renderedHover) return !1;
    if (
      void 0 === this._renderedHover.initialMousePosX ||
      void 0 === this._renderedHover.initialMousePosY
    )
      return (
        (this._renderedHover.initialMousePosX = e),
        (this._renderedHover.initialMousePosY = t),
        !1
      );
    const n = aB(this.getDomNode());
    void 0 === this._renderedHover.closestMouseDistance &&
      (this._renderedHover.closestMouseDistance = S_e(
        this._renderedHover.initialMousePosX,
        this._renderedHover.initialMousePosY,
        n.left,
        n.top,
        n.width,
        n.height,
      ));
    const i = S_e(e, t, n.left, n.top, n.width, n.height);
    return (
      !(i > this._renderedHover.closestMouseDistance + 4) &&
      ((this._renderedHover.closestMouseDistance = Math.min(
        this._renderedHover.closestMouseDistance,
        i,
      )),
      !0)
    );
  }
  _setRenderedHover(e) {
    (this._renderedHover?.dispose(),
      (this._renderedHover = e),
      this._hoverVisibleKey.set(!!e),
      this._hover.containerDomNode.classList.toggle("hidden", !e));
  }
  _updateFont() {
    const { fontSize: e, lineHeight: t } = this._editor.getOption(59),
      n = this._hover.contentsDomNode;
    ((n.style.fontSize = `${e}px`), (n.style.lineHeight = "" + t / e));
    Array.prototype.slice
      .call(this._hover.contentsDomNode.getElementsByClassName("code"))
      .forEach((e) => this._editor.applyFontInfo(e));
  }
  _updateContent(e) {
    const t = this._hover.contentsDomNode;
    ((t.style.paddingBottom = ""), (t.textContent = ""), t.appendChild(e));
  }
  _layoutContentWidget() {
    (this._editor.layoutContentWidget(this), this._hover.onContentsChanged());
  }
  _updateMaxDimensions() {
    const e = Math.max(this._editor.getLayoutInfo().height / 4, 250, x_e._lastDimensions.height),
      t = Math.max(0.66 * this._editor.getLayoutInfo().width, 750, x_e._lastDimensions.width);
    ((this._resizableNode.maxSize = new oB(t, e)), this._setHoverWidgetMaxDimensions(t, e));
  }
  _render(e) {
    (this._setRenderedHover(e),
      this._updateFont(),
      this._updateContent(e.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(e) {
    if (!this._editor || !this._editor.hasModel()) return;
    this._render(e);
    const t = hB(this._hover.containerDomNode),
      n = e.showAtPosition;
    ((this._positionPreference = this._findPositionPreference(t, n) ?? 1),
      this.handleContentsChanged(),
      e.shouldFocus && this._hover.containerDomNode.focus(),
      this._onDidResize.fire());
    const i =
      this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode &&
      v_e(
        !0 === this._configurationService.getValue("accessibility.verbosity.hover") &&
          this._accessibilityService.isScreenReaderOptimized(),
        this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel() ??
          "",
      );
    i &&
      (this._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + ", " + i);
  }
  hide() {
    if (!this._renderedHover) return;
    const e = this._renderedHover.shouldFocus || this._hoverFocusedKey.get();
    (this._setRenderedHover(void 0),
      (this._resizableNode.maxSize = new oB(1 / 0, 1 / 0)),
      this._resizableNode.clearSashHoverState(),
      this._hoverFocusedKey.set(!1),
      this._editor.layoutContentWidget(this),
      e && this._editor.focus());
  }
  _removeConstraintsRenderNormally() {
    const e = this._editor.getLayoutInfo();
    (this._resizableNode.layout(e.height, e.width),
      this._setHoverWidgetDimensions("auto", "auto"),
      this._updateMaxDimensions());
  }
  setMinimumDimensions(e) {
    ((this._minimumSize = new oB(
      Math.max(this._minimumSize.width, e.width),
      Math.max(this._minimumSize.height, e.height),
    )),
      this._updateMinimumWidth());
  }
  _updateMinimumWidth() {
    const e =
      void 0 === this._contentWidth
        ? this._minimumSize.width
        : Math.min(this._contentWidth, this._minimumSize.width);
    this._resizableNode.minSize = new oB(e, this._minimumSize.height);
  }
  handleContentsChanged() {
    this._removeConstraintsRenderNormally();
    const e = this._hover.contentsDomNode;
    let t = hB(e),
      n = cB(e) + 2;
    if (
      (this._resizableNode.layout(t, n),
      this._setHoverWidgetDimensions(n, t),
      (t = hB(e)),
      (n = cB(e)),
      (this._contentWidth = n),
      this._updateMinimumWidth(),
      this._resizableNode.layout(t, n),
      this._renderedHover?.showAtPosition)
    ) {
      const e = hB(this._hover.containerDomNode);
      this._positionPreference = this._findPositionPreference(
        e,
        this._renderedHover.showAtPosition,
      );
    }
    (this._layoutContentWidget(), this._onContentsChanged.fire());
  }
  focus() {
    this._hover.containerDomNode.focus();
  }
  scrollUp() {
    const e = this._hover.scrollbar.getScrollPosition().scrollTop,
      t = this._editor.getOption(59);
    this._hover.scrollbar.setScrollPosition({ scrollTop: e - t.lineHeight });
  }
  scrollDown() {
    const e = this._hover.scrollbar.getScrollPosition().scrollTop,
      t = this._editor.getOption(59);
    this._hover.scrollbar.setScrollPosition({ scrollTop: e + t.lineHeight });
  }
  scrollLeft() {
    const e = this._hover.scrollbar.getScrollPosition().scrollLeft;
    this._hover.scrollbar.setScrollPosition({ scrollLeft: e - 30 });
  }
  scrollRight() {
    const e = this._hover.scrollbar.getScrollPosition().scrollLeft;
    this._hover.scrollbar.setScrollPosition({ scrollLeft: e + 30 });
  }
  pageUp() {
    const e = this._hover.scrollbar.getScrollPosition().scrollTop,
      t = this._hover.scrollbar.getScrollDimensions().height;
    this._hover.scrollbar.setScrollPosition({ scrollTop: e - t });
  }
  pageDown() {
    const e = this._hover.scrollbar.getScrollPosition().scrollTop,
      t = this._hover.scrollbar.getScrollDimensions().height;
    this._hover.scrollbar.setScrollPosition({ scrollTop: e + t });
  }
  goToTop() {
    this._hover.scrollbar.setScrollPosition({ scrollTop: 0 });
  }
  goToBottom() {
    this._hover.scrollbar.setScrollPosition({
      scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight,
    });
  }
};
function S_e(e, t, n, i, r, o) {
  const s = n + r / 2,
    a = i + o / 2,
    l = Math.max(Math.abs(e - s) - r / 2, 0),
    c = Math.max(Math.abs(t - a) - o / 2, 0);
  return Math.sqrt(l * l + c * c);
}
C_e = x_e = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([w_e(1, xW), w_e(2, OU), w_e(3, KK), w_e(4, N5)], C_e);
class k_e {
  constructor(e, t) {
    ((this._editor = e), (this._participants = t));
  }
  static _getLineDecorations(e, t) {
    if (1 !== t.type && !t.supportsMarkerHover) return [];
    const n = e.getModel(),
      i = t.range.startLineNumber;
    if (i > n.getLineCount()) return [];
    const r = n.getLineMaxColumn(i);
    return e.getLineDecorations(i).filter((e) => {
      if (e.options.isWholeLine) return !0;
      const n = e.range.startLineNumber === i ? e.range.startColumn : 1,
        o = e.range.endLineNumber === i ? e.range.endColumn : r;
      if (e.options.showIfCollapsed) {
        if (n > t.range.startColumn + 1 || t.range.endColumn - 1 > o) return !1;
      } else if (n > t.range.startColumn || t.range.endColumn > o) return !1;
      return !0;
    });
  }
  computeAsync(e, t) {
    const n = e.anchor;
    if (!this._editor.hasModel() || !n) return OM.EMPTY;
    const i = k_e._getLineDecorations(this._editor, n);
    return OM.merge(
      this._participants.map((r) =>
        r.computeAsync ? r.computeAsync(n, i, e.source, t) : OM.EMPTY,
      ),
    );
  }
  computeSync(e) {
    if (!this._editor.hasModel()) return [];
    const t = e.anchor,
      n = k_e._getLineDecorations(this._editor, t);
    let i = [];
    for (const r of this._participants) i = i.concat(r.computeSync(t, n, e.source));
    return rj(i);
  }
}
class E_e {
  constructor(e, t, n) {
    ((this.hoverParts = e), (this.isComplete = t), (this.options = n));
  }
  filter(e) {
    const t = this.hoverParts.filter((t) => t.isValidForHoverAnchor(e));
    return t.length === this.hoverParts.length
      ? this
      : new N_e(this, t, this.isComplete, this.options);
  }
}
class N_e extends E_e {
  constructor(e, t, n, i) {
    (super(t, n, i), (this.original = e));
  }
  filter(e) {
    return this.original.filter(e);
  }
}
var L_e = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const D_e = VB;
let T_e = class extends PO {
  get hasContent() {
    return this._hasContent;
  }
  constructor(e, t) {
    (super(),
      (this._keybindingService = e),
      (this._hoverService = t),
      (this.actions = []),
      (this._hasContent = !1),
      (this.hoverElement = D_e("div.hover-row.status-bar")),
      (this.hoverElement.tabIndex = 0),
      (this.actionsElement = MB(this.hoverElement, D_e("div.actions"))));
  }
  addAction(e) {
    const t = this._keybindingService.lookupKeybinding(e.commandId),
      n = t ? t.getLabel() : null;
    this._hasContent = !0;
    const i = this._register(__e.render(this.actionsElement, e, n));
    return (
      this._register(
        this._hoverService.setupManagedHover(
          Bne("element"),
          i.actionContainer,
          i.actionRenderedLabel,
        ),
      ),
      this.actions.push(i),
      i
    );
  }
  append(e) {
    const t = MB(this.actionsElement, e);
    return ((this._hasContent = !0), t);
  }
};
T_e = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([L_e(0, N5), L_e(1, Xue)], T_e);
const I_e = {
  inputActiveOptionBorder: "#007ACC00",
  inputActiveOptionForeground: "#FFFFFF",
  inputActiveOptionBackground: "#0E639C50",
};
class R_e extends rJ {
  get onChange() {
    return this._onChange.event;
  }
  get onKeyDown() {
    return this._onKeyDown.event;
  }
  constructor(e) {
    (super(),
      (this._onChange = this._register(new QO())),
      (this._onKeyDown = this._register(new QO())),
      (this._opts = e),
      (this._title = this._opts.title),
      (this._checked = this._opts.isChecked));
    const t = ["monaco-custom-toggle"];
    (this._opts.icon &&
      ((this._icon = this._opts.icon), t.push(...AV.asClassNameArray(this._icon))),
      this._opts.actionClassName && t.push(...this._opts.actionClassName.split(" ")),
      this._checked && t.push("checked"),
      (this.domNode = document.createElement("div")),
      this._register(
        yae().setupDelayedHover(
          this.domNode,
          () => ({ content: this._title, style: 1 }),
          this._opts.hoverLifecycleOptions,
        ),
      ),
      this.domNode.classList.add(...t),
      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, (e) => {
        this.enabled &&
          ((this.checked = !this._checked), this._onChange.fire(!1), e.preventDefault());
      }),
      this._register(this.ignoreGesture(this.domNode)),
      this.onkeydown(this.domNode, (e) => {
        if (this.enabled)
          return 10 === e.keyCode || 3 === e.keyCode
            ? ((this.checked = !this._checked),
              this._onChange.fire(!0),
              e.preventDefault(),
              void e.stopPropagation())
            : void this._onKeyDown.fire(e);
      }));
  }
  get enabled() {
    return "true" !== this.domNode.getAttribute("aria-disabled");
  }
  focus() {
    this.domNode.focus();
  }
  get checked() {
    return this._checked;
  }
  set checked(e) {
    ((this._checked = e),
      this.domNode.setAttribute("aria-checked", String(this._checked)),
      this.domNode.classList.toggle("checked", this._checked),
      this.applyStyles());
  }
  setIcon(e) {
    (this._icon && this.domNode.classList.remove(...AV.asClassNameArray(this._icon)),
      (this._icon = e),
      this._icon && this.domNode.classList.add(...AV.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", String(!1)),
      this.domNode.classList.remove("disabled"));
  }
  disable() {
    (this.domNode.setAttribute("aria-disabled", String(!0)),
      this.domNode.classList.add("disabled"));
  }
  setTitle(e) {
    ((this._title = e), this.domNode.setAttribute("aria-label", e));
  }
  set visible(e) {
    this.domNode.style.display = e ? "" : "none";
  }
  get visible() {
    return "none" !== this.domNode.style.display;
  }
}
class O_e extends rJ {
  static {
    this.CLASS_NAME = "monaco-checkbox";
  }
  constructor(e, t, n) {
    (super(),
      (this.checkbox = e),
      (this.domNode = t),
      (this.styles = n),
      (this._onChange = this._register(new QO())),
      (this.onChange = this._onChange.event),
      this.applyStyles());
  }
  get enabled() {
    return this.checkbox.enabled;
  }
  enable() {
    (this.checkbox.enable(), this.applyStyles(!0));
  }
  disable() {
    (this.checkbox.disable(), this.applyStyles(!1));
  }
  setTitle(e) {
    this.checkbox.setTitle(e);
  }
  applyStyles(e = this.enabled) {
    ((this.domNode.style.color =
      (e ? this.styles.checkboxForeground : this.styles.checkboxDisabledForeground) || ""),
      (this.domNode.style.backgroundColor =
        (e ? this.styles.checkboxBackground : this.styles.checkboxDisabledBackground) || ""),
      (this.domNode.style.borderColor =
        (e ? this.styles.checkboxBorder : this.styles.checkboxDisabledBackground) || ""));
    const t = this.styles.size || 18;
    ((this.domNode.style.width =
      this.domNode.style.height =
      this.domNode.style.fontSize =
        `${t}px`),
      (this.domNode.style.fontSize = t - 2 + "px"));
  }
}
let M_e = class extends O_e {
  constructor(e, t, n) {
    const i = new R_e({
      title: e,
      isChecked: t,
      icon: OV.check,
      actionClassName: O_e.CLASS_NAME,
      hoverLifecycleOptions: n.hoverLifecycleOptions,
      ...I_e,
    });
    (super(i, i.domNode, n),
      this._register(i),
      this._register(
        this.checkbox.onChange((e) => {
          (this.applyStyles(), this._onChange.fire(e));
        }),
      ));
  }
  get checked() {
    return this.checkbox.checked;
  }
  set checked(e) {
    ((this.checkbox.checked = e), this.applyStyles());
  }
  applyStyles(e) {
    (this.checkbox.checked ? this.checkbox.setIcon(OV.check) : this.checkbox.setIcon(void 0),
      super.applyStyles(e));
  }
};
class A_e extends O_e {
  constructor(e, t, n) {
    let i;
    switch (t) {
      case !0:
        i = OV.check;
        break;
      case "mixed":
        i = OV.dash;
        break;
      case !1:
        i = void 0;
    }
    const r = new R_e({
      title: e,
      isChecked: !0 === t,
      icon: i,
      actionClassName: M_e.CLASS_NAME,
      hoverLifecycleOptions: n.hoverLifecycleOptions,
      ...I_e,
    });
    (super(r, r.domNode, n),
      (this._state = t),
      this._register(r),
      this._register(
        this.checkbox.onChange((e) => {
          ((this._state = this.checkbox.checked), this.applyStyles(), this._onChange.fire(e));
        }),
      ));
  }
  get checked() {
    return this._state;
  }
  set checked(e) {
    this._state !== e &&
      ((this._state = e), (this.checkbox.checked = !0 === e), this.applyStyles());
  }
  applyStyles(e) {
    switch (this._state) {
      case !0:
        this.checkbox.setIcon(OV.check);
        break;
      case "mixed":
        this.checkbox.setIcon(OV.dash);
        break;
      case !1:
        this.checkbox.setIcon(void 0);
    }
    super.applyStyles(e);
  }
}
class P_e {
  constructor(e) {
    ((this._editor = e),
      (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) {
      const e = this._findScopeDecorationIds
        .map((e) => this._editor.getModel().getDecorationRange(e))
        .filter((e) => !!e);
      if (e.length) return e;
    }
    return null;
  }
  getStartPosition() {
    return this._startPosition;
  }
  setStartPosition(e) {
    ((this._startPosition = e), this.setCurrentFindMatch(null));
  }
  _getDecorationIndex(e) {
    const t = this._decorations.indexOf(e);
    return t >= 0 ? t + 1 : 1;
  }
  getDecorationRangeAt(e) {
    const t = e < this._decorations.length ? this._decorations[e] : null;
    return t ? this._editor.getModel().getDecorationRange(t) : null;
  }
  getCurrentMatchesPosition(e) {
    const t = this._editor.getModel().getDecorationsInRange(e);
    for (const n of t) {
      const e = n.options;
      if (e === P_e._FIND_MATCH_DECORATION || e === P_e._CURRENT_FIND_MATCH_DECORATION)
        return this._getDecorationIndex(n.id);
    }
    return 0;
  }
  setCurrentFindMatch(e) {
    let t = null,
      n = 0;
    if (e)
      for (let i = 0, r = this._decorations.length; i < r; i++) {
        const r = this._editor.getModel().getDecorationRange(this._decorations[i]);
        if (e.equalsRange(r)) {
          ((t = this._decorations[i]), (n = i + 1));
          break;
        }
      }
    return (
      (null === this._highlightedDecorationId && null === t) ||
        this._editor.changeDecorations((e) => {
          if (
            (null !== this._highlightedDecorationId &&
              (e.changeDecorationOptions(this._highlightedDecorationId, P_e._FIND_MATCH_DECORATION),
              (this._highlightedDecorationId = null)),
            null !== t &&
              ((this._highlightedDecorationId = t),
              e.changeDecorationOptions(
                this._highlightedDecorationId,
                P_e._CURRENT_FIND_MATCH_DECORATION,
              )),
            null !== this._rangeHighlightDecorationId &&
              (e.removeDecoration(this._rangeHighlightDecorationId),
              (this._rangeHighlightDecorationId = null)),
            null !== t)
          ) {
            let n = this._editor.getModel().getDecorationRange(t);
            if (n.startLineNumber !== n.endLineNumber && 1 === n.endColumn) {
              const e = n.endLineNumber - 1,
                t = this._editor.getModel().getLineMaxColumn(e);
              n = new YH(n.startLineNumber, n.startColumn, e, t);
            }
            this._rangeHighlightDecorationId = e.addDecoration(n, P_e._RANGE_HIGHLIGHT_DECORATION);
          }
        }),
      n
    );
  }
  set(e, t) {
    this._editor.changeDecorations((n) => {
      let i = P_e._FIND_MATCH_DECORATION;
      const r = [];
      if (e.length > 1e3) {
        i = P_e._FIND_MATCH_NO_OVERVIEW_DECORATION;
        const t = this._editor.getModel().getLineCount(),
          n = this._editor.getLayoutInfo().height / t,
          o = Math.max(2, Math.ceil(3 / n));
        let s = e[0].range.startLineNumber,
          a = e[0].range.endLineNumber;
        for (let i = 1, l = e.length; i < l; i++) {
          const t = e[i].range;
          a + o >= t.startLineNumber
            ? t.endLineNumber > a && (a = t.endLineNumber)
            : (r.push({
                range: new YH(s, 1, a, 1),
                options: P_e._FIND_MATCH_ONLY_OVERVIEW_DECORATION,
              }),
              (s = t.startLineNumber),
              (a = t.endLineNumber));
        }
        r.push({ range: new YH(s, 1, a, 1), options: P_e._FIND_MATCH_ONLY_OVERVIEW_DECORATION });
      }
      const o = new Array(e.length);
      for (let t = 0, s = e.length; t < s; t++) o[t] = { range: e[t].range, options: i };
      ((this._decorations = n.deltaDecorations(this._decorations, o)),
        (this._overviewRulerApproximateDecorations = n.deltaDecorations(
          this._overviewRulerApproximateDecorations,
          r,
        )),
        this._rangeHighlightDecorationId &&
          (n.removeDecoration(this._rangeHighlightDecorationId),
          (this._rangeHighlightDecorationId = null)),
        this._findScopeDecorationIds.length &&
          (this._findScopeDecorationIds.forEach((e) => n.removeDecoration(e)),
          (this._findScopeDecorationIds = [])),
        t?.length &&
          (this._findScopeDecorationIds = t.map((e) =>
            n.addDecoration(e, P_e._FIND_SCOPE_DECORATION),
          )));
    });
  }
  matchBeforePosition(e) {
    if (0 === this._decorations.length) return null;
    for (let t = this._decorations.length - 1; t >= 0; t--) {
      const n = this._decorations[t],
        i = this._editor.getModel().getDecorationRange(n);
      if (i && !(i.endLineNumber > e.lineNumber)) {
        if (i.endLineNumber < e.lineNumber) return i;
        if (!(i.endColumn > e.column)) return i;
      }
    }
    return this._editor
      .getModel()
      .getDecorationRange(this._decorations[this._decorations.length - 1]);
  }
  matchAfterPosition(e) {
    if (0 === this._decorations.length) return null;
    for (let t = 0, n = this._decorations.length; t < n; t++) {
      const n = this._decorations[t],
        i = this._editor.getModel().getDecorationRange(n);
      if (i && !(i.startLineNumber < e.lineNumber)) {
        if (i.startLineNumber > e.lineNumber) return i;
        if (!(i.startColumn < e.column)) return i;
      }
    }
    return this._editor.getModel().getDecorationRange(this._decorations[0]);
  }
  _allDecorations() {
    let e = [];
    return (
      (e = e.concat(this._decorations)),
      (e = e.concat(this._overviewRulerApproximateDecorations)),
      this._findScopeDecorationIds.length && e.push(...this._findScopeDecorationIds),
      this._rangeHighlightDecorationId && e.push(this._rangeHighlightDecorationId),
      e
    );
  }
  static {
    this._CURRENT_FIND_MATCH_DECORATION = cee.register({
      description: "current-find-match",
      stickiness: 1,
      zIndex: 13,
      className: "currentFindMatch",
      inlineClassName: "currentFindMatchInline",
      showIfCollapsed: !0,
      overviewRuler: { color: g0(GZ), position: Uz.Center },
      minimap: { color: g0(JZ), position: 1 },
    });
  }
  static {
    this._FIND_MATCH_DECORATION = cee.register({
      description: "find-match",
      stickiness: 1,
      zIndex: 10,
      className: "findMatch",
      inlineClassName: "findMatchInline",
      showIfCollapsed: !0,
      overviewRuler: { color: g0(GZ), position: Uz.Center },
      minimap: { color: g0(JZ), position: 1 },
    });
  }
  static {
    this._FIND_MATCH_NO_OVERVIEW_DECORATION = cee.register({
      description: "find-match-no-overview",
      stickiness: 1,
      className: "findMatch",
      showIfCollapsed: !0,
    });
  }
  static {
    this._FIND_MATCH_ONLY_OVERVIEW_DECORATION = cee.register({
      description: "find-match-only-overview",
      stickiness: 1,
      overviewRuler: { color: g0(GZ), position: Uz.Center },
    });
  }
  static {
    this._RANGE_HIGHLIGHT_DECORATION = cee.register({
      description: "find-range-highlight",
      stickiness: 1,
      className: "rangeHighlight",
      isWholeLine: !0,
    });
  }
  static {
    this._FIND_SCOPE_DECORATION = cee.register({
      description: "find-scope",
      className: "findScope",
      isWholeLine: !0,
    });
  }
}
class j_e {
  constructor(e, t, n) {
    ((this._editorSelection = e),
      (this._ranges = t),
      (this._replaceStrings = n),
      (this._trackedEditorSelectionId = null));
  }
  getEditOperations(e, t) {
    if (this._ranges.length > 0) {
      const e = [];
      for (let t = 0; t < this._ranges.length; t++)
        e.push({ range: this._ranges[t], text: this._replaceStrings[t] });
      e.sort((e, t) => YH.compareRangesUsingStarts(e.range, t.range));
      const n = [];
      let i = e[0];
      for (let t = 1; t < e.length; t++)
        i.range.endLineNumber === e[t].range.startLineNumber &&
        i.range.endColumn === e[t].range.startColumn
          ? ((i.range = i.range.plusRange(e[t].range)), (i.text = i.text + e[t].text))
          : (n.push(i), (i = e[t]));
      n.push(i);
      for (const r of n) t.addEditOperation(r.range, r.text);
    }
    this._trackedEditorSelectionId = t.trackSelection(this._editorSelection);
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._trackedEditorSelectionId);
  }
}
function F_e(e, t) {
  if (e && "" !== e[0]) {
    const n = B_e(e, t, "-"),
      i = B_e(e, t, "_");
    return n && !i
      ? V_e(e, t, "-")
      : !n && i
        ? V_e(e, t, "_")
        : e[0].toUpperCase() === e[0]
          ? t.toUpperCase()
          : e[0].toLowerCase() === e[0]
            ? t.toLowerCase()
            : (function (e, t = !1) {
                  return !!e && (t && (e = e.replace(/\\./g, "")), e.toLowerCase() !== e);
                })(e[0][0]) && t.length > 0
              ? t[0].toUpperCase() + t.substr(1)
              : e[0][0].toUpperCase() !== e[0][0] && t.length > 0
                ? t[0].toLowerCase() + t.substr(1)
                : t;
  }
  return t;
}
function B_e(e, t, n) {
  return (
    -1 !== e[0].indexOf(n) && -1 !== t.indexOf(n) && e[0].split(n).length === t.split(n).length
  );
}
function V_e(e, t, n) {
  const i = t.split(n),
    r = e[0].split(n);
  let o = "";
  return (
    i.forEach((e, t) => {
      o += F_e([r[t]], e) + n;
    }),
    o.slice(0, -1)
  );
}
class W_e {
  constructor(e) {
    ((this.staticValue = e), (this.kind = 0));
  }
}
class H_e {
  constructor(e) {
    ((this.pieces = e), (this.kind = 1));
  }
}
class z_e {
  static fromStaticValue(e) {
    return new z_e([U_e.staticValue(e)]);
  }
  get hasReplacementPatterns() {
    return 1 === this._state.kind;
  }
  constructor(e) {
    e && 0 !== e.length
      ? 1 === e.length && null !== e[0].staticValue
        ? (this._state = new W_e(e[0].staticValue))
        : (this._state = new H_e(e))
      : (this._state = new W_e(""));
  }
  buildReplaceString(e, t) {
    if (0 === this._state.kind)
      return t ? F_e(e, this._state.staticValue) : this._state.staticValue;
    let n = "";
    for (let i = 0, r = this._state.pieces.length; i < r; i++) {
      const t = this._state.pieces[i];
      if (null !== t.staticValue) {
        n += t.staticValue;
        continue;
      }
      let r = z_e._substitute(t.matchIndex, e);
      if (null !== t.caseOps && t.caseOps.length > 0) {
        const e = [],
          n = t.caseOps.length;
        let i = 0;
        for (let o = 0, s = r.length; o < s; o++) {
          if (i >= n) {
            e.push(r.slice(o));
            break;
          }
          switch (t.caseOps[i]) {
            case "U":
              e.push(r[o].toUpperCase());
              break;
            case "u":
              (e.push(r[o].toUpperCase()), i++);
              break;
            case "L":
              e.push(r[o].toLowerCase());
              break;
            case "l":
              (e.push(r[o].toLowerCase()), i++);
              break;
            default:
              e.push(r[o]);
          }
        }
        r = e.join("");
      }
      n += r;
    }
    return n;
  }
  static _substitute(e, t) {
    if (null === t) return "";
    if (0 === e) return t[0];
    let n = "";
    for (; e > 0; ) {
      if (e < t.length) {
        return (t[e] || "") + n;
      }
      ((n = String(e % 10) + n), (e = Math.floor(e / 10)));
    }
    return "$" + n;
  }
}
class U_e {
  static staticValue(e) {
    return new U_e(e, -1, null);
  }
  static caseOps(e, t) {
    return new U_e(null, e, t);
  }
  constructor(e, t, n) {
    ((this.staticValue = e),
      (this.matchIndex = t),
      n && 0 !== n.length ? (this.caseOps = n.slice(0)) : (this.caseOps = null));
  }
}
class $_e {
  constructor(e) {
    ((this._source = e),
      (this._lastCharIndex = 0),
      (this._result = []),
      (this._resultLen = 0),
      (this._currentStaticPiece = ""));
  }
  emitUnchanged(e) {
    (this._emitStatic(this._source.substring(this._lastCharIndex, e)), (this._lastCharIndex = e));
  }
  emitStatic(e, t) {
    (this._emitStatic(e), (this._lastCharIndex = t));
  }
  _emitStatic(e) {
    0 !== e.length && (this._currentStaticPiece += e);
  }
  emitMatchIndex(e, t, n) {
    (0 !== this._currentStaticPiece.length &&
      ((this._result[this._resultLen++] = U_e.staticValue(this._currentStaticPiece)),
      (this._currentStaticPiece = "")),
      (this._result[this._resultLen++] = U_e.caseOps(e, n)),
      (this._lastCharIndex = t));
  }
  finalize() {
    return (
      this.emitUnchanged(this._source.length),
      0 !== this._currentStaticPiece.length &&
        ((this._result[this._resultLen++] = U_e.staticValue(this._currentStaticPiece)),
        (this._currentStaticPiece = "")),
      new z_e(this._result)
    );
  }
}
const q_e = new yW("findWidgetVisible", !1);
q_e.toNegated();
const K_e = new yW("findInputFocussed", !1),
  G_e = new yW("replaceInputFocussed", !1),
  Z_e = { primary: 545, mac: { primary: 2593 } },
  Y_e = { primary: 565, mac: { primary: 2613 } },
  X_e = { primary: 560, mac: { primary: 2608 } },
  Q_e = { primary: 554, mac: { primary: 2602 } },
  J_e = { primary: 558, mac: { primary: 2606 } },
  eve = "actions.find",
  tve = "actions.findWithSelection",
  nve = "editor.actions.findWithArgs",
  ive = "editor.action.nextMatchFindAction",
  rve = "editor.action.previousMatchFindAction",
  ove = "editor.action.goToMatchFindAction",
  sve = "editor.action.nextSelectionMatchFindAction",
  ave = "editor.action.previousSelectionMatchFindAction",
  lve = "editor.action.startFindReplaceAction",
  cve = "closeFindWidget",
  dve = "toggleFindCaseSensitive",
  uve = "toggleFindWholeWord",
  hve = "toggleFindRegex",
  gve = "toggleFindInSelection",
  pve = "togglePreserveCase",
  fve = "editor.action.replaceOne",
  mve = "editor.action.replaceAll",
  _ve = "editor.action.selectAllMatches",
  vve = 19999;
class bve {
  constructor(e, t) {
    ((this._toDispose = new AO()),
      (this._editor = e),
      (this._state = t),
      (this._isDisposed = !1),
      (this._startSearchingTimer = new SM()),
      (this._decorations = new P_e(e)),
      this._toDispose.add(this._decorations),
      (this._updateDecorationsScheduler = new EM(() => {
        if (this._editor.hasModel()) return this.research(!1);
      }, 100)),
      this._toDispose.add(this._updateDecorationsScheduler),
      this._toDispose.add(
        this._editor.onDidChangeCursorPosition((e) => {
          (3 !== e.reason && 5 !== e.reason && 6 !== e.reason) ||
            this._decorations.setStartPosition(this._editor.getPosition());
        }),
      ),
      (this._ignoreModelContentChanged = !1),
      this._toDispose.add(
        this._editor.onDidChangeModelContent((e) => {
          this._ignoreModelContentChanged ||
            (e.isFlush && this._decorations.reset(),
            this._decorations.setStartPosition(this._editor.getPosition()),
            this._updateDecorationsScheduler.schedule());
        }),
      ),
      this._toDispose.add(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e))),
      this.research(!1, this._state.searchScope));
  }
  dispose() {
    ((this._isDisposed = !0), IO(this._startSearchingTimer), this._toDispose.dispose());
  }
  _onStateChanged(e) {
    if (
      !this._isDisposed &&
      this._editor.hasModel() &&
      (e.searchString ||
        e.isReplaceRevealed ||
        e.isRegex ||
        e.wholeWord ||
        e.matchCase ||
        e.searchScope)
    ) {
      this._editor.getModel().isTooLargeForSyncing()
        ? (this._startSearchingTimer.cancel(),
          this._startSearchingTimer.setIfNotSet(() => {
            e.searchScope
              ? this.research(e.moveCursor, this._state.searchScope)
              : this.research(e.moveCursor);
          }, 240))
        : e.searchScope
          ? this.research(e.moveCursor, this._state.searchScope)
          : this.research(e.moveCursor);
    }
  }
  static _getSearchRange(e, t) {
    return t || e.getFullModelRange();
  }
  research(e, t) {
    let n = null;
    (void 0 !== t
      ? null !== t && (n = Array.isArray(t) ? t : [t])
      : (n = this._decorations.getFindScopes()),
      null !== n &&
        (n = n.map((e) => {
          if (e.startLineNumber !== e.endLineNumber) {
            let t = e.endLineNumber;
            return (
              1 === e.endColumn && (t -= 1),
              new YH(e.startLineNumber, 1, t, this._editor.getModel().getLineMaxColumn(t))
            );
          }
          return e;
        })));
    const i = this._findMatches(n, !1, vve);
    this._decorations.set(i, n);
    const r = this._editor.getSelection();
    let o = this._decorations.getCurrentMatchesPosition(r);
    if (0 === o && i.length > 0) {
      const e = A1(
        i.map((e) => e.range),
        (e) => YH.compareRangesUsingStarts(e, r) >= 0,
      );
      o = e > 0 ? e - 1 + 1 : o;
    }
    (this._state.changeMatchInfo(o, this._decorations.getCount(), void 0),
      e &&
        this._editor.getOption(50).cursorMoveOnType &&
        this._moveToNextMatch(this._decorations.getStartPosition()));
  }
  _hasMatches() {
    return this._state.matchesCount > 0;
  }
  _cannotFind() {
    if (!this._hasMatches()) {
      const e = this._decorations.getFindScope();
      return (e && this._editor.revealRangeInCenterIfOutsideViewport(e, 0), !0);
    }
    return !1;
  }
  _setCurrentFindMatch(e) {
    const t = this._decorations.setCurrentFindMatch(e);
    (this._state.changeMatchInfo(t, this._decorations.getCount(), e),
      this._editor.setSelection(e),
      this._editor.revealRangeInCenterIfOutsideViewport(e, 0));
  }
  _prevSearchPosition(e) {
    const t =
      this._state.isRegex &&
      (this._state.searchString.indexOf("^") >= 0 || this._state.searchString.indexOf("$") >= 0);
    let { lineNumber: n, column: i } = e;
    const r = this._editor.getModel();
    return (
      t || 1 === i ? (1 === n ? (n = r.getLineCount()) : n--, (i = r.getLineMaxColumn(n))) : i--,
      new xV(n, i)
    );
  }
  _moveToPrevMatch(e, t = !1) {
    if (!this._state.canNavigateBack()) {
      const t = this._decorations.matchAfterPosition(e);
      return void (t && this._setCurrentFindMatch(t));
    }
    if (this._decorations.getCount() < vve) {
      let t = this._decorations.matchBeforePosition(e);
      return (
        t &&
          t.isEmpty() &&
          t.getStartPosition().equals(e) &&
          ((e = this._prevSearchPosition(e)), (t = this._decorations.matchBeforePosition(e))),
        void (t && this._setCurrentFindMatch(t))
      );
    }
    if (this._cannotFind()) return;
    const n = this._decorations.getFindScope(),
      i = bve._getSearchRange(this._editor.getModel(), n);
    (i.getEndPosition().isBefore(e) && (e = i.getEndPosition()),
      e.isBefore(i.getStartPosition()) && (e = i.getEndPosition()));
    const { lineNumber: r, column: o } = e,
      s = this._editor.getModel();
    let a = new xV(r, o),
      l = s.findPreviousMatch(
        this._state.searchString,
        a,
        this._state.isRegex,
        this._state.matchCase,
        this._state.wholeWord ? this._editor.getOption(148) : null,
        !1,
      );
    return (
      l &&
        l.range.isEmpty() &&
        l.range.getStartPosition().equals(a) &&
        ((a = this._prevSearchPosition(a)),
        (l = s.findPreviousMatch(
          this._state.searchString,
          a,
          this._state.isRegex,
          this._state.matchCase,
          this._state.wholeWord ? this._editor.getOption(148) : null,
          !1,
        ))),
      l
        ? t || i.containsRange(l.range)
          ? void this._setCurrentFindMatch(l.range)
          : this._moveToPrevMatch(l.range.getStartPosition(), !0)
        : void 0
    );
  }
  moveToPrevMatch() {
    this._moveToPrevMatch(this._editor.getSelection().getStartPosition());
  }
  _nextSearchPosition(e) {
    const t =
      this._state.isRegex &&
      (this._state.searchString.indexOf("^") >= 0 || this._state.searchString.indexOf("$") >= 0);
    let { lineNumber: n, column: i } = e;
    const r = this._editor.getModel();
    return (
      t || i === r.getLineMaxColumn(n) ? (n === r.getLineCount() ? (n = 1) : n++, (i = 1)) : i++,
      new xV(n, i)
    );
  }
  _moveToNextMatch(e) {
    if (!this._state.canNavigateForward()) {
      const t = this._decorations.matchBeforePosition(e);
      return void (t && this._setCurrentFindMatch(t));
    }
    if (this._decorations.getCount() < vve) {
      let t = this._decorations.matchAfterPosition(e);
      return (
        t &&
          t.isEmpty() &&
          t.getStartPosition().equals(e) &&
          ((e = this._nextSearchPosition(e)), (t = this._decorations.matchAfterPosition(e))),
        void (t && this._setCurrentFindMatch(t))
      );
    }
    const t = this._getNextMatch(e, !1, !0);
    t && this._setCurrentFindMatch(t.range);
  }
  _getNextMatch(e, t, n, i = !1) {
    if (this._cannotFind()) return null;
    const r = this._decorations.getFindScope(),
      o = bve._getSearchRange(this._editor.getModel(), r);
    (o.getEndPosition().isBefore(e) && (e = o.getStartPosition()),
      e.isBefore(o.getStartPosition()) && (e = o.getStartPosition()));
    const { lineNumber: s, column: a } = e,
      l = this._editor.getModel();
    let c = new xV(s, a),
      d = l.findNextMatch(
        this._state.searchString,
        c,
        this._state.isRegex,
        this._state.matchCase,
        this._state.wholeWord ? this._editor.getOption(148) : null,
        t,
      );
    return (
      n &&
        d &&
        d.range.isEmpty() &&
        d.range.getStartPosition().equals(c) &&
        ((c = this._nextSearchPosition(c)),
        (d = l.findNextMatch(
          this._state.searchString,
          c,
          this._state.isRegex,
          this._state.matchCase,
          this._state.wholeWord ? this._editor.getOption(148) : null,
          t,
        ))),
      d
        ? i || o.containsRange(d.range)
          ? d
          : this._getNextMatch(d.range.getEndPosition(), t, n, !0)
        : null
    );
  }
  moveToNextMatch() {
    this._moveToNextMatch(this._editor.getSelection().getEndPosition());
  }
  _moveToMatch(e) {
    const t = this._decorations.getDecorationRangeAt(e);
    t && this._setCurrentFindMatch(t);
  }
  moveToMatch(e) {
    this._moveToMatch(e);
  }
  _getReplacePattern() {
    return this._state.isRegex
      ? (function (e) {
          if (!e || 0 === e.length) return new z_e(null);
          const t = [],
            n = new $_e(e);
          for (let i = 0, r = e.length; i < r; i++) {
            const o = e.charCodeAt(i);
            if (92 === o) {
              if ((i++, i >= r)) break;
              const o = e.charCodeAt(i);
              switch (o) {
                case 92:
                  (n.emitUnchanged(i - 1), n.emitStatic("\\", i + 1));
                  break;
                case 110:
                  (n.emitUnchanged(i - 1), n.emitStatic("\n", i + 1));
                  break;
                case 116:
                  (n.emitUnchanged(i - 1), n.emitStatic("\t", i + 1));
                  break;
                case 117:
                case 85:
                case 108:
                case 76:
                  (n.emitUnchanged(i - 1), n.emitStatic("", i + 1), t.push(String.fromCharCode(o)));
              }
              continue;
            }
            if (36 === o) {
              if ((i++, i >= r)) break;
              const o = e.charCodeAt(i);
              if (36 === o) {
                (n.emitUnchanged(i - 1), n.emitStatic("$", i + 1));
                continue;
              }
              if (48 === o || 38 === o) {
                (n.emitUnchanged(i - 1), n.emitMatchIndex(0, i + 1, t), (t.length = 0));
                continue;
              }
              if (49 <= o && o <= 57) {
                let s = o - 48;
                if (i + 1 < r) {
                  const r = e.charCodeAt(i + 1);
                  if (48 <= r && r <= 57) {
                    (i++,
                      (s = 10 * s + (r - 48)),
                      n.emitUnchanged(i - 2),
                      n.emitMatchIndex(s, i + 1, t),
                      (t.length = 0));
                    continue;
                  }
                }
                (n.emitUnchanged(i - 1), n.emitMatchIndex(s, i + 1, t), (t.length = 0));
                continue;
              }
            }
          }
          return n.finalize();
        })(this._state.replaceString)
      : z_e.fromStaticValue(this._state.replaceString);
  }
  replace() {
    if (!this._hasMatches()) return;
    const e = this._getReplacePattern(),
      t = this._editor.getSelection(),
      n = this._getNextMatch(t.getStartPosition(), !0, !1);
    if (n)
      if (t.equalsRange(n.range)) {
        const i = e.buildReplaceString(n.matches, this._state.preserveCase),
          r = new fz(t, i);
        (this._executeEditorCommand("replace", r),
          this._decorations.setStartPosition(new xV(t.startLineNumber, t.startColumn + i.length)),
          this.research(!0));
      } else
        (this._decorations.setStartPosition(this._editor.getPosition()),
          this._setCurrentFindMatch(n.range));
  }
  _findMatches(e, t, n) {
    const i = (e || [null]).map((e) => bve._getSearchRange(this._editor.getModel(), e));
    return this._editor
      .getModel()
      .findMatches(
        this._state.searchString,
        i,
        this._state.isRegex,
        this._state.matchCase,
        this._state.wholeWord ? this._editor.getOption(148) : null,
        t,
        n,
      );
  }
  replaceAll() {
    if (!this._hasMatches()) return;
    const e = this._decorations.getFindScopes();
    (null === e && this._state.matchesCount >= vve
      ? this._largeReplaceAll()
      : this._regularReplaceAll(e),
      this.research(!1));
  }
  _largeReplaceAll() {
    const e = new m9(
      this._state.searchString,
      this._state.isRegex,
      this._state.matchCase,
      this._state.wholeWord ? this._editor.getOption(148) : null,
    ).parseSearchRequest();
    if (!e) return;
    let t = e.regex;
    if (!t.multiline) {
      let e = "mu";
      (t.ignoreCase && (e += "i"), t.global && (e += "g"), (t = new RegExp(t.source, e)));
    }
    const n = this._editor.getModel(),
      i = n.getValue(1),
      r = n.getFullModelRange(),
      o = this._getReplacePattern();
    let s;
    const a = this._state.preserveCase;
    s =
      o.hasReplacementPatterns || a
        ? i.replace(t, function () {
            return o.buildReplaceString(arguments, a);
          })
        : i.replace(t, o.buildReplaceString(null, a));
    const l = new xz(r, s, this._editor.getSelection());
    this._executeEditorCommand("replaceAll", l);
  }
  _regularReplaceAll(e) {
    const t = this._getReplacePattern(),
      n = this._findMatches(e, t.hasReplacementPatterns || this._state.preserveCase, 1073741824),
      i = [];
    for (let o = 0, s = n.length; o < s; o++)
      i[o] = t.buildReplaceString(n[o].matches, this._state.preserveCase);
    const r = new j_e(
      this._editor.getSelection(),
      n.map((e) => e.range),
      i,
    );
    this._executeEditorCommand("replaceAll", r);
  }
  selectAllMatches() {
    if (!this._hasMatches()) return;
    const e = this._decorations.getFindScopes();
    let t = this._findMatches(e, !1, 1073741824).map(
      (e) =>
        new XH(
          e.range.startLineNumber,
          e.range.startColumn,
          e.range.endLineNumber,
          e.range.endColumn,
        ),
    );
    const n = this._editor.getSelection();
    for (let i = 0, r = t.length; i < r; i++) {
      if (t[i].equalsRange(n)) {
        t = [n].concat(t.slice(0, i)).concat(t.slice(i + 1));
        break;
      }
    }
    this._editor.setSelections(t);
  }
  _executeEditorCommand(e, t) {
    try {
      ((this._ignoreModelContentChanged = !0),
        this._editor.pushUndoStop(),
        this._editor.executeCommand(e, t),
        this._editor.pushUndoStop());
    } finally {
      this._ignoreModelContentChanged = !1;
    }
  }
}
const yve = SI(2, "Match Case"),
  xve = SI(3, "Match Whole Word"),
  wve = SI(4, "Use Regular Expression");
class Cve extends R_e {
  constructor(e) {
    super({
      icon: OV.caseSensitive,
      title: yve + e.appendTitle,
      isChecked: e.isChecked,
      hoverLifecycleOptions: e.hoverLifecycleOptions,
      inputActiveOptionBorder: e.inputActiveOptionBorder,
      inputActiveOptionForeground: e.inputActiveOptionForeground,
      inputActiveOptionBackground: e.inputActiveOptionBackground,
    });
  }
}
class Sve extends R_e {
  constructor(e) {
    super({
      icon: OV.wholeWord,
      title: xve + e.appendTitle,
      isChecked: e.isChecked,
      hoverLifecycleOptions: e.hoverLifecycleOptions,
      inputActiveOptionBorder: e.inputActiveOptionBorder,
      inputActiveOptionForeground: e.inputActiveOptionForeground,
      inputActiveOptionBackground: e.inputActiveOptionBackground,
    });
  }
}
class kve extends R_e {
  constructor(e) {
    super({
      icon: OV.regex,
      title: wve + e.appendTitle,
      isChecked: e.isChecked,
      hoverLifecycleOptions: e.hoverLifecycleOptions,
      inputActiveOptionBorder: e.inputActiveOptionBorder,
      inputActiveOptionForeground: e.inputActiveOptionForeground,
      inputActiveOptionBackground: e.inputActiveOptionBackground,
    });
  }
}
function Eve(e, t, n) {
  const i = n ?? document.createElement("div");
  return (
    (i.textContent = ""),
    Lve(
      i,
      (function (e) {
        const t = { type: 1, children: [] };
        let n = 0,
          i = t;
        const r = [],
          o = new Nve(e);
        for (; !o.eos(); ) {
          let e = o.next();
          const t = "\\" === e && 0 !== Tve(o.peek());
          if ((t && (e = o.next()), !t && Dve(e) && e === o.peek())) {
            (o.advance(), 2 === i.type && (i = r.pop()));
            const t = Tve(e);
            if (i.type === t || (5 === i.type && 6 === t)) i = r.pop();
            else {
              const e = { type: t, children: [] };
              (5 === t && ((e.index = n), n++), i.children.push(e), r.push(i), (i = e));
            }
          } else if ("\n" === e) (2 === i.type && (i = r.pop()), i.children.push({ type: 8 }));
          else if (2 !== i.type) {
            const t = { type: 2, content: e };
            (i.children.push(t), r.push(i), (i = t));
          } else i.content += e;
        }
        2 === i.type && (i = r.pop());
        return t;
      })(e),
      t?.actionHandler,
      t?.renderCodeSegments,
    ),
    i
  );
}
class Nve {
  constructor(e) {
    ((this.source = e), (this.index = 0));
  }
  eos() {
    return this.index >= this.source.length;
  }
  next() {
    const e = this.peek();
    return (this.advance(), e);
  }
  peek() {
    return this.source[this.index];
  }
  advance() {
    this.index++;
  }
}
function Lve(e, t, n, i) {
  let r;
  if (2 === t.type) r = document.createTextNode(t.content || "");
  else if (3 === t.type) r = document.createElement("b");
  else if (4 === t.type) r = document.createElement("i");
  else if (7 === t.type && i) r = document.createElement("code");
  else if (5 === t.type && n) {
    const e = document.createElement("a");
    (n.disposables.add(
      KF(e, "click", (e) => {
        n.callback(String(t.index), e);
      }),
    ),
      (r = e));
  } else 8 === t.type ? (r = document.createElement("br")) : 1 === t.type && (r = e);
  (r && e !== r && e.appendChild(r),
    r &&
      Array.isArray(t.children) &&
      t.children.forEach((e) => {
        Lve(r, e, n, i);
      }));
}
function Dve(e, t) {
  return 0 !== Tve(e);
}
function Tve(e, t) {
  switch (e) {
    case "*":
      return 3;
    case "_":
      return 4;
    case "[":
      return 5;
    case "]":
      return 6;
    default:
      return 0;
  }
}
class Ive {
  constructor(e, t = 0, n = e.length, i = t - 1) {
    ((this.items = e), (this.start = t), (this.end = n), (this.index = i));
  }
  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());
  }
}
class Rve {
  constructor(e = new Set(), t = 10) {
    ((this._history = e),
      (this._limit = t),
      this._onChange(),
      this._history.onDidChange &&
        (this._disposable = this._history.onDidChange(() => this._onChange())));
  }
  getHistory() {
    return this._elements;
  }
  add(e) {
    (this._history.delete(e), this._history.add(e), this._onChange());
  }
  next() {
    return this._navigator.next();
  }
  previous() {
    return 0 !== this._currentPosition() ? this._navigator.previous() : null;
  }
  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 null === this._navigator.current();
  }
  has(e) {
    return this._history.has(e);
  }
  _onChange() {
    this._reduceToLimit();
    const e = this._elements;
    this._navigator = new Ive(e, 0, e.length, e.length);
  }
  _reduceToLimit() {
    const e = this._elements;
    if (e.length > this._limit) {
      const t = e.slice(e.length - this._limit);
      this._history.replace ? this._history.replace(t) : (this._history = new Set(t));
    }
  }
  _currentPosition() {
    const e = this._navigator.current();
    return e ? this._elements.indexOf(e) : -1;
  }
  get _elements() {
    const e = [];
    return (this._history.forEach((t) => e.push(t)), e);
  }
  dispose() {
    this._disposable && (this._disposable.dispose(), (this._disposable = void 0));
  }
}
const Ove = VB;
let Mve = class extends rJ {
  get onDidChange() {
    return this._onDidChange.event;
  }
  get onDidHeightChange() {
    return this._onDidHeightChange.event;
  }
  constructor(e, t, n) {
    (super(),
      (this.state = "idle"),
      (this.maxHeight = Number.POSITIVE_INFINITY),
      (this.hover = this._register(new jO())),
      (this._onDidChange = this._register(new QO())),
      (this._onDidHeightChange = this._register(new QO())),
      (this.contextViewProvider = t),
      (this.options = n),
      (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 = MB(e, Ove(".monaco-inputbox.idle"))));
    const i = this.options.flexibleHeight ? "textarea" : "input",
      r = MB(this.element, Ove(".ibwrapper"));
    if (
      ((this.input = MB(r, Ove(i + ".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 =
        "number" == typeof this.options.flexibleMaxHeight
          ? this.options.flexibleMaxHeight
          : Number.POSITIVE_INFINITY),
        (this.mirror = MB(r, Ove("div.mirror"))),
        (this.mirror.innerText = " "),
        (this.scrollableElement = new yJ(this.element, { vertical: 1 })),
        this.options.flexibleWidth &&
          (this.input.setAttribute("wrap", "off"),
          (this.mirror.style.whiteSpace = "pre"),
          (this.mirror.style.wordWrap = "initial")),
        MB(e, this.scrollableElement.getDomNode()),
        this._register(this.scrollableElement),
        this._register(
          this.scrollableElement.onScroll((e) => (this.input.scrollTop = e.scrollTop)),
        ));
      const t = this._register(new RJ(e.ownerDocument, "selectionchange")),
        n = $O.filter(t.event, () => {
          const t = e.ownerDocument.getSelection();
          return t?.anchorNode === r;
        });
      (this._register(n(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 Cle(this.element))),
        this.actionbar.push(this.options.actions, { icon: !0, label: !1 })),
      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(e) {
    ((this.placeholder = e), this.input.setAttribute("placeholder", e));
  }
  setTooltip(e) {
    ((this.tooltip = e),
      this.hover.value ||
        (this.hover.value = this._register(
          yae().setupDelayedHoverAtMouse(this.input, () => ({
            content: this.tooltip,
            appearance: { compact: !0 },
          })),
        )));
  }
  get inputElement() {
    return this.input;
  }
  get value() {
    return this.input.value;
  }
  set value(e) {
    this.input.value !== e && ((this.input.value = e), this.onValueChange());
  }
  get height() {
    return "number" == typeof this.cachedHeight ? this.cachedHeight : hB(this.element);
  }
  focus() {
    this.input.focus();
  }
  blur() {
    this.input.blur();
  }
  hasFocus() {
    return bB(this.input);
  }
  select(e = null) {
    (this.input.select(),
      e &&
        (this.input.setSelectionRange(e.start, e.end),
        e.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() {
    const e = this.input.selectionStart;
    if (null === e) return null;
    return { start: e, end: this.input.selectionEnd ?? e };
  }
  enable() {
    this.input.removeAttribute("disabled");
  }
  disable() {
    (this.blur(), (this.input.disabled = !0), this._hideMessage());
  }
  set paddingRight(e) {
    ((this.input.style.width = `calc(100% - ${e}px)`),
      this.mirror && (this.mirror.style.paddingRight = e + "px"));
  }
  updateScrollDimensions() {
    if (
      "number" != typeof this.cachedContentHeight ||
      "number" != typeof this.cachedHeight ||
      !this.scrollableElement
    )
      return;
    const e = this.cachedContentHeight,
      t = this.cachedHeight,
      n = this.input.scrollTop;
    (this.scrollableElement.setScrollDimensions({ scrollHeight: e, height: t }),
      this.scrollableElement.setScrollPosition({ scrollTop: n }));
  }
  showMessage(e, t) {
    if ("open" === this.state && zz(this.message, e)) return;
    ((this.message = e),
      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(e.type)));
    const n = this.stylesForType(this.message.type);
    ((this.element.style.border = `1px solid ${Wne(n.border, "transparent")}`),
      this.message.content && (this.hasFocus() || t) && 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 e = null;
    return (
      this.validation &&
        ((e = this.validation(this.value)),
        e
          ? (this.inputElement.setAttribute("aria-invalid", "true"), this.showMessage(e))
          : this.inputElement.hasAttribute("aria-invalid") &&
            (this.inputElement.removeAttribute("aria-invalid"), this.hideMessage())),
      e?.type
    );
  }
  stylesForType(e) {
    const t = this.options.inputBoxStyles;
    switch (e) {
      case 1:
        return {
          border: t.inputValidationInfoBorder,
          background: t.inputValidationInfoBackground,
          foreground: t.inputValidationInfoForeground,
        };
      case 2:
        return {
          border: t.inputValidationWarningBorder,
          background: t.inputValidationWarningBackground,
          foreground: t.inputValidationWarningForeground,
        };
      default:
        return {
          border: t.inputValidationErrorBorder,
          background: t.inputValidationErrorBackground,
          foreground: t.inputValidationErrorForeground,
        };
    }
  }
  classForType(e) {
    switch (e) {
      case 1:
        return "info";
      case 2:
        return "warning";
      default:
        return "error";
    }
  }
  _showMessage() {
    if (!this.contextViewProvider || !this.message) return;
    let e;
    const t = () => (e.style.width = cB(this.element) + "px");
    let n;
    (this.contextViewProvider.showContextView({
      getAnchor: () => this.element,
      anchorAlignment: 1,
      render: (n) => {
        if (!this.message) return null;
        ((e = MB(n, Ove(".monaco-inputbox-container"))), t());
        const i = Ove("span.monaco-inputbox-message");
        (this.message.formatContent
          ? Eve(this.message.content, void 0, i)
          : (function (e, t, n) {
              const i = n ?? document.createElement("div");
              i.textContent = e;
            })(this.message.content, 0, i),
          i.classList.add(this.classForType(this.message.type)));
        const r = this.stylesForType(this.message.type);
        return (
          (i.style.backgroundColor = r.background ?? ""),
          (i.style.color = r.foreground ?? ""),
          (i.style.border = r.border ? `1px solid ${r.border}` : ""),
          MB(e, i),
          null
        );
      },
      onHide: () => {
        this.state = "closed";
      },
      layout: t,
    }),
      (n =
        3 === this.message.type
          ? SI(9, "Error: {0}", this.message.content)
          : 2 === this.message.type
            ? SI(10, "Warning: {0}", this.message.content)
            : SI(11, "Info: {0}", this.message.content)),
      pV(n),
      (this.state = "open"));
  }
  _hideMessage() {
    this.contextViewProvider &&
      ("open" === this.state && this.contextViewProvider.hideContextView(), (this.state = "idle"));
  }
  onValueChange() {
    (this._onDidChange.fire(this.value),
      this.validate(),
      this.updateMirror(),
      this.input.classList.toggle("empty", !this.value),
      "open" === this.state && this.contextViewProvider && this.contextViewProvider.layout());
  }
  updateMirror() {
    if (!this.mirror) return;
    const e = this.value,
      t = 10 === e.charCodeAt(e.length - 1) ? " " : "";
    ((e + t).replace(/\u000c/g, "")
      ? (this.mirror.textContent = e + t)
      : (this.mirror.innerText = " "),
      this.layout());
  }
  applyStyles() {
    const e = this.options.inputBoxStyles,
      t = e.inputBackground ?? "",
      n = e.inputForeground ?? "",
      i = e.inputBorder ?? "";
    ((this.element.style.backgroundColor = t),
      (this.element.style.color = n),
      (this.input.style.backgroundColor = "inherit"),
      (this.input.style.color = n),
      (this.element.style.border = `1px solid ${Wne(i, "transparent")}`));
  }
  layout() {
    if (!this.mirror) return;
    const e = this.cachedContentHeight;
    ((this.cachedContentHeight = hB(this.mirror)),
      e !== this.cachedContentHeight &&
        ((this.cachedHeight = Math.min(this.cachedContentHeight, this.maxHeight)),
        (this.input.style.height = this.cachedHeight + "px"),
        this._onDidHeightChange.fire(this.cachedContentHeight)));
  }
  insertAtCursor(e) {
    const t = this.inputElement,
      n = t.selectionStart,
      i = t.selectionEnd,
      r = t.value;
    null !== n &&
      null !== i &&
      ((this.value = r.substr(0, n) + e + r.substr(i)),
      t.setSelectionRange(n + 1, n + 1),
      this.layout());
  }
  dispose() {
    (this._hideMessage(), (this.message = null), this.actionbar?.dispose(), super.dispose());
  }
};
class Ave extends Mve {
  constructor(e, t, n) {
    const i = SI(12, " or {0} for history", "⇅"),
      r = SI(13, " ({0} for history)", "⇅");
    (super(e, t, n),
      (this._onDidFocus = this._register(new QO())),
      (this.onDidFocus = this._onDidFocus.event),
      (this._onDidBlur = this._register(new QO())),
      (this.onDidBlur = this._onDidBlur.event),
      (this.history = this._register(new Rve(n.history, 100))));
    const o = () => {
      if (
        n.showHistoryHint &&
        n.showHistoryHint() &&
        !this.placeholder.endsWith(i) &&
        !this.placeholder.endsWith(r) &&
        this.history.getHistory().length
      ) {
        const e = this.placeholder.endsWith(")") ? i : r,
          t = this.placeholder + e;
        n.showPlaceholderOnFocus && !bB(this.input)
          ? (this.placeholder = t)
          : this.setPlaceHolder(t);
      }
    };
    ((this.observer = new MutationObserver((e, t) => {
      e.forEach((e) => {
        e.target.textContent || o();
      });
    })),
      this.observer.observe(this.input, { attributeFilter: ["class"] }),
      this.onfocus(this.input, () => o()),
      this.onblur(this.input, () => {
        const e = (e) => {
          if (this.placeholder.endsWith(e)) {
            const t = this.placeholder.slice(0, this.placeholder.length - e.length);
            return (n.showPlaceholderOnFocus ? (this.placeholder = t) : this.setPlaceHolder(t), !0);
          }
          return !1;
        };
        e(r) || e(i);
      }));
  }
  dispose() {
    (super.dispose(), this.observer && (this.observer.disconnect(), (this.observer = void 0)));
  }
  addToHistory(e) {
    this.value && (e || 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 e = this.getNextValue();
    (e && (e = e === this.value ? this.getNextValue() : e),
      (this.value = e ?? ""),
      fV(this.value ? this.value : SI(14, "Cleared Input")));
  }
  showPreviousValue() {
    this.history.has(this.value) || this.addToHistory();
    let e = this.getPreviousValue();
    (e && (e = e === this.value ? this.getPreviousValue() : e),
      e && ((this.value = e), fV(this.value)));
  }
  setPlaceHolder(e) {
    (super.setPlaceHolder(e), this.setTooltip(e));
  }
  onBlur() {
    (super.onBlur(), this._onDidBlur.fire());
  }
  onFocus() {
    (super.onFocus(), this._onDidFocus.fire());
  }
  getCurrentValue() {
    let e = this.history.current();
    return (e || ((e = this.history.last()), this.history.next()), e);
  }
  getPreviousValue() {
    return this.history.previous() || this.history.first();
  }
  getNextValue() {
    return this.history.next();
  }
}
const Pve = SI(1, "input");
class jve extends rJ {
  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(e, t, n) {
    (super(),
      (this.fixFocusOnOptionClickEnabled = !0),
      (this.imeSessionInProgress = !1),
      (this.additionalTogglesDisposables = this._register(new jO())),
      (this.additionalToggles = []),
      (this._onDidOptionChange = this._register(new QO())),
      (this._onKeyDown = this._register(new QO())),
      (this._onMouseDown = this._register(new QO())),
      (this._onInput = this._register(new QO())),
      (this._onKeyUp = this._register(new QO())),
      (this._onCaseSensitiveKeyDown = this._register(new QO())),
      (this._onRegexKeyDown = this._register(new QO())),
      (this._lastHighlightFindOptions = 0),
      (this.placeholder = n.placeholder || ""),
      (this.validation = n.validation),
      (this.label = n.label || Pve),
      (this.showCommonFindToggles = !!n.showCommonFindToggles));
    const i = n.appendCaseSensitiveLabel || "",
      r = n.appendWholeWordsLabel || "",
      o = n.appendRegexLabel || "",
      s = !!n.flexibleHeight,
      a = !!n.flexibleWidth,
      l = n.flexibleMaxHeight;
    if (
      ((this.domNode = document.createElement("div")),
      this.domNode.classList.add("monaco-findInput"),
      (this.inputBox = this._register(
        new Ave(this.domNode, t, {
          placeholder: this.placeholder || "",
          ariaLabel: this.label || "",
          validationOptions: { validation: this.validation },
          showHistoryHint: n.showHistoryHint,
          flexibleHeight: s,
          flexibleWidth: a,
          flexibleMaxHeight: l,
          inputBoxStyles: n.inputBoxStyles,
          history: n.history,
        }),
      )),
      this.showCommonFindToggles)
    ) {
      const e = n?.hoverLifecycleOptions || { groupId: "find-input" };
      ((this.regex = this._register(
        new kve({ appendTitle: o, isChecked: !1, hoverLifecycleOptions: e, ...n.toggleStyles }),
      )),
        this._register(
          this.regex.onChange((e) => {
            (this._onDidOptionChange.fire(e),
              !e && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(),
              this.validate());
          }),
        ),
        this._register(
          this.regex.onKeyDown((e) => {
            this._onRegexKeyDown.fire(e);
          }),
        ),
        (this.wholeWords = this._register(
          new Sve({ appendTitle: r, isChecked: !1, hoverLifecycleOptions: e, ...n.toggleStyles }),
        )),
        this._register(
          this.wholeWords.onChange((e) => {
            (this._onDidOptionChange.fire(e),
              !e && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(),
              this.validate());
          }),
        ),
        (this.caseSensitive = this._register(
          new Cve({ appendTitle: i, isChecked: !1, hoverLifecycleOptions: e, ...n.toggleStyles }),
        )),
        this._register(
          this.caseSensitive.onChange((e) => {
            (this._onDidOptionChange.fire(e),
              !e && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(),
              this.validate());
          }),
        ),
        this._register(
          this.caseSensitive.onKeyDown((e) => {
            this._onCaseSensitiveKeyDown.fire(e);
          }),
        ));
      const t = [this.caseSensitive.domNode, this.wholeWords.domNode, this.regex.domNode];
      this.onkeydown(this.domNode, (e) => {
        if (e.equals(15) || e.equals(17) || e.equals(9)) {
          const n = t.indexOf(this.domNode.ownerDocument.activeElement);
          if (n >= 0) {
            let i = -1;
            (e.equals(17)
              ? (i = (n + 1) % t.length)
              : e.equals(15) && (i = 0 === n ? t.length - 1 : n - 1),
              e.equals(9) ? (t[n].blur(), this.inputBox.focus()) : i >= 0 && t[i].focus(),
              IB(e, !0));
          }
        }
      });
    }
    ((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(n?.additionalToggles),
      this.controls && this.domNode.appendChild(this.controls),
      e?.appendChild(this.domNode),
      this._register(
        $F(this.inputBox.inputElement, "compositionstart", (e) => {
          this.imeSessionInProgress = !0;
        }),
      ),
      this._register(
        $F(this.inputBox.inputElement, "compositionend", (e) => {
          ((this.imeSessionInProgress = !1), this._onInput.fire());
        }),
      ),
      this.onkeydown(this.inputBox.inputElement, (e) => this._onKeyDown.fire(e)),
      this.onkeyup(this.inputBox.inputElement, (e) => this._onKeyUp.fire(e)),
      this.oninput(this.inputBox.inputElement, (e) => this._onInput.fire()),
      this.onmousedown(this.inputBox.inputElement, (e) => this._onMouseDown.fire(e)));
  }
  get onDidChange() {
    return this.inputBox.onDidChange;
  }
  layout(e) {
    (this.inputBox.layout(), this.updateInputBoxPadding(e.collapsedFindWidget));
  }
  enable() {
    (this.domNode.classList.remove("disabled"),
      this.inputBox.enable(),
      this.regex?.enable(),
      this.wholeWords?.enable(),
      this.caseSensitive?.enable());
    for (const e of this.additionalToggles) e.enable();
  }
  disable() {
    (this.domNode.classList.add("disabled"),
      this.inputBox.disable(),
      this.regex?.disable(),
      this.wholeWords?.disable(),
      this.caseSensitive?.disable());
    for (const e of this.additionalToggles) e.disable();
  }
  setFocusInputOnOptionClick(e) {
    this.fixFocusOnOptionClickEnabled = e;
  }
  setEnabled(e) {
    e ? this.enable() : this.disable();
  }
  setAdditionalToggles(e) {
    for (const t of this.additionalToggles) t.domNode.remove();
    ((this.additionalToggles = []), (this.additionalTogglesDisposables.value = new AO()));
    for (const t of e ?? [])
      (this.additionalTogglesDisposables.value.add(t),
        this.controls.appendChild(t.domNode),
        this.additionalTogglesDisposables.value.add(
          t.onChange((e) => {
            (this._onDidOptionChange.fire(e),
              !e && this.fixFocusOnOptionClickEnabled && this.inputBox.focus());
          }),
        ),
        this.additionalToggles.push(t));
    (this.additionalToggles.length > 0 && (this.controls.style.display = ""),
      this.updateInputBoxPadding());
  }
  updateInputBoxPadding(e = !1) {
    this.inputBox.paddingRight = e
      ? 0
      : (this.caseSensitive?.width() ?? 0) +
        (this.wholeWords?.width() ?? 0) +
        (this.regex?.width() ?? 0) +
        this.additionalToggles.reduce((e, t) => e + t.width(), 0);
  }
  getValue() {
    return this.inputBox.value;
  }
  setValue(e) {
    this.inputBox.value !== e && (this.inputBox.value = e);
  }
  select() {
    this.inputBox.select();
  }
  focus() {
    this.inputBox.focus();
  }
  getCaseSensitive() {
    return this.caseSensitive?.checked ?? !1;
  }
  setCaseSensitive(e) {
    this.caseSensitive && (this.caseSensitive.checked = e);
  }
  getWholeWords() {
    return this.wholeWords?.checked ?? !1;
  }
  setWholeWords(e) {
    this.wholeWords && (this.wholeWords.checked = e);
  }
  getRegex() {
    return this.regex?.checked ?? !1;
  }
  setRegex(e) {
    this.regex && ((this.regex.checked = e), 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(e) {
    this.inputBox.showMessage(e);
  }
  clearMessage() {
    this.inputBox.hideMessage();
  }
}
const Fve = SI(5, "input"),
  Bve = SI(6, "Preserve Case");
class Vve extends R_e {
  constructor(e) {
    super({
      icon: OV.preserveCase,
      title: Bve + e.appendTitle,
      isChecked: e.isChecked,
      hoverLifecycleOptions: e.hoverLifecycleOptions,
      inputActiveOptionBorder: e.inputActiveOptionBorder,
      inputActiveOptionForeground: e.inputActiveOptionForeground,
      inputActiveOptionBackground: e.inputActiveOptionBackground,
    });
  }
}
class Wve extends rJ {
  get onDidOptionChange() {
    return this._onDidOptionChange.event;
  }
  get onKeyDown() {
    return this._onKeyDown.event;
  }
  get onPreserveCaseKeyDown() {
    return this._onPreserveCaseKeyDown.event;
  }
  constructor(e, t, n, i) {
    (super(),
      (this._showOptionButtons = n),
      (this.fixFocusOnOptionClickEnabled = !0),
      (this.cachedOptionsWidth = 0),
      (this._onDidOptionChange = this._register(new QO())),
      (this._onKeyDown = this._register(new QO())),
      (this._onMouseDown = this._register(new QO())),
      (this._onInput = this._register(new QO())),
      (this._onKeyUp = this._register(new QO())),
      (this._onPreserveCaseKeyDown = this._register(new QO())),
      (this.contextViewProvider = t),
      (this.placeholder = i.placeholder || ""),
      (this.validation = i.validation),
      (this.label = i.label || Fve));
    const r = i.appendPreserveCaseLabel || "",
      o = i.history || new Set([]),
      s = !!i.flexibleHeight,
      a = !!i.flexibleWidth,
      l = i.flexibleMaxHeight;
    ((this.domNode = document.createElement("div")),
      this.domNode.classList.add("monaco-findInput"),
      (this.inputBox = this._register(
        new Ave(this.domNode, this.contextViewProvider, {
          ariaLabel: this.label || "",
          placeholder: this.placeholder || "",
          validationOptions: { validation: this.validation },
          history: o,
          showHistoryHint: i.showHistoryHint,
          flexibleHeight: s,
          flexibleWidth: a,
          flexibleMaxHeight: l,
          inputBoxStyles: i.inputBoxStyles,
        }),
      )),
      (this.preserveCase = this._register(
        new Vve({
          appendTitle: r,
          isChecked: !1,
          hoverLifecycleOptions: i.hoverLifecycleOptions,
          ...i.toggleStyles,
        }),
      )),
      this._register(
        this.preserveCase.onChange((e) => {
          (this._onDidOptionChange.fire(e),
            !e && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(),
            this.validate());
        }),
      ),
      this._register(
        this.preserveCase.onKeyDown((e) => {
          this._onPreserveCaseKeyDown.fire(e);
        }),
      ),
      this._showOptionButtons
        ? (this.cachedOptionsWidth = this.preserveCase.width())
        : (this.cachedOptionsWidth = 0));
    const c = [this.preserveCase.domNode];
    this.onkeydown(this.domNode, (e) => {
      if (e.equals(15) || e.equals(17) || e.equals(9)) {
        const t = c.indexOf(this.domNode.ownerDocument.activeElement);
        if (t >= 0) {
          let n = -1;
          (e.equals(17)
            ? (n = (t + 1) % c.length)
            : e.equals(15) && (n = 0 === t ? c.length - 1 : t - 1),
            e.equals(9) ? (c[t].blur(), this.inputBox.focus()) : n >= 0 && c[n].focus(),
            IB(e, !0));
        }
      }
    });
    const d = document.createElement("div");
    ((d.className = "controls"),
      (d.style.display = this._showOptionButtons ? "block" : "none"),
      d.appendChild(this.preserveCase.domNode),
      this.domNode.appendChild(d),
      e?.appendChild(this.domNode),
      this.onkeydown(this.inputBox.inputElement, (e) => this._onKeyDown.fire(e)),
      this.onkeyup(this.inputBox.inputElement, (e) => this._onKeyUp.fire(e)),
      this.oninput(this.inputBox.inputElement, (e) => this._onInput.fire()),
      this.onmousedown(this.inputBox.inputElement, (e) => this._onMouseDown.fire(e)));
  }
  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(e) {
    e ? this.enable() : this.disable();
  }
  select() {
    this.inputBox.select();
  }
  focus() {
    this.inputBox.focus();
  }
  getPreserveCase() {
    return this.preserveCase.checked;
  }
  setPreserveCase(e) {
    this.preserveCase.checked = e;
  }
  focusOnPreserve() {
    this.preserveCase.focus();
  }
  validate() {
    this.inputBox?.validate();
  }
  set width(e) {
    ((this.inputBox.paddingRight = this.cachedOptionsWidth), (this.domNode.style.width = e + "px"));
  }
  dispose() {
    super.dispose();
  }
}
var Hve = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  zve = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const Uve = new yW("suggestWidgetVisible", !1, SI(1698, "Whether suggestion are visible")),
  $ve = "historyNavigationWidgetFocus",
  qve = "historyNavigationForwardsEnabled",
  Kve = "historyNavigationBackwardsEnabled";
let Gve;
const Zve = [];
function Yve(e, t) {
  if (Zve.includes(t)) throw new Error("Cannot register the same widget multiple times");
  Zve.push(t);
  const n = new AO(),
    i = new yW($ve, !1).bindTo(e),
    r = new yW(qve, !0).bindTo(e),
    o = new yW(Kve, !0).bindTo(e),
    s = () => {
      (i.set(!0), (Gve = t));
    },
    a = () => {
      (i.set(!1), Gve === t && (Gve = void 0));
    };
  return (
    bB(t.element) && s(),
    n.add(t.onDidFocus(() => s())),
    n.add(t.onDidBlur(() => a())),
    n.add(
      MO(() => {
        (Zve.splice(Zve.indexOf(t), 1), a());
      }),
    ),
    {
      historyNavigationForwardsEnablement: r,
      historyNavigationBackwardsEnablement: o,
      dispose() {
        n.dispose();
      },
    }
  );
}
let Xve = class extends jve {
  constructor(e, t, n, i) {
    super(e, t, n);
    const r = this._register(i.createScoped(this.inputBox.element));
    this._register(Yve(r, this.inputBox));
  }
};
Xve = Hve([zve(3, xW)], Xve);
let Qve = class extends Wve {
  constructor(e, t, n, i, r = !1) {
    super(e, t, r, n);
    const o = this._register(i.createScoped(this.inputBox.element));
    this._register(Yve(o, this.inputBox));
  }
};
function Jve(e) {
  return (
    "Up" === e.lookupKeybinding("history.showPrevious")?.getElectronAccelerator() &&
    "Down" === e.lookupKeybinding("history.showNext")?.getElectronAccelerator()
  );
}
((Qve = Hve([zve(3, xW)], Qve)),
  DW.registerCommandAndKeybindingRule({
    id: "history.showPrevious",
    weight: 200,
    when: eW.and(eW.has($ve), eW.equals(Kve, !0), eW.not("isComposing"), Uve.isEqualTo(!1)),
    primary: 16,
    secondary: [528],
    handler: (e) => {
      Gve?.showPreviousValue();
    },
  }),
  DW.registerCommandAndKeybindingRule({
    id: "history.showNext",
    weight: 200,
    when: eW.and(eW.has($ve), eW.equals(qve, !0), eW.not("isComposing"), Uve.isEqualTo(!1)),
    primary: 18,
    secondary: [530],
    handler: (e) => {
      Gve?.showNextValue();
    },
  }));
const ebe = Zle(
    "find-collapsed",
    OV.chevronRight,
    SI(956, "Icon to indicate that the editor find widget is collapsed."),
  ),
  tbe = Zle(
    "find-expanded",
    OV.chevronDown,
    SI(957, "Icon to indicate that the editor find widget is expanded."),
  ),
  nbe = Zle(
    "find-selection",
    OV.selection,
    SI(958, "Icon for 'Find in Selection' in the editor find widget."),
  ),
  ibe = Zle("find-replace", OV.replace, SI(959, "Icon for 'Replace' in the editor find widget.")),
  rbe = Zle(
    "find-replace-all",
    OV.replaceAll,
    SI(960, "Icon for 'Replace All' in the editor find widget."),
  ),
  obe = Zle(
    "find-previous-match",
    OV.arrowUp,
    SI(961, "Icon for 'Find Previous' in the editor find widget."),
  ),
  sbe = Zle(
    "find-next-match",
    OV.arrowDown,
    SI(962, "Icon for 'Find Next' in the editor find widget."),
  ),
  abe = SI(963, "Find / Replace"),
  lbe = SI(964, "Find"),
  cbe = SI(965, "Find"),
  dbe = SI(966, "Previous Match"),
  ube = SI(967, "Next Match"),
  hbe = SI(968, "Find in Selection"),
  gbe = SI(969, "Close"),
  pbe = SI(970, "Replace"),
  fbe = SI(971, "Replace"),
  mbe = SI(972, "Replace"),
  _be = SI(973, "Replace All"),
  vbe = SI(974, "Toggle Replace"),
  bbe = SI(
    975,
    "Only the first {0} results are highlighted, but all find operations work on the entire text.",
    vve,
  ),
  ybe = SI(976, "{0} of {1}"),
  xbe = SI(977, "No results"),
  wbe = 419;
let Cbe = 69;
const Sbe = PR ? 256 : 2048;
class kbe {
  constructor(e) {
    ((this.afterLineNumber = e),
      (this.heightInPx = 33),
      (this.suppressMouseDown = !1),
      (this.domNode = document.createElement("div")),
      (this.domNode.className = "dock-find-viewzone"));
  }
}
function Ebe(e, t, n) {
  const i = !!t.match(/\n/);
  n && i && n.selectionStart > 0 && e.stopPropagation();
}
function Nbe(e, t, n) {
  const i = !!t.match(/\n/);
  n && i && n.selectionEnd < n.value.length && e.stopPropagation();
}
class Lbe extends rJ {
  static {
    this.ID = "editor.contrib.findWidget";
  }
  constructor(e, t, n, i, r, o, s, a, l) {
    (super(),
      (this._hoverService = s),
      (this._findWidgetSearchHistory = a),
      (this._replaceWidgetHistory = l),
      (this._cachedHeight = null),
      (this._revealTimeouts = []),
      (this._codeEditor = e),
      (this._controller = t),
      (this._state = n),
      (this._contextViewProvider = i),
      (this._keybindingService = r),
      (this._contextKeyService = o),
      (this._isVisible = !1),
      (this._isReplaceVisible = !1),
      (this._ignoreChangeEvent = !1),
      (this._updateHistoryDelayer = new mM(500)),
      this._register(MO(() => this._updateHistoryDelayer.cancel())),
      this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e))),
      this._buildDomNode(),
      this._updateButtons(),
      this._tryUpdateWidgetWidth(),
      this._findInput.inputBox.layout(),
      this._register(
        this._codeEditor.onDidChangeConfiguration((e) => {
          if (
            (e.hasChanged(104) &&
              (this._codeEditor.getOption(104) && this._state.change({ isReplaceRevealed: !1 }, !1),
              this._updateButtons()),
            e.hasChanged(165) && this._tryUpdateWidgetWidth(),
            e.hasChanged(2) && this.updateAccessibilitySupport(),
            e.hasChanged(50))
          ) {
            const e = this._codeEditor.getOption(50).loop;
            this._state.change({ loop: e }, !1);
            const t = this._codeEditor.getOption(50).addExtraSpaceOnTop;
            (t && !this._viewZone && ((this._viewZone = new kbe(0)), this._showViewZone()),
              !t && this._viewZone && this._removeViewZone());
          }
        }),
      ),
      this.updateAccessibilitySupport(),
      this._register(
        this._codeEditor.onDidChangeCursorSelection(() => {
          this._isVisible && this._updateToggleSelectionFindButton();
        }),
      ),
      this._register(
        this._codeEditor.onDidFocusEditorWidget(async () => {
          if (this._isVisible) {
            const e = await this._controller.getGlobalBufferTerm();
            e &&
              e !== this._state.searchString &&
              (this._state.change({ searchString: e }, !1), this._findInput.select());
          }
        }),
      ),
      (this._findInputFocused = K_e.bindTo(o)),
      (this._findFocusTracker = this._register(OB(this._findInput.inputBox.inputElement))),
      this._register(
        this._findFocusTracker.onDidFocus(() => {
          (this._findInputFocused.set(!0), this._updateSearchScope());
        }),
      ),
      this._register(
        this._findFocusTracker.onDidBlur(() => {
          this._findInputFocused.set(!1);
        }),
      ),
      (this._replaceInputFocused = G_e.bindTo(o)),
      (this._replaceFocusTracker = this._register(OB(this._replaceInput.inputBox.inputElement))),
      this._register(
        this._replaceFocusTracker.onDidFocus(() => {
          (this._replaceInputFocused.set(!0), this._updateSearchScope());
        }),
      ),
      this._register(
        this._replaceFocusTracker.onDidBlur(() => {
          this._replaceInputFocused.set(!1);
        }),
      ),
      this._codeEditor.addOverlayWidget(this),
      this._codeEditor.getOption(50).addExtraSpaceOnTop && (this._viewZone = new kbe(0)),
      this._register(
        this._codeEditor.onDidChangeModel(() => {
          this._isVisible && (this._viewZoneId = void 0);
        }),
      ),
      this._register(
        this._codeEditor.onDidScrollChange((e) => {
          e.scrollTopChanged
            ? this._layoutViewZone()
            : setTimeout(() => {
                this._layoutViewZone();
              }, 0);
        }),
      ));
  }
  getId() {
    return Lbe.ID;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return this._isVisible ? { preference: 0 } : null;
  }
  _onStateChanged(e) {
    if (e.searchString) {
      try {
        ((this._ignoreChangeEvent = !0), this._findInput.setValue(this._state.searchString));
      } finally {
        this._ignoreChangeEvent = !1;
      }
      this._updateButtons();
    }
    if (
      (e.replaceString && (this._replaceInput.inputBox.value = this._state.replaceString),
      e.isRevealed && (this._state.isRevealed ? this._reveal() : this._hide(!0)),
      e.isReplaceRevealed &&
        (this._state.isReplaceRevealed
          ? this._codeEditor.getOption(104) ||
            this._isReplaceVisible ||
            ((this._isReplaceVisible = !0),
            (this._replaceInput.width = cB(this._findInput.domNode)),
            this._updateButtons(),
            this._replaceInput.inputBox.layout())
          : this._isReplaceVisible && ((this._isReplaceVisible = !1), this._updateButtons())),
      (e.isRevealed || e.isReplaceRevealed) &&
        (this._state.isRevealed || this._state.isReplaceRevealed) &&
        this._tryUpdateHeight() &&
        this._showViewZone(),
      e.isRegex && this._findInput.setRegex(this._state.isRegex),
      e.wholeWord && this._findInput.setWholeWords(this._state.wholeWord),
      e.matchCase && this._findInput.setCaseSensitive(this._state.matchCase),
      e.preserveCase && this._replaceInput.setPreserveCase(this._state.preserveCase),
      e.searchScope &&
        (this._state.searchScope
          ? (this._toggleSelectionFind.checked = !0)
          : (this._toggleSelectionFind.checked = !1),
        this._updateToggleSelectionFindButton()),
      e.searchString || e.matchesCount || e.matchesPosition)
    ) {
      const e = this._state.searchString.length > 0 && 0 === this._state.matchesCount;
      (this._domNode.classList.toggle("no-results", e),
        this._updateMatchesCount(),
        this._updateButtons());
    }
    ((e.searchString || e.currentMatch) && this._layoutViewZone(),
      e.updateHistory && this._delayedUpdateHistory(),
      e.loop && this._updateButtons());
  }
  _delayedUpdateHistory() {
    this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0, HI);
  }
  _updateHistory() {
    (this._state.searchString && this._findInput.inputBox.addToHistory(),
      this._state.replaceString && this._replaceInput.inputBox.addToHistory());
  }
  _updateMatchesCount() {
    let e;
    if (
      ((this._matchesCount.style.minWidth = Cbe + "px"),
      this._state.matchesCount >= vve
        ? (this._matchesCount.title = bbe)
        : (this._matchesCount.title = ""),
      this._matchesCount.firstChild?.remove(),
      this._state.matchesCount > 0)
    ) {
      let t = String(this._state.matchesCount);
      this._state.matchesCount >= vve && (t += "+");
      let n = String(this._state.matchesPosition);
      ("0" === n && (n = "?"), (e = WM(ybe, n, t)));
    } else e = xbe;
    (this._matchesCount.appendChild(document.createTextNode(e)),
      pV(this._getAriaLabel(e, this._state.currentMatch, this._state.searchString)),
      (Cbe = Math.max(Cbe, this._matchesCount.clientWidth)));
  }
  _getAriaLabel(e, t, n) {
    if (e === xbe) return "" === n ? SI(978, "{0} found", e) : SI(979, "{0} found for '{1}'", e, n);
    if (t) {
      const i = SI(
          980,
          "{0} found for '{1}', at {2}",
          e,
          n,
          t.startLineNumber + ":" + t.startColumn,
        ),
        r = this._codeEditor.getModel();
      if (r && t.startLineNumber <= r.getLineCount() && t.startLineNumber >= 1) {
        return `${r.getLineContent(t.startLineNumber)}, ${i}`;
      }
      return i;
    }
    return SI(981, "{0} found for '{1}'", e, n);
  }
  _updateToggleSelectionFindButton() {
    const e = this._codeEditor.getSelection(),
      t = !!e && (e.startLineNumber !== e.endLineNumber || e.startColumn !== e.endColumn),
      n = this._toggleSelectionFind.checked;
    this._isVisible && (n || t)
      ? 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));
    const e = this._state.searchString.length > 0,
      t = !!this._state.matchesCount;
    (this._prevBtn.setEnabled(this._isVisible && e && t && this._state.canNavigateBack()),
      this._nextBtn.setEnabled(this._isVisible && e && t && this._state.canNavigateForward()),
      this._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && e),
      this._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && e),
      this._domNode.classList.toggle("replaceToggled", this._isReplaceVisible),
      this._toggleReplaceBtn.setExpanded(this._isReplaceVisible));
    const n = !this._codeEditor.getOption(104);
    this._toggleReplaceBtn.setEnabled(this._isVisible && n);
  }
  _reveal() {
    if (
      (this._revealTimeouts.forEach((e) => {
        clearTimeout(e);
      }),
      (this._revealTimeouts = []),
      !this._isVisible)
    ) {
      this._isVisible = !0;
      const e = this._codeEditor.getSelection();
      switch (this._codeEditor.getOption(50).autoFindInSelection) {
        case "always":
          this._toggleSelectionFind.checked = !0;
          break;
        case "never":
          this._toggleSelectionFind.checked = !1;
          break;
        case "multiline": {
          const t = !!e && e.startLineNumber !== e.endLineNumber;
          this._toggleSelectionFind.checked = t;
          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 t = !0;
      if (this._codeEditor.getOption(50).seedSearchStringFromSelection && e) {
        const n = this._codeEditor.getDomNode();
        if (n) {
          const i = aB(n),
            r = this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),
            o = i.left + (r ? r.left : 0),
            s = r ? r.top : 0;
          if (this._viewZone && s < this._viewZone.heightInPx) {
            e.endLineNumber > e.startLineNumber && (t = !1);
            const n = sB(this._domNode).left;
            o > n && (t = !1);
            const r = this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());
            i.left + (r ? r.left : 0) > n && (t = !1);
          }
        }
      }
      this._showViewZone(t);
    }
  }
  _hide(e) {
    (this._revealTimeouts.forEach((e) => {
      clearTimeout(e);
    }),
      (this._revealTimeouts = []),
      this._isVisible &&
        ((this._isVisible = !1),
        this._updateButtons(),
        this._domNode.classList.remove("visible"),
        this._domNode.setAttribute("aria-hidden", "true"),
        this._findInput.clearMessage(),
        e && this._codeEditor.focus(),
        this._codeEditor.layoutOverlayWidget(this),
        this._removeViewZone()));
  }
  _layoutViewZone(e) {
    if (!this._codeEditor.getOption(50).addExtraSpaceOnTop) return void this._removeViewZone();
    if (!this._isVisible) return;
    const t = this._viewZone;
    void 0 === this._viewZoneId &&
      t &&
      this._codeEditor.changeViewZones((n) => {
        ((t.heightInPx = this._getHeight()),
          (this._viewZoneId = n.addZone(t)),
          this._codeEditor.setScrollTop(e || this._codeEditor.getScrollTop() + t.heightInPx));
      });
  }
  _showViewZone(e = !0) {
    if (!this._isVisible) return;
    if (!this._codeEditor.getOption(50).addExtraSpaceOnTop) return;
    void 0 === this._viewZone && (this._viewZone = new kbe(0));
    const t = this._viewZone;
    this._codeEditor.changeViewZones((n) => {
      if (void 0 !== this._viewZoneId) {
        const i = this._getHeight();
        if (i === t.heightInPx) return;
        const r = i - t.heightInPx;
        return (
          (t.heightInPx = i),
          n.layoutZone(this._viewZoneId),
          void (e && this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + r))
        );
      }
      {
        let i = this._getHeight();
        if (((i -= this._codeEditor.getOption(96).top), i <= 0)) return;
        ((t.heightInPx = i),
          (this._viewZoneId = n.addZone(t)),
          e && this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + i));
      }
    });
  }
  _removeViewZone() {
    this._codeEditor.changeViewZones((e) => {
      void 0 !== this._viewZoneId &&
        (e.removeZone(this._viewZoneId),
        (this._viewZoneId = void 0),
        this._viewZone &&
          (this._codeEditor.setScrollTop(
            this._codeEditor.getScrollTop() - this._viewZone.heightInPx,
          ),
          (this._viewZone = void 0)));
    });
  }
  _tryUpdateWidgetWidth() {
    if (!this._isVisible) return;
    if (!this._domNode.isConnected) return;
    const e = this._codeEditor.getLayoutInfo();
    if (e.contentWidth <= 0) return void this._domNode.classList.add("hiddenEditor");
    this._domNode.classList.contains("hiddenEditor") &&
      this._domNode.classList.remove("hiddenEditor");
    const t = e.width,
      n = e.minimap.minimapWidth;
    let i = !1,
      r = !1,
      o = !1;
    if (this._resized) {
      if (cB(this._domNode) > wbe)
        return (
          (this._domNode.style.maxWidth = t - 28 - n - 15 + "px"),
          void (this._replaceInput.width = cB(this._findInput.domNode))
        );
    }
    if (
      (447 + n >= t && (r = !0),
      447 + n - Cbe >= t && (o = !0),
      447 + n - Cbe >= t + 50 && (i = !0),
      this._domNode.classList.toggle("collapsed-find-widget", i),
      this._domNode.classList.toggle("narrow-find-widget", o),
      this._domNode.classList.toggle("reduced-find-widget", r),
      o || i || (this._domNode.style.maxWidth = t - 28 - n - 15 + "px"),
      this._findInput.layout({ collapsedFindWidget: i, narrowFindWidget: o, reducedFindWidget: r }),
      this._resized)
    ) {
      const e = this._findInput.inputBox.element.clientWidth;
      e > 0 && (this._replaceInput.width = e);
    } else this._isReplaceVisible && (this._replaceInput.width = cB(this._findInput.domNode));
  }
  _getHeight() {
    let e = 0;
    return (
      (e += 4),
      (e += this._findInput.inputBox.height + 2),
      this._isReplaceVisible && ((e += 4), (e += this._replaceInput.inputBox.height + 2)),
      (e += 4),
      e
    );
  }
  _tryUpdateHeight() {
    const e = this._getHeight();
    return (
      (null === this._cachedHeight || this._cachedHeight !== e) &&
      ((this._cachedHeight = e), (this._domNode.style.height = `${e}px`), !0)
    );
  }
  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) {
      const e = this._codeEditor.getSelections();
      (e
        .map((e) => {
          1 === e.endColumn &&
            e.endLineNumber > e.startLineNumber &&
            (e = e.setEndPosition(
              e.endLineNumber - 1,
              this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber - 1),
            ));
          const t = this._state.currentMatch;
          return e.startLineNumber === e.endLineNumber || YH.equalsRange(e, t) ? null : e;
        })
        .filter((e) => !!e),
        e.length && this._state.change({ searchScope: e }, !0));
    }
  }
  _onFindInputMouseDown(e) {
    e.middleButton && e.stopPropagation();
  }
  _onFindInputKeyDown(e) {
    return e.equals(3 | Sbe)
      ? (this._keybindingService.dispatchEvent(e, e.target) ||
          this._findInput.inputBox.insertAtCursor("\n"),
        void e.preventDefault())
      : e.equals(2)
        ? (this._isReplaceVisible
            ? this._replaceInput.focus()
            : this._findInput.focusOnCaseSensitive(),
          void e.preventDefault())
        : e.equals(2066)
          ? (this._codeEditor.focus(), void e.preventDefault())
          : e.equals(16)
            ? Ebe(e, this._findInput.getValue(), this._findInput.domNode.querySelector("textarea"))
            : e.equals(18)
              ? Nbe(
                  e,
                  this._findInput.getValue(),
                  this._findInput.domNode.querySelector("textarea"),
                )
              : void 0;
  }
  _onReplaceInputKeyDown(e) {
    return e.equals(3 | Sbe)
      ? (this._keybindingService.dispatchEvent(e, e.target) ||
          this._replaceInput.inputBox.insertAtCursor("\n"),
        void e.preventDefault())
      : e.equals(2)
        ? (this._findInput.focusOnCaseSensitive(), void e.preventDefault())
        : e.equals(1026)
          ? (this._findInput.focus(), void e.preventDefault())
          : e.equals(2066)
            ? (this._codeEditor.focus(), void e.preventDefault())
            : e.equals(16)
              ? Ebe(
                  e,
                  this._replaceInput.inputBox.value,
                  this._replaceInput.inputBox.element.querySelector("textarea"),
                )
              : e.equals(18)
                ? Nbe(
                    e,
                    this._replaceInput.inputBox.value,
                    this._replaceInput.inputBox.element.querySelector("textarea"),
                  )
                : void 0;
  }
  getVerticalSashLeft(e) {
    return 0;
  }
  _keybindingLabelFor(e) {
    const t = this._keybindingService.lookupKeybinding(e);
    return t ? ` (${t.getLabel()})` : "";
  }
  _buildDomNode() {
    const e = !0,
      t = !0,
      n = this._codeEditor.getOption(50).history,
      i = this._codeEditor.getOption(50).replaceHistory;
    ((this._findInput = this._register(
      new Xve(
        null,
        this._contextViewProvider,
        {
          width: 221,
          label: lbe,
          placeholder: cbe,
          appendCaseSensitiveLabel: this._keybindingLabelFor(dve),
          appendWholeWordsLabel: this._keybindingLabelFor(uve),
          appendRegexLabel: this._keybindingLabelFor(hve),
          validation: (e) => {
            if (0 === e.length || !this._findInput.getRegex()) return null;
            try {
              return (new RegExp(e, "gu"), null);
            } catch (spt) {
              return { content: spt.message };
            }
          },
          flexibleHeight: e,
          flexibleWidth: t,
          flexibleMaxHeight: 118,
          showCommonFindToggles: !0,
          showHistoryHint: () => Jve(this._keybindingService),
          inputBoxStyles: gue,
          toggleStyles: uue,
          history: "workspace" === n ? this._findWidgetSearchHistory : 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((e) => {
          (e.equals(3) &&
            !this._codeEditor.getOption(50).findOnType &&
            this._state.change({ searchString: this._findInput.getValue() }, !0),
            this._onFindInputKeyDown(e));
        }),
      ),
      this._register(
        this._findInput.inputBox.onDidChange(() => {
          !this._ignoreChangeEvent &&
            this._codeEditor.getOption(50).findOnType &&
            this._state.change({ searchString: this._findInput.getValue() }, !0);
        }),
      ),
      this._register(
        this._findInput.onDidOptionChange(() => {
          this._state.change(
            {
              isRegex: this._findInput.getRegex(),
              wholeWord: this._findInput.getWholeWords(),
              matchCase: this._findInput.getCaseSensitive(),
            },
            !0,
          );
        }),
      ),
      this._register(
        this._findInput.onCaseSensitiveKeyDown((e) => {
          e.equals(1026) &&
            this._isReplaceVisible &&
            (this._replaceInput.focus(), e.preventDefault());
        }),
      ),
      this._register(
        this._findInput.onRegexKeyDown((e) => {
          e.equals(2) &&
            this._isReplaceVisible &&
            (this._replaceInput.focusOnPreserve(), e.preventDefault());
        }),
      ),
      this._register(
        this._findInput.inputBox.onDidHeightChange((e) => {
          this._tryUpdateHeight() && this._showViewZone();
        }),
      ),
      jR && this._register(this._findInput.onMouseDown((e) => this._onFindInputMouseDown(e))),
      (this._matchesCount = document.createElement("div")),
      (this._matchesCount.className = "matchesCount"),
      this._updateMatchesCount());
    const r = { groupId: "find-widget" };
    ((this._prevBtn = this._register(
      new Dbe(
        {
          label: dbe + this._keybindingLabelFor(rve),
          icon: obe,
          hoverLifecycleOptions: r,
          onTrigger: () => {
            fR(this._codeEditor.getAction(rve))
              .run()
              .then(void 0, HI);
          },
        },
        this._hoverService,
      ),
    )),
      (this._nextBtn = this._register(
        new Dbe(
          {
            label: ube + this._keybindingLabelFor(ive),
            icon: sbe,
            hoverLifecycleOptions: r,
            onTrigger: () => {
              fR(this._codeEditor.getAction(ive))
                .run()
                .then(void 0, HI);
            },
          },
          this._hoverService,
        ),
      )));
    const o = document.createElement("div");
    ((o.className = "find-part"), o.appendChild(this._findInput.domNode));
    const s = document.createElement("div");
    ((s.className = "find-actions"),
      o.appendChild(s),
      s.appendChild(this._matchesCount),
      s.appendChild(this._prevBtn.domNode),
      s.appendChild(this._nextBtn.domNode),
      (this._toggleSelectionFind = this._register(
        new R_e({
          icon: nbe,
          title: hbe + this._keybindingLabelFor(gve),
          isChecked: !1,
          hoverLifecycleOptions: r,
          inputActiveOptionBackground: yG(hY),
          inputActiveOptionBorder: yG(dY),
          inputActiveOptionForeground: yG(gY),
        }),
      )),
      this._register(
        this._toggleSelectionFind.onChange(() => {
          if (this._toggleSelectionFind.checked) {
            if (this._codeEditor.hasModel()) {
              let e = this._codeEditor.getSelections();
              ((e = e
                .map(
                  (e) => (
                    1 === e.endColumn &&
                      e.endLineNumber > e.startLineNumber &&
                      (e = e.setEndPosition(
                        e.endLineNumber - 1,
                        this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber - 1),
                      )),
                    e.isEmpty() ? null : e
                  ),
                )
                .filter((e) => !!e)),
                e.length && this._state.change({ searchScope: e }, !0));
            }
          } else this._state.change({ searchScope: null }, !0);
        }),
      ),
      s.appendChild(this._toggleSelectionFind.domNode),
      (this._closeBtn = this._register(
        new Dbe(
          {
            label: gbe + this._keybindingLabelFor(cve),
            icon: ece,
            hoverLifecycleOptions: r,
            onTrigger: () => {
              this._state.change({ isRevealed: !1, searchScope: null }, !1);
            },
            onKeyDown: (e) => {
              e.equals(2) &&
                this._isReplaceVisible &&
                (this._replaceBtn.isEnabled() ? this._replaceBtn.focus() : this._codeEditor.focus(),
                e.preventDefault());
            },
          },
          this._hoverService,
        ),
      )),
      (this._replaceInput = this._register(
        new Qve(
          null,
          void 0,
          {
            label: pbe,
            placeholder: fbe,
            appendPreserveCaseLabel: this._keybindingLabelFor(pve),
            history: "workspace" === i ? this._replaceWidgetHistory : new Set([]),
            flexibleHeight: e,
            flexibleWidth: t,
            flexibleMaxHeight: 118,
            showHistoryHint: () => Jve(this._keybindingService),
            inputBoxStyles: gue,
            toggleStyles: uue,
            hoverLifecycleOptions: r,
          },
          this._contextKeyService,
          !0,
        ),
      )),
      this._replaceInput.setPreserveCase(!!this._state.preserveCase),
      this._register(this._replaceInput.onKeyDown((e) => this._onReplaceInputKeyDown(e))),
      this._register(
        this._replaceInput.inputBox.onDidChange(() => {
          this._state.change({ replaceString: this._replaceInput.inputBox.value }, !1);
        }),
      ),
      this._register(
        this._replaceInput.inputBox.onDidHeightChange((e) => {
          this._isReplaceVisible && this._tryUpdateHeight() && this._showViewZone();
        }),
      ),
      this._register(
        this._replaceInput.onDidOptionChange(() => {
          this._state.change({ preserveCase: this._replaceInput.getPreserveCase() }, !0);
        }),
      ),
      this._register(
        this._replaceInput.onPreserveCaseKeyDown((e) => {
          e.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(),
            e.preventDefault());
        }),
      ),
      (this._replaceBtn = this._register(
        new Dbe(
          {
            label: mbe + this._keybindingLabelFor(fve),
            icon: ibe,
            hoverLifecycleOptions: r,
            onTrigger: () => {
              this._controller.replace();
            },
            onKeyDown: (e) => {
              e.equals(1026) && (this._closeBtn.focus(), e.preventDefault());
            },
          },
          this._hoverService,
        ),
      )),
      (this._replaceAllBtn = this._register(
        new Dbe(
          {
            label: _be + this._keybindingLabelFor(mve),
            icon: rbe,
            hoverLifecycleOptions: r,
            onTrigger: () => {
              this._controller.replaceAll();
            },
          },
          this._hoverService,
        ),
      )));
    const a = document.createElement("div");
    ((a.className = "replace-part"), a.appendChild(this._replaceInput.domNode));
    const l = document.createElement("div");
    ((l.className = "replace-actions"),
      a.appendChild(l),
      l.appendChild(this._replaceBtn.domNode),
      l.appendChild(this._replaceAllBtn.domNode),
      (this._toggleReplaceBtn = this._register(
        new Dbe(
          {
            label: vbe,
            className: "codicon toggle left",
            onTrigger: () => {
              (this._state.change({ isReplaceRevealed: !this._isReplaceVisible }, !1),
                this._isReplaceVisible &&
                  ((this._replaceInput.width = cB(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 = abe),
      (this._domNode.role = "dialog"),
      (this._domNode.style.width = "419px"),
      this._domNode.appendChild(this._toggleReplaceBtn.domNode),
      this._domNode.appendChild(o),
      this._domNode.appendChild(this._closeBtn.domNode),
      this._domNode.appendChild(a),
      (this._resizeSash = this._register(
        new Ade(this._domNode, this, { orientation: 0, size: 2 }),
      )),
      (this._resized = !1));
    let c = wbe;
    (this._register(
      this._resizeSash.onDidStart(() => {
        c = cB(this._domNode);
      }),
    ),
      this._register(
        this._resizeSash.onDidChange((e) => {
          this._resized = !0;
          const t = c + e.startX - e.currentX;
          if (t < wbe) return;
          t > (parseFloat(nB(this._domNode).maxWidth) || 0) ||
            ((this._domNode.style.width = `${t}px`),
            this._isReplaceVisible && (this._replaceInput.width = cB(this._findInput.domNode)),
            this._findInput.inputBox.layout(),
            this._tryUpdateHeight());
        }),
      ),
      this._register(
        this._resizeSash.onDidReset(() => {
          const e = cB(this._domNode);
          if (e < wbe) return;
          let t = wbe;
          if (!this._resized || e === wbe) {
            const e = this._codeEditor.getLayoutInfo();
            ((t = e.width - 28 - e.minimap.minimapWidth - 15), (this._resized = !0));
          }
          ((this._domNode.style.width = `${t}px`),
            this._isReplaceVisible && (this._replaceInput.width = cB(this._findInput.domNode)),
            this._findInput.inputBox.layout());
        }),
      ));
  }
  updateAccessibilitySupport() {
    const e = this._codeEditor.getOption(2);
    this._findInput.setFocusInputOnOptionClick(2 !== e);
  }
  getViewState() {
    let e = !1;
    return (
      this._viewZone &&
        this._viewZoneId &&
        (e = this._viewZone.heightInPx > this._codeEditor.getScrollTop()),
      { widgetViewZoneVisible: e, scrollTop: this._codeEditor.getScrollTop() }
    );
  }
  setViewState(e) {
    e && e.widgetViewZoneVisible && this._layoutViewZone(e.scrollTop);
  }
}
class Dbe extends rJ {
  constructor(e, t) {
    (super(), (this._opts = e));
    let n = "button";
    (this._opts.className && (n = n + " " + this._opts.className),
      this._opts.icon && (n = n + " " + AV.asClassName(this._opts.icon)),
      (this._domNode = document.createElement("div")),
      (this._domNode.tabIndex = 0),
      (this._domNode.className = n),
      this._domNode.setAttribute("role", "button"),
      this._domNode.setAttribute("aria-label", this._opts.label),
      this._register(
        t.setupDelayedHover(
          this._domNode,
          { content: this._opts.label, style: 1 },
          e.hoverLifecycleOptions,
        ),
      ),
      this.onclick(this._domNode, (e) => {
        (this._opts.onTrigger(), e.preventDefault());
      }),
      this.onkeydown(this._domNode, (e) => {
        if (e.equals(10) || e.equals(3)) return (this._opts.onTrigger(), void e.preventDefault());
        this._opts.onKeyDown?.(e);
      }));
  }
  get domNode() {
    return this._domNode;
  }
  isEnabled() {
    return this._domNode.tabIndex >= 0;
  }
  focus() {
    this._domNode.focus();
  }
  setEnabled(e) {
    (this._domNode.classList.toggle("disabled", !e),
      this._domNode.setAttribute("aria-disabled", String(!e)),
      (this._domNode.tabIndex = e ? 0 : -1));
  }
  setExpanded(e) {
    (this._domNode.setAttribute("aria-expanded", String(!!e)),
      e
        ? (this._domNode.classList.remove(...AV.asClassNameArray(ebe)),
          this._domNode.classList.add(...AV.asClassNameArray(tbe)))
        : (this._domNode.classList.remove(...AV.asClassNameArray(tbe)),
          this._domNode.classList.add(...AV.asClassNameArray(ebe))));
  }
}
_0((e, t) => {
  const n = e.getColor(fZ);
  n &&
    t.addRule(
      `.monaco-editor .findMatch { border: 1px ${TQ(e.type) ? "dotted" : "solid"} ${n}; box-sizing: border-box; }`,
    );
  const i = e.getColor(mZ);
  i &&
    t.addRule(`.monaco-editor .findScope { border: 1px ${TQ(e.type) ? "dashed" : "solid"} ${i}; }`);
  const r = e.getColor(FG);
  r && t.addRule(`.monaco-editor .find-widget { border: 1px solid ${r}; }`);
  const o = e.getColor(hZ);
  o && t.addRule(`.monaco-editor .findMatchInline { color: ${o}; }`);
  const s = e.getColor(pZ);
  s && t.addRule(`.monaco-editor .currentFindMatchInline { color: ${s}; }`);
});
var Tbe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let Ibe = class extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._container = e),
      (this._getContent = t),
      (this._clipboardService = n),
      (this._hoverService = i),
      this._container.classList.add("hover-row-with-copy"),
      (this._button = this._register(
        new Dbe(
          {
            label: SI(1128, "Copy"),
            icon: OV.copy,
            onTrigger: () => this._copyContent(),
            className: "hover-copy-button",
          },
          this._hoverService,
        ),
      )),
      this._container.appendChild(this._button.domNode));
  }
  async _copyContent() {
    const e = this._getContent();
    e && (await this._clipboardService.writeText(e), fV(SI(1129, "Copied to clipboard")));
  }
};
Ibe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Tbe(2, ade), Tbe(3, Xue)], Ibe);
class Rbe {
  constructor(e, t, n) {
    ((this.provider = e), (this.hover = t), (this.ordinal = n));
  }
}
function Obe(e, t, n, i, r = !1) {
  const o = e.ordered(t, r).map((e, r) =>
    (async function (e, t, n, i, r) {
      const o = await Promise.resolve(e.provideHover(n, i, r)).catch(zI);
      if (
        o &&
        (function (e) {
          const t = void 0 !== e.range,
            n = void 0 !== e.contents && e.contents && e.contents.length > 0;
          return t && n;
        })(o)
      )
        return new Rbe(e, o, t);
    })(e, r, t, n, i),
  );
  return OM.fromPromisesResolveOrder(o).coalesce();
}
async function Mbe(e, t, n, i, r = !1) {
  const o = [];
  for await (const s of Obe(e, t, n, i, r)) o.push(s.hover);
  return o;
}
(FH("_executeHoverProvider", (e, t, n) => Mbe(e.get(mee).hoverProvider, t, n, aM.None)),
  FH("_executeHoverProvider_recursive", (e, t, n) =>
    Mbe(e.get(mee).hoverProvider, t, n, aM.None, !0),
  ));
var Abe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const Pbe = VB,
  jbe = Zle("hover-increase-verbosity", OV.add, SI(1130, "Icon for increaseing hover verbosity.")),
  Fbe = Zle(
    "hover-decrease-verbosity",
    OV.remove,
    SI(1131, "Icon for decreasing hover verbosity."),
  );
class Bbe {
  constructor(e, t, n, i, r, o = void 0) {
    ((this.owner = e),
      (this.range = t),
      (this.contents = n),
      (this.isBeforeContent = i),
      (this.ordinal = r),
      (this.source = o));
  }
  isValidForHoverAnchor(e) {
    return (
      1 === e.type &&
      this.range.startColumn <= e.range.startColumn &&
      this.range.endColumn >= e.range.endColumn
    );
  }
}
class Vbe {
  constructor(e, t, n) {
    ((this.hover = e), (this.hoverProvider = t), (this.hoverPosition = n));
  }
  supportsVerbosityAction(e) {
    switch (e) {
      case h2.Increase:
        return this.hover.canIncreaseVerbosity ?? !1;
      case h2.Decrease:
        return this.hover.canDecreaseVerbosity ?? !1;
    }
  }
}
let Wbe = class {
  constructor(e, t, n, i, r, o, s) {
    ((this._editor = e),
      (this._markdownRendererService = t),
      (this._configurationService = n),
      (this._languageFeaturesService = i),
      (this._keybindingService = r),
      (this._hoverService = o),
      (this._commandService = s),
      (this.hoverOrdinal = 3));
  }
  createLoadingMessage(e) {
    return new Bbe(this, e.range, [new rre().appendText(SI(1132, "Loading..."))], !1, 2e3);
  }
  computeSync(e, t) {
    if (!this._editor.hasModel() || 1 !== e.type) return [];
    const n = this._editor.getModel(),
      i = e.range.startLineNumber,
      r = n.getLineMaxColumn(i),
      o = [];
    let s = 1e3;
    const a = n.getLineLength(i),
      l = n.getLanguageIdAtPosition(e.range.startLineNumber, e.range.startColumn),
      c = this._editor.getOption(133),
      d = this._configurationService.getValue("editor.maxTokenizationLineLength", {
        overrideIdentifier: l,
      });
    let u = !1;
    (c >= 0 &&
      a > c &&
      e.range.startColumn >= c &&
      ((u = !0),
      o.push(
        new Bbe(
          this,
          e.range,
          [
            {
              value: SI(
                1133,
                "Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.",
              ),
            },
          ],
          !1,
          s++,
        ),
      )),
      !u &&
        "number" == typeof d &&
        a >= d &&
        o.push(
          new Bbe(
            this,
            e.range,
            [
              {
                value: SI(
                  1134,
                  "Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.",
                ),
              },
            ],
            !1,
            s++,
          ),
        ));
    let h = !1;
    for (const g of t) {
      const t = g.range.startLineNumber === i ? g.range.startColumn : 1,
        n = g.range.endLineNumber === i ? g.range.endColumn : r,
        a = g.options.hoverMessage;
      if (!a || ore(a)) continue;
      g.options.beforeContentClassName && (h = !0);
      const l = new YH(e.range.startLineNumber, t, e.range.startLineNumber, n);
      o.push(new Bbe(this, l, fj(a), h, s++));
    }
    return o;
  }
  computeAsync(e, t, n, i) {
    if (!this._editor.hasModel() || 1 !== e.type) return OM.EMPTY;
    const r = this._editor.getModel(),
      o = this._languageFeaturesService.hoverProvider;
    return o.has(r) ? this._getMarkdownHovers(o, r, e, i) : OM.EMPTY;
  }
  async *_getMarkdownHovers(e, t, n, i) {
    const r = n.range.getStartPosition(),
      o = Obe(e, t, r, i);
    for await (const s of o)
      if (!ore(s.hover.contents)) {
        const e = s.hover.range ? YH.lift(s.hover.range) : n.range,
          t = new Vbe(s.hover, s.provider, r);
        yield new Bbe(this, e, s.hover.contents, !1, s.ordinal, t);
      }
  }
  renderHoverParts(e, t) {
    return (
      (this._renderedHoverParts = new zbe(
        t,
        e.fragment,
        this,
        this._editor,
        this._commandService,
        this._keybindingService,
        this._hoverService,
        this._configurationService,
        this._markdownRendererService,
        e.onContentsChanged,
      )),
      this._renderedHoverParts
    );
  }
  handleScroll(e) {
    this._renderedHoverParts?.handleScroll(e);
  }
  getAccessibleContent(e) {
    return this._renderedHoverParts?.getAccessibleContent(e) ?? "";
  }
  updateMarkdownHoverVerbosityLevel(e, t) {
    return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e, t));
  }
};
Wbe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Abe(1, _ge), Abe(2, OU), Abe(3, mee), Abe(4, N5), Abe(5, Xue), Abe(6, PV)], Wbe);
class Hbe {
  constructor(e, t, n, i) {
    ((this.hoverPart = e),
      (this.hoverElement = t),
      (this.disposables = n),
      (this.actionsContainer = i));
  }
  dispose() {
    this.disposables.dispose();
  }
}
class zbe {
  constructor(e, t, n, i, r, o, s, a, l, c) {
    ((this._hoverParticipant = n),
      (this._editor = i),
      (this._commandService = r),
      (this._keybindingService = o),
      (this._hoverService = s),
      (this._configurationService = a),
      (this._markdownRendererService = l),
      (this._onFinishedRendering = c),
      (this._ongoingHoverOperations = new Map()),
      (this._disposables = new AO()),
      (this.renderedHoverParts = this._renderHoverParts(e, t, this._onFinishedRendering)),
      this._disposables.add(
        MO(() => {
          (this.renderedHoverParts.forEach((e) => {
            e.dispose();
          }),
            this._ongoingHoverOperations.forEach((e) => {
              e.tokenSource.dispose(!0);
            }));
        }),
      ));
  }
  _renderHoverParts(e, t, n) {
    return (
      e.sort(bj((e) => e.ordinal, yj)),
      e.map((e) => {
        const i = this._renderHoverPart(e, n);
        return (t.appendChild(i.hoverElement), i);
      })
    );
  }
  _renderHoverPart(e, t) {
    const n = this._renderMarkdownHover(e, t),
      i = n.hoverElement,
      r = e.source,
      o = new AO();
    if ((o.add(n), !r)) return new Hbe(e, i, o);
    const s = r.supportsVerbosityAction(h2.Increase),
      a = r.supportsVerbosityAction(h2.Decrease);
    if (!s && !a) return new Hbe(e, i, o);
    const l = Pbe("div.verbosity-actions");
    i.prepend(l);
    const c = Pbe("div.verbosity-actions-inner");
    return (
      l.append(c),
      o.add(this._renderHoverExpansionAction(c, h2.Increase, s)),
      o.add(this._renderHoverExpansionAction(c, h2.Decrease, a)),
      new Hbe(e, i, o, c)
    );
  }
  _renderMarkdownHover(e, t) {
    return Ube(this._editor, e, this._markdownRendererService, t);
  }
  _renderHoverExpansionAction(e, t, n) {
    const i = new AO(),
      r = t === h2.Increase,
      o = MB(e, Pbe(AV.asCSSSelector(r ? jbe : Fbe)));
    o.tabIndex = 0;
    const s = new Que(
      "mouse",
      void 0,
      { target: e, position: { hoverPosition: 0 } },
      this._configurationService,
      this._hoverService,
    );
    if (
      (i.add(
        this._hoverService.setupManagedHover(
          s,
          o,
          (function (e, t) {
            switch (t) {
              case h2.Increase: {
                const t = e.lookupKeybinding(Ume);
                return t
                  ? SI(1135, "Increase Hover Verbosity ({0})", t.getLabel())
                  : SI(1136, "Increase Hover Verbosity");
              }
              case h2.Decrease: {
                const t = e.lookupKeybinding(qme);
                return t
                  ? SI(1137, "Decrease Hover Verbosity ({0})", t.getLabel())
                  : SI(1138, "Decrease Hover Verbosity");
              }
            }
          })(this._keybindingService, t),
        ),
      ),
      !n)
    )
      return (o.classList.add("disabled"), i);
    o.classList.add("enabled");
    const a = () =>
      this._commandService.executeCommand(t === h2.Increase ? Ume : qme, { focus: !0 });
    return (i.add(new b_e(o, a)), i.add(new y_e(o, a, [3, 10])), i);
  }
  handleScroll(e) {
    this.renderedHoverParts.forEach((t) => {
      const n = t.actionsContainer;
      if (!n) return;
      const i = t.hoverElement,
        r = e.scrollTop + e.height,
        o = i.offsetTop,
        s = i.clientHeight;
      let a;
      ((a = o + s <= r || o >= r ? s - 22 : r - o - 22), (n.style.top = `${a}px`));
    });
  }
  async updateMarkdownHoverPartVerbosityLevel(e, t) {
    const n = this._editor.getModel();
    if (!n) return;
    const i = this._getRenderedHoverPartAtIndex(t),
      r = i?.hoverPart.source;
    if (!i || !r?.supportsVerbosityAction(e)) return;
    const o = await this._fetchHover(r, n, e);
    if (!o) return;
    const s = new Vbe(o, r.hoverProvider, r.hoverPosition),
      a = i.hoverPart,
      l = new Bbe(this._hoverParticipant, a.range, o.contents, a.isBeforeContent, a.ordinal, s),
      c = this._updateRenderedHoverPart(t, l);
    return c ? { hoverPart: l, hoverElement: c.hoverElement } : void 0;
  }
  getAccessibleContent(e) {
    const t = this.renderedHoverParts.findIndex((t) => t.hoverPart === e);
    if (-1 === t) return;
    const n = this._getRenderedHoverPartAtIndex(t);
    if (!n) return;
    return n.hoverElement.innerText.replace(/[^\S\n\r]+/gu, " ");
  }
  async _fetchHover(e, t, n) {
    let i = n === h2.Increase ? 1 : -1;
    const r = e.hoverProvider,
      o = this._ongoingHoverOperations.get(r);
    o && (o.tokenSource.cancel(), (i += o.verbosityDelta));
    const s = new cM();
    this._ongoingHoverOperations.set(r, { verbosityDelta: i, tokenSource: s });
    const a = { verbosityRequest: { verbosityDelta: i, previousHover: e.hover } };
    let l;
    try {
      l = await Promise.resolve(r.provideHover(t, e.hoverPosition, s.token, a));
    } catch (spt) {
      zI(spt);
    }
    return (s.dispose(), this._ongoingHoverOperations.delete(r), l);
  }
  _updateRenderedHoverPart(e, t) {
    if (e >= this.renderedHoverParts.length || e < 0) return;
    const n = this._renderHoverPart(t, this._onFinishedRendering),
      i = this.renderedHoverParts[e],
      r = i.hoverElement,
      o = n.hoverElement,
      s = Array.from(o.children);
    r.replaceChildren(...s);
    const a = new Hbe(t, r, n.disposables, n.actionsContainer);
    return (i.dispose(), (this.renderedHoverParts[e] = a), a);
  }
  _getRenderedHoverPartAtIndex(e) {
    return this.renderedHoverParts[e];
  }
  dispose() {
    this._disposables.dispose();
  }
}
function Ube(e, t, n, i) {
  const r = new AO(),
    o = Pbe("div.hover-row"),
    s = Pbe("div.hover-row-contents");
  o.appendChild(s);
  const a = t.contents;
  for (const l of a) {
    if (ore(l)) continue;
    const t = Pbe("div.markdown-hover"),
      o = MB(t, Pbe("div.hover-contents")),
      a = r.add(
        n.render(l, {
          context: e,
          asyncRenderCallback: () => {
            ((o.className = "hover-contents code-hover-contents"), i());
          },
        }),
      );
    (o.appendChild(a.element), s.appendChild(t));
  }
  return {
    hoverPart: t,
    hoverElement: o,
    dispose() {
      r.dispose();
    },
  };
}
const $be = VB;
class qbe extends PO {
  constructor(e, t, n) {
    (super(),
      (this.model = t),
      (this.pixelRatio = n),
      (this._onDidChange = new QO()),
      (this.onDidChange = this._onDidChange.event),
      (this._onColorFlushed = new QO()),
      (this.onColorFlushed = this._onColorFlushed.event),
      (this._domNode = $be(".saturation-wrap")),
      MB(e, this._domNode),
      (this._canvas = document.createElement("canvas")),
      (this._canvas.className = "saturation-box"),
      MB(this._domNode, this._canvas),
      (this.selection = $be(".saturation-selection")),
      MB(this._domNode, this.selection),
      this.layout(),
      this._register($F(this._domNode, DB.POINTER_DOWN, (e) => this.onPointerDown(e))),
      this._register(this.model.onDidChangeColor(this.onDidChangeColor, this)),
      (this.monitor = null));
  }
  get domNode() {
    return this._domNode;
  }
  onPointerDown(e) {
    if (!(e.target && e.target instanceof Element)) return;
    this.monitor = this._register(new gG());
    const t = aB(this._domNode);
    (e.target !== this.selection && this.onDidChangePosition(e.offsetX, e.offsetY),
      this.monitor.startMonitoring(
        e.target,
        e.pointerId,
        e.buttons,
        (e) => this.onDidChangePosition(e.pageX - t.left, e.pageY - t.top),
        () => null,
      ));
    const n = $F(
      e.target.ownerDocument,
      DB.POINTER_UP,
      () => {
        (this._onColorFlushed.fire(),
          n.dispose(),
          this.monitor && (this.monitor.stopMonitoring(!0), (this.monitor = null)));
      },
      !0,
    );
  }
  onDidChangePosition(e, t) {
    const n = Math.max(0, Math.min(1, e / this.width)),
      i = Math.max(0, Math.min(1, 1 - t / this.height));
    (this.paintSelection(n, i), this._onDidChange.fire({ s: n, v: i }));
  }
  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());
    const e = this.model.color.hsva;
    this.paintSelection(e.s, e.v);
  }
  paint() {
    const e = this.model.color.hsva,
      t = new vG(new _G(e.h, 1, 1, 1)),
      n = this._canvas.getContext("2d"),
      i = n.createLinearGradient(0, 0, this._canvas.width, 0);
    (i.addColorStop(0, "rgba(255, 255, 255, 1)"),
      i.addColorStop(0.5, "rgba(255, 255, 255, 0.5)"),
      i.addColorStop(1, "rgba(255, 255, 255, 0)"));
    const r = n.createLinearGradient(0, 0, 0, this._canvas.height);
    (r.addColorStop(0, "rgba(0, 0, 0, 0)"),
      r.addColorStop(1, "rgba(0, 0, 0, 1)"),
      n.rect(0, 0, this._canvas.width, this._canvas.height),
      (n.fillStyle = vG.Format.CSS.format(t)),
      n.fill(),
      (n.fillStyle = i),
      n.fill(),
      (n.fillStyle = r),
      n.fill());
  }
  paintSelection(e, t) {
    ((this.selection.style.left = e * this.width + "px"),
      (this.selection.style.top = this.height - t * this.height + "px"));
  }
  onDidChangeColor(e) {
    if (this.monitor && this.monitor.isMonitoring()) return;
    this.paint();
    const t = e.hsva;
    this.paintSelection(t.s, t.v);
  }
}
class Kbe extends PO {
  constructor(e) {
    (super(),
      (this._onClicked = this._register(new QO())),
      (this.onClicked = this._onClicked.event),
      (this._button = MB(e, document.createElement("button"))),
      this._button.classList.add("insert-button"),
      (this._button.textContent = "Insert"),
      this._register(
        $F(this._button, DB.CLICK, () => {
          this._onClicked.fire();
        }),
      ));
  }
  get button() {
    return this._button;
  }
}
const Gbe = VB;
class Zbe extends PO {
  constructor(e, t, n) {
    (super(),
      (this.model = t),
      (this._onDidChange = new QO()),
      (this.onDidChange = this._onDidChange.event),
      (this._onColorFlushed = new QO()),
      (this.onColorFlushed = this._onColorFlushed.event),
      "standalone" === n
        ? ((this.domNode = MB(e, Gbe(".standalone-strip"))),
          (this.overlay = MB(this.domNode, Gbe(".standalone-overlay"))))
        : ((this.domNode = MB(e, Gbe(".strip"))),
          (this.overlay = MB(this.domNode, Gbe(".overlay")))),
      (this.slider = MB(this.domNode, Gbe(".slider"))),
      (this.slider.style.top = "0px"),
      this._register($F(this.domNode, DB.POINTER_DOWN, (e) => this.onPointerDown(e))),
      this._register(t.onDidChangeColor(this.onDidChangeColor, this)),
      this.layout());
  }
  layout() {
    this.height = this.domNode.offsetHeight - this.slider.offsetHeight;
    const e = this.getValue(this.model.color);
    this.updateSliderPosition(e);
  }
  onDidChangeColor(e) {
    const t = this.getValue(e);
    this.updateSliderPosition(t);
  }
  onPointerDown(e) {
    if (!(e.target && e.target instanceof Element)) return;
    const t = this._register(new gG()),
      n = aB(this.domNode);
    (this.domNode.classList.add("grabbing"),
      e.target !== this.slider && this.onDidChangeTop(e.offsetY),
      t.startMonitoring(
        e.target,
        e.pointerId,
        e.buttons,
        (e) => this.onDidChangeTop(e.pageY - n.top),
        () => null,
      ));
    const i = $F(
      e.target.ownerDocument,
      DB.POINTER_UP,
      () => {
        (this._onColorFlushed.fire(),
          i.dispose(),
          t.stopMonitoring(!0),
          this.domNode.classList.remove("grabbing"));
      },
      !0,
    );
  }
  onDidChangeTop(e) {
    const t = Math.max(0, Math.min(1, 1 - e / this.height));
    (this.updateSliderPosition(t), this._onDidChange.fire(t));
  }
  updateSliderPosition(e) {
    this.slider.style.top = (1 - e) * this.height + "px";
  }
}
class Ybe extends Zbe {
  constructor(e, t, n) {
    (super(e, t, n),
      this.domNode.classList.add("opacity-strip"),
      this.onDidChangeColor(this.model.color));
  }
  onDidChangeColor(e) {
    super.onDidChangeColor(e);
    const { r: t, g: n, b: i } = e.rgba,
      r = new vG(new fG(t, n, i, 1)),
      o = new vG(new fG(t, n, i, 0));
    this.overlay.style.background = `linear-gradient(to bottom, ${r} 0%, ${o} 100%)`;
  }
  getValue(e) {
    return e.hsva.a;
  }
}
class Xbe extends Zbe {
  constructor(e, t, n) {
    (super(e, t, n), this.domNode.classList.add("hue-strip"));
  }
  getValue(e) {
    return 1 - e.hsva.h / 360;
  }
}
const Qbe = VB;
class Jbe extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this.model = t),
      (this.pixelRatio = n),
      (this._insertButton = null),
      (this._domNode = Qbe(".colorpicker-body")),
      MB(e, this._domNode),
      (this._saturationBox = new qbe(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 Ybe(this._domNode, this.model, i)),
      this._register(this._opacityStrip),
      this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange, this)),
      this._register(this._opacityStrip.onColorFlushed(this.flushColor, this)),
      (this._hueStrip = new Xbe(this._domNode, this.model, i)),
      this._register(this._hueStrip),
      this._register(this._hueStrip.onDidChange(this.onDidHueChange, this)),
      this._register(this._hueStrip.onColorFlushed(this.flushColor, this)),
      "standalone" === i &&
        ((this._insertButton = this._register(new Kbe(this._domNode))),
        this._domNode.classList.add("standalone-colorpicker")));
  }
  flushColor() {
    this.model.flushColor();
  }
  onDidSaturationValueChange({ s: e, v: t }) {
    const n = this.model.color.hsva;
    this.model.color = new vG(new _G(n.h, e, t, n.a));
  }
  onDidOpacityChange(e) {
    const t = this.model.color.hsva;
    this.model.color = new vG(new _G(t.h, t.s, t.v, e));
  }
  onDidHueChange(e) {
    const t = this.model.color.hsva,
      n = 360 * (1 - e);
    this.model.color = new vG(new _G(360 === n ? 0 : n, t.s, t.v, t.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());
  }
}
const eye = VB;
class tye extends PO {
  constructor(e) {
    (super(),
      (this._onClicked = this._register(new QO())),
      (this.onClicked = this._onClicked.event),
      (this._button = document.createElement("div")),
      this._button.classList.add("close-button"),
      MB(e, this._button));
    const t = document.createElement("div");
    (t.classList.add("close-button-inner-div"), MB(this._button, t));
    (MB(
      t,
      eye(
        ".button" +
          AV.asCSSSelector(
            Zle("color-picker-close", OV.close, SI(885, "Icon to close the color picker")),
          ),
      ),
    ).classList.add("close-icon"),
      this._register(
        $F(this._button, DB.CLICK, () => {
          this._onClicked.fire();
        }),
      ));
  }
}
const nye = VB;
class iye extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this.model = t),
      (this.type = i),
      (this._closeButton = null),
      (this._domNode = nye(".colorpicker-header")),
      MB(e, this._domNode),
      (this._pickedColorNode = MB(this._domNode, nye(".picked-color"))),
      MB(this._pickedColorNode, nye("span.codicon.codicon-color-mode")),
      (this._pickedColorPresentation = MB(this._pickedColorNode, document.createElement("span"))),
      this._pickedColorPresentation.classList.add("picked-color-presentation"));
    const r = SI(886, "Click to toggle color options (rgb/hsl/hex)");
    (this._pickedColorNode.setAttribute("title", r),
      (this._originalColorNode = MB(this._domNode, nye(".original-color"))),
      (this._originalColorNode.style.backgroundColor =
        vG.Format.CSS.format(this.model.originalColor) || ""),
      (this.backgroundColor = n.getColorTheme().getColor(_Z) || vG.white),
      this._register(
        n.onDidColorThemeChange((e) => {
          this.backgroundColor = e.getColor(_Z) || vG.white;
        }),
      ),
      this._register(
        $F(this._pickedColorNode, DB.CLICK, () => this.model.selectNextColorPresentation()),
      ),
      this._register(
        $F(this._originalColorNode, DB.CLICK, () => {
          ((this.model.color = this.model.originalColor), this.model.flushColor());
        }),
      ),
      this._register(t.onDidChangeColor(this.onDidChangeColor, this)),
      this._register(t.onDidChangePresentation(this.onDidChangePresentation, this)),
      (this._pickedColorNode.style.backgroundColor = vG.Format.CSS.format(t.color) || ""),
      this._pickedColorNode.classList.toggle(
        "light",
        t.color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : t.color.isLighter(),
      ),
      this.onDidChangeColor(this.model.color),
      "standalone" === this.type &&
        (this._domNode.classList.add("standalone-colorpicker"),
        (this._closeButton = this._register(new tye(this._domNode)))));
  }
  get closeButton() {
    return this._closeButton;
  }
  get pickedColorNode() {
    return this._pickedColorNode;
  }
  get originalColorNode() {
    return this._originalColorNode;
  }
  onDidChangeColor(e) {
    ((this._pickedColorNode.style.backgroundColor = vG.Format.CSS.format(e) || ""),
      this._pickedColorNode.classList.toggle(
        "light",
        e.rgba.a < 0.5 ? this.backgroundColor.isLighter() : e.isLighter(),
      ),
      this.onDidChangePresentation());
  }
  onDidChangePresentation() {
    this._pickedColorPresentation.textContent = this.model.presentation
      ? this.model.presentation.label
      : "";
  }
}
const rye = VB;
class oye extends rJ {
  constructor(e, t, n, i, r) {
    (super(),
      (this.model = t),
      (this.pixelRatio = n),
      this._register(Uq.getInstance(MF(e)).onDidChange(() => this.layout())),
      (this._domNode = rye(".colorpicker-widget")),
      e.appendChild(this._domNode),
      (this.header = this._register(new iye(this._domNode, this.model, i, r))),
      (this.body = this._register(new Jbe(this._domNode, this.model, this.pixelRatio, r))));
  }
  layout() {
    this.body.layout();
  }
  get domNode() {
    return this._domNode;
  }
}
class sye {
  get color() {
    return this._color;
  }
  set color(e) {
    this._color.equals(e) || ((this._color = e), this._onDidChangeColor.fire(e));
  }
  get presentation() {
    return this.colorPresentations[this.presentationIndex];
  }
  get colorPresentations() {
    return this._colorPresentations;
  }
  set colorPresentations(e) {
    ((this._colorPresentations = e),
      this.presentationIndex > e.length - 1 && (this.presentationIndex = 0),
      this._onDidChangePresentation.fire(this.presentation));
  }
  constructor(e, t, n) {
    ((this.presentationIndex = n),
      (this._onColorFlushed = new QO()),
      (this.onColorFlushed = this._onColorFlushed.event),
      (this._onDidChangeColor = new QO()),
      (this.onDidChangeColor = this._onDidChangeColor.event),
      (this._onDidChangePresentation = new QO()),
      (this.onDidChangePresentation = this._onDidChangePresentation.event),
      (this.originalColor = e),
      (this._color = e),
      (this._colorPresentations = t));
  }
  selectNextColorPresentation() {
    ((this.presentationIndex = (this.presentationIndex + 1) % this.colorPresentations.length),
      this.flushColor(),
      this._onDidChangePresentation.fire(this.presentation));
  }
  guessColorPresentation(e, t) {
    let n = -1;
    for (let i = 0; i < this.colorPresentations.length; i++)
      if (t.toLowerCase() === this.colorPresentations[i].label) {
        n = i;
        break;
      }
    if (-1 === n) {
      const e = t.split("(")[0].toLowerCase();
      for (let t = 0; t < this.colorPresentations.length; t++)
        if (this.colorPresentations[t].label.toLowerCase().startsWith(e)) {
          n = t;
          break;
        }
    }
    -1 !== n &&
      n !== this.presentationIndex &&
      ((this.presentationIndex = n), this._onDidChangePresentation.fire(this.presentation));
  }
  flushColor() {
    this._onColorFlushed.fire(this._color);
  }
}
async function aye(e, t, n) {
  const i = e.getValueInRange(t.range),
    { red: r, green: o, blue: s, alpha: a } = t.color,
    l = new fG(Math.round(255 * r), Math.round(255 * o), Math.round(255 * s), a),
    c = new vG(l),
    d = await Rme(e, t, n, aM.None),
    u = new sye(c, [], 0);
  return (
    (u.colorPresentations = d || []),
    u.guessColorPresentation(c, i),
    { range: YH.lift(t.range), model: u, provider: n }
  );
}
function lye(e, t, n) {
  const i = [],
    r = n.presentation.textEdit ?? { range: t, text: n.presentation.label, forceMoveMarkers: !1 };
  (i.push(r), n.presentation.additionalTextEdits && i.push(...n.presentation.additionalTextEdits));
  const o = YH.lift(r.range),
    s = e.getModel()._setTrackedRange(null, o, 3);
  return (
    e.executeEdits("colorpicker", i),
    e.pushUndoStop(),
    e.getModel()._getTrackedRange(s) ?? o
  );
}
async function cye(e, t, n, i, r) {
  const o = await Rme(
    e,
    {
      range: i,
      color: { red: n.rgba.r / 255, green: n.rgba.g / 255, blue: n.rgba.b / 255, alpha: n.rgba.a },
    },
    r.provider,
    aM.None,
  );
  t.colorPresentations = o || [];
}
class dye {
  constructor(e, t, n, i) {
    ((this.owner = e),
      (this.range = t),
      (this.model = n),
      (this.provider = i),
      (this.forceShowAtRange = !0));
  }
  isValidForHoverAnchor(e) {
    return (
      1 === e.type &&
      this.range.startColumn <= e.range.startColumn &&
      this.range.endColumn >= e.range.endColumn
    );
  }
  static fromBaseColor(e, t) {
    return new dye(e, t.range, t.model, t.provider);
  }
}
let uye = class {
  constructor(e, t) {
    ((this._editor = e), (this._themeService = t), (this.hoverOrdinal = 2));
  }
  computeSync(e, t, n) {
    return [];
  }
  computeAsync(e, t, n, i) {
    return OM.fromPromise(this._computeAsync(e, t, n));
  }
  async _computeAsync(e, t, n) {
    if (!this._editor.hasModel()) return [];
    if (!this._isValidRequest(n)) return [];
    const i = Wme.get(this._editor);
    if (!i) return [];
    for (const r of t) {
      if (!i.isColorDecoration(r)) continue;
      const e = i.getColorData(r.range.getStartPosition());
      if (e) {
        return [
          dye.fromBaseColor(this, await aye(this._editor.getModel(), e.colorInfo, e.provider)),
        ];
      }
    }
    return [];
  }
  _isValidRequest(e) {
    const t = this._editor.getOption(168);
    switch (e) {
      case 0:
        return "hover" === t || "clickAndHover" === t;
      case 1:
        return "click" === t || "clickAndHover" === t;
      case 2:
        return !0;
    }
  }
  renderHoverParts(e, t) {
    const n = this._editor;
    if (0 === t.length || !n.hasModel()) return new kme([]);
    const i = n.getOption(75) + 8;
    e.setMinimumDimensions(new oB(302, i));
    const r = new AO(),
      o = t[0],
      s = n.getModel(),
      a = o.model;
    this._colorPicker = r.add(
      new oye(e.fragment, a, n.getOption(163), this._themeService, "hover"),
    );
    let l = !1,
      c = new YH(
        o.range.startLineNumber,
        o.range.startColumn,
        o.range.endLineNumber,
        o.range.endColumn,
      );
    (r.add(
      a.onColorFlushed(async (e) => {
        (await cye(s, a, e, c, o), (l = !0), (c = lye(n, c, a)));
      }),
    ),
      r.add(
        a.onDidChangeColor((e) => {
          cye(s, a, e, c, o);
        }),
      ),
      r.add(
        n.onDidChangeModelContent((t) => {
          l ? (l = !1) : (e.hide(), n.focus());
        }),
      ));
    const d = {
      hoverPart: dye.fromBaseColor(this, o),
      hoverElement: this._colorPicker.domNode,
      dispose() {
        r.dispose();
      },
    };
    return new kme([d]);
  }
  getAccessibleContent(e) {
    return SI(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;
  }
};
uye = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, h0),
  ],
  uye,
);
class hye {
  static insert(e, t) {
    return {
      range: new YH(e.lineNumber, e.column, e.lineNumber, e.column),
      text: t,
      forceMoveMarkers: !0,
    };
  }
  static delete(e) {
    return { range: e, text: null };
  }
  static replace(e, t) {
    return { range: e, text: t };
  }
  static replaceMove(e, t) {
    return { range: e, text: t, forceMoveMarkers: !0 };
  }
}
function gye(e, t) {
  return !!e[t];
}
class pye {
  constructor(e, t) {
    ((this.target = e.target),
      (this.isLeftClick = e.event.leftButton),
      (this.isMiddleClick = e.event.middleButton),
      (this.isRightClick = e.event.rightButton),
      (this.mouseMiddleClickAction = t.mouseMiddleClickAction),
      (this.hasTriggerModifier = gye(e.event, t.triggerModifier)),
      this.isMiddleClick &&
        "ctrlLeftClick" === t.mouseMiddleClickAction &&
        ((this.isMiddleClick = !1), (this.isLeftClick = !0), (this.hasTriggerModifier = !0)),
      (this.hasSideBySideModifier = gye(e.event, t.triggerSideBySideModifier)),
      (this.isNoneOrSingleMouseDown = e.event.detail <= 1));
  }
}
class fye {
  constructor(e, t) {
    ((this.keyCodeIsTriggerKey = e.keyCode === t.triggerKey),
      (this.keyCodeIsSideBySideKey = e.keyCode === t.triggerSideBySideKey),
      (this.hasTriggerModifier = gye(e, t.triggerModifier)));
  }
}
class mye {
  constructor(e, t, n, i, r) {
    ((this.mouseMiddleClickAction = r),
      (this.triggerKey = e),
      (this.triggerModifier = t),
      (this.triggerSideBySideKey = n),
      (this.triggerSideBySideModifier = i));
  }
  equals(e) {
    return (
      this.triggerKey === e.triggerKey &&
      this.triggerModifier === e.triggerModifier &&
      this.triggerSideBySideKey === e.triggerSideBySideKey &&
      this.triggerSideBySideModifier === e.triggerSideBySideModifier &&
      this.mouseMiddleClickAction === e.mouseMiddleClickAction
    );
  }
}
function _ye(e, t) {
  return "altKey" === e
    ? PR
      ? new mye(57, "metaKey", 6, "altKey", t)
      : new mye(5, "ctrlKey", 6, "altKey", t)
    : PR
      ? new mye(6, "altKey", 57, "metaKey", t)
      : new mye(6, "altKey", 5, "ctrlKey", t);
}
class vye extends PO {
  constructor(e, t) {
    (super(),
      (this._onMouseMoveOrRelevantKeyDown = this._register(new QO())),
      (this.onMouseMoveOrRelevantKeyDown = this._onMouseMoveOrRelevantKeyDown.event),
      (this._onExecute = this._register(new QO())),
      (this.onExecute = this._onExecute.event),
      (this._onCancel = this._register(new QO())),
      (this.onCancel = this._onCancel.event),
      (this._editor = e),
      (this._extractLineNumberFromMouseEvent =
        t?.extractLineNumberFromMouseEvent ??
        ((e) => (e.target.position ? e.target.position.lineNumber : 0))),
      (this._opts = _ye(this._editor.getOption(86), this._editor.getOption(87))),
      (this._lastMouseMoveEvent = null),
      (this._hasTriggerKeyOnMouseDown = !1),
      (this._lineNumberOnMouseDown = 0),
      this._register(
        this._editor.onDidChangeConfiguration((e) => {
          if (e.hasChanged(86) || e.hasChanged(87)) {
            const e = _ye(this._editor.getOption(86), this._editor.getOption(87));
            if (this._opts.equals(e)) return;
            ((this._opts = e),
              (this._lastMouseMoveEvent = null),
              (this._hasTriggerKeyOnMouseDown = !1),
              (this._lineNumberOnMouseDown = 0),
              this._onCancel.fire());
          }
        }),
      ),
      this._register(
        this._editor.onMouseMove((e) => this._onEditorMouseMove(new pye(e, this._opts))),
      ),
      this._register(
        this._editor.onMouseDown((e) => this._onEditorMouseDown(new pye(e, this._opts))),
      ),
      this._register(this._editor.onMouseUp((e) => this._onEditorMouseUp(new pye(e, this._opts)))),
      this._register(this._editor.onKeyDown((e) => this._onEditorKeyDown(new fye(e, this._opts)))),
      this._register(this._editor.onKeyUp((e) => this._onEditorKeyUp(new fye(e, this._opts)))),
      this._register(this._editor.onMouseDrag(() => this._resetHandler())),
      this._register(
        this._editor.onDidChangeCursorSelection((e) => this._onDidChangeCursorSelection(e)),
      ),
      this._register(this._editor.onDidChangeModel((e) => this._resetHandler())),
      this._register(this._editor.onDidChangeModelContent(() => this._resetHandler())),
      this._register(
        this._editor.onDidScrollChange((e) => {
          (e.scrollTopChanged || e.scrollLeftChanged) && this._resetHandler();
        }),
      ));
  }
  _onDidChangeCursorSelection(e) {
    e.selection && e.selection.startColumn !== e.selection.endColumn && this._resetHandler();
  }
  _onEditorMouseMove(e) {
    ((this._lastMouseMoveEvent = e), this._onMouseMoveOrRelevantKeyDown.fire([e, null]));
  }
  _onEditorMouseDown(e) {
    ((this._hasTriggerKeyOnMouseDown = e.hasTriggerModifier),
      (this._lineNumberOnMouseDown = this._extractLineNumberFromMouseEvent(e)));
  }
  _onEditorMouseUp(e) {
    const t = this._extractLineNumberFromMouseEvent(e);
    !!this._lineNumberOnMouseDown &&
      this._lineNumberOnMouseDown === t &&
      (this._hasTriggerKeyOnMouseDown ||
        (e.isMiddleClick && "openLink" === e.mouseMiddleClickAction)) &&
      this._onExecute.fire(e);
  }
  _onEditorKeyDown(e) {
    this._lastMouseMoveEvent &&
    (e.keyCodeIsTriggerKey || (e.keyCodeIsSideBySideKey && e.hasTriggerModifier))
      ? this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent, e])
      : e.hasTriggerModifier && this._onCancel.fire();
  }
  _onEditorKeyUp(e) {
    e.keyCodeIsTriggerKey && this._onCancel.fire();
  }
  _resetHandler() {
    ((this._lastMouseMoveEvent = null),
      (this._hasTriggerKeyOnMouseDown = !1),
      this._onCancel.fire());
  }
}
class bye {
  constructor(e, t) {
    ((this.range = e), (this.direction = t));
  }
}
class yye {
  constructor(e, t, n) {
    ((this.hint = e), (this.anchor = t), (this.provider = n), (this._isResolved = !1));
  }
  with(e) {
    const t = new yye(this.hint, e.anchor, this.provider);
    return ((t._isResolved = this._isResolved), (t._currentResolve = this._currentResolve), t);
  }
  async resolve(e) {
    if ("function" == typeof this.provider.resolveInlayHint) {
      if (this._currentResolve) {
        if ((await this._currentResolve, e.isCancellationRequested)) return;
        return this.resolve(e);
      }
      (this._isResolved ||
        (this._currentResolve = this._doResolve(e).finally(() => (this._currentResolve = void 0))),
        await this._currentResolve);
    }
  }
  async _doResolve(e) {
    try {
      const t = await Promise.resolve(this.provider.resolveInlayHint(this.hint, e));
      ((this.hint.tooltip = t?.tooltip ?? this.hint.tooltip),
        (this.hint.label = t?.label ?? this.hint.label),
        (this.hint.textEdits = t?.textEdits ?? this.hint.textEdits),
        (this._isResolved = !0));
    } catch (t) {
      (zI(t), (this._isResolved = !1));
    }
  }
}
class xye {
  static {
    this._emptyInlayHintList = Object.freeze({ dispose() {}, hints: [] });
  }
  static async create(e, t, n, i) {
    const r = [],
      o = e
        .ordered(t)
        .reverse()
        .map((e) =>
          n.map(async (n) => {
            try {
              const o = await e.provideInlayHints(t, n, i);
              (o?.hints.length || e.onDidChangeInlayHints) &&
                r.push([o ?? xye._emptyInlayHintList, e]);
            } catch (o) {
              zI(o);
            }
          }),
        );
    if ((await Promise.all(o.flat()), i.isCancellationRequested || t.isDisposed())) throw new KI();
    return new xye(n, r, t);
  }
  constructor(e, t, n) {
    ((this._disposables = new AO()), (this.ranges = e), (this.provider = new Set()));
    const i = [];
    for (const [r, o] of t) {
      (this._disposables.add(r), this.provider.add(o));
      for (const e of r.hints) {
        const t = n.validatePosition(e.position);
        let r = "before";
        const s = xye._getRangeAtPosition(n, t);
        let a;
        (s.getStartPosition().isBefore(t)
          ? ((a = YH.fromPositions(s.getStartPosition(), t)), (r = "after"))
          : ((a = YH.fromPositions(t, s.getEndPosition())), (r = "before")),
          i.push(new yye(e, new bye(a, r), o)));
      }
    }
    this.items = i.sort((e, t) => xV.compare(e.hint.position, t.hint.position));
  }
  dispose() {
    this._disposables.dispose();
  }
  static _getRangeAtPosition(e, t) {
    const n = t.lineNumber,
      i = e.getWordAtPosition(t);
    if (i) return new YH(n, i.startColumn, n, i.endColumn);
    e.tokenization.tokenizeIfCheap(n);
    const r = e.tokenization.getLineTokens(n),
      o = t.column - 1,
      s = r.findTokenIndexAtOffset(o);
    let a = r.getStartOffset(s),
      l = r.getEndOffset(s);
    return (
      l - a === 1 &&
        (a === o && s > 1
          ? ((a = r.getStartOffset(s - 1)), (l = r.getEndOffset(s - 1)))
          : l === o &&
            s < r.getCount() - 1 &&
            ((a = r.getStartOffset(s + 1)), (l = r.getEndOffset(s + 1)))),
      new YH(n, a + 1, n, l + 1)
    );
  }
}
function wye(e) {
  return !(!e || "function" != typeof e.getEditorType) && e.getEditorType() === X3.ICodeEditor;
}
function Cye(e) {
  return !(!e || "function" != typeof e.getEditorType) && e.getEditorType() === X3.IDiffEditor;
}
function Sye(e) {
  return wye(e)
    ? e
    : Cye(e)
      ? e.getModifiedEditor()
      : (function (e) {
            return !!e && "object" == typeof e && "function" == typeof e.onDidChangeActiveEditor;
          })(e) && wye(e.activeCodeEditor)
        ? e.activeCodeEditor
        : null;
}
var kye = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let Eye = class extends ane {
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h) {
    (super(
      e,
      { ...i.getRawOptions(), overflowWidgetsDomNode: i.getOverflowWidgetsDomNode() },
      n,
      r,
      o,
      s,
      a,
      l,
      c,
      d,
      u,
      h,
    ),
      (this._parentEditor = i),
      (this._overwriteOptions = t),
      super.updateOptions(this._overwriteOptions),
      this._register(i.onDidChangeConfiguration((e) => this._onParentConfigurationChanged(e))));
  }
  getParentEditor() {
    return this._parentEditor;
  }
  _onParentConfigurationChanged(e) {
    (super.updateOptions(this._parentEditor.getRawOptions()),
      super.updateOptions(this._overwriteOptions));
  }
  updateOptions(e) {
    (Hz(this._overwriteOptions, e, !0), super.updateOptions(this._overwriteOptions));
  }
};
function Nye(e) {
  const t = e.get(yV).getFocusedCodeEditor();
  return t instanceof Eye ? t.getParentEditor() : t;
}
Eye = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    kye(4, vV),
    kye(5, yV),
    kye(6, PV),
    kye(7, xW),
    kye(8, h0),
    kye(9, Y4),
    kye(10, KK),
    kye(11, f$),
    kye(12, mee),
  ],
  Eye,
);
const Lye = new vG(new fG(0, 122, 204)),
  Dye = {
    showArrow: !0,
    showFrame: !0,
    className: "",
    frameColor: Lye,
    arrowColor: Lye,
    keepEditorSelection: !1,
  };
class Tye {
  constructor(e, t, n, i, r, o, s, a) {
    ((this.id = ""),
      (this.domNode = e),
      (this.afterLineNumber = t),
      (this.afterColumn = n),
      (this.heightInLines = i),
      (this.showInHiddenAreas = s),
      (this.ordinal = a),
      (this._onDomNodeTop = r),
      (this._onComputedHeight = o));
  }
  onDomNodeTop(e) {
    this._onDomNodeTop(e);
  }
  onComputedHeight(e) {
    this._onComputedHeight(e);
  }
}
class Iye {
  constructor(e, t) {
    ((this._id = e), (this._domNode = t));
  }
  getId() {
    return this._id;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return null;
  }
}
let Rye = class e {
  static {
    this._IdGenerator = new dre(".arrow-decoration-");
  }
  constructor(t) {
    ((this._editor = t),
      (this._ruleName = e._IdGenerator.nextId()),
      (this._color = null),
      (this._height = -1),
      (this._decorations = this._editor.createDecorationsCollection()));
  }
  dispose() {
    (this.hide(), dG(this._ruleName));
  }
  set color(e) {
    this._color !== e && ((this._color = e), this._updateStyle());
  }
  set height(e) {
    this._height !== e && ((this._height = e), this._updateStyle());
  }
  _updateStyle() {
    (dG(this._ruleName),
      cG(
        `.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(e) {
    (1 === e.column && (e = { lineNumber: e.lineNumber, column: 2 }),
      this._decorations.set([
        {
          range: YH.fromPositions(e),
          options: { description: "zone-widget-arrow", className: this._ruleName, stickiness: 1 },
        },
      ]));
  }
  hide() {
    this._decorations.clear();
  }
};
class Oye {
  constructor(e, t = {}) {
    ((this._arrow = null),
      (this._overlayWidget = null),
      (this._resizeSash = null),
      (this._isSashResizeHeight = !1),
      (this._viewZone = null),
      (this._disposables = new AO()),
      (this.container = null),
      (this._isShowing = !1),
      (this.editor = e),
      (this._positionMarkerId = this.editor.createDecorationsCollection()),
      (this.options = Fz(t)),
      Hz(this.options, Dye, !1),
      (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((e) => {
          const t = this._getWidth(e);
          ((this.domNode.style.width = t + "px"),
            (this.domNode.style.left = this._getLeft(e) + "px"),
            this._onWidth(t));
        }),
      ));
  }
  dispose() {
    (this._overlayWidget &&
      (this.editor.removeOverlayWidget(this._overlayWidget), (this._overlayWidget = null)),
      this._viewZone &&
        this.editor.changeViewZones((e) => {
          (this._viewZone && e.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 Rye(this.editor)), this._disposables.add(this._arrow)),
      this._fillContainer(this.container),
      this._initSash(),
      this._applyStyles());
  }
  style(e) {
    (e.frameColor && (this.options.frameColor = e.frameColor),
      e.arrowColor && (this.options.arrowColor = e.arrowColor),
      this._applyStyles());
  }
  _applyStyles() {
    if (this.container && this.options.frameColor) {
      const e = this.options.frameColor.toString();
      ((this.container.style.borderTopColor = e), (this.container.style.borderBottomColor = e));
    }
    if (this._arrow && this.options.arrowColor) {
      const e = this.options.arrowColor.toString();
      this._arrow.color = e;
    }
  }
  _getWidth(e) {
    return e.width - e.minimap.minimapWidth - e.verticalScrollbarWidth;
  }
  _getLeft(e) {
    return e.minimap.minimapWidth > 0 && 0 === e.minimap.minimapLeft ? e.minimap.minimapWidth : 0;
  }
  _onViewZoneTop(e) {
    this.domNode.style.top = e + "px";
  }
  _onViewZoneHeight(e) {
    if (((this.domNode.style.height = `${e}px`), this.container)) {
      const t = e - this._decoratingElementsHeight();
      this.container.style.height = `${t}px`;
      const n = this.editor.getLayoutInfo();
      this._doLayout(t, this._getWidth(n));
    }
    this._resizeSash?.layout();
  }
  get position() {
    const e = this._positionMarkerId.getRange(0);
    if (e) return e.getStartPosition();
  }
  show(e, t) {
    const n = YH.isIRange(e) ? YH.lift(e) : YH.fromPositions(e);
    ((this._isShowing = !0),
      this._showImpl(n, t),
      (this._isShowing = !1),
      this._positionMarkerId.set([{ range: n, options: cee.EMPTY }]));
  }
  hide() {
    (this._viewZone &&
      (this.editor.changeViewZones((e) => {
        this._viewZone && e.removeZone(this._viewZone.id);
      }),
      (this._viewZone = null)),
      this._overlayWidget &&
        (this.editor.removeOverlayWidget(this._overlayWidget), (this._overlayWidget = null)),
      this._arrow?.hide(),
      this._positionMarkerId.clear(),
      (this._isSashResizeHeight = !1));
  }
  _decoratingElementsHeight() {
    const e = this.editor.getOption(75);
    let t = 0;
    if (this.options.showArrow) {
      t += 2 * Math.round(e / 3);
    }
    if (this.options.showFrame) {
      t += 2 * (this.options.frameWidth ?? Math.round(e / 9));
    }
    return t;
  }
  _getMaximumHeightInLines() {
    return Math.max(12, (this.editor.getLayoutInfo().height / this.editor.getOption(75)) * 0.8);
  }
  _showImpl(e, t) {
    const n = e.getStartPosition(),
      i = this.editor.getLayoutInfo(),
      r = this._getWidth(i);
    ((this.domNode.style.width = `${r}px`), (this.domNode.style.left = this._getLeft(i) + "px"));
    const o = document.createElement("div");
    o.style.overflow = "hidden";
    const s = this.editor.getOption(75),
      a = this._getMaximumHeightInLines();
    void 0 !== a && (t = Math.min(t, a));
    let l = 0,
      c = 0;
    if (
      (this._arrow &&
        this.options.showArrow &&
        ((l = Math.round(s / 3)), (this._arrow.height = l), this._arrow.show(n)),
      this.options.showFrame && (c = Math.round(s / 9)),
      this.editor.changeViewZones((e) => {
        (this._viewZone && e.removeZone(this._viewZone.id),
          this._overlayWidget &&
            (this.editor.removeOverlayWidget(this._overlayWidget), (this._overlayWidget = null)),
          (this.domNode.style.top = "-1000px"),
          (this._viewZone = new Tye(
            o,
            n.lineNumber,
            n.column,
            t,
            (e) => this._onViewZoneTop(e),
            (e) => this._onViewZoneHeight(e),
            this.options.showInHiddenAreas,
            this.options.ordinal,
          )),
          (this._viewZone.id = e.addZone(this._viewZone)),
          (this._overlayWidget = new Iye(
            "vs.editor.contrib.zoneWidget" + this._viewZone.id,
            this.domNode,
          )),
          this.editor.addOverlayWidget(this._overlayWidget));
      }),
      this._updateSashEnablement(),
      this.container && this.options.showFrame)
    ) {
      const e = this.options.frameWidth ? this.options.frameWidth : c;
      ((this.container.style.borderTopWidth = e + "px"),
        (this.container.style.borderBottomWidth = e + "px"));
    }
    const d = t * s - this._decoratingElementsHeight();
    (this.container &&
      ((this.container.style.top = l + "px"),
      (this.container.style.height = d + "px"),
      (this.container.style.overflow = "hidden")),
      this._doLayout(d, r),
      this.options.keepEditorSelection || this.editor.setSelection(e));
    const u = this.editor.getModel();
    if (u) {
      const t = u.validateRange(new YH(e.startLineNumber, 1, e.endLineNumber + 1, 1));
      this.revealRange(t, t.startLineNumber === u.getLineCount());
    }
  }
  revealRange(e, t) {
    t ? this.editor.revealLineNearTop(e.endLineNumber, 0) : this.editor.revealRange(e, 0);
  }
  setCssClass(e, t) {
    this.container && (t && this.container.classList.remove(t), this.container.classList.add(e));
  }
  _onWidth(e) {}
  _doLayout(e, t) {}
  _relayout(e, t) {
    const n = this._getMaximumHeightInLines(),
      i = t && void 0 !== n ? Math.min(n, e) : e;
    this._viewZone &&
      this._viewZone.heightInLines !== i &&
      (this.editor.changeViewZones((e) => {
        this._viewZone && ((this._viewZone.heightInLines = i), e.layoutZone(this._viewZone.id));
      }),
      this._updateSashEnablement());
  }
  _initSash() {
    if (this._resizeSash) return;
    let e;
    ((this._resizeSash = this._disposables.add(new Ade(this.domNode, this, { orientation: 1 }))),
      this.options.isResizeable || (this._resizeSash.state = 0),
      this._disposables.add(
        this._resizeSash.onDidStart((t) => {
          this._viewZone &&
            (e = {
              startY: t.startY,
              heightInLines: this._viewZone.heightInLines,
              ...this._getResizeBounds(),
            });
        }),
      ),
      this._disposables.add(
        this._resizeSash.onDidEnd(() => {
          e = void 0;
        }),
      ),
      this._disposables.add(
        this._resizeSash.onDidChange((t) => {
          if (e) {
            const n = (t.currentY - e.startY) / this.editor.getOption(75),
              i = n < 0 ? Math.ceil(n) : Math.floor(n),
              r = e.heightInLines + i;
            r > e.minLines &&
              r < e.maxLines &&
              ((this._isSashResizeHeight = !0), this._relayout(r));
          }
        }),
      ));
  }
  _updateSashEnablement() {
    if (this._resizeSash) {
      const { minLines: e, maxLines: t } = this._getResizeBounds();
      this._resizeSash.state = e === t ? 0 : 3;
    }
  }
  _getResizeBounds() {
    return { minLines: 5, maxLines: 35 };
  }
  getHorizontalSashLeft() {
    return 0;
  }
  getHorizontalSashTop() {
    return (
      (null === this.domNode.style.height ? 0 : parseInt(this.domNode.style.height)) -
      this._decoratingElementsHeight() / 2
    );
  }
  getHorizontalSashWidth() {
    const e = this.editor.getLayoutInfo();
    return e.width - e.minimap.minimapWidth;
  }
}
var Mye = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Aye = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const Pye = bV("IPeekViewService");
var jye;
(HU(
  Pye,
  class {
    constructor() {
      this._widgets = new Map();
    }
    addExclusiveWidget(e, t) {
      const n = this._widgets.get(e);
      n && (n.listener.dispose(), n.widget.dispose());
      this._widgets.set(e, {
        widget: t,
        listener: t.onDidClose(() => {
          const n = this._widgets.get(e);
          n && n.widget === t && (n.listener.dispose(), this._widgets.delete(e));
        }),
      });
    }
  },
  1,
),
  (function (e) {
    ((e.inPeekEditor = new yW(
      "inReferenceSearchEditor",
      !0,
      SI(1316, "Whether the current code editor is embedded inside peek"),
    )),
      (e.notInPeekEditor = e.inPeekEditor.toNegated()));
  })(jye || (jye = {})));
let Fye = class {
  static {
    this.ID = "editor.contrib.referenceController";
  }
  constructor(e, t) {
    e instanceof Eye && jye.inPeekEditor.bindTo(t);
  }
  dispose() {}
};
((Fye = Mye([Aye(1, xW)], Fye)), zH(Fye.ID, Fye, 0));
const Bye = {
  headerBackgroundColor: vG.white,
  primaryHeadingColor: vG.fromHex("#333333"),
  secondaryHeadingColor: vG.fromHex("#6c6c6cb3"),
};
let Vye = class extends Oye {
  constructor(e, t, n) {
    (super(e, t),
      (this.instantiationService = n),
      (this._onDidClose = new QO()),
      (this.onDidClose = this._onDidClose.event),
      Hz(this.options, Bye, !1));
    const i = xde(this.editor);
    i.openedPeekWidgets.set(i.openedPeekWidgets.get() + 1, void 0);
  }
  dispose() {
    if (!this.disposed) {
      ((this.disposed = !0), super.dispose(), this._onDidClose.fire(this));
      const e = xde(this.editor);
      e.openedPeekWidgets.set(e.openedPeekWidgets.get() - 1, void 0);
    }
  }
  style(e) {
    const t = this.options;
    (e.headerBackgroundColor && (t.headerBackgroundColor = e.headerBackgroundColor),
      e.primaryHeadingColor && (t.primaryHeadingColor = e.primaryHeadingColor),
      e.secondaryHeadingColor && (t.secondaryHeadingColor = e.secondaryHeadingColor),
      super.style(e));
  }
  _applyStyles() {
    super._applyStyles();
    const e = this.options;
    (this._headElement &&
      e.headerBackgroundColor &&
      (this._headElement.style.backgroundColor = e.headerBackgroundColor.toString()),
      this._primaryHeading &&
        e.primaryHeadingColor &&
        (this._primaryHeading.style.color = e.primaryHeadingColor.toString()),
      this._secondaryHeading &&
        e.secondaryHeadingColor &&
        (this._secondaryHeading.style.color = e.secondaryHeadingColor.toString()),
      this._bodyElement &&
        e.frameColor &&
        (this._bodyElement.style.borderColor = e.frameColor.toString()));
  }
  _fillContainer(e) {
    (this.setCssClass("peekview-widget"),
      (this._headElement = VB(".head")),
      (this._bodyElement = VB(".body")),
      this._fillHead(this._headElement),
      this._fillBody(this._bodyElement),
      e.appendChild(this._headElement),
      e.appendChild(this._bodyElement));
  }
  _fillHead(e, t) {
    ((this._titleElement = VB(".peekview-title")),
      this.options.supportOnTitleClick &&
        (this._titleElement.classList.add("clickable"),
        KF(this._titleElement, "click", (e) => this._onTitleClick(e))),
      MB(this._headElement, this._titleElement),
      this._fillTitleIcon(this._titleElement),
      (this._primaryHeading = VB("span.filename")),
      (this._secondaryHeading = VB("span.dirname")),
      (this._metaHeading = VB("span.meta")),
      MB(this._titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading));
    const n = VB(".peekview-actions");
    MB(this._headElement, n);
    const i = this._getActionBarOptions();
    ((this._actionbarWidget = new Cle(n, i)),
      this._disposables.add(this._actionbarWidget),
      t ||
        this._actionbarWidget.push(
          this._disposables.add(
            new SV(
              "peekview.close",
              SI(1317, "Close"),
              AV.asClassName(OV.close),
              !0,
              () => (this.dispose(), Promise.resolve()),
            ),
          ),
          { label: !1, icon: !0 },
        ));
  }
  _fillTitleIcon(e) {}
  _getActionBarOptions() {
    return { actionViewItemProvider: Oue.bind(void 0, this.instantiationService), orientation: 0 };
  }
  _onTitleClick(e) {}
  setTitle(e, t) {
    this._primaryHeading &&
      this._secondaryHeading &&
      ((this._primaryHeading.innerText = e),
      this._primaryHeading.setAttribute("title", e),
      t ? (this._secondaryHeading.innerText = t) : zF(this._secondaryHeading));
  }
  setMetaTitle(e) {
    this._metaHeading &&
      (e ? ((this._metaHeading.innerText = e), WB(this._metaHeading)) : HB(this._metaHeading));
  }
  _doLayout(e, t) {
    if (!this._isShowing && e < 0) return void this.dispose();
    const n = Math.ceil(1.2 * this.editor.getOption(75)),
      i = Math.round(e - (n + 1));
    (this._doLayoutHead(n, t), this._doLayoutBody(i, t));
  }
  _doLayoutHead(e, t) {
    this._headElement &&
      ((this._headElement.style.height = `${e}px`),
      (this._headElement.style.lineHeight = this._headElement.style.height));
  }
  _doLayoutBody(e, t) {
    this._bodyElement && (this._bodyElement.style.height = `${e}px`);
  }
};
Vye = Mye([Aye(2, vV)], Vye);
const Wye = SG(
    "peekViewTitle.background",
    { dark: "#252526", light: "#F3F3F3", hcDark: vG.black, hcLight: vG.white },
    SI(1318, "Background color of the peek view title area."),
  ),
  Hye = SG(
    "peekViewTitleLabel.foreground",
    { dark: vG.white, light: vG.black, hcDark: vG.white, hcLight: ZG },
    SI(1319, "Color of the peek view title."),
  ),
  zye = SG(
    "peekViewTitleDescription.foreground",
    { dark: "#ccccccb3", light: "#616161", hcDark: "#FFFFFF99", hcLight: "#292929" },
    SI(1320, "Color of the peek view title info."),
  ),
  Uye = SG(
    "peekView.border",
    { dark: rZ, light: rZ, hcDark: FG, hcLight: FG },
    SI(1321, "Color of the peek view borders and arrow."),
  ),
  $ye = SG(
    "peekViewResult.background",
    { dark: "#252526", light: "#F3F3F3", hcDark: vG.black, hcLight: vG.white },
    SI(1322, "Background color of the peek view result list."),
  );
(SG(
  "peekViewResult.lineForeground",
  { dark: "#bbbbbb", light: "#646465", hcDark: vG.white, hcLight: ZG },
  SI(1323, "Foreground color for line nodes in the peek view result list."),
),
  SG(
    "peekViewResult.fileForeground",
    { dark: vG.white, light: "#1E1E1E", hcDark: vG.white, hcLight: ZG },
    SI(1324, "Foreground color for file nodes in the peek view result list."),
  ),
  SG(
    "peekViewResult.selectionBackground",
    { dark: "#3399ff33", light: "#3399ff33", hcDark: null, hcLight: null },
    SI(1325, "Background color of the selected entry in the peek view result list."),
  ),
  SG(
    "peekViewResult.selectionForeground",
    { dark: vG.white, light: "#6C6C6C", hcDark: vG.white, hcLight: ZG },
    SI(1326, "Foreground color of the selected entry in the peek view result list."),
  ));
const qye = SG(
  "peekViewEditor.background",
  { dark: "#001F33", light: "#F2F8FC", hcDark: vG.black, hcLight: vG.white },
  SI(1327, "Background color of the peek view editor."),
);
(SG(
  "peekViewEditorGutter.background",
  qye,
  SI(1328, "Background color of the gutter in the peek view editor."),
),
  SG(
    "peekViewEditorStickyScroll.background",
    qye,
    SI(1329, "Background color of sticky scroll in the peek view editor."),
  ),
  SG(
    "peekViewEditorStickyScrollGutter.background",
    qye,
    SI(1330, "Background color of the gutter part of sticky scroll in the peek view editor."),
  ),
  SG(
    "peekViewResult.matchHighlightBackground",
    { dark: "#ea5c004d", light: "#ea5c004d", hcDark: null, hcLight: null },
    SI(1331, "Match highlight color in the peek view result list."),
  ),
  SG(
    "peekViewEditor.matchHighlightBackground",
    { dark: "#ff8f0099", light: "#f5d802de", hcDark: null, hcLight: null },
    SI(1332, "Match highlight color in the peek view editor."),
  ),
  SG(
    "peekViewEditor.matchHighlightBorder",
    { dark: null, light: null, hcDark: BG, hcLight: BG },
    SI(1333, "Match highlight border in the peek view editor."),
  ));
class Kye {
  get templateId() {
    return this.renderer.templateId;
  }
  constructor(e, t) {
    ((this.renderer = e), (this.modelProvider = t));
  }
  renderTemplate(e) {
    return { data: this.renderer.renderTemplate(e), disposable: PO.None };
  }
  renderElement(e, t, n, i) {
    if ((n.disposable?.dispose(), !n.data)) return;
    const r = this.modelProvider();
    if (r.isResolved(e)) return this.renderer.renderElement(r.get(e), e, n.data, i);
    const o = new cM(),
      s = r.resolve(e, o.token);
    ((n.disposable = { dispose: () => o.cancel() }),
      this.renderer.renderPlaceholder(e, n.data),
      s.then((t) => this.renderer.renderElement(t, e, n.data, i)));
  }
  disposeTemplate(e) {
    (e.disposable && (e.disposable.dispose(), (e.disposable = void 0)),
      e.data && (this.renderer.disposeTemplate(e.data), (e.data = void 0)));
  }
}
class Gye {
  constructor(e, t) {
    ((this.modelProvider = e), (this.accessibilityProvider = t));
  }
  getWidgetAriaLabel() {
    return this.accessibilityProvider.getWidgetAriaLabel();
  }
  getAriaLabel(e) {
    const t = this.modelProvider();
    return t.isResolved(e) ? this.accessibilityProvider.getAriaLabel(t.get(e)) : null;
  }
}
class Zye {
  constructor(e, t, n, i, r = {}) {
    this.modelDisposables = new AO();
    const o = () => this.model,
      s = i.map((e) => new Kye(e, o));
    this.list = new gle(
      e,
      t,
      n,
      s,
      (function (e, t) {
        return {
          ...t,
          accessibilityProvider: t.accessibilityProvider && new Gye(e, t.accessibilityProvider),
        };
      })(o, r),
    );
  }
  updateOptions(e) {
    this.list.updateOptions(e);
  }
  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: e, index: t, browserEvent: n }) => ({
      element: void 0 === e ? void 0 : this._model.get(e),
      index: t,
      browserEvent: n,
    }));
  }
  get onPointer() {
    return $O.map(this.list.onPointer, ({ element: e, index: t, browserEvent: n }) => ({
      element: void 0 === e ? void 0 : this._model.get(e),
      index: t,
      browserEvent: n,
    }));
  }
  get onDidChangeSelection() {
    return $O.map(
      this.list.onDidChangeSelection,
      ({ elements: e, indexes: t, browserEvent: n }) => ({
        elements: e.map((e) => this._model.get(e)),
        indexes: t,
        browserEvent: n,
      }),
    );
  }
  get model() {
    return this._model;
  }
  set model(e) {
    (this.modelDisposables.clear(),
      (this._model = e),
      this.list.splice(0, this.list.length, cj(e.length)),
      this.modelDisposables.add(
        e.onDidIncrementLength((e) =>
          this.list.splice(this.list.length, 0, cj(this.list.length, e)),
        ),
      ));
  }
  getFocus() {
    return this.list.getFocus();
  }
  getSelection() {
    return this.list.getSelection();
  }
  getSelectedElements() {
    return this.getSelection().map((e) => this.model.get(e));
  }
  style(e) {
    this.list.style(e);
  }
  dispose() {
    (this.list.dispose(), this.modelDisposables.dispose());
  }
}
const Yye = { separatorBorder: vG.transparent };
class Xye {
  set size(e) {
    this._size = e;
  }
  get size() {
    return this._size;
  }
  get visible() {
    return void 0 === this._cachedVisibleSize;
  }
  setVisible(e, t) {
    if (e !== this.visible) {
      (e
        ? ((this.size = wae(this._cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize)),
          (this._cachedVisibleSize = void 0))
        : ((this._cachedVisibleSize = "number" == typeof t ? t : this.size), (this.size = 0)),
        this.container.classList.toggle("visible", e));
      try {
        this.view.setVisible?.(e);
      } catch (spt) {}
    }
  }
  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 ?? !0;
  }
  get snap() {
    return !!this.view.snap;
  }
  set enabled(e) {
    this.container.style.pointerEvents = e ? "" : "none";
  }
  constructor(e, t, n, i) {
    ((this.container = e),
      (this.view = t),
      (this.disposable = i),
      (this._cachedVisibleSize = void 0),
      "number" == typeof n
        ? ((this._size = n), (this._cachedVisibleSize = void 0), e.classList.add("visible"))
        : ((this._size = 0), (this._cachedVisibleSize = n.cachedVisibleSize)));
  }
  layout(e, t) {
    this.layoutContainer(e);
    try {
      this.view.layout(this.size, e, t);
    } catch (spt) {}
  }
  dispose() {
    this.disposable.dispose();
  }
}
class Qye extends Xye {
  layoutContainer(e) {
    ((this.container.style.top = `${e}px`), (this.container.style.height = `${this.size}px`));
  }
}
class Jye extends Xye {
  layoutContainer(e) {
    ((this.container.style.left = `${e}px`), (this.container.style.width = `${this.size}px`));
  }
}
var exe, txe;
(!(function (e) {
  ((e[(e.Idle = 0)] = "Idle"), (e[(e.Busy = 1)] = "Busy"));
})(exe || (exe = {})),
  (function (e) {
    ((e.Distribute = { type: "distribute" }),
      (e.Split = function (e) {
        return { type: "split", index: e };
      }),
      (e.Auto = function (e) {
        return { type: "auto", index: e };
      }),
      (e.Invisible = function (e) {
        return { type: "invisible", cachedVisibleSize: e };
      }));
  })(txe || (txe = {})));
class nxe extends PO {
  get orthogonalStartSash() {
    return this._orthogonalStartSash;
  }
  get orthogonalEndSash() {
    return this._orthogonalEndSash;
  }
  get startSnappingEnabled() {
    return this._startSnappingEnabled;
  }
  get endSnappingEnabled() {
    return this._endSnappingEnabled;
  }
  set orthogonalStartSash(e) {
    for (const t of this.sashItems) t.sash.orthogonalStartSash = e;
    this._orthogonalStartSash = e;
  }
  set orthogonalEndSash(e) {
    for (const t of this.sashItems) t.sash.orthogonalEndSash = e;
    this._orthogonalEndSash = e;
  }
  set startSnappingEnabled(e) {
    this._startSnappingEnabled !== e &&
      ((this._startSnappingEnabled = e), this.updateSashEnablement());
  }
  set endSnappingEnabled(e) {
    this._endSnappingEnabled !== e && ((this._endSnappingEnabled = e), this.updateSashEnablement());
  }
  constructor(e, t = {}) {
    (super(),
      (this.size = 0),
      (this._contentSize = 0),
      (this.proportions = void 0),
      (this.viewItems = []),
      (this.sashItems = []),
      (this.state = exe.Idle),
      (this._onDidSashChange = this._register(new QO())),
      (this._onDidSashReset = this._register(new QO())),
      (this._startSnappingEnabled = !0),
      (this._endSnappingEnabled = !0),
      (this.onDidSashChange = this._onDidSashChange.event),
      (this.onDidSashReset = this._onDidSashReset.event),
      (this.orientation = t.orientation ?? 0),
      (this.inverseAltBehavior = t.inverseAltBehavior ?? !1),
      (this.proportionalLayout = t.proportionalLayout ?? !0),
      (this.getSashOrthogonalSize = t.getSashOrthogonalSize),
      (this.el = document.createElement("div")),
      this.el.classList.add("monaco-split-view2"),
      this.el.classList.add(0 === this.orientation ? "vertical" : "horizontal"),
      e.appendChild(this.el),
      (this.sashContainer = MB(this.el, VB(".sash-container"))),
      (this.viewContainer = VB(".split-view-container")),
      (this.scrollable = this._register(
        new gJ({
          forceIntegerValues: !0,
          smoothScrollDuration: 125,
          scheduleAtNextAnimationFrame: (e) => JF(MF(this.el), e),
        }),
      )),
      (this.scrollableElement = this._register(
        new xJ(
          this.viewContainer,
          {
            vertical: 0 === this.orientation ? (t.scrollbarVisibility ?? 1) : 2,
            horizontal: 1 === this.orientation ? (t.scrollbarVisibility ?? 1) : 2,
          },
          this.scrollable,
        ),
      )));
    const n = this._register(new RJ(this.viewContainer, "scroll")).event;
    (this._register(
      n((e) => {
        const t = this.scrollableElement.getScrollPosition(),
          n =
            Math.abs(this.viewContainer.scrollLeft - t.scrollLeft) <= 1
              ? void 0
              : this.viewContainer.scrollLeft,
          i =
            Math.abs(this.viewContainer.scrollTop - t.scrollTop) <= 1
              ? void 0
              : this.viewContainer.scrollTop;
        (void 0 === n && void 0 === i) ||
          this.scrollableElement.setScrollPosition({ scrollLeft: n, scrollTop: i });
      }),
    ),
      (this.onDidScroll = this.scrollableElement.onScroll),
      this._register(
        this.onDidScroll((e) => {
          (e.scrollTopChanged && (this.viewContainer.scrollTop = e.scrollTop),
            e.scrollLeftChanged && (this.viewContainer.scrollLeft = e.scrollLeft));
        }),
      ),
      MB(this.el, this.scrollableElement.getDomNode()),
      this.style(t.styles || Yye),
      t.descriptor &&
        ((this.size = t.descriptor.size),
        t.descriptor.views.forEach((e, t) => {
          const n =
              uR(e.visible) || e.visible
                ? e.size
                : { type: "invisible", cachedVisibleSize: e.size },
            i = e.view;
          this.doAddView(i, n, t, !0);
        }),
        (this._contentSize = this.viewItems.reduce((e, t) => e + t.size, 0)),
        this.saveProportions()));
  }
  style(e) {
    e.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", e.separatorBorder.toString()));
  }
  addView(e, t, n = this.viewItems.length, i) {
    this.doAddView(e, t, n, i);
  }
  layout(e, t) {
    const n = Math.max(this.size, this._contentSize);
    if (((this.size = e), (this.layoutContext = t), this.proportions)) {
      let t = 0;
      for (let n = 0; n < this.viewItems.length; n++) {
        const i = this.viewItems[n],
          r = this.proportions[n];
        "number" == typeof r ? (t += r) : (e -= i.size);
      }
      for (let n = 0; n < this.viewItems.length; n++) {
        const i = this.viewItems[n],
          r = this.proportions[n];
        "number" == typeof r &&
          t > 0 &&
          (i.size = wae(Math.round((r * e) / t), i.minimumSize, i.maximumSize));
      }
    } else {
      const t = cj(this.viewItems.length),
        i = t.filter((e) => 1 === this.viewItems[e].priority),
        r = t.filter((e) => 2 === this.viewItems[e].priority);
      this.resize(this.viewItems.length - 1, e - n, void 0, i, r);
    }
    (this.distributeEmptySpace(), this.layoutViews());
  }
  saveProportions() {
    this.proportionalLayout &&
      this._contentSize > 0 &&
      (this.proportions = this.viewItems.map((e) =>
        e.proportionalLayout && e.visible ? e.size / this._contentSize : void 0,
      ));
  }
  onSashStart({ sash: e, start: t, alt: n }) {
    for (const s of this.viewItems) s.enabled = !1;
    const i = this.sashItems.findIndex((t) => t.sash === e),
      r = RO(
        $F(this.el.ownerDocument.body, "keydown", (e) => o(this.sashDragState.current, e.altKey)),
        $F(this.el.ownerDocument.body, "keyup", () => o(this.sashDragState.current, !1)),
      ),
      o = (e, t) => {
        const n = this.viewItems.map((e) => e.size);
        let o,
          s,
          a = Number.NEGATIVE_INFINITY,
          l = Number.POSITIVE_INFINITY;
        if ((this.inverseAltBehavior && (t = !t), t)) {
          if (i === this.sashItems.length - 1) {
            const e = this.viewItems[i];
            ((a = (e.minimumSize - e.size) / 2), (l = (e.maximumSize - e.size) / 2));
          } else {
            const e = this.viewItems[i + 1];
            ((a = (e.size - e.maximumSize) / 2), (l = (e.size - e.minimumSize) / 2));
          }
        }
        if (!t) {
          const e = cj(i, -1),
            t = cj(i + 1, this.viewItems.length),
            r = e.reduce((e, t) => e + (this.viewItems[t].minimumSize - n[t]), 0),
            a = e.reduce((e, t) => e + (this.viewItems[t].viewMaximumSize - n[t]), 0),
            l =
              0 === t.length
                ? Number.POSITIVE_INFINITY
                : t.reduce((e, t) => e + (n[t] - this.viewItems[t].minimumSize), 0),
            c =
              0 === t.length
                ? Number.NEGATIVE_INFINITY
                : t.reduce((e, t) => e + (n[t] - this.viewItems[t].viewMaximumSize), 0),
            d = Math.max(r, c),
            u = Math.min(l, a),
            h = this.findFirstSnapIndex(e),
            g = this.findFirstSnapIndex(t);
          if ("number" == typeof h) {
            const e = this.viewItems[h],
              t = Math.floor(e.viewMinimumSize / 2);
            o = { index: h, limitDelta: e.visible ? d - t : d + t, size: e.size };
          }
          if ("number" == typeof g) {
            const e = this.viewItems[g],
              t = Math.floor(e.viewMinimumSize / 2);
            s = { index: g, limitDelta: e.visible ? u + t : u - t, size: e.size };
          }
        }
        this.sashDragState = {
          start: e,
          current: e,
          index: i,
          sizes: n,
          minDelta: a,
          maxDelta: l,
          alt: t,
          snapBefore: o,
          snapAfter: s,
          disposable: r,
        };
      };
    o(t, n);
  }
  onSashChange({ current: e }) {
    const {
      index: t,
      start: n,
      sizes: i,
      alt: r,
      minDelta: o,
      maxDelta: s,
      snapBefore: a,
      snapAfter: l,
    } = this.sashDragState;
    this.sashDragState.current = e;
    const c = e - n,
      d = this.resize(t, c, i, void 0, void 0, o, s, a, l);
    if (r) {
      const e = t === this.sashItems.length - 1,
        n = this.viewItems.map((e) => e.size),
        i = e ? t : t + 1,
        r = this.viewItems[i],
        o = r.size - r.maximumSize,
        s = r.size - r.minimumSize,
        a = e ? t - 1 : t + 1;
      this.resize(a, -d, n, void 0, void 0, o, s);
    }
    (this.distributeEmptySpace(), this.layoutViews());
  }
  onSashEnd(e) {
    (this._onDidSashChange.fire(e),
      this.sashDragState.disposable.dispose(),
      this.saveProportions());
    for (const t of this.viewItems) t.enabled = !0;
  }
  onViewChange(e, t) {
    const n = this.viewItems.indexOf(e);
    n < 0 ||
      n >= this.viewItems.length ||
      ((t = wae((t = "number" == typeof t ? t : e.size), e.minimumSize, e.maximumSize)),
      this.inverseAltBehavior && n > 0
        ? (this.resize(n - 1, Math.floor((e.size - t) / 2)),
          this.distributeEmptySpace(),
          this.layoutViews())
        : ((e.size = t), this.relayout([n], void 0)));
  }
  resizeView(e, t) {
    if (!(e < 0 || e >= this.viewItems.length)) {
      if (this.state !== exe.Idle) throw new Error("Cant modify splitview");
      this.state = exe.Busy;
      try {
        const n = cj(this.viewItems.length).filter((t) => t !== e),
          i = [...n.filter((e) => 1 === this.viewItems[e].priority), e],
          r = n.filter((e) => 2 === this.viewItems[e].priority),
          o = this.viewItems[e];
        ((t = wae((t = Math.round(t)), o.minimumSize, Math.min(o.maximumSize, this.size))),
          (o.size = t),
          this.relayout(i, r));
      } finally {
        this.state = exe.Idle;
      }
    }
  }
  distributeViewSizes() {
    const e = [];
    let t = 0;
    for (const s of this.viewItems) s.maximumSize - s.minimumSize > 0 && (e.push(s), (t += s.size));
    const n = Math.floor(t / e.length);
    for (const s of e) s.size = wae(n, s.minimumSize, s.maximumSize);
    const i = cj(this.viewItems.length),
      r = i.filter((e) => 1 === this.viewItems[e].priority),
      o = i.filter((e) => 2 === this.viewItems[e].priority);
    this.relayout(r, o);
  }
  getViewSize(e) {
    return e < 0 || e >= this.viewItems.length ? -1 : this.viewItems[e].size;
  }
  doAddView(e, t, n = this.viewItems.length, i) {
    if (this.state !== exe.Idle) throw new Error("Cant modify splitview");
    this.state = exe.Busy;
    try {
      const r = VB(".split-view-view");
      n === this.viewItems.length
        ? this.viewContainer.appendChild(r)
        : this.viewContainer.insertBefore(r, this.viewContainer.children.item(n));
      const o = e.onDidChange((e) => this.onViewChange(l, e)),
        s = RO(
          o,
          MO(() => r.remove()),
        );
      let a;
      "number" == typeof t
        ? (a = t)
        : ("auto" === t.type &&
            (t = this.areViewsDistributed()
              ? { type: "distribute" }
              : { type: "split", index: t.index }),
          (a =
            "split" === t.type
              ? this.getViewSize(t.index) / 2
              : "invisible" === t.type
                ? { cachedVisibleSize: t.cachedVisibleSize }
                : e.minimumSize));
      const l = 0 === this.orientation ? new Qye(r, e, a, s) : new Jye(r, e, a, s);
      if ((this.viewItems.splice(n, 0, l), this.viewItems.length > 1)) {
        const e = {
            orthogonalStartSash: this.orthogonalStartSash,
            orthogonalEndSash: this.orthogonalEndSash,
          },
          t =
            0 === this.orientation
              ? new Ade(
                  this.sashContainer,
                  {
                    getHorizontalSashTop: (e) => this.getSashPosition(e),
                    getHorizontalSashWidth: this.getSashOrthogonalSize,
                  },
                  { ...e, orientation: 1 },
                )
              : new Ade(
                  this.sashContainer,
                  {
                    getVerticalSashLeft: (e) => this.getSashPosition(e),
                    getVerticalSashHeight: this.getSashOrthogonalSize,
                  },
                  { ...e, orientation: 0 },
                ),
          i =
            0 === this.orientation
              ? (e) => ({ sash: t, start: e.startY, current: e.currentY, alt: e.altKey })
              : (e) => ({ sash: t, start: e.startX, current: e.currentX, alt: e.altKey }),
          r = $O.map(t.onDidStart, i)(this.onSashStart, this),
          o = $O.map(t.onDidChange, i)(this.onSashChange, this),
          s = $O.map(t.onDidEnd, () => this.sashItems.findIndex((e) => e.sash === t)),
          a = s(this.onSashEnd, this),
          l = t.onDidReset(() => {
            const e = this.sashItems.findIndex((e) => e.sash === t),
              n = cj(e, -1),
              i = cj(e + 1, this.viewItems.length),
              r = this.findFirstSnapIndex(n),
              o = this.findFirstSnapIndex(i);
            ("number" != typeof r || this.viewItems[r].visible) &&
              ("number" != typeof o || this.viewItems[o].visible) &&
              this._onDidSashReset.fire(e);
          }),
          c = RO(r, o, a, l, t),
          d = { sash: t, disposable: c };
        this.sashItems.splice(n - 1, 0, d);
      }
      let c;
      (r.appendChild(e.element),
        "number" != typeof t && "split" === t.type && (c = [t.index]),
        i || this.relayout([n], c),
        i || "number" == typeof t || "distribute" !== t.type || this.distributeViewSizes());
    } finally {
      this.state = exe.Idle;
    }
  }
  relayout(e, t) {
    const n = this.viewItems.reduce((e, t) => e + t.size, 0);
    (this.resize(this.viewItems.length - 1, this.size - n, void 0, e, t),
      this.distributeEmptySpace(),
      this.layoutViews(),
      this.saveProportions());
  }
  resize(
    e,
    t,
    n = this.viewItems.map((e) => e.size),
    i,
    r,
    o = Number.NEGATIVE_INFINITY,
    s = Number.POSITIVE_INFINITY,
    a,
    l,
  ) {
    if (e < 0 || e >= this.viewItems.length) return 0;
    const c = cj(e, -1),
      d = cj(e + 1, this.viewItems.length);
    if (r) for (const w of r) (uj(c, w), uj(d, w));
    if (i) for (const w of i) (hj(c, w), hj(d, w));
    const u = c.map((e) => this.viewItems[e]),
      h = c.map((e) => n[e]),
      g = d.map((e) => this.viewItems[e]),
      p = d.map((e) => n[e]),
      f = c.reduce((e, t) => e + (this.viewItems[t].minimumSize - n[t]), 0),
      m = c.reduce((e, t) => e + (this.viewItems[t].maximumSize - n[t]), 0),
      _ =
        0 === d.length
          ? Number.POSITIVE_INFINITY
          : d.reduce((e, t) => e + (n[t] - this.viewItems[t].minimumSize), 0),
      v =
        0 === d.length
          ? Number.NEGATIVE_INFINITY
          : d.reduce((e, t) => e + (n[t] - this.viewItems[t].maximumSize), 0),
      b = Math.max(f, v, o),
      y = Math.min(_, m, s);
    let x = !1;
    if (a) {
      const e = this.viewItems[a.index],
        n = t >= a.limitDelta;
      ((x = n !== e.visible), e.setVisible(n, a.size));
    }
    if (!x && l) {
      const e = this.viewItems[l.index],
        n = t < l.limitDelta;
      ((x = n !== e.visible), e.setVisible(n, l.size));
    }
    if (x) return this.resize(e, t, n, i, r, o, s);
    for (let w = 0, C = (t = wae(t, b, y)); w < u.length; w++) {
      const e = u[w],
        t = wae(h[w] + C, e.minimumSize, e.maximumSize);
      ((C -= t - h[w]), (e.size = t));
    }
    for (let w = 0, C = t; w < g.length; w++) {
      const e = g[w],
        t = wae(p[w] - C, e.minimumSize, e.maximumSize);
      ((C += t - p[w]), (e.size = t));
    }
    return t;
  }
  distributeEmptySpace(e) {
    const t = this.viewItems.reduce((e, t) => e + t.size, 0);
    let n = this.size - t;
    const i = cj(this.viewItems.length - 1, -1),
      r = i.filter((e) => 1 === this.viewItems[e].priority),
      o = i.filter((e) => 2 === this.viewItems[e].priority);
    for (const s of o) uj(i, s);
    for (const s of r) hj(i, s);
    "number" == typeof e && hj(i, e);
    for (let s = 0; 0 !== n && s < i.length; s++) {
      const e = this.viewItems[i[s]],
        t = wae(e.size + n, e.minimumSize, e.maximumSize);
      ((n -= t - e.size), (e.size = t));
    }
  }
  layoutViews() {
    this._contentSize = this.viewItems.reduce((e, t) => e + t.size, 0);
    let e = 0;
    for (const t of this.viewItems) (t.layout(e, this.layoutContext), (e += t.size));
    (this.sashItems.forEach((e) => e.sash.layout()),
      this.updateSashEnablement(),
      this.updateScrollableElement());
  }
  updateScrollableElement() {
    0 === this.orientation
      ? this.scrollableElement.setScrollDimensions({
          height: this.size,
          scrollHeight: this._contentSize,
        })
      : this.scrollableElement.setScrollDimensions({
          width: this.size,
          scrollWidth: this._contentSize,
        });
  }
  updateSashEnablement() {
    let e = !1;
    const t = this.viewItems.map((t) => (e = t.size - t.minimumSize > 0 || e));
    e = !1;
    const n = this.viewItems.map((t) => (e = t.maximumSize - t.size > 0 || e)),
      i = [...this.viewItems].reverse();
    e = !1;
    const r = i.map((t) => (e = t.size - t.minimumSize > 0 || e)).reverse();
    e = !1;
    const o = i.map((t) => (e = t.maximumSize - t.size > 0 || e)).reverse();
    let s = 0;
    for (let a = 0; a < this.sashItems.length; a++) {
      const { sash: e } = this.sashItems[a];
      s += this.viewItems[a].size;
      const i = !(t[a] && o[a + 1]),
        l = !(n[a] && r[a + 1]);
      if (i && l) {
        const n = cj(a, -1),
          i = cj(a + 1, this.viewItems.length),
          o = this.findFirstSnapIndex(n),
          l = this.findFirstSnapIndex(i),
          c = "number" == typeof o && !this.viewItems[o].visible,
          d = "number" == typeof l && !this.viewItems[l].visible;
        c && r[a] && (s > 0 || this.startSnappingEnabled)
          ? (e.state = 1)
          : d && t[a] && (s < this._contentSize || this.endSnappingEnabled)
            ? (e.state = 2)
            : (e.state = 0);
      } else e.state = i && !l ? 1 : !i && l ? 2 : 3;
    }
  }
  getSashPosition(e) {
    let t = 0;
    for (let n = 0; n < this.sashItems.length; n++)
      if (((t += this.viewItems[n].size), this.sashItems[n].sash === e)) return t;
    return 0;
  }
  findFirstSnapIndex(e) {
    for (const t of e) {
      const e = this.viewItems[t];
      if (e.visible && e.snap) return t;
    }
    for (const t of e) {
      const e = this.viewItems[t];
      if (e.visible && e.maximumSize - e.minimumSize > 0) return;
      if (!e.visible && e.snap) return t;
    }
  }
  areViewsDistributed() {
    let e, t;
    for (const n of this.viewItems)
      if (
        ((e = void 0 === e ? n.size : Math.min(e, n.size)),
        (t = void 0 === t ? n.size : Math.max(t, n.size)),
        t - e > 2)
      )
        return !1;
    return !0;
  }
  dispose() {
    (this.sashDragState?.disposable.dispose(),
      IO(this.viewItems),
      (this.viewItems = []),
      this.sashItems.forEach((e) => e.disposable.dispose()),
      (this.sashItems = []),
      super.dispose());
  }
}
class ixe {
  static {
    this.TemplateId = "row";
  }
  constructor(e, t, n) {
    ((this.columns = e),
      (this.getColumnSize = n),
      (this.templateId = ixe.TemplateId),
      (this.renderedTemplates = new Set()));
    const i = new Map(t.map((e) => [e.templateId, e]));
    this.renderers = [];
    for (const r of e) {
      const e = i.get(r.templateId);
      if (!e) throw new Error(`Table cell renderer for template id ${r.templateId} not found.`);
      this.renderers.push(e);
    }
  }
  renderTemplate(e) {
    const t = MB(e, VB(".monaco-table-tr")),
      n = [],
      i = [];
    for (let o = 0; o < this.columns.length; o++) {
      const e = this.renderers[o],
        r = MB(t, VB(".monaco-table-td", { "data-col-index": o }));
      ((r.style.width = `${this.getColumnSize(o)}px`), n.push(r), i.push(e.renderTemplate(r)));
    }
    const r = { container: e, cellContainers: n, cellTemplateData: i };
    return (this.renderedTemplates.add(r), r);
  }
  renderElement(e, t, n, i) {
    for (let r = 0; r < this.columns.length; r++) {
      const o = this.columns[r].project(e);
      this.renderers[r].renderElement(o, t, n.cellTemplateData[r], i);
    }
  }
  disposeElement(e, t, n, i) {
    for (let r = 0; r < this.columns.length; r++) {
      const o = this.renderers[r];
      if (o.disposeElement) {
        const s = this.columns[r].project(e);
        o.disposeElement(s, t, n.cellTemplateData[r], i);
      }
    }
  }
  disposeTemplate(e) {
    for (let t = 0; t < this.columns.length; t++) {
      this.renderers[t].disposeTemplate(e.cellTemplateData[t]);
    }
    (zF(e.container), this.renderedTemplates.delete(e));
  }
  layoutColumn(e, t) {
    for (const { cellContainers: n } of this.renderedTemplates) n[e].style.width = `${t}px`;
  }
}
class rxe extends PO {
  get minimumSize() {
    return this.column.minimumWidth ?? 120;
  }
  get maximumSize() {
    return this.column.maximumWidth ?? Number.POSITIVE_INFINITY;
  }
  get onDidChange() {
    return this.column.onDidChangeWidthConstraints ?? $O.None;
  }
  constructor(e, t) {
    (super(),
      (this.column = e),
      (this.index = t),
      (this._onDidLayout = new QO()),
      (this.onDidLayout = this._onDidLayout.event),
      (this.element = VB(".monaco-table-th", { "data-col-index": t }, e.label)),
      e.tooltip && this._register(yae().setupManagedHover(Bne("mouse"), this.element, e.tooltip)));
  }
  layout(e) {
    this._onDidLayout.fire([this.index, e]);
  }
}
let oxe = class e {
  static {
    this.InstanceCount = 0;
  }
  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(e) {
    this.list.scrollTop = e;
  }
  get scrollHeight() {
    return this.list.scrollHeight;
  }
  get renderHeight() {
    return this.list.renderHeight;
  }
  get onDidDispose() {
    return this.list.onDidDispose;
  }
  constructor(t, n, i, r, o, s) {
    ((this.virtualDelegate = i),
      (this.columns = r),
      (this.domId = "table_id_" + ++e.InstanceCount),
      (this.disposables = new AO()),
      (this.cachedWidth = 0),
      (this.cachedHeight = 0),
      (this.domNode = MB(n, VB(`.monaco-table.${this.domId}`))));
    const a = r.map((e, t) => this.disposables.add(new rxe(e, t))),
      l = {
        size: a.reduce((e, t) => e + t.column.weight, 0),
        views: a.map((e) => ({ size: e.column.weight, view: e })),
      };
    ((this.splitview = this.disposables.add(
      new nxe(this.domNode, {
        orientation: 1,
        scrollbarVisibility: 2,
        getSashOrthogonalSize: () => this.cachedHeight,
        descriptor: l,
      }),
    )),
      (this.splitview.el.style.height = `${i.headerRowHeight}px`),
      (this.splitview.el.style.lineHeight = `${i.headerRowHeight}px`));
    const c = new ixe(r, o, (e) => this.splitview.getViewSize(e));
    var d;
    ((this.list = this.disposables.add(
      new gle(
        t,
        this.domNode,
        ((d = i), { getHeight: (e) => d.getHeight(e), getTemplateId: () => ixe.TemplateId }),
        [c],
        s,
      ),
    )),
      $O.any(...a.map((e) => e.onDidLayout))(
        ([e, t]) => c.layoutColumn(e, t),
        null,
        this.disposables,
      ),
      this.splitview.onDidSashReset(
        (e) => {
          const t = r.reduce((e, t) => e + t.weight, 0),
            n = (r[e].weight / t) * this.cachedWidth;
          this.splitview.resizeView(e, n);
        },
        null,
        this.disposables,
      ),
      (this.styleElement = rG(this.domNode)),
      this.style(sle));
  }
  updateOptions(e) {
    this.list.updateOptions(e);
  }
  splice(e, t, n = []) {
    this.list.splice(e, t, n);
  }
  getHTMLElement() {
    return this.domNode;
  }
  style(e) {
    const t = [];
    (t.push(
      `.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight + 1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`,
    ),
      (this.styleElement.textContent = t.join("\n")),
      this.list.style(e));
  }
  getSelectedElements() {
    return this.list.getSelectedElements();
  }
  getSelection() {
    return this.list.getSelection();
  }
  getFocus() {
    return this.list.getFocus();
  }
  dispose() {
    this.disposables.dispose();
  }
};
var sxe, axe, lxe, cxe, dxe, uxe;
(!(function (e) {
  ((e[(e.Expanded = 0)] = "Expanded"),
    (e[(e.Collapsed = 1)] = "Collapsed"),
    (e[(e.PreserveOrExpanded = 2)] = "PreserveOrExpanded"),
    (e[(e.PreserveOrCollapsed = 3)] = "PreserveOrCollapsed"));
})(sxe || (sxe = {})),
  (function (e) {
    ((e[(e.Unknown = 0)] = "Unknown"),
      (e[(e.Twistie = 1)] = "Twistie"),
      (e[(e.Element = 2)] = "Element"),
      (e[(e.Filter = 3)] = "Filter"));
  })(axe || (axe = {})));
class hxe extends Error {
  constructor(e, t) {
    super(`TreeError [${e}] ${t}`);
  }
}
class gxe {
  constructor(e) {
    ((this.fn = e), (this._map = new WeakMap()));
  }
  map(e) {
    let t = this._map.get(e);
    return (t || ((t = this.fn(e)), this._map.set(e, t)), t);
  }
}
class pxe {
  constructor(e, t, n, i) {
    ((this.originalStart = e),
      (this.originalLength = t),
      (this.modifiedStart = n),
      (this.modifiedLength = i));
  }
  getOriginalEnd() {
    return this.originalStart + this.originalLength;
  }
  getModifiedEnd() {
    return this.modifiedStart + this.modifiedLength;
  }
}
class fxe {
  constructor(e) {
    this.source = e;
  }
  getElements() {
    const e = this.source,
      t = new Int32Array(e.length);
    for (let n = 0, i = e.length; n < i; n++) t[n] = e.charCodeAt(n);
    return t;
  }
}
function mxe(e, t, n) {
  return new yxe(new fxe(e), new fxe(t)).ComputeDiff(n).changes;
}
class _xe {
  static Assert(e, t) {
    if (!e) throw new Error(t);
  }
}
class vxe {
  static Copy(e, t, n, i, r) {
    for (let o = 0; o < r; o++) n[i + o] = e[t + o];
  }
  static Copy2(e, t, n, i, r) {
    for (let o = 0; o < r; o++) n[i + o] = e[t + o];
  }
}
class bxe {
  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 pxe(
          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(e, t) {
    ((this.m_originalStart = Math.min(this.m_originalStart, e)),
      (this.m_modifiedStart = Math.min(this.m_modifiedStart, t)),
      this.m_originalCount++);
  }
  AddModifiedElement(e, t) {
    ((this.m_originalStart = Math.min(this.m_originalStart, e)),
      (this.m_modifiedStart = Math.min(this.m_modifiedStart, t)),
      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
    );
  }
}
class yxe {
  constructor(e, t, n = null) {
    ((this.ContinueProcessingPredicate = n),
      (this._originalSequence = e),
      (this._modifiedSequence = t));
    const [i, r, o] = yxe._getElements(e),
      [s, a, l] = yxe._getElements(t);
    ((this._hasStrings = o && l),
      (this._originalStringElements = i),
      (this._originalElementsOrHash = r),
      (this._modifiedStringElements = s),
      (this._modifiedElementsOrHash = a),
      (this.m_forwardHistory = []),
      (this.m_reverseHistory = []));
  }
  static _isStringArray(e) {
    return e.length > 0 && "string" == typeof e[0];
  }
  static _getElements(e) {
    const t = e.getElements();
    if (yxe._isStringArray(t)) {
      const e = new Int32Array(t.length);
      for (let n = 0, i = t.length; n < i; n++) e[n] = KP(t[n], 0);
      return [t, e, !0];
    }
    return t instanceof Int32Array ? [[], t, !1] : [[], new Int32Array(t), !1];
  }
  ElementsAreEqual(e, t) {
    return (
      this._originalElementsOrHash[e] === this._modifiedElementsOrHash[t] &&
      (!this._hasStrings || this._originalStringElements[e] === this._modifiedStringElements[t])
    );
  }
  ElementsAreStrictEqual(e, t) {
    if (!this.ElementsAreEqual(e, t)) return !1;
    return (
      yxe._getStrictElement(this._originalSequence, e) ===
      yxe._getStrictElement(this._modifiedSequence, t)
    );
  }
  static _getStrictElement(e, t) {
    return "function" == typeof e.getStrictElement ? e.getStrictElement(t) : null;
  }
  OriginalElementsAreEqual(e, t) {
    return (
      this._originalElementsOrHash[e] === this._originalElementsOrHash[t] &&
      (!this._hasStrings || this._originalStringElements[e] === this._originalStringElements[t])
    );
  }
  ModifiedElementsAreEqual(e, t) {
    return (
      this._modifiedElementsOrHash[e] === this._modifiedElementsOrHash[t] &&
      (!this._hasStrings || this._modifiedStringElements[e] === this._modifiedStringElements[t])
    );
  }
  ComputeDiff(e) {
    return this._ComputeDiff(
      0,
      this._originalElementsOrHash.length - 1,
      0,
      this._modifiedElementsOrHash.length - 1,
      e,
    );
  }
  _ComputeDiff(e, t, n, i, r) {
    const o = [!1];
    let s = this.ComputeDiffRecursive(e, t, n, i, o);
    return (r && (s = this.PrettifyChanges(s)), { quitEarly: o[0], changes: s });
  }
  ComputeDiffRecursive(e, t, n, i, r) {
    for (r[0] = !1; e <= t && n <= i && this.ElementsAreEqual(e, n); ) (e++, n++);
    for (; t >= e && i >= n && this.ElementsAreEqual(t, i); ) (t--, i--);
    if (e > t || n > i) {
      let r;
      return (
        n <= i
          ? (_xe.Assert(e === t + 1, "originalStart should only be one more than originalEnd"),
            (r = [new pxe(e, 0, n, i - n + 1)]))
          : e <= t
            ? (_xe.Assert(n === i + 1, "modifiedStart should only be one more than modifiedEnd"),
              (r = [new pxe(e, t - e + 1, n, 0)]))
            : (_xe.Assert(e === t + 1, "originalStart should only be one more than originalEnd"),
              _xe.Assert(n === i + 1, "modifiedStart should only be one more than modifiedEnd"),
              (r = [])),
        r
      );
    }
    const o = [0],
      s = [0],
      a = this.ComputeRecursionPoint(e, t, n, i, o, s, r),
      l = o[0],
      c = s[0];
    if (null !== a) return a;
    if (!r[0]) {
      const o = this.ComputeDiffRecursive(e, l, n, c, r);
      let s = [];
      return (
        (s = r[0]
          ? [new pxe(l + 1, t - (l + 1) + 1, c + 1, i - (c + 1) + 1)]
          : this.ComputeDiffRecursive(l + 1, t, c + 1, i, r)),
        this.ConcatenateChanges(o, s)
      );
    }
    return [new pxe(e, t - e + 1, n, i - n + 1)];
  }
  WALKTRACE(e, t, n, i, r, o, s, a, l, c, d, u, h, g, p, f, m, _) {
    let v = null,
      b = null,
      y = new bxe(),
      x = t,
      w = n,
      C = h[0] - f[0] - i,
      S = -1073741824,
      k = this.m_forwardHistory.length - 1;
    do {
      const t = C + e;
      (t === x || (t < w && l[t - 1] < l[t + 1])
        ? ((g = (d = l[t + 1]) - C - i),
          d < S && y.MarkNextChange(),
          (S = d),
          y.AddModifiedElement(d + 1, g),
          (C = t + 1 - e))
        : ((g = (d = l[t - 1] + 1) - C - i),
          d < S && y.MarkNextChange(),
          (S = d - 1),
          y.AddOriginalElement(d, g + 1),
          (C = t - 1 - e)),
        k >= 0 && ((e = (l = this.m_forwardHistory[k])[0]), (x = 1), (w = l.length - 1)));
    } while (--k >= -1);
    if (((v = y.getReverseChanges()), _[0])) {
      let e = h[0] + 1,
        t = f[0] + 1;
      if (null !== v && v.length > 0) {
        const n = v[v.length - 1];
        ((e = Math.max(e, n.getOriginalEnd())), (t = Math.max(t, n.getModifiedEnd())));
      }
      b = [new pxe(e, u - e + 1, t, p - t + 1)];
    } else {
      ((y = new bxe()),
        (x = o),
        (w = s),
        (C = h[0] - f[0] - a),
        (S = 1073741824),
        (k = m ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2));
      do {
        const e = C + r;
        (e === x || (e < w && c[e - 1] >= c[e + 1])
          ? ((g = (d = c[e + 1] - 1) - C - a),
            d > S && y.MarkNextChange(),
            (S = d + 1),
            y.AddOriginalElement(d + 1, g + 1),
            (C = e + 1 - r))
          : ((g = (d = c[e - 1]) - C - a),
            d > S && y.MarkNextChange(),
            (S = d),
            y.AddModifiedElement(d + 1, g + 1),
            (C = e - 1 - r)),
          k >= 0 && ((r = (c = this.m_reverseHistory[k])[0]), (x = 1), (w = c.length - 1)));
      } while (--k >= -1);
      b = y.getChanges();
    }
    return this.ConcatenateChanges(v, b);
  }
  ComputeRecursionPoint(e, t, n, i, r, o, s) {
    let a = 0,
      l = 0,
      c = 0,
      d = 0,
      u = 0,
      h = 0;
    (e--, n--, (r[0] = 0), (o[0] = 0), (this.m_forwardHistory = []), (this.m_reverseHistory = []));
    const g = t - e + (i - n),
      p = g + 1,
      f = new Int32Array(p),
      m = new Int32Array(p),
      _ = i - n,
      v = t - e,
      b = e - n,
      y = t - i,
      x = (v - _) % 2 == 0;
    ((f[_] = e), (m[v] = t), (s[0] = !1));
    for (let w = 1; w <= g / 2 + 1; w++) {
      let g = 0,
        C = 0;
      ((c = this.ClipDiagonalBound(_ - w, w, _, p)), (d = this.ClipDiagonalBound(_ + w, w, _, p)));
      for (let e = c; e <= d; e += 2) {
        ((a = e === c || (e < d && f[e - 1] < f[e + 1]) ? f[e + 1] : f[e - 1] + 1),
          (l = a - (e - _) - b));
        const n = a;
        for (; a < t && l < i && this.ElementsAreEqual(a + 1, l + 1); ) (a++, l++);
        if (
          ((f[e] = a),
          a + l > g + C && ((g = a), (C = l)),
          !x && Math.abs(e - v) <= w - 1 && a >= m[e])
        )
          return (
            (r[0] = a),
            (o[0] = l),
            n <= m[e] && w <= 1448
              ? this.WALKTRACE(_, c, d, b, v, u, h, y, f, m, a, t, r, l, i, o, x, s)
              : null
          );
      }
      const S = (g - e + (C - n) - w) / 2;
      if (null !== this.ContinueProcessingPredicate && !this.ContinueProcessingPredicate(g, S))
        return (
          (s[0] = !0),
          (r[0] = g),
          (o[0] = C),
          S > 0 && w <= 1448
            ? this.WALKTRACE(_, c, d, b, v, u, h, y, f, m, a, t, r, l, i, o, x, s)
            : (e++, n++, [new pxe(e, t - e + 1, n, i - n + 1)])
        );
      ((u = this.ClipDiagonalBound(v - w, w, v, p)), (h = this.ClipDiagonalBound(v + w, w, v, p)));
      for (let p = u; p <= h; p += 2) {
        ((a = p === u || (p < h && m[p - 1] >= m[p + 1]) ? m[p + 1] - 1 : m[p - 1]),
          (l = a - (p - v) - y));
        const g = a;
        for (; a > e && l > n && this.ElementsAreEqual(a, l); ) (a--, l--);
        if (((m[p] = a), x && Math.abs(p - _) <= w && a <= f[p]))
          return (
            (r[0] = a),
            (o[0] = l),
            g >= f[p] && w <= 1448
              ? this.WALKTRACE(_, c, d, b, v, u, h, y, f, m, a, t, r, l, i, o, x, s)
              : null
          );
      }
      if (w <= 1447) {
        let e = new Int32Array(d - c + 2);
        ((e[0] = _ - c + 1),
          vxe.Copy2(f, c, e, 1, d - c + 1),
          this.m_forwardHistory.push(e),
          (e = new Int32Array(h - u + 2)),
          (e[0] = v - u + 1),
          vxe.Copy2(m, u, e, 1, h - u + 1),
          this.m_reverseHistory.push(e));
      }
    }
    return this.WALKTRACE(_, c, d, b, v, u, h, y, f, m, a, t, r, l, i, o, x, s);
  }
  PrettifyChanges(e) {
    for (let t = 0; t < e.length; t++) {
      const n = e[t],
        i = t < e.length - 1 ? e[t + 1].originalStart : this._originalElementsOrHash.length,
        r = t < e.length - 1 ? e[t + 1].modifiedStart : this._modifiedElementsOrHash.length,
        o = n.originalLength > 0,
        s = n.modifiedLength > 0;
      for (
        ;
        n.originalStart + n.originalLength < i &&
        n.modifiedStart + n.modifiedLength < r &&
        (!o ||
          this.OriginalElementsAreEqual(n.originalStart, n.originalStart + n.originalLength)) &&
        (!s || this.ModifiedElementsAreEqual(n.modifiedStart, n.modifiedStart + n.modifiedLength));
      ) {
        const e = this.ElementsAreStrictEqual(n.originalStart, n.modifiedStart);
        if (
          this.ElementsAreStrictEqual(
            n.originalStart + n.originalLength,
            n.modifiedStart + n.modifiedLength,
          ) &&
          !e
        )
          break;
        (n.originalStart++, n.modifiedStart++);
      }
      const a = [null];
      t < e.length - 1 &&
        this.ChangesOverlap(e[t], e[t + 1], a) &&
        ((e[t] = a[0]), e.splice(t + 1, 1), t--);
    }
    for (let t = e.length - 1; t >= 0; t--) {
      const n = e[t];
      let i = 0,
        r = 0;
      if (t > 0) {
        const n = e[t - 1];
        ((i = n.originalStart + n.originalLength), (r = n.modifiedStart + n.modifiedLength));
      }
      const o = n.originalLength > 0,
        s = n.modifiedLength > 0;
      let a = 0,
        l = this._boundaryScore(
          n.originalStart,
          n.originalLength,
          n.modifiedStart,
          n.modifiedLength,
        );
      for (let e = 1; ; e++) {
        const t = n.originalStart - e,
          c = n.modifiedStart - e;
        if (t < i || c < r) break;
        if (o && !this.OriginalElementsAreEqual(t, t + n.originalLength)) break;
        if (s && !this.ModifiedElementsAreEqual(c, c + n.modifiedLength)) break;
        const d =
          (t === i && c === r ? 5 : 0) +
          this._boundaryScore(t, n.originalLength, c, n.modifiedLength);
        d > l && ((l = d), (a = e));
      }
      ((n.originalStart -= a), (n.modifiedStart -= a));
      const c = [null];
      t > 0 && this.ChangesOverlap(e[t - 1], e[t], c) && ((e[t - 1] = c[0]), e.splice(t, 1), t++);
    }
    if (this._hasStrings)
      for (let t = 1, n = e.length; t < n; t++) {
        const n = e[t - 1],
          i = e[t],
          r = i.originalStart - n.originalStart - n.originalLength,
          o = n.originalStart,
          s = i.originalStart + i.originalLength,
          a = s - o,
          l = n.modifiedStart,
          c = i.modifiedStart + i.modifiedLength,
          d = c - l;
        if (r < 5 && a < 20 && d < 20) {
          const e = this._findBetterContiguousSequence(o, a, l, d, r);
          if (e) {
            const [t, o] = e;
            (t === n.originalStart + n.originalLength &&
              o === n.modifiedStart + n.modifiedLength) ||
              ((n.originalLength = t - n.originalStart),
              (n.modifiedLength = o - n.modifiedStart),
              (i.originalStart = t + r),
              (i.modifiedStart = o + r),
              (i.originalLength = s - i.originalStart),
              (i.modifiedLength = c - i.modifiedStart));
          }
        }
      }
    return e;
  }
  _findBetterContiguousSequence(e, t, n, i, r) {
    if (t < r || i < r) return null;
    const o = e + t - r + 1,
      s = n + i - r + 1;
    let a = 0,
      l = 0,
      c = 0;
    for (let d = e; d < o; d++)
      for (let e = n; e < s; e++) {
        const t = this._contiguousSequenceScore(d, e, r);
        t > 0 && t > a && ((a = t), (l = d), (c = e));
      }
    return a > 0 ? [l, c] : null;
  }
  _contiguousSequenceScore(e, t, n) {
    let i = 0;
    for (let r = 0; r < n; r++) {
      if (!this.ElementsAreEqual(e + r, t + r)) return 0;
      i += this._originalStringElements[e + r].length;
    }
    return i;
  }
  _OriginalIsBoundary(e) {
    return (
      e <= 0 ||
      e >= this._originalElementsOrHash.length - 1 ||
      (this._hasStrings && /^\s*$/.test(this._originalStringElements[e]))
    );
  }
  _OriginalRegionIsBoundary(e, t) {
    if (this._OriginalIsBoundary(e) || this._OriginalIsBoundary(e - 1)) return !0;
    if (t > 0) {
      const n = e + t;
      if (this._OriginalIsBoundary(n - 1) || this._OriginalIsBoundary(n)) return !0;
    }
    return !1;
  }
  _ModifiedIsBoundary(e) {
    return (
      e <= 0 ||
      e >= this._modifiedElementsOrHash.length - 1 ||
      (this._hasStrings && /^\s*$/.test(this._modifiedStringElements[e]))
    );
  }
  _ModifiedRegionIsBoundary(e, t) {
    if (this._ModifiedIsBoundary(e) || this._ModifiedIsBoundary(e - 1)) return !0;
    if (t > 0) {
      const n = e + t;
      if (this._ModifiedIsBoundary(n - 1) || this._ModifiedIsBoundary(n)) return !0;
    }
    return !1;
  }
  _boundaryScore(e, t, n, i) {
    return (
      (this._OriginalRegionIsBoundary(e, t) ? 1 : 0) +
      (this._ModifiedRegionIsBoundary(n, i) ? 1 : 0)
    );
  }
  ConcatenateChanges(e, t) {
    const n = [];
    if (0 === e.length || 0 === t.length) return t.length > 0 ? t : e;
    if (this.ChangesOverlap(e[e.length - 1], t[0], n)) {
      const i = new Array(e.length + t.length - 1);
      return (
        vxe.Copy(e, 0, i, 0, e.length - 1),
        (i[e.length - 1] = n[0]),
        vxe.Copy(t, 1, i, e.length, t.length - 1),
        i
      );
    }
    {
      const n = new Array(e.length + t.length);
      return (vxe.Copy(e, 0, n, 0, e.length), vxe.Copy(t, 0, n, e.length, t.length), n);
    }
  }
  ChangesOverlap(e, t, n) {
    if (
      (_xe.Assert(
        e.originalStart <= t.originalStart,
        "Left change is not less than or equal to right change",
      ),
      _xe.Assert(
        e.modifiedStart <= t.modifiedStart,
        "Left change is not less than or equal to right change",
      ),
      e.originalStart + e.originalLength >= t.originalStart ||
        e.modifiedStart + e.modifiedLength >= t.modifiedStart)
    ) {
      const i = e.originalStart;
      let r = e.originalLength;
      const o = e.modifiedStart;
      let s = e.modifiedLength;
      return (
        e.originalStart + e.originalLength >= t.originalStart &&
          (r = t.originalStart + t.originalLength - e.originalStart),
        e.modifiedStart + e.modifiedLength >= t.modifiedStart &&
          (s = t.modifiedStart + t.modifiedLength - e.modifiedStart),
        (n[0] = new pxe(i, r, o, s)),
        !0
      );
    }
    return ((n[0] = null), !1);
  }
  ClipDiagonalBound(e, t, n, i) {
    if (e >= 0 && e < i) return e;
    const r = t % 2 == 0;
    if (e < 0) {
      return r === (n % 2 == 0) ? 0 : 1;
    }
    return r === ((i - n - 1) % 2 == 0) ? i - 1 : i - 2;
  }
}
function xxe(e) {
  return !!e && void 0 !== e.visibility;
}
function wxe(e) {
  switch (e) {
    case !0:
      return 1;
    case !1:
      return 0;
    default:
      return e;
  }
}
function Cxe(e) {
  return "collapsible" in e;
}
class Sxe {
  constructor(e, t, n = {}) {
    ((this.user = e),
      (this.rootRef = []),
      (this.eventBufferer = new rM()),
      (this._onDidSpliceModel = new QO()),
      (this.onDidSpliceModel = this._onDidSpliceModel.event),
      (this._onDidSpliceRenderedNodes = new QO()),
      (this.onDidSpliceRenderedNodes = this._onDidSpliceRenderedNodes.event),
      (this._onDidChangeCollapseState = new QO()),
      (this.onDidChangeCollapseState = this.eventBufferer.wrapEvent(
        this._onDidChangeCollapseState.event,
      )),
      (this._onDidChangeRenderNodeCount = new QO()),
      (this.onDidChangeRenderNodeCount = this.eventBufferer.wrapEvent(
        this._onDidChangeRenderNodeCount.event,
      )),
      (this.refilterDelayer = new mM(uM)),
      (this.collapseByDefault = void 0 !== n.collapseByDefault && n.collapseByDefault),
      (this.allowNonCollapsibleParents = n.allowNonCollapsibleParents ?? !1),
      (this.filter = n.filter),
      (this.autoExpandSingleChildren =
        void 0 !== n.autoExpandSingleChildren && n.autoExpandSingleChildren),
      (this.root = {
        parent: void 0,
        element: t,
        children: [],
        depth: 0,
        visibleChildrenCount: 0,
        visibleChildIndex: -1,
        collapsible: !1,
        collapsed: !1,
        renderNodeCount: 0,
        visibility: 1,
        visible: !0,
        filterData: void 0,
      }));
  }
  splice(e, t, n = DO.empty(), i = {}) {
    if (0 === e.length) throw new hxe(this.user, "Invalid tree location");
    i.diffIdentityProvider
      ? this.spliceSmart(i.diffIdentityProvider, e, t, n, i)
      : this.spliceSimple(e, t, n, i);
  }
  spliceSmart(e, t, n, i = DO.empty(), r, o = r.diffDepth ?? 0) {
    const { parentNode: s } = this.getParentNodeWithListIndex(t);
    if (!s.lastDiffIds) return this.spliceSimple(t, n, i, r);
    const a = [...i],
      l = t[t.length - 1],
      c = new yxe(
        { getElements: () => s.lastDiffIds },
        {
          getElements: () =>
            [...s.children.slice(0, l), ...a, ...s.children.slice(l + n)].map((t) =>
              e.getId(t.element).toString(),
            ),
        },
      ).ComputeDiff(!1);
    if (c.quitEarly) return ((s.lastDiffIds = void 0), this.spliceSimple(t, n, a, r));
    const d = t.slice(0, -1),
      u = (t, n, i) => {
        if (o > 0)
          for (let s = 0; s < i; s++)
            (t--,
              n--,
              this.spliceSmart(e, [...d, t, 0], Number.MAX_SAFE_INTEGER, a[n].children, r, o - 1));
      };
    let h = Math.min(s.children.length, l + n),
      g = a.length;
    for (const p of c.changes.sort((e, t) => t.originalStart - e.originalStart))
      (u(h, g, h - (p.originalStart + p.originalLength)),
        (h = p.originalStart),
        (g = p.modifiedStart - l),
        this.spliceSimple([...d, h], p.originalLength, DO.slice(a, g, g + p.modifiedLength), r));
    u(h, g, h);
  }
  spliceSimple(
    e,
    t,
    n = DO.empty(),
    { onDidCreateNode: i, onDidDeleteNode: r, diffIdentityProvider: o },
  ) {
    const {
        parentNode: s,
        listIndex: a,
        revealed: l,
        visible: c,
      } = this.getParentNodeWithListIndex(e),
      d = [],
      u = DO.map(n, (e) => this.createTreeNode(e, s, s.visible ? 1 : 0, l, d, i)),
      h = e[e.length - 1];
    let g = 0;
    for (let y = h; y >= 0 && y < s.children.length; y--) {
      const e = s.children[y];
      if (e.visible) {
        g = e.visibleChildIndex;
        break;
      }
    }
    const p = [];
    let f = 0,
      m = 0;
    for (const y of u)
      (p.push(y), (m += y.renderNodeCount), y.visible && (y.visibleChildIndex = g + f++));
    const _ = mj(s.children, h, t, p);
    o
      ? s.lastDiffIds
        ? mj(
            s.lastDiffIds,
            h,
            t,
            p.map((e) => o.getId(e.element).toString()),
          )
        : (s.lastDiffIds = s.children.map((e) => o.getId(e.element).toString()))
      : (s.lastDiffIds = void 0);
    let v = 0;
    for (const y of _) y.visible && v++;
    if (0 !== v)
      for (let y = h + p.length; y < s.children.length; y++) {
        const e = s.children[y];
        e.visible && (e.visibleChildIndex -= v);
      }
    if (((s.visibleChildrenCount += f - v), _.length > 0 && r)) {
      const e = (t) => {
        (r(t), t.children.forEach(e));
      };
      _.forEach(e);
    }
    if (l && c) {
      const e = _.reduce((e, t) => e + (t.visible ? t.renderNodeCount : 0), 0);
      (this._updateAncestorsRenderNodeCount(s, m - e),
        this._onDidSpliceRenderedNodes.fire({ start: a, deleteCount: e, elements: d }));
    }
    this._onDidSpliceModel.fire({ insertedNodes: p, deletedNodes: _ });
    let b = s;
    for (; b; ) {
      if (2 === b.visibility) {
        this.refilterDelayer.trigger(() => this.refilter());
        break;
      }
      b = b.parent;
    }
  }
  rerender(e) {
    if (0 === e.length) throw new hxe(this.user, "Invalid tree location");
    const { node: t, listIndex: n, revealed: i } = this.getTreeNodeWithListIndex(e);
    t.visible &&
      i &&
      this._onDidSpliceRenderedNodes.fire({ start: n, deleteCount: 1, elements: [t] });
  }
  has(e) {
    return this.hasTreeNode(e);
  }
  getListIndex(e) {
    const { listIndex: t, visible: n, revealed: i } = this.getTreeNodeWithListIndex(e);
    return n && i ? t : -1;
  }
  getListRenderCount(e) {
    return this.getTreeNode(e).renderNodeCount;
  }
  isCollapsible(e) {
    return this.getTreeNode(e).collapsible;
  }
  setCollapsible(e, t) {
    const n = this.getTreeNode(e);
    void 0 === t && (t = !n.collapsible);
    const i = { collapsible: t };
    return this.eventBufferer.bufferEvents(() => this._setCollapseState(e, i));
  }
  isCollapsed(e) {
    return this.getTreeNode(e).collapsed;
  }
  setCollapsed(e, t, n) {
    const i = this.getTreeNode(e);
    void 0 === t && (t = !i.collapsed);
    const r = { collapsed: t, recursive: n || !1 };
    return this.eventBufferer.bufferEvents(() => this._setCollapseState(e, r));
  }
  _setCollapseState(e, t) {
    const { node: n, listIndex: i, revealed: r } = this.getTreeNodeWithListIndex(e),
      o = this._setListNodeCollapseState(n, i, r, t);
    if (
      n !== this.root &&
      this.autoExpandSingleChildren &&
      o &&
      !Cxe(t) &&
      n.collapsible &&
      !n.collapsed &&
      !t.recursive
    ) {
      let i = -1;
      for (let e = 0; e < n.children.length; e++) {
        if (n.children[e].visible) {
          if (i > -1) {
            i = -1;
            break;
          }
          i = e;
        }
      }
      i > -1 && this._setCollapseState([...e, i], t);
    }
    return o;
  }
  _setListNodeCollapseState(e, t, n, i) {
    const r = this._setNodeCollapseState(e, i, !1);
    if (!n || !e.visible || !r) return r;
    const o = e.renderNodeCount,
      s = this.updateNodeAfterCollapseChange(e),
      a = o - (-1 === t ? 0 : 1);
    return (
      this._onDidSpliceRenderedNodes.fire({ start: t + 1, deleteCount: a, elements: s.slice(1) }),
      r
    );
  }
  _setNodeCollapseState(e, t, n) {
    let i;
    if (
      (e === this.root
        ? (i = !1)
        : (Cxe(t)
            ? ((i = e.collapsible !== t.collapsible), (e.collapsible = t.collapsible))
            : e.collapsible
              ? ((i = e.collapsed !== t.collapsed), (e.collapsed = t.collapsed))
              : (i = !1),
          i && this._onDidChangeCollapseState.fire({ node: e, deep: n })),
      !Cxe(t) && t.recursive)
    )
      for (const r of e.children) i = this._setNodeCollapseState(r, t, !0) || i;
    return i;
  }
  expandTo(e) {
    this.eventBufferer.bufferEvents(() => {
      let t = this.getTreeNode(e);
      for (; t.parent; )
        ((t = t.parent),
          (e = e.slice(0, e.length - 1)),
          t.collapsed && this._setCollapseState(e, { collapsed: !1, recursive: !1 }));
    });
  }
  refilter() {
    const e = this.root.renderNodeCount,
      t = this.updateNodeAfterFilterChange(this.root);
    (this._onDidSpliceRenderedNodes.fire({ start: 0, deleteCount: e, elements: t }),
      this.refilterDelayer.cancel());
  }
  createTreeNode(e, t, n, i, r, o) {
    const s = {
        parent: t,
        element: e.element,
        children: [],
        depth: t.depth + 1,
        visibleChildrenCount: 0,
        visibleChildIndex: -1,
        collapsible: "boolean" == typeof e.collapsible ? e.collapsible : void 0 !== e.collapsed,
        collapsed: void 0 === e.collapsed ? this.collapseByDefault : e.collapsed,
        renderNodeCount: 1,
        visibility: 1,
        visible: !0,
        filterData: void 0,
      },
      a = this._filterNode(s, n);
    ((s.visibility = a), i && r.push(s));
    const l = e.children || DO.empty(),
      c = i && 0 !== a && !s.collapsed;
    let d = 0,
      u = 1;
    for (const h of l) {
      const e = this.createTreeNode(h, s, a, c, r, o);
      (s.children.push(e), (u += e.renderNodeCount), e.visible && (e.visibleChildIndex = d++));
    }
    return (
      this.allowNonCollapsibleParents || (s.collapsible = s.collapsible || s.children.length > 0),
      (s.visibleChildrenCount = d),
      (s.visible = 2 === a ? d > 0 : 1 === a),
      s.visible ? s.collapsed || (s.renderNodeCount = u) : ((s.renderNodeCount = 0), i && r.pop()),
      o?.(s),
      s
    );
  }
  updateNodeAfterCollapseChange(e) {
    const t = e.renderNodeCount,
      n = [];
    return (
      this._updateNodeAfterCollapseChange(e, n),
      this._updateAncestorsRenderNodeCount(e.parent, n.length - t),
      n
    );
  }
  _updateNodeAfterCollapseChange(e, t) {
    if (!1 === e.visible) return 0;
    if ((t.push(e), (e.renderNodeCount = 1), !e.collapsed))
      for (const n of e.children) e.renderNodeCount += this._updateNodeAfterCollapseChange(n, t);
    return (this._onDidChangeRenderNodeCount.fire(e), e.renderNodeCount);
  }
  updateNodeAfterFilterChange(e) {
    const t = e.renderNodeCount,
      n = [];
    return (
      this._updateNodeAfterFilterChange(e, e.visible ? 1 : 0, n),
      this._updateAncestorsRenderNodeCount(e.parent, n.length - t),
      n
    );
  }
  _updateNodeAfterFilterChange(e, t, n, i = !0) {
    let r;
    if (e !== this.root) {
      if (((r = this._filterNode(e, t)), 0 === r))
        return ((e.visible = !1), (e.renderNodeCount = 0), !1);
      i && n.push(e);
    }
    const o = n.length;
    e.renderNodeCount = e === this.root ? 0 : 1;
    let s = !1;
    if (e.collapsed && 0 === r) e.visibleChildrenCount = 0;
    else {
      let t = 0;
      for (const o of e.children)
        ((s = this._updateNodeAfterFilterChange(o, r, n, i && !e.collapsed) || s),
          o.visible && (o.visibleChildIndex = t++));
      e.visibleChildrenCount = t;
    }
    return (
      e !== this.root && ((e.visible = 2 === r ? s : 1 === r), (e.visibility = r)),
      e.visible
        ? e.collapsed || (e.renderNodeCount += n.length - o)
        : ((e.renderNodeCount = 0), i && n.pop()),
      this._onDidChangeRenderNodeCount.fire(e),
      e.visible
    );
  }
  _updateAncestorsRenderNodeCount(e, t) {
    if (0 !== t)
      for (; e; )
        ((e.renderNodeCount += t), this._onDidChangeRenderNodeCount.fire(e), (e = e.parent));
  }
  _filterNode(e, t) {
    const n = this.filter ? this.filter.filter(e.element, t) : 1;
    return "boolean" == typeof n
      ? ((e.filterData = void 0), n ? 1 : 0)
      : xxe(n)
        ? ((e.filterData = n.data), wxe(n.visibility))
        : ((e.filterData = void 0), wxe(n));
  }
  hasTreeNode(e, t = this.root) {
    if (!e || 0 === e.length) return !0;
    const [n, ...i] = e;
    return !(n < 0 || n > t.children.length) && this.hasTreeNode(i, t.children[n]);
  }
  getTreeNode(e, t = this.root) {
    if (!e || 0 === e.length) return t;
    const [n, ...i] = e;
    if (n < 0 || n > t.children.length) throw new hxe(this.user, "Invalid tree location");
    return this.getTreeNode(i, t.children[n]);
  }
  getTreeNodeWithListIndex(e) {
    if (0 === e.length) return { node: this.root, listIndex: -1, revealed: !0, visible: !1 };
    const {
        parentNode: t,
        listIndex: n,
        revealed: i,
        visible: r,
      } = this.getParentNodeWithListIndex(e),
      o = e[e.length - 1];
    if (o < 0 || o > t.children.length) throw new hxe(this.user, "Invalid tree location");
    const s = t.children[o];
    return { node: s, listIndex: n, revealed: i, visible: r && s.visible };
  }
  getParentNodeWithListIndex(e, t = this.root, n = 0, i = !0, r = !0) {
    const [o, ...s] = e;
    if (o < 0 || o > t.children.length) throw new hxe(this.user, "Invalid tree location");
    for (let a = 0; a < o; a++) n += t.children[a].renderNodeCount;
    return (
      (i = i && !t.collapsed),
      (r = r && t.visible),
      0 === s.length
        ? { parentNode: t, listIndex: n, revealed: i, visible: r }
        : this.getParentNodeWithListIndex(s, t.children[o], n + 1, i, r)
    );
  }
  getNode(e = []) {
    return this.getTreeNode(e);
  }
  getNodeLocation(e) {
    const t = [];
    let n = e;
    for (; n.parent; ) (t.push(n.parent.children.indexOf(n)), (n = n.parent));
    return t.reverse();
  }
  getParentNodeLocation(e) {
    return 0 === e.length
      ? void 0
      : 1 === e.length
        ? []
        : (function (e) {
            if (0 === e.length) throw new Error("Invalid tail call");
            return [e.slice(0, e.length - 1), e[e.length - 1]];
          })(e)[0];
  }
  getFirstElementChild(e) {
    const t = this.getTreeNode(e);
    if (0 !== t.children.length) return t.children[0].element;
  }
}
class kxe extends Mae {
  constructor(e) {
    (super(e.elements.map((e) => e.element)), (this.data = e));
  }
}
function Exe(e) {
  return e instanceof Mae ? new kxe(e) : e;
}
class Nxe {
  constructor(e, t) {
    ((this.modelProvider = e),
      (this.dnd = t),
      (this.autoExpandDisposable = PO.None),
      (this.disposables = new AO()));
  }
  getDragURI(e) {
    return this.dnd.getDragURI(e.element);
  }
  getDragLabel(e, t) {
    if (this.dnd.getDragLabel)
      return this.dnd.getDragLabel(
        e.map((e) => e.element),
        t,
      );
  }
  onDragStart(e, t) {
    this.dnd.onDragStart?.(Exe(e), t);
  }
  onDragOver(e, t, n, i, r, o = !0) {
    const s = this.dnd.onDragOver(Exe(e), t && t.element, n, i, r),
      a = this.autoExpandNode !== t;
    if ((a && (this.autoExpandDisposable.dispose(), (this.autoExpandNode = t)), void 0 === t))
      return s;
    if (
      (a &&
        "boolean" != typeof s &&
        s.autoExpand &&
        (this.autoExpandDisposable = bM(
          () => {
            const e = this.modelProvider(),
              n = e.getNodeLocation(t);
            (e.isCollapsed(n) && e.setCollapsed(n, !1), (this.autoExpandNode = void 0));
          },
          500,
          this.disposables,
        )),
      "boolean" == typeof s || !s.accept || void 0 === s.bubble || s.feedback)
    ) {
      if (!o) {
        return {
          accept: "boolean" == typeof s ? s : s.accept,
          effect: "boolean" == typeof s ? void 0 : s.effect,
          feedback: [n],
        };
      }
      return s;
    }
    if (1 === s.bubble) {
      const n = this.modelProvider(),
        o = n.getNodeLocation(t),
        s = n.getParentNodeLocation(o),
        a = n.getNode(s),
        l = s && n.getListIndex(s);
      return this.onDragOver(e, a, l, i, r, !1);
    }
    const l = this.modelProvider(),
      c = l.getNodeLocation(t),
      d = l.getListIndex(c),
      u = l.getListRenderCount(c);
    return { ...s, feedback: cj(d, d + u) };
  }
  drop(e, t, n, i, r) {
    (this.autoExpandDisposable.dispose(),
      (this.autoExpandNode = void 0),
      this.dnd.drop(Exe(e), t && t.element, n, i, r));
  }
  onDragEnd(e) {
    this.dnd.onDragEnd?.(e);
  }
  dispose() {
    (this.disposables.dispose(), this.dnd.dispose());
  }
}
function Lxe(e, t, n) {
  return (
    n && {
      ...n,
      identityProvider: n.identityProvider && { getId: (e) => n.identityProvider.getId(e.element) },
      dnd: n.dnd && t.add(new Nxe(e, n.dnd)),
      multipleSelectionController: n.multipleSelectionController && {
        isSelectionSingleChangeEvent: (e) =>
          n.multipleSelectionController.isSelectionSingleChangeEvent({ ...e, element: e.element }),
        isSelectionRangeChangeEvent: (e) =>
          n.multipleSelectionController.isSelectionRangeChangeEvent({ ...e, element: e.element }),
      },
      accessibilityProvider: n.accessibilityProvider && {
        ...n.accessibilityProvider,
        getSetSize(t) {
          const n = e(),
            i = n.getNodeLocation(t),
            r = n.getParentNodeLocation(i);
          return n.getNode(r).visibleChildrenCount;
        },
        getPosInSet: (e) => e.visibleChildIndex + 1,
        isChecked:
          n.accessibilityProvider && n.accessibilityProvider.isChecked
            ? (e) => n.accessibilityProvider.isChecked(e.element)
            : void 0,
        getRole:
          n.accessibilityProvider && n.accessibilityProvider.getRole
            ? (e) => n.accessibilityProvider.getRole(e.element)
            : () => "treeitem",
        getAriaLabel: (e) => n.accessibilityProvider.getAriaLabel(e.element),
        getWidgetAriaLabel: () => n.accessibilityProvider.getWidgetAriaLabel(),
        getWidgetRole:
          n.accessibilityProvider && n.accessibilityProvider.getWidgetRole
            ? () => n.accessibilityProvider.getWidgetRole()
            : () => "tree",
        getAriaLevel:
          n.accessibilityProvider && n.accessibilityProvider.getAriaLevel
            ? (e) => n.accessibilityProvider.getAriaLevel(e.element)
            : (e) => e.depth,
        getActiveDescendantId:
          n.accessibilityProvider.getActiveDescendantId &&
          ((e) => n.accessibilityProvider.getActiveDescendantId(e.element)),
      },
      keyboardNavigationLabelProvider: n.keyboardNavigationLabelProvider && {
        ...n.keyboardNavigationLabelProvider,
        getKeyboardNavigationLabel: (e) =>
          n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element),
      },
    }
  );
}
class Dxe {
  constructor(e) {
    this.delegate = e;
  }
  getHeight(e) {
    return this.delegate.getHeight(e.element);
  }
  getTemplateId(e) {
    return this.delegate.getTemplateId(e.element);
  }
  hasDynamicHeight(e) {
    return !!this.delegate.hasDynamicHeight && this.delegate.hasDynamicHeight(e.element);
  }
  setDynamicHeight(e, t) {
    this.delegate.setDynamicHeight?.(e.element, t);
  }
}
!(function (e) {
  ((e.None = "none"), (e.OnHover = "onHover"), (e.Always = "always"));
})(lxe || (lxe = {}));
class Txe {
  get elements() {
    return this._elements;
  }
  constructor(e, t = []) {
    ((this._elements = t),
      (this.disposables = new AO()),
      (this.onDidChange = $O.forEach(e, (e) => (this._elements = e), this.disposables)));
  }
  dispose() {
    this.disposables.dispose();
  }
}
class Ixe {
  static {
    this.DefaultIndent = 8;
  }
  constructor(e, t, n, i, r, o = {}) {
    ((this.renderer = e),
      (this.model = t),
      (this.activeNodes = i),
      (this.renderedIndentGuides = r),
      (this.renderedElements = new Map()),
      (this.renderedNodes = new Map()),
      (this.indent = Ixe.DefaultIndent),
      (this.hideTwistiesOfChildlessElements = !1),
      (this.shouldRenderIndentGuides = !1),
      (this.activeIndentNodes = new Set()),
      (this.indentGuidesDisposable = PO.None),
      (this.disposables = new AO()),
      (this.templateId = e.templateId),
      this.updateOptions(o),
      $O.map(n, (e) => e.node)(this.onDidChangeNodeTwistieState, this, this.disposables),
      e.onDidChangeTwistieState?.(this.onDidChangeTwistieState, this, this.disposables));
  }
  updateOptions(e = {}) {
    if (void 0 !== e.indent) {
      const t = wae(e.indent, 0, 40);
      if (t !== this.indent) {
        this.indent = t;
        for (const [e, t] of this.renderedNodes)
          ((t.indentSize = Ixe.DefaultIndent + (e.depth - 1) * this.indent),
            this.renderTreeElement(e, t));
      }
    }
    if (void 0 !== e.renderIndentGuides) {
      const t = e.renderIndentGuides !== lxe.None;
      if (t !== this.shouldRenderIndentGuides) {
        this.shouldRenderIndentGuides = t;
        for (const [e, t] of this.renderedNodes) this._renderIndentGuides(e, t);
        if ((this.indentGuidesDisposable.dispose(), t)) {
          const e = new AO();
          (this.activeNodes.onDidChange(this._onDidChangeActiveNodes, this, e),
            (this.indentGuidesDisposable = e),
            this._onDidChangeActiveNodes(this.activeNodes.elements));
        }
      }
    }
    void 0 !== e.hideTwistiesOfChildlessElements &&
      (this.hideTwistiesOfChildlessElements = e.hideTwistiesOfChildlessElements);
  }
  renderTemplate(e) {
    const t = MB(e, VB(".monaco-tl-row")),
      n = MB(t, VB(".monaco-tl-indent")),
      i = MB(t, VB(".monaco-tl-twistie")),
      r = MB(t, VB(".monaco-tl-contents")),
      o = this.renderer.renderTemplate(r);
    return {
      container: e,
      indent: n,
      twistie: i,
      indentGuidesDisposable: PO.None,
      indentSize: 0,
      templateData: o,
    };
  }
  renderElement(e, t, n, i) {
    ((n.indentSize = Ixe.DefaultIndent + (e.depth - 1) * this.indent),
      this.renderedNodes.set(e, n),
      this.renderedElements.set(e.element, e),
      this.renderTreeElement(e, n),
      this.renderer.renderElement(e, t, n.templateData, { ...i, indent: n.indentSize }));
  }
  disposeElement(e, t, n, i) {
    (n.indentGuidesDisposable.dispose(),
      this.renderer.disposeElement?.(e, t, n.templateData, { ...i, indent: n.indentSize }),
      "number" == typeof i?.height &&
        (this.renderedNodes.delete(e), this.renderedElements.delete(e.element)));
  }
  disposeTemplate(e) {
    this.renderer.disposeTemplate(e.templateData);
  }
  onDidChangeTwistieState(e) {
    const t = this.renderedElements.get(e);
    t && this.onDidChangeNodeTwistieState(t);
  }
  onDidChangeNodeTwistieState(e) {
    const t = this.renderedNodes.get(e);
    t && (this._onDidChangeActiveNodes(this.activeNodes.elements), this.renderTreeElement(e, t));
  }
  renderTreeElement(e, t) {
    ((t.twistie.style.paddingLeft = `${t.indentSize}px`),
      (t.indent.style.width = t.indentSize + this.indent - 16 + "px"),
      e.collapsible
        ? t.container.setAttribute("aria-expanded", String(!e.collapsed))
        : t.container.removeAttribute("aria-expanded"),
      t.twistie.classList.remove(...AV.asClassNameArray(OV.treeItemExpanded)));
    let n = !1;
    (this.renderer.renderTwistie && (n = this.renderer.renderTwistie(e.element, t.twistie)),
      e.collapsible && (!this.hideTwistiesOfChildlessElements || e.visibleChildrenCount > 0)
        ? (n || t.twistie.classList.add(...AV.asClassNameArray(OV.treeItemExpanded)),
          t.twistie.classList.add("collapsible"),
          t.twistie.classList.toggle("collapsed", e.collapsed))
        : t.twistie.classList.remove("collapsible", "collapsed"),
      this._renderIndentGuides(e, t));
  }
  _renderIndentGuides(e, t) {
    if ((zF(t.indent), t.indentGuidesDisposable.dispose(), !this.shouldRenderIndentGuides)) return;
    const n = new AO();
    for (;;) {
      const i = this.model.getNodeLocation(e),
        r = this.model.getParentNodeLocation(i);
      if (!r) break;
      const o = this.model.getNode(r),
        s = VB(".indent-guide", { style: `width: ${this.indent}px` });
      (this.activeIndentNodes.has(o) && s.classList.add("active"),
        0 === t.indent.childElementCount
          ? t.indent.appendChild(s)
          : t.indent.insertBefore(s, t.indent.firstElementChild),
        this.renderedIndentGuides.add(o, s),
        n.add(MO(() => this.renderedIndentGuides.delete(o, s))),
        (e = o));
    }
    t.indentGuidesDisposable = n;
  }
  _onDidChangeActiveNodes(e) {
    if (!this.shouldRenderIndentGuides) return;
    const t = new Set();
    (e.forEach((e) => {
      const n = this.model.getNodeLocation(e);
      try {
        const i = this.model.getParentNodeLocation(n);
        e.collapsible && e.children.length > 0 && !e.collapsed
          ? t.add(e)
          : i && t.add(this.model.getNode(i));
      } catch {}
    }),
      this.activeIndentNodes.forEach((e) => {
        t.has(e) || this.renderedIndentGuides.forEach(e, (e) => e.classList.remove("active"));
      }),
      t.forEach((e) => {
        this.activeIndentNodes.has(e) ||
          this.renderedIndentGuides.forEach(e, (e) => e.classList.add("active"));
      }),
      (this.activeIndentNodes = t));
  }
  dispose() {
    (this.renderedNodes.clear(),
      this.renderedElements.clear(),
      this.indentGuidesDisposable.dispose(),
      IO(this.disposables));
  }
}
function Rxe(e, t) {
  const n = t.toLowerCase().indexOf(e);
  let i;
  if (n > -1) {
    i = [Number.MAX_SAFE_INTEGER, 0];
    for (let t = e.length; t > 0; t--) i.push(n + t - 1);
  }
  return i;
}
class Oxe {
  get totalCount() {
    return this._totalCount;
  }
  get matchCount() {
    return this._matchCount;
  }
  set findMatchType(e) {
    this._findMatchType = e;
  }
  get findMatchType() {
    return this._findMatchType;
  }
  set findMode(e) {
    this._findMode = e;
  }
  get findMode() {
    return this._findMode;
  }
  constructor(e, t, n) {
    ((this._keyboardNavigationLabelProvider = e),
      (this._filter = t),
      (this._defaultFindVisibility = n),
      (this._totalCount = 0),
      (this._matchCount = 0),
      (this._findMatchType = dxe.Fuzzy),
      (this._findMode = cxe.Highlight),
      (this._pattern = ""),
      (this._lowercasePattern = ""),
      (this.disposables = new AO()));
  }
  filter(e, t) {
    let n = 1;
    if (this._filter) {
      const i = this._filter.filter(e, t);
      if (((n = "boolean" == typeof i ? (i ? 1 : 0) : xxe(i) ? wxe(i.visibility) : i), 0 === n))
        return !1;
    }
    if ((this._totalCount++, !this._pattern))
      return (this._matchCount++, { data: zie.Default, visibility: n });
    const i = this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),
      r = Array.isArray(i) ? i : [i];
    for (const o of r) {
      const e = o && o.toString();
      if (void 0 === e) return { data: zie.Default, visibility: n };
      let t;
      if (
        ((t =
          this._findMatchType === dxe.Contiguous
            ? Rxe(this._lowercasePattern, e.toLowerCase())
            : $ie(this._pattern, this._lowercasePattern, 0, e, e.toLowerCase(), 0, {
                firstMatchCanBeWeak: !0,
                boostFullMatch: !0,
              })),
        t)
      )
        return (
          this._matchCount++,
          1 === r.length
            ? { data: t, visibility: n }
            : { data: { label: e, score: t }, visibility: n }
        );
    }
    return this._findMode === cxe.Filter
      ? "number" == typeof this._defaultFindVisibility
        ? this._defaultFindVisibility
        : this._defaultFindVisibility
          ? this._defaultFindVisibility(e)
          : 2
      : { data: zie.Default, visibility: n };
  }
  reset() {
    ((this._totalCount = 0), (this._matchCount = 0));
  }
  dispose() {
    IO(this.disposables);
  }
}
class Mxe {
  constructor(e) {
    this.stateMap = new Map(e.map((e) => [e.id, { ...e }]));
  }
  get(e) {
    const t = this.stateMap.get(e);
    if (void 0 === t) throw new Error(`No state found for toggle id ${e}`);
    return t.isChecked;
  }
  set(e, t) {
    const n = this.stateMap.get(e);
    if (void 0 === n) throw new Error(`No state found for toggle id ${e}`);
    return n.isChecked !== t && ((n.isChecked = t), !0);
  }
}
(!(function (e) {
  ((e[(e.Highlight = 0)] = "Highlight"), (e[(e.Filter = 1)] = "Filter"));
})(cxe || (cxe = {})),
  (function (e) {
    ((e[(e.Fuzzy = 0)] = "Fuzzy"), (e[(e.Contiguous = 1)] = "Contiguous"));
  })(dxe || (dxe = {})),
  (function (e) {
    ((e.Mode = "mode"), (e.MatchType = "matchType"));
  })(uxe || (uxe = {})));
class Axe {
  get pattern() {
    return this._pattern;
  }
  get placeholder() {
    return this._placeholder;
  }
  set placeholder(e) {
    ((this._placeholder = e), this.widget?.setPlaceHolder(e));
  }
  constructor(e, t, n, i = {}) {
    ((this.tree = e),
      (this.filter = t),
      (this.contextViewProvider = n),
      (this.options = i),
      (this._pattern = ""),
      (this._onDidChangePattern = new QO()),
      (this._onDidChangeOpenState = new QO()),
      (this.onDidChangeOpenState = this._onDidChangeOpenState.event),
      (this.enabledDisposables = new AO()),
      (this.disposables = new AO()),
      (this.toggles = new Mxe(i.toggles ?? [])),
      (this._placeholder = i.placeholder ?? SI(20, "Type to search")));
  }
  isOpened() {
    return !!this.widget;
  }
  updateToggleState(e, t) {
    (this.toggles.set(e, t), this.widget?.setToggleState(e, t));
  }
  renderMessage(e, t) {
    e
      ? (this.tree.options.showNotFoundMessage ?? 1)
        ? this.widget?.showMessage({ type: 2, content: t ?? SI(21, "No results found.") })
        : this.widget?.showMessage({ type: 2 })
      : this.widget?.clearMessage();
  }
  alertResults(e) {
    pV(e ? SI(23, "{0} results", e) : SI(22, "No results"));
  }
  dispose() {
    ((this._history = void 0),
      this._onDidChangePattern.dispose(),
      this.enabledDisposables.dispose(),
      this.disposables.dispose());
  }
}
let Pxe = class extends Axe {
  get mode() {
    return this.toggles.get(uxe.Mode) ? cxe.Filter : cxe.Highlight;
  }
  set mode(e) {
    if (e === this.mode) return;
    const t = e === cxe.Filter;
    (this.updateToggleState(uxe.Mode, t),
      (this.placeholder = t ? SI(24, "Type to filter") : SI(25, "Type to search")),
      (this.filter.findMode = e),
      this.tree.refilter(),
      this.render(),
      this._onDidChangeMode.fire(e));
  }
  get matchType() {
    return this.toggles.get(uxe.MatchType) ? dxe.Fuzzy : dxe.Contiguous;
  }
  set matchType(e) {
    e !== this.matchType &&
      (this.updateToggleState(uxe.MatchType, e === dxe.Fuzzy),
      (this.filter.findMatchType = e),
      this.tree.refilter(),
      this.render(),
      this._onDidChangeMatchType.fire(e));
  }
  constructor(e, t, n, i = {}) {
    const r = i.defaultFindMode ?? cxe.Highlight,
      o = i.defaultFindMatchType ?? dxe.Fuzzy,
      s = [
        { id: uxe.Mode, icon: OV.listFilter, title: SI(26, "Filter"), isChecked: r === cxe.Filter },
        {
          id: uxe.MatchType,
          icon: OV.searchFuzzy,
          title: SI(27, "Fuzzy Match"),
          isChecked: o === dxe.Fuzzy,
        },
      ];
    ((t.findMatchType = o),
      (t.findMode = r),
      super(e, t, n, { ...i, toggles: s }),
      (this.filter = t),
      (this._onDidChangeMode = new QO()),
      (this.onDidChangeMode = this._onDidChangeMode.event),
      (this._onDidChangeMatchType = new QO()),
      (this.onDidChangeMatchType = this._onDidChangeMatchType.event),
      this.disposables.add(
        this.tree.onDidChangeModel(() => {
          this.isOpened() && (0 !== this.pattern.length && this.tree.refilter(), this.render());
        }),
      ),
      this.disposables.add(this.tree.onWillRefilter(() => this.filter.reset())));
  }
  updateOptions(e = {}) {
    (void 0 !== e.defaultFindMode && (this.mode = e.defaultFindMode),
      void 0 !== e.defaultFindMatchType && (this.matchType = e.defaultFindMatchType));
  }
  shouldAllowFocus(e) {
    return (
      !this.isOpened() ||
      !this.pattern ||
      (this.filter.totalCount > 0 && this.filter.matchCount <= 1) ||
      !zie.isDefault(e.filterData)
    );
  }
  render() {
    const e = 0 === this.filter.matchCount && this.filter.totalCount > 0 && this.pattern.length > 0;
    (this.renderMessage(e), this.pattern.length && this.alertResults(this.filter.matchCount));
  }
};
function jxe(e, t) {
  return e.position === t.position && Fxe(e, t);
}
function Fxe(e, t) {
  return (
    e.node.element === t.node.element &&
    e.startIndex === t.startIndex &&
    e.height === t.height &&
    e.endIndex === t.endIndex
  );
}
class Bxe {
  constructor(e = []) {
    this.stickyNodes = e;
  }
  get count() {
    return this.stickyNodes.length;
  }
  equal(e) {
    return XP(this.stickyNodes, e.stickyNodes, jxe);
  }
  contains(e) {
    return this.stickyNodes.some((t) => t.node.element === e.element);
  }
  lastNodePartiallyVisible() {
    if (0 === this.count) return !1;
    const e = this.stickyNodes[this.count - 1];
    if (1 === this.count) return 0 !== e.position;
    const t = this.stickyNodes[this.count - 2];
    return t.position + t.height !== e.position;
  }
  animationStateChanged(e) {
    if (!XP(this.stickyNodes, e.stickyNodes, Fxe)) return !1;
    if (0 === this.count) return !1;
    const t = this.stickyNodes[this.count - 1],
      n = e.stickyNodes[e.count - 1];
    return t.position !== n.position;
  }
}
class Vxe {
  constrainStickyScrollNodes(e, t, n) {
    for (let i = 0; i < e.length; i++) {
      const r = e[i];
      if (r.position + r.height > n || i >= t) return e.slice(0, i);
    }
    return e;
  }
}
let Wxe = class extends PO {
    constructor(e, t, n, i, r, o = {}) {
      (super(),
        (this.tree = e),
        (this.model = t),
        (this.view = n),
        (this.treeDelegate = r),
        (this.maxWidgetViewRatio = 0.4));
      const s = this.validateStickySettings(o);
      ((this.stickyScrollMaxItemCount = s.stickyScrollMaxItemCount),
        (this.stickyScrollDelegate = o.stickyScrollDelegate ?? new Vxe()),
        (this.paddingTop = o.paddingTop ?? 0),
        (this._widget = this._register(
          new Hxe(n.getScrollableElement(), n, e, i, r, o.accessibilityProvider),
        )),
        (this.onDidChangeHasFocus = this._widget.onDidChangeHasFocus),
        (this.onContextMenu = this._widget.onContextMenu),
        this._register(n.onDidScroll(() => this.update())),
        this._register(n.onDidChangeContentHeight(() => this.update())),
        this._register(e.onDidChangeCollapseState(() => this.update())),
        this._register(
          t.onDidSpliceRenderedNodes((e) => {
            const t = this._widget.state;
            if (!t) return;
            if (
              e.deleteCount > 0 &&
              t.stickyNodes.some((e) => !this.model.has(this.model.getNodeLocation(e.node)))
            )
              return void this.update();
            t.stickyNodes.some((n) => {
              const i = this.model.getListIndex(this.model.getNodeLocation(n.node));
              return i >= e.start && i < e.start + e.deleteCount && t.contains(n.node);
            }) && this._widget.rerender();
          }),
        ),
        this.update());
    }
    get height() {
      return this._widget.height;
    }
    getNodeAtHeight(e) {
      let t;
      if (
        ((t = 0 === e ? this.view.firstVisibleIndex : this.view.indexAt(e + this.view.scrollTop)),
        !(t < 0 || t >= this.view.length))
      )
        return this.view.element(t);
    }
    update() {
      const e = this.getNodeAtHeight(this.paddingTop);
      if (!e || this.tree.scrollTop <= this.paddingTop) return void this._widget.setState(void 0);
      const t = this.findStickyState(e);
      this._widget.setState(t);
    }
    findStickyState(e) {
      const t = [];
      let n = e,
        i = 0,
        r = this.getNextStickyNode(n, void 0, i);
      for (
        ;
        r &&
        (t.push(r),
        (i += r.height),
        !(t.length <= this.stickyScrollMaxItemCount) || ((n = this.getNextVisibleNode(r)), n));
      )
        r = this.getNextStickyNode(n, r.node, i);
      const o = this.constrainStickyNodes(t);
      return o.length ? new Bxe(o) : void 0;
    }
    getNextVisibleNode(e) {
      return this.getNodeAtHeight(e.position + e.height);
    }
    getNextStickyNode(e, t, n) {
      const i = this.getAncestorUnderPrevious(e, t);
      if (i) {
        if (i === e) {
          if (!this.nodeIsUncollapsedParent(e)) return;
          if (this.nodeTopAlignsWithStickyNodesBottom(e, n)) return;
        }
        return this.createStickyScrollNode(i, n);
      }
    }
    nodeTopAlignsWithStickyNodesBottom(e, t) {
      const n = this.getNodeIndex(e),
        i = this.view.getElementTop(n),
        r = t;
      return this.view.scrollTop === i - r;
    }
    createStickyScrollNode(e, t) {
      const n = this.treeDelegate.getHeight(e),
        { startIndex: i, endIndex: r } = this.getNodeRange(e);
      return {
        node: e,
        position: this.calculateStickyNodePosition(r, t, n),
        height: n,
        startIndex: i,
        endIndex: r,
      };
    }
    getAncestorUnderPrevious(e, t = void 0) {
      let n = e,
        i = this.getParentNode(n);
      for (; i; ) {
        if (i === t) return n;
        ((n = i), (i = this.getParentNode(n)));
      }
      if (void 0 === t) return n;
    }
    calculateStickyNodePosition(e, t, n) {
      let i = this.view.getRelativeTop(e);
      if (null === i && this.view.firstVisibleIndex === e && e + 1 < this.view.length) {
        const t = this.treeDelegate.getHeight(this.view.element(e)),
          n = this.view.getRelativeTop(e + 1);
        i = n ? n - t / this.view.renderHeight : null;
      }
      if (null === i) return t;
      const r = this.view.element(e),
        o = this.treeDelegate.getHeight(r),
        s = i * this.view.renderHeight + o;
      return t + n > s && t <= s ? s - n : t;
    }
    constrainStickyNodes(e) {
      if (0 === e.length) return [];
      const t = this.view.renderHeight * this.maxWidgetViewRatio,
        n = e[e.length - 1];
      if (e.length <= this.stickyScrollMaxItemCount && n.position + n.height <= t) return e;
      const i = this.stickyScrollDelegate.constrainStickyScrollNodes(
        e,
        this.stickyScrollMaxItemCount,
        t,
      );
      if (!i.length) return [];
      const r = i[i.length - 1];
      if (i.length > this.stickyScrollMaxItemCount || r.position + r.height > t)
        throw new Error("stickyScrollDelegate violates constraints");
      return i;
    }
    getParentNode(e) {
      const t = this.model.getNodeLocation(e),
        n = this.model.getParentNodeLocation(t);
      return n ? this.model.getNode(n) : void 0;
    }
    nodeIsUncollapsedParent(e) {
      const t = this.model.getNodeLocation(e);
      return this.model.getListRenderCount(t) > 1;
    }
    getNodeIndex(e) {
      const t = this.model.getNodeLocation(e);
      return this.model.getListIndex(t);
    }
    getNodeRange(e) {
      const t = this.model.getNodeLocation(e),
        n = this.model.getListIndex(t);
      if (n < 0) throw new Error("Node not found in tree");
      return { startIndex: n, endIndex: n + this.model.getListRenderCount(t) - 1 };
    }
    nodePositionTopBelowWidget(e) {
      const t = [];
      let n = this.getParentNode(e);
      for (; n; ) (t.push(n), (n = this.getParentNode(n)));
      let i = 0;
      for (let r = 0; r < t.length && r < this.stickyScrollMaxItemCount; r++)
        i += this.treeDelegate.getHeight(t[r]);
      return i;
    }
    domFocus() {
      this._widget.domFocus();
    }
    focusedLast() {
      return this._widget.focusedLast();
    }
    updateOptions(e = {}) {
      if (
        (void 0 !== e.paddingTop && (this.paddingTop = e.paddingTop),
        void 0 !== e.stickyScrollMaxItemCount)
      ) {
        const t = this.validateStickySettings(e);
        this.stickyScrollMaxItemCount !== t.stickyScrollMaxItemCount &&
          ((this.stickyScrollMaxItemCount = t.stickyScrollMaxItemCount), this.update());
      }
    }
    validateStickySettings(e) {
      let t = 7;
      return (
        "number" == typeof e.stickyScrollMaxItemCount &&
          (t = Math.max(e.stickyScrollMaxItemCount, 1)),
        { stickyScrollMaxItemCount: t }
      );
    }
  },
  Hxe = class {
    get state() {
      return this._previousState;
    }
    constructor(e, t, n, i, r, o) {
      ((this.view = t),
        (this.tree = n),
        (this.treeRenderers = i),
        (this.treeDelegate = r),
        (this.accessibilityProvider = o),
        (this._previousElements = []),
        (this._previousStateDisposables = new AO()),
        (this._rootDomNode = VB(".monaco-tree-sticky-container.empty")),
        e.appendChild(this._rootDomNode));
      const s = VB(".monaco-tree-sticky-container-shadow");
      (this._rootDomNode.appendChild(s),
        (this.stickyScrollFocus = new zxe(this._rootDomNode, t)),
        (this.onDidChangeHasFocus = this.stickyScrollFocus.onDidChangeHasFocus),
        (this.onContextMenu = this.stickyScrollFocus.onContextMenu));
    }
    get height() {
      if (!this._previousState) return 0;
      const e = this._previousState.stickyNodes[this._previousState.count - 1];
      return e.position + e.height;
    }
    setState(e) {
      const t = !!this._previousState && this._previousState.count > 0,
        n = !!e && e.count > 0;
      if ((!t && !n) || (t && n && this._previousState.equal(e))) return;
      if ((t !== n && this.setVisible(n), !n))
        return (
          (this._previousState = void 0),
          (this._previousElements = []),
          void this._previousStateDisposables.clear()
        );
      const i = e.stickyNodes[e.count - 1];
      (this._previousState && e.animationStateChanged(this._previousState)
        ? (this._previousElements[this._previousState.count - 1].style.top = `${i.position}px`)
        : this.renderState(e),
        (this._previousState = e),
        (this._rootDomNode.style.height = `${i.position + i.height}px`));
    }
    renderState(e) {
      this._previousStateDisposables.clear();
      const t = Array(e.count);
      for (let n = e.count - 1; n >= 0; n--) {
        const i = e.stickyNodes[n],
          { element: r, disposable: o } = this.createElement(i, n, e.count);
        ((t[n] = r), this._rootDomNode.appendChild(r), this._previousStateDisposables.add(o));
      }
      (this.stickyScrollFocus.updateElements(t, e), (this._previousElements = t));
    }
    rerender() {
      this._previousState && this.renderState(this._previousState);
    }
    createElement(e, t, n) {
      const i = e.startIndex,
        r = document.createElement("div");
      ((r.style.top = `${e.position}px`),
        !1 !== this.tree.options.setRowHeight && (r.style.height = `${e.height}px`),
        !1 !== this.tree.options.setRowLineHeight && (r.style.lineHeight = `${e.height}px`),
        r.classList.add("monaco-tree-sticky-row"),
        r.classList.add("monaco-list-row"),
        r.setAttribute("data-index", `${i}`),
        r.setAttribute("data-parity", i % 2 == 0 ? "even" : "odd"),
        r.setAttribute("id", this.view.getElementID(i)));
      const o = this.setAccessibilityAttributes(r, e.node.element, t, n),
        s = this.treeDelegate.getTemplateId(e.node),
        a = this.treeRenderers.find((e) => e.templateId === s);
      if (!a) throw new Error(`No renderer found for template id ${s}`);
      let l = e.node;
      l === this.tree.getNode(this.tree.getNodeLocation(e.node)) && (l = new Proxy(e.node, {}));
      const c = a.renderTemplate(r);
      a.renderElement(l, e.startIndex, c, { height: e.height });
      const d = MO(() => {
        (o.dispose(),
          a.disposeElement(l, e.startIndex, c, { height: e.height }),
          a.disposeTemplate(c),
          r.remove());
      });
      return { element: r, disposable: d };
    }
    setAccessibilityAttributes(e, t, n, i) {
      if (!this.accessibilityProvider) return PO.None;
      (this.accessibilityProvider.getSetSize &&
        e.setAttribute("aria-setsize", String(this.accessibilityProvider.getSetSize(t, n, i))),
        this.accessibilityProvider.getPosInSet &&
          e.setAttribute("aria-posinset", String(this.accessibilityProvider.getPosInSet(t, n))),
        this.accessibilityProvider.getRole &&
          e.setAttribute("role", this.accessibilityProvider.getRole(t) ?? "treeitem"));
      const r = this.accessibilityProvider.getAriaLabel(t),
        o = r && "string" != typeof r ? r : xne(r),
        s = rF((t) => {
          const n = t.readObservable(o);
          n ? e.setAttribute("aria-label", n) : e.removeAttribute("aria-label");
        });
      "string" == typeof r || (r && e.setAttribute("aria-label", r.get()));
      const a =
        this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(t);
      return (
        "number" == typeof a && e.setAttribute("aria-level", `${a}`),
        e.setAttribute("aria-selected", String(!1)),
        s
      );
    }
    setVisible(e) {
      (this._rootDomNode.classList.toggle("empty", !e),
        e || this.stickyScrollFocus.updateElements([], void 0));
    }
    domFocus() {
      this.stickyScrollFocus.domFocus();
    }
    focusedLast() {
      return this.stickyScrollFocus.focusedLast();
    }
    dispose() {
      (this.stickyScrollFocus.dispose(),
        this._previousStateDisposables.dispose(),
        this._rootDomNode.remove());
    }
  };
class zxe extends PO {
  get domHasFocus() {
    return this._domHasFocus;
  }
  set domHasFocus(e) {
    e !== this._domHasFocus && (this._onDidChangeHasFocus.fire(e), (this._domHasFocus = e));
  }
  constructor(e, t) {
    (super(),
      (this.container = e),
      (this.view = t),
      (this.focusedIndex = -1),
      (this.elements = []),
      (this._onDidChangeHasFocus = new QO()),
      (this.onDidChangeHasFocus = this._onDidChangeHasFocus.event),
      (this._onContextMenu = new QO()),
      (this.onContextMenu = this._onContextMenu.event),
      (this._domHasFocus = !1),
      this._register($F(this.container, "focus", () => this.onFocus())),
      this._register($F(this.container, "blur", () => this.onBlur())),
      this._register(this.view.onDidFocus(() => this.toggleStickyScrollFocused(!1))),
      this._register(this.view.onKeyDown((e) => this.onKeyDown(e))),
      this._register(this.view.onMouseDown((e) => this.onMouseDown(e))),
      this._register(this.view.onContextMenu((e) => this.handleContextMenu(e))));
  }
  handleContextMenu(e) {
    const t = e.browserEvent.target;
    if (!Kae(t) && !qae(t)) return void (this.focusedLast() && this.view.domFocus());
    if (!LB(e.browserEvent)) {
      if (!this.state)
        throw new Error("Context menu should not be triggered when state is undefined");
      const t = this.state.stickyNodes.findIndex((t) => t.node.element === e.element?.element);
      if (-1 === t)
        throw new Error(
          "Context menu should not be triggered when element is not in sticky scroll widget",
        );
      return (this.container.focus(), void this.setFocus(t));
    }
    if (!this.state || this.focusedIndex < 0)
      throw new Error(
        "Context menu key should not be triggered when focus is not in sticky scroll widget",
      );
    const n = this.state.stickyNodes[this.focusedIndex].node.element,
      i = this.elements[this.focusedIndex];
    this._onContextMenu.fire({
      element: n,
      anchor: i,
      browserEvent: e.browserEvent,
      isStickyScroll: !0,
    });
  }
  onKeyDown(e) {
    if (this.domHasFocus && this.state)
      if ("ArrowUp" === e.key)
        (this.setFocusedElement(Math.max(0, this.focusedIndex - 1)),
          e.preventDefault(),
          e.stopPropagation());
      else if ("ArrowDown" === e.key || "ArrowRight" === e.key) {
        if (this.focusedIndex >= this.state.count - 1) {
          const e = this.state.stickyNodes[this.state.count - 1].startIndex + 1;
          (this.view.domFocus(),
            this.view.setFocus([e]),
            this.scrollNodeUnderWidget(e, this.state));
        } else this.setFocusedElement(this.focusedIndex + 1);
        (e.preventDefault(), e.stopPropagation());
      }
  }
  onMouseDown(e) {
    const t = e.browserEvent.target;
    (Kae(t) || qae(t)) && (e.browserEvent.preventDefault(), e.browserEvent.stopPropagation());
  }
  updateElements(e, t) {
    if (t && 0 === t.count)
      throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");
    if (t && t.count !== e.length) throw new Error("Sticky scroll focus received illigel state");
    const n = this.focusedIndex;
    if ((this.removeFocus(), (this.elements = e), (this.state = t), t)) {
      const e = wae(n, 0, t.count - 1);
      this.setFocus(e);
    } else this.domHasFocus && this.view.domFocus();
    this.container.tabIndex = t ? 0 : -1;
  }
  setFocusedElement(e) {
    const t = this.state;
    if (!t) throw new Error("Cannot set focus when state is undefined");
    if ((this.setFocus(e), !(e < t.count - 1) && t.lastNodePartiallyVisible())) {
      const n = t.stickyNodes[e];
      this.scrollNodeUnderWidget(n.endIndex + 1, t);
    }
  }
  scrollNodeUnderWidget(e, t) {
    const n = t.stickyNodes[t.count - 1],
      i = t.count > 1 ? t.stickyNodes[t.count - 2] : void 0,
      r = this.view.getElementTop(e),
      o = i ? i.position + i.height + n.height : n.height;
    this.view.scrollTop = r - o;
  }
  domFocus() {
    if (!this.state) throw new Error("Cannot focus when state is undefined");
    this.container.focus();
  }
  focusedLast() {
    return !!this.state && this.view.getHTMLElement().classList.contains("sticky-scroll-focused");
  }
  removeFocus() {
    -1 !== this.focusedIndex &&
      (this.toggleElementFocus(this.elements[this.focusedIndex], !1), (this.focusedIndex = -1));
  }
  setFocus(e) {
    if (0 > e) throw new Error("addFocus() can not remove focus");
    if (!this.state && e >= 0) throw new Error("Cannot set focus index when state is undefined");
    if (this.state && e >= this.state.count)
      throw new Error("Cannot set focus index to an index that does not exist");
    const t = this.focusedIndex;
    (t >= 0 && this.toggleElementFocus(this.elements[t], !1),
      e >= 0 && this.toggleElementFocus(this.elements[e], !0),
      (this.focusedIndex = e));
  }
  toggleElementFocus(e, t) {
    (this.toggleElementActiveFocus(e, t && this.domHasFocus), this.toggleElementPassiveFocus(e, t));
  }
  toggleCurrentElementActiveFocus(e) {
    -1 !== this.focusedIndex && this.toggleElementActiveFocus(this.elements[this.focusedIndex], e);
  }
  toggleElementActiveFocus(e, t) {
    e.classList.toggle("focused", t);
  }
  toggleElementPassiveFocus(e, t) {
    e.classList.toggle("passive-focused", t);
  }
  toggleStickyScrollFocused(e) {
    this.view.getHTMLElement().classList.toggle("sticky-scroll-focused", e);
  }
  onFocus() {
    if (!this.state || 0 === this.elements.length)
      throw new Error("Cannot focus when state is undefined or elements are empty");
    ((this.domHasFocus = !0),
      this.toggleStickyScrollFocused(!0),
      this.toggleCurrentElementActiveFocus(!0),
      -1 === this.focusedIndex && this.setFocus(0));
  }
  onBlur() {
    ((this.domHasFocus = !1), this.toggleCurrentElementActiveFocus(!1));
  }
  dispose() {
    (this.toggleStickyScrollFocused(!1), this._onDidChangeHasFocus.fire(!1), super.dispose());
  }
}
function Uxe(e) {
  let t = axe.Unknown;
  return (
    pB(e.browserEvent.target, "monaco-tl-twistie", "monaco-tl-row")
      ? (t = axe.Twistie)
      : pB(e.browserEvent.target, "monaco-tl-contents", "monaco-tl-row")
        ? (t = axe.Element)
        : pB(e.browserEvent.target, "monaco-tree-type-filter", "monaco-list") && (t = axe.Filter),
    { browserEvent: e.browserEvent, element: e.element ? e.element.element : null, target: t }
  );
}
function $xe(e) {
  const t = Kae(e.browserEvent.target);
  return {
    element: e.element ? e.element.element : null,
    browserEvent: e.browserEvent,
    anchor: e.anchor,
    isStickyScroll: t,
  };
}
function qxe(e, t) {
  (t(e), e.children.forEach((e) => qxe(e, t)));
}
class Kxe {
  get nodeSet() {
    return (this._nodeSet || (this._nodeSet = this.createNodeSet()), this._nodeSet);
  }
  constructor(e, t) {
    ((this.getFirstViewElementWithTrait = e),
      (this.identityProvider = t),
      (this.nodes = []),
      (this._onDidChange = new QO()),
      (this.onDidChange = this._onDidChange.event));
  }
  set(e, t) {
    const n = t;
    (!n?.__forceEvent && XP(this.nodes, e)) || this._set(e, !1, t);
  }
  _set(e, t, n) {
    if (((this.nodes = [...e]), (this.elements = void 0), (this._nodeSet = void 0), !t)) {
      const e = this;
      this._onDidChange.fire({
        get elements() {
          return e.get();
        },
        browserEvent: n,
      });
    }
  }
  get() {
    return (
      this.elements || (this.elements = this.nodes.map((e) => e.element)),
      [...this.elements]
    );
  }
  getNodes() {
    return this.nodes;
  }
  has(e) {
    return this.nodeSet.has(e);
  }
  onDidModelSplice({ insertedNodes: e, deletedNodes: t }) {
    if (!this.identityProvider) {
      const e = this.createNodeSet(),
        n = (t) => e.delete(t);
      return (t.forEach((e) => qxe(e, n)), void this.set([...e.values()]));
    }
    const n = new Set(),
      i = (e) => n.add(this.identityProvider.getId(e.element).toString());
    t.forEach((e) => qxe(e, i));
    const r = new Map(),
      o = (e) => r.set(this.identityProvider.getId(e.element).toString(), e);
    e.forEach((e) => qxe(e, o));
    const s = [];
    for (const a of this.nodes) {
      const e = this.identityProvider.getId(a.element).toString();
      if (n.has(e)) {
        const t = r.get(e);
        t && t.visible && s.push(t);
      } else s.push(a);
    }
    if (this.nodes.length > 0 && 0 === s.length) {
      const e = this.getFirstViewElementWithTrait();
      e && s.push(e);
    }
    this._set(s, !0);
  }
  createNodeSet() {
    const e = new Set();
    for (const t of this.nodes) e.add(t);
    return e;
  }
}
class Gxe extends rle {
  constructor(e, t, n) {
    (super(e), (this.tree = t), (this.stickyScrollProvider = n));
  }
  onViewPointer(e) {
    if (Gae(e.browserEvent.target) || YB(e.browserEvent.target) || $ae(e.browserEvent.target))
      return;
    if (e.browserEvent.isHandledByList) return;
    const t = e.element;
    if (!t) return super.onViewPointer(e);
    if (this.isSelectionRangeChangeEvent(e) || this.isSelectionSingleChangeEvent(e))
      return super.onViewPointer(e);
    const n = e.browserEvent.target,
      i =
        n.classList.contains("monaco-tl-twistie") ||
        (n.classList.contains("monaco-icon-label") &&
          n.classList.contains("folder-icon") &&
          e.browserEvent.offsetX < 16),
      r = qae(e.browserEvent.target);
    let o = !1;
    if (
      ((o =
        !!r ||
        ("function" == typeof this.tree.expandOnlyOnTwistieClick
          ? this.tree.expandOnlyOnTwistieClick(t.element)
          : !!this.tree.expandOnlyOnTwistieClick)),
      r)
    )
      this.handleStickyScrollMouseEvent(e, t);
    else {
      if (o && !i && 2 !== e.browserEvent.detail) return super.onViewPointer(e);
      if (!this.tree.expandOnDoubleClick && 2 === e.browserEvent.detail)
        return super.onViewPointer(e);
    }
    if (t.collapsible && (!r || i)) {
      const n = this.tree.getNodeLocation(t),
        r = e.browserEvent.altKey;
      if ((this.tree.setFocus([n]), this.tree.toggleCollapsed(n, r), i))
        return void (e.browserEvent.isHandledByList = !0);
    }
    r || super.onViewPointer(e);
  }
  handleStickyScrollMouseEvent(e, t) {
    if (
      (function (e) {
        return Uae(e, "monaco-custom-toggle");
      })(e.browserEvent.target) ||
      (function (e) {
        return Uae(e, "action-item");
      })(e.browserEvent.target)
    )
      return;
    const n = this.stickyScrollProvider();
    if (!n) throw new Error("Sticky scroll controller not found");
    const i = this.list.indexOf(t),
      r = this.list.getElementTop(i),
      o = n.nodePositionTopBelowWidget(t);
    ((this.tree.scrollTop = r - o),
      this.list.domFocus(),
      this.list.setFocus([i]),
      this.list.setSelection([i]));
  }
  onDoubleClick(e) {
    !e.browserEvent.target.classList.contains("monaco-tl-twistie") &&
      this.tree.expandOnDoubleClick &&
      (e.browserEvent.isHandledByList || super.onDoubleClick(e));
  }
  onMouseDown(e) {
    const t = e.browserEvent.target;
    Kae(t) || qae(t) || super.onMouseDown(e);
  }
  onContextMenu(e) {
    const t = e.browserEvent.target;
    Kae(t) || qae(t) || super.onContextMenu(e);
  }
}
class Zxe extends gle {
  constructor(e, t, n, i, r, o, s, a) {
    (super(e, t, n, i, a),
      (this.focusTrait = r),
      (this.selectionTrait = o),
      (this.anchorTrait = s));
  }
  createMouseController(e) {
    return new Gxe(this, e.tree, e.stickyScrollProvider);
  }
  splice(e, t, n = []) {
    if ((super.splice(e, t, n), 0 === n.length)) return;
    const i = [],
      r = [];
    let o;
    (n.forEach((t, n) => {
      (this.focusTrait.has(t) && i.push(e + n),
        this.selectionTrait.has(t) && r.push(e + n),
        this.anchorTrait.has(t) && (o = e + n));
    }),
      i.length > 0 && super.setFocus(lj([...super.getFocus(), ...i])),
      r.length > 0 && super.setSelection(lj([...super.getSelection(), ...r])),
      "number" == typeof o && super.setAnchor(o));
  }
  setFocus(e, t, n = !1) {
    (super.setFocus(e, t),
      n ||
        this.focusTrait.set(
          e.map((e) => this.element(e)),
          t,
        ));
  }
  setSelection(e, t, n = !1) {
    (super.setSelection(e, t),
      n ||
        this.selectionTrait.set(
          e.map((e) => this.element(e)),
          t,
        ));
  }
  setAnchor(e, t = !1) {
    (super.setAnchor(e),
      t || (void 0 === e ? this.anchorTrait.set([]) : this.anchorTrait.set([this.element(e)])));
  }
}
class Yxe {
  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, Uxe), (e) => e.target !== axe.Filter);
  }
  get onMouseOver() {
    return $O.map(this.view.onMouseOver, Uxe);
  }
  get onMouseOut() {
    return $O.map(this.view.onMouseOut, Uxe);
  }
  get onContextMenu() {
    return $O.any(
      $O.filter($O.map(this.view.onContextMenu, $xe), (e) => !e.isStickyScroll),
      this.stickyScrollController?.onContextMenu ?? $O.None,
    );
  }
  get onPointer() {
    return $O.map(this.view.onPointer, Uxe);
  }
  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 void 0 === this._options.expandOnDoubleClick || this._options.expandOnDoubleClick;
  }
  get expandOnlyOnTwistieClick() {
    return (
      void 0 === this._options.expandOnlyOnTwistieClick || this._options.expandOnlyOnTwistieClick
    );
  }
  get onDidDispose() {
    return this.view.onDidDispose;
  }
  constructor(e, t, n, i, r = {}) {
    ((this._user = e),
      (this._options = r),
      (this.eventBufferer = new rM()),
      (this.onDidChangeFindOpenState = $O.None),
      (this.onDidChangeStickyScrollFocused = $O.None),
      (this.disposables = new AO()),
      (this.onDidSwapModel = this.disposables.add(new QO())),
      (this.onDidChangeModelRelay = this.disposables.add(new oM())),
      (this.onDidSpliceModelRelay = this.disposables.add(new oM())),
      (this.onDidChangeCollapseStateRelay = this.disposables.add(new oM())),
      (this.onDidChangeRenderNodeCountRelay = this.disposables.add(new oM())),
      (this.onDidChangeActiveNodesRelay = this.disposables.add(new oM())),
      (this._onWillRefilter = new QO()),
      (this.onWillRefilter = this._onWillRefilter.event),
      (this._onDidUpdateOptions = new QO()),
      (this.modelDisposables = new AO()),
      r.keyboardNavigationLabelProvider &&
        (r.findWidgetEnabled ?? 1) &&
        ((this.findFilter = new Oxe(
          r.keyboardNavigationLabelProvider,
          r.filter,
          r.defaultFindVisibility,
        )),
        (r = { ...r, filter: this.findFilter }),
        this.disposables.add(this.findFilter)),
      (this.model = this.createModel(e, r)),
      (this.treeDelegate = new Dxe(n)));
    const o = this.disposables.add(new Txe(this.onDidChangeActiveNodesRelay.event)),
      s = new JW();
    this.renderers = i.map(
      (e) => new Ixe(e, this.model, this.onDidChangeCollapseStateRelay.event, o, s, r),
    );
    for (const a of this.renderers) this.disposables.add(a);
    if (
      ((this.focus = new Kxe(() => this.view.getFocusedElements()[0], r.identityProvider)),
      (this.selection = new Kxe(() => this.view.getSelectedElements()[0], r.identityProvider)),
      (this.anchor = new Kxe(() => this.view.getAnchorElement(), r.identityProvider)),
      (this.view = new Zxe(
        e,
        t,
        this.treeDelegate,
        this.renderers,
        this.focus,
        this.selection,
        this.anchor,
        {
          ...Lxe(() => this.model, this.disposables, r),
          tree: this,
          stickyScrollProvider: () => this.stickyScrollController,
        },
      )),
      this.setupModel(this.model),
      !1 !== r.keyboardSupport)
    ) {
      const e = $O.chain(this.view.onKeyDown, (e) =>
        e.filter((e) => !YB(e.target)).map((e) => new wO(e)),
      );
      ($O.chain(e, (e) => e.filter((e) => 15 === e.keyCode))(
        this.onLeftArrow,
        this,
        this.disposables,
      ),
        $O.chain(e, (e) => e.filter((e) => 17 === e.keyCode))(
          this.onRightArrow,
          this,
          this.disposables,
        ),
        $O.chain(e, (e) => e.filter((e) => 10 === e.keyCode))(
          this.onSpace,
          this,
          this.disposables,
        ));
    }
    if ((r.findWidgetEnabled ?? 1) && r.keyboardNavigationLabelProvider && r.contextViewProvider) {
      const e = {
        styles: r.findWidgetStyles,
        defaultFindMode: r.defaultFindMode,
        defaultFindMatchType: r.defaultFindMatchType,
        showNotFoundMessage: r.showNotFoundMessage,
      };
      ((this.findController = this.disposables.add(
        new Pxe(this, this.findFilter, r.contextViewProvider, e),
      )),
        (this.focusNavigationFilter = (e) => this.findController.shouldAllowFocus(e)),
        (this.onDidChangeFindOpenState = this.findController.onDidChangeOpenState),
        (this.onDidChangeFindMode = this.findController.onDidChangeMode),
        (this.onDidChangeFindMatchType = this.findController.onDidChangeMatchType));
    } else ((this.onDidChangeFindMode = $O.None), (this.onDidChangeFindMatchType = $O.None));
    (r.enableStickyScroll &&
      ((this.stickyScrollController = new Wxe(
        this,
        this.model,
        this.view,
        this.renderers,
        this.treeDelegate,
        r,
      )),
      (this.onDidChangeStickyScrollFocused = this.stickyScrollController.onDidChangeHasFocus)),
      (this.styleElement = rG(this.view.getHTMLElement())),
      this.getHTMLElement().classList.toggle(
        "always",
        this._options.renderIndentGuides === lxe.Always,
      ));
  }
  updateOptions(e = {}) {
    this._options = { ...this._options, ...e };
    for (const t of this.renderers) t.updateOptions(e);
    (this.view.updateOptions(this._options),
      this.findController?.updateOptions(e),
      this.updateStickyScroll(e),
      this._onDidUpdateOptions.fire(this._options),
      this.getHTMLElement().classList.toggle(
        "always",
        this._options.renderIndentGuides === lxe.Always,
      ));
  }
  get options() {
    return this._options;
  }
  updateStickyScroll(e) {
    (!this.stickyScrollController && this._options.enableStickyScroll
      ? ((this.stickyScrollController = new Wxe(
          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(e));
  }
  getHTMLElement() {
    return this.view.getHTMLElement();
  }
  get onDidChangeContentHeight() {
    return this.view.onDidChangeContentHeight;
  }
  get scrollTop() {
    return this.view.scrollTop;
  }
  set scrollTop(e) {
    this.view.scrollTop = e;
  }
  get scrollHeight() {
    return this.view.scrollHeight;
  }
  get renderHeight() {
    return this.view.renderHeight;
  }
  get ariaLabel() {
    return this.view.ariaLabel;
  }
  set ariaLabel(e) {
    this.view.ariaLabel = e;
  }
  domFocus() {
    this.stickyScrollController?.focusedLast()
      ? this.stickyScrollController.domFocus()
      : this.view.domFocus();
  }
  layout(e, t) {
    this.view.layout(e, t);
  }
  style(e) {
    const t = `.${this.view.domId}`,
      n = [];
    e.treeIndentGuidesStroke &&
      (n.push(
        `.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide  { opacity: 1; border-color: ${e.treeInactiveIndentGuidesStroke}; }`,
      ),
      n.push(
        `.monaco-list${t} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e.treeIndentGuidesStroke}; }`,
      ));
    const i = e.treeStickyScrollBackground ?? e.listBackground;
    (i &&
      (n.push(
        `.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${i}; }`,
      ),
      n.push(
        `.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${i}; }`,
      )),
      e.treeStickyScrollBorder &&
        n.push(
          `.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`,
        ),
      e.treeStickyScrollShadow &&
        n.push(
          `.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`,
        ),
      e.listFocusForeground &&
        (n.push(
          `.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`,
        ),
        n.push(
          `.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`,
        )));
    const r = Wne(
      e.listFocusAndSelectionOutline,
      Wne(e.listSelectionOutline, e.listFocusOutline ?? ""),
    );
    (r &&
      (n.push(
        `.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`,
      ),
      n.push(
        `.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`,
      )),
      e.listFocusOutline &&
        (n.push(
          `.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`,
        ),
        n.push(
          `.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`,
        ),
        n.push(
          `.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`,
        ),
        n.push(
          `.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`,
        ),
        n.push(
          `.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`,
        )),
      (this.styleElement.textContent = n.join("\n")),
      this.view.style(e));
  }
  getParentElement(e) {
    const t = this.model.getParentNodeLocation(e);
    return this.model.getNode(t).element;
  }
  getFirstElementChild(e) {
    return this.model.getFirstElementChild(e);
  }
  getNode(e) {
    return this.model.getNode(e);
  }
  getNodeLocation(e) {
    return this.model.getNodeLocation(e);
  }
  collapse(e, t = !1) {
    return this.model.setCollapsed(e, !0, t);
  }
  expand(e, t = !1) {
    return this.model.setCollapsed(e, !1, t);
  }
  toggleCollapsed(e, t = !1) {
    return this.model.setCollapsed(e, void 0, t);
  }
  isCollapsible(e) {
    return this.model.isCollapsible(e);
  }
  setCollapsible(e, t) {
    return this.model.setCollapsible(e, t);
  }
  isCollapsed(e) {
    return this.model.isCollapsed(e);
  }
  refilter() {
    (this._onWillRefilter.fire(void 0), this.model.refilter());
  }
  setSelection(e, t) {
    this.eventBufferer.bufferEvents(() => {
      const n = e.map((e) => this.model.getNode(e));
      this.selection.set(n, t);
      const i = e.map((e) => this.model.getListIndex(e)).filter((e) => e > -1);
      this.view.setSelection(i, t, !0);
    });
  }
  getSelection() {
    return this.selection.get();
  }
  setFocus(e, t) {
    this.eventBufferer.bufferEvents(() => {
      const n = e.map((e) => this.model.getNode(e));
      this.focus.set(n, t);
      const i = e.map((e) => this.model.getListIndex(e)).filter((e) => e > -1);
      this.view.setFocus(i, t, !0);
    });
  }
  focusNext(e = 1, t = !1, n, i = LB(n) && n.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusNext(e, t, n, i);
  }
  focusPrevious(e = 1, t = !1, n, i = LB(n) && n.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusPrevious(e, t, n, i);
  }
  focusNextPage(e, t = LB(e) && e.altKey ? void 0 : this.focusNavigationFilter) {
    return this.view.focusNextPage(e, t);
  }
  focusPreviousPage(e, t = LB(e) && e.altKey ? void 0 : this.focusNavigationFilter) {
    return this.view.focusPreviousPage(e, t, () => this.stickyScrollController?.height ?? 0);
  }
  focusLast(e, t = LB(e) && e.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusLast(e, t);
  }
  focusFirst(e, t = LB(e) && e.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusFirst(e, t);
  }
  getFocus() {
    return this.focus.get();
  }
  reveal(e, t) {
    this.model.expandTo(e);
    const n = this.model.getListIndex(e);
    if (-1 !== n)
      if (this.stickyScrollController) {
        const i = this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));
        this.view.reveal(n, t, i);
      } else this.view.reveal(n, t);
  }
  onLeftArrow(e) {
    (e.preventDefault(), e.stopPropagation());
    const t = this.view.getFocusedElements();
    if (0 === t.length) return;
    const n = t[0],
      i = this.model.getNodeLocation(n);
    if (!this.model.setCollapsed(i, !0)) {
      const e = this.model.getParentNodeLocation(i);
      if (!e) return;
      const t = this.model.getListIndex(e);
      (this.view.reveal(t), this.view.setFocus([t]));
    }
  }
  onRightArrow(e) {
    (e.preventDefault(), e.stopPropagation());
    const t = this.view.getFocusedElements();
    if (0 === t.length) return;
    const n = t[0],
      i = this.model.getNodeLocation(n);
    if (!this.model.setCollapsed(i, !1)) {
      if (!n.children.some((e) => e.visible)) return;
      const [e] = this.view.getFocus(),
        t = e + 1;
      (this.view.reveal(t), this.view.setFocus([t]));
    }
  }
  onSpace(e) {
    (e.preventDefault(), e.stopPropagation());
    const t = this.view.getFocusedElements();
    if (0 === t.length) return;
    const n = t[0],
      i = this.model.getNodeLocation(n),
      r = e.browserEvent.altKey;
    this.model.setCollapsed(i, void 0, r);
  }
  setupModel(e) {
    (this.modelDisposables.clear(),
      this.modelDisposables.add(
        e.onDidSpliceRenderedNodes(({ start: e, deleteCount: t, elements: n }) =>
          this.view.splice(e, t, n),
        ),
      ));
    const t = $O.forEach(
      e.onDidSpliceModel,
      (e) => {
        this.eventBufferer.bufferEvents(() => {
          (this.focus.onDidModelSplice(e), this.selection.onDidModelSplice(e));
        });
      },
      this.modelDisposables,
    );
    t(() => null, null, this.modelDisposables);
    const n = this.modelDisposables.add(new QO()),
      i = this.modelDisposables.add(new mM(0));
    (this.modelDisposables.add(
      $O.any(
        t,
        this.focus.onDidChange,
        this.selection.onDidChange,
      )(() => {
        i.trigger(() => {
          const e = new Set();
          for (const t of this.focus.getNodes()) e.add(t);
          for (const t of this.selection.getNodes()) e.add(t);
          n.fire([...e.values()]);
        });
      }),
    ),
      (this.onDidChangeActiveNodesRelay.input = n.event),
      (this.onDidChangeModelRelay.input = $O.signal(e.onDidSpliceModel)),
      (this.onDidChangeCollapseStateRelay.input = e.onDidChangeCollapseState),
      (this.onDidChangeRenderNodeCountRelay.input = e.onDidChangeRenderNodeCount),
      (this.onDidSpliceModelRelay.input = e.onDidSpliceModel));
  }
  dispose() {
    (IO(this.disposables),
      this.stickyScrollController?.dispose(),
      this.view.dispose(),
      this.modelDisposables.dispose());
  }
}
class Xxe {
  constructor(e, t = {}) {
    ((this.user = e),
      (this.rootRef = null),
      (this.nodes = new Map()),
      (this.nodesByIdentity = new Map()),
      (this.model = new Sxe(e, null, t)),
      (this.onDidSpliceModel = this.model.onDidSpliceModel),
      (this.onDidSpliceRenderedNodes = this.model.onDidSpliceRenderedNodes),
      (this.onDidChangeCollapseState = this.model.onDidChangeCollapseState),
      (this.onDidChangeRenderNodeCount = this.model.onDidChangeRenderNodeCount),
      t.sorter && (this.sorter = { compare: (e, n) => t.sorter.compare(e.element, n.element) }),
      (this.identityProvider = t.identityProvider));
  }
  setChildren(e, t = DO.empty(), n = {}) {
    const i = this.getElementLocation(e);
    this._setChildren(i, this.preserveCollapseState(t), n);
  }
  _setChildren(e, t = DO.empty(), n) {
    const i = new Set(),
      r = new Set();
    this.model.splice([...e, 0], Number.MAX_VALUE, t, {
      ...n,
      onDidCreateNode: (e) => {
        if (null === e.element) return;
        const t = e;
        if ((i.add(t.element), this.nodes.set(t.element, t), this.identityProvider)) {
          const e = this.identityProvider.getId(t.element).toString();
          (r.add(e), this.nodesByIdentity.set(e, t));
        }
        n.onDidCreateNode?.(t);
      },
      onDidDeleteNode: (e) => {
        if (null === e.element) return;
        const t = e;
        if ((i.has(t.element) || this.nodes.delete(t.element), this.identityProvider)) {
          const e = this.identityProvider.getId(t.element).toString();
          r.has(e) || this.nodesByIdentity.delete(e);
        }
        n.onDidDeleteNode?.(t);
      },
    });
  }
  preserveCollapseState(e = DO.empty()) {
    return (
      this.sorter && (e = [...e].sort(this.sorter.compare.bind(this.sorter))),
      DO.map(e, (e) => {
        let t = this.nodes.get(e.element);
        if (!t && this.identityProvider) {
          const n = this.identityProvider.getId(e.element).toString();
          t = this.nodesByIdentity.get(n);
        }
        if (!t) {
          let t;
          return (
            (t =
              void 0 === e.collapsed
                ? void 0
                : e.collapsed === sxe.Collapsed ||
                  e.collapsed === sxe.PreserveOrCollapsed ||
                  (e.collapsed !== sxe.Expanded &&
                    e.collapsed !== sxe.PreserveOrExpanded &&
                    Boolean(e.collapsed))),
            { ...e, children: this.preserveCollapseState(e.children), collapsed: t }
          );
        }
        const n = "boolean" == typeof e.collapsible ? e.collapsible : t.collapsible;
        let i;
        return (
          (i =
            void 0 === e.collapsed ||
            e.collapsed === sxe.PreserveOrCollapsed ||
            e.collapsed === sxe.PreserveOrExpanded
              ? t.collapsed
              : e.collapsed === sxe.Collapsed ||
                (e.collapsed !== sxe.Expanded && Boolean(e.collapsed))),
          { ...e, collapsible: n, collapsed: i, children: this.preserveCollapseState(e.children) }
        );
      })
    );
  }
  rerender(e) {
    const t = this.getElementLocation(e);
    this.model.rerender(t);
  }
  resort(e = null, t = !0) {
    if (!this.sorter) return;
    const n = this.getElementLocation(e),
      i = this.model.getNode(n);
    this._setChildren(n, this.resortChildren(i, t), {});
  }
  resortChildren(e, t, n = !0) {
    let i = [...e.children];
    return (
      (t || n) && (i = i.sort(this.sorter.compare.bind(this.sorter))),
      DO.map(i, (e) => ({
        element: e.element,
        collapsible: e.collapsible,
        collapsed: e.collapsed,
        children: this.resortChildren(e, t, !1),
      }))
    );
  }
  getFirstElementChild(e = null) {
    const t = this.getElementLocation(e);
    return this.model.getFirstElementChild(t);
  }
  has(e) {
    return this.nodes.has(e);
  }
  getListIndex(e) {
    const t = this.getElementLocation(e);
    return this.model.getListIndex(t);
  }
  getListRenderCount(e) {
    const t = this.getElementLocation(e);
    return this.model.getListRenderCount(t);
  }
  isCollapsible(e) {
    const t = this.getElementLocation(e);
    return this.model.isCollapsible(t);
  }
  setCollapsible(e, t) {
    const n = this.getElementLocation(e);
    return this.model.setCollapsible(n, t);
  }
  isCollapsed(e) {
    const t = this.getElementLocation(e);
    return this.model.isCollapsed(t);
  }
  setCollapsed(e, t, n) {
    const i = this.getElementLocation(e);
    return this.model.setCollapsed(i, t, n);
  }
  expandTo(e) {
    const t = this.getElementLocation(e);
    this.model.expandTo(t);
  }
  refilter() {
    this.model.refilter();
  }
  getNode(e = null) {
    if (null === e) return this.model.getNode(this.model.rootRef);
    const t = this.nodes.get(e);
    if (!t) throw new hxe(this.user, `Tree element not found: ${e}`);
    return t;
  }
  getNodeLocation(e) {
    return e.element;
  }
  getParentNodeLocation(e) {
    if (null === e) throw new hxe(this.user, "Invalid getParentNodeLocation call");
    const t = this.nodes.get(e);
    if (!t) throw new hxe(this.user, `Tree element not found: ${e}`);
    const n = this.model.getNodeLocation(t),
      i = this.model.getParentNodeLocation(n);
    return this.model.getNode(i).element;
  }
  getElementLocation(e) {
    if (null === e) return [];
    const t = this.nodes.get(e);
    if (!t) throw new hxe(this.user, `Tree element not found: ${e}`);
    return this.model.getNodeLocation(t);
  }
}
function Qxe(e) {
  return {
    element: { elements: [e.element], incompressible: e.incompressible || !1 },
    children: DO.map(DO.from(e.children), Qxe),
    collapsible: e.collapsible,
    collapsed: e.collapsed,
  };
}
function Jxe(e) {
  const t = [e.element],
    n = e.incompressible || !1;
  let i, r;
  for (; ([r, i] = DO.consume(DO.from(e.children), 2)), 1 === r.length && !r[0].incompressible; )
    ((e = r[0]), t.push(e.element));
  return {
    element: { elements: t, incompressible: n },
    children: DO.map(DO.concat(r, i), Jxe),
    collapsible: e.collapsible,
    collapsed: e.collapsed,
  };
}
function ewe(e, t = 0) {
  let n;
  return (
    (n =
      t < e.element.elements.length - 1
        ? [ewe(e, t + 1)]
        : DO.map(DO.from(e.children), (e) => ewe(e, 0))),
    0 === t && e.element.incompressible
      ? {
          element: e.element.elements[t],
          children: n,
          incompressible: !0,
          collapsible: e.collapsible,
          collapsed: e.collapsed,
        }
      : {
          element: e.element.elements[t],
          children: n,
          collapsible: e.collapsible,
          collapsed: e.collapsed,
        }
  );
}
function twe(e) {
  return ewe(e, 0);
}
function nwe(e, t, n) {
  return e.element === t
    ? { ...e, children: n }
    : { ...e, children: DO.map(DO.from(e.children), (e) => nwe(e, t, n)) };
}
class iwe {
  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(e, t = {}) {
    ((this.user = e),
      (this.rootRef = null),
      (this.nodes = new Map()),
      (this.model = new Xxe(e, t)),
      (this.enabled = void 0 === t.compressionEnabled || t.compressionEnabled),
      (this.identityProvider = t.identityProvider));
  }
  setChildren(e, t = DO.empty(), n) {
    const i =
      n.diffIdentityProvider &&
      ((e) => ({ getId: (t) => t.elements.map((t) => e.getId(t).toString()).join("\0") }))(
        n.diffIdentityProvider,
      );
    if (null === e) {
      const e = DO.map(t, this.enabled ? Jxe : Qxe);
      return void this._setChildren(null, e, { diffIdentityProvider: i, diffDepth: 1 / 0 });
    }
    const r = this.nodes.get(e);
    if (!r) throw new hxe(this.user, "Unknown compressed tree node");
    const o = this.model.getNode(r),
      s = this.model.getParentNodeLocation(r),
      a = this.model.getNode(s),
      l = nwe(twe(o), e, t),
      c = (this.enabled ? Jxe : Qxe)(l),
      d = n.diffIdentityProvider
        ? (e, t) => n.diffIdentityProvider.getId(e) === n.diffIdentityProvider.getId(t)
        : void 0;
    if (XP(c.element.elements, o.element.elements, d))
      return void this._setChildren(r, c.children || DO.empty(), {
        diffIdentityProvider: i,
        diffDepth: 1,
      });
    const u = a.children.map((e) => (e === o ? c : e));
    this._setChildren(a.element, u, { diffIdentityProvider: i, diffDepth: o.depth - a.depth });
  }
  isCompressionEnabled() {
    return this.enabled;
  }
  setCompressionEnabled(e) {
    if (e === this.enabled) return;
    this.enabled = e;
    const t = this.model.getNode().children,
      n = DO.map(t, twe),
      i = DO.map(n, e ? Jxe : Qxe);
    this._setChildren(null, i, { diffIdentityProvider: this.identityProvider, diffDepth: 1 / 0 });
  }
  _setChildren(e, t, n) {
    const i = new Set();
    this.model.setChildren(e, t, {
      ...n,
      onDidCreateNode: (e) => {
        for (const t of e.element.elements) (i.add(t), this.nodes.set(t, e.element));
      },
      onDidDeleteNode: (e) => {
        for (const t of e.element.elements) i.has(t) || this.nodes.delete(t);
      },
    });
  }
  has(e) {
    return this.nodes.has(e);
  }
  getListIndex(e) {
    const t = this.getCompressedNode(e);
    return this.model.getListIndex(t);
  }
  getListRenderCount(e) {
    const t = this.getCompressedNode(e);
    return this.model.getListRenderCount(t);
  }
  getNode(e) {
    if (void 0 === e) return this.model.getNode();
    const t = this.getCompressedNode(e);
    return this.model.getNode(t);
  }
  getNodeLocation(e) {
    const t = this.model.getNodeLocation(e);
    return null === t ? null : t.elements[t.elements.length - 1];
  }
  getParentNodeLocation(e) {
    const t = this.getCompressedNode(e),
      n = this.model.getParentNodeLocation(t);
    return null === n ? null : n.elements[n.elements.length - 1];
  }
  getFirstElementChild(e) {
    const t = this.getCompressedNode(e);
    return this.model.getFirstElementChild(t);
  }
  isCollapsible(e) {
    const t = this.getCompressedNode(e);
    return this.model.isCollapsible(t);
  }
  setCollapsible(e, t) {
    const n = this.getCompressedNode(e);
    return this.model.setCollapsible(n, t);
  }
  isCollapsed(e) {
    const t = this.getCompressedNode(e);
    return this.model.isCollapsed(t);
  }
  setCollapsed(e, t, n) {
    const i = this.getCompressedNode(e);
    return this.model.setCollapsed(i, t, n);
  }
  expandTo(e) {
    const t = this.getCompressedNode(e);
    this.model.expandTo(t);
  }
  rerender(e) {
    const t = this.getCompressedNode(e);
    this.model.rerender(t);
  }
  refilter() {
    this.model.refilter();
  }
  resort(e = null, t = !0) {
    const n = this.getCompressedNode(e);
    this.model.resort(n, t);
  }
  getCompressedNode(e) {
    if (null === e) return null;
    const t = this.nodes.get(e);
    if (!t) throw new hxe(this.user, `Tree element not found: ${e}`);
    return t;
  }
}
const rwe = (e) => e[e.length - 1];
class owe {
  get element() {
    return null === this.node.element ? null : this.unwrapper(this.node.element);
  }
  get children() {
    return this.node.children.map((e) => new owe(this.unwrapper, e));
  }
  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(e, t) {
    ((this.unwrapper = e), (this.node = t));
  }
}
class swe {
  get onDidSpliceModel() {
    return $O.map(this.model.onDidSpliceModel, ({ insertedNodes: e, deletedNodes: t }) => ({
      insertedNodes: e.map((e) => this.nodeMapper.map(e)),
      deletedNodes: t.map((e) => this.nodeMapper.map(e)),
    }));
  }
  get onDidSpliceRenderedNodes() {
    return $O.map(
      this.model.onDidSpliceRenderedNodes,
      ({ start: e, deleteCount: t, elements: n }) => ({
        start: e,
        deleteCount: t,
        elements: n.map((e) => this.nodeMapper.map(e)),
      }),
    );
  }
  get onDidChangeCollapseState() {
    return $O.map(this.model.onDidChangeCollapseState, ({ node: e, deep: t }) => ({
      node: this.nodeMapper.map(e),
      deep: t,
    }));
  }
  get onDidChangeRenderNodeCount() {
    return $O.map(this.model.onDidChangeRenderNodeCount, (e) => this.nodeMapper.map(e));
  }
  constructor(e, t = {}) {
    ((this.rootRef = null), (this.elementMapper = t.elementMapper || rwe));
    const n = (e) => this.elementMapper(e.elements);
    ((this.nodeMapper = new gxe((e) => new owe(n, e))),
      (this.model = new iwe(
        e,
        (function (e, t) {
          return {
            ...t,
            identityProvider: t.identityProvider && {
              getId: (n) => t.identityProvider.getId(e(n)),
            },
            sorter: t.sorter && {
              compare: (e, n) => t.sorter.compare(e.elements[0], n.elements[0]),
            },
            filter: t.filter && {
              filter(e, n) {
                const i = e.elements;
                for (let r = 0; r < i.length - 1; r++) {
                  const e = t.filter.filter(i[r], n);
                  n = wxe(xxe(e) ? e.visibility : e);
                }
                return t.filter.filter(i[i.length - 1], n);
              },
            },
          };
        })(n, t),
      )));
  }
  setChildren(e, t = DO.empty(), n = {}) {
    this.model.setChildren(e, t, n);
  }
  isCompressionEnabled() {
    return this.model.isCompressionEnabled();
  }
  setCompressionEnabled(e) {
    this.model.setCompressionEnabled(e);
  }
  has(e) {
    return this.model.has(e);
  }
  getListIndex(e) {
    return this.model.getListIndex(e);
  }
  getListRenderCount(e) {
    return this.model.getListRenderCount(e);
  }
  getNode(e) {
    return this.nodeMapper.map(this.model.getNode(e));
  }
  getNodeLocation(e) {
    return e.element;
  }
  getParentNodeLocation(e) {
    return this.model.getParentNodeLocation(e);
  }
  getFirstElementChild(e) {
    const t = this.model.getFirstElementChild(e);
    return null == t ? t : this.elementMapper(t.elements);
  }
  isCollapsible(e) {
    return this.model.isCollapsible(e);
  }
  setCollapsible(e, t) {
    return this.model.setCollapsible(e, t);
  }
  isCollapsed(e) {
    return this.model.isCollapsed(e);
  }
  setCollapsed(e, t, n) {
    return this.model.setCollapsed(e, t, n);
  }
  expandTo(e) {
    return this.model.expandTo(e);
  }
  rerender(e) {
    return this.model.rerender(e);
  }
  refilter() {
    return this.model.refilter();
  }
  resort(e = null, t = !0) {
    return this.model.resort(e, t);
  }
  getCompressedTreeNode(e = null) {
    return this.model.getNode(e);
  }
}
class awe extends Yxe {
  get onDidChangeCollapseState() {
    return this.model.onDidChangeCollapseState;
  }
  constructor(e, t, n, i, r = {}) {
    (super(e, t, n, i, r), (this.user = e));
  }
  setChildren(e, t = DO.empty(), n) {
    this.model.setChildren(e, t, n);
  }
  rerender(e) {
    void 0 !== e ? this.model.rerender(e) : this.view.rerender();
  }
  resort(e, t = !0) {
    this.model.resort(e, t);
  }
  hasElement(e) {
    return this.model.has(e);
  }
  createModel(e, t) {
    return new Xxe(e, t);
  }
}
class lwe {
  get compressedTreeNodeProvider() {
    return this._compressedTreeNodeProvider();
  }
  constructor(e, t, n) {
    ((this._compressedTreeNodeProvider = e),
      (this.stickyScrollDelegate = t),
      (this.renderer = n),
      (this.templateId = n.templateId),
      n.onDidChangeTwistieState && (this.onDidChangeTwistieState = n.onDidChangeTwistieState));
  }
  renderTemplate(e) {
    return { compressedTreeNode: void 0, data: this.renderer.renderTemplate(e) };
  }
  renderElement(e, t, n, i) {
    let r = this.stickyScrollDelegate.getCompressedNode(e);
    (r || (r = this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),
      1 === r.element.elements.length
        ? ((n.compressedTreeNode = void 0), this.renderer.renderElement(e, t, n.data, i))
        : ((n.compressedTreeNode = r), this.renderer.renderCompressedElements(r, t, n.data, i)));
  }
  disposeElement(e, t, n, i) {
    n.compressedTreeNode
      ? this.renderer.disposeCompressedElements?.(n.compressedTreeNode, t, n.data, i)
      : this.renderer.disposeElement?.(e, t, n.data, i);
  }
  disposeTemplate(e) {
    this.renderer.disposeTemplate(e.data);
  }
  renderTwistie(e, t) {
    return this.renderer.renderTwistie?.(e, t) ?? !1;
  }
}
!(function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  o > 3 && s && Object.defineProperty(t, n, s);
})([tJ], lwe.prototype, "compressedTreeNodeProvider", null);
class cwe {
  constructor(e) {
    ((this.modelProvider = e), (this.compressedStickyNodes = new Map()));
  }
  getCompressedNode(e) {
    return this.compressedStickyNodes.get(e);
  }
  constrainStickyScrollNodes(e, t, n) {
    if ((this.compressedStickyNodes.clear(), 0 === e.length)) return [];
    for (let i = 0; i < e.length; i++) {
      const r = e[i],
        o = r.position + r.height;
      if ((i + 1 < e.length && o + e[i + 1].height > n) || (i >= t - 1 && t < e.length)) {
        const t = e.slice(0, i),
          n = e.slice(i);
        return [...t, this.compressStickyNodes(n)];
      }
    }
    return e;
  }
  compressStickyNodes(e) {
    if (0 === e.length) throw new Error("Can't compress empty sticky nodes");
    const t = this.modelProvider();
    if (!t.isCompressionEnabled()) return e[0];
    const n = [];
    for (let l = 0; l < e.length; l++) {
      const i = e[l],
        r = t.getCompressedTreeNode(i.node.element);
      if (r.element) {
        if (0 !== l && r.element.incompressible) break;
        n.push(...r.element.elements);
      }
    }
    if (n.length < 2) return e[0];
    const i = e[e.length - 1],
      r = { elements: n, incompressible: !1 },
      o = { ...i.node, children: [], element: r },
      s = new Proxy(e[0].node, {}),
      a = {
        node: s,
        startIndex: e[0].startIndex,
        endIndex: i.endIndex,
        position: e[0].position,
        height: e[0].height,
      };
    return (this.compressedStickyNodes.set(s, o), a);
  }
}
function dwe(e, t) {
  return (
    t && {
      ...t,
      keyboardNavigationLabelProvider: t.keyboardNavigationLabelProvider && {
        getKeyboardNavigationLabel(n) {
          let i;
          try {
            i = e().getCompressedTreeNode(n);
          } catch {
            return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n);
          }
          return 1 === i.element.elements.length
            ? t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n)
            : t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(
                i.element.elements,
              );
        },
      },
    }
  );
}
class uwe extends awe {
  constructor(e, t, n, i, r = {}) {
    const o = () => this,
      s = new cwe(() => this.model),
      a = i.map((e) => new lwe(o, s, e));
    super(e, t, n, a, { ...dwe(o, r), stickyScrollDelegate: s });
  }
  setChildren(e, t = DO.empty(), n) {
    this.model.setChildren(e, t, n);
  }
  createModel(e, t) {
    return new swe(e, t);
  }
  updateOptions(e = {}) {
    (super.updateOptions(e),
      void 0 !== e.compressionEnabled && this.model.setCompressionEnabled(e.compressionEnabled));
  }
  getCompressedTreeNode(e = null) {
    return this.model.getCompressedTreeNode(e);
  }
}
function hwe(e) {
  return { ...e, children: [], refreshPromise: void 0, stale: !0, slow: !1, forceExpanded: !1 };
}
function gwe(e, t) {
  return !!t.parent && (t.parent === e || gwe(e, t.parent));
}
class pwe {
  get element() {
    return this.node.element.element;
  }
  get children() {
    return this.node.children.map((e) => new pwe(e));
  }
  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(e) {
    this.node = e;
  }
}
class fwe {
  constructor(e, t, n) {
    ((this.renderer = e),
      (this.nodeMapper = t),
      (this.onDidChangeTwistieState = n),
      (this.renderedNodes = new Map()),
      (this.templateId = e.templateId));
  }
  renderTemplate(e) {
    return { templateData: this.renderer.renderTemplate(e) };
  }
  renderElement(e, t, n, i) {
    this.renderer.renderElement(this.nodeMapper.map(e), t, n.templateData, i);
  }
  renderTwistie(e, t) {
    return e.slow
      ? (t.classList.add(...AV.asClassNameArray(OV.treeItemLoading)), !0)
      : (t.classList.remove(...AV.asClassNameArray(OV.treeItemLoading)), !1);
  }
  disposeElement(e, t, n, i) {
    this.renderer.disposeElement?.(this.nodeMapper.map(e), t, n.templateData, i);
  }
  disposeTemplate(e) {
    this.renderer.disposeTemplate(e.templateData);
  }
  dispose() {
    this.renderedNodes.clear();
  }
}
function mwe(e) {
  return { browserEvent: e.browserEvent, elements: e.elements.map((e) => e.element) };
}
function _we(e) {
  return {
    browserEvent: e.browserEvent,
    element: e.element && e.element.element,
    target: e.target,
  };
}
class vwe extends Mae {
  constructor(e) {
    (super(e.elements.map((e) => e.element)), (this.data = e));
  }
}
function bwe(e) {
  return e instanceof Mae ? new vwe(e) : e;
}
class ywe {
  constructor(e) {
    this.dnd = e;
  }
  getDragURI(e) {
    return this.dnd.getDragURI(e.element);
  }
  getDragLabel(e, t) {
    if (this.dnd.getDragLabel)
      return this.dnd.getDragLabel(
        e.map((e) => e.element),
        t,
      );
  }
  onDragStart(e, t) {
    this.dnd.onDragStart?.(bwe(e), t);
  }
  onDragOver(e, t, n, i, r, o = !0) {
    return this.dnd.onDragOver(bwe(e), t && t.element, n, i, r);
  }
  drop(e, t, n, i, r) {
    this.dnd.drop(bwe(e), t && t.element, n, i, r);
  }
  onDragEnd(e) {
    this.dnd.onDragEnd?.(e);
  }
  dispose() {
    this.dnd.dispose();
  }
}
class xwe extends Oxe {
  constructor(e, t, n) {
    (super(t, n), (this.findProvider = e), (this.isFindSessionActive = !1));
  }
  filter(e, t) {
    const n = super.filter(e, t);
    if (
      !this.isFindSessionActive ||
      this.findMode === cxe.Highlight ||
      !this.findProvider.isVisible
    )
      return n;
    return 0 === wxe(xxe(n) ? n.visibility : n) ? 0 : this.findProvider.isVisible(e) ? n : 0;
  }
}
class wwe extends Pxe {
  constructor(e, t, n, i, r) {
    (super(e, n, i, r),
      (this.findProvider = t),
      (this.filter = n),
      (this.activeSession = !1),
      (this.asyncWorkInProgress = !1),
      this.disposables.add(
        MO(async () => {
          this.activeSession && (await this.findProvider.endSession?.());
        }),
      ));
  }
  render() {
    if (this.asyncWorkInProgress || !this.activeFindMetadata) return;
    const e = 0 === this.activeFindMetadata.matchCount && this.pattern.length > 0;
    (this.renderMessage(e),
      this.pattern.length && this.alertResults(this.activeFindMetadata.matchCount));
  }
  shouldAllowFocus(e) {
    return this.shouldFocusWhenNavigating(e);
  }
  shouldFocusWhenNavigating(e) {
    if (!this.activeSession || !this.activeFindMetadata) return !0;
    const t = e.element?.element;
    return !(!t || !this.activeFindMetadata.isMatch(t)) || !zie.isDefault(e.filterData);
  }
}
function Cwe(e) {
  return (
    e && {
      ...e,
      collapseByDefault: !0,
      identityProvider: e.identityProvider && { getId: (t) => e.identityProvider.getId(t.element) },
      dnd: e.dnd && new ywe(e.dnd),
      multipleSelectionController: e.multipleSelectionController && {
        isSelectionSingleChangeEvent: (t) =>
          e.multipleSelectionController.isSelectionSingleChangeEvent({ ...t, element: t.element }),
        isSelectionRangeChangeEvent: (t) =>
          e.multipleSelectionController.isSelectionRangeChangeEvent({ ...t, element: t.element }),
      },
      accessibilityProvider: e.accessibilityProvider && {
        ...e.accessibilityProvider,
        getPosInSet: void 0,
        getSetSize: void 0,
        getRole: e.accessibilityProvider.getRole
          ? (t) => e.accessibilityProvider.getRole(t.element)
          : () => "treeitem",
        isChecked: e.accessibilityProvider.isChecked
          ? (t) => !!e.accessibilityProvider?.isChecked(t.element)
          : void 0,
        getAriaLabel: (t) => e.accessibilityProvider.getAriaLabel(t.element),
        getWidgetAriaLabel: () => e.accessibilityProvider.getWidgetAriaLabel(),
        getWidgetRole: e.accessibilityProvider.getWidgetRole
          ? () => e.accessibilityProvider.getWidgetRole()
          : () => "tree",
        getAriaLevel:
          e.accessibilityProvider.getAriaLevel &&
          ((t) => e.accessibilityProvider.getAriaLevel(t.element)),
        getActiveDescendantId:
          e.accessibilityProvider.getActiveDescendantId &&
          ((t) => e.accessibilityProvider.getActiveDescendantId(t.element)),
      },
      filter: e.filter && { filter: (t, n) => e.filter.filter(t.element, n) },
      keyboardNavigationLabelProvider: e.keyboardNavigationLabelProvider && {
        ...e.keyboardNavigationLabelProvider,
        getKeyboardNavigationLabel: (t) =>
          e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element),
      },
      sorter: void 0,
      expandOnlyOnTwistieClick:
        void 0 === e.expandOnlyOnTwistieClick
          ? void 0
          : "function" != typeof e.expandOnlyOnTwistieClick
            ? e.expandOnlyOnTwistieClick
            : (t) => e.expandOnlyOnTwistieClick(t.element),
      defaultFindVisibility: (t) =>
        t.hasChildren && t.stale
          ? 1
          : "number" == typeof e.defaultFindVisibility
            ? e.defaultFindVisibility
            : void 0 === e.defaultFindVisibility
              ? 2
              : e.defaultFindVisibility(t.element),
      stickyScrollDelegate: e.stickyScrollDelegate,
    }
  );
}
function Swe(e, t) {
  (t(e), e.children.forEach((e) => Swe(e, t)));
}
class kwe {
  get onDidScroll() {
    return this.tree.onDidScroll;
  }
  get onDidChangeFocus() {
    return $O.map(this.tree.onDidChangeFocus, mwe);
  }
  get onDidChangeSelection() {
    return $O.map(this.tree.onDidChangeSelection, mwe);
  }
  get onMouseDblClick() {
    return $O.map(this.tree.onMouseDblClick, _we);
  }
  get onPointer() {
    return $O.map(this.tree.onPointer, _we);
  }
  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(e, t, n, i, r, o = {}) {
    ((this.user = e),
      (this.dataSource = r),
      (this.nodes = new Map()),
      (this.subTreeRefreshPromises = new Map()),
      (this.refreshPromises = new Map()),
      (this._onDidRender = new QO()),
      (this._onDidChangeNodeSlowState = new QO()),
      (this.nodeMapper = new gxe((e) => new pwe(e))),
      (this.disposables = new AO()),
      (this.identityProvider = o.identityProvider),
      (this.autoExpandSingleChildren =
        void 0 !== o.autoExpandSingleChildren && o.autoExpandSingleChildren),
      (this.sorter = o.sorter),
      (this.getDefaultCollapseState = (e) =>
        o.collapseByDefault
          ? o.collapseByDefault(e)
            ? sxe.PreserveOrCollapsed
            : sxe.PreserveOrExpanded
          : void 0));
    let s,
      a = !1;
    if (
      (o.findProvider &&
        (o.findWidgetEnabled ?? 1) &&
        o.keyboardNavigationLabelProvider &&
        o.contextViewProvider &&
        ((a = !0), (s = new xwe(o.findProvider, o.keyboardNavigationLabelProvider, o.filter))),
      (this.tree = this.createTree(e, t, n, i, {
        ...o,
        findWidgetEnabled: !a,
        filter: s ?? o.filter,
      })),
      (this.root = hwe({
        element: void 0,
        parent: null,
        hasChildren: !0,
        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),
      a)
    ) {
      const e = {
        styles: o.findWidgetStyles,
        showNotFoundMessage: o.showNotFoundMessage,
        defaultFindMatchType: o.defaultFindMatchType,
        defaultFindMode: o.defaultFindMode,
      };
      ((this.findController = this.disposables.add(
        new wwe(this.tree, o.findProvider, s, this.tree.options.contextViewProvider, e),
      )),
        (this.focusNavigationFilter = (e) => this.findController.shouldFocusWhenNavigating(e)),
        (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(e, t, n, i, r) {
    const o = new Dxe(n),
      s = i.map((e) => new fwe(e, this.nodeMapper, this._onDidChangeNodeSlowState.event)),
      a = Cwe(r) || {};
    return new awe(e, t, o, s, a);
  }
  updateOptions(e = {}) {
    (this.findController &&
      (void 0 !== e.defaultFindMode && (this.findController.mode = e.defaultFindMode),
      void 0 !== e.defaultFindMatchType &&
        (this.findController.matchType = e.defaultFindMatchType)),
      this.tree.updateOptions(e));
  }
  getHTMLElement() {
    return this.tree.getHTMLElement();
  }
  get scrollTop() {
    return this.tree.scrollTop;
  }
  set scrollTop(e) {
    this.tree.scrollTop = e;
  }
  get scrollHeight() {
    return this.tree.scrollHeight;
  }
  get renderHeight() {
    return this.tree.renderHeight;
  }
  domFocus() {
    this.tree.domFocus();
  }
  layout(e, t) {
    this.tree.layout(e, t);
  }
  style(e) {
    this.tree.style(e);
  }
  getInput() {
    return this.root.element;
  }
  async setInput(e, t) {
    (this.cancelAllRefreshPromises(), (this.root.element = e));
    const n = t && { viewState: t, focus: [], selection: [] };
    (await this._updateChildren(e, !0, !1, n),
      n && (this.tree.setFocus(n.focus), this.tree.setSelection(n.selection)),
      t && "number" == typeof t.scrollTop && (this.scrollTop = t.scrollTop));
  }
  cancelAllRefreshPromises(e = !1) {
    (this.refreshPromises.forEach((e) => e.cancel()),
      this.refreshPromises.clear(),
      e &&
        (this.subTreeRefreshPromises.forEach((e) => e.cancel()),
        this.subTreeRefreshPromises.clear()));
  }
  async _updateChildren(e = this.root.element, t = !0, n = !1, i, r) {
    if (void 0 === this.root.element) throw new hxe(this.user, "Tree input not set");
    this.root.refreshPromise &&
      (await this.root.refreshPromise, await $O.toPromise(this._onDidRender.event));
    const o = this.getDataNode(e);
    if ((await this.refreshAndRenderNode(o, t, i, r), n))
      try {
        this.tree.rerender(o);
      } catch {}
  }
  rerender(e) {
    if (void 0 === e || e === this.root.element) return void this.tree.rerender();
    const t = this.getDataNode(e);
    this.tree.rerender(t);
  }
  getNode(e = this.root.element) {
    const t = this.getDataNode(e),
      n = this.tree.getNode(t === this.root ? null : t);
    return this.nodeMapper.map(n);
  }
  collapse(e, t = !1) {
    const n = this.getDataNode(e);
    return this.tree.collapse(n === this.root ? null : n, t);
  }
  async expand(e, t = !1) {
    if (void 0 === this.root.element) throw new hxe(this.user, "Tree input not set");
    this.root.refreshPromise &&
      (await this.root.refreshPromise, await $O.toPromise(this._onDidRender.event));
    const n = this.getDataNode(e);
    if (this.tree.hasElement(n) && !this.tree.isCollapsible(n)) return !1;
    if (
      (n.refreshPromise && (await n.refreshPromise, await $O.toPromise(this._onDidRender.event)),
      n !== this.root && !n.refreshPromise && !this.tree.isCollapsed(n))
    )
      return !1;
    const i = this.tree.expand(n === this.root ? null : n, t);
    return (
      n.refreshPromise && (await n.refreshPromise, await $O.toPromise(this._onDidRender.event)),
      i
    );
  }
  setSelection(e, t) {
    const n = e.map((e) => this.getDataNode(e));
    this.tree.setSelection(n, t);
  }
  getSelection() {
    return this.tree.getSelection().map((e) => e.element);
  }
  setFocus(e, t) {
    const n = e.map((e) => this.getDataNode(e));
    this.tree.setFocus(n, t);
  }
  getFocus() {
    return this.tree.getFocus().map((e) => e.element);
  }
  reveal(e, t) {
    this.tree.reveal(this.getDataNode(e), t);
  }
  getParentElement(e) {
    const t = this.tree.getParentElement(this.getDataNode(e));
    return t && t.element;
  }
  getFirstElementChild(e = this.root.element) {
    const t = this.getDataNode(e),
      n = this.tree.getFirstElementChild(t === this.root ? null : t);
    return n && n.element;
  }
  getDataNode(e) {
    const t = this.nodes.get(e === this.root.element ? null : e);
    if (!t) {
      const t = this.identityProvider?.getId(e).toString();
      throw new hxe(this.user, "Data tree node not found" + (t ? `: ${t}` : ""));
    }
    return t;
  }
  async refreshAndRenderNode(e, t, n, i) {
    this.disposables.isDisposed ||
      (await this.refreshNode(e, t, n), this.disposables.isDisposed || this.render(e, n, i));
  }
  async refreshNode(e, t, n) {
    let i;
    if (
      (this.subTreeRefreshPromises.forEach((r, o) => {
        !i &&
          (function (e, t) {
            return e === t || gwe(e, t) || gwe(t, e);
          })(o, e) &&
          (i = r.then(() => this.refreshNode(e, t, n)));
      }),
      i)
    )
      return i;
    if (e !== this.root) {
      if (this.tree.getNode(e).collapsed)
        return (
          (e.hasChildren = !!this.dataSource.hasChildren(e.element)),
          (e.stale = !0),
          void this.setChildren(e, [], t, n)
        );
    }
    return this.doRefreshSubTree(e, t, n);
  }
  async doRefreshSubTree(e, t, n) {
    const i = gM(async () => {
      const i = await this.doRefreshNode(e, t, n);
      ((e.stale = !1), await TM.settled(i.map((e) => this.doRefreshSubTree(e, t, n))));
    });
    return (
      (e.refreshPromise = i),
      this.subTreeRefreshPromises.set(e, i),
      i.finally(() => {
        ((e.refreshPromise = void 0), this.subTreeRefreshPromises.delete(e));
      }),
      i
    );
  }
  async doRefreshNode(e, t, n) {
    let i;
    if (((e.hasChildren = !!this.dataSource.hasChildren(e.element)), e.hasChildren)) {
      const t = this.doGetChildren(e);
      if (cR(t)) i = Promise.resolve(t);
      else {
        const n = vM(800);
        (n.then(
          () => {
            ((e.slow = !0), this._onDidChangeNodeSlowState.fire(e));
          },
          (e) => null,
        ),
          (i = t.finally(() => n.cancel())));
      }
    } else i = Promise.resolve(DO.empty());
    try {
      const r = await i;
      return this.setChildren(e, r, t, n);
    } catch (r) {
      if ((e !== this.root && this.tree.hasElement(e) && this.tree.collapse(e), qI(r))) return [];
      throw r;
    } finally {
      e.slow && ((e.slow = !1), this._onDidChangeNodeSlowState.fire(e));
    }
  }
  doGetChildren(e) {
    let t = this.refreshPromises.get(e);
    if (t) return t;
    const n = this.dataSource.getChildren(e.element);
    return cR(n)
      ? this.processChildren(n)
      : ((t = gM(async () => this.processChildren(await n))),
        this.refreshPromises.set(e, t),
        t.finally(() => {
          this.refreshPromises.delete(e);
        }));
  }
  _onDidChangeCollapseState({ node: e, deep: t }) {
    null !== e.element &&
      !e.collapsed &&
      e.element.stale &&
      (t ? this.collapse(e.element.element) : this.refreshAndRenderNode(e.element, !1).catch(HI));
  }
  setChildren(e, t, n, i) {
    const r = [...t];
    if (0 === e.children.length && 0 === r.length) return [];
    const o = new Map(),
      s = new Map();
    for (const c of e.children)
      (o.set(c.element, c),
        this.identityProvider &&
          s.set(c.id, { node: c, collapsed: this.tree.hasElement(c) && this.tree.isCollapsed(c) }));
    const a = [],
      l = r.map((t) => {
        const r = !!this.dataSource.hasChildren(t);
        if (!this.identityProvider) {
          const n = hwe({
            element: t,
            parent: e,
            hasChildren: r,
            defaultCollapseState: this.getDefaultCollapseState(t),
          });
          return (r && n.defaultCollapseState === sxe.PreserveOrExpanded && a.push(n), n);
        }
        const l = this.identityProvider.getId(t).toString(),
          c = s.get(l);
        if (c) {
          const e = c.node;
          return (
            o.delete(e.element),
            this.nodes.delete(e.element),
            this.nodes.set(t, e),
            (e.element = t),
            (e.hasChildren = r),
            n
              ? c.collapsed
                ? (e.children.forEach((e) => Swe(e, (e) => this.nodes.delete(e.element))),
                  e.children.splice(0, e.children.length),
                  (e.stale = !0))
                : a.push(e)
              : r && !c.collapsed && a.push(e),
            e
          );
        }
        const d = hwe({
          element: t,
          parent: e,
          id: l,
          hasChildren: r,
          defaultCollapseState: this.getDefaultCollapseState(t),
        });
        return (
          i && i.viewState.focus && i.viewState.focus.indexOf(l) > -1 && i.focus.push(d),
          i &&
            i.viewState.selection &&
            i.viewState.selection.indexOf(l) > -1 &&
            i.selection.push(d),
          ((i && i.viewState.expanded && i.viewState.expanded.indexOf(l) > -1) ||
            (r && d.defaultCollapseState === sxe.PreserveOrExpanded)) &&
            a.push(d),
          d
        );
      });
    for (const c of o.values()) Swe(c, (e) => this.nodes.delete(e.element));
    for (const c of l) this.nodes.set(c.element, c);
    return (
      mj(e.children, 0, e.children.length, l),
      e !== this.root &&
        this.autoExpandSingleChildren &&
        1 === l.length &&
        0 === a.length &&
        ((l[0].forceExpanded = !0), a.push(l[0])),
      a
    );
  }
  render(e, t, n) {
    const i = e.children.map((e) => this.asTreeElement(e, t)),
      r = n && {
        ...n,
        diffIdentityProvider: n.diffIdentityProvider && {
          getId: (e) => n.diffIdentityProvider.getId(e.element),
        },
      };
    (this.tree.setChildren(e === this.root ? null : e, i, r),
      e !== this.root && this.tree.setCollapsible(e, e.hasChildren),
      this._onDidRender.fire());
  }
  asTreeElement(e, t) {
    if (e.stale) return { element: e, collapsible: e.hasChildren, collapsed: !0 };
    let n;
    return (
      t && t.viewState.expanded && e.id && t.viewState.expanded.indexOf(e.id) > -1
        ? (n = !1)
        : e.forceExpanded
          ? ((n = !1), (e.forceExpanded = !1))
          : (n = e.defaultCollapseState),
      {
        element: e,
        children: e.hasChildren ? DO.map(e.children, (e) => this.asTreeElement(e, t)) : [],
        collapsible: e.hasChildren,
        collapsed: n,
      }
    );
  }
  processChildren(e) {
    return (this.sorter && (e = [...e].sort(this.sorter.compare.bind(this.sorter))), e);
  }
  dispose() {
    (this.disposables.dispose(), this.tree.dispose());
  }
}
class Ewe {
  get element() {
    return {
      elements: this.node.element.elements.map((e) => e.element),
      incompressible: this.node.element.incompressible,
    };
  }
  get children() {
    return this.node.children.map((e) => new Ewe(e));
  }
  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(e) {
    this.node = e;
  }
}
class Nwe {
  constructor(e, t, n, i) {
    ((this.renderer = e),
      (this.nodeMapper = t),
      (this.compressibleNodeMapperProvider = n),
      (this.onDidChangeTwistieState = i),
      (this.renderedNodes = new Map()),
      (this.disposables = []),
      (this.templateId = e.templateId));
  }
  renderTemplate(e) {
    return { templateData: this.renderer.renderTemplate(e) };
  }
  renderElement(e, t, n, i) {
    this.renderer.renderElement(this.nodeMapper.map(e), t, n.templateData, i);
  }
  renderCompressedElements(e, t, n, i) {
    this.renderer.renderCompressedElements(
      this.compressibleNodeMapperProvider().map(e),
      t,
      n.templateData,
      i,
    );
  }
  renderTwistie(e, t) {
    return e.slow
      ? (t.classList.add(...AV.asClassNameArray(OV.treeItemLoading)), !0)
      : (t.classList.remove(...AV.asClassNameArray(OV.treeItemLoading)), !1);
  }
  disposeElement(e, t, n, i) {
    this.renderer.disposeElement?.(this.nodeMapper.map(e), t, n.templateData, i);
  }
  disposeCompressedElements(e, t, n, i) {
    this.renderer.disposeCompressedElements?.(
      this.compressibleNodeMapperProvider().map(e),
      t,
      n.templateData,
      i,
    );
  }
  disposeTemplate(e) {
    this.renderer.disposeTemplate(e.templateData);
  }
  dispose() {
    (this.renderedNodes.clear(), (this.disposables = IO(this.disposables)));
  }
}
class Lwe extends kwe {
  constructor(e, t, n, i, r, o, s = {}) {
    (super(e, t, n, r, o, s),
      (this.compressionDelegate = i),
      (this.compressibleNodeMapper = new gxe((e) => new Ewe(e))),
      (this.filter = s.filter));
  }
  createTree(e, t, n, i, r) {
    const o = new Dxe(n),
      s = i.map(
        (e) =>
          new Nwe(
            e,
            this.nodeMapper,
            () => this.compressibleNodeMapper,
            this._onDidChangeNodeSlowState.event,
          ),
      ),
      a =
        (function (e) {
          const t = e && Cwe(e);
          return (
            t && {
              ...t,
              keyboardNavigationLabelProvider: t.keyboardNavigationLabelProvider && {
                ...t.keyboardNavigationLabelProvider,
                getCompressedNodeKeyboardNavigationLabel: (t) =>
                  e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(
                    t.map((e) => e.element),
                  ),
              },
              stickyScrollDelegate: t.stickyScrollDelegate,
            }
          );
        })(r) || {};
    return new uwe(e, t, o, s, a);
  }
  asTreeElement(e, t) {
    return {
      incompressible: this.compressionDelegate.isIncompressible(e.element),
      ...super.asTreeElement(e, t),
    };
  }
  render(e, t, n) {
    if (!this.identityProvider) return super.render(e, t);
    const i = (e) => this.identityProvider.getId(e).toString(),
      r = (e) => {
        const t = new Set();
        for (const n of e) {
          const e = this.tree.getCompressedTreeNode(n === this.root ? null : n);
          if (e.element) for (const n of e.element.elements) t.add(i(n.element));
        }
        return t;
      },
      o = r(this.tree.getSelection()),
      s = r(this.tree.getFocus());
    super.render(e, t, n);
    const a = this.getSelection();
    let l = !1;
    const c = this.getFocus();
    let d = !1;
    const u = (e) => {
      const t = e.element;
      if (t)
        for (let n = 0; n < t.elements.length; n++) {
          const e = i(t.elements[n].element),
            r = t.elements[t.elements.length - 1].element;
          (o.has(e) && -1 === a.indexOf(r) && (a.push(r), (l = !0)),
            s.has(e) && -1 === c.indexOf(r) && (c.push(r), (d = !0)));
        }
      e.children.forEach(u);
    };
    (u(this.tree.getCompressedTreeNode(e === this.root ? null : e)),
      l && this.setSelection(a),
      d && this.setFocus(c));
  }
  processChildren(e) {
    return (
      this.filter &&
        (e = DO.filter(e, (e) => {
          const t = this.filter.filter(e, 1),
            n = "boolean" == typeof (i = t) ? (i ? 1 : 0) : xxe(i) ? wxe(i.visibility) : wxe(i);
          var i;
          if (2 === n)
            throw new Error(
              "Recursive tree visibility not supported in async data compressed trees",
            );
          return 1 === n;
        })),
      super.processChildren(e)
    );
  }
}
class Dwe extends Yxe {
  constructor(e, t, n, i, r, o = {}) {
    (super(e, t, n, i, o),
      (this.user = e),
      (this.dataSource = r),
      (this.identityProvider = o.identityProvider));
  }
  createModel(e, t) {
    return new Xxe(e, t);
  }
}
(new yW("isMac", PR, SI(1684, "Whether the operating system is macOS")),
  new yW("isLinux", jR, SI(1685, "Whether the operating system is Linux")));
const Twe = new yW("isWindows", AR, SI(1686, "Whether the operating system is Windows")),
  Iwe = new yW("isWeb", BR, SI(1687, "Whether the platform is a web browser"));
(new yW(
  "isMacNative",
  PR && !BR,
  SI(1688, "Whether the operating system is macOS on a non-browser platform"),
),
  new yW("isIOS", WR, SI(1689, "Whether the operating system is iOS")),
  new yW("isMobile", HR, SI(1690, "Whether the platform is a mobile web browser")),
  new yW("isDevelopment", !1, !0),
  new yW("productQualityType", "", SI(1691, "Quality type of VS Code")));
const Rwe = "inputFocus",
  Owe = new yW(Rwe, !1, SI(1692, "Whether keyboard focus is inside an input box"));
var Mwe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Awe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const Pwe = bV("listService");
const jwe = new yW("listScrollAtBoundary", "none");
(eW.or(jwe.isEqualTo("top"), jwe.isEqualTo("both")),
  eW.or(jwe.isEqualTo("bottom"), jwe.isEqualTo("both")));
const Fwe = new yW("listFocus", !0),
  Bwe = new yW("treestickyScrollFocused", !1),
  Vwe = new yW("listSupportsMultiselect", !0),
  Wwe = eW.and(Fwe, eW.not(Rwe), Bwe.negate()),
  Hwe = new yW("listHasSelectionOrFocus", !1),
  zwe = new yW("listDoubleSelection", !1),
  Uwe = new yW("listMultiSelection", !1),
  $we = new yW("listSelectionNavigation", !1),
  qwe = new yW("listSupportsFind", !0),
  Kwe = new yW("treeElementCanCollapse", !1),
  Gwe = new yW("treeElementHasParent", !1),
  Zwe = new yW("treeElementCanExpand", !1),
  Ywe = new yW("treeElementHasChild", !1),
  Xwe = new yW("treeFindOpen", !1),
  Qwe = "listTypeNavigationMode",
  Jwe = "listAutomaticKeyboardNavigation";
function eCe(e, t) {
  const n = e.createScoped(t.getHTMLElement());
  return (Fwe.bindTo(n), n);
}
function tCe(e, t) {
  const n = jwe.bindTo(e),
    i = () => {
      const e = 0 === t.scrollTop,
        i = t.scrollHeight - t.renderHeight - t.scrollTop < 1;
      e && i ? n.set("both") : e ? n.set("top") : i ? n.set("bottom") : n.set("none");
    };
  return (i(), t.onDidScroll(i));
}
const nCe = "workbench.list.multiSelectModifier",
  iCe = "workbench.list.openMode",
  rCe = "workbench.list.horizontalScrolling",
  oCe = "workbench.list.defaultFindMode",
  sCe = "workbench.list.typeNavigationMode",
  aCe = "workbench.list.keyboardNavigation",
  lCe = "workbench.list.scrollByPage",
  cCe = "workbench.list.defaultFindMatchType",
  dCe = "workbench.tree.indent",
  uCe = "workbench.tree.renderIndentGuides",
  hCe = "workbench.list.smoothScrolling",
  gCe = "workbench.list.mouseWheelScrollSensitivity",
  pCe = "workbench.list.fastScrollSensitivity",
  fCe = "workbench.tree.expandMode",
  mCe = "workbench.tree.enableStickyScroll",
  _Ce = "workbench.tree.stickyScrollMaxItemCount";
function vCe(e) {
  return "alt" === e.getValue(nCe);
}
class bCe extends PO {
  constructor(e) {
    (super(),
      (this.configurationService = e),
      (this.useAltAsMultipleSelectionModifier = vCe(e)),
      this.registerListeners());
  }
  registerListeners() {
    this._register(
      this.configurationService.onDidChangeConfiguration((e) => {
        e.affectsConfiguration(nCe) &&
          (this.useAltAsMultipleSelectionModifier = vCe(this.configurationService));
      }),
    );
  }
  isSelectionSingleChangeEvent(e) {
    return this.useAltAsMultipleSelectionModifier ? e.browserEvent.altKey : tle(e);
  }
  isSelectionRangeChangeEvent(e) {
    return nle(e);
  }
}
function yCe(e, t) {
  const n = e.get(OU),
    i = e.get(N5),
    r = new AO(),
    o = {
      ...t,
      keyboardNavigationDelegate: {
        mightProducePrintableCharacter: (e) => i.mightProducePrintableCharacter(e),
      },
      smoothScrolling: Boolean(n.getValue(hCe)),
      mouseWheelScrollSensitivity: n.getValue(gCe),
      fastScrollSensitivity: n.getValue(pCe),
      multipleSelectionController: t.multipleSelectionController ?? r.add(new bCe(n)),
      keyboardNavigationEventFilter: LCe(i),
      scrollByPage: Boolean(n.getValue(lCe)),
    };
  return [o, r];
}
let xCe = class extends gle {
  constructor(e, t, n, i, r, o, s, a, l) {
    const c = void 0 !== r.horizontalScrolling ? r.horizontalScrolling : Boolean(a.getValue(rCe)),
      [d, u] = l.invokeFunction(yCe, r);
    (super(e, t, n, i, { keyboardSupport: !1, ...d, horizontalScrolling: c }),
      this.disposables.add(u),
      (this.contextKeyService = eCe(o, this)),
      this.disposables.add(tCe(this.contextKeyService, this)),
      (this.listSupportsMultiSelect = Vwe.bindTo(this.contextKeyService)),
      this.listSupportsMultiSelect.set(!1 !== r.multipleSelectionSupport));
    ($we.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),
      (this.listHasSelectionOrFocus = Hwe.bindTo(this.contextKeyService)),
      (this.listDoubleSelection = zwe.bindTo(this.contextKeyService)),
      (this.listMultiSelection = Uwe.bindTo(this.contextKeyService)),
      (this.horizontalScrolling = r.horizontalScrolling),
      (this._useAltAsMultipleSelectionModifier = vCe(a)),
      this.disposables.add(this.contextKeyService),
      this.disposables.add(s.register(this)),
      this.updateStyles(r.overrideStyles),
      this.disposables.add(
        this.onDidChangeSelection(() => {
          const e = this.getSelection(),
            t = this.getFocus();
          this.contextKeyService.bufferChangeEvents(() => {
            (this.listHasSelectionOrFocus.set(e.length > 0 || t.length > 0),
              this.listMultiSelection.set(e.length > 1),
              this.listDoubleSelection.set(2 === e.length));
          });
        }),
      ),
      this.disposables.add(
        this.onDidChangeFocus(() => {
          const e = this.getSelection(),
            t = this.getFocus();
          this.listHasSelectionOrFocus.set(e.length > 0 || t.length > 0);
        }),
      ),
      this.disposables.add(
        a.onDidChangeConfiguration((e) => {
          e.affectsConfiguration(nCe) && (this._useAltAsMultipleSelectionModifier = vCe(a));
          let t = {};
          if (e.affectsConfiguration(rCe) && void 0 === this.horizontalScrolling) {
            const e = Boolean(a.getValue(rCe));
            t = { ...t, horizontalScrolling: e };
          }
          if (e.affectsConfiguration(lCe)) {
            const e = Boolean(a.getValue(lCe));
            t = { ...t, scrollByPage: e };
          }
          if (e.affectsConfiguration(hCe)) {
            const e = Boolean(a.getValue(hCe));
            t = { ...t, smoothScrolling: e };
          }
          if (e.affectsConfiguration(gCe)) {
            const e = a.getValue(gCe);
            t = { ...t, mouseWheelScrollSensitivity: e };
          }
          if (e.affectsConfiguration(pCe)) {
            const e = a.getValue(pCe);
            t = { ...t, fastScrollSensitivity: e };
          }
          Object.keys(t).length > 0 && this.updateOptions(t);
        }),
      ),
      (this.navigator = new kCe(this, { configurationService: a, ...r })),
      this.disposables.add(this.navigator));
  }
  updateOptions(e) {
    (super.updateOptions(e),
      void 0 !== e.overrideStyles && this.updateStyles(e.overrideStyles),
      void 0 !== e.multipleSelectionSupport &&
        this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport));
  }
  updateStyles(e) {
    this.style(e ? _ue(e) : mue);
  }
};
xCe = Mwe([Awe(5, xW), Awe(6, Pwe), Awe(7, OU), Awe(8, vV)], xCe);
let wCe = class extends Zye {
  constructor(e, t, n, i, r, o, s, a, l) {
    const c = void 0 !== r.horizontalScrolling ? r.horizontalScrolling : Boolean(a.getValue(rCe)),
      [d, u] = l.invokeFunction(yCe, r);
    (super(e, t, n, i, { keyboardSupport: !1, ...d, horizontalScrolling: c }),
      (this.disposables = new AO()),
      this.disposables.add(u),
      (this.contextKeyService = eCe(o, this)),
      this.disposables.add(tCe(this.contextKeyService, this.widget)),
      (this.horizontalScrolling = r.horizontalScrolling),
      (this.listSupportsMultiSelect = Vwe.bindTo(this.contextKeyService)),
      this.listSupportsMultiSelect.set(!1 !== r.multipleSelectionSupport));
    ($we.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),
      (this._useAltAsMultipleSelectionModifier = vCe(a)),
      this.disposables.add(this.contextKeyService),
      this.disposables.add(s.register(this)),
      this.updateStyles(r.overrideStyles),
      this.disposables.add(
        a.onDidChangeConfiguration((e) => {
          e.affectsConfiguration(nCe) && (this._useAltAsMultipleSelectionModifier = vCe(a));
          let t = {};
          if (e.affectsConfiguration(rCe) && void 0 === this.horizontalScrolling) {
            const e = Boolean(a.getValue(rCe));
            t = { ...t, horizontalScrolling: e };
          }
          if (e.affectsConfiguration(lCe)) {
            const e = Boolean(a.getValue(lCe));
            t = { ...t, scrollByPage: e };
          }
          if (e.affectsConfiguration(hCe)) {
            const e = Boolean(a.getValue(hCe));
            t = { ...t, smoothScrolling: e };
          }
          if (e.affectsConfiguration(gCe)) {
            const e = a.getValue(gCe);
            t = { ...t, mouseWheelScrollSensitivity: e };
          }
          if (e.affectsConfiguration(pCe)) {
            const e = a.getValue(pCe);
            t = { ...t, fastScrollSensitivity: e };
          }
          Object.keys(t).length > 0 && this.updateOptions(t);
        }),
      ),
      (this.navigator = new kCe(this, { configurationService: a, ...r })),
      this.disposables.add(this.navigator));
  }
  updateOptions(e) {
    (super.updateOptions(e),
      void 0 !== e.overrideStyles && this.updateStyles(e.overrideStyles),
      void 0 !== e.multipleSelectionSupport &&
        this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport));
  }
  updateStyles(e) {
    this.style(e ? _ue(e) : mue);
  }
  dispose() {
    (this.disposables.dispose(), super.dispose());
  }
};
wCe = Mwe([Awe(5, xW), Awe(6, Pwe), Awe(7, OU), Awe(8, vV)], wCe);
let CCe = class extends oxe {
  constructor(e, t, n, i, r, o, s, a, l, c) {
    const d = void 0 !== o.horizontalScrolling ? o.horizontalScrolling : Boolean(l.getValue(rCe)),
      [u, h] = c.invokeFunction(yCe, o);
    (super(e, t, n, i, r, { keyboardSupport: !1, ...u, horizontalScrolling: d }),
      this.disposables.add(h),
      (this.contextKeyService = eCe(s, this)),
      this.disposables.add(tCe(this.contextKeyService, this)),
      (this.listSupportsMultiSelect = Vwe.bindTo(this.contextKeyService)),
      this.listSupportsMultiSelect.set(!1 !== o.multipleSelectionSupport));
    ($we.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),
      (this.listHasSelectionOrFocus = Hwe.bindTo(this.contextKeyService)),
      (this.listDoubleSelection = zwe.bindTo(this.contextKeyService)),
      (this.listMultiSelection = Uwe.bindTo(this.contextKeyService)),
      (this.horizontalScrolling = o.horizontalScrolling),
      (this._useAltAsMultipleSelectionModifier = vCe(l)),
      this.disposables.add(this.contextKeyService),
      this.disposables.add(a.register(this)),
      this.updateStyles(o.overrideStyles),
      this.disposables.add(
        this.onDidChangeSelection(() => {
          const e = this.getSelection(),
            t = this.getFocus();
          this.contextKeyService.bufferChangeEvents(() => {
            (this.listHasSelectionOrFocus.set(e.length > 0 || t.length > 0),
              this.listMultiSelection.set(e.length > 1),
              this.listDoubleSelection.set(2 === e.length));
          });
        }),
      ),
      this.disposables.add(
        this.onDidChangeFocus(() => {
          const e = this.getSelection(),
            t = this.getFocus();
          this.listHasSelectionOrFocus.set(e.length > 0 || t.length > 0);
        }),
      ),
      this.disposables.add(
        l.onDidChangeConfiguration((e) => {
          e.affectsConfiguration(nCe) && (this._useAltAsMultipleSelectionModifier = vCe(l));
          let t = {};
          if (e.affectsConfiguration(rCe) && void 0 === this.horizontalScrolling) {
            const e = Boolean(l.getValue(rCe));
            t = { ...t, horizontalScrolling: e };
          }
          if (e.affectsConfiguration(lCe)) {
            const e = Boolean(l.getValue(lCe));
            t = { ...t, scrollByPage: e };
          }
          if (e.affectsConfiguration(hCe)) {
            const e = Boolean(l.getValue(hCe));
            t = { ...t, smoothScrolling: e };
          }
          if (e.affectsConfiguration(gCe)) {
            const e = l.getValue(gCe);
            t = { ...t, mouseWheelScrollSensitivity: e };
          }
          if (e.affectsConfiguration(pCe)) {
            const e = l.getValue(pCe);
            t = { ...t, fastScrollSensitivity: e };
          }
          Object.keys(t).length > 0 && this.updateOptions(t);
        }),
      ),
      (this.navigator = new ECe(this, { configurationService: l, ...o })),
      this.disposables.add(this.navigator));
  }
  updateOptions(e) {
    (super.updateOptions(e),
      void 0 !== e.overrideStyles && this.updateStyles(e.overrideStyles),
      void 0 !== e.multipleSelectionSupport &&
        this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport));
  }
  updateStyles(e) {
    this.style(e ? _ue(e) : mue);
  }
  dispose() {
    (this.disposables.dispose(), super.dispose());
  }
};
CCe = Mwe([Awe(6, xW), Awe(7, Pwe), Awe(8, OU), Awe(9, vV)], CCe);
class SCe extends PO {
  constructor(e, t) {
    (super(),
      (this.widget = e),
      (this._onDidOpen = this._register(new QO())),
      (this.onDidOpen = this._onDidOpen.event),
      this._register(
        $O.filter(this.widget.onDidChangeSelection, (e) => LB(e.browserEvent))((e) =>
          this.onSelectionFromKeyboard(e),
        ),
      ),
      this._register(this.widget.onPointer((e) => this.onPointer(e.element, e.browserEvent))),
      this._register(
        this.widget.onMouseDblClick((e) => this.onMouseDblClick(e.element, e.browserEvent)),
      ),
      "boolean" != typeof t?.openOnSingleClick && t?.configurationService
        ? ((this.openOnSingleClick = "doubleClick" !== t?.configurationService.getValue(iCe)),
          this._register(
            t?.configurationService.onDidChangeConfiguration((e) => {
              e.affectsConfiguration(iCe) &&
                (this.openOnSingleClick = "doubleClick" !== t?.configurationService.getValue(iCe));
            }),
          ))
        : (this.openOnSingleClick = t?.openOnSingleClick ?? !0));
  }
  onSelectionFromKeyboard(e) {
    if (1 !== e.elements.length) return;
    const t = e.browserEvent,
      n = "boolean" != typeof t.preserveFocus || t.preserveFocus,
      i = "boolean" == typeof t.pinned ? t.pinned : !n;
    this._open(this.getSelectedElement(), n, i, !1, e.browserEvent);
  }
  onPointer(e, t) {
    if (!this.openOnSingleClick) return;
    if (2 === t.detail) return;
    const n = 1 === t.button,
      i = t.ctrlKey || t.metaKey || t.altKey;
    this._open(e, !0, n, i, t);
  }
  onMouseDblClick(e, t) {
    if (!t) return;
    const n = t.target;
    if (
      n.classList.contains("monaco-tl-twistie") ||
      (n.classList.contains("monaco-icon-label") &&
        n.classList.contains("folder-icon") &&
        t.offsetX < 16)
    )
      return;
    const i = t.ctrlKey || t.metaKey || t.altKey;
    this._open(e, !1, !0, i, t);
  }
  _open(e, t, n, i, r) {
    e &&
      this._onDidOpen.fire({
        editorOptions: { preserveFocus: t, pinned: n, revealIfVisible: !0 },
        sideBySide: i,
        element: e,
        browserEvent: r,
      });
  }
}
class kCe extends SCe {
  constructor(e, t) {
    (super(e, t), (this.widget = e));
  }
  getSelectedElement() {
    return this.widget.getSelectedElements()[0];
  }
}
class ECe extends SCe {
  constructor(e, t) {
    super(e, t);
  }
  getSelectedElement() {
    return this.widget.getSelectedElements()[0];
  }
}
class NCe extends SCe {
  constructor(e, t) {
    super(e, t);
  }
  getSelectedElement() {
    return this.widget.getSelection()[0] ?? void 0;
  }
}
function LCe(e) {
  let t = !1;
  return (n) => {
    if (n.toKeyCodeChord().isModifierKey()) return !1;
    if (t) return ((t = !1), !1);
    const i = e.softDispatch(n, n.target);
    return 1 === i.kind ? ((t = !0), !1) : ((t = !1), 0 === i.kind);
  };
}
let DCe = class extends awe {
  get onDidOpen() {
    return this.internals.onDidOpen;
  }
  constructor(e, t, n, i, r, o, s, a, l) {
    const { options: c, getTypeNavigationMode: d, disposable: u } = o.invokeFunction(PCe, r);
    (super(e, t, n, i, c),
      this.disposables.add(u),
      (this.internals = new jCe(this, r, d, r.overrideStyles, s, a, l)),
      this.disposables.add(this.internals));
  }
  updateOptions(e) {
    (super.updateOptions(e), this.internals.updateOptions(e));
  }
};
DCe = Mwe([Awe(5, vV), Awe(6, xW), Awe(7, Pwe), Awe(8, OU)], DCe);
let TCe = class extends uwe {
  constructor(e, t, n, i, r, o, s, a, l) {
    const { options: c, getTypeNavigationMode: d, disposable: u } = o.invokeFunction(PCe, r);
    (super(e, t, n, i, c),
      this.disposables.add(u),
      (this.internals = new jCe(this, r, d, r.overrideStyles, s, a, l)),
      this.disposables.add(this.internals));
  }
  updateOptions(e = {}) {
    (super.updateOptions(e),
      e.overrideStyles && this.internals.updateStyleOverrides(e.overrideStyles),
      this.internals.updateOptions(e));
  }
};
TCe = Mwe([Awe(5, vV), Awe(6, xW), Awe(7, Pwe), Awe(8, OU)], TCe);
let ICe = class extends Dwe {
  constructor(e, t, n, i, r, o, s, a, l, c) {
    const { options: d, getTypeNavigationMode: u, disposable: h } = s.invokeFunction(PCe, o);
    (super(e, t, n, i, r, d),
      this.disposables.add(h),
      (this.internals = new jCe(this, o, u, o.overrideStyles, a, l, c)),
      this.disposables.add(this.internals));
  }
  updateOptions(e = {}) {
    (super.updateOptions(e),
      void 0 !== e.overrideStyles && this.internals.updateStyleOverrides(e.overrideStyles),
      this.internals.updateOptions(e));
  }
};
ICe = Mwe([Awe(6, vV), Awe(7, xW), Awe(8, Pwe), Awe(9, OU)], ICe);
let RCe = class extends kwe {
  get onDidOpen() {
    return this.internals.onDidOpen;
  }
  constructor(e, t, n, i, r, o, s, a, l, c) {
    const { options: d, getTypeNavigationMode: u, disposable: h } = s.invokeFunction(PCe, o);
    (super(e, t, n, i, r, d),
      this.disposables.add(h),
      (this.internals = new jCe(this, o, u, o.overrideStyles, a, l, c)),
      this.disposables.add(this.internals));
  }
  updateOptions(e = {}) {
    (super.updateOptions(e),
      e.overrideStyles && this.internals.updateStyleOverrides(e.overrideStyles),
      this.internals.updateOptions(e));
  }
};
RCe = Mwe([Awe(6, vV), Awe(7, xW), Awe(8, Pwe), Awe(9, OU)], RCe);
let OCe = class extends Lwe {
  constructor(e, t, n, i, r, o, s, a, l, c, d) {
    const { options: u, getTypeNavigationMode: h, disposable: g } = a.invokeFunction(PCe, s);
    (super(e, t, n, i, r, o, u),
      this.disposables.add(g),
      (this.internals = new jCe(this, s, h, s.overrideStyles, l, c, d)),
      this.disposables.add(this.internals));
  }
  updateOptions(e) {
    (super.updateOptions(e), this.internals.updateOptions(e));
  }
};
function MCe(e) {
  const t = e.getValue(oCe);
  if ("highlight" === t) return cxe.Highlight;
  if ("filter" === t) return cxe.Filter;
  const n = e.getValue(aCe);
  return "simple" === n || "highlight" === n ? cxe.Highlight : "filter" === n ? cxe.Filter : void 0;
}
function ACe(e) {
  const t = e.getValue(cCe);
  return "fuzzy" === t ? dxe.Fuzzy : "contiguous" === t ? dxe.Contiguous : void 0;
}
function PCe(e, t) {
  const n = e.get(OU),
    i = e.get(lde),
    r = e.get(xW),
    o = e.get(vV),
    s = void 0 !== t.horizontalScrolling ? t.horizontalScrolling : Boolean(n.getValue(rCe)),
    [a, l] = o.invokeFunction(yCe, t),
    c = t.paddingBottom,
    d = void 0 !== t.renderIndentGuides ? t.renderIndentGuides : n.getValue(uCe);
  return {
    getTypeNavigationMode: () => {
      const e = r.getContextKeyValue(Qwe);
      if ("automatic" === e) return Yae.Automatic;
      if ("trigger" === e) return Yae.Trigger;
      if (!1 === r.getContextKeyValue(Jwe)) return Yae.Trigger;
      const t = n.getValue(sCe);
      return "automatic" === t ? Yae.Automatic : "trigger" === t ? Yae.Trigger : void 0;
    },
    disposable: l,
    options: {
      keyboardSupport: !1,
      ...a,
      indent: "number" == typeof n.getValue(dCe) ? n.getValue(dCe) : void 0,
      renderIndentGuides: d,
      smoothScrolling: Boolean(n.getValue(hCe)),
      defaultFindMode: t.defaultFindMode ?? MCe(n),
      defaultFindMatchType: t.defaultFindMatchType ?? ACe(n),
      horizontalScrolling: s,
      scrollByPage: Boolean(n.getValue(lCe)),
      paddingBottom: c,
      hideTwistiesOfChildlessElements: t.hideTwistiesOfChildlessElements,
      expandOnlyOnTwistieClick: t.expandOnlyOnTwistieClick ?? "doubleClick" === n.getValue(fCe),
      contextViewProvider: i,
      findWidgetStyles: pue,
      enableStickyScroll: Boolean(n.getValue(mCe)),
      stickyScrollMaxItemCount: Number(n.getValue(_Ce)),
    },
  };
}
OCe = Mwe([Awe(7, vV), Awe(8, xW), Awe(9, Pwe), Awe(10, OU)], OCe);
let jCe = class {
  get onDidOpen() {
    return this.navigator.onDidOpen;
  }
  constructor(e, t, n, i, r, o, s) {
    ((this.tree = e),
      (this.disposables = []),
      (this.contextKeyService = eCe(r, e)),
      this.disposables.push(tCe(this.contextKeyService, e)),
      (this.listSupportsMultiSelect = Vwe.bindTo(this.contextKeyService)),
      this.listSupportsMultiSelect.set(!1 !== t.multipleSelectionSupport));
    ($we.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),
      (this.listSupportFindWidget = qwe.bindTo(this.contextKeyService)),
      this.listSupportFindWidget.set(t.findWidgetEnabled ?? !0),
      (this.hasSelectionOrFocus = Hwe.bindTo(this.contextKeyService)),
      (this.hasDoubleSelection = zwe.bindTo(this.contextKeyService)),
      (this.hasMultiSelection = Uwe.bindTo(this.contextKeyService)),
      (this.treeElementCanCollapse = Kwe.bindTo(this.contextKeyService)),
      (this.treeElementHasParent = Gwe.bindTo(this.contextKeyService)),
      (this.treeElementCanExpand = Zwe.bindTo(this.contextKeyService)),
      (this.treeElementHasChild = Ywe.bindTo(this.contextKeyService)),
      (this.treeFindOpen = Xwe.bindTo(this.contextKeyService)),
      (this.treeStickyScrollFocused = Bwe.bindTo(this.contextKeyService)),
      (this._useAltAsMultipleSelectionModifier = vCe(s)),
      this.updateStyleOverrides(i));
    const a = () => {
        const t = e.getFocus()[0];
        if (!t) return;
        const n = e.getNode(t);
        (this.treeElementCanCollapse.set(n.collapsible && !n.collapsed),
          this.treeElementHasParent.set(!!e.getParentElement(t)),
          this.treeElementCanExpand.set(n.collapsible && n.collapsed),
          this.treeElementHasChild.set(!!e.getFirstElementChild(t)));
      },
      l = new Set();
    (l.add(Qwe),
      l.add(Jwe),
      this.disposables.push(
        this.contextKeyService,
        o.register(e),
        e.onDidChangeSelection(() => {
          const t = e.getSelection(),
            n = e.getFocus();
          this.contextKeyService.bufferChangeEvents(() => {
            (this.hasSelectionOrFocus.set(t.length > 0 || n.length > 0),
              this.hasMultiSelection.set(t.length > 1),
              this.hasDoubleSelection.set(2 === t.length));
          });
        }),
        e.onDidChangeFocus(() => {
          const t = e.getSelection(),
            n = e.getFocus();
          (this.hasSelectionOrFocus.set(t.length > 0 || n.length > 0), a());
        }),
        e.onDidChangeCollapseState(a),
        e.onDidChangeModel(a),
        e.onDidChangeFindOpenState((e) => this.treeFindOpen.set(e)),
        e.onDidChangeStickyScrollFocused((e) => this.treeStickyScrollFocused.set(e)),
        s.onDidChangeConfiguration((i) => {
          let r = {};
          if (
            (i.affectsConfiguration(nCe) && (this._useAltAsMultipleSelectionModifier = vCe(s)),
            i.affectsConfiguration(dCe))
          ) {
            const e = s.getValue(dCe);
            r = { ...r, indent: e };
          }
          if (i.affectsConfiguration(uCe) && void 0 === t.renderIndentGuides) {
            const e = s.getValue(uCe);
            r = { ...r, renderIndentGuides: e };
          }
          if (i.affectsConfiguration(hCe)) {
            const e = Boolean(s.getValue(hCe));
            r = { ...r, smoothScrolling: e };
          }
          if (i.affectsConfiguration(oCe) || i.affectsConfiguration(aCe)) {
            const e = MCe(s);
            r = { ...r, defaultFindMode: e };
          }
          if (i.affectsConfiguration(sCe) || i.affectsConfiguration(aCe)) {
            const e = n();
            r = { ...r, typeNavigationMode: e };
          }
          if (i.affectsConfiguration(cCe)) {
            const e = ACe(s);
            r = { ...r, defaultFindMatchType: e };
          }
          if (i.affectsConfiguration(rCe) && void 0 === t.horizontalScrolling) {
            const e = Boolean(s.getValue(rCe));
            r = { ...r, horizontalScrolling: e };
          }
          if (i.affectsConfiguration(lCe)) {
            const e = Boolean(s.getValue(lCe));
            r = { ...r, scrollByPage: e };
          }
          if (
            (i.affectsConfiguration(fCe) &&
              void 0 === t.expandOnlyOnTwistieClick &&
              (r = { ...r, expandOnlyOnTwistieClick: "doubleClick" === s.getValue(fCe) }),
            i.affectsConfiguration(mCe))
          ) {
            const e = s.getValue(mCe);
            r = { ...r, enableStickyScroll: e };
          }
          if (i.affectsConfiguration(_Ce)) {
            const e = Math.max(1, s.getValue(_Ce));
            r = { ...r, stickyScrollMaxItemCount: e };
          }
          if (i.affectsConfiguration(gCe)) {
            const e = s.getValue(gCe);
            r = { ...r, mouseWheelScrollSensitivity: e };
          }
          if (i.affectsConfiguration(pCe)) {
            const e = s.getValue(pCe);
            r = { ...r, fastScrollSensitivity: e };
          }
          Object.keys(r).length > 0 && e.updateOptions(r);
        }),
        this.contextKeyService.onDidChangeContext((t) => {
          t.affectsSome(l) && e.updateOptions({ typeNavigationMode: n() });
        }),
      ),
      (this.navigator = new NCe(e, { configurationService: s, ...t })),
      this.disposables.push(this.navigator));
  }
  updateOptions(e) {
    void 0 !== e.multipleSelectionSupport &&
      this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport);
  }
  updateStyleOverrides(e) {
    this.tree.style(e ? _ue(e) : mue);
  }
  dispose() {
    this.disposables = IO(this.disposables);
  }
};
jCe = Mwe([Awe(4, xW), Awe(5, Pwe), Awe(6, OU)], jCe);
NW.as(YU).registerConfiguration({
  id: "workbench",
  order: 7,
  title: SI(1705, "Workbench"),
  type: "object",
  properties: {
    [nCe]: {
      type: "string",
      enum: ["ctrlCmd", "alt"],
      markdownEnumDescriptions: [
        SI(1706, "Maps to `Control` on Windows and Linux and to `Command` on macOS."),
        SI(1707, "Maps to `Alt` on Windows and Linux and to `Option` on macOS."),
      ],
      default: "ctrlCmd",
      description: SI(
        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.",
      ),
    },
    [iCe]: {
      type: "string",
      enum: ["singleClick", "doubleClick"],
      default: "singleClick",
      description: SI(
        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.",
      ),
    },
    [rCe]: {
      type: "boolean",
      default: !1,
      description: SI(
        1710,
        "Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.",
      ),
    },
    [lCe]: {
      type: "boolean",
      default: !1,
      description: SI(1711, "Controls whether clicks in the scrollbar scroll page by page."),
    },
    [dCe]: {
      type: "number",
      default: 8,
      minimum: 4,
      maximum: 40,
      description: SI(1712, "Controls tree indentation in pixels."),
    },
    [uCe]: {
      type: "string",
      enum: ["none", "onHover", "always"],
      default: "onHover",
      description: SI(1713, "Controls whether the tree should render indent guides."),
    },
    [hCe]: {
      type: "boolean",
      default: !1,
      description: SI(1714, "Controls whether lists and trees have smooth scrolling."),
    },
    [gCe]: {
      type: "number",
      default: 1,
      markdownDescription: SI(
        1715,
        "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.",
      ),
    },
    [pCe]: {
      type: "number",
      default: 5,
      markdownDescription: SI(1716, "Scrolling speed multiplier when pressing `Alt`."),
    },
    [oCe]: {
      type: "string",
      enum: ["highlight", "filter"],
      enumDescriptions: [
        SI(
          1717,
          "Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements.",
        ),
        SI(1718, "Filter elements when searching."),
      ],
      default: "highlight",
      description: SI(1719, "Controls the default find mode for lists and trees in the workbench."),
    },
    [aCe]: {
      type: "string",
      enum: ["simple", "highlight", "filter"],
      enumDescriptions: [
        SI(
          1720,
          "Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes.",
        ),
        SI(
          1721,
          "Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements.",
        ),
        SI(
          1722,
          "Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.",
        ),
      ],
      default: "highlight",
      description: SI(
        1723,
        "Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.",
      ),
      deprecated: !0,
      deprecationMessage: SI(
        1724,
        "Please use 'workbench.list.defaultFindMode' and\t'workbench.list.typeNavigationMode' instead.",
      ),
    },
    [cCe]: {
      type: "string",
      enum: ["fuzzy", "contiguous"],
      enumDescriptions: [
        SI(1725, "Use fuzzy matching when searching."),
        SI(1726, "Use contiguous matching when searching."),
      ],
      default: "fuzzy",
      description: SI(
        1727,
        "Controls the type of matching used when searching lists and trees in the workbench.",
      ),
    },
    [fCe]: {
      type: "string",
      enum: ["singleClick", "doubleClick"],
      default: "singleClick",
      description: SI(
        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.",
      ),
    },
    [mCe]: {
      type: "boolean",
      default: !0,
      description: SI(1729, "Controls whether sticky scrolling is enabled in trees."),
    },
    [_Ce]: {
      type: "number",
      minimum: 1,
      default: 7,
      markdownDescription: SI(
        1730,
        "Controls the number of sticky elements displayed in the tree when {0} is enabled.",
        "`#workbench.tree.enableStickyScroll#`",
      ),
    },
    [sCe]: {
      type: "string",
      enum: ["automatic", "trigger"],
      default: "automatic",
      markdownDescription: SI(
        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.",
      ),
    },
  },
});
class FCe {
  constructor(e, t, n, i) {
    ((this.isProviderFirst = e),
      (this.parent = t),
      (this.link = n),
      (this._rangeCallback = i),
      (this.id = ure.nextId()));
  }
  get uri() {
    return this.link.uri;
  }
  get range() {
    return this._range ?? this.link.targetSelectionRange ?? this.link.range;
  }
  set range(e) {
    ((this._range = e), this._rangeCallback(this));
  }
  get ariaMessage() {
    const e = this.parent.getPreview(this)?.preview(this.range);
    return e
      ? SI(
          1088,
          "{0} in {1} on line {2} at column {3}",
          e.value,
          dH(this.uri),
          this.range.startLineNumber,
          this.range.startColumn,
        )
      : SI(
          1087,
          "in {0} on line {1} at column {2}",
          dH(this.uri),
          this.range.startLineNumber,
          this.range.startColumn,
        );
  }
}
class BCe {
  constructor(e) {
    this._modelReference = e;
  }
  dispose() {
    this._modelReference.dispose();
  }
  preview(e, t = 8) {
    const n = this._modelReference.object.textEditorModel;
    if (!n) return;
    const { startLineNumber: i, startColumn: r, endLineNumber: o, endColumn: s } = e,
      a = n.getWordUntilPosition({ lineNumber: i, column: r - t }),
      l = new YH(i, a.startColumn, i, r),
      c = new YH(o, s, o, 1073741824),
      d = n.getValueInRange(l).replace(/^\s+/, ""),
      u = n.getValueInRange(e);
    return {
      value: d + u + n.getValueInRange(c).replace(/\s+$/, ""),
      highlight: { start: d.length, end: d.length + u.length },
    };
  }
}
class VCe {
  constructor(e, t) {
    ((this.parent = e), (this.uri = t), (this.children = []), (this._previews = new KW()));
  }
  dispose() {
    (IO(this._previews.values()), this._previews.clear());
  }
  getPreview(e) {
    return this._previews.get(e.uri);
  }
  get ariaMessage() {
    const e = this.children.length;
    return 1 === e
      ? SI(1089, "1 symbol in {0}, full path {1}", dH(this.uri), this.uri.fsPath)
      : SI(1090, "{0} symbols in {1}, full path {2}", e, dH(this.uri), this.uri.fsPath);
  }
  async resolve(e) {
    if (0 !== this._previews.size) return this;
    for (const n of this.children)
      if (!this._previews.has(n.uri))
        try {
          const t = await e.createModelReference(n.uri);
          this._previews.set(n.uri, new BCe(t));
        } catch (t) {
          HI(t);
        }
    return this;
  }
}
class WCe {
  constructor(e, t) {
    ((this.groups = []),
      (this.references = []),
      (this._onDidChangeReferenceRange = new QO()),
      (this.onDidChangeReferenceRange = this._onDidChangeReferenceRange.event),
      (this._links = e),
      (this._title = t));
    const [n] = e;
    let i;
    e.sort(WCe._compareReferences);
    for (const r of e)
      if (
        ((i && aH.isEqual(i.uri, r.uri, !0)) || ((i = new VCe(this, r.uri)), this.groups.push(i)),
        0 === i.children.length ||
          0 !== WCe._compareReferences(r, i.children[i.children.length - 1]))
      ) {
        const e = new FCe(n === r, i, r, (e) => this._onDidChangeReferenceRange.fire(e));
        (this.references.push(e), i.children.push(e));
      }
  }
  dispose() {
    (IO(this.groups), this._onDidChangeReferenceRange.dispose(), (this.groups.length = 0));
  }
  clone() {
    return new WCe(this._links, this._title);
  }
  get title() {
    return this._title;
  }
  get isEmpty() {
    return 0 === this.groups.length;
  }
  get ariaMessage() {
    return this.isEmpty
      ? SI(1091, "No results found")
      : 1 === this.references.length
        ? SI(1092, "Found 1 symbol in {0}", this.references[0].uri.fsPath)
        : 1 === this.groups.length
          ? SI(1093, "Found {0} symbols in {1}", this.references.length, this.groups[0].uri.fsPath)
          : SI(1094, "Found {0} symbols in {1} files", this.references.length, this.groups.length);
  }
  nextOrPreviousReference(e, t) {
    const { parent: n } = e;
    let i = n.children.indexOf(e);
    const r = n.children.length,
      o = n.parent.groups.length;
    return 1 === o || (t && i + 1 < r) || (!t && i > 0)
      ? ((i = t ? (i + 1) % r : (i + r - 1) % r), n.children[i])
      : ((i = n.parent.groups.indexOf(n)),
        t
          ? ((i = (i + 1) % o), n.parent.groups[i].children[0])
          : ((i = (i + o - 1) % o),
            n.parent.groups[i].children[n.parent.groups[i].children.length - 1]));
  }
  nearestReference(e, t) {
    const n = this.references
      .map((n, i) => ({
        idx: i,
        prefixLen: cA(n.uri.toString(), e.toString()),
        offsetDist:
          100 * Math.abs(n.range.startLineNumber - t.lineNumber) +
          Math.abs(n.range.startColumn - t.column),
      }))
      .sort((e, t) =>
        e.prefixLen > t.prefixLen
          ? -1
          : e.prefixLen < t.prefixLen
            ? 1
            : e.offsetDist < t.offsetDist
              ? -1
              : e.offsetDist > t.offsetDist
                ? 1
                : 0,
      )[0];
    if (n) return this.references[n.idx];
  }
  referenceAt(e, t) {
    for (const n of this.references)
      if (n.uri.toString() === e.toString() && YH.containsPosition(n.range, t)) return n;
  }
  firstReference() {
    for (const e of this.references) if (e.isProviderFirst) return e;
    return this.references[0];
  }
  static _compareReferences(e, t) {
    return aH.compare(e.uri, t.uri) || YH.compareRangesUsingStarts(e.range, t.range);
  }
}
class HCe extends PO {
  constructor(e, t, n) {
    (super(),
      (this.options = t),
      (this.styles = n),
      (this.count = 0),
      (this.hover = this._register(new jO())),
      (this.element = MB(e, VB(".monaco-count-badge"))),
      this._register(MO(() => e.removeChild(this.element))),
      (this.countFormat = this.options.countFormat || "{0}"),
      (this.titleFormat = this.options.titleFormat || ""),
      this.setCount(this.options.count || 0),
      this.updateHover());
  }
  setCount(e) {
    ((this.count = e), this.render());
  }
  setTitleFormat(e) {
    ((this.titleFormat = e), this.updateHover(), this.render());
  }
  updateHover() {
    "" === this.titleFormat || this.hover.value
      ? "" === this.titleFormat && this.hover.value && (this.hover.value = void 0)
      : (this.hover.value = yae().setupDelayedHoverAtMouse(this.element, () => ({
          content: WM(this.titleFormat, this.count),
          appearance: { compact: !0 },
        })));
  }
  render() {
    ((this.element.textContent = WM(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}`));
  }
}
class zCe extends PO {
  constructor(e, t) {
    (super(),
      (this.options = t),
      (this.text = ""),
      (this.title = ""),
      (this.highlights = []),
      (this.didEverRender = !1),
      (this.domNode = MB(e, VB("span.monaco-highlighted-label"))));
  }
  get element() {
    return this.domNode;
  }
  set(e, t = [], n = "", i, r) {
    (e || (e = ""),
      i && (e = zCe.escapeNewLines(e, t)),
      (this.didEverRender && this.text === e && this.title === n && zz(this.highlights, t)) ||
        ((this.text = e), (this.title = n), (this.highlights = t), this.render(r)));
  }
  render(e) {
    const t = [];
    let n = 0;
    for (const i of this.highlights) {
      if (i.end === i.start) continue;
      if (n < i.start) {
        const r = this.text.substring(n, i.start);
        (e ? t.push(...Wse(r)) : t.push(r), (n = i.start));
      }
      const r = this.text.substring(n, i.end),
        o = VB("span.highlight", void 0, ...(e ? Wse(r) : [r]));
      (i.extraClasses && o.classList.add(...i.extraClasses), t.push(o), (n = i.end));
    }
    if (n < this.text.length) {
      const i = this.text.substring(n);
      e ? t.push(...Wse(i)) : t.push(i);
    }
    if ((PB(this.domNode, ...t), this.customHover || "" === this.title))
      this.customHover && this.customHover.update(this.title);
    else {
      const e = this.options?.hoverDelegate ?? Bne("mouse");
      this.customHover = this._register(yae().setupManagedHover(e, this.domNode, this.title));
    }
    this.didEverRender = !0;
  }
  static escapeNewLines(e, t) {
    let n = 0,
      i = 0;
    return e.replace(/\r\n|\r|\n/g, (e, r) => {
      ((i = "\r\n" === e ? -1 : 0), (r += n));
      for (const n of t) n.end <= r || (n.start >= r && (n.start += i), n.end >= r && (n.end += i));
      return ((n += i), "⏎");
    });
  }
}
class UCe {
  constructor(e) {
    this._element = e;
  }
  get element() {
    return this._element;
  }
  set textContent(e) {
    this.disposed ||
      e === this._textContent ||
      ((this._textContent = e), (this._element.textContent = e));
  }
  set classNames(e) {
    this.disposed ||
      zz(e, this._classNames) ||
      ((this._classNames = e),
      (this._element.classList.value = ""),
      this._element.classList.add(...e));
  }
  set empty(e) {
    this.disposed ||
      e === this._empty ||
      ((this._empty = e), (this._element.style.marginLeft = e ? "0" : ""));
  }
  dispose() {
    this.disposed = !0;
  }
}
class $Ce extends PO {
  constructor(e, t) {
    (super(),
      (this.customHovers = new Map()),
      (this.creationOptions = t),
      (this.domNode = this._register(new UCe(MB(e, VB(".monaco-icon-label"))))),
      (this.labelContainer = MB(this.domNode.element, VB(".monaco-icon-label-container"))),
      (this.nameContainer = MB(this.labelContainer, VB("span.monaco-icon-name-container"))),
      (this.nameNode =
        t?.supportHighlights || t?.supportIcons
          ? this._register(new KCe(this.nameContainer, !!t.supportIcons))
          : new qCe(this.nameContainer)),
      (this.hoverDelegate = t?.hoverDelegate ?? Bne("mouse")));
  }
  get element() {
    return this.domNode.element;
  }
  setLabel(e, t, n) {
    const i = ["monaco-icon-label"],
      r = ["monaco-icon-label-container"];
    let o = "";
    n &&
      (n.extraClasses && i.push(...n.extraClasses),
      n.bold && i.push("bold"),
      n.italic && i.push("italic"),
      n.strikethrough && i.push("strikethrough"),
      n.disabledCommand && r.push("disabled"),
      n.title && ("string" == typeof n.title ? (o += n.title) : (o += e)));
    const s = this.domNode.element.querySelector(".monaco-icon-label-iconpath");
    if (n?.iconPath) {
      let e;
      if (
        (s && SB(s)
          ? (e = s)
          : ((e = VB(".monaco-icon-label-iconpath")), this.domNode.element.prepend(e)),
        AV.isThemeIcon(n.iconPath))
      ) {
        const t = AV.asClassName(n.iconPath);
        ((e.className = `monaco-icon-label-iconpath ${t}`), (e.style.backgroundImage = ""));
      } else e.style.backgroundImage = Une(n?.iconPath);
      ((e.style.backgroundRepeat = "no-repeat"),
        (e.style.backgroundPosition = "center"),
        (e.style.backgroundSize = "contain"));
    } else s && s.remove();
    if (
      ((this.domNode.classNames = i),
      this.domNode.element.setAttribute("aria-label", o),
      (this.labelContainer.classList.value = ""),
      this.labelContainer.classList.add(...r),
      this.setupHover(n?.descriptionTitle ? this.labelContainer : this.element, n?.title),
      this.nameNode.setLabel(e, n),
      t || this.descriptionNode)
    ) {
      const e = this.getOrCreateDescriptionNode();
      if (e instanceof zCe) {
        const i = n?.supportIcons ?? this.creationOptions?.supportIcons;
        (e.set(t || "", n ? n.descriptionMatches : void 0, void 0, n?.labelEscapeNewLines, i),
          this.setupHover(e.element, n?.descriptionTitle));
      } else
        ((e.textContent = t && n?.labelEscapeNewLines ? zCe.escapeNewLines(t, []) : t || ""),
          this.setupHover(e.element, n?.descriptionTitle || ""),
          (e.empty = !t));
    }
    if (n?.suffix || this.suffixNode) {
      this.getOrCreateSuffixNode().textContent = n?.suffix ?? "";
    }
  }
  setupHover(e, t) {
    const n = this.customHovers.get(e);
    if ((n && (n.dispose(), this.customHovers.delete(e)), !t))
      return void e.removeAttribute("title");
    let i = e;
    if (this.creationOptions?.hoverTargetOverride) {
      if (!gB(e, this.creationOptions.hoverTargetOverride))
        throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");
      i = this.creationOptions.hoverTargetOverride;
    }
    const r = yae().setupManagedHover(this.hoverDelegate, i, t);
    r && this.customHovers.set(e, r);
  }
  dispose() {
    super.dispose();
    for (const e of this.customHovers.values()) e.dispose();
    this.customHovers.clear();
  }
  getOrCreateSuffixNode() {
    if (!this.suffixNode) {
      const n = this._register(
        new UCe(
          ((e = this.nameContainer), (t = VB("span.monaco-icon-suffix-container")), e.after(t), t),
        ),
      );
      this.suffixNode = this._register(new UCe(MB(n.element, VB("span.label-suffix"))));
    }
    var e, t;
    return this.suffixNode;
  }
  getOrCreateDescriptionNode() {
    if (!this.descriptionNode) {
      const e = this._register(
        new UCe(MB(this.labelContainer, VB("span.monaco-icon-description-container"))),
      );
      this.creationOptions?.supportDescriptionHighlights
        ? (this.descriptionNode = this._register(
            new zCe(MB(e.element, VB("span.label-description"))),
          ))
        : (this.descriptionNode = this._register(
            new UCe(MB(e.element, VB("span.label-description"))),
          ));
    }
    return this.descriptionNode;
  }
}
let qCe = class {
  constructor(e) {
    ((this.container = e), (this.label = void 0), (this.singleLabel = void 0));
  }
  setLabel(e, t) {
    if (this.label !== e || !zz(this.options, t))
      if (((this.label = e), (this.options = t), "string" == typeof e))
        (this.singleLabel ||
          ((this.container.textContent = ""),
          this.container.classList.remove("multiple"),
          (this.singleLabel = MB(this.container, VB("a.label-name", { id: t?.domId })))),
          (this.singleLabel.textContent = e));
      else {
        ((this.container.textContent = ""),
          this.container.classList.add("multiple"),
          (this.singleLabel = void 0));
        for (let n = 0; n < e.length; n++) {
          const i = e[n],
            r = t?.domId && `${t?.domId}_${n}`;
          (MB(
            this.container,
            VB(
              "a.label-name",
              {
                id: r,
                "data-icon-label-count": e.length,
                "data-icon-label-index": n,
                role: "treeitem",
              },
              i,
            ),
          ),
            n < e.length - 1 &&
              MB(this.container, VB("span.label-separator", void 0, t?.separator || "/")));
        }
      }
  }
};
class KCe extends PO {
  constructor(e, t) {
    (super(),
      (this.container = e),
      (this.supportIcons = t),
      (this.label = void 0),
      (this.singleLabel = void 0));
  }
  setLabel(e, t) {
    if (this.label === e && zz(this.options, t)) return;
    ((this.label = e), (this.options = t));
    const n = t?.supportIcons ?? this.supportIcons;
    if ("string" == typeof e)
      (this.singleLabel ||
        ((this.container.textContent = ""),
        this.container.classList.remove("multiple"),
        (this.singleLabel = this._register(
          new zCe(MB(this.container, VB("a.label-name", { id: t?.domId }))),
        ))),
        this.singleLabel.set(e, t?.matches, void 0, t?.labelEscapeNewLines, n));
    else {
      ((this.container.textContent = ""),
        this.container.classList.add("multiple"),
        (this.singleLabel = void 0));
      const i = t?.separator || "/",
        r = (function (e, t, n) {
          if (!n) return;
          let i = 0;
          return e.map((e) => {
            const r = { start: i, end: i + e.length },
              o = n
                .map((e) => Eae.intersect(r, e))
                .filter((e) => !Eae.isEmpty(e))
                .map(({ start: e, end: t }) => ({ start: e - i, end: t - i }));
            return ((i = r.end + t.length), o);
          });
        })(e, i, t?.matches);
      for (let o = 0; o < e.length; o++) {
        const s = e[o],
          a = r ? r[o] : void 0,
          l = VB("a.label-name", {
            id: t?.domId && `${t?.domId}_${o}`,
            "data-icon-label-count": e.length,
            "data-icon-label-index": o,
            role: "treeitem",
          });
        (this._register(new zCe(MB(this.container, l))).set(
          s,
          a,
          void 0,
          t?.labelEscapeNewLines,
          n,
        ),
          o < e.length - 1 && MB(l, VB("span.label-separator", void 0, i)));
      }
    }
  }
}
const GCe = bV("labelService");
var ZCe,
  YCe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  XCe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let QCe = class {
  constructor(e) {
    this._resolverService = e;
  }
  hasChildren(e) {
    return e instanceof WCe || e instanceof VCe;
  }
  getChildren(e) {
    if (e instanceof WCe) return e.groups;
    if (e instanceof VCe) return e.resolve(this._resolverService).then((e) => e.children);
    throw new Error("bad tree");
  }
};
QCe = YCe([XCe(0, CV)], QCe);
class JCe {
  getHeight() {
    return 23;
  }
  getTemplateId(e) {
    return e instanceof VCe ? iSe.id : oSe.id;
  }
}
let eSe = class {
  constructor(e) {
    this._keybindingService = e;
  }
  getKeyboardNavigationLabel(e) {
    if (e instanceof FCe) {
      const t = e.parent.getPreview(e)?.preview(e.range);
      if (t) return t.value;
    }
    return dH(e.uri);
  }
};
eSe = YCe([XCe(0, N5)], eSe);
class tSe {
  getId(e) {
    return e instanceof FCe ? e.id : e.uri;
  }
}
let nSe = class extends PO {
  constructor(e, t) {
    (super(), (this._labelService = t));
    const n = document.createElement("div");
    (n.classList.add("reference-file"),
      (this.file = this._register(new $Ce(n, { supportHighlights: !0 }))),
      (this.badge = this._register(new HCe(MB(n, VB(".count")), {}, fue))),
      e.appendChild(n));
  }
  set(e, t) {
    const n = hH(e.uri);
    this.file.setLabel(
      this._labelService.getUriBasenameLabel(e.uri),
      this._labelService.getUriLabel(n, { relative: !0 }),
      { title: this._labelService.getUriLabel(e.uri), matches: t },
    );
    const i = e.children.length;
    (this.badge.setCount(i),
      i > 1
        ? this.badge.setTitleFormat(SI(1081, "{0} references", i))
        : this.badge.setTitleFormat(SI(1082, "{0} reference", i)));
  }
};
nSe = YCe([XCe(1, GCe)], nSe);
let iSe = class {
  static {
    ZCe = this;
  }
  static {
    this.id = "FileReferencesRenderer";
  }
  constructor(e) {
    ((this._instantiationService = e), (this.templateId = ZCe.id));
  }
  renderTemplate(e) {
    return this._instantiationService.createInstance(nSe, e);
  }
  renderElement(e, t, n) {
    n.set(e.element, Iie(e.filterData));
  }
  disposeTemplate(e) {
    e.dispose();
  }
};
iSe = ZCe = YCe([XCe(0, vV)], iSe);
class rSe extends PO {
  constructor(e) {
    (super(), (this.label = this._register(new zCe(e))));
  }
  set(e, t) {
    const n = e.parent.getPreview(e)?.preview(e.range);
    if (n && n.value) {
      const { value: e, highlight: i } = n;
      t && !zie.isDefault(t)
        ? (this.label.element.classList.toggle("referenceMatch", !1), this.label.set(e, Iie(t)))
        : (this.label.element.classList.toggle("referenceMatch", !0), this.label.set(e, [i]));
    } else this.label.set(`${dH(e.uri)}:${e.range.startLineNumber + 1}:${e.range.startColumn + 1}`);
  }
}
class oSe {
  constructor() {
    this.templateId = oSe.id;
  }
  static {
    this.id = "OneReferenceRenderer";
  }
  renderTemplate(e) {
    return new rSe(e);
  }
  renderElement(e, t, n) {
    n.set(e.element, e.filterData);
  }
  disposeTemplate(e) {
    e.dispose();
  }
}
class sSe {
  getWidgetAriaLabel() {
    return SI(1083, "References");
  }
  getAriaLabel(e) {
    return e.ariaMessage;
  }
}
var aSe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  lSe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class cSe {
  static {
    this.DecorationOptions = cee.register({
      description: "reference-decoration",
      stickiness: 1,
      className: "reference-decoration",
    });
  }
  constructor(e, t) {
    ((this._editor = e),
      (this._model = t),
      (this._decorations = new Map()),
      (this._decorationIgnoreSet = new Set()),
      (this._callOnDispose = new AO()),
      (this._callOnModelChange = new AO()),
      this._callOnDispose.add(this._editor.onDidChangeModel(() => this._onModelChanged())),
      this._onModelChanged());
  }
  dispose() {
    (this._callOnModelChange.dispose(), this._callOnDispose.dispose(), this.removeDecorations());
  }
  _onModelChanged() {
    this._callOnModelChange.clear();
    const e = this._editor.getModel();
    if (e)
      for (const t of this._model.references)
        if (t.uri.toString() === e.uri.toString()) return void this._addDecorations(t.parent);
  }
  _addDecorations(e) {
    if (!this._editor.hasModel()) return;
    this._callOnModelChange.add(
      this._editor.getModel().onDidChangeDecorations(() => this._onDecorationChanged()),
    );
    const t = [],
      n = [];
    for (let i = 0, r = e.children.length; i < r; i++) {
      const r = e.children[i];
      this._decorationIgnoreSet.has(r.id) ||
        (r.uri.toString() === this._editor.getModel().uri.toString() &&
          (t.push({ range: r.range, options: cSe.DecorationOptions }), n.push(i)));
    }
    this._editor.changeDecorations((i) => {
      const r = i.deltaDecorations([], t);
      for (let t = 0; t < r.length; t++) this._decorations.set(r[t], e.children[n[t]]);
    });
  }
  _onDecorationChanged() {
    const e = [],
      t = this._editor.getModel();
    if (t) {
      for (const [n, i] of this._decorations) {
        const r = t.getDecorationRange(n);
        if (!r) continue;
        let o = !1;
        if (!YH.equalsRange(r, i.range)) {
          if (YH.spansMultipleLines(r)) o = !0;
          else {
            i.range.endColumn - i.range.startColumn !== r.endColumn - r.startColumn && (o = !0);
          }
          o ? (this._decorationIgnoreSet.add(i.id), e.push(n)) : (i.range = r);
        }
      }
      for (let t = 0, n = e.length; t < n; t++) this._decorations.delete(e[t]);
      this._editor.removeDecorations(e);
    }
  }
  removeDecorations() {
    (this._editor.removeDecorations([...this._decorations.keys()]), this._decorations.clear());
  }
}
class dSe {
  constructor() {
    ((this.ratio = 0.7), (this.heightInLines = 18));
  }
  static fromJSON(e) {
    let t, n;
    try {
      const i = JSON.parse(e);
      ((t = i.ratio), (n = i.heightInLines));
    } catch {}
    return { ratio: t || 0.7, heightInLines: n || 18 };
  }
}
class uSe extends RCe {}
let hSe = class {
  constructor(e) {
    ((this.labelService = e), (this.disposables = new AO()));
  }
  getDragURI(e) {
    return e instanceof VCe
      ? e.uri.toString()
      : e instanceof FCe
        ? ((t = e.uri),
          (n = e.range),
          t.with({
            fragment: `${n.startLineNumber},${n.startColumn}${n.endLineNumber ? `-${n.endLineNumber}${n.endColumn ? `,${n.endColumn}` : ""}` : ""}`,
          })).toString()
        : null;
    var t, n;
  }
  getDragLabel(e) {
    if (0 === e.length) return;
    const t = e.map((e) => this.labelService.getUriBasenameLabel(e.uri));
    return t.join(", ");
  }
  onDragStart(e, t) {
    if (!t.dataTransfer) return;
    const n = e.elements.map((e) => this.getDragURI(e)).filter(Boolean);
    n.length &&
      (t.dataTransfer.setData(Ane.RESOURCES, JSON.stringify(n)),
      t.dataTransfer.setData(Ane.TEXT, n.join("\n")));
  }
  onDragOver() {
    return !1;
  }
  drop() {}
  dispose() {
    this.disposables.dispose();
  }
};
hSe = aSe([lSe(0, GCe)], hSe);
let gSe = class extends Vye {
  constructor(e, t, n, i, r, o, s, a, l) {
    (super(
      e,
      { showFrame: !1, showArrow: !0, isResizeable: !0, isAccessible: !0, supportOnTitleClick: !0 },
      o,
    ),
      (this._defaultTreeKeyboardSupport = t),
      (this.layoutData = n),
      (this._textModelResolverService = r),
      (this._instantiationService = o),
      (this._peekViewService = s),
      (this._uriLabel = a),
      (this._keybindingService = l),
      (this._disposeOnNewModel = new AO()),
      (this._callOnDispose = new AO()),
      (this._onDidSelectReference = new QO()),
      (this.onDidSelectReference = this._onDidSelectReference.event),
      (this._dim = new oB(0, 0)),
      (this._isClosing = !1),
      this._applyTheme(i.getColorTheme()),
      this._callOnDispose.add(i.onDidColorThemeChange(this._applyTheme.bind(this))),
      this._peekViewService.addExclusiveWidget(e, this),
      this.create());
  }
  get isClosing() {
    return this._isClosing;
  }
  dispose() {
    ((this._isClosing = !0),
      this.setModel(void 0),
      this._callOnDispose.dispose(),
      this._disposeOnNewModel.dispose(),
      IO(this._preview),
      IO(this._previewNotAvailableMessage),
      IO(this._tree),
      IO(this._previewModelReference),
      this._splitView.dispose(),
      super.dispose());
  }
  _applyTheme(e) {
    const t = e.getColor(Uye) || vG.transparent;
    this.style({
      arrowColor: t,
      frameColor: t,
      headerBackgroundColor: e.getColor(Wye) || vG.transparent,
      primaryHeadingColor: e.getColor(Hye),
      secondaryHeadingColor: e.getColor(zye),
    });
  }
  show(e) {
    super.show(e, this.layoutData.heightInLines || 18);
  }
  focusOnReferenceTree() {
    this._tree.domFocus();
  }
  focusOnPreviewEditor() {
    this._preview.focus();
  }
  isPreviewEditorFocused() {
    return this._preview.hasTextFocus();
  }
  _onTitleClick(e) {
    this._preview &&
      this._preview.getModel() &&
      this._onDidSelectReference.fire({
        element: this._getFocusedReference(),
        kind: e.ctrlKey || e.metaKey || e.altKey ? "side" : "open",
        source: "title",
      });
  }
  _fillBody(e) {
    (this.setCssClass("reference-zone-widget"),
      (this._messageContainer = MB(e, VB("div.messages"))),
      HB(this._messageContainer),
      (this._splitView = new nxe(e, { orientation: 1 })),
      (this._previewContainer = MB(e, VB("div.preview.inline"))));
    ((this._preview = this._instantiationService.createInstance(
      Eye,
      this._previewContainer,
      {
        scrollBeyondLastLine: !1,
        scrollbar: {
          verticalScrollbarSize: 14,
          horizontal: "auto",
          useShadows: !0,
          verticalHasArrows: !1,
          horizontalHasArrows: !1,
          alwaysConsumeMouseWheel: !0,
        },
        overviewRulerLanes: 2,
        fixedOverflowWidgets: !0,
        minimap: { enabled: !1 },
      },
      {},
      this.editor,
    )),
      HB(this._previewContainer),
      (this._previewNotAvailableMessage = this._instantiationService.createInstance(
        Q7,
        SI(1084, "no preview available"),
        a$,
        Q7.DEFAULT_CREATION_OPTIONS,
        null,
      )),
      (this._treeContainer = MB(e, VB("div.ref-tree.inline"))));
    const t = {
      keyboardSupport: this._defaultTreeKeyboardSupport,
      accessibilityProvider: new sSe(),
      keyboardNavigationLabelProvider: this._instantiationService.createInstance(eSe),
      identityProvider: new tSe(),
      openOnSingleClick: !0,
      selectionNavigation: !0,
      overrideStyles: { listBackground: $ye },
      dnd: this._instantiationService.createInstance(hSe),
    };
    (this._defaultTreeKeyboardSupport &&
      this._callOnDispose.add(
        KF(
          this._treeContainer,
          "keydown",
          (e) => {
            e.equals(9) &&
              (this._keybindingService.dispatchEvent(e, e.target), e.stopPropagation());
          },
          !0,
        ),
      ),
      (this._tree = this._instantiationService.createInstance(
        uSe,
        "ReferencesWidget",
        this._treeContainer,
        new JCe(),
        [
          this._instantiationService.createInstance(iSe),
          this._instantiationService.createInstance(oSe),
        ],
        this._instantiationService.createInstance(QCe),
        t,
      )),
      this._splitView.addView(
        {
          onDidChange: $O.None,
          element: this._previewContainer,
          minimumSize: 200,
          maximumSize: Number.MAX_VALUE,
          layout: (e) => {
            this._preview.layout({ height: this._dim.height, width: e });
          },
        },
        txe.Distribute,
      ),
      this._splitView.addView(
        {
          onDidChange: $O.None,
          element: this._treeContainer,
          minimumSize: 100,
          maximumSize: Number.MAX_VALUE,
          layout: (e) => {
            ((this._treeContainer.style.height = `${this._dim.height}px`),
              (this._treeContainer.style.width = `${e}px`),
              this._tree.layout(this._dim.height, e));
          },
        },
        txe.Distribute,
      ),
      this._disposables.add(
        this._splitView.onDidSashChange(
          () => {
            this._dim.width &&
              (this.layoutData.ratio = this._splitView.getViewSize(0) / this._dim.width);
          },
          void 0,
        ),
      ));
    const n = (e, t) => {
      e instanceof FCe &&
        ("show" === t && this._revealReference(e, !1),
        this._onDidSelectReference.fire({ element: e, kind: t, source: "tree" }));
    };
    (this._disposables.add(
      this._tree.onDidOpen((e) => {
        e.sideBySide
          ? n(e.element, "side")
          : e.editorOptions.pinned
            ? n(e.element, "goto")
            : n(e.element, "show");
      }),
    ),
      HB(this._treeContainer));
  }
  _onWidth(e) {
    this._dim && this._doLayoutBody(this._dim.height, e);
  }
  _doLayoutBody(e, t) {
    (super._doLayoutBody(e, t),
      (this._dim = new oB(t, e)),
      (this.layoutData.heightInLines = this._viewZone
        ? this._viewZone.heightInLines
        : this.layoutData.heightInLines),
      this._splitView.layout(t),
      this._splitView.resizeView(0, t * this.layoutData.ratio));
  }
  setSelection(e) {
    return this._revealReference(e, !0).then(() => {
      this._model && (this._tree.setSelection([e]), this._tree.setFocus([e]));
    });
  }
  setModel(e) {
    return (
      this._disposeOnNewModel.clear(),
      (this._model = e),
      this._model ? this._onNewModel() : Promise.resolve()
    );
  }
  _onNewModel() {
    return this._model
      ? this._model.isEmpty
        ? (this.setTitle(""),
          (this._messageContainer.innerText = SI(1085, "No results")),
          WB(this._messageContainer),
          Promise.resolve(void 0))
        : (HB(this._messageContainer),
          (this._decorationsManager = new cSe(this._preview, this._model)),
          this._disposeOnNewModel.add(this._decorationsManager),
          this._disposeOnNewModel.add(
            this._model.onDidChangeReferenceRange((e) => this._tree.rerender(e)),
          ),
          this._disposeOnNewModel.add(
            this._preview.onMouseDown((e) => {
              const { event: t, target: n } = e;
              if (2 !== t.detail) return;
              const i = this._getFocusedReference();
              i &&
                this._onDidSelectReference.fire({
                  element: { uri: i.uri, range: n.range },
                  kind: t.ctrlKey || t.metaKey || t.altKey ? "side" : "open",
                  source: "editor",
                });
            }),
          ),
          this.container.classList.add("results-loaded"),
          WB(this._treeContainer),
          WB(this._previewContainer),
          this._splitView.layout(this._dim.width),
          this.focusOnReferenceTree(),
          this._tree.setInput(
            1 === this._model.groups.length ? this._model.groups[0] : this._model,
          ))
      : Promise.resolve(void 0);
  }
  _getFocusedReference() {
    const [e] = this._tree.getFocus();
    return e instanceof FCe
      ? e
      : e instanceof VCe && e.children.length > 0
        ? e.children[0]
        : void 0;
  }
  async revealReference(e) {
    (await this._revealReference(e, !1),
      this._onDidSelectReference.fire({ element: e, kind: "goto", source: "tree" }));
  }
  async _revealReference(e, t) {
    if (this._revealedReference === e) return;
    ((this._revealedReference = e),
      e.uri.scheme !== NP.inMemory
        ? this.setTitle(cH(e.uri), this._uriLabel.getUriLabel(hH(e.uri)))
        : this.setTitle(SI(1086, "References")));
    const n = this._textModelResolverService.createModelReference(e.uri);
    (this._tree.getInput() === e.parent ||
      (t && this._tree.reveal(e.parent), await this._tree.expand(e.parent)),
      this._tree.reveal(e));
    const i = await n;
    if (!this._model) return void i.dispose();
    IO(this._previewModelReference);
    const r = i.object;
    if (r) {
      const t = this._preview.getModel() === r.textEditorModel ? 0 : 1,
        n = YH.lift(e.range).collapseToStart();
      ((this._previewModelReference = i),
        this._preview.setModel(r.textEditorModel),
        this._preview.setSelection(n),
        this._preview.revealRangeInCenter(n, t));
    } else (this._preview.setModel(this._previewNotAvailableMessage), i.dispose());
  }
};
gSe = aSe([lSe(3, h0), lSe(4, CV), lSe(5, vV), lSe(6, Pye), lSe(7, GCe), lSe(8, N5)], gSe);
var pSe,
  fSe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const mSe = new yW(
  "referenceSearchVisible",
  !1,
  SI(1078, "Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"),
);
let _Se = class {
  static {
    pSe = this;
  }
  static {
    this.ID = "editor.contrib.referencesController";
  }
  static get(e) {
    return e.getContribution(pSe.ID);
  }
  constructor(e, t, n, i, r, o, s, a) {
    ((this._defaultTreeKeyboardSupport = e),
      (this._editor = t),
      (this._editorService = i),
      (this._notificationService = r),
      (this._instantiationService = o),
      (this._storageService = s),
      (this._configurationService = a),
      (this._disposables = new AO()),
      (this._requestIdPool = 0),
      (this._ignoreModelChangeEvent = !1),
      (this._referenceSearchVisible = mSe.bindTo(n)));
  }
  dispose() {
    (this._referenceSearchVisible.reset(),
      this._disposables.dispose(),
      this._widget?.dispose(),
      this._model?.dispose(),
      (this._widget = void 0),
      (this._model = void 0));
  }
  toggleWidget(e, t, n) {
    let i;
    if (
      (this._widget && (i = this._widget.position), this.closeWidget(), i && e.containsPosition(i))
    )
      return;
    ((this._peekMode = n),
      this._referenceSearchVisible.set(!0),
      this._disposables.add(
        this._editor.onDidChangeModelLanguage(() => {
          this.closeWidget();
        }),
      ),
      this._disposables.add(
        this._editor.onDidChangeModel(() => {
          this._ignoreModelChangeEvent || this.closeWidget();
        }),
      ));
    const r = "peekViewLayout",
      o = dSe.fromJSON(this._storageService.get(r, 0, "{}"));
    ((this._widget = this._instantiationService.createInstance(
      gSe,
      this._editor,
      this._defaultTreeKeyboardSupport,
      o,
    )),
      this._widget.setTitle(SI(1079, "Loading...")),
      this._widget.show(e),
      this._disposables.add(
        this._widget.onDidClose(() => {
          (t.cancel(),
            this._widget
              ? (this._storageService.store(r, JSON.stringify(this._widget.layoutData), 0, 1),
                this._widget.isClosing || this.closeWidget(),
                (this._widget = void 0))
              : this.closeWidget());
        }),
      ),
      this._disposables.add(
        this._widget.onDidSelectReference((e) => {
          const { element: t, kind: i } = e;
          if (t)
            switch (i) {
              case "open":
                ("editor" === e.source &&
                  this._configurationService.getValue("editor.stablePeek")) ||
                  this.openReference(t, !1, !1);
                break;
              case "side":
                this.openReference(t, !0, !1);
                break;
              case "goto":
                n ? this._gotoReference(t, !0) : this.openReference(t, !1, !0);
            }
        }),
      ));
    const s = ++this._requestIdPool;
    t.then(
      (t) => {
        if (s === this._requestIdPool && this._widget)
          return (
            this._model?.dispose(),
            (this._model = t),
            this._widget.setModel(this._model).then(() => {
              if (this._widget && this._model && this._editor.hasModel()) {
                this._model.isEmpty
                  ? this._widget.setMetaTitle("")
                  : this._widget.setMetaTitle(
                      SI(1080, "{0} ({1})", this._model.title, this._model.references.length),
                    );
                const t = this._editor.getModel().uri,
                  n = new xV(e.startLineNumber, e.startColumn),
                  i = this._model.nearestReference(t, n);
                if (i)
                  return this._widget.setSelection(i).then(() => {
                    this._widget &&
                      "editor" === this._editor.getOption(99) &&
                      this._widget.focusOnPreviewEditor();
                  });
              }
            })
          );
        t.dispose();
      },
      (e) => {
        this._notificationService.error(e);
      },
    );
  }
  changeFocusBetweenPreviewAndReferences() {
    this._widget &&
      (this._widget.isPreviewEditorFocused()
        ? this._widget.focusOnReferenceTree()
        : this._widget.focusOnPreviewEditor());
  }
  async goToNextOrPreviousReference(e) {
    if (!this._editor.hasModel() || !this._model || !this._widget) return;
    const t = this._widget.position;
    if (!t) return;
    const n = this._model.nearestReference(this._editor.getModel().uri, t);
    if (!n) return;
    const i = this._model.nextOrPreviousReference(n, e),
      r = this._editor.hasTextFocus(),
      o = this._widget.isPreviewEditorFocused();
    (await this._widget.setSelection(i),
      await this._gotoReference(i, !1),
      r ? this._editor.focus() : this._widget && o && this._widget.focusOnPreviewEditor());
  }
  async revealReference(e) {
    this._editor.hasModel() &&
      this._model &&
      this._widget &&
      (await this._widget.revealReference(e));
  }
  closeWidget(e = !0) {
    (this._widget?.dispose(),
      this._model?.dispose(),
      this._referenceSearchVisible.reset(),
      this._disposables.clear(),
      (this._widget = void 0),
      (this._model = void 0),
      e && this._editor.focus(),
      (this._requestIdPool += 1));
  }
  _gotoReference(e, t) {
    (this._widget?.hide(), (this._ignoreModelChangeEvent = !0));
    const n = YH.lift(e.range).collapseToStart();
    return this._editorService
      .openCodeEditor(
        { resource: e.uri, options: { selection: n, selectionSource: "code.jump", pinned: t } },
        this._editor,
      )
      .then(
        (e) => {
          if (((this._ignoreModelChangeEvent = !1), e && this._widget))
            if (this._editor === e) (this._widget.show(n), this._widget.focusOnReferenceTree());
            else {
              const t = pSe.get(e),
                i = this._model.clone();
              (this.closeWidget(),
                e.focus(),
                t?.toggleWidget(
                  n,
                  gM((e) => Promise.resolve(i)),
                  this._peekMode ?? !1,
                ));
            }
          else this.closeWidget();
        },
        (e) => {
          ((this._ignoreModelChangeEvent = !1), HI(e));
        },
      );
  }
  openReference(e, t, n) {
    t || this.closeWidget();
    const { uri: i, range: r } = e;
    this._editorService.openCodeEditor(
      { resource: i, options: { selection: r, selectionSource: "code.jump", pinned: n } },
      this._editor,
      t,
    );
  }
};
function vSe(e, t) {
  const n = Nye(e);
  if (!n) return;
  const i = _Se.get(n);
  i && t(i);
}
((_Se = pSe =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })([fSe(2, xW), fSe(3, yV), fSe(4, Y4), fSe(5, vV), fSe(6, oue), fSe(7, OU)], _Se)),
  DW.registerCommandAndKeybindingRule({
    id: "togglePeekWidgetFocus",
    weight: 100,
    primary: gO(2089, 60),
    when: eW.or(mSe, jye.inPeekEditor),
    handler(e) {
      vSe(e, (e) => {
        e.changeFocusBetweenPreviewAndReferences();
      });
    },
  }),
  DW.registerCommandAndKeybindingRule({
    id: "goToNextReference",
    weight: 90,
    primary: 62,
    secondary: [70],
    when: eW.or(mSe, jye.inPeekEditor),
    handler(e) {
      vSe(e, (e) => {
        e.goToNextOrPreviousReference(!0);
      });
    },
  }),
  DW.registerCommandAndKeybindingRule({
    id: "goToPreviousReference",
    weight: 90,
    primary: 1086,
    secondary: [1094],
    when: eW.or(mSe, jye.inPeekEditor),
    handler(e) {
      vSe(e, (e) => {
        e.goToNextOrPreviousReference(!1);
      });
    },
  }),
  jV.registerCommandAlias("goToNextReferenceFromEmbeddedEditor", "goToNextReference"),
  jV.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor", "goToPreviousReference"),
  jV.registerCommandAlias("closeReferenceSearchEditor", "closeReferenceSearch"),
  jV.registerCommand("closeReferenceSearch", (e) => vSe(e, (e) => e.closeWidget())),
  DW.registerKeybindingRule({
    id: "closeReferenceSearch",
    weight: -1,
    primary: 9,
    secondary: [1033],
    when: eW.and(jye.inPeekEditor, eW.not("config.editor.stablePeek")),
  }),
  DW.registerKeybindingRule({
    id: "closeReferenceSearch",
    weight: 250,
    primary: 9,
    secondary: [1033],
    when: eW.and(mSe, eW.not("config.editor.stablePeek"), eW.or($$.editorTextFocus, Owe.negate())),
  }),
  DW.registerCommandAndKeybindingRule({
    id: "revealReference",
    weight: 200,
    primary: 3,
    mac: { primary: 3, secondary: [2066] },
    when: eW.and(mSe, Wwe, Kwe.negate(), Zwe.negate()),
    handler(e) {
      const t = e.get(Pwe),
        n = t.lastFocusedList?.getFocus();
      Array.isArray(n) && n[0] instanceof FCe && vSe(e, (e) => e.revealReference(n[0]));
    },
  }),
  DW.registerCommandAndKeybindingRule({
    id: "openReferenceToSide",
    weight: 100,
    primary: 2051,
    mac: { primary: 259 },
    when: eW.and(mSe, Wwe, Kwe.negate(), Zwe.negate()),
    handler(e) {
      const t = e.get(Pwe),
        n = t.lastFocusedList?.getFocus();
      Array.isArray(n) && n[0] instanceof FCe && vSe(e, (e) => e.openReference(n[0], !0, !0));
    },
  }),
  jV.registerCommand("openReference", (e) => {
    const t = e.get(Pwe),
      n = t.lastFocusedList?.getFocus();
    Array.isArray(n) && n[0] instanceof FCe && vSe(e, (e) => e.openReference(n[0], !1, !0));
  }));
var bSe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  ySe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const xSe = new yW(
    "hasSymbols",
    !1,
    SI(1095, "Whether there are symbol locations that can be navigated via keyboard-only."),
  ),
  wSe = bV("ISymbolNavigationService");
let CSe = class {
  constructor(e, t, n, i) {
    ((this._editorService = t),
      (this._notificationService = n),
      (this._keybindingService = i),
      (this._currentModel = void 0),
      (this._currentIdx = -1),
      (this._ignoreEditorChange = !1),
      (this._ctxHasSymbols = xSe.bindTo(e)));
  }
  reset() {
    (this._ctxHasSymbols.reset(),
      this._currentState?.dispose(),
      this._currentMessage?.close(),
      (this._currentModel = void 0),
      (this._currentIdx = -1));
  }
  put(e) {
    const t = e.parent.parent;
    if (t.references.length <= 1) return void this.reset();
    ((this._currentModel = t),
      (this._currentIdx = t.references.indexOf(e)),
      this._ctxHasSymbols.set(!0),
      this._showMessage());
    const n = new SSe(this._editorService),
      i = n.onDidChange((e) => {
        if (this._ignoreEditorChange) return;
        const n = this._editorService.getActiveCodeEditor();
        if (!n) return;
        const i = n.getModel(),
          r = n.getPosition();
        if (!i || !r) return;
        let o = !1,
          s = !1;
        for (const a of t.references)
          if (lH(a.uri, i.uri)) ((o = !0), (s = s || YH.containsPosition(a.range, r)));
          else if (o) break;
        (o && s) || this.reset();
      });
    this._currentState = RO(n, i);
  }
  revealNext(e) {
    if (!this._currentModel) return Promise.resolve();
    ((this._currentIdx += 1), (this._currentIdx %= this._currentModel.references.length));
    const t = this._currentModel.references[this._currentIdx];
    return (
      this._showMessage(),
      (this._ignoreEditorChange = !0),
      this._editorService
        .openCodeEditor(
          {
            resource: t.uri,
            options: { selection: YH.collapseToStart(t.range), selectionRevealType: 3 },
          },
          e,
        )
        .finally(() => {
          this._ignoreEditorChange = !1;
        })
    );
  }
  _showMessage() {
    this._currentMessage?.close();
    const e = this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),
      t = e
        ? SI(
            1096,
            "Symbol {0} of {1}, {2} for next",
            this._currentIdx + 1,
            this._currentModel.references.length,
            e.getLabel(),
          )
        : SI(1097, "Symbol {0} of {1}", this._currentIdx + 1, this._currentModel.references.length);
    this._currentMessage = this._notificationService.status(t);
  }
};
((CSe = bSe([ySe(0, xW), ySe(1, yV), ySe(2, Y4), ySe(3, N5)], CSe)),
  HU(wSe, CSe, 1),
  BH(
    new (class extends MH {
      constructor() {
        super({
          id: "editor.gotoNextSymbolFromResult",
          precondition: xSe,
          kbOpts: { weight: 100, primary: 70 },
        });
      }
      runEditorCommand(e, t) {
        return e.get(wSe).revealNext(t);
      }
    })(),
  ),
  DW.registerCommandAndKeybindingRule({
    id: "editor.gotoNextSymbolFromResult.cancel",
    weight: 100,
    when: xSe,
    primary: 9,
    handler(e) {
      e.get(wSe).reset();
    },
  }));
let SSe = class {
  constructor(e) {
    ((this._listener = new Map()),
      (this._disposables = new AO()),
      (this._onDidChange = new QO()),
      (this.onDidChange = this._onDidChange.event),
      this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor, this)),
      this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor, this)),
      e.listCodeEditors().forEach(this._onDidAddEditor, this));
  }
  dispose() {
    (this._disposables.dispose(), this._onDidChange.dispose(), IO(this._listener.values()));
  }
  _onDidAddEditor(e) {
    this._listener.set(
      e,
      RO(
        e.onDidChangeCursorPosition((t) => this._onDidChange.fire({ editor: e })),
        e.onDidChangeModelContent((t) => this._onDidChange.fire({ editor: e })),
      ),
    );
  }
  _onDidRemoveEditor(e) {
    (this._listener.get(e)?.dispose(), this._listener.delete(e));
  }
};
function kSe(e, t) {
  return (
    t.uri.scheme === e.uri.scheme ||
    !DP(t.uri, NP.walkThroughSnippet, NP.vscodeChatCodeBlock, NP.vscodeChatCodeCompareBlock)
  );
}
async function ESe(e, t, n, i, r) {
  const o = n.ordered(e, i).map((n) =>
    Promise.resolve(r(n, e, t)).then(void 0, (e) => {
      zI(e);
    }),
  );
  return rj((await Promise.all(o)).flat()).filter((t) => kSe(e, t));
}
function NSe(e, t, n, i, r) {
  return ESe(t, n, e, i, (e, t, n) => e.provideDefinition(t, n, r));
}
function LSe(e, t, n, i, r) {
  return ESe(t, n, e, i, (e, t, n) => e.provideDeclaration(t, n, r));
}
function DSe(e, t, n, i, r) {
  return ESe(t, n, e, i, (e, t, n) => e.provideImplementation(t, n, r));
}
function TSe(e, t, n, i, r) {
  return ESe(t, n, e, i, (e, t, n) => e.provideTypeDefinition(t, n, r));
}
function ISe(e, t, n, i, r, o) {
  return ESe(t, n, e, r, async (e, t, n) => {
    const r = (await e.provideReferences(t, n, { includeDeclaration: !0 }, o))?.filter((e) =>
      kSe(t, e),
    );
    if (!i || !r || 2 !== r.length) return r;
    const s = (await e.provideReferences(t, n, { includeDeclaration: !1 }, o))?.filter((e) =>
      kSe(t, e),
    );
    return s && 1 === s.length ? s : r;
  });
}
async function RSe(e) {
  const t = await e(),
    n = new WCe(t, ""),
    i = n.references.map((e) => e.link);
  return (n.dispose(), i);
}
((SSe = bSe([ySe(0, yV)], SSe)),
  FH("_executeDefinitionProvider", (e, t, n) => {
    const i = NSe(e.get(mee).definitionProvider, t, n, !1, aM.None);
    return RSe(() => i);
  }),
  FH("_executeDefinitionProvider_recursive", (e, t, n) => {
    const i = NSe(e.get(mee).definitionProvider, t, n, !0, aM.None);
    return RSe(() => i);
  }),
  FH("_executeTypeDefinitionProvider", (e, t, n) => {
    const i = TSe(e.get(mee).typeDefinitionProvider, t, n, !1, aM.None);
    return RSe(() => i);
  }),
  FH("_executeTypeDefinitionProvider_recursive", (e, t, n) => {
    const i = TSe(e.get(mee).typeDefinitionProvider, t, n, !0, aM.None);
    return RSe(() => i);
  }),
  FH("_executeDeclarationProvider", (e, t, n) => {
    const i = LSe(e.get(mee).declarationProvider, t, n, !1, aM.None);
    return RSe(() => i);
  }),
  FH("_executeDeclarationProvider_recursive", (e, t, n) => {
    const i = LSe(e.get(mee).declarationProvider, t, n, !0, aM.None);
    return RSe(() => i);
  }),
  FH("_executeReferenceProvider", (e, t, n) => {
    const i = ISe(e.get(mee).referenceProvider, t, n, !1, !1, aM.None);
    return RSe(() => i);
  }),
  FH("_executeReferenceProvider_recursive", (e, t, n) => {
    const i = ISe(e.get(mee).referenceProvider, t, n, !1, !0, aM.None);
    return RSe(() => i);
  }),
  FH("_executeImplementationProvider", (e, t, n) => {
    const i = DSe(e.get(mee).implementationProvider, t, n, !1, aM.None);
    return RSe(() => i);
  }),
  FH("_executeImplementationProvider_recursive", (e, t, n) => {
    const i = DSe(e.get(mee).implementationProvider, t, n, !0, aM.None);
    return RSe(() => i);
  }),
  jW.appendMenuItem(MW.EditorContext, {
    submenu: MW.EditorContextPeek,
    title: SI(1038, "Peek"),
    group: "navigation",
    order: 100,
  }));
class OSe {
  static is(e) {
    return (
      !(!e || "object" != typeof e) &&
      (e instanceof OSe || !(!xV.isIPosition(e.position) || !e.model))
    );
  }
  constructor(e, t) {
    ((this.model = e), (this.position = t));
  }
}
class MSe extends jH {
  static {
    this._allSymbolNavigationCommands = new Map();
  }
  static {
    this._activeAlternativeCommands = new Set();
  }
  static all() {
    return MSe._allSymbolNavigationCommands.values();
  }
  static _patchConfig(e) {
    const t = { ...e, f1: !0 };
    if (t.menu)
      for (const n of DO.wrap(t.menu))
        (n.id !== MW.EditorContext && n.id !== MW.EditorContextPeek) ||
          (n.when = eW.and(e.precondition, n.when));
    return t;
  }
  constructor(e, t) {
    (super(MSe._patchConfig(t)),
      (this.configuration = e),
      MSe._allSymbolNavigationCommands.set(t.id, this));
  }
  runEditorCommand(e, t, n, i) {
    if (!t.hasModel()) return Promise.resolve(void 0);
    const r = e.get(Y4),
      o = e.get(yV),
      s = e.get(One),
      a = e.get(wSe),
      l = e.get(mee),
      c = e.get(vV),
      d = t.getModel(),
      u = t.getPosition(),
      h = OSe.is(n) ? n : new OSe(d, u),
      g = new uge(t, 5),
      p = pM(this._getLocationModel(l, h.model, h.position, g.token), g.token)
        .then(
          async (e) => {
            if (!e || g.token.isCancellationRequested) return;
            let r;
            if ((pV(e.ariaMessage), e.referenceAt(d.uri, u))) {
              const e = this._getAlternativeCommand(t);
              void 0 !== e &&
                !MSe._activeAlternativeCommands.has(e) &&
                MSe._allSymbolNavigationCommands.has(e) &&
                (r = MSe._allSymbolNavigationCommands.get(e));
            }
            const s = e.references.length;
            if (0 === s) {
              if (!this.configuration.muteMessage) {
                const e = d.getWordAtPosition(u);
                Cge.get(t)?.showMessage(this._getNoResultFoundMessage(e), u);
              }
            } else {
              if (1 !== s || !r) return this._onResult(o, a, t, e, i);
              (MSe._activeAlternativeCommands.add(this.desc.id),
                c.invokeFunction((e) =>
                  r.runEditorCommand(e, t, n, i).finally(() => {
                    MSe._activeAlternativeCommands.delete(this.desc.id);
                  }),
                ));
            }
          },
          (e) => {
            r.error(e);
          },
        )
        .finally(() => {
          g.dispose();
        });
    return (s.showWhile(p, 250), p);
  }
  async _onResult(e, t, n, i, r) {
    const o = this._getGoToPreference(n);
    if (
      n instanceof Eye ||
      !(this.configuration.openInPeek || ("peek" === o && i.references.length > 1))
    ) {
      const s = i.firstReference(),
        a = i.references.length > 1 && "gotoAndPeek" === o,
        l = await this._openReference(n, e, s, this.configuration.openToSide, !a);
      (a && l ? this._openInPeek(l, i, r) : i.dispose(), "goto" === o && t.put(s));
    } else this._openInPeek(n, i, r);
  }
  async _openReference(e, t, n, i, r) {
    let o;
    var s;
    if (
      ((s = n) &&
        mP.isUri(s.uri) &&
        YH.isIRange(s.range) &&
        (YH.isIRange(s.originSelectionRange) || YH.isIRange(s.targetSelectionRange)) &&
        (o = n.targetSelectionRange),
      o || (o = n.range),
      !o)
    )
      return;
    const a = await t.openCodeEditor(
      {
        resource: n.uri,
        options: {
          selection: YH.collapseToStart(o),
          selectionRevealType: 3,
          selectionSource: "code.jump",
        },
      },
      e,
      i,
    );
    if (a) {
      if (r) {
        const e = a.getModel(),
          t = a.createDecorationsCollection([
            {
              range: o,
              options: {
                description: "symbol-navigate-action-highlight",
                className: "symbolHighlight",
              },
            },
          ]);
        setTimeout(() => {
          a.getModel() === e && t.clear();
        }, 350);
      }
      return a;
    }
  }
  _openInPeek(e, t, n) {
    const i = _Se.get(e);
    i && e.hasModel()
      ? i.toggleWidget(
          n ?? e.getSelection(),
          gM((e) => Promise.resolve(t)),
          this.configuration.openInPeek,
        )
      : t.dispose();
  }
}
class ASe extends MSe {
  async _getLocationModel(e, t, n, i) {
    return new WCe(await NSe(e.definitionProvider, t, n, !1, i), SI(1039, "Definitions"));
  }
  _getNoResultFoundMessage(e) {
    return e && e.word
      ? SI(1040, "No definition found for '{0}'", e.word)
      : SI(1041, "No definition found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(67).alternativeDefinitionCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(67).multipleDefinitions;
  }
}
(WW(
  class e extends ASe {
    static {
      this.id = "editor.action.revealDefinition";
    }
    constructor() {
      (super(
        { openToSide: !1, openInPeek: !1, muteMessage: !1 },
        {
          id: e.id,
          title: { ...EI(1065, "Go to Definition"), mnemonicTitle: SI(1042, "Go to &&Definition") },
          precondition: $$.hasDefinitionProvider,
          keybinding: [
            { when: $$.editorTextFocus, primary: 70, weight: 100 },
            { when: eW.and($$.editorTextFocus, Iwe), primary: 2118, weight: 100 },
          ],
          menu: [
            { id: MW.EditorContext, group: "navigation", order: 1.1 },
            { id: MW.MenubarGoMenu, precondition: null, group: "4_symbol_nav", order: 2 },
          ],
        },
      ),
        jV.registerCommandAlias("editor.action.goToDeclaration", e.id));
    }
  },
),
  WW(
    class e extends ASe {
      static {
        this.id = "editor.action.revealDefinitionAside";
      }
      constructor() {
        (super(
          { openToSide: !0, openInPeek: !1, muteMessage: !1 },
          {
            id: e.id,
            title: EI(1066, "Open Definition to the Side"),
            precondition: eW.and($$.hasDefinitionProvider, $$.isInEmbeddedEditor.toNegated()),
            keybinding: [
              { when: $$.editorTextFocus, primary: gO(2089, 70), weight: 100 },
              { when: eW.and($$.editorTextFocus, Iwe), primary: gO(2089, 2118), weight: 100 },
            ],
          },
        ),
          jV.registerCommandAlias("editor.action.openDeclarationToTheSide", e.id));
      }
    },
  ),
  WW(
    class e extends ASe {
      static {
        this.id = "editor.action.peekDefinition";
      }
      constructor() {
        (super(
          { openToSide: !1, openInPeek: !0, muteMessage: !1 },
          {
            id: e.id,
            title: EI(1067, "Peek Definition"),
            precondition: eW.and(
              $$.hasDefinitionProvider,
              jye.notInPeekEditor,
              $$.isInEmbeddedEditor.toNegated(),
            ),
            keybinding: {
              when: $$.editorTextFocus,
              primary: 582,
              linux: { primary: 3140 },
              weight: 100,
            },
            menu: { id: MW.EditorContextPeek, group: "peek", order: 2 },
          },
        ),
          jV.registerCommandAlias("editor.action.previewDeclaration", e.id));
      }
    },
  ));
class PSe extends MSe {
  async _getLocationModel(e, t, n, i) {
    return new WCe(await LSe(e.declarationProvider, t, n, !1, i), SI(1043, "Declarations"));
  }
  _getNoResultFoundMessage(e) {
    return e && e.word
      ? SI(1044, "No declaration found for '{0}'", e.word)
      : SI(1045, "No declaration found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(67).alternativeDeclarationCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(67).multipleDeclarations;
  }
}
(WW(
  class e extends PSe {
    static {
      this.id = "editor.action.revealDeclaration";
    }
    constructor() {
      super(
        { openToSide: !1, openInPeek: !1, muteMessage: !1 },
        {
          id: e.id,
          title: {
            ...EI(1068, "Go to Declaration"),
            mnemonicTitle: SI(1046, "Go to &&Declaration"),
          },
          precondition: eW.and($$.hasDeclarationProvider, $$.isInEmbeddedEditor.toNegated()),
          menu: [
            { id: MW.EditorContext, group: "navigation", order: 1.3 },
            { id: MW.MenubarGoMenu, precondition: null, group: "4_symbol_nav", order: 3 },
          ],
        },
      );
    }
    _getNoResultFoundMessage(e) {
      return e && e.word
        ? SI(1047, "No declaration found for '{0}'", e.word)
        : SI(1048, "No declaration found");
    }
  },
),
  WW(
    class extends PSe {
      constructor() {
        super(
          { openToSide: !1, openInPeek: !0, muteMessage: !1 },
          {
            id: "editor.action.peekDeclaration",
            title: EI(1069, "Peek Declaration"),
            precondition: eW.and(
              $$.hasDeclarationProvider,
              jye.notInPeekEditor,
              $$.isInEmbeddedEditor.toNegated(),
            ),
            menu: { id: MW.EditorContextPeek, group: "peek", order: 3 },
          },
        );
      }
    },
  ));
class jSe extends MSe {
  async _getLocationModel(e, t, n, i) {
    return new WCe(await TSe(e.typeDefinitionProvider, t, n, !1, i), SI(1049, "Type Definitions"));
  }
  _getNoResultFoundMessage(e) {
    return e && e.word
      ? SI(1050, "No type definition found for '{0}'", e.word)
      : SI(1051, "No type definition found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(67).alternativeTypeDefinitionCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(67).multipleTypeDefinitions;
  }
}
(WW(
  class e extends jSe {
    static {
      this.ID = "editor.action.goToTypeDefinition";
    }
    constructor() {
      super(
        { openToSide: !1, openInPeek: !1, muteMessage: !1 },
        {
          id: e.ID,
          title: {
            ...EI(1070, "Go to Type Definition"),
            mnemonicTitle: SI(1052, "Go to &&Type Definition"),
          },
          precondition: $$.hasTypeDefinitionProvider,
          keybinding: { when: $$.editorTextFocus, primary: 0, weight: 100 },
          menu: [
            { id: MW.EditorContext, group: "navigation", order: 1.4 },
            { id: MW.MenubarGoMenu, precondition: null, group: "4_symbol_nav", order: 3 },
          ],
        },
      );
    }
  },
),
  WW(
    class e extends jSe {
      static {
        this.ID = "editor.action.peekTypeDefinition";
      }
      constructor() {
        super(
          { openToSide: !1, openInPeek: !0, muteMessage: !1 },
          {
            id: e.ID,
            title: EI(1071, "Peek Type Definition"),
            precondition: eW.and(
              $$.hasTypeDefinitionProvider,
              jye.notInPeekEditor,
              $$.isInEmbeddedEditor.toNegated(),
            ),
            menu: { id: MW.EditorContextPeek, group: "peek", order: 4 },
          },
        );
      }
    },
  ));
class FSe extends MSe {
  async _getLocationModel(e, t, n, i) {
    return new WCe(await DSe(e.implementationProvider, t, n, !1, i), SI(1053, "Implementations"));
  }
  _getNoResultFoundMessage(e) {
    return e && e.word
      ? SI(1054, "No implementation found for '{0}'", e.word)
      : SI(1055, "No implementation found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(67).alternativeImplementationCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(67).multipleImplementations;
  }
}
(WW(
  class e extends FSe {
    static {
      this.ID = "editor.action.goToImplementation";
    }
    constructor() {
      super(
        { openToSide: !1, openInPeek: !1, muteMessage: !1 },
        {
          id: e.ID,
          title: {
            ...EI(1072, "Go to Implementations"),
            mnemonicTitle: SI(1056, "Go to &&Implementations"),
          },
          precondition: $$.hasImplementationProvider,
          keybinding: { when: $$.editorTextFocus, primary: 2118, weight: 100 },
          menu: [
            { id: MW.EditorContext, group: "navigation", order: 1.45 },
            { id: MW.MenubarGoMenu, precondition: null, group: "4_symbol_nav", order: 4 },
          ],
        },
      );
    }
  },
),
  WW(
    class e extends FSe {
      static {
        this.ID = "editor.action.peekImplementation";
      }
      constructor() {
        super(
          { openToSide: !1, openInPeek: !0, muteMessage: !1 },
          {
            id: e.ID,
            title: EI(1073, "Peek Implementations"),
            precondition: eW.and(
              $$.hasImplementationProvider,
              jye.notInPeekEditor,
              $$.isInEmbeddedEditor.toNegated(),
            ),
            keybinding: { when: $$.editorTextFocus, primary: 3142, weight: 100 },
            menu: { id: MW.EditorContextPeek, group: "peek", order: 5 },
          },
        );
      }
    },
  ));
class BSe extends MSe {
  _getNoResultFoundMessage(e) {
    return e ? SI(1057, "No references found for '{0}'", e.word) : SI(1058, "No references found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(67).alternativeReferenceCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(67).multipleReferences;
  }
}
(WW(
  class extends BSe {
    constructor() {
      super(
        { openToSide: !1, openInPeek: !1, muteMessage: !1 },
        {
          id: "editor.action.goToReferences",
          title: { ...EI(1074, "Go to References"), mnemonicTitle: SI(1059, "Go to &&References") },
          precondition: eW.and(
            $$.hasReferenceProvider,
            jye.notInPeekEditor,
            $$.isInEmbeddedEditor.toNegated(),
          ),
          keybinding: { when: $$.editorTextFocus, primary: 1094, weight: 100 },
          menu: [
            { id: MW.EditorContext, group: "navigation", order: 1.45 },
            { id: MW.MenubarGoMenu, precondition: null, group: "4_symbol_nav", order: 5 },
          ],
        },
      );
    }
    async _getLocationModel(e, t, n, i) {
      return new WCe(await ISe(e.referenceProvider, t, n, !0, !1, i), SI(1060, "References"));
    }
  },
),
  WW(
    class extends BSe {
      constructor() {
        super(
          { openToSide: !1, openInPeek: !0, muteMessage: !1 },
          {
            id: "editor.action.referenceSearch.trigger",
            title: EI(1075, "Peek References"),
            precondition: eW.and(
              $$.hasReferenceProvider,
              jye.notInPeekEditor,
              $$.isInEmbeddedEditor.toNegated(),
            ),
            menu: { id: MW.EditorContextPeek, group: "peek", order: 6 },
          },
        );
      }
      async _getLocationModel(e, t, n, i) {
        return new WCe(await ISe(e.referenceProvider, t, n, !1, !1, i), SI(1061, "References"));
      }
    },
  ));
class VSe extends MSe {
  constructor(e, t, n) {
    (super(e, {
      id: "editor.action.goToLocation",
      title: EI(1076, "Go to Any Symbol"),
      precondition: eW.and(jye.notInPeekEditor, $$.isInEmbeddedEditor.toNegated()),
    }),
      (this._references = t),
      (this._gotoMultipleBehaviour = n));
  }
  async _getLocationModel(e, t, n, i) {
    return new WCe(this._references, SI(1062, "Locations"));
  }
  _getNoResultFoundMessage(e) {
    return (e && SI(1063, "No results for '{0}'", e.word)) || "";
  }
  _getGoToPreference(e) {
    return this._gotoMultipleBehaviour ?? e.getOption(67).multipleReferences;
  }
  _getAlternativeCommand() {}
}
async function WSe(e, t, n, i) {
  const r = e.get(CV),
    o = e.get(cde),
    s = e.get(PV),
    a = e.get(vV),
    l = e.get(Y4);
  if ((await i.item.resolve(aM.None), !i.part.location)) return;
  const c = i.part.location,
    d = [],
    u = new Set(jW.getMenuItems(MW.EditorContext).map((e) => (OW(e) ? e.command.id : FJ())));
  for (const g of MSe.all())
    u.has(g.desc.id) &&
      d.push(
        new SV(g.desc.id, BW.label(g.desc, { renderShortTitle: !0 }), void 0, !0, async () => {
          const e = await r.createModelReference(c.uri);
          try {
            const n = new OSe(e.object.textEditorModel, YH.getStartPosition(c.range)),
              r = i.item.anchor.range;
            await a.invokeFunction(g.runEditorCommand.bind(g), t, n, r);
          } finally {
            e.dispose();
          }
        }),
      );
  if (i.part.command) {
    const { command: e } = i.part;
    (d.push(new EV()),
      d.push(
        new SV(e.id, e.title, void 0, !0, async () => {
          try {
            await s.executeCommand(e.id, ...(e.arguments ?? []));
          } catch (t) {
            l.notify({ severity: Z4.Error, source: i.item.provider.displayName, message: t });
          }
        }),
      ));
  }
  const h = t.getOption(144);
  o.showContextMenu({
    domForShadowRoot: h ? (t.getDomNode() ?? void 0) : void 0,
    getAnchor: () => {
      const e = aB(n);
      return { x: e.left, y: e.top + e.height + 8 };
    },
    getActions: () => d,
    onHide: () => {
      t.focus();
    },
    autoSelectFirstItem: !0,
  });
}
async function HSe(e, t, n, i) {
  const r = e.get(CV),
    o = await r.createModelReference(i.uri);
  (await n.invokeWithinContext(async (e) => {
    const r = t.hasSideBySideModifier,
      s = e.get(xW),
      a = jye.inPeekEditor.getValue(s),
      l = !r && n.getOption(101) && !a;
    return new ASe(
      { openToSide: r, openInPeek: l, muteMessage: !0 },
      { title: { value: "", original: "" }, id: "", precondition: void 0 },
    ).run(e, new OSe(o.object.textEditorModel, YH.getStartPosition(i.range)), YH.lift(i.range));
  }),
    o.dispose());
}
(jV.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: mP },
      {
        name: "position",
        description: "The position at which to start",
        constraint: xV.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 (e, t, n, i, r, o, s) => {
    (pR(mP.isUri(t)),
      pR(xV.isIPosition(n)),
      pR(Array.isArray(i)),
      pR(void 0 === r || "string" == typeof r),
      pR(void 0 === s || "boolean" == typeof s));
    const a = e.get(yV),
      l = await a.openCodeEditor({ resource: t }, a.getFocusedCodeEditor());
    if (wye(l))
      return (
        l.setPosition(n),
        l.revealPositionInCenterIfOutsideViewport(n, 0),
        l.invokeWithinContext((e) => {
          const t = new (class extends VSe {
            _getNoResultFoundMessage(e) {
              return o || super._getNoResultFoundMessage(e);
            }
          })({ muteMessage: !Boolean(o), openInPeek: Boolean(s), openToSide: !1 }, i, r);
          e.get(vV).invokeFunction(t.run.bind(t), l);
        })
      );
  },
}),
  jV.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: mP },
        {
          name: "position",
          description: "The position at which to start",
          constraint: xV.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 (e, t, n, i, r) => {
      e.get(PV).executeCommand("editor.action.goToLocations", t, n, i, r, void 0, !0);
    },
  }),
  jV.registerCommand({
    id: "editor.action.findReferences",
    handler: (e, t, n) => {
      (pR(mP.isUri(t)), pR(xV.isIPosition(n)));
      const i = e.get(mee),
        r = e.get(yV);
      return r.openCodeEditor({ resource: t }, r.getFocusedCodeEditor()).then((e) => {
        if (!wye(e) || !e.hasModel()) return;
        const t = _Se.get(e);
        if (!t) return;
        const r = gM((t) =>
            ISe(i.referenceProvider, e.getModel(), xV.lift(n), !1, !1, t).then(
              (e) => new WCe(e, SI(1064, "References")),
            ),
          ),
          o = new YH(n.lineNumber, n.column, n.lineNumber, n.column);
        return Promise.resolve(t.toggleWidget(o, r, !1));
      });
    },
  }),
  jV.registerCommandAlias("editor.action.showReferences", "editor.action.peekLocations"));
var zSe,
  USe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class $Se {
  constructor() {
    this._entries = new XW(50);
  }
  get(e) {
    const t = $Se._key(e);
    return this._entries.get(t);
  }
  set(e, t) {
    const n = $Se._key(e);
    this._entries.set(n, t);
  }
  static _key(e) {
    return `${e.uri.toString()}/${e.getVersionId()}`;
  }
}
const qSe = bV("IInlayHintsCache");
HU(qSe, $Se, 1);
class KSe {
  constructor(e, t) {
    ((this.item = e), (this.index = t));
  }
  get part() {
    const e = this.item.hint.label;
    return "string" == typeof e ? { label: e } : e[this.index];
  }
}
class GSe {
  constructor(e, t) {
    ((this.part = e), (this.hasTriggerModifier = t));
  }
}
class ZSe {
  constructor() {
    ((this._store = new jO()), (this._tokenSource = new cM()));
  }
  dispose() {
    (this._store.dispose(), this._tokenSource.dispose(!0));
  }
  reset() {
    return (
      this._tokenSource.dispose(!0),
      (this._tokenSource = new cM()),
      (this._store.value = new AO()),
      { store: this._store.value, token: this._tokenSource.token }
    );
  }
}
let YSe = class {
  static {
    zSe = this;
  }
  static {
    this.ID = "editor.contrib.InlayHints";
  }
  static {
    this._MAX_DECORATORS = 1500;
  }
  static {
    this._whitespaceData = {};
  }
  static get(e) {
    return e.getContribution(zSe.ID) ?? void 0;
  }
  constructor(e, t, n, i, r, o, s) {
    ((this._editor = e),
      (this._languageFeaturesService = t),
      (this._inlayHintsCache = i),
      (this._commandService = r),
      (this._notificationService = o),
      (this._instaService = s),
      (this._disposables = new AO()),
      (this._sessionDisposables = new AO()),
      (this._decorationsMetadata = new Map()),
      (this._activeRenderMode = 0),
      (this._ruleFactory = this._disposables.add(new JX(this._editor))),
      (this._debounceInfo = n.for(t.inlayHintsProvider, "InlayHint", { min: 25 })),
      this._disposables.add(t.inlayHintsProvider.onDidChange(() => this._update())),
      this._disposables.add(e.onDidChangeModel(() => this._update())),
      this._disposables.add(e.onDidChangeModelLanguage(() => this._update())),
      this._disposables.add(
        e.onDidChangeConfiguration((e) => {
          e.hasChanged(159) && this._update();
        }),
      ),
      this._update());
  }
  dispose() {
    (this._sessionDisposables.dispose(), this._removeAllDecorations(), this._disposables.dispose());
  }
  _update() {
    (this._sessionDisposables.clear(), this._removeAllDecorations());
    const e = this._editor.getOption(159);
    if ("off" === e.enabled) return;
    const t = this._editor.getModel();
    if (!t || !this._languageFeaturesService.inlayHintsProvider.has(t)) return;
    if ("on" === e.enabled) this._activeRenderMode = 0;
    else {
      let t, n;
      ("onUnlessPressed" === e.enabled ? ((t = 0), (n = 1)) : ((t = 1), (n = 0)),
        (this._activeRenderMode = t),
        this._sessionDisposables.add(
          $B.getInstance().event((e) => {
            if (!this._editor.hasModel()) return;
            const i = e.altKey && e.ctrlKey && !e.shiftKey && !e.metaKey ? n : t;
            if (i !== this._activeRenderMode) {
              this._activeRenderMode = i;
              const e = this._editor.getModel(),
                t = this._copyInlayHintsWithCurrentAnchor(e);
              (this._updateHintsDecorators([e.getFullModelRange()], t), o.schedule(0));
            }
          }),
        ));
    }
    const n = this._inlayHintsCache.get(t);
    (n && this._updateHintsDecorators([t.getFullModelRange()], n),
      this._sessionDisposables.add(
        MO(() => {
          t.isDisposed() || this._cacheHintsForFastRestore(t);
        }),
      ));
    const i = new Set();
    this._sessionDisposables.add(t.onWillDispose(() => {}));
    const r = this._sessionDisposables.add(new ZSe()),
      o = new EM(async () => {
        const e = Date.now(),
          { store: n, token: s } = r.reset();
        try {
          const r = await xye.create(
            this._languageFeaturesService.inlayHintsProvider,
            t,
            this._getHintsRanges(),
            s,
          );
          if (((o.delay = this._debounceInfo.update(t, Date.now() - e)), s.isCancellationRequested))
            return void r.dispose();
          for (const e of r.provider)
            "function" != typeof e.onDidChangeInlayHints ||
              i.has(e) ||
              (i.add(e),
              n.add(
                e.onDidChangeInlayHints(() => {
                  o.isScheduled() || o.schedule();
                }),
              ));
          (n.add(r),
            this._updateHintsDecorators(r.ranges, r.items),
            this._cacheHintsForFastRestore(t));
        } catch (a) {
          HI(a);
        }
      }, this._debounceInfo.get(t));
    (this._sessionDisposables.add(o),
      o.schedule(0),
      this._sessionDisposables.add(
        this._editor.onDidScrollChange((e) => {
          (!e.scrollTopChanged && o.isScheduled()) || o.schedule();
        }),
      ));
    const s = this._sessionDisposables.add(new jO());
    (this._sessionDisposables.add(
      this._editor.onDidChangeModelContent((e) => {
        const t = Math.max(o.delay, 800);
        ((this._cursorInfo = {
          position: this._editor.getPosition(),
          notEarlierThan: Date.now() + t,
        }),
          (s.value = bM(() => o.schedule(0), t)),
          o.schedule());
      }),
    ),
      this._sessionDisposables.add(
        this._editor.onDidChangeConfiguration((e) => {
          e.hasChanged(159) && o.schedule();
        }),
      ),
      this._sessionDisposables.add(this._installDblClickGesture(() => o.schedule(0))),
      this._sessionDisposables.add(this._installLinkGesture()),
      this._sessionDisposables.add(this._installContextMenu()));
  }
  _installLinkGesture() {
    const e = new AO(),
      t = e.add(new vye(this._editor)),
      n = new AO();
    return (
      e.add(n),
      e.add(
        t.onMouseMoveOrRelevantKeyDown((e) => {
          const [t] = e,
            i = this._getInlayHintLabelPart(t),
            r = this._editor.getModel();
          if (!i || !r) return void n.clear();
          const o = new cM();
          (n.add(MO(() => o.dispose(!0))),
            i.item.resolve(o.token),
            (this._activeInlayHintPart =
              i.part.command || i.part.location ? new GSe(i, t.hasTriggerModifier) : void 0));
          const s = r.validatePosition(i.item.hint.position).lineNumber,
            a = new YH(s, 1, s, r.getLineMaxColumn(s)),
            l = this._getInlineHintsForRange(a);
          (this._updateHintsDecorators([a], l),
            n.add(
              MO(() => {
                ((this._activeInlayHintPart = void 0), this._updateHintsDecorators([a], l));
              }),
            ));
        }),
      ),
      e.add(t.onCancel(() => n.clear())),
      e.add(
        t.onExecute(async (e) => {
          const t = this._getInlayHintLabelPart(e);
          if (t) {
            const n = t.part;
            n.location
              ? this._instaService.invokeFunction(HSe, e, this._editor, n.location)
              : L2.is(n.command) && (await this._invokeCommand(n.command, t.item));
          }
        }),
      ),
      e
    );
  }
  _getInlineHintsForRange(e) {
    const t = new Set();
    for (const n of this._decorationsMetadata.values())
      e.containsRange(n.item.anchor.range) && t.add(n.item);
    return Array.from(t);
  }
  _installDblClickGesture(e) {
    return this._editor.onMouseUp(async (t) => {
      if (2 !== t.event.detail) return;
      const n = this._getInlayHintLabelPart(t);
      if (
        n &&
        (t.event.preventDefault(), await n.item.resolve(aM.None), aj(n.item.hint.textEdits))
      ) {
        const t = n.item.hint.textEdits.map((e) => hye.replace(YH.lift(e.range), e.text));
        (this._editor.executeEdits("inlayHint.default", t), e());
      }
    });
  }
  _installContextMenu() {
    return this._editor.onContextMenu(async (e) => {
      if (!SB(e.event.target)) return;
      const t = this._getInlayHintLabelPart(e);
      t && (await this._instaService.invokeFunction(WSe, this._editor, e.event.target, t));
    });
  }
  _getInlayHintLabelPart(e) {
    if (6 !== e.target.type) return;
    const t = e.target.detail.injectedText?.options;
    return t instanceof lee && t?.attachedData instanceof KSe ? t.attachedData : void 0;
  }
  async _invokeCommand(e, t) {
    try {
      await this._commandService.executeCommand(e.id, ...(e.arguments ?? []));
    } catch (n) {
      this._notificationService.notify({
        severity: Z4.Error,
        source: t.provider.displayName,
        message: n,
      });
    }
  }
  _cacheHintsForFastRestore(e) {
    const t = this._copyInlayHintsWithCurrentAnchor(e);
    this._inlayHintsCache.set(e, t);
  }
  _copyInlayHintsWithCurrentAnchor(e) {
    const t = new Map();
    for (const [n, i] of this._decorationsMetadata) {
      if (t.has(i.item)) continue;
      const r = e.getDecorationRange(n);
      if (r) {
        const e = new bye(r, i.item.anchor.direction),
          n = i.item.with({ anchor: e });
        t.set(i.item, n);
      }
    }
    return Array.from(t.values());
  }
  _getHintsRanges() {
    const e = this._editor.getModel(),
      t = this._editor.getVisibleRangesPlusViewportAboveBelow(),
      n = [];
    for (const i of t.sort(YH.compareRangesUsingStarts)) {
      const t = e.validateRange(
        new YH(i.startLineNumber - 30, i.startColumn, i.endLineNumber + 30, i.endColumn),
      );
      0 !== n.length && YH.areIntersectingOrTouching(n[n.length - 1], t)
        ? (n[n.length - 1] = YH.plusRange(n[n.length - 1], t))
        : n.push(t);
    }
    return n;
  }
  _updateHintsDecorators(e, t) {
    const n = new Map();
    if (
      this._cursorInfo &&
      this._cursorInfo.notEarlierThan > Date.now() &&
      e.some((e) => e.containsPosition(this._cursorInfo.position))
    ) {
      const { position: e } = this._cursorInfo;
      this._cursorInfo = void 0;
      const i = new Map();
      for (const t of this._editor.getLineDecorations(e.lineNumber) ?? []) {
        const n = this._decorationsMetadata.get(t.id);
        if (t.range.startColumn > e.column) continue;
        const r = n?.decoration.options[n.item.anchor.direction];
        if (r && r.attachedData !== zSe._whitespaceData) {
          const e = i.get(n.item) ?? 0;
          i.set(n.item, e + r.content.length);
        }
      }
      const r = t.filter(
          (t) =>
            t.anchor.range.startLineNumber === e.lineNumber && t.anchor.range.endColumn <= e.column,
        ),
        o = Array.from(i.values());
      let s;
      for (;;) {
        const e = r.shift(),
          t = o.shift();
        if (!t && !e) break;
        if (e) (n.set(e, t ?? 0), (s = e));
        else if (s && t) {
          let e = n.get(s);
          ((e += t), (e += o.reduce((e, t) => e + t, 0)), (o.length = 0));
          break;
        }
      }
    }
    const i = [],
      r = (e, t, n, r, o) => {
        const s = {
          content: n,
          inlineClassNameAffectsLetterSpacing: !0,
          inlineClassName: t.className,
          cursorStops: r,
          attachedData: o,
        };
        i.push({
          item: e,
          classNameRef: t,
          decoration: {
            range: e.anchor.range,
            options: {
              description: "InlayHint",
              showIfCollapsed: e.anchor.range.isEmpty(),
              collapseOnReplaceEdit: !e.anchor.range.isEmpty(),
              stickiness: 0,
              [e.anchor.direction]: 0 === this._activeRenderMode ? s : void 0,
            },
          },
        });
      },
      o = (e, t) => {
        const n = this._ruleFactory.createClassNameRef({
          width: ((s / 3) | 0) + "px",
          display: "inline-block",
        });
        r(e, n, " ", t ? Kz.Right : Kz.None, zSe._whitespaceData);
      },
      { fontSize: s, fontFamily: a, padding: l, isUniform: c } = this._getLayoutInfo(),
      d = this._editor.getOption(159).maximumLength,
      u = "--code-editorInlayHintsFontFamily";
    this._editor.getContainerDomNode().style.setProperty(u, a);
    let h = { line: 0, totalLen: 0 };
    for (let f = 0; f < t.length; f++) {
      const e = t[f];
      if (
        (h.line !== e.anchor.range.startLineNumber &&
          (h = { line: e.anchor.range.startLineNumber, totalLen: 0 }),
        d && h.totalLen > d)
      )
        continue;
      e.hint.paddingLeft && o(e, !1);
      const a = "string" == typeof e.hint.label ? [{ label: e.hint.label }] : e.hint.label,
        g = n.get(e);
      let p = 0;
      for (let t = 0; t < a.length; t++) {
        const n = a[t],
          i = 0 === t,
          o = t === a.length - 1,
          f = {
            fontSize: `${s}px`,
            fontFamily: `var(${u}), ${Jq.fontFamily}`,
            verticalAlign: c ? "baseline" : "middle",
            unicodeBidi: "isolate",
          };
        (aj(e.hint.textEdits) && (f.cursor = "default"),
          this._fillInColors(f, e.hint),
          (n.command || n.location) &&
            this._activeInlayHintPart?.part.item === e &&
            this._activeInlayHintPart.part.index === t &&
            ((f.textDecoration = "underline"),
            this._activeInlayHintPart.hasTriggerModifier &&
              ((f.color = g0(aZ)), (f.cursor = "pointer"))));
        let m = n.label;
        h.totalLen += m.length;
        let _ = !1;
        const v = 0 !== d ? h.totalLen - d : 0;
        if ((v > 0 && ((m = m.slice(0, -v) + "…"), (_ = !0)), (p += m.length), void 0 !== g)) {
          const e = p - g;
          e >= 0 && ((p -= e), (m = m.slice(0, -(1 + e)) + "…"), (_ = !0));
        }
        if (
          (l &&
            (i && (o || _)
              ? ((f.padding = `1px ${0 | Math.max(1, s / 4)}px`),
                (f.borderRadius = ((s / 4) | 0) + "px"))
              : i
                ? ((f.padding = `1px 0 1px ${0 | Math.max(1, s / 4)}px`),
                  (f.borderRadius = `${(s / 4) | 0}px 0 0 ${(s / 4) | 0}px`))
                : o || _
                  ? ((f.padding = `1px ${0 | Math.max(1, s / 4)}px 1px 0`),
                    (f.borderRadius = `0 ${(s / 4) | 0}px ${(s / 4) | 0}px 0`))
                  : (f.padding = "1px 0 1px 0")),
          r(
            e,
            this._ruleFactory.createClassNameRef(f),
            XSe(m),
            o && !e.hint.paddingRight ? Kz.Right : Kz.None,
            new KSe(e, t),
          ),
          _)
        )
          break;
      }
      if (void 0 !== g && p < g) {
        const t = g - p;
        r(e, this._ruleFactory.createClassNameRef({}), " ".repeat(t), Kz.None);
      }
      if ((e.hint.paddingRight && o(e, !0), i.length > zSe._MAX_DECORATORS)) break;
    }
    const g = [];
    for (const [f, m] of this._decorationsMetadata) {
      const t = this._editor.getModel()?.getDecorationRange(f);
      t &&
        e.some((e) => e.containsRange(t)) &&
        (g.push(f), m.classNameRef.dispose(), this._decorationsMetadata.delete(f));
    }
    const p = Mne.capture(this._editor);
    (this._editor.changeDecorations((e) => {
      const t = e.deltaDecorations(
        g,
        i.map((e) => e.decoration),
      );
      for (let n = 0; n < t.length; n++) {
        const e = i[n];
        this._decorationsMetadata.set(t[n], e);
      }
    }),
      p.restore(this._editor));
  }
  _fillInColors(e, t) {
    t.kind === D2.Parameter
      ? ((e.backgroundColor = g0(kZ)), (e.color = g0(SZ)))
      : t.kind === D2.Type
        ? ((e.backgroundColor = g0(CZ)), (e.color = g0(wZ)))
        : ((e.backgroundColor = g0(xZ)), (e.color = g0(yZ)));
  }
  _getLayoutInfo() {
    const e = this._editor.getOption(159),
      t = e.padding,
      n = this._editor.getOption(61),
      i = this._editor.getOption(58);
    let r = e.fontSize;
    (!r || r < 5 || r > n) && (r = n);
    const o = e.fontFamily || i;
    return { fontSize: r, fontFamily: o, padding: t, isUniform: !t && o === i && r === n };
  }
  _removeAllDecorations() {
    this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));
    for (const e of this._decorationsMetadata.values()) e.classNameRef.dispose();
    this._decorationsMetadata.clear();
  }
};
function XSe(e) {
  return e.replace(/[ \t]/g, " ");
}
((YSe = zSe =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })([USe(1, mee), USe(2, gme), USe(3, qSe), USe(4, PV), USe(5, Y4), USe(6, vV)], YSe)),
  jV.registerCommand("_executeInlayHintProvider", async (e, ...t) => {
    const [n, i] = t;
    (pR(mP.isUri(n)), pR(YH.isIRange(i)));
    const { inlayHintsProvider: r } = e.get(mee),
      o = await e.get(CV).createModelReference(n);
    try {
      const e = await xye.create(r, o.object.textEditorModel, [YH.lift(i)], aM.None),
        t = e.items.map((e) => e.hint);
      return (setTimeout(() => e.dispose(), 0), t);
    } finally {
      o.dispose();
    }
  }));
var QSe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
class JSe extends Sme {
  constructor(e, t, n, i) {
    (super(10, t, e.item.anchor.range, n, i, !0), (this.part = e));
  }
}
let eke = class extends Wbe {
  constructor(e, t, n, i, r, o, s, a) {
    (super(e, t, r, s, n, i, a), (this._resolverService = o), (this.hoverOrdinal = 6));
  }
  suggestHoverAnchor(e) {
    if (!YSe.get(this._editor)) return null;
    if (6 !== e.target.type) return null;
    const t = e.target.detail.injectedText?.options;
    return t instanceof lee && t.attachedData instanceof KSe
      ? new JSe(t.attachedData, this, e.event.posx, e.event.posy)
      : null;
  }
  computeSync() {
    return [];
  }
  computeAsync(e, t, n, i) {
    return e instanceof JSe
      ? new OM(async (t) => {
          const { part: n } = e;
          if ((await n.item.resolve(i), i.isCancellationRequested)) return;
          let r, o;
          if (
            ("string" == typeof n.item.hint.tooltip
              ? (r = new rre().appendText(n.item.hint.tooltip))
              : n.item.hint.tooltip && (r = n.item.hint.tooltip),
            r && t.emitOne(new Bbe(this, e.range, [r], !1, 0)),
            aj(n.item.hint.textEdits) &&
              t.emitOne(
                new Bbe(
                  this,
                  e.range,
                  [new rre().appendText(SI(1164, "Double-click to insert"))],
                  !1,
                  10001,
                ),
              ),
            "string" == typeof n.part.tooltip
              ? (o = new rre().appendText(n.part.tooltip))
              : n.part.tooltip && (o = n.part.tooltip),
            o && t.emitOne(new Bbe(this, e.range, [o], !1, 1)),
            n.part.location || n.part.command)
          ) {
            let i;
            const r =
              "altKey" === this._editor.getOption(86)
                ? PR
                  ? SI(1165, "cmd + click")
                  : SI(1166, "ctrl + click")
                : PR
                  ? SI(1167, "option + click")
                  : SI(1168, "alt + click");
            (n.part.location && n.part.command
              ? (i = new rre().appendText(
                  SI(1169, "Go to Definition ({0}), right click for more", r),
                ))
              : n.part.location
                ? (i = new rre().appendText(SI(1170, "Go to Definition ({0})", r)))
                : n.part.command &&
                  (i = new rre(
                    `[${SI(1171, "Execute Command")}](${((s = n.part.command), cre(s.id, ...(s.arguments ?? [])).toString())} "${n.part.command.title}") (${r})`,
                    { isTrusted: !0 },
                  )),
              i && t.emitOne(new Bbe(this, e.range, [i], !1, 1e4)));
          }
          var s;
          const a = this._resolveInlayHintLabelPartHover(n, i);
          for await (const e of a) t.emitOne(e);
        })
      : OM.EMPTY;
  }
  async *_resolveInlayHintLabelPartHover(e, t) {
    if (!e.part.location) return;
    const { uri: n, range: i } = e.part.location,
      r = await this._resolverService.createModelReference(n);
    try {
      const n = r.object.textEditorModel;
      if (!this._languageFeaturesService.hoverProvider.has(n)) return;
      for await (const r of Obe(
        this._languageFeaturesService.hoverProvider,
        n,
        new xV(i.startLineNumber, i.startColumn),
        t,
      ))
        ore(r.hover.contents) ||
          (yield new Bbe(this, e.item.anchor.range, r.hover.contents, !1, 2 + r.ordinal));
    } finally {
      r.dispose();
    }
  }
};
eke = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([QSe(1, _ge), QSe(2, N5), QSe(3, Xue), QSe(4, OU), QSe(5, CV), QSe(6, mee), QSe(7, PV)], eke);
var tke = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  nke = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class ike {
  constructor(e, t, n) {
    ((this.marker = e), (this.index = t), (this.total = n));
  }
}
let rke = class {
  constructor(e, t, n) {
    ((this._markerService = t),
      (this._configService = n),
      (this._onDidChange = new QO()),
      (this.onDidChange = this._onDidChange.event),
      (this._dispoables = new AO()),
      (this._markers = []),
      (this._nextIdx = -1),
      mP.isUri(e)
        ? (this._resourceFilter = (t) => t.toString() === e.toString())
        : e && (this._resourceFilter = e));
    const i = this._configService.getValue("problems.sortOrder"),
      r = (e, t) => {
        let n = JM(e.resource.toString(), t.resource.toString());
        return (
          0 === n &&
            (n =
              "position" === i
                ? YH.compareRangesUsingStarts(e, t) || Nfe.compare(e.severity, t.severity)
                : Nfe.compare(e.severity, t.severity) || YH.compareRangesUsingStarts(e, t)),
          n
        );
      },
      o = () => {
        let t = this._markerService.read({
          resource: mP.isUri(e) ? e : void 0,
          severities: Nfe.Error | Nfe.Warning | Nfe.Info,
        });
        return (
          "function" == typeof e && (t = t.filter((e) => this._resourceFilter(e.resource))),
          t.sort(r),
          !XP(
            t,
            this._markers,
            (e, t) =>
              e.resource.toString() === t.resource.toString() &&
              e.startLineNumber === t.startLineNumber &&
              e.startColumn === t.startColumn &&
              e.endLineNumber === t.endLineNumber &&
              e.endColumn === t.endColumn &&
              e.severity === t.severity &&
              e.message === t.message,
          ) && ((this._markers = t), !0)
        );
      };
    (o(),
      this._dispoables.add(
        t.onMarkerChanged((e) => {
          (this._resourceFilter && !e.some((e) => this._resourceFilter(e))) ||
            (o() && ((this._nextIdx = -1), this._onDidChange.fire()));
        }),
      ));
  }
  dispose() {
    (this._dispoables.dispose(), this._onDidChange.dispose());
  }
  matches(e) {
    return (
      (!this._resourceFilter && !e) || (!(!this._resourceFilter || !e) && this._resourceFilter(e))
    );
  }
  get selected() {
    const e = this._markers[this._nextIdx];
    return e && new ike(e, this._nextIdx + 1, this._markers.length);
  }
  _initIdx(e, t, n) {
    let i = this._markers.findIndex((t) => lH(t.resource, e.uri));
    if (i < 0)
      ((i = JP(this._markers.length, (t) =>
        JM(this._markers[t].resource.toString(), e.uri.toString()),
      )),
        i < 0 && (i = ~i),
        (this._nextIdx = n ? i : (this._markers.length + i - 1) % this._markers.length));
    else {
      let r = !1,
        o = !1;
      for (let n = i; n < this._markers.length; n++) {
        let i = YH.lift(this._markers[n]);
        if (i.isEmpty()) {
          const t = e.getWordAtPosition(i.getStartPosition());
          t && (i = new YH(i.startLineNumber, t.startColumn, i.startLineNumber, t.endColumn));
        }
        if (t && (i.containsPosition(t) || t.isBeforeOrEqual(i.getStartPosition()))) {
          ((this._nextIdx = n), (r = !0), (o = !i.containsPosition(t)));
          break;
        }
        if (this._markers[n].resource.toString() !== e.uri.toString()) break;
      }
      r ? o && !n && (this._nextIdx -= 1) : (this._nextIdx = n ? 0 : this._markers.length - 1);
    }
    this._nextIdx < 0 && (this._nextIdx = this._markers.length - 1);
  }
  resetIndex() {
    this._nextIdx = -1;
  }
  move(e, t, n) {
    if (0 === this._markers.length) return !1;
    const i = this._nextIdx;
    return (
      -1 === this._nextIdx
        ? this._initIdx(t, n, e)
        : e
          ? (this._nextIdx = (this._nextIdx + 1) % this._markers.length)
          : e ||
            (this._nextIdx = (this._nextIdx - 1 + this._markers.length) % this._markers.length),
      i !== this._nextIdx
    );
  }
  find(e, t) {
    let n = this._markers.findIndex((t) => t.resource.toString() === e.toString());
    if (!(n < 0))
      for (; n < this._markers.length; n++)
        if (YH.containsPosition(this._markers[n], t))
          return new ike(this._markers[n], n + 1, this._markers.length);
  }
};
rke = tke([nke(1, Tfe), nke(2, OU)], rke);
const oke = bV("IMarkerNavigationService");
let ske = class {
  constructor(e, t) {
    ((this._markerService = e), (this._configService = t), (this._provider = new HO()));
  }
  getMarkerList(e) {
    for (const t of this._provider) {
      const n = t.getMarkerList(e);
      if (n) return n;
    }
    return new rke(e, this._markerService, this._configService);
  }
};
var ake;
((ske = tke([nke(0, Tfe), nke(1, OU)], ske)),
  HU(oke, ske, 1),
  (function (e) {
    e.className = function (e) {
      switch (e) {
        case G4.Ignore:
          return "severity-ignore " + AV.asClassName(OV.info);
        case G4.Info:
          return AV.asClassName(OV.info);
        case G4.Warning:
          return AV.asClassName(OV.warning);
        case G4.Error:
          return AV.asClassName(OV.error);
        default:
          return "";
      }
    };
  })(ake || (ake = {})));
var lke,
  cke = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class dke {
  constructor(e, t, n, i, r) {
    ((this._openerService = i),
      (this._labelService = r),
      (this._lines = 0),
      (this._longestLineLength = 0),
      (this._relatedDiagnostics = new WeakMap()),
      (this._disposables = new AO()),
      (this._editor = t));
    const o = document.createElement("div");
    ((o.className = "descriptioncontainer"),
      (this._messageBlock = document.createElement("div")),
      this._messageBlock.classList.add("message"),
      this._messageBlock.setAttribute("aria-live", "assertive"),
      this._messageBlock.setAttribute("role", "alert"),
      o.appendChild(this._messageBlock),
      (this._relatedBlock = document.createElement("div")),
      o.appendChild(this._relatedBlock),
      this._disposables.add(
        KF(this._relatedBlock, "click", (e) => {
          e.preventDefault();
          const t = this._relatedDiagnostics.get(e.target);
          t && n(t);
        }),
      ),
      (this._scrollable = new yJ(o, {
        horizontal: 1,
        vertical: 1,
        useShadows: !1,
        horizontalScrollbarSize: 6,
        verticalScrollbarSize: 6,
      })),
      e.appendChild(this._scrollable.getDomNode()),
      this._disposables.add(
        this._scrollable.onScroll((e) => {
          ((o.style.left = `-${e.scrollLeft}px`), (o.style.top = `-${e.scrollTop}px`));
        }),
      ),
      this._disposables.add(this._scrollable));
  }
  dispose() {
    IO(this._disposables);
  }
  update(e) {
    const { source: t, message: n, relatedInformation: i, code: r } = e;
    let o = (t?.length || 0) + 2;
    r && (o += "string" == typeof r ? r.length : r.value.length);
    const s = ZM(n);
    ((this._lines = s.length), (this._longestLineLength = 0));
    for (const u of s) this._longestLineLength = Math.max(u.length + o, this._longestLineLength);
    (zF(this._messageBlock),
      this._messageBlock.setAttribute("aria-label", this.getAriaLabel(e)),
      this._editor.applyFontInfo(this._messageBlock));
    let a = this._messageBlock;
    for (const u of s)
      ((a = document.createElement("div")),
        (a.innerText = u),
        "" === u && (a.style.height = this._messageBlock.style.lineHeight),
        this._messageBlock.appendChild(a));
    if (t || r) {
      const e = document.createElement("span");
      if ((e.classList.add("details"), a.appendChild(e), t)) {
        const n = document.createElement("span");
        ((n.innerText = t), n.classList.add("source"), e.appendChild(n));
      }
      if (r)
        if ("string" == typeof r) {
          const t = document.createElement("span");
          ((t.innerText = `(${r})`), t.classList.add("code"), e.appendChild(t));
        } else {
          ((this._codeLink = VB("a.code-link")),
            this._codeLink.setAttribute("href", `${r.target.toString()}`),
            (this._codeLink.onclick = (e) => {
              (this._openerService.open(r.target, { allowCommands: !0 }),
                e.preventDefault(),
                e.stopPropagation());
            }));
          ((MB(this._codeLink, VB("span")).innerText = r.value), e.appendChild(this._codeLink));
        }
    }
    if ((zF(this._relatedBlock), this._editor.applyFontInfo(this._relatedBlock), aj(i))) {
      const e = this._relatedBlock.appendChild(document.createElement("div"));
      ((e.style.paddingTop = `${Math.floor(0.66 * this._editor.getOption(75))}px`),
        (this._lines += 1));
      for (const t of i) {
        const n = document.createElement("div"),
          i = document.createElement("a");
        (i.classList.add("filename"),
          (i.innerText = `${this._labelService.getUriBasenameLabel(t.resource)}(${t.startLineNumber}, ${t.startColumn}): `),
          (i.title = this._labelService.getUriLabel(t.resource)),
          this._relatedDiagnostics.set(i, t));
        const r = document.createElement("span");
        ((r.innerText = t.message),
          n.appendChild(i),
          n.appendChild(r),
          (this._lines += 1),
          e.appendChild(n));
      }
    }
    const l = this._editor.getOption(59),
      c = Math.ceil(l.typicalFullwidthCharacterWidth * this._longestLineLength * 0.75),
      d = l.lineHeight * this._lines;
    this._scrollable.setScrollDimensions({ scrollWidth: c, scrollHeight: d });
  }
  layout(e, t) {
    ((this._scrollable.getDomNode().style.height = `${e}px`),
      (this._scrollable.getDomNode().style.width = `${t}px`),
      this._scrollable.setScrollDimensions({ width: t, height: e }));
  }
  getHeightInLines() {
    return Math.min(17, this._lines);
  }
  getAriaLabel(e) {
    let t = "";
    switch (e.severity) {
      case Nfe.Error:
        t = SI(1024, "Error");
        break;
      case Nfe.Warning:
        t = SI(1025, "Warning");
        break;
      case Nfe.Info:
        t = SI(1026, "Info");
        break;
      case Nfe.Hint:
        t = SI(1027, "Hint");
    }
    let n = SI(1028, "{0} at {1}. ", t, e.startLineNumber + ":" + e.startColumn);
    const i = this._editor.getModel();
    if (i && e.startLineNumber <= i.getLineCount() && e.startLineNumber >= 1) {
      n = `${i.getLineContent(e.startLineNumber)}, ${n}`;
    }
    return n;
  }
}
let uke = class extends Vye {
  static {
    lke = this;
  }
  static {
    this.TitleMenu = new MW("gotoErrorTitleMenu");
  }
  constructor(e, t, n, i, r, o, s) {
    (super(e, { showArrow: !0, showFrame: !0, isAccessible: !0, frameWidth: 1 }, r),
      (this._themeService = t),
      (this._openerService = n),
      (this._menuService = i),
      (this._contextKeyService = o),
      (this._labelService = s),
      (this._callOnDispose = new AO()),
      (this._onDidSelectRelatedInformation = new QO()),
      (this.onDidSelectRelatedInformation = this._onDidSelectRelatedInformation.event),
      (this._severity = Nfe.Warning),
      (this._backgroundColor = vG.white),
      this._applyTheme(t.getColorTheme()),
      this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),
      this.create());
  }
  _applyTheme(e) {
    this._backgroundColor = e.getColor(xke);
    let t = fke,
      n = mke;
    this._severity === Nfe.Warning
      ? ((t = _ke), (n = vke))
      : this._severity === Nfe.Info && ((t = bke), (n = yke));
    const i = e.getColor(t),
      r = e.getColor(n);
    this.style({
      arrowColor: i,
      frameColor: i,
      headerBackgroundColor: r,
      primaryHeadingColor: e.getColor(Hye),
      secondaryHeadingColor: e.getColor(zye),
    });
  }
  _applyStyles() {
    (this._parentContainer &&
      (this._parentContainer.style.backgroundColor = this._backgroundColor
        ? this._backgroundColor.toString()
        : ""),
      super._applyStyles());
  }
  dispose() {
    (this._callOnDispose.dispose(), super.dispose());
  }
  _fillHead(e) {
    (super._fillHead(e),
      this._disposables.add(
        this._actionbarWidget.actionRunner.onWillRun((e) => this.editor.focus()),
      ));
    const t = (function (e, t, n, i) {
      const r = [];
      return (Eue(e, r, t, n, i), r);
    })(this._menuService.getMenuActions(lke.TitleMenu, this._contextKeyService));
    this._actionbarWidget.push(t, { label: !1, icon: !0, index: 0 });
  }
  _fillTitleIcon(e) {
    this._icon = MB(e, VB(""));
  }
  _fillBody(e) {
    ((this._parentContainer = e),
      e.classList.add("marker-widget"),
      (this._parentContainer.tabIndex = 0),
      this._parentContainer.setAttribute("role", "tooltip"),
      (this._container = document.createElement("div")),
      e.appendChild(this._container),
      (this._message = new dke(
        this._container,
        this.editor,
        (e) => this._onDidSelectRelatedInformation.fire(e),
        this._openerService,
        this._labelService,
      )),
      this._disposables.add(this._message));
  }
  show() {
    throw new Error("call showAtMarker");
  }
  showAtMarker(e, t, n) {
    (this._container.classList.remove("stale"),
      this._message.update(e),
      (this._severity = e.severity),
      this._applyTheme(this._themeService.getColorTheme()));
    const i = YH.lift(e),
      r = this.editor.getPosition(),
      o = r && i.containsPosition(r) ? r : i.getStartPosition();
    super.show(o, this.computeRequiredHeight());
    const s = this.editor.getModel();
    if (s) {
      const e =
        n > 1 ? SI(1029, "{0} of {1} problems", t, n) : SI(1030, "{0} of {1} problem", t, n);
      this.setTitle(dH(s.uri), e);
    }
    ((this._icon.className = `codicon ${ake.className(Nfe.toSeverity(this._severity))}`),
      this.editor.revealPositionNearTop(o, 0),
      this.editor.focus());
  }
  updateMarker(e) {
    (this._container.classList.remove("stale"), this._message.update(e));
  }
  showStale() {
    (this._container.classList.add("stale"), this._relayout());
  }
  _doLayoutBody(e, t) {
    (super._doLayoutBody(e, t),
      (this._heightInPixel = e),
      this._message.layout(e, t),
      (this._container.style.height = `${e}px`));
  }
  _onWidth(e) {
    this._message.layout(this._heightInPixel, e);
  }
  _relayout() {
    super._relayout(this.computeRequiredHeight());
  }
  computeRequiredHeight() {
    return 3 + this._message.getHeightInLines();
  }
};
uke = lke = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([cke(1, h0), cke(2, mge), cke(3, AW), cke(4, vV), cke(5, xW), cke(6, GCe)], uke);
const hke = LG(JG, eZ),
  gke = LG(nZ, iZ),
  pke = LG(rZ, oZ),
  fke = SG(
    "editorMarkerNavigationError.background",
    { dark: hke, light: hke, hcDark: FG, hcLight: FG },
    SI(1031, "Editor marker navigation widget error color."),
  ),
  mke = SG(
    "editorMarkerNavigationError.headerBackground",
    { dark: NG(fke, 0.1), light: NG(fke, 0.1), hcDark: null, hcLight: null },
    SI(1032, "Editor marker navigation widget error heading background."),
  ),
  _ke = SG(
    "editorMarkerNavigationWarning.background",
    { dark: gke, light: gke, hcDark: FG, hcLight: FG },
    SI(1033, "Editor marker navigation widget warning color."),
  ),
  vke = SG(
    "editorMarkerNavigationWarning.headerBackground",
    { dark: NG(_ke, 0.1), light: NG(_ke, 0.1), hcDark: "#0C141F", hcLight: NG(_ke, 0.2) },
    SI(1034, "Editor marker navigation widget warning heading background."),
  ),
  bke = SG(
    "editorMarkerNavigationInfo.background",
    { dark: pke, light: pke, hcDark: FG, hcLight: FG },
    SI(1035, "Editor marker navigation widget info color."),
  ),
  yke = SG(
    "editorMarkerNavigationInfo.headerBackground",
    { dark: NG(bke, 0.1), light: NG(bke, 0.1), hcDark: null, hcLight: null },
    SI(1036, "Editor marker navigation widget info heading background."),
  ),
  xke = SG(
    "editorMarkerNavigation.background",
    GG,
    SI(1037, "Editor marker navigation widget background."),
  );
var wke,
  Cke = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Ske = class {
  static {
    wke = this;
  }
  static {
    this.ID = "editor.contrib.markerController";
  }
  static get(e) {
    return e.getContribution(wke.ID);
  }
  constructor(e, t, n, i, r) {
    ((this._markerNavigationService = t),
      (this._contextKeyService = n),
      (this._editorService = i),
      (this._instantiationService = r),
      (this._sessionDispoables = new AO()),
      (this._editor = e),
      (this._widgetVisible = Lke.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(e) {
    if (this._model && this._model.matches(e)) return this._model;
    let t = !1;
    return (
      this._model && ((t = !0), this._cleanUp()),
      (this._model = this._markerNavigationService.getMarkerList(e)),
      t && this._model.move(!0, this._editor.getModel(), this._editor.getPosition()),
      (this._widget = this._instantiationService.createInstance(uke, this._editor)),
      this._widget.onDidClose(() => this.close(), this, this._sessionDispoables),
      this._widgetVisible.set(!0),
      this._sessionDispoables.add(this._model),
      this._sessionDispoables.add(this._widget),
      this._sessionDispoables.add(
        this._editor.onDidChangeCursorPosition((e) => {
          (this._model?.selected &&
            YH.containsPosition(this._model?.selected.marker, e.position)) ||
            this._model?.resetIndex();
        }),
      ),
      this._sessionDispoables.add(
        this._model.onDidChange(() => {
          if (!this._widget || !this._widget.position || !this._model) return;
          const e = this._model.find(this._editor.getModel().uri, this._widget.position);
          e ? this._widget.updateMarker(e.marker) : this._widget.showStale();
        }),
      ),
      this._sessionDispoables.add(
        this._widget.onDidSelectRelatedInformation((e) => {
          (this._editorService.openCodeEditor(
            {
              resource: e.resource,
              options: { pinned: !0, revealIfOpened: !0, selection: YH.lift(e).collapseToStart() },
            },
            this._editor,
          ),
            this.close(!1));
        }),
      ),
      this._sessionDispoables.add(this._editor.onDidChangeModel(() => this._cleanUp())),
      this._model
    );
  }
  close(e = !0) {
    (this._cleanUp(), e && this._editor.focus());
  }
  showAtMarker(e) {
    if (!this._editor.hasModel()) return;
    const t = this._editor.getModel(),
      n = this._getOrCreateModel(t.uri);
    (n.resetIndex(),
      n.move(!0, t, new xV(e.startLineNumber, e.startColumn)),
      n.selected &&
        this._widget.showAtMarker(n.selected.marker, n.selected.index, n.selected.total));
  }
  async navigate(e, t) {
    if (!this._editor.hasModel()) return;
    const n = this._editor.getModel(),
      i = this._getOrCreateModel(t ? void 0 : n.uri);
    if ((i.move(e, n, this._editor.getPosition()), i.selected))
      if (i.selected.marker.resource.toString() !== n.uri.toString()) {
        this._cleanUp();
        const n = await this._editorService.openCodeEditor(
          {
            resource: i.selected.marker.resource,
            options: {
              pinned: !1,
              revealIfOpened: !0,
              selectionRevealType: 2,
              selection: i.selected.marker,
            },
          },
          this._editor,
        );
        n && (wke.get(n)?.close(), wke.get(n)?.navigate(e, t));
      } else this._widget.showAtMarker(i.selected.marker, i.selected.index, i.selected.total);
  }
};
Ske = wke = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Cke(1, oke), Cke(2, xW), Cke(3, yV), Cke(4, vV)], Ske);
class kke extends AH {
  constructor(e, t, n) {
    (super(n), (this._next = e), (this._multiFile = t));
  }
  async run(e, t) {
    t.hasModel() && (await Ske.get(t)?.navigate(this._next, this._multiFile));
  }
}
class Eke extends kke {
  static {
    this.ID = "editor.action.marker.next";
  }
  static {
    this.LABEL = EI(1020, "Go to Next Problem (Error, Warning, Info)");
  }
  constructor() {
    super(!0, !1, {
      id: Eke.ID,
      label: Eke.LABEL,
      precondition: void 0,
      kbOpts: { kbExpr: $$.focus, primary: 578, weight: 100 },
      menuOpts: {
        menuId: uke.TitleMenu,
        title: Eke.LABEL.value,
        icon: Zle("marker-navigation-next", OV.arrowDown, SI(1016, "Icon for goto next marker.")),
        group: "navigation",
        order: 1,
      },
    });
  }
}
class Nke extends kke {
  static {
    this.ID = "editor.action.marker.prev";
  }
  static {
    this.LABEL = EI(1021, "Go to Previous Problem (Error, Warning, Info)");
  }
  constructor() {
    super(!1, !1, {
      id: Nke.ID,
      label: Nke.LABEL,
      precondition: void 0,
      kbOpts: { kbExpr: $$.focus, primary: 1602, weight: 100 },
      menuOpts: {
        menuId: uke.TitleMenu,
        title: Nke.LABEL.value,
        icon: Zle(
          "marker-navigation-previous",
          OV.arrowUp,
          SI(1017, "Icon for goto previous marker."),
        ),
        group: "navigation",
        order: 2,
      },
    });
  }
}
(zH(Ske.ID, Ske, 4),
  VH(Eke),
  VH(Nke),
  VH(
    class extends kke {
      constructor() {
        super(!0, !0, {
          id: "editor.action.marker.nextInFiles",
          label: EI(1022, "Go to Next Problem in Files (Error, Warning, Info)"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.focus, primary: 66, weight: 100 },
          menuOpts: {
            menuId: MW.MenubarGoMenu,
            title: SI(1018, "Next &&Problem"),
            group: "6_problem_nav",
            order: 1,
          },
        });
      }
    },
  ),
  VH(
    class extends kke {
      constructor() {
        super(!1, !0, {
          id: "editor.action.marker.prevInFiles",
          label: EI(1023, "Go to Previous Problem in Files (Error, Warning, Info)"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.focus, primary: 1090, weight: 100 },
          menuOpts: {
            menuId: MW.MenubarGoMenu,
            title: SI(1019, "Previous &&Problem"),
            group: "6_problem_nav",
            order: 2,
          },
        });
      }
    },
  ));
const Lke = new yW("markersNavigationVisible", !1);
BH(
  new (MH.bindToContribution(Ske.get))({
    id: "closeMarkersNavigation",
    precondition: Lke,
    handler: (e) => e.close(),
    kbOpts: { weight: 150, kbExpr: $$.focus, primary: 9, secondary: [1033] },
  }),
);
var Dke = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const Tke = VB;
class Ike {
  constructor(e, t, n) {
    ((this.owner = e), (this.range = t), (this.marker = n));
  }
  isValidForHoverAnchor(e) {
    return (
      1 === e.type &&
      this.range.startColumn <= e.range.startColumn &&
      this.range.endColumn >= e.range.endColumn
    );
  }
}
const Rke = { type: 1, filter: { include: dfe.QuickFix }, triggerAction: ufe.QuickFixHover };
let Oke = class {
  constructor(e, t, n, i) {
    ((this._editor = e),
      (this._markerDecorationsService = t),
      (this._openerService = n),
      (this._languageFeaturesService = i),
      (this.hoverOrdinal = 1),
      (this.recentMarkerCodeActionsInfo = void 0));
  }
  computeSync(e, t) {
    if (!this._editor.hasModel() || (1 !== e.type && !e.supportsMarkerHover)) return [];
    const n = this._editor.getModel(),
      i = e.range;
    if (!n.isValidRange(e.range)) return [];
    const r = i.startLineNumber,
      o = n.getLineMaxColumn(r),
      s = [];
    for (const a of t) {
      const t = a.range.startLineNumber === r ? a.range.startColumn : 1,
        i = a.range.endLineNumber === r ? a.range.endColumn : o,
        l = this._markerDecorationsService.getMarker(n.uri, a);
      if (!l) continue;
      const c = new YH(e.range.startLineNumber, t, e.range.startLineNumber, i);
      s.push(new Ike(this, c, l));
    }
    return s;
  }
  renderHoverParts(e, t) {
    if (!t.length) return new kme([]);
    const n = [];
    t.forEach((t) => {
      const i = this._renderMarkerHover(t);
      (e.fragment.appendChild(i.hoverElement), n.push(i));
    });
    const i =
        1 === t.length
          ? t[0]
          : t.sort((e, t) => Nfe.compare(e.marker.severity, t.marker.severity))[0],
      r = this._renderMarkerStatusbar(e, i);
    return new kme(n, r);
  }
  getAccessibleContent(e) {
    return e.marker.message;
  }
  _renderMarkerHover(e) {
    const t = new AO(),
      n = Tke("div.hover-row"),
      i = MB(n, Tke("div.marker.hover-contents")),
      { source: r, message: o, code: s, relatedInformation: a } = e.marker;
    this._editor.applyFontInfo(i);
    const l = MB(i, Tke("span"));
    if (((l.style.whiteSpace = "pre-wrap"), (l.innerText = o), r || s))
      if (s && "string" != typeof s) {
        const e = Tke("span");
        if (r) {
          MB(e, Tke("span")).innerText = r;
        }
        const n = MB(e, Tke("a.code-link"));
        (n.setAttribute("href", s.target.toString(!0)),
          t.add(
            $F(n, "click", (e) => {
              (this._openerService.open(s.target, { allowCommands: !0 }),
                e.preventDefault(),
                e.stopPropagation());
            }),
          ));
        MB(n, Tke("span")).innerText = s.value;
        const o = MB(i, e);
        ((o.style.opacity = "0.6"), (o.style.paddingLeft = "6px"));
      } else {
        const e = MB(i, Tke("span"));
        ((e.style.opacity = "0.6"),
          (e.style.paddingLeft = "6px"),
          (e.innerText = r && s ? `${r}(${s})` : r || `(${s})`));
      }
    if (aj(a))
      for (const { message: c, resource: d, startLineNumber: u, startColumn: h } of a) {
        const e = MB(i, Tke("div"));
        e.style.marginTop = "8px";
        const n = MB(e, Tke("a"));
        ((n.innerText = `${dH(d)}(${u}, ${h}): `),
          (n.style.cursor = "pointer"),
          t.add(
            $F(n, "click", (e) => {
              if ((e.stopPropagation(), e.preventDefault(), this._openerService)) {
                const e = { selection: { startLineNumber: u, startColumn: h } };
                this._openerService.open(d, { fromUserGesture: !0, editorOptions: e }).catch(HI);
              }
            }),
          ));
        const r = MB(e, Tke("span"));
        ((r.innerText = c), this._editor.applyFontInfo(r));
      }
    return { hoverPart: e, hoverElement: n, dispose: () => t.dispose() };
  }
  _renderMarkerStatusbar(e, t) {
    const n = new AO();
    if (
      t.marker.severity === Nfe.Error ||
      t.marker.severity === Nfe.Warning ||
      t.marker.severity === Nfe.Info
    ) {
      const n = Ske.get(this._editor);
      n &&
        e.statusBar.addAction({
          label: SI(1139, "View Problem"),
          commandId: Eke.ID,
          run: () => {
            (e.hide(), n.showAtMarker(t.marker), this._editor.focus());
          },
        });
    }
    if (!this._editor.getOption(104)) {
      const i = e.statusBar.append(Tke("div"));
      this.recentMarkerCodeActionsInfo &&
        (Lfe.makeKey(this.recentMarkerCodeActionsInfo.marker) === Lfe.makeKey(t.marker)
          ? this.recentMarkerCodeActionsInfo.hasCodeActions ||
            (i.textContent = SI(1140, "No quick fixes available"))
          : (this.recentMarkerCodeActionsInfo = void 0));
      const r =
        this.recentMarkerCodeActionsInfo && !this.recentMarkerCodeActionsInfo.hasCodeActions
          ? PO.None
          : bM(() => (i.textContent = SI(1141, "Checking for quick fixes...")), 200, n);
      i.textContent || (i.textContent = String.fromCharCode(160));
      const o = this.getCodeActions(t.marker);
      (n.add(MO(() => o.cancel())),
        o.then((o) => {
          if (
            (r.dispose(),
            (this.recentMarkerCodeActionsInfo = {
              marker: t.marker,
              hasCodeActions: o.validActions.length > 0,
            }),
            !this.recentMarkerCodeActionsInfo.hasCodeActions)
          )
            return (o.dispose(), void (i.textContent = SI(1142, "No quick fixes available")));
          i.style.display = "none";
          let s = !1;
          (n.add(
            MO(() => {
              s || o.dispose();
            }),
          ),
            e.statusBar.addAction({
              label: SI(1143, "Quick Fix..."),
              commandId: mfe,
              run: (t) => {
                s = !0;
                const n = Xfe.get(this._editor),
                  i = aB(t);
                (e.hide(),
                  n?.showCodeActions(Rke, o, {
                    x: i.left,
                    y: i.top,
                    width: i.width,
                    height: i.height,
                  }));
              },
            }));
          const a = o.validActions.find((e) => e.action.isAI);
          (a &&
            e.statusBar.addAction({
              label: a.action.title,
              commandId: a.action.command?.id ?? "",
              iconClass: AV.asClassName(OV.sparkle),
              run: () => {
                const e = Xfe.get(this._editor);
                e?.applyCodeAction(a, !1, !1, Efe.FromProblemsHover);
              },
            }),
            e.onContentsChanged());
        }, HI));
    }
    return n;
  }
  getCodeActions(e) {
    return gM((t) =>
      Sfe(
        this._languageFeaturesService.codeActionProvider,
        this._editor.getModel(),
        new YH(e.startLineNumber, e.startColumn, e.endLineNumber, e.endColumn),
        Rke,
        Rne.None,
        t,
      ),
    );
  }
};
Oke = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Dke(1, Aq), Dke(2, mge), Dke(3, mee)], Oke);
var Mke,
  Ake,
  Pke = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  jke = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Fke = (Mke = class extends PO {
  constructor(e, t, n, i, r, o, s) {
    super();
    const a = t.hoverParts;
    this._renderedHoverParts = this._register(new Vke(e, n, a, i, r, o, s));
    const l = t.options,
      c = l.anchor,
      { showAtPosition: d, showAtSecondaryPosition: u } = Mke.computeHoverPositions(e, c.range, a);
    ((this.shouldAppearBeforeContent = a.some((e) => e.isBeforeContent)),
      (this.showAtPosition = d),
      (this.showAtSecondaryPosition = u),
      (this.initialMousePosX = c.initialMousePosX),
      (this.initialMousePosY = c.initialMousePosY),
      (this.shouldFocus = l.shouldFocus),
      (this.source = l.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(e) {
    this._renderedHoverParts.focusHoverPartWithIndex(e);
  }
  async updateHoverVerbosityLevel(e, t, n) {
    this._renderedHoverParts.updateHoverVerbosityLevel(e, t, n);
  }
  isColorPickerVisible() {
    return this._renderedHoverParts.isColorPickerVisible();
  }
  static computeHoverPositions(e, t, n) {
    let i = 1;
    if (e.hasModel()) {
      const n = e._getViewModel(),
        r = n.coordinatesConverter,
        o = r.convertModelRangeToViewRange(t),
        s = n.getLineMinColumn(o.startLineNumber),
        a = new xV(o.startLineNumber, s);
      i = r.convertViewPositionToModelPosition(a).column;
    }
    const r = t.startLineNumber;
    let o,
      s,
      a,
      l = t.startColumn;
    for (const c of n) {
      const e = c.range,
        t = e.startLineNumber === r,
        n = e.endLineNumber === r;
      if (t && n) {
        const t = e.startColumn,
          n = Math.min(l, t);
        l = Math.max(n, i);
      }
      c.forceShowAtRange && (o = e);
    }
    if (o) {
      const e = o.getStartPosition();
      ((s = e), (a = e));
    } else ((s = t.getStartPosition()), (a = new xV(r, l)));
    return { showAtPosition: s, showAtSecondaryPosition: a };
  }
});
Fke = Mke = Pke([jke(4, N5), jke(5, Xue), jke(6, ade)], Fke);
class Bke {
  constructor(e, t) {
    ((this._statusBar = t), e.appendChild(this._statusBar.hoverElement));
  }
  get hoverElement() {
    return this._statusBar.hoverElement;
  }
  get actions() {
    return this._statusBar.actions;
  }
  dispose() {
    this._statusBar.dispose();
  }
}
let Vke = class extends PO {
  static {
    Ake = this;
  }
  static {
    this._DECORATION_OPTIONS = cee.register({
      description: "content-hover-highlight",
      className: "hoverHighlight",
    });
  }
  constructor(e, t, n, i, r, o, s) {
    (super(),
      (this._hoverService = o),
      (this._clipboardService = s),
      (this._renderedParts = []),
      (this._focusedHoverPartIndex = -1),
      (this._context = i),
      (this._fragment = document.createDocumentFragment()),
      this._register(this._renderParts(t, n, i, r, this._hoverService)),
      this._register(this._registerListenersOnRenderedParts()),
      this._register(this._createEditorDecorations(e, n)),
      this._updateMarkdownAndColorParticipantInfo(t));
  }
  _createEditorDecorations(e, t) {
    if (0 === t.length) return PO.None;
    let n = t[0].range;
    for (const r of t) {
      const e = r.range;
      n = YH.plusRange(n, e);
    }
    const i = e.createDecorationsCollection();
    return (
      i.set([{ range: n, options: Ake._DECORATION_OPTIONS }]),
      MO(() => {
        i.clear();
      })
    );
  }
  _renderParts(e, t, n, i, r) {
    const o = new T_e(i, r),
      s = { fragment: this._fragment, statusBar: o, ...n },
      a = new AO();
    a.add(o);
    for (const c of e) {
      const e = this._renderHoverPartsForParticipant(t, c, s);
      a.add(e);
      for (const t of e.renderedHoverParts)
        this._renderedParts.push({
          type: "hoverPart",
          participant: c,
          hoverPart: t.hoverPart,
          hoverElement: t.hoverElement,
        });
    }
    const l = this._renderStatusBar(this._fragment, o);
    return (
      l &&
        (a.add(l),
        this._renderedParts.push({
          type: "statusBar",
          hoverElement: l.hoverElement,
          actions: l.actions,
        })),
      a
    );
  }
  _renderHoverPartsForParticipant(e, t, n) {
    const i = e.filter((e) => e.owner === t);
    return i.length > 0 ? t.renderHoverParts(n, i) : new kme([]);
  }
  _renderStatusBar(e, t) {
    if (t.hasContent) return new Bke(e, t);
  }
  _registerListenersOnRenderedParts() {
    const e = new AO();
    return (
      this._renderedParts.forEach((t, n) => {
        const i = t.hoverElement;
        ((i.tabIndex = 0),
          e.add(
            $F(i, DB.FOCUS_IN, (e) => {
              (e.stopPropagation(), (this._focusedHoverPartIndex = n));
            }),
          ),
          e.add(
            $F(i, DB.FOCUS_OUT, (e) => {
              (e.stopPropagation(), (this._focusedHoverPartIndex = -1));
            }),
          ),
          "hoverPart" === t.type &&
            t.hoverPart instanceof Ike &&
            e.add(
              new Ibe(
                i,
                () => t.participant.getAccessibleContent(t.hoverPart),
                this._clipboardService,
                this._hoverService,
              ),
            ));
      }),
      e
    );
  }
  _updateMarkdownAndColorParticipantInfo(e) {
    const t = e.find((e) => e instanceof Wbe && !(e instanceof eke));
    (t && (this._markdownHoverParticipant = t),
      (this._colorHoverParticipant = e.find((e) => e instanceof uye)));
  }
  focusHoverPartWithIndex(e) {
    e < 0 || e >= this._renderedParts.length || this._renderedParts[e].hoverElement.focus();
  }
  async updateHoverVerbosityLevel(e, t, n) {
    if (!this._markdownHoverParticipant) return;
    let i;
    i =
      t >= 0
        ? { start: t, endExclusive: t + 1 }
        : this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);
    for (let r = i.start; r < i.endExclusive; r++) {
      const t = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, r);
      if (void 0 === t) continue;
      const n = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(e, t);
      n &&
        (this._renderedParts[r] = {
          type: "hoverPart",
          participant: this._markdownHoverParticipant,
          hoverPart: n.hoverPart,
          hoverElement: n.hoverElement,
        });
    }
    (n && (t >= 0 ? this.focusHoverPartWithIndex(t) : this._context.focus()),
      this._context.onContentsChanged());
  }
  isColorPickerVisible() {
    return this._colorHoverParticipant?.isColorPickerVisible() ?? !1;
  }
  _normalizedIndexToMarkdownHoverIndexRange(e, t) {
    const n = this._renderedParts[t];
    if (!n || "hoverPart" !== n.type) return;
    if (!(n.participant === e)) return;
    const i = this._renderedParts.findIndex((t) => "hoverPart" === t.type && t.participant === e);
    if (-1 === i) throw new QI();
    return t - i;
  }
  _findRangeOfMarkdownHoverParts(e) {
    const t = this._renderedParts.slice(),
      n = t.findIndex((t) => "hoverPart" === t.type && t.participant === e),
      i = t.reverse().findIndex((t) => "hoverPart" === t.type && t.participant === e);
    return { start: n, endExclusive: (i >= 0 ? t.length - i : i) + 1 };
  }
  get domNode() {
    return this._fragment;
  }
  get domNodeHasChildren() {
    return this._fragment.hasChildNodes();
  }
  get focusedHoverPartIndex() {
    return this._focusedHoverPartIndex;
  }
  get hoverPartsCount() {
    return this._renderedParts.length;
  }
};
Vke = Ake = Pke([jke(4, N5), jke(5, Xue), jke(6, ade)], Vke);
var Wke = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let Hke = class extends PO {
  constructor(e, t, n, i, r) {
    (super(),
      (this._editor = e),
      (this._instantiationService = t),
      (this._keybindingService = n),
      (this._hoverService = i),
      (this._clipboardService = r),
      (this._currentResult = null),
      (this._renderedContentHover = this._register(new jO())),
      (this._onContentsChanged = this._register(new QO())),
      (this.onContentsChanged = this._onContentsChanged.event),
      (this._contentHoverWidget = this._register(
        this._instantiationService.createInstance(C_e, this._editor),
      )),
      (this._participants = this._initializeHoverParticipants()),
      (this._hoverOperation = this._register(
        new u_e(this._editor, new k_e(this._editor, this._participants)),
      )),
      this._registerListeners());
  }
  _initializeHoverParticipants() {
    const e = [];
    for (const t of Eme.getAll()) {
      const n = this._instantiationService.createInstance(t, this._editor);
      e.push(n);
    }
    return (
      e.sort((e, t) => e.hoverOrdinal - t.hoverOrdinal),
      this._register(
        this._contentHoverWidget.onDidResize(() => {
          this._participants.forEach((e) => e.handleResize?.());
        }),
      ),
      this._register(
        this._contentHoverWidget.onDidScroll((e) => {
          this._participants.forEach((t) => t.handleScroll?.(e));
        }),
      ),
      this._register(
        this._contentHoverWidget.onContentsChanged(() => {
          this._participants.forEach((e) => e.handleContentsChanged?.());
        }),
      ),
      e
    );
  }
  _registerListeners() {
    this._register(
      this._hoverOperation.onResult((e) => {
        const t = e.hasLoadingMessage ? this._addLoadingMessage(e) : e.value;
        this._withResult(new E_e(t, e.isComplete, e.options));
      }),
    );
    const e = this._contentHoverWidget.getDomNode();
    (this._register(
      KF(e, "keydown", (e) => {
        e.equals(9) && this.hide();
      }),
    ),
      this._register(
        KF(e, "mouseleave", (e) => {
          this._onMouseLeave(e);
        }),
      ),
      this._register(
        I2.onDidChange(() => {
          this._contentHoverWidget.position &&
            this._currentResult &&
            this._setCurrentResult(this._currentResult);
        }),
      ),
      this._register(
        this._contentHoverWidget.onContentsChanged(() => {
          this._onContentsChanged.fire();
        }),
      ));
  }
  _startShowingOrUpdateHover(e, t, n, i, r) {
    if (!(this._contentHoverWidget.position && this._currentResult))
      return !!e && (this._startHoverOperationIfNecessary(e, t, n, i, !1), !0);
    const o = this._editor.getOption(69).sticky,
      s = r && this._contentHoverWidget.isMouseGettingCloser(r.event.posx, r.event.posy);
    if (o && s) return (e && this._startHoverOperationIfNecessary(e, t, n, i, !0), !0);
    if (!e) return (this._setCurrentResult(null), !1);
    if (this._currentResult && this._currentResult.options.anchor.equals(e)) return !0;
    return this._currentResult &&
      e.canAdoptVisibleHover(this._currentResult.options.anchor, this._contentHoverWidget.position)
      ? (this._currentResult && this._setCurrentResult(this._currentResult.filter(e)),
        this._startHoverOperationIfNecessary(e, t, n, i, !1),
        !0)
      : (this._setCurrentResult(null), this._startHoverOperationIfNecessary(e, t, n, i, !1), !0);
  }
  _startHoverOperationIfNecessary(e, t, n, i, r) {
    if (this._hoverOperation.options && this._hoverOperation.options.anchor.equals(e)) return;
    this._hoverOperation.cancel();
    const o = { anchor: e, source: n, shouldFocus: i, insistOnKeepingHoverVisible: r };
    this._hoverOperation.start(t, o);
  }
  _setCurrentResult(e) {
    let t = e;
    if (this._currentResult === t) return;
    (t && 0 === t.hoverParts.length && (t = null),
      (this._currentResult = t),
      this._currentResult ? this._showHover(this._currentResult) : this._hideHover());
  }
  _addLoadingMessage(e) {
    for (const t of this._participants) {
      if (!t.createLoadingMessage) continue;
      const n = t.createLoadingMessage(e.options.anchor);
      if (n) return e.value.slice(0).concat([n]);
    }
    return e.value;
  }
  _withResult(e) {
    (this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete) ||
      this._setCurrentResult(e);
    if (!e.isComplete) return;
    const t = 0 === e.hoverParts.length,
      n = e.options.insistOnKeepingHoverVisible;
    (t && n) || this._setCurrentResult(e);
  }
  _showHover(e) {
    const t = this._getHoverContext();
    ((this._renderedContentHover.value = new Fke(
      this._editor,
      e,
      this._participants,
      t,
      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((e) => e.handleHide?.()));
  }
  _getHoverContext() {
    return {
      hide: () => {
        this.hide();
      },
      onContentsChanged: () => {
        this._contentHoverWidget.handleContentsChanged();
      },
      setMinimumDimensions: (e) => {
        this._contentHoverWidget.setMinimumDimensions(e);
      },
      focus: () => this.focus(),
    };
  }
  showsOrWillShow(e) {
    if (this._contentHoverWidget.isResizing) return !0;
    const t = this._findHoverAnchorCandidates(e);
    if (!(t.length > 0)) return this._startShowingOrUpdateHover(null, 0, 0, !1, e);
    const n = t[0];
    return this._startShowingOrUpdateHover(n, 0, 0, !1, e);
  }
  _findHoverAnchorCandidates(e) {
    const t = [];
    for (const i of this._participants) {
      if (!i.suggestHoverAnchor) continue;
      const n = i.suggestHoverAnchor(e);
      n && t.push(n);
    }
    const n = e.target;
    switch (n.type) {
      case 6:
        t.push(new Cme(0, n.range, e.event.posx, e.event.posy));
        break;
      case 7: {
        const i = this._editor.getOption(59).typicalHalfwidthCharacterWidth / 2;
        if (
          !(
            !n.detail.isAfterLines &&
            "number" == typeof n.detail.horizontalDistanceToText &&
            n.detail.horizontalDistanceToText < i
          )
        )
          break;
        t.push(new Cme(0, n.range, e.event.posx, e.event.posy));
        break;
      }
    }
    return (t.sort((e, t) => t.priority - e.priority), t);
  }
  _onMouseLeave(e) {
    const t = this._editor.getDomNode();
    (!t || !c_e(t, e.x, e.y)) && this.hide();
  }
  startShowingAtRange(e, t, n, i) {
    this._startShowingOrUpdateHover(new Cme(0, e, void 0, void 0), t, n, i, null);
  }
  async updateHoverVerbosityLevel(e, t, n) {
    this._renderedContentHover.value?.updateHoverVerbosityLevel(e, t, n);
  }
  focusedHoverPartIndex() {
    return this._renderedContentHover.value?.focusedHoverPartIndex ?? -1;
  }
  containsNode(e) {
    return !!e && this._contentHoverWidget.getDomNode().contains(e);
  }
  focus() {
    const e = this._renderedContentHover.value?.hoverPartsCount;
    1 !== e ? this._contentHoverWidget.focus() : this.focusHoverPartWithIndex(0);
  }
  focusHoverPartWithIndex(e) {
    this._renderedContentHover.value?.focusHoverPartWithIndex(e);
  }
  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() ?? !1;
  }
  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;
  }
};
function zke(e) {
  const t = e.target;
  return !!t && 6 === t.type && t.detail.injectedText?.options.attachedData === Vme;
}
Hke = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Wke(1, vV), Wke(2, N5), Wke(3, Xue), Wke(4, ade)], Hke);
var Uke,
  $ke = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let qke = class extends PO {
  static {
    Uke = this;
  }
  static {
    this.ID = "editor.contrib.contentHover";
  }
  constructor(e, t, n, i) {
    (super(),
      (this._editor = e),
      (this._instantiationService = n),
      (this._keybindingService = i),
      (this._onHoverContentsChanged = this._register(new QO())),
      (this.shouldKeepOpenOnEditorMouseMoveOrLeave = !1),
      (this._listenersStore = new AO()),
      (this._isMouseDown = !1),
      (this._ignoreMouseEvents = !1),
      (this._reactToEditorMouseMoveRunner = this._register(
        new EM(() => {
          this._mouseMoveEvent && this._reactToEditorMouseMove(this._mouseMoveEvent);
        }, 0),
      )),
      this._register(
        t.onDidShowContextMenu(() => {
          (this.hideContentHover(), (this._ignoreMouseEvents = !0));
        }),
      ),
      this._register(
        t.onDidHideContextMenu(() => {
          this._ignoreMouseEvents = !1;
        }),
      ),
      this._hookListeners(),
      this._register(
        this._editor.onDidChangeConfiguration((e) => {
          e.hasChanged(69) && (this._unhookListeners(), this._hookListeners());
        }),
      ));
  }
  static get(e) {
    return e.getContribution(Uke.ID);
  }
  _hookListeners() {
    const e = this._editor.getOption(69);
    ((this._hoverSettings = { enabled: e.enabled, sticky: e.sticky, hidingDelay: e.hidingDelay }),
      e.enabled || this._cancelSchedulerAndHide(),
      this._listenersStore.add(this._editor.onMouseDown((e) => this._onEditorMouseDown(e))),
      this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())),
      this._listenersStore.add(this._editor.onMouseMove((e) => this._onEditorMouseMove(e))),
      this._listenersStore.add(this._editor.onKeyDown((e) => this._onKeyDown(e))),
      this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e))),
      this._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide())),
      this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())),
      this._listenersStore.add(
        this._editor.onDidScrollChange((e) => this._onEditorScrollChanged(e)),
      ));
  }
  _unhookListeners() {
    this._listenersStore.clear();
  }
  _cancelSchedulerAndHide() {
    (this._cancelScheduler(), this.hideContentHover());
  }
  _cancelScheduler() {
    ((this._mouseMoveEvent = void 0), this._reactToEditorMouseMoveRunner.cancel());
  }
  _onEditorScrollChanged(e) {
    this._ignoreMouseEvents ||
      ((e.scrollTopChanged || e.scrollLeftChanged) && this.hideContentHover());
  }
  _onEditorMouseDown(e) {
    if (this._ignoreMouseEvents) return;
    this._isMouseDown = !0;
    this._shouldKeepHoverWidgetVisible(e) || this.hideContentHover();
  }
  _shouldKeepHoverWidgetVisible(e) {
    return this._isMouseOnContentHoverWidget(e) || this._isContentWidgetResizing() || zke(e);
  }
  _isMouseOnContentHoverWidget(e) {
    return (
      !!this._contentWidget && c_e(this._contentWidget.getDomNode(), e.event.posx, e.event.posy)
    );
  }
  _onEditorMouseUp() {
    this._ignoreMouseEvents || (this._isMouseDown = !1);
  }
  _onEditorMouseLeave(e) {
    if (this._ignoreMouseEvents) return;
    if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) return;
    this._cancelScheduler();
    this._shouldKeepHoverWidgetVisible(e) || this.hideContentHover();
  }
  _shouldKeepCurrentHover(e) {
    const t = this._contentWidget;
    if (!t) return !1;
    const n = this._hoverSettings.sticky,
      i = t.isFocused,
      r = t.isResizing,
      o = this._hoverSettings.sticky && t.isVisibleFromKeyboard;
    return (
      this.shouldKeepOpenOnEditorMouseMoveOrLeave ||
      i ||
      r ||
      o ||
      ((e, t) => {
        const n = this._isMouseOnContentHoverWidget(e);
        return t && n;
      })(e, n) ||
      ((e) => {
        const n = t.isColorPickerVisible,
          i = this._isMouseOnContentHoverWidget(e),
          r = n && i,
          o = n && this._isMouseDown;
        return r || o;
      })(e) ||
      ((e, n) => {
        const i = e.event.browserEvent.view;
        return (
          !!i && n && t.containsNode(i.document.activeElement) && !i.getSelection()?.isCollapsed
        );
      })(e, n)
    );
  }
  _onEditorMouseMove(e) {
    if (this._ignoreMouseEvents) return;
    this._mouseMoveEvent = e;
    if (this._shouldKeepCurrentHover(e)) return void this._reactToEditorMouseMoveRunner.cancel();
    this._shouldRescheduleHoverComputation()
      ? this._reactToEditorMouseMoveRunner.isScheduled() ||
        this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay)
      : this._reactToEditorMouseMove(e);
  }
  _shouldRescheduleHoverComputation() {
    const e = this._hoverSettings.hidingDelay;
    return (this._contentWidget?.isVisible ?? !1) && this._hoverSettings.sticky && e > 0;
  }
  _reactToEditorMouseMove(e) {
    if (this._hoverSettings.enabled) {
      if (this._getOrCreateContentWidget().showsOrWillShow(e)) return;
    }
    this.hideContentHover();
  }
  _onKeyDown(e) {
    if (this._ignoreMouseEvents) return;
    if (!this._contentWidget) return;
    const t = this._isPotentialKeyboardShortcut(e),
      n = this._isModifierKeyPressed(e);
    t || n || (this._contentWidget.isFocused && 2 === e.keyCode) || this.hideContentHover();
  }
  _isPotentialKeyboardShortcut(e) {
    if (!this._editor.hasModel() || !this._contentWidget) return !1;
    const t = this._keybindingService.softDispatch(e, this._editor.getDomNode()),
      n = 1 === t.kind,
      i =
        2 === t.kind &&
        (t.commandId === zme || t.commandId === Ume || t.commandId === qme) &&
        this._contentWidget.isVisible;
    return n || i;
  }
  _isModifierKeyPressed(e) {
    return 5 === e.keyCode || 6 === e.keyCode || 57 === e.keyCode || 4 === e.keyCode;
  }
  hideContentHover() {
    o_e.dropDownVisible || this._contentWidget?.hide();
  }
  _getOrCreateContentWidget() {
    return (
      this._contentWidget ||
        ((this._contentWidget = this._instantiationService.createInstance(Hke, this._editor)),
        this._listenersStore.add(
          this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire()),
        )),
      this._contentWidget
    );
  }
  showContentHover(e, t, n, i) {
    this._getOrCreateContentWidget().startShowingAtRange(e, t, n, i);
  }
  _isContentWidgetResizing() {
    return this._contentWidget?.widget.isResizing || !1;
  }
  focusedHoverPartIndex() {
    return this._getOrCreateContentWidget().focusedHoverPartIndex();
  }
  updateHoverVerbosityLevel(e, t, n) {
    this._getOrCreateContentWidget().updateHoverVerbosityLevel(e, t, n);
  }
  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());
  }
};
qke = Uke = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([$ke(1, cde), $ke(2, vV), $ke(3, N5)], qke);
class Kke extends PO {
  static {
    this.ID = "editor.contrib.colorContribution";
  }
  constructor(e) {
    (super(), (this._editor = e), this._register(e.onMouseDown((e) => this.onMouseDown(e))));
  }
  dispose() {
    super.dispose();
  }
  onMouseDown(e) {
    const t = this._editor.getOption(168);
    if ("click" !== t && "clickAndHover" !== t) return;
    if (!zke(e)) return;
    const n = this._editor.getContribution(qke.ID);
    if (!n) return;
    if (n.isColorPickerVisible) return;
    const i = e.target.range;
    if (!i) return;
    const r = new YH(i.startLineNumber, i.startColumn + 1, i.endLineNumber, i.endColumn + 1);
    n.showContentHover(r, 1, 1, !1);
  }
}
class Gke {
  constructor(e, t, n, i) {
    ((this.owner = e), (this.range = t), (this.model = n), (this.provider = i));
  }
  static fromBaseColor(e, t) {
    return new Gke(e, t.range, t.model, t.provider);
  }
}
class Zke extends PO {
  constructor(e, t, n, i) {
    super();
    const r = e.getModel(),
      o = n.model;
    ((this.color = n.model.color),
      (this.colorPicker = this._register(
        new oye(t.fragment, o, e.getOption(163), i, "standalone"),
      )),
      this._register(
        o.onColorFlushed((e) => {
          this.color = e;
        }),
      ),
      this._register(
        o.onDidChangeColor((e) => {
          cye(r, o, e, n.range, n);
        }),
      ),
      this._register(
        e.onDidChangeModelContent((n) => {
          (t.hide(), e.focus());
        }),
      ),
      cye(r, o, this.color, n.range, n));
  }
}
let Yke = class {
  constructor(e, t) {
    ((this._editor = e), (this._themeService = t));
  }
  async createColorHover(e, t, n) {
    if (!this._editor.hasModel()) return null;
    if (!Wme.get(this._editor)) return null;
    const i = await Ime(n, this._editor.getModel(), aM.None);
    let r = null,
      o = null;
    for (const c of i) {
      const t = c.colorInfo;
      YH.containsRange(t.range, e.range) && ((r = t), (o = c.provider));
    }
    const s = r ?? e,
      a = o ?? t,
      l = !!r;
    return {
      colorHover: Gke.fromBaseColor(this, await aye(this._editor.getModel(), s, a)),
      foundInEditor: l,
    };
  }
  async updateEditorModel(e) {
    if (!this._editor.hasModel()) return;
    const t = e.model;
    let n = new YH(
      e.range.startLineNumber,
      e.range.startColumn,
      e.range.endLineNumber,
      e.range.endColumn,
    );
    this._color &&
      (await cye(this._editor.getModel(), t, this._color, n, e), (n = lye(this._editor, n, t)));
  }
  renderHoverParts(e, t) {
    if (0 !== t.length && this._editor.hasModel())
      return (
        this._setMinimumDimensions(e),
        (this._renderedParts = new Zke(this._editor, e, t[0], this._themeService)),
        this._renderedParts
      );
  }
  _setMinimumDimensions(e) {
    const t = this._editor.getOption(75) + 8;
    e.setMinimumDimensions(new oB(302, t));
  }
  get _color() {
    return this._renderedParts?.color;
  }
};
Yke = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, h0),
  ],
  Yke,
);
var Xke,
  Qke = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class Jke {
  constructor(e, t) {
    ((this.value = e), (this.foundInEditor = t));
  }
}
let eEe = class extends PO {
  static {
    Xke = this;
  }
  static {
    this.ID = "editor.contrib.standaloneColorPickerWidget";
  }
  constructor(e, t, n, i, r, o, s, a) {
    (super(),
      (this._editor = e),
      (this._standaloneColorPickerVisible = t),
      (this._standaloneColorPickerFocused = n),
      (this._keybindingService = r),
      (this._languageFeaturesService = o),
      (this._editorWorkerService = s),
      (this._hoverService = a),
      (this.allowEditorOverflow = !0),
      (this._position = void 0),
      (this._body = document.createElement("div")),
      (this._colorHover = null),
      (this._selectionSetInEditor = !1),
      (this._onResult = this._register(new QO())),
      (this.onResult = this._onResult.event),
      (this._renderedHoverParts = this._register(new jO())),
      (this._renderedStatusBar = this._register(new jO())),
      this._standaloneColorPickerVisible.set(!0),
      (this._standaloneColorPickerParticipant = i.createInstance(Yke, this._editor)),
      (this._position = this._editor._getViewModel()?.getPrimaryCursorState().modelState.position));
    const l = this._editor.getSelection(),
      c = l
        ? {
            startLineNumber: l.startLineNumber,
            startColumn: l.startColumn,
            endLineNumber: l.endLineNumber,
            endColumn: l.endColumn,
          }
        : { startLineNumber: 0, endLineNumber: 0, endColumn: 0, startColumn: 0 },
      d = this._register(OB(this._body));
    (this._register(
      d.onDidBlur((e) => {
        this.hide();
      }),
    ),
      this._register(
        d.onDidFocus((e) => {
          this.focus();
        }),
      ),
      this._register(
        this._editor.onDidChangeCursorPosition(() => {
          this._selectionSetInEditor ? (this._selectionSetInEditor = !1) : this.hide();
        }),
      ),
      this._register(
        this._editor.onMouseMove((e) => {
          const t = e.target.element?.classList;
          t && t.contains("colorpicker-color-decoration") && this.hide();
        }),
      ),
      this._register(
        this.onResult((e) => {
          this._render(e.value, e.foundInEditor);
        }),
      ),
      this._start(c),
      (this._body.style.zIndex = "50"),
      this._editor.addContentWidget(this));
  }
  updateEditor() {
    this._colorHover && this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover);
  }
  getId() {
    return Xke.ID;
  }
  getDomNode() {
    return this._body;
  }
  getPosition() {
    if (!this._position) return null;
    const e = this._editor.getOption(69).above;
    return {
      position: this._position,
      secondaryPosition: this._position,
      preference: e ? [1, 2] : [2, 1],
      positionAffinity: 2,
    };
  }
  hide() {
    (this.dispose(),
      this._standaloneColorPickerVisible.set(!1),
      this._standaloneColorPickerFocused.set(!1),
      this._editor.removeContentWidget(this),
      this._editor.focus());
  }
  focus() {
    (this._standaloneColorPickerFocused.set(!0), this._body.focus());
  }
  async _start(e) {
    const t = await this._computeAsync(e);
    t && this._onResult.fire(new Jke(t.result, t.foundInEditor));
  }
  async _computeAsync(e) {
    if (!this._editor.hasModel()) return null;
    const t = { range: e, color: { red: 0, green: 0, blue: 0, alpha: 1 } },
      n = await this._standaloneColorPickerParticipant.createColorHover(
        t,
        new Dme(this._editorWorkerService),
        this._languageFeaturesService.colorProvider,
      );
    return n ? { result: n.colorHover, foundInEditor: n.foundInEditor } : null;
  }
  _render(e, t) {
    const n = document.createDocumentFragment();
    this._renderedStatusBar.value = this._register(
      new T_e(this._keybindingService, this._hoverService),
    );
    const i = {
      fragment: n,
      statusBar: this._renderedStatusBar.value,
      onContentsChanged: () => {},
      setMinimumDimensions: () => {},
      hide: () => this.hide(),
      focus: () => this.focus(),
    };
    if (
      ((this._colorHover = e),
      (this._renderedHoverParts.value = this._standaloneColorPickerParticipant.renderHoverParts(i, [
        e,
      ])),
      !this._renderedHoverParts.value)
    )
      return (this._renderedStatusBar.clear(), void this._renderedHoverParts.clear());
    const r = 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(0.66 * this._editor.getLayoutInfo().width, 500) + "px"),
      (this._body.tabIndex = 0),
      this._body.appendChild(n),
      r.layout());
    const o = r.body,
      s = o.saturationBox.domNode.clientWidth,
      a = o.domNode.clientWidth - s - 22 - 8,
      l = r.body.enterButton;
    l?.onClicked(() => {
      (this.updateEditor(), this.hide());
    });
    const c = r.header;
    c.pickedColorNode.style.width = s + 8 + "px";
    c.originalColorNode.style.width = a + "px";
    const d = r.header.closeButton;
    (d?.onClicked(() => {
      this.hide();
    }),
      t &&
        (l && (l.button.textContent = "Replace"),
        (this._selectionSetInEditor = !0),
        this._editor.setSelection(e.range)),
      this._editor.layoutContentWidget(this));
  }
};
eEe = Xke = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Qke(3, vV), Qke(4, N5), Qke(5, mee), Qke(6, Dce), Qke(7, Xue)], eEe);
var tEe,
  nEe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let iEe = class extends PO {
  static {
    tEe = this;
  }
  static {
    this.ID = "editor.contrib.standaloneColorPickerController";
  }
  constructor(e, t, n) {
    (super(),
      (this._editor = e),
      (this._instantiationService = n),
      (this._standaloneColorPickerWidget = null),
      (this._standaloneColorPickerVisible = $$.standaloneColorPickerVisible.bindTo(t)),
      (this._standaloneColorPickerFocused = $$.standaloneColorPickerFocused.bindTo(t)));
  }
  showOrFocus() {
    this._editor.hasModel() &&
      (this._standaloneColorPickerVisible.get()
        ? this._standaloneColorPickerFocused.get() || this._standaloneColorPickerWidget?.focus()
        : (this._standaloneColorPickerWidget = this._instantiationService.createInstance(
            eEe,
            this._editor,
            this._standaloneColorPickerVisible,
            this._standaloneColorPickerFocused,
          )));
  }
  hide() {
    (this._standaloneColorPickerFocused.set(!1),
      this._standaloneColorPickerVisible.set(!1),
      this._standaloneColorPickerWidget?.hide(),
      this._editor.focus());
  }
  insertColor() {
    (this._standaloneColorPickerWidget?.updateEditor(), this.hide());
  }
  static get(e) {
    return e.getContribution(tEe.ID);
  }
};
iEe = tEe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([nEe(1, xW), nEe(2, vV)], iEe);
(VH(
  class extends AH {
    constructor() {
      super({
        id: "editor.action.hideColorPicker",
        label: EI(891, "Hide the Color Picker"),
        precondition: $$.standaloneColorPickerVisible.isEqualTo(!0),
        kbOpts: { primary: 9, weight: 100 },
        metadata: { description: EI(892, "Hide the standalone color picker.") },
      });
    }
    run(e, t) {
      iEe.get(t)?.hide();
    }
  },
),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.insertColorWithStandaloneColorPicker",
          label: EI(893, "Insert Color with Standalone Color Picker"),
          precondition: $$.standaloneColorPickerFocused.isEqualTo(!0),
          kbOpts: { primary: 3, weight: 100 },
          metadata: {
            description: EI(
              894,
              "Insert hex/rgb/hsl colors with the focused standalone color picker.",
            ),
          },
        });
      }
      run(e, t) {
        iEe.get(t)?.insertColor();
      }
    },
  ),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "editor.action.showOrFocusStandaloneColorPicker",
          title: {
            ...EI(889, "Show or Focus Standalone Color Picker"),
            mnemonicTitle: SI(888, "&&Show or Focus Standalone Color Picker"),
          },
          precondition: void 0,
          menu: [{ id: MW.CommandPalette }],
          metadata: {
            description: EI(
              890,
              "Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.",
            ),
          },
        });
      }
      runEditorCommand(e, t) {
        iEe.get(t)?.showOrFocus();
      }
    },
  ),
  zH(Kke.ID, Kke, 2),
  zH(iEe.ID, iEe, 1),
  zH(Wme.ID, Wme, 1),
  xme(Tme),
  Eme.register(uye),
  jV.registerCommand("_executeDocumentColorProvider", function (e, ...t) {
    const [n] = t;
    if (!(n instanceof mP)) throw GI();
    const { model: i, colorProviderRegistry: r, defaultColorDecoratorsEnablement: o } = jme(e, n);
    return Pme(new Mme(), r, i, aM.None, o);
  }),
  jV.registerCommand("_executeColorPresentationProvider", function (e, ...t) {
    const [n, i] = t;
    if (!i) return;
    const { uri: r, range: o } = i;
    if (!(r instanceof mP && Array.isArray(n) && 4 === n.length && YH.isIRange(o))) throw GI();
    const { model: s, colorProviderRegistry: a, defaultColorDecoratorsEnablement: l } = jme(e, r),
      [c, d, u, h] = n;
    return Pme(
      new Ame({ range: o, color: { red: c, green: d, blue: u, alpha: h } }),
      a,
      s,
      aM.None,
      l,
    );
  }));
class rEe {
  constructor(e, t, n) {
    ((this.languageConfigurationService = n),
      (this._selection = e),
      (this._insertSpace = t),
      (this._usedEndToken = null));
  }
  static _haystackHasNeedleAtOffset(e, t, n) {
    if (n < 0) return !1;
    const i = t.length;
    if (n + i > e.length) return !1;
    for (let r = 0; r < i; r++) {
      const i = e.charCodeAt(n + r),
        o = t.charCodeAt(r);
      if (
        i !== o &&
        !((i >= 65 && i <= 90 && i + 32 === o) || (o >= 65 && o <= 90 && o + 32 === i))
      )
        return !1;
    }
    return !0;
  }
  _createOperationsForBlockComment(e, t, n, i, r, o) {
    const s = e.startLineNumber,
      a = e.startColumn,
      l = e.endLineNumber,
      c = e.endColumn,
      d = r.getLineContent(s),
      u = r.getLineContent(l);
    let h,
      g = d.lastIndexOf(t, a - 1 + t.length),
      p = u.indexOf(n, c - 1 - n.length);
    if (-1 !== g && -1 !== p)
      if (s === l) {
        d.substring(g + t.length, p).indexOf(n) >= 0 && ((g = -1), (p = -1));
      } else {
        const e = d.substring(g + t.length),
          i = u.substring(0, p);
        (e.indexOf(n) >= 0 || i.indexOf(n) >= 0) && ((g = -1), (p = -1));
      }
    -1 !== g && -1 !== p
      ? (i && g + t.length < d.length && 32 === d.charCodeAt(g + t.length) && (t += " "),
        i && p > 0 && 32 === u.charCodeAt(p - 1) && ((n = " " + n), (p -= 1)),
        (h = rEe._createRemoveBlockCommentOperations(new YH(s, g + t.length + 1, l, p + 1), t, n)))
      : ((h = rEe._createAddBlockCommentOperations(e, t, n, this._insertSpace)),
        (this._usedEndToken = 1 === h.length ? n : null));
    for (const f of h) o.addTrackedEditOperation(f.range, f.text);
  }
  static _createRemoveBlockCommentOperations(e, t, n) {
    const i = [];
    return (
      YH.isEmpty(e)
        ? i.push(
            hye.delete(
              new YH(
                e.startLineNumber,
                e.startColumn - t.length,
                e.endLineNumber,
                e.endColumn + n.length,
              ),
            ),
          )
        : (i.push(
            hye.delete(
              new YH(e.startLineNumber, e.startColumn - t.length, e.startLineNumber, e.startColumn),
            ),
          ),
          i.push(
            hye.delete(
              new YH(e.endLineNumber, e.endColumn, e.endLineNumber, e.endColumn + n.length),
            ),
          )),
      i
    );
  }
  static _createAddBlockCommentOperations(e, t, n, i) {
    const r = [];
    return (
      YH.isEmpty(e)
        ? r.push(
            hye.replace(
              new YH(e.startLineNumber, e.startColumn, e.endLineNumber, e.endColumn),
              t + "  " + n,
            ),
          )
        : (r.push(hye.insert(new xV(e.startLineNumber, e.startColumn), t + (i ? " " : ""))),
          r.push(hye.insert(new xV(e.endLineNumber, e.endColumn), (i ? " " : "") + n))),
      r
    );
  }
  getEditOperations(e, t) {
    const n = this._selection.startLineNumber,
      i = this._selection.startColumn;
    e.tokenization.tokenizeIfCheap(n);
    const r = e.getLanguageIdAtPosition(n, i),
      o = this.languageConfigurationService.getLanguageConfiguration(r).comments;
    o &&
      o.blockCommentStartToken &&
      o.blockCommentEndToken &&
      this._createOperationsForBlockComment(
        this._selection,
        o.blockCommentStartToken,
        o.blockCommentEndToken,
        this._insertSpace,
        e,
        t,
      );
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations();
    if (2 === n.length) {
      const e = n[0],
        t = n[1];
      return new XH(
        e.range.endLineNumber,
        e.range.endColumn,
        t.range.startLineNumber,
        t.range.startColumn,
      );
    }
    {
      const e = n[0].range,
        t = this._usedEndToken ? -this._usedEndToken.length - 1 : 0;
      return new XH(e.endLineNumber, e.endColumn + t, e.endLineNumber, e.endColumn + t);
    }
  }
}
class oEe {
  constructor(e, t, n, i, r, o, s) {
    ((this.languageConfigurationService = e),
      (this._selection = t),
      (this._indentSize = n),
      (this._type = i),
      (this._insertSpace = r),
      (this._selectionId = null),
      (this._deltaColumn = 0),
      (this._moveEndPositionDown = !1),
      (this._ignoreEmptyLines = o),
      (this._ignoreFirstLine = s || !1));
  }
  static _gatherPreflightCommentStrings(e, t, n, i) {
    e.tokenization.tokenizeIfCheap(t);
    const r = e.getLanguageIdAtPosition(t, 1),
      o = i.getLanguageConfiguration(r).comments,
      s = o ? o.lineCommentToken : null;
    if (!s) return null;
    const a = [];
    for (let l = 0, c = n - t + 1; l < c; l++)
      a[l] = { ignore: !1, commentStr: s, commentStrOffset: 0, commentStrLength: s.length };
    return a;
  }
  static _analyzeLines(e, t, n, i, r, o, s, a, l) {
    let c = !0;
    const d = a.getLanguageConfiguration(l).comments,
      u = d?.lineCommentNoIndent ?? !1;
    let h;
    h = 0 === e || 1 !== e;
    for (let g = 0, p = i.length; g < p; g++) {
      const a = i[g],
        l = r + g;
      if (l === r && s) {
        a.ignore = !0;
        continue;
      }
      const d = n.getLineContent(l),
        p = YM(d);
      if (-1 === p) {
        ((a.ignore = o), (a.commentStrOffset = u ? 0 : d.length));
        continue;
      }
      c = !1;
      const f = u ? 0 : p;
      if (
        ((a.ignore = !1),
        (a.commentStrOffset = f),
        h &&
          !rEe._haystackHasNeedleAtOffset(d, a.commentStr, f) &&
          (0 === e ? (h = !1) : 1 === e || (a.ignore = !0)),
        h && t)
      ) {
        const e = p + a.commentStrLength;
        e < d.length && 32 === d.charCodeAt(e) && (a.commentStrLength += 1);
      }
    }
    if (0 === e && c) {
      h = !1;
      for (let e = 0, t = i.length; e < t; e++) i[e].ignore = !1;
    }
    return { supported: !0, shouldRemoveComments: h, lines: i };
  }
  static _gatherPreflightData(e, t, n, i, r, o, s, a) {
    const l = oEe._gatherPreflightCommentStrings(n, i, r, a),
      c = n.getLanguageIdAtPosition(i, 1);
    return null === l ? { supported: !1 } : oEe._analyzeLines(e, t, n, l, i, o, s, a, c);
  }
  _executeLineComments(e, t, n, i) {
    let r;
    n.shouldRemoveComments
      ? (r = oEe._createRemoveLineCommentsOperations(n.lines, i.startLineNumber))
      : (oEe._normalizeInsertionPoint(e, n.lines, i.startLineNumber, this._indentSize),
        (r = this._createAddLineCommentsOperations(n.lines, i.startLineNumber)));
    const o = new xV(i.positionLineNumber, i.positionColumn);
    for (let s = 0, a = r.length; s < a; s++)
      if (
        (t.addEditOperation(r[s].range, r[s].text),
        YH.isEmpty(r[s].range) && YH.getStartPosition(r[s].range).equals(o))
      ) {
        e.getLineContent(o.lineNumber).length + 1 === o.column &&
          (this._deltaColumn = (r[s].text || "").length);
      }
    this._selectionId = t.trackSelection(i);
  }
  _attemptRemoveBlockComment(e, t, n, i) {
    let r = t.startLineNumber,
      o = t.endLineNumber;
    const s =
      i.length + Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber), t.startColumn);
    let a = e.getLineContent(r).lastIndexOf(n, s - 1),
      l = e.getLineContent(o).indexOf(i, t.endColumn - 1 - n.length);
    return (
      -1 !== a && -1 === l && ((l = e.getLineContent(r).indexOf(i, a + n.length)), (o = r)),
      -1 === a && -1 !== l && ((a = e.getLineContent(o).lastIndexOf(n, l)), (r = o)),
      !t.isEmpty() ||
        (-1 !== a && -1 !== l) ||
        ((a = e.getLineContent(r).indexOf(n)),
        -1 !== a && (l = e.getLineContent(r).indexOf(i, a + n.length))),
      -1 !== a && 32 === e.getLineContent(r).charCodeAt(a + n.length) && (n += " "),
      -1 !== l && 32 === e.getLineContent(o).charCodeAt(l - 1) && ((i = " " + i), (l -= 1)),
      -1 !== a && -1 !== l
        ? rEe._createRemoveBlockCommentOperations(new YH(r, a + n.length + 1, o, l + 1), n, i)
        : null
    );
  }
  _executeBlockComment(e, t, n) {
    e.tokenization.tokenizeIfCheap(n.startLineNumber);
    const i = e.getLanguageIdAtPosition(n.startLineNumber, 1),
      r = this.languageConfigurationService.getLanguageConfiguration(i).comments;
    if (!r || !r.blockCommentStartToken || !r.blockCommentEndToken) return;
    const o = r.blockCommentStartToken,
      s = r.blockCommentEndToken;
    let a = this._attemptRemoveBlockComment(e, n, o, s);
    if (!a) {
      if (n.isEmpty()) {
        const t = e.getLineContent(n.startLineNumber);
        let i = YM(t);
        (-1 === i && (i = t.length),
          (a = rEe._createAddBlockCommentOperations(
            new YH(n.startLineNumber, i + 1, n.startLineNumber, t.length + 1),
            o,
            s,
            this._insertSpace,
          )));
      } else
        a = rEe._createAddBlockCommentOperations(
          new YH(
            n.startLineNumber,
            e.getLineFirstNonWhitespaceColumn(n.startLineNumber),
            n.endLineNumber,
            e.getLineMaxColumn(n.endLineNumber),
          ),
          o,
          s,
          this._insertSpace,
        );
      1 === a.length && (this._deltaColumn = o.length + 1);
    }
    this._selectionId = t.trackSelection(n);
    for (const l of a) t.addEditOperation(l.range, l.text);
  }
  getEditOperations(e, t) {
    let n = this._selection;
    if (
      ((this._moveEndPositionDown = !1),
      n.startLineNumber === n.endLineNumber && this._ignoreFirstLine)
    )
      return (
        t.addEditOperation(
          new YH(
            n.startLineNumber,
            e.getLineMaxColumn(n.startLineNumber),
            n.startLineNumber + 1,
            1,
          ),
          n.startLineNumber === e.getLineCount() ? "" : "\n",
        ),
        void (this._selectionId = t.trackSelection(n))
      );
    n.startLineNumber < n.endLineNumber &&
      1 === n.endColumn &&
      ((this._moveEndPositionDown = !0),
      (n = n.setEndPosition(n.endLineNumber - 1, e.getLineMaxColumn(n.endLineNumber - 1))));
    const i = oEe._gatherPreflightData(
      this._type,
      this._insertSpace,
      e,
      n.startLineNumber,
      n.endLineNumber,
      this._ignoreEmptyLines,
      this._ignoreFirstLine,
      this.languageConfigurationService,
    );
    return i.supported ? this._executeLineComments(e, t, i, n) : this._executeBlockComment(e, t, n);
  }
  computeCursorState(e, t) {
    let n = t.getTrackedSelection(this._selectionId);
    return (
      this._moveEndPositionDown && (n = n.setEndPosition(n.endLineNumber + 1, 1)),
      new XH(
        n.selectionStartLineNumber,
        n.selectionStartColumn + this._deltaColumn,
        n.positionLineNumber,
        n.positionColumn + this._deltaColumn,
      )
    );
  }
  static _createRemoveLineCommentsOperations(e, t) {
    const n = [];
    for (let i = 0, r = e.length; i < r; i++) {
      const r = e[i];
      r.ignore ||
        n.push(
          hye.delete(
            new YH(
              t + i,
              r.commentStrOffset + 1,
              t + i,
              r.commentStrOffset + r.commentStrLength + 1,
            ),
          ),
        );
    }
    return n;
  }
  _createAddLineCommentsOperations(e, t) {
    const n = [],
      i = this._insertSpace ? " " : "";
    for (let r = 0, o = e.length; r < o; r++) {
      const o = e[r];
      o.ignore || n.push(hye.insert(new xV(t + r, o.commentStrOffset + 1), o.commentStr + i));
    }
    return n;
  }
  static nextVisibleColumn(e, t, n, i) {
    return n ? e + (t - (e % t)) : e + i;
  }
  static _normalizeInsertionPoint(e, t, n, i) {
    let r,
      o,
      s = 1073741824;
    for (let a = 0, l = t.length; a < l; a++) {
      if (t[a].ignore) continue;
      const r = e.getLineContent(n + a);
      let o = 0;
      for (let e = 0, n = t[a].commentStrOffset; o < s && e < n; e++)
        o = oEe.nextVisibleColumn(o, i, 9 === r.charCodeAt(e), 1);
      o < s && (s = o);
    }
    s = Math.floor(s / i) * i;
    for (let a = 0, l = t.length; a < l; a++) {
      if (t[a].ignore) continue;
      const l = e.getLineContent(n + a);
      let c = 0;
      for (r = 0, o = t[a].commentStrOffset; c < s && r < o; r++)
        c = oEe.nextVisibleColumn(c, i, 9 === l.charCodeAt(r), 1);
      t[a].commentStrOffset = c > s ? r - 1 : r;
    }
  }
}
class sEe extends AH {
  constructor(e, t) {
    (super(t), (this._type = e));
  }
  run(e, t) {
    const n = e.get(f$);
    if (!t.hasModel()) return;
    const i = [],
      r = t.getModel().getOptions(),
      o = t.getOption(29),
      s = t.getSelections().map((e, t) => ({ selection: e, index: t, ignoreFirstLine: !1 }));
    s.sort((e, t) => YH.compareRangesUsingStarts(e.selection, t.selection));
    let a = s[0];
    for (let l = 1; l < s.length; l++) {
      const e = s[l];
      a.selection.endLineNumber === e.selection.startLineNumber &&
        (a.index < e.index ? (e.ignoreFirstLine = !0) : ((a.ignoreFirstLine = !0), (a = e)));
    }
    for (const l of s)
      i.push(
        new oEe(
          n,
          l.selection,
          r.indentSize,
          this._type,
          o.insertSpace,
          o.ignoreEmptyLines,
          l.ignoreFirstLine,
        ),
      );
    (t.pushUndoStop(), t.executeCommands(this.id, i), t.pushUndoStop());
  }
}
(VH(
  class extends sEe {
    constructor() {
      super(0, {
        id: "editor.action.commentLine",
        label: EI(897, "Toggle Line Comment"),
        precondition: $$.writable,
        kbOpts: { kbExpr: $$.editorTextFocus, primary: 2138, weight: 100 },
        menuOpts: {
          menuId: MW.MenubarEditMenu,
          group: "5_insert",
          title: SI(895, "&&Toggle Line Comment"),
          order: 1,
        },
        canTriggerInlineEdits: !0,
      });
    }
  },
),
  VH(
    class extends sEe {
      constructor() {
        super(1, {
          id: "editor.action.addCommentLine",
          label: EI(898, "Add Line Comment"),
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2081), weight: 100 },
          canTriggerInlineEdits: !0,
        });
      }
    },
  ),
  VH(
    class extends sEe {
      constructor() {
        super(2, {
          id: "editor.action.removeCommentLine",
          label: EI(899, "Remove Line Comment"),
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2099), weight: 100 },
          canTriggerInlineEdits: !0,
        });
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.blockComment",
          label: EI(900, "Toggle Block Comment"),
          precondition: $$.writable,
          kbOpts: {
            kbExpr: $$.editorTextFocus,
            primary: 1567,
            linux: { primary: 3103 },
            weight: 100,
          },
          menuOpts: {
            menuId: MW.MenubarEditMenu,
            group: "5_insert",
            title: SI(896, "Toggle &&Block Comment"),
            order: 2,
          },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        const n = e.get(f$);
        if (!t.hasModel()) return;
        const i = t.getOption(29),
          r = [],
          o = t.getSelections();
        for (const s of o) r.push(new rEe(s, i.insertSpace, n));
        (t.pushUndoStop(), t.executeCommands(this.id, r), t.pushUndoStop());
      }
    },
  ));
var aEe,
  lEe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let cEe = class {
  static {
    aEe = this;
  }
  static {
    this.ID = "editor.contrib.contextmenu";
  }
  static get(e) {
    return e.getContribution(aEe.ID);
  }
  constructor(e, t, n, i, r, o, s, a) {
    ((this._contextMenuService = t),
      (this._contextViewService = n),
      (this._contextKeyService = i),
      (this._keybindingService = r),
      (this._menuService = o),
      (this._configurationService = s),
      (this._workspaceContextService = a),
      (this._toDispose = new AO()),
      (this._contextMenuIsBeingShownCount = 0),
      (this._editor = e),
      this._toDispose.add(this._editor.onContextMenu((e) => this._onContextMenu(e))),
      this._toDispose.add(
        this._editor.onMouseWheel((e) => {
          if (this._contextMenuIsBeingShownCount > 0) {
            const t = this._contextViewService.getContextViewElement(),
              n = e.srcElement;
            (n.shadowRoot && _B(t) === n.shadowRoot) || this._contextViewService.hideContextView();
          }
        }),
      ),
      this._toDispose.add(
        this._editor.onKeyDown((e) => {
          this._editor.getOption(30) &&
            58 === e.keyCode &&
            (e.preventDefault(), e.stopPropagation(), this.showContextMenu());
        }),
      ));
  }
  _onContextMenu(e) {
    if (!this._editor.hasModel()) return;
    if (!this._editor.getOption(30))
      return (
        this._editor.focus(),
        void (
          e.target.position &&
          !this._editor.getSelection().containsPosition(e.target.position) &&
          this._editor.setPosition(e.target.position)
        )
      );
    if (12 === e.target.type) return;
    if (6 === e.target.type && e.target.detail.injectedText) return;
    if ((e.event.preventDefault(), e.event.stopPropagation(), 11 === e.target.type))
      return this._showScrollbarContextMenu(e.event);
    if (6 !== e.target.type && 7 !== e.target.type && 1 !== e.target.type) return;
    if ((this._editor.focus(), e.target.position)) {
      let t = !1;
      for (const n of this._editor.getSelections())
        if (n.containsPosition(e.target.position)) {
          t = !0;
          break;
        }
      t || this._editor.setPosition(e.target.position);
    }
    let t = null;
    (1 !== e.target.type && (t = e.event), this.showContextMenu(t));
  }
  showContextMenu(e) {
    if (!this._editor.getOption(30)) return;
    if (!this._editor.hasModel()) return;
    const t = this._getMenuActions(this._editor.getModel(), this._editor.contextMenuId);
    t.length > 0 && this._doShowContextMenu(t, e);
  }
  _getMenuActions(e, t) {
    const n = [],
      i = this._menuService.getMenuActions(t, this._contextKeyService, { arg: e.uri });
    for (const r of i) {
      const [, t] = r;
      let i = 0;
      for (const r of t)
        if (r instanceof FW) {
          const t = this._getMenuActions(e, r.item.submenu);
          t.length > 0 && (n.push(new NV(r.id, r.label, t)), i++);
        } else (n.push(r), i++);
      i && n.push(new EV());
    }
    return (n.length && n.pop(), n);
  }
  _doShowContextMenu(e, t = null) {
    if (!this._editor.hasModel()) return;
    let n = t;
    if (!n) {
      (this._editor.revealPosition(this._editor.getPosition(), 1), this._editor.render());
      const e = this._editor.getScrolledVisiblePosition(this._editor.getPosition()),
        t = aB(this._editor.getDomNode()),
        i = t.left + e.left,
        r = t.top + e.top + e.height;
      n = { x: i, y: r };
    }
    const i = this._editor.getOption(144) && !WR;
    (this._contextMenuIsBeingShownCount++,
      this._contextMenuService.showContextMenu({
        domForShadowRoot: i
          ? (this._editor.getOverflowWidgetsDomNode() ?? this._editor.getDomNode())
          : void 0,
        getAnchor: () => n,
        getActions: () => e,
        getActionViewItem: (e) => {
          const t = this._keybindingFor(e);
          if (t) return new xle(e, e, { label: !0, keybinding: t.getLabel(), isMenu: !0 });
          const n = e;
          return "function" == typeof n.getActionViewItem
            ? n.getActionViewItem()
            : new xle(e, e, { icon: !0, label: !0, isMenu: !0 });
        },
        getKeyBinding: (e) => this._keybindingFor(e),
        onHide: (e) => {
          this._contextMenuIsBeingShownCount--;
        },
      }));
  }
  _showScrollbarContextMenu(e) {
    if (!this._editor.hasModel()) return;
    if (this._workspaceContextService.getWorkspace().id === Fge) return;
    const t = this._editor.getOption(81);
    let n = 0;
    const i = (e) => ({
        id: "menu-action-" + ++n,
        label: e.label,
        tooltip: "",
        class: void 0,
        enabled: void 0 === e.enabled || e.enabled,
        checked: e.checked,
        run: e.run,
      }),
      r = (e, t, r, o, s) => {
        if (!t) return i({ label: e, enabled: t, run: () => {} });
        const a = (e) => () => {
            this._configurationService.updateValue(r, e);
          },
          l = [];
        for (const n of s) l.push(i({ label: n.label, checked: o === n.value, run: a(n.value) }));
        return ((e, t) => new NV("menu-action-" + ++n, e, t, void 0))(e, l);
      },
      o = [];
    (o.push(
      i({
        label: SI(901, "Minimap"),
        checked: t.enabled,
        run: () => {
          this._configurationService.updateValue("editor.minimap.enabled", !t.enabled);
        },
      }),
    ),
      o.push(new EV()),
      o.push(
        i({
          label: SI(902, "Render Characters"),
          enabled: t.enabled,
          checked: t.renderCharacters,
          run: () => {
            this._configurationService.updateValue(
              "editor.minimap.renderCharacters",
              !t.renderCharacters,
            );
          },
        }),
      ),
      o.push(
        r(SI(903, "Vertical size"), t.enabled, "editor.minimap.size", t.size, [
          { label: SI(904, "Proportional"), value: "proportional" },
          { label: SI(905, "Fill"), value: "fill" },
          { label: SI(906, "Fit"), value: "fit" },
        ]),
      ),
      o.push(
        r(SI(907, "Slider"), t.enabled, "editor.minimap.showSlider", t.showSlider, [
          { label: SI(908, "Mouse Over"), value: "mouseover" },
          { label: SI(909, "Always"), value: "always" },
        ]),
      ));
    const s = this._editor.getOption(144) && !WR;
    (this._contextMenuIsBeingShownCount++,
      this._contextMenuService.showContextMenu({
        domForShadowRoot: s ? this._editor.getDomNode() : void 0,
        getAnchor: () => e,
        getActions: () => o,
        onHide: (e) => {
          (this._contextMenuIsBeingShownCount--, this._editor.focus());
        },
      }));
  }
  _keybindingFor(e) {
    return this._keybindingService.lookupKeybinding(e.id);
  }
  dispose() {
    (this._contextMenuIsBeingShownCount > 0 && this._contextViewService.hideContextView(),
      this._toDispose.dispose());
  }
};
cEe = aEe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([lEe(1, cde), lEe(2, lde), lEe(3, xW), lEe(4, N5), lEe(5, AW), lEe(6, OU), lEe(7, Rge)], cEe);
(zH(cEe.ID, cEe, 2),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.showContextMenu",
          label: EI(910, "Show Editor Context Menu"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 1092, weight: 100 },
        });
      }
      run(e, t) {
        cEe.get(t)?.showContextMenu();
      }
    },
  ));
class dEe {
  constructor(e) {
    this.selections = e;
  }
  equals(e) {
    const t = this.selections.length;
    if (t !== e.selections.length) return !1;
    for (let n = 0; n < t; n++) if (!this.selections[n].equalsSelection(e.selections[n])) return !1;
    return !0;
  }
}
class uEe {
  constructor(e, t, n) {
    ((this.cursorState = e), (this.scrollTop = t), (this.scrollLeft = n));
  }
}
class hEe extends PO {
  static {
    this.ID = "editor.contrib.cursorUndoRedoController";
  }
  static get(e) {
    return e.getContribution(hEe.ID);
  }
  constructor(e) {
    (super(),
      (this._editor = e),
      (this._isCursorUndoRedo = !1),
      (this._undoStack = []),
      (this._redoStack = []),
      this._register(
        e.onDidChangeModel((e) => {
          ((this._undoStack = []), (this._redoStack = []));
        }),
      ),
      this._register(
        e.onDidChangeModelContent((e) => {
          ((this._undoStack = []), (this._redoStack = []));
        }),
      ),
      this._register(
        e.onDidChangeCursorSelection((t) => {
          if (this._isCursorUndoRedo) return;
          if (!t.oldSelections) return;
          if (t.oldModelVersionId !== t.modelVersionId) return;
          const n = new dEe(t.oldSelections);
          (this._undoStack.length > 0 &&
            this._undoStack[this._undoStack.length - 1].cursorState.equals(n)) ||
            (this._undoStack.push(new uEe(n, e.getScrollTop(), e.getScrollLeft())),
            (this._redoStack = []),
            this._undoStack.length > 50 && this._undoStack.shift());
        }),
      ));
  }
  cursorUndo() {
    this._editor.hasModel() &&
      0 !== this._undoStack.length &&
      (this._redoStack.push(
        new uEe(
          new dEe(this._editor.getSelections()),
          this._editor.getScrollTop(),
          this._editor.getScrollLeft(),
        ),
      ),
      this._applyState(this._undoStack.pop()));
  }
  cursorRedo() {
    this._editor.hasModel() &&
      0 !== this._redoStack.length &&
      (this._undoStack.push(
        new uEe(
          new dEe(this._editor.getSelections()),
          this._editor.getScrollTop(),
          this._editor.getScrollLeft(),
        ),
      ),
      this._applyState(this._redoStack.pop()));
  }
  _applyState(e) {
    ((this._isCursorUndoRedo = !0),
      this._editor.setSelections(e.cursorState.selections),
      this._editor.setScrollPosition({ scrollTop: e.scrollTop, scrollLeft: e.scrollLeft }),
      (this._isCursorUndoRedo = !1));
  }
}
(zH(hEe.ID, hEe, 0),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "cursorUndo",
          label: EI(911, "Cursor Undo"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 2099, weight: 100 },
        });
      }
      run(e, t, n) {
        hEe.get(t)?.cursorUndo();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({ id: "cursorRedo", label: EI(912, "Cursor Redo"), precondition: void 0 });
      }
      run(e, t, n) {
        hEe.get(t)?.cursorRedo();
      }
    },
  ));
class gEe {
  constructor(e, t, n) {
    ((this.selection = e),
      (this.targetPosition = t),
      (this.copy = n),
      (this.targetSelection = null));
  }
  getEditOperations(e, t) {
    const n = e.getValueInRange(this.selection);
    (this.copy || t.addEditOperation(this.selection, null),
      t.addEditOperation(
        new YH(
          this.targetPosition.lineNumber,
          this.targetPosition.column,
          this.targetPosition.lineNumber,
          this.targetPosition.column,
        ),
        n,
      ),
      !this.selection.containsPosition(this.targetPosition) ||
      (this.copy &&
        (this.selection.getEndPosition().equals(this.targetPosition) ||
          this.selection.getStartPosition().equals(this.targetPosition)))
        ? this.copy
          ? (this.targetSelection = new XH(
              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,
            ))
          : this.targetPosition.lineNumber > this.selection.endLineNumber
            ? (this.targetSelection = new XH(
                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,
              ))
            : this.targetPosition.lineNumber < this.selection.endLineNumber
              ? (this.targetSelection = new XH(
                  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,
                ))
              : this.selection.endColumn <= this.targetPosition.column
                ? (this.targetSelection = new XH(
                    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 XH(
                    this.targetPosition.lineNumber -
                      this.selection.endLineNumber +
                      this.selection.startLineNumber,
                    this.targetPosition.column,
                    this.targetPosition.lineNumber,
                    this.targetPosition.column +
                      this.selection.endColumn -
                      this.selection.startColumn,
                  ))
        : (this.targetSelection = this.selection));
  }
  computeCursorState(e, t) {
    return this.targetSelection;
  }
}
function pEe(e) {
  return PR ? e.altKey : e.ctrlKey;
}
class fEe extends PO {
  static {
    this.ID = "editor.contrib.dragAndDrop";
  }
  static {
    this.TRIGGER_KEY_VALUE = PR ? 6 : 5;
  }
  constructor(e) {
    (super(),
      (this._editor = e),
      (this._dndDecorationIds = this._editor.createDecorationsCollection()),
      this._register(this._editor.onMouseDown((e) => this._onEditorMouseDown(e))),
      this._register(this._editor.onMouseUp((e) => this._onEditorMouseUp(e))),
      this._register(this._editor.onMouseDrag((e) => this._onEditorMouseDrag(e))),
      this._register(this._editor.onMouseDrop((e) => this._onEditorMouseDrop(e))),
      this._register(this._editor.onMouseDropCanceled(() => this._onEditorMouseDropCanceled())),
      this._register(this._editor.onKeyDown((e) => this.onEditorKeyDown(e))),
      this._register(this._editor.onKeyUp((e) => this.onEditorKeyUp(e))),
      this._register(this._editor.onDidBlurEditorWidget(() => this.onEditorBlur())),
      this._register(this._editor.onDidBlurEditorText(() => this.onEditorBlur())),
      (this._mouseDown = !1),
      (this._modifierPressed = !1),
      (this._dragSelection = null));
  }
  onEditorBlur() {
    (this._removeDecoration(),
      (this._dragSelection = null),
      (this._mouseDown = !1),
      (this._modifierPressed = !1));
  }
  onEditorKeyDown(e) {
    this._editor.getOption(42) &&
      !this._editor.getOption(28) &&
      (pEe(e) && (this._modifierPressed = !0),
      this._mouseDown && pEe(e) && this._editor.updateOptions({ mouseStyle: "copy" }));
  }
  onEditorKeyUp(e) {
    this._editor.getOption(42) &&
      !this._editor.getOption(28) &&
      (pEe(e) && (this._modifierPressed = !1),
      this._mouseDown &&
        e.keyCode === fEe.TRIGGER_KEY_VALUE &&
        this._editor.updateOptions({ mouseStyle: "default" }));
  }
  _onEditorMouseDown(e) {
    this._mouseDown = !0;
  }
  _onEditorMouseUp(e) {
    ((this._mouseDown = !1), this._editor.updateOptions({ mouseStyle: "text" }));
  }
  _onEditorMouseDrag(e) {
    const t = e.target;
    if (null === this._dragSelection) {
      const e = (this._editor.getSelections() || []).filter(
        (e) => t.position && e.containsPosition(t.position),
      );
      if (1 !== e.length) return;
      this._dragSelection = e[0];
    }
    (pEe(e.event)
      ? this._editor.updateOptions({ mouseStyle: "copy" })
      : this._editor.updateOptions({ mouseStyle: "default" }),
      t.position &&
        (this._dragSelection.containsPosition(t.position)
          ? this._removeDecoration()
          : this.showAt(t.position)));
  }
  _onEditorMouseDropCanceled() {
    (this._editor.updateOptions({ mouseStyle: "text" }),
      this._removeDecoration(),
      (this._dragSelection = null),
      (this._mouseDown = !1));
  }
  _onEditorMouseDrop(e) {
    if (
      e.target &&
      (this._hitContent(e.target) || this._hitMargin(e.target)) &&
      e.target.position
    ) {
      const t = new xV(e.target.position.lineNumber, e.target.position.column);
      if (null === this._dragSelection) {
        let n = null;
        if (e.event.shiftKey) {
          const e = this._editor.getSelection();
          if (e) {
            const { selectionStartLineNumber: i, selectionStartColumn: r } = e;
            n = [new XH(i, r, t.lineNumber, t.column)];
          }
        } else
          n = (this._editor.getSelections() || []).map((e) =>
            e.containsPosition(t) ? new XH(t.lineNumber, t.column, t.lineNumber, t.column) : e,
          );
        this._editor.setSelections(n || [], "mouse", 3);
      } else
        (!this._dragSelection.containsPosition(t) ||
          ((pEe(e.event) || this._modifierPressed) &&
            (this._dragSelection.getEndPosition().equals(t) ||
              this._dragSelection.getStartPosition().equals(t)))) &&
          (this._editor.pushUndoStop(),
          this._editor.executeCommand(
            fEe.ID,
            new gEe(this._dragSelection, t, pEe(e.event) || this._modifierPressed),
          ),
          this._editor.pushUndoStop());
    }
    (this._editor.updateOptions({ mouseStyle: "text" }),
      this._removeDecoration(),
      (this._dragSelection = null),
      (this._mouseDown = !1));
  }
  static {
    this._DECORATION_OPTIONS = cee.register({ description: "dnd-target", className: "dnd-target" });
  }
  showAt(e) {
    (this._dndDecorationIds.set([
      {
        range: new YH(e.lineNumber, e.column, e.lineNumber, e.column),
        options: fEe._DECORATION_OPTIONS,
      },
    ]),
      this._editor.revealPosition(e, 1));
  }
  _removeDecoration() {
    this._dndDecorationIds.clear();
  }
  _hitContent(e) {
    return 6 === e.type || 7 === e.type;
  }
  _hitMargin(e) {
    return 2 === e.type || 3 === e.type || 4 === e.type;
  }
  dispose() {
    (this._removeDecoration(),
      (this._dragSelection = null),
      (this._mouseDown = !1),
      (this._modifierPressed = !1),
      super.dispose());
  }
}
zH(fEe.ID, fEe, 2);
(zH(Kpe.ID, Kpe, 0),
  xme(Zge),
  BH(
    new (class extends MH {
      constructor() {
        super({ id: Upe, precondition: $pe, kbOpts: { weight: 100, primary: 2137 } });
      }
      runEditorCommand(e, t) {
        return Kpe.get(t)?.changePasteType();
      }
    })(),
  ),
  BH(
    new (class extends MH {
      constructor() {
        super({
          id: "editor.hidePasteWidget",
          precondition: $pe,
          kbOpts: { weight: 100, primary: 9 },
        });
      }
      runEditorCommand(e, t) {
        Kpe.get(t)?.clearWidgets();
      }
    })(),
  ),
  VH(
    class e extends AH {
      static {
        this.argsSchema = {
          oneOf: [
            {
              type: "object",
              required: ["kind"],
              properties: {
                kind: {
                  type: "string",
                  description: SI(
                    913,
                    "The kind of the paste edit to try pasting with.\nIf 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: SI(
                    914,
                    "List of preferred paste edit kind to try applying.\nThe first edit matching the preferences will be applied.",
                  ),
                  items: { type: "string" },
                },
              },
            },
          ],
        };
      }
      constructor() {
        super({
          id: "editor.action.pasteAs",
          label: EI(915, "Paste As..."),
          precondition: $$.writable,
          metadata: { description: "Paste as", args: [{ name: "args", schema: e.argsSchema }] },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t, n) {
        let i;
        return (
          n &&
            ("kind" in n
              ? (i = { only: new Hhe(n.kind) })
              : "preferences" in n && (i = { preferences: n.preferences.map((e) => new Hhe(e)) })),
          Kpe.get(t)?.pasteAs(i)
        );
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.pasteAsText",
          label: EI(916, "Paste as Text"),
          precondition: $$.writable,
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        return Kpe.get(t)?.pasteAs({ providerId: Hge.id });
      }
    },
  ));
class mEe {
  constructor(e) {
    this.identifier = e;
  }
}
const _Ee = bV("treeViewsDndService");
HU(
  _Ee,
  class {
    constructor() {
      this._dragOperations = new Map();
    }
    removeDragOperationTransfer(e) {
      if (e && this._dragOperations.has(e)) {
        const t = this._dragOperations.get(e);
        return (this._dragOperations.delete(e), t);
      }
    }
  },
  1,
);
var vEe,
  bEe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const yEe = "editor.changeDropType",
  xEe = new yW("dropWidgetVisible", !1, SI(934, "Whether the drop widget is showing"));
let wEe = class extends PO {
  static {
    vEe = this;
  }
  static {
    this.ID = "editor.contrib.dropIntoEditorController";
  }
  static get(e) {
    return e.getContribution(vEe.ID);
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this._configService = n),
      (this._languageFeaturesService = i),
      (this._treeViewsDragAndDropService = r),
      (this.treeItemsTransfer = Xhe.getInstance()),
      (this._dropProgressManager = this._register(t.createInstance(fge, "dropIntoEditor", e))),
      (this._postDropWidgetManager = this._register(
        t.createInstance(
          Wpe,
          "dropIntoEditor",
          e,
          xEe,
          { id: yEe, label: SI(935, "Show drop options...") },
          () => (vEe._configureDefaultAction ? [vEe._configureDefaultAction] : []),
        ),
      )),
      this._register(e.onDropIntoEditor((t) => this.onDropIntoEditor(e, t.position, t.event))));
  }
  clearWidgets() {
    this._postDropWidgetManager.clear();
  }
  changeDropType() {
    this._postDropWidgetManager.tryShowSelector();
  }
  async onDropIntoEditor(e, t, n) {
    if (!n.dataTransfer || !e.hasModel()) return;
    (vEe._currentDropOperation?.cancel(), e.focus(), e.setPosition(t));
    const i = gM(async (r) => {
      const o = new AO(),
        s = o.add(new uge(e, 1, void 0, r));
      try {
        const i = await this.extractDataTransferData(n);
        if (0 === i.size || s.token.isCancellationRequested) return;
        const a = e.getModel();
        if (!a) return;
        const l = this._languageFeaturesService.documentDropEditProvider
            .ordered(a)
            .filter((e) => !e.dropMimeTypes || e.dropMimeTypes.some((e) => i.matches(e))),
          c = o.add(await this.getDropEdits(l, a, t, i, s.token));
        if (s.token.isCancellationRequested) return;
        if (c.edits.length) {
          const n = this.getInitialActiveEditIndex(a, c.edits),
            i = "afterDrop" === e.getOption(43).showDropSelector;
          await this._postDropWidgetManager.applyEditAndShowIfNeeded(
            [YH.fromPositions(t)],
            { activeEditIndex: n, allEdits: c.edits },
            i,
            async (e) => e,
            r,
          );
        }
      } finally {
        (o.dispose(), vEe._currentDropOperation === i && (vEe._currentDropOperation = void 0));
      }
    });
    (this._dropProgressManager.showWhile(t, SI(936, "Running drop handlers. Click to cancel"), i, {
      cancel: () => i.cancel(),
    }),
      (vEe._currentDropOperation = i));
  }
  async getDropEdits(e, t, n, i, r) {
    const o = new AO(),
      s = await pM(
        Promise.all(
          e.map(async (e) => {
            try {
              const s = await e.provideDocumentDropEdits(t, n, i, r);
              return (s && o.add(s), s?.edits.map((t) => ({ ...t, providerId: e.id })));
            } catch (s) {
              qI(s);
            }
          }),
        ),
        r,
      );
    return { edits: cpe(rj(s ?? []).flat()), dispose: () => o.dispose() };
  }
  getInitialActiveEditIndex(e, t) {
    const n = this._configService.getValue("editor.dropIntoEditor.preferences", {
      resource: e.uri,
    });
    for (const i of Array.isArray(n) ? n : []) {
      const e = new Hhe(i),
        n = t.findIndex((t) => t.kind && e.contains(t.kind));
      if (n >= 0) return n;
    }
    return 0;
  }
  async extractDataTransferData(e) {
    if (!e.dataTransfer) return new jhe();
    const t = nge(e.dataTransfer);
    if (this.treeItemsTransfer.hasData(mEe.prototype)) {
      const e = this.treeItemsTransfer.getData(mEe.prototype);
      if (Array.isArray(e))
        for (const n of e) {
          const e = await this._treeViewsDragAndDropService.removeDragOperationTransfer(
            n.identifier,
          );
          if (e) for (const [n, i] of e) t.replace(n, i);
        }
    }
    return t;
  }
};
((wEe = vEe =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })([bEe(1, vV), bEe(2, OU), bEe(3, mee), bEe(4, _Ee)], wEe)),
  zH(wEe.ID, wEe, 2),
  xme(Gge),
  BH(
    new (class extends MH {
      constructor() {
        super({ id: yEe, precondition: xEe, kbOpts: { weight: 100, primary: 2137 } });
      }
      runEditorCommand(e, t, n) {
        wEe.get(t)?.changeDropType();
      }
    })(),
  ),
  BH(
    new (class extends MH {
      constructor() {
        super({
          id: "editor.hideDropWidget",
          precondition: xEe,
          kbOpts: { weight: 100, primary: 9 },
        });
      }
      runEditorCommand(e, t, n) {
        wEe.get(t)?.clearWidgets();
      }
    })(),
  ));
class CEe extends rJ {
  static {
    this.ID = "editor.contrib.findOptionsWidget";
  }
  constructor(e, t, n) {
    (super(),
      (this._hideSoon = this._register(new EM(() => this._hide(), 2e3))),
      (this._isVisible = !1),
      (this._editor = e),
      (this._state = t),
      (this._keybindingService = n),
      (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"));
    const i = {
        inputActiveOptionBorder: yG(dY),
        inputActiveOptionForeground: yG(gY),
        inputActiveOptionBackground: yG(hY),
      },
      r = { groupId: "find-options-widget" };
    ((this.caseSensitive = this._register(
      new Cve({
        appendTitle: this._keybindingLabelFor(dve),
        isChecked: this._state.matchCase,
        hoverLifecycleOptions: r,
        ...i,
      }),
    )),
      this._domNode.appendChild(this.caseSensitive.domNode),
      this._register(
        this.caseSensitive.onChange(() => {
          this._state.change({ matchCase: this.caseSensitive.checked }, !1);
        }),
      ),
      (this.wholeWords = this._register(
        new Sve({
          appendTitle: this._keybindingLabelFor(uve),
          isChecked: this._state.wholeWord,
          hoverLifecycleOptions: r,
          ...i,
        }),
      )),
      this._domNode.appendChild(this.wholeWords.domNode),
      this._register(
        this.wholeWords.onChange(() => {
          this._state.change({ wholeWord: this.wholeWords.checked }, !1);
        }),
      ),
      (this.regex = this._register(
        new kve({
          appendTitle: this._keybindingLabelFor(hve),
          isChecked: this._state.isRegex,
          hoverLifecycleOptions: r,
          ...i,
        }),
      )),
      this._domNode.appendChild(this.regex.domNode),
      this._register(
        this.regex.onChange(() => {
          this._state.change({ isRegex: this.regex.checked }, !1);
        }),
      ),
      this._editor.addOverlayWidget(this),
      this._register(
        this._state.onFindReplaceStateChange((e) => {
          let t = !1;
          (e.isRegex && ((this.regex.checked = this._state.isRegex), (t = !0)),
            e.wholeWord && ((this.wholeWords.checked = this._state.wholeWord), (t = !0)),
            e.matchCase && ((this.caseSensitive.checked = this._state.matchCase), (t = !0)),
            !this._state.isRevealed && t && this._revealTemporarily());
        }),
      ),
      this._register($F(this._domNode, DB.MOUSE_LEAVE, (e) => this._onMouseLeave())),
      this._register($F(this._domNode, "mouseover", (e) => this._onMouseOver())));
  }
  _keybindingLabelFor(e) {
    const t = this._keybindingService.lookupKeybinding(e);
    return t ? ` (${t.getLabel()})` : "";
  }
  dispose() {
    (this._editor.removeOverlayWidget(this), super.dispose());
  }
  getId() {
    return CEe.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 = !0), (this._domNode.style.display = "block"));
  }
  _hide() {
    this._isVisible && ((this._isVisible = !1), (this._domNode.style.display = "none"));
  }
}
function SEe(e, t) {
  return 1 === e || (2 !== e && t);
}
class kEe extends PO {
  get searchString() {
    return this._searchString;
  }
  get replaceString() {
    return this._replaceString;
  }
  get isRevealed() {
    return this._isRevealed;
  }
  get isReplaceRevealed() {
    return this._isReplaceRevealed;
  }
  get isRegex() {
    return SEe(this._isRegexOverride, this._isRegex);
  }
  get wholeWord() {
    return SEe(this._wholeWordOverride, this._wholeWord);
  }
  get matchCase() {
    return SEe(this._matchCaseOverride, this._matchCase);
  }
  get preserveCase() {
    return SEe(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 QO())),
      (this.onFindReplaceStateChange = this._onFindReplaceStateChange.event),
      (this._searchString = ""),
      (this._replaceString = ""),
      (this._isRevealed = !1),
      (this._isReplaceRevealed = !1),
      (this._isRegex = !1),
      (this._isRegexOverride = 0),
      (this._wholeWord = !1),
      (this._wholeWordOverride = 0),
      (this._matchCase = !1),
      (this._matchCaseOverride = 0),
      (this._preserveCase = !1),
      (this._preserveCaseOverride = 0),
      (this._searchScope = null),
      (this._matchesPosition = 0),
      (this._matchesCount = 0),
      (this._currentMatch = null),
      (this._loop = !0),
      (this._isSearching = !1),
      (this._filters = null));
  }
  changeMatchInfo(e, t, n) {
    const i = {
      moveCursor: !1,
      updateHistory: !1,
      searchString: !1,
      replaceString: !1,
      isRevealed: !1,
      isReplaceRevealed: !1,
      isRegex: !1,
      wholeWord: !1,
      matchCase: !1,
      preserveCase: !1,
      searchScope: !1,
      matchesPosition: !1,
      matchesCount: !1,
      currentMatch: !1,
      loop: !1,
      isSearching: !1,
      filters: !1,
    };
    let r = !1;
    (0 === t && (e = 0),
      e > t && (e = t),
      this._matchesPosition !== e &&
        ((this._matchesPosition = e), (i.matchesPosition = !0), (r = !0)),
      this._matchesCount !== t && ((this._matchesCount = t), (i.matchesCount = !0), (r = !0)),
      void 0 !== n &&
        (YH.equalsRange(this._currentMatch, n) ||
          ((this._currentMatch = n), (i.currentMatch = !0), (r = !0))),
      r && this._onFindReplaceStateChange.fire(i));
  }
  change(e, t, n = !0) {
    const i = {
      moveCursor: t,
      updateHistory: n,
      searchString: !1,
      replaceString: !1,
      isRevealed: !1,
      isReplaceRevealed: !1,
      isRegex: !1,
      wholeWord: !1,
      matchCase: !1,
      preserveCase: !1,
      searchScope: !1,
      matchesPosition: !1,
      matchesCount: !1,
      currentMatch: !1,
      loop: !1,
      isSearching: !1,
      filters: !1,
    };
    let r = !1;
    const o = this.isRegex,
      s = this.wholeWord,
      a = this.matchCase,
      l = this.preserveCase;
    (void 0 !== e.searchString &&
      this._searchString !== e.searchString &&
      ((this._searchString = e.searchString), (i.searchString = !0), (r = !0)),
      void 0 !== e.replaceString &&
        this._replaceString !== e.replaceString &&
        ((this._replaceString = e.replaceString), (i.replaceString = !0), (r = !0)),
      void 0 !== e.isRevealed &&
        this._isRevealed !== e.isRevealed &&
        ((this._isRevealed = e.isRevealed), (i.isRevealed = !0), (r = !0)),
      void 0 !== e.isReplaceRevealed &&
        this._isReplaceRevealed !== e.isReplaceRevealed &&
        ((this._isReplaceRevealed = e.isReplaceRevealed), (i.isReplaceRevealed = !0), (r = !0)),
      void 0 !== e.isRegex && (this._isRegex = e.isRegex),
      void 0 !== e.wholeWord && (this._wholeWord = e.wholeWord),
      void 0 !== e.matchCase && (this._matchCase = e.matchCase),
      void 0 !== e.preserveCase && (this._preserveCase = e.preserveCase),
      void 0 !== e.searchScope &&
        (e.searchScope?.every((e) => this._searchScope?.some((t) => !YH.equalsRange(t, e))) ||
          ((this._searchScope = e.searchScope), (i.searchScope = !0), (r = !0))),
      void 0 !== e.loop &&
        this._loop !== e.loop &&
        ((this._loop = e.loop), (i.loop = !0), (r = !0)),
      void 0 !== e.isSearching &&
        this._isSearching !== e.isSearching &&
        ((this._isSearching = e.isSearching), (i.isSearching = !0), (r = !0)),
      void 0 !== e.filters &&
        (this._filters ? this._filters.update(e.filters) : (this._filters = e.filters),
        (i.filters = !0),
        (r = !0)),
      (this._isRegexOverride = void 0 !== e.isRegexOverride ? e.isRegexOverride : 0),
      (this._wholeWordOverride = void 0 !== e.wholeWordOverride ? e.wholeWordOverride : 0),
      (this._matchCaseOverride = void 0 !== e.matchCaseOverride ? e.matchCaseOverride : 0),
      (this._preserveCaseOverride = void 0 !== e.preserveCaseOverride ? e.preserveCaseOverride : 0),
      o !== this.isRegex && ((r = !0), (i.isRegex = !0)),
      s !== this.wholeWord && ((r = !0), (i.wholeWord = !0)),
      a !== this.matchCase && ((r = !0), (i.matchCase = !0)),
      l !== this.preserveCase && ((r = !0), (i.preserveCase = !0)),
      r && this._onFindReplaceStateChange.fire(i));
  }
  canNavigateBack() {
    return this.canNavigateInLoop() || 1 !== this.matchesPosition;
  }
  canNavigateForward() {
    return this.canNavigateInLoop() || this.matchesPosition < this.matchesCount;
  }
  canNavigateInLoop() {
    return this._loop || this.matchesCount >= vve;
  }
}
var EEe;
let NEe = class {
  static {
    EEe = this;
  }
  static {
    this.FIND_HISTORY_KEY = "workbench.find.history";
  }
  static {
    this._instance = null;
  }
  static getOrCreate(e) {
    return (EEe._instance || (EEe._instance = new EEe(e)), EEe._instance);
  }
  constructor(e) {
    ((this.storageService = e),
      (this.inMemoryValues = new Set()),
      (this._onDidChangeEmitter = new QO()),
      (this.onDidChange = this._onDidChangeEmitter.event),
      this.load());
  }
  delete(e) {
    const t = this.inMemoryValues.delete(e);
    return (this.save(), t);
  }
  add(e) {
    return (this.inMemoryValues.add(e), this.save(), this);
  }
  has(e) {
    return this.inMemoryValues.has(e);
  }
  forEach(e, t) {
    return (this.load(), this.inMemoryValues.forEach(e));
  }
  replace(e) {
    ((this.inMemoryValues = new Set(e)), this.save());
  }
  load() {
    let e;
    const t = this.storageService.get(EEe.FIND_HISTORY_KEY, 1);
    if (t)
      try {
        e = JSON.parse(t);
      } catch (spt) {}
    this.inMemoryValues = new Set(e || []);
  }
  save() {
    const e = [];
    return (
      this.inMemoryValues.forEach((t) => e.push(t)),
      new Promise((t) => {
        (this.storageService.store(EEe.FIND_HISTORY_KEY, JSON.stringify(e), 1, 0),
          this._onDidChangeEmitter.fire(e),
          t());
      })
    );
  }
};
NEe = EEe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, oue),
  ],
  NEe,
);
var LEe;
let DEe = class {
  static {
    LEe = this;
  }
  static {
    this.FIND_HISTORY_KEY = "workbench.replace.history";
  }
  static {
    this._instance = null;
  }
  static getOrCreate(e) {
    return (LEe._instance || (LEe._instance = new LEe(e)), LEe._instance);
  }
  constructor(e) {
    ((this.storageService = e),
      (this.inMemoryValues = new Set()),
      (this._onDidChangeEmitter = new QO()),
      (this.onDidChange = this._onDidChangeEmitter.event),
      this.load());
  }
  delete(e) {
    const t = this.inMemoryValues.delete(e);
    return (this.save(), t);
  }
  add(e) {
    return (this.inMemoryValues.add(e), this.save(), this);
  }
  has(e) {
    return this.inMemoryValues.has(e);
  }
  forEach(e, t) {
    return (this.load(), this.inMemoryValues.forEach(e));
  }
  replace(e) {
    ((this.inMemoryValues = new Set(e)), this.save());
  }
  load() {
    let e;
    const t = this.storageService.get(LEe.FIND_HISTORY_KEY, 1);
    if (t)
      try {
        e = JSON.parse(t);
      } catch (spt) {}
    this.inMemoryValues = new Set(e || []);
  }
  save() {
    const e = [];
    return (
      this.inMemoryValues.forEach((t) => e.push(t)),
      new Promise((t) => {
        (this.storageService.store(LEe.FIND_HISTORY_KEY, JSON.stringify(e), 1, 0),
          this._onDidChangeEmitter.fire(e),
          t());
      })
    );
  }
};
DEe = LEe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, oue),
  ],
  DEe,
);
var TEe,
  IEe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  REe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
function OEe(e, t = "single", n = !1) {
  if (!e.hasModel()) return null;
  const i = e.getSelection();
  if (("single" === t && i.startLineNumber === i.endLineNumber) || "multiple" === t)
    if (i.isEmpty()) {
      const t = e.getConfiguredWordAtPosition(i.getStartPosition());
      if (t && !1 === n) return t.word;
    } else if (e.getModel().getValueLengthInRange(i) < 524288)
      return e.getModel().getValueInRange(i);
  return null;
}
let MEe = class extends PO {
  static {
    TEe = this;
  }
  static {
    this.ID = "editor.contrib.findController";
  }
  get editor() {
    return this._editor;
  }
  static get(e) {
    return e.getContribution(TEe.ID);
  }
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._editor = e),
      (this._findWidgetVisible = q_e.bindTo(t)),
      (this._contextKeyService = t),
      (this._storageService = n),
      (this._clipboardService = i),
      (this._notificationService = r),
      (this._hoverService = o),
      (this._updateHistoryDelayer = new mM(500)),
      (this._state = this._register(new kEe())),
      this.loadQueryState(),
      this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e))),
      (this._model = null),
      this._register(
        this._editor.onDidChangeModel(() => {
          const e = this._editor.getModel() && this._state.isRevealed;
          (this.disposeModel(),
            this._state.change(
              {
                searchScope: null,
                matchCase: this._storageService.getBoolean("editor.matchCase", 1, !1),
                wholeWord: this._storageService.getBoolean("editor.wholeWord", 1, !1),
                isRegex: this._storageService.getBoolean("editor.isRegex", 1, !1),
                preserveCase: this._storageService.getBoolean("editor.preserveCase", 1, !1),
              },
              !1,
            ),
            e &&
              this._start({
                forceRevealReplace: !1,
                seedSearchStringFromSelection: "none",
                seedSearchStringFromNonEmptySelection: !1,
                seedSearchStringFromGlobalClipboard: !1,
                shouldFocus: 0,
                shouldAnimate: !1,
                updateSearchScope: !1,
                loop: this._editor.getOption(50).loop,
              }));
        }),
      ));
  }
  dispose() {
    (this.disposeModel(), super.dispose());
  }
  disposeModel() {
    this._model && (this._model.dispose(), (this._model = null));
  }
  _onStateChanged(e) {
    (this.saveQueryState(e),
      e.isRevealed &&
        (this._state.isRevealed
          ? this._findWidgetVisible.set(!0)
          : (this._findWidgetVisible.reset(), this.disposeModel())),
      e.searchString && this.setGlobalBufferTerm(this._state.searchString));
  }
  saveQueryState(e) {
    (e.isRegex && this._storageService.store("editor.isRegex", this._state.actualIsRegex, 1, 1),
      e.wholeWord &&
        this._storageService.store("editor.wholeWord", this._state.actualWholeWord, 1, 1),
      e.matchCase &&
        this._storageService.store("editor.matchCase", this._state.actualMatchCase, 1, 1),
      e.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,
        ),
      },
      !1,
    );
  }
  isFindInputFocused() {
    return !!K_e.getValue(this._contextKeyService);
  }
  getState() {
    return this._state;
  }
  closeFindWidget() {
    (this._state.change({ isRevealed: !1, searchScope: null }, !1), this._editor.focus());
  }
  toggleCaseSensitive() {
    (this._state.change({ matchCase: !this._state.matchCase }, !1),
      this._state.isRevealed || this.highlightFindOptions());
  }
  toggleWholeWords() {
    (this._state.change({ wholeWord: !this._state.wholeWord }, !1),
      this._state.isRevealed || this.highlightFindOptions());
  }
  toggleRegex() {
    (this._state.change({ isRegex: !this._state.isRegex }, !1),
      this._state.isRevealed || this.highlightFindOptions());
  }
  togglePreserveCase() {
    (this._state.change({ preserveCase: !this._state.preserveCase }, !1),
      this._state.isRevealed || this.highlightFindOptions());
  }
  toggleSearchScope() {
    if (this._state.searchScope) this._state.change({ searchScope: null }, !0);
    else if (this._editor.hasModel()) {
      let e = this._editor.getSelections();
      ((e = e
        .map(
          (e) => (
            1 === e.endColumn &&
              e.endLineNumber > e.startLineNumber &&
              (e = e.setEndPosition(
                e.endLineNumber - 1,
                this._editor.getModel().getLineMaxColumn(e.endLineNumber - 1),
              )),
            e.isEmpty() ? null : e
          ),
        )
        .filter((e) => !!e)),
        e.length && this._state.change({ searchScope: e }, !0));
    }
  }
  setSearchString(e) {
    (this._state.isRegex && (e = zM(e)), this._state.change({ searchString: e }, !1));
  }
  highlightFindOptions(e = !1) {}
  async _start(e, t) {
    if ((this.disposeModel(), !this._editor.hasModel())) return;
    const n = { ...t, isRevealed: !0 };
    if ("single" === e.seedSearchStringFromSelection) {
      const t = OEe(
        this._editor,
        e.seedSearchStringFromSelection,
        e.seedSearchStringFromNonEmptySelection,
      );
      t && (this._state.isRegex ? (n.searchString = zM(t)) : (n.searchString = t));
    } else if ("multiple" === e.seedSearchStringFromSelection && !e.updateSearchScope) {
      const t = OEe(this._editor, e.seedSearchStringFromSelection);
      t && (n.searchString = t);
    }
    if (!n.searchString && e.seedSearchStringFromGlobalClipboard) {
      const e = await this.getGlobalBufferTerm();
      if (!this._editor.hasModel()) return;
      e && (n.searchString = e);
    }
    if (
      (e.forceRevealReplace || n.isReplaceRevealed
        ? (n.isReplaceRevealed = !0)
        : this._findWidgetVisible.get() || (n.isReplaceRevealed = !1),
      e.updateSearchScope)
    ) {
      const e = this._editor.getSelections();
      e.some((e) => !e.isEmpty()) && (n.searchScope = e);
    }
    ((n.loop = e.loop),
      this._state.change(n, !1),
      this._model || (this._model = new bve(this._editor, this._state)));
  }
  start(e, t) {
    return this._start(e, t);
  }
  moveToNextMatch() {
    return !!this._model && (this._model.moveToNextMatch(), !0);
  }
  moveToPrevMatch() {
    return !!this._model && (this._model.moveToPrevMatch(), !0);
  }
  goToMatch(e) {
    return !!this._model && (this._model.moveToMatch(e), !0);
  }
  replace() {
    return !!this._model && (this._model.replace(), !0);
  }
  replaceAll() {
    return (
      !!this._model &&
      (this._editor.getModel()?.isTooLargeForHeapOperation()
        ? (this._notificationService.warn(
            SI(940, "The file is too large to perform a replace all operation."),
          ),
          !1)
        : (this._model.replaceAll(), !0))
    );
  }
  selectAllMatches() {
    return !!this._model && (this._model.selectAllMatches(), this._editor.focus(), !0);
  }
  async getGlobalBufferTerm() {
    return this._editor.getOption(50).globalFindClipboard &&
      this._editor.hasModel() &&
      !this._editor.getModel().isTooLargeForSyncing()
      ? this._clipboardService.readFindText()
      : "";
  }
  setGlobalBufferTerm(e) {
    this._editor.getOption(50).globalFindClipboard &&
      this._editor.hasModel() &&
      !this._editor.getModel().isTooLargeForSyncing() &&
      this._clipboardService.writeFindText(e);
  }
};
MEe = TEe = IEe([REe(1, xW), REe(2, oue), REe(3, ade), REe(4, Y4), REe(5, Xue)], MEe);
let AEe = class extends MEe {
  constructor(e, t, n, i, r, o, s, a) {
    (super(e, n, o, s, r, a),
      (this._contextViewService = t),
      (this._keybindingService = i),
      (this._widget = null),
      (this._findOptionsWidget = null),
      (this._findWidgetSearchHistory = NEe.getOrCreate(o)),
      (this._replaceWidgetHistory = DEe.getOrCreate(o)));
  }
  async _start(e, t) {
    this._widget || this._createFindWidget();
    const n = this._editor.getSelection();
    let i = !1;
    switch (this._editor.getOption(50).autoFindInSelection) {
      case "always":
        i = !0;
        break;
      case "never":
        i = !1;
        break;
      case "multiline":
        i = !!n && n.startLineNumber !== n.endLineNumber;
        break;
    }
    ((e.updateSearchScope = e.updateSearchScope || i),
      await super._start(e, t),
      this._widget &&
        (2 === e.shouldFocus
          ? this._widget.focusReplaceInput()
          : 1 === e.shouldFocus && this._widget.focusFindInput()));
  }
  highlightFindOptions(e = !1) {
    (this._widget || this._createFindWidget(),
      this._state.isRevealed && !e
        ? this._widget.highlightFindOptions()
        : this._findOptionsWidget.highlightFindOptions());
  }
  _createFindWidget() {
    ((this._widget = this._register(
      new Lbe(
        this._editor,
        this,
        this._state,
        this._contextViewService,
        this._keybindingService,
        this._contextKeyService,
        this._hoverService,
        this._findWidgetSearchHistory,
        this._replaceWidgetHistory,
      ),
    )),
      (this._findOptionsWidget = this._register(
        new CEe(this._editor, this._state, this._keybindingService),
      )));
  }
  saveViewState() {
    return this._widget?.getViewState();
  }
  restoreViewState(e) {
    this._widget?.setViewState(e);
  }
};
AEe = IEe(
  [REe(1, lde), REe(2, xW), REe(3, N5), REe(4, Y4), REe(5, oue), REe(6, ade), REe(7, Xue)],
  AEe,
);
WH(
  new PH({
    id: eve,
    label: EI(947, "Find"),
    precondition: eW.or($$.focus, eW.has("editorIsOpen")),
    kbOpts: { kbExpr: null, primary: 2084, weight: 100 },
    menuOpts: { menuId: MW.MenubarEditMenu, group: "3_find", title: SI(941, "&&Find"), order: 1 },
  }),
).addImplementation(0, (e, t, n) => {
  const i = MEe.get(t);
  return (
    !!i &&
    i.start({
      forceRevealReplace: !1,
      seedSearchStringFromSelection:
        "never" !== t.getOption(50).seedSearchStringFromSelection ? "single" : "none",
      seedSearchStringFromNonEmptySelection:
        "selection" === t.getOption(50).seedSearchStringFromSelection,
      seedSearchStringFromGlobalClipboard: t.getOption(50).globalFindClipboard,
      shouldFocus: 1,
      shouldAnimate: !0,
      updateSearchScope: !1,
      loop: t.getOption(50).loop,
    })
  );
});
const PEe = {
  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" },
        },
      },
    },
  ],
};
async function jEe(e, t) {
  const n = MEe.get(e);
  if (!n) return;
  const i = () =>
    !!(t ? n.moveToNextMatch() : n.moveToPrevMatch()) && (n.editor.pushUndoStop(), !0);
  i() ||
    (await n.start({
      forceRevealReplace: !1,
      seedSearchStringFromSelection:
        0 === n.getState().searchString.length &&
        "never" !== e.getOption(50).seedSearchStringFromSelection
          ? "single"
          : "none",
      seedSearchStringFromNonEmptySelection:
        "selection" === e.getOption(50).seedSearchStringFromSelection,
      seedSearchStringFromGlobalClipboard: !0,
      shouldFocus: 0,
      shouldAnimate: !0,
      updateSearchScope: !1,
      loop: e.getOption(50).loop,
    }),
    i());
}
WH(
  new PH({
    id: ive,
    label: EI(950, "Find Next"),
    precondition: void 0,
    kbOpts: [
      { kbExpr: $$.focus, primary: 61, mac: { primary: 2085, secondary: [61] }, weight: 100 },
      { kbExpr: eW.and($$.focus, K_e), primary: 3, weight: 100 },
    ],
  }),
).addImplementation(0, async (e, t, n) => jEe(t, !0));
WH(
  new PH({
    id: rve,
    label: EI(951, "Find Previous"),
    precondition: void 0,
    kbOpts: [
      { kbExpr: $$.focus, primary: 1085, mac: { primary: 3109, secondary: [1085] }, weight: 100 },
      { kbExpr: eW.and($$.focus, K_e), primary: 1027, weight: 100 },
    ],
  }),
).addImplementation(0, async (e, t, n) => jEe(t, !1));
class FEe extends AH {
  async run(e, t) {
    const n = MEe.get(t);
    if (!n) return;
    const i = OEe(t, "single", !1);
    (i && n.setSearchString(i),
      this._run(n) ||
        (await n.start({
          forceRevealReplace: !1,
          seedSearchStringFromSelection: "none",
          seedSearchStringFromNonEmptySelection: !1,
          seedSearchStringFromGlobalClipboard: !1,
          shouldFocus: 0,
          shouldAnimate: !0,
          updateSearchScope: !1,
          loop: t.getOption(50).loop,
        }),
        this._run(n)));
  }
}
(WH(
  new PH({
    id: lve,
    label: EI(955, "Replace"),
    precondition: eW.or($$.focus, eW.has("editorIsOpen")),
    kbOpts: { kbExpr: null, primary: 2086, mac: { primary: 2596 }, weight: 100 },
    menuOpts: {
      menuId: MW.MenubarEditMenu,
      group: "3_find",
      title: SI(946, "&&Replace"),
      order: 2,
    },
  }),
).addImplementation(0, (e, t, n) => {
  if (!t.hasModel() || t.getOption(104)) return !1;
  const i = MEe.get(t);
  if (!i) return !1;
  const r = t.getSelection(),
    o = i.isFindInputFocused(),
    s =
      !r.isEmpty() &&
      r.startLineNumber === r.endLineNumber &&
      "never" !== t.getOption(50).seedSearchStringFromSelection &&
      !o,
    a = o || s ? 2 : 1;
  return i.start({
    forceRevealReplace: !0,
    seedSearchStringFromSelection: s ? "single" : "none",
    seedSearchStringFromNonEmptySelection:
      "selection" === t.getOption(50).seedSearchStringFromSelection,
    seedSearchStringFromGlobalClipboard: "never" !== t.getOption(50).seedSearchStringFromSelection,
    shouldFocus: a,
    shouldAnimate: !0,
    updateSearchScope: !1,
    loop: t.getOption(50).loop,
  });
}),
  zH(MEe.ID, AEe, 0),
  VH(
    class extends AH {
      constructor() {
        super({
          id: nve,
          label: EI(948, "Find with Arguments"),
          precondition: void 0,
          kbOpts: { kbExpr: null, primary: 0, weight: 100 },
          metadata: PEe,
        });
      }
      async run(e, t, n) {
        const i = MEe.get(t);
        if (i) {
          const e = n
            ? {
                searchString: n.searchString,
                replaceString: n.replaceString,
                isReplaceRevealed: void 0 !== n.replaceString,
                isRegex: n.isRegex,
                wholeWord: n.matchWholeWord,
                matchCase: n.isCaseSensitive,
                preserveCase: n.preserveCase,
              }
            : {};
          (await i.start(
            {
              forceRevealReplace: !1,
              seedSearchStringFromSelection:
                0 === i.getState().searchString.length &&
                "never" !== t.getOption(50).seedSearchStringFromSelection
                  ? "single"
                  : "none",
              seedSearchStringFromNonEmptySelection:
                "selection" === t.getOption(50).seedSearchStringFromSelection,
              seedSearchStringFromGlobalClipboard: !0,
              shouldFocus: 1,
              shouldAnimate: !0,
              updateSearchScope: n?.findInSelection || !1,
              loop: t.getOption(50).loop,
            },
            e,
          ),
            i.setGlobalBufferTerm(i.getState().searchString));
        }
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: tve,
          label: EI(949, "Find with Selection"),
          precondition: void 0,
          kbOpts: { kbExpr: null, primary: 0, mac: { primary: 2083 }, weight: 100 },
        });
      }
      async run(e, t) {
        const n = MEe.get(t);
        n &&
          (await n.start({
            forceRevealReplace: !1,
            seedSearchStringFromSelection: "multiple",
            seedSearchStringFromNonEmptySelection: !1,
            seedSearchStringFromGlobalClipboard: !1,
            shouldFocus: 0,
            shouldAnimate: !0,
            updateSearchScope: !1,
            loop: t.getOption(50).loop,
          }),
          n.setGlobalBufferTerm(n.getState().searchString));
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        (super({ id: ove, label: EI(952, "Go to Match..."), precondition: q_e }),
          (this._highlightDecorations = []));
      }
      run(e, t, n) {
        const i = MEe.get(t);
        if (!i) return;
        const r = i.getState().matchesCount;
        if (r < 1) {
          return void e
            .get(Y4)
            .notify({
              severity: Z4.Warning,
              message: SI(942, "No matches. Try searching for something else."),
            });
        }
        const o = e.get(Ghe),
          s = new AO(),
          a = s.add(o.createInputBox());
        a.placeholder = SI(943, "Type a number to go to a specific match (between 1 and {0})", r);
        const l = (e) => {
            const t = parseInt(e);
            if (isNaN(t)) return;
            const n = i.getState().matchesCount;
            return t > 0 && t <= n ? t - 1 : t < 0 && t >= -n ? n + t : void 0;
          },
          c = (e) => {
            const n = l(e);
            if ("number" == typeof n) {
              ((a.validationMessage = void 0), i.goToMatch(n));
              const e = i.getState().currentMatch;
              e && this.addDecorations(t, e);
            } else
              ((a.validationMessage = SI(
                944,
                "Please type a number between 1 and {0}",
                i.getState().matchesCount,
              )),
                this.clearDecorations(t));
          };
        (s.add(
          a.onDidChangeValue((e) => {
            c(e);
          }),
        ),
          s.add(
            a.onDidAccept(() => {
              const e = l(a.value);
              "number" == typeof e
                ? (i.goToMatch(e), a.hide())
                : (a.validationMessage = SI(
                    945,
                    "Please type a number between 1 and {0}",
                    i.getState().matchesCount,
                  ));
            }),
          ),
          s.add(
            a.onDidHide(() => {
              (this.clearDecorations(t), s.dispose());
            }),
          ),
          a.show());
      }
      clearDecorations(e) {
        e.changeDecorations((e) => {
          this._highlightDecorations = e.deltaDecorations(this._highlightDecorations, []);
        });
      }
      addDecorations(e, t) {
        e.changeDecorations((e) => {
          this._highlightDecorations = e.deltaDecorations(this._highlightDecorations, [
            {
              range: t,
              options: {
                description: "find-match-quick-access-range-highlight",
                className: "rangeHighlight",
                isWholeLine: !0,
              },
            },
            {
              range: t,
              options: {
                description: "find-match-quick-access-range-highlight-overview",
                overviewRuler: { color: g0(Y0), position: Uz.Full },
              },
            },
          ]);
        });
      }
    },
  ),
  VH(
    class extends FEe {
      constructor() {
        super({
          id: sve,
          label: EI(953, "Find Next Selection"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.focus, primary: 2109, weight: 100 },
        });
      }
      _run(e) {
        return e.moveToNextMatch();
      }
    },
  ),
  VH(
    class extends FEe {
      constructor() {
        super({
          id: ave,
          label: EI(954, "Find Previous Selection"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.focus, primary: 3133, weight: 100 },
        });
      }
      _run(e) {
        return e.moveToPrevMatch();
      }
    },
  ));
const BEe = MH.bindToContribution(MEe.get);
(BH(
  new BEe({
    id: cve,
    precondition: q_e,
    handler: (e) => e.closeFindWidget(),
    kbOpts: {
      weight: 105,
      kbExpr: eW.and($$.focus, eW.not("isComposing")),
      primary: 9,
      secondary: [1033],
    },
  }),
),
  BH(
    new BEe({
      id: dve,
      precondition: void 0,
      handler: (e) => e.toggleCaseSensitive(),
      kbOpts: {
        weight: 105,
        kbExpr: $$.focus,
        primary: Z_e.primary,
        mac: Z_e.mac,
        win: Z_e.win,
        linux: Z_e.linux,
      },
    }),
  ),
  BH(
    new BEe({
      id: uve,
      precondition: void 0,
      handler: (e) => e.toggleWholeWords(),
      kbOpts: {
        weight: 105,
        kbExpr: $$.focus,
        primary: Y_e.primary,
        mac: Y_e.mac,
        win: Y_e.win,
        linux: Y_e.linux,
      },
    }),
  ),
  BH(
    new BEe({
      id: hve,
      precondition: void 0,
      handler: (e) => e.toggleRegex(),
      kbOpts: {
        weight: 105,
        kbExpr: $$.focus,
        primary: X_e.primary,
        mac: X_e.mac,
        win: X_e.win,
        linux: X_e.linux,
      },
    }),
  ),
  BH(
    new BEe({
      id: gve,
      precondition: void 0,
      handler: (e) => e.toggleSearchScope(),
      kbOpts: {
        weight: 105,
        kbExpr: $$.focus,
        primary: Q_e.primary,
        mac: Q_e.mac,
        win: Q_e.win,
        linux: Q_e.linux,
      },
    }),
  ),
  BH(
    new BEe({
      id: pve,
      precondition: void 0,
      handler: (e) => e.togglePreserveCase(),
      kbOpts: {
        weight: 105,
        kbExpr: $$.focus,
        primary: J_e.primary,
        mac: J_e.mac,
        win: J_e.win,
        linux: J_e.linux,
      },
    }),
  ),
  BH(
    new BEe({
      id: fve,
      precondition: q_e,
      handler: (e) => e.replace(),
      kbOpts: { weight: 105, kbExpr: $$.focus, primary: 3094 },
    }),
  ),
  BH(
    new BEe({
      id: fve,
      precondition: q_e,
      handler: (e) => e.replace(),
      kbOpts: { weight: 105, kbExpr: eW.and($$.focus, G_e), primary: 3 },
    }),
  ),
  BH(
    new BEe({
      id: mve,
      precondition: q_e,
      handler: (e) => e.replaceAll(),
      kbOpts: { weight: 105, kbExpr: $$.focus, primary: 2563 },
    }),
  ),
  BH(
    new BEe({
      id: mve,
      precondition: q_e,
      handler: (e) => e.replaceAll(),
      kbOpts: {
        weight: 105,
        kbExpr: eW.and($$.focus, G_e),
        primary: void 0,
        mac: { primary: 2051 },
      },
    }),
  ),
  BH(
    new BEe({
      id: _ve,
      precondition: q_e,
      handler: (e) => e.selectAllMatches(),
      kbOpts: { weight: 105, kbExpr: $$.focus, primary: 515 },
    }),
  ));
const VEe = { 0: " ", 1: "u", 2: "r" },
  WEe = 16777215,
  HEe = 4278190080;
class zEe {
  constructor(e) {
    const t = Math.ceil(e / 32);
    this._states = new Uint32Array(t);
  }
  get(e) {
    const t = (e / 32) | 0,
      n = e % 32;
    return !!(this._states[t] & (1 << n));
  }
  set(e, t) {
    const n = (e / 32) | 0,
      i = e % 32,
      r = this._states[n];
    this._states[n] = t ? r | (1 << i) : r & ~(1 << i);
  }
}
class UEe {
  constructor(e, t, n) {
    if (e.length !== t.length || e.length > 65535)
      throw new Error("invalid startIndexes or endIndexes size");
    ((this._startIndexes = e),
      (this._endIndexes = t),
      (this._collapseStates = new zEe(e.length)),
      (this._userDefinedStates = new zEe(e.length)),
      (this._recoveredStates = new zEe(e.length)),
      (this._types = n),
      (this._parentsComputed = !1));
  }
  ensureParentIndices() {
    if (!this._parentsComputed) {
      this._parentsComputed = !0;
      const e = [],
        t = (t, n) => {
          const i = e[e.length - 1];
          return this.getStartLineNumber(i) <= t && this.getEndLineNumber(i) >= n;
        };
      for (let n = 0, i = this._startIndexes.length; n < i; n++) {
        const i = this._startIndexes[n],
          r = this._endIndexes[n];
        if (i > WEe || r > WEe)
          throw new Error("startLineNumber or endLineNumber must not exceed " + WEe);
        for (; e.length > 0 && !t(i, r); ) e.pop();
        const o = e.length > 0 ? e[e.length - 1] : -1;
        (e.push(n),
          (this._startIndexes[n] = i + ((255 & o) << 24)),
          (this._endIndexes[n] = r + ((65280 & o) << 16)));
      }
    }
  }
  get length() {
    return this._startIndexes.length;
  }
  getStartLineNumber(e) {
    return this._startIndexes[e] & WEe;
  }
  getEndLineNumber(e) {
    return this._endIndexes[e] & WEe;
  }
  getType(e) {
    return this._types ? this._types[e] : void 0;
  }
  hasTypes() {
    return !!this._types;
  }
  isCollapsed(e) {
    return this._collapseStates.get(e);
  }
  setCollapsed(e, t) {
    this._collapseStates.set(e, t);
  }
  isUserDefined(e) {
    return this._userDefinedStates.get(e);
  }
  setUserDefined(e, t) {
    return this._userDefinedStates.set(e, t);
  }
  isRecovered(e) {
    return this._recoveredStates.get(e);
  }
  setRecovered(e, t) {
    return this._recoveredStates.set(e, t);
  }
  getSource(e) {
    return this.isUserDefined(e) ? 1 : this.isRecovered(e) ? 2 : 0;
  }
  setSource(e, t) {
    1 === t
      ? (this.setUserDefined(e, !0), this.setRecovered(e, !1))
      : 2 === t
        ? (this.setUserDefined(e, !1), this.setRecovered(e, !0))
        : (this.setUserDefined(e, !1), this.setRecovered(e, !1));
  }
  setCollapsedAllOfType(e, t) {
    let n = !1;
    if (this._types)
      for (let i = 0; i < this._types.length; i++)
        this._types[i] === e && (this.setCollapsed(i, t), (n = !0));
    return n;
  }
  toRegion(e) {
    return new $Ee(this, e);
  }
  getParentIndex(e) {
    this.ensureParentIndices();
    const t = ((this._startIndexes[e] & HEe) >>> 24) + ((this._endIndexes[e] & HEe) >>> 16);
    return 65535 === t ? -1 : t;
  }
  contains(e, t) {
    return this.getStartLineNumber(e) <= t && this.getEndLineNumber(e) >= t;
  }
  findIndex(e) {
    let t = 0,
      n = this._startIndexes.length;
    if (0 === n) return -1;
    for (; t < n; ) {
      const i = Math.floor((t + n) / 2);
      e < this.getStartLineNumber(i) ? (n = i) : (t = i + 1);
    }
    return t - 1;
  }
  findRange(e) {
    let t = this.findIndex(e);
    if (t >= 0) {
      if (this.getEndLineNumber(t) >= e) return t;
      for (t = this.getParentIndex(t); -1 !== t; ) {
        if (this.contains(t, e)) return t;
        t = this.getParentIndex(t);
      }
    }
    return -1;
  }
  toString() {
    const e = [];
    for (let t = 0; t < this.length; t++)
      e[t] =
        `[${VEe[this.getSource(t)]}${this.isCollapsed(t) ? "+" : "-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;
    return e.join(", ");
  }
  toFoldRange(e) {
    return {
      startLineNumber: this._startIndexes[e] & WEe,
      endLineNumber: this._endIndexes[e] & WEe,
      type: this._types ? this._types[e] : void 0,
      isCollapsed: this.isCollapsed(e),
      source: this.getSource(e),
    };
  }
  static fromFoldRanges(e) {
    const t = e.length,
      n = new Uint32Array(t),
      i = new Uint32Array(t);
    let r = [],
      o = !1;
    for (let a = 0; a < t; a++) {
      const t = e[a];
      ((n[a] = t.startLineNumber), (i[a] = t.endLineNumber), r.push(t.type), t.type && (o = !0));
    }
    o || (r = void 0);
    const s = new UEe(n, i, r);
    for (let a = 0; a < t; a++)
      (e[a].isCollapsed && s.setCollapsed(a, !0), s.setSource(a, e[a].source));
    return s;
  }
  static sanitizeAndMerge(e, t, n, i) {
    n = n ?? Number.MAX_VALUE;
    const r = (e, t) =>
        Array.isArray(e)
          ? (n) => (n < t ? e[n] : void 0)
          : (n) => (n < t ? e.toFoldRange(n) : void 0),
      o = r(e, e.length),
      s = r(t, t.length);
    let a = 0,
      l = 0,
      c = o(0),
      d = s(0);
    const u = [];
    let h,
      g = 0;
    const p = [];
    for (; c || d; ) {
      let e;
      if (d && (!c || c.startLineNumber >= d.startLineNumber))
        (c && c.startLineNumber === d.startLineNumber
          ? (1 === d.source
              ? (e = d)
              : ((e = c),
                (e.isCollapsed =
                  d.isCollapsed &&
                  (c.endLineNumber === d.endLineNumber ||
                    !i?.startsInside(c.startLineNumber + 1, c.endLineNumber + 1))),
                (e.source = 0)),
            (c = o(++a)))
          : ((e = d), d.isCollapsed && 0 === d.source && (e.source = 2)),
          (d = s(++l)));
      else {
        let t = l,
          n = d;
        for (;;) {
          if (!n || n.startLineNumber > c.endLineNumber) {
            e = c;
            break;
          }
          if (1 === n.source && n.endLineNumber > c.endLineNumber) break;
          n = s(++t);
        }
        c = o(++a);
      }
      if (e) {
        for (; h && h.endLineNumber < e.startLineNumber; ) h = u.pop();
        e.endLineNumber > e.startLineNumber &&
          e.startLineNumber > g &&
          e.endLineNumber <= n &&
          (!h || h.endLineNumber >= e.endLineNumber) &&
          (p.push(e), (g = e.startLineNumber), h && u.push(h), (h = e));
      }
    }
    return p;
  }
}
class $Ee {
  constructor(e, t) {
    ((this.ranges = e), (this.index = t));
  }
  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(e) {
    return e.startLineNumber <= this.startLineNumber && e.endLineNumber >= this.endLineNumber;
  }
  containsLine(e) {
    return this.startLineNumber <= e && e <= this.endLineNumber;
  }
}
class qEe {
  get regions() {
    return this._regions;
  }
  get textModel() {
    return this._textModel;
  }
  constructor(e, t) {
    ((this._updateEventEmitter = new QO()),
      (this.onDidChange = this._updateEventEmitter.event),
      (this._textModel = e),
      (this._decorationProvider = t),
      (this._regions = new UEe(new Uint32Array(0), new Uint32Array(0))),
      (this._editorDecorationIds = []));
  }
  toggleCollapseState(e) {
    if (!e.length) return;
    e = e.sort((e, t) => e.regionIndex - t.regionIndex);
    const t = {};
    (this._decorationProvider.changeDecorations((n) => {
      let i = 0,
        r = -1,
        o = -1;
      const s = (e) => {
        for (; i < e; ) {
          const e = this._regions.getEndLineNumber(i),
            t = this._regions.isCollapsed(i);
          if (e <= r) {
            const r = 0 !== this.regions.getSource(i);
            n.changeDecorationOptions(
              this._editorDecorationIds[i],
              this._decorationProvider.getDecorationOption(t, e <= o, r),
            );
          }
          (t && e > o && (o = e), i++);
        }
      };
      for (const a of e) {
        const e = a.regionIndex,
          n = this._editorDecorationIds[e];
        if (n && !t[n]) {
          ((t[n] = !0), s(e));
          const i = !this._regions.isCollapsed(e);
          (this._regions.setCollapsed(e, i), (r = Math.max(r, this._regions.getEndLineNumber(e))));
        }
      }
      s(this._regions.length);
    }),
      this._updateEventEmitter.fire({ model: this, collapseStateChanged: e }));
  }
  removeManualRanges(e) {
    const t = new Array(),
      n = (t) => {
        for (const n of e)
          if (!(n.startLineNumber > t.endLineNumber || t.startLineNumber > n.endLineNumber))
            return !0;
        return !1;
      };
    for (let i = 0; i < this._regions.length; i++) {
      const e = this._regions.toFoldRange(i);
      (0 !== e.source && n(e)) || t.push(e);
    }
    this.updatePost(UEe.fromFoldRanges(t));
  }
  update(e, t) {
    const n = this._currentFoldedOrManualRanges(t),
      i = UEe.sanitizeAndMerge(e, n, this._textModel.getLineCount(), t);
    this.updatePost(UEe.fromFoldRanges(i));
  }
  updatePost(e) {
    const t = [];
    let n = -1;
    for (let i = 0, r = e.length; i < r; i++) {
      const r = e.getStartLineNumber(i),
        o = e.getEndLineNumber(i),
        s = e.isCollapsed(i),
        a = 0 !== e.getSource(i),
        l = {
          startLineNumber: r,
          startColumn: this._textModel.getLineMaxColumn(r),
          endLineNumber: o,
          endColumn: this._textModel.getLineMaxColumn(o) + 1,
        };
      (t.push({ range: l, options: this._decorationProvider.getDecorationOption(s, o <= n, a) }),
        s && o > n && (n = o));
    }
    (this._decorationProvider.changeDecorations(
      (e) => (this._editorDecorationIds = e.deltaDecorations(this._editorDecorationIds, t)),
    ),
      (this._regions = e),
      this._updateEventEmitter.fire({ model: this }));
  }
  _currentFoldedOrManualRanges(e) {
    const t = [];
    for (let n = 0, i = this._regions.length; n < i; n++) {
      let i = this.regions.isCollapsed(n);
      const r = this.regions.getSource(n);
      if (i || 0 !== r) {
        const o = this._regions.toFoldRange(n),
          s = this._textModel.getDecorationRange(this._editorDecorationIds[n]);
        s &&
          (i && e?.startsInside(s.startLineNumber + 1, s.endLineNumber) && (i = !1),
          t.push({
            startLineNumber: s.startLineNumber,
            endLineNumber: s.endLineNumber,
            type: o.type,
            isCollapsed: i,
            source: r,
          }));
      }
    }
    return t;
  }
  getMemento() {
    const e = this._currentFoldedOrManualRanges(),
      t = [],
      n = this._textModel.getLineCount();
    for (let i = 0, r = e.length; i < r; i++) {
      const r = e[i];
      if (r.startLineNumber >= r.endLineNumber || r.startLineNumber < 1 || r.endLineNumber > n)
        continue;
      const o = this._getLinesChecksum(r.startLineNumber + 1, r.endLineNumber);
      t.push({
        startLineNumber: r.startLineNumber,
        endLineNumber: r.endLineNumber,
        isCollapsed: r.isCollapsed,
        source: r.source,
        checksum: o,
      });
    }
    return t.length > 0 ? t : void 0;
  }
  applyMemento(e) {
    if (!Array.isArray(e)) return;
    const t = [],
      n = this._textModel.getLineCount();
    for (const r of e) {
      if (r.startLineNumber >= r.endLineNumber || r.startLineNumber < 1 || r.endLineNumber > n)
        continue;
      const e = this._getLinesChecksum(r.startLineNumber + 1, r.endLineNumber);
      (r.checksum && e !== r.checksum) ||
        t.push({
          startLineNumber: r.startLineNumber,
          endLineNumber: r.endLineNumber,
          type: void 0,
          isCollapsed: r.isCollapsed ?? !0,
          source: r.source ?? 0,
        });
    }
    const i = UEe.sanitizeAndMerge(this._regions, t, n);
    this.updatePost(UEe.fromFoldRanges(i));
  }
  _getLinesChecksum(e, t) {
    return UP(this._textModel.getLineContent(e) + this._textModel.getLineContent(t)) % 1e6;
  }
  dispose() {
    this._decorationProvider.removeDecorations(this._editorDecorationIds);
  }
  getAllRegionsAtLine(e, t) {
    const n = [];
    if (this._regions) {
      let i = this._regions.findRange(e),
        r = 1;
      for (; i >= 0; ) {
        const e = this._regions.toRegion(i);
        ((t && !t(e, r)) || n.push(e), r++, (i = e.parentIndex));
      }
    }
    return n;
  }
  getRegionAtLine(e) {
    if (this._regions) {
      const t = this._regions.findRange(e);
      if (t >= 0) return this._regions.toRegion(t);
    }
    return null;
  }
  getRegionsInside(e, t) {
    const n = [],
      i = e ? e.regionIndex + 1 : 0,
      r = e ? e.endLineNumber : Number.MAX_VALUE;
    if (t && 2 === t.length) {
      const e = [];
      for (let o = i, s = this._regions.length; o < s; o++) {
        const i = this._regions.toRegion(o);
        if (!(this._regions.getStartLineNumber(o) < r)) break;
        for (; e.length > 0 && !i.containedBy(e[e.length - 1]); ) e.pop();
        (e.push(i), t(i, e.length) && n.push(i));
      }
    } else
      for (let o = i, s = this._regions.length; o < s; o++) {
        const e = this._regions.toRegion(o);
        if (!(this._regions.getStartLineNumber(o) < r)) break;
        (t && !t(e)) || n.push(e);
      }
    return n;
  }
}
function KEe(e, t, n) {
  const i = [];
  for (const r of n) {
    const n = e.getRegionAtLine(r);
    if (n) {
      const r = !n.isCollapsed;
      if ((i.push(n), t > 1)) {
        const o = e.getRegionsInside(n, (e, n) => e.isCollapsed !== r && n < t);
        i.push(...o);
      }
    }
  }
  e.toggleCollapseState(i);
}
function GEe(e, t, n = Number.MAX_VALUE, i) {
  const r = [];
  if (i && i.length > 0)
    for (const o of i) {
      const i = e.getRegionAtLine(o);
      if (i && (i.isCollapsed !== t && r.push(i), n > 1)) {
        const o = e.getRegionsInside(i, (e, i) => e.isCollapsed !== t && i < n);
        r.push(...o);
      }
    }
  else {
    const i = e.getRegionsInside(null, (e, i) => e.isCollapsed !== t && i < n);
    r.push(...i);
  }
  e.toggleCollapseState(r);
}
function ZEe(e, t, n, i) {
  const r = [];
  for (const o of i) {
    const i = e.getAllRegionsAtLine(o, (e, i) => e.isCollapsed !== t && i <= n);
    r.push(...i);
  }
  e.toggleCollapseState(r);
}
function YEe(e, t, n) {
  const i = [];
  for (const o of n) {
    const t = e.getAllRegionsAtLine(o, void 0);
    t.length > 0 && i.push(t[0]);
  }
  const r = e.getRegionsInside(
    null,
    (e) => i.every((t) => !t.containedBy(e) && !e.containedBy(t)) && e.isCollapsed !== t,
  );
  e.toggleCollapseState(r);
}
function XEe(e, t, n) {
  const i = e.textModel,
    r = e.regions,
    o = [];
  for (let s = r.length - 1; s >= 0; s--)
    if (n !== r.isCollapsed(s)) {
      const e = r.getStartLineNumber(s);
      t.test(i.getLineContent(e)) && o.push(r.toRegion(s));
    }
  e.toggleCollapseState(o);
}
function QEe(e, t, n) {
  const i = e.regions,
    r = [];
  for (let o = i.length - 1; o >= 0; o--)
    n !== i.isCollapsed(o) && t === i.getType(o) && r.push(i.toRegion(o));
  e.toggleCollapseState(r);
}
class JEe {
  get onDidChange() {
    return this._updateEventEmitter.event;
  }
  get hiddenRanges() {
    return this._hiddenRanges;
  }
  constructor(e) {
    ((this._updateEventEmitter = new QO()),
      (this._hasLineChanges = !1),
      (this._foldingModel = e),
      (this._foldingModelListener = e.onDidChange((e) => this.updateHiddenRanges())),
      (this._hiddenRanges = []),
      e.regions.length && this.updateHiddenRanges());
  }
  notifyChangeModelContent(e) {
    this._hiddenRanges.length &&
      !this._hasLineChanges &&
      (this._hasLineChanges = e.changes.some(
        (e) => e.range.endLineNumber !== e.range.startLineNumber || 0 !== Q3(e.text)[0],
      ));
  }
  updateHiddenRanges() {
    let e = !1;
    const t = [];
    let n = 0,
      i = 0,
      r = Number.MAX_VALUE,
      o = -1;
    const s = this._foldingModel.regions;
    for (; n < s.length; n++) {
      if (!s.isCollapsed(n)) continue;
      const a = s.getStartLineNumber(n) + 1,
        l = s.getEndLineNumber(n);
      (r <= a && l <= o) ||
        (!e &&
        i < this._hiddenRanges.length &&
        this._hiddenRanges[i].startLineNumber === a &&
        this._hiddenRanges[i].endLineNumber === l
          ? (t.push(this._hiddenRanges[i]), i++)
          : ((e = !0), t.push(new YH(a, 1, l, 1))),
        (r = a),
        (o = l));
    }
    (this._hasLineChanges || e || i < this._hiddenRanges.length) && this.applyHiddenRanges(t);
  }
  applyHiddenRanges(e) {
    ((this._hiddenRanges = e), (this._hasLineChanges = !1), this._updateEventEmitter.fire(e));
  }
  hasRanges() {
    return this._hiddenRanges.length > 0;
  }
  isHidden(e) {
    return null !== eNe(this._hiddenRanges, e);
  }
  adjustSelections(e) {
    let t = !1;
    const n = this._foldingModel.textModel;
    let i = null;
    const r = (e) => (
      (i &&
        (function (e, t) {
          return e >= t.startLineNumber && e <= t.endLineNumber;
        })(e, i)) ||
        (i = eNe(this._hiddenRanges, e)),
      i ? i.startLineNumber - 1 : null
    );
    for (let o = 0, s = e.length; o < s; o++) {
      let i = e[o];
      const s = r(i.startLineNumber);
      s && ((i = i.setStartPosition(s, n.getLineMaxColumn(s))), (t = !0));
      const a = r(i.endLineNumber);
      (a && ((i = i.setEndPosition(a, n.getLineMaxColumn(a))), (t = !0)), (e[o] = i));
    }
    return t;
  }
  dispose() {
    (this.hiddenRanges.length > 0 &&
      ((this._hiddenRanges = []), this._updateEventEmitter.fire(this._hiddenRanges)),
      this._foldingModelListener &&
        (this._foldingModelListener.dispose(), (this._foldingModelListener = null)));
  }
}
function eNe(e, t) {
  const n = A1(e, (e) => t < e.startLineNumber) - 1;
  return n >= 0 && e[n].endLineNumber >= t ? e[n] : null;
}
class tNe {
  constructor(e, t, n) {
    ((this.editorModel = e),
      (this.languageConfigurationService = t),
      (this.foldingRangesLimit = n),
      (this.id = "indent"));
  }
  dispose() {}
  compute(e) {
    const t = this.languageConfigurationService.getLanguageConfiguration(
        this.editorModel.getLanguageId(),
      ).foldingRules,
      n = t && !!t.offSide,
      i = t && t.markers;
    return Promise.resolve(
      (function (e, t, n, i = iNe) {
        const r = e.getOptions().tabSize,
          o = new nNe(i);
        let s;
        n && (s = new RegExp(`(${n.start.source})|(?:${n.end.source})`));
        const a = [],
          l = e.getLineCount() + 1;
        a.push({ indent: -1, endAbove: l, line: l });
        for (let c = e.getLineCount(); c > 0; c--) {
          const n = e.getLineContent(c),
            i = H1(n, r);
          let l,
            d = a[a.length - 1];
          if (-1 !== i) {
            if (s && (l = n.match(s))) {
              if (!l[1]) {
                a.push({ indent: -2, endAbove: c, line: c });
                continue;
              }
              {
                let e = a.length - 1;
                for (; e > 0 && -2 !== a[e].indent; ) e--;
                if (e > 0) {
                  ((a.length = e + 1),
                    (d = a[e]),
                    o.insertFirst(c, d.line, i),
                    (d.line = c),
                    (d.indent = i),
                    (d.endAbove = c));
                  continue;
                }
              }
            }
            if (d.indent > i) {
              do {
                (a.pop(), (d = a[a.length - 1]));
              } while (d.indent > i);
              const e = d.endAbove - 1;
              e - c >= 1 && o.insertFirst(c, e, i);
            }
            d.indent === i ? (d.endAbove = c) : a.push({ indent: i, endAbove: c, line: c });
          } else t && (d.endAbove = c);
        }
        return o.toIndentRanges(e);
      })(this.editorModel, n, i, this.foldingRangesLimit),
    );
  }
}
let nNe = class {
  constructor(e) {
    ((this._startIndexes = []),
      (this._endIndexes = []),
      (this._indentOccurrences = []),
      (this._length = 0),
      (this._foldingRangesLimit = e));
  }
  insertFirst(e, t, n) {
    if (e > WEe || t > WEe) return;
    const i = this._length;
    ((this._startIndexes[i] = e),
      (this._endIndexes[i] = t),
      this._length++,
      n < 1e3 && (this._indentOccurrences[n] = (this._indentOccurrences[n] || 0) + 1));
  }
  toIndentRanges(e) {
    const t = this._foldingRangesLimit.limit;
    if (this._length <= t) {
      this._foldingRangesLimit.update(this._length, !1);
      const e = new Uint32Array(this._length),
        t = new Uint32Array(this._length);
      for (let n = this._length - 1, i = 0; n >= 0; n--, i++)
        ((e[i] = this._startIndexes[n]), (t[i] = this._endIndexes[n]));
      return new UEe(e, t);
    }
    {
      this._foldingRangesLimit.update(this._length, t);
      let n = 0,
        i = this._indentOccurrences.length;
      for (let e = 0; e < this._indentOccurrences.length; e++) {
        const r = this._indentOccurrences[e];
        if (r) {
          if (r + n > t) {
            i = e;
            break;
          }
          n += r;
        }
      }
      const r = e.getOptions().tabSize,
        o = new Uint32Array(t),
        s = new Uint32Array(t);
      for (let a = this._length - 1, l = 0; a >= 0; a--) {
        const c = this._startIndexes[a],
          d = H1(e.getLineContent(c), r);
        (d < i || (d === i && n++ < t)) && ((o[l] = c), (s[l] = this._endIndexes[a]), l++);
      }
      return new UEe(o, s);
    }
  }
};
const iNe = { limit: 5e3, update: () => {} };
const rNe = SG(
  "editor.foldBackground",
  { light: NG(lZ, 0.3), dark: NG(lZ, 0.3), hcDark: null, hcLight: null },
  SI(
    1002,
    "Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations.",
  ),
  !0,
);
(SG(
  "editor.foldPlaceholderForeground",
  { light: "#808080", dark: "#808080", hcDark: null, hcLight: null },
  SI(1003, "Color of the collapsed text after the first line of a folded range."),
),
  SG(
    "editorGutter.foldingControlForeground",
    PG,
    SI(1004, "Color of the folding control in the editor gutter."),
  ));
const oNe = Zle(
    "folding-expanded",
    OV.chevronDown,
    SI(1005, "Icon for expanded ranges in the editor glyph margin."),
  ),
  sNe = Zle(
    "folding-collapsed",
    OV.chevronRight,
    SI(1006, "Icon for collapsed ranges in the editor glyph margin."),
  ),
  aNe = Zle(
    "folding-manual-collapsed",
    sNe,
    SI(1007, "Icon for manually collapsed ranges in the editor glyph margin."),
  ),
  lNe = Zle(
    "folding-manual-expanded",
    oNe,
    SI(1008, "Icon for manually expanded ranges in the editor glyph margin."),
  ),
  cNe = { color: g0(rNe), position: 1 },
  dNe = SI(1009, "Click to expand the range."),
  uNe = SI(1010, "Click to collapse the range.");
class hNe {
  static {
    this.COLLAPSED_VISUAL_DECORATION = cee.register({
      description: "folding-collapsed-visual-decoration",
      stickiness: 0,
      afterContentClassName: "inline-folded",
      isWholeLine: !0,
      linesDecorationsTooltip: dNe,
      firstLineDecorationClassName: AV.asClassName(sNe),
    });
  }
  static {
    this.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = cee.register({
      description: "folding-collapsed-highlighted-visual-decoration",
      stickiness: 0,
      afterContentClassName: "inline-folded",
      className: "folded-background",
      minimap: cNe,
      isWholeLine: !0,
      linesDecorationsTooltip: dNe,
      firstLineDecorationClassName: AV.asClassName(sNe),
    });
  }
  static {
    this.MANUALLY_COLLAPSED_VISUAL_DECORATION = cee.register({
      description: "folding-manually-collapsed-visual-decoration",
      stickiness: 0,
      afterContentClassName: "inline-folded",
      isWholeLine: !0,
      linesDecorationsTooltip: dNe,
      firstLineDecorationClassName: AV.asClassName(aNe),
    });
  }
  static {
    this.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = cee.register({
      description: "folding-manually-collapsed-highlighted-visual-decoration",
      stickiness: 0,
      afterContentClassName: "inline-folded",
      className: "folded-background",
      minimap: cNe,
      isWholeLine: !0,
      linesDecorationsTooltip: dNe,
      firstLineDecorationClassName: AV.asClassName(aNe),
    });
  }
  static {
    this.NO_CONTROLS_COLLAPSED_RANGE_DECORATION = cee.register({
      description: "folding-no-controls-range-decoration",
      stickiness: 0,
      afterContentClassName: "inline-folded",
      isWholeLine: !0,
      linesDecorationsTooltip: dNe,
    });
  }
  static {
    this.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION = cee.register({
      description: "folding-no-controls-range-decoration",
      stickiness: 0,
      afterContentClassName: "inline-folded",
      className: "folded-background",
      minimap: cNe,
      isWholeLine: !0,
      linesDecorationsTooltip: dNe,
    });
  }
  static {
    this.EXPANDED_VISUAL_DECORATION = cee.register({
      description: "folding-expanded-visual-decoration",
      stickiness: 1,
      isWholeLine: !0,
      firstLineDecorationClassName: "alwaysShowFoldIcons " + AV.asClassName(oNe),
      linesDecorationsTooltip: uNe,
    });
  }
  static {
    this.EXPANDED_AUTO_HIDE_VISUAL_DECORATION = cee.register({
      description: "folding-expanded-auto-hide-visual-decoration",
      stickiness: 1,
      isWholeLine: !0,
      firstLineDecorationClassName: AV.asClassName(oNe),
      linesDecorationsTooltip: uNe,
    });
  }
  static {
    this.MANUALLY_EXPANDED_VISUAL_DECORATION = cee.register({
      description: "folding-manually-expanded-visual-decoration",
      stickiness: 0,
      isWholeLine: !0,
      firstLineDecorationClassName: "alwaysShowFoldIcons " + AV.asClassName(lNe),
      linesDecorationsTooltip: uNe,
    });
  }
  static {
    this.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION = cee.register({
      description: "folding-manually-expanded-auto-hide-visual-decoration",
      stickiness: 0,
      isWholeLine: !0,
      firstLineDecorationClassName: AV.asClassName(lNe),
      linesDecorationsTooltip: uNe,
    });
  }
  static {
    this.NO_CONTROLS_EXPANDED_RANGE_DECORATION = cee.register({
      description: "folding-no-controls-range-decoration",
      stickiness: 0,
      isWholeLine: !0,
    });
  }
  static {
    this.HIDDEN_RANGE_DECORATION = cee.register({
      description: "folding-hidden-range-decoration",
      stickiness: 1,
    });
  }
  constructor(e) {
    ((this.editor = e),
      (this.showFoldingControls = "mouseover"),
      (this.showFoldingHighlights = !0));
  }
  getDecorationOption(e, t, n) {
    return t
      ? hNe.HIDDEN_RANGE_DECORATION
      : "never" === this.showFoldingControls
        ? e
          ? this.showFoldingHighlights
            ? hNe.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION
            : hNe.NO_CONTROLS_COLLAPSED_RANGE_DECORATION
          : hNe.NO_CONTROLS_EXPANDED_RANGE_DECORATION
        : e
          ? n
            ? this.showFoldingHighlights
              ? hNe.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION
              : hNe.MANUALLY_COLLAPSED_VISUAL_DECORATION
            : this.showFoldingHighlights
              ? hNe.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION
              : hNe.COLLAPSED_VISUAL_DECORATION
          : "mouseover" === this.showFoldingControls
            ? n
              ? hNe.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION
              : hNe.EXPANDED_AUTO_HIDE_VISUAL_DECORATION
            : n
              ? hNe.MANUALLY_EXPANDED_VISUAL_DECORATION
              : hNe.EXPANDED_VISUAL_DECORATION;
  }
  changeDecorations(e) {
    return this.editor.changeDecorations(e);
  }
  removeDecorations(e) {
    this.editor.removeDecorations(e);
  }
}
const gNe = {};
class pNe {
  constructor(e, t, n, i, r) {
    ((this.editorModel = e),
      (this.providers = t),
      (this.handleFoldingRangesChange = n),
      (this.foldingRangesLimit = i),
      (this.fallbackRangeProvider = r),
      (this.id = "syntax"),
      (this.disposables = new AO()),
      r && this.disposables.add(r));
    for (const o of t) "function" == typeof o.onDidChange && this.disposables.add(o.onDidChange(n));
  }
  compute(e) {
    return (function (e, t, n) {
      let i = null;
      const r = e.map((e, r) =>
        Promise.resolve(e.provideFoldingRanges(t, gNe, n)).then((e) => {
          if (!n.isCancellationRequested && Array.isArray(e)) {
            Array.isArray(i) || (i = []);
            const n = t.getLineCount();
            for (const t of e)
              t.start > 0 &&
                t.end > t.start &&
                t.end <= n &&
                i.push({ start: t.start, end: t.end, rank: r, kind: t.kind });
          }
        }, zI),
      );
      return Promise.all(r).then((e) => i);
    })(this.providers, this.editorModel, e).then((t) => {
      if (this.editorModel.isDisposed()) return null;
      if (t) {
        return (function (e, t) {
          const n = e.sort((e, t) => {
              let n = e.start - t.start;
              return (0 === n && (n = e.rank - t.rank), n);
            }),
            i = new fNe(t);
          let r;
          const o = [];
          for (const s of n)
            if (r) {
              if (s.start > r.start)
                if (s.end <= r.end)
                  (o.push(r), (r = s), i.add(s.start, s.end, s.kind && s.kind.value, o.length));
                else {
                  if (s.start > r.end) {
                    do {
                      r = o.pop();
                    } while (r && s.start > r.end);
                    (r && o.push(r), (r = s));
                  }
                  i.add(s.start, s.end, s.kind && s.kind.value, o.length);
                }
            } else ((r = s), i.add(s.start, s.end, s.kind && s.kind.value, o.length));
          return i.toIndentRanges();
        })(t, this.foldingRangesLimit);
      }
      return this.fallbackRangeProvider?.compute(e) ?? null;
    });
  }
  dispose() {
    this.disposables.dispose();
  }
}
class fNe {
  constructor(e) {
    ((this._startIndexes = []),
      (this._endIndexes = []),
      (this._nestingLevels = []),
      (this._nestingLevelCounts = []),
      (this._types = []),
      (this._length = 0),
      (this._foldingRangesLimit = e));
  }
  add(e, t, n, i) {
    if (e > WEe || t > WEe) return;
    const r = this._length;
    ((this._startIndexes[r] = e),
      (this._endIndexes[r] = t),
      (this._nestingLevels[r] = i),
      (this._types[r] = n),
      this._length++,
      i < 30 && (this._nestingLevelCounts[i] = (this._nestingLevelCounts[i] || 0) + 1));
  }
  toIndentRanges() {
    const e = this._foldingRangesLimit.limit;
    if (this._length <= e) {
      this._foldingRangesLimit.update(this._length, !1);
      const e = new Uint32Array(this._length),
        t = new Uint32Array(this._length);
      for (let n = 0; n < this._length; n++)
        ((e[n] = this._startIndexes[n]), (t[n] = this._endIndexes[n]));
      return new UEe(e, t, this._types);
    }
    {
      this._foldingRangesLimit.update(this._length, e);
      let t = 0,
        n = this._nestingLevelCounts.length;
      for (let s = 0; s < this._nestingLevelCounts.length; s++) {
        const i = this._nestingLevelCounts[s];
        if (i) {
          if (i + t > e) {
            n = s;
            break;
          }
          t += i;
        }
      }
      const i = new Uint32Array(e),
        r = new Uint32Array(e),
        o = [];
      for (let s = 0, a = 0; s < this._length; s++) {
        const l = this._nestingLevels[s];
        (l < n || (l === n && t++ < e)) &&
          ((i[a] = this._startIndexes[s]),
          (r[a] = this._endIndexes[s]),
          (o[a] = this._types[s]),
          a++);
      }
      return new UEe(i, r, o);
    }
  }
}
var mNe,
  _Ne = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const vNe = new yW("foldingEnabled", !1);
let bNe = class extends PO {
  static {
    mNe = this;
  }
  static {
    this.ID = "editor.contrib.folding";
  }
  static get(e) {
    return e.getContribution(mNe.ID);
  }
  static getFoldingRangeProviders(e, t) {
    const n = e.foldingRangeProvider.ordered(t);
    return mNe._foldingRangeSelector?.(n, t) ?? n;
  }
  constructor(e, t, n, i, r, o) {
    (super(),
      (this.contextKeyService = t),
      (this.languageConfigurationService = n),
      (this.languageFeaturesService = o),
      (this.localToDispose = this._register(new AO())),
      (this.editor = e),
      (this._foldingLimitReporter = this._register(new yNe(e))));
    const s = this.editor.getOptions();
    ((this._isEnabled = s.get(52)),
      (this._useFoldingProviders = "indentation" !== s.get(53)),
      (this._unfoldOnClickAfterEndOfLine = s.get(57)),
      (this._restoringViewState = !1),
      (this._currentModelHasFoldedImports = !1),
      (this._foldingImportsByDefault = s.get(55)),
      (this.updateDebounceInfo = r.for(o.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 hNe(e)),
      (this.foldingDecorationProvider.showFoldingControls = s.get(126)),
      (this.foldingDecorationProvider.showFoldingHighlights = s.get(54)),
      (this.foldingEnabled = vNe.bindTo(this.contextKeyService)),
      this.foldingEnabled.set(this._isEnabled),
      this._register(this.editor.onDidChangeModel(() => this.onModelChanged())),
      this._register(
        this.editor.onDidChangeConfiguration((e) => {
          if (
            (e.hasChanged(52) &&
              ((this._isEnabled = this.editor.getOptions().get(52)),
              this.foldingEnabled.set(this._isEnabled),
              this.onModelChanged()),
            e.hasChanged(56) && this.onModelChanged(),
            e.hasChanged(126) || e.hasChanged(54))
          ) {
            const e = this.editor.getOptions();
            ((this.foldingDecorationProvider.showFoldingControls = e.get(126)),
              (this.foldingDecorationProvider.showFoldingHighlights = e.get(54)),
              this.triggerFoldingModelChanged());
          }
          (e.hasChanged(53) &&
            ((this._useFoldingProviders = "indentation" !== this.editor.getOptions().get(53)),
            this.onFoldingStrategyChanged()),
            e.hasChanged(57) &&
              (this._unfoldOnClickAfterEndOfLine = this.editor.getOptions().get(57)),
            e.hasChanged(55) && (this._foldingImportsByDefault = this.editor.getOptions().get(55)));
        }),
      ),
      this.onModelChanged());
  }
  saveViewState() {
    const e = this.editor.getModel();
    if (!e || !this._isEnabled || e.isTooLargeForTokenization()) return {};
    if (this.foldingModel) {
      const t = this.foldingModel.getMemento(),
        n = this.rangeProvider ? this.rangeProvider.id : void 0;
      return {
        collapsedRegions: t,
        lineCount: e.getLineCount(),
        provider: n,
        foldedImports: this._currentModelHasFoldedImports,
      };
    }
  }
  restoreViewState(e) {
    const t = this.editor.getModel();
    if (
      t &&
      this._isEnabled &&
      !t.isTooLargeForTokenization() &&
      this.hiddenRangeModel &&
      e &&
      ((this._currentModelHasFoldedImports = !!e.foldedImports),
      e.collapsedRegions && e.collapsedRegions.length > 0 && this.foldingModel)
    ) {
      this._restoringViewState = !0;
      try {
        this.foldingModel.applyMemento(e.collapsedRegions);
      } finally {
        this._restoringViewState = !1;
      }
    }
  }
  onModelChanged() {
    this.localToDispose.clear();
    const e = this.editor.getModel();
    this._isEnabled &&
      e &&
      !e.isTooLargeForTokenization() &&
      ((this._currentModelHasFoldedImports = !1),
      (this.foldingModel = new qEe(e, this.foldingDecorationProvider)),
      this.localToDispose.add(this.foldingModel),
      (this.hiddenRangeModel = new JEe(this.foldingModel)),
      this.localToDispose.add(this.hiddenRangeModel),
      this.localToDispose.add(
        this.hiddenRangeModel.onDidChange((e) => this.onHiddenRangesChanges(e)),
      ),
      (this.updateScheduler = new mM(this.updateDebounceInfo.get(e))),
      this.localToDispose.add(this.updateScheduler),
      (this.cursorChangedScheduler = new EM(() => 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((e) => this.onDidChangeModelContent(e)),
      ),
      this.localToDispose.add(
        this.editor.onDidChangeCursorPosition(() => this.onCursorPositionChanged()),
      ),
      this.localToDispose.add(this.editor.onMouseDown((e) => this.onEditorMouseDown(e))),
      this.localToDispose.add(this.editor.onMouseUp((e) => this.onEditorMouseUp(e))),
      this.localToDispose.add({
        dispose: () => {
          (this.foldingRegionPromise &&
            (this.foldingRegionPromise.cancel(), (this.foldingRegionPromise = 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(e) {
    if (this.rangeProvider) return this.rangeProvider;
    const t = new tNe(e, this.languageConfigurationService, this._foldingLimitReporter);
    if (((this.rangeProvider = t), this._useFoldingProviders && this.foldingModel)) {
      const n = mNe.getFoldingRangeProviders(this.languageFeaturesService, e);
      n.length > 0 &&
        (this.rangeProvider = new pNe(
          e,
          n,
          () => this.triggerFoldingModelChanged(),
          this._foldingLimitReporter,
          t,
        ));
    }
    return this.rangeProvider;
  }
  getFoldingModel() {
    return this.foldingModelPromise;
  }
  onDidChangeModelContent(e) {
    (this.hiddenRangeModel?.notifyChangeModelContent(e), this.triggerFoldingModelChanged());
  }
  triggerFoldingModelChanged() {
    this.updateScheduler &&
      (this.foldingRegionPromise &&
        (this.foldingRegionPromise.cancel(), (this.foldingRegionPromise = null)),
      (this.foldingModelPromise = this.updateScheduler
        .trigger(() => {
          const e = this.foldingModel;
          if (!e) return null;
          const t = new UO(),
            n = this.getRangeProvider(e.textModel),
            i = (this.foldingRegionPromise = gM((e) => n.compute(e)));
          return i.then((n) => {
            if (n && i === this.foldingRegionPromise) {
              let i;
              if (this._foldingImportsByDefault && !this._currentModelHasFoldedImports) {
                const e = n.setCollapsedAllOfType(k2.Imports.value, !0);
                e && ((i = Mne.capture(this.editor)), (this._currentModelHasFoldedImports = e));
              }
              const r = this.editor.getSelections();
              (e.update(
                n,
                (function (e) {
                  if (!e || 0 === e.length) return { startsInside: () => !1 };
                  return {
                    startsInside(t, n) {
                      for (const i of e) {
                        const e = i.startLineNumber;
                        if (e >= t && e <= n) return !0;
                      }
                      return !1;
                    },
                  };
                })(r),
              ),
                i?.restore(this.editor));
              const o = this.updateDebounceInfo.update(e.textModel, t.elapsed());
              this.updateScheduler && (this.updateScheduler.defaultDelay = o);
            }
            return e;
          });
        })
        .then(void 0, (e) => (HI(e), null))));
  }
  onHiddenRangesChanges(e) {
    if (this.hiddenRangeModel && e.length && !this._restoringViewState) {
      const e = this.editor.getSelections();
      e && this.hiddenRangeModel.adjustSelections(e) && this.editor.setSelections(e);
    }
    this.editor.setHiddenAreas(e, this);
  }
  onCursorPositionChanged() {
    this.hiddenRangeModel &&
      this.hiddenRangeModel.hasRanges() &&
      this.cursorChangedScheduler.schedule();
  }
  revealCursor() {
    const e = this.getFoldingModel();
    e &&
      e
        .then((e) => {
          if (e) {
            const t = this.editor.getSelections();
            if (t && t.length > 0) {
              const n = [];
              for (const i of t) {
                const t = i.selectionStartLineNumber;
                this.hiddenRangeModel &&
                  this.hiddenRangeModel.isHidden(t) &&
                  n.push(
                    ...e.getAllRegionsAtLine(t, (e) => e.isCollapsed && t > e.startLineNumber),
                  );
              }
              n.length && (e.toggleCollapseState(n), this.reveal(t[0].getPosition()));
            }
          }
        })
        .then(void 0, HI);
  }
  onEditorMouseDown(e) {
    if (((this.mouseDownInfo = null), !this.hiddenRangeModel || !e.target || !e.target.range))
      return;
    if (!e.event.leftButton && !e.event.middleButton) return;
    const t = e.target.range;
    let n = !1;
    switch (e.target.type) {
      case 4: {
        const t = e.target.detail,
          i = e.target.element.offsetLeft;
        if (t.offsetX - i < 4) return;
        n = !0;
        break;
      }
      case 7:
        if (this._unfoldOnClickAfterEndOfLine && this.hiddenRangeModel.hasRanges()) {
          if (!e.target.detail.isAfterLines) break;
        }
        return;
      case 6:
        if (this.hiddenRangeModel.hasRanges()) {
          const e = this.editor.getModel();
          if (e && t.startColumn === e.getLineMaxColumn(t.startLineNumber)) break;
        }
        return;
      default:
        return;
    }
    this.mouseDownInfo = { lineNumber: t.startLineNumber, iconClicked: n };
  }
  onEditorMouseUp(e) {
    const t = this.foldingModel;
    if (!t || !this.mouseDownInfo || !e.target) return;
    const n = this.mouseDownInfo.lineNumber,
      i = this.mouseDownInfo.iconClicked,
      r = e.target.range;
    if (!r || r.startLineNumber !== n) return;
    if (i) {
      if (4 !== e.target.type) return;
    } else {
      const e = this.editor.getModel();
      if (!e || r.startColumn !== e.getLineMaxColumn(n)) return;
    }
    const o = t.getRegionAtLine(n);
    if (o && o.startLineNumber === n) {
      const r = o.isCollapsed;
      if (i || r) {
        let i = [];
        if (e.event.altKey) {
          const e = (e) => !e.containedBy(o) && !o.containedBy(e),
            n = t.getRegionsInside(null, e);
          for (const t of n) t.isCollapsed && i.push(t);
          0 === i.length && (i = n);
        } else {
          const n = e.event.middleButton || e.event.shiftKey;
          if (n) for (const e of t.getRegionsInside(o)) e.isCollapsed === r && i.push(e);
          (!r && n && 0 !== i.length) || i.push(o);
        }
        (t.toggleCollapseState(i), this.reveal({ lineNumber: n, column: 1 }));
      }
    }
  }
  reveal(e) {
    this.editor.revealPositionInCenterIfOutsideViewport(e, 0);
  }
};
bNe = mNe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([_Ne(1, xW), _Ne(2, f$), _Ne(3, Y4), _Ne(4, gme), _Ne(5, mee)], bNe);
class yNe extends PO {
  constructor(e) {
    (super(),
      (this.editor = e),
      (this._onDidChange = this._register(new QO())),
      (this._computed = 0),
      (this._limited = !1));
  }
  get limit() {
    return this.editor.getOptions().get(56);
  }
  update(e, t) {
    (e === this._computed && t === this._limited) ||
      ((this._computed = e), (this._limited = t), this._onDidChange.fire());
  }
}
class xNe extends AH {
  runEditorCommand(e, t, n) {
    const i = e.get(f$),
      r = bNe.get(t);
    if (!r) return;
    const o = r.getFoldingModel();
    return o
      ? (this.reportTelemetry(e, t),
        o.then((e) => {
          if (e) {
            this.invoke(r, e, t, n, i);
            const o = t.getSelection();
            o && r.reveal(o.getStartPosition());
          }
        }))
      : void 0;
  }
  getSelectedLines(e) {
    const t = e.getSelections();
    return t ? t.map((e) => e.startLineNumber) : [];
  }
  getLineNumbers(e, t) {
    return e && e.selectionLines ? e.selectionLines.map((e) => e + 1) : this.getSelectedLines(t);
  }
  run(e, t) {}
}
function wNe(e) {
  if (!uR(e)) {
    if (!sR(e)) return !1;
    const t = e;
    if (!uR(t.levels) && !lR(t.levels)) return !1;
    if (!uR(t.direction) && !oR(t.direction)) return !1;
    if (!(uR(t.selectionLines) || (Array.isArray(t.selectionLines) && t.selectionLines.every(lR))))
      return !1;
  }
  return !0;
}
class CNe extends xNe {
  static {
    this.ID_PREFIX = "editor.foldLevel";
  }
  static {
    this.ID = (e) => CNe.ID_PREFIX + e;
  }
  getFoldingLevel() {
    return parseInt(this.id.substr(CNe.ID_PREFIX.length));
  }
  invoke(e, t, n) {
    !(function (e, t, n, i) {
      const r = e.getRegionsInside(
        null,
        (e, r) => r === t && e.isCollapsed !== n && !i.some((t) => e.containsLine(t)),
      );
      e.toggleCollapseState(r);
    })(t, this.getFoldingLevel(), !0, this.getSelectedLines(n));
  }
}
(zH(bNe.ID, bNe, 0),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.unfold",
          label: EI(982, "Unfold"),
          precondition: vNe,
          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:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* '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.\n\t\t\t\t\t\t",
                constraint: wNe,
                schema: {
                  type: "object",
                  properties: {
                    levels: { type: "number", default: 1 },
                    direction: { type: "string", enum: ["up", "down"], default: "down" },
                    selectionLines: { type: "array", items: { type: "number" } },
                  },
                },
              },
            ],
          },
        });
      }
      invoke(e, t, n, i) {
        const r = (i && i.levels) || 1,
          o = this.getLineNumbers(i, n);
        i && "up" === i.direction ? ZEe(t, !1, r, o) : GEe(t, !1, r, o);
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.unfoldRecursively",
          label: EI(983, "Unfold Recursively"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2142), weight: 100 },
        });
      }
      invoke(e, t, n, i) {
        GEe(t, !1, Number.MAX_VALUE, this.getSelectedLines(n));
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.fold",
          label: EI(984, "Fold"),
          precondition: vNe,
          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:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* '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.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t",
                constraint: wNe,
                schema: {
                  type: "object",
                  properties: {
                    levels: { type: "number" },
                    direction: { type: "string", enum: ["up", "down"] },
                    selectionLines: { type: "array", items: { type: "number" } },
                  },
                },
              },
            ],
          },
        });
      }
      invoke(e, t, n, i) {
        const r = this.getLineNumbers(i, n),
          o = i && i.levels,
          s = i && i.direction;
        "number" != typeof o && "string" != typeof s
          ? (function (e, t, n) {
              const i = [];
              for (const r of n) {
                const n = e.getAllRegionsAtLine(r, (e) => e.isCollapsed !== t);
                n.length > 0 && i.push(n[0]);
              }
              e.toggleCollapseState(i);
            })(t, !0, r)
          : "up" === s
            ? ZEe(t, !0, o || 1, r)
            : GEe(t, !0, o || 1, r);
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.foldRecursively",
          label: EI(986, "Fold Recursively"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2140), weight: 100 },
        });
      }
      invoke(e, t, n) {
        const i = this.getSelectedLines(n);
        GEe(t, !0, Number.MAX_VALUE, i);
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.toggleFoldRecursively",
          label: EI(987, "Toggle Fold Recursively"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 3114), weight: 100 },
        });
      }
      invoke(e, t, n) {
        const i = this.getSelectedLines(n);
        KEe(t, Number.MAX_VALUE, i);
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.foldAll",
          label: EI(993, "Fold All"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2069), weight: 100 },
        });
      }
      invoke(e, t, n) {
        GEe(t, !0);
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.unfoldAll",
          label: EI(994, "Unfold All"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2088), weight: 100 },
        });
      }
      invoke(e, t, n) {
        GEe(t, !1);
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.foldAllBlockComments",
          label: EI(988, "Fold All Block Comments"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2138), weight: 100 },
        });
      }
      invoke(e, t, n, i, r) {
        if (t.regions.hasTypes()) QEe(t, k2.Comment.value, !0);
        else {
          const e = n.getModel();
          if (!e) return;
          const i = r.getLanguageConfiguration(e.getLanguageId()).comments;
          if (i && i.blockCommentStartToken) {
            XEe(t, new RegExp("^\\s*" + zM(i.blockCommentStartToken)), !0);
          }
        }
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.foldAllMarkerRegions",
          label: EI(989, "Fold All Regions"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2077), weight: 100 },
        });
      }
      invoke(e, t, n, i, r) {
        if (t.regions.hasTypes()) QEe(t, k2.Region.value, !0);
        else {
          const e = n.getModel();
          if (!e) return;
          const i = r.getLanguageConfiguration(e.getLanguageId()).foldingRules;
          if (i && i.markers && i.markers.start) {
            XEe(t, new RegExp(i.markers.start), !0);
          }
        }
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.unfoldAllMarkerRegions",
          label: EI(990, "Unfold All Regions"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2078), weight: 100 },
        });
      }
      invoke(e, t, n, i, r) {
        if (t.regions.hasTypes()) QEe(t, k2.Region.value, !1);
        else {
          const e = n.getModel();
          if (!e) return;
          const i = r.getLanguageConfiguration(e.getLanguageId()).foldingRules;
          if (i && i.markers && i.markers.start) {
            XEe(t, new RegExp(i.markers.start), !1);
          }
        }
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.foldAllExcept",
          label: EI(991, "Fold All Except Selected"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2136), weight: 100 },
        });
      }
      invoke(e, t, n) {
        YEe(t, !0, this.getSelectedLines(n));
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.unfoldAllExcept",
          label: EI(992, "Unfold All Except Selected"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2134), weight: 100 },
        });
      }
      invoke(e, t, n) {
        YEe(t, !1, this.getSelectedLines(n));
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.toggleFold",
          label: EI(985, "Toggle Fold"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2090), weight: 100 },
        });
      }
      invoke(e, t, n) {
        KEe(t, 1, this.getSelectedLines(n));
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.gotoParentFold",
          label: EI(995, "Go to Parent Fold"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, weight: 100 },
        });
      }
      invoke(e, t, n) {
        const i = this.getSelectedLines(n);
        if (i.length > 0) {
          const e = (function (e, t) {
            let n = null;
            const i = t.getRegionAtLine(e);
            if (null !== i && ((n = i.startLineNumber), e === n)) {
              const e = i.parentIndex;
              n = -1 !== e ? t.regions.getStartLineNumber(e) : null;
            }
            return n;
          })(i[0], t);
          null !== e &&
            n.setSelection({ startLineNumber: e, startColumn: 1, endLineNumber: e, endColumn: 1 });
        }
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.gotoPreviousFold",
          label: EI(996, "Go to Previous Folding Range"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, weight: 100 },
        });
      }
      invoke(e, t, n) {
        const i = this.getSelectedLines(n);
        if (i.length > 0) {
          const e = (function (e, t) {
            let n = t.getRegionAtLine(e);
            if (null !== n && n.startLineNumber === e) {
              if (e !== n.startLineNumber) return n.startLineNumber;
              {
                const e = n.parentIndex;
                let i = 0;
                for (-1 !== e && (i = t.regions.getStartLineNumber(n.parentIndex)); null !== n; ) {
                  if (!(n.regionIndex > 0)) return null;
                  if (((n = t.regions.toRegion(n.regionIndex - 1)), n.startLineNumber <= i))
                    return null;
                  if (n.parentIndex === e) return n.startLineNumber;
                }
              }
            } else if (t.regions.length > 0)
              for (n = t.regions.toRegion(t.regions.length - 1); null !== n; ) {
                if (n.startLineNumber < e) return n.startLineNumber;
                n = n.regionIndex > 0 ? t.regions.toRegion(n.regionIndex - 1) : null;
              }
            return null;
          })(i[0], t);
          null !== e &&
            n.setSelection({ startLineNumber: e, startColumn: 1, endLineNumber: e, endColumn: 1 });
        }
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.gotoNextFold",
          label: EI(997, "Go to Next Folding Range"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, weight: 100 },
        });
      }
      invoke(e, t, n) {
        const i = this.getSelectedLines(n);
        if (i.length > 0) {
          const e = (function (e, t) {
            let n = t.getRegionAtLine(e);
            if (null !== n && n.startLineNumber === e) {
              const e = n.parentIndex;
              let i = 0;
              if (-1 !== e) i = t.regions.getEndLineNumber(n.parentIndex);
              else {
                if (0 === t.regions.length) return null;
                i = t.regions.getEndLineNumber(t.regions.length - 1);
              }
              for (; null !== n; ) {
                if (!(n.regionIndex < t.regions.length)) return null;
                if (((n = t.regions.toRegion(n.regionIndex + 1)), n.startLineNumber >= i))
                  return null;
                if (n.parentIndex === e) return n.startLineNumber;
              }
            } else if (t.regions.length > 0)
              for (n = t.regions.toRegion(0); null !== n; ) {
                if (n.startLineNumber > e) return n.startLineNumber;
                n = n.regionIndex < t.regions.length ? t.regions.toRegion(n.regionIndex + 1) : null;
              }
            return null;
          })(i[0], t);
          null !== e &&
            n.setSelection({ startLineNumber: e, startColumn: 1, endLineNumber: e, endColumn: 1 });
        }
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.createFoldingRangeFromSelection",
          label: EI(998, "Create Folding Range from Selection"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2135), weight: 100 },
        });
      }
      invoke(e, t, n) {
        const i = [],
          r = n.getSelections();
        if (r) {
          for (const e of r) {
            let t = e.endLineNumber;
            (1 === e.endColumn && --t,
              t > e.startLineNumber &&
                (i.push({
                  startLineNumber: e.startLineNumber,
                  endLineNumber: t,
                  type: void 0,
                  isCollapsed: !0,
                  source: 1,
                }),
                n.setSelection({
                  startLineNumber: e.startLineNumber,
                  startColumn: 1,
                  endLineNumber: e.startLineNumber,
                  endColumn: 1,
                })));
          }
          if (i.length > 0) {
            i.sort((e, t) => e.startLineNumber - t.startLineNumber);
            const e = UEe.sanitizeAndMerge(t.regions, i, n.getModel()?.getLineCount());
            t.updatePost(UEe.fromFoldRanges(e));
          }
        }
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.removeManualFoldingRanges",
          label: EI(999, "Remove Manual Folding Ranges"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2137), weight: 100 },
        });
      }
      invoke(e, t, n) {
        const i = n.getSelections();
        if (i) {
          const n = [];
          for (const e of i) {
            const { startLineNumber: t, endLineNumber: i } = e;
            n.push(
              i >= t
                ? { startLineNumber: t, endLineNumber: i }
                : { endLineNumber: i, startLineNumber: t },
            );
          }
          (t.removeManualRanges(n), e.triggerFoldingModelChanged());
        }
      }
    },
  ),
  VH(
    class extends xNe {
      constructor() {
        super({
          id: "editor.toggleImportFold",
          label: EI(1e3, "Toggle Import Fold"),
          precondition: vNe,
          kbOpts: { kbExpr: $$.editorTextFocus, weight: 100 },
        });
      }
      async invoke(e, t) {
        const n = [],
          i = t.regions;
        for (let r = i.length - 1; r >= 0; r--)
          i.getType(r) === k2.Imports.value && n.push(i.toRegion(r));
        (t.toggleCollapseState(n), e.triggerFoldingModelChanged());
      }
    },
  ));
for (let Set = 1; Set <= 7; Set++)
  HH(
    new CNe({
      id: CNe.ID(Set),
      label: EI(1001, "Fold Level {0}", Set),
      precondition: vNe,
      kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2048 | (21 + Set)), weight: 100 },
    }),
  );
jV.registerCommand("_executeFoldingRangeProvider", async function (e, ...t) {
  const [n] = t;
  if (!(n instanceof mP)) throw GI();
  const i = e.get(mee),
    r = e.get(wV).getModel(n);
  if (!r) throw GI();
  const o = e.get(OU);
  if (!o.getValue("editor.folding", { resource: n })) return [];
  const s = e.get(f$),
    a = o.getValue("editor.foldingStrategy", { resource: n }),
    l = {
      get limit() {
        return o.getValue("editor.foldingMaximumRegions", { resource: n });
      },
      update: (e, t) => {},
    },
    c = new tNe(r, s, l);
  let d = c;
  if ("indentation" !== a) {
    const e = bNe.getFoldingRangeProviders(i, r);
    e.length && (d = new pNe(r, e, () => {}, l, c));
  }
  const u = await d.compute(aM.None),
    h = [];
  try {
    if (u)
      for (let e = 0; e < u.length; e++) {
        const t = u.getType(e);
        h.push({
          start: u.getStartLineNumber(e),
          end: u.getEndLineNumber(e),
          kind: t ? k2.fromValue(t) : void 0,
        });
      }
    return h;
  } finally {
    d.dispose();
  }
});
(VH(
  class extends AH {
    constructor() {
      super({
        id: "editor.action.fontZoomIn",
        label: EI(1011, "Increase Editor Font Size"),
        precondition: void 0,
      });
    }
    run(e, t) {
      Kq.setZoomLevel(Kq.getZoomLevel() + 1);
    }
  },
),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.fontZoomOut",
          label: EI(1012, "Decrease Editor Font Size"),
          precondition: void 0,
        });
      }
      run(e, t) {
        Kq.setZoomLevel(Kq.getZoomLevel() - 1);
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.fontZoomReset",
          label: EI(1013, "Reset Editor Font Size"),
          precondition: void 0,
        });
      }
      run(e, t) {
        Kq.setZoomLevel(0);
      }
    },
  ));
class SNe {
  static _handleEolEdits(e, t) {
    let n;
    const i = [];
    for (const r of t)
      ("number" == typeof r.eol && (n = r.eol), r.range && "string" == typeof r.text && i.push(r));
    return ("number" == typeof n && e.hasModel() && e.getModel().pushEOL(n), i);
  }
  static _isFullModelReplaceEdit(e, t) {
    if (!e.hasModel()) return !1;
    const n = e.getModel(),
      i = n.validateRange(t.range);
    return n.getFullModelRange().equalsRange(i);
  }
  static execute(e, t, n) {
    n && e.pushUndoStop();
    const i = Mne.capture(e),
      r = SNe._handleEolEdits(e, t);
    (1 === r.length && SNe._isFullModelReplaceEdit(e, r[0])
      ? e.executeEdits(
          "formatEditsCommand",
          r.map((e) => hye.replace(YH.lift(e.range), e.text)),
        )
      : e.executeEdits(
          "formatEditsCommand",
          r.map((e) => hye.replaceMove(YH.lift(e.range), e.text)),
        ),
      n && e.pushUndoStop(),
      i.restoreRelativeVerticalPositionOfCursor(e));
  }
}
class kNe {
  constructor(e) {
    ((this.value = e), (this._lower = e.toLowerCase()));
  }
  static toKey(e) {
    return "string" == typeof e ? e.toLowerCase() : e._lower;
  }
}
class ENe {
  constructor(e) {
    if (((this._set = new Set()), e)) for (const t of e) this.add(t);
  }
  add(e) {
    this._set.add(kNe.toKey(e));
  }
  has(e) {
    return this._set.has(kNe.toKey(e));
  }
}
function NNe(e, t, n) {
  const i = [],
    r = new ENe(),
    o = e.ordered(n);
  for (const a of o) (i.push(a), a.extensionId && r.add(a.extensionId));
  const s = t.ordered(n);
  for (const a of s) {
    if (a.extensionId) {
      if (r.has(a.extensionId)) continue;
      r.add(a.extensionId);
    }
    i.push({
      displayName: a.displayName,
      extensionId: a.extensionId,
      provideDocumentFormattingEdits: (e, t, n) =>
        a.provideDocumentRangeFormattingEdits(e, e.getFullModelRange(), t, n),
    });
  }
  return i;
}
class LNe {
  static {
    this._selectors = new HO();
  }
  static setFormatterSelector(e) {
    return { dispose: LNe._selectors.unshift(e) };
  }
  static async select(e, t, n, i) {
    if (0 === e.length) return;
    const r = DO.first(LNe._selectors);
    return r ? await r(e, t, n, i) : void 0;
  }
}
async function DNe(e, t, n, i, r, o, s) {
  const a = e.get(vV),
    { documentRangeFormattingEditProvider: l } = e.get(mee),
    c = wye(t) ? t.getModel() : t,
    d = l.ordered(c),
    u = await LNe.select(d, c, i, 2);
  u && (r.report(u), await a.invokeFunction(TNe, u, t, n, o, s));
}
async function TNe(e, t, n, i, r, o) {
  const s = e.get(Dce),
    a = e.get(yH),
    l = e.get(kne);
  let c, d;
  wye(n) ? ((c = n.getModel()), (d = new uge(n, 5, void 0, r))) : ((c = n), (d = new hge(n, r)));
  const u = [];
  let h = 0;
  for (const _ of fj(i).sort(YH.compareRangesUsingStarts))
    h > 0 && YH.areIntersectingOrTouching(u[h - 1], _)
      ? (u[h - 1] = YH.fromPositions(u[h - 1].getStartPosition(), _.getEndPosition()))
      : (h = u.push(_));
  const g = async (e) => {
      a.trace("[format][provideDocumentRangeFormattingEdits] (request)", t.extensionId?.value, e);
      const n =
        (await t.provideDocumentRangeFormattingEdits(c, e, c.getFormattingOptions(), d.token)) ||
        [];
      return (
        a.trace(
          "[format][provideDocumentRangeFormattingEdits] (response)",
          t.extensionId?.value,
          n,
        ),
        n
      );
    },
    p = (e, t) => {
      if (!e.length || !t.length) return !1;
      const n = e.reduce((e, t) => YH.plusRange(e, t.range), e[0].range);
      if (!t.some((e) => YH.intersectRanges(n, e.range))) return !1;
      for (const i of e) for (const e of t) if (YH.intersectRanges(i.range, e.range)) return !0;
      return !1;
    },
    f = [],
    m = [];
  try {
    if ("function" == typeof t.provideDocumentRangesFormattingEdits) {
      a.trace("[format][provideDocumentRangeFormattingEdits] (request)", t.extensionId?.value, u);
      const e =
        (await t.provideDocumentRangesFormattingEdits(c, u, c.getFormattingOptions(), d.token)) ||
        [];
      (a.trace("[format][provideDocumentRangeFormattingEdits] (response)", t.extensionId?.value, e),
        m.push(e));
    } else {
      for (const e of u) {
        if (d.token.isCancellationRequested) return !0;
        m.push(await g(e));
      }
      for (let e = 0; e < u.length; ++e)
        for (let t = e + 1; t < u.length; ++t) {
          if (d.token.isCancellationRequested) return !0;
          if (p(m[e], m[t])) {
            const n = YH.plusRange(u[e], u[t]),
              i = await g(n);
            (u.splice(t, 1),
              u.splice(e, 1),
              u.push(n),
              m.splice(t, 1),
              m.splice(e, 1),
              m.push(i),
              (e = 0),
              (t = 0));
          }
        }
    }
    for (const e of m) {
      if (d.token.isCancellationRequested) return !0;
      const t = await s.computeMoreMinimalEdits(c.uri, e);
      t && f.push(...t);
    }
    if (d.token.isCancellationRequested) return !0;
  } finally {
    d.dispose();
  }
  if (0 === f.length) return !1;
  if (wye(n))
    (SNe.execute(n, f, !0), n.revealPositionInCenterIfOutsideViewport(n.getPosition(), 1));
  else {
    const [{ range: e }] = f,
      t = new XH(e.startLineNumber, e.startColumn, e.endLineNumber, e.endColumn);
    c.pushEditOperations(
      [t],
      f.map((e) => ({ text: e.text, range: YH.lift(e.range), forceMoveMarkers: !0 })),
      (e) => {
        for (const { range: n } of e)
          if (YH.areIntersectingOrTouching(n, t))
            return [new XH(n.startLineNumber, n.startColumn, n.endLineNumber, n.endColumn)];
        return null;
      },
    );
  }
  return (l.playSignal(Lne.format, { userGesture: o }), !0);
}
async function INe(e, t, n, i, r, o) {
  const s = e.get(vV),
    a = e.get(mee),
    l = wye(t) ? t.getModel() : t,
    c = NNe(a.documentFormattingEditProvider, a.documentRangeFormattingEditProvider, l),
    d = await LNe.select(c, l, n, 1);
  d && (i.report(d), await s.invokeFunction(RNe, d, t, n, r, o));
}
async function RNe(e, t, n, i, r, o) {
  const s = e.get(Dce),
    a = e.get(kne);
  let l, c, d;
  wye(n) ? ((l = n.getModel()), (c = new uge(n, 5, void 0, r))) : ((l = n), (c = new hge(n, r)));
  try {
    const e = await t.provideDocumentFormattingEdits(l, l.getFormattingOptions(), c.token);
    if (((d = await s.computeMoreMinimalEdits(l.uri, e)), c.token.isCancellationRequested))
      return !0;
  } finally {
    c.dispose();
  }
  if (!d || 0 === d.length) return !1;
  if (wye(n))
    (SNe.execute(n, d, 2 !== i),
      2 !== i && n.revealPositionInCenterIfOutsideViewport(n.getPosition(), 1));
  else {
    const [{ range: e }] = d,
      t = new XH(e.startLineNumber, e.startColumn, e.endLineNumber, e.endColumn);
    l.pushEditOperations(
      [t],
      d.map((e) => ({ text: e.text, range: YH.lift(e.range), forceMoveMarkers: !0 })),
      (e) => {
        for (const { range: n } of e)
          if (YH.areIntersectingOrTouching(n, t))
            return [new XH(n.startLineNumber, n.startColumn, n.endLineNumber, n.endColumn)];
        return null;
      },
    );
  }
  return (a.playSignal(Lne.format, { userGesture: o }), !0);
}
function ONe(e, t, n, i, r, o, s) {
  const a = t.onTypeFormattingEditProvider.ordered(n);
  return 0 === a.length || a[0].autoFormatTriggerCharacters.indexOf(r) < 0
    ? Promise.resolve(void 0)
    : Promise.resolve(a[0].provideOnTypeFormattingEdits(n, i, r, o, s))
        .catch(zI)
        .then((t) => e.computeMoreMinimalEdits(n.uri, t));
}
(jV.registerCommand("_executeFormatRangeProvider", async function (e, ...t) {
  const [n, i, r] = t;
  (pR(mP.isUri(n)), pR(YH.isIRange(i)));
  const o = e.get(CV),
    s = e.get(Dce),
    a = e.get(mee),
    l = await o.createModelReference(n);
  try {
    return (async function (e, t, n, i, r, o) {
      const s = t.documentRangeFormattingEditProvider.ordered(n);
      for (const a of s) {
        const t = await Promise.resolve(a.provideDocumentRangeFormattingEdits(n, i, r, o)).catch(
          zI,
        );
        if (aj(t)) return await e.computeMoreMinimalEdits(n.uri, t);
      }
    })(s, a, l.object.textEditorModel, YH.lift(i), r, aM.None);
  } finally {
    l.dispose();
  }
}),
  jV.registerCommand("_executeFormatDocumentProvider", async function (e, ...t) {
    const [n, i] = t;
    pR(mP.isUri(n));
    const r = e.get(CV),
      o = e.get(Dce),
      s = e.get(mee),
      a = await r.createModelReference(n);
    try {
      return (async function (e, t, n, i, r) {
        const o = NNe(t.documentFormattingEditProvider, t.documentRangeFormattingEditProvider, n);
        for (const s of o) {
          const t = await Promise.resolve(s.provideDocumentFormattingEdits(n, i, r)).catch(zI);
          if (aj(t)) return await e.computeMoreMinimalEdits(n.uri, t);
        }
      })(o, s, a.object.textEditorModel, i, aM.None);
    } finally {
      a.dispose();
    }
  }),
  jV.registerCommand("_executeFormatOnTypeProvider", async function (e, ...t) {
    const [n, i, r, o] = t;
    (pR(mP.isUri(n)), pR(xV.isIPosition(i)), pR("string" == typeof r));
    const s = e.get(CV),
      a = e.get(Dce),
      l = e.get(mee),
      c = await s.createModelReference(n);
    try {
      return ONe(a, l, c.object.textEditorModel, xV.lift(i), r, o, aM.None);
    } finally {
      c.dispose();
    }
  }));
var MNe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  ANe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let PNe = class {
  static {
    this.ID = "editor.contrib.autoFormat";
  }
  constructor(e, t, n, i) {
    ((this._editor = e),
      (this._languageFeaturesService = t),
      (this._workerService = n),
      (this._accessibilitySignalService = i),
      (this._disposables = new AO()),
      (this._sessionDisposables = new AO()),
      this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update, this)),
      this._disposables.add(e.onDidChangeModel(() => this._update())),
      this._disposables.add(e.onDidChangeModelLanguage(() => this._update())),
      this._disposables.add(
        e.onDidChangeConfiguration((e) => {
          e.hasChanged(65) && this._update();
        }),
      ),
      this._update());
  }
  dispose() {
    (this._disposables.dispose(), this._sessionDisposables.dispose());
  }
  _update() {
    if ((this._sessionDisposables.clear(), !this._editor.getOption(65))) return;
    if (!this._editor.hasModel()) return;
    const e = this._editor.getModel(),
      [t] = this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);
    if (!t || !t.autoFormatTriggerCharacters) return;
    const n = new Iz();
    for (const i of t.autoFormatTriggerCharacters) n.add(i.charCodeAt(0));
    this._sessionDisposables.add(
      this._editor.onDidType((e) => {
        const t = e.charCodeAt(e.length - 1);
        n.has(t) && this._trigger(String.fromCharCode(t));
      }),
    );
  }
  _trigger(e) {
    if (!this._editor.hasModel()) return;
    if (this._editor.getSelections().length > 1 || !this._editor.getSelection().isEmpty()) return;
    const t = this._editor.getModel(),
      n = this._editor.getPosition(),
      i = new cM(),
      r = this._editor.onDidChangeModelContent((e) => {
        if (e.isFlush) return (i.cancel(), void r.dispose());
        for (let t = 0, o = e.changes.length; t < o; t++) {
          if (e.changes[t].range.endLineNumber <= n.lineNumber)
            return (i.cancel(), void r.dispose());
        }
      });
    ONe(
      this._workerService,
      this._languageFeaturesService,
      t,
      n,
      e,
      t.getFormattingOptions(),
      i.token,
    )
      .then((e) => {
        i.token.isCancellationRequested ||
          (aj(e) &&
            (this._accessibilitySignalService.playSignal(Lne.format, { userGesture: !1 }),
            SNe.execute(this._editor, e, !0)));
      })
      .finally(() => {
        r.dispose();
      });
  }
};
PNe = MNe([ANe(1, mee), ANe(2, Dce), ANe(3, kne)], PNe);
let jNe = class {
  static {
    this.ID = "editor.contrib.formatOnPaste";
  }
  constructor(e, t, n) {
    ((this.editor = e),
      (this._languageFeaturesService = t),
      (this._instantiationService = n),
      (this._callOnDispose = new AO()),
      (this._callOnModel = new AO()),
      this._callOnDispose.add(e.onDidChangeConfiguration(() => this._update())),
      this._callOnDispose.add(e.onDidChangeModel(() => this._update())),
      this._callOnDispose.add(e.onDidChangeModelLanguage(() => this._update())),
      this._callOnDispose.add(
        t.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: e }) => this._trigger(e))));
  }
  _trigger(e) {
    this.editor.hasModel() &&
      (this.editor.getSelections().length > 1 ||
        this._instantiationService
          .invokeFunction(DNe, this.editor, e, 2, Rne.None, aM.None, !1)
          .catch(HI));
  }
};
jNe = MNe([ANe(1, mee), ANe(2, vV)], jNe);
(zH(PNe.ID, PNe, 2),
  zH(jNe.ID, jNe, 2),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.formatDocument",
          label: EI(1014, "Format Document"),
          precondition: eW.and(
            $$.notInCompositeEditor,
            $$.writable,
            $$.hasDocumentFormattingProvider,
          ),
          kbOpts: {
            kbExpr: $$.editorTextFocus,
            primary: 1572,
            linux: { primary: 3111 },
            weight: 100,
          },
          contextMenuOpts: { group: "1_modification", order: 1.3 },
        });
      }
      async run(e, t) {
        if (t.hasModel()) {
          const n = e.get(vV),
            i = e.get(One);
          await i.showWhile(n.invokeFunction(INe, t, 1, Rne.None, aM.None, !0), 250);
        }
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.formatSelection",
          label: EI(1015, "Format Selection"),
          precondition: eW.and($$.writable, $$.hasDocumentSelectionFormattingProvider),
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2084), weight: 100 },
          contextMenuOpts: { when: $$.hasNonEmptySelection, group: "1_modification", order: 1.31 },
        });
      }
      async run(e, t) {
        if (!t.hasModel()) return;
        const n = e.get(vV),
          i = t.getModel(),
          r = t
            .getSelections()
            .map((e) =>
              e.isEmpty()
                ? new YH(
                    e.startLineNumber,
                    1,
                    e.startLineNumber,
                    i.getLineMaxColumn(e.startLineNumber),
                  )
                : e,
            ),
          o = e.get(One);
        await o.showWhile(n.invokeFunction(DNe, t, r, 1, Rne.None, aM.None, !0), 250);
      }
    },
  ),
  jV.registerCommand("editor.action.format", async (e) => {
    const t = e.get(yV).getFocusedCodeEditor();
    if (!t || !t.hasModel()) return;
    const n = e.get(PV);
    t.getSelection().isEmpty()
      ? await n.executeCommand("editor.action.formatDocument")
      : await n.executeCommand("editor.action.formatSelection");
  }));
var FNe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
class BNe {
  remove() {
    this.parent?.children.delete(this.id);
  }
  static findId(e, t) {
    let n;
    "string" == typeof e
      ? (n = `${t.id}/${e}`)
      : ((n = `${t.id}/${e.name}`),
        void 0 !== t.children.get(n) &&
          (n = `${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));
    let i = n;
    for (let r = 0; void 0 !== t.children.get(i); r++) i = `${n}_${r}`;
    return i;
  }
  static empty(e) {
    return 0 === e.children.size;
  }
}
class VNe extends BNe {
  constructor(e, t, n) {
    (super(), (this.id = e), (this.parent = t), (this.symbol = n), (this.children = new Map()));
  }
}
class WNe extends BNe {
  constructor(e, t, n, i) {
    (super(),
      (this.id = e),
      (this.parent = t),
      (this.label = n),
      (this.order = i),
      (this.children = new Map()));
  }
}
class HNe extends BNe {
  static create(e, t, n) {
    const i = new cM(n),
      r = new HNe(t.uri),
      o = e.ordered(t),
      s = o.map((e, n) => {
        const o = BNe.findId(`provider_${n}`, r),
          s = new WNe(o, r, e.displayName ?? "Unknown Outline Provider", n);
        return Promise.resolve(e.provideDocumentSymbols(t, i.token))
          .then(
            (e) => {
              for (const t of e || []) HNe._makeOutlineElement(t, s);
              return s;
            },
            (e) => (zI(e), s),
          )
          .then((e) => {
            BNe.empty(e) ? e.remove() : r._groups.set(o, e);
          });
      }),
      a = e.onDidChange(() => {
        XP(e.ordered(t), o) || i.cancel();
      });
    return Promise.all(s)
      .then(() =>
        i.token.isCancellationRequested && !n.isCancellationRequested
          ? HNe.create(e, t, n)
          : r._compact(),
      )
      .finally(() => {
        (i.dispose(), a.dispose(), i.dispose());
      });
  }
  static _makeOutlineElement(e, t) {
    const n = BNe.findId(e, t),
      i = new VNe(n, t, e);
    if (e.children) for (const r of e.children) HNe._makeOutlineElement(r, i);
    t.children.set(i.id, i);
  }
  constructor(e) {
    (super(),
      (this.uri = e),
      (this.id = "root"),
      (this.parent = void 0),
      (this._groups = new Map()),
      (this.children = new Map()),
      (this.id = "root"),
      (this.parent = void 0));
  }
  _compact() {
    let e = 0;
    for (const [t, n] of this._groups) 0 === n.children.size ? this._groups.delete(t) : (e += 1);
    if (1 !== e) this.children = this._groups;
    else {
      const e = DO.first(this._groups.values());
      for (const [, t] of e.children) ((t.parent = this), this.children.set(t.id, t));
    }
    return this;
  }
  getTopLevelSymbols() {
    const e = [];
    for (const t of this.children.values())
      t instanceof VNe ? e.push(t.symbol) : e.push(...DO.map(t.children.values(), (e) => e.symbol));
    return e.sort((e, t) => YH.compareRangesUsingStarts(e.range, t.range));
  }
  asListOfDocumentSymbols() {
    const e = this.getTopLevelSymbols(),
      t = [];
    return (
      HNe._flattenDocumentSymbols(t, e, ""),
      t.sort(
        (e, t) =>
          xV.compare(YH.getStartPosition(e.range), YH.getStartPosition(t.range)) ||
          xV.compare(YH.getEndPosition(t.range), YH.getEndPosition(e.range)),
      )
    );
  }
  static _flattenDocumentSymbols(e, t, n) {
    for (const i of t)
      (e.push({
        kind: i.kind,
        tags: i.tags,
        name: i.name,
        detail: i.detail,
        containerName: i.containerName || n,
        range: i.range,
        selectionRange: i.selectionRange,
        children: void 0,
      }),
        i.children && HNe._flattenDocumentSymbols(e, i.children, i.name));
  }
}
const zNe = bV("IOutlineModelService");
let UNe = class {
  constructor(e, t, n) {
    ((this._languageFeaturesService = e),
      (this._disposables = new AO()),
      (this._cache = new XW(15, 0.7)),
      (this._debounceInformation = t.for(e.documentSymbolProvider, "DocumentSymbols", {
        min: 350,
      })),
      this._disposables.add(
        n.onModelRemoved((e) => {
          this._cache.delete(e.id);
        }),
      ));
  }
  dispose() {
    this._disposables.dispose();
  }
  async getOrCreate(e, t) {
    const n = this._languageFeaturesService.documentSymbolProvider,
      i = n.ordered(e);
    let r = this._cache.get(e.id);
    if (!r || r.versionId !== e.getVersionId() || !XP(r.provider, i)) {
      const t = new cM();
      ((r = {
        versionId: e.getVersionId(),
        provider: i,
        promiseCnt: 0,
        source: t,
        promise: HNe.create(n, e, t.token),
        model: void 0,
      }),
        this._cache.set(e.id, r));
      const o = Date.now();
      r.promise
        .then((t) => {
          ((r.model = t), this._debounceInformation.update(e, Date.now() - o));
        })
        .catch((t) => {
          this._cache.delete(e.id);
        });
    }
    if (r.model) return r.model;
    r.promiseCnt += 1;
    const o = t.onCancellationRequested(() => {
      0 === --r.promiseCnt && (r.source.cancel(), this._cache.delete(e.id));
    });
    try {
      return await r.promise;
    } finally {
      o.dispose();
    }
  }
};
((UNe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([FNe(0, mee), FNe(1, gme), FNe(2, wV)], UNe)),
  HU(zNe, UNe, 1),
  jV.registerCommand("_executeDocumentSymbolProvider", async function (e, ...t) {
    const [n] = t;
    pR(mP.isUri(n));
    const i = e.get(zNe),
      r = e.get(CV),
      o = await r.createModelReference(n);
    try {
      return (await i.getOrCreate(o.object.textEditorModel, aM.None)).getTopLevelSymbols();
    } finally {
      o.dispose();
    }
  }));
const $Ne = new (class {
  constructor() {
    this._implementations = [];
  }
  register(e) {
    return (
      this._implementations.push(e),
      {
        dispose: () => {
          const t = this._implementations.indexOf(e);
          -1 !== t && this._implementations.splice(t, 1);
        },
      }
    );
  }
  getImplementations() {
    return this._implementations;
  }
})();
let qNe = class {
  constructor(e) {
    this.instantiationService = e;
  }
  init(...e) {}
};
let KNe = class extends qNe {
  constructor(e, t) {
    (super(t), this.init(e));
  }
};
KNe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, vV),
  ],
  KNe,
);
class GNe {
  validateOrThrow(e) {
    const t = this.validate(e);
    if (t.error) throw new Error(t.error.message);
    return t.content;
  }
}
class ZNe extends GNe {
  constructor(e) {
    (super(), (this.type = e));
  }
  validate(e) {
    return typeof e !== this.type
      ? { content: void 0, error: { message: `Expected ${this.type}, but got ${typeof e}` } }
      : { content: e, error: void 0 };
  }
  getJSONSchema() {
    return { type: this.type };
  }
}
const YNe = new ZNe("string");
new ZNe("number");
const XNe = new ZNe("boolean");
function QNe() {
  return XNe;
}
new ZNe("object");
class JNe extends GNe {
  validate(e) {
    return void 0 !== e
      ? { content: void 0, error: { message: "Expected undefined, but got " + typeof e } }
      : { content: void 0, error: void 0 };
  }
  getJSONSchema() {
    return {};
  }
}
class eLe {
  constructor(e) {
    this.validator = e;
  }
}
function tLe(e) {
  return new eLe(e);
}
class nLe extends GNe {
  constructor(e) {
    (super(), (this.properties = e));
  }
  validate(e) {
    if ("object" != typeof e || null === e)
      return { content: void 0, error: { message: "Expected object" } };
    const t = {};
    for (const n in this.properties) {
      const i = this.properties[n],
        r = e[n],
        o = i instanceof eLe,
        s = o ? i.validator : i;
      if (o && void 0 === r) continue;
      const { content: a, error: l } = s.validate(r);
      if (l)
        return { content: void 0, error: { message: `Error in property '${n}': ${l.message}` } };
      t[n] = a;
    }
    return { content: t, error: void 0 };
  }
  getJSONSchema() {
    const e = [],
      t = {};
    for (const [n, i] of Object.entries(this.properties)) {
      const r = i instanceof eLe,
        o = r ? i.validator : i;
      ((t[n] = o.getJSONSchema()), r || e.push(n));
    }
    return { type: "object", properties: t, ...(e.length > 0 ? { required: e } : {}) };
  }
}
class iLe extends GNe {
  constructor(e) {
    (super(), (this.validators = e));
  }
  validate(e) {
    let t;
    for (const n of this.validators) {
      const { content: i, error: r } = n.validate(e);
      if (!r) return { content: i, error: void 0 };
      t = r;
    }
    return { content: void 0, error: t };
  }
  getJSONSchema() {
    return {
      oneOf: pj(this.validators, (e) => {
        if (!(e instanceof JNe)) return e.getJSONSchema();
      }),
    };
  }
}
class rLe extends GNe {
  constructor(e, t) {
    (super(), (this._ref = e), (this._validator = t));
  }
  validate(e) {
    return this._validator.validate(e);
  }
  getJSONSchema() {
    return { $ref: this._ref };
  }
}
const oLe = {
    Visible: Uve,
    HasFocusedSuggestion: new yW(
      "suggestWidgetHasFocusedSuggestion",
      !1,
      SI(1455, "Whether any suggestion is focused"),
    ),
    DetailsVisible: new yW(
      "suggestWidgetDetailsVisible",
      !1,
      SI(1456, "Whether suggestion details are visible"),
    ),
    MultipleSuggestions: new yW(
      "suggestWidgetMultipleSuggestions",
      !1,
      SI(1457, "Whether there are multiple suggestions to pick from"),
    ),
    MakesTextEdit: new yW(
      "suggestionMakesTextEdit",
      !0,
      SI(
        1458,
        "Whether inserting the current suggestion yields in a change or has everything already been typed",
      ),
    ),
    AcceptSuggestionsOnEnter: new yW(
      "acceptSuggestionOnEnter",
      !0,
      SI(1459, "Whether suggestions are inserted when pressing Enter"),
    ),
    HasInsertAndReplaceRange: new yW(
      "suggestionHasInsertAndReplaceRange",
      !1,
      SI(1460, "Whether the current suggestion has insert and replace behaviour"),
    ),
    InsertMode: new yW("suggestionInsertMode", void 0, {
      type: "string",
      description: SI(1461, "Whether the default behaviour is to insert or replace"),
    }),
    CanResolve: new yW(
      "suggestionCanResolve",
      !1,
      SI(1462, "Whether the current suggestion supports to resolve further details"),
    ),
  },
  sLe = new MW("suggestWidgetStatusBar");
let aLe = class {
  constructor(e, t, n, i) {
    ((this.position = e),
      (this.completion = t),
      (this.container = n),
      (this.provider = i),
      (this.isInvalid = !1),
      (this.score = zie.Default),
      (this.distance = 0),
      (this.textLabel = "string" == typeof t.label ? t.label : t.label?.label),
      (this.labelLow = this.textLabel.toLowerCase()),
      (this.isInvalid = !this.textLabel),
      (this.sortTextLow = t.sortText && t.sortText.toLowerCase()),
      (this.filterTextLow = t.filterText && t.filterText.toLowerCase()),
      (this.extensionId = t.extensionId),
      YH.isIRange(t.range)
        ? ((this.editStart = new xV(t.range.startLineNumber, t.range.startColumn)),
          (this.editInsertEnd = new xV(t.range.endLineNumber, t.range.endColumn)),
          (this.editReplaceEnd = new xV(t.range.endLineNumber, t.range.endColumn)),
          (this.isInvalid =
            this.isInvalid ||
            YH.spansMultipleLines(t.range) ||
            t.range.startLineNumber !== e.lineNumber))
        : ((this.editStart = new xV(t.range.insert.startLineNumber, t.range.insert.startColumn)),
          (this.editInsertEnd = new xV(t.range.insert.endLineNumber, t.range.insert.endColumn)),
          (this.editReplaceEnd = new xV(t.range.replace.endLineNumber, t.range.replace.endColumn)),
          (this.isInvalid =
            this.isInvalid ||
            YH.spansMultipleLines(t.range.insert) ||
            YH.spansMultipleLines(t.range.replace) ||
            t.range.insert.startLineNumber !== e.lineNumber ||
            t.range.replace.startLineNumber !== e.lineNumber ||
            t.range.insert.startColumn !== t.range.replace.startColumn)),
      "function" != typeof i.resolveCompletionItem &&
        ((this._resolveCache = Promise.resolve()), (this._resolveDuration = 0)));
  }
  get isResolved() {
    return void 0 !== this._resolveDuration;
  }
  get resolveDuration() {
    return void 0 !== this._resolveDuration ? this._resolveDuration : -1;
  }
  async resolve(e) {
    if (!this._resolveCache) {
      const t = e.onCancellationRequested(() => {
          ((this._resolveCache = void 0), (this._resolveDuration = void 0));
        }),
        n = new UO(!0);
      this._resolveCache = Promise.resolve(this.provider.resolveCompletionItem(this.completion, e))
        .then(
          (e) => {
            (Object.assign(this.completion, e), (this._resolveDuration = n.elapsed()));
          },
          (e) => {
            qI(e) && ((this._resolveCache = void 0), (this._resolveDuration = void 0));
          },
        )
        .finally(() => {
          t.dispose();
        });
    }
    return this._resolveCache;
  }
};
class lLe {
  static {
    this.default = new lLe();
  }
  constructor(e = 2, t = new Set(), n = new Set(), i = new Map(), r = !0) {
    ((this.snippetSortOrder = e),
      (this.kindFilter = t),
      (this.providerFilter = n),
      (this.providerItemsToReuse = i),
      (this.showDeprecated = r));
  }
}
class cLe {
  constructor(e, t, n, i) {
    ((this.items = e), (this.needsClipboard = t), (this.durations = n), (this.disposable = i));
  }
}
async function dLe(e, t, n, i = lLe.default, r = { triggerKind: 0 }, o = aM.None) {
  const s = new UO();
  n = n.clone();
  const a = t.getWordAtPosition(n),
    l = a ? new YH(n.lineNumber, a.startColumn, n.lineNumber, a.endColumn) : YH.fromPositions(n),
    c = { replace: l, insert: l.setEndPosition(n.lineNumber, n.column) },
    d = [],
    u = new AO(),
    h = [];
  let g = !1;
  const p = (e, t, r) => {
      let o = !1;
      if (!t) return o;
      for (const s of t.suggestions)
        if (!i.kindFilter.has(s.kind)) {
          if (!i.showDeprecated && s?.tags?.includes(1)) continue;
          (s.range || (s.range = c),
            s.sortText || (s.sortText = "string" == typeof s.label ? s.label : s.label.label),
            !g &&
              s.insertTextRules &&
              4 & s.insertTextRules &&
              (g = ape.guessNeedsClipboard(s.insertText)),
            d.push(new aLe(n, s, t, e)),
            (o = !0));
        }
      return (
        TO(t) && u.add(t),
        h.push({
          providerName: e._debugDisplayName ?? "unknown_provider",
          elapsedProvider: t.duration ?? -1,
          elapsedOverall: r.elapsed(),
        }),
        o
      );
    },
    f = (async () => {})();
  for (const _ of e.orderedGroups(t)) {
    let e = !1;
    if (
      (await Promise.all(
        _.map(async (s) => {
          if (i.providerItemsToReuse.has(s)) {
            const t = i.providerItemsToReuse.get(s);
            return (t.forEach((e) => d.push(e)), void (e = e || t.length > 0));
          }
          if (!(i.providerFilter.size > 0) || i.providerFilter.has(s))
            try {
              const i = new UO(),
                a = await s.provideCompletionItems(t, n, r, o);
              e = p(s, a, i) || e;
            } catch (a) {
              zI(a);
            }
        }),
      ),
      e || o.isCancellationRequested)
    )
      break;
  }
  return (
    await f,
    o.isCancellationRequested
      ? (u.dispose(), Promise.reject(new KI()))
      : new cLe(
          d.sort(((m = i.snippetSortOrder), hLe.get(m))),
          g,
          { entries: h, elapsed: s.elapsed() },
          u,
        )
  );
  var m;
}
function uLe(e, t) {
  if (e.sortTextLow && t.sortTextLow) {
    if (e.sortTextLow < t.sortTextLow) return -1;
    if (e.sortTextLow > t.sortTextLow) return 1;
  }
  return e.textLabel < t.textLabel
    ? -1
    : e.textLabel > t.textLabel
      ? 1
      : e.completion.kind - t.completion.kind;
}
const hLe = new Map();
(hLe.set(0, function (e, t) {
  if (e.completion.kind !== t.completion.kind) {
    if (28 === e.completion.kind) return -1;
    if (28 === t.completion.kind) return 1;
  }
  return uLe(e, t);
}),
  hLe.set(2, function (e, t) {
    if (e.completion.kind !== t.completion.kind) {
      if (28 === e.completion.kind) return 1;
      if (28 === t.completion.kind) return -1;
    }
    return uLe(e, t);
  }),
  hLe.set(1, uLe),
  jV.registerCommand("_executeCompletionItemProvider", async (e, ...t) => {
    const [n, i, r, o] = t;
    (pR(mP.isUri(n)),
      pR(xV.isIPosition(i)),
      pR("string" == typeof r || !r),
      pR("number" == typeof o || !o));
    const { completionProvider: s } = e.get(mee),
      a = await e.get(CV).createModelReference(n);
    try {
      const e = { incomplete: !1, suggestions: [] },
        t = [],
        n = a.object.textEditorModel.validatePosition(i),
        l = await dLe(s, a.object.textEditorModel, n, void 0, {
          triggerCharacter: r ?? void 0,
          triggerKind: r ? 1 : 0,
        });
      for (const i of l.items)
        (t.length < (o ?? 0) && t.push(i.resolve(aM.None)),
          (e.incomplete = e.incomplete || i.container.incomplete),
          e.suggestions.push(i.completion));
      try {
        return (await Promise.all(t), e);
      } finally {
        setTimeout(() => l.disposable.dispose(), 100);
      }
    } finally {
      a.dispose();
    }
  }));
class gLe {
  static isAllOff(e) {
    return "off" === e.other && "off" === e.comments && "off" === e.strings;
  }
  static isAllOn(e) {
    return "on" === e.other && "on" === e.comments && "on" === e.strings;
  }
  static valueFor(e, t) {
    switch (t) {
      case 1:
        return e.comments;
      case 2:
        return e.strings;
      default:
        return e.other;
    }
  }
}
class pLe {
  static {
    this.inlineSuggestionVisible = new yW(
      "inlineSuggestionVisible",
      !1,
      SI(1192, "Whether an inline suggestion is visible"),
    );
  }
  static {
    this.inlineSuggestionHasIndentation = new yW(
      "inlineSuggestionHasIndentation",
      !1,
      SI(1193, "Whether the inline suggestion starts with whitespace"),
    );
  }
  static {
    this.inlineSuggestionHasIndentationLessThanTabSize = new yW(
      "inlineSuggestionHasIndentationLessThanTabSize",
      !0,
      SI(
        1194,
        "Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab",
      ),
    );
  }
  static {
    this.suppressSuggestions = new yW(
      "inlineSuggestionSuppressSuggestions",
      void 0,
      SI(1195, "Whether suggestions should be suppressed for the current suggestion"),
    );
  }
  static {
    this.cursorBeforeGhostText = new yW(
      "cursorBeforeGhostText",
      !1,
      SI(1196, "Whether the cursor is at ghost text"),
    );
  }
  static {
    this.cursorInIndentation = new yW(
      "cursorInIndentation",
      !1,
      SI(1197, "Whether the cursor is in indentation"),
    );
  }
  static {
    this.hasSelection = new yW(
      "editor.hasSelection",
      !1,
      SI(1198, "Whether the editor has a selection"),
    );
  }
  static {
    this.cursorAtInlineEdit = new yW(
      "cursorAtInlineEdit",
      !1,
      SI(1199, "Whether the cursor is at an inline edit"),
    );
  }
  static {
    this.inlineEditVisible = new yW(
      "inlineEditIsVisible",
      !1,
      SI(1200, "Whether an inline edit is visible"),
    );
  }
  static {
    this.tabShouldJumpToInlineEdit = new yW(
      "tabShouldJumpToInlineEdit",
      !1,
      SI(1201, "Whether tab should jump to an inline edit."),
    );
  }
  static {
    this.tabShouldAcceptInlineEdit = new yW(
      "tabShouldAcceptInlineEdit",
      !1,
      SI(1202, "Whether tab should accept the inline edit."),
    );
  }
  static {
    this.inInlineEditsPreviewEditor = new yW(
      "inInlineEditsPreviewEditor",
      !0,
      SI(1203, "Whether the current code editor is showing an inline edits preview"),
    );
  }
}
class fLe {
  constructor(e, t, n) {
    ((this._selection = e),
      (this._cursors = t),
      (this._selectionId = null),
      (this._trimInRegexesAndStrings = n));
  }
  getEditOperations(e, t) {
    const n = (function (e, t, n) {
      t.sort((e, t) =>
        e.lineNumber === t.lineNumber ? e.column - t.column : e.lineNumber - t.lineNumber,
      );
      for (let a = t.length - 2; a >= 0; a--)
        t[a].lineNumber === t[a + 1].lineNumber && t.splice(a, 1);
      const i = [];
      let r = 0,
        o = 0;
      const s = t.length;
      for (let a = 1, l = e.getLineCount(); a <= l; a++) {
        const l = e.getLineContent(a),
          c = l.length + 1;
        let d = 0;
        if (o < s && t[o].lineNumber === a && ((d = t[o].column), o++, d === c)) continue;
        if (0 === l.length) continue;
        const u = QM(l);
        let h = 0;
        if (-1 === u) h = 1;
        else {
          if (u === l.length - 1) continue;
          h = u + 2;
        }
        if (!n) {
          if (!e.tokenization.hasAccurateTokensForLine(a)) continue;
          const t = e.tokenization.getLineTokens(a),
            n = t.getStandardTokenType(t.findTokenIndexAtOffset(h));
          if (2 === n || 3 === n) continue;
        }
        ((h = Math.max(d, h)), (i[r++] = hye.delete(new YH(a, h, a, c))));
      }
      return i;
    })(e, this._cursors, this._trimInRegexesAndStrings);
    for (let i = 0, r = n.length; i < r; i++) {
      const e = n[i];
      t.addEditOperation(e.range, e.text);
    }
    this._selectionId = t.trackSelection(this._selection);
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._selectionId);
  }
}
class mLe {
  constructor(e, t, n) {
    ((this._selection = e),
      (this._isCopyingDown = t),
      (this._noop = n || !1),
      (this._selectionDirection = 0),
      (this._selectionId = null),
      (this._startLineNumberDelta = 0),
      (this._endLineNumberDelta = 0));
  }
  getEditOperations(e, t) {
    let n = this._selection;
    ((this._startLineNumberDelta = 0),
      (this._endLineNumberDelta = 0),
      n.startLineNumber < n.endLineNumber &&
        1 === n.endColumn &&
        ((this._endLineNumberDelta = 1),
        (n = n.setEndPosition(n.endLineNumber - 1, e.getLineMaxColumn(n.endLineNumber - 1)))));
    const i = [];
    for (let o = n.startLineNumber; o <= n.endLineNumber; o++) i.push(e.getLineContent(o));
    const r = i.join("\n");
    ("" === r && this._isCopyingDown && (this._startLineNumberDelta++, this._endLineNumberDelta++),
      this._noop
        ? t.addEditOperation(
            new YH(n.endLineNumber, e.getLineMaxColumn(n.endLineNumber), n.endLineNumber + 1, 1),
            n.endLineNumber === e.getLineCount() ? "" : "\n",
          )
        : this._isCopyingDown
          ? t.addEditOperation(new YH(n.startLineNumber, 1, n.startLineNumber, 1), r + "\n")
          : t.addEditOperation(
              new YH(
                n.endLineNumber,
                e.getLineMaxColumn(n.endLineNumber),
                n.endLineNumber,
                e.getLineMaxColumn(n.endLineNumber),
              ),
              "\n" + r,
            ),
      (this._selectionId = t.trackSelection(n)),
      (this._selectionDirection = this._selection.getDirection()));
  }
  computeCursorState(e, t) {
    let n = t.getTrackedSelection(this._selectionId);
    if (0 !== this._startLineNumberDelta || 0 !== this._endLineNumberDelta) {
      let e = n.startLineNumber,
        t = n.startColumn,
        i = n.endLineNumber,
        r = n.endColumn;
      (0 !== this._startLineNumberDelta && ((e += this._startLineNumberDelta), (t = 1)),
        0 !== this._endLineNumberDelta && ((i += this._endLineNumberDelta), (r = 1)),
        (n = XH.createWithDirection(e, t, i, r, this._selectionDirection)));
    }
    return n;
  }
}
function _Le(e, t) {
  let n = 0;
  for (let i = 0; i < e.length; i++) "\t" === e.charAt(i) ? (n += t) : n++;
  return n;
}
function vLe(e, t, n) {
  e = e < 0 ? 0 : e;
  let i = "";
  if (!n) {
    const n = Math.floor(e / t);
    e %= t;
    for (let e = 0; e < n; e++) i += "\t";
  }
  for (let r = 0; r < e; r++) i += " ";
  return i;
}
let bLe = class {
  constructor(e, t, n, i) {
    ((this._languageConfigurationService = i),
      (this._selection = e),
      (this._isMovingDown = t),
      (this._autoIndent = n),
      (this._selectionId = null),
      (this._moveEndLineSelectionShrink = !1));
  }
  getEditOperations(e, t) {
    const n = () => e.getLanguageId(),
      i = (t, n) => e.getLanguageIdAtPosition(t, n),
      r = e.getLineCount();
    if (this._isMovingDown && this._selection.endLineNumber === r)
      return void (this._selectionId = t.trackSelection(this._selection));
    if (!this._isMovingDown && 1 === this._selection.startLineNumber)
      return void (this._selectionId = t.trackSelection(this._selection));
    this._moveEndPositionDown = !1;
    let o = this._selection;
    o.startLineNumber < o.endLineNumber &&
      1 === o.endColumn &&
      ((this._moveEndPositionDown = !0),
      (o = o.setEndPosition(o.endLineNumber - 1, e.getLineMaxColumn(o.endLineNumber - 1))));
    const { tabSize: s, indentSize: a, insertSpaces: l } = e.getOptions(),
      c = this.buildIndentConverter(s, a, l);
    if (o.startLineNumber === o.endLineNumber && 1 === e.getLineMaxColumn(o.startLineNumber)) {
      const n = o.startLineNumber,
        i = this._isMovingDown ? n + 1 : n - 1;
      (1 === e.getLineMaxColumn(i)
        ? t.addEditOperation(new YH(1, 1, 1, 1), null)
        : (t.addEditOperation(new YH(n, 1, n, 1), e.getLineContent(i)),
          t.addEditOperation(new YH(i, 1, i, e.getLineMaxColumn(i)), null)),
        (o = new XH(i, 1, i, 1)));
    } else {
      let r, a;
      if (this._isMovingDown) {
        ((r = o.endLineNumber + 1),
          (a = e.getLineContent(r)),
          t.addEditOperation(
            new YH(r - 1, e.getLineMaxColumn(r - 1), r, e.getLineMaxColumn(r)),
            null,
          ));
        let d = a;
        if (this.shouldAutoIndent(e, o)) {
          const u = this.matchEnterRule(e, c, s, r, o.startLineNumber - 1);
          if (null !== u) {
            const t = vLe(u + _Le(XM(e.getLineContent(r)), s), s, l);
            d = t + this.trimStart(a);
          } else {
            const t = {
                tokenization: {
                  getLineTokens: (t) =>
                    t === o.startLineNumber
                      ? e.tokenization.getLineTokens(r)
                      : e.tokenization.getLineTokens(t),
                  getLanguageId: n,
                  getLanguageIdAtPosition: i,
                },
                getLineContent: (t) =>
                  t === o.startLineNumber ? e.getLineContent(r) : e.getLineContent(t),
              },
              u = Z$(
                this._autoIndent,
                t,
                e.getLanguageIdAtPosition(r, 1),
                o.startLineNumber,
                c,
                this._languageConfigurationService,
              );
            if (null !== u) {
              const t = XM(e.getLineContent(r)),
                n = _Le(u, s);
              if (n !== _Le(t, s)) {
                const e = vLe(n, s, l);
                d = e + this.trimStart(a);
              }
            }
          }
          t.addEditOperation(new YH(o.startLineNumber, 1, o.startLineNumber, 1), d + "\n");
          const h = this.matchEnterRuleMovingDown(e, c, s, o.startLineNumber, r, d);
          if (null !== h) 0 !== h && this.getIndentEditsOfMovingBlock(e, t, o, s, l, h);
          else {
            const a = {
                tokenization: {
                  getLineTokens: (t) =>
                    t === o.startLineNumber
                      ? e.tokenization.getLineTokens(r)
                      : t >= o.startLineNumber + 1 && t <= o.endLineNumber + 1
                        ? e.tokenization.getLineTokens(t - 1)
                        : e.tokenization.getLineTokens(t),
                  getLanguageId: n,
                  getLanguageIdAtPosition: i,
                },
                getLineContent: (t) =>
                  t === o.startLineNumber
                    ? d
                    : t >= o.startLineNumber + 1 && t <= o.endLineNumber + 1
                      ? e.getLineContent(t - 1)
                      : e.getLineContent(t),
              },
              u = Z$(
                this._autoIndent,
                a,
                e.getLanguageIdAtPosition(r, 1),
                o.startLineNumber + 1,
                c,
                this._languageConfigurationService,
              );
            if (null !== u) {
              const n = XM(e.getLineContent(o.startLineNumber)),
                i = _Le(u, s),
                r = _Le(n, s);
              if (i !== r) {
                const n = i - r;
                this.getIndentEditsOfMovingBlock(e, t, o, s, l, n);
              }
            }
          }
        } else t.addEditOperation(new YH(o.startLineNumber, 1, o.startLineNumber, 1), d + "\n");
      } else if (
        ((r = o.startLineNumber - 1),
        (a = e.getLineContent(r)),
        t.addEditOperation(new YH(r, 1, r + 1, 1), null),
        t.addEditOperation(
          new YH(
            o.endLineNumber,
            e.getLineMaxColumn(o.endLineNumber),
            o.endLineNumber,
            e.getLineMaxColumn(o.endLineNumber),
          ),
          "\n" + a,
        ),
        this.shouldAutoIndent(e, o))
      ) {
        const a = {
            tokenization: {
              getLineTokens: (t) =>
                t === r
                  ? e.tokenization.getLineTokens(o.startLineNumber)
                  : e.tokenization.getLineTokens(t),
              getLanguageId: n,
              getLanguageIdAtPosition: i,
            },
            getLineContent: (t) =>
              t === r ? e.getLineContent(o.startLineNumber) : e.getLineContent(t),
          },
          d = this.matchEnterRule(e, c, s, o.startLineNumber, o.startLineNumber - 2);
        if (null !== d) 0 !== d && this.getIndentEditsOfMovingBlock(e, t, o, s, l, d);
        else {
          const n = Z$(
            this._autoIndent,
            a,
            e.getLanguageIdAtPosition(o.startLineNumber, 1),
            r,
            c,
            this._languageConfigurationService,
          );
          if (null !== n) {
            const i = XM(e.getLineContent(o.startLineNumber)),
              r = _Le(n, s),
              a = _Le(i, s);
            if (r !== a) {
              const n = r - a;
              this.getIndentEditsOfMovingBlock(e, t, o, s, l, n);
            }
          }
        }
      }
    }
    this._selectionId = t.trackSelection(o);
  }
  buildIndentConverter(e, t, n) {
    return {
      shiftIndent: (i) => H$.shiftIndent(i, i.length + 1, e, t, n),
      unshiftIndent: (i) => H$.unshiftIndent(i, i.length + 1, e, t, n),
    };
  }
  parseEnterResult(e, t, n, i, r) {
    if (r) {
      let o = r.indentation;
      r.indentAction === Zz.None || r.indentAction === Zz.Indent
        ? (o = r.indentation + r.appendText)
        : r.indentAction === Zz.IndentOutdent
          ? (o = r.indentation)
          : r.indentAction === Zz.Outdent && (o = t.unshiftIndent(r.indentation) + r.appendText);
      const s = e.getLineContent(i);
      if (this.trimStart(s).indexOf(this.trimStart(o)) >= 0) {
        const r = XM(e.getLineContent(i));
        let s = XM(o);
        const a = Y$(e, i, this._languageConfigurationService);
        null !== a && 2 & a && (s = t.unshiftIndent(s));
        return _Le(s, n) - _Le(r, n);
      }
    }
    return null;
  }
  matchEnterRuleMovingDown(e, t, n, i, r, o) {
    if (QM(o) >= 0) {
      const o = e.getLineMaxColumn(r),
        s = F$(this._autoIndent, e, new YH(r, o, r, o), this._languageConfigurationService);
      return this.parseEnterResult(e, t, n, i, s);
    }
    {
      let r = i - 1;
      for (; r >= 1; ) {
        if (QM(e.getLineContent(r)) >= 0) break;
        r--;
      }
      if (r < 1 || i > e.getLineCount()) return null;
      const o = e.getLineMaxColumn(r),
        s = F$(this._autoIndent, e, new YH(r, o, r, o), this._languageConfigurationService);
      return this.parseEnterResult(e, t, n, i, s);
    }
  }
  matchEnterRule(e, t, n, i, r, o) {
    let s = r;
    for (; s >= 1; ) {
      let t;
      t = s === r && void 0 !== o ? o : e.getLineContent(s);
      if (QM(t) >= 0) break;
      s--;
    }
    if (s < 1 || i > e.getLineCount()) return null;
    const a = e.getLineMaxColumn(s),
      l = F$(this._autoIndent, e, new YH(s, a, s, a), this._languageConfigurationService);
    return this.parseEnterResult(e, t, n, i, l);
  }
  trimStart(e) {
    return e.replace(/^\s+/, "");
  }
  shouldAutoIndent(e, t) {
    if (this._autoIndent < 4) return !1;
    if (!e.tokenization.isCheapToTokenize(t.startLineNumber)) return !1;
    const n = e.getLanguageIdAtPosition(t.startLineNumber, 1);
    return (
      n === e.getLanguageIdAtPosition(t.endLineNumber, 1) &&
      null !== this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport
    );
  }
  getIndentEditsOfMovingBlock(e, t, n, i, r, o) {
    for (let s = n.startLineNumber; s <= n.endLineNumber; s++) {
      const a = XM(e.getLineContent(s)),
        l = vLe(_Le(a, i) + o, i, r);
      l !== a &&
        (t.addEditOperation(new YH(s, 1, s, a.length + 1), l),
        s === n.endLineNumber &&
          n.endColumn <= a.length + 1 &&
          "" === l &&
          (this._moveEndLineSelectionShrink = !0));
    }
  }
  computeCursorState(e, t) {
    let n = t.getTrackedSelection(this._selectionId);
    return (
      this._moveEndPositionDown && (n = n.setEndPosition(n.endLineNumber + 1, 1)),
      this._moveEndLineSelectionShrink &&
        n.startLineNumber < n.endLineNumber &&
        (n = n.setEndPosition(n.endLineNumber, 2)),
      n
    );
  }
};
bLe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(3, f$),
  ],
  bLe,
);
class yLe {
  static {
    this._COLLATOR = Nz.Collator();
  }
  constructor(e, t) {
    ((this.selection = e), (this.descending = t), (this.selectionId = null));
  }
  getEditOperations(e, t) {
    const n = (function (e, t, n) {
      const i = xLe(e, t, n);
      if (!i) return null;
      return hye.replace(
        new YH(i.startLineNumber, 1, i.endLineNumber, e.getLineMaxColumn(i.endLineNumber)),
        i.after.join("\n"),
      );
    })(e, this.selection, this.descending);
    (n && t.addEditOperation(n.range, n.text),
      (this.selectionId = t.trackSelection(this.selection)));
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this.selectionId);
  }
  static canRun(e, t, n) {
    if (null === e) return !1;
    const i = xLe(e, t, n);
    if (!i) return !1;
    for (let r = 0, o = i.before.length; r < o; r++) if (i.before[r] !== i.after[r]) return !0;
    return !1;
  }
}
function xLe(e, t, n) {
  const i = t.startLineNumber;
  let r = t.endLineNumber;
  if ((1 === t.endColumn && r--, i >= r)) return null;
  const o = [];
  for (let a = i; a <= r; a++) o.push(e.getLineContent(a));
  let s = o.slice(0);
  return (
    s.sort(yLe._COLLATOR.value.compare),
    !0 === n && (s = s.reverse()),
    { startLineNumber: i, endLineNumber: r, before: o, after: s }
  );
}
class wLe extends AH {
  constructor(e, t) {
    (super(t), (this.down = e));
  }
  run(e, t) {
    if (!t.hasModel()) return;
    const n = t.getSelections().map((e, t) => ({ selection: e, index: t, ignore: !1 }));
    n.sort((e, t) => YH.compareRangesUsingStarts(e.selection, t.selection));
    let i = n[0];
    for (let o = 1; o < n.length; o++) {
      const e = n[o];
      i.selection.endLineNumber === e.selection.startLineNumber &&
        (i.index < e.index ? (e.ignore = !0) : ((i.ignore = !0), (i = e)));
    }
    const r = [];
    for (const o of n) r.push(new mLe(o.selection, this.down, o.ignore));
    (t.pushUndoStop(), t.executeCommands(this.id, r), t.pushUndoStop());
  }
}
class CLe extends AH {
  constructor(e, t) {
    (super(t), (this.down = e));
  }
  run(e, t) {
    const n = e.get(f$),
      i = [],
      r = t.getSelections() || [],
      o = t.getOption(16);
    for (const s of r) i.push(new bLe(s, this.down, o, n));
    (t.pushUndoStop(), t.executeCommands(this.id, i), t.pushUndoStop());
  }
}
class SLe extends AH {
  constructor(e, t) {
    (super(t), (this.descending = e));
  }
  run(e, t) {
    if (!t.hasModel()) return;
    const n = t.getModel();
    let i = t.getSelections();
    1 === i.length &&
      i[0].isEmpty() &&
      (i = [new XH(1, 1, n.getLineCount(), n.getLineMaxColumn(n.getLineCount()))]);
    for (const o of i) if (!yLe.canRun(t.getModel(), o, this.descending)) return;
    const r = [];
    for (let o = 0, s = i.length; o < s; o++) r[o] = new yLe(i[o], this.descending);
    (t.pushUndoStop(), t.executeCommands(this.id, r), t.pushUndoStop());
  }
}
class kLe extends AH {
  static {
    this.ID = "editor.action.trimTrailingWhitespace";
  }
  constructor() {
    super({
      id: kLe.ID,
      label: EI(1258, "Trim Trailing Whitespace"),
      precondition: $$.writable,
      kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2102), weight: 100 },
    });
  }
  run(e, t, n) {
    let i = [];
    "auto-save" === n.reason &&
      (i = (t.getSelections() || []).map((e) => new xV(e.positionLineNumber, e.positionColumn)));
    const r = t.getSelection();
    if (null === r) return;
    const o = e.get(OU),
      s = t.getModel(),
      a = o.getValue("files.trimTrailingWhitespaceInRegexAndStrings", {
        overrideIdentifier: s?.getLanguageId(),
        resource: s?.uri,
      }),
      l = new fLe(r, i, a);
    (t.pushUndoStop(), t.executeCommands(this.id, [l]), t.pushUndoStop());
  }
}
class ELe extends AH {
  static {
    this.ID = "editor.action.insertLineBefore";
  }
  constructor() {
    super({
      id: ELe.ID,
      label: EI(1262, "Insert Line Above"),
      precondition: $$.writable,
      kbOpts: { kbExpr: $$.editorTextFocus, primary: 3075, weight: 100 },
      canTriggerInlineEdits: !0,
    });
  }
  run(e, t) {
    const n = t._getViewModel();
    n &&
      (t.pushUndoStop(),
      t.executeCommands(
        this.id,
        oq.lineInsertBefore(n.cursorConfig, t.getModel(), t.getSelections()),
      ));
  }
}
class NLe extends AH {
  static {
    this.ID = "editor.action.insertLineAfter";
  }
  constructor() {
    super({
      id: NLe.ID,
      label: EI(1263, "Insert Line Below"),
      precondition: $$.writable,
      kbOpts: { kbExpr: $$.editorTextFocus, primary: 2051, weight: 100 },
      canTriggerInlineEdits: !0,
    });
  }
  run(e, t) {
    const n = t._getViewModel();
    n &&
      (t.pushUndoStop(),
      t.executeCommands(
        this.id,
        oq.lineInsertAfter(n.cursorConfig, t.getModel(), t.getSelections()),
      ));
  }
}
class LLe extends AH {
  run(e, t) {
    if (!t.hasModel()) return;
    const n = t.getSelection(),
      i = this._getRangesToDelete(t),
      r = [];
    for (let a = 0, l = i.length - 1; a < l; a++) {
      const e = i[a],
        t = i[a + 1];
      null === YH.intersectRanges(e, t) ? r.push(e) : (i[a + 1] = YH.plusRange(e, t));
    }
    r.push(i[i.length - 1]);
    const o = this._getEndCursorState(n, r),
      s = r.map((e) => hye.replace(e, ""));
    (t.pushUndoStop(), t.executeEdits(this.id, s, o), t.pushUndoStop());
  }
}
class DLe extends AH {
  run(e, t) {
    const n = t.getSelections();
    if (null === n) return;
    const i = t.getModel();
    if (null === i) return;
    const r = t.getOption(148),
      o = [];
    for (const s of n)
      if (s.isEmpty()) {
        const e = s.getStartPosition(),
          n = t.getConfiguredWordAtPosition(e);
        if (!n) continue;
        const a = new YH(e.lineNumber, n.startColumn, e.lineNumber, n.endColumn),
          l = i.getValueInRange(a);
        o.push(hye.replace(a, this._modifyText(l, r)));
      } else {
        const e = i.getValueInRange(s);
        o.push(hye.replace(s, this._modifyText(e, r)));
      }
    (t.pushUndoStop(), t.executeEdits(this.id, o), t.pushUndoStop());
  }
}
class TLe {
  constructor(e, t) {
    ((this._pattern = e), (this._flags = t), (this._actual = null), (this._evaluated = !1));
  }
  get() {
    if (!this._evaluated) {
      this._evaluated = !0;
      try {
        this._actual = new RegExp(this._pattern, this._flags);
      } catch (e) {}
    }
    return this._actual;
  }
  isSupported() {
    return null !== this.get();
  }
}
class ILe extends DLe {
  static {
    this.titleBoundary = new TLe("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}", "gmu");
  }
  constructor() {
    super({
      id: "editor.action.transformToTitlecase",
      label: EI(1270, "Transform to Title Case"),
      precondition: $$.writable,
      canTriggerInlineEdits: !0,
    });
  }
  _modifyText(e, t) {
    const n = ILe.titleBoundary.get();
    return n ? e.toLocaleLowerCase().replace(n, (e) => e.toLocaleUpperCase()) : e;
  }
}
class RLe extends DLe {
  static {
    this.caseBoundary = new TLe("(\\p{Ll})(\\p{Lu})", "gmu");
  }
  static {
    this.singleLetters = new TLe("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})", "gmu");
  }
  constructor() {
    super({
      id: "editor.action.transformToSnakecase",
      label: EI(1271, "Transform to Snake Case"),
      precondition: $$.writable,
      canTriggerInlineEdits: !0,
    });
  }
  _modifyText(e, t) {
    const n = RLe.caseBoundary.get(),
      i = RLe.singleLetters.get();
    return n && i ? e.replace(n, "$1_$2").replace(i, "$1_$2$3").toLocaleLowerCase() : e;
  }
}
class OLe extends DLe {
  static {
    this.singleLineWordBoundary = new TLe("[_\\s-]+", "gm");
  }
  static {
    this.multiLineWordBoundary = new TLe("[_-]+", "gm");
  }
  static {
    this.validWordStart = new TLe("^(\\p{Lu}[^\\p{Lu}])", "gmu");
  }
  constructor() {
    super({
      id: "editor.action.transformToCamelcase",
      label: EI(1272, "Transform to Camel Case"),
      precondition: $$.writable,
      canTriggerInlineEdits: !0,
    });
  }
  _modifyText(e, t) {
    const n = /\r\n|\r|\n/.test(e)
        ? OLe.multiLineWordBoundary.get()
        : OLe.singleLineWordBoundary.get(),
      i = OLe.validWordStart.get();
    if (!n || !i) return e;
    const r = e.split(n),
      o = r.shift()?.replace(i, (e) => e.toLocaleLowerCase());
    return o + r.map((e) => e.substring(0, 1).toLocaleUpperCase() + e.substring(1)).join("");
  }
}
class MLe extends DLe {
  static {
    this.wordBoundary = new TLe("[_ \\t-]", "gm");
  }
  static {
    this.wordBoundaryToMaintain = new TLe("(?<=\\.)", "gm");
  }
  static {
    this.upperCaseWordMatcher = new TLe("^\\p{Lu}+$", "mu");
  }
  constructor() {
    super({
      id: "editor.action.transformToPascalcase",
      label: EI(1273, "Transform to Pascal Case"),
      precondition: $$.writable,
      canTriggerInlineEdits: !0,
    });
  }
  _modifyText(e, t) {
    const n = MLe.wordBoundary.get(),
      i = MLe.wordBoundaryToMaintain.get(),
      r = MLe.upperCaseWordMatcher.get();
    if (!n || !i || !r) return e;
    return e
      .split(i)
      .map((e) => e.split(n))
      .flat()
      .map((e) => {
        const t = e.charAt(0).toLocaleUpperCase() + e.slice(1);
        return t.length > 1 && r.test(t) ? t.charAt(0) + t.slice(1).toLocaleLowerCase() : t;
      })
      .join("");
  }
}
class ALe extends DLe {
  static isSupported() {
    return [this.caseBoundary, this.singleLetters, this.underscoreBoundary].every((e) =>
      e.isSupported(),
    );
  }
  static {
    this.caseBoundary = new TLe("(\\p{Ll})(\\p{Lu})", "gmu");
  }
  static {
    this.singleLetters = new TLe("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})", "gmu");
  }
  static {
    this.underscoreBoundary = new TLe("(\\S)(_)(\\S)", "gm");
  }
  constructor() {
    super({
      id: "editor.action.transformToKebabcase",
      label: EI(1274, "Transform to Kebab Case"),
      precondition: $$.writable,
      canTriggerInlineEdits: !0,
    });
  }
  _modifyText(e, t) {
    const n = ALe.caseBoundary.get(),
      i = ALe.singleLetters.get(),
      r = ALe.underscoreBoundary.get();
    return n && i && r
      ? e.replace(r, "$1-$3").replace(n, "$1-$2").replace(i, "$1-$2").toLocaleLowerCase()
      : e;
  }
}
(VH(
  class extends wLe {
    constructor() {
      super(!1, {
        id: "editor.action.copyLinesUpAction",
        label: EI(1249, "Copy Line Up"),
        precondition: $$.writable,
        kbOpts: {
          kbExpr: $$.editorTextFocus,
          primary: 1552,
          linux: { primary: 3600 },
          weight: 100,
        },
        menuOpts: {
          menuId: MW.MenubarSelectionMenu,
          group: "2_line",
          title: SI(1244, "&&Copy Line Up"),
          order: 1,
        },
        canTriggerInlineEdits: !0,
      });
    }
  },
),
  VH(
    class extends wLe {
      constructor() {
        super(!0, {
          id: "editor.action.copyLinesDownAction",
          label: EI(1250, "Copy Line Down"),
          precondition: $$.writable,
          kbOpts: {
            kbExpr: $$.editorTextFocus,
            primary: 1554,
            linux: { primary: 3602 },
            weight: 100,
          },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "2_line",
            title: SI(1245, "Co&&py Line Down"),
            order: 2,
          },
          canTriggerInlineEdits: !0,
        });
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.duplicateSelection",
          label: EI(1251, "Duplicate Selection"),
          precondition: $$.writable,
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "2_line",
            title: SI(1246, "&&Duplicate Selection"),
            order: 5,
          },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t, n) {
        if (!t.hasModel()) return;
        const i = [],
          r = t.getSelections(),
          o = t.getModel();
        for (const s of r)
          if (s.isEmpty()) i.push(new mLe(s, !0));
          else {
            const e = new XH(s.endLineNumber, s.endColumn, s.endLineNumber, s.endColumn);
            i.push(new _z(e, o.getValueInRange(s)));
          }
        (t.pushUndoStop(), t.executeCommands(this.id, i), t.pushUndoStop());
      }
    },
  ),
  VH(
    class extends CLe {
      constructor() {
        super(!1, {
          id: "editor.action.moveLinesUpAction",
          label: EI(1252, "Move Line Up"),
          precondition: $$.writable,
          kbOpts: {
            kbExpr: $$.editorTextFocus,
            primary: 528,
            linux: { primary: 528 },
            weight: 100,
          },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "2_line",
            title: SI(1247, "Mo&&ve Line Up"),
            order: 3,
          },
          canTriggerInlineEdits: !0,
        });
      }
    },
  ),
  VH(
    class extends CLe {
      constructor() {
        super(!0, {
          id: "editor.action.moveLinesDownAction",
          label: EI(1253, "Move Line Down"),
          precondition: $$.writable,
          kbOpts: {
            kbExpr: $$.editorTextFocus,
            primary: 530,
            linux: { primary: 530 },
            weight: 100,
          },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "2_line",
            title: SI(1248, "Move &&Line Down"),
            order: 4,
          },
          canTriggerInlineEdits: !0,
        });
      }
    },
  ),
  VH(
    class extends SLe {
      constructor() {
        super(!1, {
          id: "editor.action.sortLinesAscending",
          label: EI(1254, "Sort Lines Ascending"),
          precondition: $$.writable,
          canTriggerInlineEdits: !0,
        });
      }
    },
  ),
  VH(
    class extends SLe {
      constructor() {
        super(!0, {
          id: "editor.action.sortLinesDescending",
          label: EI(1255, "Sort Lines Descending"),
          precondition: $$.writable,
          canTriggerInlineEdits: !0,
        });
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.removeDuplicateLines",
          label: EI(1256, "Delete Duplicate Lines"),
          precondition: $$.writable,
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        if (!t.hasModel()) return;
        const n = t.getModel();
        if (1 === n.getLineCount() && 1 === n.getLineMaxColumn(1)) return;
        const i = [],
          r = [];
        let o = 0,
          s = !0,
          a = t.getSelections();
        1 === a.length &&
          a[0].isEmpty() &&
          ((a = [new XH(1, 1, n.getLineCount(), n.getLineMaxColumn(n.getLineCount()))]), (s = !1));
        for (const l of a) {
          const e = new Set(),
            t = [];
          for (let i = l.startLineNumber; i <= l.endLineNumber; i++) {
            const r = n.getLineContent(i);
            e.has(r) || (t.push(r), e.add(r));
          }
          const s = new XH(
              l.startLineNumber,
              1,
              l.endLineNumber,
              n.getLineMaxColumn(l.endLineNumber),
            ),
            a = l.startLineNumber - o,
            c = new XH(a, 1, a + t.length - 1, t[t.length - 1].length);
          (i.push(hye.replace(s, t.join("\n"))),
            r.push(c),
            (o += l.endLineNumber - l.startLineNumber + 1 - t.length));
        }
        (t.pushUndoStop(), t.executeEdits(this.id, i, s ? r : void 0), t.pushUndoStop());
      }
    },
  ),
  VH(kLe),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.deleteLines",
          label: EI(1259, "Delete Line"),
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 3113, weight: 100 },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        if (!t.hasModel()) return;
        const n = this._getLinesToRemove(t),
          i = t.getModel();
        if (1 === i.getLineCount() && 1 === i.getLineMaxColumn(1)) return;
        let r = 0;
        const o = [],
          s = [];
        for (let a = 0, l = n.length; a < l; a++) {
          const e = n[a];
          let t = e.startLineNumber,
            l = e.endLineNumber,
            c = 1,
            d = i.getLineMaxColumn(l);
          (l < i.getLineCount()
            ? ((l += 1), (d = 1))
            : t > 1 && ((t -= 1), (c = i.getLineMaxColumn(t))),
            o.push(hye.replace(new XH(t, c, l, d), "")),
            s.push(new XH(t - r, e.positionColumn, t - r, e.positionColumn)),
            (r += e.endLineNumber - e.startLineNumber + 1));
        }
        (t.pushUndoStop(), t.executeEdits(this.id, o, s), t.pushUndoStop());
      }
      _getLinesToRemove(e) {
        const t = e.getSelections().map((e) => {
          let t = e.endLineNumber;
          return (
            e.startLineNumber < e.endLineNumber && 1 === e.endColumn && (t -= 1),
            {
              startLineNumber: e.startLineNumber,
              selectionStartColumn: e.selectionStartColumn,
              endLineNumber: t,
              positionColumn: e.positionColumn,
            }
          );
        });
        t.sort((e, t) =>
          e.startLineNumber === t.startLineNumber
            ? e.endLineNumber - t.endLineNumber
            : e.startLineNumber - t.startLineNumber,
        );
        const n = [];
        let i = t[0];
        for (let r = 1; r < t.length; r++)
          i.endLineNumber + 1 >= t[r].startLineNumber
            ? (i.endLineNumber = t[r].endLineNumber)
            : (n.push(i), (i = t[r]));
        return (n.push(i), n);
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.indentLines",
          label: EI(1260, "Indent Line"),
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 2142, weight: 100 },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        const n = t._getViewModel();
        n &&
          (t.pushUndoStop(),
          t.executeCommands(this.id, wq.indent(n.cursorConfig, t.getModel(), t.getSelections())),
          t.pushUndoStop());
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.outdentLines",
          label: EI(1261, "Outdent Line"),
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 2140, weight: 100 },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        Rq.Outdent.runEditorCommand(e, t, null);
      }
    },
  ),
  VH(ELe),
  VH(NLe),
  VH(
    class extends LLe {
      constructor() {
        super({
          id: "deleteAllLeft",
          label: EI(1264, "Delete All Left"),
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 2049 }, weight: 100 },
          canTriggerInlineEdits: !0,
        });
      }
      _getEndCursorState(e, t) {
        let n = null;
        const i = [];
        let r = 0;
        return (
          t.forEach((t) => {
            let o;
            if (1 === t.endColumn && r > 0) {
              const e = t.startLineNumber - r;
              o = new XH(e, t.startColumn, e, t.startColumn);
            } else o = new XH(t.startLineNumber, t.startColumn, t.startLineNumber, t.startColumn);
            ((r += t.endLineNumber - t.startLineNumber),
              t.intersectRanges(e) ? (n = o) : i.push(o));
          }),
          n && i.unshift(n),
          i
        );
      }
      _getRangesToDelete(e) {
        const t = e.getSelections();
        if (null === t) return [];
        let n = t;
        const i = e.getModel();
        return null === i
          ? []
          : (n.sort(YH.compareRangesUsingStarts),
            (n = n.map((e) => {
              if (e.isEmpty()) {
                if (1 === e.startColumn) {
                  const t = Math.max(1, e.startLineNumber - 1),
                    n = 1 === e.startLineNumber ? 1 : i.getLineLength(t) + 1;
                  return new YH(t, n, e.startLineNumber, 1);
                }
                return new YH(e.startLineNumber, 1, e.startLineNumber, e.startColumn);
              }
              return new YH(e.startLineNumber, 1, e.endLineNumber, e.endColumn);
            })),
            n);
      }
    },
  ),
  VH(
    class extends LLe {
      constructor() {
        super({
          id: "deleteAllRight",
          label: EI(1265, "Delete All Right"),
          precondition: $$.writable,
          kbOpts: {
            kbExpr: $$.textInputFocus,
            primary: 0,
            mac: { primary: 297, secondary: [2068] },
            weight: 100,
          },
          canTriggerInlineEdits: !0,
        });
      }
      _getEndCursorState(e, t) {
        let n = null;
        const i = [];
        for (let r = 0, o = t.length, s = 0; r < o; r++) {
          const o = t[r],
            a = new XH(o.startLineNumber - s, o.startColumn, o.startLineNumber - s, o.startColumn);
          o.intersectRanges(e) ? (n = a) : i.push(a);
        }
        return (n && i.unshift(n), i);
      }
      _getRangesToDelete(e) {
        const t = e.getModel();
        if (null === t) return [];
        const n = e.getSelections();
        if (null === n) return [];
        const i = n.map((e) => {
          if (e.isEmpty()) {
            const n = t.getLineMaxColumn(e.startLineNumber);
            return e.startColumn === n
              ? new YH(e.startLineNumber, e.startColumn, e.startLineNumber + 1, 1)
              : new YH(e.startLineNumber, e.startColumn, e.startLineNumber, n);
          }
          return e;
        });
        return (i.sort(YH.compareRangesUsingStarts), i);
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.joinLines",
          label: EI(1266, "Join Lines"),
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 0, mac: { primary: 296 }, weight: 100 },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        const n = t.getSelections();
        if (null === n) return;
        let i = t.getSelection();
        if (null === i) return;
        n.sort(YH.compareRangesUsingStarts);
        const r = [],
          o = n.reduce((e, t) =>
            e.isEmpty()
              ? e.endLineNumber === t.startLineNumber
                ? (i.equalsSelection(e) && (i = t), t)
                : t.startLineNumber > e.endLineNumber + 1
                  ? (r.push(e), t)
                  : new XH(e.startLineNumber, e.startColumn, t.endLineNumber, t.endColumn)
              : t.startLineNumber > e.endLineNumber
                ? (r.push(e), t)
                : new XH(e.startLineNumber, e.startColumn, t.endLineNumber, t.endColumn),
          );
        r.push(o);
        const s = t.getModel();
        if (null === s) return;
        const a = [],
          l = [];
        let c = i,
          d = 0;
        for (let u = 0, h = r.length; u < h; u++) {
          const e = r[u],
            t = e.startLineNumber,
            n = 1;
          let o,
            h,
            g = 0;
          const p = s.getLineLength(e.endLineNumber) - e.endColumn;
          if (e.isEmpty() || e.startLineNumber === e.endLineNumber) {
            const n = e.getStartPosition();
            n.lineNumber < s.getLineCount()
              ? ((o = t + 1), (h = s.getLineMaxColumn(o)))
              : ((o = n.lineNumber), (h = s.getLineMaxColumn(n.lineNumber)));
          } else ((o = e.endLineNumber), (h = s.getLineMaxColumn(o)));
          let f = s.getLineContent(t);
          for (let i = t + 1; i <= o; i++) {
            const e = s.getLineContent(i),
              t = s.getLineFirstNonWhitespaceColumn(i);
            if (t >= 1) {
              let n = !0;
              ("" === f && (n = !1),
                !n ||
                  (" " !== f.charAt(f.length - 1) && "\t" !== f.charAt(f.length - 1)) ||
                  ((n = !1), (f = f.replace(/[\s\uFEFF\xA0]+$/g, " "))));
              const i = e.substr(t - 1);
              ((f += (n ? " " : "") + i), (g = n ? i.length + 1 : i.length));
            } else g = 0;
          }
          const m = new YH(t, n, o, h);
          if (!m.isEmpty()) {
            let n;
            (e.isEmpty()
              ? (a.push(hye.replace(m, f)),
                (n = new XH(m.startLineNumber - d, f.length - g + 1, t - d, f.length - g + 1)))
              : e.startLineNumber === e.endLineNumber
                ? (a.push(hye.replace(m, f)),
                  (n = new XH(
                    e.startLineNumber - d,
                    e.startColumn,
                    e.endLineNumber - d,
                    e.endColumn,
                  )))
                : (a.push(hye.replace(m, f)),
                  (n = new XH(
                    e.startLineNumber - d,
                    e.startColumn,
                    e.startLineNumber - d,
                    f.length - p,
                  ))),
              null !== YH.intersectRanges(m, i) ? (c = n) : l.push(n));
          }
          d += m.endLineNumber - m.startLineNumber;
        }
        (l.unshift(c), t.pushUndoStop(), t.executeEdits(this.id, a, l), t.pushUndoStop());
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.transpose",
          label: EI(1267, "Transpose Characters around the Cursor"),
          precondition: $$.writable,
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        const n = t.getSelections();
        if (null === n) return;
        const i = t.getModel();
        if (null === i) return;
        const r = [];
        for (let o = 0, s = n.length; o < s; o++) {
          const e = n[o];
          if (!e.isEmpty()) continue;
          const t = e.getStartPosition(),
            s = i.getLineMaxColumn(t.lineNumber);
          if (t.column >= s) {
            if (t.lineNumber === i.getLineCount()) continue;
            const e = new YH(t.lineNumber, Math.max(1, t.column - 1), t.lineNumber + 1, 1),
              n = i.getValueInRange(e).split("").reverse().join("");
            r.push(new fz(new XH(t.lineNumber, Math.max(1, t.column - 1), t.lineNumber + 1, 1), n));
          } else {
            const e = new YH(t.lineNumber, Math.max(1, t.column - 1), t.lineNumber, t.column + 1),
              n = i.getValueInRange(e).split("").reverse().join("");
            r.push(new xz(e, n, new XH(t.lineNumber, t.column + 1, t.lineNumber, t.column + 1)));
          }
        }
        (t.pushUndoStop(), t.executeCommands(this.id, r), t.pushUndoStop());
      }
    },
  ),
  VH(
    class extends DLe {
      constructor() {
        super({
          id: "editor.action.transformToUppercase",
          label: EI(1268, "Transform to Uppercase"),
          precondition: $$.writable,
          canTriggerInlineEdits: !0,
        });
      }
      _modifyText(e, t) {
        return e.toLocaleUpperCase();
      }
    },
  ),
  VH(
    class extends DLe {
      constructor() {
        super({
          id: "editor.action.transformToLowercase",
          label: EI(1269, "Transform to Lowercase"),
          precondition: $$.writable,
          canTriggerInlineEdits: !0,
        });
      }
      _modifyText(e, t) {
        return e.toLocaleLowerCase();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.reverseLines",
          label: EI(1257, "Reverse lines"),
          precondition: $$.writable,
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        if (!t.hasModel()) return;
        const n = t.getModel(),
          i = t.getSelections();
        let r = i;
        1 === r.length &&
          r[0].isEmpty() &&
          (r = [new XH(1, 1, n.getLineCount(), n.getLineMaxColumn(n.getLineCount()))]);
        const o = [],
          s = [];
        for (let a = 0; a < r.length; a++) {
          const e = r[a],
            t = i[a];
          let l = e.endLineNumber;
          e.startLineNumber < e.endLineNumber && 1 === e.endColumn && l--;
          let c = new YH(e.startLineNumber, 1, l, n.getLineMaxColumn(l));
          l === n.getLineCount() &&
            "" === n.getLineContent(c.endLineNumber) &&
            (c = c.setEndPosition(c.endLineNumber - 1, n.getLineMaxColumn(c.endLineNumber - 1)));
          const d = [];
          for (let i = c.endLineNumber; i >= c.startLineNumber; i--) d.push(n.getLineContent(i));
          const u = hye.replace(c, d.join("\n"));
          o.push(u);
          const h = function (e) {
              return e <= c.endLineNumber ? c.endLineNumber - e + c.startLineNumber : e;
            },
            g = function (e) {
              if (e.isEmpty())
                return new XH(
                  h(e.positionLineNumber),
                  e.positionColumn,
                  h(e.positionLineNumber),
                  e.positionColumn,
                );
              {
                const t = h(e.selectionStartLineNumber),
                  n = h(e.positionLineNumber),
                  i = e.selectionStartColumn,
                  r = e.positionColumn;
                return new XH(t, i, n, r);
              }
            };
          s.push(g(t));
        }
        (t.pushUndoStop(), t.executeEdits(this.id, o, s), t.pushUndoStop());
      }
    },
  ),
  RLe.caseBoundary.isSupported() && RLe.singleLetters.isSupported() && VH(RLe),
  OLe.singleLineWordBoundary.isSupported() && OLe.multiLineWordBoundary.isSupported() && VH(OLe),
  MLe.wordBoundary.isSupported() && VH(MLe),
  ILe.titleBoundary.isSupported() && VH(ILe),
  ALe.isSupported() && VH(ALe));
const PLe = bV("dataChannelService");
var jLe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let FLe = class extends PO {
  static cast() {
    return this;
  }
  constructor(e, t, n) {
    var i, r;
    (super(),
      (this._key = e),
      (this._contextKeyService = t),
      (this._dataChannelService = n),
      (this._isEnabledContextKeyValue = ((i = "structuredLogger.enabled:" + this._key),
      (r = this._contextKeyService),
      gF(r.onDidChangeContext, () => r.getContextKeyValue(i))).recomputeInitiallyAndOnChange(
        this._store,
      )),
      (this.isEnabled = this._isEnabledContextKeyValue.map((e) => void 0 !== e)));
  }
  log(e) {
    return (
      !!this._isEnabledContextKeyValue.get() &&
      (this._dataChannelService.getDataChannel("structuredLogger:" + this._key).sendData(e), !0)
    );
  }
};
FLe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([jLe(1, xW), jLe(2, PLe)], FLe);
var BLe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let VLe = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this._editor = e),
      (this._instantiationService = t),
      (this._loggerService = n),
      (this._structuredLogger = this._register(
        this._instantiationService.createInstance(
          FLe.cast(),
          "editor.inlineSuggest.logChangeReason.commandId",
        ),
      )));
    const i = this._loggerService?.createLogger("textModelChanges", {
        hidden: !1,
        name: "Text Model Changes Reason",
      }),
      r = gF(this, i.onDidChangeLogLevel, () => i.getLevel());
    (this._register(
      rF((e) => {
        SH(r.read(e), wH.Trace) &&
          e.store.add(
            this._editor.onDidChangeModelContent((e) => {
              "output" !== this._editor.getModel()?.uri.scheme &&
                i.trace(
                  "onDidChangeModelContent: " +
                    e.detailedReasons.map((e) => e.toKey(Number.MAX_VALUE)).join(", "),
                );
            }),
          );
      }),
    ),
      this._register(
        rF((e) => {
          this._editor instanceof ane &&
            this._structuredLogger.isEnabled.read(e) &&
            e.store.add(
              this._editor.onDidChangeModelContent((e) => {
                const t = this._editor.getModel();
                if (!t) return;
                const n = e.detailedReasons[0],
                  i = {
                    ...n.metadata,
                    sourceId: "TextModel.setChangeReason",
                    source: n.metadata.source,
                    time: Date.now(),
                    modelUri: t.uri,
                    modelVersion: t.getVersionId(),
                  };
                setTimeout(() => {
                  this._structuredLogger.log(i);
                }, 0);
              }),
            );
        }),
      ));
  }
};
function WLe(e, t = AR) {
  return (function (e, t = AR) {
    return !!t && oH(e.charCodeAt(0)) && 58 === e.charCodeAt(1);
  })(e, t)
    ? e.charAt(0).toUpperCase() + e.slice(1)
    : e;
}
VLe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([BLe(1, vV), BLe(2, xH)], VLe);
class HLe {
  constructor(e) {
    this._delegates = e;
  }
  resolve(e) {
    for (const t of this._delegates) {
      const n = t.resolve(e);
      if (void 0 !== n) return n;
    }
  }
}
class zLe {
  constructor(e, t, n, i) {
    ((this._model = e),
      (this._selection = t),
      (this._selectionIdx = n),
      (this._overtypingCapturer = i));
  }
  resolve(e) {
    const { name: t } = e;
    if ("SELECTION" === t || "TM_SELECTED_TEXT" === t) {
      let t = this._model.getValueInRange(this._selection) || void 0,
        n = this._selection.startLineNumber !== this._selection.endLineNumber;
      if (!t && this._overtypingCapturer) {
        const e = this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);
        e && ((t = e.value), (n = e.multiline));
      }
      if (t && n && e.snippet) {
        const n = XM(
          this._model.getLineContent(this._selection.startLineNumber),
          0,
          this._selection.startColumn - 1,
        );
        let i = n;
        e.snippet.walk((t) => t !== e && (t instanceof Qge && (i = XM(ZM(t.value).pop())), !0));
        const r = cA(i, n);
        t = t.replace(/(\r\n|\r|\n)(.*)/g, (e, t, n) => `${t}${i.substr(r)}${n}`);
      }
      return t;
    }
    if ("TM_CURRENT_LINE" === t)
      return this._model.getLineContent(this._selection.positionLineNumber);
    if ("TM_CURRENT_WORD" === t) {
      const e = this._model.getWordAtPosition({
        lineNumber: this._selection.positionLineNumber,
        column: this._selection.positionColumn,
      });
      return (e && e.word) || void 0;
    }
    return "TM_LINE_INDEX" === t
      ? String(this._selection.positionLineNumber - 1)
      : "TM_LINE_NUMBER" === t
        ? String(this._selection.positionLineNumber)
        : "CURSOR_INDEX" === t
          ? String(this._selectionIdx)
          : "CURSOR_NUMBER" === t
            ? String(this._selectionIdx + 1)
            : void 0;
  }
}
class ULe {
  constructor(e, t) {
    ((this._labelService = e), (this._model = t));
  }
  resolve(e) {
    const { name: t } = e;
    if ("TM_FILENAME" === t) return aP(this._model.uri.fsPath);
    if ("TM_FILENAME_BASE" === t) {
      const e = aP(this._model.uri.fsPath),
        t = e.lastIndexOf(".");
      return t <= 0 ? e : e.slice(0, t);
    }
    return "TM_DIRECTORY" === t
      ? "." === sP(this._model.uri.fsPath)
        ? ""
        : this._labelService.getUriLabel(hH(this._model.uri))
      : "TM_DIRECTORY_BASE" === t
        ? "." === sP(this._model.uri.fsPath)
          ? ""
          : aP(sP(this._model.uri.fsPath))
        : "TM_FILEPATH" === t
          ? this._labelService.getUriLabel(this._model.uri)
          : "RELATIVE_FILEPATH" === t
            ? this._labelService.getUriLabel(this._model.uri, { relative: !0, noPrefix: !0 })
            : void 0;
  }
}
class $Le {
  constructor(e, t, n, i) {
    ((this._readClipboardText = e),
      (this._selectionIdx = t),
      (this._selectionCount = n),
      (this._spread = i));
  }
  resolve(e) {
    if ("CLIPBOARD" !== e.name) return;
    const t = this._readClipboardText();
    if (t) {
      if (this._spread) {
        const e = t.split(/\r\n|\n|\r/).filter((e) => !BM(e));
        if (e.length === this._selectionCount) return e[this._selectionIdx];
      }
      return t;
    }
  }
}
let qLe = class {
  constructor(e, t, n) {
    ((this._model = e), (this._selection = t), (this._languageConfigurationService = n));
  }
  resolve(e) {
    const { name: t } = e,
      n = this._model.getLanguageIdAtPosition(
        this._selection.selectionStartLineNumber,
        this._selection.selectionStartColumn,
      ),
      i = this._languageConfigurationService.getLanguageConfiguration(n).comments;
    if (i)
      return "LINE_COMMENT" === t
        ? i.lineCommentToken || void 0
        : "BLOCK_COMMENT_START" === t
          ? i.blockCommentStartToken || void 0
          : ("BLOCK_COMMENT_END" === t && i.blockCommentEndToken) || void 0;
  }
};
qLe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(2, f$),
  ],
  qLe,
);
class KLe {
  constructor() {
    this._date = new Date();
  }
  static {
    this.dayNames = [
      SI(1406, "Sunday"),
      SI(1407, "Monday"),
      SI(1408, "Tuesday"),
      SI(1409, "Wednesday"),
      SI(1410, "Thursday"),
      SI(1411, "Friday"),
      SI(1412, "Saturday"),
    ];
  }
  static {
    this.dayNamesShort = [
      SI(1413, "Sun"),
      SI(1414, "Mon"),
      SI(1415, "Tue"),
      SI(1416, "Wed"),
      SI(1417, "Thu"),
      SI(1418, "Fri"),
      SI(1419, "Sat"),
    ];
  }
  static {
    this.monthNames = [
      SI(1420, "January"),
      SI(1421, "February"),
      SI(1422, "March"),
      SI(1423, "April"),
      SI(1424, "May"),
      SI(1425, "June"),
      SI(1426, "July"),
      SI(1427, "August"),
      SI(1428, "September"),
      SI(1429, "October"),
      SI(1430, "November"),
      SI(1431, "December"),
    ];
  }
  static {
    this.monthNamesShort = [
      SI(1432, "Jan"),
      SI(1433, "Feb"),
      SI(1434, "Mar"),
      SI(1435, "Apr"),
      SI(1436, "May"),
      SI(1437, "Jun"),
      SI(1438, "Jul"),
      SI(1439, "Aug"),
      SI(1440, "Sep"),
      SI(1441, "Oct"),
      SI(1442, "Nov"),
      SI(1443, "Dec"),
    ];
  }
  resolve(e) {
    const { name: t } = e;
    if ("CURRENT_YEAR" === t) return String(this._date.getFullYear());
    if ("CURRENT_YEAR_SHORT" === t) return String(this._date.getFullYear()).slice(-2);
    if ("CURRENT_MONTH" === t) return String(this._date.getMonth().valueOf() + 1).padStart(2, "0");
    if ("CURRENT_DATE" === t) return String(this._date.getDate().valueOf()).padStart(2, "0");
    if ("CURRENT_HOUR" === t) return String(this._date.getHours().valueOf()).padStart(2, "0");
    if ("CURRENT_MINUTE" === t) return String(this._date.getMinutes().valueOf()).padStart(2, "0");
    if ("CURRENT_SECOND" === t) return String(this._date.getSeconds().valueOf()).padStart(2, "0");
    if ("CURRENT_DAY_NAME" === t) return KLe.dayNames[this._date.getDay()];
    if ("CURRENT_DAY_NAME_SHORT" === t) return KLe.dayNamesShort[this._date.getDay()];
    if ("CURRENT_MONTH_NAME" === t) return KLe.monthNames[this._date.getMonth()];
    if ("CURRENT_MONTH_NAME_SHORT" === t) return KLe.monthNamesShort[this._date.getMonth()];
    if ("CURRENT_SECONDS_UNIX" === t) return String(Math.floor(this._date.getTime() / 1e3));
    if ("CURRENT_TIMEZONE_OFFSET" === t) {
      const e = this._date.getTimezoneOffset(),
        t = e > 0 ? "-" : "+",
        n = Math.trunc(Math.abs(e / 60)),
        i = n < 10 ? "0" + n : n,
        r = Math.abs(e) - 60 * n;
      return t + i + ":" + (r < 10 ? "0" + r : r);
    }
  }
}
class GLe {
  constructor(e) {
    this._workspaceService = e;
  }
  resolve(e) {
    if (!this._workspaceService) return;
    const t = (function (e) {
      if ("string" == typeof e || void 0 === e) return "string" == typeof e ? { id: aP(e) } : Age;
      const t = e;
      return t.configuration
        ? { id: t.id, configPath: t.configuration }
        : 1 === t.folders.length
          ? { id: t.id, uri: t.folders[0].uri }
          : { id: t.id };
    })(this._workspaceService.getWorkspace());
    return Mge(t)
      ? void 0
      : "WORKSPACE_NAME" === e.name
        ? this._resolveWorkspaceName(t)
        : "WORKSPACE_FOLDER" === e.name
          ? this._resoveWorkspacePath(t)
          : void 0;
  }
  _resolveWorkspaceName(e) {
    if (Oge(e)) return aP(e.uri.path);
    let t = aP(e.configPath.path);
    return (t.endsWith(jge) && (t = t.substr(0, t.length - 14 - 1)), t);
  }
  _resoveWorkspacePath(e) {
    if (Oge(e)) return WLe(e.uri.fsPath);
    const t = aP(e.configPath.path);
    let n = e.configPath.fsPath;
    return (n.endsWith(t) && (n = n.substr(0, n.length - t.length - 1)), n ? WLe(n) : "/");
  }
}
class ZLe {
  resolve(e) {
    const { name: t } = e;
    return "RANDOM" === t
      ? Math.random().toString().slice(-6)
      : "RANDOM_HEX" === t
        ? Math.random().toString(16).slice(-6)
        : "UUID" === t
          ? FJ()
          : void 0;
  }
}
var YLe;
class XLe {
  static {
    this._decor = {
      active: cee.register({
        description: "snippet-placeholder-1",
        stickiness: 0,
        className: "snippet-placeholder",
      }),
      inactive: cee.register({
        description: "snippet-placeholder-2",
        stickiness: 1,
        className: "snippet-placeholder",
      }),
      activeFinal: cee.register({
        description: "snippet-placeholder-3",
        stickiness: 1,
        className: "finish-snippet-placeholder",
      }),
      inactiveFinal: cee.register({
        description: "snippet-placeholder-4",
        stickiness: 1,
        className: "finish-snippet-placeholder",
      }),
    };
  }
  constructor(e, t, n) {
    ((this._editor = e),
      (this._snippet = t),
      (this._snippetLineLeadingWhitespace = n),
      (this._offset = -1),
      (this._nestingLevel = 1),
      (this._placeholderGroups = tj(t.placeholders, epe.compareByIndex)),
      (this._placeholderGroupsIdx = -1));
  }
  initialize(e) {
    this._offset = e.newPosition;
  }
  dispose() {
    (this._placeholderDecorations &&
      this._editor.removeDecorations([...this._placeholderDecorations.values()]),
      (this._placeholderGroups.length = 0));
  }
  _initDecorations() {
    if (-1 === this._offset) throw new Error("Snippet not initialized!");
    if (this._placeholderDecorations) return;
    this._placeholderDecorations = new Map();
    const e = this._editor.getModel();
    this._editor.changeDecorations((t) => {
      for (const n of this._snippet.placeholders) {
        const i = this._snippet.offset(n),
          r = this._snippet.fullLen(n),
          o = YH.fromPositions(
            e.getPositionAt(this._offset + i),
            e.getPositionAt(this._offset + i + r),
          ),
          s = n.isFinalTabstop ? XLe._decor.inactiveFinal : XLe._decor.inactive,
          a = t.addDecoration(o, s);
        this._placeholderDecorations.set(n, a);
      }
    });
  }
  move(e) {
    if (!this._editor.hasModel()) return [];
    if ((this._initDecorations(), this._placeholderGroupsIdx >= 0)) {
      const e = [];
      for (const t of this._placeholderGroups[this._placeholderGroupsIdx])
        if (t.transform) {
          const n = this._placeholderDecorations.get(t),
            i = this._editor.getModel().getDecorationRange(n),
            r = this._editor.getModel().getValueInRange(i),
            o = t.transform.resolve(r).split(/\r\n|\r|\n/);
          for (let e = 1; e < o.length; e++)
            o[e] = this._editor
              .getModel()
              .normalizeIndentation(this._snippetLineLeadingWhitespace + o[e]);
          e.push(hye.replace(i, o.join(this._editor.getModel().getEOL())));
        }
      e.length > 0 && this._editor.executeEdits("snippet.placeholderTransform", e);
    }
    let t = !1;
    !0 === e && this._placeholderGroupsIdx < this._placeholderGroups.length - 1
      ? ((this._placeholderGroupsIdx += 1), (t = !0))
      : !1 === e && this._placeholderGroupsIdx > 0 && ((this._placeholderGroupsIdx -= 1), (t = !0));
    const n = this._editor.getModel().changeDecorations((e) => {
      const n = new Set(),
        i = [];
      for (const r of this._placeholderGroups[this._placeholderGroupsIdx]) {
        const o = this._placeholderDecorations.get(r),
          s = this._editor.getModel().getDecorationRange(o);
        (i.push(new XH(s.startLineNumber, s.startColumn, s.endLineNumber, s.endColumn)),
          (t = t && this._hasPlaceholderBeenCollapsed(r)),
          e.changeDecorationOptions(
            o,
            r.isFinalTabstop ? XLe._decor.activeFinal : XLe._decor.active,
          ),
          n.add(r));
        for (const t of this._snippet.enclosingPlaceholders(r)) {
          const i = this._placeholderDecorations.get(t);
          (e.changeDecorationOptions(
            i,
            t.isFinalTabstop ? XLe._decor.activeFinal : XLe._decor.active,
          ),
            n.add(t));
        }
      }
      for (const [t, r] of this._placeholderDecorations)
        n.has(t) ||
          e.changeDecorationOptions(
            r,
            t.isFinalTabstop ? XLe._decor.inactiveFinal : XLe._decor.inactive,
          );
      return i;
    });
    return t ? this.move(e) : (n ?? []);
  }
  _hasPlaceholderBeenCollapsed(e) {
    let t = e;
    for (; t; ) {
      if (t instanceof epe) {
        const e = this._placeholderDecorations.get(t);
        if (this._editor.getModel().getDecorationRange(e).isEmpty() && t.toString().length > 0)
          return !0;
      }
      t = t.parent;
    }
    return !1;
  }
  get isAtFirstPlaceholder() {
    return this._placeholderGroupsIdx <= 0 || 0 === this._placeholderGroups.length;
  }
  get isAtLastPlaceholder() {
    return this._placeholderGroupsIdx === this._placeholderGroups.length - 1;
  }
  get hasPlaceholder() {
    return this._snippet.placeholders.length > 0;
  }
  get isTrivialSnippet() {
    if (0 === this._snippet.placeholders.length) return !0;
    if (1 === this._snippet.placeholders.length) {
      const [e] = this._snippet.placeholders;
      if (e.isFinalTabstop && this._snippet.rightMostDescendant === e) return !0;
    }
    return !1;
  }
  computePossibleSelections() {
    const e = new Map();
    for (const t of this._placeholderGroups) {
      let n;
      for (const i of t) {
        if (i.isFinalTabstop) break;
        n || ((n = []), e.set(i.index, n));
        const t = this._placeholderDecorations.get(i),
          r = this._editor.getModel().getDecorationRange(t);
        if (!r) {
          e.delete(i.index);
          break;
        }
        n.push(r);
      }
    }
    return e;
  }
  get activeChoice() {
    if (!this._placeholderDecorations) return;
    const e = this._placeholderGroups[this._placeholderGroupsIdx][0];
    if (!e?.choice) return;
    const t = this._placeholderDecorations.get(e);
    if (!t) return;
    const n = this._editor.getModel().getDecorationRange(t);
    return n ? { range: n, choice: e.choice } : void 0;
  }
  get hasChoice() {
    let e = !1;
    return (this._snippet.walk((t) => ((e = t instanceof tpe), !e)), e);
  }
  merge(e) {
    const t = this._editor.getModel();
    ((this._nestingLevel *= 10),
      this._editor.changeDecorations((n) => {
        for (const i of this._placeholderGroups[this._placeholderGroupsIdx]) {
          const r = e.shift(),
            o = r._snippet.placeholderInfo.last.index;
          for (const e of r._snippet.placeholderInfo.all)
            e.isFinalTabstop
              ? (e.index = i.index + (o + 1) / this._nestingLevel)
              : (e.index = i.index + e.index / this._nestingLevel);
          this._snippet.replace(i, r._snippet.children);
          const s = this._placeholderDecorations.get(i);
          (n.removeDecoration(s), this._placeholderDecorations.delete(i));
          for (const e of r._snippet.placeholders) {
            const i = r._snippet.offset(e),
              o = r._snippet.fullLen(e),
              s = YH.fromPositions(
                t.getPositionAt(r._offset + i),
                t.getPositionAt(r._offset + i + o),
              ),
              a = n.addDecoration(s, XLe._decor.inactive);
            this._placeholderDecorations.set(e, a);
          }
        }
        this._placeholderGroups = tj(this._snippet.placeholders, epe.compareByIndex);
      }));
  }
}
const QLe = {
  overwriteBefore: 0,
  overwriteAfter: 0,
  adjustWhitespace: !0,
  clipboardText: void 0,
  overtypingCapturer: void 0,
};
let JLe = (YLe = class {
  static adjustWhitespace(e, t, n, i, r) {
    const o = XM(e.getLineContent(t.lineNumber), 0, t.column - 1);
    let s;
    return (
      i.walk((t) => {
        if (!(t instanceof Qge) || t.parent instanceof tpe) return !0;
        if (r && !r.has(t)) return !0;
        const a = t.value.split(/\r\n|\r|\n/);
        if (n) {
          const n = i.offset(t);
          if (0 === n) a[0] = e.normalizeIndentation(a[0]);
          else {
            s = s ?? i.toString();
            const t = s.charCodeAt(n - 1);
            (10 !== t && 13 !== t) || (a[0] = e.normalizeIndentation(o + a[0]));
          }
          for (let t = 1; t < a.length; t++) a[t] = e.normalizeIndentation(o + a[t]);
        }
        const l = a.join(e.getEOL());
        return (l !== t.value && (t.parent.replace(t, [new Qge(l)]), (s = void 0)), !0);
      }),
      o
    );
  }
  static adjustSelection(e, t, n, i) {
    if (0 !== n || 0 !== i) {
      const { positionLineNumber: r, positionColumn: o } = t,
        s = o - n,
        a = o + i,
        l = e.validateRange({ startLineNumber: r, startColumn: s, endLineNumber: r, endColumn: a });
      t = XH.createWithDirection(
        l.startLineNumber,
        l.startColumn,
        l.endLineNumber,
        l.endColumn,
        t.getDirection(),
      );
    }
    return t;
  }
  static createEditsAndSnippetsFromSelections(e, t, n, i, r, o, s, a, l) {
    const c = [],
      d = [];
    if (!e.hasModel()) return { edits: c, snippets: d };
    const u = e.getModel(),
      h = e.invokeWithinContext((e) => e.get(Rge)),
      g = e.invokeWithinContext((e) => new ULe(e.get(GCe), u)),
      p = () => s,
      f = u.getValueInRange(YLe.adjustSelection(u, e.getSelection(), n, 0)),
      m = u.getValueInRange(YLe.adjustSelection(u, e.getSelection(), 0, i)),
      _ = u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),
      v = e
        .getSelections()
        .map((e, t) => ({ selection: e, idx: t }))
        .sort((e, t) => YH.compareRangesUsingStarts(e.selection, t.selection));
    for (const { selection: b, idx: y } of v) {
      let s = YLe.adjustSelection(u, b, n, 0),
        x = YLe.adjustSelection(u, b, 0, i);
      (f !== u.getValueInRange(s) && (s = b), m !== u.getValueInRange(x) && (x = b));
      const w = b
          .setStartPosition(s.startLineNumber, s.startColumn)
          .setEndPosition(x.endLineNumber, x.endColumn),
        C = new ape().parse(t, !0, r),
        S = w.getStartPosition(),
        k = YLe.adjustWhitespace(
          u,
          S,
          o || (y > 0 && _ !== u.getLineFirstNonWhitespaceColumn(b.positionLineNumber)),
          C,
        );
      (C.resolveVariables(
        new HLe([
          g,
          new $Le(p, y, v.length, "spread" === e.getOption(88)),
          new zLe(u, b, y, a),
          new qLe(u, b, l),
          new KLe(),
          new GLe(h),
          new ZLe(),
        ]),
      ),
        (c[y] = hye.replace(w, C.toString())),
        (c[y].identifier = { major: y, minor: 0 }),
        (c[y]._isTracked = !0),
        (d[y] = new XLe(e, C, k)));
    }
    return { edits: c, snippets: d };
  }
  static createEditsAndSnippetsFromEdits(e, t, n, i, r, o, s) {
    if (!e.hasModel() || 0 === t.length) return { edits: [], snippets: [] };
    const a = [],
      l = e.getModel(),
      c = new ape(),
      d = new spe(),
      u = new HLe([
        e.invokeWithinContext((e) => new ULe(e.get(GCe), l)),
        new $Le(() => r, 0, e.getSelections().length, "spread" === e.getOption(88)),
        new zLe(l, e.getSelection(), 0, o),
        new qLe(l, e.getSelection(), s),
        new KLe(),
        new GLe(e.invokeWithinContext((e) => e.get(Rge))),
        new ZLe(),
      ]);
    t = t.sort((e, t) => YH.compareRangesUsingStarts(e.range, t.range));
    let h = 0;
    for (let g = 0; g < t.length; g++) {
      const { range: e, template: n, keepWhitespace: r } = t[g];
      if (g > 0) {
        const n = t[g - 1].range,
          i = YH.fromPositions(n.getEndPosition(), e.getStartPosition()),
          r = new Qge(l.getValueInRange(i));
        (d.appendChild(r), (h += r.value.length));
      }
      const o = c.parseFragment(n, d);
      (YLe.adjustWhitespace(l, e.getStartPosition(), void 0 !== r ? !r : i, d, new Set(o)),
        d.resolveVariables(u));
      const s = d.toString(),
        p = s.slice(h);
      h = s.length;
      const f = hye.replace(e, p);
      ((f.identifier = { major: g, minor: 0 }), (f._isTracked = !0), a.push(f));
    }
    return (c.ensureFinalTabstop(d, n, !0), { edits: a, snippets: [new XLe(e, d, "")] });
  }
  constructor(e, t, n = QLe, i) {
    ((this._editor = e),
      (this._template = t),
      (this._options = n),
      (this._languageConfigurationService = i),
      (this._templateMerges = []),
      (this._snippets = []));
  }
  dispose() {
    IO(this._snippets);
  }
  _logInfo() {
    return `template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`;
  }
  insert(e) {
    if (!this._editor.hasModel()) return;
    const { edits: t, snippets: n } =
      "string" == typeof this._template
        ? YLe.createEditsAndSnippetsFromSelections(
            this._editor,
            this._template,
            this._options.overwriteBefore,
            this._options.overwriteAfter,
            !1,
            this._options.adjustWhitespace,
            this._options.clipboardText,
            this._options.overtypingCapturer,
            this._languageConfigurationService,
          )
        : YLe.createEditsAndSnippetsFromEdits(
            this._editor,
            this._template,
            !1,
            this._options.adjustWhitespace,
            this._options.clipboardText,
            this._options.overtypingCapturer,
            this._languageConfigurationService,
          );
    ((this._snippets = n),
      this._editor.executeEdits(e ?? m8.snippet(), t, (e) => {
        const t = e.filter((e) => !!e.identifier);
        for (let i = 0; i < n.length; i++) n[i].initialize(t[i].textChange);
        return this._snippets[0].hasPlaceholder
          ? this._move(!0)
          : t.map((e) => XH.fromPositions(e.range.getEndPosition()));
      }),
      this._editor.revealRange(this._editor.getSelections()[0]));
  }
  merge(e, t = QLe) {
    if (!this._editor.hasModel()) return;
    this._templateMerges.push([
      this._snippets[0]._nestingLevel,
      this._snippets[0]._placeholderGroupsIdx,
      e,
    ]);
    const { edits: n, snippets: i } = YLe.createEditsAndSnippetsFromSelections(
      this._editor,
      e,
      t.overwriteBefore,
      t.overwriteAfter,
      !0,
      t.adjustWhitespace,
      t.clipboardText,
      t.overtypingCapturer,
      this._languageConfigurationService,
    );
    this._editor.executeEdits("snippet", n, (e) => {
      const t = e.filter((e) => !!e.identifier);
      for (let r = 0; r < i.length; r++) i[r].initialize(t[r].textChange);
      const n = i[0].isTrivialSnippet;
      if (!n) for (const r of this._snippets) r.merge(i);
      return this._snippets[0].hasPlaceholder && !n
        ? this._move(void 0)
        : t.map((e) => XH.fromPositions(e.range.getEndPosition()));
    });
  }
  next() {
    const e = this._move(!0);
    (this._editor.setSelections(e),
      this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition()));
  }
  prev() {
    const e = this._move(!1);
    (this._editor.setSelections(e),
      this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition()));
  }
  _move(e) {
    const t = [];
    for (const n of this._snippets) {
      const i = n.move(e);
      t.push(...i);
    }
    return t;
  }
  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 !1;
    const e = this._editor.getSelections();
    if (e.length < this._snippets.length) return !1;
    const t = new Map();
    for (const n of this._snippets) {
      const i = n.computePossibleSelections();
      if (0 === t.size)
        for (const [n, r] of i) {
          r.sort(YH.compareRangesUsingStarts);
          for (const i of e)
            if (r[0].containsRange(i)) {
              t.set(n, []);
              break;
            }
        }
      if (0 === t.size) return !1;
      t.forEach((e, t) => {
        e.push(...i.get(t));
      });
    }
    e.sort(YH.compareRangesUsingStarts);
    for (const [n, i] of t)
      if (i.length === e.length) {
        i.sort(YH.compareRangesUsingStarts);
        for (let r = 0; r < i.length; r++) i[r].containsRange(e[r]) || t.delete(n);
      } else t.delete(n);
    return t.size > 0;
  }
});
JLe = YLe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(3, f$),
  ],
  JLe,
);
var eDe,
  tDe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const nDe = {
  overwriteBefore: 0,
  overwriteAfter: 0,
  undoStopBefore: !0,
  undoStopAfter: !0,
  adjustWhitespace: !0,
  clipboardText: void 0,
  overtypingCapturer: void 0,
};
let iDe = class {
  static {
    eDe = this;
  }
  static {
    this.ID = "snippetController2";
  }
  static get(e) {
    return e.getContribution(eDe.ID);
  }
  static {
    this.InSnippetMode = new yW(
      "inSnippetMode",
      !1,
      SI(1402, "Whether the editor in current in snippet mode"),
    );
  }
  static {
    this.HasNextTabstop = new yW(
      "hasNextTabstop",
      !1,
      SI(1403, "Whether there is a next tab stop when in snippet mode"),
    );
  }
  static {
    this.HasPrevTabstop = new yW(
      "hasPrevTabstop",
      !1,
      SI(1404, "Whether there is a previous tab stop when in snippet mode"),
    );
  }
  constructor(e, t, n, i, r) {
    ((this._editor = e),
      (this._logService = t),
      (this._languageFeaturesService = n),
      (this._languageConfigurationService = r),
      (this._inSnippetObservable = LF(this, !1)),
      (this._snippetListener = new AO()),
      (this._modelVersionId = -1),
      (this._inSnippet = eDe.InSnippetMode.bindTo(i)),
      (this._hasNextTabstop = eDe.HasNextTabstop.bindTo(i)),
      (this._hasPrevTabstop = eDe.HasPrevTabstop.bindTo(i)));
  }
  dispose() {
    (this._inSnippet.reset(),
      this._inSnippetObservable.set(!1, void 0),
      this._hasPrevTabstop.reset(),
      this._hasNextTabstop.reset(),
      this._session?.dispose(),
      this._snippetListener.dispose());
  }
  insert(e, t) {
    try {
      this._doInsert(e, void 0 === t ? nDe : { ...nDe, ...t });
    } catch (spt) {
      (this.cancel(),
        this._logService.error(spt),
        this._logService.error("snippet_error"),
        this._logService.error("insert_template=", e),
        this._logService.error(
          "existing_template=",
          this._session ? this._session._logInfo() : "<no_session>",
        ));
    }
  }
  _doInsert(e, t) {
    if (this._editor.hasModel()) {
      if (
        (this._snippetListener.clear(),
        t.undoStopBefore && this._editor.getModel().pushStackElement(),
        this._session && "string" != typeof e && this.cancel(),
        this._session
          ? (pR("string" == typeof e), this._session.merge(e, t))
          : ((this._modelVersionId = this._editor.getModel().getAlternativeVersionId()),
            (this._session = new JLe(this._editor, e, t, this._languageConfigurationService)),
            this._session.insert(t.reason)),
        t.undoStopAfter && this._editor.getModel().pushStackElement(),
        this._session?.hasChoice)
      ) {
        const e = {
            _debugDisplayName: "snippetChoiceCompletions",
            provideCompletionItems: (e, t) => {
              if (
                !this._session ||
                e !== this._editor.getModel() ||
                !xV.equals(this._editor.getPosition(), t)
              )
                return;
              const { activeChoice: n } = this._session;
              if (!n || 0 === n.choice.options.length) return;
              const i = e.getValueInRange(n.range),
                r = Boolean(n.choice.options.find((e) => e.value === i)),
                o = [];
              for (let s = 0; s < n.choice.options.length; s++) {
                const e = n.choice.options[s];
                o.push({
                  kind: 13,
                  label: e.value,
                  insertText: e.value,
                  sortText: "a".repeat(s + 1),
                  range: n.range,
                  filterText: r ? `${i}_${e.value}` : void 0,
                  command: {
                    id: "jumpToNextSnippetPlaceholder",
                    title: SI(1405, "Go to next placeholder..."),
                  },
                });
              }
              return { suggestions: o };
            },
          },
          t = this._editor.getModel();
        let n,
          i = !1;
        const r = () => {
            (n?.dispose(), (i = !1));
          },
          o = () => {
            i ||
              ((n = this._languageFeaturesService.completionProvider.register(
                {
                  language: t.getLanguageId(),
                  pattern: t.uri.fsPath,
                  scheme: t.uri.scheme,
                  exclusive: !0,
                },
                e,
              )),
              this._snippetListener.add(n),
              (i = !0));
          };
        this._choiceCompletions = { provider: e, enable: o, disable: r };
      }
      (this._updateState(),
        this._snippetListener.add(
          this._editor.onDidChangeModelContent((e) => e.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())
        return this.cancel();
      if (!this._session.hasPlaceholder) return this.cancel();
      if (this._session.isAtLastPlaceholder || !this._session.isSelectionWithinPlaceholders())
        return (this._editor.getModel().pushStackElement(), this.cancel());
      (this._inSnippet.set(!0),
        this._inSnippetObservable.set(!0, void 0),
        this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),
        this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),
        this._handleChoice());
    }
  }
  _handleChoice() {
    if (!this._session || !this._editor.hasModel()) return void (this._currentChoice = void 0);
    const { activeChoice: e } = this._session;
    if (!e || !this._choiceCompletions)
      return (this._choiceCompletions?.disable(), void (this._currentChoice = void 0));
    this._currentChoice !== e.choice &&
      ((this._currentChoice = e.choice),
      this._choiceCompletions.enable(),
      queueMicrotask(() => {
        !(function (e, t) {
          e.getContribution("editor.contrib.suggestController")?.triggerSuggest(
            new Set().add(t),
            void 0,
            !0,
          );
        })(this._editor, this._choiceCompletions.provider);
      }));
  }
  finish() {
    for (; this._inSnippet.get(); ) this.next();
  }
  cancel(e = !1) {
    (this._inSnippet.reset(),
      this._inSnippetObservable.set(!1, 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),
      e && this._editor.setSelections([this._editor.getSelection()]));
  }
  prev() {
    (this._session?.prev(), this._updateState());
  }
  next() {
    (this._session?.next(), this._updateState());
  }
  isInSnippet() {
    return Boolean(this._inSnippet.get());
  }
  get isInSnippetObservable() {
    return this._inSnippetObservable;
  }
};
((iDe = eDe =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })([tDe(1, yH), tDe(2, mee), tDe(3, xW), tDe(4, f$)], iDe)),
  zH(iDe.ID, iDe, 4));
const rDe = MH.bindToContribution(iDe.get);
function oDe(e) {
  return new sDe(e);
}
(BH(
  new rDe({
    id: "jumpToNextSnippetPlaceholder",
    precondition: eW.and(iDe.InSnippetMode, iDe.HasNextTabstop),
    handler: (e) => e.next(),
    kbOpts: { weight: 130, kbExpr: $$.textInputFocus, primary: 2 },
  }),
),
  BH(
    new rDe({
      id: "jumpToPrevSnippetPlaceholder",
      precondition: eW.and(iDe.InSnippetMode, iDe.HasPrevTabstop),
      handler: (e) => e.prev(),
      kbOpts: { weight: 130, kbExpr: $$.textInputFocus, primary: 1026 },
    }),
  ),
  BH(
    new rDe({
      id: "leaveSnippet",
      precondition: iDe.InSnippetMode,
      handler: (e) => e.cancel(!0),
      kbOpts: { weight: 130, kbExpr: $$.textInputFocus, primary: 9, secondary: [1033] },
    }),
  ),
  BH(
    new rDe({ id: "acceptSnippet", precondition: iDe.InSnippetMode, handler: (e) => e.finish() }),
  ));
class sDe extends t3 {
  constructor(e) {
    (super(), (this._textModel = e));
  }
  getOffset(e) {
    return this._textModel.getOffsetAt(e);
  }
  getPosition(e) {
    return this._textModel.getPositionAt(e);
  }
}
const aDe = [];
function lDe(e) {
  const t = (function (e) {
    const t = kj.createSortPermutation(
        e,
        bj((e) => e.range, YH.compareRangesUsingStarts),
      ),
      n = new l3(t.apply(e)),
      i = n.getNewRanges();
    return t.inverse().apply(i);
  })(e);
  return t.map((e) => e.getEndPosition());
}
class cDe {
  constructor(e) {
    this._contextKeyService = e;
  }
  bind(e, t) {
    return Tne(e, this._contextKeyService, t instanceof Function ? t : (e) => t.read(e));
  }
}
function dDe(e, t) {
  return new Promise((n) => {
    let i;
    const r = setTimeout(() => {
      (i && i.dispose(), n());
    }, e);
    t &&
      (i = t.onCancellationRequested(() => {
        (clearTimeout(r), i && i.dispose(), n());
      }));
  });
}
class uDe {
  constructor(e, t, n, i = hDe) {
    ((this.startValue = e),
      (this.endValue = t),
      (this.durationMs = n),
      (this._interpolationFunction = i),
      (this.startTimeMs = Date.now()),
      e === t && (this.durationMs = 0));
  }
  isFinished() {
    return Date.now() >= this.startTimeMs + this.durationMs;
  }
  getValue() {
    const e = Date.now() - this.startTimeMs;
    if (e >= this.durationMs) return this.endValue;
    return this._interpolationFunction(
      e,
      this.startValue,
      this.endValue - this.startValue,
      this.durationMs,
    );
  }
}
function hDe(e, t, n, i) {
  return e === i ? t + n : n * (1 - Math.pow(2, (-10 * e) / i)) + t;
}
function gDe(e, t, n, i) {
  return n * ((e = e / i - 1) * e * e + 1) + t;
}
class pDe {
  constructor(e) {
    this._value = LF(this, e);
  }
  getValue(e) {
    const t = this._value.read(e);
    return (t.isFinished() || fDe.instance.invalidateOnNextAnimationFrame(e), t.getValue());
  }
}
class fDe {
  constructor() {
    ((this._counter = A9(this)), (this._isScheduled = !1));
  }
  static {
    this.instance = new fDe();
  }
  invalidateOnNextAnimationFrame(e) {
    (this._counter.read(e),
      this._isScheduled ||
        ((this._isScheduled = !0),
        wB().requestAnimationFrame(() => {
          ((this._isScheduled = !1), this._update());
        })));
  }
  _update() {
    this._counter.trigger(void 0);
  }
}
class mDe {
  constructor(e, t) {
    ((this.lineNumber = e), (this.parts = t), iR(() => rR(t, (e, t) => e.column <= t.column)));
  }
  equals(e) {
    return (
      this.lineNumber === e.lineNumber &&
      this.parts.length === e.parts.length &&
      this.parts.every((t, n) => t.equals(e.parts[n]))
    );
  }
  renderForScreenReader(e) {
    if (0 === this.parts.length) return "";
    const t = this.parts[this.parts.length - 1],
      n = e.substr(0, t.column - 1),
      i = new l3([
        ...this.parts.map(
          (e) =>
            new c3(YH.fromPositions(new xV(1, e.column)), e.lines.map((e) => e.line).join("\n")),
        ),
      ]).applyToString(n);
    return i.substring(this.parts[0].column - 1);
  }
  isEmpty() {
    return this.parts.every((e) => 0 === e.lines.length);
  }
  get lineCount() {
    return 1 + this.parts.reduce((e, t) => e + t.lines.length - 1, 0);
  }
}
class _De {
  constructor(e, t, n, i = []) {
    ((this.column = e),
      (this.text = t),
      (this.preview = n),
      (this._inlineDecorations = i),
      (this.lines = ZM(this.text).map((e, t) => ({
        line: e,
        lineDecorations: gQ.filter(this._inlineDecorations, t + 1, 1, e.length + 1),
      }))));
  }
  equals(e) {
    return (
      this.column === e.column &&
      this.lines.length === e.lines.length &&
      this.lines.every(
        (t, n) =>
          t.line === e.lines[n].line && gQ.equalsArr(t.lineDecorations, e.lines[n].lineDecorations),
      )
    );
  }
}
class vDe {
  constructor(e, t, n, i = 0) {
    ((this.lineNumber = e),
      (this.columnRange = t),
      (this.text = n),
      (this.additionalReservedLineCount = i),
      (this.parts = [new _De(this.columnRange.endColumnExclusive, this.text, !1)]),
      (this.newLines = ZM(this.text)));
  }
  renderForScreenReader(e) {
    return this.newLines.join("\n");
  }
  get lineCount() {
    return this.newLines.length;
  }
  isEmpty() {
    return this.parts.every((e) => 0 === e.lines.length);
  }
  equals(e) {
    return (
      this.lineNumber === e.lineNumber &&
      this.columnRange.equals(e.columnRange) &&
      this.newLines.length === e.newLines.length &&
      this.newLines.every((t, n) => t === e.newLines[n]) &&
      this.additionalReservedLineCount === e.additionalReservedLineCount
    );
  }
}
function bDe(e, t) {
  return XP(e, t, yDe);
}
function yDe(e, t) {
  return (
    e === t ||
    (!(!e || !t) &&
      ((e instanceof mDe && t instanceof mDe) || (e instanceof vDe && t instanceof vDe)) &&
      e.equals(t))
  );
}
function xDe(e, t, n) {
  const i = n ? e.range.intersectRanges(n) : e.range;
  if (!i) return e;
  const r = e.text.replaceAll("\r\n", "\n"),
    o = t.getValueInRange(i, 1),
    s = cA(o, r),
    a = e3.ofText(o.substring(0, s)).addToPosition(e.range.getStartPosition()),
    l = r.substring(s),
    c = YH.fromPositions(a, e.range.getEndPosition());
  return new c3(c, l);
}
function wDe(e, t) {
  return (
    e.text.startsWith(t.text) &&
    ((n = e.range),
    (i = t.range).getStartPosition().equals(n.getStartPosition()) &&
      i.getEndPosition().isBeforeOrEqual(n.getEndPosition()))
  );
  var n, i;
}
function CDe(e, t, n, i, r = 0) {
  let o = xDe(e, t);
  if (o.range.endLineNumber !== o.range.startLineNumber) return;
  const s = t.getLineContent(o.range.startLineNumber),
    a = XM(s).length;
  if (o.range.startColumn - 1 <= a) {
    const e = XM(o.text).length,
      t = s.substring(o.range.startColumn - 1, a),
      [n, i] = [o.range.getStartPosition(), o.range.getEndPosition()],
      r = n.column + t.length <= i.column ? n.delta(0, t.length) : i,
      l = YH.fromPositions(r, i),
      c = o.text.startsWith(t) ? o.text.substring(t.length) : o.text.substring(e);
    o = new c3(l, c);
  }
  const l = t.getValueInRange(o.range),
    c = (function (e, t) {
      if (SDe?.originalValue === e && SDe?.newValue === t) return SDe?.changes;
      {
        let n = EDe(e, t, !0);
        if (n) {
          const i = kDe(n);
          if (i > 0) {
            const r = EDe(e, t, !1);
            r && kDe(r) < i && (n = r);
          }
        }
        return ((SDe = { originalValue: e, newValue: t, changes: n }), n);
      }
    })(l, o.text);
  if (!c) return;
  const d = o.range.startLineNumber,
    u = new Array();
  if ("prefix" === n) {
    const e = c.filter((e) => 0 === e.originalLength);
    if (e.length > 1 || (1 === e.length && e[0].originalStart !== l.length)) return;
  }
  const h = o.text.length - r;
  for (const g of c) {
    const e = o.range.startColumn + g.originalStart + g.originalLength;
    if ("subwordSmart" === n && i && i.lineNumber === o.range.startLineNumber && e < i.column)
      return;
    if (g.originalLength > 0) return;
    if (0 === g.modifiedLength) continue;
    const t = g.modifiedStart + g.modifiedLength,
      r = Math.max(g.modifiedStart, Math.min(t, h)),
      s = o.text.substring(g.modifiedStart, r),
      a = o.text.substring(r, Math.max(g.modifiedStart, t));
    (s.length > 0 && u.push(new _De(e, s, !1)), a.length > 0 && u.push(new _De(e, a, !0)));
  }
  return new mDe(d, u);
}
let SDe;
function kDe(e) {
  let t = 0;
  for (const n of e) t += n.originalLength;
  return t;
}
function EDe(e, t, n) {
  if (e.length > 5e3 || t.length > 5e3) return;
  function i(e) {
    let t = 0;
    for (let n = 0, i = e.length; n < i; n++) {
      const i = e.charCodeAt(n);
      i > t && (t = i);
    }
    return t;
  }
  const r = Math.max(i(e), i(t));
  function o(e) {
    if (e < 0) throw new Error("unexpected");
    return r + e + 1;
  }
  function s(e) {
    let t = 0,
      i = 0;
    const r = new Int32Array(e.length);
    for (let s = 0, a = e.length; s < a; s++)
      if (n && "(" === e[s]) {
        const e = 100 * i + t;
        ((r[s] = o(2 * e)), t++);
      } else if (n && ")" === e[s]) {
        t = Math.max(t - 1, 0);
        const e = 100 * i + t;
        ((r[s] = o(2 * e + 1)), 0 === t && i++);
      } else r[s] = e.charCodeAt(s);
    return r;
  }
  const a = s(e),
    l = s(t);
  return new yxe({ getElements: () => a }, { getElements: () => l }).ComputeDiff(!1).changes;
}
var NDe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
class LDe {
  constructor(e, t) {
    ((this._baseService = e), (this._intercept = t));
  }
  publicLog2(e, t) {
    (this._intercept(e, t), this._baseService.publicLog2(e, t));
  }
}
let DDe = class extends LDe {
  constructor(e, t) {
    super(e, (e, n) => {
      let i = !0;
      (n && TDe in n && (i = Boolean(n[TDe])),
        i && t.getDataChannel("editTelemetry").sendData({ eventName: e, data: n ?? {} }));
    });
  }
};
DDe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([NDe(0, HW), NDe(1, PLe)], DDe);
const TDe = Symbol("shouldForwardToChannel");
function IDe(e) {
  if (!e) return !1;
  const t = e.toLowerCase();
  return "github.copilot" === t || "github.copilot-chat" === t;
}
class RDe {
  constructor(e, t, n) {
    ((this.changes = e), (this.moves = t), (this.hitTimeout = n));
  }
}
class ODe {
  constructor(e, t) {
    ((this.lineRangeMapping = e), (this.changes = t));
  }
}
class MDe {
  computeDiff(e, t, n) {
    const i = new VDe(e, t, {
        maxComputationTime: n.maxComputationTimeMs,
        shouldIgnoreTrimWhitespace: n.ignoreTrimWhitespace,
        shouldComputeCharChanges: !0,
        shouldMakePrettyDiff: !0,
        shouldPostProcessCharChanges: !0,
      }).computeDiff(),
      r = [];
    let o = null;
    for (const s of i.changes) {
      let e, t;
      ((e =
        0 === s.originalEndLineNumber
          ? new Q5(s.originalStartLineNumber + 1, s.originalStartLineNumber + 1)
          : new Q5(s.originalStartLineNumber, s.originalEndLineNumber + 1)),
        (t =
          0 === s.modifiedEndLineNumber
            ? new Q5(s.modifiedStartLineNumber + 1, s.modifiedStartLineNumber + 1)
            : new Q5(s.modifiedStartLineNumber, s.modifiedEndLineNumber + 1)));
      let n = new Wle(
        e,
        t,
        s.charChanges?.map(
          (e) =>
            new Hle(
              new YH(
                e.originalStartLineNumber,
                e.originalStartColumn,
                e.originalEndLineNumber,
                e.originalEndColumn,
              ),
              new YH(
                e.modifiedStartLineNumber,
                e.modifiedStartColumn,
                e.modifiedEndLineNumber,
                e.modifiedEndColumn,
              ),
            ),
        ),
      );
      (o &&
        ((o.modified.endLineNumberExclusive !== n.modified.startLineNumber &&
          o.original.endLineNumberExclusive !== n.original.startLineNumber) ||
          ((n = new Wle(
            o.original.join(n.original),
            o.modified.join(n.modified),
            o.innerChanges && n.innerChanges ? o.innerChanges.concat(n.innerChanges) : void 0,
          )),
          r.pop())),
        r.push(n),
        (o = n));
    }
    return (
      iR(() =>
        rR(
          r,
          (e, t) =>
            t.original.startLineNumber - e.original.endLineNumberExclusive ===
              t.modified.startLineNumber - e.modified.endLineNumberExclusive &&
            e.original.endLineNumberExclusive < t.original.startLineNumber &&
            e.modified.endLineNumberExclusive < t.modified.startLineNumber,
        ),
      ),
      new RDe(r, [], i.quitEarly)
    );
  }
}
function ADe(e, t, n, i) {
  return new yxe(e, t, n).ComputeDiff(i);
}
let PDe = class {
  constructor(e) {
    const t = [],
      n = [];
    for (let i = 0, r = e.length; i < r; i++) ((t[i] = WDe(e[i], 1)), (n[i] = HDe(e[i], 1)));
    ((this.lines = e), (this._startColumns = t), (this._endColumns = n));
  }
  getElements() {
    const e = [];
    for (let t = 0, n = this.lines.length; t < n; t++)
      e[t] = this.lines[t].substring(this._startColumns[t] - 1, this._endColumns[t] - 1);
    return e;
  }
  getStrictElement(e) {
    return this.lines[e];
  }
  getStartLineNumber(e) {
    return e + 1;
  }
  getEndLineNumber(e) {
    return e + 1;
  }
  createCharSequence(e, t, n) {
    const i = [],
      r = [],
      o = [];
    let s = 0;
    for (let a = t; a <= n; a++) {
      const t = this.lines[a],
        l = e ? this._startColumns[a] : 1,
        c = e ? this._endColumns[a] : t.length + 1;
      for (let e = l; e < c; e++) ((i[s] = t.charCodeAt(e - 1)), (r[s] = a + 1), (o[s] = e), s++);
      !e && a < n && ((i[s] = 10), (r[s] = a + 1), (o[s] = t.length + 1), s++);
    }
    return new jDe(i, r, o);
  }
};
class jDe {
  constructor(e, t, n) {
    ((this._charCodes = e), (this._lineNumbers = t), (this._columns = n));
  }
  toString() {
    return (
      "[" +
      this._charCodes
        .map(
          (e, t) =>
            (10 === e ? "\\n" : String.fromCharCode(e)) +
            `-(${this._lineNumbers[t]},${this._columns[t]})`,
        )
        .join(", ") +
      "]"
    );
  }
  _assertIndex(e, t) {
    if (e < 0 || e >= t.length) throw new Error("Illegal index");
  }
  getElements() {
    return this._charCodes;
  }
  getStartLineNumber(e) {
    return e > 0 && e === this._lineNumbers.length
      ? this.getEndLineNumber(e - 1)
      : (this._assertIndex(e, this._lineNumbers), this._lineNumbers[e]);
  }
  getEndLineNumber(e) {
    return -1 === e
      ? this.getStartLineNumber(e + 1)
      : (this._assertIndex(e, this._lineNumbers),
        10 === this._charCodes[e] ? this._lineNumbers[e] + 1 : this._lineNumbers[e]);
  }
  getStartColumn(e) {
    return e > 0 && e === this._columns.length
      ? this.getEndColumn(e - 1)
      : (this._assertIndex(e, this._columns), this._columns[e]);
  }
  getEndColumn(e) {
    return -1 === e
      ? this.getStartColumn(e + 1)
      : (this._assertIndex(e, this._columns), 10 === this._charCodes[e] ? 1 : this._columns[e] + 1);
  }
}
class FDe {
  constructor(e, t, n, i, r, o, s, a) {
    ((this.originalStartLineNumber = e),
      (this.originalStartColumn = t),
      (this.originalEndLineNumber = n),
      (this.originalEndColumn = i),
      (this.modifiedStartLineNumber = r),
      (this.modifiedStartColumn = o),
      (this.modifiedEndLineNumber = s),
      (this.modifiedEndColumn = a));
  }
  static createFromDiffChange(e, t, n) {
    const i = t.getStartLineNumber(e.originalStart),
      r = t.getStartColumn(e.originalStart),
      o = t.getEndLineNumber(e.originalStart + e.originalLength - 1),
      s = t.getEndColumn(e.originalStart + e.originalLength - 1),
      a = n.getStartLineNumber(e.modifiedStart),
      l = n.getStartColumn(e.modifiedStart),
      c = n.getEndLineNumber(e.modifiedStart + e.modifiedLength - 1),
      d = n.getEndColumn(e.modifiedStart + e.modifiedLength - 1);
    return new FDe(i, r, o, s, a, l, c, d);
  }
}
class BDe {
  constructor(e, t, n, i, r) {
    ((this.originalStartLineNumber = e),
      (this.originalEndLineNumber = t),
      (this.modifiedStartLineNumber = n),
      (this.modifiedEndLineNumber = i),
      (this.charChanges = r));
  }
  static createFromDiffResult(e, t, n, i, r, o, s) {
    let a, l, c, d, u;
    if (
      (0 === t.originalLength
        ? ((a = n.getStartLineNumber(t.originalStart) - 1), (l = 0))
        : ((a = n.getStartLineNumber(t.originalStart)),
          (l = n.getEndLineNumber(t.originalStart + t.originalLength - 1))),
      0 === t.modifiedLength
        ? ((c = i.getStartLineNumber(t.modifiedStart) - 1), (d = 0))
        : ((c = i.getStartLineNumber(t.modifiedStart)),
          (d = i.getEndLineNumber(t.modifiedStart + t.modifiedLength - 1))),
      o &&
        t.originalLength > 0 &&
        t.originalLength < 20 &&
        t.modifiedLength > 0 &&
        t.modifiedLength < 20 &&
        r())
    ) {
      const o = n.createCharSequence(e, t.originalStart, t.originalStart + t.originalLength - 1),
        a = i.createCharSequence(e, t.modifiedStart, t.modifiedStart + t.modifiedLength - 1);
      if (o.getElements().length > 0 && a.getElements().length > 0) {
        let e = ADe(o, a, r, !0).changes;
        (s &&
          (e = (function (e) {
            if (e.length <= 1) return e;
            const t = [e[0]];
            let n = t[0];
            for (let i = 1, r = e.length; i < r; i++) {
              const r = e[i],
                o = r.originalStart - (n.originalStart + n.originalLength),
                s = r.modifiedStart - (n.modifiedStart + n.modifiedLength);
              Math.min(o, s) < 3
                ? ((n.originalLength = r.originalStart + r.originalLength - n.originalStart),
                  (n.modifiedLength = r.modifiedStart + r.modifiedLength - n.modifiedStart))
                : (t.push(r), (n = r));
            }
            return t;
          })(e)),
          (u = []));
        for (let t = 0, n = e.length; t < n; t++) u.push(FDe.createFromDiffChange(e[t], o, a));
      }
    }
    return new BDe(a, l, c, d, u);
  }
}
class VDe {
  constructor(e, t, n) {
    ((this.shouldComputeCharChanges = n.shouldComputeCharChanges),
      (this.shouldPostProcessCharChanges = n.shouldPostProcessCharChanges),
      (this.shouldIgnoreTrimWhitespace = n.shouldIgnoreTrimWhitespace),
      (this.shouldMakePrettyDiff = n.shouldMakePrettyDiff),
      (this.originalLines = e),
      (this.modifiedLines = t),
      (this.original = new PDe(e)),
      (this.modified = new PDe(t)),
      (this.continueLineDiff = zDe(n.maxComputationTime)),
      (this.continueCharDiff = zDe(
        0 === n.maxComputationTime ? 0 : Math.min(n.maxComputationTime, 5e3),
      )));
  }
  computeDiff() {
    if (1 === this.original.lines.length && 0 === this.original.lines[0].length)
      return 1 === this.modified.lines.length && 0 === this.modified.lines[0].length
        ? { quitEarly: !1, changes: [] }
        : {
            quitEarly: !1,
            changes: [
              {
                originalStartLineNumber: 1,
                originalEndLineNumber: 1,
                modifiedStartLineNumber: 1,
                modifiedEndLineNumber: this.modified.lines.length,
                charChanges: void 0,
              },
            ],
          };
    if (1 === this.modified.lines.length && 0 === this.modified.lines[0].length)
      return {
        quitEarly: !1,
        changes: [
          {
            originalStartLineNumber: 1,
            originalEndLineNumber: this.original.lines.length,
            modifiedStartLineNumber: 1,
            modifiedEndLineNumber: 1,
            charChanges: void 0,
          },
        ],
      };
    const e = ADe(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff),
      t = e.changes,
      n = e.quitEarly;
    if (this.shouldIgnoreTrimWhitespace) {
      const e = [];
      for (let n = 0, i = t.length; n < i; n++)
        e.push(
          BDe.createFromDiffResult(
            this.shouldIgnoreTrimWhitespace,
            t[n],
            this.original,
            this.modified,
            this.continueCharDiff,
            this.shouldComputeCharChanges,
            this.shouldPostProcessCharChanges,
          ),
        );
      return { quitEarly: n, changes: e };
    }
    const i = [];
    let r = 0,
      o = 0;
    for (let s = -1, a = t.length; s < a; s++) {
      const e = s + 1 < a ? t[s + 1] : null,
        n = e ? e.originalStart : this.originalLines.length,
        l = e ? e.modifiedStart : this.modifiedLines.length;
      for (; r < n && o < l; ) {
        const e = this.originalLines[r],
          t = this.modifiedLines[o];
        if (e !== t) {
          {
            let n = WDe(e, 1),
              s = WDe(t, 1);
            for (; n > 1 && s > 1; ) {
              if (e.charCodeAt(n - 2) !== t.charCodeAt(s - 2)) break;
              (n--, s--);
            }
            (n > 1 || s > 1) && this._pushTrimWhitespaceCharChange(i, r + 1, 1, n, o + 1, 1, s);
          }
          {
            let n = HDe(e, 1),
              s = HDe(t, 1);
            const a = e.length + 1,
              l = t.length + 1;
            for (; n < a && s < l; ) {
              if (e.charCodeAt(n - 1) !== e.charCodeAt(s - 1)) break;
              (n++, s++);
            }
            (n < a || s < l) && this._pushTrimWhitespaceCharChange(i, r + 1, n, a, o + 1, s, l);
          }
        }
        (r++, o++);
      }
      e &&
        (i.push(
          BDe.createFromDiffResult(
            this.shouldIgnoreTrimWhitespace,
            e,
            this.original,
            this.modified,
            this.continueCharDiff,
            this.shouldComputeCharChanges,
            this.shouldPostProcessCharChanges,
          ),
        ),
        (r += e.originalLength),
        (o += e.modifiedLength));
    }
    return { quitEarly: n, changes: i };
  }
  _pushTrimWhitespaceCharChange(e, t, n, i, r, o, s) {
    if (this._mergeTrimWhitespaceCharChange(e, t, n, i, r, o, s)) return;
    let a;
    (this.shouldComputeCharChanges && (a = [new FDe(t, n, t, i, r, o, r, s)]),
      e.push(new BDe(t, t, r, r, a)));
  }
  _mergeTrimWhitespaceCharChange(e, t, n, i, r, o, s) {
    const a = e.length;
    if (0 === a) return !1;
    const l = e[a - 1];
    return (
      0 !== l.originalEndLineNumber &&
      0 !== l.modifiedEndLineNumber &&
      (l.originalEndLineNumber === t && l.modifiedEndLineNumber === r
        ? (this.shouldComputeCharChanges &&
            l.charChanges &&
            l.charChanges.push(new FDe(t, n, t, i, r, o, r, s)),
          !0)
        : l.originalEndLineNumber + 1 === t &&
          l.modifiedEndLineNumber + 1 === r &&
          ((l.originalEndLineNumber = t),
          (l.modifiedEndLineNumber = r),
          this.shouldComputeCharChanges &&
            l.charChanges &&
            l.charChanges.push(new FDe(t, n, t, i, r, o, r, s)),
          !0))
    );
  }
}
function WDe(e, t) {
  const n = YM(e);
  return -1 === n ? t : n + 1;
}
function HDe(e, t) {
  const n = QM(e);
  return -1 === n ? t : n + 2;
}
function zDe(e) {
  if (0 === e) return () => !0;
  const t = Date.now();
  return () => Date.now() - t < e;
}
class UDe {
  compute(e, t, n = Bce.instance, i) {
    if (0 === e.length || 0 === t.length) return Pce.trivial(e, t);
    const r = new Wce(e.length, t.length),
      o = new Wce(e.length, t.length),
      s = new Wce(e.length, t.length);
    for (let g = 0; g < e.length; g++)
      for (let a = 0; a < t.length; a++) {
        if (!n.isValid()) return Pce.trivialTimedOut(e, t);
        const l = 0 === g ? 0 : r.get(g - 1, a),
          c = 0 === a ? 0 : r.get(g, a - 1);
        let d;
        e.getElement(g) === t.getElement(a)
          ? ((d = 0 === g || 0 === a ? 0 : r.get(g - 1, a - 1)),
            g > 0 && a > 0 && 3 === o.get(g - 1, a - 1) && (d += s.get(g - 1, a - 1)),
            (d += i ? i(g, a) : 1))
          : (d = -1);
        const u = Math.max(l, c, d);
        if (u === d) {
          const e = g > 0 && a > 0 ? s.get(g - 1, a - 1) : 0;
          (s.set(g, a, e + 1), o.set(g, a, 3));
        } else
          u === l ? (s.set(g, a, 0), o.set(g, a, 1)) : u === c && (s.set(g, a, 0), o.set(g, a, 2));
        r.set(g, a, u);
      }
    const a = [];
    let l = e.length,
      c = t.length;
    function d(e, t) {
      ((e + 1 === l && t + 1 === c) || a.push(new jce(new N$(e + 1, l), new N$(t + 1, c))),
        (l = e),
        (c = t));
    }
    let u = e.length - 1,
      h = t.length - 1;
    for (; u >= 0 && h >= 0; )
      3 === o.get(u, h) ? (d(u, h), u--, h--) : 1 === o.get(u, h) ? u-- : h--;
    return (d(-1, -1), a.reverse(), new Pce(a, !1));
  }
}
class $De {
  compute(e, t, n = Bce.instance) {
    if (0 === e.length || 0 === t.length) return Pce.trivial(e, t);
    const i = e,
      r = t;
    function o(e, t) {
      for (; e < i.length && t < r.length && i.getElement(e) === r.getElement(t); ) (e++, t++);
      return e;
    }
    let s = 0;
    const a = new KDe();
    a.set(0, o(0, 0));
    const l = new GDe();
    l.set(0, 0 === a.get(0) ? null : new qDe(null, 0, 0, a.get(0)));
    let c = 0;
    e: for (;;) {
      if ((s++, !n.isValid())) return Pce.trivialTimedOut(i, r);
      const e = -Math.min(s, r.length + (s % 2)),
        t = Math.min(s, i.length + (s % 2));
      for (c = e; c <= t; c += 2) {
        const n = c === t ? -1 : a.get(c + 1),
          s = c === e ? -1 : a.get(c - 1) + 1,
          d = Math.min(Math.max(n, s), i.length),
          u = d - c;
        if (d > i.length || u > r.length) continue;
        const h = o(d, u);
        a.set(c, h);
        const g = d === n ? l.get(c + 1) : l.get(c - 1);
        if (
          (l.set(c, h !== d ? new qDe(g, d, u, h - d) : g),
          a.get(c) === i.length && a.get(c) - c === r.length)
        )
          break e;
      }
    }
    let d = l.get(c);
    const u = [];
    let h = i.length,
      g = r.length;
    for (;;) {
      const e = d ? d.x + d.length : 0,
        t = d ? d.y + d.length : 0;
      if (((e === h && t === g) || u.push(new jce(new N$(e, h), new N$(t, g))), !d)) break;
      ((h = d.x), (g = d.y), (d = d.prev));
    }
    return (u.reverse(), new Pce(u, !1));
  }
}
class qDe {
  constructor(e, t, n, i) {
    ((this.prev = e), (this.x = t), (this.y = n), (this.length = i));
  }
}
class KDe {
  constructor() {
    ((this.positiveArr = new Int32Array(10)), (this.negativeArr = new Int32Array(10)));
  }
  get(e) {
    return e < 0 ? ((e = -e - 1), this.negativeArr[e]) : this.positiveArr[e];
  }
  set(e, t) {
    if (e < 0) {
      if ((e = -e - 1) >= this.negativeArr.length) {
        const e = this.negativeArr;
        ((this.negativeArr = new Int32Array(2 * e.length)), this.negativeArr.set(e));
      }
      this.negativeArr[e] = t;
    } else {
      if (e >= this.positiveArr.length) {
        const e = this.positiveArr;
        ((this.positiveArr = new Int32Array(2 * e.length)), this.positiveArr.set(e));
      }
      this.positiveArr[e] = t;
    }
  }
}
class GDe {
  constructor() {
    ((this.positiveArr = []), (this.negativeArr = []));
  }
  get(e) {
    return e < 0 ? ((e = -e - 1), this.negativeArr[e]) : this.positiveArr[e];
  }
  set(e, t) {
    e < 0 ? ((e = -e - 1), (this.negativeArr[e] = t)) : (this.positiveArr[e] = t);
  }
}
class ZDe {
  constructor(e, t, n) {
    ((this.lines = e),
      (this.range = t),
      (this.considerWhitespaceChanges = n),
      (this.elements = []),
      (this.firstElementOffsetByLineIdx = []),
      (this.lineStartOffsets = []),
      (this.trimmedWsLengthsByLineIdx = []),
      this.firstElementOffsetByLineIdx.push(0));
    for (let i = this.range.startLineNumber; i <= this.range.endLineNumber; i++) {
      let t = e[i - 1],
        r = 0;
      (i === this.range.startLineNumber &&
        this.range.startColumn > 1 &&
        ((r = this.range.startColumn - 1), (t = t.substring(r))),
        this.lineStartOffsets.push(r));
      let o = 0;
      if (!n) {
        const e = t.trimStart();
        ((o = t.length - e.length), (t = e.trimEnd()));
      }
      this.trimmedWsLengthsByLineIdx.push(o);
      const s =
        i === this.range.endLineNumber
          ? Math.min(this.range.endColumn - 1 - r - o, t.length)
          : t.length;
      for (let e = 0; e < s; e++) this.elements.push(t.charCodeAt(e));
      i < this.range.endLineNumber &&
        (this.elements.push("\n".charCodeAt(0)),
        this.firstElementOffsetByLineIdx.push(this.elements.length));
    }
  }
  toString() {
    return `Slice: "${this.text}"`;
  }
  get text() {
    return this.getText(new N$(0, this.length));
  }
  getText(e) {
    return this.elements
      .slice(e.start, e.endExclusive)
      .map((e) => String.fromCharCode(e))
      .join("");
  }
  getElement(e) {
    return this.elements[e];
  }
  get length() {
    return this.elements.length;
  }
  getBoundaryScore(e) {
    const t = eTe(e > 0 ? this.elements[e - 1] : -1),
      n = eTe(e < this.elements.length ? this.elements[e] : -1);
    if (7 === t && 8 === n) return 0;
    if (8 === t) return 150;
    let i = 0;
    return (
      t !== n && ((i += 10), 0 === t && 1 === n && (i += 1)),
      (i += JDe(t)),
      (i += JDe(n)),
      i
    );
  }
  translateOffset(e, t = "right") {
    const n = M1(this.firstElementOffsetByLineIdx, (t) => t <= e),
      i = e - this.firstElementOffsetByLineIdx[n];
    return new xV(
      this.range.startLineNumber + n,
      1 +
        this.lineStartOffsets[n] +
        i +
        (0 === i && "left" === t ? 0 : this.trimmedWsLengthsByLineIdx[n]),
    );
  }
  translateRange(e) {
    const t = this.translateOffset(e.start, "right"),
      n = this.translateOffset(e.endExclusive, "left");
    return n.isBefore(t) ? YH.fromPositions(n, n) : YH.fromPositions(t, n);
  }
  findWordContaining(e) {
    if (e < 0 || e >= this.elements.length) return;
    if (!YDe(this.elements[e])) return;
    let t = e;
    for (; t > 0 && YDe(this.elements[t - 1]); ) t--;
    let n = e;
    for (; n < this.elements.length && YDe(this.elements[n]); ) n++;
    return new N$(t, n);
  }
  findSubWordContaining(e) {
    if (e < 0 || e >= this.elements.length) return;
    if (!YDe(this.elements[e])) return;
    let t = e;
    for (; t > 0 && YDe(this.elements[t - 1]) && !XDe(this.elements[t]); ) t--;
    let n = e;
    for (; n < this.elements.length && YDe(this.elements[n]) && !XDe(this.elements[n]); ) n++;
    return new N$(t, n);
  }
  countLinesIn(e) {
    return (
      this.translateOffset(e.endExclusive).lineNumber - this.translateOffset(e.start).lineNumber
    );
  }
  isStronglyEqual(e, t) {
    return this.elements[e] === this.elements[t];
  }
  extendToFullLines(e) {
    const t = O1(this.firstElementOffsetByLineIdx, (t) => t <= e.start) ?? 0,
      n =
        (function (e, t) {
          const n = A1(e, t);
          return n === e.length ? void 0 : e[n];
        })(this.firstElementOffsetByLineIdx, (t) => e.endExclusive <= t) ?? this.elements.length;
    return new N$(t, n);
  }
}
function YDe(e) {
  return (e >= 97 && e <= 122) || (e >= 65 && e <= 90) || (e >= 48 && e <= 57);
}
function XDe(e) {
  return e >= 65 && e <= 90;
}
const QDe = { 0: 0, 1: 0, 2: 0, 3: 10, 4: 2, 5: 30, 6: 3, 7: 10, 8: 10 };
function JDe(e) {
  return QDe[e];
}
function eTe(e) {
  return 10 === e
    ? 8
    : 13 === e
      ? 7
      : Hce(e)
        ? 6
        : e >= 97 && e <= 122
          ? 0
          : e >= 65 && e <= 90
            ? 1
            : e >= 48 && e <= 57
              ? 2
              : -1 === e
                ? 3
                : 44 === e || 59 === e
                  ? 5
                  : 4;
}
function tTe(e, t, n, i, r, o) {
  let { moves: s, excludedChanges: a } = (function (e, t, n, i) {
    const r = [],
      o = e
        .filter((e) => e.modified.isEmpty && e.original.length >= 3)
        .map((e) => new zce(e.original, t, e)),
      s = new Set(
        e
          .filter((e) => e.original.isEmpty && e.modified.length >= 3)
          .map((e) => new zce(e.modified, n, e)),
      ),
      a = new Set();
    for (const l of o) {
      let e,
        t = -1;
      for (const n of s) {
        const i = l.computeSimilarity(n);
        i > t && ((t = i), (e = n));
      }
      if (
        (t > 0.9 &&
          e &&
          (s.delete(e), r.push(new Fle(l.range, e.range)), a.add(l.source), a.add(e.source)),
        !i.isValid())
      )
        return { moves: r, excludedChanges: a };
    }
    return { moves: r, excludedChanges: a };
  })(e, t, n, o);
  if (!o.isValid()) return [];
  const l = e.filter((e) => !a.has(e)),
    c = (function (e, t, n, i, r, o) {
      const s = [],
        a = new JW();
      for (const h of e)
        for (let e = h.original.startLineNumber; e < h.original.endLineNumberExclusive - 2; e++) {
          const n = `${t[e - 1]}:${t[e + 1 - 1]}:${t[e + 2 - 1]}`;
          a.add(n, { range: new Q5(e, e + 3) });
        }
      const l = [];
      e.sort(bj((e) => e.modified.startLineNumber, yj));
      for (const h of e) {
        let e = [];
        for (let t = h.modified.startLineNumber; t < h.modified.endLineNumberExclusive - 2; t++) {
          const i = `${n[t - 1]}:${n[t + 1 - 1]}:${n[t + 2 - 1]}`,
            r = new Q5(t, t + 3),
            o = [];
          (a.forEach(i, ({ range: t }) => {
            for (const i of e)
              if (
                i.originalLineRange.endLineNumberExclusive + 1 === t.endLineNumberExclusive &&
                i.modifiedLineRange.endLineNumberExclusive + 1 === r.endLineNumberExclusive
              )
                return (
                  (i.originalLineRange = new Q5(
                    i.originalLineRange.startLineNumber,
                    t.endLineNumberExclusive,
                  )),
                  (i.modifiedLineRange = new Q5(
                    i.modifiedLineRange.startLineNumber,
                    r.endLineNumberExclusive,
                  )),
                  void o.push(i)
                );
            const n = { modifiedLineRange: r, originalLineRange: t };
            (l.push(n), o.push(n));
          }),
            (e = o));
        }
        if (!o.isValid()) return [];
      }
      l.sort(wj(bj((e) => e.modifiedLineRange.length, yj)));
      const c = new J5(),
        d = new J5();
      for (const h of l) {
        const e = h.modifiedLineRange.startLineNumber - h.originalLineRange.startLineNumber,
          t = c.subtractFrom(h.modifiedLineRange),
          n = d.subtractFrom(h.originalLineRange).getWithDelta(e),
          i = t.getIntersection(n);
        for (const r of i.ranges) {
          if (r.length < 3) continue;
          const t = r,
            n = r.delta(-e);
          (s.push(new Fle(n, t)), c.addRange(t), d.addRange(n));
        }
      }
      s.sort(bj((e) => e.original.startLineNumber, yj));
      const u = new P1(e);
      for (let h = 0; h < s.length; h++) {
        const t = s[h],
          n = u.findLastMonotonous((e) => e.original.startLineNumber <= t.original.startLineNumber),
          a = O1(e, (e) => e.modified.startLineNumber <= t.modified.startLineNumber),
          l = Math.max(
            t.original.startLineNumber - n.original.startLineNumber,
            t.modified.startLineNumber - a.modified.startLineNumber,
          ),
          g = u.findLastMonotonous(
            (e) => e.original.startLineNumber < t.original.endLineNumberExclusive,
          ),
          p = O1(e, (e) => e.modified.startLineNumber < t.modified.endLineNumberExclusive),
          f = Math.max(
            g.original.endLineNumberExclusive - t.original.endLineNumberExclusive,
            p.modified.endLineNumberExclusive - t.modified.endLineNumberExclusive,
          );
        let m, _;
        for (m = 0; m < l; m++) {
          const e = t.original.startLineNumber - m - 1,
            n = t.modified.startLineNumber - m - 1;
          if (e > i.length || n > r.length) break;
          if (c.contains(n) || d.contains(e)) break;
          if (!nTe(i[e - 1], r[n - 1], o)) break;
        }
        for (
          m > 0 &&
            (d.addRange(new Q5(t.original.startLineNumber - m, t.original.startLineNumber)),
            c.addRange(new Q5(t.modified.startLineNumber - m, t.modified.startLineNumber))),
            _ = 0;
          _ < f;
          _++
        ) {
          const e = t.original.endLineNumberExclusive + _,
            n = t.modified.endLineNumberExclusive + _;
          if (e > i.length || n > r.length) break;
          if (c.contains(n) || d.contains(e)) break;
          if (!nTe(i[e - 1], r[n - 1], o)) break;
        }
        (_ > 0 &&
          (d.addRange(
            new Q5(t.original.endLineNumberExclusive, t.original.endLineNumberExclusive + _),
          ),
          c.addRange(
            new Q5(t.modified.endLineNumberExclusive, t.modified.endLineNumberExclusive + _),
          )),
          (m > 0 || _ > 0) &&
            (s[h] = new Fle(
              new Q5(t.original.startLineNumber - m, t.original.endLineNumberExclusive + _),
              new Q5(t.modified.startLineNumber - m, t.modified.endLineNumberExclusive + _),
            )));
      }
      return s;
    })(l, i, r, t, n, o);
  return (
    gj(s, c),
    (s = (function (e) {
      if (0 === e.length) return e;
      e.sort(bj((e) => e.original.startLineNumber, yj));
      const t = [e[0]];
      for (let n = 1; n < e.length; n++) {
        const i = t[t.length - 1],
          r = e[n],
          o = r.original.startLineNumber - i.original.endLineNumberExclusive,
          s = r.modified.startLineNumber - i.modified.endLineNumberExclusive;
        o >= 0 && s >= 0 && o + s <= 2 ? (t[t.length - 1] = i.join(r)) : t.push(r);
      }
      return t;
    })(s)),
    (s = s.filter((e) => {
      const n = e.original
        .toOffsetRange()
        .slice(t)
        .map((e) => e.trim());
      return (
        n.join("\n").length >= 15 &&
        (function (e, t) {
          let n = 0;
          for (const i of e) t(i) && n++;
          return n;
        })(n, (e) => e.length >= 2) >= 2
      );
    })),
    (s = (function (e, t) {
      const n = new P1(e);
      return (
        (t = t.filter((t) => {
          const i =
              n.findLastMonotonous(
                (e) => e.original.startLineNumber < t.original.endLineNumberExclusive,
              ) || new Fle(new Q5(1, 1), new Q5(1, 1)),
            r = O1(e, (e) => e.modified.startLineNumber < t.modified.endLineNumberExclusive);
          return i !== r;
        })),
        t
      );
    })(e, s)),
    s
  );
}
function nTe(e, t, n) {
  if (e.trim() === t.trim()) return !0;
  if (e.length > 300 && t.length > 300) return !1;
  const i = new $De().compute(
    new ZDe([e], new YH(1, 1, 1, e.length), !1),
    new ZDe([t], new YH(1, 1, 1, t.length), !1),
    n,
  );
  let r = 0;
  const o = jce.invert(i.diffs, e.length);
  for (const a of o)
    a.seq1Range.forEach((t) => {
      Hce(e.charCodeAt(t)) || r++;
    });
  const s = (function (t) {
    let n = 0;
    for (let i = 0; i < e.length; i++) Hce(t.charCodeAt(i)) || n++;
    return n;
  })(e.length > t.length ? e : t);
  return r / s > 0.6 && s > 10;
}
function iTe(e, t, n) {
  let i = n;
  return (
    (i = rTe(e, t, i)),
    (i = rTe(e, t, i)),
    (i = (function (e, t, n) {
      if (!e.getBoundaryScore || !t.getBoundaryScore) return n;
      for (let i = 0; i < n.length; i++) {
        const r = i > 0 ? n[i - 1] : void 0,
          o = n[i],
          s = i + 1 < n.length ? n[i + 1] : void 0,
          a = new N$(r ? r.seq1Range.endExclusive + 1 : 0, s ? s.seq1Range.start - 1 : e.length),
          l = new N$(r ? r.seq2Range.endExclusive + 1 : 0, s ? s.seq2Range.start - 1 : t.length);
        o.seq1Range.isEmpty
          ? (n[i] = oTe(o, e, t, a, l))
          : o.seq2Range.isEmpty && (n[i] = oTe(o.swap(), t, e, l, a).swap());
      }
      return n;
    })(e, t, i)),
    i
  );
}
function rTe(e, t, n) {
  if (0 === n.length) return n;
  const i = [];
  i.push(n[0]);
  for (let o = 1; o < n.length; o++) {
    const r = i[i.length - 1];
    let s = n[o];
    if (s.seq1Range.isEmpty || s.seq2Range.isEmpty) {
      const n = s.seq1Range.start - r.seq1Range.endExclusive;
      let o;
      for (
        o = 1;
        o <= n &&
        e.getElement(s.seq1Range.start - o) === e.getElement(s.seq1Range.endExclusive - o) &&
        t.getElement(s.seq2Range.start - o) === t.getElement(s.seq2Range.endExclusive - o);
        o++
      );
      if ((o--, o === n)) {
        i[i.length - 1] = new jce(
          new N$(r.seq1Range.start, s.seq1Range.endExclusive - n),
          new N$(r.seq2Range.start, s.seq2Range.endExclusive - n),
        );
        continue;
      }
      s = s.delta(-o);
    }
    i.push(s);
  }
  const r = [];
  for (let o = 0; o < i.length - 1; o++) {
    const n = i[o + 1];
    let s = i[o];
    if (s.seq1Range.isEmpty || s.seq2Range.isEmpty) {
      const r = n.seq1Range.start - s.seq1Range.endExclusive;
      let a;
      for (
        a = 0;
        a < r &&
        e.isStronglyEqual(s.seq1Range.start + a, s.seq1Range.endExclusive + a) &&
        t.isStronglyEqual(s.seq2Range.start + a, s.seq2Range.endExclusive + a);
        a++
      );
      if (a === r) {
        i[o + 1] = new jce(
          new N$(s.seq1Range.start + r, n.seq1Range.endExclusive),
          new N$(s.seq2Range.start + r, n.seq2Range.endExclusive),
        );
        continue;
      }
      a > 0 && (s = s.delta(a));
    }
    r.push(s);
  }
  return (i.length > 0 && r.push(i[i.length - 1]), r);
}
function oTe(e, t, n, i, r) {
  let o = 1;
  for (
    ;
    e.seq1Range.start - o >= i.start &&
    e.seq2Range.start - o >= r.start &&
    n.isStronglyEqual(e.seq2Range.start - o, e.seq2Range.endExclusive - o) &&
    o < 100;
  )
    o++;
  o--;
  let s = 0;
  for (
    ;
    e.seq1Range.start + s < i.endExclusive &&
    e.seq2Range.endExclusive + s < r.endExclusive &&
    n.isStronglyEqual(e.seq2Range.start + s, e.seq2Range.endExclusive + s) &&
    s < 100;
  )
    s++;
  if (0 === o && 0 === s) return e;
  let a = 0,
    l = -1;
  for (let c = -o; c <= s; c++) {
    const i = e.seq2Range.start + c,
      r = e.seq2Range.endExclusive + c,
      o = e.seq1Range.start + c,
      s = t.getBoundaryScore(o) + n.getBoundaryScore(i) + n.getBoundaryScore(r);
    s > l && ((l = s), (a = c));
  }
  return e.delta(a);
}
function sTe(e, t, n, i, r = !1) {
  const o = jce.invert(n, e.length),
    s = [];
  let a = new Fce(0, 0);
  function l(n, l) {
    if (n.offset1 < a.offset1 || n.offset2 < a.offset2) return;
    const c = i(e, n.offset1),
      d = i(t, n.offset2);
    if (!c || !d) return;
    let u = new jce(c, d);
    const h = u.intersect(l);
    let g = h.seq1Range.length,
      p = h.seq2Range.length;
    for (; o.length > 0; ) {
      const n = o[0];
      if (!(n.seq1Range.intersects(u.seq1Range) || n.seq2Range.intersects(u.seq2Range))) break;
      const r = i(e, n.seq1Range.start),
        s = i(t, n.seq2Range.start),
        a = new jce(r, s),
        l = a.intersect(n);
      if (
        ((g += l.seq1Range.length),
        (p += l.seq2Range.length),
        (u = u.join(a)),
        !(u.seq1Range.endExclusive >= n.seq1Range.endExclusive))
      )
        break;
      o.shift();
    }
    (((r && g + p < u.seq1Range.length + u.seq2Range.length) ||
      g + p < (2 * (u.seq1Range.length + u.seq2Range.length)) / 3) &&
      s.push(u),
      (a = u.getEndExclusives()));
  }
  for (; o.length > 0; ) {
    const e = o.shift();
    e.seq1Range.isEmpty || (l(e.getStarts(), e), l(e.getEndExclusives().delta(-1), e));
  }
  return (function (e, t) {
    const n = [];
    for (; e.length > 0 || t.length > 0; ) {
      const i = e[0],
        r = t[0];
      let o;
      ((o = i && (!r || i.seq1Range.start < r.seq1Range.start) ? e.shift() : t.shift()),
        n.length > 0 && n[n.length - 1].seq1Range.endExclusive >= o.seq1Range.start
          ? (n[n.length - 1] = n[n.length - 1].join(o))
          : n.push(o));
    }
    return n;
  })(n, s);
}
class aTe {
  constructor(e, t) {
    ((this.trimmedHash = e), (this.lines = t));
  }
  getElement(e) {
    return this.trimmedHash[e];
  }
  get length() {
    return this.trimmedHash.length;
  }
  getBoundaryScore(e) {
    return (
      1e3 -
      ((0 === e ? 0 : lTe(this.lines[e - 1])) + (e === this.lines.length ? 0 : lTe(this.lines[e])))
    );
  }
  getText(e) {
    return this.lines.slice(e.start, e.endExclusive).join("\n");
  }
  isStronglyEqual(e, t) {
    return this.lines[e] === this.lines[t];
  }
}
function lTe(e) {
  let t = 0;
  for (; t < e.length && (32 === e.charCodeAt(t) || 9 === e.charCodeAt(t)); ) t++;
  return t;
}
class cTe {
  constructor() {
    ((this.dynamicProgrammingDiffing = new UDe()), (this.myersDiffingAlgorithm = new $De()));
  }
  computeDiff(e, t, n) {
    if (e.length <= 1 && XP(e, t, (e, t) => e === t)) return new RDe([], [], !1);
    if ((1 === e.length && 0 === e[0].length) || (1 === t.length && 0 === t[0].length))
      return new RDe(
        [
          new Wle(new Q5(1, e.length + 1), new Q5(1, t.length + 1), [
            new Hle(
              new YH(1, 1, e.length, e[e.length - 1].length + 1),
              new YH(1, 1, t.length, t[t.length - 1].length + 1),
            ),
          ]),
        ],
        [],
        !1,
      );
    const i = 0 === n.maxComputationTimeMs ? Bce.instance : new Vce(n.maxComputationTimeMs),
      r = !n.ignoreTrimWhitespace,
      o = new Map();
    function s(e) {
      let t = o.get(e);
      return (void 0 === t && ((t = o.size), o.set(e, t)), t);
    }
    const a = e.map((e) => s(e.trim())),
      l = t.map((e) => s(e.trim())),
      c = new aTe(a, e),
      d = new aTe(l, t),
      u = (() =>
        c.length + d.length < 1700
          ? this.dynamicProgrammingDiffing.compute(c, d, i, (n, i) =>
              e[n] === t[i] ? (0 === t[i].length ? 0.1 : 1 + Math.log(1 + t[i].length)) : 0.99,
            )
          : this.myersDiffingAlgorithm.compute(c, d, i))();
    let h = u.diffs,
      g = u.hitTimeout;
    ((h = iTe(c, d, h)),
      (h = (function (e, t, n) {
        let i = n;
        if (0 === i.length) return i;
        let r,
          o = 0;
        do {
          r = !1;
          const s = [i[0]];
          for (let a = 1; a < i.length; a++) {
            const l = i[a],
              c = s[s.length - 1];
            function d(t, n) {
              const i = new N$(c.seq1Range.endExclusive, l.seq1Range.start);
              return (
                e.getText(i).replace(/\s/g, "").length <= 4 &&
                (t.seq1Range.length + t.seq2Range.length > 5 ||
                  n.seq1Range.length + n.seq2Range.length > 5)
              );
            }
            d(c, l) ? ((r = !0), (s[s.length - 1] = s[s.length - 1].join(l))) : s.push(l);
          }
          i = s;
        } while (o++ < 10 && r);
        return i;
      })(c, 0, h)));
    const p = [],
      f = (o) => {
        if (r)
          for (let s = 0; s < o; s++) {
            const o = m + s,
              a = _ + s;
            if (e[o] !== t[a]) {
              const s = this.refineDiff(e, t, new jce(new N$(o, o + 1), new N$(a, a + 1)), i, r, n);
              for (const e of s.mappings) p.push(e);
              s.hitTimeout && (g = !0);
            }
          }
      };
    let m = 0,
      _ = 0;
    for (const w of h) {
      iR(() => w.seq1Range.start - m === w.seq2Range.start - _);
      (f(w.seq1Range.start - m), (m = w.seq1Range.endExclusive), (_ = w.seq2Range.endExclusive));
      const o = this.refineDiff(e, t, w, i, r, n);
      o.hitTimeout && (g = !0);
      for (const e of o.mappings) p.push(e);
    }
    f(e.length - m);
    const v = new s3(e),
      b = new s3(t),
      y = zle(p, v, b);
    let x = [];
    return (
      n.computeMoves && (x = this.computeMoves(y, e, t, a, l, i, r, n)),
      iR(() => {
        function n(e, t) {
          if (e.lineNumber < 1 || e.lineNumber > t.length) return !1;
          const n = t[e.lineNumber - 1];
          return !(e.column < 1 || e.column > n.length + 1);
        }
        function i(e, t) {
          return (
            !(e.startLineNumber < 1 || e.startLineNumber > t.length + 1) &&
            !(e.endLineNumberExclusive < 1 || e.endLineNumberExclusive > t.length + 1)
          );
        }
        for (const r of y) {
          if (!r.innerChanges) return !1;
          for (const i of r.innerChanges) {
            if (
              !(
                n(i.modifiedRange.getStartPosition(), t) &&
                n(i.modifiedRange.getEndPosition(), t) &&
                n(i.originalRange.getStartPosition(), e) &&
                n(i.originalRange.getEndPosition(), e)
              )
            )
              return !1;
          }
          if (!i(r.modified, t) || !i(r.original, e)) return !1;
        }
        return !0;
      }),
      new RDe(y, x, g)
    );
  }
  computeMoves(e, t, n, i, r, o, s, a) {
    const l = tTe(e, t, n, i, r, o).map((e) => {
      const i = zle(
        this.refineDiff(
          t,
          n,
          new jce(e.original.toOffsetRange(), e.modified.toOffsetRange()),
          o,
          s,
          a,
        ).mappings,
        new s3(t),
        new s3(n),
        !0,
      );
      return new ODe(e, i);
    });
    return l;
  }
  refineDiff(e, t, n, i, r, o) {
    var s;
    const a = new Fle(
        new Q5((s = n).seq1Range.start + 1, s.seq1Range.endExclusive + 1),
        new Q5(s.seq2Range.start + 1, s.seq2Range.endExclusive + 1),
      ).toRangeMapping2(e, t),
      l = new ZDe(e, a.originalRange, r),
      c = new ZDe(t, a.modifiedRange, r),
      d =
        l.length + c.length < 500
          ? this.dynamicProgrammingDiffing.compute(l, c, i)
          : this.myersDiffingAlgorithm.compute(l, c, i);
    let u = d.diffs;
    ((u = iTe(l, c, u)),
      (u = sTe(l, c, u, (e, t) => e.findWordContaining(t))),
      o.extendToSubwords && (u = sTe(l, c, u, (e, t) => e.findSubWordContaining(t), !0)),
      (u = (function (e, t, n) {
        const i = [];
        for (const r of n) {
          const e = i[i.length - 1];
          e &&
          (r.seq1Range.start - e.seq1Range.endExclusive <= 2 ||
            r.seq2Range.start - e.seq2Range.endExclusive <= 2)
            ? (i[i.length - 1] = new jce(
                e.seq1Range.join(r.seq1Range),
                e.seq2Range.join(r.seq2Range),
              ))
            : i.push(r);
        }
        return i;
      })(0, 0, u)),
      (u = (function (e, t, n) {
        let i = n;
        if (0 === i.length) return i;
        let r,
          o = 0;
        do {
          r = !1;
          const a = [i[0]];
          for (let l = 1; l < i.length; l++) {
            const c = i[l],
              d = a[a.length - 1];
            function u(n, i) {
              const r = new N$(d.seq1Range.endExclusive, c.seq1Range.start);
              if (e.countLinesIn(r) > 5 || r.length > 500) return !1;
              const o = e.getText(r).trim();
              if (o.length > 20 || o.split(/\r\n|\r|\n/).length > 1) return !1;
              const s = e.countLinesIn(n.seq1Range),
                a = n.seq1Range.length,
                l = t.countLinesIn(n.seq2Range),
                u = n.seq2Range.length,
                h = e.countLinesIn(i.seq1Range),
                g = i.seq1Range.length,
                p = t.countLinesIn(i.seq2Range),
                f = i.seq2Range.length;
              function m(e) {
                return Math.min(e, 130);
              }
              return (
                Math.pow(Math.pow(m(40 * s + a), 1.5) + Math.pow(m(40 * l + u), 1.5), 1.5) +
                  Math.pow(Math.pow(m(40 * h + g), 1.5) + Math.pow(m(40 * p + f), 1.5), 1.5) >
                74184.96480721243
              );
            }
            u(d, c) ? ((r = !0), (a[a.length - 1] = a[a.length - 1].join(c))) : a.push(c);
          }
          i = a;
        } while (o++ < 10 && r);
        const s = [];
        return (
          (function (e, t) {
            for (let n = 0; n < e.length; n++)
              t(0 === n ? void 0 : e[n - 1], e[n], n + 1 === e.length ? void 0 : e[n + 1]);
          })(i, (t, n, i) => {
            let r = n;
            function o(e) {
              return (
                e.length > 0 &&
                e.trim().length <= 3 &&
                n.seq1Range.length + n.seq2Range.length > 100
              );
            }
            const a = e.extendToFullLines(n.seq1Range),
              l = e.getText(new N$(a.start, n.seq1Range.start));
            o(l) && (r = r.deltaStart(-l.length));
            const c = e.getText(new N$(n.seq1Range.endExclusive, a.endExclusive));
            o(c) && (r = r.deltaEnd(c.length));
            const d = jce.fromOffsetPairs(
                t ? t.getEndExclusives() : Fce.zero,
                i ? i.getStarts() : Fce.max,
              ),
              u = r.intersect(d);
            s.length > 0 && u.getStarts().equals(s[s.length - 1].getEndExclusives())
              ? (s[s.length - 1] = s[s.length - 1].join(u))
              : s.push(u);
          }),
          s
        );
      })(l, c, u)));
    const h = u.map((e) => new Hle(l.translateRange(e.seq1Range), c.translateRange(e.seq2Range)));
    return { mappings: h, hitTimeout: d.hitTimeout };
  }
}
const dTe = () => new MDe(),
  uTe = () => new cTe();
var hTe;
!(function (e) {
  e.create = function (e, t) {
    return e.isInlineEdit || e.uri ? vTe.create(e, t) : mTe.create(e, t);
  };
})(hTe || (hTe = {}));
class gTe {
  constructor(e, t, n) {
    ((this._data = e), (this.identity = t), (this.hint = n));
  }
  get source() {
    return this._data.source;
  }
  get isFromExplicitRequest() {
    return this._data.context.triggerKind === p2.Explicit;
  }
  get forwardStable() {
    return this.source.inlineSuggestions.enableForwardStability ?? !1;
  }
  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(e, t, n) {
    this._data.reportInlineEditShown(e, this.insertText, t, n);
  }
  reportPartialAccept(e, t, n) {
    this._data.reportPartialAccept(e, t, n);
  }
  reportEndOfLife(e) {
    this._data.reportEndOfLife(e);
  }
  setEndOfLifeReason(e) {
    this._data.setEndOfLifeReason(e);
  }
  setIsPreceeded(e) {
    this._data.setIsPreceeded(e.partialAccepts);
  }
  setNotShownReasonIfNotSet(e) {
    this._data.setNotShownReason(e);
  }
  getSourceCompletion() {
    return this._sourceInlineCompletion;
  }
}
class pTe {
  constructor() {
    ((this._onDispose = A9(this)),
      (this._jumpedTo = LF(this, !1)),
      (this._refCount = 1),
      (this.id = "InlineCompletionIdentity" + pTe.idCounter++));
  }
  static {
    this.idCounter = 0;
  }
  get jumpedTo() {
    return this._jumpedTo;
  }
  addRef() {
    this._refCount++;
  }
  removeRef() {
    (this._refCount--, 0 === this._refCount && this._onDispose.trigger(void 0));
  }
  setJumpTo(e) {
    this._jumpedTo.set(!0, e);
  }
}
class fTe {
  static create(e) {
    return new fTe(YH.lift(e.range), e.content, e.style, e.jumpToEdit);
  }
  constructor(e, t, n, i) {
    ((this.range = e), (this.content = t), (this.style = n), (this.jumpToEdit = i));
  }
  withEdit(e, t) {
    const n = X5(
      [
        new N$(
          t.getOffset(this.range.getStartPosition()),
          t.getOffset(this.range.getEndPosition()),
        ),
      ],
      e,
    )[0];
    if (!n) return;
    const i = t.getRange(n);
    return new fTe(i, this.content, this.style, this.jumpToEdit);
  }
}
let mTe = class e extends gTe {
  static create(t, n) {
    const i = new pTe(),
      r = oDe(n),
      o = t.insertText.replace(/\r\n|\r|\n/g, n.getEOL()),
      s = (function (e, t) {
        const n = t.getEOL();
        e.replaceRange.isEmpty && e.newText.includes(n) && (e = yTe(e, t));
        return e;
      })(new Y5(r.getOffsetRange(t.range), o), n),
      a = s.removeCommonSuffixAndPrefix(n.getValue()),
      l = r.getTextReplacement(s),
      c = t.hint ? fTe.create(t.hint) : void 0;
    return new e(s, a, l, l.range, t.snippetInfo, t.additionalTextEdits, t, i, c);
  }
  constructor(e, t, n, i, r, o, s, a, l) {
    (super(s, a, l),
      (this._edit = e),
      (this._trimmedEdit = t),
      (this._textEdit = n),
      (this._originalRange = i),
      (this.snippetInfo = r),
      (this.additionalTextEdits = o),
      (this.isInlineEdit = !1));
  }
  get hash() {
    return JSON.stringify(this._trimmedEdit.toJson());
  }
  getSingleTextEdit() {
    return this._textEdit;
  }
  withIdentity(t) {
    return new e(
      this._edit,
      this._trimmedEdit,
      this._textEdit,
      this._originalRange,
      this.snippetInfo,
      this.additionalTextEdits,
      this._data,
      t,
      this.hint,
    );
  }
  withEdit(t, n) {
    const i = X5([this._edit.replaceRange], t);
    if (0 === i.length) return;
    const r = new Y5(i[0], this._textEdit.text),
      o = oDe(n),
      s = o.getTextReplacement(r);
    let a = this.hint;
    if (a && ((a = a.withEdit(t, o)), !a)) return;
    const l = r.removeCommonSuffixAndPrefix(n.getValue());
    return new e(
      r,
      l,
      s,
      this._originalRange,
      this.snippetInfo,
      this.additionalTextEdits,
      this._data,
      this.identity,
      a,
    );
  }
  canBeReused(e, t) {
    const n = this._textEdit.range;
    return (
      !!n &&
      n.containsPosition(t) &&
      this.isVisible(e, t) &&
      e3.ofRange(n).isGreaterThanOrEqualTo(e3.ofRange(this._originalRange))
    );
  }
  isVisible(e, t) {
    return _Te(this.getSingleTextEdit(), this._originalRange, e, t);
  }
};
function _Te(e, t, n, i) {
  const r = xDe(e, n),
    o = e.range;
  if (
    !o ||
    (t && !t.getStartPosition().equals(o.getStartPosition())) ||
    i.lineNumber !== r.range.startLineNumber ||
    r.isEmpty
  )
    return !1;
  const s = n.getValueInRange(r.range, 1),
    a = r.text,
    l = Math.max(0, i.column - r.range.startColumn);
  let c = a.substring(0, l),
    d = a.substring(l),
    u = s.substring(0, l),
    h = s.substring(l);
  const g = n.getLineIndentColumn(r.range.startLineNumber);
  return (
    r.range.startColumn <= g &&
      ((u = u.trimStart()),
      0 === u.length && (h = h.trimStart()),
      (c = c.trimStart()),
      0 === c.length && (d = d.trimStart())),
    c.startsWith(u) && !!sie(h, d)
  );
}
class vTe extends gTe {
  static create(e, t) {
    const n = (function (e, t, n) {
        const i = e.getEOL(),
          r = e.getValueInRange(t),
          o = n.replace(/\r\n|\r|\n/g, i),
          s = uTe(),
          a = s
            .computeDiff(ZM(r), ZM(o), {
              ignoreTrimWhitespace: !1,
              computeMoves: !1,
              extendToSubwords: !0,
              maxComputationTimeMs: 500,
            })
            .changes.flatMap((e) => e.innerChanges ?? []);
        function l(e, t) {
          const n = e3.fromPosition(t.getStartPosition());
          return e3.ofRange(t).createRange(n.addToPosition(e));
        }
        const c = new a3(o),
          d = new Z5(
            a.map((n) => {
              const i = l(t.getStartPosition(), n.originalRange),
                r = oDe(e).getOffsetRange(i),
                o = c.getValueOfRange(n.modifiedRange);
              return (function (e, t, n, i) {
                const r = i.getEOL();
                e.newText.endsWith(r) &&
                  t.endsWith(r) &&
                  (e = new Y5(e.replaceRange.deltaEnd(-r.length), e.newText.slice(0, -r.length)));
                if (1 === n && e.replaceRange.isEmpty && e.newText.includes(r)) {
                  const t = i.getPositionAt(e.replaceRange.start);
                  0 !== i.getLineLength(t.lineNumber) && (e = yTe(e, i));
                }
                if (1 === n) {
                  const n = cA(t, e.newText),
                    i = dA(t.slice(n), e.newText.slice(n));
                  if (n + i === t.length)
                    return new Y5(
                      e.replaceRange.deltaStart(n).deltaEnd(-i),
                      e.newText.substring(n, e.newText.length - i),
                    );
                  if (n + i === e.newText.length)
                    return new Y5(e.replaceRange.deltaStart(n).deltaEnd(-i), "");
                }
                return e;
              })(new Y5(r, o), e.getValueInRange(i), a.length, e);
            }),
          );
        return d;
      })(t, e.range, e.insertText),
      i = new ehe(t),
      r = l3.fromStringEdit(n, i),
      o = n.isEmpty() ? new c3(new YH(1, 1, 1, 1), "") : r.toReplacement(i),
      s = new pTe(),
      a = n.replacements.map((e) => {
        const n = YH.fromPositions(
            t.getPositionAt(e.replaceRange.start),
            t.getPositionAt(e.replaceRange.endExclusive),
          ),
          i = t.getValueInRange(n);
        return bTe.create(e, i);
      }),
      l = e.hint ? fTe.create(e.hint) : void 0;
    return new vTe(n, o, e.uri, e, s, a, l, !1, t.getVersionId());
  }
  constructor(e, t, n, i, r, o, s, a = !1, l) {
    (super(i, r, s),
      (this._edit = e),
      (this._textEdit = t),
      (this.uri = n),
      (this._edits = o),
      (this._lastChangePartOfInlineEdit = a),
      (this._inlineEditModelVersion = l),
      (this.snippetInfo = void 0),
      (this.additionalTextEdits = []),
      (this.isInlineEdit = !0));
  }
  get updatedEditModelVersion() {
    return this._inlineEditModelVersion;
  }
  get updatedEdit() {
    return this._edit;
  }
  getSingleTextEdit() {
    return this._textEdit;
  }
  withIdentity(e) {
    return new vTe(
      this._edit,
      this._textEdit,
      this.uri,
      this._data,
      e,
      this._edits,
      this.hint,
      this._lastChangePartOfInlineEdit,
      this._inlineEditModelVersion,
    );
  }
  canBeReused(e, t) {
    return this._lastChangePartOfInlineEdit && this.updatedEditModelVersion === e.getVersionId();
  }
  withEdit(e, t) {
    return this._applyTextModelChanges(e, this._edits, t);
  }
  _applyTextModelChanges(e, t, n) {
    if ((t = t.map((t) => t.applyTextModelChanges(e))).some((e) => void 0 === e.edit)) return;
    const i = n.getVersionId();
    let r = this._inlineEditModelVersion;
    const o = t.some((e) => e.lastChangeUpdatedEdit);
    if ((o && (r = i ?? -1), null === i || r + 20 < i)) return;
    if (0 === (t = t.filter((e) => !e.edit.isEmpty)).length) return;
    const s = new Z5(t.map((e) => e.edit)),
      a = oDe(n),
      l = a.getTextEdit(s).toReplacement(new ehe(n));
    let c = this.hint;
    return !c || ((c = c.withEdit(e, a)), c)
      ? new vTe(s, l, this.uri, this._data, this.identity, t, c, o, r)
      : void 0;
  }
}
class bTe {
  static create(e, t) {
    const n = cA(e.newText, t),
      i = dA(e.newText, t),
      r = e.newText.substring(n, e.newText.length - i);
    return new bTe(e, r, n, i);
  }
  get edit() {
    return this._edit;
  }
  get lastChangeUpdatedEdit() {
    return this._lastChangeUpdatedEdit;
  }
  constructor(e, t, n, i, r = !1) {
    ((this._edit = e),
      (this._trimmedNewText = t),
      (this._prefixLength = n),
      (this._suffixLength = i),
      (this._lastChangeUpdatedEdit = r));
  }
  applyTextModelChanges(e) {
    const t = this._clone();
    return (t._applyTextModelChanges(e), t);
  }
  _clone() {
    return new bTe(
      this._edit,
      this._trimmedNewText,
      this._prefixLength,
      this._suffixLength,
      this._lastChangeUpdatedEdit,
    );
  }
  _applyTextModelChanges(e) {
    if (((this._lastChangeUpdatedEdit = !1), !this._edit))
      throw new QI("UpdatedInnerEdits: No edit to apply changes to");
    const t = this._applyChanges(this._edit, e);
    t
      ? ((this._edit = t.edit), (this._lastChangeUpdatedEdit = t.editHasChanged))
      : (this._edit = void 0);
  }
  _applyChanges(e, t) {
    let n = e.replaceRange.start,
      i = e.replaceRange.endExclusive,
      r = e.newText,
      o = !1;
    const s = this._prefixLength > 0 || this._suffixLength > 0;
    for (let a = t.replacements.length - 1; a >= 0; a--) {
      const l = t.replacements[a],
        c = l.newText.length > 0 && l.replaceRange.isEmpty;
      if (c && !s && l.replaceRange.start === n && r.startsWith(l.newText)) {
        ((n += l.newText.length),
          (r = r.substring(l.newText.length)),
          (i = Math.max(n, i)),
          (o = !0));
        continue;
      }
      if (
        c &&
        s &&
        l.replaceRange.start === n + this._prefixLength &&
        this._trimmedNewText.startsWith(l.newText)
      ) {
        ((i += l.newText.length),
          (o = !0),
          (this._prefixLength += l.newText.length),
          (this._trimmedNewText = this._trimmedNewText.substring(l.newText.length)));
        continue;
      }
      if (
        0 === l.newText.length &&
        l.replaceRange.length > 0 &&
        l.replaceRange.start >= n + this._prefixLength &&
        l.replaceRange.endExclusive <= i - this._suffixLength
      )
        ((i -= l.replaceRange.length), (o = !0));
      else if (l.equals(e)) ((o = !0), (n = l.replaceRange.endExclusive), (r = ""));
      else if (!(l.replaceRange.start > i)) {
        if (!(l.replaceRange.endExclusive < n)) return;
        ((n += l.newText.length - l.replaceRange.length),
          (i += l.newText.length - l.replaceRange.length));
      }
    }
    return 0 === this._trimmedNewText.length && n + this._prefixLength === i - this._suffixLength
      ? {
          edit: new Y5(new N$(n + this._prefixLength, n + this._prefixLength), ""),
          editHasChanged: !0,
        }
      : { edit: new Y5(new N$(n, i), r), editHasChanged: o };
  }
}
function yTe(e, t) {
  if (!e.replaceRange.isEmpty) throw new QI("Unexpected original range");
  if (0 === e.replaceRange.start) return e;
  const n = t.getEOL(),
    i = t.getPositionAt(e.replaceRange.start),
    r = i.column,
    o = i.lineNumber;
  return 1 === r && o > 1 && e.newText.endsWith(n) && !e.newText.startsWith(n)
    ? new Y5(e.replaceRange.delta(-1), n + e.newText.slice(0, -n.length))
    : e;
}
class xTe {
  constructor(e) {
    ((this.lines = e), (this.tokenization = { getLineTokens: (e) => this.lines[e - 1] }));
  }
  getLineCount() {
    return this.lines.length;
  }
  getLineLength(e) {
    return this.lines[e - 1].getLineContent().length;
  }
}
class wTe {
  constructor() {
    ((this._nodes = new Set()), (this._outgoingEdges = new Map()));
  }
  static from(e, t) {
    const n = new wTe();
    for (const i of e) n._nodes.add(i);
    for (const i of e) {
      const e = t(i);
      if (e.length > 0) {
        const t = new Set();
        for (const n of e) t.add(n);
        n._outgoingEdges.set(i, t);
      }
    }
    return n;
  }
  removeCycles() {
    const e = [],
      t = new Set(),
      n = new Set(),
      i = [],
      r = (o) => {
        (t.add(o), n.add(o));
        const s = this._outgoingEdges.get(o);
        if (s)
          for (const a of s) t.has(a) ? n.has(a) && (e.push(a), i.push({ from: o, to: a })) : r(a);
        n.delete(o);
      };
    for (const o of this._nodes) t.has(o) || r(o);
    for (const { from: o, to: s } of i) {
      const e = this._outgoingEdges.get(o);
      e && e.delete(s);
    }
    return { foundCycles: e };
  }
  getOutgoing(e) {
    const t = this._outgoingEdges.get(e);
    return t ? Array.from(t) : [];
  }
}
var CTe, STe, kTe;
function ETe(e, t, n, i, r, o) {
  const s = BJ("icr"),
    a = new cM();
  let l;
  const c = { ...i, requestUuid: s },
    d = (function (e, t) {
      const n = t.getWordAtPosition(e),
        i = t.getLineMaxColumn(e.lineNumber);
      return n
        ? new YH(e.lineNumber, n.startColumn, e.lineNumber, i)
        : YH.fromPositions(e, e.with(void 0, i));
    })(t, n),
    u = (function (e, t) {
      const n = new Map();
      for (const i of e) {
        const e = t(i);
        let r = n.get(e);
        (r || ((r = []), n.set(e, r)), r.push(i));
      }
      return n;
    })(e, (e) => e.groupId),
    h = wTe.from(e, (e) => e.yieldsToGroupIds?.flatMap((e) => u.get(e) ?? []) ?? []),
    { foundCycles: g } = h.removeCycles();
  g.length > 0 &&
    zI(
      new Error(
        `Inline completions: cyclic yield-to dependency detected. Path: ${g.map((e) => (e.toString ? e.toString() : "" + e)).join(" -> ")}`,
      ),
    );
  let p = 0;
  const f = new jM(async (e) => {
      try {
        if ((p++, a.token.isCancellationRequested)) return;
        const i = h.getOutgoing(e);
        for (const e of i) {
          const i = await f.get(e);
          if (i)
            for (const e of i.inlineSuggestions.items) {
              if (e.isInlineEdit || ("string" != typeof e.insertText && void 0 !== e.insertText))
                return;
              if (void 0 !== e.insertText) {
                if (_Te(new c3(YH.lift(e.range) ?? d, e.insertText), void 0, n, t)) return;
              }
            }
        }
        let s;
        const u = Date.now();
        try {
          s = await e.provideInlineCompletions(n, t, c, a.token);
        } catch (spt) {
          return void zI(spt);
        }
        const g = Date.now();
        if (!s) return;
        const m = [],
          _ = new TTe(s, m, e);
        if ((_.addRef(), NTe(a.token, () => _.removeRef(l)), a.token.isCancellationRequested))
          return;
        for (const e of s.items) m.push(LTe(e, _, d, n, o, c, r, { startTime: u, endTime: g }));
        return _;
      } finally {
        p--;
      }
    }),
    m = OM.fromPromisesResolveOrder(e.map((e) => f.get(e))).filter(hR);
  return {
    contextWithUuid: c,
    get didAllProvidersReturn() {
      return 0 === p;
    },
    lists: m,
    cancelAndDispose: (e) => {
      void 0 === l && ((l = e), a.dispose(!0));
    },
  };
}
function NTe(e, t) {
  if (e.isCancellationRequested) return (t(), PO.None);
  {
    const n = e.onCancellationRequested(() => {
      (n.dispose(), t());
    });
    return { dispose: () => n.dispose() };
  }
}
function LTe(e, t, n, i, r, o, s, a) {
  let l,
    c,
    d = e.range ? YH.lift(e.range) : n;
  if ("string" == typeof e.insertText) {
    if (((l = e.insertText), r && e.completeBracketPairs)) {
      l = ITe(l, d.getStartPosition(), i, r);
      const t = l.length - e.insertText.length;
      0 !== t && (d = new YH(d.startLineNumber, d.startColumn, d.endLineNumber, d.endColumn + t));
    }
    c = void 0;
  } else if (void 0 === e.insertText) ((l = ""), (c = void 0), (d = new YH(1, 1, 1, 1)));
  else if ("snippet" in e.insertText) {
    const t = e.insertText.snippet.length;
    if (r && e.completeBracketPairs) {
      e.insertText.snippet = ITe(e.insertText.snippet, d.getStartPosition(), i, r);
      const n = e.insertText.snippet.length - t;
      0 !== n && (d = new YH(d.startLineNumber, d.startColumn, d.endLineNumber, d.endColumn + n));
    }
    const n = new ape().parse(e.insertText.snippet);
    1 === n.children.length && n.children[0] instanceof Qge
      ? ((l = n.children[0].value), (c = void 0))
      : ((l = n.toString()), (c = { snippet: e.insertText.snippet, range: d }));
  } else eR(e.insertText);
  return new DTe(
    d,
    l,
    c,
    mP.revive(e.uri),
    e.hint,
    e.additionalTextEdits || aDe,
    e,
    t,
    o,
    e.isInlineEdit ?? !1,
    s,
    a,
    e.correlationId,
  );
}
(!(function (e) {
  ((e.Jump = "jump"), (e.Accept = "accept"), (e.Inactive = "inactive"));
})(CTe || (CTe = {})),
  (function (e) {
    ((e.GhostText = "ghostText"),
      (e.Custom = "custom"),
      (e.SideBySide = "sideBySide"),
      (e.Deletion = "deletion"),
      (e.InsertionInline = "insertionInline"),
      (e.InsertionMultiLine = "insertionMultiLine"),
      (e.WordReplacements = "wordReplacements"),
      (e.LineReplacement = "lineReplacement"),
      (e.Collapsed = "collapsed"));
  })(STe || (STe = {})));
class DTe {
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h) {
    ((this.range = e),
      (this.insertText = t),
      (this.snippetInfo = n),
      (this.uri = i),
      (this.hint = r),
      (this.additionalTextEdits = o),
      (this.sourceInlineCompletion = s),
      (this.source = a),
      (this.context = l),
      (this.isInlineEdit = c),
      (this._requestInfo = d),
      (this._providerRequestInfo = u),
      (this._correlationId = h),
      (this._didShow = !1),
      (this._timeUntilShown = void 0),
      (this._showStartTime = void 0),
      (this._shownDuration = 0),
      (this._showUncollapsedStartTime = void 0),
      (this._showUncollapsedDuration = 0),
      (this._notShownReason = void 0),
      (this._didReportEndOfLife = !1),
      (this._lastSetEndOfLifeReason = void 0),
      (this._isPreceeded = !1),
      (this._partiallyAcceptedCount = 0),
      (this._partiallyAcceptedSinceOriginal = { characters: 0, ratio: 0, count: 0 }),
      (this._viewData = { editorType: d.editorType }));
  }
  get showInlineEditMenu() {
    return this.sourceInlineCompletion.showInlineEditMenu ?? !1;
  }
  get partialAccepts() {
    return this._partiallyAcceptedSinceOriginal;
  }
  async reportInlineEditShown(e, t, n, i) {
    if ((this.updateShownDuration(n), this._didShow)) return;
    ((this._didShow = !0),
      (this._viewData.viewKind = n),
      (this._viewData.renderData = i),
      (this._timeUntilShown = Date.now() - this._requestInfo.startTime));
    const r = new b8(
      i.lineCountModified,
      i.lineCountOriginal,
      i.characterCountModified,
      i.characterCountOriginal,
    );
    (this.source.provider.handleItemDidShow?.(
      this.source.inlineSuggestions,
      this.sourceInlineCompletion,
      t,
      r,
    ),
      this.sourceInlineCompletion.shownCommand &&
        (await e.executeCommand(
          this.sourceInlineCompletion.shownCommand.id,
          ...(this.sourceInlineCompletion.shownCommand.arguments || []),
        )));
  }
  reportPartialAccept(e, t, n) {
    (this._partiallyAcceptedCount++,
      (this._partiallyAcceptedSinceOriginal.characters += n.characters),
      (this._partiallyAcceptedSinceOriginal.ratio = Math.min(
        this._partiallyAcceptedSinceOriginal.ratio +
          (1 - this._partiallyAcceptedSinceOriginal.ratio) * n.ratio,
        1,
      )),
      (this._partiallyAcceptedSinceOriginal.count += n.count),
      this.source.provider.handlePartialAccept?.(
        this.source.inlineSuggestions,
        this.sourceInlineCompletion,
        e,
        t,
      ));
  }
  reportEndOfLife(e) {
    if (
      !this._didReportEndOfLife &&
      ((this._didReportEndOfLife = !0),
      this.reportInlineEditHidden(),
      e ||
        (e = this._lastSetEndOfLifeReason ?? {
          kind: m2.Ignored,
          userTypingDisagreed: !1,
          supersededBy: void 0,
        }),
      e.kind === m2.Rejected &&
        this.source.provider.handleRejection &&
        this.source.provider.handleRejection(
          this.source.inlineSuggestions,
          this.sourceInlineCompletion,
        ),
      this.source.provider.handleEndOfLifetime)
    ) {
      const t = {
        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((e) => e.toString()).join(","),
        ...this._viewData.renderData,
      };
      this.source.provider.handleEndOfLifetime(
        this.source.inlineSuggestions,
        this.sourceInlineCompletion,
        e,
        t,
      );
    }
  }
  setIsPreceeded(e) {
    ((this._isPreceeded = !0),
      0 !== this._partiallyAcceptedSinceOriginal.characters ||
        0 !== this._partiallyAcceptedSinceOriginal.ratio ||
        this._partiallyAcceptedSinceOriginal.count,
      (this._partiallyAcceptedSinceOriginal = e));
  }
  setNotShownReason(e) {
    this._notShownReason ??= e;
  }
  setEndOfLifeReason(e) {
    (this.reportInlineEditHidden(), (this._lastSetEndOfLifeReason = e));
  }
  updateShownDuration(e) {
    const t = Date.now();
    this._showStartTime || (this._showStartTime = t);
    const n = e === STe.Collapsed;
    (n || void 0 !== this._showUncollapsedStartTime || (this._showUncollapsedStartTime = t),
      n &&
        void 0 !== this._showUncollapsedStartTime &&
        (this._showUncollapsedDuration += t - this._showUncollapsedStartTime));
  }
  reportInlineEditHidden() {
    if (void 0 === this._showStartTime) return;
    const e = Date.now();
    ((this._shownDuration += e - this._showStartTime),
      (this._showStartTime = void 0),
      void 0 !== this._showUncollapsedStartTime &&
        ((this._showUncollapsedDuration += e - this._showUncollapsedStartTime),
        (this._showUncollapsedStartTime = void 0)));
  }
}
!(function (e) {
  ((e.TextEditor = "textEditor"), (e.DiffEditor = "diffEditor"), (e.Notebook = "notebook"));
})(kTe || (kTe = {}));
class TTe {
  constructor(e, t, n) {
    ((this.inlineSuggestions = e),
      (this.inlineSuggestionsData = t),
      (this.provider = n),
      (this.refCount = 0));
  }
  addRef() {
    this.refCount++;
  }
  removeRef(e = { kind: "other" }) {
    if ((this.refCount--, 0 === this.refCount)) {
      for (const e of this.inlineSuggestionsData) e.reportEndOfLife();
      this.provider.disposeInlineCompletions(this.inlineSuggestions, e);
    }
  }
}
function ITe(e, t, n, i) {
  const r = n.getLineContent(t.lineNumber),
    o = Y5.replace(new N$(t.column - 1, r.length), e),
    s = n.tokenization.tokenizeLinesAt(t.lineNumber, [o.replace(r)]),
    a = s?.[0].sliceZeroCopy(o.getRangeAfterReplace());
  if (!a) return e;
  const l = (function (e, t) {
    const n = new w6(),
      i = new V6(n, (e) => t.getLanguageConfiguration(e)),
      r = K6(new P6(new xTe([e]), i), [], void 0, !0);
    let o = "";
    const s = e.getLineContent();
    return (
      (function e(t, n) {
        if (2 === t.kind)
          if (
            (e(t.openingBracket, n),
            (n = a6(n, t.openingBracket.length)),
            t.child && (e(t.child, n), (n = a6(n, t.child.length))),
            t.closingBracket)
          )
            (e(t.closingBracket, n), (n = a6(n, t.closingBracket.length)));
          else {
            const e = i
              .getSingleLanguageBracketTokens(t.openingBracket.languageId)
              .findClosingTokenText(t.openingBracket.bracketIds);
            o += e;
          }
        else if (3 === t.kind);
        else if (0 === t.kind || 1 === t.kind) o += s.substring(n, a6(n, t.length));
        else if (4 === t.kind) for (const i of t.children) (e(i, n), (n = a6(n, i.length)));
      })(r, 0),
      o
    );
  })(a, i);
  return l;
}
var RTe,
  OTe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let MTe = class extends PO {
  static {
    RTe = this;
  }
  static {
    this._requestId = 0;
  }
  constructor(e, t, n, i, r, o, s, a, l) {
    (super(),
      (this._textModel = e),
      (this._versionId = t),
      (this._debounceValue = n),
      (this._cursorPosition = i),
      (this._languageConfigurationService = r),
      (this._logService = o),
      (this._configurationService = s),
      (this._instantiationService = a),
      (this._contextKeyService = l),
      (this._updateOperation = this._register(new jO())),
      (this._state = (function (e, t) {
        let n,
          i = !1;
        const r = new Yj(
          new Pj(e, void 0, t.update),
          (e, r) => {
            i || ((n = t.initial instanceof Function ? t.initial() : t.initial), (i = !0));
            const o = t.update(e, n, r);
            return ((n = o), o);
          },
          t.changeTracker,
          () => {
            i && (t.disposeFinal?.(n), (i = !1));
          },
          t.equalityComparer ?? Rj,
          (e, t, o) => {
            if (!i)
              throw new QI("Can only set when there is a listener! This is to prevent leaks.");
            uF(t, (t) => {
              ((n = e), r.setValue(e, t, o));
            });
          },
          Tj.ofCaller(),
        );
        return r;
      })(this, {
        initial: () => ({
          inlineCompletions: FTe.createEmpty(),
          suggestWidgetInlineCompletions: FTe.createEmpty(),
        }),
        disposeFinal: (e) => {
          (e.inlineCompletions.dispose(), e.suggestWidgetInlineCompletions.dispose());
        },
        changeTracker: y7(() => ({ versionId: this._versionId })),
        update: (e, t, n) => {
          const i = Z5.compose(
            n.changes
              .map((e) =>
                e.change
                  ? (function (e) {
                      const t = e.map(
                        (e) => new Y5(N$.ofStartAndLength(e.rangeOffset, e.rangeLength), e.text),
                      );
                      return (t.reverse(), new Z5(t));
                    })(e.change.changes)
                  : Z5.empty,
              )
              .filter(hR),
          );
          if (i.isEmpty()) return t;
          try {
            return {
              inlineCompletions: t.inlineCompletions.createStateWithAppliedEdit(i, this._textModel),
              suggestWidgetInlineCompletions:
                t.suggestWidgetInlineCompletions.createStateWithAppliedEdit(i, this._textModel),
            };
          } finally {
            (t.inlineCompletions.dispose(), t.suggestWidgetInlineCompletions.dispose());
          }
        },
      })),
      (this.inlineCompletions = this._state.map(this, (e) => e.inlineCompletions)),
      (this.suggestWidgetInlineCompletions = this._state.map(
        this,
        (e) => e.suggestWidgetInlineCompletions,
      )),
      (this._completionsEnabled = void 0),
      (this.clearOperationOnTextModelChange = Xj(this, (e) => {
        (this._versionId.read(e), this._updateOperation.clear());
      })),
      (this._loadingCount = LF(this, 0)),
      (this._loggingEnabled = Dne(
        "editor.inlineSuggest.logFetch",
        !1,
        this._configurationService,
      ).recomputeInitiallyAndOnChange(this._store)),
      (this._sendRequestData = Dne(
        "editor.inlineSuggest.emptyResponseInformation",
        !0,
        this._configurationService,
      ).recomputeInitiallyAndOnChange(this._store)),
      (this._structuredFetchLogger = this._register(
        this._instantiationService.createInstance(
          FLe.cast(),
          "editor.inlineSuggest.logFetch.commandId",
        ),
      )),
      this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store));
    const c = ZU.defaultChatAgent?.completionsEnablementSetting ?? void 0;
    (c &&
      (this._updateCompletionsEnablement(c),
      this._register(
        this._configurationService.onDidChangeConfiguration((e) => {
          e.affectsConfiguration(c) && this._updateCompletionsEnablement(c);
        }),
      )),
      this._state.recomputeInitiallyAndOnChange(this._store));
  }
  _updateCompletionsEnablement(e) {
    const t = this._configurationService.getValue(e);
    sR(t) ? (this._completionsEnabled = t) : (this._completionsEnabled = void 0);
  }
  _log(e) {
    (this._loggingEnabled.get() &&
      this._logService.info(
        (function (e) {
          return (
            e.sourceId +
            " @@ " +
            JSON.stringify({ ...e, modelUri: e.modelUri?.toString(), sourceId: void 0 })
          );
        })(e),
      ),
      this._structuredFetchLogger.log(e));
  }
  fetch(e, t, n, i, r, o, s) {
    const a = this._cursorPosition.get(),
      l = new ATe(a, n, this._textModel.getVersionId(), new Set(e)),
      c = n.selectedSuggestionInfo
        ? this.suggestWidgetInlineCompletions.get()
        : this.inlineCompletions.get();
    if (this._updateOperation.value?.request.satisfies(l))
      return this._updateOperation.value.promise;
    if (c?.request?.satisfies(l)) return Promise.resolve(!0);
    const d = !!this._updateOperation.value;
    this._updateOperation.clear();
    const u = new cM(),
      h = (async () => {
        const a = new AO();
        this._loadingCount.set(this._loadingCount.get() + 1, void 0);
        let c = !1;
        const h = () => {
          c || ((c = !0), this._loadingCount.set(this._loadingCount.get() - 1, void 0));
        };
        a.add(new EM(() => h(), 1e4)).schedule();
        const g = e.filter((e) => e.providerId),
          p = new PTe(n, s, g);
        try {
          const c = this._debounceValue.get(this._textModel),
            h =
              F1(
                e.map((e) => e.debounceDelayMs),
                ((f = yj),
                (e, t) =>
                  void 0 === e
                    ? void 0 === t
                      ? vj.neitherLessOrGreaterThan
                      : vj.lessThan
                    : void 0 === t
                      ? vj.greaterThan
                      : f(e, t)),
              ) ?? c;
          if (
            ((d || (r && n.triggerKind === p2.Automatic)) && (await dDe(h, u.token)),
            u.token.isCancellationRequested ||
              this._store.isDisposed ||
              this._textModel.getVersionId() !== l.versionId)
          )
            return (p.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"), !1);
          const g = RTe._requestId++;
          (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) &&
            this._log({
              sourceId: "InlineCompletions.fetch",
              kind: "start",
              requestId: g,
              modelUri: this._textModel.uri,
              modelVersion: this._textModel.getVersionId(),
              context: {
                triggerKind: n.triggerKind,
                suggestInfo: !!n.selectedSuggestionInfo || void 0,
              },
              time: Date.now(),
              provider: t,
            });
          const m = new Date(),
            _ = ETe(
              e,
              this._cursorPosition.get(),
              this._textModel,
              n,
              s,
              this._languageConfigurationService,
            );
          NTe(u.token, () => _.cancelAndDispose({ kind: "tokenCancellation" }));
          let v = !1,
            b = !1;
          const y = [];
          for await (const e of _.lists)
            if (e) {
              (e.addRef(),
                a.add(
                  MO(() =>
                    e.removeRef(
                      0 === e.inlineSuggestionsData.length
                        ? { kind: "empty" }
                        : { kind: "notTaken" },
                    ),
                  ),
                ));
              for (const t of e.inlineSuggestionsData) {
                if (((b = !0), !n.includeInlineEdits && (t.isInlineEdit || t.showInlineEditMenu))) {
                  t.setNotShownReason("notInlineEditRequested");
                  continue;
                }
                if (!n.includeInlineCompletions && !t.isInlineEdit && !t.showInlineEditMenu) {
                  t.setNotShownReason("notInlineCompletionRequested");
                  continue;
                }
                const e = hTe.create(t, this._textModel);
                (y.push(e),
                  e.isInlineEdit ||
                    e.showInlineEditMenu ||
                    n.triggerKind !== p2.Automatic ||
                    (e.isVisible(this._textModel, this._cursorPosition.get()) && (v = !0)));
              }
              if (v) break;
            }
          if (
            (_.cancelAndDispose({ kind: "lostRace" }),
            this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get())
          ) {
            const e = _.didAllProvidersReturn;
            let t;
            (u.token.isCancellationRequested ||
              this._store.isDisposed ||
              this._textModel.getVersionId() !== l.versionId) &&
              (t = "canceled");
            const n = y.map((e) => ({
              range: e.editRange.toString(),
              text: e.insertText,
              hint: e.hint,
              isInlineEdit: e.isInlineEdit,
              showInlineEditMenu: e.showInlineEditMenu,
              providerId: e.source.provider.providerId?.toString(),
            }));
            this._log({
              sourceId: "InlineCompletions.fetch",
              kind: "end",
              requestId: g,
              durationMs: Date.now() - m.getTime(),
              error: t,
              result: n,
              time: Date.now(),
              didAllProvidersReturn: e,
            });
          }
          if ((p.setRequestUuid(_.contextWithUuid.requestUuid), b))
            (p.setHasProducedSuggestion(),
              y.length > 0 &&
                u.token.isCancellationRequested &&
                y.forEach((e) =>
                  e.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders"),
                ));
          else if (u.token.isCancellationRequested)
            p.setNoSuggestionReasonIfNotSet("canceled:whileFetching");
          else {
            const e = this._contextKeyService.getContextKeyValue("completionsQuotaExceeded");
            p.setNoSuggestionReasonIfNotSet(e ? "completionsQuotaExceeded" : "noSuggestion");
          }
          const x = n.earliestShownDateTime - Date.now();
          if (
            (x > 0 && (await dDe(x, u.token)),
            u.token.isCancellationRequested ||
              this._store.isDisposed ||
              this._textModel.getVersionId() !== l.versionId ||
              o.get())
          ) {
            const e = u.token.isCancellationRequested
              ? "canceled:afterMinShowDelay"
              : this._store.isDisposed
                ? "canceled:disposed"
                : this._textModel.getVersionId() !== l.versionId
                  ? "canceled:documentChanged"
                  : o.get()
                    ? "canceled:userJumped"
                    : "unknown";
            return (y.forEach((t) => t.setNotShownReasonIfNotSet(e)), !1);
          }
          const w = new Date();
          this._debounceValue.update(this._textModel, w.getTime() - m.getTime());
          const C = this._cursorPosition.get();
          (this._updateOperation.clear(),
            cF((e) => {
              const t = this._state.get();
              (n.selectedSuggestionInfo
                ? this._state.set(
                    {
                      inlineCompletions: FTe.createEmpty(),
                      suggestWidgetInlineCompletions:
                        t.suggestWidgetInlineCompletions.createStateWithAppliedResults(
                          y,
                          l,
                          this._textModel,
                          C,
                          i,
                        ),
                    },
                    e,
                  )
                : this._state.set(
                    {
                      inlineCompletions: t.inlineCompletions.createStateWithAppliedResults(
                        y,
                        l,
                        this._textModel,
                        C,
                        i,
                      ),
                      suggestWidgetInlineCompletions: FTe.createEmpty(),
                    },
                    e,
                  ),
                t.inlineCompletions.dispose(),
                t.suggestWidgetInlineCompletions.dispose());
            }));
        } finally {
          (a.dispose(), h(), this.sendInlineCompletionsRequestTelemetry(p));
        }
        var f;
        return !0;
      })(),
      g = new jTe(l, u, h);
    return ((this._updateOperation.value = g), h);
  }
  clear(e) {
    this._updateOperation.clear();
    const t = this._state.get();
    (this._state.set(
      { inlineCompletions: FTe.createEmpty(), suggestWidgetInlineCompletions: FTe.createEmpty() },
      e,
    ),
      t.inlineCompletions.dispose(),
      t.suggestWidgetInlineCompletions.dispose());
  }
  seedInlineCompletionsWithSuggestWidget() {
    const e = this.inlineCompletions.get(),
      t = this.suggestWidgetInlineCompletions.get();
    t &&
      cF((n) => {
        if (!e || (t.request?.versionId ?? -1) > (e.request?.versionId ?? -1)) {
          e?.dispose();
          const i = this._state.get();
          (this._state.set(
            { inlineCompletions: t.clone(), suggestWidgetInlineCompletions: FTe.createEmpty() },
            n,
          ),
            i.inlineCompletions.dispose(),
            i.suggestWidgetInlineCompletions.dispose());
        }
        this.clearSuggestWidgetInlineCompletions(n);
      });
  }
  sendInlineCompletionsRequestTelemetry(e) {
    if (
      !this._sendRequestData.get() &&
      !this._contextKeyService.getContextKeyValue("isRunningUnificationExperiment")
    )
      return;
    if (void 0 === e.requestUuid || e.hasProducedSuggestion) return;
    if (
      !(function (e, t = "*") {
        if (void 0 === e) return !1;
        if (void 0 !== e[t]) return Boolean(e[t]);
        return Boolean(e["*"]);
      })(this._completionsEnabled, this._textModel.getLanguageId())
    )
      return;
    if (!e.providers.some((e) => IDe(e.providerId?.extensionId))) return;
    const t = {
      opportunityId: e.requestUuid,
      noSuggestionReason: e.noSuggestionReason ?? "unknown",
      extensionId: "vscode-core",
      extensionVersion: "0.0.0",
      groupId: "empty",
      shown: !1,
      editorType: e.requestInfo.editorType,
      requestReason: e.requestInfo.reason,
      typingInterval: e.requestInfo.typingInterval,
      typingIntervalCharacterCount: e.requestInfo.typingIntervalCharacterCount,
      languageId: e.requestInfo.languageId,
      selectedSuggestionInfo: !!e.context.selectedSuggestionInfo,
      availableProviders: e.providers
        .map((e) => e.providerId?.toString())
        .filter(hR)
        .join(","),
      ...((n = e.providers.some((e) => IDe(e.providerId?.extensionId))), { [TDe]: n }),
      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,
    };
    var n;
    !(function (e, t) {
      e.publicLog2("inlineCompletion.endOfLife", t);
    })(this._instantiationService.createInstance(DDe), t);
  }
  clearSuggestWidgetInlineCompletions(e) {
    this._updateOperation.value?.request.context.selectedSuggestionInfo &&
      this._updateOperation.clear();
  }
  cancelUpdate() {
    this._updateOperation.clear();
  }
};
MTe = RTe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([OTe(4, f$), OTe(5, yH), OTe(6, OU), OTe(7, vV), OTe(8, xW)], MTe);
class ATe {
  constructor(e, t, n, i) {
    ((this.position = e), (this.context = t), (this.versionId = n), (this.providers = i));
  }
  satisfies(e) {
    return (
      this.position.equals(e.position) &&
      Mj(this.context.selectedSuggestionInfo, e.context.selectedSuggestionInfo, (e, t) =>
        e.equals(t),
      ) &&
      (e.context.triggerKind === p2.Automatic || this.context.triggerKind === p2.Explicit) &&
      this.versionId === e.versionId &&
      ((t = e.providers), (n = this.providers), [...t].every((e) => n.has(e)))
    );
    var t, n;
  }
}
class PTe {
  constructor(e, t, n) {
    ((this.context = e),
      (this.requestInfo = t),
      (this.providers = n),
      (this.hasProducedSuggestion = !1));
  }
  setRequestUuid(e) {
    this.requestUuid = e;
  }
  setNoSuggestionReasonIfNotSet(e) {
    this.noSuggestionReason ??= e;
  }
  setHasProducedSuggestion() {
    this.hasProducedSuggestion = !0;
  }
}
class jTe {
  constructor(e, t, n) {
    ((this.request = e), (this.cancellationTokenSource = t), (this.promise = n));
  }
  dispose() {
    this.cancellationTokenSource.cancel();
  }
}
class FTe extends PO {
  static createEmpty() {
    return new FTe([], void 0);
  }
  constructor(e, t) {
    for (const n of e) n.addRef();
    (super(),
      (this.inlineCompletions = e),
      (this.request = t),
      this._register({
        dispose: () => {
          for (const e of this.inlineCompletions) e.removeRef();
        },
      }));
  }
  _findById(e) {
    return this.inlineCompletions.find((t) => t.identity === e);
  }
  _findByHash(e) {
    return this.inlineCompletions.find((t) => t.hash === e);
  }
  createStateWithAppliedEdit(e, t) {
    const n = this.inlineCompletions.map((n) => n.withEdit(e, t)).filter(hR);
    return new FTe(n, this.request);
  }
  createStateWithAppliedResults(e, t, n, i, r) {
    let o;
    if (r) {
      const i = this._findById(r);
      if (i && i.canBeReused(n, t.position)) {
        o = i;
        const t = e.find((e) => e.hash === i.hash);
        e = t
          ? (function (e, t) {
              const n = t.indexOf(e);
              if (n > -1) return [e, ...t.slice(0, n), ...t.slice(n + 1)];
              return t;
            })(t, e)
          : [i, ...e];
      }
    }
    const s = o ? !o.isInlineEdit : e.some((e) => !e.isInlineEdit && e.isVisible(n, i));
    let a = [];
    for (const l of e) {
      const e = this._findByHash(l.hash);
      let t;
      (e && e !== l
        ? ((t = l.withIdentity(e.identity)),
          l.setIsPreceeded(e),
          e.setEndOfLifeReason({
            kind: m2.Ignored,
            userTypingDisagreed: !1,
            supersededBy: l.getSourceCompletion(),
          }))
        : (t = l),
        s !== t.isInlineEdit && a.push(t));
    }
    return (
      a.sort(bj((e) => e.showInlineEditMenu, xj)),
      (a = (function (e, t) {
        const n = new Set();
        return e.filter((e) => {
          const i = t(e);
          return !n.has(i) && (n.add(i), !0);
        });
      })(a, (e) => e.semanticId)),
      new FTe(a, t)
    );
  }
  clone() {
    return new FTe(this.inlineCompletions, this.request);
  }
}
class BTe {
  constructor(e, t, n) {
    ((this.edit = e), (this.commands = t), (this.inlineCompletion = n));
  }
  equals(e) {
    return this.edit.equals(e.edit) && this.inlineCompletion === e.inlineCompletion;
  }
}
var VTe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const WTe = bV("IInlineCompletionsService"),
  HTe = new yW(
    "inlineCompletions.snoozed",
    !1,
    SI(79, "Whether inline completions are currently snoozed"),
  );
let zTe = class extends PO {
  get snoozeTimeLeft() {
    return void 0 === this._snoozeTimeEnd ? 0 : Math.max(0, this._snoozeTimeEnd - Date.now());
  }
  constructor(e, t) {
    (super(),
      (this._contextKeyService = e),
      (this._telemetryService = t),
      (this._onDidChangeIsSnoozing = this._register(new QO())),
      (this.onDidChangeIsSnoozing = this._onDidChangeIsSnoozing.event),
      (this._snoozeTimeEnd = void 0),
      (this._recentCompletionIds = []),
      (this._timer = this._register(new SM())));
    const n = HTe.bindTo(this._contextKeyService);
    this._register(this.onDidChangeIsSnoozing(() => n.set(this.isSnoozing())));
  }
  setSnoozeDuration(e) {
    if (e < 0) throw new QI(`Invalid snooze duration: ${e}. Duration must be non-negative.`);
    if (0 === e) return void this.cancelSnooze();
    const t = this.isSnoozing(),
      n = this.snoozeTimeLeft;
    ((this._snoozeTimeEnd = Date.now() + e),
      t || this._onDidChangeIsSnoozing.fire(!0),
      this._timer.cancelAndSet(() => {
        if (this.isSnoozing()) throw new QI("Snooze timer did not fire as expected");
        this._onDidChangeIsSnoozing.fire(!1);
      }, this.snoozeTimeLeft + 1),
      this._reportSnooze(e - n, e));
  }
  isSnoozing() {
    return this.snoozeTimeLeft > 0;
  }
  cancelSnooze() {
    this.isSnoozing() &&
      (this._reportSnooze(-this.snoozeTimeLeft, 0),
      (this._snoozeTimeEnd = void 0),
      this._timer.cancel(),
      this._onDidChangeIsSnoozing.fire(!1));
  }
  reportNewCompletion(e) {
    ((this._lastCompletionId = e),
      this._recentCompletionIds.unshift(e),
      this._recentCompletionIds.length > 5 && this._recentCompletionIds.pop());
  }
  _reportSnooze(e, t) {
    const n = Math.round(e / 1e3),
      i = Math.round(t / 1e3);
    this._telemetryService.publicLog2("inlineCompletions.snooze", {
      deltaSeconds: n,
      totalSeconds: i,
      lastCompletionId: this._lastCompletionId,
      recentCompletionIds: this._recentCompletionIds,
    });
  }
};
((zTe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([VTe(0, xW), VTe(1, HW)], zTe)),
  HU(WTe, zTe, 1));
const UTe = "inlineCompletions.lastSnoozeDuration";
class $Te extends VW {
  static {
    this.ID = "editor.action.inlineSuggest.snooze";
  }
  constructor() {
    super({
      id: $Te.ID,
      title: EI(81, "Snooze Inline Suggestions"),
      precondition: eW.true(),
      f1: !0,
    });
  }
  async run(e, ...t) {
    const n = e.get(Ghe),
      i = e.get(WTe),
      r = e.get(oue);
    let o;
    (t.length > 0 && "number" == typeof t[0] && (o = 6e4 * t[0]),
      o || (o = await this.getDurationFromUser(n, r)),
      o && i.setSnoozeDuration(o));
  }
  async getDurationFromUser(e, t) {
    const n = t.getNumber(UTe, 0, 3e5),
      i = [
        { 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 },
      ],
      r = await e.pick(i, {
        placeHolder: SI(80, "Select snooze duration for Inline Suggestions"),
        activeItem: i.find((e) => e.value === n),
      });
    if (r) return (t.store(UTe, r.value, 0, 0), r.value);
  }
}
class qTe extends VW {
  static {
    this.ID = "editor.action.inlineSuggest.cancelSnooze";
  }
  constructor() {
    super({
      id: qTe.ID,
      title: EI(82, "Cancel Snooze Inline Suggestions"),
      precondition: HTe,
      f1: !0,
    });
  }
  async run(e) {
    e.get(WTe).cancelSnooze();
  }
}
class KTe extends PO {
  static {
    this.MAX_SESSION_GAP_MS = 3e3;
  }
  static {
    this.MIN_SESSION_DURATION_MS = 1e3;
  }
  static {
    this.SESSION_HISTORY_LIMIT = 50;
  }
  static {
    this.TYPING_SPEED_WINDOW_MS = 3e5;
  }
  static {
    this.MIN_CHARS_FOR_RELIABLE_SPEED = 20;
  }
  getTypingInterval() {
    return (
      (this._cacheInvalidated || null === this._cachedTypingIntervalResult) &&
        ((this._cachedTypingIntervalResult = this._calculateTypingInterval()),
        (this._cacheInvalidated = !1)),
      this._cachedTypingIntervalResult
    );
  }
  constructor(e) {
    (super(),
      (this._textModel = e),
      (this._typingSessions = []),
      (this._currentSession = null),
      (this._lastChangeTime = 0),
      (this._cachedTypingIntervalResult = null),
      (this._cacheInvalidated = !0),
      this._register(this._textModel.onDidChangeContent((e) => this._updateTypingSpeed(e))));
  }
  _updateTypingSpeed(e) {
    const t = Date.now();
    this._isUserTyping(e)
      ? (this._currentSession &&
          t - this._lastChangeTime > KTe.MAX_SESSION_GAP_MS &&
          this._finalizeCurrentSession(),
        this._currentSession ||
          (this._currentSession = { startTime: t, endTime: t, characterCount: 0 }),
        (this._currentSession.endTime = t),
        (this._currentSession.characterCount += this._getActualCharacterCount(e)),
        (this._lastChangeTime = t),
        (this._cacheInvalidated = !0))
      : this._finalizeCurrentSession();
  }
  _getActualCharacterCount(e) {
    let t = 0;
    for (const n of e.changes) t += Math.max(n.text.length, n.rangeLength);
    return t;
  }
  _isUserTyping(e) {
    if (!e.detailedReasons || 0 === e.detailedReasons.length) return !1;
    for (const t of e.detailedReasons) if (this._isUserTypingReason(t)) return !0;
    return !1;
  }
  _isUserTypingReason(e) {
    if (e.metadata.isUndoing || e.metadata.isRedoing) return !1;
    if ("cursor" === e.metadata.source) {
      const t = e.metadata.kind;
      return "type" === t || "compositionType" === t || "compositionEnd" === t;
    }
    return !1;
  }
  _finalizeCurrentSession() {
    if (!this._currentSession) return;
    (this._currentSession.endTime - this._currentSession.startTime >= KTe.MIN_SESSION_DURATION_MS &&
      this._currentSession.characterCount > 0 &&
      (this._typingSessions.push(this._currentSession),
      this._typingSessions.length > KTe.SESSION_HISTORY_LIMIT && this._typingSessions.shift()),
      (this._currentSession = null));
  }
  _calculateTypingInterval() {
    if (this._currentSession) {
      const e = { ...this._currentSession };
      if (e.endTime - e.startTime >= KTe.MIN_SESSION_DURATION_MS && e.characterCount > 0) {
        const t = [...this._typingSessions, e];
        return this._calculateSpeedFromSessions(t);
      }
    }
    return this._calculateSpeedFromSessions(this._typingSessions);
  }
  _calculateSpeedFromSessions(e) {
    if (0 === e.length) return { averageInterval: 0, characterCount: 0 };
    const t = [...e].sort((e, t) => t.endTime - e.endTime),
      n = Date.now() - KTe.TYPING_SPEED_WINDOW_MS,
      i = t.filter((e) => e.endTime > n),
      r = t.splice(i.length);
    let o = Ej(i.map((e) => e.characterCount));
    for (let l = 0; l < r.length && o < KTe.MIN_CHARS_FOR_RELIABLE_SPEED; l++)
      (i.push(r[l]), (o += r[l].characterCount));
    const s = Ej(i.map((e) => e.endTime - e.startTime));
    if (0 === s || o <= 1) return { averageInterval: 0, characterCount: o };
    const a = s / Math.max(1, o - 1);
    return { averageInterval: Math.round(a), characterCount: o };
  }
  dispose() {
    (this._finalizeCurrentSession(), super.dispose());
  }
}
var GTe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let ZTe = class extends PO {
  get isAcceptingPartially() {
    return this._isAcceptingPartially;
  }
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h, g) {
    (super(),
      (this.textModel = e),
      (this._selectedSuggestItem = t),
      (this._textModelVersionId = n),
      (this._positions = i),
      (this._debounceValue = r),
      (this._enabled = o),
      (this._editor = s),
      (this._instantiationService = a),
      (this._commandService = l),
      (this._languageConfigurationService = c),
      (this._accessibilityService = d),
      (this._languageFeaturesService = u),
      (this._codeEditorService = h),
      (this._inlineCompletionsService = g),
      (this._isActive = LF(this, !1)),
      (this._onlyRequestInlineEditsSignal = A9(this)),
      (this._forceUpdateExplicitlySignal = A9(this)),
      (this._noDelaySignal = A9(this)),
      (this._fetchSpecificProviderSignal = A9(this)),
      (this._selectedInlineCompletionId = LF(this, void 0)),
      (this.primaryPosition = Xj(this, (e) => this._positions.read(e)[0] ?? new xV(1, 1))),
      (this.allPositions = Xj(this, (e) => this._positions.read(e))),
      (this._isAcceptingPartially = !1),
      (this._appearedInsideViewport = Xj(this, (e) => {
        const t = this.state.read(e);
        return (
          !(!t || !t.inlineCompletion) &&
          (function (e, t) {
            const n = t.targetRange,
              i = e.getVisibleRanges();
            if (i.length < 1) return !1;
            return new YH(
              i[0].startLineNumber,
              i[0].startColumn,
              i[i.length - 1].endLineNumber,
              i[i.length - 1].endColumn,
            ).containsRange(n);
          })(this._editor, t.inlineCompletion)
        );
      })),
      (this._onDidAccept = new QO()),
      (this.onDidAccept = this._onDidAccept.event),
      (this._lastShownInlineCompletionInfo = void 0),
      (this._lastAcceptedInlineCompletionInfo = void 0),
      (this._didUndoInlineEdits = eF(
        {
          owner: this,
          changeTracker: {
            createChangeSummary: () => ({ didUndo: !1 }),
            handleChange: (e, t) => (
              (t.didUndo = e.didChange(this._textModelVersionId) && !!e.change?.isUndoing),
              !0
            ),
          },
        },
        (e, t) => {
          const n = this._textModelVersionId.read(e);
          return (
            !!(
              null !== n &&
              this._lastAcceptedInlineCompletionInfo &&
              this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter === n - 1 &&
              this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit &&
              t.didUndo
            ) && ((this._lastAcceptedInlineCompletionInfo = void 0), !0)
          );
        },
      )),
      (this._preserveCurrentCompletionReasons = new Set([YTe.Redo, YTe.Undo, YTe.AcceptWord])),
      (this.dontRefetchSignal = A9(this)),
      (this._fetchInlineCompletionsPromise = eF(
        {
          owner: this,
          changeTracker: {
            createChangeSummary: () => ({
              dontRefetch: !1,
              preserveCurrentCompletion: !1,
              inlineCompletionTriggerKind: p2.Automatic,
              onlyRequestInlineEdits: !1,
              shouldDebounce: !0,
              provider: void 0,
              textChange: !1,
              changeReason: "",
            }),
            handleChange: (e, t) => {
              if (e.didChange(this._textModelVersionId)) {
                this._preserveCurrentCompletionReasons.has(this._getReason(e.change)) &&
                  (t.preserveCurrentCompletion = !0);
                const n = e.change?.detailedReasons ?? [];
                ((t.changeReason = n.length > 0 ? n[0].getType() : ""), (t.textChange = !0));
              } else
                e.didChange(this._forceUpdateExplicitlySignal)
                  ? ((t.preserveCurrentCompletion = !0),
                    (t.inlineCompletionTriggerKind = p2.Explicit))
                  : e.didChange(this.dontRefetchSignal)
                    ? (t.dontRefetch = !0)
                    : e.didChange(this._onlyRequestInlineEditsSignal)
                      ? (t.onlyRequestInlineEdits = !0)
                      : e.didChange(this._fetchSpecificProviderSignal) && (t.provider = e.change);
              return !0;
            },
          },
        },
        (e, t) => {
          (this._source.clearOperationOnTextModelChange.read(e),
            this._noDelaySignal.read(e),
            this.dontRefetchSignal.read(e),
            this._onlyRequestInlineEditsSignal.read(e),
            this._forceUpdateExplicitlySignal.read(e),
            this._fetchSpecificProviderSignal.read(e));
          if (
            !(
              ((this._enabled.read(e) && this._selectedSuggestItem.read(e)) ||
                this._isActive.read(e)) &&
              (!this._inlineCompletionsService.isSnoozing() ||
                t.inlineCompletionTriggerKind === p2.Explicit)
            )
          )
            return void this._source.cancelUpdate();
          this._textModelVersionId.read(e);
          const n = this._source.suggestWidgetInlineCompletions.read(void 0);
          let i = this._selectedSuggestItem.read(e);
          if (
            (this._shouldShowOnSuggestConflict.read(void 0) && (i = void 0),
            n && !i && this._source.seedInlineCompletionsWithSuggestWidget(),
            t.dontRefetch)
          )
            return Promise.resolve(!0);
          if (this._didUndoInlineEdits.read(e) && t.inlineCompletionTriggerKind !== p2.Explicit)
            return void cF((e) => {
              this._source.clear(e);
            });
          let r = "";
          (t.provider
            ? (r += "providerOnDidChange")
            : t.inlineCompletionTriggerKind === p2.Explicit && (r += "explicit"),
            t.changeReason && (r += r.length > 0 ? `:${t.changeReason}` : t.changeReason));
          const o = this._typing.getTypingInterval(),
            s = {
              editorType: this.editorType,
              startTime: Date.now(),
              languageId: this.textModel.getLanguageId(),
              reason: r,
              typingInterval: o.averageInterval,
              typingIntervalCharacterCount: o.characterCount,
              availableProviders: [],
            };
          let a = {
            triggerKind: t.inlineCompletionTriggerKind,
            selectedSuggestionInfo: i?.toSelectedSuggestionInfo(),
            includeInlineCompletions: !t.onlyRequestInlineEdits,
            includeInlineEdits: this._inlineEditsEnabled.read(e),
            requestIssuedDateTime: s.startTime,
            earliestShownDateTime:
              s.startTime +
              (t.inlineCompletionTriggerKind === p2.Explicit || this.inAcceptFlow.read(void 0)
                ? 0
                : this._minShowDelay.read(void 0)),
          };
          a.triggerKind === p2.Automatic &&
            t.textChange &&
            this.textModel.getAlternativeVersionId() ===
              this._lastShownInlineCompletionInfo?.alternateTextModelVersionId &&
            (a = {
              ...a,
              includeInlineCompletions:
                !this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,
              includeInlineEdits: this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,
            });
          const l =
              this.selectedInlineCompletion.read(void 0) ??
              this._inlineCompletionItems.read(void 0)?.inlineEdit,
            c = t.preserveCurrentCompletion || l?.forwardStable ? l : void 0,
            d = this._jumpedToId.map(
              (e) => !!e && e === this._inlineCompletionItems.read(void 0)?.inlineEdit?.semanticId,
            ),
            u = t.provider
              ? { providers: [t.provider], label: "single:" + t.provider.providerId?.toString() }
              : {
                  providers: this._languageFeaturesService.inlineCompletionsProvider.all(
                    this.textModel,
                  ),
                  label: void 0,
                },
            h = this.getAvailableProviders(u.providers);
          return (
            (s.availableProviders = h.map((e) => e.providerId).filter(hR)),
            this._source.fetch(h, u.label, a, c?.identity, t.shouldDebounce, d, s)
          );
        },
      )),
      (this._inlineCompletionItems = Jj({ owner: this }, (e) => {
        const t = this._source.inlineCompletions.read(e);
        if (!t) return;
        const n = this.primaryPosition.read(e);
        let i;
        const r = [];
        for (const o of t.inlineCompletions)
          o.isInlineEdit ? (i = o) : o.isVisible(this.textModel, n) && r.push(o);
        return (0 !== r.length && (i = void 0), { inlineCompletions: r, inlineEdit: i });
      })),
      (this._filteredInlineCompletionItems = Jj({ owner: this, equalsFn: Oj() }, (e) => {
        const t = this._inlineCompletionItems.read(e);
        return t?.inlineCompletions ?? [];
      })),
      (this.selectedInlineCompletionIndex = Xj(this, (e) => {
        const t = this._selectedInlineCompletionId.read(e),
          n = this._filteredInlineCompletionItems.read(e),
          i =
            void 0 === this._selectedInlineCompletionId
              ? -1
              : n.findIndex((e) => e.semanticId === t);
        return -1 === i ? (this._selectedInlineCompletionId.set(void 0, void 0), 0) : i;
      })),
      (this.selectedInlineCompletion = Xj(
        this,
        (e) =>
          this._filteredInlineCompletionItems.read(e)[this.selectedInlineCompletionIndex.read(e)],
      )),
      (this.activeCommands = Jj(
        { owner: this, equalsFn: Oj() },
        (e) => this.selectedInlineCompletion.read(e)?.source.inlineSuggestions.commands ?? [],
      )),
      (this.inlineCompletionsCount = Xj(this, (e) =>
        this.lastTriggerKind.read(e) === p2.Explicit
          ? this._filteredInlineCompletionItems.read(e).length
          : void 0,
      )),
      (this._hasVisiblePeekWidgets = Xj(
        this,
        (e) => this._editorObs.openedPeekWidgets.read(e) > 0,
      )),
      (this._shouldShowOnSuggestConflict = Xj(this, (e) => {
        const t = this._showOnSuggestConflict.read(e);
        if ("never" !== t) {
          if (!!this.selectedInlineCompletion.read(e)) {
            const n = this._selectedSuggestItem.read(e);
            return !!n && ("whenSuggestListIsIncomplete" !== t || n.listIncomplete);
          }
        }
        return !1;
      })),
      (this.state = Jj(
        {
          owner: this,
          equalsFn: (e, t) =>
            e && t
              ? "ghostText" === e.kind && "ghostText" === t.kind
                ? bDe(e.ghostTexts, t.ghostTexts) &&
                  e.inlineCompletion === t.inlineCompletion &&
                  e.suggestItem === t.suggestItem
                : "inlineEdit" === e.kind &&
                  "inlineEdit" === t.kind &&
                  e.inlineEdit.equals(t.inlineEdit)
              : e === t,
        },
        (e) => {
          const t = this.textModel;
          if (this._suppressInSnippetMode.read(e) && this._isInSnippetMode.read(e)) return;
          const n = this._inlineCompletionItems.read(e),
            i = n?.inlineEdit;
          if (i) {
            if (this._hasVisiblePeekWidgets.read(e)) return;
            let r = i.getSingleTextEdit();
            r = xDe(r, t);
            const o = this.primaryPosition.map((e) =>
                Q5.fromRangeInclusive(i.targetRange).addMargin(1, 1).contains(e.lineNumber),
              ),
              s = i.source.inlineSuggestions.commands,
              a = new BTe(r, s ?? [], i),
              l = i.updatedEdit,
              c = l ? l3.fromStringEdit(l, new ehe(this.textModel)).replacements : [r],
              d =
                ("vscode.open" !== n.inlineEdit?.command?.id &&
                  "_workbench.open" !== n.inlineEdit?.command?.id) ||
                !n.inlineEdit?.command.arguments?.length
                  ? void 0
                  : mP.from(n.inlineEdit?.command.arguments[0]);
            return {
              kind: "inlineEdit",
              inlineEdit: a,
              inlineCompletion: i,
              edits: c,
              cursorAtInlineEdit: o,
              nextEditUri: d,
            };
          }
          const r = this._selectedSuggestItem.read(e);
          if (!this._shouldShowOnSuggestConflict.read(e) && r) {
            const n = xDe(r.getSingleTextEdit(), t),
              i = this._computeAugmentation(n, e);
            if (!this._suggestPreviewEnabled.read(e) && !i) return;
            const o = i?.edit ?? n,
              s = i ? i.edit.text.length - n.text.length : 0,
              a = this._suggestPreviewMode.read(e),
              l = this._positions.read(e),
              c = [o, ...XTe(this.textModel, l, o)]
                .map((e, n) => ({ edit: e, ghostText: e ? CDe(e, t, a, l[n], s) : void 0 }))
                .filter(({ edit: e, ghostText: t }) => void 0 !== e && void 0 !== t),
              d = c.map(({ edit: e }) => e),
              u = c.map(({ ghostText: e }) => e);
            return {
              kind: "ghostText",
              edits: d,
              primaryGhostText: u[0] ?? new mDe(o.range.endLineNumber, []),
              ghostTexts: u,
              inlineCompletion: i?.completion,
              suggestItem: r,
            };
          }
          {
            if (!this._isActive.read(e)) return;
            const n = this.selectedInlineCompletion.read(e);
            if (!n) return;
            const i = n.getSingleTextEdit(),
              r = this._inlineSuggestMode.read(e),
              o = this._positions.read(e),
              s = [i, ...XTe(this.textModel, o, i)]
                .map((e, n) => ({ edit: e, ghostText: e ? CDe(e, t, r, o[n], 0) : void 0 }))
                .filter(({ edit: e, ghostText: t }) => void 0 !== e && void 0 !== t),
              a = s.map(({ edit: e }) => e),
              l = s.map(({ ghostText: e }) => e);
            if (!l[0]) return;
            return {
              kind: "ghostText",
              edits: a,
              primaryGhostText: l[0],
              ghostTexts: l,
              inlineCompletion: n,
              suggestItem: void 0,
            };
          }
        },
      )),
      (this.inlineCompletionState = Xj(this, (e) => {
        const t = this.state.read(e);
        if (t && "ghostText" === t.kind && !this._editorObs.inComposition.read(e)) return t;
      })),
      (this.inlineEditState = Xj(this, (e) => {
        const t = this.state.read(e);
        if (t && "inlineEdit" === t.kind) return t;
      })),
      (this.inlineEditAvailable = Xj(this, (e) => !!this.inlineEditState.read(e))),
      (this.warning = Xj(
        this,
        (e) => this.inlineCompletionState.read(e)?.inlineCompletion?.warning,
      )),
      (this.ghostTexts = Jj({ owner: this, equalsFn: bDe }, (e) => {
        const t = this.inlineCompletionState.read(e);
        if (t) return t.ghostTexts;
      })),
      (this.primaryGhostText = Jj({ owner: this, equalsFn: yDe }, (e) => {
        const t = this.inlineCompletionState.read(e);
        if (t) return t?.primaryGhostText;
      })),
      (this.showCollapsed = Xj(this, (e) => {
        const t = this.state.read(e);
        if (!t || "inlineEdit" !== t.kind) return !1;
        if (t.inlineCompletion.hint) return !1;
        const n = t.inlineCompletion.updatedEditModelVersion === this._textModelVersionId.read(e);
        return (
          (this._inlineEditsShowCollapsedEnabled.read(e) || !n) &&
          this._jumpedToId.read(e) !== t.inlineCompletion.semanticId &&
          !this._inAcceptFlow.read(e)
        );
      })),
      (this._tabShouldIndent = Xj(this, (e) => {
        if (this._inAcceptFlow.read(e)) return !1;
        const t = this._editorObs.selections.read(e);
        return t?.some((e) =>
          e.isEmpty()
            ? 0 === this.textModel.getLineLength(e.startLineNumber)
            : (function (e) {
                return e.startLineNumber !== e.endLineNumber;
              })(e) ||
              e.containsRange(
                (function (e, t) {
                  const n = e.getLineIndentColumn(t),
                    i = e.getLineLastNonWhitespaceColumn(t),
                    r = Math.max(i, n);
                  return new YH(t, n, t, r);
                })(this.textModel, e.startLineNumber),
              ),
        );
      })),
      (this.tabShouldJumpToInlineEdit = Xj(this, (e) => {
        if (this._tabShouldIndent.read(e)) return !1;
        const t = this.inlineEditState.read(e);
        return (
          !!t &&
          (!!this.showCollapsed.read(e) ||
            (!(
              this._inAcceptFlow.read(e) &&
              this._appearedInsideViewport.read(e) &&
              !t.inlineCompletion.hint?.jumpToEdit
            ) &&
              !t.cursorAtInlineEdit.read(e)))
        );
      })),
      (this.tabShouldAcceptInlineEdit = Xj(this, (e) => {
        const t = this.inlineEditState.read(e);
        return (
          !!t &&
          !this.showCollapsed.read(e) &&
          !this._tabShouldIndent.read(e) &&
          (!(
            !this._inAcceptFlow.read(e) ||
            !this._appearedInsideViewport.read(e) ||
            t.inlineCompletion.hint?.jumpToEdit
          ) ||
            t.inlineCompletion.targetRange.startLineNumber ===
              this._editorObs.cursorLineNumber.read(e) ||
            this._jumpedToId.read(e) === t.inlineCompletion.semanticId ||
            t.cursorAtInlineEdit.read(e))
        );
      })),
      (this._jumpedToId = LF(this, void 0)),
      (this._inAcceptFlow = LF(this, !1)),
      (this.inAcceptFlow = this._inAcceptFlow),
      (this._source = this._register(
        this._instantiationService.createInstance(
          MTe,
          this.textModel,
          this._textModelVersionId,
          this._debounceValue,
          this.primaryPosition,
        ),
      )),
      (this.lastTriggerKind = this._source.inlineCompletions.map(
        this,
        (e) => e?.request?.context.triggerKind,
      )),
      (this._editorObs = xde(this._editor)));
    const p = this._editorObs.getOption(134);
    ((this._suggestPreviewEnabled = p.map((e) => e.preview)),
      (this._suggestPreviewMode = p.map((e) => e.previewMode)));
    const f = this._editorObs.getOption(71);
    ((this._inlineSuggestMode = f.map((e) => e.mode)),
      (this._suppressedInlineCompletionGroupIds = f.map(
        (e) => new Set(e.experimental.suppressInlineSuggestions.split(",")),
      )),
      (this._inlineEditsEnabled = f.map((e) => !!e.edits.enabled)),
      (this._inlineEditsShowCollapsedEnabled = f.map((e) => e.edits.showCollapsed)),
      (this._triggerCommandOnProviderChange = f.map((e) => e.triggerCommandOnProviderChange)),
      (this._minShowDelay = f.map((e) => e.minShowDelay)),
      (this._showOnSuggestConflict = f.map((e) => e.experimental.showOnSuggestConflict)),
      (this._suppressInSnippetMode = f.map((e) => e.suppressInSnippetMode)));
    const m = iDe.get(this._editor);
    ((this._isInSnippetMode = m?.isInSnippetObservable ?? xne(!1)),
      (this._typing = this._register(new KTe(this.textModel))),
      this._register(
        this._inlineCompletionsService.onDidChangeIsSnoozing((e) => {
          e && this.stop();
        }),
      ));
    {
      const e = "vscode-notebook-cell" === this.textModel.uri.scheme,
        [t] = this._codeEditorService
          .listDiffEditors()
          .filter(
            (e) =>
              e.getOriginalEditor().getId() === this._editor.getId() ||
              e.getModifiedEditor().getId() === this._editor.getId(),
          );
      ((this.isInDiffEditor = !!t),
        (this.editorType = e
          ? kTe.Notebook
          : this.isInDiffEditor
            ? kTe.DiffEditor
            : kTe.TextEditor));
    }
    (this._register(
      _F(this.state, (e) => {
        e &&
          e.inlineCompletion &&
          this._inlineCompletionsService.reportNewCompletion(e.inlineCompletion.requestUuid);
      }),
    ),
      this._register(_F(this._fetchInlineCompletionsPromise)),
      this._register(
        rF((e) => {
          (this._editorObs.versionId.read(e), this._inAcceptFlow.set(!1, void 0));
        }),
      ),
      this._register(
        rF((e) => {
          const t = this.state
            .map((e, t) => !e || ("inlineEdit" === e.kind && !e.cursorAtInlineEdit.read(t)))
            .read(e);
          t && this._jumpedToId.set(void 0, void 0);
        }),
      ));
    const _ = this.inlineEditState.map((e) => e?.inlineCompletion.semanticId);
    this._register(
      rF((e) => {
        _.read(e) &&
          (this._editor.pushUndoStop(),
          (this._lastShownInlineCompletionInfo = {
            alternateTextModelVersionId: this.textModel.getAlternativeVersionId(),
            inlineCompletion: this.state.get().inlineCompletion,
          }));
      }),
    );
    (yF(
      this,
      gF(this._languageFeaturesService.inlineCompletionsProvider.onDidChange, () =>
        this._languageFeaturesService.inlineCompletionsProvider.all(e),
      ),
      (e, t) => {
        e.onDidChangeInlineCompletions &&
          t.add(
            e.onDidChangeInlineCompletions(() => {
              if (!this._enabled.get()) return;
              if (
                (this._codeEditorService.getFocusedCodeEditor() ||
                  this._codeEditorService.getActiveCodeEditor()) !== this._editor
              )
                return;
              if (this._triggerCommandOnProviderChange.get())
                return void this.trigger(void 0, { onlyFetchInlineEdits: !0 });
              const t = this.state.get();
              (t && (t.inlineCompletion || t.edits) && t.inlineCompletion?.source.provider !== e) ||
                cF((t) => {
                  (this._fetchSpecificProviderSignal.trigger(t, e), this.trigger(t));
                });
            }),
          );
      },
    ).recomputeInitiallyAndOnChange(this._store),
      this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store));
  }
  getIndentationInfo(e) {
    let t = !1,
      n = !0;
    const i = this?.primaryGhostText.read(e);
    if (this?._selectedSuggestItem && i && i.parts.length > 0) {
      const { column: e, lines: r } = i.parts[0],
        o = r[0].line;
      if (e <= this.textModel.getLineIndentColumn(i.lineNumber)) {
        let e = YM(o);
        (-1 === e && (e = o.length - 1), (t = e > 0));
        const i = this.textModel.getOptions().tabSize;
        n = tz.visibleColumnFromColumn(o, e + 1, i) < i;
      }
    }
    return { startsWithIndentation: t, startsWithIndentationLessThanTabSize: n };
  }
  _getReason(e) {
    return e?.isUndoing
      ? YTe.Undo
      : e?.isRedoing
        ? YTe.Redo
        : this.isAcceptingPartially
          ? YTe.AcceptWord
          : YTe.Other;
  }
  getAvailableProviders(e) {
    const t = this._suppressedInlineCompletionGroupIds.get(),
      n = e.filter((e) => !(e.groupId && t.has(e.groupId))),
      i = new Set();
    for (const o of n) o.excludesGroupIds?.forEach((e) => i.add(e));
    const r = [];
    for (const o of n) (o.groupId && i.has(o.groupId)) || r.push(o);
    return r;
  }
  async trigger(e, t = {}) {
    (uF(e, (e) => {
      (t.onlyFetchInlineEdits && this._onlyRequestInlineEditsSignal.trigger(e),
        t.noDelay && this._noDelaySignal.trigger(e),
        this._isActive.set(!0, e),
        t.explicit && (this._inAcceptFlow.set(!0, e), this._forceUpdateExplicitlySignal.trigger(e)),
        t.provider && this._fetchSpecificProviderSignal.trigger(e, t.provider));
    }),
      await this._fetchInlineCompletionsPromise.get());
  }
  async triggerExplicitly(e, t = !1) {
    return this.trigger(e, { onlyFetchInlineEdits: t, explicit: !0 });
  }
  stop(e = "automatic", t) {
    uF(t, (t) => {
      if ("explicitCancel" === e) {
        const e = this.state.get()?.inlineCompletion;
        e && e.reportEndOfLife({ kind: m2.Rejected });
      }
      (this._isActive.set(!1, t), this._source.clear(t));
    });
  }
  _computeAugmentation(e, t) {
    const n = this.textModel,
      i = this._source.suggestWidgetInlineCompletions.read(t),
      r = i
        ? i.inlineCompletions.filter((e) => !e.isInlineEdit)
        : [this.selectedInlineCompletion.read(t)].filter(hR),
      o = (function (e, t) {
        for (const n of e) {
          const e = t(n);
          if (void 0 !== e) return e;
        }
      })(r, (t) => {
        let i = t.getSingleTextEdit();
        return (
          (i = xDe(i, n, YH.fromPositions(i.range.getStartPosition(), e.range.getEndPosition()))),
          wDe(i, e) ? { completion: t, edit: i } : void 0
        );
      });
    return o;
  }
  async _deltaSelectedInlineCompletionIndex(e) {
    await this.triggerExplicitly();
    const t = this._filteredInlineCompletionItems.get() || [];
    if (t.length > 0) {
      const n = (this.selectedInlineCompletionIndex.get() + e + t.length) % t.length;
      this._selectedInlineCompletionId.set(t[n].semanticId, void 0);
    } else this._selectedInlineCompletionId.set(void 0, void 0);
  }
  async next() {
    await this._deltaSelectedInlineCompletionIndex(1);
  }
  async previous() {
    await this._deltaSelectedInlineCompletionIndex(-1);
  }
  _getMetadata(e, t, n = void 0) {
    return n
      ? m8.inlineCompletionPartialAccept({
          nes: e.isInlineEdit,
          requestUuid: e.requestUuid,
          providerId: e.source.provider.providerId,
          languageId: t,
          type: n,
        })
      : m8.inlineCompletionAccept({
          nes: e.isInlineEdit,
          requestUuid: e.requestUuid,
          providerId: e.source.provider.providerId,
          languageId: t,
        });
  }
  async accept(e = this._editor) {
    if (e.getModel() !== this.textModel) throw new QI();
    let t,
      n = !1;
    const i = this.state.get();
    if ("ghostText" === i?.kind) {
      if (!i || i.primaryGhostText.isEmpty() || !i.inlineCompletion) return;
      t = i.inlineCompletion;
    } else {
      if ("inlineEdit" !== i?.kind) return;
      ((t = i.inlineCompletion), (n = !!i.nextEditUri));
    }
    t.addRef();
    try {
      if ((e.pushUndoStop(), n));
      else if (t.snippetInfo) {
        const n = c3.delete(t.editRange),
          i = t.additionalTextEdits.map((e) => new c3(YH.lift(e.range), e.text ?? "")),
          r = l3.fromParallelReplacementsUnsorted([n, ...i]);
        (e.edit(r, this._getMetadata(t, this.textModel.getLanguageId())),
          e.setPosition(t.snippetInfo.range.getStartPosition(), "inlineCompletionAccept"),
          iDe.get(e)?.insert(t.snippetInfo.snippet, { undoStopBefore: !1 }));
      } else {
        const n = i.edits;
        let r = n;
        "ghostText" === i.kind &&
          (r = (function (e, t) {
            const n = oDe(t),
              i = t.getValue(),
              r = e.map((e) => n.getStringReplacement(e));
            return r.map((e) => e.removeCommonSuffixPrefix(i)).map((e) => n.getTextReplacement(e));
          })(n, this.textModel));
        const o = lDe(r).map((e) => XH.fromPositions(e)),
          s = t.additionalTextEdits.map((e) => new c3(YH.lift(e.range), e.text ?? "")),
          a = l3.fromParallelReplacementsUnsorted([...n, ...s]);
        if (
          (e.edit(a, this._getMetadata(t, this.textModel.getLanguageId())),
          void 0 === t.hint &&
            e.setSelections("inlineEdit" === i.kind ? o.slice(-1) : o, "inlineCompletionAccept"),
          "inlineEdit" === i.kind && !this._accessibilityService.isMotionReduced())
        ) {
          const t = a.getNewRanges(),
            n = this._store.add(
              new QTe(e, t, () => {
                this._store.delete(n);
              }),
            );
        }
      }
      (this._onDidAccept.fire(),
        this.stop(),
        t.command &&
          (await this._commandService
            .executeCommand(t.command.id, ...(t.command.arguments || []))
            .then(void 0, zI)),
        t.reportEndOfLife({ kind: m2.Accepted }));
    } finally {
      (t.removeRef(),
        this._inAcceptFlow.set(!0, void 0),
        (this._lastAcceptedInlineCompletionInfo = {
          textModelVersionIdAfter: this.textModel.getVersionId(),
          inlineCompletion: t,
        }));
    }
  }
  async acceptNextWord() {
    await this._acceptNext(
      this._editor,
      "word",
      (e, t) => {
        const n = this.textModel.getLanguageIdAtPosition(e.lineNumber, e.column),
          i = this._languageConfigurationService.getLanguageConfiguration(n),
          r = new RegExp(i.wordDefinition.source, i.wordDefinition.flags.replace("g", "")),
          o = t.match(r);
        let s = 0;
        s = o && void 0 !== o.index ? (0 === o.index ? o[0].length : o.index) : t.length;
        const a = /\s+/g.exec(t);
        return (
          a && void 0 !== a.index && a.index + a[0].length < s && (s = a.index + a[0].length),
          s
        );
      },
      0,
    );
  }
  async acceptNextLine() {
    await this._acceptNext(
      this._editor,
      "line",
      (e, t) => {
        const n = t.match(/\n/);
        return n && void 0 !== n.index ? n.index + 1 : t.length;
      },
      1,
    );
  }
  async _acceptNext(e, t, n, i) {
    if (e.getModel() !== this.textModel) throw new QI();
    const r = this.inlineCompletionState.get();
    if (!r || r.primaryGhostText.isEmpty() || !r.inlineCompletion) return;
    const o = r.primaryGhostText,
      s = r.inlineCompletion;
    if (s.snippetInfo) return void (await this.accept(e));
    const a = o.parts[0],
      l = new xV(o.lineNumber, a.column),
      c = a.text,
      d = n(l, c);
    if (d === c.length && 1 === o.parts.length) return void this.accept(e);
    const u = c.substring(0, d),
      h = this._positions.get(),
      g = h[0];
    s.addRef();
    try {
      this._isAcceptingPartially = !0;
      try {
        e.pushUndoStop();
        const n = YH.fromPositions(g, l),
          i = e.getModel().getValueInRange(n) + u,
          r = new c3(n, i),
          o = [r, ...XTe(this.textModel, h, r)].filter(hR),
          a = lDe(o).map((e) => XH.fromPositions(e));
        (e.edit(l3.fromParallelReplacementsUnsorted(o), this._getMetadata(s, t)),
          e.setSelections(a, "inlineCompletionPartialAccept"),
          e.revealPositionInCenterIfOutsideViewport(e.getPosition(), 1));
      } finally {
        this._isAcceptingPartially = !1;
      }
      const n = YH.fromPositions(s.editRange.getStartPosition(), e3.ofText(u).addToPosition(l)),
        r = e.getModel().getValueInRange(n, 1).length;
      s.reportPartialAccept(
        r,
        { kind: i, acceptedLength: r },
        { characters: d, ratio: d / c.length, count: 1 },
      );
    } finally {
      s.removeRef();
    }
  }
  handleSuggestAccepted(e) {
    const t = xDe(e.getSingleTextEdit(), this.textModel),
      n = this._computeAugmentation(t, void 0);
    if (!n) return;
    const i = this.textModel.getValueInRange(n.completion.editRange, 1).length + t.text.length;
    n.completion.reportPartialAccept(
      t.text.length,
      { kind: 2, acceptedLength: i },
      { characters: t.text.length, count: 1, ratio: 1 },
    );
  }
  extractReproSample() {
    const e = this.textModel.getValue(),
      t = this.state.get()?.inlineCompletion;
    return { documentValue: e, inlineCompletion: t?.getSourceCompletion() };
  }
  jump() {
    const e = this.inlineEditState.get();
    e &&
      cF((t) => {
        (this._jumpedToId.set(e.inlineCompletion.semanticId, t), this.dontRefetchSignal.trigger(t));
        const n = e.inlineCompletion.targetRange,
          i = n.getStartPosition();
        this._editor.setPosition(i, "inlineCompletions.jump");
        if (
          n.isSingleLine() &&
          (e.inlineCompletion.hint || !e.inlineCompletion.insertText.includes("\n"))
        )
          this._editor.revealPosition(i);
        else {
          const e = new YH(n.startLineNumber - 1, 1, n.endLineNumber + 1, 1);
          this._editor.revealRange(e, 1);
        }
        (e.inlineCompletion.identity.setJumpTo(t), this._editor.focus());
      });
  }
  async handleInlineSuggestionShown(e, t, n) {
    await e.reportInlineEditShown(this._commandService, t, n);
  }
};
var YTe;
function XTe(e, t, n) {
  if (1 === t.length) return [];
  const i = new ehe(e),
    r = i.getTransformer(),
    o = r.getOffset(t[0]),
    s = t.slice(1).map((e) => r.getOffset(e));
  n = n.removeCommonPrefixAndSuffix(i);
  const a = r.getStringReplacement(n),
    l = a.replaceRange.start - o,
    c = a.replaceRange.join(N$.emptyAt(o)),
    d = i.getValueOfOffsetRange(c),
    u = s
      .map((e) => {
        const t = e + l,
          n = t + a.replaceRange.length,
          o = new N$(t, n),
          s = o.join(N$.emptyAt(e));
        if (i.getValueOfOffsetRange(s) !== d) return;
        const c = new Y5(o, a.newText);
        return r.getTextReplacement(c);
      })
      .filter(hR);
  return u;
}
((ZTe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [GTe(7, vV), GTe(8, PV), GTe(9, f$), GTe(10, KK), GTe(11, mee), GTe(12, yV), GTe(13, WTe)],
  ZTe,
)),
  (function (e) {
    ((e[(e.Undo = 0)] = "Undo"),
      (e[(e.Redo = 1)] = "Redo"),
      (e[(e.AcceptWord = 2)] = "AcceptWord"),
      (e[(e.Other = 3)] = "Other"));
  })(YTe || (YTe = {})));
class QTe extends PO {
  constructor(e, t, n) {
    (super(),
      n && this._register({ dispose: () => n() }),
      this._register(
        xde(e).setDecorations(
          xne(
            t.map((e) => ({
              range: e,
              options: {
                description: "animation",
                className: "edits-fadeout-decoration",
                zIndex: 1,
              },
            })),
          ),
        ),
      ));
    const i = new uDe(1, 0, 1e3, gDe),
      r = new pDe(i);
    this._register(
      rF((t) => {
        const n = r.getValue(t);
        (e.getContainerDomNode().style.setProperty("--animation-opacity", n.toString()),
          i.isFinished() && this.dispose());
      }),
    );
  }
}
var JTe,
  eIe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class tIe {
  constructor(e) {
    this.name = e;
  }
  select(e, t, n) {
    if (0 === n.length) return 0;
    const i = n[0].score[0];
    for (let r = 0; r < n.length; r++) {
      const { score: e, completion: t } = n[r];
      if (e[0] !== i) break;
      if (t.preselect) return r;
    }
    return 0;
  }
}
class nIe extends tIe {
  constructor() {
    super("first");
  }
  memorize(e, t, n) {}
  toJSON() {}
  fromJSON() {}
}
class iIe extends tIe {
  constructor() {
    (super("recentlyUsed"), (this._cache = new XW(300, 0.66)), (this._seq = 0));
  }
  memorize(e, t, n) {
    const i = `${e.getLanguageId()}/${n.textLabel}`;
    this._cache.set(i, {
      touch: this._seq++,
      type: n.completion.kind,
      insertText: n.completion.insertText,
    });
  }
  select(e, t, n) {
    if (0 === n.length) return 0;
    const i = e.getLineContent(t.lineNumber).substr(t.column - 10, t.column - 1);
    if (/\s$/.test(i)) return super.select(e, t, n);
    const r = n[0].score[0];
    let o = -1,
      s = -1,
      a = -1;
    for (let l = 0; l < n.length && n[l].score[0] === r; l++) {
      const t = `${e.getLanguageId()}/${n[l].textLabel}`,
        i = this._cache.peek(t);
      if (
        (i &&
          i.touch > a &&
          i.type === n[l].completion.kind &&
          i.insertText === n[l].completion.insertText &&
          ((a = i.touch), (s = l)),
        n[l].completion.preselect && -1 === o)
      )
        return l;
    }
    return -1 !== s ? s : -1 !== o ? o : 0;
  }
  toJSON() {
    return this._cache.toJSON();
  }
  fromJSON(e) {
    this._cache.clear();
    for (const [t, n] of e)
      ((n.touch = 0),
        (n.type = "number" == typeof n.type ? n.type : g2.fromString(n.type)),
        this._cache.set(t, n));
    this._seq = this._cache.size;
  }
}
class rIe extends tIe {
  constructor() {
    (super("recentlyUsedByPrefix"), (this._trie = Ige.forStrings()), (this._seq = 0));
  }
  memorize(e, t, n) {
    const { word: i } = e.getWordUntilPosition(t),
      r = `${e.getLanguageId()}/${i}`;
    this._trie.set(r, {
      type: n.completion.kind,
      insertText: n.completion.insertText,
      touch: this._seq++,
    });
  }
  select(e, t, n) {
    const { word: i } = e.getWordUntilPosition(t);
    if (!i) return super.select(e, t, n);
    const r = `${e.getLanguageId()}/${i}`;
    let o = this._trie.get(r);
    if ((o || (o = this._trie.findSubstr(r)), o))
      for (let s = 0; s < n.length; s++) {
        const { kind: e, insertText: t } = n[s].completion;
        if (e === o.type && t === o.insertText) return s;
      }
    return super.select(e, t, n);
  }
  toJSON() {
    const e = [];
    return (
      this._trie.forEach((t, n) => e.push([n, t])),
      e.sort((e, t) => -(e[1].touch - t[1].touch)).forEach((e, t) => (e[1].touch = t)),
      e.slice(0, 200)
    );
  }
  fromJSON(e) {
    if ((this._trie.clear(), e.length > 0)) {
      this._seq = e[0][1].touch + 1;
      for (const [t, n] of e)
        ((n.type = "number" == typeof n.type ? n.type : g2.fromString(n.type)),
          this._trie.set(t, n));
    }
  }
}
let oIe = class {
  static {
    JTe = this;
  }
  static {
    this._strategyCtors = new Map([
      ["recentlyUsedByPrefix", rIe],
      ["recentlyUsed", iIe],
      ["first", nIe],
    ]);
  }
  static {
    this._storagePrefix = "suggest/memories";
  }
  constructor(e, t) {
    ((this._storageService = e),
      (this._configService = t),
      (this._disposables = new AO()),
      (this._persistSoon = new EM(() => this._saveState(), 500)),
      this._disposables.add(
        e.onWillSaveState((e) => {
          e.reason === sue.SHUTDOWN && this._saveState();
        }),
      ));
  }
  dispose() {
    (this._disposables.dispose(), this._persistSoon.dispose());
  }
  memorize(e, t, n) {
    (this._withStrategy(e, t).memorize(e, t, n), this._persistSoon.schedule());
  }
  select(e, t, n) {
    return this._withStrategy(e, t).select(e, t, n);
  }
  _withStrategy(e, t) {
    const n = this._configService.getValue("editor.suggestSelection", {
      overrideIdentifier: e.getLanguageIdAtPosition(t.lineNumber, t.column),
      resource: e.uri,
    });
    if (this._strategy?.name !== n) {
      this._saveState();
      const e = JTe._strategyCtors.get(n) || nIe;
      this._strategy = new e();
      try {
        const e = this._configService.getValue("editor.suggest.shareSuggestSelections") ? 0 : 1,
          t = this._storageService.get(`${JTe._storagePrefix}/${n}`, e);
        t && this._strategy.fromJSON(JSON.parse(t));
      } catch (spt) {}
    }
    return this._strategy;
  }
  _saveState() {
    if (this._strategy) {
      const e = this._configService.getValue("editor.suggest.shareSuggestSelections") ? 0 : 1,
        t = JSON.stringify(this._strategy);
      this._storageService.store(`${JTe._storagePrefix}/${this._strategy.name}`, t, e, 1);
    }
  }
};
oIe = JTe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([eIe(0, oue), eIe(1, OU)], oIe);
const sIe = bV("ISuggestMemories");
HU(sIe, oIe, 1);
var aIe;
let lIe = class {
  static {
    aIe = this;
  }
  static {
    this.AtEnd = new yW("atEndOfWord", !1, {
      type: "boolean",
      description: SI(
        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",
      ),
    });
  }
  constructor(e, t) {
    ((this._editor = e),
      (this._enabled = !1),
      (this._ckAtEnd = aIe.AtEnd.bindTo(t)),
      (this._configListener = this._editor.onDidChangeConfiguration(
        (e) => e.hasChanged(139) && this._update(),
      )),
      this._update());
  }
  dispose() {
    (this._configListener.dispose(), this._selectionListener?.dispose(), this._ckAtEnd.reset());
  }
  _update() {
    const e = "on" === this._editor.getOption(139);
    if (this._enabled !== e)
      if (((this._enabled = e), this._enabled)) {
        const e = () => {
          if (!this._editor.hasModel()) return void this._ckAtEnd.set(!1);
          const e = this._editor.getModel(),
            t = this._editor.getSelection(),
            n = e.getWordAtPosition(t.getStartPosition());
          n
            ? this._ckAtEnd.set(
                n.endColumn === t.getStartPosition().column &&
                  t.getStartPosition().lineNumber === t.getEndPosition().lineNumber,
              )
            : this._ckAtEnd.set(!1);
        };
        ((this._selectionListener = this._editor.onDidChangeCursorSelection(e)), e());
      } else
        this._selectionListener &&
          (this._ckAtEnd.reset(),
          this._selectionListener.dispose(),
          (this._selectionListener = void 0));
  }
};
lIe = aIe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, xW),
  ],
  lIe,
);
var cIe;
let dIe = class {
  static {
    cIe = this;
  }
  static {
    this.OtherSuggestions = new yW("hasOtherSuggestions", !1);
  }
  constructor(e, t) {
    ((this._editor = e),
      (this._index = 0),
      (this._ckOtherSuggestions = cIe.OtherSuggestions.bindTo(t)));
  }
  dispose() {
    this.reset();
  }
  reset() {
    (this._ckOtherSuggestions.reset(),
      this._listener?.dispose(),
      (this._model = void 0),
      (this._acceptNext = void 0),
      (this._ignore = !1));
  }
  set({ model: e, index: t }, n) {
    if (0 === e.items.length) return void this.reset();
    cIe._moveIndex(!0, e, t) !== t
      ? ((this._acceptNext = n),
        (this._model = e),
        (this._index = t),
        (this._listener = this._editor.onDidChangeCursorPosition(() => {
          this._ignore || this.reset();
        })),
        this._ckOtherSuggestions.set(!0))
      : this.reset();
  }
  static _moveIndex(e, t, n) {
    let i = n;
    for (
      let r = t.items.length;
      r > 0 &&
      ((i = (i + t.items.length + (e ? 1 : -1)) % t.items.length), i !== n) &&
      t.items[i].completion.additionalTextEdits;
      r--
    );
    return i;
  }
  next() {
    this._move(!0);
  }
  prev() {
    this._move(!1);
  }
  _move(e) {
    if (this._model)
      try {
        ((this._ignore = !0),
          (this._index = cIe._moveIndex(e, this._model, this._index)),
          this._acceptNext({
            index: this._index,
            item: this._model.items[this._index],
            model: this._model,
          }));
      } finally {
        this._ignore = !1;
      }
  }
};
dIe = cIe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, xW),
  ],
  dIe,
);
class uIe {
  constructor(e, t, n, i) {
    ((this._disposables = new AO()),
      this._disposables.add(
        n.onDidSuggest((e) => {
          0 === e.completionModel.items.length && this.reset();
        }),
      ),
      this._disposables.add(
        n.onDidCancel((e) => {
          this.reset();
        }),
      ),
      this._disposables.add(t.onDidShow(() => this._onItem(t.getFocusedItem()))),
      this._disposables.add(t.onDidFocus(this._onItem, this)),
      this._disposables.add(t.onDidHide(this.reset, this)),
      this._disposables.add(
        e.onWillType((r) => {
          if (this._active && !t.isFrozen() && 0 !== n.state) {
            const t = r.charCodeAt(r.length - 1);
            this._active.acceptCharacters.has(t) && e.getOption(0) && i(this._active.item);
          }
        }),
      ));
  }
  _onItem(e) {
    if (!e || !aj(e.item.completion.commitCharacters)) return void this.reset();
    if (this._active && this._active.item.item === e.item) return;
    const t = new Iz();
    for (const n of e.item.completion.commitCharacters) n.length > 0 && t.add(n.charCodeAt(0));
    this._active = { acceptCharacters: t, item: e };
  }
  reset() {
    this._active = void 0;
  }
  dispose() {
    this._disposables.dispose();
  }
}
class hIe {
  async provideSelectionRanges(e, t) {
    const n = [];
    for (const i of t) {
      const t = [];
      n.push(t);
      const r = new Map();
      (await new Promise((t) => hIe._bracketsRightYield(t, 0, e, i, r)),
        await new Promise((n) => hIe._bracketsLeftYield(n, 0, e, i, r, t)));
    }
    return n;
  }
  static {
    this._maxDuration = 30;
  }
  static {
    this._maxRounds = 2;
  }
  static _bracketsRightYield(e, t, n, i, r) {
    const o = new Map(),
      s = Date.now();
    for (;;) {
      if (t >= hIe._maxRounds) {
        e();
        break;
      }
      if (!i) {
        e();
        break;
      }
      const a = n.bracketPairs.findNextBracket(i);
      if (!a) {
        e();
        break;
      }
      if (Date.now() - s > hIe._maxDuration) {
        setTimeout(() => hIe._bracketsRightYield(e, t + 1, n, i, r));
        break;
      }
      if (a.bracketInfo.isOpeningBracket) {
        const e = a.bracketInfo.bracketText,
          t = o.has(e) ? o.get(e) : 0;
        o.set(e, t + 1);
      } else {
        const e = a.bracketInfo.getOpeningBrackets()[0].bracketText;
        let t = o.has(e) ? o.get(e) : 0;
        if (((t -= 1), o.set(e, Math.max(0, t)), t < 0)) {
          let t = r.get(e);
          (t || ((t = new HO()), r.set(e, t)), t.push(a.range));
        }
      }
      i = a.range.getEndPosition();
    }
  }
  static _bracketsLeftYield(e, t, n, i, r, o) {
    const s = new Map(),
      a = Date.now();
    for (;;) {
      if (t >= hIe._maxRounds && 0 === r.size) {
        e();
        break;
      }
      if (!i) {
        e();
        break;
      }
      const l = n.bracketPairs.findPrevBracket(i);
      if (!l) {
        e();
        break;
      }
      if (Date.now() - a > hIe._maxDuration) {
        setTimeout(() => hIe._bracketsLeftYield(e, t + 1, n, i, r, o));
        break;
      }
      if (l.bracketInfo.isOpeningBracket) {
        const e = l.bracketInfo.bracketText;
        let t = s.has(e) ? s.get(e) : 0;
        if (((t -= 1), s.set(e, Math.max(0, t)), t < 0)) {
          const t = r.get(e);
          if (t) {
            const i = t.shift();
            0 === t.size && r.delete(e);
            const s = YH.fromPositions(l.range.getEndPosition(), i.getStartPosition()),
              a = YH.fromPositions(l.range.getStartPosition(), i.getEndPosition());
            (o.push({ range: s }), o.push({ range: a }), hIe._addBracketLeading(n, a, o));
          }
        }
      } else {
        const e = l.bracketInfo.getOpeningBrackets()[0].bracketText,
          t = s.has(e) ? s.get(e) : 0;
        s.set(e, t + 1);
      }
      i = l.range.getStartPosition();
    }
  }
  static _addBracketLeading(e, t, n) {
    if (t.startLineNumber === t.endLineNumber) return;
    const i = t.startLineNumber,
      r = e.getLineFirstNonWhitespaceColumn(i);
    0 !== r &&
      r !== t.startColumn &&
      (n.push({ range: YH.fromPositions(new xV(i, r), t.getEndPosition()) }),
      n.push({ range: YH.fromPositions(new xV(i, 1), t.getEndPosition()) }));
    const o = i - 1;
    if (o > 0) {
      const i = e.getLineFirstNonWhitespaceColumn(o);
      i === t.startColumn &&
        i !== e.getLineLastNonWhitespaceColumn(o) &&
        (n.push({ range: YH.fromPositions(new xV(o, i), t.getEndPosition()) }),
        n.push({ range: YH.fromPositions(new xV(o, 1), t.getEndPosition()) }));
    }
  }
}
class gIe {
  static {
    this.None = new (class extends gIe {
      distance() {
        return 0;
      }
    })();
  }
  static async create(e, t) {
    if (!t.getOption(134).localityBonus) return gIe.None;
    if (!t.hasModel()) return gIe.None;
    const n = t.getModel(),
      i = t.getPosition();
    if (!e.canComputeWordRanges(n.uri)) return gIe.None;
    const [r] = await new hIe().provideSelectionRanges(n, [i]);
    if (0 === r.length) return gIe.None;
    const o = await e.computeWordRanges(n.uri, r[0].range);
    if (!o) return gIe.None;
    const s = n.getWordUntilPosition(i);
    return (
      delete o[s.word],
      new (class extends gIe {
        distance(e, n) {
          if (!i.equals(t.getPosition())) return 0;
          if (17 === n.kind) return 2 << 20;
          const s = "string" == typeof n.label ? n.label : n.label.label,
            a = o[s];
          if (sj(a)) return 2 << 20;
          const l = QP(a, YH.fromPositions(e), YH.compareRangesUsingStarts),
            c = l >= 0 ? a[l] : a[Math.max(0, ~l - 1)];
          let d = r.length;
          for (const t of r) {
            if (!YH.containsRange(t.range, c)) break;
            d -= 1;
          }
          return d;
        }
      })()
    );
  }
}
let pIe = class {
  constructor(e, t) {
    ((this.leadingLineContent = e), (this.characterCountDelta = t));
  }
};
class fIe {
  constructor(e, t, n, i, r, o, s = Uie.default, a = void 0) {
    ((this.clipboardText = a),
      (this._snippetCompareFn = fIe._compareCompletionItems),
      (this._items = e),
      (this._column = t),
      (this._wordDistance = i),
      (this._options = r),
      (this._refilterKind = 1),
      (this._lineContext = n),
      (this._fuzzyScoreOptions = s),
      "top" === o
        ? (this._snippetCompareFn = fIe._compareCompletionItemsSnippetsUp)
        : "bottom" === o && (this._snippetCompareFn = fIe._compareCompletionItemsSnippetsDown));
  }
  get lineContext() {
    return this._lineContext;
  }
  set lineContext(e) {
    (this._lineContext.leadingLineContent === e.leadingLineContent &&
      this._lineContext.characterCountDelta === e.characterCountDelta) ||
      ((this._refilterKind =
        this._lineContext.characterCountDelta < e.characterCountDelta && this._filteredItems
          ? 2
          : 1),
      (this._lineContext = e));
  }
  get items() {
    return (this._ensureCachedState(), this._filteredItems);
  }
  getItemsByProvider() {
    return (this._ensureCachedState(), this._itemsByProvider);
  }
  getIncompleteProvider() {
    this._ensureCachedState();
    const e = new Set();
    for (const [t, n] of this.getItemsByProvider())
      n.length > 0 && n[0].container.incomplete && e.add(t);
    return e;
  }
  get stats() {
    return (this._ensureCachedState(), this._stats);
  }
  _ensureCachedState() {
    0 !== this._refilterKind && this._createCachedState();
  }
  _createCachedState() {
    this._itemsByProvider = new Map();
    const e = [],
      { leadingLineContent: t, characterCountDelta: n } = this._lineContext;
    let i = "",
      r = "";
    const o = 1 === this._refilterKind ? this._items : this._filteredItems,
      s = [],
      a = !this._options.filterGraceful || o.length > 2e3 ? $ie : Kie;
    for (let l = 0; l < o.length; l++) {
      const c = o[l];
      if (c.isInvalid) continue;
      const d = this._itemsByProvider.get(c.provider);
      d ? d.push(c) : this._itemsByProvider.set(c.provider, [c]);
      const u = c.position.column - c.editStart.column,
        h = u + n - (c.position.column - this._column);
      if (
        (i.length !== h && ((i = 0 === h ? "" : t.slice(-h)), (r = i.toLowerCase())),
        (c.word = i),
        0 === h)
      )
        c.score = zie.Default;
      else {
        let e = 0;
        for (; e < u; ) {
          const t = i.charCodeAt(e);
          if (32 !== t && 9 !== t) break;
          e += 1;
        }
        if (e >= h) c.score = zie.Default;
        else if ("string" == typeof c.completion.filterText) {
          const t = a(
            i,
            r,
            e,
            c.completion.filterText,
            c.filterTextLow,
            0,
            this._fuzzyScoreOptions,
          );
          if (!t) continue;
          0 === tA(c.completion.filterText, c.textLabel)
            ? (c.score = t)
            : ((c.score = Tie(i, r, e, c.textLabel, c.labelLow, 0)), (c.score[0] = t[0]));
        } else {
          const t = a(i, r, e, c.textLabel, c.labelLow, 0, this._fuzzyScoreOptions);
          if (!t) continue;
          c.score = t;
        }
      }
      ((c.idx = l),
        (c.distance = this._wordDistance.distance(c.position, c.completion)),
        s.push(c),
        e.push(c.textLabel.length));
    }
    ((this._filteredItems = s.sort(this._snippetCompareFn)),
      (this._refilterKind = 0),
      (this._stats = { pLabelLen: e.length ? ej(e.length - 0.85, e, (e, t) => e - t) : 0 }));
  }
  static _compareCompletionItems(e, t) {
    return e.score[0] > t.score[0]
      ? -1
      : e.score[0] < t.score[0]
        ? 1
        : e.distance < t.distance
          ? -1
          : e.distance > t.distance
            ? 1
            : e.idx < t.idx
              ? -1
              : e.idx > t.idx
                ? 1
                : 0;
  }
  static _compareCompletionItemsSnippetsDown(e, t) {
    if (e.completion.kind !== t.completion.kind) {
      if (28 === e.completion.kind) return 1;
      if (28 === t.completion.kind) return -1;
    }
    return fIe._compareCompletionItems(e, t);
  }
  static _compareCompletionItemsSnippetsUp(e, t) {
    if (e.completion.kind !== t.completion.kind) {
      if (28 === e.completion.kind) return -1;
      if (28 === t.completion.kind) return 1;
    }
    return fIe._compareCompletionItems(e, t);
  }
}
var mIe,
  _Ie = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class vIe {
  static shouldAutoTrigger(e) {
    if (!e.hasModel()) return !1;
    const t = e.getModel(),
      n = e.getPosition();
    t.tokenization.tokenizeIfCheap(n.lineNumber);
    const i = t.getWordAtPosition(n);
    return (
      !!i && (i.endColumn === n.column || i.startColumn + 1 === n.column) && !!isNaN(Number(i.word))
    );
  }
  constructor(e, t, n) {
    ((this.leadingLineContent = e.getLineContent(t.lineNumber).substr(0, t.column - 1)),
      (this.leadingWord = e.getWordUntilPosition(t)),
      (this.lineNumber = t.lineNumber),
      (this.column = t.column),
      (this.triggerOptions = n));
  }
}
let bIe = (mIe = class {
  constructor(e, t, n, i, r, o, s, a, l) {
    ((this._editor = e),
      (this._editorWorkerService = t),
      (this._clipboardService = n),
      (this._telemetryService = i),
      (this._logService = r),
      (this._contextKeyService = o),
      (this._configurationService = s),
      (this._languageFeaturesService = a),
      (this._envService = l),
      (this._toDispose = new AO()),
      (this._triggerCharacterListener = new AO()),
      (this._triggerQuickSuggest = new SM()),
      (this._triggerState = void 0),
      (this._completionDisposables = new AO()),
      (this._onDidCancel = new QO()),
      (this._onDidTrigger = new QO()),
      (this._onDidSuggest = new QO()),
      (this.onDidCancel = this._onDidCancel.event),
      (this.onDidTrigger = this._onDidTrigger.event),
      (this.onDidSuggest = this._onDidSuggest.event),
      (this._currentSelection = this._editor.getSelection() || new XH(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 c = !1;
    (this._toDispose.add(
      this._editor.onDidCompositionStart(() => {
        c = !0;
      }),
    ),
      this._toDispose.add(
        this._editor.onDidCompositionEnd(() => {
          ((c = !1), this._onCompositionEnd());
        }),
      ),
      this._toDispose.add(
        this._editor.onDidChangeCursorSelection((e) => {
          c || this._onCursorChange(e);
        }),
      ),
      this._toDispose.add(
        this._editor.onDidChangeModelContent(() => {
          c || void 0 === this._triggerState || this._refilterCompletionItems();
        }),
      ),
      this._updateTriggerCharacters());
  }
  dispose() {
    (IO(this._triggerCharacterListener),
      IO([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;
    const e = new Map();
    for (const n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))
      for (const t of n.triggerCharacters || []) {
        let i = e.get(t);
        (i || ((i = new Set()), e.set(t, i)), i.add(n));
      }
    const t = (t) => {
      if (
        !(function (e, t) {
          if (!Boolean(t.getContextKeyValue("inlineSuggestionVisible"))) return !0;
          const n = t.getContextKeyValue(pLe.suppressSuggestions.key);
          return void 0 !== n ? !n : !e.getOption(71).suppressSuggestions;
        })(this._editor, this._contextKeyService, this._configurationService)
      )
        return;
      if (vIe.shouldAutoTrigger(this._editor)) return;
      if (!t) {
        const e = this._editor.getPosition();
        t = this._editor
          .getModel()
          .getLineContent(e.lineNumber)
          .substr(0, e.column - 1);
      }
      let n = "";
      hA(t.charCodeAt(t.length - 1))
        ? uA(t.charCodeAt(t.length - 2)) && (n = t.substr(t.length - 2))
        : (n = t.charAt(t.length - 1));
      const i = e.get(n);
      if (i) {
        const e = new Map();
        if (this._completionModel)
          for (const [t, n] of this._completionModel.getItemsByProvider()) i.has(t) || e.set(t, n);
        this.trigger({
          auto: !0,
          triggerKind: 1,
          triggerCharacter: n,
          retrigger: Boolean(this._completionModel),
          clipboardText: this._completionModel?.clipboardText,
          completionOptions: { providerFilter: i, providerItemsToReuse: e },
        });
      }
    };
    (this._triggerCharacterListener.add(this._editor.onDidType(t)),
      this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(() => t())));
  }
  get state() {
    return this._triggerState ? (this._triggerState.auto ? 2 : 1) : 0;
  }
  cancel(e = !1) {
    void 0 !== this._triggerState &&
      (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: e }));
  }
  clear() {
    this._completionDisposables.clear();
  }
  _updateActiveSuggestSession() {
    void 0 !== this._triggerState &&
      (this._editor.hasModel() &&
      this._languageFeaturesService.completionProvider.has(this._editor.getModel())
        ? this.trigger({ auto: this._triggerState.auto, retrigger: !0 })
        : this.cancel());
  }
  _onCursorChange(e) {
    if (!this._editor.hasModel()) return;
    const t = this._currentSelection;
    ((this._currentSelection = this._editor.getSelection()),
      !e.selection.isEmpty() ||
      (0 !== e.reason && 3 !== e.reason) ||
      ("keyboard" !== e.source && "deleteLeft" !== e.source)
        ? this.cancel()
        : void 0 === this._triggerState && 0 === e.reason
          ? (t.containsRange(this._currentSelection) ||
              t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) &&
            this._doTriggerQuickSuggest()
          : void 0 !== this._triggerState && 3 === e.reason && this._refilterCompletionItems());
  }
  _onCompositionEnd() {
    void 0 === this._triggerState ? this._doTriggerQuickSuggest() : this._refilterCompletionItems();
  }
  _doTriggerQuickSuggest() {
    gLe.isAllOff(this._editor.getOption(102)) ||
      (this._editor.getOption(134).snippetsPreventQuickSuggestions &&
        iDe.get(this._editor)?.isInSnippet()) ||
      (this.cancel(),
      this._triggerQuickSuggest.cancelAndSet(() => {
        if (void 0 !== this._triggerState) return;
        if (!vIe.shouldAutoTrigger(this._editor)) return;
        if (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) return;
        const e = this._editor.getModel(),
          t = this._editor.getPosition(),
          n = this._editor.getOption(102);
        if (!gLe.isAllOff(n)) {
          if (!gLe.isAllOn(n)) {
            e.tokenization.tokenizeIfCheap(t.lineNumber);
            const i = e.tokenization.getLineTokens(t.lineNumber),
              r = i.getStandardTokenType(i.findTokenIndexAtOffset(Math.max(t.column - 1 - 1, 0)));
            if ("on" !== gLe.valueFor(n, r)) return;
          }
          (function (e, t) {
            if (!Boolean(t.getContextKeyValue(pLe.inlineSuggestionVisible.key))) return !0;
            const n = t.getContextKeyValue(pLe.suppressSuggestions.key);
            return void 0 !== n ? !n : !e.getOption(71).suppressSuggestions;
          })(this._editor, this._contextKeyService, this._configurationService) &&
            this._languageFeaturesService.completionProvider.has(e) &&
            this.trigger({ auto: !0 });
        }
      }, this._editor.getOption(103)));
  }
  _refilterCompletionItems() {
    (pR(this._editor.hasModel()), pR(void 0 !== this._triggerState));
    const e = this._editor.getModel(),
      t = this._editor.getPosition(),
      n = new vIe(e, t, { ...this._triggerState, refilter: !0 });
    this._onNewContext(n);
  }
  trigger(e) {
    if (!this._editor.hasModel()) return;
    const t = this._editor.getModel(),
      n = new vIe(t, this._editor.getPosition(), e);
    (this.cancel(e.retrigger),
      (this._triggerState = e),
      this._onDidTrigger.fire({
        auto: e.auto,
        shy: e.shy ?? !1,
        position: this._editor.getPosition(),
      }),
      (this._context = n));
    let i = { triggerKind: e.triggerKind ?? 0 };
    (e.triggerCharacter && (i = { triggerKind: 1, triggerCharacter: e.triggerCharacter }),
      (this._requestToken = new cM()));
    let r = 1;
    switch (this._editor.getOption(128)) {
      case "top":
        r = 0;
        break;
      case "bottom":
        r = 2;
    }
    const { itemKind: o, showDeprecated: s } = mIe.createSuggestFilter(this._editor),
      a = new lLe(
        r,
        e.completionOptions?.kindFilter ?? o,
        e.completionOptions?.providerFilter,
        e.completionOptions?.providerItemsToReuse,
        s,
      ),
      l = gIe.create(this._editorWorkerService, this._editor),
      c = dLe(
        this._languageFeaturesService.completionProvider,
        t,
        this._editor.getPosition(),
        a,
        i,
        this._requestToken.token,
      );
    Promise.all([c, l])
      .then(async ([t, n]) => {
        if ((this._requestToken?.dispose(), !this._editor.hasModel()))
          return void t.disposable.dispose();
        let i = e?.clipboardText;
        if (
          (!i && t.needsClipboard && (i = await this._clipboardService.readText()),
          void 0 === this._triggerState)
        )
          return void t.disposable.dispose();
        const r = this._editor.getModel(),
          o = new vIe(r, this._editor.getPosition(), e),
          s = {
            ...Uie.default,
            firstMatchCanBeWeak: !this._editor.getOption(134).matchOnWordStartOnly,
          };
        if (
          ((this._completionModel = new fIe(
            t.items,
            this._context.column,
            {
              leadingLineContent: o.leadingLineContent,
              characterCountDelta: o.column - this._context.column,
            },
            n,
            this._editor.getOption(134),
            this._editor.getOption(128),
            s,
            i,
          )),
          this._completionDisposables.add(t.disposable),
          this._onNewContext(o),
          this._reportDurationsTelemetry(t.durations),
          !this._envService.isBuilt || this._envService.isExtensionDevelopment)
        )
          for (const e of t.items)
            e.isInvalid &&
              this._logService.warn(
                `[suggest] did IGNORE invalid completion item from ${e.provider._debugDisplayName}`,
                e.completion,
              );
      })
      .catch(HI);
  }
  _reportDurationsTelemetry(e) {
    Math.random() > 1e-4 ||
      setTimeout(() => {
        (this._telemetryService.publicLog2("suggest.durations.json", { data: JSON.stringify(e) }),
          this._logService.debug("suggest.durations.json", e));
      });
  }
  static createSuggestFilter(e) {
    const t = new Set();
    "none" === e.getOption(128) && t.add(28);
    const n = e.getOption(134);
    return (
      n.showMethods || t.add(0),
      n.showFunctions || t.add(1),
      n.showConstructors || t.add(2),
      n.showFields || t.add(3),
      n.showVariables || t.add(4),
      n.showClasses || t.add(5),
      n.showStructs || t.add(6),
      n.showInterfaces || t.add(7),
      n.showModules || t.add(8),
      n.showProperties || t.add(9),
      n.showEvents || t.add(10),
      n.showOperators || t.add(11),
      n.showUnits || t.add(12),
      n.showValues || t.add(13),
      n.showConstants || t.add(14),
      n.showEnums || t.add(15),
      n.showEnumMembers || t.add(16),
      n.showKeywords || t.add(17),
      n.showWords || t.add(18),
      n.showColors || t.add(19),
      n.showFiles || t.add(20),
      n.showReferences || t.add(21),
      n.showColors || t.add(22),
      n.showFolders || t.add(23),
      n.showTypeParameters || t.add(24),
      n.showSnippets || t.add(28),
      n.showUsers || t.add(25),
      n.showIssues || t.add(26),
      { itemKind: t, showDeprecated: n.showDeprecated }
    );
  }
  _onNewContext(e) {
    if (this._context)
      if (e.lineNumber === this._context.lineNumber)
        if (XM(e.leadingLineContent) === XM(this._context.leadingLineContent)) {
          if (e.column < this._context.column)
            e.leadingWord.word
              ? this.trigger({ auto: this._context.triggerOptions.auto, retrigger: !0 })
              : this.cancel();
          else if (this._completionModel) {
            if (
              0 !== e.leadingWord.word.length &&
              e.leadingWord.startColumn > this._context.leadingWord.startColumn
            ) {
              if (vIe.shouldAutoTrigger(this._editor) && this._context) {
                const e = this._completionModel.getItemsByProvider();
                this.trigger({
                  auto: this._context.triggerOptions.auto,
                  retrigger: !0,
                  clipboardText: this._completionModel.clipboardText,
                  completionOptions: { providerItemsToReuse: e },
                });
              }
              return;
            }
            if (
              e.column > this._context.column &&
              this._completionModel.getIncompleteProvider().size > 0 &&
              0 !== e.leadingWord.word.length
            ) {
              const e = new Map(),
                t = new Set();
              for (const [n, i] of this._completionModel.getItemsByProvider())
                i.length > 0 && i[0].container.incomplete ? t.add(n) : e.set(n, i);
              this.trigger({
                auto: this._context.triggerOptions.auto,
                triggerKind: 2,
                retrigger: !0,
                clipboardText: this._completionModel.clipboardText,
                completionOptions: { providerFilter: t, providerItemsToReuse: e },
              });
            } else {
              const t = this._completionModel.lineContext;
              let n = !1;
              if (
                ((this._completionModel.lineContext = {
                  leadingLineContent: e.leadingLineContent,
                  characterCountDelta: e.column - this._context.column,
                }),
                0 === this._completionModel.items.length)
              ) {
                const i = vIe.shouldAutoTrigger(this._editor);
                if (!this._context) return void this.cancel();
                if (i && this._context.leadingWord.endColumn < e.leadingWord.startColumn)
                  return void this.trigger({
                    auto: this._context.triggerOptions.auto,
                    retrigger: !0,
                  });
                if (this._context.triggerOptions.auto) return void this.cancel();
                if (
                  ((this._completionModel.lineContext = t),
                  (n = this._completionModel.items.length > 0),
                  n && 0 === e.leadingWord.word.length)
                )
                  return void this.cancel();
              }
              this._onDidSuggest.fire({
                completionModel: this._completionModel,
                triggerOptions: e.triggerOptions,
                isFrozen: n,
              });
            }
          }
        } else this.cancel();
      else this.cancel();
  }
});
bIe = mIe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    _Ie(1, Dce),
    _Ie(2, ade),
    _Ie(3, HW),
    _Ie(4, yH),
    _Ie(5, xW),
    _Ie(6, OU),
    _Ie(7, mee),
    _Ie(8, ume),
  ],
  bIe,
);
class yIe {
  static {
    this._maxSelectionLength = 51200;
  }
  constructor(e, t) {
    ((this._disposables = new AO()),
      (this._lastOvertyped = []),
      (this._locked = !1),
      this._disposables.add(
        e.onWillType(() => {
          if (this._locked || !e.hasModel()) return;
          const t = e.getSelections(),
            n = t.length;
          let i = !1;
          for (let e = 0; e < n; e++)
            if (!t[e].isEmpty()) {
              i = !0;
              break;
            }
          if (!i)
            return void (0 !== this._lastOvertyped.length && (this._lastOvertyped.length = 0));
          this._lastOvertyped = [];
          const r = e.getModel();
          for (let e = 0; e < n; e++) {
            const n = t[e];
            if (r.getValueLengthInRange(n) > yIe._maxSelectionLength) return;
            this._lastOvertyped[e] = {
              value: r.getValueInRange(n),
              multiline: n.startLineNumber !== n.endLineNumber,
            };
          }
        }),
      ),
      this._disposables.add(
        t.onDidTrigger((e) => {
          this._locked = !0;
        }),
      ),
      this._disposables.add(
        t.onDidCancel((e) => {
          this._locked = !1;
        }),
      ));
  }
  getLastOvertypedInfo(e) {
    if (e >= 0 && e < this._lastOvertyped.length) return this._lastOvertyped[e];
  }
  dispose() {
    this._disposables.dispose();
  }
}
var xIe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let wIe = class {
  constructor(e, t, n, i, r) {
    ((this._menuId = t),
      (this._menuService = i),
      (this._contextKeyService = r),
      (this._menuDisposables = new AO()),
      (this.element = MB(e, VB(".suggest-status-bar"))));
    const o = (e) => (e instanceof BW ? n.createInstance(Due, e, { useComma: !1 }) : void 0);
    ((this._leftActions = new Cle(this.element, { actionViewItemProvider: o })),
      (this._rightActions = new Cle(this.element, { actionViewItemProvider: o })),
      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() {
    const e = this._menuService.createMenu(this._menuId, this._contextKeyService),
      t = () => {
        const t = [],
          n = [];
        for (const [i, r] of e.getActions()) "left" === i ? t.push(...r) : n.push(...r);
        (this._leftActions.clear(),
          this._leftActions.push(t),
          this._rightActions.clear(),
          this._rightActions.push(n));
      };
    (this._menuDisposables.add(e.onDidChange(() => t())), this._menuDisposables.add(e));
  }
  hide() {
    this._menuDisposables.clear();
  }
};
wIe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([xIe(2, vV), xIe(3, AW), xIe(4, xW)], wIe);
var CIe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
function SIe(e) {
  return (
    !!e &&
    Boolean(
      e.completion.documentation ||
      (e.completion.detail && e.completion.detail !== e.completion.label),
    )
  );
}
let kIe = class {
  constructor(e, t, n) {
    ((this._editor = e),
      (this._themeService = t),
      (this._markdownRendererService = n),
      (this._onDidClose = new QO()),
      (this.onDidClose = this._onDidClose.event),
      (this._onDidChangeContents = new QO()),
      (this.onDidChangeContents = this._onDidChangeContents.event),
      (this._disposables = new AO()),
      (this._renderDisposeable = new AO()),
      (this._size = new oB(330, 0)),
      (this.domNode = VB(".suggest-details")),
      this.domNode.classList.add("no-docs"),
      (this._body = VB(".body")),
      (this._scrollbar = new wJ(this._body, { alwaysConsumeMouseWheel: !0 })),
      MB(this.domNode, this._scrollbar.getDomNode()),
      this._disposables.add(this._scrollbar),
      (this._header = MB(this._body, VB(".header"))),
      (this._close = MB(this._header, VB("span" + AV.asCSSSelector(OV.close)))),
      (this._close.title = SI(1490, "Close")),
      (this._close.role = "button"),
      (this._close.tabIndex = -1),
      (this._type = MB(this._header, VB("p.type"))),
      (this._docs = MB(this._body, VB("p.docs"))),
      this._configureFont(),
      this._disposables.add(
        this._editor.onDidChangeConfiguration((e) => {
          e.hasChanged(59) && this._configureFont();
        }),
      ));
  }
  dispose() {
    (this._disposables.dispose(), this._renderDisposeable.dispose());
  }
  _configureFont() {
    const e = this._editor.getOptions(),
      t = e.get(59),
      n = t.getMassagedFontFamily(),
      i = e.get(135) || t.fontSize,
      r = e.get(136) || t.lineHeight,
      o = t.fontWeight,
      s = `${i}px`,
      a = `${r}px`;
    ((this.domNode.style.fontSize = s),
      (this.domNode.style.lineHeight = "" + r / i),
      (this.domNode.style.fontWeight = o),
      (this.domNode.style.fontFeatureSettings = t.fontFeatureSettings),
      (this._type.style.fontFamily = n),
      (this._close.style.height = a),
      (this._close.style.width = a));
  }
  getLayoutInfo() {
    const e = this._editor.getOption(136) || this._editor.getOption(59).lineHeight,
      t = TQ(this._themeService.getColorTheme().type) ? 2 : 1;
    return {
      lineHeight: e,
      borderWidth: t,
      borderHeight: 2 * t,
      verticalPadding: 22,
      horizontalPadding: 14,
    };
  }
  renderLoading() {
    ((this._type.textContent = SI(1491, "Loading...")),
      (this._docs.textContent = ""),
      this.domNode.classList.remove("no-docs", "no-type"),
      this.layout(this.size.width, 2 * this.getLayoutInfo().lineHeight),
      this._onDidChangeContents.fire(this));
  }
  renderItem(e, t) {
    this._renderDisposeable.clear();
    let { detail: n, documentation: i } = e.completion;
    if (t) {
      let t = "";
      ((t += `score: ${e.score[0]}\n`),
        (t += `prefix: ${e.word ?? "(no prefix)"}\n`),
        (t += `word: ${e.completion.filterText ? e.completion.filterText + " (filterText)" : e.textLabel}\n`),
        (t += `distance: ${e.distance} (localityBonus-setting)\n`),
        (t += `index: ${e.idx}, based on ${(e.completion.sortText && `sortText: "${e.completion.sortText}"`) || "label"}\n`),
        (t += `commit_chars: ${e.completion.commitCharacters?.join("")}\n`),
        (i = new rre().appendCodeblock("empty", t)),
        (n = `Provider: ${e.provider._debugDisplayName}`));
    }
    if (t || SIe(e)) {
      if ((this.domNode.classList.remove("no-docs", "no-type"), n)) {
        const e = n.length > 1e5 ? `${n.substr(0, 1e5)}…` : n;
        ((this._type.textContent = e),
          (this._type.title = e),
          WB(this._type),
          this._type.classList.toggle("auto-wrap", !/\r?\n^\s+/gim.test(e)));
      } else
        (zF(this._type),
          (this._type.title = ""),
          HB(this._type),
          this.domNode.classList.add("no-type"));
      if ((zF(this._docs), "string" == typeof i))
        (this._docs.classList.remove("markdown-docs"), (this._docs.textContent = i));
      else if (i) {
        (this._docs.classList.add("markdown-docs"), zF(this._docs));
        const e = this._markdownRendererService.render(i, {
          context: this._editor,
          asyncRenderCallback: () => {
            (this.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight),
              this._onDidChangeContents.fire(this));
          },
        });
        (this._docs.appendChild(e.element), this._renderDisposeable.add(e));
      }
      (this.domNode.classList.toggle("detail-and-doc", !!n && !!i),
        (this.domNode.style.userSelect = "text"),
        (this.domNode.tabIndex = -1),
        (this._close.onmousedown = (e) => {
          (e.preventDefault(), e.stopPropagation());
        }),
        (this._close.onclick = (e) => {
          (e.preventDefault(), e.stopPropagation(), this._onDidClose.fire());
        }),
        (this._body.scrollTop = 0),
        this.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight),
        this._onDidChangeContents.fire(this));
    } else this.clearContents();
  }
  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(e, t) {
    const n = new oB(e, t);
    (oB.equals(n, this._size) ||
      ((this._size = n),
      (function (e, t, n) {
        ("number" == typeof t && (e.style.width = `${t}px`),
          "number" == typeof n && (e.style.height = `${n}px`));
      })(this.domNode, e, t)),
      this._scrollbar.scanDomNode());
  }
  scrollDown(e = 8) {
    this._body.scrollTop += e;
  }
  scrollUp(e = 8) {
    this._body.scrollTop -= e;
  }
  scrollTop() {
    this._body.scrollTop = 0;
  }
  scrollBottom() {
    this._body.scrollTop = this._body.scrollHeight;
  }
  pageDown() {
    this.scrollDown(80);
  }
  pageUp() {
    this.scrollUp(80);
  }
  focus() {
    this.domNode.focus();
  }
};
kIe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([CIe(1, h0), CIe(2, _ge)], kIe);
class EIe {
  constructor(e, t) {
    let n, i;
    ((this.widget = e),
      (this._editor = t),
      (this.allowEditorOverflow = !0),
      (this._disposables = new AO()),
      (this._added = !1),
      (this._preferAlignAtTop = !0),
      (this._resizable = new g_e()),
      this._resizable.domNode.classList.add("suggest-details-container"),
      this._resizable.domNode.appendChild(e.domNode),
      this._resizable.enableSashes(!1, !0, !0, !1));
    let r = 0,
      o = 0;
    (this._disposables.add(
      this._resizable.onDidWillResize(() => {
        ((n = this._topLeft), (i = this._resizable.size));
      }),
    ),
      this._disposables.add(
        this._resizable.onDidResize((e) => {
          if (n && i) {
            this.widget.layout(e.dimension.width, e.dimension.height);
            let t = !1;
            (e.west && ((o = i.width - e.dimension.width), (t = !0)),
              e.north && ((r = i.height - e.dimension.height), (t = !0)),
              t && this._applyTopLeft({ top: n.top + r, left: n.left + o }));
          }
          e.done && ((n = void 0), (i = void 0), (r = 0), (o = 0), (this._userSize = e.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._editor.addOverlayWidget(this), (this._added = !0));
  }
  hide(e = !1) {
    (this._resizable.clearSashHoverState(),
      this._added &&
        (this._editor.removeOverlayWidget(this),
        (this._added = !1),
        (this._anchorBox = void 0),
        (this._topLeft = void 0)),
      e && ((this._userSize = void 0), this.widget.clearContents()));
  }
  placeAtAnchor(e, t) {
    const n = e.getBoundingClientRect();
    ((this._anchorBox = n),
      (this._preferAlignAtTop = t),
      this._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, t));
  }
  _placeAtAnchor(e, t, n) {
    const i = iB(this.getDomNode().ownerDocument.body),
      r = this.widget.getLayoutInfo(),
      o = new oB(220, 2 * r.lineHeight),
      s = e.top,
      a = (function () {
        const n = i.width - (e.left + e.width + r.borderWidth + r.horizontalPadding),
          a = -r.borderWidth + e.left + e.width,
          l = new oB(n, i.height - e.top - r.borderHeight - r.verticalPadding),
          c = l.with(void 0, e.top + e.height - r.borderHeight - r.verticalPadding);
        return {
          top: s,
          left: a,
          fit: n - t.width,
          maxSizeTop: l,
          maxSizeBottom: c,
          minSize: o.with(Math.min(n, o.width)),
        };
      })(),
      l = (function () {
        const n = e.left - r.borderWidth - r.horizontalPadding,
          a = Math.max(r.horizontalPadding, e.left - t.width - r.borderWidth),
          l = new oB(n, i.height - e.top - r.borderHeight - r.verticalPadding),
          c = l.with(void 0, e.top + e.height - r.borderHeight - r.verticalPadding);
        return {
          top: s,
          left: a,
          fit: n - t.width,
          maxSizeTop: l,
          maxSizeBottom: c,
          minSize: o.with(Math.min(n, o.width)),
        };
      })(),
      c = (function () {
        const n = e.left,
          s = -r.borderWidth + e.top + e.height,
          a = new oB(e.width - r.borderHeight, i.height - e.top - e.height - r.verticalPadding);
        return {
          top: s,
          left: n,
          fit: a.height - t.height,
          maxSizeBottom: a,
          maxSizeTop: a,
          minSize: o.with(a.width),
        };
      })(),
      d = [a, l, c],
      u = d.find((e) => e.fit >= 0) ?? d.sort((e, t) => t.fit - e.fit)[0],
      h = e.top + e.height - r.borderHeight;
    let g,
      p = t.height;
    const f = Math.max(u.maxSizeTop.height, u.maxSizeBottom.height);
    let m;
    (p > f && (p = f),
      n
        ? p <= u.maxSizeTop.height
          ? ((g = !0), (m = u.maxSizeTop))
          : ((g = !1), (m = u.maxSizeBottom))
        : p <= u.maxSizeBottom.height
          ? ((g = !1), (m = u.maxSizeBottom))
          : ((g = !0), (m = u.maxSizeTop)));
    let { top: _, left: v } = u;
    !g && p > e.height && (_ = h - p);
    const b = this._editor.getDomNode();
    if (b) {
      const e = b.getBoundingClientRect();
      ((_ -= e.top), (v -= e.left));
    }
    (this._applyTopLeft({ left: v, top: _ }),
      this._resizable.enableSashes(!g, u === a, g, u !== a),
      (this._resizable.minSize = u.minSize),
      (this._resizable.maxSize = m),
      this._resizable.layout(p, Math.min(m.width, t.width)),
      this.widget.layout(this._resizable.size.width, this._resizable.size.height));
  }
  _applyTopLeft(e) {
    ((this._topLeft = e), this._editor.layoutOverlayWidget(this));
  }
}
const NIe = bV("fileService");
var LIe;
!(function (e) {
  ((e[(e.FILE = 0)] = "FILE"),
    (e[(e.FOLDER = 1)] = "FOLDER"),
    (e[(e.ROOT_FOLDER = 2)] = "ROOT_FOLDER"));
})(LIe || (LIe = {}));
const DIe = /(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;
function TIe(e, t, n, i, r) {
  if (AV.isThemeIcon(r)) return [`codicon-${r.id}`, "predefined-file-icon"];
  if (mP.isUri(r)) return [];
  const o =
    i === LIe.ROOT_FOLDER
      ? ["rootfolder-icon"]
      : i === LIe.FOLDER
        ? ["folder-icon"]
        : ["file-icon"];
  if (n) {
    let r;
    if (n.scheme === NP.data) {
      r = bH.parseMetaData(n).get(bH.META_DATA_LABEL);
    } else {
      const e = n.path.match(DIe);
      e
        ? ((r = IIe(e[2].toLowerCase())),
          e[1] && o.push(`${IIe(e[1].toLowerCase())}-name-dir-icon`))
        : (r = IIe(n.authority.toLowerCase()));
    }
    if (i === LIe.ROOT_FOLDER) o.push(`${r}-root-name-folder-icon`);
    else if (i === LIe.FOLDER) o.push(`${r}-name-folder-icon`);
    else {
      if (r) {
        if ((o.push(`${r}-name-file-icon`), o.push("name-file-icon"), r.length <= 255)) {
          const e = r.split(".");
          for (let t = 1; t < e.length; t++) o.push(`${e.slice(t).join(".")}-ext-file-icon`);
        }
        o.push("ext-file-icon");
      }
      const i = (function (e, t, n) {
        if (!n) return null;
        let i = null;
        if (n.scheme === NP.data) {
          const e = bH.parseMetaData(n).get(bH.META_DATA_MIME);
          e && (i = t.getLanguageIdByMimeType(e));
        } else {
          const t = e.getModel(n);
          t && (i = t.getLanguageId());
        }
        if (i && i !== a$) return i;
        return t.guessLanguageIdByFilepathOrFirstLine(n);
      })(e, t, n);
      i && o.push(`${IIe(i)}-lang-file-icon`);
    }
  }
  return o;
}
function IIe(e) {
  return e.replace(/[\s]/g, "/");
}
var RIe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const OIe = Zle(
    "suggest-more-info",
    OV.chevronRight,
    SI(1492, "Icon for more information in the suggest widget."),
  ),
  MIe = new (class e {
    static {
      this._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*\))/;
    }
    static {
      this._regexStrict = new RegExp(`^${e._regexRelaxed.source}$`, "i");
    }
    extract(t, n) {
      if (t.textLabel.match(e._regexStrict)) return ((n[0] = t.textLabel), !0);
      if (t.completion.detail && t.completion.detail.match(e._regexStrict))
        return ((n[0] = t.completion.detail), !0);
      if (t.completion.documentation) {
        const i =
            "string" == typeof t.completion.documentation
              ? t.completion.documentation
              : t.completion.documentation.value,
          r = e._regexRelaxed.exec(i);
        if (r && (0 === r.index || r.index + r[0].length === i.length)) return ((n[0] = r[0]), !0);
      }
      return !1;
    }
  })();
let AIe = class {
  constructor(e, t, n, i) {
    ((this._editor = e),
      (this._modelService = t),
      (this._languageService = n),
      (this._themeService = i),
      (this._onDidToggleDetails = new QO()),
      (this.onDidToggleDetails = this._onDidToggleDetails.event),
      (this.templateId = "suggestion"));
  }
  dispose() {
    this._onDidToggleDetails.dispose();
  }
  renderTemplate(e) {
    const t = new AO(),
      n = e;
    n.classList.add("show-file-icons");
    const i = MB(e, VB(".icon")),
      r = MB(i, VB("span.colorspan")),
      o = MB(e, VB(".contents")),
      s = MB(o, VB(".main")),
      a = MB(s, VB(".icon-label.codicon")),
      l = MB(s, VB("span.left")),
      c = MB(s, VB("span.right")),
      d = new $Ce(l, { supportHighlights: !0, supportIcons: !0 });
    t.add(d);
    const u = MB(l, VB("span.signature-label")),
      h = MB(l, VB("span.qualifier-label")),
      g = MB(c, VB("span.details-label")),
      p = MB(c, VB("span.readMore" + AV.asCSSSelector(OIe)));
    p.title = SI(1493, "Read More");
    return {
      root: n,
      left: l,
      right: c,
      icon: i,
      colorspan: r,
      iconLabel: d,
      iconContainer: a,
      parametersLabel: u,
      qualifierLabel: h,
      detailsLabel: g,
      readMore: p,
      disposables: t,
      configureFont: () => {
        const e = this._editor.getOptions(),
          t = e.get(59),
          r = t.getMassagedFontFamily(),
          o = t.fontFeatureSettings,
          a = t.fontVariationSettings,
          l = e.get(135) || t.fontSize,
          c = e.get(136) || t.lineHeight,
          d = t.fontWeight,
          u = `${l}px`,
          h = `${c}px`,
          g = `${t.letterSpacing}px`;
        ((n.style.fontSize = u),
          (n.style.fontWeight = d),
          (n.style.letterSpacing = g),
          (s.style.fontFamily = r),
          (s.style.fontFeatureSettings = o),
          (s.style.fontVariationSettings = a),
          (s.style.lineHeight = h),
          (i.style.height = h),
          (i.style.width = h),
          (p.style.height = h),
          (p.style.width = h));
      },
    };
  }
  renderElement(e, t, n) {
    n.configureFont();
    const { completion: i } = e;
    n.colorspan.style.backgroundColor = "";
    const r = { labelEscapeNewLines: !0, matches: Iie(e.score) },
      o = [];
    if (19 === i.kind && MIe.extract(e, o))
      ((n.icon.className = "icon customcolor"),
        (n.iconContainer.className = "icon hide"),
        (n.colorspan.style.backgroundColor = o[0]));
    else if (20 === i.kind && this._themeService.getFileIconTheme().hasFileIcons) {
      ((n.icon.className = "icon hide"), (n.iconContainer.className = "icon hide"));
      const t = TIe(
          this._modelService,
          this._languageService,
          mP.from({ scheme: "fake", path: e.textLabel }),
          LIe.FILE,
        ),
        o = TIe(
          this._modelService,
          this._languageService,
          mP.from({ scheme: "fake", path: i.detail }),
          LIe.FILE,
        );
      r.extraClasses = t.length > o.length ? t : o;
    } else
      23 === i.kind && this._themeService.getFileIconTheme().hasFolderIcons
        ? ((n.icon.className = "icon hide"),
          (n.iconContainer.className = "icon hide"),
          (r.extraClasses = [
            TIe(
              this._modelService,
              this._languageService,
              mP.from({ scheme: "fake", path: e.textLabel }),
              LIe.FOLDER,
            ),
            TIe(
              this._modelService,
              this._languageService,
              mP.from({ scheme: "fake", path: i.detail }),
              LIe.FOLDER,
            ),
          ].flat()))
        : ((n.icon.className = "icon hide"),
          (n.iconContainer.className = ""),
          n.iconContainer.classList.add("suggest-icon", ...AV.asClassNameArray(g2.toIcon(i.kind))));
    (i.tags &&
      i.tags.indexOf(1) >= 0 &&
      ((r.extraClasses = (r.extraClasses || []).concat(["deprecated"])), (r.matches = [])),
      n.iconLabel.setLabel(e.textLabel, void 0, r),
      "string" == typeof i.label
        ? ((n.parametersLabel.textContent = ""),
          (n.detailsLabel.textContent = PIe(i.detail || "")),
          n.root.classList.add("string-label"))
        : ((n.parametersLabel.textContent = PIe(i.label.detail || "")),
          (n.detailsLabel.textContent = PIe(i.label.description || "")),
          n.root.classList.remove("string-label")),
      this._editor.getOption(134).showInlineDetails ? WB(n.detailsLabel) : HB(n.detailsLabel),
      SIe(e)
        ? (n.right.classList.add("can-expand-details"),
          WB(n.readMore),
          (n.readMore.onmousedown = (e) => {
            (e.stopPropagation(), e.preventDefault());
          }),
          (n.readMore.onclick = (e) => {
            (e.stopPropagation(), e.preventDefault(), this._onDidToggleDetails.fire());
          }))
        : (n.right.classList.remove("can-expand-details"),
          HB(n.readMore),
          (n.readMore.onmousedown = null),
          (n.readMore.onclick = null)));
  }
  disposeTemplate(e) {
    e.disposables.dispose();
  }
};
function PIe(e) {
  return e.replace(/\r\n|\r|\n/g, "");
}
AIe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([RIe(1, wV), RIe(2, BU), RIe(3, h0)], AIe);
var jIe,
  FIe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
(SG("editorSuggestWidget.background", YG, SI(1473, "Background color of the suggest widget.")),
  SG("editorSuggestWidget.border", QG, SI(1474, "Border color of the suggest widget.")));
const BIe = SG(
  "editorSuggestWidget.foreground",
  ZG,
  SI(1475, "Foreground color of the suggest widget."),
);
(SG(
  "editorSuggestWidget.selectedForeground",
  VX,
  SI(1476, "Foreground color of the selected entry in the suggest widget."),
),
  SG(
    "editorSuggestWidget.selectedIconForeground",
    WX,
    SI(1477, "Icon foreground color of the selected entry in the suggest widget."),
  ));
const VIe = SG(
  "editorSuggestWidget.selectedBackground",
  HX,
  SI(1478, "Background color of the selected entry in the suggest widget."),
);
(SG(
  "editorSuggestWidget.highlightForeground",
  gX,
  SI(1479, "Color of the match highlights in the suggest widget."),
),
  SG(
    "editorSuggestWidget.focusHighlightForeground",
    pX,
    SI(1480, "Color of the match highlights in the suggest widget when an item is focused."),
  ),
  SG(
    "editorSuggestWidgetStatus.foreground",
    NG(BIe, 0.5),
    SI(1481, "Foreground color of the suggest widget status."),
  ));
class WIe {
  constructor(e, t) {
    ((this._service = e),
      (this._key = `suggestWidget.size/${t.getEditorType()}/${t instanceof Eye}`));
  }
  restore() {
    const e = this._service.get(this._key, 0) ?? "";
    try {
      const t = JSON.parse(e);
      if (oB.is(t)) return oB.lift(t);
    } catch {}
  }
  store(e) {
    this._service.store(this._key, JSON.stringify(e), 0, 1);
  }
  reset() {
    this._service.remove(this._key, 0);
  }
}
let HIe = class {
  static {
    jIe = this;
  }
  static {
    this.LOADING_MESSAGE = SI(1482, "Loading...");
  }
  static {
    this.NO_SUGGESTIONS_MESSAGE = SI(1483, "No suggestions.");
  }
  constructor(e, t, n, i, r) {
    ((this.editor = e),
      (this._storageService = t),
      (this._state = 0),
      (this._isAuto = !1),
      (this._pendingLayout = new jO()),
      (this._pendingShowDetails = new jO()),
      (this._ignoreFocusEvents = !1),
      (this._forceRenderingAbove = !1),
      (this._explainMode = !1),
      (this._showTimeout = new SM()),
      (this._disposables = new AO()),
      (this._onDidSelect = new eM()),
      (this._onDidFocus = new eM()),
      (this._onDidHide = new QO()),
      (this._onDidShow = new QO()),
      (this.onDidSelect = this._onDidSelect.event),
      (this.onDidFocus = this._onDidFocus.event),
      (this.onDidHide = this._onDidHide.event),
      (this.onDidShow = this._onDidShow.event),
      (this._onDetailsKeydown = new QO()),
      (this.onDetailsKeyDown = this._onDetailsKeydown.event),
      (this.element = new g_e()),
      this.element.domNode.classList.add("editor-widget", "suggest-widget"),
      (this._contentWidget = new zIe(this, e)),
      (this._persistedSize = new WIe(t, e)));
    class o {
      constructor(e, t, n = !1, i = !1) {
        ((this.persistedSize = e),
          (this.currentSize = t),
          (this.persistHeight = n),
          (this.persistWidth = i));
      }
    }
    let s;
    (this._disposables.add(
      this.element.onDidWillResize(() => {
        (this._contentWidget.lockPreference(),
          (s = new o(this._persistedSize.restore(), this.element.size)));
      }),
    ),
      this._disposables.add(
        this.element.onDidResize((e) => {
          if (
            (this._resize(e.dimension.width, e.dimension.height),
            s &&
              ((s.persistHeight = s.persistHeight || !!e.north || !!e.south),
              (s.persistWidth = s.persistWidth || !!e.east || !!e.west)),
            e.done)
          ) {
            if (s) {
              const { itemHeight: e, defaultSize: t } = this.getLayoutInfo(),
                n = Math.round(e / 2);
              let { width: i, height: r } = this.element.size;
              ((!s.persistHeight || Math.abs(s.currentSize.height - r) <= n) &&
                (r = s.persistedSize?.height ?? t.height),
                (!s.persistWidth || Math.abs(s.currentSize.width - i) <= n) &&
                  (i = s.persistedSize?.width ?? t.width),
                this._persistedSize.store(new oB(i, r)));
            }
            (this._contentWidget.unlockPreference(), (s = void 0));
          }
        }),
      ),
      (this._messageElement = MB(this.element.domNode, VB(".message"))),
      (this._listElement = MB(this.element.domNode, VB(".tree"))));
    const a = this._disposables.add(r.createInstance(kIe, this.editor));
    (a.onDidClose(() => this.toggleDetails(), this, this._disposables),
      (this._details = new EIe(a, this.editor)));
    const l = () =>
      this.element.domNode.classList.toggle("no-icons", !this.editor.getOption(134).showIcons);
    l();
    const c = r.createInstance(AIe, this.editor);
    (this._disposables.add(c),
      this._disposables.add(c.onDidToggleDetails(() => this.toggleDetails())),
      (this._list = new gle(
        "SuggestWidget",
        this._listElement,
        { getHeight: (e) => this.getLayoutInfo().itemHeight, getTemplateId: (e) => "suggestion" },
        [c],
        {
          alwaysConsumeMouseWheel: !0,
          useShadows: !1,
          mouseSupport: !1,
          multipleSelectionSupport: !1,
          accessibilityProvider: {
            getRole: () => (AR ? "listitem" : "option"),
            getWidgetAriaLabel: () => SI(1484, "Suggest"),
            getWidgetRole: () => "listbox",
            getAriaLabel: (e) => {
              let t = e.textLabel;
              const n = g2.toLabel(e.completion.kind);
              if ("string" != typeof e.completion.label) {
                const { detail: i, description: r } = e.completion.label;
                i && r
                  ? (t = SI(1485, "{0} {1}, {2}, {3}", t, i, r, n))
                  : i
                    ? (t = SI(1486, "{0} {1}, {2}", t, i, n))
                    : r && (t = SI(1487, "{0}, {1}, {2}", t, r, n));
              } else t = SI(1488, "{0}, {1}", t, n);
              if (!e.isResolved || !this._isDetailsVisible()) return t;
              const { documentation: i, detail: r } = e.completion;
              return SI(
                1489,
                "{0}, docs: {1}",
                t,
                WM("{0}{1}", r || "", i ? ("string" == typeof i ? i : i.value) : ""),
              );
            },
          },
        },
      )),
      this._list.style(_ue({ listInactiveFocusBackground: VIe, listInactiveFocusOutline: BG })),
      (this._status = r.createInstance(wIe, this.element.domNode, sLe)));
    const d = () =>
      this.element.domNode.classList.toggle(
        "with-status-bar",
        this.editor.getOption(134).showStatusBar,
      );
    (d(),
      this._disposables.add(this._list.onMouseDown((e) => this._onListMouseDownOrTap(e))),
      this._disposables.add(this._list.onTap((e) => this._onListMouseDownOrTap(e))),
      this._disposables.add(this._list.onDidChangeSelection((e) => this._onListSelection(e))),
      this._disposables.add(this._list.onDidChangeFocus((e) => this._onListFocus(e))),
      this._disposables.add(
        this.editor.onDidChangeCursorSelection(() => this._onCursorSelectionChanged()),
      ),
      this._disposables.add(
        this.editor.onDidChangeConfiguration((e) => {
          (e.hasChanged(134) && (d(), l()),
            this._completionModel &&
              (e.hasChanged(59) || e.hasChanged(135) || e.hasChanged(136)) &&
              this._list.splice(0, this._list.length, this._completionModel.items));
        }),
      ),
      (this._ctxSuggestWidgetVisible = oLe.Visible.bindTo(n)),
      (this._ctxSuggestWidgetDetailsVisible = oLe.DetailsVisible.bindTo(n)),
      (this._ctxSuggestWidgetMultipleSuggestions = oLe.MultipleSuggestions.bindTo(n)),
      (this._ctxSuggestWidgetHasFocusedSuggestion = oLe.HasFocusedSuggestion.bindTo(n)),
      this._disposables.add(
        KF(this._details.widget.domNode, "keydown", (e) => {
          this._onDetailsKeydown.fire(e);
        }),
      ),
      this._disposables.add(this.editor.onMouseDown((e) => this._onEditorMouseDown(e))));
  }
  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(e) {
    this._details.widget.domNode.contains(e.target.element)
      ? this._details.widget.domNode.focus()
      : this.element.domNode.contains(e.target.element) && this.editor.focus();
  }
  _onCursorSelectionChanged() {
    0 !== this._state && this._contentWidget.layout();
  }
  _onListMouseDownOrTap(e) {
    void 0 !== e.element &&
      void 0 !== e.index &&
      (e.browserEvent.preventDefault(),
      e.browserEvent.stopPropagation(),
      this._select(e.element, e.index));
  }
  _onListSelection(e) {
    e.elements.length && this._select(e.elements[0], e.indexes[0]);
  }
  _select(e, t) {
    const n = this._completionModel;
    n && (this._onDidSelect.fire({ item: e, index: t, model: n }), this.editor.focus());
  }
  _onListFocus(e) {
    if (this._ignoreFocusEvents) return;
    if ((5 === this._state && this._setState(3), !e.elements.length))
      return (
        this._currentSuggestionDetails &&
          (this._currentSuggestionDetails.cancel(),
          (this._currentSuggestionDetails = void 0),
          (this._focusedItem = void 0)),
        this.editor.setAriaOptions({ activeDescendant: void 0 }),
        void this._ctxSuggestWidgetHasFocusedSuggestion.set(!1)
      );
    if (!this._completionModel) return;
    this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);
    const t = e.elements[0],
      n = e.indexes[0];
    (t !== this._focusedItem &&
      (this._currentSuggestionDetails?.cancel(),
      (this._currentSuggestionDetails = void 0),
      (this._focusedItem = t),
      this._list.reveal(n),
      (this._currentSuggestionDetails = gM(async (e) => {
        const n = bM(() => {
            this._isDetailsVisible() && this._showDetails(!0, !1);
          }, 250),
          i = e.onCancellationRequested(() => n.dispose());
        try {
          return await t.resolve(e);
        } finally {
          (n.dispose(), i.dispose());
        }
      })),
      this._currentSuggestionDetails
        .then(() => {
          n >= this._list.length ||
            t !== this._list.element(n) ||
            ((this._ignoreFocusEvents = !0),
            this._list.splice(n, 1, [t]),
            this._list.setFocus([n]),
            (this._ignoreFocusEvents = !1),
            this._isDetailsVisible()
              ? this._showDetails(!1, !1)
              : this.element.domNode.classList.remove("docs-side"),
            this.editor.setAriaOptions({ activeDescendant: this._list.getElementID(n) }));
        })
        .catch(HI)),
      this._onDidFocus.fire({ item: t, index: n, model: this._completionModel }));
  }
  _setState(e) {
    if (this._state !== e)
      switch (
        ((this._state = e),
        this.element.domNode.classList.toggle("frozen", 4 === e),
        this.element.domNode.classList.remove("message"),
        e)
      ) {
        case 0:
          (HB(this._messageElement, this._listElement, this._status.element),
            this._details.hide(!0),
            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 = !1));
          break;
        case 1:
          (this.element.domNode.classList.add("message"),
            (this._messageElement.textContent = jIe.LOADING_MESSAGE),
            HB(this._listElement, this._status.element),
            WB(this._messageElement),
            this._details.hide(),
            this._show(),
            (this._focusedItem = void 0),
            fV(jIe.LOADING_MESSAGE));
          break;
        case 2:
          (this.element.domNode.classList.add("message"),
            (this._messageElement.textContent = jIe.NO_SUGGESTIONS_MESSAGE),
            HB(this._listElement, this._status.element),
            WB(this._messageElement),
            this._details.hide(),
            this._show(),
            (this._focusedItem = void 0),
            fV(jIe.NO_SUGGESTIONS_MESSAGE));
          break;
        case 3:
        case 4:
          (HB(this._messageElement), WB(this._listElement, this._status.element), this._show());
          break;
        case 5:
          (HB(this._messageElement),
            WB(this._listElement, this._status.element),
            this._details.show(),
            this._show(),
            this._details.widget.focus());
      }
  }
  _show() {
    (this._status.show(),
      this._contentWidget.show(),
      this._layout(this._persistedSize.restore()),
      this._ctxSuggestWidgetVisible.set(!0),
      this._showTimeout.cancelAndSet(() => {
        (this.element.domNode.classList.add("visible"), this._onDidShow.fire(this));
      }, 100));
  }
  showTriggered(e, t) {
    0 === this._state &&
      (this._contentWidget.setPosition(this.editor.getPosition()),
      (this._isAuto = !!e),
      this._isAuto || (this._loadingTimeout = bM(() => this._setState(1), t)));
  }
  showSuggestions(e, t, n, i, r) {
    if (
      (this._contentWidget.setPosition(this.editor.getPosition()),
      this._loadingTimeout?.dispose(),
      this._currentSuggestionDetails?.cancel(),
      (this._currentSuggestionDetails = void 0),
      this._completionModel !== e && (this._completionModel = e),
      n && 2 !== this._state && 0 !== this._state)
    )
      return void this._setState(4);
    const o = this._completionModel.items.length,
      s = 0 === o;
    if ((this._ctxSuggestWidgetMultipleSuggestions.set(o > 1), s))
      return (this._setState(i ? 0 : 2), void (this._completionModel = void 0));
    ((this._focusedItem = void 0), this._onDidFocus.pause(), this._onDidSelect.pause());
    try {
      (this._list.splice(0, this._list.length, this._completionModel.items),
        this._setState(n ? 4 : 3),
        this._list.reveal(t, 0, 0 === t ? 0 : 0.33 * this.getLayoutInfo().itemHeight),
        this._list.setFocus(r ? [] : [t]));
    } finally {
      (this._onDidFocus.resume(), this._onDidSelect.resume());
    }
    this._pendingLayout.value = QF(MF(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 !1;
      case 5:
        return (this._details.widget.pageDown(), !0);
      case 1:
        return !this._isAuto;
      default:
        return (this._list.focusNextPage(), !0);
    }
  }
  selectNext() {
    switch (this._state) {
      case 0:
        return !1;
      case 1:
        return !this._isAuto;
      default:
        return (this._list.focusNext(1, !0), !0);
    }
  }
  selectLast() {
    switch (this._state) {
      case 0:
        return !1;
      case 5:
        return (this._details.widget.scrollBottom(), !0);
      case 1:
        return !this._isAuto;
      default:
        return (this._list.focusLast(), !0);
    }
  }
  selectPreviousPage() {
    switch (this._state) {
      case 0:
        return !1;
      case 5:
        return (this._details.widget.pageUp(), !0);
      case 1:
        return !this._isAuto;
      default:
        return (this._list.focusPreviousPage(), !0);
    }
  }
  selectPrevious() {
    switch (this._state) {
      case 0:
        return !1;
      case 1:
        return !this._isAuto;
      default:
        return (this._list.focusPrevious(1, !0), !1);
    }
  }
  selectFirst() {
    switch (this._state) {
      case 0:
        return !1;
      case 5:
        return (this._details.widget.scrollTop(), !0);
      case 1:
        return !this._isAuto;
      default:
        return (this._list.focusFirst(), !0);
    }
  }
  getFocusedItem() {
    if (
      0 !== this._state &&
      2 !== this._state &&
      1 !== this._state &&
      this._completionModel &&
      this._list.getFocus().length > 0
    )
      return {
        item: this._list.getFocusedElements()[0],
        index: this._list.getFocus()[0],
        model: this._completionModel,
      };
  }
  toggleDetailsFocus() {
    5 === this._state
      ? (this._list.setFocus(this._list.getFocus()), this._setState(3))
      : 3 === this._state &&
        (this._setState(5),
        this._isDetailsVisible() ? this._details.widget.focus() : this.toggleDetails(!0));
  }
  toggleDetails(e = !1) {
    this._isDetailsVisible()
      ? (this._pendingShowDetails.clear(),
        this._ctxSuggestWidgetDetailsVisible.set(!1),
        this._setDetailsVisible(!1),
        this._details.hide(),
        this.element.domNode.classList.remove("shows-details"))
      : (!SIe(this._list.getFocusedElements()[0]) && !this._explainMode) ||
        (3 !== this._state && 5 !== this._state && 4 !== this._state) ||
        (this._ctxSuggestWidgetDetailsVisible.set(!0),
        this._setDetailsVisible(!0),
        this._showDetails(!1, e));
  }
  _showDetails(e, t) {
    this._pendingShowDetails.value = QF(MF(this.element.domNode), () => {
      (this._pendingShowDetails.clear(), this._details.show());
      let n = !1;
      (e
        ? 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"),
            t && (this._details.widget.focus(), (n = !0))),
        n || this.editor.focus());
    });
  }
  toggleExplainMode() {
    this._list.getFocusedElements()[0] &&
      ((this._explainMode = !this._explainMode),
      this._isDetailsVisible() ? this._showDetails(!1, !1) : 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());
    const e = this._persistedSize.restore(),
      t = Math.ceil(4.3 * this.getLayoutInfo().itemHeight);
    e && e.height < t && this._persistedSize.store(e.with(void 0, t));
  }
  isFrozen() {
    return 4 === this._state;
  }
  _afterRender(e) {
    null !== e
      ? 2 !== this._state &&
        1 !== this._state &&
        (this._isDetailsVisible() && !this._details.widget.isEmpty && this._details.show(),
        this._positionDetails())
      : this._isDetailsVisible() && this._details.hide();
  }
  _layout(e) {
    if (!this.editor.hasModel()) return;
    if (!this.editor.getDomNode()) return;
    const t = iB(this.element.domNode.ownerDocument.body),
      n = this.getLayoutInfo();
    e || (e = n.defaultSize);
    let i = e.height,
      r = e.width;
    if (
      ((this._status.element.style.height = `${n.itemHeight}px`),
      2 === this._state || 1 === this._state)
    )
      ((i = n.itemHeight + n.borderHeight),
        (r = n.defaultSize.width / 2),
        this.element.enableSashes(!1, !1, !1, !1),
        (this.element.minSize = this.element.maxSize = new oB(r, i)),
        this._contentWidget.setPreference(2));
    else {
      const o = t.width - n.borderHeight - 2 * n.horizontalPadding;
      r > o && (r = o);
      const s = this._completionModel
          ? this._completionModel.stats.pLabelLen * n.typicalHalfwidthCharacterWidth
          : r,
        a = n.statusBarHeight + this._list.contentHeight + n.borderHeight,
        l = n.itemHeight + n.statusBarHeight,
        c = aB(this.editor.getDomNode()),
        d = this.editor.getScrolledVisiblePosition(this.editor.getPosition()),
        u = c.top + d.top + d.height,
        h = Math.min(t.height - u - n.verticalPadding, a),
        g = c.top + d.top - n.verticalPadding,
        p = Math.min(g, a);
      let f = Math.min(Math.max(p, h) + n.borderHeight, a);
      (i === this._cappedHeight?.capped && (i = this._cappedHeight.wanted),
        i < l && (i = l),
        i > f && (i = f));
      const m = 150;
      ((i > h && p > h) || (this._forceRenderingAbove && g > m)
        ? (this._contentWidget.setPreference(1), this.element.enableSashes(!0, !0, !1, !1), (f = p))
        : (this._contentWidget.setPreference(2),
          this.element.enableSashes(!1, !0, !0, !1),
          (f = h)),
        (this.element.preferredSize = new oB(s, n.defaultSize.height)),
        (this.element.maxSize = new oB(o, f)),
        (this.element.minSize = new oB(220, l)),
        (this._cappedHeight =
          i === a ? { wanted: this._cappedHeight?.wanted ?? e.height, capped: i } : void 0));
    }
    this._resize(r, i);
  }
  _resize(e, t) {
    const { width: n, height: i } = this.element.maxSize;
    ((e = Math.min(n, e)), (t = Math.min(i, t)));
    const { statusBarHeight: r } = this.getLayoutInfo();
    (this._list.layout(t - r, e),
      (this._listElement.style.height = t - r + "px"),
      this.element.layout(t, e),
      this._contentWidget.layout(),
      this._positionDetails());
  }
  _positionDetails() {
    this._isDetailsVisible() &&
      this._details.placeAtAnchor(
        this.element.domNode,
        2 === this._contentWidget.getPosition()?.preference[0],
      );
  }
  getLayoutInfo() {
    const e = this.editor.getOption(59),
      t = wae(this.editor.getOption(136) || e.lineHeight, 8, 1e3),
      n =
        this.editor.getOption(134).showStatusBar && 2 !== this._state && 1 !== this._state ? t : 0,
      i = this._details.widget.getLayoutInfo().borderWidth;
    return {
      itemHeight: t,
      statusBarHeight: n,
      borderWidth: i,
      borderHeight: 2 * i,
      typicalHalfwidthCharacterWidth: e.typicalHalfwidthCharacterWidth,
      verticalPadding: 22,
      horizontalPadding: 14,
      defaultSize: new oB(430, n + 12 * t),
    };
  }
  _isDetailsVisible() {
    return this._storageService.getBoolean("expandSuggestionDocs", 0, !1);
  }
  _setDetailsVisible(e) {
    this._storageService.store("expandSuggestionDocs", e, 0, 0);
  }
  forceRenderingAbove() {
    this._forceRenderingAbove ||
      ((this._forceRenderingAbove = !0), this._layout(this._persistedSize.restore()));
  }
  stopForceRenderingAbove() {
    this._forceRenderingAbove = !1;
  }
};
HIe = jIe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([FIe(1, oue), FIe(2, xW), FIe(3, h0), FIe(4, vV)], HIe);
class zIe {
  constructor(e, t) {
    ((this._widget = e),
      (this._editor = t),
      (this.allowEditorOverflow = !0),
      (this.suppressMouseDown = !1),
      (this._preferenceLocked = !1),
      (this._added = !1),
      (this._hidden = !1));
  }
  dispose() {
    this._added && ((this._added = !1), this._editor.removeContentWidget(this));
  }
  getId() {
    return "editor.widget.suggestWidget";
  }
  getDomNode() {
    return this._widget.element.domNode;
  }
  show() {
    ((this._hidden = !1), this._added || ((this._added = !0), this._editor.addContentWidget(this)));
  }
  hide() {
    this._hidden || ((this._hidden = !0), this.layout());
  }
  layout() {
    this._editor.layoutContentWidget(this);
  }
  getPosition() {
    return !this._hidden && this._position && this._preference
      ? { position: this._position, preference: [this._preference] }
      : null;
  }
  beforeRender() {
    const { height: e, width: t } = this._widget.element.size,
      { borderWidth: n, horizontalPadding: i } = this._widget.getLayoutInfo();
    return new oB(t + 2 * n + i, e + 2 * n);
  }
  afterRender(e) {
    this._widget._afterRender(e);
  }
  setPreference(e) {
    this._preferenceLocked || (this._preference = e);
  }
  lockPreference() {
    this._preferenceLocked = !0;
  }
  unlockPreference() {
    this._preferenceLocked = !1;
  }
  setPosition(e) {
    this._position = e;
  }
}
var UIe,
  $Ie = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class qIe {
  constructor(e, t) {
    ((this._model = e),
      (this._position = t),
      (this._decorationOptions = cee.register({
        description: "suggest-line-suffix",
        stickiness: 1,
      })));
    if (e.getLineMaxColumn(t.lineNumber) !== t.column) {
      const n = e.getOffsetAt(t),
        i = e.getPositionAt(n + 1);
      e.changeDecorations((e) => {
        (this._marker && e.removeDecoration(this._marker),
          (this._marker = e.addDecoration(YH.fromPositions(t, i), this._decorationOptions)));
      });
    }
  }
  dispose() {
    this._marker &&
      !this._model.isDisposed() &&
      this._model.changeDecorations((e) => {
        (e.removeDecoration(this._marker), (this._marker = void 0));
      });
  }
  delta(e) {
    if (this._model.isDisposed() || this._position.lineNumber !== e.lineNumber) return 0;
    if (this._marker) {
      const t = this._model.getDecorationRange(this._marker);
      return this._model.getOffsetAt(t.getStartPosition()) - this._model.getOffsetAt(e);
    }
    return this._model.getLineMaxColumn(e.lineNumber) - e.column;
  }
}
let KIe = class {
  static {
    UIe = this;
  }
  static {
    this.ID = "editor.contrib.suggestController";
  }
  static get(e) {
    return e.getContribution(UIe.ID);
  }
  get onWillInsertSuggestItem() {
    return this._onWillInsertSuggestItem.event;
  }
  constructor(e, t, n, i, r, o, s) {
    ((this._memoryService = t),
      (this._commandService = n),
      (this._contextKeyService = i),
      (this._instantiationService = r),
      (this._logService = o),
      (this._telemetryService = s),
      (this._lineSuffix = new jO()),
      (this._toDispose = new AO()),
      (this._selectors = new GIe((e) => e.priority)),
      (this._onWillInsertSuggestItem = new QO()),
      (this._wantsForceRenderingAbove = !1),
      (this.editor = e),
      (this.model = r.createInstance(bIe, this.editor)),
      this._selectors.register({
        priority: 0,
        select: (e, t, n) => this._memoryService.select(e, t, n),
      }));
    const a = oLe.InsertMode.bindTo(i);
    (a.set(e.getOption(134).insertMode),
      this._toDispose.add(this.model.onDidTrigger(() => a.set(e.getOption(134).insertMode))),
      (this.widget = this._toDispose.add(
        new XF(MF(e.getDomNode()), () => {
          const e = this._instantiationService.createInstance(HIe, this.editor);
          (this._toDispose.add(e),
            this._toDispose.add(e.onDidSelect((e) => this._insertSuggestion(e, 0), this)));
          const t = new uIe(this.editor, e, this.model, (e) => this._insertSuggestion(e, 2));
          this._toDispose.add(t);
          const n = oLe.MakesTextEdit.bindTo(this._contextKeyService),
            i = oLe.HasInsertAndReplaceRange.bindTo(this._contextKeyService),
            r = oLe.CanResolve.bindTo(this._contextKeyService);
          return (
            this._toDispose.add(
              MO(() => {
                (n.reset(), i.reset(), r.reset());
              }),
            ),
            this._toDispose.add(
              e.onDidFocus(({ item: e }) => {
                const t = this.editor.getPosition(),
                  o = e.editStart.column,
                  s = t.column;
                let a = !0;
                if (
                  !(
                    "smart" !== this.editor.getOption(1) ||
                    2 !== this.model.state ||
                    e.completion.additionalTextEdits ||
                    4 & e.completion.insertTextRules ||
                    s - o !== e.completion.insertText.length
                  )
                ) {
                  a =
                    this.editor
                      .getModel()
                      .getValueInRange({
                        startLineNumber: t.lineNumber,
                        startColumn: o,
                        endLineNumber: t.lineNumber,
                        endColumn: s,
                      }) !== e.completion.insertText;
                }
                (n.set(a),
                  i.set(!xV.equals(e.editInsertEnd, e.editReplaceEnd)),
                  r.set(
                    Boolean(e.provider.resolveCompletionItem) ||
                      Boolean(e.completion.documentation) ||
                      e.completion.detail !== e.completion.label,
                  ));
              }),
            ),
            this._toDispose.add(
              e.onDetailsKeyDown((e) => {
                e.toKeyCodeChord().equals(new mO(!0, !1, !1, !1, 33)) ||
                (PR && e.toKeyCodeChord().equals(new mO(!1, !1, !1, !0, 33)))
                  ? e.stopPropagation()
                  : e.toKeyCodeChord().isModifierKey() || this.editor.focus();
              }),
            ),
            this._wantsForceRenderingAbove && e.forceRenderingAbove(),
            e
          );
        }),
      )),
      (this._overtypingCapturer = this._toDispose.add(
        new XF(MF(e.getDomNode()), () => this._toDispose.add(new yIe(this.editor, this.model))),
      )),
      (this._alternatives = this._toDispose.add(
        new XF(MF(e.getDomNode()), () =>
          this._toDispose.add(new dIe(this.editor, this._contextKeyService)),
        ),
      )),
      this._toDispose.add(r.createInstance(lIe, e)),
      this._toDispose.add(
        this.model.onDidTrigger((e) => {
          (this.widget.value.showTriggered(e.auto, e.shy ? 250 : 50),
            (this._lineSuffix.value = new qIe(this.editor.getModel(), e.position)));
        }),
      ),
      this._toDispose.add(
        this.model.onDidSuggest((e) => {
          if (e.triggerOptions.shy) return;
          let t = -1;
          for (const i of this._selectors.itemsOrderedByPriorityDesc)
            if (
              ((t = i.select(
                this.editor.getModel(),
                this.editor.getPosition(),
                e.completionModel.items,
              )),
              -1 !== t)
            )
              break;
          if ((-1 === t && (t = 0), 0 === this.model.state)) return;
          let n = !1;
          if (e.triggerOptions.auto) {
            const t = this.editor.getOption(134);
            "never" === t.selectionMode || "always" === t.selectionMode
              ? (n = "never" === t.selectionMode)
              : "whenTriggerCharacter" === t.selectionMode
                ? (n = 1 !== e.triggerOptions.triggerKind)
                : "whenQuickSuggestion" === t.selectionMode &&
                  (n = 1 === e.triggerOptions.triggerKind && !e.triggerOptions.refilter);
          }
          this.widget.value.showSuggestions(
            e.completionModel,
            t,
            e.isFrozen,
            e.triggerOptions.auto,
            n,
          );
        }),
      ),
      this._toDispose.add(
        this.model.onDidCancel((e) => {
          e.retrigger || this.widget.value.hideWidget();
        }),
      ),
      this._toDispose.add(
        this.editor.onDidBlurEditorWidget(() => {
          (this.model.cancel(), this.model.clear());
        }),
      ));
    const l = oLe.AcceptSuggestionsOnEnter.bindTo(i),
      c = () => {
        const e = this.editor.getOption(1);
        l.set("on" === e || "smart" === e);
      };
    (this._toDispose.add(this.editor.onDidChangeConfiguration(() => c())), c());
  }
  dispose() {
    (this._alternatives.dispose(),
      this._toDispose.dispose(),
      this.widget.dispose(),
      this.model.dispose(),
      this._lineSuffix.dispose(),
      this._onWillInsertSuggestItem.dispose());
  }
  _insertSuggestion(e, t) {
    if (!e || !e.item)
      return (this._alternatives.value.reset(), this.model.cancel(), void this.model.clear());
    if (!this.editor.hasModel()) return;
    const n = iDe.get(this.editor);
    if (!n) return;
    this._onWillInsertSuggestItem.fire({ item: e.item });
    const i = this.editor.getModel(),
      r = i.getAlternativeVersionId(),
      { item: o } = e,
      s = [],
      a = new cM();
    1 & t || this.editor.pushUndoStop();
    const l = this.getOverwriteInfo(o, Boolean(8 & t));
    this._memoryService.memorize(i, this.editor.getPosition(), o);
    const c = o.isResolved;
    let d = -1,
      u = -1;
    if (Array.isArray(o.completion.additionalTextEdits)) {
      this.model.cancel();
      const e = Mne.capture(this.editor);
      (this.editor.executeEdits(
        "suggestController.additionalTextEdits.sync",
        o.completion.additionalTextEdits.map((e) => {
          let t = YH.lift(e.range);
          if (t.startLineNumber === o.position.lineNumber && t.startColumn > o.position.column) {
            const e = this.editor.getPosition().column - o.position.column,
              n = e,
              i = YH.spansMultipleLines(t) ? 0 : e;
            t = new YH(t.startLineNumber, t.startColumn + n, t.endLineNumber, t.endColumn + i);
          }
          return hye.replaceMove(t, e.text);
        }),
      ),
        e.restoreRelativeVerticalPositionOfCursor(this.editor));
    } else if (!c) {
      const e = new UO();
      let n;
      const r = i.onDidChangeContent((e) => {
          if (e.isFlush) return (a.cancel(), void r.dispose());
          for (const t of e.changes) {
            const e = YH.getEndPosition(t.range);
            (n && !xV.isBefore(e, n)) || (n = e);
          }
        }),
        l = t;
      t |= 2;
      let c = !1;
      const d = this.editor.onWillType(() => {
        (d.dispose(), (c = !0), 2 & l || this.editor.pushUndoStop());
      });
      s.push(
        o
          .resolve(a.token)
          .then(() => {
            if (!o.completion.additionalTextEdits || a.token.isCancellationRequested) return;
            if (
              n &&
              o.completion.additionalTextEdits.some((e) =>
                xV.isBefore(n, YH.getStartPosition(e.range)),
              )
            )
              return !1;
            c && this.editor.pushUndoStop();
            const e = Mne.capture(this.editor);
            return (
              this.editor.executeEdits(
                "suggestController.additionalTextEdits.async",
                o.completion.additionalTextEdits.map((e) =>
                  hye.replaceMove(YH.lift(e.range), e.text),
                ),
              ),
              e.restoreRelativeVerticalPositionOfCursor(this.editor),
              (!c && 2 & l) || this.editor.pushUndoStop(),
              !0
            );
          })
          .then((t) => {
            (this._logService.trace(
              "[suggest] async resolving of edits DONE (ms, applied?)",
              e.elapsed(),
              t,
            ),
              (u = !0 === t ? 1 : !1 === t ? 0 : -2));
          })
          .finally(() => {
            (r.dispose(), d.dispose());
          }),
      );
    }
    let { insertText: h } = o.completion;
    if (
      (4 & o.completion.insertTextRules || (h = ape.escape(h)),
      this.model.cancel(),
      n.insert(h, {
        overwriteBefore: l.overwriteBefore,
        overwriteAfter: l.overwriteAfter,
        undoStopBefore: !1,
        undoStopAfter: !1,
        adjustWhitespace: !(1 & o.completion.insertTextRules),
        clipboardText: e.model.clipboardText,
        overtypingCapturer: this._overtypingCapturer.value,
        reason: m8.suggest({ providerId: x2.fromExtensionId(o.extensionId?.value) }),
      }),
      2 & t || this.editor.pushUndoStop(),
      o.completion.command)
    )
      if (o.completion.command.id === ZIe.id) this.model.trigger({ auto: !0, retrigger: !0 });
      else {
        const e = new UO();
        s.push(
          this._commandService
            .executeCommand(
              o.completion.command.id,
              ...(o.completion.command.arguments ? [...o.completion.command.arguments] : []),
            )
            .catch((e) => {
              o.completion.extensionId ? zI(e) : HI(e);
            })
            .finally(() => {
              d = e.elapsed();
            }),
        );
      }
    (4 & t &&
      this._alternatives.value.set(e, (e) => {
        for (a.cancel(); i.canUndo(); ) {
          (r !== i.getAlternativeVersionId() && i.undo(),
            this._insertSuggestion(e, 3 | (8 & t ? 8 : 0)));
          break;
        }
      }),
      this._alertCompletionItem(o),
      Promise.all(s).finally(() => {
        (this._reportSuggestionAcceptedTelemetry(o, i, c, d, u, e.index, e.model.items),
          this.model.clear(),
          a.dispose());
      }));
  }
  _reportSuggestionAcceptedTelemetry(e, t, n, i, r, o, s) {
    if (Math.random() > 1e-4) return;
    const a = new Map();
    for (let d = 0; d < Math.min(30, s.length); d++) {
      const e = s[d].textLabel;
      a.has(e) ? a.get(e).push(d) : a.set(e, [d]);
    }
    const l = a.get(e.textLabel),
      c = l && l.length > 1 ? l[0] : -1;
    this._telemetryService.publicLog2("suggest.acceptedSuggestion", {
      extensionId: e.extensionId?.value ?? "unknown",
      providerId: e.provider._debugDisplayName ?? "unknown",
      kind: e.completion.kind,
      basenameHash: UP(dH(t.uri)).toString(16),
      languageId: t.getLanguageId(),
      fileExtension: uH(t.uri),
      resolveInfo: e.provider.resolveCompletionItem ? (n ? 1 : 0) : -1,
      resolveDuration: e.resolveDuration,
      commandDuration: i,
      additionalEditsAsync: r,
      index: o,
      firstIndex: c,
    });
  }
  getOverwriteInfo(e, t) {
    pR(this.editor.hasModel());
    let n = "replace" === this.editor.getOption(134).insertMode;
    t && (n = !n);
    const i = e.position.column - e.editStart.column,
      r = (n ? e.editReplaceEnd.column : e.editInsertEnd.column) - e.position.column;
    return {
      overwriteBefore: i + (this.editor.getPosition().column - e.position.column),
      overwriteAfter:
        r + (this._lineSuffix.value ? this._lineSuffix.value.delta(this.editor.getPosition()) : 0),
    };
  }
  _alertCompletionItem(e) {
    if (aj(e.completion.additionalTextEdits)) {
      pV(
        SI(
          1463,
          "Accepting '{0}' made {1} additional edits",
          e.textLabel,
          e.completion.additionalTextEdits.length,
        ),
      );
    }
  }
  triggerSuggest(e, t, n) {
    this.editor.hasModel() &&
      (this.model.trigger({
        auto: t ?? !1,
        completionOptions: { providerFilter: e, kindFilter: n ? new Set() : void 0 },
      }),
      this.editor.revealPosition(this.editor.getPosition(), 0),
      this.editor.focus());
  }
  triggerSuggestAndAcceptBest(e) {
    if (!this.editor.hasModel()) return;
    const t = this.editor.getPosition(),
      n = () => {
        t.equals(this.editor.getPosition()) && this._commandService.executeCommand(e.fallback);
      },
      i = (e) => {
        if (4 & e.completion.insertTextRules || e.completion.additionalTextEdits) return !0;
        const t = this.editor.getPosition(),
          n = e.editStart.column,
          i = t.column;
        if (i - n !== e.completion.insertText.length) return !0;
        return (
          this.editor
            .getModel()
            .getValueInRange({
              startLineNumber: t.lineNumber,
              startColumn: n,
              endLineNumber: t.lineNumber,
              endColumn: i,
            }) !== e.completion.insertText
        );
      };
    ($O.once(this.model.onDidTrigger)((e) => {
      const t = [];
      ($O.any(this.model.onDidTrigger, this.model.onDidCancel)(
        () => {
          (IO(t), n());
        },
        void 0,
        t,
      ),
        this.model.onDidSuggest(
          ({ completionModel: e }) => {
            if ((IO(t), 0 === e.items.length)) return void n();
            const r = this._memoryService.select(
                this.editor.getModel(),
                this.editor.getPosition(),
                e.items,
              ),
              o = e.items[r];
            i(o)
              ? (this.editor.pushUndoStop(),
                this._insertSuggestion({ index: r, item: o, model: e }, 7))
              : n();
          },
          void 0,
          t,
        ));
    }),
      this.model.trigger({ auto: !1, shy: !0 }),
      this.editor.revealPosition(t, 0),
      this.editor.focus());
  }
  acceptSelectedSuggestion(e, t) {
    const n = this.widget.value.getFocusedItem();
    let i = 0;
    (e && (i |= 4), t && (i |= 8), this._insertSuggestion(n, i));
  }
  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 = !0);
  }
  stopForceRenderingAbove() {
    this.widget.isInitialized
      ? this.widget.value.stopForceRenderingAbove()
      : (this._wantsForceRenderingAbove = !1);
  }
  registerSelector(e) {
    return this._selectors.register(e);
  }
};
KIe = UIe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([$Ie(1, sIe), $Ie(2, PV), $Ie(3, xW), $Ie(4, vV), $Ie(5, yH), $Ie(6, HW)], KIe);
class GIe {
  constructor(e) {
    ((this.prioritySelector = e), (this._items = new Array()));
  }
  register(e) {
    if (-1 !== this._items.indexOf(e)) throw new Error("Value is already registered");
    return (
      this._items.push(e),
      this._items.sort((e, t) => this.prioritySelector(t) - this.prioritySelector(e)),
      {
        dispose: () => {
          const t = this._items.indexOf(e);
          t >= 0 && this._items.splice(t, 1);
        },
      }
    );
  }
  get itemsOrderedByPriorityDesc() {
    return this._items;
  }
}
class ZIe extends AH {
  static {
    this.id = "editor.action.triggerSuggest";
  }
  constructor() {
    super({
      id: ZIe.id,
      label: EI(1471, "Trigger Suggest"),
      precondition: eW.and($$.writable, $$.hasCompletionItemProvider, oLe.Visible.toNegated()),
      kbOpts: {
        kbExpr: $$.textInputFocus,
        primary: 2058,
        secondary: [2087],
        mac: { primary: 266, secondary: [521, 2087] },
        weight: 100,
      },
    });
  }
  run(e, t, n) {
    const i = KIe.get(t);
    if (!i) return;
    let r;
    (n && "object" == typeof n && !0 === n.auto && (r = !0), i.triggerSuggest(void 0, r, void 0));
  }
}
(zH(KIe.ID, KIe, 2), VH(ZIe));
const YIe = 190,
  XIe = MH.bindToContribution(KIe.get);
(BH(
  new XIe({
    id: "acceptSelectedSuggestion",
    precondition: eW.and(oLe.Visible, oLe.HasFocusedSuggestion),
    handler(e) {
      e.acceptSelectedSuggestion(!0, !1);
    },
    kbOpts: [
      { primary: 2, kbExpr: eW.and(oLe.Visible, $$.textInputFocus), weight: YIe },
      {
        primary: 3,
        kbExpr: eW.and(
          oLe.Visible,
          $$.textInputFocus,
          oLe.AcceptSuggestionsOnEnter,
          oLe.MakesTextEdit,
        ),
        weight: YIe,
      },
    ],
    menuOpts: [
      {
        menuId: sLe,
        title: SI(1464, "Insert"),
        group: "left",
        order: 1,
        when: oLe.HasInsertAndReplaceRange.toNegated(),
      },
      {
        menuId: sLe,
        title: SI(1465, "Insert"),
        group: "left",
        order: 1,
        when: eW.and(oLe.HasInsertAndReplaceRange, oLe.InsertMode.isEqualTo("insert")),
      },
      {
        menuId: sLe,
        title: SI(1466, "Replace"),
        group: "left",
        order: 1,
        when: eW.and(oLe.HasInsertAndReplaceRange, oLe.InsertMode.isEqualTo("replace")),
      },
    ],
  }),
),
  BH(
    new XIe({
      id: "acceptAlternativeSelectedSuggestion",
      precondition: eW.and(oLe.Visible, $$.textInputFocus, oLe.HasFocusedSuggestion),
      kbOpts: { weight: YIe, kbExpr: $$.textInputFocus, primary: 1027, secondary: [1026] },
      handler(e) {
        e.acceptSelectedSuggestion(!1, !0);
      },
      menuOpts: [
        {
          menuId: sLe,
          group: "left",
          order: 2,
          when: eW.and(oLe.HasInsertAndReplaceRange, oLe.InsertMode.isEqualTo("insert")),
          title: SI(1467, "Replace"),
        },
        {
          menuId: sLe,
          group: "left",
          order: 2,
          when: eW.and(oLe.HasInsertAndReplaceRange, oLe.InsertMode.isEqualTo("replace")),
          title: SI(1468, "Insert"),
        },
      ],
    }),
  ),
  jV.registerCommandAlias("acceptSelectedSuggestionOnEnter", "acceptSelectedSuggestion"),
  BH(
    new XIe({
      id: "hideSuggestWidget",
      precondition: oLe.Visible,
      handler: (e) => e.cancelSuggestWidget(),
      kbOpts: { weight: YIe, kbExpr: $$.textInputFocus, primary: 9, secondary: [1033] },
    }),
  ),
  BH(
    new XIe({
      id: "selectNextSuggestion",
      precondition: eW.and(
        oLe.Visible,
        eW.or(oLe.MultipleSuggestions, oLe.HasFocusedSuggestion.negate()),
      ),
      handler: (e) => e.selectNextSuggestion(),
      kbOpts: {
        weight: YIe,
        kbExpr: $$.textInputFocus,
        primary: 18,
        secondary: [2066],
        mac: { primary: 18, secondary: [2066, 300] },
      },
    }),
  ),
  BH(
    new XIe({
      id: "selectNextPageSuggestion",
      precondition: eW.and(
        oLe.Visible,
        eW.or(oLe.MultipleSuggestions, oLe.HasFocusedSuggestion.negate()),
      ),
      handler: (e) => e.selectNextPageSuggestion(),
      kbOpts: { weight: YIe, kbExpr: $$.textInputFocus, primary: 12, secondary: [2060] },
    }),
  ),
  BH(
    new XIe({
      id: "selectLastSuggestion",
      precondition: eW.and(
        oLe.Visible,
        eW.or(oLe.MultipleSuggestions, oLe.HasFocusedSuggestion.negate()),
      ),
      handler: (e) => e.selectLastSuggestion(),
    }),
  ),
  BH(
    new XIe({
      id: "selectPrevSuggestion",
      precondition: eW.and(
        oLe.Visible,
        eW.or(oLe.MultipleSuggestions, oLe.HasFocusedSuggestion.negate()),
      ),
      handler: (e) => e.selectPrevSuggestion(),
      kbOpts: {
        weight: YIe,
        kbExpr: $$.textInputFocus,
        primary: 16,
        secondary: [2064],
        mac: { primary: 16, secondary: [2064, 302] },
      },
    }),
  ),
  BH(
    new XIe({
      id: "selectPrevPageSuggestion",
      precondition: eW.and(
        oLe.Visible,
        eW.or(oLe.MultipleSuggestions, oLe.HasFocusedSuggestion.negate()),
      ),
      handler: (e) => e.selectPrevPageSuggestion(),
      kbOpts: { weight: YIe, kbExpr: $$.textInputFocus, primary: 11, secondary: [2059] },
    }),
  ),
  BH(
    new XIe({
      id: "selectFirstSuggestion",
      precondition: eW.and(
        oLe.Visible,
        eW.or(oLe.MultipleSuggestions, oLe.HasFocusedSuggestion.negate()),
      ),
      handler: (e) => e.selectFirstSuggestion(),
    }),
  ),
  BH(
    new XIe({
      id: "focusSuggestion",
      precondition: eW.and(oLe.Visible, oLe.HasFocusedSuggestion.negate()),
      handler: (e) => e.focusSuggestion(),
      kbOpts: {
        weight: YIe,
        kbExpr: $$.textInputFocus,
        primary: 2058,
        secondary: [2087],
        mac: { primary: 266, secondary: [2087] },
      },
    }),
  ),
  BH(
    new XIe({
      id: "focusAndAcceptSuggestion",
      precondition: eW.and(oLe.Visible, oLe.HasFocusedSuggestion.negate()),
      handler: (e) => {
        (e.focusSuggestion(), e.acceptSelectedSuggestion(!0, !1));
      },
    }),
  ),
  BH(
    new XIe({
      id: "toggleSuggestionDetails",
      precondition: eW.and(oLe.Visible, oLe.HasFocusedSuggestion),
      handler: (e) => e.toggleSuggestionDetails(),
      kbOpts: {
        weight: YIe,
        kbExpr: $$.textInputFocus,
        primary: 2058,
        secondary: [2087],
        mac: { primary: 266, secondary: [2087] },
      },
      menuOpts: [
        {
          menuId: sLe,
          group: "right",
          order: 1,
          when: eW.and(oLe.DetailsVisible, oLe.CanResolve),
          title: SI(1469, "Show Less"),
        },
        {
          menuId: sLe,
          group: "right",
          order: 1,
          when: eW.and(oLe.DetailsVisible.toNegated(), oLe.CanResolve),
          title: SI(1470, "Show More"),
        },
      ],
    }),
  ),
  BH(
    new XIe({
      id: "toggleExplainMode",
      precondition: oLe.Visible,
      handler: (e) => e.toggleExplainMode(),
      kbOpts: { weight: 100, primary: 2138 },
    }),
  ),
  BH(
    new XIe({
      id: "toggleSuggestionFocus",
      precondition: oLe.Visible,
      handler: (e) => e.toggleSuggestionFocus(),
      kbOpts: { weight: YIe, kbExpr: $$.textInputFocus, primary: 2570, mac: { primary: 778 } },
    }),
  ),
  BH(
    new XIe({
      id: "insertBestCompletion",
      precondition: eW.and(
        $$.textInputFocus,
        eW.equals("config.editor.tabCompletion", "on"),
        lIe.AtEnd,
        oLe.Visible.toNegated(),
        dIe.OtherSuggestions.toNegated(),
        iDe.InSnippetMode.toNegated(),
      ),
      handler: (e, t) => {
        e.triggerSuggestAndAcceptBest(sR(t) ? { fallback: "tab", ...t } : { fallback: "tab" });
      },
      kbOpts: { weight: YIe, primary: 2 },
    }),
  ),
  BH(
    new XIe({
      id: "insertNextSuggestion",
      precondition: eW.and(
        $$.textInputFocus,
        eW.equals("config.editor.tabCompletion", "on"),
        dIe.OtherSuggestions,
        oLe.Visible.toNegated(),
        iDe.InSnippetMode.toNegated(),
      ),
      handler: (e) => e.acceptNextSuggestion(),
      kbOpts: { weight: YIe, kbExpr: $$.textInputFocus, primary: 2 },
    }),
  ),
  BH(
    new XIe({
      id: "insertPrevSuggestion",
      precondition: eW.and(
        $$.textInputFocus,
        eW.equals("config.editor.tabCompletion", "on"),
        dIe.OtherSuggestions,
        oLe.Visible.toNegated(),
        iDe.InSnippetMode.toNegated(),
      ),
      handler: (e) => e.acceptPrevSuggestion(),
      kbOpts: { weight: YIe, kbExpr: $$.textInputFocus, primary: 1026 },
    }),
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.resetSuggestSize",
          label: EI(1472, "Reset Suggest Widget Size"),
          precondition: void 0,
        });
      }
      run(e, t) {
        KIe.get(t)?.resetWidgetSize();
      }
    },
  ));
class QIe extends PO {
  get selectedItem() {
    return this._currentSuggestItemInfo;
  }
  constructor(e, t, n) {
    (super(),
      (this.editor = e),
      (this.suggestControllerPreselector = t),
      (this.onWillAccept = n),
      (this.isSuggestWidgetVisible = !1),
      (this.isShiftKeyPressed = !1),
      (this._isActive = !1),
      (this._currentSuggestItemInfo = void 0),
      (this._onDidSelectedItemChange = this._register(new QO())),
      (this.onDidSelectedItemChange = this._onDidSelectedItemChange.event),
      this._register(
        e.onKeyDown((e) => {
          e.shiftKey &&
            !this.isShiftKeyPressed &&
            ((this.isShiftKeyPressed = !0), this.update(this._isActive));
        }),
      ),
      this._register(
        e.onKeyUp((e) => {
          e.shiftKey &&
            this.isShiftKeyPressed &&
            ((this.isShiftKeyPressed = !1), this.update(this._isActive));
        }),
      ));
    const i = KIe.get(this.editor);
    if (i) {
      this._register(
        i.registerSelector({
          priority: 100,
          select: (e, t, n) => {
            const r = this.editor.getModel();
            if (!r) return -1;
            const o = this.suggestControllerPreselector(),
              s = o ? xDe(o, r) : void 0;
            if (!s) return -1;
            const a = xV.lift(t),
              l = n
                .map((e, t) => {
                  const n = xDe(
                    JIe.fromSuggestion(i, r, a, e, this.isShiftKeyPressed).getSingleTextEdit(),
                    r,
                  );
                  return {
                    index: t,
                    valid: wDe(s, n),
                    prefixLength: n.text.length,
                    suggestItem: e,
                  };
                })
                .filter((e) => e && e.valid && e.prefixLength > 0),
              c = j1(
                l,
                bj((e) => e.prefixLength, yj),
              );
            return c ? c.index : -1;
          },
        }),
      );
      let e = !1;
      const t = () => {
        e ||
          ((e = !0),
          this._register(
            i.widget.value.onDidShow(() => {
              ((this.isSuggestWidgetVisible = !0), this.update(!0));
            }),
          ),
          this._register(
            i.widget.value.onDidHide(() => {
              ((this.isSuggestWidgetVisible = !1), this.update(!1));
            }),
          ),
          this._register(
            i.widget.value.onDidFocus(() => {
              ((this.isSuggestWidgetVisible = !0), this.update(!0));
            }),
          ));
      };
      (this._register(
        $O.once(i.model.onDidTrigger)((e) => {
          t();
        }),
      ),
        this._register(
          i.onWillInsertSuggestItem((e) => {
            const t = this.editor.getPosition(),
              n = this.editor.getModel();
            if (!t || !n) return;
            const r = JIe.fromSuggestion(i, n, t, e.item, this.isShiftKeyPressed);
            this.onWillAccept(r);
          }),
        ));
    }
    this.update(this._isActive);
  }
  update(e) {
    const t = this.getSuggestItemInfo();
    (this._isActive === e &&
      (function (e, t) {
        if (e === t) return !0;
        if (!e || !t) return !1;
        return e.equals(t);
      })(this._currentSuggestItemInfo, t)) ||
      ((this._isActive = e),
      (this._currentSuggestItemInfo = t),
      this._onDidSelectedItemChange.fire());
  }
  getSuggestItemInfo() {
    const e = KIe.get(this.editor);
    if (!e || !this.isSuggestWidgetVisible) return;
    const t = e.widget.value.getFocusedItem(),
      n = this.editor.getPosition(),
      i = this.editor.getModel();
    return t && n && i ? JIe.fromSuggestion(e, i, n, t.item, this.isShiftKeyPressed) : void 0;
  }
  stopForceRenderingAbove() {
    const e = KIe.get(this.editor);
    e?.stopForceRenderingAbove();
  }
  forceRenderingAbove() {
    const e = KIe.get(this.editor);
    e?.forceRenderingAbove();
  }
}
class JIe {
  static fromSuggestion(e, t, n, i, r) {
    let { insertText: o } = i.completion,
      s = !1;
    if (4 & i.completion.insertTextRules) {
      const e = new ape().parse(o);
      (e.children.length < 100 && JLe.adjustWhitespace(t, n, !0, e), (o = e.toString()), (s = !0));
    }
    const a = e.getOverwriteInfo(i, r);
    return new JIe(
      YH.fromPositions(n.delta(0, -a.overwriteBefore), n.delta(0, Math.max(a.overwriteAfter, 0))),
      o,
      i.completion.kind,
      s,
      i.container.incomplete ?? !1,
    );
  }
  constructor(e, t, n, i, r) {
    ((this.range = e),
      (this.insertText = t),
      (this.completionItemKind = n),
      (this.isSnippetText = i),
      (this.listIncomplete = r));
  }
  equals(e) {
    return (
      this.range.equalsRange(e.range) &&
      this.insertText === e.insertText &&
      this.completionItemKind === e.completionItemKind &&
      this.isSnippetText === e.isSnippetText
    );
  }
  toSelectedSuggestionInfo() {
    return new y2(this.range, this.insertText, this.completionItemKind, this.isSnippetText);
  }
  getSingleTextEdit() {
    return new c3(this.range, this.insertText);
  }
}
class eRe extends PO {
  constructor(e, t, n) {
    (super(),
      (this._editorObs = e),
      (this._handleSuggestAccepted = t),
      (this._suggestControllerPreselector = n),
      (this._suggestWidgetAdaptor = this._register(
        new QIe(
          this._editorObs.editor,
          () => (this._editorObs.forceUpdate(), this._suggestControllerPreselector()),
          (e) =>
            this._editorObs.forceUpdate((t) => {
              this._handleSuggestAccepted(e);
            }),
        ),
      )),
      (this.selectedItem = gF(
        this,
        (e) =>
          this._suggestWidgetAdaptor.onDidSelectedItemChange(() => {
            this._editorObs.forceUpdate((t) => e(void 0));
          }),
        () => this._suggestWidgetAdaptor.selectedItem,
      )));
  }
  stopForceRenderingAbove() {
    this._suggestWidgetAdaptor.stopForceRenderingAbove();
  }
  forceRenderingAbove() {
    this._suggestWidgetAdaptor.forceRenderingAbove();
  }
}
class tRe {
  constructor(e, t) {
    ((this.lineNumber = e), (this.columnRange = t));
  }
}
class nRe {
  constructor(e, t) {
    if (((this.startColumn = e), (this.endColumnExclusive = t), e > t))
      throw new QI(`startColumn ${e} cannot be after endColumnExclusive ${t}`);
  }
  toRange(e) {
    return new YH(e, this.startColumn, e, this.endColumnExclusive);
  }
  equals(e) {
    return this.startColumn === e.startColumn && this.endColumnExclusive === e.endColumnExclusive;
  }
  toZeroBasedOffsetRange() {
    return new N$(this.startColumn - 1, this.endColumnExclusive - 1);
  }
}
class iRe {
  static fromLineTokens(e) {
    const t = [];
    for (let n = 0; n < e.getCount(); n++) t.push(new rRe(e.getTokenText(n), e.getMetadata(n)));
    return iRe.create(t);
  }
  static create(e) {
    return new iRe(e);
  }
  constructor(e) {
    this._tokenInfo = e;
  }
  toLineTokens(e) {
    return D$.createFromTextAndMetadata(
      this.map((e, t) => ({ text: t.text, metadata: t.metadata })),
      e,
    );
  }
  map(e) {
    const t = [];
    let n = 0;
    for (const i of this._tokenInfo) {
      const r = new N$(n, n + i.text.length);
      (t.push(e(r, i)), (n += i.text.length));
    }
    return t;
  }
  slice(e) {
    const t = [];
    let n = 0;
    for (const i of this._tokenInfo) {
      const r = n,
        o = r + i.text.length;
      if (o > e.start) {
        if (r >= e.endExclusive) break;
        const n = Math.max(0, e.start - r),
          s = Math.max(0, o - e.endExclusive);
        t.push(new rRe(i.text.slice(n, i.text.length - s), i.metadata));
      }
      n += i.text.length;
    }
    return iRe.create(t);
  }
  append(e) {
    const t = this._tokenInfo.concat(e._tokenInfo);
    return iRe.create(t);
  }
}
class rRe {
  constructor(e, t) {
    ((this.text = e), (this.metadata = t));
  }
}
const oRe = "ghost-text";
let sRe = class extends PO {
  static {
    this.hot = Sne(this);
  }
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._editor = e),
      (this._model = t),
      (this._options = n),
      (this._shouldKeepCursorStable = i),
      (this._isClickable = r),
      (this._languageService = o),
      (this._isDisposed = LF(this, !1)),
      (this._editorObs = xde(this._editor)),
      (this._warningState = Xj((e) => {
        const t = this._model.ghostText.read(e);
        if (!t) return;
        const n = this._model.warning.read(e);
        return n
          ? {
              lineNumber: t.lineNumber,
              position: new xV(t.lineNumber, t.parts[0].column),
              icon: n.icon,
            }
          : void 0;
      })),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this._useSyntaxHighlighting = this._options.map((e) => e.syntaxHighlightingEnabled)),
      (this._extraClassNames = Xj(this, (e) => {
        const t = [...(this._options.read(e).extraClasses ?? [])];
        (this._useSyntaxHighlighting.read(e) && t.push("syntax-highlighted"),
          this._warningState.read(e) && t.push("warning"));
        const n = t.map((e) => ` ${e}`).join("");
        return n;
      })),
      (this.uiState = Xj(this, (e) => {
        if (this._isDisposed.read(e)) return;
        const t = this._editorObs.model.read(e);
        if (t !== this._model.targetTextModel.read(e)) return;
        const n = this._model.ghostText.read(e);
        if (!n) return;
        const i = n instanceof vDe ? n.columnRange : void 0,
          r = this._useSyntaxHighlighting.read(e),
          o = this._extraClassNames.read(e),
          {
            inlineTexts: s,
            additionalLines: a,
            hiddenRange: l,
            additionalLinesOriginalSuffix: c,
          } = (function (e, t, n) {
            const i = [],
              r = [];
            function o(e, t) {
              if (r.length > 0) {
                const n = r[r.length - 1];
                (t &&
                  n.decorations.push(
                    new gQ(n.content.length + 1, n.content.length + 1 + e[0].line.length, t, 0),
                  ),
                  (n.content += e[0].line),
                  (e = e.slice(1)));
              }
              for (const n of e)
                r.push({
                  content: n.line,
                  decorations: t
                    ? [new gQ(1, n.line.length + 1, t, 0), ...n.lineDecorations]
                    : [...n.lineDecorations],
                });
            }
            const s = t.getLineContent(e.lineNumber);
            let a,
              l = 0;
            for (const u of e.parts) {
              let e = u.lines;
              (void 0 === a
                ? (i.push({
                    column: u.column,
                    text: e[0].line,
                    preview: u.preview,
                    lineDecorations: e[0].lineDecorations,
                  }),
                  (e = e.slice(1)))
                : o([{ line: s.substring(l, u.column - 1), lineDecorations: [] }], void 0),
                e.length > 0 && (o(e, n), void 0 === a && u.column <= s.length && (a = u.column)),
                (l = u.column - 1));
            }
            let c;
            void 0 !== a && (c = new tRe(e.lineNumber, new nRe(l + 1, s.length + 1)));
            const d = void 0 !== a ? new nRe(a, s.length + 1) : void 0;
            return {
              inlineTexts: i,
              additionalLines: r,
              hiddenRange: d,
              additionalLinesOriginalSuffix: c,
            };
          })(n, t, oRe + o),
          d = t.getLineContent(n.lineNumber),
          u = new Z5(s.map((e) => Y5.insert(e.column - 1, e.text))),
          h = r
            ? t.tokenization.tokenizeLinesAt(n.lineNumber, [u.apply(d), ...a.map((e) => e.content)])
            : void 0,
          g = u.getNewRanges(),
          p = s.map((e, t) => ({ ...e, tokens: h?.[0]?.getTokensInRange(g[t]) })),
          f = a.map((e, n) => {
            let i = h?.[n + 1] ?? D$.createEmpty(e.content, this._languageService.languageIdCodec);
            if (n === a.length - 1 && c) {
              const e = iRe
                .fromLineTokens(t.tokenization.getLineTokens(c.lineNumber))
                .slice(c.columnRange.toZeroBasedOffsetRange());
              i = iRe.fromLineTokens(i).append(e).toLineTokens(i.languageIdCodec);
            }
            return { content: i, decorations: e.decorations };
          }),
          m = this._editor.getSelection()?.getStartPosition().column,
          _ = p.filter((e) => "" !== e.text),
          v = 0 !== _.length,
          b = {
            cursorColumnDistance: (v ? _[0].column : 1) - m,
            cursorLineDistance: v ? 0 : a.findIndex((e) => "" !== e.content) + 1,
            lineCountOriginal: v ? 1 : 0,
            lineCountModified: a.length + (v ? 1 : 0),
            characterCountOriginal: 0,
            characterCountModified:
              Ej(_.map((e) => e.text.length)) + Ej(f.map((e) => e.content.getTextLength())),
            disjointReplacements: _.length + (a.length > 0 ? 1 : 0),
            sameShapeReplacements:
              _.length > 1 && 0 === f.length ? _.every((e) => e.text === _[0].text) : void 0,
          };
        return (
          this._model.handleInlineCompletionShown.read(e)?.(b),
          {
            replacedRange: i,
            inlineTexts: p,
            additionalLines: f,
            hiddenRange: l,
            lineNumber: n.lineNumber,
            additionalReservedLineCount: this._model.minReservedLineCount.read(e),
            targetTextModel: t,
            syntaxHighlightingEnabled: r,
          }
        );
      })),
      (this.decorations = Xj(this, (e) => {
        const t = this.uiState.read(e);
        if (!t) return [];
        const n = [],
          i = this._extraClassNames.read(e);
        (t.replacedRange &&
          n.push({
            range: t.replacedRange.toRange(t.lineNumber),
            options: {
              inlineClassName: "inline-completion-text-to-replace" + i,
              description: "GhostTextReplacement",
            },
          }),
          t.hiddenRange &&
            n.push({
              range: t.hiddenRange.toRange(t.lineNumber),
              options: { inlineClassName: "ghost-text-hidden", description: "ghost-text-hidden" },
            }));
        for (const r of t.inlineTexts)
          n.push({
            range: YH.fromPositions(new xV(t.lineNumber, r.column)),
            options: {
              description: "ghost-text-decoration",
              after: {
                content: r.text,
                tokens: r.tokens,
                inlineClassName:
                  (r.preview ? "ghost-text-decoration-preview" : "ghost-text-decoration") +
                  (this._isClickable ? " clickable" : "") +
                  i +
                  r.lineDecorations.map((e) => " " + e.className).join(" "),
                cursorStops: Kz.Left,
                attachedData: new aRe(this),
              },
              showIfCollapsed: !0,
            },
          });
        return n;
      })),
      (this._additionalLinesWidget = this._register(
        new lRe(
          this._editor,
          Xj((e) => {
            const t = this.uiState.read(e);
            return t
              ? {
                  lineNumber: t.lineNumber,
                  additionalLines: t.additionalLines,
                  minReservedLineCount: t.additionalReservedLineCount,
                  targetTextModel: t.targetTextModel,
                }
              : void 0;
          }),
          this._shouldKeepCursorStable,
          this._isClickable,
        ),
      )),
      (this._isInlineTextHovered = this._editorObs.isTargetHovered(
        (e) =>
          6 === e.target.type &&
          e.target.detail.injectedText?.options.attachedData instanceof aRe &&
          e.target.detail.injectedText.options.attachedData.owner === this,
        this._store,
      )),
      (this.isHovered = Xj(
        this,
        (e) =>
          !this._isDisposed.read(e) &&
          (this._isInlineTextHovered.read(e) || this._additionalLinesWidget.isHovered.read(e)),
      )),
      (this.height = Xj(
        this,
        (e) =>
          this._editorObs.getOption(75).read(e) +
          (this._additionalLinesWidget.viewZoneHeight.read(e) ?? 0),
      )),
      this._register(
        MO(() => {
          this._isDisposed.set(!0, void 0);
        }),
      ),
      this._register(this._editorObs.setDecorations(this.decorations)),
      this._isClickable &&
        (this._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e))),
        this._register(
          this._editor.onMouseUp((e) => {
            if (6 !== e.target.type) return;
            const t = e.target.detail.injectedText?.options.attachedData;
            t instanceof aRe && t.owner === this && this._onDidClick.fire(e.event);
          }),
        )),
      this._register(aF((e, t) => {})));
  }
  static getWarningWidgetContext(e) {
    const t = e.ghostTextViewWarningWidgetData;
    return t || (e.parentElement ? this.getWarningWidgetContext(e.parentElement) : void 0);
  }
  ownsViewZone(e) {
    return this._additionalLinesWidget.viewZoneId === e;
  }
};
sRe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(5, BU),
  ],
  sRe,
);
class aRe {
  constructor(e) {
    this.owner = e;
  }
}
class lRe extends PO {
  get viewZoneId() {
    return this._viewZoneInfo?.viewZoneId;
  }
  get viewZoneHeight() {
    return this._viewZoneHeight;
  }
  constructor(e, t, n, i) {
    (super(),
      (this._editor = e),
      (this._lines = t),
      (this._shouldKeepCursorStable = n),
      (this._isClickable = i),
      (this._viewZoneHeight = LF("viewZoneHeight", void 0)),
      (this.editorOptionsChanged = $ce(
        "editorOptionChanged",
        $O.filter(
          this._editor.onDidChangeConfiguration,
          (e) =>
            e.hasChanged(40) ||
            e.hasChanged(133) ||
            e.hasChanged(113) ||
            e.hasChanged(108) ||
            e.hasChanged(60) ||
            e.hasChanged(59) ||
            e.hasChanged(75),
        ),
      )),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this._viewZoneListener = this._register(new jO())),
      (this.isHovered = xde(this._editor).isTargetHovered(
        (e) => cRe(e.target.element),
        this._store,
      )),
      (this.hasBeenAccepted = !1),
      this._editor instanceof ane &&
        this._shouldKeepCursorStable &&
        this._register(
          this._editor.onBeforeExecuteEdit(
            (e) => (this.hasBeenAccepted = "inlineSuggestion.accept" === e.source),
          ),
        ),
      this._register(
        rF((e) => {
          const t = this._lines.read(e);
          (this.editorOptionsChanged.read(e),
            t
              ? ((this.hasBeenAccepted = !1),
                this.updateLines(t.lineNumber, t.additionalLines, t.minReservedLineCount))
              : this.clear());
        }),
      ));
  }
  dispose() {
    (super.dispose(), this.clear());
  }
  clear() {
    (this._viewZoneListener.clear(),
      this._editor.changeViewZones((e) => {
        this.removeActiveViewZone(e);
      }));
  }
  updateLines(e, t, n) {
    const i = this._editor.getModel();
    if (!i) return;
    const { tabSize: r } = i.getOptions();
    this._editor.changeViewZones((i) => {
      const o = new AO();
      this.removeActiveViewZone(i);
      const s = Math.max(t.length, n);
      if (s > 0) {
        const n = document.createElement("div");
        (!(function (e, t, n, i, r) {
          const o = i.get(40),
            s = i.get(133),
            a = "none",
            l = i.get(108),
            c = i.get(60),
            d = i.get(59),
            u = i.get(75);
          let h = "suggest-preview-text";
          r && (h += " clickable");
          const g = new bU(1e4);
          g.appendString(`<div class="${h}">`);
          for (let m = 0, _ = n.length; m < _; m++) {
            const e = n[m],
              i = e.content;
            (g.appendString('<div class="view-line'),
              g.appendString('" style="top:'),
              g.appendString(String(m * u)),
              g.appendString('px;width:1000000px;">'));
            const r = i.getLineContent(),
              h = wA(r),
              p = yA(r);
            (wQ(
              new vQ(
                d.isMonospace && !o,
                d.canUseHalfwidthRightwardsArrow,
                r,
                !1,
                h,
                p,
                0,
                i,
                e.decorations,
                t,
                0,
                d.spaceWidth,
                d.middotWidth,
                d.wsmiddotWidth,
                s,
                a,
                l,
                c !== xK.OFF,
                null,
                null,
                0,
              ),
              g,
            ),
              g.appendString("</div>"));
          }
          (g.appendString("</div>"), Vq(e, d));
          const p = g.build(),
            f = dRe ? dRe.createHTML(p) : p;
          e.innerHTML = f;
        })(n, r, t, this._editor.getOptions(), this._isClickable),
          this._isClickable &&
            (o.add(
              $F(n, "mousedown", (e) => {
                e.preventDefault();
              }),
            ),
            o.add(
              $F(n, "click", (e) => {
                cRe(e.target) && this._onDidClick.fire(new EO(MF(e), e));
              }),
            )),
          this.addViewZone(i, e, s, n));
      }
      this._viewZoneListener.value = o;
    });
  }
  addViewZone(e, t, n, i) {
    const r = e.addZone({
      afterLineNumber: t,
      heightInLines: n,
      domNode: i,
      afterColumnAffinity: 1,
      onComputedHeight: (e) => {
        this._viewZoneHeight.set(e, void 0);
      },
    });
    (this.keepCursorStable(t, n),
      (this._viewZoneInfo = { viewZoneId: r, heightInLines: n, lineNumber: t }));
  }
  removeActiveViewZone(e) {
    this._viewZoneInfo &&
      (e.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(e, t) {
    if (!this._shouldKeepCursorStable) return;
    const n = this._editor.getSelection()?.getStartPosition()?.lineNumber;
    void 0 !== n &&
      e < n &&
      this._editor.setScrollTop(this._editor.getScrollTop() + t * this._editor.getOption(75));
  }
}
function cRe(e) {
  return SB(e) && e.classList.contains(oRe);
}
const dRe = ZJ("editorGhostText", { createHTML: (e) => e });
class uRe {
  static {
    this.empty = new uRe([]);
  }
  constructor(e) {
    ((this.replacements = e),
      tR(rR(e, (e, t) => e.lineRange.endLineNumberExclusive <= t.lineRange.startLineNumber)));
  }
  toString() {
    return this.replacements.map((e) => e.toString()).join(",");
  }
  getNewLineRanges() {
    const e = [];
    let t = 0;
    for (const n of this.replacements)
      (e.push(Q5.ofLength(n.lineRange.startLineNumber + t, n.newLines.length)),
        (t += n.newLines.length - n.lineRange.length));
    return e;
  }
}
class hRe {
  static fromSingleTextEdit(e, t) {
    const n = ZM(e.text);
    let i = e.range.startLineNumber;
    const r = t.getValueOfRange(
      YH.fromPositions(new xV(e.range.startLineNumber, 1), e.range.getStartPosition()),
    );
    n[0] = r + n[0];
    let o = e.range.endLineNumber + 1;
    const s = t.getTransformer().getLineLength(e.range.endLineNumber) + 1,
      a = t.getValueOfRange(
        YH.fromPositions(e.range.getEndPosition(), new xV(e.range.endLineNumber, s)),
      );
    n[n.length - 1] = n[n.length - 1] + a;
    const l = e.range.startColumn === t.getTransformer().getLineLength(e.range.startLineNumber) + 1,
      c = 1 === e.range.endColumn;
    return (
      l && n[0].length === r.length && (i++, n.shift()),
      n.length > 0 && i < o && c && n[n.length - 1].length === a.length && (o--, n.pop()),
      new hRe(new Q5(i, o), n)
    );
  }
  constructor(e, t) {
    ((this.lineRange = e), (this.newLines = t));
  }
  toString() {
    return `${this.lineRange}->${JSON.stringify(this.newLines)}`;
  }
  toLineEdit() {
    return new uRe([this]);
  }
}
class gRe {
  get lineEdit() {
    return 0 === this.edit.replacements.length
      ? new hRe(new Q5(1, 1), [])
      : hRe.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(
        Q5.ofLength(this.originalLineRange.startLineNumber, this.lineEdit.newLines.length),
      ),
    );
  }
  constructor(e, t, n, i, r, o) {
    ((this.originalText = e),
      (this.edit = t),
      (this.cursorPosition = n),
      (this.multiCursorPositions = i),
      (this.commands = r),
      (this.inlineCompletion = o));
  }
}
class pRe {
  constructor(e, t, n) {
    ((this._model = e),
      (this.inlineEdit = t),
      (this.tabAction = n),
      (this.action = this.inlineEdit.inlineCompletion.action),
      (this.displayName =
        this.inlineEdit.inlineCompletion.source.provider.displayName ?? SI(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(e, t) {
    this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion, e, t);
  }
}
class fRe {
  constructor(e) {
    ((this._model = e),
      (this.onDidAccept = this._model.onDidAccept),
      (this.inAcceptFlow = this._model.inAcceptFlow));
  }
}
class mRe {
  constructor(e, t, n, i) {
    this.lineRange = n;
    const r = xde(e),
      o = Xj(this, (e) =>
        r.isFocused.read(e) && i.showInlineEditMenu ? CTe.Accept : CTe.Inactive,
      );
    this.model = new pRe(
      t,
      new gRe(
        new a3(""),
        new l3([i.getSingleTextEdit()]),
        t.primaryPosition.get(),
        t.allPositions.get(),
        i.source.inlineSuggestions.commands ?? [],
        i,
      ),
      o,
    );
  }
}
class _Re {
  static fromPoints(e, t) {
    return new _Re(e.x, e.y, t.x, t.y);
  }
  static fromPointSize(e, t) {
    return new _Re(e.x, e.y, e.x + t.x, e.y + t.y);
  }
  static fromLeftTopRightBottom(e, t, n, i) {
    return new _Re(e, t, n, i);
  }
  static fromLeftTopWidthHeight(e, t, n, i) {
    return new _Re(e, t, e + n, t + i);
  }
  static fromRanges(e, t) {
    return new _Re(e.start, t.start, e.endExclusive, t.endExclusive);
  }
  static hull(e) {
    let t = Number.MAX_SAFE_INTEGER,
      n = Number.MAX_SAFE_INTEGER,
      i = Number.MIN_SAFE_INTEGER,
      r = Number.MIN_SAFE_INTEGER;
    for (const o of e)
      ((t = Math.min(t, o.left)),
        (n = Math.min(n, o.top)),
        (i = Math.max(i, o.right)),
        (r = Math.max(r, o.bottom)));
    return new _Re(t, n, i, r);
  }
  get width() {
    return this.right - this.left;
  }
  get height() {
    return this.bottom - this.top;
  }
  constructor(e, t, n, i) {
    if (((this.left = e), (this.top = t), (this.right = n), (this.bottom = i), e > n))
      throw new QI("Invalid arguments: Horizontally offset by " + (e - n));
    if (t > i) throw new QI("Invalid arguments: Vertically offset by " + (t - i));
  }
  withMargin(e, t, n, i) {
    let r, o, s, a;
    return (
      void 0 === t && void 0 === n && void 0 === i
        ? (r = o = s = a = e)
        : void 0 === n && void 0 === i
          ? ((r = o = t), (s = a = e))
          : ((r = i), (o = t), (s = e), (a = n)),
      new _Re(this.left - r, this.top - s, this.right + o, this.bottom + a)
    );
  }
  intersectVertical(e) {
    const t = Math.max(this.top, e.start),
      n = Math.min(this.bottom, e.endExclusive);
    return new _Re(this.left, t, this.right, Math.max(t, n));
  }
  intersectHorizontal(e) {
    const t = Math.max(this.left, e.start),
      n = Math.min(this.right, e.endExclusive);
    return new _Re(t, this.top, Math.max(t, n), this.bottom);
  }
  toString() {
    return `Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`;
  }
  intersect(e) {
    const t = Math.max(this.left, e.left),
      n = Math.min(this.right, e.right),
      i = Math.max(this.top, e.top),
      r = Math.min(this.bottom, e.bottom);
    if (!(t > n || i > r)) return new _Re(t, i, n, r);
  }
  containsRect(e) {
    return (
      this.left <= e.left && this.top <= e.top && this.right >= e.right && this.bottom >= e.bottom
    );
  }
  containsPoint(e) {
    return this.left <= e.x && this.top <= e.y && this.right >= e.x && this.bottom >= e.y;
  }
  moveToBeContainedIn(e) {
    const t = this.width,
      n = this.height;
    let i = this.left,
      r = this.top;
    return (
      i < e.left ? (i = e.left) : i + t > e.right && (i = e.right - t),
      r < e.top ? (r = e.top) : r + n > e.bottom && (r = e.bottom - n),
      new _Re(i, r, i + t, r + n)
    );
  }
  withWidth(e) {
    return new _Re(this.left, this.top, this.left + e, this.bottom);
  }
  withHeight(e) {
    return new _Re(this.left, this.top, this.right, this.top + e);
  }
  withTop(e) {
    return new _Re(this.left, e, this.right, this.bottom);
  }
  withLeft(e) {
    return new _Re(e, this.top, this.right, this.bottom);
  }
  translateX(e) {
    return new _Re(this.left + e, this.top, this.right + e, this.bottom);
  }
  translateY(e) {
    return new _Re(this.left, this.top + e, this.right, this.bottom + e);
  }
  getLeftBottom() {
    return new yde(this.left, this.bottom);
  }
  getRightBottom() {
    return new yde(this.right, this.bottom);
  }
  getRightTop() {
    return new yde(this.right, this.top);
  }
  toStyles() {
    return {
      position: "absolute",
      left: `${this.left}px`,
      top: `${this.top}px`,
      width: `${this.width}px`,
      height: `${this.height}px`,
    };
  }
}
class vRe {
  constructor(e, t, n, i = null) {
    ((this.startLineNumbers = e),
      (this.endLineNumbers = t),
      (this.lastLineRelativePosition = n),
      (this.showEndForLine = i));
  }
  equals(e) {
    return (
      !!e &&
      this.lastLineRelativePosition === e.lastLineRelativePosition &&
      this.showEndForLine === e.showEndForLine &&
      XP(this.startLineNumbers, e.startLineNumbers) &&
      XP(this.endLineNumbers, e.endLineNumbers)
    );
  }
  static get Empty() {
    return new vRe([], [], 0);
  }
}
const bRe = ZJ("stickyScrollViewLayer", { createHTML: (e) => e }),
  yRe = "data-sticky-line-index",
  xRe = "data-sticky-is-line",
  wRe = "data-sticky-is-folding-icon";
class CRe extends PO {
  get height() {
    return this._height;
  }
  constructor(e) {
    (super(),
      (this._foldingIconStore = this._register(new AO())),
      (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 = !1),
      (this._height = -1),
      (this._onDidChangeStickyScrollHeight = this._register(new QO())),
      (this.onDidChangeStickyScrollHeight = this._onDidChangeStickyScrollHeight.event),
      (this._editor = e),
      (this._lineHeight = e.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", e instanceof Eye),
      this._rootDomNode.appendChild(this._lineNumbersDomNode),
      this._rootDomNode.appendChild(this._linesDomNodeScrollable),
      this._setHeight(0));
    const t = () => {
      this._linesDomNode.style.left = this._editor.getOption(131).scrollWithEditor
        ? `-${this._editor.getScrollLeft()}px`
        : "0px";
    };
    (this._register(
      this._editor.onDidChangeConfiguration((e) => {
        (e.hasChanged(131) && t(),
          e.hasChanged(75) && (this._lineHeight = this._editor.getOption(75)));
      }),
    ),
      this._register(
        this._editor.onDidScrollChange((e) => {
          (e.scrollLeftChanged && t(), e.scrollWidthChanged && this._updateWidgetWidth());
        }),
      ),
      this._register(
        this._editor.onDidChangeModel(() => {
          (t(), this._updateWidgetWidth());
        }),
      ),
      t(),
      this._register(
        this._editor.onDidLayoutChange((e) => {
          this._updateWidgetWidth();
        }),
      ),
      this._updateWidgetWidth());
  }
  get lineNumbers() {
    return this._lineNumbers;
  }
  get lineNumberCount() {
    return this._lineNumbers.length;
  }
  getRenderedStickyLine(e) {
    return this._renderedStickyLines.find((t) => t.lineNumber === e);
  }
  getCurrentLines() {
    return this._lineNumbers;
  }
  setState(e, t, n) {
    const i = !this._state && !e,
      r = this._state && this._state.equals(e);
    if (void 0 === n && (i || r)) return;
    const o = this._findRenderingData(e),
      s = this._lineNumbers;
    ((this._lineNumbers = o.lineNumbers),
      (this._lastLineRelativePosition = o.lastLineRelativePosition));
    const a = this._findIndexToRebuildFrom(s, this._lineNumbers, n);
    (this._renderRootNode(this._lineNumbers, this._lastLineRelativePosition, t, a),
      (this._state = e));
  }
  _findRenderingData(e) {
    if (!e) return { lineNumbers: [], lastLineRelativePosition: 0 };
    const t = [...e.startLineNumbers];
    null !== e.showEndForLine && (t[e.showEndForLine] = e.endLineNumbers[e.showEndForLine]);
    let n = 0;
    for (let i = 0; i < t.length; i++) n += this._editor.getLineHeightForPosition(new xV(t[i], 1));
    return 0 === n
      ? { lineNumbers: [], lastLineRelativePosition: 0 }
      : { lineNumbers: t, lastLineRelativePosition: e.lastLineRelativePosition };
  }
  _findIndexToRebuildFrom(e, t, n) {
    if (0 === t.length) return 0;
    if (void 0 !== n) return n;
    const i = t.findIndex((t) => !e.includes(t));
    return -1 === i ? 0 : i;
  }
  _updateWidgetWidth() {
    const e = this._editor.getLayoutInfo(),
      t = e.contentLeft;
    ((this._lineNumbersDomNode.style.width = `${t}px`),
      this._linesDomNodeScrollable.style.setProperty(
        "--vscode-editorStickyScroll-scrollableWidth",
        this._editor.getScrollWidth() - e.verticalScrollbarWidth + "px",
      ),
      (this._rootDomNode.style.width = e.width - e.verticalScrollbarWidth + "px"));
  }
  _useFoldingOpacityTransition(e) {
    this._lineNumbersDomNode.style.setProperty(
      "--vscode-editorStickyScroll-foldingOpacityTransition",
      `opacity ${e ? 0.5 : 0}s`,
    );
  }
  _setFoldingIconsVisibility(e) {
    for (const t of this._renderedStickyLines) {
      const n = t.foldingIcon;
      n && n.setVisible(!!e || n.isCollapsed);
    }
  }
  async _renderRootNode(e, t, n, i) {
    const r = this._editor._getViewModel();
    if (!r) return void this._clearWidget();
    if (0 === e.length) return void this._clearWidget();
    const o = [],
      s = e[e.length - 1];
    let a = 0;
    for (let c = 0; c < this._renderedStickyLines.length; c++)
      if (c < i) {
        const e = this._renderedStickyLines[c];
        (o.push(this._updatePosition(e, a, e.lineNumber === s)), (a += e.height));
      } else {
        const e = this._renderedStickyLines[c];
        (e.lineNumberDomNode.remove(), e.lineDomNode.remove());
      }
    const l = this._editor.getLayoutInfo();
    for (let c = i; c < e.length; c++) {
      const t = this._renderChildNode(r, c, e[c], a, s === e[c], n, l);
      ((a += t.height),
        this._linesDomNode.appendChild(t.lineDomNode),
        this._lineNumbersDomNode.appendChild(t.lineNumberDomNode),
        o.push(t));
    }
    (n &&
      (this._setFoldingHoverListeners(), this._useFoldingOpacityTransition(!this._isOnGlyphMargin)),
      (this._minContentWidthInPx =
        Math.max(...this._renderedStickyLines.map((e) => e.scrollWidth)) +
        l.verticalScrollbarWidth),
      (this._renderedStickyLines = o),
      this._setHeight(a + t),
      this._editor.layoutOverlayWidget(this));
  }
  _clearWidget() {
    for (let e = 0; e < this._renderedStickyLines.length; e++) {
      const t = this._renderedStickyLines[e];
      (t.lineNumberDomNode.remove(), t.lineDomNode.remove());
    }
    this._setHeight(0);
  }
  _setHeight(e) {
    this._height !== e &&
      ((this._height = e),
      0 === this._height
        ? (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() {
    "mouseover" === this._editor.getOption(126) &&
      (this._foldingIconStore.clear(),
      this._foldingIconStore.add(
        $F(this._lineNumbersDomNode, DB.MOUSE_ENTER, () => {
          ((this._isOnGlyphMargin = !0), this._setFoldingIconsVisibility(!0));
        }),
      ),
      this._foldingIconStore.add(
        $F(this._lineNumbersDomNode, DB.MOUSE_LEAVE, () => {
          ((this._isOnGlyphMargin = !1),
            this._useFoldingOpacityTransition(!0),
            this._setFoldingIconsVisibility(!1));
        }),
      ));
  }
  _renderChildNode(e, t, n, i, r, o, s) {
    const a = e.coordinatesConverter.convertModelPositionToViewPosition(new xV(n, 1)).lineNumber,
      l = e.getViewLineRenderingData(a),
      c = this._editor.getOption(76),
      d = this._editor.getOption(117).verticalScrollbarSize;
    let u;
    try {
      u = gQ.filter(l.inlineDecorations, a, l.minColumn, l.maxColumn);
    } catch (S) {
      u = [];
    }
    const h = this._editor.getLineHeightForPosition(new xV(n, 1)),
      g = e.getTextDirection(n),
      p = new vQ(
        !0,
        !0,
        l.content,
        l.continuesWithWrappedLine,
        l.isBasicASCII,
        l.containsRTL,
        0,
        l.tokens,
        u,
        l.tabSize,
        l.startVisibleColumn,
        1,
        1,
        1,
        500,
        "none",
        !0,
        !0,
        null,
        g,
        d,
      ),
      f = new bU(2e3),
      m = wQ(p, f);
    let _;
    _ = bRe ? bRe.createHTML(f.build()) : f.build();
    const v = document.createElement("span");
    (v.setAttribute(yRe, String(t)),
      v.setAttribute(xRe, ""),
      v.setAttribute("role", "listitem"),
      (v.tabIndex = 0),
      (v.className = "sticky-line-content"),
      v.classList.add(`stickyLine${n}`),
      (v.style.lineHeight = `${h}px`),
      (v.innerHTML = _));
    const b = document.createElement("span");
    (b.setAttribute(yRe, String(t)),
      b.setAttribute("data-sticky-is-line-number", ""),
      (b.className = "sticky-line-number"),
      (b.style.lineHeight = `${h}px`));
    const y = s.contentLeft;
    b.style.width = `${y}px`;
    const x = document.createElement("span");
    (1 === c.renderType || (3 === c.renderType && n % 10 == 0)
      ? (x.innerText = n.toString())
      : 2 === c.renderType &&
        (x.innerText = Math.abs(n - this._editor.getPosition().lineNumber).toString()),
      (x.className = "sticky-line-number-inner"),
      (x.style.width = `${s.lineNumbersWidth}px`),
      (x.style.paddingLeft = `${s.lineNumbersLeft}px`),
      b.appendChild(x));
    const w = this._renderFoldingIconForLine(o, n);
    (w &&
      (b.appendChild(w.domNode),
      (w.domNode.style.left = `${s.lineNumbersWidth + s.lineNumbersLeft}px`),
      (w.domNode.style.lineHeight = `${h}px`)),
      this._editor.applyFontInfo(v),
      this._editor.applyFontInfo(b),
      (b.style.lineHeight = `${h}px`),
      (v.style.lineHeight = `${h}px`),
      (b.style.height = `${h}px`),
      (v.style.height = `${h}px`));
    const C = new SRe(t, n, v, b, w, m.characterMapping, v.scrollWidth, h);
    return this._updatePosition(C, i, r);
  }
  _updatePosition(e, t, n) {
    const i = e.lineDomNode,
      r = e.lineNumberDomNode;
    if (n) {
      const n = "0";
      ((i.style.zIndex = n), (r.style.zIndex = n));
      const o = `${t + this._lastLineRelativePosition + (e.foldingIcon?.isCollapsed ? 1 : 0)}px`;
      ((i.style.top = o), (r.style.top = o));
    } else {
      const e = "1";
      ((i.style.zIndex = e),
        (r.style.zIndex = e),
        (i.style.top = `${t}px`),
        (r.style.top = `${t}px`));
    }
    return e;
  }
  _renderFoldingIconForLine(e, t) {
    const n = this._editor.getOption(126);
    if (!e || "never" === n) return;
    const i = e.regions,
      r = i.findRange(t),
      o = i.getStartLineNumber(r);
    if (!(t === o)) return;
    const s = i.isCollapsed(r),
      a = new kRe(s, o, i.getEndLineNumber(r), this._lineHeight);
    return (
      a.setVisible(!!this._isOnGlyphMargin || s || "always" === n),
      a.domNode.setAttribute(wRe, ""),
      a
    );
  }
  getId() {
    return "editor.contrib.stickyScrollWidget";
  }
  getDomNode() {
    return this._rootDomNode;
  }
  getPosition() {
    return { preference: 2, stackOridinal: 10 };
  }
  getMinContentWidthInPx() {
    return this._minContentWidthInPx;
  }
  focusLineWithIndex(e) {
    0 <= e &&
      e < this._renderedStickyLines.length &&
      this._renderedStickyLines[e].lineDomNode.focus();
  }
  getEditorPositionFromNode(e) {
    if (!e || e.children.length > 0) return null;
    const t = this._getRenderedStickyLineFromChildDomNode(e);
    if (!t) return null;
    const n = WQ(t.characterMapping, e, 0);
    return new xV(t.lineNumber, n);
  }
  getLineNumberFromChildDomNode(e) {
    return this._getRenderedStickyLineFromChildDomNode(e)?.lineNumber ?? null;
  }
  _getRenderedStickyLineFromChildDomNode(e) {
    const t = this.getLineIndexFromChildDomNode(e);
    return null === t || t < 0 || t >= this._renderedStickyLines.length
      ? null
      : this._renderedStickyLines[t];
  }
  getLineIndexFromChildDomNode(e) {
    const t = this._getAttributeValue(e, yRe);
    return t ? parseInt(t, 10) : null;
  }
  isInStickyLine(e) {
    return void 0 !== this._getAttributeValue(e, xRe);
  }
  isInFoldingIconDomNode(e) {
    return void 0 !== this._getAttributeValue(e, wRe);
  }
  _getAttributeValue(e, t) {
    for (; e && e !== this._rootDomNode; ) {
      const n = e.getAttribute(t);
      if (null !== n) return n;
      e = e.parentElement;
    }
  }
}
class SRe {
  constructor(e, t, n, i, r, o, s, a) {
    ((this.index = e),
      (this.lineNumber = t),
      (this.lineDomNode = n),
      (this.lineNumberDomNode = i),
      (this.foldingIcon = r),
      (this.characterMapping = o),
      (this.scrollWidth = s),
      (this.height = a));
  }
}
class kRe {
  constructor(e, t, n, i) {
    ((this.isCollapsed = e),
      (this.foldingStartLine = t),
      (this.foldingEndLine = n),
      (this.dimension = i),
      (this.domNode = document.createElement("div")),
      (this.domNode.style.width = "26px"),
      (this.domNode.style.height = `${i}px`),
      (this.domNode.style.lineHeight = `${i}px`),
      (this.domNode.className = AV.asClassName(e ? sNe : oNe)));
  }
  setVisible(e) {
    ((this.domNode.style.cursor = e ? "pointer" : "default"),
      (this.domNode.style.opacity = e ? "1" : "0"));
  }
}
class ERe {
  constructor(e, t) {
    ((this.startLineNumber = e), (this.endLineNumber = t));
  }
}
class NRe {
  constructor(e, t, n) {
    ((this.range = e), (this.children = t), (this.parent = n));
  }
}
class LRe {
  constructor(e, t, n, i) {
    ((this.uri = e), (this.version = t), (this.element = n), (this.outlineProviderId = i));
  }
}
var DRe,
  TRe,
  IRe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  RRe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
(!(function (e) {
  ((e.OUTLINE_MODEL = "outlineModel"),
    (e.FOLDING_PROVIDER_MODEL = "foldingProviderModel"),
    (e.INDENTATION_MODEL = "indentationModel"));
})(DRe || (DRe = {})),
  (function (e) {
    ((e[(e.VALID = 0)] = "VALID"),
      (e[(e.INVALID = 1)] = "INVALID"),
      (e[(e.CANCELED = 2)] = "CANCELED"));
  })(TRe || (TRe = {})));
let ORe = class extends PO {
  constructor(e, t, n, i) {
    switch (
      (super(),
      (this._editor = e),
      (this._modelProviders = []),
      (this._modelPromise = null),
      (this._updateScheduler = this._register(new mM(300))),
      (this._updateOperation = this._register(new AO())),
      this._editor.getOption(131).defaultModel)
    ) {
      case DRe.OUTLINE_MODEL:
        this._modelProviders.push(new ARe(this._editor, i));
      case DRe.FOLDING_PROVIDER_MODEL:
        this._modelProviders.push(new FRe(this._editor, t, i));
      case DRe.INDENTATION_MODEL:
        this._modelProviders.push(new jRe(this._editor, n));
    }
  }
  dispose() {
    (this._modelProviders.forEach((e) => e.dispose()),
      this._updateOperation.clear(),
      this._cancelModelPromise(),
      super.dispose());
  }
  _cancelModelPromise() {
    this._modelPromise && (this._modelPromise.cancel(), (this._modelPromise = null));
  }
  async update(e) {
    return (
      this._updateOperation.clear(),
      this._updateOperation.add({
        dispose: () => {
          (this._cancelModelPromise(), this._updateScheduler.cancel());
        },
      }),
      this._cancelModelPromise(),
      await this._updateScheduler
        .trigger(async () => {
          for (const t of this._modelProviders) {
            const { statusPromise: n, modelPromise: i } = t.computeStickyModel(e);
            this._modelPromise = i;
            const r = await n;
            if (this._modelPromise !== i) return null;
            switch (r) {
              case TRe.CANCELED:
                return (this._updateOperation.clear(), null);
              case TRe.VALID:
                return t.stickyModel;
            }
          }
          return null;
        })
        .catch((e) => (HI(e), null))
    );
  }
};
ORe = IRe([RRe(2, vV), RRe(3, mee)], ORe);
class MRe extends PO {
  constructor(e) {
    (super(), (this._editor = e), (this._stickyModel = null));
  }
  get stickyModel() {
    return this._stickyModel;
  }
  _invalid() {
    return ((this._stickyModel = null), TRe.INVALID);
  }
  computeStickyModel(e) {
    if (e.isCancellationRequested || !this.isProviderValid())
      return { statusPromise: this._invalid(), modelPromise: null };
    const t = gM((e) => this.createModelFromProvider(e));
    return {
      statusPromise: t
        .then((t) =>
          this.isModelValid(t)
            ? e.isCancellationRequested
              ? TRe.CANCELED
              : ((this._stickyModel = this.createStickyModel(e, t)), TRe.VALID)
            : this._invalid(),
        )
        .then(void 0, (e) => (HI(e), TRe.CANCELED)),
      modelPromise: t,
    };
  }
  isModelValid(e) {
    return !0;
  }
  isProviderValid() {
    return !0;
  }
}
let ARe = class extends MRe {
  constructor(e, t) {
    (super(e), (this._languageFeaturesService = t));
  }
  createModelFromProvider(e) {
    return HNe.create(
      this._languageFeaturesService.documentSymbolProvider,
      this._editor.getModel(),
      e,
    );
  }
  createStickyModel(e, t) {
    const { stickyOutlineElement: n, providerID: i } = this._stickyModelFromOutlineModel(
        t,
        this._stickyModel?.outlineProviderId,
      ),
      r = this._editor.getModel();
    return new LRe(r.uri, r.getVersionId(), n, i);
  }
  isModelValid(e) {
    return e && e.children.size > 0;
  }
  _stickyModelFromOutlineModel(e, t) {
    let n;
    if (DO.first(e.children.values()) instanceof WNe) {
      const i = DO.find(e.children.values(), (e) => e.id === t);
      if (i) n = i.children;
      else {
        let i,
          r = "",
          o = -1;
        for (const [t, n] of e.children.entries()) {
          const e = this._findSumOfRangesOfGroup(n);
          e > o && ((i = n), (o = e), (r = n.id));
        }
        ((t = r), (n = i.children));
      }
    } else n = e.children;
    const i = [],
      r = Array.from(n.values()).sort((e, t) => {
        const n = new ERe(e.symbol.range.startLineNumber, e.symbol.range.endLineNumber),
          i = new ERe(t.symbol.range.startLineNumber, t.symbol.range.endLineNumber);
        return this._comparator(n, i);
      });
    for (const o of r)
      i.push(this._stickyModelFromOutlineElement(o, o.symbol.selectionRange.startLineNumber));
    return { stickyOutlineElement: new NRe(void 0, i, void 0), providerID: t };
  }
  _stickyModelFromOutlineElement(e, t) {
    const n = [];
    for (const r of e.children.values())
      if (r.symbol.selectionRange.startLineNumber !== r.symbol.range.endLineNumber)
        if (r.symbol.selectionRange.startLineNumber !== t)
          n.push(this._stickyModelFromOutlineElement(r, r.symbol.selectionRange.startLineNumber));
        else
          for (const e of r.children.values())
            n.push(this._stickyModelFromOutlineElement(e, r.symbol.selectionRange.startLineNumber));
    n.sort((e, t) => this._comparator(e.range, t.range));
    const i = new ERe(e.symbol.selectionRange.startLineNumber, e.symbol.range.endLineNumber);
    return new NRe(i, n, void 0);
  }
  _comparator(e, t) {
    return e.startLineNumber !== t.startLineNumber
      ? e.startLineNumber - t.startLineNumber
      : t.endLineNumber - e.endLineNumber;
  }
  _findSumOfRangesOfGroup(e) {
    let t = 0;
    for (const n of e.children.values()) t += this._findSumOfRangesOfGroup(n);
    return e instanceof VNe
      ? t + e.symbol.range.endLineNumber - e.symbol.selectionRange.startLineNumber
      : t;
  }
};
ARe = IRe([RRe(1, mee)], ARe);
class PRe extends MRe {
  constructor(e) {
    (super(e), (this._foldingLimitReporter = this._register(new yNe(e))));
  }
  createStickyModel(e, t) {
    const n = this._fromFoldingRegions(t),
      i = this._editor.getModel();
    return new LRe(i.uri, i.getVersionId(), n, void 0);
  }
  isModelValid(e) {
    return null !== e;
  }
  _fromFoldingRegions(e) {
    const t = e.length,
      n = [],
      i = new NRe(void 0, [], void 0);
    for (let r = 0; r < t; r++) {
      const t = e.getParentIndex(r);
      let o;
      o = -1 !== t ? n[t] : i;
      const s = new NRe(new ERe(e.getStartLineNumber(r), e.getEndLineNumber(r) + 1), [], o);
      (o.children.push(s), n.push(s));
    }
    return i;
  }
}
let jRe = class extends PRe {
  constructor(e, t) {
    (super(e),
      (this._languageConfigurationService = t),
      (this.provider = this._register(
        new tNe(e.getModel(), this._languageConfigurationService, this._foldingLimitReporter),
      )));
  }
  async createModelFromProvider(e) {
    return this.provider.compute(e);
  }
};
jRe = IRe([RRe(1, f$)], jRe);
let FRe = class extends PRe {
  constructor(e, t, n) {
    (super(e),
      (this._languageFeaturesService = n),
      (this.provider = this._register(new jO())),
      this._register(
        this._languageFeaturesService.foldingRangeProvider.onDidChange(() => {
          this._updateProvider(e, t);
        }),
      ),
      this._updateProvider(e, t));
  }
  _updateProvider(e, t) {
    const n = bNe.getFoldingRangeProviders(this._languageFeaturesService, e.getModel());
    0 !== n.length &&
      (this.provider.value = new pNe(e.getModel(), n, t, this._foldingLimitReporter, void 0));
  }
  isProviderValid() {
    return void 0 !== this.provider;
  }
  async createModelFromProvider(e) {
    return this.provider.value?.compute(e) ?? null;
  }
};
FRe = IRe([RRe(2, mee)], FRe);
var BRe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
class VRe {
  constructor(e, t, n, i) {
    ((this.startLineNumber = e), (this.endLineNumber = t), (this.top = n), (this.height = i));
  }
}
let WRe = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this._languageFeaturesService = t),
      (this._languageConfigurationService = n),
      (this._onDidChangeStickyScroll = this._register(new QO())),
      (this.onDidChangeStickyScroll = this._onDidChangeStickyScroll.event),
      (this._model = null),
      (this._cts = null),
      (this._stickyModelProvider = null),
      (this._editor = e),
      (this._sessionStore = this._register(new AO())),
      (this._updateSoon = this._register(new EM(() => this.update(), 50))),
      this._register(
        this._editor.onDidChangeConfiguration((e) => {
          e.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(
        MO(() => {
          (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 ORe(
          this._editor,
          () => this._updateSoon.schedule(),
          this._languageConfigurationService,
          this._languageFeaturesService,
        )));
  }
  async update() {
    (this._cts?.dispose(!0),
      (this._cts = new cM()),
      await this.updateStickyModel(this._cts.token),
      this._onDidChangeStickyScroll.fire());
  }
  async updateStickyModel(e) {
    if (
      !this._editor.hasModel() ||
      !this._stickyModelProvider ||
      this._editor.getModel().isTooLargeForTokenization()
    )
      return void (this._model = null);
    const t = await this._stickyModelProvider.update(e);
    e.isCancellationRequested || (this._model = t);
  }
  getCandidateStickyLinesIntersecting(e) {
    if (!this._model?.element) return [];
    const t = [];
    return (
      this.getCandidateStickyLinesIntersectingFromStickyModel(e, this._model.element, t, 0, 0, -1),
      this.filterHiddenRanges(t)
    );
  }
  getCandidateStickyLinesIntersectingFromStickyModel(e, t, n, i, r, o) {
    const s = this._editor.getModel();
    if (!s) return;
    if (0 === t.children.length) return;
    let a = o;
    const l = [];
    for (let u = 0; u < t.children.length; u++) {
      const e = t.children[u];
      e.range && l.push(e.range.startLineNumber);
    }
    const c = this.updateIndex(QP(l, e.startLineNumber, (e, t) => e - t)),
      d = this.updateIndex(QP(l, e.endLineNumber, (e, t) => e - t));
    for (let u = c; u <= d; u++) {
      const o = t.children[u];
      if (!o || !o.range) continue;
      const { startLineNumber: l, endLineNumber: c } = o.range;
      if (
        c > l + 1 &&
        e.startLineNumber <= c + 1 &&
        l - 1 <= e.endLineNumber &&
        l !== a &&
        s.isValidRange(new YH(l, 1, c, 1))
      ) {
        a = l;
        const t = this._editor.getLineHeightForPosition(new xV(l, 1));
        (n.push(new VRe(l, c - 1, r, t)),
          this.getCandidateStickyLinesIntersectingFromStickyModel(e, o, n, i + 1, r + t, l));
      }
    }
  }
  filterHiddenRanges(e) {
    const t = this._editor._getViewModel()?.getHiddenAreas();
    return t
      ? e.filter(
          (e) =>
            !t.some(
              (t) =>
                e.startLineNumber >= t.startLineNumber && e.endLineNumber <= t.endLineNumber + 1,
            ),
        )
      : e;
  }
  updateIndex(e) {
    return -1 === e ? 0 : e < 0 ? -e - 2 : e;
  }
};
WRe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([BRe(1, mee), BRe(2, f$)], WRe);
var HRe,
  zRe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let URe = class extends PO {
  static {
    HRe = this;
  }
  static {
    this.ID = "store.contrib.stickyScrollController";
  }
  constructor(e, t, n, i, r, o, s) {
    (super(),
      (this._editor = e),
      (this._contextMenuService = t),
      (this._languageFeaturesService = n),
      (this._instaService = i),
      (this._contextKeyService = s),
      (this._sessionStore = new AO()),
      (this._maxStickyLines = Number.MAX_SAFE_INTEGER),
      (this._candidateDefinitionsLength = -1),
      (this._focusedStickyElementIndex = -1),
      (this._enabled = !1),
      (this._focused = !1),
      (this._positionRevealed = !1),
      (this._onMouseDown = !1),
      (this._endLineNumbers = []),
      (this._mouseTarget = null),
      (this._onDidChangeStickyScrollHeight = this._register(new QO())),
      (this.onDidChangeStickyScrollHeight = this._onDidChangeStickyScrollHeight.event),
      (this._stickyScrollWidget = new CRe(this._editor)),
      (this._stickyLineCandidateProvider = new WRe(this._editor, n, r)),
      this._register(this._stickyScrollWidget),
      this._register(this._stickyLineCandidateProvider),
      (this._widgetState = vRe.Empty));
    const a = this._stickyScrollWidget.getDomNode();
    (this._register(
      this._editor.onDidChangeLineHeight((e) => {
        e.changes.forEach((e) => {
          const t = e.lineNumber;
          this._widgetState.startLineNumbers.includes(t) && this._renderStickyScroll(t);
        });
      }),
    ),
      this._register(
        this._editor.onDidChangeFont((e) => {
          e.changes.forEach((e) => {
            const t = e.lineNumber;
            this._widgetState.startLineNumbers.includes(t) && this._renderStickyScroll(t);
          });
        }),
      ),
      this._register(
        this._editor.onDidChangeConfiguration((e) => {
          this._readConfigurationChange(e);
        }),
      ),
      this._register(
        $F(a, DB.CONTEXT_MENU, async (e) => {
          this._onContextMenu(MF(a), e);
        }),
      ),
      (this._stickyScrollFocusedContextKey = $$.stickyScrollFocused.bindTo(
        this._contextKeyService,
      )),
      (this._stickyScrollVisibleContextKey = $$.stickyScrollVisible.bindTo(
        this._contextKeyService,
      )));
    const l = this._register(OB(a));
    (this._register(
      l.onDidBlur((e) => {
        !1 === this._positionRevealed && 0 === a.clientHeight
          ? ((this._focusedStickyElementIndex = -1), this.focus())
          : this._disposeFocusStickyScrollStore();
      }),
    ),
      this._register(
        l.onDidFocus((e) => {
          this.focus();
        }),
      ),
      this._registerMouseListeners(),
      this._register(
        $F(a, DB.MOUSE_DOWN, (e) => {
          this._onMouseDown = !0;
        }),
      ),
      this._register(
        this._stickyScrollWidget.onDidChangeStickyScrollHeight((e) => {
          this._onDidChangeStickyScrollHeight.fire(e);
        }),
      ),
      this._onDidResize(),
      this._readConfiguration());
  }
  get stickyScrollWidgetHeight() {
    return this._stickyScrollWidget.height;
  }
  static get(e) {
    return e.getContribution(HRe.ID);
  }
  _disposeFocusStickyScrollStore() {
    (this._stickyScrollFocusedContextKey.set(!1),
      this._focusDisposableStore?.dispose(),
      (this._focused = !1),
      (this._positionRevealed = !1),
      (this._onMouseDown = !1));
  }
  isFocused() {
    return this._focused;
  }
  focus() {
    if (this._onMouseDown) return ((this._onMouseDown = !1), void this._editor.focus());
    !0 !== this._stickyScrollFocusedContextKey.get() &&
      ((this._focused = !0),
      (this._focusDisposableStore = new AO()),
      this._stickyScrollFocusedContextKey.set(!0),
      (this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumbers.length - 1),
      this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex));
  }
  focusNext() {
    this._focusedStickyElementIndex < this._stickyScrollWidget.lineNumberCount - 1 &&
      this._focusNav(!0);
  }
  focusPrevious() {
    this._focusedStickyElementIndex > 0 && this._focusNav(!1);
  }
  selectEditor() {
    this._editor.focus();
  }
  _focusNav(e) {
    ((this._focusedStickyElementIndex = e
      ? this._focusedStickyElementIndex + 1
      : this._focusedStickyElementIndex - 1),
      this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex));
  }
  goToFocused() {
    const e = this._stickyScrollWidget.lineNumbers;
    (this._disposeFocusStickyScrollStore(),
      this._revealPosition({ lineNumber: e[this._focusedStickyElementIndex], column: 1 }));
  }
  _revealPosition(e) {
    this._reveaInEditor(e, () => this._editor.revealPosition(e));
  }
  _revealLineInCenterIfOutsideViewport(e) {
    this._reveaInEditor(e, () => this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber, 0));
  }
  _reveaInEditor(e, t) {
    (this._focused && this._disposeFocusStickyScrollStore(),
      (this._positionRevealed = !0),
      t(),
      this._editor.setSelection(YH.fromPositions(e)),
      this._editor.focus());
  }
  _registerMouseListeners() {
    const e = this._register(new AO()),
      t = this._register(
        new vye(this._editor, {
          extractLineNumberFromMouseEvent: (e) => {
            const t = this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);
            return t ? t.lineNumber : 0;
          },
        }),
      ),
      n = (e) => {
        if (!this._editor.hasModel()) return null;
        if (12 !== e.target.type || e.target.detail !== this._stickyScrollWidget.getId())
          return null;
        const t = e.target.element;
        if (!t || t.innerText !== t.innerHTML) return null;
        const n = this._stickyScrollWidget.getEditorPositionFromNode(t);
        return n
          ? {
              range: new YH(n.lineNumber, n.column, n.lineNumber, n.column + t.innerText.length),
              textElement: t,
            }
          : null;
      },
      i = this._stickyScrollWidget.getDomNode();
    (this._register(
      KF(i, DB.CLICK, (e) => {
        if (e.ctrlKey || e.altKey || e.metaKey) return;
        if (!e.leftButton) return;
        if (e.shiftKey) {
          const t = this._stickyScrollWidget.getLineIndexFromChildDomNode(e.target);
          if (null === t) return;
          const n = new xV(this._endLineNumbers[t], 1);
          return void this._revealLineInCenterIfOutsideViewport(n);
        }
        if (this._stickyScrollWidget.isInFoldingIconDomNode(e.target)) {
          const t = this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);
          return void this._toggleFoldingRegionForLine(t);
        }
        if (!this._stickyScrollWidget.isInStickyLine(e.target)) return;
        let t = this._stickyScrollWidget.getEditorPositionFromNode(e.target);
        if (!t) {
          const n = this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);
          if (null === n) return;
          t = new xV(n, 1);
        }
        this._revealPosition(t);
      }),
    ),
      this._register(
        $F(NI, DB.MOUSE_MOVE, (e) => {
          ((this._mouseTarget = e.target), this._onMouseMoveOrKeyDown(e));
        }),
      ),
      this._register(
        $F(NI, DB.KEY_DOWN, (e) => {
          this._onMouseMoveOrKeyDown(e);
        }),
      ),
      this._register(
        $F(NI, DB.KEY_UP, () => {
          void 0 !== this._showEndForLine &&
            ((this._showEndForLine = void 0), this._renderStickyScroll());
        }),
      ),
      this._register(
        t.onMouseMoveOrRelevantKeyDown(([t, i]) => {
          const r = n(t);
          if (!r || !t.hasTriggerModifier || !this._editor.hasModel()) return void e.clear();
          const { range: o, textElement: s } = r;
          if (o.equalsRange(this._stickyRangeProjectedOnEditor)) {
            if ("underline" === s.style.textDecoration) return;
          } else ((this._stickyRangeProjectedOnEditor = o), e.clear());
          const a = new cM();
          let l;
          (e.add(MO(() => a.dispose(!0))),
            NSe(
              this._languageFeaturesService.definitionProvider,
              this._editor.getModel(),
              new xV(o.startLineNumber, o.startColumn + 1),
              !1,
              a.token,
            ).then((t) => {
              if (!a.token.isCancellationRequested)
                if (0 !== t.length) {
                  this._candidateDefinitionsLength = t.length;
                  const n = s;
                  l !== n
                    ? (e.clear(),
                      (l = n),
                      (l.style.textDecoration = "underline"),
                      e.add(
                        MO(() => {
                          l.style.textDecoration = "none";
                        }),
                      ))
                    : l ||
                      ((l = n),
                      (l.style.textDecoration = "underline"),
                      e.add(
                        MO(() => {
                          l.style.textDecoration = "none";
                        }),
                      ));
                } else e.clear();
            }));
        }),
      ),
      this._register(
        t.onCancel(() => {
          e.clear();
        }),
      ),
      this._register(
        t.onExecute(async (e) => {
          if (12 !== e.target.type || e.target.detail !== this._stickyScrollWidget.getId()) return;
          const t = this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);
          t &&
            this._editor.hasModel() &&
            this._stickyRangeProjectedOnEditor &&
            (this._candidateDefinitionsLength > 1 &&
              (this._focused && this._disposeFocusStickyScrollStore(),
              this._revealPosition({ lineNumber: t.lineNumber, column: 1 })),
            this._instaService.invokeFunction(HSe, e, this._editor, {
              uri: this._editor.getModel().uri,
              range: this._stickyRangeProjectedOnEditor,
            }));
        }),
      ));
  }
  _onContextMenu(e, t) {
    const n = new EO(e, t);
    this._contextMenuService.showContextMenu({
      menuId: MW.StickyScrollContext,
      getAnchor: () => n,
    });
  }
  _onMouseMoveOrKeyDown(e) {
    if (!e.shiftKey) return;
    if (!this._mouseTarget || !SB(this._mouseTarget)) return;
    const t = this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);
    null !== t &&
      this._showEndForLine !== t &&
      ((this._showEndForLine = t), this._renderStickyScroll());
  }
  _toggleFoldingRegionForLine(e) {
    if (!this._foldingModel || null === e) return;
    const t = this._stickyScrollWidget.getRenderedStickyLine(e),
      n = t?.foldingIcon;
    if (!n) return;
    (KEe(this._foldingModel, 1, [e]), (n.isCollapsed = !n.isCollapsed));
    const i =
      (n.isCollapsed
        ? this._editor.getTopForLineNumber(n.foldingEndLine)
        : this._editor.getTopForLineNumber(n.foldingStartLine)) -
      this._editor.getOption(75) * t.index +
      1;
    (this._editor.setScrollTop(i), this._renderStickyScroll(e));
  }
  _readConfiguration() {
    const e = this._editor.getOption(131);
    if (!1 === e.enabled)
      return (
        this._editor.removeOverlayWidget(this._stickyScrollWidget),
        this._resetState(),
        this._sessionStore.clear(),
        void (this._enabled = !1)
      );
    e.enabled &&
      !this._enabled &&
      (this._editor.addOverlayWidget(this._stickyScrollWidget),
      this._sessionStore.add(
        this._editor.onDidScrollChange((e) => {
          e.scrollTopChanged && ((this._showEndForLine = void 0), this._renderStickyScroll());
        }),
      ),
      this._sessionStore.add(this._editor.onDidLayoutChange(() => this._onDidResize())),
      this._sessionStore.add(this._editor.onDidChangeModelTokens((e) => this._onTokensChange(e))),
      this._sessionStore.add(
        this._stickyLineCandidateProvider.onDidChangeStickyScroll(() => {
          ((this._showEndForLine = void 0), this._renderStickyScroll());
        }),
      ),
      (this._enabled = !0));
    2 === this._editor.getOption(76).renderType &&
      this._sessionStore.add(
        this._editor.onDidChangeCursorPosition(() => {
          ((this._showEndForLine = void 0), this._renderStickyScroll(0));
        }),
      );
  }
  _readConfigurationChange(e) {
    ((e.hasChanged(131) ||
      e.hasChanged(81) ||
      e.hasChanged(75) ||
      e.hasChanged(126) ||
      e.hasChanged(76)) &&
      this._readConfiguration(),
      (e.hasChanged(76) || e.hasChanged(52) || e.hasChanged(126)) && this._renderStickyScroll(0));
  }
  _needsUpdate(e) {
    const t = this._stickyScrollWidget.getCurrentLines();
    for (const n of t)
      for (const t of e.ranges) if (n >= t.fromLineNumber && n <= t.toLineNumber) return !0;
    return !1;
  }
  _onTokensChange(e) {
    this._needsUpdate(e) && this._renderStickyScroll(0);
  }
  _onDidResize() {
    const e = this._editor.getLayoutInfo().height / this._editor.getOption(75);
    ((this._maxStickyLines = Math.round(0.25 * e)), this._renderStickyScroll(0));
  }
  async _renderStickyScroll(e) {
    const t = this._editor.getModel();
    if (!t || t.isTooLargeForTokenization()) return void this._resetState();
    const n = this._updateAndGetMinRebuildFromLine(e),
      i = this._stickyLineCandidateProvider.getVersionId();
    if (void 0 === i || i === t.getVersionId())
      if (this._focused)
        if (-1 === this._focusedStickyElementIndex)
          (await this._updateState(n),
            (this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumberCount - 1),
            -1 !== this._focusedStickyElementIndex &&
              this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex));
        else {
          const e = this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];
          if ((await this._updateState(n), 0 === this._stickyScrollWidget.lineNumberCount))
            this._focusedStickyElementIndex = -1;
          else {
            (this._stickyScrollWidget.lineNumbers.includes(e) ||
              (this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumberCount - 1),
              this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex));
          }
        }
      else await this._updateState(n);
  }
  _updateAndGetMinRebuildFromLine(e) {
    if (void 0 !== e) {
      const t = void 0 !== this._minRebuildFromLine ? this._minRebuildFromLine : 1 / 0;
      this._minRebuildFromLine = Math.min(e, t);
    }
    return this._minRebuildFromLine;
  }
  async _updateState(e) {
    ((this._minRebuildFromLine = void 0),
      (this._foldingModel = (await bNe.get(this._editor)?.getFoldingModel()) ?? void 0),
      (this._widgetState = this.findScrollWidgetState()));
    const t = this._widgetState.startLineNumbers.length > 0;
    (this._stickyScrollVisibleContextKey.set(t),
      this._stickyScrollWidget.setState(this._widgetState, this._foldingModel, e));
  }
  async _resetState() {
    ((this._minRebuildFromLine = void 0),
      (this._foldingModel = void 0),
      (this._widgetState = vRe.Empty),
      this._stickyScrollVisibleContextKey.set(!1),
      this._stickyScrollWidget.setState(void 0, void 0));
  }
  findScrollWidgetState() {
    const e = Math.min(this._maxStickyLines, this._editor.getOption(131).maxLineCount),
      t = this._editor.getScrollTop();
    let n = 0;
    const i = [],
      r = [],
      o = this._editor.getVisibleRanges();
    if (0 !== o.length) {
      const s = new ERe(o[0].startLineNumber, o[o.length - 1].endLineNumber),
        a = this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(s);
      for (const o of a) {
        const s = o.startLineNumber,
          a = o.endLineNumber,
          l = o.top,
          c = l + o.height,
          d = this._editor.getTopForLineNumber(s) - t,
          u = this._editor.getBottomForLineNumber(a) - t;
        if ((l > d && l <= u && (i.push(s), r.push(a + 1), c > u && (n = u - c)), i.length === e))
          break;
      }
    }
    return ((this._endLineNumbers = r), new vRe(i, r, n, this._showEndForLine));
  }
  dispose() {
    (super.dispose(), this._sessionStore.dispose());
  }
};
URe = HRe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([zRe(1, cde), zRe(2, mee), zRe(3, vV), zRe(4, f$), zRe(5, gme), zRe(6, xW)], URe);
const $Re = SG(
    "inlineEdit.originalBackground",
    NG(TZ, 0.2),
    SI(1220, "Background color for the original text in inline edits."),
    !0,
  ),
  qRe = SG(
    "inlineEdit.modifiedBackground",
    NG(DZ, 0.3),
    SI(1221, "Background color for the modified text in inline edits."),
    !0,
  );
SG(
  "inlineEdit.originalChangedLineBackground",
  NG(TZ, 0.8),
  SI(1222, "Background color for the changed lines in the original text of inline edits."),
  !0,
);
const KRe = SG(
    "inlineEdit.originalChangedTextBackground",
    NG(TZ, 0.8),
    SI(1223, "Overlay color for the changed text in the original text of inline edits."),
    !0,
  ),
  GRe = SG(
    "inlineEdit.modifiedChangedLineBackground",
    { light: NG(IZ, 0.7), dark: NG(IZ, 0.7), hcDark: IZ, hcLight: IZ },
    SI(1224, "Background color for the changed lines in the modified text of inline edits."),
    !0,
  ),
  ZRe = SG(
    "inlineEdit.modifiedChangedTextBackground",
    NG(DZ, 0.7),
    SI(1225, "Overlay color for the changed text in the modified text of inline edits."),
    !0,
  ),
  YRe = SG(
    "inlineEdit.gutterIndicator.primaryForeground",
    NY,
    SI(1226, "Foreground color for the primary inline edit gutter indicator."),
  ),
  XRe = SG(
    "inlineEdit.gutterIndicator.primaryBorder",
    DY,
    SI(1227, "Border color for the primary inline edit gutter indicator."),
  ),
  QRe = SG(
    "inlineEdit.gutterIndicator.primaryBackground",
    { light: NG(XRe, 0.5), dark: NG(XRe, 0.4), hcDark: NG(XRe, 0.4), hcLight: NG(XRe, 0.5) },
    SI(1228, "Background color for the primary inline edit gutter indicator."),
  ),
  JRe = SG(
    "inlineEdit.gutterIndicator.secondaryForeground",
    RY,
    SI(1229, "Foreground color for the secondary inline edit gutter indicator."),
  ),
  eOe = SG(
    "inlineEdit.gutterIndicator.secondaryBorder",
    OY,
    SI(1230, "Border color for the secondary inline edit gutter indicator."),
  ),
  tOe = SG(
    "inlineEdit.gutterIndicator.secondaryBackground",
    eOe,
    SI(1231, "Background color for the secondary inline edit gutter indicator."),
  ),
  nOe = SG(
    "inlineEdit.gutterIndicator.successfulForeground",
    NY,
    SI(1232, "Foreground color for the successful inline edit gutter indicator."),
  ),
  iOe = SG(
    "inlineEdit.gutterIndicator.successfulBorder",
    DY,
    SI(1233, "Border color for the successful inline edit gutter indicator."),
  ),
  rOe = SG(
    "inlineEdit.gutterIndicator.successfulBackground",
    iOe,
    SI(1234, "Background color for the successful inline edit gutter indicator."),
  ),
  oOe = SG(
    "inlineEdit.gutterIndicator.background",
    {
      hcDark: NG("tab.inactiveBackground", 0.5),
      hcLight: NG("tab.inactiveBackground", 0.5),
      dark: NG("tab.inactiveBackground", 0.5),
      light: "#5f5f5f18",
    },
    SI(1235, "Background color for the inline edit gutter indicator."),
  ),
  sOe = SG(
    "inlineEdit.originalBorder",
    { light: TZ, dark: TZ, hcDark: TZ, hcLight: TZ },
    SI(1236, "Border color for the original text in inline edits."),
  ),
  aOe = SG(
    "inlineEdit.modifiedBorder",
    { light: kG(DZ, 0.6), dark: DZ, hcDark: DZ, hcLight: DZ },
    SI(1237, "Border color for the modified text in inline edits."),
  ),
  lOe = SG(
    "inlineEdit.tabWillAcceptModifiedBorder",
    { light: kG(aOe, 0), dark: kG(aOe, 0), hcDark: kG(aOe, 0), hcLight: kG(aOe, 0) },
    SI(1238, "Modified border color for the inline edits widget when tab will accept it."),
  ),
  cOe = SG(
    "inlineEdit.tabWillAcceptOriginalBorder",
    { light: kG(sOe, 0), dark: kG(sOe, 0), hcDark: kG(sOe, 0), hcLight: kG(sOe, 0) },
    SI(
      1239,
      "Original border color for the inline edits widget over the original text when tab will accept it.",
    ),
  );
function dOe(e) {
  return e.map((e) => (e === CTe.Accept ? lOe : aOe));
}
function uOe(e) {
  return e.map((e) => (e === CTe.Accept ? cOe : sOe));
}
function hOe(e, t) {
  let n;
  n = "string" == typeof e ? gOe(e, t) : e.map((e, n) => gOe(e, t).read(n));
  const i = gOe(GG, t);
  return n.map((e, t) => e.makeOpaque(i.read(t)));
}
function gOe(e, t) {
  return pF(
    {
      owner: { observeColor: e },
      equalsFn: (e, t) => e.equals(t),
      debugName: () => `observeColor(${e})`,
    },
    t.onDidColorThemeChange,
    () => {
      const n = t.getColorTheme().getColor(e);
      if (!n) throw new QI(`Missing color: ${e}`);
      return n;
    },
  );
}
function pOe(e, t, n) {
  (e.layoutInfo.read(n), e.value.read(n));
  const i = e.model.read(n);
  if (!i) return 0;
  let r = 0;
  e.scrollTop.read(n);
  for (let s = t.startLineNumber; s < t.endLineNumberExclusive; s++) {
    const t = i.getLineMaxColumn(s);
    let n = e.editor.getOffsetForColumn(s, t);
    if (-1 === n) {
      n = t * e.editor.getOption(59).typicalHalfwidthCharacterWidth;
    }
    r = Math.max(r, n);
  }
  const o = t.mapToLineArray((e) => i.getLineContent(e));
  return (r < 5 && o.some((e) => e.length > 0) && i.uri.scheme, r);
}
function fOe(e, t, n, i, r = void 0) {
  const o = i.getModel();
  if (!o) return { prefixTrim: 0, prefixLeftOffset: 0 };
  const s = e.map((e) => (e.isSingleLine() ? e.startColumn - 1 : 0)),
    a = t.mapToLineArray((e) => J7(o.getLineContent(e))),
    l = n.filter((e) => "" !== e).map((e) => J7(e)),
    c = Math.min(...s, ...a, ...l);
  let d;
  if (o.getLineIndentColumn(t.startLineNumber) >= c + 1)
    (xde(i).scrollTop.read(r), (d = i.getOffsetForColumn(t.startLineNumber, c + 1)));
  else {
    if (!(n.length > 0)) return { prefixTrim: 0, prefixLeftOffset: 0 };
    d = mOe(n[0].slice(0, c), i, o);
  }
  return { prefixTrim: c, prefixLeftOffset: d };
}
function mOe(e, t, n) {
  const i = t.getOption(59).typicalHalfwidthCharacterWidth,
    r = n.getOptions().tabSize * i,
    o = e.split("\t").length - 1;
  return (e.length - o) * i + o * r;
}
function _Oe(e) {
  const t = e.layoutInfoContentLeft,
    n = Xj({ name: "editor.validOverlay.width" }, (n) => {
      const i = 0 !== e.layoutInfoMinimap.read(n).minimapLeft,
        r = e.layoutInfoWidth.read(n) - t.read(n);
      if (i) {
        return (
          r -
          (e.layoutInfoMinimap.read(n).minimapWidth + e.layoutInfoVerticalScrollbarWidth.read(n))
        );
      }
      return r;
    }),
    i = Xj(
      { name: "editor.validOverlay.height" },
      (t) => e.layoutInfoHeight.read(t) + e.contentHeight.read(t),
    );
  return Xj({ name: "editor.validOverlay" }, (e) =>
    _Re.fromLeftTopWidthHeight(t.read(e), 0, n.read(e), i.read(e)),
  );
}
function vOe(...e) {
  return e.filter((e) => "string" == typeof e).join(" ");
}
function bOe(e, t, n) {
  const i = ZM(e),
    r = [],
    o = B1(
      t.mapToLineArray((e) =>
        (function (e, t) {
          let n = 0;
          e: for (let i = 0, r = e.length; i < r; i++)
            switch (e.charCodeAt(i)) {
              case 9:
                n += t;
                break;
              case 32:
                n++;
                break;
              default:
                break e;
            }
          return n - (n % t);
        })(i[e - 1], n),
      ),
      yj,
    );
  return (
    t.forEach((e) => {
      const t = (function (e, t, n) {
        let i = t - (t % n),
          r = 0;
        for (; r < e.length && 0 !== i; r++)
          switch (e.charCodeAt(r)) {
            case 9:
              i -= n;
              break;
            case 32:
              i--;
              break;
            default:
              throw new QI("Unexpected character found while calculating indent length");
          }
        return r;
      })(i[e - 1], o, n);
      var s, a;
      r.push(
        new c3(
          ((s = new N$(0, t)),
          (a = new xV(e, 1)),
          new YH(a.lineNumber, a.column + s.start, a.lineNumber, a.column + s.endExclusive)),
          "",
        ),
      );
    }),
    new l3(r)
  );
}
class yOe {
  constructor() {
    this._data = "";
  }
  moveTo(e) {
    return ((this._data += `M ${e.x} ${e.y} `), this);
  }
  lineTo(e) {
    return ((this._data += `L ${e.x} ${e.y} `), this);
  }
  build() {
    return this._data;
  }
}
function xOe(e) {
  const t = bF(void 0, (t, n) => e.read(t) || n);
  return Jj({ debugName: () => `${e.debugName}.mapOutFalsy` }, (n) => {
    t.read(n);
    if (e.read(n)) return t;
  });
}
function wOe(e, t = Tj.ofCaller()) {
  return {
    left: Xj({ name: "editor.validOverlay.left" }, (t) => e(t).left, t),
    top: Xj({ name: "editor.validOverlay.top" }, (t) => e(t).top, t),
    width: Xj({ name: "editor.validOverlay.width" }, (t) => e(t).right - e(t).left, t),
    height: Xj({ name: "editor.validOverlay.height" }, (t) => e(t).bottom - e(t).top, t),
  };
}
var COe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let SOe = class {
  constructor(e, t, n, i, r, o) {
    ((this._model = e),
      (this._close = t),
      (this._editorObs = n),
      (this._contextKeyService = i),
      (this._keybindingService = r),
      (this._commandService = o),
      (this._inlineEditsShowCollapsed = this._editorObs
        .getOption(71)
        .map((e) => e.edits.showCollapsed)));
  }
  toDisposableLiveElement() {
    return this._createHoverContent().toDisposableLiveElement();
  }
  _createHoverContent() {
    const e = LF("active", void 0),
      t = (t) => ({
        title: t.title,
        icon: t.icon,
        keybinding:
          "string" == typeof t.commandId
            ? this._getKeybinding(t.commandArgs ? void 0 : t.commandId)
            : Xj(this, (e) =>
                "string" == typeof t.commandId
                  ? void 0
                  : this._getKeybinding(t.commandArgs ? void 0 : t.commandId.read(e)).read(e),
              ),
        isActive: e.map((e) => e === t.id),
        onHoverChange: (n) => e.set(n ? t.id : void 0, void 0),
        onAction: () => (
          this._close(!0),
          this._commandService.executeCommand(
            "string" == typeof t.commandId ? t.commandId : t.commandId.get(),
            ...(t.commandArgs ?? []),
          )
        ),
      }),
      n = (function (e) {
        return XB.div(
          {
            class: "header",
            style: {
              color: yG(AG),
              fontSize: "13px",
              fontWeight: "600",
              padding: "0 4px",
              lineHeight: 28,
            },
          },
          [e],
        );
      })(this._model.displayName),
      i = kOe(
        t({
          id: "gotoAndAccept",
          title: `${SI(1212, "Go To")} / ${SI(1213, "Accept")}`,
          icon: OV.check,
          commandId: Gme,
        }),
      ),
      r = kOe(t({ id: "reject", title: SI(1214, "Reject"), icon: OV.close, commandId: Xme })),
      o = this._model.extensionCommands.map((e, n) =>
        kOe(
          t({
            id: e.command.id + "_" + n,
            title: e.command.title,
            icon: e.icon ?? OV.symbolEvent,
            commandId: e.command.id,
            commandArgs: e.command.arguments,
          }),
        ),
      ),
      s = this._inlineEditsShowCollapsed.map((e) =>
        kOe(
          t(
            e
              ? {
                  id: "showExpanded",
                  title: SI(1215, "Show Expanded"),
                  icon: OV.expandAll,
                  commandId: Qme,
                }
              : {
                  id: "showCollapsed",
                  title: SI(1216, "Show Collapsed"),
                  icon: OV.collapseAll,
                  commandId: Qme,
                },
          ),
        ),
      ),
      a = kOe(
        t({
          id: "snooze",
          title: SI(1217, "Snooze"),
          icon: OV.bellSlash,
          commandId: "editor.action.inlineSuggest.snooze",
        }),
      ),
      l = kOe(
        t({
          id: "settings",
          title: SI(1218, "Settings"),
          icon: OV.gear,
          commandId: "workbench.action.openSettings",
          commandArgs: ["@tag:nextEditSuggestions"],
        }),
      ),
      c = this._model.action ? [this._model.action] : [],
      d =
        c.length > 0
          ? (function (e, t) {
              return Xj({ name: "inlineEdits.actionBar" }, (n) =>
                XB.div({ class: ["action-widget-action-bar"], style: { padding: "3px 24px" } }, [
                  XB.div({
                    ref: (i) => {
                      n.store.add(new Cle(i, t)).push(e, { icon: !1, label: !0 });
                    },
                  }),
                ]),
              );
            })(
              c.map((e) => ({
                id: e.id,
                label: e.title + "...",
                enabled: !0,
                run: () => this._commandService.executeCommand(e.id, ...(e.arguments ?? [])),
                class: void 0,
                tooltip: e.tooltip ?? e.title,
              })),
              { hoverDelegate: Jue },
            )
          : void 0;
    return (
      (u = [n, i, r, s, o.length ? EOe() : void 0, a, l, ...o, d ? EOe() : void 0, d]),
      XB.div({ class: "content", style: { margin: 4, minWidth: 180 } }, u)
    );
    var u;
  }
  _getKeybinding(e) {
    return e
      ? gF(this._contextKeyService.onDidChangeContext, () =>
          this._keybindingService.lookupKeybinding(e),
        )
      : xne(void 0);
  }
};
function kOe(e) {
  return Xj({ name: "inlineEdits.option" }, (t) =>
    XB.div(
      {
        class: ["monaco-menu-option", e.isActive?.map((e) => e && "active")],
        onmouseenter: () => e.onHoverChange?.(!0),
        onmouseleave: () => e.onHoverChange?.(!1),
        onclick: e.onAction,
        onkeydown: (t) => {
          "Enter" === t.key && e.onAction?.();
        },
        tabIndex: 0,
        style: { borderRadius: 3 },
      },
      [
        XB.elem("span", { style: { fontSize: 16, display: "flex" } }, [
          AV.isThemeIcon(e.icon) ? Hse(e.icon) : e.icon.map((e) => Hse(e)),
        ]),
        XB.elem("span", {}, [e.title]),
        XB.div({
          style: { marginLeft: "auto" },
          ref: (n) => {
            const i = t.store.add(
              new vpe(n, GR, {
                disableTitle: !0,
                ...lue,
                keybindingLabelShadow: void 0,
                keybindingLabelForeground: yG(AG),
                keybindingLabelBackground: "transparent",
                keybindingLabelBorder: "transparent",
                keybindingLabelBottomBorder: void 0,
              }),
            );
            t.store.add(
              rF((t) => {
                i.set(e.keybinding.read(t));
              }),
            );
          },
        }),
      ],
    ),
  );
}
function EOe() {
  return XB.div(
    {
      id: "inline-edit-gutter-indicator-menu-separator",
      class: "menu-separator",
      style: { color: yG(EX), padding: "2px 0" },
    },
    XB.div({ style: { borderBottom: `1px solid ${yG(bZ)}` } }),
  );
}
SOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([COe(3, xW), COe(4, N5), COe(5, PV)], SOe);
var NOe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let LOe = class extends PO {
  get model() {
    const e = this._model.get();
    if (!e) throw new QI("Inline Edit Model not available");
    return e;
  }
  constructor(e, t, n, i, r, o, s, a, l, c) {
    (super(),
      (this._editorObs = e),
      (this._originalRange = t),
      (this._verticalOffset = n),
      (this._model = i),
      (this._isHoveringOverInlineEdit = r),
      (this._focusIsInMenu = o),
      (this._hoverService = s),
      (this._instantiationService = a),
      (this._accessibilityService = l),
      (this._tabAction = Xj(this, (e) => {
        const t = this._model.read(e);
        return t ? t.tabAction.read(e) : CTe.Inactive;
      })),
      (this._hoverVisible = LF(this, !1)),
      (this.isHoverVisible = this._hoverVisible),
      (this._isHoveredOverIcon = LF(this, !1)),
      (this._isHoveredOverIconDebounced = mF(this._isHoveredOverIcon, 100)),
      (this.isHoveredOverIcon = this._isHoveredOverIconDebounced),
      (this._isHoveredOverInlineEditDebounced = mF(this._isHoveringOverInlineEdit, 100)),
      (this._gutterIndicatorStyles = this._tabAction.map(this, (e, t) => {
        switch (e) {
          case CTe.Inactive:
            return {
              background: hOe(tOe, c).read(t).toString(),
              foreground: hOe(JRe, c).read(t).toString(),
              border: hOe(eOe, c).read(t).toString(),
            };
          case CTe.Jump:
            return {
              background: hOe(QRe, c).read(t).toString(),
              foreground: hOe(YRe, c).read(t).toString(),
              border: hOe(XRe, c).read(t).toString(),
            };
          case CTe.Accept:
            return {
              background: hOe(rOe, c).read(t).toString(),
              foreground: hOe(nOe, c).read(t).toString(),
              border: hOe(iOe, c).read(t).toString(),
            };
          default:
            eR();
        }
      })),
      (this._originalRangeObs = xOe(this._originalRange)),
      (this._state = Xj(this, (e) => {
        const t = this._originalRangeObs.read(e);
        if (t)
          return { range: t, lineOffsetRange: this._editorObs.observeLineOffsetRange(t, e.store) };
      })),
      (this._stickyScrollController = URe.get(this._editorObs.editor)),
      (this._stickyScrollHeight = this._stickyScrollController
        ? gF(
            this._stickyScrollController.onDidChangeStickyScrollHeight,
            () => this._stickyScrollController.stickyScrollWidgetHeight,
          )
        : xne(0)),
      (this._lineNumberToRender = Xj(this, (e) => {
        if (0 !== this._verticalOffset.read(e)) return "";
        const t = this._originalRange.read(e)?.startLineNumber,
          n = this._editorObs.getOption(76).read(e);
        if (void 0 === t || 0 === n.renderType) return "";
        if (3 === n.renderType) {
          const n = this._editorObs.cursorPosition.read(e);
          return t % 10 == 0 || (n && n.lineNumber === t) ? t.toString() : "";
        }
        if (2 === n.renderType) {
          const n = this._editorObs.cursorPosition.read(e);
          if (!n) return "";
          const i = Math.abs(t - n.lineNumber);
          return 0 === i ? t.toString() : i.toString();
        }
        return 4 === n.renderType ? (n.renderFn ? n.renderFn(t) : "") : t.toString();
      })),
      (this._availableWidthForIcon = Xj(this, (e) => {
        const t = this._editorObs.editor.getModel(),
          n = this._editorObs.editor,
          i = this._editorObs.layoutInfo.read(e),
          r = i.decorationsLeft + i.decorationsWidth - i.glyphMarginLeft;
        if (!t || r <= 0) return () => 0;
        if (0 === i.lineNumbersLeft) return () => r;
        const o = this._editorObs.getOption(76).read(e);
        if (2 === o.renderType || 0 === o.renderType) return () => r;
        const s = n.getOption(59).typicalHalfwidthCharacterWidth,
          a = i.lineNumbersLeft + i.lineNumbersWidth,
          l = (t.getLineCount() + 1).toString().length,
          c = [];
        for (let d = 1; d <= l; d++) {
          const e = 10 ** (d - 1),
            t = n.getTopForLineNumber(e),
            o = d * s,
            l = Math.min(r, Math.max(0, a - o - i.glyphMarginLeft));
          c.push({
            firstLineNumberWithDigitCount: e,
            topOfLineNumber: t,
            usableWidthLeftOfLineNumber: l,
          });
        }
        return (e) => {
          for (let t = c.length - 1; t >= 0; t--)
            if (e >= c[t].topOfLineNumber) return c[t].usableWidthLeftOfLineNumber;
          throw new QI("Could not find avilable width for icon");
        };
      })),
      (this._layout = Xj(this, (e) => {
        const t = this._state.read(e);
        if (!t) return;
        const n = this._editorObs.layoutInfo.read(e),
          i = this._editorObs
            .observeLineHeightForLine(t.range.map((e) => e.startLineNumber))
            .read(e),
          r = n.decorationsLeft + n.decorationsWidth - n.glyphMarginLeft - 4,
          o = n.height - 4,
          s = _Re.fromLeftTopWidthHeight(2, 2, r, o),
          a = s.withTop(this._stickyScrollHeight.read(e)),
          l = s.withTop(a.top + 2),
          c = t.lineOffsetRange.read(e),
          d = _Re.fromRanges(N$.fromTo(l.left, l.right), c),
          u = i,
          h = this._verticalOffset.read(e),
          g = d.withHeight(u).translateY(h),
          p = a.containsRect(g),
          f = this._tabAction.map((e) => (e === CTe.Accept ? OV.keyboardTab : OV.arrowRight)),
          m = Xj(this, (e) => {
            if (
              this._isHoveredOverIconDebounced.read(e) ||
              this._isHoveredOverInlineEditDebounced.read(e)
            )
              return OV.check;
            if (this._tabAction.read(e) === CTe.Accept) return OV.keyboardTab;
            return (this._editorObs.cursorLineNumber.read(e) ?? 0) <=
              t.range.read(e).startLineNumber
              ? OV.keyboardTabAbove
              : OV.keyboardTabBelow;
          }),
          _ = (e) => {
            const t =
              this._availableWidthForIcon.read(void 0)(
                e.bottom + this._editorObs.editor.getScrollTop(),
              ) - 2;
            return Math.max(Math.min(t, 22), 16);
          };
        if (p) {
          const e = g;
          let t;
          t =
            0 === n.lineNumbersWidth
              ? Math.min(Math.max(n.lineNumbersLeft - s.left, 0), e.width - 22)
              : Math.max(n.lineNumbersLeft + n.lineNumbersWidth - s.left, 0);
          const i = e.withWidth(t),
            r = Math.max(Math.min(n.decorationsWidth, 22), 16);
          return {
            gutterEditArea: d,
            icon: m,
            iconDirection: "right",
            iconRect: e.withWidth(r).translateX(t),
            pillRect: e,
            lineNumberRect: i,
          };
        }
        const v = s.intersect(d);
        if (v && v.height >= u) {
          const e = g.moveToBeContainedIn(l).moveToBeContainedIn(v),
            t = e.withWidth(_(e));
          return { gutterEditArea: d, icon: m, iconDirection: "right", iconRect: t, pillRect: t };
        }
        const b = g.moveToBeContainedIn(s),
          y = b.withWidth(_(b)),
          x = y;
        return {
          gutterEditArea: d,
          icon: f,
          iconDirection: y.top < g.top ? "top" : "bottom",
          iconRect: x,
          pillRect: y,
        };
      })),
      (this._iconRef = XB.ref()),
      (this.isVisible = this._layout.map((e) => !!e)),
      (this._indicator = XB.div(
        {
          class: "inline-edits-view-gutter-indicator",
          onclick: () => {
            const e = this._layout.get(),
              t = e?.icon.get() === OV.check;
            (this._editorObs.editor.focus(), t ? this.model.accept() : this.model.jump());
          },
          tabIndex: 0,
          style: { position: "absolute", overflow: "visible" },
        },
        xOe(this._layout).map((e) =>
          e
            ? [
                XB.div({
                  style: {
                    position: "absolute",
                    background: yG(oOe),
                    borderRadius: "4px",
                    ...wOe((t) => e.read(t).gutterEditArea),
                  },
                }),
                XB.div(
                  {
                    class: "icon",
                    ref: this._iconRef,
                    onmouseenter: () => {
                      this._showHover();
                    },
                    style: {
                      cursor: "pointer",
                      zIndex: "20",
                      position: "absolute",
                      backgroundColor: this._gutterIndicatorStyles.map((e) => e.background),
                      "--vscodeIconForeground": this._gutterIndicatorStyles.map(
                        (e) => e.foreground,
                      ),
                      border: this._gutterIndicatorStyles.map((e) => `1px solid ${e.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",
                      ...wOe((t) => e.read(t).pillRect),
                    },
                  },
                  [
                    XB.div(
                      {
                        className: "line-number",
                        style: {
                          lineHeight: e.map((e) =>
                            e.lineNumberRect ? e.lineNumberRect.height : 0,
                          ),
                          display: e.map((e) => (e.lineNumberRect ? "flex" : "none")),
                          alignItems: "center",
                          justifyContent: "flex-end",
                          width: e.map((e) => (e.lineNumberRect ? e.lineNumberRect.width : 0)),
                          height: "100%",
                          color: this._gutterIndicatorStyles.map((e) => e.foreground),
                        },
                      },
                      this._lineNumberToRender,
                    ),
                    XB.div(
                      {
                        style: {
                          rotate: e.map(
                            (e) =>
                              `${(function (e) {
                                switch (e) {
                                  case "top":
                                    return 90;
                                  case "bottom":
                                    return -90;
                                  case "right":
                                    return 0;
                                }
                              })(e.iconDirection)}deg`,
                          ),
                          transition: "rotate 0.2s ease-in-out",
                          display: "flex",
                          alignItems: "center",
                          justifyContent: "center",
                          height: "100%",
                          marginRight: e.map(
                            (e) =>
                              e.pillRect.width - e.iconRect.width - (e.lineNumberRect?.width ?? 0),
                          ),
                          width: e.map((e) => e.iconRect.width),
                        },
                      },
                      [e.map((e, t) => Hse(e.icon.read(t)))],
                    ),
                  ],
                ),
              ]
            : [],
        ),
      ).keepUpdated(this._store)),
      this._register(
        this._editorObs.createOverlayWidget({
          domNode: this._indicator.element,
          position: xne(null),
          allowEditorOverflow: !1,
          minContentWidthInPx: xne(0),
        }),
      ),
      this._register(
        this._editorObs.editor.onMouseMove((e) => {
          if (void 0 === this._state.get()) return;
          const t = this._iconRef.element.getBoundingClientRect(),
            n = _Re.fromLeftTopWidthHeight(t.left, t.top, t.width, t.height),
            i = new yde(e.event.posx, e.event.posy);
          this._isHoveredOverIcon.set(n.containsPoint(i), void 0);
        }),
      ),
      this._register(
        this._editorObs.editor.onDidScrollChange(() => {
          this._isHoveredOverIcon.set(!1, void 0);
        }),
      ),
      this._register(
        s5(this._isHoveredOverInlineEditDebounced, (e) => {
          e && this.triggerAnimation();
        }),
      ),
      this._register(
        rF((e) => {
          (this._indicator.readEffect(e),
            this._indicator.element &&
              this._editorObs.editor.applyFontInfo(this._indicator.element));
        }),
      ));
  }
  triggerAnimation() {
    if (this._accessibilityService.isMotionReduced()) return new Animation(null, null).finished;
    const e = this._iconRef.element.animate(
      [
        {
          outline: `2px solid ${this._gutterIndicatorStyles.map((e) => e.border).get()}`,
          outlineOffset: "-1px",
          offset: 0,
        },
        { outline: "2px solid transparent", outlineOffset: "10px", offset: 1 },
      ],
      { duration: 500 },
    );
    return e.finished;
  }
  _showHover() {
    if (this._hoverVisible.get()) return;
    const e = new AO(),
      t = e.add(
        this._instantiationService
          .createInstance(
            SOe,
            this.model,
            (e) => {
              (e && this._editorObs.editor.focus(), i?.dispose());
            },
            this._editorObs,
          )
          .toDisposableLiveElement(),
      ),
      n = e.add(OB(t.element));
    (e.add(n.onDidBlur(() => this._focusIsInMenu.set(!1, void 0))),
      e.add(n.onDidFocus(() => this._focusIsInMenu.set(!0, void 0))),
      e.add(MO(() => this._focusIsInMenu.set(!1, void 0))));
    const i = this._hoverService.showInstantHover({
      target: this._iconRef.element,
      content: t.element,
    });
    i
      ? (this._hoverVisible.set(!0, void 0),
        e.add(this._editorObs.editor.onDidScrollChange(() => i.dispose())),
        e.add(
          i.onDispose(() => {
            (this._hoverVisible.set(!1, void 0), e.dispose());
          }),
        ))
      : e.dispose();
  }
};
LOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([NOe(6, Xue), NOe(7, vV), NOe(8, KK), NOe(9, h0)], LOe);
var DOe,
  TOe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
!(function (e) {
  ((e.FirstTime = "firstTime"), (e.SecondTime = "secondTime"), (e.Active = "active"));
})(DOe || (DOe = {}));
let IOe = class extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._host = e),
      (this._model = t),
      (this._indicator = n),
      (this._collapsedView = i),
      (this._storageService = r),
      (this._configurationService = o),
      (this._disposables = this._register(new jO())),
      (this._setupDone = LF({ name: "setupDone" }, !1)),
      (this._activeCompletionId = Xj((e) => {
        const t = this._model.read(e);
        if (!t) return;
        if (!this._setupDone.read(e)) return;
        const n = this._indicator.read(e);
        return n && n.isVisible.read(e) ? t.inlineEdit.inlineCompletion.identity.id : void 0;
      })),
      this._register(this._initializeDebugSetting()),
      (this._disposables.value = this.setupNewUserExperience()),
      this._setupDone.set(!0, void 0));
  }
  setupNewUserExperience() {
    if (this.getNewUserType() === DOe.Active) return;
    const e = new AO();
    let t = !1,
      n = !1,
      i = 0,
      r = 0;
    return (
      e.add(
        (function (e, t) {
          return a5(e, (e, n, i, r) => {
            t(e, n, i, dM(r));
          });
        })(this._activeCompletionId, async (e, o, s, a) => {
          if (void 0 === e) return;
          let l = this.getNewUserType();
          switch (l) {
            case DOe.FirstTime:
              (i++ >= 5 || t) && ((l = DOe.SecondTime), this.setNewUserType(l));
              break;
            case DOe.SecondTime:
              r++ >= 3 && n && ((l = DOe.Active), this.setNewUserType(l));
          }
          switch (l) {
            case DOe.FirstTime:
              for (let e = 0; e < 3 && !a.isCancellationRequested; e++)
                (await this._indicator.get()?.triggerAnimation(), await vM(500));
              break;
            case DOe.SecondTime:
              this._indicator.get()?.triggerAnimation();
          }
        }),
      ),
      e.add(
        rF((e) => {
          this._collapsedView.isVisible.read(e) &&
            this.getNewUserType() !== DOe.Active &&
            this._collapsedView.triggerAnimation();
        }),
      ),
      e.add(
        aF((e, n) => {
          const i = this._indicator.read(e);
          i &&
            n.add(
              s5(i.isHoveredOverIcon, async (e) => {
                e && (t = !0);
              }),
            );
        }),
      ),
      e.add(
        aF((e, t) => {
          const i = this._host.read(e);
          i &&
            t.add(
              i.onDidAccept(() => {
                n = !0;
              }),
            );
        }),
      ),
      e
    );
  }
  getNewUserType() {
    return this._storageService.get("inlineEditsGutterIndicatorUserKind", -1, DOe.FirstTime);
  }
  setNewUserType(e) {
    switch (e) {
      case DOe.FirstTime:
        throw new QI("UserKind should not be set to first time");
      case DOe.SecondTime:
        break;
      case DOe.Active:
        this._disposables.clear();
    }
    this._storageService.store("inlineEditsGutterIndicatorUserKind", e, -1, 0);
  }
  _initializeDebugSetting() {
    const e = "editor.inlineSuggest.edits.resetNewUserExperience";
    this._configurationService.getValue(e) &&
      this._storageService.remove("inlineEditsGutterIndicatorUserKind", -1);
    const t = this._configurationService.onDidChangeConfiguration((t) => {
      t.affectsConfiguration(e) &&
        this._configurationService.getValue(e) &&
        (this._storageService.remove("inlineEditsGutterIndicatorUserKind", -1),
        (this._disposables.value = this.setupNewUserExperience()));
    });
    return t;
  }
};
IOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([TOe(4, oue), TOe(5, OU)], IOe);
let ROe = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this._editor = e),
      (this._edit = t),
      (this._accessibilityService = n),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this._iconRef = XB.ref()),
      (this.isHovered = xne(!1)),
      (this._editorObs = xde(this._editor)));
    const i = this._edit
        .map((e) => e?.edit.replacements[0] ?? null)
        .map((e) => (e ? xDe(e, this._editor.getModel()).range.getStartPosition() : null)),
      r = this._editorObs.observePosition(i, this._store),
      o = Xj((e) => {
        const t = r.read(e);
        if (!t) return null;
        const n = this._editorObs.layoutInfoContentLeft.read(e),
          i = this._editorObs.scrollLeft.read(e);
        return new yde(n + t.x - i, t.y);
      }),
      s = XB.div(
        {
          class: "inline-edits-collapsed-view",
          style: {
            position: "absolute",
            overflow: "visible",
            top: "0px",
            left: "0px",
            display: "block",
          },
        },
        [[this.getCollapsedIndicator(o)]],
      ).keepUpdated(this._store).element;
    (this._register(
      this._editorObs.createOverlayWidget({
        domNode: s,
        position: xne(null),
        allowEditorOverflow: !1,
        minContentWidthInPx: xne(0),
      }),
    ),
      (this.isVisible = this._edit.map((e, t) => !!e && null !== o.read(t))));
  }
  triggerAnimation() {
    if (this._accessibilityService.isMotionReduced()) return new Animation(null, null).finished;
    return 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(e) {
    const t = this._editorObs.layoutInfoContentLeft,
      n = e.map((e, n) => (e ? e.deltaX(-t.read(n)) : null)),
      i = this.createIconPath(n);
    return XB.svg(
      {
        class: "collapsedView",
        ref: this._iconRef,
        style: {
          position: "absolute",
          ...wOe((e) => _Oe(this._editorObs).read(e)),
          overflow: "hidden",
          pointerEvents: "none",
        },
      },
      [XB.svgElem("path", { class: "collapsedViewPath", d: i, fill: yG(XRe) })],
    );
  }
  createIconPath(e) {
    return e.map((e) => {
      if (!e) return new yOe().build();
      const t = e.deltaX(-3).deltaY(-1),
        n = t.deltaX(6),
        i = t.deltaY(1),
        r = n.deltaY(1),
        o = i.deltaX(3).deltaY(3);
      return new yOe().moveTo(t).lineTo(n).lineTo(r).lineTo(o).lineTo(i).lineTo(t).build();
    });
  }
};
ROe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(2, KK),
  ],
  ROe,
);
var OOe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let MOe = class extends PO {
  constructor(e, t, n, i, r) {
    (super(),
      (this._editor = e),
      (this._languageService = r),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this._isHovered = LF(this, !1)),
      (this.isHovered = this._isHovered),
      (this._viewRef = XB.ref()),
      (this._editorObs = xde(this._editor)));
    const o = n.map((e, t) => {
        let n;
        switch (e) {
          case CTe.Inactive:
            n = tOe;
            break;
          case CTe.Jump:
            n = QRe;
            break;
          case CTe.Accept:
            n = rOe;
        }
        return { border: hOe(n, i).read(t).toString(), background: yG(GG) };
      }),
      s = t.map((e) => (e ? this.getState(e) : void 0)),
      a = s.map((e) => (e ? this.getRendering(e, o) : void 0));
    this.minEditorScrollHeight = Xj(this, (e) => {
      const t = s.read(e);
      return t ? t.rect.read(e).bottom + this._editor.getScrollTop() : 0;
    });
    const l = XB.div(
      {
        class: "inline-edits-custom-view",
        style: {
          position: "absolute",
          overflow: "visible",
          top: "0px",
          left: "0px",
          display: "block",
        },
      },
      [a],
    ).keepUpdated(this._store);
    (this._register(
      this._editorObs.createOverlayWidget({
        domNode: l.element,
        position: xne(null),
        allowEditorOverflow: !1,
        minContentWidthInPx: bF(this, (e, t) => {
          const n = s.read(e);
          if (!n) return t ?? 0;
          const i =
            n.rect.map((e) => e.right).read(e) +
            this._editorObs.layoutInfoVerticalScrollbarWidth.read(e) +
            4 -
            this._editorObs.layoutInfoContentLeft.read(e);
          return Math.max(t ?? 0, i);
        }).recomputeInitiallyAndOnChange(this._store),
      }),
    ),
      this._register(
        rF((e) => {
          a.read(e)
            ? this._isHovered.set(l.isHovered.read(e), void 0)
            : this._isHovered.set(!1, void 0);
        }),
      ));
  }
  fitsInsideViewport(e, t, n) {
    const i = this._editorObs.layoutInfoWidth.read(n),
      r = this._editorObs.layoutInfoContentLeft.read(n),
      o = this._editor.getLayoutInfo().verticalScrollbarWidth,
      s =
        0 !== this._editorObs.layoutInfoMinimap.read(n).minimapLeft
          ? this._editorObs.layoutInfoMinimap.read(n).minimapWidth
          : 0;
    return (
      pOe(this._editorObs, e, void 0) + mOe(t, this._editor, this._editor.getModel()) + 18 <
      i - r - o - s
    );
  }
  getState(e) {
    const t = Xj(this, (t) => {
        const n = e.range.startLineNumber,
          i = e.range.endLineNumber,
          r = e.range.startColumn,
          o = e.range.endColumn,
          s = this._editor.getModel()?.getLineCount() ?? 0;
        return {
          lineWidth: pOe(this._editorObs, new Q5(n, n + 1), t),
          lineWidthBelow: n + 1 <= s ? pOe(this._editorObs, new Q5(n + 1, n + 2), t) : void 0,
          lineWidthAbove: n - 1 >= 1 ? pOe(this._editorObs, new Q5(n - 1, n), t) : void 0,
          startContentLeftOffset: this._editor.getOffsetForColumn(n, r),
          endContentLeftOffset: this._editor.getOffsetForColumn(i, o),
        };
      }),
      n = e.range.startLineNumber,
      i = e.range.endLineNumber,
      r = this.fitsInsideViewport(new Q5(n, i + 1), e.content, void 0),
      o = Xj(this, (o) => {
        const s = this._editorObs.getOption(59).read(o).typicalHalfwidthCharacterWidth,
          {
            lineWidth: a,
            lineWidthBelow: l,
            lineWidthAbove: c,
            startContentLeftOffset: d,
            endContentLeftOffset: u,
          } = t.read(o),
          h = this._editorObs.layoutInfoContentLeft.read(o),
          g = this._editorObs
            .observeLineHeightForLine(n)
            .recomputeInitiallyAndOnChange(o.store)
            .read(o),
          p = this._editorObs.scrollTop.read(o),
          f = this._editorObs.scrollLeft.read(o);
        let m, _, v;
        m =
          n === i && u + 5 * s >= a && r
            ? "end"
            : void 0 !== l && l + 14 - 4 - 4 < d
              ? "below"
              : void 0 !== c && c + 14 - 4 - 4 < d
                ? "above"
                : "end";
        let b = 0,
          y = 0;
        switch (m) {
          case "end":
            ((_ = this._editorObs.editor.getTopForLineNumber(n)), (v = a), (b = 18));
            break;
          case "below":
            ((_ = this._editorObs.editor.getTopForLineNumber(n + 1)), (v = d), (b = 8), (y = 2));
            break;
          case "above":
            ((_ = this._editorObs.editor.getTopForLineNumber(n - 1)), (v = d), (b = 8), (y = 2));
        }
        return _Re
          .fromLeftTopWidthHeight(h + v - f, _ - p, s * e.content.length, g)
          .withMargin(0, 4)
          .translateX(b)
          .translateY(y);
      });
    return { rect: o, label: e.content, kind: e.style };
  }
  getRendering(e, t) {
    const n = document.createElement("div"),
      i = this._editor.getModel().tokenization.tokenizeLinesAt(1, [e.label])?.[0];
    let r;
    r =
      i && e.kind === f2.Code
        ? I$.fromLineTokens(i).toLineTokens(e.label, this._languageService.languageIdCodec)
        : D$.createEmpty(e.label, this._languageService.languageIdCodec);
    const o = tde(
      new nde([r]),
      ide.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),
      [],
      n,
      !0,
    );
    n.style.width = `${o.minWidthInPx}px`;
    const s = e.rect.map((e) => e.withMargin(0, 4));
    return XB.div(
      {
        class: "collapsedView",
        ref: this._viewRef,
        style: {
          position: "absolute",
          ...wOe((e) => s.read(e)),
          overflow: "hidden",
          boxSizing: "border-box",
          cursor: "pointer",
          border: t.map((e) => `1px solid ${e.border}`),
          borderRadius: "4px",
          backgroundColor: t.map((e) => e.background),
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          whiteSpace: "nowrap",
        },
        onmousedown: (e) => {
          e.preventDefault();
        },
        onclick: (e) => {
          this._onDidClick.fire(new EO(MF(e), e));
        },
      },
      [n],
    );
  }
};
MOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([OOe(3, h0), OOe(4, BU)], MOe);
class AOe extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._editor = e),
      (this._edit = t),
      (this._uiState = n),
      (this._tabAction = i),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this._display = Xj(this, (e) => (this._uiState.read(e) ? "block" : "none"))),
      (this._editorMaxContentWidthInRange = Xj(this, (e) => {
        const t = this._originalDisplayRange.read(e);
        return t
          ? (this._editorObs.versionId.read(e),
            bF(this, (e, n) => {
              const i = pOe(this._editorObs, t, e);
              return Math.max(i, n ?? 0);
            }))
          : xne(0);
      }).map((e, t) => e.read(t))),
      (this._maxPrefixTrim = Xj(this, (e) => {
        const t = this._uiState.read(e);
        return t
          ? fOe(t.deletions, t.originalRange, [], this._editor)
          : { prefixTrim: 0, prefixLeftOffset: 0 };
      })),
      (this._editorLayoutInfo = Xj(this, (e) => {
        const t = this._edit.read(e);
        if (!t) return null;
        if (!this._uiState.read(e)) return null;
        const n = this._editorObs.layoutInfo.read(e),
          i = this._editorObs.scrollLeft.read(e),
          r = this._editorObs
            .getOption(59)
            .map((e) => e.typicalHalfwidthCharacterWidth)
            .read(e),
          o = n.contentLeft + Math.max(this._editorMaxContentWidthInRange.read(e), r) - i,
          s = t.originalLineRange,
          a =
            this._originalVerticalStartPosition.read(e) ??
            this._editor.getTopForLineNumber(s.startLineNumber) - this._editorObs.scrollTop.read(e),
          l =
            this._originalVerticalEndPosition.read(e) ??
            this._editor.getTopForLineNumber(s.endLineNumberExclusive) -
              this._editorObs.scrollTop.read(e),
          c = n.contentLeft + this._maxPrefixTrim.read(e).prefixLeftOffset - i;
        if (o <= c) return null;
        return {
          codeRect: _Re.fromLeftTopRightBottom(c, a, o, l).withMargin(0, 0),
          contentLeft: n.contentLeft,
        };
      }).recomputeInitiallyAndOnChange(this._store)),
      (this._originalOverlay = XB.div(
        { style: { pointerEvents: "none" } },
        Xj(this, (e) => {
          const t = xOe(this._editorLayoutInfo).read(e);
          if (!t) return;
          const n = t.map((e) =>
              _Re.fromLeftTopRightBottom(
                e.contentLeft - 4 - 1,
                e.codeRect.top,
                e.contentLeft,
                e.codeRect.bottom,
              ),
            ),
            i = Xj(this, (e) => {
              const i = t.read(e).codeRect,
                r = n.read(e);
              return i.intersectHorizontal(new N$(r.left, Number.MAX_SAFE_INTEGER));
            }),
            r = this._uiState.map((e) => (e?.inDiffEditor ? 3 : 1)).read(e),
            o = i.map((e) => e.withMargin(r, r));
          return [
            XB.div({
              class: "originalSeparatorDeletion",
              style: {
                ...o.read(e).toStyles(),
                borderRadius: "4px",
                border: `${1 + r}px solid ${yG(GG)}`,
                boxSizing: "border-box",
              },
            }),
            XB.div({
              class: "originalOverlayDeletion",
              style: {
                ...i.read(e).toStyles(),
                borderRadius: "4px",
                border: uOe(this._tabAction).map((e) => `1px solid ${yG(e)}`),
                boxSizing: "border-box",
                backgroundColor: yG($Re),
              },
            }),
            XB.div({
              class: "originalOverlayHiderDeletion",
              style: { ...n.read(e).toStyles(), backgroundColor: yG(GG) },
            }),
          ];
        }),
      ).keepUpdated(this._store)),
      (this._nonOverflowView = XB.div(
        {
          class: "inline-edits-view",
          style: {
            position: "absolute",
            overflow: "visible",
            top: "0px",
            left: "0px",
            display: this._display,
          },
        },
        [[this._originalOverlay]],
      ).keepUpdated(this._store)),
      (this.isHovered = xne(!1)),
      (this._editorObs = xde(this._editor)));
    const r = Xj(this, (e) => {
        const t = this._edit.read(e);
        return t ? new xV(t.originalLineRange.startLineNumber, 1) : null;
      }),
      o = Xj(this, (e) => {
        const t = this._edit.read(e);
        return t ? new xV(t.originalLineRange.endLineNumberExclusive, 1) : null;
      });
    ((this._originalDisplayRange = this._uiState.map((e) => e?.originalRange)),
      (this._originalVerticalStartPosition = this._editorObs
        .observePosition(r, this._store)
        .map((e) => e?.y)),
      (this._originalVerticalEndPosition = this._editorObs
        .observePosition(o, this._store)
        .map((e) => e?.y)),
      this._register(
        this._editorObs.createOverlayWidget({
          domNode: this._nonOverflowView.element,
          position: xne(null),
          allowEditorOverflow: !1,
          minContentWidthInPx: Xj(this, (e) => {
            const t = this._editorLayoutInfo.read(e);
            return null === t ? 0 : t.codeRect.width;
          }),
        }),
      ));
  }
}
var POe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let jOe = class extends PO {
  constructor(e, t, n, i, r) {
    (super(),
      (this._editor = e),
      (this._input = t),
      (this._tabAction = n),
      (this._languageService = r),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this._state = Xj(this, (e) => {
        const t = this._input.read(e);
        if (!t) return;
        const n = this._editor.getModel(),
          i = n.getEOL();
        if (
          1 === t.startColumn &&
          t.lineNumber > 1 &&
          0 !== n.getLineLength(t.lineNumber) &&
          t.text.endsWith(i) &&
          !t.text.startsWith(i)
        ) {
          const e = n.getLineLength(t.lineNumber - 1) + 1;
          return { lineNumber: t.lineNumber - 1, column: e, text: i + t.text.slice(0, -i.length) };
        }
        return { lineNumber: t.lineNumber, column: t.startColumn, text: t.text };
      })),
      (this._trimVertically = Xj(this, (e) => {
        const t = this._state.read(e),
          n = t?.text;
        if (!n || "" === n.trim())
          return { topOffset: 0, bottomOffset: 0, linesTop: 0, linesBottom: 0 };
        const i = this._editor.getLineHeightForPosition(new xV(t.lineNumber, 1)),
          r = this._editor.getModel().getEOL();
        let o = 0,
          s = 0,
          a = 0;
        for (; a < n.length && n.startsWith(r, a); a += r.length) o += 1;
        for (let l = n.length; l > a && n.endsWith(r, l); l -= r.length) s += 1;
        return { topOffset: o * i, bottomOffset: s * i, linesTop: o, linesBottom: s };
      })),
      (this._maxPrefixTrim = Xj(this, (e) => {
        const t = this._state.read(e);
        if (!t) return { prefixLeftOffset: 0, prefixTrim: 0 };
        const n = this._editor.getModel(),
          i = n.getEOL(),
          r = this._trimVertically.read(e),
          o = t.text.split(i),
          s = o.slice(r.linesTop, o.length - r.linesBottom);
        0 === r.linesTop && (s[0] = n.getLineContent(t.lineNumber) + s[0]);
        return fOe(
          [],
          new Q5(t.lineNumber, t.lineNumber + (r.linesTop > 0 ? 0 : 1)),
          s,
          this._editor,
        );
      })),
      (this._ghostText = Xj((e) => {
        const t = this._state.read(e),
          n = this._maxPrefixTrim.read(e);
        if (!t) return;
        const i = this._editor.getModel().getEOL(),
          r = t.text
            .split(i)
            .map(
              (e, t) =>
                new Ite(
                  new YH(t + 1, 0 === t ? 1 : n.prefixTrim + 1, t + 1, e.length + 1),
                  "modified-background",
                  0,
                ),
            );
        return new mDe(t.lineNumber, [new _De(t.column, t.text, !1, r)]);
      })),
      (this._display = Xj(this, (e) => (this._state.read(e) ? "block" : "none"))),
      (this._editorMaxContentWidthInRange = Xj(this, (e) => {
        const t = this._state.read(e);
        if (!t) return 0;
        this._editorObs.versionId.read(e);
        const n = this._editor.getModel(),
          i = n.getEOL(),
          r = t.text.startsWith(i)
            ? ""
            : n.getValueInRange(new YH(t.lineNumber, 1, t.lineNumber, t.column)),
          o = n.getValueInRange(
            new YH(t.lineNumber, t.column, t.lineNumber, n.getLineLength(t.lineNumber) + 1),
          ),
          s = (r + t.text + o).split(i),
          a = ide.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),
          l = s.map((e) => {
            const i = n.tokenization.tokenizeLinesAt(t.lineNumber, [e])?.[0];
            let r;
            return (
              (r = i
                ? I$.fromLineTokens(i).toLineTokens(e, this._languageService.languageIdCodec)
                : D$.createEmpty(e, this._languageService.languageIdCodec)),
              tde(new nde([r]), a, [], VB("div"), !0).minWidthInPx
            );
          });
        return Math.max(...l);
      })),
      (this.startLineOffset = this._trimVertically.map((e) => e.topOffset)),
      (this.originalLines = this._state.map((e) =>
        e
          ? new Q5(
              e.lineNumber,
              Math.min(e.lineNumber + 2, this._editor.getModel().getLineCount() + 1),
            )
          : void 0,
      )),
      (this._overlayLayout = Xj(this, (e) => {
        this._ghostText.read(e);
        const t = this._state.read(e);
        if (!t) return null;
        this._editorObs.observePosition(LF(this, new xV(t.lineNumber, t.column)), e.store).read(e);
        const n = this._editorObs.layoutInfo.read(e),
          i = this._editorObs.scrollLeft.read(e),
          r = this._editorObs.layoutInfoVerticalScrollbarWidth.read(e),
          o = n.contentLeft + this._editorMaxContentWidthInRange.read(e) - i,
          s = this._maxPrefixTrim.read(e).prefixLeftOffset ?? 0,
          a = n.contentLeft + s - i;
        if (o <= a) return null;
        const { topOffset: l, bottomOffset: c } = this._trimVertically.read(e),
          d = this._editorObs.scrollTop.read(e),
          u = this._ghostTextView.height.read(e) - l - c,
          h = this._editor.getTopForLineNumber(t.lineNumber) - d + l,
          g = new _Re(a, h, o, h + u);
        return {
          overlay: g,
          startsAtContentLeft: 0 === s,
          contentLeft: n.contentLeft,
          minContentWidthRequired: s + g.width + r,
        };
      }).recomputeInitiallyAndOnChange(this._store)),
      (this._modifiedOverlay = XB.div(
        { style: { pointerEvents: "none" } },
        Xj(this, (e) => {
          const t = xOe(this._overlayLayout).read(e);
          if (!t) return;
          const n = t
              .map((e) =>
                _Re.fromLeftTopRightBottom(
                  e.contentLeft - 4 - 1,
                  e.overlay.top,
                  e.contentLeft,
                  e.overlay.bottom,
                ),
              )
              .read(e),
            i = this._input.map((e) => (e?.inDiffEditor ? 3 : 1)).read(e),
            r = t.map((e) =>
              e.overlay
                .withMargin(0, 1, 0, e.startsAtContentLeft ? 0 : 1)
                .intersectHorizontal(new N$(n.left, Number.MAX_SAFE_INTEGER)),
            ),
            o = r.map((e) => e.withMargin(i, i));
          return [
            XB.div({
              class: "originalUnderlayInsertion",
              style: {
                ...o.read(e).toStyles(),
                borderRadius: 4,
                border: `${1 + i}px solid ${yG(GG)}`,
                boxSizing: "border-box",
              },
            }),
            XB.div({
              class: "originalOverlayInsertion",
              style: {
                ...r.read(e).toStyles(),
                borderRadius: 4,
                border: dOe(this._tabAction).map((e) => `1px solid ${yG(e)}`),
                boxSizing: "border-box",
                backgroundColor: yG(qRe),
              },
            }),
            XB.div({
              class: "originalOverlayHiderInsertion",
              style: { ...n.toStyles(), backgroundColor: yG(GG) },
            }),
          ];
        }),
      ).keepUpdated(this._store)),
      (this._view = XB.div(
        {
          class: "inline-edits-view",
          style: {
            position: "absolute",
            overflow: "visible",
            top: "0px",
            left: "0px",
            display: this._display,
          },
        },
        [[this._modifiedOverlay]],
      ).keepUpdated(this._store)),
      (this._editorObs = xde(this._editor)),
      (this._ghostTextView = this._register(
        i.createInstance(
          sRe,
          this._editor,
          {
            ghostText: this._ghostText,
            minReservedLineCount: xne(0),
            targetTextModel: this._editorObs.model.map((e) => e ?? void 0),
            warning: xne(void 0),
            handleInlineCompletionShown: xne(() => {}),
          },
          LF(this, { syntaxHighlightingEnabled: !0, extraClasses: ["inline-edit"] }),
          !0,
          !0,
        ),
      )),
      (this.isHovered = this._ghostTextView.isHovered),
      this._register(
        this._ghostTextView.onDidClick((e) => {
          this._onDidClick.fire(e);
        }),
      ),
      this._register(
        this._editorObs.createOverlayWidget({
          domNode: this._view.element,
          position: xne(null),
          allowEditorOverflow: !1,
          minContentWidthInPx: Xj(this, (e) => {
            const t = this._overlayLayout.read(e);
            return null === t ? 0 : t.minContentWidthRequired;
          }),
        }),
      ));
  }
};
jOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([POe(3, vV), POe(4, BU)], jOe);
var FOe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let BOe = class extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._editor = e),
      (this._edit = t),
      (this._isInDiffEditor = n),
      (this._tabAction = i),
      (this._languageService = r),
      (this._themeService = o),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this._maxPrefixTrim = this._edit.map((e, t) =>
        e
          ? fOe(
              e.replacements.flatMap((e) => [e.originalRange, e.modifiedRange]),
              e.originalRange,
              e.modifiedLines,
              this._editor.editor,
              t,
            )
          : void 0,
      )),
      (this._modifiedLineElements = Xj(this, (e) => {
        const t = [];
        let n = 0;
        const i = this._maxPrefixTrim.read(e),
          r = this._edit.read(e);
        if (!r || !i) return;
        const o = i.prefixTrim,
          s = (function (e) {
            const t = [];
            for (; e.length; ) {
              let n = e.shift();
              (n.startLineNumber !== n.endLineNumber &&
                (e.push(new YH(n.startLineNumber + 1, 1, n.endLineNumber, n.endColumn)),
                (n = new YH(
                  n.startLineNumber,
                  n.startColumn,
                  n.startLineNumber,
                  Number.MAX_SAFE_INTEGER,
                ))),
                t.push(n));
            }
            return t;
          })(r.replacements.map((e) => e.modifiedRange)).map(
            (e) => new YH(e.startLineNumber, e.startColumn - o, e.endLineNumber, e.endColumn - o),
          ),
          a = this._editor.model.get(),
          l = r.modifiedRange.startLineNumber;
        for (let c = 0; c < r.modifiedRange.length; c++) {
          const i = document.createElement("div"),
            d = l + c,
            u = r.modifiedLines[c].slice(o),
            h = a.tokenization.tokenizeLinesAt(d, [u])?.[0];
          let g;
          g = h
            ? I$.fromLineTokens(h).toLineTokens(u, this._languageService.languageIdCodec)
            : D$.createEmpty(u, this._languageService.languageIdCodec);
          const p = [];
          for (const e of s.filter((e) => e.startLineNumber === d)) {
            const t = Math.min(e.endColumn, u.length + 1);
            p.push(new Ite(new YH(1, e.startColumn, 1, t), "inlineCompletions-modified-bubble", 0));
          }
          const f = tde(
            new nde([g]),
            ide.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),
            p,
            i,
            !0,
          );
          (this._editor.getOption(59).read(e), (n = Math.max(n, f.minWidthInPx)), t.push(i));
        }
        return { lines: t, requiredWidth: n };
      })),
      (this._layout = Xj(this, (e) => {
        const t = this._modifiedLineElements.read(e),
          n = this._maxPrefixTrim.read(e),
          i = this._edit.read(e);
        if (!t || !n || !i) return;
        const { prefixLeftOffset: r } = n,
          { requiredWidth: o } = t,
          s = this._editor.observeLineHeightsForLineRange(i.originalRange).read(e),
          a = (() => {
            const e = s.slice(0, i.modifiedRange.length);
            for (; e.length < i.modifiedRange.length; ) e.push(s[s.length - 1]);
            return e;
          })(),
          l = this._editor.layoutInfoContentLeft.read(e),
          c = this._editor.layoutInfoVerticalScrollbarWidth.read(e),
          d = this._editor.scrollLeft.read(e),
          u = this._editor.scrollTop.read(e),
          h = l - d,
          g = this._editor.editor.getModel(),
          p = i.originalRange.mapToLineArray(
            (e) => this._editor.editor.getOffsetForColumn(e, g.getLineMaxColumn(e)) - r,
          ),
          f = Math.max(...p, o),
          m = i.originalRange.startLineNumber,
          _ = i.originalRange.endLineNumberExclusive - 1,
          v = this._editor.editor.getTopForLineNumber(m) - u,
          b = this._editor.editor.getBottomForLineNumber(_) - u,
          y = _Re.fromLeftTopWidthHeight(h + r, v, f, b - v),
          x = _Re.fromLeftTopWidthHeight(
            y.left,
            y.bottom,
            y.width,
            a.reduce((e, t) => e + t, 0),
          ),
          w = _Re.hull([y, x]),
          C = w.intersectVertical(new N$(y.bottom, Number.MAX_SAFE_INTEGER));
        return {
          originalLinesOverlay: y,
          modifiedLinesOverlay: x,
          background: w,
          lowerBackground: C,
          lowerText: new _Re(C.left, C.top, C.right, C.bottom),
          modifiedLineHeights: a,
          minContentWidthRequired: r + f + c,
        };
      })),
      (this._viewZoneInfo = Xj((e) => {
        const t = this._editor
          .getOption(71)
          .map((e) => "always" === e.edits.allowCodeShifting)
          .read(e);
        if (!t) return;
        const n = this._layout.read(e),
          i = this._edit.read(e);
        if (!n || !i) return;
        return {
          height: n.lowerBackground.height,
          lineNumber: i.originalRange.endLineNumberExclusive,
        };
      })),
      (this.minEditorScrollHeight = Xj(this, (e) => {
        const t = xOe(this._layout).read(e);
        return t && void 0 === this._viewZoneInfo.read(e)
          ? t.read(e).lowerText.bottom + this._editor.editor.getScrollTop()
          : 0;
      })),
      (this._div = XB.div({ class: "line-replacement" }, [
        Xj(this, (e) => {
          const t = xOe(this._layout).read(e),
            n = this._modifiedLineElements.read(e);
          if (!t || !n) return [];
          const i = t.read(e),
            r = this._editor.layoutInfoContentLeft.read(e),
            o = this._isInDiffEditor.read(e) ? 3 : 1;
          n.lines.forEach((e, t) => {
            ((e.style.width = `${i.lowerText.width}px`),
              (e.style.height = `${i.modifiedLineHeights[t]}px`),
              (e.style.position = "relative"));
          });
          const s = dOe(this._tabAction).read(e),
            a = uOe(this._tabAction).read(e);
          return [
            XB.div(
              {
                style: {
                  position: "absolute",
                  ...wOe((e) => _Oe(this._editor).read(e)),
                  overflow: "hidden",
                  pointerEvents: "none",
                },
              },
              [
                XB.div({
                  class: "borderAroundLineReplacement",
                  style: {
                    position: "absolute",
                    ...wOe((e) => t.read(e).background.translateX(-r).withMargin(o)),
                    borderRadius: "4px",
                    border: `${o + 1}px solid ${yG(GG)}`,
                    boxSizing: "border-box",
                    pointerEvents: "none",
                  },
                }),
                XB.div({
                  class: "originalOverlayLineReplacement",
                  style: {
                    position: "absolute",
                    ...wOe((e) => t.read(e).background.translateX(-r)),
                    borderRadius: "4px",
                    border: hOe(a, this._themeService).map((e) => `1px solid ${e.toString()}`),
                    pointerEvents: "none",
                    boxSizing: "border-box",
                    background: yG($Re),
                  },
                }),
                XB.div(
                  {
                    class: "modifiedOverlayLineReplacement",
                    style: {
                      position: "absolute",
                      ...wOe((e) => t.read(e).lowerBackground.translateX(-r)),
                      borderRadius: "0 0 4px 4px",
                      background: yG(GG),
                      boxShadow: `${yG(zG)} 0 6px 6px -6px`,
                      border: `1px solid ${yG(s)}`,
                      boxSizing: "border-box",
                      overflow: "hidden",
                      cursor: "pointer",
                      pointerEvents: "auto",
                    },
                    onmousedown: (e) => {
                      e.preventDefault();
                    },
                    onclick: (e) => this._onDidClick.fire(new EO(MF(e), e)),
                  },
                  [
                    XB.div({
                      style: {
                        position: "absolute",
                        top: 0,
                        left: 0,
                        width: "100%",
                        height: "100%",
                        background: yG(GRe),
                      },
                    }),
                  ],
                ),
                XB.div(
                  {
                    class: "modifiedLinesLineReplacement",
                    style: {
                      position: "absolute",
                      boxSizing: "border-box",
                      ...wOe((e) => t.read(e).lowerText.translateX(-r)),
                      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",
                    },
                  },
                  [...n.lines],
                ),
              ],
            ),
          ];
        }),
      ]).keepUpdated(this._store)),
      (this.isHovered = this._editor.isTargetHovered(
        (e) => this._isMouseOverWidget(e),
        this._store,
      )),
      (this._previousViewZoneInfo = void 0),
      this._register(
        MO(() => this._editor.editor.changeViewZones((e) => this.removePreviousViewZone(e))),
      ),
      this._register(
        (function (e, t) {
          let n;
          return oF({ debugReferenceFn: t }, (i) => {
            const r = e.read(i),
              o = n;
            ((n = r), t({ lastValue: o, newValue: r }));
          });
        })(this._viewZoneInfo, ({ lastValue: e, newValue: t }) => {
          e === t ||
            (e?.height === t?.height && e?.lineNumber === t?.lineNumber) ||
            this._editor.editor.changeViewZones((e) => {
              (this.removePreviousViewZone(e), t && this.addViewZone(t, e));
            });
        }),
      ),
      this._register(
        this._editor.createOverlayWidget({
          domNode: this._div.element,
          minContentWidthInPx: Xj(this, (e) => this._layout.read(e)?.minContentWidthRequired ?? 0),
          position: xne({ preference: { top: 0, left: 0 } }),
          allowEditorOverflow: !1,
        }),
      ));
  }
  _isMouseOverWidget(e) {
    const t = this._layout.get();
    return (
      !!(t && e.event instanceof ZX) &&
      t.lowerBackground.containsPoint(new yde(e.event.relativePos.x, e.event.relativePos.y))
    );
  }
  removePreviousViewZone(e) {
    if (!this._previousViewZoneInfo) return;
    e.removeZone(this._previousViewZoneInfo.id);
    const t = this._editor.cursorLineNumber.get();
    (null !== t &&
      t >= this._previousViewZoneInfo.lineNumber &&
      this._editor.editor.setScrollTop(
        this._editor.scrollTop.get() - this._previousViewZoneInfo.height,
      ),
      (this._previousViewZoneInfo = void 0));
  }
  addViewZone(e, t) {
    const n = t.addZone({
      afterLineNumber: e.lineNumber - 1,
      heightInPx: e.height,
      domNode: VB("div"),
    });
    this._previousViewZoneInfo = { height: e.height, lineNumber: e.lineNumber, id: n };
    const i = this._editor.cursorLineNumber.get();
    null !== i &&
      i >= e.lineNumber &&
      this._editor.editor.setScrollTop(this._editor.scrollTop.get() + e.height);
  }
};
BOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([FOe(4, BU), FOe(5, h0)], BOe);
var VOe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let WOe = class extends PO {
  static fitsInsideViewport(e, t, n, i) {
    const r = xde(e),
      o = r.layoutInfoWidth.read(i),
      s = r.layoutInfoContentLeft.read(i),
      a = e.getLayoutInfo().verticalScrollbarWidth,
      l =
        0 !== r.layoutInfoMinimap.read(i).minimapLeft
          ? r.layoutInfoMinimap.read(i).minimapWidth
          : 0,
      c = pOe(r, n.displayRange, void 0),
      d = n.lineEdit.newLines.reduce((n, i) => Math.max(n, mOe(i, e, t)), 0);
    return c + d + 20 + 14 < o - s - a - l;
  }
  constructor(e, t, n, i, r, o, s) {
    (super(),
      (this._editor = e),
      (this._edit = t),
      (this._previewTextModel = n),
      (this._uiState = i),
      (this._tabAction = r),
      (this._instantiationService = o),
      (this._themeService = s),
      (this._editorObs = xde(this._editor)),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this._display = Xj(this, (e) => (this._uiState.read(e) ? "block" : "none"))),
      (this.previewRef = XB.ref()));
    const a = this._uiState.map((e) => (e?.isInDiffEditor ? 3 : 1));
    ((this._editorContainer = XB.div(
      {
        class: ["editorContainer"],
        style: { position: "absolute", overflow: "hidden", cursor: "pointer" },
        onmousedown: (e) => {
          e.preventDefault();
        },
        onclick: (e) => {
          this._onDidClick.fire(new EO(MF(e), e));
        },
      },
      [XB.div({ class: "preview", style: { pointerEvents: "none" }, ref: this.previewRef })],
    ).keepUpdated(this._store)),
      (this.isHovered = this._editorContainer.didMouseMoveDuringHover),
      (this.previewEditor = this._register(
        this._instantiationService.createInstance(
          Eye,
          this.previewRef.element,
          {
            glyphMargin: !1,
            lineNumbers: "off",
            minimap: { enabled: !1 },
            guides: {
              indentation: !1,
              bracketPairs: !1,
              bracketPairsHorizontal: !1,
              highlightActiveIndentation: !1,
            },
            rulers: [],
            padding: { top: 0, bottom: 0 },
            folding: !1,
            selectOnLineNumbers: !1,
            selectionHighlight: !1,
            columnSelection: !1,
            overviewRulerBorder: !1,
            overviewRulerLanes: 0,
            lineDecorationsWidth: 0,
            lineNumbersMinChars: 0,
            revealHorizontalRightPadding: 0,
            bracketPairColorization: { enabled: !0, independentColorPoolPerBracketType: !1 },
            scrollBeyondLastLine: !1,
            scrollbar: { vertical: "hidden", horizontal: "hidden", handleMouseWheel: !1 },
            readOnly: !0,
            wordWrap: "off",
            wordWrapOverride1: "off",
            wordWrapOverride2: "off",
          },
          { contextKeyValues: { [pLe.inInlineEditsPreviewEditor.key]: !0 }, contributions: [] },
          this._editor,
        ),
      )),
      (this._previewEditorObs = xde(this.previewEditor)),
      (this._activeViewZones = []),
      (this._updatePreviewEditor = Xj(this, (e) => {
        (this._editorContainer.readEffect(e),
          this._previewEditorObs.model.read(e),
          this._display.read(e),
          this._nonOverflowView &&
            (this._nonOverflowView.element.style.display = this._display.read(e)));
        const t = this._uiState.read(e),
          n = this._edit.read(e);
        if (!t || !n) return;
        const i = n.originalLineRange,
          r = [];
        (i.startLineNumber > 1 && r.push(new YH(1, 1, i.startLineNumber - 1, 1)),
          i.startLineNumber + t.newTextLineCount < this._previewTextModel.getLineCount() + 1 &&
            r.push(
              new YH(
                i.startLineNumber + t.newTextLineCount,
                1,
                this._previewTextModel.getLineCount() + 1,
                1,
              ),
            ),
          this.previewEditor.setHiddenAreas(r, void 0, !0));
        const o = [...this._activeViewZones];
        this._activeViewZones = [];
        const s = i.endLineNumberExclusive - i.startLineNumber - t.newTextLineCount;
        this.previewEditor.changeViewZones((e) => {
          (o.forEach((t) => e.removeZone(t)),
            s > 0 &&
              this._activeViewZones.push(
                e.addZone({
                  afterLineNumber: i.startLineNumber + t.newTextLineCount - 1,
                  heightInLines: s,
                  showInHiddenAreas: !0,
                  domNode: VB("div.diagonal-fill.inline-edits-view-zone"),
                }),
              ));
        });
      })),
      (this._previewEditorWidth = Xj(this, (e) => {
        const t = this._edit.read(e);
        return t
          ? (this._updatePreviewEditor.read(e), pOe(this._previewEditorObs, t.modifiedLineRange, e))
          : 0;
      })),
      (this._cursorPosIfTouchesEdit = Xj(this, (e) => {
        const t = this._editorObs.cursorPosition.read(e),
          n = this._edit.read(e);
        if (n && t) return n.modifiedLineRange.contains(t.lineNumber) ? t : void 0;
      })),
      (this._originalStartPosition = Xj(this, (e) => {
        const t = this._edit.read(e);
        return t ? new xV(t.originalLineRange.startLineNumber, 1) : null;
      })),
      (this._originalEndPosition = Xj(this, (e) => {
        const t = this._edit.read(e);
        return t ? new xV(t.originalLineRange.endLineNumberExclusive, 1) : null;
      })),
      (this._originalVerticalStartPosition = this._editorObs
        .observePosition(this._originalStartPosition, this._store)
        .map((e) => e?.y)),
      (this._originalVerticalEndPosition = this._editorObs
        .observePosition(this._originalEndPosition, this._store)
        .map((e) => e?.y)),
      (this._originalDisplayRange = this._edit.map((e) => e?.displayRange)),
      (this._editorMaxContentWidthInRange = Xj(this, (e) => {
        const t = this._originalDisplayRange.read(e);
        return t
          ? (this._editorObs.versionId.read(e),
            bF(this, (e, n) => {
              const i = pOe(this._editorObs, t, e);
              return Math.max(i, n ?? 0);
            }))
          : xne(0);
      }).map((e, t) => e.read(t))),
      (this._previewEditorLayoutInfo = Xj(this, (e) => {
        const t = this._edit.read(e);
        if (!t) return null;
        if (!this._uiState.read(e)) return null;
        const n = t.originalLineRange,
          i = this._editorObs.scrollLeft.read(e),
          r = this._editorMaxContentWidthInRange.read(e),
          o = this._editorObs.layoutInfo.read(e),
          s = this._previewEditorWidth.read(e),
          a = o.contentWidth - o.verticalScrollbarWidth,
          l = this._editor.getContainerDomNode().getBoundingClientRect(),
          c = o.contentLeft + o.contentWidth + l.left,
          d = MF(this._editor.getContainerDomNode()).innerWidth - c,
          u = MF(this._editor.getContainerDomNode()).innerWidth - l.right,
          h = Math.min(0.3 * o.contentWidth, s, 100),
          g = 0 + d,
          p = this._cursorPosIfTouchesEdit.read(e),
          f = Math.max(
            a + i - 0 - Math.max(0, h - g),
            Math.min(
              p
                ? (function (e, t, n) {
                    return (
                      e.layoutInfo.read(n),
                      e.value.read(n),
                      e.model.read(n)
                        ? (e.scrollTop.read(n), e.editor.getOffsetForColumn(t.lineNumber, t.column))
                        : 0
                    );
                  })(this._editorObs, p, e) + 50
                : 0,
              a + i,
            ),
          ),
          m = Math.min(r + 20, f),
          _ = r + 20 + s + 70,
          v = f - m;
        let b, y;
        m > i ? ((b = 0), (y = o.contentLeft + m - i)) : ((b = i - m), (y = o.contentLeft));
        const x =
            this._originalVerticalStartPosition.read(e) ??
            this._editor.getTopForLineNumber(n.startLineNumber) - this._editorObs.scrollTop.read(e),
          w =
            this._originalVerticalEndPosition.read(e) ??
            this._editor.getBottomForLineNumber(n.endLineNumberExclusive - 1) -
              this._editorObs.scrollTop.read(e),
          C = o.contentLeft - i;
        let S = _Re.fromLeftTopRightBottom(C, x, y, w);
        const k = 0 === S.height;
        k || (S = S.withMargin(0, 0));
        const E = this._previewEditorObs
            .observeLineHeightsForLineRange(t.modifiedLineRange)
            .read(e)
            .reduce((e, t) => e + t, 0),
          N = w - x,
          L = Math.max(N, E),
          D = 0 === v,
          T = Math.min(s + 12, u + o.width - o.contentLeft - 0);
        let I = _Re.fromLeftTopWidthHeight(S.right + 0, x, T, L);
        return (
          (I = k ? I.withMargin(0, 0).translateY(0) : I.withMargin(0, 0).translateX(1)),
          {
            codeRect: S,
            editRect: I,
            codeScrollLeft: i,
            contentLeft: o.contentLeft,
            isInsertion: k,
            maxContentWidth: _,
            shouldShowShadow: D,
            desiredPreviewEditorScrollLeft: b,
            previewEditorWidth: T,
          }
        );
      })),
      (this._stickyScrollController = URe.get(this._editorObs.editor)),
      (this._stickyScrollHeight = this._stickyScrollController
        ? gF(
            this._stickyScrollController.onDidChangeStickyScrollHeight,
            () => this._stickyScrollController.stickyScrollWidgetHeight,
          )
        : xne(0)),
      (this._shouldOverflow = Xj(this, (e) => !1)),
      (this._originalBackgroundColor = gF(
        this,
        this._themeService.onDidColorThemeChange,
        () => this._themeService.getColorTheme().getColor($Re) ?? vG.transparent,
      )),
      (this._backgroundSvg = XB.svg(
        {
          transform: "translate(-0.5 -0.5)",
          style: { overflow: "visible", pointerEvents: "none", position: "absolute" },
        },
        [
          XB.svgElem("path", {
            class: "rightOfModifiedBackgroundCoverUp",
            d: Xj(this, (e) => {
              const t = this._previewEditorLayoutInfo.read(e);
              if (!t) return;
              return this._originalBackgroundColor.read(e).isTransparent()
                ? void 0
                : new yOe()
                    .moveTo(t.codeRect.getRightTop())
                    .lineTo(t.codeRect.getRightTop().deltaX(1e3))
                    .lineTo(t.codeRect.getRightBottom().deltaX(1e3))
                    .lineTo(t.codeRect.getRightBottom())
                    .build();
            }),
            style: { fill: xG(GG, "transparent") },
          }),
        ],
      ).keepUpdated(this._store)),
      (this._originalOverlay = XB.div(
        {
          style: {
            pointerEvents: "none",
            display: this._previewEditorLayoutInfo.map((e) => (e?.isInsertion ? "none" : "block")),
          },
        },
        Xj(this, (e) => {
          const t = xOe(this._previewEditorLayoutInfo).read(e);
          if (!t) return;
          const n = a.read(e),
            i = uOe(this._tabAction).map((e) => `1px solid ${yG(e)}`),
            r = `${1 + n}px solid ${yG(GG)}`,
            o = 0 !== t.read(e).codeScrollLeft,
            s = t.map((e) => e.codeRect.bottom < e.editRect.bottom),
            l = t
              .map((e) =>
                _Re.fromLeftTopRightBottom(
                  e.contentLeft - 4 - 1,
                  e.codeRect.top,
                  e.contentLeft,
                  e.codeRect.bottom + 10,
                ),
              )
              .read(e),
            c = new N$(l.left, Number.MAX_SAFE_INTEGER),
            d = t.map((e) => e.codeRect.intersectHorizontal(c)),
            u = d.map((e) => e.withMargin(n, 0, n, n).intersectHorizontal(c)),
            h = d.map((e) =>
              _Re
                .fromLeftTopWidthHeight(e.right - 10 + 1, e.bottom - 1, 10, 10)
                .intersectHorizontal(c),
            );
          return [
            XB.div({
              class: "originalSeparatorSideBySide",
              style: {
                ...u.read(e).toStyles(),
                boxSizing: "border-box",
                borderRadius: "4px 0 0 4px",
                borderTop: r,
                borderBottom: r,
                borderLeft: o ? "none" : r,
              },
            }),
            XB.div({
              class: "originalOverlaySideBySide",
              style: {
                ...d.read(e).toStyles(),
                boxSizing: "border-box",
                borderRadius: "4px 0 0 4px",
                borderTop: i,
                borderBottom: i,
                borderLeft: o ? "none" : i,
                backgroundColor: yG($Re),
              },
            }),
            XB.div(
              {
                class: "originalCornerCutoutSideBySide",
                style: {
                  pointerEvents: "none",
                  display: s.map((e) => (e ? "block" : "none")),
                  ...h.read(e).toStyles(),
                },
              },
              [
                XB.div({
                  class: "originalCornerCutoutBackground",
                  style: {
                    position: "absolute",
                    top: "0px",
                    left: "0px",
                    width: "100%",
                    height: "100%",
                    backgroundColor: hOe($Re, this._themeService).map((e) => e.toString()),
                  },
                }),
                XB.div({
                  class: "originalCornerCutoutBorder",
                  style: {
                    position: "absolute",
                    top: "0px",
                    left: "0px",
                    width: "100%",
                    height: "100%",
                    boxSizing: "border-box",
                    borderTop: i,
                    borderRight: i,
                    borderRadius: "0 100% 0 0",
                    backgroundColor: yG(GG),
                  },
                }),
              ],
            ),
            XB.div({
              class: "originalOverlaySideBySideHider",
              style: { ...l.toStyles(), backgroundColor: yG(GG) },
            }),
          ];
        }),
      ).keepUpdated(this._store)),
      (this._modifiedOverlay = XB.div(
        { style: { pointerEvents: "none" } },
        Xj(this, (e) => {
          const t = xOe(this._previewEditorLayoutInfo).read(e);
          if (!t) return;
          const n = t.map((e) => e.codeRect.bottom < e.editRect.bottom),
            i = a.read(e),
            r = n.map((e) => `0 4px 4px ${e ? 4 : 0}px`),
            o = hOe(dOe(this._tabAction), this._themeService).map(
              (e) => `1px solid ${e.toString()}`,
            ),
            s = `${1 + i}px solid ${yG(GG)}`,
            l = t.map((e) => e.editRect.withMargin(0, 1)),
            c = l.map((e) => e.withMargin(i, i, i, 0)),
            d = Xj(this, (e) => {
              const n = l.read(e),
                i = t.read(e);
              return !i.isInsertion || i.contentLeft >= n.left
                ? _Re.fromLeftTopWidthHeight(n.left, n.top, 0, 0)
                : new _Re(i.contentLeft, n.top, n.left, n.top + 2);
            });
          return [
            XB.div({
              class: "modifiedInsertionSideBySide",
              style: {
                ...d.read(e).toStyles(),
                backgroundColor: dOe(this._tabAction).map((e) => yG(e)),
              },
            }),
            XB.div({
              class: "modifiedSeparatorSideBySide",
              style: {
                ...c.read(e).toStyles(),
                borderRadius: r,
                borderTop: s,
                borderBottom: s,
                borderRight: s,
                boxSizing: "border-box",
              },
            }),
            XB.div({
              class: "modifiedOverlaySideBySide",
              style: {
                ...l.read(e).toStyles(),
                borderRadius: r,
                border: o,
                boxSizing: "border-box",
                backgroundColor: yG(qRe),
              },
            }),
          ];
        }),
      ).keepUpdated(this._store)),
      (this._nonOverflowView = XB.div(
        {
          class: "inline-edits-view",
          style: {
            position: "absolute",
            overflow: "visible",
            top: "0px",
            left: "0px",
            display: this._display,
          },
        },
        [
          this._backgroundSvg,
          Xj(this, (e) =>
            this._shouldOverflow.read(e)
              ? []
              : [this._editorContainer, this._originalOverlay, this._modifiedOverlay],
          ),
        ],
      ).keepUpdated(this._store)),
      this._register(
        this._editorObs.createOverlayWidget({
          domNode: this._nonOverflowView.element,
          position: xne(null),
          allowEditorOverflow: !1,
          minContentWidthInPx: Xj(this, (e) => {
            const t = this._previewEditorLayoutInfo.read(e)?.maxContentWidth;
            return void 0 === t ? 0 : t;
          }),
        }),
      ),
      this.previewEditor.setModel(this._previewTextModel),
      this._register(
        rF((e) => {
          const t = this._previewEditorLayoutInfo.read(e);
          if (!t) return;
          const n = t.editRect.withMargin(-0, -0);
          (this.previewEditor.layout({ height: n.height, width: t.previewEditorWidth + 15 }),
            (this._editorContainer.element.style.top = `${n.top}px`),
            (this._editorContainer.element.style.left = `${n.left}px`),
            (this._editorContainer.element.style.width = `${t.previewEditorWidth + 0}px`));
        }),
      ),
      this._register(
        rF((e) => {
          const t = this._previewEditorLayoutInfo.read(e);
          t && this._previewEditorObs.editor.setScrollLeft(t.desiredPreviewEditorScrollLeft);
        }),
      ),
      this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store));
  }
};
WOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([VOe(5, vV), VOe(6, h0)], WOe);
let HOe = class extends PO {
  static {
    this.MAX_LENGTH = 100;
  }
  constructor(e, t, n, i) {
    (super(),
      (this._editor = e),
      (this._edit = t),
      (this._tabAction = n),
      (this._languageService = i),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this._start = this._editor.observePosition(
        xne(this._edit.range.getStartPosition()),
        this._store,
      )),
      (this._end = this._editor.observePosition(
        xne(this._edit.range.getEndPosition()),
        this._store,
      )),
      (this._line = document.createElement("div")),
      (this._hoverableElement = LF(this, null)),
      (this.isHovered = this._hoverableElement.map(
        (e, t) => e?.didMouseMoveDuringHover.read(t) ?? !1,
      )),
      (this._renderTextEffect = Xj(this, (e) => {
        const t = this._editor.model.get(),
          n = t.getLineContent(this._edit.range.startLineNumber),
          i = Y5.replace(
            new N$(this._edit.range.startColumn - 1, this._edit.range.endColumn - 1),
            this._edit.text,
          ),
          r = i.replace(n),
          o = t.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber, [r])?.[0];
        let s;
        s = o
          ? I$.fromLineTokens(o)
              .slice(i.getRangeAfterReplace())
              .toLineTokens(this._edit.text, this._languageService.languageIdCodec)
          : D$.createEmpty(this._edit.text, this._languageService.languageIdCodec);
        const a = tde(
          new nde([s]),
          ide.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),
          [],
          this._line,
          !0,
        );
        this._line.style.width = `${a.minWidthInPx}px`;
      })));
    const r = this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());
    ((this._layout = Xj(this, (e) => {
      this._renderTextEffect.read(e);
      const t = this._start.read(e),
        n = this._end.read(e);
      if (!t || !n || t.x > n.x || t.y > n.y) return;
      const i = r.read(e),
        o = this._editor.scrollLeft.read(e),
        s = this._editor.getOption(59).read(e).typicalHalfwidthCharacterWidth,
        a = new yde(3 * s, 4),
        l = _Re.fromPoints(t, n).withHeight(i).translateX(-o),
        c = _Re.fromPointSize(
          l.getLeftBottom().add(a),
          new yde(this._edit.text.length * s, l.height),
        ),
        d = c.withLeft(l.left);
      return { originalLine: l, modifiedLine: c, lowerBackground: d, lineHeight: i };
    })),
      (this.minEditorScrollHeight = Xj(this, (e) => {
        const t = xOe(this._layout).read(e);
        return t ? t.read(e).modifiedLine.bottom + 1 + this._editor.editor.getScrollTop() : 0;
      })),
      (this._root = XB.div({ class: "word-replacement" }, [
        Xj(this, (e) => {
          const t = xOe(this._layout).read(e);
          if (!t) return [];
          const n = uOe(this._tabAction)
              .map((e) => yG(e))
              .read(e),
            i = dOe(this._tabAction)
              .map((e) => yG(e))
              .read(e);
          return [
            XB.div(
              {
                style: {
                  position: "absolute",
                  ...wOe((e) => _Oe(this._editor).read(e)),
                  overflow: "hidden",
                  pointerEvents: "none",
                },
              },
              [
                XB.div({
                  style: {
                    position: "absolute",
                    ...wOe((e) => t.read(e).lowerBackground.withMargin(1, 2, 1, 0)),
                    background: yG(GG),
                    cursor: "pointer",
                    pointerEvents: "auto",
                  },
                  onmousedown: (e) => {
                    e.preventDefault();
                  },
                  onmouseup: (e) => this._onDidClick.fire(new EO(MF(e), e)),
                  obsRef: (e) => {
                    this._hoverableElement.set(e, void 0);
                  },
                }),
                XB.div(
                  {
                    style: {
                      position: "absolute",
                      ...wOe((e) => t.read(e).modifiedLine.withMargin(1, 2)),
                      fontFamily: this._editor.getOption(58),
                      fontSize: this._editor.getOption(61),
                      fontWeight: this._editor.getOption(62),
                      pointerEvents: "none",
                      boxSizing: "border-box",
                      borderRadius: "4px",
                      border: `1px solid ${i}`,
                      background: yG(ZRe),
                      display: "flex",
                      justifyContent: "center",
                      alignItems: "center",
                      outline: `2px solid ${yG(GG)}`,
                    },
                  },
                  [this._line],
                ),
                XB.div(
                  {
                    style: {
                      position: "absolute",
                      ...wOe((e) => t.read(e).originalLine.withMargin(1)),
                      boxSizing: "border-box",
                      borderRadius: "4px",
                      border: `1px solid ${n}`,
                      background: yG(KRe),
                      pointerEvents: "none",
                    },
                  },
                  [],
                ),
                XB.svg(
                  {
                    width: 11,
                    height: 14,
                    viewBox: "0 0 11 14",
                    fill: "none",
                    style: {
                      position: "absolute",
                      left: t.map((e) => e.modifiedLine.left - 16),
                      top: t.map(
                        (e) => e.modifiedLine.top + Math.round((e.lineHeight - 14 - 5) / 2),
                      ),
                    },
                  },
                  [
                    XB.svgElem("path", {
                      d: "M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5",
                      stroke: yG(vZ),
                    }),
                    XB.svgElem("path", { d: "M6 7.5L9.99999 10.49998L6 13.5", stroke: yG(vZ) }),
                  ],
                ),
              ],
            ),
          ];
        }),
      ]).keepUpdated(this._store)),
      this._register(
        this._editor.createOverlayWidget({
          domNode: this._root.element,
          minContentWidthInPx: xne(0),
          position: xne({ preference: { top: 0, left: 0 } }),
          allowEditorOverflow: !1,
        }),
      ));
  }
};
HOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(3, BU),
  ],
  HOe,
);
class zOe extends PO {
  constructor(e, t, n) {
    (super(),
      (this._originalEditor = e),
      (this._state = t),
      (this._modifiedTextModel = n),
      (this._onDidClick = this._register(new QO())),
      (this.onDidClick = this._onDidClick.event),
      (this.isHovered = xde(this._originalEditor).isTargetHovered(
        (e) =>
          6 === e.target.type &&
          e.target.detail.injectedText?.options.attachedData instanceof UOe &&
          e.target.detail.injectedText.options.attachedData.owner === this,
        this._store,
      )),
      (this._tokenizationFinished = gF(this._modifiedTextModel.onDidChangeTokens, () => qOe++)),
      (this._decorations = Xj(this, (e) => {
        const t = this._state.read(e);
        if (!t) return;
        const n = t.modifiedText,
          i = "insertionInline" === t.mode,
          r = 1 === t.diff.length && 1 === t.diff[0].innerChanges?.length,
          o = [],
          s = [],
          a = cee.register({
            className: "inlineCompletions-line-insert",
            description: "line-insert",
            isWholeLine: !0,
            marginClassName: "gutter-insert",
          }),
          l = cee.register({
            className: "inlineCompletions-line-delete",
            description: "line-delete",
            isWholeLine: !0,
            marginClassName: "gutter-delete",
          }),
          c = cee.register({
            className: "inlineCompletions-char-delete",
            description: "char-delete",
            isWholeLine: !1,
            zIndex: 1,
          }),
          d = cee.register({
            className: "inlineCompletions-char-insert",
            description: "char-insert",
            isWholeLine: !0,
          }),
          u = cee.register({
            className: "inlineCompletions-char-insert",
            description: "char-insert",
            shouldFillLineOnLineBreak: !0,
          }),
          h = cee.register({
            className: "inlineCompletions-char-insert diff-range-empty",
            description: "char-insert diff-range-empty",
          }),
          g = cee.register({
            className: "inlineCompletions-original-lines",
            description: "inlineCompletions-original-lines",
            isWholeLine: !1,
            shouldFillLineOnLineBreak: !0,
          }),
          p =
            "sideBySide" !== t.mode &&
            "deletion" !== t.mode &&
            "insertionInline" !== t.mode &&
            "lineReplacement" !== t.mode,
          f = "lineReplacement" === t.mode;
        for (const m of t.diff)
          if (
            (p &&
              (m.original.isEmpty || o.push({ range: m.original.toInclusiveRange(), options: l }),
              m.modified.isEmpty || s.push({ range: m.modified.toInclusiveRange(), options: a })),
            m.modified.isEmpty || m.original.isEmpty)
          )
            (m.original.isEmpty || o.push({ range: m.original.toInclusiveRange(), options: c }),
              m.modified.isEmpty || s.push({ range: m.modified.toInclusiveRange(), options: d }));
          else {
            const a = i && $Oe(m);
            for (const i of m.innerChanges || []) {
              if (
                m.original.contains(i.originalRange.startLineNumber) &&
                (!f || !i.originalRange.isEmpty())
              ) {
                const e = this._originalEditor.getModel()?.getValueInRange(i.originalRange, 1);
                o.push({
                  range: i.originalRange,
                  options: {
                    description: "char-delete",
                    shouldFillLineOnLineBreak: !1,
                    className: vOe(
                      "inlineCompletions-char-delete",
                      i.originalRange.isSingleLine() &&
                        "insertionInline" === t.mode &&
                        "single-line-inline",
                      i.originalRange.isEmpty() && "empty",
                      ((i.originalRange.isEmpty() && r) || ("deletion" === t.mode && "\n" === e)) &&
                        !a &&
                        "diff-range-empty",
                    ),
                    inlineClassName: a ? vOe("strike-through", "inlineCompletions") : null,
                    zIndex: 1,
                  },
                });
              }
              if (
                (m.modified.contains(i.modifiedRange.startLineNumber) &&
                  s.push({
                    range: i.modifiedRange,
                    options: i.modifiedRange.isEmpty() && !a && r ? h : u,
                  }),
                a)
              ) {
                const r = n.getValueOfRange(i.modifiedRange),
                  s =
                    r.length > 3
                      ? [
                          {
                            text: r.slice(0, 1),
                            extraClasses: ["start"],
                            offsetRange: new N$(
                              i.modifiedRange.startColumn - 1,
                              i.modifiedRange.startColumn,
                            ),
                          },
                          {
                            text: r.slice(1, -1),
                            extraClasses: [],
                            offsetRange: new N$(
                              i.modifiedRange.startColumn,
                              i.modifiedRange.endColumn - 2,
                            ),
                          },
                          {
                            text: r.slice(-1),
                            extraClasses: ["end"],
                            offsetRange: new N$(
                              i.modifiedRange.endColumn - 2,
                              i.modifiedRange.endColumn - 1,
                            ),
                          },
                        ]
                      : [
                          {
                            text: r,
                            extraClasses: ["start", "end"],
                            offsetRange: new N$(
                              i.modifiedRange.startColumn - 1,
                              i.modifiedRange.endColumn,
                            ),
                          },
                        ];
                this._tokenizationFinished.read(e);
                const a = this._modifiedTextModel.tokenization.getLineTokens(
                  i.modifiedRange.startLineNumber,
                );
                for (const { text: e, extraClasses: n, offsetRange: l } of s)
                  o.push({
                    range: YH.fromPositions(i.originalRange.getEndPosition()),
                    options: {
                      description: "inserted-text",
                      before: {
                        tokens: a.getTokensInRange(l),
                        content: e,
                        inlineClassName: vOe(
                          "inlineCompletions-char-insert",
                          i.modifiedRange.isSingleLine() &&
                            "insertionInline" === t.mode &&
                            "single-line-inline",
                          ...n,
                        ),
                        cursorStops: Kz.None,
                        attachedData: new UOe(this),
                      },
                      zIndex: 2,
                      showIfCollapsed: !0,
                    },
                  });
              }
            }
          }
        if (t.isInDiffEditor)
          for (const m of t.diff)
            m.original.isEmpty || o.push({ range: m.original.toExclusiveRange(), options: g });
        return { originalDecorations: o, modifiedDecorations: s };
      })),
      this._register(
        xde(this._originalEditor).setDecorations(
          this._decorations.map((e) => e?.originalDecorations ?? []),
        ),
      ));
    const i = this._state.map((e) => e?.modifiedCodeEditor);
    (this._register(
      aF((e, t) => {
        const n = i.read(e);
        n &&
          t.add(xde(n).setDecorations(this._decorations.map((e) => e?.modifiedDecorations ?? [])));
      }),
    ),
      this._register(
        this._originalEditor.onMouseUp((e) => {
          if (6 !== e.target.type) return;
          const t = e.target.detail.injectedText?.options.attachedData;
          t instanceof UOe && t.owner === this && this._onDidClick.fire(e.event);
        }),
      ));
  }
}
class UOe {
  constructor(e) {
    this.owner = e;
  }
}
function $Oe(e) {
  return (
    !!e.innerChanges && e.innerChanges.every((e) => fde(e.modifiedRange) && fde(e.originalRange))
  );
}
let qOe = 0;
let KOe = class extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._editor = e),
      (this._host = t),
      (this._model = n),
      (this._ghostTextIndicator = i),
      (this._focusIsInMenu = r),
      (this._instantiationService = o),
      (this._editorObs = xde(this._editor)),
      (this._tabAction = Xj((e) => this._model.read(e)?.tabAction.read(e) ?? CTe.Inactive)),
      (this._constructorDone = LF(this, !1)),
      (this._uiState = Xj(this, (e) => {
        const t = this._model.read(e);
        if (!t || !this._constructorDone.read(e)) return;
        const n = t.inlineEdit;
        let i = Hle.fromEdit(n.edit),
          r = n.edit.apply(n.originalText),
          o = zle(i, n.originalText, new a3(r)),
          s = this.determineRenderState(t, e, o, new a3(r));
        if (!s)
          return void HI(
            new Error(`unable to determine view: tried to render ${this._previousView?.view}`),
          );
        if (s.kind === STe.SideBySide) {
          const e = bOe(r, n.modifiedLineRange, a.getOptions().tabSize);
          ((r = e.applyToString(r)),
            (i = (function (e, t) {
              const n = [];
              for (const i of e) {
                const e = t.mapRange(i.modifiedRange);
                n.push(new Hle(i.originalRange, e));
              }
              return n;
            })(i, e)),
            (o = zle(i, n.originalText, new a3(r))));
        }
        this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId());
        return (
          this._previewTextModel.getValue() !== r && this._previewTextModel.setValue(r),
          t.showCollapsed.read(e) &&
            !this._indicator.read(e)?.isHoverVisible.read(e) &&
            (s = { kind: STe.Collapsed, viewData: s.viewData }),
          t.handleInlineEditShown(s.kind, s.viewData),
          {
            state: s,
            diff: o,
            edit: n,
            newText: r,
            newTextLineCount: n.modifiedLineRange.length,
            isInDiffEditor: t.isInDiffEditor,
          }
        );
      })),
      (this._previewTextModel = this._register(
        this._instantiationService.createInstance(
          Q7,
          "",
          this._editor.getModel().getLanguageId(),
          {
            ...Q7.DEFAULT_CREATION_OPTIONS,
            bracketPairColorizationOptions: { enabled: !0, independentColorPoolPerBracketType: !1 },
          },
          null,
        ),
      )),
      (this._indicatorCyclicDependencyCircuitBreaker = LF(this, !1)),
      (this._indicator = Xj(this, (e) => {
        if (!this._indicatorCyclicDependencyCircuitBreaker.read(e)) return;
        const t = Jj({ owner: this, equalsFn: Mj((e, t) => e.equals(t)) }, (e) => {
            const t = this._ghostTextIndicator.read(e);
            if (t) return t.lineRange;
            const n = this._uiState.read(e);
            if (n) {
              if ("custom" === n.state?.kind) {
                const e = n.state.displayLocation?.range;
                if (!e) throw new QI("custom view should have a range");
                return new Q5(e.startLineNumber, e.endLineNumber);
              }
              return "insertionMultiLine" === n.state?.kind
                ? this._insertion.originalLines.read(e)
                : n.edit.displayRange;
            }
          }),
          n = Xj(this, (e) => {
            const t = this._model.read(e);
            if (t) return t;
            const n = this._ghostTextIndicator.read(e);
            return n ? n.model : t;
          });
        return e.store.add(
          this._instantiationService.createInstance(
            LOe,
            this._editorObs,
            t,
            this._gutterIndicatorOffset,
            n,
            this._inlineEditsIsHovered,
            this._focusIsInMenu,
          ),
        );
      })),
      (this._inlineEditsIsHovered = Xj(
        this,
        (e) =>
          this._sideBySide.isHovered.read(e) ||
          this._wordReplacementViews.read(e).some((t) => t.isHovered.read(e)) ||
          this._deletion.isHovered.read(e) ||
          this._inlineDiffView.isHovered.read(e) ||
          this._lineReplacementView.isHovered.read(e) ||
          this._insertion.isHovered.read(e) ||
          this._customView.isHovered.read(e),
      )),
      (this._gutterIndicatorOffset = Xj(this, (e) => {
        if ("insertionMultiLine" === this._uiState.read(e)?.state?.kind)
          return this._insertion.startLineOffset.read(e);
        const t = this._ghostTextIndicator.read(e);
        return t
          ? (function (e, t) {
              const n = e.model.inlineEdit.edit.replacements;
              if (1 !== n.length) return 0;
              const i = t.getModel();
              if (!i) return 0;
              const r = i.getEOL(),
                o = n[0];
              if (o.range.isEmpty() && o.text.startsWith(r)) {
                const e = t.getLineHeightForPosition(o.range.getStartPosition());
                return (
                  (function (e, t) {
                    if (!t.length) return 0;
                    let n = 0,
                      i = 0;
                    for (; e.startsWith(t, i); ) (n++, (i += t.length));
                    return n;
                  })(o.text, r) * e
                );
              }
              return 0;
            })(t, this._editor)
          : 0;
      })),
      (this._sideBySide = this._register(
        this._instantiationService.createInstance(
          WOe,
          this._editor,
          this._model.map((e) => e?.inlineEdit),
          this._previewTextModel,
          this._uiState.map((e) =>
            e && e.state?.kind === STe.SideBySide
              ? { newTextLineCount: e.newTextLineCount, isInDiffEditor: e.isInDiffEditor }
              : void 0,
          ),
          this._tabAction,
        ),
      )),
      (this._deletion = this._register(
        this._instantiationService.createInstance(
          AOe,
          this._editor,
          this._model.map((e) => e?.inlineEdit),
          this._uiState.map((e) =>
            e && e.state?.kind === STe.Deletion
              ? {
                  originalRange: e.state.originalRange,
                  deletions: e.state.deletions,
                  inDiffEditor: e.isInDiffEditor,
                }
              : void 0,
          ),
          this._tabAction,
        ),
      )),
      (this._insertion = this._register(
        this._instantiationService.createInstance(
          jOe,
          this._editor,
          this._uiState.map((e) =>
            e && e.state?.kind === STe.InsertionMultiLine
              ? {
                  lineNumber: e.state.lineNumber,
                  startColumn: e.state.column,
                  text: e.state.text,
                  inDiffEditor: e.isInDiffEditor,
                }
              : void 0,
          ),
          this._tabAction,
        ),
      )),
      (this._inlineDiffViewState = Xj(this, (e) => {
        const t = this._uiState.read(e);
        if (
          t &&
          t.state &&
          "wordReplacements" !== t.state.kind &&
          "insertionMultiLine" !== t.state.kind &&
          "collapsed" !== t.state.kind &&
          "custom" !== t.state.kind
        )
          return {
            modifiedText: new a3(t.newText),
            diff: t.diff,
            mode: t.state.kind,
            modifiedCodeEditor: this._sideBySide.previewEditor,
            isInDiffEditor: t.isInDiffEditor,
          };
      })),
      (this._inlineCollapsedView = this._register(
        this._instantiationService.createInstance(
          ROe,
          this._editor,
          this._model.map((e, t) =>
            "collapsed" === this._uiState.read(t)?.state?.kind ? e?.inlineEdit : void 0,
          ),
        ),
      )),
      (this._customView = this._register(
        this._instantiationService.createInstance(
          MOe,
          this._editor,
          this._model.map((e, t) =>
            "custom" === this._uiState.read(t)?.state?.kind ? e?.displayLocation : void 0,
          ),
          this._tabAction,
        ),
      )),
      (this._inlineDiffView = this._register(
        new zOe(this._editor, this._inlineDiffViewState, this._previewTextModel),
      )),
      (this._wordReplacementViews = yF(
        this,
        this._uiState.map((e) =>
          "wordReplacements" === e?.state?.kind ? e.state.replacements : [],
        ),
        (e, t) =>
          t.add(
            this._instantiationService.createInstance(HOe, this._editorObs, e, this._tabAction),
          ),
      )),
      (this._lineReplacementView = this._register(
        this._instantiationService.createInstance(
          BOe,
          this._editorObs,
          this._uiState.map((e) =>
            e?.state?.kind === STe.LineReplacement
              ? {
                  originalRange: e.state.originalRange,
                  modifiedRange: e.state.modifiedRange,
                  modifiedLines: e.state.modifiedLines,
                  replacements: e.state.replacements,
                }
              : void 0,
          ),
          this._uiState.map((e) => e?.isInDiffEditor ?? !1),
          this._tabAction,
        ),
      )),
      (this._useCodeShifting = this._editorObs.getOption(71).map((e) => e.edits.allowCodeShifting)),
      (this._renderSideBySide = this._editorObs.getOption(71).map((e) => e.edits.renderSideBySide)),
      this._register(
        aF((e, t) => {
          const n = this._model.read(e);
          n &&
            t.add(
              $O.any(
                this._sideBySide.onDidClick,
                this._deletion.onDidClick,
                this._lineReplacementView.onDidClick,
                this._insertion.onDidClick,
                ...this._wordReplacementViews.read(e).map((e) => e.onDidClick),
                this._inlineDiffView.onDidClick,
                this._customView.onDidClick,
              )((e) => {
                this._viewHasBeenShownLongerThan(350) && (e.preventDefault(), n.accept());
              }),
            );
        }),
      ),
      this._indicator.recomputeInitiallyAndOnChange(this._store),
      this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store),
      this._indicatorCyclicDependencyCircuitBreaker.set(!0, void 0),
      this._register(
        this._instantiationService.createInstance(
          IOe,
          this._host,
          this._model,
          this._indicator,
          this._inlineCollapsedView,
        ),
      ));
    const s = Xj(this, (e) =>
        Math.max(
          ...this._wordReplacementViews.read(e).map((t) => t.minEditorScrollHeight.read(e)),
          this._lineReplacementView.minEditorScrollHeight.read(e),
          this._customView.minEditorScrollHeight.read(e),
        ),
      ).recomputeInitiallyAndOnChange(this._store),
      a = this._editor.getModel();
    let l;
    (this._register(
      rF((e) => {
        const t = s.read(e);
        this._editor.changeViewZones((e) => {
          const n = this._editor.getScrollHeight(),
            i = t - n + 1;
          (0 !== i && l && (e.removeZone(l), (l = void 0)),
            i <= 0 ||
              (l = e.addZone({
                afterLineNumber: a.getLineCount(),
                heightInPx: i,
                domNode: VB("div.minScrollHeightViewZone"),
              })));
        });
      }),
    ),
      this._constructorDone.set(!0, void 0));
  }
  getCacheId(e) {
    return e.inlineEdit.inlineCompletion.identity.id;
  }
  determineView(e, t, n, i) {
    const r = e.inlineEdit,
      o = this._previousView?.id === this.getCacheId(e) && !e.displayLocation?.jumpToEdit,
      s =
        this._previousView?.editorWidth !== this._editorObs.layoutInfoWidth.read(t) &&
        (this._previousView?.view === STe.SideBySide ||
          this._previousView?.view === STe.LineReplacement);
    if (o && !s) return this._previousView.view;
    if (e.inlineEdit.inlineCompletion instanceof vTe && e.inlineEdit.inlineCompletion.uri)
      return STe.Custom;
    if (e.displayLocation && !e.inlineEdit.inlineCompletion.identity.jumpedTo.read(t))
      return STe.Custom;
    const a = r.originalLineRange.length,
      l = r.modifiedLineRange.length,
      c = n.flatMap((e) => e.innerChanges ?? []),
      d = 1 === c.length;
    if (!e.isInDiffEditor) {
      if (d && "never" !== this._useCodeShifting.read(t) && GOe(n))
        return (function (e, t) {
          if (!t) return !1;
          if (!GOe(e)) return !1;
          const n = t;
          return e.every((e) => e.innerChanges.every((e) => i(e)));
          function i(e) {
            const t = e.originalRange.getStartPosition();
            return !!n.isBeforeOrEqual(t) || t.lineNumber < n.lineNumber;
          }
        })(n, r.cursorPosition)
          ? STe.InsertionInline
          : STe.LineReplacement;
      if (YOe(c, r, i)) return STe.Deletion;
      if (ZOe(n) && "always" === this._useCodeShifting.read(t)) return STe.InsertionMultiLine;
      const o = c.every(
        (e) =>
          e3.ofRange(e.originalRange).columnCount < HOe.MAX_LENGTH &&
          e3.ofRange(e.modifiedRange).columnCount < HOe.MAX_LENGTH,
      );
      if (o && d && 1 === a && 1 === l) {
        const t = c.map((e) => i.getValueOfRange(e.modifiedRange)),
          n = c.map((t) => e.inlineEdit.originalText.getValueOfRange(t.originalRange));
        if (
          !(
            t.some((e) => e.includes("\t")) ||
            n.some((e) => e.includes("\t")) ||
            (c.some((e) => e.originalRange.isEmpty()) &&
              XOe(
                c.map((e) => new c3(e.originalRange, "")),
                r.originalText,
              ).some((e) => e.range.isEmpty() && e3.ofRange(e.range).columnCount < HOe.MAX_LENGTH))
          )
        )
          return STe.WordReplacements;
      }
    }
    if (a > 0 && l > 0)
      return (1 !== a || 1 !== l || e.isInDiffEditor) &&
        "never" !== this._renderSideBySide.read(t) &&
        WOe.fitsInsideViewport(this._editor, this._previewTextModel, r, t)
        ? STe.SideBySide
        : STe.LineReplacement;
    if (e.isInDiffEditor) {
      if (YOe(c, r, i)) return STe.Deletion;
      if (ZOe(n) && "always" === this._useCodeShifting.read(t)) return STe.InsertionMultiLine;
    }
    return STe.SideBySide;
  }
  determineRenderState(e, t, n, i) {
    const r = e.inlineEdit;
    let o = this.determineView(e, t, n, i);
    if (this._willRenderAboveCursor(t, r, o))
      switch (o) {
        case STe.LineReplacement:
        case STe.WordReplacements:
          o = STe.SideBySide;
      }
    this._previousView = {
      id: this.getCacheId(e),
      view: o,
      editorWidth: this._editor.getLayoutInfo().width,
      timestamp: Date.now(),
    };
    const s = n.flatMap((e) => e.innerChanges ?? []),
      a = this._editor.getModel(),
      l = s.map((e) => ({
        originalRange: e.originalRange,
        modifiedRange: e.modifiedRange,
        original: a.getValueInRange(e.originalRange),
        modified: i.getValueOfRange(e.modifiedRange),
      })),
      c = r.cursorPosition,
      d = 0 !== l.length && l[0].modified.startsWith(a.getEOL()),
      u = {
        cursorColumnDistance:
          0 === r.edit.replacements.length
            ? 0
            : r.edit.replacements[0].range.getStartPosition().column - c.column,
        cursorLineDistance:
          r.lineEdit.lineRange.startLineNumber -
          c.lineNumber +
          (d && r.lineEdit.lineRange.startLineNumber >= c.lineNumber ? 1 : 0),
        lineCountOriginal: r.lineEdit.lineRange.length,
        lineCountModified: r.lineEdit.newLines.length,
        characterCountOriginal: l.reduce((e, t) => e + t.original.length, 0),
        characterCountModified: l.reduce((e, t) => e + t.modified.length, 0),
        disjointReplacements: l.length,
        sameShapeReplacements: l.every(
          (e) => e.original === l[0].original && e.modified === l[0].modified,
        ),
      };
    switch (o) {
      case STe.InsertionInline:
        return { kind: STe.InsertionInline, viewData: u };
      case STe.SideBySide:
        return { kind: STe.SideBySide, viewData: u };
      case STe.Collapsed:
        return { kind: STe.Collapsed, viewData: u };
      case STe.Custom:
        return { kind: STe.Custom, displayLocation: e.displayLocation, viewData: u };
    }
    if (o === STe.Deletion)
      return {
        kind: STe.Deletion,
        originalRange: r.originalLineRange,
        deletions: s.map((e) => e.originalRange),
        viewData: u,
      };
    if (o === STe.InsertionMultiLine) {
      const e = s[0];
      return {
        kind: STe.InsertionMultiLine,
        lineNumber: e.originalRange.startLineNumber,
        column: e.originalRange.startColumn,
        text: i.getValueOfRange(e.modifiedRange),
        viewData: u,
      };
    }
    const h = l.map((e) => new c3(e.originalRange, e.modified));
    if (0 !== h.length) {
      if (o === STe.WordReplacements) {
        let e = (function (e, t) {
          return QOe(e, t, (e) => /^[a-zA-Z]$/.test(e));
        })(h, r.originalText);
        return (
          e.some((e) => e.range.isEmpty()) && (e = XOe(h, r.originalText)),
          { kind: STe.WordReplacements, replacements: e, viewData: u }
        );
      }
      return o === STe.LineReplacement
        ? {
            kind: STe.LineReplacement,
            originalRange: r.originalLineRange,
            modifiedRange: r.modifiedLineRange,
            modifiedLines: r.modifiedLineRange.mapToLineArray((e) => i.getLineAt(e)),
            replacements: s.map((e) => ({
              originalRange: e.originalRange,
              modifiedRange: e.modifiedRange,
            })),
            viewData: u,
          }
        : void 0;
    }
  }
  _willRenderAboveCursor(e, t, n) {
    if ("always" === this._useCodeShifting.read(e)) return !1;
    for (const i of t.multiCursorPositions) {
      if (n === STe.WordReplacements && i.lineNumber === t.originalLineRange.startLineNumber + 1)
        return !0;
      if (
        n === STe.LineReplacement &&
        i.lineNumber >= t.originalLineRange.endLineNumberExclusive &&
        i.lineNumber < t.modifiedLineRange.endLineNumberExclusive + t.modifiedLineRange.length
      )
        return !0;
    }
    return !1;
  }
  _viewHasBeenShownLongerThan(e) {
    const t = this._previousView?.timestamp;
    if (!t) throw new QI("viewHasBeenShownLongThan called before a view has been shown");
    return Date.now() - t >= e;
  }
};
function GOe(e) {
  return e.every((e) =>
    e.innerChanges.every((e) =>
      (function (e) {
        if (!e.originalRange.isEmpty()) return !1;
        const t = e.modifiedRange.startLineNumber === e.modifiedRange.endLineNumber;
        if (!t) return !1;
        return !0;
      })(e),
    ),
  );
}
function ZOe(e) {
  const t = e.flatMap((e) => e.innerChanges ?? []);
  if (1 !== t.length) return !1;
  const n = t[0];
  return (
    !!n.originalRange.isEmpty() && n.modifiedRange.startLineNumber !== n.modifiedRange.endLineNumber
  );
}
function YOe(e, t, n) {
  const i = e.map((e) => ({
    original: t.originalText.getValueOfRange(e.originalRange),
    modified: n.getValueOfRange(e.modifiedRange),
  }));
  return i.every(
    ({ original: e, modified: t }) =>
      "" === t.trim() && e.length > 0 && (e.length > t.length || "" !== e.trim()),
  );
}
function XOe(e, t) {
  return QOe(e, t, (e) => !/^\s$/.test(e));
}
function QOe(e, t, n) {
  const i = [];
  e.sort((e, t) => YH.compareRangesUsingStarts(e.range, t.range));
  for (const o of e) {
    let e = o.range.startColumn - 1,
      n = o.range.endColumn - 2,
      s = "",
      a = "";
    const l = t.getLineAt(o.range.startLineNumber),
      c = t.getLineAt(o.range.endLineNumber);
    if (r(l[e])) for (; r(l[e - 1]); ) ((s = l[e - 1] + s), e--);
    if (r(c[n]) || n < e) for (; r(c[n + 1]); ) ((a += c[n + 1]), n++);
    let d = new c3(
      new YH(o.range.startLineNumber, e + 1, o.range.endLineNumber, n + 2),
      s + o.text + a,
    );
    (i.length > 0 &&
      YH.areIntersectingOrTouching(i[i.length - 1].range, d.range) &&
      (d = c3.joinReplacements([i.pop(), d], t)),
      i.push(d));
  }
  function r(e) {
    return void 0 !== e && n(e);
  }
  return i;
}
KOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(5, vV),
  ],
  KOe,
);
let JOe = class extends PO {
  static {
    this.hot = Sne(this);
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this._editor = e),
      (this._edit = t),
      (this._model = n),
      (this._focusIsInMenu = i),
      (this._inlineEdit = Xj(this, (e) => {
        const t = this._model.read(e);
        if (!t) return;
        const n = this._edit.read(e);
        if (!n) return;
        const i = this._editor.getModel();
        if (!i) return;
        const r = t.inlineEditState.read(void 0)?.inlineCompletion.updatedEdit;
        if (!r) return;
        const o = r.replacements.map((e) => {
            const t = YH.fromPositions(
              i.getPositionAt(e.replaceRange.start),
              i.getPositionAt(e.replaceRange.endExclusive),
            );
            return new c3(t, e.newText);
          }),
          s = new l3(o),
          a = new ehe(i);
        return new gRe(
          a,
          s,
          t.primaryPosition.read(void 0),
          t.allPositions.read(void 0),
          n.commands,
          n.inlineCompletion,
        );
      })),
      (this._inlineEditModel = Xj(this, (e) => {
        const t = this._model.read(e);
        if (!t) return;
        const n = this._inlineEdit.read(e);
        if (!n) return;
        const i = Xj(this, (e) => {
          if (this._editorObs.isFocused.read(e)) {
            if (t.tabShouldJumpToInlineEdit.read(e)) return CTe.Jump;
            if (t.tabShouldAcceptInlineEdit.read(e)) return CTe.Accept;
          }
          return CTe.Inactive;
        });
        return new pRe(t, n, i);
      })),
      (this._inlineEditHost = Xj(this, (e) => {
        const t = this._model.read(e);
        if (t) return new fRe(t);
      })),
      (this._ghostTextIndicator = Xj(this, (e) => {
        const t = this._model.read(e);
        if (!t) return;
        const n = t.inlineCompletionState.read(e);
        if (!n) return;
        const i = n.inlineCompletion;
        if (!i) return;
        if (!i.showInlineEditMenu) return;
        const r = Q5.ofLength(n.primaryGhostText.lineNumber, 1);
        return new mRe(this._editor, t, r, i);
      })),
      (this._editorObs = xde(this._editor)),
      this._register(
        r.createInstance(
          KOe,
          this._editor,
          this._inlineEditHost,
          this._inlineEditModel,
          this._ghostTextIndicator,
          this._focusIsInMenu,
        ),
      ));
  }
};
JOe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(4, vV),
  ],
  JOe,
);
let eMe = class extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._editor = e),
      (this._model = t),
      (this._focusIsInMenu = n),
      (this._instantiationService = i),
      (this._ghostTexts = Xj(this, (e) => {
        const t = this._model.read(e);
        return t?.ghostTexts.read(e) ?? [];
      })),
      (this._stablizedGhostTexts = (function (e, t) {
        const n = LF("result", []),
          i = [];
        return (
          t.add(
            rF((t) => {
              const r = e.read(t);
              cF((e) => {
                if (r.length !== i.length) {
                  i.length = r.length;
                  for (let e = 0; e < i.length; e++) i[e] || (i[e] = LF("item", r[e]));
                  n.set([...i], e);
                }
                i.forEach((t, n) => t.set(r[n], e));
              });
            }),
          ),
          n
        );
      })(this._ghostTexts, this._store)),
      (this._editorObs = xde(this._editor)),
      (this._ghostTextWidgets = yF(this, this._stablizedGhostTexts, (e, t) =>
        tF((t) =>
          this._instantiationService.createInstance(
            sRe.hot.read(t),
            this._editor,
            {
              ghostText: e,
              warning: this._model.map((e, t) => {
                const n = e?.warning?.read(t);
                return n ? { icon: n.icon } : void 0;
              }),
              minReservedLineCount: xne(0),
              targetTextModel: this._model.map((e) => e?.textModel),
              handleInlineCompletionShown: this._model.map((e, t) => {
                const n = e?.inlineCompletionState.read(t)?.inlineCompletion;
                return n ? (t) => e.handleInlineSuggestionShown(n, STe.GhostText, t) : () => {};
              }),
            },
            this._editorObs
              .getOption(71)
              .map((e) => ({ syntaxHighlightingEnabled: e.syntaxHighlightingEnabled })),
            !1,
            !1,
          ),
        ).recomputeInitiallyAndOnChange(t),
      ).recomputeInitiallyAndOnChange(this._store)),
      (this._inlineEdit = Xj(
        this,
        (e) => this._model.read(e)?.inlineEditState.read(e)?.inlineEdit,
      )),
      (this._everHadInlineEdit = bF(
        this,
        (e, t) =>
          t ||
          !!this._inlineEdit.read(e) ||
          !!this._model.read(e)?.inlineCompletionState.read(e)?.inlineCompletion
            ?.showInlineEditMenu,
      )),
      (this._inlineEditWidget = tF((e) => {
        if (this._everHadInlineEdit.read(e))
          return this._instantiationService.createInstance(
            JOe.hot.read(e),
            this._editor,
            this._inlineEdit,
            this._model,
            this._focusIsInMenu,
          );
      }).recomputeInitiallyAndOnChange(this._store)),
      (this._fontFamily = this._editorObs.getOption(71).map((e) => e.fontFamily)),
      this._register(
        hG(
          Xj(
            (e) =>
              `\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .ghost-text {\n\tfont-family: ${this._fontFamily.read(e)};\n}`,
          ),
        ),
      ),
      this._register(new n_e(this._editor, this._model, this._instantiationService)));
  }
  shouldShowHoverAtViewZone(e) {
    return this._ghostTextWidgets.get()[0]?.get().ownsViewZone(e) ?? !1;
  }
};
eMe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(3, vV),
  ],
  eMe,
);
var tMe,
  nMe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let iMe = class extends PO {
  static {
    tMe = this;
  }
  static {
    this._instances = new Set();
  }
  static {
    this.hot = Sne(this);
  }
  static {
    this.ID = "editor.contrib.inlineCompletionsController";
  }
  static getInFocusedEditorOrParent(e) {
    const t = Nye(e);
    return t ? tMe.get(t) : null;
  }
  static get(e) {
    return (t = e.getContribution(tMe.ID)) instanceof qNe ? t._instance : t;
    var t;
  }
  constructor(e, t, n, i, r, o, s, a, l, c) {
    (super(),
      (this.editor = e),
      (this._instantiationService = t),
      (this._contextKeyService = n),
      (this._configurationService = i),
      (this._commandService = r),
      (this._debounceService = o),
      (this._languageFeaturesService = s),
      (this._accessibilitySignalService = a),
      (this._keybindingService = l),
      (this._accessibilityService = c),
      (this._editorObs = xde(this.editor)),
      (this._positions = Xj(
        this,
        (e) => this._editorObs.selections.read(e)?.map((e) => e.getEndPosition()) ?? [new xV(1, 1)],
      )),
      (this._suggestWidgetAdapter = this._register(
        new eRe(
          this._editorObs,
          (e) => this.model.get()?.handleSuggestAccepted(e),
          () => this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit(),
        ),
      )),
      (this._enabledInConfig = gF(
        this,
        this.editor.onDidChangeConfiguration,
        () => this.editor.getOption(71).enabled,
      )),
      (this._isScreenReaderEnabled = gF(
        this,
        this._accessibilityService.onDidChangeScreenReaderOptimized,
        () => this._accessibilityService.isScreenReaderOptimized(),
      )),
      (this._editorDictationInProgress = gF(
        this,
        this._contextKeyService.onDidChangeContext,
        () =>
          !0 ===
          this._contextKeyService
            .getContext(this.editor.getDomNode())
            .getValue("editorDictation.inProgress"),
      )),
      (this._enabled = Xj(
        this,
        (e) =>
          this._enabledInConfig.read(e) &&
          (!this._isScreenReaderEnabled.read(e) || !this._editorDictationInProgress.read(e)),
      )),
      (this._debounceValue = this._debounceService.for(
        this._languageFeaturesService.inlineCompletionsProvider,
        "InlineCompletionsDebounce",
        { min: 50, max: 50 },
      )),
      (this._focusIsInMenu = LF(this, !1)),
      (this._focusIsInEditorOrMenu = Xj(this, (e) => {
        const t = this._editorObs.isFocused.read(e),
          n = this._focusIsInMenu.read(e);
        return t || n;
      })),
      (this._cursorIsInIndentation = Xj(this, (e) => {
        const t = this._editorObs.cursorPosition.read(e);
        if (null === t) return !1;
        const n = this._editorObs.model.read(e);
        if (!n) return !1;
        this._editorObs.versionId.read(e);
        const i = n.getLineIndentColumn(t.lineNumber);
        return t.column <= i;
      })),
      (this.model = tF(this, (e) => {
        if (this._editorObs.isReadonly.read(e)) return;
        const t = this._editorObs.model.read(e);
        if (!t) return;
        return this._instantiationService.createInstance(
          ZTe,
          t,
          this._suggestWidgetAdapter.selectedItem,
          this._editorObs.versionId,
          this._positions,
          this._debounceValue,
          this._enabled,
          this.editor,
        );
      }).recomputeInitiallyAndOnChange(this._store)),
      (this._playAccessibilitySignal = A9(this)),
      (this._hideInlineEditOnSelectionChange = this._editorObs.getOption(71).map((e) => !0)),
      (this._view = this._register(
        this._instantiationService.createInstance(
          eMe,
          this.editor,
          this.model,
          this._focusIsInMenu,
        ),
      )),
      tMe._instances.add(this),
      this._register(MO(() => tMe._instances.delete(this))),
      this._register(
        rF((e) => {
          const t = this.model.read(e);
          if (!t) return;
          const n = t.state.read(e);
          if (!n) return;
          if (!this._focusIsInEditorOrMenu.read(void 0)) return;
          const i = "inlineEdit" === n.kind ? n.nextEditUri : void 0;
          for (const r of tMe._instances)
            r !== this &&
              (i && lH(i, r.editor.getModel()?.uri) ? r.model.read(void 0)?.trigger() : r.reject());
        }),
      ),
      this._register(
        rF((e) => {
          const t = this.model.read(e),
            n = this.editor.getModel()?.uri;
          t &&
            n &&
            e.store.add(
              t.onDidAccept(() => {
                for (const e of tMe._instances) {
                  if (e === this) continue;
                  const t = e.model.read(void 0)?.state.read(void 0);
                  "inlineEdit" === t?.kind &&
                    lH(t.nextEditUri, n) &&
                    e.model.read(void 0)?.stop("automatic");
                }
              }),
            );
        }),
      ),
      this._register(
        s5(this._editorObs.onDidType, (e, t) => {
          this._enabled.get() && this.model.get()?.trigger();
        }),
      ),
      this._register(
        s5(this._editorObs.onDidPaste, (e, t) => {
          this._enabled.get() && this.model.get()?.trigger();
        }),
      ));
    const d = new Set([
      Rq.Tab.id,
      Rq.DeleteLeft.id,
      Rq.DeleteRight.id,
      Gme,
      "acceptSelectedSuggestion",
      NLe.ID,
      ELe.ID,
      ive,
      ...TH.getRegisteredCommands(),
    ]);
    (this._register(
      this._commandService.onDidExecuteCommand((t) => {
        if (d.has(t.commandId) && e.hasTextFocus() && this._enabled.get()) {
          let e = !1;
          (t.commandId === Gme && (e = !0),
            this._editorObs.forceUpdate((t) => {
              this.model.get()?.trigger(t, { noDelay: e });
            }));
        }
      }),
    ),
      this._register(
        s5(this._editorObs.selections, (e, t, n) => {
          if (n.some((e) => 3 === e.reason || "api" === e.source)) {
            if (
              !this._hideInlineEditOnSelectionChange.get() &&
              "inlineEdit" === this.model.get()?.state.get()?.kind
            )
              return;
            const e = this.model.get();
            if (!e) return;
            "ghostText" === e.state.get()?.kind && this.model.get()?.stop();
          }
        }),
      ),
      this._register(
        rF((t) => {
          const n = this._focusIsInEditorOrMenu.read(t),
            i = this.model.read(void 0);
          if (n) {
            const e = i?.state.read(void 0);
            return void (
              (e && "inlineEdit" === e.kind && e.nextEditUri) ||
              cF((e) => {
                for (const t of tMe._instances)
                  t !== this && t.model.read(void 0)?.stop("automatic", e);
              })
            );
          }
          this._contextKeyService.getContextKeyValue("accessibleViewIsShown") ||
            this._configurationService.getValue("editor.inlineSuggest.keepOnBlur") ||
            e.getOption(71).keepOnBlur ||
            o_e.dropDownVisible ||
            (i &&
              ((i.state.read(void 0)?.inlineCompletion?.isFromExplicitRequest &&
                i.inlineEditAvailable.read(void 0)) ||
                cF((e) => {
                  i.stop("automatic", e);
                })));
        }),
      ),
      this._register(
        rF((e) => {
          const t = this.model.read(e)?.inlineCompletionState.read(e);
          t?.suggestItem
            ? t.primaryGhostText.lineCount >= 2 && this._suggestWidgetAdapter.forceRenderingAbove()
            : this._suggestWidgetAdapter.stopForceRenderingAbove();
        }),
      ),
      this._register(
        MO(() => {
          this._suggestWidgetAdapter.stopForceRenderingAbove();
        }),
      ));
    const u = bF(this, (e, t) => {
      const n = this.model.read(e),
        i = n?.state.read(e);
      return this._suggestWidgetAdapter.selectedItem.get() ? t : i?.inlineCompletion?.semanticId;
    });
    (this._register(
      a5(
        Xj((e) => (this._playAccessibilitySignal.read(e), u.read(e), {})),
        async (e, t, n, i) => {
          let r = this.model.get(),
            o = r?.state.get();
          if (!o || !r) return;
          if (
            (await vM(50, dM(i)),
            await Uce(this._suggestWidgetAdapter.selectedItem, uR, () => !1, dM(i)),
            (r = this.model.get()),
            (o = r?.state.get()),
            !o || !r)
          )
            return;
          const s =
            "ghostText" === o.kind ? r.textModel.getLineContent(o.primaryGhostText.lineNumber) : "";
          (this._accessibilitySignalService.playSignal(
            "ghostText" === o.kind ? Lne.inlineSuggestion : Lne.nextEditSuggestion,
          ),
            this.editor.getOption(12) &&
              ("ghostText" === o.kind
                ? this._provideScreenReaderUpdate(o.primaryGhostText.renderForScreenReader(s))
                : this._provideScreenReaderUpdate("")));
        },
      ),
    ),
      this._register(
        this._configurationService.onDidChangeConfiguration((e) => {
          e.affectsConfiguration("accessibility.verbosity.inlineCompletions") &&
            this.editor.updateOptions({
              inlineCompletionsAccessibilityVerbose: this._configurationService.getValue(
                "accessibility.verbosity.inlineCompletions",
              ),
            });
        }),
      ),
      this.editor.updateOptions({
        inlineCompletionsAccessibilityVerbose: this._configurationService.getValue(
          "accessibility.verbosity.inlineCompletions",
        ),
      }));
    const h = new cDe(this._contextKeyService);
    (this._register(h.bind(pLe.cursorInIndentation, this._cursorIsInIndentation)),
      this._register(
        h.bind(pLe.hasSelection, (e) => !this._editorObs.cursorSelection.read(e)?.isEmpty()),
      ),
      this._register(
        h.bind(
          pLe.cursorAtInlineEdit,
          this.model.map((e, t) => e?.inlineEditState?.read(t)?.cursorAtInlineEdit.read(t)),
        ),
      ),
      this._register(
        h.bind(
          pLe.tabShouldAcceptInlineEdit,
          this.model.map((e, t) => !!e?.tabShouldAcceptInlineEdit.read(t)),
        ),
      ),
      this._register(
        h.bind(
          pLe.tabShouldJumpToInlineEdit,
          this.model.map((e, t) => !!e?.tabShouldJumpToInlineEdit.read(t)),
        ),
      ),
      this._register(
        h.bind(
          pLe.inlineEditVisible,
          (e) => void 0 !== this.model.read(e)?.inlineEditState.read(e),
        ),
      ),
      this._register(
        h.bind(
          pLe.inlineSuggestionHasIndentation,
          (e) => this.model.read(e)?.getIndentationInfo(e)?.startsWithIndentation,
        ),
      ),
      this._register(
        h.bind(
          pLe.inlineSuggestionHasIndentationLessThanTabSize,
          (e) => this.model.read(e)?.getIndentationInfo(e)?.startsWithIndentationLessThanTabSize,
        ),
      ),
      this._register(
        h.bind(pLe.suppressSuggestions, (e) => {
          const t = this.model.read(e),
            n = t?.inlineCompletionState.read(e);
          return n?.primaryGhostText && n?.inlineCompletion
            ? n.inlineCompletion.source.inlineSuggestions.suppressSuggestions
            : void 0;
        }),
      ),
      this._register(
        h.bind(pLe.inlineSuggestionVisible, (e) => {
          const t = this.model.read(e),
            n = t?.inlineCompletionState.read(e);
          return (
            !!n?.inlineCompletion &&
            void 0 !== n?.primaryGhostText &&
            !n?.primaryGhostText.isEmpty()
          );
        }),
      ));
    const g = Xj(this, (e) => {
      const t = this.model.read(e),
        n = t?.inlineCompletionState.read(e),
        i = n?.primaryGhostText;
      if (!i || i.isEmpty()) return;
      return new xV(i.lineNumber, i.parts[0].column);
    });
    (this._register(
      h.bind(pLe.cursorBeforeGhostText, (e) => {
        const t = g.read(e);
        if (!t) return !1;
        const n = this._editorObs.cursorPosition.read(e);
        return !!n && t.equals(n);
      }),
    ),
      this._register(this._instantiationService.createInstance(VLe, this.editor)));
  }
  playAccessibilitySignal(e) {
    this._playAccessibilitySignal.trigger(e);
  }
  _provideScreenReaderUpdate(e) {
    const t = this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),
      n = this._keybindingService.lookupKeybinding("editor.action.accessibleView");
    let i;
    (!t &&
      n &&
      this.editor.getOption(169) &&
      (i = SI(1204, "Inspect this in the accessible view ({0})", n.getAriaLabel())),
      pV(i ? e + ", " + i : e));
  }
  shouldShowHoverAt(e) {
    const t = this.model.get()?.primaryGhostText.get();
    return !!t && t.parts.some((n) => e.containsPosition(new xV(t.lineNumber, n.column)));
  }
  shouldShowHoverAtViewZone(e) {
    return this._view.shouldShowHoverAtViewZone(e);
  }
  reject() {
    cF((e) => {
      const t = this.model.get();
      if (t && (t.stop("explicitCancel", e), this._focusIsInEditorOrMenu.get()))
        for (const n of tMe._instances) n !== this && n.model.get()?.stop("automatic", e);
    });
  }
  jump() {
    const e = this.model.get();
    e && e.jump();
  }
};
iMe = tMe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    nMe(1, vV),
    nMe(2, xW),
    nMe(3, OU),
    nMe(4, PV),
    nMe(5, gme),
    nMe(6, mee),
    nMe(7, kne),
    nMe(8, N5),
    nMe(9, KK),
  ],
  iMe,
);
class rMe extends AH {
  static {
    this.ID = Yme;
  }
  constructor() {
    super({
      id: rMe.ID,
      label: EI(1183, "Show Next Inline Suggestion"),
      precondition: eW.and($$.writable, pLe.inlineSuggestionVisible),
      kbOpts: { weight: 100, primary: 606 },
    });
  }
  async run(e, t) {
    const n = iMe.get(t);
    n?.model.get()?.next();
  }
}
class oMe extends AH {
  static {
    this.ID = Zme;
  }
  constructor() {
    super({
      id: oMe.ID,
      label: EI(1184, "Show Previous Inline Suggestion"),
      precondition: eW.and($$.writable, pLe.inlineSuggestionVisible),
      kbOpts: { weight: 100, primary: 604 },
    });
  }
  async run(e, t) {
    const n = iMe.get(t);
    n?.model.get()?.previous();
  }
}
const sMe = (function (...e) {
  return new iLe(e);
})(
  ((aMe = {
    showNoResultNotification: tLe(QNe()),
    providerId: tLe(
      (function (e, t) {
        return new rLe(e, t);
      })("vscode://schemas/inlineCompletionProviderIdArgs", YNe),
    ),
    explicit: tLe(QNe()),
  }),
  new nLe(aMe)),
  new JNe(),
);
var aMe;
DW.registerKeybindingRule({
  id: Gme,
  weight: 202,
  primary: 2,
  when: eW.and(pLe.inInlineEditsPreviewEditor),
});
class lMe extends AH {
  static {
    this.ID = Xme;
  }
  constructor() {
    super({
      id: lMe.ID,
      label: EI(1190, "Hide Inline Suggestion"),
      precondition: eW.or(pLe.inlineSuggestionVisible, pLe.inlineEditVisible),
      kbOpts: { weight: 190, primary: 9 },
      menuOpts: [
        { menuId: MW.InlineEditsActions, title: SI(1180, "Reject"), group: "primary", order: 3 },
      ],
    });
  }
  async run(e, t) {
    const n = iMe.getInFocusedEditorOrParent(e);
    (cF((e) => {
      n?.model.get()?.stop("explicitCancel", e);
    }),
      n?.editor.focus());
  }
}
class cMe extends AH {
  static {
    this.ID = Qme;
  }
  constructor() {
    super({
      id: cMe.ID,
      label: EI(1191, "Toggle Inline Suggestions Show Collapsed"),
      precondition: eW.true(),
    });
  }
  async run(e, t) {
    const n = e.get(OU),
      i = n.getValue("editor.inlineSuggest.edits.showCollapsed");
    n.updateValue("editor.inlineSuggest.edits.showCollapsed", !i);
  }
}
DW.registerKeybindingRule({
  id: lMe.ID,
  weight: -1,
  primary: 9,
  secondary: [1033],
  when: eW.and(pLe.inInlineEditsPreviewEditor),
});
class dMe extends VW {
  static {
    this.ID = "editor.action.inlineSuggest.toggleAlwaysShowToolbar";
  }
  constructor() {
    super({
      id: dMe.ID,
      title: SI(1181, "Always Show Toolbar"),
      f1: !1,
      precondition: void 0,
      menu: [{ id: MW.InlineSuggestionToolbar, group: "secondary", order: 10 }],
      toggled: eW.equals("config.editor.inlineSuggest.showToolbar", "always"),
    });
  }
  async run(e) {
    const t = e.get(OU),
      n = "always" === t.getValue("editor.inlineSuggest.showToolbar") ? "onHover" : "always";
    t.updateValue("editor.inlineSuggest.showToolbar", n);
  }
}
var uMe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
class hMe {
  constructor(e, t, n) {
    ((this.owner = e), (this.range = t), (this.controller = n));
  }
  isValidForHoverAnchor(e) {
    return (
      1 === e.type &&
      this.range.startColumn <= e.range.startColumn &&
      this.range.endColumn >= e.range.endColumn
    );
  }
}
let gMe = class {
  constructor(e, t, n, i, r) {
    ((this._editor = e),
      (this.accessibilityService = t),
      (this._instantiationService = n),
      (this._telemetryService = i),
      (this._markdownRendererService = r),
      (this.hoverOrdinal = 4));
  }
  suggestHoverAnchor(e) {
    const t = iMe.get(this._editor);
    if (!t) return null;
    const n = e.target;
    if (8 === n.type) {
      const i = n.detail;
      if (t.shouldShowHoverAtViewZone(i.viewZoneId))
        return new Sme(
          1e3,
          this,
          YH.fromPositions(
            this._editor.getModel().validatePosition(i.positionBefore || i.position),
          ),
          e.event.posx,
          e.event.posy,
          !1,
        );
    }
    if (7 === n.type && t.shouldShowHoverAt(n.range))
      return new Sme(1e3, this, n.range, e.event.posx, e.event.posy, !1);
    if (6 === n.type) {
      if (n.detail.mightBeForeignElement && t.shouldShowHoverAt(n.range))
        return new Sme(1e3, this, n.range, e.event.posx, e.event.posy, !1);
    }
    if (9 === n.type && n.element) {
      const i = sRe.getWarningWidgetContext(n.element);
      if (i && t.shouldShowHoverAt(i.range))
        return new Sme(1e3, this, i.range, e.event.posx, e.event.posy, !1);
    }
    return null;
  }
  computeSync(e, t) {
    if ("onHover" !== this._editor.getOption(71).showToolbar) return [];
    const n = iMe.get(this._editor);
    return n && n.shouldShowHoverAt(e.range) ? [new hMe(this, e.range, n)] : [];
  }
  renderHoverParts(e, t) {
    const n = new AO(),
      i = t[0];
    (this._telemetryService.publicLog2("inlineCompletionHover.shown"),
      this.accessibilityService.isScreenReaderOptimized() &&
        !this._editor.getOption(12) &&
        n.add(this.renderScreenReaderText(e, i)));
    const r = i.controller.model.get(),
      o = document.createElement("div");
    (e.fragment.appendChild(o),
      n.add(
        aF((t, n) => {
          const i = n.add(
            this._instantiationService.createInstance(
              o_e.hot.read(t),
              this._editor,
              !1,
              xne(null),
              r.selectedInlineCompletionIndex,
              r.inlineCompletionsCount,
              r.activeCommands,
              r.warning,
              () => {
                e.onContentsChanged();
              },
            ),
          );
          o.replaceChildren(i.getDomNode());
        }),
      ),
      r.triggerExplicitly());
    return new kme([
      {
        hoverPart: i,
        hoverElement: o,
        dispose() {
          n.dispose();
        },
      },
    ]);
  }
  getAccessibleContent(e) {
    return SI(1205, "There are inline completions here");
  }
  renderScreenReaderText(e, t) {
    const n = new AO(),
      i = VB,
      r = i("div.hover-row.markdown-hover"),
      o = MB(r, i("div.hover-contents", { "aria-live": "assertive" })),
      s = (t) => {
        const i = SI(1206, "Suggestion:"),
          r = n.add(
            this._markdownRendererService.render(
              new rre().appendText(i).appendCodeblock("text", t),
              {
                context: this._editor,
                asyncRenderCallback: () => {
                  ((o.className = "hover-contents code-hover-contents"), e.onContentsChanged());
                },
              },
            ),
          );
        o.replaceChildren(r.element);
      };
    return (
      n.add(
        rF((e) => {
          const n = t.controller.model.read(e)?.primaryGhostText.read(e);
          if (n) {
            const e = this._editor.getModel().getLineContent(n.lineNumber);
            s(n.renderForScreenReader(e));
          } else PB(o);
        }),
      ),
      e.fragment.appendChild(r),
      n
    );
  }
};
gMe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([uMe(1, KK), uMe(2, vV), uMe(3, HW), uMe(4, _ge)], gMe);
(zH(iMe.ID, iMe.hot.get(), 3),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.inlineSuggest.trigger",
          label: EI(1185, "Trigger Inline Suggestion"),
          precondition: $$.writable,
          metadata: {
            description: SI(1172, "Triggers an inline suggestion in the editor."),
            args: [
              {
                name: "args",
                description: SI(1173, "Options for triggering inline suggestions."),
                isOptional: !0,
                schema: sMe.getJSONSchema(),
              },
            ],
          },
        });
      }
      async run(e, t, n) {
        const i = e.get(Y4),
          r = e.get(mee),
          o = iMe.get(t),
          s = sMe.validateOrThrow(n),
          a = s?.providerId
            ? r.inlineCompletionsProvider.all(t.getModel()).find((e) =>
                (function (e) {
                  const t = [];
                  return (
                    e.providerId &&
                      (t.push(e.providerId.toStringWithoutVersion()),
                      t.push(e.providerId.extensionId + ":*")),
                    t
                  );
                })(e).some((e) => e === s.providerId),
              )
            : void 0;
        (await (async function (e, t) {
          const n = new hF(e, t);
          try {
            await e(n);
          } finally {
            n.finish();
          }
        })(async (e) => {
          (await o?.model.get()?.trigger(e, { provider: a, explicit: s?.explicit ?? !0 }),
            o?.playAccessibilitySignal(e));
        }),
          s?.showNoResultNotification &&
            (o?.model.get()?.state.get() ||
              i.notify({
                severity: Z4.Info,
                message: SI(1174, "No inline suggestion is available."),
              })));
      }
    },
  ),
  VH(rMe),
  VH(oMe),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.inlineSuggest.acceptNextWord",
          label: EI(1186, "Accept Next Word Of Inline Suggestion"),
          precondition: eW.and($$.writable, pLe.inlineSuggestionVisible),
          kbOpts: {
            weight: 101,
            primary: 2065,
            kbExpr: eW.and(
              $$.writable,
              pLe.inlineSuggestionVisible,
              pLe.cursorBeforeGhostText,
              GK.negate(),
            ),
          },
          menuOpts: [
            {
              menuId: MW.InlineSuggestionToolbar,
              title: SI(1175, "Accept Word"),
              group: "primary",
              order: 2,
            },
          ],
        });
      }
      async run(e, t) {
        const n = iMe.get(t);
        await n?.model.get()?.acceptNextWord();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.inlineSuggest.acceptNextLine",
          label: EI(1187, "Accept Next Line Of Inline Suggestion"),
          precondition: eW.and($$.writable, pLe.inlineSuggestionVisible),
          kbOpts: { weight: 101 },
          menuOpts: [
            {
              menuId: MW.InlineSuggestionToolbar,
              title: SI(1176, "Accept Line"),
              group: "secondary",
              order: 2,
            },
          ],
        });
      }
      async run(e, t) {
        const n = iMe.get(t);
        await n?.model.get()?.acceptNextLine();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: Gme,
          label: EI(1188, "Accept Inline Suggestion"),
          precondition: eW.or(pLe.inlineSuggestionVisible, pLe.inlineEditVisible),
          menuOpts: [
            {
              menuId: MW.InlineSuggestionToolbar,
              title: SI(1177, "Accept"),
              group: "primary",
              order: 2,
            },
            {
              menuId: MW.InlineEditsActions,
              title: SI(1178, "Accept"),
              group: "primary",
              order: 2,
            },
          ],
          kbOpts: [
            {
              primary: 2,
              weight: 200,
              kbExpr: eW.or(
                eW.and(
                  pLe.inlineSuggestionVisible,
                  $$.tabMovesFocus.toNegated(),
                  oLe.Visible.toNegated(),
                  $$.hoverFocused.toNegated(),
                  pLe.hasSelection.toNegated(),
                  pLe.inlineSuggestionHasIndentationLessThanTabSize,
                ),
                eW.and(
                  pLe.inlineEditVisible,
                  $$.tabMovesFocus.toNegated(),
                  oLe.Visible.toNegated(),
                  $$.hoverFocused.toNegated(),
                  pLe.tabShouldAcceptInlineEdit,
                ),
              ),
            },
          ],
        });
      }
      async run(e, t) {
        const n = iMe.getInFocusedEditorOrParent(e);
        n && (n.model.get()?.accept(n.editor), n.editor.focus());
      }
    },
  ),
  VH(cMe),
  VH(lMe),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.inlineSuggest.jump",
          label: EI(1189, "Jump to next inline edit"),
          precondition: pLe.inlineEditVisible,
          menuOpts: [
            {
              menuId: MW.InlineEditsActions,
              title: SI(1179, "Jump"),
              group: "primary",
              order: 1,
              when: pLe.cursorAtInlineEdit.toNegated(),
            },
          ],
          kbOpts: {
            primary: 2,
            weight: 201,
            kbExpr: eW.and(
              pLe.inlineEditVisible,
              $$.tabMovesFocus.toNegated(),
              oLe.Visible.toNegated(),
              $$.hoverFocused.toNegated(),
              pLe.tabShouldJumpToInlineEdit,
            ),
          },
        });
      }
      async run(e, t) {
        const n = iMe.get(t);
        n && n.jump();
      }
    },
  ),
  WW(dMe),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.inlineSuggest.dev.extractRepro",
          label: SI(1182, "Developer: Extract Inline Suggest State"),
          alias: "Developer: Inline Suggest Extract Repro",
          precondition: eW.or(pLe.inlineEditVisible, pLe.inlineSuggestionVisible),
        });
      }
      async run(e, t) {
        const n = e.get(ade),
          i = iMe.get(t),
          r = i?.model.get();
        if (!r) return;
        const o = r.extractReproSample(),
          s = ZM(JSON.stringify({ inlineCompletion: o.inlineCompletion }, null, 4))
            .map((e) => "// " + e)
            .join("\n"),
          a = `${o.documentValue}\n\n// <json>\n${s}\n// </json>\n`;
        return (await n.writeText(a), { reproCase: a });
      }
    },
  ),
  WW($Te),
  WW(qTe),
  Eme.register(gMe),
  $Ne.register(new (class {})()));
var pMe,
  fMe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let mMe = class {
  static {
    pMe = this;
  }
  static {
    this.ID = "editor.contrib.gotodefinitionatposition";
  }
  static {
    this.MAX_SOURCE_PREVIEW_LINES = 8;
  }
  constructor(e, t, n, i) {
    ((this.textModelResolverService = t),
      (this.languageService = n),
      (this.languageFeaturesService = i),
      (this.toUnhook = new AO()),
      (this.toUnhookForKeyboard = new AO()),
      (this.currentWordAtPosition = null),
      (this.previousPromise = null),
      (this.editor = e),
      (this.linkDecorations = this.editor.createDecorationsCollection()));
    const r = new vye(e);
    (this.toUnhook.add(r),
      this.toUnhook.add(
        r.onMouseMoveOrRelevantKeyDown(([e, t]) => {
          this.startFindDefinitionFromMouse(e, t ?? void 0);
        }),
      ),
      this.toUnhook.add(
        r.onExecute((e) => {
          this.isEnabled(e) &&
            this.gotoDefinition(e.target.position, e.hasSideBySideModifier)
              .catch((e) => {
                HI(e);
              })
              .finally(() => {
                this.removeLinkDecorations();
              });
        }),
      ),
      this.toUnhook.add(
        r.onCancel(() => {
          (this.removeLinkDecorations(), (this.currentWordAtPosition = null));
        }),
      ));
  }
  static get(e) {
    return e.getContribution(pMe.ID);
  }
  async startFindDefinitionFromCursor(e) {
    (await this.startFindDefinition(e),
      this.toUnhookForKeyboard.add(
        this.editor.onDidChangeCursorPosition(() => {
          ((this.currentWordAtPosition = null),
            this.removeLinkDecorations(),
            this.toUnhookForKeyboard.clear());
        }),
      ),
      this.toUnhookForKeyboard.add(
        this.editor.onKeyDown((e) => {
          e &&
            ((this.currentWordAtPosition = null),
            this.removeLinkDecorations(),
            this.toUnhookForKeyboard.clear());
        }),
      ));
  }
  startFindDefinitionFromMouse(e, t) {
    if (9 === e.target.type && this.linkDecorations.length > 0) return;
    if (!this.editor.hasModel() || !this.isEnabled(e, t))
      return ((this.currentWordAtPosition = null), void this.removeLinkDecorations());
    const n = e.target.position;
    this.startFindDefinition(n);
  }
  async startFindDefinition(e) {
    this.toUnhookForKeyboard.clear();
    const t = e ? this.editor.getModel()?.getWordAtPosition(e) : null;
    if (!t) return ((this.currentWordAtPosition = null), void this.removeLinkDecorations());
    if (
      this.currentWordAtPosition &&
      this.currentWordAtPosition.startColumn === t.startColumn &&
      this.currentWordAtPosition.endColumn === t.endColumn &&
      this.currentWordAtPosition.word === t.word
    )
      return;
    this.currentWordAtPosition = t;
    const n = new dge(this.editor, 15);
    let i;
    (this.previousPromise && (this.previousPromise.cancel(), (this.previousPromise = null)),
      (this.previousPromise = gM((t) => this.findDefinition(e, t))));
    try {
      i = await this.previousPromise;
    } catch (D2t) {
      return void HI(D2t);
    }
    if (!i || !i.length || !n.validate(this.editor)) return void this.removeLinkDecorations();
    const r = i[0].originSelectionRange
      ? YH.lift(i[0].originSelectionRange)
      : new YH(e.lineNumber, t.startColumn, e.lineNumber, t.endColumn);
    if (!(i.length > 1)) {
      const e = i[0];
      if (!e.uri) return;
      return this.textModelResolverService.createModelReference(e.uri).then((t) => {
        if (!t.object || !t.object.textEditorModel) return void t.dispose();
        const {
            object: { textEditorModel: n },
          } = t,
          { startLineNumber: i } = e.range;
        if (i < 1 || i > n.getLineCount()) return void t.dispose();
        const o = this.getPreviewValue(n, i, e),
          s = this.languageService.guessLanguageIdByFilepathOrFirstLine(n.uri);
        (this.addDecoration(r, o ? new rre().appendCodeblock(s || "", o) : void 0), t.dispose());
      });
    }
    {
      let e = r;
      for (const { originSelectionRange: t } of i) t && (e = YH.plusRange(e, t));
      this.addDecoration(
        e,
        new rre().appendText(SI(1077, "Click to show {0} definitions.", i.length)),
      );
    }
  }
  getPreviewValue(e, t, n) {
    let i = n.range;
    (i.endLineNumber - i.startLineNumber >= pMe.MAX_SOURCE_PREVIEW_LINES &&
      (i = this.getPreviewRangeBasedOnIndentation(e, t)),
      (i = e.validateRange(i)));
    return this.stripIndentationFromPreviewRange(e, t, i);
  }
  stripIndentationFromPreviewRange(e, t, n) {
    let i = e.getLineFirstNonWhitespaceColumn(t);
    for (let r = t + 1; r < n.endLineNumber; r++) {
      const t = e.getLineFirstNonWhitespaceColumn(r);
      i = Math.min(i, t);
    }
    return e
      .getValueInRange(n)
      .replace(new RegExp(`^\\s{${i - 1}}`, "gm"), "")
      .trim();
  }
  getPreviewRangeBasedOnIndentation(e, t) {
    const n = e.getLineFirstNonWhitespaceColumn(t),
      i = Math.min(e.getLineCount(), t + pMe.MAX_SOURCE_PREVIEW_LINES);
    let r = t + 1;
    for (; r < i; r++) {
      if (n === e.getLineFirstNonWhitespaceColumn(r)) break;
    }
    return new YH(t, 1, r + 1, 1);
  }
  addDecoration(e, t) {
    const n = {
      range: e,
      options: {
        description: "goto-definition-link",
        inlineClassName: "goto-definition-link",
        hoverMessage: t,
      },
    };
    this.linkDecorations.set([n]);
  }
  removeLinkDecorations() {
    this.linkDecorations.clear();
  }
  isEnabled(e, t) {
    return (
      this.editor.hasModel() &&
      e.isLeftClick &&
      e.isNoneOrSingleMouseDown &&
      6 === e.target.type &&
      !(e.target.detail.injectedText?.options instanceof lee) &&
      (e.hasTriggerModifier || (!!t && t.keyCodeIsTriggerKey)) &&
      this.languageFeaturesService.definitionProvider.has(this.editor.getModel())
    );
  }
  findDefinition(e, t) {
    const n = this.editor.getModel();
    return n
      ? NSe(this.languageFeaturesService.definitionProvider, n, e, !1, t)
      : Promise.resolve(null);
  }
  async gotoDefinition(e, t) {
    return (
      this.editor.setPosition(e),
      this.editor.invokeWithinContext((e) => {
        const n = !t && this.editor.getOption(101) && !this.isInPeekEditor(e);
        return new ASe(
          { openToSide: t, openInPeek: n, muteMessage: !0 },
          { title: { value: "", original: "" }, id: "", precondition: void 0 },
        ).run(e);
      })
    );
  }
  isInPeekEditor(e) {
    const t = e.get(xW);
    return jye.inPeekEditor.getValue(t);
  }
  dispose() {
    (this.toUnhook.dispose(), this.toUnhookForKeyboard.dispose());
  }
};
((mMe = pMe =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })([fMe(1, CV), fMe(2, BU), fMe(3, mee)], mMe)),
  zH(mMe.ID, mMe, 2));
var _Me;
(VH(
  class extends AH {
    constructor() {
      super({
        id: "editor.action.debugEditorGpuRenderer",
        label: EI(1101, "Developer: Debug Editor GPU Renderer"),
        precondition: eW.true(),
      });
    }
    async run(e, t) {
      const n = e.get(vV),
        i = e.get(Ghe),
        r = await i.pick(
          [
            { label: SI(1098, "Log Texture Atlas Stats"), id: "logTextureAtlasStats" },
            { label: SI(1099, "Save Texture Atlas"), id: "saveTextureAtlas" },
            { label: SI(1100, "Draw Glyph"), id: "drawGlyph" },
          ],
          { canPickMany: !1 },
        );
      if (r)
        switch (r.id) {
          case "logTextureAtlasStats":
            n.invokeFunction((e) => {
              const t = e.get(yH),
                n = d5.atlas;
              if (!d5.atlas) return void t.error("No texture atlas found");
              const i = n.getStats();
              t.info(["Texture atlas stats", ...i].join("\n\n"));
            });
            break;
          case "saveTextureAtlas":
            n.invokeFunction(async (e) => {
              const t = e.get(Rge),
                n = e.get(NIe),
                i = t.getWorkspace().folders;
              if (i.length > 0) {
                const e = d5.atlas,
                  t = [];
                for (const [r, o] of e.pages.entries())
                  t.push(
                    n.writeFile(
                      mP.joinPath(i[0].uri, `textureAtlasPage${r}_actual.png`),
                      PP.wrap(new Uint8Array(await (await o.source.convertToBlob()).arrayBuffer())),
                    ),
                    n.writeFile(
                      mP.joinPath(i[0].uri, `textureAtlasPage${r}_usage.png`),
                      PP.wrap(new Uint8Array(await (await o.getUsagePreview()).arrayBuffer())),
                    ),
                  );
                await Promise.all(t);
              }
            });
            break;
          case "drawGlyph":
            n.invokeFunction(async (e) => {
              const t = e.get(OU),
                n = e.get(NIe),
                i = e.get(Ghe),
                r = e.get(Rge).getWorkspace().folders;
              if (0 === r.length) return;
              const o = d5.atlas,
                s = t.getValue("editor.fontFamily"),
                a = t.getValue("editor.fontSize"),
                l = new A4(a, s, wB().devicePixelRatio, d5.decorationStyleCache);
              let c = await i.input({
                prompt: "Enter a character to draw (prefix with 0x for code point))",
              });
              if (!c) return;
              const d = c.match(/0x(?<codePoint>[0-9a-f]+)/i)?.groups?.codePoint;
              void 0 !== d && (c = String.fromCodePoint(parseInt(d, 16)));
              const u = o.getGlyph(l, c, 0, 0, 0);
              if (!u) return;
              const h = o.pages[u.pageIndex].source
                .getContext("2d")
                ?.getImageData(u.x, u.y, u.w, u.h);
              if (!h) return;
              const g = new OffscreenCanvas(h.width, h.height);
              R4(g.getContext("2d")).putImageData(h, 0, 0);
              const p = await g.convertToBlob({ type: "image/png" }),
                f = mP.joinPath(
                  r[0].uri,
                  `glyph_${c}_0_${a}px_${s.replaceAll(/[,\\\/\.'\s]/g, "_")}.png`,
                );
              await n.writeFile(f, PP.wrap(new Uint8Array(await p.arrayBuffer())));
            });
        }
    }
  },
),
  (function (e) {
    ((e.NoAutoFocus = "noAutoFocus"),
      (e.FocusIfVisible = "focusIfVisible"),
      (e.AutoFocusImmediately = "autoFocusImmediately"));
  })(_Me || (_Me = {})));
class vMe {
  constructor(e) {
    this._editor = e;
  }
  computeSync(e) {
    const t = (e) => ({ value: e }),
      n = this._editor.getLineDecorations(e.lineNumber),
      i = [],
      r = "lineNo" === e.laneOrLine;
    if (!n) return i;
    for (const o of n) {
      const n = o.options.glyphMargin?.position ?? $z.Center;
      if (!r && n !== e.laneOrLine) continue;
      const s = r ? o.options.lineNumberHoverMessage : o.options.glyphMarginHoverMessage;
      s && !ore(s) && i.push(...fj(s).map(t));
    }
    return i;
  }
}
var bMe;
const yMe = VB;
let xMe = class extends PO {
  static {
    bMe = this;
  }
  static {
    this.ID = "editor.contrib.modesGlyphHoverWidget";
  }
  constructor(e, t) {
    (super(),
      (this._markdownRendererService = t),
      (this.allowEditorOverflow = !0),
      (this._renderDisposeables = this._register(new AO())),
      (this._editor = e),
      (this._isVisible = !1),
      (this._messages = []),
      (this._hover = this._register(new m_e(!0))),
      this._hover.containerDomNode.classList.toggle("hidden", !this._isVisible),
      (this._hoverOperation = this._register(new u_e(this._editor, new vMe(this._editor)))),
      this._register(this._hoverOperation.onResult((e) => this._withResult(e))),
      this._register(
        this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()),
      ),
      this._register(
        this._editor.onDidChangeConfiguration((e) => {
          e.hasChanged(59) && this._updateFont();
        }),
      ),
      this._register(
        KF(this._hover.containerDomNode, "mouseleave", (e) => {
          this._onMouseLeave(e);
        }),
      ),
      this._editor.addOverlayWidget(this));
  }
  dispose() {
    ((this._hoverComputerOptions = void 0),
      this._editor.removeOverlayWidget(this),
      super.dispose());
  }
  getId() {
    return bMe.ID;
  }
  getDomNode() {
    return this._hover.containerDomNode;
  }
  getPosition() {
    return null;
  }
  _updateFont() {
    Array.prototype.slice
      .call(this._hover.contentsDomNode.getElementsByClassName("code"))
      .forEach((e) => this._editor.applyFontInfo(e));
  }
  _onModelDecorationsChanged() {
    this._isVisible &&
      this._hoverComputerOptions &&
      (this._hoverOperation.cancel(), this._hoverOperation.start(0, this._hoverComputerOptions));
  }
  showsOrWillShow(e) {
    const t = e.target;
    return 2 === t.type && t.detail.glyphMarginLane
      ? (this._startShowingAt(t.position.lineNumber, t.detail.glyphMarginLane), !0)
      : 3 === t.type && (this._startShowingAt(t.position.lineNumber, "lineNo"), !0);
  }
  _startShowingAt(e, t) {
    (this._hoverComputerOptions &&
      this._hoverComputerOptions.lineNumber === e &&
      this._hoverComputerOptions.laneOrLine === t) ||
      (this._hoverOperation.cancel(),
      this.hide(),
      (this._hoverComputerOptions = { lineNumber: e, laneOrLine: t }),
      this._hoverOperation.start(0, this._hoverComputerOptions));
  }
  hide() {
    ((this._hoverComputerOptions = void 0),
      this._hoverOperation.cancel(),
      this._isVisible &&
        ((this._isVisible = !1),
        this._hover.containerDomNode.classList.toggle("hidden", !this._isVisible)));
  }
  _withResult(e) {
    ((this._messages = e.value),
      this._messages.length > 0
        ? this._renderMessages(e.options.lineNumber, e.options.laneOrLine, this._messages)
        : this.hide());
  }
  _renderMessages(e, t, n) {
    this._renderDisposeables.clear();
    const i = document.createDocumentFragment();
    for (const r of n) {
      const e = yMe("div.hover-row.markdown-hover"),
        t = MB(e, yMe("div.hover-contents")),
        n = this._renderDisposeables.add(
          this._markdownRendererService.render(r.value, { context: this._editor }),
        );
      (t.appendChild(n.element), i.appendChild(e));
    }
    (this._updateContents(i), this._showAt(e, t));
  }
  _updateContents(e) {
    ((this._hover.contentsDomNode.textContent = ""),
      this._hover.contentsDomNode.appendChild(e),
      this._updateFont());
  }
  _showAt(e, t) {
    this._isVisible ||
      ((this._isVisible = !0),
      this._hover.containerDomNode.classList.toggle("hidden", !this._isVisible));
    const n = this._editor.getLayoutInfo(),
      i = this._editor.getTopForLineNumber(e),
      r = this._editor.getScrollTop(),
      o = this._editor.getOption(75),
      s = this._hover.containerDomNode.clientHeight,
      a = i - r - (s - o) / 2,
      l = n.glyphMarginLeft + n.glyphMarginWidth + ("lineNo" === t ? n.lineNumbersWidth : 0),
      c = n.height - s,
      d = Math.max(0, Math.min(Math.round(a), c));
    if (this._editor.getOption(51)) {
      const e = this._editor.getDomNode();
      if (e) {
        const t = aB(e);
        ((this._hover.containerDomNode.style.position = "fixed"),
          (this._hover.containerDomNode.style.left = `${t.left + l}px`),
          (this._hover.containerDomNode.style.top = `${t.top + d}px`));
      }
    } else
      ((this._hover.containerDomNode.style.position = "absolute"),
        (this._hover.containerDomNode.style.left = `${l}px`),
        (this._hover.containerDomNode.style.top = `${d}px`));
    this._hover.containerDomNode.style.zIndex = "11";
  }
  _onMouseLeave(e) {
    const t = this._editor.getDomNode();
    (!t || !c_e(t, e.x, e.y)) && this.hide();
  }
};
xMe = bMe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, _ge),
  ],
  xMe,
);
let wMe = class extends PO {
  static {
    this.ID = "editor.contrib.marginHover";
  }
  constructor(e, t) {
    (super(),
      (this._editor = e),
      (this._instantiationService = t),
      (this.shouldKeepOpenOnEditorMouseMoveOrLeave = !1),
      (this._listenersStore = new AO()),
      (this._hoverState = { mouseDown: !1 }),
      (this._reactToEditorMouseMoveRunner = this._register(
        new EM(() => this._reactToEditorMouseMove(this._mouseMoveEvent), 0),
      )),
      this._hookListeners(),
      this._register(
        this._editor.onDidChangeConfiguration((e) => {
          e.hasChanged(69) && (this._unhookListeners(), this._hookListeners());
        }),
      ));
  }
  _hookListeners() {
    const e = this._editor.getOption(69);
    ((this._hoverSettings = { enabled: e.enabled, sticky: e.sticky, hidingDelay: e.hidingDelay }),
      e.enabled
        ? (this._listenersStore.add(this._editor.onMouseDown((e) => this._onEditorMouseDown(e))),
          this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())),
          this._listenersStore.add(this._editor.onMouseMove((e) => this._onEditorMouseMove(e))),
          this._listenersStore.add(this._editor.onKeyDown((e) => this._onKeyDown(e))))
        : (this._listenersStore.add(this._editor.onMouseMove((e) => this._onEditorMouseMove(e))),
          this._listenersStore.add(this._editor.onKeyDown((e) => this._onKeyDown(e)))),
      this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e))),
      this._listenersStore.add(
        this._editor.onDidChangeModel(() => {
          (this._cancelScheduler(), this.hideGlyphHover());
        }),
      ),
      this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())),
      this._listenersStore.add(
        this._editor.onDidScrollChange((e) => this._onEditorScrollChanged(e)),
      ));
  }
  _unhookListeners() {
    this._listenersStore.clear();
  }
  _cancelScheduler() {
    ((this._mouseMoveEvent = void 0), this._reactToEditorMouseMoveRunner.cancel());
  }
  _onEditorScrollChanged(e) {
    (e.scrollTopChanged || e.scrollLeftChanged) && this.hideGlyphHover();
  }
  _onEditorMouseDown(e) {
    this._hoverState.mouseDown = !0;
    this._isMouseOnGlyphHoverWidget(e) || this.hideGlyphHover();
  }
  _isMouseOnGlyphHoverWidget(e) {
    const t = this._glyphWidget?.getDomNode();
    return !!t && c_e(t, e.event.posx, e.event.posy);
  }
  _onEditorMouseUp() {
    this._hoverState.mouseDown = !1;
  }
  _onEditorMouseLeave(e) {
    if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) return;
    this._cancelScheduler();
    this._isMouseOnGlyphHoverWidget(e) || this.hideGlyphHover();
  }
  _shouldNotRecomputeCurrentHoverWidget(e) {
    const t = this._hoverSettings.sticky,
      n = this._isMouseOnGlyphHoverWidget(e);
    return t && n;
  }
  _onEditorMouseMove(e) {
    if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) return;
    this._mouseMoveEvent = e;
    this._shouldNotRecomputeCurrentHoverWidget(e)
      ? this._reactToEditorMouseMoveRunner.cancel()
      : this._reactToEditorMouseMove(e);
  }
  _reactToEditorMouseMove(e) {
    if (!e) return;
    this._tryShowHoverWidget(e) || this.hideGlyphHover();
  }
  _tryShowHoverWidget(e) {
    return this._getOrCreateGlyphWidget().showsOrWillShow(e);
  }
  _onKeyDown(e) {
    this._editor.hasModel() &&
      5 !== e.keyCode &&
      6 !== e.keyCode &&
      57 !== e.keyCode &&
      4 !== e.keyCode &&
      this.hideGlyphHover();
  }
  hideGlyphHover() {
    this._glyphWidget?.hide();
  }
  _getOrCreateGlyphWidget() {
    return (
      this._glyphWidget ||
        (this._glyphWidget = this._instantiationService.createInstance(xMe, this._editor)),
      this._glyphWidget
    );
  }
  dispose() {
    (super.dispose(),
      this._unhookListeners(),
      this._listenersStore.dispose(),
      this._glyphWidget?.dispose());
  }
};
wMe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, vV),
  ],
  wMe,
);
function CMe(e, t, n, i) {
  if (1 === e.getLineCount() && 1 === e.getLineMaxColumn(1)) return [];
  const r = t.getLanguageConfiguration(e.getLanguageId()).indentRulesSupport;
  if (!r) return [];
  const o = new M$(e, r, t);
  for (i = Math.min(i, e.getLineCount()); n <= i && o.shouldIgnore(n); ) n++;
  if (n > i - 1) return [];
  const { tabSize: s, indentSize: a, insertSpaces: l } = e.getOptions(),
    c = (e, t) => ((t = t || 1), H$.shiftIndent(e, e.length + t, s, a, l)),
    d = (e, t) => ((t = t || 1), H$.unshiftIndent(e, e.length + t, s, a, l)),
    u = [];
  let h = XM(e.getLineContent(n)),
    g = h;
  o.shouldIncrease(n) ? ((g = c(g)), (h = c(h))) : o.shouldIndentNextLine(n) && (g = c(g));
  for (let p = ++n; p <= i; p++) {
    if (SMe(e, p)) continue;
    const t = XM(e.getLineContent(p)),
      n = g;
    (o.shouldDecrease(p, n) && ((g = d(g)), (h = d(h))),
      t !== g && u.push(hye.replaceMove(new XH(p, 1, p, t.length + 1), nz(g, a, l))),
      o.shouldIgnore(p) ||
        (o.shouldIncrease(p, n)
          ? ((h = c(h)), (g = h))
          : (g = o.shouldIndentNextLine(p, n) ? c(g) : h)));
  }
  return u;
}
function SMe(e, t) {
  if (!e.tokenization.isCheapToTokenize(t)) return !1;
  return 2 === e.tokenization.getLineTokens(t).getStandardTokenType(0);
}
(zH(qke.ID, qke, 2),
  zH(wMe.ID, wMe, 2),
  VH(
    class extends AH {
      constructor() {
        super({
          id: zme,
          label: EI(1107, "Show or Focus Hover"),
          metadata: {
            description: EI(
              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: [_Me.NoAutoFocus, _Me.FocusIfVisible, _Me.AutoFocusImmediately],
                      enumDescriptions: [
                        SI(1104, "The hover will not automatically take focus."),
                        SI(1105, "The hover will take focus only if it is already visible."),
                        SI(1106, "The hover will automatically take focus when it appears."),
                      ],
                      default: _Me.FocusIfVisible,
                    },
                  },
                },
              },
            ],
          },
          precondition: void 0,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: gO(2089, 2087), weight: 100 },
        });
      }
      run(e, t, n) {
        if (!t.hasModel()) return;
        const i = qke.get(t);
        if (!i) return;
        const r = n?.focus;
        let o = _Me.FocusIfVisible;
        Object.values(_Me).includes(r)
          ? (o = r)
          : "boolean" == typeof r && r && (o = _Me.AutoFocusImmediately);
        const s = (e) => {
            const n = t.getPosition(),
              r = new YH(n.lineNumber, n.column, n.lineNumber, n.column);
            i.showContentHover(r, 1, 2, e);
          },
          a = 2 === t.getOption(2);
        i.isHoverVisible
          ? o !== _Me.NoAutoFocus
            ? i.focus()
            : s(a)
          : s(a || o === _Me.AutoFocusImmediately);
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.showDefinitionPreviewHover",
          label: EI(1109, "Show Definition Preview Hover"),
          precondition: void 0,
          metadata: { description: EI(1110, "Show the definition preview hover in the editor.") },
        });
      }
      run(e, t) {
        const n = qke.get(t);
        if (!n) return;
        const i = t.getPosition();
        if (!i) return;
        const r = new YH(i.lineNumber, i.column, i.lineNumber, i.column),
          o = mMe.get(t);
        if (!o) return;
        o.startFindDefinitionFromCursor(i).then(() => {
          n.showContentHover(r, 1, 2, !0);
        });
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.hideHover",
          label: EI(1111, "Hide Hover"),
          alias: "Hide Content Hover",
          precondition: void 0,
        });
      }
      run(e, t) {
        qke.get(t)?.hideContentHover();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.scrollUpHover",
          label: EI(1112, "Scroll Up Hover"),
          precondition: $$.hoverFocused,
          kbOpts: { kbExpr: $$.hoverFocused, primary: 16, weight: 100 },
          metadata: { description: EI(1113, "Scroll up the editor hover.") },
        });
      }
      run(e, t) {
        const n = qke.get(t);
        n && n.scrollUp();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.scrollDownHover",
          label: EI(1114, "Scroll Down Hover"),
          precondition: $$.hoverFocused,
          kbOpts: { kbExpr: $$.hoverFocused, primary: 18, weight: 100 },
          metadata: { description: EI(1115, "Scroll down the editor hover.") },
        });
      }
      run(e, t) {
        const n = qke.get(t);
        n && n.scrollDown();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.scrollLeftHover",
          label: EI(1116, "Scroll Left Hover"),
          precondition: $$.hoverFocused,
          kbOpts: { kbExpr: $$.hoverFocused, primary: 15, weight: 100 },
          metadata: { description: EI(1117, "Scroll left the editor hover.") },
        });
      }
      run(e, t) {
        const n = qke.get(t);
        n && n.scrollLeft();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.scrollRightHover",
          label: EI(1118, "Scroll Right Hover"),
          precondition: $$.hoverFocused,
          kbOpts: { kbExpr: $$.hoverFocused, primary: 17, weight: 100 },
          metadata: { description: EI(1119, "Scroll right the editor hover.") },
        });
      }
      run(e, t) {
        const n = qke.get(t);
        n && n.scrollRight();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.pageUpHover",
          label: EI(1120, "Page Up Hover"),
          precondition: $$.hoverFocused,
          kbOpts: { kbExpr: $$.hoverFocused, primary: 11, secondary: [528], weight: 100 },
          metadata: { description: EI(1121, "Page up the editor hover.") },
        });
      }
      run(e, t) {
        const n = qke.get(t);
        n && n.pageUp();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.pageDownHover",
          label: EI(1122, "Page Down Hover"),
          precondition: $$.hoverFocused,
          kbOpts: { kbExpr: $$.hoverFocused, primary: 12, secondary: [530], weight: 100 },
          metadata: { description: EI(1123, "Page down the editor hover.") },
        });
      }
      run(e, t) {
        const n = qke.get(t);
        n && n.pageDown();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.goToTopHover",
          label: EI(1124, "Go To Top Hover"),
          precondition: $$.hoverFocused,
          kbOpts: { kbExpr: $$.hoverFocused, primary: 14, secondary: [2064], weight: 100 },
          metadata: { description: EI(1125, "Go to the top of the editor hover.") },
        });
      }
      run(e, t) {
        const n = qke.get(t);
        n && n.goToTop();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.goToBottomHover",
          label: EI(1126, "Go To Bottom Hover"),
          precondition: $$.hoverFocused,
          kbOpts: { kbExpr: $$.hoverFocused, primary: 13, secondary: [2066], weight: 100 },
          metadata: { description: EI(1127, "Go to the bottom of the editor hover.") },
        });
      }
      run(e, t) {
        const n = qke.get(t);
        n && n.goToBottom();
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: Ume,
          label: $me,
          alias: "Increase Hover Verbosity Level",
          precondition: $$.hoverVisible,
        });
      }
      run(e, t, n) {
        const i = qke.get(t);
        if (!i) return;
        const r = void 0 !== n?.index ? n.index : i.focusedHoverPartIndex();
        i.updateHoverVerbosityLevel(h2.Increase, r, n?.focus);
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: qme,
          label: Kme,
          alias: "Decrease Hover Verbosity Level",
          precondition: $$.hoverVisible,
        });
      }
      run(e, t, n) {
        const i = qke.get(t);
        if (!i) return;
        const r = void 0 !== n?.index ? n.index : i.focusedHoverPartIndex();
        qke.get(t)?.updateHoverVerbosityLevel(h2.Decrease, r, n?.focus);
      }
    },
  ),
  Eme.register(Wbe),
  Eme.register(Oke),
  _0((e, t) => {
    const n = e.getColor(bZ);
    n &&
      (t.addRule(
        `.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${n.transparent(0.5)}; }`,
      ),
      t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${n.transparent(0.5)}; }`),
      t.addRule(
        `.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${n.transparent(0.5)}; }`,
      ));
  }),
  $Ne.register(new (class {})()),
  $Ne.register(new (class {})()),
  $Ne.register(new (class {})()));
class kMe extends AH {
  static {
    this.ID = "editor.action.indentationToSpaces";
  }
  constructor() {
    super({
      id: kMe.ID,
      label: EI(1148, "Convert Indentation to Spaces"),
      precondition: $$.writable,
      metadata: { description: EI(1149, "Convert the tab indentation to spaces.") },
    });
  }
  run(e, t) {
    const n = t.getModel();
    if (!n) return;
    const i = n.getOptions(),
      r = t.getSelection();
    if (!r) return;
    const o = new AMe(r, i.tabSize);
    (t.pushUndoStop(),
      t.executeCommands(this.id, [o]),
      t.pushUndoStop(),
      n.updateOptions({ insertSpaces: !0 }));
  }
}
class EMe extends AH {
  static {
    this.ID = "editor.action.indentationToTabs";
  }
  constructor() {
    super({
      id: EMe.ID,
      label: EI(1150, "Convert Indentation to Tabs"),
      precondition: $$.writable,
      metadata: { description: EI(1151, "Convert the spaces indentation to tabs.") },
    });
  }
  run(e, t) {
    const n = t.getModel();
    if (!n) return;
    const i = n.getOptions(),
      r = t.getSelection();
    if (!r) return;
    const o = new PMe(r, i.tabSize);
    (t.pushUndoStop(),
      t.executeCommands(this.id, [o]),
      t.pushUndoStop(),
      n.updateOptions({ insertSpaces: !1 }));
  }
}
class NMe extends AH {
  constructor(e, t, n) {
    (super(n), (this.insertSpaces = e), (this.displaySizeOnly = t));
  }
  run(e, t) {
    const n = e.get(Ghe),
      i = e.get(wV),
      r = t.getModel();
    if (!r) return;
    const o = i.getCreationOptions(r.getLanguageId(), r.uri, r.isForSimpleWidget),
      s = r.getOptions(),
      a = [1, 2, 3, 4, 5, 6, 7, 8].map((e) => ({
        id: e.toString(),
        label: e.toString(),
        description:
          e === o.tabSize && e === s.tabSize
            ? SI(1144, "Configured Tab Size")
            : e === o.tabSize
              ? SI(1145, "Default Tab Size")
              : e === s.tabSize
                ? SI(1146, "Current Tab Size")
                : void 0,
      })),
      l = Math.min(r.getOptions().tabSize - 1, 7);
    setTimeout(() => {
      n.pick(a, {
        placeHolder: SI(1147, "Select Tab Size for Current File"),
        activeItem: a[l],
      }).then((e) => {
        if (e && r && !r.isDisposed()) {
          const t = parseInt(e.label, 10);
          this.displaySizeOnly
            ? r.updateOptions({ tabSize: t })
            : r.updateOptions({ tabSize: t, indentSize: t, insertSpaces: this.insertSpaces });
        }
      });
    }, 50);
  }
}
class LMe extends NMe {
  static {
    this.ID = "editor.action.indentUsingTabs";
  }
  constructor() {
    super(!1, !1, {
      id: LMe.ID,
      label: EI(1152, "Indent Using Tabs"),
      precondition: void 0,
      metadata: { description: EI(1153, "Use indentation with tabs.") },
    });
  }
}
class DMe extends NMe {
  static {
    this.ID = "editor.action.indentUsingSpaces";
  }
  constructor() {
    super(!0, !1, {
      id: DMe.ID,
      label: EI(1154, "Indent Using Spaces"),
      precondition: void 0,
      metadata: { description: EI(1155, "Use indentation with spaces.") },
    });
  }
}
class TMe extends NMe {
  static {
    this.ID = "editor.action.changeTabDisplaySize";
  }
  constructor() {
    super(!0, !0, {
      id: TMe.ID,
      label: EI(1156, "Change Tab Display Size"),
      precondition: void 0,
      metadata: { description: EI(1157, "Change the space size equivalent of the tab.") },
    });
  }
}
class IMe extends AH {
  static {
    this.ID = "editor.action.detectIndentation";
  }
  constructor() {
    super({
      id: IMe.ID,
      label: EI(1158, "Detect Indentation from Content"),
      precondition: void 0,
      metadata: { description: EI(1159, "Detect the indentation from content.") },
    });
  }
  run(e, t) {
    const n = e.get(wV),
      i = t.getModel();
    if (!i) return;
    const r = n.getCreationOptions(i.getLanguageId(), i.uri, i.isForSimpleWidget);
    i.detectIndentation(r.insertSpaces, r.tabSize);
  }
}
class RMe {
  constructor(e, t) {
    ((this._initialSelection = t), (this._edits = []), (this._selectionId = null));
    for (const n of e) n.range && "string" == typeof n.text && this._edits.push(n);
  }
  getEditOperations(e, t) {
    for (const i of this._edits) t.addEditOperation(YH.lift(i.range), i.text);
    let n = !1;
    (Array.isArray(this._edits) &&
      1 === this._edits.length &&
      this._initialSelection.isEmpty() &&
      (this._edits[0].range.startColumn === this._initialSelection.endColumn &&
      this._edits[0].range.startLineNumber === this._initialSelection.endLineNumber
        ? ((n = !0), (this._selectionId = t.trackSelection(this._initialSelection, !0)))
        : this._edits[0].range.endColumn === this._initialSelection.startColumn &&
          this._edits[0].range.endLineNumber === this._initialSelection.startLineNumber &&
          ((n = !0), (this._selectionId = t.trackSelection(this._initialSelection, !1)))),
      n || (this._selectionId = t.trackSelection(this._initialSelection)));
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._selectionId);
  }
}
let OMe = class {
  static {
    this.ID = "editor.contrib.autoIndentOnPaste";
  }
  constructor(e, t) {
    ((this.editor = e),
      (this._languageConfigurationService = t),
      (this.callOnDispose = new AO()),
      (this.callOnModel = new AO()),
      this.callOnDispose.add(e.onDidChangeConfiguration(() => this.update())),
      this.callOnDispose.add(e.onDidChangeModel(() => this.update())),
      this.callOnDispose.add(e.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: e }) => {
              this.trigger(e);
            }),
          )));
  }
  trigger(e) {
    const t = this.editor.getSelections();
    if (null === t || t.length > 1) return;
    const n = this.editor.getModel();
    if (!n) return;
    if (this.rangeContainsOnlyWhitespaceCharacters(n, e)) return;
    if (
      !this.editor.getOption(18) &&
      (function (e, t) {
        const n = (t) => {
          const n = (function (e, t) {
            const n = t.lineNumber;
            if (!e.tokenization.isCheapToTokenize(n)) return;
            e.tokenization.forceTokenization(n);
            const i = e.tokenization.getLineTokens(n),
              r = i.findTokenIndexAtOffset(t.column - 1);
            return i.getStandardTokenType(r);
          })(e, t);
          return 2 === n;
        };
        return n(t.getStartPosition()) || n(t.getEndPosition());
      })(n, e)
    )
      return;
    if (!n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber)) return;
    const i = this.editor.getOption(16),
      { tabSize: r, indentSize: o, insertSpaces: s } = n.getOptions(),
      a = [],
      l = {
        shiftIndent: (e) => H$.shiftIndent(e, e.length + 1, r, o, s),
        unshiftIndent: (e) => H$.unshiftIndent(e, e.length + 1, r, o, s),
      };
    let c = e.startLineNumber,
      d = n.getLineContent(c);
    if (!/\S/.test(d.substring(0, e.startColumn - 1))) {
      const e = Z$(i, n, n.getLanguageId(), c, l, this._languageConfigurationService);
      if (null !== e) {
        const t = XM(d),
          i = _Le(e, r);
        if (i !== _Le(t, r)) {
          const e = vLe(i, r, s);
          (a.push({ range: new YH(c, 1, c, t.length + 1), text: e }),
            (d = e + d.substring(t.length)));
        } else {
          const e = Y$(n, c, this._languageConfigurationService);
          if (0 === e || 8 === e) return;
        }
      }
    }
    const u = c;
    for (; c < e.endLineNumber && !/\S/.test(n.getLineContent(c + 1)); ) c++;
    if (c !== e.endLineNumber) {
      const t = Z$(
        i,
        {
          tokenization: {
            getLineTokens: (e) => n.tokenization.getLineTokens(e),
            getLanguageId: () => n.getLanguageId(),
            getLanguageIdAtPosition: (e, t) => n.getLanguageIdAtPosition(e, t),
          },
          getLineContent: (e) => (e === u ? d : n.getLineContent(e)),
        },
        n.getLanguageId(),
        c + 1,
        l,
        this._languageConfigurationService,
      );
      if (null !== t) {
        const i = _Le(t, r),
          o = _Le(XM(n.getLineContent(c + 1)), r);
        if (i !== o) {
          const t = i - o;
          for (let i = c + 1; i <= e.endLineNumber; i++) {
            const e = XM(n.getLineContent(i)),
              o = vLe(_Le(e, r) + t, r, s);
            o !== e && a.push({ range: new YH(i, 1, i, e.length + 1), text: o });
          }
        }
      }
    }
    if (a.length > 0) {
      this.editor.pushUndoStop();
      const e = new RMe(a, this.editor.getSelection());
      (this.editor.executeCommand("autoIndentOnPaste", e), this.editor.pushUndoStop());
    }
  }
  rangeContainsOnlyWhitespaceCharacters(e, t) {
    const n = (e) => 0 === e.trim().length;
    let i = !0;
    if (t.startLineNumber === t.endLineNumber) {
      i = n(e.getLineContent(t.startLineNumber).substring(t.startColumn - 1, t.endColumn - 1));
    } else
      for (let r = t.startLineNumber; r <= t.endLineNumber; r++) {
        const o = e.getLineContent(r);
        if (r === t.startLineNumber) {
          i = n(o.substring(t.startColumn - 1));
        } else if (r === t.endLineNumber) {
          i = n(o.substring(0, t.endColumn - 1));
        } else i = 0 === e.getLineFirstNonWhitespaceColumn(r);
        if (!i) break;
      }
    return i;
  }
  dispose() {
    (this.callOnDispose.dispose(), this.callOnModel.dispose());
  }
};
function MMe(e, t, n, i) {
  if (1 === e.getLineCount() && 1 === e.getLineMaxColumn(1)) return;
  let r = "";
  for (let s = 0; s < n; s++) r += " ";
  const o = new RegExp(r, "gi");
  for (let s = 1, a = e.getLineCount(); s <= a; s++) {
    let n = e.getLineFirstNonWhitespaceColumn(s);
    if ((0 === n && (n = e.getLineMaxColumn(s)), 1 === n)) continue;
    const a = new YH(s, 1, s, n),
      l = e.getValueInRange(a),
      c = i ? l.replace(/\t/gi, r) : l.replace(o, "\t");
    t.addEditOperation(a, c);
  }
}
OMe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, f$),
  ],
  OMe,
);
class AMe {
  constructor(e, t) {
    ((this.selection = e), (this.tabSize = t), (this.selectionId = null));
  }
  getEditOperations(e, t) {
    ((this.selectionId = t.trackSelection(this.selection)), MMe(e, t, this.tabSize, !0));
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this.selectionId);
  }
}
class PMe {
  constructor(e, t) {
    ((this.selection = e), (this.tabSize = t), (this.selectionId = null));
  }
  getEditOperations(e, t) {
    ((this.selectionId = t.trackSelection(this.selection)), MMe(e, t, this.tabSize, !1));
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this.selectionId);
  }
}
(zH(OMe.ID, OMe, 2),
  VH(kMe),
  VH(EMe),
  VH(LMe),
  VH(DMe),
  VH(TMe),
  VH(IMe),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.reindentlines",
          label: EI(1160, "Reindent Lines"),
          precondition: $$.writable,
          metadata: { description: EI(1161, "Reindent the lines of the editor.") },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        const n = e.get(f$),
          i = t.getModel();
        if (!i) return;
        const r = CMe(i, n, 1, i.getLineCount());
        r.length > 0 && (t.pushUndoStop(), t.executeEdits(this.id, r), t.pushUndoStop());
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.reindentselectedlines",
          label: EI(1162, "Reindent Selected Lines"),
          precondition: $$.writable,
          metadata: { description: EI(1163, "Reindent the selected lines of the editor.") },
          canTriggerInlineEdits: !0,
        });
      }
      run(e, t) {
        const n = e.get(f$),
          i = t.getModel();
        if (!i) return;
        const r = t.getSelections();
        if (null === r) return;
        const o = [];
        for (const s of r) {
          let e = s.startLineNumber,
            t = s.endLineNumber;
          if ((e !== t && 1 === s.endColumn && t--, 1 === e)) {
            if (e === t) continue;
          } else e--;
          const r = CMe(i, n, e, t);
          o.push(...r);
        }
        o.length > 0 && (t.pushUndoStop(), t.executeEdits(this.id, o), t.pushUndoStop());
      }
    },
  ),
  zH(YSe.ID, YSe, 1),
  Eme.register(eke));
class jMe {
  constructor(e, t, n) {
    ((this._editRange = e), (this._originalSelection = t), (this._text = n));
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._editRange, this._text);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations()[0].range;
    return this._originalSelection.isEmpty()
      ? new XH(
          n.endLineNumber,
          Math.min(this._originalSelection.positionColumn, n.endColumn),
          n.endLineNumber,
          Math.min(this._originalSelection.positionColumn, n.endColumn),
        )
      : new XH(n.endLineNumber, n.endColumn - this._text.length, n.endLineNumber, n.endColumn);
  }
}
var FMe;
let BMe = class {
  static {
    FMe = this;
  }
  static {
    this.ID = "editor.contrib.inPlaceReplaceController";
  }
  static get(e) {
    return e.getContribution(FMe.ID);
  }
  static {
    this.DECORATION = cee.register({
      description: "in-place-replace",
      className: "valueSetReplacement",
    });
  }
  constructor(e, t) {
    ((this.editor = e),
      (this.editorWorkerService = t),
      (this.decorations = this.editor.createDecorationsCollection()));
  }
  dispose() {}
  run(e, t) {
    this.currentRequest?.cancel();
    const n = this.editor.getSelection(),
      i = this.editor.getModel();
    if (!i || !n) return;
    let r = n;
    if (r.startLineNumber !== r.endLineNumber) return;
    const o = new dge(this.editor, 5),
      s = i.uri;
    return this.editorWorkerService.canNavigateValueSet(s)
      ? ((this.currentRequest = gM((e) => this.editorWorkerService.navigateValueSet(s, r, t))),
        this.currentRequest
          .then((t) => {
            if (!t || !t.range || !t.value) return;
            if (!o.validate(this.editor)) return;
            const n = YH.lift(t.range);
            let i = t.range;
            const s = t.value.length - (r.endColumn - r.startColumn);
            ((i = {
              startLineNumber: i.startLineNumber,
              startColumn: i.startColumn,
              endLineNumber: i.endLineNumber,
              endColumn: i.startColumn + t.value.length,
            }),
              s > 1 &&
                (r = new XH(
                  r.startLineNumber,
                  r.startColumn,
                  r.endLineNumber,
                  r.endColumn + s - 1,
                )));
            const a = new jMe(n, r, t.value);
            (this.editor.pushUndoStop(),
              this.editor.executeCommand(e, a),
              this.editor.pushUndoStop(),
              this.decorations.set([{ range: i, options: FMe.DECORATION }]),
              this.decorationRemover?.cancel(),
              (this.decorationRemover = vM(350)),
              this.decorationRemover.then(() => this.decorations.clear()).catch(HI));
          })
          .catch(HI))
      : Promise.resolve(void 0);
  }
};
BMe = FMe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, Dce),
  ],
  BMe,
);
(zH(BMe.ID, BMe, 4),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.inPlaceReplace.up",
          label: EI(1240, "Replace with Previous Value"),
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 3159, weight: 100 },
        });
      }
      run(e, t) {
        const n = BMe.get(t);
        return n ? n.run(this.id, !1) : Promise.resolve(void 0);
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.inPlaceReplace.down",
          label: EI(1241, "Replace with Next Value"),
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 3161, weight: 100 },
        });
      }
      run(e, t) {
        const n = BMe.get(t);
        return n ? n.run(this.id, !0) : Promise.resolve(void 0);
      }
    },
  ));
class VMe {
  constructor(e) {
    ((this._selection = e), (this._selectionId = null));
  }
  getEditOperations(e, t) {
    const n = (function (e) {
      const t = e.getLineCount(),
        n = e.getLineContent(t),
        i = -1 === QM(n);
      if (!t || i) return;
      return hye.insert(new xV(t, e.getLineMaxColumn(t)), e.getEOL());
    })(e);
    (n && t.addEditOperation(n.range, n.text),
      (this._selectionId = t.trackSelection(this._selection)));
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._selectionId);
  }
}
class WMe extends AH {
  static {
    this.ID = "editor.action.insertFinalNewLine";
  }
  constructor() {
    super({ id: WMe.ID, label: EI(1242, "Insert Final New Line"), precondition: $$.writable });
  }
  run(e, t, n) {
    const i = t.getSelection();
    if (null === i) return;
    const r = new VMe(i);
    (t.pushUndoStop(), t.executeCommands(this.id, [r]), t.pushUndoStop());
  }
}
VH(WMe);
VH(
  class extends AH {
    constructor() {
      super({
        id: "expandLineSelection",
        label: EI(1243, "Expand Line Selection"),
        precondition: void 0,
        kbOpts: { weight: 0, kbExpr: $$.textInputFocus, primary: 2090 },
      });
    }
    run(e, t, n) {
      if (((n = n || {}), !t.hasModel())) return;
      const i = t._getViewModel();
      (i.model.pushStackElement(),
        i.setCursorStates(n.source, 3, nU.expandLineSelection(i, i.getCursorStates())),
        i.revealAllCursors(n.source, !0));
    }
  },
);
var HMe,
  zMe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const UMe = new yW("LinkedEditingInputVisible", !1);
let $Me = class extends PO {
  static {
    HMe = this;
  }
  static {
    this.ID = "editor.contrib.linkedEditing";
  }
  static {
    this.DECORATION = cee.register({
      description: "linked-editing",
      stickiness: 0,
      className: "linked-editing-decoration",
    });
  }
  static get(e) {
    return e.getContribution(HMe.ID);
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this.languageConfigurationService = i),
      (this._syncRangesToken = 0),
      (this._localToDispose = this._register(new AO())),
      (this._editor = e),
      (this._providers = n.linkedEditingRangeProvider),
      (this._enabled = !1),
      (this._visibleContextKey = UMe.bindTo(t)),
      (this._debounceInformation = r.for(this._providers, "Linked Editing", { max: 200 })),
      (this._currentDecorations = this._editor.createDecorationsCollection()),
      (this._languageWordPattern = null),
      (this._currentWordPattern = null),
      (this._ignoreChangeEvent = !1),
      (this._localToDispose = this._register(new AO())),
      (this._rangeUpdateTriggerPromise = null),
      (this._rangeSyncTriggerPromise = null),
      (this._currentRequestCts = null),
      (this._currentRequestPosition = null),
      (this._currentRequestModelVersion = null),
      this._register(this._editor.onDidChangeModel(() => this.reinitialize(!0))),
      this._register(
        this._editor.onDidChangeConfiguration((e) => {
          (e.hasChanged(78) || e.hasChanged(106)) && this.reinitialize(!1);
        }),
      ),
      this._register(this._providers.onDidChange(() => this.reinitialize(!1))),
      this._register(this._editor.onDidChangeModelLanguage(() => this.reinitialize(!0))),
      this.reinitialize(!0));
  }
  reinitialize(e) {
    const t = this._editor.getModel(),
      n =
        null !== t &&
        (this._editor.getOption(78) || this._editor.getOption(106)) &&
        this._providers.has(t);
    if (n === this._enabled && !e) return;
    if (((this._enabled = n), this.clearRanges(), this._localToDispose.clear(), !n || null === t))
      return;
    this._localToDispose.add(
      $O.runAndSubscribe(t.onDidChangeLanguageConfiguration, () => {
        this._languageWordPattern = this.languageConfigurationService
          .getLanguageConfiguration(t.getLanguageId())
          .getWordDefinition();
      }),
    );
    const i = new mM(this._debounceInformation.get(t)),
      r = () => {
        this._rangeUpdateTriggerPromise = i.trigger(
          () => this.updateRanges(),
          this._debounceDuration ?? this._debounceInformation.get(t),
        );
      },
      o = new mM(0),
      s = (e) => {
        this._rangeSyncTriggerPromise = o.trigger(() => this._syncRanges(e));
      };
    (this._localToDispose.add(
      this._editor.onDidChangeCursorPosition(() => {
        r();
      }),
    ),
      this._localToDispose.add(
        this._editor.onDidChangeModelContent((e) => {
          if (!this._ignoreChangeEvent && this._currentDecorations.length > 0) {
            const t = this._currentDecorations.getRange(0);
            if (t && e.changes.every((e) => t.intersectRanges(e.range)))
              return void s(this._syncRangesToken);
          }
          r();
        }),
      ),
      this._localToDispose.add({
        dispose: () => {
          (i.dispose(), o.dispose());
        },
      }),
      this.updateRanges());
  }
  _syncRanges(e) {
    if (
      !this._editor.hasModel() ||
      e !== this._syncRangesToken ||
      0 === this._currentDecorations.length
    )
      return;
    const t = this._editor.getModel(),
      n = this._currentDecorations.getRange(0);
    if (!n || n.startLineNumber !== n.endLineNumber) return this.clearRanges();
    const i = t.getValueInRange(n);
    if (this._currentWordPattern) {
      const e = i.match(this._currentWordPattern);
      if ((e ? e[0].length : 0) !== i.length) return this.clearRanges();
    }
    const r = [];
    for (let o = 1, s = this._currentDecorations.length; o < s; o++) {
      const e = this._currentDecorations.getRange(o);
      if (e)
        if (e.startLineNumber !== e.endLineNumber) r.push({ range: e, text: i });
        else {
          let n = t.getValueInRange(e),
            o = i,
            s = e.startColumn,
            a = e.endColumn;
          const l = cA(n, o);
          ((s += l), (n = n.substr(l)), (o = o.substr(l)));
          const c = dA(n, o);
          ((a -= c),
            (n = n.substr(0, n.length - c)),
            (o = o.substr(0, o.length - c)),
            (s === a && 0 === o.length) ||
              r.push({ range: new YH(e.startLineNumber, s, e.endLineNumber, a), text: o }));
        }
    }
    if (0 !== r.length)
      try {
        (this._editor.popUndoStop(), (this._ignoreChangeEvent = !0));
        const e = this._editor._getViewModel().getPrevEditOperationType();
        (this._editor.executeEdits("linkedEditing", r),
          this._editor._getViewModel().setPrevEditOperationType(e));
      } finally {
        this._ignoreChangeEvent = !1;
      }
  }
  dispose() {
    (this.clearRanges(), super.dispose());
  }
  clearRanges() {
    (this._visibleContextKey.set(!1),
      this._currentDecorations.clear(),
      this._currentRequestCts &&
        (this._currentRequestCts.cancel(),
        (this._currentRequestCts = null),
        (this._currentRequestPosition = null)));
  }
  async updateRanges(e = !1) {
    if (!this._editor.hasModel()) return void this.clearRanges();
    const t = this._editor.getPosition();
    if ((!this._enabled && !e) || this._editor.getSelections().length > 1)
      return void this.clearRanges();
    const n = this._editor.getModel(),
      i = n.getVersionId();
    if (this._currentRequestPosition && this._currentRequestModelVersion === i) {
      if (t.equals(this._currentRequestPosition)) return;
      if (this._currentDecorations.length > 0) {
        const e = this._currentDecorations.getRange(0);
        if (e && e.containsPosition(t)) return;
      }
    }
    if (!this._currentRequestPosition?.equals(t)) {
      const e = this._currentDecorations.getRange(0);
      e?.containsPosition(t) || this.clearRanges();
    }
    ((this._currentRequestPosition = t), (this._currentRequestModelVersion = i));
    const r = (this._currentRequestCts = new cM());
    try {
      const e = new UO(!1),
        o = await qMe(this._providers, n, t, r.token);
      if ((this._debounceInformation.update(n, e.elapsed()), r !== this._currentRequestCts)) return;
      if (((this._currentRequestCts = null), i !== n.getVersionId())) return;
      let s = [];
      (o?.ranges && (s = o.ranges),
        (this._currentWordPattern = o?.wordPattern || this._languageWordPattern));
      let a = !1;
      for (let n = 0, i = s.length; n < i; n++)
        if (YH.containsPosition(s[n], t)) {
          if (((a = !0), 0 !== n)) {
            const e = s[n];
            (s.splice(n, 1), s.unshift(e));
          }
          break;
        }
      if (!a) return void this.clearRanges();
      const l = s.map((e) => ({ range: e, options: HMe.DECORATION }));
      (this._visibleContextKey.set(!0), this._currentDecorations.set(l), this._syncRangesToken++);
    } catch (o) {
      (qI(o) || HI(o),
        (this._currentRequestCts !== r && this._currentRequestCts) || this.clearRanges());
    }
  }
};
$Me = HMe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([zMe(1, xW), zMe(2, mee), zMe(3, f$), zMe(4, gme)], $Me);
function qMe(e, t, n, i) {
  return yM(
    e.ordered(t).map((e) => async () => {
      try {
        return await e.provideLinkedEditingRanges(t, n, i);
      } catch (spt) {
        return void zI(spt);
      }
    }),
    (e) => !!e && aj(e?.ranges),
  );
}
(BH(
  new (MH.bindToContribution($Me.get))({
    id: "cancelLinkedEditingInput",
    precondition: UMe,
    handler: (e) => e.clearRanges(),
    kbOpts: { kbExpr: $$.editorTextFocus, weight: 199, primary: 9, secondary: [1033] },
  }),
),
  SG(
    "editor.linkedEditingBackground",
    {
      dark: vG.fromHex("#f00").transparent(0.3),
      light: vG.fromHex("#f00").transparent(0.3),
      hcDark: vG.fromHex("#f00").transparent(0.3),
      hcLight: vG.white,
    },
    SI(1275, "Background color when the editor auto renames on type."),
  ),
  FH("_executeLinkedEditingProvider", (e, t, n) => {
    const { linkedEditingRangeProvider: i } = e.get(mee);
    return qMe(i, t, n, aM.None);
  }),
  zH($Me.ID, $Me, 1),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.linkedEditing",
          label: EI(1276, "Start Linked Editing"),
          precondition: eW.and($$.writable, $$.hasRenameProvider),
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 3132, weight: 100 },
        });
      }
      runCommand(e, t) {
        const n = e.get(yV),
          [i, r] = (Array.isArray(t) && t) || [void 0, void 0];
        return mP.isUri(i) && xV.isIPosition(r)
          ? n.openCodeEditor({ resource: i }, n.getActiveCodeEditor()).then((e) => {
              e &&
                (e.setPosition(r),
                e.invokeWithinContext((t) => (this.reportTelemetry(t, e), this.run(t, e))));
            }, HI)
          : super.runCommand(e, t);
      }
      run(e, t) {
        const n = $Me.get(t);
        return n ? Promise.resolve(n.updateRanges(!0)) : Promise.resolve();
      }
    },
  ));
let KMe = class {
  constructor(e, t) {
    ((this._link = e), (this._provider = t));
  }
  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(e) {
    return this._link.url
      ? this._link.url
      : "function" == typeof this._provider.resolveLink
        ? Promise.resolve(this._provider.resolveLink(this._link, e)).then(
            (t) => (
              (this._link = t || this._link),
              this._link.url ? this.resolve(e) : Promise.reject(new Error("missing"))
            ),
          )
        : Promise.reject(new Error("missing"));
  }
};
class GMe {
  static {
    this.Empty = new GMe([]);
  }
  constructor(e) {
    this._disposables = new AO();
    let t = [];
    for (const [n, i] of e) {
      const e = n.links.map((e) => new KMe(e, i));
      ((t = GMe._union(t, e)),
        TO(n) && ((this._disposables ??= new AO()), this._disposables.add(n)));
    }
    this.links = t;
  }
  dispose() {
    (this._disposables?.dispose(), (this.links.length = 0));
  }
  static _union(e, t) {
    const n = [];
    let i, r, o, s;
    for (i = 0, o = 0, r = e.length, s = t.length; i < r && o < s; ) {
      const r = e[i],
        s = t[o];
      if (YH.areIntersectingOrTouching(r.range, s.range)) {
        i++;
        continue;
      }
      YH.compareRangesUsingStarts(r.range, s.range) < 0 ? (n.push(r), i++) : (n.push(s), o++);
    }
    for (; i < r; i++) n.push(e[i]);
    for (; o < s; o++) n.push(t[o]);
    return n;
  }
}
async function ZMe(e, t, n) {
  const i = [],
    r = e
      .ordered(t)
      .reverse()
      .map(async (e, r) => {
        try {
          const o = await e.provideLinks(t, n);
          o && (i[r] = [o, e]);
        } catch (o) {
          zI(o);
        }
      });
  await Promise.all(r);
  let o = new GMe(rj(i));
  return (n.isCancellationRequested && (o.dispose(), (o = GMe.Empty)), o);
}
jV.registerCommand("_executeLinkProvider", async (e, ...t) => {
  let [n, i] = t;
  (pR(n instanceof mP), "number" != typeof i && (i = 0));
  const { linkProvider: r } = e.get(mee),
    o = e.get(wV).getModel(n);
  if (!o) return [];
  const s = await ZMe(r, o, aM.None);
  if (!s) return [];
  for (let l = 0; l < Math.min(i, s.links.length); l++) await s.links[l].resolve(aM.None);
  const a = s.links.slice(0);
  return (s.dispose(), a);
});
var YMe,
  XMe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let QMe = class extends PO {
  static {
    YMe = this;
  }
  static {
    this.ID = "editor.linkDetector";
  }
  static get(e) {
    return e.getContribution(YMe.ID);
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this.editor = e),
      (this.openerService = t),
      (this.notificationService = n),
      (this.languageFeaturesService = i),
      (this.providers = this.languageFeaturesService.linkProvider),
      (this.debounceInformation = r.for(this.providers, "Links", { min: 1e3, max: 4e3 })),
      (this.computeLinks = this._register(new EM(() => this.computeLinksNow(), 1e3))),
      (this.computePromise = null),
      (this.activeLinksList = null),
      (this.currentOccurrences = {}),
      (this.activeLinkDecorationId = null));
    const o = this._register(new vye(e));
    (this._register(
      o.onMouseMoveOrRelevantKeyDown(([e, t]) => {
        this._onEditorMouseMove(e, t);
      }),
    ),
      this._register(
        o.onExecute((e) => {
          this.onEditorMouseUp(e);
        }),
      ),
      this._register(
        o.onCancel((e) => {
          this.cleanUpActiveLinkDecoration();
        }),
      ),
      this._register(
        e.onDidChangeConfiguration((e) => {
          e.hasChanged(79) &&
            (this.updateDecorations([]), this.stop(), this.computeLinks.schedule(0));
        }),
      ),
      this._register(
        e.onDidChangeModelContent((e) => {
          this.editor.hasModel() &&
            this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()));
        }),
      ),
      this._register(
        e.onDidChangeModel((e) => {
          ((this.currentOccurrences = {}),
            (this.activeLinkDecorationId = null),
            this.stop(),
            this.computeLinks.schedule(0));
        }),
      ),
      this._register(
        e.onDidChangeModelLanguage((e) => {
          (this.stop(), this.computeLinks.schedule(0));
        }),
      ),
      this._register(
        this.providers.onDidChange((e) => {
          (this.stop(), this.computeLinks.schedule(0));
        }),
      ),
      this.computeLinks.schedule(0));
  }
  async computeLinksNow() {
    if (!this.editor.hasModel() || !this.editor.getOption(79)) return;
    const e = this.editor.getModel();
    if (!e.isTooLargeForSyncing() && this.providers.has(e)) {
      (this.activeLinksList && (this.activeLinksList.dispose(), (this.activeLinksList = null)),
        (this.computePromise = gM((t) => ZMe(this.providers, e, t))));
      try {
        const t = new UO(!1);
        if (
          ((this.activeLinksList = await this.computePromise),
          this.debounceInformation.update(e, t.elapsed()),
          e.isDisposed())
        )
          return;
        this.updateDecorations(this.activeLinksList.links);
      } catch (t) {
        HI(t);
      } finally {
        this.computePromise = null;
      }
    }
  }
  updateDecorations(e) {
    const t = "altKey" === this.editor.getOption(86),
      n = [],
      i = Object.keys(this.currentOccurrences);
    for (const o of i) {
      const e = this.currentOccurrences[o];
      n.push(e.decorationId);
    }
    const r = [];
    if (e) for (const o of e) r.push(tAe.decoration(o, t));
    this.editor.changeDecorations((t) => {
      const i = t.deltaDecorations(n, r);
      ((this.currentOccurrences = {}), (this.activeLinkDecorationId = null));
      for (let n = 0, r = i.length; n < r; n++) {
        const t = new tAe(e[n], i[n]);
        this.currentOccurrences[t.decorationId] = t;
      }
    });
  }
  _onEditorMouseMove(e, t) {
    const n = "altKey" === this.editor.getOption(86);
    if (this.isEnabled(e, t)) {
      this.cleanUpActiveLinkDecoration();
      const t = this.getLinkOccurrence(e.target.position);
      t &&
        this.editor.changeDecorations((e) => {
          (t.activate(e, n), (this.activeLinkDecorationId = t.decorationId));
        });
    } else this.cleanUpActiveLinkDecoration();
  }
  cleanUpActiveLinkDecoration() {
    const e = "altKey" === this.editor.getOption(86);
    if (this.activeLinkDecorationId) {
      const t = this.currentOccurrences[this.activeLinkDecorationId];
      (t &&
        this.editor.changeDecorations((n) => {
          t.deactivate(n, e);
        }),
        (this.activeLinkDecorationId = null));
    }
  }
  onEditorMouseUp(e) {
    if (!this.isEnabled(e)) return;
    const t = this.getLinkOccurrence(e.target.position);
    t && this.openLinkOccurrence(t, e.hasSideBySideModifier, !0);
  }
  openLinkOccurrence(e, t, n = !1) {
    if (!this.openerService) return;
    const { link: i } = e;
    i.resolve(aM.None).then(
      (e) => {
        if ("string" == typeof e && this.editor.hasModel()) {
          const t = this.editor.getModel().uri;
          if (t.scheme === NP.file && e.startsWith(`${NP.file}:`)) {
            const n = mP.parse(e);
            if (n.scheme === NP.file) {
              const i = sH(n);
              let r = null;
              (i.startsWith("/./") || i.startsWith("\\.\\")
                ? (r = `.${i.substr(1)}`)
                : (i.startsWith("//./") || i.startsWith("\\\\.\\")) && (r = `.${i.substr(2)}`),
                r && (e = gH(t, r)));
            }
          }
        }
        return this.openerService.open(e, {
          openToSide: t,
          fromUserGesture: n,
          allowContributedOpeners: !0,
          allowCommands: !0,
          fromWorkspace: !0,
        });
      },
      (e) => {
        const t = e instanceof Error ? e.message : e;
        "invalid" === t
          ? this.notificationService.warn(
              SI(
                1277,
                "Failed to open this link because it is not well-formed: {0}",
                i.url.toString(),
              ),
            )
          : "missing" === t
            ? this.notificationService.warn(
                SI(1278, "Failed to open this link because its target is missing."),
              )
            : HI(e);
      },
    );
  }
  getLinkOccurrence(e) {
    if (!this.editor.hasModel() || !e) return null;
    const t = this.editor
      .getModel()
      .getDecorationsInRange(
        {
          startLineNumber: e.lineNumber,
          startColumn: e.column,
          endLineNumber: e.lineNumber,
          endColumn: e.column,
        },
        0,
        !0,
      );
    for (const n of t) {
      const e = this.currentOccurrences[n.id];
      if (e) return e;
    }
    return null;
  }
  isEnabled(e, t) {
    return Boolean(
      6 === e.target.type &&
      (e.hasTriggerModifier ||
        (t && t.keyCodeIsTriggerKey) ||
        (e.isMiddleClick && "openLink" === e.mouseMiddleClickAction)),
    );
  }
  stop() {
    (this.computeLinks.cancel(),
      this.activeLinksList && (this.activeLinksList?.dispose(), (this.activeLinksList = null)),
      this.computePromise && (this.computePromise.cancel(), (this.computePromise = null)));
  }
  dispose() {
    (super.dispose(), this.stop());
  }
};
QMe = YMe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([XMe(1, mge), XMe(2, Y4), XMe(3, mee), XMe(4, gme)], QMe);
const JMe = cee.register({
    description: "detected-link",
    stickiness: 1,
    collapseOnReplaceEdit: !0,
    inlineClassName: "detected-link",
  }),
  eAe = cee.register({
    description: "detected-link-active",
    stickiness: 1,
    collapseOnReplaceEdit: !0,
    inlineClassName: "detected-link-active",
  });
class tAe {
  static decoration(e, t) {
    return { range: e.range, options: tAe._getOptions(e, t, !1) };
  }
  static _getOptions(e, t, n) {
    const i = { ...(n ? eAe : JMe) };
    return (
      (i.hoverMessage = (function (e, t) {
        const n = e.url && /^command:/i.test(e.url.toString()),
          i = e.tooltip ? e.tooltip : n ? SI(1279, "Execute command") : SI(1280, "Follow link"),
          r = t
            ? PR
              ? SI(1281, "cmd + click")
              : SI(1282, "ctrl + click")
            : PR
              ? SI(1283, "option + click")
              : SI(1284, "alt + click");
        if (e.url) {
          let t = "";
          if (/^command:/i.test(e.url.toString())) {
            const n = e.url.toString().match(/^command:([^?#]+)/);
            if (n) {
              t = SI(1285, "Execute command {0}", n[1]);
            }
          }
          return new rre("", !0)
            .appendLink(e.url.toString(!0).replace(/ /g, "%20"), i, t)
            .appendMarkdown(` (${r})`);
        }
        return new rre().appendText(`${i} (${r})`);
      })(e, t)),
      i
    );
  }
  constructor(e, t) {
    ((this.link = e), (this.decorationId = t));
  }
  activate(e, t) {
    e.changeDecorationOptions(this.decorationId, tAe._getOptions(this.link, t, !0));
  }
  deactivate(e, t) {
    e.changeDecorationOptions(this.decorationId, tAe._getOptions(this.link, t, !1));
  }
}
(zH(QMe.ID, QMe, 1),
  VH(
    class extends AH {
      constructor() {
        super({ id: "editor.action.openLink", label: EI(1286, "Open Link"), precondition: void 0 });
      }
      run(e, t) {
        const n = QMe.get(t);
        if (!n) return;
        if (!t.hasModel()) return;
        const i = t.getSelections();
        for (const r of i) {
          const e = n.getLinkOccurrence(r.getEndPosition());
          e && n.openLinkOccurrence(e, !1);
        }
      }
    },
  ));
class nAe extends PO {
  static {
    this.ID = "editor.contrib.longLinesHelper";
  }
  constructor(e) {
    (super(),
      (this._editor = e),
      this._register(
        this._editor.onMouseDown((e) => {
          const t = this._editor.getOption(133);
          t >= 0 &&
            6 === e.target.type &&
            e.target.position.column >= t &&
            this._editor.updateOptions({ stopRenderingLineAfter: -1 });
        }),
      ));
  }
}
zH(nAe.ID, nAe, 2);
class iAe extends PO {
  static {
    this.ID = "editor.contrib.middleScroll";
  }
  constructor(e) {
    (super(), (this._editor = e));
    const t = xde(this._editor),
      n = t.getOption(171);
    this._register(
      rF((e) => {
        if (!n.read(e)) return;
        const i = t.domNode.read(e);
        if (!i) return;
        const r = e.store.add(TF("scrollingSession", void 0));
        (e.store.add(
          this._editor.onMouseDown((e) => {
            if (r.read(void 0)) return void r.set(void 0, void 0);
            if (!e.event.middleButton) return;
            (e.event.stopPropagation(), e.event.preventDefault());
            const t = new AO(),
              n = new yde(e.event.posx, e.event.posy),
              o = (function (e, t, n) {
                const i = LF("pos", t);
                return (
                  n.add(
                    $F(e, "mousemove", (e) => {
                      i.set(new yde(e.pageX, e.pageY), void 0);
                    }),
                  ),
                  i
                );
              })(MF(i), n, t),
              s = o.map((e) => e.subtract(n).withThreshold(5)),
              a = i.getBoundingClientRect(),
              l = new yde(n.x - a.left, n.y - a.top);
            (r.set(
              {
                mouseDeltaAfterThreshold: s,
                initialMousePosInEditor: l,
                didScroll: !1,
                dispose: () => t.dispose(),
              },
              void 0,
            ),
              t.add(
                this._editor.onMouseUp((e) => {
                  const t = r.read(void 0);
                  t && t.didScroll && r.set(void 0, void 0);
                }),
              ),
              t.add(
                this._editor.onKeyDown((e) => {
                  r.set(void 0, void 0);
                }),
              ));
          }),
        ),
          e.store.add(
            rF((e) => {
              const t = r.read(e);
              if (!t) return;
              let n = Date.now();
              e.store.add(
                rF((e) => {
                  fDe.instance.invalidateOnNextAnimationFrame(e);
                  const i = Date.now(),
                    r = i - n;
                  n = i;
                  const o = r / 32,
                    s = t.mouseDeltaAfterThreshold.read(void 0).scale(o),
                    a = new yde(this._editor.getScrollLeft(), this._editor.getScrollTop());
                  (this._editor.setScrollPosition(
                    (function (e) {
                      return { scrollLeft: e.x, scrollTop: e.y };
                    })(a.add(s)),
                  ),
                    s.isZero() || (t.didScroll = !0));
                }),
              );
              const o = Xj((e) => {
                const n = t.mouseDeltaAfterThreshold.read(e);
                let i = "";
                return (
                  (i += n.y < 0 ? "n" : n.y > 0 ? "s" : ""),
                  (i += n.x < 0 ? "w" : n.x > 0 ? "e" : ""),
                  i
                );
              });
              e.store.add(
                rF((e) => {
                  i.setAttribute("data-scroll-direction", o.read(e));
                }),
              );
            }),
          ));
        const o = e.store.add(
          XB.div({
            class: ["scroll-editor-on-middle-click-dot", r.map((e) => (e ? "" : "hidden"))],
            style: {
              left: r.map((e) => (e ? e.initialMousePosInEditor.x : 0)),
              top: r.map((e) => (e ? e.initialMousePosInEditor.y : 0)),
            },
          }).toDisposableLiveElement(),
        );
        (e.store.add(kle(i, o.element)),
          e.store.add(
            rF((e) => {
              const t = r.read(e);
              i.classList.toggle("scroll-editor-on-middle-click-editor", !!t);
            }),
          ));
      }),
    );
  }
}
zH(iAe.ID, iAe, 2);
const rAe = SG(
  "editor.wordHighlightBackground",
  { dark: "#575757B8", light: "#57575740", hcDark: null, hcLight: null },
  SI(
    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.",
  ),
  !0,
);
(SG(
  "editor.wordHighlightStrongBackground",
  { dark: "#004972B8", light: "#0e639c40", hcDark: null, hcLight: null },
  SI(
    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.",
  ),
  !0,
),
  SG(
    "editor.wordHighlightTextBackground",
    rAe,
    SI(
      1565,
      "Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ));
const oAe = SG(
  "editor.wordHighlightBorder",
  { light: null, dark: null, hcDark: BG, hcLight: BG },
  SI(1566, "Border color of a symbol during read-access, like reading a variable."),
);
(SG(
  "editor.wordHighlightStrongBorder",
  { light: null, dark: null, hcDark: BG, hcLight: BG },
  SI(1567, "Border color of a symbol during write-access, like writing to a variable."),
),
  SG(
    "editor.wordHighlightTextBorder",
    oAe,
    SI(1568, "Border color of a textual occurrence for a symbol."),
  ));
const sAe = SG(
    "editorOverviewRuler.wordHighlightForeground",
    "#A0A0A0CC",
    SI(
      1569,
      "Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  aAe = SG(
    "editorOverviewRuler.wordHighlightStrongForeground",
    "#C0A0C0CC",
    SI(
      1570,
      "Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations.",
    ),
    !0,
  ),
  lAe = SG(
    "editorOverviewRuler.wordHighlightTextForeground",
    ZZ,
    SI(
      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.",
    ),
    !0,
  ),
  cAe = cee.register({
    description: "word-highlight-strong",
    stickiness: 1,
    className: "wordHighlightStrong",
    overviewRuler: { color: g0(aAe), position: Uz.Center },
    minimap: { color: g0(eY), position: 1 },
  }),
  dAe = cee.register({
    description: "word-highlight-text",
    stickiness: 1,
    className: "wordHighlightText",
    overviewRuler: { color: g0(lAe), position: Uz.Center },
    minimap: { color: g0(eY), position: 1 },
  }),
  uAe = cee.register({
    description: "selection-highlight-overview",
    stickiness: 1,
    className: "selectionHighlight",
    overviewRuler: { color: g0(ZZ), position: Uz.Center },
    minimap: { color: g0(eY), position: 1 },
  }),
  hAe = cee.register({
    description: "selection-highlight",
    stickiness: 1,
    className: "selectionHighlight",
  }),
  gAe = cee.register({
    description: "word-highlight",
    stickiness: 1,
    className: "wordHighlight",
    overviewRuler: { color: g0(sAe), position: Uz.Center },
    minimap: { color: g0(eY), position: 1 },
  });
function pAe(e) {
  return e === b2.Write ? cAe : e === b2.Text ? dAe : gAe;
}
function fAe(e) {
  return e ? hAe : uAe;
}
_0((e, t) => {
  const n = e.getColor(uZ);
  n && t.addRule(`.monaco-editor .selectionHighlight { background-color: ${n.transparent(0.5)}; }`);
});
var mAe;
function _Ae(e, t) {
  const n = t.filter((t) => !e.find((e) => e.equals(t)));
  if (n.length >= 1) {
    const e = n
      .map((e) => `line ${e.viewState.position.lineNumber} column ${e.viewState.position.column}`)
      .join(", ");
    fV(1 === n.length ? SI(1288, "Cursor added: {0}", e) : SI(1289, "Cursors added: {0}", e));
  }
}
class vAe {
  constructor(e, t, n) {
    ((this.selections = e), (this.revealRange = t), (this.revealScrollType = n));
  }
}
class bAe {
  static create(e, t) {
    if (!e.hasModel()) return null;
    const n = t.getState();
    if (!e.hasTextFocus() && n.isRevealed && n.searchString.length > 0)
      return new bAe(e, t, !1, n.searchString, n.wholeWord, n.matchCase, null);
    let i,
      r,
      o = !1;
    const s = e.getSelections();
    1 === s.length && s[0].isEmpty()
      ? ((o = !0), (i = !0), (r = !0))
      : ((i = n.wholeWord), (r = n.matchCase));
    const a = e.getSelection();
    let l,
      c = null;
    if (a.isEmpty()) {
      const t = e.getConfiguredWordAtPosition(a.getStartPosition());
      if (!t) return null;
      ((l = t.word),
        (c = new XH(a.startLineNumber, t.startColumn, a.startLineNumber, t.endColumn)));
    } else l = e.getModel().getValueInRange(a).replace(/\r\n/g, "\n");
    return new bAe(e, t, o, l, i, r, c);
  }
  constructor(e, t, n, i, r, o, s) {
    ((this._editor = e),
      (this.findController = t),
      (this.isDisconnectedFromFindController = n),
      (this.searchText = i),
      (this.wholeWord = r),
      (this.matchCase = o),
      (this.currentMatch = s));
  }
  addSelectionToNextFindMatch() {
    if (!this._editor.hasModel()) return null;
    const e = this._getNextMatch();
    if (!e) return null;
    const t = this._editor.getSelections();
    return new vAe(t.concat(e), e, 0);
  }
  moveSelectionToNextFindMatch() {
    if (!this._editor.hasModel()) return null;
    const e = this._getNextMatch();
    if (!e) return null;
    const t = this._editor.getSelections();
    return new vAe(t.slice(0, t.length - 1).concat(e), e, 0);
  }
  _getNextMatch() {
    if (!this._editor.hasModel()) return null;
    if (this.currentMatch) {
      const e = this.currentMatch;
      return ((this.currentMatch = null), e);
    }
    this.findController.highlightFindOptions();
    const e = this._editor.getSelections(),
      t = e[e.length - 1],
      n = this._editor
        .getModel()
        .findNextMatch(
          this.searchText,
          t.getEndPosition(),
          !1,
          this.matchCase,
          this.wholeWord ? this._editor.getOption(148) : null,
          !1,
        );
    return n
      ? new XH(
          n.range.startLineNumber,
          n.range.startColumn,
          n.range.endLineNumber,
          n.range.endColumn,
        )
      : null;
  }
  addSelectionToPreviousFindMatch() {
    if (!this._editor.hasModel()) return null;
    const e = this._getPreviousMatch();
    if (!e) return null;
    const t = this._editor.getSelections();
    return new vAe(t.concat(e), e, 0);
  }
  moveSelectionToPreviousFindMatch() {
    if (!this._editor.hasModel()) return null;
    const e = this._getPreviousMatch();
    if (!e) return null;
    const t = this._editor.getSelections();
    return new vAe(t.slice(0, t.length - 1).concat(e), e, 0);
  }
  _getPreviousMatch() {
    if (!this._editor.hasModel()) return null;
    if (this.currentMatch) {
      const e = this.currentMatch;
      return ((this.currentMatch = null), e);
    }
    this.findController.highlightFindOptions();
    const e = this._editor.getSelections(),
      t = e[e.length - 1],
      n = this._editor
        .getModel()
        .findPreviousMatch(
          this.searchText,
          t.getStartPosition(),
          !1,
          this.matchCase,
          this.wholeWord ? this._editor.getOption(148) : null,
          !1,
        );
    return n
      ? new XH(
          n.range.startLineNumber,
          n.range.startColumn,
          n.range.endLineNumber,
          n.range.endColumn,
        )
      : null;
  }
  selectAll(e) {
    if (!this._editor.hasModel()) return [];
    this.findController.highlightFindOptions();
    const t = this._editor.getModel();
    return e
      ? t.findMatches(
          this.searchText,
          e,
          !1,
          this.matchCase,
          this.wholeWord ? this._editor.getOption(148) : null,
          !1,
          1073741824,
        )
      : t.findMatches(
          this.searchText,
          !0,
          !1,
          this.matchCase,
          this.wholeWord ? this._editor.getOption(148) : null,
          !1,
          1073741824,
        );
  }
}
class yAe extends PO {
  static {
    this.ID = "editor.contrib.multiCursorController";
  }
  static get(e) {
    return e.getContribution(yAe.ID);
  }
  constructor(e) {
    (super(),
      (this._sessionDispose = this._register(new AO())),
      (this._editor = e),
      (this._ignoreSelectionChange = !1),
      (this._session = null));
  }
  dispose() {
    (this._endSession(), super.dispose());
  }
  _beginSessionIfNeeded(e) {
    if (!this._session) {
      const t = bAe.create(this._editor, e);
      if (!t) return;
      this._session = t;
      const n = { searchString: this._session.searchText };
      (this._session.isDisconnectedFromFindController &&
        ((n.wholeWordOverride = 1), (n.matchCaseOverride = 1), (n.isRegexOverride = 2)),
        e.getState().change(n, !1),
        this._sessionDispose.add(
          this._editor.onDidChangeCursorSelection((e) => {
            this._ignoreSelectionChange || this._endSession();
          }),
        ),
        this._sessionDispose.add(
          this._editor.onDidBlurEditorText(() => {
            this._endSession();
          }),
        ),
        this._sessionDispose.add(
          e.getState().onFindReplaceStateChange((e) => {
            (e.matchCase || e.wholeWord) && this._endSession();
          }),
        ));
    }
  }
  _endSession() {
    if (
      (this._sessionDispose.clear(),
      this._session && this._session.isDisconnectedFromFindController)
    ) {
      const e = { wholeWordOverride: 0, matchCaseOverride: 0, isRegexOverride: 0 };
      this._session.findController.getState().change(e, !1);
    }
    this._session = null;
  }
  _setSelections(e) {
    ((this._ignoreSelectionChange = !0),
      this._editor.setSelections(e),
      (this._ignoreSelectionChange = !1));
  }
  _expandEmptyToWord(e, t) {
    if (!t.isEmpty()) return t;
    const n = this._editor.getConfiguredWordAtPosition(t.getStartPosition());
    return n ? new XH(t.startLineNumber, n.startColumn, t.startLineNumber, n.endColumn) : t;
  }
  _applySessionResult(e) {
    e &&
      (this._setSelections(e.selections),
      e.revealRange &&
        this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange, e.revealScrollType));
  }
  getSession(e) {
    return this._session;
  }
  addSelectionToNextFindMatch(e) {
    if (this._editor.hasModel()) {
      if (!this._session) {
        const t = this._editor.getSelections();
        if (t.length > 1) {
          const n = e.getState().matchCase;
          if (!SAe(this._editor.getModel(), t, n)) {
            const e = this._editor.getModel(),
              n = [];
            for (let i = 0, r = t.length; i < r; i++) n[i] = this._expandEmptyToWord(e, t[i]);
            return void this._editor.setSelections(n);
          }
        }
      }
      (this._beginSessionIfNeeded(e),
        this._session && this._applySessionResult(this._session.addSelectionToNextFindMatch()));
    }
  }
  addSelectionToPreviousFindMatch(e) {
    (this._beginSessionIfNeeded(e),
      this._session && this._applySessionResult(this._session.addSelectionToPreviousFindMatch()));
  }
  moveSelectionToNextFindMatch(e) {
    (this._beginSessionIfNeeded(e),
      this._session && this._applySessionResult(this._session.moveSelectionToNextFindMatch()));
  }
  moveSelectionToPreviousFindMatch(e) {
    (this._beginSessionIfNeeded(e),
      this._session && this._applySessionResult(this._session.moveSelectionToPreviousFindMatch()));
  }
  selectAll(e) {
    if (!this._editor.hasModel()) return;
    let t = null;
    const n = e.getState();
    if (n.isRevealed && n.searchString.length > 0 && n.isRegex) {
      const e = this._editor.getModel();
      t = n.searchScope
        ? e.findMatches(
            n.searchString,
            n.searchScope,
            n.isRegex,
            n.matchCase,
            n.wholeWord ? this._editor.getOption(148) : null,
            !1,
            1073741824,
          )
        : e.findMatches(
            n.searchString,
            !0,
            n.isRegex,
            n.matchCase,
            n.wholeWord ? this._editor.getOption(148) : null,
            !1,
            1073741824,
          );
    } else {
      if ((this._beginSessionIfNeeded(e), !this._session)) return;
      t = this._session.selectAll(n.searchScope);
    }
    if (t.length > 0) {
      const e = this._editor.getSelection();
      for (let n = 0, i = t.length; n < i; n++) {
        const i = t[n];
        if (i.range.intersectRanges(e)) {
          ((t[n] = t[0]), (t[0] = i));
          break;
        }
      }
      this._setSelections(
        t.map(
          (e) =>
            new XH(
              e.range.startLineNumber,
              e.range.startColumn,
              e.range.endLineNumber,
              e.range.endColumn,
            ),
        ),
      );
    }
  }
}
class xAe extends AH {
  run(e, t) {
    const n = yAe.get(t);
    if (!n) return;
    const i = t._getViewModel();
    if (i) {
      const r = i.getCursorStates(),
        o = MEe.get(t);
      if (o) this._run(n, o);
      else {
        const i = e.get(vV).createInstance(MEe, t);
        (this._run(n, i), i.dispose());
      }
      _Ae(r, i.getCursorStates());
    }
  }
}
class wAe {
  constructor(e, t, n, i, r) {
    ((this._model = e),
      (this._searchText = t),
      (this._matchCase = n),
      (this._wordSeparators = i),
      (this._cachedFindMatches = null),
      (this._modelVersionId = this._model.getVersionId()),
      r &&
        this._model === r._model &&
        this._searchText === r._searchText &&
        this._matchCase === r._matchCase &&
        this._wordSeparators === r._wordSeparators &&
        this._modelVersionId === r._modelVersionId &&
        (this._cachedFindMatches = r._cachedFindMatches));
  }
  findMatches() {
    return (
      null === this._cachedFindMatches &&
        ((this._cachedFindMatches = this._model
          .findMatches(this._searchText, !0, !1, this._matchCase, this._wordSeparators, !1)
          .map((e) => e.range)),
        this._cachedFindMatches.sort(YH.compareRangesUsingStarts)),
      this._cachedFindMatches
    );
  }
}
let CAe = class extends PO {
  static {
    mAe = this;
  }
  static {
    this.ID = "editor.contrib.selectionHighlighter";
  }
  constructor(e, t) {
    (super(),
      (this._languageFeaturesService = t),
      (this.editor = e),
      (this._isEnabled = e.getOption(122)),
      (this._isEnabledMultiline = e.getOption(124)),
      (this._maxLength = e.getOption(123)),
      (this._decorations = e.createDecorationsCollection()),
      (this.updateSoon = this._register(new EM(() => this._update(), 300))),
      (this.state = null),
      this._register(
        e.onDidChangeConfiguration((t) => {
          ((this._isEnabled = e.getOption(122)),
            (this._isEnabledMultiline = e.getOption(124)),
            (this._maxLength = e.getOption(123)));
        }),
      ),
      this._register(
        e.onDidChangeCursorSelection((e) => {
          this._isEnabled &&
            (e.selection.isEmpty()
              ? 3 === e.reason
                ? (this.state && this._setState(null), this.updateSoon.schedule())
                : this._setState(null)
              : this._update());
        }),
      ),
      this._register(
        e.onDidChangeModel((e) => {
          this._setState(null);
        }),
      ),
      this._register(
        e.onDidChangeModelContent((e) => {
          this._isEnabled && this.updateSoon.schedule();
        }),
      ));
    const n = MEe.get(e);
    (n &&
      this._register(
        n.getState().onFindReplaceStateChange((e) => {
          this._update();
        }),
      ),
      this.updateSoon.schedule());
  }
  _update() {
    this._setState(
      mAe._createState(
        this.state,
        this._isEnabled,
        this._isEnabledMultiline,
        this._maxLength,
        this.editor,
      ),
    );
  }
  static _createState(e, t, n, i, r) {
    if (!t) return null;
    if (!r.hasModel()) return null;
    if (!n) {
      const e = r.getSelection();
      if (e.startLineNumber !== e.endLineNumber) return null;
    }
    const o = yAe.get(r);
    if (!o) return null;
    const s = MEe.get(r);
    if (!s) return null;
    let a = o.getSession(s);
    if (!a) {
      const e = r.getSelections();
      if (e.length > 1) {
        const t = s.getState().matchCase;
        if (!SAe(r.getModel(), e, t)) return null;
      }
      a = bAe.create(r, s);
    }
    if (!a) return null;
    if (a.currentMatch) return null;
    if (/^[ \t]+$/.test(a.searchText)) return null;
    if (i > 0 && a.searchText.length > i) return null;
    const l = s.getState(),
      c = l.matchCase;
    if (l.isRevealed) {
      let e = l.searchString;
      c || (e = e.toLowerCase());
      let t = a.searchText;
      if (
        (c || (t = t.toLowerCase()),
        e === t && a.matchCase === l.matchCase && a.wholeWord === l.wholeWord && !l.isRegex)
      )
        return null;
    }
    return new wAe(
      r.getModel(),
      a.searchText,
      a.matchCase,
      a.wholeWord ? r.getOption(148) : null,
      e,
    );
  }
  _setState(e) {
    if (((this.state = e), !this.state)) return void this._decorations.clear();
    if (!this.editor.hasModel()) return;
    const t = this.editor.getModel();
    if (t.isTooLargeForTokenization()) return;
    const n = this.state.findMatches(),
      i = this.editor.getSelections();
    i.sort(YH.compareRangesUsingStarts);
    const r = [];
    for (let l = 0, c = 0, d = n.length, u = i.length; l < d; ) {
      const e = n[l];
      if (c >= u) (r.push(e), l++);
      else {
        const t = YH.compareRangesUsingStarts(e, i[c]);
        t < 0
          ? ((!i[c].isEmpty() && YH.areIntersecting(e, i[c])) || r.push(e), l++)
          : (t > 0 || l++, c++);
      }
    }
    const o = "off" !== this.editor.getOption(90),
      s = this._languageFeaturesService.documentHighlightProvider.has(t) && o,
      a = r.map((e) => ({ range: e, options: fAe(s) }));
    this._decorations.set(a);
  }
  dispose() {
    (this._setState(null), super.dispose());
  }
};
function SAe(e, t, n) {
  const i = kAe(e, t[0], !n);
  for (let r = 1, o = t.length; r < o; r++) {
    const o = t[r];
    if (o.isEmpty()) return !1;
    if (i !== kAe(e, o, !n)) return !1;
  }
  return !0;
}
function kAe(e, t, n) {
  const i = e.getValueInRange(t);
  return n ? i.toLowerCase() : i;
}
CAe = mAe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, mee),
  ],
  CAe,
);
(zH(yAe.ID, yAe, 4),
  zH(CAe.ID, CAe, 1),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.insertCursorAbove",
          label: EI(1298, "Add Cursor Above"),
          precondition: void 0,
          kbOpts: {
            kbExpr: $$.editorTextFocus,
            primary: 2576,
            linux: { primary: 1552, secondary: [3088] },
            weight: 100,
          },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "3_multi",
            title: SI(1290, "&&Add Cursor Above"),
            order: 2,
          },
        });
      }
      run(e, t, n) {
        if (!t.hasModel()) return;
        let i = !0;
        n && !1 === n.logicalLine && (i = !1);
        const r = t._getViewModel();
        if (r.cursorConfig.readOnly) return;
        r.model.pushStackElement();
        const o = r.getCursorStates();
        (r.setCursorStates(n.source, 3, nU.addCursorUp(r, o, i)),
          r.revealTopMostCursor(n.source),
          _Ae(o, r.getCursorStates()));
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.insertCursorBelow",
          label: EI(1299, "Add Cursor Below"),
          precondition: void 0,
          kbOpts: {
            kbExpr: $$.editorTextFocus,
            primary: 2578,
            linux: { primary: 1554, secondary: [3090] },
            weight: 100,
          },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "3_multi",
            title: SI(1291, "A&&dd Cursor Below"),
            order: 3,
          },
        });
      }
      run(e, t, n) {
        if (!t.hasModel()) return;
        let i = !0;
        n && !1 === n.logicalLine && (i = !1);
        const r = t._getViewModel();
        if (r.cursorConfig.readOnly) return;
        r.model.pushStackElement();
        const o = r.getCursorStates();
        (r.setCursorStates(n.source, 3, nU.addCursorDown(r, o, i)),
          r.revealBottomMostCursor(n.source),
          _Ae(o, r.getCursorStates()));
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.insertCursorAtEndOfEachLineSelected",
          label: EI(1300, "Add Cursors to Line Ends"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 1575, weight: 100 },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "3_multi",
            title: SI(1292, "Add C&&ursors to Line Ends"),
            order: 4,
          },
        });
      }
      getCursorsForSelection(e, t, n) {
        if (!e.isEmpty()) {
          for (let i = e.startLineNumber; i < e.endLineNumber; i++) {
            const e = t.getLineMaxColumn(i);
            n.push(new XH(i, e, i, e));
          }
          e.endColumn > 1 &&
            n.push(new XH(e.endLineNumber, e.endColumn, e.endLineNumber, e.endColumn));
        }
      }
      run(e, t) {
        if (!t.hasModel()) return;
        const n = t.getModel(),
          i = t.getSelections(),
          r = t._getViewModel(),
          o = r.getCursorStates(),
          s = [];
        (i.forEach((e) => this.getCursorsForSelection(e, n, s)),
          s.length > 0 && t.setSelections(s),
          _Ae(o, r.getCursorStates()));
      }
    },
  ),
  VH(
    class extends xAe {
      constructor() {
        super({
          id: "editor.action.addSelectionToNextFindMatch",
          label: EI(1303, "Add Selection to Next Find Match"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.focus, primary: 2082, weight: 100 },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "3_multi",
            title: SI(1293, "Add &&Next Occurrence"),
            order: 5,
          },
        });
      }
      _run(e, t) {
        e.addSelectionToNextFindMatch(t);
      }
    },
  ),
  VH(
    class extends xAe {
      constructor() {
        super({
          id: "editor.action.addSelectionToPreviousFindMatch",
          label: EI(1304, "Add Selection to Previous Find Match"),
          precondition: void 0,
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "3_multi",
            title: SI(1294, "Add P&&revious Occurrence"),
            order: 6,
          },
        });
      }
      _run(e, t) {
        e.addSelectionToPreviousFindMatch(t);
      }
    },
  ),
  VH(
    class extends xAe {
      constructor() {
        super({
          id: "editor.action.moveSelectionToNextFindMatch",
          label: EI(1305, "Move Last Selection to Next Find Match"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.focus, primary: gO(2089, 2082), weight: 100 },
        });
      }
      _run(e, t) {
        e.moveSelectionToNextFindMatch(t);
      }
    },
  ),
  VH(
    class extends xAe {
      constructor() {
        super({
          id: "editor.action.moveSelectionToPreviousFindMatch",
          label: EI(1306, "Move Last Selection to Previous Find Match"),
          precondition: void 0,
        });
      }
      _run(e, t) {
        e.moveSelectionToPreviousFindMatch(t);
      }
    },
  ),
  VH(
    class extends xAe {
      constructor() {
        super({
          id: "editor.action.selectHighlights",
          label: EI(1307, "Select All Occurrences of Find Match"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.focus, primary: 3114, weight: 100 },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "3_multi",
            title: SI(1295, "Select All &&Occurrences"),
            order: 7,
          },
        });
      }
      _run(e, t) {
        e.selectAll(t);
      }
    },
  ),
  VH(
    class extends xAe {
      constructor() {
        super({
          id: "editor.action.changeAll",
          label: EI(1308, "Change All Occurrences"),
          precondition: eW.and($$.writable, $$.editorTextFocus),
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 2108, weight: 100 },
          contextMenuOpts: { group: "1_modification", order: 1.2 },
        });
      }
      _run(e, t) {
        e.selectAll(t);
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.addCursorsToBottom",
          label: EI(1301, "Add Cursors to Bottom"),
          precondition: void 0,
        });
      }
      run(e, t) {
        if (!t.hasModel()) return;
        const n = t.getSelections(),
          i = t.getModel().getLineCount(),
          r = [];
        for (let a = n[0].startLineNumber; a <= i; a++)
          r.push(new XH(a, n[0].startColumn, a, n[0].endColumn));
        const o = t._getViewModel(),
          s = o.getCursorStates();
        (r.length > 0 && t.setSelections(r), _Ae(s, o.getCursorStates()));
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.addCursorsToTop",
          label: EI(1302, "Add Cursors to Top"),
          precondition: void 0,
        });
      }
      run(e, t) {
        if (!t.hasModel()) return;
        const n = t.getSelections(),
          i = [];
        for (let s = n[0].startLineNumber; s >= 1; s--)
          i.push(new XH(s, n[0].startColumn, s, n[0].endColumn));
        const r = t._getViewModel(),
          o = r.getCursorStates();
        (i.length > 0 && t.setSelections(i), _Ae(o, r.getCursorStates()));
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.focusNextCursor",
          label: EI(1309, "Focus Next Cursor"),
          metadata: { description: SI(1296, "Focuses the next cursor"), args: [] },
          precondition: void 0,
        });
      }
      run(e, t, n) {
        if (!t.hasModel()) return;
        const i = t._getViewModel();
        if (i.cursorConfig.readOnly) return;
        i.model.pushStackElement();
        const r = Array.from(i.getCursorStates()),
          o = r.shift();
        o &&
          (r.push(o),
          i.setCursorStates(n.source, 3, r),
          i.revealPrimaryCursor(n.source, !0),
          _Ae(r, i.getCursorStates()));
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.focusPreviousCursor",
          label: EI(1310, "Focus Previous Cursor"),
          metadata: { description: SI(1297, "Focuses the previous cursor"), args: [] },
          precondition: void 0,
        });
      }
      run(e, t, n) {
        if (!t.hasModel()) return;
        const i = t._getViewModel();
        if (i.cursorConfig.readOnly) return;
        i.model.pushStackElement();
        const r = Array.from(i.getCursorStates()),
          o = r.pop();
        o &&
          (r.unshift(o),
          i.setCursorStates(n.source, 3, r),
          i.revealPrimaryCursor(n.source, !0),
          _Ae(r, i.getCursorStates()));
      }
    },
  ));
const EAe = {
  Visible: new yW("parameterHintsVisible", !1),
  MultipleSignatures: new yW("parameterHintsMultipleSignatures", !1),
};
async function NAe(e, t, n, i, r) {
  const o = e.ordered(t);
  for (const a of o)
    try {
      const e = await a.provideSignatureHelp(t, n, r, i);
      if (e) return e;
    } catch (s) {
      zI(s);
    }
}
var LAe;
(jV.registerCommand("_executeSignatureHelpProvider", async (e, ...t) => {
  const [n, i, r] = t;
  (pR(mP.isUri(n)), pR(xV.isIPosition(i)), pR("string" == typeof r || !r));
  const o = e.get(mee),
    s = await e.get(CV).createModelReference(n);
  try {
    const e = await NAe(
      o.signatureHelpProvider,
      s.object.textEditorModel,
      xV.lift(i),
      { triggerKind: v2.Invoke, isRetrigger: !1, triggerCharacter: r },
      aM.None,
    );
    if (!e) return;
    return (setTimeout(() => e.dispose(), 0), e.value);
  } finally {
    s.dispose();
  }
}),
  (function (e) {
    e.Default = { type: 0 };
    e.Pending = class {
      constructor(e, t) {
        ((this.request = e), (this.previouslyActiveHints = t), (this.type = 2));
      }
    };
    e.Active = class {
      constructor(e) {
        ((this.hints = e), (this.type = 1));
      }
    };
  })(LAe || (LAe = {})));
class DAe extends PO {
  static {
    this.DEFAULT_DELAY = 120;
  }
  constructor(e, t, n = DAe.DEFAULT_DELAY) {
    (super(),
      (this._onChangedHints = this._register(new QO())),
      (this.onChangedHints = this._onChangedHints.event),
      (this.triggerOnType = !1),
      (this._state = LAe.Default),
      (this._pendingTriggers = []),
      (this._lastSignatureHelpResult = this._register(new jO())),
      (this.triggerChars = new Iz()),
      (this.retriggerChars = new Iz()),
      (this.triggerId = 0),
      (this.editor = e),
      (this.providers = t),
      (this.throttledDelayer = new mM(n)),
      this._register(this.editor.onDidBlurEditorWidget(() => this.cancel())),
      this._register(
        this.editor.onDidChangeConfiguration(() => this.onEditorConfigurationChange()),
      ),
      this._register(this.editor.onDidChangeModel((e) => this.onModelChanged())),
      this._register(this.editor.onDidChangeModelLanguage((e) => this.onModelChanged())),
      this._register(this.editor.onDidChangeCursorSelection((e) => this.onCursorChange(e))),
      this._register(this.editor.onDidChangeModelContent((e) => this.onModelContentChange())),
      this._register(this.providers.onDidChange(this.onModelChanged, this)),
      this._register(this.editor.onDidType((e) => this.onDidType(e))),
      this.onEditorConfigurationChange(),
      this.onModelChanged());
  }
  get state() {
    return this._state;
  }
  set state(e) {
    (2 === this._state.type && this._state.request.cancel(), (this._state = e));
  }
  cancel(e = !1) {
    ((this.state = LAe.Default),
      this.throttledDelayer.cancel(),
      e || this._onChangedHints.fire(void 0));
  }
  trigger(e, t) {
    const n = this.editor.getModel();
    if (!n || !this.providers.has(n)) return;
    const i = ++this.triggerId;
    (this._pendingTriggers.push(e),
      this.throttledDelayer.trigger(() => this.doTrigger(i), t).catch(HI));
  }
  next() {
    if (1 !== this.state.type) return;
    const e = this.state.hints.signatures.length,
      t = this.state.hints.activeSignature,
      n = t % e === e - 1,
      i = this.editor.getOption(98).cycle;
    !(e < 2 || n) || i ? this.updateActiveSignature(n && i ? 0 : t + 1) : this.cancel();
  }
  previous() {
    if (1 !== this.state.type) return;
    const e = this.state.hints.signatures.length,
      t = this.state.hints.activeSignature,
      n = 0 === t,
      i = this.editor.getOption(98).cycle;
    !(e < 2 || n) || i ? this.updateActiveSignature(n && i ? e - 1 : t - 1) : this.cancel();
  }
  updateActiveSignature(e) {
    1 === this.state.type &&
      ((this.state = new LAe.Active({ ...this.state.hints, activeSignature: e })),
      this._onChangedHints.fire(this.state.hints));
  }
  async doTrigger(e) {
    const t = 1 === this.state.type || 2 === this.state.type,
      n = this.getLastActiveHints();
    if ((this.cancel(!0), 0 === this._pendingTriggers.length)) return !1;
    const i = this._pendingTriggers.reduce(TAe);
    this._pendingTriggers = [];
    const r = {
      triggerKind: i.triggerKind,
      triggerCharacter: i.triggerCharacter,
      isRetrigger: t,
      activeSignatureHelp: n,
    };
    if (!this.editor.hasModel()) return !1;
    const o = this.editor.getModel(),
      s = this.editor.getPosition();
    this.state = new LAe.Pending(
      gM((e) => NAe(this.providers, o, s, r, e)),
      n,
    );
    try {
      const t = await this.state.request;
      return e !== this.triggerId
        ? (t?.dispose(), !1)
        : t && t.value.signatures && 0 !== t.value.signatures.length
          ? ((this.state = new LAe.Active(t.value)),
            (this._lastSignatureHelpResult.value = t),
            this._onChangedHints.fire(this.state.hints),
            !0)
          : (t?.dispose(), this._lastSignatureHelpResult.clear(), this.cancel(), !1);
    } catch (D2t) {
      return (e === this.triggerId && (this.state = LAe.Default), HI(D2t), !1);
    }
  }
  getLastActiveHints() {
    switch (this.state.type) {
      case 1:
        return this.state.hints;
      case 2:
        return this.state.previouslyActiveHints;
      default:
        return;
    }
  }
  get isTriggered() {
    return 1 === this.state.type || 2 === this.state.type || this.throttledDelayer.isTriggered();
  }
  onModelChanged() {
    (this.cancel(), this.triggerChars.clear(), this.retriggerChars.clear());
    const e = this.editor.getModel();
    if (e)
      for (const t of this.providers.ordered(e)) {
        for (const e of t.signatureHelpTriggerCharacters || [])
          if (e.length) {
            const t = e.charCodeAt(0);
            (this.triggerChars.add(t), this.retriggerChars.add(t));
          }
        for (const e of t.signatureHelpRetriggerCharacters || [])
          e.length && this.retriggerChars.add(e.charCodeAt(0));
      }
  }
  onDidType(e) {
    if (!this.triggerOnType) return;
    const t = e.length - 1,
      n = e.charCodeAt(t);
    (this.triggerChars.has(n) || (this.isTriggered && this.retriggerChars.has(n))) &&
      this.trigger({ triggerKind: v2.TriggerCharacter, triggerCharacter: e.charAt(t) });
  }
  onCursorChange(e) {
    "mouse" === e.source
      ? this.cancel()
      : this.isTriggered && this.trigger({ triggerKind: v2.ContentChange });
  }
  onModelContentChange() {
    this.isTriggered && this.trigger({ triggerKind: v2.ContentChange });
  }
  onEditorConfigurationChange() {
    ((this.triggerOnType = this.editor.getOption(98).enabled), this.triggerOnType || this.cancel());
  }
  dispose() {
    (this.cancel(!0), super.dispose());
  }
}
function TAe(e, t) {
  switch (t.triggerKind) {
    case v2.Invoke:
      return t;
    case v2.ContentChange:
      return e;
    case v2.TriggerCharacter:
    default:
      return t;
  }
}
var IAe,
  RAe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const OAe = VB,
  MAe = Zle("parameter-hints-next", OV.chevronDown, SI(1312, "Icon for show next parameter hint.")),
  AAe = Zle(
    "parameter-hints-previous",
    OV.chevronUp,
    SI(1313, "Icon for show previous parameter hint."),
  );
let PAe = class extends PO {
  static {
    IAe = this;
  }
  static {
    this.ID = "editor.widget.parameterHintsWidget";
  }
  constructor(e, t, n, i) {
    (super(),
      (this.editor = e),
      (this.model = t),
      (this.markdownRendererService = i),
      (this.renderDisposeables = this._register(new AO())),
      (this.visible = !1),
      (this.announcedLabel = null),
      (this.allowEditorOverflow = !0),
      (this.keyVisible = EAe.Visible.bindTo(n)),
      (this.keyMultipleSignatures = EAe.MultipleSignatures.bindTo(n)));
  }
  createParameterHintDOMNodes() {
    const e = OAe(".editor-widget.parameter-hints-widget"),
      t = MB(e, OAe(".phwrapper"));
    t.tabIndex = -1;
    const n = MB(t, OAe(".controls")),
      i = MB(n, OAe(".button" + AV.asCSSSelector(AAe))),
      r = MB(n, OAe(".overloads")),
      o = MB(n, OAe(".button" + AV.asCSSSelector(MAe)));
    (this._register(
      $F(i, "click", (e) => {
        (IB(e), this.previous());
      }),
    ),
      this._register(
        $F(o, "click", (e) => {
          (IB(e), this.next());
        }),
      ));
    const s = OAe(".body"),
      a = new wJ(s, { alwaysConsumeMouseWheel: !0 });
    (this._register(a), t.appendChild(a.getDomNode()));
    const l = MB(s, OAe(".signature")),
      c = MB(s, OAe(".docs"));
    ((e.style.userSelect = "text"),
      (this.domNodes = { element: e, signature: l, overloads: r, docs: c, scrollbar: a }),
      this.editor.addContentWidget(this),
      this.hide(),
      this._register(
        this.editor.onDidChangeCursorSelection((e) => {
          this.visible && this.editor.layoutContentWidget(this);
        }),
      ));
    const d = () => {
      if (!this.domNodes) return;
      const e = this.editor.getOption(59),
        t = this.domNodes.element;
      ((t.style.fontSize = `${e.fontSize}px`),
        (t.style.lineHeight = "" + e.lineHeight / e.fontSize),
        t.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily", e.fontFamily),
        t.style.setProperty(
          "--vscode-parameterHintsWidget-editorFontFamilyDefault",
          Jq.fontFamily,
        ));
    };
    (d(),
      this._register(
        $O.chain(this.editor.onDidChangeConfiguration.bind(this.editor), (e) =>
          e.filter((e) => e.hasChanged(59)),
        )(d),
      ),
      this._register(this.editor.onDidLayoutChange((e) => this.updateMaxHeight())),
      this.updateMaxHeight());
  }
  show() {
    this.visible ||
      (this.domNodes || this.createParameterHintDOMNodes(),
      this.keyVisible.set(!0),
      (this.visible = !0),
      setTimeout(() => {
        this.domNodes?.element.classList.add("visible");
      }, 100),
      this.editor.layoutContentWidget(this));
  }
  hide() {
    (this.renderDisposeables.clear(),
      this.visible &&
        (this.keyVisible.reset(),
        (this.visible = !1),
        (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(e) {
    if ((this.renderDisposeables.clear(), !this.domNodes)) return;
    const t = e.signatures.length > 1;
    (this.domNodes.element.classList.toggle("multiple", t),
      this.keyMultipleSignatures.set(t),
      (this.domNodes.signature.innerText = ""),
      (this.domNodes.docs.innerText = ""));
    const n = e.signatures[e.activeSignature];
    if (!n) return;
    const i = MB(this.domNodes.signature, OAe(".code")),
      r = n.parameters.length > 0,
      o = n.activeParameter ?? e.activeParameter;
    if (r) this.renderParameters(i, n, o);
    else {
      MB(i, OAe("span")).textContent = n.label;
    }
    const s = n.parameters[o];
    if (s?.documentation) {
      const e = OAe("span.documentation");
      if ("string" == typeof s.documentation) e.textContent = s.documentation;
      else {
        const t = this.renderMarkdownDocs(s.documentation);
        e.appendChild(t.element);
      }
      MB(this.domNodes.docs, OAe("p", {}, e));
    }
    if (void 0 === n.documentation);
    else if ("string" == typeof n.documentation)
      MB(this.domNodes.docs, OAe("p", {}, n.documentation));
    else {
      const e = this.renderMarkdownDocs(n.documentation);
      MB(this.domNodes.docs, e.element);
    }
    const a = this.hasDocs(n, s);
    if (
      (this.domNodes.signature.classList.toggle("has-docs", a),
      this.domNodes.docs.classList.toggle("empty", !a),
      (this.domNodes.overloads.textContent =
        String(e.activeSignature + 1).padStart(e.signatures.length.toString().length, "0") +
        "/" +
        e.signatures.length),
      s)
    ) {
      let e = "";
      const t = n.parameters[o];
      ((e = Array.isArray(t.label) ? n.label.substring(t.label[0], t.label[1]) : t.label),
        t.documentation &&
          (e +=
            "string" == typeof t.documentation
              ? `, ${t.documentation}`
              : `, ${t.documentation.value}`),
        n.documentation &&
          (e +=
            "string" == typeof n.documentation
              ? `, ${n.documentation}`
              : `, ${n.documentation.value}`),
        this.announcedLabel !== e && (pV(SI(1314, "{0}, hint", e)), (this.announcedLabel = e)));
    }
    (this.editor.layoutContentWidget(this), this.domNodes.scrollbar.scanDomNode());
  }
  renderMarkdownDocs(e) {
    const t = this.renderDisposeables.add(
      this.markdownRendererService.render(e, {
        context: this.editor,
        asyncRenderCallback: () => {
          this.domNodes?.scrollbar.scanDomNode();
        },
      }),
    );
    return (t.element.classList.add("markdown-docs"), t);
  }
  hasDocs(e, t) {
    return (
      !!(t && "string" == typeof t.documentation && fR(t.documentation).length > 0) ||
      !!(t && "object" == typeof t.documentation && fR(t.documentation).value.length > 0) ||
      !!(e.documentation && "string" == typeof e.documentation && fR(e.documentation).length > 0) ||
      !!(
        e.documentation &&
        "object" == typeof e.documentation &&
        fR(e.documentation.value).length > 0
      )
    );
  }
  renderParameters(e, t, n) {
    const [i, r] = this.getParameterLabelOffsets(t, n),
      o = document.createElement("span");
    o.textContent = t.label.substring(0, i);
    const s = document.createElement("span");
    ((s.textContent = t.label.substring(i, r)), (s.className = "parameter active"));
    const a = document.createElement("span");
    ((a.textContent = t.label.substring(r)), MB(e, o, s, a));
  }
  getParameterLabelOffsets(e, t) {
    const n = e.parameters[t];
    if (n) {
      if (Array.isArray(n.label)) return n.label;
      if (n.label.length) {
        const t = new RegExp(`(\\W|^)${zM(n.label)}(?=\\W|$)`, "g");
        t.test(e.label);
        const i = t.lastIndex - n.label.length;
        return i >= 0 ? [i, t.lastIndex] : [0, 0];
      }
      return [0, 0];
    }
    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 IAe.ID;
  }
  updateMaxHeight() {
    if (!this.domNodes) return;
    const e = `${Math.max(this.editor.getLayoutInfo().height / 4, 250)}px`;
    this.domNodes.element.style.maxHeight = e;
    const t = this.domNodes.element.getElementsByClassName("phwrapper");
    t.length && (t[0].style.maxHeight = e);
  }
};
((PAe = IAe =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })([RAe(2, xW), RAe(3, _ge)], PAe)),
  SG(
    "editorHoverWidget.highlightForeground",
    gX,
    SI(1315, "Foreground color of the active item in the parameter hint."),
  ));
var jAe,
  FAe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let BAe = class extends PO {
  static {
    jAe = this;
  }
  static {
    this.ID = "editor.controller.parameterHints";
  }
  static get(e) {
    return e.getContribution(jAe.ID);
  }
  constructor(e, t, n) {
    (super(),
      (this.editor = e),
      (this.model = this._register(new DAe(e, n.signatureHelpProvider))),
      this._register(
        this.model.onChangedHints((e) => {
          e
            ? (this.widget.value.show(), this.widget.value.render(e))
            : this.widget.rawValue?.hide();
        }),
      ),
      (this.widget = new FM(() => this._register(t.createInstance(PAe, this.editor, this.model)))));
  }
  cancel() {
    this.model.cancel();
  }
  previous() {
    this.widget.rawValue?.previous();
  }
  next() {
    this.widget.rawValue?.next();
  }
  trigger(e) {
    this.model.trigger(e, 0);
  }
};
BAe = jAe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([FAe(1, vV), FAe(2, mee)], BAe);
(zH(BAe.ID, BAe, 2),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.triggerParameterHints",
          label: EI(1311, "Trigger Parameter Hints"),
          precondition: $$.hasSignatureHelpProvider,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 3082, weight: 100 },
        });
      }
      run(e, t) {
        const n = BAe.get(t);
        n?.trigger({ triggerKind: v2.Invoke });
      }
    },
  ));
const VAe = MH.bindToContribution(BAe.get);
(BH(
  new VAe({
    id: "closeParameterHints",
    precondition: EAe.Visible,
    handler: (e) => e.cancel(),
    kbOpts: { weight: 175, kbExpr: $$.focus, primary: 9, secondary: [1033] },
  }),
),
  BH(
    new VAe({
      id: "showPrevParameterHint",
      precondition: eW.and(EAe.Visible, EAe.MultipleSignatures),
      handler: (e) => e.previous(),
      kbOpts: {
        weight: 175,
        kbExpr: $$.focus,
        primary: 16,
        secondary: [528],
        mac: { primary: 16, secondary: [528, 302] },
      },
    }),
  ),
  BH(
    new VAe({
      id: "showNextParameterHint",
      precondition: eW.and(EAe.Visible, EAe.MultipleSignatures),
      handler: (e) => e.next(),
      kbOpts: {
        weight: 175,
        kbExpr: $$.focus,
        primary: 18,
        secondary: [530],
        mac: { primary: 18, secondary: [530, 300] },
      },
    }),
  ));
class WAe extends PO {
  static {
    this.ID = "editor.contrib.placeholderText";
  }
  constructor(e) {
    (super(),
      (this._editor = e),
      (this._editorObs = xde(this._editor)),
      (this._placeholderText = this._editorObs.getOption(100)),
      (this._state = Jj({ owner: this, equalsFn: Aj }, (e) => {
        const t = this._placeholderText.read(e);
        if (t && this._editorObs.valueIsEmpty.read(e)) return { placeholder: t };
      })),
      (this._shouldViewBeAlive = (function (e, t) {
        return bF(e, (e, n) => !0 === n || t(e));
      })(this, (e) => void 0 !== this._state.read(e)?.placeholder)),
      (this._view = Xj((e) => {
        if (!this._shouldViewBeAlive.read(e)) return;
        const t = GB("div.editorPlaceholder");
        (e.store.add(
          rF((e) => {
            const n = this._state.read(e),
              i = void 0 !== n?.placeholder;
            ((t.root.style.display = i ? "block" : "none"),
              (t.root.innerText = n?.placeholder ?? ""));
          }),
        ),
          e.store.add(
            rF((e) => {
              const n = this._editorObs.layoutInfo.read(e);
              ((t.root.style.left = `${n.contentLeft}px`),
                (t.root.style.width = n.contentWidth - n.verticalScrollbarWidth + "px"),
                (t.root.style.top = `${this._editor.getTopForLineNumber(0)}px`));
            }),
          ),
          e.store.add(
            rF((e) => {
              ((t.root.style.fontFamily = this._editorObs.getOption(58).read(e)),
                (t.root.style.fontSize = this._editorObs.getOption(61).read(e) + "px"),
                (t.root.style.lineHeight = this._editorObs.getOption(75).read(e) + "px"));
            }),
          ),
          e.store.add(
            this._editorObs.createOverlayWidget({
              allowEditorOverflow: !1,
              minContentWidthInPx: xne(0),
              position: xne(null),
              domNode: t.root,
            }),
          ));
      })),
      this._view.recomputeInitiallyAndOnChange(this._store));
  }
}
class HAe {
  constructor(e) {
    this.instantiationService = e;
  }
  init(...e) {}
}
let zAe = class extends HAe {
  constructor(e, t) {
    (super(t), this.init(e));
  }
};
((zAe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, vV),
  ],
  zAe,
)),
  zH(WAe.ID, (() => WAe)(), 0),
  SG(
    "editor.placeholder.foreground",
    Z0,
    SI(1334, "Foreground color of the placeholder text in the editor."),
  ));
const UAe = bV("textResourceConfigurationService"),
  $Ae = bV("textResourcePropertiesService");
var qAe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const KAe = new yW(
  "renameInputVisible",
  !1,
  SI(1391, "Whether the rename input widget is visible"),
);
new yW("renameInputFocused", !1, SI(1392, "Whether the rename input widget is focused"));
let GAe = class {
  constructor(e, t, n, i, r, o) {
    ((this._editor = e),
      (this._acceptKeybindings = t),
      (this._themeService = n),
      (this._keybindingService = i),
      (this._logService = o),
      (this.allowEditorOverflow = !0),
      (this._disposables = new AO()),
      (this._visibleContextKey = KAe.bindTo(r)),
      (this._isEditingRenameCandidate = !1),
      (this._nRenameSuggestionsInvocations = 0),
      (this._hadAutomaticRenameSuggestionsInvocation = !1),
      (this._candidates = new Set()),
      (this._beforeFirstInputFieldEditSW = new UO()),
      (this._inputWithButton = new YAe()),
      this._disposables.add(this._inputWithButton),
      this._editor.addContentWidget(this),
      this._disposables.add(
        this._editor.onDidChangeConfiguration((e) => {
          e.hasChanged(59) && this._updateFont();
        }),
      ),
      this._disposables.add(n.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 ZAe(this._domNode, {
            fontInfo: this._editor.getOption(59),
            onFocusChange: (e) => {
              ((this._inputWithButton.input.value = e), (this._isEditingRenameCandidate = !1));
            },
            onSelectionChange: () => {
              ((this._isEditingRenameCandidate = !1), this.acceptInput(!1));
            },
          }),
        )),
        this._disposables.add(
          this._inputWithButton.onDidInputChange(() => {
            (void 0 !== this._renameCandidateListView?.focusedCandidate &&
              (this._isEditingRenameCandidate = !0),
              (this._timeBeforeFirstInputFieldEdit ??= this._beforeFirstInputFieldEditSW.elapsed()),
              !1 === this._renameCandidateProvidersCts?.token.isCancellationRequested &&
                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(e) {
    if (!this._domNode) return;
    const t = e.getColor(MZ),
      n = e.getColor(AZ);
    ((this._domNode.style.backgroundColor = String(e.getColor(YG) ?? "")),
      (this._domNode.style.boxShadow = t ? ` 0 0 8px 2px ${t}` : ""),
      (this._domNode.style.border = n ? `1px solid ${n}` : ""),
      (this._domNode.style.color = String(e.getColor(lY) ?? "")));
    const i = e.getColor(cY);
    ((this._inputWithButton.domNode.style.backgroundColor = String(e.getColor(aY) ?? "")),
      (this._inputWithButton.input.style.backgroundColor = String(e.getColor(aY) ?? "")),
      (this._inputWithButton.domNode.style.borderWidth = i ? "1px" : "0px"),
      (this._inputWithButton.domNode.style.borderStyle = i ? "solid" : "none"),
      (this._inputWithButton.domNode.style.borderColor = i?.toString() ?? "none"));
  }
  _updateFont() {
    if (void 0 === this._domNode) return;
    (pR(
      void 0 !== this._label,
      "RenameWidget#_updateFont: _label must not be undefined given _domNode is defined",
    ),
      this._editor.applyFontInfo(this._inputWithButton.input));
    const e = this._editor.getOption(59);
    this._label.style.fontSize = `${this._computeLabelFontSize(e.fontSize)}px`;
  }
  _computeLabelFontSize(e) {
    return 0.8 * e;
  }
  getPosition() {
    if (!this._visible) return null;
    if (!this._editor.hasModel() || !this._editor.getDomNode()) return null;
    const e = iB(this.getDomNode().ownerDocument.body),
      t = aB(this._editor.getDomNode()),
      n = this._getTopForPosition();
    ((this._nPxAvailableAbove = n + t.top),
      (this._nPxAvailableBelow = e.height - this._nPxAvailableAbove));
    const i = this._editor.getOption(75),
      { totalHeight: r } = XAe.getLayoutInfo({ lineHeight: i }),
      o = this._nPxAvailableBelow > 6 * r ? [2, 1] : [1, 2];
    return { position: this._position, preference: o };
  }
  beforeRender() {
    const [e, t] = this._acceptKeybindings;
    return (
      (this._label.innerText = SI(
        1393,
        "{0} to Rename, {1} to Preview",
        this._keybindingService.lookupKeybinding(e)?.getLabel(),
        this._keybindingService.lookupKeybinding(t)?.getLabel(),
      )),
      (this._domNode.style.minWidth = "200px"),
      null
    );
  }
  afterRender(e) {
    if (null === e) return void this.cancelInput(!0, "afterRender (because position is null)");
    if (!this._editor.hasModel() || !this._editor.getDomNode()) return;
    (pR(this._renameCandidateListView),
      pR(void 0 !== this._nPxAvailableAbove),
      pR(void 0 !== this._nPxAvailableBelow));
    const t = hB(this._inputWithButton.domNode),
      n = hB(this._label);
    let i;
    ((i = 2 === e ? this._nPxAvailableBelow : this._nPxAvailableAbove),
      this._renameCandidateListView.layout({
        height: i - n - t,
        width: cB(this._inputWithButton.domNode),
      }));
  }
  acceptInput(e) {
    (this._trace("invoking acceptInput"), this._currentAcceptInput?.(e));
  }
  cancelInput(e, t) {
    this._currentCancelInput?.(e);
  }
  focusNextRenameSuggestion() {
    this._renameCandidateListView?.focusNext() ||
      (this._inputWithButton.input.value = this._currentName);
  }
  focusPreviousRenameSuggestion() {
    this._renameCandidateListView?.focusPrevious() ||
      (this._inputWithButton.input.value = this._currentName);
  }
  getInput(e, t, n, i, r) {
    const { start: o, end: s } = this._getSelection(e, t);
    this._renameCts = r;
    const a = new AO();
    ((this._nRenameSuggestionsInvocations = 0),
      (this._hadAutomaticRenameSuggestionsInvocation = !1),
      void 0 === i
        ? (this._inputWithButton.button.style.display = "none")
        : ((this._inputWithButton.button.style.display = "flex"),
          (this._requestRenameCandidatesOnce = i),
          this._requestRenameCandidates(t, !1),
          a.add(
            $F(this._inputWithButton.button, "click", () => this._requestRenameCandidates(t, !0)),
          ),
          a.add(
            $F(this._inputWithButton.button, DB.KEY_DOWN, (e) => {
              const n = new wO(e);
              (n.equals(3) || n.equals(10)) &&
                (n.stopPropagation(), n.preventDefault(), this._requestRenameCandidates(t, !0));
            }),
          )),
      (this._isEditingRenameCandidate = !1),
      this._domNode.classList.toggle("preview", n),
      (this._position = new xV(e.startLineNumber, e.startColumn)),
      (this._currentName = t),
      (this._inputWithButton.input.value = t),
      this._inputWithButton.input.setAttribute("selectionStart", o.toString()),
      this._inputWithButton.input.setAttribute("selectionEnd", s.toString()),
      (this._inputWithButton.input.size = Math.max(1.1 * (e.endColumn - e.startColumn), 20)),
      this._beforeFirstInputFieldEditSW.reset(),
      a.add(
        MO(() => {
          ((this._renameCts = void 0), r.dispose(!0));
        }),
      ),
      a.add(
        MO(() => {
          void 0 !== this._renameCandidateProvidersCts &&
            (this._renameCandidateProvidersCts.dispose(!0),
            (this._renameCandidateProvidersCts = void 0));
        }),
      ),
      a.add(MO(() => this._candidates.clear())));
    const l = new DM();
    return (
      l.p.finally(() => {
        (a.dispose(), this._hide());
      }),
      (this._currentCancelInput = (e) => (
        this._trace("invoking _currentCancelInput"),
        (this._currentAcceptInput = void 0),
        (this._currentCancelInput = void 0),
        this._renameCandidateListView?.clearCandidates(),
        l.complete(e),
        !0
      )),
      (this._currentAcceptInput = (e) => {
        (this._trace("invoking _currentAcceptInput"), pR(void 0 !== this._renameCandidateListView));
        const i = this._renameCandidateListView.nCandidates;
        let r, o;
        const s = this._renameCandidateListView.focusedCandidate;
        (void 0 !== s
          ? (this._trace("using new name from renameSuggestion"),
            (r = s),
            (o = { k: "renameSuggestion" }))
          : (this._trace("using new name from inputField"),
            (r = this._inputWithButton.input.value),
            (o = this._isEditingRenameCandidate
              ? { k: "userEditedRenameSuggestion" }
              : { k: "inputField" })),
          r !== t && 0 !== r.trim().length
            ? ((this._currentAcceptInput = void 0),
              (this._currentCancelInput = void 0),
              this._renameCandidateListView.clearCandidates(),
              l.complete({
                newName: r,
                wantsPreview: n && e,
                stats: {
                  source: o,
                  nRenameSuggestions: i,
                  timeBeforeFirstInputFieldEdit: this._timeBeforeFirstInputFieldEdit,
                  nRenameSuggestionsInvocations: this._nRenameSuggestionsInvocations,
                  hadAutomaticRenameSuggestionsInvocation:
                    this._hadAutomaticRenameSuggestionsInvocation,
                },
              }))
            : this.cancelInput(
                !0,
                "_currentAcceptInput (because newName === value || newName.trim().length === 0)",
              ));
      }),
      a.add(
        r.token.onCancellationRequested(() =>
          this.cancelInput(!0, "cts.token.onCancellationRequested"),
        ),
      ),
      a.add(
        this._editor.onDidBlurEditorWidget(() =>
          this.cancelInput(
            !this._domNode?.ownerDocument.hasFocus(),
            "editor.onDidBlurEditorWidget",
          ),
        ),
      ),
      this._show(),
      l.p
    );
  }
  _requestRenameCandidates(e, t) {
    if (
      void 0 !== this._requestRenameCandidatesOnce &&
      (void 0 !== this._renameCandidateProvidersCts &&
        this._renameCandidateProvidersCts.dispose(!0),
      pR(this._renameCts),
      "stop" !== this._inputWithButton.buttonState)
    ) {
      this._renameCandidateProvidersCts = new cM();
      const n = t ? N2.Invoke : N2.Automatic,
        i = this._requestRenameCandidatesOnce(n, this._renameCandidateProvidersCts.token);
      if (0 === i.length) return void this._inputWithButton.setSparkleButton();
      (t || (this._hadAutomaticRenameSuggestionsInvocation = !0),
        (this._nRenameSuggestionsInvocations += 1),
        this._inputWithButton.setStopButton(),
        this._updateRenameCandidates(i, e, this._renameCts.token));
    }
  }
  _getSelection(e, t) {
    pR(this._editor.hasModel());
    const n = this._editor.getSelection();
    let i = 0,
      r = t.length;
    return (
      YH.isEmpty(n) ||
        YH.spansMultipleLines(n) ||
        !YH.containsRange(e, n) ||
        ((i = Math.max(0, n.startColumn - e.startColumn)),
        (r = Math.min(e.endColumn, n.endColumn) - e.startColumn)),
      { start: i, end: r }
    );
  }
  _show() {
    (this._trace("invoking _show"),
      this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber, 0),
      (this._visible = !0),
      this._visibleContextKey.set(!0),
      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(e, t, n) {
    const i = (...e) => this._trace("_updateRenameCandidates", ...e);
    i("start");
    const r = await pM(Promise.allSettled(e), n);
    if ((this._inputWithButton.setSparkleButton(), void 0 === r))
      return void i("returning early - received updateRenameCandidates results - undefined");
    const o = r.flatMap((e) => ("fulfilled" === e.status && hR(e.value) ? e.value : []));
    i(`received updateRenameCandidates results - total (unfiltered) ${o.length} candidates.`);
    const s = lj(o, (e) => e.newSymbolName);
    i(`distinct candidates - ${s.length} candidates.`);
    const a = s.filter(
      ({ newSymbolName: e }) =>
        e.trim().length > 0 &&
        e !== this._inputWithButton.input.value &&
        e !== t &&
        !this._candidates.has(e),
    );
    (i(`valid distinct candidates - ${o.length} candidates.`),
      a.forEach((e) => this._candidates.add(e.newSymbolName)),
      a.length < 1
        ? i("returning early - no valid distinct candidates")
        : (i("setting candidates"),
          this._renameCandidateListView.setCandidates(a),
          i("asking editor to re-layout"),
          this._editor.layoutContentWidget(this)));
  }
  _hide() {
    (this._trace("invoked _hide"),
      (this._visible = !1),
      this._visibleContextKey.reset(),
      this._editor.layoutContentWidget(this));
  }
  _getTopForPosition() {
    const e = this._editor.getVisibleRanges();
    let t;
    return (
      e.length > 0
        ? (t = e[0].startLineNumber)
        : (this._logService.warn(
            "RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty",
          ),
          (t = Math.max(1, this._position.lineNumber - 5))),
      this._editor.getTopForLineNumber(this._position.lineNumber) -
        this._editor.getTopForLineNumber(t)
    );
  }
  _trace(...e) {
    this._logService.trace("RenameWidget", ...e);
  }
};
GAe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([qAe(2, h0), qAe(3, N5), qAe(4, xW), qAe(5, yH)], GAe);
class ZAe {
  constructor(e, t) {
    ((this._disposables = new AO()),
      (this._availableHeight = 0),
      (this._minimumWidth = 0),
      (this._lineHeight = t.fontInfo.lineHeight),
      (this._typicalHalfwidthCharacterWidth = t.fontInfo.typicalHalfwidthCharacterWidth),
      (this._listContainer = document.createElement("div")),
      (this._listContainer.className = "rename-box rename-candidate-list-container"),
      e.appendChild(this._listContainer),
      (this._listWidget = ZAe._createListWidget(
        this._listContainer,
        this._candidateViewHeight,
        t.fontInfo,
      )),
      this._disposables.add(
        this._listWidget.onDidChangeFocus((e) => {
          1 === e.elements.length && t.onFocusChange(e.elements[0].newSymbolName);
        }, this._disposables),
      ),
      this._disposables.add(
        this._listWidget.onDidChangeSelection((e) => {
          1 === e.elements.length && t.onSelectionChange();
        }, this._disposables),
      ),
      this._disposables.add(
        this._listWidget.onDidBlur((e) => {
          this._listWidget.setFocus([]);
        }),
      ),
      this._listWidget.style(
        _ue({ listInactiveFocusForeground: VX, listInactiveFocusBackground: HX }),
      ));
  }
  dispose() {
    (this._listWidget.dispose(), this._disposables.dispose());
  }
  layout({ height: e, width: t }) {
    ((this._availableHeight = e), (this._minimumWidth = t));
  }
  setCandidates(e) {
    this._listWidget.splice(0, 0, e);
    const t = this._pickListHeight(this._listWidget.length),
      n = this._pickListWidth(e);
    (this._listWidget.layout(t, n),
      (this._listContainer.style.height = `${t}px`),
      (this._listContainer.style.width = `${n}px`),
      fV(SI(1394, "Received {0} rename suggestions", e.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 (0 === this._listWidget.length) return;
    const e = this._listWidget.getSelectedElements()[0];
    if (void 0 !== e) return e.newSymbolName;
    const t = this._listWidget.getFocusedElements()[0];
    return void 0 !== t ? t.newSymbolName : void 0;
  }
  focusNext() {
    if (0 === this._listWidget.length) return !1;
    const e = this._listWidget.getFocus();
    if (0 === e.length) return (this._listWidget.focusFirst(), this._listWidget.reveal(0), !0);
    if (e[0] === this._listWidget.length - 1)
      return (this._listWidget.setFocus([]), this._listWidget.reveal(0), !1);
    {
      this._listWidget.focusNext();
      const e = this._listWidget.getFocus()[0];
      return (this._listWidget.reveal(e), !0);
    }
  }
  focusPrevious() {
    if (0 === this._listWidget.length) return !1;
    const e = this._listWidget.getFocus();
    if (0 === e.length) {
      this._listWidget.focusLast();
      const e = this._listWidget.getFocus()[0];
      return (this._listWidget.reveal(e), !0);
    }
    if (0 === e[0]) return (this._listWidget.setFocus([]), !1);
    {
      this._listWidget.focusPrevious();
      const e = this._listWidget.getFocus()[0];
      return (this._listWidget.reveal(e), !0);
    }
  }
  clearFocus() {
    this._listWidget.setFocus([]);
  }
  get _candidateViewHeight() {
    const { totalHeight: e } = XAe.getLayoutInfo({ lineHeight: this._lineHeight });
    return e;
  }
  _pickListHeight(e) {
    const t = this._candidateViewHeight * e;
    return Math.min(t, this._availableHeight, 7 * this._candidateViewHeight);
  }
  _pickListWidth(e) {
    const t = Math.ceil(
      Math.max(...e.map((e) => e.newSymbolName.length)) * this._typicalHalfwidthCharacterWidth,
    );
    return Math.max(this._minimumWidth, 25 + t + 10);
  }
  static _createListWidget(e, t, n) {
    const i = new (class {
        getTemplateId(e) {
          return "candidate";
        }
        getHeight(e) {
          return t;
        }
      })(),
      r = new (class {
        constructor() {
          this.templateId = "candidate";
        }
        renderTemplate(e) {
          return new XAe(e, n);
        }
        renderElement(e, t, n) {
          n.populate(e);
        }
        disposeTemplate(e) {
          e.dispose();
        }
      })();
    return new gle("NewSymbolNameCandidates", e, i, [r], {
      keyboardSupport: !1,
      mouseSupport: !0,
      multipleSelectionSupport: !1,
    });
  }
}
class YAe {
  constructor() {
    ((this._buttonHoverContent = ""),
      (this._onDidInputChange = new QO()),
      (this.onDidInputChange = this._onDidInputChange.event),
      (this._disposables = new AO()));
  }
  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",
          SI(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 = SI(1396, "Generate New Name Suggestions")),
        (this._buttonCancelHoverText = SI(1397, "Cancel")),
        (this._buttonHoverContent = this._buttonGenHoverText),
        this._disposables.add(
          yae().setupDelayedHover(this._buttonNode, () => ({
            content: this._buttonHoverContent,
            style: 1,
          })),
        ),
        this._domNode.appendChild(this._buttonNode),
        this._disposables.add($F(this.input, DB.INPUT, () => this._onDidInputChange.fire())),
        this._disposables.add(
          $F(this.input, DB.KEY_DOWN, (e) => {
            const t = new wO(e);
            (15 !== t.keyCode && 17 !== t.keyCode) || this._onDidInputChange.fire();
          }),
        ),
        this._disposables.add($F(this.input, DB.CLICK, () => this._onDidInputChange.fire())),
        this._disposables.add(
          $F(this.input, DB.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(
          $F(this.input, DB.BLUR, () => {
            this.domNode.style.outline = "none";
          }),
        )),
      this._domNode
    );
  }
  get input() {
    return (pR(this._inputNode), this._inputNode);
  }
  get button() {
    return (pR(this._buttonNode), this._buttonNode);
  }
  get buttonState() {
    return this._buttonState;
  }
  setSparkleButton() {
    ((this._buttonState = "sparkle"),
      (this._sparkleIcon ??= Hse(OV.sparkle)),
      zF(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 ??= Hse(OV.stopCircle)),
      zF(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();
  }
}
class XAe {
  static {
    this._PADDING = 2;
  }
  constructor(e, t) {
    ((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 = `${t.lineHeight}px`),
      (this._domNode.style.padding = `${XAe._PADDING}px`));
    const n = document.createElement("div");
    ((n.style.display = "flex"),
      (n.style.alignItems = "center"),
      (n.style.width = n.style.height = 0.8 * t.lineHeight + "px"),
      this._domNode.appendChild(n),
      (this._icon = Hse(OV.sparkle)),
      (this._icon.style.display = "none"),
      n.appendChild(this._icon),
      (this._label = document.createElement("div")),
      Vq(this._label, t),
      this._domNode.appendChild(this._label),
      e.appendChild(this._domNode));
  }
  populate(e) {
    (this._updateIcon(e), this._updateLabel(e));
  }
  _updateIcon(e) {
    const t = !!e.tags?.includes(E2.AIGenerated);
    this._icon.style.display = t ? "inherit" : "none";
  }
  _updateLabel(e) {
    this._label.innerText = e.newSymbolName;
  }
  static getLayoutInfo({ lineHeight: e }) {
    return { totalHeight: e + 2 * XAe._PADDING };
  }
  dispose() {}
}
var QAe,
  JAe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class ePe {
  constructor(e, t, n) {
    ((this.model = e),
      (this.position = t),
      (this._providerRenameIdx = 0),
      (this._providers = n.ordered(e)));
  }
  hasProvider() {
    return this._providers.length > 0;
  }
  async resolveRenameLocation(e) {
    const t = [];
    for (
      this._providerRenameIdx = 0;
      this._providerRenameIdx < this._providers.length;
      this._providerRenameIdx++
    ) {
      const n = this._providers[this._providerRenameIdx];
      if (!n.resolveRenameLocation) break;
      const i = await n.resolveRenameLocation(this.model, this.position, e);
      if (i) {
        if (!i.rejectReason) return i;
        t.push(i.rejectReason);
      }
    }
    this._providerRenameIdx = 0;
    const n = this.model.getWordAtPosition(this.position);
    return n
      ? {
          range: new YH(
            this.position.lineNumber,
            n.startColumn,
            this.position.lineNumber,
            n.endColumn,
          ),
          text: n.word,
          rejectReason: t.length > 0 ? t.join("\n") : void 0,
        }
      : {
          range: YH.fromPositions(this.position),
          text: "",
          rejectReason: t.length > 0 ? t.join("\n") : void 0,
        };
  }
  async provideRenameEdits(e, t) {
    return this._provideRenameEdits(e, this._providerRenameIdx, [], t);
  }
  async _provideRenameEdits(e, t, n, i) {
    const r = this._providers[t];
    if (!r) return { edits: [], rejectReason: n.join("\n") };
    const o = await r.provideRenameEdits(this.model, this.position, e, i);
    return o
      ? o.rejectReason
        ? this._provideRenameEdits(e, t + 1, n.concat(o.rejectReason), i)
        : o
      : this._provideRenameEdits(e, t + 1, n.concat(SI(1380, "No result.")), i);
  }
}
let tPe = class {
  static {
    QAe = this;
  }
  static {
    this.ID = "editor.contrib.renameController";
  }
  static get(e) {
    return e.getContribution(QAe.ID);
  }
  constructor(e, t, n, i, r, o, s, a) {
    ((this.editor = e),
      (this._instaService = t),
      (this._notificationService = n),
      (this._bulkEditService = i),
      (this._progressService = r),
      (this._logService = o),
      (this._configService = s),
      (this._languageFeaturesService = a),
      (this._disposableStore = new AO()),
      (this._cts = new cM()),
      (this._renameWidget = this._disposableStore.add(
        this._instaService.createInstance(GAe, this.editor, [
          "acceptRenameInput",
          "acceptRenameInputWithPreview",
        ]),
      )));
  }
  dispose() {
    (this._disposableStore.dispose(), this._cts.dispose(!0));
  }
  async run() {
    const e = this._logService.trace.bind(this._logService, "[rename]");
    if ((this._cts.dispose(!0), (this._cts = new cM()), !this.editor.hasModel()))
      return void e("editor has no model");
    const t = this.editor.getPosition(),
      n = new ePe(this.editor.getModel(), t, this._languageFeaturesService.renameProvider);
    if (!n.hasProvider()) return void e("skeleton has no provider");
    const i = new uge(this.editor, 5, void 0, this._cts.token);
    let r;
    try {
      e("resolving rename location");
      const t = n.resolveRenameLocation(i.token);
      (this._progressService.showWhile(t, 250), (r = await t), e("resolved rename location"));
    } catch (spt) {
      return void (spt instanceof KI
        ? e("resolve rename location cancelled", JSON.stringify(spt, null, "\t"))
        : (e(
            "resolve rename location failed",
            spt instanceof Error ? spt : JSON.stringify(spt, null, "\t"),
          ),
          ("string" == typeof spt || sre(spt)) &&
            Cge.get(this.editor)?.showMessage(
              spt || SI(1381, "An unknown error occurred while resolving rename location"),
              t,
            )));
    } finally {
      i.dispose();
    }
    if (!r) return void e("returning early - no loc");
    if (r.rejectReason)
      return (
        e(`returning early - rejected with reason: ${r.rejectReason}`, r.rejectReason),
        void Cge.get(this.editor)?.showMessage(r.rejectReason, t)
      );
    if (i.token.isCancellationRequested) return void e("returning early - cts1 cancelled");
    const o = new uge(this.editor, 5, r.range, this._cts.token),
      s = this.editor.getModel(),
      a = this._languageFeaturesService.newSymbolNamesProvider.all(s),
      l = await Promise.all(
        a.map(async (e) => [e, (await e.supportsAutomaticNewSymbolNamesTriggerKind) ?? !1]),
      );
    e("creating rename input field and awaiting its result");
    const c =
        this._bulkEditService.hasPreviewHandler() &&
        this._configService.getValue(this.editor.getModel().uri, "editor.rename.enablePreview"),
      d = await this._renameWidget.getInput(
        r.range,
        r.text,
        c,
        a.length > 0
          ? (e, t) => {
              let n = l.slice();
              return (
                e === N2.Automatic && (n = n.filter(([e, t]) => t)),
                n.map(([n]) => n.provideNewSymbolNames(s, r.range, e, t))
              );
            }
          : void 0,
        o,
      );
    if ((e("received response from rename input field"), "boolean" == typeof d))
      return (
        e(`returning early - rename input field response - ${d}`),
        d && this.editor.focus(),
        void o.dispose()
      );
    (this.editor.focus(), e("requesting rename edits"));
    const u = pM(n.provideRenameEdits(d.newName, o.token), o.token)
      .then(
        async (t) => {
          if (t)
            if (this.editor.hasModel()) {
              if (t.rejectReason)
                return (
                  e(`returning early - rejected with reason: ${t.rejectReason}`),
                  void this._notificationService.info(t.rejectReason)
                );
              (this.editor.setSelection(YH.fromPositions(this.editor.getSelection().getPosition())),
                e("applying edits"),
                this._bulkEditService
                  .apply(t, {
                    editor: this.editor,
                    showPreview: d.wantsPreview,
                    label: SI(1382, "Renaming '{0}' to '{1}'", r?.text, d.newName),
                    code: "undoredo.rename",
                    quotableLabel: SI(1383, "Renaming {0} to {1}", r?.text, d.newName),
                    respectAutoSaveConfig: !0,
                    reason: m8.rename(),
                  })
                  .then((t) => {
                    (e("edits applied"),
                      t.ariaSummary &&
                        pV(
                          SI(
                            1384,
                            "Successfully renamed '{0}' to '{1}'. Summary: {2}",
                            r.text,
                            d.newName,
                            t.ariaSummary,
                          ),
                        ));
                  })
                  .catch((t) => {
                    (e(`error when applying edits ${JSON.stringify(t, null, "\t")}`),
                      this._notificationService.error(SI(1385, "Rename failed to apply edits")),
                      this._logService.error(t));
                  }));
            } else e("returning early - no model after rename edits are provided");
          else e("returning early - no rename edits result");
        },
        (t) => {
          (e("error when providing rename edits", JSON.stringify(t, null, "\t")),
            this._notificationService.error(SI(1386, "Rename failed to compute edits")),
            this._logService.error(t));
        },
      )
      .finally(() => {
        o.dispose();
      });
    return (e("returning rename operation"), this._progressService.showWhile(u, 250), u);
  }
  acceptRenameInput(e) {
    this._renameWidget.acceptInput(e);
  }
  cancelRenameInput() {
    this._renameWidget.cancelInput(!0, "cancelRenameInput command");
  }
  focusNextRenameSuggestion() {
    this._renameWidget.focusNextRenameSuggestion();
  }
  focusPreviousRenameSuggestion() {
    this._renameWidget.focusPreviousRenameSuggestion();
  }
};
tPe = QAe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([JAe(1, vV), JAe(2, Y4), JAe(3, ige), JAe(4, One), JAe(5, yH), JAe(6, UAe), JAe(7, mee)], tPe);
(zH(tPe.ID, tPe, 4),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.rename",
          label: EI(1388, "Rename Symbol"),
          precondition: eW.and($$.writable, $$.hasRenameProvider),
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 60, weight: 100 },
          contextMenuOpts: { group: "1_modification", order: 1.1 },
          canTriggerInlineEdits: !0,
        });
      }
      runCommand(e, t) {
        const n = e.get(yV),
          [i, r] = (Array.isArray(t) && t) || [void 0, void 0];
        return mP.isUri(i) && xV.isIPosition(r)
          ? n.openCodeEditor({ resource: i }, n.getActiveCodeEditor()).then((e) => {
              e &&
                (e.setPosition(r),
                e.invokeWithinContext((t) => (this.reportTelemetry(t, e), this.run(t, e))));
            }, HI)
          : super.runCommand(e, t);
      }
      run(e, t) {
        const n = e.get(yH),
          i = tPe.get(t);
        return i
          ? (n.trace("[RenameAction] got controller, running..."), i.run())
          : (n.trace("[RenameAction] returning early - controller missing"), Promise.resolve());
      }
    },
  ));
const nPe = MH.bindToContribution(tPe.get);
(BH(
  new nPe({
    id: "acceptRenameInput",
    precondition: KAe,
    handler: (e) => e.acceptRenameInput(!1),
    kbOpts: { weight: 199, kbExpr: eW.and($$.focus, eW.not("isComposing")), primary: 3 },
  }),
),
  BH(
    new nPe({
      id: "acceptRenameInputWithPreview",
      precondition: eW.and(KAe, eW.has("config.editor.rename.enablePreview")),
      handler: (e) => e.acceptRenameInput(!0),
      kbOpts: { weight: 199, kbExpr: eW.and($$.focus, eW.not("isComposing")), primary: 2051 },
    }),
  ),
  BH(
    new nPe({
      id: "cancelRenameInput",
      precondition: KAe,
      handler: (e) => e.cancelRenameInput(),
      kbOpts: { weight: 199, kbExpr: $$.focus, primary: 9, secondary: [1033] },
    }),
  ),
  WW(
    class extends VW {
      constructor() {
        super({
          id: "focusNextRenameSuggestion",
          title: { ...EI(1389, "Focus Next Rename Suggestion") },
          precondition: KAe,
          keybinding: [{ primary: 18, weight: 199 }],
        });
      }
      run(e) {
        const t = e.get(yV).getFocusedCodeEditor();
        if (!t) return;
        const n = tPe.get(t);
        n && n.focusNextRenameSuggestion();
      }
    },
  ),
  WW(
    class extends VW {
      constructor() {
        super({
          id: "focusPreviousRenameSuggestion",
          title: { ...EI(1390, "Focus Previous Rename Suggestion") },
          precondition: KAe,
          keybinding: [{ primary: 16, weight: 199 }],
        });
      }
      run(e) {
        const t = e.get(yV).getFocusedCodeEditor();
        if (!t) return;
        const n = tPe.get(t);
        n && n.focusPreviousRenameSuggestion();
      }
    },
  ),
  FH("_executeDocumentRenameProvider", function (e, t, n, ...i) {
    const [r] = i;
    pR("string" == typeof r);
    const { renameProvider: o } = e.get(mee);
    return (async function (e, t, n, i) {
      const r = new ePe(t, n, e),
        o = await r.resolveRenameLocation(aM.None);
      return o?.rejectReason
        ? { edits: [], rejectReason: o.rejectReason }
        : r.provideRenameEdits(i, aM.None);
    })(o, t, n, r);
  }),
  FH("_executePrepareRename", async function (e, t, n) {
    const { renameProvider: i } = e.get(mee),
      r = new ePe(t, n, i),
      o = await r.resolveRenameLocation(aM.None);
    if (o?.rejectReason) throw new Error(o.rejectReason);
    return o;
  }),
  NW.as(YU).registerConfiguration({
    id: "editor",
    properties: {
      "editor.rename.enablePreview": {
        scope: 6,
        description: SI(1387, "Enable/disable the ability to preview changes before renaming"),
        default: !0,
        type: "boolean",
      },
    },
  }));
var iPe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let rPe = class extends PO {
  static {
    this.ID = "editor.sectionHeaderDetector";
  }
  constructor(e, t, n) {
    (super(),
      (this.editor = e),
      (this.languageConfigurationService = t),
      (this.editorWorkerService = n),
      (this.decorations = this.editor.createDecorationsCollection()),
      (this.options = this.createOptions(e.getOption(81))),
      (this.computePromise = null),
      (this.currentOccurrences = {}),
      this._register(
        e.onDidChangeModel((t) => {
          ((this.currentOccurrences = {}),
            (this.options = this.createOptions(e.getOption(81))),
            this.stop(),
            this.computeSectionHeaders.schedule(0));
        }),
      ),
      this._register(
        e.onDidChangeModelLanguage((t) => {
          ((this.currentOccurrences = {}),
            (this.options = this.createOptions(e.getOption(81))),
            this.stop(),
            this.computeSectionHeaders.schedule(0));
        }),
      ),
      this._register(
        t.onDidChange((t) => {
          const n = this.editor.getModel()?.getLanguageId();
          n &&
            t.affects(n) &&
            ((this.currentOccurrences = {}),
            (this.options = this.createOptions(e.getOption(81))),
            this.stop(),
            this.computeSectionHeaders.schedule(0));
        }),
      ),
      this._register(
        e.onDidChangeConfiguration((t) => {
          (this.options && !t.hasChanged(81)) ||
            ((this.options = this.createOptions(e.getOption(81))),
            this.updateDecorations([]),
            this.stop(),
            this.computeSectionHeaders.schedule(0));
        }),
      ),
      this._register(
        this.editor.onDidChangeModelContent((e) => {
          this.computeSectionHeaders.schedule();
        }),
      ),
      this._register(
        e.onDidChangeModelTokens((e) => {
          this.computeSectionHeaders.isScheduled() || this.computeSectionHeaders.schedule(1e3);
        }),
      ),
      (this.computeSectionHeaders = this._register(
        new EM(() => {
          this.findSectionHeaders();
        }, 250),
      )),
      this.computeSectionHeaders.schedule(0));
  }
  createOptions(e) {
    if (!e || !this.editor.hasModel()) return;
    const t = this.editor.getModel().getLanguageId();
    if (!t) return;
    const n = this.languageConfigurationService.getLanguageConfiguration(t).comments,
      i = this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;
    return n || i?.markers
      ? {
          foldingRules: i,
          markSectionHeaderRegex: e.markSectionHeaderRegex,
          findMarkSectionHeaders: e.showMarkSectionHeaders,
          findRegionSectionHeaders: e.showRegionSectionHeaders,
        }
      : void 0;
  }
  findSectionHeaders() {
    if (
      !this.editor.hasModel() ||
      (!this.options?.findMarkSectionHeaders && !this.options?.findRegionSectionHeaders)
    )
      return;
    const e = this.editor.getModel();
    if (e.isDisposed() || e.isTooLargeForSyncing()) return;
    const t = e.getVersionId();
    this.editorWorkerService.findSectionHeaders(e.uri, this.options).then((n) => {
      e.isDisposed() || e.getVersionId() !== t || this.updateDecorations(n);
    });
  }
  updateDecorations(e) {
    const t = this.editor.getModel();
    t &&
      (e = e.filter((e) => {
        if (!e.shouldBeInComments) return !0;
        const n = t.validateRange(e.range),
          i = t.tokenization.getLineTokens(n.startLineNumber),
          r = i.findTokenIndexAtOffset(n.startColumn - 1),
          o = i.getStandardTokenType(r);
        return i.getLanguageId(r) === t.getLanguageId() && 1 === o;
      }));
    const n = Object.values(this.currentOccurrences).map((e) => e.decorationId),
      i = e.map((e) =>
        (function (e) {
          return {
            range: e.range,
            options: cee.createDynamic({
              description: "section-header",
              stickiness: 3,
              collapseOnReplaceEdit: !0,
              minimap: {
                color: void 0,
                position: 1,
                sectionHeaderStyle: e.hasSeparatorLine ? 2 : 1,
                sectionHeaderText: e.text,
              },
            }),
          };
        })(e),
      );
    this.editor.changeDecorations((t) => {
      const r = t.deltaDecorations(n, i);
      this.currentOccurrences = {};
      for (let n = 0, i = r.length; n < i; n++) {
        const t = { sectionHeader: e[n], decorationId: r[n] };
        this.currentOccurrences[t.decorationId] = t;
      }
    });
  }
  stop() {
    (this.computeSectionHeaders.cancel(),
      this.computePromise && (this.computePromise.cancel(), (this.computePromise = null)));
  }
  dispose() {
    (super.dispose(), this.stop(), this.decorations.clear());
  }
};
((rPe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([iPe(1, f$), iPe(2, Dce)], rPe)),
  zH(rPe.ID, rPe, 1));
class oPe {
  constructor(e = 5) {
    ((this.timesPerSecond = e), (this._lastRun = 0), (this._minimumTimeBetweenRuns = 1e3 / e));
  }
  runIfNotLimited(e) {
    const t = Date.now();
    t - this._lastRun >= this._minimumTimeBetweenRuns && ((this._lastRun = t), e());
  }
}
class sPe {
  static create(e, t) {
    return new sPe(e, new aPe(t));
  }
  get startLineNumber() {
    return this._startLineNumber;
  }
  get endLineNumber() {
    return this._endLineNumber;
  }
  constructor(e, t) {
    ((this._startLineNumber = e),
      (this._tokens = t),
      (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(e) {
    return this._startLineNumber <= e && e <= this._endLineNumber
      ? this._tokens.getLineTokens(e - this._startLineNumber)
      : null;
  }
  getRange() {
    const e = this._tokens.getRange();
    return e
      ? new YH(
          this._startLineNumber + e.startLineNumber,
          e.startColumn,
          this._startLineNumber + e.endLineNumber,
          e.endColumn,
        )
      : e;
  }
  removeTokens(e) {
    const t = e.startLineNumber - this._startLineNumber,
      n = e.endLineNumber - this._startLineNumber;
    ((this._startLineNumber += this._tokens.removeTokens(t, e.startColumn - 1, n, e.endColumn - 1)),
      this._updateEndLineNumber());
  }
  split(e) {
    const t = e.startLineNumber - this._startLineNumber,
      n = e.endLineNumber - this._startLineNumber,
      [i, r, o] = this._tokens.split(t, e.startColumn - 1, n, e.endColumn - 1);
    return [new sPe(this._startLineNumber, i), new sPe(this._startLineNumber + o, r)];
  }
  applyEdit(e, t) {
    const [n, i, r] = Q3(t);
    this.acceptEdit(e, n, i, r, t.length > 0 ? t.charCodeAt(0) : 0);
  }
  acceptEdit(e, t, n, i, r) {
    (this._acceptDeleteRange(e),
      this._acceptInsertText(new xV(e.startLineNumber, e.startColumn), t, n, i, r),
      this._updateEndLineNumber());
  }
  _acceptDeleteRange(e) {
    if (e.startLineNumber === e.endLineNumber && e.startColumn === e.endColumn) return;
    const t = e.startLineNumber - this._startLineNumber,
      n = e.endLineNumber - this._startLineNumber;
    if (n < 0) {
      const e = n - t;
      return void (this._startLineNumber -= e);
    }
    const i = this._tokens.getMaxDeltaLine();
    if (!(t >= i + 1)) {
      if (t < 0 && n >= i + 1) return ((this._startLineNumber = 0), void this._tokens.clear());
      if (t < 0) {
        const i = -t;
        ((this._startLineNumber -= i),
          this._tokens.acceptDeleteRange(e.startColumn - 1, 0, 0, n, e.endColumn - 1));
      } else this._tokens.acceptDeleteRange(0, t, e.startColumn - 1, n, e.endColumn - 1);
    }
  }
  _acceptInsertText(e, t, n, i, r) {
    if (0 === t && 0 === n) return;
    const o = e.lineNumber - this._startLineNumber;
    if (o < 0) return void (this._startLineNumber += t);
    o >= this._tokens.getMaxDeltaLine() + 1 ||
      this._tokens.acceptInsertText(o, e.column - 1, t, n, i, r);
  }
  reportIfInvalid(e) {
    this._tokens.reportIfInvalid(e, this._startLineNumber);
  }
}
class aPe {
  constructor(e) {
    ((this._tokens = e), (this._tokenCount = e.length / 4));
  }
  toString(e) {
    const t = [];
    for (let n = 0; n < this._tokenCount; n++)
      t.push(
        `(${this._getDeltaLine(n) + e},${this._getStartCharacter(n)}-${this._getEndCharacter(n)})`,
      );
    return `[${t.join(",")}]`;
  }
  getMaxDeltaLine() {
    const e = this._getTokenCount();
    return 0 === e ? -1 : this._getDeltaLine(e - 1);
  }
  getRange() {
    const e = this._getTokenCount();
    if (0 === e) return null;
    const t = this._getStartCharacter(0),
      n = this._getDeltaLine(e - 1),
      i = this._getEndCharacter(e - 1);
    return new YH(0, t + 1, n, i + 1);
  }
  _getTokenCount() {
    return this._tokenCount;
  }
  _getDeltaLine(e) {
    return this._tokens[4 * e];
  }
  _getStartCharacter(e) {
    return this._tokens[4 * e + 1];
  }
  _getEndCharacter(e) {
    return this._tokens[4 * e + 2];
  }
  isEmpty() {
    return 0 === this._getTokenCount();
  }
  getLineTokens(e) {
    let t = 0,
      n = this._getTokenCount() - 1;
    for (; t < n; ) {
      const i = t + Math.floor((n - t) / 2),
        r = this._getDeltaLine(i);
      if (r < e) t = i + 1;
      else {
        if (!(r > e)) {
          let r = i;
          for (; r > t && this._getDeltaLine(r - 1) === e; ) r--;
          let o = i;
          for (; o < n && this._getDeltaLine(o + 1) === e; ) o++;
          return new lPe(this._tokens.subarray(4 * r, 4 * o + 4));
        }
        n = i - 1;
      }
    }
    return this._getDeltaLine(t) === e ? new lPe(this._tokens.subarray(4 * t, 4 * t + 4)) : null;
  }
  clear() {
    this._tokenCount = 0;
  }
  removeTokens(e, t, n, i) {
    const r = this._tokens,
      o = this._tokenCount;
    let s = 0,
      a = !1,
      l = 0;
    for (let c = 0; c < o; c++) {
      const o = 4 * c,
        d = r[o],
        u = r[o + 1],
        h = r[o + 2],
        g = r[o + 3];
      if ((d > e || (d === e && h >= t)) && (d < n || (d === n && u <= i))) a = !0;
      else {
        if ((0 === s && (l = d), a)) {
          const e = 4 * s;
          ((r[e] = d - l), (r[e + 1] = u), (r[e + 2] = h), (r[e + 3] = g));
        } else 0 !== l && (r[o] = d - l);
        s++;
      }
    }
    return ((this._tokenCount = s), l);
  }
  split(e, t, n, i) {
    const r = this._tokens,
      o = this._tokenCount,
      s = [],
      a = [];
    let l = s,
      c = 0,
      d = 0;
    for (let u = 0; u < o; u++) {
      const o = 4 * u,
        s = r[o],
        h = r[o + 1],
        g = r[o + 2],
        p = r[o + 3];
      if (s > e || (s === e && g >= t)) {
        if (s < n || (s === n && h <= i)) continue;
        l !== a && ((l = a), (c = 0), (d = s));
      }
      ((l[c++] = s - d), (l[c++] = h), (l[c++] = g), (l[c++] = p));
    }
    return [new aPe(new Uint32Array(s)), new aPe(new Uint32Array(a)), d];
  }
  acceptDeleteRange(e, t, n, i, r) {
    const o = this._tokens,
      s = this._tokenCount,
      a = i - t;
    let l = 0,
      c = !1;
    for (let d = 0; d < s; d++) {
      const u = 4 * d;
      let h = o[u],
        g = o[u + 1],
        p = o[u + 2];
      const f = o[u + 3];
      if (h < t || (h === t && p <= n)) {
        l++;
        continue;
      }
      if (h === t && g < n) h === i && p > r ? (p -= r - n) : (p = n);
      else if (h === t && g === n) {
        if (!(h === i && p > r)) {
          c = !0;
          continue;
        }
        p -= r - n;
      } else if (h < i || (h === i && g < r)) {
        if (!(h === i && p > r)) {
          c = !0;
          continue;
        }
        ((h = t), (g = n), (p = g + (p - r)));
      } else if (h > i) {
        if (0 === a && !c) {
          l = s;
          break;
        }
        h -= a;
      } else {
        if (!(h === i && g >= r)) throw new Error("Not possible!");
        (e && 0 === h && ((g += e), (p += e)), (h -= a), (g -= r - n), (p -= r - n));
      }
      const m = 4 * l;
      ((o[m] = h), (o[m + 1] = g), (o[m + 2] = p), (o[m + 3] = f), l++);
    }
    this._tokenCount = l;
  }
  acceptInsertText(e, t, n, i, r, o) {
    const s =
        0 === n &&
        1 === i &&
        ((o >= 48 && o <= 57) || (o >= 65 && o <= 90) || (o >= 97 && o <= 122)),
      a = this._tokens,
      l = this._tokenCount;
    for (let c = 0; c < l; c++) {
      const o = 4 * c;
      let l = a[o],
        d = a[o + 1],
        u = a[o + 2];
      if (!(l < e || (l === e && u < t))) {
        if (l === e && u === t) {
          if (!s) continue;
          u += 1;
        } else if (l === e && d < t && t < u) 0 === n ? (u += i) : (u = t);
        else {
          if (l === e && d === t && s) continue;
          if (l === e)
            if (((l += n), 0 === n)) ((d += i), (u += i));
            else {
              const e = u - d;
              ((d = r + (d - t)), (u = d + e));
            }
          else l += n;
        }
        ((a[o] = l), (a[o + 1] = d), (a[o + 2] = u));
      }
    }
  }
  static {
    this._rateLimiter = new oPe(10 / 60);
  }
  reportIfInvalid(e, t) {
    for (let n = 0; n < this._tokenCount; n++) {
      const i = this._getDeltaLine(n) + t;
      (i < 1 || i > e.getLineCount() || this._getEndCharacter(n) > e.getLineLength(i)) &&
        aPe._rateLimiter.runIfNotLimited(() => {});
    }
  }
}
class lPe {
  constructor(e) {
    this._tokens = e;
  }
  getCount() {
    return this._tokens.length / 4;
  }
  getStartCharacter(e) {
    return this._tokens[4 * e + 1];
  }
  getEndCharacter(e) {
    return this._tokens[4 * e + 2];
  }
  getMetadata(e) {
    return this._tokens[4 * e + 3];
  }
}
var cPe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let dPe = class {
  constructor(e, t, n, i) {
    ((this._legend = e),
      (this._themeService = t),
      (this._languageService = n),
      (this._logService = i),
      (this._hasWarnedOverlappingTokens = !1),
      (this._hasWarnedInvalidLengthTokens = !1),
      (this._hasWarnedInvalidEditStart = !1),
      (this._hashTable = new gPe()));
  }
  getMetadata(e, t, n) {
    const i = this._languageService.languageIdCodec.encodeLanguageId(n),
      r = this._hashTable.get(e, t, i);
    let o;
    if (r) o = r.metadata;
    else {
      let r = this._legend.tokenTypes[e];
      const s = [];
      if (r) {
        let e = t;
        for (let t = 0; e > 0 && t < this._legend.tokenModifiers.length; t++)
          (1 & e && s.push(this._legend.tokenModifiers[t]), (e >>= 1));
        const i = this._themeService.getColorTheme().getTokenStyleMetadata(r, s, n);
        if (void 0 === i) o = 2147483647;
        else {
          if (((o = 0), void 0 !== i.italic)) {
            o |= 1 | ((i.italic ? 1 : 0) << 11);
          }
          if (void 0 !== i.bold) {
            o |= 2 | ((i.bold ? 2 : 0) << 11);
          }
          if (void 0 !== i.underline) {
            o |= 4 | ((i.underline ? 4 : 0) << 11);
          }
          if (void 0 !== i.strikethrough) {
            o |= 8 | ((i.strikethrough ? 8 : 0) << 11);
          }
          if (i.foreground) {
            o |= 16 | (i.foreground << 15);
          }
          0 === o && (o = 2147483647);
        }
      } else ((o = 2147483647), (r = "not-in-legend"));
      this._hashTable.add(e, t, i, o);
    }
    return o;
  }
  warnOverlappingSemanticTokens(e, t) {
    this._hasWarnedOverlappingTokens ||
      ((this._hasWarnedOverlappingTokens = !0),
      this._logService.warn(
        `Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`,
      ));
  }
  warnInvalidLengthSemanticTokens(e, t) {
    this._hasWarnedInvalidLengthTokens ||
      ((this._hasWarnedInvalidLengthTokens = !0),
      this._logService.warn(
        `Semantic token with invalid length detected at lineNumber ${e}, column ${t}`,
      ));
  }
  warnInvalidEditStart(e, t, n, i, r) {
    this._hasWarnedInvalidEditStart ||
      ((this._hasWarnedInvalidEditStart = !0),
      this._logService.warn(
        `Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${i} is outside the previous data (length ${r}).`,
      ));
  }
};
function uPe(e, t, n) {
  const i = e.data,
    r = (e.data.length / 5) | 0,
    o = Math.max(Math.ceil(r / 1024), 400),
    s = [];
  let a = 0,
    l = 1,
    c = 0;
  for (; a < r; ) {
    const e = a;
    let d = Math.min(e + o, r);
    if (d < r) {
      let t = d;
      for (; t - 1 > e && 0 === i[5 * t]; ) t--;
      if (t - 1 === e) {
        let e = d;
        for (; e + 1 < r && 0 === i[5 * e]; ) e++;
        d = e;
      } else d = t;
    }
    let u = new Uint32Array(4 * (d - e)),
      h = 0,
      g = 0,
      p = 0,
      f = 0;
    for (; a < d; ) {
      const e = 5 * a,
        r = i[e],
        o = i[e + 1],
        s = (l + r) | 0,
        d = 0 === r ? (c + o) | 0 : o,
        m = (d + i[e + 2]) | 0,
        _ = i[e + 3],
        v = i[e + 4];
      if (m <= d) t.warnInvalidLengthSemanticTokens(s, d + 1);
      else if (p === s && f > d) t.warnOverlappingSemanticTokens(s, d + 1);
      else {
        const e = t.getMetadata(_, v, n);
        2147483647 !== e &&
          (0 === g && (g = s),
          (u[h] = s - g),
          (u[h + 1] = d),
          (u[h + 2] = m),
          (u[h + 3] = e),
          (h += 4),
          (p = s),
          (f = m));
      }
      ((l = s), (c = d), a++);
    }
    h !== u.length && (u = u.subarray(0, h));
    const m = sPe.create(g, u);
    s.push(m);
  }
  return s;
}
dPe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([cPe(1, h0), cPe(2, BU), cPe(3, yH)], dPe);
class hPe {
  constructor(e, t, n, i) {
    ((this.tokenTypeIndex = e),
      (this.tokenModifierSet = t),
      (this.languageId = n),
      (this.metadata = i),
      (this.next = null));
  }
}
class gPe {
  static {
    this._SIZES = [
      3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139,
      524287, 1048573, 2097143,
    ];
  }
  constructor() {
    ((this._elementsCount = 0),
      (this._currentLengthIndex = 0),
      (this._currentLength = gPe._SIZES[this._currentLengthIndex]),
      (this._growCount = Math.round(
        this._currentLengthIndex + 1 < gPe._SIZES.length ? (2 / 3) * this._currentLength : 0,
      )),
      (this._elements = []),
      gPe._nullOutEntries(this._elements, this._currentLength));
  }
  static _nullOutEntries(e, t) {
    for (let n = 0; n < t; n++) e[n] = null;
  }
  _hash2(e, t) {
    return ((e << 5) - e + t) | 0;
  }
  _hashFunc(e, t, n) {
    return this._hash2(this._hash2(e, t), n) % this._currentLength;
  }
  get(e, t, n) {
    const i = this._hashFunc(e, t, n);
    let r = this._elements[i];
    for (; r; ) {
      if (r.tokenTypeIndex === e && r.tokenModifierSet === t && r.languageId === n) return r;
      r = r.next;
    }
    return null;
  }
  add(e, t, n, i) {
    if ((this._elementsCount++, 0 !== this._growCount && this._elementsCount >= this._growCount)) {
      const e = this._elements;
      (this._currentLengthIndex++,
        (this._currentLength = gPe._SIZES[this._currentLengthIndex]),
        (this._growCount = Math.round(
          this._currentLengthIndex + 1 < gPe._SIZES.length ? (2 / 3) * this._currentLength : 0,
        )),
        (this._elements = []),
        gPe._nullOutEntries(this._elements, this._currentLength));
      for (const t of e) {
        let e = t;
        for (; e; ) {
          const t = e.next;
          ((e.next = null), this._add(e), (e = t));
        }
      }
    }
    this._add(new hPe(e, t, n, i));
  }
  _add(e) {
    const t = this._hashFunc(e.tokenTypeIndex, e.tokenModifierSet, e.languageId);
    ((e.next = this._elements[t]), (this._elements[t] = e));
  }
}
const pPe = bV("semanticTokensStylingService");
function fPe(e) {
  const t = new Uint32Array(
    (function (e) {
      let t = 0;
      if (((t += 2), "full" === e.type)) t += 1 + e.data.length;
      else {
        ((t += 1), (t += 3 * e.deltas.length));
        for (const n of e.deltas) n.data && (t += n.data.length);
      }
      return t;
    })(e),
  );
  let n = 0;
  if (((t[n++] = e.id), "full" === e.type))
    ((t[n++] = 1), (t[n++] = e.data.length), t.set(e.data, n), (n += e.data.length));
  else {
    ((t[n++] = 2), (t[n++] = e.deltas.length));
    for (const i of e.deltas)
      ((t[n++] = i.start),
        (t[n++] = i.deleteCount),
        i.data ? ((t[n++] = i.data.length), t.set(i.data, n), (n += i.data.length)) : (t[n++] = 0));
  }
  return (function (e) {
    const t = new Uint8Array(e.buffer, e.byteOffset, 4 * e.length);
    return (
      XR() ||
        (function (e) {
          for (let t = 0, n = e.length; t < n; t += 4) {
            const n = e[t + 0],
              i = e[t + 1],
              r = e[t + 2],
              o = e[t + 3];
            ((e[t + 0] = o), (e[t + 1] = r), (e[t + 2] = i), (e[t + 3] = n));
          }
        })(t),
      PP.wrap(t)
    );
  })(t);
}
function mPe(e) {
  return e && !!e.data;
}
function _Pe(e) {
  return e && Array.isArray(e.edits);
}
class vPe {
  constructor(e, t, n) {
    ((this.provider = e), (this.tokens = t), (this.error = n));
  }
}
function bPe(e, t) {
  return e.has(t);
}
async function yPe(e, t, n, i, r) {
  const o = (function (e, t) {
      const n = e.orderedGroups(t);
      return n.length > 0 ? n[0] : [];
    })(e, t),
    s = await Promise.all(
      o.map(async (e) => {
        let o,
          s = null;
        try {
          o = await e.provideDocumentSemanticTokens(t, e === n ? i : null, r);
        } catch (a) {
          ((s = a), (o = null));
        }
        return ((o && (mPe(o) || _Pe(o))) || (o = null), new vPe(e, o, s));
      }),
    );
  for (const a of s) {
    if (a.error) throw a.error;
    if (a.tokens) return a;
  }
  return s.length > 0 ? s[0] : null;
}
class xPe {
  constructor(e, t) {
    ((this.provider = e), (this.tokens = t));
  }
}
function wPe(e, t) {
  const n = e.orderedGroups(t);
  return n.length > 0 ? n[0] : [];
}
async function CPe(e, t, n, i) {
  const r = wPe(e, t),
    o = await Promise.all(
      r.map(async (e) => {
        let r;
        try {
          r = await e.provideDocumentRangeSemanticTokens(t, n, i);
        } catch (o) {
          (zI(o), (r = null));
        }
        return ((r && mPe(r)) || (r = null), new xPe(e, r));
      }),
    );
  for (const s of o) if (s.tokens) return s;
  return o.length > 0 ? o[0] : null;
}
(jV.registerCommand("_provideDocumentSemanticTokensLegend", async (e, ...t) => {
  const [n] = t;
  pR(n instanceof mP);
  const i = e.get(wV).getModel(n);
  if (!i) return;
  const { documentSemanticTokensProvider: r } = e.get(mee),
    o = (function (e, t) {
      const n = e.orderedGroups(t);
      return n.length > 0 ? n[0] : null;
    })(r, i);
  return o
    ? o[0].getLegend()
    : e.get(PV).executeCommand("_provideDocumentRangeSemanticTokensLegend", n);
}),
  jV.registerCommand("_provideDocumentSemanticTokens", async (e, ...t) => {
    const [n] = t;
    pR(n instanceof mP);
    const i = e.get(wV).getModel(n);
    if (!i) return;
    const { documentSemanticTokensProvider: r } = e.get(mee);
    if (!bPe(r, i))
      return e
        .get(PV)
        .executeCommand("_provideDocumentRangeSemanticTokens", n, i.getFullModelRange());
    const o = await yPe(r, i, null, null, aM.None);
    if (!o) return;
    const { provider: s, tokens: a } = o;
    if (!a || !mPe(a)) return;
    const l = fPe({ id: 0, type: "full", data: a.data });
    return (a.resultId && s.releaseDocumentSemanticTokens(a.resultId), l);
  }),
  jV.registerCommand("_provideDocumentRangeSemanticTokensLegend", async (e, ...t) => {
    const [n, i] = t;
    pR(n instanceof mP);
    const r = e.get(wV).getModel(n);
    if (!r) return;
    const { documentRangeSemanticTokensProvider: o } = e.get(mee),
      s = wPe(o, r);
    if (0 === s.length) return;
    if (1 === s.length) return s[0].getLegend();
    if (!i || !YH.isIRange(i)) return s[0].getLegend();
    const a = await CPe(o, r, YH.lift(i), aM.None);
    return a ? a.provider.getLegend() : void 0;
  }),
  jV.registerCommand("_provideDocumentRangeSemanticTokens", async (e, ...t) => {
    const [n, i] = t;
    (pR(n instanceof mP), pR(YH.isIRange(i)));
    const r = e.get(wV).getModel(n);
    if (!r) return;
    const { documentRangeSemanticTokensProvider: o } = e.get(mee),
      s = await CPe(o, r, YH.lift(i), aM.None);
    return s && s.tokens ? fPe({ id: 0, type: "full", data: s.tokens.data }) : void 0;
  }));
const SPe = "editor.semanticHighlighting";
function kPe(e, t, n) {
  const i = n.getValue(SPe, { overrideIdentifier: e.getLanguageId(), resource: e.uri })?.enabled;
  return "boolean" == typeof i ? i : t.getColorTheme().semanticHighlighting;
}
var EPe,
  NPe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  LPe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let DPe = class extends PO {
  constructor(e, t, n, i, r, o) {
    (super(), (this._watchers = new KW()));
    const s = (t) => {
        (this._watchers.get(t.uri)?.dispose(), this._watchers.set(t.uri, new TPe(t, e, n, r, o)));
      },
      a = (e, t) => {
        (t.dispose(), this._watchers.delete(e.uri));
      },
      l = () => {
        for (const e of t.getModels()) {
          const t = this._watchers.get(e.uri);
          kPe(e, n, i) ? t || s(e) : t && a(e, t);
        }
      };
    (t.getModels().forEach((e) => {
      kPe(e, n, i) && s(e);
    }),
      this._register(
        t.onModelAdded((e) => {
          kPe(e, n, i) && s(e);
        }),
      ),
      this._register(
        t.onModelRemoved((e) => {
          const t = this._watchers.get(e.uri);
          t && a(e, t);
        }),
      ),
      this._register(
        i.onDidChangeConfiguration((e) => {
          e.affectsConfiguration(SPe) && l();
        }),
      ),
      this._register(n.onDidColorThemeChange(l)));
  }
  dispose() {
    (IO(this._watchers.values()), this._watchers.clear(), super.dispose());
  }
};
DPe = NPe([LPe(0, pPe), LPe(1, wV), LPe(2, h0), LPe(3, OU), LPe(4, gme), LPe(5, mee)], DPe);
let TPe = class extends PO {
  static {
    EPe = this;
  }
  static {
    this.REQUEST_MIN_DELAY = 300;
  }
  static {
    this.REQUEST_MAX_DELAY = 2e3;
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this._semanticTokensStylingService = t),
      (this._isDisposed = !1),
      (this._model = e),
      (this._provider = r.documentSemanticTokensProvider),
      (this._debounceInformation = i.for(this._provider, "DocumentSemanticTokens", {
        min: EPe.REQUEST_MIN_DELAY,
        max: EPe.REQUEST_MAX_DELAY,
      })),
      (this._fetchDocumentSemanticTokens = this._register(
        new EM(() => this._fetchDocumentSemanticTokensNow(), EPe.REQUEST_MIN_DELAY),
      )),
      (this._currentDocumentResponse = null),
      (this._currentDocumentRequestCancellationTokenSource = null),
      (this._documentProvidersChangeListeners = []),
      (this._providersChangedDuringRequest = !1),
      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.dispose(), (this._currentDocumentResponse = null)),
            this._currentDocumentRequestCancellationTokenSource &&
              (this._currentDocumentRequestCancellationTokenSource.cancel(),
              (this._currentDocumentRequestCancellationTokenSource = null)),
            this._setDocumentSemanticTokens(null, null, null, []),
            this._fetchDocumentSemanticTokens.schedule(0));
        }),
      ));
    const o = () => {
      (IO(this._documentProvidersChangeListeners), (this._documentProvidersChangeListeners = []));
      for (const t of this._provider.all(e))
        "function" == typeof t.onDidChange &&
          this._documentProvidersChangeListeners.push(
            t.onDidChange(() => {
              this._currentDocumentRequestCancellationTokenSource
                ? (this._providersChangedDuringRequest = !0)
                : this._fetchDocumentSemanticTokens.schedule(0);
            }),
          );
    };
    (o(),
      this._register(
        this._provider.onDidChange(() => {
          (o(),
            this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)));
        }),
      ),
      this._register(
        n.onDidColorThemeChange((e) => {
          (this._setDocumentSemanticTokens(null, null, null, []),
            this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)));
        }),
      ),
      this._fetchDocumentSemanticTokens.schedule(0));
  }
  dispose() {
    (this._currentDocumentResponse &&
      (this._currentDocumentResponse.dispose(), (this._currentDocumentResponse = null)),
      this._currentDocumentRequestCancellationTokenSource &&
        (this._currentDocumentRequestCancellationTokenSource.cancel(),
        (this._currentDocumentRequestCancellationTokenSource = null)),
      IO(this._documentProvidersChangeListeners),
      (this._documentProvidersChangeListeners = []),
      this._setDocumentSemanticTokens(null, null, null, []),
      (this._isDisposed = !0),
      super.dispose());
  }
  _fetchDocumentSemanticTokensNow() {
    if (this._currentDocumentRequestCancellationTokenSource) return;
    if (!bPe(this._provider, this._model))
      return void (
        this._currentDocumentResponse && this._model.tokenization.setSemanticTokens(null, !1)
      );
    if (!this._model.isAttachedToEditor()) return;
    const e = new cM(),
      t = this._currentDocumentResponse ? this._currentDocumentResponse.provider : null,
      n = (this._currentDocumentResponse && this._currentDocumentResponse.resultId) || null,
      i = yPe(this._provider, this._model, t, n, e.token);
    ((this._currentDocumentRequestCancellationTokenSource = e),
      (this._providersChangedDuringRequest = !1));
    const r = [],
      o = this._model.onDidChangeContent((e) => {
        r.push(e);
      }),
      s = new UO(!1);
    i.then(
      (e) => {
        if (
          (this._debounceInformation.update(this._model, s.elapsed()),
          (this._currentDocumentRequestCancellationTokenSource = null),
          o.dispose(),
          e)
        ) {
          const { provider: t, tokens: n } = e,
            i = this._semanticTokensStylingService.getStyling(t);
          this._setDocumentSemanticTokens(t, n || null, i, r);
        } else this._setDocumentSemanticTokens(null, null, null, r);
      },
      (e) => {
        ((e && (qI(e) || ("string" == typeof e.message && -1 !== e.message.indexOf("busy")))) ||
          HI(e),
          (this._currentDocumentRequestCancellationTokenSource = null),
          o.dispose(),
          (r.length > 0 || this._providersChangedDuringRequest) &&
            (this._fetchDocumentSemanticTokens.isScheduled() ||
              this._fetchDocumentSemanticTokens.schedule(
                this._debounceInformation.get(this._model),
              )));
      },
    );
  }
  static _copy(e, t, n, i, r) {
    r = Math.min(r, n.length - i, e.length - t);
    for (let o = 0; o < r; o++) n[i + o] = e[t + o];
  }
  _setDocumentSemanticTokens(e, t, n, i) {
    const r = this._currentDocumentResponse,
      o = () => {
        (i.length > 0 || this._providersChangedDuringRequest) &&
          !this._fetchDocumentSemanticTokens.isScheduled() &&
          this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
      };
    if (
      (this._currentDocumentResponse &&
        (this._currentDocumentResponse.dispose(), (this._currentDocumentResponse = null)),
      this._isDisposed)
    )
      e && t && e.releaseDocumentSemanticTokens(t.resultId);
    else if (e && n) {
      if (!t) return (this._model.tokenization.setSemanticTokens(null, !0), void o());
      if (_Pe(t)) {
        if (!r) return void this._model.tokenization.setSemanticTokens(null, !0);
        if (0 === t.edits.length) t = { resultId: t.resultId, data: r.data };
        else {
          let e = 0;
          for (const n of t.edits) e += (n.data ? n.data.length : 0) - n.deleteCount;
          const i = r.data,
            o = new Uint32Array(i.length + e);
          let s = i.length,
            a = o.length;
          for (let l = t.edits.length - 1; l >= 0; l--) {
            const e = t.edits[l];
            if (e.start > i.length)
              return (
                n.warnInvalidEditStart(r.resultId, t.resultId, l, e.start, i.length),
                void this._model.tokenization.setSemanticTokens(null, !0)
              );
            const c = s - (e.start + e.deleteCount);
            (c > 0 && (EPe._copy(i, s - c, o, a - c, c), (a -= c)),
              e.data &&
                (EPe._copy(e.data, 0, o, a - e.data.length, e.data.length), (a -= e.data.length)),
              (s = e.start));
          }
          (s > 0 && EPe._copy(i, 0, o, 0, s), (t = { resultId: t.resultId, data: o }));
        }
      }
      if (mPe(t)) {
        this._currentDocumentResponse = new IPe(e, t.resultId, t.data);
        const r = uPe(t, n, this._model.getLanguageId());
        if (i.length > 0)
          for (const e of i)
            for (const t of r) for (const n of e.changes) t.applyEdit(n.range, n.text);
        this._model.tokenization.setSemanticTokens(r, !0);
      } else this._model.tokenization.setSemanticTokens(null, !0);
      o();
    } else this._model.tokenization.setSemanticTokens(null, !1);
  }
};
TPe = EPe = NPe([LPe(1, pPe), LPe(2, h0), LPe(3, gme), LPe(4, mee)], TPe);
class IPe {
  constructor(e, t, n) {
    ((this.provider = e), (this.resultId = t), (this.data = n));
  }
  dispose() {
    this.provider.releaseDocumentSemanticTokens(this.resultId);
  }
}
xme(DPe);
var RPe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let OPe = class extends PO {
  static {
    this.ID = "editor.contrib.viewportSemanticTokens";
  }
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._semanticTokensStylingService = t),
      (this._themeService = n),
      (this._configurationService = i),
      (this._editor = e),
      (this._provider = o.documentRangeSemanticTokensProvider),
      (this._debounceInformation = r.for(this._provider, "DocumentRangeSemanticTokens", {
        min: 100,
        max: 500,
      })),
      (this._tokenizeViewport = this._register(new EM(() => this._tokenizeViewportNow(), 100))),
      (this._outstandingRequests = []),
      (this._rangeProvidersChangeListeners = []));
    const s = () => {
        this._editor.hasModel() &&
          this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()));
      },
      a = () => {
        if ((this._cleanupProviderListeners(), this._editor.hasModel())) {
          const e = this._editor.getModel();
          for (const t of this._provider.all(e)) {
            const e = t.onDidChange?.(() => {
              (this._cancelAll(), s());
            });
            e && this._rangeProvidersChangeListeners.push(e);
          }
        }
      };
    (this._register(
      this._editor.onDidScrollChange(() => {
        s();
      }),
    ),
      this._register(
        this._editor.onDidChangeModel(() => {
          (a(), this._cancelAll(), s());
        }),
      ),
      this._register(
        this._editor.onDidChangeModelLanguage(() => {
          (a(), this._cancelAll(), s());
        }),
      ),
      this._register(
        this._editor.onDidChangeModelContent((e) => {
          (this._cancelAll(), s());
        }),
      ),
      a(),
      this._register(
        this._provider.onDidChange(() => {
          (a(), this._cancelAll(), s());
        }),
      ),
      this._register(
        this._configurationService.onDidChangeConfiguration((e) => {
          e.affectsConfiguration(SPe) && (this._cancelAll(), s());
        }),
      ),
      this._register(
        this._themeService.onDidColorThemeChange(() => {
          (this._cancelAll(), s());
        }),
      ),
      s());
  }
  dispose() {
    (this._cleanupProviderListeners(), super.dispose());
  }
  _cleanupProviderListeners() {
    (IO(this._rangeProvidersChangeListeners), (this._rangeProvidersChangeListeners = []));
  }
  _cancelAll() {
    for (const e of this._outstandingRequests) e.cancel();
    this._outstandingRequests = [];
  }
  _removeOutstandingRequest(e) {
    for (let t = 0, n = this._outstandingRequests.length; t < n; t++)
      if (this._outstandingRequests[t] === e) return void this._outstandingRequests.splice(t, 1);
  }
  _tokenizeViewportNow() {
    if (!this._editor.hasModel()) return;
    const e = this._editor.getModel();
    if (e.tokenization.hasCompleteSemanticTokens()) return;
    if (!kPe(e, this._themeService, this._configurationService))
      return void (
        e.tokenization.hasSomeSemanticTokens() && e.tokenization.setSemanticTokens(null, !1)
      );
    if (
      !(function (e, t) {
        return e.has(t);
      })(this._provider, e)
    )
      return void (
        e.tokenization.hasSomeSemanticTokens() && e.tokenization.setSemanticTokens(null, !1)
      );
    const t = this._editor.getVisibleRangesPlusViewportAboveBelow();
    this._outstandingRequests = this._outstandingRequests.concat(
      t.map((t) => this._requestRange(e, t)),
    );
  }
  _requestRange(e, t) {
    const n = e.getVersionId(),
      i = gM((n) => Promise.resolve(CPe(this._provider, e, t, n))),
      r = new UO(!1);
    return (
      i
        .then((i) => {
          if (
            (this._debounceInformation.update(e, r.elapsed()),
            !i || !i.tokens || e.isDisposed() || e.getVersionId() !== n)
          )
            return;
          const { provider: o, tokens: s } = i,
            a = this._semanticTokensStylingService.getStyling(o);
          e.tokenization.setPartialSemanticTokens(t, uPe(s, a, e.getLanguageId()));
        })
        .then(
          () => this._removeOutstandingRequest(i),
          () => this._removeOutstandingRequest(i),
        ),
      i
    );
  }
};
((OPe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([RPe(1, pPe), RPe(2, h0), RPe(3, OU), RPe(4, gme), RPe(5, mee)], OPe)),
  zH(OPe.ID, OPe, 1));
class MPe {
  constructor(e = !0) {
    this.selectSubwords = e;
  }
  provideSelectionRanges(e, t) {
    const n = [];
    for (const i of t) {
      const t = [];
      (n.push(t),
        this.selectSubwords && this._addInWordRanges(t, e, i),
        this._addWordRanges(t, e, i),
        this._addWhitespaceLine(t, e, i),
        t.push({ range: e.getFullModelRange() }));
    }
    return n;
  }
  _addInWordRanges(e, t, n) {
    const i = t.getWordAtPosition(n);
    if (!i) return;
    const { word: r, startColumn: o } = i,
      s = n.column - o;
    let a = s,
      l = s,
      c = 0;
    for (; a >= 0; a--) {
      const e = r.charCodeAt(a);
      if (a !== s && (95 === e || 45 === e)) break;
      if (rA(e) && oA(c)) break;
      c = e;
    }
    for (a += 1; l < r.length; l++) {
      const e = r.charCodeAt(l);
      if (oA(e) && rA(c)) break;
      if (95 === e || 45 === e) break;
      c = e;
    }
    a < l && e.push({ range: new YH(n.lineNumber, o + a, n.lineNumber, o + l) });
  }
  _addWordRanges(e, t, n) {
    const i = t.getWordAtPosition(n);
    i && e.push({ range: new YH(n.lineNumber, i.startColumn, n.lineNumber, i.endColumn) });
  }
  _addWhitespaceLine(e, t, n) {
    t.getLineLength(n.lineNumber) > 0 &&
      0 === t.getLineFirstNonWhitespaceColumn(n.lineNumber) &&
      0 === t.getLineLastNonWhitespaceColumn(n.lineNumber) &&
      e.push({ range: new YH(n.lineNumber, 1, n.lineNumber, t.getLineMaxColumn(n.lineNumber)) });
  }
}
var APe;
class PPe {
  constructor(e, t) {
    ((this.index = e), (this.ranges = t));
  }
  mov(e) {
    const t = this.index + (e ? 1 : -1);
    if (t < 0 || t >= this.ranges.length) return this;
    const n = new PPe(t, this.ranges);
    return n.ranges[t].equalsRange(this.ranges[this.index]) ? n.mov(e) : n;
  }
}
let jPe = class {
  static {
    APe = this;
  }
  static {
    this.ID = "editor.contrib.smartSelectController";
  }
  static get(e) {
    return e.getContribution(APe.ID);
  }
  constructor(e, t) {
    ((this._editor = e), (this._languageFeaturesService = t), (this._ignoreSelection = !1));
  }
  dispose() {
    this._selectionListener?.dispose();
  }
  async run(e) {
    if (!this._editor.hasModel()) return;
    const t = this._editor.getSelections(),
      n = this._editor.getModel();
    if (
      (this._state ||
        (await BPe(
          this._languageFeaturesService.selectionRangeProvider,
          n,
          t.map((e) => e.getPosition()),
          this._editor.getOption(129),
          aM.None,
        ).then((e) => {
          if (
            aj(e) &&
            e.length === t.length &&
            this._editor.hasModel() &&
            XP(this._editor.getSelections(), t, (e, t) => e.equalsSelection(t))
          ) {
            for (let n = 0; n < e.length; n++)
              ((e[n] = e[n].filter(
                (e) =>
                  e.containsPosition(t[n].getStartPosition()) &&
                  e.containsPosition(t[n].getEndPosition()),
              )),
                e[n].unshift(t[n]));
            ((this._state = e.map((e) => new PPe(0, e))),
              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((t) => t.mov(e));
    const i = this._state.map((e) =>
      XH.fromPositions(e.ranges[e.index].getStartPosition(), e.ranges[e.index].getEndPosition()),
    );
    this._ignoreSelection = !0;
    try {
      this._editor.setSelections(i);
    } finally {
      this._ignoreSelection = !1;
    }
  }
};
jPe = APe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(1, mee),
  ],
  jPe,
);
class FPe extends AH {
  constructor(e, t) {
    (super(t), (this._forward = e));
  }
  async run(e, t) {
    const n = jPe.get(t);
    n && (await n.run(this._forward));
  }
}
jV.registerCommandAlias("editor.action.smartSelect.grow", "editor.action.smartSelect.expand");
async function BPe(e, t, n, i, r) {
  const o = e.all(t).concat(new MPe(i.selectSubwords));
  1 === o.length && o.unshift(new hIe());
  const s = [],
    a = [];
  for (const l of o)
    s.push(
      Promise.resolve(l.provideSelectionRanges(t, n, r)).then((e) => {
        if (aj(e) && e.length === n.length)
          for (let t = 0; t < n.length; t++) {
            a[t] || (a[t] = []);
            for (const i of e[t])
              YH.isIRange(i.range) &&
                YH.containsPosition(i.range, n[t]) &&
                a[t].push(YH.lift(i.range));
          }
      }, zI),
    );
  return (
    await Promise.all(s),
    a.map((e) => {
      if (0 === e.length) return [];
      e.sort((e, t) =>
        xV.isBefore(e.getStartPosition(), t.getStartPosition())
          ? 1
          : xV.isBefore(t.getStartPosition(), e.getStartPosition()) ||
              xV.isBefore(e.getEndPosition(), t.getEndPosition())
            ? -1
            : xV.isBefore(t.getEndPosition(), e.getEndPosition())
              ? 1
              : 0,
      );
      const n = [];
      let r;
      for (const t of e)
        (!r || (YH.containsRange(t, r) && !YH.equalsRange(t, r))) && (n.push(t), (r = t));
      if (!i.selectLeadingAndTrailingWhitespace) return n;
      const o = [n[0]];
      for (let i = 1; i < n.length; i++) {
        const e = n[i - 1],
          r = n[i];
        if (r.startLineNumber !== e.startLineNumber || r.endLineNumber !== e.endLineNumber) {
          const n = new YH(
            e.startLineNumber,
            t.getLineFirstNonWhitespaceColumn(e.startLineNumber),
            e.endLineNumber,
            t.getLineLastNonWhitespaceColumn(e.endLineNumber),
          );
          n.containsRange(e) &&
            !n.equalsRange(e) &&
            r.containsRange(n) &&
            !r.equalsRange(n) &&
            o.push(n);
          const i = new YH(
            e.startLineNumber,
            1,
            e.endLineNumber,
            t.getLineMaxColumn(e.endLineNumber),
          );
          i.containsRange(e) &&
            !i.equalsRange(n) &&
            r.containsRange(i) &&
            !r.equalsRange(i) &&
            o.push(i);
        }
        o.push(r);
      }
      return o;
    })
  );
}
(zH(jPe.ID, jPe, 4),
  VH(
    class extends FPe {
      constructor() {
        super(!0, {
          id: "editor.action.smartSelect.expand",
          label: EI(1400, "Expand Selection"),
          precondition: void 0,
          kbOpts: {
            kbExpr: $$.editorTextFocus,
            primary: 1553,
            mac: { primary: 3345, secondary: [1297] },
            weight: 100,
          },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "1_basic",
            title: SI(1398, "&&Expand Selection"),
            order: 2,
          },
        });
      }
    },
  ),
  VH(
    class extends FPe {
      constructor() {
        super(!1, {
          id: "editor.action.smartSelect.shrink",
          label: EI(1401, "Shrink Selection"),
          precondition: void 0,
          kbOpts: {
            kbExpr: $$.editorTextFocus,
            primary: 1551,
            mac: { primary: 3343, secondary: [1295] },
            weight: 100,
          },
          menuOpts: {
            menuId: MW.MenubarSelectionMenu,
            group: "1_basic",
            title: SI(1399, "&&Shrink Selection"),
            order: 3,
          },
        });
      }
    },
  ),
  jV.registerCommand("_executeSelectionRangeProvider", async function (e, ...t) {
    const [n, i] = t;
    var r, o;
    (pR(mP.isUri(n)),
      pR(((r = i), (o = (e) => xV.isIPosition(e)), Array.isArray(r) && r.every(o))));
    const s = e.get(mee).selectionRangeProvider,
      a = await e.get(CV).createModelReference(n);
    try {
      return BPe(
        s,
        a.object.textEditorModel,
        i.map(xV.lift),
        { selectLeadingAndTrailingWhitespace: !0, selectSubwords: !0 },
        aM.None,
      );
    } finally {
      a.dispose();
    }
  }));
const VPe = Object.freeze({
  View: EI(1638, "View"),
  Help: EI(1639, "Help"),
  Test: EI(1640, "Test"),
  File: EI(1641, "File"),
  Preferences: EI(1642, "Preferences"),
  Developer: EI(1643, "Developer"),
});
const WPe = 100;
(zH(URe.ID, URe, 1),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "editor.action.toggleStickyScroll",
          title: {
            ...EI(1448, "Toggle Editor Sticky Scroll"),
            mnemonicTitle: SI(1444, "&&Toggle Editor Sticky Scroll"),
          },
          metadata: {
            description: EI(
              1449,
              "Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport",
            ),
          },
          category: VPe.View,
          toggled: {
            condition: eW.equals("config.editor.stickyScroll.enabled", !0),
            title: SI(1445, "Sticky Scroll"),
            mnemonicTitle: SI(1446, "&&Sticky Scroll"),
          },
          menu: [
            { id: MW.CommandPalette },
            { id: MW.MenubarAppearanceMenu, group: "4_editor", order: 3 },
            { id: MW.StickyScrollContext },
          ],
        });
      }
      async runEditorCommand(e, t) {
        const n = e.get(OU),
          i = !n.getValue("editor.stickyScroll.enabled"),
          r = URe.get(t)?.isFocused();
        (n.updateValue("editor.stickyScroll.enabled", i), r && t.focus());
      }
    },
  ),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "editor.action.focusStickyScroll",
          title: {
            ...EI(1450, "Focus Editor Sticky Scroll"),
            mnemonicTitle: SI(1447, "&&Focus Editor Sticky Scroll"),
          },
          precondition: eW.and(
            eW.has("config.editor.stickyScroll.enabled"),
            $$.stickyScrollVisible,
          ),
          menu: [{ id: MW.CommandPalette }],
        });
      }
      runEditorCommand(e, t) {
        URe.get(t)?.focus();
      }
    },
  ),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "editor.action.selectPreviousStickyScrollLine",
          title: EI(1452, "Select the previous sticky scroll line"),
          precondition: $$.stickyScrollFocused.isEqualTo(!0),
          keybinding: { weight: WPe, primary: 16 },
        });
      }
      runEditorCommand(e, t) {
        URe.get(t)?.focusPrevious();
      }
    },
  ),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "editor.action.selectNextStickyScrollLine",
          title: EI(1451, "Select the next editor sticky scroll line"),
          precondition: $$.stickyScrollFocused.isEqualTo(!0),
          keybinding: { weight: WPe, primary: 18 },
        });
      }
      runEditorCommand(e, t) {
        URe.get(t)?.focusNext();
      }
    },
  ),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "editor.action.goToFocusedStickyScrollLine",
          title: EI(1453, "Go to the focused sticky scroll line"),
          precondition: $$.stickyScrollFocused.isEqualTo(!0),
          keybinding: { weight: WPe, primary: 3 },
        });
      }
      runEditorCommand(e, t) {
        URe.get(t)?.goToFocused();
      }
    },
  ),
  WW(
    class extends jH {
      constructor() {
        super({
          id: "editor.action.selectEditor",
          title: EI(1454, "Select Editor"),
          precondition: $$.stickyScrollFocused.isEqualTo(!0),
          keybinding: { weight: WPe, primary: 9 },
        });
      }
      runEditorCommand(e, t) {
        URe.get(t)?.selectEditor();
      }
    },
  ));
var HPe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  zPe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class UPe {
  constructor(e, t, n, i, r, o, s) {
    ((this.range = e),
      (this.insertText = t),
      (this.filterText = n),
      (this.additionalTextEdits = i),
      (this.command = r),
      (this.gutterMenuLinkAction = o),
      (this.completion = s));
  }
}
let $Pe = class extends FO {
  constructor(e, t, n, i, r, o) {
    (super(r.disposable),
      (this.model = e),
      (this.line = t),
      (this.word = n),
      (this.completionModel = i),
      (this._suggestMemoryService = o));
  }
  canBeReused(e, t, n) {
    return (
      this.model === e &&
      this.line === t &&
      this.word.word.length > 0 &&
      this.word.startColumn === n.startColumn &&
      this.word.endColumn < n.endColumn &&
      0 === this.completionModel.getIncompleteProvider().size
    );
  }
  get items() {
    const e = [],
      { items: t } = this.completionModel,
      n = this._suggestMemoryService.select(
        this.model,
        {
          lineNumber: this.line,
          column: this.word.endColumn + this.completionModel.lineContext.characterCountDelta,
        },
        t,
      ),
      i = DO.slice(t, n),
      r = DO.slice(t, 0, n);
    let o = 5;
    for (const s of DO.concat(i, r)) {
      if (s.score === zie.Default) continue;
      const t = new YH(
          s.editStart.lineNumber,
          s.editStart.column,
          s.editInsertEnd.lineNumber,
          s.editInsertEnd.column + this.completionModel.lineContext.characterCountDelta,
        ),
        n =
          s.completion.insertTextRules && 4 & s.completion.insertTextRules
            ? { snippet: s.completion.insertText }
            : s.completion.insertText;
      (e.push(
        new UPe(
          t,
          n,
          s.filterTextLow ?? s.labelLow,
          s.completion.additionalTextEdits,
          s.completion.command,
          s.completion.action,
          s,
        ),
      ),
        o-- >= 0 && s.resolve(aM.None));
    }
    return e;
  }
};
$Pe = HPe([zPe(5, sIe)], $Pe);
let qPe = class extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._languageFeatureService = e),
      (this._clipboardService = t),
      (this._suggestMemoryService = n),
      (this._editorService = i),
      this._store.add(e.inlineCompletionsProvider.register("*", this)));
  }
  async provideInlineCompletions(e, t, n, i) {
    if (n.selectedSuggestionInfo) return;
    let r;
    for (const h of this._editorService.listCodeEditors())
      if (h.getModel() === e) {
        r = h;
        break;
      }
    if (!r) return;
    const o = r.getOption(102);
    if (gLe.isAllOff(o)) return;
    e.tokenization.tokenizeIfCheap(t.lineNumber);
    const s = e.tokenization.getLineTokens(t.lineNumber),
      a = s.getStandardTokenType(s.findTokenIndexAtOffset(Math.max(t.column - 1 - 1, 0)));
    if ("inline" !== gLe.valueFor(o, a)) return;
    let l,
      c,
      d = e.getWordAtPosition(t);
    if ((d?.word || (l = this._getTriggerCharacterInfo(e, t)), !d?.word && !l)) return;
    if ((d || (d = e.getWordUntilPosition(t)), d.endColumn !== t.column)) return;
    const u = e.getValueInRange(new YH(t.lineNumber, 1, t.lineNumber, t.column));
    if (!l && this._lastResult?.canBeReused(e, t.lineNumber, d)) {
      const e = new pIe(u, t.column - this._lastResult.word.endColumn);
      ((this._lastResult.completionModel.lineContext = e),
        this._lastResult.acquire(),
        (c = this._lastResult));
    } else {
      const n = await dLe(
        this._languageFeatureService.completionProvider,
        e,
        t,
        new lLe(void 0, bIe.createSuggestFilter(r).itemKind, l?.providers),
        l && { triggerKind: 1, triggerCharacter: l.ch },
        i,
      );
      let o;
      n.needsClipboard && (o = await this._clipboardService.readText());
      const s = new fIe(
        n.items,
        t.column,
        new pIe(u, 0),
        gIe.None,
        r.getOption(134),
        r.getOption(128),
        { boostFullMatch: !1, firstMatchCanBeWeak: !1 },
        o,
      );
      c = new $Pe(e, t.lineNumber, d, s, n, this._suggestMemoryService);
    }
    return ((this._lastResult = c), c);
  }
  handleItemDidShow(e, t) {
    t.completion.resolve(aM.None);
  }
  disposeInlineCompletions(e) {
    e.release();
  }
  _getTriggerCharacterInfo(e, t) {
    const n = e.getValueInRange(
        YH.fromPositions({ lineNumber: t.lineNumber, column: t.column - 1 }, t),
      ),
      i = new Set();
    for (const r of this._languageFeatureService.completionProvider.all(e))
      r.triggerCharacters?.includes(n) && i.add(r);
    if (0 !== i.size) return { providers: i, ch: n };
  }
};
((qPe = HPe([zPe(0, mee), zPe(1, ade), zPe(2, sIe), zPe(3, yV)], qPe)), xme(qPe));
VH(
  class extends AH {
    constructor() {
      super({
        id: "editor.action.forceRetokenize",
        label: EI(1532, "Developer: Force Retokenize"),
        precondition: void 0,
      });
    }
    run(e, t) {
      if (!t.hasModel()) return;
      const n = t.getModel();
      n.tokenization.resetTokenization();
      const i = new UO();
      (n.tokenization.forceTokenization(n.getLineCount()), i.stop());
    }
  },
);
class KPe extends VW {
  static {
    this.ID = "editor.action.toggleTabFocusMode";
  }
  constructor() {
    super({
      id: KPe.ID,
      title: EI(1530, "Toggle Tab Key Moves Focus"),
      precondition: void 0,
      keybinding: { primary: 2091, mac: { primary: 1323 }, weight: 100 },
      metadata: {
        description: EI(
          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: !0,
    });
  }
  run() {
    const e = !qK.getTabFocusMode();
    (qK.setTabFocusMode(e),
      pV(
        e
          ? SI(1528, "Pressing Tab will now move focus to the next focusable element")
          : SI(1529, "Pressing Tab will now insert the tab character"),
      ));
  }
}
WW(KPe);
class GPe {
  static computeUnicodeHighlights(e, t, n) {
    const i = n ? n.startLineNumber : 1,
      r = n ? n.endLineNumber : e.getLineCount(),
      o = new ZPe(t),
      s = o.getCandidateCodePoints();
    let a;
    a =
      "allNonBasicAscii" === s
        ? new RegExp("[^\\t\\n\\r\\x20-\\x7E]", "g")
        : new RegExp(
            `${(function (e) {
              const t = `[${zM(e.map((e) => String.fromCodePoint(e)).join(""))}]`;
              return t;
            })(Array.from(s))}`,
            "g",
          );
    const l = new w9(null, a),
      c = [];
    let d,
      u = !1,
      h = 0,
      g = 0,
      p = 0;
    e: for (let f = i, m = r; f <= m; f++) {
      const t = e.getLineContent(f),
        n = t.length;
      l.reset(0);
      do {
        if (((d = l.next(t)), d)) {
          let e = d.index,
            i = d.index + d[0].length;
          if (e > 0) {
            uA(t.charCodeAt(e - 1)) && e--;
          }
          if (i + 1 < n) {
            uA(t.charCodeAt(i - 1)) && i++;
          }
          const r = t.substring(e, i);
          let s = dU(e + 1, aU, t, 0);
          s && s.endColumn <= e + 1 && (s = null);
          const a = o.shouldHighlightNonBasicASCII(r, s ? s.word : null);
          if (0 !== a) {
            3 === a ? h++ : 2 === a ? g++ : 1 === a ? p++ : eR();
            const t = 1e3;
            if (c.length >= t) {
              u = !0;
              break e;
            }
            c.push(new YH(f, e + 1, f, i + 1));
          }
        }
      } while (d);
    }
    return {
      ranges: c,
      hasMore: u,
      ambiguousCharacterCount: h,
      invisibleCharacterCount: g,
      nonBasicAsciiCharacterCount: p,
    };
  }
  static computeUnicodeHighlightReason(e, t) {
    const n = new ZPe(t);
    switch (n.shouldHighlightNonBasicASCII(e, null)) {
      case 0:
        return null;
      case 2:
        return { kind: 1 };
      case 3: {
        const i = e.codePointAt(0),
          r = n.ambiguousCharacters.getPrimaryConfusable(i),
          o = MA.getLocales().filter(
            (e) => !MA.getInstance(new Set([...t.allowedLocales, e])).isAmbiguous(i),
          );
        return { kind: 0, confusableWith: String.fromCodePoint(r), notAmbiguousInLocales: o };
      }
      case 1:
        return { kind: 2 };
    }
  }
}
class ZPe {
  constructor(e) {
    ((this.options = e),
      (this.allowedCodePoints = new Set(e.allowedCodePoints)),
      (this.ambiguousCharacters = MA.getInstance(new Set(e.allowedLocales))));
  }
  getCandidateCodePoints() {
    if (this.options.nonBasicASCII) return "allNonBasicAscii";
    const e = new Set();
    if (this.options.invisibleCharacters)
      for (const t of AA.codePoints) YPe(String.fromCodePoint(t)) || e.add(t);
    if (this.options.ambiguousCharacters)
      for (const t of this.ambiguousCharacters.getConfusableCodePoints()) e.add(t);
    for (const t of this.allowedCodePoints) e.delete(t);
    return e;
  }
  shouldHighlightNonBasicASCII(e, t) {
    const n = e.codePointAt(0);
    if (this.allowedCodePoints.has(n)) return 0;
    if (this.options.nonBasicASCII) return 1;
    let i = !1,
      r = !1;
    if (t)
      for (const o of t) {
        const e = o.codePointAt(0),
          t = wA(o);
        ((i = i || t),
          t || this.ambiguousCharacters.isAmbiguous(e) || AA.isInvisibleCharacter(e) || (r = !0));
      }
    return !i && r
      ? 0
      : this.options.invisibleCharacters && !YPe(e) && AA.isInvisibleCharacter(n)
        ? 2
        : this.options.ambiguousCharacters && this.ambiguousCharacters.isAmbiguous(n)
          ? 3
          : 0;
  }
}
function YPe(e) {
  return " " === e || "\n" === e || "\t" === e;
}
var XPe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let QPe = class extends PO {
  get enabled() {
    return this._enabled;
  }
  set enabled(e) {
    (e
      ? (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 = !1))
      : (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 = !0)),
      (this._enabled = e));
  }
  constructor(e, t, n = {}, i, r) {
    (super(),
      (this._link = t),
      (this._hoverService = i),
      (this._enabled = !0),
      (this.el = MB(e, VB("a.monaco-link", { tabIndex: t.tabIndex ?? 0, href: t.href }, t.label))),
      (this.hoverDelegate = n.hoverDelegate ?? Bne("mouse")),
      this.setTooltip(t.title),
      this.el.setAttribute("role", "button"));
    const o = this._register(new RJ(this.el, "click")),
      s = this._register(new RJ(this.el, "keypress")),
      a = $O.chain(s.event, (e) => e.map((e) => new wO(e)).filter((e) => 3 === e.keyCode)),
      l = this._register(new RJ(this.el, nJ.Tap)).event;
    this._register(iJ.addTarget(this.el));
    const c = $O.any(o.event, a, l);
    (this._register(
      c((e) => {
        this.enabled &&
          (IB(e, !0),
          n?.opener ? n.opener(this._link.href) : r.open(this._link.href, { allowCommands: !0 }));
      }),
    ),
      (this.enabled = !0));
  }
  setTooltip(e) {
    !this.hover && e
      ? (this.hover = this._register(
          this._hoverService.setupManagedHover(this.hoverDelegate, this.el, e),
        ))
      : this.hover && this.hover.update(e);
  }
};
QPe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([XPe(3, Xue), XPe(4, mge)], QPe);
var JPe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  eje = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let tje = class extends PO {
  constructor(e, t) {
    (super(),
      (this._editor = e),
      (this.instantiationService = t),
      (this.banner = this._register(this.instantiationService.createInstance(nje))));
  }
  hide() {
    (this._editor.setBanner(null, 0), this.banner.clear());
  }
  show(e) {
    (this.banner.show({
      ...e,
      onClose: () => {
        (this.hide(), e.onClose?.());
      },
    }),
      this._editor.setBanner(this.banner.element, 26));
  }
};
tje = JPe([eje(1, vV)], tje);
let nje = class extends PO {
  constructor(e, t) {
    (super(),
      (this.instantiationService = e),
      (this.markdownRendererService = t),
      (this.element = VB("div.editor-banner")),
      (this.element.tabIndex = 0));
  }
  getAriaLabel(e) {
    return e.ariaLabel ? e.ariaLabel : "string" == typeof e.message ? e.message : void 0;
  }
  getBannerMessage(e) {
    if ("string" == typeof e) {
      const t = VB("span");
      return ((t.innerText = e), t);
    }
    return this.markdownRendererService.render(e).element;
  }
  clear() {
    zF(this.element);
  }
  show(e) {
    zF(this.element);
    const t = this.getAriaLabel(e);
    t && this.element.setAttribute("aria-label", t);
    const n = MB(this.element, VB("div.icon-container"));
    (n.setAttribute("aria-hidden", "true"),
      e.icon && n.appendChild(VB(`div${AV.asCSSSelector(e.icon)}`)));
    const i = MB(this.element, VB("div.message-container"));
    if (
      (i.setAttribute("aria-hidden", "true"),
      i.appendChild(this.getBannerMessage(e.message)),
      (this.messageActionsContainer = MB(this.element, VB("div.message-actions-container"))),
      e.actions)
    )
      for (const o of e.actions)
        this._register(
          this.instantiationService.createInstance(
            QPe,
            this.messageActionsContainer,
            { ...o, tabIndex: -1 },
            {},
          ),
        );
    const r = MB(this.element, VB("div.action-container"));
    ((this.actionBar = this._register(new Cle(r))),
      this.actionBar.push(
        this._register(
          new SV("banner.close", SI(1533, "Close Banner"), AV.asClassName(ece), !0, () => {
            "function" == typeof e.onClose && e.onClose();
          }),
        ),
        { icon: !0, label: !1 },
      ),
      this.actionBar.setFocusable(!1));
  }
};
nje = JPe([eje(0, vV), eje(1, _ge)], nje);
const ije = bV("workspaceTrustManagementService");
var rje = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  oje = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const sje = Zle(
  "extensions-warning-message",
  OV.warning,
  SI(1534, "Icon shown with a warning message in the extensions editor."),
);
let aje = class extends PO {
  static {
    this.ID = "editor.contrib.unicodeHighlighter";
  }
  constructor(e, t, n, i) {
    (super(),
      (this._editor = e),
      (this._editorWorkerService = t),
      (this._workspaceTrustService = n),
      (this._highlighter = null),
      (this._bannerClosed = !1),
      (this._updateState = (e) => {
        if (e && e.hasMore) {
          if (this._bannerClosed) return;
          const t = Math.max(
            e.ambiguousCharacterCount,
            e.nonBasicAsciiCharacterCount,
            e.invisibleCharacterCount,
          );
          let n;
          if (e.nonBasicAsciiCharacterCount >= t)
            n = {
              message: SI(1535, "This document contains many non-basic ASCII unicode characters"),
              command: new yje(),
            };
          else if (e.ambiguousCharacterCount >= t)
            n = {
              message: SI(1536, "This document contains many ambiguous unicode characters"),
              command: new vje(),
            };
          else {
            if (!(e.invisibleCharacterCount >= t)) throw new Error("Unreachable");
            n = {
              message: SI(1537, "This document contains many invisible unicode characters"),
              command: new bje(),
            };
          }
          this._bannerController.show({
            id: "unicodeHighlightBanner",
            message: n.message,
            icon: sje,
            actions: [{ label: n.command.shortLabel, href: `command:${n.command.desc.id}` }],
            onClose: () => {
              this._bannerClosed = !0;
            },
          });
        } else this._bannerController.hide();
      }),
      (this._bannerController = this._register(i.createInstance(tje, e))),
      this._register(
        this._editor.onDidChangeModel(() => {
          ((this._bannerClosed = !1), this._updateHighlighter());
        }),
      ),
      (this._options = e.getOption(142)),
      this._register(
        n.onDidChangeTrust((e) => {
          this._updateHighlighter();
        }),
      ),
      this._register(
        e.onDidChangeConfiguration((t) => {
          t.hasChanged(142) && ((this._options = e.getOption(142)), this._updateHighlighter());
        }),
      ),
      this._updateHighlighter());
  }
  dispose() {
    (this._highlighter && (this._highlighter.dispose(), (this._highlighter = null)),
      super.dispose());
  }
  _updateHighlighter() {
    if (
      (this._updateState(null),
      this._highlighter && (this._highlighter.dispose(), (this._highlighter = null)),
      !this._editor.hasModel())
    )
      return;
    const e = (function (e, t) {
      return {
        nonBasicASCII: t.nonBasicASCII === LK ? !e : t.nonBasicASCII,
        ambiguousCharacters: t.ambiguousCharacters,
        invisibleCharacters: t.invisibleCharacters,
        includeComments: t.includeComments === LK ? !e : t.includeComments,
        includeStrings: t.includeStrings === LK ? !e : t.includeStrings,
        allowedCharacters: t.allowedCharacters,
        allowedLocales: t.allowedLocales,
      };
    })(this._workspaceTrustService.isWorkspaceTrusted(), this._options);
    if ([e.nonBasicASCII, e.ambiguousCharacters, e.invisibleCharacters].every((e) => !1 === e))
      return;
    const t = {
      nonBasicASCII: e.nonBasicASCII,
      ambiguousCharacters: e.ambiguousCharacters,
      invisibleCharacters: e.invisibleCharacters,
      includeComments: e.includeComments,
      includeStrings: e.includeStrings,
      allowedCodePoints: Object.keys(e.allowedCharacters).map((e) => e.codePointAt(0)),
      allowedLocales: Object.keys(e.allowedLocales).map((e) => {
        if ("_os" === e) {
          return Nz.NumberFormat().value.resolvedOptions().locale;
        }
        return "_vscode" === e ? $R : e;
      }),
    };
    this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)
      ? (this._highlighter = new lje(this._editor, t, this._updateState, this._editorWorkerService))
      : (this._highlighter = new cje(this._editor, t, this._updateState));
  }
  getDecorationInfo(e) {
    return this._highlighter ? this._highlighter.getDecorationInfo(e) : null;
  }
};
aje = rje([oje(1, Dce), oje(2, ije), oje(3, vV)], aje);
let lje = class extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this._editor = e),
      (this._options = t),
      (this._updateState = n),
      (this._editorWorkerService = i),
      (this._model = this._editor.getModel()),
      (this._decorations = this._editor.createDecorationsCollection()),
      (this._updateSoon = this._register(new EM(() => 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()) return void this._decorations.clear();
    const e = this._model.getVersionId();
    this._editorWorkerService
      .computedUnicodeHighlights(this._model.uri, this._options)
      .then((t) => {
        if (this._model.isDisposed()) return;
        if (this._model.getVersionId() !== e) return;
        this._updateState(t);
        const n = [];
        if (!t.hasMore)
          for (const e of t.ranges)
            n.push({ range: e, options: fje.instance.getDecorationFromOptions(this._options) });
        this._decorations.set(n);
      });
  }
  getDecorationInfo(e) {
    if (!this._decorations.has(e)) return null;
    const t = this._editor.getModel();
    if (!W2(t, e)) return null;
    return {
      reason: pje(t.getValueInRange(e.range), this._options),
      inComment: H2(t, e),
      inString: z2(t, e),
    };
  }
};
lje = rje([oje(3, Dce)], lje);
class cje extends PO {
  constructor(e, t, n) {
    (super(),
      (this._editor = e),
      (this._options = t),
      (this._updateState = n),
      (this._model = this._editor.getModel()),
      (this._decorations = this._editor.createDecorationsCollection()),
      (this._updateSoon = this._register(new EM(() => 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()) return void this._decorations.clear();
    const e = this._editor.getVisibleRanges(),
      t = [],
      n = {
        ranges: [],
        ambiguousCharacterCount: 0,
        invisibleCharacterCount: 0,
        nonBasicAsciiCharacterCount: 0,
        hasMore: !1,
      };
    for (const i of e) {
      const e = GPe.computeUnicodeHighlights(this._model, this._options, i);
      for (const t of e.ranges) n.ranges.push(t);
      ((n.ambiguousCharacterCount += n.ambiguousCharacterCount),
        (n.invisibleCharacterCount += n.invisibleCharacterCount),
        (n.nonBasicAsciiCharacterCount += n.nonBasicAsciiCharacterCount),
        (n.hasMore = n.hasMore || e.hasMore));
    }
    if (!n.hasMore)
      for (const i of n.ranges)
        t.push({ range: i, options: fje.instance.getDecorationFromOptions(this._options) });
    (this._updateState(n), this._decorations.set(t));
  }
  getDecorationInfo(e) {
    if (!this._decorations.has(e)) return null;
    const t = this._editor.getModel(),
      n = t.getValueInRange(e.range);
    return W2(t, e)
      ? { reason: pje(n, this._options), inComment: H2(t, e), inString: z2(t, e) }
      : null;
  }
}
const dje = SI(1538, "Configure Unicode Highlight Options");
let uje = class {
  constructor(e, t) {
    ((this._editor = e), (this._markdownRendererService = t), (this.hoverOrdinal = 5));
  }
  computeSync(e, t) {
    if (!this._editor.hasModel() || 1 !== e.type) return [];
    const n = this._editor.getModel(),
      i = this._editor.getContribution(aje.ID);
    if (!i) return [];
    const r = [],
      o = new Set();
    let s = 300;
    for (const a of t) {
      const e = i.getDecorationInfo(a);
      if (!e) continue;
      const t = n.getValueInRange(a.range).codePointAt(0),
        l = gje(t);
      let c;
      switch (e.reason.kind) {
        case 0:
          c = wA(e.reason.confusableWith)
            ? SI(
                1539,
                "The character {0} could be confused with the ASCII character {1}, which is more common in source code.",
                l,
                gje(e.reason.confusableWith.codePointAt(0)),
              )
            : SI(
                1540,
                "The character {0} could be confused with the character {1}, which is more common in source code.",
                l,
                gje(e.reason.confusableWith.codePointAt(0)),
              );
          break;
        case 1:
          c = SI(1541, "The character {0} is invisible.", l);
          break;
        case 2:
          c = SI(1542, "The character {0} is not a basic ASCII character.", l);
      }
      if (o.has(c)) continue;
      o.add(c);
      const d = { codePoint: t, reason: e.reason, inComment: e.inComment, inString: e.inString },
        u = SI(1543, "Adjust settings"),
        h = cre(xje.ID, d),
        g = new rre("", !0).appendMarkdown(c).appendText(" ").appendLink(h, u, dje);
      r.push(new Bbe(this, a.range, [g], !1, s++));
    }
    return r;
  }
  renderHoverParts(e, t) {
    return (function (e, t, n, i) {
      t.sort(bj((e) => e.ordinal, yj));
      const r = [];
      for (const o of t) {
        const t = Ube(n, o, i, e.onContentsChanged);
        (e.fragment.appendChild(t.hoverElement), r.push(t));
      }
      return new kme(r);
    })(e, t, this._editor, this._markdownRendererService);
  }
  getAccessibleContent(e) {
    return e.contents.map((e) => e.value).join("\n");
  }
};
function hje(e) {
  return `U+${e.toString(16).padStart(4, "0")}`;
}
function gje(e) {
  let t = `\`${hje(e)}\``;
  return (
    AA.isInvisibleCharacter(e) ||
      (t += ` "${(function (e) {
        if (96 === e) return "`` ` ``";
        return "`" + String.fromCodePoint(e) + "`";
      })(e)}"`),
    t
  );
}
function pje(e, t) {
  return GPe.computeUnicodeHighlightReason(e, t);
}
uje = rje([oje(1, _ge)], uje);
class fje {
  constructor() {
    this.map = new Map();
  }
  static {
    this.instance = new fje();
  }
  getDecorationFromOptions(e) {
    return this.getDecoration(!e.includeComments, !e.includeStrings);
  }
  getDecoration(e, t) {
    const n = `${e}${t}`;
    let i = this.map.get(n);
    return (
      i ||
        ((i = cee.createDynamic({
          description: "unicode-highlight",
          stickiness: 1,
          className: "unicode-highlight",
          showIfCollapsed: !0,
          overviewRuler: null,
          minimap: null,
          hideInCommentTokens: e,
          hideInStringTokens: t,
        })),
        this.map.set(n, i)),
      i
    );
  }
}
class mje extends AH {
  constructor() {
    (super({
      id: vje.ID,
      label: EI(1552, "Disable highlighting of characters in comments"),
      precondition: void 0,
    }),
      (this.shortLabel = SI(1544, "Disable Highlight In Comments")));
  }
  async run(e, t, n) {
    const i = e.get(OU);
    i && this.runAction(i);
  }
  async runAction(e) {
    await e.updateValue(OK, !1, 2);
  }
}
class _je extends AH {
  constructor() {
    (super({
      id: vje.ID,
      label: EI(1553, "Disable highlighting of characters in strings"),
      precondition: void 0,
    }),
      (this.shortLabel = SI(1545, "Disable Highlight In Strings")));
  }
  async run(e, t, n) {
    const i = e.get(OU);
    i && this.runAction(i);
  }
  async runAction(e) {
    await e.updateValue(MK, !1, 2);
  }
}
class vje extends VW {
  static {
    this.ID = "editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";
  }
  constructor() {
    (super({
      id: vje.ID,
      title: EI(1554, "Disable highlighting of ambiguous characters"),
      precondition: void 0,
      f1: !1,
    }),
      (this.shortLabel = SI(1546, "Disable Ambiguous Highlight")));
  }
  async run(e, t, n) {
    const i = e.get(OU);
    i && this.runAction(i);
  }
  async runAction(e) {
    await e.updateValue(RK, !1, 2);
  }
}
class bje extends VW {
  static {
    this.ID = "editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";
  }
  constructor() {
    (super({
      id: bje.ID,
      title: EI(1555, "Disable highlighting of invisible characters"),
      precondition: void 0,
      f1: !1,
    }),
      (this.shortLabel = SI(1547, "Disable Invisible Highlight")));
  }
  async run(e, t, n) {
    const i = e.get(OU);
    i && this.runAction(i);
  }
  async runAction(e) {
    await e.updateValue(TK, !1, 2);
  }
}
class yje extends VW {
  static {
    this.ID = "editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";
  }
  constructor() {
    (super({
      id: yje.ID,
      title: EI(1556, "Disable highlighting of non basic ASCII characters"),
      precondition: void 0,
      f1: !1,
    }),
      (this.shortLabel = SI(1548, "Disable Non ASCII Highlight")));
  }
  async run(e, t, n) {
    const i = e.get(OU);
    i && this.runAction(i);
  }
  async runAction(e) {
    await e.updateValue(IK, !1, 2);
  }
}
class xje extends VW {
  static {
    this.ID = "editor.action.unicodeHighlight.showExcludeOptions";
  }
  constructor() {
    super({ id: xje.ID, title: EI(1557, "Show Exclude Options"), precondition: void 0, f1: !1 });
  }
  async run(e, t) {
    const { codePoint: n, reason: i, inString: r, inComment: o } = t,
      s = String.fromCodePoint(n),
      a = e.get(Ghe),
      l = e.get(OU);
    const c = [];
    if (0 === i.kind)
      for (const h of i.notAmbiguousInLocales)
        c.push({
          label: SI(
            1551,
            'Allow unicode characters that are more common in the language "{0}".',
            h,
          ),
          run: async () => {
            wje(l, [h]);
          },
        });
    if (
      (c.push({
        label: (function (e) {
          return AA.isInvisibleCharacter(e)
            ? SI(1549, "Exclude {0} (invisible character) from being highlighted", hje(e))
            : SI(1550, "Exclude {0} from being highlighted", `${hje(e)} "${s}"`);
        })(n),
        run: () =>
          (async function (e, t) {
            const n = e.getValue(DK);
            let i;
            i = "object" == typeof n && n ? n : {};
            for (const r of t) i[String.fromCodePoint(r)] = !0;
            await e.updateValue(DK, i, 2);
          })(l, [n]),
      }),
      o)
    ) {
      const e = new mje();
      c.push({ label: e.label, run: async () => e.runAction(l) });
    } else if (r) {
      const e = new _je();
      c.push({ label: e.label, run: async () => e.runAction(l) });
    }
    function d(e) {
      return "string" == typeof e.desc.title ? e.desc.title : e.desc.title.value;
    }
    if (0 === i.kind) {
      const e = new vje();
      c.push({ label: d(e), run: async () => e.runAction(l) });
    } else if (1 === i.kind) {
      const e = new bje();
      c.push({ label: d(e), run: async () => e.runAction(l) });
    } else if (2 === i.kind) {
      const e = new yje();
      c.push({ label: d(e), run: async () => e.runAction(l) });
    } else
      !(function (e) {
        throw new Error(`Unexpected value: ${e}`);
      })(i);
    const u = await a.pick(c, { title: dje });
    u && (await u.run());
  }
}
async function wje(e, t) {
  const n = e.inspect(AK).user?.value;
  let i;
  i = "object" == typeof n && n ? Object.assign({}, n) : {};
  for (const r of t) i[r] = !0;
  await e.updateValue(AK, i, 2);
}
(WW(vje), WW(bje), WW(yje), WW(xje), zH(aje.ID, aje, 1), Eme.register(uje));
const Cje = bV("dialogService");
var Sje = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const kje = "ignoreUnusualLineTerminators";
let Eje = class extends PO {
  static {
    this.ID = "editor.contrib.unusualLineTerminatorsDetector";
  }
  constructor(e, t, n) {
    (super(),
      (this._editor = e),
      (this._dialogService = t),
      (this._codeEditorService = n),
      (this._isPresentingDialog = !1),
      (this._config = this._editor.getOption(143)),
      this._register(
        this._editor.onDidChangeConfiguration((e) => {
          e.hasChanged(143) &&
            ((this._config = this._editor.getOption(143)), this._checkForUnusualLineTerminators());
        }),
      ),
      this._register(
        this._editor.onDidChangeModel(() => {
          this._checkForUnusualLineTerminators();
        }),
      ),
      this._register(
        this._editor.onDidChangeModelContent((e) => {
          e.isUndoing || this._checkForUnusualLineTerminators();
        }),
      ),
      this._checkForUnusualLineTerminators());
  }
  async _checkForUnusualLineTerminators() {
    if ("off" === this._config) return;
    if (!this._editor.hasModel()) return;
    const e = this._editor.getModel();
    if (!e.mightContainUnusualLineTerminators()) return;
    const t = (function (e, t) {
      return e.getModelProperty(t.uri, kje);
    })(this._codeEditorService, e);
    if (!0 === t) return;
    if (this._editor.getOption(104)) return;
    if ("auto" === this._config)
      return void e.removeUnusualLineTerminators(this._editor.getSelections());
    if (this._isPresentingDialog) return;
    let n;
    try {
      ((this._isPresentingDialog = !0),
        (n = await this._dialogService.confirm({
          title: SI(1558, "Unusual Line Terminators"),
          message: SI(1559, "Detected unusual line terminators"),
          detail: SI(
            1560,
            "The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",
            dH(e.uri),
          ),
          primaryButton: SI(1561, "&&Remove Unusual Line Terminators"),
          cancelButton: SI(1562, "Ignore"),
        })));
    } finally {
      this._isPresentingDialog = !1;
    }
    n.confirmed
      ? e.removeUnusualLineTerminators(this._editor.getSelections())
      : (function (e, t, n) {
          e.setModelProperty(t.uri, kje, n);
        })(this._codeEditorService, e, !0);
  }
};
((Eje = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Sje(1, Cje), Sje(2, yV)], Eje)),
  zH(Eje.ID, Eje, 1));
const Nje = "**",
  Lje = "[/\\\\]",
  Dje = "[^/\\\\]",
  Tje = /\//g;
function Ije(e, t) {
  switch (e) {
    case 0:
      return "";
    case 1:
      return `${Dje}*?`;
    default:
      return `(?:${Lje}|${Dje}+${Lje}${t ? `|${Lje}${Dje}+` : ""})*?`;
  }
}
function Rje(e, t) {
  if (!e) return [];
  const n = [];
  let i = !1,
    r = !1,
    o = "";
  for (const s of e) {
    switch (s) {
      case t:
        if (!i && !r) {
          (n.push(o), (o = ""));
          continue;
        }
        break;
      case "{":
        i = !0;
        break;
      case "}":
        i = !1;
        break;
      case "[":
        r = !0;
        break;
      case "]":
        r = !1;
    }
    o += s;
  }
  return (o && n.push(o), n);
}
function Oje(e) {
  if (!e) return "";
  let t = "";
  const n = Rje(e, "/");
  if (n.every((e) => e === Nje)) t = ".*";
  else {
    let e = !1;
    n.forEach((i, r) => {
      if (i === Nje) {
        if (e) return;
        t += Ije(2, r === n.length - 1);
      } else {
        let e = !1,
          o = "",
          s = !1,
          a = "";
        for (const n of i)
          if ("}" !== n && e) o += n;
          else {
            if (s && ("]" !== n || !a)) {
              let e;
              ((e = "-" === n ? n : ("^" !== n && "!" !== n) || a ? ("/" === n ? "" : zM(n)) : "^"),
                (a += e));
              continue;
            }
            switch (n) {
              case "{":
                e = !0;
                continue;
              case "[":
                s = !0;
                continue;
              case "}": {
                const n = `(?:${Rje(o, ",")
                  .map((e) => Oje(e))
                  .join("|")})`;
                ((t += n), (e = !1), (o = ""));
                break;
              }
              case "]":
                ((t += "[" + a + "]"), (s = !1), (a = ""));
                break;
              case "?":
                t += Dje;
                continue;
              case "*":
                t += Ije(1);
                continue;
              default:
                t += zM(n);
            }
          }
        r < n.length - 1 && (n[r + 1] !== Nje || r + 2 < n.length) && (t += Lje);
      }
      e = i === Nje;
    });
  }
  return t;
}
const Mje = /^\*\*\/\*\.[\w\.-]+$/,
  Aje = /^\*\*\/([\w\.-]+)\/?$/,
  Pje = /^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,
  jje = /^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,
  Fje = /^\*\*((\/[\w\.-]+)+)\/?$/,
  Bje = /^([\w\.-]+(\/[\w\.-]+)*)\/?$/,
  Vje = new XW(1e4),
  Wje = function () {
    return !1;
  },
  Hje = function () {
    return null;
  };
function zje(e, t) {
  if (!e) return Hje;
  let n;
  ((n = "string" != typeof e ? e.pattern : e), (n = n.trim()));
  const i = t.ignoreCase ?? !1,
    r = {
      ...t,
      equals: i ? sA : (e, t) => e === t,
      endsWith: i ? lA : (e, t) => e.endsWith(t),
      isEqualOrParent: (e, t) => rH(e, t, !jR || i),
    },
    o = `${i ? n.toLowerCase() : n}_${!!t.trimForExclusions}_${i}`;
  let s,
    a = Vje.get(o);
  return (
    a ||
      ((a = Mje.test(n)
        ? (function (e, t, n) {
            return function (i, r) {
              return "string" == typeof i && n.endsWith(i, e) ? t : null;
            };
          })(n.substring(4), n, r)
        : (s = Aje.exec($je(n, r)))
          ? (function (e, t, n) {
              const i = `/${e}`,
                r = `\\${e}`,
                o = function (o, s) {
                  return "string" != typeof o
                    ? null
                    : s
                      ? n.equals(s, e)
                        ? t
                        : null
                      : n.equals(o, e) || n.endsWith(o, i) || n.endsWith(o, r)
                        ? t
                        : null;
                },
                s = [e];
              return ((o.basenames = s), (o.patterns = [t]), (o.allBasenames = s), o);
            })(s[1], n, r)
          : (t.trimForExclusions ? jje : Pje).test(n)
            ? (function (e, t) {
                const n = Gje(
                    e
                      .slice(1, -1)
                      .split(",")
                      .map((e) => zje(e, t))
                      .filter((e) => e !== Hje),
                    e,
                  ),
                  i = n.length;
                if (!i) return Hje;
                if (1 === i) return n[0];
                const r = function (t, i) {
                    for (let r = 0, o = n.length; r < o; r++) if (n[r](t, i)) return e;
                    return null;
                  },
                  o = n.find((e) => !!e.allBasenames);
                o && (r.allBasenames = o.allBasenames);
                const s = n.reduce((e, t) => (t.allPaths ? e.concat(t.allPaths) : e), []);
                s.length && (r.allPaths = s);
                return r;
              })(n, r)
            : (s = Fje.exec($je(n, r)))
              ? qje(s[1].substring(1), n, !0, r)
              : (s = Bje.exec($je(n, r)))
                ? qje(s[1], n, !1, r)
                : (function (e, t) {
                    try {
                      const n = new RegExp(`^${Oje(e)}$`, t.ignoreCase ? "i" : void 0);
                      return function (t) {
                        return ((n.lastIndex = 0), "string" == typeof t && n.test(t) ? e : null);
                      };
                    } catch {
                      return Hje;
                    }
                  })(n, r)),
      Vje.set(o, a)),
    Uje(a, e, r)
  );
}
function Uje(e, t, n) {
  if ("string" == typeof t) return e;
  const i = function (i, r) {
    return n.isEqualOrParent(i, t.base) ? e($M(i.substring(t.base.length), cP), r) : null;
  };
  return (
    (i.allBasenames = e.allBasenames),
    (i.allPaths = e.allPaths),
    (i.basenames = e.basenames),
    (i.patterns = e.patterns),
    i
  );
}
function $je(e, t) {
  return t.trimForExclusions && e.endsWith("/**") ? e.substring(0, e.length - 2) : e;
}
function qje(e, t, n, i) {
  const r = cP === nP.sep,
    o = r ? e : e.replace(Tje, cP),
    s = cP + o,
    a = nP.sep + e;
  let l;
  return (
    (l = n
      ? function (n, l) {
          return "string" == typeof n &&
            (i.equals(n, o) || i.endsWith(n, s) || (!r && (i.equals(n, e) || i.endsWith(n, a))))
            ? t
            : null;
        }
      : function (n, s) {
          return "string" == typeof n && (i.equals(n, o) || (!r && i.equals(n, e))) ? t : null;
        }),
    (l.allPaths = [(n ? "*/" : "./") + e]),
    l
  );
}
function Kje(e, t = {}) {
  if (!e) return Wje;
  if (
    "string" == typeof e ||
    (function (e) {
      const t = e;
      if (!t) return !1;
      return "string" == typeof t.base && "string" == typeof t.pattern;
    })(e)
  ) {
    const n = zje(e, t);
    if (n === Hje) return Wje;
    const i = function (e, t) {
      return !!n(e, t);
    };
    return (
      n.allBasenames && (i.allBasenames = n.allBasenames),
      n.allPaths && (i.allPaths = n.allPaths),
      i
    );
  }
  return (function (e, t) {
    const n = Gje(
        Object.getOwnPropertyNames(e)
          .map((n) =>
            (function (e, t, n) {
              if (!1 === t) return Hje;
              const i = zje(e, n);
              if (i === Hje) return Hje;
              if ("boolean" == typeof t) return i;
              if (t) {
                const n = t.when;
                if ("string" == typeof n) {
                  const t = (t, r, o, s) => {
                    if (!s || !i(t, r)) return null;
                    const a = s(n.replace("$(basename)", () => o));
                    return hM(a) ? a.then((t) => (t ? e : null)) : a ? e : null;
                  };
                  return ((t.requiresSiblings = !0), t);
                }
              }
              return i;
            })(n, e[n], t),
          )
          .filter((e) => e !== Hje),
      ),
      i = n.length;
    if (!i) return Hje;
    if (!n.some((e) => !!e.requiresSiblings)) {
      if (1 === i) return n[0];
      const e = function (e, t) {
          let i;
          for (let r = 0, o = n.length; r < o; r++) {
            const o = n[r](e, t);
            if ("string" == typeof o) return o;
            hM(o) && (i || (i = []), i.push(o));
          }
          return i
            ? (async () => {
                for (const e of i) {
                  const t = await e;
                  if ("string" == typeof t) return t;
                }
                return null;
              })()
            : null;
        },
        t = n.find((e) => !!e.allBasenames);
      t && (e.allBasenames = t.allBasenames);
      const r = n.reduce((e, t) => (t.allPaths ? e.concat(t.allPaths) : e), []);
      return (r.length && (e.allPaths = r), e);
    }
    const r = function (e, t, i) {
        let r, o;
        for (let s = 0, a = n.length; s < a; s++) {
          const a = n[s];
          a.requiresSiblings &&
            i &&
            (t || (t = aP(e)), r || (r = t.substring(0, t.length - lP(e).length)));
          const l = a(e, t, r, i);
          if ("string" == typeof l) return l;
          hM(l) && (o || (o = []), o.push(l));
        }
        return o
          ? (async () => {
              for (const e of o) {
                const t = await e;
                if ("string" == typeof t) return t;
              }
              return null;
            })()
          : null;
      },
      o = n.find((e) => !!e.allBasenames);
    o && (r.allBasenames = o.allBasenames);
    const s = n.reduce((e, t) => (t.allPaths ? e.concat(t.allPaths) : e), []);
    s.length && (r.allPaths = s);
    return r;
  })(e, t);
}
function Gje(e, t) {
  const n = e.filter((e) => !!e.basenames);
  if (n.length < 2) return e;
  const i = n.reduce((e, t) => {
    const n = t.basenames;
    return n ? e.concat(n) : e;
  }, []);
  let r;
  if (t) {
    r = [];
    for (let e = 0, n = i.length; e < n; e++) r.push(t);
  } else
    r = n.reduce((e, t) => {
      const n = t.patterns;
      return n ? e.concat(n) : e;
    }, []);
  const o = function (e, t) {
    if ("string" != typeof e) return null;
    if (!t) {
      let n;
      for (n = e.length; n > 0; n--) {
        const t = e.charCodeAt(n - 1);
        if (47 === t || 92 === t) break;
      }
      t = e.substring(n);
    }
    const n = i.indexOf(t);
    return -1 !== n ? r[n] : null;
  };
  ((o.basenames = i), (o.patterns = r), (o.allBasenames = i));
  const s = e.filter((e) => !e.basenames);
  return (s.push(o), s);
}
function Zje(e, t, n, i, r, o) {
  if (Array.isArray(e)) {
    let s = 0;
    for (const a of e) {
      const e = Zje(a, t, n, i, r, o);
      if (10 === e) return e;
      e > s && (s = e);
    }
    return s;
  }
  if ("string" == typeof e) return i ? ("*" === e ? 5 : e === n ? 10 : 0) : 0;
  if (e) {
    const { language: s, pattern: a, scheme: l, hasAccessToAllModels: c, notebookType: d } = e;
    if (!i && !c) return 0;
    d && r && (t = r);
    let u = 0;
    if (l)
      if (l === t.scheme) u = 10;
      else {
        if ("*" !== l) return 0;
        u = 5;
      }
    if (s)
      if (s === n) u = 10;
      else {
        if ("*" !== s) return 0;
        u = Math.max(u, 5);
      }
    if (d)
      if (d === o) u = 10;
      else {
        if ("*" !== d || void 0 === o) return 0;
        u = Math.max(u, 5);
      }
    if (a) {
      let e;
      if (
        ((e = "string" == typeof a ? a : { ...a, base: iP(a.base) }),
        e !== t.fsPath &&
          !(function (e, t, n) {
            return !(!e || "string" != typeof t) && Kje(e, n)(t);
          })(e, t.fsPath))
      )
        return 0;
      u = 10;
    }
    return u;
  }
  return 0;
}
class Yje {
  constructor() {
    this.selector = { language: "*" };
  }
  provideDocumentHighlights(e, t, n) {
    const i = [],
      r = e.getWordAtPosition({ lineNumber: t.lineNumber, column: t.column });
    if (!r) return Promise.resolve(i);
    if (e.isDisposed()) return;
    return e
      .findMatches(r.word, !0, !1, !0, sU, !1)
      .map((e) => ({ range: e.range, kind: b2.Text }));
  }
  provideMultiDocumentHighlights(e, t, n, i) {
    const r = new KW(),
      o = e.getWordAtPosition({ lineNumber: t.lineNumber, column: t.column });
    if (!o) return Promise.resolve(r);
    for (const s of [e, ...n]) {
      if (s.isDisposed()) continue;
      const e = s
        .findMatches(o.word, !0, !1, !0, sU, !1)
        .map((e) => ({ range: e.range, kind: b2.Text }));
      e && r.set(s.uri, e);
    }
    return r;
  }
}
let Xje = class extends PO {
  constructor(e) {
    (super(),
      this._register(e.documentHighlightProvider.register("*", new Yje())),
      this._register(e.multiDocumentHighlightProvider.register("*", new Yje())));
  }
};
Xje = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, mee),
  ],
  Xje,
);
var Qje,
  Jje,
  eFe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  tFe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const nFe = new yW("hasWordHighlights", !1);
function iFe(e, t, n, i) {
  return yM(
    e
      .ordered(t)
      .map((e) => () => Promise.resolve(e.provideDocumentHighlights(t, n, i)).then(void 0, zI)),
    (e) => null != e,
  ).then((e) => {
    if (e) {
      const n = new KW();
      return (n.set(t.uri, e), n);
    }
    return new KW();
  });
}
class rFe {
  constructor(e, t, n) {
    ((this._model = e),
      (this._selection = t),
      (this._wordSeparators = n),
      (this._wordRange = this._getCurrentWordRange(e, t)),
      (this._result = null));
  }
  get result() {
    return (
      this._result ||
        (this._result = gM((e) =>
          this._compute(this._model, this._selection, this._wordSeparators, e),
        )),
      this._result
    );
  }
  _getCurrentWordRange(e, t) {
    const n = e.getWordAtPosition(t.getPosition());
    return n ? new YH(t.startLineNumber, n.startColumn, t.startLineNumber, n.endColumn) : null;
  }
  cancel() {
    this.result.cancel();
  }
}
class oFe extends rFe {
  constructor(e, t, n, i) {
    (super(e, t, n), (this._providers = i));
  }
  _compute(e, t, n, i) {
    return iFe(this._providers, e, t.getPosition(), i).then((e) => e || new KW());
  }
}
class sFe extends rFe {
  constructor(e, t, n, i, r) {
    (super(e, t, n), (this._providers = i), (this._otherModels = r));
  }
  _compute(e, t, n, i) {
    return (function (e, t, n, i, r) {
      return yM(
        e.ordered(t).map((e) => () => {
          const o = r
            .filter((e) => tU(e))
            .filter((t) => Zje(e.selector, t.uri, t.getLanguageId(), !0, void 0, void 0) > 0);
          return Promise.resolve(e.provideMultiDocumentHighlights(t, n, o, i)).then(void 0, zI);
        }),
        (e) => null != e,
      );
    })(this._providers, e, t.getPosition(), i, this._otherModels).then((e) => e || new KW());
  }
}
FH("_executeDocumentHighlights", async (e, t, n) => {
  const i = e.get(mee),
    r = await iFe(i.documentHighlightProvider, t, n, aM.None);
  return r?.get(t.uri);
});
let aFe = class {
  static {
    Qje = this;
  }
  static {
    this.storedDecorationIDs = new KW();
  }
  static {
    this.query = null;
  }
  constructor(e, t, n, i, r, o, s, a) {
    ((this.toUnhook = new AO()),
      (this.workerRequestTokenId = 0),
      (this.workerRequestCompleted = !1),
      (this.workerRequestValue = new KW()),
      (this.lastCursorPositionChangeTime = 0),
      (this.renderDecorationsTimer = void 0),
      (this.runDelayer = this.toUnhook.add(new mM(50))),
      (this.editor = e),
      (this.providers = t),
      (this.multiDocumentProviders = n),
      (this.codeEditorService = o),
      (this.textModelService = r),
      (this.configurationService = s),
      (this.logService = a),
      (this._hasWordHighlights = nFe.bindTo(i)),
      (this._ignorePositionChangeEvent = !1),
      (this.occurrencesHighlightEnablement = this.editor.getOption(90)),
      (this.occurrencesHighlightDelay = this.configurationService.getValue(
        "editor.occurrencesHighlightDelay",
      )),
      (this.model = this.editor.getModel()),
      this.toUnhook.add(
        e.onDidChangeCursorPosition((e) => {
          this._ignorePositionChangeEvent ||
            ("off" !== this.occurrencesHighlightEnablement &&
              this.runDelayer.trigger(() => {
                this._onPositionChanged(e);
              }));
        }),
      ),
      this.toUnhook.add(
        e.onDidFocusEditorText((e) => {
          "off" !== this.occurrencesHighlightEnablement &&
            (this.workerRequest ||
              this.runDelayer.trigger(() => {
                this._run();
              }));
        }),
      ),
      this.toUnhook.add(
        e.onDidChangeModelContent((e) => {
          LP(this.model.uri, "output") || this._stopAll();
        }),
      ),
      this.toUnhook.add(
        e.onDidChangeModel((e) => {
          !e.newModelUrl && e.oldModelUrl ? this._stopSingular() : Qje.query && this._run();
        }),
      ),
      this.toUnhook.add(
        e.onDidChangeConfiguration((e) => {
          const t = this.editor.getOption(90);
          if (this.occurrencesHighlightEnablement !== t)
            switch (((this.occurrencesHighlightEnablement = t), t)) {
              case "off":
                this._stopAll();
                break;
              case "singleFile":
                this._stopAll(Qje.query?.modelInfo?.modelURI);
                break;
              case "multiFile":
                Qje.query && this._run(!0);
            }
        }),
      ),
      this.toUnhook.add(
        this.configurationService.onDidChangeConfiguration((e) => {
          if (e.affectsConfiguration("editor.occurrencesHighlightDelay")) {
            const e = s.getValue("editor.occurrencesHighlightDelay");
            this.occurrencesHighlightDelay !== e && (this.occurrencesHighlightDelay = e);
          }
        }),
      ),
      this.toUnhook.add(
        e.onDidBlurEditorWidget(() => {
          const e = this.codeEditorService.getFocusedCodeEditor();
          e
            ? e.getModel()?.uri.scheme === NP.vscodeNotebookCell &&
              this.editor.getModel()?.uri.scheme !== NP.vscodeNotebookCell &&
              this._stopAll()
            : this._stopAll();
        }),
      ),
      (this.decorations = this.editor.createDecorationsCollection()),
      (this.workerRequestTokenId = 0),
      (this.workerRequest = null),
      (this.workerRequestCompleted = !1),
      (this.lastCursorPositionChangeTime = 0),
      (this.renderDecorationsTimer = void 0),
      Qje.query && this._run());
  }
  hasDecorations() {
    return this.decorations.length > 0;
  }
  restore(e) {
    "off" !== this.occurrencesHighlightEnablement &&
      (this.runDelayer.cancel(),
      this.runDelayer.trigger(() => {
        this._run(!1, e);
      }));
  }
  stop() {
    "off" !== this.occurrencesHighlightEnablement && this._stopAll();
  }
  _getSortedHighlights() {
    return this.decorations.getRanges().sort(YH.compareRangesUsingStarts);
  }
  moveNext() {
    const e = this._getSortedHighlights(),
      t = e.findIndex((e) => e.containsPosition(this.editor.getPosition())),
      n = (t + 1) % e.length,
      i = e[n];
    try {
      ((this._ignorePositionChangeEvent = !0),
        this.editor.setPosition(i.getStartPosition()),
        this.editor.revealRangeInCenterIfOutsideViewport(i));
      const t = this._getWord();
      if (t) {
        pV(
          `${this.editor.getModel().getLineContent(i.startLineNumber)}, ${n + 1} of ${e.length} for '${t.word}'`,
        );
      }
    } finally {
      this._ignorePositionChangeEvent = !1;
    }
  }
  moveBack() {
    const e = this._getSortedHighlights(),
      t = e.findIndex((e) => e.containsPosition(this.editor.getPosition())),
      n = (t - 1 + e.length) % e.length,
      i = e[n];
    try {
      ((this._ignorePositionChangeEvent = !0),
        this.editor.setPosition(i.getStartPosition()),
        this.editor.revealRangeInCenterIfOutsideViewport(i));
      const t = this._getWord();
      if (t) {
        pV(
          `${this.editor.getModel().getLineContent(i.startLineNumber)}, ${n + 1} of ${e.length} for '${t.word}'`,
        );
      }
    } finally {
      this._ignorePositionChangeEvent = !1;
    }
  }
  _removeSingleDecorations() {
    if (!this.editor.hasModel()) return;
    const e = Qje.storedDecorationIDs.get(this.editor.getModel().uri);
    e &&
      (this.editor.removeDecorations(e),
      Qje.storedDecorationIDs.delete(this.editor.getModel().uri),
      this.decorations.length > 0 && (this.decorations.clear(), this._hasWordHighlights.set(!1)));
  }
  _removeAllDecorations(e) {
    const t = this.codeEditorService.listCodeEditors(),
      n = [];
    for (const i of t) {
      if (!i.hasModel() || lH(i.getModel().uri, e)) continue;
      const t = Qje.storedDecorationIDs.get(i.getModel().uri);
      if (!t) continue;
      (i.removeDecorations(t), n.push(i.getModel().uri));
      const r = lFe.get(i);
      r?.wordHighlighter &&
        r.wordHighlighter.decorations.length > 0 &&
        (r.wordHighlighter.decorations.clear(),
        (r.wordHighlighter.workerRequest = null),
        r.wordHighlighter._hasWordHighlights.set(!1));
    }
    for (const i of n) Qje.storedDecorationIDs.delete(i);
  }
  _stopSingular() {
    (this._removeSingleDecorations(),
      this.editor.hasTextFocus() &&
        (this.editor.getModel()?.uri.scheme !== NP.vscodeNotebookCell &&
        Qje.query?.modelInfo?.modelURI.scheme !== NP.vscodeNotebookCell
          ? ((Qje.query = null), this._run())
          : Qje.query?.modelInfo && (Qje.query.modelInfo = null)),
      void 0 !== this.renderDecorationsTimer &&
        (clearTimeout(this.renderDecorationsTimer), (this.renderDecorationsTimer = void 0)),
      null !== this.workerRequest && (this.workerRequest.cancel(), (this.workerRequest = null)),
      this.workerRequestCompleted ||
        (this.workerRequestTokenId++, (this.workerRequestCompleted = !0)));
  }
  _stopAll(e) {
    (this._removeAllDecorations(e),
      void 0 !== this.renderDecorationsTimer &&
        (clearTimeout(this.renderDecorationsTimer), (this.renderDecorationsTimer = void 0)),
      null !== this.workerRequest && (this.workerRequest.cancel(), (this.workerRequest = null)),
      this.workerRequestCompleted ||
        (this.workerRequestTokenId++, (this.workerRequestCompleted = !0)));
  }
  _onPositionChanged(e) {
    "off" !== this.occurrencesHighlightEnablement && ("api" === e.source || 3 === e.reason)
      ? this._run()
      : this._stopAll();
  }
  _getWord() {
    const e = this.editor.getSelection(),
      t = e.startLineNumber,
      n = e.startColumn;
    return this.model.isDisposed()
      ? null
      : this.model.getWordAtPosition({ lineNumber: t, column: n });
  }
  getOtherModelsToHighlight(e) {
    if (!e) return [];
    if (e.uri.scheme === NP.vscodeNotebookCell) {
      const t = [],
        n = this.codeEditorService.listCodeEditors();
      for (const i of n) {
        const n = i.getModel();
        n && n !== e && n.uri.scheme === NP.vscodeNotebookCell && t.push(n);
      }
      return t;
    }
    const t = [],
      n = this.codeEditorService.listCodeEditors();
    for (const i of n) {
      if (!Cye(i)) continue;
      const n = i.getModel();
      n && e === n.modified && t.push(n.modified);
    }
    if (t.length) return t;
    if ("singleFile" === this.occurrencesHighlightEnablement) return [];
    for (const i of n) {
      const n = i.getModel();
      n && n !== e && t.push(n);
    }
    return t;
  }
  async _run(e, t) {
    if (this.editor.hasTextFocus()) {
      const e = this.editor.getSelection();
      if (!e || e.startLineNumber !== e.endLineNumber)
        return ((Qje.query = null), void this._stopAll());
      const t = e.startColumn,
        n = e.endColumn,
        i = this._getWord();
      if (!i || i.startColumn > t || i.endColumn < n)
        return ((Qje.query = null), void this._stopAll());
      Qje.query = { modelInfo: { modelURI: this.model.uri, selection: e } };
    } else if (!Qje.query) return void this._stopAll();
    if (
      ((this.lastCursorPositionChangeTime = new Date().getTime()),
      lH(this.editor.getModel().uri, Qje.query.modelInfo?.modelURI))
    ) {
      if (!e) {
        const e = this.decorations.getRanges();
        for (const t of e) if (t.containsPosition(this.editor.getPosition())) return;
      }
      this._stopAll(e ? this.model.uri : void 0);
      const n = ++this.workerRequestTokenId;
      this.workerRequestCompleted = !1;
      const i = this.getOtherModelsToHighlight(this.editor.getModel());
      if (!Qje.query || !Qje.query.modelInfo) return;
      const r = await this.textModelService.createModelReference(Qje.query.modelInfo.modelURI);
      try {
        ((this.workerRequest = this.computeWithModel(
          r.object.textEditorModel,
          Qje.query.modelInfo.selection,
          i,
        )),
          this.workerRequest?.result.then((e) => {
            n === this.workerRequestTokenId &&
              ((this.workerRequestCompleted = !0),
              (this.workerRequestValue = e || []),
              this._beginRenderDecorations(t ?? this.occurrencesHighlightDelay));
          }, HI));
      } catch (spt) {
        this.logService.error("Unexpected error during occurrence request. Log: ", spt);
      } finally {
        r.dispose();
      }
    } else if (this.model.uri.scheme === NP.vscodeNotebookCell) {
      const e = ++this.workerRequestTokenId;
      if (((this.workerRequestCompleted = !1), !Qje.query || !Qje.query.modelInfo)) return;
      const n = await this.textModelService.createModelReference(Qje.query.modelInfo.modelURI);
      try {
        ((this.workerRequest = this.computeWithModel(
          n.object.textEditorModel,
          Qje.query.modelInfo.selection,
          [this.model],
        )),
          this.workerRequest?.result.then((n) => {
            e === this.workerRequestTokenId &&
              ((this.workerRequestCompleted = !0),
              (this.workerRequestValue = n || []),
              this._beginRenderDecorations(t ?? this.occurrencesHighlightDelay));
          }, HI));
      } catch (spt) {
        this.logService.error("Unexpected error during occurrence request. Log: ", spt);
      } finally {
        n.dispose();
      }
    }
  }
  computeWithModel(e, t, n) {
    return n.length
      ? (function (e, t, n, i, r) {
          return new sFe(t, n, i, e, r);
        })(this.multiDocumentProviders, e, t, this.editor.getOption(148), n)
      : (function (e, t, n, i) {
          return new oFe(t, n, i, e);
        })(this.providers, e, t, this.editor.getOption(148));
  }
  _beginRenderDecorations(e) {
    const t = new Date().getTime(),
      n = this.lastCursorPositionChangeTime + e;
    t >= n
      ? ((this.renderDecorationsTimer = void 0), this.renderDecorations())
      : (this.renderDecorationsTimer = setTimeout(() => {
          this.renderDecorations();
        }, n - t));
  }
  renderDecorations() {
    this.renderDecorationsTimer = void 0;
    const e = this.codeEditorService.listCodeEditors();
    for (const t of e) {
      const e = lFe.get(t);
      if (!e) continue;
      const n = [],
        i = t.getModel()?.uri;
      if (i && this.workerRequestValue.has(i)) {
        const r = Qje.storedDecorationIDs.get(i),
          o = this.workerRequestValue.get(i);
        if (o) for (const e of o) e.range && n.push({ range: e.range, options: pAe(e.kind) });
        let s = [];
        (t.changeDecorations((e) => {
          s = e.deltaDecorations(r ?? [], n);
        }),
          (Qje.storedDecorationIDs = Qje.storedDecorationIDs.set(i, s)),
          n.length > 0 &&
            (e.wordHighlighter?.decorations.set(n), e.wordHighlighter?._hasWordHighlights.set(!0)));
      }
    }
    this.workerRequest = null;
  }
  dispose() {
    (this._stopSingular(), this.toUnhook.dispose());
  }
};
aFe = Qje = eFe([tFe(4, CV), tFe(5, yV), tFe(6, OU), tFe(7, yH)], aFe);
let lFe = class extends PO {
  static {
    Jje = this;
  }
  static {
    this.ID = "editor.contrib.wordHighlighter";
  }
  static get(e) {
    return e.getContribution(Jje.ID);
  }
  constructor(e, t, n, i, r, o, s) {
    (super(), (this._wordHighlighter = null));
    const a = () => {
      e.hasModel() &&
        !e.getModel().isTooLargeForTokenization() &&
        e.getModel().uri.scheme !== NP.accessibleView &&
        (this._wordHighlighter = new aFe(
          e,
          n.documentHighlightProvider,
          n.multiDocumentHighlightProvider,
          t,
          r,
          i,
          o,
          s,
        ));
    };
    (this._register(
      e.onDidChangeModel((e) => {
        (this._wordHighlighter &&
          (e.newModelUrl ||
            e.oldModelUrl?.scheme === NP.vscodeNotebookCell ||
            this.wordHighlighter?.stop(),
          this._wordHighlighter.dispose(),
          (this._wordHighlighter = null)),
          a());
      }),
    ),
      a());
  }
  get wordHighlighter() {
    return this._wordHighlighter;
  }
  saveViewState() {
    return !(!this._wordHighlighter || !this._wordHighlighter.hasDecorations());
  }
  moveNext() {
    this._wordHighlighter?.moveNext();
  }
  moveBack() {
    this._wordHighlighter?.moveBack();
  }
  restoreViewState(e) {
    this._wordHighlighter && e && this._wordHighlighter.restore(250);
  }
  dispose() {
    (this._wordHighlighter && (this._wordHighlighter.dispose(), (this._wordHighlighter = null)),
      super.dispose());
  }
};
lFe = Jje = eFe([tFe(1, xW), tFe(2, mee), tFe(3, yV), tFe(4, CV), tFe(5, OU), tFe(6, yH)], lFe);
class cFe extends AH {
  constructor(e, t) {
    (super(t), (this._isNext = e));
  }
  run(e, t) {
    const n = lFe.get(t);
    n && (this._isNext ? n.moveNext() : n.moveBack());
  }
}
(zH(lFe.ID, lFe, 0),
  VH(
    class extends cFe {
      constructor() {
        super(!0, {
          id: "editor.action.wordHighlight.next",
          label: EI(1572, "Go to Next Symbol Highlight"),
          precondition: nFe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 65, weight: 100 },
        });
      }
    },
  ),
  VH(
    class extends cFe {
      constructor() {
        super(!1, {
          id: "editor.action.wordHighlight.prev",
          label: EI(1573, "Go to Previous Symbol Highlight"),
          precondition: nFe,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 1089, weight: 100 },
        });
      }
    },
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.wordHighlight.trigger",
          label: EI(1574, "Trigger Symbol Highlight"),
          precondition: void 0,
          kbOpts: { kbExpr: $$.editorTextFocus, primary: 0, weight: 100 },
        });
      }
      run(e, t, n) {
        const i = lFe.get(t);
        i && i.restoreViewState(!0);
      }
    },
  ),
  xme(Xje));
class dFe extends MH {
  constructor(e) {
    (super(e),
      (this._inSelectionMode = e.inSelectionMode),
      (this._wordNavigationType = e.wordNavigationType));
  }
  runEditorCommand(e, t, n) {
    if (!t.hasModel()) return;
    const i = Mz(t.getOption(148), t.getOption(147)),
      r = t.getModel(),
      o = t.getSelections(),
      s = o.length > 1,
      a = o.map((e) => {
        const t = new xV(e.positionLineNumber, e.positionColumn),
          n = this._move(i, r, t, this._wordNavigationType, s);
        return this._moveTo(e, n, this._inSelectionMode);
      });
    if (
      (r.pushStackElement(),
      t._getViewModel().setCursorStates(
        "moveWordCommand",
        3,
        a.map((e) => lz.fromModelSelection(e)),
      ),
      1 === a.length)
    ) {
      const e = new xV(a[0].positionLineNumber, a[0].positionColumn);
      t.revealPosition(e, 0);
    }
  }
  _moveTo(e, t, n) {
    return n
      ? new XH(e.selectionStartLineNumber, e.selectionStartColumn, t.lineNumber, t.column)
      : new XH(t.lineNumber, t.column, t.lineNumber, t.column);
  }
}
class uFe extends dFe {
  _move(e, t, n, i, r) {
    return Az.moveWordLeft(e, t, n, i, r);
  }
}
class hFe extends dFe {
  _move(e, t, n, i, r) {
    return Az.moveWordRight(e, t, n, i);
  }
}
class gFe extends MH {
  constructor(e) {
    (super({ canTriggerInlineEdits: !0, ...e }),
      (this._whitespaceHeuristics = e.whitespaceHeuristics),
      (this._wordNavigationType = e.wordNavigationType));
  }
  runEditorCommand(e, t, n) {
    const i = e?.get(f$);
    if (!t.hasModel() || !i) return;
    const r = Mz(t.getOption(148), t.getOption(147)),
      o = t.getModel(),
      s = t.getSelections(),
      a = t.getOption(10),
      l = t.getOption(15),
      c = i.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),
      d = t._getViewModel(),
      u = s.map((e) => {
        const n = this._delete(
          {
            wordSeparators: r,
            model: o,
            selection: e,
            whitespaceHeuristics: this._whitespaceHeuristics,
            autoClosingDelete: t.getOption(13),
            autoClosingBrackets: a,
            autoClosingQuotes: l,
            autoClosingPairs: c,
            autoClosedCharacters: d.getCursorAutoClosedCharacters(),
          },
          this._wordNavigationType,
        );
        return new fz(n, "");
      });
    (t.pushUndoStop(), t.executeCommands(this.id, u), t.pushUndoStop());
  }
}
class pFe extends gFe {
  _delete(e, t) {
    const n = Az.deleteWordLeft(e, t);
    return n || new YH(1, 1, 1, 1);
  }
}
class fFe extends gFe {
  _delete(e, t) {
    const n = Az.deleteWordRight(e, t);
    if (n) return n;
    const i = e.model.getLineCount(),
      r = e.model.getLineMaxColumn(i);
    return new YH(i, r, i, r);
  }
}
(BH(
  new (class extends uFe {
    constructor() {
      super({
        inSelectionMode: !1,
        wordNavigationType: 0,
        id: "cursorWordStartLeft",
        precondition: void 0,
      });
    }
  })(),
),
  BH(
    new (class extends uFe {
      constructor() {
        super({
          inSelectionMode: !1,
          wordNavigationType: 2,
          id: "cursorWordEndLeft",
          precondition: void 0,
        });
      }
    })(),
  ),
  BH(
    new (class extends uFe {
      constructor() {
        super({
          inSelectionMode: !1,
          wordNavigationType: 1,
          id: "cursorWordLeft",
          precondition: void 0,
          kbOpts: {
            kbExpr: eW.and($$.textInputFocus, eW.and(GK, Twe)?.negate()),
            primary: 2063,
            mac: { primary: 527 },
            weight: 100,
          },
        });
      }
    })(),
  ),
  BH(
    new (class extends uFe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 0,
          id: "cursorWordStartLeftSelect",
          precondition: void 0,
        });
      }
    })(),
  ),
  BH(
    new (class extends uFe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 2,
          id: "cursorWordEndLeftSelect",
          precondition: void 0,
        });
      }
    })(),
  ),
  BH(
    new (class extends uFe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 1,
          id: "cursorWordLeftSelect",
          precondition: void 0,
          kbOpts: {
            kbExpr: eW.and($$.textInputFocus, eW.and(GK, Twe)?.negate()),
            primary: 3087,
            mac: { primary: 1551 },
            weight: 100,
          },
        });
      }
    })(),
  ),
  BH(
    new (class extends hFe {
      constructor() {
        super({
          inSelectionMode: !1,
          wordNavigationType: 0,
          id: "cursorWordStartRight",
          precondition: void 0,
        });
      }
    })(),
  ),
  BH(
    new (class extends hFe {
      constructor() {
        super({
          inSelectionMode: !1,
          wordNavigationType: 2,
          id: "cursorWordEndRight",
          precondition: void 0,
          kbOpts: {
            kbExpr: eW.and($$.textInputFocus, eW.and(GK, Twe)?.negate()),
            primary: 2065,
            mac: { primary: 529 },
            weight: 100,
          },
        });
      }
    })(),
  ),
  BH(
    new (class extends hFe {
      constructor() {
        super({
          inSelectionMode: !1,
          wordNavigationType: 2,
          id: "cursorWordRight",
          precondition: void 0,
        });
      }
    })(),
  ),
  BH(
    new (class extends hFe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 0,
          id: "cursorWordStartRightSelect",
          precondition: void 0,
        });
      }
    })(),
  ),
  BH(
    new (class extends hFe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 2,
          id: "cursorWordEndRightSelect",
          precondition: void 0,
          kbOpts: {
            kbExpr: eW.and($$.textInputFocus, eW.and(GK, Twe)?.negate()),
            primary: 3089,
            mac: { primary: 1553 },
            weight: 100,
          },
        });
      }
    })(),
  ),
  BH(
    new (class extends hFe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 2,
          id: "cursorWordRightSelect",
          precondition: void 0,
        });
      }
    })(),
  ),
  BH(
    new (class extends uFe {
      constructor() {
        super({
          inSelectionMode: !1,
          wordNavigationType: 3,
          id: "cursorWordAccessibilityLeft",
          precondition: void 0,
        });
      }
      _move(e, t, n, i, r) {
        return super._move(Mz(BK.wordSeparators.defaultValue, e.intlSegmenterLocales), t, n, i, r);
      }
    })(),
  ),
  BH(
    new (class extends uFe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 3,
          id: "cursorWordAccessibilityLeftSelect",
          precondition: void 0,
        });
      }
      _move(e, t, n, i, r) {
        return super._move(Mz(BK.wordSeparators.defaultValue, e.intlSegmenterLocales), t, n, i, r);
      }
    })(),
  ),
  BH(
    new (class extends hFe {
      constructor() {
        super({
          inSelectionMode: !1,
          wordNavigationType: 3,
          id: "cursorWordAccessibilityRight",
          precondition: void 0,
        });
      }
      _move(e, t, n, i, r) {
        return super._move(Mz(BK.wordSeparators.defaultValue, e.intlSegmenterLocales), t, n, i, r);
      }
    })(),
  ),
  BH(
    new (class extends hFe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 3,
          id: "cursorWordAccessibilityRightSelect",
          precondition: void 0,
        });
      }
      _move(e, t, n, i, r) {
        return super._move(Mz(BK.wordSeparators.defaultValue, e.intlSegmenterLocales), t, n, i, r);
      }
    })(),
  ),
  BH(
    new (class extends pFe {
      constructor() {
        super({
          whitespaceHeuristics: !1,
          wordNavigationType: 0,
          id: "deleteWordStartLeft",
          precondition: $$.writable,
        });
      }
    })(),
  ),
  BH(
    new (class extends pFe {
      constructor() {
        super({
          whitespaceHeuristics: !1,
          wordNavigationType: 2,
          id: "deleteWordEndLeft",
          precondition: $$.writable,
        });
      }
    })(),
  ),
  BH(
    new (class extends pFe {
      constructor() {
        super({
          whitespaceHeuristics: !0,
          wordNavigationType: 0,
          id: "deleteWordLeft",
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 2049, mac: { primary: 513 }, weight: 100 },
        });
      }
    })(),
  ),
  BH(
    new (class extends fFe {
      constructor() {
        super({
          whitespaceHeuristics: !1,
          wordNavigationType: 0,
          id: "deleteWordStartRight",
          precondition: $$.writable,
        });
      }
    })(),
  ),
  BH(
    new (class extends fFe {
      constructor() {
        super({
          whitespaceHeuristics: !1,
          wordNavigationType: 2,
          id: "deleteWordEndRight",
          precondition: $$.writable,
        });
      }
    })(),
  ),
  BH(
    new (class extends fFe {
      constructor() {
        super({
          whitespaceHeuristics: !0,
          wordNavigationType: 2,
          id: "deleteWordRight",
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 2068, mac: { primary: 532 }, weight: 100 },
        });
      }
    })(),
  ),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "deleteInsideWord",
          precondition: $$.writable,
          label: EI(1575, "Delete Word"),
        });
      }
      run(e, t, n) {
        if (!t.hasModel()) return;
        const i = Mz(t.getOption(148), t.getOption(147)),
          r = t.getModel(),
          o = t.getSelections().map((e) => {
            const t = Az.deleteInsideWord(i, r, e);
            return new fz(t, "");
          });
        (t.pushUndoStop(), t.executeCommands(this.id, o), t.pushUndoStop());
      }
    },
  ));
class mFe extends dFe {
  _move(e, t, n, i, r) {
    return Pz.moveWordPartLeft(e, t, n, r);
  }
}
jV.registerCommandAlias("cursorWordPartStartLeft", "cursorWordPartLeft");
jV.registerCommandAlias("cursorWordPartStartLeftSelect", "cursorWordPartLeftSelect");
class _Fe extends dFe {
  _move(e, t, n, i, r) {
    return Pz.moveWordPartRight(e, t, n);
  }
}
(BH(
  new (class extends gFe {
    constructor() {
      super({
        whitespaceHeuristics: !0,
        wordNavigationType: 0,
        id: "deleteWordPartLeft",
        precondition: $$.writable,
        kbOpts: { kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 769 }, weight: 100 },
      });
    }
    _delete(e, t) {
      const n = Pz.deleteWordPartLeft(e);
      return n || new YH(1, 1, 1, 1);
    }
  })(),
),
  BH(
    new (class extends gFe {
      constructor() {
        super({
          whitespaceHeuristics: !0,
          wordNavigationType: 2,
          id: "deleteWordPartRight",
          precondition: $$.writable,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 788 }, weight: 100 },
        });
      }
      _delete(e, t) {
        const n = Pz.deleteWordPartRight(e);
        if (n) return n;
        const i = e.model.getLineCount(),
          r = e.model.getLineMaxColumn(i);
        return new YH(i, r, i, r);
      }
    })(),
  ),
  BH(
    new (class extends mFe {
      constructor() {
        super({
          inSelectionMode: !1,
          wordNavigationType: 0,
          id: "cursorWordPartLeft",
          precondition: void 0,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 783 }, weight: 100 },
        });
      }
    })(),
  ),
  BH(
    new (class extends mFe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 0,
          id: "cursorWordPartLeftSelect",
          precondition: void 0,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 1807 }, weight: 100 },
        });
      }
    })(),
  ),
  BH(
    new (class extends _Fe {
      constructor() {
        super({
          inSelectionMode: !1,
          wordNavigationType: 2,
          id: "cursorWordPartRight",
          precondition: void 0,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 785 }, weight: 100 },
        });
      }
    })(),
  ),
  BH(
    new (class extends _Fe {
      constructor() {
        super({
          inSelectionMode: !0,
          wordNavigationType: 2,
          id: "cursorWordPartRightSelect",
          precondition: void 0,
          kbOpts: { kbExpr: $$.textInputFocus, primary: 0, mac: { primary: 1809 }, weight: 100 },
        });
      }
    })(),
  ));
class vFe extends PO {
  static {
    this.ID = "editor.contrib.readOnlyMessageController";
  }
  constructor(e) {
    (super(),
      (this.editor = e),
      this._register(this.editor.onDidAttemptReadOnlyEdit(() => this._onDidAttemptReadOnlyEdit())));
  }
  _onDidAttemptReadOnlyEdit() {
    const e = Cge.get(this.editor);
    if (e && this.editor.hasModel()) {
      let t = this.editor.getOptions().get(105);
      (t ||
        (t = this.editor.isSimpleWidget
          ? new rre(SI(1378, "Cannot edit in read-only input"))
          : new rre(SI(1379, "Cannot edit in read-only editor"))),
        e.showMessage(t, this.editor.getPosition()));
    }
  }
}
zH(vFe.ID, vFe, 2);
var bFe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let yFe = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this._textModel = e),
      (this._languageFeaturesService = t),
      (this._outlineModelService = n),
      (this._currentModel = LF(this, void 0)));
    const i = $ce(
        "documentSymbolProvider.onDidChange",
        this._languageFeaturesService.documentSymbolProvider.onDidChange,
      ),
      r = $ce(
        "_textModel.onDidChangeContent",
        $O.debounce(
          (e) => this._textModel.onDidChangeContent(e),
          () => {},
          100,
        ),
      );
    this._register(
      aF(async (e, t) => {
        (i.read(e), r.read(e));
        const n = t.add(new Ole()),
          o = await this._outlineModelService.getOrCreate(this._textModel, n.token);
        t.isDisposed || this._currentModel.set(o, void 0);
      }),
    );
  }
  getBreadcrumbItems(e, t) {
    const n = this._currentModel.read(t);
    if (!n) return [];
    const i = n
      .asListOfDocumentSymbols()
      .filter((t) => e.contains(t.range.startLineNumber) && !e.contains(t.range.endLineNumber));
    return (
      i.sort(wj(bj((e) => e.range.endLineNumber - e.range.startLineNumber, yj))),
      i.map((e) => ({ name: e.name, kind: e.kind, startLineNumber: e.range.startLineNumber }))
    );
  }
};
((yFe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([bFe(1, mee), bFe(2, zNe)], yFe)),
  uhe.setBreadcrumbsSourceFactory((e, t) => t.createInstance(yFe, e)));
var xFe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let wFe = class extends PO {
  static {
    this.ID = "editor.contrib.floatingToolbar";
  }
  constructor(e, t, n, i) {
    super();
    const r = this._register(xde(e)),
      o = this._register(i.createMenu(MW.EditorContent, e.contextKeyService)),
      s = gF(this, o.onDidChange, () => 0 === o.getActions().length);
    this._register(
      rF((e) => {
        if (s.read(e)) return;
        const i = GB("div.floating-menu-overlay-widget");
        i.root.style.height = "28px";
        const o = t.createInstance(Zue, i.root, MW.EditorContent, {
          actionViewItemProvider: (e, i) => {
            if (!(e instanceof BW)) return;
            const r = n.lookupKeybinding(e.id);
            return r
              ? t.createInstance(
                  class extends Lue {
                    updateLabel() {
                      this.options.label &&
                        this.label &&
                        (this.label.textContent = `${this._commandAction.label} (${r.getLabel()})`);
                    }
                  },
                  e,
                  { ...i, keybindingNotRenderedWithLabel: !0 },
                )
              : void 0;
          },
          hiddenItemStrategy: 0,
          menuOptions: { shouldForwardArgs: !0 },
          telemetrySource: "editor.overlayToolbar",
          toolbarOptions: { primaryGroup: () => !0, useSeparatorsInPrimaryActions: !0 },
        });
        (e.store.add(o),
          e.store.add(
            rF((e) => {
              const t = r.model.read(e);
              o.context = t?.uri;
            }),
          ),
          e.store.add(
            r.createOverlayWidget({
              allowEditorOverflow: !1,
              domNode: i.root,
              minContentWidthInPx: xne(0),
              position: xne({ preference: 1 }),
            }),
          ));
      }),
    );
  }
};
var CFe, SFe, kFe, EFe, NFe, LFe, DFe, TFe;
((wFe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([xFe(1, vV), xFe(2, N5), xFe(3, AW)], wFe)),
  zH(wFe.ID, wFe, 1),
  (function (e) {
    e.inspectTokensAction = SI(786, "Developer: Inspect Tokens");
  })(CFe || (CFe = {})),
  (function (e) {
    e.gotoLineActionLabel = SI(787, "Go to Line/Column...");
  })(SFe || (SFe = {})),
  (function (e) {
    e.helpQuickAccessActionLabel = SI(788, "Show all Quick Access Providers");
  })(kFe || (kFe = {})),
  (function (e) {
    ((e.quickCommandActionLabel = SI(789, "Command Palette")),
      (e.quickCommandHelp = SI(790, "Show And Run Commands")));
  })(EFe || (EFe = {})),
  (function (e) {
    ((e.quickOutlineActionLabel = SI(791, "Go to Symbol...")),
      (e.quickOutlineByCategoryActionLabel = SI(792, "Go to Symbol by Category...")));
  })(NFe || (NFe = {})),
  (function (e) {
    e.editorViewAccessibleLabel = SI(793, "Editor content");
  })(LFe || (LFe = {})),
  (function (e) {
    e.toggleHighContrast = SI(794, "Toggle High Contrast Theme");
  })(DFe || (DFe = {})),
  (function (e) {
    e.bulkEditServiceSummary = SI(795, "Made {0} edits in {1} files");
  })(TFe || (TFe = {})));
class IFe extends PO {
  static {
    this.ID = "editor.contrib.iPadShowKeyboard";
  }
  constructor(e) {
    (super(),
      (this.editor = e),
      (this.widget = null),
      WR && (this._register(e.onDidChangeConfiguration(() => this.update())), this.update()));
  }
  update() {
    const e = !this.editor.getOption(104);
    !this.widget && e
      ? (this.widget = new RFe(this.editor))
      : this.widget && !e && (this.widget.dispose(), (this.widget = null));
  }
  dispose() {
    (super.dispose(), this.widget && (this.widget.dispose(), (this.widget = null)));
  }
}
class RFe extends PO {
  static {
    this.ID = "editor.contrib.ShowKeyboardWidget";
  }
  constructor(e) {
    (super(),
      (this.editor = e),
      (this._domNode = document.createElement("textarea")),
      (this._domNode.className = "iPadShowKeyboard"),
      this._register(
        $F(this._domNode, "touchstart", (e) => {
          this.editor.focus();
        }),
      ),
      this._register(
        $F(this._domNode, "focus", (e) => {
          this.editor.focus();
        }),
      ),
      this.editor.addOverlayWidget(this));
  }
  dispose() {
    (this.editor.removeOverlayWidget(this), super.dispose());
  }
  getId() {
    return RFe.ID;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return { preference: 1 };
  }
}
zH(IFe.ID, IFe, 3);
const OFe = bV("themeService");
var MFe,
  AFe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let PFe = class extends PO {
  static {
    MFe = this;
  }
  static {
    this.ID = "editor.contrib.inspectTokens";
  }
  static get(e) {
    return e.getContribution(MFe.ID);
  }
  constructor(e, t, n) {
    (super(),
      (this._editor = e),
      (this._languageService = n),
      (this._widget = null),
      this._register(this._editor.onDidChangeModel((e) => this.stop())),
      this._register(this._editor.onDidChangeModelLanguage((e) => this.stop())),
      this._register(I2.onDidChange((e) => this.stop())),
      this._register(this._editor.onKeyUp((e) => 9 === e.keyCode && this.stop())));
  }
  dispose() {
    (this.stop(), super.dispose());
  }
  launch() {
    this._widget ||
      (this._editor.hasModel() && (this._widget = new jFe(this._editor, this._languageService)));
  }
  stop() {
    this._widget && (this._widget.dispose(), (this._widget = null));
  }
};
PFe = MFe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([AFe(1, OFe), AFe(2, BU)], PFe);
class jFe extends PO {
  static {
    this._ID = "editor.contrib.inspectTokensWidget";
  }
  constructor(e, t) {
    (super(),
      (this.allowEditorOverflow = !0),
      (this._editor = e),
      (this._languageService = t),
      (this._model = this._editor.getModel()),
      (this._domNode = document.createElement("div")),
      (this._domNode.className = "tokens-inspect-widget"),
      (this._tokenizationSupport = (function (e, t) {
        const n = I2.get(t);
        if (n) return n;
        const i = e.encodeLanguageId(t);
        return {
          getInitialState: () => J9,
          tokenize: (e, n, i) => e7(t, i),
          tokenizeEncoded: (e, t, n) => t7(i, n),
        };
      })(this._languageService.languageIdCodec, this._model.getLanguageId())),
      this._compute(this._editor.getPosition()),
      this._register(
        this._editor.onDidChangeCursorPosition((e) => this._compute(this._editor.getPosition())),
      ),
      this._editor.addContentWidget(this));
  }
  dispose() {
    (this._editor.removeContentWidget(this), super.dispose());
  }
  getId() {
    return jFe._ID;
  }
  _compute(e) {
    const t = this._getTokensAtLine(e.lineNumber);
    let n = 0;
    for (let a = t.tokens1.length - 1; a >= 0; a--) {
      const i = t.tokens1[a];
      if (e.column - 1 >= i.offset) {
        n = a;
        break;
      }
    }
    let i = 0;
    for (let a = t.tokens2.length >>> 1; a >= 0; a--)
      if (e.column - 1 >= t.tokens2[a << 1]) {
        i = a;
        break;
      }
    const r = this._model.getLineContent(e.lineNumber);
    let o = "";
    if (n < t.tokens1.length) {
      const e = t.tokens1[n].offset,
        i = n + 1 < t.tokens1.length ? t.tokens1[n + 1].offset : r.length;
      o = r.substring(e, i);
    }
    (PB(
      this._domNode,
      VB(
        "h2.tm-token",
        void 0,
        (function (e) {
          let t = "";
          for (let n = 0, i = e.length; n < i; n++) {
            const i = e.charCodeAt(n);
            switch (i) {
              case 9:
                t += "→";
                break;
              case 32:
                t += "·";
                break;
              default:
                t += String.fromCharCode(i);
            }
          }
          return t;
        })(o),
        VB("span.tm-token-length", void 0, `${o.length} ${1 === o.length ? "char" : "chars"}`),
      ),
    ),
      MB(this._domNode, VB("hr.tokens-inspect-separator", { style: "clear:both" })));
    const s =
      1 + (i << 1) < t.tokens2.length ? this._decodeMetadata(t.tokens2[1 + (i << 1)]) : null;
    (MB(
      this._domNode,
      VB(
        "table.tm-metadata-table",
        void 0,
        VB(
          "tbody",
          void 0,
          VB(
            "tr",
            void 0,
            VB("td.tm-metadata-key", void 0, "language"),
            VB("td.tm-metadata-value", void 0, `${s ? s.languageId : "-?-"}`),
          ),
          VB(
            "tr",
            void 0,
            VB("td.tm-metadata-key", void 0, "token type"),
            VB(
              "td.tm-metadata-value",
              void 0,
              `${s ? this._tokenTypeToString(s.tokenType) : "-?-"}`,
            ),
          ),
          VB(
            "tr",
            void 0,
            VB("td.tm-metadata-key", void 0, "font style"),
            VB(
              "td.tm-metadata-value",
              void 0,
              `${s ? this._fontStyleToString(s.fontStyle) : "-?-"}`,
            ),
          ),
          VB(
            "tr",
            void 0,
            VB("td.tm-metadata-key", void 0, "foreground"),
            VB(
              "td.tm-metadata-value",
              void 0,
              `${s ? vG.Format.CSS.formatHex(s.foreground) : "-?-"}`,
            ),
          ),
          VB(
            "tr",
            void 0,
            VB("td.tm-metadata-key", void 0, "background"),
            VB(
              "td.tm-metadata-value",
              void 0,
              `${s ? vG.Format.CSS.formatHex(s.background) : "-?-"}`,
            ),
          ),
        ),
      ),
    ),
      MB(this._domNode, VB("hr.tokens-inspect-separator")),
      n < t.tokens1.length &&
        MB(this._domNode, VB("span.tm-token-type", void 0, t.tokens1[n].type)),
      this._editor.layoutContentWidget(this));
  }
  _decodeMetadata(e) {
    const t = I2.getColorMap(),
      n = E$.getLanguageId(e),
      i = E$.getTokenType(e),
      r = E$.getFontStyle(e),
      o = E$.getForeground(e),
      s = E$.getBackground(e);
    return {
      languageId: this._languageService.languageIdCodec.decodeLanguageId(n),
      tokenType: i,
      fontStyle: r,
      foreground: t[o],
      background: t[s],
    };
  }
  _tokenTypeToString(e) {
    switch (e) {
      case 0:
        return "Other";
      case 1:
        return "Comment";
      case 2:
        return "String";
      case 3:
        return "RegEx";
      default:
        return "??";
    }
  }
  _fontStyleToString(e) {
    let t = "";
    return (
      1 & e && (t += "italic "),
      2 & e && (t += "bold "),
      4 & e && (t += "underline "),
      8 & e && (t += "strikethrough "),
      0 === t.length && (t = "---"),
      t
    );
  }
  _getTokensAtLine(e) {
    const t = this._getStateBeforeLine(e),
      n = this._tokenizationSupport.tokenize(this._model.getLineContent(e), !0, t),
      i = this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e), !0, t);
    return { startState: t, tokens1: n.tokens, tokens2: i.tokens, endState: n.endState };
  }
  _getStateBeforeLine(e) {
    let t = this._tokenizationSupport.getInitialState();
    for (let n = 1; n < e; n++) {
      t = this._tokenizationSupport.tokenize(this._model.getLineContent(n), !0, t).endState;
    }
    return t;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return { position: this._editor.getPosition(), preference: [2, 1] };
  }
}
var FFe;
(zH(PFe.ID, PFe, 4),
  VH(
    class extends AH {
      constructor() {
        super({
          id: "editor.action.inspectTokens",
          label: CFe.inspectTokensAction,
          alias: "Developer: Inspect Tokens",
          precondition: void 0,
        });
      }
      run(e, t) {
        const n = PFe.get(t);
        n?.launch();
      }
    },
  ),
  (function (e) {
    ((e[(e.PRESERVE = 0)] = "PRESERVE"), (e[(e.LAST = 1)] = "LAST"));
  })(FFe || (FFe = {})));
const BFe = "workbench.contributions.quickaccess";
NW.add(
  BFe,
  new (class {
    constructor() {
      ((this.providers = []), (this.defaultProvider = void 0));
    }
    registerQuickAccessProvider(e) {
      return (
        0 === e.prefix.length ? (this.defaultProvider = e) : this.providers.push(e),
        this.providers.sort((e, t) => t.prefix.length - e.prefix.length),
        MO(() => {
          (this.providers.splice(this.providers.indexOf(e), 1),
            this.defaultProvider === e && (this.defaultProvider = void 0));
        })
      );
    }
    getQuickAccessProviders() {
      return rj([this.defaultProvider, ...this.providers]);
    }
    getQuickAccessProvider(e) {
      return (
        (e && this.providers.find((t) => e.startsWith(t.prefix))) || void 0 || this.defaultProvider
      );
    }
  })(),
);
var VFe,
  WFe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let HFe = class {
  static {
    VFe = this;
  }
  static {
    this.PREFIX = "?";
  }
  constructor(e, t) {
    ((this.quickInputService = e), (this.keybindingService = t), (this.registry = NW.as(BFe)));
  }
  provide(e) {
    const t = new AO();
    return (
      t.add(
        e.onDidAccept(() => {
          const [t] = e.selectedItems;
          t && this.quickInputService.quickAccess.show(t.prefix, { preserveValue: !0 });
        }),
      ),
      t.add(
        e.onDidChangeValue((e) => {
          const t = this.registry.getQuickAccessProvider(e.substr(VFe.PREFIX.length));
          t &&
            t.prefix &&
            t.prefix !== VFe.PREFIX &&
            this.quickInputService.quickAccess.show(t.prefix, { preserveValue: !0 });
        }),
      ),
      (e.items = this.getQuickAccessProviders().filter((e) => e.prefix !== VFe.PREFIX)),
      t
    );
  }
  getQuickAccessProviders() {
    return this.registry
      .getQuickAccessProviders()
      .sort((e, t) => e.prefix.localeCompare(t.prefix))
      .flatMap((e) => this.createPicks(e));
  }
  createPicks(e) {
    return e.helpEntries.map((t) => {
      const n = t.prefix || e.prefix,
        i = n || "…";
      return {
        prefix: n,
        label: i,
        keybinding: t.commandId ? this.keybindingService.lookupKeybinding(t.commandId) : void 0,
        ariaLabel: SI(1747, "{0}, {1}", i, t.description),
        description: t.description,
      };
    });
  }
};
((HFe = VFe =
  (function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  })([WFe(0, Ghe), WFe(1, N5)], HFe)),
  NW.as(BFe).registerQuickAccessProvider({
    ctor: HFe,
    prefix: "",
    helpEntries: [{ description: kFe.helpQuickAccessActionLabel }],
  }));
class zFe {
  constructor(e) {
    ((this.options = e), (this.rangeHighlightDecorationId = void 0));
  }
  provide(e, t, n) {
    const i = new AO();
    ((e.canAcceptInBackground = !!this.options?.canAcceptInBackground),
      (e.matchOnLabel = e.matchOnDescription = e.matchOnDetail = e.sortByLabel = !1));
    const r = i.add(new jO());
    return (
      (r.value = this.doProvide(e, t, n)),
      i.add(
        this.onDidActiveTextEditorControlChange(() => {
          ((r.value = void 0), (r.value = this.doProvide(e, t)));
        }),
      ),
      i
    );
  }
  doProvide(e, t, n) {
    const i = new AO(),
      r = this.activeTextEditorControl;
    if (r && this.canProvideWithTextEditor(r)) {
      const o = { editor: r },
        s = Sye(r);
      if (s) {
        let e = r.saveViewState() ?? void 0;
        (i.add(
          s.onDidChangeCursorPosition(() => {
            e = r.saveViewState() ?? void 0;
          }),
        ),
          (o.restoreViewState = () => {
            e && r === this.activeTextEditorControl && r.restoreViewState(e);
          }),
          i.add(LO(t.onCancellationRequested)(() => o.restoreViewState?.())));
      }
      (i.add(MO(() => this.clearDecorations(r))), i.add(this.provideWithTextEditor(o, e, t, n)));
    } else i.add(this.provideWithoutTextEditor(e, t));
    return i;
  }
  canProvideWithTextEditor(e) {
    return !0;
  }
  gotoLocation({ editor: e }, t) {
    (e.setSelection(t.range, "code.jump"),
      e.revealRangeInCenter(t.range, 0),
      t.preserveFocus || e.focus());
    const n = e.getModel();
    n && "getLineContent" in n && fV(`${n.getLineContent(t.range.startLineNumber)}`);
  }
  getModel(e) {
    return Cye(e) ? e.getModel()?.modified : e.getModel();
  }
  addDecorations(e, t) {
    e.changeDecorations((e) => {
      const n = [];
      this.rangeHighlightDecorationId &&
        (n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),
        n.push(this.rangeHighlightDecorationId.rangeHighlightId),
        (this.rangeHighlightDecorationId = void 0));
      const i = [
          {
            range: t,
            options: {
              description: "quick-access-range-highlight",
              className: "rangeHighlight",
              isWholeLine: !0,
            },
          },
          {
            range: t,
            options: {
              description: "quick-access-range-highlight-overview",
              overviewRuler: { color: g0(Y0), position: Uz.Full },
            },
          },
        ],
        [r, o] = e.deltaDecorations(n, i);
      this.rangeHighlightDecorationId = { rangeHighlightId: r, overviewRulerDecorationId: o };
    });
  }
  clearDecorations(e) {
    const t = this.rangeHighlightDecorationId;
    t &&
      (e.changeDecorations((e) => {
        e.deltaDecorations([t.overviewRulerDecorationId, t.rangeHighlightId], []);
      }),
      (this.rangeHighlightDecorationId = void 0));
  }
}
class UFe extends zFe {
  static {
    this.PREFIX = ":";
  }
  static {
    this.ZERO_BASED_OFFSET_STORAGE_KEY = "gotoLine.useZeroBasedOffset";
  }
  constructor() {
    super({ canAcceptInBackground: !0 });
  }
  get useZeroBasedOffset() {
    return this.storageService.getBoolean(UFe.ZERO_BASED_OFFSET_STORAGE_KEY, -1, !1);
  }
  set useZeroBasedOffset(e) {
    this.storageService.store(UFe.ZERO_BASED_OFFSET_STORAGE_KEY, e, -1, 0);
  }
  provideWithoutTextEditor(e) {
    const t = SI(1335, "Open a text editor first to go to a line.");
    return ((e.items = [{ label: t }]), (e.ariaLabel = t), PO.None);
  }
  provideWithTextEditor(e, t, n) {
    const i = e.editor,
      r = new AO();
    r.add(
      t.onDidAccept((n) => {
        const [i] = t.selectedItems;
        if (i) {
          if (!i.lineNumber) return;
          (this.gotoLocation(e, {
            range: this.toRange(i.lineNumber, i.column),
            keyMods: t.keyMods,
            preserveFocus: n.inBackground,
          }),
            n.inBackground || t.hide());
        }
      }),
    );
    const o = () => {
        const e = t.value.trim().substring(UFe.PREFIX.length),
          { inOffsetMode: n, lineNumber: r, column: o, label: a } = this.parsePosition(i, e);
        if (
          ((s.visible = !!n),
          (t.items = [{ lineNumber: r, column: o, label: a }]),
          (t.ariaLabel = a),
          !r)
        )
          return void this.clearDecorations(i);
        const l = this.toRange(r, o);
        (i.revealRangeInCenter(l, 0), this.addDecorations(i, l));
      },
      s = new R_e({
        title: SI(1336, "Use Zero-Based Offset"),
        icon: OV.indexZero,
        isChecked: this.useZeroBasedOffset,
        inputActiveOptionBorder: yG(dY),
        inputActiveOptionForeground: yG(gY),
        inputActiveOptionBackground: yG(hY),
      });
    (r.add(
      s.onChange(() => {
        ((this.useZeroBasedOffset = !this.useZeroBasedOffset), o());
      }),
    ),
      (t.toggles = [s]),
      o(),
      r.add(t.onDidChangeValue(() => o())));
    const a = Sye(i);
    if (a) {
      2 === a.getOptions().get(76).renderType &&
        (a.updateOptions({ lineNumbers: "on" }),
        r.add(MO(() => a.updateOptions({ lineNumbers: "relative" }))));
    }
    return r;
  }
  toRange(e = 1, t = 1) {
    return { startLineNumber: e, startColumn: t, endLineNumber: e, endColumn: t };
  }
  parsePosition(e, t) {
    const n = this.getModel(e);
    if (!n) return { label: SI(1337, "Open a text editor first to go to a line.") };
    if (t.startsWith(":")) {
      let e = parseInt(t.substring(1), 10);
      const i = n.getValueLength();
      if (isNaN(e))
        return {
          inOffsetMode: !0,
          label: this.useZeroBasedOffset
            ? SI(1338, "Type a character position to go to (from 0 to {0}).", i - 1)
            : SI(1339, "Type a character position to go to (from 1 to {0}).", i),
        };
      {
        const t = e < 0;
        (this.useZeroBasedOffset || (e -= Math.sign(e)), t && (e += i));
        const r = n.getPositionAt(e);
        return {
          ...r,
          inOffsetMode: !0,
          label: SI(1340, "Press 'Enter' to go to line {0} at column {1}.", r.lineNumber, r.column),
        };
      }
    }
    {
      const e = t.split(/,|:|#/),
        i = n.getLineCount();
      let r = parseInt(e[0]?.trim(), 10);
      if (e.length < 1 || isNaN(r))
        return { label: SI(1341, "Type a line number to go to (from 1 to {0}).", i) };
      ((r = r >= 0 ? r : i + 1 + r), (r = Math.min(Math.max(1, r), i)));
      const o = n.getLineMaxColumn(r);
      let s = parseInt(e[1]?.trim(), 10);
      return e.length < 2 || isNaN(s)
        ? {
            lineNumber: r,
            column: 1,
            label:
              e.length < 2
                ? SI(1342, "Press 'Enter' to go to line {0} or enter : to add a column number.", r)
                : SI(
                    1343,
                    "Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",
                    r,
                    o,
                  ),
          }
        : ((s = s >= 0 ? s : o + s),
          (s = Math.min(Math.max(1, s), o)),
          {
            lineNumber: r,
            column: s,
            label: SI(1344, "Press 'Enter' to go to line {0} at column {1}.", r, s),
          });
    }
  }
}
var $Fe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let qFe = class extends UFe {
  constructor(e, t) {
    (super(),
      (this.editorService = e),
      (this.storageService = t),
      (this.onDidActiveTextEditorControlChange = $O.None));
  }
  get activeTextEditorControl() {
    return this.editorService.getFocusedCodeEditor() ?? void 0;
  }
};
qFe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([$Fe(0, yV), $Fe(1, oue)], qFe);
let KFe = class e extends AH {
  static {
    this.ID = "editor.action.gotoLine";
  }
  constructor() {
    super({
      id: e.ID,
      label: SFe.gotoLineActionLabel,
      alias: "Go to Line/Column...",
      precondition: void 0,
      kbOpts: { kbExpr: $$.focus, primary: 2085, mac: { primary: 293 }, weight: 100 },
    });
  }
  run(e) {
    e.get(Ghe).quickAccess.show(qFe.PREFIX);
  }
};
(VH(KFe),
  NW.as(BFe).registerQuickAccessProvider({
    ctor: qFe,
    prefix: qFe.PREFIX,
    helpEntries: [{ description: SFe.gotoLineActionLabel, commandId: KFe.ID }],
  }));
const GFe = [void 0, []];
function ZFe(e, t, n = 0, i = 0) {
  const r = t;
  return r.values && r.values.length > 1
    ? (function (e, t, n, i) {
        let r = 0;
        const o = [];
        for (const s of t) {
          const [t, a] = YFe(e, s, n, i);
          if ("number" != typeof t) return GFe;
          ((r += t), o.push(...a));
        }
        return [r, XFe(o)];
      })(e, r.values, n, i)
    : YFe(e, t, n, i);
}
function YFe(e, t, n, i) {
  const r = $ie(t.original, t.originalLowercase, n, e, e.toLowerCase(), i, {
    firstMatchCanBeWeak: !0,
    boostFullMatch: !0,
  });
  return r ? [r[0], Iie(r)] : GFe;
}
function XFe(e) {
  const t = e.sort((e, t) => e.start - t.start),
    n = [];
  let i;
  for (const r of t)
    i && QFe(i, r)
      ? ((i.start = Math.min(i.start, r.start)), (i.end = Math.max(i.end, r.end)))
      : ((i = r), n.push(r));
  return n;
}
function QFe(e, t) {
  return !(e.end < t.start) && !(t.end < e.start);
}
function JFe(e) {
  return e.startsWith('"') && e.endsWith('"');
}
function eBe(e) {
  "string" != typeof e && (e = "");
  const t = e.toLowerCase(),
    { pathNormalized: n, normalized: i, normalizedLowercase: r } = tBe(e),
    o = n.indexOf(cP) >= 0,
    s = JFe(e);
  let a;
  const l = e.split(" ");
  if (l.length > 1)
    for (const c of l) {
      const e = JFe(c),
        { pathNormalized: t, normalized: n, normalizedLowercase: i } = tBe(c);
      n &&
        (a || (a = []),
        a.push({
          original: c,
          originalLowercase: c.toLowerCase(),
          pathNormalized: t,
          normalized: n,
          normalizedLowercase: i,
          expectContiguousMatch: e,
        }));
    }
  return {
    original: e,
    originalLowercase: t,
    pathNormalized: n,
    normalized: i,
    normalizedLowercase: r,
    values: a,
    containsPathSeparator: o,
    expectContiguousMatch: s,
  };
}
function tBe(e) {
  let t;
  t = AR ? e.replace(/\//g, cP) : e.replace(/\\/g, cP);
  const n = t.replace(/[\*\u2026\s"]/g, "");
  return { pathNormalized: t, normalized: n, normalizedLowercase: n.toLowerCase() };
}
function nBe(e) {
  return Array.isArray(e) ? eBe(e.map((e) => e.original).join(" ")) : eBe(e.original);
}
var iBe,
  rBe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let oBe = class extends zFe {
  static {
    iBe = this;
  }
  static {
    this.PREFIX = "@";
  }
  static {
    this.SCOPE_PREFIX = ":";
  }
  static {
    this.PREFIX_BY_CATEGORY = `${this.PREFIX}${this.SCOPE_PREFIX}`;
  }
  constructor(e, t, n = Object.create(null)) {
    (super(n),
      (this._languageFeaturesService = e),
      (this._outlineModelService = t),
      (this.options = n),
      (this.options.canAcceptInBackground = !0));
  }
  provideWithoutTextEditor(e) {
    return (
      this.provideLabelPick(
        e,
        SI(1345, "To go to a symbol, first open a text editor with symbol information."),
      ),
      PO.None
    );
  }
  provideWithTextEditor(e, t, n, i) {
    const r = e.editor,
      o = this.getModel(r);
    return o
      ? this._languageFeaturesService.documentSymbolProvider.has(o)
        ? this.doProvideWithEditorSymbols(e, o, t, n, i)
        : this.doProvideWithoutEditorSymbols(e, o, t, n)
      : PO.None;
  }
  doProvideWithoutEditorSymbols(e, t, n, i) {
    const r = new AO();
    return (
      this.provideLabelPick(
        n,
        SI(1346, "The active text editor does not provide symbol information."),
      ),
      (async () => {
        (await this.waitForLanguageSymbolRegistry(t, r)) &&
          !i.isCancellationRequested &&
          r.add(this.doProvideWithEditorSymbols(e, t, n, i));
      })(),
      r
    );
  }
  provideLabelPick(e, t) {
    ((e.items = [{ label: t, index: 0, kind: 14 }]), (e.ariaLabel = t));
  }
  async waitForLanguageSymbolRegistry(e, t) {
    if (this._languageFeaturesService.documentSymbolProvider.has(e)) return !0;
    const n = new DM(),
      i = t.add(
        this._languageFeaturesService.documentSymbolProvider.onDidChange(() => {
          this._languageFeaturesService.documentSymbolProvider.has(e) &&
            (i.dispose(), n.complete(!0));
        }),
      );
    return (t.add(MO(() => n.complete(!1))), n.p);
  }
  doProvideWithEditorSymbols(e, t, n, i, r) {
    const o = e.editor,
      s = new AO();
    (s.add(
      n.onDidAccept((t) => {
        const [i] = n.selectedItems;
        i &&
          i.range &&
          (this.gotoLocation(e, {
            range: i.range.selection,
            keyMods: n.keyMods,
            preserveFocus: t.inBackground,
          }),
          r?.handleAccept?.(i, t.inBackground),
          t.inBackground || n.hide());
      }),
    ),
      s.add(
        n.onDidTriggerItemButton(({ item: t }) => {
          t &&
            t.range &&
            (this.gotoLocation(e, {
              range: t.range.selection,
              keyMods: n.keyMods,
              forceSideBySide: !0,
            }),
            n.hide());
        }),
      ));
    const a = this.getDocumentSymbols(t, i),
      l = s.add(new jO()),
      c = async (e) => {
        (l?.value?.cancel(), (n.busy = !1), (l.value = new cM()), (n.busy = !0));
        try {
          const r = eBe(n.value.substr(iBe.PREFIX.length).trim()),
            o = await this.doGetSymbolPicks(a, r, void 0, l.value.token, t);
          if (i.isCancellationRequested) return;
          if (o.length > 0) {
            if (((n.items = o), e && 0 === r.original.length)) {
              const t = R1(o, (t) =>
                Boolean(
                  "separator" !== t.type && t.range && YH.containsPosition(t.range.decoration, e),
                ),
              );
              t && (n.activeItems = [t]);
            }
          } else
            r.original.length > 0
              ? this.provideLabelPick(n, SI(1347, "No matching editor symbols"))
              : this.provideLabelPick(n, SI(1348, "No editor symbols"));
        } finally {
          i.isCancellationRequested || (n.busy = !1);
        }
      };
    return (
      s.add(n.onDidChangeValue(() => c(void 0))),
      c(o.getSelection()?.getPosition()),
      s.add(
        n.onDidChangeActive(() => {
          const [e] = n.activeItems;
          e &&
            e.range &&
            (o.revealRangeInCenter(e.range.selection, 0),
            this.addDecorations(o, e.range.decoration));
        }),
      ),
      s
    );
  }
  async doGetSymbolPicks(e, t, n, i, r) {
    const o = await e;
    if (i.isCancellationRequested) return [];
    const s = 0 === t.original.indexOf(iBe.SCOPE_PREFIX),
      a = s ? 1 : 0;
    let l, c, d;
    t.values && t.values.length > 1
      ? ((l = nBe(t.values[0])), (c = nBe(t.values.slice(1))))
      : (l = t);
    const u = this.options?.openSideBySideDirection?.();
    u &&
      (d = [
        {
          iconClass:
            "right" === u ? AV.asClassName(OV.splitHorizontal) : AV.asClassName(OV.splitVertical),
          tooltip: "right" === u ? SI(1349, "Open to the Side") : SI(1350, "Open to the Bottom"),
        },
      ]);
    const h = [];
    for (let f = 0; f < o.length; f++) {
      const m = o[f],
        _ = UM(m.name),
        v = `$(${S2.toIcon(m.kind).id}) ${_}`,
        b = v.length - _.length;
      let y,
        x,
        w,
        C,
        S = m.containerName;
      if (
        (n?.extraContainerLabel &&
          (S = S ? `${n.extraContainerLabel} • ${S}` : n.extraContainerLabel),
        t.original.length > a)
      ) {
        let E = !1;
        if (
          (l !== t &&
            (([y, x] = ZFe(v, { ...t, values: void 0 }, a, b)), "number" == typeof y && (E = !0)),
          "number" != typeof y && (([y, x] = ZFe(v, l, a, b)), "number" != typeof y))
        )
          continue;
        if (!E && c) {
          if ((S && c.original.length > 0 && ([w, C] = ZFe(S, c)), "number" != typeof w)) continue;
          "number" == typeof y && (y += w);
        }
      }
      const k = m.tags && m.tags.indexOf(1) >= 0;
      h.push({
        index: f,
        kind: m.kind,
        score: y,
        label: v,
        ariaLabel: C2(m.name, m.kind),
        description: S,
        highlights: k ? void 0 : { label: x, description: C },
        range: { selection: YH.collapseToStart(m.selectionRange), decoration: m.range },
        uri: r.uri,
        symbolName: _,
        strikethrough: k,
        buttons: d,
      });
    }
    const g = h.sort((e, t) => (s ? this.compareByKindAndScore(e, t) : this.compareByScore(e, t)));
    let p = [];
    if (s) {
      let N,
        L,
        D = 0;
      function T() {
        L && "number" == typeof N && D > 0 && (L.label = WM(aBe[N] || sBe, D));
      }
      for (const I of g)
        (N !== I.kind ? (T(), (N = I.kind), (D = 1), (L = { type: "separator" }), p.push(L)) : D++,
          p.push(I));
      T();
    } else
      g.length > 0 &&
        (p = [{ label: SI(1351, "symbols ({0})", h.length), type: "separator" }, ...g]);
    return p;
  }
  compareByScore(e, t) {
    if ("number" != typeof e.score && "number" == typeof t.score) return 1;
    if ("number" == typeof e.score && "number" != typeof t.score) return -1;
    if ("number" == typeof e.score && "number" == typeof t.score) {
      if (e.score > t.score) return -1;
      if (e.score < t.score) return 1;
    }
    return e.index < t.index ? -1 : e.index > t.index ? 1 : 0;
  }
  compareByKindAndScore(e, t) {
    const n = aBe[e.kind] || sBe,
      i = aBe[t.kind] || sBe,
      r = n.localeCompare(i);
    return 0 === r ? this.compareByScore(e, t) : r;
  }
  async getDocumentSymbols(e, t) {
    const n = await this._outlineModelService.getOrCreate(e, t);
    return t.isCancellationRequested ? [] : n.asListOfDocumentSymbols();
  }
};
oBe = iBe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([rBe(0, mee), rBe(1, zNe)], oBe);
const sBe = SI(1352, "properties ({0})"),
  aBe = {
    5: SI(1353, "methods ({0})"),
    11: SI(1354, "functions ({0})"),
    8: SI(1355, "constructors ({0})"),
    12: SI(1356, "variables ({0})"),
    4: SI(1357, "classes ({0})"),
    22: SI(1358, "structs ({0})"),
    23: SI(1359, "events ({0})"),
    24: SI(1360, "operators ({0})"),
    10: SI(1361, "interfaces ({0})"),
    2: SI(1362, "namespaces ({0})"),
    3: SI(1363, "packages ({0})"),
    25: SI(1364, "type parameters ({0})"),
    1: SI(1365, "modules ({0})"),
    6: SI(1366, "properties ({0})"),
    9: SI(1367, "enumerations ({0})"),
    21: SI(1368, "enumeration members ({0})"),
    14: SI(1369, "strings ({0})"),
    0: SI(1370, "files ({0})"),
    17: SI(1371, "arrays ({0})"),
    15: SI(1372, "numbers ({0})"),
    16: SI(1373, "booleans ({0})"),
    18: SI(1374, "objects ({0})"),
    19: SI(1375, "keys ({0})"),
    7: SI(1376, "fields ({0})"),
    13: SI(1377, "constants ({0})"),
  };
var lBe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let cBe = class extends oBe {
  constructor(e, t, n) {
    (super(t, n), (this.editorService = e), (this.onDidActiveTextEditorControlChange = $O.None));
  }
  get activeTextEditorControl() {
    return this.editorService.getFocusedCodeEditor() ?? void 0;
  }
};
cBe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([lBe(0, yV), lBe(1, mee), lBe(2, zNe)], cBe);
class dBe extends AH {
  static {
    this.ID = "editor.action.quickOutline";
  }
  constructor() {
    super({
      id: dBe.ID,
      label: NFe.quickOutlineActionLabel,
      alias: "Go to Symbol...",
      precondition: $$.hasDocumentSymbolProvider,
      kbOpts: { kbExpr: $$.focus, primary: 3117, weight: 100 },
      contextMenuOpts: { group: "navigation", order: 3 },
    });
  }
  run(e) {
    e.get(Ghe).quickAccess.show(oBe.PREFIX, { itemActivation: $he.NONE });
  }
}
(VH(dBe),
  NW.as(BFe).registerQuickAccessProvider({
    ctor: cBe,
    prefix: oBe.PREFIX,
    helpEntries: [
      { description: NFe.quickOutlineActionLabel, prefix: oBe.PREFIX, commandId: dBe.ID },
      { description: NFe.quickOutlineByCategoryActionLabel, prefix: oBe.PREFIX_BY_CATEGORY },
    ],
  }));
class uBe {
  constructor() {
    ((this.chunkCount = 0), (this.chunkOccurrences = new Map()), (this.documents = new Map()));
  }
  calculateScores(e, t) {
    const n = this.computeEmbedding(e),
      i = new Map(),
      r = [];
    for (const [o, s] of this.documents) {
      if (t.isCancellationRequested) return [];
      for (const e of s.chunks) {
        const t = this.computeSimilarityScore(e, n, i);
        t > 0 && r.push({ key: o, score: t });
      }
    }
    return r;
  }
  static termFrequencies(e) {
    return (function (e) {
      const t = new Map();
      for (const n of e) t.set(n, (t.get(n) ?? 0) + 1);
      return t;
    })(uBe.splitTerms(e));
  }
  static *splitTerms(e) {
    const t = (e) => e.toLowerCase();
    for (const [n] of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)) {
      yield t(n);
      const e = n.replace(/([a-z])([A-Z])/g, "$1 $2").split(/\s+/g);
      if (e.length > 1)
        for (const n of e) n.length > 2 && /\p{Letter}{3,}/gu.test(n) && (yield t(n));
    }
  }
  updateDocuments(e) {
    for (const { key: t } of e) this.deleteDocument(t);
    for (const t of e) {
      const e = [];
      for (const n of t.textChunks) {
        const t = uBe.termFrequencies(n);
        for (const e of t.keys())
          this.chunkOccurrences.set(e, (this.chunkOccurrences.get(e) ?? 0) + 1);
        e.push({ text: n, tf: t });
      }
      ((this.chunkCount += e.length), this.documents.set(t.key, { chunks: e }));
    }
    return this;
  }
  deleteDocument(e) {
    const t = this.documents.get(e);
    if (t) {
      (this.documents.delete(e), (this.chunkCount -= t.chunks.length));
      for (const e of t.chunks)
        for (const t of e.tf.keys()) {
          const e = this.chunkOccurrences.get(t);
          if ("number" == typeof e) {
            const n = e - 1;
            n <= 0 ? this.chunkOccurrences.delete(t) : this.chunkOccurrences.set(t, n);
          }
        }
    }
  }
  computeSimilarityScore(e, t, n) {
    let i = 0;
    for (const [r, o] of Object.entries(t)) {
      const t = e.tf.get(r);
      if (!t) continue;
      let s = n.get(r);
      "number" != typeof s && ((s = this.computeIdf(r)), n.set(r, s));
      i += t * s * o;
    }
    return i;
  }
  computeEmbedding(e) {
    const t = uBe.termFrequencies(e);
    return this.computeTfidf(t);
  }
  computeIdf(e) {
    const t = this.chunkOccurrences.get(e) ?? 0;
    return t > 0 ? Math.log((this.chunkCount + 1) / t) : 0;
  }
  computeTfidf(e) {
    const t = Object.create(null);
    for (const [n, i] of e) {
      const e = this.computeIdf(n);
      e > 0 && (t[n] = i * e);
    }
    return t;
  }
}
var hBe;
function gBe(e) {
  const t = e;
  return Array.isArray(t.items);
}
function pBe(e) {
  const t = e;
  return !!t.picks && t.additionalPicks instanceof Promise;
}
!(function (e) {
  ((e[(e.NO_ACTION = 0)] = "NO_ACTION"),
    (e[(e.CLOSE_PICKER = 1)] = "CLOSE_PICKER"),
    (e[(e.REFRESH_PICKER = 2)] = "REFRESH_PICKER"),
    (e[(e.REMOVE_ITEM = 3)] = "REMOVE_ITEM"));
})(hBe || (hBe = {}));
class fBe extends PO {
  constructor(e, t) {
    (super(), (this.prefix = e), (this.options = t));
  }
  provide(e, t, n) {
    const i = new AO();
    let r;
    ((e.canAcceptInBackground = !!this.options?.canAcceptInBackground),
      (e.matchOnLabel = e.matchOnDescription = e.matchOnDetail = e.sortByLabel = !1));
    const o = i.add(new jO()),
      s = async () => {
        (r?.dispose(!0), (e.busy = !1));
        const i = (o.value = new AO());
        r = i.add(new cM(t));
        const s = r.token;
        let a = e.value.substring(this.prefix.length);
        this.options?.shouldSkipTrimPickFilter || (a = a.trim());
        const l = this._getPicks(a, i, s, n),
          c = (t, n) => {
            let i, r;
            if ((gBe(t) ? ((i = t.items), (r = t.active)) : (i = t), 0 === i.length)) {
              if (n) return !1;
              (a.length > 0 || e.hideInput) &&
                this.options?.noResultsPick &&
                (i = mR(this.options.noResultsPick)
                  ? [this.options.noResultsPick(a)]
                  : [this.options.noResultsPick]);
            }
            return ((e.items = i), r && (e.activeItems = [r]), !0);
          },
          d = async (t) => {
            let n = !1,
              i = !1;
            await Promise.all([
              (async () => {
                ("number" == typeof t.mergeDelay &&
                  (await vM(t.mergeDelay), s.isCancellationRequested)) ||
                  i ||
                  (n = c(t.picks, !0));
              })(),
              (async () => {
                e.busy = !0;
                try {
                  const i = await t.additionalPicks;
                  if (s.isCancellationRequested) return;
                  let r, o, a, l;
                  if (
                    (gBe(t.picks) ? ((r = t.picks.items), (o = t.picks.active)) : (r = t.picks),
                    gBe(i) ? ((a = i.items), (l = i.active)) : (a = i),
                    a.length > 0 || !n)
                  ) {
                    let t;
                    if (!o && !l) {
                      const n = e.activeItems[0];
                      n && -1 !== r.indexOf(n) && (t = n);
                    }
                    c({ items: [...r, ...a], active: o || l || t });
                  }
                } finally {
                  (s.isCancellationRequested || (e.busy = !1), (i = !0));
                }
              })(),
            ]);
          };
        if (null === l);
        else if (pBe(l)) await d(l);
        else if (l instanceof Promise) {
          e.busy = !0;
          try {
            const e = await l;
            if (s.isCancellationRequested) return;
            pBe(e) ? await d(e) : c(e);
          } finally {
            s.isCancellationRequested || (e.busy = !1);
          }
        } else c(l);
      };
    (i.add(e.onDidChangeValue(() => s())),
      s(),
      i.add(
        e.onDidAccept((t) => {
          if (n?.handleAccept)
            return (
              t.inBackground || e.hide(),
              void n.handleAccept?.(e.activeItems[0], t.inBackground)
            );
          const [i] = e.selectedItems;
          "function" == typeof i?.accept && (t.inBackground || e.hide(), i.accept(e.keyMods, t));
        }),
      ));
    const a = async (n, i) => {
      if ("function" != typeof i.trigger) return;
      const r = i.buttons?.indexOf(n) ?? -1;
      if (r >= 0) {
        const n = i.trigger(r, e.keyMods),
          o = "number" == typeof n ? n : await n;
        if (t.isCancellationRequested) return;
        switch (o) {
          case hBe.NO_ACTION:
            break;
          case hBe.CLOSE_PICKER:
            e.hide();
            break;
          case hBe.REFRESH_PICKER:
            s();
            break;
          case hBe.REMOVE_ITEM: {
            const t = e.items.indexOf(i);
            if (-1 !== t) {
              const n = e.items.slice(),
                i = n.splice(t, 1),
                r = e.activeItems.filter((e) => e !== i[0]),
                o = e.keepScrollPosition;
              ((e.keepScrollPosition = !0),
                (e.items = n),
                r && (e.activeItems = r),
                (e.keepScrollPosition = o));
            }
            break;
          }
        }
      }
    };
    return (
      i.add(e.onDidTriggerItemButton(({ button: e, item: t }) => a(e, t))),
      i.add(e.onDidTriggerSeparatorButton(({ button: e, separator: t }) => a(e, t))),
      i
    );
  }
}
new XW(1e4);
const mBe = new XW(1e4);
function _Be(e) {
  return (function (e, t, n) {
    if (!e) return e;
    const i = n.get(e);
    if (i) return i;
    let r;
    r = vBe.test(e) ? e.normalize(t) : e;
    return (n.set(e, r), r);
  })(e, "NFD", mBe);
}
const vBe = /[^\u0000-\u0080]/;
const bBe = (function () {
  const e = /[\u0300-\u036f]/g;
  return function (t) {
    return _Be(t).replace(e, "");
  };
})();
var yBe,
  xBe,
  wBe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  CBe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let SBe = class extends fBe {
  static {
    yBe = this;
  }
  static {
    this.PREFIX = ">";
  }
  static {
    this.TFIDF_THRESHOLD = 0.5;
  }
  static {
    this.TFIDF_MAX_RESULTS = 5;
  }
  static {
    this.WORD_FILTER = nie(iie, wie, oie);
  }
  constructor(e, t, n, i, r, o) {
    (super(yBe.PREFIX, e),
      (this.keybindingService = n),
      (this.commandService = i),
      (this.telemetryService = r),
      (this.dialogService = o),
      (this.commandsHistory = this._register(t.createInstance(kBe))),
      (this.options = e));
  }
  async _getPicks(e, t, n, i) {
    const r = await this.getCommandPicks(n);
    if (n.isCancellationRequested) return [];
    const o = LO(() => {
        const t = new uBe();
        t.updateDocuments(
          r.map((e) => ({ key: e.commandId, textChunks: [this.getTfIdfChunk(e)] })),
        );
        return (function (e) {
          const t = e.slice(0);
          t.sort((e, t) => t.score - e.score);
          const n = t[0]?.score ?? 0;
          if (n > 0) for (const i of t) i.score /= n;
          return t;
        })(t.calculateScores(e, n))
          .filter((e) => e.score > yBe.TFIDF_THRESHOLD)
          .slice(0, yBe.TFIDF_MAX_RESULTS);
      }),
      s = this.normalizeForFiltering(e),
      a = [];
    for (const g of r) {
      g.labelNoAccents ??= this.normalizeForFiltering(g.label);
      const t = yBe.WORD_FILTER(s, g.labelNoAccents) ?? void 0;
      let i;
      if (
        (g.commandAlias &&
          ((g.aliasNoAccents ??= this.normalizeForFiltering(g.commandAlias)),
          (i = yBe.WORD_FILTER(s, g.aliasNoAccents) ?? void 0)),
        t || i)
      )
        ((g.highlights = { label: t, detail: this.options.showAlias ? i : void 0 }), a.push(g));
      else if (e === g.commandId) a.push(g);
      else if (e.length >= 3) {
        const e = o();
        if (n.isCancellationRequested) return [];
        const t = e.find((e) => e.key === g.commandId);
        t && ((g.tfIdfScore = t.score), a.push(g));
      }
    }
    const l = new Map();
    for (const g of a) {
      const e = l.get(g.label);
      e ? ((g.description = g.commandId), (e.description = e.commandId)) : l.set(g.label, g);
    }
    a.sort((e, t) => {
      if (e.tfIdfScore && t.tfIdfScore)
        return e.tfIdfScore === t.tfIdfScore
          ? e.label.localeCompare(t.label)
          : t.tfIdfScore - e.tfIdfScore;
      if (e.tfIdfScore) return 1;
      if (t.tfIdfScore) return -1;
      const n = this.commandsHistory.peek(e.commandId),
        i = this.commandsHistory.peek(t.commandId);
      if (n && i) return n > i ? -1 : 1;
      if (n) return -1;
      if (i) return 1;
      if (this.options.suggestedCommandIds) {
        const n = this.options.suggestedCommandIds.has(e.commandId),
          i = this.options.suggestedCommandIds.has(t.commandId);
        if (n && i) return 0;
        if (n) return -1;
        if (i) return 1;
      }
      const r = e.commandCategory === VPe.Developer.value,
        o = t.commandCategory === VPe.Developer.value;
      return r && !o ? 1 : !r && o ? -1 : e.label.localeCompare(t.label);
    });
    const c = [];
    let d = !1,
      u = !0,
      h = !!this.options.suggestedCommandIds;
    for (let g = 0; g < a.length; g++) {
      const e = a[g];
      (0 === g &&
        this.commandsHistory.peek(e.commandId) &&
        (c.push({ type: "separator", label: SI(1740, "recently used") }), (d = !0)),
        u &&
          void 0 !== e.tfIdfScore &&
          (c.push({ type: "separator", label: SI(1741, "similar commands") }), (u = !1)),
        h &&
          void 0 === e.tfIdfScore &&
          !this.commandsHistory.peek(e.commandId) &&
          this.options.suggestedCommandIds?.has(e.commandId) &&
          (c.push({ type: "separator", label: SI(1742, "commonly used") }), (d = !0), (h = !1)),
        !d ||
          void 0 !== e.tfIdfScore ||
          this.commandsHistory.peek(e.commandId) ||
          this.options.suggestedCommandIds?.has(e.commandId) ||
          (c.push({ type: "separator", label: SI(1743, "other commands") }), (d = !1)),
        c.push(this.toCommandPick(e, i)));
    }
    return this.hasAdditionalCommandPicks(e, n)
      ? {
          picks: c,
          additionalPicks: (async () => {
            const t = await this.getAdditionalCommandPicks(r, a, e, n);
            if (n.isCancellationRequested) return [];
            const o = t.map((e) => this.toCommandPick(e, i));
            return (
              u &&
                "separator" !== o[0]?.type &&
                o.unshift({ type: "separator", label: SI(1744, "similar commands") }),
              o
            );
          })(),
        }
      : c;
  }
  toCommandPick(e, t) {
    if ("separator" === e.type) return e;
    const n = this.keybindingService.lookupKeybinding(e.commandId),
      i = n ? SI(1745, "{0}, {1}", e.label, n.getAriaLabel()) : e.label;
    return {
      ...e,
      ariaLabel: i,
      detail: this.options.showAlias && e.commandAlias !== e.label ? e.commandAlias : void 0,
      keybinding: n,
      accept: async () => {
        (this.commandsHistory.push(e.commandId),
          this.telemetryService.publicLog2("workbenchActionExecuted", {
            id: e.commandId,
            from: t?.from ?? "quick open",
          }));
        try {
          e.args?.length
            ? await this.commandService.executeCommand(e.commandId, ...e.args)
            : await this.commandService.executeCommand(e.commandId);
        } catch (D2t) {
          qI(D2t) ||
            this.dialogService.error(
              SI(1746, "Command '{0}' resulted in an error", e.label),
              fpe(D2t),
            );
        }
      },
    };
  }
  getTfIdfChunk({ label: e, commandAlias: t, commandDescription: n }) {
    let i = e;
    return (
      t && t !== e && (i += ` - ${t}`),
      n &&
        n.value !== e &&
        (i += ` - ${n.value === n.original ? n.value : `${n.value} (${n.original})`}`),
      i
    );
  }
  normalizeForFiltering(e) {
    const t = bBe(e);
    return t.length !== e.length
      ? (this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch", {
          originalLength: e.length,
          normalizedLength: t.length,
        }),
        e)
      : t;
  }
};
SBe = yBe = wBe([CBe(1, vV), CBe(2, N5), CBe(3, PV), CBe(4, HW), CBe(5, Cje)], SBe);
let kBe = class extends PO {
  static {
    xBe = this;
  }
  static {
    this.DEFAULT_COMMANDS_HISTORY_LENGTH = 50;
  }
  static {
    this.PREF_KEY_CACHE = "commandPalette.mru.cache";
  }
  static {
    this.PREF_KEY_COUNTER = "commandPalette.mru.counter";
  }
  static {
    this.counter = 1;
  }
  static {
    this.hasChanges = !1;
  }
  constructor(e, t, n) {
    (super(),
      (this.storageService = e),
      (this.configurationService = t),
      (this.logService = n),
      (this.configuredCommandsHistoryLength = 0),
      this.updateConfiguration(),
      this.load(),
      this.registerListeners());
  }
  registerListeners() {
    (this._register(
      this.configurationService.onDidChangeConfiguration((e) => this.updateConfiguration(e)),
    ),
      this._register(
        this.storageService.onWillSaveState((e) => {
          e.reason === sue.SHUTDOWN && this.saveState();
        }),
      ));
  }
  updateConfiguration(e) {
    (e && !e.affectsConfiguration("workbench.commandPalette.history")) ||
      ((this.configuredCommandsHistoryLength = xBe.getConfiguredCommandHistoryLength(
        this.configurationService,
      )),
      xBe.cache &&
        xBe.cache.limit !== this.configuredCommandsHistoryLength &&
        ((xBe.cache.limit = this.configuredCommandsHistoryLength), (xBe.hasChanges = !0)));
  }
  load() {
    const e = this.storageService.get(xBe.PREF_KEY_CACHE, 0);
    let t;
    if (e)
      try {
        t = JSON.parse(e);
      } catch (D2t) {
        this.logService.error(`[CommandsHistory] invalid data: ${D2t}`);
      }
    const n = (xBe.cache = new XW(this.configuredCommandsHistoryLength, 1));
    if (t) {
      let e;
      ((e = t.usesLRU ? t.entries : t.entries.sort((e, t) => e.value - t.value)),
        e.forEach((e) => n.set(e.key, e.value)));
    }
    xBe.counter = this.storageService.getNumber(xBe.PREF_KEY_COUNTER, 0, xBe.counter);
  }
  push(e) {
    xBe.cache && (xBe.cache.set(e, xBe.counter++), (xBe.hasChanges = !0));
  }
  peek(e) {
    return xBe.cache?.peek(e);
  }
  saveState() {
    if (!xBe.cache) return;
    if (!xBe.hasChanges) return;
    const e = { usesLRU: !0, entries: [] };
    (xBe.cache.forEach((t, n) => e.entries.push({ key: n, value: t })),
      this.storageService.store(xBe.PREF_KEY_CACHE, JSON.stringify(e), 0, 0),
      this.storageService.store(xBe.PREF_KEY_COUNTER, xBe.counter, 0, 0),
      (xBe.hasChanges = !1));
  }
  static getConfiguredCommandHistoryLength(e) {
    const t = e.getValue(),
      n = t.workbench?.commandPalette?.history;
    return "number" == typeof n ? n : xBe.DEFAULT_COMMANDS_HISTORY_LENGTH;
  }
};
kBe = xBe = wBe([CBe(0, oue), CBe(1, OU), CBe(2, yH)], kBe);
class EBe extends SBe {
  constructor(e, t, n, i, r, o) {
    super(e, t, n, i, r, o);
  }
  getCodeEditorCommandPicks() {
    const e = this.activeTextEditorControl;
    if (!e) return [];
    const t = [];
    for (const n of e.getSupportedActions()) {
      let e;
      (n.metadata?.description &&
        (e = Jde(n.metadata.description)
          ? n.metadata.description
          : { original: n.metadata.description, value: n.metadata.description }),
        t.push({
          commandId: n.id,
          commandAlias: n.alias,
          commandDescription: e,
          label: Jie(n.label) || n.id,
        }));
    }
    return t;
  }
}
var NBe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let LBe = class extends EBe {
  get activeTextEditorControl() {
    return this.codeEditorService.getFocusedCodeEditor() ?? void 0;
  }
  constructor(e, t, n, i, r, o) {
    (super({ showAlias: !1 }, e, n, i, r, o), (this.codeEditorService = t));
  }
  async getCommandPicks() {
    return this.getCodeEditorCommandPicks();
  }
  hasAdditionalCommandPicks() {
    return !1;
  }
  async getAdditionalCommandPicks() {
    return [];
  }
};
LBe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([NBe(0, vV), NBe(1, yV), NBe(2, N5), NBe(3, PV), NBe(4, HW), NBe(5, Cje)], LBe);
class DBe extends AH {
  static {
    this.ID = "editor.action.quickCommand";
  }
  constructor() {
    super({
      id: DBe.ID,
      label: EFe.quickCommandActionLabel,
      alias: "Command Palette",
      precondition: void 0,
      kbOpts: { kbExpr: $$.focus, primary: 59, weight: 100 },
      contextMenuOpts: { group: "z_commands", order: 1 },
    });
  }
  run(e) {
    e.get(Ghe).quickAccess.show(LBe.PREFIX);
  }
}
(VH(DBe),
  NW.as(BFe).registerQuickAccessProvider({
    ctor: LBe,
    prefix: LBe.PREFIX,
    helpEntries: [{ description: EFe.quickCommandHelp, commandId: DBe.ID }],
  }));
var TBe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let IBe = class extends _Se {
  constructor(e, t, n, i, r, o, s) {
    super(!0, e, t, n, i, r, o, s);
  }
};
((IBe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([TBe(1, xW), TBe(2, yV), TBe(3, Y4), TBe(4, vV), TBe(5, oue), TBe(6, OU)], IBe)),
  zH(_Se.ID, IBe, 4));
class RBe {
  constructor(e, t, n, i, r) {
    ((this._parsedThemeRuleBrand = void 0),
      (this.token = e),
      (this.index = t),
      (this.fontStyle = n),
      (this.foreground = i),
      (this.background = r));
  }
}
const OBe = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;
class MBe {
  constructor() {
    ((this._lastColorId = 0), (this._id2color = []), (this._color2id = new Map()));
  }
  getId(e) {
    if (null === e) return 0;
    const t = e.match(OBe);
    if (!t) throw new Error("Illegal value for token color: " + e);
    e = t[1].toUpperCase();
    let n = this._color2id.get(e);
    return (
      n ||
      ((n = ++this._lastColorId),
      this._color2id.set(e, n),
      (this._id2color[n] = vG.fromHex("#" + e)),
      n)
    );
  }
  getColorMap() {
    return this._id2color.slice(0);
  }
}
class ABe {
  static createFromRawTokenTheme(e, t) {
    return this.createFromParsedTokenTheme(
      (function (e) {
        if (!e || !Array.isArray(e)) return [];
        const t = [];
        let n = 0;
        for (let i = 0, r = e.length; i < r; i++) {
          const r = e[i];
          let o = -1;
          if ("string" == typeof r.fontStyle) {
            o = 0;
            const e = r.fontStyle.split(" ");
            for (let t = 0, n = e.length; t < n; t++)
              switch (e[t]) {
                case "italic":
                  o |= 1;
                  break;
                case "bold":
                  o |= 2;
                  break;
                case "underline":
                  o |= 4;
                  break;
                case "strikethrough":
                  o |= 8;
              }
          }
          let s = null;
          "string" == typeof r.foreground && (s = r.foreground);
          let a = null;
          ("string" == typeof r.background && (a = r.background),
            (t[n++] = new RBe(r.token || "", i, o, s, a)));
        }
        return t;
      })(e),
      t,
    );
  }
  static createFromParsedTokenTheme(e, t) {
    return (function (e, t) {
      e.sort((e, t) => {
        const n = (function (e, t) {
          return e < t ? -1 : e > t ? 1 : 0;
        })(e.token, t.token);
        return 0 !== n ? n : e.index - t.index;
      });
      let n = 0,
        i = "000000",
        r = "ffffff";
      for (; e.length >= 1 && "" === e[0].token; ) {
        const t = e.shift();
        (-1 !== t.fontStyle && (n = t.fontStyle),
          null !== t.foreground && (i = t.foreground),
          null !== t.background && (r = t.background));
      }
      const o = new MBe();
      for (const d of t) o.getId(d);
      const s = o.getId(i),
        a = o.getId(r),
        l = new jBe(n, s, a),
        c = new FBe(l);
      for (let d = 0, u = e.length; d < u; d++) {
        const t = e[d];
        c.insert(t.token, t.fontStyle, o.getId(t.foreground), o.getId(t.background));
      }
      return new ABe(o, c);
    })(e, t);
  }
  constructor(e, t) {
    ((this._colorMap = e), (this._root = t), (this._cache = new Map()));
  }
  getColorMap() {
    return this._colorMap.getColorMap();
  }
  _match(e) {
    return this._root.match(e);
  }
  match(e, t) {
    let n = this._cache.get(t);
    if (void 0 === n) {
      const e = this._match(t),
        i = (function (e) {
          const t = e.match(PBe);
          if (!t) return 0;
          switch (t[1]) {
            case "comment":
              return 1;
            case "string":
              return 2;
            case "regex":
            case "regexp":
              return 3;
          }
          throw new Error("Unexpected match for standard token type!");
        })(t);
      ((n = (e.metadata | (i << 8)) >>> 0), this._cache.set(t, n));
    }
    return (n | e | 0) >>> 0;
  }
}
const PBe = /\b(comment|string|regex|regexp)\b/;
class jBe {
  constructor(e, t, n) {
    ((this._themeTrieElementRuleBrand = void 0),
      (this._fontStyle = e),
      (this._foreground = t),
      (this._background = n),
      (this.metadata =
        ((this._fontStyle << 11) | (this._foreground << 15) | (this._background << 24)) >>> 0));
  }
  clone() {
    return new jBe(this._fontStyle, this._foreground, this._background);
  }
  acceptOverwrite(e, t, n) {
    (-1 !== e && (this._fontStyle = e),
      0 !== t && (this._foreground = t),
      0 !== n && (this._background = n),
      (this.metadata =
        ((this._fontStyle << 11) | (this._foreground << 15) | (this._background << 24)) >>> 0));
  }
}
class FBe {
  constructor(e) {
    ((this._themeTrieElementBrand = void 0), (this._mainRule = e), (this._children = new Map()));
  }
  match(e) {
    if ("" === e) return this._mainRule;
    const t = e.indexOf(".");
    let n, i;
    -1 === t ? ((n = e), (i = "")) : ((n = e.substring(0, t)), (i = e.substring(t + 1)));
    const r = this._children.get(n);
    return void 0 !== r ? r.match(i) : this._mainRule;
  }
  insert(e, t, n, i) {
    if ("" === e) return void this._mainRule.acceptOverwrite(t, n, i);
    const r = e.indexOf(".");
    let o, s;
    -1 === r ? ((o = e), (s = "")) : ((o = e.substring(0, r)), (s = e.substring(r + 1)));
    let a = this._children.get(o);
    (void 0 === a && ((a = new FBe(this._mainRule.clone())), this._children.set(o, a)),
      a.insert(s, t, n, i));
  }
}
const BBe = {
    base: "vs",
    inherit: !1,
    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: {
      [GG]: "#FFFFFE",
      [ZG]: "#000000",
      [dZ]: "#E5EBF1",
      [I0]: "#D3D3D3",
      [j0]: "#939393",
      [uZ]: "#ADD6FF4D",
    },
  },
  VBe = {
    base: "vs-dark",
    inherit: !1,
    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: {
      [GG]: "#1E1E1E",
      [ZG]: "#D4D4D4",
      [dZ]: "#3A3D41",
      [I0]: "#404040",
      [j0]: "#707070",
      [uZ]: "#ADD6FF26",
    },
  },
  WBe = {
    base: "hc-black",
    inherit: !1,
    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: { [GG]: "#000000", [ZG]: "#FFFFFF", [I0]: "#FFFFFF", [j0]: "#FFFFFF" },
  },
  HBe = {
    base: "hc-light",
    inherit: !1,
    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: { [GG]: "#FFFFFF", [ZG]: "#292929", [I0]: "#292929", [j0]: "#292929" },
  };
class zBe {
  getIcon(e) {
    const t = Yle();
    let n = e.defaults;
    for (; AV.isThemeIcon(n); ) {
      const e = t.getIcon(n.id);
      if (!e) return;
      n = e.defaults;
    }
    return n;
  }
}
const UBe = "vs",
  $Be = "vs-dark",
  qBe = "hc-black",
  KBe = "hc-light",
  GBe = NW.as(wG),
  ZBe = NW.as(f0);
class YBe {
  constructor(e, t) {
    ((this.semanticHighlighting = !1), (this.themeData = t));
    const n = t.base;
    (e.length > 0
      ? (XBe(e) ? (this.id = e) : (this.id = n + " " + e), (this.themeName = e))
      : ((this.id = n), (this.themeName = n)),
      (this.colors = null),
      (this.defaultColors = 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) {
      const e = new Map();
      for (const t in this.themeData.colors) e.set(t, vG.fromHex(this.themeData.colors[t]));
      if (this.themeData.inherit) {
        const t = QBe(this.themeData.base);
        for (const n in t.colors) e.has(n) || e.set(n, vG.fromHex(t.colors[n]));
      }
      this.colors = e;
    }
    return this.colors;
  }
  getColor(e, t) {
    const n = this.getColors().get(e);
    return n || (!1 !== t ? this.getDefault(e) : void 0);
  }
  getDefault(e) {
    let t = this.defaultColors[e];
    return t || ((t = GBe.resolveDefaultColor(e, this)), (this.defaultColors[e] = t), t);
  }
  defines(e) {
    return this.getColors().has(e);
  }
  get type() {
    switch (this.base) {
      case UBe:
        return LQ.LIGHT;
      case qBe:
        return LQ.HIGH_CONTRAST_DARK;
      case KBe:
        return LQ.HIGH_CONTRAST_LIGHT;
      default:
        return LQ.DARK;
    }
  }
  get tokenTheme() {
    if (!this._tokenTheme) {
      let e = [],
        t = [];
      if (this.themeData.inherit) {
        const n = QBe(this.themeData.base);
        ((e = n.rules), n.encodedTokensColors && (t = n.encodedTokensColors));
      }
      const n = this.themeData.colors["editor.foreground"],
        i = this.themeData.colors["editor.background"];
      if (n || i) {
        const t = { token: "" };
        (n && (t.foreground = n), i && (t.background = i), e.push(t));
      }
      ((e = e.concat(this.themeData.rules)),
        this.themeData.encodedTokensColors && (t = this.themeData.encodedTokensColors),
        (this._tokenTheme = ABe.createFromRawTokenTheme(e, t)));
    }
    return this._tokenTheme;
  }
  getTokenStyleMetadata(e, t, n) {
    const i = this.tokenTheme._match([e].concat(t).join(".")).metadata,
      r = E$.getForeground(i),
      o = E$.getFontStyle(i);
    return {
      foreground: r,
      italic: Boolean(1 & o),
      bold: Boolean(2 & o),
      underline: Boolean(4 & o),
      strikethrough: Boolean(8 & o),
    };
  }
  get tokenColorMap() {
    return [];
  }
}
function XBe(e) {
  return e === UBe || e === $Be || e === qBe || e === KBe;
}
function QBe(e) {
  switch (e) {
    case UBe:
      return BBe;
    case $Be:
      return VBe;
    case qBe:
      return WBe;
    case KBe:
      return HBe;
  }
}
function JBe(e) {
  const t = QBe(e);
  return new YBe(e, t);
}
var eVe,
  tVe,
  nVe,
  iVe,
  rVe,
  oVe,
  sVe,
  aVe,
  lVe,
  cVe,
  dVe,
  uVe,
  hVe,
  gVe,
  pVe,
  fVe,
  mVe,
  _Ve,
  vVe,
  bVe,
  yVe,
  xVe,
  wVe,
  CVe,
  SVe,
  kVe,
  EVe,
  NVe,
  LVe,
  DVe,
  TVe,
  IVe,
  RVe,
  OVe,
  MVe,
  AVe,
  PVe,
  jVe,
  FVe,
  BVe,
  VVe,
  WVe,
  HVe,
  zVe,
  UVe,
  $Ve,
  qVe,
  KVe;
(VH(
  class extends AH {
    constructor() {
      (super({
        id: "editor.action.toggleHighContrast",
        label: DFe.toggleHighContrast,
        alias: "Toggle High Contrast Theme",
        precondition: void 0,
      }),
        (this._originalThemeName = null));
    }
    run(e, t) {
      const n = e.get(OFe),
        i = n.getColorTheme();
      TQ(i.type)
        ? (n.setTheme(this._originalThemeName || (IQ(i.type) ? $Be : UBe)),
          (this._originalThemeName = null))
        : (n.setTheme(IQ(i.type) ? qBe : KBe), (this._originalThemeName = i.themeName));
    }
  },
),
  (function (e) {
    ((e[(e.Unknown = 0)] = "Unknown"),
      (e[(e.Disabled = 1)] = "Disabled"),
      (e[(e.Enabled = 2)] = "Enabled"));
  })(eVe || (eVe = {})),
  (function (e) {
    ((e[(e.Invoke = 1)] = "Invoke"), (e[(e.Auto = 2)] = "Auto"));
  })(tVe || (tVe = {})),
  (function (e) {
    ((e[(e.None = 0)] = "None"),
      (e[(e.KeepWhitespace = 1)] = "KeepWhitespace"),
      (e[(e.InsertAsSnippet = 4)] = "InsertAsSnippet"));
  })(nVe || (nVe = {})),
  (function (e) {
    ((e[(e.Method = 0)] = "Method"),
      (e[(e.Function = 1)] = "Function"),
      (e[(e.Constructor = 2)] = "Constructor"),
      (e[(e.Field = 3)] = "Field"),
      (e[(e.Variable = 4)] = "Variable"),
      (e[(e.Class = 5)] = "Class"),
      (e[(e.Struct = 6)] = "Struct"),
      (e[(e.Interface = 7)] = "Interface"),
      (e[(e.Module = 8)] = "Module"),
      (e[(e.Property = 9)] = "Property"),
      (e[(e.Event = 10)] = "Event"),
      (e[(e.Operator = 11)] = "Operator"),
      (e[(e.Unit = 12)] = "Unit"),
      (e[(e.Value = 13)] = "Value"),
      (e[(e.Constant = 14)] = "Constant"),
      (e[(e.Enum = 15)] = "Enum"),
      (e[(e.EnumMember = 16)] = "EnumMember"),
      (e[(e.Keyword = 17)] = "Keyword"),
      (e[(e.Text = 18)] = "Text"),
      (e[(e.Color = 19)] = "Color"),
      (e[(e.File = 20)] = "File"),
      (e[(e.Reference = 21)] = "Reference"),
      (e[(e.Customcolor = 22)] = "Customcolor"),
      (e[(e.Folder = 23)] = "Folder"),
      (e[(e.TypeParameter = 24)] = "TypeParameter"),
      (e[(e.User = 25)] = "User"),
      (e[(e.Issue = 26)] = "Issue"),
      (e[(e.Tool = 27)] = "Tool"),
      (e[(e.Snippet = 28)] = "Snippet"));
  })(iVe || (iVe = {})),
  (function (e) {
    e[(e.Deprecated = 1)] = "Deprecated";
  })(rVe || (rVe = {})),
  (function (e) {
    ((e[(e.Invoke = 0)] = "Invoke"),
      (e[(e.TriggerCharacter = 1)] = "TriggerCharacter"),
      (e[(e.TriggerForIncompleteCompletions = 2)] = "TriggerForIncompleteCompletions"));
  })(oVe || (oVe = {})),
  (function (e) {
    ((e[(e.EXACT = 0)] = "EXACT"), (e[(e.ABOVE = 1)] = "ABOVE"), (e[(e.BELOW = 2)] = "BELOW"));
  })(sVe || (sVe = {})),
  (function (e) {
    ((e[(e.NotSet = 0)] = "NotSet"),
      (e[(e.ContentFlush = 1)] = "ContentFlush"),
      (e[(e.RecoverFromMarkers = 2)] = "RecoverFromMarkers"),
      (e[(e.Explicit = 3)] = "Explicit"),
      (e[(e.Paste = 4)] = "Paste"),
      (e[(e.Undo = 5)] = "Undo"),
      (e[(e.Redo = 6)] = "Redo"));
  })(aVe || (aVe = {})),
  (function (e) {
    ((e[(e.LF = 1)] = "LF"), (e[(e.CRLF = 2)] = "CRLF"));
  })(lVe || (lVe = {})),
  (function (e) {
    ((e[(e.Text = 0)] = "Text"), (e[(e.Read = 1)] = "Read"), (e[(e.Write = 2)] = "Write"));
  })(cVe || (cVe = {})),
  (function (e) {
    ((e[(e.None = 0)] = "None"),
      (e[(e.Keep = 1)] = "Keep"),
      (e[(e.Brackets = 2)] = "Brackets"),
      (e[(e.Advanced = 3)] = "Advanced"),
      (e[(e.Full = 4)] = "Full"));
  })(dVe || (dVe = {})),
  (function (e) {
    ((e[(e.acceptSuggestionOnCommitCharacter = 0)] = "acceptSuggestionOnCommitCharacter"),
      (e[(e.acceptSuggestionOnEnter = 1)] = "acceptSuggestionOnEnter"),
      (e[(e.accessibilitySupport = 2)] = "accessibilitySupport"),
      (e[(e.accessibilityPageSize = 3)] = "accessibilityPageSize"),
      (e[(e.allowOverflow = 4)] = "allowOverflow"),
      (e[(e.allowVariableLineHeights = 5)] = "allowVariableLineHeights"),
      (e[(e.allowVariableFonts = 6)] = "allowVariableFonts"),
      (e[(e.allowVariableFontsInAccessibilityMode = 7)] = "allowVariableFontsInAccessibilityMode"),
      (e[(e.ariaLabel = 8)] = "ariaLabel"),
      (e[(e.ariaRequired = 9)] = "ariaRequired"),
      (e[(e.autoClosingBrackets = 10)] = "autoClosingBrackets"),
      (e[(e.autoClosingComments = 11)] = "autoClosingComments"),
      (e[(e.screenReaderAnnounceInlineSuggestion = 12)] = "screenReaderAnnounceInlineSuggestion"),
      (e[(e.autoClosingDelete = 13)] = "autoClosingDelete"),
      (e[(e.autoClosingOvertype = 14)] = "autoClosingOvertype"),
      (e[(e.autoClosingQuotes = 15)] = "autoClosingQuotes"),
      (e[(e.autoIndent = 16)] = "autoIndent"),
      (e[(e.autoIndentOnPaste = 17)] = "autoIndentOnPaste"),
      (e[(e.autoIndentOnPasteWithinString = 18)] = "autoIndentOnPasteWithinString"),
      (e[(e.automaticLayout = 19)] = "automaticLayout"),
      (e[(e.autoSurround = 20)] = "autoSurround"),
      (e[(e.bracketPairColorization = 21)] = "bracketPairColorization"),
      (e[(e.guides = 22)] = "guides"),
      (e[(e.codeLens = 23)] = "codeLens"),
      (e[(e.codeLensFontFamily = 24)] = "codeLensFontFamily"),
      (e[(e.codeLensFontSize = 25)] = "codeLensFontSize"),
      (e[(e.colorDecorators = 26)] = "colorDecorators"),
      (e[(e.colorDecoratorsLimit = 27)] = "colorDecoratorsLimit"),
      (e[(e.columnSelection = 28)] = "columnSelection"),
      (e[(e.comments = 29)] = "comments"),
      (e[(e.contextmenu = 30)] = "contextmenu"),
      (e[(e.copyWithSyntaxHighlighting = 31)] = "copyWithSyntaxHighlighting"),
      (e[(e.cursorBlinking = 32)] = "cursorBlinking"),
      (e[(e.cursorSmoothCaretAnimation = 33)] = "cursorSmoothCaretAnimation"),
      (e[(e.cursorStyle = 34)] = "cursorStyle"),
      (e[(e.cursorSurroundingLines = 35)] = "cursorSurroundingLines"),
      (e[(e.cursorSurroundingLinesStyle = 36)] = "cursorSurroundingLinesStyle"),
      (e[(e.cursorWidth = 37)] = "cursorWidth"),
      (e[(e.cursorHeight = 38)] = "cursorHeight"),
      (e[(e.disableLayerHinting = 39)] = "disableLayerHinting"),
      (e[(e.disableMonospaceOptimizations = 40)] = "disableMonospaceOptimizations"),
      (e[(e.domReadOnly = 41)] = "domReadOnly"),
      (e[(e.dragAndDrop = 42)] = "dragAndDrop"),
      (e[(e.dropIntoEditor = 43)] = "dropIntoEditor"),
      (e[(e.editContext = 44)] = "editContext"),
      (e[(e.emptySelectionClipboard = 45)] = "emptySelectionClipboard"),
      (e[(e.experimentalGpuAcceleration = 46)] = "experimentalGpuAcceleration"),
      (e[(e.experimentalWhitespaceRendering = 47)] = "experimentalWhitespaceRendering"),
      (e[(e.extraEditorClassName = 48)] = "extraEditorClassName"),
      (e[(e.fastScrollSensitivity = 49)] = "fastScrollSensitivity"),
      (e[(e.find = 50)] = "find"),
      (e[(e.fixedOverflowWidgets = 51)] = "fixedOverflowWidgets"),
      (e[(e.folding = 52)] = "folding"),
      (e[(e.foldingStrategy = 53)] = "foldingStrategy"),
      (e[(e.foldingHighlight = 54)] = "foldingHighlight"),
      (e[(e.foldingImportsByDefault = 55)] = "foldingImportsByDefault"),
      (e[(e.foldingMaximumRegions = 56)] = "foldingMaximumRegions"),
      (e[(e.unfoldOnClickAfterEndOfLine = 57)] = "unfoldOnClickAfterEndOfLine"),
      (e[(e.fontFamily = 58)] = "fontFamily"),
      (e[(e.fontInfo = 59)] = "fontInfo"),
      (e[(e.fontLigatures = 60)] = "fontLigatures"),
      (e[(e.fontSize = 61)] = "fontSize"),
      (e[(e.fontWeight = 62)] = "fontWeight"),
      (e[(e.fontVariations = 63)] = "fontVariations"),
      (e[(e.formatOnPaste = 64)] = "formatOnPaste"),
      (e[(e.formatOnType = 65)] = "formatOnType"),
      (e[(e.glyphMargin = 66)] = "glyphMargin"),
      (e[(e.gotoLocation = 67)] = "gotoLocation"),
      (e[(e.hideCursorInOverviewRuler = 68)] = "hideCursorInOverviewRuler"),
      (e[(e.hover = 69)] = "hover"),
      (e[(e.inDiffEditor = 70)] = "inDiffEditor"),
      (e[(e.inlineSuggest = 71)] = "inlineSuggest"),
      (e[(e.letterSpacing = 72)] = "letterSpacing"),
      (e[(e.lightbulb = 73)] = "lightbulb"),
      (e[(e.lineDecorationsWidth = 74)] = "lineDecorationsWidth"),
      (e[(e.lineHeight = 75)] = "lineHeight"),
      (e[(e.lineNumbers = 76)] = "lineNumbers"),
      (e[(e.lineNumbersMinChars = 77)] = "lineNumbersMinChars"),
      (e[(e.linkedEditing = 78)] = "linkedEditing"),
      (e[(e.links = 79)] = "links"),
      (e[(e.matchBrackets = 80)] = "matchBrackets"),
      (e[(e.minimap = 81)] = "minimap"),
      (e[(e.mouseStyle = 82)] = "mouseStyle"),
      (e[(e.mouseWheelScrollSensitivity = 83)] = "mouseWheelScrollSensitivity"),
      (e[(e.mouseWheelZoom = 84)] = "mouseWheelZoom"),
      (e[(e.multiCursorMergeOverlapping = 85)] = "multiCursorMergeOverlapping"),
      (e[(e.multiCursorModifier = 86)] = "multiCursorModifier"),
      (e[(e.mouseMiddleClickAction = 87)] = "mouseMiddleClickAction"),
      (e[(e.multiCursorPaste = 88)] = "multiCursorPaste"),
      (e[(e.multiCursorLimit = 89)] = "multiCursorLimit"),
      (e[(e.occurrencesHighlight = 90)] = "occurrencesHighlight"),
      (e[(e.occurrencesHighlightDelay = 91)] = "occurrencesHighlightDelay"),
      (e[(e.overtypeCursorStyle = 92)] = "overtypeCursorStyle"),
      (e[(e.overtypeOnPaste = 93)] = "overtypeOnPaste"),
      (e[(e.overviewRulerBorder = 94)] = "overviewRulerBorder"),
      (e[(e.overviewRulerLanes = 95)] = "overviewRulerLanes"),
      (e[(e.padding = 96)] = "padding"),
      (e[(e.pasteAs = 97)] = "pasteAs"),
      (e[(e.parameterHints = 98)] = "parameterHints"),
      (e[(e.peekWidgetDefaultFocus = 99)] = "peekWidgetDefaultFocus"),
      (e[(e.placeholder = 100)] = "placeholder"),
      (e[(e.definitionLinkOpensInPeek = 101)] = "definitionLinkOpensInPeek"),
      (e[(e.quickSuggestions = 102)] = "quickSuggestions"),
      (e[(e.quickSuggestionsDelay = 103)] = "quickSuggestionsDelay"),
      (e[(e.readOnly = 104)] = "readOnly"),
      (e[(e.readOnlyMessage = 105)] = "readOnlyMessage"),
      (e[(e.renameOnType = 106)] = "renameOnType"),
      (e[(e.renderRichScreenReaderContent = 107)] = "renderRichScreenReaderContent"),
      (e[(e.renderControlCharacters = 108)] = "renderControlCharacters"),
      (e[(e.renderFinalNewline = 109)] = "renderFinalNewline"),
      (e[(e.renderLineHighlight = 110)] = "renderLineHighlight"),
      (e[(e.renderLineHighlightOnlyWhenFocus = 111)] = "renderLineHighlightOnlyWhenFocus"),
      (e[(e.renderValidationDecorations = 112)] = "renderValidationDecorations"),
      (e[(e.renderWhitespace = 113)] = "renderWhitespace"),
      (e[(e.revealHorizontalRightPadding = 114)] = "revealHorizontalRightPadding"),
      (e[(e.roundedSelection = 115)] = "roundedSelection"),
      (e[(e.rulers = 116)] = "rulers"),
      (e[(e.scrollbar = 117)] = "scrollbar"),
      (e[(e.scrollBeyondLastColumn = 118)] = "scrollBeyondLastColumn"),
      (e[(e.scrollBeyondLastLine = 119)] = "scrollBeyondLastLine"),
      (e[(e.scrollPredominantAxis = 120)] = "scrollPredominantAxis"),
      (e[(e.selectionClipboard = 121)] = "selectionClipboard"),
      (e[(e.selectionHighlight = 122)] = "selectionHighlight"),
      (e[(e.selectionHighlightMaxLength = 123)] = "selectionHighlightMaxLength"),
      (e[(e.selectionHighlightMultiline = 124)] = "selectionHighlightMultiline"),
      (e[(e.selectOnLineNumbers = 125)] = "selectOnLineNumbers"),
      (e[(e.showFoldingControls = 126)] = "showFoldingControls"),
      (e[(e.showUnused = 127)] = "showUnused"),
      (e[(e.snippetSuggestions = 128)] = "snippetSuggestions"),
      (e[(e.smartSelect = 129)] = "smartSelect"),
      (e[(e.smoothScrolling = 130)] = "smoothScrolling"),
      (e[(e.stickyScroll = 131)] = "stickyScroll"),
      (e[(e.stickyTabStops = 132)] = "stickyTabStops"),
      (e[(e.stopRenderingLineAfter = 133)] = "stopRenderingLineAfter"),
      (e[(e.suggest = 134)] = "suggest"),
      (e[(e.suggestFontSize = 135)] = "suggestFontSize"),
      (e[(e.suggestLineHeight = 136)] = "suggestLineHeight"),
      (e[(e.suggestOnTriggerCharacters = 137)] = "suggestOnTriggerCharacters"),
      (e[(e.suggestSelection = 138)] = "suggestSelection"),
      (e[(e.tabCompletion = 139)] = "tabCompletion"),
      (e[(e.tabIndex = 140)] = "tabIndex"),
      (e[(e.trimWhitespaceOnDelete = 141)] = "trimWhitespaceOnDelete"),
      (e[(e.unicodeHighlighting = 142)] = "unicodeHighlighting"),
      (e[(e.unusualLineTerminators = 143)] = "unusualLineTerminators"),
      (e[(e.useShadowDOM = 144)] = "useShadowDOM"),
      (e[(e.useTabStops = 145)] = "useTabStops"),
      (e[(e.wordBreak = 146)] = "wordBreak"),
      (e[(e.wordSegmenterLocales = 147)] = "wordSegmenterLocales"),
      (e[(e.wordSeparators = 148)] = "wordSeparators"),
      (e[(e.wordWrap = 149)] = "wordWrap"),
      (e[(e.wordWrapBreakAfterCharacters = 150)] = "wordWrapBreakAfterCharacters"),
      (e[(e.wordWrapBreakBeforeCharacters = 151)] = "wordWrapBreakBeforeCharacters"),
      (e[(e.wordWrapColumn = 152)] = "wordWrapColumn"),
      (e[(e.wordWrapOverride1 = 153)] = "wordWrapOverride1"),
      (e[(e.wordWrapOverride2 = 154)] = "wordWrapOverride2"),
      (e[(e.wrappingIndent = 155)] = "wrappingIndent"),
      (e[(e.wrappingStrategy = 156)] = "wrappingStrategy"),
      (e[(e.showDeprecated = 157)] = "showDeprecated"),
      (e[(e.inertialScroll = 158)] = "inertialScroll"),
      (e[(e.inlayHints = 159)] = "inlayHints"),
      (e[(e.wrapOnEscapedLineFeeds = 160)] = "wrapOnEscapedLineFeeds"),
      (e[(e.effectiveCursorStyle = 161)] = "effectiveCursorStyle"),
      (e[(e.editorClassName = 162)] = "editorClassName"),
      (e[(e.pixelRatio = 163)] = "pixelRatio"),
      (e[(e.tabFocusMode = 164)] = "tabFocusMode"),
      (e[(e.layoutInfo = 165)] = "layoutInfo"),
      (e[(e.wrappingInfo = 166)] = "wrappingInfo"),
      (e[(e.defaultColorDecorators = 167)] = "defaultColorDecorators"),
      (e[(e.colorDecoratorsActivatedOn = 168)] = "colorDecoratorsActivatedOn"),
      (e[(e.inlineCompletionsAccessibilityVerbose = 169)] =
        "inlineCompletionsAccessibilityVerbose"),
      (e[(e.effectiveEditContext = 170)] = "effectiveEditContext"),
      (e[(e.scrollOnMiddleClick = 171)] = "scrollOnMiddleClick"),
      (e[(e.effectiveAllowVariableFonts = 172)] = "effectiveAllowVariableFonts"));
  })(uVe || (uVe = {})),
  (function (e) {
    ((e[(e.TextDefined = 0)] = "TextDefined"), (e[(e.LF = 1)] = "LF"), (e[(e.CRLF = 2)] = "CRLF"));
  })(hVe || (hVe = {})),
  (function (e) {
    ((e[(e.LF = 0)] = "LF"), (e[(e.CRLF = 1)] = "CRLF"));
  })(gVe || (gVe = {})),
  (function (e) {
    ((e[(e.Left = 1)] = "Left"), (e[(e.Center = 2)] = "Center"), (e[(e.Right = 3)] = "Right"));
  })(pVe || (pVe = {})),
  (function (e) {
    ((e[(e.Increase = 0)] = "Increase"), (e[(e.Decrease = 1)] = "Decrease"));
  })(fVe || (fVe = {})),
  (function (e) {
    ((e[(e.None = 0)] = "None"),
      (e[(e.Indent = 1)] = "Indent"),
      (e[(e.IndentOutdent = 2)] = "IndentOutdent"),
      (e[(e.Outdent = 3)] = "Outdent"));
  })(mVe || (mVe = {})),
  (function (e) {
    ((e[(e.Both = 0)] = "Both"),
      (e[(e.Right = 1)] = "Right"),
      (e[(e.Left = 2)] = "Left"),
      (e[(e.None = 3)] = "None"));
  })(_Ve || (_Ve = {})),
  (function (e) {
    ((e[(e.Type = 1)] = "Type"), (e[(e.Parameter = 2)] = "Parameter"));
  })(vVe || (vVe = {})),
  (function (e) {
    ((e[(e.Accepted = 0)] = "Accepted"),
      (e[(e.Rejected = 1)] = "Rejected"),
      (e[(e.Ignored = 2)] = "Ignored"));
  })(bVe || (bVe = {})),
  (function (e) {
    ((e[(e.Code = 1)] = "Code"), (e[(e.Label = 2)] = "Label"));
  })(yVe || (yVe = {})),
  (function (e) {
    ((e[(e.Automatic = 0)] = "Automatic"), (e[(e.Explicit = 1)] = "Explicit"));
  })(xVe || (xVe = {})),
  (function (e) {
    ((e[(e.DependsOnKbLayout = -1)] = "DependsOnKbLayout"),
      (e[(e.Unknown = 0)] = "Unknown"),
      (e[(e.Backspace = 1)] = "Backspace"),
      (e[(e.Tab = 2)] = "Tab"),
      (e[(e.Enter = 3)] = "Enter"),
      (e[(e.Shift = 4)] = "Shift"),
      (e[(e.Ctrl = 5)] = "Ctrl"),
      (e[(e.Alt = 6)] = "Alt"),
      (e[(e.PauseBreak = 7)] = "PauseBreak"),
      (e[(e.CapsLock = 8)] = "CapsLock"),
      (e[(e.Escape = 9)] = "Escape"),
      (e[(e.Space = 10)] = "Space"),
      (e[(e.PageUp = 11)] = "PageUp"),
      (e[(e.PageDown = 12)] = "PageDown"),
      (e[(e.End = 13)] = "End"),
      (e[(e.Home = 14)] = "Home"),
      (e[(e.LeftArrow = 15)] = "LeftArrow"),
      (e[(e.UpArrow = 16)] = "UpArrow"),
      (e[(e.RightArrow = 17)] = "RightArrow"),
      (e[(e.DownArrow = 18)] = "DownArrow"),
      (e[(e.Insert = 19)] = "Insert"),
      (e[(e.Delete = 20)] = "Delete"),
      (e[(e.Digit0 = 21)] = "Digit0"),
      (e[(e.Digit1 = 22)] = "Digit1"),
      (e[(e.Digit2 = 23)] = "Digit2"),
      (e[(e.Digit3 = 24)] = "Digit3"),
      (e[(e.Digit4 = 25)] = "Digit4"),
      (e[(e.Digit5 = 26)] = "Digit5"),
      (e[(e.Digit6 = 27)] = "Digit6"),
      (e[(e.Digit7 = 28)] = "Digit7"),
      (e[(e.Digit8 = 29)] = "Digit8"),
      (e[(e.Digit9 = 30)] = "Digit9"),
      (e[(e.KeyA = 31)] = "KeyA"),
      (e[(e.KeyB = 32)] = "KeyB"),
      (e[(e.KeyC = 33)] = "KeyC"),
      (e[(e.KeyD = 34)] = "KeyD"),
      (e[(e.KeyE = 35)] = "KeyE"),
      (e[(e.KeyF = 36)] = "KeyF"),
      (e[(e.KeyG = 37)] = "KeyG"),
      (e[(e.KeyH = 38)] = "KeyH"),
      (e[(e.KeyI = 39)] = "KeyI"),
      (e[(e.KeyJ = 40)] = "KeyJ"),
      (e[(e.KeyK = 41)] = "KeyK"),
      (e[(e.KeyL = 42)] = "KeyL"),
      (e[(e.KeyM = 43)] = "KeyM"),
      (e[(e.KeyN = 44)] = "KeyN"),
      (e[(e.KeyO = 45)] = "KeyO"),
      (e[(e.KeyP = 46)] = "KeyP"),
      (e[(e.KeyQ = 47)] = "KeyQ"),
      (e[(e.KeyR = 48)] = "KeyR"),
      (e[(e.KeyS = 49)] = "KeyS"),
      (e[(e.KeyT = 50)] = "KeyT"),
      (e[(e.KeyU = 51)] = "KeyU"),
      (e[(e.KeyV = 52)] = "KeyV"),
      (e[(e.KeyW = 53)] = "KeyW"),
      (e[(e.KeyX = 54)] = "KeyX"),
      (e[(e.KeyY = 55)] = "KeyY"),
      (e[(e.KeyZ = 56)] = "KeyZ"),
      (e[(e.Meta = 57)] = "Meta"),
      (e[(e.ContextMenu = 58)] = "ContextMenu"),
      (e[(e.F1 = 59)] = "F1"),
      (e[(e.F2 = 60)] = "F2"),
      (e[(e.F3 = 61)] = "F3"),
      (e[(e.F4 = 62)] = "F4"),
      (e[(e.F5 = 63)] = "F5"),
      (e[(e.F6 = 64)] = "F6"),
      (e[(e.F7 = 65)] = "F7"),
      (e[(e.F8 = 66)] = "F8"),
      (e[(e.F9 = 67)] = "F9"),
      (e[(e.F10 = 68)] = "F10"),
      (e[(e.F11 = 69)] = "F11"),
      (e[(e.F12 = 70)] = "F12"),
      (e[(e.F13 = 71)] = "F13"),
      (e[(e.F14 = 72)] = "F14"),
      (e[(e.F15 = 73)] = "F15"),
      (e[(e.F16 = 74)] = "F16"),
      (e[(e.F17 = 75)] = "F17"),
      (e[(e.F18 = 76)] = "F18"),
      (e[(e.F19 = 77)] = "F19"),
      (e[(e.F20 = 78)] = "F20"),
      (e[(e.F21 = 79)] = "F21"),
      (e[(e.F22 = 80)] = "F22"),
      (e[(e.F23 = 81)] = "F23"),
      (e[(e.F24 = 82)] = "F24"),
      (e[(e.NumLock = 83)] = "NumLock"),
      (e[(e.ScrollLock = 84)] = "ScrollLock"),
      (e[(e.Semicolon = 85)] = "Semicolon"),
      (e[(e.Equal = 86)] = "Equal"),
      (e[(e.Comma = 87)] = "Comma"),
      (e[(e.Minus = 88)] = "Minus"),
      (e[(e.Period = 89)] = "Period"),
      (e[(e.Slash = 90)] = "Slash"),
      (e[(e.Backquote = 91)] = "Backquote"),
      (e[(e.BracketLeft = 92)] = "BracketLeft"),
      (e[(e.Backslash = 93)] = "Backslash"),
      (e[(e.BracketRight = 94)] = "BracketRight"),
      (e[(e.Quote = 95)] = "Quote"),
      (e[(e.OEM_8 = 96)] = "OEM_8"),
      (e[(e.IntlBackslash = 97)] = "IntlBackslash"),
      (e[(e.Numpad0 = 98)] = "Numpad0"),
      (e[(e.Numpad1 = 99)] = "Numpad1"),
      (e[(e.Numpad2 = 100)] = "Numpad2"),
      (e[(e.Numpad3 = 101)] = "Numpad3"),
      (e[(e.Numpad4 = 102)] = "Numpad4"),
      (e[(e.Numpad5 = 103)] = "Numpad5"),
      (e[(e.Numpad6 = 104)] = "Numpad6"),
      (e[(e.Numpad7 = 105)] = "Numpad7"),
      (e[(e.Numpad8 = 106)] = "Numpad8"),
      (e[(e.Numpad9 = 107)] = "Numpad9"),
      (e[(e.NumpadMultiply = 108)] = "NumpadMultiply"),
      (e[(e.NumpadAdd = 109)] = "NumpadAdd"),
      (e[(e.NUMPAD_SEPARATOR = 110)] = "NUMPAD_SEPARATOR"),
      (e[(e.NumpadSubtract = 111)] = "NumpadSubtract"),
      (e[(e.NumpadDecimal = 112)] = "NumpadDecimal"),
      (e[(e.NumpadDivide = 113)] = "NumpadDivide"),
      (e[(e.KEY_IN_COMPOSITION = 114)] = "KEY_IN_COMPOSITION"),
      (e[(e.ABNT_C1 = 115)] = "ABNT_C1"),
      (e[(e.ABNT_C2 = 116)] = "ABNT_C2"),
      (e[(e.AudioVolumeMute = 117)] = "AudioVolumeMute"),
      (e[(e.AudioVolumeUp = 118)] = "AudioVolumeUp"),
      (e[(e.AudioVolumeDown = 119)] = "AudioVolumeDown"),
      (e[(e.BrowserSearch = 120)] = "BrowserSearch"),
      (e[(e.BrowserHome = 121)] = "BrowserHome"),
      (e[(e.BrowserBack = 122)] = "BrowserBack"),
      (e[(e.BrowserForward = 123)] = "BrowserForward"),
      (e[(e.MediaTrackNext = 124)] = "MediaTrackNext"),
      (e[(e.MediaTrackPrevious = 125)] = "MediaTrackPrevious"),
      (e[(e.MediaStop = 126)] = "MediaStop"),
      (e[(e.MediaPlayPause = 127)] = "MediaPlayPause"),
      (e[(e.LaunchMediaPlayer = 128)] = "LaunchMediaPlayer"),
      (e[(e.LaunchMail = 129)] = "LaunchMail"),
      (e[(e.LaunchApp2 = 130)] = "LaunchApp2"),
      (e[(e.Clear = 131)] = "Clear"),
      (e[(e.MAX_VALUE = 132)] = "MAX_VALUE"));
  })(wVe || (wVe = {})),
  (function (e) {
    ((e[(e.Hint = 1)] = "Hint"),
      (e[(e.Info = 2)] = "Info"),
      (e[(e.Warning = 4)] = "Warning"),
      (e[(e.Error = 8)] = "Error"));
  })(CVe || (CVe = {})),
  (function (e) {
    ((e[(e.Unnecessary = 1)] = "Unnecessary"), (e[(e.Deprecated = 2)] = "Deprecated"));
  })(SVe || (SVe = {})),
  (function (e) {
    ((e[(e.Inline = 1)] = "Inline"), (e[(e.Gutter = 2)] = "Gutter"));
  })(kVe || (kVe = {})),
  (function (e) {
    ((e[(e.Normal = 1)] = "Normal"), (e[(e.Underlined = 2)] = "Underlined"));
  })(EVe || (EVe = {})),
  (function (e) {
    ((e[(e.UNKNOWN = 0)] = "UNKNOWN"),
      (e[(e.TEXTAREA = 1)] = "TEXTAREA"),
      (e[(e.GUTTER_GLYPH_MARGIN = 2)] = "GUTTER_GLYPH_MARGIN"),
      (e[(e.GUTTER_LINE_NUMBERS = 3)] = "GUTTER_LINE_NUMBERS"),
      (e[(e.GUTTER_LINE_DECORATIONS = 4)] = "GUTTER_LINE_DECORATIONS"),
      (e[(e.GUTTER_VIEW_ZONE = 5)] = "GUTTER_VIEW_ZONE"),
      (e[(e.CONTENT_TEXT = 6)] = "CONTENT_TEXT"),
      (e[(e.CONTENT_EMPTY = 7)] = "CONTENT_EMPTY"),
      (e[(e.CONTENT_VIEW_ZONE = 8)] = "CONTENT_VIEW_ZONE"),
      (e[(e.CONTENT_WIDGET = 9)] = "CONTENT_WIDGET"),
      (e[(e.OVERVIEW_RULER = 10)] = "OVERVIEW_RULER"),
      (e[(e.SCROLLBAR = 11)] = "SCROLLBAR"),
      (e[(e.OVERLAY_WIDGET = 12)] = "OVERLAY_WIDGET"),
      (e[(e.OUTSIDE_EDITOR = 13)] = "OUTSIDE_EDITOR"));
  })(NVe || (NVe = {})),
  (function (e) {
    e[(e.AIGenerated = 1)] = "AIGenerated";
  })(LVe || (LVe = {})),
  (function (e) {
    ((e[(e.Invoke = 0)] = "Invoke"), (e[(e.Automatic = 1)] = "Automatic"));
  })(DVe || (DVe = {})),
  (function (e) {
    ((e[(e.TOP_RIGHT_CORNER = 0)] = "TOP_RIGHT_CORNER"),
      (e[(e.BOTTOM_RIGHT_CORNER = 1)] = "BOTTOM_RIGHT_CORNER"),
      (e[(e.TOP_CENTER = 2)] = "TOP_CENTER"));
  })(TVe || (TVe = {})),
  (function (e) {
    ((e[(e.Left = 1)] = "Left"),
      (e[(e.Center = 2)] = "Center"),
      (e[(e.Right = 4)] = "Right"),
      (e[(e.Full = 7)] = "Full"));
  })(IVe || (IVe = {})),
  (function (e) {
    ((e[(e.Word = 0)] = "Word"), (e[(e.Line = 1)] = "Line"), (e[(e.Suggest = 2)] = "Suggest"));
  })(RVe || (RVe = {})),
  (function (e) {
    ((e[(e.Left = 0)] = "Left"),
      (e[(e.Right = 1)] = "Right"),
      (e[(e.None = 2)] = "None"),
      (e[(e.LeftOfInjectedText = 3)] = "LeftOfInjectedText"),
      (e[(e.RightOfInjectedText = 4)] = "RightOfInjectedText"));
  })(OVe || (OVe = {})),
  (function (e) {
    ((e[(e.Off = 0)] = "Off"),
      (e[(e.On = 1)] = "On"),
      (e[(e.Relative = 2)] = "Relative"),
      (e[(e.Interval = 3)] = "Interval"),
      (e[(e.Custom = 4)] = "Custom"));
  })(MVe || (MVe = {})),
  (function (e) {
    ((e[(e.None = 0)] = "None"), (e[(e.Text = 1)] = "Text"), (e[(e.Blocks = 2)] = "Blocks"));
  })(AVe || (AVe = {})),
  (function (e) {
    ((e[(e.Smooth = 0)] = "Smooth"), (e[(e.Immediate = 1)] = "Immediate"));
  })(PVe || (PVe = {})),
  (function (e) {
    ((e[(e.Auto = 1)] = "Auto"), (e[(e.Hidden = 2)] = "Hidden"), (e[(e.Visible = 3)] = "Visible"));
  })(jVe || (jVe = {})),
  (function (e) {
    ((e[(e.LTR = 0)] = "LTR"), (e[(e.RTL = 1)] = "RTL"));
  })(FVe || (FVe = {})),
  (function (e) {
    ((e.Off = "off"), (e.OnCode = "onCode"), (e.On = "on"));
  })(BVe || (BVe = {})),
  (function (e) {
    ((e[(e.Invoke = 1)] = "Invoke"),
      (e[(e.TriggerCharacter = 2)] = "TriggerCharacter"),
      (e[(e.ContentChange = 3)] = "ContentChange"));
  })(VVe || (VVe = {})),
  (function (e) {
    ((e[(e.File = 0)] = "File"),
      (e[(e.Module = 1)] = "Module"),
      (e[(e.Namespace = 2)] = "Namespace"),
      (e[(e.Package = 3)] = "Package"),
      (e[(e.Class = 4)] = "Class"),
      (e[(e.Method = 5)] = "Method"),
      (e[(e.Property = 6)] = "Property"),
      (e[(e.Field = 7)] = "Field"),
      (e[(e.Constructor = 8)] = "Constructor"),
      (e[(e.Enum = 9)] = "Enum"),
      (e[(e.Interface = 10)] = "Interface"),
      (e[(e.Function = 11)] = "Function"),
      (e[(e.Variable = 12)] = "Variable"),
      (e[(e.Constant = 13)] = "Constant"),
      (e[(e.String = 14)] = "String"),
      (e[(e.Number = 15)] = "Number"),
      (e[(e.Boolean = 16)] = "Boolean"),
      (e[(e.Array = 17)] = "Array"),
      (e[(e.Object = 18)] = "Object"),
      (e[(e.Key = 19)] = "Key"),
      (e[(e.Null = 20)] = "Null"),
      (e[(e.EnumMember = 21)] = "EnumMember"),
      (e[(e.Struct = 22)] = "Struct"),
      (e[(e.Event = 23)] = "Event"),
      (e[(e.Operator = 24)] = "Operator"),
      (e[(e.TypeParameter = 25)] = "TypeParameter"));
  })(WVe || (WVe = {})),
  (function (e) {
    e[(e.Deprecated = 1)] = "Deprecated";
  })(HVe || (HVe = {})),
  (function (e) {
    ((e[(e.LTR = 0)] = "LTR"), (e[(e.RTL = 1)] = "RTL"));
  })(zVe || (zVe = {})),
  (function (e) {
    ((e[(e.Hidden = 0)] = "Hidden"),
      (e[(e.Blink = 1)] = "Blink"),
      (e[(e.Smooth = 2)] = "Smooth"),
      (e[(e.Phase = 3)] = "Phase"),
      (e[(e.Expand = 4)] = "Expand"),
      (e[(e.Solid = 5)] = "Solid"));
  })(UVe || (UVe = {})),
  (function (e) {
    ((e[(e.Line = 1)] = "Line"),
      (e[(e.Block = 2)] = "Block"),
      (e[(e.Underline = 3)] = "Underline"),
      (e[(e.LineThin = 4)] = "LineThin"),
      (e[(e.BlockOutline = 5)] = "BlockOutline"),
      (e[(e.UnderlineThin = 6)] = "UnderlineThin"));
  })($Ve || ($Ve = {})),
  (function (e) {
    ((e[(e.AlwaysGrowsWhenTypingAtEdges = 0)] = "AlwaysGrowsWhenTypingAtEdges"),
      (e[(e.NeverGrowsWhenTypingAtEdges = 1)] = "NeverGrowsWhenTypingAtEdges"),
      (e[(e.GrowsOnlyWhenTypingBefore = 2)] = "GrowsOnlyWhenTypingBefore"),
      (e[(e.GrowsOnlyWhenTypingAfter = 3)] = "GrowsOnlyWhenTypingAfter"));
  })(qVe || (qVe = {})),
  (function (e) {
    ((e[(e.None = 0)] = "None"),
      (e[(e.Same = 1)] = "Same"),
      (e[(e.Indent = 2)] = "Indent"),
      (e[(e.DeepIndent = 3)] = "DeepIndent"));
  })(KVe || (KVe = {})));
let GVe = class {
  static {
    this.CtrlCmd = 2048;
  }
  static {
    this.Shift = 1024;
  }
  static {
    this.Alt = 512;
  }
  static {
    this.WinCtrl = 256;
  }
  static chord(e, t) {
    return gO(e, t);
  }
};
function ZVe() {
  return {
    editor: void 0,
    languages: void 0,
    CancellationTokenSource: cM,
    Emitter: QO,
    KeyCode: wVe,
    KeyMod: GVe,
    Position: xV,
    Range: YH,
    Selection: XH,
    SelectionDirection: FVe,
    MarkerSeverity: CVe,
    MarkerTag: SVe,
    Uri: mP,
    Token: c2,
  };
}
const YVe = "default";
let XVe,
  QVe = !1;
function JVe(e) {
  BR && (QVe || (QVe = !0));
}
class eWe {
  constructor(e, t, n, i, r) {
    ((this.vsWorker = e),
      (this.req = t),
      (this.channel = n),
      (this.method = i),
      (this.args = r),
      (this.type = 0));
  }
}
class tWe {
  constructor(e, t, n, i) {
    ((this.vsWorker = e), (this.seq = t), (this.res = n), (this.err = i), (this.type = 1));
  }
}
class nWe {
  constructor(e, t, n, i, r) {
    ((this.vsWorker = e),
      (this.req = t),
      (this.channel = n),
      (this.eventName = i),
      (this.arg = r),
      (this.type = 2));
  }
}
class iWe {
  constructor(e, t, n) {
    ((this.vsWorker = e), (this.req = t), (this.event = n), (this.type = 3));
  }
}
class rWe {
  constructor(e, t) {
    ((this.vsWorker = e), (this.req = t), (this.type = 4));
  }
}
class oWe {
  constructor(e) {
    ((this._workerId = -1),
      (this._handler = e),
      (this._lastSentReq = 0),
      (this._pendingReplies = Object.create(null)),
      (this._pendingEmitters = new Map()),
      (this._pendingEvents = new Map()));
  }
  setWorkerId(e) {
    this._workerId = e;
  }
  async sendMessage(e, t, n) {
    const i = String(++this._lastSentReq);
    return new Promise((r, o) => {
      ((this._pendingReplies[i] = { resolve: r, reject: o }),
        this._send(new eWe(this._workerId, i, e, t, n)));
    });
  }
  listen(e, t, n) {
    let i = null;
    const r = new QO({
      onWillAddFirstListener: () => {
        ((i = String(++this._lastSentReq)),
          this._pendingEmitters.set(i, r),
          this._send(new nWe(this._workerId, i, e, t, n)));
      },
      onDidRemoveLastListener: () => {
        (this._pendingEmitters.delete(i), this._send(new rWe(this._workerId, i)), (i = null));
      },
    });
    return r.event;
  }
  handleMessage(e) {
    e &&
      e.vsWorker &&
      ((-1 !== this._workerId && e.vsWorker !== this._workerId) || this._handleMessage(e));
  }
  createProxyToRemoteChannel(e, t) {
    const n = {
      get: (n, i) => (
        "string" != typeof i ||
          n[i] ||
          (lWe(i)
            ? (n[i] = (t) => this.listen(e, i, t))
            : aWe(i)
              ? (n[i] = this.listen(e, i, void 0))
              : 36 === i.charCodeAt(0) &&
                (n[i] = async (...n) => (await t?.(), this.sendMessage(e, i, n)))),
        n[i]
      ),
    };
    return new Proxy(Object.create(null), n);
  }
  _handleMessage(e) {
    switch (e.type) {
      case 1:
        return this._handleReplyMessage(e);
      case 0:
        return this._handleRequestMessage(e);
      case 2:
        return this._handleSubscribeEventMessage(e);
      case 3:
        return this._handleEventMessage(e);
      case 4:
        return this._handleUnsubscribeEventMessage(e);
    }
  }
  _handleReplyMessage(e) {
    if (!this._pendingReplies[e.seq]) return;
    const t = this._pendingReplies[e.seq];
    if ((delete this._pendingReplies[e.seq], e.err)) {
      let n = e.err;
      if (e.err.$isError) {
        const t = new Error();
        ((t.name = e.err.name), (t.message = e.err.message), (t.stack = e.err.stack), (n = t));
      }
      return void t.reject(n);
    }
    t.resolve(e.res);
  }
  _handleRequestMessage(e) {
    const t = e.req;
    this._handler.handleMessage(e.channel, e.method, e.args).then(
      (e) => {
        this._send(new tWe(this._workerId, t, e, void 0));
      },
      (e) => {
        (e.detail instanceof Error && (e.detail = UI(e.detail)),
          this._send(new tWe(this._workerId, t, void 0, UI(e))));
      },
    );
  }
  _handleSubscribeEventMessage(e) {
    const t = e.req,
      n = this._handler.handleEvent(
        e.channel,
        e.eventName,
        e.arg,
      )((e) => {
        this._send(new iWe(this._workerId, t, e));
      });
    this._pendingEvents.set(t, n);
  }
  _handleEventMessage(e) {
    this._pendingEmitters.has(e.req) && this._pendingEmitters.get(e.req).fire(e.event);
  }
  _handleUnsubscribeEventMessage(e) {
    this._pendingEvents.has(e.req) &&
      (this._pendingEvents.get(e.req).dispose(), this._pendingEvents.delete(e.req));
  }
  _send(e) {
    const t = [];
    if (0 === e.type)
      for (let n = 0; n < e.args.length; n++) {
        const i = e.args[n];
        i instanceof ArrayBuffer && t.push(i);
      }
    else 1 === e.type && e.res instanceof ArrayBuffer && t.push(e.res);
    this._handler.sendMessage(e, t);
  }
}
class sWe extends PO {
  constructor(e) {
    (super(),
      (this._localChannels = new Map()),
      (this._worker = this._register(e)),
      this._register(
        this._worker.onMessage((e) => {
          this._protocol.handleMessage(e);
        }),
      ),
      this._register(
        this._worker.onError((e) => {
          (JVe(), HI(e));
        }),
      ),
      (this._protocol = new oWe({
        sendMessage: (e, t) => {
          this._worker.postMessage(e, t);
        },
        handleMessage: (e, t, n) => this._handleMessage(e, t, n),
        handleEvent: (e, t, n) => this._handleEvent(e, t, n),
      })),
      this._protocol.setWorkerId(this._worker.getId()),
      (this._onModuleLoaded = this._protocol
        .sendMessage(YVe, "$initialize", [this._worker.getId()])
        .then(() => {})),
      (this.proxy = this._protocol.createProxyToRemoteChannel(YVe, async () => {
        await this._onModuleLoaded;
      })),
      this._onModuleLoaded.catch((e) => {
        this._onError("Worker failed to load ", e);
      }));
  }
  _handleMessage(e, t, n) {
    const i = this._localChannels.get(e);
    if (!i) return Promise.reject(new Error(`Missing channel ${e} on main thread`));
    const r = i[t];
    if ("function" != typeof r)
      return Promise.reject(new Error(`Missing method ${t} on main thread channel ${e}`));
    try {
      return Promise.resolve(r.apply(i, n));
    } catch (spt) {
      return Promise.reject(spt);
    }
  }
  _handleEvent(e, t, n) {
    const i = this._localChannels.get(e);
    if (!i) throw new Error(`Missing channel ${e} on main thread`);
    if (lWe(t)) {
      const r = i[t];
      if ("function" != typeof r)
        throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);
      const o = r.call(i, n);
      if ("function" != typeof o)
        throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);
      return o;
    }
    if (aWe(t)) {
      const n = i[t];
      if ("function" != typeof n)
        throw new Error(`Missing event ${t} on main thread channel ${e}.`);
      return n;
    }
    throw new Error(`Malformed event name ${t}`);
  }
  setChannel(e, t) {
    this._localChannels.set(e, t);
  }
  _onError(e, t) {}
}
function aWe(e) {
  return "o" === e[0] && "n" === e[1] && oA(e.charCodeAt(2));
}
function lWe(e) {
  return /^onDynamic/.test(e) && oA(e.charCodeAt(9));
}
function cWe(e, t) {
  const n = e.label || "anonymous" + t,
    i = BI();
  if (i) {
    if ("function" == typeof i.getWorker) return i.getWorker("workerMain.js", n);
    if ("function" == typeof i.getWorkerUrl) {
      const e = i.getWorkerUrl("workerMain.js", n);
      return new Worker(XVe ? XVe.createScriptURL(e) : e, { name: n, type: "module" });
    }
  }
  const r = e.esmModuleLocation;
  if (r) {
    const e = (function (e, t) {
      if (
        /^((http:)|(https:)|(file:))/.test(t) &&
        t.substring(0, globalThis.origin.length) !== globalThis.origin
      );
      else {
        const n = t.lastIndexOf("?"),
          i = t.lastIndexOf("#", n),
          r =
            n > 0
              ? new URLSearchParams(t.substring(n + 1, ~i ? i : void 0))
              : new URLSearchParams();
        OP.addSearchParam(r, !0, !0);
        t = r.toString() ? `${t}?${r.toString()}#${e}` : `${t}#${e}`;
      }
      const n = new Blob(
        [
          rj([
            `/*${e}*/`,
            `globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(yI())};`,
            `globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(xI())};`,
            `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(t)}) ?? ${JSON.stringify(t)});`,
            "globalThis.postMessage({ type: 'vscode-worker-ready' });",
            `/*${e}*/`,
          ]).join(""),
        ],
        { type: "application/javascript" },
      );
      return URL.createObjectURL(n);
    })(n, r.toString(!0));
    return (function (e) {
      return new Promise((t, n) => {
        ((e.onmessage = function (n) {
          "vscode-worker-ready" === n.data.type && ((e.onmessage = null), t(e));
        }),
          (e.onerror = n));
      });
    })(new Worker(XVe ? XVe.createScriptURL(e) : e, { name: n, type: "module" }));
  }
  throw new Error(
    "You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker",
  );
}
XVe =
  "object" == typeof self &&
  self.constructor &&
  "DedicatedWorkerGlobalScope" === self.constructor.name &&
  void 0 !== globalThis.workerttPolicy
    ? globalThis.workerttPolicy
    : ZJ("defaultWorkerFactory", { createScriptURL: (e) => e });
class dWe extends PO {
  static {
    this.LAST_WORKER_ID = 0;
  }
  constructor(e) {
    (super(),
      (this._onMessage = this._register(new QO())),
      (this.onMessage = this._onMessage.event),
      (this._onError = this._register(new QO())),
      (this.onError = this._onError.event),
      (this.id = ++dWe.LAST_WORKER_ID));
    const t = e instanceof Worker || "then" in e ? e : cWe(e, this.id);
    var n;
    ((n = t) && "function" == typeof n.then
      ? (this.worker = t)
      : (this.worker = Promise.resolve(t)),
      this.postMessage("-please-ignore-", []));
    const i = (e) => {
      this._onError.fire(e);
    };
    (this.worker.then((e) => {
      ((e.onmessage = (e) => {
        this._onMessage.fire(e.data);
      }),
        (e.onmessageerror = (e) => {
          this._onError.fire(e);
        }),
        "function" == typeof e.addEventListener && e.addEventListener("error", i));
    }),
      this._register(
        MO(() => {
          (this.worker?.then((e) => {
            ((e.onmessage = null),
              (e.onmessageerror = null),
              e.removeEventListener("error", i),
              e.terminate());
          }),
            (this.worker = null));
        }),
      ));
  }
  getId() {
    return this.id;
  }
  postMessage(e, t) {
    this.worker?.then((n) => {
      try {
        n.postMessage(e, t);
      } catch (i) {
        (HI(i), HI(new Error("FAILED to post message to worker", { cause: i })));
      }
    });
  }
}
class uWe {
  constructor(e, t) {
    ((this.esmModuleLocation = e), (this.label = t));
  }
}
class hWe {
  constructor(e, t, n) {
    const i = new Uint8Array(e * t);
    for (let r = 0, o = e * t; r < o; r++) i[r] = n;
    ((this._data = i), (this.rows = e), (this.cols = t));
  }
  get(e, t) {
    return this._data[e * this.cols + t];
  }
  set(e, t, n) {
    this._data[e * this.cols + t] = n;
  }
}
class gWe {
  constructor(e) {
    let t = 0,
      n = 0;
    for (let r = 0, o = e.length; r < o; r++) {
      const [i, o, s] = e[r];
      (o > t && (t = o), i > n && (n = i), s > n && (n = s));
    }
    (t++, n++);
    const i = new hWe(n, t, 0);
    for (let r = 0, o = e.length; r < o; r++) {
      const [t, n, o] = e[r];
      i.set(t, n, o);
    }
    ((this._states = i), (this._maxCharCode = t));
  }
  nextState(e, t) {
    return t < 0 || t >= this._maxCharCode ? 0 : this._states.get(e, t);
  }
}
let pWe = null;
let fWe = null;
class mWe {
  static _createLink(e, t, n, i, r) {
    let o = r - 1;
    do {
      const n = t.charCodeAt(o);
      if (2 !== e.get(n)) break;
      o--;
    } while (o > i);
    if (i > 0) {
      const e = t.charCodeAt(i - 1),
        n = t.charCodeAt(o);
      ((40 === e && 41 === n) || (91 === e && 93 === n) || (123 === e && 125 === n)) && o--;
    }
    return {
      range: { startLineNumber: n, startColumn: i + 1, endLineNumber: n, endColumn: o + 2 },
      url: t.substring(i, o + 1),
    };
  }
  static computeLinks(
    e,
    t = (function () {
      return (
        null === pWe &&
          (pWe = new gWe([
            [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],
          ])),
        pWe
      );
    })(),
  ) {
    const n = (function () {
        if (null === fWe) {
          fWe = new Tz(0);
          const e = " \t<>'\"、。｡､，．：；‘〈「『〔（［｛｢｣｝］）〕』」〉’｀～…|";
          for (let n = 0; n < e.length; n++) fWe.set(e.charCodeAt(n), 1);
          const t = ".,;:";
          for (let n = 0; n < t.length; n++) fWe.set(t.charCodeAt(n), 2);
        }
        return fWe;
      })(),
      i = [];
    for (let r = 1, o = e.getLineCount(); r <= o; r++) {
      const o = e.getLineContent(r),
        s = o.length;
      let a = 0,
        l = 0,
        c = 0,
        d = 1,
        u = !1,
        h = !1,
        g = !1,
        p = !1;
      for (; a < s; ) {
        let e = !1;
        const s = o.charCodeAt(a);
        if (13 === d) {
          let t;
          switch (s) {
            case 40:
              ((u = !0), (t = 0));
              break;
            case 41:
              t = u ? 0 : 1;
              break;
            case 91:
              ((g = !0), (h = !0), (t = 0));
              break;
            case 93:
              ((g = !1), (t = h ? 0 : 1));
              break;
            case 123:
              ((p = !0), (t = 0));
              break;
            case 125:
              t = p ? 0 : 1;
              break;
            case 39:
            case 34:
            case 96:
              t = c === s ? 1 : 39 === c || 34 === c || 96 === c ? 0 : 1;
              break;
            case 42:
              t = 42 === c ? 1 : 0;
              break;
            case 32:
              t = g ? 0 : 1;
              break;
            default:
              t = n.get(s);
          }
          1 === t && (i.push(mWe._createLink(n, o, r, l, a)), (e = !0));
        } else if (12 === d) {
          let t;
          (91 === s ? ((h = !0), (t = 0)) : (t = n.get(s)), 1 === t ? (e = !0) : (d = 13));
        } else ((d = t.nextState(d, s)), 0 === d && (e = !0));
        (e && ((d = 1), (u = !1), (h = !1), (p = !1), (l = a + 1), (c = s)), a++);
      }
      13 === d && i.push(mWe._createLink(n, o, r, l, s));
    }
    return i;
  }
}
class _We {
  constructor() {
    this._defaultValueSet = [
      ["true", "false"],
      ["True", "False"],
      ["Private", "Public", "Friend", "ReadOnly", "Partial", "Protected", "WriteOnly"],
      ["public", "protected", "private"],
    ];
  }
  static {
    this.INSTANCE = new _We();
  }
  navigateValueSet(e, t, n, i, r) {
    if (e && t) {
      const n = this.doNavigateValueSet(t, r);
      if (n) return { range: e, value: n };
    }
    if (n && i) {
      const e = this.doNavigateValueSet(i, r);
      if (e) return { range: n, value: e };
    }
    return null;
  }
  doNavigateValueSet(e, t) {
    const n = this.numberReplace(e, t);
    return null !== n ? n : this.textReplace(e, t);
  }
  numberReplace(e, t) {
    const n = Math.pow(10, e.length - (e.lastIndexOf(".") + 1));
    let i = Number(e);
    const r = parseFloat(e);
    return isNaN(i) || isNaN(r) || i !== r
      ? null
      : 0 !== i || t
        ? ((i = Math.floor(i * n)), (i += t ? n : -n), String(i / n))
        : null;
  }
  textReplace(e, t) {
    return this.valueSetsReplace(this._defaultValueSet, e, t);
  }
  valueSetsReplace(e, t, n) {
    let i = null;
    for (let r = 0, o = e.length; null === i && r < o; r++) i = this.valueSetReplace(e[r], t, n);
    return i;
  }
  valueSetReplace(e, t, n) {
    let i = e.indexOf(t);
    return i >= 0 ? ((i += n ? 1 : -1), i < 0 ? (i = e.length - 1) : (i %= e.length), e[i]) : null;
  }
}
function vWe(e) {
  const t = [];
  for (const n of e) {
    const e = Number(n);
    (e || (0 === e && "" !== n.replace(/\s/g, ""))) && t.push(e);
  }
  return t;
}
function bWe(e, t, n, i) {
  return { red: e / 255, blue: n / 255, green: t / 255, alpha: i };
}
function yWe(e, t) {
  const n = t.index,
    i = t[0].length;
  if (void 0 === n) return;
  const r = e.positionAt(n);
  return {
    startLineNumber: r.lineNumber,
    startColumn: r.column,
    endLineNumber: r.lineNumber,
    endColumn: r.column + i,
  };
}
function xWe(e, t) {
  if (!e) return;
  const n = vG.Format.CSS.parseHex(t);
  return n ? { range: e, color: bWe(n.rgba.r, n.rgba.g, n.rgba.b, n.rgba.a) } : void 0;
}
function wWe(e, t, n) {
  if (!e || 1 !== t.length) return;
  const i = vWe(t[0].values());
  return { range: e, color: bWe(i[0], i[1], i[2], n ? i[3] : 1) };
}
function CWe(e, t, n) {
  if (!e || 1 !== t.length) return;
  const i = vWe(t[0].values()),
    r = new vG(new mG(i[0], i[1] / 100, i[2] / 100, n ? i[3] : 1));
  return { range: e, color: bWe(r.rgba.r, r.rgba.g, r.rgba.b, r.rgba.a) };
}
function SWe(e, t) {
  return "string" == typeof e ? [...e.matchAll(t)] : e.findMatches(t);
}
function kWe(e) {
  return e && "function" == typeof e.getValue && "function" == typeof e.positionAt
    ? (function (e) {
        const t = [],
          n = SWe(
            e,
            /\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 (n.length > 0)
          for (const i of n) {
            const n = i.filter((e) => void 0 !== e),
              r = n[1],
              o = n[2];
            if (!o) continue;
            let s;
            if ("rgb" === r) {
              const t =
                /^\(\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;
              s = wWe(yWe(e, i), SWe(o, t), !1);
            } else if ("rgba" === r) {
              const t =
                /^\(\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;
              s = wWe(yWe(e, i), SWe(o, t), !0);
            } else if ("hsl" === r) {
              const t =
                /^\(\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;
              s = CWe(yWe(e, i), SWe(o, t), !1);
            } else if ("hsla" === r) {
              const t =
                /^\(\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;
              s = CWe(yWe(e, i), SWe(o, t), !0);
            } else "#" === r && (s = xWe(yWe(e, i), r + o));
            s && t.push(s);
          }
        return t;
      })(e)
    : [];
}
const EWe = /^-+|-+$/g,
  NWe = 100;
function LWe(e, t) {
  let n = [];
  if (t.findRegionSectionHeaders && t.foldingRules?.markers) {
    const i = (function (e, t) {
      const n = [],
        i = e.getLineCount();
      for (let r = 1; r <= i; r++) {
        const i = e.getLineContent(r),
          o = i.match(t.foldingRules.markers.start);
        if (o) {
          const e = {
            startLineNumber: r,
            startColumn: o[0].length + 1,
            endLineNumber: r,
            endColumn: i.length + 1,
          };
          if (e.endColumn > e.startColumn) {
            const t = { range: e, ...DWe(i.substring(o[0].length)), shouldBeInComments: !1 };
            (t.text || t.hasSeparatorLine) && n.push(t);
          }
        }
      }
      return n;
    })(e, t);
    n = n.concat(i);
  }
  if (t.findMarkSectionHeaders) {
    const i = (function (e, t) {
      const n = [],
        i = e.getLineCount();
      if (!t.markSectionHeaderRegex || "" === t.markSectionHeaderRegex.trim()) return n;
      const r = _9(t.markSectionHeaderRegex),
        o = new RegExp(t.markSectionHeaderRegex, "gdm" + (r ? "s" : ""));
      if (GM(o)) return n;
      for (let s = 1; s <= i; s += 95) {
        const t = Math.min(s + NWe - 1, i),
          r = [];
        for (let n = s; n <= t; n++) r.push(e.getLineContent(n));
        const a = r.join("\n");
        let l;
        for (o.lastIndex = 0; null !== (l = o.exec(a)); ) {
          const e = a.substring(0, l.index),
            t = s + (e.match(/\n/g) || []).length,
            i = l[0].split("\n"),
            r = i.length,
            c = t + r - 1,
            d = e.lastIndexOf("\n") + 1,
            u = l.index - d + 1,
            h = i[i.length - 1],
            g = {
              range: {
                startLineNumber: t,
                startColumn: u,
                endLineNumber: c,
                endColumn: 1 === r ? u + l[0].length : h.length + 1,
              },
              text: (l.groups ?? {}).label ?? "",
              hasSeparatorLine: "" !== ((l.groups ?? {}).separator ?? ""),
              shouldBeInComments: !0,
            };
          ((g.text || g.hasSeparatorLine) &&
            (0 === n.length || n[n.length - 1].range.endLineNumber < g.range.startLineNumber) &&
            n.push(g),
            (o.lastIndex = l.index + l[0].length));
        }
      }
      return n;
    })(e, t);
    n = n.concat(i);
  }
  return n;
}
function DWe(e) {
  const t = (e = e.trim()).startsWith("-");
  return { text: (e = e.replace(EWe, "")), hasSeparatorLine: t };
}
class TWe {
  constructor(e, t, n, i) {
    ((this._uri = e),
      (this._lines = t),
      (this._eol = n),
      (this._versionId = i),
      (this._lineStarts = null),
      (this._cachedTextValue = null));
  }
  dispose() {
    this._lines.length = 0;
  }
  get version() {
    return this._versionId;
  }
  getText() {
    return (
      null === this._cachedTextValue && (this._cachedTextValue = this._lines.join(this._eol)),
      this._cachedTextValue
    );
  }
  onEvents(e) {
    e.eol && e.eol !== this._eol && ((this._eol = e.eol), (this._lineStarts = null));
    const t = e.changes;
    for (const n of t)
      (this._acceptDeleteRange(n.range),
        this._acceptInsertText(new xV(n.range.startLineNumber, n.range.startColumn), n.text));
    ((this._versionId = e.versionId), (this._cachedTextValue = null));
  }
  _ensureLineStarts() {
    if (!this._lineStarts) {
      const e = this._eol.length,
        t = this._lines.length,
        n = new Uint32Array(t);
      for (let i = 0; i < t; i++) n[i] = this._lines[i].length + e;
      this._lineStarts = new Wte(n);
    }
  }
  _setLineText(e, t) {
    ((this._lines[e] = t),
      this._lineStarts && this._lineStarts.setValue(e, this._lines[e].length + this._eol.length));
  }
  _acceptDeleteRange(e) {
    if (e.startLineNumber !== e.endLineNumber)
      (this._setLineText(
        e.startLineNumber - 1,
        this._lines[e.startLineNumber - 1].substring(0, e.startColumn - 1) +
          this._lines[e.endLineNumber - 1].substring(e.endColumn - 1),
      ),
        this._lines.splice(e.startLineNumber, e.endLineNumber - e.startLineNumber),
        this._lineStarts &&
          this._lineStarts.removeValues(e.startLineNumber, e.endLineNumber - e.startLineNumber));
    else {
      if (e.startColumn === e.endColumn) return;
      this._setLineText(
        e.startLineNumber - 1,
        this._lines[e.startLineNumber - 1].substring(0, e.startColumn - 1) +
          this._lines[e.startLineNumber - 1].substring(e.endColumn - 1),
      );
    }
  }
  _acceptInsertText(e, t) {
    if (0 === t.length) return;
    const n = ZM(t);
    if (1 === n.length)
      return void this._setLineText(
        e.lineNumber - 1,
        this._lines[e.lineNumber - 1].substring(0, e.column - 1) +
          n[0] +
          this._lines[e.lineNumber - 1].substring(e.column - 1),
      );
    ((n[n.length - 1] += this._lines[e.lineNumber - 1].substring(e.column - 1)),
      this._setLineText(
        e.lineNumber - 1,
        this._lines[e.lineNumber - 1].substring(0, e.column - 1) + n[0],
      ));
    const i = new Uint32Array(n.length - 1);
    for (let r = 1; r < n.length; r++)
      (this._lines.splice(e.lineNumber + r - 1, 0, n[r]),
        (i[r - 1] = n[r].length + this._eol.length));
    this._lineStarts && this._lineStarts.insertValues(e.lineNumber, i);
  }
}
class IWe extends PO {
  constructor(e, t, n = !1) {
    if (
      (super(),
      (this._syncedModels = Object.create(null)),
      (this._syncedModelsLastUsedTime = Object.create(null)),
      (this._proxy = e),
      (this._modelService = t),
      !n)
    ) {
      const e = new kM();
      (e.cancelAndSet(() => this._checkStopModelSync(), Math.round(3e4)), this._register(e));
    }
  }
  dispose() {
    for (const e in this._syncedModels) IO(this._syncedModels[e]);
    ((this._syncedModels = Object.create(null)),
      (this._syncedModelsLastUsedTime = Object.create(null)),
      super.dispose());
  }
  ensureSyncedResources(e, t = !1) {
    for (const n of e) {
      const e = n.toString();
      (this._syncedModels[e] || this._beginModelSync(n, t),
        this._syncedModels[e] && (this._syncedModelsLastUsedTime[e] = new Date().getTime()));
    }
  }
  _checkStopModelSync() {
    const e = new Date().getTime(),
      t = [];
    for (const n in this._syncedModelsLastUsedTime) {
      e - this._syncedModelsLastUsedTime[n] > 6e4 && t.push(n);
    }
    for (const n of t) this._stopModelSync(n);
  }
  _beginModelSync(e, t) {
    const n = this._modelService.getModel(e);
    if (!n) return;
    if (!t && n.isTooLargeForSyncing()) return;
    const i = e.toString();
    this._proxy.$acceptNewModel({
      url: n.uri.toString(),
      lines: n.getLinesContent(),
      EOL: n.getEOL(),
      versionId: n.getVersionId(),
    });
    const r = new AO();
    (r.add(
      n.onDidChangeContent((e) => {
        this._proxy.$acceptModelChanged(i.toString(), e);
      }),
    ),
      r.add(
        n.onWillDispose(() => {
          this._stopModelSync(i);
        }),
      ),
      r.add(
        MO(() => {
          this._proxy.$acceptRemovedModel(i);
        }),
      ),
      (this._syncedModels[i] = r));
  }
  _stopModelSync(e) {
    const t = this._syncedModels[e];
    (delete this._syncedModels[e], delete this._syncedModelsLastUsedTime[e], IO(t));
  }
}
class RWe {
  constructor() {
    this._models = Object.create(null);
  }
  getModel(e) {
    return this._models[e];
  }
  getModels() {
    const e = [];
    return (Object.keys(this._models).forEach((t) => e.push(this._models[t])), e);
  }
  $acceptNewModel(e) {
    this._models[e.url] = new OWe(mP.parse(e.url), e.lines, e.EOL, e.versionId);
  }
  $acceptModelChanged(e, t) {
    if (!this._models[e]) return;
    this._models[e].onEvents(t);
  }
  $acceptRemovedModel(e) {
    this._models[e] && delete this._models[e];
  }
}
class OWe extends TWe {
  get uri() {
    return this._uri;
  }
  get eol() {
    return this._eol;
  }
  getValue() {
    return this.getText();
  }
  findMatches(e) {
    const t = [];
    for (let n = 0; n < this._lines.length; n++) {
      const i = this._lines[n],
        r = this.offsetAt(new xV(n + 1, 1)),
        o = i.matchAll(e);
      for (const e of o) ((e.index || 0 === e.index) && (e.index = e.index + r), t.push(e));
    }
    return t;
  }
  getLinesContent() {
    return this._lines.slice(0);
  }
  getLineCount() {
    return this._lines.length;
  }
  getLineContent(e) {
    return this._lines[e - 1];
  }
  getWordAtPosition(e, t) {
    const n = dU(e.column, lU(t), this._lines[e.lineNumber - 1], 0);
    return n ? new YH(e.lineNumber, n.startColumn, e.lineNumber, n.endColumn) : null;
  }
  words(e) {
    const t = this._lines,
      n = this._wordenize.bind(this);
    let i = 0,
      r = "",
      o = 0,
      s = [];
    return {
      *[Symbol.iterator]() {
        for (;;)
          if (o < s.length) {
            const e = r.substring(s[o].start, s[o].end);
            ((o += 1), yield e);
          } else {
            if (!(i < t.length)) break;
            ((r = t[i]), (s = n(r, e)), (o = 0), (i += 1));
          }
      },
    };
  }
  getLineWords(e, t) {
    const n = this._lines[e - 1],
      i = this._wordenize(n, t),
      r = [];
    for (const o of i)
      r.push({ word: n.substring(o.start, o.end), startColumn: o.start + 1, endColumn: o.end + 1 });
    return r;
  }
  _wordenize(e, t) {
    const n = [];
    let i;
    for (t.lastIndex = 0; (i = t.exec(e)) && 0 !== i[0].length; )
      n.push({ start: i.index, end: i.index + i[0].length });
    return n;
  }
  getValueInRange(e) {
    if ((e = this._validateRange(e)).startLineNumber === e.endLineNumber)
      return this._lines[e.startLineNumber - 1].substring(e.startColumn - 1, e.endColumn - 1);
    const t = this._eol,
      n = e.startLineNumber - 1,
      i = e.endLineNumber - 1,
      r = [];
    r.push(this._lines[n].substring(e.startColumn - 1));
    for (let o = n + 1; o < i; o++) r.push(this._lines[o]);
    return (r.push(this._lines[i].substring(0, e.endColumn - 1)), r.join(t));
  }
  offsetAt(e) {
    return (
      (e = this._validatePosition(e)),
      this._ensureLineStarts(),
      this._lineStarts.getPrefixSum(e.lineNumber - 2) + (e.column - 1)
    );
  }
  positionAt(e) {
    ((e = Math.floor(e)), (e = Math.max(0, e)), this._ensureLineStarts());
    const t = this._lineStarts.getIndexOf(e),
      n = this._lines[t.index].length;
    return { lineNumber: 1 + t.index, column: 1 + Math.min(t.remainder, n) };
  }
  _validateRange(e) {
    const t = this._validatePosition({ lineNumber: e.startLineNumber, column: e.startColumn }),
      n = this._validatePosition({ lineNumber: e.endLineNumber, column: e.endColumn });
    return t.lineNumber !== e.startLineNumber ||
      t.column !== e.startColumn ||
      n.lineNumber !== e.endLineNumber ||
      n.column !== e.endColumn
      ? {
          startLineNumber: t.lineNumber,
          startColumn: t.column,
          endLineNumber: n.lineNumber,
          endColumn: n.column,
        }
      : e;
  }
  _validatePosition(e) {
    if (!xV.isIPosition(e)) throw new Error("bad position");
    let { lineNumber: t, column: n } = e,
      i = !1;
    if (t < 1) ((t = 1), (n = 1), (i = !0));
    else if (t > this._lines.length)
      ((t = this._lines.length), (n = this._lines[t - 1].length + 1), (i = !0));
    else {
      const e = this._lines[t - 1].length + 1;
      n < 1 ? ((n = 1), (i = !0)) : n > e && ((n = e), (i = !0));
    }
    return i ? { lineNumber: t, column: n } : e;
  }
}
class MWe {
  constructor(e = null) {
    ((this._foreignModule = e),
      (this._requestHandlerBrand = void 0),
      (this._workerTextModelSyncServer = new RWe()));
  }
  dispose() {}
  async $ping() {
    return "pong";
  }
  _getModel(e) {
    return this._workerTextModelSyncServer.getModel(e);
  }
  getModels() {
    return this._workerTextModelSyncServer.getModels();
  }
  $acceptNewModel(e) {
    this._workerTextModelSyncServer.$acceptNewModel(e);
  }
  $acceptModelChanged(e, t) {
    this._workerTextModelSyncServer.$acceptModelChanged(e, t);
  }
  $acceptRemovedModel(e) {
    this._workerTextModelSyncServer.$acceptRemovedModel(e);
  }
  async $computeUnicodeHighlights(e, t, n) {
    const i = this._getModel(e);
    return i
      ? GPe.computeUnicodeHighlights(i, t, n)
      : {
          ranges: [],
          hasMore: !1,
          ambiguousCharacterCount: 0,
          invisibleCharacterCount: 0,
          nonBasicAsciiCharacterCount: 0,
        };
  }
  async $findSectionHeaders(e, t) {
    const n = this._getModel(e);
    return n ? LWe(n, t) : [];
  }
  async $computeDiff(e, t, n, i) {
    const r = this._getModel(e),
      o = this._getModel(t);
    if (!r || !o) return null;
    return MWe.computeDiff(r, o, n, i);
  }
  static computeDiff(e, t, n, i) {
    const r = "advanced" === i ? uTe() : dTe(),
      o = e.getLinesContent(),
      s = t.getLinesContent(),
      a = r.computeDiff(o, s, n);
    function l(e) {
      return e.map((e) => [
        e.original.startLineNumber,
        e.original.endLineNumberExclusive,
        e.modified.startLineNumber,
        e.modified.endLineNumberExclusive,
        e.innerChanges?.map((e) => [
          e.originalRange.startLineNumber,
          e.originalRange.startColumn,
          e.originalRange.endLineNumber,
          e.originalRange.endColumn,
          e.modifiedRange.startLineNumber,
          e.modifiedRange.startColumn,
          e.modifiedRange.endLineNumber,
          e.modifiedRange.endColumn,
        ]),
      ]);
    }
    return {
      identical: !(a.changes.length > 0) && this._modelsAreIdentical(e, t),
      quitEarly: a.hitTimeout,
      changes: l(a.changes),
      moves: a.moves.map((e) => [
        e.lineRangeMapping.original.startLineNumber,
        e.lineRangeMapping.original.endLineNumberExclusive,
        e.lineRangeMapping.modified.startLineNumber,
        e.lineRangeMapping.modified.endLineNumberExclusive,
        l(e.changes),
      ]),
    };
  }
  static _modelsAreIdentical(e, t) {
    const n = e.getLineCount();
    if (n !== t.getLineCount()) return !1;
    for (let i = 1; i <= n; i++) {
      if (e.getLineContent(i) !== t.getLineContent(i)) return !1;
    }
    return !0;
  }
  static {
    this._diffLimit = 1e5;
  }
  async $computeMoreMinimalEdits(e, t, n) {
    const i = this._getModel(e);
    if (!i) return t;
    const r = [];
    let o;
    t = t.slice(0).sort((e, t) => {
      if (e.range && t.range) return YH.compareRangesUsingStarts(e.range, t.range);
      return (e.range ? 0 : 1) - (t.range ? 0 : 1);
    });
    let s = 0;
    for (let a = 1; a < t.length; a++)
      YH.getEndPosition(t[s].range).equals(YH.getStartPosition(t[a].range))
        ? ((t[s].range = YH.fromPositions(
            YH.getStartPosition(t[s].range),
            YH.getEndPosition(t[a].range),
          )),
          (t[s].text += t[a].text))
        : (s++, (t[s] = t[a]));
    t.length = s + 1;
    for (let { range: a, text: l, eol: c } of t) {
      if (("number" == typeof c && (o = c), YH.isEmpty(a) && !l)) continue;
      const e = i.getValueInRange(a);
      if (((l = l.replace(/\r\n|\n|\r/g, i.eol)), e === l)) continue;
      if (Math.max(l.length, e.length) > MWe._diffLimit) {
        r.push({ range: a, text: l });
        continue;
      }
      const t = mxe(e, l, n),
        s = i.offsetAt(YH.lift(a).getStartPosition());
      for (const n of t) {
        const e = i.positionAt(s + n.originalStart),
          t = i.positionAt(s + n.originalStart + n.originalLength),
          o = {
            text: l.substr(n.modifiedStart, n.modifiedLength),
            range: {
              startLineNumber: e.lineNumber,
              startColumn: e.column,
              endLineNumber: t.lineNumber,
              endColumn: t.column,
            },
          };
        i.getValueInRange(o.range) !== o.text && r.push(o);
      }
    }
    return (
      "number" == typeof o &&
        r.push({
          eol: o,
          text: "",
          range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 },
        }),
      r
    );
  }
  async $computeLinks(e) {
    const t = this._getModel(e);
    return t
      ? (function (e) {
          return e && "function" == typeof e.getLineCount && "function" == typeof e.getLineContent
            ? mWe.computeLinks(e)
            : [];
        })(t)
      : null;
  }
  async $computeDefaultDocumentColors(e) {
    const t = this._getModel(e);
    return t ? kWe(t) : null;
  }
  static {
    this._suggestionsLimit = 1e4;
  }
  async $textualSuggest(e, t, n, i) {
    const r = new UO(),
      o = new RegExp(n, i),
      s = new Set();
    e: for (const a of e) {
      const e = this._getModel(a);
      if (e)
        for (const n of e.words(o))
          if (n !== t && isNaN(Number(n)) && (s.add(n), s.size > MWe._suggestionsLimit)) break e;
    }
    return { words: Array.from(s), duration: r.elapsed() };
  }
  async $computeWordRanges(e, t, n, i) {
    const r = this._getModel(e);
    if (!r) return Object.create(null);
    const o = new RegExp(n, i),
      s = Object.create(null);
    for (let a = t.startLineNumber; a < t.endLineNumber; a++) {
      const e = r.getLineWords(a, o);
      for (const t of e) {
        if (!isNaN(Number(t.word))) continue;
        let e = s[t.word];
        (e || ((e = []), (s[t.word] = e)),
          e.push({
            startLineNumber: a,
            startColumn: t.startColumn,
            endLineNumber: a,
            endColumn: t.endColumn,
          }));
      }
    }
    return s;
  }
  async $navigateValueSet(e, t, n, i, r) {
    const o = this._getModel(e);
    if (!o) return null;
    const s = new RegExp(i, r);
    t.startColumn === t.endColumn &&
      (t = {
        startLineNumber: t.startLineNumber,
        startColumn: t.startColumn,
        endLineNumber: t.endLineNumber,
        endColumn: t.endColumn + 1,
      });
    const a = o.getValueInRange(t),
      l = o.getWordAtPosition({ lineNumber: t.startLineNumber, column: t.startColumn }, s);
    if (!l) return null;
    const c = o.getValueInRange(l);
    return _We.INSTANCE.navigateValueSet(t, a, l, c, n);
  }
  $fmr(e, t) {
    if (!this._foreignModule || "function" != typeof this._foreignModule[e])
      return Promise.reject(new Error("Missing requestHandler or method: " + e));
    try {
      return Promise.resolve(this._foreignModule[e].apply(this._foreignModule, t));
    } catch (spt) {
      return Promise.reject(spt);
    }
  }
}
"function" == typeof importScripts && (globalThis.monaco = ZVe());
class AWe {
  static {
    this.CHANNEL_NAME = "editorWorkerHost";
  }
  static getChannel(e) {
    return e.getChannel(AWe.CHANNEL_NAME);
  }
  static setChannel(e, t) {
    e.setChannel(AWe.CHANNEL_NAME, t);
  }
}
var PWe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  jWe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const FWe = 3e5;
function BWe(e, t) {
  const n = e.getModel(t);
  return !!n && !n.isTooLargeForSyncing();
}
let VWe = class extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._languageConfigurationService = r),
      (this._modelService = t),
      (this._workerManager = this._register(new HWe(e, this._modelService))),
      (this._logService = i),
      this._register(
        o.linkProvider.register(
          { language: "*", hasAccessToAllModels: !0 },
          {
            provideLinks: async (e, t) => {
              if (!BWe(this._modelService, e.uri)) return Promise.resolve({ links: [] });
              const n = await this._workerWithResources([e.uri]),
                i = await n.$computeLinks(e.uri.toString());
              return i && { links: i };
            },
          },
        ),
      ),
      this._register(
        o.completionProvider.register(
          "*",
          new WWe(
            this._workerManager,
            n,
            this._modelService,
            this._languageConfigurationService,
            this._logService,
          ),
        ),
      ));
  }
  dispose() {
    super.dispose();
  }
  canComputeUnicodeHighlights(e) {
    return BWe(this._modelService, e);
  }
  async computedUnicodeHighlights(e, t, n) {
    return (await this._workerWithResources([e])).$computeUnicodeHighlights(e.toString(), t, n);
  }
  async computeDiff(e, t, n, i) {
    const r = await this._workerWithResources([e, t], !0),
      o = await r.$computeDiff(e.toString(), t.toString(), n, i);
    if (!o) return null;
    const s = {
      identical: o.identical,
      quitEarly: o.quitEarly,
      changes: a(o.changes),
      moves: o.moves.map((e) => new ODe(new Fle(new Q5(e[0], e[1]), new Q5(e[2], e[3])), a(e[4]))),
    };
    return s;
    function a(e) {
      return e.map(
        (e) =>
          new Wle(
            new Q5(e[0], e[1]),
            new Q5(e[2], e[3]),
            e[4]?.map(
              (e) => new Hle(new YH(e[0], e[1], e[2], e[3]), new YH(e[4], e[5], e[6], e[7])),
            ),
          ),
      );
    }
  }
  async computeMoreMinimalEdits(e, t, n = !1) {
    if (aj(t)) {
      if (!BWe(this._modelService, e)) return Promise.resolve(t);
      const i = UO.create(),
        r = this._workerWithResources([e]).then((i) =>
          i.$computeMoreMinimalEdits(e.toString(), t, n),
        );
      return (
        r.finally(() =>
          this._logService.trace("FORMAT#computeMoreMinimalEdits", e.toString(!0), i.elapsed()),
        ),
        Promise.race([r, vM(1e3).then(() => t)])
      );
    }
    return Promise.resolve(void 0);
  }
  canNavigateValueSet(e) {
    return BWe(this._modelService, e);
  }
  async navigateValueSet(e, t, n) {
    const i = this._modelService.getModel(e);
    if (!i) return null;
    const r = this._languageConfigurationService
        .getLanguageConfiguration(i.getLanguageId())
        .getWordDefinition(),
      o = r.source,
      s = r.flags;
    return (await this._workerWithResources([e])).$navigateValueSet(e.toString(), t, n, o, s);
  }
  canComputeWordRanges(e) {
    return BWe(this._modelService, e);
  }
  async computeWordRanges(e, t) {
    const n = this._modelService.getModel(e);
    if (!n) return Promise.resolve(null);
    const i = this._languageConfigurationService
        .getLanguageConfiguration(n.getLanguageId())
        .getWordDefinition(),
      r = i.source,
      o = i.flags;
    return (await this._workerWithResources([e])).$computeWordRanges(e.toString(), t, r, o);
  }
  async findSectionHeaders(e, t) {
    return (await this._workerWithResources([e])).$findSectionHeaders(e.toString(), t);
  }
  async computeDefaultDocumentColors(e) {
    return (await this._workerWithResources([e])).$computeDefaultDocumentColors(e.toString());
  }
  async _workerWithResources(e, t = !1) {
    const n = await this._workerManager.withWorker();
    return await n.workerWithSyncedResources(e, t);
  }
};
VWe = PWe([jWe(1, wV), jWe(2, UAe), jWe(3, yH), jWe(4, f$), jWe(5, mee)], VWe);
class WWe {
  constructor(e, t, n, i, r) {
    ((this.languageConfigurationService = i),
      (this.logService = r),
      (this._debugDisplayName = "wordbasedCompletions"),
      (this._workerManager = e),
      (this._configurationService = t),
      (this._modelService = n));
  }
  async provideCompletionItems(e, t) {
    const n = this._configurationService.getValue(e.uri, t, "editor");
    if ("off" === n.wordBasedSuggestions) return;
    const i = [];
    if ("currentDocument" === n.wordBasedSuggestions)
      BWe(this._modelService, e.uri) && i.push(e.uri);
    else
      for (const d of this._modelService.getModels())
        BWe(this._modelService, d.uri) &&
          (d === e
            ? i.unshift(d.uri)
            : ("allDocuments" !== n.wordBasedSuggestions &&
                d.getLanguageId() !== e.getLanguageId()) ||
              i.push(d.uri));
    if (0 === i.length) return;
    const r = this.languageConfigurationService
        .getLanguageConfiguration(e.getLanguageId())
        .getWordDefinition(),
      o = e.getWordAtPosition(t),
      s = o ? new YH(t.lineNumber, o.startColumn, t.lineNumber, o.endColumn) : YH.fromPositions(t),
      a = s.setEndPosition(t.lineNumber, t.column);
    this.logService.trace(
      "[WordBasedCompletionItemProvider]",
      `word: "${o?.word || ""}", wordDef: "${r}", replace: [${s.toString()}], insert: [${a.toString()}]`,
    );
    const l = await this._workerManager.withWorker(),
      c = await l.textualSuggest(i, o?.word, r);
    return c
      ? {
          duration: c.duration,
          suggestions: c.words.map((e) => ({
            kind: 18,
            label: e,
            insertText: e,
            range: { insert: a, replace: s },
          })),
        }
      : void 0;
  }
}
let HWe = class extends PO {
  constructor(e, t) {
    (super(),
      (this._workerDescriptor = e),
      (this._modelService = t),
      (this._editorWorkerClient = null),
      (this._lastWorkerUsedTime = new Date().getTime()));
    (this._register(new eB()).cancelAndSet(() => this._checkStopIdleWorker(), Math.round(15e4), NI),
      this._register(this._modelService.onModelRemoved((e) => this._checkStopEmptyWorker())));
  }
  dispose() {
    (this._editorWorkerClient &&
      (this._editorWorkerClient.dispose(), (this._editorWorkerClient = null)),
      super.dispose());
  }
  _checkStopEmptyWorker() {
    if (!this._editorWorkerClient) return;
    0 === this._modelService.getModels().length &&
      (this._editorWorkerClient.dispose(), (this._editorWorkerClient = null));
  }
  _checkStopIdleWorker() {
    if (!this._editorWorkerClient) return;
    new Date().getTime() - this._lastWorkerUsedTime > FWe &&
      (this._editorWorkerClient.dispose(), (this._editorWorkerClient = null));
  }
  withWorker() {
    return (
      (this._lastWorkerUsedTime = new Date().getTime()),
      this._editorWorkerClient ||
        (this._editorWorkerClient = new UWe(this._workerDescriptor, !1, this._modelService)),
      Promise.resolve(this._editorWorkerClient)
    );
  }
};
HWe = PWe([jWe(1, wV)], HWe);
class zWe {
  constructor(e) {
    ((this._instance = e), (this.proxy = this._instance));
  }
  dispose() {
    this._instance.dispose();
  }
  setChannel(e, t) {
    throw new Error("Not supported");
  }
}
let UWe = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this._workerDescriptorOrWorker = e),
      (this._disposed = !1),
      (this._modelService = n),
      (this._keepIdleModels = t),
      (this._worker = null),
      (this._modelManager = null));
  }
  fhr(e, t) {
    throw new Error("Not implemented!");
  }
  _getOrCreateWorker() {
    if (!this._worker)
      try {
        ((this._worker = this._register(
          (function (e, t) {
            const n = mP.isUri(e) ? new uWe(e, t) : e;
            return new sWe(new dWe(n));
          })(this._workerDescriptorOrWorker),
        )),
          AWe.setChannel(this._worker, this._createEditorWorkerHost()));
      } catch (e) {
        (JVe(), (this._worker = this._createFallbackLocalWorker()));
      }
    return this._worker;
  }
  async _getProxy() {
    try {
      const e = this._getOrCreateWorker().proxy;
      return (await e.$ping(), e);
    } catch (e) {
      return (JVe(), (this._worker = this._createFallbackLocalWorker()), this._worker.proxy);
    }
  }
  _createFallbackLocalWorker() {
    return new zWe(new MWe(null));
  }
  _createEditorWorkerHost() {
    return { $fhr: (e, t) => this.fhr(e, t) };
  }
  _getOrCreateModelManager(e) {
    return (
      this._modelManager ||
        (this._modelManager = this._register(new IWe(e, this._modelService, this._keepIdleModels))),
      this._modelManager
    );
  }
  async workerWithSyncedResources(e, t = !1) {
    if (this._disposed)
      return Promise.reject(
        (function () {
          const e = new Error($I);
          return ((e.name = e.message), e);
        })(),
      );
    const n = await this._getProxy();
    return (this._getOrCreateModelManager(n).ensureSyncedResources(e, t), n);
  }
  async textualSuggest(e, t, n) {
    const i = await this.workerWithSyncedResources(e),
      r = n.source,
      o = n.flags;
    return i.$textualSuggest(
      e.map((e) => e.toString()),
      t,
      r,
      o,
    );
  }
  dispose() {
    (super.dispose(), (this._disposed = !0));
  }
};
UWe = PWe([jWe(2, wV)], UWe);
class $We extends UWe {
  constructor(e, t) {
    (super(t.worker, t.keepIdleModels || !1, e),
      (this._foreignModuleHost = t.host || null),
      (this._foreignProxy = this._getProxy().then(
        (e) =>
          new Proxy(
            {},
            {
              get(t, n, i) {
                if ("then" !== n) {
                  if ("string" != typeof n) throw new Error("Not supported");
                  return (...t) => e.$fmr(n, t);
                }
              },
            },
          ),
      )));
  }
  fhr(e, t) {
    if (!this._foreignModuleHost || "function" != typeof this._foreignModuleHost[e])
      return Promise.reject(
        new Error("Missing method " + e + " or missing main thread foreign host."),
      );
    try {
      return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost, t));
    } catch (spt) {
      return Promise.reject(spt);
    }
  }
  getProxy() {
    return this._foreignProxy;
  }
  withSyncedResources(e) {
    return this.workerWithSyncedResources(e).then((e) => this.getProxy());
  }
}
function qWe(e) {
  return !(function (e) {
    return Array.isArray(e);
  })(e);
}
function KWe(e) {
  return "string" == typeof e;
}
function GWe(e) {
  return !KWe(e);
}
function ZWe(e) {
  return !e;
}
function YWe(e, t) {
  return e.ignoreCase && t ? t.toLowerCase() : t;
}
function XWe(e) {
  return e.replace(/[&<>'"_]/g, "-");
}
function QWe(e, t) {}
function JWe(e, t) {
  return new Error(`${e.languageId}: ${t}`);
}
function eHe(e, t, n, i, r) {
  let o = null;
  return t.replace(
    /\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,
    function (t, s, a, l, c, d, u, h, g) {
      return ZWe(a)
        ? ZWe(l)
          ? !ZWe(c) && c < i.length
            ? YWe(e, i[c])
            : !ZWe(u) && e && "string" == typeof e[u]
              ? e[u]
              : (null === o && ((o = r.split(".")), o.unshift(r)),
                !ZWe(d) && d < o.length ? YWe(e, o[d]) : "")
          : YWe(e, n)
        : "$";
    },
  );
}
function tHe(e, t) {
  let n = t;
  for (; n && n.length > 0; ) {
    const t = e.tokenizer[n];
    if (t) return t;
    const i = n.lastIndexOf(".");
    n = i < 0 ? null : n.substr(0, i);
  }
  return null;
}
var nHe;
class iHe {
  static {
    this._INSTANCE = new iHe(5);
  }
  static create(e, t) {
    return this._INSTANCE.create(e, t);
  }
  constructor(e) {
    ((this._maxCacheDepth = e), (this._entries = Object.create(null)));
  }
  create(e, t) {
    if (null !== e && e.depth >= this._maxCacheDepth) return new rHe(e, t);
    let n = rHe.getStackElementId(e);
    (n.length > 0 && (n += "|"), (n += t));
    let i = this._entries[n];
    return i || ((i = new rHe(e, t)), (this._entries[n] = i), i);
  }
}
class rHe {
  constructor(e, t) {
    ((this.parent = e), (this.state = t), (this.depth = (this.parent ? this.parent.depth : 0) + 1));
  }
  static getStackElementId(e) {
    let t = "";
    for (; null !== e; ) (t.length > 0 && (t += "|"), (t += e.state), (e = e.parent));
    return t;
  }
  static _equals(e, t) {
    for (; null !== e && null !== t; ) {
      if (e === t) return !0;
      if (e.state !== t.state) return !1;
      ((e = e.parent), (t = t.parent));
    }
    return null === e && null === t;
  }
  equals(e) {
    return rHe._equals(this, e);
  }
  push(e) {
    return iHe.create(this, e);
  }
  pop() {
    return this.parent;
  }
  popall() {
    let e = this;
    for (; e.parent; ) e = e.parent;
    return e;
  }
  switchTo(e) {
    return iHe.create(this.parent, e);
  }
}
class oHe {
  constructor(e, t) {
    ((this.languageId = e), (this.state = t));
  }
  equals(e) {
    return this.languageId === e.languageId && this.state.equals(e.state);
  }
  clone() {
    return this.state.clone() === this.state ? this : new oHe(this.languageId, this.state);
  }
}
class sHe {
  static {
    this._INSTANCE = new sHe(5);
  }
  static create(e, t) {
    return this._INSTANCE.create(e, t);
  }
  constructor(e) {
    ((this._maxCacheDepth = e), (this._entries = Object.create(null)));
  }
  create(e, t) {
    if (null !== t) return new aHe(e, t);
    if (null !== e && e.depth >= this._maxCacheDepth) return new aHe(e, t);
    const n = rHe.getStackElementId(e);
    let i = this._entries[n];
    return i || ((i = new aHe(e, null)), (this._entries[n] = i), i);
  }
}
class aHe {
  constructor(e, t) {
    ((this.stack = e), (this.embeddedLanguageData = t));
  }
  clone() {
    return (this.embeddedLanguageData ? this.embeddedLanguageData.clone() : null) ===
      this.embeddedLanguageData
      ? this
      : sHe.create(this.stack, this.embeddedLanguageData);
  }
  equals(e) {
    return (
      e instanceof aHe &&
      !!this.stack.equals(e.stack) &&
      ((null === this.embeddedLanguageData && null === e.embeddedLanguageData) ||
        (null !== this.embeddedLanguageData &&
          null !== e.embeddedLanguageData &&
          this.embeddedLanguageData.equals(e.embeddedLanguageData)))
    );
  }
}
class lHe {
  constructor() {
    ((this._tokens = []),
      (this._languageId = null),
      (this._lastTokenType = null),
      (this._lastTokenLanguage = null));
  }
  enterLanguage(e) {
    this._languageId = e;
  }
  emit(e, t) {
    (this._lastTokenType === t && this._lastTokenLanguage === this._languageId) ||
      ((this._lastTokenType = t),
      (this._lastTokenLanguage = this._languageId),
      this._tokens.push(new c2(e, t, this._languageId)));
  }
  nestedLanguageTokenize(e, t, n, i) {
    const r = n.languageId,
      o = n.state,
      s = I2.get(r);
    if (!s) return (this.enterLanguage(r), this.emit(i, ""), o);
    const a = s.tokenize(e, t, o);
    if (0 !== i)
      for (const l of a.tokens) this._tokens.push(new c2(l.offset + i, l.type, l.language));
    else this._tokens = this._tokens.concat(a.tokens);
    return (
      (this._lastTokenType = null),
      (this._lastTokenLanguage = null),
      (this._languageId = null),
      a.endState
    );
  }
  finalize(e) {
    return new d2(this._tokens, e);
  }
}
class cHe {
  constructor(e, t) {
    ((this._languageService = e),
      (this._theme = t),
      (this._prependTokens = null),
      (this._tokens = []),
      (this._currentLanguageId = 0),
      (this._lastTokenMetadata = 0));
  }
  enterLanguage(e) {
    this._currentLanguageId = this._languageService.languageIdCodec.encodeLanguageId(e);
  }
  emit(e, t) {
    const n = 1024 | this._theme.match(this._currentLanguageId, t);
    this._lastTokenMetadata !== n &&
      ((this._lastTokenMetadata = n), this._tokens.push(e), this._tokens.push(n));
  }
  static _merge(e, t, n) {
    const i = null !== e ? e.length : 0,
      r = t.length,
      o = null !== n ? n.length : 0;
    if (0 === i && 0 === r && 0 === o) return new Uint32Array(0);
    if (0 === i && 0 === r) return n;
    if (0 === r && 0 === o) return e;
    const s = new Uint32Array(i + r + o);
    null !== e && s.set(e);
    for (let a = 0; a < r; a++) s[i + a] = t[a];
    return (null !== n && s.set(n, i + r), s);
  }
  nestedLanguageTokenize(e, t, n, i) {
    const r = n.languageId,
      o = n.state,
      s = I2.get(r);
    if (!s) return (this.enterLanguage(r), this.emit(i, ""), o);
    const a = s.tokenizeEncoded(e, t, o);
    if (0 !== i) for (let l = 0, c = a.tokens.length; l < c; l += 2) a.tokens[l] += i;
    return (
      (this._prependTokens = cHe._merge(this._prependTokens, this._tokens, a.tokens)),
      (this._tokens = []),
      (this._currentLanguageId = 0),
      (this._lastTokenMetadata = 0),
      a.endState
    );
  }
  finalize(e) {
    return new u2(cHe._merge(this._prependTokens, this._tokens, null), e);
  }
}
let dHe = (nHe = class extends PO {
  constructor(e, t, n, i, r) {
    (super(),
      (this._configurationService = r),
      (this._languageService = e),
      (this._standaloneThemeService = t),
      (this._languageId = n),
      (this._lexer = i),
      (this._embeddedLanguages = Object.create(null)),
      (this.embeddedLoaded = Promise.resolve(void 0)));
    let o = !1;
    (this._register(
      I2.onDidChange((e) => {
        if (o) return;
        let t = !1;
        for (let n = 0, i = e.changedLanguages.length; n < i; n++) {
          const i = e.changedLanguages[n];
          if (this._embeddedLanguages[i]) {
            t = !0;
            break;
          }
        }
        t && ((o = !0), I2.handleChange([this._languageId]), (o = !1));
      }),
    ),
      (this._maxTokenizationLineLength = this._configurationService.getValue(
        "editor.maxTokenizationLineLength",
        { overrideIdentifier: this._languageId },
      )),
      this._register(
        this._configurationService.onDidChangeConfiguration((e) => {
          e.affectsConfiguration("editor.maxTokenizationLineLength") &&
            (this._maxTokenizationLineLength = this._configurationService.getValue(
              "editor.maxTokenizationLineLength",
              { overrideIdentifier: this._languageId },
            ));
        }),
      ));
  }
  getLoadStatus() {
    const e = [];
    for (const t in this._embeddedLanguages) {
      const n = I2.get(t);
      if (n) {
        if (n instanceof nHe) {
          const t = n.getLoadStatus();
          !1 === t.loaded && e.push(t.promise);
        }
      } else I2.isResolved(t) || e.push(I2.getOrCreate(t));
    }
    return 0 === e.length
      ? { loaded: !0 }
      : { loaded: !1, promise: Promise.all(e).then((e) => {}) };
  }
  getInitialState() {
    const e = iHe.create(null, this._lexer.start);
    return sHe.create(e, null);
  }
  tokenize(e, t, n) {
    if (e.length >= this._maxTokenizationLineLength) return e7(this._languageId, n);
    const i = new lHe(),
      r = this._tokenize(e, t, n, i);
    return i.finalize(r);
  }
  tokenizeEncoded(e, t, n) {
    if (e.length >= this._maxTokenizationLineLength)
      return t7(this._languageService.languageIdCodec.encodeLanguageId(this._languageId), n);
    const i = new cHe(
        this._languageService,
        this._standaloneThemeService.getColorTheme().tokenTheme,
      ),
      r = this._tokenize(e, t, n, i);
    return i.finalize(r);
  }
  _tokenize(e, t, n, i) {
    return n.embeddedLanguageData
      ? this._nestedTokenize(e, t, n, 0, i)
      : this._myTokenize(e, t, n, 0, i);
  }
  _findLeavingNestedLanguageOffset(e, t) {
    let n = this._lexer.tokenizer[t.stack.state];
    if (!n && ((n = tHe(this._lexer, t.stack.state)), !n))
      throw JWe(this._lexer, "tokenizer state is not defined: " + t.stack.state);
    let i = -1,
      r = !1;
    for (const o of n) {
      if (!GWe(o.action) || ("@pop" !== o.action.nextEmbedded && !o.action.hasEmbeddedEndInCases))
        continue;
      r = !0;
      let n = o.resolveRegex(t.stack.state);
      const s = n.source;
      if ("^(?:" === s.substr(0, 4) && ")" === s.substr(s.length - 1, 1)) {
        const e = (n.ignoreCase ? "i" : "") + (n.unicode ? "u" : "");
        n = new RegExp(s.substr(4, s.length - 5), e);
      }
      const a = e.search(n);
      -1 === a || (0 !== a && o.matchOnlyAtLineStart) || ((-1 === i || a < i) && (i = a));
    }
    if (!r)
      throw JWe(
        this._lexer,
        'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: ' + t.stack.state,
      );
    return i;
  }
  _nestedTokenize(e, t, n, i, r) {
    const o = this._findLeavingNestedLanguageOffset(e, n);
    if (-1 === o) {
      const o = r.nestedLanguageTokenize(e, t, n.embeddedLanguageData, i);
      return sHe.create(n.stack, new oHe(n.embeddedLanguageData.languageId, o));
    }
    const s = e.substring(0, o);
    s.length > 0 && r.nestedLanguageTokenize(s, !1, n.embeddedLanguageData, i);
    const a = e.substring(o);
    return this._myTokenize(a, t, n, i + o, r);
  }
  _safeRuleName(e) {
    return e ? e.name : "(unknown)";
  }
  _myTokenize(e, t, n, i, r) {
    r.enterLanguage(this._languageId);
    const o = e.length,
      s = t && this._lexer.includeLF ? e + "\n" : e,
      a = s.length;
    let l = n.embeddedLanguageData,
      c = n.stack,
      d = 0,
      u = null,
      h = !0;
    for (; h || d < a; ) {
      const n = d,
        g = c.depth,
        p = u ? u.groups.length : 0,
        f = c.state;
      let m = null,
        _ = null,
        v = null,
        b = null,
        y = null;
      if (u) {
        m = u.matches;
        const e = u.groups.shift();
        ((_ = e.matched), (v = e.action), (b = u.rule), 0 === u.groups.length && (u = null));
      } else {
        if (!h && d >= a) break;
        h = !1;
        let e = this._lexer.tokenizer[f];
        if (!e && ((e = tHe(this._lexer, f)), !e))
          throw JWe(this._lexer, "tokenizer state is not defined: " + f);
        const t = s.substr(d);
        for (const n of e)
          if ((0 === d || !n.matchOnlyAtLineStart) && ((m = t.match(n.resolveRegex(f))), m)) {
            ((_ = m[0]), (v = n.action));
            break;
          }
      }
      if (
        (m || ((m = [""]), (_ = "")),
        v || (d < a && ((m = [s.charAt(d)]), (_ = m[0])), (v = this._lexer.defaultToken)),
        null === _)
      )
        break;
      for (d += _.length; qWe(v) && GWe(v) && v.test; ) v = v.test(_, m, f, d === a);
      let x = null;
      if ("string" == typeof v || Array.isArray(v)) x = v;
      else if (v.group) x = v.group;
      else if (null !== v.token && void 0 !== v.token) {
        if (((x = v.tokenSubst ? eHe(this._lexer, v.token, _, m, f) : v.token), v.nextEmbedded))
          if ("@pop" === v.nextEmbedded) {
            if (!l) throw JWe(this._lexer, "cannot pop embedded language if not inside one");
            l = null;
          } else {
            if (l)
              throw JWe(
                this._lexer,
                "cannot enter embedded language from within an embedded language",
              );
            y = eHe(this._lexer, v.nextEmbedded, _, m, f);
          }
        if (
          (v.goBack && (d = Math.max(0, d - v.goBack)), v.switchTo && "string" == typeof v.switchTo)
        ) {
          let e = eHe(this._lexer, v.switchTo, _, m, f);
          if (("@" === e[0] && (e = e.substr(1)), !tHe(this._lexer, e)))
            throw JWe(
              this._lexer,
              "trying to switch to a state '" +
                e +
                "' that is undefined in rule: " +
                this._safeRuleName(b),
            );
          c = c.switchTo(e);
        } else {
          if (v.transform && "function" == typeof v.transform)
            throw JWe(this._lexer, "action.transform not supported");
          if (v.next)
            if ("@push" === v.next) {
              if (c.depth >= this._lexer.maxStack)
                throw JWe(
                  this._lexer,
                  "maximum tokenizer stack size reached: [" +
                    c.state +
                    "," +
                    c.parent.state +
                    ",...]",
                );
              c = c.push(f);
            } else if ("@pop" === v.next) {
              if (c.depth <= 1)
                throw JWe(
                  this._lexer,
                  "trying to pop an empty stack in rule: " + this._safeRuleName(b),
                );
              c = c.pop();
            } else if ("@popall" === v.next) c = c.popall();
            else {
              let e = eHe(this._lexer, v.next, _, m, f);
              if (("@" === e[0] && (e = e.substr(1)), !tHe(this._lexer, e)))
                throw JWe(
                  this._lexer,
                  "trying to set a next state '" +
                    e +
                    "' that is undefined in rule: " +
                    this._safeRuleName(b),
                );
              c = c.push(e);
            }
        }
        v.log &&
          "string" == typeof v.log &&
          QWe(this._lexer, (this._lexer.languageId, eHe(this._lexer, v.log, _, m, f)));
      }
      if (null === x)
        throw JWe(
          this._lexer,
          "lexer rule has no well-defined action in rule: " + this._safeRuleName(b),
        );
      const w = (n) => {
        const o =
            this._languageService.getLanguageIdByLanguageName(n) ||
            this._languageService.getLanguageIdByMimeType(n) ||
            n,
          s = this._getNestedEmbeddedLanguageData(o);
        if (d < a) {
          const n = e.substr(d);
          return this._nestedTokenize(n, t, sHe.create(c, s), i + d, r);
        }
        return sHe.create(c, s);
      };
      if (Array.isArray(x)) {
        if (u && u.groups.length > 0)
          throw JWe(this._lexer, "groups cannot be nested: " + this._safeRuleName(b));
        if (m.length !== x.length + 1)
          throw JWe(
            this._lexer,
            "matched number of groups does not match the number of actions in rule: " +
              this._safeRuleName(b),
          );
        let e = 0;
        for (let t = 1; t < m.length; t++) e += m[t].length;
        if (e !== _.length)
          throw JWe(
            this._lexer,
            "with groups, all characters should be matched in consecutive groups in rule: " +
              this._safeRuleName(b),
          );
        u = { rule: b, matches: m, groups: [] };
        for (let t = 0; t < x.length; t++) u.groups[t] = { action: x[t], matched: m[t + 1] };
        d -= _.length;
        continue;
      }
      {
        if ("@rematch" === x && ((d -= _.length), (_ = ""), (m = null), (x = ""), null !== y))
          return w(y);
        if (0 === _.length) {
          if (0 === a || g !== c.depth || f !== c.state || (u ? u.groups.length : 0) !== p)
            continue;
          throw JWe(this._lexer, "no progress in tokenizer in rule: " + this._safeRuleName(b));
        }
        let e = null;
        if (KWe(x) && 0 === x.indexOf("@brackets")) {
          const t = x.substr(9),
            n = uHe(this._lexer, _);
          if (!n)
            throw JWe(this._lexer, "@brackets token returned but no bracket defined as: " + _);
          e = XWe(n.token + t);
        } else {
          e = XWe("" === x ? "" : x + this._lexer.tokenPostfix);
        }
        n < o && r.emit(n + i, e);
      }
      if (null !== y) return w(y);
    }
    return sHe.create(c, l);
  }
  _getNestedEmbeddedLanguageData(e) {
    if (!this._languageService.isRegisteredLanguageId(e)) return new oHe(e, J9);
    e !== this._languageId &&
      (this._languageService.requestBasicLanguageFeatures(e),
      I2.getOrCreate(e),
      (this._embeddedLanguages[e] = !0));
    const t = I2.get(e);
    return new oHe(e, t ? t.getInitialState() : J9);
  }
});
function uHe(e, t) {
  if (!t) return null;
  t = YWe(e, t);
  const n = e.brackets;
  for (const i of n) {
    if (i.open === t) return { token: i.token, bracketType: 1 };
    if (i.close === t) return { token: i.token, bracketType: -1 };
  }
  return null;
}
dHe = nHe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(4, OU),
  ],
  dHe,
);
const hHe = ZJ("standaloneColorizer", { createHTML: (e) => e });
class gHe {
  static colorizeElement(e, t, n, i) {
    const r = (i = i || {}).theme || "vs",
      o = i.mimeType || n.getAttribute("lang") || n.getAttribute("data-lang");
    if (!o) return Promise.resolve();
    const s = t.getLanguageIdByMimeType(o) || o;
    e.setTheme(r);
    const a = n.firstChild ? n.firstChild.nodeValue : "";
    n.className += " " + r;
    return this.colorize(t, a || "", s, i).then(
      (e) => {
        const t = hHe?.createHTML(e) ?? e;
        n.innerHTML = t;
      },
      (e) => {},
    );
  }
  static async colorize(e, t, n, i) {
    const r = e.languageIdCodec;
    let o = 4;
    (i && "number" == typeof i.tabSize && (o = i.tabSize), LA(t) && (t = t.substr(1)));
    const s = ZM(t);
    if (!e.isRegisteredLanguageId(n)) return pHe(s, o, r);
    const a = await I2.getOrCreate(n);
    return a
      ? (function (e, t, n, i) {
          return new Promise((r, o) => {
            const s = () => {
              const a = (function (e, t, n, i) {
                let r = [],
                  o = n.getInitialState();
                for (let s = 0, a = e.length; s < a; s++) {
                  const a = e[s],
                    l = n.tokenizeEncoded(a, !0, o);
                  D$.convertToEndOffset(l.tokens, a.length);
                  const c = new D$(l.tokens, a, i),
                    d = r4.isBasicASCII(a, !0),
                    u = r4.containsRTL(a, d, !0),
                    h = SQ(
                      new vQ(
                        !1,
                        !0,
                        a,
                        !1,
                        d,
                        u,
                        0,
                        c.inflate(),
                        [],
                        t,
                        0,
                        0,
                        0,
                        0,
                        -1,
                        "none",
                        !1,
                        !1,
                        null,
                        null,
                        0,
                      ),
                    );
                  ((r = r.concat(h.html)), r.push("<br/>"), (o = l.endState));
                }
                return r.join("");
              })(e, t, n, i);
              if (n instanceof dHe) {
                const e = n.getLoadStatus();
                if (!1 === e.loaded) return void e.promise.then(s, o);
              }
              r(a);
            };
            s();
          });
        })(s, o, a, r)
      : pHe(s, o, r);
  }
  static colorizeLine(e, t, n, i, r = 4) {
    const o = r4.isBasicASCII(e, t),
      s = r4.containsRTL(e, o, n);
    return SQ(
      new vQ(!1, !0, e, !1, o, s, 0, i, [], r, 0, 0, 0, 0, -1, "none", !1, !1, null, null, 0),
    ).html;
  }
  static colorizeModelLine(e, t, n = 4) {
    const i = e.getLineContent(t);
    e.tokenization.forceTokenization(t);
    const r = e.tokenization.getLineTokens(t).inflate();
    return this.colorizeLine(i, e.mightContainNonBasicASCII(), e.mightContainRTL(), r, n);
  }
}
function pHe(e, t, n) {
  let i = [];
  const r = new Uint32Array(2);
  ((r[0] = 0), (r[1] = 33587200));
  for (let o = 0, s = e.length; o < s; o++) {
    const s = e[o];
    r[0] = s.length;
    const a = new D$(r, s, n),
      l = r4.isBasicASCII(s, !0),
      c = r4.containsRTL(s, l, !0),
      d = SQ(
        new vQ(!1, !0, s, !1, l, c, 0, a, [], t, 0, 0, 0, 0, -1, "none", !1, !1, null, null, 0),
      );
    ((i = i.concat(d.html)), i.push("<br/>"));
  }
  return i.join("");
}
let fHe = class extends PO {
  constructor(e) {
    (super(),
      (this._themeService = e),
      (this._onWillCreateCodeEditor = this._register(new QO())),
      (this._onCodeEditorAdd = this._register(new QO())),
      (this.onCodeEditorAdd = this._onCodeEditorAdd.event),
      (this._onCodeEditorRemove = this._register(new QO())),
      (this.onCodeEditorRemove = this._onCodeEditorRemove.event),
      (this._onWillCreateDiffEditor = this._register(new QO())),
      (this._onDiffEditorAdd = this._register(new QO())),
      (this.onDiffEditorAdd = this._onDiffEditorAdd.event),
      (this._onDiffEditorRemove = this._register(new QO())),
      (this.onDiffEditorRemove = this._onDiffEditorRemove.event),
      (this._decorationOptionProviders = new Map()),
      (this._codeEditorOpenHandlers = new HO()),
      (this._modelProperties = new Map()),
      (this._codeEditors = Object.create(null)),
      (this._diffEditors = Object.create(null)),
      (this._globalStyleSheet = null));
  }
  willCreateCodeEditor() {
    this._onWillCreateCodeEditor.fire();
  }
  addCodeEditor(e) {
    ((this._codeEditors[e.getId()] = e), this._onCodeEditorAdd.fire(e));
  }
  removeCodeEditor(e) {
    delete this._codeEditors[e.getId()] && this._onCodeEditorRemove.fire(e);
  }
  listCodeEditors() {
    return Object.keys(this._codeEditors).map((e) => this._codeEditors[e]);
  }
  willCreateDiffEditor() {
    this._onWillCreateDiffEditor.fire();
  }
  addDiffEditor(e) {
    ((this._diffEditors[e.getId()] = e), this._onDiffEditorAdd.fire(e));
  }
  removeDiffEditor(e) {
    delete this._diffEditors[e.getId()] && this._onDiffEditorRemove.fire(e);
  }
  listDiffEditors() {
    return Object.keys(this._diffEditors).map((e) => this._diffEditors[e]);
  }
  getFocusedCodeEditor() {
    let e = null;
    const t = this.listCodeEditors();
    for (const n of t) {
      if (n.hasTextFocus()) return n;
      n.hasWidgetFocus() && (e = n);
    }
    return e;
  }
  removeDecorationType(e) {
    const t = this._decorationOptionProviders.get(e);
    t &&
      (t.refCount--,
      t.refCount <= 0 &&
        (this._decorationOptionProviders.delete(e),
        t.dispose(),
        this.listCodeEditors().forEach((t) => t.removeDecorationsByType(e))));
  }
  setModelProperty(e, t, n) {
    const i = e.toString();
    let r;
    (this._modelProperties.has(i)
      ? (r = this._modelProperties.get(i))
      : ((r = new Map()), this._modelProperties.set(i, r)),
      r.set(t, n));
  }
  getModelProperty(e, t) {
    const n = e.toString();
    if (this._modelProperties.has(n)) {
      return this._modelProperties.get(n).get(t);
    }
  }
  async openCodeEditor(e, t, n) {
    for (const i of this._codeEditorOpenHandlers) {
      const r = await i(e, t, n);
      if (null !== r) return r;
    }
    return null;
  }
  registerCodeEditorOpenHandler(e) {
    return MO(this._codeEditorOpenHandlers.unshift(e));
  }
};
fHe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, h0),
  ],
  fHe,
);
var mHe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let _He = class extends fHe {
  constructor(e, t) {
    (super(t),
      this._register(this.onCodeEditorAdd(() => this._checkContextKey())),
      this._register(this.onCodeEditorRemove(() => this._checkContextKey())),
      (this._editorIsOpen = e.createKey("editorIsOpen", !1)),
      (this._activeCodeEditor = null),
      this._register(
        this.registerCodeEditorOpenHandler(async (e, t, n) => (t ? this.doOpenEditor(t, e) : null)),
      ));
  }
  _checkContextKey() {
    let e = !1;
    for (const t of this.listCodeEditors())
      if (!t.isSimpleWidget) {
        e = !0;
        break;
      }
    this._editorIsOpen.set(e);
  }
  setActiveCodeEditor(e) {
    this._activeCodeEditor = e;
  }
  getActiveCodeEditor() {
    return this._activeCodeEditor;
  }
  doOpenEditor(e, t) {
    if (!this.findModel(e, t.resource)) {
      if (t.resource) {
        const n = t.resource.scheme;
        if (n === NP.http || n === NP.https) return (UB(t.resource.toString()), e);
      }
      return null;
    }
    const n = t.options ? t.options.selection : null;
    if (n)
      if ("number" == typeof n.endLineNumber && "number" == typeof n.endColumn)
        (e.setSelection(n), e.revealRangeInCenter(n, 1));
      else {
        const t = { lineNumber: n.startLineNumber, column: n.startColumn };
        (e.setPosition(t), e.revealPositionInCenter(t, 1));
      }
    return e;
  }
  findModel(e, t) {
    const n = e.getModel();
    return n && n.uri.toString() !== t.toString() ? null : n;
  }
};
((_He = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([mHe(0, xW), mHe(1, h0)], _He)),
  HU(yV, _He, 0));
var vHe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  bHe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let yHe = class {
  get mainContainer() {
    return (
      this._codeEditorService.listCodeEditors().at(0)?.getContainerDomNode() ?? NI.document.body
    );
  }
  get activeContainer() {
    const e =
      this._codeEditorService.getFocusedCodeEditor() ??
      this._codeEditorService.getActiveCodeEditor();
    return e?.getContainerDomNode() ?? this.mainContainer;
  }
  get mainContainerDimension() {
    return iB(this.mainContainer);
  }
  get activeContainerDimension() {
    return iB(this.activeContainer);
  }
  get containers() {
    return rj(this._codeEditorService.listCodeEditors().map((e) => e.getContainerDomNode()));
  }
  getContainer() {
    return this.activeContainer;
  }
  whenContainerStylesLoaded() {}
  focus() {
    this._codeEditorService.getFocusedCodeEditor()?.focus();
  }
  constructor(e) {
    ((this._codeEditorService = e),
      (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 }));
  }
};
yHe = vHe([bHe(0, yV)], yHe);
let xHe = class extends yHe {
  get mainContainer() {
    return this._container;
  }
  constructor(e, t) {
    (super(t), (this._container = e));
  }
};
((xHe = vHe([bHe(1, yV)], xHe)), HU(bpe, yHe, 1));
var wHe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
function CHe(e) {
  return e.scheme === NP.file ? e.fsPath : e.path;
}
let SHe = 0;
class kHe {
  constructor(e, t, n, i, r, o, s) {
    ((this.id = ++SHe),
      (this.type = 0),
      (this.actual = e),
      (this.label = e.label),
      (this.confirmBeforeUndo = e.confirmBeforeUndo || !1),
      (this.resourceLabel = t),
      (this.strResource = n),
      (this.resourceLabels = [this.resourceLabel]),
      (this.strResources = [this.strResource]),
      (this.groupId = i),
      (this.groupOrder = r),
      (this.sourceId = o),
      (this.sourceOrder = s),
      (this.isValid = !0));
  }
  setValid(e) {
    this.isValid = e;
  }
  toString() {
    return `[id:${this.id}] [group:${this.groupId}] [${this.isValid ? "  VALID" : "INVALID"}] ${this.actual.constructor.name} - ${this.actual}`;
  }
}
class EHe {
  constructor(e, t) {
    ((this.resourceLabel = e), (this.reason = t));
  }
}
class NHe {
  constructor() {
    this.elements = new Map();
  }
  createMessage() {
    const e = [],
      t = [];
    for (const [, i] of this.elements) {
      (0 === i.reason ? e : t).push(i.resourceLabel);
    }
    const n = [];
    return (
      e.length > 0 &&
        n.push(
          SI(2030, "The following files have been closed and modified on disk: {0}.", e.join(", ")),
        ),
      t.length > 0 &&
        n.push(
          SI(
            2031,
            "The following files have been modified in an incompatible way: {0}.",
            t.join(", "),
          ),
        ),
      n.join("\n")
    );
  }
  get size() {
    return this.elements.size;
  }
  has(e) {
    return this.elements.has(e);
  }
  set(e, t) {
    this.elements.set(e, t);
  }
  delete(e) {
    return this.elements.delete(e);
  }
}
class LHe {
  constructor(e, t, n, i, r, o, s) {
    ((this.id = ++SHe),
      (this.type = 1),
      (this.actual = e),
      (this.label = e.label),
      (this.confirmBeforeUndo = e.confirmBeforeUndo || !1),
      (this.resourceLabels = t),
      (this.strResources = n),
      (this.groupId = i),
      (this.groupOrder = r),
      (this.sourceId = o),
      (this.sourceOrder = s),
      (this.removedResources = null),
      (this.invalidatedResources = null));
  }
  canSplit() {
    return "function" == typeof this.actual.split;
  }
  removeResource(e, t, n) {
    (this.removedResources || (this.removedResources = new NHe()),
      this.removedResources.has(t) || this.removedResources.set(t, new EHe(e, n)));
  }
  setValid(e, t, n) {
    n
      ? this.invalidatedResources &&
        (this.invalidatedResources.delete(t),
        0 === this.invalidatedResources.size && (this.invalidatedResources = null))
      : (this.invalidatedResources || (this.invalidatedResources = new NHe()),
        this.invalidatedResources.has(t) || this.invalidatedResources.set(t, new EHe(e, 0)));
  }
  toString() {
    return `[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources ? "INVALID" : "  VALID"}] ${this.actual.constructor.name} - ${this.actual}`;
  }
}
class DHe {
  constructor(e, t) {
    ((this.resourceLabel = e),
      (this.strResource = t),
      (this._past = []),
      (this._future = []),
      (this.locked = !1),
      (this.versionId = 1));
  }
  dispose() {
    for (const e of this._past)
      1 === e.type && e.removeResource(this.resourceLabel, this.strResource, 0);
    for (const e of this._future)
      1 === e.type && e.removeResource(this.resourceLabel, this.strResource, 0);
    this.versionId++;
  }
  toString() {
    const e = [];
    e.push(`* ${this.strResource}:`);
    for (let t = 0; t < this._past.length; t++) e.push(`   * [UNDO] ${this._past[t]}`);
    for (let t = this._future.length - 1; t >= 0; t--) e.push(`   * [REDO] ${this._future[t]}`);
    return e.join("\n");
  }
  flushAllElements() {
    ((this._past = []), (this._future = []), this.versionId++);
  }
  _setElementValidFlag(e, t) {
    1 === e.type ? e.setValid(this.resourceLabel, this.strResource, t) : e.setValid(t);
  }
  setElementsValidFlag(e, t) {
    for (const n of this._past) t(n.actual) && this._setElementValidFlag(n, e);
    for (const n of this._future) t(n.actual) && this._setElementValidFlag(n, e);
  }
  pushElement(e) {
    for (const t of this._future)
      1 === t.type && t.removeResource(this.resourceLabel, this.strResource, 1);
    ((this._future = []), this._past.push(e), this.versionId++);
  }
  createSnapshot(e) {
    const t = [];
    for (let n = 0, i = this._past.length; n < i; n++) t.push(this._past[n].id);
    for (let n = this._future.length - 1; n >= 0; n--) t.push(this._future[n].id);
    return new V7(e, t);
  }
  restoreSnapshot(e) {
    const t = e.elements.length;
    let n = !0,
      i = 0,
      r = -1;
    for (let s = 0, a = this._past.length; s < a; s++, i++) {
      const o = this._past[s];
      (n && (i >= t || o.id !== e.elements[i]) && ((n = !1), (r = 0)),
        n || 1 !== o.type || o.removeResource(this.resourceLabel, this.strResource, 0));
    }
    let o = -1;
    for (let s = this._future.length - 1; s >= 0; s--, i++) {
      const r = this._future[s];
      (n && (i >= t || r.id !== e.elements[i]) && ((n = !1), (o = s)),
        n || 1 !== r.type || r.removeResource(this.resourceLabel, this.strResource, 0));
    }
    (-1 !== r && (this._past = this._past.slice(0, r)),
      -1 !== o && (this._future = this._future.slice(o + 1)),
      this.versionId++);
  }
  getElements() {
    const e = [],
      t = [];
    for (const n of this._past) e.push(n.actual);
    for (const n of this._future) t.push(n.actual);
    return { past: e, future: t };
  }
  getClosestPastElement() {
    return 0 === this._past.length ? null : this._past[this._past.length - 1];
  }
  getSecondClosestPastElement() {
    return this._past.length < 2 ? null : this._past[this._past.length - 2];
  }
  getClosestFutureElement() {
    return 0 === this._future.length ? null : this._future[this._future.length - 1];
  }
  hasPastElements() {
    return this._past.length > 0;
  }
  hasFutureElements() {
    return this._future.length > 0;
  }
  splitPastWorkspaceElement(e, t) {
    for (let n = this._past.length - 1; n >= 0; n--)
      if (this._past[n] === e) {
        t.has(this.strResource)
          ? (this._past[n] = t.get(this.strResource))
          : this._past.splice(n, 1);
        break;
      }
    this.versionId++;
  }
  splitFutureWorkspaceElement(e, t) {
    for (let n = this._future.length - 1; n >= 0; n--)
      if (this._future[n] === e) {
        t.has(this.strResource)
          ? (this._future[n] = t.get(this.strResource))
          : this._future.splice(n, 1);
        break;
      }
    this.versionId++;
  }
  moveBackward(e) {
    (this._past.pop(), this._future.push(e), this.versionId++);
  }
  moveForward(e) {
    (this._future.pop(), this._past.push(e), this.versionId++);
  }
}
class THe {
  constructor(e) {
    ((this.editStacks = e), (this._versionIds = []));
    for (let t = 0, n = this.editStacks.length; t < n; t++)
      this._versionIds[t] = this.editStacks[t].versionId;
  }
  isValid() {
    for (let e = 0, t = this.editStacks.length; e < t; e++)
      if (this._versionIds[e] !== this.editStacks[e].versionId) return !1;
    return !0;
  }
}
const IHe = new DHe("", "");
IHe.locked = !0;
let RHe = class {
  constructor(e, t) {
    ((this._dialogService = e),
      (this._notificationService = t),
      (this._editStacks = new Map()),
      (this._uriComparisonKeyComputers = []));
  }
  getUriComparisonKey(e) {
    for (const t of this._uriComparisonKeyComputers)
      if (t[0] === e.scheme) return t[1].getComparisonKey(e);
    return e.toString();
  }
  _print(e) {
    const t = [];
    for (const n of this._editStacks) t.push(n[1].toString());
  }
  pushElement(e, t = W7.None, n = H7.None) {
    if (0 === e.type) {
      const i = CHe(e.resource),
        r = this.getUriComparisonKey(e.resource);
      this._pushElement(new kHe(e, i, r, t.id, t.nextOrder(), n.id, n.nextOrder()));
    } else {
      const i = new Set(),
        r = [],
        o = [];
      for (const t of e.resources) {
        const e = CHe(t),
          n = this.getUriComparisonKey(t);
        i.has(n) || (i.add(n), r.push(e), o.push(n));
      }
      1 === r.length
        ? this._pushElement(new kHe(e, r[0], o[0], t.id, t.nextOrder(), n.id, n.nextOrder()))
        : this._pushElement(new LHe(e, r, o, t.id, t.nextOrder(), n.id, n.nextOrder()));
    }
  }
  _pushElement(e) {
    for (let t = 0, n = e.strResources.length; t < n; t++) {
      const n = e.resourceLabels[t],
        i = e.strResources[t];
      let r;
      (this._editStacks.has(i)
        ? (r = this._editStacks.get(i))
        : ((r = new DHe(n, i)), this._editStacks.set(i, r)),
        r.pushElement(e));
    }
  }
  getLastElement(e) {
    const t = this.getUriComparisonKey(e);
    if (this._editStacks.has(t)) {
      const e = this._editStacks.get(t);
      if (e.hasFutureElements()) return null;
      const n = e.getClosestPastElement();
      return n ? n.actual : null;
    }
    return null;
  }
  _splitPastWorkspaceElement(e, t) {
    const n = e.actual.split(),
      i = new Map();
    for (const r of n) {
      const e = CHe(r.resource),
        t = this.getUriComparisonKey(r.resource),
        n = new kHe(r, e, t, 0, 0, 0, 0);
      i.set(n.strResource, n);
    }
    for (const r of e.strResources) {
      if (t && t.has(r)) continue;
      this._editStacks.get(r).splitPastWorkspaceElement(e, i);
    }
  }
  _splitFutureWorkspaceElement(e, t) {
    const n = e.actual.split(),
      i = new Map();
    for (const r of n) {
      const e = CHe(r.resource),
        t = this.getUriComparisonKey(r.resource),
        n = new kHe(r, e, t, 0, 0, 0, 0);
      i.set(n.strResource, n);
    }
    for (const r of e.strResources) {
      if (t && t.has(r)) continue;
      this._editStacks.get(r).splitFutureWorkspaceElement(e, i);
    }
  }
  removeElements(e) {
    const t = "string" == typeof e ? e : this.getUriComparisonKey(e);
    if (this._editStacks.has(t)) {
      (this._editStacks.get(t).dispose(), this._editStacks.delete(t));
    }
  }
  setElementsValidFlag(e, t, n) {
    const i = this.getUriComparisonKey(e);
    if (this._editStacks.has(i)) {
      this._editStacks.get(i).setElementsValidFlag(t, n);
    }
  }
  createSnapshot(e) {
    const t = this.getUriComparisonKey(e);
    if (this._editStacks.has(t)) {
      return this._editStacks.get(t).createSnapshot(e);
    }
    return new V7(e, []);
  }
  restoreSnapshot(e) {
    const t = this.getUriComparisonKey(e.resource);
    if (this._editStacks.has(t)) {
      const n = this._editStacks.get(t);
      (n.restoreSnapshot(e),
        n.hasPastElements() || n.hasFutureElements() || (n.dispose(), this._editStacks.delete(t)));
    }
  }
  getElements(e) {
    const t = this.getUriComparisonKey(e);
    if (this._editStacks.has(t)) {
      return this._editStacks.get(t).getElements();
    }
    return { past: [], future: [] };
  }
  _findClosestUndoElementWithSource(e) {
    if (!e) return [null, null];
    let t = null,
      n = null;
    for (const [i, r] of this._editStacks) {
      const o = r.getClosestPastElement();
      o && o.sourceId === e && (!t || o.sourceOrder > t.sourceOrder) && ((t = o), (n = i));
    }
    return [t, n];
  }
  canUndo(e) {
    if (e instanceof H7) {
      const [, t] = this._findClosestUndoElementWithSource(e.id);
      return !!t;
    }
    const t = this.getUriComparisonKey(e);
    if (this._editStacks.has(t)) {
      return this._editStacks.get(t).hasPastElements();
    }
    return !1;
  }
  _onError(e, t) {
    HI(e);
    for (const n of t.strResources) this.removeElements(n);
    this._notificationService.error(e);
  }
  _acquireLocks(e) {
    for (const t of e.editStacks) if (t.locked) throw new Error("Cannot acquire edit stack lock");
    for (const t of e.editStacks) t.locked = !0;
    return () => {
      for (const t of e.editStacks) t.locked = !1;
    };
  }
  _safeInvokeWithLocks(e, t, n, i, r) {
    const o = this._acquireLocks(n);
    let s;
    try {
      s = t();
    } catch (a) {
      return (o(), i.dispose(), this._onError(a, e));
    }
    return s
      ? s.then(
          () => (o(), i.dispose(), r()),
          (t) => (o(), i.dispose(), this._onError(t, e)),
        )
      : (o(), i.dispose(), r());
  }
  async _invokeWorkspacePrepare(e) {
    if (void 0 === e.actual.prepareUndoRedo) return PO.None;
    const t = e.actual.prepareUndoRedo();
    return void 0 === t ? PO.None : t;
  }
  _invokeResourcePrepare(e, t) {
    if (1 !== e.actual.type || void 0 === e.actual.prepareUndoRedo) return t(PO.None);
    const n = e.actual.prepareUndoRedo();
    return n ? (TO(n) ? t(n) : n.then((e) => t(e))) : t(PO.None);
  }
  _getAffectedEditStacks(e) {
    const t = [];
    for (const n of e.strResources) t.push(this._editStacks.get(n) || IHe);
    return new THe(t);
  }
  _tryToSplitAndUndo(e, t, n, i) {
    if (t.canSplit())
      return (
        this._splitPastWorkspaceElement(t, n),
        this._notificationService.warn(i),
        new OHe(this._undo(e, 0, !0))
      );
    for (const r of t.strResources) this.removeElements(r);
    return (this._notificationService.warn(i), new OHe());
  }
  _checkWorkspaceUndo(e, t, n, i) {
    if (t.removedResources)
      return this._tryToSplitAndUndo(
        e,
        t,
        t.removedResources,
        SI(
          2032,
          "Could not undo '{0}' across all files. {1}",
          t.label,
          t.removedResources.createMessage(),
        ),
      );
    if (i && t.invalidatedResources)
      return this._tryToSplitAndUndo(
        e,
        t,
        t.invalidatedResources,
        SI(
          2033,
          "Could not undo '{0}' across all files. {1}",
          t.label,
          t.invalidatedResources.createMessage(),
        ),
      );
    const r = [];
    for (const s of n.editStacks) s.getClosestPastElement() !== t && r.push(s.resourceLabel);
    if (r.length > 0)
      return this._tryToSplitAndUndo(
        e,
        t,
        null,
        SI(
          2034,
          "Could not undo '{0}' across all files because changes were made to {1}",
          t.label,
          r.join(", "),
        ),
      );
    const o = [];
    for (const s of n.editStacks) s.locked && o.push(s.resourceLabel);
    return o.length > 0
      ? this._tryToSplitAndUndo(
          e,
          t,
          null,
          SI(
            2035,
            "Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",
            t.label,
            o.join(", "),
          ),
        )
      : n.isValid()
        ? null
        : this._tryToSplitAndUndo(
            e,
            t,
            null,
            SI(
              2036,
              "Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",
              t.label,
            ),
          );
  }
  _workspaceUndo(e, t, n) {
    const i = this._getAffectedEditStacks(t),
      r = this._checkWorkspaceUndo(e, t, i, !1);
    return r ? r.returnValue : this._confirmAndExecuteWorkspaceUndo(e, t, i, n);
  }
  _isPartOfUndoGroup(e) {
    if (!e.groupId) return !1;
    for (const [, t] of this._editStacks) {
      const n = t.getClosestPastElement();
      if (n) {
        if (n === e) {
          const n = t.getSecondClosestPastElement();
          if (n && n.groupId === e.groupId) return !0;
        }
        if (n.groupId === e.groupId) return !0;
      }
    }
    return !1;
  }
  async _confirmAndExecuteWorkspaceUndo(e, t, n, i) {
    if (t.canSplit() && !this._isPartOfUndoGroup(t)) {
      let r;
      !(function (e) {
        ((e[(e.All = 0)] = "All"), (e[(e.This = 1)] = "This"), (e[(e.Cancel = 2)] = "Cancel"));
      })(r || (r = {}));
      const { result: o } = await this._dialogService.prompt({
        type: G4.Info,
        message: SI(2037, "Would you like to undo '{0}' across all files?", t.label),
        buttons: [
          { label: SI(2038, "&&Undo in {0} Files", n.editStacks.length), run: () => r.All },
          { label: SI(2039, "Undo this &&File"), run: () => r.This },
        ],
        cancelButton: { run: () => r.Cancel },
      });
      if (o === r.Cancel) return;
      if (o === r.This) return (this._splitPastWorkspaceElement(t, null), this._undo(e, 0, !0));
      const s = this._checkWorkspaceUndo(e, t, n, !1);
      if (s) return s.returnValue;
      i = !0;
    }
    let r;
    try {
      r = await this._invokeWorkspacePrepare(t);
    } catch (s) {
      return this._onError(s, t);
    }
    const o = this._checkWorkspaceUndo(e, t, n, !0);
    if (o) return (r.dispose(), o.returnValue);
    for (const a of n.editStacks) a.moveBackward(t);
    return this._safeInvokeWithLocks(
      t,
      () => t.actual.undo(),
      n,
      r,
      () => this._continueUndoInGroup(t.groupId, i),
    );
  }
  _resourceUndo(e, t, n) {
    if (t.isValid) {
      if (e.locked) {
        const e = SI(
          2040,
          "Could not undo '{0}' because there is already an undo or redo operation running.",
          t.label,
        );
        return void this._notificationService.warn(e);
      }
      return this._invokeResourcePrepare(
        t,
        (i) => (
          e.moveBackward(t),
          this._safeInvokeWithLocks(
            t,
            () => t.actual.undo(),
            new THe([e]),
            i,
            () => this._continueUndoInGroup(t.groupId, n),
          )
        ),
      );
    }
    e.flushAllElements();
  }
  _findClosestUndoElementInGroup(e) {
    if (!e) return [null, null];
    let t = null,
      n = null;
    for (const [i, r] of this._editStacks) {
      const o = r.getClosestPastElement();
      o && o.groupId === e && (!t || o.groupOrder > t.groupOrder) && ((t = o), (n = i));
    }
    return [t, n];
  }
  _continueUndoInGroup(e, t) {
    if (!e) return;
    const [, n] = this._findClosestUndoElementInGroup(e);
    return n ? this._undo(n, 0, t) : void 0;
  }
  undo(e) {
    if (e instanceof H7) {
      const [, t] = this._findClosestUndoElementWithSource(e.id);
      return t ? this._undo(t, e.id, !1) : void 0;
    }
    return "string" == typeof e
      ? this._undo(e, 0, !1)
      : this._undo(this.getUriComparisonKey(e), 0, !1);
  }
  _undo(e, t = 0, n) {
    if (!this._editStacks.has(e)) return;
    const i = this._editStacks.get(e),
      r = i.getClosestPastElement();
    if (!r) return;
    if (r.groupId) {
      const [e, i] = this._findClosestUndoElementInGroup(r.groupId);
      if (r !== e && i) return this._undo(i, t, n);
    }
    if ((r.sourceId !== t || r.confirmBeforeUndo) && !n)
      return this._confirmAndContinueUndo(e, t, r);
    try {
      return 1 === r.type ? this._workspaceUndo(e, r, n) : this._resourceUndo(i, r, n);
    } finally {
    }
  }
  async _confirmAndContinueUndo(e, t, n) {
    if (
      (
        await this._dialogService.confirm({
          message: SI(2041, "Would you like to undo '{0}'?", n.label),
          primaryButton: SI(2042, "&&Yes"),
          cancelButton: SI(2043, "No"),
        })
      ).confirmed
    )
      return this._undo(e, t, !0);
  }
  _findClosestRedoElementWithSource(e) {
    if (!e) return [null, null];
    let t = null,
      n = null;
    for (const [i, r] of this._editStacks) {
      const o = r.getClosestFutureElement();
      o && o.sourceId === e && (!t || o.sourceOrder < t.sourceOrder) && ((t = o), (n = i));
    }
    return [t, n];
  }
  canRedo(e) {
    if (e instanceof H7) {
      const [, t] = this._findClosestRedoElementWithSource(e.id);
      return !!t;
    }
    const t = this.getUriComparisonKey(e);
    if (this._editStacks.has(t)) {
      return this._editStacks.get(t).hasFutureElements();
    }
    return !1;
  }
  _tryToSplitAndRedo(e, t, n, i) {
    if (t.canSplit())
      return (
        this._splitFutureWorkspaceElement(t, n),
        this._notificationService.warn(i),
        new OHe(this._redo(e))
      );
    for (const r of t.strResources) this.removeElements(r);
    return (this._notificationService.warn(i), new OHe());
  }
  _checkWorkspaceRedo(e, t, n, i) {
    if (t.removedResources)
      return this._tryToSplitAndRedo(
        e,
        t,
        t.removedResources,
        SI(
          2044,
          "Could not redo '{0}' across all files. {1}",
          t.label,
          t.removedResources.createMessage(),
        ),
      );
    if (i && t.invalidatedResources)
      return this._tryToSplitAndRedo(
        e,
        t,
        t.invalidatedResources,
        SI(
          2045,
          "Could not redo '{0}' across all files. {1}",
          t.label,
          t.invalidatedResources.createMessage(),
        ),
      );
    const r = [];
    for (const s of n.editStacks) s.getClosestFutureElement() !== t && r.push(s.resourceLabel);
    if (r.length > 0)
      return this._tryToSplitAndRedo(
        e,
        t,
        null,
        SI(
          2046,
          "Could not redo '{0}' across all files because changes were made to {1}",
          t.label,
          r.join(", "),
        ),
      );
    const o = [];
    for (const s of n.editStacks) s.locked && o.push(s.resourceLabel);
    return o.length > 0
      ? this._tryToSplitAndRedo(
          e,
          t,
          null,
          SI(
            2047,
            "Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",
            t.label,
            o.join(", "),
          ),
        )
      : n.isValid()
        ? null
        : this._tryToSplitAndRedo(
            e,
            t,
            null,
            SI(
              2048,
              "Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",
              t.label,
            ),
          );
  }
  _workspaceRedo(e, t) {
    const n = this._getAffectedEditStacks(t),
      i = this._checkWorkspaceRedo(e, t, n, !1);
    return i ? i.returnValue : this._executeWorkspaceRedo(e, t, n);
  }
  async _executeWorkspaceRedo(e, t, n) {
    let i;
    try {
      i = await this._invokeWorkspacePrepare(t);
    } catch (o) {
      return this._onError(o, t);
    }
    const r = this._checkWorkspaceRedo(e, t, n, !0);
    if (r) return (i.dispose(), r.returnValue);
    for (const s of n.editStacks) s.moveForward(t);
    return this._safeInvokeWithLocks(
      t,
      () => t.actual.redo(),
      n,
      i,
      () => this._continueRedoInGroup(t.groupId),
    );
  }
  _resourceRedo(e, t) {
    if (t.isValid) {
      if (e.locked) {
        const e = SI(
          2049,
          "Could not redo '{0}' because there is already an undo or redo operation running.",
          t.label,
        );
        return void this._notificationService.warn(e);
      }
      return this._invokeResourcePrepare(
        t,
        (n) => (
          e.moveForward(t),
          this._safeInvokeWithLocks(
            t,
            () => t.actual.redo(),
            new THe([e]),
            n,
            () => this._continueRedoInGroup(t.groupId),
          )
        ),
      );
    }
    e.flushAllElements();
  }
  _findClosestRedoElementInGroup(e) {
    if (!e) return [null, null];
    let t = null,
      n = null;
    for (const [i, r] of this._editStacks) {
      const o = r.getClosestFutureElement();
      o && o.groupId === e && (!t || o.groupOrder < t.groupOrder) && ((t = o), (n = i));
    }
    return [t, n];
  }
  _continueRedoInGroup(e) {
    if (!e) return;
    const [, t] = this._findClosestRedoElementInGroup(e);
    return t ? this._redo(t) : void 0;
  }
  redo(e) {
    if (e instanceof H7) {
      const [, t] = this._findClosestRedoElementWithSource(e.id);
      return t ? this._redo(t) : void 0;
    }
    return "string" == typeof e ? this._redo(e) : this._redo(this.getUriComparisonKey(e));
  }
  _redo(e) {
    if (!this._editStacks.has(e)) return;
    const t = this._editStacks.get(e),
      n = t.getClosestFutureElement();
    if (n) {
      if (n.groupId) {
        const [e, t] = this._findClosestRedoElementInGroup(n.groupId);
        if (n !== e && t) return this._redo(t);
      }
      try {
        return 1 === n.type ? this._workspaceRedo(e, n) : this._resourceRedo(t, n);
      } finally {
      }
    }
  }
};
RHe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([wHe(0, Cje), wHe(1, Y4)], RHe);
class OHe {
  constructor(e) {
    this.returnValue = e;
  }
}
HU(B7, RHe, 1);
var MHe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let AHe = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this._themeService = e),
      (this._logService = t),
      (this._languageService = n),
      (this._caches = new WeakMap()),
      this._register(
        this._themeService.onDidColorThemeChange(() => {
          this._caches = new WeakMap();
        }),
      ));
  }
  getStyling(e) {
    return (
      this._caches.has(e) ||
        this._caches.set(
          e,
          new dPe(e.getLegend(), this._themeService, this._languageService, this._logService),
        ),
      this._caches.get(e)
    );
  }
};
function PHe(e) {
  return "string" != typeof e && (Array.isArray(e) ? e.every(PHe) : !!e.exclusive);
}
((AHe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([MHe(0, h0), MHe(1, yH), MHe(2, BU)], AHe)),
  HU(pPe, AHe, 1));
class jHe {
  constructor(e, t, n, i, r) {
    ((this.uri = e),
      (this.languageId = t),
      (this.notebookUri = n),
      (this.notebookType = i),
      (this.recursive = r));
  }
  equals(e) {
    return (
      this.notebookType === e.notebookType &&
      this.languageId === e.languageId &&
      this.uri.toString() === e.uri.toString() &&
      this.notebookUri?.toString() === e.notebookUri?.toString() &&
      this.recursive === e.recursive
    );
  }
}
class FHe {
  get onDidChange() {
    return this._onDidChange.event;
  }
  constructor(e) {
    ((this._notebookInfoResolver = e),
      (this._clock = 0),
      (this._entries = []),
      (this._onDidChange = new QO()));
  }
  register(e, t) {
    let n = { selector: e, provider: t, _score: -1, _time: this._clock++ };
    return (
      this._entries.push(n),
      (this._lastCandidate = void 0),
      this._onDidChange.fire(this._entries.length),
      MO(() => {
        if (n) {
          const e = this._entries.indexOf(n);
          e >= 0 &&
            (this._entries.splice(e, 1),
            (this._lastCandidate = void 0),
            this._onDidChange.fire(this._entries.length),
            (n = void 0));
        }
      })
    );
  }
  has(e) {
    return this.all(e).length > 0;
  }
  all(e) {
    if (!e) return [];
    this._updateScores(e, !1);
    const t = [];
    for (const n of this._entries) n._score > 0 && t.push(n.provider);
    return t;
  }
  ordered(e, t = !1) {
    const n = [];
    return (this._orderedForEach(e, t, (e) => n.push(e.provider)), n);
  }
  orderedGroups(e) {
    const t = [];
    let n, i;
    return (
      this._orderedForEach(e, !1, (e) => {
        n && i === e._score ? n.push(e.provider) : ((i = e._score), (n = [e.provider]), t.push(n));
      }),
      t
    );
  }
  _orderedForEach(e, t, n) {
    this._updateScores(e, t);
    for (const i of this._entries) i._score > 0 && n(i);
  }
  _updateScores(e, t) {
    const n = this._notebookInfoResolver?.(e.uri),
      i = n
        ? new jHe(e.uri, e.getLanguageId(), n.uri, n.type, t)
        : new jHe(e.uri, e.getLanguageId(), void 0, void 0, t);
    if (!this._lastCandidate?.equals(i)) {
      this._lastCandidate = i;
      for (const n of this._entries)
        if (
          ((n._score = Zje(n.selector, i.uri, i.languageId, tU(e), i.notebookUri, i.notebookType)),
          PHe(n.selector) && n._score > 0)
        ) {
          if (!t) {
            for (const e of this._entries) e._score = 0;
            n._score = 1e3;
            break;
          }
          n._score = 0;
        }
      this._entries.sort(FHe._compareByScoreAndTime);
    }
  }
  static _compareByScoreAndTime(e, t) {
    return e._score < t._score
      ? 1
      : e._score > t._score
        ? -1
        : BHe(e.selector) && !BHe(t.selector)
          ? 1
          : !BHe(e.selector) && BHe(t.selector)
            ? -1
            : e._time < t._time
              ? 1
              : e._time > t._time
                ? -1
                : 0;
  }
}
function BHe(e) {
  return "string" != typeof e && (Array.isArray(e) ? e.some(BHe) : Boolean(e.isBuiltin));
}
HU(
  mee,
  class {
    constructor() {
      ((this.referenceProvider = new FHe(this._score.bind(this))),
        (this.renameProvider = new FHe(this._score.bind(this))),
        (this.newSymbolNamesProvider = new FHe(this._score.bind(this))),
        (this.codeActionProvider = new FHe(this._score.bind(this))),
        (this.definitionProvider = new FHe(this._score.bind(this))),
        (this.typeDefinitionProvider = new FHe(this._score.bind(this))),
        (this.declarationProvider = new FHe(this._score.bind(this))),
        (this.implementationProvider = new FHe(this._score.bind(this))),
        (this.documentSymbolProvider = new FHe(this._score.bind(this))),
        (this.inlayHintsProvider = new FHe(this._score.bind(this))),
        (this.colorProvider = new FHe(this._score.bind(this))),
        (this.codeLensProvider = new FHe(this._score.bind(this))),
        (this.documentFormattingEditProvider = new FHe(this._score.bind(this))),
        (this.documentRangeFormattingEditProvider = new FHe(this._score.bind(this))),
        (this.onTypeFormattingEditProvider = new FHe(this._score.bind(this))),
        (this.signatureHelpProvider = new FHe(this._score.bind(this))),
        (this.hoverProvider = new FHe(this._score.bind(this))),
        (this.documentHighlightProvider = new FHe(this._score.bind(this))),
        (this.multiDocumentHighlightProvider = new FHe(this._score.bind(this))),
        (this.selectionRangeProvider = new FHe(this._score.bind(this))),
        (this.foldingRangeProvider = new FHe(this._score.bind(this))),
        (this.linkProvider = new FHe(this._score.bind(this))),
        (this.inlineCompletionsProvider = new FHe(this._score.bind(this))),
        (this.completionProvider = new FHe(this._score.bind(this))),
        (this.linkedEditingRangeProvider = new FHe(this._score.bind(this))),
        (this.documentRangeSemanticTokensProvider = new FHe(this._score.bind(this))),
        (this.documentSemanticTokensProvider = new FHe(this._score.bind(this))),
        (this.documentDropEditProvider = new FHe(this._score.bind(this))),
        (this.documentPasteEditProvider = new FHe(this._score.bind(this))));
    }
    _score(e) {
      return this._notebookTypeResolver?.(e);
    }
  },
  1,
);
var VHe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const WHe = VB;
let HHe = class extends rJ {
  get _targetWindow() {
    return MF(this._target.targetElements[0]);
  }
  get _targetDocumentElement() {
    return MF(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 2 === this._hoverPosition ? 0 : 1;
  }
  get x() {
    return this._x;
  }
  get y() {
    return this._y;
  }
  get isLocked() {
    return this._isLocked;
  }
  set isLocked(e) {
    this._isLocked !== e &&
      ((this._isLocked = e), this._hoverContainer.classList.toggle("locked", this._isLocked));
  }
  constructor(e, t, n, i, r) {
    if (
      (super(),
      (this._keybindingService = t),
      (this._configurationService = n),
      (this._markdownRenderer = i),
      (this._accessibilityService = r),
      (this._messageListeners = new AO()),
      (this._isDisposed = !1),
      (this._forcePosition = !1),
      (this._x = 0),
      (this._y = 0),
      (this._isLocked = !1),
      (this._enableFocusTraps = !1),
      (this._addedFocusTrap = !1),
      (this._maxHeightRatioRelativeToWindow = 0.5),
      (this._onDispose = this._register(new QO())),
      (this._onRequestLayout = this._register(new QO())),
      (this._linkHandler = e.linkHandler),
      (this._target = "targetElements" in e.target ? e.target : new UHe(e.target)),
      e.style)
    )
      switch (e.style) {
        case 1:
          ((e.appearance ??= {}), (e.appearance.compact ??= !0), (e.appearance.showPointer ??= !0));
          break;
        case 2:
          ((e.appearance ??= {}), (e.appearance.compact ??= !0));
      }
    ((this._hoverPointer = e.appearance?.showPointer ? WHe("div.workbench-hover-pointer") : void 0),
      (this._hover = this._register(new m_e(!e.appearance?.skipFadeInAnimation))),
      this._hover.containerDomNode.classList.add("workbench-hover"),
      e.appearance?.compact &&
        this._hover.containerDomNode.classList.add("workbench-hover", "compact"),
      e.additionalClasses && this._hover.containerDomNode.classList.add(...e.additionalClasses),
      e.position?.forcePosition && (this._forcePosition = !0),
      e.trapFocus && (this._enableFocusTraps = !0));
    const o = e.appearance?.maxHeightRatio;
    (void 0 !== o && o > 0 && o <= 1 && (this._maxHeightRatioRelativeToWindow = o),
      (this._hoverPosition =
        void 0 === e.position?.hoverPosition
          ? 3
          : lR(e.position.hoverPosition)
            ? e.position.hoverPosition
            : 2),
      this.onmousedown(this._hover.containerDomNode, (e) => e.stopPropagation()),
      this.onkeydown(this._hover.containerDomNode, (e) => {
        e.equals(9) && this.dispose();
      }),
      this._register($F(this._targetWindow, "blur", () => this.dispose())));
    const s = WHe("div.hover-row.markdown-hover"),
      a = WHe("div.hover-contents");
    if ("string" == typeof e.content)
      ((a.textContent = e.content), (a.style.whiteSpace = "pre-wrap"));
    else if (SB(e.content)) (a.appendChild(e.content), a.classList.add("html-hover-contents"));
    else {
      const t = e.content,
        { element: n } = this._register(
          this._markdownRenderer.render(t, {
            actionHandler: this._linkHandler,
            asyncRenderCallback: () => {
              (a.classList.add("code-hover-contents"), this.layout(), this._onRequestLayout.fire());
            },
          }),
        );
      a.appendChild(n);
    }
    if (
      (s.appendChild(a),
      this._hover.contentsDomNode.appendChild(s),
      e.actions && e.actions.length > 0)
    ) {
      const t = WHe("div.hover-row.status-bar"),
        n = WHe("div.actions");
      (e.actions.forEach((e) => {
        const t = this._keybindingService.lookupKeybinding(e.commandId),
          i = t ? t.getLabel() : null;
        this._register(
          __e.render(
            n,
            {
              label: e.label,
              commandId: e.commandId,
              run: (t) => {
                (e.run(t), this.dispose());
              },
              iconClass: e.iconClass,
            },
            i,
          ),
        );
      }),
        t.appendChild(n),
        this._hover.containerDomNode.appendChild(t));
    }
    let l;
    if (
      ((this._hoverContainer = WHe("div.workbench-hover-container")),
      this._hoverPointer && this._hoverContainer.appendChild(this._hoverPointer),
      this._hoverContainer.appendChild(this._hover.containerDomNode),
      (l =
        !(e.actions && e.actions.length > 0) &&
        (void 0 === e.persistence?.hideOnHover
          ? "string" == typeof e.content ||
            (sre(e.content) && !e.content.value.includes("](") && !e.content.value.includes("</a>"))
          : e.persistence.hideOnHover)),
      e.appearance?.showHoverHint)
    ) {
      const e = WHe("div.hover-row.status-bar"),
        t = WHe("div.info");
      ((t.textContent = SI(1699, "Hold {0} key to mouse over", PR ? "Option" : "Alt")),
        e.appendChild(t),
        this._hover.containerDomNode.appendChild(e));
    }
    const c = [...this._target.targetElements];
    l || c.push(this._hoverContainer);
    const d = this._register(new zHe(c));
    if (
      (this._register(
        d.onMouseOut(() => {
          this._isLocked || this.dispose();
        }),
      ),
      l)
    ) {
      const e = [...this._target.targetElements, this._hoverContainer];
      ((this._lockMouseTracker = this._register(new zHe(e))),
        this._register(
          this._lockMouseTracker.onMouseOut(() => {
            this._isLocked || this.dispose();
          }),
        ));
    } else this._lockMouseTracker = d;
  }
  addFocusTrap() {
    if (!this._enableFocusTraps || this._addedFocusTrap) return;
    this._addedFocusTrap = !0;
    const e = this._hover.containerDomNode,
      t = this.findLastFocusableChild(this._hover.containerDomNode);
    if (t) {
      const n = AB(this._hoverContainer, WHe("div")),
        i = MB(this._hoverContainer, WHe("div"));
      ((n.tabIndex = 0),
        (i.tabIndex = 0),
        this._register(
          $F(i, "focus", (t) => {
            (e.focus(), t.preventDefault());
          }),
        ),
        this._register(
          $F(n, "focus", (e) => {
            (t.focus(), e.preventDefault());
          }),
        ));
    }
  }
  findLastFocusableChild(e) {
    if (e.hasChildNodes())
      for (let t = 0; t < e.childNodes.length; t++) {
        const n = e.childNodes.item(e.childNodes.length - t - 1);
        if (n.nodeType === n.ELEMENT_NODE) {
          const e = n;
          if ("number" == typeof e.tabIndex && e.tabIndex >= 0) return e;
        }
        const i = this.findLastFocusableChild(n);
        if (i) return i;
      }
  }
  render(e) {
    e.appendChild(this._hoverContainer);
    const t =
      this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement) &&
      v_e(
        !0 === this._configurationService.getValue("accessibility.verbosity.hover") &&
          this._accessibilityService.isScreenReaderOptimized(),
        this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel(),
      );
    (t && fV(t), this.layout(), this.addFocusTrap());
  }
  layout() {
    (this._hover.containerDomNode.classList.remove("right-aligned"),
      (this._hover.contentsDomNode.style.maxHeight = ""));
    const e = this._target.targetElements.map((e) =>
        ((e) => {
          const t = lB(e),
            n = e.getBoundingClientRect();
          return { top: n.top * t, bottom: n.bottom * t, right: n.right * t, left: n.left * t };
        })(e),
      ),
      { top: t, right: n, bottom: i, left: r } = e[0],
      o = n - r,
      s = i - t,
      a = {
        top: t,
        right: n,
        bottom: i,
        left: r,
        width: o,
        height: s,
        center: { x: r + o / 2, y: t + s / 2 },
      };
    if (
      (this.adjustHorizontalHoverPosition(a),
      this.adjustVerticalHoverPosition(a),
      this.adjustHoverMaxHeight(a),
      (this._hoverContainer.style.padding = ""),
      (this._hoverContainer.style.margin = ""),
      this._hoverPointer)
    ) {
      switch (this._hoverPosition) {
        case 1:
          ((a.left += 3),
            (a.right += 3),
            (this._hoverContainer.style.paddingLeft = "3px"),
            (this._hoverContainer.style.marginLeft = "-3px"));
          break;
        case 0:
          ((a.left -= 3),
            (a.right -= 3),
            (this._hoverContainer.style.paddingRight = "3px"),
            (this._hoverContainer.style.marginRight = "-3px"));
          break;
        case 2:
          ((a.top += 3),
            (a.bottom += 3),
            (this._hoverContainer.style.paddingTop = "3px"),
            (this._hoverContainer.style.marginTop = "-3px"));
          break;
        case 3:
          ((a.top -= 3),
            (a.bottom -= 3),
            (this._hoverContainer.style.paddingBottom = "3px"),
            (this._hoverContainer.style.marginBottom = "-3px"));
      }
      ((a.center.x = a.left + o / 2), (a.center.y = a.top + s / 2));
    }
    (this.computeXCordinate(a),
      this.computeYCordinate(a),
      this._hoverPointer &&
        (this._hoverPointer.classList.remove("top"),
        this._hoverPointer.classList.remove("left"),
        this._hoverPointer.classList.remove("right"),
        this._hoverPointer.classList.remove("bottom"),
        this.setHoverPointerPosition(a)),
      this._hover.onContentsChanged());
  }
  computeXCordinate(e) {
    const t = this._hover.containerDomNode.clientWidth + 2;
    (void 0 !== this._target.x
      ? (this._x = this._target.x)
      : 1 === this._hoverPosition
        ? (this._x = e.right)
        : 0 === this._hoverPosition
          ? (this._x = e.left - t)
          : (this._hoverPointer
              ? (this._x = e.center.x - this._hover.containerDomNode.clientWidth / 2)
              : (this._x = e.left),
            this._x + t >= this._targetDocumentElement.clientWidth &&
              (this._hover.containerDomNode.classList.add("right-aligned"),
              (this._x = Math.max(
                this._targetDocumentElement.clientWidth - t - 2,
                this._targetDocumentElement.clientLeft,
              )))),
      this._x < this._targetDocumentElement.clientLeft && (this._x = e.left + 2));
  }
  computeYCordinate(e) {
    (void 0 !== this._target.y
      ? (this._y = this._target.y)
      : 3 === this._hoverPosition
        ? (this._y = e.top)
        : 2 === this._hoverPosition
          ? (this._y = e.bottom - 2)
          : this._hoverPointer
            ? (this._y = e.center.y + this._hover.containerDomNode.clientHeight / 2)
            : (this._y = e.bottom),
      this._y > this._targetWindow.innerHeight && (this._y = e.bottom));
  }
  adjustHorizontalHoverPosition(e) {
    if (void 0 !== this._target.x) return;
    const t = this._hoverPointer ? 3 : 0;
    if (this._forcePosition) {
      const n = t + 2;
      return void (1 === this._hoverPosition
        ? (this._hover.containerDomNode.style.maxWidth =
            this._targetDocumentElement.clientWidth - e.right - n + "px")
        : 0 === this._hoverPosition &&
          (this._hover.containerDomNode.style.maxWidth = e.left - n + "px"));
    }
    if (1 === this._hoverPosition) {
      if (
        this._targetDocumentElement.clientWidth - e.right <
        this._hover.containerDomNode.clientWidth + t
      ) {
        e.left >= this._hover.containerDomNode.clientWidth + t
          ? (this._hoverPosition = 0)
          : (this._hoverPosition = 2);
      }
    } else if (0 === this._hoverPosition) {
      if (e.left < this._hover.containerDomNode.clientWidth + t) {
        this._targetDocumentElement.clientWidth - e.right >=
        this._hover.containerDomNode.clientWidth + t
          ? (this._hoverPosition = 1)
          : (this._hoverPosition = 2);
      }
      e.left - this._hover.containerDomNode.clientWidth - t <=
        this._targetDocumentElement.clientLeft && (this._hoverPosition = 1);
    }
  }
  adjustVerticalHoverPosition(e) {
    if (void 0 !== this._target.y || this._forcePosition) return;
    const t = this._hoverPointer ? 3 : 0;
    3 === this._hoverPosition
      ? e.top - this._hover.containerDomNode.clientHeight - t < 0 && (this._hoverPosition = 2)
      : 2 === this._hoverPosition &&
        e.bottom + this._hover.containerDomNode.offsetHeight + t > this._targetWindow.innerHeight &&
        (this._hoverPosition = 3);
  }
  adjustHoverMaxHeight(e) {
    let t = this._targetWindow.innerHeight * this._maxHeightRatioRelativeToWindow;
    if (this._forcePosition) {
      const n = 2 + (this._hoverPointer ? 3 : 0);
      3 === this._hoverPosition
        ? (t = Math.min(t, e.top - n))
        : 2 === this._hoverPosition &&
          (t = Math.min(t, this._targetWindow.innerHeight - e.bottom - n));
    }
    if (
      ((this._hover.containerDomNode.style.maxHeight = `${t}px`),
      this._hover.contentsDomNode.clientHeight < this._hover.contentsDomNode.scrollHeight)
    ) {
      const e = `${this._hover.scrollbar.options.verticalScrollbarSize}px`;
      this._hover.contentsDomNode.style.paddingRight !== e &&
        (this._hover.contentsDomNode.style.paddingRight = e);
    }
  }
  setHoverPointerPosition(e) {
    if (this._hoverPointer)
      switch (this._hoverPosition) {
        case 0:
        case 1: {
          this._hoverPointer.classList.add(0 === this._hoverPosition ? "right" : "left");
          const t = this._hover.containerDomNode.clientHeight;
          t > e.height
            ? (this._hoverPointer.style.top = e.center.y - (this._y - t) - 3 + "px")
            : (this._hoverPointer.style.top = Math.round(t / 2) - 3 + "px");
          break;
        }
        case 3:
        case 2: {
          this._hoverPointer.classList.add(3 === this._hoverPosition ? "bottom" : "top");
          const t = this._hover.containerDomNode.clientWidth;
          let n = Math.round(t / 2) - 3;
          const i = this._x + n;
          ((i < e.left || i > e.right) && (n = e.center.x - this._x - 3),
            (this._hoverPointer.style.left = `${n}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 = !0));
  }
};
HHe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([VHe(1, N5), VHe(2, OU), VHe(3, _ge), VHe(4, KK)], HHe);
class zHe extends rJ {
  get onMouseOut() {
    return this._onMouseOut.event;
  }
  get isMouseIn() {
    return this._isMouseIn;
  }
  constructor(e, t = 200) {
    (super(),
      (this._elements = e),
      (this._eventDebounceDelay = t),
      (this._isMouseIn = !0),
      (this._mouseTimer = this._register(new jO())),
      (this._onMouseOut = this._register(new QO())));
    for (const n of this._elements)
      (this.onmouseover(n, () => this._onTargetMouseOver()),
        this.onmouseleave(n, () => this._onTargetMouseLeave()));
  }
  _onTargetMouseOver() {
    ((this._isMouseIn = !0), this._mouseTimer.clear());
  }
  _onTargetMouseLeave() {
    ((this._isMouseIn = !1),
      (this._mouseTimer.value = new SM(
        () => this._fireIfMouseOutside(),
        this._eventDebounceDelay,
      )));
  }
  _fireIfMouseOutside() {
    this._isMouseIn || this._onMouseOut.fire();
  }
}
class UHe {
  constructor(e) {
    ((this._element = e), (this.targetElements = [this._element]));
  }
  dispose() {}
}
var $He;
function qHe(e, t, n) {
  const i = n.mode === $He.ALIGN ? n.offset : n.offset + n.size,
    r = n.mode === $He.ALIGN ? n.offset + n.size : n.offset;
  return 0 === n.position
    ? t <= e - i
      ? i
      : t <= r
        ? r - t
        : Math.max(e - t, 0)
    : t <= r
      ? r - t
      : t <= e - i
        ? i
        : 0;
}
!(function (e) {
  ((e[(e.AVOID = 0)] = "AVOID"), (e[(e.ALIGN = 1)] = "ALIGN"));
})($He || ($He = {}));
class KHe extends PO {
  static {
    this.BUBBLE_UP_EVENTS = ["click", "keydown", "focus", "blur"];
  }
  static {
    this.BUBBLE_DOWN_EVENTS = ["click"];
  }
  constructor(e, t) {
    (super(),
      (this.container = null),
      (this.useFixedPosition = !1),
      (this.useShadowDOM = !1),
      (this.delegate = null),
      (this.toDisposeOnClean = PO.None),
      (this.toDisposeOnSetContainer = PO.None),
      (this.shadowRoot = null),
      (this.shadowRootHostElement = null),
      (this.view = VB(".context-view")),
      HB(this.view),
      this.setContainer(e, t),
      this._register(MO(() => this.setContainer(null, 1))));
  }
  setContainer(e, t) {
    this.useFixedPosition = 1 !== t;
    const n = this.useShadowDOM;
    if (
      ((this.useShadowDOM = 3 === t),
      (e !== this.container || n !== this.useShadowDOM) &&
        (this.container &&
          (this.toDisposeOnSetContainer.dispose(),
          this.view.remove(),
          this.shadowRoot &&
            ((this.shadowRoot = null),
            this.shadowRootHostElement?.remove(),
            (this.shadowRootHostElement = null)),
          (this.container = null)),
        e))
    ) {
      if (((this.container = e), this.useShadowDOM)) {
        ((this.shadowRootHostElement = VB(".shadow-root-host")),
          this.container.appendChild(this.shadowRootHostElement),
          (this.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: "open" })));
        const e = document.createElement("style");
        ((e.textContent = GHe),
          this.shadowRoot.appendChild(e),
          this.shadowRoot.appendChild(this.view),
          this.shadowRoot.appendChild(VB("slot")));
      } else this.container.appendChild(this.view);
      const t = new AO();
      (KHe.BUBBLE_UP_EVENTS.forEach((e) => {
        t.add(
          KF(this.container, e, (e) => {
            this.onDOMEvent(e, !1);
          }),
        );
      }),
        KHe.BUBBLE_DOWN_EVENTS.forEach((e) => {
          t.add(
            KF(
              this.container,
              e,
              (e) => {
                this.onDOMEvent(e, !0);
              },
              !0,
            ),
          );
        }),
        (this.toDisposeOnSetContainer = t));
    }
  }
  show(e) {
    (this.isVisible() && this.hide(),
      zF(this.view),
      (this.view.className = "context-view monaco-component"),
      (this.view.style.top = "0px"),
      (this.view.style.left = "0px"),
      (this.view.style.zIndex = `${2575 + (e.layer ?? 0)}`),
      (this.view.style.position = this.useFixedPosition ? "fixed" : "absolute"),
      WB(this.view),
      (this.toDisposeOnClean = e.render(this.view) || PO.None),
      (this.delegate = e),
      this.doLayout(),
      this.delegate.focus?.());
  }
  getViewElement() {
    return this.view;
  }
  layout() {
    this.isVisible() &&
      (!1 !== this.delegate.canRelayout || (WR && iO)
        ? (this.delegate?.layout?.(), this.doLayout())
        : this.hide());
  }
  doLayout() {
    if (!this.isVisible()) return;
    const e = this.delegate.getAnchor();
    let t;
    if (SB(e)) {
      const n = aB(e),
        i = lB(e);
      t = { top: n.top * i, left: n.left * i, width: n.width * i, height: n.height * i };
    } else
      t = (function (e) {
        const t = e;
        return !!t && "number" == typeof t.x && "number" == typeof t.y;
      })(e)
        ? { top: e.y, left: e.x, width: e.width || 1, height: e.height || 2 }
        : { top: e.posy, left: e.posx, width: 2, height: 2 };
    const n = cB(this.view),
      i = hB(this.view),
      r = this.delegate.anchorPosition ?? 0,
      o = this.delegate.anchorAlignment ?? 0,
      s = this.delegate.anchorAxisAlignment ?? 0;
    let a, l;
    const c = wB();
    if (0 === s) {
      const e = { offset: t.top - c.pageYOffset, size: t.height, position: 0 === r ? 0 : 1 },
        s = { offset: t.left, size: t.width, position: 0 === o ? 0 : 1, mode: $He.ALIGN };
      ((a = qHe(c.innerHeight, i, e) + c.pageYOffset),
        Eae.intersects({ start: a, end: a + i }, { start: e.offset, end: e.offset + e.size }) &&
          (s.mode = $He.AVOID),
        (l = qHe(c.innerWidth, n, s)));
    } else {
      const e = { offset: t.left, size: t.width, position: 0 === o ? 0 : 1 },
        s = { offset: t.top, size: t.height, position: 0 === r ? 0 : 1, mode: $He.ALIGN };
      ((l = qHe(c.innerWidth, n, e)),
        Eae.intersects({ start: l, end: l + n }, { start: e.offset, end: e.offset + e.size }) &&
          (s.mode = $He.AVOID),
        (a = qHe(c.innerHeight, i, s) + c.pageYOffset));
    }
    (this.view.classList.remove("top", "bottom", "left", "right"),
      this.view.classList.add(0 === r ? "bottom" : "top"),
      this.view.classList.add(0 === o ? "left" : "right"),
      this.view.classList.toggle("fixed", this.useFixedPosition));
    const d = aB(this.container),
      u = this.container.scrollTop || 0,
      h = this.container.scrollLeft || 0;
    ((this.view.style.top = `${a - (this.useFixedPosition ? aB(this.view).top : d.top) + u}px`),
      (this.view.style.left = `${l - (this.useFixedPosition ? aB(this.view).left : d.left) + h}px`),
      (this.view.style.width = "initial"));
  }
  hide(e) {
    const t = this.delegate;
    ((this.delegate = null),
      t?.onHide && t.onHide(e),
      this.toDisposeOnClean.dispose(),
      HB(this.view));
  }
  isVisible() {
    return !!this.delegate;
  }
  onDOMEvent(e, t) {
    this.delegate &&
      (this.delegate.onDOMEvent
        ? this.delegate.onDOMEvent(e, MF(e).document.activeElement)
        : t && !gB(e.target, this.container) && this.hide());
  }
  dispose() {
    (this.hide(), super.dispose());
  }
}
const GHe =
  '\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Nanum Gothic", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t: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; }\n\t: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; }\n\t: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; }\n\t: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; }\n';
let ZHe = class extends PO {
  constructor(e) {
    (super(),
      (this.layoutService = e),
      (this.contextView = this._register(new KHe(this.layoutService.mainContainer, 1))),
      this.layout(),
      this._register(e.onDidLayoutContainer(() => this.layout())));
  }
  showContextView(e, t, n) {
    let i;
    ((i = t ? (t === this.layoutService.getContainer(MF(t)) ? 1 : n ? 3 : 2) : 1),
      this.contextView.setContainer(t ?? this.layoutService.activeContainer, i),
      this.contextView.show(e));
    const r = {
      close: () => {
        this.openContextView === r && this.hideContextView();
      },
    };
    return ((this.openContextView = r), r);
  }
  layout() {
    this.contextView.layout();
  }
  hideContextView(e) {
    (this.contextView.hide(e), (this.openContextView = void 0));
  }
};
ZHe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, bpe),
  ],
  ZHe,
);
class YHe extends ZHe {
  getContextViewElement() {
    return this.contextView.getViewElement();
  }
}
function XHe(e) {
  return "object" == typeof e && "markdown" in e && "markdownNotSupportedFallback" in e;
}
class QHe {
  constructor(e, t, n) {
    ((this.hoverDelegate = e), (this.target = t), (this.fadeInAnimation = n));
  }
  async update(e, t, n) {
    if (
      (this._cancellationTokenSource &&
        (this._cancellationTokenSource.dispose(!0), (this._cancellationTokenSource = void 0)),
      this.isDisposed)
    )
      return;
    let i;
    if (oR(e) || SB(e) || void 0 === e) i = e;
    else {
      this._cancellationTokenSource = new cM();
      const r = this._cancellationTokenSource.token;
      let o;
      if (
        ((o = XHe(e)
          ? mR(e.markdown)
            ? e.markdown(r).then((t) => t ?? e.markdownNotSupportedFallback)
            : (e.markdown ?? e.markdownNotSupportedFallback)
          : e.element(r)),
        o instanceof Promise
          ? (this._hoverWidget || this.show(SI(1700, "Loading..."), t, n), (i = await o))
          : (i = o),
        this.isDisposed || r.isCancellationRequested)
      )
        return;
    }
    this.show(i, t, n);
  }
  show(e, t, n) {
    const i = this._hoverWidget;
    if (this.hasContent(e)) {
      const r = {
        content: e,
        target: this.target,
        actions: n?.actions,
        linkHandler: n?.linkHandler,
        trapFocus: n?.trapFocus,
        appearance: {
          showPointer: "element" === this.hoverDelegate.placement,
          skipFadeInAnimation: !this.fadeInAnimation || !!i,
          showHoverHint: n?.appearance?.showHoverHint,
        },
        position: { hoverPosition: 2 },
      };
      this._hoverWidget = this.hoverDelegate.showHover(r, t);
    }
    i?.dispose();
  }
  hasContent(e) {
    return !!e && (!sre(e) || !!e.value);
  }
  get isDisposed() {
    return this._hoverWidget?.isDisposed;
  }
  dispose() {
    (this._hoverWidget?.dispose(),
      this._cancellationTokenSource?.dispose(!0),
      (this._cancellationTokenSource = void 0));
  }
}
var JHe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let eze = class extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._instantiationService = e),
      (this._configurationService = t),
      (this._keybindingService = i),
      (this._layoutService = r),
      (this._accessibilityService = o),
      (this._currentDelayedHoverWasShown = !1),
      (this._delayedHovers = new Map()),
      (this._managedHovers = new Map()),
      this._register(n.onDidShowContextMenu(() => this.hideHover())),
      (this._contextViewHandler = this._register(new ZHe(this._layoutService))),
      this._register(
        DW.registerCommandAndKeybindingRule({
          id: "workbench.action.showHover",
          weight: 0,
          primary: gO(2089, 2087),
          handler: () => {
            this._showAndFocusHoverForActiveElement();
          },
        }),
      ));
  }
  showInstantHover(e, t, n, i) {
    const r = this._createHover(e, n);
    if (r) return (this._showHover(r, e, t), r);
  }
  showDelayedHover(e, t) {
    if (
      (void 0 === e.id && (e.id = nze(e.content)),
      !this._currentDelayedHover || this._currentDelayedHoverWasShown)
    ) {
      if (this._currentHover?.isLocked) return;
      if (tze(this._currentHoverOptions) === tze(e)) return this._currentHover;
      if (
        this._currentHover &&
        !this._currentHover.isDisposed &&
        void 0 !== this._currentDelayedHoverGroupId &&
        this._currentDelayedHoverGroupId === t?.groupId
      )
        return this.showInstantHover({
          ...e,
          appearance: { ...e.appearance, skipFadeInAnimation: !0 },
        });
    } else if (this._currentDelayedHover && tze(this._currentHoverOptions) === tze(e))
      return this._currentDelayedHover;
    const n = this._createHover(e, void 0);
    return n
      ? ((this._currentDelayedHover = n),
        (this._currentDelayedHoverWasShown = !1),
        (this._currentDelayedHoverGroupId = t?.groupId),
        vM(this._configurationService.getValue("workbench.hover.delay")).then(() => {
          n && !n.isDisposed && ((this._currentDelayedHoverWasShown = !0), this._showHover(n, e));
        }),
        n)
      : ((this._currentDelayedHover = void 0),
        (this._currentDelayedHoverWasShown = !1),
        void (this._currentDelayedHoverGroupId = void 0));
  }
  setupDelayedHover(e, t, n) {
    return this._setupDelayedHover(
      e,
      () => ({ ...("function" == typeof t ? t() : t), target: e }),
      n,
    );
  }
  setupDelayedHoverAtMouse(e, t, n) {
    return this._setupDelayedHover(
      e,
      (n) => ({
        ...("function" == typeof t ? t() : t),
        target: { targetElements: [e], x: void 0 !== n ? n.x + 10 : void 0 },
      }),
      n,
    );
  }
  _setupDelayedHover(e, t, n) {
    const i = new AO();
    return (
      i.add(
        $F(e, DB.MOUSE_OVER, (e) => {
          this.showDelayedHover(t(e), { groupId: n?.groupId });
        }),
      ),
      n?.setupKeyboardEvents &&
        i.add(
          $F(e, DB.KEY_DOWN, (e) => {
            const n = new wO(e);
            (n.equals(10) || n.equals(3)) && this.showInstantHover(t(), !0);
          }),
        ),
      this._delayedHovers.set(e, {
        show: (e) => {
          this.showInstantHover(t(), e);
        },
      }),
      i.add(MO(() => this._delayedHovers.delete(e))),
      i
    );
  }
  _createHover(e, t) {
    if (((this._currentDelayedHover = void 0), "" === e.content)) return;
    if (this._currentHover?.isLocked) return;
    if ((void 0 === e.id && (e.id = nze(e.content)), tze(this._currentHoverOptions) === tze(e)))
      return;
    ((this._currentHoverOptions = e), (this._lastHoverOptions = e));
    const n = e.trapFocus || this._accessibilityService.isScreenReaderOptimized(),
      i = vB();
    t ||
      (n && i
        ? i.classList.contains("monaco-hover") || (this._lastFocusedElementBeforeOpen = i)
        : (this._lastFocusedElementBeforeOpen = void 0));
    const r = new AO(),
      o = this._instantiationService.createInstance(HHe, e);
    if (
      (e.persistence?.sticky && (o.isLocked = !0),
      e.position?.hoverPosition &&
        !lR(e.position.hoverPosition) &&
        (e.target = {
          targetElements: SB(e.target) ? [e.target] : e.target.targetElements,
          x: e.position.hoverPosition.x + 10,
        }),
      o.onDispose(
        () => {
          (this._currentHover?.domNode &&
            yB(this._currentHover.domNode) &&
            this._lastFocusedElementBeforeOpen?.focus(),
            tze(this._currentHoverOptions) === tze(e) && this.doHideHover(),
            r.dispose());
        },
        void 0,
        r,
      ),
      !e.container)
    ) {
      const t = SB(e.target) ? e.target : e.target.targetElements[0];
      e.container = this._layoutService.getContainer(MF(t));
    }
    if (
      (o.onRequestLayout(() => this._contextViewHandler.layout(), void 0, r), e.persistence?.sticky)
    )
      r.add(
        $F(MF(e.container).document, DB.MOUSE_DOWN, (e) => {
          gB(e.target, o.domNode) || this.doHideHover();
        }),
      );
    else {
      if ("targetElements" in e.target)
        for (const n of e.target.targetElements) r.add($F(n, DB.CLICK, () => this.hideHover()));
      else r.add($F(e.target, DB.CLICK, () => this.hideHover()));
      const t = vB();
      if (t) {
        const n = MF(t).document;
        (r.add($F(t, DB.KEY_DOWN, (t) => this._keyDown(t, o, !!e.persistence?.hideOnKeyDown))),
          r.add($F(n, DB.KEY_DOWN, (t) => this._keyDown(t, o, !!e.persistence?.hideOnKeyDown))),
          r.add($F(t, DB.KEY_UP, (e) => this._keyUp(e, o))),
          r.add($F(n, DB.KEY_UP, (e) => this._keyUp(e, o))));
      }
    }
    if ("IntersectionObserver" in NI) {
      const t = new IntersectionObserver((e) => this._intersectionChange(e, o), { threshold: 0 }),
        n = "targetElements" in e.target ? e.target.targetElements[0] : e.target;
      (t.observe(n), r.add(MO(() => t.disconnect())));
    }
    return ((this._currentHover = o), o);
  }
  _showHover(e, t, n) {
    this._contextViewHandler.showContextView(new rze(e, n), t.container);
  }
  hideHover(e) {
    (!e && this._currentHover?.isLocked) || !this._currentHoverOptions || this.doHideHover();
  }
  doHideHover() {
    ((this._currentHover = void 0),
      (this._currentHoverOptions = void 0),
      this._contextViewHandler.hideContextView());
  }
  _intersectionChange(e, t) {
    e[e.length - 1].isIntersecting || t.dispose();
  }
  showAndFocusLastHover() {
    this._lastHoverOptions && this.showInstantHover(this._lastHoverOptions, !0, !0);
  }
  _showAndFocusHoverForActiveElement() {
    let e = vB();
    for (; e; ) {
      const t = this._delayedHovers.get(e) ?? this._managedHovers.get(e);
      if (t) return void t.show(!0);
      e = e.parentElement;
    }
  }
  _keyDown(e, t, n) {
    if ("Alt" === e.key) return void (t.isLocked = !0);
    const i = new wO(e);
    this._keybindingService
      .resolveKeyboardEvent(i)
      .getSingleModifierDispatchChords()
      .some((e) => !!e) ||
      0 !== this._keybindingService.softDispatch(i, i.target).kind ||
      !n ||
      (this._currentHoverOptions?.trapFocus && "Tab" === e.key) ||
      (this.hideHover(), this._lastFocusedElementBeforeOpen?.focus());
  }
  _keyUp(e, t) {
    "Alt" === e.key &&
      ((t.isLocked = !1),
      t.isMouseIn || (this.hideHover(), this._lastFocusedElementBeforeOpen?.focus()));
  }
  setupManagedHover(e, t, n, i) {
    if (e.showNativeHover)
      return (function (e, t) {
        function n(t) {
          t ? e.setAttribute("title", t) : e.removeAttribute("title");
        }
        return (
          n(ize(t)),
          { update: (e) => n(ize(e)), show: () => {}, hide: () => {}, dispose: () => n(void 0) }
        );
      })(t, n);
    let r, o;
    (t.setAttribute("custom-hover", "true"), "" !== t.title && (t.title = ""));
    const s = (t, n) => {
        const i = void 0 !== o;
        (t && (o?.dispose(), (o = void 0)),
          n && (r?.dispose(), (r = void 0)),
          i && (e.onDidHideHover?.(), (o = void 0)));
      },
      a = (r, s, a, l) =>
        new SM(async () => {
          (o && !o.isDisposed) ||
            ((o = new QHe(e, a || t, r > 0)),
            await o.update("function" == typeof n ? n() : n, s, { ...i, trapFocus: l }));
        }, r),
      l = new AO();
    let c = !1;
    (l.add(
      $F(
        t,
        DB.MOUSE_DOWN,
        () => {
          ((c = !0), s(!0, !0));
        },
        !0,
      ),
    ),
      l.add(
        $F(
          t,
          DB.MOUSE_UP,
          () => {
            c = !1;
          },
          !0,
        ),
      ),
      l.add(
        $F(
          t,
          DB.MOUSE_LEAVE,
          (e) => {
            ((c = !1), s(!1, e.fromElement === t));
          },
          !0,
        ),
      ),
      l.add(
        $F(
          t,
          DB.MOUSE_OVER,
          (i) => {
            if (r) return;
            const o = new AO(),
              l = { targetElements: [t], dispose: () => {} };
            if (void 0 === e.placement || "mouse" === e.placement) {
              const e = (e) => {
                ((l.x = e.x + 10), oze(e, t) || s(!0, !0));
              };
              o.add($F(t, DB.MOUSE_MOVE, e, !0));
            }
            ((r = o),
              oze(i, t) && o.add(a("function" == typeof e.delay ? e.delay(n) : e.delay, !1, l)));
          },
          !0,
        ),
      ));
    const d = (i) => {
      if (c || r) return;
      if (!oze(i, t)) return;
      const o = { targetElements: [t], dispose: () => {} },
        l = new AO();
      (l.add($F(t, DB.BLUR, () => s(!0, !0), !0)),
        l.add(a("function" == typeof e.delay ? e.delay(n) : e.delay, !1, o)),
        (r = l));
    };
    YB(t) || l.add($F(t, DB.FOCUS, d, !0));
    const u = {
      show: (e) => {
        (s(!1, !0), a(0, e, void 0, e));
      },
      hide: () => {
        s(!0, !0);
      },
      update: async (e, t) => {
        ((n = e), await o?.update(n, void 0, t));
      },
      dispose: () => {
        (this._managedHovers.delete(t), l.dispose(), s(!0, !0));
      },
    };
    return (this._managedHovers.set(t, u), u);
  }
  showManagedHover(e) {
    const t = this._managedHovers.get(e);
    t && t.show(!0);
  }
  dispose() {
    (this._managedHovers.forEach((e) => e.dispose()), super.dispose());
  }
};
function tze(e) {
  if (void 0 !== e) return e?.id ?? e;
}
function nze(e) {
  if (!SB(e)) return "string" == typeof e ? e.toString() : e.value;
}
function ize(e) {
  const t = "function" == typeof e ? e() : e;
  return oR(t) ? Jie(t) : XHe(t) ? t.markdownNotSupportedFallback : void 0;
}
eze = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([JHe(0, vV), JHe(1, OU), JHe(2, cde), JHe(3, N5), JHe(4, bpe), JHe(5, KK)], eze);
class rze {
  get anchorPosition() {
    return this._hover.anchor;
  }
  constructor(e, t = !1) {
    ((this._hover = e), (this._focus = t), (this.layer = 1));
  }
  render(e) {
    return (this._hover.render(e), this._focus && this._hover.focus(), this._hover);
  }
  getAnchor() {
    return { x: this._hover.x, y: this._hover.y };
  }
  layout() {
    this._hover.layout();
  }
}
function oze(e, t) {
  return (
    SB(e.target) &&
    (function (e, t) {
      t = t ?? MF(e).document.body;
      for (; !e.hasAttribute("custom-hover") && e !== t; ) e = e.parentElement;
      return e;
    })(e.target, t) === t
  );
}
function sze(e) {
  return Object.isFrozen(e)
    ? e
    : (function (e) {
        if (!e || "object" != typeof e) return e;
        const t = [e];
        for (; t.length > 0; ) {
          const e = t.shift();
          Object.freeze(e);
          for (const n in e)
            if (Bz.call(e, n)) {
              const i = e[n];
              "object" != typeof i || Object.isFrozen(i) || aR(i) || t.push(i);
            }
        }
        return e;
      })(e);
}
(HU(Xue, eze, 1),
  _0((e, t) => {
    const n = e.getColor(bZ);
    n &&
      (t.addRule(
        `.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${n.transparent(0.5)}; }`,
      ),
      t.addRule(
        `.monaco-hover.workbench-hover hr { border-top: 1px solid ${n.transparent(0.5)}; }`,
      ));
  }));
class aze {
  static createEmptyModel(e) {
    return new aze({}, [], [], void 0, e);
  }
  constructor(e, t, n, i, r) {
    ((this._contents = e),
      (this._keys = t),
      (this._overrides = n),
      (this.raw = i),
      (this.logService = r),
      (this.overrideConfigurations = new Map()));
  }
  get rawConfiguration() {
    if (!this._rawConfiguration)
      if (this.raw) {
        const e = (Array.isArray(this.raw) ? this.raw : [this.raw]).map((e) => {
          if (e instanceof aze) return e;
          const t = new lze("", this.logService);
          return (t.parseRaw(e), t.configurationModel);
        });
        this._rawConfiguration = e.reduce((e, t) => (t === e ? t : e.merge(t)), e[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 (
      0 === this._keys.length &&
      0 === Object.keys(this._contents).length &&
      0 === this._overrides.length
    );
  }
  getValue(e) {
    return e ? FU(this.contents, e) : this.contents;
  }
  inspect(e, t) {
    const n = this;
    return {
      get value() {
        return sze(n.rawConfiguration.getValue(e));
      },
      get override() {
        return t ? sze(n.rawConfiguration.getOverrideValue(e, t)) : void 0;
      },
      get merged() {
        return sze(t ? n.rawConfiguration.override(t).getValue(e) : n.rawConfiguration.getValue(e));
      },
      get overrides() {
        const t = [];
        for (const { contents: i, identifiers: r, keys: o } of n.rawConfiguration.overrides) {
          const s = new aze(i, o, [], void 0, n.logService).getValue(e);
          void 0 !== s && t.push({ identifiers: r, value: s });
        }
        return t.length ? sze(t) : void 0;
      },
    };
  }
  getOverrideValue(e, t) {
    const n = this.getContentsForOverrideIdentifer(t);
    return n ? (e ? FU(n, e) : n) : void 0;
  }
  override(e) {
    let t = this.overrideConfigurations.get(e);
    return (
      t || ((t = this.createOverrideConfigurationModel(e)), this.overrideConfigurations.set(e, t)),
      t
    );
  }
  merge(...e) {
    const t = Fz(this.contents),
      n = Fz(this.overrides),
      i = [...this.keys],
      r = this.raw ? (Array.isArray(this.raw) ? [...this.raw] : [this.raw]) : [this];
    for (const o of e)
      if ((r.push(...(o.raw ? (Array.isArray(o.raw) ? o.raw : [o.raw]) : [o])), !o.isEmpty())) {
        this.mergeContents(t, o.contents);
        for (const e of o.overrides) {
          const [t] = n.filter((t) => XP(t.identifiers, e.identifiers));
          t
            ? (this.mergeContents(t.contents, e.contents),
              t.keys.push(...e.keys),
              (t.keys = lj(t.keys)))
            : n.push(Fz(e));
        }
        for (const e of o.keys) -1 === i.indexOf(e) && i.push(e);
      }
    return new aze(
      t,
      i,
      n,
      !r.length || r.every((e) => e instanceof aze) ? void 0 : r,
      this.logService,
    );
  }
  createOverrideConfigurationModel(e) {
    const t = this.getContentsForOverrideIdentifer(e);
    if (!t || "object" != typeof t || !Object.keys(t).length) return this;
    const n = {};
    for (const i of lj([...Object.keys(this.contents), ...Object.keys(t)])) {
      let e = this.contents[i];
      const r = t[i];
      (r &&
        ("object" == typeof e && "object" == typeof r
          ? ((e = Fz(e)), this.mergeContents(e, r))
          : (e = r)),
        (n[i] = e));
    }
    return new aze(n, this.keys, this.overrides, void 0, this.logService);
  }
  mergeContents(e, t) {
    for (const n of Object.keys(t))
      n in e && sR(e[n]) && sR(t[n]) ? this.mergeContents(e[n], t[n]) : (e[n] = Fz(t[n]));
  }
  getContentsForOverrideIdentifer(e) {
    let t = null,
      n = null;
    const i = (e) => {
      e && (n ? this.mergeContents(n, e) : (n = Fz(e)));
    };
    for (const r of this.overrides)
      1 === r.identifiers.length && r.identifiers[0] === e
        ? (t = r.contents)
        : r.identifiers.includes(e) && i(r.contents);
    return (i(t), n);
  }
  toJSON() {
    return { contents: this.contents, overrides: this.overrides, keys: this.keys };
  }
  setValue(e, t) {
    this.updateValue(e, t, !1);
  }
  removeValue(e) {
    const t = this.keys.indexOf(e);
    -1 !== t &&
      (this.keys.splice(t, 1),
      PU(this.contents, e),
      t$.test(e) &&
        this.overrides.splice(
          this.overrides.findIndex((t) => XP(t.identifiers, n$(e))),
          1,
        ));
  }
  updateValue(e, t, n) {
    if (
      (AU(this.contents, e, t, (e) => this.logService.error(e)),
      (n = n || -1 === this.keys.indexOf(e)) && this.keys.push(e),
      t$.test(e))
    ) {
      const t = n$(e),
        n = {
          identifiers: t,
          keys: Object.keys(this.contents[e]),
          contents: MU(this.contents[e], (e) => this.logService.error(e)),
        },
        i = this.overrides.findIndex((e) => XP(e.identifiers, t));
      -1 !== i ? (this.overrides[i] = n) : this.overrides.push(n);
    }
  }
}
class lze {
  constructor(e, t) {
    ((this._name = e),
      (this.logService = t),
      (this._raw = null),
      (this._configurationModel = null),
      (this._restrictedConfigurations = []));
  }
  get configurationModel() {
    return this._configurationModel || aze.createEmptyModel(this.logService);
  }
  parseRaw(e, t) {
    this._raw = e;
    const {
      contents: n,
      keys: i,
      overrides: r,
      restricted: o,
      hasExcludedProperties: s,
    } = this.doParseRaw(e, t);
    ((this._configurationModel = new aze(n, i, r, s ? [e] : void 0, this.logService)),
      (this._restrictedConfigurations = o || []));
  }
  doParseRaw(e, t) {
    const n = NW.as(YU),
      i = n.getConfigurationProperties(),
      r = n.getExcludedConfigurationProperties(),
      o = this.filter(e, i, r, !0, t),
      s = MU((e = o.raw), (e) =>
        this.logService.error(`Conflict in settings file ${this._name}: ${e}`),
      ),
      a = Object.keys(e),
      l = this.toOverrides(e, (e) =>
        this.logService.error(`Conflict in settings file ${this._name}: ${e}`),
      );
    return {
      contents: s,
      keys: a,
      overrides: l,
      restricted: o.restricted,
      hasExcludedProperties: o.hasExcludedProperties,
    };
  }
  filter(e, t, n, i, r) {
    let o = !1;
    if (!(r?.scopes || r?.skipRestricted || r?.skipUnregistered || r?.exclude?.length))
      return { raw: e, restricted: [], hasExcludedProperties: o };
    const s = {},
      a = [];
    for (const l in e)
      if (t$.test(l) && i) {
        const i = this.filter(e[l], t, n, !1, r);
        ((s[l] = i.raw), (o = o || i.hasExcludedProperties), a.push(...i.restricted));
      } else {
        const i = t[l];
        (i?.restricted && a.push(l), this.shouldInclude(l, i, n, r) ? (s[l] = e[l]) : (o = !0));
      }
    return { raw: s, restricted: a, hasExcludedProperties: o };
  }
  shouldInclude(e, t, n, i) {
    if (i.exclude?.includes(e)) return !1;
    if (i.include?.includes(e)) return !0;
    if (i.skipRestricted && t?.restricted) return !1;
    if (i.skipUnregistered && !t) return !1;
    const r = t ?? n[e],
      o = r ? (void 0 !== r.scope ? r.scope : 4) : void 0;
    return void 0 === o || void 0 === i.scopes || i.scopes.includes(o);
  }
  toOverrides(e, t) {
    const n = [];
    for (const i of Object.keys(e))
      if (t$.test(i)) {
        const r = {};
        for (const t in e[i]) r[t] = e[i][t];
        n.push({ identifiers: n$(i), keys: Object.keys(r), contents: MU(r, t) });
      }
    return n;
  }
}
class cze {
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h) {
    ((this.key = e),
      (this.overrides = t),
      (this._value = n),
      (this.overrideIdentifiers = i),
      (this.defaultConfiguration = r),
      (this.policyConfiguration = o),
      (this.applicationConfiguration = s),
      (this.userConfiguration = a),
      (this.localUserConfiguration = l),
      (this.remoteUserConfiguration = c),
      (this.workspaceConfiguration = d),
      (this.folderConfigurationModel = u),
      (this.memoryConfigurationModel = h));
  }
  toInspectValue(e) {
    return void 0 !== e?.value || void 0 !== e?.override || void 0 !== e?.overrides ? e : 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);
  }
}
class dze {
  constructor(e, t, n, i, r, o, s, a, l, c) {
    ((this._defaultConfiguration = e),
      (this._policyConfiguration = t),
      (this._applicationConfiguration = n),
      (this._localUserConfiguration = i),
      (this._remoteUserConfiguration = r),
      (this._workspaceConfiguration = o),
      (this._folderConfigurations = s),
      (this._memoryConfiguration = a),
      (this._memoryConfigurationByResource = l),
      (this.logService = c),
      (this._workspaceConsolidatedConfiguration = null),
      (this._foldersConsolidatedConfigurations = new KW()),
      (this._userConfiguration = null));
  }
  getValue(e, t, n) {
    return this.getConsolidatedConfigurationModel(e, t, n).getValue(e);
  }
  updateValue(e, t, n = {}) {
    let i;
    (n.resource
      ? ((i = this._memoryConfigurationByResource.get(n.resource)),
        i ||
          ((i = aze.createEmptyModel(this.logService)),
          this._memoryConfigurationByResource.set(n.resource, i)))
      : (i = this._memoryConfiguration),
      void 0 === t ? i.removeValue(e) : i.setValue(e, t),
      n.resource || (this._workspaceConsolidatedConfiguration = null));
  }
  inspect(e, t, n) {
    const i = this.getConsolidatedConfigurationModel(e, t, n),
      r = this.getFolderConfigurationModelForResource(t.resource, n),
      o =
        (t.resource && this._memoryConfigurationByResource.get(t.resource)) ||
        this._memoryConfiguration,
      s = new Set();
    for (const a of i.overrides)
      for (const t of a.identifiers) void 0 !== i.getOverrideValue(e, t) && s.add(t);
    return new cze(
      e,
      t,
      i.getValue(e),
      s.size ? [...s] : void 0,
      this._defaultConfiguration,
      this._policyConfiguration.isEmpty() ? void 0 : this._policyConfiguration,
      this.applicationConfiguration.isEmpty() ? void 0 : this.applicationConfiguration,
      this.userConfiguration,
      this.localUserConfiguration,
      this.remoteUserConfiguration,
      n ? this._workspaceConfiguration : void 0,
      r || void 0,
      o,
    );
  }
  get applicationConfiguration() {
    return this._applicationConfiguration;
  }
  get userConfiguration() {
    if (!this._userConfiguration)
      if (this._remoteUserConfiguration.isEmpty())
        this._userConfiguration = this._localUserConfiguration;
      else {
        const e = this._localUserConfiguration.merge(this._remoteUserConfiguration);
        this._userConfiguration = new aze(e.contents, e.keys, e.overrides, void 0, this.logService);
      }
    return this._userConfiguration;
  }
  get localUserConfiguration() {
    return this._localUserConfiguration;
  }
  get remoteUserConfiguration() {
    return this._remoteUserConfiguration;
  }
  getConsolidatedConfigurationModel(e, t, n) {
    let i = this.getConsolidatedConfigurationModelForResource(t, n);
    if (
      (t.overrideIdentifier && (i = i.override(t.overrideIdentifier)),
      !this._policyConfiguration.isEmpty() && void 0 !== this._policyConfiguration.getValue(e))
    ) {
      i = i.merge();
      for (const e of this._policyConfiguration.keys)
        i.setValue(e, this._policyConfiguration.getValue(e));
    }
    return i;
  }
  getConsolidatedConfigurationModelForResource({ resource: e }, t) {
    let n = this.getWorkspaceConsolidatedConfiguration();
    if (t && e) {
      const i = t.getFolder(e);
      i && (n = this.getFolderConsolidatedConfiguration(i.uri) || n);
      const r = this._memoryConfigurationByResource.get(e);
      r && (n = n.merge(r));
    }
    return n;
  }
  getWorkspaceConsolidatedConfiguration() {
    return (
      this._workspaceConsolidatedConfiguration ||
        (this._workspaceConsolidatedConfiguration = this._defaultConfiguration.merge(
          this.applicationConfiguration,
          this.userConfiguration,
          this._workspaceConfiguration,
          this._memoryConfiguration,
        )),
      this._workspaceConsolidatedConfiguration
    );
  }
  getFolderConsolidatedConfiguration(e) {
    let t = this._foldersConsolidatedConfigurations.get(e);
    if (!t) {
      const n = this.getWorkspaceConsolidatedConfiguration(),
        i = this._folderConfigurations.get(e);
      i ? ((t = n.merge(i)), this._foldersConsolidatedConfigurations.set(e, t)) : (t = n);
    }
    return t;
  }
  getFolderConfigurationModelForResource(e, t) {
    if (t && e) {
      const n = t.getFolder(e);
      if (n) return this._folderConfigurations.get(n.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((e, t) => {
        const { contents: n, overrides: i, keys: r } = this._folderConfigurations.get(t);
        return (e.push([t, { contents: n, overrides: i, keys: r }]), e);
      }, []),
    };
  }
  static parse(e, t) {
    const n = this.parseConfigurationModel(e.defaults, t),
      i = this.parseConfigurationModel(e.policy, t),
      r = this.parseConfigurationModel(e.application, t),
      o = this.parseConfigurationModel(e.userLocal, t),
      s = this.parseConfigurationModel(e.userRemote, t),
      a = this.parseConfigurationModel(e.workspace, t),
      l = e.folders.reduce(
        (e, n) => (e.set(mP.revive(n[0]), this.parseConfigurationModel(n[1], t)), e),
        new KW(),
      );
    return new dze(n, i, r, o, s, a, l, aze.createEmptyModel(t), new KW(), t);
  }
  static parseConfigurationModel(e, t) {
    return new aze(e.contents, e.keys, e.overrides, e.raw, t);
  }
}
class uze {
  constructor(e, t, n, i, r) {
    ((this.change = e),
      (this.previous = t),
      (this.currentConfiguraiton = n),
      (this.currentWorkspace = i),
      (this.logService = r),
      (this._marker = "\n"),
      (this._markerCode1 = this._marker.charCodeAt(0)),
      (this._markerCode2 = ".".charCodeAt(0)),
      (this.affectedKeys = new Set()),
      (this._previousConfiguration = void 0));
    for (const o of e.keys) this.affectedKeys.add(o);
    for (const [, o] of e.overrides) for (const e of o) this.affectedKeys.add(e);
    this._affectsConfigStr = this._marker;
    for (const o of this.affectedKeys) this._affectsConfigStr += o + this._marker;
  }
  get previousConfiguration() {
    return (
      !this._previousConfiguration &&
        this.previous &&
        (this._previousConfiguration = dze.parse(this.previous.data, this.logService)),
      this._previousConfiguration
    );
  }
  affectsConfiguration(e, t) {
    const n = this._marker + e,
      i = this._affectsConfigStr.indexOf(n);
    if (i < 0) return !1;
    const r = i + n.length;
    if (r >= this._affectsConfigStr.length) return !1;
    const o = this._affectsConfigStr.charCodeAt(r);
    if (o !== this._markerCode1 && o !== this._markerCode2) return !1;
    if (t) {
      return !zz(
        this.previousConfiguration
          ? this.previousConfiguration.getValue(e, t, this.previous?.workspace)
          : void 0,
        this.currentConfiguraiton.getValue(e, t, this.currentWorkspace),
      );
    }
    return !0;
  }
}
const hze = { kind: 0 },
  gze = { kind: 1 };
class pze {
  constructor(e, t, n) {
    ((this._log = n), (this._defaultKeybindings = e), (this._defaultBoundCommands = new Map()));
    for (const i of e) {
      const e = i.command;
      e && "-" !== e.charAt(0) && this._defaultBoundCommands.set(e, !0);
    }
    ((this._map = new Map()),
      (this._lookupMap = new Map()),
      (this._keybindings = pze.handleRemovals([].concat(e).concat(t))));
    for (let i = 0, r = this._keybindings.length; i < r; i++) {
      const e = this._keybindings[i];
      if (0 === e.chords.length) continue;
      const t = e.when?.substituteConstants();
      (t && 0 === t.type) || this._addKeyPress(e.chords[0], e);
    }
  }
  static _isTargetedForRemoval(e, t, n) {
    if (t) for (let i = 0; i < t.length; i++) if (t[i] !== e.chords[i]) return !1;
    if (n && 1 !== n.type) {
      if (!e.when) return !1;
      if (
        !(function (e, t) {
          const n = e ? e.substituteConstants() : void 0,
            i = t ? t.substituteConstants() : void 0;
          return (!n && !i) || (!(!n || !i) && n.equals(i));
        })(n, e.when)
      )
        return !1;
    }
    return !0;
  }
  static handleRemovals(e) {
    const t = new Map();
    for (let i = 0, r = e.length; i < r; i++) {
      const n = e[i];
      if (n.command && "-" === n.command.charAt(0)) {
        const e = n.command.substring(1);
        t.has(e) ? t.get(e).push(n) : t.set(e, [n]);
      }
    }
    if (0 === t.size) return e;
    const n = [];
    for (let i = 0, r = e.length; i < r; i++) {
      const r = e[i];
      if (!r.command || 0 === r.command.length) {
        n.push(r);
        continue;
      }
      if ("-" === r.command.charAt(0)) continue;
      const o = t.get(r.command);
      if (!o || !r.isDefault) {
        n.push(r);
        continue;
      }
      let s = !1;
      for (const e of o) {
        const t = e.when;
        if (this._isTargetedForRemoval(r, e.chords, t)) {
          s = !0;
          break;
        }
      }
      s || n.push(r);
    }
    return n;
  }
  _addKeyPress(e, t) {
    const n = this._map.get(e);
    if (void 0 === n) return (this._map.set(e, [t]), void this._addToLookupMap(t));
    for (let i = n.length - 1; i >= 0; i--) {
      const e = n[i];
      if (e.command === t.command) continue;
      let r = !0;
      for (let n = 1; n < e.chords.length && n < t.chords.length; n++)
        if (e.chords[n] !== t.chords[n]) {
          r = !1;
          break;
        }
      r && pze.whenIsEntirelyIncluded(e.when, t.when) && this._removeFromLookupMap(e);
    }
    (n.push(t), this._addToLookupMap(t));
  }
  _addToLookupMap(e) {
    if (!e.command) return;
    let t = this._lookupMap.get(e.command);
    void 0 === t ? ((t = [e]), this._lookupMap.set(e.command, t)) : t.push(e);
  }
  _removeFromLookupMap(e) {
    if (!e.command) return;
    const t = this._lookupMap.get(e.command);
    if (void 0 !== t)
      for (let n = 0, i = t.length; n < i; n++) if (t[n] === e) return void t.splice(n, 1);
  }
  static whenIsEntirelyIncluded(e, t) {
    return !t || 1 === t.type || (!(!e || 1 === e.type) && SW(e, t));
  }
  getKeybindings() {
    return this._keybindings;
  }
  lookupPrimaryKeybinding(e, t, n = !1) {
    const i = this._lookupMap.get(e);
    if (void 0 === i || 0 === i.length) return null;
    if (1 === i.length && !n) return i[0];
    for (let r = i.length - 1; r >= 0; r--) {
      const e = i[r];
      if (t.contextMatchesRules(e.when)) return e;
    }
    return n ? null : i[i.length - 1];
  }
  resolve(e, t, n) {
    const i = [...t, n];
    this._log(`| Resolving ${i}`);
    const r = this._map.get(i[0]);
    if (void 0 === r) return (this._log("\\ No keybinding entries."), hze);
    let o = null;
    if (i.length < 2) o = r;
    else {
      o = [];
      for (let e = 0, t = r.length; e < t; e++) {
        const t = r[e];
        if (i.length > t.chords.length) continue;
        let n = !0;
        for (let e = 1; e < i.length; e++)
          if (t.chords[e] !== i[e]) {
            n = !1;
            break;
          }
        n && o.push(t);
      }
    }
    const s = this._findCommand(e, o);
    return s
      ? i.length < s.chords.length
        ? (this._log(
            `\\ From ${o.length} keybinding entries, awaiting ${s.chords.length - i.length} more chord(s), when: ${fze(s.when)}, source: ${mze(s)}.`,
          ),
          gze)
        : (this._log(
            `\\ From ${o.length} keybinding entries, matched ${s.command}, when: ${fze(s.when)}, source: ${mze(s)}.`,
          ),
          (a = s.command),
          (l = s.commandArgs),
          (c = s.bubble),
          { kind: 2, commandId: a, commandArgs: l, isBubble: c })
      : (this._log(`\\ From ${o.length} keybinding entries, no when clauses matched the context.`),
        hze);
    var a, l, c;
  }
  _findCommand(e, t) {
    for (let n = t.length - 1; n >= 0; n--) {
      const i = t[n];
      if (pze._contextMatchesRules(e, i.when)) return i;
    }
    return null;
  }
  static _contextMatchesRules(e, t) {
    return !t || t.evaluate(e);
  }
}
function fze(e) {
  return e ? `${e.serialize()}` : "no when condition";
}
function mze(e) {
  return e.extensionId
    ? e.isBuiltinExtension
      ? `built-in extension ${e.extensionId}`
      : `user extension ${e.extensionId}`
    : e.isDefault
      ? "built-in"
      : "user";
}
const _ze = /^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;
class vze extends PO {
  get onDidUpdateKeybindings() {
    return this._onDidUpdateKeybindings ? this._onDidUpdateKeybindings.event : $O.None;
  }
  get inChordMode() {
    return this._currentChords.length > 0;
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this._contextKeyService = e),
      (this._commandService = t),
      (this._telemetryService = n),
      (this._notificationService = i),
      (this._logService = r),
      (this._onDidUpdateKeybindings = this._register(new QO())),
      (this._currentChords = []),
      (this._currentChordChecker = new kM()),
      (this._currentChordStatusMessage = null),
      (this._ignoreSingleModifiers = bze.EMPTY),
      (this._currentSingleModifier = null),
      (this._currentSingleModifierClearTimeout = new SM()),
      (this._currentlyDispatchingCommandId = null),
      (this._logging = !1));
  }
  dispose() {
    super.dispose();
  }
  _log(e) {
    this._logging && this._logService.info(`[KeybindingService]: ${e}`);
  }
  getKeybindings() {
    return this._getResolver().getKeybindings();
  }
  lookupKeybinding(e, t, n = !1) {
    const i = this._getResolver().lookupPrimaryKeybinding(e, t || this._contextKeyService, n);
    if (i) return i.resolvedKeybinding;
  }
  dispatchEvent(e, t) {
    return this._dispatch(e, t);
  }
  softDispatch(e, t) {
    this._log("/ Soft dispatching keyboard event");
    const n = this.resolveKeyboardEvent(e);
    if (n.hasMultipleChords()) return hze;
    const [i] = n.getDispatchChords();
    if (null === i) return (this._log("\\ Keyboard event cannot be dispatched"), hze);
    const r = this._contextKeyService.getContext(t),
      o = this._currentChords.map(({ keypress: e }) => e);
    return this._getResolver().resolve(r, o, i);
  }
  _scheduleLeaveChordMode() {
    const e = Date.now();
    this._currentChordChecker.cancelAndSet(() => {
      this._documentHasFocus()
        ? Date.now() - e > 5e3 && this._leaveChordMode()
        : this._leaveChordMode();
    }, 500);
  }
  _expectAnotherChord(e, t) {
    switch ((this._currentChords.push({ keypress: e, label: t }), this._currentChords.length)) {
      case 0:
        throw ZI("impossible");
      case 1:
        this._currentChordStatusMessage = this._notificationService.status(
          SI(1701, "({0}) was pressed. Waiting for second key of chord...", t),
        );
        break;
      default: {
        const e = this._currentChords.map(({ label: e }) => e).join(", ");
        this._currentChordStatusMessage = this._notificationService.status(
          SI(1702, "({0}) was pressed. Waiting for next key of chord...", e),
        );
      }
    }
    (this._scheduleLeaveChordMode(), E5.enabled && E5.disable());
  }
  _leaveChordMode() {
    (this._currentChordStatusMessage &&
      (this._currentChordStatusMessage.close(), (this._currentChordStatusMessage = null)),
      this._currentChordChecker.cancel(),
      (this._currentChords = []),
      E5.enable());
  }
  _dispatch(e, t) {
    return this._doDispatch(this.resolveKeyboardEvent(e), t, !1);
  }
  _singleModifierDispatch(e, t) {
    const n = this.resolveKeyboardEvent(e),
      [i] = n.getSingleModifierDispatchChords();
    if (i)
      return this._ignoreSingleModifiers.has(i)
        ? (this._log(
            `+ Ignoring single modifier ${i} due to it being pressed together with other keys.`,
          ),
          (this._ignoreSingleModifiers = bze.EMPTY),
          this._currentSingleModifierClearTimeout.cancel(),
          (this._currentSingleModifier = null),
          !1)
        : ((this._ignoreSingleModifiers = bze.EMPTY),
          null === this._currentSingleModifier
            ? (this._log(`+ Storing single modifier for possible chord ${i}.`),
              (this._currentSingleModifier = i),
              this._currentSingleModifierClearTimeout.cancelAndSet(() => {
                (this._log("+ Clearing single modifier due to 300ms elapsed."),
                  (this._currentSingleModifier = null));
              }, 300),
              !1)
            : i === this._currentSingleModifier
              ? (this._log(`/ Dispatching single modifier chord ${i} ${i}`),
                this._currentSingleModifierClearTimeout.cancel(),
                (this._currentSingleModifier = null),
                this._doDispatch(n, t, !0))
              : (this._log(
                  `+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${i}`,
                ),
                this._currentSingleModifierClearTimeout.cancel(),
                (this._currentSingleModifier = null),
                !1));
    const [r] = n.getChords();
    return (
      (this._ignoreSingleModifiers = new bze(r)),
      null !== this._currentSingleModifier &&
        this._log("+ Clearing single modifier due to other key up."),
      this._currentSingleModifierClearTimeout.cancel(),
      (this._currentSingleModifier = null),
      !1
    );
  }
  _doDispatch(e, t, n = !1) {
    let i = !1;
    if (e.hasMultipleChords()) return !1;
    let r = null,
      o = null;
    if (n) {
      const [t] = e.getSingleModifierDispatchChords();
      ((r = t), (o = t ? [t] : []));
    } else (([r] = e.getDispatchChords()), (o = this._currentChords.map(({ keypress: e }) => e)));
    if (null === r)
      return (this._log("\\ Keyboard event cannot be dispatched in keydown phase."), i);
    const s = this._contextKeyService.getContext(t),
      a = e.getLabel(),
      l = this._getResolver().resolve(s, o, r);
    switch (l.kind) {
      case 0:
        if (
          (this._logService.trace("KeybindingService#dispatch", a, "[ No matching keybinding ]"),
          this.inChordMode)
        ) {
          const e = this._currentChords.map(({ label: e }) => e).join(", ");
          (this._log(`+ Leaving multi-chord mode: Nothing bound to "${e}, ${a}".`),
            this._notificationService.status(
              SI(1703, "The key combination ({0}, {1}) is not a command.", e, a),
              { hideAfter: 1e4 },
            ),
            this._leaveChordMode(),
            (i = !0));
        }
        return i;
      case 1:
        return (
          this._logService.trace(
            "KeybindingService#dispatch",
            a,
            "[ Several keybindings match - more chords needed ]",
          ),
          (i = !0),
          this._expectAnotherChord(r, a),
          this._log(
            1 === this._currentChords.length
              ? "+ Entering multi-chord mode..."
              : "+ Continuing multi-chord mode...",
          ),
          i
        );
      case 2:
        if (
          (this._logService.trace(
            "KeybindingService#dispatch",
            a,
            `[ Will dispatch command ${l.commandId} ]`,
          ),
          null === l.commandId || "" === l.commandId)
        ) {
          if (this.inChordMode) {
            const e = this._currentChords.map(({ label: e }) => e).join(", ");
            (this._log(`+ Leaving chord mode: Nothing bound to "${e}, ${a}".`),
              this._notificationService.status(
                SI(1704, "The key combination ({0}, {1}) is not a command.", e, a),
                { hideAfter: 1e4 },
              ),
              this._leaveChordMode(),
              (i = !0));
          }
        } else {
          (this.inChordMode && this._leaveChordMode(),
            l.isBubble || (i = !0),
            this._log(`+ Invoking command ${l.commandId}.`),
            (this._currentlyDispatchingCommandId = l.commandId));
          try {
            void 0 === l.commandArgs
              ? this._commandService
                  .executeCommand(l.commandId)
                  .then(void 0, (e) => this._notificationService.warn(e))
              : this._commandService
                  .executeCommand(l.commandId, l.commandArgs)
                  .then(void 0, (e) => this._notificationService.warn(e));
          } finally {
            this._currentlyDispatchingCommandId = null;
          }
          _ze.test(l.commandId) ||
            this._telemetryService.publicLog2("workbenchActionExecuted", {
              id: l.commandId,
              from: "keybinding",
              detail: e.getUserSettingsLabel() ?? void 0,
            });
        }
        return i;
    }
  }
  mightProducePrintableCharacter(e) {
    return (
      !e.ctrlKey &&
      !e.metaKey &&
      ((e.keyCode >= 31 && e.keyCode <= 56) || (e.keyCode >= 21 && e.keyCode <= 30))
    );
  }
}
class bze {
  static {
    this.EMPTY = new bze(null);
  }
  constructor(e) {
    ((this._ctrlKey = !!e && e.ctrlKey),
      (this._shiftKey = !!e && e.shiftKey),
      (this._altKey = !!e && e.altKey),
      (this._metaKey = !!e && e.metaKey));
  }
  has(e) {
    switch (e) {
      case "ctrl":
        return this._ctrlKey;
      case "shift":
        return this._shiftKey;
      case "alt":
        return this._altKey;
      case "meta":
        return this._metaKey;
    }
  }
}
class yze {
  constructor(e, t, n, i, r, o, s) {
    ((this._resolvedKeybindingItemBrand = void 0),
      (this.resolvedKeybinding = e),
      (this.chords = e ? xze(e.getDispatchChords()) : []),
      e && 0 === this.chords.length && (this.chords = xze(e.getSingleModifierDispatchChords())),
      (this.bubble = !!t && 94 === t.charCodeAt(0)),
      (this.command = this.bubble ? t.substr(1) : t),
      (this.commandArgs = n),
      (this.when = i),
      (this.isDefault = r),
      (this.extensionId = o),
      (this.isBuiltinExtension = s));
  }
}
function xze(e) {
  const t = [];
  for (let n = 0, i = e.length; n < i; n++) {
    const i = e[n];
    if (!i) return [];
    t.push(i);
  }
  return t;
}
class wze extends bO {
  constructor(e, t) {
    if ((super(), 0 === t.length)) throw GI("chords");
    ((this._os = e), (this._chords = t));
  }
  getLabel() {
    return Gde.toLabel(this._os, this._chords, (e) => this._getLabel(e));
  }
  getAriaLabel() {
    return Zde.toLabel(this._os, this._chords, (e) => this._getAriaLabel(e));
  }
  getElectronAccelerator() {
    return this._chords.length > 1 || this._chords[0].isDuplicateModifierCase()
      ? null
      : Yde.toLabel(this._os, this._chords, (e) => this._getElectronAccelerator(e));
  }
  getUserSettingsLabel() {
    return Xde.toLabel(this._os, this._chords, (e) => this._getUserSettingsLabel(e));
  }
  hasMultipleChords() {
    return this._chords.length > 1;
  }
  getChords() {
    return this._chords.map((e) => this._getChord(e));
  }
  _getChord(e) {
    return new vO(
      e.ctrlKey,
      e.shiftKey,
      e.altKey,
      e.metaKey,
      this._getLabel(e),
      this._getAriaLabel(e),
    );
  }
  getDispatchChords() {
    return this._chords.map((e) => this._getChordDispatch(e));
  }
  getSingleModifierDispatchChords() {
    return this._chords.map((e) => this._getSingleModifierChordDispatch(e));
  }
}
class Cze extends wze {
  constructor(e, t) {
    super(t, e);
  }
  _keyCodeToUILabel(e) {
    if (2 === this._os)
      switch (e) {
        case 15:
          return "←";
        case 16:
          return "↑";
        case 17:
          return "→";
        case 18:
          return "↓";
      }
    return hO.toString(e);
  }
  _getLabel(e) {
    return e.isDuplicateModifierCase() ? "" : this._keyCodeToUILabel(e.keyCode);
  }
  _getAriaLabel(e) {
    return e.isDuplicateModifierCase() ? "" : hO.toString(e.keyCode);
  }
  _getElectronAccelerator(e) {
    return hO.toElectronAccelerator(e.keyCode);
  }
  _getUserSettingsLabel(e) {
    if (e.isDuplicateModifierCase()) return "";
    const t = hO.toUserSettingsUS(e.keyCode);
    return t ? t.toLowerCase() : t;
  }
  _getChordDispatch(e) {
    return Cze.getDispatchStr(e);
  }
  static getDispatchStr(e) {
    if (e.isModifierKey()) return null;
    let t = "";
    return (
      e.ctrlKey && (t += "ctrl+"),
      e.shiftKey && (t += "shift+"),
      e.altKey && (t += "alt+"),
      e.metaKey && (t += "meta+"),
      (t += hO.toString(e.keyCode)),
      t
    );
  }
  _getSingleModifierChordDispatch(e) {
    return 5 !== e.keyCode || e.shiftKey || e.altKey || e.metaKey
      ? 4 !== e.keyCode || e.ctrlKey || e.altKey || e.metaKey
        ? 6 !== e.keyCode || e.ctrlKey || e.shiftKey || e.metaKey
          ? 57 !== e.keyCode || e.ctrlKey || e.shiftKey || e.altKey
            ? null
            : "meta"
          : "alt"
        : "shift"
      : "ctrl";
  }
  static _scanCodeToKeyCode(e) {
    const t = uO[e];
    if (-1 !== t) return t;
    switch (e) {
      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(e) {
    if (!e) return null;
    if (e instanceof mO) return e;
    const t = this._scanCodeToKeyCode(e.scanCode);
    return 0 === t ? null : new mO(e.ctrlKey, e.shiftKey, e.altKey, e.metaKey, t);
  }
  static resolveKeybinding(e, t) {
    const n = xze(e.chords.map((e) => this._toKeyCodeChord(e)));
    return n.length > 0 ? [new Cze(n, t)] : [];
  }
}
let Sze = [],
  kze = [],
  Eze = [];
function Nze(e, t = !1) {
  !(function (e, t, n) {
    const i = (function (e, t) {
      return {
        id: e.id,
        mime: e.mime,
        filename: e.filename,
        extension: e.extension,
        filepattern: e.filepattern,
        firstline: e.firstline,
        userConfigured: t,
        filenameLowercase: e.filename ? e.filename.toLowerCase() : void 0,
        extensionLowercase: e.extension ? e.extension.toLowerCase() : void 0,
        filepatternLowercase: e.filepattern ? Kje(e.filepattern.toLowerCase()) : void 0,
        filepatternOnPath: !!e.filepattern && e.filepattern.indexOf(nP.sep) >= 0,
      };
    })(e, t);
    (Sze.push(i), i.userConfigured ? Eze.push(i) : kze.push(i));
    n &&
      !i.userConfigured &&
      Sze.forEach((e) => {
        e.mime === i.mime ||
          e.userConfigured ||
          (i.extension && (e.extension, i.extension),
          i.filename && (e.filename, i.filename),
          i.filepattern && (e.filepattern, i.filepattern),
          i.firstline && (e.firstline, i.firstline));
      });
  })(e, !1, t);
}
function Lze(e, t) {
  return (function (e, t) {
    let n;
    if (e)
      switch (e.scheme) {
        case NP.file:
          n = e.fsPath;
          break;
        case NP.data:
          n = bH.parseMetaData(e).get(bH.META_DATA_LABEL);
          break;
        case NP.vscodeNotebookCell:
          n = void 0;
          break;
        default:
          n = e.path;
      }
    if (!n) return [{ id: "unknown", mime: UU.unknown }];
    n = n.toLowerCase();
    const i = aP(n),
      r = Dze(n, i, Eze);
    if (r) return [r, { id: a$, mime: UU.text }];
    const o = Dze(n, i, kze);
    if (o) return [o, { id: a$, mime: UU.text }];
    if (t) {
      const e = (function (e) {
        LA(e) && (e = e.substr(1));
        if (e.length > 0)
          for (let t = Sze.length - 1; t >= 0; t--) {
            const n = Sze[t];
            if (!n.firstline) continue;
            const i = e.match(n.firstline);
            if (i && i.length > 0) return n;
          }
        return;
      })(t);
      if (e) return [e, { id: a$, mime: UU.text }];
    }
    return [{ id: "unknown", mime: UU.unknown }];
  })(e, t).map((e) => e.id);
}
function Dze(e, t, n) {
  let i, r, o;
  for (let s = n.length - 1; s >= 0; s--) {
    const a = n[s];
    if (t === a.filenameLowercase) {
      i = a;
      break;
    }
    if (a.filepattern && (!r || a.filepattern.length > r.filepattern.length)) {
      const n = a.filepatternOnPath ? e : t;
      a.filepatternLowercase?.(n) && (r = a);
    }
    a.extension &&
      (!o || a.extension.length > o.extension.length) &&
      t.endsWith(a.extensionLowercase) &&
      (o = a);
  }
  return i || r || o || void 0;
}
const Tze = Object.prototype.hasOwnProperty,
  Ize = "vs.editor.nullLanguage";
class Rze {
  constructor() {
    ((this._languageIdToLanguage = []),
      (this._languageToLanguageId = new Map()),
      this._register(Ize, 0),
      this._register(a$, 1),
      (this._nextLanguageId = 2));
  }
  _register(e, t) {
    ((this._languageIdToLanguage[t] = e), this._languageToLanguageId.set(e, t));
  }
  register(e) {
    if (this._languageToLanguageId.has(e)) return;
    const t = this._nextLanguageId++;
    this._register(e, t);
  }
  encodeLanguageId(e) {
    return this._languageToLanguageId.get(e) || 0;
  }
  decodeLanguageId(e) {
    return this._languageIdToLanguage[e] || Ize;
  }
}
class Oze extends PO {
  static {
    this.instanceCount = 0;
  }
  constructor(e = !0, t = !1) {
    (super(),
      (this._onDidChange = this._register(new QO())),
      (this.onDidChange = this._onDidChange.event),
      Oze.instanceCount++,
      (this._warnOnOverwrite = t),
      (this.languageIdCodec = new Rze()),
      (this._dynamicLanguages = []),
      (this._languages = {}),
      (this._mimeTypesMap = {}),
      (this._nameMap = {}),
      (this._lowercaseNameMap = {}),
      e &&
        (this._initializeFromRegistry(),
        this._register(
          s$.onDidChangeLanguages((e) => {
            this._initializeFromRegistry();
          }),
        )));
  }
  dispose() {
    (Oze.instanceCount--, super.dispose());
  }
  _initializeFromRegistry() {
    ((this._languages = {}),
      (this._mimeTypesMap = {}),
      (this._nameMap = {}),
      (this._lowercaseNameMap = {}),
      (Sze = Sze.filter((e) => e.userConfigured)),
      (kze = []));
    const e = [].concat(s$.getLanguages()).concat(this._dynamicLanguages);
    this._registerLanguages(e);
  }
  _registerLanguages(e) {
    for (const t of e) this._registerLanguage(t);
    ((this._mimeTypesMap = {}),
      (this._nameMap = {}),
      (this._lowercaseNameMap = {}),
      Object.keys(this._languages).forEach((e) => {
        const t = this._languages[e];
        (t.name && (this._nameMap[t.name] = t.identifier),
          t.aliases.forEach((e) => {
            this._lowercaseNameMap[e.toLowerCase()] = t.identifier;
          }),
          t.mimetypes.forEach((e) => {
            this._mimeTypesMap[e] = t.identifier;
          }));
      }),
      NW.as(YU).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),
      this._onDidChange.fire());
  }
  _registerLanguage(e) {
    const t = e.id;
    let n;
    (Tze.call(this._languages, t)
      ? (n = this._languages[t])
      : (this.languageIdCodec.register(t),
        (n = {
          identifier: t,
          name: null,
          mimetypes: [],
          aliases: [],
          extensions: [],
          filenames: [],
          configurationFiles: [],
          icons: [],
        }),
        (this._languages[t] = n)),
      this._mergeLanguage(n, e));
  }
  _mergeLanguage(e, t) {
    const n = t.id;
    let i = null;
    if (
      (Array.isArray(t.mimetypes) &&
        t.mimetypes.length > 0 &&
        (e.mimetypes.push(...t.mimetypes), (i = t.mimetypes[0])),
      i || ((i = `text/x-${n}`), e.mimetypes.push(i)),
      Array.isArray(t.extensions))
    ) {
      t.configuration
        ? (e.extensions = t.extensions.concat(e.extensions))
        : (e.extensions = e.extensions.concat(t.extensions));
      for (const e of t.extensions) Nze({ id: n, mime: i, extension: e }, this._warnOnOverwrite);
    }
    if (Array.isArray(t.filenames))
      for (const a of t.filenames)
        (Nze({ id: n, mime: i, filename: a }, this._warnOnOverwrite), e.filenames.push(a));
    if (Array.isArray(t.filenamePatterns))
      for (const a of t.filenamePatterns)
        Nze({ id: n, mime: i, filepattern: a }, this._warnOnOverwrite);
    if ("string" == typeof t.firstLine && t.firstLine.length > 0) {
      let e = t.firstLine;
      "^" !== e.charAt(0) && (e = "^" + e);
      try {
        const t = new RegExp(e);
        GM(t) || Nze({ id: n, mime: i, firstline: t }, this._warnOnOverwrite);
      } catch (s) {}
    }
    e.aliases.push(n);
    let r = null;
    if (
      (void 0 !== t.aliases &&
        Array.isArray(t.aliases) &&
        (r = 0 === t.aliases.length ? [null] : t.aliases),
      null !== r)
    )
      for (const a of r) a && 0 !== a.length && e.aliases.push(a);
    const o = null !== r && r.length > 0;
    if (o && null === r[0]);
    else {
      const t = (o ? r[0] : null) || n;
      (!o && e.name) || (e.name = t);
    }
    (t.configuration && e.configurationFiles.push(t.configuration), t.icon && e.icons.push(t.icon));
  }
  isRegisteredLanguageId(e) {
    return !!e && Tze.call(this._languages, e);
  }
  getRegisteredLanguageIds() {
    return Object.keys(this._languages);
  }
  getLanguageIdByLanguageName(e) {
    const t = e.toLowerCase();
    return Tze.call(this._lowercaseNameMap, t) ? this._lowercaseNameMap[t] : null;
  }
  getLanguageIdByMimeType(e) {
    return e && Tze.call(this._mimeTypesMap, e) ? this._mimeTypesMap[e] : null;
  }
  guessLanguageIdByFilepathOrFirstLine(e, t) {
    return e || t ? Lze(e, t) : [];
  }
}
class Mze extends PO {
  static {
    this.instanceCount = 0;
  }
  constructor(e = !1) {
    (super(),
      (this._onDidRequestBasicLanguageFeatures = this._register(new QO())),
      (this.onDidRequestBasicLanguageFeatures = this._onDidRequestBasicLanguageFeatures.event),
      (this._onDidRequestRichLanguageFeatures = this._register(new QO())),
      (this.onDidRequestRichLanguageFeatures = this._onDidRequestRichLanguageFeatures.event),
      (this._onDidChange = this._register(new QO({ leakWarningThreshold: 200 }))),
      (this.onDidChange = this._onDidChange.event),
      (this._requestedBasicLanguages = new Set()),
      (this._requestedRichLanguages = new Set()),
      Mze.instanceCount++,
      (this._registry = this._register(new Oze(!0, e))),
      (this.languageIdCodec = this._registry.languageIdCodec),
      this._register(this._registry.onDidChange(() => this._onDidChange.fire())));
  }
  dispose() {
    (Mze.instanceCount--, super.dispose());
  }
  isRegisteredLanguageId(e) {
    return this._registry.isRegisteredLanguageId(e);
  }
  getLanguageIdByLanguageName(e) {
    return this._registry.getLanguageIdByLanguageName(e);
  }
  getLanguageIdByMimeType(e) {
    return this._registry.getLanguageIdByMimeType(e);
  }
  guessLanguageIdByFilepathOrFirstLine(e, t) {
    return this._registry.guessLanguageIdByFilepathOrFirstLine(e, t).at(0) ?? null;
  }
  createById(e) {
    return new Aze(this.onDidChange, () => this._createAndGetLanguageIdentifier(e));
  }
  createByFilepathOrFirstLine(e, t) {
    return new Aze(this.onDidChange, () => {
      const n = this.guessLanguageIdByFilepathOrFirstLine(e, t);
      return this._createAndGetLanguageIdentifier(n);
    });
  }
  _createAndGetLanguageIdentifier(e) {
    return ((e && this.isRegisteredLanguageId(e)) || (e = a$), e);
  }
  requestBasicLanguageFeatures(e) {
    this._requestedBasicLanguages.has(e) ||
      (this._requestedBasicLanguages.add(e), this._onDidRequestBasicLanguageFeatures.fire(e));
  }
  requestRichLanguageFeatures(e) {
    this._requestedRichLanguages.has(e) ||
      (this._requestedRichLanguages.add(e),
      this.requestBasicLanguageFeatures(e),
      I2.getOrCreate(e),
      this._onDidRequestRichLanguageFeatures.fire(e));
  }
}
class Aze {
  constructor(e, t) {
    ((this._value = gF(this, e, () => t())), (this.onDidChange = $O.fromObservable(this._value)));
  }
  get languageId() {
    return this._value.get();
  }
}
const Pze = /\(&([^\s&])\)|(^|[^&])&([^\s&])/,
  jze = /(&amp;)?(&amp;)([^\s&])/g;
var Fze, Bze;
(!(function (e) {
  ((e[(e.Right = 0)] = "Right"), (e[(e.Left = 1)] = "Left"));
})(Fze || (Fze = {})),
  (function (e) {
    ((e[(e.Above = 0)] = "Above"), (e[(e.Below = 1)] = "Below"));
  })(Bze || (Bze = {})));
let Vze = class e extends Cle {
  constructor(e, t, n, i) {
    (e.classList.add("monaco-menu-container"), e.setAttribute("role", "presentation"));
    const r = document.createElement("div");
    (r.classList.add("monaco-menu"),
      r.setAttribute("role", "presentation"),
      super(r, {
        orientation: 1,
        actionViewItemProvider: (e) => this.doGetActionViewItem(e, n, o),
        context: n.context,
        actionRunner: n.actionRunner,
        ariaLabel: n.ariaLabel,
        ariaRole: "menu",
        focusOnlyEnabledItems: !0,
        triggerKeys: { keys: [3, ...(PR || jR ? [10] : [])], keyDown: !0 },
      }),
      (this.menuStyles = i),
      (this.menuElement = r),
      (this.actionsList.tabIndex = 0),
      this.initializeOrUpdateStyleSheet(e, i),
      this._register(iJ.addTarget(r)),
      this._register(
        $F(r, DB.KEY_DOWN, (e) => {
          new wO(e).equals(2) && e.preventDefault();
        }),
      ),
      n.enableMnemonics &&
        this._register(
          $F(r, DB.KEY_DOWN, (e) => {
            const t = e.key.toLocaleLowerCase();
            if (this.mnemonics.has(t)) {
              IB(e, !0);
              const n = this.mnemonics.get(t);
              if (
                (1 === n.length &&
                  (n[0] instanceof Hze && n[0].container && this.focusItemByElement(n[0].container),
                  n[0].onClick(e)),
                n.length > 1)
              ) {
                const e = n.shift();
                (e && e.container && (this.focusItemByElement(e.container), n.push(e)),
                  this.mnemonics.set(t, n));
              }
            }
          }),
        ),
      jR &&
        this._register(
          $F(r, DB.KEY_DOWN, (e) => {
            const t = new wO(e);
            t.equals(14) || t.equals(11)
              ? ((this.focusedItem = this.viewItems.length - 1), this.focusNext(), IB(e, !0))
              : (t.equals(13) || t.equals(12)) &&
                ((this.focusedItem = 0), this.focusPrevious(), IB(e, !0));
          }),
        ),
      this._register(
        $F(this.domNode, DB.MOUSE_OUT, (e) => {
          gB(e.relatedTarget, this.domNode) ||
            ((this.focusedItem = void 0), this.updateFocus(), e.stopPropagation());
        }),
      ),
      this._register(
        $F(this.actionsList, DB.MOUSE_OVER, (e) => {
          let t = e.target;
          if (t && gB(t, this.actionsList) && t !== this.actionsList) {
            for (; t.parentElement !== this.actionsList && null !== t.parentElement; )
              t = t.parentElement;
            if (t.classList.contains("action-item")) {
              const e = this.focusedItem;
              (this.setFocusedItem(t), e !== this.focusedItem && this.updateFocus());
            }
          }
        }),
      ),
      this._register(iJ.addTarget(this.actionsList)),
      this._register(
        $F(this.actionsList, nJ.Tap, (e) => {
          let t = e.initialTarget;
          if (t && gB(t, this.actionsList) && t !== this.actionsList) {
            for (; t.parentElement !== this.actionsList && null !== t.parentElement; )
              t = t.parentElement;
            if (t.classList.contains("action-item")) {
              const e = this.focusedItem;
              (this.setFocusedItem(t), e !== this.focusedItem && this.updateFocus());
            }
          }
        }),
      ));
    const o = { parent: this };
    ((this.mnemonics = new Map()),
      (this.scrollableElement = this._register(
        new wJ(r, {
          alwaysConsumeMouseWheel: !0,
          horizontal: 2,
          vertical: 3,
          verticalScrollbarSize: 7,
          handleMouseWheel: !0,
          useShadows: !0,
        }),
      )));
    const s = this.scrollableElement.getDomNode();
    ((s.style.position = ""),
      this.styleScrollElement(s, i),
      this._register(
        $F(r, nJ.Change, (e) => {
          IB(e, !0);
          const t = this.scrollableElement.getScrollPosition().scrollTop;
          this.scrollableElement.setScrollPosition({ scrollTop: t - e.translationY });
        }),
      ),
      this._register(
        $F(s, DB.MOUSE_UP, (e) => {
          e.preventDefault();
        }),
      ));
    const a = MF(e);
    ((r.style.maxHeight = `${Math.max(10, a.innerHeight - e.getBoundingClientRect().top - 35)}px`),
      (t = t.filter((e, i) => {
        if (n.submenuIds?.has(e.id)) return !1;
        if (e instanceof EV) {
          if (i === t.length - 1 || 0 === i) return !1;
          if (t[i - 1] instanceof EV) return !1;
        }
        return !0;
      })),
      this.push(t, { icon: !0, label: !0, isMenu: !0 }),
      e.appendChild(this.scrollableElement.getDomNode()),
      this.scrollableElement.scanDomNode(),
      this.viewItems
        .filter((e) => !(e instanceof zze))
        .forEach((e, t, n) => {
          e.updatePositionInSet(t + 1, n.length);
        }));
  }
  initializeOrUpdateStyleSheet(t, n) {
    (this.styleSheet ||
      (mB(t)
        ? (this.styleSheet = rG(t))
        : (e.globalStyleSheet || (e.globalStyleSheet = rG()),
          (this.styleSheet = e.globalStyleSheet))),
      (this.styleSheet.textContent = (function (e, t) {
        let n = `\n.monaco-menu {\n\tfont-size: 13px;\n\tborder-radius: 5px;\n\tmin-width: 160px;\n}\n\n${Uze(OV.menuSelection)}\n${Uze(OV.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative;  /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-menu-separatorBackground);\n\tpadding-top: 1px;\n\tpadding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 0 4px;\n\tborder-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n\topacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n\topacity: 0.7;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\twidth: 100%;\n\theight: 0px !important;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n\tmax-height: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tmargin: 5px 0 !important;\n\tpadding: 0;\n\tborder-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;
        if (t) {
          n +=
            "\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t/* Fix for https://github.com/microsoft/vscode/issues/103170 */\n\t\t\t.monaco-menu .action-item .monaco-submenu {\n\t\t\t\tz-index: 1;\n\t\t\t}\n\t\t";
          const t = e.scrollbarShadow;
          t &&
            (n += `\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);
          const i = e.scrollbarSliderBackground;
          i &&
            (n += `\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${i};\n\t\t\t\t}\n\t\t\t`);
          const r = e.scrollbarSliderHoverBackground;
          r &&
            (n += `\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${r};\n\t\t\t\t}\n\t\t\t`);
          const o = e.scrollbarSliderActiveBackground;
          o &&
            (n += `\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`);
        }
        return n;
      })(n, mB(t))));
  }
  styleScrollElement(e, t) {
    const n = t.foregroundColor ?? "",
      i = t.backgroundColor ?? "",
      r = t.borderColor ? `1px solid ${t.borderColor}` : "",
      o = t.shadowColor ? `0 2px 8px ${t.shadowColor}` : "";
    ((e.style.outline = r),
      (e.style.borderRadius = "5px"),
      (e.style.color = n),
      (e.style.backgroundColor = i),
      (e.style.boxShadow = o));
  }
  getContainer() {
    return this.scrollableElement.getDomNode();
  }
  get onScroll() {
    return this.scrollableElement.onScroll;
  }
  focusItemByElement(e) {
    const t = this.focusedItem;
    (this.setFocusedItem(e), t !== this.focusedItem && this.updateFocus());
  }
  setFocusedItem(e) {
    for (let t = 0; t < this.actionsList.children.length; t++) {
      if (e === this.actionsList.children[t]) {
        this.focusedItem = t;
        break;
      }
    }
  }
  updateFocus(e) {
    (super.updateFocus(e, !0, !0),
      void 0 !== this.focusedItem &&
        this.scrollableElement.setScrollPosition({
          scrollTop: Math.round(this.menuElement.scrollTop),
        }));
  }
  doGetActionViewItem(e, t, n) {
    if (e instanceof EV) return new zze(t.context, e, { icon: !0 }, this.menuStyles);
    if (e instanceof NV) {
      const i = new Hze(
        e,
        e.actions,
        n,
        { ...t, submenuIds: new Set([...(t.submenuIds || []), e.id]) },
        this.menuStyles,
      );
      if (t.enableMnemonics) {
        const e = i.getMnemonic();
        if (e && i.isEnabled()) {
          let t = [];
          (this.mnemonics.has(e) && (t = this.mnemonics.get(e)),
            t.push(i),
            this.mnemonics.set(e, t));
        }
      }
      return i;
    }
    {
      const n = t.getKeyBinding?.(e)?.getLabel(),
        i = {
          enableMnemonics: t.enableMnemonics,
          useEventAsContext: t.useEventAsContext,
          keybinding: n,
        },
        r = new Wze(t.context, e, i, this.menuStyles);
      if (t.enableMnemonics) {
        const e = r.getMnemonic();
        if (e && r.isEnabled()) {
          let t = [];
          (this.mnemonics.has(e) && (t = this.mnemonics.get(e)),
            t.push(r),
            this.mnemonics.set(e, t));
        }
      }
      return r;
    }
  }
};
class Wze extends yle {
  constructor(e, t, n, i) {
    if (
      (super(
        t,
        t,
        (n = {
          ...n,
          isMenu: !0,
          icon: void 0 !== n.icon && n.icon,
          label: void 0 === n.label || n.label,
        }),
      ),
      (this.menuStyle = i),
      (this.options = n),
      (this.cssClass = ""),
      this.options.label && n.enableMnemonics)
    ) {
      const e = this.action.label;
      if (e) {
        const t = Pze.exec(e);
        t && (this.mnemonic = (t[1] ? t[1] : t[3]).toLocaleLowerCase());
      }
    }
    ((this.runOnceToEnableMouseUp = new EM(() => {
      this.element &&
        (this._register(
          $F(this.element, DB.MOUSE_UP, (e) => {
            if ((IB(e, !0), RI)) {
              if (new EO(MF(this.element), e).rightButton) return;
              this.onClick(e);
            } else
              setTimeout(() => {
                this.onClick(e);
              }, 0);
          }),
        ),
        this._register(
          $F(this.element, DB.CONTEXT_MENU, (e) => {
            IB(e, !0);
          }),
        ));
    }, 100)),
      this._register(this.runOnceToEnableMouseUp));
  }
  render(e) {
    (super.render(e),
      this.element &&
        ((this.container = e),
        (this.item = MB(this.element, VB("a.action-menu-item"))),
        this._action.id === EV.ID
          ? this.item.setAttribute("role", "presentation")
          : (this.item.setAttribute("role", "menuitem"),
            this.mnemonic && this.item.setAttribute("aria-keyshortcuts", `${this.mnemonic}`)),
        (this.check = MB(
          this.item,
          VB("span.menu-item-check" + AV.asCSSSelector(OV.menuSelection)),
        )),
        this.check.setAttribute("role", "none"),
        (this.label = MB(this.item, VB("span.action-label"))),
        this.options.label &&
          this.options.keybinding &&
          (MB(this.item, VB("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(e, t) {
    this.item &&
      (this.item.setAttribute("aria-posinset", `${e}`),
      this.item.setAttribute("aria-setsize", `${t}`));
  }
  updateLabel() {
    if (this.label && this.options.label) {
      zF(this.label);
      let e = Jie(this.action.label);
      if (e) {
        const t = (function (e) {
          const t = Pze,
            n = t.exec(e);
          if (!n) return e;
          const i = !n[1];
          return e.replace(t, i ? "$2$3" : "").trim();
        })(e);
        (this.options.enableMnemonics || (e = t),
          this.label.setAttribute("aria-label", t.replace(/&&/g, "&")));
        const n = Pze.exec(e);
        if (n) {
          ((e = HM(e)), (jze.lastIndex = 0));
          let t = jze.exec(e);
          for (; t && t[1]; ) t = jze.exec(e);
          const i = (e) => e.replace(/&amp;&amp;/g, "&amp;");
          (t
            ? this.label.append(
                $M(i(e.substr(0, t.index)), " "),
                VB("u", { "aria-hidden": "true" }, t[3]),
                qM(i(e.substr(t.index + t[0].length)), " "),
              )
            : (this.label.textContent = i(e).trim()),
            this.item?.setAttribute("aria-keyshortcuts", (n[1] ? n[1] : n[3]).toLocaleLowerCase()));
        } else this.label.textContent = e.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;
    const e = this.action.checked;
    (this.item.classList.toggle("checked", !!e),
      void 0 !== e
        ? (this.item.setAttribute("role", "menuitemcheckbox"),
          this.item.setAttribute("aria-checked", e ? "true" : "false"))
        : (this.item.setAttribute("role", "menuitem"), this.item.setAttribute("aria-checked", "")));
  }
  getMnemonic() {
    return this.mnemonic;
  }
  applyStyle() {
    const e = this.element && this.element.classList.contains("focused"),
      t =
        e && this.menuStyle.selectionForegroundColor
          ? this.menuStyle.selectionForegroundColor
          : this.menuStyle.foregroundColor,
      n =
        e && this.menuStyle.selectionBackgroundColor
          ? this.menuStyle.selectionBackgroundColor
          : void 0,
      i =
        e && this.menuStyle.selectionBorderColor
          ? `1px solid ${this.menuStyle.selectionBorderColor}`
          : "",
      r = e && this.menuStyle.selectionBorderColor ? "-1px" : "";
    (this.item &&
      ((this.item.style.color = t ?? ""),
      (this.item.style.backgroundColor = n ?? ""),
      (this.item.style.outline = i),
      (this.item.style.outlineOffset = r)),
      this.check && (this.check.style.color = t ?? ""));
  }
}
class Hze extends Wze {
  constructor(e, t, n, i, r) {
    (super(e, e, i, r),
      (this.submenuActions = t),
      (this.parentData = n),
      (this.submenuOptions = i),
      (this.mysubmenu = null),
      (this.submenuDisposables = this._register(new AO())),
      (this.mouseOver = !1),
      (this.expandDirection =
        i && void 0 !== i.expandDirection
          ? i.expandDirection
          : { horizontal: Fze.Right, vertical: Bze.Below }),
      (this.showScheduler = new EM(() => {
        this.mouseOver && (this.cleanupExistingSubmenu(!1), this.createSubmenu(!1));
      }, 250)),
      (this.hideScheduler = new EM(() => {
        this.element &&
          !gB(vB(), this.element) &&
          this.parentData.submenu === this.mysubmenu &&
          (this.parentData.parent.focus(!1), this.cleanupExistingSubmenu(!0));
      }, 750)));
  }
  render(e) {
    (super.render(e),
      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 = MB(
            this.item,
            VB("span.submenu-indicator" + AV.asCSSSelector(OV.menuSubmenu)),
          )),
          this.submenuIndicator.setAttribute("aria-hidden", "true")),
        this._register(
          $F(this.element, DB.KEY_UP, (e) => {
            const t = new wO(e);
            (t.equals(17) || t.equals(3)) && (IB(e, !0), this.createSubmenu(!0));
          }),
        ),
        this._register(
          $F(this.element, DB.KEY_DOWN, (e) => {
            const t = new wO(e);
            vB() === this.item && (t.equals(17) || t.equals(3)) && IB(e, !0);
          }),
        ),
        this._register(
          $F(this.element, DB.MOUSE_OVER, (e) => {
            this.mouseOver || ((this.mouseOver = !0), this.showScheduler.schedule());
          }),
        ),
        this._register(
          $F(this.element, DB.MOUSE_LEAVE, (e) => {
            this.mouseOver = !1;
          }),
        ),
        this._register(
          $F(this.element, DB.FOCUS_OUT, (e) => {
            this.element && !gB(vB(), this.element) && this.hideScheduler.schedule();
          }),
        ),
        this._register(
          this.parentData.parent.onScroll(() => {
            this.parentData.submenu === this.mysubmenu &&
              (this.parentData.parent.focus(!1), this.cleanupExistingSubmenu(!0));
          }),
        )));
  }
  updateEnabled() {}
  onClick(e) {
    (IB(e, !0), this.cleanupExistingSubmenu(!1), this.createSubmenu(!0));
  }
  cleanupExistingSubmenu(e) {
    if (this.parentData.submenu && (e || this.parentData.submenu !== this.mysubmenu)) {
      try {
        this.parentData.submenu.dispose();
      } catch {}
      ((this.parentData.submenu = void 0),
        this.updateAriaExpanded("false"),
        this.submenuContainer &&
          (this.submenuDisposables.clear(), (this.submenuContainer = void 0)));
    }
  }
  calculateSubmenuMenuLayout(e, t, n, i) {
    const r = { top: 0, left: 0 };
    return (
      (r.left = qHe(e.width, t.width, {
        position: i.horizontal === Fze.Right ? 0 : 1,
        offset: n.left,
        size: n.width,
      })),
      r.left >= n.left &&
        r.left < n.left + n.width &&
        (n.left + 10 + t.width <= e.width && (r.left = n.left + 10), (n.top += 10), (n.height = 0)),
      (r.top = qHe(e.height, t.height, { position: 0, offset: n.top, size: 0 })),
      r.top + t.height === n.top && r.top + n.height + t.height <= e.height && (r.top += n.height),
      r
    );
  }
  createSubmenu(e = !0) {
    if (this.element)
      if (this.parentData.submenu) this.parentData.submenu.focus(!1);
      else {
        (this.updateAriaExpanded("true"),
          (this.submenuContainer = MB(this.element, VB("div.monaco-submenu"))),
          this.submenuContainer.classList.add("menubar-menu-items-holder", "context-view"));
        const t = MF(this.parentData.parent.domNode).getComputedStyle(
            this.parentData.parent.domNode,
          ),
          n = parseFloat(t.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 Vze(
            this.submenuContainer,
            this.submenuActions.length ? this.submenuActions : [new LV()],
            this.submenuOptions,
            this.menuStyle,
          )));
        const i = this.element.getBoundingClientRect(),
          r = { top: i.top - n, left: i.left, height: i.height + 2 * n, width: i.width },
          o = this.submenuContainer.getBoundingClientRect(),
          s = MF(this.element),
          { top: a, left: l } = this.calculateSubmenuMenuLayout(
            new oB(s.innerWidth, s.innerHeight),
            oB.lift(o),
            r,
            this.expandDirection,
          );
        ((this.submenuContainer.style.left = l - o.left + "px"),
          (this.submenuContainer.style.top = a - o.top + "px"),
          this.submenuDisposables.add(
            $F(this.submenuContainer, DB.KEY_UP, (e) => {
              new wO(e).equals(15) &&
                (IB(e, !0), this.parentData.parent.focus(), this.cleanupExistingSubmenu(!0));
            }),
          ),
          this.submenuDisposables.add(
            $F(this.submenuContainer, DB.KEY_DOWN, (e) => {
              new wO(e).equals(15) && IB(e, !0);
            }),
          ),
          this.submenuDisposables.add(
            this.parentData.submenu.onDidCancel(() => {
              (this.parentData.parent.focus(), this.cleanupExistingSubmenu(!0));
            }),
          ),
          this.parentData.submenu.focus(e),
          (this.mysubmenu = this.parentData.submenu));
      }
  }
  updateAriaExpanded(e) {
    this.item && this.item?.setAttribute("aria-expanded", e);
  }
  applyStyle() {
    super.applyStyle();
    const e =
      this.element &&
      this.element.classList.contains("focused") &&
      this.menuStyle.selectionForegroundColor
        ? this.menuStyle.selectionForegroundColor
        : this.menuStyle.foregroundColor;
    this.submenuIndicator && (this.submenuIndicator.style.color = e ?? "");
  }
  dispose() {
    (super.dispose(),
      this.hideScheduler.dispose(),
      this.mysubmenu && (this.mysubmenu.dispose(), (this.mysubmenu = null)),
      this.submenuContainer && (this.submenuContainer = void 0));
  }
}
class zze extends xle {
  constructor(e, t, n, i) {
    (super(e, t, n), (this.menuStyles = i));
  }
  render(e) {
    (super.render(e),
      this.label &&
        (this.label.style.borderBottomColor = this.menuStyles.separatorColor
          ? `${this.menuStyles.separatorColor}`
          : ""));
  }
}
function Uze(e) {
  const t = RV()[e.id];
  return `.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`;
}
class $ze {
  constructor(e, t, n, i) {
    ((this.contextViewService = e),
      (this.telemetryService = t),
      (this.notificationService = n),
      (this.keybindingService = i),
      (this.focusToReturn = null),
      (this.lastContainer = null),
      (this.block = null),
      (this.blockDisposable = null),
      (this.options = { blockMouse: !0 }));
  }
  configure(e) {
    this.options = e;
  }
  showContextMenu(e) {
    const t = e.getActions();
    if (!t.length) return;
    let n;
    this.focusToReturn = vB();
    const i = SB(e.domForShadowRoot) ? e.domForShadowRoot : void 0;
    this.contextViewService.showContextView(
      {
        getAnchor: () => e.getAnchor(),
        canRelayout: !1,
        anchorAlignment: e.anchorAlignment,
        anchorAxisAlignment: e.anchorAxisAlignment,
        layer: e.layer,
        render: (i) => {
          this.lastContainer = i;
          const r = e.getMenuClassName ? e.getMenuClassName() : "";
          (r && (i.className += " " + r),
            this.options.blockMouse &&
              ((this.block = i.appendChild(VB(".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 = $F(this.block, DB.MOUSE_DOWN, (e) => e.stopPropagation()))));
          const o = new AO(),
            s = e.actionRunner || o.add(new kV());
          (s.onWillRun((t) => this.onActionRun(t, !e.skipTelemetry), this, o),
            s.onDidRun(this.onDidActionRun, this, o),
            (n = new Vze(
              i,
              t,
              {
                actionViewItemProvider: e.getActionViewItem,
                context: e.getActionsContext ? e.getActionsContext() : null,
                actionRunner: s,
                getKeyBinding: e.getKeyBinding
                  ? e.getKeyBinding
                  : (e) => this.keybindingService.lookupKeybinding(e.id),
              },
              bue,
            )),
            n.onDidCancel(() => this.contextViewService.hideContextView(!0), null, o),
            n.onDidBlur(() => this.contextViewService.hideContextView(!0), null, o));
          const a = MF(i);
          return (
            o.add($F(a, DB.BLUR, () => this.contextViewService.hideContextView(!0))),
            o.add(
              $F(a, DB.MOUSE_DOWN, (e) => {
                if (e.defaultPrevented) return;
                const t = new EO(a, e);
                let n = t.target;
                if (!t.rightButton) {
                  for (; n; ) {
                    if (n === i) return;
                    n = n.parentElement;
                  }
                  this.contextViewService.hideContextView(!0);
                }
              }),
            ),
            RO(o, n)
          );
        },
        focus: () => {
          n?.focus(!!e.autoSelectFirstItem);
        },
        onHide: (t) => {
          (e.onHide?.(!!t),
            this.block && (this.block.remove(), (this.block = null)),
            this.blockDisposable?.dispose(),
            (this.blockDisposable = null),
            this.lastContainer &&
              (vB() === this.lastContainer || gB(vB(), this.lastContainer)) &&
              this.focusToReturn?.focus(),
            (this.lastContainer = null));
        },
      },
      i,
      !!i,
    );
  }
  onActionRun(e, t) {
    (t &&
      this.telemetryService.publicLog2("workbenchActionExecuted", {
        id: e.action.id,
        from: "contextMenu",
      }),
      this.contextViewService.hideContextView(!1));
  }
  onDidActionRun(e) {
    e.error && !qI(e.error) && this.notificationService.error(e.error);
  }
}
var qze = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let Kze = class extends PO {
  get contextMenuHandler() {
    return (
      this._contextMenuHandler ||
        (this._contextMenuHandler = new $ze(
          this.contextViewService,
          this.telemetryService,
          this.notificationService,
          this.keybindingService,
        )),
      this._contextMenuHandler
    );
  }
  constructor(e, t, n, i, r, o) {
    (super(),
      (this.telemetryService = e),
      (this.notificationService = t),
      (this.contextViewService = n),
      (this.keybindingService = i),
      (this.menuService = r),
      (this.contextKeyService = o),
      (this._contextMenuHandler = void 0),
      (this._onDidShowContextMenu = this._store.add(new QO())),
      (this.onDidShowContextMenu = this._onDidShowContextMenu.event),
      (this._onDidHideContextMenu = this._store.add(new QO())),
      (this.onDidHideContextMenu = this._onDidHideContextMenu.event));
  }
  configure(e) {
    this.contextMenuHandler.configure(e);
  }
  showContextMenu(e) {
    ((e = Gze.transform(e, this.menuService, this.contextKeyService)),
      this.contextMenuHandler.showContextMenu({
        ...e,
        onHide: (t) => {
          (e.onHide?.(t), this._onDidHideContextMenu.fire());
        },
      }),
      $B.getInstance().resetKeyStatus(),
      this._onDidShowContextMenu.fire());
  }
};
var Gze, Zze;
((Kze = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([qze(0, HW), qze(1, Y4), qze(2, lde), qze(3, N5), qze(4, AW), qze(5, xW)], Kze)),
  (function (e) {
    e.transform = function (e, t, n) {
      if (!((i = e) && i.menuId instanceof MW)) return e;
      var i;
      const { menuId: r, menuActionOptions: o, contextKeyService: s } = e;
      return {
        ...e,
        getActions: () => {
          let i = [];
          if (r) {
            i = Sue(t.getMenuActions(r, s ?? n, o));
          }
          return e.getActions ? EV.join(e.getActions(), i) : i;
        },
      };
    };
  })(Gze || (Gze = {})),
  (function (e) {
    ((e[(e.API = 0)] = "API"), (e[(e.USER = 1)] = "USER"));
  })(Zze || (Zze = {})));
var Yze = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Xze = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Qze = class {
  constructor(e) {
    this._commandService = e;
  }
  async open(e, t) {
    if (!LP(e, NP.command)) return !1;
    if (!t?.allowCommands) return !0;
    if (
      ("string" == typeof e && (e = mP.parse(e)),
      Array.isArray(t.allowCommands) && !t.allowCommands.includes(e.path))
    )
      return !0;
    let n = [];
    try {
      n = woe(decodeURIComponent(e.query));
    } catch {
      try {
        n = woe(e.query);
      } catch {}
    }
    return (
      Array.isArray(n) || (n = [n]),
      await this._commandService.executeCommand(e.path, ...n),
      !0
    );
  }
};
Qze = Yze([Xze(0, PV)], Qze);
let Jze = class {
  constructor(e) {
    this._editorService = e;
  }
  async open(e, t) {
    "string" == typeof e && (e = mP.parse(e));
    const { selection: n, uri: i } = (function (e) {
      let t;
      const n = /^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);
      return (
        n &&
          ((t = {
            startLineNumber: parseInt(n[1]),
            startColumn: n[2] ? parseInt(n[2]) : 1,
            endLineNumber: n[4] ? parseInt(n[4]) : void 0,
            endColumn: n[4] ? (n[5] ? parseInt(n[5]) : 1) : void 0,
          }),
          (e = e.with({ fragment: "" }))),
        { selection: t, uri: e }
      );
    })(e);
    return (
      (e = i).scheme === NP.file && (e = pH(e)),
      await this._editorService.openCodeEditor(
        {
          resource: e,
          options: {
            selection: n,
            source: t?.fromUserGesture ? Zze.USER : Zze.API,
            ...t?.editorOptions,
          },
        },
        this._editorService.getFocusedCodeEditor(),
        t?.openToSide,
      ),
      !0
    );
  }
};
Jze = Yze([Xze(0, yV)], Jze);
let eUe = class {
  constructor(e, t) {
    ((this._openers = new HO()),
      (this._validators = new HO()),
      (this._resolvers = new HO()),
      (this._resolvedUriTargets = new KW((e) =>
        e.with({ path: null, fragment: null, query: null }).toString(),
      )),
      (this._externalOpeners = new HO()),
      (this._defaultExternalOpener = {
        openExternal: async (e) => (DP(e, NP.http, NP.https) ? UB(e) : (NI.location.href = e), !0),
      }),
      this._openers.push({
        open: async (e, t) =>
          !(!t?.openExternal && !DP(e, NP.mailto, NP.http, NP.https, NP.vsls)) &&
          (await this._doOpenExternal(e, t), !0),
      }),
      this._openers.push(new Qze(t)),
      this._openers.push(new Jze(e)));
  }
  registerOpener(e) {
    return { dispose: this._openers.unshift(e) };
  }
  async open(e, t) {
    if (!t?.skipValidation) {
      const n = "string" == typeof e ? mP.parse(e) : e,
        i = this._resolvedUriTargets.get(n) ?? e;
      for (const e of this._validators) if (!(await e.shouldOpen(i, t))) return !1;
    }
    for (const n of this._openers) {
      if (await n.open(e, t)) return !0;
    }
    return !1;
  }
  async resolveExternalUri(e, t) {
    for (const n of this._resolvers)
      try {
        const i = await n.resolveExternalUri(e, t);
        if (i)
          return (
            this._resolvedUriTargets.has(i.resolved) || this._resolvedUriTargets.set(i.resolved, e),
            i
          );
      } catch {}
    throw new Error("Could not resolve external URI: " + e.toString());
  }
  async _doOpenExternal(e, t) {
    const n = "string" == typeof e ? mP.parse(e) : e;
    let i, r;
    try {
      i = (await this.resolveExternalUri(n, t)).resolved;
    } catch {
      i = n;
    }
    if (
      ((r = "string" == typeof e && n.toString() === i.toString() ? e : encodeURI(i.toString(!0))),
      t?.allowContributedOpeners)
    ) {
      const e = "string" == typeof t?.allowContributedOpeners ? t?.allowContributedOpeners : void 0;
      for (const t of this._externalOpeners) {
        if (await t.openExternal(r, { sourceUri: n, preferredOpenerId: e }, aM.None)) return !0;
      }
    }
    return this._defaultExternalOpener.openExternal(r, { sourceUri: n }, aM.None);
  }
  dispose() {
    this._validators.clear();
  }
};
eUe = Yze([Xze(0, yV), Xze(1, PV)], eUe);
var tUe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let nUe = class extends PO {
  constructor(e, t) {
    (super(),
      (this._markerService = t),
      (this._onDidChangeMarker = this._register(new QO())),
      (this._suppressedRanges = new KW()),
      (this._markerDecorations = new KW()),
      e.getModels().forEach((e) => this._onModelAdded(e)),
      this._register(e.onModelAdded(this._onModelAdded, this)),
      this._register(e.onModelRemoved(this._onModelRemoved, this)),
      this._register(this._markerService.onMarkerChanged(this._handleMarkerChange, this)));
  }
  dispose() {
    (super.dispose(),
      this._markerDecorations.forEach((e) => e.dispose()),
      this._markerDecorations.clear());
  }
  getMarker(e, t) {
    const n = this._markerDecorations.get(e);
    return (n && n.getMarker(t)) || null;
  }
  _handleMarkerChange(e) {
    e.forEach((e) => {
      const t = this._markerDecorations.get(e);
      t && this._updateDecorations(t);
    });
  }
  _onModelAdded(e) {
    const t = new iUe(e);
    (this._markerDecorations.set(e.uri, t), this._updateDecorations(t));
  }
  _onModelRemoved(e) {
    const t = this._markerDecorations.get(e.uri);
    (t && (t.dispose(), this._markerDecorations.delete(e.uri)),
      (e.uri.scheme !== NP.inMemory &&
        e.uri.scheme !== NP.internal &&
        e.uri.scheme !== NP.vscode) ||
        this._markerService
          ?.read({ resource: e.uri })
          .map((e) => e.owner)
          .forEach((t) => this._markerService.remove(t, [e.uri])));
  }
  _updateDecorations(e) {
    let t = this._markerService.read({ resource: e.model.uri, take: 500 });
    const n = this._suppressedRanges.get(e.model.uri);
    (n && (t = t.filter((e) => !DO.some(n, (t) => YH.areIntersectingOrTouching(t, e)))),
      e.update(t) && this._onDidChangeMarker.fire(e.model));
  }
};
nUe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([tUe(0, wV), tUe(1, Tfe)], nUe);
class iUe extends PO {
  constructor(e) {
    (super(),
      (this.model = e),
      (this._map = new QW()),
      this._register(
        MO(() => {
          (this.model.deltaDecorations([...this._map.values()], []), this._map.clear());
        }),
      ));
  }
  update(e) {
    const { added: t, removed: n } = (function (e, t) {
      const n = [],
        i = [];
      for (const r of e) t.has(r) || n.push(r);
      for (const r of t) e.has(r) || i.push(r);
      return { removed: n, added: i };
    })(new Set(this._map.keys()), new Set(e));
    if (0 === t.length && 0 === n.length) return !1;
    const i = n.map((e) => this._map.get(e)),
      r = t.map((e) => ({
        range: this._createDecorationRange(this.model, e),
        options: this._createDecorationOption(e),
      })),
      o = this.model.deltaDecorations(i, r);
    for (const s of n) this._map.delete(s);
    for (let s = 0; s < o.length; s++) this._map.set(t[s], o[s]);
    return !0;
  }
  getMarker(e) {
    return this._map.getKey(e.id);
  }
  _createDecorationRange(e, t) {
    let n = YH.lift(t);
    if (
      (t.severity !== Nfe.Hint ||
        this._hasMarkerTag(t, 1) ||
        this._hasMarkerTag(t, 2) ||
        (n = n.setEndPosition(n.startLineNumber, n.startColumn + 2)),
      (n = e.validateRange(n)),
      n.isEmpty())
    ) {
      const t =
        e.getLineLastNonWhitespaceColumn(n.startLineNumber) ||
        e.getLineMaxColumn(n.startLineNumber);
      if (1 === t || n.endColumn >= t) return n;
      const i = e.getWordAtPosition(n.getStartPosition());
      i && (n = new YH(n.startLineNumber, i.startColumn, n.endLineNumber, i.endColumn));
    } else if (
      t.endColumn === Number.MAX_VALUE &&
      1 === t.startColumn &&
      n.startLineNumber === n.endLineNumber
    ) {
      const i = e.getLineFirstNonWhitespaceColumn(t.startLineNumber);
      i < n.endColumn &&
        ((n = new YH(n.startLineNumber, i, n.endLineNumber, n.endColumn)), (t.startColumn = i));
    }
    return n;
  }
  _createDecorationOption(e) {
    let t, n, i, r, o;
    switch (e.severity) {
      case Nfe.Hint:
        ((t = this._hasMarkerTag(e, 2)
          ? void 0
          : this._hasMarkerTag(e, 1)
            ? "squiggly-unnecessary"
            : "squiggly-hint"),
          (i = 0));
        break;
      case Nfe.Info:
        ((t = "squiggly-info"), (n = g0(J0)), (i = 10), (o = { color: g0(nY), position: 1 }));
        break;
      case Nfe.Warning:
        ((t = "squiggly-warning"), (n = g0(Q0)), (i = 20), (o = { color: g0(iY), position: 1 }));
        break;
      case Nfe.Error:
      default:
        ((t = "squiggly-error"), (n = g0(X0)), (i = 30), (o = { color: g0(rY), position: 1 }));
    }
    return (
      e.tags &&
        (-1 !== e.tags.indexOf(1) && (r = "squiggly-inline-unnecessary"),
        -1 !== e.tags.indexOf(2) && (r = "squiggly-inline-deprecated")),
      {
        description: "marker-decoration",
        stickiness: 1,
        className: t,
        showIfCollapsed: !0,
        overviewRuler: { color: n, position: Uz.Right },
        minimap: o,
        zIndex: i,
        inlineClassName: r,
      }
    );
  }
  _hasMarkerTag(e, t) {
    return !!e.tags && e.tags.indexOf(t) >= 0;
  }
}
var rUe,
  oUe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
function sUe(e) {
  return e.toString();
}
class aUe {
  constructor(e, t, n) {
    ((this.model = e),
      (this._modelEventListeners = new AO()),
      (this.model = e),
      this._modelEventListeners.add(e.onWillDispose(() => t(e))),
      this._modelEventListeners.add(e.onDidChangeLanguage((t) => n(e, t))));
  }
  dispose() {
    this._modelEventListeners.dispose();
  }
}
const lUe = jR || PR ? 1 : 2;
class cUe {
  constructor(e, t, n, i, r, o, s, a) {
    ((this.uri = e),
      (this.initialUndoRedoSnapshot = t),
      (this.time = n),
      (this.sharesUndoRedoStack = i),
      (this.heapSize = r),
      (this.sha1 = o),
      (this.versionId = s),
      (this.alternativeVersionId = a));
  }
}
let dUe = class extends PO {
  static {
    rUe = this;
  }
  static {
    this.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK = 20971520;
  }
  constructor(e, t, n, i) {
    (super(),
      (this._configurationService = e),
      (this._resourcePropertiesService = t),
      (this._undoRedoService = n),
      (this._instantiationService = i),
      (this._onModelAdded = this._register(new QO())),
      (this.onModelAdded = this._onModelAdded.event),
      (this._onModelRemoved = this._register(new QO())),
      (this.onModelRemoved = this._onModelRemoved.event),
      (this._onModelModeChanged = this._register(new QO())),
      (this.onModelLanguageChanged = this._onModelModeChanged.event),
      (this._modelCreationOptionsByLanguageAndResource = Object.create(null)),
      (this._models = {}),
      (this._disposedModels = new Map()),
      (this._disposedModelsHeapSize = 0),
      this._register(
        this._configurationService.onDidChangeConfiguration((e) => this._updateModelOptions(e)),
      ),
      this._updateModelOptions(void 0));
  }
  static _readModelOptions(e, t) {
    let n = eK.tabSize;
    e.editor && void 0 !== e.editor.tabSize && (n = dK(e.editor.tabSize, eK.tabSize, 1, 100));
    let i = "tabSize";
    e.editor &&
      void 0 !== e.editor.indentSize &&
      "tabSize" !== e.editor.indentSize &&
      (i = dK(e.editor.indentSize, "tabSize", 1, 100));
    let r = eK.insertSpaces;
    e.editor &&
      void 0 !== e.editor.insertSpaces &&
      (r = "false" !== e.editor.insertSpaces && Boolean(e.editor.insertSpaces));
    let o = lUe;
    const s = e.eol;
    "\r\n" === s ? (o = 2) : "\n" === s && (o = 1);
    let a = eK.trimAutoWhitespace;
    e.editor &&
      void 0 !== e.editor.trimAutoWhitespace &&
      (a = "false" !== e.editor.trimAutoWhitespace && Boolean(e.editor.trimAutoWhitespace));
    let l = eK.detectIndentation;
    e.editor &&
      void 0 !== e.editor.detectIndentation &&
      (l = "false" !== e.editor.detectIndentation && Boolean(e.editor.detectIndentation));
    let c = eK.largeFileOptimizations;
    e.editor &&
      void 0 !== e.editor.largeFileOptimizations &&
      (c = "false" !== e.editor.largeFileOptimizations && Boolean(e.editor.largeFileOptimizations));
    let d = eK.bracketPairColorizationOptions;
    if (e.editor?.bracketPairColorization && "object" == typeof e.editor.bracketPairColorization) {
      const t = e.editor.bracketPairColorization;
      d = {
        enabled: !!t.enabled,
        independentColorPoolPerBracketType: !!t.independentColorPoolPerBracketType,
      };
    }
    return {
      isForSimpleWidget: t,
      tabSize: n,
      indentSize: i,
      insertSpaces: r,
      detectIndentation: l,
      defaultEOL: o,
      trimAutoWhitespace: a,
      largeFileOptimizations: c,
      bracketPairColorizationOptions: d,
    };
  }
  _getEOL(e, t) {
    if (e) return this._resourcePropertiesService.getEOL(e, t);
    const n = this._configurationService.getValue("files.eol", { overrideIdentifier: t });
    return n && "string" == typeof n && "auto" !== n ? n : 3 === GR || 2 === GR ? "\n" : "\r\n";
  }
  _shouldRestoreUndoStack() {
    const e = this._configurationService.getValue("files.restoreUndoStack");
    return "boolean" != typeof e || e;
  }
  getCreationOptions(e, t, n) {
    const i = "string" == typeof e ? e : e.languageId;
    let r = this._modelCreationOptionsByLanguageAndResource[i + t];
    if (!r) {
      const e = this._configurationService.getValue("editor", {
          overrideIdentifier: i,
          resource: t,
        }),
        o = this._getEOL(t, i);
      ((r = rUe._readModelOptions({ editor: e, eol: o }, n)),
        (this._modelCreationOptionsByLanguageAndResource[i + t] = r));
    }
    return r;
  }
  _updateModelOptions(e) {
    const t = this._modelCreationOptionsByLanguageAndResource;
    this._modelCreationOptionsByLanguageAndResource = Object.create(null);
    const n = Object.keys(this._models);
    for (let i = 0, r = n.length; i < r; i++) {
      const r = n[i],
        o = this._models[r],
        s = o.model.getLanguageId(),
        a = o.model.uri;
      if (
        e &&
        !e.affectsConfiguration("editor", { overrideIdentifier: s, resource: a }) &&
        !e.affectsConfiguration("files.eol", { overrideIdentifier: s, resource: a })
      )
        continue;
      const l = t[s + a],
        c = this.getCreationOptions(s, a, o.model.isForSimpleWidget);
      rUe._setModelOptionsForModel(o.model, c, l);
    }
  }
  static _setModelOptionsForModel(e, t, n) {
    (n &&
      n.defaultEOL !== t.defaultEOL &&
      1 === e.getLineCount() &&
      e.setEOL(1 === t.defaultEOL ? 0 : 1),
      (n &&
        n.detectIndentation === t.detectIndentation &&
        n.insertSpaces === t.insertSpaces &&
        n.tabSize === t.tabSize &&
        n.indentSize === t.indentSize &&
        n.trimAutoWhitespace === t.trimAutoWhitespace &&
        zz(n.bracketPairColorizationOptions, t.bracketPairColorizationOptions)) ||
        (t.detectIndentation
          ? (e.detectIndentation(t.insertSpaces, t.tabSize),
            e.updateOptions({
              trimAutoWhitespace: t.trimAutoWhitespace,
              bracketColorizationOptions: t.bracketPairColorizationOptions,
            }))
          : e.updateOptions({
              insertSpaces: t.insertSpaces,
              tabSize: t.tabSize,
              indentSize: t.indentSize,
              trimAutoWhitespace: t.trimAutoWhitespace,
              bracketColorizationOptions: t.bracketPairColorizationOptions,
            })));
  }
  _insertDisposedModel(e) {
    (this._disposedModels.set(sUe(e.uri), e), (this._disposedModelsHeapSize += e.heapSize));
  }
  _removeDisposedModel(e) {
    const t = this._disposedModels.get(sUe(e));
    return (
      t && (this._disposedModelsHeapSize -= t.heapSize),
      this._disposedModels.delete(sUe(e)),
      t
    );
  }
  _ensureDisposedModelsHeapSize(e) {
    if (this._disposedModelsHeapSize > e) {
      const t = [];
      for (
        this._disposedModels.forEach((e) => {
          e.sharesUndoRedoStack || t.push(e);
        }),
          t.sort((e, t) => e.time - t.time);
        t.length > 0 && this._disposedModelsHeapSize > e;
      ) {
        const e = t.shift();
        (this._removeDisposedModel(e.uri),
          null !== e.initialUndoRedoSnapshot &&
            this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot));
      }
    }
  }
  _createModelData(e, t, n, i) {
    const r = this.getCreationOptions(t, n, i),
      o = this._instantiationService.createInstance(Q7, e, t, r, n);
    if (n && this._disposedModels.has(sUe(n))) {
      const e = this._removeDisposedModel(n),
        t = this._undoRedoService.getElements(n),
        i = this._getSHA1Computer(),
        r = !!i.canComputeSHA1(o) && i.computeSHA1(o) === e.sha1;
      if (r || e.sharesUndoRedoStack) {
        for (const e of t.past) E8(e) && e.matchesResource(n) && e.setModel(o);
        for (const e of t.future) E8(e) && e.matchesResource(n) && e.setModel(o);
        (this._undoRedoService.setElementsValidFlag(n, !0, (e) => E8(e) && e.matchesResource(n)),
          r &&
            (o._overwriteVersionId(e.versionId),
            o._overwriteAlternativeVersionId(e.alternativeVersionId),
            o._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot)));
      } else
        null !== e.initialUndoRedoSnapshot &&
          this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot);
    }
    const s = sUe(o.uri);
    if (this._models[s])
      throw new Error("ModelService: Cannot add model because it already exists!");
    const a = new aUe(
      o,
      (e) => this._onWillDispose(e),
      (e, t) => this._onDidChangeLanguage(e, t),
    );
    return ((this._models[s] = a), a);
  }
  createModel(e, t, n, i = !1) {
    let r;
    return (
      (r = t ? this._createModelData(e, t, n, i) : this._createModelData(e, a$, n, i)),
      this._onModelAdded.fire(r.model),
      r.model
    );
  }
  getModels() {
    const e = [],
      t = Object.keys(this._models);
    for (let n = 0, i = t.length; n < i; n++) {
      const i = t[n];
      e.push(this._models[i].model);
    }
    return e;
  }
  getModel(e) {
    const t = sUe(e),
      n = this._models[t];
    return n ? n.model : null;
  }
  _schemaShouldMaintainUndoRedoElements(e) {
    return (
      e.scheme === NP.file ||
      e.scheme === NP.vscodeRemote ||
      e.scheme === NP.vscodeUserData ||
      e.scheme === NP.vscodeNotebookCell ||
      "fake-fs" === e.scheme
    );
  }
  _onWillDispose(e) {
    const t = sUe(e.uri),
      n = this._models[t],
      i = this._undoRedoService.getUriComparisonKey(e.uri) !== e.uri.toString();
    let r = !1,
      o = 0;
    if (
      i ||
      (this._shouldRestoreUndoStack() && this._schemaShouldMaintainUndoRedoElements(e.uri))
    ) {
      const t = this._undoRedoService.getElements(e.uri);
      if (t.past.length > 0 || t.future.length > 0) {
        for (const n of t.past)
          E8(n) &&
            n.matchesResource(e.uri) &&
            ((r = !0), (o += n.heapSize(e.uri)), n.setModel(e.uri));
        for (const n of t.future)
          E8(n) &&
            n.matchesResource(e.uri) &&
            ((r = !0), (o += n.heapSize(e.uri)), n.setModel(e.uri));
      }
    }
    const s = rUe.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,
      a = this._getSHA1Computer();
    if (r)
      if (i || (!(o > s) && a.canComputeSHA1(e)))
        (this._ensureDisposedModelsHeapSize(s - o),
          this._undoRedoService.setElementsValidFlag(
            e.uri,
            !1,
            (t) => E8(t) && t.matchesResource(e.uri),
          ),
          this._insertDisposedModel(
            new cUe(
              e.uri,
              n.model.getInitialUndoRedoSnapshot(),
              Date.now(),
              i,
              o,
              a.computeSHA1(e),
              e.getVersionId(),
              e.getAlternativeVersionId(),
            ),
          ));
      else {
        const e = n.model.getInitialUndoRedoSnapshot();
        null !== e && this._undoRedoService.restoreSnapshot(e);
      }
    else if (!i) {
      const e = n.model.getInitialUndoRedoSnapshot();
      null !== e && this._undoRedoService.restoreSnapshot(e);
    }
    (delete this._models[t],
      n.dispose(),
      delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId() + e.uri],
      this._onModelRemoved.fire(e));
  }
  _onDidChangeLanguage(e, t) {
    const n = t.oldLanguage,
      i = e.getLanguageId(),
      r = this.getCreationOptions(n, e.uri, e.isForSimpleWidget),
      o = this.getCreationOptions(i, e.uri, e.isForSimpleWidget);
    (rUe._setModelOptionsForModel(e, o, r),
      this._onModelModeChanged.fire({ model: e, oldLanguageId: n }));
  }
  _getSHA1Computer() {
    return new uUe();
  }
};
dUe = rUe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([oUe(0, OU), oUe(1, $Ae), oUe(2, B7), oUe(3, vV)], dUe);
class uUe {
  static {
    this.MAX_MODEL_SIZE = 10485760;
  }
  canComputeSHA1(e) {
    return e.getValueLength() <= uUe.MAX_MODEL_SIZE;
  }
  computeSHA1(e) {
    const t = new YP(),
      n = e.createSnapshot();
    let i;
    for (; (i = n.read()); ) t.update(i);
    return t.digest();
  }
}
var hUe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let gUe = class extends PO {
  constructor(e, t) {
    (super(),
      (this.quickInputService = e),
      (this.instantiationService = t),
      (this.registry = NW.as(BFe)),
      (this.mapProviderToDescriptor = new Map()),
      (this.lastAcceptedPickerValues = new Map()),
      (this.visibleQuickAccess = void 0),
      this._register(
        MO(() => {
          for (const e of this.mapProviderToDescriptor.values()) TO(e) && e.dispose();
          this.visibleQuickAccess?.picker.dispose();
        }),
      ));
  }
  show(e = "", t) {
    this.doShowOrPick(e, !1, t);
  }
  doShowOrPick(e, t, n) {
    const [i, r] = this.getOrInstantiateProvider(e, n?.enabledProviderPrefixes),
      o = this.visibleQuickAccess,
      s = o?.descriptor;
    if (o && r && s === r)
      return (
        e === r.prefix || n?.preserveValue || (o.picker.value = e),
        void this.adjustValueSelection(o.picker, r, n)
      );
    if (r && !n?.preserveValue) {
      let t;
      if (o && s && s !== r) {
        const e = o.value.substr(s.prefix.length);
        e && (t = `${r.prefix}${e}`);
      }
      if (!t) {
        const e = i?.defaultFilterValue;
        e === FFe.LAST
          ? (t = this.lastAcceptedPickerValues.get(r))
          : "string" == typeof e && (t = `${r.prefix}${e}`);
      }
      "string" == typeof t && (e = t);
    }
    const a = o?.picker?.valueSelection,
      l = o?.picker?.value,
      c = new AO(),
      d = c.add(this.quickInputService.createQuickPick({ useSeparators: !0 }));
    let u;
    ((d.value = e),
      this.adjustValueSelection(d, r, n),
      (d.placeholder = n?.placeholder ?? r?.placeholder),
      (d.quickNavigate = n?.quickNavigateConfiguration),
      (d.hideInput = !!d.quickNavigate && !o),
      ("number" == typeof n?.itemActivation || n?.quickNavigateConfiguration) &&
        (d.itemActivation = n?.itemActivation ?? $he.SECOND),
      (d.contextKey = r?.contextKey),
      (d.filterValue = (e) => e.substring(r ? r.prefix.length : 0)),
      t &&
        ((u = new DM()),
        c.add(
          $O.once(d.onWillAccept)((e) => {
            (e.veto(), d.hide());
          }),
        )),
      c.add(this.registerPickerListeners(d, i, r, e, n)));
    const h = c.add(new cM());
    return (
      i && c.add(i.provide(d, h.token, n?.providerOptions)),
      $O.once(d.onDidHide)(() => {
        (0 === d.selectedItems.length && h.cancel(),
          c.dispose(),
          u?.complete(d.selectedItems.slice(0)));
      }),
      d.show(),
      a && l === e && (d.valueSelection = a),
      t ? u?.p : void 0
    );
  }
  adjustValueSelection(e, t, n) {
    let i;
    ((i = n?.preserveValue
      ? [e.value.length, e.value.length]
      : [t?.prefix.length ?? 0, e.value.length]),
      (e.valueSelection = i));
  }
  registerPickerListeners(e, t, n, i, r) {
    const o = new AO(),
      s = (this.visibleQuickAccess = { picker: e, descriptor: n, value: i });
    return (
      o.add(
        MO(() => {
          s === this.visibleQuickAccess && (this.visibleQuickAccess = void 0);
        }),
      ),
      o.add(
        e.onDidChangeValue((e) => {
          const [n] = this.getOrInstantiateProvider(e, r?.enabledProviderPrefixes);
          n !== t
            ? this.show(e, {
                enabledProviderPrefixes: r?.enabledProviderPrefixes,
                preserveValue: !0,
                providerOptions: r?.providerOptions,
              })
            : (s.value = e);
        }),
      ),
      n &&
        o.add(
          e.onDidAccept(() => {
            this.lastAcceptedPickerValues.set(n, e.value);
          }),
        ),
      o
    );
  }
  getOrInstantiateProvider(e, t) {
    const n = this.registry.getQuickAccessProvider(e);
    if (!n || (t && !t?.includes(n.prefix))) return [void 0, void 0];
    let i = this.mapProviderToDescriptor.get(n);
    return (
      i ||
        ((i = this.instantiationService.createInstance(n.ctor)),
        this.mapProviderToDescriptor.set(n, i)),
      [i, n]
    );
  }
};
gUe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([hUe(0, Ghe), hUe(1, vV)], gUe);
class pUe {
  constructor(e) {
    this.nodes = e;
  }
  toString() {
    return this.nodes.map((e) => ("string" == typeof e ? e : e.label)).join("");
  }
}
!(function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  o > 3 && s && Object.defineProperty(t, n, s);
})([tJ], pUe.prototype, "toString", null);
const fUe = /\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;
const mUe = {},
  _Ue = new dre("quick-input-button-icon-");
function vUe(e, t, n) {
  let i =
    e.iconClass ||
    (function (e) {
      if (!e) return;
      let t;
      const n = e.dark.toString();
      return (
        mUe[n]
          ? (t = mUe[n])
          : ((t = _Ue.nextId()),
            cG(`.${t}, .hc-light .${t}`, `background-image: ${Une(e.light || e.dark)}`),
            cG(`.vs-dark .${t}, .hc-black .${t}`, `background-image: ${Une(e.dark)}`),
            (mUe[n] = t)),
        t
      );
    })(e.iconPath);
  return (
    e.alwaysVisible && (i = i ? `${i} always-visible` : "always-visible"),
    { id: t, label: "", tooltip: e.tooltip || "", class: i, enabled: !0, run: n }
  );
}
function bUe(e, t, n) {
  PB(t);
  const i = (function (e) {
    const t = [];
    let n,
      i = 0;
    for (; (n = fUe.exec(e)); ) {
      n.index - i > 0 && t.push(e.substring(i, n.index));
      const [, r, o, , s] = n;
      (s ? t.push({ label: r, href: o, title: s }) : t.push({ label: r, href: o }),
        (i = n.index + n[0].length));
    }
    return (i < e.length && t.push(e.substring(i)), new pUe(t));
  })(e);
  let r = 0;
  for (const o of i.nodes)
    if ("string" == typeof o) t.append(...Wse(o));
    else {
      let e = o.title;
      !e && o.href.startsWith("command:")
        ? (e = SI(1771, "Click to execute command '{0}'", o.href.substring(8)))
        : e || (e = o.href);
      const i = VB("a", { href: o.href, title: e, tabIndex: r++ }, o.label);
      i.style.textDecoration = "underline";
      const s = (e) => {
          (TB(e) && IB(e, !0), n.callback(o.href));
        },
        a = n.disposables.add(new RJ(i, DB.CLICK)).event,
        l = n.disposables.add(new RJ(i, DB.KEY_DOWN)).event,
        c = $O.chain(l, (e) =>
          e.filter((e) => {
            const t = new wO(e);
            return t.equals(10) || t.equals(3);
          }),
        );
      n.disposables.add(iJ.addTarget(i));
      const d = n.disposables.add(new RJ(i, nJ.Tap)).event;
      ($O.any(a, d, c)(s, null, n.disposables), t.appendChild(i));
    }
}
var yUe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
const xUe = "inQuickInput",
  wUe = new yW(xUe, !1, SI(1748, "Whether keyboard focus is inside the quick input control")),
  CUe = eW.has(xUe),
  SUe = new yW("quickInputAlignment", "top", SI(1749, "The alignment of the quick input")),
  kUe = "quickInputType",
  EUe = new yW(kUe, void 0, SI(1750, "The type of the currently visible quick input")),
  NUe = "cursorAtEndOfQuickInputBox",
  LUe = new yW(
    NUe,
    !1,
    SI(1751, "Whether the cursor in the quick input is at the end of the input box"),
  ),
  DUe = eW.has(NUe),
  TUe = { iconClass: AV.asClassName(OV.quickInputBack), tooltip: SI(1752, "Back") };
class IUe extends PO {
  static {
    this.noPromptMessage = SI(1753, "Press 'Enter' to confirm your input or 'Escape' to cancel");
  }
  constructor(e) {
    (super(),
      (this.ui = e),
      (this._visible = LF("visible", !1)),
      (this._widgetUpdated = !1),
      (this._enabled = !0),
      (this._busy = !1),
      (this._ignoreFocusOut = !1),
      (this._leftButtons = []),
      (this._rightButtons = []),
      (this._inlineButtons = []),
      (this.buttonsUpdated = !1),
      (this._toggles = []),
      (this.togglesUpdated = !1),
      (this.noValidationMessage = IUe.noPromptMessage),
      (this._severity = G4.Ignore),
      (this.onDidTriggerButtonEmitter = this._register(new QO())),
      (this.onDidHideEmitter = this._register(new QO())),
      (this.onWillHideEmitter = this._register(new QO())),
      (this.onDisposeEmitter = this._register(new QO())),
      (this.visibleDisposables = this._register(new AO())),
      (this.onDidHide = this.onDidHideEmitter.event));
  }
  get visible() {
    return this._visible.get();
  }
  get title() {
    return this._title;
  }
  set title(e) {
    ((this._title = e), this.update());
  }
  get description() {
    return this._description;
  }
  set description(e) {
    ((this._description = e), this.update());
  }
  get step() {
    return this._steps;
  }
  set step(e) {
    ((this._steps = e), this.update());
  }
  get totalSteps() {
    return this._totalSteps;
  }
  set totalSteps(e) {
    ((this._totalSteps = e), this.update());
  }
  get enabled() {
    return this._enabled;
  }
  set enabled(e) {
    ((this._enabled = e), this.update());
  }
  get contextKey() {
    return this._contextKey;
  }
  set contextKey(e) {
    ((this._contextKey = e), this.update());
  }
  get busy() {
    return this._busy;
  }
  set busy(e) {
    ((this._busy = e), this.update());
  }
  get ignoreFocusOut() {
    return this._ignoreFocusOut;
  }
  set ignoreFocusOut(e) {
    const t = this._ignoreFocusOut !== e && !WR;
    ((this._ignoreFocusOut = e && !WR), t && 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(e) {
    ((this._leftButtons = e.filter((e) => e === TUe)),
      (this._rightButtons = e.filter((e) => e !== TUe && e.location !== Khe.Inline)),
      (this._inlineButtons = e.filter((e) => e.location === Khe.Inline)),
      (this.buttonsUpdated = !0),
      this.update());
  }
  get toggles() {
    return this._toggles;
  }
  set toggles(e) {
    ((this._toggles = e ?? []), (this.togglesUpdated = !0), this.update());
  }
  get validationMessage() {
    return this._validationMessage;
  }
  set validationMessage(e) {
    ((this._validationMessage = e), this.update());
  }
  get severity() {
    return this._severity;
  }
  set severity(e) {
    ((this._severity = e), this.update());
  }
  show() {
    this.visible ||
      (this.visibleDisposables.add(
        this.ui.onDidTriggerButton((e) => {
          -1 !== this.buttons.indexOf(e) && this.onDidTriggerButtonEmitter.fire(e);
        }),
      ),
      this.ui.show(this),
      this._visible.set(!0, void 0),
      (this._lastValidationMessage = void 0),
      (this._lastSeverity = void 0),
      this.buttons.length && (this.buttonsUpdated = !0),
      this.toggles.length && (this.togglesUpdated = !0),
      this.update());
  }
  hide() {
    this.visible && this.ui.hide();
  }
  didHide(e = Uhe.Other) {
    (this._visible.set(!1, void 0),
      this.visibleDisposables.clear(),
      this.onDidHideEmitter.fire({ reason: e }));
  }
  willHide(e = Uhe.Other) {
    this.onWillHideEmitter.fire({ reason: e });
  }
  update() {
    if (!this.visible) return;
    const e = this.getTitle();
    e && this.ui.title.textContent !== e
      ? (this.ui.title.textContent = e)
      : e || "&nbsp;" === this.ui.title.innerHTML || (this.ui.title.innerText = " ");
    const t = this.getDescription();
    if (
      (this.ui.description1.textContent !== t && (this.ui.description1.textContent = t),
      this.ui.description2.textContent !== t && (this.ui.description2.textContent = t),
      this._widgetUpdated &&
        ((this._widgetUpdated = !1),
        this._widget ? PB(this.ui.widget, this._widget) : PB(this.ui.widget)),
      this.busy &&
        !this.busyDelay &&
        ((this.busyDelay = new SM()),
        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 = !1), this.ui.leftActionBar.clear());
      const e = this._leftButtons.map((e, t) =>
        vUe(e, `id-${t}`, async () => this.onDidTriggerButtonEmitter.fire(e)),
      );
      (this.ui.leftActionBar.push(e, { icon: !0, label: !1 }), this.ui.rightActionBar.clear());
      const t = this._rightButtons.map((e, t) =>
        vUe(e, `id-${t}`, async () => this.onDidTriggerButtonEmitter.fire(e)),
      );
      (this.ui.rightActionBar.push(t, { icon: !0, label: !1 }), this.ui.inlineActionBar.clear());
      const n = this._inlineButtons.map((e, t) =>
        vUe(e, `id-${t}`, async () => this.onDidTriggerButtonEmitter.fire(e)),
      );
      this.ui.inlineActionBar.push(n, { icon: !0, label: !1 });
    }
    if (this.togglesUpdated) {
      this.togglesUpdated = !1;
      const e = this.toggles?.filter((e) => e instanceof R_e) ?? [];
      this.ui.inputBox.toggles = e;
      const t = 22 * e.length;
      ((this.ui.countContainer.style.right = t > 0 ? `${4 + t}px` : "4px"),
        (this.ui.visibleCountContainer.style.right = t > 0 ? `${4 + t}px` : "4px"));
    }
    ((this.ui.ignoreFocusOut = this.ignoreFocusOut),
      this.ui.setEnabled(this.enabled),
      this.ui.setContextKey(this.contextKey));
    const n = this.validationMessage || this.noValidationMessage;
    (this._lastValidationMessage !== n &&
      ((this._lastValidationMessage = n),
      PB(this.ui.message),
      n &&
        bUe(n, this.ui.message, {
          callback: (e) => {
            this.ui.linkOpenerDelegate(e);
          },
          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
      ? SI(1754, "{0}/{1}", this.step, this.totalSteps)
      : this.step
        ? String(this.step)
        : "";
  }
  showMessageDecoration(e) {
    if ((this.ui.inputBox.showDecoration(e), e !== G4.Ignore)) {
      const t = this.ui.inputBox.stylesForType(e);
      ((this.ui.message.style.color = t.foreground ? `${t.foreground}` : ""),
        (this.ui.message.style.backgroundColor = t.background ? `${t.background}` : ""),
        (this.ui.message.style.border = t.border ? `1px solid ${t.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());
  }
}
class RUe extends IUe {
  static {
    this.DEFAULT_ARIA_LABEL = SI(1755, "Type to narrow down results.");
  }
  constructor(e) {
    (super(e),
      (this._value = ""),
      (this.onDidChangeValueEmitter = this._register(new QO())),
      (this.onWillAcceptEmitter = this._register(new QO())),
      (this.onDidAcceptEmitter = this._register(new QO())),
      (this.onDidCustomEmitter = this._register(new QO())),
      (this._items = []),
      (this.itemsUpdated = !1),
      (this._canSelectMany = !1),
      (this._canAcceptInBackground = !1),
      (this._matchOnDescription = !1),
      (this._matchOnDetail = !1),
      (this._matchOnLabel = !0),
      (this._matchOnLabelMode = "fuzzy"),
      (this._sortByLabel = !0),
      (this._keepScrollPosition = !1),
      (this._itemActivation = $he.FIRST),
      (this._activeItems = []),
      (this.activeItemsUpdated = !1),
      (this.activeItemsToConfirm = []),
      (this.onDidChangeActiveEmitter = this._register(new QO())),
      (this._selectedItems = []),
      (this.selectedItemsUpdated = !1),
      (this.selectedItemsToConfirm = []),
      (this.onDidChangeSelectionEmitter = this._register(new QO())),
      (this.onDidTriggerItemButtonEmitter = this._register(new QO())),
      (this.onDidTriggerSeparatorButtonEmitter = this._register(new QO())),
      (this.valueSelectionUpdated = !0),
      (this._ok = "default"),
      (this._customButton = !1),
      (this._focusEventBufferer = new rM()),
      (this.type = "quickPick"),
      (this.filterValue = (e) => e),
      (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(e) {
    ((this._quickNavigate = e), this.update());
  }
  get value() {
    return this._value;
  }
  set value(e) {
    this.doSetValue(e);
  }
  doSetValue(e, t) {
    if (this._value !== e) {
      if (((this._value = e), t || this.update(), this.visible)) {
        this.ui.list.filter(this.filterValue(this._value)) && this.trySelectFirst();
      }
      this.onDidChangeValueEmitter.fire(this._value);
    }
  }
  set ariaLabel(e) {
    ((this._ariaLabel = e), this.update());
  }
  get ariaLabel() {
    return this._ariaLabel;
  }
  get placeholder() {
    return this._placeholder;
  }
  set placeholder(e) {
    ((this._placeholder = e), this.update());
  }
  get prompt() {
    return this.noValidationMessage;
  }
  set prompt(e) {
    ((this.noValidationMessage = e), this.update());
  }
  get items() {
    return this._items;
  }
  get scrollTop() {
    return this.ui.list.scrollTop;
  }
  set scrollTop(e) {
    this.ui.list.scrollTop = e;
  }
  set items(e) {
    ((this._items = e), (this.itemsUpdated = !0), this.update());
  }
  get canSelectMany() {
    return this._canSelectMany;
  }
  set canSelectMany(e) {
    ((this._canSelectMany = e), this.update());
  }
  get canAcceptInBackground() {
    return this._canAcceptInBackground;
  }
  set canAcceptInBackground(e) {
    this._canAcceptInBackground = e;
  }
  get matchOnDescription() {
    return this._matchOnDescription;
  }
  set matchOnDescription(e) {
    ((this._matchOnDescription = e), this.update());
  }
  get matchOnDetail() {
    return this._matchOnDetail;
  }
  set matchOnDetail(e) {
    ((this._matchOnDetail = e), this.update());
  }
  get matchOnLabel() {
    return this._matchOnLabel;
  }
  set matchOnLabel(e) {
    ((this._matchOnLabel = e), this.update());
  }
  get matchOnLabelMode() {
    return this._matchOnLabelMode;
  }
  set matchOnLabelMode(e) {
    ((this._matchOnLabelMode = e), this.update());
  }
  get sortByLabel() {
    return this._sortByLabel;
  }
  set sortByLabel(e) {
    ((this._sortByLabel = e), this.update());
  }
  get keepScrollPosition() {
    return this._keepScrollPosition;
  }
  set keepScrollPosition(e) {
    this._keepScrollPosition = e;
  }
  get itemActivation() {
    return this._itemActivation;
  }
  set itemActivation(e) {
    this._itemActivation = e;
  }
  get activeItems() {
    return this._activeItems;
  }
  set activeItems(e) {
    ((this._activeItems = e), (this.activeItemsUpdated = !0), this.update());
  }
  get selectedItems() {
    return this._selectedItems;
  }
  set selectedItems(e) {
    ((this._selectedItems = e), (this.selectedItemsUpdated = !0), this.update());
  }
  get keyMods() {
    return this._quickNavigate ? zhe : this.ui.keyMods;
  }
  get valueSelection() {
    const e = this.ui.inputBox.getSelection();
    if (e) return [e.start, e.end];
  }
  set valueSelection(e) {
    ((this._valueSelection = e), (this.valueSelectionUpdated = !0), this.update());
  }
  get customButton() {
    return this._customButton;
  }
  set customButton(e) {
    ((this._customButton = e), this.update());
  }
  get customLabel() {
    return this._customButtonLabel;
  }
  set customLabel(e) {
    ((this._customButtonLabel = e), this.update());
  }
  get customHover() {
    return this._customButtonHover;
  }
  set customHover(e) {
    ((this._customButtonHover = e), this.update());
  }
  get ok() {
    return this._ok;
  }
  set ok(e) {
    ((this._ok = e), this.update());
  }
  get okLabel() {
    return this._okLabel ?? SI(1756, "OK");
  }
  set okLabel(e) {
    ((this._okLabel = e), this.update());
  }
  get hideInput() {
    return !!this._hideInput;
  }
  set hideInput(e) {
    ((this._hideInput = e), this.update());
  }
  trySelectFirst() {
    this.canSelectMany || this.ui.list.focus(qhe.First);
  }
  show() {
    (this.visible ||
      (this.visibleDisposables.add(
        this.ui.inputBox.onDidChange((e) => {
          this.doSetValue(e, !0);
        }),
      ),
      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(!1));
        }),
      ),
      this.visibleDisposables.add(
        this.ui.onDidCustom(() => {
          this.onDidCustomEmitter.fire();
        }),
      ),
      this.visibleDisposables.add(
        this._focusEventBufferer.wrapEvent(
          this.ui.list.onDidChangeFocus,
          (e, t) => t,
        )((e) => {
          this.activeItemsUpdated ||
            (this.activeItemsToConfirm !== this._activeItems &&
              XP(e, this._activeItems, (e, t) => e === t)) ||
            ((this._activeItems = e), this.onDidChangeActiveEmitter.fire(e));
        }),
      ),
      this.visibleDisposables.add(
        this.ui.list.onDidChangeSelection(({ items: e, event: t }) => {
          !this.canSelectMany || e.some((e) => !1 === e.pickable)
            ? (this.selectedItemsToConfirm !== this._selectedItems &&
                XP(e, this._selectedItems, (e, t) => e === t)) ||
              ((this._selectedItems = e),
              this.onDidChangeSelectionEmitter.fire(e),
              e.length && this.handleAccept(NB(t) && 1 === t.button))
            : e.length && this.ui.list.setSelectedElements([]);
        }),
      ),
      this.visibleDisposables.add(
        this.ui.list.onChangedCheckedElements((e) => {
          this.canSelectMany &&
            this.visible &&
            ((this.selectedItemsToConfirm !== this._selectedItems &&
              XP(e, this._selectedItems, (e, t) => e === t)) ||
              ((this._selectedItems = e), this.onDidChangeSelectionEmitter.fire(e)));
        }),
      ),
      this.visibleDisposables.add(
        this.ui.list.onButtonTriggered((e) => this.onDidTriggerItemButtonEmitter.fire(e)),
      ),
      this.visibleDisposables.add(
        this.ui.list.onSeparatorButtonTriggered((e) =>
          this.onDidTriggerSeparatorButtonEmitter.fire(e),
        ),
      ),
      this.visibleDisposables.add(this.registerQuickNavigation()),
      (this.valueSelectionUpdated = !0)),
      super.show());
  }
  handleAccept(e) {
    let t = !1;
    (this.onWillAcceptEmitter.fire({ veto: () => (t = !0) }),
      t || this.onDidAcceptEmitter.fire({ inBackground: e }));
  }
  registerQuickNavigation() {
    return $F(this.ui.container, DB.KEY_UP, (e) => {
      if (this.canSelectMany || !this._quickNavigate) return;
      const t = new wO(e),
        n = t.keyCode,
        i = this._quickNavigate.keybindings.some((e) => {
          const i = e.getChords();
          return (
            !(i.length > 1) &&
            (i[0].shiftKey && 4 === n
              ? !(t.ctrlKey || t.altKey || t.metaKey)
              : !(!i[0].altKey || 6 !== n) ||
                !(!i[0].ctrlKey || 5 !== n) ||
                !(!i[0].metaKey || 57 !== n))
          );
        });
      i &&
        (this.activeItems[0] &&
          ((this._selectedItems = [this.activeItems[0]]),
          this.onDidChangeSelectionEmitter.fire(this.selectedItems),
          this.handleAccept(!1)),
        (this._quickNavigate = void 0));
    });
  }
  update() {
    if (!this.visible) return;
    const e = this.keepScrollPosition ? this.scrollTop : 0,
      t = !!this.description,
      n = {
        title: !!this.title || !!this.step || !!this.titleButtons.length,
        description: t,
        checkAll: this.canSelectMany && !this._hideCheckAll,
        checkBox: this.canSelectMany,
        inputBox: !this._hideInput,
        progressBar: !this._hideInput || t,
        visibleCount: !0,
        count: this.canSelectMany && !this._hideCountBadge,
        ok: "default" === this.ok ? this.canSelectMany : this.ok,
        list: !0,
        message: !!this.validationMessage || !!this.prompt,
        customButton: this.customButton,
      };
    (this.ui.setVisibilities(n),
      super.update(),
      this.ui.inputBox.value !== this.value && (this.ui.inputBox.value = this.value),
      this.valueSelectionUpdated &&
        ((this.valueSelectionUpdated = !1),
        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 i = this.ariaLabel;
    (!i &&
      n.inputBox &&
      ((i = this.placeholder),
      this.title && (i = i ? `${i} - ${this.title}` : this.title),
      i || (i = RUe.DEFAULT_ARIA_LABEL)),
      this.ui.list.ariaLabel !== i && (this.ui.list.ariaLabel = i ?? null),
      this.ui.inputBox.ariaLabel !== i && (this.ui.inputBox.ariaLabel = i ?? "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 = !1),
        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 $he.NONE:
              this._itemActivation = $he.FIRST;
              break;
            case $he.SECOND:
              (this.ui.list.focus(qhe.Second), (this._itemActivation = $he.FIRST));
              break;
            case $he.LAST:
              (this.ui.list.focus(qhe.Last), (this._itemActivation = $he.FIRST));
              break;
            default:
              this.trySelectFirst();
          }
        })),
      this.ui.container.classList.contains("show-checkboxes") !== !!this.canSelectMany &&
        (this.canSelectMany ? this.ui.list.clearFocus() : this.trySelectFirst()),
      this.activeItemsUpdated &&
        ((this.activeItemsUpdated = !1),
        (this.activeItemsToConfirm = this._activeItems),
        this.ui.list.setFocusedElements(this.activeItems),
        this.activeItemsToConfirm === this._activeItems && (this.activeItemsToConfirm = null)),
      this.selectedItemsUpdated &&
        ((this.selectedItemsUpdated = !1),
        (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 || ""),
      n.inputBox || (this.ui.list.domFocus(), this.canSelectMany && this.ui.list.focus(qhe.First)),
      this.keepScrollPosition && (this.scrollTop = e));
  }
  focus(e) {
    (this.ui.list.focus(e), this.canSelectMany && this.ui.list.domFocus());
  }
  accept(e) {
    (e && !this._canAcceptInBackground) ||
      (this.activeItems[0] &&
        !this._canSelectMany &&
        ((this._selectedItems = [this.activeItems[0]]),
        this.onDidChangeSelectionEmitter.fire(this.selectedItems)),
      this.handleAccept(e ?? !1));
  }
}
class OUe extends IUe {
  constructor() {
    (super(...arguments),
      (this._value = ""),
      (this.valueSelectionUpdated = !0),
      (this._password = !1),
      (this.onDidValueChangeEmitter = this._register(new QO())),
      (this.onDidAcceptEmitter = this._register(new QO())),
      (this.type = "inputBox"),
      (this.onDidChangeValue = this.onDidValueChangeEmitter.event),
      (this.onDidAccept = this.onDidAcceptEmitter.event));
  }
  get value() {
    return this._value;
  }
  set value(e) {
    ((this._value = e || ""), this.update());
  }
  get valueSelection() {
    const e = this.ui.inputBox.getSelection();
    if (e) return [e.start, e.end];
  }
  set valueSelection(e) {
    ((this._valueSelection = e), (this.valueSelectionUpdated = !0), this.update());
  }
  get placeholder() {
    return this._placeholder;
  }
  set placeholder(e) {
    ((this._placeholder = e), this.update());
  }
  get ariaLabel() {
    return this._ariaLabel;
  }
  set ariaLabel(e) {
    ((this._ariaLabel = e), this.update());
  }
  get password() {
    return this._password;
  }
  set password(e) {
    ((this._password = e), this.update());
  }
  get prompt() {
    return this._prompt;
  }
  set prompt(e) {
    ((this._prompt = e),
      (this.noValidationMessage = e
        ? SI(1757, "{0} (Press 'Enter' to confirm or 'Escape' to cancel)", e)
        : IUe.noPromptMessage),
      this.update());
  }
  show() {
    (this.visible ||
      (this.visibleDisposables.add(
        this.ui.inputBox.onDidChange((e) => {
          e !== this.value && ((this._value = e), this.onDidValueChangeEmitter.fire(e));
        }),
      ),
      this.visibleDisposables.add(this.ui.onDidAccept(() => this.onDidAcceptEmitter.fire())),
      (this.valueSelectionUpdated = !0)),
      super.show());
  }
  accept() {
    this.onDidAcceptEmitter.fire();
  }
  update() {
    if (!this.visible) return;
    this.ui.container.classList.remove("hidden-input");
    const e = {
      title: !!this.title || !!this.step || !!this.titleButtons.length,
      description: !!this.description || !!this.step,
      inputBox: !0,
      message: !0,
      progressBar: !0,
    };
    (this.ui.setVisibilities(e),
      super.update(),
      this.ui.inputBox.value !== this.value && (this.ui.inputBox.value = this.value),
      this.valueSelectionUpdated &&
        ((this.valueSelectionUpdated = !1),
        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 t = this.ariaLabel;
    (!t &&
      e.inputBox &&
      (t = this.placeholder
        ? this.title
          ? `${this.placeholder} - ${this.title}`
          : this.placeholder
        : this.title
          ? this.title
          : "input"),
      this.ui.inputBox.ariaLabel !== t && (this.ui.inputBox.ariaLabel = t || "input"));
  }
}
let MUe = class extends Que {
  constructor(e, t) {
    super("mouse", void 0, (e) => this.getOverrideOptions(e), e, t);
  }
  getOverrideOptions(e) {
    return {
      persistence: { hideOnKeyDown: !1 },
      appearance: {
        showHoverHint: (SB(e.content)
          ? (e.content.textContent ?? "")
          : "string" == typeof e.content
            ? e.content
            : e.content.value
        ).includes("\n"),
        skipFadeInAnimation: !0,
      },
    };
  }
};
MUe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([yUe(0, OU), yUe(1, Xue)], MUe);
const AUe = "done",
  PUe = "active",
  jUe = "infinite",
  FUe = "infinite-long-running",
  BUe = "discrete";
class VUe extends PO {
  static {
    this.LONG_RUNNING_INFINITE_THRESHOLD = 1e4;
  }
  constructor(e, t) {
    (super(),
      (this.progressSignal = this._register(new jO())),
      (this.workedVal = 0),
      (this.showDelayedScheduler = this._register(new EM(() => WB(this.element), 0))),
      (this.longRunningScheduler = this._register(
        new EM(() => this.infiniteLongRunning(), VUe.LONG_RUNNING_INFINITE_THRESHOLD),
      )),
      this.create(e, t));
  }
  create(e, t) {
    ((this.element = document.createElement("div")),
      this.element.classList.add("monaco-progress-container"),
      this.element.setAttribute("role", "progressbar"),
      this.element.setAttribute("aria-valuemin", "0"),
      e.appendChild(this.element),
      (this.bit = document.createElement("div")),
      this.bit.classList.add("progress-bit"),
      (this.bit.style.backgroundColor = t?.progressBarBackground || "#0E70C0"),
      this.element.appendChild(this.bit));
  }
  off() {
    ((this.bit.style.width = "inherit"),
      (this.bit.style.opacity = "1"),
      this.element.classList.remove(PUe, jUe, FUe, BUe),
      (this.workedVal = 0),
      (this.totalWork = void 0),
      this.longRunningScheduler.cancel(),
      this.progressSignal.clear());
  }
  stop() {
    return this.doDone(!1);
  }
  doDone(e) {
    return (
      this.element.classList.add(AUe),
      this.element.classList.contains(jUe)
        ? ((this.bit.style.opacity = "0"), e ? setTimeout(() => this.off(), 200) : this.off())
        : ((this.bit.style.width = "inherit"), e ? setTimeout(() => this.off(), 200) : this.off()),
      this
    );
  }
  infinite() {
    return (
      (this.bit.style.width = "2%"),
      (this.bit.style.opacity = "1"),
      this.element.classList.remove(BUe, AUe, FUe),
      this.element.classList.add(PUe, jUe),
      this.longRunningScheduler.schedule(),
      this
    );
  }
  infiniteLongRunning() {
    this.element.classList.add(FUe);
  }
  getContainer() {
    return this.element;
  }
}
const WUe = VB;
class HUe extends PO {
  constructor(e, t, n) {
    (super(),
      (this.parent = e),
      (this.onDidChange = (e) => this.findInput.onDidChange(e)),
      (this.container = MB(this.parent, WUe(".quick-input-box"))),
      (this.findInput = this._register(
        new jve(this.container, void 0, { label: "", inputBoxStyles: t, toggleStyles: n }),
      )));
    const i = this.findInput.inputBox.inputElement;
    ((i.role = "textbox"), (i.ariaHasPopup = "menu"), (i.ariaAutoComplete = "list"));
  }
  get onKeyDown() {
    return this.findInput.onKeyDown;
  }
  get value() {
    return this.findInput.getValue();
  }
  set value(e) {
    this.findInput.setValue(e);
  }
  select(e = null) {
    this.findInput.inputBox.select(e);
  }
  getSelection() {
    return this.findInput.inputBox.getSelection();
  }
  isSelectionAtEnd() {
    return this.findInput.inputBox.isSelectionAtEnd();
  }
  get placeholder() {
    return this.findInput.inputBox.inputElement.getAttribute("placeholder") || "";
  }
  set placeholder(e) {
    this.findInput.inputBox.setPlaceHolder(e);
  }
  get password() {
    return "password" === this.findInput.inputBox.inputElement.type;
  }
  set password(e) {
    this.findInput.inputBox.inputElement.type = e ? "password" : "text";
  }
  set enabled(e) {
    this.findInput.inputBox.inputElement.toggleAttribute("readonly", !e);
  }
  set toggles(e) {
    this.findInput.setAdditionalToggles(e);
  }
  get ariaLabel() {
    return this.findInput.inputBox.inputElement.getAttribute("aria-label") || "";
  }
  set ariaLabel(e) {
    this.findInput.inputBox.inputElement.setAttribute("aria-label", e);
  }
  hasFocus() {
    return this.findInput.inputBox.hasFocus();
  }
  setAttribute(e, t) {
    this.findInput.inputBox.inputElement.setAttribute(e, t);
  }
  removeAttribute(e) {
    this.findInput.inputBox.inputElement.removeAttribute(e);
  }
  showDecoration(e) {
    e === G4.Ignore
      ? this.findInput.clearMessage()
      : this.findInput.showMessage({
          type: e === G4.Info ? 1 : e === G4.Warning ? 2 : 3,
          content: "",
        });
  }
  stylesForType(e) {
    return this.findInput.inputBox.stylesForType(e === G4.Info ? 1 : e === G4.Warning ? 2 : 3);
  }
  setFocus() {
    this.findInput.focus();
  }
  layout() {
    this.findInput.inputBox.layout();
  }
}
const zUe = new FM(() => {
  const e = Nz.Collator(void 0, { numeric: !0, sensitivity: "base" }).value;
  return { collator: e, collatorIsNumeric: e.resolvedOptions().numeric };
});
function UUe(e, t, n) {
  const i = e.toLowerCase(),
    r = t.toLowerCase(),
    o = (function (e, t, n) {
      const i = e.toLowerCase(),
        r = t.toLowerCase(),
        o = i.startsWith(n),
        s = r.startsWith(n);
      if (o !== s) return o ? -1 : 1;
      if (o && s) {
        if (i.length < r.length) return -1;
        if (i.length > r.length) return 1;
      }
      return 0;
    })(e, t, n);
  if (o) return o;
  const s = i.endsWith(n);
  if (s !== r.endsWith(n)) return s ? -1 : 1;
  const a = (function (e, t) {
    const n = e || "",
      i = t || "",
      r = zUe.value.collator.compare(n, i);
    return zUe.value.collatorIsNumeric && 0 === r && n !== i ? (n < i ? -1 : 1) : r;
  })(i, r);
  return 0 !== a ? a : i.localeCompare(r);
}
(new FM(() => ({ collator: Nz.Collator(void 0, { numeric: !0 }).value })),
  new FM(() => ({ collator: Nz.Collator(void 0, { numeric: !0, sensitivity: "accent" }).value })));
var $Ue,
  qUe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  KUe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const GUe = VB;
class ZUe {
  constructor(e, t, n) {
    ((this.index = e),
      (this.hasCheckbox = t),
      (this._hidden = !1),
      (this._init = new FM(() => {
        const e = n.label ?? "",
          t = nre(e).text.trim(),
          i =
            n.ariaLabel ||
            [e, this.saneDescription, this.saneDetail]
              .map((e) => ere(e))
              .filter((e) => !!e)
              .join(", ");
        return { saneLabel: e, saneSortLabel: t, saneAriaLabel: i };
      })),
      (this._saneDescription = n.description),
      (this._saneTooltip = n.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(e) {
    this._element = e;
  }
  get hidden() {
    return this._hidden;
  }
  set hidden(e) {
    this._hidden = e;
  }
  get saneDescription() {
    return this._saneDescription;
  }
  set saneDescription(e) {
    this._saneDescription = e;
  }
  get saneDetail() {
    return this._saneDetail;
  }
  set saneDetail(e) {
    this._saneDetail = e;
  }
  get saneTooltip() {
    return this._saneTooltip;
  }
  set saneTooltip(e) {
    this._saneTooltip = e;
  }
  get labelHighlights() {
    return this._labelHighlights;
  }
  set labelHighlights(e) {
    this._labelHighlights = e;
  }
  get descriptionHighlights() {
    return this._descriptionHighlights;
  }
  set descriptionHighlights(e) {
    this._descriptionHighlights = e;
  }
  get detailHighlights() {
    return this._detailHighlights;
  }
  set detailHighlights(e) {
    this._detailHighlights = e;
  }
}
class YUe extends ZUe {
  constructor(e, t, n, i, r, o, s) {
    (super(e, n, o),
      (this.childIndex = t),
      (this.fireButtonTriggered = i),
      (this._onChecked = r),
      (this.item = o),
      (this._separator = s),
      (this._checked = !1),
      (this.onChecked = n
        ? $O.map(
            $O.filter(this._onChecked.event, (e) => e.element === this),
            (e) => e.checked,
          )
        : $O.None),
      (this._saneDetail = o.detail),
      (this._labelHighlights = o.highlights?.label),
      (this._descriptionHighlights = o.highlights?.description),
      (this._detailHighlights = o.highlights?.detail));
  }
  get separator() {
    return this._separator;
  }
  set separator(e) {
    this._separator = e;
  }
  get checked() {
    return this._checked;
  }
  set checked(e) {
    e !== this._checked &&
      ((this._checked = e), this._onChecked.fire({ element: this, checked: e }));
  }
  get checkboxDisabled() {
    return !!this.item.disabled;
  }
}
var XUe;
!(function (e) {
  ((e[(e.NONE = 0)] = "NONE"),
    (e[(e.MOUSE_HOVER = 1)] = "MOUSE_HOVER"),
    (e[(e.ACTIVE_ITEM = 2)] = "ACTIVE_ITEM"));
})(XUe || (XUe = {}));
class QUe extends ZUe {
  constructor(e, t, n) {
    (super(e, !1, n),
      (this.fireSeparatorButtonTriggered = t),
      (this.separator = n),
      (this.children = new Array()),
      (this.focusInsideSeparator = XUe.NONE));
  }
}
class JUe {
  getHeight(e) {
    return e instanceof QUe ? 30 : e.saneDetail ? 44 : 22;
  }
  getTemplateId(e) {
    return e instanceof YUe ? n$e.ID : i$e.ID;
  }
}
class e$e {
  getWidgetAriaLabel() {
    return SI(1770, "Quick Input");
  }
  getAriaLabel(e) {
    return e.separator?.label ? `${e.saneAriaLabel}, ${e.separator.label}` : e.saneAriaLabel;
  }
  getWidgetRole() {
    return "listbox";
  }
  getRole(e) {
    return e.hasCheckbox ? "checkbox" : "option";
  }
  isChecked(e) {
    if (e.hasCheckbox && e instanceof YUe)
      return {
        get value() {
          return e.checked;
        },
        onDidChange: (t) => e.onChecked(() => t()),
      };
  }
}
class t$e {
  constructor(e) {
    this.hoverDelegate = e;
  }
  renderTemplate(e) {
    const t = Object.create(null);
    ((t.toDisposeElement = new AO()),
      (t.toDisposeTemplate = new AO()),
      (t.entry = MB(e, GUe(".quick-input-list-entry"))));
    const n = MB(t.entry, GUe("label.quick-input-list-label"));
    ((t.outerLabel = n),
      (t.checkbox = t.toDisposeTemplate.add(new jO())),
      t.toDisposeTemplate.add(
        KF(n, DB.CLICK, (e) => {
          if (t.checkbox.value && !e.defaultPrevented && t.checkbox.value.enabled) {
            const e = !t.checkbox.value.checked;
            ((t.checkbox.value.checked = e), (t.element.checked = e));
          }
        }),
      ));
    const i = MB(n, GUe(".quick-input-list-rows")),
      r = MB(i, GUe(".quick-input-list-row")),
      o = MB(i, GUe(".quick-input-list-row"));
    ((t.label = new $Ce(r, {
      supportHighlights: !0,
      supportDescriptionHighlights: !0,
      supportIcons: !0,
      hoverDelegate: this.hoverDelegate,
    })),
      t.toDisposeTemplate.add(t.label),
      (t.icon = AB(t.label.element, GUe(".quick-input-list-icon"))));
    const s = MB(r, GUe(".quick-input-list-entry-keybinding"));
    ((t.keybinding = new vpe(s, GR)), t.toDisposeTemplate.add(t.keybinding));
    const a = MB(o, GUe(".quick-input-list-label-meta"));
    return (
      (t.detail = new $Ce(a, {
        supportHighlights: !0,
        supportIcons: !0,
        hoverDelegate: this.hoverDelegate,
      })),
      t.toDisposeTemplate.add(t.detail),
      (t.separator = MB(t.entry, GUe(".quick-input-list-separator"))),
      (t.actionBar = new Cle(
        t.entry,
        this.hoverDelegate ? { hoverDelegate: this.hoverDelegate } : void 0,
      )),
      t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),
      t.toDisposeTemplate.add(t.actionBar),
      t
    );
  }
  disposeTemplate(e) {
    (e.toDisposeElement.dispose(), e.toDisposeTemplate.dispose());
  }
  disposeElement(e, t, n) {
    (n.toDisposeElement.clear(), n.actionBar.clear());
  }
}
let n$e = class extends t$e {
  static {
    $Ue = this;
  }
  static {
    this.ID = "quickpickitem";
  }
  constructor(e, t) {
    (super(e), (this.themeService = t), (this._itemsWithSeparatorsFrequency = new Map()));
  }
  get templateId() {
    return $Ue.ID;
  }
  ensureCheckbox(e, t) {
    if (!e.hasCheckbox) return (t.checkbox.value?.domNode.remove(), void t.checkbox.clear());
    let n = t.checkbox.value;
    (n
      ? n.setTitle(e.saneLabel)
      : ((n = new M_e(e.saneLabel, e.checked, { ...hue, size: 15 })),
        (t.checkbox.value = n),
        t.outerLabel.prepend(n.domNode)),
      e.checkboxDisabled ? n.disable() : n.enable(),
      (n.checked = e.checked),
      t.toDisposeElement.add(e.onChecked((e) => (n.checked = e))),
      t.toDisposeElement.add(n.onChange(() => (e.checked = n.checked))));
  }
  renderElement(e, t, n) {
    const i = e.element;
    ((n.element = i), (i.element = n.entry ?? void 0));
    const r = i.item;
    (i.element.classList.toggle("not-pickable", !1 === i.item.pickable), this.ensureCheckbox(i, n));
    const { labelHighlights: o, descriptionHighlights: s, detailHighlights: a } = i;
    if (r.iconPath) {
      const e = IQ(this.themeService.getColorTheme().type)
          ? r.iconPath.dark
          : (r.iconPath.light ?? r.iconPath.dark),
        t = mP.revive(e);
      ((n.icon.className = "quick-input-list-icon"), (n.icon.style.backgroundImage = Une(t)));
    } else
      ((n.icon.style.backgroundImage = ""),
        (n.icon.className = r.iconClass ? `quick-input-list-icon ${r.iconClass}` : ""));
    let l;
    !i.saneTooltip &&
      i.saneDescription &&
      (l = {
        markdown: { value: HM(i.saneDescription), supportThemeIcons: !0 },
        markdownNotSupportedFallback: i.saneDescription,
      });
    const c = {
      matches: o || [],
      descriptionTitle: l,
      descriptionMatches: s || [],
      labelEscapeNewLines: !0,
    };
    if (
      ((c.extraClasses = r.iconClasses),
      (c.italic = r.italic),
      (c.strikethrough = r.strikethrough),
      n.entry.classList.remove("quick-input-list-separator-as-item"),
      n.label.setLabel(i.saneLabel, i.saneDescription, c),
      n.keybinding.set(r.keybinding),
      i.saneDetail)
    ) {
      let e;
      (i.saneTooltip ||
        (e = {
          markdown: { value: HM(i.saneDetail), supportThemeIcons: !0 },
          markdownNotSupportedFallback: i.saneDetail,
        }),
        (n.detail.element.style.display = ""),
        n.detail.setLabel(i.saneDetail, void 0, { matches: a, title: e, labelEscapeNewLines: !0 }));
    } else n.detail.element.style.display = "none";
    (i.separator?.label
      ? ((n.separator.textContent = i.separator.label),
        (n.separator.style.display = ""),
        this.addItemWithSeparator(i))
      : (n.separator.style.display = "none"),
      n.entry.classList.toggle(
        "quick-input-list-separator-border",
        !!i.separator && 0 !== i.childIndex,
      ));
    const d = r.buttons;
    d && d.length
      ? (n.actionBar.push(
          d.map((e, t) =>
            vUe(e, `id-${t}`, () => i.fireButtonTriggered({ button: e, item: i.item })),
          ),
          { icon: !0, label: !1 },
        ),
        n.entry.classList.add("has-actions"))
      : n.entry.classList.remove("has-actions");
  }
  disposeElement(e, t, n) {
    (this.removeItemWithSeparator(e.element), super.disposeElement(e, t, n));
  }
  isItemWithSeparatorVisible(e) {
    return this._itemsWithSeparatorsFrequency.has(e);
  }
  addItemWithSeparator(e) {
    this._itemsWithSeparatorsFrequency.set(e, (this._itemsWithSeparatorsFrequency.get(e) || 0) + 1);
  }
  removeItemWithSeparator(e) {
    const t = this._itemsWithSeparatorsFrequency.get(e) || 0;
    t > 1
      ? this._itemsWithSeparatorsFrequency.set(e, t - 1)
      : this._itemsWithSeparatorsFrequency.delete(e);
  }
};
n$e = $Ue = qUe([KUe(1, h0)], n$e);
class i$e extends t$e {
  constructor() {
    (super(...arguments), (this._visibleSeparatorsFrequency = new Map()));
  }
  static {
    this.ID = "quickpickseparator";
  }
  get templateId() {
    return i$e.ID;
  }
  get visibleSeparators() {
    return [...this._visibleSeparatorsFrequency.keys()];
  }
  isSeparatorVisible(e) {
    return this._visibleSeparatorsFrequency.has(e);
  }
  renderElement(e, t, n) {
    const i = e.element;
    ((n.element = i),
      (i.element = n.entry ?? void 0),
      i.element.classList.toggle("focus-inside", !!i.focusInsideSeparator));
    const r = i.separator,
      { labelHighlights: o, descriptionHighlights: s } = i;
    let a;
    ((n.icon.style.backgroundImage = ""),
      (n.icon.className = ""),
      !i.saneTooltip &&
        i.saneDescription &&
        (a = {
          markdown: { value: HM(i.saneDescription), supportThemeIcons: !0 },
          markdownNotSupportedFallback: i.saneDescription,
        }));
    const l = {
      matches: o || [],
      descriptionTitle: a,
      descriptionMatches: s || [],
      labelEscapeNewLines: !0,
    };
    (n.entry.classList.add("quick-input-list-separator-as-item"),
      n.label.setLabel(i.saneLabel, i.saneDescription, l),
      (n.separator.style.display = "none"),
      n.entry.classList.add("quick-input-list-separator-border"));
    const c = r.buttons;
    (c && c.length
      ? (n.actionBar.push(
          c.map((e, t) =>
            vUe(e, `id-${t}`, () =>
              i.fireSeparatorButtonTriggered({ button: e, separator: i.separator }),
            ),
          ),
          { icon: !0, label: !1 },
        ),
        n.entry.classList.add("has-actions"))
      : n.entry.classList.remove("has-actions"),
      this.addSeparator(i));
  }
  disposeElement(e, t, n) {
    (this.removeSeparator(e.element),
      this.isSeparatorVisible(e.element) || e.element.element?.classList.remove("focus-inside"),
      super.disposeElement(e, t, n));
  }
  addSeparator(e) {
    this._visibleSeparatorsFrequency.set(e, (this._visibleSeparatorsFrequency.get(e) || 0) + 1);
  }
  removeSeparator(e) {
    const t = this._visibleSeparatorsFrequency.get(e) || 0;
    t > 1
      ? this._visibleSeparatorsFrequency.set(e, t - 1)
      : this._visibleSeparatorsFrequency.delete(e);
  }
}
let r$e = class extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this.parent = e),
      (this.hoverDelegate = t),
      (this.linkOpenerDelegate = n),
      (this.accessibilityService = o),
      (this._onKeyDown = new QO()),
      (this._onLeave = new QO()),
      (this.onLeave = this._onLeave.event),
      (this._visibleCountObservable = LF("VisibleCount", 0)),
      (this.onChangedVisibleCount = $O.fromObservable(this._visibleCountObservable, this._store)),
      (this._allVisibleCheckedObservable = LF("AllVisibleChecked", !1)),
      (this.onChangedAllVisibleChecked = $O.fromObservable(
        this._allVisibleCheckedObservable,
        this._store,
      )),
      (this._checkedCountObservable = LF("CheckedCount", 0)),
      (this.onChangedCheckedCount = $O.fromObservable(this._checkedCountObservable, this._store)),
      (this._checkedElementsObservable = F9({ equalsFn: XP }, new Array())),
      (this.onChangedCheckedElements = $O.fromObservable(
        this._checkedElementsObservable,
        this._store,
      )),
      (this._onButtonTriggered = new QO()),
      (this.onButtonTriggered = this._onButtonTriggered.event),
      (this._onSeparatorButtonTriggered = new QO()),
      (this.onSeparatorButtonTriggered = this._onSeparatorButtonTriggered.event),
      (this._elementChecked = new QO()),
      (this._elementCheckedEventBufferer = new rM()),
      (this._hasCheckboxes = !1),
      (this._inputElements = new Array()),
      (this._elementTree = new Array()),
      (this._itemElements = new Array()),
      (this._elementDisposable = this._register(new AO())),
      (this._matchOnDescription = !1),
      (this._matchOnDetail = !1),
      (this._matchOnLabel = !0),
      (this._matchOnLabelMode = "fuzzy"),
      (this._sortByLabel = !0),
      (this._shouldLoop = !0),
      (this._container = MB(this.parent, GUe(".quick-input-list"))),
      (this._separatorRenderer = new i$e(t)),
      (this._itemRenderer = r.createInstance(n$e, t)),
      (this._tree = this._register(
        r.createInstance(
          DCe,
          "QuickInput",
          this._container,
          new JUe(),
          [this._itemRenderer, this._separatorRenderer],
          {
            filter: { filter: (e) => (e.hidden ? 0 : e instanceof QUe ? 2 : 1) },
            sorter: {
              compare: (e, t) => {
                if (!this.sortByLabel || !this._lastQueryString) return 0;
                return (function (e, t, n) {
                  const i = e.labelHighlights || [],
                    r = t.labelHighlights || [];
                  if (i.length && !r.length) return -1;
                  if (!i.length && r.length) return 1;
                  if (0 === i.length && 0 === r.length) return 0;
                  return UUe(e.saneSortLabel, t.saneSortLabel, n);
                })(e, t, this._lastQueryString.toLowerCase());
              },
            },
            accessibilityProvider: new e$e(),
            setRowLineHeight: !1,
            multipleSelectionSupport: !1,
            hideTwistiesOfChildlessElements: !0,
            renderIndentGuides: lxe.None,
            findWidgetEnabled: !1,
            indent: 0,
            horizontalScrolling: !1,
            allowNonCollapsibleParents: !0,
            alwaysConsumeMouseWheel: !0,
          },
        ),
      )),
      (this._tree.getHTMLElement().id = i),
      this._registerListeners());
  }
  get onDidChangeFocus() {
    return $O.map(
      this._tree.onDidChangeFocus,
      (e) => e.elements.filter((e) => e instanceof YUe).map((e) => e.item),
      this._store,
    );
  }
  get onDidChangeSelection() {
    return $O.map(
      this._tree.onDidChangeSelection,
      (e) => ({
        items: e.elements.filter((e) => e instanceof YUe).map((e) => e.item),
        event: e.browserEvent,
      }),
      this._store,
    );
  }
  get displayed() {
    return "none" !== this._container.style.display;
  }
  set displayed(e) {
    this._container.style.display = e ? "" : "none";
  }
  get scrollTop() {
    return this._tree.scrollTop;
  }
  set scrollTop(e) {
    this._tree.scrollTop = e;
  }
  get ariaLabel() {
    return this._tree.ariaLabel;
  }
  set ariaLabel(e) {
    this._tree.ariaLabel = e ?? "";
  }
  set enabled(e) {
    this._tree.getHTMLElement().style.pointerEvents = e ? "" : "none";
  }
  get matchOnDescription() {
    return this._matchOnDescription;
  }
  set matchOnDescription(e) {
    this._matchOnDescription = e;
  }
  get matchOnDetail() {
    return this._matchOnDetail;
  }
  set matchOnDetail(e) {
    this._matchOnDetail = e;
  }
  get matchOnLabel() {
    return this._matchOnLabel;
  }
  set matchOnLabel(e) {
    this._matchOnLabel = e;
  }
  get matchOnLabelMode() {
    return this._matchOnLabelMode;
  }
  set matchOnLabelMode(e) {
    this._matchOnLabelMode = e;
  }
  get sortByLabel() {
    return this._sortByLabel;
  }
  set sortByLabel(e) {
    this._sortByLabel = e;
  }
  get shouldLoop() {
    return this._shouldLoop;
  }
  set shouldLoop(e) {
    this._shouldLoop = e;
  }
  _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((e) => {
        const t = new wO(e);
        if (10 === t.keyCode) this.toggleCheckbox();
        this._onKeyDown.fire(t);
      }),
    );
  }
  _registerOnContainerClick() {
    this._register(
      $F(this._container, DB.CLICK, (e) => {
        (e.x || e.y) && this._onLeave.fire();
      }),
    );
  }
  _registerOnMouseMiddleClick() {
    this._register(
      $F(this._container, DB.AUXCLICK, (e) => {
        1 === e.button && this._onLeave.fire();
      }),
    );
  }
  _registerOnTreeModelChanged() {
    this._register(
      this._tree.onDidChangeModel(() => {
        const e = this._itemElements.filter((e) => !e.hidden).length;
        (this._visibleCountObservable.set(e, void 0),
          this._hasCheckboxes && this._updateCheckedObservables());
      }),
    );
  }
  _registerOnElementChecked() {
    this._register(
      this._elementCheckedEventBufferer.wrapEvent(
        this._elementChecked.event,
        (e, t) => t,
      )((e) => this._updateCheckedObservables()),
    );
  }
  _registerOnContextMenu() {
    this._register(
      this._tree.onContextMenu((e) => {
        e.element && (e.browserEvent.preventDefault(), this._tree.setSelection([e.element]));
      }),
    );
  }
  _registerHoverListeners() {
    const e = this._register(
      new _M(
        "function" == typeof this.hoverDelegate.delay
          ? this.hoverDelegate.delay()
          : this.hoverDelegate.delay,
      ),
    );
    (this._register(
      this._tree.onMouseOver(async (t) => {
        if (kB(t.browserEvent.target)) e.cancel();
        else if (
          kB(t.browserEvent.relatedTarget) ||
          !gB(t.browserEvent.relatedTarget, t.element?.element)
        )
          try {
            await e.trigger(async () => {
              t.element instanceof YUe && this.showHover(t.element);
            });
          } catch (t) {
            if (!qI(t)) throw t;
          }
      }),
    ),
      this._register(
        this._tree.onMouseOut((t) => {
          gB(t.browserEvent.relatedTarget, t.element?.element) || e.cancel();
        }),
      ));
  }
  _registerSeparatorActionShowingListeners() {
    (this._register(
      this._tree.onDidChangeFocus((e) => {
        const t = e.elements[0] ? this._tree.getParentElement(e.elements[0]) : null;
        for (const n of this._separatorRenderer.visibleSeparators) {
          const e = n === t;
          !!(n.focusInsideSeparator & XUe.ACTIVE_ITEM) !== e &&
            (e
              ? (n.focusInsideSeparator |= XUe.ACTIVE_ITEM)
              : (n.focusInsideSeparator &= ~XUe.ACTIVE_ITEM),
            this._tree.rerender(n));
        }
      }),
    ),
      this._register(
        this._tree.onMouseOver((e) => {
          const t = e.element ? this._tree.getParentElement(e.element) : null;
          for (const n of this._separatorRenderer.visibleSeparators) {
            if (n !== t) continue;
            !!(n.focusInsideSeparator & XUe.MOUSE_HOVER) ||
              ((n.focusInsideSeparator |= XUe.MOUSE_HOVER), this._tree.rerender(n));
          }
        }),
      ),
      this._register(
        this._tree.onMouseOut((e) => {
          const t = e.element ? this._tree.getParentElement(e.element) : null;
          for (const n of this._separatorRenderer.visibleSeparators) {
            if (n !== t) continue;
            !!(n.focusInsideSeparator & XUe.MOUSE_HOVER) &&
              ((n.focusInsideSeparator &= ~XUe.MOUSE_HOVER), this._tree.rerender(n));
          }
        }),
      ));
  }
  _registerSelectionChangeListener() {
    this._register(
      this._tree.onDidChangeSelection((e) => {
        const t = e.elements.filter((e) => e instanceof YUe);
        t.length !== e.elements.length &&
          (1 === e.elements.length &&
            e.elements[0] instanceof QUe &&
            (this._tree.setFocus([e.elements[0].children[0]]), this._tree.reveal(e.elements[0], 0)),
          this._tree.setSelection(t));
      }),
    );
  }
  setAllVisibleChecked(e) {
    this._elementCheckedEventBufferer.bufferEvents(() => {
      this._itemElements.forEach((t) => {
        t.hidden || t.checkboxDisabled || !1 === t.item.pickable || (t.checked = e);
      });
    });
  }
  setElements(e) {
    let t;
    (this._elementDisposable.clear(),
      (this._lastQueryString = void 0),
      (this._inputElements = e),
      (this._hasCheckboxes = this.parent.classList.contains("show-checkboxes")),
      (this._itemElements = new Array()),
      (this._elementTree = e.reduce((n, i, r) => {
        let o;
        if ("separator" === i.type) {
          if (!i.buttons) return n;
          ((t = new QUe(r, (e) => this._onSeparatorButtonTriggered.fire(e), i)), (o = t));
        } else {
          const s = r > 0 ? e[r - 1] : void 0;
          let a;
          s && "separator" === s.type && !s.buttons && (a = s);
          const l = new YUe(
            r,
            t?.children ? t.children.length : r,
            this._hasCheckboxes && !1 !== i.pickable,
            (e) => this._onButtonTriggered.fire(e),
            this._elementChecked,
            i,
            a,
          );
          if ((this._itemElements.push(l), t)) return (t.children.push(l), n);
          o = l;
        }
        return (n.push(o), n);
      }, new Array())),
      this._setElementsToTree(this._elementTree),
      this.accessibilityService.isScreenReaderOptimized() &&
        setTimeout(() => {
          const e = this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),
            t = e?.parentNode;
          if (e && t) {
            const n = e.nextSibling;
            (e.remove(), t.insertBefore(e, n));
          }
        }, 0));
  }
  setFocusedElements(e) {
    const t = e
      .map((e) => this._itemElements.find((t) => t.item === e))
      .filter((e) => !!e)
      .filter((e) => !e.hidden);
    if ((this._tree.setFocus(t), e.length > 0)) {
      const e = this._tree.getFocus()[0];
      e && this._tree.reveal(e);
    }
  }
  getActiveDescendant() {
    return this._tree.getHTMLElement().getAttribute("aria-activedescendant");
  }
  setSelectedElements(e) {
    const t = e.map((e) => this._itemElements.find((t) => t.item === e)).filter((e) => !!e);
    this._tree.setSelection(t);
  }
  getCheckedElements() {
    return this._itemElements.filter((e) => e.checked).map((e) => e.item);
  }
  setCheckedElements(e) {
    this._elementCheckedEventBufferer.bufferEvents(() => {
      const t = new Set();
      for (const n of e) t.add(n);
      for (const e of this._itemElements) e.checked = t.has(e.item);
    });
  }
  focus(e) {
    if (this._itemElements.length)
      switch ((e === qhe.Second && this._itemElements.length < 2 && (e = qhe.First), e)) {
        case qhe.First:
          ((this._tree.scrollTop = 0),
            this._tree.focusFirst(void 0, (e) => e.element instanceof YUe));
          break;
        case qhe.Second: {
          this._tree.scrollTop = 0;
          let e = !1;
          this._tree.focusFirst(void 0, (t) => t.element instanceof YUe && (!!e || ((e = !e), !1)));
          break;
        }
        case qhe.Last:
          ((this._tree.scrollTop = this._tree.scrollHeight),
            this._tree.focusLast(void 0, (e) => e.element instanceof YUe));
          break;
        case qhe.Next: {
          const e = this._tree.getFocus();
          this._tree.focusNext(
            void 0,
            this._shouldLoop,
            void 0,
            (e) => e.element instanceof YUe && (this._tree.reveal(e.element), !0),
          );
          const t = this._tree.getFocus();
          e.length && e[0] === t[0] && this._onLeave.fire();
          break;
        }
        case qhe.Previous: {
          const e = this._tree.getFocus();
          this._tree.focusPrevious(void 0, this._shouldLoop, void 0, (e) => {
            if (!(e.element instanceof YUe)) return !1;
            const t = this._tree.getParentElement(e.element);
            return (
              null === t || t.children[0] !== e.element
                ? this._tree.reveal(e.element)
                : this._tree.reveal(t),
              !0
            );
          });
          const t = this._tree.getFocus();
          e.length && e[0] === t[0] && this._onLeave.fire();
          break;
        }
        case qhe.NextPage:
          this._tree.focusNextPage(
            void 0,
            (e) => e.element instanceof YUe && (this._tree.reveal(e.element), !0),
          );
          break;
        case qhe.PreviousPage:
          this._tree.focusPreviousPage(void 0, (e) => {
            if (!(e.element instanceof YUe)) return !1;
            const t = this._tree.getParentElement(e.element);
            return (
              null === t || t.children[0] !== e.element
                ? this._tree.reveal(e.element)
                : this._tree.reveal(t),
              !0
            );
          });
          break;
        case qhe.NextSeparator: {
          let e = !1;
          const t = this._tree.getFocus()[0];
          this._tree.focusNext(void 0, !0, void 0, (t) => {
            if (e) return !0;
            if (t.element instanceof QUe)
              ((e = !0),
                this._separatorRenderer.isSeparatorVisible(t.element)
                  ? this._tree.reveal(t.element.children[0])
                  : this._tree.reveal(t.element, 0));
            else if (t.element instanceof YUe) {
              if (t.element.separator)
                return (
                  this._itemRenderer.isItemWithSeparatorVisible(t.element)
                    ? this._tree.reveal(t.element)
                    : this._tree.reveal(t.element, 0),
                  !0
                );
              if (t.element === this._elementTree[0]) return (this._tree.reveal(t.element, 0), !0);
            }
            return !1;
          });
          t === this._tree.getFocus()[0] &&
            ((this._tree.scrollTop = this._tree.scrollHeight),
            this._tree.focusLast(void 0, (e) => e.element instanceof YUe));
          break;
        }
        case qhe.PreviousSeparator: {
          let e,
            t = !!this._tree.getFocus()[0]?.separator;
          (this._tree.focusPrevious(void 0, !0, void 0, (n) => {
            if (n.element instanceof QUe)
              t
                ? e ||
                  (this._separatorRenderer.isSeparatorVisible(n.element)
                    ? this._tree.reveal(n.element)
                    : this._tree.reveal(n.element, 0),
                  (e = n.element.children[0]))
                : (t = !0);
            else if (n.element instanceof YUe && !e)
              if (n.element.separator)
                (this._itemRenderer.isItemWithSeparatorVisible(n.element)
                  ? this._tree.reveal(n.element)
                  : this._tree.reveal(n.element, 0),
                  (e = n.element));
              else if (n.element === this._elementTree[0])
                return (this._tree.reveal(n.element, 0), !0);
            return !1;
          }),
            e && this._tree.setFocus([e]));
          break;
        }
      }
  }
  clearFocus() {
    this._tree.setFocus([]);
  }
  domFocus() {
    this._tree.domFocus();
  }
  layout(e) {
    ((this._tree.getHTMLElement().style.maxHeight = e ? 44 * Math.floor(e / 44) + 6 + "px" : ""),
      this._tree.layout());
  }
  filter(e) {
    if (
      ((this._lastQueryString = e),
      !(this._sortByLabel || this._matchOnLabel || this._matchOnDescription || this._matchOnDetail))
    )
      return (this._tree.layout(), !1);
    const t = e;
    if ((e = e.trim()) && (this.matchOnLabel || this.matchOnDescription || this.matchOnDetail)) {
      let n;
      this._itemElements.forEach((i) => {
        let r;
        r =
          "fuzzy" === this.matchOnLabelMode
            ? this.matchOnLabel
              ? (ire(e, nre(i.saneLabel)) ?? void 0)
              : void 0
            : this.matchOnLabel
              ? ((function (e, t) {
                  const { text: n, iconOffsets: i } = t;
                  if (!i || 0 === i.length) return o$e(e, n);
                  const r = $M(n, " "),
                    o = n.length - r.length,
                    s = o$e(e, r);
                  if (s)
                    for (const a of s) {
                      const e = i[a.start + o] + o;
                      ((a.start += e), (a.end += e));
                    }
                  return s;
                })(t, nre(i.saneLabel)) ?? void 0)
              : void 0;
        const o = this.matchOnDescription
            ? (ire(e, nre(i.saneDescription || "")) ?? void 0)
            : void 0,
          s = this.matchOnDetail ? (ire(e, nre(i.saneDetail || "")) ?? void 0) : void 0;
        if (
          (r || o || s
            ? ((i.labelHighlights = r),
              (i.descriptionHighlights = o),
              (i.detailHighlights = s),
              (i.hidden = !1))
            : ((i.labelHighlights = void 0),
              (i.descriptionHighlights = void 0),
              (i.detailHighlights = void 0),
              (i.hidden = !i.item || !i.item.alwaysShow)),
          i.item ? (i.separator = void 0) : i.separator && (i.hidden = !0),
          !this.sortByLabel)
        ) {
          const e = (i.index && this._inputElements[i.index - 1]) || void 0;
          ("separator" !== e?.type || e.buttons || (n = e),
            n && !i.hidden && ((i.separator = n), (n = void 0)));
        }
      });
    } else
      this._itemElements.forEach((e) => {
        ((e.labelHighlights = void 0),
          (e.descriptionHighlights = void 0),
          (e.detailHighlights = void 0),
          (e.hidden = !1));
        const t = e.index && this._inputElements[e.index - 1];
        e.item && (e.separator = t && "separator" === t.type && !t.buttons ? t : void 0);
      });
    return (
      this._setElementsToTree(this._sortByLabel && e ? this._itemElements : this._elementTree),
      this._tree.layout(),
      !0
    );
  }
  toggleCheckbox() {
    this._elementCheckedEventBufferer.bufferEvents(() => {
      const e = this._tree.getFocus().filter((e) => e instanceof YUe),
        t = this._allVisibleChecked(e);
      for (const n of e) n.checkboxDisabled || (n.checked = !t);
    });
  }
  style(e) {
    this._tree.style(e);
  }
  toggleHover() {
    const e = this._tree.getFocus()[0];
    if (!(e?.saneTooltip && e instanceof YUe)) return;
    if (this._lastHover && !this._lastHover.isDisposed) return void this._lastHover.dispose();
    this.showHover(e);
    const t = new AO();
    (t.add(
      this._tree.onDidChangeFocus((e) => {
        e.elements[0] instanceof YUe && this.showHover(e.elements[0]);
      }),
    ),
      this._lastHover && t.add(this._lastHover),
      this._elementDisposable.add(t));
  }
  _setElementsToTree(e) {
    const t = new Array();
    for (const n of e)
      n instanceof QUe
        ? t.push({
            element: n,
            collapsible: !1,
            collapsed: !1,
            children: n.children.map((e) => ({ element: e, collapsible: !1, collapsed: !1 })),
          })
        : t.push({ element: n, collapsible: !1, collapsed: !1 });
    this._tree.setChildren(null, t);
  }
  _allVisibleChecked(e, t = !0) {
    for (let n = 0, i = e.length; n < i; n++) {
      const i = e[n];
      if (!i.hidden && !1 !== i.item.pickable) {
        if (!i.checked) return !1;
        t = !0;
      }
    }
    return t;
  }
  _updateCheckedObservables() {
    cF((e) => {
      this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements, !1), e);
      const t = this._itemElements.filter((e) => e.checked).length;
      (this._checkedCountObservable.set(t, e),
        this._checkedElementsObservable.set(this.getCheckedElements(), e));
    });
  }
  showHover(e) {
    (this._lastHover &&
      !this._lastHover.isDisposed &&
      (this.hoverDelegate.onDidHideHover?.(), this._lastHover?.dispose()),
      e.element &&
        e.saneTooltip &&
        (this._lastHover = this.hoverDelegate.showHover(
          {
            content: e.saneTooltip,
            target: e.element,
            linkHandler: (e) => {
              this.linkOpenerDelegate(e);
            },
            appearance: { showPointer: !0 },
            container: this._container,
            position: { hoverPosition: 1 },
          },
          !1,
        )));
  }
};
function o$e(e, t) {
  const n = t.toLowerCase().indexOf(e.toLowerCase());
  return -1 !== n ? [{ start: n, end: n + e.length }] : null;
}
function s$e(e, t = {}) {
  DW.registerCommandAndKeybindingRule({
    weight: 200,
    when: eW.and(eW.or(eW.equals(kUe, "quickPick"), eW.equals(kUe, "quickTree")), CUe),
    metadata: {
      description: SI(
        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.",
      ),
    },
    ...e,
    secondary: l$e(e.primary, e.secondary ?? [], t),
  });
}
(qUe([tJ], r$e.prototype, "onDidChangeFocus", null),
  qUe([tJ], r$e.prototype, "onDidChangeSelection", null),
  (r$e = qUe([KUe(4, vV), KUe(5, KK)], r$e)));
const a$e = PR ? 256 : 2048;
function l$e(e, t, n = {}) {
  return (
    n.withAltMod && t.push(512 + e),
    n.withCtrlMod && (t.push(a$e + e), n.withAltMod && t.push(512 + a$e + e)),
    n.withCmdMod &&
      PR &&
      (t.push(2048 + e),
      n.withCtrlMod && t.push(2304 + e),
      n.withAltMod && (t.push(2560 + e), n.withCtrlMod && t.push(2816 + e))),
    t
  );
}
function c$e(e, t) {
  return (n) => {
    const i = n.get(Ghe).currentQuickInput;
    if (i) return t && i.quickNavigate ? i.focus(t) : i.focus(e);
  };
}
(s$e(
  { id: "quickInput.pageNext", primary: 12, handler: c$e(qhe.NextPage) },
  { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 },
),
  s$e(
    { id: "quickInput.pagePrevious", primary: 11, handler: c$e(qhe.PreviousPage) },
    { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 },
  ),
  s$e(
    { id: "quickInput.first", primary: a$e + 14, handler: c$e(qhe.First) },
    { withAltMod: !0, withCmdMod: !0 },
  ),
  s$e(
    { id: "quickInput.last", primary: a$e + 13, handler: c$e(qhe.Last) },
    { withAltMod: !0, withCmdMod: !0 },
  ),
  s$e({ id: "quickInput.next", primary: 18, handler: c$e(qhe.Next) }, { withCtrlMod: !0 }),
  s$e({ id: "quickInput.previous", primary: 16, handler: c$e(qhe.Previous) }, { withCtrlMod: !0 }));
const d$e = SI(
    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.",
  ),
  u$e = SI(
    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.",
  );
(PR
  ? (s$e({
      id: "quickInput.nextSeparatorWithQuickAccessFallback",
      primary: 2066,
      handler: c$e(qhe.NextSeparator, qhe.Next),
      metadata: { description: d$e },
    }),
    s$e(
      {
        id: "quickInput.nextSeparator",
        primary: 2578,
        secondary: [2322],
        handler: c$e(qhe.NextSeparator),
      },
      { withCtrlMod: !0 },
    ),
    s$e({
      id: "quickInput.previousSeparatorWithQuickAccessFallback",
      primary: 2064,
      handler: c$e(qhe.PreviousSeparator, qhe.Previous),
      metadata: { description: u$e },
    }),
    s$e(
      {
        id: "quickInput.previousSeparator",
        primary: 2576,
        secondary: [2320],
        handler: c$e(qhe.PreviousSeparator),
      },
      { withCtrlMod: !0 },
    ))
  : (s$e({
      id: "quickInput.nextSeparatorWithQuickAccessFallback",
      primary: 530,
      handler: c$e(qhe.NextSeparator, qhe.Next),
      metadata: { description: d$e },
    }),
    s$e({ id: "quickInput.nextSeparator", primary: 2578, handler: c$e(qhe.NextSeparator) }),
    s$e({
      id: "quickInput.previousSeparatorWithQuickAccessFallback",
      primary: 528,
      handler: c$e(qhe.PreviousSeparator, qhe.Previous),
      metadata: { description: u$e },
    }),
    s$e({
      id: "quickInput.previousSeparator",
      primary: 2576,
      handler: c$e(qhe.PreviousSeparator),
    })),
  DW.registerCommandAndKeybindingRule({
    id: "quickInput.accept",
    primary: 3,
    weight: 200,
    when: eW.and(eW.notEquals(kUe, "quickWidget"), CUe, eW.not("isComposing")),
    metadata: {
      description: SI(
        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: (e) => {
      const t = e.get(Ghe).currentQuickInput;
      t?.accept();
    },
    secondary: l$e(3, [], { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 }),
  }),
  s$e(
    {
      id: "quickInput.acceptInBackground",
      when: eW.and(CUe, eW.equals(kUe, "quickPick"), eW.or(Owe.negate(), DUe)),
      primary: 17,
      weight: 250,
      handler: (e) => {
        const t = e.get(Ghe).currentQuickInput;
        t?.accept(!0);
      },
    },
    { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 },
  ),
  (function (e, t = {}) {
    DW.registerCommandAndKeybindingRule({
      weight: 200,
      when: CUe,
      metadata: {
        description: SI(
          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.",
        ),
      },
      ...e,
      secondary: l$e(e.primary, e.secondary ?? [], t),
    });
  })(
    {
      id: "quickInput.hide",
      primary: 9,
      handler: (e) => {
        const t = e.get(Ghe).currentQuickInput;
        t?.hide();
      },
    },
    { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 },
  ),
  s$e({
    id: "quickInput.toggleHover",
    primary: 10 | a$e,
    handler: (e) => {
      e.get(Ghe).toggleHover();
    },
  }));
var h$e;
const g$e = VB;
let p$e = class extends PO {
  static {
    h$e = this;
  }
  static {
    this.ID = "quickInputTreeElement";
  }
  constructor(e, t, n, i) {
    (super(),
      (this._hoverDelegate = e),
      (this._buttonTriggeredEmitter = t),
      (this.onCheckedEvent = n),
      (this._themeService = i),
      (this.templateId = h$e.ID));
  }
  renderTemplate(e) {
    const t = new AO(),
      n = MB(e, g$e(".quick-input-tree-entry")),
      i = t.add(new A_e("", !1, { ...hue, size: 15 }));
    n.appendChild(i.domNode);
    const r = MB(n, g$e("label.quick-input-tree-label")),
      o = MB(r, g$e(".quick-input-tree-rows")),
      s = MB(o, g$e(".quick-input-tree-row")),
      a = AB(s, g$e(".quick-input-tree-icon")),
      l = t.add(
        new $Ce(s, {
          supportHighlights: !0,
          supportDescriptionHighlights: !0,
          supportIcons: !0,
          hoverDelegate: this._hoverDelegate,
        }),
      ),
      c = t.add(new Cle(n, this._hoverDelegate ? { hoverDelegate: this._hoverDelegate } : void 0));
    return (
      c.domNode.classList.add("quick-input-tree-entry-action-bar"),
      {
        toDisposeTemplate: t,
        entry: n,
        checkbox: i,
        icon: a,
        label: l,
        actionBar: c,
        toDisposeElement: new AO(),
      }
    );
  }
  renderElement(e, t, n, i) {
    const r = n.toDisposeElement,
      o = e.element;
    if (
      (!1 === o.pickable
        ? (n.checkbox.domNode.style.display = "none")
        : ((n.checkbox.domNode.style.display = ""),
          (n.checkbox.checked = o.checked ?? !1),
          r.add(
            $O.filter(
              this.onCheckedEvent,
              (e) => e.item === o,
            )((e) => (n.checkbox.checked = e.checked)),
          ),
          o.disabled && n.checkbox.disable()),
      o.iconPath)
    ) {
      const e = IQ(this._themeService.getColorTheme().type)
          ? o.iconPath.dark
          : (o.iconPath.light ?? o.iconPath.dark),
        t = mP.revive(e);
      ((n.icon.className = "quick-input-tree-icon"), (n.icon.style.backgroundImage = Une(t)));
    } else
      ((n.icon.style.backgroundImage = ""),
        (n.icon.className = o.iconClass ? `quick-input-tree-icon ${o.iconClass}` : ""));
    const { labelHighlights: s, descriptionHighlights: a } = e.filterData || {};
    let l;
    (o.description &&
      (l = {
        markdown: { value: HM(o.description), supportThemeIcons: !0 },
        markdownNotSupportedFallback: o.description,
      }),
      n.label.setLabel(o.label, o.description, {
        matches: s,
        descriptionMatches: a,
        extraClasses: o.iconClasses,
        italic: o.italic,
        strikethrough: o.strikethrough,
        labelEscapeNewLines: !0,
        descriptionTitle: l,
      }));
    const c = o.buttons;
    c && c.length
      ? (n.actionBar.push(
          c.map((e, t) =>
            vUe(e, `tree-${t}`, () => this._buttonTriggeredEmitter.fire({ item: o, button: e })),
          ),
          { icon: !0, label: !1 },
        ),
        n.entry.classList.add("has-actions"))
      : n.entry.classList.remove("has-actions");
  }
  disposeElement(e, t, n, i) {
    (n.toDisposeElement.clear(), n.actionBar.clear());
  }
  disposeTemplate(e) {
    (e.toDisposeElement.dispose(), e.toDisposeTemplate.dispose());
  }
};
p$e = h$e = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(3, h0),
  ],
  p$e,
);
class f$e {
  getHeight(e) {
    return 22;
  }
  getTemplateId(e) {
    return p$e.ID;
  }
}
function m$e(e) {
  let t = !1,
    n = !1,
    i = !1;
  for (const r of e) {
    switch (r.element?.checked) {
      case "mixed":
        i = !0;
        break;
      case !0:
        t = !0;
        break;
      default:
        n = !0;
    }
    if (t && n && i) break;
  }
  return n ? (i || !!t) && "mixed" : i ? "mixed" : t;
}
class _$e {
  constructor(e) {
    this.onCheckedEvent = e;
  }
  getWidgetAriaLabel() {
    return SI(1772, "Quick Tree");
  }
  getAriaLabel(e) {
    return (
      e.ariaLabel ||
      [e.label, e.description]
        .map((e) => ere(e))
        .filter((e) => !!e)
        .join(", ")
    );
  }
  getWidgetRole() {
    return "tree";
  }
  getRole(e) {
    return "checkbox";
  }
  isChecked(e) {
    return {
      get value() {
        return "mixed" === e.checked ? "mixed" : !!e.checked;
      },
      onDidChange: (t) => $O.filter(this.onCheckedEvent, (t) => t.item === e)((e) => t()),
    };
  }
}
class v$e {
  constructor() {
    ((this.filterValue = ""), (this.matchOnLabel = !0), (this.matchOnDescription = !1));
  }
  filter(e, t) {
    if (!this.filterValue || (!this.matchOnLabel && !this.matchOnDescription))
      return e.children ? { visibility: 2, data: {} } : { visibility: 1, data: {} };
    const n = this.matchOnLabel ? (ire(this.filterValue, nre(e.label)) ?? void 0) : void 0,
      i = this.matchOnDescription
        ? (ire(this.filterValue, nre(e.description || "")) ?? void 0)
        : void 0;
    return {
      visibility: 1 === t || n || i ? 1 : e.children ? 2 : 0,
      data: { labelHighlights: n, descriptionHighlights: i },
    };
  }
}
class b$e extends PO {
  constructor() {
    (super(...arguments), (this._sortByLabel = !0));
  }
  get sortByLabel() {
    return this._sortByLabel;
  }
  set sortByLabel(e) {
    this._sortByLabel = e;
  }
  compare(e, t) {
    if (!this._sortByLabel) return 0;
    if (e.label < t.label) return -1;
    if (e.label > t.label) return 1;
    if (e.description && t.description) {
      if (e.description < t.description) return -1;
      if (e.description > t.description) return 1;
    } else {
      if (e.description) return -1;
      if (t.description) return 1;
    }
    return 0;
  }
}
const y$e = VB;
let x$e = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this.instantiationService = n),
      (this._onDidTriggerButton = this._register(new QO())),
      (this._onDidChangeCheckboxState = this._register(new QO())),
      (this.onDidChangeCheckboxState = this._onDidChangeCheckboxState.event),
      (this._onDidCheckedLeafItemsChange = this._register(new QO())),
      (this._onLeave = new QO()),
      (this.onLeave = this._onLeave.event),
      (this._onDidAccept = this._register(new QO())),
      (this.onDidAccept = this._onDidAccept.event),
      (this._container = MB(e, y$e(".quick-input-tree"))),
      (this._renderer = this._register(
        this.instantiationService.createInstance(
          p$e,
          t,
          this._onDidTriggerButton,
          this.onDidChangeCheckboxState,
        ),
      )),
      (this._filter = this.instantiationService.createInstance(v$e)),
      (this._sorter = this._register(new b$e())),
      (this._tree = this._register(
        this.instantiationService.createInstance(
          DCe,
          "QuickInputTree",
          this._container,
          new f$e(),
          [this._renderer],
          {
            accessibilityProvider: new _$e(this.onDidChangeCheckboxState),
            horizontalScrolling: !1,
            multipleSelectionSupport: !1,
            findWidgetEnabled: !1,
            alwaysConsumeMouseWheel: !0,
            hideTwistiesOfChildlessElements: !0,
            renderIndentGuides: lxe.None,
            expandOnDoubleClick: !0,
            expandOnlyOnTwistieClick: !0,
            disableExpandOnSpacebar: !0,
            sorter: this._sorter,
            filter: this._filter,
          },
        ),
      )),
      this.registerOnOpenListener());
  }
  get tree() {
    return this._tree;
  }
  get displayed() {
    return "none" !== this._container.style.display;
  }
  set displayed(e) {
    this._container.style.display = e ? "" : "none";
  }
  get sortByLabel() {
    return this._sorter.sortByLabel;
  }
  set sortByLabel(e) {
    ((this._sorter.sortByLabel = e), this._tree.resort(null, !0));
  }
  getActiveDescendant() {
    return this._tree.getHTMLElement().getAttribute("aria-activedescendant");
  }
  updateFilterOptions(e) {
    (void 0 !== e.matchOnLabel && (this._filter.matchOnLabel = e.matchOnLabel),
      void 0 !== e.matchOnDescription && (this._filter.matchOnDescription = e.matchOnDescription),
      this._tree.refilter());
  }
  layout(e) {
    ((this._tree.getHTMLElement().style.maxHeight = e ? 44 * Math.floor(e / 44) + 6 + "px" : ""),
      this._tree.layout());
  }
  registerOnOpenListener() {
    this._register(
      this._tree.onDidOpen((e) => {
        const t = e.element;
        if (!t) return;
        if (t.disabled) return;
        if (!1 === t.pickable) return (this._tree.setFocus([t]), void this._onDidAccept.fire());
        const n = !0 !== t.checked;
        if ((t.checked ?? !1) === n) return;
        ((t.checked = n), this._tree.rerender(t));
        const i = new Set(),
          r = [...this._tree.getNode(t).children];
        for (; r.length; ) {
          const e = r.shift();
          e?.element &&
            !i.has(e.element) &&
            (i.add(e.element),
            (e.element.checked ?? !1) !== t.checked &&
              ((e.element.checked = t.checked), this._tree.rerender(e.element)),
            r.push(...e.children));
        }
        let o = this._tree.getParentElement(t);
        for (; o; ) {
          const e = m$e([...this._tree.getNode(o).children]);
          ((o.checked ?? !1) !== e && ((o.checked = e), this._tree.rerender(o)),
            (o = this._tree.getParentElement(o)));
        }
        (this._onDidChangeCheckboxState.fire({ item: t, checked: t.checked ?? !1 }),
          this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems()));
      }),
    );
  }
  getCheckedLeafItems() {
    const e = new Set(),
      t = [...this._tree.getNode().children],
      n = new Array();
    for (; t.length; ) {
      const i = t.shift();
      i?.element &&
        !e.has(i.element) &&
        i.element.checked &&
        (e.add(i.element), t.push(...i.children), i.element.children || n.push(i.element));
    }
    return n;
  }
};
x$e = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(2, vV),
  ],
  x$e,
);
var w$e,
  C$e = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  S$e = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const k$e = VB,
  E$e = "workbench.quickInput.viewState";
let N$e = class extends PO {
  static {
    w$e = this;
  }
  static {
    this.MAX_WIDTH = 600;
  }
  get currentQuickInput() {
    return this.controller ?? void 0;
  }
  get container() {
    return this._container;
  }
  constructor(e, t, n, i, r) {
    (super(),
      (this.options = e),
      (this.layoutService = t),
      (this.instantiationService = n),
      (this.storageService = r),
      (this.enabled = !0),
      (this.onDidAcceptEmitter = this._register(new QO())),
      (this.onDidCustomEmitter = this._register(new QO())),
      (this.onDidTriggerButtonEmitter = this._register(new QO())),
      (this.keyMods = { ctrlCmd: !1, alt: !1 }),
      (this.controller = null),
      (this.onShowEmitter = this._register(new QO())),
      (this.onShow = this.onShowEmitter.event),
      (this.onHideEmitter = this._register(new QO())),
      (this.onHide = this.onHideEmitter.event),
      (this.inQuickInputContext = wUe.bindTo(i)),
      (this.quickInputTypeContext = EUe.bindTo(i)),
      (this.endOfQuickInputBoxContext = LUe.bindTo(i)),
      (this.idPrefix = e.idPrefix),
      (this._container = e.container),
      (this.styles = e.styles),
      this._register(
        $O.runAndSubscribe(
          VF,
          ({ window: e, disposables: t }) => this.registerKeyModsListeners(e, t),
          { window: NI, disposables: this._store },
        ),
      ),
      this._register(
        WF((e) => {
          this.ui &&
            MF(this.ui.container) === e &&
            (this.reparentUI(this.layoutService.mainContainer),
            this.layout(
              this.layoutService.mainContainerDimension,
              this.layoutService.mainContainerOffset.quickPickTop,
            ));
        }),
      ),
      (this.viewState = this.loadViewState()));
  }
  registerKeyModsListeners(e, t) {
    const n = (e) => {
      ((this.keyMods.ctrlCmd = e.ctrlKey || e.metaKey), (this.keyMods.alt = e.altKey));
    };
    for (const i of [DB.KEY_DOWN, DB.KEY_UP, DB.MOUSE_DOWN]) t.add($F(e, i, n, !0));
  }
  getUI(e) {
    if (this.ui)
      return (
        e &&
          MF(this._container) !== MF(this.layoutService.activeContainer) &&
          (this.reparentUI(this.layoutService.activeContainer),
          this.layout(
            this.layoutService.activeContainerDimension,
            this.layoutService.activeContainerOffset.quickPickTop,
          )),
        this.ui
      );
    const t = MB(this._container, k$e(".quick-input-widget.show-file-icons"));
    ((t.tabIndex = -1), (t.style.display = "none"));
    const n = rG(t),
      i = MB(t, k$e(".quick-input-titlebar")),
      r = this._register(new Cle(i, { hoverDelegate: this.options.hoverDelegate }));
    r.domNode.classList.add("quick-input-left-action-bar");
    const o = MB(i, k$e(".quick-input-title")),
      s = this._register(new Cle(i, { hoverDelegate: this.options.hoverDelegate }));
    s.domNode.classList.add("quick-input-right-action-bar");
    const a = MB(t, k$e(".quick-input-header")),
      l = this._register(new A_e(SI(1763, "Toggle all checkboxes"), !1, { ...hue, size: 15 }));
    (MB(a, l.domNode),
      this._register(
        l.onChange(() => {
          const e = l.checked;
          N.setAllVisibleChecked(!0 === e);
        }),
      ),
      this._register(
        $F(l.domNode, DB.CLICK, (e) => {
          (e.x || e.y) && h.setFocus();
        }),
      ));
    const c = MB(a, k$e(".quick-input-description")),
      d = MB(a, k$e(".quick-input-and-message")),
      u = MB(d, k$e(".quick-input-filter")),
      h = this._register(new HUe(u, this.styles.inputBox, this.styles.toggle));
    h.setAttribute("aria-describedby", `${this.idPrefix}message`);
    const g = MB(u, k$e(".quick-input-visible-count"));
    (g.setAttribute("aria-live", "polite"), g.setAttribute("aria-atomic", "true"));
    const p = this._register(
        new HCe(g, { countFormat: SI(1764, "{0} Results") }, this.styles.countBadge),
      ),
      f = MB(u, k$e(".quick-input-count"));
    f.setAttribute("aria-live", "polite");
    const m = this._register(
        new HCe(f, { countFormat: SI(1765, "{0} Selected") }, this.styles.countBadge),
      ),
      _ = this._register(new Cle(a, { hoverDelegate: this.options.hoverDelegate }));
    _.domNode.classList.add("quick-input-inline-action-bar");
    const v = MB(a, k$e(".quick-input-action")),
      b = this._register(new upe(v, this.styles.button));
    ((b.label = SI(1766, "OK")),
      this._register(
        b.onDidClick((e) => {
          this.onDidAcceptEmitter.fire();
        }),
      ));
    const y = MB(a, k$e(".quick-input-action")),
      x = this._register(new upe(y, { ...this.styles.button, supportIcons: !0 }));
    ((x.label = SI(1767, "Custom")),
      this._register(
        x.onDidClick((e) => {
          this.onDidCustomEmitter.fire();
        }),
      ));
    const w = MB(d, k$e(`#${this.idPrefix}message.quick-input-message`)),
      C = this._register(new VUe(t, this.styles.progressBar));
    C.getContainer().classList.add("quick-input-progress");
    const S = MB(t, k$e(".quick-input-html-widget"));
    S.tabIndex = -1;
    const k = MB(t, k$e(".quick-input-description")),
      E = this.idPrefix + "list",
      N = this._register(
        this.instantiationService.createInstance(
          r$e,
          t,
          this.options.hoverDelegate,
          this.options.linkOpenerDelegate,
          E,
        ),
      );
    (h.setAttribute("aria-controls", E),
      this._register(
        N.onDidChangeFocus(() => {
          h.hasFocus() && h.setAttribute("aria-activedescendant", N.getActiveDescendant() ?? "");
        }),
      ),
      this._register(
        N.onChangedAllVisibleChecked((e) => {
          l.checked = e;
        }),
      ),
      this._register(
        N.onChangedVisibleCount((e) => {
          p.setCount(e);
        }),
      ),
      this._register(
        N.onChangedCheckedCount((e) => {
          KR(() => m.setCount(e));
        }),
      ),
      this._register(
        N.onLeave(() => {
          setTimeout(() => {
            this.controller &&
              (h.setFocus(),
              this.controller instanceof RUe && this.controller.canSelectMany && N.clearFocus());
          }, 0);
        }),
      ));
    const L = this._register(
      this.instantiationService.createInstance(x$e, t, this.options.hoverDelegate),
    );
    (this._register(
      L.tree.onDidChangeFocus(() => {
        h.hasFocus() && h.setAttribute("aria-activedescendant", L.getActiveDescendant() ?? "");
      }),
    ),
      this._register(
        L.onLeave(() => {
          setTimeout(() => {
            this.controller && (h.setFocus(), L.tree.setFocus([]));
          }, 0);
        }),
      ),
      this._register(
        L.onDidAccept(() => {
          this.onDidAcceptEmitter.fire();
        }),
      ),
      this._register(L.tree.onDidChangeContentHeight(() => this.updateLayout())));
    const D = OB(t);
    return (
      this._register(D),
      this._register(
        $F(
          t,
          DB.FOCUS,
          (e) => {
            const t = this.getUI();
            if (gB(e.relatedTarget, t.inputContainer)) {
              const e = t.inputBox.isSelectionAtEnd();
              this.endOfQuickInputBoxContext.get() !== e && this.endOfQuickInputBoxContext.set(e);
            }
            gB(e.relatedTarget, t.container) ||
              (this.inQuickInputContext.set(!0),
              (this.previousFocusElement = SB(e.relatedTarget) ? e.relatedTarget : void 0));
          },
          !0,
        ),
      ),
      this._register(
        D.onDidBlur(() => {
          (this.getUI().ignoreFocusOut || this.options.ignoreFocusOut() || this.hide(Uhe.Blur),
            this.inQuickInputContext.set(!1),
            this.endOfQuickInputBoxContext.set(!1),
            (this.previousFocusElement = void 0));
        }),
      ),
      this._register(
        h.onKeyDown((e) => {
          const t = this.getUI().inputBox.isSelectionAtEnd();
          (this.endOfQuickInputBoxContext.get() !== t && this.endOfQuickInputBoxContext.set(t),
            h.removeAttribute("aria-activedescendant"));
        }),
      ),
      this._register(
        $F(t, DB.FOCUS, (e) => {
          h.setFocus();
        }),
      ),
      (this.dndController = this._register(
        this.instantiationService.createInstance(
          L$e,
          this._container,
          t,
          [
            { node: i, includeChildren: !0 },
            { node: a, includeChildren: !1 },
          ],
          this.viewState,
        ),
      )),
      this._register(
        rF((e) => {
          const t = this.dndController?.dndViewState.read(e);
          t &&
            (void 0 !== t.top && void 0 !== t.left
              ? (this.viewState = { ...this.viewState, top: t.top, left: t.left })
              : (this.viewState = void 0),
            this.updateLayout(),
            t.done && this.saveViewState(this.viewState));
        }),
      ),
      (this.ui = {
        container: t,
        styleSheet: n,
        leftActionBar: r,
        titleBar: i,
        title: o,
        description1: k,
        description2: c,
        widget: S,
        rightActionBar: s,
        inlineActionBar: _,
        checkAll: l,
        inputContainer: d,
        filterContainer: u,
        inputBox: h,
        visibleCountContainer: g,
        visibleCount: p,
        countContainer: f,
        count: m,
        okContainer: v,
        ok: b,
        message: w,
        customButtonContainer: y,
        customButton: x,
        list: N,
        tree: L,
        progressBar: C,
        onDidAccept: this.onDidAcceptEmitter.event,
        onDidCustom: this.onDidCustomEmitter.event,
        onDidTriggerButton: this.onDidTriggerButtonEmitter.event,
        ignoreFocusOut: !1,
        keyMods: this.keyMods,
        show: (e) => this.show(e),
        hide: () => this.hide(),
        setVisibilities: (e) => this.setVisibilities(e),
        setEnabled: (e) => this.setEnabled(e),
        setContextKey: (e) => this.options.setContextKey(e),
        linkOpenerDelegate: (e) => this.options.linkOpenerDelegate(e),
      }),
      this.updateStyles(),
      this.ui
    );
  }
  reparentUI(e) {
    this.ui &&
      ((this._container = e),
      MB(this._container, this.ui.container),
      this.dndController?.reparentUI(this._container));
  }
  pick(e, t = {}, n = aM.None) {
    return new Promise((i, r) => {
      let o = (e) => {
        ((o = i), t.onKeyMods?.(s.keyMods), i(e));
      };
      if (n.isCancellationRequested) return void o(void 0);
      const s = this.createQuickPick({ useSeparators: !0 });
      let a;
      const l = [
        s,
        s.onDidAccept(() => {
          if (s.canSelectMany) (o(s.selectedItems.slice()), s.hide());
          else {
            const e = s.activeItems[0];
            e && (o(e), s.hide());
          }
        }),
        s.onDidChangeActive((e) => {
          const n = e[0];
          n && t.onDidFocus && t.onDidFocus(n);
        }),
        s.onDidChangeSelection((e) => {
          if (!s.canSelectMany) {
            const t = e[0];
            t && (o(t), s.hide());
          }
        }),
        s.onDidTriggerItemButton(
          (e) =>
            t.onDidTriggerItemButton &&
            t.onDidTriggerItemButton({
              ...e,
              removeItem: () => {
                const t = s.items.indexOf(e.item);
                if (-1 !== t) {
                  const e = s.items.slice(),
                    n = e.splice(t, 1),
                    i = s.activeItems.filter((e) => e !== n[0]),
                    r = s.keepScrollPosition;
                  ((s.keepScrollPosition = !0),
                    (s.items = e),
                    i && (s.activeItems = i),
                    (s.keepScrollPosition = r));
                }
              },
            }),
        ),
        s.onDidTriggerSeparatorButton((e) => t.onDidTriggerSeparatorButton?.(e)),
        s.onDidChangeValue((e) => {
          !a ||
            e ||
            (1 === s.activeItems.length && s.activeItems[0] === a) ||
            (s.activeItems = [a]);
        }),
        n.onCancellationRequested(() => {
          s.hide();
        }),
        s.onDidHide(() => {
          (IO(l), o(void 0));
        }),
      ];
      ((s.title = t.title),
        t.value && (s.value = t.value),
        (s.canSelectMany = !!t.canPickMany),
        (s.placeholder = t.placeHolder),
        (s.prompt = t.prompt),
        (s.ignoreFocusOut = !!t.ignoreFocusLost),
        (s.matchOnDescription = !!t.matchOnDescription),
        (s.matchOnDetail = !!t.matchOnDetail),
        void 0 !== t.sortByLabel && (s.sortByLabel = t.sortByLabel),
        (s.matchOnLabel = void 0 === t.matchOnLabel || t.matchOnLabel),
        (s.quickNavigate = t.quickNavigate),
        (s.hideInput = !!t.hideInput),
        (s.contextKey = t.contextKey),
        (s.busy = !0),
        Promise.all([e, t.activeItem]).then(([e, t]) => {
          ((a = t),
            (s.busy = !1),
            (s.items = e),
            s.canSelectMany &&
              (s.selectedItems = e.filter((e) => "separator" !== e.type && e.picked)),
            a && (s.activeItems = [a]));
        }),
        s.show(),
        Promise.resolve(e).then(void 0, (e) => {
          (r(e), s.hide());
        }));
    });
  }
  setValidationOnInput(e, t) {
    t && oR(t)
      ? ((e.severity = G4.Error), (e.validationMessage = t))
      : t && !oR(t)
        ? ((e.severity = t.severity), (e.validationMessage = t.content))
        : ((e.severity = G4.Ignore), (e.validationMessage = void 0));
  }
  input(e = {}, t = aM.None) {
    return new Promise((n) => {
      if (t.isCancellationRequested) return void n(void 0);
      const i = this.createInputBox(),
        r = e.validateInput || (() => Promise.resolve(void 0)),
        o = $O.debounce(i.onDidChangeValue, (e, t) => t, 100);
      let s = e.value || "",
        a = Promise.resolve(r(s));
      const l = [
        i,
        o((e) => {
          (e !== s && ((a = Promise.resolve(r(e))), (s = e)),
            a.then((t) => {
              e === s && this.setValidationOnInput(i, t);
            }));
        }),
        i.onDidAccept(() => {
          const e = i.value;
          (e !== s && ((a = Promise.resolve(r(e))), (s = e)),
            a.then((t) => {
              !t || (!oR(t) && t.severity !== G4.Error)
                ? (n(e), i.hide())
                : e === s && this.setValidationOnInput(i, t);
            }));
        }),
        t.onCancellationRequested(() => {
          i.hide();
        }),
        i.onDidHide(() => {
          (IO(l), n(void 0));
        }),
      ];
      ((i.title = e.title),
        (i.value = e.value || ""),
        (i.valueSelection = e.valueSelection),
        (i.prompt = e.prompt),
        (i.placeholder = e.placeHolder),
        (i.password = !!e.password),
        (i.ignoreFocusOut = !!e.ignoreFocusLost),
        i.show());
    });
  }
  createQuickPick(e = { useSeparators: !1 }) {
    const t = this.getUI(!0);
    return new RUe(t);
  }
  createInputBox() {
    const e = this.getUI(!0);
    return new OUe(e);
  }
  show(e) {
    const t = this.getUI(!0);
    this.onShowEmitter.fire();
    const n = this.controller;
    ((this.controller = e),
      n?.didHide(),
      this.setEnabled(!0),
      t.leftActionBar.clear(),
      (t.title.textContent = ""),
      (t.description1.textContent = ""),
      (t.description2.textContent = ""),
      PB(t.widget),
      t.rightActionBar.clear(),
      t.inlineActionBar.clear(),
      (t.checkAll.checked = !1),
      (t.inputBox.placeholder = ""),
      (t.inputBox.password = !1),
      t.inputBox.showDecoration(G4.Ignore),
      t.visibleCount.setCount(0),
      t.count.setCount(0),
      PB(t.message),
      t.progressBar.stop(),
      t.progressBar.getContainer().setAttribute("aria-hidden", "true"),
      t.list.setElements([]),
      (t.list.matchOnDescription = !1),
      (t.list.matchOnDetail = !1),
      (t.list.matchOnLabel = !0),
      (t.list.sortByLabel = !0),
      t.tree.updateFilterOptions({ matchOnDescription: !1, matchOnLabel: !0 }),
      (t.tree.sortByLabel = !0),
      (t.ignoreFocusOut = !1),
      (t.inputBox.toggles = void 0));
    const i = this.options.backKeybindingLabel();
    ((TUe.tooltip = i ? SI(1768, "Back ({0})", i) : SI(1769, "Back")),
      (t.container.style.display = ""),
      this.updateLayout(),
      this.dndController?.layoutContainer(),
      t.inputBox.setFocus(),
      this.quickInputTypeContext.set(e.type));
  }
  isVisible() {
    return !!this.ui && "none" !== this.ui.container.style.display;
  }
  setVisibilities(e) {
    const t = this.getUI();
    ((t.title.style.display = e.title ? "" : "none"),
      (t.description1.style.display = e.description && (e.inputBox || e.checkAll) ? "" : "none"),
      (t.description2.style.display = !e.description || e.inputBox || e.checkAll ? "none" : ""),
      (t.checkAll.domNode.style.display = e.checkAll ? "" : "none"),
      (t.inputContainer.style.display = e.inputBox ? "" : "none"),
      (t.filterContainer.style.display = e.inputBox ? "" : "none"),
      (t.visibleCountContainer.style.display = e.visibleCount ? "" : "none"),
      (t.countContainer.style.display = e.count ? "" : "none"),
      (t.okContainer.style.display = e.ok ? "" : "none"),
      (t.customButtonContainer.style.display = e.customButton ? "" : "none"),
      (t.message.style.display = e.message ? "" : "none"),
      (t.progressBar.getContainer().style.display = e.progressBar ? "" : "none"),
      (t.list.displayed = !!e.list),
      (t.tree.displayed = !!e.tree),
      t.container.classList.toggle("show-checkboxes", !!e.checkBox),
      t.container.classList.toggle("hidden-input", !e.inputBox && !e.description),
      this.updateLayout());
  }
  setEnabled(e) {
    if (e !== this.enabled) {
      this.enabled = e;
      const t = this.getUI();
      for (const n of t.leftActionBar.viewItems) n.action.enabled = e;
      for (const n of t.rightActionBar.viewItems) n.action.enabled = e;
      (e ? t.checkAll.enable() : t.checkAll.disable(),
        (t.inputBox.enabled = e),
        (t.ok.enabled = e),
        (t.list.enabled = e));
    }
  }
  hide(e) {
    const t = this.controller;
    if (!t) return;
    t.willHide(e);
    const n = this.ui?.container,
      i = n && !yB(n);
    if (
      ((this.controller = null), this.onHideEmitter.fire(), n && (n.style.display = "none"), !i)
    ) {
      let e = this.previousFocusElement;
      for (; e && !e.offsetParent; ) e = e.parentElement ?? void 0;
      e?.offsetParent
        ? (e.focus(), (this.previousFocusElement = void 0))
        : this.options.returnFocus();
    }
    t.didHide(e);
  }
  toggleHover() {
    this.isVisible() && this.controller instanceof RUe && this.getUI().list.toggleHover();
  }
  layout(e, t) {
    ((this.dimension = e), (this.titleBarOffset = t), this.updateLayout());
  }
  updateLayout() {
    if (this.ui && this.isVisible()) {
      const e = this.ui.container.style,
        t = Math.min(0.62 * this.dimension.width, w$e.MAX_WIDTH);
      ((e.width = t + "px"),
        (e.top = `${this.viewState?.top ? Math.round(this.dimension.height * this.viewState.top) : this.titleBarOffset}px`),
        (e.left = `${Math.round(this.dimension.width * (this.viewState?.left ?? 0.5) - t / 2)}px`),
        this.ui.inputBox.layout(),
        this.ui.list.layout(this.dimension && 0.4 * this.dimension.height),
        this.ui.tree.layout(this.dimension && 0.4 * this.dimension.height));
    }
  }
  applyStyles(e) {
    ((this.styles = e), this.updateStyles());
  }
  updateStyles() {
    if (this.ui) {
      const {
        quickInputTitleBackground: e,
        quickInputBackground: t,
        quickInputForeground: n,
        widgetBorder: i,
        widgetShadow: r,
      } = this.styles.widget;
      ((this.ui.titleBar.style.backgroundColor = e ?? ""),
        (this.ui.container.style.backgroundColor = t ?? ""),
        (this.ui.container.style.color = n ?? ""),
        (this.ui.container.style.border = i ? `1px solid ${i}` : ""),
        (this.ui.container.style.boxShadow = r ? `0 0 8px 2px ${r}` : ""),
        this.ui.list.style(this.styles.list),
        this.ui.tree.tree.style(this.styles.list));
      const o = [];
      (this.styles.pickerGroup.pickerGroupBorder &&
        o.push(
          `.quick-input-list .quick-input-list-entry { border-top-color:  ${this.styles.pickerGroup.pickerGroupBorder}; }`,
        ),
        this.styles.pickerGroup.pickerGroupForeground &&
          o.push(
            `.quick-input-list .quick-input-list-separator { color:  ${this.styles.pickerGroup.pickerGroupForeground}; }`,
          ),
        this.styles.pickerGroup.pickerGroupForeground &&
          o.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) &&
          (o.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),
          this.styles.keybindingLabel.keybindingLabelBackground &&
            o.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),
          this.styles.keybindingLabel.keybindingLabelBorder &&
            o.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),
          this.styles.keybindingLabel.keybindingLabelBottomBorder &&
            o.push(
              `border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`,
            ),
          this.styles.keybindingLabel.keybindingLabelShadow &&
            o.push(
              `box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`,
            ),
          this.styles.keybindingLabel.keybindingLabelForeground &&
            o.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),
          o.push("}")));
      const s = o.join("\n");
      s !== this.ui.styleSheet.textContent && (this.ui.styleSheet.textContent = s);
    }
  }
  loadViewState() {
    try {
      const e = JSON.parse(this.storageService.get(E$e, -1, "{}"));
      if (void 0 !== e.top || void 0 !== e.left) return e;
    } catch {}
  }
  saveViewState(e) {
    this.layoutService.activeContainer === this.layoutService.mainContainer &&
      (void 0 !== e
        ? this.storageService.store(E$e, JSON.stringify(e), -1, 1)
        : this.storageService.remove(E$e, -1));
  }
};
N$e = w$e = C$e([S$e(1, bpe), S$e(2, vV), S$e(3, xW), S$e(4, oue)], N$e);
let L$e = class extends PO {
  constructor(e, t, n, i, r, o, s) {
    (super(),
      (this._container = e),
      (this._quickInputContainer = t),
      (this._quickInputDragAreas = n),
      (this._layoutService = r),
      (this.configurationService = s),
      (this.dndViewState = LF(this, void 0)),
      (this._snapThreshold = 20),
      (this._snapLineHorizontalRatio = 0.25),
      (this._quickInputAlignmentContext = SUe.bindTo(o)));
    const a =
      "custom" ===
      (function (e) {
        if (BR || PR || "native" === xue(e)) return "native";
        const t = e.getValue("window"),
          n = t?.controlsStyle;
        return "custom" === n || "hidden" === n ? n : "native";
      })(this.configurationService);
    ((this._controlsOnLeft = a && 1 === zR),
      (this._controlsOnRight = a && (3 === zR || 2 === zR)),
      this._registerLayoutListener(),
      this.registerMouseListeners(),
      this.dndViewState.set({ ...i, done: !0 }, void 0));
  }
  reparentUI(e) {
    this._container = e;
  }
  layoutContainer(e = this._layoutService.activeContainerDimension) {
    const t = this.dndViewState.get(),
      n = this._quickInputContainer.getBoundingClientRect();
    if (t?.top && t?.left) {
      const i = (Math.round(100 * t.left) / 100) * e.width - n.width / 2;
      this._layout(t.top * e.height, i);
    }
  }
  _registerLayoutListener() {
    this._register(
      $O.filter(
        this._layoutService.onDidLayoutContainer,
        (e) => e.container === this._container,
      )((e) => this.layoutContainer(e.dimension)),
    );
  }
  registerMouseListeners() {
    const e = this._quickInputContainer;
    (this._register(
      ZF(e, (t) => {
        const n = new EO(MF(e), t);
        2 === n.detail &&
          this._quickInputDragAreas.some(({ node: e, includeChildren: t }) =>
            t ? gB(n.target, e) : n.target === e,
          ) &&
          this.dndViewState.set({ top: void 0, left: void 0, done: !0 }, void 0);
      }),
    ),
      this._register(
        GF(e, (e) => {
          const t = MF(this._layoutService.activeContainer),
            n = new EO(t, e);
          if (
            !this._quickInputDragAreas.some(({ node: e, includeChildren: t }) =>
              t ? gB(n.target, e) : n.target === e,
            )
          )
            return;
          const i = this._quickInputContainer.getBoundingClientRect(),
            r = n.browserEvent.clientX - i.left,
            o = n.browserEvent.clientY - i.top;
          let s = !1;
          const a =
            ((l = (e) => {
              (new EO(t, e).preventDefault(),
                s || (s = !0),
                this._layout(e.clientY - o, e.clientX - r));
            }),
            $F(t, WR && iO ? DB.POINTER_MOVE : DB.MOUSE_MOVE, l, c));
          var l, c;
          const d = ZF(t, (e) => {
            if (s) {
              const e = this.dndViewState.get();
              this.dndViewState.set({ top: e?.top, left: e?.left, done: !0 }, void 0);
            }
            (a.dispose(), d.dispose());
          });
        }),
      ));
  }
  _layout(e, t) {
    const n = this._getTopSnapValue(),
      i = this._getCenterYSnapValue(),
      r = this._getCenterXSnapValue();
    (e = Math.max(
      0,
      Math.min(e, this._container.clientHeight - this._quickInputContainer.clientHeight),
    )) < this._layoutService.activeContainerOffset.top &&
      (this._controlsOnLeft
        ? (t = Math.max(t, 80 / TI(wB())))
        : this._controlsOnRight &&
          (t = Math.min(
            t,
            this._container.clientWidth - this._quickInputContainer.clientWidth - 140 / TI(wB()),
          )));
    const o = Math.abs(e - n) < this._snapThreshold;
    e = o ? n : e;
    const s = Math.abs(e - i) < this._snapThreshold,
      a = (e = s ? i : e) / this._container.clientHeight;
    t = Math.max(
      0,
      Math.min(t, this._container.clientWidth - this._quickInputContainer.clientWidth),
    );
    const l = Math.abs(t - r) < this._snapThreshold;
    t = l ? r : t;
    const c = this._container.clientWidth,
      d = (t + this._quickInputContainer.clientWidth / 2) / c;
    if ((this.dndViewState.set({ top: a, left: d, done: !1 }, void 0), l)) {
      if (o) return void this._quickInputAlignmentContext.set("top");
      if (s) return void this._quickInputAlignmentContext.set("center");
    }
    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)
    );
  }
};
L$e = C$e([S$e(4, bpe), S$e(5, xW), S$e(6, OU)], L$e);
var D$e = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let T$e = class extends v0 {
  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(gUe))),
      this._quickAccess
    );
  }
  constructor(e, t, n, i, r) {
    (super(n),
      (this.instantiationService = e),
      (this.contextKeyService = t),
      (this.layoutService = i),
      (this.configurationService = r),
      (this._onShow = this._register(new QO())),
      (this._onHide = this._register(new QO())),
      (this.contexts = new Map()));
  }
  createController(e = this.layoutService, t) {
    const n = {
        idPrefix: "quickInput_",
        container: e.activeContainer,
        ignoreFocusOut: () => !1,
        backKeybindingLabel: () => {},
        setContextKey: (e) => this.setContextKey(e),
        linkOpenerDelegate: (e) => {
          this.instantiationService.invokeFunction((t) => {
            t.get(mge).open(e, { allowCommands: !0, fromUserGesture: !0 });
          });
        },
        returnFocus: () => e.focus(),
        styles: this.computeStyles(),
        hoverDelegate: this._register(this.instantiationService.createInstance(MUe)),
      },
      i = this._register(this.instantiationService.createInstance(N$e, { ...n, ...t }));
    return (
      i.layout(e.activeContainerDimension, e.activeContainerOffset.quickPickTop),
      this._register(
        e.onDidLayoutActiveContainer((t) => {
          MF(e.activeContainer) === MF(i.container) &&
            i.layout(t, e.activeContainerOffset.quickPickTop);
        }),
      ),
      this._register(
        e.onDidChangeActiveContainer(() => {
          i.isVisible() ||
            i.layout(e.activeContainerDimension, e.activeContainerOffset.quickPickTop);
        }),
      ),
      this._register(
        i.onShow(() => {
          (this.resetContextKeys(), this._onShow.fire());
        }),
      ),
      this._register(
        i.onHide(() => {
          (this.resetContextKeys(), this._onHide.fire());
        }),
      ),
      i
    );
  }
  setContextKey(e) {
    let t;
    (e &&
      ((t = this.contexts.get(e)),
      t || ((t = new yW(e, !1).bindTo(this.contextKeyService)), this.contexts.set(e, t))),
      (t && t.get()) || (this.resetContextKeys(), t?.set(!0)));
  }
  resetContextKeys() {
    this.contexts.forEach((e) => {
      e.get() && e.reset();
    });
  }
  pick(e, t, n = aM.None) {
    return this.controller.pick(e, t, n);
  }
  input(e = {}, t = aM.None) {
    return this.controller.input(e, t);
  }
  createQuickPick(e = { useSeparators: !1 }) {
    return this.controller.createQuickPick(e);
  }
  createInputBox() {
    return this.controller.createInputBox();
  }
  toggleHover() {
    this.hasController && this.controller.toggleHover();
  }
  updateStyles() {
    this.hasController && this.controller.applyStyles(this.computeStyles());
  }
  computeStyles() {
    return {
      widget: {
        quickInputBackground: yG(MX),
        quickInputForeground: yG(AX),
        quickInputTitleBackground: yG(PX),
        widgetBorder: yG(AZ),
        widgetShadow: yG(MZ),
      },
      inputBox: gue,
      toggle: uue,
      countBadge: fue,
      button: cue,
      progressBar: due,
      keybindingLabel: lue,
      list: _ue({
        listBackground: MX,
        listFocusBackground: HX,
        listFocusForeground: VX,
        listInactiveFocusForeground: VX,
        listInactiveSelectionIconForeground: WX,
        listInactiveFocusBackground: HX,
        listFocusOutline: BG,
        listInactiveFocusOutline: BG,
        treeStickyScrollBackground: MX,
      }),
      pickerGroup: { pickerGroupBorder: yG(FX), pickerGroupForeground: yG(jX) },
    };
  }
};
T$e = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([D$e(0, vV), D$e(1, xW), D$e(2, h0), D$e(3, bpe), D$e(4, OU)], T$e);
var I$e = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  R$e = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let O$e = class extends T$e {
  constructor(e, t, n, i, r, o) {
    (super(t, n, i, new xHe(e.getContainerDomNode(), r), o), (this.host = void 0));
    const s = A$e.get(e);
    if (s) {
      const t = s.widget;
      this.host = {
        _serviceBrand: void 0,
        get mainContainer() {
          return t.getDomNode();
        },
        getContainer: () => t.getDomNode(),
        whenContainerStylesLoaded() {},
        get containers() {
          return [t.getDomNode()];
        },
        get activeContainer() {
          return t.getDomNode();
        },
        get mainContainerDimension() {
          return e.getLayoutInfo();
        },
        get activeContainerDimension() {
          return e.getLayoutInfo();
        },
        get onDidLayoutMainContainer() {
          return e.onDidLayoutChange;
        },
        get onDidLayoutActiveContainer() {
          return e.onDidLayoutChange;
        },
        get onDidLayoutContainer() {
          return $O.map(e.onDidLayoutChange, (e) => ({ container: t.getDomNode(), dimension: e }));
        },
        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: () => e.focus(),
      };
    } else this.host = void 0;
  }
  createController() {
    return super.createController(this.host);
  }
};
O$e = I$e([R$e(1, vV), R$e(2, xW), R$e(3, h0), R$e(4, yV), R$e(5, OU)], O$e);
let M$e = class {
  get activeService() {
    const e = this.codeEditorService.getFocusedCodeEditor();
    if (!e) throw new Error("Quick input service needs a focused editor to work.");
    let t = this.mapEditorToService.get(e);
    if (!t) {
      const n = (t = this.instantiationService.createInstance(O$e, e));
      (this.mapEditorToService.set(e, t),
        LO(e.onDidDispose)(() => {
          (n.dispose(), this.mapEditorToService.delete(e));
        }));
    }
    return t;
  }
  get currentQuickInput() {
    return this.activeService.currentQuickInput;
  }
  get quickAccess() {
    return this.activeService.quickAccess;
  }
  constructor(e, t) {
    ((this.instantiationService = e),
      (this.codeEditorService = t),
      (this.mapEditorToService = new Map()));
  }
  pick(e, t, n = aM.None) {
    return this.activeService.pick(e, t, n);
  }
  input(e, t) {
    return this.activeService.input(e, t);
  }
  createQuickPick(e = { useSeparators: !1 }) {
    return this.activeService.createQuickPick(e);
  }
  createInputBox() {
    return this.activeService.createInputBox();
  }
  toggleHover() {
    return this.activeService.toggleHover();
  }
};
M$e = I$e([R$e(0, vV), R$e(1, yV)], M$e);
class A$e {
  static {
    this.ID = "editor.controller.quickInput";
  }
  static get(e) {
    return e.getContribution(A$e.ID);
  }
  constructor(e) {
    ((this.editor = e), (this.widget = new P$e(this.editor)));
  }
  dispose() {
    this.widget.dispose();
  }
}
class P$e {
  static {
    this.ID = "editor.contrib.quickInputWidget";
  }
  constructor(e) {
    ((this.codeEditor = e),
      (this.domNode = document.createElement("div")),
      this.codeEditor.addOverlayWidget(this));
  }
  getId() {
    return P$e.ID;
  }
  getDomNode() {
    return this.domNode;
  }
  getPosition() {
    return { preference: { top: 0, left: 0 } };
  }
  dispose() {
    this.codeEditor.removeOverlayWidget(this);
  }
}
zH(A$e.ID, A$e, 4);
var j$e = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let F$e = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this._contextKeyService = e),
      (this._layoutService = t),
      (this._configurationService = n),
      (this._accessibilitySupport = 0),
      (this._onDidChangeScreenReaderOptimized = new QO()),
      (this._onDidChangeReducedMotion = new QO()),
      (this._onDidChangeLinkUnderline = new QO()),
      (this._accessibilityModeEnabledContext = GK.bindTo(this._contextKeyService)));
    const i = () => this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());
    (this._register(
      this._configurationService.onDidChangeConfiguration((e) => {
        (e.affectsConfiguration("editor.accessibilitySupport") &&
          (i(), this._onDidChangeScreenReaderOptimized.fire()),
          e.affectsConfiguration("workbench.reduceMotion") &&
            ((this._configMotionReduced =
              this._configurationService.getValue("workbench.reduceMotion")),
            this._onDidChangeReducedMotion.fire()));
      }),
    ),
      i(),
      this._register(this.onDidChangeScreenReaderOptimized(() => i())));
    const r = NI.matchMedia("(prefers-reduced-motion: reduce)");
    ((this._systemMotionReduced = r.matches),
      (this._configMotionReduced = this._configurationService.getValue("workbench.reduceMotion")),
      (this._linkUnderlinesEnabled = this._configurationService.getValue(
        "accessibility.underlineLinks",
      )),
      this.initReducedMotionListeners(r),
      this.initLinkUnderlineListeners());
  }
  initReducedMotionListeners(e) {
    this._register(
      $F(e, "change", () => {
        ((this._systemMotionReduced = e.matches),
          "auto" === this._configMotionReduced && this._onDidChangeReducedMotion.fire());
      }),
    );
    const t = () => {
      const e = this.isMotionReduced();
      (this._layoutService.mainContainer.classList.toggle("monaco-reduce-motion", e),
        this._layoutService.mainContainer.classList.toggle("monaco-enable-motion", !e));
    };
    (t(), this._register(this.onDidChangeReducedMotion(() => t())));
  }
  initLinkUnderlineListeners() {
    this._register(
      this._configurationService.onDidChangeConfiguration((e) => {
        if (e.affectsConfiguration("accessibility.underlineLinks")) {
          const e = this._configurationService.getValue("accessibility.underlineLinks");
          ((this._linkUnderlinesEnabled = e), this._onDidChangeLinkUnderline.fire());
        }
      }),
    );
    const e = () => {
      const e = this._linkUnderlinesEnabled;
      this._layoutService.mainContainer.classList.toggle("underline-links", e);
    };
    (e(), this._register(this.onDidChangeLinkUnderlines(() => e())));
  }
  onDidChangeLinkUnderlines(e) {
    return this._onDidChangeLinkUnderline.event(e);
  }
  get onDidChangeScreenReaderOptimized() {
    return this._onDidChangeScreenReaderOptimized.event;
  }
  isScreenReaderOptimized() {
    const e = this._configurationService.getValue("editor.accessibilitySupport");
    return "on" === e || ("auto" === e && 2 === this._accessibilitySupport);
  }
  get onDidChangeReducedMotion() {
    return this._onDidChangeReducedMotion.event;
  }
  isMotionReduced() {
    const e = this._configMotionReduced;
    return "on" === e || ("auto" === e && this._systemMotionReduced);
  }
  getAccessibilitySupport() {
    return this._accessibilitySupport;
  }
};
F$e = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([j$e(0, xW), j$e(1, bpe), j$e(2, OU)], F$e);
var B$e,
  V$e = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
const W$e = "application/vnd.code.resources";
let H$e = class extends PO {
  static {
    B$e = this;
  }
  constructor(e, t) {
    (super(),
      (this.layoutService = e),
      (this.logService = t),
      (this.mapTextToType = new Map()),
      (this.findText = ""),
      (this.resources = []),
      (this.resourcesStateHash = void 0),
      (AI || PI) && this.installWebKitWriteTextWorkaround(),
      this._register(
        $O.runAndSubscribe(
          VF,
          ({ window: e, disposables: t }) => {
            t.add($F(e.document, "copy", () => this.clearResourcesState()));
          },
          { window: NI, disposables: this._store },
        ),
      ));
  }
  triggerPaste() {
    this.logService.trace("BrowserClipboardService#triggerPaste");
  }
  installWebKitWriteTextWorkaround() {
    const e = () => {
      const e = new DM();
      (this.webKitPendingClipboardWritePromise &&
        !this.webKitPendingClipboardWritePromise.isSettled &&
        this.webKitPendingClipboardWritePromise.cancel(),
        (this.webKitPendingClipboardWritePromise = e),
        wB()
          .navigator.clipboard.write([new ClipboardItem({ "text/plain": e.p })])
          .catch(async (t) => {
            (t instanceof Error && "NotAllowedError" === t.name && e.isRejected) ||
              this.logService.error(t);
          }));
    };
    this._register(
      $O.runAndSubscribe(
        this.layoutService.onDidAddContainer,
        ({ container: t, disposables: n }) => {
          (n.add($F(t, "click", e)), n.add($F(t, "keydown", e)));
        },
        { container: this.layoutService.mainContainer, disposables: this._store },
      ),
    );
  }
  async writeText(e, t) {
    if (
      (this.logService.trace(
        "BrowserClipboardService#writeText called with type:",
        t,
        " text.length:",
        e.length,
      ),
      this.clearResourcesState(),
      t)
    )
      return (
        this.mapTextToType.set(t, e),
        void this.logService.trace("BrowserClipboardService#writeText")
      );
    if (this.webKitPendingClipboardWritePromise)
      return this.webKitPendingClipboardWritePromise.complete(e);
    try {
      return (
        this.logService.trace("before navigator.clipboard.writeText"),
        await wB().navigator.clipboard.writeText(e)
      );
    } catch (D2t) {}
    this.fallbackWriteText(e);
  }
  fallbackWriteText(e) {
    this.logService.trace("BrowserClipboardService#fallbackWriteText");
    const t = xB(),
      n = t.activeElement,
      i = t.body.appendChild(VB("textarea", { "aria-hidden": !0 }));
    ((i.style.height = "1px"),
      (i.style.width = "1px"),
      (i.style.position = "absolute"),
      (i.value = e),
      i.focus(),
      i.select(),
      t.execCommand("copy"),
      SB(n) && n.focus(),
      i.remove());
  }
  async readText(e) {
    if ((this.logService.trace("BrowserClipboardService#readText called with type:", e), e)) {
      const t = this.mapTextToType.get(e) || "";
      return (this.logService.trace("BrowserClipboardService#readText text.length:", t.length), t);
    }
    try {
      const e = await wB().navigator.clipboard.readText();
      return (this.logService.trace("BrowserClipboardService#readText text.length:", e.length), e);
    } catch (D2t) {}
    return "";
  }
  async readFindText() {
    return this.findText;
  }
  async writeFindText(e) {
    this.findText = e;
  }
  static {
    this.MAX_RESOURCE_STATE_SOURCE_LENGTH = 1e3;
  }
  async readResources() {
    try {
      const e = await wB().navigator.clipboard.read();
      for (const t of e)
        if (t.types.includes(`web ${W$e}`)) {
          const e = await t.getType(`web ${W$e}`),
            n = JSON.parse(await e.text()).map((e) => mP.from(e));
          return n;
        }
    } catch (D2t) {}
    const e = await this.computeResourcesStateHash();
    return (this.resourcesStateHash !== e && this.clearResourcesState(), this.resources);
  }
  async computeResourcesStateHash() {
    if (0 === this.resources.length) return;
    return UP((await this.readText()).substring(0, B$e.MAX_RESOURCE_STATE_SOURCE_LENGTH));
  }
  clearInternalState() {
    this.clearResourcesState();
  }
  clearResourcesState() {
    ((this.resources = []), (this.resourcesStateHash = void 0));
  }
};
H$e = B$e = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([V$e(0, bpe), V$e(1, yH)], H$e);
const z$e = "data-keybinding-context";
class U$e {
  constructor(e, t) {
    ((this._id = e),
      (this._parent = t),
      (this._value = Object.create(null)),
      (this._value._contextId = e));
  }
  get value() {
    return { ...this._value };
  }
  setValue(e, t) {
    return this._value[e] !== t && ((this._value[e] = t), !0);
  }
  removeValue(e) {
    return e in this._value && (delete this._value[e], !0);
  }
  getValue(e) {
    const t = this._value[e];
    return void 0 === t && this._parent ? this._parent.getValue(e) : t;
  }
}
class $$e extends U$e {
  static {
    this.INSTANCE = new $$e();
  }
  constructor() {
    super(-1, null);
  }
  setValue(e, t) {
    return !1;
  }
  removeValue(e) {
    return !1;
  }
  getValue(e) {}
}
class q$e extends U$e {
  static {
    this._keyPrefix = "config.";
  }
  constructor(e, t, n) {
    (super(e, null),
      (this._configurationService = t),
      (this._values = Ige.forConfigKeys()),
      (this._listener = this._configurationService.onDidChangeConfiguration((e) => {
        if (7 === e.source) {
          const e = Array.from(this._values, ([e]) => e);
          (this._values.clear(), n.fire(new Z$e(e)));
        } else {
          const t = [];
          for (const n of e.affectedKeys) {
            const e = `config.${n}`,
              i = this._values.findSuperstr(e);
            (void 0 !== i && (t.push(...DO.map(i, ([e]) => e)), this._values.deleteSuperstr(e)),
              this._values.has(e) && (t.push(e), this._values.delete(e)));
          }
          n.fire(new Z$e(t));
        }
      })));
  }
  dispose() {
    this._listener.dispose();
  }
  getValue(e) {
    if (0 !== e.indexOf(q$e._keyPrefix)) return super.getValue(e);
    if (this._values.has(e)) return this._values.get(e);
    const t = e.substr(q$e._keyPrefix.length),
      n = this._configurationService.getValue(t);
    let i;
    switch (typeof n) {
      case "number":
      case "boolean":
      case "string":
        i = n;
        break;
      default:
        i = Array.isArray(n) ? JSON.stringify(n) : n;
    }
    return (this._values.set(e, i), i);
  }
  setValue(e, t) {
    return super.setValue(e, t);
  }
  removeValue(e) {
    return super.removeValue(e);
  }
}
class K$e {
  constructor(e, t, n) {
    ((this._service = e), (this._key = t), (this._defaultValue = n), this.reset());
  }
  set(e) {
    this._service.setContext(this._key, e);
  }
  reset() {
    void 0 === this._defaultValue
      ? this._service.removeContext(this._key)
      : this._service.setContext(this._key, this._defaultValue);
  }
  get() {
    return this._service.getContextKeyValue(this._key);
  }
}
class G$e {
  constructor(e) {
    this.key = e;
  }
  affectsSome(e) {
    return e.has(this.key);
  }
  allKeysContainedIn(e) {
    return this.affectsSome(e);
  }
}
class Z$e {
  constructor(e) {
    this.keys = e;
  }
  affectsSome(e) {
    for (const t of this.keys) if (e.has(t)) return !0;
    return !1;
  }
  allKeysContainedIn(e) {
    return this.keys.every((t) => e.has(t));
  }
}
class Y$e {
  constructor(e) {
    this.events = e;
  }
  affectsSome(e) {
    for (const t of this.events) if (t.affectsSome(e)) return !0;
    return !1;
  }
  allKeysContainedIn(e) {
    return this.events.every((t) => t.allKeysContainedIn(e));
  }
}
class X$e extends PO {
  get onDidChangeContext() {
    return this._onDidChangeContext.event;
  }
  constructor(e) {
    (super(),
      (this._onDidChangeContext = this._register(new eM({ merge: (e) => new Y$e(e) }))),
      (this._isDisposed = !1),
      (this._myContextId = e));
  }
  createKey(e, t) {
    if (this._isDisposed) throw new Error("AbstractContextKeyService has been disposed");
    return new K$e(this, e, t);
  }
  bufferChangeEvents(e) {
    this._onDidChangeContext.pause();
    try {
      e();
    } finally {
      this._onDidChangeContext.resume();
    }
  }
  createScoped(e) {
    if (this._isDisposed) throw new Error("AbstractContextKeyService has been disposed");
    return new J$e(this, e);
  }
  contextMatchesRules(e) {
    if (this._isDisposed) throw new Error("AbstractContextKeyService has been disposed");
    const t = this.getContextValuesContainer(this._myContextId);
    return !e || e.evaluate(t);
  }
  getContextKeyValue(e) {
    if (!this._isDisposed) return this.getContextValuesContainer(this._myContextId).getValue(e);
  }
  setContext(e, t) {
    if (this._isDisposed) return;
    const n = this.getContextValuesContainer(this._myContextId);
    n && n.setValue(e, t) && this._onDidChangeContext.fire(new G$e(e));
  }
  removeContext(e) {
    this._isDisposed ||
      (this.getContextValuesContainer(this._myContextId).removeValue(e) &&
        this._onDidChangeContext.fire(new G$e(e)));
  }
  getContext(e) {
    return this._isDisposed
      ? $$e.INSTANCE
      : this.getContextValuesContainer(
          (function (e) {
            for (; e; ) {
              if (e.hasAttribute(z$e)) {
                const t = e.getAttribute(z$e);
                return t ? parseInt(t, 10) : NaN;
              }
              e = e.parentElement;
            }
            return 0;
          })(e),
        );
  }
  dispose() {
    (super.dispose(), (this._isDisposed = !0));
  }
}
let Q$e = class extends X$e {
  constructor(e) {
    (super(0),
      (this._contexts = new Map()),
      (this._lastContextId = 0),
      (this.inputFocusedContext = Owe.bindTo(this)));
    const t = this._register(new q$e(this._myContextId, e, this._onDidChangeContext));
    (this._contexts.set(this._myContextId, t),
      this._register(
        $O.runAndSubscribe(
          VF,
          ({ window: e, disposables: t }) => {
            const n = t.add(new jO());
            t.add(
              $F(
                e,
                DB.FOCUS_IN,
                () => {
                  ((n.value = new AO()), this.updateInputContextKeys(e.document, n.value));
                },
                !0,
              ),
            );
          },
          { window: NI, disposables: this._store },
        ),
      ));
  }
  updateInputContextKeys(e, t) {
    function n() {
      return !!e.activeElement && YB(e.activeElement);
    }
    const i = n();
    if ((this.inputFocusedContext.set(i), i)) {
      const i = t.add(OB(e.activeElement));
      $O.once(i.onDidBlur)(
        () => {
          (wB().document === e && this.inputFocusedContext.set(n()), i.dispose());
        },
        void 0,
        t,
      );
    }
  }
  getContextValuesContainer(e) {
    return this._isDisposed ? $$e.INSTANCE : this._contexts.get(e) || $$e.INSTANCE;
  }
  createChildContext(e = this._myContextId) {
    if (this._isDisposed) throw new Error("ContextKeyService has been disposed");
    const t = ++this._lastContextId;
    return (this._contexts.set(t, new U$e(t, this.getContextValuesContainer(e))), t);
  }
  disposeContext(e) {
    this._isDisposed || this._contexts.delete(e);
  }
};
Q$e = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(0, OU),
  ],
  Q$e,
);
class J$e extends X$e {
  constructor(e, t) {
    if (
      (super(e.createChildContext()),
      (this._parentChangeListener = this._register(new jO())),
      (this._parent = e),
      this._updateParentChangeListener(),
      (this._domNode = t),
      this._domNode.hasAttribute(z$e))
    ) {
      let e = "";
      this._domNode.classList && (e = Array.from(this._domNode.classList.values()).join(", "));
    }
    this._domNode.setAttribute(z$e, String(this._myContextId));
  }
  _updateParentChangeListener() {
    this._parentChangeListener.value = this._parent.onDidChangeContext((e) => {
      const t = this._parent.getContextValuesContainer(this._myContextId).value;
      var n;
      ((n = t), e.allKeysContainedIn(new Set(Object.keys(n))) || this._onDidChangeContext.fire(e));
    });
  }
  dispose() {
    this._isDisposed ||
      (this._parent.disposeContext(this._myContextId),
      this._domNode.removeAttribute(z$e),
      super.dispose());
  }
  getContextValuesContainer(e) {
    return this._isDisposed ? $$e.INSTANCE : this._parent.getContextValuesContainer(e);
  }
  createChildContext(e = this._myContextId) {
    if (this._isDisposed) throw new Error("ScopedContextKeyService has been disposed");
    return this._parent.createChildContext(e);
  }
  disposeContext(e) {
    this._isDisposed || this._parent.disposeContext(e);
  }
}
(jV.registerCommand("_setContext", function (e, t, n) {
  e.get(xW).createKey(
    String(t),
    (function (e) {
      return Vz(e, (e) =>
        "object" == typeof e && 1 === e.$mid
          ? mP.revive(e).toString()
          : e instanceof mP
            ? e.toString()
            : void 0,
      );
    })(n),
  );
}),
  jV.registerCommand({
    id: "getContextKeyInfo",
    handler: () => [...yW.all()].sort((e, t) => e.key.localeCompare(t.key)),
    metadata: {
      description: SI(1674, "A command that returns information about context keys"),
      args: [],
    },
  }),
  jV.registerCommand("_generateContextKeyInfo", function () {
    const e = [],
      t = new Set();
    for (const n of yW.all()) t.has(n.key) || (t.add(n.key), e.push(n));
    e.sort((e, t) => e.key.localeCompare(t.key));
  }));
let eqe = class {
  constructor(e, t) {
    ((this.key = e), (this.data = t), (this.incoming = new Map()), (this.outgoing = new Map()));
  }
};
class tqe {
  constructor(e) {
    ((this._hashFn = e), (this._nodes = new Map()));
  }
  roots() {
    const e = [];
    for (const t of this._nodes.values()) 0 === t.outgoing.size && e.push(t);
    return e;
  }
  insertEdge(e, t) {
    const n = this.lookupOrInsertNode(e),
      i = this.lookupOrInsertNode(t);
    (n.outgoing.set(i.key, i), i.incoming.set(n.key, n));
  }
  removeNode(e) {
    const t = this._hashFn(e);
    this._nodes.delete(t);
    for (const n of this._nodes.values()) (n.outgoing.delete(t), n.incoming.delete(t));
  }
  lookupOrInsertNode(e) {
    const t = this._hashFn(e);
    let n = this._nodes.get(t);
    return (n || ((n = new eqe(t, e)), this._nodes.set(t, n)), n);
  }
  isEmpty() {
    return 0 === this._nodes.size;
  }
  toString() {
    const e = [];
    for (const [t, n] of this._nodes)
      e.push(
        `${t}\n\t(-> incoming)[${[...n.incoming.keys()].join(", ")}]\n\t(outgoing ->)[${[...n.outgoing.keys()].join(",")}]\n`,
      );
    return e.join("\n");
  }
  findCycleSlow() {
    for (const [e, t] of this._nodes) {
      const n = new Set([e]),
        i = this._findCycle(t, n);
      if (i) return i;
    }
  }
  _findCycle(e, t) {
    for (const [n, i] of e.outgoing) {
      if (t.has(n)) return [...t, n].join(" -> ");
      t.add(n);
      const e = this._findCycle(i, t);
      if (e) return e;
      t.delete(n);
    }
  }
}
class nqe extends Error {
  constructor(e) {
    (super("cyclic dependency between services"),
      (this.message =
        e.findCycleSlow() ?? `UNABLE to detect cycle, dumping graph: \n${e.toString()}`));
  }
}
class iqe {
  constructor(e = new rne(), t = !1, n, i = false) {
    ((this._services = e),
      (this._strict = t),
      (this._parent = n),
      (this._enableTracing = i),
      (this._isDisposed = !1),
      (this._servicesToMaybeDispose = new Set()),
      (this._children = new Set()),
      (this._activeInstantiations = new Set()),
      this._services.set(vV, this),
      (this._globalGraph = i ? (n?._globalGraph ?? new tqe((e) => e)) : void 0));
  }
  dispose() {
    if (!this._isDisposed) {
      ((this._isDisposed = !0), IO(this._children), this._children.clear());
      for (const e of this._servicesToMaybeDispose) TO(e) && e.dispose();
      this._servicesToMaybeDispose.clear();
    }
  }
  _throwIfDisposed() {
    if (this._isDisposed) throw new Error("InstantiationService has been disposed");
  }
  createChild(e, t) {
    this._throwIfDisposed();
    const n = this,
      i = new (class extends iqe {
        dispose() {
          (n._children.delete(i), super.dispose());
        }
      })(e, this._strict, this, this._enableTracing);
    return (this._children.add(i), t?.add(i), i);
  }
  invokeFunction(e, ...t) {
    this._throwIfDisposed();
    const n = rqe.traceInvocation(this._enableTracing, e);
    let i = !1;
    try {
      const r = {
        get: (e) => {
          if (i)
            throw ZI("service accessor is only valid during the invocation of its target method");
          const t = this._getOrCreateServiceInstance(e, n);
          if (!t) throw new Error(`[invokeFunction] unknown service '${e}'`);
          return t;
        },
        getIfExists: (e) => {
          if (i)
            throw ZI("service accessor is only valid during the invocation of its target method");
          return this._getOrCreateServiceInstance(e, n);
        },
      };
      return e(r, ...t);
    } finally {
      ((i = !0), n.stop());
    }
  }
  createInstance(e, ...t) {
    let n, i;
    return (
      this._throwIfDisposed(),
      e instanceof VU
        ? ((n = rqe.traceCreation(this._enableTracing, e.ctor)),
          (i = this._createInstance(e.ctor, e.staticArguments.concat(t), n)))
        : ((n = rqe.traceCreation(this._enableTracing, e)), (i = this._createInstance(e, t, n))),
      n.stop(),
      i
    );
  }
  _createInstance(e, t = [], n) {
    const i = _V.getServiceDependencies(e).sort((e, t) => e.index - t.index),
      r = [];
    for (const s of i) {
      const t = this._getOrCreateServiceInstance(s.id, n);
      (t ||
        this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${s.id}.`, !1),
        r.push(t));
    }
    const o = i.length > 0 ? i[0].index : t.length;
    if (t.length !== o) {
      const e = o - t.length;
      t = e > 0 ? t.concat(new Array(e)) : t.slice(0, o);
    }
    return Reflect.construct(e, t.concat(r));
  }
  _setCreatedServiceInstance(e, t) {
    if (this._services.get(e) instanceof VU) this._services.set(e, t);
    else {
      if (!this._parent) throw new Error("illegalState - setting UNKNOWN service instance");
      this._parent._setCreatedServiceInstance(e, t);
    }
  }
  _getServiceInstanceOrDescriptor(e) {
    const t = this._services.get(e);
    return !t && this._parent ? this._parent._getServiceInstanceOrDescriptor(e) : t;
  }
  _getOrCreateServiceInstance(e, t) {
    this._globalGraph &&
      this._globalGraphImplicitDependency &&
      this._globalGraph.insertEdge(this._globalGraphImplicitDependency, String(e));
    const n = this._getServiceInstanceOrDescriptor(e);
    return n instanceof VU
      ? this._safeCreateAndCacheServiceInstance(e, n, t.branch(e, !0))
      : (t.branch(e, !1), n);
  }
  _safeCreateAndCacheServiceInstance(e, t, n) {
    if (this._activeInstantiations.has(e))
      throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);
    this._activeInstantiations.add(e);
    try {
      return this._createAndCacheServiceInstance(e, t, n);
    } finally {
      this._activeInstantiations.delete(e);
    }
  }
  _createAndCacheServiceInstance(e, t, n) {
    const i = new tqe((e) => e.id.toString());
    let r = 0;
    const o = [{ id: e, desc: t, _trace: n }],
      s = new Set();
    for (; o.length; ) {
      const t = o.pop();
      if (!s.has(String(t.id))) {
        if ((s.add(String(t.id)), i.lookupOrInsertNode(t), r++ > 1e3)) throw new nqe(i);
        for (const n of _V.getServiceDependencies(t.desc.ctor)) {
          const r = this._getServiceInstanceOrDescriptor(n.id);
          if (
            (r ||
              this._throwIfStrict(
                `[createInstance] ${e} depends on ${n.id} which is NOT registered.`,
                !0,
              ),
            this._globalGraph?.insertEdge(String(t.id), String(n.id)),
            r instanceof VU)
          ) {
            const e = { id: n.id, desc: r, _trace: t._trace.branch(n.id, !0) };
            (i.insertEdge(t, e), o.push(e));
          }
        }
      }
    }
    for (;;) {
      const e = i.roots();
      if (0 === e.length) {
        if (!i.isEmpty()) throw new nqe(i);
        break;
      }
      for (const { data: t } of e) {
        if (this._getServiceInstanceOrDescriptor(t.id) instanceof VU) {
          const e = this._createServiceInstanceWithOwner(
            t.id,
            t.desc.ctor,
            t.desc.staticArguments,
            t.desc.supportsDelayedInstantiation,
            t._trace,
          );
          this._setCreatedServiceInstance(t.id, e);
        }
        i.removeNode(t);
      }
    }
    return this._getServiceInstanceOrDescriptor(e);
  }
  _createServiceInstanceWithOwner(e, t, n = [], i, r) {
    if (this._services.get(e) instanceof VU)
      return this._createServiceInstance(e, t, n, i, r, this._servicesToMaybeDispose);
    if (this._parent) return this._parent._createServiceInstanceWithOwner(e, t, n, i, r);
    throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`);
  }
  _createServiceInstance(e, t, n = [], i, r, o) {
    if (i) {
      const i = new iqe(void 0, this._strict, this, this._enableTracing);
      i._globalGraphImplicitDependency = String(e);
      const s = new Map(),
        a = new LM(() => {
          const e = i._createInstance(t, n, r);
          for (const [t, n] of s) {
            const i = e[t];
            if ("function" == typeof i) for (const t of n) t.disposable = i.apply(e, t.listener);
          }
          return (s.clear(), o.add(e), e);
        });
      return new Proxy(Object.create(null), {
        get(e, t) {
          if (
            !a.isInitialized &&
            "string" == typeof t &&
            (t.startsWith("onDid") || t.startsWith("onWill"))
          ) {
            let e = s.get(t);
            e || ((e = new HO()), s.set(t, e));
            return (n, i, r) => {
              if (a.isInitialized) return a.value[t](n, i, r);
              {
                const t = { listener: [n, i, r], disposable: void 0 },
                  o = e.push(t);
                return MO(() => {
                  (o(), t.disposable?.dispose());
                });
              }
            };
          }
          if (t in e) return e[t];
          const n = a.value;
          let i = n[t];
          return ("function" != typeof i || ((i = i.bind(n)), (e[t] = i)), i);
        },
        set: (e, t, n) => ((a.value[t] = n), !0),
        getPrototypeOf: (e) => t.prototype,
      });
    }
    {
      const e = this._createInstance(t, n, r);
      return (o.add(e), e);
    }
  }
  _throwIfStrict(e, t) {
    if (this._strict) throw new Error(e);
  }
}
class rqe {
  static {
    this.all = new Set();
  }
  static {
    this._None = new (class extends rqe {
      constructor() {
        super(0, null);
      }
      stop() {}
      branch() {
        return this;
      }
    })();
  }
  static traceInvocation(e, t) {
    return e
      ? new rqe(2, t.name || new Error().stack.split("\n").slice(3, 4).join("\n"))
      : rqe._None;
  }
  static traceCreation(e, t) {
    return e ? new rqe(1, t.name) : rqe._None;
  }
  static {
    this._totals = 0;
  }
  constructor(e, t) {
    ((this.type = e), (this.name = t), (this._start = Date.now()), (this._dep = []));
  }
  branch(e, t) {
    const n = new rqe(3, e.toString());
    return (this._dep.push([e, t, n]), n);
  }
  stop() {
    const e = Date.now() - this._start;
    rqe._totals += e;
    let t = !1;
    const n = [
      `${1 === this.type ? "CREATE" : "CALL"} ${this.name}`,
      `${(function e(n, i) {
        const r = [],
          o = new Array(n + 1).join("\t");
        for (const [s, a, l] of i._dep)
          if (a && l) {
            ((t = !0), r.push(`${o}CREATES -> ${s}`));
            const i = e(n + 1, l);
            i && r.push(i);
          } else r.push(`${o}uses -> ${s}`);
        return r.join("\n");
      })(1, this)}`,
      `DONE, took ${e.toFixed(2)}ms (grand total ${rqe._totals.toFixed(2)}ms)`,
    ];
    (e > 2 || t) && rqe.all.add(n.join("\n"));
  }
}
const oqe = new Set([
  NP.inMemory,
  NP.vscodeSourceControl,
  NP.walkThrough,
  NP.walkThroughSnippet,
  NP.vscodeChatCodeBlock,
  NP.vscodeTerminal,
]);
class sqe {
  constructor() {
    ((this._byResource = new KW()), (this._byOwner = new Map()));
  }
  set(e, t, n) {
    let i = this._byResource.get(e);
    (i || ((i = new Map()), this._byResource.set(e, i)), i.set(t, n));
    let r = this._byOwner.get(t);
    (r || ((r = new KW()), this._byOwner.set(t, r)), r.set(e, n));
  }
  get(e, t) {
    const n = this._byResource.get(e);
    return n?.get(t);
  }
  delete(e, t) {
    let n = !1,
      i = !1;
    const r = this._byResource.get(e);
    r && (n = r.delete(t));
    const o = this._byOwner.get(t);
    if ((o && (i = o.delete(e)), n !== i)) throw new Error("illegal state");
    return n && i;
  }
  values(e) {
    return "string" == typeof e
      ? (this._byOwner.get(e)?.values() ?? DO.empty())
      : mP.isUri(e)
        ? (this._byResource.get(e)?.values() ?? DO.empty())
        : DO.map(DO.concat(...this._byOwner.values()), (e) => e[1]);
  }
}
class aqe {
  constructor(e) {
    ((this.errors = 0),
      (this.infos = 0),
      (this.warnings = 0),
      (this.unknowns = 0),
      (this._data = new KW()),
      (this._service = e),
      (this._subscription = e.onMarkerChanged(this._update, this)));
  }
  dispose() {
    this._subscription.dispose();
  }
  _update(e) {
    for (const t of e) {
      const e = this._data.get(t);
      e && this._substract(e);
      const n = this._resourceStats(t);
      (this._add(n), this._data.set(t, n));
    }
  }
  _resourceStats(e) {
    const t = { errors: 0, warnings: 0, infos: 0, unknowns: 0 };
    if (oqe.has(e.scheme)) return t;
    for (const { severity: n } of this._service.read({ resource: e }))
      n === Nfe.Error
        ? (t.errors += 1)
        : n === Nfe.Warning
          ? (t.warnings += 1)
          : n === Nfe.Info
            ? (t.infos += 1)
            : (t.unknowns += 1);
    return t;
  }
  _substract(e) {
    ((this.errors -= e.errors),
      (this.warnings -= e.warnings),
      (this.infos -= e.infos),
      (this.unknowns -= e.unknowns));
  }
  _add(e) {
    ((this.errors += e.errors),
      (this.warnings += e.warnings),
      (this.infos += e.infos),
      (this.unknowns += e.unknowns));
  }
}
class lqe {
  constructor() {
    ((this._onMarkerChanged = new tM({ delay: 0, merge: lqe._merge })),
      (this.onMarkerChanged = this._onMarkerChanged.event),
      (this._data = new sqe()),
      (this._stats = new aqe(this)),
      (this._filteredResources = new KW()));
  }
  dispose() {
    (this._stats.dispose(), this._onMarkerChanged.dispose());
  }
  remove(e, t) {
    for (const n of t || []) this.changeOne(e, n, []);
  }
  changeOne(e, t, n) {
    if (sj(n)) {
      this._data.delete(t, e) && this._onMarkerChanged.fire([t]);
    } else {
      const i = [];
      for (const r of n) {
        const n = lqe._toMarker(e, t, r);
        n && i.push(n);
      }
      (this._data.set(t, e, i), this._onMarkerChanged.fire([t]));
    }
  }
  static _toMarker(e, t, n) {
    let {
      code: i,
      severity: r,
      message: o,
      source: s,
      startLineNumber: a,
      startColumn: l,
      endLineNumber: c,
      endColumn: d,
      relatedInformation: u,
      tags: h,
      origin: g,
    } = n;
    if (o)
      return (
        (a = a > 0 ? a : 1),
        (l = l > 0 ? l : 1),
        (c = c >= a ? c : a),
        (d = d > 0 ? d : l),
        {
          resource: t,
          owner: e,
          code: i,
          severity: r,
          message: o,
          source: s,
          startLineNumber: a,
          startColumn: l,
          endLineNumber: c,
          endColumn: d,
          relatedInformation: u,
          tags: h,
          origin: g,
        }
      );
  }
  changeAll(e, t) {
    const n = [],
      i = this._data.values(e);
    if (i)
      for (const r of i) {
        const t = DO.first(r);
        t && (n.push(t.resource), this._data.delete(t.resource, e));
      }
    if (aj(t)) {
      const i = new KW();
      for (const { resource: r, marker: o } of t) {
        const t = lqe._toMarker(e, r, o);
        if (!t) continue;
        const s = i.get(r);
        s ? s.push(t) : (i.set(r, [t]), n.push(r));
      }
      for (const [t, n] of i) this._data.set(t, e, n);
    }
    n.length > 0 && this._onMarkerChanged.fire(n);
  }
  _createFilteredMarker(e, t) {
    const n =
      1 === t.length
        ? SI(1738, 'Problems are paused because: "{0}"', t[0])
        : SI(1739, 'Problems are paused because: "{0}" and {1} more', t[0], t.length - 1);
    return {
      owner: "markersFilter",
      resource: e,
      severity: Nfe.Info,
      message: n,
      startLineNumber: 1,
      startColumn: 1,
      endLineNumber: 1,
      endColumn: 1,
    };
  }
  read(e = Object.create(null)) {
    let { owner: t, resource: n, severities: i, take: r } = e;
    if (((!r || r < 0) && (r = -1), t && n)) {
      const o = e.ignoreResourceFilters ? void 0 : this._filteredResources.get(n);
      if (o?.length) {
        return [this._createFilteredMarker(n, o)];
      }
      const s = this._data.get(n, t);
      if (!s) return [];
      const a = [];
      for (const t of s) {
        if (r > 0 && a.length === r) break;
        const o = e.ignoreResourceFilters ? void 0 : this._filteredResources.get(n);
        o?.length ? a.push(this._createFilteredMarker(n, o)) : lqe._accept(t, i) && a.push(t);
      }
      return a;
    }
    {
      const o = t || n ? this._data.values(n ?? t) : this._data.values(),
        s = [],
        a = new GW();
      for (const t of o)
        for (const n of t) {
          if (a.has(n.resource)) continue;
          if (r > 0 && s.length === r) break;
          const t = e.ignoreResourceFilters ? void 0 : this._filteredResources.get(n.resource);
          t?.length
            ? (s.push(this._createFilteredMarker(n.resource, t)), a.add(n.resource))
            : lqe._accept(n, i) && s.push(n);
        }
      return s;
    }
  }
  static _accept(e, t) {
    return void 0 === t || (t & e.severity) === e.severity;
  }
  static _merge(e) {
    const t = new KW();
    for (const n of e) for (const e of n) t.set(e, !0);
    return Array.from(t.keys());
  }
}
class cqe extends PO {
  get configurationModel() {
    return this._configurationModel;
  }
  constructor(e) {
    (super(), (this.logService = e), (this._configurationModel = aze.createEmptyModel(e)));
  }
  reload() {
    return (this.resetConfigurationModel(), this.configurationModel);
  }
  getConfigurationDefaultOverrides() {
    return {};
  }
  resetConfigurationModel() {
    this._configurationModel = aze.createEmptyModel(this.logService);
    const e = NW.as(YU).getConfigurationProperties();
    this.updateConfigurationModel(Object.keys(e), e);
  }
  updateConfigurationModel(e, t) {
    const n = this.getConfigurationDefaultOverrides();
    for (const i of e) {
      const e = n[i],
        r = t[i];
      void 0 !== e
        ? this._configurationModel.setValue(i, e)
        : r
          ? this._configurationModel.setValue(i, Fz(r.default))
          : this._configurationModel.removeValue(i);
    }
  }
}
class dqe extends PO {
  constructor(e, t = []) {
    (super(),
      (this.logger = new NH([e, ...t])),
      this._register(e.onDidChangeLogLevel((e) => this.setLevel(e))));
  }
  get onDidChangeLogLevel() {
    return this.logger.onDidChangeLogLevel;
  }
  setLevel(e) {
    this.logger.setLevel(e);
  }
  getLevel() {
    return this.logger.getLevel();
  }
  trace(e, ...t) {
    this.logger.trace(e, ...t);
  }
  debug(e, ...t) {
    this.logger.debug(e, ...t);
  }
  info(e, ...t) {
    this.logger.info(e, ...t);
  }
  warn(e, ...t) {
    this.logger.warn(e, ...t);
  }
  error(e, ...t) {
    this.logger.error(e, ...t);
  }
}
var uqe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  hqe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
class gqe {
  constructor(e) {
    ((this.disposed = !1), (this.model = e), (this._onWillDispose = new QO()));
  }
  get textEditorModel() {
    return this.model;
  }
  dispose() {
    ((this.disposed = !0), this._onWillDispose.fire());
  }
}
let pqe = class {
  constructor(e) {
    this.modelService = e;
  }
  createModelReference(e) {
    const t = this.modelService.getModel(e);
    return t ? Promise.resolve(new BO(new gqe(t))) : Promise.reject(new Error("Model not found"));
  }
};
pqe = uqe([hqe(0, wV)], pqe);
class fqe {
  static {
    this.NULL_PROGRESS_RUNNER = { done: () => {}, total: () => {}, worked: () => {} };
  }
  show() {
    return fqe.NULL_PROGRESS_RUNNER;
  }
  async showWhile(e, t) {
    await e;
  }
}
class mqe {
  static {
    this.NO_OP = new X4();
  }
  info(e) {
    return this.notify({ severity: G4.Info, message: e });
  }
  warn(e) {
    return this.notify({ severity: G4.Warning, message: e });
  }
  error(e) {
    return this.notify({ severity: G4.Error, message: e });
  }
  notify(e) {
    switch (e.severity) {
      case G4.Error:
      case G4.Warning:
    }
    return mqe.NO_OP;
  }
  prompt(e, t, n, i) {
    return mqe.NO_OP;
  }
  status(e, t) {
    return { close: () => {} };
  }
}
let _qe = class {
  constructor(e) {
    ((this._onWillExecuteCommand = new QO()),
      (this._onDidExecuteCommand = new QO()),
      (this.onDidExecuteCommand = this._onDidExecuteCommand.event),
      (this._instantiationService = e));
  }
  executeCommand(e, ...t) {
    const n = jV.getCommand(e);
    if (!n) return Promise.reject(new Error(`command '${e}' not found`));
    try {
      this._onWillExecuteCommand.fire({ commandId: e, args: t });
      const i = this._instantiationService.invokeFunction.apply(this._instantiationService, [
        n.handler,
        ...t,
      ]);
      return (this._onDidExecuteCommand.fire({ commandId: e, args: t }), Promise.resolve(i));
    } catch (i) {
      return Promise.reject(i);
    }
  }
};
_qe = uqe([hqe(0, vV)], _qe);
let vqe = class extends vze {
  constructor(e, t, n, i, r, o) {
    (super(e, t, n, i, r),
      (this._cachedResolver = null),
      (this._dynamicKeybindings = []),
      (this._domNodeListeners = []));
    const s = (e) => {
        const t = new AO();
        (t.add(
          $F(e, DB.KEY_DOWN, (e) => {
            const t = new wO(e);
            this._dispatch(t, t.target) && (t.preventDefault(), t.stopPropagation());
          }),
        ),
          t.add(
            $F(e, DB.KEY_UP, (e) => {
              const t = new wO(e);
              this._singleModifierDispatch(t, t.target) && t.preventDefault();
            }),
          ),
          this._domNodeListeners.push(new bqe(e, t)));
      },
      a = (e) => {
        for (let t = 0; t < this._domNodeListeners.length; t++) {
          const n = this._domNodeListeners[t];
          n.domNode === e && (this._domNodeListeners.splice(t, 1), n.dispose());
        }
      },
      l = (e) => {
        e.getOption(70) || s(e.getContainerDomNode());
      };
    (this._register(o.onCodeEditorAdd(l)),
      this._register(
        o.onCodeEditorRemove((e) => {
          e.getOption(70) || a(e.getContainerDomNode());
        }),
      ),
      o.listCodeEditors().forEach(l));
    const c = (e) => {
      s(e.getContainerDomNode());
    };
    (this._register(o.onDiffEditorAdd(c)),
      this._register(
        o.onDiffEditorRemove((e) => {
          a(e.getContainerDomNode());
        }),
      ),
      o.listDiffEditors().forEach(c));
  }
  addDynamicKeybinding(e, t, n, i) {
    return RO(
      jV.registerCommand(e, n),
      this.addDynamicKeybindings([{ keybinding: t, command: e, when: i }]),
    );
  }
  addDynamicKeybindings(e) {
    const t = e.map((e) => ({
      keybinding: pO(e.keybinding, GR),
      command: e.command ?? null,
      commandArgs: e.commandArgs,
      when: e.when,
      weight1: 1e3,
      weight2: 0,
      extensionId: null,
      isBuiltinExtension: !1,
    }));
    return (
      (this._dynamicKeybindings = this._dynamicKeybindings.concat(t)),
      this.updateResolver(),
      MO(() => {
        for (let e = 0; e < this._dynamicKeybindings.length; e++)
          if (this._dynamicKeybindings[e] === t[0])
            return (this._dynamicKeybindings.splice(e, t.length), void this.updateResolver());
      })
    );
  }
  updateResolver() {
    ((this._cachedResolver = null), this._onDidUpdateKeybindings.fire());
  }
  _getResolver() {
    if (!this._cachedResolver) {
      const e = this._toNormalizedKeybindingItems(DW.getDefaultKeybindings(), !0),
        t = this._toNormalizedKeybindingItems(this._dynamicKeybindings, !1);
      this._cachedResolver = new pze(e, t, (e) => this._log(e));
    }
    return this._cachedResolver;
  }
  _documentHasFocus() {
    return NI.document.hasFocus();
  }
  _toNormalizedKeybindingItems(e, t) {
    const n = [];
    let i = 0;
    for (const r of e) {
      const e = r.when || void 0,
        o = r.keybinding;
      if (o) {
        const s = Cze.resolveKeybinding(o, GR);
        for (const o of s) n[i++] = new yze(o, r.command, r.commandArgs, e, t, null, !1);
      } else n[i++] = new yze(void 0, r.command, r.commandArgs, e, t, null, !1);
    }
    return n;
  }
  resolveKeyboardEvent(e) {
    const t = new mO(e.ctrlKey, e.shiftKey, e.altKey, e.metaKey, e.keyCode);
    return new Cze([t], GR);
  }
};
vqe = uqe([hqe(0, xW), hqe(1, PV), hqe(2, HW), hqe(3, Y4), hqe(4, yH), hqe(5, yV)], vqe);
class bqe extends PO {
  constructor(e, t) {
    (super(), (this.domNode = e), this._register(t));
  }
}
function yqe(e) {
  return !(
    !e ||
    "object" != typeof e ||
    (e.overrideIdentifier && "string" != typeof e.overrideIdentifier) ||
    (e.resource && !(e.resource instanceof mP))
  );
}
let xqe = class {
  constructor(e) {
    ((this.logService = e),
      (this._onDidChangeConfiguration = new QO()),
      (this.onDidChangeConfiguration = this._onDidChangeConfiguration.event));
    const t = new cqe(e);
    ((this._configuration = new dze(
      t.reload(),
      aze.createEmptyModel(e),
      aze.createEmptyModel(e),
      aze.createEmptyModel(e),
      aze.createEmptyModel(e),
      aze.createEmptyModel(e),
      new KW(),
      aze.createEmptyModel(e),
      new KW(),
      e,
    )),
      t.dispose());
  }
  getValue(e, t) {
    const n = "string" == typeof e ? e : void 0,
      i = yqe(e) ? e : yqe(t) ? t : {};
    return this._configuration.getValue(n, i, void 0);
  }
  updateValues(e) {
    const t = { data: this._configuration.toData() },
      n = [];
    for (const i of e) {
      const [e, t] = i;
      this.getValue(e) !== t && (this._configuration.updateValue(e, t), n.push(e));
    }
    if (n.length > 0) {
      const e = new uze(
        { keys: n, overrides: [] },
        t,
        this._configuration,
        void 0,
        this.logService,
      );
      ((e.source = 8), this._onDidChangeConfiguration.fire(e));
    }
    return Promise.resolve();
  }
  updateValue(e, t, n, i) {
    return this.updateValues([[e, t]]);
  }
  inspect(e, t = {}) {
    return this._configuration.inspect(e, t, void 0);
  }
};
xqe = uqe([hqe(0, yH)], xqe);
let wqe = class {
  constructor(e, t, n) {
    ((this.configurationService = e),
      (this.modelService = t),
      (this.languageService = n),
      (this._onDidChangeConfiguration = new QO()),
      this.configurationService.onDidChangeConfiguration((e) => {
        this._onDidChangeConfiguration.fire({
          affectedKeys: e.affectedKeys,
          affectsConfiguration: (t, n) => e.affectsConfiguration(n),
        });
      }));
  }
  getValue(e, t, n) {
    const i = xV.isIPosition(t) ? t : null,
      r = i ? ("string" == typeof n ? n : void 0) : "string" == typeof t ? t : void 0,
      o = e ? this.getLanguage(e, i) : void 0;
    return void 0 === r
      ? this.configurationService.getValue({ resource: e, overrideIdentifier: o })
      : this.configurationService.getValue(r, { resource: e, overrideIdentifier: o });
  }
  getLanguage(e, t) {
    const n = this.modelService.getModel(e);
    return n
      ? t
        ? n.getLanguageIdAtPosition(t.lineNumber, t.column)
        : n.getLanguageId()
      : this.languageService.guessLanguageIdByFilepathOrFirstLine(e);
  }
};
wqe = uqe([hqe(0, OU), hqe(1, wV), hqe(2, BU)], wqe);
let Cqe = class {
  constructor(e) {
    this.configurationService = e;
  }
  getEOL(e, t) {
    const n = this.configurationService.getValue("files.eol", {
      overrideIdentifier: t,
      resource: e,
    });
    return n && "string" == typeof n && "auto" !== n ? n : jR || PR ? "\n" : "\r\n";
  }
};
Cqe = uqe([hqe(0, OU)], Cqe);
class Sqe {
  static {
    this.SCHEME = "inmemory";
  }
  constructor() {
    const e = mP.from({ scheme: Sqe.SCHEME, authority: "model", path: "/" });
    this.workspace = { id: Fge, folders: [new Pge({ uri: e, name: "", index: 0 })] };
  }
  getWorkspace() {
    return this.workspace;
  }
  getWorkspaceFolder(e) {
    return e && e.scheme === Sqe.SCHEME ? this.workspace.folders[0] : null;
  }
}
function kqe(e, t, n) {
  if (!t) return;
  if (!(e instanceof xqe)) return;
  const i = [];
  (Object.keys(t).forEach((e) => {
    ((function (e) {
      return cfe()[`editor.${e}`] || !1;
    })(e) && i.push([`editor.${e}`, t[e]]),
      n &&
        (function (e) {
          return cfe()[`diffEditor.${e}`] || !1;
        })(e) &&
        i.push([`diffEditor.${e}`, t[e]]));
  }),
    i.length > 0 && e.updateValues(i));
}
let Eqe = class {
  constructor(e) {
    this._modelService = e;
  }
  hasPreviewHandler() {
    return !1;
  }
  async apply(e, t) {
    const n = Array.isArray(e) ? e : rge.convert(e),
      i = new Map();
    for (const s of n) {
      if (!(s instanceof oge)) throw new Error("bad edit - only text edits are supported");
      const e = this._modelService.getModel(s.resource);
      if (!e) throw new Error("bad edit - model not found");
      if ("number" == typeof s.versionId && e.getVersionId() !== s.versionId)
        throw new Error("bad state - model changed in the meantime");
      let t = i.get(e);
      (t || ((t = []), i.set(e, t)),
        t.push(hye.replaceMove(YH.lift(s.textEdit.range), s.textEdit.text)));
    }
    let r = 0,
      o = 0;
    for (const [s, a] of i)
      (s.pushStackElement(),
        s.pushEditOperations([], a, () => []),
        s.pushStackElement(),
        (o += 1),
        (r += a.length));
    return { ariaSummary: WM(TFe.bulkEditServiceSummary, r, o), isApplied: r > 0 };
  }
};
Eqe = uqe([hqe(0, wV)], Eqe);
let Nqe = class extends YHe {
  constructor(e, t) {
    (super(e), (this._codeEditorService = t));
  }
  showContextView(e, t, n) {
    if (!t) {
      const e =
        this._codeEditorService.getFocusedCodeEditor() ||
        this._codeEditorService.getActiveCodeEditor();
      e && (t = e.getContainerDomNode());
    }
    return super.showContextView(e, t, n);
  }
};
Nqe = uqe([hqe(0, bpe), hqe(1, yV)], Nqe);
let Lqe = class extends Kze {
  constructor(e, t, n, i, r, o) {
    (super(e, t, n, i, r, o), this.configure({ blockMouse: !1 }));
  }
};
Lqe = uqe([hqe(0, HW), hqe(1, Y4), hqe(2, lde), hqe(3, N5), hqe(4, AW), hqe(5, xW)], Lqe);
const Dqe = { esmModuleLocation: void 0, label: "editorWorkerService" };
let Tqe = class extends VWe {
  constructor(e, t, n, i, r) {
    super(Dqe, e, t, n, i, r);
  }
};
Tqe = uqe([hqe(0, wV), hqe(1, UAe), hqe(2, yH), hqe(3, f$), hqe(4, mee)], Tqe);
var Iqe;
(HU(
  yH,
  class extends dqe {
    constructor() {
      super(new EH());
    }
  },
  0,
),
  HU(OU, xqe, 0),
  HU(UAe, wqe, 0),
  HU($Ae, Cqe, 0),
  HU(Rge, Sqe, 0),
  HU(
    GCe,
    class {
      getUriLabel(e, t) {
        return "file" === e.scheme ? e.fsPath : e.path;
      }
      getUriBasenameLabel(e) {
        return dH(e);
      }
    },
    0,
  ),
  HU(
    HW,
    class {
      publicLog2() {}
    },
    0,
  ),
  HU(
    Cje,
    class {
      async confirm(e) {
        return { confirmed: this.doConfirm(e.message, e.detail), checkboxChecked: !1 };
      }
      doConfirm(e, t) {
        let n = e;
        return (t && (n = n + "\n\n" + t), NI.confirm(n));
      }
      async prompt(e) {
        let t;
        if (this.doConfirm(e.message, e.detail)) {
          const n = [...(e.buttons ?? [])];
          (e.cancelButton &&
            "string" != typeof e.cancelButton &&
            "boolean" != typeof e.cancelButton &&
            n.push(e.cancelButton),
            (t = await n[0]?.run({ checkboxChecked: !1 })));
        }
        return { result: t };
      }
      async error(e, t) {
        await this.prompt({ type: G4.Error, message: e, detail: t });
      }
    },
    0,
  ),
  HU(
    ume,
    class {
      constructor() {
        ((this.isExtensionDevelopment = !1), (this.isBuilt = !1));
      }
    },
    0,
  ),
  HU(Y4, mqe, 0),
  HU(Tfe, lqe, 0),
  HU(
    BU,
    class extends Mze {
      constructor() {
        super();
      }
    },
    0,
  ),
  HU(
    OFe,
    class extends PO {
      constructor() {
        (super(),
          (this._onColorThemeChange = this._register(new QO())),
          (this.onDidColorThemeChange = this._onColorThemeChange.event),
          (this._onProductIconThemeChange = this._register(new QO())),
          (this.onDidProductIconThemeChange = this._onProductIconThemeChange.event),
          (this._environment = Object.create(null)),
          (this._builtInProductIconTheme = new zBe()),
          (this._autoDetectHighContrast = !0),
          (this._knownThemes = new Map()),
          this._knownThemes.set(UBe, JBe(UBe)),
          this._knownThemes.set($Be, JBe($Be)),
          this._knownThemes.set(qBe, JBe(qBe)),
          this._knownThemes.set(KBe, JBe(KBe)));
        const e = this._register(
          (function (e) {
            const t = new AO(),
              n = t.add(new QO()),
              i = Yle();
            return (
              t.add(i.onDidChange(() => n.fire())),
              e && t.add(e.onDidProductIconThemeChange(() => n.fire())),
              {
                dispose: () => t.dispose(),
                onDidChange: n.event,
                getCSS() {
                  const t = e ? e.getProductIconTheme() : new zBe(),
                    n = {},
                    r = new Kne(),
                    o = new Kne();
                  for (const e of i.getIcons()) {
                    const i = t.getIcon(e);
                    if (!i) continue;
                    const s = i.font,
                      a = qne`--vscode-icon-${$ne(e.id)}-font-family`,
                      l = qne`--vscode-icon-${$ne(e.id)}-content`;
                    s
                      ? ((n[s.id] = s.definition),
                        o.push(qne`${a}: ${zne(s.id)};`, qne`${l}: ${zne(i.fontCharacter)};`),
                        r.push(
                          qne`.codicon-${$ne(e.id)}:before { content: ${zne(i.fontCharacter)}; font-family: ${zne(s.id)}; }`,
                        ))
                      : (o.push(qne`${l}: ${zne(i.fontCharacter)}; ${a}: 'codicon';`),
                        r.push(
                          qne`.codicon-${$ne(e.id)}:before { content: ${zne(i.fontCharacter)}; }`,
                        ));
                  }
                  for (const e in n) {
                    const t = n[e],
                      i = t.weight ? qne`font-weight: ${Hne(t.weight)};` : qne``,
                      o = t.style ? qne`font-style: ${Hne(t.style)};` : qne``,
                      s = new Kne();
                    for (const e of t.src) s.push(qne`${Une(e.location)} format(${zne(e.format)})`);
                    r.push(
                      qne`@font-face { src: ${s.join(", ")}; font-family: ${zne(e)};${i}${o} font-display: block; }`,
                    );
                  }
                  return (r.push(qne`:root { ${o.join(" ")} }`), r.join("\n"));
                },
              }
            );
          })(this),
        );
        ((this._codiconCSS = e.getCSS()),
          (this._themeCSS = ""),
          (this._allCSS = `${this._codiconCSS}\n${this._themeCSS}`),
          (this._globalStyleElement = null),
          (this._styleElements = []),
          (this._colorMapOverride = null),
          this.setTheme(UBe),
          this._onOSSchemeChanged(),
          this._register(
            e.onDidChange(() => {
              ((this._codiconCSS = e.getCSS()), this._updateCSS());
            }),
          ),
          DI(NI, "(forced-colors: active)", () => {
            this._onOSSchemeChanged();
          }));
      }
      registerEditorContainer(e) {
        return mB(e) ? this._registerShadowDomContainer(e) : this._registerRegularEditorContainer();
      }
      _registerRegularEditorContainer() {
        return (
          this._globalStyleElement ||
            ((this._globalStyleElement = rG(void 0, (e) => {
              ((e.className = "monaco-colors"), (e.textContent = this._allCSS));
            })),
            this._styleElements.push(this._globalStyleElement)),
          PO.None
        );
      }
      _registerShadowDomContainer(e) {
        const t = rG(e, (e) => {
          ((e.className = "monaco-colors"), (e.textContent = this._allCSS));
        });
        return (
          this._styleElements.push(t),
          {
            dispose: () => {
              for (let e = 0; e < this._styleElements.length; e++)
                if (this._styleElements[e] === t) return void this._styleElements.splice(e, 1);
            },
          }
        );
      }
      defineTheme(e, t) {
        if (!/^[a-z0-9\-]+$/i.test(e)) throw new Error("Illegal theme name!");
        if (!XBe(t.base) && !XBe(e)) throw new Error("Illegal theme base!");
        (this._knownThemes.set(e, new YBe(e, t)),
          XBe(e) &&
            this._knownThemes.forEach((t) => {
              t.base === e && t.notifyBaseUpdated();
            }),
          this._theme.themeName === e && this.setTheme(e));
      }
      getColorTheme() {
        return this._theme;
      }
      setColorMapOverride(e) {
        ((this._colorMapOverride = e), this._updateThemeOrColorMap());
      }
      setTheme(e) {
        let t;
        ((t = this._knownThemes.has(e) ? this._knownThemes.get(e) : this._knownThemes.get(UBe)),
          this._updateActualTheme(t));
      }
      _updateActualTheme(e) {
        e && this._theme !== e && ((this._theme = e), this._updateThemeOrColorMap());
      }
      _onOSSchemeChanged() {
        if (this._autoDetectHighContrast) {
          const e = NI.matchMedia("(forced-colors: active)").matches;
          if (e !== TQ(this._theme.type)) {
            let t;
            ((t = IQ(this._theme.type) ? (e ? qBe : $Be) : e ? KBe : UBe),
              this._updateActualTheme(this._knownThemes.get(t)));
          }
        }
      }
      setAutoDetectHighContrast(e) {
        ((this._autoDetectHighContrast = e), this._onOSSchemeChanged());
      }
      _updateThemeOrColorMap() {
        const e = [],
          t = {},
          n = {
            addRule: (n) => {
              t[n] || (e.push(n), (t[n] = !0));
            },
          };
        ZBe.getThemingParticipants().forEach((e) => e(this._theme, n, this._environment));
        const i = [];
        for (const o of GBe.getColors()) {
          const e = this._theme.getColor(o.id, !0);
          e && i.push(`${bG(o.id)}: ${e.toString()};`);
        }
        n.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${i.join("\n")} }`);
        const r = this._colorMapOverride || this._theme.tokenTheme.getColorMap();
        (n.addRule(
          (function (e) {
            const t = [];
            for (let n = 1, i = e.length; n < i; n++) {
              const i = e[n];
              t[n] = `.mtk${n} { color: ${i}; }`;
            }
            return (
              t.push(".mtki { font-style: italic; }"),
              t.push(".mtkb { font-weight: bold; }"),
              t.push(".mtku { text-decoration: underline; text-underline-position: under; }"),
              t.push(".mtks { text-decoration: line-through; }"),
              t.push(
                ".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }",
              ),
              t.join("\n")
            );
          })(r),
        ),
          n.addRule(
            ".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }",
          ),
          (this._themeCSS = e.join("\n")),
          this._updateCSS(),
          I2.setColorMap(r),
          this._onColorThemeChange.fire(this._theme));
      }
      _updateCSS() {
        ((this._allCSS = `${this._codiconCSS}\n${this._themeCSS}`),
          this._styleElements.forEach((e) => (e.textContent = this._allCSS)));
      }
      getFileIconTheme() {
        return { hasFileIcons: !1, hasFolderIcons: !1, hidesExplorerArrows: !1 };
      }
      getProductIconTheme() {
        return this._builtInProductIconTheme;
      }
    },
    0,
  ),
  HU(wV, dUe, 0),
  HU(Aq, nUe, 0),
  HU(xW, Q$e, 0),
  HU(
    Ine,
    class {
      withProgress(e, t, n) {
        return t({ report: () => {} });
      }
    },
    0,
  ),
  HU(One, fqe, 0),
  HU(
    oue,
    class extends aue {
      constructor() {
        (super(),
          (this.applicationStorage = this._register(
            new nue(new iue(), { hint: eue.STORAGE_IN_MEMORY }),
          )),
          (this.profileStorage = this._register(
            new nue(new iue(), { hint: eue.STORAGE_IN_MEMORY }),
          )),
          (this.workspaceStorage = this._register(
            new nue(new iue(), { hint: eue.STORAGE_IN_MEMORY }),
          )),
          this._register(
            this.workspaceStorage.onDidChangeStorage((e) => this.emitDidChangeValue(1, e)),
          ),
          this._register(
            this.profileStorage.onDidChangeStorage((e) => this.emitDidChangeValue(0, e)),
          ),
          this._register(
            this.applicationStorage.onDidChangeStorage((e) => this.emitDidChangeValue(-1, e)),
          ));
      }
      getStorage(e) {
        switch (e) {
          case -1:
            return this.applicationStorage;
          case 0:
            return this.profileStorage;
          default:
            return this.workspaceStorage;
        }
      }
      shouldFlushWhenIdle() {
        return !1;
      }
    },
    0,
  ),
  HU(Dce, Tqe, 0),
  HU(ige, Eqe, 0),
  HU(
    ije,
    class {
      constructor() {
        ((this._neverEmitter = new QO()), (this.onDidChangeTrust = this._neverEmitter.event));
      }
      isWorkspaceTrusted() {
        return !0;
      }
    },
    0,
  ),
  HU(CV, pqe, 0),
  HU(KK, F$e, 0),
  HU(
    Pwe,
    class {
      get lastFocusedList() {
        return this._lastFocusedWidget;
      }
      constructor() {
        ((this.disposables = new AO()), (this.lists = []), (this._lastFocusedWidget = void 0));
      }
      setLastFocusedList(e) {
        e !== this._lastFocusedWidget &&
          (this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"),
          (this._lastFocusedWidget = e),
          this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"));
      }
      register(e, t) {
        if (this.lists.some((t) => t.widget === e))
          throw new Error("Cannot register the same widget multiple times");
        const n = { widget: e, extraContextKeys: t };
        return (
          this.lists.push(n),
          bB(e.getHTMLElement()) && this.setLastFocusedList(e),
          RO(
            e.onDidFocus(() => this.setLastFocusedList(e)),
            MO(() => this.lists.splice(this.lists.indexOf(n), 1)),
            e.onDidDispose(() => {
              ((this.lists = this.lists.filter((e) => e !== n)),
                this._lastFocusedWidget === e && this.setLastFocusedList(void 0));
            }),
          )
        );
      }
      dispose() {
        this.disposables.dispose();
      }
    },
    0,
  ),
  HU(PV, _qe, 0),
  HU(N5, vqe, 0),
  HU(Ghe, M$e, 0),
  HU(lde, Nqe, 0),
  HU(mge, eUe, 0),
  HU(ade, H$e, 0),
  HU(cde, Lqe, 0),
  HU(AW, Fue, 0),
  HU(
    kne,
    class {
      async playSignal(e, t) {}
    },
    0,
  ),
  HU(
    S7,
    class {
      getParserClass() {
        throw new Error("not implemented in StandaloneTreeSitterLibraryService");
      }
      supportsLanguage(e, t) {
        return !1;
      }
      getLanguage(e, t, n) {}
      getInjectionQueries(e, t) {
        return null;
      }
      getHighlightingQueries(e, t) {
        return null;
      }
    },
    0,
  ),
  HU(
    xH,
    class extends LH {
      constructor() {
        super(wH.Off, mP.parse("log:///log"));
      }
      doCreateLogger(e, t, n) {
        return new DH();
      }
    },
    0,
  ),
  HU(
    PLe,
    class {
      getDataChannel(e) {
        return { sendData: () => {} };
      }
    },
    0,
  ),
  (function (e) {
    const t = new rne();
    for (const [s, a] of zU()) t.set(s, a);
    const n = new iqe(t, !0);
    (t.set(vV, n),
      (e.get = function (e) {
        i || o({});
        const r = t.get(e);
        if (!r) throw new Error("Missing service " + e);
        return r instanceof VU ? n.invokeFunction((t) => t.get(e)) : r;
      }));
    let i = !1;
    const r = new QO();
    function o(e) {
      if (i) return n;
      i = !0;
      for (const [n, i] of zU()) t.get(n) || t.set(n, i);
      for (const n in e)
        if (e.hasOwnProperty(n)) {
          const i = bV(n);
          t.get(i) instanceof VU && t.set(i, e[n]);
        }
      const o = wme();
      for (const t of o)
        try {
          n.createInstance(t);
        } catch (s) {
          HI(s);
        }
      return (r.fire(), n);
    }
    ((e.initialize = o),
      (e.withServices = function (e) {
        if (i) return e();
        const t = new AO(),
          n = t.add(
            r.event(() => {
              (n.dispose(), t.add(e()));
            }),
          );
        return t;
      }));
  })(Iqe || (Iqe = {})));
var Rqe,
  Oqe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let Mqe = class {
  static {
    Rqe = this;
  }
  static {
    this._ttpTokenizer = ZJ("tokenizeToString", { createHTML: (e) => e });
  }
  constructor(e, t) {
    ((this._configurationService = e), (this._languageService = t));
  }
  async renderCodeBlock(e, t, n) {
    const i = wye(n.context) ? n.context : void 0;
    let r;
    (e
      ? (r = this._languageService.getLanguageIdByLanguageName(e))
      : i && (r = i.getModel()?.getLanguageId()),
      r || (r = a$));
    const o = await (async function (e, t, n) {
        if (!n) return xte(t, e.languageIdCodec, bte);
        const i = await I2.getOrCreate(n);
        return xte(t, e.languageIdCodec, i || bte);
      })(this._languageService, t, r),
      s = Rqe._ttpTokenizer ? (Rqe._ttpTokenizer.createHTML(o) ?? o) : o,
      a = document.createElement("span");
    a.innerHTML = s;
    const l = a.querySelector(".monaco-tokenized-source");
    return SB(l) ? (Vq(l, this.getFontInfo(i)), a) : document.createElement("span");
  }
  getFontInfo(e) {
    return e
      ? e.getOption(59)
      : (function (e, t, n = !1) {
          const i = BK.fontFamily.validate(e.fontFamily),
            r = BK.fontWeight.validate(e.fontWeight),
            o = BK.fontSize.validate(e.fontSize),
            s = BK.fontLigatures2.validate(e.fontLigatures),
            a = BK.fontVariations.validate(e.fontVariations),
            l = BK.lineHeight.validate(e.lineHeight),
            c = BK.letterSpacing.validate(e.letterSpacing);
          return Zq._create(i, r, o, s, a, l, c, t, n);
        })({ fontFamily: this._configurationService.getValue("editor").fontFamily }, 1);
  }
};
Mqe = Rqe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Oqe(0, OU), Oqe(1, BU)], Mqe);
var Aqe = function (e, t, n, i) {
    var r,
      o = arguments.length,
      s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
      s = Reflect.decorate(e, t, n, i);
    else
      for (var a = e.length - 1; a >= 0; a--)
        (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
    return (o > 3 && s && Object.defineProperty(t, n, s), s);
  },
  Pqe = function (e, t) {
    return function (n, i) {
      t(n, i, e);
    };
  };
let jqe = 0,
  Fqe = !1;
function Bqe(e) {
  if (!e) {
    if (Fqe) return;
    Fqe = !0;
  }
  !(function (e) {
    ((cV = document.createElement("div")), (cV.className = "monaco-aria-container"));
    const t = () => {
      const e = document.createElement("div");
      return (
        (e.className = "monaco-alert"),
        e.setAttribute("role", "alert"),
        e.setAttribute("aria-atomic", "true"),
        cV.appendChild(e),
        e
      );
    };
    ((dV = t()), (uV = t()));
    const n = () => {
      const e = document.createElement("div");
      return (
        (e.className = "monaco-status"),
        e.setAttribute("aria-live", "polite"),
        e.setAttribute("aria-atomic", "true"),
        cV.appendChild(e),
        e
      );
    };
    ((hV = n()), (gV = n()), e.appendChild(cV));
  })(e || NI.document.body);
}
let Vqe = class extends ane {
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h, g) {
    const p = { ...t };
    ((p.ariaLabel = p.ariaLabel || LFe.editorViewAccessibleLabel),
      super(e, p, {}, n, i, r, o, l, c, d, u, h),
      (this._standaloneKeybindingService = a instanceof vqe ? a : null),
      Bqe(p.ariaContainerElement),
      (Pne = (e, t) => n.createInstance(Que, e, { instantHover: t }, {})),
      (bae = s),
      g.setDefaultCodeBlockRenderer(n.createInstance(Mqe)));
  }
  addCommand(e, t, n) {
    if (!this._standaloneKeybindingService) return null;
    const i = "DYNAMIC_" + ++jqe,
      r = eW.deserialize(n);
    return (this._standaloneKeybindingService.addDynamicKeybinding(i, e, t, r), i);
  }
  createContextKey(e, t) {
    return this._contextKeyService.createKey(e, t);
  }
  addAction(e) {
    if ("string" != typeof e.id || "string" != typeof e.label || "function" != typeof e.run)
      throw new Error(
        "Invalid action descriptor, `id`, `label` and `run` are required properties!",
      );
    if (!this._standaloneKeybindingService) return PO.None;
    const t = e.id,
      n = e.label,
      i = eW.and(eW.equals("editorId", this.getId()), eW.deserialize(e.precondition)),
      r = e.keybindings,
      o = eW.and(i, eW.deserialize(e.keybindingContext)),
      s = e.contextMenuGroupId || null,
      a = e.contextMenuOrder || 0,
      l = (t, ...n) => Promise.resolve(e.run(this, ...n)),
      c = new AO(),
      d = this.getId() + ":" + t;
    if ((c.add(jV.registerCommand(d, l)), s)) {
      const e = { command: { id: d, title: n }, when: i, group: s, order: a };
      c.add(jW.appendMenuItem(MW.EditorContext, e));
    }
    if (Array.isArray(r))
      for (const h of r) c.add(this._standaloneKeybindingService.addDynamicKeybinding(d, h, l, o));
    const u = new Y3(
      d,
      n,
      n,
      void 0,
      i,
      (...t) => Promise.resolve(e.run(this, ...t)),
      this._contextKeyService,
    );
    return (
      this._actions.set(t, u),
      c.add(
        MO(() => {
          this._actions.delete(t);
        }),
      ),
      c
    );
  }
  _triggerCommand(e, t) {
    if (this._codeEditorService instanceof _He)
      try {
        (this._codeEditorService.setActiveCodeEditor(this), super._triggerCommand(e, t));
      } finally {
        this._codeEditorService.setActiveCodeEditor(null);
      }
    else super._triggerCommand(e, t);
  }
};
Vqe = Aqe(
  [
    Pqe(2, vV),
    Pqe(3, yV),
    Pqe(4, PV),
    Pqe(5, xW),
    Pqe(6, Xue),
    Pqe(7, N5),
    Pqe(8, h0),
    Pqe(9, Y4),
    Pqe(10, KK),
    Pqe(11, f$),
    Pqe(12, mee),
    Pqe(13, _ge),
  ],
  Vqe,
);
let Wqe = class extends Vqe {
  constructor(e, t, n, i, r, o, s, a, l, c, d, u, h, g, p, f, m) {
    const _ = { ...t };
    kqe(d, _, !1);
    const v = l.registerEditorContainer(e);
    ("string" == typeof _.theme && l.setTheme(_.theme),
      void 0 !== _.autoDetectHighContrast &&
        l.setAutoDetectHighContrast(Boolean(_.autoDetectHighContrast)));
    const b = _.model;
    let y;
    if (
      (delete _.model,
      super(e, _, n, i, r, o, s, a, l, c, u, p, f, m),
      (this._configurationService = d),
      (this._standaloneThemeService = l),
      this._register(v),
      void 0 === b)
    ) {
      const e = g.getLanguageIdByMimeType(_.language) || _.language || a$;
      ((y = zqe(h, g, _.value || "", e, void 0)), (this._ownsModel = !0));
    } else ((y = b), (this._ownsModel = !1));
    if ((this._attachModel(y), y)) {
      const e = { oldModelUrl: null, newModelUrl: y.uri };
      this._onDidChangeModel.fire(e);
    }
  }
  dispose() {
    super.dispose();
  }
  updateOptions(e) {
    (kqe(this._configurationService, e, !1),
      "string" == typeof e.theme && this._standaloneThemeService.setTheme(e.theme),
      void 0 !== e.autoDetectHighContrast &&
        this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),
      super.updateOptions(e));
  }
  _postDetachModelCleanup(e) {
    (super._postDetachModelCleanup(e),
      e && this._ownsModel && (e.dispose(), (this._ownsModel = !1)));
  }
};
Wqe = Aqe(
  [
    Pqe(2, vV),
    Pqe(3, yV),
    Pqe(4, PV),
    Pqe(5, xW),
    Pqe(6, Xue),
    Pqe(7, N5),
    Pqe(8, OFe),
    Pqe(9, Y4),
    Pqe(10, OU),
    Pqe(11, KK),
    Pqe(12, wV),
    Pqe(13, BU),
    Pqe(14, f$),
    Pqe(15, mee),
    Pqe(16, _ge),
  ],
  Wqe,
);
let Hqe = class extends vhe {
  constructor(e, t, n, i, r, o, s, a, l, c, d, u) {
    const h = { ...t };
    kqe(a, h, !0);
    const g = o.registerEditorContainer(e);
    ("string" == typeof h.theme && o.setTheme(h.theme),
      void 0 !== h.autoDetectHighContrast &&
        o.setAutoDetectHighContrast(Boolean(h.autoDetectHighContrast)),
      super(e, h, {}, i, n, r, u, c),
      (this._configurationService = a),
      (this._standaloneThemeService = o),
      this._register(g));
  }
  dispose() {
    super.dispose();
  }
  updateOptions(e) {
    (kqe(this._configurationService, e, !0),
      "string" == typeof e.theme && this._standaloneThemeService.setTheme(e.theme),
      void 0 !== e.autoDetectHighContrast &&
        this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),
      super.updateOptions(e));
  }
  _createInnerEditor(e, t, n) {
    return e.createInstance(Vqe, t, n);
  }
  getOriginalEditor() {
    return super.getOriginalEditor();
  }
  getModifiedEditor() {
    return super.getModifiedEditor();
  }
  addCommand(e, t, n) {
    return this.getModifiedEditor().addCommand(e, t, n);
  }
  createContextKey(e, t) {
    return this.getModifiedEditor().createContextKey(e, t);
  }
  addAction(e) {
    return this.getModifiedEditor().addAction(e);
  }
};
function zqe(e, t, n, i, r) {
  if (((n = n || ""), !i)) {
    const i = n.indexOf("\n");
    let o = n;
    return (
      -1 !== i && (o = n.substring(0, i)),
      Uqe(e, n, t.createByFilepathOrFirstLine(r || null, o), r)
    );
  }
  return Uqe(e, n, t.createById(i), r);
}
function Uqe(e, t, n, i) {
  return e.createModel(t, n, i);
}
((Hqe = Aqe(
  [
    Pqe(2, vV),
    Pqe(3, xW),
    Pqe(4, yV),
    Pqe(5, OFe),
    Pqe(6, Y4),
    Pqe(7, OU),
    Pqe(8, cde),
    Pqe(9, One),
    Pqe(10, ade),
    Pqe(11, kne),
  ],
  Hqe,
)),
  SG(
    "multiDiffEditor.headerBackground",
    {
      dark: "#262626",
      light: "tab.inactiveBackground",
      hcDark: "tab.inactiveBackground",
      hcLight: "tab.inactiveBackground",
    },
    SI(142, "The background color of the diff editor's header"),
  ),
  SG(
    "multiDiffEditor.background",
    GG,
    SI(143, "The background color of the multi file diff editor"),
  ),
  SG(
    "multiDiffEditor.border",
    {
      dark: "sideBarSectionHeader.border",
      light: "#cccccc",
      hcDark: "sideBarSectionHeader.border",
      hcLight: "#cccccc",
    },
    SI(144, "The border color of the multi file diff editor"),
  ));
var $qe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
class qqe {
  constructor(e, t) {
    ((this.viewModel = e), (this.deltaScrollVertical = t));
  }
  getId() {
    return this.viewModel;
  }
}
let Kqe = class extends PO {
  constructor(e, t, n, i, r) {
    (super(),
      (this._container = e),
      (this._overflowWidgetsDomNode = t),
      (this._workbenchUIElementFactory = n),
      (this._instantiationService = i),
      (this._viewModel = LF(this, void 0)),
      (this._collapsed = Xj(this, (e) => this._viewModel.read(e)?.collapsed.read(e))),
      (this._editorContentHeight = LF(this, 500)),
      (this.contentHeight = Xj(
        this,
        (e) =>
          (this._collapsed.read(e) ? 0 : this._editorContentHeight.read(e)) +
          this._outerEditorHeight,
      )),
      (this._modifiedContentWidth = LF(this, 0)),
      (this._modifiedWidth = LF(this, 0)),
      (this._originalContentWidth = LF(this, 0)),
      (this._originalWidth = LF(this, 0)),
      (this.maxScroll = Xj(this, (e) => {
        const t = this._modifiedContentWidth.read(e) - this._modifiedWidth.read(e),
          n = this._originalContentWidth.read(e) - this._originalWidth.read(e);
        return t > n
          ? { maxScroll: t, width: this._modifiedWidth.read(e) }
          : { maxScroll: n, width: this._originalWidth.read(e) };
      })),
      (this._elements = GB("div.multiDiffEntry", [
        GB("div.header@header", [
          GB("div.header-content", [
            GB("div.collapse-button@collapseButton"),
            GB("div.file-path", [
              GB("div.title.modified.show-file-icons@primaryPath", []),
              GB("div.status.deleted@status", ["R"]),
              GB("div.title.original.show-file-icons@secondaryPath", []),
            ]),
            GB("div.actions@actions"),
          ]),
        ]),
        GB("div.editorParent", [GB("div.editorContainer@editor")]),
      ])),
      (this.editor = this._register(
        this._instantiationService.createInstance(
          vhe,
          this._elements.editor,
          { overflowWidgetsDomNode: this._overflowWidgetsDomNode, fixedOverflowWidgets: !0 },
          {},
        ),
      )),
      (this.isModifedFocused = xde(this.editor.getModifiedEditor()).isFocused),
      (this.isOriginalFocused = xde(this.editor.getOriginalEditor()).isFocused),
      (this.isFocused = Xj(
        this,
        (e) => this.isModifedFocused.read(e) || this.isOriginalFocused.read(e),
      )),
      (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 AO())),
      (this._headerHeight = 40),
      (this._lastScrollTop = -1),
      (this._isSettingScrollTop = !1));
    const o = new upe(this._elements.collapseButton, {});
    (this._register(
      rF((e) => {
        ((o.element.className = ""),
          (o.icon = this._collapsed.read(e) ? OV.chevronRight : OV.chevronDown));
      }),
    ),
      this._register(
        o.onDidClick(() => {
          this._viewModel.get()?.collapsed.set(!this._collapsed.get(), void 0);
        }),
      ),
      this._register(
        rF((e) => {
          this._elements.editor.style.display = this._collapsed.read(e) ? "none" : "block";
        }),
      ),
      this._register(
        this.editor.getModifiedEditor().onDidLayoutChange((e) => {
          const t = this.editor.getModifiedEditor().getLayoutInfo().contentWidth;
          this._modifiedWidth.set(t, void 0);
        }),
      ),
      this._register(
        this.editor.getOriginalEditor().onDidLayoutChange((e) => {
          const t = this.editor.getOriginalEditor().getLayoutInfo().contentWidth;
          this._originalWidth.set(t, void 0);
        }),
      ),
      this._register(
        this.editor.onDidContentSizeChange((e) => {
          dF((t) => {
            (this._editorContentHeight.set(e.contentHeight, t),
              this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(), t),
              this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(), t));
          });
        }),
      ),
      this._register(
        this.editor.getOriginalEditor().onDidScrollChange((e) => {
          if (this._isSettingScrollTop) return;
          if (!e.scrollTopChanged || !this._data) return;
          const t = e.scrollTop - this._lastScrollTop;
          this._data.deltaScrollVertical(t);
        }),
      ),
      this._register(
        rF((e) => {
          const t = this._viewModel.read(e)?.isActive.read(e);
          this._elements.root.classList.toggle("active", t);
        }),
      ),
      this._container.appendChild(this._elements.root),
      (this._outerEditorHeight = this._headerHeight),
      (this._contextKeyService = this._register(r.createScoped(this._elements.actions))));
    const s = this._register(
      this._instantiationService.createChild(new rne([xW, this._contextKeyService])),
    );
    this._register(
      s.createInstance(Zue, this._elements.actions, MW.MultiDiffEditorFileToolbar, {
        actionRunner: this._register(
          new the(() => this._viewModel.get()?.modifiedUri ?? this._viewModel.get()?.originalUri),
        ),
        menuOptions: { shouldForwardArgs: !0 },
        toolbarOptions: { primaryGroup: (e) => e.startsWith("navigation") },
        actionViewItemProvider: (e, t) => Oue(s, e, t),
      }),
    );
  }
  setScrollLeft(e) {
    this._modifiedContentWidth.get() - this._modifiedWidth.get() >
    this._originalContentWidth.get() - this._originalWidth.get()
      ? this.editor.getModifiedEditor().setScrollLeft(e)
      : this.editor.getOriginalEditor().setScrollLeft(e);
  }
  setData(e) {
    function t(e) {
      return {
        ...e,
        scrollBeyondLastLine: !1,
        hideUnchangedRegions: { enabled: !0 },
        scrollbar: {
          vertical: "hidden",
          horizontal: "hidden",
          handleMouseWheel: !1,
          useShadows: !1,
        },
        renderOverviewRuler: !1,
        fixedOverflowWidgets: !0,
        overviewRulerBorder: !1,
      };
    }
    if (((this._data = e), !e))
      return void dF((e) => {
        (this._viewModel.set(void 0, e),
          this.editor.setDiffModel(null, e),
          this._dataStore.clear());
      });
    const n = e.viewModel.documentDiffItem;
    if (
      (dF((i) => {
        this._resourceLabel?.setUri(e.viewModel.modifiedUri ?? e.viewModel.originalUri, {
          strikethrough: void 0 === e.viewModel.modifiedUri,
        });
        let r = !1,
          o = !1,
          s = !1,
          a = "";
        (e.viewModel.modifiedUri &&
        e.viewModel.originalUri &&
        e.viewModel.modifiedUri.path !== e.viewModel.originalUri.path
          ? ((a = "R"), (r = !0))
          : e.viewModel.modifiedUri
            ? e.viewModel.originalUri || ((a = "A"), (s = !0))
            : ((a = "D"), (o = !0)),
          this._elements.status.classList.toggle("renamed", r),
          this._elements.status.classList.toggle("deleted", o),
          this._elements.status.classList.toggle("added", s),
          (this._elements.status.innerText = a),
          this._resourceLabel2?.setUri(r ? e.viewModel.originalUri : void 0, { strikethrough: !0 }),
          this._dataStore.clear(),
          this._viewModel.set(e.viewModel, i),
          this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef, i),
          this.editor.updateOptions(t(n.options ?? {})));
      }),
      n.onOptionsDidChange &&
        this._dataStore.add(
          n.onOptionsDidChange(() => {
            this.editor.updateOptions(t(n.options ?? {}));
          }),
        ),
      e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore, (e) => {
        e || this.setData(void 0);
      }),
      e.viewModel.documentDiffItem.contextKeys)
    )
      for (const [i, r] of Object.entries(e.viewModel.documentDiffItem.contextKeys))
        this._contextKeyService.createKey(i, r);
  }
  render(e, t, n, i) {
    ((this._elements.root.style.visibility = "visible"),
      (this._elements.root.style.top = `${e.start}px`),
      (this._elements.root.style.height = `${e.length}px`),
      (this._elements.root.style.width = `${t}px`),
      (this._elements.root.style.position = "absolute"));
    const r = e.length - this._headerHeight,
      o = Math.max(0, Math.min(i.start - e.start, r));
    ((this._elements.header.style.transform = `translateY(${o}px)`),
      dF((n) => {
        this.editor.layout({ width: t - 16 - 2, height: e.length - this._outerEditorHeight });
      }));
    try {
      ((this._isSettingScrollTop = !0),
        (this._lastScrollTop = n),
        this.editor.getOriginalEditor().setScrollTop(n));
    } finally {
      this._isSettingScrollTop = !1;
    }
    (this._elements.header.classList.toggle("shadow", o > 0 || n > 0),
      this._elements.header.classList.toggle("collapsed", o === r));
  }
  hide() {
    ((this._elements.root.style.top = "-100000px"),
      (this._elements.root.style.visibility = "hidden"));
  }
};
Kqe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([$qe(3, vV), $qe(4, xW)], Kqe);
class Gqe {
  constructor(e) {
    ((this._create = e),
      (this._unused = new Set()),
      (this._used = new Set()),
      (this._itemData = new Map()));
  }
  getUnusedObj(e) {
    let t;
    if (0 === this._unused.size) ((t = this._create(e)), this._itemData.set(t, e));
    else {
      const n = [...this._unused.values()];
      ((t = n.find((t) => this._itemData.get(t).getId() === e.getId()) ?? n[0]),
        this._unused.delete(t),
        this._itemData.set(t, e),
        t.setData(e));
    }
    return (
      this._used.add(t),
      {
        object: t,
        dispose: () => {
          (this._used.delete(t), this._unused.size > 5 ? t.dispose() : this._unused.add(t));
        },
      }
    );
  }
  dispose() {
    for (const e of this._used) e.dispose();
    for (const e of this._unused) e.dispose();
    (this._used.clear(), this._unused.clear());
  }
}
var Zqe = function (e, t) {
  return function (n, i) {
    t(n, i, e);
  };
};
let Yqe = class extends PO {
  constructor(e, t, n, i, r, o) {
    (super(),
      (this._element = e),
      (this._dimension = t),
      (this._viewModel = n),
      (this._workbenchUIElementFactory = i),
      (this._parentContextKeyService = r),
      (this._parentInstantiationService = o),
      (this._scrollableElements = GB("div.scrollContent", [
        GB("div@content", { style: { overflow: "hidden" } }),
        GB("div.monaco-editor@overflowWidgetsDomNode", {}),
      ])),
      (this._scrollable = this._register(
        new gJ({
          forceIntegerValues: !1,
          scheduleAtNextAnimationFrame: (e) => JF(MF(this._element), e),
          smoothScrollDuration: 100,
        }),
      )),
      (this._scrollableElement = this._register(
        new xJ(
          this._scrollableElements.root,
          { vertical: 1, horizontal: 1, useShadows: !1 },
          this._scrollable,
        ),
      )),
      (this._elements = GB("div.monaco-component.multiDiffEditor", {}, [
        GB("div", {}, [this._scrollableElement.getDomNode()]),
        GB("div.placeholder@placeholder", {}, [GB("div")]),
      ])),
      (this._sizeObserver = this._register(new Ele(this._element, void 0))),
      (this._objectPool = this._register(
        new Gqe((e) => {
          const t = this._instantiationService.createInstance(
            Kqe,
            this._scrollableElements.content,
            this._scrollableElements.overflowWidgetsDomNode,
            this._workbenchUIElementFactory,
          );
          return (t.setData(e), t);
        }),
      )),
      (this.scrollTop = gF(
        this,
        this._scrollableElement.onScroll,
        () => this._scrollableElement.getScrollPosition().scrollTop,
      )),
      (this.scrollLeft = gF(
        this,
        this._scrollableElement.onScroll,
        () => this._scrollableElement.getScrollPosition().scrollLeft,
      )),
      (this._viewItemsInfo = Xj(this, (e) => {
        const t = this._viewModel.read(e);
        if (!t)
          return {
            items: [],
            getItem: (e) => {
              throw new QI();
            },
          };
        const n = t.items.read(e),
          i = new Map(),
          r = n.map((t) => {
            const n = e.store.add(
                new Xqe(t, this._objectPool, this.scrollLeft, (e) => {
                  this._scrollableElement.setScrollPosition({
                    scrollTop: this._scrollableElement.getScrollPosition().scrollTop + e,
                  });
                }),
              ),
              r = this._lastDocStates?.[n.getKey()];
            return (
              r &&
                cF((e) => {
                  n.setViewState(r, e);
                }),
              i.set(t, n),
              n
            );
          });
        return { items: r, getItem: (e) => i.get(e) };
      })),
      (this._viewItems = this._viewItemsInfo.map(this, (e) => e.items)),
      (this._spaceBetweenPx = 0),
      (this._totalHeight = this._viewItems.map(this, (e, t) =>
        e.reduce((e, n) => e + n.contentHeight.read(t) + this._spaceBetweenPx, 0),
      )),
      (this.activeControl = Xj(this, (e) => {
        const t = this._viewModel.read(e)?.activeDiffItem.read(e);
        if (!t) return;
        const n = this._viewItemsInfo.read(e).getItem(t);
        return n.template.read(e)?.editor;
      })),
      (this._contextKeyService = this._register(
        this._parentContextKeyService.createScoped(this._element),
      )),
      (this._instantiationService = this._register(
        this._parentInstantiationService.createChild(new rne([xW, this._contextKeyService])),
      )),
      this._contextKeyService.createKey($$.inMultiDiffEditor.key, !0),
      (this._lastDocStates = {}),
      this._register(
        aF((e, t) => {
          const n = this._viewModel.read(e);
          if (n && n.contextKeys)
            for (const [i, r] of Object.entries(n.contextKeys)) {
              const e = this._contextKeyService.createKey(i, void 0);
              (e.set(r), t.add(MO(() => e.reset())));
            }
        }),
      ));
    const s = this._parentContextKeyService.createKey($$.multiDiffEditorAllCollapsed.key, !1);
    (this._register(
      rF((e) => {
        const t = this._viewModel.read(e);
        if (t) {
          const n = t.items.read(e).every((t) => t.collapsed.read(e));
          s.set(n);
        }
      }),
    ),
      this._register(
        rF((e) => {
          const t = this._dimension.read(e);
          this._sizeObserver.observe(t);
        }),
      ));
    const a = Xj((e) => {
      if (this._viewItems.read(e).length > 0) return;
      const t = this._viewModel.read(e);
      return !t || t.isLoading.read(e) ? SI(145, "Loading...") : SI(146, "No Changed Files");
    });
    (this._register(
      rF((e) => {
        const t = a.read(e);
        ((this._elements.placeholder.innerText = t ?? ""),
          this._elements.placeholder.classList.toggle("visible", !!t));
      }),
    ),
      (this._scrollableElements.content.style.position = "relative"),
      this._register(
        rF((e) => {
          const t = this._sizeObserver.height.read(e);
          this._scrollableElements.root.style.height = `${t}px`;
          const n = this._totalHeight.read(e);
          this._scrollableElements.content.style.height = `${n}px`;
          const i = this._sizeObserver.width.read(e);
          let r = i;
          const o = j1(
            this._viewItems.read(e),
            bj((t) => t.maxScroll.read(e).maxScroll, yj),
          );
          if (o) {
            r = i + o.maxScroll.read(e).maxScroll;
          }
          this._scrollableElement.setScrollDimensions({
            width: i,
            height: t,
            scrollHeight: n,
            scrollWidth: r,
          });
        }),
      ),
      e.replaceChildren(this._elements.root),
      this._register(
        MO(() => {
          e.replaceChildren();
        }),
      ),
      this._register(
        rF((e) => {
          const t = this._viewModel.read(e);
          if (t && !t.isLoading.read(e)) {
            if (0 === t.items.read(e).length) return;
            if (t.activeDiffItem.read(e)) return;
            this.goToNextChange();
          }
        }),
      ),
      this._register(
        this._register(
          rF((e) => {
            dF((t) => {
              this.render(e);
            });
          }),
        ),
      ));
  }
  reveal(e, t) {
    const n = this._viewItems.get(),
      i = n.findIndex(
        (t) =>
          t.viewModel.originalUri?.toString() === e.original?.toString() &&
          t.viewModel.modifiedUri?.toString() === e.modified?.toString(),
      );
    if (-1 === i) throw new QI("Resource not found in diff editor");
    const r = n[i];
    this._viewModel.get().activeDiffItem.setCache(r.viewModel, void 0);
    let o = 0;
    for (let l = 0; l < i; l++) o += n[l].contentHeight.get() + this._spaceBetweenPx;
    this._scrollableElement.setScrollPosition({ scrollTop: o });
    const s = r.template.get()?.editor,
      a = "original" in e ? s?.getOriginalEditor() : s?.getModifiedEditor();
    a &&
      t?.range &&
      (a.revealRangeInCenter(t.range),
      (function (e, t) {
        const n = e.getModel(),
          i = e.createDecorationsCollection([
            {
              range: t,
              options: {
                description: "symbol-navigate-action-highlight",
                className: "symbolHighlight",
              },
            },
          ]);
        setTimeout(() => {
          e.getModel() === n && i.clear();
        }, 350);
      })(a, t.range));
  }
  goToNextChange() {
    this._navigateToChange("next");
  }
  _navigateToChange(e) {
    const t = this._viewItems.get();
    if (0 === t.length) return;
    const n = this._viewModel.get()?.activeDiffItem.get(),
      i = n ? t.findIndex((e) => e.viewModel === n) : -1;
    if (-1 === i) return void this._goToFile(0, "first");
    const r = t[i];
    r.viewModel.collapsed.get() && r.viewModel.collapsed.set(!1, void 0);
    const o = r.template.get()?.editor;
    if (o?.getDiffComputationResult()?.changes2?.length) {
      const t = o.getModifiedEditor().getPosition()?.lineNumber || 1,
        n = o.getDiffComputationResult().changes2,
        i =
          "next" === e
            ? n.some((e) => e.modified.startLineNumber > t)
            : n.some((e) => e.modified.endLineNumberExclusive <= t);
      if (i) return void o.goToDiff(e);
    }
    const s = (i + ("next" === e ? 1 : -1) + t.length) % t.length;
    this._goToFile(s, "next" === e ? "first" : "last");
  }
  _goToFile(e, t) {
    const n = this._viewItems.get()[e];
    (n.viewModel.collapsed.get() && n.viewModel.collapsed.set(!1, void 0),
      this.reveal({ original: n.viewModel.originalUri, modified: n.viewModel.modifiedUri }));
    const i = n.template.get()?.editor;
    if (i?.getDiffComputationResult()?.changes2?.length)
      if ("first" === t) i.revealFirstDiff();
      else {
        const e = i.getDiffComputationResult().changes2.at(-1),
          t = i.getModifiedEditor();
        (t.setPosition({ lineNumber: e.modified.startLineNumber, column: 1 }),
          t.revealLineInCenter(e.modified.startLineNumber));
      }
    i?.focus();
  }
  render(e) {
    const t = this.scrollTop.read(e);
    let n = 0,
      i = 0,
      r = 0;
    const o = this._sizeObserver.height.read(e),
      s = N$.ofStartAndLength(t, o),
      a = this._sizeObserver.width.read(e);
    for (const l of this._viewItems.read(e)) {
      const c = l.contentHeight.read(e),
        d = Math.min(c, o),
        u = N$.ofStartAndLength(i, d),
        h = N$.ofStartAndLength(r, c);
      if (h.isBefore(s)) ((n -= c - d), l.hide());
      else if (h.isAfter(s)) l.hide();
      else {
        const e = Math.max(0, Math.min(s.start - h.start, c - d));
        n -= e;
        const i = N$.ofStartAndLength(t + n, o);
        l.render(u, e, a, i);
      }
      ((i += d + this._spaceBetweenPx), (r += c + this._spaceBetweenPx));
    }
    this._scrollableElements.content.style.transform = `translateY(${-(t + n)}px)`;
  }
};
Yqe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})([Zqe(4, xW), Zqe(5, vV)], Yqe);
class Xqe extends PO {
  constructor(e, t, n, i) {
    (super(),
      (this.viewModel = e),
      (this._objectPool = t),
      (this._scrollLeft = n),
      (this._deltaScrollVertical = i),
      (this._templateRef = this._register(TF(this, void 0))),
      (this.contentHeight = Xj(
        this,
        (e) =>
          this._templateRef.read(e)?.object.contentHeight?.read(e) ??
          this.viewModel.lastTemplateData.read(e).contentHeight,
      )),
      (this.maxScroll = Xj(
        this,
        (e) =>
          this._templateRef.read(e)?.object.maxScroll.read(e) ?? { maxScroll: 0, scrollWidth: 0 },
      )),
      (this.template = Xj(this, (e) => this._templateRef.read(e)?.object)),
      (this._isHidden = LF(this, !1)),
      (this._isFocused = Xj(this, (e) => this.template.read(e)?.isFocused.read(e) ?? !1)),
      this.viewModel.setIsFocused(this._isFocused, void 0),
      this._register(
        rF((e) => {
          const t = this._scrollLeft.read(e);
          this._templateRef.read(e)?.object.setScrollLeft(t);
        }),
      ),
      this._register(
        rF((e) => {
          const t = this._templateRef.read(e);
          if (!t) return;
          if (!this._isHidden.read(e)) return;
          t.object.isFocused.read(e) || this._clear();
        }),
      ));
  }
  dispose() {
    (this._clear(), super.dispose());
  }
  toString() {
    return `VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`;
  }
  getKey() {
    return this.viewModel.getKey();
  }
  setViewState(e, t) {
    (this.viewModel.collapsed.set(e.collapsed, t), this._updateTemplateData(t));
    const n = this.viewModel.lastTemplateData.get(),
      i = e.selections?.map(XH.liftSelection);
    this.viewModel.lastTemplateData.set({ ...n, selections: i }, t);
    const r = this._templateRef.get();
    r && i && r.object.editor.setSelections(i);
  }
  _updateTemplateData(e) {
    const t = this._templateRef.get();
    t &&
      this.viewModel.lastTemplateData.set(
        {
          contentHeight: t.object.contentHeight.get(),
          selections: t.object.editor.getSelections() ?? void 0,
        },
        e,
      );
  }
  _clear() {
    const e = this._templateRef.get();
    e &&
      cF((t) => {
        (this._updateTemplateData(t), e.object.hide(), this._templateRef.set(void 0, t));
      });
  }
  hide() {
    this._isHidden.set(!0, void 0);
  }
  render(e, t, n, i) {
    this._isHidden.set(!1, void 0);
    let r = this._templateRef.get();
    if (!r) {
      ((r = this._objectPool.getUnusedObj(new qqe(this.viewModel, this._deltaScrollVertical))),
        this._templateRef.set(r, void 0));
      const e = this.viewModel.lastTemplateData.get().selections;
      e && r.object.editor.setSelections(e);
    }
    r.object.render(e, n, t, i);
  }
}
let Qqe = class extends PO {
  constructor(e, t, n) {
    (super(),
      (this._element = e),
      (this._workbenchUIElementFactory = t),
      (this._instantiationService = n),
      (this._dimension = LF(this, void 0)),
      (this._viewModel = LF(this, void 0)),
      (this._widgetImpl = Xj(this, (e) =>
        e.store.add(
          this._instantiationService.createInstance(
            Cne(Yqe),
            this._element,
            this._dimension,
            this._viewModel,
            this._workbenchUIElementFactory,
          ),
        ),
      )),
      this._register(_F(this._widgetImpl)));
  }
};
function Jqe(e, t, n) {
  return Iqe.initialize(n || {}).createInstance(Wqe, e, t);
}
function eKe(e) {
  return Iqe.get(yV).onCodeEditorAdd((t) => {
    e(t);
  });
}
function tKe(e) {
  return Iqe.get(yV).onDiffEditorAdd((t) => {
    e(t);
  });
}
function nKe() {
  return Iqe.get(yV).listCodeEditors();
}
function iKe() {
  return Iqe.get(yV).listDiffEditors();
}
function rKe(e, t, n) {
  return Iqe.initialize(n || {}).createInstance(Hqe, e, t);
}
function oKe(e, t) {
  const n = Iqe.initialize(t || {});
  return new Qqe(e, {}, n);
}
function sKe(e) {
  if ("string" != typeof e.id || "function" != typeof e.run)
    throw new Error("Invalid command descriptor, `id` and `run` are required properties!");
  return jV.registerCommand(e.id, e.run);
}
function aKe(e) {
  if ("string" != typeof e.id || "string" != typeof e.label || "function" != typeof e.run)
    throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");
  const t = eW.deserialize(e.precondition),
    n = new AO();
  if (
    (n.add(
      jV.registerCommand(e.id, (n, ...i) =>
        MH.runEditorCommand(n, i, t, (t, n, i) => Promise.resolve(e.run(n, ...i))),
      ),
    ),
    e.contextMenuGroupId)
  ) {
    const i = {
      command: { id: e.id, title: e.label },
      when: t,
      group: e.contextMenuGroupId,
      order: e.contextMenuOrder || 0,
    };
    n.add(jW.appendMenuItem(MW.EditorContext, i));
  }
  if (Array.isArray(e.keybindings)) {
    const i = Iqe.get(N5);
    if (i instanceof vqe) {
      const r = eW.and(t, eW.deserialize(e.keybindingContext));
      n.add(
        i.addDynamicKeybindings(
          e.keybindings.map((t) => ({ keybinding: t, command: e.id, when: r })),
        ),
      );
    } else;
  }
  return n;
}
function lKe(e) {
  return cKe([e]);
}
function cKe(e) {
  const t = Iqe.get(N5);
  return t instanceof vqe
    ? t.addDynamicKeybindings(
        e.map((e) => ({
          keybinding: e.keybinding,
          command: e.command,
          commandArgs: e.commandArgs,
          when: eW.deserialize(e.when),
        })),
      )
    : PO.None;
}
function dKe(e, t, n) {
  const i = Iqe.get(BU),
    r = i.getLanguageIdByMimeType(t) || t;
  return zqe(Iqe.get(wV), i, e, r, n);
}
function uKe(e, t) {
  const n = Iqe.get(BU),
    i = n.getLanguageIdByMimeType(t) || t || a$;
  e.setLanguage(n.createById(i));
}
function hKe(e, t, n) {
  if (e) {
    Iqe.get(Tfe).changeOne(t, e.uri, n);
  }
}
function gKe(e) {
  Iqe.get(Tfe).changeAll(e, []);
}
function pKe(e) {
  return Iqe.get(Tfe).read(e);
}
function fKe(e) {
  return Iqe.get(Tfe).onMarkerChanged(e);
}
function mKe(e) {
  return Iqe.get(wV).getModel(e);
}
function _Ke() {
  return Iqe.get(wV).getModels();
}
function vKe(e) {
  return Iqe.get(wV).onModelAdded(e);
}
function bKe(e) {
  return Iqe.get(wV).onModelRemoved(e);
}
function yKe(e) {
  return Iqe.get(wV).onModelLanguageChanged((t) => {
    e({ model: t.model, oldLanguage: t.oldLanguageId });
  });
}
function xKe(e) {
  return (function (e, t) {
    return new $We(e, t);
  })(Iqe.get(wV), e);
}
function wKe(e, t) {
  const n = Iqe.get(BU),
    i = Iqe.get(OFe);
  return gHe.colorizeElement(i, n, e, t).then(() => {
    i.registerEditorContainer(e);
  });
}
function CKe(e, t, n) {
  const i = Iqe.get(BU);
  return (Iqe.get(OFe).registerEditorContainer(NI.document.body), gHe.colorize(i, e, t, n));
}
function SKe(e, t, n = 4) {
  return (Iqe.get(OFe).registerEditorContainer(NI.document.body), gHe.colorizeModelLine(e, t, n));
}
function kKe(e, t) {
  I2.getOrCreate(t);
  const n = (function (e) {
      const t = I2.get(e);
      return t || { getInitialState: () => J9, tokenize: (t, n, i) => e7(e, i) };
    })(t),
    i = ZM(e),
    r = [];
  let o = n.getInitialState();
  for (let s = 0, a = i.length; s < a; s++) {
    const e = i[s],
      t = n.tokenize(e, !0, o);
    ((r[s] = t.tokens), (o = t.endState));
  }
  return r;
}
function EKe(e, t) {
  Iqe.get(OFe).defineTheme(e, t);
}
function NKe(e) {
  Iqe.get(OFe).setTheme(e);
}
function LKe() {
  WK.clearAllFontInfos();
}
function DKe(e, t) {
  return jV.registerCommand({ id: e, handler: t });
}
function TKe(e) {
  return Iqe.get(mge).registerOpener({
    open: async (t) => ("string" == typeof t && (t = mP.parse(t)), e.open(t)),
  });
}
function IKe(e) {
  return Iqe.get(yV).registerCodeEditorOpenHandler(async (t, n, i) => {
    if (!n) return null;
    const r = t.options?.selection;
    let o;
    return (
      r && "number" == typeof r.endLineNumber && "number" == typeof r.endColumn
        ? (o = r)
        : r && (o = { lineNumber: r.startLineNumber, column: r.startColumn }),
      (await e.openCodeEditor(n, t.resource, o)) ? n : null
    );
  });
}
function RKe(e, t) {
  return "boolean" == typeof e ? e : t;
}
function OKe(e, t) {
  return "string" == typeof e ? e : t;
}
function MKe(e, t = !1) {
  t &&
    (e = e.map(function (e) {
      return e.toLowerCase();
    }));
  const n = (function (e) {
    const t = {};
    for (const n of e) t[n] = !0;
    return t;
  })(e);
  return t
    ? function (e) {
        return void 0 !== n[e.toLowerCase()] && n.hasOwnProperty(e.toLowerCase());
      }
    : function (e) {
        return void 0 !== n[e] && n.hasOwnProperty(e);
      };
}
function AKe(e, t, n) {
  t = t.replace(/@@/g, "");
  let i,
    r = 0;
  do {
    ((i = !1),
      (t = t.replace(/@(\w+)/g, function (n, r) {
        i = !0;
        let o = "";
        if ("string" == typeof e[r]) o = e[r];
        else {
          if (!(e[r] && e[r] instanceof RegExp))
            throw void 0 === e[r]
              ? JWe(e, "language definition does not contain attribute '" + r + "', used at: " + t)
              : JWe(e, "attribute reference '" + r + "' must be a string, used at: " + t);
          o = e[r].source;
        }
        return ZWe(o) ? "" : "(?:" + o + ")";
      })),
      r++);
  } while (i && r < 5);
  t = t.replace(/\x01/g, "@");
  const o = (e.ignoreCase ? "i" : "") + (e.unicode ? "u" : "");
  if (n) {
    if (t.match(/\$[sS](\d\d?)/g)) {
      let n = null,
        i = null;
      return (r) => (
        (i && n === r) ||
          ((n = r),
          (i = new RegExp(
            (function (e, t, n) {
              let i = null;
              return t.replace(/\$[sS](\d\d?)/g, function (t, r) {
                return (
                  null === i && ((i = n.split(".")), i.unshift(n)),
                  !ZWe(r) && r < i.length ? zM(YWe(e, i[r])) : ""
                );
              });
            })(e, t, r),
            o,
          ))),
        i
      );
    }
  }
  return new RegExp(t, o);
}
function PKe(e, t, n, i) {
  let r = -1,
    o = n,
    s = n.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);
  s && (s[3] && ((r = parseInt(s[3])), s[2] && (r += 100)), (o = s[4]));
  let a,
    l = "~",
    c = o;
  if (
    (o && 0 !== o.length
      ? /^\w*$/.test(c)
        ? (l = "==")
        : ((s = o.match(/^(@|!@|~|!~|==|!=)(.*)$/)), s && ((l = s[1]), (c = s[2])))
      : ((l = "!="), (c = "")),
    ("~" !== l && "!~" !== l) || !/^(\w|\|)*$/.test(c))
  )
    if ("@" === l || "!@" === l) {
      const n = e[c];
      if (!n) throw JWe(e, "the @ match target '" + c + "' is not defined, in rule: " + t);
      if (
        !(function (e, t) {
          if (!t) return !1;
          if (!Array.isArray(t)) return !1;
          for (const n of t) if (!e(n)) return !1;
          return !0;
        })(function (e) {
          return "string" == typeof e;
        }, n)
      )
        throw JWe(e, "the @ match target '" + c + "' must be an array of strings, in rule: " + t);
      const i = MKe(n, e.ignoreCase);
      a = function (e) {
        return "@" === l ? i(e) : !i(e);
      };
    } else if ("~" === l || "!~" === l)
      if (c.indexOf("$") < 0) {
        const t = AKe(e, "^" + c + "$", !1);
        a = function (e) {
          return "~" === l ? t.test(e) : !t.test(e);
        };
      } else
        a = function (t, n, i, r) {
          return AKe(e, "^" + eHe(e, c, n, i, r) + "$", !1).test(t);
        };
    else if (c.indexOf("$") < 0) {
      const t = YWe(e, c);
      a = function (e) {
        return "==" === l ? e === t : e !== t;
      };
    } else {
      const t = YWe(e, c);
      a = function (n, i, r, o, s) {
        const a = eHe(e, t, i, r, o);
        return "==" === l ? n === a : n !== a;
      };
    }
  else {
    const t = MKe(c.split("|"), e.ignoreCase);
    a = function (e) {
      return "~" === l ? t(e) : !t(e);
    };
  }
  return -1 === r
    ? {
        name: n,
        value: i,
        test: function (e, t, n, i) {
          return a(e, e, t, n, i);
        },
      }
    : {
        name: n,
        value: i,
        test: function (e, t, n, i) {
          const o = (function (e, t, n, i) {
            if (i < 0) return e;
            if (i < t.length) return t[i];
            if (i >= 100) {
              i -= 100;
              const e = n.split(".");
              if ((e.unshift(n), i < e.length)) return e[i];
            }
            return null;
          })(e, t, n, r);
          return a(o || "", e, t, n, i);
        },
      };
}
function jKe(e, t, n) {
  if (n) {
    if ("string" == typeof n) return n;
    if (n.token || "" === n.token) {
      if ("string" != typeof n.token)
        throw JWe(e, "a 'token' attribute must be of type string, in rule: " + t);
      {
        const i = { token: n.token };
        if ((n.token.indexOf("$") >= 0 && (i.tokenSubst = !0), "string" == typeof n.bracket))
          if ("@open" === n.bracket) i.bracket = 1;
          else {
            if ("@close" !== n.bracket)
              throw JWe(
                e,
                "a 'bracket' attribute must be either '@open' or '@close', in rule: " + t,
              );
            i.bracket = -1;
          }
        if (n.next) {
          if ("string" != typeof n.next)
            throw JWe(e, "the next state must be a string value in rule: " + t);
          {
            let r = n.next;
            if (
              !/^(@pop|@push|@popall)$/.test(r) &&
              ("@" === r[0] && (r = r.substr(1)),
              r.indexOf("$") < 0 &&
                !(function (e, t) {
                  let n = t;
                  for (; n && n.length > 0; ) {
                    if (e.stateNames[n]) return !0;
                    const t = n.lastIndexOf(".");
                    n = t < 0 ? null : n.substr(0, t);
                  }
                  return !1;
                })(e, eHe(e, r, "", [], "")))
            )
              throw JWe(e, "the next state '" + n.next + "' is not defined in rule: " + t);
            i.next = r;
          }
        }
        return (
          "number" == typeof n.goBack && (i.goBack = n.goBack),
          "string" == typeof n.switchTo && (i.switchTo = n.switchTo),
          "string" == typeof n.log && (i.log = n.log),
          "string" == typeof n.nextEmbedded &&
            ((i.nextEmbedded = n.nextEmbedded), (e.usesEmbedded = !0)),
          i
        );
      }
    }
    if (Array.isArray(n)) {
      const i = [];
      for (let r = 0, o = n.length; r < o; r++) i[r] = jKe(e, t, n[r]);
      return { group: i };
    }
    if (n.cases) {
      const i = [];
      let r = !1;
      for (const s in n.cases)
        if (n.cases.hasOwnProperty(s)) {
          const o = jKe(e, t, n.cases[s]);
          ("@default" === s || "@" === s || "" === s
            ? i.push({ test: void 0, value: o, name: s })
            : "@eos" === s
              ? i.push({
                  test: function (e, t, n, i) {
                    return i;
                  },
                  value: o,
                  name: s,
                })
              : i.push(PKe(e, t, s, o)),
            r ||
              (r =
                !oR(o) &&
                (o.hasEmbeddedEndInCases || ["@pop", "@popall"].includes(o.nextEmbedded || ""))));
        }
      const o = e.defaultToken;
      return {
        hasEmbeddedEndInCases: r,
        test: function (e, t, n, r) {
          for (const o of i) {
            if (!o.test || o.test(e, t, n, r)) return o.value;
          }
          return o;
        },
      };
    }
    throw JWe(
      e,
      "an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: " +
        t,
    );
  }
  return { token: "" };
}
Qqe = (function (e, t, n, i) {
  var r,
    o = arguments.length,
    s = o < 3 ? t : null === i ? (i = Object.getOwnPropertyDescriptor(t, n)) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
    s = Reflect.decorate(e, t, n, i);
  else
    for (var a = e.length - 1; a >= 0; a--)
      (r = e[a]) && (s = (o < 3 ? r(s) : o > 3 ? r(t, n, s) : r(t, n)) || s);
  return (o > 3 && s && Object.defineProperty(t, n, s), s);
})(
  [
    (function (e, t) {
      return function (n, i) {
        t(n, i, e);
      };
    })(2, vV),
  ],
  Qqe,
);
class FKe {
  constructor(e) {
    ((this.regex = new RegExp("")),
      (this.action = { token: "" }),
      (this.matchOnlyAtLineStart = !1),
      (this.name = ""),
      (this.name = e));
  }
  setRegex(e, t) {
    let n;
    if ("string" == typeof t) n = t;
    else {
      if (!(t instanceof RegExp))
        throw JWe(e, "rules must start with a match string or regular expression: " + this.name);
      n = t.source;
    }
    ((this.matchOnlyAtLineStart = n.length > 0 && "^" === n[0]),
      (this.name = this.name + ": " + n),
      (this.regex = AKe(e, "^(?:" + (this.matchOnlyAtLineStart ? n.substr(1) : n) + ")", !0)));
  }
  setAction(e, t) {
    this.action = jKe(e, this.name, t);
  }
  resolveRegex(e) {
    return this.regex instanceof RegExp ? this.regex : this.regex(e);
  }
}
function BKe(e, t) {
  if (!t || "object" != typeof t)
    throw new Error("Monarch: expecting a language definition object");
  const n = {
      languageId: e,
      includeLF: RKe(t.includeLF, !1),
      noThrow: !1,
      maxStack: 100,
      start: "string" == typeof t.start ? t.start : null,
      ignoreCase: RKe(t.ignoreCase, !1),
      unicode: RKe(t.unicode, !1),
      tokenPostfix: OKe(t.tokenPostfix, "." + e),
      defaultToken: OKe(t.defaultToken, "source"),
      usesEmbedded: !1,
      stateNames: {},
      tokenizer: {},
      brackets: [],
    },
    i = t;
  function r(e, o, s) {
    for (const a of s) {
      let s = a.include;
      if (s) {
        if ("string" != typeof s) throw JWe(n, "an 'include' attribute must be a string at: " + e);
        if (("@" === s[0] && (s = s.substr(1)), !t.tokenizer[s]))
          throw JWe(n, "include target '" + s + "' is not defined at: " + e);
        r(e + "." + s, o, t.tokenizer[s]);
      } else {
        const t = new FKe(e);
        if (Array.isArray(a) && a.length >= 1 && a.length <= 3)
          if ((t.setRegex(i, a[0]), a.length >= 3))
            if ("string" == typeof a[1]) t.setAction(i, { token: a[1], next: a[2] });
            else {
              if ("object" != typeof a[1])
                throw JWe(
                  n,
                  "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: " +
                    e,
                );
              {
                const e = a[1];
                ((e.next = a[2]), t.setAction(i, e));
              }
            }
          else t.setAction(i, a[1]);
        else {
          if (!a.regex)
            throw JWe(
              n,
              "a rule must either be an array, or an object with a 'regex' or 'include' field at: " +
                e,
            );
          (a.name && "string" == typeof a.name && (t.name = a.name),
            a.matchOnlyAtStart && (t.matchOnlyAtLineStart = RKe(a.matchOnlyAtLineStart, !1)),
            t.setRegex(i, a.regex),
            t.setAction(i, a.action));
        }
        o.push(t);
      }
    }
  }
  if (
    ((i.languageId = e),
    (i.includeLF = n.includeLF),
    (i.ignoreCase = n.ignoreCase),
    (i.unicode = n.unicode),
    (i.noThrow = n.noThrow),
    (i.usesEmbedded = n.usesEmbedded),
    (i.stateNames = t.tokenizer),
    (i.defaultToken = n.defaultToken),
    !t.tokenizer || "object" != typeof t.tokenizer)
  )
    throw JWe(n, "a language definition must define the 'tokenizer' attribute as an object");
  n.tokenizer = [];
  for (const s in t.tokenizer)
    if (t.tokenizer.hasOwnProperty(s)) {
      n.start || (n.start = s);
      const e = t.tokenizer[s];
      ((n.tokenizer[s] = new Array()), r("tokenizer." + s, n.tokenizer[s], e));
    }
  if (((n.usesEmbedded = i.usesEmbedded), t.brackets)) {
    if (!Array.isArray(t.brackets))
      throw JWe(n, "the 'brackets' attribute must be defined as an array");
  } else
    t.brackets = [
      { open: "{", close: "}", token: "delimiter.curly" },
      { open: "[", close: "]", token: "delimiter.square" },
      { open: "(", close: ")", token: "delimiter.parenthesis" },
      { open: "<", close: ">", token: "delimiter.angle" },
    ];
  const o = [];
  for (const s of t.brackets) {
    let e = s;
    if (
      (e && Array.isArray(e) && 3 === e.length && (e = { token: e[2], open: e[0], close: e[1] }),
      e.open === e.close)
    )
      throw JWe(
        n,
        "open and close brackets in a 'brackets' attribute must be different: " +
          e.open +
          "\n hint: use the 'bracket' attribute if matching on equal brackets is required.",
      );
    if ("string" != typeof e.open || "string" != typeof e.token || "string" != typeof e.close)
      throw JWe(
        n,
        "every element in the 'brackets' array must be a '{open,close,token}' object or array",
      );
    o.push({ token: e.token + n.tokenPostfix, open: YWe(n, e.open), close: YWe(n, e.close) });
  }
  return ((n.brackets = o), (n.noThrow = !0), n);
}
function VKe(e) {
  s$.registerLanguage(e);
}
function WKe() {
  let e = [];
  return ((e = e.concat(s$.getLanguages())), e);
}
function HKe(e) {
  return Iqe.get(BU).languageIdCodec.encodeLanguageId(e);
}
function zKe(e, t) {
  return Iqe.withServices(() => {
    const n = Iqe.get(BU).onDidRequestRichLanguageFeatures((i) => {
      i === e && (n.dispose(), t());
    });
    return n;
  });
}
function UKe(e, t) {
  return Iqe.withServices(() => {
    const n = Iqe.get(BU).onDidRequestBasicLanguageFeatures((i) => {
      i === e && (n.dispose(), t());
    });
    return n;
  });
}
function $Ke(e, t) {
  if (!Iqe.get(BU).isRegisteredLanguageId(e))
    throw new Error(`Cannot set configuration for unknown language ${e}`);
  return Iqe.get(f$).register(e, t, 100);
}
class qKe {
  constructor(e, t) {
    ((this._languageId = e), (this._actual = t));
  }
  dispose() {}
  getInitialState() {
    return this._actual.getInitialState();
  }
  tokenize(e, t, n) {
    if ("function" == typeof this._actual.tokenize)
      return KKe.adaptTokenize(this._languageId, this._actual, e, n);
    throw new Error("Not supported!");
  }
  tokenizeEncoded(e, t, n) {
    const i = this._actual.tokenizeEncoded(e, n);
    return new u2(i.tokens, i.endState);
  }
}
class KKe {
  constructor(e, t, n, i) {
    ((this._languageId = e),
      (this._actual = t),
      (this._languageService = n),
      (this._standaloneThemeService = i));
  }
  dispose() {}
  getInitialState() {
    return this._actual.getInitialState();
  }
  static _toClassicTokens(e, t) {
    const n = [];
    let i = 0;
    for (let r = 0, o = e.length; r < o; r++) {
      const o = e[r];
      let s = o.startIndex;
      (0 === r ? (s = 0) : s < i && (s = i), (n[r] = new c2(s, o.scopes, t)), (i = s));
    }
    return n;
  }
  static adaptTokenize(e, t, n, i) {
    const r = t.tokenize(n, i),
      o = KKe._toClassicTokens(r.tokens, e);
    let s;
    return ((s = r.endState.equals(i) ? i : r.endState), new d2(o, s));
  }
  tokenize(e, t, n) {
    return KKe.adaptTokenize(this._languageId, this._actual, e, n);
  }
  _toBinaryTokens(e, t) {
    const n = e.encodeLanguageId(this._languageId),
      i = this._standaloneThemeService.getColorTheme().tokenTheme,
      r = [];
    let o = 0,
      s = 0;
    for (let l = 0, c = t.length; l < c; l++) {
      const e = t[l],
        a = 1024 | i.match(n, e.scopes);
      if (o > 0 && r[o - 1] === a) continue;
      let c = e.startIndex;
      (0 === l ? (c = 0) : c < s && (c = s), (r[o++] = c), (r[o++] = a), (s = c));
    }
    const a = new Uint32Array(o);
    for (let l = 0; l < o; l++) a[l] = r[l];
    return a;
  }
  tokenizeEncoded(e, t, n) {
    const i = this._actual.tokenize(e, n),
      r = this._toBinaryTokens(this._languageService.languageIdCodec, i.tokens);
    let o;
    return ((o = i.endState.equals(n) ? n : i.endState), new u2(r, o));
  }
}
function GKe(e) {
  return e && "function" == typeof e.then;
}
function ZKe(e) {
  const t = Iqe.get(OFe);
  if (e) {
    const n = [null];
    for (let t = 1, i = e.length; t < i; t++) n[t] = vG.fromHex(e[t]);
    t.setColorMapOverride(n);
  } else t.setColorMapOverride(null);
}
function YKe(e, t) {
  return (function (e) {
    return "tokenizeEncoded" in e;
  })(t)
    ? new qKe(e, t)
    : new KKe(e, t, Iqe.get(BU), Iqe.get(OFe));
}
function XKe(e, t) {
  const n = new T2(async () => {
    const n = await Promise.resolve(t.create());
    return n
      ? "function" == typeof n.getInitialState
        ? YKe(e, n)
        : new dHe(Iqe.get(BU), Iqe.get(OFe), e, BKe(e, n), Iqe.get(OU))
      : null;
  });
  return I2.registerFactory(e, n);
}
function QKe(e, t) {
  if (!Iqe.get(BU).isRegisteredLanguageId(e))
    throw new Error(`Cannot set tokens provider for unknown language ${e}`);
  return GKe(t) ? XKe(e, { create: () => t }) : I2.register(e, YKe(e, t));
}
function JKe(e, t) {
  return GKe(t)
    ? XKe(e, { create: () => t })
    : I2.register(e, ((t) => new dHe(Iqe.get(BU), Iqe.get(OFe), e, BKe(e, t), Iqe.get(OU)))(t));
}
function eGe(e, t) {
  return Iqe.get(mee).referenceProvider.register(e, t);
}
function tGe(e, t) {
  return Iqe.get(mee).renameProvider.register(e, t);
}
function nGe(e, t) {
  return Iqe.get(mee).newSymbolNamesProvider.register(e, t);
}
function iGe(e, t) {
  return Iqe.get(mee).signatureHelpProvider.register(e, t);
}
function rGe(e, t) {
  return Iqe.get(mee).hoverProvider.register(e, {
    provideHover: async (e, n, i, r) => {
      const o = e.getWordAtPosition(n);
      return Promise.resolve(t.provideHover(e, n, i, r)).then((e) => {
        if (e)
          return (
            !e.range &&
              o &&
              (e.range = new YH(n.lineNumber, o.startColumn, n.lineNumber, o.endColumn)),
            e.range || (e.range = new YH(n.lineNumber, n.column, n.lineNumber, n.column)),
            e
          );
      });
    },
  });
}
function oGe(e, t) {
  return Iqe.get(mee).documentSymbolProvider.register(e, t);
}
function sGe(e, t) {
  return Iqe.get(mee).documentHighlightProvider.register(e, t);
}
function aGe(e, t) {
  return Iqe.get(mee).linkedEditingRangeProvider.register(e, t);
}
function lGe(e, t) {
  return Iqe.get(mee).definitionProvider.register(e, t);
}
function cGe(e, t) {
  return Iqe.get(mee).implementationProvider.register(e, t);
}
function dGe(e, t) {
  return Iqe.get(mee).typeDefinitionProvider.register(e, t);
}
function uGe(e, t) {
  return Iqe.get(mee).codeLensProvider.register(e, t);
}
function hGe(e, t, n) {
  return Iqe.get(mee).codeActionProvider.register(e, {
    providedCodeActionKinds: n?.providedCodeActionKinds,
    documentation: n?.documentation,
    provideCodeActions: (e, n, i, r) => {
      const o = Iqe.get(Tfe)
        .read({ resource: e.uri })
        .filter((e) => YH.areIntersectingOrTouching(e, n));
      return t.provideCodeActions(e, n, { markers: o, only: i.only, trigger: i.trigger }, r);
    },
    resolveCodeAction: t.resolveCodeAction,
  });
}
function gGe(e, t) {
  return Iqe.get(mee).documentFormattingEditProvider.register(e, t);
}
function pGe(e, t) {
  return Iqe.get(mee).documentRangeFormattingEditProvider.register(e, t);
}
function fGe(e, t) {
  return Iqe.get(mee).onTypeFormattingEditProvider.register(e, t);
}
function mGe(e, t) {
  return Iqe.get(mee).linkProvider.register(e, t);
}
function _Ge(e, t) {
  return Iqe.get(mee).completionProvider.register(e, t);
}
function vGe(e, t) {
  return Iqe.get(mee).colorProvider.register(e, t);
}
function bGe(e, t) {
  return Iqe.get(mee).foldingRangeProvider.register(e, t);
}
function yGe(e, t) {
  return Iqe.get(mee).declarationProvider.register(e, t);
}
function xGe(e, t) {
  return Iqe.get(mee).selectionRangeProvider.register(e, t);
}
function wGe(e, t) {
  return Iqe.get(mee).documentSemanticTokensProvider.register(e, t);
}
function CGe(e, t) {
  return Iqe.get(mee).documentRangeSemanticTokensProvider.register(e, t);
}
function SGe(e, t) {
  return Iqe.get(mee).inlineCompletionsProvider.register(e, t);
}
function kGe(e, t) {
  return Iqe.get(mee).inlayHintsProvider.register(e, t);
}
((BK.wrappingIndent.defaultValue = 0),
  (BK.glyphMargin.defaultValue = !1),
  (BK.autoIndent.defaultValue = 3),
  (BK.overviewRulerLanes.defaultValue = 2),
  LNe.setFormatterSelector((e, t, n) => Promise.resolve(e[0])));
const EGe = ZVe();
((EGe.editor = {
  create: Jqe,
  getEditors: nKe,
  getDiffEditors: iKe,
  onDidCreateEditor: eKe,
  onDidCreateDiffEditor: tKe,
  createDiffEditor: rKe,
  addCommand: sKe,
  addEditorAction: aKe,
  addKeybindingRule: lKe,
  addKeybindingRules: cKe,
  createModel: dKe,
  setModelLanguage: uKe,
  setModelMarkers: hKe,
  getModelMarkers: pKe,
  removeAllMarkers: gKe,
  onDidChangeMarkers: fKe,
  getModels: _Ke,
  getModel: mKe,
  onDidCreateModel: vKe,
  onWillDisposeModel: bKe,
  onDidChangeModelLanguage: yKe,
  createWebWorker: xKe,
  colorizeElement: wKe,
  colorize: CKe,
  colorizeModelLine: SKe,
  tokenize: kKe,
  defineTheme: EKe,
  setTheme: NKe,
  remeasureFonts: LKe,
  registerCommand: DKe,
  registerLinkOpener: TKe,
  registerEditorOpener: IKe,
  AccessibilitySupport: eVe,
  ContentWidgetPositionPreference: sVe,
  CursorChangeReason: aVe,
  DefaultEndOfLine: lVe,
  EditorAutoIndentStrategy: dVe,
  EditorOption: uVe,
  EndOfLinePreference: hVe,
  EndOfLineSequence: gVe,
  MinimapPosition: kVe,
  MinimapSectionHeaderStyle: EVe,
  MouseTargetType: NVe,
  OverlayWidgetPositionPreference: TVe,
  OverviewRulerLane: IVe,
  GlyphMarginLane: pVe,
  RenderLineNumbersType: MVe,
  RenderMinimap: AVe,
  ScrollbarVisibility: jVe,
  ScrollType: PVe,
  TextEditorCursorBlinkingStyle: UVe,
  TextEditorCursorStyle: $Ve,
  TrackedRangeStickiness: qVe,
  WrappingIndent: KVe,
  InjectedTextCursorStops: _Ve,
  PositionAffinity: OVe,
  ShowLightbulbIconMode: BVe,
  TextDirection: zVe,
  ConfigurationChangedEvent: tK,
  BareFontInfo: Zq,
  FontInfo: Yq,
  TextModelResolvedOptions: Yz,
  FindMatch: Xz,
  ApplyUpdateResult: rK,
  EditorZoom: Kq,
  createMultiFileDiffEditor: oKe,
  EditorType: X3,
  EditorOptions: BK,
}),
  (EGe.languages = {
    register: VKe,
    getLanguages: WKe,
    onLanguage: zKe,
    onLanguageEncountered: UKe,
    getEncodedLanguageId: HKe,
    setLanguageConfiguration: $Ke,
    setColorMap: ZKe,
    registerTokensProviderFactory: XKe,
    setTokensProvider: QKe,
    setMonarchTokensProvider: JKe,
    registerReferenceProvider: eGe,
    registerRenameProvider: tGe,
    registerNewSymbolNameProvider: nGe,
    registerCompletionItemProvider: _Ge,
    registerSignatureHelpProvider: iGe,
    registerHoverProvider: rGe,
    registerDocumentSymbolProvider: oGe,
    registerDocumentHighlightProvider: sGe,
    registerLinkedEditingRangeProvider: aGe,
    registerDefinitionProvider: lGe,
    registerImplementationProvider: cGe,
    registerTypeDefinitionProvider: dGe,
    registerCodeLensProvider: uGe,
    registerCodeActionProvider: hGe,
    registerDocumentFormattingEditProvider: gGe,
    registerDocumentRangeFormattingEditProvider: pGe,
    registerOnTypeFormattingEditProvider: fGe,
    registerLinkProvider: mGe,
    registerColorProvider: vGe,
    registerFoldingRangeProvider: bGe,
    registerDeclarationProvider: yGe,
    registerSelectionRangeProvider: xGe,
    registerDocumentSemanticTokensProvider: wGe,
    registerDocumentRangeSemanticTokensProvider: CGe,
    registerInlineCompletionsProvider: SGe,
    registerInlayHintsProvider: kGe,
    DocumentHighlightKind: cVe,
    CompletionItemKind: iVe,
    CompletionItemTag: rVe,
    CompletionItemInsertTextRule: nVe,
    SymbolKind: WVe,
    SymbolTag: HVe,
    IndentAction: mVe,
    CompletionTriggerKind: oVe,
    SignatureHelpTriggerKind: VVe,
    InlayHintKind: vVe,
    InlineCompletionTriggerKind: xVe,
    CodeActionTriggerType: tVe,
    NewSymbolNameTag: LVe,
    NewSymbolNameTriggerKind: DVe,
    PartialAcceptTriggerKind: RVe,
    HoverVerbosityAction: fVe,
    InlineCompletionEndOfLifeReasonKind: bVe,
    InlineCompletionHintStyle: yVe,
    FoldingRangeKind: k2,
    SelectedSuggestionInfo: y2,
    EditDeltaInfo: b8,
  }));
const NGe = EGe.CancellationTokenSource,
  LGe = EGe.Emitter,
  DGe = EGe.KeyCode,
  TGe = EGe.KeyMod,
  IGe = EGe.Position,
  RGe = EGe.Range,
  OGe = EGe.Selection,
  MGe = EGe.SelectionDirection,
  AGe = EGe.MarkerSeverity,
  PGe = EGe.MarkerTag,
  jGe = EGe.Uri,
  FGe = EGe.Token,
  BGe = EGe.editor,
  VGe = EGe.languages,
  WGe = BI(),
  HGe = globalThis;
((WGe?.globalAPI || ("function" == typeof HGe.define && HGe.define.amd)) && (HGe.monaco = EGe),
  void 0 !== HGe.require &&
    "function" == typeof HGe.require.config &&
    HGe.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",
      ],
    }));
const zGe = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      CancellationTokenSource: NGe,
      Emitter: LGe,
      KeyCode: DGe,
      KeyMod: TGe,
      MarkerSeverity: AGe,
      MarkerTag: PGe,
      Position: IGe,
      Range: RGe,
      Selection: OGe,
      SelectionDirection: MGe,
      Token: FGe,
      Uri: jGe,
      editor: BGe,
      languages: VGe,
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
let UGe = class {
  constructor(e, t, n) {
    ((this._onDidChange = new LGe()),
      (this._languageId = e),
      this.setOptions(t),
      this.setModeConfiguration(n));
  }
  get onDidChange() {
    return this._onDidChange.event;
  }
  get languageId() {
    return this._languageId;
  }
  get modeConfiguration() {
    return this._modeConfiguration;
  }
  get diagnosticsOptions() {
    return this.options;
  }
  get options() {
    return this._options;
  }
  setOptions(e) {
    ((this._options = e || Object.create(null)), this._onDidChange.fire(this));
  }
  setDiagnosticsOptions(e) {
    this.setOptions(e);
  }
  setModeConfiguration(e) {
    ((this._modeConfiguration = e || Object.create(null)), this._onDidChange.fire(this));
  }
};
const $Ge = {
    validate: !0,
    lint: {
      compatibleVendorPrefixes: "ignore",
      vendorPrefix: "warning",
      duplicateProperties: "warning",
      emptyRules: "warning",
      importStatement: "ignore",
      boxModel: "ignore",
      universalSelector: "ignore",
      zeroUnits: "ignore",
      fontFaceProperties: "warning",
      hexColorLength: "error",
      argumentsInColorFunction: "error",
      unknownProperties: "warning",
      ieHack: "ignore",
      unknownVendorSpecificProperties: "ignore",
      propertyIgnoredDueToDisplay: "warning",
      important: "ignore",
      float: "ignore",
      idSelector: "ignore",
    },
    data: { useDefaultDataProvider: !0 },
    format: {
      newlineBetweenSelectors: !0,
      newlineBetweenRules: !0,
      spaceAroundSelectorSeparator: !1,
      braceStyle: "collapse",
      maxPreserveNewLines: void 0,
      preserveNewLines: !0,
    },
  },
  qGe = {
    completionItems: !0,
    hovers: !0,
    documentSymbols: !0,
    definitions: !0,
    references: !0,
    documentHighlights: !0,
    rename: !0,
    colors: !0,
    foldingRanges: !0,
    diagnostics: !0,
    selectionRanges: !0,
    documentFormattingEdits: !0,
    documentRangeFormattingEdits: !0,
  },
  KGe = new UGe("css", $Ge, qGe),
  GGe = new UGe("scss", $Ge, qGe),
  ZGe = new UGe("less", $Ge, qGe);
function YGe() {
  return xp(() => Promise.resolve().then(() => W2e), void 0, import.meta.url);
}
(VGe.onLanguage("less", () => {
  YGe().then((e) => e.setupMode(ZGe));
}),
  VGe.onLanguage("scss", () => {
    YGe().then((e) => e.setupMode(GGe));
  }),
  VGe.onLanguage("css", () => {
    YGe().then((e) => e.setupMode(KGe));
  }));
const XGe = Object.freeze(
  Object.defineProperty(
    { __proto__: null, cssDefaults: KGe, lessDefaults: ZGe, scssDefaults: GGe },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
let QGe = class {
  constructor(e, t, n) {
    ((this._onDidChange = new LGe()),
      (this._languageId = e),
      this.setOptions(t),
      this.setModeConfiguration(n));
  }
  get onDidChange() {
    return this._onDidChange.event;
  }
  get languageId() {
    return this._languageId;
  }
  get options() {
    return this._options;
  }
  get modeConfiguration() {
    return this._modeConfiguration;
  }
  setOptions(e) {
    ((this._options = e || Object.create(null)), this._onDidChange.fire(this));
  }
  setModeConfiguration(e) {
    ((this._modeConfiguration = e || Object.create(null)), this._onDidChange.fire(this));
  }
};
const JGe = {
  format: {
    tabSize: 4,
    insertSpaces: !1,
    wrapLineLength: 120,
    unformatted:
      'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',
    contentUnformatted: "pre",
    indentInnerHtml: !1,
    preserveNewLines: !0,
    maxPreserveNewLines: void 0,
    indentHandlebars: !1,
    endWithNewline: !1,
    extraLiners: "head, body, /html",
    wrapAttributes: "auto",
  },
  suggest: {},
  data: { useDefaultDataProvider: !0 },
};
function eZe(e) {
  return {
    completionItems: !0,
    hovers: !0,
    documentSymbols: !0,
    links: !0,
    documentHighlights: !0,
    rename: !0,
    colors: !0,
    foldingRanges: !0,
    selectionRanges: !0,
    diagnostics: e === tZe,
    documentFormattingEdits: e === tZe,
    documentRangeFormattingEdits: e === tZe,
  };
}
const tZe = "html",
  nZe = "handlebars",
  iZe = "razor",
  rZe = dZe(tZe, JGe, eZe(tZe)),
  oZe = rZe.defaults,
  sZe = dZe(nZe, JGe, eZe(nZe)),
  aZe = sZe.defaults,
  lZe = dZe(iZe, JGe, eZe(iZe)),
  cZe = lZe.defaults;
function dZe(e, t = JGe, n = eZe(e)) {
  const i = new QGe(e, t, n);
  let r;
  const o = VGe.onLanguage(e, async () => {
    r = (await xp(() => Promise.resolve().then(() => q2e), void 0, import.meta.url)).setupMode(i);
  });
  return {
    defaults: i,
    dispose() {
      (o.dispose(), r?.dispose(), (r = void 0));
    },
  };
}
const uZe = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      handlebarDefaults: aZe,
      handlebarLanguageService: sZe,
      htmlDefaults: oZe,
      htmlLanguageService: rZe,
      razorDefaults: cZe,
      razorLanguageService: lZe,
      registerHTMLLanguageService: dZe,
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
const hZe = new (class {
  constructor(e, t, n) {
    ((this._onDidChange = new LGe()),
      (this._languageId = e),
      this.setDiagnosticsOptions(t),
      this.setModeConfiguration(n));
  }
  get onDidChange() {
    return this._onDidChange.event;
  }
  get languageId() {
    return this._languageId;
  }
  get modeConfiguration() {
    return this._modeConfiguration;
  }
  get diagnosticsOptions() {
    return this._diagnosticsOptions;
  }
  setDiagnosticsOptions(e) {
    ((this._diagnosticsOptions = e || Object.create(null)), this._onDidChange.fire(this));
  }
  setModeConfiguration(e) {
    ((this._modeConfiguration = e || Object.create(null)), this._onDidChange.fire(this));
  }
})(
  "json",
  {
    validate: !0,
    allowComments: !0,
    schemas: [],
    enableSchemaRequest: !1,
    schemaRequest: "warning",
    schemaValidation: "warning",
    comments: "error",
    trailingCommas: "error",
  },
  {
    documentFormattingEdits: !0,
    documentRangeFormattingEdits: !0,
    completionItems: !0,
    hovers: !0,
    documentSymbols: !0,
    tokens: !0,
    colors: !0,
    foldingRanges: !0,
    diagnostics: !0,
    selectionRanges: !0,
  },
);
function gZe() {
  return xp(() => Promise.resolve().then(() => C4e), void 0, import.meta.url);
}
(VGe.register({
  id: "json",
  extensions: [".json", ".bowerrc", ".jshintrc", ".jscsrc", ".eslintrc", ".babelrc", ".har"],
  aliases: ["JSON", "json"],
  mimetypes: ["application/json"],
}),
  VGe.onLanguage("json", () => {
    gZe().then((e) => e.setupMode(hZe));
  }));
const pZe = Object.freeze(
  Object.defineProperty(
    { __proto__: null, getWorker: () => gZe().then((e) => e.getWorker()), jsonDefaults: hZe },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
var fZe = ((e) => (
    (e[(e.None = 0)] = "None"),
    (e[(e.CommonJS = 1)] = "CommonJS"),
    (e[(e.AMD = 2)] = "AMD"),
    (e[(e.UMD = 3)] = "UMD"),
    (e[(e.System = 4)] = "System"),
    (e[(e.ES2015 = 5)] = "ES2015"),
    (e[(e.ESNext = 99)] = "ESNext"),
    e
  ))(fZe || {}),
  mZe = ((e) => (
    (e[(e.None = 0)] = "None"),
    (e[(e.Preserve = 1)] = "Preserve"),
    (e[(e.React = 2)] = "React"),
    (e[(e.ReactNative = 3)] = "ReactNative"),
    (e[(e.ReactJSX = 4)] = "ReactJSX"),
    (e[(e.ReactJSXDev = 5)] = "ReactJSXDev"),
    e
  ))(mZe || {}),
  _Ze = ((e) => (
    (e[(e.CarriageReturnLineFeed = 0)] = "CarriageReturnLineFeed"),
    (e[(e.LineFeed = 1)] = "LineFeed"),
    e
  ))(_Ze || {}),
  vZe = ((e) => (
    (e[(e.ES3 = 0)] = "ES3"),
    (e[(e.ES5 = 1)] = "ES5"),
    (e[(e.ES2015 = 2)] = "ES2015"),
    (e[(e.ES2016 = 3)] = "ES2016"),
    (e[(e.ES2017 = 4)] = "ES2017"),
    (e[(e.ES2018 = 5)] = "ES2018"),
    (e[(e.ES2019 = 6)] = "ES2019"),
    (e[(e.ES2020 = 7)] = "ES2020"),
    (e[(e.ESNext = 99)] = "ESNext"),
    (e[(e.JSON = 100)] = "JSON"),
    (e[(e.Latest = 99)] = "Latest"),
    e
  ))(vZe || {}),
  bZe = ((e) => ((e[(e.Classic = 1)] = "Classic"), (e[(e.NodeJs = 2)] = "NodeJs"), e))(bZe || {});
class yZe {
  constructor(e, t, n, i, r) {
    ((this._onDidChange = new LGe()),
      (this._onDidExtraLibsChange = new LGe()),
      (this._extraLibs = Object.create(null)),
      (this._removedExtraLibs = Object.create(null)),
      (this._eagerModelSync = !1),
      this.setCompilerOptions(e),
      this.setDiagnosticsOptions(t),
      this.setWorkerOptions(n),
      this.setInlayHintsOptions(i),
      this.setModeConfiguration(r),
      (this._onDidExtraLibsChangeTimeout = -1));
  }
  get onDidChange() {
    return this._onDidChange.event;
  }
  get onDidExtraLibsChange() {
    return this._onDidExtraLibsChange.event;
  }
  get modeConfiguration() {
    return this._modeConfiguration;
  }
  get workerOptions() {
    return this._workerOptions;
  }
  get inlayHintsOptions() {
    return this._inlayHintsOptions;
  }
  getExtraLibs() {
    return this._extraLibs;
  }
  addExtraLib(e, t) {
    let n;
    if (
      ((n = void 0 === t ? `ts:extralib-${Math.random().toString(36).substring(2, 15)}` : t),
      this._extraLibs[n] && this._extraLibs[n].content === e)
    )
      return { dispose: () => {} };
    let i = 1;
    return (
      this._removedExtraLibs[n] && (i = this._removedExtraLibs[n] + 1),
      this._extraLibs[n] && (i = this._extraLibs[n].version + 1),
      (this._extraLibs[n] = { content: e, version: i }),
      this._fireOnDidExtraLibsChangeSoon(),
      {
        dispose: () => {
          let e = this._extraLibs[n];
          e &&
            e.version === i &&
            (delete this._extraLibs[n],
            (this._removedExtraLibs[n] = i),
            this._fireOnDidExtraLibsChangeSoon());
        },
      }
    );
  }
  setExtraLibs(e) {
    for (const t in this._extraLibs) this._removedExtraLibs[t] = this._extraLibs[t].version;
    if (((this._extraLibs = Object.create(null)), e && e.length > 0))
      for (const t of e) {
        const e = t.filePath || `ts:extralib-${Math.random().toString(36).substring(2, 15)}`,
          n = t.content;
        let i = 1;
        (this._removedExtraLibs[e] && (i = this._removedExtraLibs[e] + 1),
          (this._extraLibs[e] = { content: n, version: i }));
      }
    this._fireOnDidExtraLibsChangeSoon();
  }
  _fireOnDidExtraLibsChangeSoon() {
    -1 === this._onDidExtraLibsChangeTimeout &&
      (this._onDidExtraLibsChangeTimeout = window.setTimeout(() => {
        ((this._onDidExtraLibsChangeTimeout = -1), this._onDidExtraLibsChange.fire(void 0));
      }, 0));
  }
  getCompilerOptions() {
    return this._compilerOptions;
  }
  setCompilerOptions(e) {
    ((this._compilerOptions = e || Object.create(null)), this._onDidChange.fire(void 0));
  }
  getDiagnosticsOptions() {
    return this._diagnosticsOptions;
  }
  setDiagnosticsOptions(e) {
    ((this._diagnosticsOptions = e || Object.create(null)), this._onDidChange.fire(void 0));
  }
  setWorkerOptions(e) {
    ((this._workerOptions = e || Object.create(null)), this._onDidChange.fire(void 0));
  }
  setInlayHintsOptions(e) {
    ((this._inlayHintsOptions = e || Object.create(null)), this._onDidChange.fire(void 0));
  }
  setMaximumWorkerIdleTime(e) {}
  setEagerModelSync(e) {
    this._eagerModelSync = e;
  }
  getEagerModelSync() {
    return this._eagerModelSync;
  }
  setModeConfiguration(e) {
    ((this._modeConfiguration = e || Object.create(null)), this._onDidChange.fire(void 0));
  }
}
const xZe = {
    completionItems: !0,
    hovers: !0,
    documentSymbols: !0,
    definitions: !0,
    references: !0,
    documentHighlights: !0,
    rename: !0,
    diagnostics: !0,
    documentRangeFormattingEdits: !0,
    signatureHelp: !0,
    onTypeFormattingEdits: !0,
    codeActions: !0,
    inlayHints: !0,
  },
  wZe = new yZe(
    { allowNonTsExtensions: !0, target: 99 },
    { noSemanticValidation: !1, noSyntaxValidation: !1, onlyVisible: !1 },
    {},
    {},
    xZe,
  ),
  CZe = new yZe(
    { allowNonTsExtensions: !0, allowJs: !0, target: 99 },
    { noSemanticValidation: !0, noSyntaxValidation: !1, onlyVisible: !1 },
    {},
    {},
    xZe,
  );
function SZe() {
  return xp(() => Promise.resolve().then(() => Y4e), void 0, import.meta.url);
}
(VGe.onLanguage("typescript", () => SZe().then((e) => e.setupTypeScript(wZe))),
  VGe.onLanguage("javascript", () => SZe().then((e) => e.setupJavaScript(CZe))));
const kZe = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        JsxEmit: mZe,
        ModuleKind: fZe,
        ModuleResolutionKind: bZe,
        NewLineKind: _Ze,
        ScriptTarget: vZe,
        getJavaScriptWorker: () => SZe().then((e) => e.getJavaScriptWorker()),
        getTypeScriptWorker: () => SZe().then((e) => e.getTypeScriptWorker()),
        javascriptDefaults: CZe,
        typescriptDefaults: wZe,
        typescriptVersion: "5.9.3",
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  EZe = {},
  NZe = {};
class LZe {
  static getOrCreate(e) {
    return (NZe[e] || (NZe[e] = new LZe(e)), NZe[e]);
  }
  constructor(e) {
    ((this._languageId = e),
      (this._loadingTriggered = !1),
      (this._lazyLoadPromise = new Promise((e, t) => {
        ((this._lazyLoadPromiseResolve = e), (this._lazyLoadPromiseReject = t));
      })));
  }
  load() {
    return (
      this._loadingTriggered ||
        ((this._loadingTriggered = !0),
        EZe[this._languageId].loader().then(
          (e) => this._lazyLoadPromiseResolve(e),
          (e) => this._lazyLoadPromiseReject(e),
        )),
      this._lazyLoadPromise
    );
  }
}
function DZe(e) {
  const t = e.id;
  ((EZe[t] = e), VGe.register(e));
  const n = LZe.getOrCreate(t);
  (VGe.registerTokensProviderFactory(t, { create: async () => (await n.load()).language }),
    VGe.onLanguageEncountered(t, async () => {
      const e = await n.load();
      VGe.setLanguageConfiguration(t, e.conf);
    }));
}
(DZe({
  id: "abap",
  extensions: [".abap"],
  aliases: ["abap", "ABAP"],
  loader: () => xp(() => Promise.resolve().then(() => X4e), void 0, import.meta.url),
}),
  DZe({
    id: "apex",
    extensions: [".cls"],
    aliases: ["Apex", "apex"],
    mimetypes: ["text/x-apex-source", "text/x-apex"],
    loader: () => xp(() => Promise.resolve().then(() => t5e), void 0, import.meta.url),
  }),
  DZe({
    id: "azcli",
    extensions: [".azcli"],
    aliases: ["Azure CLI", "azcli"],
    loader: () => xp(() => Promise.resolve().then(() => n5e), void 0, import.meta.url),
  }),
  DZe({
    id: "bat",
    extensions: [".bat", ".cmd"],
    aliases: ["Batch", "bat"],
    loader: () => xp(() => Promise.resolve().then(() => r5e), void 0, import.meta.url),
  }),
  DZe({
    id: "bicep",
    extensions: [".bicep"],
    aliases: ["Bicep"],
    loader: () => xp(() => Promise.resolve().then(() => l5e), void 0, import.meta.url),
  }),
  DZe({
    id: "cameligo",
    extensions: [".mligo"],
    aliases: ["Cameligo"],
    loader: () => xp(() => Promise.resolve().then(() => c5e), void 0, import.meta.url),
  }),
  DZe({
    id: "clojure",
    extensions: [".clj", ".cljs", ".cljc", ".edn"],
    aliases: ["clojure", "Clojure"],
    loader: () => xp(() => Promise.resolve().then(() => d5e), void 0, import.meta.url),
  }),
  DZe({
    id: "coffeescript",
    extensions: [".coffee"],
    aliases: ["CoffeeScript", "coffeescript", "coffee"],
    mimetypes: ["text/x-coffeescript", "text/coffeescript"],
    loader: () => xp(() => Promise.resolve().then(() => h5e), void 0, import.meta.url),
  }),
  DZe({
    id: "c",
    extensions: [".c", ".h"],
    aliases: ["C", "c"],
    loader: () => xp(() => Promise.resolve().then(() => p5e), void 0, import.meta.url),
  }),
  DZe({
    id: "cpp",
    extensions: [".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx"],
    aliases: ["C++", "Cpp", "cpp"],
    loader: () => xp(() => Promise.resolve().then(() => p5e), void 0, import.meta.url),
  }),
  DZe({
    id: "csharp",
    extensions: [".cs", ".csx", ".cake"],
    aliases: ["C#", "csharp"],
    loader: () => xp(() => Promise.resolve().then(() => m5e), void 0, import.meta.url),
  }),
  DZe({
    id: "csp",
    extensions: [".csp"],
    aliases: ["CSP", "csp"],
    loader: () => xp(() => Promise.resolve().then(() => _5e), void 0, import.meta.url),
  }),
  DZe({
    id: "css",
    extensions: [".css"],
    aliases: ["CSS", "css"],
    mimetypes: ["text/css"],
    loader: () => xp(() => Promise.resolve().then(() => b5e), void 0, import.meta.url),
  }),
  DZe({
    id: "cypher",
    extensions: [".cypher", ".cyp"],
    aliases: ["Cypher", "OpenCypher"],
    loader: () => xp(() => Promise.resolve().then(() => x5e), void 0, import.meta.url),
  }),
  DZe({
    id: "dart",
    extensions: [".dart"],
    aliases: ["Dart", "dart"],
    mimetypes: ["text/x-dart-source", "text/x-dart"],
    loader: () => xp(() => Promise.resolve().then(() => w5e), void 0, import.meta.url),
  }),
  DZe({
    id: "dockerfile",
    extensions: [".dockerfile"],
    filenames: ["Dockerfile"],
    aliases: ["Dockerfile"],
    loader: () => xp(() => Promise.resolve().then(() => C5e), void 0, import.meta.url),
  }),
  DZe({
    id: "ecl",
    extensions: [".ecl"],
    aliases: ["ECL", "Ecl", "ecl"],
    loader: () => xp(() => Promise.resolve().then(() => k5e), void 0, import.meta.url),
  }),
  DZe({
    id: "elixir",
    extensions: [".ex", ".exs"],
    aliases: ["Elixir", "elixir", "ex"],
    loader: () => xp(() => Promise.resolve().then(() => E5e), void 0, import.meta.url),
  }),
  DZe({
    id: "flow9",
    extensions: [".flow"],
    aliases: ["Flow9", "Flow", "flow9", "flow"],
    loader: () => xp(() => Promise.resolve().then(() => N5e), void 0, import.meta.url),
  }),
  DZe({
    id: "fsharp",
    extensions: [".fs", ".fsi", ".ml", ".mli", ".fsx", ".fsscript"],
    aliases: ["F#", "FSharp", "fsharp"],
    loader: () => xp(() => Promise.resolve().then(() => D5e), void 0, import.meta.url),
  }),
  DZe({
    id: "freemarker2",
    extensions: [".ftl", ".ftlh", ".ftlx"],
    aliases: ["FreeMarker2", "Apache FreeMarker2"],
    loader: () =>
      xp(() => Promise.resolve().then(() => K5e), void 0, import.meta.url).then(
        (e) => e.TagAutoInterpolationDollar,
      ),
  }),
  DZe({
    id: "freemarker2.tag-angle.interpolation-dollar",
    aliases: ["FreeMarker2 (Angle/Dollar)", "Apache FreeMarker2 (Angle/Dollar)"],
    loader: () =>
      xp(() => Promise.resolve().then(() => K5e), void 0, import.meta.url).then(
        (e) => e.TagAngleInterpolationDollar,
      ),
  }),
  DZe({
    id: "freemarker2.tag-bracket.interpolation-dollar",
    aliases: ["FreeMarker2 (Bracket/Dollar)", "Apache FreeMarker2 (Bracket/Dollar)"],
    loader: () =>
      xp(() => Promise.resolve().then(() => K5e), void 0, import.meta.url).then(
        (e) => e.TagBracketInterpolationDollar,
      ),
  }),
  DZe({
    id: "freemarker2.tag-angle.interpolation-bracket",
    aliases: ["FreeMarker2 (Angle/Bracket)", "Apache FreeMarker2 (Angle/Bracket)"],
    loader: () =>
      xp(() => Promise.resolve().then(() => K5e), void 0, import.meta.url).then(
        (e) => e.TagAngleInterpolationBracket,
      ),
  }),
  DZe({
    id: "freemarker2.tag-bracket.interpolation-bracket",
    aliases: ["FreeMarker2 (Bracket/Bracket)", "Apache FreeMarker2 (Bracket/Bracket)"],
    loader: () =>
      xp(() => Promise.resolve().then(() => K5e), void 0, import.meta.url).then(
        (e) => e.TagBracketInterpolationBracket,
      ),
  }),
  DZe({
    id: "freemarker2.tag-auto.interpolation-dollar",
    aliases: ["FreeMarker2 (Auto/Dollar)", "Apache FreeMarker2 (Auto/Dollar)"],
    loader: () =>
      xp(() => Promise.resolve().then(() => K5e), void 0, import.meta.url).then(
        (e) => e.TagAutoInterpolationDollar,
      ),
  }),
  DZe({
    id: "freemarker2.tag-auto.interpolation-bracket",
    aliases: ["FreeMarker2 (Auto/Bracket)", "Apache FreeMarker2 (Auto/Bracket)"],
    loader: () =>
      xp(() => Promise.resolve().then(() => K5e), void 0, import.meta.url).then(
        (e) => e.TagAutoInterpolationBracket,
      ),
  }),
  DZe({
    id: "go",
    extensions: [".go"],
    aliases: ["Go"],
    loader: () => xp(() => Promise.resolve().then(() => G5e), void 0, import.meta.url),
  }),
  DZe({
    id: "graphql",
    extensions: [".graphql", ".gql"],
    aliases: ["GraphQL", "graphql", "gql"],
    mimetypes: ["application/graphql"],
    loader: () => xp(() => Promise.resolve().then(() => Z5e), void 0, import.meta.url),
  }),
  DZe({
    id: "handlebars",
    extensions: [".handlebars", ".hbs"],
    aliases: ["Handlebars", "handlebars", "hbs"],
    mimetypes: ["text/x-handlebars-template"],
    loader: () => xp(() => Promise.resolve().then(() => Q5e), void 0, import.meta.url),
  }),
  DZe({
    id: "hcl",
    extensions: [".tf", ".tfvars", ".hcl"],
    aliases: ["Terraform", "tf", "HCL", "hcl"],
    loader: () => xp(() => Promise.resolve().then(() => J5e), void 0, import.meta.url),
  }),
  DZe({
    id: "html",
    extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm"],
    aliases: ["HTML", "htm", "html", "xhtml"],
    mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
    loader: () => xp(() => Promise.resolve().then(() => n3e), void 0, import.meta.url),
  }),
  DZe({
    id: "ini",
    extensions: [".ini", ".properties", ".gitconfig"],
    filenames: ["config", ".gitattributes", ".gitconfig", ".editorconfig"],
    aliases: ["Ini", "ini"],
    loader: () => xp(() => Promise.resolve().then(() => i3e), void 0, import.meta.url),
  }),
  DZe({
    id: "java",
    extensions: [".java", ".jav"],
    aliases: ["Java", "java"],
    mimetypes: ["text/x-java-source", "text/x-java"],
    loader: () => xp(() => Promise.resolve().then(() => o3e), void 0, import.meta.url),
  }),
  DZe({
    id: "javascript",
    extensions: [".js", ".es6", ".jsx", ".mjs", ".cjs"],
    firstLine: "^#!.*\\bnode",
    filenames: ["jakefile"],
    aliases: ["JavaScript", "javascript", "js"],
    mimetypes: ["text/javascript"],
    loader: () => xp(() => Promise.resolve().then(() => u3e), void 0, import.meta.url),
  }),
  DZe({
    id: "julia",
    extensions: [".jl"],
    aliases: ["julia", "Julia"],
    loader: () => xp(() => Promise.resolve().then(() => h3e), void 0, import.meta.url),
  }),
  DZe({
    id: "kotlin",
    extensions: [".kt", ".kts"],
    aliases: ["Kotlin", "kotlin"],
    mimetypes: ["text/x-kotlin-source", "text/x-kotlin"],
    loader: () => xp(() => Promise.resolve().then(() => p3e), void 0, import.meta.url),
  }),
  DZe({
    id: "less",
    extensions: [".less"],
    aliases: ["Less", "less"],
    mimetypes: ["text/x-less", "text/less"],
    loader: () => xp(() => Promise.resolve().then(() => m3e), void 0, import.meta.url),
  }),
  DZe({
    id: "lexon",
    extensions: [".lex"],
    aliases: ["Lexon"],
    loader: () => xp(() => Promise.resolve().then(() => v3e), void 0, import.meta.url),
  }),
  DZe({
    id: "lua",
    extensions: [".lua"],
    aliases: ["Lua", "lua"],
    loader: () => xp(() => Promise.resolve().then(() => b3e), void 0, import.meta.url),
  }),
  DZe({
    id: "liquid",
    extensions: [".liquid", ".html.liquid"],
    aliases: ["Liquid", "liquid"],
    mimetypes: ["application/liquid"],
    loader: () => xp(() => Promise.resolve().then(() => w3e), void 0, import.meta.url),
  }),
  DZe({
    id: "m3",
    extensions: [".m3", ".i3", ".mg", ".ig"],
    aliases: ["Modula-3", "Modula3", "modula3", "m3"],
    loader: () => xp(() => Promise.resolve().then(() => C3e), void 0, import.meta.url),
  }),
  DZe({
    id: "markdown",
    extensions: [".md", ".markdown", ".mdown", ".mkdn", ".mkd", ".mdwn", ".mdtxt", ".mdtext"],
    aliases: ["Markdown", "markdown"],
    loader: () => xp(() => Promise.resolve().then(() => k3e), void 0, import.meta.url),
  }),
  DZe({
    id: "mdx",
    extensions: [".mdx"],
    aliases: ["MDX", "mdx"],
    loader: () => xp(() => Promise.resolve().then(() => N3e), void 0, import.meta.url),
  }),
  DZe({
    id: "mips",
    extensions: [".s"],
    aliases: ["MIPS", "MIPS-V"],
    mimetypes: ["text/x-mips", "text/mips", "text/plaintext"],
    loader: () => xp(() => Promise.resolve().then(() => D3e), void 0, import.meta.url),
  }),
  DZe({
    id: "msdax",
    extensions: [".dax", ".msdax"],
    aliases: ["DAX", "MSDAX"],
    loader: () => xp(() => Promise.resolve().then(() => T3e), void 0, import.meta.url),
  }),
  DZe({
    id: "mysql",
    extensions: [],
    aliases: ["MySQL", "mysql"],
    loader: () => xp(() => Promise.resolve().then(() => I3e), void 0, import.meta.url),
  }),
  DZe({
    id: "objective-c",
    extensions: [".m"],
    aliases: ["Objective-C"],
    loader: () => xp(() => Promise.resolve().then(() => R3e), void 0, import.meta.url),
  }),
  DZe({
    id: "pascal",
    extensions: [".pas", ".p", ".pp"],
    aliases: ["Pascal", "pas"],
    mimetypes: ["text/x-pascal-source", "text/x-pascal"],
    loader: () => xp(() => Promise.resolve().then(() => M3e), void 0, import.meta.url),
  }),
  DZe({
    id: "pascaligo",
    extensions: [".ligo"],
    aliases: ["Pascaligo", "ligo"],
    loader: () => xp(() => Promise.resolve().then(() => A3e), void 0, import.meta.url),
  }),
  DZe({
    id: "perl",
    extensions: [".pl", ".pm"],
    aliases: ["Perl", "pl"],
    loader: () => xp(() => Promise.resolve().then(() => P3e), void 0, import.meta.url),
  }),
  DZe({
    id: "pgsql",
    extensions: [],
    aliases: ["PostgreSQL", "postgres", "pg", "postgre"],
    loader: () => xp(() => Promise.resolve().then(() => j3e), void 0, import.meta.url),
  }),
  DZe({
    id: "php",
    extensions: [".php", ".php4", ".php5", ".phtml", ".ctp"],
    aliases: ["PHP", "php"],
    mimetypes: ["application/x-php"],
    loader: () => xp(() => Promise.resolve().then(() => B3e), void 0, import.meta.url),
  }),
  DZe({
    id: "pla",
    extensions: [".pla"],
    loader: () => xp(() => Promise.resolve().then(() => V3e), void 0, import.meta.url),
  }),
  DZe({
    id: "postiats",
    extensions: [".dats", ".sats", ".hats"],
    aliases: ["ATS", "ATS/Postiats"],
    loader: () => xp(() => Promise.resolve().then(() => W3e), void 0, import.meta.url),
  }),
  DZe({
    id: "powerquery",
    extensions: [".pq", ".pqm"],
    aliases: ["PQ", "M", "Power Query", "Power Query M"],
    loader: () => xp(() => Promise.resolve().then(() => H3e), void 0, import.meta.url),
  }),
  DZe({
    id: "powershell",
    extensions: [".ps1", ".psm1", ".psd1"],
    aliases: ["PowerShell", "powershell", "ps", "ps1"],
    loader: () => xp(() => Promise.resolve().then(() => U3e), void 0, import.meta.url),
  }),
  DZe({
    id: "proto",
    extensions: [".proto"],
    aliases: ["protobuf", "Protocol Buffers"],
    loader: () => xp(() => Promise.resolve().then(() => K3e), void 0, import.meta.url),
  }),
  DZe({
    id: "pug",
    extensions: [".jade", ".pug"],
    aliases: ["Pug", "Jade", "jade"],
    loader: () => xp(() => Promise.resolve().then(() => G3e), void 0, import.meta.url),
  }),
  DZe({
    id: "python",
    extensions: [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"],
    aliases: ["Python", "py"],
    firstLine: "^#!/.*\\bpython[0-9.-]*\\b",
    loader: () => xp(() => Promise.resolve().then(() => Y3e), void 0, import.meta.url),
  }),
  DZe({
    id: "qsharp",
    extensions: [".qs"],
    aliases: ["Q#", "qsharp"],
    loader: () => xp(() => Promise.resolve().then(() => X3e), void 0, import.meta.url),
  }),
  DZe({
    id: "r",
    extensions: [".r", ".rhistory", ".rmd", ".rprofile", ".rt"],
    aliases: ["R", "r"],
    loader: () => xp(() => Promise.resolve().then(() => Q3e), void 0, import.meta.url),
  }),
  DZe({
    id: "razor",
    extensions: [".cshtml"],
    aliases: ["Razor", "razor"],
    mimetypes: ["text/x-cshtml"],
    loader: () => xp(() => Promise.resolve().then(() => t6e), void 0, import.meta.url),
  }),
  DZe({
    id: "redis",
    extensions: [".redis"],
    aliases: ["redis"],
    loader: () => xp(() => Promise.resolve().then(() => n6e), void 0, import.meta.url),
  }),
  DZe({
    id: "redshift",
    extensions: [],
    aliases: ["Redshift", "redshift"],
    loader: () => xp(() => Promise.resolve().then(() => i6e), void 0, import.meta.url),
  }),
  DZe({
    id: "restructuredtext",
    extensions: [".rst"],
    aliases: ["reStructuredText", "restructuredtext"],
    loader: () => xp(() => Promise.resolve().then(() => o6e), void 0, import.meta.url),
  }),
  DZe({
    id: "ruby",
    extensions: [".rb", ".rbx", ".rjs", ".gemspec", ".pp"],
    filenames: ["rakefile", "Gemfile"],
    aliases: ["Ruby", "rb"],
    loader: () => xp(() => Promise.resolve().then(() => a6e), void 0, import.meta.url),
  }),
  DZe({
    id: "rust",
    extensions: [".rs", ".rlib"],
    aliases: ["Rust", "rust"],
    loader: () => xp(() => Promise.resolve().then(() => c6e), void 0, import.meta.url),
  }),
  DZe({
    id: "sb",
    extensions: [".sb"],
    aliases: ["Small Basic", "sb"],
    loader: () => xp(() => Promise.resolve().then(() => d6e), void 0, import.meta.url),
  }),
  DZe({
    id: "scala",
    extensions: [".scala", ".sc", ".sbt"],
    aliases: ["Scala", "scala", "SBT", "Sbt", "sbt", "Dotty", "dotty"],
    mimetypes: ["text/x-scala-source", "text/x-scala", "text/x-sbt", "text/x-dotty"],
    loader: () => xp(() => Promise.resolve().then(() => h6e), void 0, import.meta.url),
  }),
  DZe({
    id: "scheme",
    extensions: [".scm", ".ss", ".sch", ".rkt"],
    aliases: ["scheme", "Scheme"],
    loader: () => xp(() => Promise.resolve().then(() => g6e), void 0, import.meta.url),
  }),
  DZe({
    id: "scss",
    extensions: [".scss"],
    aliases: ["Sass", "sass", "scss"],
    mimetypes: ["text/x-scss", "text/scss"],
    loader: () => xp(() => Promise.resolve().then(() => f6e), void 0, import.meta.url),
  }),
  DZe({
    id: "shell",
    extensions: [".sh", ".bash"],
    aliases: ["Shell", "sh"],
    loader: () => xp(() => Promise.resolve().then(() => m6e), void 0, import.meta.url),
  }),
  DZe({
    id: "sol",
    extensions: [".sol"],
    aliases: ["sol", "solidity", "Solidity"],
    loader: () => xp(() => Promise.resolve().then(() => _6e), void 0, import.meta.url),
  }),
  DZe({
    id: "aes",
    extensions: [".aes"],
    aliases: ["aes", "sophia", "Sophia"],
    loader: () => xp(() => Promise.resolve().then(() => v6e), void 0, import.meta.url),
  }),
  DZe({
    id: "sparql",
    extensions: [".rq"],
    aliases: ["sparql", "SPARQL"],
    loader: () => xp(() => Promise.resolve().then(() => b6e), void 0, import.meta.url),
  }),
  DZe({
    id: "sql",
    extensions: [".sql"],
    aliases: ["SQL"],
    loader: () => xp(() => Promise.resolve().then(() => y6e), void 0, import.meta.url),
  }),
  DZe({
    id: "st",
    extensions: [".st", ".iecst", ".iecplc", ".lc3lib", ".TcPOU", ".TcDUT", ".TcGVL", ".TcIO"],
    aliases: ["StructuredText", "scl", "stl"],
    loader: () => xp(() => Promise.resolve().then(() => w6e), void 0, import.meta.url),
  }),
  DZe({
    id: "swift",
    aliases: ["Swift", "swift"],
    extensions: [".swift"],
    mimetypes: ["text/swift"],
    loader: () => xp(() => Promise.resolve().then(() => C6e), void 0, import.meta.url),
  }),
  DZe({
    id: "systemverilog",
    extensions: [".sv", ".svh"],
    aliases: ["SV", "sv", "SystemVerilog", "systemverilog"],
    loader: () => xp(() => Promise.resolve().then(() => k6e), void 0, import.meta.url),
  }),
  DZe({
    id: "verilog",
    extensions: [".v", ".vh"],
    aliases: ["V", "v", "Verilog", "verilog"],
    loader: () => xp(() => Promise.resolve().then(() => k6e), void 0, import.meta.url),
  }),
  DZe({
    id: "tcl",
    extensions: [".tcl"],
    aliases: ["tcl", "Tcl", "tcltk", "TclTk", "tcl/tk", "Tcl/Tk"],
    loader: () => xp(() => Promise.resolve().then(() => E6e), void 0, import.meta.url),
  }),
  DZe({
    id: "twig",
    extensions: [".twig"],
    aliases: ["Twig", "twig"],
    mimetypes: ["text/x-twig"],
    loader: () => xp(() => Promise.resolve().then(() => N6e), void 0, import.meta.url),
  }),
  DZe({
    id: "typescript",
    extensions: [".ts", ".tsx", ".cts", ".mts"],
    aliases: ["TypeScript", "ts", "typescript"],
    mimetypes: ["text/typescript"],
    loader: () => xp(() => Promise.resolve().then(() => l3e), void 0, import.meta.url),
  }),
  DZe({
    id: "typespec",
    extensions: [".tsp"],
    aliases: ["TypeSpec"],
    loader: () => xp(() => Promise.resolve().then(() => M6e), void 0, import.meta.url),
  }),
  DZe({
    id: "vb",
    extensions: [".vb"],
    aliases: ["Visual Basic", "vb"],
    loader: () => xp(() => Promise.resolve().then(() => P6e), void 0, import.meta.url),
  }),
  DZe({
    id: "wgsl",
    extensions: [".wgsl"],
    aliases: ["WebGPU Shading Language", "WGSL", "wgsl"],
    loader: () => xp(() => Promise.resolve().then(() => W6e), void 0, import.meta.url),
  }),
  DZe({
    id: "xml",
    extensions: [
      ".xml",
      ".xsd",
      ".dtd",
      ".ascx",
      ".csproj",
      ".config",
      ".props",
      ".targets",
      ".wxi",
      ".wxl",
      ".wxs",
      ".xaml",
      ".svg",
      ".svgz",
      ".opf",
      ".xslt",
      ".xsl",
    ],
    firstLine: "(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",
    aliases: ["XML", "xml"],
    mimetypes: ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"],
    loader: () => xp(() => Promise.resolve().then(() => z6e), void 0, import.meta.url),
  }),
  DZe({
    id: "yaml",
    extensions: [".yaml", ".yml"],
    aliases: ["YAML", "yaml", "YML", "yml"],
    mimetypes: ["application/x-yaml", "text/x-yaml"],
    loader: () => xp(() => Promise.resolve().then(() => $6e), void 0, import.meta.url),
  }));
var TZe,
  IZe,
  RZe,
  OZe,
  MZe,
  AZe,
  PZe,
  jZe = Object.defineProperty,
  FZe = (e, t, n) =>
    ((e, t, n) =>
      t in e
        ? jZe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n })
        : (e[t] = n))(e, "symbol" != typeof t ? t + "" : t, n);
(((AZe || (AZe = {})).create = function (e) {
  return e;
}),
  (function (e) {
    function t(e) {
      return -32099 <= e && e <= -32e3;
    }
    ((e.parseError = -32700),
      (e.invalidRequest = -32600),
      (e.methodNotFound = -32601),
      (e.invalidParams = -32602),
      (e.internalError = -32603),
      (e.isServerError = t),
      (e.serverError = function (e) {
        if (!t(e)) throw new Error("Invalid range for a server error.");
        return e;
      }),
      (e.unexpectedServerError = -32e3),
      (e.isApplicationError = function (e) {
        return !0;
      }),
      (e.applicationError = function (e) {
        return e;
      }),
      (e.genericApplicationError = -320100));
  })(PZe || (PZe = {})));
var BZe = class {
    constructor() {
      (FZe(this, "listeners", new Set()),
        FZe(
          this,
          "event",
          (e) => (
            this.listeners.add(e),
            {
              dispose: () => {
                this.listeners.delete(e);
              },
            }
          ),
        ));
    }
    fire(e) {
      this.listeners.forEach((t) => t(e));
    }
  },
  VZe = class {
    constructor(e) {
      (FZe(this, "_value"),
        FZe(this, "eventEmitter"),
        (this._value = e),
        (this.eventEmitter = new BZe()));
    }
    get value() {
      return this._value;
    }
    set value(e) {
      this._value !== e && ((this._value = e), this.eventEmitter.fire(e));
    }
    get onChange() {
      return this.eventEmitter.event;
    }
  };
function WZe(e, t, n) {
  return e instanceof Set
    ? (e.add(t), { dispose: () => e.delete(t) })
    : (e.set(t, n), { dispose: () => e.delete(t) });
}
var HZe = class {
    constructor() {
      (FZe(this, "_state", "none"),
        FZe(this, "promise"),
        FZe(this, "resolve", () => {}),
        FZe(this, "reject", () => {}),
        (this.promise = new Promise((e, t) => {
          ((this.resolve = e), (this.reject = t));
        })));
    }
    get state() {
      return this._state;
    }
  },
  zZe =
    ((TZe = class {
      constructor() {
        (FZe(this, "_unprocessedMessages", []),
          FZe(this, "_messageListener"),
          FZe(this, "id", TZe.id++),
          FZe(this, "_state", new VZe({ state: "open" })),
          FZe(this, "state", this._state));
      }
      setListener(e) {
        if (((this._messageListener = e), e))
          for (; this._unprocessedMessages.length > 0 && void 0 !== this._messageListener; ) {
            const e = this._unprocessedMessages.shift();
            this._messageListener(e);
          }
      }
      send(e) {
        return this._sendImpl(e);
      }
      _dispatchReceivedMessage(e) {
        0 === this._unprocessedMessages.length && this._messageListener
          ? this._messageListener(e)
          : this._unprocessedMessages.push(e);
      }
      _onConnectionClosed() {
        this._state.value = { state: "closed", error: void 0 };
      }
      log(e) {
        return new UZe(this, e ?? new $Ze());
      }
    }),
    FZe(TZe, "id", 0),
    TZe),
  UZe = class {
    constructor(e, t) {
      (FZe(this, "baseStream"), FZe(this, "logger"), (this.baseStream = e), (this.logger = t));
    }
    get state() {
      return this.baseStream.state;
    }
    setListener(e) {
      void 0 !== e
        ? this.baseStream.setListener((t) => {
            (this.logger.log(this.baseStream, "incoming", t), e(t));
          })
        : this.baseStream.setListener(void 0);
    }
    send(e) {
      return (this.logger.log(this.baseStream, "outgoing", e), this.baseStream.send(e));
    }
    toString() {
      return `StreamLogger/${this.baseStream.toString()}`;
    }
  },
  $Ze = class {
    log(e, t, n) {}
  },
  qZe = class e {
    constructor(e) {
      (FZe(this, "connect"), (this.connect = e));
    }
    mapContext(t) {
      return new e((e) =>
        this.connect(
          e
            ? (function (e, t) {
                return {
                  handleNotification: (n, i) => e.handleNotification(n, t(i)),
                  handleRequest: (n, i, r) => e.handleRequest(n, i, t(r)),
                };
              })(e, t)
            : void 0,
        ),
      );
    }
  };
var KZe,
  GZe,
  ZZe = class e {
    constructor(e, t, n) {
      (FZe(this, "_stream"),
        FZe(this, "_listener"),
        FZe(this, "_logger"),
        FZe(this, "_unprocessedResponses", new Map()),
        FZe(this, "_lastUsedRequestId", 0),
        (this._stream = e),
        (this._listener = t),
        (this._logger = n),
        this._stream.setListener((e) => {
          void 0 !== e.method
            ? void 0 === e.id
              ? this._processNotification(e)
              : this._processRequest(e)
            : this._processResponse(e);
        }));
    }
    static createChannel(t, n) {
      let i = !1;
      return new qZe((r) => {
        if (i) throw new Error(`A channel to the stream ${t} was already constructed!`);
        return ((i = !0), new e(t, r, n));
      });
    }
    get state() {
      return this._stream.state;
    }
    async _processNotification(e) {
      if (void 0 !== e.id) throw new Error();
      if (this._listener)
        try {
          await this._listener.handleNotification({ method: e.method, params: e.params || null });
        } catch (t) {
          this._logger &&
            this._logger.warn({
              text: `Exception was thrown while handling notification: ${t}`,
              exception: t,
              message: e,
            });
        }
      else this._logger && this._logger.debug({ text: "Notification ignored", message: e });
    }
    async _processRequest(e) {
      if (void 0 === e.id) throw new Error();
      let t, n;
      if (this._listener)
        try {
          t = await this._listener.handleRequest(
            { method: e.method, params: e.params || null },
            e.id,
          );
        } catch (i) {
          (this._logger &&
            this._logger.warn({
              text: `Exception was thrown while handling request: ${i}`,
              message: e,
              exception: i,
            }),
            (t = {
              error: {
                code: PZe.internalError,
                message: "An unexpected exception was thrown.",
                data: void 0,
              },
            }));
        }
      else
        (this._logger &&
          this._logger.debug({
            text: "Received request even though not listening for requests",
            message: e,
          }),
          (t = {
            error: {
              code: PZe.methodNotFound,
              message: "This endpoint does not listen for requests or notifications.",
              data: void 0,
            },
          }));
      ((n =
        "result" in t
          ? { jsonrpc: "2.0", id: e.id, result: t.result }
          : { jsonrpc: "2.0", id: e.id, error: t.error }),
        await this._stream.send(n));
    }
    _processResponse(e) {
      const t = "" + e.id,
        n = this._unprocessedResponses.get(t);
      n
        ? (this._unprocessedResponses.delete(t), n(e))
        : this._logger &&
          this._logger.debug({ text: "Got an unexpected response message", message: e });
    }
    _newRequestId() {
      return this._lastUsedRequestId++;
    }
    sendRequest(e, t, n) {
      const i = {
        jsonrpc: "2.0",
        id: this._newRequestId(),
        method: e.method,
        params: e.params || void 0,
      };
      return (
        n && n(i.id),
        new Promise((e, t) => {
          const n = "" + i.id;
          (this._unprocessedResponses.set(n, (n) => {
            "result" in n
              ? e({ result: n.result })
              : (n.error || t(new Error("Response had neither 'result' nor 'error' field set.")),
                e({ error: n.error }));
          }),
            this._stream.send(i).then(void 0, (e) => {
              (this._unprocessedResponses.delete(n), t(e));
            }));
        })
      );
    }
    sendNotification(e, t) {
      const n = { jsonrpc: "2.0", id: void 0, method: e.method, params: e.params || void 0 };
      return this._stream.send(n);
    }
    toString() {
      return "StreamChannel/" + this._stream.toString();
    }
  };
(((GZe = KZe || (KZe = {})).sAny = function () {
  return { deserializeFromJson: (e) => ({ hasErrors: !1, value: e }), serializeToJson: (e) => e };
}),
  (GZe.sEmptyObject = function () {
    return {
      deserializeFromJson: (e) => ({ hasErrors: !1, value: {} }),
      serializeToJson: (e) => ({}),
    };
  }),
  (GZe.sVoidFromNull = function () {
    return {
      deserializeFromJson: (e) => ({ hasErrors: !1, value: void 0 }),
      serializeToJson: (e) => null,
    };
  }));
const YZe = Symbol("OptionalMethodNotFound");
var XZe = class {
    contextualize(e) {
      return new QZe(this, e);
    }
  },
  QZe = class extends XZe {
    constructor(e, t) {
      (super(),
        FZe(this, "underylingTypedChannel"),
        FZe(this, "converters"),
        (this.underylingTypedChannel = e),
        (this.converters = t));
    }
    async request(e, t, n) {
      const i = await this.converters.getSendContext(n);
      return this.underylingTypedChannel.request(e, t, i);
    }
    async notify(e, t, n) {
      const i = await this.converters.getSendContext(n);
      return this.underylingTypedChannel.notify(e, t, i);
    }
    registerNotificationHandler(e, t) {
      return this.underylingTypedChannel.registerNotificationHandler(
        e,
        async (e, n) => await t(e, await this.converters.getNewContext(n)),
      );
    }
    registerRequestHandler(e, t) {
      return this.underylingTypedChannel.registerRequestHandler(
        e,
        async (e, n, i) => await t(e, n, await this.converters.getNewContext(i)),
      );
    }
  },
  JZe = class e extends XZe {
    constructor(e, t = {}) {
      (super(),
        FZe(this, "channelCtor"),
        FZe(this, "_requestSender"),
        FZe(this, "_handler", new Map()),
        FZe(this, "_unknownNotificationHandler", new Set()),
        FZe(this, "_timeout"),
        FZe(this, "sendExceptionDetails", !1),
        FZe(this, "_logger"),
        FZe(this, "listeningDeferred", new HZe()),
        FZe(this, "onListening", this.listeningDeferred.promise),
        FZe(this, "_requestDidErrorEventEmitter", new BZe()),
        FZe(this, "onRequestDidError", this._requestDidErrorEventEmitter.event),
        (this.channelCtor = e),
        (this._logger = t.logger),
        (this.sendExceptionDetails = !!t.sendExceptionDetails),
        (this._timeout = (function (e, t) {
          const n = setTimeout(t, e);
          return { dispose: () => clearTimeout(n) };
        })(1e3, () => {
          this._requestSender;
        })));
    }
    static fromTransport(t, n = {}) {
      return new e(ZZe.createChannel(t, n.logger), n);
    }
    startListen() {
      if (this._requestSender)
        throw new Error(
          `"${this.startListen.name}" can be called only once, but it already has been called.`,
        );
      (this._timeout && (this._timeout.dispose(), (this._timeout = void 0)),
        (this._requestSender = this.channelCtor.connect({
          handleRequest: (e, t, n) => this.handleRequest(e, t, n),
          handleNotification: (e, t) => this.handleNotification(e, t),
        })),
        this.listeningDeferred.resolve());
    }
    checkChannel(e) {
      if (!e)
        throw new Error(
          `"${this.startListen.name}" must be called before any messages can be sent or received.`,
        );
      return !0;
    }
    async handleRequest(e, t, n) {
      const i = this._handler.get(e.method);
      if (!i)
        return (
          this._logger &&
            this._logger.debug({
              text: `No request handler for "${e.method}".`,
              data: { requestObject: e },
            }),
          {
            error: {
              code: PZe.methodNotFound,
              message: `No request handler for "${e.method}".`,
              data: { method: e.method },
            },
          }
        );
      if ("request" != i.kind) {
        const t = `"${e.method}" is registered as notification, but was sent as request.`;
        return (
          this._logger && this._logger.debug({ text: t, data: { requestObject: e } }),
          { error: { code: PZe.invalidRequest, message: t, data: { method: e.method } } }
        );
      }
      const r = i.requestType.paramsSerializer.deserializeFromJson(e.params);
      if (r.hasErrors) {
        const t = `Got invalid params: ${r.errorMessage}`;
        return (
          this._logger &&
            this._logger.debug({
              text: t,
              data: { requestObject: e, errorMessage: r.errorMessage },
            }),
          { error: { code: PZe.invalidParams, message: t, data: { errors: r.errorMessage } } }
        );
      }
      {
        const s = r.value;
        let a;
        try {
          const e = await i.handler(s, t, n);
          if ("error" in e || "errorMessage" in e) {
            const t = e.error ? i.requestType.errorSerializer.serializeToJson(e.error) : void 0;
            a = {
              error: {
                code: e.errorCode || PZe.genericApplicationError,
                message: e.errorMessage || "An error was returned",
                data: t,
              },
            };
          } else a = { result: i.requestType.resultSerializer.serializeToJson(e.ok) };
        } catch (o) {
          o instanceof tYe
            ? (a = { error: { code: o.code, message: o.message } })
            : (this._logger &&
                this._logger.warn({
                  text: `An exception was thrown while handling a request: ${o}.`,
                  exception: o,
                  data: { requestObject: e },
                }),
              (a = {
                error: {
                  code: PZe.unexpectedServerError,
                  message: this.sendExceptionDetails
                    ? `An exception was thrown while handling a request: ${o}.`
                    : "Server has thrown an unexpected exception",
                },
              }));
        }
        return a;
      }
    }
    async handleNotification(e, t) {
      const n = this._handler.get(e.method);
      if (!n) {
        for (const t of this._unknownNotificationHandler) t(e);
        return void (
          0 === this._unknownNotificationHandler.size &&
          this._logger &&
          this._logger.debug({
            text: `Unhandled notification "${e.method}"`,
            data: { requestObject: e },
          })
        );
      }
      if ("notification" != n.kind)
        return void (
          this._logger &&
          this._logger.debug({
            text: `"${e.method}" is registered as request, but was sent as notification.`,
            data: { requestObject: e },
          })
        );
      const i = n.notificationType.paramsSerializer.deserializeFromJson(e.params);
      if (i.hasErrors)
        return void (
          this._logger &&
          this._logger.debug({
            text: `Got invalid params: ${i}`,
            data: { requestObject: e, errorMessage: i.errorMessage },
          })
        );
      const r = i.value;
      for (const s of n.handlers)
        try {
          s(r, t);
        } catch (o) {
          this._logger &&
            this._logger.warn({
              text: `An exception was thrown while handling a notification: ${o}.`,
              exception: o,
              data: { requestObject: e },
            });
        }
    }
    registerUnknownNotificationHandler(e) {
      return WZe(this._unknownNotificationHandler, e);
    }
    registerRequestHandler(e, t) {
      if (this._handler.get(e.method))
        throw new Error(`Handler with method "${e.method}" already registered.`);
      return WZe(this._handler, e.method, { kind: "request", requestType: e, handler: t });
    }
    registerNotificationHandler(e, t) {
      let n = this._handler.get(e.method);
      if (n) {
        if ("notification" !== n.kind)
          throw new Error(`Method "${e.method}" was already registered as request handler.`);
        if (n.notificationType !== e)
          throw new Error(`Method "${e.method}" was registered for a different type.`);
      } else
        ((n = { kind: "notification", notificationType: e, handlers: new Set() }),
          this._handler.set(e.method, n));
      return WZe(n.handlers, t);
    }
    getRegisteredTypes() {
      const e = [];
      for (const t of this._handler.values())
        "notification" === t.kind
          ? e.push(t.notificationType)
          : "request" === t.kind && e.push(t.requestType);
      return e;
    }
    async request(e, t, n) {
      if (!this.checkChannel(this._requestSender)) throw new Error("Impossible");
      const i = e.paramsSerializer.serializeToJson(t);
      eYe(i);
      const r = await this._requestSender.sendRequest({ method: e.method, params: i }, n);
      if ("error" in r) {
        if (e.isOptional && r.error.code === PZe.methodNotFound) return YZe;
        let t;
        if (void 0 !== r.error.data) {
          const n = e.errorSerializer.deserializeFromJson(r.error.data);
          if (n.hasErrors) throw new Error(n.errorMessage);
          t = n.value;
        } else t = void 0;
        const n = new tYe(r.error.message, t, r.error.code);
        throw (this._requestDidErrorEventEmitter.fire({ error: n }), n);
      }
      {
        const t = e.resultSerializer.deserializeFromJson(r.result);
        if (t.hasErrors)
          throw new Error(
            "Could not deserialize response: " +
              t.errorMessage +
              `\n\n${JSON.stringify(r, null, 2)}`,
          );
        return t.value;
      }
    }
    async notify(e, t, n) {
      if (!this.checkChannel(this._requestSender)) throw new Error();
      const i = e.paramsSerializer.serializeToJson(t);
      (eYe(i), this._requestSender.sendNotification({ method: e.method, params: i }, n));
    }
  };
function eYe(e) {
  if (null !== e && Array.isArray(e) && "object" != typeof e)
    throw new Error("Invalid value! Only null, array and object is allowed.");
}
var tYe = class e extends Error {
    constructor(t, n, i = PZe.genericApplicationError) {
      (super(t),
        FZe(this, "data"),
        FZe(this, "code"),
        (this.data = n),
        (this.code = i),
        Object.setPrototypeOf(this, e.prototype));
    }
  },
  nYe = class e {
    constructor(e, t, n, i, r = !1) {
      (FZe(this, "method"),
        FZe(this, "paramsSerializer"),
        FZe(this, "resultSerializer"),
        FZe(this, "errorSerializer"),
        FZe(this, "isOptional"),
        FZe(this, "kind", "request"),
        (this.method = e),
        (this.paramsSerializer = t),
        (this.resultSerializer = n),
        (this.errorSerializer = i),
        (this.isOptional = r));
    }
    withMethod(t) {
      return new e(t, this.paramsSerializer, this.resultSerializer, this.errorSerializer);
    }
    optional() {
      return new e(
        this.method,
        this.paramsSerializer,
        this.resultSerializer,
        this.errorSerializer,
        !0,
      );
    }
  },
  iYe = class e {
    constructor(e, t) {
      (FZe(this, "method"),
        FZe(this, "paramsSerializer"),
        FZe(this, "kind", "notification"),
        (this.method = e),
        (this.paramsSerializer = t));
    }
    withMethod(t) {
      return new e(t, this.paramsSerializer);
    }
  };
function rYe(e) {
  return new nYe((e || {}).method, KZe.sAny(), KZe.sAny(), KZe.sAny());
}
function oYe(e) {
  return new iYe((e || {}).method, KZe.sAny());
}
const sYe = Symbol();
var aYe =
  ((IZe = sYe),
  (RZe = class {
    constructor(e) {
      (FZe(this, "error"), FZe(this, IZe), (this.error = e));
    }
  }),
  FZe(RZe, "factory", (e) => new RZe(e)),
  RZe);
function lYe(e) {
  const t = {};
  for (const [n, i] of Object.entries(e)) {
    const e = i.method ? i.method : n;
    t[n] = i.withMethod(e);
  }
  return t;
}
var cYe = class e {
  constructor(e = [], t, n) {
    (FZe(this, "tags"),
      FZe(this, "server"),
      FZe(this, "client"),
      (this.tags = e),
      (this.server = t),
      (this.client = n));
  }
  _onlyDesignTime() {
    return new Error("This property is not meant to be accessed at runtime");
  }
  get TContractObject() {
    throw this._onlyDesignTime();
  }
  get TClientInterface() {
    throw this._onlyDesignTime();
  }
  get TServerInterface() {
    throw this._onlyDesignTime();
  }
  get TClientHandler() {
    throw this._onlyDesignTime();
  }
  get TServerHandler() {
    throw this._onlyDesignTime();
  }
  get TTags() {
    throw this._onlyDesignTime();
  }
  getInterface(e, t, n, i) {
    const r = this.buildCounterpart(e, n),
      o = this.registerHandlers(e, t, i, r);
    return { counterpart: r, dispose: () => o.dispose() };
  }
  buildCounterpart(e, t) {
    const n = {};
    for (const [i, r] of Object.entries(t)) {
      let t;
      ((t =
        "request" === r.kind
          ? r.isOptional
            ? async (t, n) => {
                void 0 === t && (t = {});
                try {
                  return await e.request(r, t, n);
                } catch (D2t) {
                  if (D2t && D2t.code === PZe.methodNotFound) return YZe;
                  throw D2t;
                }
              }
            : (t, n) => (void 0 === t && (t = {}), e.request(r, t, n))
          : (t, n) => (void 0 === t && (t = {}), e.notify(r, t, n))),
        (n[i] = t));
    }
    return n;
  }
  registerHandlers(e, t, n, i) {
    const r = [];
    for (const [o, s] of Object.entries(t))
      if ("request" === s.kind) {
        let t = n[o];
        if (!t) continue;
        const a = this.createRequestHandler(i, t);
        r.push(e.registerRequestHandler(s, a));
      } else {
        const t = n[o];
        t &&
          r.push(
            e.registerNotificationHandler(s, (e, n) => {
              t(e, { context: n, counterpart: i });
            }),
          );
      }
    return { dispose: () => r.forEach((e) => e.dispose()) };
  }
  createRequestHandler(e, t) {
    return async (n, i, r) => {
      const o = await t(n, { context: r, counterpart: e, newErr: aYe.factory, requestId: i });
      return o instanceof aYe ? o.error : { ok: o };
    };
  }
  static getServerFromStream(e, t, n, i) {
    const r = JZe.fromTransport(t, n),
      { server: o } = e.getServer(r, i);
    return (r.startListen(), { channel: r, server: o });
  }
  static registerServerToStream(e, t, n, i) {
    const r = JZe.fromTransport(t, n),
      { client: o } = e.registerServer(r, i);
    return (r.startListen(), { channel: r, client: o });
  }
  getServer(e, t) {
    const { counterpart: n, dispose: i } = this.getInterface(e, this.client, this.server, t);
    return { server: n, dispose: i };
  }
  registerServer(e, t) {
    const { counterpart: n, dispose: i } = this.getInterface(e, this.server, this.client, t);
    return { client: n, dispose: i };
  }
  withContext() {
    return new e(this.tags, this.server, this.client);
  }
};
let dYe = (function (e) {
    return ((e.Comment = "comment"), (e.Imports = "imports"), (e.Region = "region"), e);
  })({}),
  uYe = (function (e) {
    return (
      (e[(e.File = 1)] = "File"),
      (e[(e.Module = 2)] = "Module"),
      (e[(e.Namespace = 3)] = "Namespace"),
      (e[(e.Package = 4)] = "Package"),
      (e[(e.Class = 5)] = "Class"),
      (e[(e.Method = 6)] = "Method"),
      (e[(e.Property = 7)] = "Property"),
      (e[(e.Field = 8)] = "Field"),
      (e[(e.Constructor = 9)] = "Constructor"),
      (e[(e.Enum = 10)] = "Enum"),
      (e[(e.Interface = 11)] = "Interface"),
      (e[(e.Function = 12)] = "Function"),
      (e[(e.Variable = 13)] = "Variable"),
      (e[(e.Constant = 14)] = "Constant"),
      (e[(e.String = 15)] = "String"),
      (e[(e.Number = 16)] = "Number"),
      (e[(e.Boolean = 17)] = "Boolean"),
      (e[(e.Array = 18)] = "Array"),
      (e[(e.Object = 19)] = "Object"),
      (e[(e.Key = 20)] = "Key"),
      (e[(e.Null = 21)] = "Null"),
      (e[(e.EnumMember = 22)] = "EnumMember"),
      (e[(e.Struct = 23)] = "Struct"),
      (e[(e.Event = 24)] = "Event"),
      (e[(e.Operator = 25)] = "Operator"),
      (e[(e.TypeParameter = 26)] = "TypeParameter"),
      e
    );
  })({}),
  hYe = (function (e) {
    return ((e[(e.Deprecated = 1)] = "Deprecated"), e);
  })({}),
  gYe = (function (e) {
    return ((e[(e.Type = 1)] = "Type"), (e[(e.Parameter = 2)] = "Parameter"), e);
  })({}),
  pYe = (function (e) {
    return (
      (e[(e.None = 0)] = "None"),
      (e[(e.Full = 1)] = "Full"),
      (e[(e.Incremental = 2)] = "Incremental"),
      e
    );
  })({}),
  fYe = (function (e) {
    return (
      (e[(e.Text = 1)] = "Text"),
      (e[(e.Method = 2)] = "Method"),
      (e[(e.Function = 3)] = "Function"),
      (e[(e.Constructor = 4)] = "Constructor"),
      (e[(e.Field = 5)] = "Field"),
      (e[(e.Variable = 6)] = "Variable"),
      (e[(e.Class = 7)] = "Class"),
      (e[(e.Interface = 8)] = "Interface"),
      (e[(e.Module = 9)] = "Module"),
      (e[(e.Property = 10)] = "Property"),
      (e[(e.Unit = 11)] = "Unit"),
      (e[(e.Value = 12)] = "Value"),
      (e[(e.Enum = 13)] = "Enum"),
      (e[(e.Keyword = 14)] = "Keyword"),
      (e[(e.Snippet = 15)] = "Snippet"),
      (e[(e.Color = 16)] = "Color"),
      (e[(e.File = 17)] = "File"),
      (e[(e.Reference = 18)] = "Reference"),
      (e[(e.Folder = 19)] = "Folder"),
      (e[(e.EnumMember = 20)] = "EnumMember"),
      (e[(e.Constant = 21)] = "Constant"),
      (e[(e.Struct = 22)] = "Struct"),
      (e[(e.Event = 23)] = "Event"),
      (e[(e.Operator = 24)] = "Operator"),
      (e[(e.TypeParameter = 25)] = "TypeParameter"),
      e
    );
  })({}),
  mYe = (function (e) {
    return ((e[(e.Deprecated = 1)] = "Deprecated"), e);
  })({}),
  _Ye = (function (e) {
    return ((e[(e.PlainText = 1)] = "PlainText"), (e[(e.Snippet = 2)] = "Snippet"), e);
  })({}),
  vYe = (function (e) {
    return (
      (e[(e.Text = 1)] = "Text"),
      (e[(e.Read = 2)] = "Read"),
      (e[(e.Write = 3)] = "Write"),
      e
    );
  })({}),
  bYe = (function (e) {
    return (
      (e.Empty = ""),
      (e.QuickFix = "quickfix"),
      (e.Refactor = "refactor"),
      (e.RefactorExtract = "refactor.extract"),
      (e.RefactorInline = "refactor.inline"),
      (e.RefactorRewrite = "refactor.rewrite"),
      (e.Source = "source"),
      (e.SourceOrganizeImports = "source.organizeImports"),
      (e.SourceFixAll = "source.fixAll"),
      e
    );
  })({}),
  yYe = (function (e) {
    return ((e.PlainText = "plaintext"), (e.Markdown = "markdown"), e);
  })({}),
  xYe = (function (e) {
    return (
      (e[(e.Error = 1)] = "Error"),
      (e[(e.Warning = 2)] = "Warning"),
      (e[(e.Information = 3)] = "Information"),
      (e[(e.Hint = 4)] = "Hint"),
      e
    );
  })({}),
  wYe = (function (e) {
    return ((e[(e.Unnecessary = 1)] = "Unnecessary"), (e[(e.Deprecated = 2)] = "Deprecated"), e);
  })({}),
  CYe = (function (e) {
    return (
      (e[(e.Invoked = 1)] = "Invoked"),
      (e[(e.TriggerCharacter = 2)] = "TriggerCharacter"),
      (e[(e.TriggerForIncompleteCompletions = 3)] = "TriggerForIncompleteCompletions"),
      e
    );
  })({}),
  SYe = (function (e) {
    return (
      (e[(e.Invoked = 1)] = "Invoked"),
      (e[(e.TriggerCharacter = 2)] = "TriggerCharacter"),
      (e[(e.ContentChange = 3)] = "ContentChange"),
      e
    );
  })({}),
  kYe = (function (e) {
    return ((e[(e.Invoked = 1)] = "Invoked"), (e[(e.Automatic = 2)] = "Automatic"), e);
  })({}),
  EYe = (function (e) {
    return ((e.Relative = "relative"), e);
  })({});
var NYe = class {
  constructor(e) {
    this.method = e;
  }
};
const LYe = {
    textDocumentImplementation: new NYe("textDocument/implementation"),
    textDocumentTypeDefinition: new NYe("textDocument/typeDefinition"),
    textDocumentDocumentColor: new NYe("textDocument/documentColor"),
    textDocumentColorPresentation: new NYe("textDocument/colorPresentation"),
    textDocumentFoldingRange: new NYe("textDocument/foldingRange"),
    textDocumentDeclaration: new NYe("textDocument/declaration"),
    textDocumentSelectionRange: new NYe("textDocument/selectionRange"),
    textDocumentPrepareCallHierarchy: new NYe("textDocument/prepareCallHierarchy"),
    textDocumentSemanticTokensFull: new NYe("textDocument/semanticTokens/full"),
    textDocumentSemanticTokensFullDelta: new NYe("textDocument/semanticTokens/full/delta"),
    textDocumentLinkedEditingRange: new NYe("textDocument/linkedEditingRange"),
    workspaceWillCreateFiles: new NYe("workspace/willCreateFiles"),
    workspaceWillRenameFiles: new NYe("workspace/willRenameFiles"),
    workspaceWillDeleteFiles: new NYe("workspace/willDeleteFiles"),
    textDocumentMoniker: new NYe("textDocument/moniker"),
    textDocumentPrepareTypeHierarchy: new NYe("textDocument/prepareTypeHierarchy"),
    textDocumentInlineValue: new NYe("textDocument/inlineValue"),
    textDocumentInlayHint: new NYe("textDocument/inlayHint"),
    textDocumentDiagnostic: new NYe("textDocument/diagnostic"),
    textDocumentInlineCompletion: new NYe("textDocument/inlineCompletion"),
    textDocumentWillSaveWaitUntil: new NYe("textDocument/willSaveWaitUntil"),
    textDocumentCompletion: new NYe("textDocument/completion"),
    textDocumentHover: new NYe("textDocument/hover"),
    textDocumentSignatureHelp: new NYe("textDocument/signatureHelp"),
    textDocumentDefinition: new NYe("textDocument/definition"),
    textDocumentReferences: new NYe("textDocument/references"),
    textDocumentDocumentHighlight: new NYe("textDocument/documentHighlight"),
    textDocumentDocumentSymbol: new NYe("textDocument/documentSymbol"),
    textDocumentCodeAction: new NYe("textDocument/codeAction"),
    workspaceSymbol: new NYe("workspace/symbol"),
    textDocumentCodeLens: new NYe("textDocument/codeLens"),
    textDocumentDocumentLink: new NYe("textDocument/documentLink"),
    textDocumentFormatting: new NYe("textDocument/formatting"),
    textDocumentRangeFormatting: new NYe("textDocument/rangeFormatting"),
    textDocumentRangesFormatting: new NYe("textDocument/rangesFormatting"),
    textDocumentOnTypeFormatting: new NYe("textDocument/onTypeFormatting"),
    textDocumentRename: new NYe("textDocument/rename"),
    workspaceExecuteCommand: new NYe("workspace/executeCommand"),
    workspaceDidCreateFiles: new NYe("workspace/didCreateFiles"),
    workspaceDidRenameFiles: new NYe("workspace/didRenameFiles"),
    workspaceDidDeleteFiles: new NYe("workspace/didDeleteFiles"),
    workspaceDidChangeConfiguration: new NYe("workspace/didChangeConfiguration"),
    textDocumentDidOpen: new NYe("textDocument/didOpen"),
    textDocumentDidChange: new NYe("textDocument/didChange"),
    textDocumentDidClose: new NYe("textDocument/didClose"),
    textDocumentDidSave: new NYe("textDocument/didSave"),
    textDocumentWillSave: new NYe("textDocument/willSave"),
    workspaceDidChangeWatchedFiles: new NYe("workspace/didChangeWatchedFiles"),
  },
  DYe = (function (e) {
    const t = lYe(e.server),
      n = lYe(e.client);
    return new cYe(e.tags || [], t, n);
  })({
    server: {
      textDocumentImplementation: rYe({ method: "textDocument/implementation" }),
      textDocumentTypeDefinition: rYe({ method: "textDocument/typeDefinition" }),
      textDocumentDocumentColor: rYe({ method: "textDocument/documentColor" }),
      textDocumentColorPresentation: rYe({ method: "textDocument/colorPresentation" }),
      textDocumentFoldingRange: rYe({ method: "textDocument/foldingRange" }),
      textDocumentDeclaration: rYe({ method: "textDocument/declaration" }),
      textDocumentSelectionRange: rYe({ method: "textDocument/selectionRange" }),
      textDocumentPrepareCallHierarchy: rYe({ method: "textDocument/prepareCallHierarchy" }),
      callHierarchyIncomingCalls: rYe({ method: "callHierarchy/incomingCalls" }),
      callHierarchyOutgoingCalls: rYe({ method: "callHierarchy/outgoingCalls" }),
      textDocumentSemanticTokensFull: rYe({ method: "textDocument/semanticTokens/full" }),
      textDocumentSemanticTokensFullDelta: rYe({
        method: "textDocument/semanticTokens/full/delta",
      }),
      textDocumentSemanticTokensRange: rYe({ method: "textDocument/semanticTokens/range" }),
      textDocumentLinkedEditingRange: rYe({ method: "textDocument/linkedEditingRange" }),
      workspaceWillCreateFiles: rYe({ method: "workspace/willCreateFiles" }),
      workspaceWillRenameFiles: rYe({ method: "workspace/willRenameFiles" }),
      workspaceWillDeleteFiles: rYe({ method: "workspace/willDeleteFiles" }),
      textDocumentMoniker: rYe({ method: "textDocument/moniker" }),
      textDocumentPrepareTypeHierarchy: rYe({ method: "textDocument/prepareTypeHierarchy" }),
      typeHierarchySupertypes: rYe({ method: "typeHierarchy/supertypes" }),
      typeHierarchySubtypes: rYe({ method: "typeHierarchy/subtypes" }),
      textDocumentInlineValue: rYe({ method: "textDocument/inlineValue" }),
      textDocumentInlayHint: rYe({ method: "textDocument/inlayHint" }),
      inlayHintResolve: rYe({ method: "inlayHint/resolve" }),
      textDocumentDiagnostic: rYe({ method: "textDocument/diagnostic" }),
      workspaceDiagnostic: rYe({ method: "workspace/diagnostic" }),
      textDocumentInlineCompletion: rYe({ method: "textDocument/inlineCompletion" }),
      initialize: rYe({ method: "initialize" }),
      shutdown: rYe({ method: "shutdown" }),
      textDocumentWillSaveWaitUntil: rYe({ method: "textDocument/willSaveWaitUntil" }),
      textDocumentCompletion: rYe({ method: "textDocument/completion" }),
      completionItemResolve: rYe({ method: "completionItem/resolve" }),
      textDocumentHover: rYe({ method: "textDocument/hover" }),
      textDocumentSignatureHelp: rYe({ method: "textDocument/signatureHelp" }),
      textDocumentDefinition: rYe({ method: "textDocument/definition" }),
      textDocumentReferences: rYe({ method: "textDocument/references" }),
      textDocumentDocumentHighlight: rYe({ method: "textDocument/documentHighlight" }),
      textDocumentDocumentSymbol: rYe({ method: "textDocument/documentSymbol" }),
      textDocumentCodeAction: rYe({ method: "textDocument/codeAction" }),
      codeActionResolve: rYe({ method: "codeAction/resolve" }),
      workspaceSymbol: rYe({ method: "workspace/symbol" }),
      workspaceSymbolResolve: rYe({ method: "workspaceSymbol/resolve" }),
      textDocumentCodeLens: rYe({ method: "textDocument/codeLens" }),
      codeLensResolve: rYe({ method: "codeLens/resolve" }),
      textDocumentDocumentLink: rYe({ method: "textDocument/documentLink" }),
      documentLinkResolve: rYe({ method: "documentLink/resolve" }),
      textDocumentFormatting: rYe({ method: "textDocument/formatting" }),
      textDocumentRangeFormatting: rYe({ method: "textDocument/rangeFormatting" }),
      textDocumentRangesFormatting: rYe({ method: "textDocument/rangesFormatting" }),
      textDocumentOnTypeFormatting: rYe({ method: "textDocument/onTypeFormatting" }),
      textDocumentRename: rYe({ method: "textDocument/rename" }),
      textDocumentPrepareRename: rYe({ method: "textDocument/prepareRename" }),
      workspaceExecuteCommand: rYe({ method: "workspace/executeCommand" }),
      workspaceDidChangeWorkspaceFolders: oYe({ method: "workspace/didChangeWorkspaceFolders" }),
      windowWorkDoneProgressCancel: oYe({ method: "window/workDoneProgress/cancel" }),
      workspaceDidCreateFiles: oYe({ method: "workspace/didCreateFiles" }),
      workspaceDidRenameFiles: oYe({ method: "workspace/didRenameFiles" }),
      workspaceDidDeleteFiles: oYe({ method: "workspace/didDeleteFiles" }),
      notebookDocumentDidOpen: oYe({ method: "notebookDocument/didOpen" }),
      notebookDocumentDidChange: oYe({ method: "notebookDocument/didChange" }),
      notebookDocumentDidSave: oYe({ method: "notebookDocument/didSave" }),
      notebookDocumentDidClose: oYe({ method: "notebookDocument/didClose" }),
      initialized: oYe({ method: "initialized" }),
      exit: oYe({ method: "exit" }),
      workspaceDidChangeConfiguration: oYe({ method: "workspace/didChangeConfiguration" }),
      textDocumentDidOpen: oYe({ method: "textDocument/didOpen" }),
      textDocumentDidChange: oYe({ method: "textDocument/didChange" }),
      textDocumentDidClose: oYe({ method: "textDocument/didClose" }),
      textDocumentDidSave: oYe({ method: "textDocument/didSave" }),
      textDocumentWillSave: oYe({ method: "textDocument/willSave" }),
      workspaceDidChangeWatchedFiles: oYe({ method: "workspace/didChangeWatchedFiles" }),
      setTrace: oYe({ method: "$/setTrace" }),
      cancelRequest: oYe({ method: "$/cancelRequest" }),
      progress: oYe({ method: "$/progress" }),
    },
    client: {
      workspaceWorkspaceFolders: rYe({ method: "workspace/workspaceFolders" }).optional(),
      workspaceConfiguration: rYe({ method: "workspace/configuration" }).optional(),
      workspaceFoldingRangeRefresh: rYe({ method: "workspace/foldingRange/refresh" }).optional(),
      windowWorkDoneProgressCreate: rYe({ method: "window/workDoneProgress/create" }).optional(),
      workspaceSemanticTokensRefresh: rYe({
        method: "workspace/semanticTokens/refresh",
      }).optional(),
      windowShowDocument: rYe({ method: "window/showDocument" }).optional(),
      workspaceInlineValueRefresh: rYe({ method: "workspace/inlineValue/refresh" }).optional(),
      workspaceInlayHintRefresh: rYe({ method: "workspace/inlayHint/refresh" }).optional(),
      workspaceDiagnosticRefresh: rYe({ method: "workspace/diagnostic/refresh" }).optional(),
      clientRegisterCapability: rYe({ method: "client/registerCapability" }).optional(),
      clientUnregisterCapability: rYe({ method: "client/unregisterCapability" }).optional(),
      windowShowMessageRequest: rYe({ method: "window/showMessageRequest" }).optional(),
      workspaceCodeLensRefresh: rYe({ method: "workspace/codeLens/refresh" }).optional(),
      workspaceApplyEdit: rYe({ method: "workspace/applyEdit" }).optional(),
      windowShowMessage: oYe({ method: "window/showMessage" }),
      windowLogMessage: oYe({ method: "window/logMessage" }),
      telemetryEvent: oYe({ method: "telemetry/event" }),
      textDocumentPublishDiagnostics: oYe({ method: "textDocument/publishDiagnostics" }),
      logTrace: oYe({ method: "$/logTrace" }),
      cancelRequest: oYe({ method: "$/cancelRequest" }),
      progress: oYe({ method: "$/progress" }),
    },
  });
function TYe(e, t) {
  if (e.textModel !== t) throw new Error(`Expected text model to be ${t}, but got ${e.textModel}`);
  return e;
}
var IYe =
    ((OZe = class {
      constructor() {
        FZe(this, "_store", new RYe());
      }
      dispose() {
        this._store.dispose();
      }
      _register(e) {
        if (e === this) throw new Error("Cannot register a disposable on itself!");
        return this._store.add(e);
      }
    }),
    FZe(OZe, "None", Object.freeze({ dispose() {} })),
    OZe),
  RYe =
    ((MZe = class {
      constructor() {
        (FZe(this, "_toDispose", new Set()), FZe(this, "_isDisposed", !1));
      }
      dispose() {
        this._isDisposed || ((this._isDisposed = !0), this.clear());
      }
      clear() {
        if (0 !== this._toDispose.size)
          try {
            for (const e of this._toDispose) e.dispose();
          } finally {
            this._toDispose.clear();
          }
      }
      add(e) {
        if (!e) return e;
        if (e === this) throw new Error("Cannot register a disposable on itself!");
        return (this._isDisposed ? MZe.DISABLE_DISPOSED_WARNING : this._toDispose.add(e), e);
      }
    }),
    FZe(MZe, "DISABLE_DISPOSED_WARNING", !1),
    MZe);
const OYe = new Map([
  [bYe.Empty, ""],
  [bYe.QuickFix, "quickfix"],
  [bYe.Refactor, "refactor"],
  [bYe.RefactorExtract, "refactor.extract"],
  [bYe.RefactorInline, "refactor.inline"],
  [bYe.RefactorRewrite, "refactor.rewrite"],
  [bYe.Source, "source"],
  [bYe.SourceOrganizeImports, "source.organizeImports"],
  [bYe.SourceFixAll, "source.fixAll"],
]);
function MYe(e) {
  if (e) return OYe.get(e) ?? e;
}
const AYe = new Map([
  [VGe.CodeActionTriggerType.Invoke, kYe.Invoked],
  [VGe.CodeActionTriggerType.Auto, kYe.Automatic],
]);
const PYe = new Map([
  [fYe.Text, VGe.CompletionItemKind.Text],
  [fYe.Method, VGe.CompletionItemKind.Method],
  [fYe.Function, VGe.CompletionItemKind.Function],
  [fYe.Constructor, VGe.CompletionItemKind.Constructor],
  [fYe.Field, VGe.CompletionItemKind.Field],
  [fYe.Variable, VGe.CompletionItemKind.Variable],
  [fYe.Class, VGe.CompletionItemKind.Class],
  [fYe.Interface, VGe.CompletionItemKind.Interface],
  [fYe.Module, VGe.CompletionItemKind.Module],
  [fYe.Property, VGe.CompletionItemKind.Property],
  [fYe.Unit, VGe.CompletionItemKind.Unit],
  [fYe.Value, VGe.CompletionItemKind.Value],
  [fYe.Enum, VGe.CompletionItemKind.Enum],
  [fYe.Keyword, VGe.CompletionItemKind.Keyword],
  [fYe.Snippet, VGe.CompletionItemKind.Snippet],
  [fYe.Color, VGe.CompletionItemKind.Color],
  [fYe.File, VGe.CompletionItemKind.File],
  [fYe.Reference, VGe.CompletionItemKind.Reference],
  [fYe.Folder, VGe.CompletionItemKind.Folder],
  [fYe.EnumMember, VGe.CompletionItemKind.EnumMember],
  [fYe.Constant, VGe.CompletionItemKind.Constant],
  [fYe.Struct, VGe.CompletionItemKind.Struct],
  [fYe.Event, VGe.CompletionItemKind.Event],
  [fYe.Operator, VGe.CompletionItemKind.Operator],
  [fYe.TypeParameter, VGe.CompletionItemKind.TypeParameter],
]);
const jYe = new Map([[mYe.Deprecated, VGe.CompletionItemTag.Deprecated]]);
function FYe(e) {
  return jYe.get(e);
}
const BYe = new Map([
  [VGe.CompletionTriggerKind.Invoke, CYe.Invoked],
  [VGe.CompletionTriggerKind.TriggerCharacter, CYe.TriggerCharacter],
  [VGe.CompletionTriggerKind.TriggerForIncompleteCompletions, CYe.TriggerForIncompleteCompletions],
]);
const VYe = new Map([[_Ye.Snippet, VGe.CompletionItemInsertTextRule.InsertAsSnippet]]);
const WYe = new Map([
  [uYe.File, VGe.SymbolKind.File],
  [uYe.Module, VGe.SymbolKind.Module],
  [uYe.Namespace, VGe.SymbolKind.Namespace],
  [uYe.Package, VGe.SymbolKind.Package],
  [uYe.Class, VGe.SymbolKind.Class],
  [uYe.Method, VGe.SymbolKind.Method],
  [uYe.Property, VGe.SymbolKind.Property],
  [uYe.Field, VGe.SymbolKind.Field],
  [uYe.Constructor, VGe.SymbolKind.Constructor],
  [uYe.Enum, VGe.SymbolKind.Enum],
  [uYe.Interface, VGe.SymbolKind.Interface],
  [uYe.Function, VGe.SymbolKind.Function],
  [uYe.Variable, VGe.SymbolKind.Variable],
  [uYe.Constant, VGe.SymbolKind.Constant],
  [uYe.String, VGe.SymbolKind.String],
  [uYe.Number, VGe.SymbolKind.Number],
  [uYe.Boolean, VGe.SymbolKind.Boolean],
  [uYe.Array, VGe.SymbolKind.Array],
  [uYe.Object, VGe.SymbolKind.Object],
  [uYe.Key, VGe.SymbolKind.Key],
  [uYe.Null, VGe.SymbolKind.Null],
  [uYe.EnumMember, VGe.SymbolKind.EnumMember],
  [uYe.Struct, VGe.SymbolKind.Struct],
  [uYe.Event, VGe.SymbolKind.Event],
  [uYe.Operator, VGe.SymbolKind.Operator],
  [uYe.TypeParameter, VGe.SymbolKind.TypeParameter],
]);
function HYe(e) {
  return WYe.get(e) ?? VGe.SymbolKind.File;
}
const zYe = new Map([[hYe.Deprecated, VGe.SymbolTag.Deprecated]]);
function UYe(e) {
  return zYe.get(e);
}
const $Ye = new Map([
  [vYe.Text, VGe.DocumentHighlightKind.Text],
  [vYe.Read, VGe.DocumentHighlightKind.Read],
  [vYe.Write, VGe.DocumentHighlightKind.Write],
]);
const qYe = new Map([
  [dYe.Comment, VGe.FoldingRangeKind.Comment],
  [dYe.Imports, VGe.FoldingRangeKind.Imports],
  [dYe.Region, VGe.FoldingRangeKind.Region],
]);
function KYe(e) {
  if (e) return qYe.get(e);
}
const GYe = new Map([
  [AGe.Error, xYe.Error],
  [AGe.Warning, xYe.Warning],
  [AGe.Info, xYe.Information],
  [AGe.Hint, xYe.Hint],
]);
const ZYe = new Map([
  [xYe.Error, AGe.Error],
  [xYe.Warning, AGe.Warning],
  [xYe.Information, AGe.Info],
  [xYe.Hint, AGe.Hint],
]);
const YYe = new Map([
  [wYe.Unnecessary, PGe.Unnecessary],
  [wYe.Deprecated, PGe.Deprecated],
]);
const XYe = new Map([
  [VGe.SignatureHelpTriggerKind.Invoke, SYe.Invoked],
  [VGe.SignatureHelpTriggerKind.TriggerCharacter, SYe.TriggerCharacter],
  [VGe.SignatureHelpTriggerKind.ContentChange, SYe.ContentChange],
]);
function QYe(e) {
  if (e) return { id: e.command, title: e.title, arguments: e.arguments };
}
const JYe = new Map([
  [gYe.Type, VGe.InlayHintKind.Type],
  [gYe.Parameter, VGe.InlayHintKind.Parameter],
]);
function eXe(e, t) {
  if ("targetUri" in e) {
    const n = t.bridge.translateBackRange({ uri: e.targetUri }, e.targetRange);
    return {
      uri: n.textModel.uri,
      range: n.range,
      originSelectionRange: e.originSelectionRange
        ? t.bridge.translateBackRange({ uri: e.targetUri }, e.originSelectionRange).range
        : void 0,
      targetSelectionRange: e.targetSelectionRange
        ? t.bridge.translateBackRange({ uri: e.targetUri }, e.targetSelectionRange).range
        : void 0,
    };
  }
  {
    const n = t.bridge.translateBackRange({ uri: e.uri }, e.range);
    return { uri: n.textModel.uri, range: n.range };
  }
}
function tXe(e) {
  return e && 0 !== e.length
    ? e.map((e) =>
        "notebook" in e
          ? "string" == typeof e.notebook
            ? { notebookType: e.notebook, language: e.language }
            : {
                notebookType: e.notebook.notebookType,
                language: e.language,
                pattern: e.notebook.pattern,
                scheme: e.notebook.scheme,
              }
          : { language: e.language, pattern: e.pattern, scheme: e.scheme },
      )
    : { language: "*" };
}
function nXe(e) {
  const t = {
    severity: ((n = e.severity), n ? (ZYe.get(n) ?? AGe.Error) : AGe.Error),
    startLineNumber: e.range.start.line + 1,
    startColumn: e.range.start.character + 1,
    endLineNumber: e.range.end.line + 1,
    endColumn: e.range.end.character + 1,
    message: e.message,
    source: e.source,
    code: "string" == typeof e.code ? e.code : e.code?.toString(),
  };
  var n;
  return (
    e.tags &&
      (t.tags = e.tags
        .map((e) =>
          (function (e) {
            return YYe.get(e);
          })(e),
        )
        .filter((e) => void 0 !== e)),
    e.relatedInformation &&
      (t.relatedInformation = e.relatedInformation.map((e) => ({
        resource: jGe.parse(e.location.uri),
        startLineNumber: e.location.range.start.line + 1,
        startColumn: e.location.range.start.character + 1,
        endLineNumber: e.location.range.end.line + 1,
        endColumn: e.location.range.end.character + 1,
        message: e.message,
      }))),
    t
  );
}
var iXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: {
              completion: {
                dynamicRegistration: !0,
                contextSupport: !0,
                completionItemKind: { valueSet: Array.from(PYe.keys()) },
                completionItem: {
                  tagSupport: { valueSet: Array.from(jYe.keys()) },
                  commitCharactersSupport: !0,
                  deprecatedSupport: !0,
                  preselectSupport: !0,
                },
              },
            },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentCompletion,
            !0,
            (e) =>
              VGe.registerCompletionItemProvider(
                tXe(e.documentSelector),
                new rXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  rXe = class {
    constructor(e, t) {
      (FZe(this, "resolveCompletionItem"),
        (this._client = e),
        (this._capabilities = t),
        t.resolveProvider &&
          (this.resolveCompletionItem = async (e, t) => (
            sXe(
              e,
              await this._client.server.completionItemResolve(e._lspItem),
              this._client.bridge,
              e._translated,
              e._model,
            ),
            e
          )));
    }
    get triggerCharacters() {
      return this._capabilities.triggerCharacters;
    }
    async provideCompletionItems(e, t, n, i) {
      const r = this._client.bridge.translate(e, t),
        o = await this._client.server.textDocumentCompletion({
          textDocument: r.textDocument,
          position: r.position,
          context: n.triggerCharacter
            ? {
                triggerKind: ((s = n.triggerKind), BYe.get(s) ?? CYe.Invoked),
                triggerCharacter: n.triggerCharacter,
              }
            : void 0,
        });
      var s;
      return o
        ? {
            suggestions: (Array.isArray(o) ? o : o.items).map((n) => ({
              ...oXe(n, this._client.bridge, r, e, t),
              _lspItem: n,
              _translated: r,
              _model: e,
            })),
          }
        : { suggestions: [] };
    }
  };
function oXe(e, t, n, i, r) {
  let o,
    s = e.insertText || e.label;
  (e.textEdit &&
    ("range" in e.textEdit
      ? ((s = e.textEdit.newText),
        (o = TYe(t.translateBackRange(n.textDocument, e.textEdit.range), i).range))
      : ((s = e.textEdit.newText),
        (o = {
          insert: TYe(t.translateBackRange(n.textDocument, e.textEdit.insert), i).range,
          replace: TYe(t.translateBackRange(n.textDocument, e.textEdit.replace), i).range,
        }))),
    o || (o = RGe.fromPositions(r, r)));
  const a = {
    label: e.label,
    kind:
      ((l = e.kind), l ? (PYe.get(l) ?? VGe.CompletionItemKind.Text) : VGe.CompletionItemKind.Text),
    insertText: s,
    sortText: e.sortText,
    filterText: e.filterText,
    preselect: e.preselect,
    commitCharacters: e.commitCharacters,
    range: o,
  };
  var l;
  return (sXe(a, e, t, n, i), a);
}
function sXe(e, t, n, i, r) {
  var o;
  (void 0 !== t.detail && (e.detail = t.detail),
    void 0 !== t.documentation &&
      (e.documentation = (o = t.documentation)
        ? "string" == typeof o
          ? o
          : { value: o.value, isTrusted: !0 }
        : void 0),
    void 0 !== t.insertTextFormat &&
      (e.insertTextRules = (function (e) {
        if (e) return VYe.get(e);
      })(t.insertTextFormat)),
    t.tags && t.tags.length > 0 && (e.tags = t.tags.map(FYe).filter((e) => void 0 !== e)),
    t.additionalTextEdits &&
      t.additionalTextEdits.length > 0 &&
      (e.additionalTextEdits = t.additionalTextEdits.map((e) => ({
        range: TYe(n.translateBackRange(i.textDocument, e.range), r).range,
        text: e.newText,
      }))),
    t.command && (e.command = QYe(t.command)));
}
var aXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: {
              hover: { dynamicRegistration: !0, contentFormat: [yYe.Markdown, yYe.PlainText] },
            },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(LYe.textDocumentHover, !0, (e) =>
            VGe.registerHoverProvider(tXe(e.documentSelector), new lXe(this._connection, e)),
          ),
        ));
    }
  },
  lXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideHover(e, t, n) {
      const i = this._client.bridge.translate(e, t),
        r = await this._client.server.textDocumentHover({
          textDocument: i.textDocument,
          position: i.position,
        });
      return r && r.contents
        ? {
            contents: cXe(r.contents),
            range: r.range
              ? this._client.bridge.translateBackRange(i.textDocument, r.range).range
              : void 0,
          }
        : null;
    }
  };
function cXe(e) {
  return Array.isArray(e) ? e.map((e) => dXe(e)) : [dXe(e)];
}
function dXe(e) {
  return "string" == typeof e
    ? { value: e, isTrusted: !0 }
    : "kind" in e
      ? { value: e.value, isTrusted: !0 }
      : { value: `\`\`\`${e.language}\n${e.value}\n\`\`\``, isTrusted: !0 };
}
var uXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: {
              signatureHelp: {
                dynamicRegistration: !0,
                contextSupport: !0,
                signatureInformation: {
                  documentationFormat: [yYe.Markdown, yYe.PlainText],
                  parameterInformation: { labelOffsetSupport: !0 },
                  activeParameterSupport: !0,
                },
              },
            },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentSignatureHelp,
            !0,
            (e) =>
              VGe.registerSignatureHelpProvider(
                tXe(e.documentSelector),
                new hXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  hXe = class {
    constructor(e, t) {
      (FZe(this, "signatureHelpTriggerCharacters"),
        FZe(this, "signatureHelpRetriggerCharacters"),
        (this._client = e),
        (this._capabilities = t),
        (this.signatureHelpTriggerCharacters = t.triggerCharacters),
        (this.signatureHelpRetriggerCharacters = t.retriggerCharacters));
    }
    async provideSignatureHelp(e, t, n, i) {
      const r = this._client.bridge.translate(e, t),
        o = await this._client.server.textDocumentSignatureHelp({
          textDocument: r.textDocument,
          position: r.position,
          context: {
            triggerKind: ((s = i.triggerKind), XYe.get(s) ?? SYe.Invoked),
            triggerCharacter: i.triggerCharacter,
            isRetrigger: i.isRetrigger,
          },
        });
      var s;
      return o
        ? {
            value: {
              signatures: o.signatures.map((e) => ({
                label: e.label,
                documentation: gXe(e.documentation),
                parameters:
                  e.parameters?.map((e) => ({
                    label: e.label,
                    documentation: gXe(e.documentation),
                  })) || [],
                activeParameter: e.activeParameter,
              })),
              activeSignature: o.activeSignature || 0,
              activeParameter: o.activeParameter || 0,
            },
            dispose: () => {},
          }
        : null;
    }
  };
function gXe(e) {
  if (e) return "string" == typeof e ? e : { value: e.value, isTrusted: !0 };
}
var pXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { definition: { dynamicRegistration: !0, linkSupport: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentDefinition,
            !0,
            (e) =>
              VGe.registerDefinitionProvider(tXe(e.documentSelector), new fXe(this._connection, e)),
          ),
        ));
    }
  },
  fXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideDefinition(e, t, n) {
      const i = this._client.bridge.translate(e, t),
        r = await this._client.server.textDocumentDefinition({
          textDocument: i.textDocument,
          position: i.position,
        });
      return r
        ? Array.isArray(r)
          ? r.map((e) => eXe(e, this._client))
          : eXe(r, this._client)
        : null;
    }
  },
  mXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { declaration: { dynamicRegistration: !0, linkSupport: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentDeclaration,
            !0,
            (e) =>
              VGe.registerDeclarationProvider(
                tXe(e.documentSelector),
                new _Xe(this._connection, e),
              ),
          ),
        ));
    }
  },
  _Xe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideDeclaration(e, t, n) {
      const i = this._client.bridge.translate(e, t),
        r = await this._client.server.textDocumentDeclaration({
          textDocument: i.textDocument,
          position: i.position,
        });
      return r
        ? Array.isArray(r)
          ? r.map((e) => eXe(e, this._client))
          : eXe(r, this._client)
        : null;
    }
  },
  vXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { typeDefinition: { dynamicRegistration: !0, linkSupport: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentTypeDefinition,
            !0,
            (e) =>
              VGe.registerTypeDefinitionProvider(
                tXe(e.documentSelector),
                new bXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  bXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideTypeDefinition(e, t, n) {
      const i = this._client.bridge.translate(e, t),
        r = await this._client.server.textDocumentTypeDefinition({
          textDocument: i.textDocument,
          position: i.position,
        });
      return r
        ? Array.isArray(r)
          ? r.map((e) => eXe(e, this._client))
          : eXe(r, this._client)
        : null;
    }
  },
  yXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { implementation: { dynamicRegistration: !0, linkSupport: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentImplementation,
            !0,
            (e) =>
              VGe.registerImplementationProvider(
                tXe(e.documentSelector),
                new xXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  xXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideImplementation(e, t, n) {
      const i = this._client.bridge.translate(e, t),
        r = await this._client.server.textDocumentImplementation({
          textDocument: i.textDocument,
          position: i.position,
        });
      return r
        ? Array.isArray(r)
          ? r.map((e) => eXe(e, this._client))
          : eXe(r, this._client)
        : null;
    }
  },
  wXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { references: { dynamicRegistration: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentReferences,
            !0,
            (e) =>
              VGe.registerReferenceProvider(tXe(e.documentSelector), new CXe(this._connection, e)),
          ),
        ));
    }
  },
  CXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideReferences(e, t, n, i) {
      const r = this._client.bridge.translate(e, t),
        o = await this._client.server.textDocumentReferences({
          textDocument: r.textDocument,
          position: r.position,
          context: { includeDeclaration: n.includeDeclaration },
        });
      return o
        ? o.map((e) => {
            const t = this._client.bridge.translateBackRange({ uri: e.uri }, e.range);
            return { uri: t.textModel.uri, range: t.range };
          })
        : null;
    }
  },
  SXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { documentHighlight: { dynamicRegistration: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentDocumentHighlight,
            !0,
            (e) =>
              VGe.registerDocumentHighlightProvider(
                tXe(e.documentSelector),
                new kXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  kXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideDocumentHighlights(e, t, n) {
      const i = this._client.bridge.translate(e, t),
        r = await this._client.server.textDocumentDocumentHighlight({
          textDocument: i.textDocument,
          position: i.position,
        });
      return r
        ? r.map((e) => {
            return {
              range: this._client.bridge.translateBackRange(i.textDocument, e.range).range,
              kind:
                ((t = e.kind),
                t
                  ? ($Ye.get(t) ?? VGe.DocumentHighlightKind.Text)
                  : VGe.DocumentHighlightKind.Text),
            };
            var t;
          })
        : null;
    }
  },
  EXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: {
              documentSymbol: {
                dynamicRegistration: !0,
                hierarchicalDocumentSymbolSupport: !0,
                symbolKind: { valueSet: Array.from(WYe.keys()) },
                tagSupport: { valueSet: [hYe.Deprecated] },
              },
            },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentDocumentSymbol,
            !0,
            (e) =>
              VGe.registerDocumentSymbolProvider(
                tXe(e.documentSelector),
                new NXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  NXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideDocumentSymbols(e, t) {
      const n = this._client.bridge.translate(e, new IGe(1, 1)),
        i = await this._client.server.textDocumentDocumentSymbol({ textDocument: n.textDocument });
      return i
        ? Array.isArray(i) && i.length > 0
          ? "location" in i[0]
            ? i.map((e) =>
                (function (e, t) {
                  return {
                    name: e.name,
                    detail: "",
                    kind: HYe(e.kind),
                    tags: e.tags?.map((e) => UYe(e)).filter((e) => void 0 !== e) || [],
                    range: t.bridge.translateBackRange({ uri: e.location.uri }, e.location.range)
                      .range,
                    selectionRange: t.bridge.translateBackRange(
                      { uri: e.location.uri },
                      e.location.range,
                    ).range,
                    children: [],
                  };
                })(e, this._client),
              )
            : i.map((e) => LXe(e, this._client, n.textDocument))
          : []
        : null;
    }
  };
function LXe(e, t, n) {
  return {
    name: e.name,
    detail: e.detail || "",
    kind: HYe(e.kind),
    tags: e.tags?.map((e) => UYe(e)).filter((e) => void 0 !== e) || [],
    range: t.bridge.translateBackRange(n, e.range).range,
    selectionRange: t.bridge.translateBackRange(n, e.selectionRange).range,
    children: e.children?.map((e) => LXe(e, t, n)) || [],
  };
}
var DXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { rename: { dynamicRegistration: !0, prepareSupport: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(LYe.textDocumentRename, !0, (e) =>
            VGe.registerRenameProvider(tXe(e.documentSelector), new TXe(this._connection, e)),
          ),
        ));
    }
  },
  TXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideRenameEdits(e, t, n, i) {
      const r = this._client.bridge.translate(e, t),
        o = await this._client.server.textDocumentRename({
          textDocument: r.textDocument,
          position: r.position,
          newName: n,
        });
      return o
        ? (function (e, t) {
            const n = [];
            if (e.changes)
              for (const i in e.changes) {
                const r = e.changes[i];
                for (const e of r) {
                  const r = t.bridge.translateBackRange({ uri: i }, e.range);
                  n.push({
                    resource: r.textModel.uri,
                    versionId: void 0,
                    textEdit: { range: r.range, text: e.newText },
                  });
                }
              }
            if (e.documentChanges)
              for (const i of e.documentChanges)
                if ("textDocument" in i) {
                  const e = i.textDocument.uri;
                  for (const r of i.edits) {
                    const o = t.bridge.translateBackRange({ uri: e }, r.range);
                    n.push({
                      resource: o.textModel.uri,
                      versionId: i.textDocument.version,
                      textEdit: { range: o.range, text: r.newText },
                    });
                  }
                }
            return { edits: n };
          })(o, this._client)
        : null;
    }
    async resolveRenameLocation(e, t, n) {
      if (!this._capabilities.prepareProvider) return null;
      const i = this._client.bridge.translate(e, t),
        r = await this._client.server.textDocumentPrepareRename({
          textDocument: i.textDocument,
          position: i.position,
        });
      if (!r) return null;
      if ("range" in r && "placeholder" in r)
        return {
          range: this._client.bridge.translateBackRange(i.textDocument, r.range).range,
          text: r.placeholder,
        };
      if ("defaultBehavior" in r) return null;
      if ("start" in r && "end" in r) {
        const t = this._client.bridge.translateBackRange(i.textDocument, r).range;
        return { range: t, text: e.getValueInRange(t) };
      }
      return null;
    }
  };
var IXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: {
              codeAction: {
                dynamicRegistration: !0,
                codeActionLiteralSupport: { codeActionKind: { valueSet: Array.from(OYe.keys()) } },
                isPreferredSupport: !0,
                disabledSupport: !0,
                dataSupport: !0,
                resolveSupport: { properties: ["edit"] },
              },
            },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentCodeAction,
            !0,
            (e) =>
              VGe.registerCodeActionProvider(tXe(e.documentSelector), new RXe(this._connection, e)),
          ),
        ));
    }
  },
  RXe = class {
    constructor(e, t) {
      (FZe(this, "resolveCodeAction"),
        (this._client = e),
        (this._capabilities = t),
        t.resolveProvider &&
          (this.resolveCodeAction = async (e, t) => {
            if (e._lspAction) {
              const t = await this._client.server.codeActionResolve(e._lspAction);
              (t.edit && (e.edit = OXe(t.edit, this._client)),
                t.command && (e.command = QYe(t.command)));
            }
            return e;
          }));
    }
    async provideCodeActions(e, t, n, i) {
      const r = this._client.bridge.translate(e, t.getStartPosition()),
        o = await this._client.server.textDocumentCodeAction({
          textDocument: r.textDocument,
          range: this._client.bridge.translateRange(e, t),
          context: {
            diagnostics: n.markers.map((t) => {
              return {
                range: this._client.bridge.translateRange(e, RGe.lift(t)),
                message: t.message,
                severity: ((n = t.severity), GYe.get(n) ?? xYe.Error),
              };
              var n;
            }),
            triggerKind: ((s = n.trigger), AYe.get(s) ?? kYe.Invoked),
          },
        });
      var s;
      return o
        ? {
            actions: (Array.isArray(o) ? o : [o]).map((e) => {
              if ("title" in e && !("kind" in e)) {
                const t = e;
                return { title: t.title, command: QYe(t) };
              }
              {
                const t = e;
                return {
                  title: t.title,
                  kind: MYe(t.kind),
                  isPreferred: t.isPreferred,
                  disabled: t.disabled?.reason,
                  edit: t.edit ? OXe(t.edit, this._client) : void 0,
                  command: QYe(t.command),
                  _lspAction: t,
                };
              }
            }),
            dispose: () => {},
          }
        : null;
    }
  };
function OXe(e, t) {
  const n = [];
  if (e.changes)
    for (const i in e.changes) {
      const r = e.changes[i];
      for (const e of r) {
        const r = t.bridge.translateBackRange({ uri: i }, e.range);
        n.push({
          resource: r.textModel.uri,
          versionId: void 0,
          textEdit: { range: r.range, text: e.newText },
        });
      }
    }
  if (e.documentChanges)
    for (const i of e.documentChanges)
      if ("textDocument" in i) {
        const e = i.textDocument.uri;
        for (const r of i.edits) {
          const o = t.bridge.translateBackRange({ uri: e }, r.range);
          n.push({
            resource: o.textModel.uri,
            versionId: i.textDocument.version ?? void 0,
            textEdit: { range: o.range, text: r.newText },
          });
        }
      }
  return { edits: n };
}
var MXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { codeLens: { dynamicRegistration: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentCodeLens,
            !0,
            (e) =>
              VGe.registerCodeLensProvider(tXe(e.documentSelector), new AXe(this._connection, e)),
          ),
        ));
    }
  },
  AXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideCodeLenses(e, t) {
      const n = this._client.bridge.translate(e, new IGe(1, 1)),
        i = await this._client.server.textDocumentCodeLens({ textDocument: n.textDocument });
      return i
        ? {
            lenses: i.map((t) => ({
              range: TYe(this._client.bridge.translateBackRange(n.textDocument, t.range), e).range,
              command: QYe(t.command),
              _lspCodeLens: t,
            })),
            dispose: () => {},
          }
        : null;
    }
    async resolveCodeLens(e, t, n) {
      if (!this._capabilities.resolveProvider || !t._lspCodeLens) return t;
      const i = await this._client.server.codeLensResolve(t._lspCodeLens);
      return (
        i.command &&
          (t.command = {
            id: i.command.command,
            title: i.command.title,
            arguments: i.command.arguments,
          }),
        t
      );
    }
  },
  PXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { documentLink: { dynamicRegistration: !0, tooltipSupport: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentDocumentLink,
            !0,
            (e) => VGe.registerLinkProvider(tXe(e.documentSelector), new jXe(this._connection, e)),
          ),
        ));
    }
  },
  jXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideLinks(e, t) {
      const n = this._client.bridge.translate(e, new IGe(1, 1)),
        i = await this._client.server.textDocumentDocumentLink({ textDocument: n.textDocument });
      return i
        ? {
            links: i.map((e) => ({
              range: this._client.bridge.translateBackRange(n.textDocument, e.range).range,
              url: e.target,
              tooltip: e.tooltip,
            })),
          }
        : null;
    }
    async resolveLink(e, t) {
      return (this._capabilities.resolveProvider, e);
    }
  },
  FXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { formatting: { dynamicRegistration: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentFormatting,
            !0,
            (e) =>
              VGe.registerDocumentFormattingEditProvider(
                tXe(e.documentSelector),
                new BXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  BXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideDocumentFormattingEdits(e, t, n) {
      const i = this._client.bridge.translate(e, new IGe(1, 1)),
        r = await this._client.server.textDocumentFormatting({
          textDocument: i.textDocument,
          options: { tabSize: t.tabSize, insertSpaces: t.insertSpaces },
        });
      return r
        ? r.map((e) => ({
            range: this._client.bridge.translateBackRange(i.textDocument, e.range).range,
            text: e.newText,
          }))
        : null;
    }
  },
  VXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { rangeFormatting: { dynamicRegistration: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentRangeFormatting,
            !0,
            (e) =>
              VGe.registerDocumentRangeFormattingEditProvider(
                tXe(e.documentSelector),
                new WXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  WXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideDocumentRangeFormattingEdits(e, t, n, i) {
      const r = this._client.bridge.translate(e, t.getStartPosition()),
        o = await this._client.server.textDocumentRangeFormatting({
          textDocument: r.textDocument,
          range: this._client.bridge.translateRange(e, t),
          options: { tabSize: n.tabSize, insertSpaces: n.insertSpaces },
        });
      return o
        ? o.map((e) => ({
            range: this._client.bridge.translateBackRange(r.textDocument, e.range).range,
            text: e.newText,
          }))
        : null;
    }
  },
  HXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { onTypeFormatting: { dynamicRegistration: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentOnTypeFormatting,
            !0,
            (e) =>
              VGe.registerOnTypeFormattingEditProvider(
                tXe(e.documentSelector),
                new zXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  zXe = class {
    constructor(e, t) {
      (FZe(this, "autoFormatTriggerCharacters"),
        (this._client = e),
        (this._capabilities = t),
        (this.autoFormatTriggerCharacters = [
          t.firstTriggerCharacter,
          ...(t.moreTriggerCharacter || []),
        ]));
    }
    async provideOnTypeFormattingEdits(e, t, n, i, r) {
      const o = this._client.bridge.translate(e, t),
        s = await this._client.server.textDocumentOnTypeFormatting({
          textDocument: o.textDocument,
          position: o.position,
          ch: n,
          options: { tabSize: i.tabSize, insertSpaces: i.insertSpaces },
        });
      return s
        ? s.map((e) => ({
            range: this._client.bridge.translateBackRange(o.textDocument, e.range).range,
            text: e.newText,
          }))
        : null;
    }
  },
  UXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: {
              foldingRange: {
                dynamicRegistration: !0,
                rangeLimit: 5e3,
                lineFoldingOnly: !1,
                foldingRangeKind: { valueSet: [dYe.Comment, dYe.Imports, dYe.Region] },
              },
            },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentFoldingRange,
            !0,
            (e) =>
              VGe.registerFoldingRangeProvider(
                tXe(e.documentSelector),
                new $Xe(this._connection, e),
              ),
          ),
        ));
    }
  },
  $Xe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideFoldingRanges(e, t, n) {
      const i = this._client.bridge.translate(e, new IGe(1, 1)),
        r = await this._client.server.textDocumentFoldingRange({ textDocument: i.textDocument });
      return r
        ? r.map((e) => ({ start: e.startLine + 1, end: e.endLine + 1, kind: KYe(e.kind) }))
        : null;
    }
  },
  qXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: { selectionRange: { dynamicRegistration: !0 } },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentSelectionRange,
            !0,
            (e) =>
              VGe.registerSelectionRangeProvider(
                tXe(e.documentSelector),
                new KXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  KXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    async provideSelectionRanges(e, t, n) {
      const i = this._client.bridge.translate(e, t[0]),
        r = await this._client.server.textDocumentSelectionRange({
          textDocument: i.textDocument,
          positions: t.map((t) => this._client.bridge.translate(e, t).position),
        });
      return r ? r.map((e) => this.convertSelectionRange(e, i.textDocument)) : null;
    }
    convertSelectionRange(e, t) {
      const n = [];
      let i = e;
      for (; i; )
        (n.push({ range: this._client.bridge.translateBackRange(t, i.range).range }),
          (i = i.parent));
      return n;
    }
  },
  GXe = class extends IYe {
    constructor(e) {
      (super(),
        FZe(this, "_providers", new Set()),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: {
              inlayHint: {
                dynamicRegistration: !0,
                resolveSupport: {
                  properties: [
                    "tooltip",
                    "textEdits",
                    "label.tooltip",
                    "label.location",
                    "label.command",
                  ],
                },
              },
            },
            workspace: { inlayHint: { refreshSupport: !0 } },
          }),
        ),
        this._register(
          this._connection.connection.registerRequestHandler(
            DYe.client.workspaceInlayHintRefresh,
            async () => {
              for (const e of this._providers) e.refresh();
              return { ok: null };
            },
          ),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentInlayHint,
            !0,
            (e) => {
              const t = new ZXe(this._connection, e);
              this._providers.add(t);
              const n = VGe.registerInlayHintsProvider(tXe(e.documentSelector), t);
              return {
                dispose: () => {
                  (this._providers.delete(t), n.dispose());
                },
              };
            },
          ),
        ));
    }
  },
  ZXe = class {
    constructor(e, t) {
      (FZe(this, "_onDidChangeInlayHints", new LGe()),
        FZe(this, "onDidChangeInlayHints", this._onDidChangeInlayHints.event),
        FZe(this, "resolveInlayHint"),
        (this._client = e),
        (this._capabilities = t),
        t.resolveProvider &&
          (this.resolveInlayHint = async (e, t) => {
            const n = await this._client.server.inlayHintResolve(e._lspInlayHint);
            return (
              n.tooltip && (e.tooltip = XXe(n.tooltip)),
              n.label !== e._lspInlayHint.label && (e.label = YXe(n.label)),
              n.textEdits &&
                (e.textEdits = n.textEdits.map((t) => ({
                  range: this._client.bridge.translateBackRange({ uri: e._targetUri }, t.range)
                    .range,
                  text: t.newText,
                }))),
              e
            );
          }));
    }
    refresh() {
      this._onDidChangeInlayHints.fire();
    }
    async provideInlayHints(e, t, n) {
      const i = this._client.bridge.translate(e, t.getStartPosition()),
        r = await (async function (e) {
          for (let t = 3; ; t--)
            try {
              return await e();
            } catch (spt) {
              if ("content modified" === spt.message && t > 0) continue;
              throw spt;
            }
        })(
          async () =>
            await this._client.server.textDocumentInlayHint({
              textDocument: i.textDocument,
              range: this._client.bridge.translateRange(e, t),
            }),
        );
      return r
        ? {
            hints: r.map((t) => {
              return {
                label: YXe(t.label),
                position: TYe(this._client.bridge.translateBack(i.textDocument, t.position), e)
                  .position,
                kind:
                  ((n = t.kind),
                  n ? (JYe.get(n) ?? VGe.InlayHintKind.Type) : VGe.InlayHintKind.Type),
                tooltip: XXe(t.tooltip),
                paddingLeft: t.paddingLeft,
                paddingRight: t.paddingRight,
                textEdits: t.textEdits?.map((t) => ({
                  range: TYe(this._client.bridge.translateBackRange(i.textDocument, t.range), e)
                    .range,
                  text: t.newText,
                })),
                _lspInlayHint: t,
                _targetUri: i.textDocument.uri,
              };
              var n;
            }),
            dispose: () => {},
          }
        : null;
    }
  };
function YXe(e) {
  return "string" == typeof e
    ? e
    : e.map((e) => {
        const t = { label: e.value, tooltip: XXe(e.tooltip), command: QYe(e.command) };
        return (
          e.location &&
            (t.location = {
              uri: jGe.parse(e.location.uri),
              range: new RGe(
                e.location.range.start.line + 1,
                e.location.range.start.character + 1,
                e.location.range.end.line + 1,
                e.location.range.end.character + 1,
              ),
            }),
          t
        );
      });
}
function XXe(e) {
  if (e) return "string" == typeof e ? e : { value: e.value, isTrusted: !0 };
}
var QXe = class extends IYe {
    constructor(e) {
      (super(),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: {
              semanticTokens: {
                dynamicRegistration: !0,
                requests: { range: !0, full: { delta: !0 } },
                tokenTypes: [
                  "namespace",
                  "type",
                  "class",
                  "enum",
                  "interface",
                  "struct",
                  "typeParameter",
                  "parameter",
                  "variable",
                  "property",
                  "enumMember",
                  "event",
                  "function",
                  "method",
                  "macro",
                  "keyword",
                  "modifier",
                  "comment",
                  "string",
                  "number",
                  "regexp",
                  "operator",
                  "decorator",
                ],
                tokenModifiers: [
                  "declaration",
                  "definition",
                  "readonly",
                  "static",
                  "deprecated",
                  "abstract",
                  "async",
                  "modification",
                  "documentation",
                  "defaultLibrary",
                ],
                formats: [EYe.Relative],
                overlappingTokenSupport: !1,
                multilineTokenSupport: !0,
              },
            },
          }),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentSemanticTokensFull,
            !0,
            (e) =>
              VGe.registerDocumentSemanticTokensProvider(
                tXe(e.documentSelector),
                new JXe(this._connection, e),
              ),
          ),
        ));
    }
  },
  JXe = class {
    constructor(e, t) {
      ((this._client = e), (this._capabilities = t));
    }
    getLegend() {
      return {
        tokenTypes: this._capabilities.legend.tokenTypes,
        tokenModifiers: this._capabilities.legend.tokenModifiers,
      };
    }
    releaseDocumentSemanticTokens(e) {}
    async provideDocumentSemanticTokens(e, t, n) {
      const i = this._client.bridge.translate(e, e.getPositionAt(0)),
        r = this._capabilities.full;
      if (t && r && "object" == typeof r && r.delta) {
        const e = await this._client.server.textDocumentSemanticTokensFullDelta({
          textDocument: i.textDocument,
          previousResultId: t,
        });
        return e
          ? "edits" in e
            ? {
                resultId: e.resultId,
                edits: e.edits.map((e) => ({
                  start: e.start,
                  deleteCount: e.deleteCount,
                  data: e.data ? new Uint32Array(e.data) : void 0,
                })),
              }
            : { resultId: e.resultId, data: new Uint32Array(e.data) }
          : null;
      }
      const o = await this._client.server.textDocumentSemanticTokensFull({
        textDocument: i.textDocument,
      });
      return o ? { resultId: o.resultId, data: new Uint32Array(o.data) } : null;
    }
    async provideDocumentSemanticTokensEdits(e, t, n) {
      return this.provideDocumentSemanticTokens(e, t, n);
    }
  },
  eQe = class extends IYe {
    constructor(e) {
      (super(),
        FZe(this, "_diagnosticsMarkerOwner", "lsp"),
        FZe(this, "_pullDiagnosticProviders", new Map()),
        (this._connection = e),
        this._register(
          this._connection.capabilities.addStaticClientCapabilities({
            textDocument: {
              publishDiagnostics: {
                relatedInformation: !0,
                tagSupport: { valueSet: [...YYe.keys()] },
                versionSupport: !0,
                codeDescriptionSupport: !0,
                dataSupport: !0,
              },
              diagnostic: { dynamicRegistration: !0, relatedDocumentSupport: !0 },
            },
          }),
        ),
        this._register(
          this._connection.connection.registerNotificationHandler(
            DYe.client.textDocumentPublishDiagnostics,
            (e) => this._handlePublishDiagnostics(e),
          ),
        ),
        this._register(
          this._connection.capabilities.registerCapabilityHandler(
            LYe.textDocumentDiagnostic,
            !0,
            (e) => {
              const t = new RYe();
              for (const n of BGe.getModels()) this._addPullDiagnosticProvider(n, e, t);
              return (
                t.add(
                  BGe.onDidCreateModel((n) => {
                    this._addPullDiagnosticProvider(n, e, t);
                  }),
                ),
                t
              );
            },
          ),
        ));
    }
    _addPullDiagnosticProvider(e, t, n) {
      if (
        (e.getLanguageId(),
        !(function (e, t) {
          if (!t) return !0;
          const n = e.getLanguageId();
          if ((e.uri.toString(!0), !t || 0 === t.length)) return !0;
          for (const i of t) if (!i.language || "*" === i.language || i.language === n) return !0;
          return !1;
        })(e, t.documentSelector))
      )
        return;
      const i = new tQe(e, this._connection, this._diagnosticsMarkerOwner, t);
      (this._pullDiagnosticProviders.set(e, i),
        n.add(i),
        n.add(
          e.onWillDispose(() => {
            this._pullDiagnosticProviders.delete(e);
          }),
        ));
    }
    _handlePublishDiagnostics(e) {
      const t = e.uri;
      try {
        const n = this._connection.bridge.translateBack(
          { uri: t },
          { line: 0, character: 0 },
        ).textModel;
        if (!n || n.isDisposed()) return;
        const i = e.diagnostics.map((e) => nXe(e));
        BGe.setModelMarkers(n, this._diagnosticsMarkerOwner, i);
      } catch (D2t) {}
    }
  },
  tQe = class extends IYe {
    constructor(e, t, n, i) {
      (super(),
        FZe(this, "_updateHandle"),
        FZe(this, "_previousResultId"),
        (this._model = e),
        (this._connection = t),
        (this._markerOwner = n),
        (this._capability = i),
        this._register(
          this._model.onDidChangeContent(() => {
            this._scheduleDiagnosticUpdate();
          }),
        ),
        this._scheduleDiagnosticUpdate());
    }
    _scheduleDiagnosticUpdate() {
      (void 0 !== this._updateHandle && clearTimeout(this._updateHandle),
        (this._updateHandle = window.setTimeout(() => {
          ((this._updateHandle = void 0), this._requestDiagnostics());
        }, 500)));
    }
    async _requestDiagnostics() {
      if (!this._model.isDisposed())
        try {
          const e = this._connection.bridge.translate(this._model, new IGe(1, 1)),
            t = await this._connection.server.textDocumentDiagnostic({
              textDocument: e.textDocument,
              identifier: this._capability.identifier,
              previousResultId: this._previousResultId,
            });
          if (this._model.isDisposed()) return;
          this._handleDiagnosticReport(t);
        } catch (D2t) {}
    }
    _handleDiagnosticReport(e) {
      if ("full" === e.kind) {
        this._previousResultId = e.resultId;
        const t = e.items.map((e) => nXe(e));
        (BGe.setModelMarkers(this._model, this._markerOwner, t),
          "relatedDocuments" in e &&
            e.relatedDocuments &&
            this._handleRelatedDocuments(e.relatedDocuments));
      } else "unchanged" === e.kind && (this._previousResultId = e.resultId);
    }
    _handleRelatedDocuments(e) {
      for (const [t, n] of Object.entries(e))
        try {
          const e = this._connection.bridge.translateBack(
            { uri: t },
            { line: 0, character: 0 },
          ).textModel;
          if (!e || e.isDisposed()) continue;
          if ("full" === n.kind) {
            const t = n.items.map((e) => nXe(e));
            BGe.setModelMarkers(e, this._markerOwner, t);
          }
        } catch (D2t) {}
    }
    dispose() {
      (void 0 !== this._updateHandle &&
        (clearTimeout(this._updateHandle), (this._updateHandle = void 0)),
        super.dispose());
    }
  },
  nQe = class {
    constructor(e, t, n, i) {
      ((this.server = e), (this.bridge = t), (this.capabilities = n), (this.connection = i));
    }
  },
  iQe = class extends IYe {
    constructor(e) {
      (super(),
        FZe(this, "_staticCapabilities", new Set()),
        FZe(this, "_dynamicFromStatic", cQe.create()),
        FZe(this, "_registrations", new Map()),
        FZe(this, "_serverCapabilities"),
        (this._connection = e),
        this._register(
          this._connection.registerRequestHandler(
            DYe.client.clientRegisterCapability,
            async (e) => {
              for (const t of e.registrations) {
                const e = aQe(t.method),
                  n = new oQe(t.id, e, t.registerOptions, !1);
                this._registerCapabilityOptions(n);
              }
              return { ok: null };
            },
          ),
        ),
        this._register(
          this._connection.registerRequestHandler(
            DYe.client.clientUnregisterCapability,
            async (e) => {
              for (const t of e.unregisterations) {
                const e = aQe(t.method),
                  n = this._registrations.get(e),
                  i = n?.registrations.get(t.id);
                if (!i) throw new Error(`No registration for method ${t.method} with id ${t.id}`);
                (i?.handlerDisposables.forEach((e) => e.dispose()), n?.registrations.delete(t.id));
              }
              return { ok: null };
            },
          ),
        ));
    }
    _registerCapabilityOptions(e) {
      let t = this._registrations.get(e.capability);
      if (
        (t || ((t = new lQe()), this._registrations.set(e.capability, t)),
        t.registrations.has(e.id))
      )
        throw new Error(
          `Handler for method ${e.capability.method} with id ${e.id} already registered`,
        );
      t.registrations.set(e.id, e);
      for (const n of t.handlers)
        (!n.handleStaticCapability && e.isFromStatic) ||
          e.handlerDisposables.set(n, n.handler(e.options));
    }
    setServerCapabilities(e) {
      if (this._serverCapabilities) throw new Error("Server capabilities already set");
      this._serverCapabilities = e;
      for (const t of Object.values(LYe)) {
        const n = this._dynamicFromStatic.getOptions(t, e);
        n && this._registerCapabilityOptions(new oQe(t.method, t, n, !0));
      }
    }
    getClientCapabilities() {
      const e = {};
      for (const t of this._staticCapabilities) dQe(e, t.cap);
      return e;
    }
    addStaticClientCapabilities(e) {
      const t = { cap: e };
      return (
        this._staticCapabilities.add(t),
        {
          dispose: () => {
            this._staticCapabilities.delete(t);
          },
        }
      );
    }
    registerCapabilityHandler(e, t, n) {
      let i = this._registrations.get(e);
      i || ((i = new lQe()), this._registrations.set(e, i));
      const r = new rQe(e, t, n);
      i.handlers.add(r);
      for (const o of i.registrations.values())
        (!r.handleStaticCapability && o.isFromStatic) || o.handlerDisposables.set(r, n(o.options));
      return {
        dispose: () => {
          i.handlers.delete(r);
          for (const e of i.registrations.values()) {
            const t = e.handlerDisposables.get(r);
            t && (t.dispose(), e.handlerDisposables.delete(r));
          }
        },
      };
    }
  },
  rQe = class {
    constructor(e, t, n) {
      ((this.capability = e), (this.handleStaticCapability = t), (this.handler = n));
    }
  },
  oQe = class {
    constructor(e, t, n, i) {
      (FZe(this, "handlerDisposables", new Map()),
        (this.id = e),
        (this.capability = t),
        (this.options = n),
        (this.isFromStatic = i));
    }
  };
const sQe = new Map([...Object.values(LYe)].map((e) => [e.method, e]));
function aQe(e) {
  const t = sQe.get(e);
  if (!t) throw new Error(`No capability found for method ${e}`);
  return t;
}
var lQe = class {
    constructor() {
      (FZe(this, "handlers", new Set()), FZe(this, "registrations", new Map()));
    }
  },
  cQe = class e {
    constructor() {
      FZe(this, "_mappings", new Map());
    }
    static create() {
      const t = new e();
      return (
        t.set(LYe.textDocumentDidChange, (e) => {
          if (void 0 !== e.textDocumentSync)
            return "object" == typeof e.textDocumentSync
              ? { syncKind: e.textDocumentSync.change ?? pYe.None, documentSelector: null }
              : { syncKind: e.textDocumentSync, documentSelector: null };
        }),
        t.set(LYe.textDocumentCompletion, (e) => e.completionProvider),
        t.set(LYe.textDocumentHover, (e) => e.hoverProvider),
        t.set(LYe.textDocumentSignatureHelp, (e) => e.signatureHelpProvider),
        t.set(LYe.textDocumentDefinition, (e) => e.definitionProvider),
        t.set(LYe.textDocumentReferences, (e) => e.referencesProvider),
        t.set(LYe.textDocumentDocumentHighlight, (e) => e.documentHighlightProvider),
        t.set(LYe.textDocumentDocumentSymbol, (e) => e.documentSymbolProvider),
        t.set(LYe.textDocumentCodeAction, (e) => e.codeActionProvider),
        t.set(LYe.textDocumentCodeLens, (e) => e.codeLensProvider),
        t.set(LYe.textDocumentDocumentLink, (e) => e.documentLinkProvider),
        t.set(LYe.textDocumentFormatting, (e) => e.documentFormattingProvider),
        t.set(LYe.textDocumentRangeFormatting, (e) => e.documentRangeFormattingProvider),
        t.set(LYe.textDocumentOnTypeFormatting, (e) => e.documentOnTypeFormattingProvider),
        t.set(LYe.textDocumentRename, (e) => e.renameProvider),
        t.set(LYe.textDocumentFoldingRange, (e) => e.foldingRangeProvider),
        t.set(LYe.textDocumentDeclaration, (e) => e.declarationProvider),
        t.set(LYe.textDocumentTypeDefinition, (e) => e.typeDefinitionProvider),
        t.set(LYe.textDocumentImplementation, (e) => e.implementationProvider),
        t.set(LYe.textDocumentDocumentColor, (e) => e.colorProvider),
        t.set(LYe.textDocumentSelectionRange, (e) => e.selectionRangeProvider),
        t.set(LYe.textDocumentLinkedEditingRange, (e) => e.linkedEditingRangeProvider),
        t.set(LYe.textDocumentPrepareCallHierarchy, (e) => e.callHierarchyProvider),
        t.set(LYe.textDocumentSemanticTokensFull, (e) => e.semanticTokensProvider),
        t.set(LYe.textDocumentInlayHint, (e) => e.inlayHintProvider),
        t.set(LYe.textDocumentInlineValue, (e) => e.inlineValueProvider),
        t.set(LYe.textDocumentDiagnostic, (e) => e.diagnosticProvider),
        t.set(LYe.textDocumentMoniker, (e) => e.monikerProvider),
        t.set(LYe.textDocumentPrepareTypeHierarchy, (e) => e.typeHierarchyProvider),
        t.set(LYe.workspaceSymbol, (e) => e.workspaceSymbolProvider),
        t.set(LYe.workspaceExecuteCommand, (e) => e.executeCommandProvider),
        t
      );
    }
    set(e, t) {
      if (this._mappings.has(e.method))
        throw new Error(`Capability for method ${e.method} already registered`);
      this._mappings.set(e.method, t);
    }
    getOptions(e, t) {
      const n = this._mappings.get(e.method);
      if (n) return n(t);
    }
  };
function dQe(e, t) {
  for (const n of Object.keys(t)) {
    const i = t[n];
    if (void 0 === i) continue;
    const r = e[n];
    void 0 !== r
      ? "object" == typeof i && null !== i && "object" == typeof r && null !== r
        ? dQe(r, i)
        : (e[n] = i)
      : (e[n] = i);
  }
}
var uQe = class extends IYe {
    constructor(e, t) {
      (super(),
        FZe(this, "_managedModels", new Map()),
        FZe(this, "_managedModelsReverse", new Map()),
        FZe(this, "_started", !1),
        (this._server = e),
        (this._capabilities = t),
        this._register(
          this._capabilities.addStaticClientCapabilities({
            textDocument: {
              synchronization: {
                dynamicRegistration: !0,
                willSave: !1,
                willSaveWaitUntil: !1,
                didSave: !1,
              },
            },
          }),
        ),
        this._register(
          t.registerCapabilityHandler(LYe.textDocumentDidChange, !0, (e) => {
            if (this._started) return { dispose: () => {} };
            ((this._started = !0),
              this._register(
                BGe.onDidCreateModel((e) => {
                  this._getOrCreateManagedModel(e);
                }),
              ));
            for (const t of BGe.getModels()) this._getOrCreateManagedModel(t);
            return { dispose: () => {} };
          }),
        ));
    }
    _getOrCreateManagedModel(e) {
      if (!this._started) throw new Error("Not started");
      const t = e.uri.toString(!0).toLowerCase();
      let n = this._managedModels.get(e);
      return (
        n ||
          ((n = new hQe(e, this._server)),
          this._managedModels.set(e, n),
          this._managedModelsReverse.set(t, e)),
        e.onWillDispose(() => {
          (n.dispose(), this._managedModels.delete(e), this._managedModelsReverse.delete(t));
        }),
        n
      );
    }
    translateBack(e, t) {
      const n = e.uri.toLowerCase(),
        i = this._managedModelsReverse.get(n);
      if (!i) throw new Error(`No text model for uri ${n}`);
      return { textModel: i, position: new IGe(t.line + 1, t.character + 1) };
    }
    translateBackRange(e, t) {
      const n = e.uri.toLowerCase(),
        i = this._managedModelsReverse.get(n);
      if (!i) throw new Error(`No text model for uri ${n}`);
      return {
        textModel: i,
        range: new RGe(
          t.start.line + 1,
          t.start.character + 1,
          t.end.line + 1,
          t.end.character + 1,
        ),
      };
    }
    translate(e, t) {
      return {
        textDocument: { uri: e.uri.toString(!0) },
        position: { line: t.lineNumber - 1, character: t.column - 1 },
      };
    }
    translateRange(e, t) {
      return {
        start: { line: t.startLineNumber - 1, character: t.startColumn - 1 },
        end: { line: t.endLineNumber - 1, character: t.endColumn - 1 },
      };
    }
  },
  hQe = class extends IYe {
    constructor(e, t) {
      (super(), (this._textModel = e), (this._api = t));
      const n = e.uri.toString(!0).toLowerCase();
      (this._api.textDocumentDidOpen({
        textDocument: {
          languageId: e.getLanguageId(),
          uri: n,
          version: e.getVersionId(),
          text: e.getValue(),
        },
      }),
        this._register(
          e.onDidChangeContent((t) => {
            const i = t.changes.map((e) => {
              return { range: gQe((t = e).range), rangeLength: t.rangeLength, text: t.text };
              var t;
            });
            this._api.textDocumentDidChange({
              textDocument: { uri: n, version: e.getVersionId() },
              contentChanges: i,
            });
          }),
        ),
        this._register({
          dispose: () => {
            this._api.textDocumentDidClose({ textDocument: { uri: n } });
          },
        }));
    }
  };
function gQe(e) {
  return {
    start: { line: e.startLineNumber - 1, character: e.startColumn - 1 },
    end: { line: e.endLineNumber - 1, character: e.endColumn - 1 },
  };
}
var pQe = null;
"undefined" != typeof WebSocket
  ? (pQe = WebSocket)
  : "undefined" != typeof MozWebSocket
    ? (pQe = MozWebSocket)
    : "undefined" != typeof global
      ? (pQe = global.WebSocket || global.MozWebSocket)
      : "undefined" != typeof window
        ? (pQe = window.WebSocket || window.MozWebSocket)
        : "undefined" != typeof self && (pQe = self.WebSocket || self.MozWebSocket);
var fQe = pQe;
var mQe = class extends zZe {
  constructor(e, t = void 0, n = void 0) {
    (super(),
      FZe(this, "_windowLike"),
      FZe(this, "_source"),
      FZe(this, "_loadingState"),
      FZe(this, "_disposed", !1),
      FZe(this, "_messageHandler", ({ data: e, source: t }) => {
        (this._source && t !== this._source) ||
          ("object" == typeof e && e && this._dispatchReceivedMessage(e));
      }),
      (this._windowLike = e),
      (this._source = t),
      (this._loadingState = n),
      this._windowLike.addEventListener("message", this._messageHandler));
  }
  async _sendImpl(e) {
    if (this._disposed) throw new Error("Transport is disposed");
    (this._loadingState && !this._loadingState.loaded && (await this._loadingState.onLoaded),
      this._windowLike.postMessage(e));
  }
  toString() {
    return `${this.id}@${this._windowLike}`;
  }
  dispose() {
    this._disposed ||
      ((this._disposed = !0),
      this._windowLike.removeEventListener("message", this._messageHandler));
  }
};
const _Qe = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      MonacoLspClient: class {
        constructor(e) {
          (FZe(this, "_connection"),
            FZe(this, "_capabilitiesRegistry"),
            FZe(this, "_bridge"),
            FZe(this, "_initPromise"));
          const t = JZe.fromTransport(e),
            n = DYe.getServer(t, {});
          (t.startListen(),
            (this._capabilitiesRegistry = new iQe(t)),
            (this._bridge = new uQe(n.server, this._capabilitiesRegistry)),
            (this._connection = new nQe(n.server, this._bridge, this._capabilitiesRegistry, t)),
            this.createFeatures(),
            (this._initPromise = this._init()));
        }
        async _init() {
          const e = await this._connection.server.initialize({
            processId: null,
            capabilities: this._capabilitiesRegistry.getClientCapabilities(),
            rootUri: null,
          });
          (this._connection.server.initialized({}),
            this._capabilitiesRegistry.setServerCapabilities(e.capabilities));
        }
        createFeatures() {
          const e = new RYe();
          return (
            e.add(new iXe(this._connection)),
            e.add(new aXe(this._connection)),
            e.add(new uXe(this._connection)),
            e.add(new pXe(this._connection)),
            e.add(new mXe(this._connection)),
            e.add(new vXe(this._connection)),
            e.add(new yXe(this._connection)),
            e.add(new wXe(this._connection)),
            e.add(new SXe(this._connection)),
            e.add(new EXe(this._connection)),
            e.add(new DXe(this._connection)),
            e.add(new IXe(this._connection)),
            e.add(new MXe(this._connection)),
            e.add(new PXe(this._connection)),
            e.add(new FXe(this._connection)),
            e.add(new VXe(this._connection)),
            e.add(new HXe(this._connection)),
            e.add(new UXe(this._connection)),
            e.add(new qXe(this._connection)),
            e.add(new GXe(this._connection)),
            e.add(new QXe(this._connection)),
            e.add(new eQe(this._connection)),
            e
          );
        }
      },
      WebSocketTransport: class e extends zZe {
        constructor(e) {
          (super(),
            FZe(this, "socket"),
            FZe(this, "errorEmitter", new BZe()),
            FZe(this, "onError", this.errorEmitter),
            (this.socket = e),
            (e.onmessage = (e) => {
              try {
                const t = e.data;
                if ("string" != typeof t) throw new Error("Not supported");
                {
                  const e = JSON.parse(t);
                  this._dispatchReceivedMessage(e);
                }
              } catch (D2t) {
                this.errorEmitter.fire({ error: D2t });
              }
            }),
            (e.onclose = (e) => {
              this._onConnectionClosed();
            }));
        }
        static connectTo(t) {
          const n = new fQe(
            (function (e) {
              return "host" in e
                ? { address: `${e.forceTls ? "wss" : "ws"}://${e.host}:${e.port}` }
                : e;
            })(t).address,
          );
          return new Promise((t, i) => {
            ((n.onerror = (e) => {
              i(e);
            }),
              (n.onopen = () => {
                t(new e(n));
              }));
          });
        }
        static fromWebSocket(t) {
          return new e(t);
        }
        close() {
          this.socket.close();
        }
        dispose() {
          this.close();
        }
        _sendImpl(e) {
          const t = JSON.stringify(e);
          return new Promise((e, n) => {
            this.socket.send(t, (t) => {
              t ? n(t) : e();
            });
          });
        }
        toString() {
          return `${this.id}@${this.socket.url}`;
        }
      },
      createTransportToIFrame: function (e) {
        if ("undefined" == typeof window)
          throw new Error("call this function from the main browser thread");
        return new mQe(e.contentWindow, e.contentWindow, {
          loaded: "complete" === window.document.readyState,
          onLoaded: new Promise((e) => {
            window.addEventListener("load", () => e());
          }),
        });
      },
      createTransportToWorker: function (e) {
        if ("undefined" == typeof window)
          throw new Error("call this function from the main browser thread");
        return new mQe(e);
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
let vQe;
function bQe(e) {
  const t = Promise.resolve(
    (function (e) {
      const t = e.label,
        n = globalThis.MonacoEnvironment;
      if (n) {
        if ("function" == typeof n.getWorker) return n.getWorker("workerMain.js", t);
        if ("function" == typeof n.getWorkerUrl) {
          const e = n.getWorkerUrl("workerMain.js", t);
          return new Worker(vQe ? vQe.createScriptURL(e) : e, { name: t, type: "module" });
        }
      }
      if (e.createWorker) return e.createWorker();
      throw new Error(
        "You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker",
      );
    })({
      label: e.label ?? "monaco-editor-worker",
      moduleId: e.moduleId,
      createWorker: e.createWorker,
    }),
  ).then((t) => (t.postMessage("ignore"), t.postMessage(e.createData), t));
  return BGe.createWebWorker({ worker: t, host: e.host, keepIdleModels: e.keepIdleModels });
}
function yQe() {
  return zGe;
}
vQe =
  "object" == typeof self &&
  self.constructor &&
  "DedicatedWorkerGlobalScope" === self.constructor.name &&
  void 0 !== globalThis.workerttPolicy
    ? globalThis.workerttPolicy
    : (function (e, t) {
        const n = globalThis.MonacoEnvironment;
        if (n?.createTrustedTypesPolicy)
          try {
            return n.createTrustedTypesPolicy(e, t);
          } catch (i) {
            return;
          }
        try {
          return globalThis.trustedTypes?.createPolicy(e, t);
        } catch (i) {
          return;
        }
      })("defaultWorkerFactory", { createScriptURL: (e) => e });
const xQe = globalThis.MonacoEnvironment;
xQe?.globalAPI && (globalThis.monaco = yQe());
const wQe = yQe();
((wQe.languages.css = XGe),
  (wQe.languages.html = uZe),
  (wQe.languages.typescript = kZe),
  (wQe.languages.json = pZe));
const CQe = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      CancellationTokenSource: NGe,
      Emitter: LGe,
      KeyCode: DGe,
      KeyMod: TGe,
      MarkerSeverity: AGe,
      MarkerTag: PGe,
      Position: IGe,
      Range: RGe,
      Selection: OGe,
      SelectionDirection: MGe,
      Token: FGe,
      Uri: jGe,
      createWebWorker: bQe,
      css: XGe,
      editor: BGe,
      html: uZe,
      json: pZe,
      languages: VGe,
      lsp: _Qe,
      typescript: kZe,
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
iI.config({ monaco: CQe });
const SQe = gy({
    subscribe_template_singbox: ly().optional().default(""),
    subscribe_template_clash: ly().optional().default(""),
    subscribe_template_clashmeta: ly().optional().default(""),
    subscribe_template_stash: ly().optional().default(""),
    subscribe_template_surge: ly().optional().default(""),
    subscribe_template_surfboard: ly().optional().default(""),
  }),
  kQe = [
    { key: "singbox", label: "Sing-box", language: "json" },
    { key: "clash", label: "Clash", language: "yaml" },
    { key: "clashmeta", label: "Clash Meta", language: "yaml" },
    { key: "stash", label: "Stash", language: "yaml" },
    { key: "surge", label: "Surge", language: "ini" },
    { key: "surfboard", label: "Surfboard", language: "ini" },
  ],
  EQe = {
    subscribe_template_singbox: "",
    subscribe_template_clash: "",
    subscribe_template_clashmeta: "",
    subscribe_template_stash: "",
    subscribe_template_surge: "",
    subscribe_template_surfboard: "",
  };
function NQe() {
  const { t: e } = Py("settings"),
    [t, n] = H.useState(!1),
    i = H.useRef(null),
    [r, o] = H.useState("singbox"),
    s = kv({ resolver: Ov(SQe), defaultValues: EQe, mode: "onChange" }),
    { data: a, isLoading: l } = gC({
      queryKey: ["settings", "subscribe_template"],
      queryFn: () => xT.getSettings("subscribe_template"),
    }),
    { mutateAsync: c } = pC({
      mutationFn: xT.saveSettings,
      onSuccess: () => {
        hN.success(e("common.autoSaved"));
      },
      onError: (t) => {
        hN.error(e("common.saveFailed"));
      },
    });
  H.useEffect(() => {
    if (a?.data?.subscribe_template) {
      const e = a.data.subscribe_template;
      (Object.entries(e).forEach(([e, t]) => {
        if (e in EQe) {
          const n = "string" == typeof t ? t : "";
          s.setValue(e, n);
        }
      }),
        (i.current = s.getValues()));
    }
  }, [a, s]);
  const d = H.useMemo(
    () =>
      kT.debounce(async (e) => {
        if (!i.current || !kT.isEqual(e, i.current)) {
          n(!0);
          try {
            (await c(e), (i.current = e));
          } catch (D2t) {
          } finally {
            n(!1);
          }
        }
      }, 1500),
    [c],
  );
  H.useEffect(() => () => d.cancel(), [d]);
  const u = H.useCallback(() => {
      const e = s.getValues();
      d(e);
    }, [s, d]),
    h = H.useCallback(
      (t, n) =>
        Q.jsx(Uy, {
          control: s.control,
          name: t,
          render: ({ field: i }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-base",
                  children: e(`subscribe_template.${t.replace("subscribe_template_", "")}.title`),
                }),
                Q.jsx(Zy, {
                  children: Q.jsx(bI, {
                    height: "500px",
                    defaultLanguage: n,
                    value: i.value || "",
                    onChange: (e) => {
                      (i.onChange(e || ""), u());
                    },
                    options: {
                      minimap: { enabled: !1 },
                      fontSize: 14,
                      wordWrap: "on",
                      scrollBeyondLastLine: !1,
                      automaticLayout: !0,
                    },
                  }),
                }),
                Q.jsx(Yy, {
                  children: e(
                    `subscribe_template.${t.replace("subscribe_template_", "")}.description`,
                  ),
                }),
                Q.jsx(Xy, {}),
              ],
            }),
        }),
      [s.control, e, u],
    );
  return l
    ? Q.jsx("div", {
        className: "flex items-center justify-center h-64",
        children: Q.jsx("div", {
          className: "text-sm text-muted-foreground",
          children: e("common.loading"),
        }),
      })
    : Q.jsx(Hy, {
        ...s,
        children: Q.jsxs("div", {
          className: "space-y-4",
          children: [
            Q.jsxs(iw, {
              value: r,
              onValueChange: o,
              className: "w-full",
              children: [
                Q.jsx(rw, {
                  className: "",
                  children: kQe.map(({ key: e, label: t }) =>
                    Q.jsx(ow, { value: e, className: "text-xs", children: t }, e),
                  ),
                }),
                kQe.map(({ key: e, language: t }) =>
                  Q.jsx(
                    sw,
                    { value: e, className: "mt-4", children: h(`subscribe_template_${e}`, t) },
                    e,
                  ),
                ),
              ],
            }),
            t &&
              Q.jsxs("div", {
                className: "flex items-center gap-2 text-sm text-muted-foreground",
                children: [
                  Q.jsx("div", { className: "h-2 w-2 animate-pulse rounded-full bg-blue-500" }),
                  e("common.saving"),
                ],
              }),
          ],
        }),
      });
}
function LQe() {
  const { t: e } = Py("settings");
  return Q.jsxs("div", {
    className: "space-y-6",
    children: [
      Q.jsxs("div", {
        children: [
          Q.jsx("h3", {
            className: "text-lg font-medium",
            children: e("subscribe_template.title"),
          }),
          Q.jsx("p", {
            className: "text-sm text-muted-foreground",
            children: e("subscribe_template.description"),
          }),
        ],
      }),
      Q.jsx(Um, {}),
      Q.jsx(NQe, {}),
    ],
  });
}
const DQe =
  ((TQe = [
    {
      path: "/sign-in",
      lazy: async () => ({
        Component: (
          await xp(
            async () => {
              const { default: e } = await Promise.resolve().then(() => Vot);
              return { default: e };
            },
            void 0,
            import.meta.url,
          )
        ).default,
      }),
    },
    {
      element: Q.jsx(Fm, { children: Q.jsx(vg, {}) }),
      children: [
        {
          path: "/",
          lazy: async () => ({
            Component: (await xp(() => Promise.resolve().then(() => vlt), void 0, import.meta.url))
              .default,
          }),
          errorElement: Q.jsx(Lm, {}),
          children: [
            {
              index: !0,
              lazy: async () => ({
                Component: (
                  await xp(
                    async () => {
                      const { default: e } = await Promise.resolve().then(() => tGt);
                      return { default: e };
                    },
                    void 0,
                    import.meta.url,
                  )
                ).default,
              }),
            },
            {
              path: "config",
              errorElement: Q.jsx(Lm, {}),
              children: [
                {
                  path: "system",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => rGt);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                  children: [
                    {
                      index: !0,
                      lazy: async () => ({
                        Component: (
                          await xp(
                            async () => {
                              const { default: e } = await Promise.resolve().then(() => yGt);
                              return { default: e };
                            },
                            void 0,
                            import.meta.url,
                          )
                        ).default,
                      }),
                    },
                    {
                      path: "safe",
                      lazy: async () => ({
                        Component: (
                          await xp(
                            async () => {
                              const { default: e } = await Promise.resolve().then(() => SGt);
                              return { default: e };
                            },
                            void 0,
                            import.meta.url,
                          )
                        ).default,
                      }),
                    },
                    {
                      path: "subscribe",
                      lazy: async () => ({
                        Component: (
                          await xp(
                            async () => {
                              const { default: e } = await Promise.resolve().then(() => LGt);
                              return { default: e };
                            },
                            void 0,
                            import.meta.url,
                          )
                        ).default,
                      }),
                    },
                    {
                      path: "invite",
                      lazy: async () => ({
                        Component: (
                          await xp(
                            async () => {
                              const { default: e } = await Promise.resolve().then(() => RGt);
                              return { default: e };
                            },
                            void 0,
                            import.meta.url,
                          )
                        ).default,
                      }),
                    },
                    {
                      path: "frontend",
                      lazy: async () => ({
                        Component: (
                          await xp(
                            async () => {
                              const { default: e } = await Promise.resolve().then(() => PGt);
                              return { default: e };
                            },
                            void 0,
                            import.meta.url,
                          )
                        ).default,
                      }),
                    },
                    {
                      path: "server",
                      lazy: async () => ({
                        Component: (
                          await xp(
                            async () => {
                              const { default: e } = await Promise.resolve().then(() => WGt);
                              return { default: e };
                            },
                            void 0,
                            import.meta.url,
                          )
                        ).default,
                      }),
                    },
                    {
                      path: "email",
                      lazy: async () => ({
                        Component: (
                          await xp(
                            async () => {
                              const { default: e } = await Promise.resolve().then(() => $Gt);
                              return { default: e };
                            },
                            void 0,
                            import.meta.url,
                          )
                        ).default,
                      }),
                    },
                    {
                      path: "telegram",
                      lazy: async () => ({
                        Component: (
                          await xp(
                            async () => {
                              const { default: e } = await Promise.resolve().then(() => ZGt);
                              return { default: e };
                            },
                            void 0,
                            import.meta.url,
                          )
                        ).default,
                      }),
                    },
                    {
                      path: "APP",
                      lazy: async () => ({
                        Component: (
                          await xp(
                            async () => {
                              const { default: e } = await Promise.resolve().then(() => JGt);
                              return { default: e };
                            },
                            void 0,
                            import.meta.url,
                          )
                        ).default,
                      }),
                    },
                    { path: "subscribe-template", element: Q.jsx(LQe, {}) },
                  ],
                },
                {
                  path: "plugin",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => jQt);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
                {
                  path: "theme",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => WQt);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
                {
                  path: "notice",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => J2t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
                {
                  path: "knowledge",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => a4t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
              ],
            },
            {
              path: "server",
              errorElement: Q.jsx(Lm, {}),
              children: [
                {
                  path: "manage",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => U5t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
                {
                  path: "group",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => G5t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
                {
                  path: "route",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => e3t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
              ],
            },
            {
              path: "finance",
              errorElement: Q.jsx(Lm, {}),
              children: [
                {
                  path: "plan",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => p3t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
                {
                  path: "order",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => R3t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
              ],
            },
            {
              path: "user",
              errorElement: Q.jsx(Lm, {}),
              children: [
                {
                  path: "manage",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => u8t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
                {
                  path: "ticket",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => A8t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
                {
                  path: "realname",
                  lazy: async () => ({ Component: codexNativeRealnamePage }),
                },
                {
                  path: "online-devices",
                  lazy: async () => ({ Component: codexNativeOnlineDevicesPage }),
                },
                {
                  path: "ipv6-subscription",
                  lazy: async () => ({ Component: codexNativeIPv6Page }),
                },
                {
                  path: "traffic-reset-logs",
                  lazy: async () => ({
                    Component: (
                      await xp(
                        async () => {
                          const { default: e } = await Promise.resolve().then(() => V8t);
                          return { default: e };
                        },
                        void 0,
                        import.meta.url,
                      )
                    ).default,
                  }),
                },
              ],
            },
          ],
        },
      ],
    },
    { path: "/500", Component: Lm },
    { path: "/404", Component: Dm },
    {
      path: "/503",
      Component: function () {
        return Q.jsx("div", {
          className: "h-svh",
          children: Q.jsxs("div", {
            className: "m-auto flex h-full w-full flex-col items-center justify-center gap-2",
            children: [
              Q.jsx("h1", { className: "text-[7rem] font-bold leading-tight", children: "503" }),
              Q.jsx("span", {
                className: "font-medium",
                children: "Website is under maintenance!",
              }),
              Q.jsxs("p", {
                className: "text-center text-muted-foreground",
                children: [
                  "The site is not available at the moment. ",
                  Q.jsx("br", {}),
                  "We'll be back online shortly.",
                ],
              }),
              Q.jsx("div", {
                className: "mt-6 flex gap-4",
                children: Q.jsx(Nm, { variant: "outline", children: "Learn more" }),
              }),
            ],
          }),
        });
      },
    },
    { path: "*", Component: Dm },
  ]),
  lh({
    basename:
      null == (IQe = { future: { v7_startTransition: !0, v7_relativeSplatPath: !0 } })
        ? void 0
        : IQe.basename,
    future: xg({}, null == IQe ? void 0 : IQe.future, { v7_prependBasename: !0 }),
    history: uu({ window: null == IQe ? void 0 : IQe.window }),
    hydrationData: (null == IQe ? void 0 : IQe.hydrationData) || Sg(),
    routes: TQe,
    mapRouteProperties: yg,
    dataStrategy: null == IQe ? void 0 : IQe.dataStrategy,
    patchRoutesOnNavigation: null == IQe ? void 0 : IQe.patchRoutesOnNavigation,
    window: null == IQe ? void 0 : IQe.window,
  }).initialize());
var TQe, IQe;
function RQe(e) {
  return `Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `;
}
var OQe = (() => ("function" == typeof Symbol && Symbol.observable) || "@@observable")(),
  MQe = () => Math.random().toString(36).substring(7).split("").join("."),
  AQe = {
    INIT: `@@redux/INIT${MQe()}`,
    REPLACE: `@@redux/REPLACE${MQe()}`,
    PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${MQe()}`,
  };
function PQe(e) {
  if ("object" != typeof e || null === e) return !1;
  let t = e;
  for (; null !== Object.getPrototypeOf(t); ) t = Object.getPrototypeOf(t);
  return Object.getPrototypeOf(e) === t || null === Object.getPrototypeOf(e);
}
function jQe(e, t, n) {
  if ("function" != typeof e) throw new Error(RQe(2));
  if (
    ("function" == typeof t && "function" == typeof n) ||
    ("function" == typeof n && "function" == typeof arguments[3])
  )
    throw new Error(RQe(0));
  if (("function" == typeof t && void 0 === n && ((n = t), (t = void 0)), void 0 !== n)) {
    if ("function" != typeof n) throw new Error(RQe(1));
    return n(jQe)(e, t);
  }
  let i = e,
    r = t,
    o = new Map(),
    s = o,
    a = 0,
    l = !1;
  function c() {
    s === o &&
      ((s = new Map()),
      o.forEach((e, t) => {
        s.set(t, e);
      }));
  }
  function d() {
    if (l) throw new Error(RQe(3));
    return r;
  }
  function u(e) {
    if ("function" != typeof e) throw new Error(RQe(4));
    if (l) throw new Error(RQe(5));
    let t = !0;
    c();
    const n = a++;
    return (
      s.set(n, e),
      function () {
        if (t) {
          if (l) throw new Error(RQe(6));
          ((t = !1), c(), s.delete(n), (o = null));
        }
      }
    );
  }
  function h(e) {
    if (!PQe(e)) throw new Error(RQe(7));
    if (void 0 === e.type) throw new Error(RQe(8));
    if ("string" != typeof e.type) throw new Error(RQe(17));
    if (l) throw new Error(RQe(9));
    try {
      ((l = !0), (r = i(r, e)));
    } finally {
      l = !1;
    }
    return (
      (o = s).forEach((e) => {
        e();
      }),
      e
    );
  }
  h({ type: AQe.INIT });
  return {
    dispatch: h,
    subscribe: u,
    getState: d,
    replaceReducer: function (e) {
      if ("function" != typeof e) throw new Error(RQe(10));
      ((i = e), h({ type: AQe.REPLACE }));
    },
    [OQe]: function () {
      const e = u;
      return {
        subscribe(t) {
          if ("object" != typeof t || null === t) throw new Error(RQe(11));
          function n() {
            const e = t;
            e.next && e.next(d());
          }
          n();
          return { unsubscribe: e(n) };
        },
        [OQe]() {
          return this;
        },
      };
    },
  };
}
function FQe(e) {
  const t = Object.keys(e),
    n = {};
  for (let o = 0; o < t.length; o++) {
    const i = t[o];
    "function" == typeof e[i] && (n[i] = e[i]);
  }
  const i = Object.keys(n);
  let r;
  try {
    !(function (e) {
      Object.keys(e).forEach((t) => {
        const n = e[t];
        if (void 0 === n(void 0, { type: AQe.INIT })) throw new Error(RQe(12));
        if (void 0 === n(void 0, { type: AQe.PROBE_UNKNOWN_ACTION() })) throw new Error(RQe(13));
      });
    })(n);
  } catch (spt) {
    r = spt;
  }
  return function (e = {}, t) {
    if (r) throw r;
    let o = !1;
    const s = {};
    for (let r = 0; r < i.length; r++) {
      const a = i[r],
        l = n[a],
        c = e[a],
        d = l(c, t);
      if (void 0 === d) throw (t && t.type, new Error(RQe(14)));
      ((s[a] = d), (o = o || d !== c));
    }
    return ((o = o || i.length !== Object.keys(e).length), o ? s : e);
  };
}
function BQe(...e) {
  return 0 === e.length
    ? (e) => e
    : 1 === e.length
      ? e[0]
      : e.reduce(
          (e, t) =>
            (...n) =>
              e(t(...n)),
        );
}
var VQe = Symbol.for("immer-nothing"),
  WQe = Symbol.for("immer-draftable"),
  HQe = Symbol.for("immer-state");
function zQe(e, ...t) {
  throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`);
}
var UQe = Object,
  $Qe = UQe.getPrototypeOf,
  qQe = "constructor",
  KQe = "prototype",
  GQe = "configurable",
  ZQe = "enumerable",
  YQe = "writable",
  XQe = "value",
  QQe = (e) => !!e && !!e[HQe];
function JQe(e) {
  return !!e && (nJe(e) || lJe(e) || !!e[WQe] || !!e[qQe]?.[WQe] || cJe(e) || dJe(e));
}
var eJe = UQe[KQe][qQe].toString(),
  tJe = new WeakMap();
function nJe(e) {
  if (!e || !uJe(e)) return !1;
  const t = $Qe(e);
  if (null === t || t === UQe[KQe]) return !0;
  const n = UQe.hasOwnProperty.call(t, qQe) && t[qQe];
  if (n === Object) return !0;
  if (!hJe(n)) return !1;
  let i = tJe.get(n);
  return (void 0 === i && ((i = Function.toString.call(n)), tJe.set(n, i)), i === eJe);
}
function iJe(e, t, n = !0) {
  if (0 === rJe(e)) {
    (n ? Reflect.ownKeys(e) : UQe.keys(e)).forEach((n) => {
      t(n, e[n], e);
    });
  } else e.forEach((n, i) => t(i, n, e));
}
function rJe(e) {
  const t = e[HQe];
  return t ? t.type_ : lJe(e) ? 1 : cJe(e) ? 2 : dJe(e) ? 3 : 0;
}
var oJe = (e, t, n = rJe(e)) => (2 === n ? e.has(t) : UQe[KQe].hasOwnProperty.call(e, t)),
  sJe = (e, t, n = rJe(e)) => (2 === n ? e.get(t) : e[t]),
  aJe = (e, t, n, i = rJe(e)) => {
    2 === i ? e.set(t, n) : 3 === i ? e.add(n) : (e[t] = n);
  };
var lJe = Array.isArray,
  cJe = (e) => e instanceof Map,
  dJe = (e) => e instanceof Set,
  uJe = (e) => "object" == typeof e,
  hJe = (e) => "function" == typeof e,
  gJe = (e) => "boolean" == typeof e,
  pJe = (e) => e.copy_ || e.base_,
  fJe = (e) => (e.modified_ ? e.copy_ : e.base_);
function mJe(e, t) {
  if (cJe(e)) return new Map(e);
  if (dJe(e)) return new Set(e);
  if (lJe(e)) return Array[KQe].slice.call(e);
  const n = nJe(e);
  if (!0 === t || ("class_only" === t && !n)) {
    const t = UQe.getOwnPropertyDescriptors(e);
    delete t[HQe];
    let n = Reflect.ownKeys(t);
    for (let i = 0; i < n.length; i++) {
      const r = n[i],
        o = t[r];
      (!1 === o[YQe] && ((o[YQe] = !0), (o[GQe] = !0)),
        (o.get || o.set) && (t[r] = { [GQe]: !0, [YQe]: !0, [ZQe]: o[ZQe], [XQe]: e[r] }));
    }
    return UQe.create($Qe(e), t);
  }
  {
    const t = $Qe(e);
    if (null !== t && n) return { ...e };
    const i = UQe.create(t);
    return UQe.assign(i, e);
  }
}
function _Je(e, t = !1) {
  return (
    bJe(e) ||
      QQe(e) ||
      !JQe(e) ||
      (rJe(e) > 1 && UQe.defineProperties(e, { set: vJe, add: vJe, clear: vJe, delete: vJe }),
      UQe.freeze(e),
      t &&
        iJe(
          e,
          (e, t) => {
            _Je(t, !0);
          },
          !1,
        )),
    e
  );
}
var vJe = {
  [XQe]: function () {
    zQe(2);
  },
};
function bJe(e) {
  return null === e || !uJe(e) || UQe.isFrozen(e);
}
var yJe = "MapSet",
  xJe = "Patches",
  wJe = {};
function CJe(e) {
  const t = wJe[e];
  return (t || zQe(0), t);
}
var SJe,
  kJe = () => SJe;
function EJe(e, t) {
  t &&
    ((e.patchPlugin_ = CJe(xJe)),
    (e.patches_ = []),
    (e.inversePatches_ = []),
    (e.patchListener_ = t));
}
function NJe(e) {
  (LJe(e), e.drafts_.forEach(TJe), (e.drafts_ = null));
}
function LJe(e) {
  e === SJe && (SJe = e.parent_);
}
var DJe = (e) => {
  return (SJe = {
    drafts_: [],
    parent_: SJe,
    immer_: e,
    canAutoFreeze_: !0,
    unfinalizedDrafts_: 0,
    handledSet_: new Set(),
    processedForPatches_: new Set(),
    mapSetPlugin_: ((t = yJe), wJe[t] ? CJe(yJe) : void 0),
  });
  var t;
};
function TJe(e) {
  const t = e[HQe];
  0 === t.type_ || 1 === t.type_ ? t.revoke_() : (t.revoked_ = !0);
}
function IJe(e, t) {
  t.unfinalizedDrafts_ = t.drafts_.length;
  const n = t.drafts_[0];
  if (void 0 !== e && e !== n) {
    (n[HQe].modified_ && (NJe(t), zQe(4)), JQe(e) && (e = RJe(t, e)));
    const { patchPlugin_: i } = t;
    i && i.generateReplacementPatches_(n[HQe].base_, e, t);
  } else e = RJe(t, n);
  return (
    (function (e, t, n = !1) {
      !e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && _Je(t, n);
    })(t, e, !0),
    NJe(t),
    t.patches_ && t.patchListener_(t.patches_, t.inversePatches_),
    e !== VQe ? e : void 0
  );
}
function RJe(e, t) {
  if (bJe(t)) return t;
  const n = t[HQe];
  if (!n) {
    return FJe(t, e.handledSet_, e);
  }
  if (!MJe(n, e)) return t;
  if (!n.modified_) return n.base_;
  if (!n.finalized_) {
    const { callbacks_: t } = n;
    if (t)
      for (; t.length > 0; ) {
        t.pop()(e);
      }
    jJe(n, e);
  }
  return n.copy_;
}
function OJe(e) {
  ((e.finalized_ = !0), e.scope_.unfinalizedDrafts_--);
}
var MJe = (e, t) => e.scope_ === t,
  AJe = [];
function PJe(e, t, n, i) {
  const r = pJe(e),
    o = e.type_;
  if (void 0 !== i) {
    if (sJe(r, i, o) === t) return void aJe(r, i, n, o);
  }
  if (!e.draftLocations_) {
    const t = (e.draftLocations_ = new Map());
    iJe(r, (e, n) => {
      if (QQe(n)) {
        const i = t.get(n) || [];
        (i.push(e), t.set(n, i));
      }
    });
  }
  const s = e.draftLocations_.get(t) ?? AJe;
  for (const a of s) aJe(r, a, n, o);
}
function jJe(e, t) {
  if (e.modified_ && !e.finalized_ && (3 === e.type_ || (e.assigned_?.size ?? 0) > 0)) {
    const { patchPlugin_: n } = t;
    if (n) {
      const i = n.getPath(e);
      i && n.generatePatches_(e, i, t);
    }
    OJe(e);
  }
}
function FJe(e, t, n) {
  return (
    (!n.immer_.autoFreeze_ && n.unfinalizedDrafts_ < 1) ||
      QQe(e) ||
      t.has(e) ||
      !JQe(e) ||
      bJe(e) ||
      (t.add(e),
      iJe(e, (i, r) => {
        if (QQe(r)) {
          const t = r[HQe];
          if (MJe(t, n)) {
            const n = fJe(t);
            (aJe(e, i, n, e.type_), OJe(t));
          }
        } else JQe(r) && FJe(r, t, n);
      })),
    e
  );
}
var BJe = {
    get(e, t) {
      if (t === HQe) return e;
      const n = pJe(e);
      if (!oJe(n, t, e.type_))
        return (function (e, t, n) {
          const i = HJe(t, n);
          return i ? (XQe in i ? i[XQe] : i.get?.call(e.draft_)) : void 0;
        })(e, n, t);
      const i = n[t];
      if (e.finalized_ || !JQe(i)) return i;
      if (i === WJe(e.base_, t)) {
        UJe(e);
        const n = 1 === e.type_ ? +t : t,
          r = $Je(e.scope_, i, e, n);
        return (e.copy_[n] = r);
      }
      return i;
    },
    has: (e, t) => t in pJe(e),
    ownKeys: (e) => Reflect.ownKeys(pJe(e)),
    set(e, t, n) {
      const i = HJe(pJe(e), t);
      if (i?.set) return (i.set.call(e.draft_, n), !0);
      if (!e.modified_) {
        const i = WJe(pJe(e), t),
          r = i?.[HQe];
        if (r && r.base_ === n) return ((e.copy_[t] = n), e.assigned_.set(t, !1), !0);
        if (
          (function (e, t) {
            return e === t ? 0 !== e || 1 / e == 1 / t : e != e && t != t;
          })(n, i) &&
          (void 0 !== n || oJe(e.base_, t, e.type_))
        )
          return !0;
        (UJe(e), zJe(e));
      }
      return (
        (e.copy_[t] === n && (void 0 !== n || t in e.copy_)) ||
          (Number.isNaN(n) && Number.isNaN(e.copy_[t])) ||
          ((e.copy_[t] = n),
          e.assigned_.set(t, !0),
          (function (e, t, n) {
            const { scope_: i } = e;
            if (QQe(n)) {
              const r = n[HQe];
              MJe(r, i) &&
                r.callbacks_.push(function () {
                  UJe(e);
                  const i = fJe(r);
                  PJe(e, n, i, t);
                });
            } else
              JQe(n) &&
                e.callbacks_.push(function () {
                  const r = pJe(e);
                  sJe(r, t, e.type_) === n &&
                    i.drafts_.length > 1 &&
                    !0 === (e.assigned_.get(t) ?? !1) &&
                    e.copy_ &&
                    FJe(sJe(e.copy_, t, e.type_), i.handledSet_, i);
                });
          })(e, t, n)),
        !0
      );
    },
    deleteProperty: (e, t) => (
      UJe(e),
      void 0 !== WJe(e.base_, t) || t in e.base_
        ? (e.assigned_.set(t, !1), zJe(e))
        : e.assigned_.delete(t),
      e.copy_ && delete e.copy_[t],
      !0
    ),
    getOwnPropertyDescriptor(e, t) {
      const n = pJe(e),
        i = Reflect.getOwnPropertyDescriptor(n, t);
      return i
        ? { [YQe]: !0, [GQe]: 1 !== e.type_ || "length" !== t, [ZQe]: i[ZQe], [XQe]: n[t] }
        : i;
    },
    defineProperty() {
      zQe(11);
    },
    getPrototypeOf: (e) => $Qe(e.base_),
    setPrototypeOf() {
      zQe(12);
    },
  },
  VJe = {};
function WJe(e, t) {
  const n = e[HQe];
  return (n ? pJe(n) : e)[t];
}
function HJe(e, t) {
  if (!(t in e)) return;
  let n = $Qe(e);
  for (; n; ) {
    const e = Object.getOwnPropertyDescriptor(n, t);
    if (e) return e;
    n = $Qe(n);
  }
}
function zJe(e) {
  e.modified_ || ((e.modified_ = !0), e.parent_ && zJe(e.parent_));
}
function UJe(e) {
  e.copy_ ||
    ((e.assigned_ = new Map()), (e.copy_ = mJe(e.base_, e.scope_.immer_.useStrictShallowCopy_)));
}
(iJe(BJe, (e, t) => {
  VJe[e] = function () {
    const e = arguments;
    return ((e[0] = e[0][0]), t.apply(this, e));
  };
}),
  (VJe.deleteProperty = function (e, t) {
    return VJe.set.call(this, e, t, void 0);
  }),
  (VJe.set = function (e, t, n) {
    return BJe.set.call(this, e[0], t, n, e[0]);
  }));
function $Je(e, t, n, i) {
  const [r, o] = cJe(t)
    ? CJe(yJe).proxyMap_(t, n)
    : dJe(t)
      ? CJe(yJe).proxySet_(t, n)
      : (function (e, t) {
          const n = lJe(e),
            i = {
              type_: n ? 1 : 0,
              scope_: t ? t.scope_ : kJe(),
              modified_: !1,
              finalized_: !1,
              assigned_: void 0,
              parent_: t,
              base_: e,
              draft_: null,
              copy_: null,
              revoke_: null,
              isManual_: !1,
              callbacks_: void 0,
            };
          let r = i,
            o = BJe;
          n && ((r = [i]), (o = VJe));
          const { revoke: s, proxy: a } = Proxy.revocable(r, o);
          return ((i.draft_ = a), (i.revoke_ = s), [a, i]);
        })(t, n);
  return (
    (n?.scope_ ?? kJe()).drafts_.push(r),
    (o.callbacks_ = n?.callbacks_ ?? []),
    (o.key_ = i),
    n && void 0 !== i
      ? (function (e, t, n) {
          e.callbacks_.push(function (i) {
            const r = t;
            if (!r || !MJe(r, i)) return;
            i.mapSetPlugin_?.fixSetContents(r);
            const o = fJe(r);
            (PJe(e, r.draft_ ?? r, o, n), jJe(r, i));
          });
        })(n, o, i)
      : o.callbacks_.push(function (e) {
          e.mapSetPlugin_?.fixSetContents(o);
          const { patchPlugin_: t } = e;
          o.modified_ && t && t.generatePatches_(o, [], e);
        }),
    r
  );
}
function qJe(e) {
  if (!JQe(e) || bJe(e)) return e;
  const t = e[HQe];
  let n,
    i = !0;
  if (t) {
    if (!t.modified_) return t.base_;
    ((t.finalized_ = !0),
      (n = mJe(e, t.scope_.immer_.useStrictShallowCopy_)),
      (i = t.scope_.immer_.shouldUseStrictIteration()));
  } else n = mJe(e, !0);
  return (
    iJe(
      n,
      (e, t) => {
        aJe(n, e, qJe(t));
      },
      i,
    ),
    t && (t.finalized_ = !1),
    n
  );
}
var KJe = new (class {
    constructor(e) {
      ((this.autoFreeze_ = !0),
        (this.useStrictShallowCopy_ = !1),
        (this.useStrictIteration_ = !1),
        (this.produce = (e, t, n) => {
          if (hJe(e) && !hJe(t)) {
            const n = t;
            t = e;
            const i = this;
            return function (e = n, ...r) {
              return i.produce(e, (e) => t.call(this, e, ...r));
            };
          }
          let i;
          if ((hJe(t) || zQe(6), void 0 === n || hJe(n) || zQe(7), JQe(e))) {
            const r = DJe(this),
              o = $Je(r, e, void 0);
            let s = !0;
            try {
              ((i = t(o)), (s = !1));
            } finally {
              s ? NJe(r) : LJe(r);
            }
            return (EJe(r, n), IJe(i, r));
          }
          if (!e || !uJe(e)) {
            if (
              ((i = t(e)),
              void 0 === i && (i = e),
              i === VQe && (i = void 0),
              this.autoFreeze_ && _Je(i, !0),
              n)
            ) {
              const t = [],
                r = [];
              (CJe(xJe).generateReplacementPatches_(e, i, { patches_: t, inversePatches_: r }),
                n(t, r));
            }
            return i;
          }
          zQe(1);
        }),
        (this.produceWithPatches = (e, t) => {
          if (hJe(e)) return (t, ...n) => this.produceWithPatches(t, (t) => e(t, ...n));
          let n, i;
          const r = this.produce(e, t, (e, t) => {
            ((n = e), (i = t));
          });
          return [r, n, i];
        }),
        gJe(e?.autoFreeze) && this.setAutoFreeze(e.autoFreeze),
        gJe(e?.useStrictShallowCopy) && this.setUseStrictShallowCopy(e.useStrictShallowCopy),
        gJe(e?.useStrictIteration) && this.setUseStrictIteration(e.useStrictIteration));
    }
    createDraft(e) {
      (JQe(e) || zQe(8),
        QQe(e) &&
          (e = (function (e) {
            QQe(e) || zQe(10);
            return qJe(e);
          })(e)));
      const t = DJe(this),
        n = $Je(t, e, void 0);
      return ((n[HQe].isManual_ = !0), LJe(t), n);
    }
    finishDraft(e, t) {
      const n = e && e[HQe];
      (n && n.isManual_) || zQe(9);
      const { scope_: i } = n;
      return (EJe(i, t), IJe(void 0, i));
    }
    setAutoFreeze(e) {
      this.autoFreeze_ = e;
    }
    setUseStrictShallowCopy(e) {
      this.useStrictShallowCopy_ = e;
    }
    setUseStrictIteration(e) {
      this.useStrictIteration_ = e;
    }
    shouldUseStrictIteration() {
      return this.useStrictIteration_;
    }
    applyPatches(e, t) {
      let n;
      for (n = t.length - 1; n >= 0; n--) {
        const i = t[n];
        if (0 === i.path.length && "replace" === i.op) {
          e = i.value;
          break;
        }
      }
      n > -1 && (t = t.slice(n + 1));
      const i = CJe(xJe).applyPatches_;
      return QQe(e) ? i(e, t) : this.produce(e, (e) => i(e, t));
    }
  })(),
  GJe = KJe.produce;
var ZJe = (e) => (Array.isArray(e) ? e : [e]);
function YJe(e) {
  const t = Array.isArray(e[0]) ? e[0] : e;
  return (
    (function (
      e,
      t = "expected all items to be functions, instead received the following types: ",
    ) {
      if (!e.every((e) => "function" == typeof e)) {
        const n = e
          .map((e) => ("function" == typeof e ? `function ${e.name || "unnamed"}()` : typeof e))
          .join(", ");
        throw new TypeError(`${t}[${n}]`);
      }
    })(
      t,
      "createSelector expects all input-selectors to be functions, but received the following types: ",
    ),
    t
  );
}
var XJe =
  "undefined" != typeof WeakRef
    ? WeakRef
    : class {
        constructor(e) {
          this.value = e;
        }
        deref() {
          return this.value;
        }
      };
function QJe() {
  return { s: 0, v: void 0, o: null, p: null };
}
function JJe(e, t = {}) {
  let n = { s: 0, v: void 0, o: null, p: null };
  const { resultEqualityCheck: i } = t;
  let r,
    o = 0;
  function s() {
    let t = n;
    const { length: s } = arguments;
    for (let e = 0, n = s; e < n; e++) {
      const n = arguments[e];
      if ("function" == typeof n || ("object" == typeof n && null !== n)) {
        let e = t.o;
        null === e && (t.o = e = new WeakMap());
        const i = e.get(n);
        void 0 === i ? ((t = QJe()), e.set(n, t)) : (t = i);
      } else {
        let e = t.p;
        null === e && (t.p = e = new Map());
        const i = e.get(n);
        void 0 === i ? ((t = QJe()), e.set(n, t)) : (t = i);
      }
    }
    const a = t;
    let l;
    if (1 === t.s) l = t.v;
    else if (((l = e.apply(null, arguments)), o++, i)) {
      const e = r?.deref?.() ?? r;
      null != e && i(e, l) && ((l = e), 0 !== o && o--);
      r = ("object" == typeof l && null !== l) || "function" == typeof l ? new XJe(l) : l;
    }
    return ((a.s = 1), (a.v = l), l);
  }
  return (
    (s.clearCache = () => {
      ((n = { s: 0, v: void 0, o: null, p: null }), s.resetResultsCount());
    }),
    (s.resultsCount = () => o),
    (s.resetResultsCount = () => {
      o = 0;
    }),
    s
  );
}
function e0e(e, ...t) {
  const n = "function" == typeof e ? { memoize: e, memoizeOptions: t } : e,
    i = (...e) => {
      let t,
        i = 0,
        r = 0,
        o = {},
        s = e.pop();
      ("object" == typeof s && ((o = s), (s = e.pop())),
        (function (e, t = "expected a function, instead received " + typeof e) {
          if ("function" != typeof e) throw new TypeError(t);
        })(
          s,
          `createSelector expects an output function after the inputs, but received: [${typeof s}]`,
        ));
      const a = { ...n, ...o },
        {
          memoize: l,
          memoizeOptions: c = [],
          argsMemoize: d = JJe,
          argsMemoizeOptions: u = [],
        } = a,
        h = ZJe(c),
        g = ZJe(u),
        p = YJe(e),
        f = l(
          function () {
            return (i++, s.apply(null, arguments));
          },
          ...h,
        ),
        m = d(
          function () {
            r++;
            const e = (function (e, t) {
              const n = [],
                { length: i } = e;
              for (let r = 0; r < i; r++) n.push(e[r].apply(null, t));
              return n;
            })(p, arguments);
            return ((t = f.apply(null, e)), t);
          },
          ...g,
        );
      return Object.assign(m, {
        resultFunc: s,
        memoizedResultFunc: f,
        dependencies: p,
        dependencyRecomputations: () => r,
        resetDependencyRecomputations: () => {
          r = 0;
        },
        lastResult: () => t,
        recomputations: () => i,
        resetRecomputations: () => {
          i = 0;
        },
        memoize: l,
        argsMemoize: d,
      });
    };
  return (Object.assign(i, { withTypes: () => i }), i);
}
var t0e = e0e(JJe),
  n0e = Object.assign(
    (e, t = t0e) => {
      !(function (e, t = "expected an object, instead received " + typeof e) {
        if ("object" != typeof e) throw new TypeError(t);
      })(
        e,
        "createStructuredSelector expects first argument to be an object where each property is a selector, instead received a " +
          typeof e,
      );
      const n = Object.keys(e),
        i = t(
          n.map((t) => e[t]),
          (...e) => e.reduce((e, t, i) => ((e[n[i]] = t), e), {}),
        );
      return i;
    },
    { withTypes: () => n0e },
  );
function i0e(e) {
  return ({ dispatch: t, getState: n }) =>
    (i) =>
    (r) =>
      "function" == typeof r ? r(t, n, e) : i(r);
}
var r0e = i0e(),
  o0e = i0e,
  s0e =
    "undefined" != typeof window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
      ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
      : function () {
          if (0 !== arguments.length)
            return "object" == typeof arguments[0] ? BQe : BQe.apply(null, arguments);
        };
function a0e(e, t) {
  function n(...n) {
    if (t) {
      let i = t(...n);
      if (!i) throw new Error(L0e(0));
      return {
        type: e,
        payload: i.payload,
        ...("meta" in i && { meta: i.meta }),
        ...("error" in i && { error: i.error }),
      };
    }
    return { type: e, payload: n[0] };
  }
  return (
    (n.toString = () => `${e}`),
    (n.type = e),
    (n.match = (t) =>
      (function (e) {
        return PQe(e) && "type" in e && "string" == typeof e.type;
      })(t) && t.type === e),
    n
  );
}
var l0e = class e extends Array {
  constructor(...t) {
    (super(...t), Object.setPrototypeOf(this, e.prototype));
  }
  static get [Symbol.species]() {
    return e;
  }
  concat(...e) {
    return super.concat.apply(this, e);
  }
  prepend(...t) {
    return 1 === t.length && Array.isArray(t[0])
      ? new e(...t[0].concat(this))
      : new e(...t.concat(this));
  }
};
function c0e(e) {
  return JQe(e) ? GJe(e, () => {}) : e;
}
function d0e(e, t, n) {
  return e.has(t) ? e.get(t) : e.set(t, n(t)).get(t);
}
var u0e = (e) => (t) => {
    setTimeout(t, e);
  },
  h0e = (e) =>
    function (t) {
      const { autoBatch: n = !0 } = t ?? {};
      let i = new l0e(e);
      return (
        n &&
          i.push(
            (
              (e = { type: "raf" }) =>
              (t) =>
              (...n) => {
                const i = t(...n);
                let r = !0,
                  o = !1,
                  s = !1;
                const a = new Set(),
                  l =
                    "tick" === e.type
                      ? queueMicrotask
                      : "raf" === e.type
                        ? "undefined" != typeof window && window.requestAnimationFrame
                          ? window.requestAnimationFrame
                          : u0e(10)
                        : "callback" === e.type
                          ? e.queueNotification
                          : u0e(e.timeout),
                  c = () => {
                    ((s = !1), o && ((o = !1), a.forEach((e) => e())));
                  };
                return Object.assign({}, i, {
                  subscribe(e) {
                    const t = i.subscribe(() => r && e());
                    return (
                      a.add(e),
                      () => {
                        (t(), a.delete(e));
                      }
                    );
                  },
                  dispatch(e) {
                    try {
                      return (
                        (r = !e?.meta?.RTK_autoBatch),
                        (o = !r),
                        o && (s || ((s = !0), l(c))),
                        i.dispatch(e)
                      );
                    } finally {
                      r = !0;
                    }
                  },
                });
              }
            )("object" == typeof n ? n : void 0),
          ),
        i
      );
    };
function g0e(e) {
  const t = {},
    n = [];
  let i;
  const r = {
    addCase(e, n) {
      const i = "string" == typeof e ? e : e.type;
      if (!i) throw new Error(L0e(28));
      if (i in t) throw new Error(L0e(29));
      return ((t[i] = n), r);
    },
    addAsyncThunk: (e, i) => (
      i.pending && (t[e.pending.type] = i.pending),
      i.rejected && (t[e.rejected.type] = i.rejected),
      i.fulfilled && (t[e.fulfilled.type] = i.fulfilled),
      i.settled && n.push({ matcher: e.settled, reducer: i.settled }),
      r
    ),
    addMatcher: (e, t) => (n.push({ matcher: e, reducer: t }), r),
    addDefaultCase: (e) => ((i = e), r),
  };
  return (e(r), [t, n, i]);
}
function p0e(...e) {
  return (t) =>
    e.some((e) =>
      ((e, t) => (((e) => e && "function" == typeof e.match)(e) ? e.match(t) : e(t)))(e, t),
    );
}
var f0e = ["name", "message", "stack", "code"],
  m0e = class {
    constructor(e, t) {
      ((this.payload = e), (this.meta = t));
    }
    _type;
  },
  _0e = class {
    constructor(e, t) {
      ((this.payload = e), (this.meta = t));
    }
    _type;
  },
  v0e = (e) => {
    if ("object" == typeof e && null !== e) {
      const t = {};
      for (const n of f0e) "string" == typeof e[n] && (t[n] = e[n]);
      return t;
    }
    return { message: String(e) };
  },
  b0e = "External signal was aborted",
  y0e = (() => {
    function e(e, t, n) {
      const i = a0e(e + "/fulfilled", (e, t, n, i) => ({
          payload: e,
          meta: { ...(i || {}), arg: n, requestId: t, requestStatus: "fulfilled" },
        })),
        r = a0e(e + "/pending", (e, t, n) => ({
          payload: void 0,
          meta: { ...(n || {}), arg: t, requestId: e, requestStatus: "pending" },
        })),
        o = a0e(e + "/rejected", (e, t, i, r, o) => ({
          payload: r,
          error: ((n && n.serializeError) || v0e)(e || "Rejected"),
          meta: {
            ...(o || {}),
            arg: i,
            requestId: t,
            rejectedWithValue: !!r,
            requestStatus: "rejected",
            aborted: "AbortError" === e?.name,
            condition: "ConditionError" === e?.name,
          },
        }));
      return Object.assign(
        function (e, { signal: s } = {}) {
          return (a, l, c) => {
            const d = n?.idGenerator
                ? n.idGenerator(e)
                : ((e = 21) => {
                    let t = "",
                      n = e;
                    for (; n--; )
                      t += "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[
                        (64 * Math.random()) | 0
                      ];
                    return t;
                  })(),
              u = new AbortController();
            let h, g;
            function p(e) {
              ((g = e), u.abort());
            }
            s && (s.aborted ? p(b0e) : s.addEventListener("abort", () => p(b0e), { once: !0 }));
            const f = (async function () {
              let s;
              try {
                let o = n?.condition?.(e, { getState: l, extra: c });
                if (
                  (null !== (f = o) &&
                    "object" == typeof f &&
                    "function" == typeof f.then &&
                    (o = await o),
                  !1 === o || u.signal.aborted)
                )
                  throw {
                    name: "ConditionError",
                    message: "Aborted due to condition callback returning false.",
                  };
                const m = new Promise((e, t) => {
                  ((h = () => {
                    t({ name: "AbortError", message: g || "Aborted" });
                  }),
                    u.signal.addEventListener("abort", h, { once: !0 }));
                });
                (a(
                  r(d, e, n?.getPendingMeta?.({ requestId: d, arg: e }, { getState: l, extra: c })),
                ),
                  (s = await Promise.race([
                    m,
                    Promise.resolve(
                      t(e, {
                        dispatch: a,
                        getState: l,
                        extra: c,
                        requestId: d,
                        signal: u.signal,
                        abort: p,
                        rejectWithValue: (e, t) => new m0e(e, t),
                        fulfillWithValue: (e, t) => new _0e(e, t),
                      }),
                    ).then((t) => {
                      if (t instanceof m0e) throw t;
                      return t instanceof _0e ? i(t.payload, d, e, t.meta) : i(t, d, e);
                    }),
                  ])));
              } catch (m) {
                s = m instanceof m0e ? o(null, d, e, m.payload, m.meta) : o(m, d, e);
              } finally {
                h && u.signal.removeEventListener("abort", h);
              }
              var f;
              return (
                (n && !n.dispatchConditionRejection && o.match(s) && s.meta.condition) || a(s),
                s
              );
            })();
            return Object.assign(f, { abort: p, requestId: d, arg: e, unwrap: () => f.then(x0e) });
          };
        },
        { pending: r, rejected: o, fulfilled: i, settled: p0e(o, i), typePrefix: e },
      );
    }
    return ((e.withTypes = () => e), e);
  })();
function x0e(e) {
  if (e.meta && e.meta.rejectedWithValue) throw e.payload;
  if (e.error) throw e.error;
  return e.payload;
}
var w0e = Symbol.for("rtk-slice-createasyncthunk");
function C0e(e, t) {
  return `${e}/${t}`;
}
function S0e({ creators: e } = {}) {
  const t = e?.asyncThunk?.[w0e];
  return function (e) {
    const { name: n, reducerPath: i = n } = e;
    if (!n) throw new Error(L0e(11));
    const r =
        ("function" == typeof e.reducers
          ? e.reducers(
              (function () {
                function e(e, t) {
                  return { _reducerDefinitionType: "asyncThunk", payloadCreator: e, ...t };
                }
                return (
                  (e.withTypes = () => e),
                  {
                    reducer: (e) =>
                      Object.assign({ [e.name]: (...t) => e(...t) }[e.name], {
                        _reducerDefinitionType: "reducer",
                      }),
                    preparedReducer: (e, t) => ({
                      _reducerDefinitionType: "reducerWithPrepare",
                      prepare: e,
                      reducer: t,
                    }),
                    asyncThunk: e,
                  }
                );
              })(),
            )
          : e.reducers) || {},
      o = Object.keys(r),
      s = {
        sliceCaseReducersByName: {},
        sliceCaseReducersByType: {},
        actionCreators: {},
        sliceMatchers: [],
      },
      a = {
        addCase(e, t) {
          const n = "string" == typeof e ? e : e.type;
          if (!n) throw new Error(L0e(12));
          if (n in s.sliceCaseReducersByType) throw new Error(L0e(13));
          return ((s.sliceCaseReducersByType[n] = t), a);
        },
        addMatcher: (e, t) => (s.sliceMatchers.push({ matcher: e, reducer: t }), a),
        exposeAction: (e, t) => ((s.actionCreators[e] = t), a),
        exposeCaseReducer: (e, t) => ((s.sliceCaseReducersByName[e] = t), a),
      };
    function l() {
      const [t = {}, n = [], i] =
          "function" == typeof e.extraReducers ? g0e(e.extraReducers) : [e.extraReducers],
        r = { ...t, ...s.sliceCaseReducersByType };
      return (function (e, t) {
        let n,
          [i, r, o] = g0e(t);
        if (
          (function (e) {
            return "function" == typeof e;
          })(e)
        )
          n = () => c0e(e());
        else {
          const t = c0e(e);
          n = () => t;
        }
        function s(e = n(), t) {
          let s = [i[t.type], ...r.filter(({ matcher: e }) => e(t)).map(({ reducer: e }) => e)];
          return (
            0 === s.filter((e) => !!e).length && (s = [o]),
            s.reduce((e, n) => {
              if (n) {
                if (QQe(e)) {
                  const i = n(e, t);
                  return void 0 === i ? e : i;
                }
                if (JQe(e)) return GJe(e, (e) => n(e, t));
                {
                  const i = n(e, t);
                  if (void 0 === i) {
                    if (null === e) return e;
                    throw Error(
                      "A case reducer on a non-draftable value must not return undefined",
                    );
                  }
                  return i;
                }
              }
              return e;
            }, e)
          );
        }
        return ((s.getInitialState = n), s);
      })(e.initialState, (e) => {
        for (let t in r) e.addCase(t, r[t]);
        for (let t of s.sliceMatchers) e.addMatcher(t.matcher, t.reducer);
        for (let t of n) e.addMatcher(t.matcher, t.reducer);
        i && e.addDefaultCase(i);
      });
    }
    o.forEach((i) => {
      const o = r[i],
        s = { reducerName: i, type: C0e(n, i), createNotation: "function" == typeof e.reducers };
      !(function (e) {
        return "asyncThunk" === e._reducerDefinitionType;
      })(o)
        ? (function ({ type: e, reducerName: t, createNotation: n }, i, r) {
            let o, s;
            if ("reducer" in i) {
              if (
                n &&
                !(function (e) {
                  return "reducerWithPrepare" === e._reducerDefinitionType;
                })(i)
              )
                throw new Error(L0e(17));
              ((o = i.reducer), (s = i.prepare));
            } else o = i;
            r.addCase(e, o)
              .exposeCaseReducer(t, o)
              .exposeAction(t, s ? a0e(e, s) : a0e(e));
          })(s, o, a)
        : (function ({ type: e, reducerName: t }, n, i, r) {
            if (!r) throw new Error(L0e(18));
            const {
                payloadCreator: o,
                fulfilled: s,
                pending: a,
                rejected: l,
                settled: c,
                options: d,
              } = n,
              u = r(e, o, d);
            (i.exposeAction(t, u), s && i.addCase(u.fulfilled, s));
            a && i.addCase(u.pending, a);
            l && i.addCase(u.rejected, l);
            c && i.addMatcher(u.settled, c);
            i.exposeCaseReducer(t, {
              fulfilled: s || N0e,
              pending: a || N0e,
              rejected: l || N0e,
              settled: c || N0e,
            });
          })(s, o, a, t);
    });
    const c = (e) => e,
      d = new Map(),
      u = new WeakMap();
    let h;
    function g(e, t) {
      return (h || (h = l()), h(e, t));
    }
    function p() {
      return (h || (h = l()), h.getInitialState());
    }
    function f(t, n = !1) {
      function i(e) {
        let r = e[t];
        return (void 0 === r && n && (r = d0e(u, i, p)), r);
      }
      function r(t = c) {
        const i = d0e(d, n, () => new WeakMap());
        return d0e(i, t, () => {
          const i = {};
          for (const [r, o] of Object.entries(e.selectors ?? {}))
            i[r] = k0e(o, t, () => d0e(u, t, p), n);
          return i;
        });
      }
      return {
        reducerPath: t,
        getSelectors: r,
        get selectors() {
          return r(i);
        },
        selectSlice: i,
      };
    }
    const m = {
      name: n,
      reducer: g,
      actions: s.actionCreators,
      caseReducers: s.sliceCaseReducersByName,
      getInitialState: p,
      ...f(i),
      injectInto(e, { reducerPath: t, ...n } = {}) {
        const r = t ?? i;
        return (e.inject({ reducerPath: r, reducer: g }, n), { ...m, ...f(r, !0) });
      },
    };
    return m;
  };
}
function k0e(e, t, n, i) {
  function r(r, ...o) {
    let s = t(r);
    return (void 0 === s && i && (s = n()), e(s, ...o));
  }
  return ((r.unwrapped = e), r);
}
var E0e = S0e();
function N0e() {}
function L0e(e) {
  return `Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `;
}
const D0e = {
    token: Am()?.value || "",
    userInfo: null,
    isLoggedIn: !!Am()?.value,
    loading: !1,
    error: null,
  },
  T0e = y0e("user/fetchUserInfo", async () => (await TL("/user/info")).data, {
    condition: (e, { getState: t }) => {
      const { user: n } = t();
      return !!n.token && !n.loading;
    },
  }),
  I0e = E0e({
    name: "user",
    initialState: D0e,
    reducers: {
      setToken(e, t) {
        ((e.token = t.payload), (e.isLoggedIn = !!t.payload));
      },
      resetUserState: () => D0e,
    },
    extraReducers: (e) => {
      e.addCase(T0e.pending, (e) => {
        ((e.loading = !0), (e.error = null));
      })
        .addCase(T0e.fulfilled, (e, t) => {
          ((e.loading = !1), (e.userInfo = t.payload), (e.error = null));
        })
        .addCase(T0e.rejected, (e, t) => {
          if (
            ((e.loading = !1), (e.error = t.error.message || "Failed to fetch user info"), !e.token)
          )
            return D0e;
        });
    },
  }),
  { setToken: R0e, resetUserState: O0e } = I0e.actions,
  M0e = (e) => e.user.userInfo,
  A0e = (function (e) {
    const t = function (e) {
        const {
          thunk: t = !0,
          immutableCheck: n = !0,
          serializableCheck: i = !0,
          actionCreatorCheck: r = !0,
        } = e ?? {};
        let o = new l0e();
        return (
          t &&
            ((function (e) {
              return "boolean" == typeof e;
            })(t)
              ? o.push(r0e)
              : o.push(o0e(t.extraArgument))),
          o
        );
      },
      { reducer: n, middleware: i, devTools: r = !0, preloadedState: o, enhancers: s } = e || {};
    let a, l;
    if ("function" == typeof n) a = n;
    else {
      if (!PQe(n)) throw new Error(L0e(1));
      a = FQe(n);
    }
    l = "function" == typeof i ? i(t) : t();
    let c = BQe;
    r && (c = s0e({ trace: !1, ...("object" == typeof r && r) }));
    const d = (function (...e) {
        return (t) => (n, i) => {
          const r = t(n, i);
          let o = () => {
            throw new Error(RQe(15));
          };
          const s = { getState: r.getState, dispatch: (e, ...t) => o(e, ...t) },
            a = e.map((e) => e(s));
          return ((o = BQe(...a)(r.dispatch)), { ...r, dispatch: o });
        };
      })(...l),
      u = h0e(d);
    return jQe(a, o, c(...("function" == typeof s ? s(u) : u())));
  })({ reducer: { user: I0e.reducer } });
Am()?.value && A0e.dispatch(T0e());
const P0e = new (class {
  #K;
  #B;
  #h;
  #G;
  #Z;
  #Y;
  #X;
  #Q;
  constructor(e = {}) {
    ((this.#K = e.queryCache || new oC()),
      (this.#B = e.mutationCache || new nC()),
      (this.#h = e.defaultOptions || {}),
      (this.#G = new Map()),
      (this.#Z = new Map()),
      (this.#Y = 0));
  }
  mount() {
    (this.#Y++,
      1 === this.#Y &&
        ((this.#X = Ow.subscribe(async (e) => {
          e && (await this.resumePausedMutations(), this.#K.onFocus());
        })),
        (this.#Q = jw.subscribe(async (e) => {
          e && (await this.resumePausedMutations(), this.#K.onOnline());
        }))));
  }
  unmount() {
    (this.#Y--,
      0 === this.#Y && (this.#X?.(), (this.#X = void 0), this.#Q?.(), (this.#Q = void 0)));
  }
  isFetching(e) {
    return this.#K.findAll({ ...e, fetchStatus: "fetching" }).length;
  }
  isMutating(e) {
    return this.#B.findAll({ ...e, status: "pending" }).length;
  }
  getQueryData(e) {
    const t = this.defaultQueryOptions({ queryKey: e });
    return this.#K.get(t.queryHash)?.state.data;
  }
  ensureQueryData(e) {
    const t = this.defaultQueryOptions(e),
      n = this.#K.build(this, t),
      i = n.state.data;
    return void 0 === i
      ? this.fetchQuery(e)
      : (e.revalidateIfStale && n.isStaleByTime(pw(t.staleTime, n)) && this.prefetchQuery(t),
        Promise.resolve(i));
  }
  getQueriesData(e) {
    return this.#K.findAll(e).map(({ queryKey: e, state: t }) => [e, t.data]);
  }
  setQueryData(e, t, n) {
    const i = this.defaultQueryOptions({ queryKey: e }),
      r = this.#K.get(i.queryHash),
      o = r?.state.data,
      s = (function (e, t) {
        return "function" == typeof e ? e(t) : e;
      })(t, o);
    if (void 0 !== s) return this.#K.build(this, i).setData(s, { ...n, manual: !0 });
  }
  setQueriesData(e, t, n) {
    return Pw.batch(() =>
      this.#K.findAll(e).map(({ queryKey: e }) => [e, this.setQueryData(e, t, n)]),
    );
  }
  getQueryState(e) {
    const t = this.defaultQueryOptions({ queryKey: e });
    return this.#K.get(t.queryHash)?.state;
  }
  removeQueries(e) {
    const t = this.#K;
    Pw.batch(() => {
      t.findAll(e).forEach((e) => {
        t.remove(e);
      });
    });
  }
  resetQueries(e, t) {
    const n = this.#K;
    return Pw.batch(
      () => (
        n.findAll(e).forEach((e) => {
          e.reset();
        }),
        this.refetchQueries({ type: "active", ...e }, t)
      ),
    );
  }
  cancelQueries(e, t = {}) {
    const n = { revert: !0, ...t },
      i = Pw.batch(() => this.#K.findAll(e).map((e) => e.cancel(n)));
    return Promise.all(i).then(uw).catch(uw);
  }
  invalidateQueries(e, t = {}) {
    return Pw.batch(
      () => (
        this.#K.findAll(e).forEach((e) => {
          e.invalidate();
        }),
        "none" === e?.refetchType
          ? Promise.resolve()
          : this.refetchQueries({ ...e, type: e?.refetchType ?? e?.type ?? "active" }, t)
      ),
    );
  }
  refetchQueries(e, t = {}) {
    const n = { ...t, cancelRefetch: t.cancelRefetch ?? !0 },
      i = Pw.batch(() =>
        this.#K
          .findAll(e)
          .filter((e) => !e.isDisabled() && !e.isStatic())
          .map((e) => {
            let t = e.fetch(void 0, n);
            return (
              n.throwOnError || (t = t.catch(uw)),
              "paused" === e.state.fetchStatus ? Promise.resolve() : t
            );
          }),
      );
    return Promise.all(i).then(uw);
  }
  fetchQuery(e) {
    const t = this.defaultQueryOptions(e);
    void 0 === t.retry && (t.retry = !1);
    const n = this.#K.build(this, t);
    return n.isStaleByTime(pw(t.staleTime, n)) ? n.fetch(t) : Promise.resolve(n.state.data);
  }
  prefetchQuery(e) {
    return this.fetchQuery(e).then(uw).catch(uw);
  }
  fetchInfiniteQuery(e) {
    return ((e.behavior = Qw(e.pages)), this.fetchQuery(e));
  }
  prefetchInfiniteQuery(e) {
    return this.fetchInfiniteQuery(e).then(uw).catch(uw);
  }
  ensureInfiniteQueryData(e) {
    return ((e.behavior = Qw(e.pages)), this.ensureQueryData(e));
  }
  resumePausedMutations() {
    return jw.isOnline() ? this.#B.resumePausedMutations() : Promise.resolve();
  }
  getQueryCache() {
    return this.#K;
  }
  getMutationCache() {
    return this.#B;
  }
  getDefaultOptions() {
    return this.#h;
  }
  setDefaultOptions(e) {
    this.#h = e;
  }
  setQueryDefaults(e, t) {
    this.#G.set(bw(e), { queryKey: e, defaultOptions: t });
  }
  getQueryDefaults(e) {
    const t = [...this.#G.values()],
      n = {};
    return (
      t.forEach((t) => {
        yw(e, t.queryKey) && Object.assign(n, t.defaultOptions);
      }),
      n
    );
  }
  setMutationDefaults(e, t) {
    this.#Z.set(bw(e), { mutationKey: e, defaultOptions: t });
  }
  getMutationDefaults(e) {
    const t = [...this.#Z.values()],
      n = {};
    return (
      t.forEach((t) => {
        yw(e, t.mutationKey) && Object.assign(n, t.defaultOptions);
      }),
      n
    );
  }
  defaultQueryOptions(e) {
    if (e._defaulted) return e;
    const t = { ...this.#h.queries, ...this.getQueryDefaults(e.queryKey), ...e, _defaulted: !0 };
    return (
      t.queryHash || (t.queryHash = vw(t.queryKey, t)),
      void 0 === t.refetchOnReconnect && (t.refetchOnReconnect = "always" !== t.networkMode),
      void 0 === t.throwOnError && (t.throwOnError = !!t.suspense),
      !t.networkMode && t.persister && (t.networkMode = "offlineFirst"),
      t.queryFn === Tw && (t.enabled = !1),
      t
    );
  }
  defaultMutationOptions(e) {
    return e?._defaulted
      ? e
      : {
          ...this.#h.mutations,
          ...(e?.mutationKey && this.getMutationDefaults(e.mutationKey)),
          ...e,
          _defaulted: !0,
        };
  }
  clear() {
    (this.#K.clear(), this.#B.clear());
  }
})({ defaultOptions: { queries: { staleTime: 3e4, retry: 1, refetchOnWindowFocus: !1 } } });
J.createRoot(document.getElementById("root")).render(
  Q.jsx(z.StrictMode, {
    children: Q.jsx(lC, {
      client: P0e,
      children: Q.jsx(cp, {
        store: A0e,
        children: Q.jsxs(Ug, {
          defaultTheme: "light",
          storageKey: "vite-ui-theme",
          children: [
            Q.jsx(bp, { children: Q.jsx(Rg, { router: DQe }) }),
            Q.jsx(yN, { richColors: !0, position: "top-right" }),
          ],
        }),
      }),
    }),
  }),
);
let j0e = class {
  constructor(e) {
    ((this._defaults = e),
      (this._worker = null),
      (this._client = null),
      (this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 3e4)),
      (this._lastUsedTime = 0),
      (this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker())));
  }
  _stopWorker() {
    (this._worker && (this._worker.dispose(), (this._worker = null)), (this._client = null));
  }
  dispose() {
    (clearInterval(this._idleCheckInterval),
      this._configChangeListener.dispose(),
      this._stopWorker());
  }
  _checkIfIdle() {
    if (!this._worker) return;
    Date.now() - this._lastUsedTime > 12e4 && this._stopWorker();
  }
  _getClient() {
    return (
      (this._lastUsedTime = Date.now()),
      this._client ||
        ((this._worker = bQe({
          moduleId: "vs/language/css/cssWorker",
          createWorker: () =>
            new Worker(
              new URL(
                "" + new URL("css.worker-Bx7Y3X-c.js", import.meta.url).href,
                import.meta.url,
              ),
              { type: "module" },
            ),
          label: this._defaults.languageId,
          createData: { options: this._defaults.options, languageId: this._defaults.languageId },
        })),
        (this._client = this._worker.getProxy())),
      this._client
    );
  }
  getLanguageServiceWorker(...e) {
    let t;
    return this._getClient()
      .then((e) => {
        t = e;
      })
      .then((t) => {
        if (this._worker) return this._worker.withSyncedResources(e);
      })
      .then((e) => t);
  }
};
var F0e,
  B0e,
  V0e,
  W0e,
  H0e,
  z0e,
  U0e,
  $0e,
  q0e,
  K0e,
  G0e,
  Z0e,
  Y0e,
  X0e,
  Q0e,
  J0e,
  e1e,
  t1e,
  n1e,
  i1e,
  r1e,
  o1e,
  s1e,
  a1e,
  l1e,
  c1e,
  d1e,
  u1e,
  h1e,
  g1e,
  p1e,
  f1e,
  m1e,
  _1e,
  v1e,
  b1e,
  y1e,
  x1e,
  w1e,
  C1e,
  S1e,
  k1e,
  E1e,
  N1e,
  L1e,
  D1e,
  T1e,
  I1e,
  R1e,
  O1e,
  M1e,
  A1e,
  P1e,
  j1e,
  F1e,
  B1e,
  V1e,
  W1e,
  H1e,
  z1e,
  U1e,
  $1e,
  q1e,
  K1e,
  G1e,
  Z1e,
  Y1e,
  X1e,
  Q1e,
  J1e,
  e2e,
  t2e,
  n2e,
  i2e,
  r2e,
  o2e,
  s2e,
  a2e,
  l2e,
  c2e;
(!(function (e) {
  e.is = function (e) {
    return "string" == typeof e;
  };
})(F0e || (F0e = {})),
  (function (e) {
    e.is = function (e) {
      return "string" == typeof e;
    };
  })(B0e || (B0e = {})),
  (function (e) {
    ((e.MIN_VALUE = -2147483648),
      (e.MAX_VALUE = 2147483647),
      (e.is = function (t) {
        return "number" == typeof t && e.MIN_VALUE <= t && t <= e.MAX_VALUE;
      }));
  })(V0e || (V0e = {})),
  (function (e) {
    ((e.MIN_VALUE = 0),
      (e.MAX_VALUE = 2147483647),
      (e.is = function (t) {
        return "number" == typeof t && e.MIN_VALUE <= t && t <= e.MAX_VALUE;
      }));
  })(W0e || (W0e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return (
        e === Number.MAX_VALUE && (e = W0e.MAX_VALUE),
        t === Number.MAX_VALUE && (t = W0e.MAX_VALUE),
        { line: e, character: t }
      );
    }),
      (e.is = function (e) {
        let t = e;
        return c2e.objectLiteral(t) && c2e.uinteger(t.line) && c2e.uinteger(t.character);
      }));
  })(H0e || (H0e = {})),
  (function (e) {
    ((e.create = function (e, t, n, i) {
      if (c2e.uinteger(e) && c2e.uinteger(t) && c2e.uinteger(n) && c2e.uinteger(i))
        return { start: H0e.create(e, t), end: H0e.create(n, i) };
      if (H0e.is(e) && H0e.is(t)) return { start: e, end: t };
      throw new Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${i}]`);
    }),
      (e.is = function (e) {
        let t = e;
        return c2e.objectLiteral(t) && H0e.is(t.start) && H0e.is(t.end);
      }));
  })(z0e || (z0e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { uri: e, range: t };
    }),
      (e.is = function (e) {
        let t = e;
        return (
          c2e.objectLiteral(t) && z0e.is(t.range) && (c2e.string(t.uri) || c2e.undefined(t.uri))
        );
      }));
  })(U0e || (U0e = {})),
  (function (e) {
    ((e.create = function (e, t, n, i) {
      return { targetUri: e, targetRange: t, targetSelectionRange: n, originSelectionRange: i };
    }),
      (e.is = function (e) {
        let t = e;
        return (
          c2e.objectLiteral(t) &&
          z0e.is(t.targetRange) &&
          c2e.string(t.targetUri) &&
          z0e.is(t.targetSelectionRange) &&
          (z0e.is(t.originSelectionRange) || c2e.undefined(t.originSelectionRange))
        );
      }));
  })($0e || ($0e = {})),
  (function (e) {
    ((e.create = function (e, t, n, i) {
      return { red: e, green: t, blue: n, alpha: i };
    }),
      (e.is = function (e) {
        const t = e;
        return (
          c2e.objectLiteral(t) &&
          c2e.numberRange(t.red, 0, 1) &&
          c2e.numberRange(t.green, 0, 1) &&
          c2e.numberRange(t.blue, 0, 1) &&
          c2e.numberRange(t.alpha, 0, 1)
        );
      }));
  })(q0e || (q0e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { range: e, color: t };
    }),
      (e.is = function (e) {
        const t = e;
        return c2e.objectLiteral(t) && z0e.is(t.range) && q0e.is(t.color);
      }));
  })(K0e || (K0e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      return { label: e, textEdit: t, additionalTextEdits: n };
    }),
      (e.is = function (e) {
        const t = e;
        return (
          c2e.objectLiteral(t) &&
          c2e.string(t.label) &&
          (c2e.undefined(t.textEdit) || i1e.is(t)) &&
          (c2e.undefined(t.additionalTextEdits) || c2e.typedArray(t.additionalTextEdits, i1e.is))
        );
      }));
  })(G0e || (G0e = {})),
  (function (e) {
    ((e.Comment = "comment"), (e.Imports = "imports"), (e.Region = "region"));
  })(Z0e || (Z0e = {})),
  (function (e) {
    ((e.create = function (e, t, n, i, r, o) {
      const s = { startLine: e, endLine: t };
      return (
        c2e.defined(n) && (s.startCharacter = n),
        c2e.defined(i) && (s.endCharacter = i),
        c2e.defined(r) && (s.kind = r),
        c2e.defined(o) && (s.collapsedText = o),
        s
      );
    }),
      (e.is = function (e) {
        const t = e;
        return (
          c2e.objectLiteral(t) &&
          c2e.uinteger(t.startLine) &&
          c2e.uinteger(t.startLine) &&
          (c2e.undefined(t.startCharacter) || c2e.uinteger(t.startCharacter)) &&
          (c2e.undefined(t.endCharacter) || c2e.uinteger(t.endCharacter)) &&
          (c2e.undefined(t.kind) || c2e.string(t.kind))
        );
      }));
  })(Y0e || (Y0e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { location: e, message: t };
    }),
      (e.is = function (e) {
        let t = e;
        return c2e.defined(t) && U0e.is(t.location) && c2e.string(t.message);
      }));
  })(X0e || (X0e = {})),
  (function (e) {
    ((e.Error = 1), (e.Warning = 2), (e.Information = 3), (e.Hint = 4));
  })(Q0e || (Q0e = {})),
  (function (e) {
    ((e.Unnecessary = 1), (e.Deprecated = 2));
  })(J0e || (J0e = {})),
  (function (e) {
    e.is = function (e) {
      const t = e;
      return c2e.objectLiteral(t) && c2e.string(t.href);
    };
  })(e1e || (e1e = {})),
  (function (e) {
    ((e.create = function (e, t, n, i, r, o) {
      let s = { range: e, message: t };
      return (
        c2e.defined(n) && (s.severity = n),
        c2e.defined(i) && (s.code = i),
        c2e.defined(r) && (s.source = r),
        c2e.defined(o) && (s.relatedInformation = o),
        s
      );
    }),
      (e.is = function (e) {
        var t;
        let n = e;
        return (
          c2e.defined(n) &&
          z0e.is(n.range) &&
          c2e.string(n.message) &&
          (c2e.number(n.severity) || c2e.undefined(n.severity)) &&
          (c2e.integer(n.code) || c2e.string(n.code) || c2e.undefined(n.code)) &&
          (c2e.undefined(n.codeDescription) ||
            c2e.string(null === (t = n.codeDescription) || void 0 === t ? void 0 : t.href)) &&
          (c2e.string(n.source) || c2e.undefined(n.source)) &&
          (c2e.undefined(n.relatedInformation) || c2e.typedArray(n.relatedInformation, X0e.is))
        );
      }));
  })(t1e || (t1e = {})),
  (function (e) {
    ((e.create = function (e, t, ...n) {
      let i = { title: e, command: t };
      return (c2e.defined(n) && n.length > 0 && (i.arguments = n), i);
    }),
      (e.is = function (e) {
        let t = e;
        return c2e.defined(t) && c2e.string(t.title) && c2e.string(t.command);
      }));
  })(n1e || (n1e = {})),
  (function (e) {
    ((e.replace = function (e, t) {
      return { range: e, newText: t };
    }),
      (e.insert = function (e, t) {
        return { range: { start: e, end: e }, newText: t };
      }),
      (e.del = function (e) {
        return { range: e, newText: "" };
      }),
      (e.is = function (e) {
        const t = e;
        return c2e.objectLiteral(t) && c2e.string(t.newText) && z0e.is(t.range);
      }));
  })(i1e || (i1e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      const i = { label: e };
      return (void 0 !== t && (i.needsConfirmation = t), void 0 !== n && (i.description = n), i);
    }),
      (e.is = function (e) {
        const t = e;
        return (
          c2e.objectLiteral(t) &&
          c2e.string(t.label) &&
          (c2e.boolean(t.needsConfirmation) || void 0 === t.needsConfirmation) &&
          (c2e.string(t.description) || void 0 === t.description)
        );
      }));
  })(r1e || (r1e = {})),
  (function (e) {
    e.is = function (e) {
      const t = e;
      return c2e.string(t);
    };
  })(o1e || (o1e = {})),
  (function (e) {
    ((e.replace = function (e, t, n) {
      return { range: e, newText: t, annotationId: n };
    }),
      (e.insert = function (e, t, n) {
        return { range: { start: e, end: e }, newText: t, annotationId: n };
      }),
      (e.del = function (e, t) {
        return { range: e, newText: "", annotationId: t };
      }),
      (e.is = function (e) {
        const t = e;
        return i1e.is(t) && (r1e.is(t.annotationId) || o1e.is(t.annotationId));
      }));
  })(s1e || (s1e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { textDocument: e, edits: t };
    }),
      (e.is = function (e) {
        let t = e;
        return c2e.defined(t) && p1e.is(t.textDocument) && Array.isArray(t.edits);
      }));
  })(a1e || (a1e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      let i = { kind: "create", uri: e };
      return (
        void 0 === t || (void 0 === t.overwrite && void 0 === t.ignoreIfExists) || (i.options = t),
        void 0 !== n && (i.annotationId = n),
        i
      );
    }),
      (e.is = function (e) {
        let t = e;
        return (
          t &&
          "create" === t.kind &&
          c2e.string(t.uri) &&
          (void 0 === t.options ||
            ((void 0 === t.options.overwrite || c2e.boolean(t.options.overwrite)) &&
              (void 0 === t.options.ignoreIfExists || c2e.boolean(t.options.ignoreIfExists)))) &&
          (void 0 === t.annotationId || o1e.is(t.annotationId))
        );
      }));
  })(l1e || (l1e = {})),
  (function (e) {
    ((e.create = function (e, t, n, i) {
      let r = { kind: "rename", oldUri: e, newUri: t };
      return (
        void 0 === n || (void 0 === n.overwrite && void 0 === n.ignoreIfExists) || (r.options = n),
        void 0 !== i && (r.annotationId = i),
        r
      );
    }),
      (e.is = function (e) {
        let t = e;
        return (
          t &&
          "rename" === t.kind &&
          c2e.string(t.oldUri) &&
          c2e.string(t.newUri) &&
          (void 0 === t.options ||
            ((void 0 === t.options.overwrite || c2e.boolean(t.options.overwrite)) &&
              (void 0 === t.options.ignoreIfExists || c2e.boolean(t.options.ignoreIfExists)))) &&
          (void 0 === t.annotationId || o1e.is(t.annotationId))
        );
      }));
  })(c1e || (c1e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      let i = { kind: "delete", uri: e };
      return (
        void 0 === t ||
          (void 0 === t.recursive && void 0 === t.ignoreIfNotExists) ||
          (i.options = t),
        void 0 !== n && (i.annotationId = n),
        i
      );
    }),
      (e.is = function (e) {
        let t = e;
        return (
          t &&
          "delete" === t.kind &&
          c2e.string(t.uri) &&
          (void 0 === t.options ||
            ((void 0 === t.options.recursive || c2e.boolean(t.options.recursive)) &&
              (void 0 === t.options.ignoreIfNotExists ||
                c2e.boolean(t.options.ignoreIfNotExists)))) &&
          (void 0 === t.annotationId || o1e.is(t.annotationId))
        );
      }));
  })(d1e || (d1e = {})),
  (function (e) {
    e.is = function (e) {
      let t = e;
      return (
        t &&
        (void 0 !== t.changes || void 0 !== t.documentChanges) &&
        (void 0 === t.documentChanges ||
          t.documentChanges.every((e) =>
            c2e.string(e.kind) ? l1e.is(e) || c1e.is(e) || d1e.is(e) : a1e.is(e),
          ))
      );
    };
  })(u1e || (u1e = {})),
  (function (e) {
    ((e.create = function (e) {
      return { uri: e };
    }),
      (e.is = function (e) {
        let t = e;
        return c2e.defined(t) && c2e.string(t.uri);
      }));
  })(h1e || (h1e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { uri: e, version: t };
    }),
      (e.is = function (e) {
        let t = e;
        return c2e.defined(t) && c2e.string(t.uri) && c2e.integer(t.version);
      }));
  })(g1e || (g1e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { uri: e, version: t };
    }),
      (e.is = function (e) {
        let t = e;
        return (
          c2e.defined(t) && c2e.string(t.uri) && (null === t.version || c2e.integer(t.version))
        );
      }));
  })(p1e || (p1e = {})),
  (function (e) {
    ((e.create = function (e, t, n, i) {
      return { uri: e, languageId: t, version: n, text: i };
    }),
      (e.is = function (e) {
        let t = e;
        return (
          c2e.defined(t) &&
          c2e.string(t.uri) &&
          c2e.string(t.languageId) &&
          c2e.integer(t.version) &&
          c2e.string(t.text)
        );
      }));
  })(f1e || (f1e = {})),
  (function (e) {
    ((e.PlainText = "plaintext"),
      (e.Markdown = "markdown"),
      (e.is = function (t) {
        const n = t;
        return n === e.PlainText || n === e.Markdown;
      }));
  })(m1e || (m1e = {})),
  (function (e) {
    e.is = function (e) {
      const t = e;
      return c2e.objectLiteral(e) && m1e.is(t.kind) && c2e.string(t.value);
    };
  })(_1e || (_1e = {})),
  (function (e) {
    ((e.Text = 1),
      (e.Method = 2),
      (e.Function = 3),
      (e.Constructor = 4),
      (e.Field = 5),
      (e.Variable = 6),
      (e.Class = 7),
      (e.Interface = 8),
      (e.Module = 9),
      (e.Property = 10),
      (e.Unit = 11),
      (e.Value = 12),
      (e.Enum = 13),
      (e.Keyword = 14),
      (e.Snippet = 15),
      (e.Color = 16),
      (e.File = 17),
      (e.Reference = 18),
      (e.Folder = 19),
      (e.EnumMember = 20),
      (e.Constant = 21),
      (e.Struct = 22),
      (e.Event = 23),
      (e.Operator = 24),
      (e.TypeParameter = 25));
  })(v1e || (v1e = {})),
  (function (e) {
    ((e.PlainText = 1), (e.Snippet = 2));
  })(b1e || (b1e = {})),
  (function (e) {
    e.Deprecated = 1;
  })(y1e || (y1e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      return { newText: e, insert: t, replace: n };
    }),
      (e.is = function (e) {
        const t = e;
        return t && c2e.string(t.newText) && z0e.is(t.insert) && z0e.is(t.replace);
      }));
  })(x1e || (x1e = {})),
  (function (e) {
    ((e.asIs = 1), (e.adjustIndentation = 2));
  })(w1e || (w1e = {})),
  (function (e) {
    e.is = function (e) {
      const t = e;
      return (
        t &&
        (c2e.string(t.detail) || void 0 === t.detail) &&
        (c2e.string(t.description) || void 0 === t.description)
      );
    };
  })(C1e || (C1e = {})),
  (function (e) {
    e.create = function (e) {
      return { label: e };
    };
  })(S1e || (S1e = {})),
  (function (e) {
    e.create = function (e, t) {
      return { items: e || [], isIncomplete: !!t };
    };
  })(k1e || (k1e = {})),
  (function (e) {
    ((e.fromPlainText = function (e) {
      return e.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
    }),
      (e.is = function (e) {
        const t = e;
        return (
          c2e.string(t) || (c2e.objectLiteral(t) && c2e.string(t.language) && c2e.string(t.value))
        );
      }));
  })(E1e || (E1e = {})),
  (function (e) {
    e.is = function (e) {
      let t = e;
      return (
        !!t &&
        c2e.objectLiteral(t) &&
        (_1e.is(t.contents) || E1e.is(t.contents) || c2e.typedArray(t.contents, E1e.is)) &&
        (void 0 === e.range || z0e.is(e.range))
      );
    };
  })(N1e || (N1e = {})),
  (function (e) {
    e.create = function (e, t) {
      return t ? { label: e, documentation: t } : { label: e };
    };
  })(L1e || (L1e = {})),
  (function (e) {
    e.create = function (e, t, ...n) {
      let i = { label: e };
      return (
        c2e.defined(t) && (i.documentation = t),
        c2e.defined(n) ? (i.parameters = n) : (i.parameters = []),
        i
      );
    };
  })(D1e || (D1e = {})),
  (function (e) {
    ((e.Text = 1), (e.Read = 2), (e.Write = 3));
  })(T1e || (T1e = {})),
  (function (e) {
    e.create = function (e, t) {
      let n = { range: e };
      return (c2e.number(t) && (n.kind = t), n);
    };
  })(I1e || (I1e = {})),
  (function (e) {
    ((e.File = 1),
      (e.Module = 2),
      (e.Namespace = 3),
      (e.Package = 4),
      (e.Class = 5),
      (e.Method = 6),
      (e.Property = 7),
      (e.Field = 8),
      (e.Constructor = 9),
      (e.Enum = 10),
      (e.Interface = 11),
      (e.Function = 12),
      (e.Variable = 13),
      (e.Constant = 14),
      (e.String = 15),
      (e.Number = 16),
      (e.Boolean = 17),
      (e.Array = 18),
      (e.Object = 19),
      (e.Key = 20),
      (e.Null = 21),
      (e.EnumMember = 22),
      (e.Struct = 23),
      (e.Event = 24),
      (e.Operator = 25),
      (e.TypeParameter = 26));
  })(R1e || (R1e = {})),
  (function (e) {
    e.Deprecated = 1;
  })(O1e || (O1e = {})),
  (function (e) {
    e.create = function (e, t, n, i, r) {
      let o = { name: e, kind: t, location: { uri: i, range: n } };
      return (r && (o.containerName = r), o);
    };
  })(M1e || (M1e = {})),
  (function (e) {
    e.create = function (e, t, n, i) {
      return void 0 !== i
        ? { name: e, kind: t, location: { uri: n, range: i } }
        : { name: e, kind: t, location: { uri: n } };
    };
  })(A1e || (A1e = {})),
  (function (e) {
    ((e.create = function (e, t, n, i, r, o) {
      let s = { name: e, detail: t, kind: n, range: i, selectionRange: r };
      return (void 0 !== o && (s.children = o), s);
    }),
      (e.is = function (e) {
        let t = e;
        return (
          t &&
          c2e.string(t.name) &&
          c2e.number(t.kind) &&
          z0e.is(t.range) &&
          z0e.is(t.selectionRange) &&
          (void 0 === t.detail || c2e.string(t.detail)) &&
          (void 0 === t.deprecated || c2e.boolean(t.deprecated)) &&
          (void 0 === t.children || Array.isArray(t.children)) &&
          (void 0 === t.tags || Array.isArray(t.tags))
        );
      }));
  })(P1e || (P1e = {})),
  (function (e) {
    ((e.Empty = ""),
      (e.QuickFix = "quickfix"),
      (e.Refactor = "refactor"),
      (e.RefactorExtract = "refactor.extract"),
      (e.RefactorInline = "refactor.inline"),
      (e.RefactorRewrite = "refactor.rewrite"),
      (e.Source = "source"),
      (e.SourceOrganizeImports = "source.organizeImports"),
      (e.SourceFixAll = "source.fixAll"));
  })(j1e || (j1e = {})),
  (function (e) {
    ((e.Invoked = 1), (e.Automatic = 2));
  })(F1e || (F1e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      let i = { diagnostics: e };
      return (null != t && (i.only = t), null != n && (i.triggerKind = n), i);
    }),
      (e.is = function (e) {
        let t = e;
        return (
          c2e.defined(t) &&
          c2e.typedArray(t.diagnostics, t1e.is) &&
          (void 0 === t.only || c2e.typedArray(t.only, c2e.string)) &&
          (void 0 === t.triggerKind ||
            t.triggerKind === F1e.Invoked ||
            t.triggerKind === F1e.Automatic)
        );
      }));
  })(B1e || (B1e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      let i = { title: e },
        r = !0;
      return (
        "string" == typeof t
          ? ((r = !1), (i.kind = t))
          : n1e.is(t)
            ? (i.command = t)
            : (i.edit = t),
        r && void 0 !== n && (i.kind = n),
        i
      );
    }),
      (e.is = function (e) {
        let t = e;
        return (
          t &&
          c2e.string(t.title) &&
          (void 0 === t.diagnostics || c2e.typedArray(t.diagnostics, t1e.is)) &&
          (void 0 === t.kind || c2e.string(t.kind)) &&
          (void 0 !== t.edit || void 0 !== t.command) &&
          (void 0 === t.command || n1e.is(t.command)) &&
          (void 0 === t.isPreferred || c2e.boolean(t.isPreferred)) &&
          (void 0 === t.edit || u1e.is(t.edit))
        );
      }));
  })(V1e || (V1e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      let n = { range: e };
      return (c2e.defined(t) && (n.data = t), n);
    }),
      (e.is = function (e) {
        let t = e;
        return c2e.defined(t) && z0e.is(t.range) && (c2e.undefined(t.command) || n1e.is(t.command));
      }));
  })(W1e || (W1e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { tabSize: e, insertSpaces: t };
    }),
      (e.is = function (e) {
        let t = e;
        return c2e.defined(t) && c2e.uinteger(t.tabSize) && c2e.boolean(t.insertSpaces);
      }));
  })(H1e || (H1e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      return { range: e, target: t, data: n };
    }),
      (e.is = function (e) {
        let t = e;
        return (
          c2e.defined(t) && z0e.is(t.range) && (c2e.undefined(t.target) || c2e.string(t.target))
        );
      }));
  })(z1e || (z1e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { range: e, parent: t };
    }),
      (e.is = function (t) {
        let n = t;
        return c2e.objectLiteral(n) && z0e.is(n.range) && (void 0 === n.parent || e.is(n.parent));
      }));
  })(U1e || (U1e = {})),
  (function (e) {
    ((e.namespace = "namespace"),
      (e.type = "type"),
      (e.class = "class"),
      (e.enum = "enum"),
      (e.interface = "interface"),
      (e.struct = "struct"),
      (e.typeParameter = "typeParameter"),
      (e.parameter = "parameter"),
      (e.variable = "variable"),
      (e.property = "property"),
      (e.enumMember = "enumMember"),
      (e.event = "event"),
      (e.function = "function"),
      (e.method = "method"),
      (e.macro = "macro"),
      (e.keyword = "keyword"),
      (e.modifier = "modifier"),
      (e.comment = "comment"),
      (e.string = "string"),
      (e.number = "number"),
      (e.regexp = "regexp"),
      (e.operator = "operator"),
      (e.decorator = "decorator"));
  })($1e || ($1e = {})),
  (function (e) {
    ((e.declaration = "declaration"),
      (e.definition = "definition"),
      (e.readonly = "readonly"),
      (e.static = "static"),
      (e.deprecated = "deprecated"),
      (e.abstract = "abstract"),
      (e.async = "async"),
      (e.modification = "modification"),
      (e.documentation = "documentation"),
      (e.defaultLibrary = "defaultLibrary"));
  })(q1e || (q1e = {})),
  (function (e) {
    e.is = function (e) {
      const t = e;
      return (
        c2e.objectLiteral(t) &&
        (void 0 === t.resultId || "string" == typeof t.resultId) &&
        Array.isArray(t.data) &&
        (0 === t.data.length || "number" == typeof t.data[0])
      );
    };
  })(K1e || (K1e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { range: e, text: t };
    }),
      (e.is = function (e) {
        const t = e;
        return null != t && z0e.is(t.range) && c2e.string(t.text);
      }));
  })(G1e || (G1e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      return { range: e, variableName: t, caseSensitiveLookup: n };
    }),
      (e.is = function (e) {
        const t = e;
        return (
          null != t &&
          z0e.is(t.range) &&
          c2e.boolean(t.caseSensitiveLookup) &&
          (c2e.string(t.variableName) || void 0 === t.variableName)
        );
      }));
  })(Z1e || (Z1e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { range: e, expression: t };
    }),
      (e.is = function (e) {
        const t = e;
        return (
          null != t && z0e.is(t.range) && (c2e.string(t.expression) || void 0 === t.expression)
        );
      }));
  })(Y1e || (Y1e = {})),
  (function (e) {
    ((e.create = function (e, t) {
      return { frameId: e, stoppedLocation: t };
    }),
      (e.is = function (e) {
        const t = e;
        return c2e.defined(t) && z0e.is(e.stoppedLocation);
      }));
  })(X1e || (X1e = {})),
  (function (e) {
    ((e.Type = 1),
      (e.Parameter = 2),
      (e.is = function (e) {
        return 1 === e || 2 === e;
      }));
  })(Q1e || (Q1e = {})),
  (function (e) {
    ((e.create = function (e) {
      return { value: e };
    }),
      (e.is = function (e) {
        const t = e;
        return (
          c2e.objectLiteral(t) &&
          (void 0 === t.tooltip || c2e.string(t.tooltip) || _1e.is(t.tooltip)) &&
          (void 0 === t.location || U0e.is(t.location)) &&
          (void 0 === t.command || n1e.is(t.command))
        );
      }));
  })(J1e || (J1e = {})),
  (function (e) {
    ((e.create = function (e, t, n) {
      const i = { position: e, label: t };
      return (void 0 !== n && (i.kind = n), i);
    }),
      (e.is = function (e) {
        const t = e;
        return (
          (c2e.objectLiteral(t) &&
            H0e.is(t.position) &&
            (c2e.string(t.label) || c2e.typedArray(t.label, J1e.is)) &&
            (void 0 === t.kind || Q1e.is(t.kind)) &&
            void 0 === t.textEdits) ||
          (c2e.typedArray(t.textEdits, i1e.is) &&
            (void 0 === t.tooltip || c2e.string(t.tooltip) || _1e.is(t.tooltip)) &&
            (void 0 === t.paddingLeft || c2e.boolean(t.paddingLeft)) &&
            (void 0 === t.paddingRight || c2e.boolean(t.paddingRight)))
        );
      }));
  })(e2e || (e2e = {})),
  (function (e) {
    e.createSnippet = function (e) {
      return { kind: "snippet", value: e };
    };
  })(t2e || (t2e = {})),
  (function (e) {
    e.create = function (e, t, n, i) {
      return { insertText: e, filterText: t, range: n, command: i };
    };
  })(n2e || (n2e = {})),
  (function (e) {
    e.create = function (e) {
      return { items: e };
    };
  })(i2e || (i2e = {})),
  (function (e) {
    ((e.Invoked = 0), (e.Automatic = 1));
  })(r2e || (r2e = {})),
  (function (e) {
    e.create = function (e, t) {
      return { range: e, text: t };
    };
  })(o2e || (o2e = {})),
  (function (e) {
    e.create = function (e, t) {
      return { triggerKind: e, selectedCompletionInfo: t };
    };
  })(s2e || (s2e = {})),
  (function (e) {
    e.is = function (e) {
      const t = e;
      return c2e.objectLiteral(t) && B0e.is(t.uri) && c2e.string(t.name);
    };
  })(a2e || (a2e = {})),
  (function (e) {
    function t(e, n) {
      if (e.length <= 1) return e;
      const i = (e.length / 2) | 0,
        r = e.slice(0, i),
        o = e.slice(i);
      (t(r, n), t(o, n));
      let s = 0,
        a = 0,
        l = 0;
      for (; s < r.length && a < o.length; ) {
        let t = n(r[s], o[a]);
        e[l++] = t <= 0 ? r[s++] : o[a++];
      }
      for (; s < r.length; ) e[l++] = r[s++];
      for (; a < o.length; ) e[l++] = o[a++];
      return e;
    }
    ((e.create = function (e, t, n, i) {
      return new d2e(e, t, n, i);
    }),
      (e.is = function (e) {
        let t = e;
        return !!(
          c2e.defined(t) &&
          c2e.string(t.uri) &&
          (c2e.undefined(t.languageId) || c2e.string(t.languageId)) &&
          c2e.uinteger(t.lineCount) &&
          c2e.func(t.getText) &&
          c2e.func(t.positionAt) &&
          c2e.func(t.offsetAt)
        );
      }),
      (e.applyEdits = function (e, n) {
        let i = e.getText(),
          r = t(n, (e, t) => {
            let n = e.range.start.line - t.range.start.line;
            return 0 === n ? e.range.start.character - t.range.start.character : n;
          }),
          o = i.length;
        for (let t = r.length - 1; t >= 0; t--) {
          let n = r[t],
            s = e.offsetAt(n.range.start),
            a = e.offsetAt(n.range.end);
          if (!(a <= o)) throw new Error("Overlapping edit");
          ((i = i.substring(0, s) + n.newText + i.substring(a, i.length)), (o = s));
        }
        return i;
      }));
  })(l2e || (l2e = {})));
class d2e {
  constructor(e, t, n, i) {
    ((this._uri = e),
      (this._languageId = t),
      (this._version = n),
      (this._content = i),
      (this._lineOffsets = void 0));
  }
  get uri() {
    return this._uri;
  }
  get languageId() {
    return this._languageId;
  }
  get version() {
    return this._version;
  }
  getText(e) {
    if (e) {
      let t = this.offsetAt(e.start),
        n = this.offsetAt(e.end);
      return this._content.substring(t, n);
    }
    return this._content;
  }
  update(e, t) {
    ((this._content = e.text), (this._version = t), (this._lineOffsets = void 0));
  }
  getLineOffsets() {
    if (void 0 === this._lineOffsets) {
      let e = [],
        t = this._content,
        n = !0;
      for (let i = 0; i < t.length; i++) {
        n && (e.push(i), (n = !1));
        let r = t.charAt(i);
        ((n = "\r" === r || "\n" === r),
          "\r" === r && i + 1 < t.length && "\n" === t.charAt(i + 1) && i++);
      }
      (n && t.length > 0 && e.push(t.length), (this._lineOffsets = e));
    }
    return this._lineOffsets;
  }
  positionAt(e) {
    e = Math.max(Math.min(e, this._content.length), 0);
    let t = this.getLineOffsets(),
      n = 0,
      i = t.length;
    if (0 === i) return H0e.create(0, e);
    for (; n < i; ) {
      let r = Math.floor((n + i) / 2);
      t[r] > e ? (i = r) : (n = r + 1);
    }
    let r = n - 1;
    return H0e.create(r, e - t[r]);
  }
  offsetAt(e) {
    let t = this.getLineOffsets();
    if (e.line >= t.length) return this._content.length;
    if (e.line < 0) return 0;
    let n = t[e.line],
      i = e.line + 1 < t.length ? t[e.line + 1] : this._content.length;
    return Math.max(Math.min(n + e.character, i), n);
  }
  get lineCount() {
    return this.getLineOffsets().length;
  }
}
!(function (e) {
  const t = Object.prototype.toString;
  ((e.defined = function (e) {
    return void 0 !== e;
  }),
    (e.undefined = function (e) {
      return void 0 === e;
    }),
    (e.boolean = function (e) {
      return !0 === e || !1 === e;
    }),
    (e.string = function (e) {
      return "[object String]" === t.call(e);
    }),
    (e.number = function (e) {
      return "[object Number]" === t.call(e);
    }),
    (e.numberRange = function (e, n, i) {
      return "[object Number]" === t.call(e) && n <= e && e <= i;
    }),
    (e.integer = function (e) {
      return "[object Number]" === t.call(e) && -2147483648 <= e && e <= 2147483647;
    }),
    (e.uinteger = function (e) {
      return "[object Number]" === t.call(e) && 0 <= e && e <= 2147483647;
    }),
    (e.func = function (e) {
      return "[object Function]" === t.call(e);
    }),
    (e.objectLiteral = function (e) {
      return null !== e && "object" == typeof e;
    }),
    (e.typedArray = function (e, t) {
      return Array.isArray(e) && e.every(t);
    }));
})(c2e || (c2e = {}));
let u2e = class {
  constructor(e, t, n) {
    ((this._languageId = e),
      (this._worker = t),
      (this._disposables = []),
      (this._listener = Object.create(null)));
    const i = (e) => {
        let t,
          n = e.getLanguageId();
        n === this._languageId &&
          ((this._listener[e.uri.toString()] = e.onDidChangeContent(() => {
            (window.clearTimeout(t),
              (t = window.setTimeout(() => this._doValidate(e.uri, n), 500)));
          })),
          this._doValidate(e.uri, n));
      },
      r = (e) => {
        BGe.setModelMarkers(e, this._languageId, []);
        let t = e.uri.toString(),
          n = this._listener[t];
        n && (n.dispose(), delete this._listener[t]);
      };
    (this._disposables.push(BGe.onDidCreateModel(i)),
      this._disposables.push(BGe.onWillDisposeModel(r)),
      this._disposables.push(
        BGe.onDidChangeModelLanguage((e) => {
          (r(e.model), i(e.model));
        }),
      ),
      this._disposables.push(
        n((e) => {
          BGe.getModels().forEach((e) => {
            e.getLanguageId() === this._languageId && (r(e), i(e));
          });
        }),
      ),
      this._disposables.push({
        dispose: () => {
          BGe.getModels().forEach(r);
          for (let e in this._listener) this._listener[e].dispose();
        },
      }),
      BGe.getModels().forEach(i));
  }
  dispose() {
    (this._disposables.forEach((e) => e && e.dispose()), (this._disposables.length = 0));
  }
  _doValidate(e, t) {
    this._worker(e)
      .then((t) => t.doValidation(e.toString()))
      .then((n) => {
        const i = n.map((e) =>
          (function (e, t) {
            let n = "number" == typeof t.code ? String(t.code) : t.code;
            return {
              severity: h2e(t.severity),
              startLineNumber: t.range.start.line + 1,
              startColumn: t.range.start.character + 1,
              endLineNumber: t.range.end.line + 1,
              endColumn: t.range.end.character + 1,
              message: t.message,
              code: n,
              source: t.source,
            };
          })(0, e),
        );
        let r = BGe.getModel(e);
        r && r.getLanguageId() === t && BGe.setModelMarkers(r, t, i);
      })
      .then(void 0, (e) => {});
  }
};
function h2e(e) {
  switch (e) {
    case Q0e.Error:
      return AGe.Error;
    case Q0e.Warning:
      return AGe.Warning;
    case Q0e.Information:
      return AGe.Info;
    case Q0e.Hint:
      return AGe.Hint;
    default:
      return AGe.Info;
  }
}
class g2e {
  constructor(e, t) {
    ((this._worker = e), (this._triggerCharacters = t));
  }
  get triggerCharacters() {
    return this._triggerCharacters;
  }
  provideCompletionItems(e, t, n, i) {
    const r = e.uri;
    return this._worker(r)
      .then((e) => e.doComplete(r.toString(), p2e(t)))
      .then((n) => {
        if (!n) return;
        const i = e.getWordUntilPosition(t),
          r = new RGe(t.lineNumber, i.startColumn, t.lineNumber, i.endColumn),
          o = n.items.map((e) => {
            const t = {
              label: e.label,
              insertText: e.insertText || e.label,
              sortText: e.sortText,
              filterText: e.filterText,
              documentation: e.documentation,
              detail: e.detail,
              command: b2e(e.command),
              range: r,
              kind: _2e(e.kind),
            };
            return (
              e.textEdit &&
                (!(function (e) {
                  return void 0 !== e.insert && void 0 !== e.replace;
                })(e.textEdit)
                  ? (t.range = m2e(e.textEdit.range))
                  : (t.range = {
                      insert: m2e(e.textEdit.insert),
                      replace: m2e(e.textEdit.replace),
                    }),
                (t.insertText = e.textEdit.newText)),
              e.additionalTextEdits && (t.additionalTextEdits = e.additionalTextEdits.map(v2e)),
              e.insertTextFormat === b1e.Snippet &&
                (t.insertTextRules = VGe.CompletionItemInsertTextRule.InsertAsSnippet),
              t
            );
          });
        return { isIncomplete: n.isIncomplete, suggestions: o };
      });
  }
}
function p2e(e) {
  if (e) return { character: e.column - 1, line: e.lineNumber - 1 };
}
function f2e(e) {
  if (e)
    return {
      start: { line: e.startLineNumber - 1, character: e.startColumn - 1 },
      end: { line: e.endLineNumber - 1, character: e.endColumn - 1 },
    };
}
function m2e(e) {
  if (e)
    return new RGe(e.start.line + 1, e.start.character + 1, e.end.line + 1, e.end.character + 1);
}
function _2e(e) {
  const t = VGe.CompletionItemKind;
  switch (e) {
    case v1e.Text:
      return t.Text;
    case v1e.Method:
      return t.Method;
    case v1e.Function:
      return t.Function;
    case v1e.Constructor:
      return t.Constructor;
    case v1e.Field:
      return t.Field;
    case v1e.Variable:
      return t.Variable;
    case v1e.Class:
      return t.Class;
    case v1e.Interface:
      return t.Interface;
    case v1e.Module:
      return t.Module;
    case v1e.Property:
      return t.Property;
    case v1e.Unit:
      return t.Unit;
    case v1e.Value:
      return t.Value;
    case v1e.Enum:
      return t.Enum;
    case v1e.Keyword:
      return t.Keyword;
    case v1e.Snippet:
      return t.Snippet;
    case v1e.Color:
      return t.Color;
    case v1e.File:
      return t.File;
    case v1e.Reference:
      return t.Reference;
  }
  return t.Property;
}
function v2e(e) {
  if (e) return { range: m2e(e.range), text: e.newText };
}
function b2e(e) {
  return e && "editor.action.triggerSuggest" === e.command
    ? { id: e.command, title: e.title, arguments: e.arguments }
    : void 0;
}
class y2e {
  constructor(e) {
    this._worker = e;
  }
  provideHover(e, t, n) {
    let i = e.uri;
    return this._worker(i)
      .then((e) => e.doHover(i.toString(), p2e(t)))
      .then((e) => {
        if (e) return { range: m2e(e.range), contents: w2e(e.contents) };
      });
  }
}
function x2e(e) {
  return "string" == typeof e
    ? { value: e }
    : (t = e) && "object" == typeof t && "string" == typeof t.kind
      ? "plaintext" === e.kind
        ? { value: e.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&") }
        : { value: e.value }
      : { value: "```" + e.language + "\n" + e.value + "\n```\n" };
  var t;
}
function w2e(e) {
  if (e) return Array.isArray(e) ? e.map(x2e) : [x2e(e)];
}
let C2e = class {
  constructor(e) {
    this._worker = e;
  }
  provideDocumentHighlights(e, t, n) {
    const i = e.uri;
    return this._worker(i)
      .then((e) => e.findDocumentHighlights(i.toString(), p2e(t)))
      .then((e) => {
        if (e) return e.map((e) => ({ range: m2e(e.range), kind: S2e(e.kind) }));
      });
  }
};
function S2e(e) {
  switch (e) {
    case T1e.Read:
      return VGe.DocumentHighlightKind.Read;
    case T1e.Write:
      return VGe.DocumentHighlightKind.Write;
    case T1e.Text:
      return VGe.DocumentHighlightKind.Text;
  }
  return VGe.DocumentHighlightKind.Text;
}
let k2e = class {
  constructor(e) {
    this._worker = e;
  }
  provideDefinition(e, t, n) {
    const i = e.uri;
    return this._worker(i)
      .then((e) => e.findDefinition(i.toString(), p2e(t)))
      .then((e) => {
        if (e) return [E2e(e)];
      });
  }
};
function E2e(e) {
  return { uri: jGe.parse(e.uri), range: m2e(e.range) };
}
let N2e = class {
    constructor(e) {
      this._worker = e;
    }
    provideReferences(e, t, n, i) {
      const r = e.uri;
      return this._worker(r)
        .then((e) => e.findReferences(r.toString(), p2e(t)))
        .then((e) => {
          if (e) return e.map(E2e);
        });
    }
  },
  L2e = class {
    constructor(e) {
      this._worker = e;
    }
    provideRenameEdits(e, t, n, i) {
      const r = e.uri;
      return this._worker(r)
        .then((e) => e.doRename(r.toString(), p2e(t), n))
        .then((e) =>
          (function (e) {
            if (!e || !e.changes) return;
            let t = [];
            for (let n in e.changes) {
              const i = jGe.parse(n);
              for (let r of e.changes[n])
                t.push({
                  resource: i,
                  versionId: void 0,
                  textEdit: { range: m2e(r.range), text: r.newText },
                });
            }
            return { edits: t };
          })(e),
        );
    }
  };
class D2e {
  constructor(e) {
    this._worker = e;
  }
  provideDocumentSymbols(e, t) {
    const n = e.uri;
    return this._worker(n)
      .then((e) => e.findDocumentSymbols(n.toString()))
      .then((e) => {
        if (e)
          return e.map((e) =>
            "children" in e
              ? T2e(e)
              : {
                  name: e.name,
                  detail: "",
                  containerName: e.containerName,
                  kind: I2e(e.kind),
                  range: m2e(e.location.range),
                  selectionRange: m2e(e.location.range),
                  tags: [],
                },
          );
      });
  }
}
function T2e(e) {
  return {
    name: e.name,
    detail: e.detail ?? "",
    kind: I2e(e.kind),
    range: m2e(e.range),
    selectionRange: m2e(e.selectionRange),
    tags: e.tags ?? [],
    children: (e.children ?? []).map((e) => T2e(e)),
  };
}
function I2e(e) {
  let t = VGe.SymbolKind;
  switch (e) {
    case R1e.File:
      return t.File;
    case R1e.Module:
      return t.Module;
    case R1e.Namespace:
      return t.Namespace;
    case R1e.Package:
      return t.Package;
    case R1e.Class:
      return t.Class;
    case R1e.Method:
      return t.Method;
    case R1e.Property:
      return t.Property;
    case R1e.Field:
      return t.Field;
    case R1e.Constructor:
      return t.Constructor;
    case R1e.Enum:
      return t.Enum;
    case R1e.Interface:
      return t.Interface;
    case R1e.Function:
      return t.Function;
    case R1e.Variable:
      return t.Variable;
    case R1e.Constant:
      return t.Constant;
    case R1e.String:
      return t.String;
    case R1e.Number:
      return t.Number;
    case R1e.Boolean:
      return t.Boolean;
    case R1e.Array:
      return t.Array;
  }
  return t.Function;
}
class R2e {
  constructor(e) {
    this._worker = e;
  }
  provideLinks(e, t) {
    const n = e.uri;
    return this._worker(n)
      .then((e) => e.findDocumentLinks(n.toString()))
      .then((e) => {
        if (e) return { links: e.map((e) => ({ range: m2e(e.range), url: e.target })) };
      });
  }
}
class O2e {
  constructor(e) {
    this._worker = e;
  }
  provideDocumentFormattingEdits(e, t, n) {
    const i = e.uri;
    return this._worker(i).then((e) =>
      e.format(i.toString(), null, A2e(t)).then((e) => {
        if (e && 0 !== e.length) return e.map(v2e);
      }),
    );
  }
}
class M2e {
  constructor(e) {
    ((this._worker = e), (this.canFormatMultipleRanges = !1));
  }
  provideDocumentRangeFormattingEdits(e, t, n, i) {
    const r = e.uri;
    return this._worker(r).then((e) =>
      e.format(r.toString(), f2e(t), A2e(n)).then((e) => {
        if (e && 0 !== e.length) return e.map(v2e);
      }),
    );
  }
}
function A2e(e) {
  return { tabSize: e.tabSize, insertSpaces: e.insertSpaces };
}
class P2e {
  constructor(e) {
    this._worker = e;
  }
  provideDocumentColors(e, t) {
    const n = e.uri;
    return this._worker(n)
      .then((e) => e.findDocumentColors(n.toString()))
      .then((e) => {
        if (e) return e.map((e) => ({ color: e.color, range: m2e(e.range) }));
      });
  }
  provideColorPresentations(e, t, n) {
    const i = e.uri;
    return this._worker(i)
      .then((e) => e.getColorPresentations(i.toString(), t.color, f2e(t.range)))
      .then((e) => {
        if (e)
          return e.map((e) => {
            let t = { label: e.label };
            return (
              e.textEdit && (t.textEdit = v2e(e.textEdit)),
              e.additionalTextEdits && (t.additionalTextEdits = e.additionalTextEdits.map(v2e)),
              t
            );
          });
      });
  }
}
class j2e {
  constructor(e) {
    this._worker = e;
  }
  provideFoldingRanges(e, t, n) {
    const i = e.uri;
    return this._worker(i)
      .then((e) => e.getFoldingRanges(i.toString(), t))
      .then((e) => {
        if (e)
          return e.map((e) => {
            const t = { start: e.startLine + 1, end: e.endLine + 1 };
            return (
              void 0 !== e.kind &&
                (t.kind = (function (e) {
                  switch (e) {
                    case Z0e.Comment:
                      return VGe.FoldingRangeKind.Comment;
                    case Z0e.Imports:
                      return VGe.FoldingRangeKind.Imports;
                    case Z0e.Region:
                      return VGe.FoldingRangeKind.Region;
                  }
                  return;
                })(e.kind)),
              t
            );
          });
      });
  }
}
class F2e {
  constructor(e) {
    this._worker = e;
  }
  provideSelectionRanges(e, t, n) {
    const i = e.uri;
    return this._worker(i)
      .then((e) => e.getSelectionRanges(i.toString(), t.map(p2e)))
      .then((e) => {
        if (e)
          return e.map((e) => {
            const t = [];
            for (; e; ) (t.push({ range: m2e(e.range) }), (e = e.parent));
            return t;
          });
      });
  }
}
function B2e(e) {
  return { dispose: () => V2e(e) };
}
function V2e(e) {
  for (; e.length; ) e.pop().dispose();
}
const W2e = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      CompletionAdapter: g2e,
      DefinitionAdapter: k2e,
      DiagnosticsAdapter: u2e,
      DocumentColorAdapter: P2e,
      DocumentFormattingEditProvider: O2e,
      DocumentHighlightAdapter: C2e,
      DocumentLinkAdapter: R2e,
      DocumentRangeFormattingEditProvider: M2e,
      DocumentSymbolAdapter: D2e,
      FoldingRangeAdapter: j2e,
      HoverAdapter: y2e,
      ReferenceAdapter: N2e,
      RenameAdapter: L2e,
      SelectionRangeAdapter: F2e,
      WorkerManager: j0e,
      fromPosition: p2e,
      fromRange: f2e,
      setupMode: function (e) {
        const t = [],
          n = [],
          i = new j0e(e);
        t.push(i);
        const r = (...e) => i.getLanguageServiceWorker(...e);
        return (
          (function () {
            const { languageId: t, modeConfiguration: i } = e;
            (V2e(n),
              i.completionItems &&
                n.push(VGe.registerCompletionItemProvider(t, new g2e(r, ["/", "-", ":"]))),
              i.hovers && n.push(VGe.registerHoverProvider(t, new y2e(r))),
              i.documentHighlights && n.push(VGe.registerDocumentHighlightProvider(t, new C2e(r))),
              i.definitions && n.push(VGe.registerDefinitionProvider(t, new k2e(r))),
              i.references && n.push(VGe.registerReferenceProvider(t, new N2e(r))),
              i.documentSymbols && n.push(VGe.registerDocumentSymbolProvider(t, new D2e(r))),
              i.rename && n.push(VGe.registerRenameProvider(t, new L2e(r))),
              i.colors && n.push(VGe.registerColorProvider(t, new P2e(r))),
              i.foldingRanges && n.push(VGe.registerFoldingRangeProvider(t, new j2e(r))),
              i.diagnostics && n.push(new u2e(t, r, e.onDidChange)),
              i.selectionRanges && n.push(VGe.registerSelectionRangeProvider(t, new F2e(r))),
              i.documentFormattingEdits &&
                n.push(VGe.registerDocumentFormattingEditProvider(t, new O2e(r))),
              i.documentRangeFormattingEdits &&
                n.push(VGe.registerDocumentRangeFormattingEditProvider(t, new M2e(r))));
          })(),
          t.push(B2e(n)),
          B2e(t)
        );
      },
      toRange: m2e,
      toTextEdit: v2e,
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
let H2e = class {
  constructor(e) {
    ((this._defaults = e),
      (this._worker = null),
      (this._client = null),
      (this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 3e4)),
      (this._lastUsedTime = 0),
      (this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker())));
  }
  _stopWorker() {
    (this._worker && (this._worker.dispose(), (this._worker = null)), (this._client = null));
  }
  dispose() {
    (clearInterval(this._idleCheckInterval),
      this._configChangeListener.dispose(),
      this._stopWorker());
  }
  _checkIfIdle() {
    if (!this._worker) return;
    Date.now() - this._lastUsedTime > 12e4 && this._stopWorker();
  }
  _getClient() {
    return (
      (this._lastUsedTime = Date.now()),
      this._client ||
        ((this._worker = bQe({
          moduleId: "vs/language/html/htmlWorker",
          createWorker: () =>
            new Worker(
              new URL(
                "" + new URL("html.worker-C4RoLUfz.js", import.meta.url).href,
                import.meta.url,
              ),
              { type: "module" },
            ),
          createData: {
            languageSettings: this._defaults.options,
            languageId: this._defaults.languageId,
          },
          label: this._defaults.languageId,
        })),
        (this._client = this._worker.getProxy())),
      this._client
    );
  }
  getLanguageServiceWorker(...e) {
    let t;
    return this._getClient()
      .then((e) => {
        t = e;
      })
      .then((t) => {
        if (this._worker) return this._worker.withSyncedResources(e);
      })
      .then((e) => t);
  }
};
class z2e extends g2e {
  constructor(e) {
    super(e, [".", ":", "<", '"', "=", "/"]);
  }
}
function U2e(e) {
  return { dispose: () => $2e(e) };
}
function $2e(e) {
  for (; e.length; ) e.pop().dispose();
}
const q2e = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      CompletionAdapter: g2e,
      DefinitionAdapter: k2e,
      DiagnosticsAdapter: u2e,
      DocumentColorAdapter: P2e,
      DocumentFormattingEditProvider: O2e,
      DocumentHighlightAdapter: C2e,
      DocumentLinkAdapter: R2e,
      DocumentRangeFormattingEditProvider: M2e,
      DocumentSymbolAdapter: D2e,
      FoldingRangeAdapter: j2e,
      HoverAdapter: y2e,
      ReferenceAdapter: N2e,
      RenameAdapter: L2e,
      SelectionRangeAdapter: F2e,
      WorkerManager: H2e,
      fromPosition: p2e,
      fromRange: f2e,
      setupMode: function (e) {
        const t = [],
          n = [],
          i = new H2e(e);
        t.push(i);
        const r = (...e) => i.getLanguageServiceWorker(...e);
        return (
          (function () {
            const { languageId: t, modeConfiguration: i } = e;
            ($2e(n),
              i.completionItems && n.push(VGe.registerCompletionItemProvider(t, new z2e(r))),
              i.hovers && n.push(VGe.registerHoverProvider(t, new y2e(r))),
              i.documentHighlights && n.push(VGe.registerDocumentHighlightProvider(t, new C2e(r))),
              i.links && n.push(VGe.registerLinkProvider(t, new R2e(r))),
              i.documentSymbols && n.push(VGe.registerDocumentSymbolProvider(t, new D2e(r))),
              i.rename && n.push(VGe.registerRenameProvider(t, new L2e(r))),
              i.foldingRanges && n.push(VGe.registerFoldingRangeProvider(t, new j2e(r))),
              i.selectionRanges && n.push(VGe.registerSelectionRangeProvider(t, new F2e(r))),
              i.documentFormattingEdits &&
                n.push(VGe.registerDocumentFormattingEditProvider(t, new O2e(r))),
              i.documentRangeFormattingEdits &&
                n.push(VGe.registerDocumentRangeFormattingEditProvider(t, new M2e(r))));
          })(),
          t.push(U2e(n)),
          U2e(t)
        );
      },
      setupMode1: function (e) {
        const t = new H2e(e),
          n = (...e) => t.getLanguageServiceWorker(...e);
        let i = e.languageId;
        (VGe.registerCompletionItemProvider(i, new z2e(n)),
          VGe.registerHoverProvider(i, new y2e(n)),
          VGe.registerDocumentHighlightProvider(i, new C2e(n)),
          VGe.registerLinkProvider(i, new R2e(n)),
          VGe.registerFoldingRangeProvider(i, new j2e(n)),
          VGe.registerDocumentSymbolProvider(i, new D2e(n)),
          VGe.registerSelectionRangeProvider(i, new F2e(n)),
          VGe.registerRenameProvider(i, new L2e(n)),
          "html" === i &&
            (VGe.registerDocumentFormattingEditProvider(i, new O2e(n)),
            VGe.registerDocumentRangeFormattingEditProvider(i, new M2e(n))));
      },
      toRange: m2e,
      toTextEdit: v2e,
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
let K2e = class {
  constructor(e) {
    ((this._defaults = e),
      (this._worker = null),
      (this._client = null),
      (this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 3e4)),
      (this._lastUsedTime = 0),
      (this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker())));
  }
  _stopWorker() {
    (this._worker && (this._worker.dispose(), (this._worker = null)), (this._client = null));
  }
  dispose() {
    (clearInterval(this._idleCheckInterval),
      this._configChangeListener.dispose(),
      this._stopWorker());
  }
  _checkIfIdle() {
    if (!this._worker) return;
    Date.now() - this._lastUsedTime > 12e4 && this._stopWorker();
  }
  _getClient() {
    return (
      (this._lastUsedTime = Date.now()),
      this._client ||
        ((this._worker = bQe({
          moduleId: "vs/language/json/jsonWorker",
          createWorker: () =>
            new Worker(
              new URL(
                "" + new URL("json.worker-qCj-lAKT.js", import.meta.url).href,
                import.meta.url,
              ),
              { type: "module" },
            ),
          label: this._defaults.languageId,
          createData: {
            languageSettings: this._defaults.diagnosticsOptions,
            languageId: this._defaults.languageId,
            enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest,
          },
        })),
        (this._client = this._worker.getProxy())),
      this._client
    );
  }
  getLanguageServiceWorker(...e) {
    let t;
    return this._getClient()
      .then((e) => {
        t = e;
      })
      .then((t) => {
        if (this._worker) return this._worker.withSyncedResources(e);
      })
      .then((e) => t);
  }
};
function G2e(e) {
  return 32 === e || 9 === e;
}
function Z2e(e) {
  return 10 === e || 13 === e;
}
function Y2e(e) {
  return e >= 48 && e <= 57;
}
var X2e;
(!(function (e) {
  ((e[(e.lineFeed = 10)] = "lineFeed"),
    (e[(e.carriageReturn = 13)] = "carriageReturn"),
    (e[(e.space = 32)] = "space"),
    (e[(e._0 = 48)] = "_0"),
    (e[(e._1 = 49)] = "_1"),
    (e[(e._2 = 50)] = "_2"),
    (e[(e._3 = 51)] = "_3"),
    (e[(e._4 = 52)] = "_4"),
    (e[(e._5 = 53)] = "_5"),
    (e[(e._6 = 54)] = "_6"),
    (e[(e._7 = 55)] = "_7"),
    (e[(e._8 = 56)] = "_8"),
    (e[(e._9 = 57)] = "_9"),
    (e[(e.a = 97)] = "a"),
    (e[(e.b = 98)] = "b"),
    (e[(e.c = 99)] = "c"),
    (e[(e.d = 100)] = "d"),
    (e[(e.e = 101)] = "e"),
    (e[(e.f = 102)] = "f"),
    (e[(e.g = 103)] = "g"),
    (e[(e.h = 104)] = "h"),
    (e[(e.i = 105)] = "i"),
    (e[(e.j = 106)] = "j"),
    (e[(e.k = 107)] = "k"),
    (e[(e.l = 108)] = "l"),
    (e[(e.m = 109)] = "m"),
    (e[(e.n = 110)] = "n"),
    (e[(e.o = 111)] = "o"),
    (e[(e.p = 112)] = "p"),
    (e[(e.q = 113)] = "q"),
    (e[(e.r = 114)] = "r"),
    (e[(e.s = 115)] = "s"),
    (e[(e.t = 116)] = "t"),
    (e[(e.u = 117)] = "u"),
    (e[(e.v = 118)] = "v"),
    (e[(e.w = 119)] = "w"),
    (e[(e.x = 120)] = "x"),
    (e[(e.y = 121)] = "y"),
    (e[(e.z = 122)] = "z"),
    (e[(e.A = 65)] = "A"),
    (e[(e.B = 66)] = "B"),
    (e[(e.C = 67)] = "C"),
    (e[(e.D = 68)] = "D"),
    (e[(e.E = 69)] = "E"),
    (e[(e.F = 70)] = "F"),
    (e[(e.G = 71)] = "G"),
    (e[(e.H = 72)] = "H"),
    (e[(e.I = 73)] = "I"),
    (e[(e.J = 74)] = "J"),
    (e[(e.K = 75)] = "K"),
    (e[(e.L = 76)] = "L"),
    (e[(e.M = 77)] = "M"),
    (e[(e.N = 78)] = "N"),
    (e[(e.O = 79)] = "O"),
    (e[(e.P = 80)] = "P"),
    (e[(e.Q = 81)] = "Q"),
    (e[(e.R = 82)] = "R"),
    (e[(e.S = 83)] = "S"),
    (e[(e.T = 84)] = "T"),
    (e[(e.U = 85)] = "U"),
    (e[(e.V = 86)] = "V"),
    (e[(e.W = 87)] = "W"),
    (e[(e.X = 88)] = "X"),
    (e[(e.Y = 89)] = "Y"),
    (e[(e.Z = 90)] = "Z"),
    (e[(e.asterisk = 42)] = "asterisk"),
    (e[(e.backslash = 92)] = "backslash"),
    (e[(e.closeBrace = 125)] = "closeBrace"),
    (e[(e.closeBracket = 93)] = "closeBracket"),
    (e[(e.colon = 58)] = "colon"),
    (e[(e.comma = 44)] = "comma"),
    (e[(e.dot = 46)] = "dot"),
    (e[(e.doubleQuote = 34)] = "doubleQuote"),
    (e[(e.minus = 45)] = "minus"),
    (e[(e.openBrace = 123)] = "openBrace"),
    (e[(e.openBracket = 91)] = "openBracket"),
    (e[(e.plus = 43)] = "plus"),
    (e[(e.slash = 47)] = "slash"),
    (e[(e.formFeed = 12)] = "formFeed"),
    (e[(e.tab = 9)] = "tab"));
})(X2e || (X2e = {})),
  new Array(20).fill(0).map((e, t) => " ".repeat(t)));
const Q2e = 200;
var J2e;
(new Array(Q2e).fill(0).map((e, t) => "\n" + " ".repeat(t)),
  new Array(Q2e).fill(0).map((e, t) => "\r" + " ".repeat(t)),
  new Array(Q2e).fill(0).map((e, t) => "\r\n" + " ".repeat(t)),
  new Array(Q2e).fill(0).map((e, t) => "\n" + "\t".repeat(t)),
  new Array(Q2e).fill(0).map((e, t) => "\r" + "\t".repeat(t)),
  new Array(Q2e).fill(0).map((e, t) => "\r\n" + "\t".repeat(t)),
  (function (e) {
    e.DEFAULT = { allowTrailingComma: !1 };
  })(J2e || (J2e = {})));
const e4e = function (e, t = !1) {
  const n = e.length;
  let i = 0,
    r = "",
    o = 0,
    s = 16,
    a = 0,
    l = 0,
    c = 0,
    d = 0,
    u = 0;
  function h(t, n) {
    let r = 0,
      o = 0;
    for (; r < t; ) {
      let t = e.charCodeAt(i);
      if (t >= 48 && t <= 57) o = 16 * o + t - 48;
      else if (t >= 65 && t <= 70) o = 16 * o + t - 65 + 10;
      else {
        if (!(t >= 97 && t <= 102)) break;
        o = 16 * o + t - 97 + 10;
      }
      (i++, r++);
    }
    return (r < t && (o = -1), o);
  }
  function g() {
    if (((r = ""), (u = 0), (o = i), (l = a), (d = c), i >= n)) return ((o = n), (s = 17));
    let t = e.charCodeAt(i);
    if (G2e(t)) {
      do {
        (i++, (r += String.fromCharCode(t)), (t = e.charCodeAt(i)));
      } while (G2e(t));
      return (s = 15);
    }
    if (Z2e(t))
      return (
        i++,
        (r += String.fromCharCode(t)),
        13 === t && 10 === e.charCodeAt(i) && (i++, (r += "\n")),
        a++,
        (c = i),
        (s = 14)
      );
    switch (t) {
      case 123:
        return (i++, (s = 1));
      case 125:
        return (i++, (s = 2));
      case 91:
        return (i++, (s = 3));
      case 93:
        return (i++, (s = 4));
      case 58:
        return (i++, (s = 6));
      case 44:
        return (i++, (s = 5));
      case 34:
        return (
          i++,
          (r = (function () {
            let t = "",
              r = i;
            for (;;) {
              if (i >= n) {
                ((t += e.substring(r, i)), (u = 2));
                break;
              }
              const o = e.charCodeAt(i);
              if (34 === o) {
                ((t += e.substring(r, i)), i++);
                break;
              }
              if (92 !== o) {
                if (o >= 0 && o <= 31) {
                  if (Z2e(o)) {
                    ((t += e.substring(r, i)), (u = 2));
                    break;
                  }
                  u = 6;
                }
                i++;
              } else {
                if (((t += e.substring(r, i)), i++, i >= n)) {
                  u = 2;
                  break;
                }
                switch (e.charCodeAt(i++)) {
                  case 34:
                    t += '"';
                    break;
                  case 92:
                    t += "\\";
                    break;
                  case 47:
                    t += "/";
                    break;
                  case 98:
                    t += "\b";
                    break;
                  case 102:
                    t += "\f";
                    break;
                  case 110:
                    t += "\n";
                    break;
                  case 114:
                    t += "\r";
                    break;
                  case 116:
                    t += "\t";
                    break;
                  case 117:
                    const e = h(4);
                    e >= 0 ? (t += String.fromCharCode(e)) : (u = 4);
                    break;
                  default:
                    u = 5;
                }
                r = i;
              }
            }
            return t;
          })()),
          (s = 10)
        );
      case 47:
        const l = i - 1;
        if (47 === e.charCodeAt(i + 1)) {
          for (i += 2; i < n && !Z2e(e.charCodeAt(i)); ) i++;
          return ((r = e.substring(l, i)), (s = 12));
        }
        if (42 === e.charCodeAt(i + 1)) {
          i += 2;
          const t = n - 1;
          let o = !1;
          for (; i < t; ) {
            const t = e.charCodeAt(i);
            if (42 === t && 47 === e.charCodeAt(i + 1)) {
              ((i += 2), (o = !0));
              break;
            }
            (i++, Z2e(t) && (13 === t && 10 === e.charCodeAt(i) && i++, a++, (c = i)));
          }
          return (o || (i++, (u = 1)), (r = e.substring(l, i)), (s = 13));
        }
        return ((r += String.fromCharCode(t)), i++, (s = 16));
      case 45:
        if (((r += String.fromCharCode(t)), i++, i === n || !Y2e(e.charCodeAt(i)))) return (s = 16);
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
        return (
          (r += (function () {
            let t = i;
            if (48 === e.charCodeAt(i)) i++;
            else for (i++; i < e.length && Y2e(e.charCodeAt(i)); ) i++;
            if (i < e.length && 46 === e.charCodeAt(i)) {
              if ((i++, !(i < e.length && Y2e(e.charCodeAt(i)))))
                return ((u = 3), e.substring(t, i));
              for (i++; i < e.length && Y2e(e.charCodeAt(i)); ) i++;
            }
            let n = i;
            if (i < e.length && (69 === e.charCodeAt(i) || 101 === e.charCodeAt(i)))
              if (
                (i++,
                ((i < e.length && 43 === e.charCodeAt(i)) || 45 === e.charCodeAt(i)) && i++,
                i < e.length && Y2e(e.charCodeAt(i)))
              ) {
                for (i++; i < e.length && Y2e(e.charCodeAt(i)); ) i++;
                n = i;
              } else u = 3;
            return e.substring(t, n);
          })()),
          (s = 11)
        );
      default:
        for (; i < n && p(t); ) (i++, (t = e.charCodeAt(i)));
        if (o !== i) {
          switch (((r = e.substring(o, i)), r)) {
            case "true":
              return (s = 8);
            case "false":
              return (s = 9);
            case "null":
              return (s = 7);
          }
          return (s = 16);
        }
        return ((r += String.fromCharCode(t)), i++, (s = 16));
    }
  }
  function p(e) {
    if (G2e(e) || Z2e(e)) return !1;
    switch (e) {
      case 125:
      case 93:
      case 123:
      case 91:
      case 34:
      case 58:
      case 44:
      case 47:
        return !1;
    }
    return !0;
  }
  return {
    setPosition: function (e) {
      ((i = e), (r = ""), (o = 0), (s = 16), (u = 0));
    },
    getPosition: () => i,
    scan: t
      ? function () {
          let e;
          do {
            e = g();
          } while (e >= 12 && e <= 15);
          return e;
        }
      : g,
    getToken: () => s,
    getTokenValue: () => r,
    getTokenOffset: () => o,
    getTokenLength: () => i - o,
    getTokenStartLine: () => l,
    getTokenStartCharacter: () => o - d,
    getTokenError: () => u,
  };
};
var t4e, n4e, i4e;
function r4e(e) {
  return {
    getInitialState: () => new _4e(null, null, !1, null),
    tokenize: (e, t) =>
      (function (e, t, n, i = 0) {
        let r = 0,
          o = !1;
        switch (n.scanError) {
          case 2:
            ((t = '"' + t), (r = 1));
            break;
          case 1:
            ((t = "/*" + t), (r = 2));
        }
        const s = e4e(t);
        let a = n.lastWasColon,
          l = n.parents;
        const c = { tokens: [], endState: n.clone() };
        for (;;) {
          let e = i + s.getPosition(),
            d = "";
          const u = s.scan();
          if (17 === u) break;
          if (e === i + s.getPosition())
            throw new Error(
              "Scanner did not advance, next 3 characters are: " + t.substr(s.getPosition(), 3),
            );
          switch ((o && (e -= r), (o = r > 0), u)) {
            case 1:
              ((l = m4e.push(l, 0)), (d = o4e), (a = !1));
              break;
            case 2:
              ((l = m4e.pop(l)), (d = o4e), (a = !1));
              break;
            case 3:
              ((l = m4e.push(l, 1)), (d = s4e), (a = !1));
              break;
            case 4:
              ((l = m4e.pop(l)), (d = s4e), (a = !1));
              break;
            case 6:
              ((d = a4e), (a = !0));
              break;
            case 5:
              ((d = l4e), (a = !1));
              break;
            case 8:
            case 9:
              ((d = c4e), (a = !1));
              break;
            case 7:
              ((d = d4e), (a = !1));
              break;
            case 10:
              const e = l ? l.type : 0;
              ((d = a || 1 === e ? u4e : g4e), (a = !1));
              break;
            case 11:
              ((d = h4e), (a = !1));
          }
          switch (u) {
            case 12:
              d = f4e;
              break;
            case 13:
              d = p4e;
          }
          ((c.endState = new _4e(n.getStateData(), s.getTokenError(), a, l)),
            c.tokens.push({ startIndex: e, scopes: d }));
        }
        return c;
      })(0, e, t),
  };
}
(!(function (e) {
  ((e[(e.None = 0)] = "None"),
    (e[(e.UnexpectedEndOfComment = 1)] = "UnexpectedEndOfComment"),
    (e[(e.UnexpectedEndOfString = 2)] = "UnexpectedEndOfString"),
    (e[(e.UnexpectedEndOfNumber = 3)] = "UnexpectedEndOfNumber"),
    (e[(e.InvalidUnicode = 4)] = "InvalidUnicode"),
    (e[(e.InvalidEscapeCharacter = 5)] = "InvalidEscapeCharacter"),
    (e[(e.InvalidCharacter = 6)] = "InvalidCharacter"));
})(t4e || (t4e = {})),
  (function (e) {
    ((e[(e.OpenBraceToken = 1)] = "OpenBraceToken"),
      (e[(e.CloseBraceToken = 2)] = "CloseBraceToken"),
      (e[(e.OpenBracketToken = 3)] = "OpenBracketToken"),
      (e[(e.CloseBracketToken = 4)] = "CloseBracketToken"),
      (e[(e.CommaToken = 5)] = "CommaToken"),
      (e[(e.ColonToken = 6)] = "ColonToken"),
      (e[(e.NullKeyword = 7)] = "NullKeyword"),
      (e[(e.TrueKeyword = 8)] = "TrueKeyword"),
      (e[(e.FalseKeyword = 9)] = "FalseKeyword"),
      (e[(e.StringLiteral = 10)] = "StringLiteral"),
      (e[(e.NumericLiteral = 11)] = "NumericLiteral"),
      (e[(e.LineCommentTrivia = 12)] = "LineCommentTrivia"),
      (e[(e.BlockCommentTrivia = 13)] = "BlockCommentTrivia"),
      (e[(e.LineBreakTrivia = 14)] = "LineBreakTrivia"),
      (e[(e.Trivia = 15)] = "Trivia"),
      (e[(e.Unknown = 16)] = "Unknown"),
      (e[(e.EOF = 17)] = "EOF"));
  })(n4e || (n4e = {})),
  (function (e) {
    ((e[(e.InvalidSymbol = 1)] = "InvalidSymbol"),
      (e[(e.InvalidNumberFormat = 2)] = "InvalidNumberFormat"),
      (e[(e.PropertyNameExpected = 3)] = "PropertyNameExpected"),
      (e[(e.ValueExpected = 4)] = "ValueExpected"),
      (e[(e.ColonExpected = 5)] = "ColonExpected"),
      (e[(e.CommaExpected = 6)] = "CommaExpected"),
      (e[(e.CloseBraceExpected = 7)] = "CloseBraceExpected"),
      (e[(e.CloseBracketExpected = 8)] = "CloseBracketExpected"),
      (e[(e.EndOfFileExpected = 9)] = "EndOfFileExpected"),
      (e[(e.InvalidCommentToken = 10)] = "InvalidCommentToken"),
      (e[(e.UnexpectedEndOfComment = 11)] = "UnexpectedEndOfComment"),
      (e[(e.UnexpectedEndOfString = 12)] = "UnexpectedEndOfString"),
      (e[(e.UnexpectedEndOfNumber = 13)] = "UnexpectedEndOfNumber"),
      (e[(e.InvalidUnicode = 14)] = "InvalidUnicode"),
      (e[(e.InvalidEscapeCharacter = 15)] = "InvalidEscapeCharacter"),
      (e[(e.InvalidCharacter = 16)] = "InvalidCharacter"));
  })(i4e || (i4e = {})));
const o4e = "delimiter.bracket.json",
  s4e = "delimiter.array.json",
  a4e = "delimiter.colon.json",
  l4e = "delimiter.comma.json",
  c4e = "keyword.json",
  d4e = "keyword.json",
  u4e = "string.value.json",
  h4e = "number.json",
  g4e = "string.key.json",
  p4e = "comment.block.json",
  f4e = "comment.line.json";
class m4e {
  constructor(e, t) {
    ((this.parent = e), (this.type = t));
  }
  static pop(e) {
    return e ? e.parent : null;
  }
  static push(e, t) {
    return new m4e(e, t);
  }
  static equals(e, t) {
    if (!e && !t) return !0;
    if (!e || !t) return !1;
    for (; e && t; ) {
      if (e === t) return !0;
      if (e.type !== t.type) return !1;
      ((e = e.parent), (t = t.parent));
    }
    return !0;
  }
}
class _4e {
  constructor(e, t, n, i) {
    ((this._state = e), (this.scanError = t), (this.lastWasColon = n), (this.parents = i));
  }
  clone() {
    return new _4e(this._state, this.scanError, this.lastWasColon, this.parents);
  }
  equals(e) {
    return (
      e === this ||
      (!!(e && e instanceof _4e) &&
        this.scanError === e.scanError &&
        this.lastWasColon === e.lastWasColon &&
        m4e.equals(this.parents, e.parents))
    );
  }
  getStateData() {
    return this._state;
  }
  setStateData(e) {
    this._state = e;
  }
}
let v4e;
class b4e extends u2e {
  constructor(e, t, n) {
    (super(e, t, n.onDidChange),
      this._disposables.push(
        BGe.onWillDisposeModel((e) => {
          this._resetSchema(e.uri);
        }),
      ),
      this._disposables.push(
        BGe.onDidChangeModelLanguage((e) => {
          this._resetSchema(e.model.uri);
        }),
      ));
  }
  _resetSchema(e) {
    this._worker().then((t) => {
      t.resetSchema(e.toString());
    });
  }
}
function y4e(e) {
  return { dispose: () => x4e(e) };
}
function x4e(e) {
  for (; e.length; ) e.pop().dispose();
}
const w4e = {
    wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}", notIn: ["string"] },
      { open: "[", close: "]", notIn: ["string"] },
      { open: '"', close: '"', notIn: ["string"] },
    ],
  },
  C4e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        CompletionAdapter: g2e,
        DefinitionAdapter: k2e,
        DiagnosticsAdapter: u2e,
        DocumentColorAdapter: P2e,
        DocumentFormattingEditProvider: O2e,
        DocumentHighlightAdapter: C2e,
        DocumentLinkAdapter: R2e,
        DocumentRangeFormattingEditProvider: M2e,
        DocumentSymbolAdapter: D2e,
        FoldingRangeAdapter: j2e,
        HoverAdapter: y2e,
        ReferenceAdapter: N2e,
        RenameAdapter: L2e,
        SelectionRangeAdapter: F2e,
        WorkerManager: K2e,
        fromPosition: p2e,
        fromRange: f2e,
        getWorker: function () {
          return new Promise((e, t) => {
            if (!v4e) return t("JSON not registered!");
            e(v4e);
          });
        },
        setupMode: function (e) {
          const t = [],
            n = [],
            i = new K2e(e);
          function r() {
            const { languageId: t, modeConfiguration: i } = e;
            (x4e(n),
              i.documentFormattingEdits &&
                n.push(VGe.registerDocumentFormattingEditProvider(t, new O2e(v4e))),
              i.documentRangeFormattingEdits &&
                n.push(VGe.registerDocumentRangeFormattingEditProvider(t, new M2e(v4e))),
              i.completionItems &&
                n.push(VGe.registerCompletionItemProvider(t, new g2e(v4e, [" ", ":", '"']))),
              i.hovers && n.push(VGe.registerHoverProvider(t, new y2e(v4e))),
              i.documentSymbols && n.push(VGe.registerDocumentSymbolProvider(t, new D2e(v4e))),
              i.tokens && n.push(VGe.setTokensProvider(t, r4e())),
              i.colors && n.push(VGe.registerColorProvider(t, new P2e(v4e))),
              i.foldingRanges && n.push(VGe.registerFoldingRangeProvider(t, new j2e(v4e))),
              i.diagnostics && n.push(new b4e(t, v4e, e)),
              i.selectionRanges && n.push(VGe.registerSelectionRangeProvider(t, new F2e(v4e))));
          }
          (t.push(i),
            (v4e = (...e) => i.getLanguageServiceWorker(...e)),
            r(),
            t.push(VGe.setLanguageConfiguration(e.languageId, w4e)));
          let o = e.modeConfiguration;
          return (
            e.onDidChange((e) => {
              e.modeConfiguration !== o && ((o = e.modeConfiguration), r());
            }),
            t.push(y4e(n)),
            y4e(t)
          );
        },
        toRange: m2e,
        toTextEdit: v2e,
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  );
class S4e {
  constructor(e, t) {
    ((this._modeId = e),
      (this._defaults = t),
      (this._worker = null),
      (this._client = null),
      (this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker())),
      (this._updateExtraLibsToken = 0),
      (this._extraLibsChangeListener = this._defaults.onDidExtraLibsChange(() =>
        this._updateExtraLibs(),
      )));
  }
  dispose() {
    (this._configChangeListener.dispose(),
      this._extraLibsChangeListener.dispose(),
      this._stopWorker());
  }
  _stopWorker() {
    (this._worker && (this._worker.dispose(), (this._worker = null)), (this._client = null));
  }
  async _updateExtraLibs() {
    if (!this._worker) return;
    const e = ++this._updateExtraLibsToken,
      t = await this._worker.getProxy();
    this._updateExtraLibsToken === e && t.updateExtraLibs(this._defaults.getExtraLibs());
  }
  _getClient() {
    return (
      this._client ||
        (this._client = (async () => (
          (this._worker = bQe({
            moduleId: "vs/language/typescript/tsWorker",
            createWorker: () =>
              new Worker(
                new URL(
                  "" + new URL("ts.worker-sc26f_2L.js", import.meta.url).href,
                  import.meta.url,
                ),
                { type: "module" },
              ),
            label: this._modeId,
            keepIdleModels: !0,
            createData: {
              compilerOptions: this._defaults.getCompilerOptions(),
              extraLibs: this._defaults.getExtraLibs(),
              customWorkerPath: this._defaults.workerOptions.customWorkerPath,
              inlayHintsOptions: this._defaults.inlayHintsOptions,
            },
          })),
          this._defaults.getEagerModelSync()
            ? await this._worker.withSyncedResources(
                BGe.getModels()
                  .filter((e) => e.getLanguageId() === this._modeId)
                  .map((e) => e.uri),
              )
            : await this._worker.getProxy()
        ))()),
      this._client
    );
  }
  async getLanguageServiceWorker(...e) {
    const t = await this._getClient();
    return (this._worker && (await this._worker.withSyncedResources(e)), t);
  }
}
const k4e = {};
function E4e(e, t, n = 0) {
  if ("string" == typeof e) return e;
  if (void 0 === e) return "";
  let i = "";
  if (n) {
    i += t;
    for (let e = 0; e < n; e++) i += "  ";
  }
  if (((i += e.messageText), n++, e.next)) for (const r of e.next) i += E4e(r, t, n);
  return i;
}
function N4e(e) {
  return e ? e.map((e) => e.text).join("") : "";
}
((k4e["lib.d.ts"] = !0),
  (k4e["lib.decorators.d.ts"] = !0),
  (k4e["lib.decorators.legacy.d.ts"] = !0),
  (k4e["lib.dom.asynciterable.d.ts"] = !0),
  (k4e["lib.dom.d.ts"] = !0),
  (k4e["lib.dom.iterable.d.ts"] = !0),
  (k4e["lib.es2015.collection.d.ts"] = !0),
  (k4e["lib.es2015.core.d.ts"] = !0),
  (k4e["lib.es2015.d.ts"] = !0),
  (k4e["lib.es2015.generator.d.ts"] = !0),
  (k4e["lib.es2015.iterable.d.ts"] = !0),
  (k4e["lib.es2015.promise.d.ts"] = !0),
  (k4e["lib.es2015.proxy.d.ts"] = !0),
  (k4e["lib.es2015.reflect.d.ts"] = !0),
  (k4e["lib.es2015.symbol.d.ts"] = !0),
  (k4e["lib.es2015.symbol.wellknown.d.ts"] = !0),
  (k4e["lib.es2016.array.include.d.ts"] = !0),
  (k4e["lib.es2016.d.ts"] = !0),
  (k4e["lib.es2016.full.d.ts"] = !0),
  (k4e["lib.es2016.intl.d.ts"] = !0),
  (k4e["lib.es2017.arraybuffer.d.ts"] = !0),
  (k4e["lib.es2017.d.ts"] = !0),
  (k4e["lib.es2017.date.d.ts"] = !0),
  (k4e["lib.es2017.full.d.ts"] = !0),
  (k4e["lib.es2017.intl.d.ts"] = !0),
  (k4e["lib.es2017.object.d.ts"] = !0),
  (k4e["lib.es2017.sharedmemory.d.ts"] = !0),
  (k4e["lib.es2017.string.d.ts"] = !0),
  (k4e["lib.es2017.typedarrays.d.ts"] = !0),
  (k4e["lib.es2018.asyncgenerator.d.ts"] = !0),
  (k4e["lib.es2018.asynciterable.d.ts"] = !0),
  (k4e["lib.es2018.d.ts"] = !0),
  (k4e["lib.es2018.full.d.ts"] = !0),
  (k4e["lib.es2018.intl.d.ts"] = !0),
  (k4e["lib.es2018.promise.d.ts"] = !0),
  (k4e["lib.es2018.regexp.d.ts"] = !0),
  (k4e["lib.es2019.array.d.ts"] = !0),
  (k4e["lib.es2019.d.ts"] = !0),
  (k4e["lib.es2019.full.d.ts"] = !0),
  (k4e["lib.es2019.intl.d.ts"] = !0),
  (k4e["lib.es2019.object.d.ts"] = !0),
  (k4e["lib.es2019.string.d.ts"] = !0),
  (k4e["lib.es2019.symbol.d.ts"] = !0),
  (k4e["lib.es2020.bigint.d.ts"] = !0),
  (k4e["lib.es2020.d.ts"] = !0),
  (k4e["lib.es2020.date.d.ts"] = !0),
  (k4e["lib.es2020.full.d.ts"] = !0),
  (k4e["lib.es2020.intl.d.ts"] = !0),
  (k4e["lib.es2020.number.d.ts"] = !0),
  (k4e["lib.es2020.promise.d.ts"] = !0),
  (k4e["lib.es2020.sharedmemory.d.ts"] = !0),
  (k4e["lib.es2020.string.d.ts"] = !0),
  (k4e["lib.es2020.symbol.wellknown.d.ts"] = !0),
  (k4e["lib.es2021.d.ts"] = !0),
  (k4e["lib.es2021.full.d.ts"] = !0),
  (k4e["lib.es2021.intl.d.ts"] = !0),
  (k4e["lib.es2021.promise.d.ts"] = !0),
  (k4e["lib.es2021.string.d.ts"] = !0),
  (k4e["lib.es2021.weakref.d.ts"] = !0),
  (k4e["lib.es2022.array.d.ts"] = !0),
  (k4e["lib.es2022.d.ts"] = !0),
  (k4e["lib.es2022.error.d.ts"] = !0),
  (k4e["lib.es2022.full.d.ts"] = !0),
  (k4e["lib.es2022.intl.d.ts"] = !0),
  (k4e["lib.es2022.object.d.ts"] = !0),
  (k4e["lib.es2022.regexp.d.ts"] = !0),
  (k4e["lib.es2022.string.d.ts"] = !0),
  (k4e["lib.es2023.array.d.ts"] = !0),
  (k4e["lib.es2023.collection.d.ts"] = !0),
  (k4e["lib.es2023.d.ts"] = !0),
  (k4e["lib.es2023.full.d.ts"] = !0),
  (k4e["lib.es2023.intl.d.ts"] = !0),
  (k4e["lib.es2024.arraybuffer.d.ts"] = !0),
  (k4e["lib.es2024.collection.d.ts"] = !0),
  (k4e["lib.es2024.d.ts"] = !0),
  (k4e["lib.es2024.full.d.ts"] = !0),
  (k4e["lib.es2024.object.d.ts"] = !0),
  (k4e["lib.es2024.promise.d.ts"] = !0),
  (k4e["lib.es2024.regexp.d.ts"] = !0),
  (k4e["lib.es2024.sharedmemory.d.ts"] = !0),
  (k4e["lib.es2024.string.d.ts"] = !0),
  (k4e["lib.es5.d.ts"] = !0),
  (k4e["lib.es6.d.ts"] = !0),
  (k4e["lib.esnext.array.d.ts"] = !0),
  (k4e["lib.esnext.collection.d.ts"] = !0),
  (k4e["lib.esnext.d.ts"] = !0),
  (k4e["lib.esnext.decorators.d.ts"] = !0),
  (k4e["lib.esnext.disposable.d.ts"] = !0),
  (k4e["lib.esnext.error.d.ts"] = !0),
  (k4e["lib.esnext.float16.d.ts"] = !0),
  (k4e["lib.esnext.full.d.ts"] = !0),
  (k4e["lib.esnext.intl.d.ts"] = !0),
  (k4e["lib.esnext.iterator.d.ts"] = !0),
  (k4e["lib.esnext.promise.d.ts"] = !0),
  (k4e["lib.esnext.sharedmemory.d.ts"] = !0),
  (k4e["lib.scripthost.d.ts"] = !0),
  (k4e["lib.webworker.asynciterable.d.ts"] = !0),
  (k4e["lib.webworker.d.ts"] = !0),
  (k4e["lib.webworker.importscripts.d.ts"] = !0),
  (k4e["lib.webworker.iterable.d.ts"] = !0));
class L4e {
  constructor(e) {
    this._worker = e;
  }
  _textSpanToRange(e, t) {
    let n = e.getPositionAt(t.start),
      i = e.getPositionAt(t.start + t.length),
      { lineNumber: r, column: o } = n,
      { lineNumber: s, column: a } = i;
    return { startLineNumber: r, startColumn: o, endLineNumber: s, endColumn: a };
  }
}
class D4e {
  constructor(e) {
    ((this._worker = e),
      (this._libFiles = {}),
      (this._hasFetchedLibFiles = !1),
      (this._fetchLibFilesPromise = null));
  }
  isLibFile(e) {
    return !!e && 0 === e.path.indexOf("/lib.") && !!k4e[e.path.slice(1)];
  }
  getOrCreateModel(e) {
    const t = jGe.parse(e),
      n = BGe.getModel(t);
    if (n) return n;
    if (this.isLibFile(t) && this._hasFetchedLibFiles)
      return BGe.createModel(this._libFiles[t.path.slice(1)], "typescript", t);
    const i = wZe.getExtraLibs()[e];
    return i ? BGe.createModel(i.content, "typescript", t) : null;
  }
  _containsLibFile(e) {
    for (let t of e) if (this.isLibFile(t)) return !0;
    return !1;
  }
  async fetchLibFilesIfNecessary(e) {
    this._containsLibFile(e) && (await this._fetchLibFiles());
  }
  _fetchLibFiles() {
    return (
      this._fetchLibFilesPromise ||
        (this._fetchLibFilesPromise = this._worker()
          .then((e) => e.getLibFiles())
          .then((e) => {
            ((this._hasFetchedLibFiles = !0), (this._libFiles = e));
          })),
      this._fetchLibFilesPromise
    );
  }
}
class T4e extends L4e {
  constructor(e, t, n, i) {
    (super(i),
      (this._libFiles = e),
      (this._defaults = t),
      (this._selector = n),
      (this._disposables = []),
      (this._listener = Object.create(null)));
    const r = (e) => {
        if (e.getLanguageId() !== n) return;
        const t = () => {
          const { onlyVisible: t } = this._defaults.getDiagnosticsOptions();
          t ? e.isAttachedToEditor() && this._doValidate(e) : this._doValidate(e);
        };
        let i;
        const r = e.onDidChangeContent(() => {
            (clearTimeout(i), (i = window.setTimeout(t, 500)));
          }),
          o = e.onDidChangeAttached(() => {
            const { onlyVisible: n } = this._defaults.getDiagnosticsOptions();
            n && (e.isAttachedToEditor() ? t() : BGe.setModelMarkers(e, this._selector, []));
          });
        ((this._listener[e.uri.toString()] = {
          dispose() {
            (r.dispose(), o.dispose(), clearTimeout(i));
          },
        }),
          t());
      },
      o = (e) => {
        BGe.setModelMarkers(e, this._selector, []);
        const t = e.uri.toString();
        this._listener[t] && (this._listener[t].dispose(), delete this._listener[t]);
      };
    (this._disposables.push(BGe.onDidCreateModel((e) => r(e))),
      this._disposables.push(BGe.onWillDisposeModel(o)),
      this._disposables.push(
        BGe.onDidChangeModelLanguage((e) => {
          (o(e.model), r(e.model));
        }),
      ),
      this._disposables.push({
        dispose() {
          for (const e of BGe.getModels()) o(e);
        },
      }));
    const s = () => {
      for (const e of BGe.getModels()) (o(e), r(e));
    };
    (this._disposables.push(this._defaults.onDidChange(s)),
      this._disposables.push(this._defaults.onDidExtraLibsChange(s)),
      BGe.getModels().forEach((e) => r(e)));
  }
  dispose() {
    (this._disposables.forEach((e) => e && e.dispose()), (this._disposables = []));
  }
  async _doValidate(e) {
    const t = await this._worker(e.uri);
    if (e.isDisposed()) return;
    const n = [],
      {
        noSyntaxValidation: i,
        noSemanticValidation: r,
        noSuggestionDiagnostics: o,
      } = this._defaults.getDiagnosticsOptions();
    (i || n.push(t.getSyntacticDiagnostics(e.uri.toString())),
      r || n.push(t.getSemanticDiagnostics(e.uri.toString())),
      o || n.push(t.getSuggestionDiagnostics(e.uri.toString())));
    const s = await Promise.all(n);
    if (!s || e.isDisposed()) return;
    const a = s
        .reduce((e, t) => t.concat(e), [])
        .filter(
          (e) =>
            -1 ===
            (this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore || []).indexOf(e.code),
        ),
      l = a
        .map((e) => e.relatedInformation || [])
        .reduce((e, t) => t.concat(e), [])
        .map((e) => (e.file ? jGe.parse(e.file.fileName) : null));
    (await this._libFiles.fetchLibFilesIfNecessary(l),
      e.isDisposed() ||
        BGe.setModelMarkers(
          e,
          this._selector,
          a.map((t) => this._convertDiagnostics(e, t)),
        ));
  }
  _convertDiagnostics(e, t) {
    const n = t.start || 0,
      i = t.length || 1,
      { lineNumber: r, column: o } = e.getPositionAt(n),
      { lineNumber: s, column: a } = e.getPositionAt(n + i),
      l = [];
    return (
      t.reportsUnnecessary && l.push(PGe.Unnecessary),
      t.reportsDeprecated && l.push(PGe.Deprecated),
      {
        severity: this._tsDiagnosticCategoryToMarkerSeverity(t.category),
        startLineNumber: r,
        startColumn: o,
        endLineNumber: s,
        endColumn: a,
        message: E4e(t.messageText, "\n"),
        code: t.code.toString(),
        tags: l,
        relatedInformation: this._convertRelatedInformation(e, t.relatedInformation),
      }
    );
  }
  _convertRelatedInformation(e, t) {
    if (!t) return [];
    const n = [];
    return (
      t.forEach((t) => {
        let i = e;
        if ((t.file && (i = this._libFiles.getOrCreateModel(t.file.fileName)), !i)) return;
        const r = t.start || 0,
          o = t.length || 1,
          { lineNumber: s, column: a } = i.getPositionAt(r),
          { lineNumber: l, column: c } = i.getPositionAt(r + o);
        n.push({
          resource: i.uri,
          startLineNumber: s,
          startColumn: a,
          endLineNumber: l,
          endColumn: c,
          message: E4e(t.messageText, "\n"),
        });
      }),
      n
    );
  }
  _tsDiagnosticCategoryToMarkerSeverity(e) {
    switch (e) {
      case 1:
        return AGe.Error;
      case 3:
        return AGe.Info;
      case 0:
        return AGe.Warning;
      case 2:
        return AGe.Hint;
    }
    return AGe.Info;
  }
}
class I4e extends L4e {
  get triggerCharacters() {
    return ["."];
  }
  async provideCompletionItems(e, t, n, i) {
    const r = e.getWordUntilPosition(t),
      o = new RGe(t.lineNumber, r.startColumn, t.lineNumber, r.endColumn),
      s = e.uri,
      a = e.getOffsetAt(t),
      l = await this._worker(s);
    if (e.isDisposed()) return;
    const c = await l.getCompletionsAtPosition(s.toString(), a);
    if (!c || e.isDisposed()) return;
    const d = c.entries.map((n) => {
      let i = o;
      if (n.replacementSpan) {
        const t = e.getPositionAt(n.replacementSpan.start),
          r = e.getPositionAt(n.replacementSpan.start + n.replacementSpan.length);
        i = new RGe(t.lineNumber, t.column, r.lineNumber, r.column);
      }
      const r = [];
      return (
        void 0 !== n.kindModifiers &&
          -1 !== n.kindModifiers.indexOf("deprecated") &&
          r.push(VGe.CompletionItemTag.Deprecated),
        {
          uri: s,
          position: t,
          offset: a,
          range: i,
          label: n.name,
          insertText: n.name,
          sortText: n.sortText,
          kind: I4e.convertKind(n.kind),
          tags: r,
        }
      );
    });
    return { suggestions: d };
  }
  async resolveCompletionItem(e, t) {
    const n = e,
      i = n.uri,
      r = n.position,
      o = n.offset,
      s = await this._worker(i),
      a = await s.getCompletionEntryDetails(i.toString(), o, n.label);
    return a
      ? {
          uri: i,
          position: r,
          label: a.name,
          kind: I4e.convertKind(a.kind),
          detail: N4e(a.displayParts),
          documentation: { value: I4e.createDocumentationString(a) },
        }
      : n;
  }
  static convertKind(e) {
    switch (e) {
      case B4e.primitiveType:
      case B4e.keyword:
        return VGe.CompletionItemKind.Keyword;
      case B4e.variable:
      case B4e.localVariable:
        return VGe.CompletionItemKind.Variable;
      case B4e.memberVariable:
      case B4e.memberGetAccessor:
      case B4e.memberSetAccessor:
        return VGe.CompletionItemKind.Field;
      case B4e.function:
      case B4e.memberFunction:
      case B4e.constructSignature:
      case B4e.callSignature:
      case B4e.indexSignature:
        return VGe.CompletionItemKind.Function;
      case B4e.enum:
        return VGe.CompletionItemKind.Enum;
      case B4e.module:
        return VGe.CompletionItemKind.Module;
      case B4e.class:
        return VGe.CompletionItemKind.Class;
      case B4e.interface:
        return VGe.CompletionItemKind.Interface;
      case B4e.warning:
        return VGe.CompletionItemKind.File;
    }
    return VGe.CompletionItemKind.Property;
  }
  static createDocumentationString(e) {
    let t = N4e(e.documentation);
    if (e.tags) for (const n of e.tags) t += `\n\n${R4e(n)}`;
    return t;
  }
}
function R4e(e) {
  let t = `*@${e.name}*`;
  if ("param" === e.name && e.text) {
    const [n, ...i] = e.text;
    ((t += `\`${n.text}\``), i.length > 0 && (t += ` — ${i.map((e) => e.text).join(" ")}`));
  } else
    Array.isArray(e.text)
      ? (t += ` — ${e.text.map((e) => e.text).join(" ")}`)
      : e.text && (t += ` — ${e.text}`);
  return t;
}
class O4e extends L4e {
  constructor() {
    (super(...arguments), (this.signatureHelpTriggerCharacters = ["(", ","]));
  }
  static _toSignatureHelpTriggerReason(e) {
    switch (e.triggerKind) {
      case VGe.SignatureHelpTriggerKind.TriggerCharacter:
        return e.triggerCharacter
          ? e.isRetrigger
            ? { kind: "retrigger", triggerCharacter: e.triggerCharacter }
            : { kind: "characterTyped", triggerCharacter: e.triggerCharacter }
          : { kind: "invoked" };
      case VGe.SignatureHelpTriggerKind.ContentChange:
        return e.isRetrigger ? { kind: "retrigger" } : { kind: "invoked" };
      case VGe.SignatureHelpTriggerKind.Invoke:
      default:
        return { kind: "invoked" };
    }
  }
  async provideSignatureHelp(e, t, n, i) {
    const r = e.uri,
      o = e.getOffsetAt(t),
      s = await this._worker(r);
    if (e.isDisposed()) return;
    const a = await s.getSignatureHelpItems(r.toString(), o, {
      triggerReason: O4e._toSignatureHelpTriggerReason(i),
    });
    if (!a || e.isDisposed()) return;
    const l = {
      activeSignature: a.selectedItemIndex,
      activeParameter: a.argumentIndex,
      signatures: [],
    };
    return (
      a.items.forEach((e) => {
        const t = { label: "", parameters: [] };
        ((t.documentation = { value: N4e(e.documentation) }),
          (t.label += N4e(e.prefixDisplayParts)),
          e.parameters.forEach((n, i, r) => {
            const o = N4e(n.displayParts),
              s = { label: o, documentation: { value: N4e(n.documentation) } };
            ((t.label += o),
              t.parameters.push(s),
              i < r.length - 1 && (t.label += N4e(e.separatorDisplayParts)));
          }),
          (t.label += N4e(e.suffixDisplayParts)),
          l.signatures.push(t));
      }),
      { value: l, dispose() {} }
    );
  }
}
class M4e extends L4e {
  async provideHover(e, t, n) {
    const i = e.uri,
      r = e.getOffsetAt(t),
      o = await this._worker(i);
    if (e.isDisposed()) return;
    const s = await o.getQuickInfoAtPosition(i.toString(), r);
    if (!s || e.isDisposed()) return;
    const a = N4e(s.documentation),
      l = s.tags ? s.tags.map((e) => R4e(e)).join("  \n\n") : "",
      c = N4e(s.displayParts);
    return {
      range: this._textSpanToRange(e, s.textSpan),
      contents: [
        { value: "```typescript\n" + c + "\n```\n" },
        { value: a + (l ? "\n\n" + l : "") },
      ],
    };
  }
}
class A4e extends L4e {
  async provideDocumentHighlights(e, t, n) {
    const i = e.uri,
      r = e.getOffsetAt(t),
      o = await this._worker(i);
    if (e.isDisposed()) return;
    const s = await o.getDocumentHighlights(i.toString(), r, [i.toString()]);
    return s && !e.isDisposed()
      ? s.flatMap((t) =>
          t.highlightSpans.map((t) => ({
            range: this._textSpanToRange(e, t.textSpan),
            kind:
              "writtenReference" === t.kind
                ? VGe.DocumentHighlightKind.Write
                : VGe.DocumentHighlightKind.Text,
          })),
        )
      : void 0;
  }
}
class P4e extends L4e {
  constructor(e, t) {
    (super(t), (this._libFiles = e));
  }
  async provideDefinition(e, t, n) {
    const i = e.uri,
      r = e.getOffsetAt(t),
      o = await this._worker(i);
    if (e.isDisposed()) return;
    const s = await o.getDefinitionAtPosition(i.toString(), r);
    if (!s || e.isDisposed()) return;
    if (
      (await this._libFiles.fetchLibFilesIfNecessary(s.map((e) => jGe.parse(e.fileName))),
      e.isDisposed())
    )
      return;
    const a = [];
    for (let l of s) {
      const e = this._libFiles.getOrCreateModel(l.fileName);
      e && a.push({ uri: e.uri, range: this._textSpanToRange(e, l.textSpan) });
    }
    return a;
  }
}
class j4e extends L4e {
  constructor(e, t) {
    (super(t), (this._libFiles = e));
  }
  async provideReferences(e, t, n, i) {
    const r = e.uri,
      o = e.getOffsetAt(t),
      s = await this._worker(r);
    if (e.isDisposed()) return;
    const a = await s.getReferencesAtPosition(r.toString(), o);
    if (!a || e.isDisposed()) return;
    if (
      (await this._libFiles.fetchLibFilesIfNecessary(a.map((e) => jGe.parse(e.fileName))),
      e.isDisposed())
    )
      return;
    const l = [];
    for (let c of a) {
      const e = this._libFiles.getOrCreateModel(c.fileName);
      e && l.push({ uri: e.uri, range: this._textSpanToRange(e, c.textSpan) });
    }
    return l;
  }
}
class F4e extends L4e {
  async provideDocumentSymbols(e, t) {
    const n = e.uri,
      i = await this._worker(n);
    if (e.isDisposed()) return;
    const r = await i.getNavigationTree(n.toString());
    if (!r || e.isDisposed()) return;
    const o = (t, n) => ({
      name: t.text,
      detail: "",
      kind: H4e[t.kind] || VGe.SymbolKind.Variable,
      range: this._textSpanToRange(e, t.spans[0]),
      selectionRange: this._textSpanToRange(e, t.spans[0]),
      tags: [],
      children: t.childItems?.map((e) => o(e, t.text)),
      containerName: n,
    });
    return r.childItems ? r.childItems.map((e) => o(e)) : [];
  }
}
class B4e {}
((B4e.unknown = ""),
  (B4e.keyword = "keyword"),
  (B4e.script = "script"),
  (B4e.module = "module"),
  (B4e.class = "class"),
  (B4e.interface = "interface"),
  (B4e.type = "type"),
  (B4e.enum = "enum"),
  (B4e.variable = "var"),
  (B4e.localVariable = "local var"),
  (B4e.function = "function"),
  (B4e.localFunction = "local function"),
  (B4e.memberFunction = "method"),
  (B4e.memberGetAccessor = "getter"),
  (B4e.memberSetAccessor = "setter"),
  (B4e.memberVariable = "property"),
  (B4e.constructorImplementation = "constructor"),
  (B4e.callSignature = "call"),
  (B4e.indexSignature = "index"),
  (B4e.constructSignature = "construct"),
  (B4e.parameter = "parameter"),
  (B4e.typeParameter = "type parameter"),
  (B4e.primitiveType = "primitive type"),
  (B4e.label = "label"),
  (B4e.alias = "alias"),
  (B4e.const = "const"),
  (B4e.let = "let"),
  (B4e.warning = "warning"));
let V4e,
  W4e,
  H4e = Object.create(null);
((H4e[B4e.module] = VGe.SymbolKind.Module),
  (H4e[B4e.class] = VGe.SymbolKind.Class),
  (H4e[B4e.enum] = VGe.SymbolKind.Enum),
  (H4e[B4e.interface] = VGe.SymbolKind.Interface),
  (H4e[B4e.memberFunction] = VGe.SymbolKind.Method),
  (H4e[B4e.memberVariable] = VGe.SymbolKind.Property),
  (H4e[B4e.memberGetAccessor] = VGe.SymbolKind.Property),
  (H4e[B4e.memberSetAccessor] = VGe.SymbolKind.Property),
  (H4e[B4e.variable] = VGe.SymbolKind.Variable),
  (H4e[B4e.const] = VGe.SymbolKind.Variable),
  (H4e[B4e.localVariable] = VGe.SymbolKind.Variable),
  (H4e[B4e.variable] = VGe.SymbolKind.Variable),
  (H4e[B4e.function] = VGe.SymbolKind.Function),
  (H4e[B4e.localFunction] = VGe.SymbolKind.Function));
class z4e extends L4e {
  static _convertOptions(e) {
    return {
      ConvertTabsToSpaces: e.insertSpaces,
      TabSize: e.tabSize,
      IndentSize: e.tabSize,
      IndentStyle: 2,
      NewLineCharacter: "\n",
      InsertSpaceAfterCommaDelimiter: !0,
      InsertSpaceAfterSemicolonInForStatements: !0,
      InsertSpaceBeforeAndAfterBinaryOperators: !0,
      InsertSpaceAfterKeywordsInControlFlowStatements: !0,
      InsertSpaceAfterFunctionKeywordForAnonymousFunctions: !0,
      InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: !1,
      InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: !1,
      InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: !1,
      PlaceOpenBraceOnNewLineForControlBlocks: !1,
      PlaceOpenBraceOnNewLineForFunctions: !1,
    };
  }
  _convertTextChanges(e, t) {
    return { text: t.newText, range: this._textSpanToRange(e, t.span) };
  }
}
class U4e extends z4e {
  constructor() {
    (super(...arguments), (this.canFormatMultipleRanges = !1));
  }
  async provideDocumentRangeFormattingEdits(e, t, n, i) {
    const r = e.uri,
      o = e.getOffsetAt({ lineNumber: t.startLineNumber, column: t.startColumn }),
      s = e.getOffsetAt({ lineNumber: t.endLineNumber, column: t.endColumn }),
      a = await this._worker(r);
    if (e.isDisposed()) return;
    const l = await a.getFormattingEditsForRange(r.toString(), o, s, z4e._convertOptions(n));
    return l && !e.isDisposed() ? l.map((t) => this._convertTextChanges(e, t)) : void 0;
  }
}
class $4e extends z4e {
  get autoFormatTriggerCharacters() {
    return [";", "}", "\n"];
  }
  async provideOnTypeFormattingEdits(e, t, n, i, r) {
    const o = e.uri,
      s = e.getOffsetAt(t),
      a = await this._worker(o);
    if (e.isDisposed()) return;
    const l = await a.getFormattingEditsAfterKeystroke(o.toString(), s, n, z4e._convertOptions(i));
    return l && !e.isDisposed() ? l.map((t) => this._convertTextChanges(e, t)) : void 0;
  }
}
class q4e extends z4e {
  async provideCodeActions(e, t, n, i) {
    const r = e.uri,
      o = e.getOffsetAt({ lineNumber: t.startLineNumber, column: t.startColumn }),
      s = e.getOffsetAt({ lineNumber: t.endLineNumber, column: t.endColumn }),
      a = z4e._convertOptions(e.getOptions()),
      l = n.markers
        .filter((e) => e.code)
        .map((e) => e.code)
        .map(Number),
      c = await this._worker(r);
    if (e.isDisposed()) return;
    const d = await c.getCodeFixesAtPosition(r.toString(), o, s, l, a);
    if (!d || e.isDisposed()) return { actions: [], dispose: () => {} };
    return {
      actions: d
        .filter((e) => 0 === e.changes.filter((e) => e.isNewFile).length)
        .map((t) => this._tsCodeFixActionToMonacoCodeAction(e, n, t)),
      dispose: () => {},
    };
  }
  _tsCodeFixActionToMonacoCodeAction(e, t, n) {
    const i = [];
    for (const r of n.changes)
      for (const t of r.textChanges)
        i.push({
          resource: e.uri,
          versionId: void 0,
          textEdit: { range: this._textSpanToRange(e, t.span), text: t.newText },
        });
    return { title: n.description, edit: { edits: i }, diagnostics: t.markers, kind: "quickfix" };
  }
}
class K4e extends L4e {
  constructor(e, t) {
    (super(t), (this._libFiles = e));
  }
  async provideRenameEdits(e, t, n, i) {
    const r = e.uri,
      o = r.toString(),
      s = e.getOffsetAt(t),
      a = await this._worker(r);
    if (e.isDisposed()) return;
    const l = await a.getRenameInfo(o, s, { allowRenameOfImportPath: !1 });
    if (!1 === l.canRename) return { edits: [], rejectReason: l.localizedErrorMessage };
    if (void 0 !== l.fileToRename) throw new Error("Renaming files is not supported.");
    const c = await a.findRenameLocations(o, s, !1, !1, !1);
    if (!c || e.isDisposed()) return;
    const d = [];
    for (const u of c) {
      const e = this._libFiles.getOrCreateModel(u.fileName);
      if (!e) throw new Error(`Unknown file ${u.fileName}.`);
      d.push({
        resource: e.uri,
        versionId: void 0,
        textEdit: { range: this._textSpanToRange(e, u.textSpan), text: n },
      });
    }
    return { edits: d };
  }
}
class G4e extends L4e {
  async provideInlayHints(e, t, n) {
    const i = e.uri,
      r = i.toString(),
      o = e.getOffsetAt({ lineNumber: t.startLineNumber, column: t.startColumn }),
      s = e.getOffsetAt({ lineNumber: t.endLineNumber, column: t.endColumn }),
      a = await this._worker(i);
    if (e.isDisposed()) return null;
    return {
      hints: (await a.provideInlayHints(r, o, s)).map((t) => ({
        ...t,
        label: t.text,
        position: e.getPositionAt(t.position),
        kind: this._convertHintKind(t.kind),
      })),
      dispose: () => {},
    };
  }
  _convertHintKind(e) {
    return "Parameter" === e ? VGe.InlayHintKind.Parameter : VGe.InlayHintKind.Type;
  }
}
function Z4e(e, t) {
  const n = [],
    i = new S4e(t, e),
    r = (...e) => i.getLanguageServiceWorker(...e),
    o = new D4e(r);
  return (
    (function () {
      const { modeConfiguration: i } = e;
      (!(function (e) {
        for (; e.length; ) e.pop().dispose();
      })(n),
        i.completionItems && n.push(VGe.registerCompletionItemProvider(t, new I4e(r))),
        i.signatureHelp && n.push(VGe.registerSignatureHelpProvider(t, new O4e(r))),
        i.hovers && n.push(VGe.registerHoverProvider(t, new M4e(r))),
        i.documentHighlights && n.push(VGe.registerDocumentHighlightProvider(t, new A4e(r))),
        i.definitions && n.push(VGe.registerDefinitionProvider(t, new P4e(o, r))),
        i.references && n.push(VGe.registerReferenceProvider(t, new j4e(o, r))),
        i.documentSymbols && n.push(VGe.registerDocumentSymbolProvider(t, new F4e(r))),
        i.rename && n.push(VGe.registerRenameProvider(t, new K4e(o, r))),
        i.documentRangeFormattingEdits &&
          n.push(VGe.registerDocumentRangeFormattingEditProvider(t, new U4e(r))),
        i.onTypeFormattingEdits && n.push(VGe.registerOnTypeFormattingEditProvider(t, new $4e(r))),
        i.codeActions && n.push(VGe.registerCodeActionProvider(t, new q4e(r))),
        i.inlayHints && n.push(VGe.registerInlayHintsProvider(t, new G4e(r))),
        i.diagnostics && n.push(new T4e(o, e, t, r)));
    })(),
    r
  );
}
const Y4e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        Adapter: L4e,
        CodeActionAdaptor: q4e,
        DefinitionAdapter: P4e,
        DiagnosticsAdapter: T4e,
        DocumentHighlightAdapter: A4e,
        FormatAdapter: U4e,
        FormatHelper: z4e,
        FormatOnTypeAdapter: $4e,
        InlayHintsAdapter: G4e,
        Kind: B4e,
        LibFiles: D4e,
        OutlineAdapter: F4e,
        QuickInfoAdapter: M4e,
        ReferenceAdapter: j4e,
        RenameAdapter: K4e,
        SignatureHelpAdapter: O4e,
        SuggestAdapter: I4e,
        WorkerManager: S4e,
        flattenDiagnosticMessageText: E4e,
        getJavaScriptWorker: function () {
          return new Promise((e, t) => {
            if (!V4e) return t("JavaScript not registered!");
            e(V4e);
          });
        },
        getTypeScriptWorker: function () {
          return new Promise((e, t) => {
            if (!W4e) return t("TypeScript not registered!");
            e(W4e);
          });
        },
        setupJavaScript: function (e) {
          V4e = Z4e(e, "javascript");
        },
        setupTypeScript: function (e) {
          W4e = Z4e(e, "typescript");
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  X4e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "*" },
          brackets: [
            ["[", "]"],
            ["(", ")"],
          ],
        },
        language: {
          defaultToken: "invalid",
          ignoreCase: !0,
          tokenPostfix: ".abap",
          keywords: [
            "abap-source",
            "abbreviated",
            "abstract",
            "accept",
            "accepting",
            "according",
            "activation",
            "actual",
            "add",
            "add-corresponding",
            "adjacent",
            "after",
            "alias",
            "aliases",
            "align",
            "all",
            "allocate",
            "alpha",
            "analysis",
            "analyzer",
            "and",
            "append",
            "appendage",
            "appending",
            "application",
            "archive",
            "area",
            "arithmetic",
            "as",
            "ascending",
            "aspect",
            "assert",
            "assign",
            "assigned",
            "assigning",
            "association",
            "asynchronous",
            "at",
            "attributes",
            "authority",
            "authority-check",
            "avg",
            "back",
            "background",
            "backup",
            "backward",
            "badi",
            "base",
            "before",
            "begin",
            "between",
            "big",
            "binary",
            "bintohex",
            "bit",
            "black",
            "blank",
            "blanks",
            "blob",
            "block",
            "blocks",
            "blue",
            "bound",
            "boundaries",
            "bounds",
            "boxed",
            "break-point",
            "buffer",
            "by",
            "bypassing",
            "byte",
            "byte-order",
            "call",
            "calling",
            "case",
            "cast",
            "casting",
            "catch",
            "center",
            "centered",
            "chain",
            "chain-input",
            "chain-request",
            "change",
            "changing",
            "channels",
            "character",
            "char-to-hex",
            "check",
            "checkbox",
            "ci_",
            "circular",
            "class",
            "class-coding",
            "class-data",
            "class-events",
            "class-methods",
            "class-pool",
            "cleanup",
            "clear",
            "client",
            "clob",
            "clock",
            "close",
            "coalesce",
            "code",
            "coding",
            "col_background",
            "col_group",
            "col_heading",
            "col_key",
            "col_negative",
            "col_normal",
            "col_positive",
            "col_total",
            "collect",
            "color",
            "column",
            "columns",
            "comment",
            "comments",
            "commit",
            "common",
            "communication",
            "comparing",
            "component",
            "components",
            "compression",
            "compute",
            "concat",
            "concat_with_space",
            "concatenate",
            "cond",
            "condense",
            "condition",
            "connect",
            "connection",
            "constants",
            "context",
            "contexts",
            "continue",
            "control",
            "controls",
            "conv",
            "conversion",
            "convert",
            "copies",
            "copy",
            "corresponding",
            "country",
            "cover",
            "cpi",
            "create",
            "creating",
            "critical",
            "currency",
            "currency_conversion",
            "current",
            "cursor",
            "cursor-selection",
            "customer",
            "customer-function",
            "dangerous",
            "data",
            "database",
            "datainfo",
            "dataset",
            "date",
            "dats_add_days",
            "dats_add_months",
            "dats_days_between",
            "dats_is_valid",
            "daylight",
            "dd/mm/yy",
            "dd/mm/yyyy",
            "ddmmyy",
            "deallocate",
            "decimal_shift",
            "decimals",
            "declarations",
            "deep",
            "default",
            "deferred",
            "define",
            "defining",
            "definition",
            "delete",
            "deleting",
            "demand",
            "department",
            "descending",
            "describe",
            "destination",
            "detail",
            "dialog",
            "directory",
            "disconnect",
            "display",
            "display-mode",
            "distinct",
            "divide",
            "divide-corresponding",
            "division",
            "do",
            "dummy",
            "duplicate",
            "duplicates",
            "duration",
            "during",
            "dynamic",
            "dynpro",
            "edit",
            "editor-call",
            "else",
            "elseif",
            "empty",
            "enabled",
            "enabling",
            "encoding",
            "end",
            "endat",
            "endcase",
            "endcatch",
            "endchain",
            "endclass",
            "enddo",
            "endenhancement",
            "end-enhancement-section",
            "endexec",
            "endform",
            "endfunction",
            "endian",
            "endif",
            "ending",
            "endinterface",
            "end-lines",
            "endloop",
            "endmethod",
            "endmodule",
            "end-of-definition",
            "end-of-editing",
            "end-of-file",
            "end-of-page",
            "end-of-selection",
            "endon",
            "endprovide",
            "endselect",
            "end-test-injection",
            "end-test-seam",
            "endtry",
            "endwhile",
            "endwith",
            "engineering",
            "enhancement",
            "enhancement-point",
            "enhancements",
            "enhancement-section",
            "entries",
            "entry",
            "enum",
            "environment",
            "equiv",
            "errormessage",
            "errors",
            "escaping",
            "event",
            "events",
            "exact",
            "except",
            "exception",
            "exceptions",
            "exception-table",
            "exclude",
            "excluding",
            "exec",
            "execute",
            "exists",
            "exit",
            "exit-command",
            "expand",
            "expanding",
            "expiration",
            "explicit",
            "exponent",
            "export",
            "exporting",
            "extend",
            "extended",
            "extension",
            "extract",
            "fail",
            "fetch",
            "field",
            "field-groups",
            "fields",
            "field-symbol",
            "field-symbols",
            "file",
            "filter",
            "filters",
            "filter-table",
            "final",
            "find",
            "first",
            "first-line",
            "fixed-point",
            "fkeq",
            "fkge",
            "flush",
            "font",
            "for",
            "form",
            "format",
            "forward",
            "found",
            "frame",
            "frames",
            "free",
            "friends",
            "from",
            "function",
            "functionality",
            "function-pool",
            "further",
            "gaps",
            "generate",
            "get",
            "giving",
            "gkeq",
            "gkge",
            "global",
            "grant",
            "green",
            "group",
            "groups",
            "handle",
            "handler",
            "harmless",
            "hashed",
            "having",
            "hdb",
            "header",
            "headers",
            "heading",
            "head-lines",
            "help-id",
            "help-request",
            "hextobin",
            "hide",
            "high",
            "hint",
            "hold",
            "hotspot",
            "icon",
            "id",
            "identification",
            "identifier",
            "ids",
            "if",
            "ignore",
            "ignoring",
            "immediately",
            "implementation",
            "implementations",
            "implemented",
            "implicit",
            "import",
            "importing",
            "in",
            "inactive",
            "incl",
            "include",
            "includes",
            "including",
            "increment",
            "index",
            "index-line",
            "infotypes",
            "inheriting",
            "init",
            "initial",
            "initialization",
            "inner",
            "inout",
            "input",
            "insert",
            "instance",
            "instances",
            "instr",
            "intensified",
            "interface",
            "interface-pool",
            "interfaces",
            "internal",
            "intervals",
            "into",
            "inverse",
            "inverted-date",
            "is",
            "iso",
            "job",
            "join",
            "keep",
            "keeping",
            "kernel",
            "key",
            "keys",
            "keywords",
            "kind",
            "language",
            "last",
            "late",
            "layout",
            "leading",
            "leave",
            "left",
            "left-justified",
            "leftplus",
            "leftspace",
            "legacy",
            "length",
            "let",
            "level",
            "levels",
            "like",
            "line",
            "lines",
            "line-count",
            "linefeed",
            "line-selection",
            "line-size",
            "list",
            "listbox",
            "list-processing",
            "little",
            "llang",
            "load",
            "load-of-program",
            "lob",
            "local",
            "locale",
            "locator",
            "logfile",
            "logical",
            "log-point",
            "long",
            "loop",
            "low",
            "lower",
            "lpad",
            "lpi",
            "ltrim",
            "mail",
            "main",
            "major-id",
            "mapping",
            "margin",
            "mark",
            "mask",
            "match",
            "matchcode",
            "max",
            "maximum",
            "medium",
            "members",
            "memory",
            "mesh",
            "message",
            "message-id",
            "messages",
            "messaging",
            "method",
            "methods",
            "min",
            "minimum",
            "minor-id",
            "mm/dd/yy",
            "mm/dd/yyyy",
            "mmddyy",
            "mode",
            "modif",
            "modifier",
            "modify",
            "module",
            "move",
            "move-corresponding",
            "multiply",
            "multiply-corresponding",
            "name",
            "nametab",
            "native",
            "nested",
            "nesting",
            "new",
            "new-line",
            "new-page",
            "new-section",
            "next",
            "no",
            "no-display",
            "no-extension",
            "no-gap",
            "no-gaps",
            "no-grouping",
            "no-heading",
            "no-scrolling",
            "no-sign",
            "no-title",
            "no-topofpage",
            "no-zero",
            "node",
            "nodes",
            "non-unicode",
            "non-unique",
            "not",
            "null",
            "number",
            "object",
            "objects",
            "obligatory",
            "occurrence",
            "occurrences",
            "occurs",
            "of",
            "off",
            "offset",
            "ole",
            "on",
            "only",
            "open",
            "option",
            "optional",
            "options",
            "or",
            "order",
            "other",
            "others",
            "out",
            "outer",
            "output",
            "output-length",
            "overflow",
            "overlay",
            "pack",
            "package",
            "pad",
            "padding",
            "page",
            "pages",
            "parameter",
            "parameters",
            "parameter-table",
            "part",
            "partially",
            "pattern",
            "percentage",
            "perform",
            "performing",
            "person",
            "pf1",
            "pf10",
            "pf11",
            "pf12",
            "pf13",
            "pf14",
            "pf15",
            "pf2",
            "pf3",
            "pf4",
            "pf5",
            "pf6",
            "pf7",
            "pf8",
            "pf9",
            "pf-status",
            "pink",
            "places",
            "pool",
            "pos_high",
            "pos_low",
            "position",
            "pragmas",
            "precompiled",
            "preferred",
            "preserving",
            "primary",
            "print",
            "print-control",
            "priority",
            "private",
            "procedure",
            "process",
            "program",
            "property",
            "protected",
            "provide",
            "public",
            "push",
            "pushbutton",
            "put",
            "queue-only",
            "quickinfo",
            "radiobutton",
            "raise",
            "raising",
            "range",
            "ranges",
            "read",
            "reader",
            "read-only",
            "receive",
            "received",
            "receiver",
            "receiving",
            "red",
            "redefinition",
            "reduce",
            "reduced",
            "ref",
            "reference",
            "refresh",
            "regex",
            "reject",
            "remote",
            "renaming",
            "replace",
            "replacement",
            "replacing",
            "report",
            "request",
            "requested",
            "reserve",
            "reset",
            "resolution",
            "respecting",
            "responsible",
            "result",
            "results",
            "resumable",
            "resume",
            "retry",
            "return",
            "returncode",
            "returning",
            "returns",
            "right",
            "right-justified",
            "rightplus",
            "rightspace",
            "risk",
            "rmc_communication_failure",
            "rmc_invalid_status",
            "rmc_system_failure",
            "role",
            "rollback",
            "rows",
            "rpad",
            "rtrim",
            "run",
            "sap",
            "sap-spool",
            "saving",
            "scale_preserving",
            "scale_preserving_scientific",
            "scan",
            "scientific",
            "scientific_with_leading_zero",
            "scroll",
            "scroll-boundary",
            "scrolling",
            "search",
            "secondary",
            "seconds",
            "section",
            "select",
            "selection",
            "selections",
            "selection-screen",
            "selection-set",
            "selection-sets",
            "selection-table",
            "select-options",
            "send",
            "separate",
            "separated",
            "set",
            "shared",
            "shift",
            "short",
            "shortdump-id",
            "sign_as_postfix",
            "single",
            "size",
            "skip",
            "skipping",
            "smart",
            "some",
            "sort",
            "sortable",
            "sorted",
            "source",
            "specified",
            "split",
            "spool",
            "spots",
            "sql",
            "sqlscript",
            "stable",
            "stamp",
            "standard",
            "starting",
            "start-of-editing",
            "start-of-selection",
            "state",
            "statement",
            "statements",
            "static",
            "statics",
            "statusinfo",
            "step-loop",
            "stop",
            "structure",
            "structures",
            "style",
            "subkey",
            "submatches",
            "submit",
            "subroutine",
            "subscreen",
            "subtract",
            "subtract-corresponding",
            "suffix",
            "sum",
            "summary",
            "summing",
            "supplied",
            "supply",
            "suppress",
            "switch",
            "switchstates",
            "symbol",
            "syncpoints",
            "syntax",
            "syntax-check",
            "syntax-trace",
            "system-call",
            "system-exceptions",
            "system-exit",
            "tab",
            "tabbed",
            "table",
            "tables",
            "tableview",
            "tabstrip",
            "target",
            "task",
            "tasks",
            "test",
            "testing",
            "test-injection",
            "test-seam",
            "text",
            "textpool",
            "then",
            "throw",
            "time",
            "times",
            "timestamp",
            "timezone",
            "tims_is_valid",
            "title",
            "titlebar",
            "title-lines",
            "to",
            "tokenization",
            "tokens",
            "top-lines",
            "top-of-page",
            "trace-file",
            "trace-table",
            "trailing",
            "transaction",
            "transfer",
            "transformation",
            "translate",
            "transporting",
            "trmac",
            "truncate",
            "truncation",
            "try",
            "tstmp_add_seconds",
            "tstmp_current_utctimestamp",
            "tstmp_is_valid",
            "tstmp_seconds_between",
            "type",
            "type-pool",
            "type-pools",
            "types",
            "uline",
            "unassign",
            "under",
            "unicode",
            "union",
            "unique",
            "unit_conversion",
            "unix",
            "unpack",
            "until",
            "unwind",
            "up",
            "update",
            "upper",
            "user",
            "user-command",
            "using",
            "utf-8",
            "valid",
            "value",
            "value-request",
            "values",
            "vary",
            "varying",
            "verification-message",
            "version",
            "via",
            "view",
            "visible",
            "wait",
            "warning",
            "when",
            "whenever",
            "where",
            "while",
            "width",
            "window",
            "windows",
            "with",
            "with-heading",
            "without",
            "with-title",
            "word",
            "work",
            "write",
            "writer",
            "xml",
            "xsd",
            "yellow",
            "yes",
            "yymmdd",
            "zero",
            "zone",
            "abap_system_timezone",
            "abap_user_timezone",
            "access",
            "action",
            "adabas",
            "adjust_numbers",
            "allow_precision_loss",
            "allowed",
            "amdp",
            "applicationuser",
            "as_geo_json",
            "as400",
            "associations",
            "balance",
            "behavior",
            "breakup",
            "bulk",
            "cds",
            "cds_client",
            "check_before_save",
            "child",
            "clients",
            "corr",
            "corr_spearman",
            "cross",
            "cycles",
            "datn_add_days",
            "datn_add_months",
            "datn_days_between",
            "dats_from_datn",
            "dats_tims_to_tstmp",
            "dats_to_datn",
            "db2",
            "db6",
            "ddl",
            "dense_rank",
            "depth",
            "deterministic",
            "discarding",
            "entities",
            "entity",
            "error",
            "failed",
            "finalize",
            "first_value",
            "fltp_to_dec",
            "following",
            "fractional",
            "full",
            "graph",
            "grouping",
            "hierarchy",
            "hierarchy_ancestors",
            "hierarchy_ancestors_aggregate",
            "hierarchy_descendants",
            "hierarchy_descendants_aggregate",
            "hierarchy_siblings",
            "incremental",
            "indicators",
            "lag",
            "last_value",
            "lead",
            "leaves",
            "like_regexpr",
            "link",
            "locale_sap",
            "lock",
            "locks",
            "many",
            "mapped",
            "matched",
            "measures",
            "median",
            "mssqlnt",
            "multiple",
            "nodetype",
            "ntile",
            "nulls",
            "occurrences_regexpr",
            "one",
            "operations",
            "oracle",
            "orphans",
            "over",
            "parent",
            "parents",
            "partition",
            "pcre",
            "period",
            "pfcg_mapping",
            "preceding",
            "privileged",
            "product",
            "projection",
            "rank",
            "redirected",
            "replace_regexpr",
            "reported",
            "response",
            "responses",
            "root",
            "row",
            "row_number",
            "sap_system_date",
            "save",
            "schema",
            "session",
            "sets",
            "shortdump",
            "siblings",
            "spantree",
            "start",
            "stddev",
            "string_agg",
            "subtotal",
            "sybase",
            "tims_from_timn",
            "tims_to_timn",
            "to_blob",
            "to_clob",
            "total",
            "trace-entry",
            "tstmp_to_dats",
            "tstmp_to_dst",
            "tstmp_to_tims",
            "tstmpl_from_utcl",
            "tstmpl_to_utcl",
            "unbounded",
            "utcl_add_seconds",
            "utcl_current",
            "utcl_seconds_between",
            "uuid",
            "var",
            "verbatim",
          ],
          builtinFunctions: [
            "abs",
            "acos",
            "asin",
            "atan",
            "bit-set",
            "boolc",
            "boolx",
            "ceil",
            "char_off",
            "charlen",
            "cmax",
            "cmin",
            "concat_lines_of",
            "contains",
            "contains_any_not_of",
            "contains_any_of",
            "cos",
            "cosh",
            "count",
            "count_any_not_of",
            "count_any_of",
            "dbmaxlen",
            "distance",
            "escape",
            "exp",
            "find_any_not_of",
            "find_any_of",
            "find_end",
            "floor",
            "frac",
            "from_mixed",
            "ipow",
            "line_exists",
            "line_index",
            "log",
            "log10",
            "matches",
            "nmax",
            "nmin",
            "numofchar",
            "repeat",
            "rescale",
            "reverse",
            "round",
            "segment",
            "shift_left",
            "shift_right",
            "sign",
            "sin",
            "sinh",
            "sqrt",
            "strlen",
            "substring",
            "substring_after",
            "substring_before",
            "substring_from",
            "substring_to",
            "tan",
            "tanh",
            "to_lower",
            "to_mixed",
            "to_upper",
            "trunc",
            "utclong_add",
            "utclong_current",
            "utclong_diff",
            "xsdbool",
            "xstrlen",
          ],
          typeKeywords: [
            "b",
            "c",
            "d",
            "decfloat16",
            "decfloat34",
            "f",
            "i",
            "int8",
            "n",
            "p",
            "s",
            "string",
            "t",
            "utclong",
            "x",
            "xstring",
            "any",
            "clike",
            "csequence",
            "decfloat",
            "numeric",
            "simple",
            "xsequence",
            "accp",
            "char",
            "clnt",
            "cuky",
            "curr",
            "datn",
            "dats",
            "d16d",
            "d16n",
            "d16r",
            "d34d",
            "d34n",
            "d34r",
            "dec",
            "df16_dec",
            "df16_raw",
            "df34_dec",
            "df34_raw",
            "fltp",
            "geom_ewkb",
            "int1",
            "int2",
            "int4",
            "lang",
            "lchr",
            "lraw",
            "numc",
            "quan",
            "raw",
            "rawstring",
            "sstring",
            "timn",
            "tims",
            "unit",
            "utcl",
            "df16_scl",
            "df34_scl",
            "prec",
            "varc",
            "abap_bool",
            "abap_false",
            "abap_true",
            "abap_undefined",
            "me",
            "screen",
            "space",
            "super",
            "sy",
            "syst",
            "table_line",
            "*sys*",
          ],
          builtinMethods: ["class_constructor", "constructor"],
          derivedTypes: [
            "%CID",
            "%CID_REF",
            "%CONTROL",
            "%DATA",
            "%ELEMENT",
            "%FAIL",
            "%KEY",
            "%MSG",
            "%PARAM",
            "%PID",
            "%PID_ASSOC",
            "%PID_PARENT",
            "%_HINTS",
          ],
          cdsLanguage: [
            "@AbapAnnotation",
            "@AbapCatalog",
            "@AccessControl",
            "@API",
            "@ClientDependent",
            "@ClientHandling",
            "@CompatibilityContract",
            "@DataAging",
            "@EndUserText",
            "@Environment",
            "@LanguageDependency",
            "@MappingRole",
            "@Metadata",
            "@MetadataExtension",
            "@ObjectModel",
            "@Scope",
            "@Semantics",
            "$EXTENSION",
            "$SELF",
          ],
          selectors: ["->", "->*", "=>", "~", "~*"],
          operators: [
            " +",
            " -",
            "/",
            "*",
            "**",
            "div",
            "mod",
            "=",
            "#",
            "@",
            "+=",
            "-=",
            "*=",
            "/=",
            "**=",
            "&&=",
            "?=",
            "&",
            "&&",
            "bit-and",
            "bit-not",
            "bit-or",
            "bit-xor",
            "m",
            "o",
            "z",
            "<",
            " >",
            "<=",
            ">=",
            "<>",
            "><",
            "=<",
            "=>",
            "bt",
            "byte-ca",
            "byte-cn",
            "byte-co",
            "byte-cs",
            "byte-na",
            "byte-ns",
            "ca",
            "cn",
            "co",
            "cp",
            "cs",
            "eq",
            "ge",
            "gt",
            "le",
            "lt",
            "na",
            "nb",
            "ne",
            "np",
            "ns",
            "*/",
            "*:",
            "--",
            "/*",
            "//",
          ],
          symbols: /[=><!~?&+\-*\/\^%#@]+/,
          tokenizer: {
            root: [
              [
                /[a-z_\/$%@]([\w\/$%]|-(?!>))*/,
                {
                  cases: {
                    "@typeKeywords": "type",
                    "@keywords": "keyword",
                    "@cdsLanguage": "annotation",
                    "@derivedTypes": "type",
                    "@builtinFunctions": "type",
                    "@builtinMethods": "type",
                    "@operators": "key",
                    "@default": "identifier",
                  },
                },
              ],
              [/<[\w]+>/, "identifier"],
              [/##[\w|_]+/, "comment"],
              { include: "@whitespace" },
              [/[:,.]/, "delimiter"],
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, { cases: { "@selectors": "tag", "@operators": "key", "@default": "" } }],
              [/'/, { token: "string", bracket: "@open", next: "@stringquote" }],
              [/`/, { token: "string", bracket: "@open", next: "@stringping" }],
              [/\|/, { token: "string", bracket: "@open", next: "@stringtemplate" }],
              [/\d+/, "number"],
            ],
            stringtemplate: [
              [/[^\\\|]+/, "string"],
              [/\\\|/, "string"],
              [/\|/, { token: "string", bracket: "@close", next: "@pop" }],
            ],
            stringping: [
              [/[^\\`]+/, "string"],
              [/`/, { token: "string", bracket: "@close", next: "@pop" }],
            ],
            stringquote: [
              [/[^\\']+/, "string"],
              [/'/, { token: "string", bracket: "@close", next: "@pop" }],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/^\*.*$/, "comment"],
              [/\".*$/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  Q4e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: "<", close: ">" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
        end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))"),
      },
    },
  };
let J4e = [];
[
  "abstract",
  "activate",
  "and",
  "any",
  "array",
  "as",
  "asc",
  "assert",
  "autonomous",
  "begin",
  "bigdecimal",
  "blob",
  "boolean",
  "break",
  "bulk",
  "by",
  "case",
  "cast",
  "catch",
  "char",
  "class",
  "collect",
  "commit",
  "const",
  "continue",
  "convertcurrency",
  "decimal",
  "default",
  "delete",
  "desc",
  "do",
  "double",
  "else",
  "end",
  "enum",
  "exception",
  "exit",
  "export",
  "extends",
  "false",
  "final",
  "finally",
  "float",
  "for",
  "from",
  "future",
  "get",
  "global",
  "goto",
  "group",
  "having",
  "hint",
  "if",
  "implements",
  "import",
  "in",
  "inner",
  "insert",
  "instanceof",
  "int",
  "interface",
  "into",
  "join",
  "last_90_days",
  "last_month",
  "last_n_days",
  "last_week",
  "like",
  "limit",
  "list",
  "long",
  "loop",
  "map",
  "merge",
  "native",
  "new",
  "next_90_days",
  "next_month",
  "next_n_days",
  "next_week",
  "not",
  "null",
  "nulls",
  "number",
  "object",
  "of",
  "on",
  "or",
  "outer",
  "override",
  "package",
  "parallel",
  "pragma",
  "private",
  "protected",
  "public",
  "retrieve",
  "return",
  "returning",
  "rollback",
  "savepoint",
  "search",
  "select",
  "set",
  "short",
  "sort",
  "stat",
  "static",
  "strictfp",
  "super",
  "switch",
  "synchronized",
  "system",
  "testmethod",
  "then",
  "this",
  "this_month",
  "this_week",
  "throw",
  "throws",
  "today",
  "tolabel",
  "tomorrow",
  "transaction",
  "transient",
  "trigger",
  "true",
  "try",
  "type",
  "undelete",
  "update",
  "upsert",
  "using",
  "virtual",
  "void",
  "volatile",
  "webservice",
  "when",
  "where",
  "while",
  "yesterday",
].forEach((e) => {
  (J4e.push(e),
    J4e.push(e.toUpperCase()),
    J4e.push(((e) => e.charAt(0).toUpperCase() + e.substr(1))(e)));
});
const e5e = {
    defaultToken: "",
    tokenPostfix: ".apex",
    keywords: J4e,
    operators: [
      "=",
      ">",
      "<",
      "!",
      "~",
      "?",
      ":",
      "==",
      "<=",
      ">=",
      "!=",
      "&&",
      "||",
      "++",
      "--",
      "+",
      "-",
      "*",
      "/",
      "&",
      "|",
      "^",
      "%",
      "<<",
      ">>",
      ">>>",
      "+=",
      "-=",
      "*=",
      "/=",
      "&=",
      "|=",
      "^=",
      "%=",
      "<<=",
      ">>=",
      ">>>=",
    ],
    symbols: /[=><!~?:&|+\-*\/\^%]+/,
    escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
    digits: /\d+(_+\d+)*/,
    octaldigits: /[0-7]+(_+[0-7]+)*/,
    binarydigits: /[0-1]+(_+[0-1]+)*/,
    hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
    tokenizer: {
      root: [
        [
          /[a-z_$][\w$]*/,
          { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
        ],
        [
          /[A-Z][\w\$]*/,
          { cases: { "@keywords": { token: "keyword.$0" }, "@default": "type.identifier" } },
        ],
        { include: "@whitespace" },
        [/[{}()\[\]]/, "@brackets"],
        [/[<>](?!@symbols)/, "@brackets"],
        [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
        [/@\s*[a-zA-Z_\$][\w\$]*/, "annotation"],
        [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, "number.float"],
        [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, "number.float"],
        [/(@digits)[fFdD]/, "number.float"],
        [/(@digits)[lL]?/, "number"],
        [/[;,.]/, "delimiter"],
        [/"([^"\\]|\\.)*$/, "string.invalid"],
        [/'([^'\\]|\\.)*$/, "string.invalid"],
        [/"/, "string", '@string."'],
        [/'/, "string", "@string.'"],
        [/'[^\\']'/, "string"],
        [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
        [/'/, "string.invalid"],
      ],
      whitespace: [
        [/[ \t\r\n]+/, ""],
        [/\/\*\*(?!\/)/, "comment.doc", "@apexdoc"],
        [/\/\*/, "comment", "@comment"],
        [/\/\/.*$/, "comment"],
      ],
      comment: [
        [/[^\/*]+/, "comment"],
        [/\*\//, "comment", "@pop"],
        [/[\/*]/, "comment"],
      ],
      apexdoc: [
        [/[^\/*]+/, "comment.doc"],
        [/\*\//, "comment.doc", "@pop"],
        [/[\/*]/, "comment.doc"],
      ],
      string: [
        [/[^\\"']+/, "string"],
        [/@escapes/, "string.escape"],
        [/\\./, "string.escape.invalid"],
        [/["']/, { cases: { "$#==$S2": { token: "string", next: "@pop" }, "@default": "string" } }],
      ],
    },
  },
  t5e = Object.freeze(
    Object.defineProperty({ __proto__: null, conf: Q4e, language: e5e }, Symbol.toStringTag, {
      value: "Module",
    }),
  ),
  n5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: { comments: { lineComment: "#" } },
        language: {
          defaultToken: "keyword",
          ignoreCase: !0,
          tokenPostfix: ".azcli",
          str: /[^#\s]/,
          tokenizer: {
            root: [
              { include: "@comment" },
              [
                /\s-+@str*\s*/,
                {
                  cases: {
                    "@eos": { token: "key.identifier", next: "@popall" },
                    "@default": { token: "key.identifier", next: "@type" },
                  },
                },
              ],
              [
                /^-+@str*\s*/,
                {
                  cases: {
                    "@eos": { token: "key.identifier", next: "@popall" },
                    "@default": { token: "key.identifier", next: "@type" },
                  },
                },
              ],
            ],
            type: [
              { include: "@comment" },
              [
                /-+@str*\s*/,
                {
                  cases: {
                    "@eos": { token: "key.identifier", next: "@popall" },
                    "@default": "key.identifier",
                  },
                },
              ],
              [
                /@str+\s*/,
                { cases: { "@eos": { token: "string", next: "@popall" }, "@default": "string" } },
              ],
            ],
            comment: [[/#.*$/, { cases: { "@eos": { token: "comment", next: "@popall" } } }]],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  i5e = {
    comments: { lineComment: "REM" },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
    ],
    surroundingPairs: [
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*(::\\s*|REM\\s+)#region"),
        end: new RegExp("^\\s*(::\\s*|REM\\s+)#endregion"),
      },
    },
  },
  r5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: i5e,
        language: {
          defaultToken: "",
          ignoreCase: !0,
          tokenPostfix: ".bat",
          brackets: [
            { token: "delimiter.bracket", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
          ],
          keywords:
            /call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,
          symbols: /[=><!~?&|+\-*\/\^;\.,]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [/^(\s*)(rem(?:\s.*|))$/, ["", "comment"]],
              [/(\@?)(@keywords)(?!\w)/, [{ token: "keyword" }, { token: "keyword.$2" }]],
              [/[ \t\r\n]+/, ""],
              [/setlocal(?!\w)/, "keyword.tag-setlocal"],
              [/endlocal(?!\w)/, "keyword.tag-setlocal"],
              [/[a-zA-Z_]\w*/, ""],
              [/:\w*/, "metatag"],
              [/%[^%]+%/, "variable"],
              [/%%[\w]+(?!\w)/, "variable"],
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, "delimiter"],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/, "number.hex"],
              [/\d+/, "number"],
              [/[;,.]/, "delimiter"],
              [/"/, "string", '@string."'],
              [/'/, "string", "@string.'"],
            ],
            string: [
              [
                /[^\\"'%]+/,
                { cases: { "@eos": { token: "string", next: "@popall" }, "@default": "string" } },
              ],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/%[\w ]+%/, "variable"],
              [/%%[\w]+(?!\w)/, "variable"],
              [
                /["']/,
                { cases: { "$#==$S2": { token: "string", next: "@pop" }, "@default": "string" } },
              ],
              [/$/, "string", "@popall"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  o5e = ((e) => `\\b${e}\\b`)("[_a-zA-Z][_a-zA-Z0-9]*"),
  s5e = {
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "'", close: "'" },
      { open: "'''", close: "'''" },
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "'", close: "'", notIn: ["string", "comment"] },
      { open: "'''", close: "'''", notIn: ["string", "comment"] },
    ],
    autoCloseBefore: ":.,=}])' \n\t",
    indentationRules: {
      increaseIndentPattern: new RegExp(
        "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$",
      ),
      decreaseIndentPattern: new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$"),
    },
  },
  a5e = {
    defaultToken: "",
    tokenPostfix: ".bicep",
    brackets: [
      { open: "{", close: "}", token: "delimiter.curly" },
      { open: "[", close: "]", token: "delimiter.square" },
      { open: "(", close: ")", token: "delimiter.parenthesis" },
    ],
    symbols: /[=><!~?:&|+\-*/^%]+/,
    keywords: [
      "targetScope",
      "resource",
      "module",
      "param",
      "var",
      "output",
      "for",
      "in",
      "if",
      "existing",
    ],
    namedLiterals: ["true", "false", "null"],
    escapes: "\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",
    tokenizer: {
      root: [{ include: "@expression" }, { include: "@whitespace" }],
      stringVerbatim: [
        { regex: "(|'|'')[^']", action: { token: "string" } },
        { regex: "'''", action: { token: "string.quote", next: "@pop" } },
      ],
      stringLiteral: [
        { regex: "\\${", action: { token: "delimiter.bracket", next: "@bracketCounting" } },
        { regex: "[^\\\\'$]+", action: { token: "string" } },
        { regex: "@escapes", action: { token: "string.escape" } },
        { regex: "\\\\.", action: { token: "string.escape.invalid" } },
        { regex: "'", action: { token: "string", next: "@pop" } },
      ],
      bracketCounting: [
        { regex: "{", action: { token: "delimiter.bracket", next: "@bracketCounting" } },
        { regex: "}", action: { token: "delimiter.bracket", next: "@pop" } },
        { include: "expression" },
      ],
      comment: [
        { regex: "[^\\*]+", action: { token: "comment" } },
        { regex: "\\*\\/", action: { token: "comment", next: "@pop" } },
        { regex: "[\\/*]", action: { token: "comment" } },
      ],
      whitespace: [
        { regex: "[ \\t\\r\\n]" },
        { regex: "\\/\\*", action: { token: "comment", next: "@comment" } },
        { regex: "\\/\\/.*$", action: { token: "comment" } },
      ],
      expression: [
        { regex: "'''", action: { token: "string.quote", next: "@stringVerbatim" } },
        { regex: "'", action: { token: "string.quote", next: "@stringLiteral" } },
        { regex: "[0-9]+", action: { token: "number" } },
        {
          regex: o5e,
          action: {
            cases: {
              "@keywords": { token: "keyword" },
              "@namedLiterals": { token: "keyword" },
              "@default": { token: "identifier" },
            },
          },
        },
      ],
    },
  },
  l5e = Object.freeze(
    Object.defineProperty({ __proto__: null, conf: s5e, language: a5e }, Symbol.toStringTag, {
      value: "Module",
    }),
  ),
  c5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["(*", "*)"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
            ["<", ">"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "<", close: ">" },
            { open: "'", close: "'" },
            { open: '"', close: '"' },
            { open: "(*", close: "*)" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "<", close: ">" },
            { open: "'", close: "'" },
            { open: '"', close: '"' },
            { open: "(*", close: "*)" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".cameligo",
          ignoreCase: !0,
          brackets: [
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "<", close: ">", token: "delimiter.angle" },
          ],
          keywords: [
            "abs",
            "assert",
            "block",
            "Bytes",
            "case",
            "Crypto",
            "Current",
            "else",
            "failwith",
            "false",
            "for",
            "fun",
            "if",
            "in",
            "let",
            "let%entry",
            "let%init",
            "List",
            "list",
            "Map",
            "map",
            "match",
            "match%nat",
            "mod",
            "not",
            "operation",
            "Operation",
            "of",
            "record",
            "Set",
            "set",
            "sender",
            "skip",
            "source",
            "String",
            "then",
            "to",
            "true",
            "type",
            "with",
          ],
          typeKeywords: ["int", "unit", "string", "tz", "nat", "bool"],
          operators: [
            "=",
            ">",
            "<",
            "<=",
            ">=",
            "<>",
            ":",
            ":=",
            "and",
            "mod",
            "or",
            "+",
            "-",
            "*",
            "/",
            "@",
            "&",
            "^",
            "%",
            "->",
            "<-",
            "&&",
            "||",
          ],
          symbols: /[=><:@\^&|+\-*\/\^%]+/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_][\w]*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/\$[0-9a-fA-F]{1,16}/, "number.hex"],
              [/\d+/, "number"],
              [/[;,.]/, "delimiter"],
              [/'([^'\\]|\\.)*$/, "string.invalid"],
              [/'/, "string", "@string"],
              [/'[^\\']'/, "string"],
              [/'/, "string.invalid"],
              [/\#\d+/, "string"],
            ],
            comment: [
              [/[^\(\*]+/, "comment"],
              [/\*\)/, "comment", "@pop"],
              [/\(\*/, "comment"],
            ],
            string: [
              [/[^\\']+/, "string"],
              [/\\./, "string.escape.invalid"],
              [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/\(\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  d5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: ";;" },
          brackets: [
            ["[", "]"],
            ["(", ")"],
            ["{", "}"],
          ],
          autoClosingPairs: [
            { open: "[", close: "]" },
            { open: '"', close: '"' },
            { open: "(", close: ")" },
            { open: "{", close: "}" },
          ],
          surroundingPairs: [
            { open: "[", close: "]" },
            { open: '"', close: '"' },
            { open: "(", close: ")" },
            { open: "{", close: "}" },
          ],
        },
        language: {
          defaultToken: "",
          ignoreCase: !0,
          tokenPostfix: ".clj",
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "{", close: "}", token: "delimiter.curly" },
          ],
          constants: ["true", "false", "nil"],
          numbers:
            /^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,
          characters:
            /^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,
          escapes: /^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          qualifiedSymbols:
            /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,
          specialForms: [
            ".",
            "catch",
            "def",
            "do",
            "if",
            "monitor-enter",
            "monitor-exit",
            "new",
            "quote",
            "recur",
            "set!",
            "throw",
            "try",
            "var",
          ],
          coreSymbols: [
            "*",
            "*'",
            "*1",
            "*2",
            "*3",
            "*agent*",
            "*allow-unresolved-vars*",
            "*assert*",
            "*clojure-version*",
            "*command-line-args*",
            "*compile-files*",
            "*compile-path*",
            "*compiler-options*",
            "*data-readers*",
            "*default-data-reader-fn*",
            "*e",
            "*err*",
            "*file*",
            "*flush-on-newline*",
            "*fn-loader*",
            "*in*",
            "*math-context*",
            "*ns*",
            "*out*",
            "*print-dup*",
            "*print-length*",
            "*print-level*",
            "*print-meta*",
            "*print-namespace-maps*",
            "*print-readably*",
            "*read-eval*",
            "*reader-resolver*",
            "*source-path*",
            "*suppress-read*",
            "*unchecked-math*",
            "*use-context-classloader*",
            "*verbose-defrecords*",
            "*warn-on-reflection*",
            "+",
            "+'",
            "-",
            "-'",
            "->",
            "->>",
            "->ArrayChunk",
            "->Eduction",
            "->Vec",
            "->VecNode",
            "->VecSeq",
            "-cache-protocol-fn",
            "-reset-methods",
            "..",
            "/",
            "<",
            "<=",
            "=",
            "==",
            ">",
            ">=",
            "EMPTY-NODE",
            "Inst",
            "StackTraceElement->vec",
            "Throwable->map",
            "accessor",
            "aclone",
            "add-classpath",
            "add-watch",
            "agent",
            "agent-error",
            "agent-errors",
            "aget",
            "alength",
            "alias",
            "all-ns",
            "alter",
            "alter-meta!",
            "alter-var-root",
            "amap",
            "ancestors",
            "and",
            "any?",
            "apply",
            "areduce",
            "array-map",
            "as->",
            "aset",
            "aset-boolean",
            "aset-byte",
            "aset-char",
            "aset-double",
            "aset-float",
            "aset-int",
            "aset-long",
            "aset-short",
            "assert",
            "assoc",
            "assoc!",
            "assoc-in",
            "associative?",
            "atom",
            "await",
            "await-for",
            "await1",
            "bases",
            "bean",
            "bigdec",
            "bigint",
            "biginteger",
            "binding",
            "bit-and",
            "bit-and-not",
            "bit-clear",
            "bit-flip",
            "bit-not",
            "bit-or",
            "bit-set",
            "bit-shift-left",
            "bit-shift-right",
            "bit-test",
            "bit-xor",
            "boolean",
            "boolean-array",
            "boolean?",
            "booleans",
            "bound-fn",
            "bound-fn*",
            "bound?",
            "bounded-count",
            "butlast",
            "byte",
            "byte-array",
            "bytes",
            "bytes?",
            "case",
            "cast",
            "cat",
            "char",
            "char-array",
            "char-escape-string",
            "char-name-string",
            "char?",
            "chars",
            "chunk",
            "chunk-append",
            "chunk-buffer",
            "chunk-cons",
            "chunk-first",
            "chunk-next",
            "chunk-rest",
            "chunked-seq?",
            "class",
            "class?",
            "clear-agent-errors",
            "clojure-version",
            "coll?",
            "comment",
            "commute",
            "comp",
            "comparator",
            "compare",
            "compare-and-set!",
            "compile",
            "complement",
            "completing",
            "concat",
            "cond",
            "cond->",
            "cond->>",
            "condp",
            "conj",
            "conj!",
            "cons",
            "constantly",
            "construct-proxy",
            "contains?",
            "count",
            "counted?",
            "create-ns",
            "create-struct",
            "cycle",
            "dec",
            "dec'",
            "decimal?",
            "declare",
            "dedupe",
            "default-data-readers",
            "definline",
            "definterface",
            "defmacro",
            "defmethod",
            "defmulti",
            "defn",
            "defn-",
            "defonce",
            "defprotocol",
            "defrecord",
            "defstruct",
            "deftype",
            "delay",
            "delay?",
            "deliver",
            "denominator",
            "deref",
            "derive",
            "descendants",
            "destructure",
            "disj",
            "disj!",
            "dissoc",
            "dissoc!",
            "distinct",
            "distinct?",
            "doall",
            "dorun",
            "doseq",
            "dosync",
            "dotimes",
            "doto",
            "double",
            "double-array",
            "double?",
            "doubles",
            "drop",
            "drop-last",
            "drop-while",
            "eduction",
            "empty",
            "empty?",
            "ensure",
            "ensure-reduced",
            "enumeration-seq",
            "error-handler",
            "error-mode",
            "eval",
            "even?",
            "every-pred",
            "every?",
            "ex-data",
            "ex-info",
            "extend",
            "extend-protocol",
            "extend-type",
            "extenders",
            "extends?",
            "false?",
            "ffirst",
            "file-seq",
            "filter",
            "filterv",
            "find",
            "find-keyword",
            "find-ns",
            "find-protocol-impl",
            "find-protocol-method",
            "find-var",
            "first",
            "flatten",
            "float",
            "float-array",
            "float?",
            "floats",
            "flush",
            "fn",
            "fn?",
            "fnext",
            "fnil",
            "for",
            "force",
            "format",
            "frequencies",
            "future",
            "future-call",
            "future-cancel",
            "future-cancelled?",
            "future-done?",
            "future?",
            "gen-class",
            "gen-interface",
            "gensym",
            "get",
            "get-in",
            "get-method",
            "get-proxy-class",
            "get-thread-bindings",
            "get-validator",
            "group-by",
            "halt-when",
            "hash",
            "hash-combine",
            "hash-map",
            "hash-ordered-coll",
            "hash-set",
            "hash-unordered-coll",
            "ident?",
            "identical?",
            "identity",
            "if-let",
            "if-not",
            "if-some",
            "ifn?",
            "import",
            "in-ns",
            "inc",
            "inc'",
            "indexed?",
            "init-proxy",
            "inst-ms",
            "inst-ms*",
            "inst?",
            "instance?",
            "int",
            "int-array",
            "int?",
            "integer?",
            "interleave",
            "intern",
            "interpose",
            "into",
            "into-array",
            "ints",
            "io!",
            "isa?",
            "iterate",
            "iterator-seq",
            "juxt",
            "keep",
            "keep-indexed",
            "key",
            "keys",
            "keyword",
            "keyword?",
            "last",
            "lazy-cat",
            "lazy-seq",
            "let",
            "letfn",
            "line-seq",
            "list",
            "list*",
            "list?",
            "load",
            "load-file",
            "load-reader",
            "load-string",
            "loaded-libs",
            "locking",
            "long",
            "long-array",
            "longs",
            "loop",
            "macroexpand",
            "macroexpand-1",
            "make-array",
            "make-hierarchy",
            "map",
            "map-entry?",
            "map-indexed",
            "map?",
            "mapcat",
            "mapv",
            "max",
            "max-key",
            "memfn",
            "memoize",
            "merge",
            "merge-with",
            "meta",
            "method-sig",
            "methods",
            "min",
            "min-key",
            "mix-collection-hash",
            "mod",
            "munge",
            "name",
            "namespace",
            "namespace-munge",
            "nat-int?",
            "neg-int?",
            "neg?",
            "newline",
            "next",
            "nfirst",
            "nil?",
            "nnext",
            "not",
            "not-any?",
            "not-empty",
            "not-every?",
            "not=",
            "ns",
            "ns-aliases",
            "ns-imports",
            "ns-interns",
            "ns-map",
            "ns-name",
            "ns-publics",
            "ns-refers",
            "ns-resolve",
            "ns-unalias",
            "ns-unmap",
            "nth",
            "nthnext",
            "nthrest",
            "num",
            "number?",
            "numerator",
            "object-array",
            "odd?",
            "or",
            "parents",
            "partial",
            "partition",
            "partition-all",
            "partition-by",
            "pcalls",
            "peek",
            "persistent!",
            "pmap",
            "pop",
            "pop!",
            "pop-thread-bindings",
            "pos-int?",
            "pos?",
            "pr",
            "pr-str",
            "prefer-method",
            "prefers",
            "primitives-classnames",
            "print",
            "print-ctor",
            "print-dup",
            "print-method",
            "print-simple",
            "print-str",
            "printf",
            "println",
            "println-str",
            "prn",
            "prn-str",
            "promise",
            "proxy",
            "proxy-call-with-super",
            "proxy-mappings",
            "proxy-name",
            "proxy-super",
            "push-thread-bindings",
            "pvalues",
            "qualified-ident?",
            "qualified-keyword?",
            "qualified-symbol?",
            "quot",
            "rand",
            "rand-int",
            "rand-nth",
            "random-sample",
            "range",
            "ratio?",
            "rational?",
            "rationalize",
            "re-find",
            "re-groups",
            "re-matcher",
            "re-matches",
            "re-pattern",
            "re-seq",
            "read",
            "read-line",
            "read-string",
            "reader-conditional",
            "reader-conditional?",
            "realized?",
            "record?",
            "reduce",
            "reduce-kv",
            "reduced",
            "reduced?",
            "reductions",
            "ref",
            "ref-history-count",
            "ref-max-history",
            "ref-min-history",
            "ref-set",
            "refer",
            "refer-clojure",
            "reify",
            "release-pending-sends",
            "rem",
            "remove",
            "remove-all-methods",
            "remove-method",
            "remove-ns",
            "remove-watch",
            "repeat",
            "repeatedly",
            "replace",
            "replicate",
            "require",
            "reset!",
            "reset-meta!",
            "reset-vals!",
            "resolve",
            "rest",
            "restart-agent",
            "resultset-seq",
            "reverse",
            "reversible?",
            "rseq",
            "rsubseq",
            "run!",
            "satisfies?",
            "second",
            "select-keys",
            "send",
            "send-off",
            "send-via",
            "seq",
            "seq?",
            "seqable?",
            "seque",
            "sequence",
            "sequential?",
            "set",
            "set-agent-send-executor!",
            "set-agent-send-off-executor!",
            "set-error-handler!",
            "set-error-mode!",
            "set-validator!",
            "set?",
            "short",
            "short-array",
            "shorts",
            "shuffle",
            "shutdown-agents",
            "simple-ident?",
            "simple-keyword?",
            "simple-symbol?",
            "slurp",
            "some",
            "some->",
            "some->>",
            "some-fn",
            "some?",
            "sort",
            "sort-by",
            "sorted-map",
            "sorted-map-by",
            "sorted-set",
            "sorted-set-by",
            "sorted?",
            "special-symbol?",
            "spit",
            "split-at",
            "split-with",
            "str",
            "string?",
            "struct",
            "struct-map",
            "subs",
            "subseq",
            "subvec",
            "supers",
            "swap!",
            "swap-vals!",
            "symbol",
            "symbol?",
            "sync",
            "tagged-literal",
            "tagged-literal?",
            "take",
            "take-last",
            "take-nth",
            "take-while",
            "test",
            "the-ns",
            "thread-bound?",
            "time",
            "to-array",
            "to-array-2d",
            "trampoline",
            "transduce",
            "transient",
            "tree-seq",
            "true?",
            "type",
            "unchecked-add",
            "unchecked-add-int",
            "unchecked-byte",
            "unchecked-char",
            "unchecked-dec",
            "unchecked-dec-int",
            "unchecked-divide-int",
            "unchecked-double",
            "unchecked-float",
            "unchecked-inc",
            "unchecked-inc-int",
            "unchecked-int",
            "unchecked-long",
            "unchecked-multiply",
            "unchecked-multiply-int",
            "unchecked-negate",
            "unchecked-negate-int",
            "unchecked-remainder-int",
            "unchecked-short",
            "unchecked-subtract",
            "unchecked-subtract-int",
            "underive",
            "unquote",
            "unquote-splicing",
            "unreduced",
            "unsigned-bit-shift-right",
            "update",
            "update-in",
            "update-proxy",
            "uri?",
            "use",
            "uuid?",
            "val",
            "vals",
            "var-get",
            "var-set",
            "var?",
            "vary-meta",
            "vec",
            "vector",
            "vector-of",
            "vector?",
            "volatile!",
            "volatile?",
            "vreset!",
            "vswap!",
            "when",
            "when-first",
            "when-let",
            "when-not",
            "when-some",
            "while",
            "with-bindings",
            "with-bindings*",
            "with-in-str",
            "with-loading-context",
            "with-local-vars",
            "with-meta",
            "with-open",
            "with-out-str",
            "with-precision",
            "with-redefs",
            "with-redefs-fn",
            "xml-seq",
            "zero?",
            "zipmap",
          ],
          tokenizer: {
            root: [
              { include: "@whitespace" },
              [/@numbers/, "number"],
              [/@characters/, "string"],
              { include: "@string" },
              [/[()\[\]{}]/, "@brackets"],
              [/\/#"(?:\.|(?:")|[^"\n])*"\/g/, "regexp"],
              [/[#'@^`~]/, "meta"],
              [
                /@qualifiedSymbols/,
                {
                  cases: {
                    "^:.+$": "constant",
                    "@specialForms": "keyword",
                    "@coreSymbols": "keyword",
                    "@constants": "constant",
                    "@default": "identifier",
                  },
                },
              ],
            ],
            whitespace: [
              [/[\s,]+/, "white"],
              [/;.*$/, "comment"],
              [/\(comment\b/, "comment", "@comment"],
            ],
            comment: [
              [/\(/, "comment", "@push"],
              [/\)/, "comment", "@pop"],
              [/[^()]/, "comment"],
            ],
            string: [[/"/, "string", "@multiLineString"]],
            multiLineString: [
              [/"/, "string", "@popall"],
              [/@escapes/, "string.escape"],
              [/./, "string"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  u5e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { blockComment: ["###", "###"], lineComment: "#" },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: { start: new RegExp("^\\s*#region\\b"), end: new RegExp("^\\s*#endregion\\b") },
    },
  },
  h5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: u5e,
        language: {
          defaultToken: "",
          ignoreCase: !0,
          tokenPostfix: ".coffee",
          brackets: [
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          regEx: /\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,
          keywords: [
            "and",
            "or",
            "is",
            "isnt",
            "not",
            "on",
            "yes",
            "@",
            "no",
            "off",
            "true",
            "false",
            "null",
            "this",
            "new",
            "delete",
            "typeof",
            "in",
            "instanceof",
            "return",
            "throw",
            "break",
            "continue",
            "debugger",
            "if",
            "else",
            "switch",
            "for",
            "while",
            "do",
            "try",
            "catch",
            "finally",
            "class",
            "extends",
            "super",
            "undefined",
            "then",
            "unless",
            "until",
            "loop",
            "of",
            "by",
            "when",
          ],
          symbols: /[=><!~?&%|+\-*\/\^\.,\:]+/,
          escapes: /\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [/\@[a-zA-Z_]\w*/, "variable.predefined"],
              [
                /[a-zA-Z_]\w*/,
                {
                  cases: {
                    this: "variable.predefined",
                    "@keywords": { token: "keyword.$0" },
                    "@default": "",
                  },
                },
              ],
              [/[ \t\r\n]+/, ""],
              [/###/, "comment", "@comment"],
              [/#.*$/, "comment"],
              ["///", { token: "regexp", next: "@hereregexp" }],
              [/^(\s*)(@regEx)/, ["", "regexp"]],
              [/(\()(\s*)(@regEx)/, ["@brackets", "", "regexp"]],
              [/(\,)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
              [/(\=)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
              [/(\:)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
              [/(\[)(\s*)(@regEx)/, ["@brackets", "", "regexp"]],
              [/(\!)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
              [/(\&)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
              [/(\|)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
              [/(\?)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
              [/(\{)(\s*)(@regEx)/, ["@brackets", "", "regexp"]],
              [/(\;)(\s*)(@regEx)/, ["", "", "regexp"]],
              [
                /}/,
                {
                  cases: {
                    "$S2==interpolatedstring": { token: "string", next: "@pop" },
                    "@default": "@brackets",
                  },
                },
              ],
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, "delimiter"],
              [/\d+[eE]([\-+]?\d+)?/, "number.float"],
              [/\d+\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F]+/, "number.hex"],
              [/0[0-7]+(?!\d)/, "number.octal"],
              [/\d+/, "number"],
              [/[,.]/, "delimiter"],
              [/"""/, "string", '@herestring."""'],
              [/'''/, "string", "@herestring.'''"],
              [
                /"/,
                { cases: { "@eos": "string", "@default": { token: "string", next: '@string."' } } },
              ],
              [
                /'/,
                { cases: { "@eos": "string", "@default": { token: "string", next: "@string.'" } } },
              ],
            ],
            string: [
              [/[^"'\#\\]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\./, "string.escape.invalid"],
              [/\./, "string.escape.invalid"],
              [
                /#{/,
                {
                  cases: {
                    '$S2=="': { token: "string", next: "root.interpolatedstring" },
                    "@default": "string",
                  },
                },
              ],
              [
                /["']/,
                { cases: { "$#==$S2": { token: "string", next: "@pop" }, "@default": "string" } },
              ],
              [/#/, "string"],
            ],
            herestring: [
              [
                /("""|''')/,
                { cases: { "$1==$S2": { token: "string", next: "@pop" }, "@default": "string" } },
              ],
              [/[^#\\'"]+/, "string"],
              [/['"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\./, "string.escape.invalid"],
              [/#{/, { token: "string.quote", next: "root.interpolatedstring" }],
              [/#/, "string"],
            ],
            comment: [
              [/[^#]+/, "comment"],
              [/###/, "comment", "@pop"],
              [/#/, "comment"],
            ],
            hereregexp: [
              [/[^\\\/#]+/, "regexp"],
              [/\\./, "regexp"],
              [/#.*$/, "comment"],
              ["///[igm]*", { token: "regexp", next: "@pop" }],
              [/\//, "regexp"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  g5e = {
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "[", close: "]" },
      { open: "{", close: "}" },
      { open: "(", close: ")" },
      { open: "'", close: "'", notIn: ["string", "comment"] },
      { open: '"', close: '"', notIn: ["string"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*#pragma\\s+region\\b"),
        end: new RegExp("^\\s*#pragma\\s+endregion\\b"),
      },
    },
  },
  p5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: g5e,
        language: {
          defaultToken: "",
          tokenPostfix: ".cpp",
          brackets: [
            { token: "delimiter.curly", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
            { token: "delimiter.angle", open: "<", close: ">" },
          ],
          keywords: [
            "abstract",
            "amp",
            "array",
            "auto",
            "bool",
            "break",
            "case",
            "catch",
            "char",
            "class",
            "const",
            "constexpr",
            "const_cast",
            "continue",
            "cpu",
            "decltype",
            "default",
            "delegate",
            "delete",
            "do",
            "double",
            "dynamic_cast",
            "each",
            "else",
            "enum",
            "event",
            "explicit",
            "export",
            "extern",
            "false",
            "final",
            "finally",
            "float",
            "for",
            "friend",
            "gcnew",
            "generic",
            "goto",
            "if",
            "in",
            "initonly",
            "inline",
            "int",
            "interface",
            "interior_ptr",
            "internal",
            "literal",
            "long",
            "mutable",
            "namespace",
            "new",
            "noexcept",
            "nullptr",
            "__nullptr",
            "operator",
            "override",
            "partial",
            "pascal",
            "pin_ptr",
            "private",
            "property",
            "protected",
            "public",
            "ref",
            "register",
            "reinterpret_cast",
            "restrict",
            "return",
            "safe_cast",
            "sealed",
            "short",
            "signed",
            "sizeof",
            "static",
            "static_assert",
            "static_cast",
            "struct",
            "switch",
            "template",
            "this",
            "thread_local",
            "throw",
            "tile_static",
            "true",
            "try",
            "typedef",
            "typeid",
            "typename",
            "union",
            "unsigned",
            "using",
            "virtual",
            "void",
            "volatile",
            "wchar_t",
            "where",
            "while",
            "_asm",
            "_based",
            "_cdecl",
            "_declspec",
            "_fastcall",
            "_if_exists",
            "_if_not_exists",
            "_inline",
            "_multiple_inheritance",
            "_pascal",
            "_single_inheritance",
            "_stdcall",
            "_virtual_inheritance",
            "_w64",
            "__abstract",
            "__alignof",
            "__asm",
            "__assume",
            "__based",
            "__box",
            "__builtin_alignof",
            "__cdecl",
            "__clrcall",
            "__declspec",
            "__delegate",
            "__event",
            "__except",
            "__fastcall",
            "__finally",
            "__forceinline",
            "__gc",
            "__hook",
            "__identifier",
            "__if_exists",
            "__if_not_exists",
            "__inline",
            "__int128",
            "__int16",
            "__int32",
            "__int64",
            "__int8",
            "__interface",
            "__leave",
            "__m128",
            "__m128d",
            "__m128i",
            "__m256",
            "__m256d",
            "__m256i",
            "__m512",
            "__m512d",
            "__m512i",
            "__m64",
            "__multiple_inheritance",
            "__newslot",
            "__nogc",
            "__noop",
            "__nounwind",
            "__novtordisp",
            "__pascal",
            "__pin",
            "__pragma",
            "__property",
            "__ptr32",
            "__ptr64",
            "__raise",
            "__restrict",
            "__resume",
            "__sealed",
            "__single_inheritance",
            "__stdcall",
            "__super",
            "__thiscall",
            "__try",
            "__try_cast",
            "__typeof",
            "__unaligned",
            "__unhook",
            "__uuidof",
            "__value",
            "__virtual_inheritance",
            "__w64",
            "__wchar_t",
          ],
          operators: [
            "=",
            ">",
            "<",
            "!",
            "~",
            "?",
            ":",
            "==",
            "<=",
            ">=",
            "!=",
            "&&",
            "||",
            "++",
            "--",
            "+",
            "-",
            "*",
            "/",
            "&",
            "|",
            "^",
            "%",
            "<<",
            ">>",
            "+=",
            "-=",
            "*=",
            "/=",
            "&=",
            "|=",
            "^=",
            "%=",
            "<<=",
            ">>=",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[0abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          integersuffix: /([uU](ll|LL|l|L)|(ll|LL|l|L)?[uU]?)/,
          floatsuffix: /[fFlL]?/,
          encoding: /u|u8|U|L/,
          tokenizer: {
            root: [
              [/@encoding?R\"(?:([^ ()\\\t]*))\(/, { token: "string.raw.begin", next: "@raw.$1" }],
              [
                /[a-zA-Z_]\w*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              [/^\s*#\s*include/, { token: "keyword.directive.include", next: "@include" }],
              [/^\s*#\s*\w+/, "keyword.directive"],
              { include: "@whitespace" },
              [/\[\s*\[/, { token: "annotation", next: "@annotation" }],
              [/[{}()<>\[\]]/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, "number.hex"],
              [/0[0-7']*[0-7](@integersuffix)/, "number.octal"],
              [/0[bB][0-1']*[0-1](@integersuffix)/, "number.binary"],
              [/\d[\d']*\d(@integersuffix)/, "number"],
              [/\d(@integersuffix)/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", "@string"],
              [/'[^\\']'/, "string"],
              [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
              [/'/, "string.invalid"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*\*(?!\/)/, "comment.doc", "@doccomment"],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*\\$/, "comment", "@linecomment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            linecomment: [
              [/.*[^\\]$/, "comment", "@pop"],
              [/[^]+/, "comment"],
            ],
            doccomment: [
              [/[^\/*]+/, "comment.doc"],
              [/\*\//, "comment.doc", "@pop"],
              [/[\/*]/, "comment.doc"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
            raw: [
              [/[^)]+/, "string.raw"],
              [/\)$S2\"/, { token: "string.raw.end", next: "@pop" }],
              [/\)/, "string.raw"],
            ],
            annotation: [
              { include: "@whitespace" },
              [/using|alignas/, "keyword"],
              [/[a-zA-Z0-9_]+/, "annotation"],
              [/[,:]/, "delimiter"],
              [/[()]/, "@brackets"],
              [/\]\s*\]/, { token: "annotation", next: "@pop" }],
            ],
            include: [
              [
                /(\s*)(<)([^<>]*)(>)/,
                [
                  "",
                  "keyword.directive.include.begin",
                  "string.include.identifier",
                  { token: "keyword.directive.include.end", next: "@pop" },
                ],
              ],
              [
                /(\s*)(")([^"]*)(")/,
                [
                  "",
                  "keyword.directive.include.begin",
                  "string.include.identifier",
                  { token: "keyword.directive.include.end", next: "@pop" },
                ],
              ],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  f5e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "'", close: "'", notIn: ["string", "comment"] },
      { open: '"', close: '"', notIn: ["string", "comment"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">" },
      { open: "'", close: "'" },
      { open: '"', close: '"' },
    ],
    folding: {
      markers: { start: new RegExp("^\\s*#region\\b"), end: new RegExp("^\\s*#endregion\\b") },
    },
  },
  m5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: f5e,
        language: {
          defaultToken: "",
          tokenPostfix: ".cs",
          brackets: [
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "<", close: ">", token: "delimiter.angle" },
          ],
          keywords: [
            "extern",
            "alias",
            "using",
            "bool",
            "decimal",
            "sbyte",
            "byte",
            "short",
            "ushort",
            "int",
            "uint",
            "long",
            "ulong",
            "char",
            "float",
            "double",
            "object",
            "dynamic",
            "string",
            "assembly",
            "is",
            "as",
            "ref",
            "out",
            "this",
            "base",
            "new",
            "typeof",
            "void",
            "checked",
            "unchecked",
            "default",
            "delegate",
            "var",
            "const",
            "if",
            "else",
            "switch",
            "case",
            "while",
            "do",
            "for",
            "foreach",
            "in",
            "break",
            "continue",
            "goto",
            "return",
            "throw",
            "try",
            "catch",
            "finally",
            "lock",
            "yield",
            "from",
            "let",
            "where",
            "join",
            "on",
            "equals",
            "into",
            "orderby",
            "ascending",
            "descending",
            "select",
            "group",
            "by",
            "namespace",
            "partial",
            "class",
            "field",
            "event",
            "method",
            "param",
            "public",
            "protected",
            "internal",
            "private",
            "abstract",
            "sealed",
            "static",
            "struct",
            "readonly",
            "volatile",
            "virtual",
            "override",
            "params",
            "get",
            "set",
            "add",
            "remove",
            "operator",
            "true",
            "false",
            "implicit",
            "explicit",
            "interface",
            "enum",
            "null",
            "async",
            "await",
            "fixed",
            "sizeof",
            "stackalloc",
            "unsafe",
            "nameof",
            "when",
          ],
          namespaceFollows: ["namespace", "using"],
          parenFollows: ["if", "for", "while", "switch", "foreach", "using", "catch", "when"],
          operators: [
            "=",
            "??",
            "||",
            "&&",
            "|",
            "^",
            "&",
            "==",
            "!=",
            "<=",
            ">=",
            "<<",
            "+",
            "-",
            "*",
            "/",
            "%",
            "!",
            "~",
            "++",
            "--",
            "+=",
            "-=",
            "*=",
            "/=",
            "%=",
            "&=",
            "|=",
            "^=",
            "<<=",
            ">>=",
            ">>",
            "=>",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [
                /\@?[a-zA-Z_]\w*/,
                {
                  cases: {
                    "@namespaceFollows": { token: "keyword.$0", next: "@namespace" },
                    "@keywords": { token: "keyword.$0", next: "@qualified" },
                    "@default": { token: "identifier", next: "@qualified" },
                  },
                },
              ],
              { include: "@whitespace" },
              [
                /}/,
                {
                  cases: {
                    "$S2==interpolatedstring": { token: "string.quote", next: "@pop" },
                    "$S2==litinterpstring": { token: "string.quote", next: "@pop" },
                    "@default": "@brackets",
                  },
                },
              ],
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/, "number.float"],
              [/0[xX][0-9a-fA-F_]+/, "number.hex"],
              [/0[bB][01_]+/, "number.hex"],
              [/[0-9_]+/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, { token: "string.quote", next: "@string" }],
              [/\$\@"/, { token: "string.quote", next: "@litinterpstring" }],
              [/\@"/, { token: "string.quote", next: "@litstring" }],
              [/\$"/, { token: "string.quote", next: "@interpolatedstring" }],
              [/'[^\\']'/, "string"],
              [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
              [/'/, "string.invalid"],
            ],
            qualified: [
              [
                /[a-zA-Z_][\w]*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              [/\./, "delimiter"],
              ["", "", "@pop"],
            ],
            namespace: [
              { include: "@whitespace" },
              [/[A-Z]\w*/, "namespace"],
              [/[\.=]/, "delimiter"],
              ["", "", "@pop"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              ["\\*/", "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, { token: "string.quote", next: "@pop" }],
            ],
            litstring: [
              [/[^"]+/, "string"],
              [/""/, "string.escape"],
              [/"/, { token: "string.quote", next: "@pop" }],
            ],
            litinterpstring: [
              [/[^"{]+/, "string"],
              [/""/, "string.escape"],
              [/{{/, "string.escape"],
              [/}}/, "string.escape"],
              [/{/, { token: "string.quote", next: "root.litinterpstring" }],
              [/"/, { token: "string.quote", next: "@pop" }],
            ],
            interpolatedstring: [
              [/[^\\"{]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/{{/, "string.escape"],
              [/}}/, "string.escape"],
              [/{/, { token: "string.quote", next: "root.interpolatedstring" }],
              [/"/, { token: "string.quote", next: "@pop" }],
            ],
            whitespace: [
              [/^[ \t\v\f]*#((r)|(load))(?=\s)/, "directive.csx"],
              [/^[ \t\v\f]*#\w.*$/, "namespace.cpp"],
              [/[ \t\v\f\r\n]+/, ""],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  _5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: { brackets: [], autoClosingPairs: [], surroundingPairs: [] },
        language: {
          keywords: [],
          typeKeywords: [],
          tokenPostfix: ".csp",
          operators: [],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [/child-src/, "string.quote"],
              [/connect-src/, "string.quote"],
              [/default-src/, "string.quote"],
              [/font-src/, "string.quote"],
              [/frame-src/, "string.quote"],
              [/img-src/, "string.quote"],
              [/manifest-src/, "string.quote"],
              [/media-src/, "string.quote"],
              [/object-src/, "string.quote"],
              [/script-src/, "string.quote"],
              [/style-src/, "string.quote"],
              [/worker-src/, "string.quote"],
              [/base-uri/, "string.quote"],
              [/plugin-types/, "string.quote"],
              [/sandbox/, "string.quote"],
              [/disown-opener/, "string.quote"],
              [/form-action/, "string.quote"],
              [/frame-ancestors/, "string.quote"],
              [/report-uri/, "string.quote"],
              [/report-to/, "string.quote"],
              [/upgrade-insecure-requests/, "string.quote"],
              [/block-all-mixed-content/, "string.quote"],
              [/require-sri-for/, "string.quote"],
              [/reflected-xss/, "string.quote"],
              [/referrer/, "string.quote"],
              [/policy-uri/, "string.quote"],
              [/'self'/, "string.quote"],
              [/'unsafe-inline'/, "string.quote"],
              [/'unsafe-eval'/, "string.quote"],
              [/'strict-dynamic'/, "string.quote"],
              [/'unsafe-hashed-attributes'/, "string.quote"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  v5e = {
    wordPattern: /(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,
    comments: { blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}", notIn: ["string", "comment"] },
      { open: "[", close: "]", notIn: ["string", "comment"] },
      { open: "(", close: ")", notIn: ["string", "comment"] },
      { open: '"', close: '"', notIn: ["string", "comment"] },
      { open: "'", close: "'", notIn: ["string", "comment"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
        end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/"),
      },
    },
  },
  b5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: v5e,
        language: {
          defaultToken: "",
          tokenPostfix: ".css",
          ws: "[ \t\n\r\f]*",
          identifier:
            "-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",
          brackets: [
            { open: "{", close: "}", token: "delimiter.bracket" },
            { open: "[", close: "]", token: "delimiter.bracket" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "<", close: ">", token: "delimiter.angle" },
          ],
          tokenizer: {
            root: [{ include: "@selector" }],
            selector: [
              { include: "@comments" },
              { include: "@import" },
              { include: "@strings" },
              [
                "[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",
                { token: "keyword", next: "@keyframedeclaration" },
              ],
              ["[@](page|content|font-face|-moz-document)", { token: "keyword" }],
              ["[@](charset|namespace)", { token: "keyword", next: "@declarationbody" }],
              [
                "(url-prefix)(\\()",
                ["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }],
              ],
              [
                "(url)(\\()",
                ["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }],
              ],
              { include: "@selectorname" },
              ["[\\*]", "tag"],
              ["[>\\+,]", "delimiter"],
              ["\\[", { token: "delimiter.bracket", next: "@selectorattribute" }],
              ["{", { token: "delimiter.bracket", next: "@selectorbody" }],
            ],
            selectorbody: [
              { include: "@comments" },
              ["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))", "attribute.name", "@rulevalue"],
              ["}", { token: "delimiter.bracket", next: "@pop" }],
            ],
            selectorname: [["(\\.|#(?=[^{])|%|(@identifier)|:)+", "tag"]],
            selectorattribute: [
              { include: "@term" },
              ["]", { token: "delimiter.bracket", next: "@pop" }],
            ],
            term: [
              { include: "@comments" },
              [
                "(url-prefix)(\\()",
                ["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }],
              ],
              [
                "(url)(\\()",
                ["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }],
              ],
              { include: "@functioninvocation" },
              { include: "@numbers" },
              { include: "@name" },
              { include: "@strings" },
              ["([<>=\\+\\-\\*\\/\\^\\|\\~,])", "delimiter"],
              [",", "delimiter"],
            ],
            rulevalue: [
              { include: "@comments" },
              { include: "@strings" },
              { include: "@term" },
              ["!important", "keyword"],
              [";", "delimiter", "@pop"],
              ["(?=})", { token: "", next: "@pop" }],
            ],
            warndebug: [["[@](warn|debug)", { token: "keyword", next: "@declarationbody" }]],
            import: [["[@](import)", { token: "keyword", next: "@declarationbody" }]],
            urldeclaration: [
              { include: "@strings" },
              ["[^)\r\n]+", "string"],
              ["\\)", { token: "delimiter.parenthesis", next: "@pop" }],
            ],
            parenthizedterm: [
              { include: "@term" },
              ["\\)", { token: "delimiter.parenthesis", next: "@pop" }],
            ],
            declarationbody: [
              { include: "@term" },
              [";", "delimiter", "@pop"],
              ["(?=})", { token: "", next: "@pop" }],
            ],
            comments: [
              ["\\/\\*", "comment", "@comment"],
              ["\\/\\/+.*", "comment"],
            ],
            comment: [
              ["\\*\\/", "comment", "@pop"],
              [/[^*/]+/, "comment"],
              [/./, "comment"],
            ],
            name: [["@identifier", "attribute.value"]],
            numbers: [
              [
                "-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",
                { token: "attribute.value.number", next: "@units" },
              ],
              ["#[0-9a-fA-F_]+(?!\\w)", "attribute.value.hex"],
            ],
            units: [
              [
                "(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?",
                "attribute.value.unit",
                "@pop",
              ],
            ],
            keyframedeclaration: [
              ["@identifier", "attribute.value"],
              ["{", { token: "delimiter.bracket", switchTo: "@keyframebody" }],
            ],
            keyframebody: [
              { include: "@term" },
              ["{", { token: "delimiter.bracket", next: "@selectorbody" }],
              ["}", { token: "delimiter.bracket", next: "@pop" }],
            ],
            functioninvocation: [
              ["@identifier\\(", { token: "attribute.value", next: "@functionarguments" }],
            ],
            functionarguments: [
              ["\\$@identifier@ws:", "attribute.name"],
              ["[,]", "delimiter"],
              { include: "@term" },
              ["\\)", { token: "attribute.value", next: "@pop" }],
            ],
            strings: [
              ['~?"', { token: "string", next: "@stringenddoublequote" }],
              ["~?'", { token: "string", next: "@stringendquote" }],
            ],
            stringenddoublequote: [
              ["\\\\.", "string"],
              ['"', { token: "string", next: "@pop" }],
              [/[^\\"]+/, "string"],
              [".", "string"],
            ],
            stringendquote: [
              ["\\\\.", "string"],
              ["'", { token: "string", next: "@pop" }],
              [/[^\\']+/, "string"],
              [".", "string"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  y5e = {
    defaultToken: "",
    tokenPostfix: ".cypher",
    ignoreCase: !0,
    brackets: [
      { open: "{", close: "}", token: "delimiter.curly" },
      { open: "[", close: "]", token: "delimiter.bracket" },
      { open: "(", close: ")", token: "delimiter.parenthesis" },
    ],
    keywords: [
      "ALL",
      "AND",
      "AS",
      "ASC",
      "ASCENDING",
      "BY",
      "CALL",
      "CASE",
      "CONTAINS",
      "CREATE",
      "DELETE",
      "DESC",
      "DESCENDING",
      "DETACH",
      "DISTINCT",
      "ELSE",
      "END",
      "ENDS",
      "EXISTS",
      "IN",
      "IS",
      "LIMIT",
      "MANDATORY",
      "MATCH",
      "MERGE",
      "NOT",
      "ON",
      "ON",
      "OPTIONAL",
      "OR",
      "ORDER",
      "REMOVE",
      "RETURN",
      "SET",
      "SKIP",
      "STARTS",
      "THEN",
      "UNION",
      "UNWIND",
      "WHEN",
      "WHERE",
      "WITH",
      "XOR",
      "YIELD",
    ],
    builtinLiterals: ["true", "TRUE", "false", "FALSE", "null", "NULL"],
    builtinFunctions: [
      "abs",
      "acos",
      "asin",
      "atan",
      "atan2",
      "avg",
      "ceil",
      "coalesce",
      "collect",
      "cos",
      "cot",
      "count",
      "degrees",
      "e",
      "endNode",
      "exists",
      "exp",
      "floor",
      "head",
      "id",
      "keys",
      "labels",
      "last",
      "left",
      "length",
      "log",
      "log10",
      "lTrim",
      "max",
      "min",
      "nodes",
      "percentileCont",
      "percentileDisc",
      "pi",
      "properties",
      "radians",
      "rand",
      "range",
      "relationships",
      "replace",
      "reverse",
      "right",
      "round",
      "rTrim",
      "sign",
      "sin",
      "size",
      "split",
      "sqrt",
      "startNode",
      "stDev",
      "stDevP",
      "substring",
      "sum",
      "tail",
      "tan",
      "timestamp",
      "toBoolean",
      "toFloat",
      "toInteger",
      "toLower",
      "toString",
      "toUpper",
      "trim",
      "type",
    ],
    operators: [
      "+",
      "-",
      "*",
      "/",
      "%",
      "^",
      "=",
      "<>",
      "<",
      ">",
      "<=",
      ">=",
      "->",
      "<-",
      "--\x3e",
      "<--",
    ],
    escapes: /\\(?:[tbnrf\\"'`]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
    digits: /\d+/,
    octaldigits: /[0-7]+/,
    hexdigits: /[0-9a-fA-F]+/,
    tokenizer: {
      root: [[/[{}[\]()]/, "@brackets"], { include: "common" }],
      common: [
        { include: "@whitespace" },
        { include: "@numbers" },
        { include: "@strings" },
        [/:[a-zA-Z_][\w]*/, "type.identifier"],
        [/[a-zA-Z_][\w]*(?=\()/, { cases: { "@builtinFunctions": "predefined.function" } }],
        [
          /[a-zA-Z_$][\w$]*/,
          {
            cases: {
              "@keywords": "keyword",
              "@builtinLiterals": "predefined.literal",
              "@default": "identifier",
            },
          },
        ],
        [/`/, "identifier.escape", "@identifierBacktick"],
        [/[;,.:|]/, "delimiter"],
        [/[<>=%+\-*/^]+/, { cases: { "@operators": "delimiter", "@default": "" } }],
      ],
      numbers: [
        [/-?(@digits)[eE](-?(@digits))?/, "number.float"],
        [/-?(@digits)?\.(@digits)([eE]-?(@digits))?/, "number.float"],
        [/-?0x(@hexdigits)/, "number.hex"],
        [/-?0(@octaldigits)/, "number.octal"],
        [/-?(@digits)/, "number"],
      ],
      strings: [
        [/"([^"\\]|\\.)*$/, "string.invalid"],
        [/'([^'\\]|\\.)*$/, "string.invalid"],
        [/"/, "string", "@stringDouble"],
        [/'/, "string", "@stringSingle"],
      ],
      whitespace: [
        [/[ \t\r\n]+/, "white"],
        [/\/\*/, "comment", "@comment"],
        [/\/\/.*$/, "comment"],
      ],
      comment: [
        [/\/\/.*/, "comment"],
        [/[^/*]+/, "comment"],
        [/\*\//, "comment", "@pop"],
        [/[/*]/, "comment"],
      ],
      stringDouble: [
        [/[^\\"]+/, "string"],
        [/@escapes/, "string"],
        [/\\./, "string.invalid"],
        [/"/, "string", "@pop"],
      ],
      stringSingle: [
        [/[^\\']+/, "string"],
        [/@escapes/, "string"],
        [/\\./, "string.invalid"],
        [/'/, "string", "@pop"],
      ],
      identifierBacktick: [
        [/[^\\`]+/, "identifier.escape"],
        [/@escapes/, "identifier.escape"],
        [/\\./, "identifier.escape.invalid"],
        [/`/, "identifier.escape", "@pop"],
      ],
    },
  },
  x5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "`", close: "`" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "`", close: "`" },
          ],
        },
        language: y5e,
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  w5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "'", close: "'", notIn: ["string", "comment"] },
            { open: '"', close: '"', notIn: ["string"] },
            { open: "`", close: "`", notIn: ["string", "comment"] },
            { open: "/**", close: " */", notIn: ["string"] },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "<", close: ">" },
            { open: "'", close: "'" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "`", close: "`" },
          ],
          folding: { markers: { start: /^\s*\s*#?region\b/, end: /^\s*\s*#?endregion\b/ } },
        },
        language: {
          defaultToken: "invalid",
          tokenPostfix: ".dart",
          keywords: [
            "abstract",
            "dynamic",
            "implements",
            "show",
            "as",
            "else",
            "import",
            "static",
            "assert",
            "enum",
            "in",
            "super",
            "async",
            "export",
            "interface",
            "switch",
            "await",
            "extends",
            "is",
            "sync",
            "break",
            "external",
            "library",
            "this",
            "case",
            "factory",
            "mixin",
            "throw",
            "catch",
            "false",
            "new",
            "true",
            "class",
            "final",
            "null",
            "try",
            "const",
            "finally",
            "on",
            "typedef",
            "continue",
            "for",
            "operator",
            "var",
            "covariant",
            "Function",
            "part",
            "void",
            "default",
            "get",
            "rethrow",
            "while",
            "deferred",
            "hide",
            "return",
            "with",
            "do",
            "if",
            "set",
            "yield",
          ],
          typeKeywords: ["int", "double", "String", "bool"],
          operators: [
            "+",
            "-",
            "*",
            "/",
            "~/",
            "%",
            "++",
            "--",
            "==",
            "!=",
            ">",
            "<",
            ">=",
            "<=",
            "=",
            "-=",
            "/=",
            "%=",
            ">>=",
            "^=",
            "+=",
            "*=",
            "~/=",
            "<<=",
            "&=",
            "!=",
            "||",
            "&&",
            "&",
            "|",
            "^",
            "~",
            "<<",
            ">>",
            "!",
            ">>>",
            "??",
            "?",
            ":",
            "|=",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          digits: /\d+(_+\d+)*/,
          octaldigits: /[0-7]+(_+[0-7]+)*/,
          binarydigits: /[0-1]+(_+[0-1]+)*/,
          hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
          regexpctl: /[(){}\[\]\$\^|\-*+?\.]/,
          regexpesc: /\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,
          tokenizer: {
            root: [[/[{}]/, "delimiter.bracket"], { include: "common" }],
            common: [
              [
                /[a-z_$][\w$]*/,
                {
                  cases: {
                    "@typeKeywords": "type.identifier",
                    "@keywords": "keyword",
                    "@default": "identifier",
                  },
                },
              ],
              [/[A-Z_$][\w\$]*/, "type.identifier"],
              { include: "@whitespace" },
              [
                /\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,
                { token: "regexp", bracket: "@open", next: "@regexp" },
              ],
              [/@[a-zA-Z]+/, "annotation"],
              [/[()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/!(?=([^=]|$))/, "delimiter"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/(@digits)[eE]([\-+]?(@digits))?/, "number.float"],
              [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, "number.float"],
              [/0[xX](@hexdigits)n?/, "number.hex"],
              [/0[oO]?(@octaldigits)n?/, "number.octal"],
              [/0[bB](@binarydigits)n?/, "number.binary"],
              [/(@digits)n?/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/'([^'\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", "@string_double"],
              [/'/, "string", "@string_single"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*\*(?!\/)/, "comment.doc", "@jsdoc"],
              [/\/\*/, "comment", "@comment"],
              [/\/\/\/.*$/, "comment.doc"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            jsdoc: [
              [/[^\/*]+/, "comment.doc"],
              [/\*\//, "comment.doc", "@pop"],
              [/[\/*]/, "comment.doc"],
            ],
            regexp: [
              [
                /(\{)(\d+(?:,\d*)?)(\})/,
                ["regexp.escape.control", "regexp.escape.control", "regexp.escape.control"],
              ],
              [
                /(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,
                ["regexp.escape.control", { token: "regexp.escape.control", next: "@regexrange" }],
              ],
              [/(\()(\?:|\?=|\?!)/, ["regexp.escape.control", "regexp.escape.control"]],
              [/[()]/, "regexp.escape.control"],
              [/@regexpctl/, "regexp.escape.control"],
              [/[^\\\/]/, "regexp"],
              [/@regexpesc/, "regexp.escape"],
              [/\\\./, "regexp.invalid"],
              [
                /(\/)([gimsuy]*)/,
                [{ token: "regexp", bracket: "@close", next: "@pop" }, "keyword.other"],
              ],
            ],
            regexrange: [
              [/-/, "regexp.escape.control"],
              [/\^/, "regexp.invalid"],
              [/@regexpesc/, "regexp.escape"],
              [/[^\]]/, "regexp"],
              [/\]/, { token: "regexp.escape.control", next: "@pop", bracket: "@close" }],
            ],
            string_double: [
              [/[^\\"\$]+/, "string"],
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
              [/\$\w+/, "identifier"],
            ],
            string_single: [
              [/[^\\'\$]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/'/, "string", "@pop"],
              [/\$\w+/, "identifier"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  C5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".dockerfile",
          variable: /\${?[\w]+}?/,
          tokenizer: {
            root: [
              { include: "@whitespace" },
              { include: "@comment" },
              [/(ONBUILD)(\s+)/, ["keyword", ""]],
              [/(ENV)(\s+)([\w]+)/, ["keyword", "", { token: "variable", next: "@arguments" }]],
              [
                /(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/,
                { token: "keyword", next: "@arguments" },
              ],
            ],
            arguments: [
              { include: "@whitespace" },
              { include: "@strings" },
              [
                /(@variable)/,
                {
                  cases: { "@eos": { token: "variable", next: "@popall" }, "@default": "variable" },
                },
              ],
              [/\\/, { cases: { "@eos": "", "@default": "" } }],
              [/./, { cases: { "@eos": { token: "", next: "@popall" }, "@default": "" } }],
            ],
            whitespace: [
              [/\s+/, { cases: { "@eos": { token: "", next: "@popall" }, "@default": "" } }],
            ],
            comment: [[/(^#.*$)/, "comment", "@popall"]],
            strings: [
              [/\\'$/, "", "@popall"],
              [/\\'/, ""],
              [/'$/, "string", "@popall"],
              [/'/, "string", "@stringBody"],
              [/"$/, "string", "@popall"],
              [/"/, "string", "@dblStringBody"],
            ],
            stringBody: [
              [
                /[^\\\$']/,
                { cases: { "@eos": { token: "string", next: "@popall" }, "@default": "string" } },
              ],
              [/\\./, "string.escape"],
              [/'$/, "string", "@popall"],
              [/'/, "string", "@pop"],
              [/(@variable)/, "variable"],
              [/\\$/, "string"],
              [/$/, "string", "@popall"],
            ],
            dblStringBody: [
              [
                /[^\\\$"]/,
                { cases: { "@eos": { token: "string", next: "@popall" }, "@default": "string" } },
              ],
              [/\\./, "string.escape"],
              [/"$/, "string", "@popall"],
              [/"/, "string", "@pop"],
              [/(@variable)/, "variable"],
              [/\\$/, "string"],
              [/$/, "string", "@popall"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  S5e = {
    defaultToken: "",
    tokenPostfix: ".ecl",
    ignoreCase: !0,
    brackets: [
      { open: "{", close: "}", token: "delimiter.curly" },
      { open: "[", close: "]", token: "delimiter.square" },
      { open: "(", close: ")", token: "delimiter.parenthesis" },
      { open: "<", close: ">", token: "delimiter.angle" },
    ],
    pounds: [
      "append",
      "break",
      "declare",
      "demangle",
      "end",
      "for",
      "getdatatype",
      "if",
      "inmodule",
      "loop",
      "mangle",
      "onwarning",
      "option",
      "set",
      "stored",
      "uniquename",
    ].join("|"),
    keywords: [
      "__compressed__",
      "after",
      "all",
      "and",
      "any",
      "as",
      "atmost",
      "before",
      "beginc",
      "best",
      "between",
      "case",
      "cluster",
      "compressed",
      "compression",
      "const",
      "counter",
      "csv",
      "default",
      "descend",
      "embed",
      "encoding",
      "encrypt",
      "end",
      "endc",
      "endembed",
      "endmacro",
      "enum",
      "escape",
      "except",
      "exclusive",
      "expire",
      "export",
      "extend",
      "fail",
      "few",
      "fileposition",
      "first",
      "flat",
      "forward",
      "from",
      "full",
      "function",
      "functionmacro",
      "group",
      "grouped",
      "heading",
      "hole",
      "ifblock",
      "import",
      "in",
      "inner",
      "interface",
      "internal",
      "joined",
      "keep",
      "keyed",
      "last",
      "left",
      "limit",
      "linkcounted",
      "literal",
      "little_endian",
      "load",
      "local",
      "locale",
      "lookup",
      "lzw",
      "macro",
      "many",
      "maxcount",
      "maxlength",
      "min skew",
      "module",
      "mofn",
      "multiple",
      "named",
      "namespace",
      "nocase",
      "noroot",
      "noscan",
      "nosort",
      "not",
      "noxpath",
      "of",
      "onfail",
      "only",
      "opt",
      "or",
      "outer",
      "overwrite",
      "packed",
      "partition",
      "penalty",
      "physicallength",
      "pipe",
      "prefetch",
      "quote",
      "record",
      "repeat",
      "retry",
      "return",
      "right",
      "right1",
      "right2",
      "rows",
      "rowset",
      "scan",
      "scope",
      "self",
      "separator",
      "service",
      "shared",
      "skew",
      "skip",
      "smart",
      "soapaction",
      "sql",
      "stable",
      "store",
      "terminator",
      "thor",
      "threshold",
      "timelimit",
      "timeout",
      "token",
      "transform",
      "trim",
      "type",
      "unicodeorder",
      "unordered",
      "unsorted",
      "unstable",
      "update",
      "use",
      "validate",
      "virtual",
      "whole",
      "width",
      "wild",
      "within",
      "wnotrim",
      "xml",
      "xpath",
    ],
    functions: [
      "abs",
      "acos",
      "aggregate",
      "allnodes",
      "apply",
      "ascii",
      "asin",
      "assert",
      "asstring",
      "atan",
      "atan2",
      "ave",
      "build",
      "buildindex",
      "case",
      "catch",
      "choose",
      "choosen",
      "choosesets",
      "clustersize",
      "combine",
      "correlation",
      "cos",
      "cosh",
      "count",
      "covariance",
      "cron",
      "dataset",
      "dedup",
      "define",
      "denormalize",
      "dictionary",
      "distribute",
      "distributed",
      "distribution",
      "ebcdic",
      "enth",
      "error",
      "evaluate",
      "event",
      "eventextra",
      "eventname",
      "exists",
      "exp",
      "fail",
      "failcode",
      "failmessage",
      "fetch",
      "fromunicode",
      "fromxml",
      "getenv",
      "getisvalid",
      "global",
      "graph",
      "group",
      "hash",
      "hash32",
      "hash64",
      "hashcrc",
      "hashmd5",
      "having",
      "httpcall",
      "httpheader",
      "if",
      "iff",
      "index",
      "intformat",
      "isvalid",
      "iterate",
      "join",
      "keydiff",
      "keypatch",
      "keyunicode",
      "length",
      "library",
      "limit",
      "ln",
      "loadxml",
      "local",
      "log",
      "loop",
      "map",
      "matched",
      "matchlength",
      "matchposition",
      "matchtext",
      "matchunicode",
      "max",
      "merge",
      "mergejoin",
      "min",
      "nofold",
      "nolocal",
      "nonempty",
      "normalize",
      "nothor",
      "notify",
      "output",
      "parallel",
      "parse",
      "pipe",
      "power",
      "preload",
      "process",
      "project",
      "pull",
      "random",
      "range",
      "rank",
      "ranked",
      "realformat",
      "recordof",
      "regexfind",
      "regexreplace",
      "regroup",
      "rejected",
      "rollup",
      "round",
      "roundup",
      "row",
      "rowdiff",
      "sample",
      "sequential",
      "set",
      "sin",
      "sinh",
      "sizeof",
      "soapcall",
      "sort",
      "sorted",
      "sqrt",
      "stepped",
      "stored",
      "sum",
      "table",
      "tan",
      "tanh",
      "thisnode",
      "topn",
      "tounicode",
      "toxml",
      "transfer",
      "transform",
      "trim",
      "truncate",
      "typeof",
      "ungroup",
      "unicodeorder",
      "variance",
      "wait",
      "which",
      "workunit",
      "xmldecode",
      "xmlencode",
      "xmltext",
      "xmlunicode",
    ],
    typesint: ["integer", "unsigned"].join("|"),
    typesnum: ["data", "qstring", "string", "unicode", "utf8", "varstring", "varunicode"],
    typesone: [
      "ascii",
      "big_endian",
      "boolean",
      "data",
      "decimal",
      "ebcdic",
      "grouped",
      "integer",
      "linkcounted",
      "pattern",
      "qstring",
      "real",
      "record",
      "rule",
      "set of",
      "streamed",
      "string",
      "token",
      "udecimal",
      "unicode",
      "unsigned",
      "utf8",
      "varstring",
      "varunicode",
    ].join("|"),
    operators: ["+", "-", "/", ":=", "<", "<>", "=", ">", "\\", "and", "in", "not", "or"],
    symbols: /[=><!~?:&|+\-*\/\^%]+/,
    escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
    tokenizer: {
      root: [
        [/@typesint[4|8]/, "type"],
        [/#(@pounds)/, "type"],
        [/@typesone/, "type"],
        [
          /[a-zA-Z_$][\w-$]*/,
          {
            cases: {
              "@functions": "keyword.function",
              "@keywords": "keyword",
              "@operators": "operator",
            },
          },
        ],
        { include: "@whitespace" },
        [/[{}()\[\]]/, "@brackets"],
        [/[<>](?!@symbols)/, "@brackets"],
        [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
        [/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?/, "number.float"],
        [/0[xX][0-9a-fA-F_]+/, "number.hex"],
        [/0[bB][01]+/, "number.hex"],
        [/[0-9_]+/, "number"],
        [/[;,.]/, "delimiter"],
        [/"([^"\\]|\\.)*$/, "string.invalid"],
        [/"/, "string", "@string"],
        [/'[^\\']'/, "string"],
        [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
        [/'/, "string.invalid"],
      ],
      whitespace: [
        [/[ \t\v\f\r\n]+/, ""],
        [/\/\*/, "comment", "@comment"],
        [/\/\/.*$/, "comment"],
      ],
      comment: [
        [/[^\/*]+/, "comment"],
        [/\*\//, "comment", "@pop"],
        [/[\/*]/, "comment"],
      ],
      string: [
        [/[^\\']+/, "string"],
        [/@escapes/, "string.escape"],
        [/\\./, "string.escape.invalid"],
        [/'/, "string", "@pop"],
      ],
    },
  },
  k5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "'", close: "'", notIn: ["string", "comment"] },
            { open: '"', close: '"', notIn: ["string", "comment"] },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "<", close: ">" },
            { open: "'", close: "'" },
            { open: '"', close: '"' },
          ],
        },
        language: S5e,
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  E5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "#" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "'", close: "'" },
            { open: '"', close: '"' },
          ],
          autoClosingPairs: [
            { open: "'", close: "'", notIn: ["string", "comment"] },
            { open: '"', close: '"', notIn: ["comment"] },
            { open: '"""', close: '"""' },
            { open: "`", close: "`", notIn: ["string", "comment"] },
            { open: "(", close: ")" },
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "<<", close: ">>" },
          ],
          indentationRules: {
            increaseIndentPattern:
              /^\s*(after|else|catch|rescue|fn|[^#]*(do|<\-|\->|\{|\[|\=))\s*$/,
            decreaseIndentPattern: /^\s*((\}|\])\s*$|(after|else|catch|rescue|end)\b)/,
          },
        },
        language: {
          defaultToken: "source",
          tokenPostfix: ".elixir",
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "<<", close: ">>", token: "delimiter.angle.special" },
          ],
          declarationKeywords: [
            "def",
            "defp",
            "defn",
            "defnp",
            "defguard",
            "defguardp",
            "defmacro",
            "defmacrop",
            "defdelegate",
            "defcallback",
            "defmacrocallback",
            "defmodule",
            "defprotocol",
            "defexception",
            "defimpl",
            "defstruct",
          ],
          operatorKeywords: ["and", "in", "not", "or", "when"],
          namespaceKeywords: ["alias", "import", "require", "use"],
          otherKeywords: [
            "after",
            "case",
            "catch",
            "cond",
            "do",
            "else",
            "end",
            "fn",
            "for",
            "if",
            "quote",
            "raise",
            "receive",
            "rescue",
            "super",
            "throw",
            "try",
            "unless",
            "unquote_splicing",
            "unquote",
            "with",
          ],
          constants: ["true", "false", "nil"],
          nameBuiltin: ["__MODULE__", "__DIR__", "__ENV__", "__CALLER__", "__STACKTRACE__"],
          operator:
            /-[->]?|!={0,2}|\*{1,2}|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,
          variableName: /[a-z_][a-zA-Z0-9_]*[?!]?/,
          atomName: /[a-zA-Z_][a-zA-Z0-9_@]*[?!]?|@specialAtomName|@operator/,
          specialAtomName: /\.\.\.|<<>>|%\{\}|%|\{\}/,
          aliasPart: /[A-Z][a-zA-Z0-9_]*/,
          moduleName: /@aliasPart(?:\.@aliasPart)*/,
          sigilSymmetricDelimiter: /"""|'''|"|'|\/|\|/,
          sigilStartDelimiter: /@sigilSymmetricDelimiter|<|\{|\[|\(/,
          sigilEndDelimiter: /@sigilSymmetricDelimiter|>|\}|\]|\)/,
          sigilModifiers: /[a-zA-Z0-9]*/,
          decimal: /\d(?:_?\d)*/,
          hex: /[0-9a-fA-F](_?[0-9a-fA-F])*/,
          octal: /[0-7](_?[0-7])*/,
          binary: /[01](_?[01])*/,
          escape: /\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2}|\\./,
          tokenizer: {
            root: [
              { include: "@whitespace" },
              { include: "@comments" },
              { include: "@keywordsShorthand" },
              { include: "@numbers" },
              { include: "@identifiers" },
              { include: "@strings" },
              { include: "@atoms" },
              { include: "@sigils" },
              { include: "@attributes" },
              { include: "@symbols" },
            ],
            whitespace: [[/\s+/, "white"]],
            comments: [[/(#)(.*)/, ["comment.punctuation", "comment"]]],
            keywordsShorthand: [
              [/(@atomName)(:)(\s+)/, ["constant", "constant.punctuation", "white"]],
              [
                /"(?=([^"]|#\{.*?\}|\\")*":)/,
                { token: "constant.delimiter", next: "@doubleQuotedStringKeyword" },
              ],
              [
                /'(?=([^']|#\{.*?\}|\\')*':)/,
                { token: "constant.delimiter", next: "@singleQuotedStringKeyword" },
              ],
            ],
            doubleQuotedStringKeyword: [
              [/":/, { token: "constant.delimiter", next: "@pop" }],
              { include: "@stringConstantContentInterpol" },
            ],
            singleQuotedStringKeyword: [
              [/':/, { token: "constant.delimiter", next: "@pop" }],
              { include: "@stringConstantContentInterpol" },
            ],
            numbers: [
              [/0b@binary/, "number.binary"],
              [/0o@octal/, "number.octal"],
              [/0x@hex/, "number.hex"],
              [/@decimal\.@decimal([eE]-?@decimal)?/, "number.float"],
              [/@decimal/, "number"],
            ],
            identifiers: [
              [
                /\b(defp?|defnp?|defmacrop?|defguardp?|defdelegate)(\s+)(@variableName)(?!\s+@operator)/,
                [
                  "keyword.declaration",
                  "white",
                  { cases: { unquote: "keyword", "@default": "function" } },
                ],
              ],
              [
                /(@variableName)(?=\s*\.?\s*\()/,
                {
                  cases: {
                    "@declarationKeywords": "keyword.declaration",
                    "@namespaceKeywords": "keyword",
                    "@otherKeywords": "keyword",
                    "@default": "function.call",
                  },
                },
              ],
              [
                /(@moduleName)(\s*)(\.)(\s*)(@variableName)/,
                ["type.identifier", "white", "operator", "white", "function.call"],
              ],
              [
                /(:)(@atomName)(\s*)(\.)(\s*)(@variableName)/,
                ["constant.punctuation", "constant", "white", "operator", "white", "function.call"],
              ],
              [
                /(\|>)(\s*)(@variableName)/,
                [
                  "operator",
                  "white",
                  { cases: { "@otherKeywords": "keyword", "@default": "function.call" } },
                ],
              ],
              [/(&)(\s*)(@variableName)/, ["operator", "white", "function.call"]],
              [
                /@variableName/,
                {
                  cases: {
                    "@declarationKeywords": "keyword.declaration",
                    "@operatorKeywords": "keyword.operator",
                    "@namespaceKeywords": "keyword",
                    "@otherKeywords": "keyword",
                    "@constants": "constant.language",
                    "@nameBuiltin": "variable.language",
                    "_.*": "comment.unused",
                    "@default": "identifier",
                  },
                },
              ],
              [/@moduleName/, "type.identifier"],
            ],
            strings: [
              [/"""/, { token: "string.delimiter", next: "@doubleQuotedHeredoc" }],
              [/'''/, { token: "string.delimiter", next: "@singleQuotedHeredoc" }],
              [/"/, { token: "string.delimiter", next: "@doubleQuotedString" }],
              [/'/, { token: "string.delimiter", next: "@singleQuotedString" }],
            ],
            doubleQuotedHeredoc: [
              [/"""/, { token: "string.delimiter", next: "@pop" }],
              { include: "@stringContentInterpol" },
            ],
            singleQuotedHeredoc: [
              [/'''/, { token: "string.delimiter", next: "@pop" }],
              { include: "@stringContentInterpol" },
            ],
            doubleQuotedString: [
              [/"/, { token: "string.delimiter", next: "@pop" }],
              { include: "@stringContentInterpol" },
            ],
            singleQuotedString: [
              [/'/, { token: "string.delimiter", next: "@pop" }],
              { include: "@stringContentInterpol" },
            ],
            atoms: [
              [/(:)(@atomName)/, ["constant.punctuation", "constant"]],
              [/:"/, { token: "constant.delimiter", next: "@doubleQuotedStringAtom" }],
              [/:'/, { token: "constant.delimiter", next: "@singleQuotedStringAtom" }],
            ],
            doubleQuotedStringAtom: [
              [/"/, { token: "constant.delimiter", next: "@pop" }],
              { include: "@stringConstantContentInterpol" },
            ],
            singleQuotedStringAtom: [
              [/'/, { token: "constant.delimiter", next: "@pop" }],
              { include: "@stringConstantContentInterpol" },
            ],
            sigils: [
              [/~[a-z]@sigilStartDelimiter/, { token: "@rematch", next: "@sigil.interpol" }],
              [/~([A-Z]+)@sigilStartDelimiter/, { token: "@rematch", next: "@sigil.noInterpol" }],
            ],
            sigil: [
              [/~([a-z]|[A-Z]+)\{/, { token: "@rematch", switchTo: "@sigilStart.$S2.$1.{.}" }],
              [/~([a-z]|[A-Z]+)\[/, { token: "@rematch", switchTo: "@sigilStart.$S2.$1.[.]" }],
              [/~([a-z]|[A-Z]+)\(/, { token: "@rematch", switchTo: "@sigilStart.$S2.$1.(.)" }],
              [/~([a-z]|[A-Z]+)\</, { token: "@rematch", switchTo: "@sigilStart.$S2.$1.<.>" }],
              [
                /~([a-z]|[A-Z]+)(@sigilSymmetricDelimiter)/,
                { token: "@rematch", switchTo: "@sigilStart.$S2.$1.$2.$2" },
              ],
            ],
            "sigilStart.interpol.s": [
              [
                /~s@sigilStartDelimiter/,
                { token: "string.delimiter", switchTo: "@sigilContinue.$S2.$S3.$S4.$S5" },
              ],
            ],
            "sigilContinue.interpol.s": [
              [
                /(@sigilEndDelimiter)@sigilModifiers/,
                {
                  cases: {
                    "$1==$S5": { token: "string.delimiter", next: "@pop" },
                    "@default": "string",
                  },
                },
              ],
              { include: "@stringContentInterpol" },
            ],
            "sigilStart.noInterpol.S": [
              [
                /~S@sigilStartDelimiter/,
                { token: "string.delimiter", switchTo: "@sigilContinue.$S2.$S3.$S4.$S5" },
              ],
            ],
            "sigilContinue.noInterpol.S": [
              [/(^|[^\\])\\@sigilEndDelimiter/, "string"],
              [
                /(@sigilEndDelimiter)@sigilModifiers/,
                {
                  cases: {
                    "$1==$S5": { token: "string.delimiter", next: "@pop" },
                    "@default": "string",
                  },
                },
              ],
              { include: "@stringContent" },
            ],
            "sigilStart.interpol.r": [
              [
                /~r@sigilStartDelimiter/,
                { token: "regexp.delimiter", switchTo: "@sigilContinue.$S2.$S3.$S4.$S5" },
              ],
            ],
            "sigilContinue.interpol.r": [
              [
                /(@sigilEndDelimiter)@sigilModifiers/,
                {
                  cases: {
                    "$1==$S5": { token: "regexp.delimiter", next: "@pop" },
                    "@default": "regexp",
                  },
                },
              ],
              { include: "@regexpContentInterpol" },
            ],
            "sigilStart.noInterpol.R": [
              [
                /~R@sigilStartDelimiter/,
                { token: "regexp.delimiter", switchTo: "@sigilContinue.$S2.$S3.$S4.$S5" },
              ],
            ],
            "sigilContinue.noInterpol.R": [
              [/(^|[^\\])\\@sigilEndDelimiter/, "regexp"],
              [
                /(@sigilEndDelimiter)@sigilModifiers/,
                {
                  cases: {
                    "$1==$S5": { token: "regexp.delimiter", next: "@pop" },
                    "@default": "regexp",
                  },
                },
              ],
              { include: "@regexpContent" },
            ],
            "sigilStart.interpol": [
              [
                /~([a-z]|[A-Z]+)@sigilStartDelimiter/,
                { token: "sigil.delimiter", switchTo: "@sigilContinue.$S2.$S3.$S4.$S5" },
              ],
            ],
            "sigilContinue.interpol": [
              [
                /(@sigilEndDelimiter)@sigilModifiers/,
                {
                  cases: {
                    "$1==$S5": { token: "sigil.delimiter", next: "@pop" },
                    "@default": "sigil",
                  },
                },
              ],
              { include: "@sigilContentInterpol" },
            ],
            "sigilStart.noInterpol": [
              [
                /~([a-z]|[A-Z]+)@sigilStartDelimiter/,
                { token: "sigil.delimiter", switchTo: "@sigilContinue.$S2.$S3.$S4.$S5" },
              ],
            ],
            "sigilContinue.noInterpol": [
              [/(^|[^\\])\\@sigilEndDelimiter/, "sigil"],
              [
                /(@sigilEndDelimiter)@sigilModifiers/,
                {
                  cases: {
                    "$1==$S5": { token: "sigil.delimiter", next: "@pop" },
                    "@default": "sigil",
                  },
                },
              ],
              { include: "@sigilContent" },
            ],
            attributes: [
              [
                /\@(module|type)?doc (~[sS])?"""/,
                { token: "comment.block.documentation", next: "@doubleQuotedHeredocDocstring" },
              ],
              [
                /\@(module|type)?doc (~[sS])?'''/,
                { token: "comment.block.documentation", next: "@singleQuotedHeredocDocstring" },
              ],
              [
                /\@(module|type)?doc (~[sS])?"/,
                { token: "comment.block.documentation", next: "@doubleQuotedStringDocstring" },
              ],
              [
                /\@(module|type)?doc (~[sS])?'/,
                { token: "comment.block.documentation", next: "@singleQuotedStringDocstring" },
              ],
              [/\@(module|type)?doc false/, "comment.block.documentation"],
              [/\@(@variableName)/, "variable"],
            ],
            doubleQuotedHeredocDocstring: [
              [/"""/, { token: "comment.block.documentation", next: "@pop" }],
              { include: "@docstringContent" },
            ],
            singleQuotedHeredocDocstring: [
              [/'''/, { token: "comment.block.documentation", next: "@pop" }],
              { include: "@docstringContent" },
            ],
            doubleQuotedStringDocstring: [
              [/"/, { token: "comment.block.documentation", next: "@pop" }],
              { include: "@docstringContent" },
            ],
            singleQuotedStringDocstring: [
              [/'/, { token: "comment.block.documentation", next: "@pop" }],
              { include: "@docstringContent" },
            ],
            symbols: [
              [/\?(\\.|[^\\\s])/, "number.constant"],
              [/&\d+/, "operator"],
              [/<<<|>>>/, "operator"],
              [/[()\[\]\{\}]|<<|>>/, "@brackets"],
              [/\.\.\./, "identifier"],
              [/=>/, "punctuation"],
              [/@operator/, "operator"],
              [/[:;,.%]/, "punctuation"],
            ],
            stringContentInterpol: [
              { include: "@interpolation" },
              { include: "@escapeChar" },
              { include: "@stringContent" },
            ],
            stringContent: [[/./, "string"]],
            stringConstantContentInterpol: [
              { include: "@interpolation" },
              { include: "@escapeChar" },
              { include: "@stringConstantContent" },
            ],
            stringConstantContent: [[/./, "constant"]],
            regexpContentInterpol: [
              { include: "@interpolation" },
              { include: "@escapeChar" },
              { include: "@regexpContent" },
            ],
            regexpContent: [
              [/(\s)(#)(\s.*)$/, ["white", "comment.punctuation", "comment"]],
              [/./, "regexp"],
            ],
            sigilContentInterpol: [
              { include: "@interpolation" },
              { include: "@escapeChar" },
              { include: "@sigilContent" },
            ],
            sigilContent: [[/./, "sigil"]],
            docstringContent: [[/./, "comment.block.documentation"]],
            escapeChar: [[/@escape/, "constant.character.escape"]],
            interpolation: [
              [/#{/, { token: "delimiter.bracket.embed", next: "@interpolationContinue" }],
            ],
            interpolationContinue: [
              [/}/, { token: "delimiter.bracket.embed", next: "@pop" }],
              { include: "@root" },
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  N5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { blockComment: ["/*", "*/"], lineComment: "//" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}", notIn: ["string"] },
            { open: "[", close: "]", notIn: ["string"] },
            { open: "(", close: ")", notIn: ["string"] },
            { open: '"', close: '"', notIn: ["string"] },
            { open: "'", close: "'", notIn: ["string"] },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "<", close: ">" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".flow",
          keywords: [
            "import",
            "require",
            "export",
            "forbid",
            "native",
            "if",
            "else",
            "cast",
            "unsafe",
            "switch",
            "default",
          ],
          types: [
            "io",
            "mutable",
            "bool",
            "int",
            "double",
            "string",
            "flow",
            "void",
            "ref",
            "true",
            "false",
            "with",
          ],
          operators: [
            "=",
            ">",
            "<",
            "<=",
            ">=",
            "==",
            "!",
            "!=",
            ":=",
            "::=",
            "&&",
            "||",
            "+",
            "-",
            "*",
            "/",
            "@",
            "&",
            "%",
            ":",
            "->",
            "\\",
            "$",
            "??",
            "^",
          ],
          symbols: /[@$=><!~?:&|+\-*\\\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_]\w*/,
                { cases: { "@keywords": "keyword", "@types": "type", "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "delimiter"],
              [/[<>](?!@symbols)/, "delimiter"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [
                /((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)/,
                "number",
              ],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", "@string"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  L5e = {
    comments: { lineComment: "//", blockComment: ["(*", "*)"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"),
        end: new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)"),
      },
    },
  },
  D5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: L5e,
        language: {
          defaultToken: "",
          tokenPostfix: ".fs",
          keywords: [
            "abstract",
            "and",
            "atomic",
            "as",
            "assert",
            "asr",
            "base",
            "begin",
            "break",
            "checked",
            "component",
            "const",
            "constraint",
            "constructor",
            "continue",
            "class",
            "default",
            "delegate",
            "do",
            "done",
            "downcast",
            "downto",
            "elif",
            "else",
            "end",
            "exception",
            "eager",
            "event",
            "external",
            "extern",
            "false",
            "finally",
            "for",
            "fun",
            "function",
            "fixed",
            "functor",
            "global",
            "if",
            "in",
            "include",
            "inherit",
            "inline",
            "interface",
            "internal",
            "land",
            "lor",
            "lsl",
            "lsr",
            "lxor",
            "lazy",
            "let",
            "match",
            "member",
            "mod",
            "module",
            "mutable",
            "namespace",
            "method",
            "mixin",
            "new",
            "not",
            "null",
            "of",
            "open",
            "or",
            "object",
            "override",
            "private",
            "parallel",
            "process",
            "protected",
            "pure",
            "public",
            "rec",
            "return",
            "static",
            "sealed",
            "struct",
            "sig",
            "then",
            "to",
            "true",
            "tailcall",
            "trait",
            "try",
            "type",
            "upcast",
            "use",
            "val",
            "void",
            "virtual",
            "volatile",
            "when",
            "while",
            "with",
            "yield",
          ],
          symbols: /[=><!~?:&|+\-*\^%;\.,\/]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          integersuffix: /[uU]?[yslnLI]?/,
          floatsuffix: /[fFmM]?/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_]\w*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/\[<.*>\]/, "annotation"],
              [/^#(if|else|endif)/, "keyword"],
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, "delimiter"],
              [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/0x[0-9a-fA-F]+LF/, "number.float"],
              [/0x[0-9a-fA-F]+(@integersuffix)/, "number.hex"],
              [/0b[0-1]+(@integersuffix)/, "number.bin"],
              [/\d+(@integersuffix)/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"""/, "string", '@string."""'],
              [/"/, "string", '@string."'],
              [/\@"/, { token: "string.quote", next: "@litstring" }],
              [/'[^\\']'B?/, "string"],
              [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
              [/'/, "string.invalid"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\(\*(?!\))/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^*(]+/, "comment"],
              [/\*\)/, "comment", "@pop"],
              [/\*/, "comment"],
              [/\(\*\)/, "comment"],
              [/\(/, "comment"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [
                /("""|"B?)/,
                { cases: { "$#==$S2": { token: "string", next: "@pop" }, "@default": "string" } },
              ],
            ],
            litstring: [
              [/[^"]+/, "string"],
              [/""/, "string.escape"],
              [/"/, { token: "string.quote", next: "@pop" }],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  T5e = [
    "assign",
    "flush",
    "ftl",
    "return",
    "global",
    "import",
    "include",
    "break",
    "continue",
    "local",
    "nested",
    "nt",
    "setting",
    "stop",
    "t",
    "lt",
    "rt",
    "fallback",
  ],
  I5e = [
    "attempt",
    "autoesc",
    "autoEsc",
    "compress",
    "comment",
    "escape",
    "noescape",
    "function",
    "if",
    "list",
    "items",
    "sep",
    "macro",
    "noparse",
    "noParse",
    "noautoesc",
    "noAutoEsc",
    "outputformat",
    "switch",
    "visit",
    "recurse",
  ],
  R5e = { close: ">", id: "angle", open: "<" },
  O5e = { close: "\\]", id: "bracket", open: "\\[" },
  M5e = { close: "[>\\]]", id: "auto", open: "[<\\[]" },
  A5e = { close: "\\}", id: "dollar", open1: "\\$", open2: "\\{" },
  P5e = { close: "\\]", id: "bracket", open1: "\\[", open2: "=" };
function j5e(e) {
  return {
    brackets: [
      ["<", ">"],
      ["[", "]"],
      ["(", ")"],
      ["{", "}"],
    ],
    comments: { blockComment: [`${e.open}--`, `--${e.close}`] },
    autoCloseBefore: "\n\r\t }]),.:;=",
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"', notIn: ["string"] },
      { open: "'", close: "'", notIn: ["string"] },
    ],
    surroundingPairs: [
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">" },
    ],
    folding: {
      markers: {
        start: new RegExp(
          `${e.open}#(?:${I5e.join("|")})([^/${e.close}]*(?!/)${e.close})[^${e.open}]*$`,
        ),
        end: new RegExp(`${e.open}/#(?:${I5e.join("|")})[\\r\\n\\t ]*>`),
      },
    },
    onEnterRules: [
      {
        beforeText: new RegExp(
          `${e.open}#(?!(?:${T5e.join("|")}))([a-zA-Z_]+)([^/${e.close}]*(?!/)${e.close})[^${e.open}]*$`,
        ),
        afterText: new RegExp(`^${e.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${e.close}$`),
        action: { indentAction: VGe.IndentAction.IndentOutdent },
      },
      {
        beforeText: new RegExp(
          `${e.open}#(?!(?:${T5e.join("|")}))([a-zA-Z_]+)([^/${e.close}]*(?!/)${e.close})[^${e.open}]*$`,
        ),
        action: { indentAction: VGe.IndentAction.Indent },
      },
    ],
  };
}
function F5e() {
  return {
    brackets: [
      ["<", ">"],
      ["[", "]"],
      ["(", ")"],
      ["{", "}"],
    ],
    autoCloseBefore: "\n\r\t }]),.:;=",
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"', notIn: ["string"] },
      { open: "'", close: "'", notIn: ["string"] },
    ],
    surroundingPairs: [
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">" },
    ],
    folding: {
      markers: {
        start: new RegExp(`[<\\[]#(?:${I5e.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),
        end: new RegExp(`[<\\[]/#(?:${I5e.join("|")})[\\r\\n\\t ]*>`),
      },
    },
    onEnterRules: [
      {
        beforeText: new RegExp(
          `[<\\[]#(?!(?:${T5e.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`,
        ),
        afterText: new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),
        action: { indentAction: VGe.IndentAction.IndentOutdent },
      },
      {
        beforeText: new RegExp(
          `[<\\[]#(?!(?:${T5e.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`,
        ),
        action: { indentAction: VGe.IndentAction.Indent },
      },
    ],
  };
}
function B5e(e, t) {
  const n = `_${e.id}_${t.id}`,
    i = (e) => e.replace(/__id__/g, n),
    r = (e) => {
      const t = e.source.replace(/__id__/g, n);
      return new RegExp(t, e.flags);
    };
  return {
    unicode: !0,
    includeLF: !1,
    start: i("default__id__"),
    ignoreCase: !1,
    defaultToken: "invalid",
    tokenPostfix: ".freemarker2",
    brackets: [
      { open: "{", close: "}", token: "delimiter.curly" },
      { open: "[", close: "]", token: "delimiter.square" },
      { open: "(", close: ")", token: "delimiter.parenthesis" },
      { open: "<", close: ">", token: "delimiter.angle" },
    ],
    [i("open__id__")]: new RegExp(e.open),
    [i("close__id__")]: new RegExp(e.close),
    [i("iOpen1__id__")]: new RegExp(t.open1),
    [i("iOpen2__id__")]: new RegExp(t.open2),
    [i("iClose__id__")]: new RegExp(t.close),
    [i("startTag__id__")]: r(/(@open__id__)(#)/),
    [i("endTag__id__")]: r(/(@open__id__)(\/#)/),
    [i("startOrEndTag__id__")]: r(/(@open__id__)(\/?#)/),
    [i("closeTag1__id__")]: r(/((?:@blank)*)(@close__id__)/),
    [i("closeTag2__id__")]: r(/((?:@blank)*\/?)(@close__id__)/),
    blank: /[ \t\n\r]/,
    keywords: ["false", "true", "in", "as", "using"],
    directiveStartCloseTag1:
      /attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,
    directiveStartCloseTag2:
      /else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,
    directiveStartBlank:
      /if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,
    directiveEndCloseTag1:
      /if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,
    escapedChar: /\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,
    asciiDigit: /[0-9]/,
    integer: /[0-9]+/,
    nonEscapedIdStartChar:
      /[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
    escapedIdChar: /\\[\-\.:#]/,
    idStartChar: /(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,
    id: /(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,
    specialHashKeys: /\*\*|\*|false|true|in|as|using/,
    namedSymbols:
      /&lt;=|&gt;=|\\lte|\\lt|&lt;|\\gte|\\gt|&gt;|&amp;&amp;|\\and|-&gt;|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,
    arrows: ["->", "-&gt;"],
    delimiters: [";", ":", ",", "."],
    stringOperators: ["lte", "lt", "gte", "gt"],
    noParseTags: ["noparse", "noParse", "comment"],
    tokenizer: {
      [i("default__id__")]: [
        { include: i("@directive_token__id__") },
        { include: i("@interpolation_and_text_token__id__") },
      ],
      [i("fmExpression__id__.directive")]: [
        { include: i("@blank_and_expression_comment_token__id__") },
        { include: i("@directive_end_token__id__") },
        { include: i("@expression_token__id__") },
      ],
      [i("fmExpression__id__.interpolation")]: [
        { include: i("@blank_and_expression_comment_token__id__") },
        { include: i("@expression_token__id__") },
        { include: i("@greater_operators_token__id__") },
      ],
      [i("inParen__id__.plain")]: [
        { include: i("@blank_and_expression_comment_token__id__") },
        { include: i("@directive_end_token__id__") },
        { include: i("@expression_token__id__") },
      ],
      [i("inParen__id__.gt")]: [
        { include: i("@blank_and_expression_comment_token__id__") },
        { include: i("@expression_token__id__") },
        { include: i("@greater_operators_token__id__") },
      ],
      [i("noSpaceExpression__id__")]: [
        { include: i("@no_space_expression_end_token__id__") },
        { include: i("@directive_end_token__id__") },
        { include: i("@expression_token__id__") },
      ],
      [i("unifiedCall__id__")]: [{ include: i("@unified_call_token__id__") }],
      [i("singleString__id__")]: [{ include: i("@string_single_token__id__") }],
      [i("doubleString__id__")]: [{ include: i("@string_double_token__id__") }],
      [i("rawSingleString__id__")]: [{ include: i("@string_single_raw_token__id__") }],
      [i("rawDoubleString__id__")]: [{ include: i("@string_double_raw_token__id__") }],
      [i("expressionComment__id__")]: [{ include: i("@expression_comment_token__id__") }],
      [i("noParse__id__")]: [{ include: i("@no_parse_token__id__") }],
      [i("terseComment__id__")]: [{ include: i("@terse_comment_token__id__") }],
      [i("directive_token__id__")]: [
        [
          r(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),
          "auto" === e.id
            ? {
                cases: {
                  "$1==<": { token: "@rematch", switchTo: `@default_angle_${t.id}` },
                  "$1==[": { token: "@rematch", switchTo: `@default_bracket_${t.id}` },
                },
              }
            : [
                { token: "@brackets.directive" },
                { token: "delimiter.directive" },
                {
                  cases: {
                    "@noParseTags": { token: "tag", next: i("@noParse__id__.$3") },
                    "@default": { token: "tag" },
                  },
                },
                { token: "delimiter.directive" },
                { token: "@brackets.directive" },
              ],
        ],
        [
          r(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),
          "auto" === e.id
            ? {
                cases: {
                  "$1==<": { token: "@rematch", switchTo: `@default_angle_${t.id}` },
                  "$1==[": { token: "@rematch", switchTo: `@default_bracket_${t.id}` },
                },
              }
            : [
                { token: "@brackets.directive" },
                { token: "delimiter.directive" },
                { token: "tag" },
                { token: "delimiter.directive" },
                { token: "@brackets.directive" },
              ],
        ],
        [
          r(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),
          "auto" === e.id
            ? {
                cases: {
                  "$1==<": { token: "@rematch", switchTo: `@default_angle_${t.id}` },
                  "$1==[": { token: "@rematch", switchTo: `@default_bracket_${t.id}` },
                },
              }
            : [
                { token: "@brackets.directive" },
                { token: "delimiter.directive" },
                { token: "tag" },
                { token: "", next: i("@fmExpression__id__.directive") },
              ],
        ],
        [
          r(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),
          "auto" === e.id
            ? {
                cases: {
                  "$1==<": { token: "@rematch", switchTo: `@default_angle_${t.id}` },
                  "$1==[": { token: "@rematch", switchTo: `@default_bracket_${t.id}` },
                },
              }
            : [
                { token: "@brackets.directive" },
                { token: "delimiter.directive" },
                { token: "tag" },
                { token: "delimiter.directive" },
                { token: "@brackets.directive" },
              ],
        ],
        [
          r(/(@open__id__)(@)/),
          "auto" === e.id
            ? {
                cases: {
                  "$1==<": { token: "@rematch", switchTo: `@default_angle_${t.id}` },
                  "$1==[": { token: "@rematch", switchTo: `@default_bracket_${t.id}` },
                },
              }
            : [
                { token: "@brackets.directive" },
                { token: "delimiter.directive", next: i("@unifiedCall__id__") },
              ],
        ],
        [
          r(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),
          [
            { token: "@brackets.directive" },
            { token: "delimiter.directive" },
            { token: "tag" },
            { token: "delimiter.directive" },
            { token: "@brackets.directive" },
          ],
        ],
        [
          r(/(@open__id__)#--/),
          "auto" === e.id
            ? {
                cases: {
                  "$1==<": { token: "@rematch", switchTo: `@default_angle_${t.id}` },
                  "$1==[": { token: "@rematch", switchTo: `@default_bracket_${t.id}` },
                },
              }
            : { token: "comment", next: i("@terseComment__id__") },
        ],
        [
          r(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),
          "auto" === e.id
            ? {
                cases: {
                  "$1==<": { token: "@rematch", switchTo: `@default_angle_${t.id}` },
                  "$1==[": { token: "@rematch", switchTo: `@default_bracket_${t.id}` },
                },
              }
            : [
                { token: "@brackets.directive" },
                { token: "delimiter.directive" },
                { token: "tag.invalid", next: i("@fmExpression__id__.directive") },
              ],
        ],
      ],
      [i("interpolation_and_text_token__id__")]: [
        [
          r(/(@iOpen1__id__)(@iOpen2__id__)/),
          [
            { token: "bracket" === t.id ? "@brackets.interpolation" : "delimiter.interpolation" },
            {
              token: "bracket" === t.id ? "delimiter.interpolation" : "@brackets.interpolation",
              next: i("@fmExpression__id__.interpolation"),
            },
          ],
        ],
        [/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/, { token: "source" }],
      ],
      [i("string_single_token__id__")]: [
        [/[^'\\]/, { token: "string" }],
        [/@escapedChar/, { token: "string.escape" }],
        [/'/, { token: "string", next: "@pop" }],
      ],
      [i("string_double_token__id__")]: [
        [/[^"\\]/, { token: "string" }],
        [/@escapedChar/, { token: "string.escape" }],
        [/"/, { token: "string", next: "@pop" }],
      ],
      [i("string_single_raw_token__id__")]: [
        [/[^']+/, { token: "string.raw" }],
        [/'/, { token: "string.raw", next: "@pop" }],
      ],
      [i("string_double_raw_token__id__")]: [
        [/[^"]+/, { token: "string.raw" }],
        [/"/, { token: "string.raw", next: "@pop" }],
      ],
      [i("expression_token__id__")]: [
        [
          /(r?)(['"])/,
          {
            cases: {
              "r'": [
                { token: "keyword" },
                { token: "string.raw", next: i("@rawSingleString__id__") },
              ],
              'r"': [
                { token: "keyword" },
                { token: "string.raw", next: i("@rawDoubleString__id__") },
              ],
              "'": [{ token: "source" }, { token: "string", next: i("@singleString__id__") }],
              '"': [{ token: "source" }, { token: "string", next: i("@doubleString__id__") }],
            },
          },
        ],
        [
          /(?:@integer)(?:\.(?:@integer))?/,
          { cases: { "(?:@integer)": { token: "number" }, "@default": { token: "number.float" } } },
        ],
        [
          /(\.)(@blank*)(@specialHashKeys)/,
          [{ token: "delimiter" }, { token: "" }, { token: "identifier" }],
        ],
        [
          /(?:@namedSymbols)/,
          {
            cases: {
              "@arrows": { token: "meta.arrow" },
              "@delimiters": { token: "delimiter" },
              "@default": { token: "operators" },
            },
          },
        ],
        [
          /@id/,
          {
            cases: {
              "@keywords": { token: "keyword.$0" },
              "@stringOperators": { token: "operators" },
              "@default": { token: "identifier" },
            },
          },
        ],
        [
          /[\[\]\(\)\{\}]/,
          {
            cases: {
              "\\[": {
                cases: {
                  "$S2==gt": { token: "@brackets", next: i("@inParen__id__.gt") },
                  "@default": { token: "@brackets", next: i("@inParen__id__.plain") },
                },
              },
              "\\]": {
                cases: {
                  ...("bracket" === t.id
                    ? {
                        "$S2==interpolation": { token: "@brackets.interpolation", next: "@popall" },
                      }
                    : {}),
                  ...("bracket" === e.id
                    ? { "$S2==directive": { token: "@brackets.directive", next: "@popall" } }
                    : {}),
                  [i("$S1==inParen__id__")]: { token: "@brackets", next: "@pop" },
                  "@default": { token: "@brackets" },
                },
              },
              "\\(": { token: "@brackets", next: i("@inParen__id__.gt") },
              "\\)": {
                cases: {
                  [i("$S1==inParen__id__")]: { token: "@brackets", next: "@pop" },
                  "@default": { token: "@brackets" },
                },
              },
              "\\{": {
                cases: {
                  "$S2==gt": { token: "@brackets", next: i("@inParen__id__.gt") },
                  "@default": { token: "@brackets", next: i("@inParen__id__.plain") },
                },
              },
              "\\}": {
                cases: {
                  ...("bracket" === t.id
                    ? {}
                    : {
                        "$S2==interpolation": { token: "@brackets.interpolation", next: "@popall" },
                      }),
                  [i("$S1==inParen__id__")]: { token: "@brackets", next: "@pop" },
                  "@default": { token: "@brackets" },
                },
              },
            },
          },
        ],
        [/\$\{/, { token: "delimiter.invalid" }],
      ],
      [i("blank_and_expression_comment_token__id__")]: [
        [/(?:@blank)+/, { token: "" }],
        [/[<\[][#!]--/, { token: "comment", next: i("@expressionComment__id__") }],
      ],
      [i("directive_end_token__id__")]: [
        [
          />/,
          "bracket" === e.id
            ? { token: "operators" }
            : { token: "@brackets.directive", next: "@popall" },
        ],
        [
          r(/(\/)(@close__id__)/),
          [{ token: "delimiter.directive" }, { token: "@brackets.directive", next: "@popall" }],
        ],
      ],
      [i("greater_operators_token__id__")]: [
        [/>/, { token: "operators" }],
        [/>=/, { token: "operators" }],
      ],
      [i("no_space_expression_end_token__id__")]: [
        [/(?:@blank)+/, { token: "", switchTo: i("@fmExpression__id__.directive") }],
      ],
      [i("unified_call_token__id__")]: [
        [
          /(@id)((?:@blank)+)/,
          [{ token: "tag" }, { token: "", next: i("@fmExpression__id__.directive") }],
        ],
        [
          r(/(@id)(\/?)(@close__id__)/),
          [
            { token: "tag" },
            { token: "delimiter.directive" },
            { token: "@brackets.directive", next: "@popall" },
          ],
        ],
        [/./, { token: "@rematch", next: i("@noSpaceExpression__id__") }],
      ],
      [i("no_parse_token__id__")]: [
        [
          r(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),
          {
            cases: {
              "$S2==$3": [
                { token: "@brackets.directive" },
                { token: "delimiter.directive" },
                { token: "tag" },
                { token: "" },
                { token: "@brackets.directive", next: "@popall" },
              ],
              "$S2==comment": [
                { token: "comment" },
                { token: "comment" },
                { token: "comment" },
                { token: "comment" },
                { token: "comment" },
              ],
              "@default": [
                { token: "source" },
                { token: "source" },
                { token: "source" },
                { token: "source" },
                { token: "source" },
              ],
            },
          },
        ],
        [
          /[^<\[\-]+|[<\[\-]/,
          { cases: { "$S2==comment": { token: "comment" }, "@default": { token: "source" } } },
        ],
      ],
      [i("expression_comment_token__id__")]: [
        [/--[>\]]/, { token: "comment", next: "@pop" }],
        [/[^\->\]]+|[>\]\-]/, { token: "comment" }],
      ],
      [i("terse_comment_token__id__")]: [
        [r(/--(?:@close__id__)/), { token: "comment", next: "@popall" }],
        [/[^<\[\-]+|[<\[\-]/, { token: "comment" }],
      ],
    },
  };
}
function V5e(e) {
  const t = B5e(R5e, e),
    n = B5e(O5e, e),
    i = B5e(M5e, e);
  return {
    ...t,
    ...n,
    ...i,
    unicode: !0,
    includeLF: !1,
    start: `default_auto_${e.id}`,
    ignoreCase: !1,
    defaultToken: "invalid",
    tokenPostfix: ".freemarker2",
    brackets: [
      { open: "{", close: "}", token: "delimiter.curly" },
      { open: "[", close: "]", token: "delimiter.square" },
      { open: "(", close: ")", token: "delimiter.parenthesis" },
      { open: "<", close: ">", token: "delimiter.angle" },
    ],
    tokenizer: { ...t.tokenizer, ...n.tokenizer, ...i.tokenizer },
  };
}
const W5e = { conf: j5e(R5e), language: B5e(R5e, A5e) },
  H5e = { conf: j5e(O5e), language: B5e(O5e, A5e) },
  z5e = { conf: j5e(R5e), language: B5e(R5e, P5e) },
  U5e = { conf: j5e(O5e), language: B5e(O5e, P5e) },
  $5e = { conf: F5e(), language: V5e(A5e) },
  q5e = { conf: F5e(), language: V5e(P5e) },
  K5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        TagAngleInterpolationBracket: z5e,
        TagAngleInterpolationDollar: W5e,
        TagAutoInterpolationBracket: q5e,
        TagAutoInterpolationDollar: $5e,
        TagBracketInterpolationBracket: U5e,
        TagBracketInterpolationDollar: H5e,
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  G5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "`", close: "`", notIn: ["string"] },
            { open: '"', close: '"', notIn: ["string"] },
            { open: "'", close: "'", notIn: ["string", "comment"] },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "`", close: "`" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".go",
          keywords: [
            "break",
            "case",
            "chan",
            "const",
            "continue",
            "default",
            "defer",
            "else",
            "fallthrough",
            "for",
            "func",
            "go",
            "goto",
            "if",
            "import",
            "interface",
            "map",
            "package",
            "range",
            "return",
            "select",
            "struct",
            "switch",
            "type",
            "var",
            "bool",
            "true",
            "false",
            "uint8",
            "uint16",
            "uint32",
            "uint64",
            "int8",
            "int16",
            "int32",
            "int64",
            "float32",
            "float64",
            "complex64",
            "complex128",
            "byte",
            "rune",
            "uint",
            "int",
            "uintptr",
            "string",
            "nil",
          ],
          operators: [
            "+",
            "-",
            "*",
            "/",
            "%",
            "&",
            "|",
            "^",
            "<<",
            ">>",
            "&^",
            "+=",
            "-=",
            "*=",
            "/=",
            "%=",
            "&=",
            "|=",
            "^=",
            "<<=",
            ">>=",
            "&^=",
            "&&",
            "||",
            "<-",
            "++",
            "--",
            "==",
            "<",
            ">",
            "=",
            "!",
            "!=",
            "<=",
            ">=",
            ":=",
            "...",
            "(",
            ")",
            "",
            "]",
            "{",
            "}",
            ",",
            ";",
            ".",
            ":",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_]\w*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/\[\[.*\]\]/, "annotation"],
              [/^\s*#\w+/, "keyword"],
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/\d*\d+[eE]([\-+]?\d+)?/, "number.float"],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex"],
              [/0[0-7']*[0-7]/, "number.octal"],
              [/0[bB][0-1']*[0-1]/, "number.binary"],
              [/\d[\d']*/, "number"],
              [/\d/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", "@string"],
              [/`/, "string", "@rawstring"],
              [/'[^\\']'/, "string"],
              [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
              [/'/, "string.invalid"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*\*(?!\/)/, "comment.doc", "@doccomment"],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            doccomment: [
              [/[^\/*]+/, "comment.doc"],
              [/\/\*/, "comment.doc.invalid"],
              [/\*\//, "comment.doc", "@pop"],
              [/[\/*]/, "comment.doc"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
            rawstring: [
              [/[^\`]/, "string"],
              [/`/, "string", "@pop"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  Z5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "#" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"""', close: '"""', notIn: ["string", "comment"] },
            { open: '"', close: '"', notIn: ["string", "comment"] },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"""', close: '"""' },
            { open: '"', close: '"' },
          ],
          folding: { offSide: !0 },
        },
        language: {
          defaultToken: "invalid",
          tokenPostfix: ".gql",
          keywords: [
            "null",
            "true",
            "false",
            "query",
            "mutation",
            "subscription",
            "extend",
            "schema",
            "directive",
            "scalar",
            "type",
            "interface",
            "union",
            "enum",
            "input",
            "implements",
            "fragment",
            "on",
          ],
          typeKeywords: ["Int", "Float", "String", "Boolean", "ID"],
          directiveLocations: [
            "SCHEMA",
            "SCALAR",
            "OBJECT",
            "FIELD_DEFINITION",
            "ARGUMENT_DEFINITION",
            "INTERFACE",
            "UNION",
            "ENUM",
            "ENUM_VALUE",
            "INPUT_OBJECT",
            "INPUT_FIELD_DEFINITION",
            "QUERY",
            "MUTATION",
            "SUBSCRIPTION",
            "FIELD",
            "FRAGMENT_DEFINITION",
            "FRAGMENT_SPREAD",
            "INLINE_FRAGMENT",
            "VARIABLE_DEFINITION",
          ],
          operators: ["=", "!", "?", ":", "&", "|"],
          symbols: /[=!?:&|]+/,
          escapes: /\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/,
          tokenizer: {
            root: [
              [/[a-z_][\w$]*/, { cases: { "@keywords": "keyword", "@default": "key.identifier" } }],
              [
                /[$][\w$]*/,
                { cases: { "@keywords": "keyword", "@default": "argument.identifier" } },
              ],
              [
                /[A-Z][\w\$]*/,
                { cases: { "@typeKeywords": "keyword", "@default": "type.identifier" } },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "operator", "@default": "" } }],
              [/@\s*[a-zA-Z_\$][\w\$]*/, { token: "annotation", log: "annotation token: $0" }],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F]+/, "number.hex"],
              [/\d+/, "number"],
              [/[;,.]/, "delimiter"],
              [/"""/, { token: "string", next: "@mlstring", nextEmbedded: "markdown" }],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, { token: "string.quote", bracket: "@open", next: "@string" }],
            ],
            mlstring: [
              [/[^"]+/, "string"],
              ['"""', { token: "string", next: "@pop", nextEmbedded: "@pop" }],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/#.*$/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  Y5e = [
    "area",
    "base",
    "br",
    "col",
    "embed",
    "hr",
    "img",
    "input",
    "keygen",
    "link",
    "menuitem",
    "meta",
    "param",
    "source",
    "track",
    "wbr",
  ],
  X5e = {
    wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
    comments: { blockComment: ["{{!--", "--}}"] },
    brackets: [
      ["\x3c!--", "--\x3e"],
      ["<", ">"],
      ["{{", "}}"],
      ["{", "}"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "<", close: ">" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    onEnterRules: [
      {
        beforeText: new RegExp(`<(?!(?:${Y5e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
        afterText: /^<\/(\w[\w\d]*)\s*>$/i,
        action: { indentAction: VGe.IndentAction.IndentOutdent },
      },
      {
        beforeText: new RegExp(`<(?!(?:${Y5e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
        action: { indentAction: VGe.IndentAction.Indent },
      },
    ],
  },
  Q5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: X5e,
        language: {
          defaultToken: "",
          tokenPostfix: "",
          tokenizer: {
            root: [
              [/\{\{!--/, "comment.block.start.handlebars", "@commentBlock"],
              [/\{\{!/, "comment.start.handlebars", "@comment"],
              [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.root" }],
              [/<!DOCTYPE/, "metatag.html", "@doctype"],
              [/<!--/, "comment.html", "@commentHtml"],
              [/(<)(\w+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
              [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
              [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
              [/(<)([:\w]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
              [/(<\/)(\w+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
              [/</, "delimiter.html"],
              [/\{/, "delimiter.html"],
              [/[^<{]+/],
            ],
            doctype: [
              [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.comment" }],
              [/[^>]+/, "metatag.content.html"],
              [/>/, "metatag.html", "@pop"],
            ],
            comment: [
              [/\}\}/, "comment.end.handlebars", "@pop"],
              [/./, "comment.content.handlebars"],
            ],
            commentBlock: [
              [/--\}\}/, "comment.block.end.handlebars", "@pop"],
              [/./, "comment.content.handlebars"],
            ],
            commentHtml: [
              [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.comment" }],
              [/-->/, "comment.html", "@pop"],
              [/[^-]+/, "comment.content.html"],
              [/./, "comment.content.html"],
            ],
            otherTag: [
              [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.otherTag" }],
              [/\/?>/, "delimiter.html", "@pop"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
            ],
            script: [
              [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.script" }],
              [/type/, "attribute.name", "@scriptAfterType"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded.text/javascript",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [
                /(<\/)(script\s*)(>)/,
                ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }],
              ],
            ],
            scriptAfterType: [
              [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.scriptAfterType" }],
              [/=/, "delimiter", "@scriptAfterTypeEquals"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded.text/javascript",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptAfterTypeEquals: [
              [
                /\{\{/,
                { token: "@rematch", switchTo: "@handlebarsInSimpleState.scriptAfterTypeEquals" },
              ],
              [/"([^"]*)"/, { token: "attribute.value", switchTo: "@scriptWithCustomType.$1" }],
              [/'([^']*)'/, { token: "attribute.value", switchTo: "@scriptWithCustomType.$1" }],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded.text/javascript",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptWithCustomType: [
              [
                /\{\{/,
                {
                  token: "@rematch",
                  switchTo: "@handlebarsInSimpleState.scriptWithCustomType.$S2",
                },
              ],
              [/>/, { token: "delimiter.html", next: "@scriptEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptEmbedded: [
              [
                /\{\{/,
                {
                  token: "@rematch",
                  switchTo: "@handlebarsInEmbeddedState.scriptEmbedded.$S2",
                  nextEmbedded: "@pop",
                },
              ],
              [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
            ],
            style: [
              [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.style" }],
              [/type/, "attribute.name", "@styleAfterType"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@styleEmbedded.text/css",
                  nextEmbedded: "text/css",
                },
              ],
              [/[ \t\r\n]+/],
              [
                /(<\/)(style\s*)(>)/,
                ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }],
              ],
            ],
            styleAfterType: [
              [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.styleAfterType" }],
              [/=/, "delimiter", "@styleAfterTypeEquals"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@styleEmbedded.text/css",
                  nextEmbedded: "text/css",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleAfterTypeEquals: [
              [
                /\{\{/,
                { token: "@rematch", switchTo: "@handlebarsInSimpleState.styleAfterTypeEquals" },
              ],
              [/"([^"]*)"/, { token: "attribute.value", switchTo: "@styleWithCustomType.$1" }],
              [/'([^']*)'/, { token: "attribute.value", switchTo: "@styleWithCustomType.$1" }],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@styleEmbedded.text/css",
                  nextEmbedded: "text/css",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleWithCustomType: [
              [
                /\{\{/,
                { token: "@rematch", switchTo: "@handlebarsInSimpleState.styleWithCustomType.$S2" },
              ],
              [/>/, { token: "delimiter.html", next: "@styleEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleEmbedded: [
              [
                /\{\{/,
                {
                  token: "@rematch",
                  switchTo: "@handlebarsInEmbeddedState.styleEmbedded.$S2",
                  nextEmbedded: "@pop",
                },
              ],
              [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
            ],
            handlebarsInSimpleState: [
              [/\{\{\{?/, "delimiter.handlebars"],
              [/\}\}\}?/, { token: "delimiter.handlebars", switchTo: "@$S2.$S3" }],
              { include: "handlebarsRoot" },
            ],
            handlebarsInEmbeddedState: [
              [/\{\{\{?/, "delimiter.handlebars"],
              [
                /\}\}\}?/,
                { token: "delimiter.handlebars", switchTo: "@$S2.$S3", nextEmbedded: "$S3" },
              ],
              { include: "handlebarsRoot" },
            ],
            handlebarsRoot: [
              [/"[^"]*"/, "string.handlebars"],
              [/[#/][^\s}]+/, "keyword.helper.handlebars"],
              [/else\b/, "keyword.helper.handlebars"],
              [/[\s]+/],
              [/[^}]/, "variable.parameter.handlebars"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  J5e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "#", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"', notIn: ["string"] },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".hcl",
          keywords: [
            "var",
            "local",
            "path",
            "for_each",
            "any",
            "string",
            "number",
            "bool",
            "true",
            "false",
            "null",
            "if ",
            "else ",
            "endif ",
            "for ",
            "in",
            "endfor",
          ],
          operators: [
            "=",
            ">=",
            "<=",
            "==",
            "!=",
            "+",
            "-",
            "*",
            "/",
            "%",
            "&&",
            "||",
            "!",
            "<",
            ">",
            "?",
            "...",
            ":",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          terraformFunctions:
            /(abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)/,
          terraformMainBlocks: /(module|data|terraform|resource|provider|variable|output|locals)/,
          tokenizer: {
            root: [
              [
                /^@terraformMainBlocks([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,
                ["type", "", "string", "", "string", "", "@brackets"],
              ],
              [
                /(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,
                ["identifier", "", "string", "", "string", "", "@brackets"],
              ],
              [
                /(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)(=)(\{)/,
                ["identifier", "", "string", "", "operator", "", "@brackets"],
              ],
              { include: "@terraform" },
            ],
            terraform: [
              [/@terraformFunctions(\()/, ["type", "@brackets"]],
              [
                /[a-zA-Z_]\w*-*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "variable" } },
              ],
              { include: "@whitespace" },
              { include: "@heredoc" },
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "operator", "@default": "" } }],
              [/\d*\d+[eE]([\-+]?\d+)?/, "number.float"],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/\d[\d']*/, "number"],
              [/\d/, "number"],
              [/[;,.]/, "delimiter"],
              [/"/, "string", "@string"],
              [/'/, "invalid"],
            ],
            heredoc: [
              [
                /<<[-]*\s*["]?([\w\-]+)["]?/,
                { token: "string.heredoc.delimiter", next: "@heredocBody.$1" },
              ],
            ],
            heredocBody: [
              [
                /([\w\-]+)$/,
                {
                  cases: {
                    "$1==$S2": [{ token: "string.heredoc.delimiter", next: "@popall" }],
                    "@default": "string.heredoc",
                  },
                },
              ],
              [/./, "string.heredoc"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
              [/#.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            string: [
              [/\$\{/, { token: "delimiter", next: "@stringExpression" }],
              [/[^\\"\$]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@popall"],
            ],
            stringInsideExpression: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
            stringExpression: [
              [/\}/, { token: "delimiter", next: "@pop" }],
              [/"/, "string", "@stringInsideExpression"],
              { include: "@terraform" },
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  e3e = [
    "area",
    "base",
    "br",
    "col",
    "embed",
    "hr",
    "img",
    "input",
    "keygen",
    "link",
    "menuitem",
    "meta",
    "param",
    "source",
    "track",
    "wbr",
  ],
  t3e = {
    wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
    comments: { blockComment: ["\x3c!--", "--\x3e"] },
    brackets: [
      ["\x3c!--", "--\x3e"],
      ["<", ">"],
      ["{", "}"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">" },
    ],
    onEnterRules: [
      {
        beforeText: new RegExp(
          `<(?!(?:${e3e.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,
          "i",
        ),
        afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i,
        action: { indentAction: VGe.IndentAction.IndentOutdent },
      },
      {
        beforeText: new RegExp(`<(?!(?:${e3e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
        action: { indentAction: VGe.IndentAction.Indent },
      },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*\x3c!--\\s*#region\\b.*--\x3e"),
        end: new RegExp("^\\s*\x3c!--\\s*#endregion\\b.*--\x3e"),
      },
    },
  },
  n3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: t3e,
        language: {
          defaultToken: "",
          tokenPostfix: ".html",
          ignoreCase: !0,
          tokenizer: {
            root: [
              [/<!DOCTYPE/, "metatag", "@doctype"],
              [/<!--/, "comment", "@comment"],
              [/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/, ["delimiter", "tag", "", "delimiter"]],
              [/(<)(script)/, ["delimiter", { token: "tag", next: "@script" }]],
              [/(<)(style)/, ["delimiter", { token: "tag", next: "@style" }]],
              [/(<)((?:[\w\-]+:)?[\w\-]+)/, ["delimiter", { token: "tag", next: "@otherTag" }]],
              [/(<\/)((?:[\w\-]+:)?[\w\-]+)/, ["delimiter", { token: "tag", next: "@otherTag" }]],
              [/</, "delimiter"],
              [/[^<]+/],
            ],
            doctype: [
              [/[^>]+/, "metatag.content"],
              [/>/, "metatag", "@pop"],
            ],
            comment: [
              [/-->/, "comment", "@pop"],
              [/[^-]+/, "comment.content"],
              [/./, "comment.content"],
            ],
            otherTag: [
              [/\/?>/, "delimiter", "@pop"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
            ],
            script: [
              [/type/, "attribute.name", "@scriptAfterType"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [
                />/,
                { token: "delimiter", next: "@scriptEmbedded", nextEmbedded: "text/javascript" },
              ],
              [/[ \t\r\n]+/],
              [/(<\/)(script\s*)(>)/, ["delimiter", "tag", { token: "delimiter", next: "@pop" }]],
            ],
            scriptAfterType: [
              [/=/, "delimiter", "@scriptAfterTypeEquals"],
              [
                />/,
                { token: "delimiter", next: "@scriptEmbedded", nextEmbedded: "text/javascript" },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptAfterTypeEquals: [
              [
                /"module"/,
                { token: "attribute.value", switchTo: "@scriptWithCustomType.text/javascript" },
              ],
              [
                /'module'/,
                { token: "attribute.value", switchTo: "@scriptWithCustomType.text/javascript" },
              ],
              [/"([^"]*)"/, { token: "attribute.value", switchTo: "@scriptWithCustomType.$1" }],
              [/'([^']*)'/, { token: "attribute.value", switchTo: "@scriptWithCustomType.$1" }],
              [
                />/,
                { token: "delimiter", next: "@scriptEmbedded", nextEmbedded: "text/javascript" },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptWithCustomType: [
              [/>/, { token: "delimiter", next: "@scriptEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptEmbedded: [
              [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
              [/[^<]+/, ""],
            ],
            style: [
              [/type/, "attribute.name", "@styleAfterType"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/>/, { token: "delimiter", next: "@styleEmbedded", nextEmbedded: "text/css" }],
              [/[ \t\r\n]+/],
              [/(<\/)(style\s*)(>)/, ["delimiter", "tag", { token: "delimiter", next: "@pop" }]],
            ],
            styleAfterType: [
              [/=/, "delimiter", "@styleAfterTypeEquals"],
              [/>/, { token: "delimiter", next: "@styleEmbedded", nextEmbedded: "text/css" }],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleAfterTypeEquals: [
              [/"([^"]*)"/, { token: "attribute.value", switchTo: "@styleWithCustomType.$1" }],
              [/'([^']*)'/, { token: "attribute.value", switchTo: "@styleWithCustomType.$1" }],
              [/>/, { token: "delimiter", next: "@styleEmbedded", nextEmbedded: "text/css" }],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleWithCustomType: [
              [/>/, { token: "delimiter", next: "@styleEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleEmbedded: [
              [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
              [/[^<]+/, ""],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  i3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "#" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".ini",
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [/^\[[^\]]*\]/, "metatag"],
              [/(^\w+)(\s*)(\=)/, ["key", "", "delimiter"]],
              { include: "@whitespace" },
              [/\d+/, "number"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/'([^'\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", '@string."'],
              [/'/, "string", "@string.'"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/^\s*[#;].*$/, "comment"],
            ],
            string: [
              [/[^\\"']+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [
                /["']/,
                { cases: { "$#==$S2": { token: "string", next: "@pop" }, "@default": "string" } },
              ],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  r3e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: "<", close: ">" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
        end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))"),
      },
    },
  },
  o3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: r3e,
        language: {
          defaultToken: "",
          tokenPostfix: ".java",
          keywords: [
            "abstract",
            "continue",
            "for",
            "new",
            "switch",
            "assert",
            "default",
            "goto",
            "package",
            "synchronized",
            "boolean",
            "do",
            "if",
            "private",
            "this",
            "break",
            "double",
            "implements",
            "protected",
            "throw",
            "byte",
            "else",
            "import",
            "public",
            "throws",
            "case",
            "enum",
            "instanceof",
            "return",
            "transient",
            "catch",
            "extends",
            "int",
            "short",
            "try",
            "char",
            "final",
            "interface",
            "static",
            "void",
            "class",
            "finally",
            "long",
            "strictfp",
            "volatile",
            "const",
            "float",
            "native",
            "super",
            "while",
            "true",
            "false",
            "yield",
            "record",
            "sealed",
            "non-sealed",
            "permits",
          ],
          operators: [
            "=",
            ">",
            "<",
            "!",
            "~",
            "?",
            ":",
            "==",
            "<=",
            ">=",
            "!=",
            "&&",
            "||",
            "++",
            "--",
            "+",
            "-",
            "*",
            "/",
            "&",
            "|",
            "^",
            "%",
            "<<",
            ">>",
            ">>>",
            "+=",
            "-=",
            "*=",
            "/=",
            "&=",
            "|=",
            "^=",
            "%=",
            "<<=",
            ">>=",
            ">>>=",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          digits: /\d+(_+\d+)*/,
          octaldigits: /[0-7]+(_+[0-7]+)*/,
          binarydigits: /[0-1]+(_+[0-1]+)*/,
          hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
          tokenizer: {
            root: [
              ["non-sealed", "keyword.non-sealed"],
              [
                /[a-zA-Z_$][\w$]*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/@\s*[a-zA-Z_\$][\w\$]*/, "annotation"],
              [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, "number.float"],
              [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, "number.float"],
              [/0[xX](@hexdigits)[Ll]?/, "number.hex"],
              [/0(@octaldigits)[Ll]?/, "number.octal"],
              [/0[bB](@binarydigits)[Ll]?/, "number.binary"],
              [/(@digits)[fFdD]/, "number.float"],
              [/(@digits)[lL]?/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"""/, "string", "@multistring"],
              [/"/, "string", "@string"],
              [/'[^\\']'/, "string"],
              [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
              [/'/, "string.invalid"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*\*(?!\/)/, "comment.doc", "@javadoc"],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            javadoc: [
              [/[^\/*]+/, "comment.doc"],
              [/\/\*/, "comment.doc.invalid"],
              [/\*\//, "comment.doc", "@pop"],
              [/[\/*]/, "comment.doc"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
            multistring: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"""/, "string", "@pop"],
              [/./, "string"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  s3e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    onEnterRules: [
      {
        beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
        afterText: /^\s*\*\/$/,
        action: { indentAction: VGe.IndentAction.IndentOutdent, appendText: " * " },
      },
      {
        beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
        action: { indentAction: VGe.IndentAction.None, appendText: " * " },
      },
      {
        beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,
        action: { indentAction: VGe.IndentAction.None, appendText: "* " },
      },
      {
        beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/,
        action: { indentAction: VGe.IndentAction.None, removeText: 1 },
      },
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"', notIn: ["string"] },
      { open: "'", close: "'", notIn: ["string", "comment"] },
      { open: "`", close: "`", notIn: ["string", "comment"] },
      { open: "/**", close: " */", notIn: ["string"] },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*//\\s*#?region\\b"),
        end: new RegExp("^\\s*//\\s*#?endregion\\b"),
      },
    },
  },
  a3e = {
    defaultToken: "invalid",
    tokenPostfix: ".ts",
    keywords: [
      "abstract",
      "any",
      "as",
      "asserts",
      "bigint",
      "boolean",
      "break",
      "case",
      "catch",
      "class",
      "continue",
      "const",
      "constructor",
      "debugger",
      "declare",
      "default",
      "delete",
      "do",
      "else",
      "enum",
      "export",
      "extends",
      "false",
      "finally",
      "for",
      "from",
      "function",
      "get",
      "if",
      "implements",
      "import",
      "in",
      "infer",
      "instanceof",
      "interface",
      "is",
      "keyof",
      "let",
      "module",
      "namespace",
      "never",
      "new",
      "null",
      "number",
      "object",
      "out",
      "package",
      "private",
      "protected",
      "public",
      "override",
      "readonly",
      "require",
      "global",
      "return",
      "satisfies",
      "set",
      "static",
      "string",
      "super",
      "switch",
      "symbol",
      "this",
      "throw",
      "true",
      "try",
      "type",
      "typeof",
      "undefined",
      "unique",
      "unknown",
      "var",
      "void",
      "while",
      "with",
      "yield",
      "async",
      "await",
      "of",
    ],
    operators: [
      "<=",
      ">=",
      "==",
      "!=",
      "===",
      "!==",
      "=>",
      "+",
      "-",
      "**",
      "*",
      "/",
      "%",
      "++",
      "--",
      "<<",
      "</",
      ">>",
      ">>>",
      "&",
      "|",
      "^",
      "!",
      "~",
      "&&",
      "||",
      "??",
      "?",
      ":",
      "=",
      "+=",
      "-=",
      "*=",
      "**=",
      "/=",
      "%=",
      "<<=",
      ">>=",
      ">>>=",
      "&=",
      "|=",
      "^=",
      "@",
    ],
    symbols: /[=><!~?:&|+\-*\/\^%]+/,
    escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
    digits: /\d+(_+\d+)*/,
    octaldigits: /[0-7]+(_+[0-7]+)*/,
    binarydigits: /[0-1]+(_+[0-1]+)*/,
    hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
    regexpctl: /[(){}\[\]\$\^|\-*+?\.]/,
    regexpesc: /\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,
    tokenizer: {
      root: [[/[{}]/, "delimiter.bracket"], { include: "common" }],
      common: [
        [/#?[a-z_$][\w$]*/, { cases: { "@keywords": "keyword", "@default": "identifier" } }],
        [/[A-Z][\w\$]*/, "type.identifier"],
        { include: "@whitespace" },
        [
          /\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,
          { token: "regexp", bracket: "@open", next: "@regexp" },
        ],
        [/[()\[\]]/, "@brackets"],
        [/[<>](?!@symbols)/, "@brackets"],
        [/!(?=([^=]|$))/, "delimiter"],
        [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
        [/(@digits)[eE]([\-+]?(@digits))?/, "number.float"],
        [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, "number.float"],
        [/0[xX](@hexdigits)n?/, "number.hex"],
        [/0[oO]?(@octaldigits)n?/, "number.octal"],
        [/0[bB](@binarydigits)n?/, "number.binary"],
        [/(@digits)n?/, "number"],
        [/[;,.]/, "delimiter"],
        [/"([^"\\]|\\.)*$/, "string.invalid"],
        [/'([^'\\]|\\.)*$/, "string.invalid"],
        [/"/, "string", "@string_double"],
        [/'/, "string", "@string_single"],
        [/`/, "string", "@string_backtick"],
      ],
      whitespace: [
        [/[ \t\r\n]+/, ""],
        [/\/\*\*(?!\/)/, "comment.doc", "@jsdoc"],
        [/\/\*/, "comment", "@comment"],
        [/\/\/.*$/, "comment"],
      ],
      comment: [
        [/[^\/*]+/, "comment"],
        [/\*\//, "comment", "@pop"],
        [/[\/*]/, "comment"],
      ],
      jsdoc: [
        [/[^\/*]+/, "comment.doc"],
        [/\*\//, "comment.doc", "@pop"],
        [/[\/*]/, "comment.doc"],
      ],
      regexp: [
        [
          /(\{)(\d+(?:,\d*)?)(\})/,
          ["regexp.escape.control", "regexp.escape.control", "regexp.escape.control"],
        ],
        [
          /(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,
          ["regexp.escape.control", { token: "regexp.escape.control", next: "@regexrange" }],
        ],
        [/(\()(\?:|\?=|\?!)/, ["regexp.escape.control", "regexp.escape.control"]],
        [/[()]/, "regexp.escape.control"],
        [/@regexpctl/, "regexp.escape.control"],
        [/[^\\\/]/, "regexp"],
        [/@regexpesc/, "regexp.escape"],
        [/\\\./, "regexp.invalid"],
        [
          /(\/)([dgimsuy]*)/,
          [{ token: "regexp", bracket: "@close", next: "@pop" }, "keyword.other"],
        ],
      ],
      regexrange: [
        [/-/, "regexp.escape.control"],
        [/\^/, "regexp.invalid"],
        [/@regexpesc/, "regexp.escape"],
        [/[^\]]/, "regexp"],
        [/\]/, { token: "regexp.escape.control", next: "@pop", bracket: "@close" }],
      ],
      string_double: [
        [/[^\\"]+/, "string"],
        [/@escapes/, "string.escape"],
        [/\\./, "string.escape.invalid"],
        [/"/, "string", "@pop"],
      ],
      string_single: [
        [/[^\\']+/, "string"],
        [/@escapes/, "string.escape"],
        [/\\./, "string.escape.invalid"],
        [/'/, "string", "@pop"],
      ],
      string_backtick: [
        [/\$\{/, { token: "delimiter.bracket", next: "@bracketCounting" }],
        [/[^\\`$]+/, "string"],
        [/@escapes/, "string.escape"],
        [/\\./, "string.escape.invalid"],
        [/`/, "string", "@pop"],
      ],
      bracketCounting: [
        [/\{/, "delimiter.bracket", "@bracketCounting"],
        [/\}/, "delimiter.bracket", "@pop"],
        { include: "common" },
      ],
    },
  },
  l3e = Object.freeze(
    Object.defineProperty({ __proto__: null, conf: s3e, language: a3e }, Symbol.toStringTag, {
      value: "Module",
    }),
  ),
  c3e = s3e,
  d3e = {
    defaultToken: "invalid",
    tokenPostfix: ".js",
    keywords: [
      "break",
      "case",
      "catch",
      "class",
      "continue",
      "const",
      "constructor",
      "debugger",
      "default",
      "delete",
      "do",
      "else",
      "export",
      "extends",
      "false",
      "finally",
      "for",
      "from",
      "function",
      "get",
      "if",
      "import",
      "in",
      "instanceof",
      "let",
      "new",
      "null",
      "return",
      "set",
      "static",
      "super",
      "switch",
      "symbol",
      "this",
      "throw",
      "true",
      "try",
      "typeof",
      "undefined",
      "var",
      "void",
      "while",
      "with",
      "yield",
      "async",
      "await",
      "of",
    ],
    typeKeywords: [],
    operators: a3e.operators,
    symbols: a3e.symbols,
    escapes: a3e.escapes,
    digits: a3e.digits,
    octaldigits: a3e.octaldigits,
    binarydigits: a3e.binarydigits,
    hexdigits: a3e.hexdigits,
    regexpctl: a3e.regexpctl,
    regexpesc: a3e.regexpesc,
    tokenizer: a3e.tokenizer,
  },
  u3e = Object.freeze(
    Object.defineProperty({ __proto__: null, conf: c3e, language: d3e }, Symbol.toStringTag, {
      value: "Module",
    }),
  ),
  h3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          tokenPostfix: ".julia",
          keywords: [
            "begin",
            "while",
            "if",
            "for",
            "try",
            "return",
            "break",
            "continue",
            "function",
            "macro",
            "quote",
            "let",
            "local",
            "global",
            "const",
            "do",
            "struct",
            "module",
            "baremodule",
            "using",
            "import",
            "export",
            "end",
            "else",
            "elseif",
            "catch",
            "finally",
            "mutable",
            "primitive",
            "abstract",
            "type",
            "in",
            "isa",
            "where",
            "new",
          ],
          types: [
            "LinRange",
            "LineNumberNode",
            "LinearIndices",
            "LoadError",
            "MIME",
            "Matrix",
            "Method",
            "MethodError",
            "Missing",
            "MissingException",
            "Module",
            "NTuple",
            "NamedTuple",
            "Nothing",
            "Number",
            "OrdinalRange",
            "OutOfMemoryError",
            "OverflowError",
            "Pair",
            "PartialQuickSort",
            "PermutedDimsArray",
            "Pipe",
            "Ptr",
            "QuoteNode",
            "Rational",
            "RawFD",
            "ReadOnlyMemoryError",
            "Real",
            "ReentrantLock",
            "Ref",
            "Regex",
            "RegexMatch",
            "RoundingMode",
            "SegmentationFault",
            "Set",
            "Signed",
            "Some",
            "StackOverflowError",
            "StepRange",
            "StepRangeLen",
            "StridedArray",
            "StridedMatrix",
            "StridedVecOrMat",
            "StridedVector",
            "String",
            "StringIndexError",
            "SubArray",
            "SubString",
            "SubstitutionString",
            "Symbol",
            "SystemError",
            "Task",
            "Text",
            "TextDisplay",
            "Timer",
            "Tuple",
            "Type",
            "TypeError",
            "TypeVar",
            "UInt",
            "UInt128",
            "UInt16",
            "UInt32",
            "UInt64",
            "UInt8",
            "UndefInitializer",
            "AbstractArray",
            "UndefKeywordError",
            "AbstractChannel",
            "UndefRefError",
            "AbstractChar",
            "UndefVarError",
            "AbstractDict",
            "Union",
            "AbstractDisplay",
            "UnionAll",
            "AbstractFloat",
            "UnitRange",
            "AbstractIrrational",
            "Unsigned",
            "AbstractMatrix",
            "AbstractRange",
            "Val",
            "AbstractSet",
            "Vararg",
            "AbstractString",
            "VecElement",
            "AbstractUnitRange",
            "VecOrMat",
            "AbstractVecOrMat",
            "Vector",
            "AbstractVector",
            "VersionNumber",
            "Any",
            "WeakKeyDict",
            "ArgumentError",
            "WeakRef",
            "Array",
            "AssertionError",
            "BigFloat",
            "BigInt",
            "BitArray",
            "BitMatrix",
            "BitSet",
            "BitVector",
            "Bool",
            "BoundsError",
            "CapturedException",
            "CartesianIndex",
            "CartesianIndices",
            "Cchar",
            "Cdouble",
            "Cfloat",
            "Channel",
            "Char",
            "Cint",
            "Cintmax_t",
            "Clong",
            "Clonglong",
            "Cmd",
            "Colon",
            "Complex",
            "ComplexF16",
            "ComplexF32",
            "ComplexF64",
            "CompositeException",
            "Condition",
            "Cptrdiff_t",
            "Cshort",
            "Csize_t",
            "Cssize_t",
            "Cstring",
            "Cuchar",
            "Cuint",
            "Cuintmax_t",
            "Culong",
            "Culonglong",
            "Cushort",
            "Cvoid",
            "Cwchar_t",
            "Cwstring",
            "DataType",
            "DenseArray",
            "DenseMatrix",
            "DenseVecOrMat",
            "DenseVector",
            "Dict",
            "DimensionMismatch",
            "Dims",
            "DivideError",
            "DomainError",
            "EOFError",
            "Enum",
            "ErrorException",
            "Exception",
            "ExponentialBackOff",
            "Expr",
            "Float16",
            "Float32",
            "Float64",
            "Function",
            "GlobalRef",
            "HTML",
            "IO",
            "IOBuffer",
            "IOContext",
            "IOStream",
            "IdDict",
            "IndexCartesian",
            "IndexLinear",
            "IndexStyle",
            "InexactError",
            "InitError",
            "Int",
            "Int128",
            "Int16",
            "Int32",
            "Int64",
            "Int8",
            "Integer",
            "InterruptException",
            "InvalidStateException",
            "Irrational",
            "KeyError",
          ],
          keywordops: ["<:", ">:", ":", "=>", "...", ".", "->", "?"],
          allops: /[^\w\d\s()\[\]{}"'#]+/,
          constants: [
            "true",
            "false",
            "nothing",
            "missing",
            "undef",
            "Inf",
            "pi",
            "NaN",
            "π",
            "ℯ",
            "ans",
            "PROGRAM_FILE",
            "ARGS",
            "C_NULL",
            "VERSION",
            "DEPOT_PATH",
            "LOAD_PATH",
          ],
          operators: [
            "!",
            "!=",
            "!==",
            "%",
            "&",
            "*",
            "+",
            "-",
            "/",
            "//",
            "<",
            "<<",
            "<=",
            "==",
            "===",
            "=>",
            ">",
            ">=",
            ">>",
            ">>>",
            "\\",
            "^",
            "|",
            "|>",
            "~",
            "÷",
            "∈",
            "∉",
            "∋",
            "∌",
            "∘",
            "√",
            "∛",
            "∩",
            "∪",
            "≈",
            "≉",
            "≠",
            "≡",
            "≢",
            "≤",
            "≥",
            "⊆",
            "⊇",
            "⊈",
            "⊉",
            "⊊",
            "⊋",
            "⊻",
          ],
          brackets: [
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
          ],
          ident: /π|ℯ|\b(?!\d)\w+\b/,
          escape: /(?:[abefnrstv\\"'\n\r]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4})/,
          escapes: /\\(?:C\-(@escape|.)|c(@escape|.)|@escape)/,
          tokenizer: {
            root: [
              [/(::)\s*|\b(isa)\s+/, "keyword", "@typeanno"],
              [/\b(isa)(\s*\(@ident\s*,\s*)/, ["keyword", { token: "", next: "@typeanno" }]],
              [/\b(type|struct)[ \t]+/, "keyword", "@typeanno"],
              [/^\s*:@ident[!?]?/, "metatag"],
              [/(return)(\s*:@ident[!?]?)/, ["keyword", "metatag"]],
              [/(\(|\[|\{|@allops)(\s*:@ident[!?]?)/, ["", "metatag"]],
              [/:\(/, "metatag", "@quote"],
              [/r"""/, "regexp.delim", "@tregexp"],
              [/r"/, "regexp.delim", "@sregexp"],
              [/raw"""/, "string.delim", "@rtstring"],
              [/[bv]?"""/, "string.delim", "@dtstring"],
              [/raw"/, "string.delim", "@rsstring"],
              [/[bv]?"/, "string.delim", "@dsstring"],
              [
                /(@ident)\{/,
                {
                  cases: {
                    "$1@types": { token: "type", next: "@gen" },
                    "@default": { token: "type", next: "@gen" },
                  },
                },
              ],
              [
                /@ident[!?'']?(?=\.?\()/,
                {
                  cases: {
                    "@types": "type",
                    "@keywords": "keyword",
                    "@constants": "variable",
                    "@default": "keyword.flow",
                  },
                },
              ],
              [
                /@ident[!?']?/,
                {
                  cases: {
                    "@types": "type",
                    "@keywords": "keyword",
                    "@constants": "variable",
                    "@default": "identifier",
                  },
                },
              ],
              [/\$\w+/, "key"],
              [/\$\(/, "key", "@paste"],
              [/@@@ident/, "annotation"],
              { include: "@whitespace" },
              [/'(?:@escapes|.)'/, "string.character"],
              [/[()\[\]{}]/, "@brackets"],
              [/@allops/, { cases: { "@keywordops": "keyword", "@operators": "operator" } }],
              [/[;,]/, "delimiter"],
              [/0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/, "number.hex"],
              [/0[_oO][0-7](_?[0-7])*/, "number.octal"],
              [/0[bB][01](_?[01])*/, "number.binary"],
              [/[+\-]?\d+(\.\d+)?(im?|[eE][+\-]?\d+(\.\d+)?)?/, "number"],
            ],
            typeanno: [
              [/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*\{/, "type", "@gen"],
              [/([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(\s*<:\s*)/, ["type", "keyword"]],
              [/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*/, "type", "@pop"],
              ["", "", "@pop"],
            ],
            gen: [
              [/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*\{/, "type", "@push"],
              [/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*/, "type"],
              [/<:/, "keyword"],
              [/(\})(\s*<:\s*)/, ["type", { token: "keyword", next: "@pop" }]],
              [/\}/, "type", "@pop"],
              { include: "@root" },
            ],
            quote: [
              [/\$\(/, "key", "@paste"],
              [/\(/, "@brackets", "@paren"],
              [/\)/, "metatag", "@pop"],
              { include: "@root" },
            ],
            paste: [
              [/:\(/, "metatag", "@quote"],
              [/\(/, "@brackets", "@paren"],
              [/\)/, "key", "@pop"],
              { include: "@root" },
            ],
            paren: [
              [/\$\(/, "key", "@paste"],
              [/:\(/, "metatag", "@quote"],
              [/\(/, "@brackets", "@push"],
              [/\)/, "@brackets", "@pop"],
              { include: "@root" },
            ],
            sregexp: [
              [/^.*/, "invalid"],
              [/[^\\"()\[\]{}]/, "regexp"],
              [/[()\[\]{}]/, "@brackets"],
              [/\\./, "operator.scss"],
              [/"[imsx]*/, "regexp.delim", "@pop"],
            ],
            tregexp: [
              [/[^\\"()\[\]{}]/, "regexp"],
              [/[()\[\]{}]/, "@brackets"],
              [/\\./, "operator.scss"],
              [/"(?!"")/, "string"],
              [/"""[imsx]*/, "regexp.delim", "@pop"],
            ],
            rsstring: [
              [/^.*/, "invalid"],
              [/[^\\"]/, "string"],
              [/\\./, "string.escape"],
              [/"/, "string.delim", "@pop"],
            ],
            rtstring: [
              [/[^\\"]/, "string"],
              [/\\./, "string.escape"],
              [/"(?!"")/, "string"],
              [/"""/, "string.delim", "@pop"],
            ],
            dsstring: [
              [/^.*/, "invalid"],
              [/[^\\"\$]/, "string"],
              [/\$/, "", "@interpolated"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string.delim", "@pop"],
            ],
            dtstring: [
              [/[^\\"\$]/, "string"],
              [/\$/, "", "@interpolated"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"(?!"")/, "string"],
              [/"""/, "string.delim", "@pop"],
            ],
            interpolated: [
              [/\(/, { token: "", switchTo: "@interpolated_compound" }],
              [/[a-zA-Z_]\w*/, "identifier"],
              ["", "", "@pop"],
            ],
            interpolated_compound: [[/\)/, "", "@pop"], { include: "@root" }],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/#=/, "comment", "@multi_comment"],
              [/#.*$/, "comment"],
            ],
            multi_comment: [
              [/#=/, "comment", "@push"],
              [/=#/, "comment", "@pop"],
              [/=(?!#)|#(?!=)/, "comment"],
              [/[^#=]+/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  g3e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: "<", close: ">" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
        end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))"),
      },
    },
  },
  p3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: g3e,
        language: {
          defaultToken: "",
          tokenPostfix: ".kt",
          keywords: [
            "as",
            "as?",
            "break",
            "class",
            "continue",
            "do",
            "else",
            "false",
            "for",
            "fun",
            "if",
            "in",
            "!in",
            "interface",
            "is",
            "!is",
            "null",
            "object",
            "package",
            "return",
            "super",
            "this",
            "throw",
            "true",
            "try",
            "typealias",
            "val",
            "var",
            "when",
            "while",
            "by",
            "catch",
            "constructor",
            "delegate",
            "dynamic",
            "field",
            "file",
            "finally",
            "get",
            "import",
            "init",
            "param",
            "property",
            "receiver",
            "set",
            "setparam",
            "where",
            "actual",
            "abstract",
            "annotation",
            "companion",
            "const",
            "crossinline",
            "data",
            "enum",
            "expect",
            "external",
            "final",
            "infix",
            "inline",
            "inner",
            "internal",
            "lateinit",
            "noinline",
            "open",
            "operator",
            "out",
            "override",
            "private",
            "protected",
            "public",
            "reified",
            "sealed",
            "suspend",
            "tailrec",
            "vararg",
            "field",
            "it",
          ],
          operators: [
            "+",
            "-",
            "*",
            "/",
            "%",
            "=",
            "+=",
            "-=",
            "*=",
            "/=",
            "%=",
            "++",
            "--",
            "&&",
            "||",
            "!",
            "==",
            "!=",
            "===",
            "!==",
            ">",
            "<",
            "<=",
            ">=",
            "[",
            "]",
            "!!",
            "?.",
            "?:",
            "::",
            "..",
            ":",
            "?",
            "->",
            "@",
            ";",
            "$",
            "_",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          digits: /\d+(_+\d+)*/,
          octaldigits: /[0-7]+(_+[0-7]+)*/,
          binarydigits: /[0-1]+(_+[0-1]+)*/,
          hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
          tokenizer: {
            root: [
              [/[A-Z][\w\$]*/, "type.identifier"],
              [
                /[a-zA-Z_$][\w$]*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/@\s*[a-zA-Z_\$][\w\$]*/, "annotation"],
              [/(@digits)[eE]([\-+]?(@digits))?[fF]?/, "number.float"],
              [/(@digits)?\.(@digits)([eE][\-+]?(@digits))?[fF]?/, "number.float"],
              [/0[xX](@hexdigits)[uU]?L?/, "number.hex"],
              [/0[bB](@binarydigits)[uU]?L?/, "number.binary"],
              [/(@digits)[fF]/, "number.float"],
              [/(@digits)[uU]?L?/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"""/, "string", "@multistring"],
              [/"/, "string", "@string"],
              [/'[^\\']'/, "string"],
              [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
              [/'/, "string.invalid"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*\*(?!\/)/, "comment.doc", "@javadoc"],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\/\*/, "comment", "@comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            javadoc: [
              [/[^\/*]+/, "comment.doc"],
              [/\/\*/, "comment.doc", "@push"],
              [/\/\*/, "comment.doc.invalid"],
              [/\*\//, "comment.doc", "@pop"],
              [/[\/*]/, "comment.doc"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
            multistring: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"""/, "string", "@pop"],
              [/./, "string"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  f3e = {
    wordPattern: /(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,
    comments: { blockComment: ["/*", "*/"], lineComment: "//" },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}", notIn: ["string", "comment"] },
      { open: "[", close: "]", notIn: ["string", "comment"] },
      { open: "(", close: ")", notIn: ["string", "comment"] },
      { open: '"', close: '"', notIn: ["string", "comment"] },
      { open: "'", close: "'", notIn: ["string", "comment"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
        end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/"),
      },
    },
  },
  m3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: f3e,
        language: {
          defaultToken: "",
          tokenPostfix: ".less",
          identifier:
            "-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",
          identifierPlus:
            "-?-?([a-zA-Z:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",
          brackets: [
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.bracket" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "<", close: ">", token: "delimiter.angle" },
          ],
          tokenizer: {
            root: [
              { include: "@nestedJSBegin" },
              ["[ \\t\\r\\n]+", ""],
              { include: "@comments" },
              { include: "@keyword" },
              { include: "@strings" },
              { include: "@numbers" },
              ["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))", "attribute.name", "@attribute"],
              ["url(\\-prefix)?\\(", { token: "tag", next: "@urldeclaration" }],
              ["[{}()\\[\\]]", "@brackets"],
              ["[,:;]", "delimiter"],
              ["#@identifierPlus", "tag.id"],
              ["&", "tag"],
              ["\\.@identifierPlus(?=\\()", "tag.class", "@attribute"],
              ["\\.@identifierPlus", "tag.class"],
              ["@identifierPlus", "tag"],
              { include: "@operators" },
              ["@(@identifier(?=[:,\\)]))", "variable", "@attribute"],
              ["@(@identifier)", "variable"],
              ["@", "key", "@atRules"],
            ],
            nestedJSBegin: [
              ["``", "delimiter.backtick"],
              [
                "`",
                {
                  token: "delimiter.backtick",
                  next: "@nestedJSEnd",
                  nextEmbedded: "text/javascript",
                },
              ],
            ],
            nestedJSEnd: [
              ["`", { token: "delimiter.backtick", next: "@pop", nextEmbedded: "@pop" }],
            ],
            operators: [["[<>=\\+\\-\\*\\/\\^\\|\\~]", "operator"]],
            keyword: [
              [
                "(@[\\s]*import|![\\s]*important|true|false|when|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|hue|saturation|lightness|alpha|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|round|ceil|floor|percentage)\\b",
                "keyword",
              ],
            ],
            urldeclaration: [
              { include: "@strings" },
              ["[^)\r\n]+", "string"],
              ["\\)", { token: "tag", next: "@pop" }],
            ],
            attribute: [
              { include: "@nestedJSBegin" },
              { include: "@comments" },
              { include: "@strings" },
              { include: "@numbers" },
              { include: "@keyword" },
              ["[a-zA-Z\\-]+(?=\\()", "attribute.value", "@attribute"],
              [">", "operator", "@pop"],
              ["@identifier", "attribute.value"],
              { include: "@operators" },
              ["@(@identifier)", "variable"],
              ["[)\\}]", "@brackets", "@pop"],
              ["[{}()\\[\\]>]", "@brackets"],
              ["[;]", "delimiter", "@pop"],
              ["[,=:]", "delimiter"],
              ["\\s", ""],
              [".", "attribute.value"],
            ],
            comments: [
              ["\\/\\*", "comment", "@comment"],
              ["\\/\\/+.*", "comment"],
            ],
            comment: [
              ["\\*\\/", "comment", "@pop"],
              [".", "comment"],
            ],
            numbers: [
              [
                "(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",
                { token: "attribute.value.number", next: "@units" },
              ],
              ["#[0-9a-fA-F_]+(?!\\w)", "attribute.value.hex"],
            ],
            units: [
              [
                "(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?",
                "attribute.value.unit",
                "@pop",
              ],
            ],
            strings: [
              ['~?"', { token: "string.delimiter", next: "@stringsEndDoubleQuote" }],
              ["~?'", { token: "string.delimiter", next: "@stringsEndQuote" }],
            ],
            stringsEndDoubleQuote: [
              ['\\\\"', "string"],
              ['"', { token: "string.delimiter", next: "@popall" }],
              [".", "string"],
            ],
            stringsEndQuote: [
              ["\\\\'", "string"],
              ["'", { token: "string.delimiter", next: "@popall" }],
              [".", "string"],
            ],
            atRules: [
              { include: "@comments" },
              { include: "@strings" },
              ["[()]", "delimiter"],
              ["[\\{;]", "delimiter", "@pop"],
              [".", "key"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  _3e = {
    comments: { lineComment: "COMMENT" },
    brackets: [["(", ")"]],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: ":", close: "." },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "`", close: "`" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: ":", close: "." },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*(::\\s*|COMMENT\\s+)#region"),
        end: new RegExp("^\\s*(::\\s*|COMMENT\\s+)#endregion"),
      },
    },
  },
  v3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: _3e,
        language: {
          tokenPostfix: ".lexon",
          ignoreCase: !0,
          keywords: [
            "lexon",
            "lex",
            "clause",
            "terms",
            "contracts",
            "may",
            "pay",
            "pays",
            "appoints",
            "into",
            "to",
          ],
          typeKeywords: ["amount", "person", "key", "time", "date", "asset", "text"],
          operators: [
            "less",
            "greater",
            "equal",
            "le",
            "gt",
            "or",
            "and",
            "add",
            "added",
            "subtract",
            "subtracted",
            "multiply",
            "multiplied",
            "times",
            "divide",
            "divided",
            "is",
            "be",
            "certified",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          tokenizer: {
            root: [
              [/^(\s*)(comment:?(?:\s.*|))$/, ["", "comment"]],
              [/"/, { token: "identifier.quote", bracket: "@open", next: "@quoted_identifier" }],
              ["LEX$", { token: "keyword", bracket: "@open", next: "@identifier_until_period" }],
              ["LEXON", { token: "keyword", bracket: "@open", next: "@semver" }],
              [":", { token: "delimiter", bracket: "@open", next: "@identifier_until_period" }],
              [
                /[a-z_$][\w$]*/,
                {
                  cases: {
                    "@operators": "operator",
                    "@typeKeywords": "keyword.type",
                    "@keywords": "keyword",
                    "@default": "identifier",
                  },
                },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, "delimiter"],
              [/\d*\.\d*\.\d*/, "number.semver"],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F]+/, "number.hex"],
              [/\d+/, "number"],
              [/[;,.]/, "delimiter"],
            ],
            quoted_identifier: [
              [/[^\\"]+/, "identifier"],
              [/"/, { token: "identifier.quote", bracket: "@close", next: "@pop" }],
            ],
            space_identifier_until_period: [
              [":", "delimiter"],
              [" ", { token: "white", next: "@identifier_rest" }],
            ],
            identifier_until_period: [
              { include: "@whitespace" },
              [":", { token: "delimiter", next: "@identifier_rest" }],
              [/[^\\.]+/, "identifier"],
              [/\./, { token: "delimiter", bracket: "@close", next: "@pop" }],
            ],
            identifier_rest: [
              [/[^\\.]+/, "identifier"],
              [/\./, { token: "delimiter", bracket: "@close", next: "@pop" }],
            ],
            semver: [
              { include: "@whitespace" },
              [":", "delimiter"],
              [/\d*\.\d*\.\d*/, { token: "number.semver", bracket: "@close", next: "@pop" }],
            ],
            whitespace: [[/[ \t\r\n]+/, "white"]],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  b3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "--", blockComment: ["--[[", "]]"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".lua",
          keywords: [
            "and",
            "break",
            "do",
            "else",
            "elseif",
            "end",
            "false",
            "for",
            "function",
            "goto",
            "if",
            "in",
            "local",
            "nil",
            "not",
            "or",
            "repeat",
            "return",
            "then",
            "true",
            "until",
            "while",
          ],
          brackets: [
            { token: "delimiter.bracket", open: "{", close: "}" },
            { token: "delimiter.array", open: "[", close: "]" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
          ],
          operators: [
            "+",
            "-",
            "*",
            "/",
            "%",
            "^",
            "#",
            "==",
            "~=",
            "<=",
            ">=",
            "<",
            ">",
            "=",
            ";",
            ":",
            ",",
            ".",
            "..",
            "...",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_]\w*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/(,)(\s*)([a-zA-Z_]\w*)(\s*)(:)(?!:)/, ["delimiter", "", "key", "", "delimiter"]],
              [/({)(\s*)([a-zA-Z_]\w*)(\s*)(:)(?!:)/, ["@brackets", "", "key", "", "delimiter"]],
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/, "number.hex"],
              [/\d+?/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/'([^'\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", '@string."'],
              [/'/, "string", "@string.'"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/--\[([=]*)\[/, "comment", "@comment.$1"],
              [/--.*$/, "comment"],
            ],
            comment: [
              [/[^\]]+/, "comment"],
              [
                /\]([=]*)\]/,
                { cases: { "$1==$S2": { token: "comment", next: "@pop" }, "@default": "comment" } },
              ],
              [/./, "comment"],
            ],
            string: [
              [/[^\\"']+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [
                /["']/,
                { cases: { "$#==$S2": { token: "string", next: "@pop" }, "@default": "string" } },
              ],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  y3e = [
    "area",
    "base",
    "br",
    "col",
    "embed",
    "hr",
    "img",
    "input",
    "keygen",
    "link",
    "menuitem",
    "meta",
    "param",
    "source",
    "track",
    "wbr",
  ],
  x3e = {
    wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
    brackets: [
      ["\x3c!--", "--\x3e"],
      ["<", ">"],
      ["{{", "}}"],
      ["{%", "%}"],
      ["{", "}"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "%", close: "%" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "<", close: ">" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    onEnterRules: [
      {
        beforeText: new RegExp(`<(?!(?:${y3e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
        afterText: /^<\/(\w[\w\d]*)\s*>$/i,
        action: { indentAction: VGe.IndentAction.IndentOutdent },
      },
      {
        beforeText: new RegExp(`<(?!(?:${y3e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
        action: { indentAction: VGe.IndentAction.Indent },
      },
    ],
  },
  w3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: x3e,
        language: {
          defaultToken: "",
          tokenPostfix: "",
          builtinTags: [
            "if",
            "else",
            "elseif",
            "endif",
            "render",
            "assign",
            "capture",
            "endcapture",
            "case",
            "endcase",
            "comment",
            "endcomment",
            "cycle",
            "decrement",
            "for",
            "endfor",
            "include",
            "increment",
            "layout",
            "raw",
            "endraw",
            "render",
            "tablerow",
            "endtablerow",
            "unless",
            "endunless",
          ],
          builtinFilters: [
            "abs",
            "append",
            "at_least",
            "at_most",
            "capitalize",
            "ceil",
            "compact",
            "date",
            "default",
            "divided_by",
            "downcase",
            "escape",
            "escape_once",
            "first",
            "floor",
            "join",
            "json",
            "last",
            "lstrip",
            "map",
            "minus",
            "modulo",
            "newline_to_br",
            "plus",
            "prepend",
            "remove",
            "remove_first",
            "replace",
            "replace_first",
            "reverse",
            "round",
            "rstrip",
            "size",
            "slice",
            "sort",
            "sort_natural",
            "split",
            "strip",
            "strip_html",
            "strip_newlines",
            "times",
            "truncate",
            "truncatewords",
            "uniq",
            "upcase",
            "url_decode",
            "url_encode",
            "where",
          ],
          constants: ["true", "false"],
          operators: ["==", "!=", ">", "<", ">=", "<="],
          symbol: /[=><!]+/,
          identifier: /[a-zA-Z_][\w]*/,
          tokenizer: {
            root: [
              [/\{\%\s*comment\s*\%\}/, "comment.start.liquid", "@comment"],
              [/\{\{/, { token: "@rematch", switchTo: "@liquidState.root" }],
              [/\{\%/, { token: "@rematch", switchTo: "@liquidState.root" }],
              [/(<)([\w\-]+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
              [/(<)([:\w]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
              [/(<\/)([\w\-]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
              [/</, "delimiter.html"],
              [/\{/, "delimiter.html"],
              [/[^<{]+/],
            ],
            comment: [
              [/\{\%\s*endcomment\s*\%\}/, "comment.end.liquid", "@pop"],
              [/./, "comment.content.liquid"],
            ],
            otherTag: [
              [/\{\{/, { token: "@rematch", switchTo: "@liquidState.otherTag" }],
              [/\{\%/, { token: "@rematch", switchTo: "@liquidState.otherTag" }],
              [/\/?>/, "delimiter.html", "@pop"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
            ],
            liquidState: [
              [/\{\{/, "delimiter.output.liquid"],
              [/\}\}/, { token: "delimiter.output.liquid", switchTo: "@$S2.$S3" }],
              [/\{\%/, "delimiter.tag.liquid"],
              [/raw\s*\%\}/, "delimiter.tag.liquid", "@liquidRaw"],
              [/\%\}/, { token: "delimiter.tag.liquid", switchTo: "@$S2.$S3" }],
              { include: "liquidRoot" },
            ],
            liquidRaw: [
              [/^(?!\{\%\s*endraw\s*\%\}).+/],
              [/\{\%/, "delimiter.tag.liquid"],
              [/@identifier/],
              [/\%\}/, { token: "delimiter.tag.liquid", next: "@root" }],
            ],
            liquidRoot: [
              [/\d+(\.\d+)?/, "number.liquid"],
              [/"[^"]*"/, "string.liquid"],
              [/'[^']*'/, "string.liquid"],
              [/\s+/],
              [/@symbol/, { cases: { "@operators": "operator.liquid", "@default": "" } }],
              [/\./],
              [
                /@identifier/,
                {
                  cases: {
                    "@constants": "keyword.liquid",
                    "@builtinFilters": "predefined.liquid",
                    "@builtinTags": "predefined.liquid",
                    "@default": "variable.liquid",
                  },
                },
              ],
              [/[^}|%]/, "variable.liquid"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  C3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { blockComment: ["(*", "*)"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "[", close: "]" },
            { open: "{", close: "}" },
            { open: "(", close: ")" },
            { open: "(*", close: "*)" },
            { open: "<*", close: "*>" },
            { open: "'", close: "'", notIn: ["string", "comment"] },
            { open: '"', close: '"', notIn: ["string", "comment"] },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".m3",
          brackets: [
            { token: "delimiter.curly", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
          ],
          keywords: [
            "AND",
            "ANY",
            "ARRAY",
            "AS",
            "BEGIN",
            "BITS",
            "BRANDED",
            "BY",
            "CASE",
            "CONST",
            "DIV",
            "DO",
            "ELSE",
            "ELSIF",
            "END",
            "EVAL",
            "EXCEPT",
            "EXCEPTION",
            "EXIT",
            "EXPORTS",
            "FINALLY",
            "FOR",
            "FROM",
            "GENERIC",
            "IF",
            "IMPORT",
            "IN",
            "INTERFACE",
            "LOCK",
            "LOOP",
            "METHODS",
            "MOD",
            "MODULE",
            "NOT",
            "OBJECT",
            "OF",
            "OR",
            "OVERRIDES",
            "PROCEDURE",
            "RAISE",
            "RAISES",
            "READONLY",
            "RECORD",
            "REF",
            "REPEAT",
            "RETURN",
            "REVEAL",
            "SET",
            "THEN",
            "TO",
            "TRY",
            "TYPE",
            "TYPECASE",
            "UNSAFE",
            "UNTIL",
            "UNTRACED",
            "VALUE",
            "VAR",
            "WHILE",
            "WITH",
          ],
          reservedConstNames: [
            "ABS",
            "ADR",
            "ADRSIZE",
            "BITSIZE",
            "BYTESIZE",
            "CEILING",
            "DEC",
            "DISPOSE",
            "FALSE",
            "FIRST",
            "FLOAT",
            "FLOOR",
            "INC",
            "ISTYPE",
            "LAST",
            "LOOPHOLE",
            "MAX",
            "MIN",
            "NARROW",
            "NEW",
            "NIL",
            "NUMBER",
            "ORD",
            "ROUND",
            "SUBARRAY",
            "TRUE",
            "TRUNC",
            "TYPECODE",
            "VAL",
          ],
          reservedTypeNames: [
            "ADDRESS",
            "ANY",
            "BOOLEAN",
            "CARDINAL",
            "CHAR",
            "EXTENDED",
            "INTEGER",
            "LONGCARD",
            "LONGINT",
            "LONGREAL",
            "MUTEX",
            "NULL",
            "REAL",
            "REFANY",
            "ROOT",
            "TEXT",
          ],
          operators: ["+", "-", "*", "/", "&", "^", "."],
          relations: ["=", "#", "<", "<=", ">", ">=", "<:", ":"],
          delimiters: ["|", "..", "=>", ",", ";", ":="],
          symbols: /[>=<#.,:;+\-*/&^]+/,
          escapes: /\\(?:[\\fnrt"']|[0-7]{3})/,
          tokenizer: {
            root: [
              [/_\w*/, "invalid"],
              [
                /[a-zA-Z][a-zA-Z0-9_]*/,
                {
                  cases: {
                    "@keywords": { token: "keyword.$0" },
                    "@reservedConstNames": { token: "constant.reserved.$0" },
                    "@reservedTypeNames": { token: "type.reserved.$0" },
                    "@default": "identifier",
                  },
                },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/[0-9]+\.[0-9]+(?:[DdEeXx][\+\-]?[0-9]+)?/, "number.float"],
              [/[0-9]+(?:\_[0-9a-fA-F]+)?L?/, "number"],
              [
                /@symbols/,
                {
                  cases: {
                    "@operators": "operators",
                    "@relations": "operators",
                    "@delimiters": "delimiter",
                    "@default": "invalid",
                  },
                },
              ],
              [/'[^\\']'/, "string.char"],
              [/(')(@escapes)(')/, ["string.char", "string.escape", "string.char"]],
              [/'/, "invalid"],
              [/"([^"\\]|\\.)*$/, "invalid"],
              [/"/, "string.text", "@text"],
            ],
            text: [
              [/[^\\"]+/, "string.text"],
              [/@escapes/, "string.escape"],
              [/\\./, "invalid"],
              [/"/, "string.text", "@pop"],
            ],
            comment: [
              [/\(\*/, "comment", "@push"],
              [/\*\)/, "comment", "@pop"],
              [/./, "comment"],
            ],
            pragma: [
              [/<\*/, "keyword.pragma", "@push"],
              [/\*>/, "keyword.pragma", "@pop"],
              [/./, "keyword.pragma"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/\(\*/, "comment", "@comment"],
              [/<\*/, "keyword.pragma", "@pragma"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  S3e = {
    comments: { blockComment: ["\x3c!--", "--\x3e"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">", notIn: ["string"] },
    ],
    surroundingPairs: [
      { open: "(", close: ")" },
      { open: "[", close: "]" },
      { open: "`", close: "`" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),
        end: new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e"),
      },
    },
  },
  k3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: S3e,
        language: {
          defaultToken: "",
          tokenPostfix: ".md",
          control: /[\\`*_\[\]{}()#+\-\.!]/,
          noncontrol: /[^\\`*_\[\]{}()#+\-\.!]/,
          escapes: /\\(?:@control)/,
          jsescapes: /\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,
          empty: [
            "area",
            "base",
            "basefont",
            "br",
            "col",
            "frame",
            "hr",
            "img",
            "input",
            "isindex",
            "link",
            "meta",
            "param",
          ],
          tokenizer: {
            root: [
              [/^\s*\|/, "@rematch", "@table_header"],
              [
                /^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/,
                ["white", "keyword", "keyword", "keyword"],
              ],
              [/^\s*(=+|\-+)\s*$/, "keyword"],
              [/^\s*((\*[ ]?)+)\s*$/, "meta.separator"],
              [/^\s*>+/, "comment"],
              [/^\s*([\*\-+:]|\d+\.)\s/, "keyword"],
              [/^(\t|[ ]{4})[^ ].*$/, "string"],
              [/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/, { token: "string", next: "@codeblock" }],
              [
                /^\s*```\s*((?:\w|[\/\-#])+).*$/,
                { token: "string", next: "@codeblockgh", nextEmbedded: "$1" },
              ],
              [/^\s*```\s*$/, { token: "string", next: "@codeblock" }],
              { include: "@linecontent" },
            ],
            table_header: [{ include: "@table_common" }, [/[^\|]+/, "keyword.table.header"]],
            table_body: [{ include: "@table_common" }, { include: "@linecontent" }],
            table_common: [
              [/\s*[\-:]+\s*/, { token: "keyword", switchTo: "table_body" }],
              [/^\s*\|/, "keyword.table.left"],
              [/^\s*[^\|]/, "@rematch", "@pop"],
              [/^\s*$/, "@rematch", "@pop"],
              [
                /\|/,
                { cases: { "@eos": "keyword.table.right", "@default": "keyword.table.middle" } },
              ],
            ],
            codeblock: [
              [/^\s*~~~\s*$/, { token: "string", next: "@pop" }],
              [/^\s*```\s*$/, { token: "string", next: "@pop" }],
              [/.*$/, "variable.source"],
            ],
            codeblockgh: [
              [/```\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
              [/[^`]+/, "variable.source"],
            ],
            linecontent: [
              [/&\w+;/, "string.escape"],
              [/@escapes/, "escape"],
              [/\b__([^\\_]|@escapes|_(?!_))+__\b/, "strong"],
              [/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/, "strong"],
              [/\b_[^_]+_\b/, "emphasis"],
              [/\*([^\\*]|@escapes)+\*/, "emphasis"],
              [/`([^\\`]|@escapes)+`/, "variable"],
              [/\{+[^}]+\}+/, "string.target"],
              [/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/, ["string.link", "", "string.link"]],
              [/(!?\[)((?:[^\]\\]|@escapes)*)(\])/, "string.link"],
              { include: "html" },
            ],
            html: [
              [/<(\w+)\/>/, "tag"],
              [
                /<(\w+)(\-|\w)*/,
                {
                  cases: {
                    "@empty": { token: "tag", next: "@tag.$1" },
                    "@default": { token: "tag", next: "@tag.$1" },
                  },
                },
              ],
              [/<\/(\w+)(\-|\w)*\s*>/, { token: "tag" }],
              [/<!--/, "comment", "@comment"],
            ],
            comment: [
              [/[^<\-]+/, "comment.content"],
              [/-->/, "comment", "@pop"],
              [/<!--/, "comment.content.invalid"],
              [/[<\-]/, "comment.content"],
            ],
            tag: [
              [/[ \t\r\n]+/, "white"],
              [
                /(type)(\s*=\s*)(")([^"]+)(")/,
                [
                  "attribute.name.html",
                  "delimiter.html",
                  "string.html",
                  { token: "string.html", switchTo: "@tag.$S2.$4" },
                  "string.html",
                ],
              ],
              [
                /(type)(\s*=\s*)(')([^']+)(')/,
                [
                  "attribute.name.html",
                  "delimiter.html",
                  "string.html",
                  { token: "string.html", switchTo: "@tag.$S2.$4" },
                  "string.html",
                ],
              ],
              [
                /(\w+)(\s*=\s*)("[^"]*"|'[^']*')/,
                ["attribute.name.html", "delimiter.html", "string.html"],
              ],
              [/\w+/, "attribute.name.html"],
              [/\/>/, "tag", "@pop"],
              [
                />/,
                {
                  cases: {
                    "$S2==style": {
                      token: "tag",
                      switchTo: "embeddedStyle",
                      nextEmbedded: "text/css",
                    },
                    "$S2==script": {
                      cases: {
                        $S3: { token: "tag", switchTo: "embeddedScript", nextEmbedded: "$S3" },
                        "@default": {
                          token: "tag",
                          switchTo: "embeddedScript",
                          nextEmbedded: "text/javascript",
                        },
                      },
                    },
                    "@default": { token: "tag", next: "@pop" },
                  },
                },
              ],
            ],
            embeddedStyle: [
              [/[^<]+/, ""],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
              [/</, ""],
            ],
            embeddedScript: [
              [/[^<]+/, ""],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
              [/</, ""],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  E3e = {
    comments: { blockComment: ["{/*", "*/}"] },
    brackets: [["{", "}"]],
    autoClosingPairs: [
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: "“", close: "”" },
      { open: "‘", close: "’" },
      { open: "`", close: "`" },
      { open: "{", close: "}" },
      { open: "(", close: ")" },
      { open: "_", close: "_" },
      { open: "**", close: "**" },
      { open: "<", close: ">" },
    ],
    onEnterRules: [
      { beforeText: /^\s*- .+/, action: { indentAction: VGe.IndentAction.None, appendText: "- " } },
      {
        beforeText: /^\s*\+ .+/,
        action: { indentAction: VGe.IndentAction.None, appendText: "+ " },
      },
      {
        beforeText: /^\s*\* .+/,
        action: { indentAction: VGe.IndentAction.None, appendText: "* " },
      },
      { beforeText: /^> /, action: { indentAction: VGe.IndentAction.None, appendText: "> " } },
      { beforeText: /<\w+/, action: { indentAction: VGe.IndentAction.Indent } },
      { beforeText: /\s+>\s*$/, action: { indentAction: VGe.IndentAction.Indent } },
      { beforeText: /<\/\w+>/, action: { indentAction: VGe.IndentAction.Outdent } },
      ...Array.from({ length: 100 }, (e, t) => ({
        beforeText: new RegExp(`^${t}\\. .+`),
        action: { indentAction: VGe.IndentAction.None, appendText: `${t + 1}. ` },
      })),
    ],
  },
  N3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: E3e,
        language: {
          defaultToken: "",
          tokenPostfix: ".mdx",
          control: /[!#()*+.[\\\]_`{}\-]/,
          escapes: /\\@control/,
          tokenizer: {
            root: [
              [/^---$/, { token: "meta.content", next: "@frontmatter", nextEmbedded: "yaml" }],
              [/^\s*import/, { token: "keyword", next: "@import", nextEmbedded: "js" }],
              [/^\s*export/, { token: "keyword", next: "@export", nextEmbedded: "js" }],
              [/<\w+/, { token: "type.identifier", next: "@jsx" }],
              [/<\/?\w+>/, "type.identifier"],
              [
                /^(\s*)(>*\s*)(#{1,6}\s)/,
                [{ token: "white" }, { token: "comment" }, { token: "keyword", next: "@header" }],
              ],
              [/^(\s*)(>*\s*)([*+-])(\s+)/, ["white", "comment", "keyword", "white"]],
              [/^(\s*)(>*\s*)(\d{1,9}\.)(\s+)/, ["white", "comment", "number", "white"]],
              [/^(\s*)(>*\s*)(\d{1,9}\.)(\s+)/, ["white", "comment", "number", "white"]],
              [/^(\s*)(>*\s*)(-{3,}|\*{3,}|_{3,})$/, ["white", "comment", "keyword"]],
              [/`{3,}(\s.*)?$/, { token: "string", next: "@codeblock_backtick" }],
              [/~{3,}(\s.*)?$/, { token: "string", next: "@codeblock_tilde" }],
              [
                /`{3,}(\S+).*$/,
                { token: "string", next: "@codeblock_highlight_backtick", nextEmbedded: "$1" },
              ],
              [
                /~{3,}(\S+).*$/,
                { token: "string", next: "@codeblock_highlight_tilde", nextEmbedded: "$1" },
              ],
              [/^(\s*)(-{4,})$/, ["white", "comment"]],
              [/^(\s*)(>+)/, ["white", "comment"]],
              { include: "content" },
            ],
            content: [
              [
                /(\[)(.+)(]\()(.+)(\s+".*")(\))/,
                ["", "string.link", "", "type.identifier", "string.link", ""],
              ],
              [/(\[)(.+)(]\()(.+)(\))/, ["", "type.identifier", "", "string.link", ""]],
              [/(\[)(.+)(]\[)(.+)(])/, ["", "type.identifier", "", "type.identifier", ""]],
              [/(\[)(.+)(]:\s+)(\S*)/, ["", "type.identifier", "", "string.link"]],
              [/(\[)(.+)(])/, ["", "type.identifier", ""]],
              [/`.*`/, "variable.source"],
              [/_/, { token: "emphasis", next: "@emphasis_underscore" }],
              [/\*(?!\*)/, { token: "emphasis", next: "@emphasis_asterisk" }],
              [/\*\*/, { token: "strong", next: "@strong" }],
              [/{/, { token: "delimiter.bracket", next: "@expression", nextEmbedded: "js" }],
            ],
            import: [[/'\s*(;|$)/, { token: "string", next: "@pop", nextEmbedded: "@pop" }]],
            expression: [
              [/{/, { token: "delimiter.bracket", next: "@expression" }],
              [/}/, { token: "delimiter.bracket", next: "@pop", nextEmbedded: "@pop" }],
            ],
            export: [[/^\s*$/, { token: "delimiter.bracket", next: "@pop", nextEmbedded: "@pop" }]],
            jsx: [
              [/\s+/, ""],
              [/(\w+)(=)("(?:[^"\\]|\\.)*")/, ["attribute.name", "operator", "string"]],
              [/(\w+)(=)('(?:[^'\\]|\\.)*')/, ["attribute.name", "operator", "string"]],
              [/(\w+(?=\s|>|={|$))/, ["attribute.name"]],
              [/={/, { token: "delimiter.bracket", next: "@expression", nextEmbedded: "js" }],
              [/>/, { token: "type.identifier", next: "@pop" }],
            ],
            header: [
              [/.$/, { token: "keyword", next: "@pop" }],
              { include: "content" },
              [/./, { token: "keyword" }],
            ],
            strong: [
              [/\*\*/, { token: "strong", next: "@pop" }],
              { include: "content" },
              [/./, { token: "strong" }],
            ],
            emphasis_underscore: [
              [/_/, { token: "emphasis", next: "@pop" }],
              { include: "content" },
              [/./, { token: "emphasis" }],
            ],
            emphasis_asterisk: [
              [/\*(?!\*)/, { token: "emphasis", next: "@pop" }],
              { include: "content" },
              [/./, { token: "emphasis" }],
            ],
            frontmatter: [[/^---$/, { token: "meta.content", nextEmbedded: "@pop", next: "@pop" }]],
            codeblock_highlight_backtick: [
              [/\s*`{3,}\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
              [/.*$/, "variable.source"],
            ],
            codeblock_highlight_tilde: [
              [/\s*~{3,}\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
              [/.*$/, "variable.source"],
            ],
            codeblock_backtick: [
              [/\s*`{3,}\s*$/, { token: "string", next: "@pop" }],
              [/.*$/, "variable.source"],
            ],
            codeblock_tilde: [
              [/\s*~{3,}\s*$/, { token: "string", next: "@pop" }],
              [/.*$/, "variable.source"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  L3e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { blockComment: ["###", "###"], lineComment: "#" },
    folding: {
      markers: { start: new RegExp("^\\s*#region\\b"), end: new RegExp("^\\s*#endregion\\b") },
    },
  },
  D3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: L3e,
        language: {
          defaultToken: "",
          ignoreCase: !1,
          tokenPostfix: ".mips",
          regEx: /\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,
          keywords: [
            ".data",
            ".text",
            "syscall",
            "trap",
            "add",
            "addu",
            "addi",
            "addiu",
            "and",
            "andi",
            "div",
            "divu",
            "mult",
            "multu",
            "nor",
            "or",
            "ori",
            "sll",
            "slv",
            "sra",
            "srav",
            "srl",
            "srlv",
            "sub",
            "subu",
            "xor",
            "xori",
            "lhi",
            "lho",
            "lhi",
            "llo",
            "slt",
            "slti",
            "sltu",
            "sltiu",
            "beq",
            "bgtz",
            "blez",
            "bne",
            "j",
            "jal",
            "jalr",
            "jr",
            "lb",
            "lbu",
            "lh",
            "lhu",
            "lw",
            "li",
            "la",
            "sb",
            "sh",
            "sw",
            "mfhi",
            "mflo",
            "mthi",
            "mtlo",
            "move",
          ],
          symbols: /[\.,\:]+/,
          escapes: /\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [/\$[a-zA-Z_]\w*/, "variable.predefined"],
              [
                /[.a-zA-Z_]\w*/,
                {
                  cases: {
                    this: "variable.predefined",
                    "@keywords": { token: "keyword.$0" },
                    "@default": "",
                  },
                },
              ],
              [/[ \t\r\n]+/, ""],
              [/#.*$/, "comment"],
              ["///", { token: "regexp", next: "@hereregexp" }],
              [/^(\s*)(@regEx)/, ["", "regexp"]],
              [/(\,)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
              [/(\:)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
              [/@symbols/, "delimiter"],
              [/\d+[eE]([\-+]?\d+)?/, "number.float"],
              [/\d+\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F]+/, "number.hex"],
              [/0[0-7]+(?!\d)/, "number.octal"],
              [/\d+/, "number"],
              [/[,.]/, "delimiter"],
              [/"""/, "string", '@herestring."""'],
              [/'''/, "string", "@herestring.'''"],
              [
                /"/,
                { cases: { "@eos": "string", "@default": { token: "string", next: '@string."' } } },
              ],
              [
                /'/,
                { cases: { "@eos": "string", "@default": { token: "string", next: "@string.'" } } },
              ],
            ],
            string: [
              [/[^"'\#\\]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\./, "string.escape.invalid"],
              [/\./, "string.escape.invalid"],
              [
                /#{/,
                {
                  cases: {
                    '$S2=="': { token: "string", next: "root.interpolatedstring" },
                    "@default": "string",
                  },
                },
              ],
              [
                /["']/,
                { cases: { "$#==$S2": { token: "string", next: "@pop" }, "@default": "string" } },
              ],
              [/#/, "string"],
            ],
            herestring: [
              [
                /("""|''')/,
                { cases: { "$1==$S2": { token: "string", next: "@pop" }, "@default": "string" } },
              ],
              [/[^#\\'"]+/, "string"],
              [/['"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\./, "string.escape.invalid"],
              [/#{/, { token: "string.quote", next: "root.interpolatedstring" }],
              [/#/, "string"],
            ],
            comment: [
              [/[^#]+/, "comment"],
              [/#/, "comment"],
            ],
            hereregexp: [
              [/[^\\\/#]+/, "regexp"],
              [/\\./, "regexp"],
              [/#.*$/, "comment"],
              ["///[igm]*", { token: "regexp", next: "@pop" }],
              [/\//, "regexp"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  T3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["[", "]"],
            ["(", ")"],
            ["{", "}"],
          ],
          autoClosingPairs: [
            { open: '"', close: '"', notIn: ["string", "comment"] },
            { open: "'", close: "'", notIn: ["string", "comment"] },
            { open: "[", close: "]", notIn: ["string", "comment"] },
            { open: "(", close: ")", notIn: ["string", "comment"] },
            { open: "{", close: "}", notIn: ["string", "comment"] },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".msdax",
          ignoreCase: !0,
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "{", close: "}", token: "delimiter.brackets" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          keywords: [
            "VAR",
            "RETURN",
            "NOT",
            "EVALUATE",
            "DATATABLE",
            "ORDER",
            "BY",
            "START",
            "AT",
            "DEFINE",
            "MEASURE",
            "ASC",
            "DESC",
            "IN",
            "BOOLEAN",
            "DOUBLE",
            "INTEGER",
            "DATETIME",
            "CURRENCY",
            "STRING",
          ],
          functions: [
            "CLOSINGBALANCEMONTH",
            "CLOSINGBALANCEQUARTER",
            "CLOSINGBALANCEYEAR",
            "DATEADD",
            "DATESBETWEEN",
            "DATESINPERIOD",
            "DATESMTD",
            "DATESQTD",
            "DATESYTD",
            "ENDOFMONTH",
            "ENDOFQUARTER",
            "ENDOFYEAR",
            "FIRSTDATE",
            "FIRSTNONBLANK",
            "LASTDATE",
            "LASTNONBLANK",
            "NEXTDAY",
            "NEXTMONTH",
            "NEXTQUARTER",
            "NEXTYEAR",
            "OPENINGBALANCEMONTH",
            "OPENINGBALANCEQUARTER",
            "OPENINGBALANCEYEAR",
            "PARALLELPERIOD",
            "PREVIOUSDAY",
            "PREVIOUSMONTH",
            "PREVIOUSQUARTER",
            "PREVIOUSYEAR",
            "SAMEPERIODLASTYEAR",
            "STARTOFMONTH",
            "STARTOFQUARTER",
            "STARTOFYEAR",
            "TOTALMTD",
            "TOTALQTD",
            "TOTALYTD",
            "ADDCOLUMNS",
            "ADDMISSINGITEMS",
            "ALL",
            "ALLEXCEPT",
            "ALLNOBLANKROW",
            "ALLSELECTED",
            "CALCULATE",
            "CALCULATETABLE",
            "CALENDAR",
            "CALENDARAUTO",
            "CROSSFILTER",
            "CROSSJOIN",
            "CURRENTGROUP",
            "DATATABLE",
            "DETAILROWS",
            "DISTINCT",
            "EARLIER",
            "EARLIEST",
            "EXCEPT",
            "FILTER",
            "FILTERS",
            "GENERATE",
            "GENERATEALL",
            "GROUPBY",
            "IGNORE",
            "INTERSECT",
            "ISONORAFTER",
            "KEEPFILTERS",
            "LOOKUPVALUE",
            "NATURALINNERJOIN",
            "NATURALLEFTOUTERJOIN",
            "RELATED",
            "RELATEDTABLE",
            "ROLLUP",
            "ROLLUPADDISSUBTOTAL",
            "ROLLUPGROUP",
            "ROLLUPISSUBTOTAL",
            "ROW",
            "SAMPLE",
            "SELECTCOLUMNS",
            "SUBSTITUTEWITHINDEX",
            "SUMMARIZE",
            "SUMMARIZECOLUMNS",
            "TOPN",
            "TREATAS",
            "UNION",
            "USERELATIONSHIP",
            "VALUES",
            "SUM",
            "SUMX",
            "PATH",
            "PATHCONTAINS",
            "PATHITEM",
            "PATHITEMREVERSE",
            "PATHLENGTH",
            "AVERAGE",
            "AVERAGEA",
            "AVERAGEX",
            "COUNT",
            "COUNTA",
            "COUNTAX",
            "COUNTBLANK",
            "COUNTROWS",
            "COUNTX",
            "DISTINCTCOUNT",
            "DIVIDE",
            "GEOMEAN",
            "GEOMEANX",
            "MAX",
            "MAXA",
            "MAXX",
            "MEDIAN",
            "MEDIANX",
            "MIN",
            "MINA",
            "MINX",
            "PERCENTILE.EXC",
            "PERCENTILE.INC",
            "PERCENTILEX.EXC",
            "PERCENTILEX.INC",
            "PRODUCT",
            "PRODUCTX",
            "RANK.EQ",
            "RANKX",
            "STDEV.P",
            "STDEV.S",
            "STDEVX.P",
            "STDEVX.S",
            "VAR.P",
            "VAR.S",
            "VARX.P",
            "VARX.S",
            "XIRR",
            "XNPV",
            "DATE",
            "DATEDIFF",
            "DATEVALUE",
            "DAY",
            "EDATE",
            "EOMONTH",
            "HOUR",
            "MINUTE",
            "MONTH",
            "NOW",
            "SECOND",
            "TIME",
            "TIMEVALUE",
            "TODAY",
            "WEEKDAY",
            "WEEKNUM",
            "YEAR",
            "YEARFRAC",
            "CONTAINS",
            "CONTAINSROW",
            "CUSTOMDATA",
            "ERROR",
            "HASONEFILTER",
            "HASONEVALUE",
            "ISBLANK",
            "ISCROSSFILTERED",
            "ISEMPTY",
            "ISERROR",
            "ISEVEN",
            "ISFILTERED",
            "ISLOGICAL",
            "ISNONTEXT",
            "ISNUMBER",
            "ISODD",
            "ISSUBTOTAL",
            "ISTEXT",
            "USERNAME",
            "USERPRINCIPALNAME",
            "AND",
            "FALSE",
            "IF",
            "IFERROR",
            "NOT",
            "OR",
            "SWITCH",
            "TRUE",
            "ABS",
            "ACOS",
            "ACOSH",
            "ACOT",
            "ACOTH",
            "ASIN",
            "ASINH",
            "ATAN",
            "ATANH",
            "BETA.DIST",
            "BETA.INV",
            "CEILING",
            "CHISQ.DIST",
            "CHISQ.DIST.RT",
            "CHISQ.INV",
            "CHISQ.INV.RT",
            "COMBIN",
            "COMBINA",
            "CONFIDENCE.NORM",
            "CONFIDENCE.T",
            "COS",
            "COSH",
            "COT",
            "COTH",
            "CURRENCY",
            "DEGREES",
            "EVEN",
            "EXP",
            "EXPON.DIST",
            "FACT",
            "FLOOR",
            "GCD",
            "INT",
            "ISO.CEILING",
            "LCM",
            "LN",
            "LOG",
            "LOG10",
            "MOD",
            "MROUND",
            "ODD",
            "PERMUT",
            "PI",
            "POISSON.DIST",
            "POWER",
            "QUOTIENT",
            "RADIANS",
            "RAND",
            "RANDBETWEEN",
            "ROUND",
            "ROUNDDOWN",
            "ROUNDUP",
            "SIGN",
            "SIN",
            "SINH",
            "SQRT",
            "SQRTPI",
            "TAN",
            "TANH",
            "TRUNC",
            "BLANK",
            "CONCATENATE",
            "CONCATENATEX",
            "EXACT",
            "FIND",
            "FIXED",
            "FORMAT",
            "LEFT",
            "LEN",
            "LOWER",
            "MID",
            "REPLACE",
            "REPT",
            "RIGHT",
            "SEARCH",
            "SUBSTITUTE",
            "TRIM",
            "UNICHAR",
            "UNICODE",
            "UPPER",
            "VALUE",
          ],
          tokenizer: {
            root: [
              { include: "@comments" },
              { include: "@whitespace" },
              { include: "@numbers" },
              { include: "@strings" },
              { include: "@complexIdentifiers" },
              [/[;,.]/, "delimiter"],
              [/[({})]/, "@brackets"],
              [
                /[a-z_][a-zA-Z0-9_]*/,
                {
                  cases: {
                    "@keywords": "keyword",
                    "@functions": "keyword",
                    "@default": "identifier",
                  },
                },
              ],
              [/[<>=!%&+\-*/|~^]/, "operator"],
            ],
            whitespace: [[/\s+/, "white"]],
            comments: [
              [/\/\/+.*/, "comment"],
              [/\/\*/, { token: "comment.quote", next: "@comment" }],
            ],
            comment: [
              [/[^*/]+/, "comment"],
              [/\*\//, { token: "comment.quote", next: "@pop" }],
              [/./, "comment"],
            ],
            numbers: [
              [/0[xX][0-9a-fA-F]*/, "number"],
              [/[$][+-]*\d*(\.\d*)?/, "number"],
              [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, "number"],
            ],
            strings: [
              [/N"/, { token: "string", next: "@string" }],
              [/"/, { token: "string", next: "@string" }],
            ],
            string: [
              [/[^"]+/, "string"],
              [/""/, "string"],
              [/"/, { token: "string", next: "@pop" }],
            ],
            complexIdentifiers: [
              [/\[/, { token: "identifier.quote", next: "@bracketedIdentifier" }],
              [/'/, { token: "identifier.quote", next: "@quotedIdentifier" }],
            ],
            bracketedIdentifier: [
              [/[^\]]+/, "identifier"],
              [/]]/, "identifier"],
              [/]/, { token: "identifier.quote", next: "@pop" }],
            ],
            quotedIdentifier: [
              [/[^']+/, "identifier"],
              [/''/, "identifier"],
              [/'/, { token: "identifier.quote", next: "@pop" }],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  I3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "--", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".sql",
          ignoreCase: !0,
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          keywords: [
            "ACCESSIBLE",
            "ADD",
            "ALL",
            "ALTER",
            "ANALYZE",
            "AND",
            "AS",
            "ASC",
            "ASENSITIVE",
            "BEFORE",
            "BETWEEN",
            "BIGINT",
            "BINARY",
            "BLOB",
            "BOTH",
            "BY",
            "CALL",
            "CASCADE",
            "CASE",
            "CHANGE",
            "CHAR",
            "CHARACTER",
            "CHECK",
            "COLLATE",
            "COLUMN",
            "CONDITION",
            "CONSTRAINT",
            "CONTINUE",
            "CONVERT",
            "CREATE",
            "CROSS",
            "CUBE",
            "CUME_DIST",
            "CURRENT_DATE",
            "CURRENT_TIME",
            "CURRENT_TIMESTAMP",
            "CURRENT_USER",
            "CURSOR",
            "DATABASE",
            "DATABASES",
            "DAY_HOUR",
            "DAY_MICROSECOND",
            "DAY_MINUTE",
            "DAY_SECOND",
            "DEC",
            "DECIMAL",
            "DECLARE",
            "DEFAULT",
            "DELAYED",
            "DELETE",
            "DENSE_RANK",
            "DESC",
            "DESCRIBE",
            "DETERMINISTIC",
            "DISTINCT",
            "DISTINCTROW",
            "DIV",
            "DOUBLE",
            "DROP",
            "DUAL",
            "EACH",
            "ELSE",
            "ELSEIF",
            "EMPTY",
            "ENCLOSED",
            "ESCAPED",
            "EXCEPT",
            "EXISTS",
            "EXIT",
            "EXPLAIN",
            "FALSE",
            "FETCH",
            "FIRST_VALUE",
            "FLOAT",
            "FLOAT4",
            "FLOAT8",
            "FOR",
            "FORCE",
            "FOREIGN",
            "FROM",
            "FULLTEXT",
            "FUNCTION",
            "GENERATED",
            "GET",
            "GRANT",
            "GROUP",
            "GROUPING",
            "GROUPS",
            "HAVING",
            "HIGH_PRIORITY",
            "HOUR_MICROSECOND",
            "HOUR_MINUTE",
            "HOUR_SECOND",
            "IF",
            "IGNORE",
            "IN",
            "INDEX",
            "INFILE",
            "INNER",
            "INOUT",
            "INSENSITIVE",
            "INSERT",
            "INT",
            "INT1",
            "INT2",
            "INT3",
            "INT4",
            "INT8",
            "INTEGER",
            "INTERVAL",
            "INTO",
            "IO_AFTER_GTIDS",
            "IO_BEFORE_GTIDS",
            "IS",
            "ITERATE",
            "JOIN",
            "JSON_TABLE",
            "KEY",
            "KEYS",
            "KILL",
            "LAG",
            "LAST_VALUE",
            "LATERAL",
            "LEAD",
            "LEADING",
            "LEAVE",
            "LEFT",
            "LIKE",
            "LIMIT",
            "LINEAR",
            "LINES",
            "LOAD",
            "LOCALTIME",
            "LOCALTIMESTAMP",
            "LOCK",
            "LONG",
            "LONGBLOB",
            "LONGTEXT",
            "LOOP",
            "LOW_PRIORITY",
            "MASTER_BIND",
            "MASTER_SSL_VERIFY_SERVER_CERT",
            "MATCH",
            "MAXVALUE",
            "MEDIUMBLOB",
            "MEDIUMINT",
            "MEDIUMTEXT",
            "MIDDLEINT",
            "MINUTE_MICROSECOND",
            "MINUTE_SECOND",
            "MOD",
            "MODIFIES",
            "NATURAL",
            "NOT",
            "NO_WRITE_TO_BINLOG",
            "NTH_VALUE",
            "NTILE",
            "NULL",
            "NUMERIC",
            "OF",
            "ON",
            "OPTIMIZE",
            "OPTIMIZER_COSTS",
            "OPTION",
            "OPTIONALLY",
            "OR",
            "ORDER",
            "OUT",
            "OUTER",
            "OUTFILE",
            "OVER",
            "PARTITION",
            "PERCENT_RANK",
            "PRECISION",
            "PRIMARY",
            "PROCEDURE",
            "PURGE",
            "RANGE",
            "RANK",
            "READ",
            "READS",
            "READ_WRITE",
            "REAL",
            "RECURSIVE",
            "REFERENCES",
            "REGEXP",
            "RELEASE",
            "RENAME",
            "REPEAT",
            "REPLACE",
            "REQUIRE",
            "RESIGNAL",
            "RESTRICT",
            "RETURN",
            "REVOKE",
            "RIGHT",
            "RLIKE",
            "ROW",
            "ROWS",
            "ROW_NUMBER",
            "SCHEMA",
            "SCHEMAS",
            "SECOND_MICROSECOND",
            "SELECT",
            "SENSITIVE",
            "SEPARATOR",
            "SET",
            "SHOW",
            "SIGNAL",
            "SMALLINT",
            "SPATIAL",
            "SPECIFIC",
            "SQL",
            "SQLEXCEPTION",
            "SQLSTATE",
            "SQLWARNING",
            "SQL_BIG_RESULT",
            "SQL_CALC_FOUND_ROWS",
            "SQL_SMALL_RESULT",
            "SSL",
            "STARTING",
            "STORED",
            "STRAIGHT_JOIN",
            "SYSTEM",
            "TABLE",
            "TERMINATED",
            "THEN",
            "TINYBLOB",
            "TINYINT",
            "TINYTEXT",
            "TO",
            "TRAILING",
            "TRIGGER",
            "TRUE",
            "UNDO",
            "UNION",
            "UNIQUE",
            "UNLOCK",
            "UNSIGNED",
            "UPDATE",
            "USAGE",
            "USE",
            "USING",
            "UTC_DATE",
            "UTC_TIME",
            "UTC_TIMESTAMP",
            "VALUES",
            "VARBINARY",
            "VARCHAR",
            "VARCHARACTER",
            "VARYING",
            "VIRTUAL",
            "WHEN",
            "WHERE",
            "WHILE",
            "WINDOW",
            "WITH",
            "WRITE",
            "XOR",
            "YEAR_MONTH",
            "ZEROFILL",
          ],
          operators: [
            "AND",
            "BETWEEN",
            "IN",
            "LIKE",
            "NOT",
            "OR",
            "IS",
            "NULL",
            "INTERSECT",
            "UNION",
            "INNER",
            "JOIN",
            "LEFT",
            "OUTER",
            "RIGHT",
          ],
          builtinFunctions: [
            "ABS",
            "ACOS",
            "ADDDATE",
            "ADDTIME",
            "AES_DECRYPT",
            "AES_ENCRYPT",
            "ANY_VALUE",
            "Area",
            "AsBinary",
            "AsWKB",
            "ASCII",
            "ASIN",
            "AsText",
            "AsWKT",
            "ASYMMETRIC_DECRYPT",
            "ASYMMETRIC_DERIVE",
            "ASYMMETRIC_ENCRYPT",
            "ASYMMETRIC_SIGN",
            "ASYMMETRIC_VERIFY",
            "ATAN",
            "ATAN2",
            "ATAN",
            "AVG",
            "BENCHMARK",
            "BIN",
            "BIT_AND",
            "BIT_COUNT",
            "BIT_LENGTH",
            "BIT_OR",
            "BIT_XOR",
            "Buffer",
            "CAST",
            "CEIL",
            "CEILING",
            "Centroid",
            "CHAR",
            "CHAR_LENGTH",
            "CHARACTER_LENGTH",
            "CHARSET",
            "COALESCE",
            "COERCIBILITY",
            "COLLATION",
            "COMPRESS",
            "CONCAT",
            "CONCAT_WS",
            "CONNECTION_ID",
            "Contains",
            "CONV",
            "CONVERT",
            "CONVERT_TZ",
            "ConvexHull",
            "COS",
            "COT",
            "COUNT",
            "CRC32",
            "CREATE_ASYMMETRIC_PRIV_KEY",
            "CREATE_ASYMMETRIC_PUB_KEY",
            "CREATE_DH_PARAMETERS",
            "CREATE_DIGEST",
            "Crosses",
            "CUME_DIST",
            "CURDATE",
            "CURRENT_DATE",
            "CURRENT_ROLE",
            "CURRENT_TIME",
            "CURRENT_TIMESTAMP",
            "CURRENT_USER",
            "CURTIME",
            "DATABASE",
            "DATE",
            "DATE_ADD",
            "DATE_FORMAT",
            "DATE_SUB",
            "DATEDIFF",
            "DAY",
            "DAYNAME",
            "DAYOFMONTH",
            "DAYOFWEEK",
            "DAYOFYEAR",
            "DECODE",
            "DEFAULT",
            "DEGREES",
            "DES_DECRYPT",
            "DES_ENCRYPT",
            "DENSE_RANK",
            "Dimension",
            "Disjoint",
            "Distance",
            "ELT",
            "ENCODE",
            "ENCRYPT",
            "EndPoint",
            "Envelope",
            "Equals",
            "EXP",
            "EXPORT_SET",
            "ExteriorRing",
            "EXTRACT",
            "ExtractValue",
            "FIELD",
            "FIND_IN_SET",
            "FIRST_VALUE",
            "FLOOR",
            "FORMAT",
            "FORMAT_BYTES",
            "FORMAT_PICO_TIME",
            "FOUND_ROWS",
            "FROM_BASE64",
            "FROM_DAYS",
            "FROM_UNIXTIME",
            "GEN_RANGE",
            "GEN_RND_EMAIL",
            "GEN_RND_PAN",
            "GEN_RND_SSN",
            "GEN_RND_US_PHONE",
            "GeomCollection",
            "GeomCollFromText",
            "GeometryCollectionFromText",
            "GeomCollFromWKB",
            "GeometryCollectionFromWKB",
            "GeometryCollection",
            "GeometryN",
            "GeometryType",
            "GeomFromText",
            "GeometryFromText",
            "GeomFromWKB",
            "GeometryFromWKB",
            "GET_FORMAT",
            "GET_LOCK",
            "GLength",
            "GREATEST",
            "GROUP_CONCAT",
            "GROUPING",
            "GTID_SUBSET",
            "GTID_SUBTRACT",
            "HEX",
            "HOUR",
            "ICU_VERSION",
            "IF",
            "IFNULL",
            "INET_ATON",
            "INET_NTOA",
            "INET6_ATON",
            "INET6_NTOA",
            "INSERT",
            "INSTR",
            "InteriorRingN",
            "Intersects",
            "INTERVAL",
            "IS_FREE_LOCK",
            "IS_IPV4",
            "IS_IPV4_COMPAT",
            "IS_IPV4_MAPPED",
            "IS_IPV6",
            "IS_USED_LOCK",
            "IS_UUID",
            "IsClosed",
            "IsEmpty",
            "ISNULL",
            "IsSimple",
            "JSON_APPEND",
            "JSON_ARRAY",
            "JSON_ARRAY_APPEND",
            "JSON_ARRAY_INSERT",
            "JSON_ARRAYAGG",
            "JSON_CONTAINS",
            "JSON_CONTAINS_PATH",
            "JSON_DEPTH",
            "JSON_EXTRACT",
            "JSON_INSERT",
            "JSON_KEYS",
            "JSON_LENGTH",
            "JSON_MERGE",
            "JSON_MERGE_PATCH",
            "JSON_MERGE_PRESERVE",
            "JSON_OBJECT",
            "JSON_OBJECTAGG",
            "JSON_OVERLAPS",
            "JSON_PRETTY",
            "JSON_QUOTE",
            "JSON_REMOVE",
            "JSON_REPLACE",
            "JSON_SCHEMA_VALID",
            "JSON_SCHEMA_VALIDATION_REPORT",
            "JSON_SEARCH",
            "JSON_SET",
            "JSON_STORAGE_FREE",
            "JSON_STORAGE_SIZE",
            "JSON_TABLE",
            "JSON_TYPE",
            "JSON_UNQUOTE",
            "JSON_VALID",
            "LAG",
            "LAST_DAY",
            "LAST_INSERT_ID",
            "LAST_VALUE",
            "LCASE",
            "LEAD",
            "LEAST",
            "LEFT",
            "LENGTH",
            "LineFromText",
            "LineStringFromText",
            "LineFromWKB",
            "LineStringFromWKB",
            "LineString",
            "LN",
            "LOAD_FILE",
            "LOCALTIME",
            "LOCALTIMESTAMP",
            "LOCATE",
            "LOG",
            "LOG10",
            "LOG2",
            "LOWER",
            "LPAD",
            "LTRIM",
            "MAKE_SET",
            "MAKEDATE",
            "MAKETIME",
            "MASK_INNER",
            "MASK_OUTER",
            "MASK_PAN",
            "MASK_PAN_RELAXED",
            "MASK_SSN",
            "MASTER_POS_WAIT",
            "MAX",
            "MBRContains",
            "MBRCoveredBy",
            "MBRCovers",
            "MBRDisjoint",
            "MBREqual",
            "MBREquals",
            "MBRIntersects",
            "MBROverlaps",
            "MBRTouches",
            "MBRWithin",
            "MD5",
            "MEMBER OF",
            "MICROSECOND",
            "MID",
            "MIN",
            "MINUTE",
            "MLineFromText",
            "MultiLineStringFromText",
            "MLineFromWKB",
            "MultiLineStringFromWKB",
            "MOD",
            "MONTH",
            "MONTHNAME",
            "MPointFromText",
            "MultiPointFromText",
            "MPointFromWKB",
            "MultiPointFromWKB",
            "MPolyFromText",
            "MultiPolygonFromText",
            "MPolyFromWKB",
            "MultiPolygonFromWKB",
            "MultiLineString",
            "MultiPoint",
            "MultiPolygon",
            "NAME_CONST",
            "NOT IN",
            "NOW",
            "NTH_VALUE",
            "NTILE",
            "NULLIF",
            "NumGeometries",
            "NumInteriorRings",
            "NumPoints",
            "OCT",
            "OCTET_LENGTH",
            "OLD_PASSWORD",
            "ORD",
            "Overlaps",
            "PASSWORD",
            "PERCENT_RANK",
            "PERIOD_ADD",
            "PERIOD_DIFF",
            "PI",
            "Point",
            "PointFromText",
            "PointFromWKB",
            "PointN",
            "PolyFromText",
            "PolygonFromText",
            "PolyFromWKB",
            "PolygonFromWKB",
            "Polygon",
            "POSITION",
            "POW",
            "POWER",
            "PS_CURRENT_THREAD_ID",
            "PS_THREAD_ID",
            "PROCEDURE ANALYSE",
            "QUARTER",
            "QUOTE",
            "RADIANS",
            "RAND",
            "RANDOM_BYTES",
            "RANK",
            "REGEXP_INSTR",
            "REGEXP_LIKE",
            "REGEXP_REPLACE",
            "REGEXP_REPLACE",
            "RELEASE_ALL_LOCKS",
            "RELEASE_LOCK",
            "REPEAT",
            "REPLACE",
            "REVERSE",
            "RIGHT",
            "ROLES_GRAPHML",
            "ROUND",
            "ROW_COUNT",
            "ROW_NUMBER",
            "RPAD",
            "RTRIM",
            "SCHEMA",
            "SEC_TO_TIME",
            "SECOND",
            "SESSION_USER",
            "SHA1",
            "SHA",
            "SHA2",
            "SIGN",
            "SIN",
            "SLEEP",
            "SOUNDEX",
            "SOURCE_POS_WAIT",
            "SPACE",
            "SQRT",
            "SRID",
            "ST_Area",
            "ST_AsBinary",
            "ST_AsWKB",
            "ST_AsGeoJSON",
            "ST_AsText",
            "ST_AsWKT",
            "ST_Buffer",
            "ST_Buffer_Strategy",
            "ST_Centroid",
            "ST_Collect",
            "ST_Contains",
            "ST_ConvexHull",
            "ST_Crosses",
            "ST_Difference",
            "ST_Dimension",
            "ST_Disjoint",
            "ST_Distance",
            "ST_Distance_Sphere",
            "ST_EndPoint",
            "ST_Envelope",
            "ST_Equals",
            "ST_ExteriorRing",
            "ST_FrechetDistance",
            "ST_GeoHash",
            "ST_GeomCollFromText",
            "ST_GeometryCollectionFromText",
            "ST_GeomCollFromTxt",
            "ST_GeomCollFromWKB",
            "ST_GeometryCollectionFromWKB",
            "ST_GeometryN",
            "ST_GeometryType",
            "ST_GeomFromGeoJSON",
            "ST_GeomFromText",
            "ST_GeometryFromText",
            "ST_GeomFromWKB",
            "ST_GeometryFromWKB",
            "ST_HausdorffDistance",
            "ST_InteriorRingN",
            "ST_Intersection",
            "ST_Intersects",
            "ST_IsClosed",
            "ST_IsEmpty",
            "ST_IsSimple",
            "ST_IsValid",
            "ST_LatFromGeoHash",
            "ST_Length",
            "ST_LineFromText",
            "ST_LineStringFromText",
            "ST_LineFromWKB",
            "ST_LineStringFromWKB",
            "ST_LineInterpolatePoint",
            "ST_LineInterpolatePoints",
            "ST_LongFromGeoHash",
            "ST_Longitude",
            "ST_MakeEnvelope",
            "ST_MLineFromText",
            "ST_MultiLineStringFromText",
            "ST_MLineFromWKB",
            "ST_MultiLineStringFromWKB",
            "ST_MPointFromText",
            "ST_MultiPointFromText",
            "ST_MPointFromWKB",
            "ST_MultiPointFromWKB",
            "ST_MPolyFromText",
            "ST_MultiPolygonFromText",
            "ST_MPolyFromWKB",
            "ST_MultiPolygonFromWKB",
            "ST_NumGeometries",
            "ST_NumInteriorRing",
            "ST_NumInteriorRings",
            "ST_NumPoints",
            "ST_Overlaps",
            "ST_PointAtDistance",
            "ST_PointFromGeoHash",
            "ST_PointFromText",
            "ST_PointFromWKB",
            "ST_PointN",
            "ST_PolyFromText",
            "ST_PolygonFromText",
            "ST_PolyFromWKB",
            "ST_PolygonFromWKB",
            "ST_Simplify",
            "ST_SRID",
            "ST_StartPoint",
            "ST_SwapXY",
            "ST_SymDifference",
            "ST_Touches",
            "ST_Transform",
            "ST_Union",
            "ST_Validate",
            "ST_Within",
            "ST_X",
            "ST_Y",
            "StartPoint",
            "STATEMENT_DIGEST",
            "STATEMENT_DIGEST_TEXT",
            "STD",
            "STDDEV",
            "STDDEV_POP",
            "STDDEV_SAMP",
            "STR_TO_DATE",
            "STRCMP",
            "SUBDATE",
            "SUBSTR",
            "SUBSTRING",
            "SUBSTRING_INDEX",
            "SUBTIME",
            "SUM",
            "SYSDATE",
            "SYSTEM_USER",
            "TAN",
            "TIME",
            "TIME_FORMAT",
            "TIME_TO_SEC",
            "TIMEDIFF",
            "TIMESTAMP",
            "TIMESTAMPADD",
            "TIMESTAMPDIFF",
            "TO_BASE64",
            "TO_DAYS",
            "TO_SECONDS",
            "Touches",
            "TRIM",
            "TRUNCATE",
            "UCASE",
            "UNCOMPRESS",
            "UNCOMPRESSED_LENGTH",
            "UNHEX",
            "UNIX_TIMESTAMP",
            "UpdateXML",
            "UPPER",
            "USER",
            "UTC_DATE",
            "UTC_TIME",
            "UTC_TIMESTAMP",
            "UUID",
            "UUID_SHORT",
            "UUID_TO_BIN",
            "VALIDATE_PASSWORD_STRENGTH",
            "VALUES",
            "VAR_POP",
            "VAR_SAMP",
            "VARIANCE",
            "VERSION",
            "WAIT_FOR_EXECUTED_GTID_SET",
            "WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS",
            "WEEK",
            "WEEKDAY",
            "WEEKOFYEAR",
            "WEIGHT_STRING",
            "Within",
            "X",
            "Y",
            "YEAR",
            "YEARWEEK",
          ],
          builtinVariables: [],
          tokenizer: {
            root: [
              { include: "@comments" },
              { include: "@whitespace" },
              { include: "@numbers" },
              { include: "@strings" },
              { include: "@complexIdentifiers" },
              { include: "@scopes" },
              [/[;,.]/, "delimiter"],
              [/[()]/, "@brackets"],
              [
                /[\w@]+/,
                {
                  cases: {
                    "@operators": "operator",
                    "@builtinVariables": "predefined",
                    "@builtinFunctions": "predefined",
                    "@keywords": "keyword",
                    "@default": "identifier",
                  },
                },
              ],
              [/[<>=!%&+\-*/|~^]/, "operator"],
            ],
            whitespace: [[/\s+/, "white"]],
            comments: [
              [/--+.*/, "comment"],
              [/#+.*/, "comment"],
              [/\/\*/, { token: "comment.quote", next: "@comment" }],
            ],
            comment: [
              [/[^*/]+/, "comment"],
              [/\*\//, { token: "comment.quote", next: "@pop" }],
              [/./, "comment"],
            ],
            numbers: [
              [/0[xX][0-9a-fA-F]*/, "number"],
              [/[$][+-]*\d*(\.\d*)?/, "number"],
              [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, "number"],
            ],
            strings: [
              [/'/, { token: "string", next: "@string" }],
              [/"/, { token: "string.double", next: "@stringDouble" }],
            ],
            string: [
              [/\\'/, "string"],
              [/[^']+/, "string"],
              [/''/, "string"],
              [/'/, { token: "string", next: "@pop" }],
            ],
            stringDouble: [
              [/[^"]+/, "string.double"],
              [/""/, "string.double"],
              [/"/, { token: "string.double", next: "@pop" }],
            ],
            complexIdentifiers: [[/`/, { token: "identifier.quote", next: "@quotedIdentifier" }]],
            quotedIdentifier: [
              [/[^`]+/, "identifier"],
              [/``/, "identifier"],
              [/`/, { token: "identifier.quote", next: "@pop" }],
            ],
            scopes: [],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  R3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".objective-c",
          keywords: [
            "#import",
            "#include",
            "#define",
            "#else",
            "#endif",
            "#if",
            "#ifdef",
            "#ifndef",
            "#ident",
            "#undef",
            "@class",
            "@defs",
            "@dynamic",
            "@encode",
            "@end",
            "@implementation",
            "@interface",
            "@package",
            "@private",
            "@protected",
            "@property",
            "@protocol",
            "@public",
            "@selector",
            "@synthesize",
            "__declspec",
            "assign",
            "auto",
            "BOOL",
            "break",
            "bycopy",
            "byref",
            "case",
            "char",
            "Class",
            "const",
            "copy",
            "continue",
            "default",
            "do",
            "double",
            "else",
            "enum",
            "extern",
            "FALSE",
            "false",
            "float",
            "for",
            "goto",
            "if",
            "in",
            "int",
            "id",
            "inout",
            "IMP",
            "long",
            "nil",
            "nonatomic",
            "NULL",
            "oneway",
            "out",
            "private",
            "public",
            "protected",
            "readwrite",
            "readonly",
            "register",
            "return",
            "SEL",
            "self",
            "short",
            "signed",
            "sizeof",
            "static",
            "struct",
            "super",
            "switch",
            "typedef",
            "TRUE",
            "true",
            "union",
            "unsigned",
            "volatile",
            "void",
            "while",
          ],
          decpart: /\d(_?\d)*/,
          decimal: /0|@decpart/,
          tokenizer: {
            root: [
              { include: "@comments" },
              { include: "@whitespace" },
              { include: "@numbers" },
              { include: "@strings" },
              [/[,:;]/, "delimiter"],
              [/[{}\[\]()<>]/, "@brackets"],
              [/[a-zA-Z@#]\w*/, { cases: { "@keywords": "keyword", "@default": "identifier" } }],
              [/[<>=\\+\\-\\*\\/\\^\\|\\~,]|and\\b|or\\b|not\\b]/, "operator"],
            ],
            whitespace: [[/\s+/, "white"]],
            comments: [
              ["\\/\\*", "comment", "@comment"],
              ["\\/\\/+.*", "comment"],
            ],
            comment: [
              ["\\*\\/", "comment", "@pop"],
              [".", "comment"],
            ],
            numbers: [
              [/0[xX][0-9a-fA-F]*(_?[0-9a-fA-F])*/, "number.hex"],
              [
                /@decimal((\.@decpart)?([eE][\-+]?@decpart)?)[fF]*/,
                { cases: { "(\\d)*": "number", $0: "number.float" } },
              ],
            ],
            strings: [
              [/'$/, "string.escape", "@popall"],
              [/'/, "string.escape", "@stringBody"],
              [/"$/, "string.escape", "@popall"],
              [/"/, "string.escape", "@dblStringBody"],
            ],
            stringBody: [
              [/[^\\']+$/, "string", "@popall"],
              [/[^\\']+/, "string"],
              [/\\./, "string"],
              [/'/, "string.escape", "@popall"],
              [/\\$/, "string"],
            ],
            dblStringBody: [
              [/[^\\"]+$/, "string", "@popall"],
              [/[^\\"]+/, "string"],
              [/\\./, "string"],
              [/"/, "string.escape", "@popall"],
              [/\\$/, "string"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  O3e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { lineComment: "//", blockComment: ["{", "}"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
      ["<", ">"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">" },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">" },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*\\{\\$REGION(\\s\\'.*\\')?\\}"),
        end: new RegExp("^\\s*\\{\\$ENDREGION\\}"),
      },
    },
  },
  M3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: O3e,
        language: {
          defaultToken: "",
          tokenPostfix: ".pascal",
          ignoreCase: !0,
          brackets: [
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "<", close: ">", token: "delimiter.angle" },
          ],
          keywords: [
            "absolute",
            "abstract",
            "all",
            "and_then",
            "array",
            "as",
            "asm",
            "attribute",
            "begin",
            "bindable",
            "case",
            "class",
            "const",
            "contains",
            "default",
            "div",
            "else",
            "end",
            "except",
            "exports",
            "external",
            "far",
            "file",
            "finalization",
            "finally",
            "forward",
            "generic",
            "goto",
            "if",
            "implements",
            "import",
            "in",
            "index",
            "inherited",
            "initialization",
            "interrupt",
            "is",
            "label",
            "library",
            "mod",
            "module",
            "name",
            "near",
            "not",
            "object",
            "of",
            "on",
            "only",
            "operator",
            "or_else",
            "otherwise",
            "override",
            "package",
            "packed",
            "pow",
            "private",
            "program",
            "protected",
            "public",
            "published",
            "interface",
            "implementation",
            "qualified",
            "read",
            "record",
            "resident",
            "requires",
            "resourcestring",
            "restricted",
            "segment",
            "set",
            "shl",
            "shr",
            "specialize",
            "stored",
            "strict",
            "then",
            "threadvar",
            "to",
            "try",
            "type",
            "unit",
            "uses",
            "var",
            "view",
            "virtual",
            "dynamic",
            "overload",
            "reintroduce",
            "with",
            "write",
            "xor",
            "true",
            "false",
            "procedure",
            "function",
            "constructor",
            "destructor",
            "property",
            "break",
            "continue",
            "exit",
            "abort",
            "while",
            "do",
            "for",
            "raise",
            "repeat",
            "until",
          ],
          typeKeywords: [
            "boolean",
            "double",
            "byte",
            "integer",
            "shortint",
            "char",
            "longint",
            "float",
            "string",
          ],
          operators: [
            "=",
            ">",
            "<",
            "<=",
            ">=",
            "<>",
            ":",
            ":=",
            "and",
            "or",
            "+",
            "-",
            "*",
            "/",
            "@",
            "&",
            "^",
            "%",
          ],
          symbols: /[=><:@\^&|+\-*\/\^%]+/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_][\w]*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/\$[0-9a-fA-F]{1,16}/, "number.hex"],
              [/\d+/, "number"],
              [/[;,.]/, "delimiter"],
              [/'([^'\\]|\\.)*$/, "string.invalid"],
              [/'/, "string", "@string"],
              [/'[^\\']'/, "string"],
              [/'/, "string.invalid"],
              [/\#\d+/, "string"],
            ],
            comment: [
              [/[^\*\}]+/, "comment"],
              [/\}/, "comment", "@pop"],
              [/[\{]/, "comment"],
            ],
            string: [
              [/[^\\']+/, "string"],
              [/\\./, "string.escape.invalid"],
              [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/\{/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  A3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["(*", "*)"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
            ["<", ">"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "<", close: ">" },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: "<", close: ">" },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".pascaligo",
          ignoreCase: !0,
          brackets: [
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "<", close: ">", token: "delimiter.angle" },
          ],
          keywords: [
            "begin",
            "block",
            "case",
            "const",
            "else",
            "end",
            "fail",
            "for",
            "from",
            "function",
            "if",
            "is",
            "nil",
            "of",
            "remove",
            "return",
            "skip",
            "then",
            "type",
            "var",
            "while",
            "with",
            "option",
            "None",
            "transaction",
          ],
          typeKeywords: [
            "bool",
            "int",
            "list",
            "map",
            "nat",
            "record",
            "string",
            "unit",
            "address",
            "map",
            "mtz",
            "xtz",
          ],
          operators: [
            "=",
            ">",
            "<",
            "<=",
            ">=",
            "<>",
            ":",
            ":=",
            "and",
            "mod",
            "or",
            "+",
            "-",
            "*",
            "/",
            "@",
            "&",
            "^",
            "%",
          ],
          symbols: /[=><:@\^&|+\-*\/\^%]+/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_][\w]*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/\$[0-9a-fA-F]{1,16}/, "number.hex"],
              [/\d+/, "number"],
              [/[;,.]/, "delimiter"],
              [/'([^'\\]|\\.)*$/, "string.invalid"],
              [/'/, "string", "@string"],
              [/'[^\\']'/, "string"],
              [/'/, "string.invalid"],
              [/\#\d+/, "string"],
            ],
            comment: [
              [/[^\(\*]+/, "comment"],
              [/\*\)/, "comment", "@pop"],
              [/\(\*/, "comment"],
            ],
            string: [
              [/[^\\']+/, "string"],
              [/\\./, "string.escape.invalid"],
              [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/\(\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  P3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "#" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "`", close: "`" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "`", close: "`" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".perl",
          brackets: [
            { token: "delimiter.bracket", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
          ],
          keywords: [
            "__DATA__",
            "else",
            "lock",
            "__END__",
            "elsif",
            "lt",
            "__FILE__",
            "eq",
            "__LINE__",
            "exp",
            "ne",
            "sub",
            "__PACKAGE__",
            "for",
            "no",
            "and",
            "foreach",
            "or",
            "unless",
            "cmp",
            "ge",
            "package",
            "until",
            "continue",
            "gt",
            "while",
            "CORE",
            "if",
            "xor",
            "do",
            "le",
            "__DIE__",
            "__WARN__",
          ],
          builtinFunctions: [
            "-A",
            "END",
            "length",
            "setpgrp",
            "-B",
            "endgrent",
            "link",
            "setpriority",
            "-b",
            "endhostent",
            "listen",
            "setprotoent",
            "-C",
            "endnetent",
            "local",
            "setpwent",
            "-c",
            "endprotoent",
            "localtime",
            "setservent",
            "-d",
            "endpwent",
            "log",
            "setsockopt",
            "-e",
            "endservent",
            "lstat",
            "shift",
            "-f",
            "eof",
            "map",
            "shmctl",
            "-g",
            "eval",
            "mkdir",
            "shmget",
            "-k",
            "exec",
            "msgctl",
            "shmread",
            "-l",
            "exists",
            "msgget",
            "shmwrite",
            "-M",
            "exit",
            "msgrcv",
            "shutdown",
            "-O",
            "fcntl",
            "msgsnd",
            "sin",
            "-o",
            "fileno",
            "my",
            "sleep",
            "-p",
            "flock",
            "next",
            "socket",
            "-r",
            "fork",
            "not",
            "socketpair",
            "-R",
            "format",
            "oct",
            "sort",
            "-S",
            "formline",
            "open",
            "splice",
            "-s",
            "getc",
            "opendir",
            "split",
            "-T",
            "getgrent",
            "ord",
            "sprintf",
            "-t",
            "getgrgid",
            "our",
            "sqrt",
            "-u",
            "getgrnam",
            "pack",
            "srand",
            "-w",
            "gethostbyaddr",
            "pipe",
            "stat",
            "-W",
            "gethostbyname",
            "pop",
            "state",
            "-X",
            "gethostent",
            "pos",
            "study",
            "-x",
            "getlogin",
            "print",
            "substr",
            "-z",
            "getnetbyaddr",
            "printf",
            "symlink",
            "abs",
            "getnetbyname",
            "prototype",
            "syscall",
            "accept",
            "getnetent",
            "push",
            "sysopen",
            "alarm",
            "getpeername",
            "quotemeta",
            "sysread",
            "atan2",
            "getpgrp",
            "rand",
            "sysseek",
            "AUTOLOAD",
            "getppid",
            "read",
            "system",
            "BEGIN",
            "getpriority",
            "readdir",
            "syswrite",
            "bind",
            "getprotobyname",
            "readline",
            "tell",
            "binmode",
            "getprotobynumber",
            "readlink",
            "telldir",
            "bless",
            "getprotoent",
            "readpipe",
            "tie",
            "break",
            "getpwent",
            "recv",
            "tied",
            "caller",
            "getpwnam",
            "redo",
            "time",
            "chdir",
            "getpwuid",
            "ref",
            "times",
            "CHECK",
            "getservbyname",
            "rename",
            "truncate",
            "chmod",
            "getservbyport",
            "require",
            "uc",
            "chomp",
            "getservent",
            "reset",
            "ucfirst",
            "chop",
            "getsockname",
            "return",
            "umask",
            "chown",
            "getsockopt",
            "reverse",
            "undef",
            "chr",
            "glob",
            "rewinddir",
            "UNITCHECK",
            "chroot",
            "gmtime",
            "rindex",
            "unlink",
            "close",
            "goto",
            "rmdir",
            "unpack",
            "closedir",
            "grep",
            "say",
            "unshift",
            "connect",
            "hex",
            "scalar",
            "untie",
            "cos",
            "index",
            "seek",
            "use",
            "crypt",
            "INIT",
            "seekdir",
            "utime",
            "dbmclose",
            "int",
            "select",
            "values",
            "dbmopen",
            "ioctl",
            "semctl",
            "vec",
            "defined",
            "join",
            "semget",
            "wait",
            "delete",
            "keys",
            "semop",
            "waitpid",
            "DESTROY",
            "kill",
            "send",
            "wantarray",
            "die",
            "last",
            "setgrent",
            "warn",
            "dump",
            "lc",
            "sethostent",
            "write",
            "each",
            "lcfirst",
            "setnetent",
          ],
          builtinFileHandlers: ["ARGV", "STDERR", "STDOUT", "ARGVOUT", "STDIN", "ENV"],
          builtinVariables: [
            "$!",
            "$^RE_TRIE_MAXBUF",
            "$LAST_REGEXP_CODE_RESULT",
            '$"',
            "$^S",
            "$LIST_SEPARATOR",
            "$#",
            "$^T",
            "$MATCH",
            "$$",
            "$^TAINT",
            "$MULTILINE_MATCHING",
            "$%",
            "$^UNICODE",
            "$NR",
            "$&",
            "$^UTF8LOCALE",
            "$OFMT",
            "$'",
            "$^V",
            "$OFS",
            "$(",
            "$^W",
            "$ORS",
            "$)",
            "$^WARNING_BITS",
            "$OS_ERROR",
            "$*",
            "$^WIDE_SYSTEM_CALLS",
            "$OSNAME",
            "$+",
            "$^X",
            "$OUTPUT_AUTO_FLUSH",
            "$,",
            "$_",
            "$OUTPUT_FIELD_SEPARATOR",
            "$-",
            "$`",
            "$OUTPUT_RECORD_SEPARATOR",
            "$.",
            "$a",
            "$PERL_VERSION",
            "$/",
            "$ACCUMULATOR",
            "$PERLDB",
            "$0",
            "$ARG",
            "$PID",
            "$:",
            "$ARGV",
            "$POSTMATCH",
            "$;",
            "$b",
            "$PREMATCH",
            "$<",
            "$BASETIME",
            "$PROCESS_ID",
            "$=",
            "$CHILD_ERROR",
            "$PROGRAM_NAME",
            "$>",
            "$COMPILING",
            "$REAL_GROUP_ID",
            "$?",
            "$DEBUGGING",
            "$REAL_USER_ID",
            "$@",
            "$EFFECTIVE_GROUP_ID",
            "$RS",
            "$[",
            "$EFFECTIVE_USER_ID",
            "$SUBSCRIPT_SEPARATOR",
            "$\\",
            "$EGID",
            "$SUBSEP",
            "$]",
            "$ERRNO",
            "$SYSTEM_FD_MAX",
            "$^",
            "$EUID",
            "$UID",
            "$^A",
            "$EVAL_ERROR",
            "$WARNING",
            "$^C",
            "$EXCEPTIONS_BEING_CAUGHT",
            "$|",
            "$^CHILD_ERROR_NATIVE",
            "$EXECUTABLE_NAME",
            "$~",
            "$^D",
            "$EXTENDED_OS_ERROR",
            "%!",
            "$^E",
            "$FORMAT_FORMFEED",
            "%^H",
            "$^ENCODING",
            "$FORMAT_LINE_BREAK_CHARACTERS",
            "%ENV",
            "$^F",
            "$FORMAT_LINES_LEFT",
            "%INC",
            "$^H",
            "$FORMAT_LINES_PER_PAGE",
            "%OVERLOAD",
            "$^I",
            "$FORMAT_NAME",
            "%SIG",
            "$^L",
            "$FORMAT_PAGE_NUMBER",
            "@+",
            "$^M",
            "$FORMAT_TOP_NAME",
            "@-",
            "$^N",
            "$GID",
            "@_",
            "$^O",
            "$INPLACE_EDIT",
            "@ARGV",
            "$^OPEN",
            "$INPUT_LINE_NUMBER",
            "@INC",
            "$^P",
            "$INPUT_RECORD_SEPARATOR",
            "@LAST_MATCH_START",
            "$^R",
            "$LAST_MATCH_END",
            "$^RE_DEBUG_FLAGS",
            "$LAST_PAREN_MATCH",
          ],
          symbols: /[:+\-\^*$&%@=<>!?|\/~\.]/,
          quoteLikeOps: ["qr", "m", "s", "q", "qq", "qx", "qw", "tr", "y"],
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              { include: "@whitespace" },
              [
                /[a-zA-Z\-_][\w\-_]*/,
                {
                  cases: {
                    "@keywords": "keyword",
                    "@builtinFunctions": "type.identifier",
                    "@builtinFileHandlers": "variable.predefined",
                    "@quoteLikeOps": { token: "@rematch", next: "quotedConstructs" },
                    "@default": "",
                  },
                },
              ],
              [
                /[\$@%][*@#?\+\-\$!\w\\\^><~:;\.]+/,
                { cases: { "@builtinVariables": "variable.predefined", "@default": "variable" } },
              ],
              { include: "@strings" },
              { include: "@dblStrings" },
              { include: "@perldoc" },
              { include: "@heredoc" },
              [/[{}\[\]()]/, "@brackets"],
              [/[\/](?:(?:\[(?:\\]|[^\]])+\])|(?:\\\/|[^\]\/]))*[\/]\w*\s*(?=[).,;]|$)/, "regexp"],
              [/@symbols/, "operators"],
              { include: "@numbers" },
              [/[,;]/, "delimiter"],
            ],
            whitespace: [
              [/\s+/, "white"],
              [/(^#!.*$)/, "metatag"],
              [/(^#.*$)/, "comment"],
            ],
            numbers: [
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/, "number.hex"],
              [/\d+/, "number"],
            ],
            strings: [[/'/, "string", "@stringBody"]],
            stringBody: [
              [/'/, "string", "@popall"],
              [/\\'/, "string.escape"],
              [/./, "string"],
            ],
            dblStrings: [[/"/, "string", "@dblStringBody"]],
            dblStringBody: [
              [/"/, "string", "@popall"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              { include: "@variables" },
              [/./, "string"],
            ],
            quotedConstructs: [
              [/(q|qw|tr|y)\s*\(/, { token: "string.delim", switchTo: "@qstring.(.)" }],
              [/(q|qw|tr|y)\s*\[/, { token: "string.delim", switchTo: "@qstring.[.]" }],
              [/(q|qw|tr|y)\s*\{/, { token: "string.delim", switchTo: "@qstring.{.}" }],
              [/(q|qw|tr|y)\s*</, { token: "string.delim", switchTo: "@qstring.<.>" }],
              [/(q|qw|tr|y)#/, { token: "string.delim", switchTo: "@qstring.#.#" }],
              [
                /(q|qw|tr|y)\s*([^A-Za-z0-9#\s])/,
                { token: "string.delim", switchTo: "@qstring.$2.$2" },
              ],
              [/(q|qw|tr|y)\s+(\w)/, { token: "string.delim", switchTo: "@qstring.$2.$2" }],
              [/(qr|m|s)\s*\(/, { token: "regexp.delim", switchTo: "@qregexp.(.)" }],
              [/(qr|m|s)\s*\[/, { token: "regexp.delim", switchTo: "@qregexp.[.]" }],
              [/(qr|m|s)\s*\{/, { token: "regexp.delim", switchTo: "@qregexp.{.}" }],
              [/(qr|m|s)\s*</, { token: "regexp.delim", switchTo: "@qregexp.<.>" }],
              [/(qr|m|s)#/, { token: "regexp.delim", switchTo: "@qregexp.#.#" }],
              [
                /(qr|m|s)\s*([^A-Za-z0-9_#\s])/,
                { token: "regexp.delim", switchTo: "@qregexp.$2.$2" },
              ],
              [/(qr|m|s)\s+(\w)/, { token: "regexp.delim", switchTo: "@qregexp.$2.$2" }],
              [/(qq|qx)\s*\(/, { token: "string.delim", switchTo: "@qqstring.(.)" }],
              [/(qq|qx)\s*\[/, { token: "string.delim", switchTo: "@qqstring.[.]" }],
              [/(qq|qx)\s*\{/, { token: "string.delim", switchTo: "@qqstring.{.}" }],
              [/(qq|qx)\s*</, { token: "string.delim", switchTo: "@qqstring.<.>" }],
              [/(qq|qx)#/, { token: "string.delim", switchTo: "@qqstring.#.#" }],
              [
                /(qq|qx)\s*([^A-Za-z0-9#\s])/,
                { token: "string.delim", switchTo: "@qqstring.$2.$2" },
              ],
              [/(qq|qx)\s+(\w)/, { token: "string.delim", switchTo: "@qqstring.$2.$2" }],
            ],
            qstring: [
              [/\\./, "string.escape"],
              [
                /./,
                {
                  cases: {
                    "$#==$S3": { token: "string.delim", next: "@pop" },
                    "$#==$S2": { token: "string.delim", next: "@push" },
                    "@default": "string",
                  },
                },
              ],
            ],
            qregexp: [
              { include: "@variables" },
              [/\\./, "regexp.escape"],
              [
                /./,
                {
                  cases: {
                    "$#==$S3": { token: "regexp.delim", next: "@regexpModifiers" },
                    "$#==$S2": { token: "regexp.delim", next: "@push" },
                    "@default": "regexp",
                  },
                },
              ],
            ],
            regexpModifiers: [
              [/[msixpodualngcer]+/, { token: "regexp.modifier", next: "@popall" }],
            ],
            qqstring: [{ include: "@variables" }, { include: "@qstring" }],
            heredoc: [
              [
                /<<\s*['"`]?([\w\-]+)['"`]?/,
                { token: "string.heredoc.delimiter", next: "@heredocBody.$1" },
              ],
            ],
            heredocBody: [
              [
                /^([\w\-]+)$/,
                {
                  cases: {
                    "$1==$S2": [{ token: "string.heredoc.delimiter", next: "@popall" }],
                    "@default": "string.heredoc",
                  },
                },
              ],
              [/./, "string.heredoc"],
            ],
            perldoc: [[/^=\w/, "comment.doc", "@perldocBody"]],
            perldocBody: [
              [/^=cut\b/, "type.identifier", "@popall"],
              [/./, "comment.doc"],
            ],
            variables: [
              [/\$\w+/, "variable"],
              [/@\w+/, "variable"],
              [/%\w+/, "variable"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  j3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "--", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".sql",
          ignoreCase: !0,
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          keywords: [
            "ALL",
            "ANALYSE",
            "ANALYZE",
            "AND",
            "ANY",
            "ARRAY",
            "AS",
            "ASC",
            "ASYMMETRIC",
            "AUTHORIZATION",
            "BINARY",
            "BOTH",
            "CASE",
            "CAST",
            "CHECK",
            "COLLATE",
            "COLLATION",
            "COLUMN",
            "CONCURRENTLY",
            "CONSTRAINT",
            "CREATE",
            "CROSS",
            "CURRENT_CATALOG",
            "CURRENT_DATE",
            "CURRENT_ROLE",
            "CURRENT_SCHEMA",
            "CURRENT_TIME",
            "CURRENT_TIMESTAMP",
            "CURRENT_USER",
            "DEFAULT",
            "DEFERRABLE",
            "DESC",
            "DISTINCT",
            "DO",
            "ELSE",
            "END",
            "EXCEPT",
            "FALSE",
            "FETCH",
            "FOR",
            "FOREIGN",
            "FREEZE",
            "FROM",
            "FULL",
            "GRANT",
            "GROUP",
            "HAVING",
            "ILIKE",
            "IN",
            "INITIALLY",
            "INNER",
            "INTERSECT",
            "INTO",
            "IS",
            "ISNULL",
            "JOIN",
            "LATERAL",
            "LEADING",
            "LEFT",
            "LIKE",
            "LIMIT",
            "LOCALTIME",
            "LOCALTIMESTAMP",
            "NATURAL",
            "NOT",
            "NOTNULL",
            "NULL",
            "OFFSET",
            "ON",
            "ONLY",
            "OR",
            "ORDER",
            "OUTER",
            "OVERLAPS",
            "PLACING",
            "PRIMARY",
            "REFERENCES",
            "RETURNING",
            "RIGHT",
            "SELECT",
            "SESSION_USER",
            "SIMILAR",
            "SOME",
            "SYMMETRIC",
            "TABLE",
            "TABLESAMPLE",
            "THEN",
            "TO",
            "TRAILING",
            "TRUE",
            "UNION",
            "UNIQUE",
            "USER",
            "USING",
            "VARIADIC",
            "VERBOSE",
            "WHEN",
            "WHERE",
            "WINDOW",
            "WITH",
          ],
          operators: [
            "AND",
            "BETWEEN",
            "IN",
            "LIKE",
            "NOT",
            "OR",
            "IS",
            "NULL",
            "INTERSECT",
            "UNION",
            "INNER",
            "JOIN",
            "LEFT",
            "OUTER",
            "RIGHT",
          ],
          builtinFunctions: [
            "abbrev",
            "abs",
            "acldefault",
            "aclexplode",
            "acos",
            "acosd",
            "acosh",
            "age",
            "any",
            "area",
            "array_agg",
            "array_append",
            "array_cat",
            "array_dims",
            "array_fill",
            "array_length",
            "array_lower",
            "array_ndims",
            "array_position",
            "array_positions",
            "array_prepend",
            "array_remove",
            "array_replace",
            "array_to_json",
            "array_to_string",
            "array_to_tsvector",
            "array_upper",
            "ascii",
            "asin",
            "asind",
            "asinh",
            "atan",
            "atan2",
            "atan2d",
            "atand",
            "atanh",
            "avg",
            "bit",
            "bit_and",
            "bit_count",
            "bit_length",
            "bit_or",
            "bit_xor",
            "bool_and",
            "bool_or",
            "bound_box",
            "box",
            "brin_desummarize_range",
            "brin_summarize_new_values",
            "brin_summarize_range",
            "broadcast",
            "btrim",
            "cardinality",
            "cbrt",
            "ceil",
            "ceiling",
            "center",
            "char_length",
            "character_length",
            "chr",
            "circle",
            "clock_timestamp",
            "coalesce",
            "col_description",
            "concat",
            "concat_ws",
            "convert",
            "convert_from",
            "convert_to",
            "corr",
            "cos",
            "cosd",
            "cosh",
            "cot",
            "cotd",
            "count",
            "covar_pop",
            "covar_samp",
            "cume_dist",
            "current_catalog",
            "current_database",
            "current_date",
            "current_query",
            "current_role",
            "current_schema",
            "current_schemas",
            "current_setting",
            "current_time",
            "current_timestamp",
            "current_user",
            "currval",
            "cursor_to_xml",
            "cursor_to_xmlschema",
            "date_bin",
            "date_part",
            "date_trunc",
            "database_to_xml",
            "database_to_xml_and_xmlschema",
            "database_to_xmlschema",
            "decode",
            "degrees",
            "dense_rank",
            "diagonal",
            "diameter",
            "div",
            "encode",
            "enum_first",
            "enum_last",
            "enum_range",
            "every",
            "exp",
            "extract",
            "factorial",
            "family",
            "first_value",
            "floor",
            "format",
            "format_type",
            "gcd",
            "gen_random_uuid",
            "generate_series",
            "generate_subscripts",
            "get_bit",
            "get_byte",
            "get_current_ts_config",
            "gin_clean_pending_list",
            "greatest",
            "grouping",
            "has_any_column_privilege",
            "has_column_privilege",
            "has_database_privilege",
            "has_foreign_data_wrapper_privilege",
            "has_function_privilege",
            "has_language_privilege",
            "has_schema_privilege",
            "has_sequence_privilege",
            "has_server_privilege",
            "has_table_privilege",
            "has_tablespace_privilege",
            "has_type_privilege",
            "height",
            "host",
            "hostmask",
            "inet_client_addr",
            "inet_client_port",
            "inet_merge",
            "inet_same_family",
            "inet_server_addr",
            "inet_server_port",
            "initcap",
            "isclosed",
            "isempty",
            "isfinite",
            "isopen",
            "json_agg",
            "json_array_elements",
            "json_array_elements_text",
            "json_array_length",
            "json_build_array",
            "json_build_object",
            "json_each",
            "json_each_text",
            "json_extract_path",
            "json_extract_path_text",
            "json_object",
            "json_object_agg",
            "json_object_keys",
            "json_populate_record",
            "json_populate_recordset",
            "json_strip_nulls",
            "json_to_record",
            "json_to_recordset",
            "json_to_tsvector",
            "json_typeof",
            "jsonb_agg",
            "jsonb_array_elements",
            "jsonb_array_elements_text",
            "jsonb_array_length",
            "jsonb_build_array",
            "jsonb_build_object",
            "jsonb_each",
            "jsonb_each_text",
            "jsonb_extract_path",
            "jsonb_extract_path_text",
            "jsonb_insert",
            "jsonb_object",
            "jsonb_object_agg",
            "jsonb_object_keys",
            "jsonb_path_exists",
            "jsonb_path_match",
            "jsonb_path_query",
            "jsonb_path_query_array",
            "jsonb_path_exists_tz",
            "jsonb_path_query_first",
            "jsonb_path_query_array_tz",
            "jsonb_path_query_first_tz",
            "jsonb_path_query_tz",
            "jsonb_path_match_tz",
            "jsonb_populate_record",
            "jsonb_populate_recordset",
            "jsonb_pretty",
            "jsonb_set",
            "jsonb_set_lax",
            "jsonb_strip_nulls",
            "jsonb_to_record",
            "jsonb_to_recordset",
            "jsonb_to_tsvector",
            "jsonb_typeof",
            "justify_days",
            "justify_hours",
            "justify_interval",
            "lag",
            "last_value",
            "lastval",
            "lcm",
            "lead",
            "least",
            "left",
            "length",
            "line",
            "ln",
            "localtime",
            "localtimestamp",
            "log",
            "log10",
            "lower",
            "lower_inc",
            "lower_inf",
            "lpad",
            "lseg",
            "ltrim",
            "macaddr8_set7bit",
            "make_date",
            "make_interval",
            "make_time",
            "make_timestamp",
            "make_timestamptz",
            "makeaclitem",
            "masklen",
            "max",
            "md5",
            "min",
            "min_scale",
            "mod",
            "mode",
            "multirange",
            "netmask",
            "network",
            "nextval",
            "normalize",
            "now",
            "npoints",
            "nth_value",
            "ntile",
            "nullif",
            "num_nonnulls",
            "num_nulls",
            "numnode",
            "obj_description",
            "octet_length",
            "overlay",
            "parse_ident",
            "path",
            "pclose",
            "percent_rank",
            "percentile_cont",
            "percentile_disc",
            "pg_advisory_lock",
            "pg_advisory_lock_shared",
            "pg_advisory_unlock",
            "pg_advisory_unlock_all",
            "pg_advisory_unlock_shared",
            "pg_advisory_xact_lock",
            "pg_advisory_xact_lock_shared",
            "pg_backend_pid",
            "pg_backup_start_time",
            "pg_blocking_pids",
            "pg_cancel_backend",
            "pg_client_encoding",
            "pg_collation_actual_version",
            "pg_collation_is_visible",
            "pg_column_compression",
            "pg_column_size",
            "pg_conf_load_time",
            "pg_control_checkpoint",
            "pg_control_init",
            "pg_control_recovery",
            "pg_control_system",
            "pg_conversion_is_visible",
            "pg_copy_logical_replication_slot",
            "pg_copy_physical_replication_slot",
            "pg_create_logical_replication_slot",
            "pg_create_physical_replication_slot",
            "pg_create_restore_point",
            "pg_current_logfile",
            "pg_current_snapshot",
            "pg_current_wal_flush_lsn",
            "pg_current_wal_insert_lsn",
            "pg_current_wal_lsn",
            "pg_current_xact_id",
            "pg_current_xact_id_if_assigned",
            "pg_current_xlog_flush_location",
            "pg_current_xlog_insert_location",
            "pg_current_xlog_location",
            "pg_database_size",
            "pg_describe_object",
            "pg_drop_replication_slot",
            "pg_event_trigger_ddl_commands",
            "pg_event_trigger_dropped_objects",
            "pg_event_trigger_table_rewrite_oid",
            "pg_event_trigger_table_rewrite_reason",
            "pg_export_snapshot",
            "pg_filenode_relation",
            "pg_function_is_visible",
            "pg_get_catalog_foreign_keys",
            "pg_get_constraintdef",
            "pg_get_expr",
            "pg_get_function_arguments",
            "pg_get_function_identity_arguments",
            "pg_get_function_result",
            "pg_get_functiondef",
            "pg_get_indexdef",
            "pg_get_keywords",
            "pg_get_object_address",
            "pg_get_owned_sequence",
            "pg_get_ruledef",
            "pg_get_serial_sequence",
            "pg_get_statisticsobjdef",
            "pg_get_triggerdef",
            "pg_get_userbyid",
            "pg_get_viewdef",
            "pg_get_wal_replay_pause_state",
            "pg_has_role",
            "pg_identify_object",
            "pg_identify_object_as_address",
            "pg_import_system_collations",
            "pg_index_column_has_property",
            "pg_index_has_property",
            "pg_indexam_has_property",
            "pg_indexes_size",
            "pg_is_in_backup",
            "pg_is_in_recovery",
            "pg_is_other_temp_schema",
            "pg_is_wal_replay_paused",
            "pg_is_xlog_replay_paused",
            "pg_jit_available",
            "pg_last_committed_xact",
            "pg_last_wal_receive_lsn",
            "pg_last_wal_replay_lsn",
            "pg_last_xact_replay_timestamp",
            "pg_last_xlog_receive_location",
            "pg_last_xlog_replay_location",
            "pg_listening_channels",
            "pg_log_backend_memory_contexts",
            "pg_logical_emit_message",
            "pg_logical_slot_get_binary_changes",
            "pg_logical_slot_get_changes",
            "pg_logical_slot_peek_binary_changes",
            "pg_logical_slot_peek_changes",
            "pg_ls_archive_statusdir",
            "pg_ls_dir",
            "pg_ls_logdir",
            "pg_ls_tmpdir",
            "pg_ls_waldir",
            "pg_mcv_list_items",
            "pg_my_temp_schema",
            "pg_notification_queue_usage",
            "pg_opclass_is_visible",
            "pg_operator_is_visible",
            "pg_opfamily_is_visible",
            "pg_options_to_table",
            "pg_partition_ancestors",
            "pg_partition_root",
            "pg_partition_tree",
            "pg_postmaster_start_time",
            "pg_promote",
            "pg_read_binary_file",
            "pg_read_file",
            "pg_relation_filenode",
            "pg_relation_filepath",
            "pg_relation_size",
            "pg_reload_conf",
            "pg_replication_origin_advance",
            "pg_replication_origin_create",
            "pg_replication_origin_drop",
            "pg_replication_origin_oid",
            "pg_replication_origin_progress",
            "pg_replication_origin_session_is_setup",
            "pg_replication_origin_session_progress",
            "pg_replication_origin_session_reset",
            "pg_replication_origin_session_setup",
            "pg_replication_origin_xact_reset",
            "pg_replication_origin_xact_setup",
            "pg_replication_slot_advance",
            "pg_rotate_logfile",
            "pg_safe_snapshot_blocking_pids",
            "pg_size_bytes",
            "pg_size_pretty",
            "pg_sleep",
            "pg_sleep_for",
            "pg_sleep_until",
            "pg_snapshot_xip",
            "pg_snapshot_xmax",
            "pg_snapshot_xmin",
            "pg_start_backup",
            "pg_stat_file",
            "pg_statistics_obj_is_visible",
            "pg_stop_backup",
            "pg_switch_wal",
            "pg_switch_xlog",
            "pg_table_is_visible",
            "pg_table_size",
            "pg_tablespace_databases",
            "pg_tablespace_location",
            "pg_tablespace_size",
            "pg_terminate_backend",
            "pg_total_relation_size",
            "pg_trigger_depth",
            "pg_try_advisory_lock",
            "pg_try_advisory_lock_shared",
            "pg_try_advisory_xact_lock",
            "pg_try_advisory_xact_lock_shared",
            "pg_ts_config_is_visible",
            "pg_ts_dict_is_visible",
            "pg_ts_parser_is_visible",
            "pg_ts_template_is_visible",
            "pg_type_is_visible",
            "pg_typeof",
            "pg_visible_in_snapshot",
            "pg_wal_lsn_diff",
            "pg_wal_replay_pause",
            "pg_wal_replay_resume",
            "pg_walfile_name",
            "pg_walfile_name_offset",
            "pg_xact_commit_timestamp",
            "pg_xact_commit_timestamp_origin",
            "pg_xact_status",
            "pg_xlog_location_diff",
            "pg_xlog_replay_pause",
            "pg_xlog_replay_resume",
            "pg_xlogfile_name",
            "pg_xlogfile_name_offset",
            "phraseto_tsquery",
            "pi",
            "plainto_tsquery",
            "point",
            "polygon",
            "popen",
            "position",
            "power",
            "pqserverversion",
            "query_to_xml",
            "query_to_xml_and_xmlschema",
            "query_to_xmlschema",
            "querytree",
            "quote_ident",
            "quote_literal",
            "quote_nullable",
            "radians",
            "radius",
            "random",
            "range_agg",
            "range_intersect_agg",
            "range_merge",
            "rank",
            "regexp_count",
            "regexp_instr",
            "regexp_like",
            "regexp_match",
            "regexp_matches",
            "regexp_replace",
            "regexp_split_to_array",
            "regexp_split_to_table",
            "regexp_substr",
            "regr_avgx",
            "regr_avgy",
            "regr_count",
            "regr_intercept",
            "regr_r2",
            "regr_slope",
            "regr_sxx",
            "regr_sxy",
            "regr_syy",
            "repeat",
            "replace",
            "reverse",
            "right",
            "round",
            "row_number",
            "row_security_active",
            "row_to_json",
            "rpad",
            "rtrim",
            "scale",
            "schema_to_xml",
            "schema_to_xml_and_xmlschema",
            "schema_to_xmlschema",
            "session_user",
            "set_bit",
            "set_byte",
            "set_config",
            "set_masklen",
            "setseed",
            "setval",
            "setweight",
            "sha224",
            "sha256",
            "sha384",
            "sha512",
            "shobj_description",
            "sign",
            "sin",
            "sind",
            "sinh",
            "slope",
            "split_part",
            "sprintf",
            "sqrt",
            "starts_with",
            "statement_timestamp",
            "stddev",
            "stddev_pop",
            "stddev_samp",
            "string_agg",
            "string_to_array",
            "string_to_table",
            "strip",
            "strpos",
            "substr",
            "substring",
            "sum",
            "suppress_redundant_updates_trigger",
            "table_to_xml",
            "table_to_xml_and_xmlschema",
            "table_to_xmlschema",
            "tan",
            "tand",
            "tanh",
            "text",
            "timeofday",
            "timezone",
            "to_ascii",
            "to_char",
            "to_date",
            "to_hex",
            "to_json",
            "to_number",
            "to_regclass",
            "to_regcollation",
            "to_regnamespace",
            "to_regoper",
            "to_regoperator",
            "to_regproc",
            "to_regprocedure",
            "to_regrole",
            "to_regtype",
            "to_timestamp",
            "to_tsquery",
            "to_tsvector",
            "transaction_timestamp",
            "translate",
            "trim",
            "trim_array",
            "trim_scale",
            "trunc",
            "ts_debug",
            "ts_delete",
            "ts_filter",
            "ts_headline",
            "ts_lexize",
            "ts_parse",
            "ts_rank",
            "ts_rank_cd",
            "ts_rewrite",
            "ts_stat",
            "ts_token_type",
            "tsquery_phrase",
            "tsvector_to_array",
            "tsvector_update_trigger",
            "tsvector_update_trigger_column",
            "txid_current",
            "txid_current_if_assigned",
            "txid_current_snapshot",
            "txid_snapshot_xip",
            "txid_snapshot_xmax",
            "txid_snapshot_xmin",
            "txid_status",
            "txid_visible_in_snapshot",
            "unistr",
            "unnest",
            "upper",
            "upper_inc",
            "upper_inf",
            "user",
            "var_pop",
            "var_samp",
            "variance",
            "version",
            "websearch_to_tsquery",
            "width",
            "width_bucket",
            "xml_is_well_formed",
            "xml_is_well_formed_content",
            "xml_is_well_formed_document",
            "xmlagg",
            "xmlcomment",
            "xmlconcat",
            "xmlelement",
            "xmlexists",
            "xmlforest",
            "xmlparse",
            "xmlpi",
            "xmlroot",
            "xmlserialize",
            "xpath",
            "xpath_exists",
          ],
          builtinVariables: [],
          pseudoColumns: [],
          tokenizer: {
            root: [
              { include: "@comments" },
              { include: "@whitespace" },
              { include: "@pseudoColumns" },
              { include: "@numbers" },
              { include: "@strings" },
              { include: "@complexIdentifiers" },
              { include: "@scopes" },
              [/[;,.]/, "delimiter"],
              [/[()]/, "@brackets"],
              [
                /[\w@#$]+/,
                {
                  cases: {
                    "@operators": "operator",
                    "@builtinVariables": "predefined",
                    "@builtinFunctions": "predefined",
                    "@keywords": "keyword",
                    "@default": "identifier",
                  },
                },
              ],
              [/[<>=!%&+\-*/|~^]/, "operator"],
            ],
            whitespace: [[/\s+/, "white"]],
            comments: [
              [/--+.*/, "comment"],
              [/\/\*/, { token: "comment.quote", next: "@comment" }],
            ],
            comment: [
              [/[^*/]+/, "comment"],
              [/\*\//, { token: "comment.quote", next: "@pop" }],
              [/./, "comment"],
            ],
            pseudoColumns: [
              [
                /[$][A-Za-z_][\w@#$]*/,
                { cases: { "@pseudoColumns": "predefined", "@default": "identifier" } },
              ],
            ],
            numbers: [
              [/0[xX][0-9a-fA-F]*/, "number"],
              [/[$][+-]*\d*(\.\d*)?/, "number"],
              [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, "number"],
            ],
            strings: [[/'/, { token: "string", next: "@string" }]],
            string: [
              [/[^']+/, "string"],
              [/''/, "string"],
              [/'/, { token: "string", next: "@pop" }],
            ],
            complexIdentifiers: [[/"/, { token: "identifier.quote", next: "@quotedIdentifier" }]],
            quotedIdentifier: [
              [/[^"]+/, "identifier"],
              [/""/, "identifier"],
              [/"/, { token: "identifier.quote", next: "@pop" }],
            ],
            scopes: [],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  F3e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}", notIn: ["string"] },
      { open: "[", close: "]", notIn: ["string"] },
      { open: "(", close: ")", notIn: ["string"] },
      { open: '"', close: '"', notIn: ["string"] },
      { open: "'", close: "'", notIn: ["string", "comment"] },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*(#|//)region\\b"),
        end: new RegExp("^\\s*(#|//)endregion\\b"),
      },
    },
  },
  B3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: F3e,
        language: {
          defaultToken: "",
          tokenPostfix: "",
          tokenizer: {
            root: [
              [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.root" }],
              [/<!DOCTYPE/, "metatag.html", "@doctype"],
              [/<!--/, "comment.html", "@comment"],
              [/(<)(\w+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
              [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
              [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
              [/(<)([:\w]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
              [/(<\/)(\w+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
              [/</, "delimiter.html"],
              [/[^<]+/],
            ],
            doctype: [
              [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.comment" }],
              [/[^>]+/, "metatag.content.html"],
              [/>/, "metatag.html", "@pop"],
            ],
            comment: [
              [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.comment" }],
              [/-->/, "comment.html", "@pop"],
              [/[^-]+/, "comment.content.html"],
              [/./, "comment.content.html"],
            ],
            otherTag: [
              [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.otherTag" }],
              [/\/?>/, "delimiter.html", "@pop"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
            ],
            script: [
              [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.script" }],
              [/type/, "attribute.name", "@scriptAfterType"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded.text/javascript",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [
                /(<\/)(script\s*)(>)/,
                ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }],
              ],
            ],
            scriptAfterType: [
              [
                /<\?((php)|=)?/,
                { token: "@rematch", switchTo: "@phpInSimpleState.scriptAfterType" },
              ],
              [/=/, "delimiter", "@scriptAfterTypeEquals"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded.text/javascript",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptAfterTypeEquals: [
              [
                /<\?((php)|=)?/,
                { token: "@rematch", switchTo: "@phpInSimpleState.scriptAfterTypeEquals" },
              ],
              [/"([^"]*)"/, { token: "attribute.value", switchTo: "@scriptWithCustomType.$1" }],
              [/'([^']*)'/, { token: "attribute.value", switchTo: "@scriptWithCustomType.$1" }],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded.text/javascript",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptWithCustomType: [
              [
                /<\?((php)|=)?/,
                { token: "@rematch", switchTo: "@phpInSimpleState.scriptWithCustomType.$S2" },
              ],
              [/>/, { token: "delimiter.html", next: "@scriptEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptEmbedded: [
              [
                /<\?((php)|=)?/,
                {
                  token: "@rematch",
                  switchTo: "@phpInEmbeddedState.scriptEmbedded.$S2",
                  nextEmbedded: "@pop",
                },
              ],
              [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
            ],
            style: [
              [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.style" }],
              [/type/, "attribute.name", "@styleAfterType"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@styleEmbedded.text/css",
                  nextEmbedded: "text/css",
                },
              ],
              [/[ \t\r\n]+/],
              [
                /(<\/)(style\s*)(>)/,
                ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }],
              ],
            ],
            styleAfterType: [
              [
                /<\?((php)|=)?/,
                { token: "@rematch", switchTo: "@phpInSimpleState.styleAfterType" },
              ],
              [/=/, "delimiter", "@styleAfterTypeEquals"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@styleEmbedded.text/css",
                  nextEmbedded: "text/css",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleAfterTypeEquals: [
              [
                /<\?((php)|=)?/,
                { token: "@rematch", switchTo: "@phpInSimpleState.styleAfterTypeEquals" },
              ],
              [/"([^"]*)"/, { token: "attribute.value", switchTo: "@styleWithCustomType.$1" }],
              [/'([^']*)'/, { token: "attribute.value", switchTo: "@styleWithCustomType.$1" }],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@styleEmbedded.text/css",
                  nextEmbedded: "text/css",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleWithCustomType: [
              [
                /<\?((php)|=)?/,
                { token: "@rematch", switchTo: "@phpInSimpleState.styleWithCustomType.$S2" },
              ],
              [/>/, { token: "delimiter.html", next: "@styleEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleEmbedded: [
              [
                /<\?((php)|=)?/,
                {
                  token: "@rematch",
                  switchTo: "@phpInEmbeddedState.styleEmbedded.$S2",
                  nextEmbedded: "@pop",
                },
              ],
              [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
            ],
            phpInSimpleState: [
              [/<\?((php)|=)?/, "metatag.php"],
              [/\?>/, { token: "metatag.php", switchTo: "@$S2.$S3" }],
              { include: "phpRoot" },
            ],
            phpInEmbeddedState: [
              [/<\?((php)|=)?/, "metatag.php"],
              [/\?>/, { token: "metatag.php", switchTo: "@$S2.$S3", nextEmbedded: "$S3" }],
              { include: "phpRoot" },
            ],
            phpRoot: [
              [
                /[a-zA-Z_]\w*/,
                {
                  cases: {
                    "@phpKeywords": { token: "keyword.php" },
                    "@phpCompileTimeConstants": { token: "constant.php" },
                    "@default": "identifier.php",
                  },
                },
              ],
              [
                /[$a-zA-Z_]\w*/,
                {
                  cases: {
                    "@phpPreDefinedVariables": { token: "variable.predefined.php" },
                    "@default": "variable.php",
                  },
                },
              ],
              [/[{}]/, "delimiter.bracket.php"],
              [/[\[\]]/, "delimiter.array.php"],
              [/[()]/, "delimiter.parenthesis.php"],
              [/[ \t\r\n]+/],
              [/(#|\/\/)$/, "comment.php"],
              [/(#|\/\/)/, "comment.php", "@phpLineComment"],
              [/\/\*/, "comment.php", "@phpComment"],
              [/"/, "string.php", "@phpDoubleQuoteString"],
              [/'/, "string.php", "@phpSingleQuoteString"],
              [/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,\@]/, "delimiter.php"],
              [/\d*\d+[eE]([\-+]?\d+)?/, "number.float.php"],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float.php"],
              [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex.php"],
              [/0[0-7']*[0-7]/, "number.octal.php"],
              [/0[bB][0-1']*[0-1]/, "number.binary.php"],
              [/\d[\d']*/, "number.php"],
              [/\d/, "number.php"],
            ],
            phpComment: [
              [/\*\//, "comment.php", "@pop"],
              [/[^*]+/, "comment.php"],
              [/./, "comment.php"],
            ],
            phpLineComment: [
              [/\?>/, { token: "@rematch", next: "@pop" }],
              [/.$/, "comment.php", "@pop"],
              [/[^?]+$/, "comment.php", "@pop"],
              [/[^?]+/, "comment.php"],
              [/./, "comment.php"],
            ],
            phpDoubleQuoteString: [
              [/[^\\"]+/, "string.php"],
              [/@escapes/, "string.escape.php"],
              [/\\./, "string.escape.invalid.php"],
              [/"/, "string.php", "@pop"],
            ],
            phpSingleQuoteString: [
              [/[^\\']+/, "string.php"],
              [/@escapes/, "string.escape.php"],
              [/\\./, "string.escape.invalid.php"],
              [/'/, "string.php", "@pop"],
            ],
          },
          phpKeywords: [
            "abstract",
            "and",
            "array",
            "as",
            "break",
            "callable",
            "case",
            "catch",
            "cfunction",
            "class",
            "clone",
            "const",
            "continue",
            "declare",
            "default",
            "do",
            "else",
            "elseif",
            "enddeclare",
            "endfor",
            "endforeach",
            "endif",
            "endswitch",
            "endwhile",
            "extends",
            "false",
            "final",
            "for",
            "foreach",
            "function",
            "global",
            "goto",
            "if",
            "implements",
            "interface",
            "instanceof",
            "insteadof",
            "namespace",
            "new",
            "null",
            "object",
            "old_function",
            "or",
            "private",
            "protected",
            "public",
            "resource",
            "static",
            "switch",
            "throw",
            "trait",
            "try",
            "true",
            "use",
            "var",
            "while",
            "xor",
            "die",
            "echo",
            "empty",
            "exit",
            "eval",
            "include",
            "include_once",
            "isset",
            "list",
            "require",
            "require_once",
            "return",
            "print",
            "unset",
            "yield",
            "__construct",
          ],
          phpCompileTimeConstants: [
            "__CLASS__",
            "__DIR__",
            "__FILE__",
            "__LINE__",
            "__NAMESPACE__",
            "__METHOD__",
            "__FUNCTION__",
            "__TRAIT__",
          ],
          phpPreDefinedVariables: [
            "$GLOBALS",
            "$_SERVER",
            "$_GET",
            "$_POST",
            "$_FILES",
            "$_REQUEST",
            "$_SESSION",
            "$_ENV",
            "$_COOKIE",
            "$php_errormsg",
            "$HTTP_RAW_POST_DATA",
            "$http_response_header",
            "$argc",
            "$argv",
          ],
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  V3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "#" },
          brackets: [
            ["[", "]"],
            ["<", ">"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "[", close: "]" },
            { open: "<", close: ">" },
            { open: "(", close: ")" },
          ],
          surroundingPairs: [
            { open: "[", close: "]" },
            { open: "<", close: ">" },
            { open: "(", close: ")" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".pla",
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "<", close: ">", token: "delimiter.angle" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          keywords: [
            ".i",
            ".o",
            ".mv",
            ".ilb",
            ".ob",
            ".label",
            ".type",
            ".phase",
            ".pair",
            ".symbolic",
            ".symbolic-output",
            ".kiss",
            ".p",
            ".e",
            ".end",
          ],
          comment: /#.*$/,
          identifier: /[a-zA-Z]+[a-zA-Z0-9_\-]*/,
          plaContent: /[01\-~\|]+/,
          tokenizer: {
            root: [
              { include: "@whitespace" },
              [/@comment/, "comment"],
              [
                /\.([a-zA-Z_\-]+)/,
                {
                  cases: {
                    "@eos": { token: "keyword.$1" },
                    "@keywords": {
                      cases: {
                        ".type": { token: "keyword.$1", next: "@type" },
                        "@default": { token: "keyword.$1", next: "@keywordArg" },
                      },
                    },
                    "@default": { token: "keyword.$1" },
                  },
                },
              ],
              [/@identifier/, "identifier"],
              [/@plaContent/, "string"],
            ],
            whitespace: [[/[ \t\r\n]+/, ""]],
            type: [{ include: "@whitespace" }, [/\w+/, { token: "type", next: "@pop" }]],
            keywordArg: [
              [/[ \t\r\n]+/, { cases: { "@eos": { token: "", next: "@pop" }, "@default": "" } }],
              [/@comment/, "comment", "@pop"],
              [
                /[<>()\[\]]/,
                {
                  cases: { "@eos": { token: "@brackets", next: "@pop" }, "@default": "@brackets" },
                },
              ],
              [
                /\-?\d+/,
                { cases: { "@eos": { token: "number", next: "@pop" }, "@default": "number" } },
              ],
              [
                /@identifier/,
                {
                  cases: {
                    "@eos": { token: "identifier", next: "@pop" },
                    "@default": "identifier",
                  },
                },
              ],
              [
                /[;=]/,
                {
                  cases: { "@eos": { token: "delimiter", next: "@pop" }, "@default": "delimiter" },
                },
              ],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  W3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["(*", "*)"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
            ["<", ">"],
          ],
          autoClosingPairs: [
            { open: '"', close: '"', notIn: ["string", "comment"] },
            { open: "{", close: "}", notIn: ["string", "comment"] },
            { open: "[", close: "]", notIn: ["string", "comment"] },
            { open: "(", close: ")", notIn: ["string", "comment"] },
          ],
        },
        language: {
          tokenPostfix: ".pats",
          defaultToken: "invalid",
          keywords: [
            "abstype",
            "abst0ype",
            "absprop",
            "absview",
            "absvtype",
            "absviewtype",
            "absvt0ype",
            "absviewt0ype",
            "as",
            "and",
            "assume",
            "begin",
            "classdec",
            "datasort",
            "datatype",
            "dataprop",
            "dataview",
            "datavtype",
            "dataviewtype",
            "do",
            "end",
            "extern",
            "extype",
            "extvar",
            "exception",
            "fn",
            "fnx",
            "fun",
            "prfn",
            "prfun",
            "praxi",
            "castfn",
            "if",
            "then",
            "else",
            "ifcase",
            "in",
            "infix",
            "infixl",
            "infixr",
            "prefix",
            "postfix",
            "implmnt",
            "implement",
            "primplmnt",
            "primplement",
            "import",
            "let",
            "local",
            "macdef",
            "macrodef",
            "nonfix",
            "symelim",
            "symintr",
            "overload",
            "of",
            "op",
            "rec",
            "sif",
            "scase",
            "sortdef",
            "sta",
            "stacst",
            "stadef",
            "static",
            "staload",
            "dynload",
            "try",
            "tkindef",
            "typedef",
            "propdef",
            "viewdef",
            "vtypedef",
            "viewtypedef",
            "prval",
            "var",
            "prvar",
            "when",
            "where",
            "with",
            "withtype",
            "withprop",
            "withview",
            "withvtype",
            "withviewtype",
          ],
          keywords_dlr: [
            "$delay",
            "$ldelay",
            "$arrpsz",
            "$arrptrsize",
            "$d2ctype",
            "$effmask",
            "$effmask_ntm",
            "$effmask_exn",
            "$effmask_ref",
            "$effmask_wrt",
            "$effmask_all",
            "$extern",
            "$extkind",
            "$extype",
            "$extype_struct",
            "$extval",
            "$extfcall",
            "$extmcall",
            "$literal",
            "$myfilename",
            "$mylocation",
            "$myfunction",
            "$lst",
            "$lst_t",
            "$lst_vt",
            "$list",
            "$list_t",
            "$list_vt",
            "$rec",
            "$rec_t",
            "$rec_vt",
            "$record",
            "$record_t",
            "$record_vt",
            "$tup",
            "$tup_t",
            "$tup_vt",
            "$tuple",
            "$tuple_t",
            "$tuple_vt",
            "$break",
            "$continue",
            "$raise",
            "$showtype",
            "$vcopyenv_v",
            "$vcopyenv_vt",
            "$tempenver",
            "$solver_assert",
            "$solver_verify",
          ],
          keywords_srp: [
            "#if",
            "#ifdef",
            "#ifndef",
            "#then",
            "#elif",
            "#elifdef",
            "#elifndef",
            "#else",
            "#endif",
            "#error",
            "#prerr",
            "#print",
            "#assert",
            "#undef",
            "#define",
            "#include",
            "#require",
            "#pragma",
            "#codegen2",
            "#codegen3",
          ],
          irregular_keyword_list: [
            "val+",
            "val-",
            "val",
            "case+",
            "case-",
            "case",
            "addr@",
            "addr",
            "fold@",
            "free@",
            "fix@",
            "fix",
            "lam@",
            "lam",
            "llam@",
            "llam",
            "viewt@ype+",
            "viewt@ype-",
            "viewt@ype",
            "viewtype+",
            "viewtype-",
            "viewtype",
            "view+",
            "view-",
            "view@",
            "view",
            "type+",
            "type-",
            "type",
            "vtype+",
            "vtype-",
            "vtype",
            "vt@ype+",
            "vt@ype-",
            "vt@ype",
            "viewt@ype+",
            "viewt@ype-",
            "viewt@ype",
            "viewtype+",
            "viewtype-",
            "viewtype",
            "prop+",
            "prop-",
            "prop",
            "type+",
            "type-",
            "type",
            "t@ype",
            "t@ype+",
            "t@ype-",
            "abst@ype",
            "abstype",
            "absviewt@ype",
            "absvt@ype",
            "for*",
            "for",
            "while*",
            "while",
          ],
          keywords_types: [
            "bool",
            "double",
            "byte",
            "int",
            "short",
            "char",
            "void",
            "unit",
            "long",
            "float",
            "string",
            "strptr",
          ],
          keywords_effects: [
            "0",
            "fun",
            "clo",
            "prf",
            "funclo",
            "cloptr",
            "cloref",
            "ref",
            "ntm",
            "1",
          ],
          operators: [
            "@",
            "!",
            "|",
            "`",
            ":",
            "$",
            ".",
            "=",
            "#",
            "~",
            "..",
            "...",
            "=>",
            "=<>",
            "=/=>",
            "=>>",
            "=/=>>",
            "<",
            ">",
            "><",
            ".<",
            ">.",
            ".<>.",
            "->",
            "-<>",
          ],
          brackets: [
            { open: ",(", close: ")", token: "delimiter.parenthesis" },
            { open: "`(", close: ")", token: "delimiter.parenthesis" },
            { open: "%(", close: ")", token: "delimiter.parenthesis" },
            { open: "'(", close: ")", token: "delimiter.parenthesis" },
            { open: "'{", close: "}", token: "delimiter.parenthesis" },
            { open: "@(", close: ")", token: "delimiter.parenthesis" },
            { open: "@{", close: "}", token: "delimiter.brace" },
            { open: "@[", close: "]", token: "delimiter.square" },
            { open: "#[", close: "]", token: "delimiter.square" },
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "<", close: ">", token: "delimiter.angle" },
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          IDENTFST: /[a-zA-Z_]/,
          IDENTRST: /[a-zA-Z0-9_'$]/,
          symbolic: /[%&+-./:=@~`^|*!$#?<>]/,
          digit: /[0-9]/,
          digitseq0: /@digit*/,
          xdigit: /[0-9A-Za-z]/,
          xdigitseq0: /@xdigit*/,
          INTSP: /[lLuU]/,
          FLOATSP: /[fFlL]/,
          fexponent: /[eE][+-]?[0-9]+/,
          fexponent_bin: /[pP][+-]?[0-9]+/,
          deciexp: /\.[0-9]*@fexponent?/,
          hexiexp: /\.[0-9a-zA-Z]*@fexponent_bin?/,
          irregular_keywords:
            /val[+-]?|case[+-]?|addr\@?|fold\@|free\@|fix\@?|lam\@?|llam\@?|prop[+-]?|type[+-]?|view[+-@]?|viewt@?ype[+-]?|t@?ype[+-]?|v(iew)?t@?ype[+-]?|abst@?ype|absv(iew)?t@?ype|for\*?|while\*?/,
          ESCHAR: /[ntvbrfa\\\?'"\(\[\{]/,
          start: "root",
          tokenizer: {
            root: [
              { regex: /[ \t\r\n]+/, action: { token: "" } },
              { regex: /\(\*\)/, action: { token: "invalid" } },
              { regex: /\(\*/, action: { token: "comment", next: "lexing_COMMENT_block_ml" } },
              { regex: /\(/, action: "@brackets" },
              { regex: /\)/, action: "@brackets" },
              { regex: /\[/, action: "@brackets" },
              { regex: /\]/, action: "@brackets" },
              { regex: /\{/, action: "@brackets" },
              { regex: /\}/, action: "@brackets" },
              { regex: /,\(/, action: "@brackets" },
              { regex: /,/, action: { token: "delimiter.comma" } },
              { regex: /;/, action: { token: "delimiter.semicolon" } },
              { regex: /@\(/, action: "@brackets" },
              { regex: /@\[/, action: "@brackets" },
              { regex: /@\{/, action: "@brackets" },
              { regex: /:</, action: { token: "keyword", next: "@lexing_EFFECT_commaseq0" } },
              { regex: /\.@symbolic+/, action: { token: "identifier.sym" } },
              { regex: /\.@digit*@fexponent@FLOATSP*/, action: { token: "number.float" } },
              { regex: /\.@digit+/, action: { token: "number.float" } },
              {
                regex: /\$@IDENTFST@IDENTRST*/,
                action: {
                  cases: {
                    "@keywords_dlr": { token: "keyword.dlr" },
                    "@default": { token: "namespace" },
                  },
                },
              },
              {
                regex: /\#@IDENTFST@IDENTRST*/,
                action: {
                  cases: {
                    "@keywords_srp": { token: "keyword.srp" },
                    "@default": { token: "identifier" },
                  },
                },
              },
              { regex: /%\(/, action: { token: "delimiter.parenthesis" } },
              {
                regex: /^%{(#|\^|\$)?/,
                action: {
                  token: "keyword",
                  next: "@lexing_EXTCODE",
                  nextEmbedded: "text/javascript",
                },
              },
              { regex: /^%}/, action: { token: "keyword" } },
              { regex: /'\(/, action: { token: "delimiter.parenthesis" } },
              { regex: /'\[/, action: { token: "delimiter.bracket" } },
              { regex: /'\{/, action: { token: "delimiter.brace" } },
              [/(')(\\@ESCHAR|\\[xX]@xdigit+|\\@digit+)(')/, ["string", "string.escape", "string"]],
              [/'[^\\']'/, "string"],
              [/"/, "string.quote", "@lexing_DQUOTE"],
              { regex: /`\(/, action: "@brackets" },
              { regex: /\\/, action: { token: "punctuation" } },
              { regex: /@irregular_keywords(?!@IDENTRST)/, action: { token: "keyword" } },
              {
                regex: /@IDENTFST@IDENTRST*[<!\[]?/,
                action: {
                  cases: {
                    "@keywords": { token: "keyword" },
                    "@keywords_types": { token: "type" },
                    "@default": { token: "identifier" },
                  },
                },
              },
              { regex: /\/\/\/\//, action: { token: "comment", next: "@lexing_COMMENT_rest" } },
              { regex: /\/\/.*$/, action: { token: "comment" } },
              { regex: /\/\*/, action: { token: "comment", next: "@lexing_COMMENT_block_c" } },
              { regex: /-<|=</, action: { token: "keyword", next: "@lexing_EFFECT_commaseq0" } },
              {
                regex: /@symbolic+/,
                action: { cases: { "@operators": "keyword", "@default": "operator" } },
              },
              {
                regex: /0[xX]@xdigit+(@hexiexp|@fexponent_bin)@FLOATSP*/,
                action: { token: "number.float" },
              },
              { regex: /0[xX]@xdigit+@INTSP*/, action: { token: "number.hex" } },
              { regex: /0[0-7]+(?![0-9])@INTSP*/, action: { token: "number.octal" } },
              { regex: /@digit+(@fexponent|@deciexp)@FLOATSP*/, action: { token: "number.float" } },
              { regex: /@digit@digitseq0@INTSP*/, action: { token: "number.decimal" } },
              { regex: /@digit+@INTSP*/, action: { token: "number" } },
            ],
            lexing_COMMENT_block_ml: [
              [/[^\(\*]+/, "comment"],
              [/\(\*/, "comment", "@push"],
              [/\(\*/, "comment.invalid"],
              [/\*\)/, "comment", "@pop"],
              [/\*/, "comment"],
            ],
            lexing_COMMENT_block_c: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            lexing_COMMENT_rest: [
              [/$/, "comment", "@pop"],
              [/.*/, "comment"],
            ],
            lexing_EFFECT_commaseq0: [
              {
                regex: /@IDENTFST@IDENTRST+|@digit+/,
                action: {
                  cases: {
                    "@keywords_effects": { token: "type.effect" },
                    "@default": { token: "identifier" },
                  },
                },
              },
              { regex: /,/, action: { token: "punctuation" } },
              { regex: />/, action: { token: "@rematch", next: "@pop" } },
            ],
            lexing_EXTCODE: [
              { regex: /^%}/, action: { token: "@rematch", next: "@pop", nextEmbedded: "@pop" } },
              { regex: /[^%]+/, action: "" },
            ],
            lexing_DQUOTE: [
              { regex: /"/, action: { token: "string.quote", next: "@pop" } },
              {
                regex: /(\{\$)(@IDENTFST@IDENTRST*)(\})/,
                action: [
                  { token: "string.escape" },
                  { token: "identifier" },
                  { token: "string.escape" },
                ],
              },
              { regex: /\\$/, action: { token: "string.escape" } },
              { regex: /\\(@ESCHAR|[xX]@xdigit+|@digit+)/, action: { token: "string.escape" } },
              { regex: /[^\\"]+/, action: { token: "string" } },
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  H3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["[", "]"],
            ["(", ")"],
            ["{", "}"],
          ],
          autoClosingPairs: [
            { open: '"', close: '"', notIn: ["string", "comment", "identifier"] },
            { open: "[", close: "]", notIn: ["string", "comment", "identifier"] },
            { open: "(", close: ")", notIn: ["string", "comment", "identifier"] },
            { open: "{", close: "}", notIn: ["string", "comment", "identifier"] },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".pq",
          ignoreCase: !1,
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "{", close: "}", token: "delimiter.brackets" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          operatorKeywords: ["and", "not", "or"],
          keywords: [
            "as",
            "each",
            "else",
            "error",
            "false",
            "if",
            "in",
            "is",
            "let",
            "meta",
            "otherwise",
            "section",
            "shared",
            "then",
            "true",
            "try",
            "type",
          ],
          constructors: [
            "#binary",
            "#date",
            "#datetime",
            "#datetimezone",
            "#duration",
            "#table",
            "#time",
          ],
          constants: ["#infinity", "#nan", "#sections", "#shared"],
          typeKeywords: [
            "action",
            "any",
            "anynonnull",
            "none",
            "null",
            "logical",
            "number",
            "time",
            "date",
            "datetime",
            "datetimezone",
            "duration",
            "text",
            "binary",
            "list",
            "record",
            "table",
            "function",
          ],
          builtinFunctions: [
            "Access.Database",
            "Action.Return",
            "Action.Sequence",
            "Action.Try",
            "ActiveDirectory.Domains",
            "AdoDotNet.DataSource",
            "AdoDotNet.Query",
            "AdobeAnalytics.Cubes",
            "AnalysisServices.Database",
            "AnalysisServices.Databases",
            "AzureStorage.BlobContents",
            "AzureStorage.Blobs",
            "AzureStorage.Tables",
            "Binary.Buffer",
            "Binary.Combine",
            "Binary.Compress",
            "Binary.Decompress",
            "Binary.End",
            "Binary.From",
            "Binary.FromList",
            "Binary.FromText",
            "Binary.InferContentType",
            "Binary.Length",
            "Binary.ToList",
            "Binary.ToText",
            "BinaryFormat.7BitEncodedSignedInteger",
            "BinaryFormat.7BitEncodedUnsignedInteger",
            "BinaryFormat.Binary",
            "BinaryFormat.Byte",
            "BinaryFormat.ByteOrder",
            "BinaryFormat.Choice",
            "BinaryFormat.Decimal",
            "BinaryFormat.Double",
            "BinaryFormat.Group",
            "BinaryFormat.Length",
            "BinaryFormat.List",
            "BinaryFormat.Null",
            "BinaryFormat.Record",
            "BinaryFormat.SignedInteger16",
            "BinaryFormat.SignedInteger32",
            "BinaryFormat.SignedInteger64",
            "BinaryFormat.Single",
            "BinaryFormat.Text",
            "BinaryFormat.Transform",
            "BinaryFormat.UnsignedInteger16",
            "BinaryFormat.UnsignedInteger32",
            "BinaryFormat.UnsignedInteger64",
            "Byte.From",
            "Character.FromNumber",
            "Character.ToNumber",
            "Combiner.CombineTextByDelimiter",
            "Combiner.CombineTextByEachDelimiter",
            "Combiner.CombineTextByLengths",
            "Combiner.CombineTextByPositions",
            "Combiner.CombineTextByRanges",
            "Comparer.Equals",
            "Comparer.FromCulture",
            "Comparer.Ordinal",
            "Comparer.OrdinalIgnoreCase",
            "Csv.Document",
            "Cube.AddAndExpandDimensionColumn",
            "Cube.AddMeasureColumn",
            "Cube.ApplyParameter",
            "Cube.AttributeMemberId",
            "Cube.AttributeMemberProperty",
            "Cube.CollapseAndRemoveColumns",
            "Cube.Dimensions",
            "Cube.DisplayFolders",
            "Cube.Measures",
            "Cube.Parameters",
            "Cube.Properties",
            "Cube.PropertyKey",
            "Cube.ReplaceDimensions",
            "Cube.Transform",
            "Currency.From",
            "DB2.Database",
            "Date.AddDays",
            "Date.AddMonths",
            "Date.AddQuarters",
            "Date.AddWeeks",
            "Date.AddYears",
            "Date.Day",
            "Date.DayOfWeek",
            "Date.DayOfWeekName",
            "Date.DayOfYear",
            "Date.DaysInMonth",
            "Date.EndOfDay",
            "Date.EndOfMonth",
            "Date.EndOfQuarter",
            "Date.EndOfWeek",
            "Date.EndOfYear",
            "Date.From",
            "Date.FromText",
            "Date.IsInCurrentDay",
            "Date.IsInCurrentMonth",
            "Date.IsInCurrentQuarter",
            "Date.IsInCurrentWeek",
            "Date.IsInCurrentYear",
            "Date.IsInNextDay",
            "Date.IsInNextMonth",
            "Date.IsInNextNDays",
            "Date.IsInNextNMonths",
            "Date.IsInNextNQuarters",
            "Date.IsInNextNWeeks",
            "Date.IsInNextNYears",
            "Date.IsInNextQuarter",
            "Date.IsInNextWeek",
            "Date.IsInNextYear",
            "Date.IsInPreviousDay",
            "Date.IsInPreviousMonth",
            "Date.IsInPreviousNDays",
            "Date.IsInPreviousNMonths",
            "Date.IsInPreviousNQuarters",
            "Date.IsInPreviousNWeeks",
            "Date.IsInPreviousNYears",
            "Date.IsInPreviousQuarter",
            "Date.IsInPreviousWeek",
            "Date.IsInPreviousYear",
            "Date.IsInYearToDate",
            "Date.IsLeapYear",
            "Date.Month",
            "Date.MonthName",
            "Date.QuarterOfYear",
            "Date.StartOfDay",
            "Date.StartOfMonth",
            "Date.StartOfQuarter",
            "Date.StartOfWeek",
            "Date.StartOfYear",
            "Date.ToRecord",
            "Date.ToText",
            "Date.WeekOfMonth",
            "Date.WeekOfYear",
            "Date.Year",
            "DateTime.AddZone",
            "DateTime.Date",
            "DateTime.FixedLocalNow",
            "DateTime.From",
            "DateTime.FromFileTime",
            "DateTime.FromText",
            "DateTime.IsInCurrentHour",
            "DateTime.IsInCurrentMinute",
            "DateTime.IsInCurrentSecond",
            "DateTime.IsInNextHour",
            "DateTime.IsInNextMinute",
            "DateTime.IsInNextNHours",
            "DateTime.IsInNextNMinutes",
            "DateTime.IsInNextNSeconds",
            "DateTime.IsInNextSecond",
            "DateTime.IsInPreviousHour",
            "DateTime.IsInPreviousMinute",
            "DateTime.IsInPreviousNHours",
            "DateTime.IsInPreviousNMinutes",
            "DateTime.IsInPreviousNSeconds",
            "DateTime.IsInPreviousSecond",
            "DateTime.LocalNow",
            "DateTime.Time",
            "DateTime.ToRecord",
            "DateTime.ToText",
            "DateTimeZone.FixedLocalNow",
            "DateTimeZone.FixedUtcNow",
            "DateTimeZone.From",
            "DateTimeZone.FromFileTime",
            "DateTimeZone.FromText",
            "DateTimeZone.LocalNow",
            "DateTimeZone.RemoveZone",
            "DateTimeZone.SwitchZone",
            "DateTimeZone.ToLocal",
            "DateTimeZone.ToRecord",
            "DateTimeZone.ToText",
            "DateTimeZone.ToUtc",
            "DateTimeZone.UtcNow",
            "DateTimeZone.ZoneHours",
            "DateTimeZone.ZoneMinutes",
            "Decimal.From",
            "Diagnostics.ActivityId",
            "Diagnostics.Trace",
            "DirectQueryCapabilities.From",
            "Double.From",
            "Duration.Days",
            "Duration.From",
            "Duration.FromText",
            "Duration.Hours",
            "Duration.Minutes",
            "Duration.Seconds",
            "Duration.ToRecord",
            "Duration.ToText",
            "Duration.TotalDays",
            "Duration.TotalHours",
            "Duration.TotalMinutes",
            "Duration.TotalSeconds",
            "Embedded.Value",
            "Error.Record",
            "Excel.CurrentWorkbook",
            "Excel.Workbook",
            "Exchange.Contents",
            "Expression.Constant",
            "Expression.Evaluate",
            "Expression.Identifier",
            "Facebook.Graph",
            "File.Contents",
            "Folder.Contents",
            "Folder.Files",
            "Function.From",
            "Function.Invoke",
            "Function.InvokeAfter",
            "Function.IsDataSource",
            "GoogleAnalytics.Accounts",
            "Guid.From",
            "HdInsight.Containers",
            "HdInsight.Contents",
            "HdInsight.Files",
            "Hdfs.Contents",
            "Hdfs.Files",
            "Informix.Database",
            "Int16.From",
            "Int32.From",
            "Int64.From",
            "Int8.From",
            "ItemExpression.From",
            "Json.Document",
            "Json.FromValue",
            "Lines.FromBinary",
            "Lines.FromText",
            "Lines.ToBinary",
            "Lines.ToText",
            "List.Accumulate",
            "List.AllTrue",
            "List.Alternate",
            "List.AnyTrue",
            "List.Average",
            "List.Buffer",
            "List.Combine",
            "List.Contains",
            "List.ContainsAll",
            "List.ContainsAny",
            "List.Count",
            "List.Covariance",
            "List.DateTimeZones",
            "List.DateTimes",
            "List.Dates",
            "List.Difference",
            "List.Distinct",
            "List.Durations",
            "List.FindText",
            "List.First",
            "List.FirstN",
            "List.Generate",
            "List.InsertRange",
            "List.Intersect",
            "List.IsDistinct",
            "List.IsEmpty",
            "List.Last",
            "List.LastN",
            "List.MatchesAll",
            "List.MatchesAny",
            "List.Max",
            "List.MaxN",
            "List.Median",
            "List.Min",
            "List.MinN",
            "List.Mode",
            "List.Modes",
            "List.NonNullCount",
            "List.Numbers",
            "List.PositionOf",
            "List.PositionOfAny",
            "List.Positions",
            "List.Product",
            "List.Random",
            "List.Range",
            "List.RemoveFirstN",
            "List.RemoveItems",
            "List.RemoveLastN",
            "List.RemoveMatchingItems",
            "List.RemoveNulls",
            "List.RemoveRange",
            "List.Repeat",
            "List.ReplaceMatchingItems",
            "List.ReplaceRange",
            "List.ReplaceValue",
            "List.Reverse",
            "List.Select",
            "List.Single",
            "List.SingleOrDefault",
            "List.Skip",
            "List.Sort",
            "List.StandardDeviation",
            "List.Sum",
            "List.Times",
            "List.Transform",
            "List.TransformMany",
            "List.Union",
            "List.Zip",
            "Logical.From",
            "Logical.FromText",
            "Logical.ToText",
            "MQ.Queue",
            "MySQL.Database",
            "Number.Abs",
            "Number.Acos",
            "Number.Asin",
            "Number.Atan",
            "Number.Atan2",
            "Number.BitwiseAnd",
            "Number.BitwiseNot",
            "Number.BitwiseOr",
            "Number.BitwiseShiftLeft",
            "Number.BitwiseShiftRight",
            "Number.BitwiseXor",
            "Number.Combinations",
            "Number.Cos",
            "Number.Cosh",
            "Number.Exp",
            "Number.Factorial",
            "Number.From",
            "Number.FromText",
            "Number.IntegerDivide",
            "Number.IsEven",
            "Number.IsNaN",
            "Number.IsOdd",
            "Number.Ln",
            "Number.Log",
            "Number.Log10",
            "Number.Mod",
            "Number.Permutations",
            "Number.Power",
            "Number.Random",
            "Number.RandomBetween",
            "Number.Round",
            "Number.RoundAwayFromZero",
            "Number.RoundDown",
            "Number.RoundTowardZero",
            "Number.RoundUp",
            "Number.Sign",
            "Number.Sin",
            "Number.Sinh",
            "Number.Sqrt",
            "Number.Tan",
            "Number.Tanh",
            "Number.ToText",
            "OData.Feed",
            "Odbc.DataSource",
            "Odbc.Query",
            "OleDb.DataSource",
            "OleDb.Query",
            "Oracle.Database",
            "Percentage.From",
            "PostgreSQL.Database",
            "RData.FromBinary",
            "Record.AddField",
            "Record.Combine",
            "Record.Field",
            "Record.FieldCount",
            "Record.FieldNames",
            "Record.FieldOrDefault",
            "Record.FieldValues",
            "Record.FromList",
            "Record.FromTable",
            "Record.HasFields",
            "Record.RemoveFields",
            "Record.RenameFields",
            "Record.ReorderFields",
            "Record.SelectFields",
            "Record.ToList",
            "Record.ToTable",
            "Record.TransformFields",
            "Replacer.ReplaceText",
            "Replacer.ReplaceValue",
            "RowExpression.Column",
            "RowExpression.From",
            "Salesforce.Data",
            "Salesforce.Reports",
            "SapBusinessWarehouse.Cubes",
            "SapHana.Database",
            "SharePoint.Contents",
            "SharePoint.Files",
            "SharePoint.Tables",
            "Single.From",
            "Soda.Feed",
            "Splitter.SplitByNothing",
            "Splitter.SplitTextByAnyDelimiter",
            "Splitter.SplitTextByDelimiter",
            "Splitter.SplitTextByEachDelimiter",
            "Splitter.SplitTextByLengths",
            "Splitter.SplitTextByPositions",
            "Splitter.SplitTextByRanges",
            "Splitter.SplitTextByRepeatedLengths",
            "Splitter.SplitTextByWhitespace",
            "Sql.Database",
            "Sql.Databases",
            "SqlExpression.SchemaFrom",
            "SqlExpression.ToExpression",
            "Sybase.Database",
            "Table.AddColumn",
            "Table.AddIndexColumn",
            "Table.AddJoinColumn",
            "Table.AddKey",
            "Table.AggregateTableColumn",
            "Table.AlternateRows",
            "Table.Buffer",
            "Table.Column",
            "Table.ColumnCount",
            "Table.ColumnNames",
            "Table.ColumnsOfType",
            "Table.Combine",
            "Table.CombineColumns",
            "Table.Contains",
            "Table.ContainsAll",
            "Table.ContainsAny",
            "Table.DemoteHeaders",
            "Table.Distinct",
            "Table.DuplicateColumn",
            "Table.ExpandListColumn",
            "Table.ExpandRecordColumn",
            "Table.ExpandTableColumn",
            "Table.FillDown",
            "Table.FillUp",
            "Table.FilterWithDataTable",
            "Table.FindText",
            "Table.First",
            "Table.FirstN",
            "Table.FirstValue",
            "Table.FromColumns",
            "Table.FromList",
            "Table.FromPartitions",
            "Table.FromRecords",
            "Table.FromRows",
            "Table.FromValue",
            "Table.Group",
            "Table.HasColumns",
            "Table.InsertRows",
            "Table.IsDistinct",
            "Table.IsEmpty",
            "Table.Join",
            "Table.Keys",
            "Table.Last",
            "Table.LastN",
            "Table.MatchesAllRows",
            "Table.MatchesAnyRows",
            "Table.Max",
            "Table.MaxN",
            "Table.Min",
            "Table.MinN",
            "Table.NestedJoin",
            "Table.Partition",
            "Table.PartitionValues",
            "Table.Pivot",
            "Table.PositionOf",
            "Table.PositionOfAny",
            "Table.PrefixColumns",
            "Table.Profile",
            "Table.PromoteHeaders",
            "Table.Range",
            "Table.RemoveColumns",
            "Table.RemoveFirstN",
            "Table.RemoveLastN",
            "Table.RemoveMatchingRows",
            "Table.RemoveRows",
            "Table.RemoveRowsWithErrors",
            "Table.RenameColumns",
            "Table.ReorderColumns",
            "Table.Repeat",
            "Table.ReplaceErrorValues",
            "Table.ReplaceKeys",
            "Table.ReplaceMatchingRows",
            "Table.ReplaceRelationshipIdentity",
            "Table.ReplaceRows",
            "Table.ReplaceValue",
            "Table.ReverseRows",
            "Table.RowCount",
            "Table.Schema",
            "Table.SelectColumns",
            "Table.SelectRows",
            "Table.SelectRowsWithErrors",
            "Table.SingleRow",
            "Table.Skip",
            "Table.Sort",
            "Table.SplitColumn",
            "Table.ToColumns",
            "Table.ToList",
            "Table.ToRecords",
            "Table.ToRows",
            "Table.TransformColumnNames",
            "Table.TransformColumnTypes",
            "Table.TransformColumns",
            "Table.TransformRows",
            "Table.Transpose",
            "Table.Unpivot",
            "Table.UnpivotOtherColumns",
            "Table.View",
            "Table.ViewFunction",
            "TableAction.DeleteRows",
            "TableAction.InsertRows",
            "TableAction.UpdateRows",
            "Tables.GetRelationships",
            "Teradata.Database",
            "Text.AfterDelimiter",
            "Text.At",
            "Text.BeforeDelimiter",
            "Text.BetweenDelimiters",
            "Text.Clean",
            "Text.Combine",
            "Text.Contains",
            "Text.End",
            "Text.EndsWith",
            "Text.Format",
            "Text.From",
            "Text.FromBinary",
            "Text.Insert",
            "Text.Length",
            "Text.Lower",
            "Text.Middle",
            "Text.NewGuid",
            "Text.PadEnd",
            "Text.PadStart",
            "Text.PositionOf",
            "Text.PositionOfAny",
            "Text.Proper",
            "Text.Range",
            "Text.Remove",
            "Text.RemoveRange",
            "Text.Repeat",
            "Text.Replace",
            "Text.ReplaceRange",
            "Text.Select",
            "Text.Split",
            "Text.SplitAny",
            "Text.Start",
            "Text.StartsWith",
            "Text.ToBinary",
            "Text.ToList",
            "Text.Trim",
            "Text.TrimEnd",
            "Text.TrimStart",
            "Text.Upper",
            "Time.EndOfHour",
            "Time.From",
            "Time.FromText",
            "Time.Hour",
            "Time.Minute",
            "Time.Second",
            "Time.StartOfHour",
            "Time.ToRecord",
            "Time.ToText",
            "Type.AddTableKey",
            "Type.ClosedRecord",
            "Type.Facets",
            "Type.ForFunction",
            "Type.ForRecord",
            "Type.FunctionParameters",
            "Type.FunctionRequiredParameters",
            "Type.FunctionReturn",
            "Type.Is",
            "Type.IsNullable",
            "Type.IsOpenRecord",
            "Type.ListItem",
            "Type.NonNullable",
            "Type.OpenRecord",
            "Type.RecordFields",
            "Type.ReplaceFacets",
            "Type.ReplaceTableKeys",
            "Type.TableColumn",
            "Type.TableKeys",
            "Type.TableRow",
            "Type.TableSchema",
            "Type.Union",
            "Uri.BuildQueryString",
            "Uri.Combine",
            "Uri.EscapeDataString",
            "Uri.Parts",
            "Value.Add",
            "Value.As",
            "Value.Compare",
            "Value.Divide",
            "Value.Equals",
            "Value.Firewall",
            "Value.FromText",
            "Value.Is",
            "Value.Metadata",
            "Value.Multiply",
            "Value.NativeQuery",
            "Value.NullableEquals",
            "Value.RemoveMetadata",
            "Value.ReplaceMetadata",
            "Value.ReplaceType",
            "Value.Subtract",
            "Value.Type",
            "ValueAction.NativeStatement",
            "ValueAction.Replace",
            "Variable.Value",
            "Web.Contents",
            "Web.Page",
            "WebAction.Request",
            "Xml.Document",
            "Xml.Tables",
          ],
          builtinConstants: [
            "BinaryEncoding.Base64",
            "BinaryEncoding.Hex",
            "BinaryOccurrence.Optional",
            "BinaryOccurrence.Repeating",
            "BinaryOccurrence.Required",
            "ByteOrder.BigEndian",
            "ByteOrder.LittleEndian",
            "Compression.Deflate",
            "Compression.GZip",
            "CsvStyle.QuoteAfterDelimiter",
            "CsvStyle.QuoteAlways",
            "Culture.Current",
            "Day.Friday",
            "Day.Monday",
            "Day.Saturday",
            "Day.Sunday",
            "Day.Thursday",
            "Day.Tuesday",
            "Day.Wednesday",
            "ExtraValues.Error",
            "ExtraValues.Ignore",
            "ExtraValues.List",
            "GroupKind.Global",
            "GroupKind.Local",
            "JoinAlgorithm.Dynamic",
            "JoinAlgorithm.LeftHash",
            "JoinAlgorithm.LeftIndex",
            "JoinAlgorithm.PairwiseHash",
            "JoinAlgorithm.RightHash",
            "JoinAlgorithm.RightIndex",
            "JoinAlgorithm.SortMerge",
            "JoinKind.FullOuter",
            "JoinKind.Inner",
            "JoinKind.LeftAnti",
            "JoinKind.LeftOuter",
            "JoinKind.RightAnti",
            "JoinKind.RightOuter",
            "JoinSide.Left",
            "JoinSide.Right",
            "MissingField.Error",
            "MissingField.Ignore",
            "MissingField.UseNull",
            "Number.E",
            "Number.Epsilon",
            "Number.NaN",
            "Number.NegativeInfinity",
            "Number.PI",
            "Number.PositiveInfinity",
            "Occurrence.All",
            "Occurrence.First",
            "Occurrence.Last",
            "Occurrence.Optional",
            "Occurrence.Repeating",
            "Occurrence.Required",
            "Order.Ascending",
            "Order.Descending",
            "Precision.Decimal",
            "Precision.Double",
            "QuoteStyle.Csv",
            "QuoteStyle.None",
            "RelativePosition.FromEnd",
            "RelativePosition.FromStart",
            "RoundingMode.AwayFromZero",
            "RoundingMode.Down",
            "RoundingMode.ToEven",
            "RoundingMode.TowardZero",
            "RoundingMode.Up",
            "SapHanaDistribution.All",
            "SapHanaDistribution.Connection",
            "SapHanaDistribution.Off",
            "SapHanaDistribution.Statement",
            "SapHanaRangeOperator.Equals",
            "SapHanaRangeOperator.GreaterThan",
            "SapHanaRangeOperator.GreaterThanOrEquals",
            "SapHanaRangeOperator.LessThan",
            "SapHanaRangeOperator.LessThanOrEquals",
            "SapHanaRangeOperator.NotEquals",
            "TextEncoding.Ascii",
            "TextEncoding.BigEndianUnicode",
            "TextEncoding.Unicode",
            "TextEncoding.Utf16",
            "TextEncoding.Utf8",
            "TextEncoding.Windows",
            "TraceLevel.Critical",
            "TraceLevel.Error",
            "TraceLevel.Information",
            "TraceLevel.Verbose",
            "TraceLevel.Warning",
            "WebMethod.Delete",
            "WebMethod.Get",
            "WebMethod.Head",
            "WebMethod.Patch",
            "WebMethod.Post",
            "WebMethod.Put",
          ],
          builtinTypes: [
            "Action.Type",
            "Any.Type",
            "Binary.Type",
            "BinaryEncoding.Type",
            "BinaryOccurrence.Type",
            "Byte.Type",
            "ByteOrder.Type",
            "Character.Type",
            "Compression.Type",
            "CsvStyle.Type",
            "Currency.Type",
            "Date.Type",
            "DateTime.Type",
            "DateTimeZone.Type",
            "Day.Type",
            "Decimal.Type",
            "Double.Type",
            "Duration.Type",
            "ExtraValues.Type",
            "Function.Type",
            "GroupKind.Type",
            "Guid.Type",
            "Int16.Type",
            "Int32.Type",
            "Int64.Type",
            "Int8.Type",
            "JoinAlgorithm.Type",
            "JoinKind.Type",
            "JoinSide.Type",
            "List.Type",
            "Logical.Type",
            "MissingField.Type",
            "None.Type",
            "Null.Type",
            "Number.Type",
            "Occurrence.Type",
            "Order.Type",
            "Password.Type",
            "Percentage.Type",
            "Precision.Type",
            "QuoteStyle.Type",
            "Record.Type",
            "RelativePosition.Type",
            "RoundingMode.Type",
            "SapHanaDistribution.Type",
            "SapHanaRangeOperator.Type",
            "Single.Type",
            "Table.Type",
            "Text.Type",
            "TextEncoding.Type",
            "Time.Type",
            "TraceLevel.Type",
            "Type.Type",
            "Uri.Type",
            "WebMethod.Type",
          ],
          tokenizer: {
            root: [
              [/#"[\w \.]+"/, "identifier.quote"],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F]+/, "number.hex"],
              [/\d+([eE][\-+]?\d+)?/, "number"],
              [
                /(#?[a-z]+)\b/,
                {
                  cases: {
                    "@typeKeywords": "type",
                    "@keywords": "keyword",
                    "@constants": "constant",
                    "@constructors": "constructor",
                    "@operatorKeywords": "operators",
                    "@default": "identifier",
                  },
                },
              ],
              [
                /\b([A-Z][a-zA-Z0-9]+\.Type)\b/,
                { cases: { "@builtinTypes": "type", "@default": "identifier" } },
              ],
              [
                /\b([A-Z][a-zA-Z0-9]+\.[A-Z][a-zA-Z0-9]+)\b/,
                {
                  cases: {
                    "@builtinFunctions": "keyword.function",
                    "@builtinConstants": "constant",
                    "@default": "identifier",
                  },
                },
              ],
              [/\b([a-zA-Z_][\w\.]*)\b/, "identifier"],
              { include: "@whitespace" },
              { include: "@comments" },
              { include: "@strings" },
              [/[{}()\[\]]/, "@brackets"],
              [/([=\+<>\-\*&@\?\/!])|([<>]=)|(<>)|(=>)|(\.\.\.)|(\.\.)/, "operators"],
              [/[,;]/, "delimiter"],
            ],
            whitespace: [[/\s+/, "white"]],
            comments: [
              ["\\/\\*", "comment", "@comment"],
              ["\\/\\/+.*", "comment"],
            ],
            comment: [
              ["\\*\\/", "comment", "@pop"],
              [".", "comment"],
            ],
            strings: [['"', "string", "@string"]],
            string: [
              ['""', "string.escape"],
              ['"', "string", "@pop"],
              [".", "string"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  z3e = {
    wordPattern:
      /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
    comments: { lineComment: "#", blockComment: ["<#", "#>"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"', notIn: ["string"] },
      { open: "'", close: "'", notIn: ["string", "comment"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: { start: new RegExp("^\\s*#region\\b"), end: new RegExp("^\\s*#endregion\\b") },
    },
  },
  U3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: z3e,
        language: {
          defaultToken: "",
          ignoreCase: !0,
          tokenPostfix: ".ps1",
          brackets: [
            { token: "delimiter.curly", open: "{", close: "}" },
            { token: "delimiter.square", open: "[", close: "]" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
          ],
          keywords: [
            "begin",
            "break",
            "catch",
            "class",
            "continue",
            "data",
            "define",
            "do",
            "dynamicparam",
            "else",
            "elseif",
            "end",
            "exit",
            "filter",
            "finally",
            "for",
            "foreach",
            "from",
            "function",
            "if",
            "in",
            "param",
            "process",
            "return",
            "switch",
            "throw",
            "trap",
            "try",
            "until",
            "using",
            "var",
            "while",
            "workflow",
            "parallel",
            "sequence",
            "inlinescript",
            "configuration",
          ],
          helpKeywords:
            /SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/,
          symbols: /[=><!~?&%|+\-*\/\^;\.,]+/,
          escapes: /`(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_][\w-]*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "" } },
              ],
              [/[ \t\r\n]+/, ""],
              [/^:\w*/, "metatag"],
              [
                /\$(\{((global|local|private|script|using):)?[\w]+\}|((global|local|private|script|using):)?[\w]+)/,
                "variable",
              ],
              [/<#/, "comment", "@comment"],
              [/#.*$/, "comment"],
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, "delimiter"],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/, "number.hex"],
              [/\d+?/, "number"],
              [/[;,.]/, "delimiter"],
              [/\@"/, "string", '@herestring."'],
              [/\@'/, "string", "@herestring.'"],
              [
                /"/,
                { cases: { "@eos": "string", "@default": { token: "string", next: '@string."' } } },
              ],
              [
                /'/,
                { cases: { "@eos": "string", "@default": { token: "string", next: "@string.'" } } },
              ],
            ],
            string: [
              [
                /[^"'\$`]+/,
                { cases: { "@eos": { token: "string", next: "@popall" }, "@default": "string" } },
              ],
              [
                /@escapes/,
                {
                  cases: {
                    "@eos": { token: "string.escape", next: "@popall" },
                    "@default": "string.escape",
                  },
                },
              ],
              [
                /`./,
                {
                  cases: {
                    "@eos": { token: "string.escape.invalid", next: "@popall" },
                    "@default": "string.escape.invalid",
                  },
                },
              ],
              [
                /\$[\w]+$/,
                {
                  cases: {
                    '$S2=="': { token: "variable", next: "@popall" },
                    "@default": { token: "string", next: "@popall" },
                  },
                },
              ],
              [/\$[\w]+/, { cases: { '$S2=="': "variable", "@default": "string" } }],
              [
                /["']/,
                {
                  cases: {
                    "$#==$S2": { token: "string", next: "@pop" },
                    "@default": {
                      cases: { "@eos": { token: "string", next: "@popall" }, "@default": "string" },
                    },
                  },
                },
              ],
            ],
            herestring: [
              [
                /^\s*(["'])@/,
                { cases: { "$1==$S2": { token: "string", next: "@pop" }, "@default": "string" } },
              ],
              [/[^\$`]+/, "string"],
              [/@escapes/, "string.escape"],
              [/`./, "string.escape.invalid"],
              [/\$[\w]+/, { cases: { '$S2=="': "variable", "@default": "string" } }],
            ],
            comment: [
              [/[^#\.]+/, "comment"],
              [/#>/, "comment", "@pop"],
              [/(\.)(@helpKeywords)(?!\w)/, { token: "comment.keyword.$2" }],
              [/[\.#]/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  $3e = {
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
      ["<", ">"],
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">" },
      { open: '"', close: '"', notIn: ["string"] },
      { open: "'", close: "'", notIn: ["string"] },
    ],
    autoCloseBefore: ".,=}])>' \n\t",
    indentationRules: {
      increaseIndentPattern: new RegExp(
        "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$",
      ),
      decreaseIndentPattern: new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$"),
    },
  },
  q3e = {
    defaultToken: "",
    tokenPostfix: ".proto",
    brackets: [
      { open: "{", close: "}", token: "delimiter.curly" },
      { open: "[", close: "]", token: "delimiter.square" },
      { open: "(", close: ")", token: "delimiter.parenthesis" },
      { open: "<", close: ">", token: "delimiter.angle" },
    ],
    symbols: /[=><!~?:&|+\-*/^%]+/,
    keywords: [
      "syntax",
      "import",
      "weak",
      "public",
      "package",
      "option",
      "repeated",
      "oneof",
      "map",
      "reserved",
      "to",
      "max",
      "enum",
      "message",
      "service",
      "rpc",
      "stream",
      "returns",
      "package",
      "optional",
      "true",
      "false",
    ],
    builtinTypes: [
      "double",
      "float",
      "int32",
      "int64",
      "uint32",
      "uint64",
      "sint32",
      "sint64",
      "fixed32",
      "fixed64",
      "sfixed32",
      "sfixed64",
      "bool",
      "string",
      "bytes",
    ],
    operators: ["=", "+", "-"],
    namedLiterals: ["true", "false"],
    escapes: "\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",
    identifier: /[a-zA-Z]\w*/,
    fullIdentifier: /@identifier(?:\s*\.\s*@identifier)*/,
    optionName: /(?:@identifier|\(\s*@fullIdentifier\s*\))(?:\s*\.\s*@identifier)*/,
    messageName: /@identifier/,
    enumName: /@identifier/,
    messageType: /\.?\s*(?:@identifier\s*\.\s*)*@messageName/,
    enumType: /\.?\s*(?:@identifier\s*\.\s*)*@enumName/,
    floatLit: /[0-9]+\s*\.\s*[0-9]*(?:@exponent)?|[0-9]+@exponent|\.[0-9]+(?:@exponent)?/,
    exponent: /[eE]\s*[+-]?\s*[0-9]+/,
    boolLit: /true\b|false\b/,
    decimalLit: /[1-9][0-9]*/,
    octalLit: /0[0-7]*/,
    hexLit: /0[xX][0-9a-fA-F]+/,
    type: /double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes|@messageType|@enumType/,
    keyType:
      /int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string/,
    tokenizer: {
      root: [
        { include: "@whitespace" },
        [/syntax/, "keyword"],
        [/=/, "operators"],
        [/;/, "delimiter"],
        [
          /(")(proto3)(")/,
          ["string.quote", "string", { token: "string.quote", switchTo: "@topLevel.proto3" }],
        ],
        [
          /(")(proto2)(")/,
          ["string.quote", "string", { token: "string.quote", switchTo: "@topLevel.proto2" }],
        ],
        [/.*?/, { token: "", switchTo: "@topLevel.proto2" }],
      ],
      topLevel: [
        { include: "@whitespace" },
        { include: "@constant" },
        [/=/, "operators"],
        [/[;.]/, "delimiter"],
        [
          /@fullIdentifier/,
          {
            cases: {
              option: { token: "keyword", next: "@option.$S2" },
              enum: { token: "keyword", next: "@enumDecl.$S2" },
              message: { token: "keyword", next: "@messageDecl.$S2" },
              service: { token: "keyword", next: "@serviceDecl.$S2" },
              extend: { cases: { "$S2==proto2": { token: "keyword", next: "@extendDecl.$S2" } } },
              "@keywords": "keyword",
              "@default": "identifier",
            },
          },
        ],
      ],
      enumDecl: [
        { include: "@whitespace" },
        [/@identifier/, "type.identifier"],
        [/{/, { token: "@brackets", bracket: "@open", switchTo: "@enumBody.$S2" }],
      ],
      enumBody: [
        { include: "@whitespace" },
        { include: "@constant" },
        [/=/, "operators"],
        [/;/, "delimiter"],
        [/option\b/, "keyword", "@option.$S2"],
        [/@identifier/, "identifier"],
        [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
        [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }],
      ],
      messageDecl: [
        { include: "@whitespace" },
        [/@identifier/, "type.identifier"],
        [/{/, { token: "@brackets", bracket: "@open", switchTo: "@messageBody.$S2" }],
      ],
      messageBody: [
        { include: "@whitespace" },
        { include: "@constant" },
        [/=/, "operators"],
        [/;/, "delimiter"],
        [
          "(map)(s*)(<)",
          ["keyword", "white", { token: "@brackets", bracket: "@open", next: "@map.$S2" }],
        ],
        [
          /@identifier/,
          {
            cases: {
              option: { token: "keyword", next: "@option.$S2" },
              enum: { token: "keyword", next: "@enumDecl.$S2" },
              message: { token: "keyword", next: "@messageDecl.$S2" },
              oneof: { token: "keyword", next: "@oneofDecl.$S2" },
              extensions: { cases: { "$S2==proto2": { token: "keyword", next: "@reserved.$S2" } } },
              reserved: { token: "keyword", next: "@reserved.$S2" },
              "(?:repeated|optional)": { token: "keyword", next: "@field.$S2" },
              required: { cases: { "$S2==proto2": { token: "keyword", next: "@field.$S2" } } },
              "$S2==proto3": { token: "@rematch", next: "@field.$S2" },
            },
          },
        ],
        [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
        [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }],
      ],
      extendDecl: [
        { include: "@whitespace" },
        [/@identifier/, "type.identifier"],
        [/{/, { token: "@brackets", bracket: "@open", switchTo: "@extendBody.$S2" }],
      ],
      extendBody: [
        { include: "@whitespace" },
        { include: "@constant" },
        [/;/, "delimiter"],
        [/(?:repeated|optional|required)/, "keyword", "@field.$S2"],
        [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
        [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }],
      ],
      options: [
        { include: "@whitespace" },
        { include: "@constant" },
        [/;/, "delimiter"],
        [/@optionName/, "annotation"],
        [/[()]/, "annotation.brackets"],
        [/=/, "operator"],
        [/\]/, { token: "@brackets", bracket: "@close", next: "@pop" }],
      ],
      option: [
        { include: "@whitespace" },
        [/@optionName/, "annotation"],
        [/[()]/, "annotation.brackets"],
        [/=/, "operator", "@pop"],
      ],
      oneofDecl: [
        { include: "@whitespace" },
        [/@identifier/, "identifier"],
        [/{/, { token: "@brackets", bracket: "@open", switchTo: "@oneofBody.$S2" }],
      ],
      oneofBody: [
        { include: "@whitespace" },
        { include: "@constant" },
        [/;/, "delimiter"],
        [/(@identifier)(\s*)(=)/, ["identifier", "white", "delimiter"]],
        [
          /@fullIdentifier|\./,
          { cases: { "@builtinTypes": "keyword", "@default": "type.identifier" } },
        ],
        [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
        [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }],
      ],
      reserved: [
        { include: "@whitespace" },
        [/,/, "delimiter"],
        [/;/, "delimiter", "@pop"],
        { include: "@constant" },
        [/to\b|max\b/, "keyword"],
      ],
      map: [
        { include: "@whitespace" },
        [
          /@fullIdentifier|\./,
          { cases: { "@builtinTypes": "keyword", "@default": "type.identifier" } },
        ],
        [/,/, "delimiter"],
        [/>/, { token: "@brackets", bracket: "@close", switchTo: "identifier" }],
      ],
      field: [
        { include: "@whitespace" },
        ["group", { cases: { "$S2==proto2": { token: "keyword", switchTo: "@groupDecl.$S2" } } }],
        [/(@identifier)(\s*)(=)/, ["identifier", "white", { token: "delimiter", next: "@pop" }]],
        [
          /@fullIdentifier|\./,
          { cases: { "@builtinTypes": "keyword", "@default": "type.identifier" } },
        ],
      ],
      groupDecl: [
        { include: "@whitespace" },
        [/@identifier/, "identifier"],
        ["=", "operator"],
        [/{/, { token: "@brackets", bracket: "@open", switchTo: "@messageBody.$S2" }],
        { include: "@constant" },
      ],
      type: [
        { include: "@whitespace" },
        [/@identifier/, "type.identifier", "@pop"],
        [/./, "delimiter"],
      ],
      identifier: [{ include: "@whitespace" }, [/@identifier/, "identifier", "@pop"]],
      serviceDecl: [
        { include: "@whitespace" },
        [/@identifier/, "identifier"],
        [/{/, { token: "@brackets", bracket: "@open", switchTo: "@serviceBody.$S2" }],
      ],
      serviceBody: [
        { include: "@whitespace" },
        { include: "@constant" },
        [/;/, "delimiter"],
        [/option\b/, "keyword", "@option.$S2"],
        [/rpc\b/, "keyword", "@rpc.$S2"],
        [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
        [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }],
      ],
      rpc: [
        { include: "@whitespace" },
        [/@identifier/, "identifier"],
        [/\(/, { token: "@brackets", bracket: "@open", switchTo: "@request.$S2" }],
        [/{/, { token: "@brackets", bracket: "@open", next: "@methodOptions.$S2" }],
        [/;/, "delimiter", "@pop"],
      ],
      request: [
        { include: "@whitespace" },
        [
          /@messageType/,
          {
            cases: {
              stream: { token: "keyword", next: "@type.$S2" },
              "@default": "type.identifier",
            },
          },
        ],
        [/\)/, { token: "@brackets", bracket: "@close", switchTo: "@returns.$S2" }],
      ],
      returns: [
        { include: "@whitespace" },
        [/returns\b/, "keyword"],
        [/\(/, { token: "@brackets", bracket: "@open", switchTo: "@response.$S2" }],
      ],
      response: [
        { include: "@whitespace" },
        [
          /@messageType/,
          {
            cases: {
              stream: { token: "keyword", next: "@type.$S2" },
              "@default": "type.identifier",
            },
          },
        ],
        [/\)/, { token: "@brackets", bracket: "@close", switchTo: "@rpc.$S2" }],
      ],
      methodOptions: [
        { include: "@whitespace" },
        { include: "@constant" },
        [/;/, "delimiter"],
        ["option", "keyword"],
        [/@optionName/, "annotation"],
        [/[()]/, "annotation.brackets"],
        [/=/, "operator"],
        [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }],
      ],
      comment: [
        [/[^\/*]+/, "comment"],
        [/\/\*/, "comment", "@push"],
        ["\\*/", "comment", "@pop"],
        [/[\/*]/, "comment"],
      ],
      string: [
        [/[^\\"]+/, "string"],
        [/@escapes/, "string.escape"],
        [/\\./, "string.escape.invalid"],
        [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }],
      ],
      stringSingle: [
        [/[^\\']+/, "string"],
        [/@escapes/, "string.escape"],
        [/\\./, "string.escape.invalid"],
        [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }],
      ],
      constant: [
        ["@boolLit", "keyword.constant"],
        ["@hexLit", "number.hex"],
        ["@octalLit", "number.octal"],
        ["@decimalLit", "number"],
        ["@floatLit", "number.float"],
        [/("([^"\\]|\\.)*|'([^'\\]|\\.)*)$/, "string.invalid"],
        [/"/, { token: "string.quote", bracket: "@open", next: "@string" }],
        [/'/, { token: "string.quote", bracket: "@open", next: "@stringSingle" }],
        [/{/, { token: "@brackets", bracket: "@open", next: "@prototext" }],
        [/identifier/, "identifier"],
      ],
      whitespace: [
        [/[ \t\r\n]+/, "white"],
        [/\/\*/, "comment", "@comment"],
        [/\/\/.*$/, "comment"],
      ],
      prototext: [
        { include: "@whitespace" },
        { include: "@constant" },
        [/@identifier/, "identifier"],
        [/[:;]/, "delimiter"],
        [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }],
      ],
    },
  },
  K3e = Object.freeze(
    Object.defineProperty({ __proto__: null, conf: $3e, language: q3e }, Symbol.toStringTag, {
      value: "Module",
    }),
  ),
  G3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: '"', close: '"', notIn: ["string", "comment"] },
            { open: "'", close: "'", notIn: ["string", "comment"] },
            { open: "{", close: "}", notIn: ["string", "comment"] },
            { open: "[", close: "]", notIn: ["string", "comment"] },
            { open: "(", close: ")", notIn: ["string", "comment"] },
          ],
          folding: { offSide: !0 },
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".pug",
          ignoreCase: !0,
          brackets: [
            { token: "delimiter.curly", open: "{", close: "}" },
            { token: "delimiter.array", open: "[", close: "]" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
          ],
          keywords: [
            "append",
            "block",
            "case",
            "default",
            "doctype",
            "each",
            "else",
            "extends",
            "for",
            "if",
            "in",
            "include",
            "mixin",
            "typeof",
            "unless",
            "var",
            "when",
          ],
          tags: [
            "a",
            "abbr",
            "acronym",
            "address",
            "area",
            "article",
            "aside",
            "audio",
            "b",
            "base",
            "basefont",
            "bdi",
            "bdo",
            "blockquote",
            "body",
            "br",
            "button",
            "canvas",
            "caption",
            "center",
            "cite",
            "code",
            "col",
            "colgroup",
            "command",
            "datalist",
            "dd",
            "del",
            "details",
            "dfn",
            "div",
            "dl",
            "dt",
            "em",
            "embed",
            "fieldset",
            "figcaption",
            "figure",
            "font",
            "footer",
            "form",
            "frame",
            "frameset",
            "h1",
            "h2",
            "h3",
            "h4",
            "h5",
            "h6",
            "head",
            "header",
            "hgroup",
            "hr",
            "html",
            "i",
            "iframe",
            "img",
            "input",
            "ins",
            "keygen",
            "kbd",
            "label",
            "li",
            "link",
            "map",
            "mark",
            "menu",
            "meta",
            "meter",
            "nav",
            "noframes",
            "noscript",
            "object",
            "ol",
            "optgroup",
            "option",
            "output",
            "p",
            "param",
            "pre",
            "progress",
            "q",
            "rp",
            "rt",
            "ruby",
            "s",
            "samp",
            "script",
            "section",
            "select",
            "small",
            "source",
            "span",
            "strike",
            "strong",
            "style",
            "sub",
            "summary",
            "sup",
            "table",
            "tbody",
            "td",
            "textarea",
            "tfoot",
            "th",
            "thead",
            "time",
            "title",
            "tr",
            "tracks",
            "tt",
            "u",
            "ul",
            "video",
            "wbr",
          ],
          symbols: /[\+\-\*\%\&\|\!\=\/\.\,\:]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [
                /^(\s*)([a-zA-Z_-][\w-]*)/,
                {
                  cases: {
                    "$2@tags": {
                      cases: {
                        "@eos": ["", "tag"],
                        "@default": ["", { token: "tag", next: "@tag.$1" }],
                      },
                    },
                    "$2@keywords": ["", { token: "keyword.$2" }],
                    "@default": ["", ""],
                  },
                },
              ],
              [
                /^(\s*)(#[a-zA-Z_-][\w-]*)/,
                {
                  cases: {
                    "@eos": ["", "tag.id"],
                    "@default": ["", { token: "tag.id", next: "@tag.$1" }],
                  },
                },
              ],
              [
                /^(\s*)(\.[a-zA-Z_-][\w-]*)/,
                {
                  cases: {
                    "@eos": ["", "tag.class"],
                    "@default": ["", { token: "tag.class", next: "@tag.$1" }],
                  },
                },
              ],
              [/^(\s*)(\|.*)$/, ""],
              { include: "@whitespace" },
              [
                /[a-zA-Z_$][\w$]*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "" } },
              ],
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, "delimiter"],
              [/\d+\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/\d+/, "number"],
              [/"/, "string", '@string."'],
              [/'/, "string", "@string.'"],
            ],
            tag: [
              [/(\.)(\s*$)/, [{ token: "delimiter", next: "@blockText.$S2." }, ""]],
              [/\s+/, { token: "", next: "@simpleText" }],
              [
                /#[a-zA-Z_-][\w-]*/,
                { cases: { "@eos": { token: "tag.id", next: "@pop" }, "@default": "tag.id" } },
              ],
              [
                /\.[a-zA-Z_-][\w-]*/,
                {
                  cases: { "@eos": { token: "tag.class", next: "@pop" }, "@default": "tag.class" },
                },
              ],
              [/\(/, { token: "delimiter.parenthesis", next: "@attributeList" }],
            ],
            simpleText: [
              [/[^#]+$/, { token: "", next: "@popall" }],
              [/[^#]+/, { token: "" }],
              [
                /(#{)([^}]*)(})/,
                {
                  cases: {
                    "@eos": [
                      "interpolation.delimiter",
                      "interpolation",
                      { token: "interpolation.delimiter", next: "@popall" },
                    ],
                    "@default": [
                      "interpolation.delimiter",
                      "interpolation",
                      "interpolation.delimiter",
                    ],
                  },
                },
              ],
              [/#$/, { token: "", next: "@popall" }],
              [/#/, ""],
            ],
            attributeList: [
              [/\s+/, ""],
              [
                /(\w+)(\s*=\s*)("|')/,
                ["attribute.name", "delimiter", { token: "attribute.value", next: "@value.$3" }],
              ],
              [/\w+/, "attribute.name"],
              [
                /,/,
                {
                  cases: {
                    "@eos": { token: "attribute.delimiter", next: "@popall" },
                    "@default": "attribute.delimiter",
                  },
                },
              ],
              [/\)$/, { token: "delimiter.parenthesis", next: "@popall" }],
              [/\)/, { token: "delimiter.parenthesis", next: "@pop" }],
            ],
            whitespace: [
              [/^(\s*)(\/\/.*)$/, { token: "comment", next: "@blockText.$1.comment" }],
              [/[ \t\r\n]+/, ""],
              [/<!--/, { token: "comment", next: "@comment" }],
            ],
            blockText: [
              [
                /^\s+.*$/,
                {
                  cases: {
                    "($S2\\s+.*$)": { token: "$S3" },
                    "@default": { token: "@rematch", next: "@popall" },
                  },
                },
              ],
              [/./, { token: "@rematch", next: "@popall" }],
            ],
            comment: [
              [/[^<\-]+/, "comment.content"],
              [/-->/, { token: "comment", next: "@pop" }],
              [/<!--/, "comment.content.invalid"],
              [/[<\-]/, "comment.content"],
            ],
            string: [
              [
                /[^\\"'#]+/,
                { cases: { "@eos": { token: "string", next: "@popall" }, "@default": "string" } },
              ],
              [
                /@escapes/,
                {
                  cases: {
                    "@eos": { token: "string.escape", next: "@popall" },
                    "@default": "string.escape",
                  },
                },
              ],
              [
                /\\./,
                {
                  cases: {
                    "@eos": { token: "string.escape.invalid", next: "@popall" },
                    "@default": "string.escape.invalid",
                  },
                },
              ],
              [
                /(#{)([^}]*)(})/,
                ["interpolation.delimiter", "interpolation", "interpolation.delimiter"],
              ],
              [/#/, "string"],
              [
                /["']/,
                {
                  cases: {
                    "$#==$S2": { token: "string", next: "@pop" },
                    "@default": { token: "string" },
                  },
                },
              ],
            ],
            value: [
              [
                /[^\\"']+/,
                {
                  cases: {
                    "@eos": { token: "attribute.value", next: "@popall" },
                    "@default": "attribute.value",
                  },
                },
              ],
              [
                /\\./,
                {
                  cases: {
                    "@eos": { token: "attribute.value", next: "@popall" },
                    "@default": "attribute.value",
                  },
                },
              ],
              [
                /["']/,
                {
                  cases: {
                    "$#==$S2": { token: "attribute.value", next: "@pop" },
                    "@default": { token: "attribute.value" },
                  },
                },
              ],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  Z3e = {
    comments: { lineComment: "#", blockComment: ["'''", "'''"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"', notIn: ["string"] },
      { open: "'", close: "'", notIn: ["string", "comment"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    onEnterRules: [
      {
        beforeText: new RegExp(
          "^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async|match|case).*?:\\s*$",
        ),
        action: { indentAction: VGe.IndentAction.Indent },
      },
    ],
    folding: {
      offSide: !0,
      markers: { start: new RegExp("^\\s*#region\\b"), end: new RegExp("^\\s*#endregion\\b") },
    },
  },
  Y3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: Z3e,
        language: {
          defaultToken: "",
          tokenPostfix: ".python",
          keywords: [
            "False",
            "None",
            "True",
            "_",
            "and",
            "as",
            "assert",
            "async",
            "await",
            "break",
            "case",
            "class",
            "continue",
            "def",
            "del",
            "elif",
            "else",
            "except",
            "exec",
            "finally",
            "for",
            "from",
            "global",
            "if",
            "import",
            "in",
            "is",
            "lambda",
            "match",
            "nonlocal",
            "not",
            "or",
            "pass",
            "print",
            "raise",
            "return",
            "try",
            "type",
            "while",
            "with",
            "yield",
            "int",
            "float",
            "long",
            "complex",
            "hex",
            "abs",
            "all",
            "any",
            "apply",
            "basestring",
            "bin",
            "bool",
            "buffer",
            "bytearray",
            "callable",
            "chr",
            "classmethod",
            "cmp",
            "coerce",
            "compile",
            "complex",
            "delattr",
            "dict",
            "dir",
            "divmod",
            "enumerate",
            "eval",
            "execfile",
            "file",
            "filter",
            "format",
            "frozenset",
            "getattr",
            "globals",
            "hasattr",
            "hash",
            "help",
            "id",
            "input",
            "intern",
            "isinstance",
            "issubclass",
            "iter",
            "len",
            "locals",
            "list",
            "map",
            "max",
            "memoryview",
            "min",
            "next",
            "object",
            "oct",
            "open",
            "ord",
            "pow",
            "print",
            "property",
            "reversed",
            "range",
            "raw_input",
            "reduce",
            "reload",
            "repr",
            "reversed",
            "round",
            "self",
            "set",
            "setattr",
            "slice",
            "sorted",
            "staticmethod",
            "str",
            "sum",
            "super",
            "tuple",
            "type",
            "unichr",
            "unicode",
            "vars",
            "xrange",
            "zip",
            "__dict__",
            "__methods__",
            "__members__",
            "__class__",
            "__bases__",
            "__name__",
            "__mro__",
            "__subclasses__",
            "__init__",
            "__import__",
          ],
          brackets: [
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.bracket" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          tokenizer: {
            root: [
              { include: "@whitespace" },
              { include: "@numbers" },
              { include: "@strings" },
              [/[,:;]/, "delimiter"],
              [/[{}\[\]()]/, "@brackets"],
              [/@[a-zA-Z_]\w*/, "tag"],
              [/[a-zA-Z_]\w*/, { cases: { "@keywords": "keyword", "@default": "identifier" } }],
            ],
            whitespace: [
              [/\s+/, "white"],
              [/(^#.*$)/, "comment"],
              [/'''/, "string", "@endDocString"],
              [/"""/, "string", "@endDblDocString"],
            ],
            endDocString: [
              [/[^']+/, "string"],
              [/\\'/, "string"],
              [/'''/, "string", "@popall"],
              [/'/, "string"],
            ],
            endDblDocString: [
              [/[^"]+/, "string"],
              [/\\"/, "string"],
              [/"""/, "string", "@popall"],
              [/"/, "string"],
            ],
            numbers: [
              [/-?0x([abcdef]|[ABCDEF]|\d)+[lL]?/, "number.hex"],
              [/-?(\d*\.)?\d+([eE][+\-]?\d+)?[jJ]?[lL]?/, "number"],
            ],
            strings: [
              [/'$/, "string.escape", "@popall"],
              [/f'{1,3}/, "string.escape", "@fStringBody"],
              [/'/, "string.escape", "@stringBody"],
              [/"$/, "string.escape", "@popall"],
              [/f"{1,3}/, "string.escape", "@fDblStringBody"],
              [/"/, "string.escape", "@dblStringBody"],
            ],
            fStringBody: [
              [/[^\\'\{\}]+$/, "string", "@popall"],
              [/[^\\'\{\}]+/, "string"],
              [/\{[^\}':!=]+/, "identifier", "@fStringDetail"],
              [/\\./, "string"],
              [/'/, "string.escape", "@popall"],
              [/\\$/, "string"],
            ],
            stringBody: [
              [/[^\\']+$/, "string", "@popall"],
              [/[^\\']+/, "string"],
              [/\\./, "string"],
              [/'/, "string.escape", "@popall"],
              [/\\$/, "string"],
            ],
            fDblStringBody: [
              [/[^\\"\{\}]+$/, "string", "@popall"],
              [/[^\\"\{\}]+/, "string"],
              [/\{[^\}':!=]+/, "identifier", "@fStringDetail"],
              [/\\./, "string"],
              [/"/, "string.escape", "@popall"],
              [/\\$/, "string"],
            ],
            dblStringBody: [
              [/[^\\"]+$/, "string", "@popall"],
              [/[^\\"]+/, "string"],
              [/\\./, "string"],
              [/"/, "string.escape", "@popall"],
              [/\\$/, "string"],
            ],
            fStringDetail: [
              [/[:][^}]+/, "string"],
              [/[!][ars]/, "string"],
              [/=/, "string"],
              [/\}/, "identifier", "@pop"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  X3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"', notIn: ["string", "comment"] },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
          ],
        },
        language: {
          keywords: [
            "namespace",
            "open",
            "import",
            "export",
            "as",
            "operation",
            "function",
            "body",
            "adjoint",
            "newtype",
            "struct",
            "controlled",
            "if",
            "elif",
            "else",
            "repeat",
            "until",
            "fixup",
            "for",
            "in",
            "while",
            "return",
            "fail",
            "within",
            "apply",
            "Adjoint",
            "Controlled",
            "Adj",
            "Ctl",
            "is",
            "self",
            "auto",
            "distribute",
            "invert",
            "intrinsic",
            "let",
            "set",
            "w/",
            "new",
            "not",
            "and",
            "or",
            "use",
            "borrow",
            "using",
            "borrowing",
            "mutable",
            "internal",
          ],
          typeKeywords: [
            "Unit",
            "Int",
            "BigInt",
            "Double",
            "Bool",
            "String",
            "Qubit",
            "Result",
            "Pauli",
            "Range",
          ],
          invalidKeywords: [
            "abstract",
            "base",
            "bool",
            "break",
            "byte",
            "case",
            "catch",
            "char",
            "checked",
            "class",
            "const",
            "continue",
            "decimal",
            "default",
            "delegate",
            "do",
            "double",
            "enum",
            "event",
            "explicit",
            "extern",
            "finally",
            "fixed",
            "float",
            "foreach",
            "goto",
            "implicit",
            "int",
            "interface",
            "lock",
            "long",
            "null",
            "object",
            "operator",
            "out",
            "override",
            "params",
            "private",
            "protected",
            "public",
            "readonly",
            "ref",
            "sbyte",
            "sealed",
            "short",
            "sizeof",
            "stackalloc",
            "static",
            "string",
            "switch",
            "this",
            "throw",
            "try",
            "typeof",
            "unit",
            "ulong",
            "unchecked",
            "unsafe",
            "ushort",
            "virtual",
            "void",
            "volatile",
          ],
          constants: ["true", "false", "PauliI", "PauliX", "PauliY", "PauliZ", "One", "Zero"],
          builtin: [
            "X",
            "Y",
            "Z",
            "H",
            "HY",
            "S",
            "T",
            "SWAP",
            "CNOT",
            "CCNOT",
            "MultiX",
            "R",
            "RFrac",
            "Rx",
            "Ry",
            "Rz",
            "R1",
            "R1Frac",
            "Exp",
            "ExpFrac",
            "Measure",
            "M",
            "MultiM",
            "Message",
            "Length",
            "Assert",
            "AssertProb",
            "AssertEqual",
          ],
          operators: [
            "and=",
            "<-",
            "->",
            "*",
            "*=",
            "@",
            "!",
            "^",
            "^=",
            ":",
            "::",
            ".",
            "..",
            "==",
            "...",
            "=",
            "=>",
            ">",
            ">=",
            "<",
            "<=",
            "-",
            "-=",
            "!=",
            "or=",
            "%",
            "%=",
            "|",
            "+",
            "+=",
            "?",
            "/",
            "/=",
            "&&&",
            "&&&=",
            "^^^",
            "^^^=",
            ">>>",
            ">>>=",
            "<<<",
            "<<<=",
            "|||",
            "|||=",
            "~~~",
            "_",
            "w/",
            "w/=",
          ],
          namespaceFollows: ["namespace", "open"],
          importsFollows: ["import"],
          symbols: /[=><!~?:&|+\-*\/\^%@._]+/,
          escapes: /\\[\s\S]/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_$][\w$]*/,
                {
                  cases: {
                    "@namespaceFollows": { token: "keyword.$0", next: "@namespace" },
                    "@importsFollows": { token: "keyword.$0", next: "@imports" },
                    "@typeKeywords": "type",
                    "@keywords": "keyword",
                    "@constants": "constant",
                    "@builtin": "keyword",
                    "@invalidKeywords": "invalid",
                    "@default": "identifier",
                  },
                },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "operator", "@default": "" } }],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/\d+/, "number"],
              [/[;,.]/, "delimiter"],
              [/"/, { token: "string.quote", bracket: "@open", next: "@string" }],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
            namespace: [
              { include: "@whitespace" },
              [/[A-Za-z]\w*/, "namespace"],
              [/[\.]/, "delimiter"],
              ["", "", "@pop"],
            ],
            imports: [
              { include: "@whitespace" },
              [/[A-Za-z]\w*(?=\.)/, "namespace"],
              [/[A-Za-z]\w*/, "identifier"],
              [/\*/, "wildcard"],
              [/[\.,]/, "delimiter"],
              ["", "", "@pop"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/(\/\/).*/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  Q3e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "#" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".r",
          roxygen: [
            "@alias",
            "@aliases",
            "@assignee",
            "@author",
            "@backref",
            "@callGraph",
            "@callGraphDepth",
            "@callGraphPrimitives",
            "@concept",
            "@describeIn",
            "@description",
            "@details",
            "@docType",
            "@encoding",
            "@evalNamespace",
            "@evalRd",
            "@example",
            "@examples",
            "@export",
            "@exportClass",
            "@exportMethod",
            "@exportPattern",
            "@family",
            "@field",
            "@formals",
            "@format",
            "@import",
            "@importClassesFrom",
            "@importFrom",
            "@importMethodsFrom",
            "@include",
            "@inherit",
            "@inheritDotParams",
            "@inheritParams",
            "@inheritSection",
            "@keywords",
            "@md",
            "@method",
            "@name",
            "@noMd",
            "@noRd",
            "@note",
            "@param",
            "@rawNamespace",
            "@rawRd",
            "@rdname",
            "@references",
            "@return",
            "@S3method",
            "@section",
            "@seealso",
            "@setClass",
            "@slot",
            "@source",
            "@template",
            "@templateVar",
            "@title",
            "@TODO",
            "@usage",
            "@useDynLib",
          ],
          constants: [
            "NULL",
            "FALSE",
            "TRUE",
            "NA",
            "Inf",
            "NaN",
            "NA_integer_",
            "NA_real_",
            "NA_complex_",
            "NA_character_",
            "T",
            "F",
            "LETTERS",
            "letters",
            "month.abb",
            "month.name",
            "pi",
            "R.version.string",
          ],
          keywords: [
            "break",
            "next",
            "return",
            "if",
            "else",
            "for",
            "in",
            "repeat",
            "while",
            "array",
            "category",
            "character",
            "complex",
            "double",
            "function",
            "integer",
            "list",
            "logical",
            "matrix",
            "numeric",
            "vector",
            "data.frame",
            "factor",
            "library",
            "require",
            "attach",
            "detach",
            "source",
          ],
          special: ["\\n", "\\r", "\\t", "\\b", "\\a", "\\f", "\\v", "\\'", '\\"', "\\\\"],
          brackets: [
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.bracket" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          tokenizer: {
            root: [
              { include: "@numbers" },
              { include: "@strings" },
              [/[{}\[\]()]/, "@brackets"],
              { include: "@operators" },
              [/#'$/, "comment.doc"],
              [/#'/, "comment.doc", "@roxygen"],
              [/(^#.*$)/, "comment"],
              [/\s+/, "white"],
              [/[,:;]/, "delimiter"],
              [/@[a-zA-Z]\w*/, "tag"],
              [
                /[a-zA-Z]\w*/,
                {
                  cases: {
                    "@keywords": "keyword",
                    "@constants": "constant",
                    "@default": "identifier",
                  },
                },
              ],
            ],
            roxygen: [
              [
                /@\w+/,
                {
                  cases: {
                    "@roxygen": "tag",
                    "@eos": { token: "comment.doc", next: "@pop" },
                    "@default": "comment.doc",
                  },
                },
              ],
              [
                /\s+/,
                {
                  cases: {
                    "@eos": { token: "comment.doc", next: "@pop" },
                    "@default": "comment.doc",
                  },
                },
              ],
              [/.*/, { token: "comment.doc", next: "@pop" }],
            ],
            numbers: [
              [/0[xX][0-9a-fA-F]+/, "number.hex"],
              [/-?(\d*\.)?\d+([eE][+\-]?\d+)?/, "number"],
            ],
            operators: [
              [/<{1,2}-/, "operator"],
              [/->{1,2}/, "operator"],
              [/%[^%\s]+%/, "operator"],
              [/\*\*/, "operator"],
              [/%%/, "operator"],
              [/&&/, "operator"],
              [/\|\|/, "operator"],
              [/<</, "operator"],
              [/>>/, "operator"],
              [/[-+=&|!<>^~*/:$]/, "operator"],
            ],
            strings: [
              [/'/, "string.escape", "@stringBody"],
              [/"/, "string.escape", "@dblStringBody"],
            ],
            stringBody: [
              [/\\./, { cases: { "@special": "string", "@default": "error-token" } }],
              [/'/, "string.escape", "@popall"],
              [/./, "string"],
            ],
            dblStringBody: [
              [/\\./, { cases: { "@special": "string", "@default": "error-token" } }],
              [/"/, "string.escape", "@popall"],
              [/./, "string"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  J3e = [
    "area",
    "base",
    "br",
    "col",
    "embed",
    "hr",
    "img",
    "input",
    "keygen",
    "link",
    "menuitem",
    "meta",
    "param",
    "source",
    "track",
    "wbr",
  ],
  e6e = {
    wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
    comments: { blockComment: ["\x3c!--", "--\x3e"] },
    brackets: [
      ["\x3c!--", "--\x3e"],
      ["<", ">"],
      ["{", "}"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: "<", close: ">" },
    ],
    onEnterRules: [
      {
        beforeText: new RegExp(`<(?!(?:${J3e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
        afterText: /^<\/(\w[\w\d]*)\s*>$/i,
        action: { indentAction: VGe.IndentAction.IndentOutdent },
      },
      {
        beforeText: new RegExp(`<(?!(?:${J3e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
        action: { indentAction: VGe.IndentAction.Indent },
      },
    ],
  },
  t6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: e6e,
        language: {
          defaultToken: "",
          tokenPostfix: "",
          tokenizer: {
            root: [
              [/@@@@/],
              [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.root" }],
              [/<!DOCTYPE/, "metatag.html", "@doctype"],
              [/<!--/, "comment.html", "@comment"],
              [/(<)([\w\-]+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
              [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
              [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
              [/(<)([:\w\-]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
              [/(<\/)([\w\-]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
              [/</, "delimiter.html"],
              [/[ \t\r\n]+/],
              [/[^<@]+/],
            ],
            doctype: [
              [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.comment" }],
              [/[^>]+/, "metatag.content.html"],
              [/>/, "metatag.html", "@pop"],
            ],
            comment: [
              [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.comment" }],
              [/-->/, "comment.html", "@pop"],
              [/[^-]+/, "comment.content.html"],
              [/./, "comment.content.html"],
            ],
            otherTag: [
              [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.otherTag" }],
              [/\/?>/, "delimiter.html", "@pop"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
            ],
            script: [
              [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.script" }],
              [/type/, "attribute.name", "@scriptAfterType"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded.text/javascript",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [
                /(<\/)(script\s*)(>)/,
                ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }],
              ],
            ],
            scriptAfterType: [
              [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.scriptAfterType" }],
              [/=/, "delimiter", "@scriptAfterTypeEquals"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded.text/javascript",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptAfterTypeEquals: [
              [
                /@[^@]/,
                { token: "@rematch", switchTo: "@razorInSimpleState.scriptAfterTypeEquals" },
              ],
              [/"([^"]*)"/, { token: "attribute.value", switchTo: "@scriptWithCustomType.$1" }],
              [/'([^']*)'/, { token: "attribute.value", switchTo: "@scriptWithCustomType.$1" }],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded.text/javascript",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptWithCustomType: [
              [
                /@[^@]/,
                { token: "@rematch", switchTo: "@razorInSimpleState.scriptWithCustomType.$S2" },
              ],
              [/>/, { token: "delimiter.html", next: "@scriptEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptEmbedded: [
              [
                /@[^@]/,
                {
                  token: "@rematch",
                  switchTo: "@razorInEmbeddedState.scriptEmbedded.$S2",
                  nextEmbedded: "@pop",
                },
              ],
              [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
            ],
            style: [
              [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.style" }],
              [/type/, "attribute.name", "@styleAfterType"],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@styleEmbedded.text/css",
                  nextEmbedded: "text/css",
                },
              ],
              [/[ \t\r\n]+/],
              [
                /(<\/)(style\s*)(>)/,
                ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }],
              ],
            ],
            styleAfterType: [
              [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.styleAfterType" }],
              [/=/, "delimiter", "@styleAfterTypeEquals"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@styleEmbedded.text/css",
                  nextEmbedded: "text/css",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleAfterTypeEquals: [
              [
                /@[^@]/,
                { token: "@rematch", switchTo: "@razorInSimpleState.styleAfterTypeEquals" },
              ],
              [/"([^"]*)"/, { token: "attribute.value", switchTo: "@styleWithCustomType.$1" }],
              [/'([^']*)'/, { token: "attribute.value", switchTo: "@styleWithCustomType.$1" }],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@styleEmbedded.text/css",
                  nextEmbedded: "text/css",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleWithCustomType: [
              [
                /@[^@]/,
                { token: "@rematch", switchTo: "@razorInSimpleState.styleWithCustomType.$S2" },
              ],
              [/>/, { token: "delimiter.html", next: "@styleEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value"],
              [/'([^']*)'/, "attribute.value"],
              [/[\w\-]+/, "attribute.name"],
              [/=/, "delimiter"],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleEmbedded: [
              [
                /@[^@]/,
                {
                  token: "@rematch",
                  switchTo: "@razorInEmbeddedState.styleEmbedded.$S2",
                  nextEmbedded: "@pop",
                },
              ],
              [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
            ],
            razorInSimpleState: [
              [/@\*/, "comment.cs", "@razorBlockCommentTopLevel"],
              [/@[{(]/, "metatag.cs", "@razorRootTopLevel"],
              [/(@)(\s*[\w]+)/, ["metatag.cs", { token: "identifier.cs", switchTo: "@$S2.$S3" }]],
              [/[})]/, { token: "metatag.cs", switchTo: "@$S2.$S3" }],
              [/\*@/, { token: "comment.cs", switchTo: "@$S2.$S3" }],
            ],
            razorInEmbeddedState: [
              [/@\*/, "comment.cs", "@razorBlockCommentTopLevel"],
              [/@[{(]/, "metatag.cs", "@razorRootTopLevel"],
              [
                /(@)(\s*[\w]+)/,
                [
                  "metatag.cs",
                  { token: "identifier.cs", switchTo: "@$S2.$S3", nextEmbedded: "$S3" },
                ],
              ],
              [/[})]/, { token: "metatag.cs", switchTo: "@$S2.$S3", nextEmbedded: "$S3" }],
              [/\*@/, { token: "comment.cs", switchTo: "@$S2.$S3", nextEmbedded: "$S3" }],
            ],
            razorBlockCommentTopLevel: [
              [/\*@/, "@rematch", "@pop"],
              [/[^*]+/, "comment.cs"],
              [/./, "comment.cs"],
            ],
            razorBlockComment: [
              [/\*@/, "comment.cs", "@pop"],
              [/[^*]+/, "comment.cs"],
              [/./, "comment.cs"],
            ],
            razorRootTopLevel: [
              [/\{/, "delimiter.bracket.cs", "@razorRoot"],
              [/\(/, "delimiter.parenthesis.cs", "@razorRoot"],
              [/[})]/, "@rematch", "@pop"],
              { include: "razorCommon" },
            ],
            razorRoot: [
              [/\{/, "delimiter.bracket.cs", "@razorRoot"],
              [/\(/, "delimiter.parenthesis.cs", "@razorRoot"],
              [/\}/, "delimiter.bracket.cs", "@pop"],
              [/\)/, "delimiter.parenthesis.cs", "@pop"],
              { include: "razorCommon" },
            ],
            razorCommon: [
              [
                /[a-zA-Z_]\w*/,
                {
                  cases: { "@razorKeywords": { token: "keyword.cs" }, "@default": "identifier.cs" },
                },
              ],
              [/[\[\]]/, "delimiter.array.cs"],
              [/[ \t\r\n]+/],
              [/\/\/.*$/, "comment.cs"],
              [/@\*/, "comment.cs", "@razorBlockComment"],
              [/"([^"]*)"/, "string.cs"],
              [/'([^']*)'/, "string.cs"],
              [/(<)([\w\-]+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
              [/(<)([\w\-]+)(>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
              [/(<\/)([\w\-]+)(>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
              [/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,]/, "delimiter.cs"],
              [/\d*\d+[eE]([\-+]?\d+)?/, "number.float.cs"],
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float.cs"],
              [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex.cs"],
              [/0[0-7']*[0-7]/, "number.octal.cs"],
              [/0[bB][0-1']*[0-1]/, "number.binary.cs"],
              [/\d[\d']*/, "number.cs"],
              [/\d/, "number.cs"],
            ],
          },
          razorKeywords: [
            "abstract",
            "as",
            "async",
            "await",
            "base",
            "bool",
            "break",
            "by",
            "byte",
            "case",
            "catch",
            "char",
            "checked",
            "class",
            "const",
            "continue",
            "decimal",
            "default",
            "delegate",
            "do",
            "double",
            "descending",
            "explicit",
            "event",
            "extern",
            "else",
            "enum",
            "false",
            "finally",
            "fixed",
            "float",
            "for",
            "foreach",
            "from",
            "goto",
            "group",
            "if",
            "implicit",
            "in",
            "int",
            "interface",
            "internal",
            "into",
            "is",
            "lock",
            "long",
            "nameof",
            "new",
            "null",
            "namespace",
            "object",
            "operator",
            "out",
            "override",
            "orderby",
            "params",
            "private",
            "protected",
            "public",
            "readonly",
            "ref",
            "return",
            "switch",
            "struct",
            "sbyte",
            "sealed",
            "short",
            "sizeof",
            "stackalloc",
            "static",
            "string",
            "select",
            "this",
            "throw",
            "true",
            "try",
            "typeof",
            "uint",
            "ulong",
            "unchecked",
            "unsafe",
            "ushort",
            "using",
            "var",
            "virtual",
            "volatile",
            "void",
            "when",
            "while",
            "where",
            "yield",
            "model",
            "inject",
          ],
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  n6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".redis",
          ignoreCase: !0,
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          keywords: [
            "APPEND",
            "AUTH",
            "BGREWRITEAOF",
            "BGSAVE",
            "BITCOUNT",
            "BITFIELD",
            "BITOP",
            "BITPOS",
            "BLPOP",
            "BRPOP",
            "BRPOPLPUSH",
            "CLIENT",
            "KILL",
            "LIST",
            "GETNAME",
            "PAUSE",
            "REPLY",
            "SETNAME",
            "CLUSTER",
            "ADDSLOTS",
            "COUNT-FAILURE-REPORTS",
            "COUNTKEYSINSLOT",
            "DELSLOTS",
            "FAILOVER",
            "FORGET",
            "GETKEYSINSLOT",
            "INFO",
            "KEYSLOT",
            "MEET",
            "NODES",
            "REPLICATE",
            "RESET",
            "SAVECONFIG",
            "SET-CONFIG-EPOCH",
            "SETSLOT",
            "SLAVES",
            "SLOTS",
            "COMMAND",
            "COUNT",
            "GETKEYS",
            "CONFIG",
            "GET",
            "REWRITE",
            "SET",
            "RESETSTAT",
            "DBSIZE",
            "DEBUG",
            "OBJECT",
            "SEGFAULT",
            "DECR",
            "DECRBY",
            "DEL",
            "DISCARD",
            "DUMP",
            "ECHO",
            "EVAL",
            "EVALSHA",
            "EXEC",
            "EXISTS",
            "EXPIRE",
            "EXPIREAT",
            "FLUSHALL",
            "FLUSHDB",
            "GEOADD",
            "GEOHASH",
            "GEOPOS",
            "GEODIST",
            "GEORADIUS",
            "GEORADIUSBYMEMBER",
            "GETBIT",
            "GETRANGE",
            "GETSET",
            "HDEL",
            "HEXISTS",
            "HGET",
            "HGETALL",
            "HINCRBY",
            "HINCRBYFLOAT",
            "HKEYS",
            "HLEN",
            "HMGET",
            "HMSET",
            "HSET",
            "HSETNX",
            "HSTRLEN",
            "HVALS",
            "INCR",
            "INCRBY",
            "INCRBYFLOAT",
            "KEYS",
            "LASTSAVE",
            "LINDEX",
            "LINSERT",
            "LLEN",
            "LPOP",
            "LPUSH",
            "LPUSHX",
            "LRANGE",
            "LREM",
            "LSET",
            "LTRIM",
            "MGET",
            "MIGRATE",
            "MONITOR",
            "MOVE",
            "MSET",
            "MSETNX",
            "MULTI",
            "PERSIST",
            "PEXPIRE",
            "PEXPIREAT",
            "PFADD",
            "PFCOUNT",
            "PFMERGE",
            "PING",
            "PSETEX",
            "PSUBSCRIBE",
            "PUBSUB",
            "PTTL",
            "PUBLISH",
            "PUNSUBSCRIBE",
            "QUIT",
            "RANDOMKEY",
            "READONLY",
            "READWRITE",
            "RENAME",
            "RENAMENX",
            "RESTORE",
            "ROLE",
            "RPOP",
            "RPOPLPUSH",
            "RPUSH",
            "RPUSHX",
            "SADD",
            "SAVE",
            "SCARD",
            "SCRIPT",
            "FLUSH",
            "LOAD",
            "SDIFF",
            "SDIFFSTORE",
            "SELECT",
            "SETBIT",
            "SETEX",
            "SETNX",
            "SETRANGE",
            "SHUTDOWN",
            "SINTER",
            "SINTERSTORE",
            "SISMEMBER",
            "SLAVEOF",
            "SLOWLOG",
            "SMEMBERS",
            "SMOVE",
            "SORT",
            "SPOP",
            "SRANDMEMBER",
            "SREM",
            "STRLEN",
            "SUBSCRIBE",
            "SUNION",
            "SUNIONSTORE",
            "SWAPDB",
            "SYNC",
            "TIME",
            "TOUCH",
            "TTL",
            "TYPE",
            "UNSUBSCRIBE",
            "UNLINK",
            "UNWATCH",
            "WAIT",
            "WATCH",
            "ZADD",
            "ZCARD",
            "ZCOUNT",
            "ZINCRBY",
            "ZINTERSTORE",
            "ZLEXCOUNT",
            "ZRANGE",
            "ZRANGEBYLEX",
            "ZREVRANGEBYLEX",
            "ZRANGEBYSCORE",
            "ZRANK",
            "ZREM",
            "ZREMRANGEBYLEX",
            "ZREMRANGEBYRANK",
            "ZREMRANGEBYSCORE",
            "ZREVRANGE",
            "ZREVRANGEBYSCORE",
            "ZREVRANK",
            "ZSCORE",
            "ZUNIONSTORE",
            "SCAN",
            "SSCAN",
            "HSCAN",
            "ZSCAN",
          ],
          operators: [],
          builtinFunctions: [],
          builtinVariables: [],
          pseudoColumns: [],
          tokenizer: {
            root: [
              { include: "@whitespace" },
              { include: "@pseudoColumns" },
              { include: "@numbers" },
              { include: "@strings" },
              { include: "@scopes" },
              [/[;,.]/, "delimiter"],
              [/[()]/, "@brackets"],
              [
                /[\w@#$]+/,
                {
                  cases: {
                    "@keywords": "keyword",
                    "@operators": "operator",
                    "@builtinVariables": "predefined",
                    "@builtinFunctions": "predefined",
                    "@default": "identifier",
                  },
                },
              ],
              [/[<>=!%&+\-*/|~^]/, "operator"],
            ],
            whitespace: [[/\s+/, "white"]],
            pseudoColumns: [
              [
                /[$][A-Za-z_][\w@#$]*/,
                { cases: { "@pseudoColumns": "predefined", "@default": "identifier" } },
              ],
            ],
            numbers: [
              [/0[xX][0-9a-fA-F]*/, "number"],
              [/[$][+-]*\d*(\.\d*)?/, "number"],
              [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, "number"],
            ],
            strings: [
              [/'/, { token: "string", next: "@string" }],
              [/"/, { token: "string.double", next: "@stringDouble" }],
            ],
            string: [
              [/[^']+/, "string"],
              [/''/, "string"],
              [/'/, { token: "string", next: "@pop" }],
            ],
            stringDouble: [
              [/[^"]+/, "string.double"],
              [/""/, "string.double"],
              [/"/, { token: "string.double", next: "@pop" }],
            ],
            scopes: [],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  i6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "--", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".sql",
          ignoreCase: !0,
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          keywords: [
            "AES128",
            "AES256",
            "ALL",
            "ALLOWOVERWRITE",
            "ANALYSE",
            "ANALYZE",
            "AND",
            "ANY",
            "ARRAY",
            "AS",
            "ASC",
            "AUTHORIZATION",
            "AZ64",
            "BACKUP",
            "BETWEEN",
            "BINARY",
            "BLANKSASNULL",
            "BOTH",
            "BYTEDICT",
            "BZIP2",
            "CASE",
            "CAST",
            "CHECK",
            "COLLATE",
            "COLUMN",
            "CONSTRAINT",
            "CREATE",
            "CREDENTIALS",
            "CROSS",
            "CURRENT_DATE",
            "CURRENT_TIME",
            "CURRENT_TIMESTAMP",
            "CURRENT_USER",
            "CURRENT_USER_ID",
            "DEFAULT",
            "DEFERRABLE",
            "DEFLATE",
            "DEFRAG",
            "DELTA",
            "DELTA32K",
            "DESC",
            "DISABLE",
            "DISTINCT",
            "DO",
            "ELSE",
            "EMPTYASNULL",
            "ENABLE",
            "ENCODE",
            "ENCRYPT",
            "ENCRYPTION",
            "END",
            "EXCEPT",
            "EXPLICIT",
            "FALSE",
            "FOR",
            "FOREIGN",
            "FREEZE",
            "FROM",
            "FULL",
            "GLOBALDICT256",
            "GLOBALDICT64K",
            "GRANT",
            "GROUP",
            "GZIP",
            "HAVING",
            "IDENTITY",
            "IGNORE",
            "ILIKE",
            "IN",
            "INITIALLY",
            "INNER",
            "INTERSECT",
            "INTO",
            "IS",
            "ISNULL",
            "JOIN",
            "LANGUAGE",
            "LEADING",
            "LEFT",
            "LIKE",
            "LIMIT",
            "LOCALTIME",
            "LOCALTIMESTAMP",
            "LUN",
            "LUNS",
            "LZO",
            "LZOP",
            "MINUS",
            "MOSTLY16",
            "MOSTLY32",
            "MOSTLY8",
            "NATURAL",
            "NEW",
            "NOT",
            "NOTNULL",
            "NULL",
            "NULLS",
            "OFF",
            "OFFLINE",
            "OFFSET",
            "OID",
            "OLD",
            "ON",
            "ONLY",
            "OPEN",
            "OR",
            "ORDER",
            "OUTER",
            "OVERLAPS",
            "PARALLEL",
            "PARTITION",
            "PERCENT",
            "PERMISSIONS",
            "PLACING",
            "PRIMARY",
            "RAW",
            "READRATIO",
            "RECOVER",
            "REFERENCES",
            "RESPECT",
            "REJECTLOG",
            "RESORT",
            "RESTORE",
            "RIGHT",
            "SELECT",
            "SESSION_USER",
            "SIMILAR",
            "SNAPSHOT",
            "SOME",
            "SYSDATE",
            "SYSTEM",
            "TABLE",
            "TAG",
            "TDES",
            "TEXT255",
            "TEXT32K",
            "THEN",
            "TIMESTAMP",
            "TO",
            "TOP",
            "TRAILING",
            "TRUE",
            "TRUNCATECOLUMNS",
            "UNION",
            "UNIQUE",
            "USER",
            "USING",
            "VERBOSE",
            "WALLET",
            "WHEN",
            "WHERE",
            "WITH",
            "WITHOUT",
          ],
          operators: [
            "AND",
            "BETWEEN",
            "IN",
            "LIKE",
            "NOT",
            "OR",
            "IS",
            "NULL",
            "INTERSECT",
            "UNION",
            "INNER",
            "JOIN",
            "LEFT",
            "OUTER",
            "RIGHT",
          ],
          builtinFunctions: [
            "current_schema",
            "current_schemas",
            "has_database_privilege",
            "has_schema_privilege",
            "has_table_privilege",
            "age",
            "current_time",
            "current_timestamp",
            "localtime",
            "isfinite",
            "now",
            "ascii",
            "get_bit",
            "get_byte",
            "set_bit",
            "set_byte",
            "to_ascii",
            "approximate percentile_disc",
            "avg",
            "count",
            "listagg",
            "max",
            "median",
            "min",
            "percentile_cont",
            "stddev_samp",
            "stddev_pop",
            "sum",
            "var_samp",
            "var_pop",
            "bit_and",
            "bit_or",
            "bool_and",
            "bool_or",
            "cume_dist",
            "first_value",
            "lag",
            "last_value",
            "lead",
            "nth_value",
            "ratio_to_report",
            "dense_rank",
            "ntile",
            "percent_rank",
            "rank",
            "row_number",
            "case",
            "coalesce",
            "decode",
            "greatest",
            "least",
            "nvl",
            "nvl2",
            "nullif",
            "add_months",
            "at time zone",
            "convert_timezone",
            "current_date",
            "date_cmp",
            "date_cmp_timestamp",
            "date_cmp_timestamptz",
            "date_part_year",
            "dateadd",
            "datediff",
            "date_part",
            "date_trunc",
            "extract",
            "getdate",
            "interval_cmp",
            "last_day",
            "months_between",
            "next_day",
            "sysdate",
            "timeofday",
            "timestamp_cmp",
            "timestamp_cmp_date",
            "timestamp_cmp_timestamptz",
            "timestamptz_cmp",
            "timestamptz_cmp_date",
            "timestamptz_cmp_timestamp",
            "timezone",
            "to_timestamp",
            "trunc",
            "abs",
            "acos",
            "asin",
            "atan",
            "atan2",
            "cbrt",
            "ceil",
            "ceiling",
            "checksum",
            "cos",
            "cot",
            "degrees",
            "dexp",
            "dlog1",
            "dlog10",
            "exp",
            "floor",
            "ln",
            "log",
            "mod",
            "pi",
            "power",
            "radians",
            "random",
            "round",
            "sin",
            "sign",
            "sqrt",
            "tan",
            "to_hex",
            "bpcharcmp",
            "btrim",
            "bttext_pattern_cmp",
            "char_length",
            "character_length",
            "charindex",
            "chr",
            "concat",
            "crc32",
            "func_sha1",
            "initcap",
            "left and rights",
            "len",
            "length",
            "lower",
            "lpad and rpads",
            "ltrim",
            "md5",
            "octet_length",
            "position",
            "quote_ident",
            "quote_literal",
            "regexp_count",
            "regexp_instr",
            "regexp_replace",
            "regexp_substr",
            "repeat",
            "replace",
            "replicate",
            "reverse",
            "rtrim",
            "split_part",
            "strpos",
            "strtol",
            "substring",
            "textlen",
            "translate",
            "trim",
            "upper",
            "cast",
            "convert",
            "to_char",
            "to_date",
            "to_number",
            "json_array_length",
            "json_extract_array_element_text",
            "json_extract_path_text",
            "current_setting",
            "pg_cancel_backend",
            "pg_terminate_backend",
            "set_config",
            "current_database",
            "current_user",
            "current_user_id",
            "pg_backend_pid",
            "pg_last_copy_count",
            "pg_last_copy_id",
            "pg_last_query_id",
            "pg_last_unload_count",
            "session_user",
            "slice_num",
            "user",
            "version",
            "abbrev",
            "acosd",
            "any",
            "area",
            "array_agg",
            "array_append",
            "array_cat",
            "array_dims",
            "array_fill",
            "array_length",
            "array_lower",
            "array_ndims",
            "array_position",
            "array_positions",
            "array_prepend",
            "array_remove",
            "array_replace",
            "array_to_json",
            "array_to_string",
            "array_to_tsvector",
            "array_upper",
            "asind",
            "atan2d",
            "atand",
            "bit",
            "bit_length",
            "bound_box",
            "box",
            "brin_summarize_new_values",
            "broadcast",
            "cardinality",
            "center",
            "circle",
            "clock_timestamp",
            "col_description",
            "concat_ws",
            "convert_from",
            "convert_to",
            "corr",
            "cosd",
            "cotd",
            "covar_pop",
            "covar_samp",
            "current_catalog",
            "current_query",
            "current_role",
            "currval",
            "cursor_to_xml",
            "diameter",
            "div",
            "encode",
            "enum_first",
            "enum_last",
            "enum_range",
            "every",
            "family",
            "format",
            "format_type",
            "generate_series",
            "generate_subscripts",
            "get_current_ts_config",
            "gin_clean_pending_list",
            "grouping",
            "has_any_column_privilege",
            "has_column_privilege",
            "has_foreign_data_wrapper_privilege",
            "has_function_privilege",
            "has_language_privilege",
            "has_sequence_privilege",
            "has_server_privilege",
            "has_tablespace_privilege",
            "has_type_privilege",
            "height",
            "host",
            "hostmask",
            "inet_client_addr",
            "inet_client_port",
            "inet_merge",
            "inet_same_family",
            "inet_server_addr",
            "inet_server_port",
            "isclosed",
            "isempty",
            "isopen",
            "json_agg",
            "json_object",
            "json_object_agg",
            "json_populate_record",
            "json_populate_recordset",
            "json_to_record",
            "json_to_recordset",
            "jsonb_agg",
            "jsonb_object_agg",
            "justify_days",
            "justify_hours",
            "justify_interval",
            "lastval",
            "left",
            "line",
            "localtimestamp",
            "lower_inc",
            "lower_inf",
            "lpad",
            "lseg",
            "make_date",
            "make_interval",
            "make_time",
            "make_timestamp",
            "make_timestamptz",
            "masklen",
            "mode",
            "netmask",
            "network",
            "nextval",
            "npoints",
            "num_nonnulls",
            "num_nulls",
            "numnode",
            "obj_description",
            "overlay",
            "parse_ident",
            "path",
            "pclose",
            "percentile_disc",
            "pg_advisory_lock",
            "pg_advisory_lock_shared",
            "pg_advisory_unlock",
            "pg_advisory_unlock_all",
            "pg_advisory_unlock_shared",
            "pg_advisory_xact_lock",
            "pg_advisory_xact_lock_shared",
            "pg_backup_start_time",
            "pg_blocking_pids",
            "pg_client_encoding",
            "pg_collation_is_visible",
            "pg_column_size",
            "pg_conf_load_time",
            "pg_control_checkpoint",
            "pg_control_init",
            "pg_control_recovery",
            "pg_control_system",
            "pg_conversion_is_visible",
            "pg_create_logical_replication_slot",
            "pg_create_physical_replication_slot",
            "pg_create_restore_point",
            "pg_current_xlog_flush_location",
            "pg_current_xlog_insert_location",
            "pg_current_xlog_location",
            "pg_database_size",
            "pg_describe_object",
            "pg_drop_replication_slot",
            "pg_export_snapshot",
            "pg_filenode_relation",
            "pg_function_is_visible",
            "pg_get_constraintdef",
            "pg_get_expr",
            "pg_get_function_arguments",
            "pg_get_function_identity_arguments",
            "pg_get_function_result",
            "pg_get_functiondef",
            "pg_get_indexdef",
            "pg_get_keywords",
            "pg_get_object_address",
            "pg_get_owned_sequence",
            "pg_get_ruledef",
            "pg_get_serial_sequence",
            "pg_get_triggerdef",
            "pg_get_userbyid",
            "pg_get_viewdef",
            "pg_has_role",
            "pg_identify_object",
            "pg_identify_object_as_address",
            "pg_index_column_has_property",
            "pg_index_has_property",
            "pg_indexam_has_property",
            "pg_indexes_size",
            "pg_is_in_backup",
            "pg_is_in_recovery",
            "pg_is_other_temp_schema",
            "pg_is_xlog_replay_paused",
            "pg_last_committed_xact",
            "pg_last_xact_replay_timestamp",
            "pg_last_xlog_receive_location",
            "pg_last_xlog_replay_location",
            "pg_listening_channels",
            "pg_logical_emit_message",
            "pg_logical_slot_get_binary_changes",
            "pg_logical_slot_get_changes",
            "pg_logical_slot_peek_binary_changes",
            "pg_logical_slot_peek_changes",
            "pg_ls_dir",
            "pg_my_temp_schema",
            "pg_notification_queue_usage",
            "pg_opclass_is_visible",
            "pg_operator_is_visible",
            "pg_opfamily_is_visible",
            "pg_options_to_table",
            "pg_postmaster_start_time",
            "pg_read_binary_file",
            "pg_read_file",
            "pg_relation_filenode",
            "pg_relation_filepath",
            "pg_relation_size",
            "pg_reload_conf",
            "pg_replication_origin_create",
            "pg_replication_origin_drop",
            "pg_replication_origin_oid",
            "pg_replication_origin_progress",
            "pg_replication_origin_session_is_setup",
            "pg_replication_origin_session_progress",
            "pg_replication_origin_session_reset",
            "pg_replication_origin_session_setup",
            "pg_replication_origin_xact_reset",
            "pg_replication_origin_xact_setup",
            "pg_rotate_logfile",
            "pg_size_bytes",
            "pg_size_pretty",
            "pg_sleep",
            "pg_sleep_for",
            "pg_sleep_until",
            "pg_start_backup",
            "pg_stat_file",
            "pg_stop_backup",
            "pg_switch_xlog",
            "pg_table_is_visible",
            "pg_table_size",
            "pg_tablespace_databases",
            "pg_tablespace_location",
            "pg_tablespace_size",
            "pg_total_relation_size",
            "pg_trigger_depth",
            "pg_try_advisory_lock",
            "pg_try_advisory_lock_shared",
            "pg_try_advisory_xact_lock",
            "pg_try_advisory_xact_lock_shared",
            "pg_ts_config_is_visible",
            "pg_ts_dict_is_visible",
            "pg_ts_parser_is_visible",
            "pg_ts_template_is_visible",
            "pg_type_is_visible",
            "pg_typeof",
            "pg_xact_commit_timestamp",
            "pg_xlog_location_diff",
            "pg_xlog_replay_pause",
            "pg_xlog_replay_resume",
            "pg_xlogfile_name",
            "pg_xlogfile_name_offset",
            "phraseto_tsquery",
            "plainto_tsquery",
            "point",
            "polygon",
            "popen",
            "pqserverversion",
            "query_to_xml",
            "querytree",
            "quote_nullable",
            "radius",
            "range_merge",
            "regexp_matches",
            "regexp_split_to_array",
            "regexp_split_to_table",
            "regr_avgx",
            "regr_avgy",
            "regr_count",
            "regr_intercept",
            "regr_r2",
            "regr_slope",
            "regr_sxx",
            "regr_sxy",
            "regr_syy",
            "right",
            "row_security_active",
            "row_to_json",
            "rpad",
            "scale",
            "set_masklen",
            "setseed",
            "setval",
            "setweight",
            "shobj_description",
            "sind",
            "sprintf",
            "statement_timestamp",
            "stddev",
            "string_agg",
            "string_to_array",
            "strip",
            "substr",
            "table_to_xml",
            "table_to_xml_and_xmlschema",
            "tand",
            "text",
            "to_json",
            "to_regclass",
            "to_regnamespace",
            "to_regoper",
            "to_regoperator",
            "to_regproc",
            "to_regprocedure",
            "to_regrole",
            "to_regtype",
            "to_tsquery",
            "to_tsvector",
            "transaction_timestamp",
            "ts_debug",
            "ts_delete",
            "ts_filter",
            "ts_headline",
            "ts_lexize",
            "ts_parse",
            "ts_rank",
            "ts_rank_cd",
            "ts_rewrite",
            "ts_stat",
            "ts_token_type",
            "tsquery_phrase",
            "tsvector_to_array",
            "tsvector_update_trigger",
            "tsvector_update_trigger_column",
            "txid_current",
            "txid_current_snapshot",
            "txid_snapshot_xip",
            "txid_snapshot_xmax",
            "txid_snapshot_xmin",
            "txid_visible_in_snapshot",
            "unnest",
            "upper_inc",
            "upper_inf",
            "variance",
            "width",
            "width_bucket",
            "xml_is_well_formed",
            "xml_is_well_formed_content",
            "xml_is_well_formed_document",
            "xmlagg",
            "xmlcomment",
            "xmlconcat",
            "xmlelement",
            "xmlexists",
            "xmlforest",
            "xmlparse",
            "xmlpi",
            "xmlroot",
            "xmlserialize",
            "xpath",
            "xpath_exists",
          ],
          builtinVariables: [],
          pseudoColumns: [],
          tokenizer: {
            root: [
              { include: "@comments" },
              { include: "@whitespace" },
              { include: "@pseudoColumns" },
              { include: "@numbers" },
              { include: "@strings" },
              { include: "@complexIdentifiers" },
              { include: "@scopes" },
              [/[;,.]/, "delimiter"],
              [/[()]/, "@brackets"],
              [
                /[\w@#$]+/,
                {
                  cases: {
                    "@keywords": "keyword",
                    "@operators": "operator",
                    "@builtinVariables": "predefined",
                    "@builtinFunctions": "predefined",
                    "@default": "identifier",
                  },
                },
              ],
              [/[<>=!%&+\-*/|~^]/, "operator"],
            ],
            whitespace: [[/\s+/, "white"]],
            comments: [
              [/--+.*/, "comment"],
              [/\/\*/, { token: "comment.quote", next: "@comment" }],
            ],
            comment: [
              [/[^*/]+/, "comment"],
              [/\*\//, { token: "comment.quote", next: "@pop" }],
              [/./, "comment"],
            ],
            pseudoColumns: [
              [
                /[$][A-Za-z_][\w@#$]*/,
                { cases: { "@pseudoColumns": "predefined", "@default": "identifier" } },
              ],
            ],
            numbers: [
              [/0[xX][0-9a-fA-F]*/, "number"],
              [/[$][+-]*\d*(\.\d*)?/, "number"],
              [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, "number"],
            ],
            strings: [[/'/, { token: "string", next: "@string" }]],
            string: [
              [/[^']+/, "string"],
              [/''/, "string"],
              [/'/, { token: "string", next: "@pop" }],
            ],
            complexIdentifiers: [[/"/, { token: "identifier.quote", next: "@quotedIdentifier" }]],
            quotedIdentifier: [
              [/[^"]+/, "identifier"],
              [/""/, "identifier"],
              [/"/, { token: "identifier.quote", next: "@pop" }],
            ],
            scopes: [],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  r6e = {
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: "<", close: ">", notIn: ["string"] },
    ],
    surroundingPairs: [
      { open: "(", close: ")" },
      { open: "[", close: "]" },
      { open: "`", close: "`" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),
        end: new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e"),
      },
    },
  },
  o6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: r6e,
        language: {
          defaultToken: "",
          tokenPostfix: ".rst",
          control: /[\\`*_\[\]{}()#+\-\.!]/,
          escapes: /\\(?:@control)/,
          empty: [
            "area",
            "base",
            "basefont",
            "br",
            "col",
            "frame",
            "hr",
            "img",
            "input",
            "isindex",
            "link",
            "meta",
            "param",
          ],
          alphanumerics: /[A-Za-z0-9]/,
          simpleRefNameWithoutBq: /(?:@alphanumerics[-_+:.]*@alphanumerics)+|(?:@alphanumerics+)/,
          simpleRefName: /(?:`@phrase`|@simpleRefNameWithoutBq)/,
          phrase: /@simpleRefNameWithoutBq(?:\s@simpleRefNameWithoutBq)*/,
          citationName: /[A-Za-z][A-Za-z0-9-_.]*/,
          blockLiteralStart: /(?:[!"#$%&'()*+,-./:;<=>?@\[\]^_`{|}~]|[\s])/,
          precedingChars: /(?:[ -:/'"<([{])/,
          followingChars: /(?:[ -.,:;!?/'")\]}>]|$)/,
          punctuation: /(=|-|~|`|#|"|\^|\+|\*|:|\.|'|_|\+)/,
          tokenizer: {
            root: [
              [/^(@punctuation{3,}$){1,1}?/, "keyword"],
              [/^\s*([\*\-+‣•]|[a-zA-Z0-9]+\.|\([a-zA-Z0-9]+\)|[a-zA-Z0-9]+\))\s/, "keyword"],
              [/([ ]::)\s*$/, "keyword", "@blankLineOfLiteralBlocks"],
              [/(::)\s*$/, "keyword", "@blankLineOfLiteralBlocks"],
              { include: "@tables" },
              { include: "@explicitMarkupBlocks" },
              { include: "@inlineMarkup" },
            ],
            explicitMarkupBlocks: [
              { include: "@citations" },
              { include: "@footnotes" },
              [
                /^(\.\.\s)(@simpleRefName)(::\s)(.*)$/,
                [{ token: "", next: "subsequentLines" }, "keyword", "", ""],
              ],
              [
                /^(\.\.)(\s+)(_)(@simpleRefName)(:)(\s+)(.*)/,
                [{ token: "", next: "hyperlinks" }, "", "", "string.link", "", "", "string.link"],
              ],
              [
                /^((?:(?:\.\.)(?:\s+))?)(__)(:)(\s+)(.*)/,
                [{ token: "", next: "subsequentLines" }, "", "", "", "string.link"],
              ],
              [/^(__\s+)(.+)/, ["", "string.link"]],
              [
                /^(\.\.)( \|)([^| ]+[^|]*[^| ]*)(\| )(@simpleRefName)(:: .*)/,
                [{ token: "", next: "subsequentLines" }, "", "string.link", "", "keyword", ""],
                "@rawBlocks",
              ],
              [/(\|)([^| ]+[^|]*[^| ]*)(\|_{0,2})/, ["", "string.link", ""]],
              [/^(\.\.)([ ].*)$/, [{ token: "", next: "@comments" }, "comment"]],
            ],
            inlineMarkup: [
              { include: "@citationsReference" },
              { include: "@footnotesReference" },
              [/(@simpleRefName)(_{1,2})/, ["string.link", ""]],
              [
                /(`)([^<`]+\s+)(<)(.*)(>)(`)(_)/,
                ["", "string.link", "", "string.link", "", "", ""],
              ],
              [/\*\*([^\\*]|\*(?!\*))+\*\*/, "strong"],
              [/\*[^*]+\*/, "emphasis"],
              [/(``)((?:[^`]|\`(?!`))+)(``)/, ["", "keyword", ""]],
              [/(__\s+)(.+)/, ["", "keyword"]],
              [/(:)((?:@simpleRefNameWithoutBq)?)(:`)([^`]+)(`)/, ["", "keyword", "", "", ""]],
              [/(`)([^`]+)(`:)((?:@simpleRefNameWithoutBq)?)(:)/, ["", "", "", "keyword", ""]],
              [/(`)([^`]+)(`)/, ""],
              [/(_`)(@phrase)(`)/, ["", "string.link", ""]],
            ],
            citations: [
              [
                /^(\.\.\s+\[)((?:@citationName))(\]\s+)(.*)/,
                [{ token: "", next: "@subsequentLines" }, "string.link", "", ""],
              ],
            ],
            citationsReference: [[/(\[)(@citationName)(\]_)/, ["", "string.link", ""]]],
            footnotes: [
              [
                /^(\.\.\s+\[)((?:[0-9]+))(\]\s+.*)/,
                [{ token: "", next: "@subsequentLines" }, "string.link", ""],
              ],
              [
                /^(\.\.\s+\[)((?:#@simpleRefName?))(\]\s+)(.*)/,
                [{ token: "", next: "@subsequentLines" }, "string.link", "", ""],
              ],
              [
                /^(\.\.\s+\[)((?:\*))(\]\s+)(.*)/,
                [{ token: "", next: "@subsequentLines" }, "string.link", "", ""],
              ],
            ],
            footnotesReference: [
              [/(\[)([0-9]+)(\])(_)/, ["", "string.link", "", ""]],
              [/(\[)(#@simpleRefName?)(\])(_)/, ["", "string.link", "", ""]],
              [/(\[)(\*)(\])(_)/, ["", "string.link", "", ""]],
            ],
            blankLineOfLiteralBlocks: [
              [/^$/, "", "@subsequentLinesOfLiteralBlocks"],
              [/^.*$/, "", "@pop"],
            ],
            subsequentLinesOfLiteralBlocks: [
              [/(@blockLiteralStart+)(.*)/, ["keyword", ""]],
              [/^(?!blockLiteralStart)/, "", "@popall"],
            ],
            subsequentLines: [
              [/^[\s]+.*/, ""],
              [/^(?!\s)/, "", "@pop"],
            ],
            hyperlinks: [
              [/^[\s]+.*/, "string.link"],
              [/^(?!\s)/, "", "@pop"],
            ],
            comments: [
              [/^[\s]+.*/, "comment"],
              [/^(?!\s)/, "", "@pop"],
            ],
            tables: [
              [/\+-[+-]+/, "keyword"],
              [/\+=[+=]+/, "keyword"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  s6e = {
    comments: { lineComment: "#", blockComment: ["=begin", "=end"] },
    brackets: [
      ["(", ")"],
      ["{", "}"],
      ["[", "]"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    indentationRules: {
      increaseIndentPattern: new RegExp(
        "^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while|case)|([^#]*\\sdo\\b)|([^#]*=\\s*(case|if|unless)))\\b([^#\\{;]|(\"|'|/).*\\4)*(#.*)?$",
      ),
      decreaseIndentPattern: new RegExp(
        "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when)\\b)",
      ),
    },
  },
  a6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: s6e,
        language: {
          tokenPostfix: ".ruby",
          keywords: [
            "__LINE__",
            "__ENCODING__",
            "__FILE__",
            "BEGIN",
            "END",
            "alias",
            "and",
            "begin",
            "break",
            "case",
            "class",
            "def",
            "defined?",
            "do",
            "else",
            "elsif",
            "end",
            "ensure",
            "for",
            "false",
            "if",
            "in",
            "module",
            "next",
            "nil",
            "not",
            "or",
            "redo",
            "rescue",
            "retry",
            "return",
            "self",
            "super",
            "then",
            "true",
            "undef",
            "unless",
            "until",
            "when",
            "while",
            "yield",
          ],
          keywordops: ["::", "..", "...", "?", ":", "=>"],
          builtins: [
            "require",
            "public",
            "private",
            "include",
            "extend",
            "attr_reader",
            "protected",
            "private_class_method",
            "protected_class_method",
            "new",
          ],
          declarations: [
            "module",
            "class",
            "def",
            "case",
            "do",
            "begin",
            "for",
            "if",
            "while",
            "until",
            "unless",
          ],
          linedecls: ["def", "case", "do", "begin", "for", "if", "while", "until", "unless"],
          operators: [
            "^",
            "&",
            "|",
            "<=>",
            "==",
            "===",
            "!~",
            "=~",
            ">",
            ">=",
            "<",
            "<=",
            "<<",
            ">>",
            "+",
            "-",
            "*",
            "/",
            "%",
            "**",
            "~",
            "+@",
            "-@",
            "[]",
            "[]=",
            "`",
            "+=",
            "-=",
            "*=",
            "**=",
            "/=",
            "^=",
            "%=",
            "<<=",
            ">>=",
            "&=",
            "&&=",
            "||=",
            "|=",
          ],
          brackets: [
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
          ],
          symbols: /[=><!~?:&|+\-*\/\^%\.]+/,
          escape: /(?:[abefnrstv\\"'\n\r]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4})/,
          escapes: /\\(?:C\-(@escape|.)|c(@escape|.)|@escape)/,
          decpart: /\d(_?\d)*/,
          decimal: /0|@decpart/,
          delim: /[^a-zA-Z0-9\s\n\r]/,
          heredelim: /(?:\w+|'[^']*'|"[^"]*"|`[^`]*`)/,
          regexpctl: /[(){}\[\]\$\^|\-*+?\.]/,
          regexpesc:
            /\\(?:[AzZbBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})?/,
          tokenizer: {
            root: [
              [
                /^(\s*)([a-z_]\w*[!?=]?)/,
                [
                  "white",
                  {
                    cases: {
                      "for|until|while": { token: "keyword.$2", next: "@dodecl.$2" },
                      "@declarations": { token: "keyword.$2", next: "@root.$2" },
                      end: { token: "keyword.$S2", next: "@pop" },
                      "@keywords": "keyword",
                      "@builtins": "predefined",
                      "@default": "identifier",
                    },
                  },
                ],
              ],
              [
                /[a-z_]\w*[!?=]?/,
                {
                  cases: {
                    "if|unless|while|until": { token: "keyword.$0x", next: "@modifier.$0x" },
                    for: { token: "keyword.$2", next: "@dodecl.$2" },
                    "@linedecls": { token: "keyword.$0", next: "@root.$0" },
                    end: { token: "keyword.$S2", next: "@pop" },
                    "@keywords": "keyword",
                    "@builtins": "predefined",
                    "@default": "identifier",
                  },
                },
              ],
              [/[A-Z][\w]*[!?=]?/, "constructor.identifier"],
              [/\$[\w]*/, "global.constant"],
              [/@[\w]*/, "namespace.instance.identifier"],
              [/@@@[\w]*/, "namespace.class.identifier"],
              [/<<[-~](@heredelim).*/, { token: "string.heredoc.delimiter", next: "@heredoc.$1" }],
              [
                /[ \t\r\n]+<<(@heredelim).*/,
                { token: "string.heredoc.delimiter", next: "@heredoc.$1" },
              ],
              [/^<<(@heredelim).*/, { token: "string.heredoc.delimiter", next: "@heredoc.$1" }],
              { include: "@whitespace" },
              [/"/, { token: "string.d.delim", next: '@dstring.d."' }],
              [/'/, { token: "string.sq.delim", next: "@sstring.sq" }],
              [/%([rsqxwW]|Q?)/, { token: "@rematch", next: "pstring" }],
              [/`/, { token: "string.x.delim", next: "@dstring.x.`" }],
              [/:(\w|[$@])\w*[!?=]?/, "string.s"],
              [/:"/, { token: "string.s.delim", next: '@dstring.s."' }],
              [/:'/, { token: "string.s.delim", next: "@sstring.s" }],
              [/\/(?=(\\\/|[^\/\n])+\/)/, { token: "regexp.delim", next: "@regexp" }],
              [/[{}()\[\]]/, "@brackets"],
              [
                /@symbols/,
                { cases: { "@keywordops": "keyword", "@operators": "operator", "@default": "" } },
              ],
              [/[;,]/, "delimiter"],
              [/0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/, "number.hex"],
              [/0[_oO][0-7](_?[0-7])*/, "number.octal"],
              [/0[bB][01](_?[01])*/, "number.binary"],
              [/0[dD]@decpart/, "number"],
              [
                /@decimal((\.@decpart)?([eE][\-+]?@decpart)?)/,
                { cases: { $1: "number.float", "@default": "number" } },
              ],
            ],
            dodecl: [
              [/^/, { token: "", switchTo: "@root.$S2" }],
              [
                /[a-z_]\w*[!?=]?/,
                {
                  cases: {
                    end: { token: "keyword.$S2", next: "@pop" },
                    do: { token: "keyword", switchTo: "@root.$S2" },
                    "@linedecls": { token: "@rematch", switchTo: "@root.$S2" },
                    "@keywords": "keyword",
                    "@builtins": "predefined",
                    "@default": "identifier",
                  },
                },
              ],
              { include: "@root" },
            ],
            modifier: [
              [/^/, "", "@pop"],
              [
                /[a-z_]\w*[!?=]?/,
                {
                  cases: {
                    end: { token: "keyword.$S2", next: "@pop" },
                    "then|else|elsif|do": { token: "keyword", switchTo: "@root.$S2" },
                    "@linedecls": { token: "@rematch", switchTo: "@root.$S2" },
                    "@keywords": "keyword",
                    "@builtins": "predefined",
                    "@default": "identifier",
                  },
                },
              ],
              { include: "@root" },
            ],
            sstring: [
              [/[^\\']+/, "string.$S2"],
              [/\\\\|\\'|\\$/, "string.$S2.escape"],
              [/\\./, "string.$S2.invalid"],
              [/'/, { token: "string.$S2.delim", next: "@pop" }],
            ],
            dstring: [
              [/[^\\`"#]+/, "string.$S2"],
              [/#/, "string.$S2.escape", "@interpolated"],
              [/\\$/, "string.$S2.escape"],
              [/@escapes/, "string.$S2.escape"],
              [/\\./, "string.$S2.escape.invalid"],
              [
                /[`"]/,
                {
                  cases: {
                    "$#==$S3": { token: "string.$S2.delim", next: "@pop" },
                    "@default": "string.$S2",
                  },
                },
              ],
            ],
            heredoc: [
              [
                /^(\s*)(@heredelim)$/,
                {
                  cases: {
                    "$2==$S2": [
                      "string.heredoc",
                      { token: "string.heredoc.delimiter", next: "@pop" },
                    ],
                    "@default": ["string.heredoc", "string.heredoc"],
                  },
                },
              ],
              [/.*/, "string.heredoc"],
            ],
            interpolated: [
              [/\$\w*/, "global.constant", "@pop"],
              [/@\w*/, "namespace.class.identifier", "@pop"],
              [/@@@\w*/, "namespace.instance.identifier", "@pop"],
              [/[{]/, { token: "string.escape.curly", switchTo: "@interpolated_compound" }],
              ["", "", "@pop"],
            ],
            interpolated_compound: [
              [/[}]/, { token: "string.escape.curly", next: "@pop" }],
              { include: "@root" },
            ],
            pregexp: [
              { include: "@whitespace" },
              [
                /[^\(\{\[\\]/,
                {
                  cases: {
                    "$#==$S3": { token: "regexp.delim", next: "@pop" },
                    "$#==$S2": { token: "regexp.delim", next: "@push" },
                    "~[)}\\]]": "@brackets.regexp.escape.control",
                    "~@regexpctl": "regexp.escape.control",
                    "@default": "regexp",
                  },
                },
              ],
              { include: "@regexcontrol" },
            ],
            regexp: [
              { include: "@regexcontrol" },
              [/[^\\\/]/, "regexp"],
              ["/[ixmp]*", { token: "regexp.delim" }, "@pop"],
            ],
            regexcontrol: [
              [
                /(\{)(\d+(?:,\d*)?)(\})/,
                [
                  "@brackets.regexp.escape.control",
                  "regexp.escape.control",
                  "@brackets.regexp.escape.control",
                ],
              ],
              [
                /(\[)(\^?)/,
                [
                  "@brackets.regexp.escape.control",
                  { token: "regexp.escape.control", next: "@regexrange" },
                ],
              ],
              [/(\()(\?[:=!])/, ["@brackets.regexp.escape.control", "regexp.escape.control"]],
              [/\(\?#/, { token: "regexp.escape.control", next: "@regexpcomment" }],
              [/[()]/, "@brackets.regexp.escape.control"],
              [/@regexpctl/, "regexp.escape.control"],
              [/\\$/, "regexp.escape"],
              [/@regexpesc/, "regexp.escape"],
              [/\\\./, "regexp.invalid"],
              [/#/, "regexp.escape", "@interpolated"],
            ],
            regexrange: [
              [/-/, "regexp.escape.control"],
              [/\^/, "regexp.invalid"],
              [/\\$/, "regexp.escape"],
              [/@regexpesc/, "regexp.escape"],
              [/[^\]]/, "regexp"],
              [/\]/, "@brackets.regexp.escape.control", "@pop"],
            ],
            regexpcomment: [
              [/[^)]+/, "comment"],
              [/\)/, { token: "regexp.escape.control", next: "@pop" }],
            ],
            pstring: [
              [/%([qws])\(/, { token: "string.$1.delim", switchTo: "@qstring.$1.(.)" }],
              [/%([qws])\[/, { token: "string.$1.delim", switchTo: "@qstring.$1.[.]" }],
              [/%([qws])\{/, { token: "string.$1.delim", switchTo: "@qstring.$1.{.}" }],
              [/%([qws])</, { token: "string.$1.delim", switchTo: "@qstring.$1.<.>" }],
              [/%([qws])(@delim)/, { token: "string.$1.delim", switchTo: "@qstring.$1.$2.$2" }],
              [/%r\(/, { token: "regexp.delim", switchTo: "@pregexp.(.)" }],
              [/%r\[/, { token: "regexp.delim", switchTo: "@pregexp.[.]" }],
              [/%r\{/, { token: "regexp.delim", switchTo: "@pregexp.{.}" }],
              [/%r</, { token: "regexp.delim", switchTo: "@pregexp.<.>" }],
              [/%r(@delim)/, { token: "regexp.delim", switchTo: "@pregexp.$1.$1" }],
              [/%(x|W|Q?)\(/, { token: "string.$1.delim", switchTo: "@qqstring.$1.(.)" }],
              [/%(x|W|Q?)\[/, { token: "string.$1.delim", switchTo: "@qqstring.$1.[.]" }],
              [/%(x|W|Q?)\{/, { token: "string.$1.delim", switchTo: "@qqstring.$1.{.}" }],
              [/%(x|W|Q?)</, { token: "string.$1.delim", switchTo: "@qqstring.$1.<.>" }],
              [/%(x|W|Q?)(@delim)/, { token: "string.$1.delim", switchTo: "@qqstring.$1.$2.$2" }],
              [/%([rqwsxW]|Q?)./, { token: "invalid", next: "@pop" }],
              [/./, { token: "invalid", next: "@pop" }],
            ],
            qstring: [
              [/\\$/, "string.$S2.escape"],
              [/\\./, "string.$S2.escape"],
              [
                /./,
                {
                  cases: {
                    "$#==$S4": { token: "string.$S2.delim", next: "@pop" },
                    "$#==$S3": { token: "string.$S2.delim", next: "@push" },
                    "@default": "string.$S2",
                  },
                },
              ],
            ],
            qqstring: [[/#/, "string.$S2.escape", "@interpolated"], { include: "@qstring" }],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/^\s*=begin\b/, "comment", "@comment"],
              [/#.*$/, "comment"],
            ],
            comment: [
              [/[^=]+/, "comment"],
              [/^\s*=begin\b/, "comment.invalid"],
              [/^\s*=end\b.*/, "comment", "@pop"],
              [/[=]/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  l6e = {
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "[", close: "]" },
      { open: "{", close: "}" },
      { open: "(", close: ")" },
      { open: '"', close: '"', notIn: ["string"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*#pragma\\s+region\\b"),
        end: new RegExp("^\\s*#pragma\\s+endregion\\b"),
      },
    },
  },
  c6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: l6e,
        language: {
          tokenPostfix: ".rust",
          defaultToken: "invalid",
          keywords: [
            "as",
            "async",
            "await",
            "box",
            "break",
            "const",
            "continue",
            "crate",
            "dyn",
            "else",
            "enum",
            "extern",
            "false",
            "fn",
            "for",
            "if",
            "impl",
            "in",
            "let",
            "loop",
            "match",
            "mod",
            "move",
            "mut",
            "pub",
            "ref",
            "return",
            "self",
            "static",
            "struct",
            "super",
            "trait",
            "true",
            "try",
            "type",
            "unsafe",
            "use",
            "where",
            "while",
            "catch",
            "default",
            "union",
            "static",
            "abstract",
            "alignof",
            "become",
            "do",
            "final",
            "macro",
            "offsetof",
            "override",
            "priv",
            "proc",
            "pure",
            "sizeof",
            "typeof",
            "unsized",
            "virtual",
            "yield",
          ],
          typeKeywords: [
            "Self",
            "m32",
            "m64",
            "m128",
            "f80",
            "f16",
            "f128",
            "int",
            "uint",
            "float",
            "char",
            "bool",
            "u8",
            "u16",
            "u32",
            "u64",
            "f32",
            "f64",
            "i8",
            "i16",
            "i32",
            "i64",
            "str",
            "Option",
            "Either",
            "c_float",
            "c_double",
            "c_void",
            "FILE",
            "fpos_t",
            "DIR",
            "dirent",
            "c_char",
            "c_schar",
            "c_uchar",
            "c_short",
            "c_ushort",
            "c_int",
            "c_uint",
            "c_long",
            "c_ulong",
            "size_t",
            "ptrdiff_t",
            "clock_t",
            "time_t",
            "c_longlong",
            "c_ulonglong",
            "intptr_t",
            "uintptr_t",
            "off_t",
            "dev_t",
            "ino_t",
            "pid_t",
            "mode_t",
            "ssize_t",
          ],
          constants: ["true", "false", "Some", "None", "Left", "Right", "Ok", "Err"],
          supportConstants: [
            "EXIT_FAILURE",
            "EXIT_SUCCESS",
            "RAND_MAX",
            "EOF",
            "SEEK_SET",
            "SEEK_CUR",
            "SEEK_END",
            "_IOFBF",
            "_IONBF",
            "_IOLBF",
            "BUFSIZ",
            "FOPEN_MAX",
            "FILENAME_MAX",
            "L_tmpnam",
            "TMP_MAX",
            "O_RDONLY",
            "O_WRONLY",
            "O_RDWR",
            "O_APPEND",
            "O_CREAT",
            "O_EXCL",
            "O_TRUNC",
            "S_IFIFO",
            "S_IFCHR",
            "S_IFBLK",
            "S_IFDIR",
            "S_IFREG",
            "S_IFMT",
            "S_IEXEC",
            "S_IWRITE",
            "S_IREAD",
            "S_IRWXU",
            "S_IXUSR",
            "S_IWUSR",
            "S_IRUSR",
            "F_OK",
            "R_OK",
            "W_OK",
            "X_OK",
            "STDIN_FILENO",
            "STDOUT_FILENO",
            "STDERR_FILENO",
          ],
          supportMacros: [
            "format!",
            "print!",
            "println!",
            "panic!",
            "format_args!",
            "unreachable!",
            "write!",
            "writeln!",
          ],
          operators: [
            "!",
            "!=",
            "%",
            "%=",
            "&",
            "&=",
            "&&",
            "*",
            "*=",
            "+",
            "+=",
            "-",
            "-=",
            "->",
            ".",
            "..",
            "...",
            "/",
            "/=",
            ":",
            ";",
            "<<",
            "<<=",
            "<",
            "<=",
            "=",
            "==",
            "=>",
            ">",
            ">=",
            ">>",
            ">>=",
            "@",
            "^",
            "^=",
            "|",
            "|=",
            "||",
            "_",
            "?",
            "#",
          ],
          escapes: /\\([nrt0\"''\\]|x\h{2}|u\{\h{1,6}\})/,
          delimiters: /[,]/,
          symbols: /[\#\!\%\&\*\+\-\.\/\:\;\<\=\>\@\^\|_\?]+/,
          intSuffixes: /[iu](8|16|32|64|128|size)/,
          floatSuffixes: /f(32|64)/,
          tokenizer: {
            root: [
              [/r(#*)"/, { token: "string.quote", bracket: "@open", next: "@stringraw.$1" }],
              [
                /[a-zA-Z][a-zA-Z0-9_]*!?|_[a-zA-Z0-9_]+/,
                {
                  cases: {
                    "@typeKeywords": "keyword.type",
                    "@keywords": "keyword",
                    "@supportConstants": "keyword",
                    "@supportMacros": "keyword",
                    "@constants": "keyword",
                    "@default": "identifier",
                  },
                },
              ],
              [/\$/, "identifier"],
              [/'[a-zA-Z_][a-zA-Z0-9_]*(?=[^\'])/, "identifier"],
              [/'(\S|@escapes)'/, "string.byteliteral"],
              [/"/, { token: "string.quote", bracket: "@open", next: "@string" }],
              { include: "@numbers" },
              { include: "@whitespace" },
              [/@delimiters/, { cases: { "@keywords": "keyword", "@default": "delimiter" } }],
              [/[{}()\[\]<>]/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "operator", "@default": "" } }],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\/\*/, "comment", "@push"],
              ["\\*/", "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
            stringraw: [
              [/[^"#]+/, { token: "string" }],
              [
                /"(#*)/,
                {
                  cases: {
                    "$1==$S2": { token: "string.quote", bracket: "@close", next: "@pop" },
                    "@default": { token: "string" },
                  },
                },
              ],
              [/["#]/, { token: "string" }],
            ],
            numbers: [
              [/(0o[0-7_]+)(@intSuffixes)?/, { token: "number" }],
              [/(0b[0-1_]+)(@intSuffixes)?/, { token: "number" }],
              [/[\d][\d_]*(\.[\d][\d_]*)?[eE][+-][\d_]+(@floatSuffixes)?/, { token: "number" }],
              [/\b(\d\.?[\d_]*)(@floatSuffixes)?\b/, { token: "number" }],
              [/(0x[\da-fA-F]+)_?(@intSuffixes)?/, { token: "number" }],
              [/[\d][\d_]*(@intSuffixes?)?/, { token: "number" }],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  d6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "'" },
          brackets: [
            ["(", ")"],
            ["[", "]"],
            ["If", "EndIf"],
            ["While", "EndWhile"],
            ["For", "EndFor"],
            ["Sub", "EndSub"],
          ],
          autoClosingPairs: [
            { open: '"', close: '"', notIn: ["string", "comment"] },
            { open: "(", close: ")", notIn: ["string", "comment"] },
            { open: "[", close: "]", notIn: ["string", "comment"] },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".sb",
          ignoreCase: !0,
          brackets: [
            { token: "delimiter.array", open: "[", close: "]" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "keyword.tag-if", open: "If", close: "EndIf" },
            { token: "keyword.tag-while", open: "While", close: "EndWhile" },
            { token: "keyword.tag-for", open: "For", close: "EndFor" },
            { token: "keyword.tag-sub", open: "Sub", close: "EndSub" },
          ],
          keywords: [
            "Else",
            "ElseIf",
            "EndFor",
            "EndIf",
            "EndSub",
            "EndWhile",
            "For",
            "Goto",
            "If",
            "Step",
            "Sub",
            "Then",
            "To",
            "While",
          ],
          tagwords: ["If", "Sub", "While", "For"],
          operators: [">", "<", "<>", "<=", ">=", "And", "Or", "+", "-", "*", "/", "="],
          identifier: /[a-zA-Z_][\w]*/,
          symbols: /[=><:+\-*\/%\.,]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              { include: "@whitespace" },
              [/(@identifier)(?=[.])/, "type"],
              [
                /@identifier/,
                {
                  cases: {
                    "@keywords": { token: "keyword.$0" },
                    "@operators": "operator",
                    "@default": "variable.name",
                  },
                },
              ],
              [
                /([.])(@identifier)/,
                { cases: { $2: ["delimiter", "type.member"], "@default": "" } },
              ],
              [/\d*\.\d+/, "number.float"],
              [/\d+/, "number"],
              [/[()\[\]]/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "operator", "@default": "delimiter" } }],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", "@string"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/(\').*$/, "comment"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"C?/, "string", "@pop"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  u6e = {
    wordPattern:
      /(unary_[@~!#%^&*()\-=+\\|:<>\/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
        end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))"),
      },
    },
  },
  h6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: u6e,
        language: {
          tokenPostfix: ".scala",
          keywords: [
            "asInstanceOf",
            "catch",
            "class",
            "classOf",
            "def",
            "do",
            "else",
            "extends",
            "finally",
            "for",
            "foreach",
            "forSome",
            "if",
            "import",
            "isInstanceOf",
            "macro",
            "match",
            "new",
            "object",
            "package",
            "return",
            "throw",
            "trait",
            "try",
            "type",
            "until",
            "val",
            "var",
            "while",
            "with",
            "yield",
            "given",
            "enum",
            "then",
          ],
          softKeywords: ["as", "export", "extension", "end", "derives", "on"],
          constants: ["true", "false", "null", "this", "super"],
          modifiers: [
            "abstract",
            "final",
            "implicit",
            "lazy",
            "override",
            "private",
            "protected",
            "sealed",
          ],
          softModifiers: ["inline", "opaque", "open", "transparent", "using"],
          name: /(?:[a-z_$][\w$]*|`[^`]+`)/,
          type: /(?:[A-Z][\w$]*)/,
          symbols: /[=><!~?:&|+\-*\/^\\%@#]+/,
          digits: /\d+(_+\d+)*/,
          hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
          escapes: /\\(?:[btnfr\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          fstring_conv: /[bBhHsScCdoxXeEfgGaAt]|[Tn](?:[HIklMSLNpzZsQ]|[BbhAaCYyjmde]|[RTrDFC])/,
          tokenizer: {
            root: [
              [/\braw"""/, { token: "string.quote", bracket: "@open", next: "@rawstringt" }],
              [/\braw"/, { token: "string.quote", bracket: "@open", next: "@rawstring" }],
              [/\bs"""/, { token: "string.quote", bracket: "@open", next: "@sstringt" }],
              [/\bs"/, { token: "string.quote", bracket: "@open", next: "@sstring" }],
              [/\bf""""/, { token: "string.quote", bracket: "@open", next: "@fstringt" }],
              [/\bf"/, { token: "string.quote", bracket: "@open", next: "@fstring" }],
              [/"""/, { token: "string.quote", bracket: "@open", next: "@stringt" }],
              [/"/, { token: "string.quote", bracket: "@open", next: "@string" }],
              [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, "number.float", "@allowMethod"],
              [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, "number.float", "@allowMethod"],
              [/0[xX](@hexdigits)[Ll]?/, "number.hex", "@allowMethod"],
              [/(@digits)[fFdD]/, "number.float", "@allowMethod"],
              [/(@digits)[lL]?/, "number", "@allowMethod"],
              [/\b_\*/, "key"],
              [/\b(_)\b/, "keyword", "@allowMethod"],
              [/\bimport\b/, "keyword", "@import"],
              [/\b(case)([ \t]+)(class)\b/, ["keyword.modifier", "white", "keyword"]],
              [/\bcase\b/, "keyword", "@case"],
              [/\bva[lr]\b/, "keyword", "@vardef"],
              [
                /\b(def)([ \t]+)((?:unary_)?@symbols|@name(?:_=)|@name)/,
                ["keyword", "white", "identifier"],
              ],
              [/@name(?=[ \t]*:(?!:))/, "variable"],
              [/(\.)(@name|@symbols)/, ["operator", { token: "@rematch", next: "@allowMethod" }]],
              [/([{(])(\s*)(@name(?=\s*=>))/, ["@brackets", "white", "variable"]],
              [
                /@name/,
                {
                  cases: {
                    "@keywords": "keyword",
                    "@softKeywords": "keyword",
                    "@modifiers": "keyword.modifier",
                    "@softModifiers": "keyword.modifier",
                    "@constants": { token: "constant", next: "@allowMethod" },
                    "@default": { token: "identifier", next: "@allowMethod" },
                  },
                },
              ],
              [/@type/, "type", "@allowMethod"],
              { include: "@whitespace" },
              [/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/, "annotation"],
              [/[{(]/, "@brackets"],
              [/[})]/, "@brackets", "@allowMethod"],
              [/\[/, "operator.square"],
              [/](?!\s*(?:va[rl]|def|type)\b)/, "operator.square", "@allowMethod"],
              [/]/, "operator.square"],
              [/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},\."'`])/, "keyword"],
              [/@symbols/, "operator"],
              [/[;,\.]/, "delimiter"],
              [/'[a-zA-Z$][\w$]*(?!')/, "attribute.name"],
              [/'[^\\']'/, "string", "@allowMethod"],
              [
                /(')(@escapes)(')/,
                ["string", "string.escape", { token: "string", next: "@allowMethod" }],
              ],
              [/'/, "string.invalid"],
            ],
            import: [
              [/;/, "delimiter", "@pop"],
              [/^|$/, "", "@pop"],
              [/[ \t]+/, "white"],
              [/[\n\r]+/, "white", "@pop"],
              [/\/\*/, "comment", "@comment"],
              [/@name|@type/, "type"],
              [/[(){}]/, "@brackets"],
              [/[[\]]/, "operator.square"],
              [/[\.,]/, "delimiter"],
            ],
            allowMethod: [
              [/^|$/, "", "@pop"],
              [/[ \t]+/, "white"],
              [/[\n\r]+/, "white", "@pop"],
              [/\/\*/, "comment", "@comment"],
              [/(?==>[\s\w([{])/, "keyword", "@pop"],
              [
                /(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,
                {
                  cases: {
                    "@keywords": { token: "keyword", next: "@pop" },
                    "->|<-|>:|<:|<%": { token: "keyword", next: "@pop" },
                    "@default": { token: "@rematch", next: "@pop" },
                  },
                },
              ],
              ["", "", "@pop"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\/\*/, "comment", "@push"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            case: [
              [/\b_\*/, "key"],
              [/\b(_|true|false|null|this|super)\b/, "keyword", "@allowMethod"],
              [/\bif\b|=>/, "keyword", "@pop"],
              [/`[^`]+`/, "identifier", "@allowMethod"],
              [/@name/, "variable", "@allowMethod"],
              [/:::?|\||@(?![a-z_$])/, "keyword"],
              { include: "@root" },
            ],
            vardef: [
              [/\b_\*/, "key"],
              [/\b(_|true|false|null|this|super)\b/, "keyword"],
              [/@name/, "variable"],
              [/:::?|\||@(?![a-z_$])/, "keyword"],
              [/=|:(?!:)/, "operator", "@pop"],
              [/$/, "white", "@pop"],
              { include: "@root" },
            ],
            string: [
              [/[^\\"\n\r]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, { token: "string.quote", bracket: "@close", switchTo: "@allowMethod" }],
            ],
            stringt: [
              [/[^\\"\n\r]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"(?=""")/, "string"],
              [/"""/, { token: "string.quote", bracket: "@close", switchTo: "@allowMethod" }],
              [/"/, "string"],
            ],
            fstring: [
              [/@escapes/, "string.escape"],
              [/"/, { token: "string.quote", bracket: "@close", switchTo: "@allowMethod" }],
              [/\$\$/, "string"],
              [/(\$)([a-z_]\w*)/, ["operator", "identifier"]],
              [/\$\{/, "operator", "@interp"],
              [/%%/, "string"],
              [
                /(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,
                ["metatag", "keyword.modifier", "number", "metatag"],
              ],
              [/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ["metatag", "number", "metatag"]],
              [/(%)([\-#+ 0,(])(@fstring_conv)/, ["metatag", "keyword.modifier", "metatag"]],
              [/(%)(@fstring_conv)/, ["metatag", "metatag"]],
              [/./, "string"],
            ],
            fstringt: [
              [/@escapes/, "string.escape"],
              [/"(?=""")/, "string"],
              [/"""/, { token: "string.quote", bracket: "@close", switchTo: "@allowMethod" }],
              [/\$\$/, "string"],
              [/(\$)([a-z_]\w*)/, ["operator", "identifier"]],
              [/\$\{/, "operator", "@interp"],
              [/%%/, "string"],
              [
                /(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,
                ["metatag", "keyword.modifier", "number", "metatag"],
              ],
              [/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ["metatag", "number", "metatag"]],
              [/(%)([\-#+ 0,(])(@fstring_conv)/, ["metatag", "keyword.modifier", "metatag"]],
              [/(%)(@fstring_conv)/, ["metatag", "metatag"]],
              [/./, "string"],
            ],
            sstring: [
              [/@escapes/, "string.escape"],
              [/"/, { token: "string.quote", bracket: "@close", switchTo: "@allowMethod" }],
              [/\$\$/, "string"],
              [/(\$)([a-z_]\w*)/, ["operator", "identifier"]],
              [/\$\{/, "operator", "@interp"],
              [/./, "string"],
            ],
            sstringt: [
              [/@escapes/, "string.escape"],
              [/"(?=""")/, "string"],
              [/"""/, { token: "string.quote", bracket: "@close", switchTo: "@allowMethod" }],
              [/\$\$/, "string"],
              [/(\$)([a-z_]\w*)/, ["operator", "identifier"]],
              [/\$\{/, "operator", "@interp"],
              [/./, "string"],
            ],
            interp: [[/{/, "operator", "@push"], [/}/, "operator", "@pop"], { include: "@root" }],
            rawstring: [
              [/[^"]/, "string"],
              [/"/, { token: "string.quote", bracket: "@close", switchTo: "@allowMethod" }],
            ],
            rawstringt: [
              [/[^"]/, "string"],
              [/"(?=""")/, "string"],
              [/"""/, { token: "string.quote", bracket: "@close", switchTo: "@allowMethod" }],
              [/"/, "string"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  g6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: ";", blockComment: ["#|", "|#"] },
          brackets: [
            ["(", ")"],
            ["{", "}"],
            ["[", "]"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
          ],
        },
        language: {
          defaultToken: "",
          ignoreCase: !0,
          tokenPostfix: ".scheme",
          brackets: [
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
          ],
          keywords: [
            "case",
            "do",
            "let",
            "loop",
            "if",
            "else",
            "when",
            "cons",
            "car",
            "cdr",
            "cond",
            "lambda",
            "lambda*",
            "syntax-rules",
            "format",
            "set!",
            "quote",
            "eval",
            "append",
            "list",
            "list?",
            "member?",
            "load",
          ],
          constants: ["#t", "#f"],
          operators: ["eq?", "eqv?", "equal?", "and", "or", "not", "null?"],
          tokenizer: {
            root: [
              [/#[xXoObB][0-9a-fA-F]+/, "number.hex"],
              [/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?/, "number.float"],
              [
                /(?:\b(?:(define|define-syntax|define-macro))\b)(\s+)((?:\w|\-|\!|\?)*)/,
                ["keyword", "white", "variable"],
              ],
              { include: "@whitespace" },
              { include: "@strings" },
              [
                /[a-zA-Z_#][a-zA-Z0-9_\-\?\!\*]*/,
                {
                  cases: {
                    "@keywords": "keyword",
                    "@constants": "constant",
                    "@operators": "operators",
                    "@default": "identifier",
                  },
                },
              ],
            ],
            comment: [
              [/[^\|#]+/, "comment"],
              [/#\|/, "comment", "@push"],
              [/\|#/, "comment", "@pop"],
              [/[\|#]/, "comment"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/#\|/, "comment", "@comment"],
              [/;.*$/, "comment"],
            ],
            strings: [
              [/"$/, "string", "@popall"],
              [/"(?=.)/, "string", "@multiLineString"],
            ],
            multiLineString: [
              [/[^\\"]+$/, "string", "@popall"],
              [/[^\\"]+/, "string"],
              [/\\./, "string.escape"],
              [/"/, "string", "@popall"],
              [/\\$/, "string"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  p6e = {
    wordPattern: /(#?-?\d*\.\d\w*%?)|([@$#!.:]?[\w-?]+%?)|[@#!.]/g,
    comments: { blockComment: ["/*", "*/"], lineComment: "//" },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}", notIn: ["string", "comment"] },
      { open: "[", close: "]", notIn: ["string", "comment"] },
      { open: "(", close: ")", notIn: ["string", "comment"] },
      { open: '"', close: '"', notIn: ["string", "comment"] },
      { open: "'", close: "'", notIn: ["string", "comment"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
        end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/"),
      },
    },
  },
  f6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: p6e,
        language: {
          defaultToken: "",
          tokenPostfix: ".scss",
          ws: "[ \t\n\r\f]*",
          identifier:
            "-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",
          brackets: [
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.bracket" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "<", close: ">", token: "delimiter.angle" },
          ],
          tokenizer: {
            root: [{ include: "@selector" }],
            selector: [
              { include: "@comments" },
              { include: "@import" },
              { include: "@variabledeclaration" },
              { include: "@warndebug" },
              ["[@](include)", { token: "keyword", next: "@includedeclaration" }],
              [
                "[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",
                { token: "keyword", next: "@keyframedeclaration" },
              ],
              ["[@](page|content|font-face|-moz-document)", { token: "keyword" }],
              ["[@](charset|namespace)", { token: "keyword", next: "@declarationbody" }],
              ["[@](function)", { token: "keyword", next: "@functiondeclaration" }],
              ["[@](mixin)", { token: "keyword", next: "@mixindeclaration" }],
              ["url(\\-prefix)?\\(", { token: "meta", next: "@urldeclaration" }],
              { include: "@controlstatement" },
              { include: "@selectorname" },
              ["[&\\*]", "tag"],
              ["[>\\+,]", "delimiter"],
              ["\\[", { token: "delimiter.bracket", next: "@selectorattribute" }],
              ["{", { token: "delimiter.curly", next: "@selectorbody" }],
            ],
            selectorbody: [
              ["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))", "attribute.name", "@rulevalue"],
              { include: "@selector" },
              ["[@](extend)", { token: "keyword", next: "@extendbody" }],
              ["[@](return)", { token: "keyword", next: "@declarationbody" }],
              ["}", { token: "delimiter.curly", next: "@pop" }],
            ],
            selectorname: [
              ["#{", { token: "meta", next: "@variableinterpolation" }],
              ["(\\.|#(?=[^{])|%|(@identifier)|:)+", "tag"],
            ],
            selectorattribute: [
              { include: "@term" },
              ["]", { token: "delimiter.bracket", next: "@pop" }],
            ],
            term: [
              { include: "@comments" },
              ["url(\\-prefix)?\\(", { token: "meta", next: "@urldeclaration" }],
              { include: "@functioninvocation" },
              { include: "@numbers" },
              { include: "@strings" },
              { include: "@variablereference" },
              ["(and\\b|or\\b|not\\b)", "operator"],
              { include: "@name" },
              ["([<>=\\+\\-\\*\\/\\^\\|\\~,])", "operator"],
              [",", "delimiter"],
              ["!default", "literal"],
              ["\\(", { token: "delimiter.parenthesis", next: "@parenthizedterm" }],
            ],
            rulevalue: [
              { include: "@term" },
              ["!important", "literal"],
              [";", "delimiter", "@pop"],
              ["{", { token: "delimiter.curly", switchTo: "@nestedproperty" }],
              ["(?=})", { token: "", next: "@pop" }],
            ],
            nestedproperty: [
              ["[*_]?@identifier@ws:", "attribute.name", "@rulevalue"],
              { include: "@comments" },
              ["}", { token: "delimiter.curly", next: "@pop" }],
            ],
            warndebug: [["[@](warn|debug)", { token: "keyword", next: "@declarationbody" }]],
            import: [["[@](import)", { token: "keyword", next: "@declarationbody" }]],
            variabledeclaration: [["\\$@identifier@ws:", "variable.decl", "@declarationbody"]],
            urldeclaration: [
              { include: "@strings" },
              ["[^)\r\n]+", "string"],
              ["\\)", { token: "meta", next: "@pop" }],
            ],
            parenthizedterm: [
              { include: "@term" },
              ["\\)", { token: "delimiter.parenthesis", next: "@pop" }],
            ],
            declarationbody: [
              { include: "@term" },
              [";", "delimiter", "@pop"],
              ["(?=})", { token: "", next: "@pop" }],
            ],
            extendbody: [
              { include: "@selectorname" },
              ["!optional", "literal"],
              [";", "delimiter", "@pop"],
              ["(?=})", { token: "", next: "@pop" }],
            ],
            variablereference: [
              ["\\$@identifier", "variable.ref"],
              ["\\.\\.\\.", "operator"],
              ["#{", { token: "meta", next: "@variableinterpolation" }],
            ],
            variableinterpolation: [
              { include: "@variablereference" },
              ["}", { token: "meta", next: "@pop" }],
            ],
            comments: [
              ["\\/\\*", "comment", "@comment"],
              ["\\/\\/+.*", "comment"],
            ],
            comment: [
              ["\\*\\/", "comment", "@pop"],
              [".", "comment"],
            ],
            name: [["@identifier", "attribute.value"]],
            numbers: [
              ["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?", { token: "number", next: "@units" }],
              ["#[0-9a-fA-F_]+(?!\\w)", "number.hex"],
            ],
            units: [
              [
                "(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?",
                "number",
                "@pop",
              ],
            ],
            functiondeclaration: [
              ["@identifier@ws\\(", { token: "meta", next: "@parameterdeclaration" }],
              ["{", { token: "delimiter.curly", switchTo: "@functionbody" }],
            ],
            mixindeclaration: [
              ["@identifier@ws\\(", { token: "meta", next: "@parameterdeclaration" }],
              ["@identifier", "meta"],
              ["{", { token: "delimiter.curly", switchTo: "@selectorbody" }],
            ],
            parameterdeclaration: [
              ["\\$@identifier@ws:", "variable.decl"],
              ["\\.\\.\\.", "operator"],
              [",", "delimiter"],
              { include: "@term" },
              ["\\)", { token: "meta", next: "@pop" }],
            ],
            includedeclaration: [
              { include: "@functioninvocation" },
              ["@identifier", "meta"],
              [";", "delimiter", "@pop"],
              ["(?=})", { token: "", next: "@pop" }],
              ["{", { token: "delimiter.curly", switchTo: "@selectorbody" }],
            ],
            keyframedeclaration: [
              ["@identifier", "meta"],
              ["{", { token: "delimiter.curly", switchTo: "@keyframebody" }],
            ],
            keyframebody: [
              { include: "@term" },
              ["{", { token: "delimiter.curly", next: "@selectorbody" }],
              ["}", { token: "delimiter.curly", next: "@pop" }],
            ],
            controlstatement: [
              [
                "[@](if|else|for|while|each|media)",
                { token: "keyword.flow", next: "@controlstatementdeclaration" },
              ],
            ],
            controlstatementdeclaration: [
              ["(in|from|through|if|to)\\b", { token: "keyword.flow" }],
              { include: "@term" },
              ["{", { token: "delimiter.curly", switchTo: "@selectorbody" }],
            ],
            functionbody: [
              ["[@](return)", { token: "keyword" }],
              { include: "@variabledeclaration" },
              { include: "@term" },
              { include: "@controlstatement" },
              [";", "delimiter"],
              ["}", { token: "delimiter.curly", next: "@pop" }],
            ],
            functioninvocation: [["@identifier\\(", { token: "meta", next: "@functionarguments" }]],
            functionarguments: [
              ["\\$@identifier@ws:", "attribute.name"],
              ["[,]", "delimiter"],
              { include: "@term" },
              ["\\)", { token: "meta", next: "@pop" }],
            ],
            strings: [
              ['~?"', { token: "string.delimiter", next: "@stringenddoublequote" }],
              ["~?'", { token: "string.delimiter", next: "@stringendquote" }],
            ],
            stringenddoublequote: [
              ["\\\\.", "string"],
              ['"', { token: "string.delimiter", next: "@pop" }],
              [".", "string"],
            ],
            stringendquote: [
              ["\\\\.", "string"],
              ["'", { token: "string.delimiter", next: "@pop" }],
              [".", "string"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  m6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "#" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "`", close: "`" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "`", close: "`" },
          ],
        },
        language: {
          defaultToken: "",
          ignoreCase: !0,
          tokenPostfix: ".shell",
          brackets: [
            { token: "delimiter.bracket", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
          ],
          keywords: [
            "if",
            "then",
            "do",
            "else",
            "elif",
            "while",
            "until",
            "for",
            "in",
            "esac",
            "fi",
            "fin",
            "fil",
            "done",
            "exit",
            "set",
            "unset",
            "export",
            "function",
          ],
          builtins: [
            "ab",
            "awk",
            "bash",
            "beep",
            "cat",
            "cc",
            "cd",
            "chown",
            "chmod",
            "chroot",
            "clear",
            "cp",
            "curl",
            "cut",
            "diff",
            "echo",
            "find",
            "gawk",
            "gcc",
            "get",
            "git",
            "grep",
            "hg",
            "kill",
            "killall",
            "ln",
            "ls",
            "make",
            "mkdir",
            "openssl",
            "mv",
            "nc",
            "node",
            "npm",
            "ping",
            "ps",
            "restart",
            "rm",
            "rmdir",
            "sed",
            "service",
            "sh",
            "shopt",
            "shred",
            "source",
            "sort",
            "sleep",
            "ssh",
            "start",
            "stop",
            "su",
            "sudo",
            "svn",
            "tee",
            "telnet",
            "top",
            "touch",
            "vi",
            "vim",
            "wall",
            "wc",
            "wget",
            "who",
            "write",
            "yes",
            "zsh",
          ],
          startingWithDash: /\-+\w+/,
          identifiersWithDashes: /[a-zA-Z]\w+(?:@startingWithDash)+/,
          symbols: /[=><!~?&|+\-*\/\^;\.,]+/,
          tokenizer: {
            root: [
              [/@identifiersWithDashes/, ""],
              [/(\s)((?:@startingWithDash)+)/, ["white", "attribute.name"]],
              [
                /[a-zA-Z]\w*/,
                {
                  cases: { "@keywords": "keyword", "@builtins": "type.identifier", "@default": "" },
                },
              ],
              { include: "@whitespace" },
              { include: "@strings" },
              { include: "@parameters" },
              { include: "@heredoc" },
              [/[{}\[\]()]/, "@brackets"],
              [/@symbols/, "delimiter"],
              { include: "@numbers" },
              [/[,;]/, "delimiter"],
            ],
            whitespace: [
              [/\s+/, "white"],
              [/(^#!.*$)/, "metatag"],
              [/(^#.*$)/, "comment"],
            ],
            numbers: [
              [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
              [/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/, "number.hex"],
              [/\d+/, "number"],
            ],
            strings: [
              [/'/, "string", "@stringBody"],
              [/"/, "string", "@dblStringBody"],
            ],
            stringBody: [
              [/'/, "string", "@popall"],
              [/./, "string"],
            ],
            dblStringBody: [
              [/"/, "string", "@popall"],
              [/./, "string"],
            ],
            heredoc: [
              [
                /(<<[-<]?)(\s*)(['"`]?)([\w\-]+)(['"`]?)/,
                [
                  "constants",
                  "white",
                  "string.heredoc.delimiter",
                  "string.heredoc",
                  "string.heredoc.delimiter",
                ],
              ],
            ],
            parameters: [
              [/\$\d+/, "variable.predefined"],
              [/\$\w+/, "variable"],
              [/\$[*@#?\-$!0_]/, "variable"],
              [/\$'/, "variable", "@parameterBodyQuote"],
              [/\$"/, "variable", "@parameterBodyDoubleQuote"],
              [/\$\(/, "variable", "@parameterBodyParen"],
              [/\$\{/, "variable", "@parameterBodyCurlyBrace"],
            ],
            parameterBodyQuote: [
              [/[^#:%*@\-!_']+/, "variable"],
              [/[#:%*@\-!_]/, "delimiter"],
              [/[']/, "variable", "@pop"],
            ],
            parameterBodyDoubleQuote: [
              [/[^#:%*@\-!_"]+/, "variable"],
              [/[#:%*@\-!_]/, "delimiter"],
              [/["]/, "variable", "@pop"],
            ],
            parameterBodyParen: [
              [/[^#:%*@\-!_)]+/, "variable"],
              [/[#:%*@\-!_]/, "delimiter"],
              [/[)]/, "variable", "@pop"],
            ],
            parameterBodyCurlyBrace: [
              [/[^#:%*@\-!_}]+/, "variable"],
              [/[#:%*@\-!_]/, "delimiter"],
              [/[}]/, "variable", "@pop"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  _6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
            ["<", ">"],
          ],
          autoClosingPairs: [
            { open: '"', close: '"', notIn: ["string", "comment"] },
            { open: "{", close: "}", notIn: ["string", "comment"] },
            { open: "[", close: "]", notIn: ["string", "comment"] },
            { open: "(", close: ")", notIn: ["string", "comment"] },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".sol",
          brackets: [
            { token: "delimiter.curly", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
            { token: "delimiter.angle", open: "<", close: ">" },
          ],
          keywords: [
            "pragma",
            "solidity",
            "contract",
            "library",
            "using",
            "struct",
            "function",
            "modifier",
            "constructor",
            "address",
            "string",
            "bool",
            "Int",
            "Uint",
            "Byte",
            "Fixed",
            "Ufixed",
            "int",
            "int8",
            "int16",
            "int24",
            "int32",
            "int40",
            "int48",
            "int56",
            "int64",
            "int72",
            "int80",
            "int88",
            "int96",
            "int104",
            "int112",
            "int120",
            "int128",
            "int136",
            "int144",
            "int152",
            "int160",
            "int168",
            "int176",
            "int184",
            "int192",
            "int200",
            "int208",
            "int216",
            "int224",
            "int232",
            "int240",
            "int248",
            "int256",
            "uint",
            "uint8",
            "uint16",
            "uint24",
            "uint32",
            "uint40",
            "uint48",
            "uint56",
            "uint64",
            "uint72",
            "uint80",
            "uint88",
            "uint96",
            "uint104",
            "uint112",
            "uint120",
            "uint128",
            "uint136",
            "uint144",
            "uint152",
            "uint160",
            "uint168",
            "uint176",
            "uint184",
            "uint192",
            "uint200",
            "uint208",
            "uint216",
            "uint224",
            "uint232",
            "uint240",
            "uint248",
            "uint256",
            "byte",
            "bytes",
            "bytes1",
            "bytes2",
            "bytes3",
            "bytes4",
            "bytes5",
            "bytes6",
            "bytes7",
            "bytes8",
            "bytes9",
            "bytes10",
            "bytes11",
            "bytes12",
            "bytes13",
            "bytes14",
            "bytes15",
            "bytes16",
            "bytes17",
            "bytes18",
            "bytes19",
            "bytes20",
            "bytes21",
            "bytes22",
            "bytes23",
            "bytes24",
            "bytes25",
            "bytes26",
            "bytes27",
            "bytes28",
            "bytes29",
            "bytes30",
            "bytes31",
            "bytes32",
            "fixed",
            "fixed0x8",
            "fixed0x16",
            "fixed0x24",
            "fixed0x32",
            "fixed0x40",
            "fixed0x48",
            "fixed0x56",
            "fixed0x64",
            "fixed0x72",
            "fixed0x80",
            "fixed0x88",
            "fixed0x96",
            "fixed0x104",
            "fixed0x112",
            "fixed0x120",
            "fixed0x128",
            "fixed0x136",
            "fixed0x144",
            "fixed0x152",
            "fixed0x160",
            "fixed0x168",
            "fixed0x176",
            "fixed0x184",
            "fixed0x192",
            "fixed0x200",
            "fixed0x208",
            "fixed0x216",
            "fixed0x224",
            "fixed0x232",
            "fixed0x240",
            "fixed0x248",
            "fixed0x256",
            "fixed8x8",
            "fixed8x16",
            "fixed8x24",
            "fixed8x32",
            "fixed8x40",
            "fixed8x48",
            "fixed8x56",
            "fixed8x64",
            "fixed8x72",
            "fixed8x80",
            "fixed8x88",
            "fixed8x96",
            "fixed8x104",
            "fixed8x112",
            "fixed8x120",
            "fixed8x128",
            "fixed8x136",
            "fixed8x144",
            "fixed8x152",
            "fixed8x160",
            "fixed8x168",
            "fixed8x176",
            "fixed8x184",
            "fixed8x192",
            "fixed8x200",
            "fixed8x208",
            "fixed8x216",
            "fixed8x224",
            "fixed8x232",
            "fixed8x240",
            "fixed8x248",
            "fixed16x8",
            "fixed16x16",
            "fixed16x24",
            "fixed16x32",
            "fixed16x40",
            "fixed16x48",
            "fixed16x56",
            "fixed16x64",
            "fixed16x72",
            "fixed16x80",
            "fixed16x88",
            "fixed16x96",
            "fixed16x104",
            "fixed16x112",
            "fixed16x120",
            "fixed16x128",
            "fixed16x136",
            "fixed16x144",
            "fixed16x152",
            "fixed16x160",
            "fixed16x168",
            "fixed16x176",
            "fixed16x184",
            "fixed16x192",
            "fixed16x200",
            "fixed16x208",
            "fixed16x216",
            "fixed16x224",
            "fixed16x232",
            "fixed16x240",
            "fixed24x8",
            "fixed24x16",
            "fixed24x24",
            "fixed24x32",
            "fixed24x40",
            "fixed24x48",
            "fixed24x56",
            "fixed24x64",
            "fixed24x72",
            "fixed24x80",
            "fixed24x88",
            "fixed24x96",
            "fixed24x104",
            "fixed24x112",
            "fixed24x120",
            "fixed24x128",
            "fixed24x136",
            "fixed24x144",
            "fixed24x152",
            "fixed24x160",
            "fixed24x168",
            "fixed24x176",
            "fixed24x184",
            "fixed24x192",
            "fixed24x200",
            "fixed24x208",
            "fixed24x216",
            "fixed24x224",
            "fixed24x232",
            "fixed32x8",
            "fixed32x16",
            "fixed32x24",
            "fixed32x32",
            "fixed32x40",
            "fixed32x48",
            "fixed32x56",
            "fixed32x64",
            "fixed32x72",
            "fixed32x80",
            "fixed32x88",
            "fixed32x96",
            "fixed32x104",
            "fixed32x112",
            "fixed32x120",
            "fixed32x128",
            "fixed32x136",
            "fixed32x144",
            "fixed32x152",
            "fixed32x160",
            "fixed32x168",
            "fixed32x176",
            "fixed32x184",
            "fixed32x192",
            "fixed32x200",
            "fixed32x208",
            "fixed32x216",
            "fixed32x224",
            "fixed40x8",
            "fixed40x16",
            "fixed40x24",
            "fixed40x32",
            "fixed40x40",
            "fixed40x48",
            "fixed40x56",
            "fixed40x64",
            "fixed40x72",
            "fixed40x80",
            "fixed40x88",
            "fixed40x96",
            "fixed40x104",
            "fixed40x112",
            "fixed40x120",
            "fixed40x128",
            "fixed40x136",
            "fixed40x144",
            "fixed40x152",
            "fixed40x160",
            "fixed40x168",
            "fixed40x176",
            "fixed40x184",
            "fixed40x192",
            "fixed40x200",
            "fixed40x208",
            "fixed40x216",
            "fixed48x8",
            "fixed48x16",
            "fixed48x24",
            "fixed48x32",
            "fixed48x40",
            "fixed48x48",
            "fixed48x56",
            "fixed48x64",
            "fixed48x72",
            "fixed48x80",
            "fixed48x88",
            "fixed48x96",
            "fixed48x104",
            "fixed48x112",
            "fixed48x120",
            "fixed48x128",
            "fixed48x136",
            "fixed48x144",
            "fixed48x152",
            "fixed48x160",
            "fixed48x168",
            "fixed48x176",
            "fixed48x184",
            "fixed48x192",
            "fixed48x200",
            "fixed48x208",
            "fixed56x8",
            "fixed56x16",
            "fixed56x24",
            "fixed56x32",
            "fixed56x40",
            "fixed56x48",
            "fixed56x56",
            "fixed56x64",
            "fixed56x72",
            "fixed56x80",
            "fixed56x88",
            "fixed56x96",
            "fixed56x104",
            "fixed56x112",
            "fixed56x120",
            "fixed56x128",
            "fixed56x136",
            "fixed56x144",
            "fixed56x152",
            "fixed56x160",
            "fixed56x168",
            "fixed56x176",
            "fixed56x184",
            "fixed56x192",
            "fixed56x200",
            "fixed64x8",
            "fixed64x16",
            "fixed64x24",
            "fixed64x32",
            "fixed64x40",
            "fixed64x48",
            "fixed64x56",
            "fixed64x64",
            "fixed64x72",
            "fixed64x80",
            "fixed64x88",
            "fixed64x96",
            "fixed64x104",
            "fixed64x112",
            "fixed64x120",
            "fixed64x128",
            "fixed64x136",
            "fixed64x144",
            "fixed64x152",
            "fixed64x160",
            "fixed64x168",
            "fixed64x176",
            "fixed64x184",
            "fixed64x192",
            "fixed72x8",
            "fixed72x16",
            "fixed72x24",
            "fixed72x32",
            "fixed72x40",
            "fixed72x48",
            "fixed72x56",
            "fixed72x64",
            "fixed72x72",
            "fixed72x80",
            "fixed72x88",
            "fixed72x96",
            "fixed72x104",
            "fixed72x112",
            "fixed72x120",
            "fixed72x128",
            "fixed72x136",
            "fixed72x144",
            "fixed72x152",
            "fixed72x160",
            "fixed72x168",
            "fixed72x176",
            "fixed72x184",
            "fixed80x8",
            "fixed80x16",
            "fixed80x24",
            "fixed80x32",
            "fixed80x40",
            "fixed80x48",
            "fixed80x56",
            "fixed80x64",
            "fixed80x72",
            "fixed80x80",
            "fixed80x88",
            "fixed80x96",
            "fixed80x104",
            "fixed80x112",
            "fixed80x120",
            "fixed80x128",
            "fixed80x136",
            "fixed80x144",
            "fixed80x152",
            "fixed80x160",
            "fixed80x168",
            "fixed80x176",
            "fixed88x8",
            "fixed88x16",
            "fixed88x24",
            "fixed88x32",
            "fixed88x40",
            "fixed88x48",
            "fixed88x56",
            "fixed88x64",
            "fixed88x72",
            "fixed88x80",
            "fixed88x88",
            "fixed88x96",
            "fixed88x104",
            "fixed88x112",
            "fixed88x120",
            "fixed88x128",
            "fixed88x136",
            "fixed88x144",
            "fixed88x152",
            "fixed88x160",
            "fixed88x168",
            "fixed96x8",
            "fixed96x16",
            "fixed96x24",
            "fixed96x32",
            "fixed96x40",
            "fixed96x48",
            "fixed96x56",
            "fixed96x64",
            "fixed96x72",
            "fixed96x80",
            "fixed96x88",
            "fixed96x96",
            "fixed96x104",
            "fixed96x112",
            "fixed96x120",
            "fixed96x128",
            "fixed96x136",
            "fixed96x144",
            "fixed96x152",
            "fixed96x160",
            "fixed104x8",
            "fixed104x16",
            "fixed104x24",
            "fixed104x32",
            "fixed104x40",
            "fixed104x48",
            "fixed104x56",
            "fixed104x64",
            "fixed104x72",
            "fixed104x80",
            "fixed104x88",
            "fixed104x96",
            "fixed104x104",
            "fixed104x112",
            "fixed104x120",
            "fixed104x128",
            "fixed104x136",
            "fixed104x144",
            "fixed104x152",
            "fixed112x8",
            "fixed112x16",
            "fixed112x24",
            "fixed112x32",
            "fixed112x40",
            "fixed112x48",
            "fixed112x56",
            "fixed112x64",
            "fixed112x72",
            "fixed112x80",
            "fixed112x88",
            "fixed112x96",
            "fixed112x104",
            "fixed112x112",
            "fixed112x120",
            "fixed112x128",
            "fixed112x136",
            "fixed112x144",
            "fixed120x8",
            "fixed120x16",
            "fixed120x24",
            "fixed120x32",
            "fixed120x40",
            "fixed120x48",
            "fixed120x56",
            "fixed120x64",
            "fixed120x72",
            "fixed120x80",
            "fixed120x88",
            "fixed120x96",
            "fixed120x104",
            "fixed120x112",
            "fixed120x120",
            "fixed120x128",
            "fixed120x136",
            "fixed128x8",
            "fixed128x16",
            "fixed128x24",
            "fixed128x32",
            "fixed128x40",
            "fixed128x48",
            "fixed128x56",
            "fixed128x64",
            "fixed128x72",
            "fixed128x80",
            "fixed128x88",
            "fixed128x96",
            "fixed128x104",
            "fixed128x112",
            "fixed128x120",
            "fixed128x128",
            "fixed136x8",
            "fixed136x16",
            "fixed136x24",
            "fixed136x32",
            "fixed136x40",
            "fixed136x48",
            "fixed136x56",
            "fixed136x64",
            "fixed136x72",
            "fixed136x80",
            "fixed136x88",
            "fixed136x96",
            "fixed136x104",
            "fixed136x112",
            "fixed136x120",
            "fixed144x8",
            "fixed144x16",
            "fixed144x24",
            "fixed144x32",
            "fixed144x40",
            "fixed144x48",
            "fixed144x56",
            "fixed144x64",
            "fixed144x72",
            "fixed144x80",
            "fixed144x88",
            "fixed144x96",
            "fixed144x104",
            "fixed144x112",
            "fixed152x8",
            "fixed152x16",
            "fixed152x24",
            "fixed152x32",
            "fixed152x40",
            "fixed152x48",
            "fixed152x56",
            "fixed152x64",
            "fixed152x72",
            "fixed152x80",
            "fixed152x88",
            "fixed152x96",
            "fixed152x104",
            "fixed160x8",
            "fixed160x16",
            "fixed160x24",
            "fixed160x32",
            "fixed160x40",
            "fixed160x48",
            "fixed160x56",
            "fixed160x64",
            "fixed160x72",
            "fixed160x80",
            "fixed160x88",
            "fixed160x96",
            "fixed168x8",
            "fixed168x16",
            "fixed168x24",
            "fixed168x32",
            "fixed168x40",
            "fixed168x48",
            "fixed168x56",
            "fixed168x64",
            "fixed168x72",
            "fixed168x80",
            "fixed168x88",
            "fixed176x8",
            "fixed176x16",
            "fixed176x24",
            "fixed176x32",
            "fixed176x40",
            "fixed176x48",
            "fixed176x56",
            "fixed176x64",
            "fixed176x72",
            "fixed176x80",
            "fixed184x8",
            "fixed184x16",
            "fixed184x24",
            "fixed184x32",
            "fixed184x40",
            "fixed184x48",
            "fixed184x56",
            "fixed184x64",
            "fixed184x72",
            "fixed192x8",
            "fixed192x16",
            "fixed192x24",
            "fixed192x32",
            "fixed192x40",
            "fixed192x48",
            "fixed192x56",
            "fixed192x64",
            "fixed200x8",
            "fixed200x16",
            "fixed200x24",
            "fixed200x32",
            "fixed200x40",
            "fixed200x48",
            "fixed200x56",
            "fixed208x8",
            "fixed208x16",
            "fixed208x24",
            "fixed208x32",
            "fixed208x40",
            "fixed208x48",
            "fixed216x8",
            "fixed216x16",
            "fixed216x24",
            "fixed216x32",
            "fixed216x40",
            "fixed224x8",
            "fixed224x16",
            "fixed224x24",
            "fixed224x32",
            "fixed232x8",
            "fixed232x16",
            "fixed232x24",
            "fixed240x8",
            "fixed240x16",
            "fixed248x8",
            "ufixed",
            "ufixed0x8",
            "ufixed0x16",
            "ufixed0x24",
            "ufixed0x32",
            "ufixed0x40",
            "ufixed0x48",
            "ufixed0x56",
            "ufixed0x64",
            "ufixed0x72",
            "ufixed0x80",
            "ufixed0x88",
            "ufixed0x96",
            "ufixed0x104",
            "ufixed0x112",
            "ufixed0x120",
            "ufixed0x128",
            "ufixed0x136",
            "ufixed0x144",
            "ufixed0x152",
            "ufixed0x160",
            "ufixed0x168",
            "ufixed0x176",
            "ufixed0x184",
            "ufixed0x192",
            "ufixed0x200",
            "ufixed0x208",
            "ufixed0x216",
            "ufixed0x224",
            "ufixed0x232",
            "ufixed0x240",
            "ufixed0x248",
            "ufixed0x256",
            "ufixed8x8",
            "ufixed8x16",
            "ufixed8x24",
            "ufixed8x32",
            "ufixed8x40",
            "ufixed8x48",
            "ufixed8x56",
            "ufixed8x64",
            "ufixed8x72",
            "ufixed8x80",
            "ufixed8x88",
            "ufixed8x96",
            "ufixed8x104",
            "ufixed8x112",
            "ufixed8x120",
            "ufixed8x128",
            "ufixed8x136",
            "ufixed8x144",
            "ufixed8x152",
            "ufixed8x160",
            "ufixed8x168",
            "ufixed8x176",
            "ufixed8x184",
            "ufixed8x192",
            "ufixed8x200",
            "ufixed8x208",
            "ufixed8x216",
            "ufixed8x224",
            "ufixed8x232",
            "ufixed8x240",
            "ufixed8x248",
            "ufixed16x8",
            "ufixed16x16",
            "ufixed16x24",
            "ufixed16x32",
            "ufixed16x40",
            "ufixed16x48",
            "ufixed16x56",
            "ufixed16x64",
            "ufixed16x72",
            "ufixed16x80",
            "ufixed16x88",
            "ufixed16x96",
            "ufixed16x104",
            "ufixed16x112",
            "ufixed16x120",
            "ufixed16x128",
            "ufixed16x136",
            "ufixed16x144",
            "ufixed16x152",
            "ufixed16x160",
            "ufixed16x168",
            "ufixed16x176",
            "ufixed16x184",
            "ufixed16x192",
            "ufixed16x200",
            "ufixed16x208",
            "ufixed16x216",
            "ufixed16x224",
            "ufixed16x232",
            "ufixed16x240",
            "ufixed24x8",
            "ufixed24x16",
            "ufixed24x24",
            "ufixed24x32",
            "ufixed24x40",
            "ufixed24x48",
            "ufixed24x56",
            "ufixed24x64",
            "ufixed24x72",
            "ufixed24x80",
            "ufixed24x88",
            "ufixed24x96",
            "ufixed24x104",
            "ufixed24x112",
            "ufixed24x120",
            "ufixed24x128",
            "ufixed24x136",
            "ufixed24x144",
            "ufixed24x152",
            "ufixed24x160",
            "ufixed24x168",
            "ufixed24x176",
            "ufixed24x184",
            "ufixed24x192",
            "ufixed24x200",
            "ufixed24x208",
            "ufixed24x216",
            "ufixed24x224",
            "ufixed24x232",
            "ufixed32x8",
            "ufixed32x16",
            "ufixed32x24",
            "ufixed32x32",
            "ufixed32x40",
            "ufixed32x48",
            "ufixed32x56",
            "ufixed32x64",
            "ufixed32x72",
            "ufixed32x80",
            "ufixed32x88",
            "ufixed32x96",
            "ufixed32x104",
            "ufixed32x112",
            "ufixed32x120",
            "ufixed32x128",
            "ufixed32x136",
            "ufixed32x144",
            "ufixed32x152",
            "ufixed32x160",
            "ufixed32x168",
            "ufixed32x176",
            "ufixed32x184",
            "ufixed32x192",
            "ufixed32x200",
            "ufixed32x208",
            "ufixed32x216",
            "ufixed32x224",
            "ufixed40x8",
            "ufixed40x16",
            "ufixed40x24",
            "ufixed40x32",
            "ufixed40x40",
            "ufixed40x48",
            "ufixed40x56",
            "ufixed40x64",
            "ufixed40x72",
            "ufixed40x80",
            "ufixed40x88",
            "ufixed40x96",
            "ufixed40x104",
            "ufixed40x112",
            "ufixed40x120",
            "ufixed40x128",
            "ufixed40x136",
            "ufixed40x144",
            "ufixed40x152",
            "ufixed40x160",
            "ufixed40x168",
            "ufixed40x176",
            "ufixed40x184",
            "ufixed40x192",
            "ufixed40x200",
            "ufixed40x208",
            "ufixed40x216",
            "ufixed48x8",
            "ufixed48x16",
            "ufixed48x24",
            "ufixed48x32",
            "ufixed48x40",
            "ufixed48x48",
            "ufixed48x56",
            "ufixed48x64",
            "ufixed48x72",
            "ufixed48x80",
            "ufixed48x88",
            "ufixed48x96",
            "ufixed48x104",
            "ufixed48x112",
            "ufixed48x120",
            "ufixed48x128",
            "ufixed48x136",
            "ufixed48x144",
            "ufixed48x152",
            "ufixed48x160",
            "ufixed48x168",
            "ufixed48x176",
            "ufixed48x184",
            "ufixed48x192",
            "ufixed48x200",
            "ufixed48x208",
            "ufixed56x8",
            "ufixed56x16",
            "ufixed56x24",
            "ufixed56x32",
            "ufixed56x40",
            "ufixed56x48",
            "ufixed56x56",
            "ufixed56x64",
            "ufixed56x72",
            "ufixed56x80",
            "ufixed56x88",
            "ufixed56x96",
            "ufixed56x104",
            "ufixed56x112",
            "ufixed56x120",
            "ufixed56x128",
            "ufixed56x136",
            "ufixed56x144",
            "ufixed56x152",
            "ufixed56x160",
            "ufixed56x168",
            "ufixed56x176",
            "ufixed56x184",
            "ufixed56x192",
            "ufixed56x200",
            "ufixed64x8",
            "ufixed64x16",
            "ufixed64x24",
            "ufixed64x32",
            "ufixed64x40",
            "ufixed64x48",
            "ufixed64x56",
            "ufixed64x64",
            "ufixed64x72",
            "ufixed64x80",
            "ufixed64x88",
            "ufixed64x96",
            "ufixed64x104",
            "ufixed64x112",
            "ufixed64x120",
            "ufixed64x128",
            "ufixed64x136",
            "ufixed64x144",
            "ufixed64x152",
            "ufixed64x160",
            "ufixed64x168",
            "ufixed64x176",
            "ufixed64x184",
            "ufixed64x192",
            "ufixed72x8",
            "ufixed72x16",
            "ufixed72x24",
            "ufixed72x32",
            "ufixed72x40",
            "ufixed72x48",
            "ufixed72x56",
            "ufixed72x64",
            "ufixed72x72",
            "ufixed72x80",
            "ufixed72x88",
            "ufixed72x96",
            "ufixed72x104",
            "ufixed72x112",
            "ufixed72x120",
            "ufixed72x128",
            "ufixed72x136",
            "ufixed72x144",
            "ufixed72x152",
            "ufixed72x160",
            "ufixed72x168",
            "ufixed72x176",
            "ufixed72x184",
            "ufixed80x8",
            "ufixed80x16",
            "ufixed80x24",
            "ufixed80x32",
            "ufixed80x40",
            "ufixed80x48",
            "ufixed80x56",
            "ufixed80x64",
            "ufixed80x72",
            "ufixed80x80",
            "ufixed80x88",
            "ufixed80x96",
            "ufixed80x104",
            "ufixed80x112",
            "ufixed80x120",
            "ufixed80x128",
            "ufixed80x136",
            "ufixed80x144",
            "ufixed80x152",
            "ufixed80x160",
            "ufixed80x168",
            "ufixed80x176",
            "ufixed88x8",
            "ufixed88x16",
            "ufixed88x24",
            "ufixed88x32",
            "ufixed88x40",
            "ufixed88x48",
            "ufixed88x56",
            "ufixed88x64",
            "ufixed88x72",
            "ufixed88x80",
            "ufixed88x88",
            "ufixed88x96",
            "ufixed88x104",
            "ufixed88x112",
            "ufixed88x120",
            "ufixed88x128",
            "ufixed88x136",
            "ufixed88x144",
            "ufixed88x152",
            "ufixed88x160",
            "ufixed88x168",
            "ufixed96x8",
            "ufixed96x16",
            "ufixed96x24",
            "ufixed96x32",
            "ufixed96x40",
            "ufixed96x48",
            "ufixed96x56",
            "ufixed96x64",
            "ufixed96x72",
            "ufixed96x80",
            "ufixed96x88",
            "ufixed96x96",
            "ufixed96x104",
            "ufixed96x112",
            "ufixed96x120",
            "ufixed96x128",
            "ufixed96x136",
            "ufixed96x144",
            "ufixed96x152",
            "ufixed96x160",
            "ufixed104x8",
            "ufixed104x16",
            "ufixed104x24",
            "ufixed104x32",
            "ufixed104x40",
            "ufixed104x48",
            "ufixed104x56",
            "ufixed104x64",
            "ufixed104x72",
            "ufixed104x80",
            "ufixed104x88",
            "ufixed104x96",
            "ufixed104x104",
            "ufixed104x112",
            "ufixed104x120",
            "ufixed104x128",
            "ufixed104x136",
            "ufixed104x144",
            "ufixed104x152",
            "ufixed112x8",
            "ufixed112x16",
            "ufixed112x24",
            "ufixed112x32",
            "ufixed112x40",
            "ufixed112x48",
            "ufixed112x56",
            "ufixed112x64",
            "ufixed112x72",
            "ufixed112x80",
            "ufixed112x88",
            "ufixed112x96",
            "ufixed112x104",
            "ufixed112x112",
            "ufixed112x120",
            "ufixed112x128",
            "ufixed112x136",
            "ufixed112x144",
            "ufixed120x8",
            "ufixed120x16",
            "ufixed120x24",
            "ufixed120x32",
            "ufixed120x40",
            "ufixed120x48",
            "ufixed120x56",
            "ufixed120x64",
            "ufixed120x72",
            "ufixed120x80",
            "ufixed120x88",
            "ufixed120x96",
            "ufixed120x104",
            "ufixed120x112",
            "ufixed120x120",
            "ufixed120x128",
            "ufixed120x136",
            "ufixed128x8",
            "ufixed128x16",
            "ufixed128x24",
            "ufixed128x32",
            "ufixed128x40",
            "ufixed128x48",
            "ufixed128x56",
            "ufixed128x64",
            "ufixed128x72",
            "ufixed128x80",
            "ufixed128x88",
            "ufixed128x96",
            "ufixed128x104",
            "ufixed128x112",
            "ufixed128x120",
            "ufixed128x128",
            "ufixed136x8",
            "ufixed136x16",
            "ufixed136x24",
            "ufixed136x32",
            "ufixed136x40",
            "ufixed136x48",
            "ufixed136x56",
            "ufixed136x64",
            "ufixed136x72",
            "ufixed136x80",
            "ufixed136x88",
            "ufixed136x96",
            "ufixed136x104",
            "ufixed136x112",
            "ufixed136x120",
            "ufixed144x8",
            "ufixed144x16",
            "ufixed144x24",
            "ufixed144x32",
            "ufixed144x40",
            "ufixed144x48",
            "ufixed144x56",
            "ufixed144x64",
            "ufixed144x72",
            "ufixed144x80",
            "ufixed144x88",
            "ufixed144x96",
            "ufixed144x104",
            "ufixed144x112",
            "ufixed152x8",
            "ufixed152x16",
            "ufixed152x24",
            "ufixed152x32",
            "ufixed152x40",
            "ufixed152x48",
            "ufixed152x56",
            "ufixed152x64",
            "ufixed152x72",
            "ufixed152x80",
            "ufixed152x88",
            "ufixed152x96",
            "ufixed152x104",
            "ufixed160x8",
            "ufixed160x16",
            "ufixed160x24",
            "ufixed160x32",
            "ufixed160x40",
            "ufixed160x48",
            "ufixed160x56",
            "ufixed160x64",
            "ufixed160x72",
            "ufixed160x80",
            "ufixed160x88",
            "ufixed160x96",
            "ufixed168x8",
            "ufixed168x16",
            "ufixed168x24",
            "ufixed168x32",
            "ufixed168x40",
            "ufixed168x48",
            "ufixed168x56",
            "ufixed168x64",
            "ufixed168x72",
            "ufixed168x80",
            "ufixed168x88",
            "ufixed176x8",
            "ufixed176x16",
            "ufixed176x24",
            "ufixed176x32",
            "ufixed176x40",
            "ufixed176x48",
            "ufixed176x56",
            "ufixed176x64",
            "ufixed176x72",
            "ufixed176x80",
            "ufixed184x8",
            "ufixed184x16",
            "ufixed184x24",
            "ufixed184x32",
            "ufixed184x40",
            "ufixed184x48",
            "ufixed184x56",
            "ufixed184x64",
            "ufixed184x72",
            "ufixed192x8",
            "ufixed192x16",
            "ufixed192x24",
            "ufixed192x32",
            "ufixed192x40",
            "ufixed192x48",
            "ufixed192x56",
            "ufixed192x64",
            "ufixed200x8",
            "ufixed200x16",
            "ufixed200x24",
            "ufixed200x32",
            "ufixed200x40",
            "ufixed200x48",
            "ufixed200x56",
            "ufixed208x8",
            "ufixed208x16",
            "ufixed208x24",
            "ufixed208x32",
            "ufixed208x40",
            "ufixed208x48",
            "ufixed216x8",
            "ufixed216x16",
            "ufixed216x24",
            "ufixed216x32",
            "ufixed216x40",
            "ufixed224x8",
            "ufixed224x16",
            "ufixed224x24",
            "ufixed224x32",
            "ufixed232x8",
            "ufixed232x16",
            "ufixed232x24",
            "ufixed240x8",
            "ufixed240x16",
            "ufixed248x8",
            "event",
            "enum",
            "let",
            "mapping",
            "private",
            "public",
            "external",
            "inherited",
            "payable",
            "true",
            "false",
            "var",
            "import",
            "constant",
            "if",
            "else",
            "for",
            "else",
            "for",
            "while",
            "do",
            "break",
            "continue",
            "throw",
            "returns",
            "return",
            "suicide",
            "new",
            "is",
            "this",
            "super",
          ],
          operators: [
            "=",
            ">",
            "<",
            "!",
            "~",
            "?",
            ":",
            "==",
            "<=",
            ">=",
            "!=",
            "&&",
            "||",
            "++",
            "--",
            "+",
            "-",
            "*",
            "/",
            "&",
            "|",
            "^",
            "%",
            "<<",
            ">>",
            ">>>",
            "+=",
            "-=",
            "*=",
            "/=",
            "&=",
            "|=",
            "^=",
            "%=",
            "<<=",
            ">>=",
            ">>>=",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          integersuffix: /(ll|LL|u|U|l|L)?(ll|LL|u|U|l|L)?/,
          floatsuffix: /[fFlL]?/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_]\w*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/\[\[.*\]\]/, "annotation"],
              [/^\s*#\w+/, "keyword"],
              [/int\d*/, "keyword"],
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, "number.hex"],
              [/0[0-7']*[0-7](@integersuffix)/, "number.octal"],
              [/0[bB][0-1']*[0-1](@integersuffix)/, "number.binary"],
              [/\d[\d']*\d(@integersuffix)/, "number"],
              [/\d(@integersuffix)/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", "@string"],
              [/'[^\\']'/, "string"],
              [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
              [/'/, "string.invalid"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*\*(?!\/)/, "comment.doc", "@doccomment"],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            doccomment: [
              [/[^\/*]+/, "comment.doc"],
              [/\*\//, "comment.doc", "@pop"],
              [/[\/*]/, "comment.doc"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  v6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
            ["<", ">"],
          ],
          autoClosingPairs: [
            { open: '"', close: '"', notIn: ["string", "comment"] },
            { open: "{", close: "}", notIn: ["string", "comment"] },
            { open: "[", close: "]", notIn: ["string", "comment"] },
            { open: "(", close: ")", notIn: ["string", "comment"] },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".aes",
          brackets: [
            { token: "delimiter.curly", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
            { token: "delimiter.angle", open: "<", close: ">" },
          ],
          keywords: [
            "contract",
            "library",
            "entrypoint",
            "function",
            "stateful",
            "state",
            "hash",
            "signature",
            "tuple",
            "list",
            "address",
            "string",
            "bool",
            "int",
            "record",
            "datatype",
            "type",
            "option",
            "oracle",
            "oracle_query",
            "Call",
            "Bits",
            "Bytes",
            "Oracle",
            "String",
            "Crypto",
            "Address",
            "Auth",
            "Chain",
            "None",
            "Some",
            "bits",
            "bytes",
            "event",
            "let",
            "map",
            "private",
            "public",
            "true",
            "false",
            "var",
            "if",
            "else",
            "throw",
          ],
          operators: [
            "=",
            ">",
            "<",
            "!",
            "~",
            "?",
            "::",
            ":",
            "==",
            "<=",
            ">=",
            "!=",
            "&&",
            "||",
            "++",
            "--",
            "+",
            "-",
            "*",
            "/",
            "&",
            "|",
            "^",
            "%",
            "<<",
            ">>",
            ">>>",
            "+=",
            "-=",
            "*=",
            "/=",
            "&=",
            "|=",
            "^=",
            "%=",
            "<<=",
            ">>=",
            ">>>=",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          integersuffix: /(ll|LL|u|U|l|L)?(ll|LL|u|U|l|L)?/,
          floatsuffix: /[fFlL]?/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_]\w*/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
              { include: "@whitespace" },
              [/\[\[.*\]\]/, "annotation"],
              [/^\s*#\w+/, "keyword"],
              [/int\d*/, "keyword"],
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, "number.hex"],
              [/0[0-7']*[0-7](@integersuffix)/, "number.octal"],
              [/0[bB][0-1']*[0-1](@integersuffix)/, "number.binary"],
              [/\d[\d']*\d(@integersuffix)/, "number"],
              [/\d(@integersuffix)/, "number"],
              [/[;,.]/, "delimiter"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", "@string"],
              [/'[^\\']'/, "string"],
              [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
              [/'/, "string.invalid"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*\*(?!\/)/, "comment.doc", "@doccomment"],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            doccomment: [
              [/[^\/*]+/, "comment.doc"],
              [/\*\//, "comment.doc", "@pop"],
              [/[\/*]/, "comment.doc"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  b6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "#" },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "'", close: "'", notIn: ["string"] },
            { open: '"', close: '"', notIn: ["string"] },
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".rq",
          brackets: [
            { token: "delimiter.curly", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
            { token: "delimiter.angle", open: "<", close: ">" },
          ],
          keywords: [
            "add",
            "as",
            "asc",
            "ask",
            "base",
            "by",
            "clear",
            "construct",
            "copy",
            "create",
            "data",
            "delete",
            "desc",
            "describe",
            "distinct",
            "drop",
            "false",
            "filter",
            "from",
            "graph",
            "group",
            "having",
            "in",
            "insert",
            "limit",
            "load",
            "minus",
            "move",
            "named",
            "not",
            "offset",
            "optional",
            "order",
            "prefix",
            "reduced",
            "select",
            "service",
            "silent",
            "to",
            "true",
            "undef",
            "union",
            "using",
            "values",
            "where",
            "with",
          ],
          builtinFunctions: [
            "a",
            "abs",
            "avg",
            "bind",
            "bnode",
            "bound",
            "ceil",
            "coalesce",
            "concat",
            "contains",
            "count",
            "datatype",
            "day",
            "encode_for_uri",
            "exists",
            "floor",
            "group_concat",
            "hours",
            "if",
            "iri",
            "isblank",
            "isiri",
            "isliteral",
            "isnumeric",
            "isuri",
            "lang",
            "langmatches",
            "lcase",
            "max",
            "md5",
            "min",
            "minutes",
            "month",
            "now",
            "rand",
            "regex",
            "replace",
            "round",
            "sameterm",
            "sample",
            "seconds",
            "sha1",
            "sha256",
            "sha384",
            "sha512",
            "str",
            "strafter",
            "strbefore",
            "strdt",
            "strends",
            "strlang",
            "strlen",
            "strstarts",
            "struuid",
            "substr",
            "sum",
            "timezone",
            "tz",
            "ucase",
            "uri",
            "uuid",
            "year",
          ],
          ignoreCase: !0,
          tokenizer: {
            root: [
              [/<[^\s\u00a0>]*>?/, "tag"],
              { include: "@strings" },
              [/#.*/, "comment"],
              [/[{}()\[\]]/, "@brackets"],
              [/[;,.]/, "delimiter"],
              [
                /[_\w\d]+:(\.(?=[\w_\-\\%])|[:\w_-]|\\[-\\_~.!$&'()*+,;=/?#@%]|%[a-f\d][a-f\d])*/,
                "tag",
              ],
              [/:(\.(?=[\w_\-\\%])|[:\w_-]|\\[-\\_~.!$&'()*+,;=/?#@%]|%[a-f\d][a-f\d])+/, "tag"],
              [
                /[$?]?[_\w\d]+/,
                {
                  cases: {
                    "@keywords": { token: "keyword" },
                    "@builtinFunctions": { token: "predefined.sql" },
                    "@default": "identifier",
                  },
                },
              ],
              [/\^\^/, "operator.sql"],
              [/\^[*+\-<>=&|^\/!?]*/, "operator.sql"],
              [/[*+\-<>=&|\/!?]/, "operator.sql"],
              [/@[a-z\d\-]*/, "metatag.html"],
              [/\s+/, "white"],
            ],
            strings: [
              [/'([^'\\]|\\.)*$/, "string.invalid"],
              [/'$/, "string.sql", "@pop"],
              [/'/, "string.sql", "@stringBody"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"$/, "string.sql", "@pop"],
              [/"/, "string.sql", "@dblStringBody"],
            ],
            stringBody: [
              [/[^\\']+/, "string.sql"],
              [/\\./, "string.escape"],
              [/'/, "string.sql", "@pop"],
            ],
            dblStringBody: [
              [/[^\\"]+/, "string.sql"],
              [/\\./, "string.escape"],
              [/"/, "string.sql", "@pop"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  y6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "--", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".sql",
          ignoreCase: !0,
          brackets: [
            { open: "[", close: "]", token: "delimiter.square" },
            { open: "(", close: ")", token: "delimiter.parenthesis" },
          ],
          keywords: [
            "ABORT",
            "ABSOLUTE",
            "ACTION",
            "ADA",
            "ADD",
            "AFTER",
            "ALL",
            "ALLOCATE",
            "ALTER",
            "ALWAYS",
            "ANALYZE",
            "AND",
            "ANY",
            "ARE",
            "AS",
            "ASC",
            "ASSERTION",
            "AT",
            "ATTACH",
            "AUTHORIZATION",
            "AUTOINCREMENT",
            "AVG",
            "BACKUP",
            "BEFORE",
            "BEGIN",
            "BETWEEN",
            "BIT",
            "BIT_LENGTH",
            "BOTH",
            "BREAK",
            "BROWSE",
            "BULK",
            "BY",
            "CASCADE",
            "CASCADED",
            "CASE",
            "CAST",
            "CATALOG",
            "CHAR",
            "CHARACTER",
            "CHARACTER_LENGTH",
            "CHAR_LENGTH",
            "CHECK",
            "CHECKPOINT",
            "CLOSE",
            "CLUSTERED",
            "COALESCE",
            "COLLATE",
            "COLLATION",
            "COLUMN",
            "COMMIT",
            "COMPUTE",
            "CONFLICT",
            "CONNECT",
            "CONNECTION",
            "CONSTRAINT",
            "CONSTRAINTS",
            "CONTAINS",
            "CONTAINSTABLE",
            "CONTINUE",
            "CONVERT",
            "CORRESPONDING",
            "COUNT",
            "CREATE",
            "CROSS",
            "CURRENT",
            "CURRENT_DATE",
            "CURRENT_TIME",
            "CURRENT_TIMESTAMP",
            "CURRENT_USER",
            "CURSOR",
            "DATABASE",
            "DATE",
            "DAY",
            "DBCC",
            "DEALLOCATE",
            "DEC",
            "DECIMAL",
            "DECLARE",
            "DEFAULT",
            "DEFERRABLE",
            "DEFERRED",
            "DELETE",
            "DENY",
            "DESC",
            "DESCRIBE",
            "DESCRIPTOR",
            "DETACH",
            "DIAGNOSTICS",
            "DISCONNECT",
            "DISK",
            "DISTINCT",
            "DISTRIBUTED",
            "DO",
            "DOMAIN",
            "DOUBLE",
            "DROP",
            "DUMP",
            "EACH",
            "ELSE",
            "END",
            "END-EXEC",
            "ERRLVL",
            "ESCAPE",
            "EXCEPT",
            "EXCEPTION",
            "EXCLUDE",
            "EXCLUSIVE",
            "EXEC",
            "EXECUTE",
            "EXISTS",
            "EXIT",
            "EXPLAIN",
            "EXTERNAL",
            "EXTRACT",
            "FAIL",
            "FALSE",
            "FETCH",
            "FILE",
            "FILLFACTOR",
            "FILTER",
            "FIRST",
            "FLOAT",
            "FOLLOWING",
            "FOR",
            "FOREIGN",
            "FORTRAN",
            "FOUND",
            "FREETEXT",
            "FREETEXTTABLE",
            "FROM",
            "FULL",
            "FUNCTION",
            "GENERATED",
            "GET",
            "GLOB",
            "GLOBAL",
            "GO",
            "GOTO",
            "GRANT",
            "GROUP",
            "GROUPS",
            "HAVING",
            "HOLDLOCK",
            "HOUR",
            "IDENTITY",
            "IDENTITYCOL",
            "IDENTITY_INSERT",
            "IF",
            "IGNORE",
            "IMMEDIATE",
            "IN",
            "INCLUDE",
            "INDEX",
            "INDEXED",
            "INDICATOR",
            "INITIALLY",
            "INNER",
            "INPUT",
            "INSENSITIVE",
            "INSERT",
            "INSTEAD",
            "INT",
            "INTEGER",
            "INTERSECT",
            "INTERVAL",
            "INTO",
            "IS",
            "ISNULL",
            "ISOLATION",
            "JOIN",
            "KEY",
            "KILL",
            "LANGUAGE",
            "LAST",
            "LEADING",
            "LEFT",
            "LEVEL",
            "LIKE",
            "LIMIT",
            "LINENO",
            "LOAD",
            "LOCAL",
            "LOWER",
            "MATCH",
            "MATERIALIZED",
            "MAX",
            "MERGE",
            "MIN",
            "MINUTE",
            "MODULE",
            "MONTH",
            "NAMES",
            "NATIONAL",
            "NATURAL",
            "NCHAR",
            "NEXT",
            "NO",
            "NOCHECK",
            "NONCLUSTERED",
            "NONE",
            "NOT",
            "NOTHING",
            "NOTNULL",
            "NULL",
            "NULLIF",
            "NULLS",
            "NUMERIC",
            "OCTET_LENGTH",
            "OF",
            "OFF",
            "OFFSET",
            "OFFSETS",
            "ON",
            "ONLY",
            "OPEN",
            "OPENDATASOURCE",
            "OPENQUERY",
            "OPENROWSET",
            "OPENXML",
            "OPTION",
            "OR",
            "ORDER",
            "OTHERS",
            "OUTER",
            "OUTPUT",
            "OVER",
            "OVERLAPS",
            "PAD",
            "PARTIAL",
            "PARTITION",
            "PASCAL",
            "PERCENT",
            "PIVOT",
            "PLAN",
            "POSITION",
            "PRAGMA",
            "PRECEDING",
            "PRECISION",
            "PREPARE",
            "PRESERVE",
            "PRIMARY",
            "PRINT",
            "PRIOR",
            "PRIVILEGES",
            "PROC",
            "PROCEDURE",
            "PUBLIC",
            "QUERY",
            "RAISE",
            "RAISERROR",
            "RANGE",
            "READ",
            "READTEXT",
            "REAL",
            "RECONFIGURE",
            "RECURSIVE",
            "REFERENCES",
            "REGEXP",
            "REINDEX",
            "RELATIVE",
            "RELEASE",
            "RENAME",
            "REPLACE",
            "REPLICATION",
            "RESTORE",
            "RESTRICT",
            "RETURN",
            "RETURNING",
            "REVERT",
            "REVOKE",
            "RIGHT",
            "ROLLBACK",
            "ROW",
            "ROWCOUNT",
            "ROWGUIDCOL",
            "ROWS",
            "RULE",
            "SAVE",
            "SAVEPOINT",
            "SCHEMA",
            "SCROLL",
            "SECOND",
            "SECTION",
            "SECURITYAUDIT",
            "SELECT",
            "SEMANTICKEYPHRASETABLE",
            "SEMANTICSIMILARITYDETAILSTABLE",
            "SEMANTICSIMILARITYTABLE",
            "SESSION",
            "SESSION_USER",
            "SET",
            "SETUSER",
            "SHUTDOWN",
            "SIZE",
            "SMALLINT",
            "SOME",
            "SPACE",
            "SQL",
            "SQLCA",
            "SQLCODE",
            "SQLERROR",
            "SQLSTATE",
            "SQLWARNING",
            "STATISTICS",
            "SUBSTRING",
            "SUM",
            "SYSTEM_USER",
            "TABLE",
            "TABLESAMPLE",
            "TEMP",
            "TEMPORARY",
            "TEXTSIZE",
            "THEN",
            "TIES",
            "TIME",
            "TIMESTAMP",
            "TIMEZONE_HOUR",
            "TIMEZONE_MINUTE",
            "TO",
            "TOP",
            "TRAILING",
            "TRAN",
            "TRANSACTION",
            "TRANSLATE",
            "TRANSLATION",
            "TRIGGER",
            "TRIM",
            "TRUE",
            "TRUNCATE",
            "TRY_CONVERT",
            "TSEQUAL",
            "UNBOUNDED",
            "UNION",
            "UNIQUE",
            "UNKNOWN",
            "UNPIVOT",
            "UPDATE",
            "UPDATETEXT",
            "UPPER",
            "USAGE",
            "USE",
            "USER",
            "USING",
            "VACUUM",
            "VALUE",
            "VALUES",
            "VARCHAR",
            "VARYING",
            "VIEW",
            "VIRTUAL",
            "WAITFOR",
            "WHEN",
            "WHENEVER",
            "WHERE",
            "WHILE",
            "WINDOW",
            "WITH",
            "WITHIN GROUP",
            "WITHOUT",
            "WORK",
            "WRITE",
            "WRITETEXT",
            "YEAR",
            "ZONE",
          ],
          operators: [
            "ALL",
            "AND",
            "ANY",
            "BETWEEN",
            "EXISTS",
            "IN",
            "LIKE",
            "NOT",
            "OR",
            "SOME",
            "EXCEPT",
            "INTERSECT",
            "UNION",
            "APPLY",
            "CROSS",
            "FULL",
            "INNER",
            "JOIN",
            "LEFT",
            "OUTER",
            "RIGHT",
            "CONTAINS",
            "FREETEXT",
            "IS",
            "NULL",
            "PIVOT",
            "UNPIVOT",
            "MATCHED",
          ],
          builtinFunctions: [
            "AVG",
            "CHECKSUM_AGG",
            "COUNT",
            "COUNT_BIG",
            "GROUPING",
            "GROUPING_ID",
            "MAX",
            "MIN",
            "SUM",
            "STDEV",
            "STDEVP",
            "VAR",
            "VARP",
            "CUME_DIST",
            "FIRST_VALUE",
            "LAG",
            "LAST_VALUE",
            "LEAD",
            "PERCENTILE_CONT",
            "PERCENTILE_DISC",
            "PERCENT_RANK",
            "COLLATE",
            "COLLATIONPROPERTY",
            "TERTIARY_WEIGHTS",
            "FEDERATION_FILTERING_VALUE",
            "CAST",
            "CONVERT",
            "PARSE",
            "TRY_CAST",
            "TRY_CONVERT",
            "TRY_PARSE",
            "ASYMKEY_ID",
            "ASYMKEYPROPERTY",
            "CERTPROPERTY",
            "CERT_ID",
            "CRYPT_GEN_RANDOM",
            "DECRYPTBYASYMKEY",
            "DECRYPTBYCERT",
            "DECRYPTBYKEY",
            "DECRYPTBYKEYAUTOASYMKEY",
            "DECRYPTBYKEYAUTOCERT",
            "DECRYPTBYPASSPHRASE",
            "ENCRYPTBYASYMKEY",
            "ENCRYPTBYCERT",
            "ENCRYPTBYKEY",
            "ENCRYPTBYPASSPHRASE",
            "HASHBYTES",
            "IS_OBJECTSIGNED",
            "KEY_GUID",
            "KEY_ID",
            "KEY_NAME",
            "SIGNBYASYMKEY",
            "SIGNBYCERT",
            "SYMKEYPROPERTY",
            "VERIFYSIGNEDBYCERT",
            "VERIFYSIGNEDBYASYMKEY",
            "CURSOR_STATUS",
            "DATALENGTH",
            "IDENT_CURRENT",
            "IDENT_INCR",
            "IDENT_SEED",
            "IDENTITY",
            "SQL_VARIANT_PROPERTY",
            "CURRENT_TIMESTAMP",
            "DATEADD",
            "DATEDIFF",
            "DATEFROMPARTS",
            "DATENAME",
            "DATEPART",
            "DATETIME2FROMPARTS",
            "DATETIMEFROMPARTS",
            "DATETIMEOFFSETFROMPARTS",
            "DAY",
            "EOMONTH",
            "GETDATE",
            "GETUTCDATE",
            "ISDATE",
            "MONTH",
            "SMALLDATETIMEFROMPARTS",
            "SWITCHOFFSET",
            "SYSDATETIME",
            "SYSDATETIMEOFFSET",
            "SYSUTCDATETIME",
            "TIMEFROMPARTS",
            "TODATETIMEOFFSET",
            "YEAR",
            "CHOOSE",
            "COALESCE",
            "IIF",
            "NULLIF",
            "ABS",
            "ACOS",
            "ASIN",
            "ATAN",
            "ATN2",
            "CEILING",
            "COS",
            "COT",
            "DEGREES",
            "EXP",
            "FLOOR",
            "LOG",
            "LOG10",
            "PI",
            "POWER",
            "RADIANS",
            "RAND",
            "ROUND",
            "SIGN",
            "SIN",
            "SQRT",
            "SQUARE",
            "TAN",
            "APP_NAME",
            "APPLOCK_MODE",
            "APPLOCK_TEST",
            "ASSEMBLYPROPERTY",
            "COL_LENGTH",
            "COL_NAME",
            "COLUMNPROPERTY",
            "DATABASE_PRINCIPAL_ID",
            "DATABASEPROPERTYEX",
            "DB_ID",
            "DB_NAME",
            "FILE_ID",
            "FILE_IDEX",
            "FILE_NAME",
            "FILEGROUP_ID",
            "FILEGROUP_NAME",
            "FILEGROUPPROPERTY",
            "FILEPROPERTY",
            "FULLTEXTCATALOGPROPERTY",
            "FULLTEXTSERVICEPROPERTY",
            "INDEX_COL",
            "INDEXKEY_PROPERTY",
            "INDEXPROPERTY",
            "OBJECT_DEFINITION",
            "OBJECT_ID",
            "OBJECT_NAME",
            "OBJECT_SCHEMA_NAME",
            "OBJECTPROPERTY",
            "OBJECTPROPERTYEX",
            "ORIGINAL_DB_NAME",
            "PARSENAME",
            "SCHEMA_ID",
            "SCHEMA_NAME",
            "SCOPE_IDENTITY",
            "SERVERPROPERTY",
            "STATS_DATE",
            "TYPE_ID",
            "TYPE_NAME",
            "TYPEPROPERTY",
            "DENSE_RANK",
            "NTILE",
            "RANK",
            "ROW_NUMBER",
            "PUBLISHINGSERVERNAME",
            "OPENDATASOURCE",
            "OPENQUERY",
            "OPENROWSET",
            "OPENXML",
            "CERTENCODED",
            "CERTPRIVATEKEY",
            "CURRENT_USER",
            "HAS_DBACCESS",
            "HAS_PERMS_BY_NAME",
            "IS_MEMBER",
            "IS_ROLEMEMBER",
            "IS_SRVROLEMEMBER",
            "LOGINPROPERTY",
            "ORIGINAL_LOGIN",
            "PERMISSIONS",
            "PWDENCRYPT",
            "PWDCOMPARE",
            "SESSION_USER",
            "SESSIONPROPERTY",
            "SUSER_ID",
            "SUSER_NAME",
            "SUSER_SID",
            "SUSER_SNAME",
            "SYSTEM_USER",
            "USER",
            "USER_ID",
            "USER_NAME",
            "ASCII",
            "CHAR",
            "CHARINDEX",
            "CONCAT",
            "DIFFERENCE",
            "FORMAT",
            "LEFT",
            "LEN",
            "LOWER",
            "LTRIM",
            "NCHAR",
            "PATINDEX",
            "QUOTENAME",
            "REPLACE",
            "REPLICATE",
            "REVERSE",
            "RIGHT",
            "RTRIM",
            "SOUNDEX",
            "SPACE",
            "STR",
            "STUFF",
            "SUBSTRING",
            "UNICODE",
            "UPPER",
            "BINARY_CHECKSUM",
            "CHECKSUM",
            "CONNECTIONPROPERTY",
            "CONTEXT_INFO",
            "CURRENT_REQUEST_ID",
            "ERROR_LINE",
            "ERROR_NUMBER",
            "ERROR_MESSAGE",
            "ERROR_PROCEDURE",
            "ERROR_SEVERITY",
            "ERROR_STATE",
            "FORMATMESSAGE",
            "GETANSINULL",
            "GET_FILESTREAM_TRANSACTION_CONTEXT",
            "HOST_ID",
            "HOST_NAME",
            "ISNULL",
            "ISNUMERIC",
            "MIN_ACTIVE_ROWVERSION",
            "NEWID",
            "NEWSEQUENTIALID",
            "ROWCOUNT_BIG",
            "XACT_STATE",
            "TEXTPTR",
            "TEXTVALID",
            "COLUMNS_UPDATED",
            "EVENTDATA",
            "TRIGGER_NESTLEVEL",
            "UPDATE",
            "CHANGETABLE",
            "CHANGE_TRACKING_CONTEXT",
            "CHANGE_TRACKING_CURRENT_VERSION",
            "CHANGE_TRACKING_IS_COLUMN_IN_MASK",
            "CHANGE_TRACKING_MIN_VALID_VERSION",
            "CONTAINSTABLE",
            "FREETEXTTABLE",
            "SEMANTICKEYPHRASETABLE",
            "SEMANTICSIMILARITYDETAILSTABLE",
            "SEMANTICSIMILARITYTABLE",
            "FILETABLEROOTPATH",
            "GETFILENAMESPACEPATH",
            "GETPATHLOCATOR",
            "PATHNAME",
            "GET_TRANSMISSION_STATUS",
          ],
          builtinVariables: [
            "@@DATEFIRST",
            "@@DBTS",
            "@@LANGID",
            "@@LANGUAGE",
            "@@LOCK_TIMEOUT",
            "@@MAX_CONNECTIONS",
            "@@MAX_PRECISION",
            "@@NESTLEVEL",
            "@@OPTIONS",
            "@@REMSERVER",
            "@@SERVERNAME",
            "@@SERVICENAME",
            "@@SPID",
            "@@TEXTSIZE",
            "@@VERSION",
            "@@CURSOR_ROWS",
            "@@FETCH_STATUS",
            "@@DATEFIRST",
            "@@PROCID",
            "@@ERROR",
            "@@IDENTITY",
            "@@ROWCOUNT",
            "@@TRANCOUNT",
            "@@CONNECTIONS",
            "@@CPU_BUSY",
            "@@IDLE",
            "@@IO_BUSY",
            "@@PACKET_ERRORS",
            "@@PACK_RECEIVED",
            "@@PACK_SENT",
            "@@TIMETICKS",
            "@@TOTAL_ERRORS",
            "@@TOTAL_READ",
            "@@TOTAL_WRITE",
          ],
          pseudoColumns: ["$ACTION", "$IDENTITY", "$ROWGUID", "$PARTITION"],
          tokenizer: {
            root: [
              { include: "@comments" },
              { include: "@whitespace" },
              { include: "@pseudoColumns" },
              { include: "@numbers" },
              { include: "@strings" },
              { include: "@complexIdentifiers" },
              { include: "@scopes" },
              [/[;,.]/, "delimiter"],
              [/[()]/, "@brackets"],
              [
                /[\w@#$]+/,
                {
                  cases: {
                    "@operators": "operator",
                    "@builtinVariables": "predefined",
                    "@builtinFunctions": "predefined",
                    "@keywords": "keyword",
                    "@default": "identifier",
                  },
                },
              ],
              [/[<>=!%&+\-*/|~^]/, "operator"],
            ],
            whitespace: [[/\s+/, "white"]],
            comments: [
              [/--+.*/, "comment"],
              [/\/\*/, { token: "comment.quote", next: "@comment" }],
            ],
            comment: [
              [/[^*/]+/, "comment"],
              [/\*\//, { token: "comment.quote", next: "@pop" }],
              [/./, "comment"],
            ],
            pseudoColumns: [
              [
                /[$][A-Za-z_][\w@#$]*/,
                { cases: { "@pseudoColumns": "predefined", "@default": "identifier" } },
              ],
            ],
            numbers: [
              [/0[xX][0-9a-fA-F]*/, "number"],
              [/[$][+-]*\d*(\.\d*)?/, "number"],
              [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, "number"],
            ],
            strings: [
              [/N'/, { token: "string", next: "@string" }],
              [/'/, { token: "string", next: "@string" }],
            ],
            string: [
              [/[^']+/, "string"],
              [/''/, "string"],
              [/'/, { token: "string", next: "@pop" }],
            ],
            complexIdentifiers: [
              [/\[/, { token: "identifier.quote", next: "@bracketedIdentifier" }],
              [/"/, { token: "identifier.quote", next: "@quotedIdentifier" }],
            ],
            bracketedIdentifier: [
              [/[^\]]+/, "identifier"],
              [/]]/, "identifier"],
              [/]/, { token: "identifier.quote", next: "@pop" }],
            ],
            quotedIdentifier: [
              [/[^"]+/, "identifier"],
              [/""/, "identifier"],
              [/"/, { token: "identifier.quote", next: "@pop" }],
            ],
            scopes: [
              [/BEGIN\s+(DISTRIBUTED\s+)?TRAN(SACTION)?\b/i, "keyword"],
              [/BEGIN\s+TRY\b/i, { token: "keyword.try" }],
              [/END\s+TRY\b/i, { token: "keyword.try" }],
              [/BEGIN\s+CATCH\b/i, { token: "keyword.catch" }],
              [/END\s+CATCH\b/i, { token: "keyword.catch" }],
              [/(BEGIN|CASE)\b/i, { token: "keyword.block" }],
              [/END\b/i, { token: "keyword.block" }],
              [/WHEN\b/i, { token: "keyword.choice" }],
              [/THEN\b/i, { token: "keyword.choice" }],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  x6e = {
    comments: { lineComment: "//", blockComment: ["(*", "*)"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
      ["var", "end_var"],
      ["var_input", "end_var"],
      ["var_output", "end_var"],
      ["var_in_out", "end_var"],
      ["var_temp", "end_var"],
      ["var_global", "end_var"],
      ["var_access", "end_var"],
      ["var_external", "end_var"],
      ["type", "end_type"],
      ["struct", "end_struct"],
      ["program", "end_program"],
      ["function", "end_function"],
      ["function_block", "end_function_block"],
      ["action", "end_action"],
      ["step", "end_step"],
      ["initial_step", "end_step"],
      ["transaction", "end_transaction"],
      ["configuration", "end_configuration"],
      ["tcp", "end_tcp"],
      ["recource", "end_recource"],
      ["channel", "end_channel"],
      ["library", "end_library"],
      ["folder", "end_folder"],
      ["binaries", "end_binaries"],
      ["includes", "end_includes"],
      ["sources", "end_sources"],
    ],
    autoClosingPairs: [
      { open: "[", close: "]" },
      { open: "{", close: "}" },
      { open: "(", close: ")" },
      { open: "/*", close: "*/" },
      { open: "'", close: "'", notIn: ["string_sq"] },
      { open: '"', close: '"', notIn: ["string_dq"] },
      { open: "var_input", close: "end_var" },
      { open: "var_output", close: "end_var" },
      { open: "var_in_out", close: "end_var" },
      { open: "var_temp", close: "end_var" },
      { open: "var_global", close: "end_var" },
      { open: "var_access", close: "end_var" },
      { open: "var_external", close: "end_var" },
      { open: "type", close: "end_type" },
      { open: "struct", close: "end_struct" },
      { open: "program", close: "end_program" },
      { open: "function", close: "end_function" },
      { open: "function_block", close: "end_function_block" },
      { open: "action", close: "end_action" },
      { open: "step", close: "end_step" },
      { open: "initial_step", close: "end_step" },
      { open: "transaction", close: "end_transaction" },
      { open: "configuration", close: "end_configuration" },
      { open: "tcp", close: "end_tcp" },
      { open: "recource", close: "end_recource" },
      { open: "channel", close: "end_channel" },
      { open: "library", close: "end_library" },
      { open: "folder", close: "end_folder" },
      { open: "binaries", close: "end_binaries" },
      { open: "includes", close: "end_includes" },
      { open: "sources", close: "end_sources" },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
      { open: "var", close: "end_var" },
      { open: "var_input", close: "end_var" },
      { open: "var_output", close: "end_var" },
      { open: "var_in_out", close: "end_var" },
      { open: "var_temp", close: "end_var" },
      { open: "var_global", close: "end_var" },
      { open: "var_access", close: "end_var" },
      { open: "var_external", close: "end_var" },
      { open: "type", close: "end_type" },
      { open: "struct", close: "end_struct" },
      { open: "program", close: "end_program" },
      { open: "function", close: "end_function" },
      { open: "function_block", close: "end_function_block" },
      { open: "action", close: "end_action" },
      { open: "step", close: "end_step" },
      { open: "initial_step", close: "end_step" },
      { open: "transaction", close: "end_transaction" },
      { open: "configuration", close: "end_configuration" },
      { open: "tcp", close: "end_tcp" },
      { open: "recource", close: "end_recource" },
      { open: "channel", close: "end_channel" },
      { open: "library", close: "end_library" },
      { open: "folder", close: "end_folder" },
      { open: "binaries", close: "end_binaries" },
      { open: "includes", close: "end_includes" },
      { open: "sources", close: "end_sources" },
    ],
    folding: {
      markers: {
        start: new RegExp("^\\s*#pragma\\s+region\\b"),
        end: new RegExp("^\\s*#pragma\\s+endregion\\b"),
      },
    },
  },
  w6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: x6e,
        language: {
          defaultToken: "",
          tokenPostfix: ".st",
          ignoreCase: !0,
          brackets: [
            { token: "delimiter.curly", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
          ],
          keywords: [
            "if",
            "end_if",
            "elsif",
            "else",
            "case",
            "of",
            "to",
            "__try",
            "__catch",
            "__finally",
            "do",
            "with",
            "by",
            "while",
            "repeat",
            "end_while",
            "end_repeat",
            "end_case",
            "for",
            "end_for",
            "task",
            "retain",
            "non_retain",
            "constant",
            "with",
            "at",
            "exit",
            "return",
            "interval",
            "priority",
            "address",
            "port",
            "on_channel",
            "then",
            "iec",
            "file",
            "uses",
            "version",
            "packagetype",
            "displayname",
            "copyright",
            "summary",
            "vendor",
            "common_source",
            "from",
            "extends",
            "implements",
          ],
          constant: ["false", "true", "null"],
          defineKeywords: [
            "var",
            "var_input",
            "var_output",
            "var_in_out",
            "var_temp",
            "var_global",
            "var_access",
            "var_external",
            "end_var",
            "type",
            "end_type",
            "struct",
            "end_struct",
            "program",
            "end_program",
            "function",
            "end_function",
            "function_block",
            "end_function_block",
            "interface",
            "end_interface",
            "method",
            "end_method",
            "property",
            "end_property",
            "namespace",
            "end_namespace",
            "configuration",
            "end_configuration",
            "tcp",
            "end_tcp",
            "resource",
            "end_resource",
            "channel",
            "end_channel",
            "library",
            "end_library",
            "folder",
            "end_folder",
            "binaries",
            "end_binaries",
            "includes",
            "end_includes",
            "sources",
            "end_sources",
            "action",
            "end_action",
            "step",
            "initial_step",
            "end_step",
            "transaction",
            "end_transaction",
          ],
          typeKeywords: [
            "int",
            "sint",
            "dint",
            "lint",
            "usint",
            "uint",
            "udint",
            "ulint",
            "real",
            "lreal",
            "time",
            "date",
            "time_of_day",
            "date_and_time",
            "string",
            "bool",
            "byte",
            "word",
            "dword",
            "array",
            "pointer",
            "lword",
          ],
          operators: [
            "=",
            ">",
            "<",
            ":",
            ":=",
            "<=",
            ">=",
            "<>",
            "&",
            "+",
            "-",
            "*",
            "**",
            "MOD",
            "^",
            "or",
            "and",
            "not",
            "xor",
            "abs",
            "acos",
            "asin",
            "atan",
            "cos",
            "exp",
            "expt",
            "ln",
            "log",
            "sin",
            "sqrt",
            "tan",
            "sel",
            "max",
            "min",
            "limit",
            "mux",
            "shl",
            "shr",
            "rol",
            "ror",
            "indexof",
            "sizeof",
            "adr",
            "adrinst",
            "bitadr",
            "is_valid",
            "ref",
            "ref_to",
          ],
          builtinVariables: [],
          builtinFunctions: [
            "sr",
            "rs",
            "tp",
            "ton",
            "tof",
            "eq",
            "ge",
            "le",
            "lt",
            "ne",
            "round",
            "trunc",
            "ctd",
            "сtu",
            "ctud",
            "r_trig",
            "f_trig",
            "move",
            "concat",
            "delete",
            "find",
            "insert",
            "left",
            "len",
            "replace",
            "right",
            "rtc",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              [/(\.\.)/, "delimiter"],
              [/\b(16#[0-9A-Fa-f\_]*)+\b/, "number.hex"],
              [/\b(2#[01\_]+)+\b/, "number.binary"],
              [/\b(8#[0-9\_]*)+\b/, "number.octal"],
              [/\b\d*\.\d+([eE][\-+]?\d+)?\b/, "number.float"],
              [/\b(L?REAL)#[0-9\_\.e]+\b/, "number.float"],
              [/\b(BYTE|(?:D|L)?WORD|U?(?:S|D|L)?INT)#[0-9\_]+\b/, "number"],
              [/\d+/, "number"],
              [/\b(T|DT|TOD)#[0-9:-_shmyd]+\b/, "tag"],
              [/\%(I|Q|M)(X|B|W|D|L)[0-9\.]+/, "tag"],
              [/\%(I|Q|M)[0-9\.]*/, "tag"],
              [/\b[A-Za-z]{1,6}#[0-9]+\b/, "tag"],
              [/\b(TO_|CTU_|CTD_|CTUD_|MUX_|SEL_)[A_Za-z]+\b/, "predefined"],
              [/\b[A_Za-z]+(_TO_)[A_Za-z]+\b/, "predefined"],
              [/[;]/, "delimiter"],
              [/[.]/, { token: "delimiter", next: "@params" }],
              [
                /[a-zA-Z_]\w*/,
                {
                  cases: {
                    "@operators": "operators",
                    "@keywords": "keyword",
                    "@typeKeywords": "type",
                    "@defineKeywords": "variable",
                    "@constant": "constant",
                    "@builtinVariables": "predefined",
                    "@builtinFunctions": "predefined",
                    "@default": "identifier",
                  },
                },
              ],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, { token: "string.quote", bracket: "@open", next: "@string_dq" }],
              [/'/, { token: "string.quote", bracket: "@open", next: "@string_sq" }],
              [/'[^\\']'/, "string"],
              [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
              [/'/, "string.invalid"],
            ],
            params: [
              [/\b[A-Za-z0-9_]+\b(?=\()/, { token: "identifier", next: "@pop" }],
              [/\b[A-Za-z0-9_]+\b/, "variable.name", "@pop"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\/\*/, "comment", "@push"],
              ["\\*/", "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            comment2: [
              [/[^\(*]+/, "comment"],
              [/\(\*/, "comment", "@push"],
              ["\\*\\)", "comment", "@pop"],
              [/[\(*]/, "comment"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/\/\/.*$/, "comment"],
              [/\/\*/, "comment", "@comment"],
              [/\(\*/, "comment", "@comment2"],
            ],
            string_dq: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
            string_sq: [
              [/[^\\']+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  C6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "`", close: "`" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "`", close: "`" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: ".swift",
          identifier: /[a-zA-Z_][\w$]*/,
          attributes: [
            "@GKInspectable",
            "@IBAction",
            "@IBDesignable",
            "@IBInspectable",
            "@IBOutlet",
            "@IBSegueAction",
            "@NSApplicationMain",
            "@NSCopying",
            "@NSManaged",
            "@Sendable",
            "@UIApplicationMain",
            "@autoclosure",
            "@actorIndependent",
            "@asyncHandler",
            "@available",
            "@convention",
            "@derivative",
            "@differentiable",
            "@discardableResult",
            "@dynamicCallable",
            "@dynamicMemberLookup",
            "@escaping",
            "@frozen",
            "@globalActor",
            "@inlinable",
            "@inline",
            "@main",
            "@noDerivative",
            "@nonobjc",
            "@noreturn",
            "@objc",
            "@objcMembers",
            "@preconcurrency",
            "@propertyWrapper",
            "@requires_stored_property_inits",
            "@resultBuilder",
            "@testable",
            "@unchecked",
            "@unknown",
            "@usableFromInline",
            "@warn_unqualified_access",
          ],
          accessmodifiers: ["open", "public", "internal", "fileprivate", "private"],
          keywords: [
            "#available",
            "#colorLiteral",
            "#column",
            "#dsohandle",
            "#else",
            "#elseif",
            "#endif",
            "#error",
            "#file",
            "#fileID",
            "#fileLiteral",
            "#filePath",
            "#function",
            "#if",
            "#imageLiteral",
            "#keyPath",
            "#line",
            "#selector",
            "#sourceLocation",
            "#warning",
            "Any",
            "Protocol",
            "Self",
            "Type",
            "actor",
            "as",
            "assignment",
            "associatedtype",
            "associativity",
            "async",
            "await",
            "break",
            "case",
            "catch",
            "class",
            "continue",
            "convenience",
            "default",
            "defer",
            "deinit",
            "didSet",
            "do",
            "dynamic",
            "dynamicType",
            "else",
            "enum",
            "extension",
            "fallthrough",
            "false",
            "fileprivate",
            "final",
            "for",
            "func",
            "get",
            "guard",
            "higherThan",
            "if",
            "import",
            "in",
            "indirect",
            "infix",
            "init",
            "inout",
            "internal",
            "is",
            "isolated",
            "lazy",
            "left",
            "let",
            "lowerThan",
            "mutating",
            "nil",
            "none",
            "nonisolated",
            "nonmutating",
            "open",
            "operator",
            "optional",
            "override",
            "postfix",
            "precedence",
            "precedencegroup",
            "prefix",
            "private",
            "protocol",
            "public",
            "repeat",
            "required",
            "rethrows",
            "return",
            "right",
            "safe",
            "self",
            "set",
            "some",
            "static",
            "struct",
            "subscript",
            "super",
            "switch",
            "throw",
            "throws",
            "true",
            "try",
            "typealias",
            "unowned",
            "unsafe",
            "var",
            "weak",
            "where",
            "while",
            "willSet",
            "__consuming",
            "__owned",
          ],
          symbols: /[=(){}\[\].,:;@#\_&\-<>`?!+*\\\/]/,
          operatorstart:
            /[\/=\-+!*%<>&|^~?\u00A1-\u00A7\u00A9\u00AB\u00AC\u00AE\u00B0-\u00B1\u00B6\u00BB\u00BF\u00D7\u00F7\u2016-\u2017\u2020-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u23FF\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3030]/,
          operatorend:
            /[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE00-\uFE0F\uFE20-\uFE2F\uE0100-\uE01EF]/,
          operators: /(@operatorstart)((@operatorstart)|(@operatorend))*/,
          escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          tokenizer: {
            root: [
              { include: "@whitespace" },
              { include: "@comment" },
              { include: "@attribute" },
              { include: "@literal" },
              { include: "@keyword" },
              { include: "@invokedmethod" },
              { include: "@symbol" },
            ],
            whitespace: [
              [/\s+/, "white"],
              [/"""/, "string.quote", "@endDblDocString"],
            ],
            endDblDocString: [
              [/[^"]+/, "string"],
              [/\\"/, "string"],
              [/"""/, "string.quote", "@popall"],
              [/"/, "string"],
            ],
            symbol: [
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/[.]/, "delimiter"],
              [/@operators/, "operator"],
              [/@symbols/, "operator"],
            ],
            comment: [
              [/\/\/\/.*$/, "comment.doc"],
              [/\/\*\*/, "comment.doc", "@commentdocbody"],
              [/\/\/.*$/, "comment"],
              [/\/\*/, "comment", "@commentbody"],
            ],
            commentdocbody: [
              [/\/\*/, "comment", "@commentbody"],
              [/\*\//, "comment.doc", "@pop"],
              [/\:[a-zA-Z]+\:/, "comment.doc.param"],
              [/./, "comment.doc"],
            ],
            commentbody: [
              [/\/\*/, "comment", "@commentbody"],
              [/\*\//, "comment", "@pop"],
              [/./, "comment"],
            ],
            attribute: [
              [/@@@identifier/, { cases: { "@attributes": "keyword.control", "@default": "" } }],
            ],
            literal: [
              [/"/, { token: "string.quote", next: "@stringlit" }],
              [/0[b]([01]_?)+/, "number.binary"],
              [/0[o]([0-7]_?)+/, "number.octal"],
              [/0[x]([0-9a-fA-F]_?)+([pP][\-+](\d_?)+)?/, "number.hex"],
              [/(\d_?)*\.(\d_?)+([eE][\-+]?(\d_?)+)?/, "number.float"],
              [/(\d_?)+/, "number"],
            ],
            stringlit: [
              [/\\\(/, { token: "operator", next: "@interpolatedexpression" }],
              [/@escapes/, "string"],
              [/\\./, "string.escape.invalid"],
              [/"/, { token: "string.quote", next: "@pop" }],
              [/./, "string"],
            ],
            interpolatedexpression: [
              [/\(/, { token: "operator", next: "@interpolatedexpression" }],
              [/\)/, { token: "operator", next: "@pop" }],
              { include: "@literal" },
              { include: "@keyword" },
              { include: "@symbol" },
            ],
            keyword: [
              [/`/, { token: "operator", next: "@escapedkeyword" }],
              [
                /@identifier/,
                {
                  cases: {
                    "@keywords": "keyword",
                    "[A-Z][a-zA-Z0-9$]*": "type.identifier",
                    "@default": "identifier",
                  },
                },
              ],
            ],
            escapedkeyword: [
              [/`/, { token: "operator", next: "@pop" }],
              [/./, "identifier"],
            ],
            invokedmethod: [
              [
                /([.])(@identifier)/,
                { cases: { $2: ["delimeter", "type.identifier"], "@default": "" } },
              ],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  S6e = {
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
      ["begin", "end"],
      ["case", "endcase"],
      ["casex", "endcase"],
      ["casez", "endcase"],
      ["checker", "endchecker"],
      ["class", "endclass"],
      ["clocking", "endclocking"],
      ["config", "endconfig"],
      ["function", "endfunction"],
      ["generate", "endgenerate"],
      ["group", "endgroup"],
      ["interface", "endinterface"],
      ["module", "endmodule"],
      ["package", "endpackage"],
      ["primitive", "endprimitive"],
      ["program", "endprogram"],
      ["property", "endproperty"],
      ["specify", "endspecify"],
      ["sequence", "endsequence"],
      ["table", "endtable"],
      ["task", "endtask"],
    ],
    autoClosingPairs: [
      { open: "[", close: "]" },
      { open: "{", close: "}" },
      { open: "(", close: ")" },
      { open: "'", close: "'", notIn: ["string", "comment"] },
      { open: '"', close: '"', notIn: ["string"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: {
      offSide: !1,
      markers: {
        start: new RegExp(
          "^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:begin|case(x|z)?|class|clocking|config|covergroup|function|generate|interface|module|package|primitive|property|program|sequence|specify|table|task)\\b",
        ),
        end: new RegExp(
          "^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:end|endcase|endclass|endclocking|endconfig|endgroup|endfunction|endgenerate|endinterface|endmodule|endpackage|endprimitive|endproperty|endprogram|endsequence|endspecify|endtable|endtask)\\b",
        ),
      },
    },
  },
  k6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: S6e,
        language: {
          defaultToken: "",
          tokenPostfix: ".sv",
          brackets: [
            { token: "delimiter.curly", open: "{", close: "}" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.square", open: "[", close: "]" },
            { token: "delimiter.angle", open: "<", close: ">" },
          ],
          keywords: [
            "accept_on",
            "alias",
            "always",
            "always_comb",
            "always_ff",
            "always_latch",
            "and",
            "assert",
            "assign",
            "assume",
            "automatic",
            "before",
            "begin",
            "bind",
            "bins",
            "binsof",
            "bit",
            "break",
            "buf",
            "bufif0",
            "bufif1",
            "byte",
            "case",
            "casex",
            "casez",
            "cell",
            "chandle",
            "checker",
            "class",
            "clocking",
            "cmos",
            "config",
            "const",
            "constraint",
            "context",
            "continue",
            "cover",
            "covergroup",
            "coverpoint",
            "cross",
            "deassign",
            "default",
            "defparam",
            "design",
            "disable",
            "dist",
            "do",
            "edge",
            "else",
            "end",
            "endcase",
            "endchecker",
            "endclass",
            "endclocking",
            "endconfig",
            "endfunction",
            "endgenerate",
            "endgroup",
            "endinterface",
            "endmodule",
            "endpackage",
            "endprimitive",
            "endprogram",
            "endproperty",
            "endspecify",
            "endsequence",
            "endtable",
            "endtask",
            "enum",
            "event",
            "eventually",
            "expect",
            "export",
            "extends",
            "extern",
            "final",
            "first_match",
            "for",
            "force",
            "foreach",
            "forever",
            "fork",
            "forkjoin",
            "function",
            "generate",
            "genvar",
            "global",
            "highz0",
            "highz1",
            "if",
            "iff",
            "ifnone",
            "ignore_bins",
            "illegal_bins",
            "implements",
            "implies",
            "import",
            "incdir",
            "include",
            "initial",
            "inout",
            "input",
            "inside",
            "instance",
            "int",
            "integer",
            "interconnect",
            "interface",
            "intersect",
            "join",
            "join_any",
            "join_none",
            "large",
            "let",
            "liblist",
            "library",
            "local",
            "localparam",
            "logic",
            "longint",
            "macromodule",
            "matches",
            "medium",
            "modport",
            "module",
            "nand",
            "negedge",
            "nettype",
            "new",
            "nexttime",
            "nmos",
            "nor",
            "noshowcancelled",
            "not",
            "notif0",
            "notif1",
            "null",
            "or",
            "output",
            "package",
            "packed",
            "parameter",
            "pmos",
            "posedge",
            "primitive",
            "priority",
            "program",
            "property",
            "protected",
            "pull0",
            "pull1",
            "pulldown",
            "pullup",
            "pulsestyle_ondetect",
            "pulsestyle_onevent",
            "pure",
            "rand",
            "randc",
            "randcase",
            "randsequence",
            "rcmos",
            "real",
            "realtime",
            "ref",
            "reg",
            "reject_on",
            "release",
            "repeat",
            "restrict",
            "return",
            "rnmos",
            "rpmos",
            "rtran",
            "rtranif0",
            "rtranif1",
            "s_always",
            "s_eventually",
            "s_nexttime",
            "s_until",
            "s_until_with",
            "scalared",
            "sequence",
            "shortint",
            "shortreal",
            "showcancelled",
            "signed",
            "small",
            "soft",
            "solve",
            "specify",
            "specparam",
            "static",
            "string",
            "strong",
            "strong0",
            "strong1",
            "struct",
            "super",
            "supply0",
            "supply1",
            "sync_accept_on",
            "sync_reject_on",
            "table",
            "tagged",
            "task",
            "this",
            "throughout",
            "time",
            "timeprecision",
            "timeunit",
            "tran",
            "tranif0",
            "tranif1",
            "tri",
            "tri0",
            "tri1",
            "triand",
            "trior",
            "trireg",
            "type",
            "typedef",
            "union",
            "unique",
            "unique0",
            "unsigned",
            "until",
            "until_with",
            "untyped",
            "use",
            "uwire",
            "var",
            "vectored",
            "virtual",
            "void",
            "wait",
            "wait_order",
            "wand",
            "weak",
            "weak0",
            "weak1",
            "while",
            "wildcard",
            "wire",
            "with",
            "within",
            "wor",
            "xnor",
            "xor",
          ],
          builtin_gates: [
            "and",
            "nand",
            "nor",
            "or",
            "xor",
            "xnor",
            "buf",
            "not",
            "bufif0",
            "bufif1",
            "notif1",
            "notif0",
            "cmos",
            "nmos",
            "pmos",
            "rcmos",
            "rnmos",
            "rpmos",
            "tran",
            "tranif1",
            "tranif0",
            "rtran",
            "rtranif1",
            "rtranif0",
          ],
          operators: [
            "=",
            "+=",
            "-=",
            "*=",
            "/=",
            "%=",
            "&=",
            "|=",
            "^=",
            "<<=",
            ">>+",
            "<<<=",
            ">>>=",
            "?",
            ":",
            "+",
            "-",
            "!",
            "~",
            "&",
            "~&",
            "|",
            "~|",
            "^",
            "~^",
            "^~",
            "+",
            "-",
            "*",
            "/",
            "%",
            "==",
            "!=",
            "===",
            "!==",
            "==?",
            "!=?",
            "&&",
            "||",
            "**",
            "<",
            "<=",
            ">",
            ">=",
            "&",
            "|",
            "^",
            ">>",
            "<<",
            ">>>",
            "<<<",
            "++",
            "--",
            "->",
            "<->",
            "inside",
            "dist",
            "::",
            "+:",
            "-:",
            "*>",
            "&&&",
            "|->",
            "|=>",
            "#=#",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%#]+/,
          escapes: /%%|\\(?:[antvf\\"']|x[0-9A-Fa-f]{1,2}|[0-7]{1,3})/,
          identifier: /(?:[a-zA-Z_][a-zA-Z0-9_$\.]*|\\\S+ )/,
          systemcall: /[$][a-zA-Z0-9_]+/,
          timeunits: /s|ms|us|ns|ps|fs/,
          tokenizer: {
            root: [
              [
                /^(\s*)(@identifier)/,
                [
                  "",
                  {
                    cases: {
                      "@builtin_gates": { token: "keyword.$2", next: "@module_instance" },
                      table: { token: "keyword.$2", next: "@table" },
                      "@keywords": { token: "keyword.$2" },
                      "@default": { token: "identifier", next: "@module_instance" },
                    },
                  },
                ],
              ],
              [/^\s*`include/, { token: "keyword.directive.include", next: "@include" }],
              [/^\s*`\s*\w+/, "keyword"],
              { include: "@identifier_or_keyword" },
              { include: "@whitespace" },
              [/\(\*.*\*\)/, "annotation"],
              [/@systemcall/, "variable.predefined"],
              [/[{}()\[\]]/, "@brackets"],
              [/[<>](?!@symbols)/, "@brackets"],
              [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }],
              { include: "@numbers" },
              [/[;,.]/, "delimiter"],
              { include: "@strings" },
            ],
            identifier_or_keyword: [
              [
                /@identifier/,
                { cases: { "@keywords": { token: "keyword.$0" }, "@default": "identifier" } },
              ],
            ],
            numbers: [
              [/\d+?[\d_]*(?:\.[\d_]+)?[eE][\-+]?\d+/, "number.float"],
              [/\d+?[\d_]*\.[\d_]+(?:\s*@timeunits)?/, "number.float"],
              [/(?:\d+?[\d_]*\s*)?'[sS]?[dD]\s*[0-9xXzZ?]+?[0-9xXzZ?_]*/, "number"],
              [/(?:\d+?[\d_]*\s*)?'[sS]?[bB]\s*[0-1xXzZ?]+?[0-1xXzZ?_]*/, "number.binary"],
              [/(?:\d+?[\d_]*\s*)?'[sS]?[oO]\s*[0-7xXzZ?]+?[0-7xXzZ?_]*/, "number.octal"],
              [/(?:\d+?[\d_]*\s*)?'[sS]?[hH]\s*[0-9a-fA-FxXzZ?]+?[0-9a-fA-FxXzZ?_]*/, "number.hex"],
              [/1step/, "number"],
              [/[\dxXzZ]+?[\dxXzZ_]*(?:\s*@timeunits)?/, "number"],
              [/'[01xXzZ]+/, "number"],
            ],
            module_instance: [
              { include: "@whitespace" },
              [/(#?)(\()/, ["", { token: "@brackets", next: "@port_connection" }]],
              [/@identifier\s*[;={}\[\],]/, { token: "@rematch", next: "@pop" }],
              [/@symbols|[;={}\[\],]/, { token: "@rematch", next: "@pop" }],
              [/@identifier/, "type"],
              [/;/, "delimiter", "@pop"],
            ],
            port_connection: [
              { include: "@identifier_or_keyword" },
              { include: "@whitespace" },
              [/@systemcall/, "variable.predefined"],
              { include: "@numbers" },
              { include: "@strings" },
              [/[,]/, "delimiter"],
              [/\(/, "@brackets", "@port_connection"],
              [/\)/, "@brackets", "@pop"],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/\/\*/, "comment", "@comment"],
              [/\/\/.*$/, "comment"],
            ],
            comment: [
              [/[^\/*]+/, "comment"],
              [/\*\//, "comment", "@pop"],
              [/[\/*]/, "comment"],
            ],
            strings: [
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/"/, "string", "@string"],
            ],
            string: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
            include: [
              [
                /(\s*)(")([\w*\/*]*)(.\w*)(")/,
                [
                  "",
                  "string.include.identifier",
                  "string.include.identifier",
                  "string.include.identifier",
                  { token: "string.include.identifier", next: "@pop" },
                ],
              ],
              [
                /(\s*)(<)([\w*\/*]*)(.\w*)(>)/,
                [
                  "",
                  "string.include.identifier",
                  "string.include.identifier",
                  "string.include.identifier",
                  { token: "string.include.identifier", next: "@pop" },
                ],
              ],
            ],
            table: [
              { include: "@whitespace" },
              [/[()]/, "@brackets"],
              [/[:;]/, "delimiter"],
              [/[01\-*?xXbBrRfFpPnN]/, "variable.predefined"],
              ["endtable", "keyword.endtable", "@pop"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  E6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
        },
        language: {
          tokenPostfix: ".tcl",
          specialFunctions: [
            "set",
            "unset",
            "rename",
            "variable",
            "proc",
            "coroutine",
            "foreach",
            "incr",
            "append",
            "lappend",
            "linsert",
            "lreplace",
          ],
          mainFunctions: [
            "if",
            "then",
            "elseif",
            "else",
            "case",
            "switch",
            "while",
            "for",
            "break",
            "continue",
            "return",
            "package",
            "namespace",
            "catch",
            "exit",
            "eval",
            "expr",
            "uplevel",
            "upvar",
          ],
          builtinFunctions: [
            "file",
            "info",
            "concat",
            "join",
            "lindex",
            "list",
            "llength",
            "lrange",
            "lsearch",
            "lsort",
            "split",
            "array",
            "parray",
            "binary",
            "format",
            "regexp",
            "regsub",
            "scan",
            "string",
            "subst",
            "dict",
            "cd",
            "clock",
            "exec",
            "glob",
            "pid",
            "pwd",
            "close",
            "eof",
            "fblocked",
            "fconfigure",
            "fcopy",
            "fileevent",
            "flush",
            "gets",
            "open",
            "puts",
            "read",
            "seek",
            "socket",
            "tell",
            "interp",
            "after",
            "auto_execok",
            "auto_load",
            "auto_mkindex",
            "auto_reset",
            "bgerror",
            "error",
            "global",
            "history",
            "load",
            "source",
            "time",
            "trace",
            "unknown",
            "unset",
            "update",
            "vwait",
            "winfo",
            "wm",
            "bind",
            "event",
            "pack",
            "place",
            "grid",
            "font",
            "bell",
            "clipboard",
            "destroy",
            "focus",
            "grab",
            "lower",
            "option",
            "raise",
            "selection",
            "send",
            "tk",
            "tkwait",
            "tk_bisque",
            "tk_focusNext",
            "tk_focusPrev",
            "tk_focusFollowsMouse",
            "tk_popup",
            "tk_setPalette",
          ],
          symbols: /[=><!~?:&|+\-*\/\^%]+/,
          brackets: [
            { open: "(", close: ")", token: "delimiter.parenthesis" },
            { open: "{", close: "}", token: "delimiter.curly" },
            { open: "[", close: "]", token: "delimiter.square" },
          ],
          escapes:
            /\\(?:[abfnrtv\\"'\[\]\{\};\$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
          variables: /(?:\$+(?:(?:\:\:?)?[a-zA-Z_]\w*)+)/,
          tokenizer: {
            root: [
              [
                /[a-zA-Z_]\w*/,
                {
                  cases: {
                    "@specialFunctions": { token: "keyword.flow", next: "@specialFunc" },
                    "@mainFunctions": "keyword",
                    "@builtinFunctions": "variable",
                    "@default": "operator.scss",
                  },
                },
              ],
              [/\s+\-+(?!\d|\.)\w*|{\*}/, "metatag"],
              { include: "@whitespace" },
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, "operator"],
              [/\$+(?:\:\:)?\{/, { token: "identifier", next: "@nestedVariable" }],
              [/@variables/, "type.identifier"],
              [/\.(?!\d|\.)[\w\-]*/, "operator.sql"],
              [/\d+(\.\d+)?/, "number"],
              [/\d+/, "number"],
              [/;/, "delimiter"],
              [/"/, { token: "string.quote", bracket: "@open", next: "@dstring" }],
              [/'/, { token: "string.quote", bracket: "@open", next: "@sstring" }],
            ],
            dstring: [
              [/\[/, { token: "@brackets", next: "@nestedCall" }],
              [/\$+(?:\:\:)?\{/, { token: "identifier", next: "@nestedVariable" }],
              [/@variables/, "type.identifier"],
              [/[^\\$\[\]"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
            sstring: [
              [/\[/, { token: "@brackets", next: "@nestedCall" }],
              [/\$+(?:\:\:)?\{/, { token: "identifier", next: "@nestedVariable" }],
              [/@variables/, "type.identifier"],
              [/[^\\$\[\]']+/, "string"],
              [/@escapes/, "string.escape"],
              [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }],
            ],
            whitespace: [
              [/[ \t\r\n]+/, "white"],
              [/#.*\\$/, { token: "comment", next: "@newlineComment" }],
              [/#.*(?!\\)$/, "comment"],
            ],
            newlineComment: [
              [/.*\\$/, "comment"],
              [/.*(?!\\)$/, { token: "comment", next: "@pop" }],
            ],
            nestedVariable: [
              [/[^\{\}\$]+/, "type.identifier"],
              [/\}/, { token: "identifier", next: "@pop" }],
            ],
            nestedCall: [
              [/\[/, { token: "@brackets", next: "@nestedCall" }],
              [/\]/, { token: "@brackets", next: "@pop" }],
              { include: "root" },
            ],
            specialFunc: [
              [/"/, { token: "string", next: "@dstring" }],
              [/'/, { token: "string", next: "@sstring" }],
              [/\S+/, { token: "type", next: "@pop" }],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  N6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          wordPattern:
            /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
          comments: { blockComment: ["{#", "#}"] },
          brackets: [
            ["{#", "#}"],
            ["{%", "%}"],
            ["{{", "}}"],
            ["(", ")"],
            ["[", "]"],
            ["\x3c!--", "--\x3e"],
            ["<", ">"],
          ],
          autoClosingPairs: [
            { open: "{# ", close: " #}" },
            { open: "{% ", close: " %}" },
            { open: "{{ ", close: " }}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
            { open: '"', close: '"' },
            { open: "'", close: "'" },
          ],
          surroundingPairs: [
            { open: '"', close: '"' },
            { open: "'", close: "'" },
            { open: "<", close: ">" },
          ],
        },
        language: {
          defaultToken: "",
          tokenPostfix: "",
          ignoreCase: !0,
          keywords: [
            "apply",
            "autoescape",
            "block",
            "deprecated",
            "do",
            "embed",
            "extends",
            "flush",
            "for",
            "from",
            "if",
            "import",
            "include",
            "macro",
            "sandbox",
            "set",
            "use",
            "verbatim",
            "with",
            "endapply",
            "endautoescape",
            "endblock",
            "endembed",
            "endfor",
            "endif",
            "endmacro",
            "endsandbox",
            "endset",
            "endwith",
            "true",
            "false",
          ],
          tokenizer: {
            root: [
              [/\s+/],
              [/{#/, "comment.twig", "@commentState"],
              [/{%[-~]?/, "delimiter.twig", "@blockState"],
              [/{{[-~]?/, "delimiter.twig", "@variableState"],
              [/<!DOCTYPE/, "metatag.html", "@doctype"],
              [/<!--/, "comment.html", "@comment"],
              [
                /(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,
                ["delimiter.html", "tag.html", "", "delimiter.html"],
              ],
              [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
              [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
              [
                /(<)((?:[\w\-]+:)?[\w\-]+)/,
                ["delimiter.html", { token: "tag.html", next: "@otherTag" }],
              ],
              [
                /(<\/)((?:[\w\-]+:)?[\w\-]+)/,
                ["delimiter.html", { token: "tag.html", next: "@otherTag" }],
              ],
              [/</, "delimiter.html"],
              [/[^<{]+/],
            ],
            commentState: [
              [/#}/, "comment.twig", "@pop"],
              [/./, "comment.twig"],
            ],
            blockState: [
              [/[-~]?%}/, "delimiter.twig", "@pop"],
              [/\s+/],
              [
                /(verbatim)(\s*)([-~]?%})/,
                ["keyword.twig", "", { token: "delimiter.twig", next: "@rawDataState" }],
              ],
              { include: "expression" },
            ],
            rawDataState: [
              [
                /({%[-~]?)(\s*)(endverbatim)(\s*)([-~]?%})/,
                [
                  "delimiter.twig",
                  "",
                  "keyword.twig",
                  "",
                  { token: "delimiter.twig", next: "@popall" },
                ],
              ],
              [/./, "string.twig"],
            ],
            variableState: [[/[-~]?}}/, "delimiter.twig", "@pop"], { include: "expression" }],
            stringState: [
              [/"/, "string.twig", "@pop"],
              [/#{\s*/, "string.twig", "@interpolationState"],
              [/[^#"\\]*(?:(?:\\.|#(?!\{))[^#"\\]*)*/, "string.twig"],
            ],
            interpolationState: [[/}/, "string.twig", "@pop"], { include: "expression" }],
            expression: [
              [/\s+/],
              [/\+|-|\/{1,2}|%|\*{1,2}/, "operators.twig"],
              [/(and|or|not|b-and|b-xor|b-or)(\s+)/, ["operators.twig", ""]],
              [/==|!=|<|>|>=|<=/, "operators.twig"],
              [/(starts with|ends with|matches)(\s+)/, ["operators.twig", ""]],
              [/(in)(\s+)/, ["operators.twig", ""]],
              [/(is)(\s+)/, ["operators.twig", ""]],
              [/\||~|:|\.{1,2}|\?{1,2}/, "operators.twig"],
              [
                /[^\W\d][\w]*/,
                { cases: { "@keywords": "keyword.twig", "@default": "variable.twig" } },
              ],
              [/\d+(\.\d+)?/, "number.twig"],
              [/\(|\)|\[|\]|{|}|,/, "delimiter.twig"],
              [/"([^#"\\]*(?:\\.[^#"\\]*)*)"|\'([^\'\\]*(?:\\.[^\'\\]*)*)\'/, "string.twig"],
              [/"/, "string.twig", "@stringState"],
              [/=>/, "operators.twig"],
              [/=/, "operators.twig"],
            ],
            doctype: [
              [/[^>]+/, "metatag.content.html"],
              [/>/, "metatag.html", "@pop"],
            ],
            comment: [
              [/-->/, "comment.html", "@pop"],
              [/[^-]+/, "comment.content.html"],
              [/./, "comment.content.html"],
            ],
            otherTag: [
              [/\/?>/, "delimiter.html", "@pop"],
              [/"([^"]*)"/, "attribute.value.html"],
              [/'([^']*)'/, "attribute.value.html"],
              [/[\w\-]+/, "attribute.name.html"],
              [/=/, "delimiter.html"],
              [/[ \t\r\n]+/],
            ],
            script: [
              [/type/, "attribute.name.html", "@scriptAfterType"],
              [/"([^"]*)"/, "attribute.value.html"],
              [/'([^']*)'/, "attribute.value.html"],
              [/[\w\-]+/, "attribute.name.html"],
              [/=/, "delimiter.html"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [
                /(<\/)(script\s*)(>)/,
                ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }],
              ],
            ],
            scriptAfterType: [
              [/=/, "delimiter.html", "@scriptAfterTypeEquals"],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptAfterTypeEquals: [
              [
                /"([^"]*)"/,
                { token: "attribute.value.html", switchTo: "@scriptWithCustomType.$1" },
              ],
              [
                /'([^']*)'/,
                { token: "attribute.value.html", switchTo: "@scriptWithCustomType.$1" },
              ],
              [
                />/,
                {
                  token: "delimiter.html",
                  next: "@scriptEmbedded",
                  nextEmbedded: "text/javascript",
                },
              ],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptWithCustomType: [
              [/>/, { token: "delimiter.html", next: "@scriptEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value.html"],
              [/'([^']*)'/, "attribute.value.html"],
              [/[\w\-]+/, "attribute.name.html"],
              [/=/, "delimiter.html"],
              [/[ \t\r\n]+/],
              [/<\/script\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            scriptEmbedded: [
              [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
              [/[^<]+/, ""],
            ],
            style: [
              [/type/, "attribute.name.html", "@styleAfterType"],
              [/"([^"]*)"/, "attribute.value.html"],
              [/'([^']*)'/, "attribute.value.html"],
              [/[\w\-]+/, "attribute.name.html"],
              [/=/, "delimiter.html"],
              [/>/, { token: "delimiter.html", next: "@styleEmbedded", nextEmbedded: "text/css" }],
              [/[ \t\r\n]+/],
              [
                /(<\/)(style\s*)(>)/,
                ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }],
              ],
            ],
            styleAfterType: [
              [/=/, "delimiter.html", "@styleAfterTypeEquals"],
              [/>/, { token: "delimiter.html", next: "@styleEmbedded", nextEmbedded: "text/css" }],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleAfterTypeEquals: [
              [/"([^"]*)"/, { token: "attribute.value.html", switchTo: "@styleWithCustomType.$1" }],
              [/'([^']*)'/, { token: "attribute.value.html", switchTo: "@styleWithCustomType.$1" }],
              [/>/, { token: "delimiter.html", next: "@styleEmbedded", nextEmbedded: "text/css" }],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleWithCustomType: [
              [/>/, { token: "delimiter.html", next: "@styleEmbedded.$S2", nextEmbedded: "$S2" }],
              [/"([^"]*)"/, "attribute.value.html"],
              [/'([^']*)'/, "attribute.value.html"],
              [/[\w\-]+/, "attribute.name.html"],
              [/=/, "delimiter.html"],
              [/[ \t\r\n]+/],
              [/<\/style\s*>/, { token: "@rematch", next: "@pop" }],
            ],
            styleEmbedded: [
              [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
              [/[^<]+/, ""],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  L6e = (e) => `\\b${e}\\b`,
  D6e = (e) => `(?!${e})`,
  T6e = L6e("[_a-zA-Z][_a-zA-Z0-9]*"),
  I6e = L6e("[_a-zA-Z-0-9]+"),
  R6e = {
    comments: { lineComment: "//", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "/**", close: " */", notIn: ["string"] },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
    ],
    indentationRules: {
      decreaseIndentPattern: new RegExp("^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$"),
      increaseIndentPattern: new RegExp(
        "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$",
      ),
      unIndentedLinePattern: new RegExp(
        "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$",
      ),
    },
  },
  O6e = {
    defaultToken: "",
    tokenPostfix: ".tsp",
    brackets: [
      { open: "{", close: "}", token: "delimiter.curly" },
      { open: "[", close: "]", token: "delimiter.square" },
      { open: "(", close: ")", token: "delimiter.parenthesis" },
    ],
    symbols: /[=:;<>]+/,
    keywords: [
      "import",
      "model",
      "scalar",
      "namespace",
      "op",
      "interface",
      "union",
      "using",
      "is",
      "extends",
      "enum",
      "alias",
      "return",
      "void",
      "if",
      "else",
      "projection",
      "dec",
      "extern",
      "fn",
    ],
    namedLiterals: ["true", "false", "null", "unknown", "never"],
    escapes: '\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|"|\\${)',
    tokenizer: {
      root: [{ include: "@expression" }, { include: "@whitespace" }],
      stringVerbatim: [
        { regex: '(|"|"")[^"]', action: { token: "string" } },
        { regex: `"""${D6e('"')}`, action: { token: "string", next: "@pop" } },
      ],
      stringLiteral: [
        { regex: "\\${", action: { token: "delimiter.bracket", next: "@bracketCounting" } },
        { regex: '[^\\\\"$]+', action: { token: "string" } },
        { regex: "@escapes", action: { token: "string.escape" } },
        { regex: "\\\\.", action: { token: "string.escape.invalid" } },
        { regex: '"', action: { token: "string", next: "@pop" } },
      ],
      bracketCounting: [
        { regex: "{", action: { token: "delimiter.bracket", next: "@bracketCounting" } },
        { regex: "}", action: { token: "delimiter.bracket", next: "@pop" } },
        { include: "@expression" },
      ],
      comment: [
        { regex: "[^\\*]+", action: { token: "comment" } },
        { regex: "\\*\\/", action: { token: "comment", next: "@pop" } },
        { regex: "[\\/*]", action: { token: "comment" } },
      ],
      whitespace: [
        { regex: "[ \\t\\r\\n]" },
        { regex: "\\/\\*", action: { token: "comment", next: "@comment" } },
        { regex: "\\/\\/.*$", action: { token: "comment" } },
      ],
      expression: [
        { regex: '"""', action: { token: "string", next: "@stringVerbatim" } },
        { regex: `"${D6e('""')}`, action: { token: "string", next: "@stringLiteral" } },
        { regex: "[0-9]+", action: { token: "number" } },
        {
          regex: T6e,
          action: {
            cases: {
              "@keywords": { token: "keyword" },
              "@namedLiterals": { token: "keyword" },
              "@default": { token: "identifier" },
            },
          },
        },
        { regex: `@${T6e}`, action: { token: "tag" } },
        { regex: `#${I6e}`, action: { token: "directive" } },
      ],
    },
  },
  M6e = Object.freeze(
    Object.defineProperty({ __proto__: null, conf: R6e, language: O6e }, Symbol.toStringTag, {
      value: "Module",
    }),
  ),
  A6e = {
    comments: { lineComment: "'", blockComment: ["/*", "*/"] },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
      ["<", ">"],
      ["addhandler", "end addhandler"],
      ["class", "end class"],
      ["enum", "end enum"],
      ["event", "end event"],
      ["function", "end function"],
      ["get", "end get"],
      ["if", "end if"],
      ["interface", "end interface"],
      ["module", "end module"],
      ["namespace", "end namespace"],
      ["operator", "end operator"],
      ["property", "end property"],
      ["raiseevent", "end raiseevent"],
      ["removehandler", "end removehandler"],
      ["select", "end select"],
      ["set", "end set"],
      ["structure", "end structure"],
      ["sub", "end sub"],
      ["synclock", "end synclock"],
      ["try", "end try"],
      ["while", "end while"],
      ["with", "end with"],
      ["using", "end using"],
      ["do", "loop"],
      ["for", "next"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}", notIn: ["string", "comment"] },
      { open: "[", close: "]", notIn: ["string", "comment"] },
      { open: "(", close: ")", notIn: ["string", "comment"] },
      { open: '"', close: '"', notIn: ["string", "comment"] },
      { open: "<", close: ">", notIn: ["string", "comment"] },
    ],
    folding: {
      markers: { start: new RegExp("^\\s*#Region\\b"), end: new RegExp("^\\s*#End Region\\b") },
    },
  },
  P6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: A6e,
        language: {
          defaultToken: "",
          tokenPostfix: ".vb",
          ignoreCase: !0,
          brackets: [
            { token: "delimiter.bracket", open: "{", close: "}" },
            { token: "delimiter.array", open: "[", close: "]" },
            { token: "delimiter.parenthesis", open: "(", close: ")" },
            { token: "delimiter.angle", open: "<", close: ">" },
            { token: "keyword.tag-addhandler", open: "addhandler", close: "end addhandler" },
            { token: "keyword.tag-class", open: "class", close: "end class" },
            { token: "keyword.tag-enum", open: "enum", close: "end enum" },
            { token: "keyword.tag-event", open: "event", close: "end event" },
            { token: "keyword.tag-function", open: "function", close: "end function" },
            { token: "keyword.tag-get", open: "get", close: "end get" },
            { token: "keyword.tag-if", open: "if", close: "end if" },
            { token: "keyword.tag-interface", open: "interface", close: "end interface" },
            { token: "keyword.tag-module", open: "module", close: "end module" },
            { token: "keyword.tag-namespace", open: "namespace", close: "end namespace" },
            { token: "keyword.tag-operator", open: "operator", close: "end operator" },
            { token: "keyword.tag-property", open: "property", close: "end property" },
            { token: "keyword.tag-raiseevent", open: "raiseevent", close: "end raiseevent" },
            {
              token: "keyword.tag-removehandler",
              open: "removehandler",
              close: "end removehandler",
            },
            { token: "keyword.tag-select", open: "select", close: "end select" },
            { token: "keyword.tag-set", open: "set", close: "end set" },
            { token: "keyword.tag-structure", open: "structure", close: "end structure" },
            { token: "keyword.tag-sub", open: "sub", close: "end sub" },
            { token: "keyword.tag-synclock", open: "synclock", close: "end synclock" },
            { token: "keyword.tag-try", open: "try", close: "end try" },
            { token: "keyword.tag-while", open: "while", close: "end while" },
            { token: "keyword.tag-with", open: "with", close: "end with" },
            { token: "keyword.tag-using", open: "using", close: "end using" },
            { token: "keyword.tag-do", open: "do", close: "loop" },
            { token: "keyword.tag-for", open: "for", close: "next" },
          ],
          keywords: [
            "AddHandler",
            "AddressOf",
            "Alias",
            "And",
            "AndAlso",
            "As",
            "Async",
            "Boolean",
            "ByRef",
            "Byte",
            "ByVal",
            "Call",
            "Case",
            "Catch",
            "CBool",
            "CByte",
            "CChar",
            "CDate",
            "CDbl",
            "CDec",
            "Char",
            "CInt",
            "Class",
            "CLng",
            "CObj",
            "Const",
            "Continue",
            "CSByte",
            "CShort",
            "CSng",
            "CStr",
            "CType",
            "CUInt",
            "CULng",
            "CUShort",
            "Date",
            "Decimal",
            "Declare",
            "Default",
            "Delegate",
            "Dim",
            "DirectCast",
            "Do",
            "Double",
            "Each",
            "Else",
            "ElseIf",
            "End",
            "EndIf",
            "Enum",
            "Erase",
            "Error",
            "Event",
            "Exit",
            "False",
            "Finally",
            "For",
            "Friend",
            "Function",
            "Get",
            "GetType",
            "GetXMLNamespace",
            "Global",
            "GoSub",
            "GoTo",
            "Handles",
            "If",
            "Implements",
            "Imports",
            "In",
            "Inherits",
            "Integer",
            "Interface",
            "Is",
            "IsNot",
            "Let",
            "Lib",
            "Like",
            "Long",
            "Loop",
            "Me",
            "Mod",
            "Module",
            "MustInherit",
            "MustOverride",
            "MyBase",
            "MyClass",
            "NameOf",
            "Namespace",
            "Narrowing",
            "New",
            "Next",
            "Not",
            "Nothing",
            "NotInheritable",
            "NotOverridable",
            "Object",
            "Of",
            "On",
            "Operator",
            "Option",
            "Optional",
            "Or",
            "OrElse",
            "Out",
            "Overloads",
            "Overridable",
            "Overrides",
            "ParamArray",
            "Partial",
            "Private",
            "Property",
            "Protected",
            "Public",
            "RaiseEvent",
            "ReadOnly",
            "ReDim",
            "RemoveHandler",
            "Resume",
            "Return",
            "SByte",
            "Select",
            "Set",
            "Shadows",
            "Shared",
            "Short",
            "Single",
            "Static",
            "Step",
            "Stop",
            "String",
            "Structure",
            "Sub",
            "SyncLock",
            "Then",
            "Throw",
            "To",
            "True",
            "Try",
            "TryCast",
            "TypeOf",
            "UInteger",
            "ULong",
            "UShort",
            "Using",
            "Variant",
            "Wend",
            "When",
            "While",
            "Widening",
            "With",
            "WithEvents",
            "WriteOnly",
            "Xor",
          ],
          tagwords: [
            "If",
            "Sub",
            "Select",
            "Try",
            "Class",
            "Enum",
            "Function",
            "Get",
            "Interface",
            "Module",
            "Namespace",
            "Operator",
            "Set",
            "Structure",
            "Using",
            "While",
            "With",
            "Do",
            "Loop",
            "For",
            "Next",
            "Property",
            "Continue",
            "AddHandler",
            "RemoveHandler",
            "Event",
            "RaiseEvent",
            "SyncLock",
          ],
          symbols: /[=><!~?;\.,:&|+\-*\/\^%]+/,
          integersuffix: /U?[DI%L&S@]?/,
          floatsuffix: /[R#F!]?/,
          tokenizer: {
            root: [
              { include: "@whitespace" },
              [/next(?!\w)/, { token: "keyword.tag-for" }],
              [/loop(?!\w)/, { token: "keyword.tag-do" }],
              [
                /end\s+(?!for|do)(addhandler|class|enum|event|function|get|if|interface|module|namespace|operator|property|raiseevent|removehandler|select|set|structure|sub|synclock|try|while|with|using)/,
                { token: "keyword.tag-$1" },
              ],
              [
                /[a-zA-Z_]\w*/,
                {
                  cases: {
                    "@tagwords": { token: "keyword.tag-$0" },
                    "@keywords": { token: "keyword.$0" },
                    "@default": "identifier",
                  },
                },
              ],
              [/^\s*#\w+/, "keyword"],
              [/\d*\d+e([\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/\d*\.\d+(e[\-+]?\d+)?(@floatsuffix)/, "number.float"],
              [/&H[0-9a-f]+(@integersuffix)/, "number.hex"],
              [/&0[0-7]+(@integersuffix)/, "number.octal"],
              [/\d+(@integersuffix)/, "number"],
              [/#.*#/, "number"],
              [/[{}()\[\]]/, "@brackets"],
              [/@symbols/, "delimiter"],
              [/["\u201c\u201d]/, { token: "string.quote", next: "@string" }],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/(\'|REM(?!\w)).*$/, "comment"],
            ],
            string: [
              [/[^"\u201c\u201d]+/, "string"],
              [/["\u201c\u201d]{2}/, "string.escape"],
              [/["\u201c\u201d]C?/, { token: "string.quote", next: "@pop" }],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  );
function j6e(e) {
  let t = [];
  const n = e.split(/\t+|\r+|\n+| +/);
  for (let i = 0; i < n.length; ++i) n[i].length > 0 && t.push(n[i]);
  return t;
}
const F6e = /[_\p{XID_Start}]\p{XID_Continue}*/u,
  B6e = "variable.predefined",
  V6e = {
    tokenPostfix: ".wgsl",
    defaultToken: "invalid",
    unicode: !0,
    atoms: j6e("true false"),
    keywords: j6e(
      "\n\t\t\t  alias\n\t\t\t  break\n\t\t\t  case\n\t\t\t  const\n\t\t\t  const_assert\n\t\t\t  continue\n\t\t\t  continuing\n\t\t\t  default\n\t\t\t  diagnostic\n\t\t\t  discard\n\t\t\t  else\n\t\t\t  enable\n\t\t\t  fn\n\t\t\t  for\n\t\t\t  if\n\t\t\t  let\n\t\t\t  loop\n\t\t\t  override\n\t\t\t  requires\n\t\t\t  return\n\t\t\t  struct\n\t\t\t  switch\n\t\t\t  var\n\t\t\t  while\n\t\t\t  ",
    ),
    reserved: j6e(
      "\n\t\t\t  NULL\n\t\t\t  Self\n\t\t\t  abstract\n\t\t\t  active\n\t\t\t  alignas\n\t\t\t  alignof\n\t\t\t  as\n\t\t\t  asm\n\t\t\t  asm_fragment\n\t\t\t  async\n\t\t\t  attribute\n\t\t\t  auto\n\t\t\t  await\n\t\t\t  become\n\t\t\t  binding_array\n\t\t\t  cast\n\t\t\t  catch\n\t\t\t  class\n\t\t\t  co_await\n\t\t\t  co_return\n\t\t\t  co_yield\n\t\t\t  coherent\n\t\t\t  column_major\n\t\t\t  common\n\t\t\t  compile\n\t\t\t  compile_fragment\n\t\t\t  concept\n\t\t\t  const_cast\n\t\t\t  consteval\n\t\t\t  constexpr\n\t\t\t  constinit\n\t\t\t  crate\n\t\t\t  debugger\n\t\t\t  decltype\n\t\t\t  delete\n\t\t\t  demote\n\t\t\t  demote_to_helper\n\t\t\t  do\n\t\t\t  dynamic_cast\n\t\t\t  enum\n\t\t\t  explicit\n\t\t\t  export\n\t\t\t  extends\n\t\t\t  extern\n\t\t\t  external\n\t\t\t  fallthrough\n\t\t\t  filter\n\t\t\t  final\n\t\t\t  finally\n\t\t\t  friend\n\t\t\t  from\n\t\t\t  fxgroup\n\t\t\t  get\n\t\t\t  goto\n\t\t\t  groupshared\n\t\t\t  highp\n\t\t\t  impl\n\t\t\t  implements\n\t\t\t  import\n\t\t\t  inline\n\t\t\t  instanceof\n\t\t\t  interface\n\t\t\t  layout\n\t\t\t  lowp\n\t\t\t  macro\n\t\t\t  macro_rules\n\t\t\t  match\n\t\t\t  mediump\n\t\t\t  meta\n\t\t\t  mod\n\t\t\t  module\n\t\t\t  move\n\t\t\t  mut\n\t\t\t  mutable\n\t\t\t  namespace\n\t\t\t  new\n\t\t\t  nil\n\t\t\t  noexcept\n\t\t\t  noinline\n\t\t\t  nointerpolation\n\t\t\t  noperspective\n\t\t\t  null\n\t\t\t  nullptr\n\t\t\t  of\n\t\t\t  operator\n\t\t\t  package\n\t\t\t  packoffset\n\t\t\t  partition\n\t\t\t  pass\n\t\t\t  patch\n\t\t\t  pixelfragment\n\t\t\t  precise\n\t\t\t  precision\n\t\t\t  premerge\n\t\t\t  priv\n\t\t\t  protected\n\t\t\t  pub\n\t\t\t  public\n\t\t\t  readonly\n\t\t\t  ref\n\t\t\t  regardless\n\t\t\t  register\n\t\t\t  reinterpret_cast\n\t\t\t  require\n\t\t\t  resource\n\t\t\t  restrict\n\t\t\t  self\n\t\t\t  set\n\t\t\t  shared\n\t\t\t  sizeof\n\t\t\t  smooth\n\t\t\t  snorm\n\t\t\t  static\n\t\t\t  static_assert\n\t\t\t  static_cast\n\t\t\t  std\n\t\t\t  subroutine\n\t\t\t  super\n\t\t\t  target\n\t\t\t  template\n\t\t\t  this\n\t\t\t  thread_local\n\t\t\t  throw\n\t\t\t  trait\n\t\t\t  try\n\t\t\t  type\n\t\t\t  typedef\n\t\t\t  typeid\n\t\t\t  typename\n\t\t\t  typeof\n\t\t\t  union\n\t\t\t  unless\n\t\t\t  unorm\n\t\t\t  unsafe\n\t\t\t  unsized\n\t\t\t  use\n\t\t\t  using\n\t\t\t  varying\n\t\t\t  virtual\n\t\t\t  volatile\n\t\t\t  wgsl\n\t\t\t  where\n\t\t\t  with\n\t\t\t  writeonly\n\t\t\t  yield\n\t\t\t  ",
    ),
    predeclared_enums: j6e(
      "\n\t\tread write read_write\n\t\tfunction private workgroup uniform storage\n\t\tperspective linear flat\n\t\tcenter centroid sample\n\t\tvertex_index instance_index position front_facing frag_depth\n\t\t\tlocal_invocation_id local_invocation_index\n\t\t\tglobal_invocation_id workgroup_id num_workgroups\n\t\t\tsample_index sample_mask\n\t\trgba8unorm\n\t\trgba8snorm\n\t\trgba8uint\n\t\trgba8sint\n\t\trgba16uint\n\t\trgba16sint\n\t\trgba16float\n\t\tr32uint\n\t\tr32sint\n\t\tr32float\n\t\trg32uint\n\t\trg32sint\n\t\trg32float\n\t\trgba32uint\n\t\trgba32sint\n\t\trgba32float\n\t\tbgra8unorm\n",
    ),
    predeclared_types: j6e(
      "\n\t\tbool\n\t\tf16\n\t\tf32\n\t\ti32\n\t\tsampler sampler_comparison\n\t\ttexture_depth_2d\n\t\ttexture_depth_2d_array\n\t\ttexture_depth_cube\n\t\ttexture_depth_cube_array\n\t\ttexture_depth_multisampled_2d\n\t\ttexture_external\n\t\ttexture_external\n\t\tu32\n\t\t",
    ),
    predeclared_type_generators: j6e(
      "\n\t\tarray\n\t\tatomic\n\t\tmat2x2\n\t\tmat2x3\n\t\tmat2x4\n\t\tmat3x2\n\t\tmat3x3\n\t\tmat3x4\n\t\tmat4x2\n\t\tmat4x3\n\t\tmat4x4\n\t\tptr\n\t\ttexture_1d\n\t\ttexture_2d\n\t\ttexture_2d_array\n\t\ttexture_3d\n\t\ttexture_cube\n\t\ttexture_cube_array\n\t\ttexture_multisampled_2d\n\t\ttexture_storage_1d\n\t\ttexture_storage_2d\n\t\ttexture_storage_2d_array\n\t\ttexture_storage_3d\n\t\tvec2\n\t\tvec3\n\t\tvec4\n\t\t",
    ),
    predeclared_type_aliases: j6e(
      "\n\t\tvec2i vec3i vec4i\n\t\tvec2u vec3u vec4u\n\t\tvec2f vec3f vec4f\n\t\tvec2h vec3h vec4h\n\t\tmat2x2f mat2x3f mat2x4f\n\t\tmat3x2f mat3x3f mat3x4f\n\t\tmat4x2f mat4x3f mat4x4f\n\t\tmat2x2h mat2x3h mat2x4h\n\t\tmat3x2h mat3x3h mat3x4h\n\t\tmat4x2h mat4x3h mat4x4h\n\t\t",
    ),
    predeclared_intrinsics: j6e(
      "\n  bitcast all any select arrayLength abs acos acosh asin asinh atan atanh atan2\n  ceil clamp cos cosh countLeadingZeros countOneBits countTrailingZeros cross\n  degrees determinant distance dot exp exp2 extractBits faceForward firstLeadingBit\n  firstTrailingBit floor fma fract frexp inverseBits inverseSqrt ldexp length\n  log log2 max min mix modf normalize pow quantizeToF16 radians reflect refract\n  reverseBits round saturate sign sin sinh smoothstep sqrt step tan tanh transpose\n  trunc dpdx dpdxCoarse dpdxFine dpdy dpdyCoarse dpdyFine fwidth fwidthCoarse fwidthFine\n  textureDimensions textureGather textureGatherCompare textureLoad textureNumLayers\n  textureNumLevels textureNumSamples textureSample textureSampleBias textureSampleCompare\n  textureSampleCompareLevel textureSampleGrad textureSampleLevel textureSampleBaseClampToEdge\n  textureStore atomicLoad atomicStore atomicAdd atomicSub atomicMax atomicMin\n  atomicAnd atomicOr atomicXor atomicExchange atomicCompareExchangeWeak pack4x8snorm\n  pack4x8unorm pack2x16snorm pack2x16unorm pack2x16float unpack4x8snorm unpack4x8unorm\n  unpack2x16snorm unpack2x16unorm unpack2x16float storageBarrier workgroupBarrier\n  workgroupUniformLoad\n",
    ),
    operators: j6e(
      "\n\t\t\t\t\t &\n\t\t\t\t\t &&\n\t\t\t\t\t ->\n\t\t\t\t\t /\n\t\t\t\t\t =\n\t\t\t\t\t ==\n\t\t\t\t\t !=\n\t\t\t\t\t >\n\t\t\t\t\t >=\n\t\t\t\t\t <\n\t\t\t\t\t <=\n\t\t\t\t\t %\n\t\t\t\t\t -\n\t\t\t\t\t --\n\t\t\t\t\t +\n\t\t\t\t\t ++\n\t\t\t\t\t |\n\t\t\t\t\t ||\n\t\t\t\t\t *\n\t\t\t\t\t <<\n\t\t\t\t\t >>\n\t\t\t\t\t +=\n\t\t\t\t\t -=\n\t\t\t\t\t *=\n\t\t\t\t\t /=\n\t\t\t\t\t %=\n\t\t\t\t\t &=\n\t\t\t\t\t |=\n\t\t\t\t\t ^=\n\t\t\t\t\t >>=\n\t\t\t\t\t <<=\n\t\t\t\t\t ",
    ),
    symbols: /[!%&*+\-\.\/:;<=>^|_~,]+/,
    tokenizer: {
      root: [
        [/enable|requires|diagnostic/, "keyword", "@directive"],
        [
          F6e,
          {
            cases: {
              "@atoms": B6e,
              "@keywords": "keyword",
              "@reserved": "invalid",
              "@predeclared_enums": B6e,
              "@predeclared_types": B6e,
              "@predeclared_type_generators": B6e,
              "@predeclared_type_aliases": B6e,
              "@predeclared_intrinsics": B6e,
              "@default": "identifier",
            },
          },
        ],
        { include: "@commentOrSpace" },
        { include: "@numbers" },
        [/[{}()\[\]]/, "@brackets"],
        ["@", "annotation", "@attribute"],
        [/@symbols/, { cases: { "@operators": "operator", "@default": "delimiter" } }],
        [/./, "invalid"],
      ],
      commentOrSpace: [
        [/\s+/, "white"],
        [/\/\*/, "comment", "@blockComment"],
        [/\/\/.*$/, "comment"],
      ],
      blockComment: [
        [/[^\/*]+/, "comment"],
        [/\/\*/, "comment", "@push"],
        [/\*\//, "comment", "@pop"],
        [/[\/*]/, "comment"],
      ],
      attribute: [{ include: "@commentOrSpace" }, [/\w+/, "annotation", "@pop"]],
      directive: [
        { include: "@commentOrSpace" },
        [/[()]/, "@brackets"],
        [/,/, "delimiter"],
        [F6e, "meta.content"],
        [/;/, "delimiter", "@pop"],
      ],
      numbers: [
        [/0[fh]/, "number.float"],
        [/[1-9][0-9]*[fh]/, "number.float"],
        [/[0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[fh]?/, "number.float"],
        [/[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?[fh]?/, "number.float"],
        [/[0-9]+[eE][+-]?[0-9]+[fh]?/, "number.float"],
        [/0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+(?:[pP][+-]?[0-9]+[fh]?)?/, "number.hex"],
        [/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*(?:[pP][+-]?[0-9]+[fh]?)?/, "number.hex"],
        [/0[xX][0-9a-fA-F]+[pP][+-]?[0-9]+[fh]?/, "number.hex"],
        [/0[xX][0-9a-fA-F]+[iu]?/, "number.hex"],
        [/[1-9][0-9]*[iu]?/, "number"],
        [/0[iu]?/, "number"],
      ],
    },
  },
  W6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: {
          comments: { lineComment: "//", blockComment: ["/*", "*/"] },
          brackets: [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
          ],
          autoClosingPairs: [
            { open: "[", close: "]" },
            { open: "{", close: "}" },
            { open: "(", close: ")" },
          ],
          surroundingPairs: [
            { open: "{", close: "}" },
            { open: "[", close: "]" },
            { open: "(", close: ")" },
          ],
        },
        language: V6e,
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  H6e = {
    comments: { blockComment: ["\x3c!--", "--\x3e"] },
    brackets: [["<", ">"]],
    autoClosingPairs: [
      { open: "<", close: ">" },
      { open: "'", close: "'" },
      { open: '"', close: '"' },
    ],
    surroundingPairs: [
      { open: "<", close: ">" },
      { open: "'", close: "'" },
      { open: '"', close: '"' },
    ],
    onEnterRules: [
      {
        beforeText: new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$", "i"),
        afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i,
        action: { indentAction: VGe.IndentAction.IndentOutdent },
      },
      {
        beforeText: new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$", "i"),
        action: { indentAction: VGe.IndentAction.Indent },
      },
    ],
  },
  z6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: H6e,
        language: {
          defaultToken: "",
          tokenPostfix: ".xml",
          ignoreCase: !0,
          qualifiedName: /(?:[\w\.\-]+:)?[\w\.\-]+/,
          tokenizer: {
            root: [
              [/[^<&]+/, ""],
              { include: "@whitespace" },
              [/(<)(@qualifiedName)/, [{ token: "delimiter" }, { token: "tag", next: "@tag" }]],
              [
                /(<\/)(@qualifiedName)(\s*)(>)/,
                [{ token: "delimiter" }, { token: "tag" }, "", { token: "delimiter" }],
              ],
              [
                /(<\?)(@qualifiedName)/,
                [{ token: "delimiter" }, { token: "metatag", next: "@tag" }],
              ],
              [
                /(<\!)(@qualifiedName)/,
                [{ token: "delimiter" }, { token: "metatag", next: "@tag" }],
              ],
              [/<\!\[CDATA\[/, { token: "delimiter.cdata", next: "@cdata" }],
              [/&\w+;/, "string.escape"],
            ],
            cdata: [
              [/[^\]]+/, ""],
              [/\]\]>/, { token: "delimiter.cdata", next: "@pop" }],
              [/\]/, ""],
            ],
            tag: [
              [/[ \t\r\n]+/, ""],
              [
                /(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,
                ["attribute.name", "", "attribute.value"],
              ],
              [
                /(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,
                ["attribute.name", "", "attribute.value"],
              ],
              [
                /(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,
                ["attribute.name", "", "attribute.value"],
              ],
              [/@qualifiedName/, "attribute.name"],
              [/\?>/, { token: "delimiter", next: "@pop" }],
              [/(\/)(>)/, [{ token: "tag" }, { token: "delimiter", next: "@pop" }]],
              [/>/, { token: "delimiter", next: "@pop" }],
            ],
            whitespace: [
              [/[ \t\r\n]+/, ""],
              [/<!--/, { token: "comment", next: "@comment" }],
            ],
            comment: [
              [/[^<\-]+/, "comment.content"],
              [/-->/, { token: "comment", next: "@pop" }],
              [/<!--/, "comment.content.invalid"],
              [/[<\-]/, "comment.content"],
            ],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  U6e = {
    comments: { lineComment: "#" },
    brackets: [
      ["{", "}"],
      ["[", "]"],
      ["(", ")"],
    ],
    autoClosingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    surroundingPairs: [
      { open: "{", close: "}" },
      { open: "[", close: "]" },
      { open: "(", close: ")" },
      { open: '"', close: '"' },
      { open: "'", close: "'" },
    ],
    folding: { offSide: !0 },
    onEnterRules: [{ beforeText: /:\s*$/, action: { indentAction: VGe.IndentAction.Indent } }],
  },
  $6e = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        conf: U6e,
        language: {
          tokenPostfix: ".yaml",
          brackets: [
            { token: "delimiter.bracket", open: "{", close: "}" },
            { token: "delimiter.square", open: "[", close: "]" },
          ],
          keywords: [
            "true",
            "True",
            "TRUE",
            "false",
            "False",
            "FALSE",
            "null",
            "Null",
            "Null",
            "~",
          ],
          numberInteger: /(?:0|[+-]?[0-9]+)/,
          numberFloat: /(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,
          numberOctal: /0o[0-7]+/,
          numberHex: /0x[0-9a-fA-F]+/,
          numberInfinity: /[+-]?\.(?:inf|Inf|INF)/,
          numberNaN: /\.(?:nan|Nan|NAN)/,
          numberDate: /\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,
          escapes: /\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,
          tokenizer: {
            root: [
              { include: "@whitespace" },
              { include: "@comment" },
              [/%[^ ]+.*$/, "meta.directive"],
              [/---/, "operators.directivesEnd"],
              [/\.{3}/, "operators.documentEnd"],
              [/[-?:](?= )/, "operators"],
              { include: "@anchor" },
              { include: "@tagHandle" },
              { include: "@flowCollections" },
              { include: "@blockStyle" },
              [/@numberInteger(?![ \t]*\S+)/, "number"],
              [/@numberFloat(?![ \t]*\S+)/, "number.float"],
              [/@numberOctal(?![ \t]*\S+)/, "number.octal"],
              [/@numberHex(?![ \t]*\S+)/, "number.hex"],
              [/@numberInfinity(?![ \t]*\S+)/, "number.infinity"],
              [/@numberNaN(?![ \t]*\S+)/, "number.nan"],
              [/@numberDate(?![ \t]*\S+)/, "number.date"],
              [/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/, ["type", "white", "operators", "white"]],
              { include: "@flowScalars" },
              [/.+?(?=(\s+#|$))/, { cases: { "@keywords": "keyword", "@default": "string" } }],
            ],
            object: [
              { include: "@whitespace" },
              { include: "@comment" },
              [/\}/, "@brackets", "@pop"],
              [/,/, "delimiter.comma"],
              [/:(?= )/, "operators"],
              [/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/, "type"],
              { include: "@flowCollections" },
              { include: "@flowScalars" },
              { include: "@tagHandle" },
              { include: "@anchor" },
              { include: "@flowNumber" },
              [/[^\},]+/, { cases: { "@keywords": "keyword", "@default": "string" } }],
            ],
            array: [
              { include: "@whitespace" },
              { include: "@comment" },
              [/\]/, "@brackets", "@pop"],
              [/,/, "delimiter.comma"],
              { include: "@flowCollections" },
              { include: "@flowScalars" },
              { include: "@tagHandle" },
              { include: "@anchor" },
              { include: "@flowNumber" },
              [/[^\],]+/, { cases: { "@keywords": "keyword", "@default": "string" } }],
            ],
            multiString: [[/^( +).+$/, "string", "@multiStringContinued.$1"]],
            multiStringContinued: [
              [
                /^( *).+$/,
                {
                  cases: {
                    "$1==$S2": "string",
                    "@default": { token: "@rematch", next: "@popall" },
                  },
                },
              ],
            ],
            whitespace: [[/[ \t\r\n]+/, "white"]],
            comment: [[/#.*$/, "comment"]],
            flowCollections: [
              [/\[/, "@brackets", "@array"],
              [/\{/, "@brackets", "@object"],
            ],
            flowScalars: [
              [/"([^"\\]|\\.)*$/, "string.invalid"],
              [/'([^'\\]|\\.)*$/, "string.invalid"],
              [/'[^']*'/, "string"],
              [/"/, "string", "@doubleQuotedString"],
            ],
            doubleQuotedString: [
              [/[^\\"]+/, "string"],
              [/@escapes/, "string.escape"],
              [/\\./, "string.escape.invalid"],
              [/"/, "string", "@pop"],
            ],
            blockStyle: [[/[>|][0-9]*[+-]?$/, "operators", "@multiString"]],
            flowNumber: [
              [/@numberInteger(?=[ \t]*[,\]\}])/, "number"],
              [/@numberFloat(?=[ \t]*[,\]\}])/, "number.float"],
              [/@numberOctal(?=[ \t]*[,\]\}])/, "number.octal"],
              [/@numberHex(?=[ \t]*[,\]\}])/, "number.hex"],
              [/@numberInfinity(?=[ \t]*[,\]\}])/, "number.infinity"],
              [/@numberNaN(?=[ \t]*[,\]\}])/, "number.nan"],
              [/@numberDate(?=[ \t]*[,\]\}])/, "number.date"],
            ],
            tagHandle: [[/\![^ ]*/, "tag"]],
            anchor: [[/[&*][^ ]+/, "namespace"]],
          },
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  q6e = H.forwardRef(({ className: e, ...t }, n) =>
    Q.jsx("div", {
      ref: n,
      className: Rf("rounded-xl border bg-card text-card-foreground shadow", e),
      ...t,
    }),
  );
q6e.displayName = "Card";
const K6e = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("div", { ref: n, className: Rf("flex flex-col space-y-1.5 p-6", e), ...t }),
);
K6e.displayName = "CardHeader";
const G6e = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("h3", { ref: n, className: Rf("font-semibold leading-none tracking-tight", e), ...t }),
);
G6e.displayName = "CardTitle";
const Z6e = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("p", { ref: n, className: Rf("text-sm text-muted-foreground", e), ...t }),
);
Z6e.displayName = "CardDescription";
const Y6e = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("div", { ref: n, className: Rf("p-6 pt-0", e), ...t }),
);
Y6e.displayName = "CardContent";
const X6e = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("div", { ref: n, className: Rf("flex items-center p-6 pt-0", e), ...t }),
);
X6e.displayName = "CardFooter";
const Q6e = H.forwardRef(({ className: e, type: t, ...n }, i) =>
  Q.jsx("input", {
    type: t,
    className: Rf(
      "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
      e,
    ),
    ref: i,
    ...n,
  }),
);
Q6e.displayName = "Input";
const J6e = H.forwardRef(({ className: e, ...t }, n) => {
  const [i, r] = H.useState(!1);
  return Q.jsxs("div", {
    className: "relative rounded-md",
    children: [
      Q.jsx("input", {
        type: i ? "text" : "password",
        className: Rf(
          "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
          e,
        ),
        ref: n,
        ...t,
      }),
      Q.jsx(Nm, {
        type: "button",
        size: "icon",
        variant: "ghost",
        className:
          "absolute right-1 top-1/2 h-6 w-6 -translate-y-1/2 rounded-md text-muted-foreground",
        onClick: () => r((e) => !e),
        children: i ? Q.jsx(sm, { size: 18 }) : Q.jsx(om, { size: 18 }),
      }),
    ],
  });
});
J6e.displayName = "PasswordInput";
function e8e({ className: e, onForgotPassword: t, ...n }) {
  const i = og(),
    r = fp(),
    { t: o } = Py("auth"),
    s = gy({
      email: ly().min(1, { message: o("signIn.validation.emailRequired") }),
      password: ly()
        .min(1, { message: o("signIn.validation.passwordRequired") })
        .min(7, { message: o("signIn.validation.passwordLength") }),
    }),
    a = kv({ resolver: Ov(s), defaultValues: { email: "", password: "" } });
  return Q.jsx("div", {
    className: Rf("grid gap-6", e),
    ...n,
    children: Q.jsx(Hy, {
      ...a,
      children: Q.jsx("form", {
        onSubmit: a.handleSubmit(async function (e) {
          try {
            const { data: t } = await ((e) => IL("/passport/auth/login", e))(e);
            (!(function (e) {
              Om.set(Mm, e, 259200);
            })(t.auth_data),
              r(R0e(t.auth_data)),
              await r(T0e()).unwrap(),
              i("/"));
          } catch (D2t) {
            const t =
              "object" == typeof D2t &&
              null !== D2t &&
              "response" in D2t &&
              "string" == typeof D2t.response?.data?.message
                ? D2t.response?.data?.message
                : null;
            t && a.setError("root", { message: t });
          }
        }),
        className: "space-y-4",
        children: Q.jsxs("div", {
          className: "space-y-4",
          children: [
            a.formState.errors.root &&
              Q.jsx("div", {
                className: "text-sm text-destructive",
                children: a.formState.errors.root.message,
              }),
            Q.jsx(Uy, {
              control: a.control,
              name: "email",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  children: [
                    Q.jsx(Gy, { children: o("signIn.email") }),
                    Q.jsx(Zy, {
                      children: Q.jsx(Q6e, {
                        placeholder: o("signIn.emailPlaceholder"),
                        autoComplete: "email",
                        ...e,
                      }),
                    }),
                    Q.jsx(Xy, {}),
                  ],
                }),
            }),
            Q.jsx(Uy, {
              control: a.control,
              name: "password",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  children: [
                    Q.jsx(Gy, { children: o("signIn.password") }),
                    Q.jsx(Zy, {
                      children: Q.jsx(J6e, {
                        placeholder: o("signIn.passwordPlaceholder"),
                        autoComplete: "current-password",
                        ...e,
                      }),
                    }),
                    Q.jsx(Xy, {}),
                  ],
                }),
            }),
            Q.jsx("div", {
              className: "flex items-center justify-between",
              children: Q.jsx(Nm, {
                variant: "link",
                type: "button",
                className: "px-0 text-sm font-normal text-muted-foreground hover:text-primary",
                onClick: t,
                children: o("signIn.forgotPassword"),
              }),
            }),
            Q.jsx(Nm, {
              className: "w-full",
              size: "lg",
              loading: a.formState.isSubmitting,
              children: o("signIn.submit"),
            }),
          ],
        }),
      }),
    }),
  });
}
function t8e() {
  return (function (e) {
    const [t, n] = H.useState(() => "undefined" != typeof window && window.matchMedia(e).matches);
    return (
      H.useEffect(() => {
        if ("undefined" == typeof window) return;
        const t = window.matchMedia(e);
        n(t.matches);
        const i = (e) => {
          n(e.matches);
        };
        return (t.addEventListener("change", i), () => t.removeEventListener("change", i));
      }, [e]),
      t
    );
  })("(max-width: 767px)");
}
var n8e,
  i8e = "dismissableLayer.update",
  r8e = "dismissableLayer.pointerDownOutside",
  o8e = "dismissableLayer.focusOutside",
  s8e = H.createContext({
    layers: new Set(),
    layersWithOutsidePointerEventsDisabled: new Set(),
    branches: new Set(),
  }),
  a8e = H.forwardRef((e, t) => {
    const {
        disableOutsidePointerEvents: n = !1,
        onEscapeKeyDown: i,
        onPointerDownOutside: r,
        onFocusOutside: o,
        onInteractOutside: s,
        onDismiss: a,
        ...l
      } = e,
      c = H.useContext(s8e),
      [d, u] = H.useState(null),
      h = d?.ownerDocument ?? globalThis?.document,
      [, g] = H.useState({}),
      p = Sp(t, (e) => u(e)),
      f = Array.from(c.layers),
      [m] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1),
      _ = f.indexOf(m),
      v = d ? f.indexOf(d) : -1,
      b = c.layersWithOutsidePointerEventsDisabled.size > 0,
      y = v >= _,
      x = (function (e, t = globalThis?.document) {
        const n = fx(e),
          i = H.useRef(!1),
          r = H.useRef(() => {});
        return (
          H.useEffect(() => {
            const e = (e) => {
                if (e.target && !i.current) {
                  let i = function () {
                    c8e(r8e, n, o, { discrete: !0 });
                  };
                  const o = { originalEvent: e };
                  "touch" === e.pointerType
                    ? (t.removeEventListener("click", r.current),
                      (r.current = i),
                      t.addEventListener("click", r.current, { once: !0 }))
                    : i();
                } else t.removeEventListener("click", r.current);
                i.current = !1;
              },
              o = window.setTimeout(() => {
                t.addEventListener("pointerdown", e);
              }, 0);
            return () => {
              (window.clearTimeout(o),
                t.removeEventListener("pointerdown", e),
                t.removeEventListener("click", r.current));
            };
          }, [t, n]),
          { onPointerDownCapture: () => (i.current = !0) }
        );
      })((e) => {
        const t = e.target,
          n = [...c.branches].some((e) => e.contains(t));
        y && !n && (r?.(e), s?.(e), e.defaultPrevented || a?.());
      }, h),
      w = (function (e, t = globalThis?.document) {
        const n = fx(e),
          i = H.useRef(!1);
        return (
          H.useEffect(() => {
            const e = (e) => {
              if (e.target && !i.current) {
                c8e(o8e, n, { originalEvent: e }, { discrete: !1 });
              }
            };
            return (t.addEventListener("focusin", e), () => t.removeEventListener("focusin", e));
          }, [t, n]),
          { onFocusCapture: () => (i.current = !0), onBlurCapture: () => (i.current = !1) }
        );
      })((e) => {
        const t = e.target;
        [...c.branches].some((e) => e.contains(t)) || (o?.(e), s?.(e), e.defaultPrevented || a?.());
      }, h);
    return (
      (function (e, t = globalThis?.document) {
        const n = fx(e);
        H.useEffect(() => {
          const e = (e) => {
            "Escape" === e.key && n(e);
          };
          return (
            t.addEventListener("keydown", e, { capture: !0 }),
            () => t.removeEventListener("keydown", e, { capture: !0 })
          );
        }, [n, t]);
      })((e) => {
        v === c.layers.size - 1 && (i?.(e), !e.defaultPrevented && a && (e.preventDefault(), a()));
      }, h),
      H.useEffect(() => {
        if (d)
          return (
            n &&
              (0 === c.layersWithOutsidePointerEventsDisabled.size &&
                ((n8e = h.body.style.pointerEvents), (h.body.style.pointerEvents = "none")),
              c.layersWithOutsidePointerEventsDisabled.add(d)),
            c.layers.add(d),
            l8e(),
            () => {
              n &&
                1 === c.layersWithOutsidePointerEventsDisabled.size &&
                (h.body.style.pointerEvents = n8e);
            }
          );
      }, [d, h, n, c]),
      H.useEffect(
        () => () => {
          d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), l8e());
        },
        [d, c],
      ),
      H.useEffect(() => {
        const e = () => g({});
        return (document.addEventListener(i8e, e), () => document.removeEventListener(i8e, e));
      }, []),
      Q.jsx(gx.div, {
        ...l,
        ref: p,
        style: { pointerEvents: b ? (y ? "auto" : "none") : void 0, ...e.style },
        onFocusCapture: Qy(e.onFocusCapture, w.onFocusCapture),
        onBlurCapture: Qy(e.onBlurCapture, w.onBlurCapture),
        onPointerDownCapture: Qy(e.onPointerDownCapture, x.onPointerDownCapture),
      })
    );
  });
a8e.displayName = "DismissableLayer";
function l8e() {
  const e = new CustomEvent(i8e);
  document.dispatchEvent(e);
}
function c8e(e, t, n, { discrete: i }) {
  const r = n.originalEvent.target,
    o = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
  (t && r.addEventListener(e, t, { once: !0 }), i ? px(r, o) : r.dispatchEvent(o));
}
H.forwardRef((e, t) => {
  const n = H.useContext(s8e),
    i = H.useRef(null),
    r = Sp(t, i);
  return (
    H.useEffect(() => {
      const e = i.current;
      if (e)
        return (
          n.branches.add(e),
          () => {
            n.branches.delete(e);
          }
        );
    }, [n.branches]),
    Q.jsx(gx.div, { ...e, ref: r })
  );
}).displayName = "DismissableLayerBranch";
var d8e = "focusScope.autoFocusOnMount",
  u8e = "focusScope.autoFocusOnUnmount",
  h8e = { bubbles: !1, cancelable: !0 },
  g8e = H.forwardRef((e, t) => {
    const { loop: n = !1, trapped: i = !1, onMountAutoFocus: r, onUnmountAutoFocus: o, ...s } = e,
      [a, l] = H.useState(null),
      c = fx(r),
      d = fx(o),
      u = H.useRef(null),
      h = Sp(t, (e) => l(e)),
      g = H.useRef({
        paused: !1,
        pause() {
          this.paused = !0;
        },
        resume() {
          this.paused = !1;
        },
      }).current;
    (H.useEffect(() => {
      if (i) {
        let e = function (e) {
            if (g.paused || !a) return;
            const t = e.target;
            a.contains(t) ? (u.current = t) : _8e(u.current, { select: !0 });
          },
          t = function (e) {
            if (g.paused || !a) return;
            const t = e.relatedTarget;
            null !== t && (a.contains(t) || _8e(u.current, { select: !0 }));
          },
          n = function (e) {
            if (document.activeElement === document.body)
              for (const t of e) t.removedNodes.length > 0 && _8e(a);
          };
        (document.addEventListener("focusin", e), document.addEventListener("focusout", t));
        const i = new MutationObserver(n);
        return (
          a && i.observe(a, { childList: !0, subtree: !0 }),
          () => {
            (document.removeEventListener("focusin", e),
              document.removeEventListener("focusout", t),
              i.disconnect());
          }
        );
      }
    }, [i, a, g.paused]),
      H.useEffect(() => {
        if (a) {
          v8e.add(g);
          const t = document.activeElement;
          if (!a.contains(t)) {
            const n = new CustomEvent(d8e, h8e);
            (a.addEventListener(d8e, c),
              a.dispatchEvent(n),
              n.defaultPrevented ||
                (!(function (e, { select: t = !1 } = {}) {
                  const n = document.activeElement;
                  for (const i of e)
                    if ((_8e(i, { select: t }), document.activeElement !== n)) return;
                })(((e = p8e(a)), e.filter((e) => "A" !== e.tagName)), { select: !0 }),
                document.activeElement === t && _8e(a)));
          }
          return () => {
            (a.removeEventListener(d8e, c),
              setTimeout(() => {
                const e = new CustomEvent(u8e, h8e);
                (a.addEventListener(u8e, d),
                  a.dispatchEvent(e),
                  e.defaultPrevented || _8e(t ?? document.body, { select: !0 }),
                  a.removeEventListener(u8e, d),
                  v8e.remove(g));
              }, 0));
          };
        }
        var e;
      }, [a, c, d, g]));
    const p = H.useCallback(
      (e) => {
        if (!n && !i) return;
        if (g.paused) return;
        const t = "Tab" === e.key && !e.altKey && !e.ctrlKey && !e.metaKey,
          r = document.activeElement;
        if (t && r) {
          const t = e.currentTarget,
            [i, o] = (function (e) {
              const t = p8e(e),
                n = f8e(t, e),
                i = f8e(t.reverse(), e);
              return [n, i];
            })(t);
          i && o
            ? e.shiftKey || r !== o
              ? e.shiftKey && r === i && (e.preventDefault(), n && _8e(o, { select: !0 }))
              : (e.preventDefault(), n && _8e(i, { select: !0 }))
            : r === t && e.preventDefault();
        }
      },
      [n, i, g.paused],
    );
    return Q.jsx(gx.div, { tabIndex: -1, ...s, ref: h, onKeyDown: p });
  });
function p8e(e) {
  const t = [],
    n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
      acceptNode: (e) => {
        const t = "INPUT" === e.tagName && "hidden" === e.type;
        return e.disabled || e.hidden || t
          ? NodeFilter.FILTER_SKIP
          : e.tabIndex >= 0
            ? NodeFilter.FILTER_ACCEPT
            : NodeFilter.FILTER_SKIP;
      },
    });
  for (; n.nextNode(); ) t.push(n.currentNode);
  return t;
}
function f8e(e, t) {
  for (const n of e) if (!m8e(n, { upTo: t })) return n;
}
function m8e(e, { upTo: t }) {
  if ("hidden" === getComputedStyle(e).visibility) return !0;
  for (; e; ) {
    if (void 0 !== t && e === t) return !1;
    if ("none" === getComputedStyle(e).display) return !0;
    e = e.parentElement;
  }
  return !1;
}
function _8e(e, { select: t = !1 } = {}) {
  if (e && e.focus) {
    const n = document.activeElement;
    (e.focus({ preventScroll: !0 }),
      e !== n &&
        (function (e) {
          return e instanceof HTMLInputElement && "select" in e;
        })(e) &&
        t &&
        e.select());
  }
}
g8e.displayName = "FocusScope";
var v8e = (function () {
  let e = [];
  return {
    add(t) {
      const n = e[0];
      (t !== n && n?.pause(), (e = b8e(e, t)), e.unshift(t));
    },
    remove(t) {
      ((e = b8e(e, t)), e[0]?.resume());
    },
  };
})();
function b8e(e, t) {
  const n = [...e],
    i = n.indexOf(t);
  return (-1 !== i && n.splice(i, 1), n);
}
var y8e = H.forwardRef((e, t) => {
  const { container: n, ...i } = e,
    [r, o] = H.useState(!1);
  sx(() => o(!0), []);
  const s = n || (r && globalThis?.document?.body);
  return s ? ou.createPortal(Q.jsx(gx.div, { ...i, ref: t }), s) : null;
});
y8e.displayName = "Portal";
var x8e = 0;
function w8e() {
  H.useEffect(() => {
    const e = document.querySelectorAll("[data-radix-focus-guard]");
    return (
      document.body.insertAdjacentElement("afterbegin", e[0] ?? C8e()),
      document.body.insertAdjacentElement("beforeend", e[1] ?? C8e()),
      x8e++,
      () => {
        (1 === x8e &&
          document.querySelectorAll("[data-radix-focus-guard]").forEach((e) => e.remove()),
          x8e--);
      }
    );
  }, []);
}
function C8e() {
  const e = document.createElement("span");
  return (
    e.setAttribute("data-radix-focus-guard", ""),
    (e.tabIndex = 0),
    (e.style.outline = "none"),
    (e.style.opacity = "0"),
    (e.style.position = "fixed"),
    (e.style.pointerEvents = "none"),
    e
  );
}
var S8e = function () {
  return (
    (S8e =
      Object.assign ||
      function (e) {
        for (var t, n = 1, i = arguments.length; n < i; n++)
          for (var r in (t = arguments[n]))
            Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
        return e;
      }),
    S8e.apply(this, arguments)
  );
};
function k8e(e, t) {
  var n = {};
  for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
  if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
    var r = 0;
    for (i = Object.getOwnPropertySymbols(e); r < i.length; r++)
      t.indexOf(i[r]) < 0 &&
        Object.prototype.propertyIsEnumerable.call(e, i[r]) &&
        (n[i[r]] = e[i[r]]);
  }
  return n;
}
function E8e(e, t, n) {
  if (n || 2 === arguments.length)
    for (var i, r = 0, o = t.length; r < o; r++)
      (!i && r in t) || (i || (i = Array.prototype.slice.call(t, 0, r)), (i[r] = t[r]));
  return e.concat(i || Array.prototype.slice.call(t));
}
"function" == typeof SuppressedError && SuppressedError;
var N8e = "right-scroll-bar-position",
  L8e = "width-before-scroll-bar";
function D8e(e, t) {
  return ("function" == typeof e ? e(t) : e && (e.current = t), e);
}
var T8e = "undefined" != typeof window ? H.useLayoutEffect : H.useEffect,
  I8e = new WeakMap();
function R8e(e, t) {
  var n,
    i,
    r,
    o =
      ((n = null),
      (i = function (t) {
        return e.forEach(function (e) {
          return D8e(e, t);
        });
      }),
      (r = H.useState(function () {
        return {
          value: n,
          callback: i,
          facade: {
            get current() {
              return r.value;
            },
            set current(e) {
              var t = r.value;
              t !== e && ((r.value = e), r.callback(e, t));
            },
          },
        };
      })[0]),
      (r.callback = i),
      r.facade);
  return (
    T8e(
      function () {
        var t = I8e.get(o);
        if (t) {
          var n = new Set(t),
            i = new Set(e),
            r = o.current;
          (n.forEach(function (e) {
            i.has(e) || D8e(e, null);
          }),
            i.forEach(function (e) {
              n.has(e) || D8e(e, r);
            }));
        }
        I8e.set(o, e);
      },
      [e],
    ),
    o
  );
}
function O8e(e) {
  return e;
}
function M8e(e) {
  void 0 === e && (e = {});
  var t = (function (e, t) {
    void 0 === t && (t = O8e);
    var n = [],
      i = !1,
      r = {
        read: function () {
          if (i)
            throw new Error(
              "Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.",
            );
          return n.length ? n[n.length - 1] : e;
        },
        useMedium: function (e) {
          var r = t(e, i);
          return (
            n.push(r),
            function () {
              n = n.filter(function (e) {
                return e !== r;
              });
            }
          );
        },
        assignSyncMedium: function (e) {
          for (i = !0; n.length; ) {
            var t = n;
            ((n = []), t.forEach(e));
          }
          n = {
            push: function (t) {
              return e(t);
            },
            filter: function () {
              return n;
            },
          };
        },
        assignMedium: function (e) {
          i = !0;
          var t = [];
          if (n.length) {
            var r = n;
            ((n = []), r.forEach(e), (t = n));
          }
          var o = function () {
              var n = t;
              ((t = []), n.forEach(e));
            },
            s = function () {
              return Promise.resolve().then(o);
            };
          (s(),
            (n = {
              push: function (e) {
                (t.push(e), s());
              },
              filter: function (e) {
                return ((t = t.filter(e)), n);
              },
            }));
        },
      };
    return r;
  })(null);
  return ((t.options = S8e({ async: !0, ssr: !1 }, e)), t);
}
var A8e = function (e) {
  var t = e.sideCar,
    n = k8e(e, ["sideCar"]);
  if (!t) throw new Error("Sidecar: please provide `sideCar` property to import the right car");
  var i = t.read();
  if (!i) throw new Error("Sidecar medium not found");
  return H.createElement(i, S8e({}, n));
};
function P8e(e, t) {
  return (e.useMedium(t), A8e);
}
A8e.isSideCarExport = !0;
var j8e = M8e(),
  F8e = function () {},
  B8e = H.forwardRef(function (e, t) {
    var n = H.useRef(null),
      i = H.useState({ onScrollCapture: F8e, onWheelCapture: F8e, onTouchMoveCapture: F8e }),
      r = i[0],
      o = i[1],
      s = e.forwardProps,
      a = e.children,
      l = e.className,
      c = e.removeScrollBar,
      d = e.enabled,
      u = e.shards,
      h = e.sideCar,
      g = e.noRelative,
      p = e.noIsolation,
      f = e.inert,
      m = e.allowPinchZoom,
      _ = e.as,
      v = void 0 === _ ? "div" : _,
      b = e.gapMode,
      y = k8e(e, [
        "forwardProps",
        "children",
        "className",
        "removeScrollBar",
        "enabled",
        "shards",
        "sideCar",
        "noRelative",
        "noIsolation",
        "inert",
        "allowPinchZoom",
        "as",
        "gapMode",
      ]),
      x = h,
      w = R8e([n, t]),
      C = S8e(S8e({}, y), r);
    return H.createElement(
      H.Fragment,
      null,
      d &&
        H.createElement(x, {
          sideCar: j8e,
          removeScrollBar: c,
          shards: u,
          noRelative: g,
          noIsolation: p,
          inert: f,
          setCallbacks: o,
          allowPinchZoom: !!m,
          lockRef: n,
          gapMode: b,
        }),
      s
        ? H.cloneElement(H.Children.only(a), S8e(S8e({}, C), { ref: w }))
        : H.createElement(v, S8e({}, C, { className: l, ref: w }), a),
    );
  });
((B8e.defaultProps = { enabled: !0, removeScrollBar: !0, inert: !1 }),
  (B8e.classNames = { fullWidth: L8e, zeroRight: N8e }));
function V8e() {
  if (!document) return null;
  var e = document.createElement("style");
  e.type = "text/css";
  var t = (function () {
    if ("undefined" != typeof __webpack_nonce__) return __webpack_nonce__;
  })();
  return (t && e.setAttribute("nonce", t), e);
}
var W8e = function () {
    var e = 0,
      t = null;
    return {
      add: function (n) {
        (0 == e &&
          (t = V8e()) &&
          ((function (e, t) {
            e.styleSheet ? (e.styleSheet.cssText = t) : e.appendChild(document.createTextNode(t));
          })(t, n),
          (function (e) {
            (document.head || document.getElementsByTagName("head")[0]).appendChild(e);
          })(t)),
          e++);
      },
      remove: function () {
        !--e && t && (t.parentNode && t.parentNode.removeChild(t), (t = null));
      },
    };
  },
  H8e = function () {
    var e,
      t =
        ((e = W8e()),
        function (t, n) {
          H.useEffect(
            function () {
              return (
                e.add(t),
                function () {
                  e.remove();
                }
              );
            },
            [t && n],
          );
        });
    return function (e) {
      var n = e.styles,
        i = e.dynamic;
      return (t(n, i), null);
    };
  },
  z8e = { left: 0, top: 0, right: 0, gap: 0 },
  U8e = function (e) {
    return parseInt(e || "", 10) || 0;
  },
  $8e = function (e) {
    if ((void 0 === e && (e = "margin"), "undefined" == typeof window)) return z8e;
    var t = (function (e) {
        var t = window.getComputedStyle(document.body),
          n = t["padding" === e ? "paddingLeft" : "marginLeft"],
          i = t["padding" === e ? "paddingTop" : "marginTop"],
          r = t["padding" === e ? "paddingRight" : "marginRight"];
        return [U8e(n), U8e(i), U8e(r)];
      })(e),
      n = document.documentElement.clientWidth,
      i = window.innerWidth;
    return { left: t[0], top: t[1], right: t[2], gap: Math.max(0, i - n + t[2] - t[0]) };
  },
  q8e = H8e(),
  K8e = "data-scroll-locked",
  G8e = function (e, t, n, i) {
    var r = e.left,
      o = e.top,
      s = e.right,
      a = e.gap;
    return (
      void 0 === n && (n = "margin"),
      "\n  ."
        .concat("with-scroll-bars-hidden", " {\n   overflow: hidden ")
        .concat(i, ";\n   padding-right: ")
        .concat(a, "px ")
        .concat(i, ";\n  }\n  body[")
        .concat(K8e, "] {\n    overflow: hidden ")
        .concat(i, ";\n    overscroll-behavior: contain;\n    ")
        .concat(
          [
            t && "position: relative ".concat(i, ";"),
            "margin" === n &&
              "\n    padding-left: "
                .concat(r, "px;\n    padding-top: ")
                .concat(o, "px;\n    padding-right: ")
                .concat(s, "px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ")
                .concat(a, "px ")
                .concat(i, ";\n    "),
            "padding" === n && "padding-right: ".concat(a, "px ").concat(i, ";"),
          ]
            .filter(Boolean)
            .join(""),
          "\n  }\n  \n  .",
        )
        .concat(N8e, " {\n    right: ")
        .concat(a, "px ")
        .concat(i, ";\n  }\n  \n  .")
        .concat(L8e, " {\n    margin-right: ")
        .concat(a, "px ")
        .concat(i, ";\n  }\n  \n  .")
        .concat(N8e, " .")
        .concat(N8e, " {\n    right: 0 ")
        .concat(i, ";\n  }\n  \n  .")
        .concat(L8e, " .")
        .concat(L8e, " {\n    margin-right: 0 ")
        .concat(i, ";\n  }\n  \n  body[")
        .concat(K8e, "] {\n    ")
        .concat("--removed-body-scroll-bar-size", ": ")
        .concat(a, "px;\n  }\n")
    );
  },
  Z8e = function () {
    var e = parseInt(document.body.getAttribute(K8e) || "0", 10);
    return isFinite(e) ? e : 0;
  },
  Y8e = function (e) {
    var t = e.noRelative,
      n = e.noImportant,
      i = e.gapMode,
      r = void 0 === i ? "margin" : i;
    H.useEffect(function () {
      return (
        document.body.setAttribute(K8e, (Z8e() + 1).toString()),
        function () {
          var e = Z8e() - 1;
          e <= 0
            ? document.body.removeAttribute(K8e)
            : document.body.setAttribute(K8e, e.toString());
        }
      );
    }, []);
    var o = H.useMemo(
      function () {
        return $8e(r);
      },
      [r],
    );
    return H.createElement(q8e, { styles: G8e(o, !t, r, n ? "" : "!important") });
  },
  X8e = !1;
if ("undefined" != typeof window)
  try {
    var Q8e = Object.defineProperty({}, "passive", {
      get: function () {
        return ((X8e = !0), !0);
      },
    });
    (window.addEventListener("test", Q8e, Q8e), window.removeEventListener("test", Q8e, Q8e));
  } catch (W8t) {
    X8e = !1;
  }
var J8e = !!X8e && { passive: !1 },
  e9e = function (e, t) {
    if (!(e instanceof Element)) return !1;
    var n = window.getComputedStyle(e);
    return (
      "hidden" !== n[t] &&
      !(
        n.overflowY === n.overflowX &&
        !(function (e) {
          return "TEXTAREA" === e.tagName;
        })(e) &&
        "visible" === n[t]
      )
    );
  },
  t9e = function (e, t) {
    var n = t.ownerDocument,
      i = t;
    do {
      if (
        ("undefined" != typeof ShadowRoot && i instanceof ShadowRoot && (i = i.host), n9e(e, i))
      ) {
        var r = i9e(e, i);
        if (r[1] > r[2]) return !0;
      }
      i = i.parentNode;
    } while (i && i !== n.body);
    return !1;
  },
  n9e = function (e, t) {
    return "v" === e
      ? (function (e) {
          return e9e(e, "overflowY");
        })(t)
      : (function (e) {
          return e9e(e, "overflowX");
        })(t);
  },
  i9e = function (e, t) {
    return "v" === e
      ? (function (e) {
          return [e.scrollTop, e.scrollHeight, e.clientHeight];
        })(t)
      : (function (e) {
          return [e.scrollLeft, e.scrollWidth, e.clientWidth];
        })(t);
  },
  r9e = function (e) {
    return "changedTouches" in e
      ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY]
      : [0, 0];
  },
  o9e = function (e) {
    return [e.deltaX, e.deltaY];
  },
  s9e = function (e) {
    return e && "current" in e ? e.current : e;
  },
  a9e = function (e) {
    return "\n  .block-interactivity-"
      .concat(e, " {pointer-events: none;}\n  .allow-interactivity-")
      .concat(e, " {pointer-events: all;}\n");
  },
  l9e = 0,
  c9e = [];
function d9e(e) {
  for (var t = null; null !== e; )
    (e instanceof ShadowRoot && ((t = e.host), (e = e.host)), (e = e.parentNode));
  return t;
}
const u9e = P8e(j8e, function (e) {
  var t = H.useRef([]),
    n = H.useRef([0, 0]),
    i = H.useRef(),
    r = H.useState(l9e++)[0],
    o = H.useState(H8e)[0],
    s = H.useRef(e);
  (H.useEffect(
    function () {
      s.current = e;
    },
    [e],
  ),
    H.useEffect(
      function () {
        if (e.inert) {
          document.body.classList.add("block-interactivity-".concat(r));
          var t = E8e([e.lockRef.current], (e.shards || []).map(s9e), !0).filter(Boolean);
          return (
            t.forEach(function (e) {
              return e.classList.add("allow-interactivity-".concat(r));
            }),
            function () {
              (document.body.classList.remove("block-interactivity-".concat(r)),
                t.forEach(function (e) {
                  return e.classList.remove("allow-interactivity-".concat(r));
                }));
            }
          );
        }
      },
      [e.inert, e.lockRef.current, e.shards],
    ));
  var a = H.useCallback(function (e, t) {
      if (("touches" in e && 2 === e.touches.length) || ("wheel" === e.type && e.ctrlKey))
        return !s.current.allowPinchZoom;
      var r,
        o = r9e(e),
        a = n.current,
        l = "deltaX" in e ? e.deltaX : a[0] - o[0],
        c = "deltaY" in e ? e.deltaY : a[1] - o[1],
        d = e.target,
        u = Math.abs(l) > Math.abs(c) ? "h" : "v";
      if ("touches" in e && "h" === u && "range" === d.type) return !1;
      var h = window.getSelection(),
        g = h && h.anchorNode;
      if (!!g && (g === d || g.contains(d))) return !1;
      var p = t9e(u, d);
      if (!p) return !0;
      if ((p ? (r = u) : ((r = "v" === u ? "h" : "v"), (p = t9e(u, d))), !p)) return !1;
      if ((!i.current && "changedTouches" in e && (l || c) && (i.current = r), !r)) return !0;
      var f = i.current || r;
      return (function (e, t, n, i) {
        var r = (function (e, t) {
            return "h" === e && "rtl" === t ? -1 : 1;
          })(e, window.getComputedStyle(t).direction),
          o = r * i,
          s = n.target,
          a = t.contains(s),
          l = !1,
          c = o > 0,
          d = 0,
          u = 0;
        do {
          if (!s) break;
          var h = i9e(e, s),
            g = h[0],
            p = h[1] - h[2] - r * g;
          (g || p) && n9e(e, s) && ((d += p), (u += g));
          var f = s.parentNode;
          s = f && f.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? f.host : f;
        } while ((!a && s !== document.body) || (a && (t.contains(s) || t === s)));
        return (((c && Math.abs(d) < 1) || (!c && Math.abs(u) < 1)) && (l = !0), l);
      })(f, t, e, "h" === f ? l : c);
    }, []),
    l = H.useCallback(function (e) {
      var n = e;
      if (c9e.length && c9e[c9e.length - 1] === o) {
        var i = "deltaY" in n ? o9e(n) : r9e(n),
          r = t.current.filter(function (e) {
            return (
              e.name === n.type &&
              (e.target === n.target || n.target === e.shadowParent) &&
              (function (e, t) {
                return e[0] === t[0] && e[1] === t[1];
              })(e.delta, i)
            );
          })[0];
        if (r && r.should) n.cancelable && n.preventDefault();
        else if (!r) {
          var l = (s.current.shards || [])
            .map(s9e)
            .filter(Boolean)
            .filter(function (e) {
              return e.contains(n.target);
            });
          (l.length > 0 ? a(n, l[0]) : !s.current.noIsolation) &&
            n.cancelable &&
            n.preventDefault();
        }
      }
    }, []),
    c = H.useCallback(function (e, n, i, r) {
      var o = { name: e, delta: n, target: i, should: r, shadowParent: d9e(i) };
      (t.current.push(o),
        setTimeout(function () {
          t.current = t.current.filter(function (e) {
            return e !== o;
          });
        }, 1));
    }, []),
    d = H.useCallback(function (e) {
      ((n.current = r9e(e)), (i.current = void 0));
    }, []),
    u = H.useCallback(function (t) {
      c(t.type, o9e(t), t.target, a(t, e.lockRef.current));
    }, []),
    h = H.useCallback(function (t) {
      c(t.type, r9e(t), t.target, a(t, e.lockRef.current));
    }, []);
  H.useEffect(function () {
    return (
      c9e.push(o),
      e.setCallbacks({ onScrollCapture: u, onWheelCapture: u, onTouchMoveCapture: h }),
      document.addEventListener("wheel", l, J8e),
      document.addEventListener("touchmove", l, J8e),
      document.addEventListener("touchstart", d, J8e),
      function () {
        ((c9e = c9e.filter(function (e) {
          return e !== o;
        })),
          document.removeEventListener("wheel", l, J8e),
          document.removeEventListener("touchmove", l, J8e),
          document.removeEventListener("touchstart", d, J8e));
      }
    );
  }, []);
  var g = e.removeScrollBar,
    p = e.inert;
  return H.createElement(
    H.Fragment,
    null,
    p ? H.createElement(o, { styles: a9e(r) }) : null,
    g ? H.createElement(Y8e, { noRelative: e.noRelative, gapMode: e.gapMode }) : null,
  );
});
var h9e = H.forwardRef(function (e, t) {
  return H.createElement(B8e, S8e({}, e, { ref: t, sideCar: u9e }));
});
h9e.classNames = B8e.classNames;
var g9e = new WeakMap(),
  p9e = new WeakMap(),
  f9e = {},
  m9e = 0,
  _9e = function (e) {
    return e && (e.host || _9e(e.parentNode));
  },
  v9e = function (e, t, n, i) {
    var r = (function (e, t) {
      return t
        .map(function (t) {
          if (e.contains(t)) return t;
          var n = _9e(t);
          return n && e.contains(n) ? n : null;
        })
        .filter(function (e) {
          return Boolean(e);
        });
    })(t, Array.isArray(e) ? e : [e]);
    f9e[n] || (f9e[n] = new WeakMap());
    var o = f9e[n],
      s = [],
      a = new Set(),
      l = new Set(r),
      c = function (e) {
        e && !a.has(e) && (a.add(e), c(e.parentNode));
      };
    r.forEach(c);
    var d = function (e) {
      e &&
        !l.has(e) &&
        Array.prototype.forEach.call(e.children, function (e) {
          if (a.has(e)) d(e);
          else
            try {
              var t = e.getAttribute(i),
                r = null !== t && "false" !== t,
                l = (g9e.get(e) || 0) + 1,
                c = (o.get(e) || 0) + 1;
              (g9e.set(e, l),
                o.set(e, c),
                s.push(e),
                1 === l && r && p9e.set(e, !0),
                1 === c && e.setAttribute(n, "true"),
                r || e.setAttribute(i, "true"));
            } catch (spt) {}
        });
    };
    return (
      d(t),
      a.clear(),
      m9e++,
      function () {
        (s.forEach(function (e) {
          var t = g9e.get(e) - 1,
            r = o.get(e) - 1;
          (g9e.set(e, t),
            o.set(e, r),
            t || (p9e.has(e) || e.removeAttribute(i), p9e.delete(e)),
            r || e.removeAttribute(n));
        }),
          --m9e ||
            ((g9e = new WeakMap()), (g9e = new WeakMap()), (p9e = new WeakMap()), (f9e = {})));
      }
    );
  },
  b9e = function (e, t, n) {
    void 0 === n && (n = "data-aria-hidden");
    var i = Array.from(Array.isArray(e) ? e : [e]),
      r = (function (e) {
        return "undefined" == typeof document
          ? null
          : (Array.isArray(e) ? e[0] : e).ownerDocument.body;
      })(e);
    return r
      ? (i.push.apply(i, Array.from(r.querySelectorAll("[aria-live], script"))),
        v9e(i, r, n, "aria-hidden"))
      : function () {
          return null;
        };
  };
function y9e(e) {
  const t = H.forwardRef((e, t) => {
    const { children: n, ...i } = e;
    if (H.isValidElement(n)) {
      const e = (function (e) {
          let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get,
            n = t && "isReactWarning" in t && t.isReactWarning;
          if (n) return e.ref;
          if (
            ((t = Object.getOwnPropertyDescriptor(e, "ref")?.get),
            (n = t && "isReactWarning" in t && t.isReactWarning),
            n)
          )
            return e.props.ref;
          return e.props.ref || e.ref;
        })(n),
        r = (function (e, t) {
          const n = { ...t };
          for (const i in t) {
            const r = e[i],
              o = t[i];
            /^on[A-Z]/.test(i)
              ? r && o
                ? (n[i] = (...e) => {
                    const t = o(...e);
                    return (r(...e), t);
                  })
                : r && (n[i] = r)
              : "style" === i
                ? (n[i] = { ...r, ...o })
                : "className" === i && (n[i] = [r, o].filter(Boolean).join(" "));
          }
          return { ...e, ...n };
        })(i, n.props);
      return (n.type !== H.Fragment && (r.ref = t ? Cp(t, e) : e), H.cloneElement(n, r));
    }
    return H.Children.count(n) > 1 ? H.Children.only(null) : null;
  });
  return ((t.displayName = `${e}.SlotClone`), t);
}
var x9e = Symbol("radix.slottable");
function w9e(e) {
  return (
    H.isValidElement(e) &&
    "function" == typeof e.type &&
    "__radixId" in e.type &&
    e.type.__radixId === x9e
  );
}
var C9e = "Dialog",
  [S9e, k9e] = Jy(C9e),
  [E9e, N9e] = S9e(C9e),
  L9e = (e) => {
    const {
        __scopeDialog: t,
        children: n,
        open: i,
        defaultOpen: r,
        onOpenChange: o,
        modal: s = !0,
      } = e,
      a = H.useRef(null),
      l = H.useRef(null),
      [c, d] = _x({ prop: i, defaultProp: r ?? !1, onChange: o, caller: C9e });
    return Q.jsx(E9e, {
      scope: t,
      triggerRef: a,
      contentRef: l,
      contentId: cx(),
      titleId: cx(),
      descriptionId: cx(),
      open: c,
      onOpenChange: d,
      onOpenToggle: H.useCallback(() => d((e) => !e), [d]),
      modal: s,
      children: n,
    });
  };
L9e.displayName = C9e;
var D9e = "DialogTrigger",
  T9e = H.forwardRef((e, t) => {
    const { __scopeDialog: n, ...i } = e,
      r = N9e(D9e, n),
      o = Sp(t, r.triggerRef);
    return Q.jsx(gx.button, {
      type: "button",
      "aria-haspopup": "dialog",
      "aria-expanded": r.open,
      "aria-controls": r.contentId,
      "data-state": Y9e(r.open),
      ...i,
      ref: o,
      onClick: Qy(e.onClick, r.onOpenToggle),
    });
  });
T9e.displayName = D9e;
var I9e = "DialogPortal",
  [R9e, O9e] = S9e(I9e, { forceMount: void 0 }),
  M9e = (e) => {
    const { __scopeDialog: t, forceMount: n, children: i, container: r } = e,
      o = N9e(I9e, t);
    return Q.jsx(R9e, {
      scope: t,
      forceMount: n,
      children: H.Children.map(i, (e) =>
        Q.jsx(Fx, {
          present: n || o.open,
          children: Q.jsx(y8e, { asChild: !0, container: r, children: e }),
        }),
      ),
    });
  };
M9e.displayName = I9e;
var A9e = "DialogOverlay",
  P9e = H.forwardRef((e, t) => {
    const n = O9e(A9e, e.__scopeDialog),
      { forceMount: i = n.forceMount, ...r } = e,
      o = N9e(A9e, e.__scopeDialog);
    return o.modal
      ? Q.jsx(Fx, { present: i || o.open, children: Q.jsx(F9e, { ...r, ref: t }) })
      : null;
  });
P9e.displayName = A9e;
var j9e = (function (e) {
    const t = y9e(e),
      n = H.forwardRef((e, n) => {
        const { children: i, ...r } = e,
          o = H.Children.toArray(i),
          s = o.find(w9e);
        if (s) {
          const e = s.props.children,
            i = o.map((t) =>
              t === s
                ? H.Children.count(e) > 1
                  ? H.Children.only(null)
                  : H.isValidElement(e)
                    ? e.props.children
                    : null
                : t,
            );
          return Q.jsx(t, {
            ...r,
            ref: n,
            children: H.isValidElement(e) ? H.cloneElement(e, void 0, i) : null,
          });
        }
        return Q.jsx(t, { ...r, ref: n, children: i });
      });
    return ((n.displayName = `${e}.Slot`), n);
  })("DialogOverlay.RemoveScroll"),
  F9e = H.forwardRef((e, t) => {
    const { __scopeDialog: n, ...i } = e,
      r = N9e(A9e, n);
    return Q.jsx(h9e, {
      as: j9e,
      allowPinchZoom: !0,
      shards: [r.contentRef],
      children: Q.jsx(gx.div, {
        "data-state": Y9e(r.open),
        ...i,
        ref: t,
        style: { pointerEvents: "auto", ...i.style },
      }),
    });
  }),
  B9e = "DialogContent",
  V9e = H.forwardRef((e, t) => {
    const n = O9e(B9e, e.__scopeDialog),
      { forceMount: i = n.forceMount, ...r } = e,
      o = N9e(B9e, e.__scopeDialog);
    return Q.jsx(Fx, {
      present: i || o.open,
      children: o.modal ? Q.jsx(W9e, { ...r, ref: t }) : Q.jsx(H9e, { ...r, ref: t }),
    });
  });
V9e.displayName = B9e;
var W9e = H.forwardRef((e, t) => {
    const n = N9e(B9e, e.__scopeDialog),
      i = H.useRef(null),
      r = Sp(t, n.contentRef, i);
    return (
      H.useEffect(() => {
        const e = i.current;
        if (e) return b9e(e);
      }, []),
      Q.jsx(z9e, {
        ...e,
        ref: r,
        trapFocus: n.open,
        disableOutsidePointerEvents: !0,
        onCloseAutoFocus: Qy(e.onCloseAutoFocus, (e) => {
          (e.preventDefault(), n.triggerRef.current?.focus());
        }),
        onPointerDownOutside: Qy(e.onPointerDownOutside, (e) => {
          const t = e.detail.originalEvent,
            n = 0 === t.button && !0 === t.ctrlKey;
          (2 === t.button || n) && e.preventDefault();
        }),
        onFocusOutside: Qy(e.onFocusOutside, (e) => e.preventDefault()),
      })
    );
  }),
  H9e = H.forwardRef((e, t) => {
    const n = N9e(B9e, e.__scopeDialog),
      i = H.useRef(!1),
      r = H.useRef(!1);
    return Q.jsx(z9e, {
      ...e,
      ref: t,
      trapFocus: !1,
      disableOutsidePointerEvents: !1,
      onCloseAutoFocus: (t) => {
        (e.onCloseAutoFocus?.(t),
          t.defaultPrevented || (i.current || n.triggerRef.current?.focus(), t.preventDefault()),
          (i.current = !1),
          (r.current = !1));
      },
      onInteractOutside: (t) => {
        (e.onInteractOutside?.(t),
          t.defaultPrevented ||
            ((i.current = !0), "pointerdown" === t.detail.originalEvent.type && (r.current = !0)));
        const o = t.target,
          s = n.triggerRef.current?.contains(o);
        (s && t.preventDefault(),
          "focusin" === t.detail.originalEvent.type && r.current && t.preventDefault());
      },
    });
  }),
  z9e = H.forwardRef((e, t) => {
    const { __scopeDialog: n, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...s } = e,
      a = N9e(B9e, n),
      l = H.useRef(null),
      c = Sp(t, l);
    return (
      w8e(),
      Q.jsxs(Q.Fragment, {
        children: [
          Q.jsx(g8e, {
            asChild: !0,
            loop: !0,
            trapped: i,
            onMountAutoFocus: r,
            onUnmountAutoFocus: o,
            children: Q.jsx(a8e, {
              role: "dialog",
              id: a.contentId,
              "aria-describedby": a.descriptionId,
              "aria-labelledby": a.titleId,
              "data-state": Y9e(a.open),
              ...s,
              ref: c,
              onDismiss: () => a.onOpenChange(!1),
            }),
          }),
          Q.jsxs(Q.Fragment, {
            children: [
              Q.jsx(e7e, { titleId: a.titleId }),
              Q.jsx(t7e, { contentRef: l, descriptionId: a.descriptionId }),
            ],
          }),
        ],
      })
    );
  }),
  U9e = "DialogTitle",
  $9e = H.forwardRef((e, t) => {
    const { __scopeDialog: n, ...i } = e,
      r = N9e(U9e, n);
    return Q.jsx(gx.h2, { id: r.titleId, ...i, ref: t });
  });
$9e.displayName = U9e;
var q9e = "DialogDescription",
  K9e = H.forwardRef((e, t) => {
    const { __scopeDialog: n, ...i } = e,
      r = N9e(q9e, n);
    return Q.jsx(gx.p, { id: r.descriptionId, ...i, ref: t });
  });
K9e.displayName = q9e;
var G9e = "DialogClose",
  Z9e = H.forwardRef((e, t) => {
    const { __scopeDialog: n, ...i } = e,
      r = N9e(G9e, n);
    return Q.jsx(gx.button, {
      type: "button",
      ...i,
      ref: t,
      onClick: Qy(e.onClick, () => r.onOpenChange(!1)),
    });
  });
function Y9e(e) {
  return e ? "open" : "closed";
}
Z9e.displayName = G9e;
var X9e = "DialogTitleWarning",
  [Q9e, J9e] = (function (e, t) {
    const n = H.createContext(t),
      i = (e) => {
        const { children: t, ...i } = e,
          r = H.useMemo(() => i, Object.values(i));
        return Q.jsx(n.Provider, { value: r, children: t });
      };
    return (
      (i.displayName = e + "Provider"),
      [
        i,
        function (i) {
          const r = H.useContext(n);
          if (r) return r;
          if (void 0 !== t) return t;
          throw new Error(`\`${i}\` must be used within \`${e}\``);
        },
      ]
    );
  })(X9e, { contentName: B9e, titleName: U9e, docsSlug: "dialog" }),
  e7e = ({ titleId: e }) => {
    const t = J9e(X9e),
      n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
    return (
      H.useEffect(() => {
        if (e) {
          document.getElementById(e);
        }
      }, [n, e]),
      null
    );
  },
  t7e = ({ contentRef: e, descriptionId: t }) => {
    const n = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${J9e("DialogDescriptionWarning").contentName}}.`;
    return (
      H.useEffect(() => {
        const n = e.current?.getAttribute("aria-describedby");
        if (t && n) {
          document.getElementById(t);
        }
      }, [n, e, t]),
      null
    );
  },
  n7e = L9e,
  i7e = T9e,
  r7e = M9e,
  o7e = P9e,
  s7e = V9e,
  a7e = $9e,
  l7e = K9e,
  c7e = Z9e;
function d7e(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = {},
    o = Object.keys(e);
  for (i = 0; i < o.length; i++) ((n = o[i]), t.indexOf(n) >= 0 || (r[n] = e[n]));
  return r;
}
var u7e = ["color"],
  h7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, u7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  g7e = ["color"],
  p7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, g7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  f7e = ["color"],
  m7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, f7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  _7e = ["color"],
  v7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, _7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  b7e = ["color"],
  y7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, b7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  x7e = ["color"],
  w7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, x7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  C7e = ["color"],
  S7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, C7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M0.877075 7.49991C0.877075 3.84222 3.84222 0.877075 7.49991 0.877075C11.1576 0.877075 14.1227 3.84222 14.1227 7.49991C14.1227 11.1576 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1576 0.877075 7.49991ZM7.49991 1.82708C4.36689 1.82708 1.82708 4.36689 1.82708 7.49991C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49991C13.1727 4.36689 10.6329 1.82708 7.49991 1.82708Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  k7e = ["color"],
  E7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, k7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  N7e = ["color"],
  L7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, N7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704ZM9.85358 5.14644C10.0488 5.3417 10.0488 5.65829 9.85358 5.85355L8.20713 7.49999L9.85358 9.14644C10.0488 9.3417 10.0488 9.65829 9.85358 9.85355C9.65832 10.0488 9.34173 10.0488 9.14647 9.85355L7.50002 8.2071L5.85358 9.85355C5.65832 10.0488 5.34173 10.0488 5.14647 9.85355C4.95121 9.65829 4.95121 9.3417 5.14647 9.14644L6.79292 7.49999L5.14647 5.85355C4.95121 5.65829 4.95121 5.3417 5.14647 5.14644C5.34173 4.95118 5.65832 4.95118 5.85358 5.14644L7.50002 6.79289L9.14647 5.14644C9.34173 4.95118 9.65832 4.95118 9.85358 5.14644Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  D7e = ["color"],
  T7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, D7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",
        fill: i,
      }),
    );
  }),
  I7e = ["color"],
  R7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, I7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  O7e = ["color"],
  M7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, O7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  A7e = ["color"],
  P7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, A7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M5.5 4.625C6.12132 4.625 6.625 4.12132 6.625 3.5C6.625 2.87868 6.12132 2.375 5.5 2.375C4.87868 2.375 4.375 2.87868 4.375 3.5C4.375 4.12132 4.87868 4.625 5.5 4.625ZM9.5 4.625C10.1213 4.625 10.625 4.12132 10.625 3.5C10.625 2.87868 10.1213 2.375 9.5 2.375C8.87868 2.375 8.375 2.87868 8.375 3.5C8.375 4.12132 8.87868 4.625 9.5 4.625ZM10.625 7.5C10.625 8.12132 10.1213 8.625 9.5 8.625C8.87868 8.625 8.375 8.12132 8.375 7.5C8.375 6.87868 8.87868 6.375 9.5 6.375C10.1213 6.375 10.625 6.87868 10.625 7.5ZM5.5 8.625C6.12132 8.625 6.625 8.12132 6.625 7.5C6.625 6.87868 6.12132 6.375 5.5 6.375C4.87868 6.375 4.375 6.87868 4.375 7.5C4.375 8.12132 4.87868 8.625 5.5 8.625ZM10.625 11.5C10.625 12.1213 10.1213 12.625 9.5 12.625C8.87868 12.625 8.375 12.1213 8.375 11.5C8.375 10.8787 8.87868 10.375 9.5 10.375C10.1213 10.375 10.625 10.8787 10.625 11.5ZM5.5 12.625C6.12132 12.625 6.625 12.1213 6.625 11.5C6.625 10.8787 6.12132 10.375 5.5 10.375C4.87868 10.375 4.375 10.8787 4.375 11.5C4.375 12.1213 4.87868 12.625 5.5 12.625Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  j7e = ["color"],
  F7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, j7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  B7e = ["color"],
  V7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, B7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  W7e = ["color"],
  H7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, W7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M12.1464 1.14645C12.3417 0.951184 12.6583 0.951184 12.8535 1.14645L14.8535 3.14645C15.0488 3.34171 15.0488 3.65829 14.8535 3.85355L10.9109 7.79618C10.8349 7.87218 10.7471 7.93543 10.651 7.9835L6.72359 9.94721C6.53109 10.0435 6.29861 10.0057 6.14643 9.85355C5.99425 9.70137 5.95652 9.46889 6.05277 9.27639L8.01648 5.34897C8.06455 5.25283 8.1278 5.16507 8.2038 5.08907L12.1464 1.14645ZM12.5 2.20711L8.91091 5.79618L7.87266 7.87267L8.12731 8.12732L10.2038 7.08907L13.7929 3.5L12.5 2.20711ZM9.99998 2L8.99998 3H4.9C4.47171 3 4.18056 3.00039 3.95552 3.01877C3.73631 3.03668 3.62421 3.06915 3.54601 3.10899C3.35785 3.20487 3.20487 3.35785 3.10899 3.54601C3.06915 3.62421 3.03669 3.73631 3.01878 3.95552C3.00039 4.18056 3 4.47171 3 4.9V11.1C3 11.5283 3.00039 11.8194 3.01878 12.0445C3.03669 12.2637 3.06915 12.3758 3.10899 12.454C3.20487 12.6422 3.35785 12.7951 3.54601 12.891C3.62421 12.9309 3.73631 12.9633 3.95552 12.9812C4.18056 12.9996 4.47171 13 4.9 13H11.1C11.5283 13 11.8194 12.9996 12.0445 12.9812C12.2637 12.9633 12.3758 12.9309 12.454 12.891C12.6422 12.7951 12.7951 12.6422 12.891 12.454C12.9309 12.3758 12.9633 12.2637 12.9812 12.0445C12.9996 11.8194 13 11.5283 13 11.1V6.99998L14 5.99998V11.1V11.1207C14 11.5231 14 11.8553 13.9779 12.1259C13.9549 12.407 13.9057 12.6653 13.782 12.908C13.5903 13.2843 13.2843 13.5903 12.908 13.782C12.6653 13.9057 12.407 13.9549 12.1259 13.9779C11.8553 14 11.5231 14 11.1207 14H11.1H4.9H4.87934C4.47686 14 4.14468 14 3.87409 13.9779C3.59304 13.9549 3.33469 13.9057 3.09202 13.782C2.7157 13.5903 2.40973 13.2843 2.21799 12.908C2.09434 12.6653 2.04506 12.407 2.0221 12.1259C1.99999 11.8553 1.99999 11.5231 2 11.1207V11.1206V11.1V4.9V4.87935V4.87932V4.87931C1.99999 4.47685 1.99999 4.14468 2.0221 3.87409C2.04506 3.59304 2.09434 3.33469 2.21799 3.09202C2.40973 2.71569 2.7157 2.40973 3.09202 2.21799C3.33469 2.09434 3.59304 2.04506 3.87409 2.0221C4.14468 1.99999 4.47685 1.99999 4.87932 2H4.87935H4.9H9.99998Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  z7e = ["color"],
  U7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, z7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM7.50003 4C7.77617 4 8.00003 4.22386 8.00003 4.5V7H10.5C10.7762 7 11 7.22386 11 7.5C11 7.77614 10.7762 8 10.5 8H8.00003V10.5C8.00003 10.7761 7.77617 11 7.50003 11C7.22389 11 7.00003 10.7761 7.00003 10.5V8H4.50003C4.22389 8 4.00003 7.77614 4.00003 7.5C4.00003 7.22386 4.22389 7 4.50003 7H7.00003V4.5C7.00003 4.22386 7.22389 4 7.50003 4Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  $7e = ["color"],
  q7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, $7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  }),
  K7e = ["color"],
  G7e = H.forwardRef(function (e, t) {
    var n = e.color,
      i = void 0 === n ? "currentColor" : n,
      r = d7e(e, K7e);
    return H.createElement(
      "svg",
      Object.assign(
        {
          width: "15",
          height: "15",
          viewBox: "0 0 15 15",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
        },
        r,
        { ref: t },
      ),
      H.createElement("path", {
        d: "M5.49998 0.5C5.49998 0.223858 5.72383 0 5.99998 0H7.49998H8.99998C9.27612 0 9.49998 0.223858 9.49998 0.5C9.49998 0.776142 9.27612 1 8.99998 1H7.99998V2.11922C9.09832 2.20409 10.119 2.56622 10.992 3.13572C11.0116 3.10851 11.0336 3.08252 11.058 3.05806L11.858 2.25806C12.1021 2.01398 12.4978 2.01398 12.7419 2.25806C12.986 2.50214 12.986 2.89786 12.7419 3.14194L11.967 3.91682C13.1595 5.07925 13.9 6.70314 13.9 8.49998C13.9 12.0346 11.0346 14.9 7.49998 14.9C3.96535 14.9 1.09998 12.0346 1.09998 8.49998C1.09998 5.13362 3.69904 2.3743 6.99998 2.11922V1H5.99998C5.72383 1 5.49998 0.776142 5.49998 0.5ZM2.09998 8.49998C2.09998 5.51764 4.51764 3.09998 7.49998 3.09998C10.4823 3.09998 12.9 5.51764 12.9 8.49998C12.9 11.4823 10.4823 13.9 7.49998 13.9C4.51764 13.9 2.09998 11.4823 2.09998 8.49998ZM7.99998 4.5C7.99998 4.22386 7.77612 4 7.49998 4C7.22383 4 6.99998 4.22386 6.99998 4.5V9.5C6.99998 9.77614 7.22383 10 7.49998 10C7.77612 10 7.99998 9.77614 7.99998 9.5V4.5Z",
        fill: i,
        fillRule: "evenodd",
        clipRule: "evenodd",
      }),
    );
  });
const Z7e = n7e,
  Y7e = i7e,
  X7e = r7e,
  Q7e = c7e,
  J7e = H.forwardRef(({ className: e, ...t }, n) =>
    Q.jsx(o7e, {
      ref: n,
      className: Rf(
        "fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
        e,
      ),
      ...t,
    }),
  );
J7e.displayName = o7e.displayName;
const eet = H.forwardRef(({ className: e, children: t, ...n }, i) =>
  Q.jsxs(X7e, {
    children: [
      Q.jsx(J7e, {}),
      Q.jsxs(s7e, {
        ref: i,
        className: Rf(
          "max-h-[95%] overflow-auto fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
          e,
        ),
        ...n,
        children: [
          t,
          Q.jsxs(c7e, {
            className:
              "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
            children: [
              Q.jsx(E7e, { className: "h-4 w-4" }),
              Q.jsx("span", { className: "sr-only", children: "Close" }),
            ],
          }),
        ],
      }),
    ],
  }),
);
eet.displayName = s7e.displayName;
const tet = ({ className: e, ...t }) =>
  Q.jsx("div", { className: Rf("flex flex-col space-y-1.5 text-center sm:text-left", e), ...t });
tet.displayName = "DialogHeader";
const net = ({ className: e, ...t }) =>
  Q.jsx("div", {
    className: Rf("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
    ...t,
  });
net.displayName = "DialogFooter";
const iet = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(a7e, {
    ref: n,
    className: Rf("text-lg font-semibold leading-none tracking-tight", e),
    ...t,
  }),
);
iet.displayName = a7e.displayName;
const ret = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(l7e, { ref: n, className: Rf("text-sm text-muted-foreground", e), ...t }),
);
ret.displayName = l7e.displayName;
const oet = z.createContext({
    drawerRef: { current: null },
    overlayRef: { current: null },
    onPress: () => {},
    onRelease: () => {},
    onDrag: () => {},
    onNestedDrag: () => {},
    onNestedOpenChange: () => {},
    onNestedRelease: () => {},
    openProp: void 0,
    dismissible: !1,
    isOpen: !1,
    isDragging: !1,
    keyboardIsOpen: { current: !1 },
    snapPointsOffset: null,
    snapPoints: null,
    handleOnly: !1,
    modal: !1,
    shouldFade: !1,
    activeSnapPoint: null,
    onOpenChange: () => {},
    setActiveSnapPoint: () => {},
    closeDrawer: () => {},
    direction: "bottom",
    shouldScaleBackground: !1,
    setBackgroundColorOnScale: !0,
    noBodyStyles: !1,
    container: null,
    autoFocus: !1,
  }),
  set = () => {
    const e = z.useContext(oet);
    if (!e) throw new Error("useDrawerContext must be used within a Drawer.Root");
    return e;
  };
!(function (e) {
  if ("undefined" == typeof document) return;
  let t = document.head || document.getElementsByTagName("head")[0],
    n = document.createElement("style");
  ((n.type = "text/css"),
    t.appendChild(n),
    n.styleSheet ? (n.styleSheet.cssText = e) : n.appendChild(document.createTextNode(e)));
})(
  "[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}",
);
const aet = "undefined" != typeof window ? H.useLayoutEffect : H.useEffect;
function cet(...e) {
  return (...t) => {
    for (let n of e) "function" == typeof n && n(...t);
  };
}
function det() {
  return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
}
function uet() {
  return get(/^iPad/) || (get(/^Mac/) && navigator.maxTouchPoints > 1);
}
function het() {
  return get(/^iPhone/) || uet();
}
function get(e) {
  return "undefined" != typeof window && null != window.navigator
    ? e.test(window.navigator.platform)
    : void 0;
}
const pet = "undefined" != typeof document && window.visualViewport;
function fet(e) {
  let t = window.getComputedStyle(e);
  return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
}
function met(e) {
  for (fet(e) && (e = e.parentElement); e && !fet(e); ) e = e.parentElement;
  return e || document.scrollingElement || document.documentElement;
}
const _et = new Set([
  "checkbox",
  "radio",
  "range",
  "color",
  "file",
  "image",
  "button",
  "submit",
  "reset",
]);
let vet,
  bet = 0;
function yet(e = {}) {
  let { isDisabled: t } = e;
  aet(() => {
    if (!t)
      return (
        bet++,
        1 === bet &&
          het() &&
          (vet = (function () {
            let e,
              t = 0,
              n = (n) => {
                ((e = met(n.target)),
                  (e === document.documentElement && e === document.body) ||
                    (t = n.changedTouches[0].pageY));
              },
              i = (n) => {
                if (!e || e === document.documentElement || e === document.body)
                  return void n.preventDefault();
                let i = n.changedTouches[0].pageY,
                  r = e.scrollTop,
                  o = e.scrollHeight - e.clientHeight;
                0 !== o &&
                  (((r <= 0 && i > t) || (r >= o && i < t)) && n.preventDefault(), (t = i));
              },
              r = (e) => {
                let t = e.target;
                Cet(t) &&
                  t !== document.activeElement &&
                  (e.preventDefault(),
                  (t.style.transform = "translateY(-2000px)"),
                  t.focus(),
                  requestAnimationFrame(() => {
                    t.style.transform = "";
                  }));
              },
              o = (e) => {
                let t = e.target;
                Cet(t) &&
                  ((t.style.transform = "translateY(-2000px)"),
                  requestAnimationFrame(() => {
                    ((t.style.transform = ""),
                      pet &&
                        (pet.height < window.innerHeight
                          ? requestAnimationFrame(() => {
                              wet(t);
                            })
                          : pet.addEventListener("resize", () => wet(t), { once: !0 })));
                  }));
              },
              s = () => {
                window.scrollTo(0, 0);
              },
              a = window.pageXOffset,
              l = window.pageYOffset,
              c = cet(
                (function (e, t, n) {
                  let i = e.style[t];
                  return (
                    (e.style[t] = n),
                    () => {
                      e.style[t] = i;
                    }
                  );
                })(
                  document.documentElement,
                  "paddingRight",
                  window.innerWidth - document.documentElement.clientWidth + "px",
                ),
              );
            window.scrollTo(0, 0);
            let d = cet(
              xet(document, "touchstart", n, { passive: !1, capture: !0 }),
              xet(document, "touchmove", i, { passive: !1, capture: !0 }),
              xet(document, "touchend", r, { passive: !1, capture: !0 }),
              xet(document, "focus", o, !0),
              xet(window, "scroll", s),
            );
            return () => {
              (c(), d(), window.scrollTo(a, l));
            };
          })()),
        () => {
          (bet--, 0 === bet && (null == vet || vet()));
        }
      );
  }, [t]);
}
function xet(e, t, n, i) {
  return (
    e.addEventListener(t, n, i),
    () => {
      e.removeEventListener(t, n, i);
    }
  );
}
function wet(e) {
  let t = document.scrollingElement || document.documentElement;
  for (; e && e !== t; ) {
    let t = met(e);
    if (t !== document.documentElement && t !== document.body && t !== e) {
      let n = t.getBoundingClientRect().top,
        i = e.getBoundingClientRect().top;
      e.getBoundingClientRect().bottom > t.getBoundingClientRect().bottom + 24 &&
        (t.scrollTop += i - n);
    }
    e = t.parentElement;
  }
}
function Cet(e) {
  return (
    (e instanceof HTMLInputElement && !_et.has(e.type)) ||
    e instanceof HTMLTextAreaElement ||
    (e instanceof HTMLElement && e.isContentEditable)
  );
}
function ket(...e) {
  return H.useCallback(
    (function (...e) {
      return (t) =>
        e.forEach((e) =>
          (function (e, t) {
            "function" == typeof e ? e(t) : null != e && (e.current = t);
          })(e, t),
        );
    })(...e),
    e,
  );
}
const Eet = new WeakMap();
function Net(e, t, n = !1) {
  if (!(e && e instanceof HTMLElement)) return;
  let i = {};
  (Object.entries(t).forEach(([t, n]) => {
    t.startsWith("--") ? e.style.setProperty(t, n) : ((i[t] = e.style[t]), (e.style[t] = n));
  }),
    n || Eet.set(e, i));
}
const Let = (e) => {
  switch (e) {
    case "top":
    case "bottom":
      return !0;
    case "left":
    case "right":
      return !1;
    default:
      return e;
  }
};
function Det(e, t) {
  if (!e) return null;
  const n = window.getComputedStyle(e),
    i = n.transform || n.webkitTransform || n.mozTransform;
  let r = i.match(/^matrix3d\((.+)\)$/);
  return r
    ? parseFloat(r[1].split(", ")[Let(t) ? 13 : 12])
    : ((r = i.match(/^matrix\((.+)\)$/)), r ? parseFloat(r[1].split(", ")[Let(t) ? 5 : 4]) : null);
}
function Tet(e, t) {
  if (!e) return () => {};
  const n = e.style.cssText;
  return (
    Object.assign(e.style, t),
    () => {
      e.style.cssText = n;
    }
  );
}
const Iet = { DURATION: 0.5, EASE: [0.32, 0.72, 0, 1] },
  Ret = 16,
  Oet = "vaul-dragging";
function Met(e) {
  const t = z.useRef(e);
  return (
    z.useEffect(() => {
      t.current = e;
    }),
    z.useMemo(
      () =>
        (...e) =>
          null == t.current ? void 0 : t.current.call(t, ...e),
      [],
    )
  );
}
function Aet({ prop: e, defaultProp: t, onChange: n = () => {} }) {
  const [i, r] = (function ({ defaultProp: e, onChange: t }) {
      const n = z.useState(e),
        [i] = n,
        r = z.useRef(i),
        o = Met(t);
      return (
        z.useEffect(() => {
          r.current !== i && (o(i), (r.current = i));
        }, [i, r, o]),
        n
      );
    })({ defaultProp: t, onChange: n }),
    o = void 0 !== e,
    s = o ? e : i,
    a = Met(n),
    l = z.useCallback(
      (t) => {
        if (o) {
          const n = "function" == typeof t ? t(e) : t;
          n !== e && a(n);
        } else r(t);
      },
      [o, e, r, a],
    );
  return [s, l];
}
let Pet = null;
const jet = z.forwardRef(function ({ ...e }, t) {
  const { overlayRef: n, snapPoints: i, onRelease: r, shouldFade: o, isOpen: s, modal: a } = set(),
    l = ket(t, n),
    c = i && i.length > 0;
  return a
    ? z.createElement(o7e, {
        onMouseUp: r,
        ref: l,
        "data-vaul-overlay": "",
        "data-vaul-snap-points": s && c ? "true" : "false",
        "data-vaul-snap-points-overlay": s && o ? "true" : "false",
        ...e,
      })
    : ("undefined" != typeof window &&
        window.requestAnimationFrame(() => {
          document.body.style.pointerEvents = "auto";
        }),
      null);
});
jet.displayName = "Drawer.Overlay";
const Fet = z.forwardRef(function (
  { onPointerDownOutside: e, style: t, onOpenAutoFocus: n, ...i },
  r,
) {
  const {
      drawerRef: o,
      onPress: s,
      onRelease: a,
      onDrag: l,
      keyboardIsOpen: c,
      snapPointsOffset: d,
      modal: u,
      isOpen: h,
      direction: g,
      snapPoints: p,
      container: f,
      handleOnly: m,
      autoFocus: _,
    } = set(),
    [v, b] = z.useState(!1),
    y = ket(r, o),
    x = z.useRef(null),
    w = z.useRef(null),
    C = z.useRef(!1),
    S = p && p.length > 0;
  !(function () {
    const {
        direction: e,
        isOpen: t,
        shouldScaleBackground: n,
        setBackgroundColorOnScale: i,
        noBodyStyles: r,
      } = set(),
      o = z.useRef(null),
      s = H.useMemo(() => document.body.style.backgroundColor, []);
    function a() {
      return (window.innerWidth - 26) / window.innerWidth;
    }
    z.useEffect(() => {
      if (t && n) {
        o.current && clearTimeout(o.current);
        const t =
          document.querySelector("[data-vaul-drawer-wrapper]") ||
          document.querySelector("[vaul-drawer-wrapper]");
        if (!t) return;
        (i && !r && Tet(document.body, { background: "black" }),
          Tet(t, {
            transformOrigin: Let(e) ? "top" : "left",
            transitionProperty: "transform, border-radius",
            transitionDuration: `${Iet.DURATION}s`,
            transitionTimingFunction: `cubic-bezier(${Iet.EASE.join(",")})`,
          }));
        const n = Tet(t, {
          borderRadius: "8px",
          overflow: "hidden",
          ...(Let(e)
            ? {
                transform: `scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
              }
            : {
                transform: `scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
              }),
        });
        return () => {
          (n(),
            (o.current = window.setTimeout(() => {
              s
                ? (document.body.style.background = s)
                : document.body.style.removeProperty("background");
            }, 1e3 * Iet.DURATION)));
        };
      }
    }, [t, n, s]);
  })();
  function k(e) {
    ((x.current = null), (C.current = !1), a(e));
  }
  return (
    z.useEffect(() => {
      S &&
        window.requestAnimationFrame(() => {
          b(!0);
        });
    }, []),
    z.createElement(s7e, {
      "data-vaul-drawer-direction": g,
      "data-vaul-drawer": "",
      "data-vaul-delayed-snap-points": v ? "true" : "false",
      "data-vaul-snap-points": h && S ? "true" : "false",
      "data-vaul-custom-container": f ? "true" : "false",
      ...i,
      ref: y,
      style: d && d.length > 0 ? { "--snap-point-height": `${d[0]}px`, ...t } : t,
      onPointerDown: (e) => {
        m ||
          (null == i.onPointerDown || i.onPointerDown.call(i, e),
          (x.current = { x: e.pageX, y: e.pageY }),
          s(e));
      },
      onOpenAutoFocus: (e) => {
        (null == n || n(e), _ || e.preventDefault());
      },
      onPointerDownOutside: (t) => {
        (null == e || e(t),
          u && !t.defaultPrevented ? c.current && (c.current = !1) : t.preventDefault());
      },
      onFocusOutside: (e) => {
        u || e.preventDefault();
      },
      onPointerMove: (e) => {
        if (((w.current = e), m)) return;
        if ((null == i.onPointerMove || i.onPointerMove.call(i, e), !x.current)) return;
        const t = e.pageY - x.current.y,
          n = e.pageX - x.current.x,
          r = "touch" === e.pointerType ? 10 : 2,
          o = ((e, t, n = 0) => {
            if (C.current) return !0;
            const i = Math.abs(e.y),
              r = Math.abs(e.x),
              o = r > i,
              s = ["bottom", "right"].includes(t) ? 1 : -1;
            if ("left" === t || "right" === t) {
              if (!(e.x * s < 0) && r >= 0 && r <= n) return o;
            } else if (!(e.y * s < 0) && i >= 0 && i <= n) return !o;
            return ((C.current = !0), !0);
          })({ x: n, y: t }, g, r);
        o ? l(e) : (Math.abs(n) > r || Math.abs(t) > r) && (x.current = null);
      },
      onPointerUp: (e) => {
        (null == i.onPointerUp || i.onPointerUp.call(i, e),
          (x.current = null),
          (C.current = !1),
          a(e));
      },
      onPointerOut: (e) => {
        (null == i.onPointerOut || i.onPointerOut.call(i, e), k(w.current));
      },
      onContextMenu: (e) => {
        (null == i.onContextMenu || i.onContextMenu.call(i, e), k(w.current));
      },
    })
  );
});
Fet.displayName = "Drawer.Content";
const Bet = z.forwardRef(function ({ preventCycle: e = !1, children: t, ...n }, i) {
  const {
      closeDrawer: r,
      isDragging: o,
      snapPoints: s,
      activeSnapPoint: a,
      setActiveSnapPoint: l,
      dismissible: c,
      handleOnly: d,
      isOpen: u,
      onPress: h,
      onDrag: g,
    } = set(),
    p = z.useRef(null),
    f = z.useRef(!1);
  function m() {
    (window.clearTimeout(p.current), (f.current = !1));
  }
  return z.createElement(
    "div",
    {
      onClick: function () {
        f.current
          ? m()
          : window.setTimeout(() => {
              !(function () {
                if (o || e || f.current) return void m();
                if ((m(), (!s || 0 === s.length) && c)) return void r();
                if (a === s[s.length - 1] && c) return void r();
                const t = s.findIndex((e) => e === a);
                if (-1 === t) return;
                const n = s[t + 1];
                l(n);
              })();
            }, 120);
      },
      onPointerCancel: m,
      onPointerDown: (e) => {
        (d && h(e),
          (p.current = window.setTimeout(() => {
            f.current = !0;
          }, 250)));
      },
      onPointerMove: (e) => {
        d && g(e);
      },
      ref: i,
      "data-vaul-drawer-visible": u ? "true" : "false",
      "data-vaul-handle": "",
      "aria-hidden": "true",
      ...n,
    },
    z.createElement("span", { "data-vaul-handle-hitarea": "", "aria-hidden": "true" }, t),
  );
});
Bet.displayName = "Drawer.Handle";
const Vet = {
    Root: function ({
      open: e,
      onOpenChange: t,
      children: n,
      onDrag: i,
      onRelease: r,
      snapPoints: o,
      shouldScaleBackground: s = !1,
      setBackgroundColorOnScale: a = !0,
      closeThreshold: l = 0.25,
      scrollLockTimeout: c = 100,
      dismissible: d = !0,
      handleOnly: u = !1,
      fadeFromIndex: h = o && o.length - 1,
      activeSnapPoint: g,
      setActiveSnapPoint: p,
      fixed: f,
      modal: m = !0,
      onClose: _,
      nested: v,
      noBodyStyles: b,
      direction: y = "bottom",
      defaultOpen: x = !1,
      disablePreventScroll: w = !0,
      snapToSequentialPoint: C = !1,
      preventScrollRestoration: S = !1,
      repositionInputs: k = !0,
      onAnimationEnd: E,
      container: N,
      autoFocus: L = !1,
    }) {
      var D, T;
      const [I = !1, R] = Aet({
          defaultProp: x,
          prop: e,
          onChange: (e) => {
            (null == t || t(e),
              e || v || ce(),
              setTimeout(() => {
                null == E || E(e);
              }, 1e3 * Iet.DURATION),
              e &&
                !m &&
                "undefined" != typeof window &&
                window.requestAnimationFrame(() => {
                  document.body.style.pointerEvents = "auto";
                }),
              e || (document.body.style.pointerEvents = "auto"));
          },
        }),
        [O, M] = z.useState(!1),
        [A, P] = z.useState(!1),
        [j, F] = z.useState(!1),
        B = z.useRef(null),
        V = z.useRef(null),
        W = z.useRef(null),
        H = z.useRef(null),
        U = z.useRef(null),
        $ = z.useRef(!1),
        q = z.useRef(null),
        K = z.useRef(0),
        G = z.useRef(!1),
        Z = z.useRef(0),
        Y = z.useRef(null),
        X = z.useRef((null == (D = Y.current) ? void 0 : D.getBoundingClientRect().height) || 0),
        Q = z.useRef((null == (T = Y.current) ? void 0 : T.getBoundingClientRect().width) || 0),
        J = z.useRef(0),
        ee = z.useCallback((e) => {
          o && e === oe.length - 1 && (V.current = new Date());
        }, []),
        {
          activeSnapPoint: te,
          activeSnapPointIndex: ne,
          setActiveSnapPoint: ie,
          onRelease: re,
          snapPointsOffset: oe,
          onDrag: se,
          shouldFade: ae,
          getPercentageDragged: le,
        } = (function ({
          activeSnapPointProp: e,
          setActiveSnapPointProp: t,
          snapPoints: n,
          drawerRef: i,
          overlayRef: r,
          fadeFromIndex: o,
          onSnapPointChange: s,
          direction: a = "bottom",
          container: l,
          snapToSequentialPoint: c,
        }) {
          const [d, u] = Aet({ prop: e, defaultProp: null == n ? void 0 : n[0], onChange: t }),
            [h, g] = z.useState(
              "undefined" != typeof window
                ? { innerWidth: window.innerWidth, innerHeight: window.innerHeight }
                : void 0,
            );
          z.useEffect(() => {
            function e() {
              g({ innerWidth: window.innerWidth, innerHeight: window.innerHeight });
            }
            return (
              window.addEventListener("resize", e),
              () => window.removeEventListener("resize", e)
            );
          }, []);
          const p = z.useMemo(() => d === (null == n ? void 0 : n[n.length - 1]) || null, [n, d]),
            f = z.useMemo(() => (null == n ? void 0 : n.findIndex((e) => e === d)), [n, d]),
            m = (n && n.length > 0 && (o || 0 === o) && !Number.isNaN(o) && n[o] === d) || !n,
            _ = z.useMemo(() => {
              const e = l
                ? {
                    width: l.getBoundingClientRect().width,
                    height: l.getBoundingClientRect().height,
                  }
                : "undefined" != typeof window
                  ? { width: window.innerWidth, height: window.innerHeight }
                  : { width: 0, height: 0 };
              var t;
              return null !=
                (t =
                  null == n
                    ? void 0
                    : n.map((t) => {
                        const n = "string" == typeof t;
                        let i = 0;
                        if ((n && (i = parseInt(t, 10)), Let(a))) {
                          const r = n ? i : h ? t * e.height : 0;
                          return h ? ("bottom" === a ? e.height - r : -e.height + r) : r;
                        }
                        const r = n ? i : h ? t * e.width : 0;
                        return h ? ("right" === a ? e.width - r : -e.width + r) : r;
                      }))
                ? t
                : [];
            }, [n, h, l]),
            v = z.useMemo(() => (null !== f ? (null == _ ? void 0 : _[f]) : null), [_, f]),
            b = z.useCallback(
              (e) => {
                var t;
                const l = null != (t = null == _ ? void 0 : _.findIndex((t) => t === e)) ? t : null;
                (s(l),
                  Net(i.current, {
                    transition: `transform ${Iet.DURATION}s cubic-bezier(${Iet.EASE.join(",")})`,
                    transform: Let(a) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`,
                  }),
                  _ && l !== _.length - 1 && l !== o && l < o
                    ? Net(r.current, {
                        transition: `opacity ${Iet.DURATION}s cubic-bezier(${Iet.EASE.join(",")})`,
                        opacity: "0",
                      })
                    : Net(r.current, {
                        transition: `opacity ${Iet.DURATION}s cubic-bezier(${Iet.EASE.join(",")})`,
                        opacity: "1",
                      }),
                  u(null == n ? void 0 : n[Math.max(l, 0)]));
              },
              [i.current, n, _, o, r, u],
            );
          return (
            z.useEffect(() => {
              if (d || e) {
                var t;
                const i =
                  null != (t = null == n ? void 0 : n.findIndex((t) => t === e || t === d))
                    ? t
                    : -1;
                _ && -1 !== i && "number" == typeof _[i] && b(_[i]);
              }
            }, [d, e, n, _, b]),
            {
              isLastSnapPoint: p,
              activeSnapPoint: d,
              shouldFade: m,
              getPercentageDragged: function (e, t) {
                if (!n || "number" != typeof f || !_ || void 0 === o) return null;
                const i = f === o - 1;
                if (f >= o && t) return 0;
                if (i && !t) return 1;
                if (!m && !i) return null;
                const r = i ? f + 1 : f - 1,
                  s = i ? _[r] - _[r - 1] : _[r + 1] - _[r],
                  a = e / Math.abs(s);
                return i ? 1 - a : a;
              },
              setActiveSnapPoint: u,
              activeSnapPointIndex: f,
              onRelease: function ({
                draggedDistance: e,
                closeDrawer: t,
                velocity: i,
                dismissible: s,
              }) {
                if (void 0 === o) return;
                const l =
                    "bottom" === a || "right" === a
                      ? (null != v ? v : 0) - e
                      : (null != v ? v : 0) + e,
                  d = 0 === f,
                  u = e > 0;
                if (
                  (f === o - 1 &&
                    Net(r.current, {
                      transition: `opacity ${Iet.DURATION}s cubic-bezier(${Iet.EASE.join(",")})`,
                    }),
                  !c && i > 2 && !u)
                )
                  return void (s ? t() : b(_[0]));
                if (!c && i > 2 && u && _ && n) return void b(_[n.length - 1]);
                const h =
                    null == _
                      ? void 0
                      : _.reduce((e, t) =>
                          "number" != typeof e || "number" != typeof t
                            ? e
                            : Math.abs(t - l) < Math.abs(e - l)
                              ? t
                              : e,
                        ),
                  g = Let(a) ? window.innerHeight : window.innerWidth;
                if (i > 0.4 && Math.abs(e) < 0.4 * g) {
                  const e = u ? 1 : -1;
                  if (e > 0 && p) return void b(_[n.length - 1]);
                  if ((d && e < 0 && s && t(), null === f)) return;
                  return void b(_[f + e]);
                }
                b(h);
              },
              onDrag: function ({ draggedDistance: e }) {
                if (null === v) return;
                const t = "bottom" === a || "right" === a ? v - e : v + e;
                (("bottom" === a || "right" === a) && t < _[_.length - 1]) ||
                  (("top" === a || "left" === a) && t > _[_.length - 1]) ||
                  Net(i.current, {
                    transform: Let(a) ? `translate3d(0, ${t}px, 0)` : `translate3d(${t}px, 0, 0)`,
                  });
              },
              snapPointsOffset: _,
            }
          );
        })({
          snapPoints: o,
          activeSnapPointProp: g,
          setActiveSnapPointProp: p,
          drawerRef: Y,
          fadeFromIndex: h,
          overlayRef: B,
          onSnapPointChange: ee,
          direction: y,
          container: N,
          snapToSequentialPoint: C,
        });
      yet({ isDisabled: !I || A || !m || j || !O || !k || !w });
      const { restorePositionSetting: ce } = (function ({
        isOpen: e,
        modal: t,
        nested: n,
        hasBeenOpened: i,
        preventScrollRestoration: r,
        noBodyStyles: o,
      }) {
        const [s, a] = z.useState(() => ("undefined" != typeof window ? window.location.href : "")),
          l = z.useRef(0),
          c = z.useCallback(() => {
            if (det() && null === Pet && e && !o) {
              Pet = {
                position: document.body.style.position,
                top: document.body.style.top,
                left: document.body.style.left,
                height: document.body.style.height,
                right: "unset",
              };
              const { scrollX: e, innerHeight: t } = window;
              (document.body.style.setProperty("position", "fixed", "important"),
                Object.assign(document.body.style, {
                  top: -l.current + "px",
                  left: -e + "px",
                  right: "0px",
                  height: "auto",
                }),
                window.setTimeout(
                  () =>
                    window.requestAnimationFrame(() => {
                      const e = t - window.innerHeight;
                      e && l.current >= t && (document.body.style.top = -(l.current + e) + "px");
                    }),
                  300,
                ));
            }
          }, [e]),
          d = z.useCallback(() => {
            if (det() && null !== Pet && !o) {
              const e = -parseInt(document.body.style.top, 10),
                t = -parseInt(document.body.style.left, 10);
              (Object.assign(document.body.style, Pet),
                window.requestAnimationFrame(() => {
                  r && s !== window.location.href ? a(window.location.href) : window.scrollTo(t, e);
                }),
                (Pet = null));
            }
          }, [s]);
        return (
          z.useEffect(() => {
            function e() {
              l.current = window.scrollY;
            }
            return (
              e(),
              window.addEventListener("scroll", e),
              () => {
                window.removeEventListener("scroll", e);
              }
            );
          }, []),
          z.useEffect(() => {
            !n &&
              i &&
              (e
                ? (!window.matchMedia("(display-mode: standalone)").matches && c(),
                  t ||
                    window.setTimeout(() => {
                      d();
                    }, 500))
                : d());
          }, [e, i, s, t, n, c, d]),
          { restorePositionSetting: d }
        );
      })({
        isOpen: I,
        modal: m,
        nested: v,
        hasBeenOpened: O,
        preventScrollRestoration: S,
        noBodyStyles: b,
      });
      function de() {
        return (window.innerWidth - 26) / window.innerWidth;
      }
      function ue(e, t) {
        var n, i;
        let r = e;
        const o = null == (n = window.getSelection()) ? void 0 : n.toString(),
          s = Y.current ? Det(Y.current, y) : null,
          a = new Date();
        if (r.hasAttribute("data-vaul-no-drag") || r.closest("[data-vaul-no-drag]")) return !1;
        if ("right" === y || "left" === y) return !0;
        if (V.current && a.getTime() - V.current.getTime() < 500) return !1;
        if (null !== s && ("bottom" === y ? s > 0 : s < 0)) return !0;
        if (o && o.length > 0) return !1;
        if (a.getTime() - (null == (i = U.current) ? void 0 : i.getTime()) < c && 0 === s)
          return ((U.current = a), !1);
        if (t) return ((U.current = a), !1);
        for (; r; ) {
          if (r.scrollHeight > r.clientHeight) {
            if (0 !== r.scrollTop) return ((U.current = new Date()), !1);
            if ("dialog" === r.getAttribute("role")) return !0;
          }
          r = r.parentNode;
        }
        return !0;
      }
      function he(e) {
        (!(function () {
          if (!A || !Y.current) return;
          (Y.current.classList.remove(Oet), ($.current = !1), P(!1), (H.current = new Date()));
        })(),
          null == _ || _(),
          e || R(!1),
          setTimeout(() => {
            o && ie(o[0]);
          }, 1e3 * Iet.DURATION));
      }
      function ge() {
        if (!Y.current) return;
        const e = document.querySelector("[data-vaul-drawer-wrapper]"),
          t = Det(Y.current, y);
        (Net(Y.current, {
          transform: "translate3d(0, 0, 0)",
          transition: `transform ${Iet.DURATION}s cubic-bezier(${Iet.EASE.join(",")})`,
        }),
          Net(B.current, {
            transition: `opacity ${Iet.DURATION}s cubic-bezier(${Iet.EASE.join(",")})`,
            opacity: "1",
          }),
          s &&
            t &&
            t > 0 &&
            I &&
            Net(
              e,
              {
                borderRadius: "8px",
                overflow: "hidden",
                ...(Let(y)
                  ? {
                      transform: `scale(${de()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
                      transformOrigin: "top",
                    }
                  : {
                      transform: `scale(${de()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
                      transformOrigin: "left",
                    }),
                transitionProperty: "transform, border-radius",
                transitionDuration: `${Iet.DURATION}s`,
                transitionTimingFunction: `cubic-bezier(${Iet.EASE.join(",")})`,
              },
              !0,
            ));
      }
      return (
        z.useEffect(() => {
          var e;
          function t() {
            if (!Y.current || !k) return;
            if (Cet(document.activeElement) || G.current) {
              var e;
              const t = (null == (e = window.visualViewport) ? void 0 : e.height) || 0,
                n = window.innerHeight;
              let i = n - t;
              const r = Y.current.getBoundingClientRect().height || 0,
                s = r > 0.8 * n;
              J.current || (J.current = r);
              const a = Y.current.getBoundingClientRect().top;
              if (
                (Math.abs(Z.current - i) > 60 && (G.current = !G.current),
                o && o.length > 0 && oe && ne)
              ) {
                i += oe[ne] || 0;
              }
              if (((Z.current = i), r > t || G.current)) {
                const e = Y.current.getBoundingClientRect().height;
                let n = e;
                (e > t && (n = t - (s ? a : 26)),
                  (Y.current.style.height = f
                    ? e - Math.max(i, 0) + "px"
                    : `${Math.max(n, t - a)}px`));
              } else Y.current.style.height = `${J.current}px`;
              o && o.length > 0 && !G.current
                ? (Y.current.style.bottom = "0px")
                : (Y.current.style.bottom = `${Math.max(i, 0)}px`);
            }
          }
          return (
            null == (e = window.visualViewport) || e.addEventListener("resize", t),
            () => {
              var e;
              return null == (e = window.visualViewport)
                ? void 0
                : e.removeEventListener("resize", t);
            }
          );
        }, [ne, o, oe]),
        z.useEffect(
          () => (
            I &&
              (Net(document.documentElement, { scrollBehavior: "auto" }), (V.current = new Date())),
            () => {
              !(function (e, t) {
                if (!(e && e instanceof HTMLElement)) return;
                let n = Eet.get(e);
                n && (e.style[t] = n[t]);
              })(document.documentElement, "scrollBehavior");
            }
          ),
          [I],
        ),
        z.createElement(
          n7e,
          {
            defaultOpen: x,
            onOpenChange: (e) => {
              (d || e) && (e ? M(!0) : he(!0), R(e));
            },
            open: I,
          },
          z.createElement(
            oet.Provider,
            {
              value: {
                activeSnapPoint: te,
                snapPoints: o,
                setActiveSnapPoint: ie,
                drawerRef: Y,
                overlayRef: B,
                onOpenChange: t,
                onPress: function (e) {
                  var t, n;
                  (d || o) &&
                    ((Y.current && !Y.current.contains(e.target)) ||
                      ((X.current =
                        (null == (t = Y.current) ? void 0 : t.getBoundingClientRect().height) || 0),
                      (Q.current =
                        (null == (n = Y.current) ? void 0 : n.getBoundingClientRect().width) || 0),
                      P(!0),
                      (W.current = new Date()),
                      het() &&
                        window.addEventListener("touchend", () => ($.current = !1), { once: !0 }),
                      e.target.setPointerCapture(e.pointerId),
                      (K.current = Let(y) ? e.pageY : e.pageX)));
                },
                onRelease: function (e) {
                  if (!A || !Y.current) return;
                  (Y.current.classList.remove(Oet),
                    ($.current = !1),
                    P(!1),
                    (H.current = new Date()));
                  const t = Det(Y.current, y);
                  if (!ue(e.target, !1) || !t || Number.isNaN(t)) return;
                  if (null === W.current) return;
                  const n = H.current.getTime() - W.current.getTime(),
                    i = K.current - (Let(y) ? e.pageY : e.pageX),
                    s = Math.abs(i) / n;
                  if (
                    (s > 0.05 &&
                      (F(!0),
                      setTimeout(() => {
                        F(!1);
                      }, 200)),
                    o)
                  ) {
                    return (
                      re({
                        draggedDistance: i * ("bottom" === y || "right" === y ? 1 : -1),
                        closeDrawer: he,
                        velocity: s,
                        dismissible: d,
                      }),
                      void (null == r || r(e, !0))
                    );
                  }
                  if ("bottom" === y || "right" === y ? i > 0 : i < 0)
                    return (ge(), void (null == r || r(e, !0)));
                  if (s > 0.4) return (he(), void (null == r || r(e, !1)));
                  var a;
                  const c = Math.min(
                    null != (a = Y.current.getBoundingClientRect().height) ? a : 0,
                    window.innerHeight,
                  );
                  var u;
                  const h = Math.min(
                      null != (u = Y.current.getBoundingClientRect().width) ? u : 0,
                      window.innerWidth,
                    ),
                    g = "left" === y || "right" === y;
                  if (Math.abs(t) >= (g ? h : c) * l) return (he(), void (null == r || r(e, !1)));
                  (null == r || r(e, !0), ge());
                },
                onDrag: function (e) {
                  if (Y.current && A) {
                    const t = "bottom" === y || "right" === y ? 1 : -1,
                      n = (K.current - (Let(y) ? e.pageY : e.pageX)) * t,
                      r = n > 0,
                      a = o && !d && !r;
                    if (a && 0 === ne) return;
                    const l = Math.abs(n),
                      c = document.querySelector("[data-vaul-drawer-wrapper]");
                    let u = l / ("bottom" === y || "top" === y ? X.current : Q.current);
                    const g = le(l, r);
                    if ((null !== g && (u = g), a && u >= 1)) return;
                    if (!$.current && !ue(e.target, r)) return;
                    if (
                      (Y.current.classList.add(Oet),
                      ($.current = !0),
                      Net(Y.current, { transition: "none" }),
                      Net(B.current, { transition: "none" }),
                      o && se({ draggedDistance: n }),
                      r && !o)
                    ) {
                      const e = (function (e) {
                          return 8 * (Math.log(e + 1) - 2);
                        })(n),
                        i = Math.min(-1 * e, 0) * t;
                      return void Net(Y.current, {
                        transform: Let(y)
                          ? `translate3d(0, ${i}px, 0)`
                          : `translate3d(${i}px, 0, 0)`,
                      });
                    }
                    const p = 1 - u;
                    if (
                      ((ae || (h && ne === h - 1)) &&
                        (null == i || i(e, u),
                        Net(B.current, { opacity: `${p}`, transition: "none" }, !0)),
                      c && B.current && s)
                    ) {
                      const e = Math.min(de() + u * (1 - de()), 1),
                        t = 8 - 8 * u,
                        n = Math.max(0, 14 - 14 * u);
                      Net(
                        c,
                        {
                          borderRadius: `${t}px`,
                          transform: Let(y)
                            ? `scale(${e}) translate3d(0, ${n}px, 0)`
                            : `scale(${e}) translate3d(${n}px, 0, 0)`,
                          transition: "none",
                        },
                        !0,
                      );
                    }
                    if (!o) {
                      const e = l * t;
                      Net(Y.current, {
                        transform: Let(y)
                          ? `translate3d(0, ${e}px, 0)`
                          : `translate3d(${e}px, 0, 0)`,
                      });
                    }
                  }
                },
                dismissible: d,
                handleOnly: u,
                isOpen: I,
                isDragging: A,
                shouldFade: ae,
                closeDrawer: he,
                onNestedDrag: function (e, t) {
                  if (t < 0) return;
                  const n = (window.innerWidth - Ret) / window.innerWidth,
                    i = n + t * (1 - n),
                    r = t * Ret - 16;
                  Net(Y.current, {
                    transform: Let(y)
                      ? `scale(${i}) translate3d(0, ${r}px, 0)`
                      : `scale(${i}) translate3d(${r}px, 0, 0)`,
                    transition: "none",
                  });
                },
                onNestedOpenChange: function (e) {
                  const t = e ? (window.innerWidth - Ret) / window.innerWidth : 1,
                    n = e ? -16 : 0;
                  (q.current && window.clearTimeout(q.current),
                    Net(Y.current, {
                      transition: `transform ${Iet.DURATION}s cubic-bezier(${Iet.EASE.join(",")})`,
                      transform: `scale(${t}) translate3d(0, ${n}px, 0)`,
                    }),
                    !e &&
                      Y.current &&
                      (q.current = setTimeout(() => {
                        const e = Det(Y.current, y);
                        Net(Y.current, {
                          transition: "none",
                          transform: Let(y)
                            ? `translate3d(0, ${e}px, 0)`
                            : `translate3d(${e}px, 0, 0)`,
                        });
                      }, 500)));
                },
                onNestedRelease: function (e, t) {
                  const n = Let(y) ? window.innerHeight : window.innerWidth,
                    i = t ? (n - Ret) / n : 1,
                    r = t ? -16 : 0;
                  t &&
                    Net(Y.current, {
                      transition: `transform ${Iet.DURATION}s cubic-bezier(${Iet.EASE.join(",")})`,
                      transform: Let(y)
                        ? `scale(${i}) translate3d(0, ${r}px, 0)`
                        : `scale(${i}) translate3d(${r}px, 0, 0)`,
                    });
                },
                keyboardIsOpen: G,
                modal: m,
                snapPointsOffset: oe,
                direction: y,
                shouldScaleBackground: s,
                setBackgroundColorOnScale: a,
                noBodyStyles: b,
                container: N,
                autoFocus: L,
              },
            },
            n,
          ),
        )
      );
    },
    Content: Fet,
    Overlay: jet,
    Trigger: i7e,
    Portal: function (e) {
      const t = set(),
        { container: n = t.container, ...i } = e;
      return z.createElement(r7e, { container: n, ...i });
    },
    Close: c7e,
    Title: a7e,
    Description: l7e,
  },
  Wet = ({ shouldScaleBackground: e = !0, ...t }) =>
    Q.jsx(Vet.Root, { shouldScaleBackground: e, ...t });
Wet.displayName = "Drawer";
const Het = Vet.Trigger,
  zet = Vet.Portal,
  Uet = Vet.Close,
  $et = H.forwardRef(({ className: e, ...t }, n) =>
    Q.jsx(Vet.Overlay, { ref: n, className: Rf("fixed inset-0 z-50 bg-black/80", e), ...t }),
  );
$et.displayName = Vet.Overlay.displayName;
const qet = H.forwardRef(({ className: e, children: t, ...n }, i) =>
  Q.jsxs(zet, {
    children: [
      Q.jsx($et, {}),
      Q.jsxs(Vet.Content, {
        ref: i,
        className: Rf(
          "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
          e,
        ),
        ...n,
        children: [
          Q.jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
          t,
        ],
      }),
    ],
  }),
);
qet.displayName = "DrawerContent";
const Ket = ({ className: e, ...t }) =>
  Q.jsx("div", { className: Rf("grid gap-1.5 p-4 text-center sm:text-left", e), ...t });
Ket.displayName = "DrawerHeader";
const Get = ({ className: e, ...t }) =>
  Q.jsx("div", { className: Rf("mt-auto flex flex-col gap-2 p-4", e), ...t });
Get.displayName = "DrawerFooter";
const Zet = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(Vet.Title, {
    ref: n,
    className: Rf("text-lg font-semibold leading-none tracking-tight", e),
    ...t,
  }),
);
Zet.displayName = Vet.Title.displayName;
const Yet = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(Vet.Description, { ref: n, className: Rf("text-sm text-muted-foreground", e), ...t }),
);
Yet.displayName = Vet.Description.displayName;
const Xet = H.createContext(!1),
  Qet = () => H.useContext(Xet),
  Jet = ({ children: e, ...t }) => {
    const n = t8e();
    return Q.jsx(Xet.Provider, {
      value: n,
      children: n ? Q.jsx(Wet, { ...t, children: e }) : Q.jsx(Z7e, { ...t, children: e }),
    });
  };
Jet.displayName = "ResponsiveDialog";
const ett = H.forwardRef((e, t) =>
  Qet() ? Q.jsx(Het, { ref: t, ...e }) : Q.jsx(Y7e, { ref: t, ...e }),
);
ett.displayName = "ResponsiveDialogTrigger";
const ttt = H.forwardRef(({ className: e, drawerClassName: t, children: n, ...i }, r) =>
  Qet()
    ? Q.jsx(qet, { className: Rf("flex max-h-[90vh] flex-col", t), children: n })
    : Q.jsx(eet, { ref: r, className: e, ...i, children: n }),
);
ttt.displayName = "ResponsiveDialogContent";
const ntt = ({ className: e, ...t }) =>
  Qet() ? Q.jsx(Ket, { className: Rf("text-left", e), ...t }) : Q.jsx(tet, { className: e, ...t });
ntt.displayName = "ResponsiveDialogHeader";
const itt = ({ className: e, ...t }) =>
  Qet() ? Q.jsx(Get, { className: e, ...t }) : Q.jsx(net, { className: e, ...t });
itt.displayName = "ResponsiveDialogFooter";
const rtt = H.forwardRef(({ className: e, ...t }, n) =>
  Qet() ? Q.jsx(Zet, { className: e, ...t }) : Q.jsx(iet, { ref: n, className: e, ...t }),
);
rtt.displayName = "ResponsiveDialogTitle";
const ott = H.forwardRef(({ className: e, ...t }, n) =>
  Qet() ? Q.jsx(Yet, { className: e, ...t }) : Q.jsx(ret, { ref: n, className: e, ...t }),
);
ott.displayName = "ResponsiveDialogDescription";
const stt = H.forwardRef((e, t) =>
  Qet() ? Q.jsx(Uet, { ref: t, ...e }) : Q.jsx(Q7e, { ref: t, ...e }),
);
stt.displayName = "ResponsiveDialogClose";
const att = jp(
    "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
    {
      variants: {
        variant: {
          default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
          destructive:
            "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
          outline:
            "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
          secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
          ghost: "hover:bg-accent hover:text-accent-foreground",
          link: "text-primary underline-offset-4 hover:underline",
        },
        size: {
          default: "h-9 px-4 py-2",
          sm: "h-8 rounded-md px-3 text-xs",
          lg: "h-10 rounded-md px-8",
          icon: "h-9 w-9",
        },
      },
      defaultVariants: { variant: "default", size: "default" },
    },
  ),
  ltt = H.forwardRef(({ className: e, variant: t, size: n, asChild: i = !1, ...r }, o) => {
    const s = i ? Dp : "button";
    return Q.jsx(s, { className: Rf(att({ variant: t, size: n, className: e })), ref: o, ...r });
  });
ltt.displayName = "Button";
var ctt = ["title"],
  dtt = ["title"],
  utt = ["title"];
function htt() {
  return (
    (htt =
      Object.assign ||
      function (e) {
        for (var t = 1; t < arguments.length; t++) {
          var n = arguments[t];
          for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
        }
        return e;
      }),
    htt.apply(this, arguments)
  );
}
function gtt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n,
        i,
        r = {},
        o = Object.keys(e);
      for (i = 0; i < o.length; i++) ((n = o[i]), t.indexOf(n) >= 0 || (r[n] = e[n]));
      return r;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
const ptt = ["top", "right", "bottom", "left"],
  ftt = Math.min,
  mtt = Math.max,
  _tt = Math.round,
  vtt = Math.floor,
  btt = (e) => ({ x: e, y: e }),
  ytt = { left: "right", right: "left", bottom: "top", top: "bottom" },
  xtt = { start: "end", end: "start" };
function wtt(e, t, n) {
  return mtt(e, ftt(t, n));
}
function Ctt(e, t) {
  return "function" == typeof e ? e(t) : e;
}
function Stt(e) {
  return e.split("-")[0];
}
function ktt(e) {
  return e.split("-")[1];
}
function Ett(e) {
  return "x" === e ? "y" : "x";
}
function Ntt(e) {
  return "y" === e ? "height" : "width";
}
const Ltt = new Set(["top", "bottom"]);
function Dtt(e) {
  return Ltt.has(Stt(e)) ? "y" : "x";
}
function Ttt(e) {
  return Ett(Dtt(e));
}
function Itt(e) {
  return e.replace(/start|end/g, (e) => xtt[e]);
}
const Rtt = ["left", "right"],
  Ott = ["right", "left"],
  Mtt = ["top", "bottom"],
  Att = ["bottom", "top"];
function Ptt(e, t, n, i) {
  const r = ktt(e);
  let o = (function (e, t, n) {
    switch (e) {
      case "top":
      case "bottom":
        return n ? (t ? Ott : Rtt) : t ? Rtt : Ott;
      case "left":
      case "right":
        return t ? Mtt : Att;
      default:
        return [];
    }
  })(Stt(e), "start" === n, i);
  return (r && ((o = o.map((e) => e + "-" + r)), t && (o = o.concat(o.map(Itt)))), o);
}
function jtt(e) {
  return e.replace(/left|right|bottom|top/g, (e) => ytt[e]);
}
function Ftt(e) {
  return "number" != typeof e
    ? (function (e) {
        return { top: 0, right: 0, bottom: 0, left: 0, ...e };
      })(e)
    : { top: e, right: e, bottom: e, left: e };
}
function Btt(e) {
  const { x: t, y: n, width: i, height: r } = e;
  return { width: i, height: r, top: n, left: t, right: t + i, bottom: n + r, x: t, y: n };
}
function Vtt(e, t, n) {
  let { reference: i, floating: r } = e;
  const o = Dtt(t),
    s = Ttt(t),
    a = Ntt(s),
    l = Stt(t),
    c = "y" === o,
    d = i.x + i.width / 2 - r.width / 2,
    u = i.y + i.height / 2 - r.height / 2,
    h = i[a] / 2 - r[a] / 2;
  let g;
  switch (l) {
    case "top":
      g = { x: d, y: i.y - r.height };
      break;
    case "bottom":
      g = { x: d, y: i.y + i.height };
      break;
    case "right":
      g = { x: i.x + i.width, y: u };
      break;
    case "left":
      g = { x: i.x - r.width, y: u };
      break;
    default:
      g = { x: i.x, y: i.y };
  }
  switch (ktt(t)) {
    case "start":
      g[s] -= h * (n && c ? -1 : 1);
      break;
    case "end":
      g[s] += h * (n && c ? -1 : 1);
  }
  return g;
}
async function Wtt(e, t) {
  var n;
  void 0 === t && (t = {});
  const { x: i, y: r, platform: o, rects: s, elements: a, strategy: l } = e,
    {
      boundary: c = "clippingAncestors",
      rootBoundary: d = "viewport",
      elementContext: u = "floating",
      altBoundary: h = !1,
      padding: g = 0,
    } = Ctt(t, e),
    p = Ftt(g),
    f = a[h ? ("floating" === u ? "reference" : "floating") : u],
    m = Btt(
      await o.getClippingRect({
        element:
          null == (n = await (null == o.isElement ? void 0 : o.isElement(f))) || n
            ? f
            : f.contextElement ||
              (await (null == o.getDocumentElement ? void 0 : o.getDocumentElement(a.floating))),
        boundary: c,
        rootBoundary: d,
        strategy: l,
      }),
    ),
    _ =
      "floating" === u
        ? { x: i, y: r, width: s.floating.width, height: s.floating.height }
        : s.reference,
    v = await (null == o.getOffsetParent ? void 0 : o.getOffsetParent(a.floating)),
    b = ((await (null == o.isElement ? void 0 : o.isElement(v))) &&
      (await (null == o.getScale ? void 0 : o.getScale(v)))) || { x: 1, y: 1 },
    y = Btt(
      o.convertOffsetParentRelativeRectToViewportRelativeRect
        ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
            elements: a,
            rect: _,
            offsetParent: v,
            strategy: l,
          })
        : _,
    );
  return {
    top: (m.top - y.top + p.top) / b.y,
    bottom: (y.bottom - m.bottom + p.bottom) / b.y,
    left: (m.left - y.left + p.left) / b.x,
    right: (y.right - m.right + p.right) / b.x,
  };
}
function Htt(e, t) {
  return {
    top: e.top - t.height,
    right: e.right - t.width,
    bottom: e.bottom - t.height,
    left: e.left - t.width,
  };
}
function ztt(e) {
  return ptt.some((t) => e[t] >= 0);
}
const Utt = new Set(["left", "top"]);
function $tt() {
  return "undefined" != typeof window;
}
function qtt(e) {
  return Ztt(e) ? (e.nodeName || "").toLowerCase() : "#document";
}
function Ktt(e) {
  var t;
  return (null == e || null == (t = e.ownerDocument) ? void 0 : t.defaultView) || window;
}
function Gtt(e) {
  var t;
  return null == (t = (Ztt(e) ? e.ownerDocument : e.document) || window.document)
    ? void 0
    : t.documentElement;
}
function Ztt(e) {
  return !!$tt() && (e instanceof Node || e instanceof Ktt(e).Node);
}
function Ytt(e) {
  return !!$tt() && (e instanceof Element || e instanceof Ktt(e).Element);
}
function Xtt(e) {
  return !!$tt() && (e instanceof HTMLElement || e instanceof Ktt(e).HTMLElement);
}
function Qtt(e) {
  return (
    !(!$tt() || "undefined" == typeof ShadowRoot) &&
    (e instanceof ShadowRoot || e instanceof Ktt(e).ShadowRoot)
  );
}
const Jtt = new Set(["inline", "contents"]);
function ent(e) {
  const { overflow: t, overflowX: n, overflowY: i, display: r } = hnt(e);
  return /auto|scroll|overlay|hidden|clip/.test(t + i + n) && !Jtt.has(r);
}
const tnt = new Set(["table", "td", "th"]);
function nnt(e) {
  return tnt.has(qtt(e));
}
const int = [":popover-open", ":modal"];
function rnt(e) {
  return int.some((t) => {
    try {
      return e.matches(t);
    } catch (MZe) {
      return !1;
    }
  });
}
const ont = ["transform", "translate", "scale", "rotate", "perspective"],
  snt = ["transform", "translate", "scale", "rotate", "perspective", "filter"],
  ant = ["paint", "layout", "strict", "content"];
function lnt(e) {
  const t = cnt(),
    n = Ytt(e) ? hnt(e) : e;
  return (
    ont.some((e) => !!n[e] && "none" !== n[e]) ||
    (!!n.containerType && "normal" !== n.containerType) ||
    (!t && !!n.backdropFilter && "none" !== n.backdropFilter) ||
    (!t && !!n.filter && "none" !== n.filter) ||
    snt.some((e) => (n.willChange || "").includes(e)) ||
    ant.some((e) => (n.contain || "").includes(e))
  );
}
function cnt() {
  return (
    !("undefined" == typeof CSS || !CSS.supports) && CSS.supports("-webkit-backdrop-filter", "none")
  );
}
const dnt = new Set(["html", "body", "#document"]);
function unt(e) {
  return dnt.has(qtt(e));
}
function hnt(e) {
  return Ktt(e).getComputedStyle(e);
}
function gnt(e) {
  return Ytt(e)
    ? { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop }
    : { scrollLeft: e.scrollX, scrollTop: e.scrollY };
}
function pnt(e) {
  if ("html" === qtt(e)) return e;
  const t = e.assignedSlot || e.parentNode || (Qtt(e) && e.host) || Gtt(e);
  return Qtt(t) ? t.host : t;
}
function fnt(e) {
  const t = pnt(e);
  return unt(t) ? (e.ownerDocument ? e.ownerDocument.body : e.body) : Xtt(t) && ent(t) ? t : fnt(t);
}
function mnt(e, t, n) {
  var i;
  (void 0 === t && (t = []), void 0 === n && (n = !0));
  const r = fnt(e),
    o = r === (null == (i = e.ownerDocument) ? void 0 : i.body),
    s = Ktt(r);
  if (o) {
    const e = _nt(s);
    return t.concat(s, s.visualViewport || [], ent(r) ? r : [], e && n ? mnt(e) : []);
  }
  return t.concat(r, mnt(r, [], n));
}
function _nt(e) {
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
}
function vnt(e) {
  const t = hnt(e);
  let n = parseFloat(t.width) || 0,
    i = parseFloat(t.height) || 0;
  const r = Xtt(e),
    o = r ? e.offsetWidth : n,
    s = r ? e.offsetHeight : i,
    a = _tt(n) !== o || _tt(i) !== s;
  return (a && ((n = o), (i = s)), { width: n, height: i, $: a });
}
function bnt(e) {
  return Ytt(e) ? e : e.contextElement;
}
function ynt(e) {
  const t = bnt(e);
  if (!Xtt(t)) return btt(1);
  const n = t.getBoundingClientRect(),
    { width: i, height: r, $: o } = vnt(t);
  let s = (o ? _tt(n.width) : n.width) / i,
    a = (o ? _tt(n.height) : n.height) / r;
  return (
    (s && Number.isFinite(s)) || (s = 1),
    (a && Number.isFinite(a)) || (a = 1),
    { x: s, y: a }
  );
}
const xnt = btt(0);
function wnt(e) {
  const t = Ktt(e);
  return cnt() && t.visualViewport
    ? { x: t.visualViewport.offsetLeft, y: t.visualViewport.offsetTop }
    : xnt;
}
function Cnt(e, t, n, i) {
  (void 0 === t && (t = !1), void 0 === n && (n = !1));
  const r = e.getBoundingClientRect(),
    o = bnt(e);
  let s = btt(1);
  t && (i ? Ytt(i) && (s = ynt(i)) : (s = ynt(e)));
  const a = (function (e, t, n) {
    return (void 0 === t && (t = !1), !(!n || (t && n !== Ktt(e))) && t);
  })(o, n, i)
    ? wnt(o)
    : btt(0);
  let l = (r.left + a.x) / s.x,
    c = (r.top + a.y) / s.y,
    d = r.width / s.x,
    u = r.height / s.y;
  if (o) {
    const e = Ktt(o),
      t = i && Ytt(i) ? Ktt(i) : i;
    let n = e,
      r = _nt(n);
    for (; r && i && t !== n; ) {
      const e = ynt(r),
        t = r.getBoundingClientRect(),
        i = hnt(r),
        o = t.left + (r.clientLeft + parseFloat(i.paddingLeft)) * e.x,
        s = t.top + (r.clientTop + parseFloat(i.paddingTop)) * e.y;
      ((l *= e.x),
        (c *= e.y),
        (d *= e.x),
        (u *= e.y),
        (l += o),
        (c += s),
        (n = Ktt(r)),
        (r = _nt(n)));
    }
  }
  return Btt({ width: d, height: u, x: l, y: c });
}
function Snt(e, t) {
  const n = gnt(e).scrollLeft;
  return t ? t.left + n : Cnt(Gtt(e)).left + n;
}
function knt(e, t) {
  const n = e.getBoundingClientRect();
  return { x: n.left + t.scrollLeft - Snt(e, n), y: n.top + t.scrollTop };
}
const Ent = new Set(["absolute", "fixed"]);
function Nnt(e, t, n) {
  let i;
  if ("viewport" === t)
    i = (function (e, t) {
      const n = Ktt(e),
        i = Gtt(e),
        r = n.visualViewport;
      let o = i.clientWidth,
        s = i.clientHeight,
        a = 0,
        l = 0;
      if (r) {
        ((o = r.width), (s = r.height));
        const e = cnt();
        (!e || (e && "fixed" === t)) && ((a = r.offsetLeft), (l = r.offsetTop));
      }
      const c = Snt(i);
      if (c <= 0) {
        const e = i.ownerDocument,
          t = e.body,
          n = getComputedStyle(t),
          r =
            ("CSS1Compat" === e.compatMode &&
              parseFloat(n.marginLeft) + parseFloat(n.marginRight)) ||
            0,
          s = Math.abs(i.clientWidth - t.clientWidth - r);
        s <= 25 && (o -= s);
      } else c <= 25 && (o += c);
      return { width: o, height: s, x: a, y: l };
    })(e, n);
  else if ("document" === t)
    i = (function (e) {
      const t = Gtt(e),
        n = gnt(e),
        i = e.ownerDocument.body,
        r = mtt(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth),
        o = mtt(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
      let s = -n.scrollLeft + Snt(e);
      const a = -n.scrollTop;
      return (
        "rtl" === hnt(i).direction && (s += mtt(t.clientWidth, i.clientWidth) - r),
        { width: r, height: o, x: s, y: a }
      );
    })(Gtt(e));
  else if (Ytt(t))
    i = (function (e, t) {
      const n = Cnt(e, !0, "fixed" === t),
        i = n.top + e.clientTop,
        r = n.left + e.clientLeft,
        o = Xtt(e) ? ynt(e) : btt(1);
      return { width: e.clientWidth * o.x, height: e.clientHeight * o.y, x: r * o.x, y: i * o.y };
    })(t, n);
  else {
    const n = wnt(e);
    i = { x: t.x - n.x, y: t.y - n.y, width: t.width, height: t.height };
  }
  return Btt(i);
}
function Lnt(e, t) {
  const n = pnt(e);
  return !(n === t || !Ytt(n) || unt(n)) && ("fixed" === hnt(n).position || Lnt(n, t));
}
function Dnt(e, t, n) {
  const i = Xtt(t),
    r = Gtt(t),
    o = "fixed" === n,
    s = Cnt(e, !0, o, t);
  let a = { scrollLeft: 0, scrollTop: 0 };
  const l = btt(0);
  function c() {
    l.x = Snt(r);
  }
  if (i || (!i && !o))
    if ((("body" !== qtt(t) || ent(r)) && (a = gnt(t)), i)) {
      const e = Cnt(t, !0, o, t);
      ((l.x = e.x + t.clientLeft), (l.y = e.y + t.clientTop));
    } else r && c();
  o && !i && r && c();
  const d = !r || i || o ? btt(0) : knt(r, a);
  return {
    x: s.left + a.scrollLeft - l.x - d.x,
    y: s.top + a.scrollTop - l.y - d.y,
    width: s.width,
    height: s.height,
  };
}
function Tnt(e) {
  return "static" === hnt(e).position;
}
function Int(e, t) {
  if (!Xtt(e) || "fixed" === hnt(e).position) return null;
  if (t) return t(e);
  let n = e.offsetParent;
  return (Gtt(e) === n && (n = n.ownerDocument.body), n);
}
function Rnt(e, t) {
  const n = Ktt(e);
  if (rnt(e)) return n;
  if (!Xtt(e)) {
    let t = pnt(e);
    for (; t && !unt(t); ) {
      if (Ytt(t) && !Tnt(t)) return t;
      t = pnt(t);
    }
    return n;
  }
  let i = Int(e, t);
  for (; i && nnt(i) && Tnt(i); ) i = Int(i, t);
  return i && unt(i) && Tnt(i) && !lnt(i)
    ? n
    : i ||
        (function (e) {
          let t = pnt(e);
          for (; Xtt(t) && !unt(t); ) {
            if (lnt(t)) return t;
            if (rnt(t)) return null;
            t = pnt(t);
          }
          return null;
        })(e) ||
        n;
}
const Ont = {
  convertOffsetParentRelativeRectToViewportRelativeRect: function (e) {
    let { elements: t, rect: n, offsetParent: i, strategy: r } = e;
    const o = "fixed" === r,
      s = Gtt(i),
      a = !!t && rnt(t.floating);
    if (i === s || (a && o)) return n;
    let l = { scrollLeft: 0, scrollTop: 0 },
      c = btt(1);
    const d = btt(0),
      u = Xtt(i);
    if ((u || (!u && !o)) && (("body" !== qtt(i) || ent(s)) && (l = gnt(i)), Xtt(i))) {
      const e = Cnt(i);
      ((c = ynt(i)), (d.x = e.x + i.clientLeft), (d.y = e.y + i.clientTop));
    }
    const h = !s || u || o ? btt(0) : knt(s, l);
    return {
      width: n.width * c.x,
      height: n.height * c.y,
      x: n.x * c.x - l.scrollLeft * c.x + d.x + h.x,
      y: n.y * c.y - l.scrollTop * c.y + d.y + h.y,
    };
  },
  getDocumentElement: Gtt,
  getClippingRect: function (e) {
    let { element: t, boundary: n, rootBoundary: i, strategy: r } = e;
    const o =
        "clippingAncestors" === n
          ? rnt(t)
            ? []
            : (function (e, t) {
                const n = t.get(e);
                if (n) return n;
                let i = mnt(e, [], !1).filter((e) => Ytt(e) && "body" !== qtt(e)),
                  r = null;
                const o = "fixed" === hnt(e).position;
                let s = o ? pnt(e) : e;
                for (; Ytt(s) && !unt(s); ) {
                  const t = hnt(s),
                    n = lnt(s);
                  (n || "fixed" !== t.position || (r = null),
                    (
                      o
                        ? !n && !r
                        : (!n && "static" === t.position && r && Ent.has(r.position)) ||
                          (ent(s) && !n && Lnt(e, s))
                    )
                      ? (i = i.filter((e) => e !== s))
                      : (r = t),
                    (s = pnt(s)));
                }
                return (t.set(e, i), i);
              })(t, this._c)
          : [].concat(n),
      s = [...o, i],
      a = s[0],
      l = s.reduce(
        (e, n) => {
          const i = Nnt(t, n, r);
          return (
            (e.top = mtt(i.top, e.top)),
            (e.right = ftt(i.right, e.right)),
            (e.bottom = ftt(i.bottom, e.bottom)),
            (e.left = mtt(i.left, e.left)),
            e
          );
        },
        Nnt(t, a, r),
      );
    return { width: l.right - l.left, height: l.bottom - l.top, x: l.left, y: l.top };
  },
  getOffsetParent: Rnt,
  getElementRects: async function (e) {
    const t = this.getOffsetParent || Rnt,
      n = this.getDimensions,
      i = await n(e.floating);
    return {
      reference: Dnt(e.reference, await t(e.floating), e.strategy),
      floating: { x: 0, y: 0, width: i.width, height: i.height },
    };
  },
  getClientRects: function (e) {
    return Array.from(e.getClientRects());
  },
  getDimensions: function (e) {
    const { width: t, height: n } = vnt(e);
    return { width: t, height: n };
  },
  getScale: ynt,
  isElement: Ytt,
  isRTL: function (e) {
    return "rtl" === hnt(e).direction;
  },
};
function Mnt(e, t) {
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
}
function Ant(e, t, n, i) {
  void 0 === i && (i = {});
  const {
      ancestorScroll: r = !0,
      ancestorResize: o = !0,
      elementResize: s = "function" == typeof ResizeObserver,
      layoutShift: a = "function" == typeof IntersectionObserver,
      animationFrame: l = !1,
    } = i,
    c = bnt(e),
    d = r || o ? [...(c ? mnt(c) : []), ...mnt(t)] : [];
  d.forEach((e) => {
    (r && e.addEventListener("scroll", n, { passive: !0 }), o && e.addEventListener("resize", n));
  });
  const u =
    c && a
      ? (function (e, t) {
          let n,
            i = null;
          const r = Gtt(e);
          function o() {
            var e;
            (clearTimeout(n), null == (e = i) || e.disconnect(), (i = null));
          }
          return (
            (function s(a, l) {
              (void 0 === a && (a = !1), void 0 === l && (l = 1), o());
              const c = e.getBoundingClientRect(),
                { left: d, top: u, width: h, height: g } = c;
              if ((a || t(), !h || !g)) return;
              const p = {
                rootMargin:
                  -vtt(u) +
                  "px " +
                  -vtt(r.clientWidth - (d + h)) +
                  "px " +
                  -vtt(r.clientHeight - (u + g)) +
                  "px " +
                  -vtt(d) +
                  "px",
                threshold: mtt(0, ftt(1, l)) || 1,
              };
              let f = !0;
              function m(t) {
                const i = t[0].intersectionRatio;
                if (i !== l) {
                  if (!f) return s();
                  i
                    ? s(!1, i)
                    : (n = setTimeout(() => {
                        s(!1, 1e-7);
                      }, 1e3));
                }
                (1 !== i || Mnt(c, e.getBoundingClientRect()) || s(), (f = !1));
              }
              try {
                i = new IntersectionObserver(m, { ...p, root: r.ownerDocument });
              } catch (MZe) {
                i = new IntersectionObserver(m, p);
              }
              i.observe(e);
            })(!0),
            o
          );
        })(c, n)
      : null;
  let h,
    g = -1,
    p = null;
  s &&
    ((p = new ResizeObserver((e) => {
      let [i] = e;
      (i &&
        i.target === c &&
        p &&
        (p.unobserve(t),
        cancelAnimationFrame(g),
        (g = requestAnimationFrame(() => {
          var e;
          null == (e = p) || e.observe(t);
        }))),
        n());
    })),
    c && !l && p.observe(c),
    p.observe(t));
  let f = l ? Cnt(e) : null;
  return (
    l &&
      (function t() {
        const i = Cnt(e);
        f && !Mnt(f, i) && n();
        ((f = i), (h = requestAnimationFrame(t)));
      })(),
    n(),
    () => {
      var e;
      (d.forEach((e) => {
        (r && e.removeEventListener("scroll", n), o && e.removeEventListener("resize", n));
      }),
        null == u || u(),
        null == (e = p) || e.disconnect(),
        (p = null),
        l && cancelAnimationFrame(h));
    }
  );
}
const Pnt = function (e) {
    return (
      void 0 === e && (e = 0),
      {
        name: "offset",
        options: e,
        async fn(t) {
          var n, i;
          const { x: r, y: o, placement: s, middlewareData: a } = t,
            l = await (async function (e, t) {
              const { placement: n, platform: i, elements: r } = e,
                o = await (null == i.isRTL ? void 0 : i.isRTL(r.floating)),
                s = Stt(n),
                a = ktt(n),
                l = "y" === Dtt(n),
                c = Utt.has(s) ? -1 : 1,
                d = o && l ? -1 : 1,
                u = Ctt(t, e);
              let {
                mainAxis: h,
                crossAxis: g,
                alignmentAxis: p,
              } = "number" == typeof u
                ? { mainAxis: u, crossAxis: 0, alignmentAxis: null }
                : {
                    mainAxis: u.mainAxis || 0,
                    crossAxis: u.crossAxis || 0,
                    alignmentAxis: u.alignmentAxis,
                  };
              return (
                a && "number" == typeof p && (g = "end" === a ? -1 * p : p),
                l ? { x: g * d, y: h * c } : { x: h * c, y: g * d }
              );
            })(t, e);
          return s === (null == (n = a.offset) ? void 0 : n.placement) &&
            null != (i = a.arrow) &&
            i.alignmentOffset
            ? {}
            : { x: r + l.x, y: o + l.y, data: { ...l, placement: s } };
        },
      }
    );
  },
  jnt = function (e) {
    return (
      void 0 === e && (e = {}),
      {
        name: "shift",
        options: e,
        async fn(t) {
          const { x: n, y: i, placement: r } = t,
            {
              mainAxis: o = !0,
              crossAxis: s = !1,
              limiter: a = {
                fn: (e) => {
                  let { x: t, y: n } = e;
                  return { x: t, y: n };
                },
              },
              ...l
            } = Ctt(e, t),
            c = { x: n, y: i },
            d = await Wtt(t, l),
            u = Dtt(Stt(r)),
            h = Ett(u);
          let g = c[h],
            p = c[u];
          if (o) {
            const e = "y" === h ? "bottom" : "right";
            g = wtt(g + d["y" === h ? "top" : "left"], g, g - d[e]);
          }
          if (s) {
            const e = "y" === u ? "bottom" : "right";
            p = wtt(p + d["y" === u ? "top" : "left"], p, p - d[e]);
          }
          const f = a.fn({ ...t, [h]: g, [u]: p });
          return { ...f, data: { x: f.x - n, y: f.y - i, enabled: { [h]: o, [u]: s } } };
        },
      }
    );
  },
  Fnt = function (e) {
    return (
      void 0 === e && (e = {}),
      {
        name: "flip",
        options: e,
        async fn(t) {
          var n, i;
          const {
              placement: r,
              middlewareData: o,
              rects: s,
              initialPlacement: a,
              platform: l,
              elements: c,
            } = t,
            {
              mainAxis: d = !0,
              crossAxis: u = !0,
              fallbackPlacements: h,
              fallbackStrategy: g = "bestFit",
              fallbackAxisSideDirection: p = "none",
              flipAlignment: f = !0,
              ...m
            } = Ctt(e, t);
          if (null != (n = o.arrow) && n.alignmentOffset) return {};
          const _ = Stt(r),
            v = Dtt(a),
            b = Stt(a) === a,
            y = await (null == l.isRTL ? void 0 : l.isRTL(c.floating)),
            x =
              h ||
              (b || !f
                ? [jtt(a)]
                : (function (e) {
                    const t = jtt(e);
                    return [Itt(e), t, Itt(t)];
                  })(a)),
            w = "none" !== p;
          !h && w && x.push(...Ptt(a, f, p, y));
          const C = [a, ...x],
            S = await Wtt(t, m),
            k = [];
          let E = (null == (i = o.flip) ? void 0 : i.overflows) || [];
          if ((d && k.push(S[_]), u)) {
            const e = (function (e, t, n) {
              void 0 === n && (n = !1);
              const i = ktt(e),
                r = Ttt(e),
                o = Ntt(r);
              let s =
                "x" === r
                  ? i === (n ? "end" : "start")
                    ? "right"
                    : "left"
                  : "start" === i
                    ? "bottom"
                    : "top";
              return (t.reference[o] > t.floating[o] && (s = jtt(s)), [s, jtt(s)]);
            })(r, s, y);
            k.push(S[e[0]], S[e[1]]);
          }
          if (((E = [...E, { placement: r, overflows: k }]), !k.every((e) => e <= 0))) {
            var N, L;
            const e = ((null == (N = o.flip) ? void 0 : N.index) || 0) + 1,
              t = C[e];
            if (t) {
              if (
                !("alignment" === u && v !== Dtt(t)) ||
                E.every((e) => Dtt(e.placement) !== v || e.overflows[0] > 0)
              )
                return { data: { index: e, overflows: E }, reset: { placement: t } };
            }
            let n =
              null ==
              (L = E.filter((e) => e.overflows[0] <= 0).sort(
                (e, t) => e.overflows[1] - t.overflows[1],
              )[0])
                ? void 0
                : L.placement;
            if (!n)
              switch (g) {
                case "bestFit": {
                  var D;
                  const e =
                    null ==
                    (D = E.filter((e) => {
                      if (w) {
                        const t = Dtt(e.placement);
                        return t === v || "y" === t;
                      }
                      return !0;
                    })
                      .map((e) => [
                        e.placement,
                        e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0),
                      ])
                      .sort((e, t) => e[1] - t[1])[0])
                      ? void 0
                      : D[0];
                  e && (n = e);
                  break;
                }
                case "initialPlacement":
                  n = a;
              }
            if (r !== n) return { reset: { placement: n } };
          }
          return {};
        },
      }
    );
  },
  Bnt = function (e) {
    return (
      void 0 === e && (e = {}),
      {
        name: "size",
        options: e,
        async fn(t) {
          var n, i;
          const { placement: r, rects: o, platform: s, elements: a } = t,
            { apply: l = () => {}, ...c } = Ctt(e, t),
            d = await Wtt(t, c),
            u = Stt(r),
            h = ktt(r),
            g = "y" === Dtt(r),
            { width: p, height: f } = o.floating;
          let m, _;
          "top" === u || "bottom" === u
            ? ((m = u),
              (_ =
                h === ((await (null == s.isRTL ? void 0 : s.isRTL(a.floating))) ? "start" : "end")
                  ? "left"
                  : "right"))
            : ((_ = u), (m = "end" === h ? "top" : "bottom"));
          const v = f - d.top - d.bottom,
            b = p - d.left - d.right,
            y = ftt(f - d[m], v),
            x = ftt(p - d[_], b),
            w = !t.middlewareData.shift;
          let C = y,
            S = x;
          if (
            (null != (n = t.middlewareData.shift) && n.enabled.x && (S = b),
            null != (i = t.middlewareData.shift) && i.enabled.y && (C = v),
            w && !h)
          ) {
            const e = mtt(d.left, 0),
              t = mtt(d.right, 0),
              n = mtt(d.top, 0),
              i = mtt(d.bottom, 0);
            g
              ? (S = p - 2 * (0 !== e || 0 !== t ? e + t : mtt(d.left, d.right)))
              : (C = f - 2 * (0 !== n || 0 !== i ? n + i : mtt(d.top, d.bottom)));
          }
          await l({ ...t, availableWidth: S, availableHeight: C });
          const k = await s.getDimensions(a.floating);
          return p !== k.width || f !== k.height ? { reset: { rects: !0 } } : {};
        },
      }
    );
  },
  Vnt = function (e) {
    return (
      void 0 === e && (e = {}),
      {
        name: "hide",
        options: e,
        async fn(t) {
          const { rects: n } = t,
            { strategy: i = "referenceHidden", ...r } = Ctt(e, t);
          switch (i) {
            case "referenceHidden": {
              const e = Htt(await Wtt(t, { ...r, elementContext: "reference" }), n.reference);
              return { data: { referenceHiddenOffsets: e, referenceHidden: ztt(e) } };
            }
            case "escaped": {
              const e = Htt(await Wtt(t, { ...r, altBoundary: !0 }), n.floating);
              return { data: { escapedOffsets: e, escaped: ztt(e) } };
            }
            default:
              return {};
          }
        },
      }
    );
  },
  Wnt = (e) => ({
    name: "arrow",
    options: e,
    async fn(t) {
      const { x: n, y: i, placement: r, rects: o, platform: s, elements: a, middlewareData: l } = t,
        { element: c, padding: d = 0 } = Ctt(e, t) || {};
      if (null == c) return {};
      const u = Ftt(d),
        h = { x: n, y: i },
        g = Ttt(r),
        p = Ntt(g),
        f = await s.getDimensions(c),
        m = "y" === g,
        _ = m ? "top" : "left",
        v = m ? "bottom" : "right",
        b = m ? "clientHeight" : "clientWidth",
        y = o.reference[p] + o.reference[g] - h[g] - o.floating[p],
        x = h[g] - o.reference[g],
        w = await (null == s.getOffsetParent ? void 0 : s.getOffsetParent(c));
      let C = w ? w[b] : 0;
      (C && (await (null == s.isElement ? void 0 : s.isElement(w)))) ||
        (C = a.floating[b] || o.floating[p]);
      const S = y / 2 - x / 2,
        k = C / 2 - f[p] / 2 - 1,
        E = ftt(u[_], k),
        N = ftt(u[v], k),
        L = E,
        D = C - f[p] - N,
        T = C / 2 - f[p] / 2 + S,
        I = wtt(L, T, D),
        R =
          !l.arrow &&
          null != ktt(r) &&
          T !== I &&
          o.reference[p] / 2 - (T < L ? E : N) - f[p] / 2 < 0,
        O = R ? (T < L ? T - L : T - D) : 0;
      return {
        [g]: h[g] + O,
        data: { [g]: I, centerOffset: T - I - O, ...(R && { alignmentOffset: O }) },
        reset: R,
      };
    },
  }),
  Hnt = function (e) {
    return (
      void 0 === e && (e = {}),
      {
        options: e,
        fn(t) {
          const { x: n, y: i, placement: r, rects: o, middlewareData: s } = t,
            { offset: a = 0, mainAxis: l = !0, crossAxis: c = !0 } = Ctt(e, t),
            d = { x: n, y: i },
            u = Dtt(r),
            h = Ett(u);
          let g = d[h],
            p = d[u];
          const f = Ctt(a, t),
            m =
              "number" == typeof f
                ? { mainAxis: f, crossAxis: 0 }
                : { mainAxis: 0, crossAxis: 0, ...f };
          if (l) {
            const e = "y" === h ? "height" : "width",
              t = o.reference[h] - o.floating[e] + m.mainAxis,
              n = o.reference[h] + o.reference[e] - m.mainAxis;
            g < t ? (g = t) : g > n && (g = n);
          }
          if (c) {
            var _, v;
            const e = "y" === h ? "width" : "height",
              t = Utt.has(Stt(r)),
              n =
                o.reference[u] -
                o.floating[e] +
                ((t && (null == (_ = s.offset) ? void 0 : _[u])) || 0) +
                (t ? 0 : m.crossAxis),
              i =
                o.reference[u] +
                o.reference[e] +
                (t ? 0 : (null == (v = s.offset) ? void 0 : v[u]) || 0) -
                (t ? m.crossAxis : 0);
            p < n ? (p = n) : p > i && (p = i);
          }
          return { [h]: g, [u]: p };
        },
      }
    );
  },
  znt = (e, t, n) => {
    const i = new Map(),
      r = { platform: Ont, ...n },
      o = { ...r.platform, _c: i };
    return (async (e, t, n) => {
      const {
          placement: i = "bottom",
          strategy: r = "absolute",
          middleware: o = [],
          platform: s,
        } = n,
        a = o.filter(Boolean),
        l = await (null == s.isRTL ? void 0 : s.isRTL(t));
      let c = await s.getElementRects({ reference: e, floating: t, strategy: r }),
        { x: d, y: u } = Vtt(c, i, l),
        h = i,
        g = {},
        p = 0;
      for (let f = 0; f < a.length; f++) {
        const { name: n, fn: o } = a[f],
          {
            x: m,
            y: _,
            data: v,
            reset: b,
          } = await o({
            x: d,
            y: u,
            initialPlacement: i,
            placement: h,
            strategy: r,
            middlewareData: g,
            rects: c,
            platform: s,
            elements: { reference: e, floating: t },
          });
        ((d = null != m ? m : d),
          (u = null != _ ? _ : u),
          (g = { ...g, [n]: { ...g[n], ...v } }),
          b &&
            p <= 50 &&
            (p++,
            "object" == typeof b &&
              (b.placement && (h = b.placement),
              b.rects &&
                (c =
                  !0 === b.rects
                    ? await s.getElementRects({ reference: e, floating: t, strategy: r })
                    : b.rects),
              ({ x: d, y: u } = Vtt(c, h, l))),
            (f = -1)));
      }
      return { x: d, y: u, placement: h, strategy: r, middlewareData: g };
    })(e, t, { ...r, platform: o });
  };
var Unt = "undefined" != typeof document ? H.useLayoutEffect : function () {};
function $nt(e, t) {
  if (e === t) return !0;
  if (typeof e != typeof t) return !1;
  if ("function" == typeof e && e.toString() === t.toString()) return !0;
  let n, i, r;
  if (e && t && "object" == typeof e) {
    if (Array.isArray(e)) {
      if (((n = e.length), n !== t.length)) return !1;
      for (i = n; 0 !== i--; ) if (!$nt(e[i], t[i])) return !1;
      return !0;
    }
    if (((r = Object.keys(e)), (n = r.length), n !== Object.keys(t).length)) return !1;
    for (i = n; 0 !== i--; ) if (!{}.hasOwnProperty.call(t, r[i])) return !1;
    for (i = n; 0 !== i--; ) {
      const n = r[i];
      if (("_owner" !== n || !e.$$typeof) && !$nt(e[n], t[n])) return !1;
    }
    return !0;
  }
  return e != e && t != t;
}
function qnt(e) {
  if ("undefined" == typeof window) return 1;
  return (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
}
function Knt(e, t) {
  const n = qnt(e);
  return Math.round(t * n) / n;
}
function Gnt(e) {
  const t = H.useRef(e);
  return (
    Unt(() => {
      t.current = e;
    }),
    t
  );
}
const Znt = (e) => ({
    name: "arrow",
    options: e,
    fn(t) {
      const { element: n, padding: i } = "function" == typeof e ? e(t) : e;
      return n && ((r = n), {}.hasOwnProperty.call(r, "current"))
        ? null != n.current
          ? Wnt({ element: n.current, padding: i }).fn(t)
          : {}
        : n
          ? Wnt({ element: n, padding: i }).fn(t)
          : {};
      var r;
    },
  }),
  Ynt = (e, t) => ({ ...Pnt(e), options: [e, t] }),
  Xnt = (e, t) => ({ ...jnt(e), options: [e, t] }),
  Qnt = (e, t) => ({ ...Hnt(e), options: [e, t] }),
  Jnt = (e, t) => ({ ...Fnt(e), options: [e, t] }),
  eit = (e, t) => ({ ...Bnt(e), options: [e, t] }),
  tit = (e, t) => ({ ...Vnt(e), options: [e, t] }),
  nit = (e, t) => ({ ...Znt(e), options: [e, t] });
var iit = H.forwardRef((e, t) => {
  const { children: n, width: i = 10, height: r = 5, ...o } = e;
  return Q.jsx(gx.svg, {
    ...o,
    ref: t,
    width: i,
    height: r,
    viewBox: "0 0 30 10",
    preserveAspectRatio: "none",
    children: e.asChild ? n : Q.jsx("polygon", { points: "0,0 30,0 15,10" }),
  });
});
iit.displayName = "Arrow";
var rit = iit;
function oit(e) {
  const [t, n] = H.useState(void 0);
  return (
    sx(() => {
      if (e) {
        n({ width: e.offsetWidth, height: e.offsetHeight });
        const t = new ResizeObserver((t) => {
          if (!Array.isArray(t)) return;
          if (!t.length) return;
          const i = t[0];
          let r, o;
          if ("borderBoxSize" in i) {
            const e = i.borderBoxSize,
              t = Array.isArray(e) ? e[0] : e;
            ((r = t.inlineSize), (o = t.blockSize));
          } else ((r = e.offsetWidth), (o = e.offsetHeight));
          n({ width: r, height: o });
        });
        return (t.observe(e, { box: "border-box" }), () => t.unobserve(e));
      }
      n(void 0);
    }, [e]),
    t
  );
}
var sit = "Popper",
  [ait, lit] = Jy(sit),
  [cit, dit] = ait(sit),
  uit = (e) => {
    const { __scopePopper: t, children: n } = e,
      [i, r] = H.useState(null);
    return Q.jsx(cit, { scope: t, anchor: i, onAnchorChange: r, children: n });
  };
uit.displayName = sit;
var hit = "PopperAnchor",
  git = H.forwardRef((e, t) => {
    const { __scopePopper: n, virtualRef: i, ...r } = e,
      o = dit(hit, n),
      s = H.useRef(null),
      a = Sp(t, s),
      l = H.useRef(null);
    return (
      H.useEffect(() => {
        const e = l.current;
        ((l.current = i?.current || s.current), e !== l.current && o.onAnchorChange(l.current));
      }),
      i ? null : Q.jsx(gx.div, { ...r, ref: a })
    );
  });
git.displayName = hit;
var pit = "PopperContent",
  [fit, mit] = ait(pit),
  _it = H.forwardRef((e, t) => {
    const {
        __scopePopper: n,
        side: i = "bottom",
        sideOffset: r = 0,
        align: o = "center",
        alignOffset: s = 0,
        arrowPadding: a = 0,
        avoidCollisions: l = !0,
        collisionBoundary: c = [],
        collisionPadding: d = 0,
        sticky: u = "partial",
        hideWhenDetached: h = !1,
        updatePositionStrategy: g = "optimized",
        onPlaced: p,
        ...f
      } = e,
      m = dit(pit, n),
      [_, v] = H.useState(null),
      b = Sp(t, (e) => v(e)),
      [y, x] = H.useState(null),
      w = oit(y),
      C = w?.width ?? 0,
      S = w?.height ?? 0,
      k = i + ("center" !== o ? "-" + o : ""),
      E = "number" == typeof d ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d },
      N = Array.isArray(c) ? c : [c],
      L = N.length > 0,
      D = { padding: E, boundary: N.filter(xit), altBoundary: L },
      {
        refs: T,
        floatingStyles: I,
        placement: R,
        isPositioned: O,
        middlewareData: M,
      } = (function (e) {
        void 0 === e && (e = {});
        const {
            placement: t = "bottom",
            strategy: n = "absolute",
            middleware: i = [],
            platform: r,
            elements: { reference: o, floating: s } = {},
            transform: a = !0,
            whileElementsMounted: l,
            open: c,
          } = e,
          [d, u] = H.useState({
            x: 0,
            y: 0,
            strategy: n,
            placement: t,
            middlewareData: {},
            isPositioned: !1,
          }),
          [h, g] = H.useState(i);
        $nt(h, i) || g(i);
        const [p, f] = H.useState(null),
          [m, _] = H.useState(null),
          v = H.useCallback((e) => {
            e !== w.current && ((w.current = e), f(e));
          }, []),
          b = H.useCallback((e) => {
            e !== C.current && ((C.current = e), _(e));
          }, []),
          y = o || p,
          x = s || m,
          w = H.useRef(null),
          C = H.useRef(null),
          S = H.useRef(d),
          k = null != l,
          E = Gnt(l),
          N = Gnt(r),
          L = Gnt(c),
          D = H.useCallback(() => {
            if (!w.current || !C.current) return;
            const e = { placement: t, strategy: n, middleware: h };
            (N.current && (e.platform = N.current),
              znt(w.current, C.current, e).then((e) => {
                const t = { ...e, isPositioned: !1 !== L.current };
                T.current &&
                  !$nt(S.current, t) &&
                  ((S.current = t),
                  ru.flushSync(() => {
                    u(t);
                  }));
              }));
          }, [h, t, n, N, L]);
        Unt(() => {
          !1 === c &&
            S.current.isPositioned &&
            ((S.current.isPositioned = !1), u((e) => ({ ...e, isPositioned: !1 })));
        }, [c]);
        const T = H.useRef(!1);
        (Unt(
          () => (
            (T.current = !0),
            () => {
              T.current = !1;
            }
          ),
          [],
        ),
          Unt(() => {
            if ((y && (w.current = y), x && (C.current = x), y && x)) {
              if (E.current) return E.current(y, x, D);
              D();
            }
          }, [y, x, D, E, k]));
        const I = H.useMemo(
            () => ({ reference: w, floating: C, setReference: v, setFloating: b }),
            [v, b],
          ),
          R = H.useMemo(() => ({ reference: y, floating: x }), [y, x]),
          O = H.useMemo(() => {
            const e = { position: n, left: 0, top: 0 };
            if (!R.floating) return e;
            const t = Knt(R.floating, d.x),
              i = Knt(R.floating, d.y);
            return a
              ? {
                  ...e,
                  transform: "translate(" + t + "px, " + i + "px)",
                  ...(qnt(R.floating) >= 1.5 && { willChange: "transform" }),
                }
              : { position: n, left: t, top: i };
          }, [n, a, R.floating, d.x, d.y]);
        return H.useMemo(
          () => ({ ...d, update: D, refs: I, elements: R, floatingStyles: O }),
          [d, D, I, R, O],
        );
      })({
        strategy: "fixed",
        placement: k,
        whileElementsMounted: (...e) => Ant(...e, { animationFrame: "always" === g }),
        elements: { reference: m.anchor },
        middleware: [
          Ynt({ mainAxis: r + S, alignmentAxis: s }),
          l &&
            Xnt({ mainAxis: !0, crossAxis: !1, limiter: "partial" === u ? Qnt() : void 0, ...D }),
          l && Jnt({ ...D }),
          eit({
            ...D,
            apply: ({ elements: e, rects: t, availableWidth: n, availableHeight: i }) => {
              const { width: r, height: o } = t.reference,
                s = e.floating.style;
              (s.setProperty("--radix-popper-available-width", `${n}px`),
                s.setProperty("--radix-popper-available-height", `${i}px`),
                s.setProperty("--radix-popper-anchor-width", `${r}px`),
                s.setProperty("--radix-popper-anchor-height", `${o}px`));
            },
          }),
          y && nit({ element: y, padding: a }),
          wit({ arrowWidth: C, arrowHeight: S }),
          h && tit({ strategy: "referenceHidden", ...D }),
        ],
      }),
      [A, P] = Cit(R),
      j = fx(p);
    sx(() => {
      O && j?.();
    }, [O, j]);
    const F = M.arrow?.x,
      B = M.arrow?.y,
      V = 0 !== M.arrow?.centerOffset,
      [W, z] = H.useState();
    return (
      sx(() => {
        _ && z(window.getComputedStyle(_).zIndex);
      }, [_]),
      Q.jsx("div", {
        ref: T.setFloating,
        "data-radix-popper-content-wrapper": "",
        style: {
          ...I,
          transform: O ? I.transform : "translate(0, -200%)",
          minWidth: "max-content",
          zIndex: W,
          "--radix-popper-transform-origin": [M.transformOrigin?.x, M.transformOrigin?.y].join(" "),
          ...(M.hide?.referenceHidden && { visibility: "hidden", pointerEvents: "none" }),
        },
        dir: e.dir,
        children: Q.jsx(fit, {
          scope: n,
          placedSide: A,
          onArrowChange: x,
          arrowX: F,
          arrowY: B,
          shouldHideArrow: V,
          children: Q.jsx(gx.div, {
            "data-side": A,
            "data-align": P,
            ...f,
            ref: b,
            style: { ...f.style, animation: O ? void 0 : "none" },
          }),
        }),
      })
    );
  });
_it.displayName = pit;
var vit = "PopperArrow",
  bit = { top: "bottom", right: "left", bottom: "top", left: "right" },
  yit = H.forwardRef(function (e, t) {
    const { __scopePopper: n, ...i } = e,
      r = mit(vit, n),
      o = bit[r.placedSide];
    return Q.jsx("span", {
      ref: r.onArrowChange,
      style: {
        position: "absolute",
        left: r.arrowX,
        top: r.arrowY,
        [o]: 0,
        transformOrigin: { top: "", right: "0 0", bottom: "center 0", left: "100% 0" }[
          r.placedSide
        ],
        transform: {
          top: "translateY(100%)",
          right: "translateY(50%) rotate(90deg) translateX(-50%)",
          bottom: "rotate(180deg)",
          left: "translateY(50%) rotate(-90deg) translateX(50%)",
        }[r.placedSide],
        visibility: r.shouldHideArrow ? "hidden" : void 0,
      },
      children: Q.jsx(rit, { ...i, ref: t, style: { ...i.style, display: "block" } }),
    });
  });
function xit(e) {
  return null !== e;
}
yit.displayName = vit;
var wit = (e) => ({
  name: "transformOrigin",
  options: e,
  fn(t) {
    const { placement: n, rects: i, middlewareData: r } = t,
      o = 0 !== r.arrow?.centerOffset,
      s = o ? 0 : e.arrowWidth,
      a = o ? 0 : e.arrowHeight,
      [l, c] = Cit(n),
      d = { start: "0%", center: "50%", end: "100%" }[c],
      u = (r.arrow?.x ?? 0) + s / 2,
      h = (r.arrow?.y ?? 0) + a / 2;
    let g = "",
      p = "";
    return (
      "bottom" === l
        ? ((g = o ? d : `${u}px`), (p = -a + "px"))
        : "top" === l
          ? ((g = o ? d : `${u}px`), (p = `${i.floating.height + a}px`))
          : "right" === l
            ? ((g = -a + "px"), (p = o ? d : `${h}px`))
            : "left" === l && ((g = `${i.floating.width + a}px`), (p = o ? d : `${h}px`)),
      { data: { x: g, y: p } }
    );
  },
});
function Cit(e) {
  const [t, n = "center"] = e.split("-");
  return [t, n];
}
var Sit = uit,
  kit = git,
  Eit = _it,
  Nit = yit;
function Lit(e) {
  const t = H.forwardRef((e, t) => {
    const { children: n, ...i } = e;
    if (H.isValidElement(n)) {
      const e = (function (e) {
          let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get,
            n = t && "isReactWarning" in t && t.isReactWarning;
          if (n) return e.ref;
          if (
            ((t = Object.getOwnPropertyDescriptor(e, "ref")?.get),
            (n = t && "isReactWarning" in t && t.isReactWarning),
            n)
          )
            return e.props.ref;
          return e.props.ref || e.ref;
        })(n),
        r = (function (e, t) {
          const n = { ...t };
          for (const i in t) {
            const r = e[i],
              o = t[i];
            /^on[A-Z]/.test(i)
              ? r && o
                ? (n[i] = (...e) => {
                    const t = o(...e);
                    return (r(...e), t);
                  })
                : r && (n[i] = r)
              : "style" === i
                ? (n[i] = { ...r, ...o })
                : "className" === i && (n[i] = [r, o].filter(Boolean).join(" "));
          }
          return { ...e, ...n };
        })(i, n.props);
      return (n.type !== H.Fragment && (r.ref = t ? Cp(t, e) : e), H.cloneElement(n, r));
    }
    return H.Children.count(n) > 1 ? H.Children.only(null) : null;
  });
  return ((t.displayName = `${e}.SlotClone`), t);
}
var Dit = Symbol("radix.slottable");
function Tit(e) {
  return (
    H.isValidElement(e) &&
    "function" == typeof e.type &&
    "__radixId" in e.type &&
    e.type.__radixId === Dit
  );
}
var Iit = ["Enter", " "],
  Rit = ["ArrowUp", "PageDown", "End"],
  Oit = ["ArrowDown", "PageUp", "Home", ...Rit],
  Mit = { ltr: [...Iit, "ArrowRight"], rtl: [...Iit, "ArrowLeft"] },
  Ait = { ltr: ["ArrowLeft"], rtl: ["ArrowRight"] },
  Pit = "Menu",
  [jit, Fit, Bit] = ox(Pit),
  [Vit, Wit] = Jy(Pit, [Bit, lit, Nx]),
  Hit = lit(),
  zit = Nx(),
  [Uit, $it] = Vit(Pit),
  [qit, Kit] = Vit(Pit),
  Git = (e) => {
    const { __scopeMenu: t, open: n = !1, children: i, dir: r, onOpenChange: o, modal: s = !0 } = e,
      a = Hit(t),
      [l, c] = H.useState(null),
      d = H.useRef(!1),
      u = fx(o),
      h = bx(r);
    return (
      H.useEffect(() => {
        const e = () => {
            ((d.current = !0),
              document.addEventListener("pointerdown", t, { capture: !0, once: !0 }),
              document.addEventListener("pointermove", t, { capture: !0, once: !0 }));
          },
          t = () => (d.current = !1);
        return (
          document.addEventListener("keydown", e, { capture: !0 }),
          () => {
            (document.removeEventListener("keydown", e, { capture: !0 }),
              document.removeEventListener("pointerdown", t, { capture: !0 }),
              document.removeEventListener("pointermove", t, { capture: !0 }));
          }
        );
      }, []),
      Q.jsx(Sit, {
        ...a,
        children: Q.jsx(Uit, {
          scope: t,
          open: n,
          onOpenChange: u,
          content: l,
          onContentChange: c,
          children: Q.jsx(qit, {
            scope: t,
            onClose: H.useCallback(() => u(!1), [u]),
            isUsingKeyboardRef: d,
            dir: h,
            modal: s,
            children: i,
          }),
        }),
      })
    );
  };
Git.displayName = Pit;
var Zit = H.forwardRef((e, t) => {
  const { __scopeMenu: n, ...i } = e,
    r = Hit(n);
  return Q.jsx(kit, { ...r, ...i, ref: t });
});
Zit.displayName = "MenuAnchor";
var Yit = "MenuPortal",
  [Xit, Qit] = Vit(Yit, { forceMount: void 0 }),
  Jit = (e) => {
    const { __scopeMenu: t, forceMount: n, children: i, container: r } = e,
      o = $it(Yit, t);
    return Q.jsx(Xit, {
      scope: t,
      forceMount: n,
      children: Q.jsx(Fx, {
        present: n || o.open,
        children: Q.jsx(y8e, { asChild: !0, container: r, children: i }),
      }),
    });
  };
Jit.displayName = Yit;
var ert = "MenuContent",
  [trt, nrt] = Vit(ert),
  irt = H.forwardRef((e, t) => {
    const n = Qit(ert, e.__scopeMenu),
      { forceMount: i = n.forceMount, ...r } = e,
      o = $it(ert, e.__scopeMenu),
      s = Kit(ert, e.__scopeMenu);
    return Q.jsx(jit.Provider, {
      scope: e.__scopeMenu,
      children: Q.jsx(Fx, {
        present: i || o.open,
        children: Q.jsx(jit.Slot, {
          scope: e.__scopeMenu,
          children: s.modal ? Q.jsx(rrt, { ...r, ref: t }) : Q.jsx(ort, { ...r, ref: t }),
        }),
      }),
    });
  }),
  rrt = H.forwardRef((e, t) => {
    const n = $it(ert, e.__scopeMenu),
      i = H.useRef(null),
      r = Sp(t, i);
    return (
      H.useEffect(() => {
        const e = i.current;
        if (e) return b9e(e);
      }, []),
      Q.jsx(art, {
        ...e,
        ref: r,
        trapFocus: n.open,
        disableOutsidePointerEvents: n.open,
        disableOutsideScroll: !0,
        onFocusOutside: Qy(e.onFocusOutside, (e) => e.preventDefault(), {
          checkForDefaultPrevented: !1,
        }),
        onDismiss: () => n.onOpenChange(!1),
      })
    );
  }),
  ort = H.forwardRef((e, t) => {
    const n = $it(ert, e.__scopeMenu);
    return Q.jsx(art, {
      ...e,
      ref: t,
      trapFocus: !1,
      disableOutsidePointerEvents: !1,
      disableOutsideScroll: !1,
      onDismiss: () => n.onOpenChange(!1),
    });
  }),
  srt = (function (e) {
    const t = Lit(e),
      n = H.forwardRef((e, n) => {
        const { children: i, ...r } = e,
          o = H.Children.toArray(i),
          s = o.find(Tit);
        if (s) {
          const e = s.props.children,
            i = o.map((t) =>
              t === s
                ? H.Children.count(e) > 1
                  ? H.Children.only(null)
                  : H.isValidElement(e)
                    ? e.props.children
                    : null
                : t,
            );
          return Q.jsx(t, {
            ...r,
            ref: n,
            children: H.isValidElement(e) ? H.cloneElement(e, void 0, i) : null,
          });
        }
        return Q.jsx(t, { ...r, ref: n, children: i });
      });
    return ((n.displayName = `${e}.Slot`), n);
  })("MenuContent.ScrollLock"),
  art = H.forwardRef((e, t) => {
    const {
        __scopeMenu: n,
        loop: i = !1,
        trapFocus: r,
        onOpenAutoFocus: o,
        onCloseAutoFocus: s,
        disableOutsidePointerEvents: a,
        onEntryFocus: l,
        onEscapeKeyDown: c,
        onPointerDownOutside: d,
        onFocusOutside: u,
        onInteractOutside: h,
        onDismiss: g,
        disableOutsideScroll: p,
        ...f
      } = e,
      m = $it(ert, n),
      _ = Kit(ert, n),
      v = Hit(n),
      b = zit(n),
      y = Fit(n),
      [x, w] = H.useState(null),
      C = H.useRef(null),
      S = Sp(t, C, m.onContentChange),
      k = H.useRef(0),
      E = H.useRef(""),
      N = H.useRef(0),
      L = H.useRef(null),
      D = H.useRef("right"),
      T = H.useRef(0),
      I = p ? h9e : H.Fragment,
      R = p ? { as: srt, allowPinchZoom: !0 } : void 0,
      O = (e) => {
        const t = E.current + e,
          n = y().filter((e) => !e.disabled),
          i = document.activeElement,
          r = n.find((e) => e.ref.current === i)?.textValue,
          o = (function (e, t, n) {
            const i = t.length > 1 && Array.from(t).every((e) => e === t[0]),
              r = i ? t[0] : t,
              o = n ? e.indexOf(n) : -1;
            let s = (function (e, t) {
              return e.map((n, i) => e[(t + i) % e.length]);
            })(e, Math.max(o, 0));
            1 === r.length && (s = s.filter((e) => e !== n));
            const a = s.find((e) => e.toLowerCase().startsWith(r.toLowerCase()));
            return a !== n ? a : void 0;
          })(
            n.map((e) => e.textValue),
            t,
            r,
          ),
          s = n.find((e) => e.textValue === o)?.ref.current;
        (!(function e(t) {
          ((E.current = t),
            window.clearTimeout(k.current),
            "" !== t && (k.current = window.setTimeout(() => e(""), 1e3)));
        })(t),
          s && setTimeout(() => s.focus()));
      };
    (H.useEffect(() => () => window.clearTimeout(k.current), []), w8e());
    const M = H.useCallback(
      (e) =>
        D.current === L.current?.side &&
        (function (e, t) {
          if (!t) return !1;
          const n = { x: e.clientX, y: e.clientY };
          return (function (e, t) {
            const { x: n, y: i } = e;
            let r = !1;
            for (let o = 0, s = t.length - 1; o < t.length; s = o++) {
              const e = t[o],
                a = t[s],
                l = e.x,
                c = e.y,
                d = a.x,
                u = a.y;
              c > i != u > i && n < ((d - l) * (i - c)) / (u - c) + l && (r = !r);
            }
            return r;
          })(n, t);
        })(e, L.current?.area),
      [],
    );
    return Q.jsx(trt, {
      scope: n,
      searchRef: E,
      onItemEnter: H.useCallback(
        (e) => {
          M(e) && e.preventDefault();
        },
        [M],
      ),
      onItemLeave: H.useCallback(
        (e) => {
          M(e) || (C.current?.focus(), w(null));
        },
        [M],
      ),
      onTriggerLeave: H.useCallback(
        (e) => {
          M(e) && e.preventDefault();
        },
        [M],
      ),
      pointerGraceTimerRef: N,
      onPointerGraceIntentChange: H.useCallback((e) => {
        L.current = e;
      }, []),
      children: Q.jsx(I, {
        ...R,
        children: Q.jsx(g8e, {
          asChild: !0,
          trapped: r,
          onMountAutoFocus: Qy(o, (e) => {
            (e.preventDefault(), C.current?.focus({ preventScroll: !0 }));
          }),
          onUnmountAutoFocus: s,
          children: Q.jsx(a8e, {
            asChild: !0,
            disableOutsidePointerEvents: a,
            onEscapeKeyDown: c,
            onPointerDownOutside: d,
            onFocusOutside: u,
            onInteractOutside: h,
            onDismiss: g,
            children: Q.jsx(Px, {
              asChild: !0,
              ...b,
              dir: _.dir,
              orientation: "vertical",
              loop: i,
              currentTabStopId: x,
              onCurrentTabStopIdChange: w,
              onEntryFocus: Qy(l, (e) => {
                _.isUsingKeyboardRef.current || e.preventDefault();
              }),
              preventScrollOnEntryFocus: !0,
              children: Q.jsx(Eit, {
                role: "menu",
                "aria-orientation": "vertical",
                "data-state": Ort(m.open),
                "data-radix-menu-content": "",
                dir: _.dir,
                ...v,
                ...f,
                ref: S,
                style: { outline: "none", ...f.style },
                onKeyDown: Qy(f.onKeyDown, (e) => {
                  const t = e.target.closest("[data-radix-menu-content]") === e.currentTarget,
                    n = e.ctrlKey || e.altKey || e.metaKey,
                    i = 1 === e.key.length;
                  t && ("Tab" === e.key && e.preventDefault(), !n && i && O(e.key));
                  const r = C.current;
                  if (e.target !== r) return;
                  if (!Oit.includes(e.key)) return;
                  e.preventDefault();
                  const o = y()
                    .filter((e) => !e.disabled)
                    .map((e) => e.ref.current);
                  (Rit.includes(e.key) && o.reverse(),
                    (function (e) {
                      const t = document.activeElement;
                      for (const n of e) {
                        if (n === t) return;
                        if ((n.focus(), document.activeElement !== t)) return;
                      }
                    })(o));
                }),
                onBlur: Qy(e.onBlur, (e) => {
                  e.currentTarget.contains(e.target) ||
                    (window.clearTimeout(k.current), (E.current = ""));
                }),
                onPointerMove: Qy(
                  e.onPointerMove,
                  Prt((e) => {
                    const t = e.target,
                      n = T.current !== e.clientX;
                    if (e.currentTarget.contains(t) && n) {
                      const t = e.clientX > T.current ? "right" : "left";
                      ((D.current = t), (T.current = e.clientX));
                    }
                  }),
                ),
              }),
            }),
          }),
        }),
      }),
    });
  });
irt.displayName = ert;
var lrt = H.forwardRef((e, t) => {
  const { __scopeMenu: n, ...i } = e;
  return Q.jsx(gx.div, { role: "group", ...i, ref: t });
});
lrt.displayName = "MenuGroup";
var crt = H.forwardRef((e, t) => {
  const { __scopeMenu: n, ...i } = e;
  return Q.jsx(gx.div, { ...i, ref: t });
});
crt.displayName = "MenuLabel";
var drt = "MenuItem",
  urt = "menu.itemSelect",
  hrt = H.forwardRef((e, t) => {
    const { disabled: n = !1, onSelect: i, ...r } = e,
      o = H.useRef(null),
      s = Kit(drt, e.__scopeMenu),
      a = nrt(drt, e.__scopeMenu),
      l = Sp(t, o),
      c = H.useRef(!1);
    return Q.jsx(grt, {
      ...r,
      ref: l,
      disabled: n,
      onClick: Qy(e.onClick, () => {
        const e = o.current;
        if (!n && e) {
          const t = new CustomEvent(urt, { bubbles: !0, cancelable: !0 });
          (e.addEventListener(urt, (e) => i?.(e), { once: !0 }),
            px(e, t),
            t.defaultPrevented ? (c.current = !1) : s.onClose());
        }
      }),
      onPointerDown: (t) => {
        (e.onPointerDown?.(t), (c.current = !0));
      },
      onPointerUp: Qy(e.onPointerUp, (e) => {
        c.current || e.currentTarget?.click();
      }),
      onKeyDown: Qy(e.onKeyDown, (e) => {
        const t = "" !== a.searchRef.current;
        n ||
          (t && " " === e.key) ||
          (Iit.includes(e.key) && (e.currentTarget.click(), e.preventDefault()));
      }),
    });
  });
hrt.displayName = drt;
var grt = H.forwardRef((e, t) => {
    const { __scopeMenu: n, disabled: i = !1, textValue: r, ...o } = e,
      s = nrt(drt, n),
      a = zit(n),
      l = H.useRef(null),
      c = Sp(t, l),
      [d, u] = H.useState(!1),
      [h, g] = H.useState("");
    return (
      H.useEffect(() => {
        const e = l.current;
        e && g((e.textContent ?? "").trim());
      }, [o.children]),
      Q.jsx(jit.ItemSlot, {
        scope: n,
        disabled: i,
        textValue: r ?? h,
        children: Q.jsx(jx, {
          asChild: !0,
          ...a,
          focusable: !i,
          children: Q.jsx(gx.div, {
            role: "menuitem",
            "data-highlighted": d ? "" : void 0,
            "aria-disabled": i || void 0,
            "data-disabled": i ? "" : void 0,
            ...o,
            ref: c,
            onPointerMove: Qy(
              e.onPointerMove,
              Prt((e) => {
                if (i) s.onItemLeave(e);
                else if ((s.onItemEnter(e), !e.defaultPrevented)) {
                  e.currentTarget.focus({ preventScroll: !0 });
                }
              }),
            ),
            onPointerLeave: Qy(
              e.onPointerLeave,
              Prt((e) => s.onItemLeave(e)),
            ),
            onFocus: Qy(e.onFocus, () => u(!0)),
            onBlur: Qy(e.onBlur, () => u(!1)),
          }),
        }),
      })
    );
  }),
  prt = H.forwardRef((e, t) => {
    const { checked: n = !1, onCheckedChange: i, ...r } = e;
    return Q.jsx(wrt, {
      scope: e.__scopeMenu,
      checked: n,
      children: Q.jsx(hrt, {
        role: "menuitemcheckbox",
        "aria-checked": Mrt(n) ? "mixed" : n,
        ...r,
        ref: t,
        "data-state": Art(n),
        onSelect: Qy(r.onSelect, () => i?.(!!Mrt(n) || !n), { checkForDefaultPrevented: !1 }),
      }),
    });
  });
prt.displayName = "MenuCheckboxItem";
var frt = "MenuRadioGroup",
  [mrt, _rt] = Vit(frt, { value: void 0, onValueChange: () => {} }),
  vrt = H.forwardRef((e, t) => {
    const { value: n, onValueChange: i, ...r } = e,
      o = fx(i);
    return Q.jsx(mrt, {
      scope: e.__scopeMenu,
      value: n,
      onValueChange: o,
      children: Q.jsx(lrt, { ...r, ref: t }),
    });
  });
vrt.displayName = frt;
var brt = "MenuRadioItem",
  yrt = H.forwardRef((e, t) => {
    const { value: n, ...i } = e,
      r = _rt(brt, e.__scopeMenu),
      o = n === r.value;
    return Q.jsx(wrt, {
      scope: e.__scopeMenu,
      checked: o,
      children: Q.jsx(hrt, {
        role: "menuitemradio",
        "aria-checked": o,
        ...i,
        ref: t,
        "data-state": Art(o),
        onSelect: Qy(i.onSelect, () => r.onValueChange?.(n), { checkForDefaultPrevented: !1 }),
      }),
    });
  });
yrt.displayName = brt;
var xrt = "MenuItemIndicator",
  [wrt, Crt] = Vit(xrt, { checked: !1 }),
  Srt = H.forwardRef((e, t) => {
    const { __scopeMenu: n, forceMount: i, ...r } = e,
      o = Crt(xrt, n);
    return Q.jsx(Fx, {
      present: i || Mrt(o.checked) || !0 === o.checked,
      children: Q.jsx(gx.span, { ...r, ref: t, "data-state": Art(o.checked) }),
    });
  });
Srt.displayName = xrt;
var krt = H.forwardRef((e, t) => {
  const { __scopeMenu: n, ...i } = e;
  return Q.jsx(gx.div, { role: "separator", "aria-orientation": "horizontal", ...i, ref: t });
});
krt.displayName = "MenuSeparator";
var Ert = H.forwardRef((e, t) => {
  const { __scopeMenu: n, ...i } = e,
    r = Hit(n);
  return Q.jsx(Nit, { ...r, ...i, ref: t });
});
Ert.displayName = "MenuArrow";
var [Nrt, Lrt] = Vit("MenuSub"),
  Drt = "MenuSubTrigger",
  Trt = H.forwardRef((e, t) => {
    const n = $it(Drt, e.__scopeMenu),
      i = Kit(Drt, e.__scopeMenu),
      r = Lrt(Drt, e.__scopeMenu),
      o = nrt(Drt, e.__scopeMenu),
      s = H.useRef(null),
      { pointerGraceTimerRef: a, onPointerGraceIntentChange: l } = o,
      c = { __scopeMenu: e.__scopeMenu },
      d = H.useCallback(() => {
        (s.current && window.clearTimeout(s.current), (s.current = null));
      }, []);
    return (
      H.useEffect(() => d, [d]),
      H.useEffect(() => {
        const e = a.current;
        return () => {
          (window.clearTimeout(e), l(null));
        };
      }, [a, l]),
      Q.jsx(Zit, {
        asChild: !0,
        ...c,
        children: Q.jsx(grt, {
          id: r.triggerId,
          "aria-haspopup": "menu",
          "aria-expanded": n.open,
          "aria-controls": r.contentId,
          "data-state": Ort(n.open),
          ...e,
          ref: Cp(t, r.onTriggerChange),
          onClick: (t) => {
            (e.onClick?.(t),
              e.disabled ||
                t.defaultPrevented ||
                (t.currentTarget.focus(), n.open || n.onOpenChange(!0)));
          },
          onPointerMove: Qy(
            e.onPointerMove,
            Prt((t) => {
              (o.onItemEnter(t),
                t.defaultPrevented ||
                  e.disabled ||
                  n.open ||
                  s.current ||
                  (o.onPointerGraceIntentChange(null),
                  (s.current = window.setTimeout(() => {
                    (n.onOpenChange(!0), d());
                  }, 100))));
            }),
          ),
          onPointerLeave: Qy(
            e.onPointerLeave,
            Prt((e) => {
              d();
              const t = n.content?.getBoundingClientRect();
              if (t) {
                const i = n.content?.dataset.side,
                  r = "right" === i,
                  s = r ? -5 : 5,
                  l = t[r ? "left" : "right"],
                  c = t[r ? "right" : "left"];
                (o.onPointerGraceIntentChange({
                  area: [
                    { x: e.clientX + s, y: e.clientY },
                    { x: l, y: t.top },
                    { x: c, y: t.top },
                    { x: c, y: t.bottom },
                    { x: l, y: t.bottom },
                  ],
                  side: i,
                }),
                  window.clearTimeout(a.current),
                  (a.current = window.setTimeout(() => o.onPointerGraceIntentChange(null), 300)));
              } else {
                if ((o.onTriggerLeave(e), e.defaultPrevented)) return;
                o.onPointerGraceIntentChange(null);
              }
            }),
          ),
          onKeyDown: Qy(e.onKeyDown, (t) => {
            const r = "" !== o.searchRef.current;
            e.disabled ||
              (r && " " === t.key) ||
              (Mit[i.dir].includes(t.key) &&
                (n.onOpenChange(!0), n.content?.focus(), t.preventDefault()));
          }),
        }),
      })
    );
  });
Trt.displayName = Drt;
var Irt = "MenuSubContent",
  Rrt = H.forwardRef((e, t) => {
    const n = Qit(ert, e.__scopeMenu),
      { forceMount: i = n.forceMount, ...r } = e,
      o = $it(ert, e.__scopeMenu),
      s = Kit(ert, e.__scopeMenu),
      a = Lrt(Irt, e.__scopeMenu),
      l = H.useRef(null),
      c = Sp(t, l);
    return Q.jsx(jit.Provider, {
      scope: e.__scopeMenu,
      children: Q.jsx(Fx, {
        present: i || o.open,
        children: Q.jsx(jit.Slot, {
          scope: e.__scopeMenu,
          children: Q.jsx(art, {
            id: a.contentId,
            "aria-labelledby": a.triggerId,
            ...r,
            ref: c,
            align: "start",
            side: "rtl" === s.dir ? "left" : "right",
            disableOutsidePointerEvents: !1,
            disableOutsideScroll: !1,
            trapFocus: !1,
            onOpenAutoFocus: (e) => {
              (s.isUsingKeyboardRef.current && l.current?.focus(), e.preventDefault());
            },
            onCloseAutoFocus: (e) => e.preventDefault(),
            onFocusOutside: Qy(e.onFocusOutside, (e) => {
              e.target !== a.trigger && o.onOpenChange(!1);
            }),
            onEscapeKeyDown: Qy(e.onEscapeKeyDown, (e) => {
              (s.onClose(), e.preventDefault());
            }),
            onKeyDown: Qy(e.onKeyDown, (e) => {
              const t = e.currentTarget.contains(e.target),
                n = Ait[s.dir].includes(e.key);
              t && n && (o.onOpenChange(!1), a.trigger?.focus(), e.preventDefault());
            }),
          }),
        }),
      }),
    });
  });
function Ort(e) {
  return e ? "open" : "closed";
}
function Mrt(e) {
  return "indeterminate" === e;
}
function Art(e) {
  return Mrt(e) ? "indeterminate" : e ? "checked" : "unchecked";
}
function Prt(e) {
  return (t) => ("mouse" === t.pointerType ? e(t) : void 0);
}
Rrt.displayName = Irt;
var jrt = Git,
  Frt = Zit,
  Brt = Jit,
  Vrt = irt,
  Wrt = lrt,
  Hrt = crt,
  zrt = hrt,
  Urt = prt,
  $rt = vrt,
  qrt = yrt,
  Krt = Srt,
  Grt = krt,
  Zrt = Ert,
  Yrt = Trt,
  Xrt = Rrt,
  Qrt = "DropdownMenu",
  [Jrt] = Jy(Qrt, [Wit]),
  eot = Wit(),
  [tot, not] = Jrt(Qrt),
  iot = (e) => {
    const {
        __scopeDropdownMenu: t,
        children: n,
        dir: i,
        open: r,
        defaultOpen: o,
        onOpenChange: s,
        modal: a = !0,
      } = e,
      l = eot(t),
      c = H.useRef(null),
      [d, u] = _x({ prop: r, defaultProp: o ?? !1, onChange: s, caller: Qrt });
    return Q.jsx(tot, {
      scope: t,
      triggerId: cx(),
      triggerRef: c,
      contentId: cx(),
      open: d,
      onOpenChange: u,
      onOpenToggle: H.useCallback(() => u((e) => !e), [u]),
      modal: a,
      children: Q.jsx(jrt, { ...l, open: d, onOpenChange: u, dir: i, modal: a, children: n }),
    });
  };
iot.displayName = Qrt;
var rot = "DropdownMenuTrigger",
  oot = H.forwardRef((e, t) => {
    const { __scopeDropdownMenu: n, disabled: i = !1, ...r } = e,
      o = not(rot, n),
      s = eot(n);
    return Q.jsx(Frt, {
      asChild: !0,
      ...s,
      children: Q.jsx(gx.button, {
        type: "button",
        id: o.triggerId,
        "aria-haspopup": "menu",
        "aria-expanded": o.open,
        "aria-controls": o.open ? o.contentId : void 0,
        "data-state": o.open ? "open" : "closed",
        "data-disabled": i ? "" : void 0,
        disabled: i,
        ...r,
        ref: Cp(t, o.triggerRef),
        onPointerDown: Qy(e.onPointerDown, (e) => {
          i ||
            0 !== e.button ||
            !1 !== e.ctrlKey ||
            (o.onOpenToggle(), o.open || e.preventDefault());
        }),
        onKeyDown: Qy(e.onKeyDown, (e) => {
          i ||
            (["Enter", " "].includes(e.key) && o.onOpenToggle(),
            "ArrowDown" === e.key && o.onOpenChange(!0),
            ["Enter", " ", "ArrowDown"].includes(e.key) && e.preventDefault());
        }),
      }),
    });
  });
oot.displayName = rot;
var sot = (e) => {
  const { __scopeDropdownMenu: t, ...n } = e,
    i = eot(t);
  return Q.jsx(Brt, { ...i, ...n });
};
sot.displayName = "DropdownMenuPortal";
var aot = "DropdownMenuContent",
  lot = H.forwardRef((e, t) => {
    const { __scopeDropdownMenu: n, ...i } = e,
      r = not(aot, n),
      o = eot(n),
      s = H.useRef(!1);
    return Q.jsx(Vrt, {
      id: r.contentId,
      "aria-labelledby": r.triggerId,
      ...o,
      ...i,
      ref: t,
      onCloseAutoFocus: Qy(e.onCloseAutoFocus, (e) => {
        (s.current || r.triggerRef.current?.focus(), (s.current = !1), e.preventDefault());
      }),
      onInteractOutside: Qy(e.onInteractOutside, (e) => {
        const t = e.detail.originalEvent,
          n = 0 === t.button && !0 === t.ctrlKey,
          i = 2 === t.button || n;
        (r.modal && !i) || (s.current = !0);
      }),
      style: {
        ...e.style,
        "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
        "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
        "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
        "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
        "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)",
      },
    });
  });
lot.displayName = aot;
H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(Wrt, { ...r, ...i, ref: t });
}).displayName = "DropdownMenuGroup";
var cot = H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(Hrt, { ...r, ...i, ref: t });
});
cot.displayName = "DropdownMenuLabel";
var dot = H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(zrt, { ...r, ...i, ref: t });
});
dot.displayName = "DropdownMenuItem";
var uot = H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(Urt, { ...r, ...i, ref: t });
});
uot.displayName = "DropdownMenuCheckboxItem";
H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx($rt, { ...r, ...i, ref: t });
}).displayName = "DropdownMenuRadioGroup";
var hot = H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(qrt, { ...r, ...i, ref: t });
});
hot.displayName = "DropdownMenuRadioItem";
var got = H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(Krt, { ...r, ...i, ref: t });
});
got.displayName = "DropdownMenuItemIndicator";
var pot = H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(Grt, { ...r, ...i, ref: t });
});
pot.displayName = "DropdownMenuSeparator";
H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(Zrt, { ...r, ...i, ref: t });
}).displayName = "DropdownMenuArrow";
var fot = H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(Yrt, { ...r, ...i, ref: t });
});
fot.displayName = "DropdownMenuSubTrigger";
var mot = H.forwardRef((e, t) => {
  const { __scopeDropdownMenu: n, ...i } = e,
    r = eot(n);
  return Q.jsx(Xrt, {
    ...r,
    ...i,
    ref: t,
    style: {
      ...e.style,
      "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
      "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
      "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)",
    },
  });
});
mot.displayName = "DropdownMenuSubContent";
var _ot = sot,
  vot = lot,
  bot = cot,
  yot = dot,
  xot = uot,
  wot = hot,
  Cot = got,
  Sot = pot,
  kot = fot,
  Eot = mot;
const Not = iot,
  Lot = oot,
  Dot = H.forwardRef(({ className: e, inset: t, children: n, ...i }, r) =>
    Q.jsxs(kot, {
      ref: r,
      className: Rf(
        "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
        t && "pl-8",
        e,
      ),
      ...i,
      children: [n, Q.jsx(y7e, { className: "ml-auto h-4 w-4" })],
    }),
  );
Dot.displayName = kot.displayName;
const Tot = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(Eot, {
    ref: n,
    className: Rf(
      "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
      e,
    ),
    ...t,
  }),
);
Tot.displayName = Eot.displayName;
const Iot = H.forwardRef(({ className: e, sideOffset: t = 4, ...n }, i) =>
  Q.jsx(_ot, {
    children: Q.jsx(vot, {
      ref: i,
      sideOffset: t,
      className: Rf(
        "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
        "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
        e,
      ),
      ...n,
    }),
  }),
);
Iot.displayName = vot.displayName;
const Rot = H.forwardRef(({ className: e, inset: t, ...n }, i) =>
  Q.jsx(yot, {
    ref: i,
    className: Rf(
      "relative flex cursor-default cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
      t && "pl-8",
      e,
    ),
    ...n,
  }),
);
Rot.displayName = yot.displayName;
const Oot = H.forwardRef(({ className: e, children: t, checked: n, ...i }, r) =>
  Q.jsxs(xot, {
    ref: r,
    className: Rf(
      "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
      e,
    ),
    checked: n,
    ...i,
    children: [
      Q.jsx("span", {
        className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
        children: Q.jsx(Cot, { children: Q.jsx(h7e, { className: "h-4 w-4" }) }),
      }),
      t,
    ],
  }),
);
Oot.displayName = xot.displayName;
const Mot = H.forwardRef(({ className: e, children: t, ...n }, i) =>
  Q.jsxs(wot, {
    ref: i,
    className: Rf(
      "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
      e,
    ),
    ...n,
    children: [
      Q.jsx("span", {
        className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
        children: Q.jsx(Cot, { children: Q.jsx(T7e, { className: "h-4 w-4 fill-current" }) }),
      }),
      t,
    ],
  }),
);
Mot.displayName = wot.displayName;
const Aot = H.forwardRef(({ className: e, inset: t, ...n }, i) =>
  Q.jsx(bot, { ref: i, className: Rf("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e), ...n }),
);
Aot.displayName = bot.displayName;
const Pot = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(Sot, { ref: n, className: Rf("-mx-1 my-1 h-px bg-muted", e), ...t }),
);
Pot.displayName = Sot.displayName;
const jot = ({ className: e, ...t }) =>
  Q.jsx("span", { className: Rf("ml-auto text-xs tracking-widest opacity-60", e), ...t });
jot.displayName = "DropdownMenuShortcut";
const Fot = [
  {
    code: "en-US",
    name: "English",
    flag: function (e) {
      var t = e.title,
        n = gtt(e, dtt);
      return z.createElement(
        "svg",
        htt({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 513 342" }, n),
        t && z.createElement("title", null, t),
        z.createElement(
          "g",
          { fill: "#FFF" },
          z.createElement("path", { d: "M0 0h513v341.3H0V0z" }),
          z.createElement("path", {
            d: "M311.7 230 513 341.3v-31.5L369.3 230h-57.6zM200.3 111.3 0 0v31.5l143.7 79.8h56.6z",
          }),
        ),
        z.createElement("path", {
          d: "M393.8 230 513 295.7V230H393.8zm-82.1 0L513 341.3v-31.5L369.3 230h-57.6zm146.9 111.3-147-81.7v81.7h147zM90.3 230 0 280.2V230h90.3zm110 14.2v97.2H25.5l174.8-97.2zm-82.1-132.9L0 45.6v65.7h118.2zm82.1 0L0 0v31.5l143.7 79.8h56.6zM53.4 0l147 81.7V0h-147zm368.3 111.3L513 61.1v50.2h-91.3zm-110-14.2V0h174.9L311.7 97.1z",
          fill: "#0052B4",
        }),
        z.createElement(
          "g",
          { fill: "#D80027" },
          z.createElement("path", { d: "M288 0h-64v138.7H0v64h224v138.7h64V202.7h224v-64H288V0z" }),
          z.createElement("path", {
            d: "M311.7 230 513 341.3v-31.5L369.3 230h-57.6zm-168 0L0 309.9v31.5L200.3 230h-56.6zm56.6-118.7L0 0v31.5l143.7 79.8h56.6zm168 0L513 31.5V0L311.7 111.3h56.6z",
          }),
        ),
      );
    },
    shortName: "EN",
  },
  {
    code: "zh-CN",
    name: "中文",
    flag: function (e) {
      var t = e.title,
        n = gtt(e, ctt);
      return z.createElement(
        "svg",
        htt({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 513 342" }, n),
        t && z.createElement("title", null, t),
        z.createElement("path", { fill: "#D80027", d: "M0 0h513v342H0z" }),
        z.createElement("path", {
          d: "m226.8 239.2-9.7-15.6-17.9 4.4 11.9-14.1-9.7-15.6 17.1 6.9 11.8-14.1-1.3 18.4 17.1 6.9-17.9 4.4zM290.6 82l-10.1 15.4 11.6 14.3-17.7-4.8-10.1 15.5-1-18.4-17.7-4.8 17.2-6.6-1-18.4 11.6 14.3zm-54.4-56.6-2 18.3 16.8 7.6-18 3.8-2 18.3-9.2-16-17.9 3.8 12.3-13.7-9.2-15.9 16.8 7.5zm56.6 136.4-14.9 10.9 5.8 17.5-14.9-10.8-14.9 11 5.6-17.6-14.9-10.7 18.4-.1 5.6-17.6 5.8 17.5zM115 46.3l17.3 53.5h56.2l-45.4 32.9 17.3 53.5-45.4-33-45.5 33 17.4-53.5-45.5-32.9h56.3z",
          fill: "#FFDA44",
        }),
      );
    },
    shortName: "CN",
  },
  {
    code: "ru-RU",
    name: "Русский",
    flag: function (e) {
      var t = e.title,
        n = gtt(e, utt);
      return z.createElement(
        "svg",
        htt({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 85.333 512 341.333" }, n),
        t && z.createElement("title", null, t),
        z.createElement("path", { fill: "#FFF", d: "M0 85.33v341.332h512V85.33z" }),
        z.createElement("path", { fill: "#0052B4", d: "M0 85.333h512V426.67H0z" }),
        z.createElement("path", { fill: "#FFF", d: "M0 85.333h512v113.775H0z" }),
        z.createElement("path", { fill: "#D80027", d: "M0 312.884h512v113.775H0z" }),
      );
    },
    shortName: "RU",
  },
];
function Bot() {
  const { i18n: e } = Py(),
    t = Fot.find((t) => t.code === e.language) || Fot[1],
    n = t.flag;
  return Q.jsxs(Not, {
    children: [
      Q.jsx(Lot, {
        asChild: !0,
        children: Q.jsxs(ltt, {
          variant: "ghost",
          size: "sm",
          className: "h-8 px-2 gap-1",
          children: [
            Q.jsx(n, { className: "h-4 w-5 rounded-sm shadow-sm" }),
            Q.jsx("span", { className: "text-sm font-medium", children: t.shortName }),
          ],
        }),
      }),
      Q.jsx(Iot, {
        align: "end",
        className: "w-[120px]",
        children: Fot.map((t) => {
          const n = t.flag,
            i = t.code === e.language;
          return Q.jsxs(
            Rot,
            {
              onClick: () => {
                return ((n = t.code), void e.changeLanguage(n));
                var n;
              },
              className: Rf("flex items-center gap-2 px-2 py-1.5 cursor-pointer", i && "bg-accent"),
              children: [
                Q.jsx(n, { className: "h-4 w-5 rounded-sm shadow-sm" }),
                Q.jsx("span", { className: Rf("text-sm", i && "font-medium"), children: t.name }),
              ],
            },
            t.code,
          );
        }),
      }),
    ],
  });
}
const Vot = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const [e, t] = H.useState(!1),
            { t: n } = Py("auth"),
            i = n("signIn.resetPassword.command");
          return Q.jsxs(Q.Fragment, {
            children: [
              Q.jsxs("div", {
                className:
                  "container relative flex min-h-svh flex-col items-center justify-center bg-primary-foreground px-4 py-8 lg:max-w-none lg:px-0",
                children: [
                  Q.jsx("div", {
                    className: "absolute right-4 top-4 md:right-8 md:top-8",
                    children: Q.jsx(Bot, {}),
                  }),
                  Q.jsxs("div", {
                    className:
                      "mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px] md:w-[420px] lg:p-8",
                    children: [
                      Q.jsxs("div", {
                        className: "flex flex-col space-y-2 text-center",
                        children: [
                          Q.jsx("h1", {
                            className: "text-2xl font-bold sm:text-3xl",
                            children: window?.settings?.title,
                          }),
                          Q.jsx("p", {
                            className: "text-sm text-muted-foreground",
                            children: window?.settings?.description,
                          }),
                        ],
                      }),
                      Q.jsxs(q6e, {
                        className: "p-4 sm:p-6",
                        children: [
                          Q.jsxs("div", {
                            className: "flex flex-col space-y-2 text-left",
                            children: [
                              Q.jsx("h1", {
                                className: "text-xl font-semibold tracking-tight sm:text-2xl",
                                children: n("signIn.title"),
                              }),
                              Q.jsx("p", {
                                className: "text-sm text-muted-foreground",
                                children: n("signIn.description"),
                              }),
                            ],
                          }),
                          Q.jsx(e8e, { onForgotPassword: () => t(!0) }),
                        ],
                      }),
                    ],
                  }),
                ],
              }),
              Q.jsx(Jet, {
                open: e,
                onOpenChange: t,
                children: Q.jsx(ttt, {
                  className: "max-w-[90vw] sm:max-w-lg",
                  children: Q.jsxs(ntt, {
                    children: [
                      Q.jsx(rtt, { children: n("signIn.resetPassword.title") }),
                      Q.jsx(ott, { children: n("signIn.resetPassword.description") }),
                      Q.jsx("div", {
                        className: "mt-4",
                        children: Q.jsxs("div", {
                          className: "relative",
                          children: [
                            Q.jsx("pre", {
                              className:
                                "max-w-full overflow-x-auto rounded-md bg-secondary p-4 pr-12 text-sm",
                              children: i,
                            }),
                            Q.jsx(ltt, {
                              variant: "ghost",
                              size: "icon",
                              className:
                                "absolute right-2 top-2 h-8 w-8 hover:bg-secondary-foreground/10",
                              onClick: () =>
                                TS(i).then(() => {
                                  hN.success(n("common:copy.success"));
                                }),
                              children: Q.jsx(em, { className: "h-4 w-4" }),
                            }),
                          ],
                        }),
                      }),
                    ],
                  }),
                }),
              }),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  Wot = H.forwardRef(({ className: e, fadedBelow: t = !1, fixedHeight: n = !1, ...i }, r) =>
    Q.jsx("div", {
      ref: r,
      className: Rf(
        "relative flex h-full w-full flex-col",
        t &&
          "after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:hidden after:h-32 after:w-full after:bg-[linear-gradient(180deg,_transparent_10%,_hsl(var(--background))_70%)] after:md:block",
        n && "md:h-svh",
        e,
      ),
      ...i,
    }),
  );
Wot.displayName = "Layout";
const Hot = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("div", {
    ref: n,
    className: Rf(
      "flex h-[var(--header-height)] flex-none items-center gap-4 bg-background p-4 md:px-8",
      e,
    ),
    ...t,
  }),
);
Hot.displayName = "LayoutHeader";
const zot = H.forwardRef(({ className: e, fixedHeight: t, ...n }, i) =>
  Q.jsx("div", {
    ref: i,
    className: Rf(
      "flex-1 overflow-hidden px-4 py-6 md:px-8",
      t && "h-[calc(100%-var(--header-height))]",
      e,
    ),
    ...n,
  }),
);
zot.displayName = "LayoutBody";
var Uot = "Collapsible",
  [$ot] = Jy(Uot),
  [qot, Kot] = $ot(Uot),
  Got = H.forwardRef((e, t) => {
    const {
        __scopeCollapsible: n,
        open: i,
        defaultOpen: r,
        disabled: o,
        onOpenChange: s,
        ...a
      } = e,
      [l, c] = _x({ prop: i, defaultProp: r ?? !1, onChange: s, caller: Uot });
    return Q.jsx(qot, {
      scope: n,
      disabled: o,
      contentId: cx(),
      open: l,
      onOpenToggle: H.useCallback(() => c((e) => !e), [c]),
      children: Q.jsx(gx.div, {
        "data-state": est(l),
        "data-disabled": o ? "" : void 0,
        ...a,
        ref: t,
      }),
    });
  });
Got.displayName = Uot;
var Zot = "CollapsibleTrigger",
  Yot = H.forwardRef((e, t) => {
    const { __scopeCollapsible: n, ...i } = e,
      r = Kot(Zot, n);
    return Q.jsx(gx.button, {
      type: "button",
      "aria-controls": r.contentId,
      "aria-expanded": r.open || !1,
      "data-state": est(r.open),
      "data-disabled": r.disabled ? "" : void 0,
      disabled: r.disabled,
      ...i,
      ref: t,
      onClick: Qy(e.onClick, r.onOpenToggle),
    });
  });
Yot.displayName = Zot;
var Xot = "CollapsibleContent",
  Qot = H.forwardRef((e, t) => {
    const { forceMount: n, ...i } = e,
      r = Kot(Xot, e.__scopeCollapsible);
    return Q.jsx(Fx, {
      present: n || r.open,
      children: ({ present: e }) => Q.jsx(Jot, { ...i, ref: t, present: e }),
    });
  });
Qot.displayName = Xot;
var Jot = H.forwardRef((e, t) => {
  const { __scopeCollapsible: n, present: i, children: r, ...o } = e,
    s = Kot(Xot, n),
    [a, l] = H.useState(i),
    c = H.useRef(null),
    d = Sp(t, c),
    u = H.useRef(0),
    h = u.current,
    g = H.useRef(0),
    p = g.current,
    f = s.open || a,
    m = H.useRef(f),
    _ = H.useRef(void 0);
  return (
    H.useEffect(() => {
      const e = requestAnimationFrame(() => (m.current = !1));
      return () => cancelAnimationFrame(e);
    }, []),
    sx(() => {
      const e = c.current;
      if (e) {
        ((_.current = _.current || {
          transitionDuration: e.style.transitionDuration,
          animationName: e.style.animationName,
        }),
          (e.style.transitionDuration = "0s"),
          (e.style.animationName = "none"));
        const t = e.getBoundingClientRect();
        ((u.current = t.height),
          (g.current = t.width),
          m.current ||
            ((e.style.transitionDuration = _.current.transitionDuration),
            (e.style.animationName = _.current.animationName)),
          l(i));
      }
    }, [s.open, i]),
    Q.jsx(gx.div, {
      "data-state": est(s.open),
      "data-disabled": s.disabled ? "" : void 0,
      id: s.contentId,
      hidden: !f,
      ...o,
      ref: d,
      style: {
        "--radix-collapsible-content-height": h ? `${h}px` : void 0,
        "--radix-collapsible-content-width": p ? `${p}px` : void 0,
        ...e.style,
      },
      children: f && r,
    })
  );
});
function est(e) {
  return e ? "open" : "closed";
}
const tst = Got,
  nst = Yot,
  ist = Qot;
var rst = Symbol("radix.slottable");
var ost = Object.freeze({
    position: "absolute",
    border: 0,
    width: 1,
    height: 1,
    padding: 0,
    margin: -1,
    overflow: "hidden",
    clip: "rect(0, 0, 0, 0)",
    whiteSpace: "nowrap",
    wordWrap: "normal",
  }),
  sst = H.forwardRef((e, t) => Q.jsx(gx.span, { ...e, ref: t, style: { ...ost, ...e.style } }));
sst.displayName = "VisuallyHidden";
var ast = sst,
  [lst] = Jy("Tooltip", [lit]),
  cst = lit(),
  dst = "TooltipProvider",
  ust = 700,
  hst = "tooltip.open",
  [gst, pst] = lst(dst),
  fst = (e) => {
    const {
        __scopeTooltip: t,
        delayDuration: n = ust,
        skipDelayDuration: i = 300,
        disableHoverableContent: r = !1,
        children: o,
      } = e,
      s = H.useRef(!0),
      a = H.useRef(!1),
      l = H.useRef(0);
    return (
      H.useEffect(() => {
        const e = l.current;
        return () => window.clearTimeout(e);
      }, []),
      Q.jsx(gst, {
        scope: t,
        isOpenDelayedRef: s,
        delayDuration: n,
        onOpen: H.useCallback(() => {
          (window.clearTimeout(l.current), (s.current = !1));
        }, []),
        onClose: H.useCallback(() => {
          (window.clearTimeout(l.current),
            (l.current = window.setTimeout(() => (s.current = !0), i)));
        }, [i]),
        isPointerInTransitRef: a,
        onPointerInTransitChange: H.useCallback((e) => {
          a.current = e;
        }, []),
        disableHoverableContent: r,
        children: o,
      })
    );
  };
fst.displayName = dst;
var mst = "Tooltip",
  [_st, vst] = lst(mst),
  bst = (e) => {
    const {
        __scopeTooltip: t,
        children: n,
        open: i,
        defaultOpen: r,
        onOpenChange: o,
        disableHoverableContent: s,
        delayDuration: a,
      } = e,
      l = pst(mst, e.__scopeTooltip),
      c = cst(t),
      [d, u] = H.useState(null),
      h = cx(),
      g = H.useRef(0),
      p = s ?? l.disableHoverableContent,
      f = a ?? l.delayDuration,
      m = H.useRef(!1),
      [_, v] = _x({
        prop: i,
        defaultProp: r ?? !1,
        onChange: (e) => {
          (e ? (l.onOpen(), document.dispatchEvent(new CustomEvent(hst))) : l.onClose(), o?.(e));
        },
        caller: mst,
      }),
      b = H.useMemo(() => (_ ? (m.current ? "delayed-open" : "instant-open") : "closed"), [_]),
      y = H.useCallback(() => {
        (window.clearTimeout(g.current), (g.current = 0), (m.current = !1), v(!0));
      }, [v]),
      x = H.useCallback(() => {
        (window.clearTimeout(g.current), (g.current = 0), v(!1));
      }, [v]),
      w = H.useCallback(() => {
        (window.clearTimeout(g.current),
          (g.current = window.setTimeout(() => {
            ((m.current = !0), v(!0), (g.current = 0));
          }, f)));
      }, [f, v]);
    return (
      H.useEffect(
        () => () => {
          g.current && (window.clearTimeout(g.current), (g.current = 0));
        },
        [],
      ),
      Q.jsx(Sit, {
        ...c,
        children: Q.jsx(_st, {
          scope: t,
          contentId: h,
          open: _,
          stateAttribute: b,
          trigger: d,
          onTriggerChange: u,
          onTriggerEnter: H.useCallback(() => {
            l.isOpenDelayedRef.current ? w() : y();
          }, [l.isOpenDelayedRef, w, y]),
          onTriggerLeave: H.useCallback(() => {
            p ? x() : (window.clearTimeout(g.current), (g.current = 0));
          }, [x, p]),
          onOpen: y,
          onClose: x,
          disableHoverableContent: p,
          children: n,
        }),
      })
    );
  };
bst.displayName = mst;
var yst = "TooltipTrigger",
  xst = H.forwardRef((e, t) => {
    const { __scopeTooltip: n, ...i } = e,
      r = vst(yst, n),
      o = pst(yst, n),
      s = cst(n),
      a = Sp(t, H.useRef(null), r.onTriggerChange),
      l = H.useRef(!1),
      c = H.useRef(!1),
      d = H.useCallback(() => (l.current = !1), []);
    return (
      H.useEffect(() => () => document.removeEventListener("pointerup", d), [d]),
      Q.jsx(kit, {
        asChild: !0,
        ...s,
        children: Q.jsx(gx.button, {
          "aria-describedby": r.open ? r.contentId : void 0,
          "data-state": r.stateAttribute,
          ...i,
          ref: a,
          onPointerMove: Qy(e.onPointerMove, (e) => {
            "touch" !== e.pointerType &&
              (c.current ||
                o.isPointerInTransitRef.current ||
                (r.onTriggerEnter(), (c.current = !0)));
          }),
          onPointerLeave: Qy(e.onPointerLeave, () => {
            (r.onTriggerLeave(), (c.current = !1));
          }),
          onPointerDown: Qy(e.onPointerDown, () => {
            (r.open && r.onClose(),
              (l.current = !0),
              document.addEventListener("pointerup", d, { once: !0 }));
          }),
          onFocus: Qy(e.onFocus, () => {
            l.current || r.onOpen();
          }),
          onBlur: Qy(e.onBlur, r.onClose),
          onClick: Qy(e.onClick, r.onClose),
        }),
      })
    );
  });
xst.displayName = yst;
var wst = "TooltipPortal",
  [Cst, Sst] = lst(wst, { forceMount: void 0 }),
  kst = (e) => {
    const { __scopeTooltip: t, forceMount: n, children: i, container: r } = e,
      o = vst(wst, t);
    return Q.jsx(Cst, {
      scope: t,
      forceMount: n,
      children: Q.jsx(Fx, {
        present: n || o.open,
        children: Q.jsx(y8e, { asChild: !0, container: r, children: i }),
      }),
    });
  };
kst.displayName = wst;
var Est = "TooltipContent",
  Nst = H.forwardRef((e, t) => {
    const n = Sst(Est, e.__scopeTooltip),
      { forceMount: i = n.forceMount, side: r = "top", ...o } = e,
      s = vst(Est, e.__scopeTooltip);
    return Q.jsx(Fx, {
      present: i || s.open,
      children: s.disableHoverableContent
        ? Q.jsx(Rst, { side: r, ...o, ref: t })
        : Q.jsx(Lst, { side: r, ...o, ref: t }),
    });
  }),
  Lst = H.forwardRef((e, t) => {
    const n = vst(Est, e.__scopeTooltip),
      i = pst(Est, e.__scopeTooltip),
      r = H.useRef(null),
      o = Sp(t, r),
      [s, a] = H.useState(null),
      { trigger: l, onClose: c } = n,
      d = r.current,
      { onPointerInTransitChange: u } = i,
      h = H.useCallback(() => {
        (a(null), u(!1));
      }, [u]),
      g = H.useCallback(
        (e, t) => {
          const n = e.currentTarget,
            i = { x: e.clientX, y: e.clientY },
            r = (function (e, t) {
              const n = Math.abs(t.top - e.y),
                i = Math.abs(t.bottom - e.y),
                r = Math.abs(t.right - e.x),
                o = Math.abs(t.left - e.x);
              switch (Math.min(n, i, r, o)) {
                case o:
                  return "left";
                case r:
                  return "right";
                case n:
                  return "top";
                case i:
                  return "bottom";
                default:
                  throw new Error("unreachable");
              }
            })(i, n.getBoundingClientRect()),
            o = (function (e, t, n = 5) {
              const i = [];
              switch (t) {
                case "top":
                  i.push({ x: e.x - n, y: e.y + n }, { x: e.x + n, y: e.y + n });
                  break;
                case "bottom":
                  i.push({ x: e.x - n, y: e.y - n }, { x: e.x + n, y: e.y - n });
                  break;
                case "left":
                  i.push({ x: e.x + n, y: e.y - n }, { x: e.x + n, y: e.y + n });
                  break;
                case "right":
                  i.push({ x: e.x - n, y: e.y - n }, { x: e.x - n, y: e.y + n });
              }
              return i;
            })(i, r),
            s = (function (e) {
              const t = e.slice();
              return (
                t.sort((e, t) =>
                  e.x < t.x ? -1 : e.x > t.x ? 1 : e.y < t.y ? -1 : e.y > t.y ? 1 : 0,
                ),
                (function (e) {
                  if (e.length <= 1) return e.slice();
                  const t = [];
                  for (let i = 0; i < e.length; i++) {
                    const n = e[i];
                    for (; t.length >= 2; ) {
                      const e = t[t.length - 1],
                        i = t[t.length - 2];
                      if (!((e.x - i.x) * (n.y - i.y) >= (e.y - i.y) * (n.x - i.x))) break;
                      t.pop();
                    }
                    t.push(n);
                  }
                  t.pop();
                  const n = [];
                  for (let i = e.length - 1; i >= 0; i--) {
                    const t = e[i];
                    for (; n.length >= 2; ) {
                      const e = n[n.length - 1],
                        i = n[n.length - 2];
                      if (!((e.x - i.x) * (t.y - i.y) >= (e.y - i.y) * (t.x - i.x))) break;
                      n.pop();
                    }
                    n.push(t);
                  }
                  return (
                    n.pop(),
                    1 === t.length && 1 === n.length && t[0].x === n[0].x && t[0].y === n[0].y
                      ? t
                      : t.concat(n)
                  );
                })(t)
              );
            })([
              ...o,
              ...(function (e) {
                const { top: t, right: n, bottom: i, left: r } = e;
                return [
                  { x: r, y: t },
                  { x: n, y: t },
                  { x: n, y: i },
                  { x: r, y: i },
                ];
              })(t.getBoundingClientRect()),
            ]);
          (a(s), u(!0));
        },
        [u],
      );
    return (
      H.useEffect(() => () => h(), [h]),
      H.useEffect(() => {
        if (l && d) {
          const e = (e) => g(e, d),
            t = (e) => g(e, l);
          return (
            l.addEventListener("pointerleave", e),
            d.addEventListener("pointerleave", t),
            () => {
              (l.removeEventListener("pointerleave", e), d.removeEventListener("pointerleave", t));
            }
          );
        }
      }, [l, d, g, h]),
      H.useEffect(() => {
        if (s) {
          const e = (e) => {
            const t = e.target,
              n = { x: e.clientX, y: e.clientY },
              i = l?.contains(t) || d?.contains(t),
              r = !(function (e, t) {
                const { x: n, y: i } = e;
                let r = !1;
                for (let o = 0, s = t.length - 1; o < t.length; s = o++) {
                  const e = t[o],
                    a = t[s],
                    l = e.x,
                    c = e.y,
                    d = a.x,
                    u = a.y;
                  c > i != u > i && n < ((d - l) * (i - c)) / (u - c) + l && (r = !r);
                }
                return r;
              })(n, s);
            i ? h() : r && (h(), c());
          };
          return (
            document.addEventListener("pointermove", e),
            () => document.removeEventListener("pointermove", e)
          );
        }
      }, [l, d, s, c, h]),
      Q.jsx(Rst, { ...e, ref: o })
    );
  }),
  [Dst, Tst] = lst(mst, { isInside: !1 }),
  Ist = (function (e) {
    const t = ({ children: e }) => Q.jsx(Q.Fragment, { children: e });
    return ((t.displayName = `${e}.Slottable`), (t.__radixId = rst), t);
  })("TooltipContent"),
  Rst = H.forwardRef((e, t) => {
    const {
        __scopeTooltip: n,
        children: i,
        "aria-label": r,
        onEscapeKeyDown: o,
        onPointerDownOutside: s,
        ...a
      } = e,
      l = vst(Est, n),
      c = cst(n),
      { onClose: d } = l;
    return (
      H.useEffect(
        () => (document.addEventListener(hst, d), () => document.removeEventListener(hst, d)),
        [d],
      ),
      H.useEffect(() => {
        if (l.trigger) {
          const e = (e) => {
            const t = e.target;
            t?.contains(l.trigger) && d();
          };
          return (
            window.addEventListener("scroll", e, { capture: !0 }),
            () => window.removeEventListener("scroll", e, { capture: !0 })
          );
        }
      }, [l.trigger, d]),
      Q.jsx(a8e, {
        asChild: !0,
        disableOutsidePointerEvents: !1,
        onEscapeKeyDown: o,
        onPointerDownOutside: s,
        onFocusOutside: (e) => e.preventDefault(),
        onDismiss: d,
        children: Q.jsxs(Eit, {
          "data-state": l.stateAttribute,
          ...c,
          ...a,
          ref: t,
          style: {
            ...a.style,
            "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
            "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
            "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
            "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
            "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)",
          },
          children: [
            Q.jsx(Ist, { children: i }),
            Q.jsx(Dst, {
              scope: n,
              isInside: !0,
              children: Q.jsx(ast, { id: l.contentId, role: "tooltip", children: r || i }),
            }),
          ],
        }),
      })
    );
  });
Nst.displayName = Est;
var Ost = "TooltipArrow";
H.forwardRef((e, t) => {
  const { __scopeTooltip: n, ...i } = e,
    r = cst(n);
  return Tst(Ost, n).isInside ? null : Q.jsx(Nit, { ...r, ...i, ref: t });
}).displayName = Ost;
var Mst = kst,
  Ast = Nst;
const Pst = fst,
  jst = bst,
  Fst = xst,
  Bst = H.forwardRef(({ className: e, sideOffset: t = 4, ...n }, i) =>
    Q.jsx(Ast, {
      ref: i,
      sideOffset: t,
      className: Rf(
        "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
        e,
      ),
      ...n,
    }),
  );
function Vst() {
  const { pathname: e } = ig();
  return {
    checkActiveNav: (t) => {
      if ("/" === t && "/" === e) return !0;
      const n = t.replace(/^\//, ""),
        i = e.replace(/^\//, "");
      return !!n && i.startsWith(n);
    },
  };
}
function Wst({ key: e, defaultValue: t }) {
  const [n, i] = H.useState(() => {
    const n = localStorage.getItem(e);
    return null !== n ? JSON.parse(n) : t;
  });
  return (
    H.useEffect(() => {
      localStorage.setItem(e, JSON.stringify(n));
    }, [n, e]),
    [n, i]
  );
}
function Hst({ links: e, isCollapsed: t, className: n, closeNav: i }) {
  const { t: r } = Py();
  return Q.jsx("div", {
    "data-collapsed": t,
    className: Rf(
      "group border-b bg-background py-2 transition-[max-height,padding] duration-500 data-[collapsed=true]:py-2 md:border-none",
      n,
    ),
    children: Q.jsx(Pst, {
      delayDuration: 0,
      children: Q.jsx("nav", {
        className:
          "grid gap-1 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2",
        children: e.map(({ sub: e, ...n }) => {
          const o = `${r(n.title)}-${n.href}`;
          return t && e
            ? H.createElement(qst, { ...n, sub: e, key: o, closeNav: i })
            : t
              ? H.createElement($st, { ...n, key: o, closeNav: i })
              : e
                ? H.createElement(Ust, { ...n, sub: e, key: o, closeNav: i })
                : H.createElement(zst, { ...n, key: o, closeNav: i });
        }),
      }),
    }),
  });
}
function zst({ title: e, icon: t, label: n, href: i, closeNav: r, subLink: o = !1 }) {
  const { checkActiveNav: s } = Vst(),
    { t: a } = Py();
  return Q.jsxs(jg, {
    to: i,
    onClick: r,
    className: Rf(
      Em({ variant: s(i) ? "secondary" : "ghost", size: "sm" }),
      "h-12 justify-start text-wrap rounded-none px-6",
      o && "h-10 w-full border-l border-l-slate-500 px-2",
    ),
    "aria-current": s(i) ? "page" : void 0,
    children: [
      Q.jsx("div", { className: "mr-2", children: t }),
      a(e),
      n &&
        Q.jsx("div", {
          className: "ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",
          children: a(n),
        }),
    ],
  });
}
function Ust({ title: e, icon: t, label: n, sub: i, closeNav: r }) {
  const { checkActiveNav: o } = Vst(),
    { isExpanded: s, toggleItem: a } = (function () {
      const [e, t] = Wst({ key: "collapsed-sidebar-items", defaultValue: [] }),
        n = (t) => !e.includes(t);
      return {
        isExpanded: n,
        toggleItem: (i) => {
          n(i) ? t([...e, i]) : t(e.filter((e) => e !== i));
        },
      };
    })(),
    { t: l } = Py(),
    c = !!i?.find((e) => o(e.href)),
    d = l(e),
    u = s(d) || c;
  return Q.jsxs(tst, {
    open: u,
    onOpenChange: () => a(d),
    children: [
      Q.jsxs(nst, {
        className: Rf(
          Em({ variant: c ? "secondary" : "ghost", size: "sm" }),
          "group h-12 w-full justify-start rounded-none px-6",
        ),
        children: [
          Q.jsx("div", { className: "mr-2", children: t }),
          l(e),
          n &&
            Q.jsx("div", {
              className: "ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",
              children: l(n),
            }),
          Q.jsx("span", {
            className: Rf('ml-auto transition-all group-data-[state="open"]:-rotate-180'),
            children: Q.jsx(Qf, { stroke: 1 }),
          }),
        ],
      }),
      Q.jsx(ist, {
        className: "collapsibleDropdown",
        asChild: !0,
        children: Q.jsx("ul", {
          children: i.map((e) =>
            Q.jsx(
              "li",
              { className: "my-1 ml-8", children: Q.jsx(zst, { ...e, subLink: !0, closeNav: r }) },
              l(e.title),
            ),
          ),
        }),
      }),
    ],
  });
}
function $st({ title: e, icon: t, label: n, href: i, closeNav: r }) {
  const { checkActiveNav: o } = Vst(),
    { t: s } = Py();
  return Q.jsxs(jst, {
    delayDuration: 0,
    children: [
      Q.jsx(Fst, {
        asChild: !0,
        children: Q.jsxs(jg, {
          to: i,
          onClick: r,
          className: Rf(Em({ variant: o(i) ? "secondary" : "ghost", size: "icon" }), "h-12 w-12"),
          children: [t, Q.jsx("span", { className: "sr-only", children: s(e) })],
        }),
      }),
      Q.jsxs(Bst, {
        side: "right",
        className: "flex items-center gap-4",
        children: [
          s(e),
          n && Q.jsx("span", { className: "ml-auto text-muted-foreground", children: s(n) }),
        ],
      }),
    ],
  });
}
function qst({ title: e, icon: t, label: n, sub: i, closeNav: r }) {
  const { checkActiveNav: o } = Vst(),
    { t: s } = Py(),
    a = !!i?.find((e) => o(e.href));
  return Q.jsxs(Not, {
    children: [
      Q.jsxs(jst, {
        delayDuration: 0,
        children: [
          Q.jsx(Fst, {
            asChild: !0,
            children: Q.jsx(Lot, { asChild: !0, onClick: (e) => (e.stopPropagation(), e.preventDefault()), children: Q.jsx(Nm, {
                variant: a ? "secondary" : "ghost",
                size: "icon",
                className: "h-12 w-12",
                children: t,
              }),
            }),
          }),
          Q.jsxs(Bst, {
            side: "right",
            className: "flex items-center gap-4",
            children: [
              s(e),
              " ",
              n && Q.jsx("span", { className: "ml-auto text-muted-foreground", children: s(n) }),
              Q.jsx(Qf, { size: 18, className: "-rotate-90 text-muted-foreground" }),
            ],
          }),
        ],
      }),
      Q.jsxs(Iot, {
        side: "right",
        align: "start",
        sideOffset: 4,
        children: [
          Q.jsxs(Aot, { children: [s(e), " ", n ? `(${s(n)})` : ""] }),
          Q.jsx(Pot, {}),
          i.map(({ title: e, icon: t, label: n, href: i }) =>
            Q.jsx(
              Rot,
              {
                asChild: !0,
                children: Q.jsxs(jg, {
                  to: i,
                  onClick: r,
                  className: "" + (o(i) ? "bg-secondary" : ""),
                  children: [
                    t,
                    " ",
                    Q.jsx("span", { className: "ml-2 max-w-52 text-wrap", children: s(e) }),
                    n && Q.jsx("span", { className: "ml-auto text-xs", children: s(n) }),
                  ],
                }),
              },
              `${s(e)}-${i}`,
            ),
          ),
        ],
      }),
    ],
  });
}
/**
 * @license lucide-react v0.399.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ Bst.displayName = Ast.displayName;
const Kst = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(),
  Gst = (...e) => e.filter((e, t, n) => Boolean(e) && n.indexOf(e) === t).join(" ");
/**
 * @license lucide-react v0.399.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
var Zst = {
  xmlns: "http://www.w3.org/2000/svg",
  width: 24,
  height: 24,
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  strokeWidth: 2,
  strokeLinecap: "round",
  strokeLinejoin: "round",
};
/**
 * @license lucide-react v0.399.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Yst = H.forwardRef(
    (
      {
        color: e = "currentColor",
        size: t = 24,
        strokeWidth: n = 2,
        absoluteStrokeWidth: i,
        className: r = "",
        children: o,
        iconNode: s,
        ...a
      },
      l,
    ) =>
      H.createElement(
        "svg",
        {
          ref: l,
          ...Zst,
          width: t,
          height: t,
          stroke: e,
          strokeWidth: i ? (24 * Number(n)) / Number(t) : n,
          className: Gst("lucide", r),
          ...a,
        },
        [...s.map(([e, t]) => H.createElement(e, t)), ...(Array.isArray(o) ? o : [o])],
      ),
  ),
  Xst = (e, t) => {
    const n = H.forwardRef(({ className: n, ...i }, r) =>
      H.createElement(Yst, { ref: r, iconNode: t, className: Gst(`lucide-${Kst(e)}`, n), ...i }),
    );
    return ((n.displayName = `${e}`), n);
  },
  Qst = Xst("Activity", [
    [
      "path",
      {
        d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
        key: "169zse",
      },
    ],
  ]),
  Jst = Xst("ArrowDownToLine", [
    ["path", { d: "M12 17V3", key: "1cwfxf" }],
    ["path", { d: "m6 11 6 6 6-6", key: "12ii2o" }],
    ["path", { d: "M19 21H5", key: "150jfl" }],
  ]),
  eat = Xst("ArrowDown", [
    ["path", { d: "M12 5v14", key: "s699le" }],
    ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }],
  ]),
  tat = Xst("ArrowRightLeft", [
    ["path", { d: "m16 3 4 4-4 4", key: "1x1c3m" }],
    ["path", { d: "M20 7H4", key: "zbl0bi" }],
    ["path", { d: "m8 21-4-4 4-4", key: "h9nckh" }],
    ["path", { d: "M4 17h16", key: "g4d7ey" }],
  ]),
  nat = Xst("ArrowUpDown", [
    ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
    ["path", { d: "M17 20V4", key: "1ejh1v" }],
    ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
    ["path", { d: "M7 4v16", key: "1glfcx" }],
  ]),
  iat = Xst("ArrowUp", [
    ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
    ["path", { d: "M12 19V5", key: "x0mq9r" }],
  ]),
  rat = Xst("BarChart3", [
    ["path", { d: "M3 3v18h18", key: "1s2lah" }],
    ["path", { d: "M18 17V9", key: "2bz60n" }],
    ["path", { d: "M13 17V5", key: "1frdt8" }],
    ["path", { d: "M8 17v-3", key: "17ska0" }],
  ]),
  oat = Xst("Bell", [
    ["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
    ["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }],
  ]),
  sat = Xst("Calendar", [
    ["path", { d: "M8 2v4", key: "1cmpym" }],
    ["path", { d: "M16 2v4", key: "4m81vk" }],
    ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
    ["path", { d: "M3 10h18", key: "8toen8" }],
  ]),
  aat = Xst("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]),
  lat = Xst("ChevronDown", [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]]),
  cat = Xst("ChevronLeft", [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]]),
  dat = Xst("ChevronRight", [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]]),
  uat = Xst("ChevronsUpDown", [
    ["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
    ["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }],
  ]),
  hat = Xst("CircleAlert", [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
    ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }],
  ]),
  gat = Xst("CircleArrowUp", [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["path", { d: "m16 12-4-4-4 4", key: "177agl" }],
    ["path", { d: "M12 16V8", key: "1sbj14" }],
  ]),
  pat = Xst("CircleCheck", [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }],
  ]),
  fat = Xst("CircleHelp", [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
    ["path", { d: "M12 17h.01", key: "p32p05" }],
  ]),
  mat = Xst("CirclePlus", [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["path", { d: "M8 12h8", key: "1wcyev" }],
    ["path", { d: "M12 8v8", key: "napkw2" }],
  ]),
  _at = Xst("ClipboardCopy", [
    ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
    ["path", { d: "M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2", key: "4jdomd" }],
    ["path", { d: "M16 4h2a2 2 0 0 1 2 2v4", key: "3hqy98" }],
    ["path", { d: "M21 14H11", key: "1bme5i" }],
    ["path", { d: "m15 10-4 4 4 4", key: "5dvupr" }],
  ]),
  vat = Xst("Clock", [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }],
  ]),
  bat = Xst("Cog", [
    ["path", { d: "M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", key: "sobvz5" }],
    ["path", { d: "M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z", key: "11i496" }],
    ["path", { d: "M12 2v2", key: "tus03m" }],
    ["path", { d: "M12 22v-2", key: "1osdcq" }],
    ["path", { d: "m17 20.66-1-1.73", key: "eq3orb" }],
    ["path", { d: "M11 10.27 7 3.34", key: "16pf9h" }],
    ["path", { d: "m20.66 17-1.73-1", key: "sg0v6f" }],
    ["path", { d: "m3.34 7 1.73 1", key: "1ulond" }],
    ["path", { d: "M14 12h8", key: "4f43i9" }],
    ["path", { d: "M2 12h2", key: "1t8f8n" }],
    ["path", { d: "m20.66 7-1.73 1", key: "1ow05n" }],
    ["path", { d: "m3.34 17 1.73-1", key: "nuk764" }],
    ["path", { d: "m17 3.34-1 1.73", key: "2wel8s" }],
    ["path", { d: "m11 13.73-4 6.93", key: "794ttg" }],
  ]),
  yat = Xst("Copy", [
    ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
    ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }],
  ]),
  xat = Xst("Cpu", [
    ["rect", { width: "16", height: "16", x: "4", y: "4", rx: "2", key: "14l7u7" }],
    ["rect", { width: "6", height: "6", x: "9", y: "9", rx: "1", key: "5aljv4" }],
    ["path", { d: "M15 2v2", key: "13l42r" }],
    ["path", { d: "M15 20v2", key: "15mkzm" }],
    ["path", { d: "M2 15h2", key: "1gxd5l" }],
    ["path", { d: "M2 9h2", key: "1bbxkp" }],
    ["path", { d: "M20 15h2", key: "19e6y8" }],
    ["path", { d: "M20 9h2", key: "19tzq7" }],
    ["path", { d: "M9 2v2", key: "165o2o" }],
    ["path", { d: "M9 20v2", key: "i2bqo8" }],
  ]),
  wat = Xst("Download", [
    ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
    ["polyline", { points: "7 10 12 15 17 10", key: "2ggqvy" }],
    ["line", { x1: "12", x2: "12", y1: "15", y2: "3", key: "1vk2je" }],
  ]),
  Cat = Xst("Ellipsis", [
    ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
    ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
    ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }],
  ]),
  Sat = Xst("ExternalLink", [
    ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
    ["path", { d: "M10 14 21 3", key: "gplh6r" }],
    ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }],
  ]),
  kat = Xst("EyeOff", [
    ["path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24", key: "1jxqfv" }],
    [
      "path",
      {
        d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",
        key: "9wicm4",
      },
    ],
    [
      "path",
      {
        d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",
        key: "1jreej",
      },
    ],
    ["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }],
  ]),
  Eat = Xst("Eye", [
    ["path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z", key: "rwhkz3" }],
    ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
  ]),
  Nat = Xst("FileText", [
    ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
    ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
    ["path", { d: "M10 9H8", key: "b1mrlr" }],
    ["path", { d: "M16 13H8", key: "t4e002" }],
    ["path", { d: "M16 17H8", key: "z1uh3a" }],
  ]),
  Lat = Xst("Filter", [
    ["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }],
  ]),
  Dat = Xst("Ghost", [
    ["path", { d: "M9 10h.01", key: "qbtxuw" }],
    ["path", { d: "M15 10h.01", key: "1qmjsl" }],
    [
      "path",
      {
        d: "M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",
        key: "uwwb07",
      },
    ],
  ]),
  Tat = Xst("Gift", [
    ["rect", { x: "3", y: "8", width: "18", height: "4", rx: "1", key: "bkv52" }],
    ["path", { d: "M12 8v13", key: "1c76mn" }],
    ["path", { d: "M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7", key: "6wjy6b" }],
    [
      "path",
      {
        d: "M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",
        key: "1ihvrl",
      },
    ],
  ]),
  Iat = Xst("Globe", [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
    ["path", { d: "M2 12h20", key: "9i4pu4" }],
  ]),
  Rat = Xst("GripVertical", [
    ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
    ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
    ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
    ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
    ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
    ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }],
  ]),
  Oat = Xst("History", [
    ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
    ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
    ["path", { d: "M12 7v5l4 2", key: "1fdv2h" }],
  ]),
  Mat = Xst("Image", [
    ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
    ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
    ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }],
  ]),
  Aat = Xst("LoaderCircle", [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]]),
  Pat = Xst("MessagesSquare", [
    ["path", { d: "M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2z", key: "jj09z8" }],
    ["path", { d: "M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1", key: "1cx29u" }],
  ]),
  jat = Xst("Network", [
    ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
    ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
    ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
    ["path", { d: "M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3", key: "1jsf9p" }],
    ["path", { d: "M12 12V8", key: "2874zd" }],
  ]),
  Fat = Xst("Package", [
    ["path", { d: "m7.5 4.27 9 5.15", key: "1c824w" }],
    [
      "path",
      {
        d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",
        key: "hh9hay",
      },
    ],
    ["path", { d: "m3.3 7 8.7 5 8.7-5", key: "g66t2b" }],
    ["path", { d: "M12 22V12", key: "d0xqtd" }],
  ]),
  Bat = Xst("Palette", [
    ["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
    ["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
    ["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }],
    ["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
    [
      "path",
      {
        d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",
        key: "12rzf8",
      },
    ],
  ]),
  Vat = Xst("Pencil", [
    [
      "path",
      {
        d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
        key: "1a8usu",
      },
    ],
    ["path", { d: "m15 5 4 4", key: "1mk7zo" }],
  ]),
  Wat = Xst("Plus", [
    ["path", { d: "M5 12h14", key: "1ays0h" }],
    ["path", { d: "M12 5v14", key: "s699le" }],
  ]),
  Hat = Xst("Power", [
    ["path", { d: "M12 2v10", key: "mnfbl" }],
    ["path", { d: "M18.4 6.6a9 9 0 1 1-12.77.04", key: "obofu9" }],
  ]),
  zat = Xst("RefreshCw", [
    ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
    ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
    ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
    ["path", { d: "M8 16H3v5", key: "1cv678" }],
  ]),
  Uat = Xst("RotateCcw", [
    ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
    ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
  ]),
  $at = Xst("RotateCw", [
    ["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
    ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
  ]),
  qat = Xst("Search", [
    ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
    ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }],
  ]),
  Kat = Xst("Send", [
    ["path", { d: "m22 2-7 20-4-9-9-4Z", key: "1q3vgg" }],
    ["path", { d: "M22 2 11 13", key: "nzbqef" }],
  ]),
  Gat = Xst("Server", [
    ["rect", { width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2", key: "ngkwjq" }],
    ["rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2", key: "iecqi9" }],
    ["line", { x1: "6", x2: "6.01", y1: "6", y2: "6", key: "16zg32" }],
    ["line", { x1: "6", x2: "6.01", y1: "18", y2: "18", key: "nzw8ys" }],
  ]),
  Zat = Xst("Settings2", [
    ["path", { d: "M20 7h-9", key: "3s1dr2" }],
    ["path", { d: "M14 17H5", key: "gfn3mx" }],
    ["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
    ["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }],
  ]),
  Yat = Xst("Settings", [
    [
      "path",
      {
        d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",
        key: "1qme2f",
      },
    ],
    ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
  ]),
  Xat = Xst("ShieldBan", [
    [
      "path",
      {
        d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
        key: "oel41y",
      },
    ],
    ["path", { d: "m4.243 5.21 14.39 12.472", key: "1c9a7c" }],
  ]),
  Qat = Xst("ShieldCheck", [
    [
      "path",
      {
        d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
        key: "oel41y",
      },
    ],
    ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }],
  ]),
  Jat = Xst("Shield", [
    [
      "path",
      {
        d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
        key: "oel41y",
      },
    ],
  ]),
  elt = Xst("SlidersHorizontal", [
    ["line", { x1: "21", x2: "14", y1: "4", y2: "4", key: "obuewd" }],
    ["line", { x1: "10", x2: "3", y1: "4", y2: "4", key: "1q6298" }],
    ["line", { x1: "21", x2: "12", y1: "12", y2: "12", key: "1iu8h1" }],
    ["line", { x1: "8", x2: "3", y1: "12", y2: "12", key: "ntss68" }],
    ["line", { x1: "21", x2: "16", y1: "20", y2: "20", key: "14d8ph" }],
    ["line", { x1: "12", x2: "3", y1: "20", y2: "20", key: "m0wm8r" }],
    ["line", { x1: "14", x2: "14", y1: "2", y2: "6", key: "14e1ph" }],
    ["line", { x1: "8", x2: "8", y1: "10", y2: "14", key: "1i6ji0" }],
    ["line", { x1: "16", x2: "16", y1: "18", y2: "22", key: "1lctlv" }],
  ]),
  tlt = Xst("Target", [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["circle", { cx: "12", cy: "12", r: "6", key: "1vlfrh" }],
    ["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }],
  ]),
  nlt = Xst("Timer", [
    ["line", { x1: "10", x2: "14", y1: "2", y2: "2", key: "14vaq8" }],
    ["line", { x1: "12", x2: "15", y1: "14", y2: "11", key: "17fdiu" }],
    ["circle", { cx: "12", cy: "14", r: "8", key: "1e1u0o" }],
  ]),
  ilt = Xst("Trash2", [
    ["path", { d: "M3 6h18", key: "d0wm0j" }],
    ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
    ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
    ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
    ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }],
  ]),
  rlt = Xst("Trash", [
    ["path", { d: "M3 6h18", key: "d0wm0j" }],
    ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
    ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
  ]),
  olt = Xst("TrendingUp", [
    ["polyline", { points: "22 7 13.5 15.5 8.5 10.5 2 17", key: "126l90" }],
    ["polyline", { points: "16 7 22 7 22 13", key: "kwv8wd" }],
  ]),
  slt = Xst("TriangleAlert", [
    [
      "path",
      {
        d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
        key: "wmoenq",
      },
    ],
    ["path", { d: "M12 9v4", key: "juzpu7" }],
    ["path", { d: "M12 17h.01", key: "p32p05" }],
  ]),
  alt = Xst("Upload", [
    ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
    ["polyline", { points: "17 8 12 3 7 8", key: "t8dd8p" }],
    ["line", { x1: "12", x2: "12", y1: "3", y2: "15", key: "widbto" }],
  ]),
  llt = Xst("UserCheck", [
    ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
    ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
    ["polyline", { points: "16 11 18 13 22 9", key: "1pwet4" }],
  ]),
  clt = Xst("User", [
    ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
    ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }],
  ]),
  dlt = Xst("Users", [
    ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
    ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
    ["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
    ["path", { d: "M16 3.13a4 4 0 0 1 0 7.75", key: "1da9ce" }],
  ]),
  ult = Xst("WandSparkles", [
    [
      "path",
      {
        d: "m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",
        key: "ul74o6",
      },
    ],
    ["path", { d: "m14 7 3 3", key: "1r5n42" }],
    ["path", { d: "M5 6v4", key: "ilb8ba" }],
    ["path", { d: "M19 14v4", key: "blhpug" }],
    ["path", { d: "M10 2v2", key: "7u0qdc" }],
    ["path", { d: "M7 8H3", key: "zfb6yr" }],
    ["path", { d: "M21 16h-4", key: "1cnmox" }],
    ["path", { d: "M11 3H9", key: "1obp7u" }],
  ]),
  hlt = Xst("WifiOff", [
    ["path", { d: "M12 20h.01", key: "zekei9" }],
    ["path", { d: "M8.5 16.429a5 5 0 0 1 7 0", key: "1bycff" }],
    ["path", { d: "M5 12.859a10 10 0 0 1 5.17-2.69", key: "1dl1wf" }],
    ["path", { d: "M19 12.859a10 10 0 0 0-2.007-1.523", key: "4k23kn" }],
    ["path", { d: "M2 8.82a15 15 0 0 1 4.177-2.643", key: "1grhjp" }],
    ["path", { d: "M22 8.82a15 15 0 0 0-11.288-3.764", key: "z3jwby" }],
    ["path", { d: "m2 2 20 20", key: "1ooewy" }],
  ]),
  glt = Xst("Wifi", [
    ["path", { d: "M12 20h.01", key: "zekei9" }],
    ["path", { d: "M2 8.82a15 15 0 0 1 20 0", key: "dnpr2z" }],
    ["path", { d: "M5 12.859a10 10 0 0 1 14 0", key: "1x1e6c" }],
    ["path", { d: "M8.5 16.429a5 5 0 0 1 7 0", key: "1bycff" }],
  ]),
  plt = Xst("X", [
    ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
    ["path", { d: "m6 6 12 12", key: "d8bk6v" }],
  ]),
  flt = Xst("Zap", [
    [
      "path",
      {
        d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
        key: "1xq2db",
      },
    ],
  ]),
  mlt = [
    { title: "nav:dashboard", label: "", href: "/", icon: Q.jsx(nm, { size: 18 }) },
    {
      title: "nav:systemManagement",
      label: "",
      href: "",
      icon: Q.jsx(vm, { size: 18 }),
      sub: [
        {
          title: "nav:systemConfig",
          label: "",
          href: "/config/system",
          icon: Q.jsx(Kf, { size: 18 }),
        },
        {
          title: "nav:themeConfig",
          label: "",
          href: "/config/theme",
          icon: Q.jsx(Kf, { size: 18 }),
        },
        {
          title: "nav:noticeManagement",
          label: "",
          href: "/config/notice",
          icon: Q.jsx(pm, { size: 18 }),
        },
        {
          title: "nav:knowledgeManagement",
          label: "",
          href: "/config/knowledge",
          icon: Q.jsx(am, { size: 18 }),
        },
      ],
    },
    {
      title: "nav:nodeManagement",
      label: "",
      href: "",
      icon: Q.jsx(_m, { size: 18 }),
      sub: [
        {
          title: "nav:nodeManagement",
          label: "",
          href: "/server/manage",
          icon: Q.jsx(mm, { size: 18 }),
        },
        {
          title: "nav:permissionGroupManagement",
          label: "",
          href: "/server/group",
          icon: Q.jsx(dm, { size: 18 }),
        },
        {
          title: "nav:routeManagement",
          label: "",
          href: "/server/route",
          icon: Q.jsx(fm, { size: 18 }),
        },
      ],
    },
    {
      title: "nav:subscriptionManagement",
      label: "",
      href: "",
      icon: Q.jsx(Xf, { size: 18 }),
      sub: [
        {
          title: "nav:planManagement",
          label: "",
          href: "/finance/plan",
          icon: Q.jsx(Zf, { size: 18 }),
        },
        {
          title: "nav:orderManagement",
          label: "",
          href: "/finance/order",
          icon: Q.jsx(tm, { size: 18 }),
        },
      ],
    },
    {
      title: "nav:userManagement",
      label: "",
      href: "",
      icon: Q.jsx(Sm, { size: 18 }),
      sub: [
        {
          title: "nav:userManagement",
          label: "",
          href: "/user/manage",
          icon: Q.jsx(Cm, { size: 18 }),
        },
        {
          title: "nav:ticketManagement",
          label: "",
          href: "/user/ticket",
          icon: Q.jsx(xm, { size: 18 }),
        },
        {
          title: "实名认证",
          label: "",
          href: "/user/realname",
          icon: Q.jsx(xm, { size: 18 }),
        },
        {
          title: "在线 IP 统计",
          label: "",
          href: "/user/online-devices",
          icon: Q.jsx(xm, { size: 18 }),
        },
        {
          title: "IPv6 子账号",
          label: "",
          href: "/user/ipv6-subscription",
          icon: Q.jsx(xm, { size: 18 }),
        },
      ],
    },
  ];
/**
 * @license lucide-react v0.399.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ function _lt({ className: e, isCollapsed: t, setIsCollapsed: n }) {
  const [i, r] = H.useState(!1),
    { t: o } = Py();
  return (
    H.useEffect(() => {
      i
        ? document.body.classList.add("overflow-hidden")
        : document.body.classList.remove("overflow-hidden");
    }, [i]),
    Q.jsxs("aside", {
      className: Rf(
        "fixed left-0 right-0 top-0 z-50 flex h-auto flex-col border-r-2 border-r-muted transition-[width] md:bottom-0 md:right-auto md:h-svh " +
          (t ? "md:w-14" : "md:w-64"),
        e,
      ),
      children: [
        Q.jsx("div", {
          onClick: () => r(!1),
          className: `absolute inset-0 transition-[opacity] delay-100 duration-700 ${i ? "h-svh opacity-50" : "h-0 opacity-0"} w-full bg-black md:hidden`,
        }),
        Q.jsxs(Wot, {
          className: "flex h-full flex-col  " + (i ? "h-[100vh] md:h-full" : ""),
          children: [
            Q.jsxs(Hot, {
              className: "sticky top-0 justify-between px-4 py-3 shadow md:px-4",
              children: [
                Q.jsxs("div", {
                  className: "flex items-center " + (t ? "" : "gap-2"),
                  children: [
                    Q.jsxs("svg", {
                      xmlns: "http://www.w3.org/2000/svg",
                      viewBox: "0 0 256 256",
                      className: "transition-all " + (t ? "h-6 w-6" : "h-8 w-8"),
                      children: [
                        Q.jsx("rect", { width: "256", height: "256", fill: "none" }),
                        Q.jsx("line", {
                          x1: "208",
                          y1: "128",
                          x2: "128",
                          y2: "208",
                          fill: "none",
                          stroke: "currentColor",
                          strokeLinecap: "round",
                          strokeLinejoin: "round",
                          strokeWidth: "16",
                        }),
                        Q.jsx("line", {
                          x1: "192",
                          y1: "40",
                          x2: "40",
                          y2: "192",
                          fill: "none",
                          stroke: "currentColor",
                          strokeLinecap: "round",
                          strokeLinejoin: "round",
                          strokeWidth: "16",
                        }),
                        Q.jsx("span", { className: "sr-only", children: "Website Name" }),
                      ],
                    }),
                    Q.jsx("div", {
                      className:
                        "flex flex-col justify-end truncate " +
                        (t ? "invisible w-0" : "visible w-auto"),
                      children: Q.jsx("span", {
                        className: "font-medium",
                        children: window?.settings?.title,
                      }),
                    }),
                  ],
                }),
                Q.jsx(Nm, {
                  variant: "ghost",
                  size: "icon",
                  className: "md:hidden",
                  "aria-label": o("common:toggleNavigation"),
                  "aria-controls": "sidebar-menu",
                  "aria-expanded": i,
                  onClick: () => r((e) => !e),
                  children: i ? Q.jsx(km, {}) : Q.jsx(hm, {}),
                }),
              ],
            }),
            Q.jsx(Hst, {
              id: "sidebar-menu",
              className: Rf(
                "flex-1 overflow-auto overscroll-contain",
                i ? "block" : "hidden md:block",
                "md:py-2",
              ),
              closeNav: () => r(!1),
              isCollapsed: t,
              links: mlt,
            }),
            Q.jsx("div", {
              className: Rf(
                "border-t border-border/50 bg-background",
                "px-4 py-2.5 text-xs text-muted-foreground",
                i ? "block" : "hidden md:block",
                t ? "text-center" : "text-left",
              ),
              children: Q.jsxs("div", {
                className: Rf("flex items-center gap-1.5", t ? "justify-center" : "justify-start"),
                children: [
                  Q.jsx("div", { className: "h-1.5 w-1.5 rounded-full bg-green-500" }),
                  Q.jsxs("span", {
                    className: Rf(
                      "whitespace-nowrap tracking-wide",
                      "transition-opacity duration-200",
                      t && "md:opacity-0",
                    ),
                    children: ["v", window?.settings?.version],
                  }),
                ],
              }),
            }),
            Q.jsx(Nm, {
              onClick: () => n((e) => !e),
              size: "icon",
              variant: "outline",
              className: "absolute -right-5 top-1/2 hidden rounded-full md:inline-flex",
              "aria-label": o("common:toggleSidebar"),
              children: Q.jsx(Jf, { stroke: 1.5, className: "h-5 w-5 " + (t ? "rotate-180" : "") }),
            }),
          ],
        }),
      ],
    })
  );
}
const vlt = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const [e, t] = (function () {
          const [e, t] = Wst({ key: "collapsed-sidebar", defaultValue: !1 }),
            n = t8e();
          return (
            H.useEffect(() => {
              n && t(!1);
            }, [n, t]),
            [e, t]
          );
        })();
        return Q.jsxs("div", {
          className: "relative h-full overflow-hidden bg-background",
          children: [
            Q.jsx(_lt, { isCollapsed: e, setIsCollapsed: t }),
            Q.jsx("main", {
              id: "content",
              className: `overflow-x-hidden pt-16 transition-[margin] md:overflow-y-hidden md:pt-0 ${e ? "md:ml-14" : "md:ml-64"} h-full`,
              children: Q.jsx(vg, {}),
            }),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
var blt = 0.999,
  ylt = /[\\\/_+.#"@\[\(\{&]/,
  xlt = /[\\\/_+.#"@\[\(\{&]/g,
  wlt = /[\s-]/,
  Clt = /[\s-]/g;
function Slt(e, t, n, i, r, o, s) {
  if (o === t.length) return r === e.length ? 1 : 0.99;
  var a = `${r},${o}`;
  if (void 0 !== s[a]) return s[a];
  for (var l, c, d, u, h = i.charAt(o), g = n.indexOf(h, r), p = 0; g >= 0; )
    ((l = Slt(e, t, n, i, g + 1, o + 1, s)) > p &&
      (g === r
        ? (l *= 1)
        : ylt.test(e.charAt(g - 1))
          ? ((l *= 0.8),
            (d = e.slice(r, g - 1).match(xlt)) && r > 0 && (l *= Math.pow(blt, d.length)))
          : wlt.test(e.charAt(g - 1))
            ? ((l *= 0.9),
              (u = e.slice(r, g - 1).match(Clt)) && r > 0 && (l *= Math.pow(blt, u.length)))
            : ((l *= 0.17), r > 0 && (l *= Math.pow(blt, g - r))),
      e.charAt(g) !== t.charAt(o) && (l *= 0.9999)),
      ((l < 0.1 && n.charAt(g - 1) === i.charAt(o + 1)) ||
        (i.charAt(o + 1) === i.charAt(o) && n.charAt(g - 1) !== i.charAt(o))) &&
        0.1 * (c = Slt(e, t, n, i, g + 1, o + 2, s)) > l &&
        (l = 0.1 * c),
      l > p && (p = l),
      (g = n.indexOf(h, g + 1)));
  return ((s[a] = p), p);
}
function klt(e) {
  return e.toLowerCase().replace(Clt, " ");
}
function Elt(e, t) {
  return Slt(e, t, klt(e), klt(t), 0, 0, {});
}
function Nlt() {
  return (
    (Nlt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) ({}).hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    Nlt.apply(null, arguments)
  );
}
function Llt(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
  return function (i) {
    if ((null == e || e(i), !1 === n || !i.defaultPrevented)) return null == t ? void 0 : t(i);
  };
}
function Dlt(...e) {
  return (t) =>
    e.forEach((e) =>
      (function (e, t) {
        "function" == typeof e ? e(t) : null != e && (e.current = t);
      })(e, t),
    );
}
function Tlt(...e) {
  return H.useCallback(Dlt(...e), e);
}
function Ilt(...e) {
  const t = e[0];
  if (1 === e.length) return t;
  const n = () => {
    const n = e.map((e) => ({ useScope: e(), scopeName: e.scopeName }));
    return function (e) {
      const i = n.reduce(
        (t, { useScope: n, scopeName: i }) => ({ ...t, ...n(e)[`__scope${i}`] }),
        {},
      );
      return H.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
    };
  };
  return ((n.scopeName = t.scopeName), n);
}
const Rlt = Boolean(null === globalThis || void 0 === globalThis ? void 0 : globalThis.document)
    ? H.useLayoutEffect
    : () => {},
  Olt = U["useId".toString()] || (() => {});
let Mlt = 0;
function Alt(e) {
  const [t, n] = H.useState(Olt());
  return (
    Rlt(() => {
      n((e) => (null != e ? e : String(Mlt++)));
    }, [e]),
    e || (t ? `radix-${t}` : "")
  );
}
function Plt(e) {
  const t = H.useRef(e);
  return (
    H.useEffect(() => {
      t.current = e;
    }),
    H.useMemo(
      () =>
        (...e) => {
          var n;
          return null === (n = t.current) || void 0 === n ? void 0 : n.call(t, ...e);
        },
      [],
    )
  );
}
function jlt({ prop: e, defaultProp: t, onChange: n = () => {} }) {
  const [i, r] = (function ({ defaultProp: e, onChange: t }) {
      const n = H.useState(e),
        [i] = n,
        r = H.useRef(i),
        o = Plt(t);
      return (
        H.useEffect(() => {
          r.current !== i && (o(i), (r.current = i));
        }, [i, r, o]),
        n
      );
    })({ defaultProp: t, onChange: n }),
    o = void 0 !== e,
    s = o ? e : i,
    a = Plt(n);
  return [
    s,
    H.useCallback(
      (t) => {
        if (o) {
          const n = "function" == typeof t ? t(e) : t;
          n !== e && a(n);
        } else r(t);
      },
      [o, e, r, a],
    ),
  ];
}
const Flt = H.forwardRef((e, t) => {
  const { children: n, ...i } = e,
    r = H.Children.toArray(n),
    o = r.find(Wlt);
  if (o) {
    const e = o.props.children,
      n = r.map((t) =>
        t === o
          ? H.Children.count(e) > 1
            ? H.Children.only(null)
            : H.isValidElement(e)
              ? e.props.children
              : null
          : t,
      );
    return H.createElement(
      Blt,
      Nlt({}, i, { ref: t }),
      H.isValidElement(e) ? H.cloneElement(e, void 0, n) : null,
    );
  }
  return H.createElement(Blt, Nlt({}, i, { ref: t }), n);
});
Flt.displayName = "Slot";
const Blt = H.forwardRef((e, t) => {
  const { children: n, ...i } = e;
  return H.isValidElement(n)
    ? H.cloneElement(n, { ...Hlt(i, n.props), ref: Dlt(t, n.ref) })
    : H.Children.count(n) > 1
      ? H.Children.only(null)
      : null;
});
Blt.displayName = "SlotClone";
const Vlt = ({ children: e }) => H.createElement(H.Fragment, null, e);
function Wlt(e) {
  return H.isValidElement(e) && e.type === Vlt;
}
function Hlt(e, t) {
  const n = { ...t };
  for (const i in t) {
    const r = e[i],
      o = t[i];
    /^on[A-Z]/.test(i)
      ? (n[i] = (...e) => {
          (null == o || o(...e), null == r || r(...e));
        })
      : "style" === i
        ? (n[i] = { ...r, ...o })
        : "className" === i && (n[i] = [r, o].filter(Boolean).join(" "));
  }
  return { ...e, ...n };
}
const zlt = [
  "a",
  "button",
  "div",
  "h2",
  "h3",
  "img",
  "li",
  "nav",
  "ol",
  "p",
  "span",
  "svg",
  "ul",
].reduce((e, t) => {
  const n = H.forwardRef((e, n) => {
    const { asChild: i, ...r } = e,
      o = i ? Flt : t;
    return (
      H.useEffect(() => {
        window[Symbol.for("radix-ui")] = !0;
      }, []),
      H.createElement(o, Nlt({}, r, { ref: n }))
    );
  });
  return ((n.displayName = `Primitive.${t}`), { ...e, [t]: n });
}, {});
function Ult(e) {
  const t = H.useRef(e);
  return (
    H.useEffect(() => {
      t.current = e;
    }),
    H.useMemo(
      () =>
        (...e) => {
          var n;
          return null === (n = t.current) || void 0 === n ? void 0 : n.call(t, ...e);
        },
      [],
    )
  );
}
const $lt = "dismissableLayer.update",
  qlt = "dismissableLayer.pointerDownOutside",
  Klt = "dismissableLayer.focusOutside";
let Glt;
const Zlt = H.createContext({
    layers: new Set(),
    layersWithOutsidePointerEventsDisabled: new Set(),
    branches: new Set(),
  }),
  Ylt = H.forwardRef((e, t) => {
    const {
        disableOutsidePointerEvents: n = !1,
        onEscapeKeyDown: i,
        onPointerDownOutside: r,
        onFocusOutside: o,
        onInteractOutside: s,
        onDismiss: a,
        ...l
      } = e,
      c = H.useContext(Zlt),
      [d, u] = H.useState(null),
      [, h] = H.useState({}),
      g = Tlt(t, (e) => u(e)),
      p = Array.from(c.layers),
      [f] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1),
      m = p.indexOf(f),
      _ = d ? p.indexOf(d) : -1,
      v = c.layersWithOutsidePointerEventsDisabled.size > 0,
      b = _ >= m,
      y = (function (e) {
        const t = Ult(e),
          n = H.useRef(!1),
          i = H.useRef(() => {});
        return (
          H.useEffect(() => {
            const e = (e) => {
                if (e.target && !n.current) {
                  const r = { originalEvent: e };
                  function o() {
                    Qlt(qlt, t, r, { discrete: !0 });
                  }
                  "touch" === e.pointerType
                    ? (document.removeEventListener("click", i.current),
                      (i.current = o),
                      document.addEventListener("click", i.current, { once: !0 }))
                    : o();
                }
                n.current = !1;
              },
              r = window.setTimeout(() => {
                document.addEventListener("pointerdown", e);
              }, 0);
            return () => {
              (window.clearTimeout(r),
                document.removeEventListener("pointerdown", e),
                document.removeEventListener("click", i.current));
            };
          }, [t]),
          { onPointerDownCapture: () => (n.current = !0) }
        );
      })((e) => {
        const t = e.target,
          n = [...c.branches].some((e) => e.contains(t));
        b && !n && (null == r || r(e), null == s || s(e), e.defaultPrevented || null == a || a());
      }),
      x = (function (e) {
        const t = Ult(e),
          n = H.useRef(!1);
        return (
          H.useEffect(() => {
            const e = (e) => {
              if (e.target && !n.current) {
                Qlt(Klt, t, { originalEvent: e }, { discrete: !1 });
              }
            };
            return (
              document.addEventListener("focusin", e),
              () => document.removeEventListener("focusin", e)
            );
          }, [t]),
          { onFocusCapture: () => (n.current = !0), onBlurCapture: () => (n.current = !1) }
        );
      })((e) => {
        const t = e.target;
        [...c.branches].some((e) => e.contains(t)) ||
          (null == o || o(e), null == s || s(e), e.defaultPrevented || null == a || a());
      });
    return (
      (function (e) {
        const t = Ult(e);
        H.useEffect(() => {
          const e = (e) => {
            "Escape" === e.key && t(e);
          };
          return (
            document.addEventListener("keydown", e),
            () => document.removeEventListener("keydown", e)
          );
        }, [t]);
      })((e) => {
        _ === c.layers.size - 1 &&
          (null == i || i(e), !e.defaultPrevented && a && (e.preventDefault(), a()));
      }),
      H.useEffect(() => {
        if (d)
          return (
            n &&
              (0 === c.layersWithOutsidePointerEventsDisabled.size &&
                ((Glt = document.body.style.pointerEvents),
                (document.body.style.pointerEvents = "none")),
              c.layersWithOutsidePointerEventsDisabled.add(d)),
            c.layers.add(d),
            Xlt(),
            () => {
              n &&
                1 === c.layersWithOutsidePointerEventsDisabled.size &&
                (document.body.style.pointerEvents = Glt);
            }
          );
      }, [d, n, c]),
      H.useEffect(
        () => () => {
          d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Xlt());
        },
        [d, c],
      ),
      H.useEffect(() => {
        const e = () => h({});
        return (document.addEventListener($lt, e), () => document.removeEventListener($lt, e));
      }, []),
      H.createElement(
        zlt.div,
        Nlt({}, l, {
          ref: g,
          style: { pointerEvents: v ? (b ? "auto" : "none") : void 0, ...e.style },
          onFocusCapture: Llt(e.onFocusCapture, x.onFocusCapture),
          onBlurCapture: Llt(e.onBlurCapture, x.onBlurCapture),
          onPointerDownCapture: Llt(e.onPointerDownCapture, y.onPointerDownCapture),
        }),
      )
    );
  });
function Xlt() {
  const e = new CustomEvent($lt);
  document.dispatchEvent(e);
}
function Qlt(e, t, n, { discrete: i }) {
  const r = n.originalEvent.target,
    o = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
  (t && r.addEventListener(e, t, { once: !0 }),
    i
      ? (function (e, t) {
          e && ru.flushSync(() => e.dispatchEvent(t));
        })(r, o)
      : r.dispatchEvent(o));
}
function Jlt(e) {
  const t = H.useRef(e);
  return (
    H.useEffect(() => {
      t.current = e;
    }),
    H.useMemo(
      () =>
        (...e) => {
          var n;
          return null === (n = t.current) || void 0 === n ? void 0 : n.call(t, ...e);
        },
      [],
    )
  );
}
const ect = "focusScope.autoFocusOnMount",
  tct = "focusScope.autoFocusOnUnmount",
  nct = { bubbles: !1, cancelable: !0 },
  ict = H.forwardRef((e, t) => {
    const { loop: n = !1, trapped: i = !1, onMountAutoFocus: r, onUnmountAutoFocus: o, ...s } = e,
      [a, l] = H.useState(null),
      c = Jlt(r),
      d = Jlt(o),
      u = H.useRef(null),
      h = Tlt(t, (e) => l(e)),
      g = H.useRef({
        paused: !1,
        pause() {
          this.paused = !0;
        },
        resume() {
          this.paused = !1;
        },
      }).current;
    (H.useEffect(() => {
      if (i) {
        function e(e) {
          if (g.paused || !a) return;
          const t = e.target;
          a.contains(t) ? (u.current = t) : act(u.current, { select: !0 });
        }
        function t(e) {
          !g.paused && a && (a.contains(e.relatedTarget) || act(u.current, { select: !0 }));
        }
        return (
          document.addEventListener("focusin", e),
          document.addEventListener("focusout", t),
          () => {
            (document.removeEventListener("focusin", e),
              document.removeEventListener("focusout", t));
          }
        );
      }
    }, [i, a, g.paused]),
      H.useEffect(() => {
        if (a) {
          lct.add(g);
          const t = document.activeElement;
          if (!a.contains(t)) {
            const n = new CustomEvent(ect, nct);
            (a.addEventListener(ect, c),
              a.dispatchEvent(n),
              n.defaultPrevented ||
                (!(function (e, { select: t = !1 } = {}) {
                  const n = document.activeElement;
                  for (const i of e)
                    if ((act(i, { select: t }), document.activeElement !== n)) return;
                })(((e = rct(a)), e.filter((e) => "A" !== e.tagName)), { select: !0 }),
                document.activeElement === t && act(a)));
          }
          return () => {
            (a.removeEventListener(ect, c),
              setTimeout(() => {
                const e = new CustomEvent(tct, nct);
                (a.addEventListener(tct, d),
                  a.dispatchEvent(e),
                  e.defaultPrevented || act(null != t ? t : document.body, { select: !0 }),
                  a.removeEventListener(tct, d),
                  lct.remove(g));
              }, 0));
          };
        }
        var e;
      }, [a, c, d, g]));
    const p = H.useCallback(
      (e) => {
        if (!n && !i) return;
        if (g.paused) return;
        const t = "Tab" === e.key && !e.altKey && !e.ctrlKey && !e.metaKey,
          r = document.activeElement;
        if (t && r) {
          const t = e.currentTarget,
            [i, o] = (function (e) {
              const t = rct(e),
                n = oct(t, e),
                i = oct(t.reverse(), e);
              return [n, i];
            })(t);
          i && o
            ? e.shiftKey || r !== o
              ? e.shiftKey && r === i && (e.preventDefault(), n && act(o, { select: !0 }))
              : (e.preventDefault(), n && act(i, { select: !0 }))
            : r === t && e.preventDefault();
        }
      },
      [n, i, g.paused],
    );
    return H.createElement(zlt.div, Nlt({ tabIndex: -1 }, s, { ref: h, onKeyDown: p }));
  });
function rct(e) {
  const t = [],
    n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
      acceptNode: (e) => {
        const t = "INPUT" === e.tagName && "hidden" === e.type;
        return e.disabled || e.hidden || t
          ? NodeFilter.FILTER_SKIP
          : e.tabIndex >= 0
            ? NodeFilter.FILTER_ACCEPT
            : NodeFilter.FILTER_SKIP;
      },
    });
  for (; n.nextNode(); ) t.push(n.currentNode);
  return t;
}
function oct(e, t) {
  for (const n of e) if (!sct(n, { upTo: t })) return n;
}
function sct(e, { upTo: t }) {
  if ("hidden" === getComputedStyle(e).visibility) return !0;
  for (; e; ) {
    if (void 0 !== t && e === t) return !1;
    if ("none" === getComputedStyle(e).display) return !0;
    e = e.parentElement;
  }
  return !1;
}
function act(e, { select: t = !1 } = {}) {
  if (e && e.focus) {
    const n = document.activeElement;
    (e.focus({ preventScroll: !0 }),
      e !== n &&
        (function (e) {
          return e instanceof HTMLInputElement && "select" in e;
        })(e) &&
        t &&
        e.select());
  }
}
const lct = (function () {
  let e = [];
  return {
    add(t) {
      const n = e[0];
      (t !== n && (null == n || n.pause()), (e = cct(e, t)), e.unshift(t));
    },
    remove(t) {
      var n;
      ((e = cct(e, t)), null === (n = e[0]) || void 0 === n || n.resume());
    },
  };
})();
function cct(e, t) {
  const n = [...e],
    i = n.indexOf(t);
  return (-1 !== i && n.splice(i, 1), n);
}
const dct = H.forwardRef((e, t) => {
    var n;
    const {
      container: i = null === globalThis ||
      void 0 === globalThis ||
      null === (n = globalThis.document) ||
      void 0 === n
        ? void 0
        : n.body,
      ...r
    } = e;
    return i ? ou.createPortal(H.createElement(zlt.div, Nlt({}, r, { ref: t })), i) : null;
  }),
  uct = Boolean(null === globalThis || void 0 === globalThis ? void 0 : globalThis.document)
    ? H.useLayoutEffect
    : () => {};
const hct = (e) => {
  const { present: t, children: n } = e,
    i = (function (e) {
      const [t, n] = H.useState(),
        i = H.useRef({}),
        r = H.useRef(e),
        o = H.useRef("none"),
        s = e ? "mounted" : "unmounted",
        [a, l] = (function (e, t) {
          return H.useReducer((e, n) => {
            const i = t[e][n];
            return null != i ? i : e;
          }, e);
        })(s, {
          mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" },
          unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" },
          unmounted: { MOUNT: "mounted" },
        });
      return (
        H.useEffect(() => {
          const e = gct(i.current);
          o.current = "mounted" === a ? e : "none";
        }, [a]),
        uct(() => {
          const t = i.current,
            n = r.current;
          if (n !== e) {
            const i = o.current,
              s = gct(t);
            if (e) l("MOUNT");
            else if ("none" === s || "none" === (null == t ? void 0 : t.display)) l("UNMOUNT");
            else {
              l(n && i !== s ? "ANIMATION_OUT" : "UNMOUNT");
            }
            r.current = e;
          }
        }, [e, l]),
        uct(() => {
          if (t) {
            const e = (e) => {
                const n = gct(i.current).includes(e.animationName);
                e.target === t && n && ru.flushSync(() => l("ANIMATION_END"));
              },
              n = (e) => {
                e.target === t && (o.current = gct(i.current));
              };
            return (
              t.addEventListener("animationstart", n),
              t.addEventListener("animationcancel", e),
              t.addEventListener("animationend", e),
              () => {
                (t.removeEventListener("animationstart", n),
                  t.removeEventListener("animationcancel", e),
                  t.removeEventListener("animationend", e));
              }
            );
          }
          l("ANIMATION_END");
        }, [t, l]),
        {
          isPresent: ["mounted", "unmountSuspended"].includes(a),
          ref: H.useCallback((e) => {
            (e && (i.current = getComputedStyle(e)), n(e));
          }, []),
        }
      );
    })(t),
    r = "function" == typeof n ? n({ present: i.isPresent }) : H.Children.only(n),
    o = Tlt(i.ref, r.ref);
  return "function" == typeof n || i.isPresent ? H.cloneElement(r, { ref: o }) : null;
};
function gct(e) {
  return (null == e ? void 0 : e.animationName) || "none";
}
hct.displayName = "Presence";
let pct = 0;
function fct() {
  const e = document.createElement("span");
  return (
    e.setAttribute("data-radix-focus-guard", ""),
    (e.tabIndex = 0),
    (e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none"),
    e
  );
}
var mct = M8e(),
  _ct = function () {},
  vct = H.forwardRef(function (e, t) {
    var n = H.useRef(null),
      i = H.useState({ onScrollCapture: _ct, onWheelCapture: _ct, onTouchMoveCapture: _ct }),
      r = i[0],
      o = i[1],
      s = e.forwardProps,
      a = e.children,
      l = e.className,
      c = e.removeScrollBar,
      d = e.enabled,
      u = e.shards,
      h = e.sideCar,
      g = e.noIsolation,
      p = e.inert,
      f = e.allowPinchZoom,
      m = e.as,
      _ = void 0 === m ? "div" : m,
      v = k8e(e, [
        "forwardProps",
        "children",
        "className",
        "removeScrollBar",
        "enabled",
        "shards",
        "sideCar",
        "noIsolation",
        "inert",
        "allowPinchZoom",
        "as",
      ]),
      b = h,
      y = R8e([n, t]),
      x = S8e(S8e({}, v), r);
    return H.createElement(
      H.Fragment,
      null,
      d &&
        H.createElement(b, {
          sideCar: mct,
          removeScrollBar: c,
          shards: u,
          noIsolation: g,
          inert: p,
          setCallbacks: o,
          allowPinchZoom: !!f,
          lockRef: n,
        }),
      s
        ? H.cloneElement(H.Children.only(a), S8e(S8e({}, x), { ref: y }))
        : H.createElement(_, S8e({}, x, { className: l, ref: y }), a),
    );
  });
((vct.defaultProps = { enabled: !0, removeScrollBar: !0, inert: !1 }),
  (vct.classNames = { fullWidth: L8e, zeroRight: N8e }));
var bct = !1;
if ("undefined" != typeof window)
  try {
    var yct = Object.defineProperty({}, "passive", {
      get: function () {
        return ((bct = !0), !0);
      },
    });
    (window.addEventListener("test", yct, yct), window.removeEventListener("test", yct, yct));
  } catch (W8t) {
    bct = !1;
  }
var xct = !!bct && { passive: !1 },
  wct = function (e, t) {
    var n = t;
    do {
      if (
        ("undefined" != typeof ShadowRoot && n instanceof ShadowRoot && (n = n.host), Cct(e, n))
      ) {
        var i = Sct(e, n);
        if (i[1] > i[2]) return !0;
      }
      n = n.parentNode;
    } while (n && n !== document.body);
    return !1;
  },
  Cct = function (e, t) {
    return "v" === e
      ? (function (e) {
          var t = window.getComputedStyle(e);
          return (
            "hidden" !== t.overflowY && !(t.overflowY === t.overflowX && "visible" === t.overflowY)
          );
        })(t)
      : (function (e) {
          var t = window.getComputedStyle(e);
          return (
            "hidden" !== t.overflowX && !(t.overflowY === t.overflowX && "visible" === t.overflowX)
          );
        })(t);
  },
  Sct = function (e, t) {
    return "v" === e
      ? (function (e) {
          return [e.scrollTop, e.scrollHeight, e.clientHeight];
        })(t)
      : (function (e) {
          return [e.scrollLeft, e.scrollWidth, e.clientWidth];
        })(t);
  },
  kct = function (e) {
    return "changedTouches" in e
      ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY]
      : [0, 0];
  },
  Ect = function (e) {
    return [e.deltaX, e.deltaY];
  },
  Nct = function (e) {
    return e && "current" in e ? e.current : e;
  },
  Lct = function (e) {
    return "\n  .block-interactivity-"
      .concat(e, " {pointer-events: none;}\n  .allow-interactivity-")
      .concat(e, " {pointer-events: all;}\n");
  },
  Dct = 0,
  Tct = [];
const Ict = P8e(mct, function (e) {
  var t = H.useRef([]),
    n = H.useRef([0, 0]),
    i = H.useRef(),
    r = H.useState(Dct++)[0],
    o = H.useState(function () {
      return H8e();
    })[0],
    s = H.useRef(e);
  (H.useEffect(
    function () {
      s.current = e;
    },
    [e],
  ),
    H.useEffect(
      function () {
        if (e.inert) {
          document.body.classList.add("block-interactivity-".concat(r));
          var t = E8e([e.lockRef.current], (e.shards || []).map(Nct), !0).filter(Boolean);
          return (
            t.forEach(function (e) {
              return e.classList.add("allow-interactivity-".concat(r));
            }),
            function () {
              (document.body.classList.remove("block-interactivity-".concat(r)),
                t.forEach(function (e) {
                  return e.classList.remove("allow-interactivity-".concat(r));
                }));
            }
          );
        }
      },
      [e.inert, e.lockRef.current, e.shards],
    ));
  var a = H.useCallback(function (e, t) {
      if ("touches" in e && 2 === e.touches.length) return !s.current.allowPinchZoom;
      var r,
        o = kct(e),
        a = n.current,
        l = "deltaX" in e ? e.deltaX : a[0] - o[0],
        c = "deltaY" in e ? e.deltaY : a[1] - o[1],
        d = e.target,
        u = Math.abs(l) > Math.abs(c) ? "h" : "v";
      if ("touches" in e && "h" === u && "range" === d.type) return !1;
      var h = wct(u, d);
      if (!h) return !0;
      if ((h ? (r = u) : ((r = "v" === u ? "h" : "v"), (h = wct(u, d))), !h)) return !1;
      if ((!i.current && "changedTouches" in e && (l || c) && (i.current = r), !r)) return !0;
      var g = i.current || r;
      return (function (e, t, n, i) {
        var r = (function (e, t) {
            return "h" === e && "rtl" === t ? -1 : 1;
          })(e, window.getComputedStyle(t).direction),
          o = r * i,
          s = n.target,
          a = t.contains(s),
          l = !1,
          c = o > 0,
          d = 0,
          u = 0;
        do {
          var h = Sct(e, s),
            g = h[0],
            p = h[1] - h[2] - r * g;
          ((g || p) && Cct(e, s) && ((d += p), (u += g)), (s = s.parentNode));
        } while ((!a && s !== document.body) || (a && (t.contains(s) || t === s)));
        return (c && 0 === d ? (l = !0) : c || 0 !== u || (l = !0), l);
      })(g, t, e, "h" === g ? l : c);
    }, []),
    l = H.useCallback(function (e) {
      var n = e;
      if (Tct.length && Tct[Tct.length - 1] === o) {
        var i = "deltaY" in n ? Ect(n) : kct(n),
          r = t.current.filter(function (e) {
            return (
              e.name === n.type &&
              e.target === n.target &&
              (function (e, t) {
                return e[0] === t[0] && e[1] === t[1];
              })(e.delta, i)
            );
          })[0];
        if (r && r.should) n.preventDefault();
        else if (!r) {
          var l = (s.current.shards || [])
            .map(Nct)
            .filter(Boolean)
            .filter(function (e) {
              return e.contains(n.target);
            });
          (l.length > 0 ? a(n, l[0]) : !s.current.noIsolation) && n.preventDefault();
        }
      }
    }, []),
    c = H.useCallback(function (e, n, i, r) {
      var o = { name: e, delta: n, target: i, should: r };
      (t.current.push(o),
        setTimeout(function () {
          t.current = t.current.filter(function (e) {
            return e !== o;
          });
        }, 1));
    }, []),
    d = H.useCallback(function (e) {
      ((n.current = kct(e)), (i.current = void 0));
    }, []),
    u = H.useCallback(function (t) {
      c(t.type, Ect(t), t.target, a(t, e.lockRef.current));
    }, []),
    h = H.useCallback(function (t) {
      c(t.type, kct(t), t.target, a(t, e.lockRef.current));
    }, []);
  H.useEffect(function () {
    return (
      Tct.push(o),
      e.setCallbacks({ onScrollCapture: u, onWheelCapture: u, onTouchMoveCapture: h }),
      document.addEventListener("wheel", l, xct),
      document.addEventListener("touchmove", l, xct),
      document.addEventListener("touchstart", d, xct),
      function () {
        ((Tct = Tct.filter(function (e) {
          return e !== o;
        })),
          document.removeEventListener("wheel", l, xct),
          document.removeEventListener("touchmove", l, xct),
          document.removeEventListener("touchstart", d, xct));
      }
    );
  }, []);
  var g = e.removeScrollBar,
    p = e.inert;
  return H.createElement(
    H.Fragment,
    null,
    p ? H.createElement(o, { styles: Lct(r) }) : null,
    g ? H.createElement(Y8e, { gapMode: "margin" }) : null,
  );
});
var Rct = H.forwardRef(function (e, t) {
  return H.createElement(vct, S8e({}, e, { ref: t, sideCar: Ict }));
});
Rct.classNames = vct.classNames;
const Oct = "Dialog",
  [Mct] = (function (e, t = []) {
    let n = [];
    const i = () => {
      const t = n.map((e) => H.createContext(e));
      return function (n) {
        const i = (null == n ? void 0 : n[e]) || t;
        return H.useMemo(() => ({ [`__scope${e}`]: { ...n, [e]: i } }), [n, i]);
      };
    };
    return (
      (i.scopeName = e),
      [
        function (t, i) {
          const r = H.createContext(i),
            o = n.length;
          function s(t) {
            const { scope: n, children: i, ...s } = t,
              a = (null == n ? void 0 : n[e][o]) || r,
              l = H.useMemo(() => s, Object.values(s));
            return H.createElement(a.Provider, { value: l }, i);
          }
          return (
            (n = [...n, i]),
            (s.displayName = t + "Provider"),
            [
              s,
              function (n, s) {
                const a = (null == s ? void 0 : s[e][o]) || r,
                  l = H.useContext(a);
                if (l) return l;
                if (void 0 !== i) return i;
                throw new Error(`\`${n}\` must be used within \`${t}\``);
              },
            ]
          );
        },
        Ilt(i, ...t),
      ]
    );
  })(Oct),
  [Act, Pct] = Mct(Oct),
  jct = "DialogPortal",
  [Fct, Bct] = Mct(jct, { forceMount: void 0 }),
  Vct = "DialogOverlay",
  Wct = H.forwardRef((e, t) => {
    const n = Bct(Vct, e.__scopeDialog),
      { forceMount: i = n.forceMount, ...r } = e,
      o = Pct(Vct, e.__scopeDialog);
    return o.modal
      ? H.createElement(hct, { present: i || o.open }, H.createElement(Hct, Nlt({}, r, { ref: t })))
      : null;
  }),
  Hct = H.forwardRef((e, t) => {
    const { __scopeDialog: n, ...i } = e,
      r = Pct(Vct, n);
    return H.createElement(
      Rct,
      { as: Flt, allowPinchZoom: !0, shards: [r.contentRef] },
      H.createElement(
        zlt.div,
        Nlt({ "data-state": Zct(r.open) }, i, {
          ref: t,
          style: { pointerEvents: "auto", ...i.style },
        }),
      ),
    );
  }),
  zct = "DialogContent",
  Uct = H.forwardRef((e, t) => {
    const n = Bct(zct, e.__scopeDialog),
      { forceMount: i = n.forceMount, ...r } = e,
      o = Pct(zct, e.__scopeDialog);
    return H.createElement(
      hct,
      { present: i || o.open },
      o.modal
        ? H.createElement($ct, Nlt({}, r, { ref: t }))
        : H.createElement(qct, Nlt({}, r, { ref: t })),
    );
  }),
  $ct = H.forwardRef((e, t) => {
    const n = Pct(zct, e.__scopeDialog),
      i = H.useRef(null),
      r = Tlt(t, n.contentRef, i);
    return (
      H.useEffect(() => {
        const e = i.current;
        if (e) return b9e(e);
      }, []),
      H.createElement(
        Kct,
        Nlt({}, e, {
          ref: r,
          trapFocus: n.open,
          disableOutsidePointerEvents: !0,
          onCloseAutoFocus: Llt(e.onCloseAutoFocus, (e) => {
            var t;
            (e.preventDefault(), null === (t = n.triggerRef.current) || void 0 === t || t.focus());
          }),
          onPointerDownOutside: Llt(e.onPointerDownOutside, (e) => {
            const t = e.detail.originalEvent,
              n = 0 === t.button && !0 === t.ctrlKey;
            (2 === t.button || n) && e.preventDefault();
          }),
          onFocusOutside: Llt(e.onFocusOutside, (e) => e.preventDefault()),
        }),
      )
    );
  }),
  qct = H.forwardRef((e, t) => {
    const n = Pct(zct, e.__scopeDialog),
      i = H.useRef(!1);
    return H.createElement(
      Kct,
      Nlt({}, e, {
        ref: t,
        trapFocus: !1,
        disableOutsidePointerEvents: !1,
        onCloseAutoFocus: (t) => {
          var r, o;
          (null === (r = e.onCloseAutoFocus) || void 0 === r || r.call(e, t), t.defaultPrevented) ||
            (i.current || null === (o = n.triggerRef.current) || void 0 === o || o.focus(),
            t.preventDefault());
          i.current = !1;
        },
        onInteractOutside: (t) => {
          var r, o;
          (null === (r = e.onInteractOutside) || void 0 === r || r.call(e, t),
            t.defaultPrevented || (i.current = !0));
          const s = t.target;
          (null === (o = n.triggerRef.current) || void 0 === o ? void 0 : o.contains(s)) &&
            t.preventDefault();
        },
      }),
    );
  }),
  Kct = H.forwardRef((e, t) => {
    const { __scopeDialog: n, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...s } = e,
      a = Pct(zct, n),
      l = Tlt(t, H.useRef(null));
    return (
      H.useEffect(() => {
        var e, t;
        const n = document.querySelectorAll("[data-radix-focus-guard]");
        return (
          document.body.insertAdjacentElement(
            "afterbegin",
            null !== (e = n[0]) && void 0 !== e ? e : fct(),
          ),
          document.body.insertAdjacentElement(
            "beforeend",
            null !== (t = n[1]) && void 0 !== t ? t : fct(),
          ),
          pct++,
          () => {
            (1 === pct &&
              document.querySelectorAll("[data-radix-focus-guard]").forEach((e) => e.remove()),
              pct--);
          }
        );
      }, []),
      H.createElement(
        H.Fragment,
        null,
        H.createElement(
          ict,
          { asChild: !0, loop: !0, trapped: i, onMountAutoFocus: r, onUnmountAutoFocus: o },
          H.createElement(
            Ylt,
            Nlt(
              {
                role: "dialog",
                id: a.contentId,
                "aria-describedby": a.descriptionId,
                "aria-labelledby": a.titleId,
                "data-state": Zct(a.open),
              },
              s,
              { ref: l, onDismiss: () => a.onOpenChange(!1) },
            ),
          ),
        ),
        !1,
      )
    );
  }),
  Gct = "DialogTitle";
function Zct(e) {
  return e ? "open" : "closed";
}
!(function (e, t) {
  const n = H.createContext(t);
  function i(e) {
    const { children: t, ...i } = e,
      r = H.useMemo(() => i, Object.values(i));
    return H.createElement(n.Provider, { value: r }, t);
  }
  i.displayName = e + "Provider";
})("DialogTitleWarning", { contentName: zct, titleName: Gct, docsSlug: "dialog" });
const Yct = (e) => {
    const {
        __scopeDialog: t,
        children: n,
        open: i,
        defaultOpen: r,
        onOpenChange: o,
        modal: s = !0,
      } = e,
      a = H.useRef(null),
      l = H.useRef(null),
      [c = !1, d] = jlt({ prop: i, defaultProp: r, onChange: o });
    return H.createElement(
      Act,
      {
        scope: t,
        triggerRef: a,
        contentRef: l,
        contentId: Alt(),
        titleId: Alt(),
        descriptionId: Alt(),
        open: c,
        onOpenChange: d,
        onOpenToggle: H.useCallback(() => d((e) => !e), [d]),
        modal: s,
      },
      n,
    );
  },
  Xct = (e) => {
    const { __scopeDialog: t, forceMount: n, children: i, container: r } = e,
      o = Pct(jct, t);
    return H.createElement(
      Fct,
      { scope: t, forceMount: n },
      H.Children.map(i, (e) =>
        H.createElement(
          hct,
          { present: n || o.open },
          H.createElement(dct, { asChild: !0, container: r }, e),
        ),
      ),
    );
  },
  Qct = Wct,
  Jct = Uct;
var edt = '[cmdk-group=""]',
  tdt = '[cmdk-group-items=""]',
  ndt = '[cmdk-item=""]',
  idt = `${ndt}:not([aria-disabled="true"])`,
  rdt = "cmdk-item-select",
  odt = "data-value",
  sdt = (e, t) => Elt(e, t),
  adt = H.createContext(void 0),
  ldt = () => H.useContext(adt),
  cdt = H.createContext(void 0),
  ddt = () => H.useContext(cdt),
  udt = H.createContext(void 0),
  hdt = H.forwardRef((e, t) => {
    let n = H.useRef(null),
      i = Edt(() => {
        var t, n, i;
        return {
          search: "",
          value:
            null !=
            (i =
              null != (n = e.value) ? n : null == (t = e.defaultValue) ? void 0 : t.toLowerCase())
              ? i
              : "",
          filtered: { count: 0, items: new Map(), groups: new Set() },
        };
      }),
      r = Edt(() => new Set()),
      o = Edt(() => new Map()),
      s = Edt(() => new Map()),
      a = Edt(() => new Set()),
      l = Sdt(e),
      {
        label: c,
        children: d,
        value: u,
        onValueChange: h,
        filter: g,
        shouldFilter: p,
        vimBindings: f = !0,
        ...m
      } = e,
      _ = H.useId(),
      v = H.useId(),
      b = H.useId(),
      y = Tdt();
    kdt(() => {
      if (void 0 !== u) {
        let e = u.trim().toLowerCase();
        ((i.current.value = e), y(6, N), x.emit());
      }
    }, [u]);
    let x = H.useMemo(
        () => ({
          subscribe: (e) => (a.current.add(e), () => a.current.delete(e)),
          snapshot: () => i.current,
          setState: (e, t, n) => {
            var r, o, s;
            if (!Object.is(i.current[e], t)) {
              if (((i.current[e] = t), "search" === e)) (E(), S(), y(1, k));
              else if ("value" === e) {
                if (void 0 !== (null == (r = l.current) ? void 0 : r.value)) {
                  let e = null != t ? t : "";
                  return void (null == (s = (o = l.current).onValueChange) || s.call(o, e));
                }
                n || y(5, N);
              }
              x.emit();
            }
          },
          emit: () => {
            a.current.forEach((e) => e());
          },
        }),
        [],
      ),
      w = H.useMemo(
        () => ({
          value: (e, t) => {
            t !== s.current.get(e) &&
              (s.current.set(e, t),
              i.current.filtered.items.set(e, C(t)),
              y(2, () => {
                (S(), x.emit());
              }));
          },
          item: (e, t) => (
            r.current.add(e),
            t && (o.current.has(t) ? o.current.get(t).add(e) : o.current.set(t, new Set([e]))),
            y(3, () => {
              (E(), S(), i.current.value || k(), x.emit());
            }),
            () => {
              (s.current.delete(e), r.current.delete(e), i.current.filtered.items.delete(e));
              let t = L();
              y(4, () => {
                (E(), (null == t ? void 0 : t.getAttribute("id")) === e && k(), x.emit());
              });
            }
          ),
          group: (e) => (
            o.current.has(e) || o.current.set(e, new Set()),
            () => {
              (s.current.delete(e), o.current.delete(e));
            }
          ),
          filter: () => l.current.shouldFilter,
          label: c || e["aria-label"],
          commandRef: n,
          listId: _,
          inputId: b,
          labelId: v,
        }),
        [],
      );
    function C(e) {
      var t, n;
      let r = null != (n = null == (t = l.current) ? void 0 : t.filter) ? n : sdt;
      return e ? r(e, i.current.search) : 0;
    }
    function S() {
      if (!n.current || !i.current.search || !1 === l.current.shouldFilter) return;
      let e = i.current.filtered.items,
        t = [];
      i.current.filtered.groups.forEach((n) => {
        let i = o.current.get(n),
          r = 0;
        (i.forEach((t) => {
          let n = e.get(t);
          r = Math.max(n, r);
        }),
          t.push([n, r]));
      });
      let r = n.current.querySelector('[cmdk-list-sizer=""]');
      (D()
        .sort((t, n) => {
          var i, r;
          let o = t.getAttribute(odt),
            s = n.getAttribute(odt);
          return (null != (i = e.get(s)) ? i : 0) - (null != (r = e.get(o)) ? r : 0);
        })
        .forEach((e) => {
          let t = e.closest(tdt);
          t
            ? t.appendChild(e.parentElement === t ? e : e.closest(`${tdt} > *`))
            : r.appendChild(e.parentElement === r ? e : e.closest(`${tdt} > *`));
        }),
        t
          .sort((e, t) => t[1] - e[1])
          .forEach((e) => {
            let t = n.current.querySelector(`${edt}[${odt}="${e[0]}"]`);
            null == t || t.parentElement.appendChild(t);
          }));
    }
    function k() {
      let e = D().find((e) => !e.ariaDisabled),
        t = null == e ? void 0 : e.getAttribute(odt);
      x.setState("value", t || void 0);
    }
    function E() {
      if (!i.current.search || !1 === l.current.shouldFilter)
        return void (i.current.filtered.count = r.current.size);
      i.current.filtered.groups = new Set();
      let e = 0;
      for (let t of r.current) {
        let n = C(s.current.get(t));
        (i.current.filtered.items.set(t, n), n > 0 && e++);
      }
      for (let [t, n] of o.current)
        for (let e of n)
          if (i.current.filtered.items.get(e) > 0) {
            i.current.filtered.groups.add(t);
            break;
          }
      i.current.filtered.count = e;
    }
    function N() {
      var e, t, n;
      let i = L();
      i &&
        ((null == (e = i.parentElement) ? void 0 : e.firstChild) === i &&
          (null ==
            (n =
              null == (t = i.closest(edt)) ? void 0 : t.querySelector('[cmdk-group-heading=""]')) ||
            n.scrollIntoView({ block: "nearest" })),
        i.scrollIntoView({ block: "nearest" }));
    }
    function L() {
      var e;
      return null == (e = n.current) ? void 0 : e.querySelector(`${ndt}[aria-selected="true"]`);
    }
    function D() {
      return Array.from(n.current.querySelectorAll(idt));
    }
    function T(e) {
      let t = D()[e];
      t && x.setState("value", t.getAttribute(odt));
    }
    function I(e) {
      var t;
      let n = L(),
        i = D(),
        r = i.findIndex((e) => e === n),
        o = i[r + e];
      (null != (t = l.current) &&
        t.loop &&
        (o = r + e < 0 ? i[i.length - 1] : r + e === i.length ? i[0] : i[r + e]),
        o && x.setState("value", o.getAttribute(odt)));
    }
    function R(e) {
      let t,
        n = L(),
        i = null == n ? void 0 : n.closest(edt);
      for (; i && !t; )
        ((i = e > 0 ? wdt(i, edt) : Cdt(i, edt)), (t = null == i ? void 0 : i.querySelector(idt)));
      t ? x.setState("value", t.getAttribute(odt)) : I(e);
    }
    let O = () => T(D().length - 1),
      M = (e) => {
        (e.preventDefault(), e.metaKey ? O() : e.altKey ? R(1) : I(1));
      },
      A = (e) => {
        (e.preventDefault(), e.metaKey ? T(0) : e.altKey ? R(-1) : I(-1));
      };
    return H.createElement(
      "div",
      {
        ref: Ndt([n, t]),
        ...m,
        "cmdk-root": "",
        onKeyDown: (e) => {
          var t;
          if ((null == (t = m.onKeyDown) || t.call(m, e), !e.defaultPrevented))
            switch (e.key) {
              case "n":
              case "j":
                f && e.ctrlKey && M(e);
                break;
              case "ArrowDown":
                M(e);
                break;
              case "p":
              case "k":
                f && e.ctrlKey && A(e);
                break;
              case "ArrowUp":
                A(e);
                break;
              case "Home":
                (e.preventDefault(), T(0));
                break;
              case "End":
                (e.preventDefault(), O());
                break;
              case "Enter":
                if (!e.nativeEvent.isComposing) {
                  e.preventDefault();
                  let t = L();
                  if (t) {
                    let e = new Event(rdt);
                    t.dispatchEvent(e);
                  }
                }
            }
        },
      },
      H.createElement(
        "label",
        { "cmdk-label": "", htmlFor: w.inputId, id: w.labelId, style: Idt },
        c,
      ),
      H.createElement(cdt.Provider, { value: x }, H.createElement(adt.Provider, { value: w }, d)),
    );
  }),
  gdt = H.forwardRef((e, t) => {
    var n, i;
    let r = H.useId(),
      o = H.useRef(null),
      s = H.useContext(udt),
      a = ldt(),
      l = Sdt(e),
      c =
        null != (i = null == (n = l.current) ? void 0 : n.forceMount)
          ? i
          : null == s
            ? void 0
            : s.forceMount;
    kdt(() => a.item(r, null == s ? void 0 : s.id), []);
    let d = Ddt(r, o, [e.value, e.children, o]),
      u = ddt(),
      h = Ldt((e) => e.value && e.value === d.current),
      g = Ldt((e) => !(!c && !1 !== a.filter()) || !e.search || e.filtered.items.get(r) > 0);
    function p() {
      var e, t;
      (f(), null == (t = (e = l.current).onSelect) || t.call(e, d.current));
    }
    function f() {
      u.setState("value", d.current, !0);
    }
    if (
      (H.useEffect(() => {
        let t = o.current;
        if (t && !e.disabled)
          return (t.addEventListener(rdt, p), () => t.removeEventListener(rdt, p));
      }, [g, e.onSelect, e.disabled]),
      !g)
    )
      return null;
    let { disabled: m, value: _, onSelect: v, forceMount: b, ...y } = e;
    return H.createElement(
      "div",
      {
        ref: Ndt([o, t]),
        ...y,
        id: r,
        "cmdk-item": "",
        role: "option",
        "aria-disabled": m || void 0,
        "aria-selected": h || void 0,
        "data-disabled": m || void 0,
        "data-selected": h || void 0,
        onPointerMove: m ? void 0 : f,
        onClick: m ? void 0 : p,
      },
      e.children,
    );
  }),
  pdt = H.forwardRef((e, t) => {
    let { heading: n, children: i, forceMount: r, ...o } = e,
      s = H.useId(),
      a = H.useRef(null),
      l = H.useRef(null),
      c = H.useId(),
      d = ldt(),
      u = Ldt((e) => !(!r && !1 !== d.filter()) || !e.search || e.filtered.groups.has(s));
    (kdt(() => d.group(s), []), Ddt(s, a, [e.value, e.heading, l]));
    let h = H.useMemo(() => ({ id: s, forceMount: r }), [r]),
      g = H.createElement(udt.Provider, { value: h }, i);
    return H.createElement(
      "div",
      { ref: Ndt([a, t]), ...o, "cmdk-group": "", role: "presentation", hidden: !u || void 0 },
      n &&
        H.createElement("div", { ref: l, "cmdk-group-heading": "", "aria-hidden": !0, id: c }, n),
      H.createElement(
        "div",
        { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? c : void 0 },
        g,
      ),
    );
  }),
  fdt = H.forwardRef((e, t) => {
    let { alwaysRender: n, ...i } = e,
      r = H.useRef(null),
      o = Ldt((e) => !e.search);
    return n || o
      ? H.createElement("div", { ref: Ndt([r, t]), ...i, "cmdk-separator": "", role: "separator" })
      : null;
  }),
  mdt = H.forwardRef((e, t) => {
    let { onValueChange: n, ...i } = e,
      r = null != e.value,
      o = ddt(),
      s = Ldt((e) => e.search),
      a = Ldt((e) => e.value),
      l = ldt(),
      c = H.useMemo(() => {
        var e;
        let t =
          null == (e = l.commandRef.current) ? void 0 : e.querySelector(`${ndt}[${odt}="${a}"]`);
        return null == t ? void 0 : t.getAttribute("id");
      }, [a, l.commandRef]);
    return (
      H.useEffect(() => {
        null != e.value && o.setState("search", e.value);
      }, [e.value]),
      H.createElement("input", {
        ref: t,
        ...i,
        "cmdk-input": "",
        autoComplete: "off",
        autoCorrect: "off",
        spellCheck: !1,
        "aria-autocomplete": "list",
        role: "combobox",
        "aria-expanded": !0,
        "aria-controls": l.listId,
        "aria-labelledby": l.labelId,
        "aria-activedescendant": c,
        id: l.inputId,
        type: "text",
        value: r ? e.value : s,
        onChange: (e) => {
          (r || o.setState("search", e.target.value), null == n || n(e.target.value));
        },
      })
    );
  }),
  _dt = H.forwardRef((e, t) => {
    let { children: n, ...i } = e,
      r = H.useRef(null),
      o = H.useRef(null),
      s = ldt();
    return (
      H.useEffect(() => {
        if (o.current && r.current) {
          let e,
            t = o.current,
            n = r.current,
            i = new ResizeObserver(() => {
              e = requestAnimationFrame(() => {
                let e = t.offsetHeight;
                n.style.setProperty("--cmdk-list-height", e.toFixed(1) + "px");
              });
            });
          return (
            i.observe(t),
            () => {
              (cancelAnimationFrame(e), i.unobserve(t));
            }
          );
        }
      }, []),
      H.createElement(
        "div",
        {
          ref: Ndt([r, t]),
          ...i,
          "cmdk-list": "",
          role: "listbox",
          "aria-label": "Suggestions",
          id: s.listId,
          "aria-labelledby": s.inputId,
        },
        H.createElement("div", { ref: o, "cmdk-list-sizer": "" }, n),
      )
    );
  }),
  vdt = H.forwardRef((e, t) => {
    let {
      open: n,
      onOpenChange: i,
      overlayClassName: r,
      contentClassName: o,
      container: s,
      ...a
    } = e;
    return H.createElement(
      Yct,
      { open: n, onOpenChange: i },
      H.createElement(
        Xct,
        { container: s },
        H.createElement(Qct, { "cmdk-overlay": "", className: r }),
        H.createElement(
          Jct,
          { "aria-label": e.label, "cmdk-dialog": "", className: o },
          H.createElement(hdt, { ref: t, ...a }),
        ),
      ),
    );
  }),
  bdt = H.forwardRef((e, t) => {
    let n = H.useRef(!0),
      i = Ldt((e) => 0 === e.filtered.count);
    return (
      H.useEffect(() => {
        n.current = !1;
      }, []),
      n.current || !i
        ? null
        : H.createElement("div", { ref: t, ...e, "cmdk-empty": "", role: "presentation" })
    );
  }),
  ydt = H.forwardRef((e, t) => {
    let { progress: n, children: i, ...r } = e;
    return H.createElement(
      "div",
      {
        ref: t,
        ...r,
        "cmdk-loading": "",
        role: "progressbar",
        "aria-valuenow": n,
        "aria-valuemin": 0,
        "aria-valuemax": 100,
        "aria-label": "Loading...",
      },
      H.createElement("div", { "aria-hidden": !0 }, i),
    );
  }),
  xdt = Object.assign(hdt, {
    List: _dt,
    Item: gdt,
    Input: mdt,
    Group: pdt,
    Separator: fdt,
    Dialog: vdt,
    Empty: bdt,
    Loading: ydt,
  });
function wdt(e, t) {
  let n = e.nextElementSibling;
  for (; n; ) {
    if (n.matches(t)) return n;
    n = n.nextElementSibling;
  }
}
function Cdt(e, t) {
  let n = e.previousElementSibling;
  for (; n; ) {
    if (n.matches(t)) return n;
    n = n.previousElementSibling;
  }
}
function Sdt(e) {
  let t = H.useRef(e);
  return (
    kdt(() => {
      t.current = e;
    }),
    t
  );
}
var kdt = "undefined" == typeof window ? H.useEffect : H.useLayoutEffect;
function Edt(e) {
  let t = H.useRef();
  return (void 0 === t.current && (t.current = e()), t);
}
function Ndt(e) {
  return (t) => {
    e.forEach((e) => {
      "function" == typeof e ? e(t) : null != e && (e.current = t);
    });
  };
}
function Ldt(e) {
  let t = ddt(),
    n = () => e(t.snapshot());
  return H.useSyncExternalStore(t.subscribe, n, n);
}
function Ddt(e, t, n) {
  let i = H.useRef(),
    r = ldt();
  return (
    kdt(() => {
      var o;
      let s = (() => {
        var e;
        for (let t of n) {
          if ("string" == typeof t) return t.trim().toLowerCase();
          if ("object" == typeof t && "current" in t)
            return t.current
              ? null == (e = t.current.textContent)
                ? void 0
                : e.trim().toLowerCase()
              : i.current;
        }
      })();
      (r.value(e, s), null == (o = t.current) || o.setAttribute(odt, s), (i.current = s));
    }),
    i
  );
}
var Tdt = () => {
    let [e, t] = H.useState(),
      n = Edt(() => new Map());
    return (
      kdt(() => {
        (n.current.forEach((e) => e()), (n.current = new Map()));
      }, [e]),
      (e, i) => {
        (n.current.set(e, i), t({}));
      }
    );
  },
  Idt = {
    position: "absolute",
    width: "1px",
    height: "1px",
    padding: "0",
    margin: "-1px",
    overflow: "hidden",
    clip: "rect(0, 0, 0, 0)",
    whiteSpace: "nowrap",
    borderWidth: "0",
  };
const Rdt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(xdt, {
    ref: n,
    className: Rf(
      "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
      e,
    ),
    ...t,
  }),
);
Rdt.displayName = xdt.displayName;
const Odt = ({ children: e, ...t }) =>
    Q.jsx(Z7e, {
      ...t,
      children: Q.jsx(eet, {
        className: "overflow-hidden p-0",
        children: Q.jsx(Rdt, {
          className:
            "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",
          children: e,
        }),
      }),
    }),
  Mdt = H.forwardRef(({ className: e, ...t }, n) =>
    Q.jsxs("div", {
      className: "flex items-center border-b px-3",
      "cmdk-input-wrapper": "",
      children: [
        Q.jsx(F7e, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
        Q.jsx(xdt.Input, {
          ref: n,
          className: Rf(
            "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
            e,
          ),
          ...t,
        }),
      ],
    }),
  );
Mdt.displayName = xdt.Input.displayName;
const Adt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(xdt.List, {
    ref: n,
    className: Rf("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
    ...t,
  }),
);
Adt.displayName = xdt.List.displayName;
const Pdt = H.forwardRef((e, t) =>
  Q.jsx(xdt.Empty, { ref: t, className: "py-6 text-center text-sm", ...e }),
);
Pdt.displayName = xdt.Empty.displayName;
const jdt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(xdt.Group, {
    ref: n,
    className: Rf(
      "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
      e,
    ),
    ...t,
  }),
);
jdt.displayName = xdt.Group.displayName;
const Fdt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(xdt.Separator, { ref: n, className: Rf("-mx-1 h-px bg-border", e), ...t }),
);
Fdt.displayName = xdt.Separator.displayName;
const Bdt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(xdt.Item, {
    ref: n,
    className: Rf(
      "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
      e,
    ),
    ...t,
  }),
);
function Vdt() {
  const [e, t] = H.useState(!1),
    n = og(),
    i = (function () {
      const e = [];
      for (const t of mlt)
        if ((t.href && e.push(t), t.sub)) for (const n of t.sub) e.push({ ...n, parent: t.title });
      return e;
    })(),
    { t: r } = Py("search"),
    { t: o } = Py("nav");
  H.useEffect(() => {
    const e = (e) => {
      "k" === e.key && (e.metaKey || e.ctrlKey) && (e.preventDefault(), t((e) => !e));
    };
    return (
      document.addEventListener("keydown", e),
      () => document.removeEventListener("keydown", e)
    );
  }, []);
  const s = H.useCallback(
    (e) => {
      (t(!1), n(e));
    },
    [n],
  );
  return Q.jsxs(Q.Fragment, {
    children: [
      Q.jsxs(ltt, {
        variant: "outline",
        className: "relative h-9 w-9 p-0 xl:h-10 xl:w-60 xl:justify-start xl:px-3 xl:py-2",
        onClick: () => t(!0),
        children: [
          Q.jsx(qat, { className: "h-4 w-4 xl:mr-2" }),
          Q.jsx("span", { className: "hidden xl:inline-flex", children: r("placeholder") }),
          Q.jsx("span", { className: "sr-only", children: r("shortcut.label") }),
          Q.jsx("kbd", {
            className:
              "pointer-events-none absolute right-1.5 top-2 hidden h-6 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 xl:flex",
            children: r("shortcut.key"),
          }),
        ],
      }),
      Q.jsxs(Odt, {
        open: e,
        onOpenChange: t,
        children: [
          Q.jsx(Mdt, { placeholder: r("placeholder") }),
          Q.jsxs(Adt, {
            children: [
              Q.jsx(Pdt, { children: r("noResults") }),
              Q.jsx(jdt, {
                heading: r("title"),
                children: i.map((e) =>
                  Q.jsxs(
                    Bdt,
                    {
                      value: `${e.parent ? e.parent + " " : ""}${e.title}`,
                      onSelect: () => s(e.href),
                      children: [
                        Q.jsx("div", { className: "mr-2", children: e.icon }),
                        Q.jsx("span", { children: o(e.title) }),
                        e.parent &&
                          Q.jsx("span", {
                            className: "ml-2 text-xs text-muted-foreground",
                            children: o(e.parent),
                          }),
                      ],
                    },
                    e.href,
                  ),
                ),
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
function Wdt() {
  const { theme: e, setTheme: t } = (() => {
    const e = H.useContext(zg);
    if (void 0 === e) throw new Error("useTheme must be used within a ThemeProvider");
    return e;
  })();
  return (
    H.useEffect(() => {
      const t = "dark" === e ? "#020817" : "#fff",
        n = document.querySelector("meta[name='theme-color']");
      n && n.setAttribute("content", t);
    }, [e]),
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Nm, {
          size: "icon",
          variant: "ghost",
          className: "rounded-full",
          onClick: () => t("light" === e ? "dark" : "light"),
          children: "light" === e ? Q.jsx(gm, { size: 20 }) : Q.jsx(bm, { size: 20 }),
        }),
        Q.jsx(Bot, {}),
      ],
    })
  );
}
function Hdt(...e) {
  const t = e[0];
  if (1 === e.length) return t;
  const n = () => {
    const n = e.map((e) => ({ useScope: e(), scopeName: e.scopeName }));
    return function (e) {
      const i = n.reduce(
        (t, { useScope: n, scopeName: i }) => ({ ...t, ...n(e)[`__scope${i}`] }),
        {},
      );
      return H.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
    };
  };
  return ((n.scopeName = t.scopeName), n);
}
Bdt.displayName = xdt.Item.displayName;
var zdt = [
    "a",
    "button",
    "div",
    "form",
    "h2",
    "h3",
    "img",
    "input",
    "label",
    "li",
    "nav",
    "ol",
    "p",
    "select",
    "span",
    "svg",
    "ul",
  ].reduce((e, t) => {
    const n = Lp(`Primitive.${t}`),
      i = H.forwardRef((e, i) => {
        const { asChild: r, ...o } = e,
          s = r ? n : t;
        return (
          "undefined" != typeof window && (window[Symbol.for("radix-ui")] = !0),
          Q.jsx(s, { ...o, ref: i })
        );
      });
    return ((i.displayName = `Primitive.${t}`), { ...e, [t]: i });
  }, {}),
  Udt = { exports: {} },
  $dt = {},
  qdt = H;
var Kdt =
    "function" == typeof Object.is
      ? Object.is
      : function (e, t) {
          return (e === t && (0 !== e || 1 / e == 1 / t)) || (e != e && t != t);
        },
  Gdt = qdt.useState,
  Zdt = qdt.useEffect,
  Ydt = qdt.useLayoutEffect,
  Xdt = qdt.useDebugValue;
function Qdt(e) {
  var t = e.getSnapshot;
  e = e.value;
  try {
    var n = t();
    return !Kdt(e, n);
  } catch (D2t) {
    return !0;
  }
}
var Jdt =
  "undefined" == typeof window ||
  void 0 === window.document ||
  void 0 === window.document.createElement
    ? function (e, t) {
        return t();
      }
    : function (e, t) {
        var n = t(),
          i = Gdt({ inst: { value: n, getSnapshot: t } }),
          r = i[0].inst,
          o = i[1];
        return (
          Ydt(
            function () {
              ((r.value = n), (r.getSnapshot = t), Qdt(r) && o({ inst: r }));
            },
            [e, n, t],
          ),
          Zdt(
            function () {
              return (
                Qdt(r) && o({ inst: r }),
                e(function () {
                  Qdt(r) && o({ inst: r });
                })
              );
            },
            [e],
          ),
          Xdt(n),
          n
        );
      };
(($dt.useSyncExternalStore = void 0 !== qdt.useSyncExternalStore ? qdt.useSyncExternalStore : Jdt),
  (Udt.exports = $dt));
var eut = Udt.exports;
function tut() {
  return () => {};
}
var nut = "Avatar",
  [iut] = (function (e, t = []) {
    let n = [];
    const i = () => {
      const t = n.map((e) => H.createContext(e));
      return function (n) {
        const i = n?.[e] || t;
        return H.useMemo(() => ({ [`__scope${e}`]: { ...n, [e]: i } }), [n, i]);
      };
    };
    return (
      (i.scopeName = e),
      [
        function (t, i) {
          const r = H.createContext(i);
          r.displayName = t + "Context";
          const o = n.length;
          n = [...n, i];
          const s = (t) => {
            const { scope: n, children: i, ...s } = t,
              a = n?.[e]?.[o] || r,
              l = H.useMemo(() => s, Object.values(s));
            return Q.jsx(a.Provider, { value: l, children: i });
          };
          return (
            (s.displayName = t + "Provider"),
            [
              s,
              function (n, s) {
                const a = s?.[e]?.[o] || r,
                  l = H.useContext(a);
                if (l) return l;
                if (void 0 !== i) return i;
                throw new Error(`\`${n}\` must be used within \`${t}\``);
              },
            ]
          );
        },
        Hdt(i, ...t),
      ]
    );
  })(nut),
  [rut, out] = iut(nut),
  sut = H.forwardRef((e, t) => {
    const { __scopeAvatar: n, ...i } = e,
      [r, o] = H.useState("idle");
    return Q.jsx(rut, {
      scope: n,
      imageLoadingStatus: r,
      onImageLoadingStatusChange: o,
      children: Q.jsx(zdt.span, { ...i, ref: t }),
    });
  });
sut.displayName = nut;
var aut = "AvatarImage",
  lut = H.forwardRef((e, t) => {
    const { __scopeAvatar: n, src: i, onLoadingStatusChange: r = () => {}, ...o } = e,
      s = out(aut, n),
      a = (function (e, { referrerPolicy: t, crossOrigin: n }) {
        const i = eut.useSyncExternalStore(
            tut,
            () => !0,
            () => !1,
          ),
          r = H.useRef(null),
          o = i ? (r.current || (r.current = new window.Image()), r.current) : null,
          [s, a] = H.useState(() => uut(o, e));
        return (
          sx(() => {
            a(uut(o, e));
          }, [o, e]),
          sx(() => {
            const e = (e) => () => {
              a(e);
            };
            if (!o) return;
            const i = e("loaded"),
              r = e("error");
            return (
              o.addEventListener("load", i),
              o.addEventListener("error", r),
              t && (o.referrerPolicy = t),
              "string" == typeof n && (o.crossOrigin = n),
              () => {
                (o.removeEventListener("load", i), o.removeEventListener("error", r));
              }
            );
          }, [o, n, t]),
          s
        );
      })(i, o),
      l = fx((e) => {
        (r(e), s.onImageLoadingStatusChange(e));
      });
    return (
      sx(() => {
        "idle" !== a && l(a);
      }, [a, l]),
      "loaded" === a ? Q.jsx(zdt.img, { ...o, ref: t, src: i }) : null
    );
  });
lut.displayName = aut;
var cut = "AvatarFallback",
  dut = H.forwardRef((e, t) => {
    const { __scopeAvatar: n, delayMs: i, ...r } = e,
      o = out(cut, n),
      [s, a] = H.useState(void 0 === i);
    return (
      H.useEffect(() => {
        if (void 0 !== i) {
          const e = window.setTimeout(() => a(!0), i);
          return () => window.clearTimeout(e);
        }
      }, [i]),
      s && "loaded" !== o.imageLoadingStatus ? Q.jsx(zdt.span, { ...r, ref: t }) : null
    );
  });
function uut(e, t) {
  return e
    ? t
      ? (e.src !== t && (e.src = t), e.complete && e.naturalWidth > 0 ? "loaded" : "loading")
      : "error"
    : "idle";
}
dut.displayName = cut;
var hut = sut,
  gut = lut,
  put = dut;
const fut = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(hut, {
    ref: n,
    className: Rf("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", e),
    ...t,
  }),
);
fut.displayName = hut.displayName;
const mut = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(gut, { ref: n, className: Rf("aspect-square h-full w-full", e), ...t }),
);
mut.displayName = gut.displayName;
const _ut = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(put, {
    ref: n,
    className: Rf("flex h-full w-full items-center justify-center rounded-full bg-muted", e),
    ...t,
  }),
);
function vut() {
  const e = og(),
    t = fp(),
    n = vp(M0e),
    { t: i } = Py(["common"]),
    r = n?.email?.split("@")[0] || i("common:user"),
    o = r.substring(0, 2).toUpperCase();
  return Q.jsxs(Not, {
    children: [
      Q.jsx(Lot, { asChild: !0, onClick: (e) => (e.stopPropagation(), e.preventDefault()), children: Q.jsx(Nm, {
          variant: "ghost",
          className: "relative h-8 w-8 rounded-full",
          children: Q.jsxs(fut, {
            className: "h-8 w-8",
            children: [Q.jsx(mut, { src: n?.avatar_url, alt: r }), Q.jsx(_ut, { children: o })],
          }),
        }),
      }),
      Q.jsxs(Iot, {
        className: "w-56",
        align: "end",
        forceMount: !0,
        children: [
          Q.jsx(Aot, {
            className: "font-normal",
            children: Q.jsxs("div", {
              className: "flex flex-col space-y-1",
              children: [
                Q.jsx("p", { className: "text-sm font-medium leading-none", children: r }),
                Q.jsx("p", {
                  className: "text-xs leading-none text-muted-foreground",
                  children: n?.email || i("common:defaultEmail"),
                }),
              ],
            }),
          }),
          Q.jsx(Pot, {}),
          Q.jsx(Rot, {
            asChild: !0,
            children: Q.jsxs(jg, {
              to: "/config/system",
              children: [i("common:settings"), Q.jsx(jot, { children: "⌘S" })],
            }),
          }),
          Q.jsx(Pot, {}),
          Q.jsxs(Rot, {
            onClick: () => {
              (Pm(), t(O0e()), e("/sign-in"));
            },
            children: [i("common:logout"), Q.jsx(jot, { children: "⇧⌘Q" })],
          }),
        ],
      }),
    ],
  });
}
_ut.displayName = put.displayName;
var but = Array.isArray,
  yut = "object" == typeof t && t && t.Object === Object && t,
  xut = yut,
  wut = "object" == typeof self && self && self.Object === Object && self,
  Cut = xut || wut || Function("return this")(),
  Sut = Cut.Symbol,
  kut = Sut,
  Eut = Object.prototype,
  Nut = Eut.hasOwnProperty,
  Lut = Eut.toString,
  Dut = kut ? kut.toStringTag : void 0;
var Tut = function (e) {
    var t = Nut.call(e, Dut),
      n = e[Dut];
    try {
      e[Dut] = void 0;
      var i = !0;
    } catch (spt) {}
    var r = Lut.call(e);
    return (i && (t ? (e[Dut] = n) : delete e[Dut]), r);
  },
  Iut = Object.prototype.toString;
var Rut = Tut,
  Out = function (e) {
    return Iut.call(e);
  },
  Mut = Sut ? Sut.toStringTag : void 0;
var Aut = function (e) {
  return null == e
    ? void 0 === e
      ? "[object Undefined]"
      : "[object Null]"
    : Mut && Mut in Object(e)
      ? Rut(e)
      : Out(e);
};
var Put = function (e) {
    return null != e && "object" == typeof e;
  },
  jut = Aut,
  Fut = Put;
var But = function (e) {
    return "symbol" == typeof e || (Fut(e) && "[object Symbol]" == jut(e));
  },
  Vut = but,
  Wut = But,
  Hut = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  zut = /^\w*$/;
var Uut = function (e, t) {
  if (Vut(e)) return !1;
  var n = typeof e;
  return (
    !("number" != n && "symbol" != n && "boolean" != n && null != e && !Wut(e)) ||
    zut.test(e) ||
    !Hut.test(e) ||
    (null != t && e in Object(t))
  );
};
var $ut = function (e) {
  var t = typeof e;
  return null != e && ("object" == t || "function" == t);
};
const qut = n($ut);
var Kut = Aut,
  Gut = $ut;
var Zut = function (e) {
  if (!Gut(e)) return !1;
  var t = Kut(e);
  return (
    "[object Function]" == t ||
    "[object GeneratorFunction]" == t ||
    "[object AsyncFunction]" == t ||
    "[object Proxy]" == t
  );
};
const Yut = n(Zut);
var Xut,
  Qut = Cut["__core-js_shared__"],
  Jut = (Xut = /[^.]+$/.exec((Qut && Qut.keys && Qut.keys.IE_PROTO) || ""))
    ? "Symbol(src)_1." + Xut
    : "";
var eht = function (e) {
    return !!Jut && Jut in e;
  },
  tht = Function.prototype.toString;
var nht = function (e) {
    if (null != e) {
      try {
        return tht.call(e);
      } catch (spt) {}
      try {
        return e + "";
      } catch (spt) {}
    }
    return "";
  },
  iht = Zut,
  rht = eht,
  oht = $ut,
  sht = nht,
  aht = /^\[object .+?Constructor\]$/,
  lht = Function.prototype,
  cht = Object.prototype,
  dht = lht.toString,
  uht = cht.hasOwnProperty,
  hht = RegExp(
    "^" +
      dht
        .call(uht)
        .replace(/[\\^$.*+?()[\]{}|]/g, "\\$&")
        .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") +
      "$",
  );
var ght = function (e, t) {
    return null == e ? void 0 : e[t];
  },
  pht = function (e) {
    return !(!oht(e) || rht(e)) && (iht(e) ? hht : aht).test(sht(e));
  },
  fht = ght;
var mht = function (e, t) {
    var n = fht(e, t);
    return pht(n) ? n : void 0;
  },
  _ht = mht(Object, "create"),
  vht = _ht;
var bht = function () {
  ((this.__data__ = vht ? vht(null) : {}), (this.size = 0));
};
var yht = function (e) {
    var t = this.has(e) && delete this.__data__[e];
    return ((this.size -= t ? 1 : 0), t);
  },
  xht = _ht,
  wht = Object.prototype.hasOwnProperty;
var Cht = function (e) {
    var t = this.__data__;
    if (xht) {
      var n = t[e];
      return "__lodash_hash_undefined__" === n ? void 0 : n;
    }
    return wht.call(t, e) ? t[e] : void 0;
  },
  Sht = _ht,
  kht = Object.prototype.hasOwnProperty;
var Eht = _ht;
var Nht = bht,
  Lht = yht,
  Dht = Cht,
  Tht = function (e) {
    var t = this.__data__;
    return Sht ? void 0 !== t[e] : kht.call(t, e);
  },
  Iht = function (e, t) {
    var n = this.__data__;
    return (
      (this.size += this.has(e) ? 0 : 1),
      (n[e] = Eht && void 0 === t ? "__lodash_hash_undefined__" : t),
      this
    );
  };
function Rht(e) {
  var t = -1,
    n = null == e ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var i = e[t];
    this.set(i[0], i[1]);
  }
}
((Rht.prototype.clear = Nht),
  (Rht.prototype.delete = Lht),
  (Rht.prototype.get = Dht),
  (Rht.prototype.has = Tht),
  (Rht.prototype.set = Iht));
var Oht = Rht;
var Mht = function () {
  ((this.__data__ = []), (this.size = 0));
};
var Aht = function (e, t) {
    return e === t || (e != e && t != t);
  },
  Pht = Aht;
var jht = function (e, t) {
    for (var n = e.length; n--; ) if (Pht(e[n][0], t)) return n;
    return -1;
  },
  Fht = jht,
  Bht = Array.prototype.splice;
var Vht = function (e) {
    var t = this.__data__,
      n = Fht(t, e);
    return !(n < 0) && (n == t.length - 1 ? t.pop() : Bht.call(t, n, 1), --this.size, !0);
  },
  Wht = jht;
var Hht = function (e) {
    var t = this.__data__,
      n = Wht(t, e);
    return n < 0 ? void 0 : t[n][1];
  },
  zht = jht;
var Uht = jht;
var $ht = function (e, t) {
    var n = this.__data__,
      i = Uht(n, e);
    return (i < 0 ? (++this.size, n.push([e, t])) : (n[i][1] = t), this);
  },
  qht = Mht,
  Kht = Vht,
  Ght = Hht,
  Zht = function (e) {
    return zht(this.__data__, e) > -1;
  },
  Yht = $ht;
function Xht(e) {
  var t = -1,
    n = null == e ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var i = e[t];
    this.set(i[0], i[1]);
  }
}
((Xht.prototype.clear = qht),
  (Xht.prototype.delete = Kht),
  (Xht.prototype.get = Ght),
  (Xht.prototype.has = Zht),
  (Xht.prototype.set = Yht));
var Qht = Xht,
  Jht = mht(Cut, "Map"),
  egt = Oht,
  tgt = Qht,
  ngt = Jht;
var igt = function (e) {
  var t = typeof e;
  return "string" == t || "number" == t || "symbol" == t || "boolean" == t
    ? "__proto__" !== e
    : null === e;
};
var rgt = function (e, t) {
    var n = e.__data__;
    return igt(t) ? n["string" == typeof t ? "string" : "hash"] : n.map;
  },
  ogt = rgt;
var sgt = rgt;
var agt = rgt;
var lgt = rgt;
var cgt = function (e, t) {
    var n = lgt(this, e),
      i = n.size;
    return (n.set(e, t), (this.size += n.size == i ? 0 : 1), this);
  },
  dgt = function () {
    ((this.size = 0),
      (this.__data__ = { hash: new egt(), map: new (ngt || tgt)(), string: new egt() }));
  },
  ugt = function (e) {
    var t = ogt(this, e).delete(e);
    return ((this.size -= t ? 1 : 0), t);
  },
  hgt = function (e) {
    return sgt(this, e).get(e);
  },
  ggt = function (e) {
    return agt(this, e).has(e);
  },
  pgt = cgt;
function fgt(e) {
  var t = -1,
    n = null == e ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var i = e[t];
    this.set(i[0], i[1]);
  }
}
((fgt.prototype.clear = dgt),
  (fgt.prototype.delete = ugt),
  (fgt.prototype.get = hgt),
  (fgt.prototype.has = ggt),
  (fgt.prototype.set = pgt));
var mgt = fgt,
  _gt = mgt;
function vgt(e, t) {
  if ("function" != typeof e || (null != t && "function" != typeof t))
    throw new TypeError("Expected a function");
  var n = function () {
    var i = arguments,
      r = t ? t.apply(this, i) : i[0],
      o = n.cache;
    if (o.has(r)) return o.get(r);
    var s = e.apply(this, i);
    return ((n.cache = o.set(r, s) || o), s);
  };
  return ((n.cache = new (vgt.Cache || _gt)()), n);
}
vgt.Cache = _gt;
var bgt = vgt;
const ygt = n(bgt);
var xgt = bgt;
var wgt = function (e) {
    var t = xgt(e, function (e) {
        return (500 === n.size && n.clear(), e);
      }),
      n = t.cache;
    return t;
  },
  Cgt =
    /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,
  Sgt = /\\(\\)?/g,
  kgt = wgt(function (e) {
    var t = [];
    return (
      46 === e.charCodeAt(0) && t.push(""),
      e.replace(Cgt, function (e, n, i, r) {
        t.push(i ? r.replace(Sgt, "$1") : n || e);
      }),
      t
    );
  }),
  Egt = kgt;
var Ngt = function (e, t) {
    for (var n = -1, i = null == e ? 0 : e.length, r = Array(i); ++n < i; ) r[n] = t(e[n], n, e);
    return r;
  },
  Lgt = Ngt,
  Dgt = but,
  Tgt = But,
  Igt = Sut ? Sut.prototype : void 0,
  Rgt = Igt ? Igt.toString : void 0;
var Ogt = function e(t) {
    if ("string" == typeof t) return t;
    if (Dgt(t)) return Lgt(t, e) + "";
    if (Tgt(t)) return Rgt ? Rgt.call(t) : "";
    var n = t + "";
    return "0" == n && 1 / t == -1 / 0 ? "-0" : n;
  },
  Mgt = Ogt;
var Agt = function (e) {
    return null == e ? "" : Mgt(e);
  },
  Pgt = but,
  jgt = Uut,
  Fgt = Egt,
  Bgt = Agt;
var Vgt = function (e, t) {
    return Pgt(e) ? e : jgt(e, t) ? [e] : Fgt(Bgt(e));
  },
  Wgt = But;
var Hgt = function (e) {
    if ("string" == typeof e || Wgt(e)) return e;
    var t = e + "";
    return "0" == t && 1 / e == -1 / 0 ? "-0" : t;
  },
  zgt = Vgt,
  Ugt = Hgt;
var $gt = function (e, t) {
    for (var n = 0, i = (t = zgt(t, e)).length; null != e && n < i; ) e = e[Ugt(t[n++])];
    return n && n == i ? e : void 0;
  },
  qgt = $gt;
var Kgt = function (e, t, n) {
  var i = null == e ? void 0 : qgt(e, t);
  return void 0 === i ? n : i;
};
const Ggt = n(Kgt);
const Zgt = n(function (e) {
  return null == e;
});
var Ygt = Aut,
  Xgt = but,
  Qgt = Put;
const Jgt = n(function (e) {
  return "string" == typeof e || (!Xgt(e) && Qgt(e) && "[object String]" == Ygt(e));
});
var ept,
  tpt = { exports: {} },
  npt = {},
  ipt = Symbol.for("react.element"),
  rpt = Symbol.for("react.portal"),
  opt = Symbol.for("react.fragment"),
  spt = Symbol.for("react.strict_mode"),
  apt = Symbol.for("react.profiler"),
  lpt = Symbol.for("react.provider"),
  cpt = Symbol.for("react.context"),
  dpt = Symbol.for("react.server_context"),
  upt = Symbol.for("react.forward_ref"),
  hpt = Symbol.for("react.suspense"),
  gpt = Symbol.for("react.suspense_list"),
  ppt = Symbol.for("react.memo"),
  fpt = Symbol.for("react.lazy"),
  mpt = Symbol.for("react.offscreen");
function _pt(e) {
  if ("object" == typeof e && null !== e) {
    var t = e.$$typeof;
    switch (t) {
      case ipt:
        switch ((e = e.type)) {
          case opt:
          case apt:
          case spt:
          case hpt:
          case gpt:
            return e;
          default:
            switch ((e = e && e.$$typeof)) {
              case dpt:
              case cpt:
              case upt:
              case fpt:
              case ppt:
              case lpt:
                return e;
              default:
                return t;
            }
        }
      case rpt:
        return t;
    }
  }
}
((ept = Symbol.for("react.module.reference")),
  (npt.ContextConsumer = cpt),
  (npt.ContextProvider = lpt),
  (npt.Element = ipt),
  (npt.ForwardRef = upt),
  (npt.Fragment = opt),
  (npt.Lazy = fpt),
  (npt.Memo = ppt),
  (npt.Portal = rpt),
  (npt.Profiler = apt),
  (npt.StrictMode = spt),
  (npt.Suspense = hpt),
  (npt.SuspenseList = gpt),
  (npt.isAsyncMode = function () {
    return !1;
  }),
  (npt.isConcurrentMode = function () {
    return !1;
  }),
  (npt.isContextConsumer = function (e) {
    return _pt(e) === cpt;
  }),
  (npt.isContextProvider = function (e) {
    return _pt(e) === lpt;
  }),
  (npt.isElement = function (e) {
    return "object" == typeof e && null !== e && e.$$typeof === ipt;
  }),
  (npt.isForwardRef = function (e) {
    return _pt(e) === upt;
  }),
  (npt.isFragment = function (e) {
    return _pt(e) === opt;
  }),
  (npt.isLazy = function (e) {
    return _pt(e) === fpt;
  }),
  (npt.isMemo = function (e) {
    return _pt(e) === ppt;
  }),
  (npt.isPortal = function (e) {
    return _pt(e) === rpt;
  }),
  (npt.isProfiler = function (e) {
    return _pt(e) === apt;
  }),
  (npt.isStrictMode = function (e) {
    return _pt(e) === spt;
  }),
  (npt.isSuspense = function (e) {
    return _pt(e) === hpt;
  }),
  (npt.isSuspenseList = function (e) {
    return _pt(e) === gpt;
  }),
  (npt.isValidElementType = function (e) {
    return (
      "string" == typeof e ||
      "function" == typeof e ||
      e === opt ||
      e === apt ||
      e === spt ||
      e === hpt ||
      e === gpt ||
      e === mpt ||
      ("object" == typeof e &&
        null !== e &&
        (e.$$typeof === fpt ||
          e.$$typeof === ppt ||
          e.$$typeof === lpt ||
          e.$$typeof === cpt ||
          e.$$typeof === upt ||
          e.$$typeof === ept ||
          void 0 !== e.getModuleId))
    );
  }),
  (npt.typeOf = _pt),
  (tpt.exports = npt));
var vpt = tpt.exports,
  bpt = Aut,
  ypt = Put;
var xpt = function (e) {
  return "number" == typeof e || (ypt(e) && "[object Number]" == bpt(e));
};
const wpt = n(xpt);
var Cpt = xpt;
const Spt = n(function (e) {
  return Cpt(e) && e != +e;
});
var kpt = function (e) {
    return 0 === e ? 0 : e > 0 ? 1 : -1;
  },
  Ept = function (e) {
    return Jgt(e) && e.indexOf("%") === e.length - 1;
  },
  Npt = function (e) {
    return wpt(e) && !Spt(e);
  },
  Lpt = function (e) {
    return Npt(e) || Jgt(e);
  },
  Dpt = 0,
  Tpt = function (e) {
    var t = ++Dpt;
    return "".concat(e || "").concat(t);
  },
  Ipt = function (e, t) {
    var n,
      i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
      r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3];
    if (!Npt(e) && !Jgt(e)) return i;
    if (Ept(e)) {
      var o = e.indexOf("%");
      n = (t * parseFloat(e.slice(0, o))) / 100;
    } else n = +e;
    return (Spt(n) && (n = i), r && n > t && (n = t), n);
  },
  Rpt = function (e) {
    if (!e) return null;
    var t = Object.keys(e);
    return t && t.length ? e[t[0]] : null;
  },
  Opt = function (e, t) {
    return Npt(e) && Npt(t)
      ? function (n) {
          return e + n * (t - e);
        }
      : function () {
          return t;
        };
  };
function Mpt(e, t, n) {
  return e && e.length
    ? e.find(function (e) {
        return e && ("function" == typeof t ? t(e) : Ggt(e, t)) === n;
      })
    : null;
}
var Apt = function (e, t) {
  return Npt(e) && Npt(t)
    ? e - t
    : Jgt(e) && Jgt(t)
      ? e.localeCompare(t)
      : e instanceof Date && t instanceof Date
        ? e.getTime() - t.getTime()
        : String(e).localeCompare(String(t));
};
function Ppt(e, t) {
  for (var n in e)
    if ({}.hasOwnProperty.call(e, n) && (!{}.hasOwnProperty.call(t, n) || e[n] !== t[n])) return !1;
  for (var i in t) if ({}.hasOwnProperty.call(t, i) && !{}.hasOwnProperty.call(e, i)) return !1;
  return !0;
}
function jpt(e) {
  return (
    (jpt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    jpt(e)
  );
}
var Fpt = [
    "aria-activedescendant",
    "aria-atomic",
    "aria-autocomplete",
    "aria-busy",
    "aria-checked",
    "aria-colcount",
    "aria-colindex",
    "aria-colspan",
    "aria-controls",
    "aria-current",
    "aria-describedby",
    "aria-details",
    "aria-disabled",
    "aria-errormessage",
    "aria-expanded",
    "aria-flowto",
    "aria-haspopup",
    "aria-hidden",
    "aria-invalid",
    "aria-keyshortcuts",
    "aria-label",
    "aria-labelledby",
    "aria-level",
    "aria-live",
    "aria-modal",
    "aria-multiline",
    "aria-multiselectable",
    "aria-orientation",
    "aria-owns",
    "aria-placeholder",
    "aria-posinset",
    "aria-pressed",
    "aria-readonly",
    "aria-relevant",
    "aria-required",
    "aria-roledescription",
    "aria-rowcount",
    "aria-rowindex",
    "aria-rowspan",
    "aria-selected",
    "aria-setsize",
    "aria-sort",
    "aria-valuemax",
    "aria-valuemin",
    "aria-valuenow",
    "aria-valuetext",
    "className",
    "color",
    "height",
    "id",
    "lang",
    "max",
    "media",
    "method",
    "min",
    "name",
    "style",
    "target",
    "width",
    "role",
    "tabIndex",
    "accentHeight",
    "accumulate",
    "additive",
    "alignmentBaseline",
    "allowReorder",
    "alphabetic",
    "amplitude",
    "arabicForm",
    "ascent",
    "attributeName",
    "attributeType",
    "autoReverse",
    "azimuth",
    "baseFrequency",
    "baselineShift",
    "baseProfile",
    "bbox",
    "begin",
    "bias",
    "by",
    "calcMode",
    "capHeight",
    "clip",
    "clipPath",
    "clipPathUnits",
    "clipRule",
    "colorInterpolation",
    "colorInterpolationFilters",
    "colorProfile",
    "colorRendering",
    "contentScriptType",
    "contentStyleType",
    "cursor",
    "cx",
    "cy",
    "d",
    "decelerate",
    "descent",
    "diffuseConstant",
    "direction",
    "display",
    "divisor",
    "dominantBaseline",
    "dur",
    "dx",
    "dy",
    "edgeMode",
    "elevation",
    "enableBackground",
    "end",
    "exponent",
    "externalResourcesRequired",
    "fill",
    "fillOpacity",
    "fillRule",
    "filter",
    "filterRes",
    "filterUnits",
    "floodColor",
    "floodOpacity",
    "focusable",
    "fontFamily",
    "fontSize",
    "fontSizeAdjust",
    "fontStretch",
    "fontStyle",
    "fontVariant",
    "fontWeight",
    "format",
    "from",
    "fx",
    "fy",
    "g1",
    "g2",
    "glyphName",
    "glyphOrientationHorizontal",
    "glyphOrientationVertical",
    "glyphRef",
    "gradientTransform",
    "gradientUnits",
    "hanging",
    "horizAdvX",
    "horizOriginX",
    "href",
    "ideographic",
    "imageRendering",
    "in2",
    "in",
    "intercept",
    "k1",
    "k2",
    "k3",
    "k4",
    "k",
    "kernelMatrix",
    "kernelUnitLength",
    "kerning",
    "keyPoints",
    "keySplines",
    "keyTimes",
    "lengthAdjust",
    "letterSpacing",
    "lightingColor",
    "limitingConeAngle",
    "local",
    "markerEnd",
    "markerHeight",
    "markerMid",
    "markerStart",
    "markerUnits",
    "markerWidth",
    "mask",
    "maskContentUnits",
    "maskUnits",
    "mathematical",
    "mode",
    "numOctaves",
    "offset",
    "opacity",
    "operator",
    "order",
    "orient",
    "orientation",
    "origin",
    "overflow",
    "overlinePosition",
    "overlineThickness",
    "paintOrder",
    "panose1",
    "pathLength",
    "patternContentUnits",
    "patternTransform",
    "patternUnits",
    "pointerEvents",
    "pointsAtX",
    "pointsAtY",
    "pointsAtZ",
    "preserveAlpha",
    "preserveAspectRatio",
    "primitiveUnits",
    "r",
    "radius",
    "refX",
    "refY",
    "renderingIntent",
    "repeatCount",
    "repeatDur",
    "requiredExtensions",
    "requiredFeatures",
    "restart",
    "result",
    "rotate",
    "rx",
    "ry",
    "seed",
    "shapeRendering",
    "slope",
    "spacing",
    "specularConstant",
    "specularExponent",
    "speed",
    "spreadMethod",
    "startOffset",
    "stdDeviation",
    "stemh",
    "stemv",
    "stitchTiles",
    "stopColor",
    "stopOpacity",
    "strikethroughPosition",
    "strikethroughThickness",
    "string",
    "stroke",
    "strokeDasharray",
    "strokeDashoffset",
    "strokeLinecap",
    "strokeLinejoin",
    "strokeMiterlimit",
    "strokeOpacity",
    "strokeWidth",
    "surfaceScale",
    "systemLanguage",
    "tableValues",
    "targetX",
    "targetY",
    "textAnchor",
    "textDecoration",
    "textLength",
    "textRendering",
    "to",
    "transform",
    "u1",
    "u2",
    "underlinePosition",
    "underlineThickness",
    "unicode",
    "unicodeBidi",
    "unicodeRange",
    "unitsPerEm",
    "vAlphabetic",
    "values",
    "vectorEffect",
    "version",
    "vertAdvY",
    "vertOriginX",
    "vertOriginY",
    "vHanging",
    "vIdeographic",
    "viewTarget",
    "visibility",
    "vMathematical",
    "widths",
    "wordSpacing",
    "writingMode",
    "x1",
    "x2",
    "x",
    "xChannelSelector",
    "xHeight",
    "xlinkActuate",
    "xlinkArcrole",
    "xlinkHref",
    "xlinkRole",
    "xlinkShow",
    "xlinkTitle",
    "xlinkType",
    "xmlBase",
    "xmlLang",
    "xmlns",
    "xmlnsXlink",
    "xmlSpace",
    "y1",
    "y2",
    "y",
    "yChannelSelector",
    "z",
    "zoomAndPan",
    "ref",
    "key",
    "angle",
  ],
  Bpt = ["points", "pathLength"],
  Vpt = { svg: ["viewBox", "children"], polygon: Bpt, polyline: Bpt },
  Wpt = [
    "dangerouslySetInnerHTML",
    "onCopy",
    "onCopyCapture",
    "onCut",
    "onCutCapture",
    "onPaste",
    "onPasteCapture",
    "onCompositionEnd",
    "onCompositionEndCapture",
    "onCompositionStart",
    "onCompositionStartCapture",
    "onCompositionUpdate",
    "onCompositionUpdateCapture",
    "onFocus",
    "onFocusCapture",
    "onBlur",
    "onBlurCapture",
    "onChange",
    "onChangeCapture",
    "onBeforeInput",
    "onBeforeInputCapture",
    "onInput",
    "onInputCapture",
    "onReset",
    "onResetCapture",
    "onSubmit",
    "onSubmitCapture",
    "onInvalid",
    "onInvalidCapture",
    "onLoad",
    "onLoadCapture",
    "onError",
    "onErrorCapture",
    "onKeyDown",
    "onKeyDownCapture",
    "onKeyPress",
    "onKeyPressCapture",
    "onKeyUp",
    "onKeyUpCapture",
    "onAbort",
    "onAbortCapture",
    "onCanPlay",
    "onCanPlayCapture",
    "onCanPlayThrough",
    "onCanPlayThroughCapture",
    "onDurationChange",
    "onDurationChangeCapture",
    "onEmptied",
    "onEmptiedCapture",
    "onEncrypted",
    "onEncryptedCapture",
    "onEnded",
    "onEndedCapture",
    "onLoadedData",
    "onLoadedDataCapture",
    "onLoadedMetadata",
    "onLoadedMetadataCapture",
    "onLoadStart",
    "onLoadStartCapture",
    "onPause",
    "onPauseCapture",
    "onPlay",
    "onPlayCapture",
    "onPlaying",
    "onPlayingCapture",
    "onProgress",
    "onProgressCapture",
    "onRateChange",
    "onRateChangeCapture",
    "onSeeked",
    "onSeekedCapture",
    "onSeeking",
    "onSeekingCapture",
    "onStalled",
    "onStalledCapture",
    "onSuspend",
    "onSuspendCapture",
    "onTimeUpdate",
    "onTimeUpdateCapture",
    "onVolumeChange",
    "onVolumeChangeCapture",
    "onWaiting",
    "onWaitingCapture",
    "onAuxClick",
    "onAuxClickCapture",
    "onClick",
    "onClickCapture",
    "onContextMenu",
    "onContextMenuCapture",
    "onDoubleClick",
    "onDoubleClickCapture",
    "onDrag",
    "onDragCapture",
    "onDragEnd",
    "onDragEndCapture",
    "onDragEnter",
    "onDragEnterCapture",
    "onDragExit",
    "onDragExitCapture",
    "onDragLeave",
    "onDragLeaveCapture",
    "onDragOver",
    "onDragOverCapture",
    "onDragStart",
    "onDragStartCapture",
    "onDrop",
    "onDropCapture",
    "onMouseDown",
    "onMouseDownCapture",
    "onMouseEnter",
    "onMouseLeave",
    "onMouseMove",
    "onMouseMoveCapture",
    "onMouseOut",
    "onMouseOutCapture",
    "onMouseOver",
    "onMouseOverCapture",
    "onMouseUp",
    "onMouseUpCapture",
    "onSelect",
    "onSelectCapture",
    "onTouchCancel",
    "onTouchCancelCapture",
    "onTouchEnd",
    "onTouchEndCapture",
    "onTouchMove",
    "onTouchMoveCapture",
    "onTouchStart",
    "onTouchStartCapture",
    "onPointerDown",
    "onPointerDownCapture",
    "onPointerMove",
    "onPointerMoveCapture",
    "onPointerUp",
    "onPointerUpCapture",
    "onPointerCancel",
    "onPointerCancelCapture",
    "onPointerEnter",
    "onPointerEnterCapture",
    "onPointerLeave",
    "onPointerLeaveCapture",
    "onPointerOver",
    "onPointerOverCapture",
    "onPointerOut",
    "onPointerOutCapture",
    "onGotPointerCapture",
    "onGotPointerCaptureCapture",
    "onLostPointerCapture",
    "onLostPointerCaptureCapture",
    "onScroll",
    "onScrollCapture",
    "onWheel",
    "onWheelCapture",
    "onAnimationStart",
    "onAnimationStartCapture",
    "onAnimationEnd",
    "onAnimationEndCapture",
    "onAnimationIteration",
    "onAnimationIterationCapture",
    "onTransitionEnd",
    "onTransitionEndCapture",
  ],
  Hpt = function (e, t) {
    if (!e || "function" == typeof e || "boolean" == typeof e) return null;
    var n = e;
    if ((H.isValidElement(e) && (n = e.props), !qut(n))) return null;
    var i = {};
    return (
      Object.keys(n).forEach(function (e) {
        Wpt.includes(e) &&
          (i[e] =
            t ||
            function (t) {
              return n[e](n, t);
            });
      }),
      i
    );
  },
  zpt = function (e, t, n) {
    if (!qut(e) || "object" !== jpt(e)) return null;
    var i = null;
    return (
      Object.keys(e).forEach(function (r) {
        var o = e[r];
        Wpt.includes(r) &&
          "function" == typeof o &&
          (i || (i = {}),
          (i[r] = (function (e, t, n) {
            return function (i) {
              return (e(t, n, i), null);
            };
          })(o, t, n)));
      }),
      i
    );
  },
  Upt = ["children"],
  $pt = ["children"];
function qpt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function Kpt(e) {
  return (
    (Kpt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    Kpt(e)
  );
}
var Gpt = {
    click: "onClick",
    mousedown: "onMouseDown",
    mouseup: "onMouseUp",
    mouseover: "onMouseOver",
    mousemove: "onMouseMove",
    mouseout: "onMouseOut",
    mouseenter: "onMouseEnter",
    mouseleave: "onMouseLeave",
    touchcancel: "onTouchCancel",
    touchend: "onTouchEnd",
    touchmove: "onTouchMove",
    touchstart: "onTouchStart",
    contextmenu: "onContextMenu",
    dblclick: "onDoubleClick",
  },
  Zpt = function (e) {
    return "string" == typeof e ? e : e ? e.displayName || e.name || "Component" : "";
  },
  Ypt = null,
  Xpt = null,
  Qpt = function e(t) {
    if (t === Ypt && Array.isArray(Xpt)) return Xpt;
    var n = [];
    return (
      H.Children.forEach(t, function (t) {
        Zgt(t) || (vpt.isFragment(t) ? (n = n.concat(e(t.props.children))) : n.push(t));
      }),
      (Xpt = n),
      (Ypt = t),
      n
    );
  };
function Jpt(e, t) {
  var n = [],
    i = [];
  return (
    (i = Array.isArray(t)
      ? t.map(function (e) {
          return Zpt(e);
        })
      : [Zpt(t)]),
    Qpt(e).forEach(function (e) {
      var t = Ggt(e, "type.displayName") || Ggt(e, "type.name");
      -1 !== i.indexOf(t) && n.push(e);
    }),
    n
  );
}
function eft(e, t) {
  var n = Jpt(e, t);
  return n && n[0];
}
var tft = function (e) {
    if (!e || !e.props) return !1;
    var t = e.props,
      n = t.width,
      i = t.height;
    return !(!Npt(n) || n <= 0 || !Npt(i) || i <= 0);
  },
  nft = [
    "a",
    "altGlyph",
    "altGlyphDef",
    "altGlyphItem",
    "animate",
    "animateColor",
    "animateMotion",
    "animateTransform",
    "circle",
    "clipPath",
    "color-profile",
    "cursor",
    "defs",
    "desc",
    "ellipse",
    "feBlend",
    "feColormatrix",
    "feComponentTransfer",
    "feComposite",
    "feConvolveMatrix",
    "feDiffuseLighting",
    "feDisplacementMap",
    "feDistantLight",
    "feFlood",
    "feFuncA",
    "feFuncB",
    "feFuncG",
    "feFuncR",
    "feGaussianBlur",
    "feImage",
    "feMerge",
    "feMergeNode",
    "feMorphology",
    "feOffset",
    "fePointLight",
    "feSpecularLighting",
    "feSpotLight",
    "feTile",
    "feTurbulence",
    "filter",
    "font",
    "font-face",
    "font-face-format",
    "font-face-name",
    "font-face-url",
    "foreignObject",
    "g",
    "glyph",
    "glyphRef",
    "hkern",
    "image",
    "line",
    "lineGradient",
    "marker",
    "mask",
    "metadata",
    "missing-glyph",
    "mpath",
    "path",
    "pattern",
    "polygon",
    "polyline",
    "radialGradient",
    "rect",
    "script",
    "set",
    "stop",
    "style",
    "svg",
    "switch",
    "symbol",
    "text",
    "textPath",
    "title",
    "tref",
    "tspan",
    "use",
    "view",
    "vkern",
  ],
  ift = function (e) {
    return e && "object" === Kpt(e) && "clipDot" in e;
  },
  rft = function (e, t, n) {
    if (!e || "function" == typeof e || "boolean" == typeof e) return null;
    var i = e;
    if ((H.isValidElement(e) && (i = e.props), !qut(i))) return null;
    var r = {};
    return (
      Object.keys(i).forEach(function (e) {
        var o;
        (function (e, t, n, i) {
          var r,
            o = null !== (r = null == Vpt ? void 0 : Vpt[i]) && void 0 !== r ? r : [];
          return (
            t.startsWith("data-") ||
            (!Yut(e) && ((i && o.includes(t)) || Fpt.includes(t))) ||
            (n && Wpt.includes(t))
          );
        })(null === (o = i) || void 0 === o ? void 0 : o[e], e, t, n) && (r[e] = i[e]);
      }),
      r
    );
  },
  oft = function e(t, n) {
    if (t === n) return !0;
    var i = H.Children.count(t);
    if (i !== H.Children.count(n)) return !1;
    if (0 === i) return !0;
    if (1 === i) return sft(Array.isArray(t) ? t[0] : t, Array.isArray(n) ? n[0] : n);
    for (var r = 0; r < i; r++) {
      var o = t[r],
        s = n[r];
      if (Array.isArray(o) || Array.isArray(s)) {
        if (!e(o, s)) return !1;
      } else if (!sft(o, s)) return !1;
    }
    return !0;
  },
  sft = function (e, t) {
    if (Zgt(e) && Zgt(t)) return !0;
    if (!Zgt(e) && !Zgt(t)) {
      var n = e.props || {},
        i = n.children,
        r = qpt(n, Upt),
        o = t.props || {},
        s = o.children,
        a = qpt(o, $pt);
      return i && s ? Ppt(r, a) && oft(i, s) : !i && !s && Ppt(r, a);
    }
    return !1;
  },
  aft = function (e, t) {
    var n = [],
      i = {};
    return (
      Qpt(e).forEach(function (e, r) {
        if (
          (function (e) {
            return e && e.type && Jgt(e.type) && nft.indexOf(e.type) >= 0;
          })(e)
        )
          n.push(e);
        else if (e) {
          var o = Zpt(e.type),
            s = t[o] || {},
            a = s.handler,
            l = s.once;
          if (a && (!l || !i[o])) {
            var c = a(e, o, r);
            (n.push(c), (i[o] = !0));
          }
        }
      }),
      n
    );
  },
  lft = ["children", "width", "height", "viewBox", "className", "style", "title", "desc"];
function cft() {
  return (
    (cft = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    cft.apply(this, arguments)
  );
}
function dft(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function uft(e) {
  var t = e.children,
    n = e.width,
    i = e.height,
    r = e.viewBox,
    o = e.className,
    s = e.style,
    a = e.title,
    l = e.desc,
    c = dft(e, lft),
    d = r || { width: n, height: i, x: 0, y: 0 },
    u = Mp("recharts-surface", o);
  return z.createElement(
    "svg",
    cft({}, rft(c, !0, "svg"), {
      className: u,
      width: n,
      height: i,
      style: s,
      viewBox: "".concat(d.x, " ").concat(d.y, " ").concat(d.width, " ").concat(d.height),
    }),
    z.createElement("title", null, a),
    z.createElement("desc", null, l),
    t,
  );
}
var hft = ["children", "className"];
function gft() {
  return (
    (gft = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    gft.apply(this, arguments)
  );
}
function pft(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
var fft = z.forwardRef(function (e, t) {
    var n = e.children,
      i = e.className,
      r = pft(e, hft),
      o = Mp("recharts-layer", i);
    return z.createElement("g", gft({ className: o }, rft(r, !0), { ref: t }), n);
  }),
  mft = function (e, t) {
    for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), r = 2; r < n; r++)
      i[r - 2] = arguments[r];
  };
var _ft = function (e, t, n) {
    var i = -1,
      r = e.length;
    (t < 0 && (t = -t > r ? 0 : r + t),
      (n = n > r ? r : n) < 0 && (n += r),
      (r = t > n ? 0 : (n - t) >>> 0),
      (t >>>= 0));
    for (var o = Array(r); ++i < r; ) o[i] = e[i + t];
    return o;
  },
  vft = _ft;
var bft = function (e, t, n) {
    var i = e.length;
    return ((n = void 0 === n ? i : n), !t && n >= i ? e : vft(e, t, n));
  },
  yft = RegExp(
    "[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]",
  );
var xft = function (e) {
  return yft.test(e);
};
var wft = function (e) {
    return e.split("");
  },
  Cft = "\\ud800-\\udfff",
  Sft = "[" + Cft + "]",
  kft = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",
  Eft = "\\ud83c[\\udffb-\\udfff]",
  Nft = "[^" + Cft + "]",
  Lft = "(?:\\ud83c[\\udde6-\\uddff]){2}",
  Dft = "[\\ud800-\\udbff][\\udc00-\\udfff]",
  Tft = "(?:" + kft + "|" + Eft + ")" + "?",
  Ift = "[\\ufe0e\\ufe0f]?",
  Rft = Ift + Tft + ("(?:\\u200d(?:" + [Nft, Lft, Dft].join("|") + ")" + Ift + Tft + ")*"),
  Oft = "(?:" + [Nft + kft + "?", kft, Lft, Dft, Sft].join("|") + ")",
  Mft = RegExp(Eft + "(?=" + Eft + ")|" + Oft + Rft, "g");
var Aft = function (e) {
    return e.match(Mft) || [];
  },
  Pft = wft,
  jft = xft,
  Fft = Aft;
var Bft = function (e) {
    return jft(e) ? Fft(e) : Pft(e);
  },
  Vft = bft,
  Wft = xft,
  Hft = Bft,
  zft = Agt;
var Uft = function (e) {
  return function (t) {
    t = zft(t);
    var n = Wft(t) ? Hft(t) : void 0,
      i = n ? n[0] : t.charAt(0),
      r = n ? Vft(n, 1).join("") : t.slice(1);
    return i[e]() + r;
  };
};
const $ft = n(Uft("toUpperCase"));
function qft(e) {
  return function () {
    return e;
  };
}
const Kft = Math.cos,
  Gft = Math.sin,
  Zft = Math.sqrt,
  Yft = Math.PI,
  Xft = 2 * Yft,
  Qft = Math.PI,
  Jft = 2 * Qft,
  emt = 1e-6,
  tmt = Jft - emt;
function nmt(e) {
  this._ += e[0];
  for (let t = 1, n = e.length; t < n; ++t) this._ += arguments[t] + e[t];
}
class imt {
  constructor(e) {
    ((this._x0 = this._y0 = this._x1 = this._y1 = null),
      (this._ = ""),
      (this._append =
        null == e
          ? nmt
          : (function (e) {
              let t = Math.floor(e);
              if (!(t >= 0)) throw new Error(`invalid digits: ${e}`);
              if (t > 15) return nmt;
              const n = 10 ** t;
              return function (e) {
                this._ += e[0];
                for (let t = 1, i = e.length; t < i; ++t)
                  this._ += Math.round(arguments[t] * n) / n + e[t];
              };
            })(e)));
  }
  moveTo(e, t) {
    this._append`M${(this._x0 = this._x1 = +e)},${(this._y0 = this._y1 = +t)}`;
  }
  closePath() {
    null !== this._x1 && ((this._x1 = this._x0), (this._y1 = this._y0), this._append`Z`);
  }
  lineTo(e, t) {
    this._append`L${(this._x1 = +e)},${(this._y1 = +t)}`;
  }
  quadraticCurveTo(e, t, n, i) {
    this._append`Q${+e},${+t},${(this._x1 = +n)},${(this._y1 = +i)}`;
  }
  bezierCurveTo(e, t, n, i, r, o) {
    this._append`C${+e},${+t},${+n},${+i},${(this._x1 = +r)},${(this._y1 = +o)}`;
  }
  arcTo(e, t, n, i, r) {
    if (((e = +e), (t = +t), (n = +n), (i = +i), (r = +r) < 0))
      throw new Error(`negative radius: ${r}`);
    let o = this._x1,
      s = this._y1,
      a = n - e,
      l = i - t,
      c = o - e,
      d = s - t,
      u = c * c + d * d;
    if (null === this._x1) this._append`M${(this._x1 = e)},${(this._y1 = t)}`;
    else if (u > emt)
      if (Math.abs(d * a - l * c) > emt && r) {
        let h = n - o,
          g = i - s,
          p = a * a + l * l,
          f = h * h + g * g,
          m = Math.sqrt(p),
          _ = Math.sqrt(u),
          v = r * Math.tan((Qft - Math.acos((p + u - f) / (2 * m * _))) / 2),
          b = v / _,
          y = v / m;
        (Math.abs(b - 1) > emt && this._append`L${e + b * c},${t + b * d}`,
          this
            ._append`A${r},${r},0,0,${+(d * h > c * g)},${(this._x1 = e + y * a)},${(this._y1 = t + y * l)}`);
      } else this._append`L${(this._x1 = e)},${(this._y1 = t)}`;
    else;
  }
  arc(e, t, n, i, r, o) {
    if (((e = +e), (t = +t), (o = !!o), (n = +n) < 0)) throw new Error(`negative radius: ${n}`);
    let s = n * Math.cos(i),
      a = n * Math.sin(i),
      l = e + s,
      c = t + a,
      d = 1 ^ o,
      u = o ? i - r : r - i;
    (null === this._x1
      ? this._append`M${l},${c}`
      : (Math.abs(this._x1 - l) > emt || Math.abs(this._y1 - c) > emt) && this._append`L${l},${c}`,
      n &&
        (u < 0 && (u = (u % Jft) + Jft),
        u > tmt
          ? this
              ._append`A${n},${n},0,1,${d},${e - s},${t - a}A${n},${n},0,1,${d},${(this._x1 = l)},${(this._y1 = c)}`
          : u > emt &&
            this
              ._append`A${n},${n},0,${+(u >= Qft)},${d},${(this._x1 = e + n * Math.cos(r))},${(this._y1 = t + n * Math.sin(r))}`));
  }
  rect(e, t, n, i) {
    this
      ._append`M${(this._x0 = this._x1 = +e)},${(this._y0 = this._y1 = +t)}h${(n = +n)}v${+i}h${-n}Z`;
  }
  toString() {
    return this._;
  }
}
function rmt(e) {
  let t = 3;
  return (
    (e.digits = function (n) {
      if (!arguments.length) return t;
      if (null == n) t = null;
      else {
        const e = Math.floor(n);
        if (!(e >= 0)) throw new RangeError(`invalid digits: ${n}`);
        t = e;
      }
      return e;
    }),
    () => new imt(t)
  );
}
function omt(e) {
  return "object" == typeof e && "length" in e ? e : Array.from(e);
}
function smt(e) {
  this._context = e;
}
function amt(e) {
  return new smt(e);
}
function lmt(e) {
  return e[0];
}
function cmt(e) {
  return e[1];
}
function dmt(e, t) {
  var n = qft(!0),
    i = null,
    r = amt,
    o = null,
    s = rmt(a);
  function a(a) {
    var l,
      c,
      d,
      u = (a = omt(a)).length,
      h = !1;
    for (null == i && (o = r((d = s()))), l = 0; l <= u; ++l)
      (!(l < u && n((c = a[l]), l, a)) === h && ((h = !h) ? o.lineStart() : o.lineEnd()),
        h && o.point(+e(c, l, a), +t(c, l, a)));
    if (d) return ((o = null), d + "" || null);
  }
  return (
    (e = "function" == typeof e ? e : void 0 === e ? lmt : qft(e)),
    (t = "function" == typeof t ? t : void 0 === t ? cmt : qft(t)),
    (a.x = function (t) {
      return arguments.length ? ((e = "function" == typeof t ? t : qft(+t)), a) : e;
    }),
    (a.y = function (e) {
      return arguments.length ? ((t = "function" == typeof e ? e : qft(+e)), a) : t;
    }),
    (a.defined = function (e) {
      return arguments.length ? ((n = "function" == typeof e ? e : qft(!!e)), a) : n;
    }),
    (a.curve = function (e) {
      return arguments.length ? ((r = e), null != i && (o = r(i)), a) : r;
    }),
    (a.context = function (e) {
      return arguments.length ? (null == e ? (i = o = null) : (o = r((i = e))), a) : i;
    }),
    a
  );
}
function umt(e, t, n) {
  var i = null,
    r = qft(!0),
    o = null,
    s = amt,
    a = null,
    l = rmt(c);
  function c(c) {
    var d,
      u,
      h,
      g,
      p,
      f = (c = omt(c)).length,
      m = !1,
      _ = new Array(f),
      v = new Array(f);
    for (null == o && (a = s((p = l()))), d = 0; d <= f; ++d) {
      if (!(d < f && r((g = c[d]), d, c)) === m)
        if ((m = !m)) ((u = d), a.areaStart(), a.lineStart());
        else {
          for (a.lineEnd(), a.lineStart(), h = d - 1; h >= u; --h) a.point(_[h], v[h]);
          (a.lineEnd(), a.areaEnd());
        }
      m &&
        ((_[d] = +e(g, d, c)),
        (v[d] = +t(g, d, c)),
        a.point(i ? +i(g, d, c) : _[d], n ? +n(g, d, c) : v[d]));
    }
    if (p) return ((a = null), p + "" || null);
  }
  function d() {
    return dmt().defined(r).curve(s).context(o);
  }
  return (
    (e = "function" == typeof e ? e : void 0 === e ? lmt : qft(+e)),
    (t = "function" == typeof t ? t : qft(void 0 === t ? 0 : +t)),
    (n = "function" == typeof n ? n : void 0 === n ? cmt : qft(+n)),
    (c.x = function (t) {
      return arguments.length ? ((e = "function" == typeof t ? t : qft(+t)), (i = null), c) : e;
    }),
    (c.x0 = function (t) {
      return arguments.length ? ((e = "function" == typeof t ? t : qft(+t)), c) : e;
    }),
    (c.x1 = function (e) {
      return arguments.length
        ? ((i = null == e ? null : "function" == typeof e ? e : qft(+e)), c)
        : i;
    }),
    (c.y = function (e) {
      return arguments.length ? ((t = "function" == typeof e ? e : qft(+e)), (n = null), c) : t;
    }),
    (c.y0 = function (e) {
      return arguments.length ? ((t = "function" == typeof e ? e : qft(+e)), c) : t;
    }),
    (c.y1 = function (e) {
      return arguments.length
        ? ((n = null == e ? null : "function" == typeof e ? e : qft(+e)), c)
        : n;
    }),
    (c.lineX0 = c.lineY0 =
      function () {
        return d().x(e).y(t);
      }),
    (c.lineY1 = function () {
      return d().x(e).y(n);
    }),
    (c.lineX1 = function () {
      return d().x(i).y(t);
    }),
    (c.defined = function (e) {
      return arguments.length ? ((r = "function" == typeof e ? e : qft(!!e)), c) : r;
    }),
    (c.curve = function (e) {
      return arguments.length ? ((s = e), null != o && (a = s(o)), c) : s;
    }),
    (c.context = function (e) {
      return arguments.length ? (null == e ? (o = a = null) : (a = s((o = e))), c) : o;
    }),
    c
  );
}
smt.prototype = {
  areaStart: function () {
    this._line = 0;
  },
  areaEnd: function () {
    this._line = NaN;
  },
  lineStart: function () {
    this._point = 0;
  },
  lineEnd: function () {
    ((this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(),
      (this._line = 1 - this._line));
  },
  point: function (e, t) {
    switch (((e = +e), (t = +t), this._point)) {
      case 0:
        ((this._point = 1), this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t));
        break;
      case 1:
        this._point = 2;
      default:
        this._context.lineTo(e, t);
    }
  },
};
class hmt {
  constructor(e, t) {
    ((this._context = e), (this._x = t));
  }
  areaStart() {
    this._line = 0;
  }
  areaEnd() {
    this._line = NaN;
  }
  lineStart() {
    this._point = 0;
  }
  lineEnd() {
    ((this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(),
      (this._line = 1 - this._line));
  }
  point(e, t) {
    switch (((e = +e), (t = +t), this._point)) {
      case 0:
        ((this._point = 1), this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t));
        break;
      case 1:
        this._point = 2;
      default:
        this._x
          ? this._context.bezierCurveTo(
              (this._x0 = (this._x0 + e) / 2),
              this._y0,
              this._x0,
              t,
              e,
              t,
            )
          : this._context.bezierCurveTo(
              this._x0,
              (this._y0 = (this._y0 + t) / 2),
              e,
              this._y0,
              e,
              t,
            );
    }
    ((this._x0 = e), (this._y0 = t));
  }
}
const gmt = {
    draw(e, t) {
      const n = Zft(t / Yft);
      (e.moveTo(n, 0), e.arc(0, 0, n, 0, Xft));
    },
  },
  pmt = {
    draw(e, t) {
      const n = Zft(t / 5) / 2;
      (e.moveTo(-3 * n, -n),
        e.lineTo(-n, -n),
        e.lineTo(-n, -3 * n),
        e.lineTo(n, -3 * n),
        e.lineTo(n, -n),
        e.lineTo(3 * n, -n),
        e.lineTo(3 * n, n),
        e.lineTo(n, n),
        e.lineTo(n, 3 * n),
        e.lineTo(-n, 3 * n),
        e.lineTo(-n, n),
        e.lineTo(-3 * n, n),
        e.closePath());
    },
  },
  fmt = Zft(1 / 3),
  mmt = 2 * fmt,
  _mt = {
    draw(e, t) {
      const n = Zft(t / mmt),
        i = n * fmt;
      (e.moveTo(0, -n), e.lineTo(i, 0), e.lineTo(0, n), e.lineTo(-i, 0), e.closePath());
    },
  },
  vmt = {
    draw(e, t) {
      const n = Zft(t),
        i = -n / 2;
      e.rect(i, i, n, n);
    },
  },
  bmt = Gft(Yft / 10) / Gft((7 * Yft) / 10),
  ymt = Gft(Xft / 10) * bmt,
  xmt = -Kft(Xft / 10) * bmt,
  wmt = {
    draw(e, t) {
      const n = Zft(0.8908130915292852 * t),
        i = ymt * n,
        r = xmt * n;
      (e.moveTo(0, -n), e.lineTo(i, r));
      for (let o = 1; o < 5; ++o) {
        const t = (Xft * o) / 5,
          s = Kft(t),
          a = Gft(t);
        (e.lineTo(a * n, -s * n), e.lineTo(s * i - a * r, a * i + s * r));
      }
      e.closePath();
    },
  },
  Cmt = Zft(3),
  Smt = {
    draw(e, t) {
      const n = -Zft(t / (3 * Cmt));
      (e.moveTo(0, 2 * n), e.lineTo(-Cmt * n, -n), e.lineTo(Cmt * n, -n), e.closePath());
    },
  },
  kmt = -0.5,
  Emt = Zft(3) / 2,
  Nmt = 1 / Zft(12),
  Lmt = 3 * (Nmt / 2 + 1),
  Dmt = {
    draw(e, t) {
      const n = Zft(t / Lmt),
        i = n / 2,
        r = n * Nmt,
        o = i,
        s = n * Nmt + n,
        a = -o,
        l = s;
      (e.moveTo(i, r),
        e.lineTo(o, s),
        e.lineTo(a, l),
        e.lineTo(kmt * i - Emt * r, Emt * i + kmt * r),
        e.lineTo(kmt * o - Emt * s, Emt * o + kmt * s),
        e.lineTo(kmt * a - Emt * l, Emt * a + kmt * l),
        e.lineTo(kmt * i + Emt * r, kmt * r - Emt * i),
        e.lineTo(kmt * o + Emt * s, kmt * s - Emt * o),
        e.lineTo(kmt * a + Emt * l, kmt * l - Emt * a),
        e.closePath());
    },
  };
function Tmt() {}
function Imt(e, t, n) {
  e._context.bezierCurveTo(
    (2 * e._x0 + e._x1) / 3,
    (2 * e._y0 + e._y1) / 3,
    (e._x0 + 2 * e._x1) / 3,
    (e._y0 + 2 * e._y1) / 3,
    (e._x0 + 4 * e._x1 + t) / 6,
    (e._y0 + 4 * e._y1 + n) / 6,
  );
}
function Rmt(e) {
  this._context = e;
}
function Omt(e) {
  this._context = e;
}
function Mmt(e) {
  this._context = e;
}
function Amt(e) {
  this._context = e;
}
function Pmt(e) {
  return e < 0 ? -1 : 1;
}
function jmt(e, t, n) {
  var i = e._x1 - e._x0,
    r = t - e._x1,
    o = (e._y1 - e._y0) / (i || (r < 0 && -0)),
    s = (n - e._y1) / (r || (i < 0 && -0)),
    a = (o * r + s * i) / (i + r);
  return (Pmt(o) + Pmt(s)) * Math.min(Math.abs(o), Math.abs(s), 0.5 * Math.abs(a)) || 0;
}
function Fmt(e, t) {
  var n = e._x1 - e._x0;
  return n ? ((3 * (e._y1 - e._y0)) / n - t) / 2 : t;
}
function Bmt(e, t, n) {
  var i = e._x0,
    r = e._y0,
    o = e._x1,
    s = e._y1,
    a = (o - i) / 3;
  e._context.bezierCurveTo(i + a, r + a * t, o - a, s - a * n, o, s);
}
function Vmt(e) {
  this._context = e;
}
function Wmt(e) {
  this._context = new Hmt(e);
}
function Hmt(e) {
  this._context = e;
}
function zmt(e) {
  this._context = e;
}
function Umt(e) {
  var t,
    n,
    i = e.length - 1,
    r = new Array(i),
    o = new Array(i),
    s = new Array(i);
  for (r[0] = 0, o[0] = 2, s[0] = e[0] + 2 * e[1], t = 1; t < i - 1; ++t)
    ((r[t] = 1), (o[t] = 4), (s[t] = 4 * e[t] + 2 * e[t + 1]));
  for (r[i - 1] = 2, o[i - 1] = 7, s[i - 1] = 8 * e[i - 1] + e[i], t = 1; t < i; ++t)
    ((n = r[t] / o[t - 1]), (o[t] -= n), (s[t] -= n * s[t - 1]));
  for (r[i - 1] = s[i - 1] / o[i - 1], t = i - 2; t >= 0; --t) r[t] = (s[t] - r[t + 1]) / o[t];
  for (o[i - 1] = (e[i] + r[i - 1]) / 2, t = 0; t < i - 1; ++t) o[t] = 2 * e[t + 1] - r[t + 1];
  return [r, o];
}
function $mt(e, t) {
  ((this._context = e), (this._t = t));
}
function qmt(e, t) {
  if ((r = e.length) > 1)
    for (var n, i, r, o = 1, s = e[t[0]], a = s.length; o < r; ++o)
      for (i = s, s = e[t[o]], n = 0; n < a; ++n)
        s[n][1] += s[n][0] = isNaN(i[n][1]) ? i[n][0] : i[n][1];
}
function Kmt(e) {
  for (var t = e.length, n = new Array(t); --t >= 0; ) n[t] = t;
  return n;
}
function Gmt(e, t) {
  return e[t];
}
function Zmt(e) {
  const t = [];
  return ((t.key = e), t);
}
function Ymt(e) {
  return (
    (Ymt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    Ymt(e)
  );
}
((Rmt.prototype = {
  areaStart: function () {
    this._line = 0;
  },
  areaEnd: function () {
    this._line = NaN;
  },
  lineStart: function () {
    ((this._x0 = this._x1 = this._y0 = this._y1 = NaN), (this._point = 0));
  },
  lineEnd: function () {
    switch (this._point) {
      case 3:
        Imt(this, this._x1, this._y1);
      case 2:
        this._context.lineTo(this._x1, this._y1);
    }
    ((this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(),
      (this._line = 1 - this._line));
  },
  point: function (e, t) {
    switch (((e = +e), (t = +t), this._point)) {
      case 0:
        ((this._point = 1), this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t));
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        ((this._point = 3),
          this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6));
      default:
        Imt(this, e, t);
    }
    ((this._x0 = this._x1), (this._x1 = e), (this._y0 = this._y1), (this._y1 = t));
  },
}),
  (Omt.prototype = {
    areaStart: Tmt,
    areaEnd: Tmt,
    lineStart: function () {
      ((this._x0 =
        this._x1 =
        this._x2 =
        this._x3 =
        this._x4 =
        this._y0 =
        this._y1 =
        this._y2 =
        this._y3 =
        this._y4 =
          NaN),
        (this._point = 0));
    },
    lineEnd: function () {
      switch (this._point) {
        case 1:
          (this._context.moveTo(this._x2, this._y2), this._context.closePath());
          break;
        case 2:
          (this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3),
            this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3),
            this._context.closePath());
          break;
        case 3:
          (this.point(this._x2, this._y2),
            this.point(this._x3, this._y3),
            this.point(this._x4, this._y4));
      }
    },
    point: function (e, t) {
      switch (((e = +e), (t = +t), this._point)) {
        case 0:
          ((this._point = 1), (this._x2 = e), (this._y2 = t));
          break;
        case 1:
          ((this._point = 2), (this._x3 = e), (this._y3 = t));
          break;
        case 2:
          ((this._point = 3),
            (this._x4 = e),
            (this._y4 = t),
            this._context.moveTo(
              (this._x0 + 4 * this._x1 + e) / 6,
              (this._y0 + 4 * this._y1 + t) / 6,
            ));
          break;
        default:
          Imt(this, e, t);
      }
      ((this._x0 = this._x1), (this._x1 = e), (this._y0 = this._y1), (this._y1 = t));
    },
  }),
  (Mmt.prototype = {
    areaStart: function () {
      this._line = 0;
    },
    areaEnd: function () {
      this._line = NaN;
    },
    lineStart: function () {
      ((this._x0 = this._x1 = this._y0 = this._y1 = NaN), (this._point = 0));
    },
    lineEnd: function () {
      ((this._line || (0 !== this._line && 3 === this._point)) && this._context.closePath(),
        (this._line = 1 - this._line));
    },
    point: function (e, t) {
      switch (((e = +e), (t = +t), this._point)) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          var n = (this._x0 + 4 * this._x1 + e) / 6,
            i = (this._y0 + 4 * this._y1 + t) / 6;
          this._line ? this._context.lineTo(n, i) : this._context.moveTo(n, i);
          break;
        case 3:
          this._point = 4;
        default:
          Imt(this, e, t);
      }
      ((this._x0 = this._x1), (this._x1 = e), (this._y0 = this._y1), (this._y1 = t));
    },
  }),
  (Amt.prototype = {
    areaStart: Tmt,
    areaEnd: Tmt,
    lineStart: function () {
      this._point = 0;
    },
    lineEnd: function () {
      this._point && this._context.closePath();
    },
    point: function (e, t) {
      ((e = +e),
        (t = +t),
        this._point ? this._context.lineTo(e, t) : ((this._point = 1), this._context.moveTo(e, t)));
    },
  }),
  (Vmt.prototype = {
    areaStart: function () {
      this._line = 0;
    },
    areaEnd: function () {
      this._line = NaN;
    },
    lineStart: function () {
      ((this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN), (this._point = 0));
    },
    lineEnd: function () {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x1, this._y1);
          break;
        case 3:
          Bmt(this, this._t0, Fmt(this, this._t0));
      }
      ((this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(),
        (this._line = 1 - this._line));
    },
    point: function (e, t) {
      var n = NaN;
      if (((t = +t), (e = +e) !== this._x1 || t !== this._y1)) {
        switch (this._point) {
          case 0:
            ((this._point = 1),
              this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t));
            break;
          case 1:
            this._point = 2;
            break;
          case 2:
            ((this._point = 3), Bmt(this, Fmt(this, (n = jmt(this, e, t))), n));
            break;
          default:
            Bmt(this, this._t0, (n = jmt(this, e, t)));
        }
        ((this._x0 = this._x1),
          (this._x1 = e),
          (this._y0 = this._y1),
          (this._y1 = t),
          (this._t0 = n));
      }
    },
  }),
  ((Wmt.prototype = Object.create(Vmt.prototype)).point = function (e, t) {
    Vmt.prototype.point.call(this, t, e);
  }),
  (Hmt.prototype = {
    moveTo: function (e, t) {
      this._context.moveTo(t, e);
    },
    closePath: function () {
      this._context.closePath();
    },
    lineTo: function (e, t) {
      this._context.lineTo(t, e);
    },
    bezierCurveTo: function (e, t, n, i, r, o) {
      this._context.bezierCurveTo(t, e, i, n, o, r);
    },
  }),
  (zmt.prototype = {
    areaStart: function () {
      this._line = 0;
    },
    areaEnd: function () {
      this._line = NaN;
    },
    lineStart: function () {
      ((this._x = []), (this._y = []));
    },
    lineEnd: function () {
      var e = this._x,
        t = this._y,
        n = e.length;
      if (n)
        if (
          (this._line ? this._context.lineTo(e[0], t[0]) : this._context.moveTo(e[0], t[0]),
          2 === n)
        )
          this._context.lineTo(e[1], t[1]);
        else
          for (var i = Umt(e), r = Umt(t), o = 0, s = 1; s < n; ++o, ++s)
            this._context.bezierCurveTo(i[0][o], r[0][o], i[1][o], r[1][o], e[s], t[s]);
      ((this._line || (0 !== this._line && 1 === n)) && this._context.closePath(),
        (this._line = 1 - this._line),
        (this._x = this._y = null));
    },
    point: function (e, t) {
      (this._x.push(+e), this._y.push(+t));
    },
  }),
  ($mt.prototype = {
    areaStart: function () {
      this._line = 0;
    },
    areaEnd: function () {
      this._line = NaN;
    },
    lineStart: function () {
      ((this._x = this._y = NaN), (this._point = 0));
    },
    lineEnd: function () {
      (0 < this._t && this._t < 1 && 2 === this._point && this._context.lineTo(this._x, this._y),
        (this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(),
        this._line >= 0 && ((this._t = 1 - this._t), (this._line = 1 - this._line)));
    },
    point: function (e, t) {
      switch (((e = +e), (t = +t), this._point)) {
        case 0:
          ((this._point = 1), this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t));
          break;
        case 1:
          this._point = 2;
        default:
          if (this._t <= 0) (this._context.lineTo(this._x, t), this._context.lineTo(e, t));
          else {
            var n = this._x * (1 - this._t) + e * this._t;
            (this._context.lineTo(n, this._y), this._context.lineTo(n, t));
          }
      }
      ((this._x = e), (this._y = t));
    },
  }));
var Xmt = ["type", "size", "sizeType"];
function Qmt() {
  return (
    (Qmt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    Qmt.apply(this, arguments)
  );
}
function Jmt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function e_t(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? Jmt(Object(n), !0).forEach(function (t) {
          t_t(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : Jmt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function t_t(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != Ymt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != Ymt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == Ymt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function n_t(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
var i_t = {
    symbolCircle: gmt,
    symbolCross: pmt,
    symbolDiamond: _mt,
    symbolSquare: vmt,
    symbolStar: wmt,
    symbolTriangle: Smt,
    symbolWye: Dmt,
  },
  r_t = Math.PI / 180,
  o_t = function (e) {
    var t,
      n,
      i = e.type,
      r = void 0 === i ? "circle" : i,
      o = e.size,
      s = void 0 === o ? 64 : o,
      a = e.sizeType,
      l = void 0 === a ? "area" : a,
      c = e_t(e_t({}, n_t(e, Xmt)), {}, { type: r, size: s, sizeType: l }),
      d = c.className,
      u = c.cx,
      h = c.cy,
      g = rft(c, !0);
    return u === +u && h === +h && s === +s
      ? z.createElement(
          "path",
          Qmt({}, g, {
            className: Mp("recharts-symbols", d),
            transform: "translate(".concat(u, ", ").concat(h, ")"),
            d:
              ((t = (function (e) {
                var t = "symbol".concat($ft(e));
                return i_t[t] || gmt;
              })(r)),
              (n = (function (e, t) {
                let n = null,
                  i = rmt(r);
                function r() {
                  let r;
                  if (
                    (n || (n = r = i()),
                    e.apply(this, arguments).draw(n, +t.apply(this, arguments)),
                    r)
                  )
                    return ((n = null), r + "" || null);
                }
                return (
                  (e = "function" == typeof e ? e : qft(e || gmt)),
                  (t = "function" == typeof t ? t : qft(void 0 === t ? 64 : +t)),
                  (r.type = function (t) {
                    return arguments.length ? ((e = "function" == typeof t ? t : qft(t)), r) : e;
                  }),
                  (r.size = function (e) {
                    return arguments.length ? ((t = "function" == typeof e ? e : qft(+e)), r) : t;
                  }),
                  (r.context = function (e) {
                    return arguments.length ? ((n = null == e ? null : e), r) : n;
                  }),
                  r
                );
              })()
                .type(t)
                .size(
                  (function (e, t, n) {
                    if ("area" === t) return e;
                    switch (n) {
                      case "cross":
                        return (5 * e * e) / 9;
                      case "diamond":
                        return (0.5 * e * e) / Math.sqrt(3);
                      case "square":
                        return e * e;
                      case "star":
                        var i = 18 * r_t;
                        return (
                          1.25 * e * e * (Math.tan(i) - Math.tan(2 * i) * Math.pow(Math.tan(i), 2))
                        );
                      case "triangle":
                        return (Math.sqrt(3) * e * e) / 4;
                      case "wye":
                        return ((21 - 10 * Math.sqrt(3)) * e * e) / 8;
                      default:
                        return (Math.PI * e * e) / 4;
                    }
                  })(s, l, r),
                )),
              n()),
          }),
        )
      : null;
  };
function s_t(e) {
  return (
    (s_t =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    s_t(e)
  );
}
function a_t() {
  return (
    (a_t = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    a_t.apply(this, arguments)
  );
}
function l_t(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function c_t(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, f_t(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function d_t(e, t, n) {
  return (
    (t = h_t(t)),
    (function (e, t) {
      if (t && ("object" === s_t(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, u_t() ? Reflect.construct(t, n || [], h_t(e).constructor) : t.apply(e, n))
  );
}
function u_t() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (u_t = function () {
    return !!e;
  })();
}
function h_t(e) {
  return (
    (h_t = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    h_t(e)
  );
}
function g_t(e, t) {
  return (
    (g_t = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    g_t(e, t)
  );
}
function p_t(e, t, n) {
  return (
    (t = f_t(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function f_t(e) {
  var t = (function (e, t) {
    if ("object" != s_t(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != s_t(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == s_t(t) ? t : t + "";
}
o_t.registerSymbol = function (e, t) {
  i_t["symbol".concat($ft(e))] = t;
};
var m_t = 32,
  __t = (function () {
    function e() {
      return (
        (function (e, t) {
          if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
        })(this, e),
        d_t(this, e, arguments)
      );
    }
    return (
      (function (e, t) {
        if ("function" != typeof t && null !== t)
          throw new TypeError("Super expression must either be null or a function");
        ((e.prototype = Object.create(t && t.prototype, {
          constructor: { value: e, writable: !0, configurable: !0 },
        })),
          Object.defineProperty(e, "prototype", { writable: !1 }),
          t && g_t(e, t));
      })(e, H.PureComponent),
      c_t(e, [
        {
          key: "renderIcon",
          value: function (e) {
            var t = this.props.inactiveColor,
              n = 16,
              i = m_t / 6,
              r = m_t / 3,
              o = e.inactive ? t : e.color;
            if ("plainline" === e.type)
              return z.createElement("line", {
                strokeWidth: 4,
                fill: "none",
                stroke: o,
                strokeDasharray: e.payload.strokeDasharray,
                x1: 0,
                y1: n,
                x2: m_t,
                y2: n,
                className: "recharts-legend-icon",
              });
            if ("line" === e.type)
              return z.createElement("path", {
                strokeWidth: 4,
                fill: "none",
                stroke: o,
                d: "M0,"
                  .concat(n, "h")
                  .concat(r, "\n            A")
                  .concat(i, ",")
                  .concat(i, ",0,1,1,")
                  .concat(2 * r, ",")
                  .concat(n, "\n            H")
                  .concat(m_t, "M")
                  .concat(2 * r, ",")
                  .concat(n, "\n            A")
                  .concat(i, ",")
                  .concat(i, ",0,1,1,")
                  .concat(r, ",")
                  .concat(n),
                className: "recharts-legend-icon",
              });
            if ("rect" === e.type)
              return z.createElement("path", {
                stroke: "none",
                fill: o,
                d: "M0,".concat(4, "h").concat(m_t, "v").concat(24, "h").concat(-32, "z"),
                className: "recharts-legend-icon",
              });
            if (z.isValidElement(e.legendIcon)) {
              var s = (function (e) {
                for (var t = 1; t < arguments.length; t++) {
                  var n = null != arguments[t] ? arguments[t] : {};
                  t % 2
                    ? l_t(Object(n), !0).forEach(function (t) {
                        p_t(e, t, n[t]);
                      })
                    : Object.getOwnPropertyDescriptors
                      ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
                      : l_t(Object(n)).forEach(function (t) {
                          Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
                        });
                }
                return e;
              })({}, e);
              return (delete s.legendIcon, z.cloneElement(e.legendIcon, s));
            }
            return z.createElement(o_t, {
              fill: o,
              cx: n,
              cy: n,
              size: m_t,
              sizeType: "diameter",
              type: e.type,
            });
          },
        },
        {
          key: "renderItems",
          value: function () {
            var e = this,
              t = this.props,
              n = t.payload,
              i = t.iconSize,
              r = t.layout,
              o = t.formatter,
              s = t.inactiveColor,
              a = { x: 0, y: 0, width: m_t, height: m_t },
              l = { display: "horizontal" === r ? "inline-block" : "block", marginRight: 10 },
              c = { display: "inline-block", verticalAlign: "middle", marginRight: 4 };
            return n.map(function (t, n) {
              var r = t.formatter || o,
                d = Mp(
                  p_t(
                    p_t({ "recharts-legend-item": !0 }, "legend-item-".concat(n), !0),
                    "inactive",
                    t.inactive,
                  ),
                );
              if ("none" === t.type) return null;
              var u = Yut(t.value) ? null : t.value;
              mft(
                !Yut(t.value),
                'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>',
              );
              var h = t.inactive ? s : t.color;
              return z.createElement(
                "li",
                a_t({ className: d, style: l, key: "legend-item-".concat(n) }, zpt(e.props, t, n)),
                z.createElement(
                  uft,
                  { width: i, height: i, viewBox: a, style: c },
                  e.renderIcon(t),
                ),
                z.createElement(
                  "span",
                  { className: "recharts-legend-item-text", style: { color: h } },
                  r ? r(u, t, n) : u,
                ),
              );
            });
          },
        },
        {
          key: "render",
          value: function () {
            var e = this.props,
              t = e.payload,
              n = e.layout,
              i = e.align;
            if (!t || !t.length) return null;
            var r = { padding: 0, margin: 0, textAlign: "horizontal" === n ? i : "left" };
            return z.createElement(
              "ul",
              { className: "recharts-default-legend", style: r },
              this.renderItems(),
            );
          },
        },
      ])
    );
  })();
(p_t(__t, "displayName", "Legend"),
  p_t(__t, "defaultProps", {
    iconSize: 14,
    layout: "horizontal",
    align: "center",
    verticalAlign: "middle",
    inactiveColor: "#ccc",
  }));
var v_t = Qht;
var b_t = Qht,
  y_t = Jht,
  x_t = mgt;
var w_t = Qht,
  C_t = function () {
    ((this.__data__ = new v_t()), (this.size = 0));
  },
  S_t = function (e) {
    var t = this.__data__,
      n = t.delete(e);
    return ((this.size = t.size), n);
  },
  k_t = function (e) {
    return this.__data__.get(e);
  },
  E_t = function (e) {
    return this.__data__.has(e);
  },
  N_t = function (e, t) {
    var n = this.__data__;
    if (n instanceof b_t) {
      var i = n.__data__;
      if (!y_t || i.length < 199) return (i.push([e, t]), (this.size = ++n.size), this);
      n = this.__data__ = new x_t(i);
    }
    return (n.set(e, t), (this.size = n.size), this);
  };
function L_t(e) {
  var t = (this.__data__ = new w_t(e));
  this.size = t.size;
}
((L_t.prototype.clear = C_t),
  (L_t.prototype.delete = S_t),
  (L_t.prototype.get = k_t),
  (L_t.prototype.has = E_t),
  (L_t.prototype.set = N_t));
var D_t = L_t;
var T_t = mgt,
  I_t = function (e) {
    return (this.__data__.set(e, "__lodash_hash_undefined__"), this);
  },
  R_t = function (e) {
    return this.__data__.has(e);
  };
function O_t(e) {
  var t = -1,
    n = null == e ? 0 : e.length;
  for (this.__data__ = new T_t(); ++t < n; ) this.add(e[t]);
}
((O_t.prototype.add = O_t.prototype.push = I_t), (O_t.prototype.has = R_t));
var M_t = O_t;
var A_t = function (e, t) {
  for (var n = -1, i = null == e ? 0 : e.length; ++n < i; ) if (t(e[n], n, e)) return !0;
  return !1;
};
var P_t = function (e, t) {
    return e.has(t);
  },
  j_t = M_t,
  F_t = A_t,
  B_t = P_t;
var V_t = function (e, t, n, i, r, o) {
  var s = 1 & n,
    a = e.length,
    l = t.length;
  if (a != l && !(s && l > a)) return !1;
  var c = o.get(e),
    d = o.get(t);
  if (c && d) return c == t && d == e;
  var u = -1,
    h = !0,
    g = 2 & n ? new j_t() : void 0;
  for (o.set(e, t), o.set(t, e); ++u < a; ) {
    var p = e[u],
      f = t[u];
    if (i) var m = s ? i(f, p, u, t, e, o) : i(p, f, u, e, t, o);
    if (void 0 !== m) {
      if (m) continue;
      h = !1;
      break;
    }
    if (g) {
      if (
        !F_t(t, function (e, t) {
          if (!B_t(g, t) && (p === e || r(p, e, n, i, o))) return g.push(t);
        })
      ) {
        h = !1;
        break;
      }
    } else if (p !== f && !r(p, f, n, i, o)) {
      h = !1;
      break;
    }
  }
  return (o.delete(e), o.delete(t), h);
};
var W_t = function (e) {
  var t = -1,
    n = Array(e.size);
  return (
    e.forEach(function (e, i) {
      n[++t] = [i, e];
    }),
    n
  );
};
var H_t = function (e) {
    var t = -1,
      n = Array(e.size);
    return (
      e.forEach(function (e) {
        n[++t] = e;
      }),
      n
    );
  },
  z_t = Cut.Uint8Array,
  U_t = Aht,
  $_t = V_t,
  q_t = W_t,
  K_t = H_t,
  G_t = Sut ? Sut.prototype : void 0,
  Z_t = G_t ? G_t.valueOf : void 0;
var Y_t = function (e, t, n, i, r, o, s) {
  switch (n) {
    case "[object DataView]":
      if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
      ((e = e.buffer), (t = t.buffer));
    case "[object ArrayBuffer]":
      return !(e.byteLength != t.byteLength || !o(new z_t(e), new z_t(t)));
    case "[object Boolean]":
    case "[object Date]":
    case "[object Number]":
      return U_t(+e, +t);
    case "[object Error]":
      return e.name == t.name && e.message == t.message;
    case "[object RegExp]":
    case "[object String]":
      return e == t + "";
    case "[object Map]":
      var a = q_t;
    case "[object Set]":
      var l = 1 & i;
      if ((a || (a = K_t), e.size != t.size && !l)) return !1;
      var c = s.get(e);
      if (c) return c == t;
      ((i |= 2), s.set(e, t));
      var d = $_t(a(e), a(t), i, r, o, s);
      return (s.delete(e), d);
    case "[object Symbol]":
      if (Z_t) return Z_t.call(e) == Z_t.call(t);
  }
  return !1;
};
var X_t = function (e, t) {
    for (var n = -1, i = t.length, r = e.length; ++n < i; ) e[r + n] = t[n];
    return e;
  },
  Q_t = X_t,
  J_t = but;
var evt = function (e, t, n) {
  var i = t(e);
  return J_t(e) ? i : Q_t(i, n(e));
};
var tvt = function (e, t) {
  for (var n = -1, i = null == e ? 0 : e.length, r = 0, o = []; ++n < i; ) {
    var s = e[n];
    t(s, n, e) && (o[r++] = s);
  }
  return o;
};
var nvt = tvt,
  ivt = function () {
    return [];
  },
  rvt = Object.prototype.propertyIsEnumerable,
  ovt = Object.getOwnPropertySymbols,
  svt = ovt
    ? function (e) {
        return null == e
          ? []
          : ((e = Object(e)),
            nvt(ovt(e), function (t) {
              return rvt.call(e, t);
            }));
      }
    : ivt,
  avt = svt;
var lvt = function (e, t) {
    for (var n = -1, i = Array(e); ++n < e; ) i[n] = t(n);
    return i;
  },
  cvt = Aut,
  dvt = Put;
var uvt = function (e) {
    return dvt(e) && "[object Arguments]" == cvt(e);
  },
  hvt = Put,
  gvt = Object.prototype,
  pvt = gvt.hasOwnProperty,
  fvt = gvt.propertyIsEnumerable,
  mvt = uvt(
    (function () {
      return arguments;
    })(),
  )
    ? uvt
    : function (e) {
        return hvt(e) && pvt.call(e, "callee") && !fvt.call(e, "callee");
      },
  _vt = { exports: {} };
var vvt = function () {
  return !1;
};
!(function (e, t) {
  var n = Cut,
    i = vvt,
    r = t && !t.nodeType && t,
    o = r && e && !e.nodeType && e,
    s = o && o.exports === r ? n.Buffer : void 0,
    a = (s ? s.isBuffer : void 0) || i;
  e.exports = a;
})(_vt, _vt.exports);
var bvt = _vt.exports,
  yvt = /^(?:0|[1-9]\d*)$/;
var xvt = function (e, t) {
  var n = typeof e;
  return (
    !!(t = null == t ? 9007199254740991 : t) &&
    ("number" == n || ("symbol" != n && yvt.test(e))) &&
    e > -1 &&
    e % 1 == 0 &&
    e < t
  );
};
var wvt = function (e) {
    return "number" == typeof e && e > -1 && e % 1 == 0 && e <= 9007199254740991;
  },
  Cvt = Aut,
  Svt = wvt,
  kvt = Put,
  Evt = {};
((Evt["[object Float32Array]"] =
  Evt["[object Float64Array]"] =
  Evt["[object Int8Array]"] =
  Evt["[object Int16Array]"] =
  Evt["[object Int32Array]"] =
  Evt["[object Uint8Array]"] =
  Evt["[object Uint8ClampedArray]"] =
  Evt["[object Uint16Array]"] =
  Evt["[object Uint32Array]"] =
    !0),
  (Evt["[object Arguments]"] =
    Evt["[object Array]"] =
    Evt["[object ArrayBuffer]"] =
    Evt["[object Boolean]"] =
    Evt["[object DataView]"] =
    Evt["[object Date]"] =
    Evt["[object Error]"] =
    Evt["[object Function]"] =
    Evt["[object Map]"] =
    Evt["[object Number]"] =
    Evt["[object Object]"] =
    Evt["[object RegExp]"] =
    Evt["[object Set]"] =
    Evt["[object String]"] =
    Evt["[object WeakMap]"] =
      !1));
var Nvt = function (e) {
  return kvt(e) && Svt(e.length) && !!Evt[Cvt(e)];
};
var Lvt = function (e) {
    return function (t) {
      return e(t);
    };
  },
  Dvt = { exports: {} };
!(function (e, t) {
  var n = yut,
    i = t && !t.nodeType && t,
    r = i && e && !e.nodeType && e,
    o = r && r.exports === i && n.process,
    s = (function () {
      try {
        var e = r && r.require && r.require("util").types;
        return e || (o && o.binding && o.binding("util"));
      } catch (spt) {}
    })();
  e.exports = s;
})(Dvt, Dvt.exports);
var Tvt = Dvt.exports,
  Ivt = Nvt,
  Rvt = Lvt,
  Ovt = Tvt && Tvt.isTypedArray,
  Mvt = Ovt ? Rvt(Ovt) : Ivt,
  Avt = lvt,
  Pvt = mvt,
  jvt = but,
  Fvt = bvt,
  Bvt = xvt,
  Vvt = Mvt,
  Wvt = Object.prototype.hasOwnProperty;
var Hvt = function (e, t) {
    var n = jvt(e),
      i = !n && Pvt(e),
      r = !n && !i && Fvt(e),
      o = !n && !i && !r && Vvt(e),
      s = n || i || r || o,
      a = s ? Avt(e.length, String) : [],
      l = a.length;
    for (var c in e)
      (!t && !Wvt.call(e, c)) ||
        (s &&
          ("length" == c ||
            (r && ("offset" == c || "parent" == c)) ||
            (o && ("buffer" == c || "byteLength" == c || "byteOffset" == c)) ||
            Bvt(c, l))) ||
        a.push(c);
    return a;
  },
  zvt = Object.prototype;
var Uvt = function (e) {
  var t = e && e.constructor;
  return e === (("function" == typeof t && t.prototype) || zvt);
};
var $vt = function (e, t) {
    return function (n) {
      return e(t(n));
    };
  },
  qvt = $vt(Object.keys, Object),
  Kvt = Uvt,
  Gvt = qvt,
  Zvt = Object.prototype.hasOwnProperty;
var Yvt = function (e) {
    if (!Kvt(e)) return Gvt(e);
    var t = [];
    for (var n in Object(e)) Zvt.call(e, n) && "constructor" != n && t.push(n);
    return t;
  },
  Xvt = Zut,
  Qvt = wvt;
var Jvt = function (e) {
    return null != e && Qvt(e.length) && !Xvt(e);
  },
  ebt = Hvt,
  tbt = Yvt,
  nbt = Jvt;
var ibt = function (e) {
    return nbt(e) ? ebt(e) : tbt(e);
  },
  rbt = evt,
  obt = avt,
  sbt = ibt;
var abt = function (e) {
    return rbt(e, sbt, obt);
  },
  lbt = abt,
  cbt = Object.prototype.hasOwnProperty;
var dbt = function (e, t, n, i, r, o) {
    var s = 1 & n,
      a = lbt(e),
      l = a.length;
    if (l != lbt(t).length && !s) return !1;
    for (var c = l; c--; ) {
      var d = a[c];
      if (!(s ? d in t : cbt.call(t, d))) return !1;
    }
    var u = o.get(e),
      h = o.get(t);
    if (u && h) return u == t && h == e;
    var g = !0;
    (o.set(e, t), o.set(t, e));
    for (var p = s; ++c < l; ) {
      var f = e[(d = a[c])],
        m = t[d];
      if (i) var _ = s ? i(m, f, d, t, e, o) : i(f, m, d, e, t, o);
      if (!(void 0 === _ ? f === m || r(f, m, n, i, o) : _)) {
        g = !1;
        break;
      }
      p || (p = "constructor" == d);
    }
    if (g && !p) {
      var v = e.constructor,
        b = t.constructor;
      v == b ||
        !("constructor" in e) ||
        !("constructor" in t) ||
        ("function" == typeof v && v instanceof v && "function" == typeof b && b instanceof b) ||
        (g = !1);
    }
    return (o.delete(e), o.delete(t), g);
  },
  ubt = mht(Cut, "DataView"),
  hbt = mht(Cut, "Promise"),
  gbt = mht(Cut, "Set"),
  pbt = ubt,
  fbt = Jht,
  mbt = hbt,
  _bt = gbt,
  vbt = mht(Cut, "WeakMap"),
  bbt = Aut,
  ybt = nht,
  xbt = "[object Map]",
  wbt = "[object Promise]",
  Cbt = "[object Set]",
  Sbt = "[object WeakMap]",
  kbt = "[object DataView]",
  Ebt = ybt(pbt),
  Nbt = ybt(fbt),
  Lbt = ybt(mbt),
  Dbt = ybt(_bt),
  Tbt = ybt(vbt),
  Ibt = bbt;
((pbt && Ibt(new pbt(new ArrayBuffer(1))) != kbt) ||
  (fbt && Ibt(new fbt()) != xbt) ||
  (mbt && Ibt(mbt.resolve()) != wbt) ||
  (_bt && Ibt(new _bt()) != Cbt) ||
  (vbt && Ibt(new vbt()) != Sbt)) &&
  (Ibt = function (e) {
    var t = bbt(e),
      n = "[object Object]" == t ? e.constructor : void 0,
      i = n ? ybt(n) : "";
    if (i)
      switch (i) {
        case Ebt:
          return kbt;
        case Nbt:
          return xbt;
        case Lbt:
          return wbt;
        case Dbt:
          return Cbt;
        case Tbt:
          return Sbt;
      }
    return t;
  });
var Rbt = D_t,
  Obt = V_t,
  Mbt = Y_t,
  Abt = dbt,
  Pbt = Ibt,
  jbt = but,
  Fbt = bvt,
  Bbt = Mvt,
  Vbt = "[object Arguments]",
  Wbt = "[object Array]",
  Hbt = "[object Object]",
  zbt = Object.prototype.hasOwnProperty;
var Ubt = function (e, t, n, i, r, o) {
    var s = jbt(e),
      a = jbt(t),
      l = s ? Wbt : Pbt(e),
      c = a ? Wbt : Pbt(t),
      d = (l = l == Vbt ? Hbt : l) == Hbt,
      u = (c = c == Vbt ? Hbt : c) == Hbt,
      h = l == c;
    if (h && Fbt(e)) {
      if (!Fbt(t)) return !1;
      ((s = !0), (d = !1));
    }
    if (h && !d)
      return (o || (o = new Rbt()), s || Bbt(e) ? Obt(e, t, n, i, r, o) : Mbt(e, t, l, n, i, r, o));
    if (!(1 & n)) {
      var g = d && zbt.call(e, "__wrapped__"),
        p = u && zbt.call(t, "__wrapped__");
      if (g || p) {
        var f = g ? e.value() : e,
          m = p ? t.value() : t;
        return (o || (o = new Rbt()), r(f, m, n, i, o));
      }
    }
    return !!h && (o || (o = new Rbt()), Abt(e, t, n, i, r, o));
  },
  $bt = Ubt,
  qbt = Put;
var Kbt = function e(t, n, i, r, o) {
    return (
      t === n ||
      (null == t || null == n || (!qbt(t) && !qbt(n)) ? t != t && n != n : $bt(t, n, i, r, e, o))
    );
  },
  Gbt = D_t,
  Zbt = Kbt;
var Ybt = function (e, t, n, i) {
    var r = n.length,
      o = r,
      s = !i;
    if (null == e) return !o;
    for (e = Object(e); r--; ) {
      var a = n[r];
      if (s && a[2] ? a[1] !== e[a[0]] : !(a[0] in e)) return !1;
    }
    for (; ++r < o; ) {
      var l = (a = n[r])[0],
        c = e[l],
        d = a[1];
      if (s && a[2]) {
        if (void 0 === c && !(l in e)) return !1;
      } else {
        var u = new Gbt();
        if (i) var h = i(c, d, l, e, t, u);
        if (!(void 0 === h ? Zbt(d, c, 3, i, u) : h)) return !1;
      }
    }
    return !0;
  },
  Xbt = $ut;
var Qbt = function (e) {
    return e == e && !Xbt(e);
  },
  Jbt = Qbt,
  eyt = ibt;
var tyt = function (e) {
  for (var t = eyt(e), n = t.length; n--; ) {
    var i = t[n],
      r = e[i];
    t[n] = [i, r, Jbt(r)];
  }
  return t;
};
var nyt = function (e, t) {
    return function (n) {
      return null != n && n[e] === t && (void 0 !== t || e in Object(n));
    };
  },
  iyt = Ybt,
  ryt = tyt,
  oyt = nyt;
var syt = function (e) {
  var t = ryt(e);
  return 1 == t.length && t[0][2]
    ? oyt(t[0][0], t[0][1])
    : function (n) {
        return n === e || iyt(n, e, t);
      };
};
var ayt = function (e, t) {
    return null != e && t in Object(e);
  },
  lyt = Vgt,
  cyt = mvt,
  dyt = but,
  uyt = xvt,
  hyt = wvt,
  gyt = Hgt;
var pyt = function (e, t, n) {
    for (var i = -1, r = (t = lyt(t, e)).length, o = !1; ++i < r; ) {
      var s = gyt(t[i]);
      if (!(o = null != e && n(e, s))) break;
      e = e[s];
    }
    return o || ++i != r
      ? o
      : !!(r = null == e ? 0 : e.length) && hyt(r) && uyt(s, r) && (dyt(e) || cyt(e));
  },
  fyt = ayt,
  myt = pyt;
var _yt = function (e, t) {
    return null != e && myt(e, t, fyt);
  },
  vyt = Kbt,
  byt = Kgt,
  yyt = _yt,
  xyt = Uut,
  wyt = Qbt,
  Cyt = nyt,
  Syt = Hgt;
var kyt = function (e, t) {
  return xyt(e) && wyt(t)
    ? Cyt(Syt(e), t)
    : function (n) {
        var i = byt(n, e);
        return void 0 === i && i === t ? yyt(n, e) : vyt(t, i, 3);
      };
};
var Eyt = function (e) {
  return e;
};
var Nyt = function (e) {
    return function (t) {
      return null == t ? void 0 : t[e];
    };
  },
  Lyt = $gt;
var Dyt = function (e) {
    return function (t) {
      return Lyt(t, e);
    };
  },
  Tyt = Nyt,
  Iyt = Dyt,
  Ryt = Uut,
  Oyt = Hgt;
var Myt = function (e) {
    return Ryt(e) ? Tyt(Oyt(e)) : Iyt(e);
  },
  Ayt = syt,
  Pyt = kyt,
  jyt = Eyt,
  Fyt = but,
  Byt = Myt;
var Vyt = function (e) {
  return "function" == typeof e
    ? e
    : null == e
      ? jyt
      : "object" == typeof e
        ? Fyt(e)
          ? Pyt(e[0], e[1])
          : Ayt(e)
        : Byt(e);
};
var Wyt = function (e, t, n, i) {
  for (var r = e.length, o = n + (i ? 1 : -1); i ? o-- : ++o < r; ) if (t(e[o], o, e)) return o;
  return -1;
};
var Hyt = function (e, t, n) {
    for (var i = n - 1, r = e.length; ++i < r; ) if (e[i] === t) return i;
    return -1;
  },
  zyt = Wyt,
  Uyt = function (e) {
    return e != e;
  },
  $yt = Hyt;
var qyt = function (e, t, n) {
    return t == t ? $yt(e, t, n) : zyt(e, Uyt, n);
  },
  Kyt = qyt;
var Gyt = function (e, t) {
  return !!(null == e ? 0 : e.length) && Kyt(e, t, 0) > -1;
};
var Zyt = function (e, t, n) {
  for (var i = -1, r = null == e ? 0 : e.length; ++i < r; ) if (n(t, e[i])) return !0;
  return !1;
};
var Yyt = gbt,
  Xyt = function () {},
  Qyt =
    Yyt && 1 / H_t(new Yyt([, -0]))[1] == 1 / 0
      ? function (e) {
          return new Yyt(e);
        }
      : Xyt,
  Jyt = M_t,
  ext = Gyt,
  txt = Zyt,
  nxt = P_t,
  ixt = Qyt,
  rxt = H_t;
var oxt = function (e, t, n) {
    var i = -1,
      r = ext,
      o = e.length,
      s = !0,
      a = [],
      l = a;
    if (n) ((s = !1), (r = txt));
    else if (o >= 200) {
      var c = t ? null : ixt(e);
      if (c) return rxt(c);
      ((s = !1), (r = nxt), (l = new Jyt()));
    } else l = t ? [] : a;
    e: for (; ++i < o; ) {
      var d = e[i],
        u = t ? t(d) : d;
      if (((d = n || 0 !== d ? d : 0), s && u == u)) {
        for (var h = l.length; h--; ) if (l[h] === u) continue e;
        (t && l.push(u), a.push(d));
      } else r(l, u, n) || (l !== a && l.push(u), a.push(d));
    }
    return a;
  },
  sxt = Vyt,
  axt = oxt;
var lxt = function (e, t) {
  return e && e.length ? axt(e, sxt(t)) : [];
};
const cxt = n(lxt);
function dxt(e, t, n) {
  return !0 === t ? cxt(e, n) : Yut(t) ? cxt(e, t) : e;
}
function uxt(e) {
  return (
    (uxt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    uxt(e)
  );
}
var hxt = ["ref"];
function gxt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function pxt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? gxt(Object(n), !0).forEach(function (t) {
          yxt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : gxt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function fxt(e, t) {
  for (var n = 0; n < t.length; n++) {
    var i = t[n];
    ((i.enumerable = i.enumerable || !1),
      (i.configurable = !0),
      "value" in i && (i.writable = !0),
      Object.defineProperty(e, xxt(i.key), i));
  }
}
function mxt(e, t, n) {
  return (
    (t = vxt(t)),
    (function (e, t) {
      if (t && ("object" === uxt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, _xt() ? Reflect.construct(t, n || [], vxt(e).constructor) : t.apply(e, n))
  );
}
function _xt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (_xt = function () {
    return !!e;
  })();
}
function vxt(e) {
  return (
    (vxt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    vxt(e)
  );
}
function bxt(e, t) {
  return (
    (bxt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    bxt(e, t)
  );
}
function yxt(e, t, n) {
  return (
    (t = xxt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function xxt(e) {
  var t = (function (e, t) {
    if ("object" != uxt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != uxt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == uxt(t) ? t : t + "";
}
function wxt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function Cxt(e) {
  return e.value;
}
var Sxt = (function () {
  function e() {
    var t;
    !(function (e, t) {
      if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
    })(this, e);
    for (var n = arguments.length, i = new Array(n), r = 0; r < n; r++) i[r] = arguments[r];
    return (yxt((t = mxt(this, e, [].concat(i))), "lastBoundingBox", { width: -1, height: -1 }), t);
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && bxt(e, t));
    })(e, H.PureComponent),
    (t = e),
    (n = [
      {
        key: "componentDidMount",
        value: function () {
          this.updateBBox();
        },
      },
      {
        key: "componentDidUpdate",
        value: function () {
          this.updateBBox();
        },
      },
      {
        key: "getBBox",
        value: function () {
          if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
            var e = this.wrapperNode.getBoundingClientRect();
            return (
              (e.height = this.wrapperNode.offsetHeight),
              (e.width = this.wrapperNode.offsetWidth),
              e
            );
          }
          return null;
        },
      },
      {
        key: "updateBBox",
        value: function () {
          var e = this.props.onBBoxUpdate,
            t = this.getBBox();
          t
            ? (Math.abs(t.width - this.lastBoundingBox.width) > 1 ||
                Math.abs(t.height - this.lastBoundingBox.height) > 1) &&
              ((this.lastBoundingBox.width = t.width),
              (this.lastBoundingBox.height = t.height),
              e && e(t))
            : (-1 === this.lastBoundingBox.width && -1 === this.lastBoundingBox.height) ||
              ((this.lastBoundingBox.width = -1), (this.lastBoundingBox.height = -1), e && e(null));
        },
      },
      {
        key: "getBBoxSnapshot",
        value: function () {
          return this.lastBoundingBox.width >= 0 && this.lastBoundingBox.height >= 0
            ? pxt({}, this.lastBoundingBox)
            : { width: 0, height: 0 };
        },
      },
      {
        key: "getDefaultPosition",
        value: function (e) {
          var t,
            n,
            i = this.props,
            r = i.layout,
            o = i.align,
            s = i.verticalAlign,
            a = i.margin,
            l = i.chartWidth,
            c = i.chartHeight;
          return (
            (e &&
              ((void 0 !== e.left && null !== e.left) ||
                (void 0 !== e.right && null !== e.right))) ||
              (t =
                "center" === o && "vertical" === r
                  ? { left: ((l || 0) - this.getBBoxSnapshot().width) / 2 }
                  : "right" === o
                    ? { right: (a && a.right) || 0 }
                    : { left: (a && a.left) || 0 }),
            (e &&
              ((void 0 !== e.top && null !== e.top) ||
                (void 0 !== e.bottom && null !== e.bottom))) ||
              (n =
                "middle" === s
                  ? { top: ((c || 0) - this.getBBoxSnapshot().height) / 2 }
                  : "bottom" === s
                    ? { bottom: (a && a.bottom) || 0 }
                    : { top: (a && a.top) || 0 }),
            pxt(pxt({}, t), n)
          );
        },
      },
      {
        key: "render",
        value: function () {
          var e = this,
            t = this.props,
            n = t.content,
            i = t.width,
            r = t.height,
            o = t.wrapperStyle,
            s = t.payloadUniqBy,
            a = t.payload,
            l = pxt(
              pxt(
                { position: "absolute", width: i || "auto", height: r || "auto" },
                this.getDefaultPosition(o),
              ),
              o,
            );
          return z.createElement(
            "div",
            {
              className: "recharts-legend-wrapper",
              style: l,
              ref: function (t) {
                e.wrapperNode = t;
              },
            },
            (function (e, t) {
              if (z.isValidElement(e)) return z.cloneElement(e, t);
              if ("function" == typeof e) return z.createElement(e, t);
              t.ref;
              var n = wxt(t, hxt);
              return z.createElement(__t, n);
            })(n, pxt(pxt({}, this.props), {}, { payload: dxt(a, s, Cxt) })),
          );
        },
      },
    ]),
    (i = [
      {
        key: "getWithHeight",
        value: function (e, t) {
          var n = pxt(pxt({}, this.defaultProps), e.props).layout;
          return "vertical" === n && Npt(e.props.height)
            ? { height: e.props.height }
            : "horizontal" === n
              ? { width: e.props.width || t }
              : null;
        },
      },
    ]),
    n && fxt(t.prototype, n),
    i && fxt(t, i),
    Object.defineProperty(t, "prototype", { writable: !1 }),
    t
  );
  var t, n, i;
})();
(yxt(Sxt, "displayName", "Legend"),
  yxt(Sxt, "defaultProps", {
    iconSize: 14,
    layout: "horizontal",
    align: "center",
    verticalAlign: "bottom",
  }));
var kxt = mvt,
  Ext = but,
  Nxt = Sut ? Sut.isConcatSpreadable : void 0;
var Lxt = X_t,
  Dxt = function (e) {
    return Ext(e) || kxt(e) || !!(Nxt && e && e[Nxt]);
  };
var Txt = function e(t, n, i, r, o) {
  var s = -1,
    a = t.length;
  for (i || (i = Dxt), o || (o = []); ++s < a; ) {
    var l = t[s];
    n > 0 && i(l) ? (n > 1 ? e(l, n - 1, i, r, o) : Lxt(o, l)) : r || (o[o.length] = l);
  }
  return o;
};
var Ixt = function (e) {
    return function (t, n, i) {
      for (var r = -1, o = Object(t), s = i(t), a = s.length; a--; ) {
        var l = s[e ? a : ++r];
        if (!1 === n(o[l], l, o)) break;
      }
      return t;
    };
  },
  Rxt = Ixt(),
  Oxt = ibt;
var Mxt = function (e, t) {
    return e && Rxt(e, t, Oxt);
  },
  Axt = Jvt;
var Pxt = function (e, t) {
    return function (n, i) {
      if (null == n) return n;
      if (!Axt(n)) return e(n, i);
      for (
        var r = n.length, o = t ? r : -1, s = Object(n);
        (t ? o-- : ++o < r) && !1 !== i(s[o], o, s);
      );
      return n;
    };
  },
  jxt = Pxt(Mxt),
  Fxt = jxt,
  Bxt = Jvt;
var Vxt = function (e, t) {
  var n = -1,
    i = Bxt(e) ? Array(e.length) : [];
  return (
    Fxt(e, function (e, r, o) {
      i[++n] = t(e, r, o);
    }),
    i
  );
};
var Wxt = function (e, t) {
    var n = e.length;
    for (e.sort(t); n--; ) e[n] = e[n].value;
    return e;
  },
  Hxt = But;
var zxt = function (e, t) {
  if (e !== t) {
    var n = void 0 !== e,
      i = null === e,
      r = e == e,
      o = Hxt(e),
      s = void 0 !== t,
      a = null === t,
      l = t == t,
      c = Hxt(t);
    if ((!a && !c && !o && e > t) || (o && s && l && !a && !c) || (i && s && l) || (!n && l) || !r)
      return 1;
    if ((!i && !o && !c && e < t) || (c && n && r && !i && !o) || (a && n && r) || (!s && r) || !l)
      return -1;
  }
  return 0;
};
var Uxt = function (e, t, n) {
    for (var i = -1, r = e.criteria, o = t.criteria, s = r.length, a = n.length; ++i < s; ) {
      var l = zxt(r[i], o[i]);
      if (l) return i >= a ? l : l * ("desc" == n[i] ? -1 : 1);
    }
    return e.index - t.index;
  },
  $xt = Ngt,
  qxt = $gt,
  Kxt = Vyt,
  Gxt = Vxt,
  Zxt = Wxt,
  Yxt = Lvt,
  Xxt = Uxt,
  Qxt = Eyt,
  Jxt = but;
var ewt = function (e, t, n) {
  t = t.length
    ? $xt(t, function (e) {
        return Jxt(e)
          ? function (t) {
              return qxt(t, 1 === e.length ? e[0] : e);
            }
          : e;
      })
    : [Qxt];
  var i = -1;
  t = $xt(t, Yxt(Kxt));
  var r = Gxt(e, function (e, n, r) {
    return {
      criteria: $xt(t, function (t) {
        return t(e);
      }),
      index: ++i,
      value: e,
    };
  });
  return Zxt(r, function (e, t) {
    return Xxt(e, t, n);
  });
};
var twt = function (e, t, n) {
    switch (n.length) {
      case 0:
        return e.call(t);
      case 1:
        return e.call(t, n[0]);
      case 2:
        return e.call(t, n[0], n[1]);
      case 3:
        return e.call(t, n[0], n[1], n[2]);
    }
    return e.apply(t, n);
  },
  nwt = Math.max;
var iwt = function (e, t, n) {
  return (
    (t = nwt(void 0 === t ? e.length - 1 : t, 0)),
    function () {
      for (var i = arguments, r = -1, o = nwt(i.length - t, 0), s = Array(o); ++r < o; )
        s[r] = i[t + r];
      r = -1;
      for (var a = Array(t + 1); ++r < t; ) a[r] = i[r];
      return ((a[t] = n(s)), twt(e, this, a));
    }
  );
};
var rwt = function (e) {
    return function () {
      return e;
    };
  },
  owt = mht,
  swt = (function () {
    try {
      var e = owt(Object, "defineProperty");
      return (e({}, "", {}), e);
    } catch (spt) {}
  })(),
  awt = rwt,
  lwt = swt,
  cwt = lwt
    ? function (e, t) {
        return lwt(e, "toString", {
          configurable: !0,
          enumerable: !1,
          value: awt(t),
          writable: !0,
        });
      }
    : Eyt,
  dwt = cwt,
  uwt = Date.now;
var hwt = function (e) {
    var t = 0,
      n = 0;
    return function () {
      var i = uwt(),
        r = 16 - (i - n);
      if (((n = i), r > 0)) {
        if (++t >= 800) return arguments[0];
      } else t = 0;
      return e.apply(void 0, arguments);
    };
  },
  gwt = hwt(dwt),
  pwt = Eyt,
  fwt = iwt,
  mwt = gwt;
var _wt = Aht,
  vwt = Jvt,
  bwt = xvt,
  ywt = $ut;
var xwt = function (e, t, n) {
    if (!ywt(n)) return !1;
    var i = typeof t;
    return !!("number" == i ? vwt(n) && bwt(t, n.length) : "string" == i && t in n) && _wt(n[t], e);
  },
  wwt = Txt,
  Cwt = ewt,
  Swt = xwt;
const kwt = n(
  (function (e, t) {
    return mwt(fwt(e, t, pwt), e + "");
  })(function (e, t) {
    if (null == e) return [];
    var n = t.length;
    return (
      n > 1 && Swt(e, t[0], t[1]) ? (t = []) : n > 2 && Swt(t[0], t[1], t[2]) && (t = [t[0]]),
      Cwt(e, wwt(t, 1), [])
    );
  }),
);
function Ewt(e) {
  return (
    (Ewt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    Ewt(e)
  );
}
function Nwt() {
  return (
    (Nwt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    Nwt.apply(this, arguments)
  );
}
function Lwt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t));
          else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (e) {
          ((c = !0), (r = e));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return Dwt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Dwt(e, t);
    })(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function Dwt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function Twt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function Iwt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? Twt(Object(n), !0).forEach(function (t) {
          Rwt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : Twt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function Rwt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != Ewt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != Ewt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == Ewt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function Owt(e) {
  return Array.isArray(e) && Lpt(e[0]) && Lpt(e[1]) ? e.join(" ~ ") : e;
}
var Mwt = function (e) {
  var t = e.separator,
    n = void 0 === t ? " : " : t,
    i = e.contentStyle,
    r = void 0 === i ? {} : i,
    o = e.itemStyle,
    s = void 0 === o ? {} : o,
    a = e.labelStyle,
    l = void 0 === a ? {} : a,
    c = e.payload,
    d = e.formatter,
    u = e.itemSorter,
    h = e.wrapperClassName,
    g = e.labelClassName,
    p = e.label,
    f = e.labelFormatter,
    m = e.accessibilityLayer,
    _ = void 0 !== m && m,
    v = Iwt(
      {
        margin: 0,
        padding: 10,
        backgroundColor: "#fff",
        border: "1px solid #ccc",
        whiteSpace: "nowrap",
      },
      r,
    ),
    b = Iwt({ margin: 0 }, l),
    y = !Zgt(p),
    x = y ? p : "",
    w = Mp("recharts-default-tooltip", h),
    C = Mp("recharts-tooltip-label", g);
  y && f && null != c && (x = f(p, c));
  var S = _ ? { role: "status", "aria-live": "assertive" } : {};
  return z.createElement(
    "div",
    Nwt({ className: w, style: v }, S),
    z.createElement("p", { className: C, style: b }, z.isValidElement(x) ? x : "".concat(x)),
    (function () {
      if (c && c.length) {
        var e = (u ? kwt(c, u) : c).map(function (e, t) {
          if ("none" === e.type) return null;
          var i = Iwt(
              { display: "block", paddingTop: 4, paddingBottom: 4, color: e.color || "#000" },
              s,
            ),
            r = e.formatter || d || Owt,
            o = e.value,
            a = e.name,
            l = o,
            u = a;
          if (r && null != l && null != u) {
            var h = r(o, a, e, t, c);
            if (Array.isArray(h)) {
              var g = Lwt(h, 2);
              ((l = g[0]), (u = g[1]));
            } else l = h;
          }
          return z.createElement(
            "li",
            { className: "recharts-tooltip-item", key: "tooltip-item-".concat(t), style: i },
            Lpt(u) ? z.createElement("span", { className: "recharts-tooltip-item-name" }, u) : null,
            Lpt(u)
              ? z.createElement("span", { className: "recharts-tooltip-item-separator" }, n)
              : null,
            z.createElement("span", { className: "recharts-tooltip-item-value" }, l),
            z.createElement("span", { className: "recharts-tooltip-item-unit" }, e.unit || ""),
          );
        });
        return z.createElement(
          "ul",
          { className: "recharts-tooltip-item-list", style: { padding: 0, margin: 0 } },
          e,
        );
      }
      return null;
    })(),
  );
};
function Awt(e) {
  return (
    (Awt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    Awt(e)
  );
}
function Pwt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != Awt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != Awt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == Awt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
var jwt = "recharts-tooltip-wrapper",
  Fwt = { visibility: "hidden" };
function Bwt(e) {
  var t = e.coordinate,
    n = e.translateX,
    i = e.translateY;
  return Mp(
    jwt,
    Pwt(
      Pwt(
        Pwt(
          Pwt({}, "".concat(jwt, "-right"), Npt(n) && t && Npt(t.x) && n >= t.x),
          "".concat(jwt, "-left"),
          Npt(n) && t && Npt(t.x) && n < t.x,
        ),
        "".concat(jwt, "-bottom"),
        Npt(i) && t && Npt(t.y) && i >= t.y,
      ),
      "".concat(jwt, "-top"),
      Npt(i) && t && Npt(t.y) && i < t.y,
    ),
  );
}
function Vwt(e) {
  var t = e.allowEscapeViewBox,
    n = e.coordinate,
    i = e.key,
    r = e.offsetTopLeft,
    o = e.position,
    s = e.reverseDirection,
    a = e.tooltipDimension,
    l = e.viewBox,
    c = e.viewBoxDimension;
  if (o && Npt(o[i])) return o[i];
  var d = n[i] - a - r,
    u = n[i] + r;
  return t[i]
    ? s[i]
      ? d
      : u
    : s[i]
      ? d < l[i]
        ? Math.max(u, l[i])
        : Math.max(d, l[i])
      : u + a > l[i] + c
        ? Math.max(d, l[i])
        : Math.max(u, l[i]);
}
function Wwt(e) {
  return (
    (Wwt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    Wwt(e)
  );
}
function Hwt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function zwt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? Hwt(Object(n), !0).forEach(function (t) {
          Zwt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : Hwt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function Uwt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, Ywt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function $wt(e, t, n) {
  return (
    (t = Kwt(t)),
    (function (e, t) {
      if (t && ("object" === Wwt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, qwt() ? Reflect.construct(t, n || [], Kwt(e).constructor) : t.apply(e, n))
  );
}
function qwt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (qwt = function () {
    return !!e;
  })();
}
function Kwt(e) {
  return (
    (Kwt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    Kwt(e)
  );
}
function Gwt(e, t) {
  return (
    (Gwt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    Gwt(e, t)
  );
}
function Zwt(e, t, n) {
  return (
    (t = Ywt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function Ywt(e) {
  var t = (function (e, t) {
    if ("object" != Wwt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != Wwt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == Wwt(t) ? t : t + "";
}
var Xwt = (function () {
    function e() {
      var t;
      !(function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e);
      for (var n = arguments.length, i = new Array(n), r = 0; r < n; r++) i[r] = arguments[r];
      return (
        Zwt((t = $wt(this, e, [].concat(i))), "state", {
          dismissed: !1,
          dismissedAtCoordinate: { x: 0, y: 0 },
          lastBoundingBox: { width: -1, height: -1 },
        }),
        Zwt(t, "handleKeyDown", function (e) {
          var n, i, r, o;
          "Escape" === e.key &&
            t.setState({
              dismissed: !0,
              dismissedAtCoordinate: {
                x:
                  null !== (n = null === (i = t.props.coordinate) || void 0 === i ? void 0 : i.x) &&
                  void 0 !== n
                    ? n
                    : 0,
                y:
                  null !== (r = null === (o = t.props.coordinate) || void 0 === o ? void 0 : o.y) &&
                  void 0 !== r
                    ? r
                    : 0,
              },
            });
        }),
        t
      );
    }
    return (
      (function (e, t) {
        if ("function" != typeof t && null !== t)
          throw new TypeError("Super expression must either be null or a function");
        ((e.prototype = Object.create(t && t.prototype, {
          constructor: { value: e, writable: !0, configurable: !0 },
        })),
          Object.defineProperty(e, "prototype", { writable: !1 }),
          t && Gwt(e, t));
      })(e, H.PureComponent),
      Uwt(e, [
        {
          key: "updateBBox",
          value: function () {
            if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
              var e = this.wrapperNode.getBoundingClientRect();
              (Math.abs(e.width - this.state.lastBoundingBox.width) > 1 ||
                Math.abs(e.height - this.state.lastBoundingBox.height) > 1) &&
                this.setState({ lastBoundingBox: { width: e.width, height: e.height } });
            } else
              (-1 === this.state.lastBoundingBox.width &&
                -1 === this.state.lastBoundingBox.height) ||
                this.setState({ lastBoundingBox: { width: -1, height: -1 } });
          },
        },
        {
          key: "componentDidMount",
          value: function () {
            (document.addEventListener("keydown", this.handleKeyDown), this.updateBBox());
          },
        },
        {
          key: "componentWillUnmount",
          value: function () {
            document.removeEventListener("keydown", this.handleKeyDown);
          },
        },
        {
          key: "componentDidUpdate",
          value: function () {
            var e, t;
            (this.props.active && this.updateBBox(),
              this.state.dismissed &&
                (((null === (e = this.props.coordinate) || void 0 === e ? void 0 : e.x) ===
                  this.state.dismissedAtCoordinate.x &&
                  (null === (t = this.props.coordinate) || void 0 === t ? void 0 : t.y) ===
                    this.state.dismissedAtCoordinate.y) ||
                  (this.state.dismissed = !1)));
          },
        },
        {
          key: "render",
          value: function () {
            var e = this,
              t = this.props,
              n = t.active,
              i = t.allowEscapeViewBox,
              r = t.animationDuration,
              o = t.animationEasing,
              s = t.children,
              a = t.coordinate,
              l = t.hasPayload,
              c = t.isAnimationActive,
              d = t.offset,
              u = t.position,
              h = t.reverseDirection,
              g = t.useTranslate3d,
              p = t.viewBox,
              f = t.wrapperStyle,
              m = (function (e) {
                var t,
                  n,
                  i = e.allowEscapeViewBox,
                  r = e.coordinate,
                  o = e.offsetTopLeft,
                  s = e.position,
                  a = e.reverseDirection,
                  l = e.tooltipBox,
                  c = e.useTranslate3d,
                  d = e.viewBox;
                return {
                  cssProperties:
                    l.height > 0 && l.width > 0 && r
                      ? (function (e) {
                          var t = e.translateX,
                            n = e.translateY;
                          return {
                            transform: e.useTranslate3d
                              ? "translate3d(".concat(t, "px, ").concat(n, "px, 0)")
                              : "translate(".concat(t, "px, ").concat(n, "px)"),
                          };
                        })({
                          translateX: (t = Vwt({
                            allowEscapeViewBox: i,
                            coordinate: r,
                            key: "x",
                            offsetTopLeft: o,
                            position: s,
                            reverseDirection: a,
                            tooltipDimension: l.width,
                            viewBox: d,
                            viewBoxDimension: d.width,
                          })),
                          translateY: (n = Vwt({
                            allowEscapeViewBox: i,
                            coordinate: r,
                            key: "y",
                            offsetTopLeft: o,
                            position: s,
                            reverseDirection: a,
                            tooltipDimension: l.height,
                            viewBox: d,
                            viewBoxDimension: d.height,
                          })),
                          useTranslate3d: c,
                        })
                      : Fwt,
                  cssClasses: Bwt({ translateX: t, translateY: n, coordinate: r }),
                };
              })({
                allowEscapeViewBox: i,
                coordinate: a,
                offsetTopLeft: d,
                position: u,
                reverseDirection: h,
                tooltipBox: this.state.lastBoundingBox,
                useTranslate3d: g,
                viewBox: p,
              }),
              _ = m.cssClasses,
              v = m.cssProperties,
              b = zwt(
                zwt({ transition: c && n ? "transform ".concat(r, "ms ").concat(o) : void 0 }, v),
                {},
                {
                  pointerEvents: "none",
                  visibility: !this.state.dismissed && n && l ? "visible" : "hidden",
                  position: "absolute",
                  top: 0,
                  left: 0,
                },
                f,
              );
            return z.createElement(
              "div",
              {
                tabIndex: -1,
                className: _,
                style: b,
                ref: function (t) {
                  e.wrapperNode = t;
                },
              },
              s,
            );
          },
        },
      ])
    );
  })(),
  Qwt = !(
    "undefined" != typeof window &&
    window.document &&
    window.document.createElement &&
    window.setTimeout
  );
function Jwt(e) {
  return (
    (Jwt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    Jwt(e)
  );
}
function eCt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function tCt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? eCt(Object(n), !0).forEach(function (t) {
          aCt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : eCt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function nCt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, lCt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function iCt(e, t, n) {
  return (
    (t = oCt(t)),
    (function (e, t) {
      if (t && ("object" === Jwt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, rCt() ? Reflect.construct(t, n || [], oCt(e).constructor) : t.apply(e, n))
  );
}
function rCt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (rCt = function () {
    return !!e;
  })();
}
function oCt(e) {
  return (
    (oCt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    oCt(e)
  );
}
function sCt(e, t) {
  return (
    (sCt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    sCt(e, t)
  );
}
function aCt(e, t, n) {
  return (
    (t = lCt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function lCt(e) {
  var t = (function (e, t) {
    if ("object" != Jwt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != Jwt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == Jwt(t) ? t : t + "";
}
function cCt(e) {
  return e.dataKey;
}
var dCt = (function () {
  function e() {
    return (
      (function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
      iCt(this, e, arguments)
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && sCt(e, t));
    })(e, H.PureComponent),
    nCt(e, [
      {
        key: "render",
        value: function () {
          var e = this,
            t = this.props,
            n = t.active,
            i = t.allowEscapeViewBox,
            r = t.animationDuration,
            o = t.animationEasing,
            s = t.content,
            a = t.coordinate,
            l = t.filterNull,
            c = t.isAnimationActive,
            d = t.offset,
            u = t.payload,
            h = t.payloadUniqBy,
            g = t.position,
            p = t.reverseDirection,
            f = t.useTranslate3d,
            m = t.viewBox,
            _ = t.wrapperStyle,
            v = null != u ? u : [];
          l &&
            v.length &&
            (v = dxt(
              u.filter(function (t) {
                return null != t.value && (!0 !== t.hide || e.props.includeHidden);
              }),
              h,
              cCt,
            ));
          var b = v.length > 0;
          return z.createElement(
            Xwt,
            {
              allowEscapeViewBox: i,
              animationDuration: r,
              animationEasing: o,
              isAnimationActive: c,
              active: n,
              coordinate: a,
              hasPayload: b,
              offset: d,
              position: g,
              reverseDirection: p,
              useTranslate3d: f,
              viewBox: m,
              wrapperStyle: _,
            },
            (function (e, t) {
              return z.isValidElement(e)
                ? z.cloneElement(e, t)
                : "function" == typeof e
                  ? z.createElement(e, t)
                  : z.createElement(Mwt, t);
            })(s, tCt(tCt({}, this.props), {}, { payload: v })),
          );
        },
      },
    ])
  );
})();
(aCt(dCt, "displayName", "Tooltip"),
  aCt(dCt, "defaultProps", {
    accessibilityLayer: !1,
    allowEscapeViewBox: { x: !1, y: !1 },
    animationDuration: 400,
    animationEasing: "ease",
    contentStyle: {},
    coordinate: { x: 0, y: 0 },
    cursor: !0,
    cursorStyle: {},
    filterNull: !0,
    isAnimationActive: !Qwt,
    itemStyle: {},
    labelStyle: {},
    offset: 10,
    reverseDirection: { x: !1, y: !1 },
    separator: " : ",
    trigger: "hover",
    useTranslate3d: !1,
    viewBox: { x: 0, y: 0, height: 0, width: 0 },
    wrapperStyle: {},
  }));
var uCt = Cut,
  hCt = /\s/;
var gCt = function (e) {
    for (var t = e.length; t-- && hCt.test(e.charAt(t)); );
    return t;
  },
  pCt = gCt,
  fCt = /^\s+/;
var mCt = function (e) {
    return e ? e.slice(0, pCt(e) + 1).replace(fCt, "") : e;
  },
  _Ct = mCt,
  vCt = $ut,
  bCt = But,
  yCt = /^[-+]0x[0-9a-f]+$/i,
  xCt = /^0b[01]+$/i,
  wCt = /^0o[0-7]+$/i,
  CCt = parseInt;
var SCt = function (e) {
    if ("number" == typeof e) return e;
    if (bCt(e)) return NaN;
    if (vCt(e)) {
      var t = "function" == typeof e.valueOf ? e.valueOf() : e;
      e = vCt(t) ? t + "" : t;
    }
    if ("string" != typeof e) return 0 === e ? e : +e;
    e = _Ct(e);
    var n = xCt.test(e);
    return n || wCt.test(e) ? CCt(e.slice(2), n ? 2 : 8) : yCt.test(e) ? NaN : +e;
  },
  kCt = $ut,
  ECt = function () {
    return uCt.Date.now();
  },
  NCt = SCt,
  LCt = Math.max,
  DCt = Math.min;
var TCt = function (e, t, n) {
    var i,
      r,
      o,
      s,
      a,
      l,
      c = 0,
      d = !1,
      u = !1,
      h = !0;
    if ("function" != typeof e) throw new TypeError("Expected a function");
    function g(t) {
      var n = i,
        o = r;
      return ((i = r = void 0), (c = t), (s = e.apply(o, n)));
    }
    function p(e) {
      var n = e - l;
      return void 0 === l || n >= t || n < 0 || (u && e - c >= o);
    }
    function f() {
      var e = ECt();
      if (p(e)) return m(e);
      a = setTimeout(
        f,
        (function (e) {
          var n = t - (e - l);
          return u ? DCt(n, o - (e - c)) : n;
        })(e),
      );
    }
    function m(e) {
      return ((a = void 0), h && i ? g(e) : ((i = r = void 0), s));
    }
    function _() {
      var e = ECt(),
        n = p(e);
      if (((i = arguments), (r = this), (l = e), n)) {
        if (void 0 === a)
          return (function (e) {
            return ((c = e), (a = setTimeout(f, t)), d ? g(e) : s);
          })(l);
        if (u) return (clearTimeout(a), (a = setTimeout(f, t)), g(l));
      }
      return (void 0 === a && (a = setTimeout(f, t)), s);
    }
    return (
      (t = NCt(t) || 0),
      kCt(n) &&
        ((d = !!n.leading),
        (o = (u = "maxWait" in n) ? LCt(NCt(n.maxWait) || 0, t) : o),
        (h = "trailing" in n ? !!n.trailing : h)),
      (_.cancel = function () {
        (void 0 !== a && clearTimeout(a), (c = 0), (i = l = r = a = void 0));
      }),
      (_.flush = function () {
        return void 0 === a ? s : m(ECt());
      }),
      _
    );
  },
  ICt = TCt,
  RCt = $ut;
var OCt = function (e, t, n) {
  var i = !0,
    r = !0;
  if ("function" != typeof e) throw new TypeError("Expected a function");
  return (
    RCt(n) && ((i = "leading" in n ? !!n.leading : i), (r = "trailing" in n ? !!n.trailing : r)),
    ICt(e, t, { leading: i, maxWait: t, trailing: r })
  );
};
const MCt = n(OCt);
function ACt(e) {
  return (
    (ACt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    ACt(e)
  );
}
function PCt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function jCt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? PCt(Object(n), !0).forEach(function (t) {
          FCt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : PCt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function FCt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != ACt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != ACt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == ACt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function BCt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t));
          else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (e) {
          ((c = !0), (r = e));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return VCt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return VCt(e, t);
    })(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function VCt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
var WCt = H.forwardRef(function (e, t) {
    var n = e.aspect,
      i = e.initialDimension,
      r = void 0 === i ? { width: -1, height: -1 } : i,
      o = e.width,
      s = void 0 === o ? "100%" : o,
      a = e.height,
      l = void 0 === a ? "100%" : a,
      c = e.minWidth,
      d = void 0 === c ? 0 : c,
      u = e.minHeight,
      h = e.maxHeight,
      g = e.children,
      p = e.debounce,
      f = void 0 === p ? 0 : p,
      m = e.id,
      _ = e.className,
      v = e.onResize,
      b = e.style,
      y = void 0 === b ? {} : b,
      x = H.useRef(null),
      w = H.useRef();
    ((w.current = v),
      H.useImperativeHandle(t, function () {
        return Object.defineProperty(x.current, "current", {
          get: function () {
            return x.current;
          },
          configurable: !0,
        });
      }));
    var C = BCt(H.useState({ containerWidth: r.width, containerHeight: r.height }), 2),
      S = C[0],
      k = C[1],
      E = H.useCallback(function (e, t) {
        k(function (n) {
          var i = Math.round(e),
            r = Math.round(t);
          return n.containerWidth === i && n.containerHeight === r
            ? n
            : { containerWidth: i, containerHeight: r };
        });
      }, []);
    H.useEffect(
      function () {
        var e = function (e) {
          var t,
            n = e[0].contentRect,
            i = n.width,
            r = n.height;
          (E(i, r), null === (t = w.current) || void 0 === t || t.call(w, i, r));
        };
        f > 0 && (e = MCt(e, f, { trailing: !0, leading: !1 }));
        var t = new ResizeObserver(e),
          n = x.current.getBoundingClientRect(),
          i = n.width,
          r = n.height;
        return (
          E(i, r),
          t.observe(x.current),
          function () {
            t.disconnect();
          }
        );
      },
      [E, f],
    );
    var N = H.useMemo(
      function () {
        var e = S.containerWidth,
          t = S.containerHeight;
        if (e < 0 || t < 0) return null;
        (mft(
          Ept(s) || Ept(l),
          "The width(%s) and height(%s) are both fixed numbers,\n       maybe you don't need to use a ResponsiveContainer.",
          s,
          l,
        ),
          mft(!n || n > 0, "The aspect(%s) must be greater than zero.", n));
        var i = Ept(s) ? e : s,
          r = Ept(l) ? t : l;
        (n && n > 0 && (i ? (r = i / n) : r && (i = r * n), h && r > h && (r = h)),
          mft(
            i > 0 || r > 0,
            "The width(%s) and height(%s) of chart should be greater than 0,\n       please check the style of container, or the props width(%s) and height(%s),\n       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n       height and width.",
            i,
            r,
            s,
            l,
            d,
            u,
            n,
          ));
        var o = !Array.isArray(g) && Zpt(g.type).endsWith("Chart");
        return z.Children.map(g, function (e) {
          return z.isValidElement(e)
            ? H.cloneElement(
                e,
                jCt(
                  { width: i, height: r },
                  o
                    ? {
                        style: jCt(
                          { height: "100%", width: "100%", maxHeight: r, maxWidth: i },
                          e.props.style,
                        ),
                      }
                    : {},
                ),
              )
            : e;
        });
      },
      [n, g, l, h, u, d, S, s],
    );
    return z.createElement(
      "div",
      {
        id: m ? "".concat(m) : void 0,
        className: Mp("recharts-responsive-container", _),
        style: jCt(
          jCt({}, y),
          {},
          { width: s, height: l, minWidth: d, minHeight: u, maxHeight: h },
        ),
        ref: x,
      },
      N,
    );
  }),
  HCt = function (e) {
    return null;
  };
function zCt(e) {
  return (
    (zCt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    zCt(e)
  );
}
function UCt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function $Ct(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? UCt(Object(n), !0).forEach(function (t) {
          qCt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : UCt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function qCt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != zCt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != zCt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == zCt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
HCt.displayName = "Cell";
var KCt = { widthCache: {}, cacheCount: 0 },
  GCt = {
    position: "absolute",
    top: "-20000px",
    left: 0,
    padding: 0,
    margin: 0,
    border: "none",
    whiteSpace: "pre",
  },
  ZCt = "recharts_measurement_span";
var YCt = function (e) {
  if (null == e || Qwt) return { width: 0, height: 0 };
  var t,
    n =
      ((t = $Ct({}, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {})),
      Object.keys(t).forEach(function (e) {
        t[e] || delete t[e];
      }),
      t),
    i = JSON.stringify({ text: e, copyStyle: n });
  if (KCt.widthCache[i]) return KCt.widthCache[i];
  try {
    var r = document.getElementById(ZCt);
    r ||
      ((r = document.createElement("span")).setAttribute("id", ZCt),
      r.setAttribute("aria-hidden", "true"),
      document.body.appendChild(r));
    var o = $Ct($Ct({}, GCt), n);
    (Object.assign(r.style, o), (r.textContent = "".concat(e)));
    var s = r.getBoundingClientRect(),
      a = { width: s.width, height: s.height };
    return (
      (KCt.widthCache[i] = a),
      ++KCt.cacheCount > 2e3 && ((KCt.cacheCount = 0), (KCt.widthCache = {})),
      a
    );
  } catch (spt) {
    return { width: 0, height: 0 };
  }
};
function XCt(e) {
  return (
    (XCt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    XCt(e)
  );
}
function QCt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t)) {
            if (Object(n) !== n) return;
            l = !1;
          } else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (e) {
          ((c = !0), (r = e));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return JCt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return JCt(e, t);
    })(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function JCt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function eSt(e, t) {
  for (var n = 0; n < t.length; n++) {
    var i = t[n];
    ((i.enumerable = i.enumerable || !1),
      (i.configurable = !0),
      "value" in i && (i.writable = !0),
      Object.defineProperty(e, tSt(i.key), i));
  }
}
function tSt(e) {
  var t = (function (e, t) {
    if ("object" != XCt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != XCt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == XCt(t) ? t : t + "";
}
var nSt = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,
  iSt = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,
  rSt = /^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,
  oSt = /(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,
  sSt = { cm: 96 / 2.54, mm: 96 / 25.4, pt: 96 / 72, pc: 16, in: 96, Q: 96 / 101.6, px: 1 },
  aSt = Object.keys(sSt),
  lSt = "NaN";
var cSt = (function () {
  function e(t, n) {
    (!(function (e, t) {
      if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
    })(this, e),
      (this.num = t),
      (this.unit = n),
      (this.num = t),
      (this.unit = n),
      Number.isNaN(t) && (this.unit = ""),
      "" === n || rSt.test(n) || ((this.num = NaN), (this.unit = "")),
      aSt.includes(n) &&
        ((this.num = (function (e, t) {
          return e * sSt[t];
        })(t, n)),
        (this.unit = "px")));
  }
  return (
    (t = e),
    (i = [
      {
        key: "parse",
        value: function (t) {
          var n,
            i = QCt(null !== (n = oSt.exec(t)) && void 0 !== n ? n : [], 3),
            r = i[1],
            o = i[2];
          return new e(parseFloat(r), null != o ? o : "");
        },
      },
    ]),
    (n = [
      {
        key: "add",
        value: function (t) {
          return this.unit !== t.unit ? new e(NaN, "") : new e(this.num + t.num, this.unit);
        },
      },
      {
        key: "subtract",
        value: function (t) {
          return this.unit !== t.unit ? new e(NaN, "") : new e(this.num - t.num, this.unit);
        },
      },
      {
        key: "multiply",
        value: function (t) {
          return "" !== this.unit && "" !== t.unit && this.unit !== t.unit
            ? new e(NaN, "")
            : new e(this.num * t.num, this.unit || t.unit);
        },
      },
      {
        key: "divide",
        value: function (t) {
          return "" !== this.unit && "" !== t.unit && this.unit !== t.unit
            ? new e(NaN, "")
            : new e(this.num / t.num, this.unit || t.unit);
        },
      },
      {
        key: "toString",
        value: function () {
          return "".concat(this.num).concat(this.unit);
        },
      },
      {
        key: "isNaN",
        value: function () {
          return Number.isNaN(this.num);
        },
      },
    ]) && eSt(t.prototype, n),
    i && eSt(t, i),
    Object.defineProperty(t, "prototype", { writable: !1 }),
    t
  );
  var t, n, i;
})();
function dSt(e) {
  if (e.includes(lSt)) return lSt;
  for (var t = e; t.includes("*") || t.includes("/"); ) {
    var n,
      i = QCt(null !== (n = nSt.exec(t)) && void 0 !== n ? n : [], 4),
      r = i[1],
      o = i[2],
      s = i[3],
      a = cSt.parse(null != r ? r : ""),
      l = cSt.parse(null != s ? s : ""),
      c = "*" === o ? a.multiply(l) : a.divide(l);
    if (c.isNaN()) return lSt;
    t = t.replace(nSt, c.toString());
  }
  for (; t.includes("+") || /.-\d+(?:\.\d+)?/.test(t); ) {
    var d,
      u = QCt(null !== (d = iSt.exec(t)) && void 0 !== d ? d : [], 4),
      h = u[1],
      g = u[2],
      p = u[3],
      f = cSt.parse(null != h ? h : ""),
      m = cSt.parse(null != p ? p : ""),
      _ = "+" === g ? f.add(m) : f.subtract(m);
    if (_.isNaN()) return lSt;
    t = t.replace(iSt, _.toString());
  }
  return t;
}
var uSt = /\(([^()]*)\)/;
function hSt(e) {
  var t = e.replace(/\s+/g, "");
  return (
    (t = (function (e) {
      for (var t = e; t.includes("("); ) {
        var n = QCt(uSt.exec(t), 2)[1];
        t = t.replace(uSt, dSt(n));
      }
      return t;
    })(t)),
    (t = dSt(t))
  );
}
function gSt(e) {
  var t = (function (e) {
    try {
      return hSt(e);
    } catch (spt) {
      return lSt;
    }
  })(e.slice(5, -1));
  return t === lSt ? "" : t;
}
var pSt = [
    "x",
    "y",
    "lineHeight",
    "capHeight",
    "scaleToFit",
    "textAnchor",
    "verticalAnchor",
    "fill",
  ],
  fSt = ["dx", "dy", "angle", "className", "breakAll"];
function mSt() {
  return (
    (mSt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    mSt.apply(this, arguments)
  );
}
function _St(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function vSt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t)) {
            if (Object(n) !== n) return;
            l = !1;
          } else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (e) {
          ((c = !0), (r = e));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return bSt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return bSt(e, t);
    })(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function bSt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
var ySt = /[ \f\n\r\t\v\u2028\u2029]+/,
  xSt = function (e) {
    var t = e.children,
      n = e.breakAll,
      i = e.style;
    try {
      var r = [];
      return (
        Zgt(t) || (r = n ? t.toString().split("") : t.toString().split(ySt)),
        {
          wordsWithComputedWidth: r.map(function (e) {
            return { word: e, width: YCt(e, i).width };
          }),
          spaceWidth: n ? 0 : YCt(" ", i).width,
        }
      );
    } catch (spt) {
      return null;
    }
  },
  wSt = function (e) {
    return [{ words: Zgt(e) ? [] : e.toString().split(ySt) }];
  },
  CSt = function (e) {
    var t = e.width,
      n = e.scaleToFit,
      i = e.children,
      r = e.style,
      o = e.breakAll,
      s = e.maxLines;
    if ((t || n) && !Qwt) {
      var a = xSt({ breakAll: o, children: i, style: r });
      return a
        ? (function (e, t, n, i, r) {
            var o = e.maxLines,
              s = e.children,
              a = e.style,
              l = e.breakAll,
              c = Npt(o),
              d = s,
              u = function () {
                return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []).reduce(
                  function (e, t) {
                    var o = t.word,
                      s = t.width,
                      a = e[e.length - 1];
                    if (a && (null == i || r || a.width + s + n < Number(i)))
                      (a.words.push(o), (a.width += s + n));
                    else {
                      var l = { words: [o], width: s };
                      e.push(l);
                    }
                    return e;
                  },
                  [],
                );
              },
              h = u(t);
            if (!c) return h;
            for (
              var g,
                p = function (e) {
                  var t = d.slice(0, e),
                    n = xSt({ breakAll: l, style: a, children: t + "…" }).wordsWithComputedWidth,
                    r = u(n),
                    s =
                      r.length > o ||
                      (function (e) {
                        return e.reduce(function (e, t) {
                          return e.width > t.width ? e : t;
                        });
                      })(r).width > Number(i);
                  return [s, r];
                },
                f = 0,
                m = d.length - 1,
                _ = 0;
              f <= m && _ <= d.length - 1;
            ) {
              var v = Math.floor((f + m) / 2),
                b = vSt(p(v - 1), 2),
                y = b[0],
                x = b[1],
                w = vSt(p(v), 1)[0];
              if ((y || w || (f = v + 1), y && w && (m = v - 1), !y && w)) {
                g = x;
                break;
              }
              _++;
            }
            return g || h;
          })(
            { breakAll: o, children: i, maxLines: s, style: r },
            a.wordsWithComputedWidth,
            a.spaceWidth,
            t,
            n,
          )
        : wSt(i);
    }
    return wSt(i);
  },
  SSt = "#808080",
  kSt = function (e) {
    var t = e.x,
      n = void 0 === t ? 0 : t,
      i = e.y,
      r = void 0 === i ? 0 : i,
      o = e.lineHeight,
      s = void 0 === o ? "1em" : o,
      a = e.capHeight,
      l = void 0 === a ? "0.71em" : a,
      c = e.scaleToFit,
      d = void 0 !== c && c,
      u = e.textAnchor,
      h = void 0 === u ? "start" : u,
      g = e.verticalAnchor,
      p = void 0 === g ? "end" : g,
      f = e.fill,
      m = void 0 === f ? SSt : f,
      _ = _St(e, pSt),
      v = H.useMemo(
        function () {
          return CSt({
            breakAll: _.breakAll,
            children: _.children,
            maxLines: _.maxLines,
            scaleToFit: d,
            style: _.style,
            width: _.width,
          });
        },
        [_.breakAll, _.children, _.maxLines, d, _.style, _.width],
      ),
      b = _.dx,
      y = _.dy,
      x = _.angle,
      w = _.className,
      C = _.breakAll,
      S = _St(_, fSt);
    if (!Lpt(n) || !Lpt(r)) return null;
    var k,
      E = n + (Npt(b) ? b : 0),
      N = r + (Npt(y) ? y : 0);
    switch (p) {
      case "start":
        k = gSt("calc(".concat(l, ")"));
        break;
      case "middle":
        k = gSt(
          "calc("
            .concat((v.length - 1) / 2, " * -")
            .concat(s, " + (")
            .concat(l, " / 2))"),
        );
        break;
      default:
        k = gSt("calc(".concat(v.length - 1, " * -").concat(s, ")"));
    }
    var L = [];
    if (d) {
      var D = v[0].width,
        T = _.width;
      L.push("scale(".concat((Npt(T) ? T / D : 1) / D, ")"));
    }
    return (
      x && L.push("rotate(".concat(x, ", ").concat(E, ", ").concat(N, ")")),
      L.length && (S.transform = L.join(" ")),
      z.createElement(
        "text",
        mSt({}, rft(S, !0), {
          x: E,
          y: N,
          className: Mp("recharts-text", w),
          textAnchor: h,
          fill: m.includes("url") ? SSt : m,
        }),
        v.map(function (e, t) {
          var n = e.words.join(C ? "" : " ");
          return z.createElement(
            "tspan",
            { x: E, dy: 0 === t ? k : s, key: "".concat(n, "-").concat(t) },
            n,
          );
        }),
      )
    );
  };
function ESt(e, t) {
  return null == e || null == t ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
}
function NSt(e, t) {
  return null == e || null == t ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
}
function LSt(e) {
  let t, n, i;
  function r(e, i, r = 0, o = e.length) {
    if (r < o) {
      if (0 !== t(i, i)) return o;
      do {
        const t = (r + o) >>> 1;
        n(e[t], i) < 0 ? (r = t + 1) : (o = t);
      } while (r < o);
    }
    return r;
  }
  return (
    2 !== e.length
      ? ((t = ESt), (n = (t, n) => ESt(e(t), n)), (i = (t, n) => e(t) - n))
      : ((t = e === ESt || e === NSt ? e : DSt), (n = e), (i = e)),
    {
      left: r,
      center: function (e, t, n = 0, o = e.length) {
        const s = r(e, t, n, o - 1);
        return s > n && i(e[s - 1], t) > -i(e[s], t) ? s - 1 : s;
      },
      right: function (e, i, r = 0, o = e.length) {
        if (r < o) {
          if (0 !== t(i, i)) return o;
          do {
            const t = (r + o) >>> 1;
            n(e[t], i) <= 0 ? (r = t + 1) : (o = t);
          } while (r < o);
        }
        return r;
      },
    }
  );
}
function DSt() {
  return 0;
}
function TSt(e) {
  return null === e ? NaN : +e;
}
const ISt = LSt(ESt).right;
LSt(TSt).center;
class RSt extends Map {
  constructor(e, t = MSt) {
    if (
      (super(),
      Object.defineProperties(this, { _intern: { value: new Map() }, _key: { value: t } }),
      null != e)
    )
      for (const [n, i] of e) this.set(n, i);
  }
  get(e) {
    return super.get(OSt(this, e));
  }
  has(e) {
    return super.has(OSt(this, e));
  }
  set(e, t) {
    return super.set(
      (function ({ _intern: e, _key: t }, n) {
        const i = t(n);
        return e.has(i) ? e.get(i) : (e.set(i, n), n);
      })(this, e),
      t,
    );
  }
  delete(e) {
    return super.delete(
      (function ({ _intern: e, _key: t }, n) {
        const i = t(n);
        e.has(i) && ((n = e.get(i)), e.delete(i));
        return n;
      })(this, e),
    );
  }
}
function OSt({ _intern: e, _key: t }, n) {
  const i = t(n);
  return e.has(i) ? e.get(i) : n;
}
function MSt(e) {
  return null !== e && "object" == typeof e ? e.valueOf() : e;
}
function ASt(e, t) {
  return (null == e || !(e >= e)) - (null == t || !(t >= t)) || (e < t ? -1 : e > t ? 1 : 0);
}
const PSt = Math.sqrt(50),
  jSt = Math.sqrt(10),
  FSt = Math.sqrt(2);
function BSt(e, t, n) {
  const i = (t - e) / Math.max(0, n),
    r = Math.floor(Math.log10(i)),
    o = i / Math.pow(10, r),
    s = o >= PSt ? 10 : o >= jSt ? 5 : o >= FSt ? 2 : 1;
  let a, l, c;
  return (
    r < 0
      ? ((c = Math.pow(10, -r) / s),
        (a = Math.round(e * c)),
        (l = Math.round(t * c)),
        a / c < e && ++a,
        l / c > t && --l,
        (c = -c))
      : ((c = Math.pow(10, r) * s),
        (a = Math.round(e / c)),
        (l = Math.round(t / c)),
        a * c < e && ++a,
        l * c > t && --l),
    l < a && 0.5 <= n && n < 2 ? BSt(e, t, 2 * n) : [a, l, c]
  );
}
function VSt(e, t, n) {
  if (!((n = +n) > 0)) return [];
  if ((e = +e) === (t = +t)) return [e];
  const i = t < e,
    [r, o, s] = i ? BSt(t, e, n) : BSt(e, t, n);
  if (!(o >= r)) return [];
  const a = o - r + 1,
    l = new Array(a);
  if (i)
    if (s < 0) for (let c = 0; c < a; ++c) l[c] = (o - c) / -s;
    else for (let c = 0; c < a; ++c) l[c] = (o - c) * s;
  else if (s < 0) for (let c = 0; c < a; ++c) l[c] = (r + c) / -s;
  else for (let c = 0; c < a; ++c) l[c] = (r + c) * s;
  return l;
}
function WSt(e, t, n) {
  return BSt((e = +e), (t = +t), (n = +n))[2];
}
function HSt(e, t, n) {
  n = +n;
  const i = (t = +t) < (e = +e),
    r = i ? WSt(t, e, n) : WSt(e, t, n);
  return (i ? -1 : 1) * (r < 0 ? 1 / -r : r);
}
function zSt(e, t) {
  let n;
  for (const i of e) null != i && (n < i || (void 0 === n && i >= i)) && (n = i);
  return n;
}
function USt(e, t) {
  let n;
  for (const i of e) null != i && (n > i || (void 0 === n && i >= i)) && (n = i);
  return n;
}
function $St(e, t, n = 0, i = 1 / 0, r) {
  if (
    ((t = Math.floor(t)),
    (n = Math.floor(Math.max(0, n))),
    (i = Math.floor(Math.min(e.length - 1, i))),
    !(n <= t && t <= i))
  )
    return e;
  for (
    r =
      void 0 === r
        ? ASt
        : (function (e = ESt) {
            if (e === ESt) return ASt;
            if ("function" != typeof e) throw new TypeError("compare is not a function");
            return (t, n) => {
              const i = e(t, n);
              return i || 0 === i ? i : (0 === e(n, n)) - (0 === e(t, t));
            };
          })(r);
    i > n;
  ) {
    if (i - n > 600) {
      const o = i - n + 1,
        s = t - n + 1,
        a = Math.log(o),
        l = 0.5 * Math.exp((2 * a) / 3),
        c = 0.5 * Math.sqrt((a * l * (o - l)) / o) * (s - o / 2 < 0 ? -1 : 1);
      $St(
        e,
        t,
        Math.max(n, Math.floor(t - (s * l) / o + c)),
        Math.min(i, Math.floor(t + ((o - s) * l) / o + c)),
        r,
      );
    }
    const o = e[t];
    let s = n,
      a = i;
    for (qSt(e, n, t), r(e[i], o) > 0 && qSt(e, n, i); s < a; ) {
      for (qSt(e, s, a), ++s, --a; r(e[s], o) < 0; ) ++s;
      for (; r(e[a], o) > 0; ) --a;
    }
    (0 === r(e[n], o) ? qSt(e, n, a) : (++a, qSt(e, a, i)),
      a <= t && (n = a + 1),
      t <= a && (i = a - 1));
  }
  return e;
}
function qSt(e, t, n) {
  const i = e[t];
  ((e[t] = e[n]), (e[n] = i));
}
function KSt(e, t, n = TSt) {
  if ((i = e.length) && !isNaN((t = +t))) {
    if (t <= 0 || i < 2) return +n(e[0], 0, e);
    if (t >= 1) return +n(e[i - 1], i - 1, e);
    var i,
      r = (i - 1) * t,
      o = Math.floor(r),
      s = +n(e[o], o, e);
    return s + (+n(e[o + 1], o + 1, e) - s) * (r - o);
  }
}
function GSt(e, t) {
  switch (arguments.length) {
    case 0:
      break;
    case 1:
      this.range(e);
      break;
    default:
      this.range(t).domain(e);
  }
  return this;
}
function ZSt(e, t) {
  switch (arguments.length) {
    case 0:
      break;
    case 1:
      "function" == typeof e ? this.interpolator(e) : this.range(e);
      break;
    default:
      (this.domain(e), "function" == typeof t ? this.interpolator(t) : this.range(t));
  }
  return this;
}
const YSt = Symbol("implicit");
function XSt() {
  var e = new RSt(),
    t = [],
    n = [],
    i = YSt;
  function r(r) {
    let o = e.get(r);
    if (void 0 === o) {
      if (i !== YSt) return i;
      e.set(r, (o = t.push(r) - 1));
    }
    return n[o % n.length];
  }
  return (
    (r.domain = function (n) {
      if (!arguments.length) return t.slice();
      ((t = []), (e = new RSt()));
      for (const i of n) e.has(i) || e.set(i, t.push(i) - 1);
      return r;
    }),
    (r.range = function (e) {
      return arguments.length ? ((n = Array.from(e)), r) : n.slice();
    }),
    (r.unknown = function (e) {
      return arguments.length ? ((i = e), r) : i;
    }),
    (r.copy = function () {
      return XSt(t, n).unknown(i);
    }),
    GSt.apply(r, arguments),
    r
  );
}
function QSt() {
  var e,
    t,
    n = XSt().unknown(void 0),
    i = n.domain,
    r = n.range,
    o = 0,
    s = 1,
    a = !1,
    l = 0,
    c = 0,
    d = 0.5;
  function u() {
    var n = i().length,
      u = s < o,
      h = u ? s : o,
      g = u ? o : s;
    ((e = (g - h) / Math.max(1, n - l + 2 * c)),
      a && (e = Math.floor(e)),
      (h += (g - h - e * (n - l)) * d),
      (t = e * (1 - l)),
      a && ((h = Math.round(h)), (t = Math.round(t))));
    var p = (function (e, t, n) {
      ((e = +e),
        (t = +t),
        (n = (r = arguments.length) < 2 ? ((t = e), (e = 0), 1) : r < 3 ? 1 : +n));
      for (var i = -1, r = 0 | Math.max(0, Math.ceil((t - e) / n)), o = new Array(r); ++i < r; )
        o[i] = e + i * n;
      return o;
    })(n).map(function (t) {
      return h + e * t;
    });
    return r(u ? p.reverse() : p);
  }
  return (
    delete n.unknown,
    (n.domain = function (e) {
      return arguments.length ? (i(e), u()) : i();
    }),
    (n.range = function (e) {
      return arguments.length ? (([o, s] = e), (o = +o), (s = +s), u()) : [o, s];
    }),
    (n.rangeRound = function (e) {
      return (([o, s] = e), (o = +o), (s = +s), (a = !0), u());
    }),
    (n.bandwidth = function () {
      return t;
    }),
    (n.step = function () {
      return e;
    }),
    (n.round = function (e) {
      return arguments.length ? ((a = !!e), u()) : a;
    }),
    (n.padding = function (e) {
      return arguments.length ? ((l = Math.min(1, (c = +e))), u()) : l;
    }),
    (n.paddingInner = function (e) {
      return arguments.length ? ((l = Math.min(1, e)), u()) : l;
    }),
    (n.paddingOuter = function (e) {
      return arguments.length ? ((c = +e), u()) : c;
    }),
    (n.align = function (e) {
      return arguments.length ? ((d = Math.max(0, Math.min(1, e))), u()) : d;
    }),
    (n.copy = function () {
      return QSt(i(), [o, s]).round(a).paddingInner(l).paddingOuter(c).align(d);
    }),
    GSt.apply(u(), arguments)
  );
}
function JSt(e) {
  var t = e.copy;
  return (
    (e.padding = e.paddingOuter),
    delete e.paddingInner,
    delete e.paddingOuter,
    (e.copy = function () {
      return JSt(t());
    }),
    e
  );
}
function ekt() {
  return JSt(QSt.apply(null, arguments).paddingInner(1));
}
function tkt(e, t, n) {
  ((e.prototype = t.prototype = n), (n.constructor = e));
}
function nkt(e, t) {
  var n = Object.create(e.prototype);
  for (var i in t) n[i] = t[i];
  return n;
}
function ikt() {}
var rkt = 0.7,
  okt = 1 / rkt,
  skt = "\\s*([+-]?\\d+)\\s*",
  akt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
  lkt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
  ckt = /^#([0-9a-f]{3,8})$/,
  dkt = new RegExp(`^rgb\\(${skt},${skt},${skt}\\)$`),
  ukt = new RegExp(`^rgb\\(${lkt},${lkt},${lkt}\\)$`),
  hkt = new RegExp(`^rgba\\(${skt},${skt},${skt},${akt}\\)$`),
  gkt = new RegExp(`^rgba\\(${lkt},${lkt},${lkt},${akt}\\)$`),
  pkt = new RegExp(`^hsl\\(${akt},${lkt},${lkt}\\)$`),
  fkt = new RegExp(`^hsla\\(${akt},${lkt},${lkt},${akt}\\)$`),
  mkt = {
    aliceblue: 15792383,
    antiquewhite: 16444375,
    aqua: 65535,
    aquamarine: 8388564,
    azure: 15794175,
    beige: 16119260,
    bisque: 16770244,
    black: 0,
    blanchedalmond: 16772045,
    blue: 255,
    blueviolet: 9055202,
    brown: 10824234,
    burlywood: 14596231,
    cadetblue: 6266528,
    chartreuse: 8388352,
    chocolate: 13789470,
    coral: 16744272,
    cornflowerblue: 6591981,
    cornsilk: 16775388,
    crimson: 14423100,
    cyan: 65535,
    darkblue: 139,
    darkcyan: 35723,
    darkgoldenrod: 12092939,
    darkgray: 11119017,
    darkgreen: 25600,
    darkgrey: 11119017,
    darkkhaki: 12433259,
    darkmagenta: 9109643,
    darkolivegreen: 5597999,
    darkorange: 16747520,
    darkorchid: 10040012,
    darkred: 9109504,
    darksalmon: 15308410,
    darkseagreen: 9419919,
    darkslateblue: 4734347,
    darkslategray: 3100495,
    darkslategrey: 3100495,
    darkturquoise: 52945,
    darkviolet: 9699539,
    deeppink: 16716947,
    deepskyblue: 49151,
    dimgray: 6908265,
    dimgrey: 6908265,
    dodgerblue: 2003199,
    firebrick: 11674146,
    floralwhite: 16775920,
    forestgreen: 2263842,
    fuchsia: 16711935,
    gainsboro: 14474460,
    ghostwhite: 16316671,
    gold: 16766720,
    goldenrod: 14329120,
    gray: 8421504,
    green: 32768,
    greenyellow: 11403055,
    grey: 8421504,
    honeydew: 15794160,
    hotpink: 16738740,
    indianred: 13458524,
    indigo: 4915330,
    ivory: 16777200,
    khaki: 15787660,
    lavender: 15132410,
    lavenderblush: 16773365,
    lawngreen: 8190976,
    lemonchiffon: 16775885,
    lightblue: 11393254,
    lightcoral: 15761536,
    lightcyan: 14745599,
    lightgoldenrodyellow: 16448210,
    lightgray: 13882323,
    lightgreen: 9498256,
    lightgrey: 13882323,
    lightpink: 16758465,
    lightsalmon: 16752762,
    lightseagreen: 2142890,
    lightskyblue: 8900346,
    lightslategray: 7833753,
    lightslategrey: 7833753,
    lightsteelblue: 11584734,
    lightyellow: 16777184,
    lime: 65280,
    limegreen: 3329330,
    linen: 16445670,
    magenta: 16711935,
    maroon: 8388608,
    mediumaquamarine: 6737322,
    mediumblue: 205,
    mediumorchid: 12211667,
    mediumpurple: 9662683,
    mediumseagreen: 3978097,
    mediumslateblue: 8087790,
    mediumspringgreen: 64154,
    mediumturquoise: 4772300,
    mediumvioletred: 13047173,
    midnightblue: 1644912,
    mintcream: 16121850,
    mistyrose: 16770273,
    moccasin: 16770229,
    navajowhite: 16768685,
    navy: 128,
    oldlace: 16643558,
    olive: 8421376,
    olivedrab: 7048739,
    orange: 16753920,
    orangered: 16729344,
    orchid: 14315734,
    palegoldenrod: 15657130,
    palegreen: 10025880,
    paleturquoise: 11529966,
    palevioletred: 14381203,
    papayawhip: 16773077,
    peachpuff: 16767673,
    peru: 13468991,
    pink: 16761035,
    plum: 14524637,
    powderblue: 11591910,
    purple: 8388736,
    rebeccapurple: 6697881,
    red: 16711680,
    rosybrown: 12357519,
    royalblue: 4286945,
    saddlebrown: 9127187,
    salmon: 16416882,
    sandybrown: 16032864,
    seagreen: 3050327,
    seashell: 16774638,
    sienna: 10506797,
    silver: 12632256,
    skyblue: 8900331,
    slateblue: 6970061,
    slategray: 7372944,
    slategrey: 7372944,
    snow: 16775930,
    springgreen: 65407,
    steelblue: 4620980,
    tan: 13808780,
    teal: 32896,
    thistle: 14204888,
    tomato: 16737095,
    turquoise: 4251856,
    violet: 15631086,
    wheat: 16113331,
    white: 16777215,
    whitesmoke: 16119285,
    yellow: 16776960,
    yellowgreen: 10145074,
  };
function _kt() {
  return this.rgb().formatHex();
}
function vkt() {
  return this.rgb().formatRgb();
}
function bkt(e) {
  var t, n;
  return (
    (e = (e + "").trim().toLowerCase()),
    (t = ckt.exec(e))
      ? ((n = t[1].length),
        (t = parseInt(t[1], 16)),
        6 === n
          ? ykt(t)
          : 3 === n
            ? new Ckt(
                ((t >> 8) & 15) | ((t >> 4) & 240),
                ((t >> 4) & 15) | (240 & t),
                ((15 & t) << 4) | (15 & t),
                1,
              )
            : 8 === n
              ? xkt((t >> 24) & 255, (t >> 16) & 255, (t >> 8) & 255, (255 & t) / 255)
              : 4 === n
                ? xkt(
                    ((t >> 12) & 15) | ((t >> 8) & 240),
                    ((t >> 8) & 15) | ((t >> 4) & 240),
                    ((t >> 4) & 15) | (240 & t),
                    (((15 & t) << 4) | (15 & t)) / 255,
                  )
                : null)
      : (t = dkt.exec(e))
        ? new Ckt(t[1], t[2], t[3], 1)
        : (t = ukt.exec(e))
          ? new Ckt((255 * t[1]) / 100, (255 * t[2]) / 100, (255 * t[3]) / 100, 1)
          : (t = hkt.exec(e))
            ? xkt(t[1], t[2], t[3], t[4])
            : (t = gkt.exec(e))
              ? xkt((255 * t[1]) / 100, (255 * t[2]) / 100, (255 * t[3]) / 100, t[4])
              : (t = pkt.exec(e))
                ? Dkt(t[1], t[2] / 100, t[3] / 100, 1)
                : (t = fkt.exec(e))
                  ? Dkt(t[1], t[2] / 100, t[3] / 100, t[4])
                  : mkt.hasOwnProperty(e)
                    ? ykt(mkt[e])
                    : "transparent" === e
                      ? new Ckt(NaN, NaN, NaN, 0)
                      : null
  );
}
function ykt(e) {
  return new Ckt((e >> 16) & 255, (e >> 8) & 255, 255 & e, 1);
}
function xkt(e, t, n, i) {
  return (i <= 0 && (e = t = n = NaN), new Ckt(e, t, n, i));
}
function wkt(e, t, n, i) {
  return 1 === arguments.length
    ? (function (e) {
        return (
          e instanceof ikt || (e = bkt(e)),
          e ? new Ckt((e = e.rgb()).r, e.g, e.b, e.opacity) : new Ckt()
        );
      })(e)
    : new Ckt(e, t, n, null == i ? 1 : i);
}
function Ckt(e, t, n, i) {
  ((this.r = +e), (this.g = +t), (this.b = +n), (this.opacity = +i));
}
function Skt() {
  return `#${Lkt(this.r)}${Lkt(this.g)}${Lkt(this.b)}`;
}
function kkt() {
  const e = Ekt(this.opacity);
  return `${1 === e ? "rgb(" : "rgba("}${Nkt(this.r)}, ${Nkt(this.g)}, ${Nkt(this.b)}${1 === e ? ")" : `, ${e})`}`;
}
function Ekt(e) {
  return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
}
function Nkt(e) {
  return Math.max(0, Math.min(255, Math.round(e) || 0));
}
function Lkt(e) {
  return ((e = Nkt(e)) < 16 ? "0" : "") + e.toString(16);
}
function Dkt(e, t, n, i) {
  return (
    i <= 0 ? (e = t = n = NaN) : n <= 0 || n >= 1 ? (e = t = NaN) : t <= 0 && (e = NaN),
    new Ikt(e, t, n, i)
  );
}
function Tkt(e) {
  if (e instanceof Ikt) return new Ikt(e.h, e.s, e.l, e.opacity);
  if ((e instanceof ikt || (e = bkt(e)), !e)) return new Ikt();
  if (e instanceof Ikt) return e;
  var t = (e = e.rgb()).r / 255,
    n = e.g / 255,
    i = e.b / 255,
    r = Math.min(t, n, i),
    o = Math.max(t, n, i),
    s = NaN,
    a = o - r,
    l = (o + r) / 2;
  return (
    a
      ? ((s = t === o ? (n - i) / a + 6 * (n < i) : n === o ? (i - t) / a + 2 : (t - n) / a + 4),
        (a /= l < 0.5 ? o + r : 2 - o - r),
        (s *= 60))
      : (a = l > 0 && l < 1 ? 0 : s),
    new Ikt(s, a, l, e.opacity)
  );
}
function Ikt(e, t, n, i) {
  ((this.h = +e), (this.s = +t), (this.l = +n), (this.opacity = +i));
}
function Rkt(e) {
  return (e = (e || 0) % 360) < 0 ? e + 360 : e;
}
function Okt(e) {
  return Math.max(0, Math.min(1, e || 0));
}
function Mkt(e, t, n) {
  return (
    255 *
    (e < 60 ? t + ((n - t) * e) / 60 : e < 180 ? n : e < 240 ? t + ((n - t) * (240 - e)) / 60 : t)
  );
}
(tkt(ikt, bkt, {
  copy(e) {
    return Object.assign(new this.constructor(), this, e);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: _kt,
  formatHex: _kt,
  formatHex8: function () {
    return this.rgb().formatHex8();
  },
  formatHsl: function () {
    return Tkt(this).formatHsl();
  },
  formatRgb: vkt,
  toString: vkt,
}),
  tkt(
    Ckt,
    wkt,
    nkt(ikt, {
      brighter(e) {
        return (
          (e = null == e ? okt : Math.pow(okt, e)),
          new Ckt(this.r * e, this.g * e, this.b * e, this.opacity)
        );
      },
      darker(e) {
        return (
          (e = null == e ? rkt : Math.pow(rkt, e)),
          new Ckt(this.r * e, this.g * e, this.b * e, this.opacity)
        );
      },
      rgb() {
        return this;
      },
      clamp() {
        return new Ckt(Nkt(this.r), Nkt(this.g), Nkt(this.b), Ekt(this.opacity));
      },
      displayable() {
        return (
          -0.5 <= this.r &&
          this.r < 255.5 &&
          -0.5 <= this.g &&
          this.g < 255.5 &&
          -0.5 <= this.b &&
          this.b < 255.5 &&
          0 <= this.opacity &&
          this.opacity <= 1
        );
      },
      hex: Skt,
      formatHex: Skt,
      formatHex8: function () {
        return `#${Lkt(this.r)}${Lkt(this.g)}${Lkt(this.b)}${Lkt(255 * (isNaN(this.opacity) ? 1 : this.opacity))}`;
      },
      formatRgb: kkt,
      toString: kkt,
    }),
  ),
  tkt(
    Ikt,
    function (e, t, n, i) {
      return 1 === arguments.length ? Tkt(e) : new Ikt(e, t, n, null == i ? 1 : i);
    },
    nkt(ikt, {
      brighter(e) {
        return (
          (e = null == e ? okt : Math.pow(okt, e)),
          new Ikt(this.h, this.s, this.l * e, this.opacity)
        );
      },
      darker(e) {
        return (
          (e = null == e ? rkt : Math.pow(rkt, e)),
          new Ikt(this.h, this.s, this.l * e, this.opacity)
        );
      },
      rgb() {
        var e = (this.h % 360) + 360 * (this.h < 0),
          t = isNaN(e) || isNaN(this.s) ? 0 : this.s,
          n = this.l,
          i = n + (n < 0.5 ? n : 1 - n) * t,
          r = 2 * n - i;
        return new Ckt(
          Mkt(e >= 240 ? e - 240 : e + 120, r, i),
          Mkt(e, r, i),
          Mkt(e < 120 ? e + 240 : e - 120, r, i),
          this.opacity,
        );
      },
      clamp() {
        return new Ikt(Rkt(this.h), Okt(this.s), Okt(this.l), Ekt(this.opacity));
      },
      displayable() {
        return (
          ((0 <= this.s && this.s <= 1) || isNaN(this.s)) &&
          0 <= this.l &&
          this.l <= 1 &&
          0 <= this.opacity &&
          this.opacity <= 1
        );
      },
      formatHsl() {
        const e = Ekt(this.opacity);
        return `${1 === e ? "hsl(" : "hsla("}${Rkt(this.h)}, ${100 * Okt(this.s)}%, ${100 * Okt(this.l)}%${1 === e ? ")" : `, ${e})`}`;
      },
    }),
  ));
const Akt = (e) => () => e;
function Pkt(e) {
  return 1 === (e = +e)
    ? jkt
    : function (t, n) {
        return n - t
          ? (function (e, t, n) {
              return (
                (e = Math.pow(e, n)),
                (t = Math.pow(t, n) - e),
                (n = 1 / n),
                function (i) {
                  return Math.pow(e + i * t, n);
                }
              );
            })(t, n, e)
          : Akt(isNaN(t) ? n : t);
      };
}
function jkt(e, t) {
  var n = t - e;
  return n
    ? (function (e, t) {
        return function (n) {
          return e + n * t;
        };
      })(e, n)
    : Akt(isNaN(e) ? t : e);
}
const Fkt = (function e(t) {
  var n = Pkt(t);
  function i(e, t) {
    var i = n((e = wkt(e)).r, (t = wkt(t)).r),
      r = n(e.g, t.g),
      o = n(e.b, t.b),
      s = jkt(e.opacity, t.opacity);
    return function (t) {
      return ((e.r = i(t)), (e.g = r(t)), (e.b = o(t)), (e.opacity = s(t)), e + "");
    };
  }
  return ((i.gamma = e), i);
})(1);
function Bkt(e, t) {
  t || (t = []);
  var n,
    i = e ? Math.min(t.length, e.length) : 0,
    r = t.slice();
  return function (o) {
    for (n = 0; n < i; ++n) r[n] = e[n] * (1 - o) + t[n] * o;
    return r;
  };
}
function Vkt(e, t) {
  var n,
    i = t ? t.length : 0,
    r = e ? Math.min(i, e.length) : 0,
    o = new Array(r),
    s = new Array(i);
  for (n = 0; n < r; ++n) o[n] = Kkt(e[n], t[n]);
  for (; n < i; ++n) s[n] = t[n];
  return function (e) {
    for (n = 0; n < r; ++n) s[n] = o[n](e);
    return s;
  };
}
function Wkt(e, t) {
  var n = new Date();
  return (
    (e = +e),
    (t = +t),
    function (i) {
      return (n.setTime(e * (1 - i) + t * i), n);
    }
  );
}
function Hkt(e, t) {
  return (
    (e = +e),
    (t = +t),
    function (n) {
      return e * (1 - n) + t * n;
    }
  );
}
function zkt(e, t) {
  var n,
    i = {},
    r = {};
  for (n in ((null !== e && "object" == typeof e) || (e = {}),
  (null !== t && "object" == typeof t) || (t = {}),
  t))
    n in e ? (i[n] = Kkt(e[n], t[n])) : (r[n] = t[n]);
  return function (e) {
    for (n in i) r[n] = i[n](e);
    return r;
  };
}
var Ukt = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
  $kt = new RegExp(Ukt.source, "g");
function qkt(e, t) {
  var n,
    i,
    r,
    o = (Ukt.lastIndex = $kt.lastIndex = 0),
    s = -1,
    a = [],
    l = [];
  for (e += "", t += ""; (n = Ukt.exec(e)) && (i = $kt.exec(t)); )
    ((r = i.index) > o && ((r = t.slice(o, r)), a[s] ? (a[s] += r) : (a[++s] = r)),
      (n = n[0]) === (i = i[0])
        ? a[s]
          ? (a[s] += i)
          : (a[++s] = i)
        : ((a[++s] = null), l.push({ i: s, x: Hkt(n, i) })),
      (o = $kt.lastIndex));
  return (
    o < t.length && ((r = t.slice(o)), a[s] ? (a[s] += r) : (a[++s] = r)),
    a.length < 2
      ? l[0]
        ? (function (e) {
            return function (t) {
              return e(t) + "";
            };
          })(l[0].x)
        : (function (e) {
            return function () {
              return e;
            };
          })(t)
      : ((t = l.length),
        function (e) {
          for (var n, i = 0; i < t; ++i) a[(n = l[i]).i] = n.x(e);
          return a.join("");
        })
  );
}
function Kkt(e, t) {
  var n,
    i = typeof t;
  return null == t || "boolean" === i
    ? Akt(t)
    : ("number" === i
        ? Hkt
        : "string" === i
          ? (n = bkt(t))
            ? ((t = n), Fkt)
            : qkt
          : t instanceof bkt
            ? Fkt
            : t instanceof Date
              ? Wkt
              : (function (e) {
                    return ArrayBuffer.isView(e) && !(e instanceof DataView);
                  })(t)
                ? Bkt
                : Array.isArray(t)
                  ? Vkt
                  : ("function" != typeof t.valueOf && "function" != typeof t.toString) || isNaN(t)
                    ? zkt
                    : Hkt)(e, t);
}
function Gkt(e, t) {
  return (
    (e = +e),
    (t = +t),
    function (n) {
      return Math.round(e * (1 - n) + t * n);
    }
  );
}
function Zkt(e, t) {
  void 0 === t && ((t = e), (e = Kkt));
  for (var n = 0, i = t.length - 1, r = t[0], o = new Array(i < 0 ? 0 : i); n < i; )
    o[n] = e(r, (r = t[++n]));
  return function (e) {
    var t = Math.max(0, Math.min(i - 1, Math.floor((e *= i))));
    return o[t](e - t);
  };
}
function Ykt(e) {
  return +e;
}
var Xkt = [0, 1];
function Qkt(e) {
  return e;
}
function Jkt(e, t) {
  return (t -= e = +e)
    ? function (n) {
        return (n - e) / t;
      }
    : (function (e) {
        return function () {
          return e;
        };
      })(isNaN(t) ? NaN : 0.5);
}
function eEt(e, t, n) {
  var i = e[0],
    r = e[1],
    o = t[0],
    s = t[1];
  return (
    r < i ? ((i = Jkt(r, i)), (o = n(s, o))) : ((i = Jkt(i, r)), (o = n(o, s))),
    function (e) {
      return o(i(e));
    }
  );
}
function tEt(e, t, n) {
  var i = Math.min(e.length, t.length) - 1,
    r = new Array(i),
    o = new Array(i),
    s = -1;
  for (e[i] < e[0] && ((e = e.slice().reverse()), (t = t.slice().reverse())); ++s < i; )
    ((r[s] = Jkt(e[s], e[s + 1])), (o[s] = n(t[s], t[s + 1])));
  return function (t) {
    var n = ISt(e, t, 1, i) - 1;
    return o[n](r[n](t));
  };
}
function nEt(e, t) {
  return t
    .domain(e.domain())
    .range(e.range())
    .interpolate(e.interpolate())
    .clamp(e.clamp())
    .unknown(e.unknown());
}
function iEt() {
  var e,
    t,
    n,
    i,
    r,
    o,
    s = Xkt,
    a = Xkt,
    l = Kkt,
    c = Qkt;
  function d() {
    var e = Math.min(s.length, a.length);
    return (
      c !== Qkt &&
        (c = (function (e, t) {
          var n;
          return (
            e > t && ((n = e), (e = t), (t = n)),
            function (n) {
              return Math.max(e, Math.min(t, n));
            }
          );
        })(s[0], s[e - 1])),
      (i = e > 2 ? tEt : eEt),
      (r = o = null),
      u
    );
  }
  function u(t) {
    return null == t || isNaN((t = +t)) ? n : (r || (r = i(s.map(e), a, l)))(e(c(t)));
  }
  return (
    (u.invert = function (n) {
      return c(t((o || (o = i(a, s.map(e), Hkt)))(n)));
    }),
    (u.domain = function (e) {
      return arguments.length ? ((s = Array.from(e, Ykt)), d()) : s.slice();
    }),
    (u.range = function (e) {
      return arguments.length ? ((a = Array.from(e)), d()) : a.slice();
    }),
    (u.rangeRound = function (e) {
      return ((a = Array.from(e)), (l = Gkt), d());
    }),
    (u.clamp = function (e) {
      return arguments.length ? ((c = !!e || Qkt), d()) : c !== Qkt;
    }),
    (u.interpolate = function (e) {
      return arguments.length ? ((l = e), d()) : l;
    }),
    (u.unknown = function (e) {
      return arguments.length ? ((n = e), u) : n;
    }),
    function (n, i) {
      return ((e = n), (t = i), d());
    }
  );
}
function rEt() {
  return iEt()(Qkt, Qkt);
}
function oEt(e, t) {
  if ((n = (e = t ? e.toExponential(t - 1) : e.toExponential()).indexOf("e")) < 0) return null;
  var n,
    i = e.slice(0, n);
  return [i.length > 1 ? i[0] + i.slice(2) : i, +e.slice(n + 1)];
}
function sEt(e) {
  return (e = oEt(Math.abs(e))) ? e[1] : NaN;
}
var aEt,
  lEt = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
function cEt(e) {
  if (!(t = lEt.exec(e))) throw new Error("invalid format: " + e);
  var t;
  return new dEt({
    fill: t[1],
    align: t[2],
    sign: t[3],
    symbol: t[4],
    zero: t[5],
    width: t[6],
    comma: t[7],
    precision: t[8] && t[8].slice(1),
    trim: t[9],
    type: t[10],
  });
}
function dEt(e) {
  ((this.fill = void 0 === e.fill ? " " : e.fill + ""),
    (this.align = void 0 === e.align ? ">" : e.align + ""),
    (this.sign = void 0 === e.sign ? "-" : e.sign + ""),
    (this.symbol = void 0 === e.symbol ? "" : e.symbol + ""),
    (this.zero = !!e.zero),
    (this.width = void 0 === e.width ? void 0 : +e.width),
    (this.comma = !!e.comma),
    (this.precision = void 0 === e.precision ? void 0 : +e.precision),
    (this.trim = !!e.trim),
    (this.type = void 0 === e.type ? "" : e.type + ""));
}
function uEt(e, t) {
  var n = oEt(e, t);
  if (!n) return e + "";
  var i = n[0],
    r = n[1];
  return r < 0
    ? "0." + new Array(-r).join("0") + i
    : i.length > r + 1
      ? i.slice(0, r + 1) + "." + i.slice(r + 1)
      : i + new Array(r - i.length + 2).join("0");
}
((cEt.prototype = dEt.prototype),
  (dEt.prototype.toString = function () {
    return (
      this.fill +
      this.align +
      this.sign +
      this.symbol +
      (this.zero ? "0" : "") +
      (void 0 === this.width ? "" : Math.max(1, 0 | this.width)) +
      (this.comma ? "," : "") +
      (void 0 === this.precision ? "" : "." + Math.max(0, 0 | this.precision)) +
      (this.trim ? "~" : "") +
      this.type
    );
  }));
const hEt = {
  "%": (e, t) => (100 * e).toFixed(t),
  b: (e) => Math.round(e).toString(2),
  c: (e) => e + "",
  d: function (e) {
    return Math.abs((e = Math.round(e))) >= 1e21
      ? e.toLocaleString("en").replace(/,/g, "")
      : e.toString(10);
  },
  e: (e, t) => e.toExponential(t),
  f: (e, t) => e.toFixed(t),
  g: (e, t) => e.toPrecision(t),
  o: (e) => Math.round(e).toString(8),
  p: (e, t) => uEt(100 * e, t),
  r: uEt,
  s: function (e, t) {
    var n = oEt(e, t);
    if (!n) return e + "";
    var i = n[0],
      r = n[1],
      o = r - (aEt = 3 * Math.max(-8, Math.min(8, Math.floor(r / 3)))) + 1,
      s = i.length;
    return o === s
      ? i
      : o > s
        ? i + new Array(o - s + 1).join("0")
        : o > 0
          ? i.slice(0, o) + "." + i.slice(o)
          : "0." + new Array(1 - o).join("0") + oEt(e, Math.max(0, t + o - 1))[0];
  },
  X: (e) => Math.round(e).toString(16).toUpperCase(),
  x: (e) => Math.round(e).toString(16),
};
function gEt(e) {
  return e;
}
var pEt,
  fEt,
  mEt,
  _Et = Array.prototype.map,
  vEt = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
function bEt(e) {
  var t,
    n,
    i =
      void 0 === e.grouping || void 0 === e.thousands
        ? gEt
        : ((t = _Et.call(e.grouping, Number)),
          (n = e.thousands + ""),
          function (e, i) {
            for (
              var r = e.length, o = [], s = 0, a = t[0], l = 0;
              r > 0 &&
              a > 0 &&
              (l + a + 1 > i && (a = Math.max(1, i - l)),
              o.push(e.substring((r -= a), r + a)),
              !((l += a + 1) > i));
            )
              a = t[(s = (s + 1) % t.length)];
            return o.reverse().join(n);
          }),
    r = void 0 === e.currency ? "" : e.currency[0] + "",
    o = void 0 === e.currency ? "" : e.currency[1] + "",
    s = void 0 === e.decimal ? "." : e.decimal + "",
    a =
      void 0 === e.numerals
        ? gEt
        : (function (e) {
            return function (t) {
              return t.replace(/[0-9]/g, function (t) {
                return e[+t];
              });
            };
          })(_Et.call(e.numerals, String)),
    l = void 0 === e.percent ? "%" : e.percent + "",
    c = void 0 === e.minus ? "−" : e.minus + "",
    d = void 0 === e.nan ? "NaN" : e.nan + "";
  function u(e) {
    var t = (e = cEt(e)).fill,
      n = e.align,
      u = e.sign,
      h = e.symbol,
      g = e.zero,
      p = e.width,
      f = e.comma,
      m = e.precision,
      _ = e.trim,
      v = e.type;
    ("n" === v ? ((f = !0), (v = "g")) : hEt[v] || (void 0 === m && (m = 12), (_ = !0), (v = "g")),
      (g || ("0" === t && "=" === n)) && ((g = !0), (t = "0"), (n = "=")));
    var b = "$" === h ? r : "#" === h && /[boxX]/.test(v) ? "0" + v.toLowerCase() : "",
      y = "$" === h ? o : /[%p]/.test(v) ? l : "",
      x = hEt[v],
      w = /[defgprs%]/.test(v);
    function C(e) {
      var r,
        o,
        l,
        h = b,
        C = y;
      if ("c" === v) ((C = x(e) + C), (e = ""));
      else {
        var S = (e = +e) < 0 || 1 / e < 0;
        if (
          ((e = isNaN(e) ? d : x(Math.abs(e), m)),
          _ &&
            (e = (function (e) {
              e: for (var t, n = e.length, i = 1, r = -1; i < n; ++i)
                switch (e[i]) {
                  case ".":
                    r = t = i;
                    break;
                  case "0":
                    (0 === r && (r = i), (t = i));
                    break;
                  default:
                    if (!+e[i]) break e;
                    r > 0 && (r = 0);
                }
              return r > 0 ? e.slice(0, r) + e.slice(t + 1) : e;
            })(e)),
          S && 0 === +e && "+" !== u && (S = !1),
          (h = (S ? ("(" === u ? u : c) : "-" === u || "(" === u ? "" : u) + h),
          (C = ("s" === v ? vEt[8 + aEt / 3] : "") + C + (S && "(" === u ? ")" : "")),
          w)
        )
          for (r = -1, o = e.length; ++r < o; )
            if (48 > (l = e.charCodeAt(r)) || l > 57) {
              ((C = (46 === l ? s + e.slice(r + 1) : e.slice(r)) + C), (e = e.slice(0, r)));
              break;
            }
      }
      f && !g && (e = i(e, 1 / 0));
      var k = h.length + e.length + C.length,
        E = k < p ? new Array(p - k + 1).join(t) : "";
      switch ((f && g && ((e = i(E + e, E.length ? p - C.length : 1 / 0)), (E = "")), n)) {
        case "<":
          e = h + e + C + E;
          break;
        case "=":
          e = h + E + e + C;
          break;
        case "^":
          e = E.slice(0, (k = E.length >> 1)) + h + e + C + E.slice(k);
          break;
        default:
          e = E + h + e + C;
      }
      return a(e);
    }
    return (
      (m =
        void 0 === m
          ? 6
          : /[gprs]/.test(v)
            ? Math.max(1, Math.min(21, m))
            : Math.max(0, Math.min(20, m))),
      (C.toString = function () {
        return e + "";
      }),
      C
    );
  }
  return {
    format: u,
    formatPrefix: function (e, t) {
      var n = u((((e = cEt(e)).type = "f"), e)),
        i = 3 * Math.max(-8, Math.min(8, Math.floor(sEt(t) / 3))),
        r = Math.pow(10, -i),
        o = vEt[8 + i / 3];
      return function (e) {
        return n(r * e) + o;
      };
    },
  };
}
function yEt(e, t, n, i) {
  var r,
    o = HSt(e, t, n);
  switch ((i = cEt(null == i ? ",f" : i)).type) {
    case "s":
      var s = Math.max(Math.abs(e), Math.abs(t));
      return (
        null != i.precision ||
          isNaN(
            (r = (function (e, t) {
              return Math.max(
                0,
                3 * Math.max(-8, Math.min(8, Math.floor(sEt(t) / 3))) - sEt(Math.abs(e)),
              );
            })(o, s)),
          ) ||
          (i.precision = r),
        mEt(i, s)
      );
    case "":
    case "e":
    case "g":
    case "p":
    case "r":
      null != i.precision ||
        isNaN(
          (r = (function (e, t) {
            return ((e = Math.abs(e)), (t = Math.abs(t) - e), Math.max(0, sEt(t) - sEt(e)) + 1);
          })(o, Math.max(Math.abs(e), Math.abs(t)))),
        ) ||
        (i.precision = r - ("e" === i.type));
      break;
    case "f":
    case "%":
      null != i.precision ||
        isNaN(
          (r = (function (e) {
            return Math.max(0, -sEt(Math.abs(e)));
          })(o)),
        ) ||
        (i.precision = r - 2 * ("%" === i.type));
  }
  return fEt(i);
}
function xEt(e) {
  var t = e.domain;
  return (
    (e.ticks = function (e) {
      var n = t();
      return VSt(n[0], n[n.length - 1], null == e ? 10 : e);
    }),
    (e.tickFormat = function (e, n) {
      var i = t();
      return yEt(i[0], i[i.length - 1], null == e ? 10 : e, n);
    }),
    (e.nice = function (n) {
      null == n && (n = 10);
      var i,
        r,
        o = t(),
        s = 0,
        a = o.length - 1,
        l = o[s],
        c = o[a],
        d = 10;
      for (c < l && ((r = l), (l = c), (c = r), (r = s), (s = a), (a = r)); d-- > 0; ) {
        if ((r = WSt(l, c, n)) === i) return ((o[s] = l), (o[a] = c), t(o));
        if (r > 0) ((l = Math.floor(l / r) * r), (c = Math.ceil(c / r) * r));
        else {
          if (!(r < 0)) break;
          ((l = Math.ceil(l * r) / r), (c = Math.floor(c * r) / r));
        }
        i = r;
      }
      return e;
    }),
    e
  );
}
function wEt() {
  var e = rEt();
  return (
    (e.copy = function () {
      return nEt(e, wEt());
    }),
    GSt.apply(e, arguments),
    xEt(e)
  );
}
function CEt(e, t) {
  var n,
    i = 0,
    r = (e = e.slice()).length - 1,
    o = e[i],
    s = e[r];
  return (
    s < o && ((n = i), (i = r), (r = n), (n = o), (o = s), (s = n)),
    (e[i] = t.floor(o)),
    (e[r] = t.ceil(s)),
    e
  );
}
function SEt(e) {
  return Math.log(e);
}
function kEt(e) {
  return Math.exp(e);
}
function EEt(e) {
  return -Math.log(-e);
}
function NEt(e) {
  return -Math.exp(-e);
}
function LEt(e) {
  return isFinite(e) ? +("1e" + e) : e < 0 ? 0 : e;
}
function DEt(e) {
  return (t, n) => -e(-t, n);
}
function TEt(e) {
  const t = e(SEt, kEt),
    n = t.domain;
  let i,
    r,
    o = 10;
  function s() {
    return (
      (i = (function (e) {
        return e === Math.E
          ? Math.log
          : (10 === e && Math.log10) ||
              (2 === e && Math.log2) ||
              ((e = Math.log(e)), (t) => Math.log(t) / e);
      })(o)),
      (r = (function (e) {
        return 10 === e ? LEt : e === Math.E ? Math.exp : (t) => Math.pow(e, t);
      })(o)),
      n()[0] < 0 ? ((i = DEt(i)), (r = DEt(r)), e(EEt, NEt)) : e(SEt, kEt),
      t
    );
  }
  return (
    (t.base = function (e) {
      return arguments.length ? ((o = +e), s()) : o;
    }),
    (t.domain = function (e) {
      return arguments.length ? (n(e), s()) : n();
    }),
    (t.ticks = (e) => {
      const t = n();
      let s = t[0],
        a = t[t.length - 1];
      const l = a < s;
      l && ([s, a] = [a, s]);
      let c,
        d,
        u = i(s),
        h = i(a);
      const g = null == e ? 10 : +e;
      let p = [];
      if (!(o % 1) && h - u < g) {
        if (((u = Math.floor(u)), (h = Math.ceil(h)), s > 0)) {
          for (; u <= h; ++u)
            for (c = 1; c < o; ++c)
              if (((d = u < 0 ? c / r(-u) : c * r(u)), !(d < s))) {
                if (d > a) break;
                p.push(d);
              }
        } else
          for (; u <= h; ++u)
            for (c = o - 1; c >= 1; --c)
              if (((d = u > 0 ? c / r(-u) : c * r(u)), !(d < s))) {
                if (d > a) break;
                p.push(d);
              }
        2 * p.length < g && (p = VSt(s, a, g));
      } else p = VSt(u, h, Math.min(h - u, g)).map(r);
      return l ? p.reverse() : p;
    }),
    (t.tickFormat = (e, n) => {
      if (
        (null == e && (e = 10),
        null == n && (n = 10 === o ? "s" : ","),
        "function" != typeof n &&
          (o % 1 || null != (n = cEt(n)).precision || (n.trim = !0), (n = fEt(n))),
        e === 1 / 0)
      )
        return n;
      const s = Math.max(1, (o * e) / t.ticks().length);
      return (e) => {
        let t = e / r(Math.round(i(e)));
        return (t * o < o - 0.5 && (t *= o), t <= s ? n(e) : "");
      };
    }),
    (t.nice = () =>
      n(CEt(n(), { floor: (e) => r(Math.floor(i(e))), ceil: (e) => r(Math.ceil(i(e))) }))),
    t
  );
}
function IEt(e) {
  return function (t) {
    return Math.sign(t) * Math.log1p(Math.abs(t / e));
  };
}
function REt(e) {
  return function (t) {
    return Math.sign(t) * Math.expm1(Math.abs(t)) * e;
  };
}
function OEt(e) {
  var t = 1,
    n = e(IEt(t), REt(t));
  return (
    (n.constant = function (n) {
      return arguments.length ? e(IEt((t = +n)), REt(t)) : t;
    }),
    xEt(n)
  );
}
function MEt(e) {
  return function (t) {
    return t < 0 ? -Math.pow(-t, e) : Math.pow(t, e);
  };
}
function AEt(e) {
  return e < 0 ? -Math.sqrt(-e) : Math.sqrt(e);
}
function PEt(e) {
  return e < 0 ? -e * e : e * e;
}
function jEt(e) {
  var t = e(Qkt, Qkt),
    n = 1;
  return (
    (t.exponent = function (t) {
      return arguments.length
        ? 1 === (n = +t)
          ? e(Qkt, Qkt)
          : 0.5 === n
            ? e(AEt, PEt)
            : e(MEt(n), MEt(1 / n))
        : n;
    }),
    xEt(t)
  );
}
function FEt() {
  var e = jEt(iEt());
  return (
    (e.copy = function () {
      return nEt(e, FEt()).exponent(e.exponent());
    }),
    GSt.apply(e, arguments),
    e
  );
}
function BEt(e) {
  return Math.sign(e) * e * e;
}
((pEt = bEt({ thousands: ",", grouping: [3], currency: ["$", ""] })),
  (fEt = pEt.format),
  (mEt = pEt.formatPrefix));
const VEt = new Date(),
  WEt = new Date();
function HEt(e, t, n, i) {
  function r(t) {
    return (e((t = 0 === arguments.length ? new Date() : new Date(+t))), t);
  }
  return (
    (r.floor = (t) => (e((t = new Date(+t))), t)),
    (r.ceil = (n) => (e((n = new Date(n - 1))), t(n, 1), e(n), n)),
    (r.round = (e) => {
      const t = r(e),
        n = r.ceil(e);
      return e - t < n - e ? t : n;
    }),
    (r.offset = (e, n) => (t((e = new Date(+e)), null == n ? 1 : Math.floor(n)), e)),
    (r.range = (n, i, o) => {
      const s = [];
      if (((n = r.ceil(n)), (o = null == o ? 1 : Math.floor(o)), !(n < i && o > 0))) return s;
      let a;
      do {
        (s.push((a = new Date(+n))), t(n, o), e(n));
      } while (a < n && n < i);
      return s;
    }),
    (r.filter = (n) =>
      HEt(
        (t) => {
          if (t >= t) for (; e(t), !n(t); ) t.setTime(t - 1);
        },
        (e, i) => {
          if (e >= e)
            if (i < 0) for (; ++i <= 0; ) for (; t(e, -1), !n(e); );
            else for (; --i >= 0; ) for (; t(e, 1), !n(e); );
        },
      )),
    n &&
      ((r.count = (t, i) => (
        VEt.setTime(+t),
        WEt.setTime(+i),
        e(VEt),
        e(WEt),
        Math.floor(n(VEt, WEt))
      )),
      (r.every = (e) => (
        (e = Math.floor(e)),
        isFinite(e) && e > 0
          ? e > 1
            ? r.filter(i ? (t) => i(t) % e === 0 : (t) => r.count(0, t) % e === 0)
            : r
          : null
      ))),
    r
  );
}
const zEt = HEt(
  () => {},
  (e, t) => {
    e.setTime(+e + t);
  },
  (e, t) => t - e,
);
((zEt.every = (e) => (
  (e = Math.floor(e)),
  isFinite(e) && e > 0
    ? e > 1
      ? HEt(
          (t) => {
            t.setTime(Math.floor(t / e) * e);
          },
          (t, n) => {
            t.setTime(+t + n * e);
          },
          (t, n) => (n - t) / e,
        )
      : zEt
    : null
)),
  zEt.range);
const UEt = 1e3,
  $Et = 6e4,
  qEt = 36e5,
  KEt = 864e5,
  GEt = 6048e5,
  ZEt = 2592e6,
  YEt = 31536e6,
  XEt = HEt(
    (e) => {
      e.setTime(e - e.getMilliseconds());
    },
    (e, t) => {
      e.setTime(+e + t * UEt);
    },
    (e, t) => (t - e) / UEt,
    (e) => e.getUTCSeconds(),
  );
XEt.range;
const QEt = HEt(
  (e) => {
    e.setTime(e - e.getMilliseconds() - e.getSeconds() * UEt);
  },
  (e, t) => {
    e.setTime(+e + t * $Et);
  },
  (e, t) => (t - e) / $Et,
  (e) => e.getMinutes(),
);
QEt.range;
const JEt = HEt(
  (e) => {
    e.setUTCSeconds(0, 0);
  },
  (e, t) => {
    e.setTime(+e + t * $Et);
  },
  (e, t) => (t - e) / $Et,
  (e) => e.getUTCMinutes(),
);
JEt.range;
const eNt = HEt(
  (e) => {
    e.setTime(e - e.getMilliseconds() - e.getSeconds() * UEt - e.getMinutes() * $Et);
  },
  (e, t) => {
    e.setTime(+e + t * qEt);
  },
  (e, t) => (t - e) / qEt,
  (e) => e.getHours(),
);
eNt.range;
const tNt = HEt(
  (e) => {
    e.setUTCMinutes(0, 0, 0);
  },
  (e, t) => {
    e.setTime(+e + t * qEt);
  },
  (e, t) => (t - e) / qEt,
  (e) => e.getUTCHours(),
);
tNt.range;
const nNt = HEt(
  (e) => e.setHours(0, 0, 0, 0),
  (e, t) => e.setDate(e.getDate() + t),
  (e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * $Et) / KEt,
  (e) => e.getDate() - 1,
);
nNt.range;
const iNt = HEt(
  (e) => {
    e.setUTCHours(0, 0, 0, 0);
  },
  (e, t) => {
    e.setUTCDate(e.getUTCDate() + t);
  },
  (e, t) => (t - e) / KEt,
  (e) => e.getUTCDate() - 1,
);
iNt.range;
const rNt = HEt(
  (e) => {
    e.setUTCHours(0, 0, 0, 0);
  },
  (e, t) => {
    e.setUTCDate(e.getUTCDate() + t);
  },
  (e, t) => (t - e) / KEt,
  (e) => Math.floor(e / KEt),
);
function oNt(e) {
  return HEt(
    (t) => {
      (t.setDate(t.getDate() - ((t.getDay() + 7 - e) % 7)), t.setHours(0, 0, 0, 0));
    },
    (e, t) => {
      e.setDate(e.getDate() + 7 * t);
    },
    (e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * $Et) / GEt,
  );
}
rNt.range;
const sNt = oNt(0),
  aNt = oNt(1),
  lNt = oNt(2),
  cNt = oNt(3),
  dNt = oNt(4),
  uNt = oNt(5),
  hNt = oNt(6);
function gNt(e) {
  return HEt(
    (t) => {
      (t.setUTCDate(t.getUTCDate() - ((t.getUTCDay() + 7 - e) % 7)), t.setUTCHours(0, 0, 0, 0));
    },
    (e, t) => {
      e.setUTCDate(e.getUTCDate() + 7 * t);
    },
    (e, t) => (t - e) / GEt,
  );
}
(sNt.range, aNt.range, lNt.range, cNt.range, dNt.range, uNt.range, hNt.range);
const pNt = gNt(0),
  fNt = gNt(1),
  mNt = gNt(2),
  _Nt = gNt(3),
  vNt = gNt(4),
  bNt = gNt(5),
  yNt = gNt(6);
(pNt.range, fNt.range, mNt.range, _Nt.range, vNt.range, bNt.range, yNt.range);
const xNt = HEt(
  (e) => {
    (e.setDate(1), e.setHours(0, 0, 0, 0));
  },
  (e, t) => {
    e.setMonth(e.getMonth() + t);
  },
  (e, t) => t.getMonth() - e.getMonth() + 12 * (t.getFullYear() - e.getFullYear()),
  (e) => e.getMonth(),
);
xNt.range;
const wNt = HEt(
  (e) => {
    (e.setUTCDate(1), e.setUTCHours(0, 0, 0, 0));
  },
  (e, t) => {
    e.setUTCMonth(e.getUTCMonth() + t);
  },
  (e, t) => t.getUTCMonth() - e.getUTCMonth() + 12 * (t.getUTCFullYear() - e.getUTCFullYear()),
  (e) => e.getUTCMonth(),
);
wNt.range;
const CNt = HEt(
  (e) => {
    (e.setMonth(0, 1), e.setHours(0, 0, 0, 0));
  },
  (e, t) => {
    e.setFullYear(e.getFullYear() + t);
  },
  (e, t) => t.getFullYear() - e.getFullYear(),
  (e) => e.getFullYear(),
);
((CNt.every = (e) =>
  isFinite((e = Math.floor(e))) && e > 0
    ? HEt(
        (t) => {
          (t.setFullYear(Math.floor(t.getFullYear() / e) * e),
            t.setMonth(0, 1),
            t.setHours(0, 0, 0, 0));
        },
        (t, n) => {
          t.setFullYear(t.getFullYear() + n * e);
        },
      )
    : null),
  CNt.range);
const SNt = HEt(
  (e) => {
    (e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0));
  },
  (e, t) => {
    e.setUTCFullYear(e.getUTCFullYear() + t);
  },
  (e, t) => t.getUTCFullYear() - e.getUTCFullYear(),
  (e) => e.getUTCFullYear(),
);
function kNt(e, t, n, i, r, o) {
  const s = [
    [XEt, 1, UEt],
    [XEt, 5, 5e3],
    [XEt, 15, 15e3],
    [XEt, 30, 3e4],
    [o, 1, $Et],
    [o, 5, 3e5],
    [o, 15, 9e5],
    [o, 30, 18e5],
    [r, 1, qEt],
    [r, 3, 108e5],
    [r, 6, 216e5],
    [r, 12, 432e5],
    [i, 1, KEt],
    [i, 2, 1728e5],
    [n, 1, GEt],
    [t, 1, ZEt],
    [t, 3, 7776e6],
    [e, 1, YEt],
  ];
  function a(t, n, i) {
    const r = Math.abs(n - t) / i,
      o = LSt(([, , e]) => e).right(s, r);
    if (o === s.length) return e.every(HSt(t / YEt, n / YEt, i));
    if (0 === o) return zEt.every(Math.max(HSt(t, n, i), 1));
    const [a, l] = s[r / s[o - 1][2] < s[o][2] / r ? o - 1 : o];
    return a.every(l);
  }
  return [
    function (e, t, n) {
      const i = t < e;
      i && ([e, t] = [t, e]);
      const r = n && "function" == typeof n.range ? n : a(e, t, n),
        o = r ? r.range(e, +t + 1) : [];
      return i ? o.reverse() : o;
    },
    a,
  ];
}
((SNt.every = (e) =>
  isFinite((e = Math.floor(e))) && e > 0
    ? HEt(
        (t) => {
          (t.setUTCFullYear(Math.floor(t.getUTCFullYear() / e) * e),
            t.setUTCMonth(0, 1),
            t.setUTCHours(0, 0, 0, 0));
        },
        (t, n) => {
          t.setUTCFullYear(t.getUTCFullYear() + n * e);
        },
      )
    : null),
  SNt.range);
const [ENt, NNt] = kNt(SNt, wNt, pNt, rNt, tNt, JEt),
  [LNt, DNt] = kNt(CNt, xNt, sNt, nNt, eNt, QEt);
function TNt(e) {
  if (0 <= e.y && e.y < 100) {
    var t = new Date(-1, e.m, e.d, e.H, e.M, e.S, e.L);
    return (t.setFullYear(e.y), t);
  }
  return new Date(e.y, e.m, e.d, e.H, e.M, e.S, e.L);
}
function INt(e) {
  if (0 <= e.y && e.y < 100) {
    var t = new Date(Date.UTC(-1, e.m, e.d, e.H, e.M, e.S, e.L));
    return (t.setUTCFullYear(e.y), t);
  }
  return new Date(Date.UTC(e.y, e.m, e.d, e.H, e.M, e.S, e.L));
}
function RNt(e, t, n) {
  return { y: e, m: t, d: n, H: 0, M: 0, S: 0, L: 0 };
}
var ONt,
  MNt,
  ANt,
  PNt = { "-": "", _: " ", 0: "0" },
  jNt = /^\s*\d+/,
  FNt = /^%/,
  BNt = /[\\^$*+?|[\]().{}]/g;
function VNt(e, t, n) {
  var i = e < 0 ? "-" : "",
    r = (i ? -e : e) + "",
    o = r.length;
  return i + (o < n ? new Array(n - o + 1).join(t) + r : r);
}
function WNt(e) {
  return e.replace(BNt, "\\$&");
}
function HNt(e) {
  return new RegExp("^(?:" + e.map(WNt).join("|") + ")", "i");
}
function zNt(e) {
  return new Map(e.map((e, t) => [e.toLowerCase(), t]));
}
function UNt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 1));
  return i ? ((e.w = +i[0]), n + i[0].length) : -1;
}
function $Nt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 1));
  return i ? ((e.u = +i[0]), n + i[0].length) : -1;
}
function qNt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 2));
  return i ? ((e.U = +i[0]), n + i[0].length) : -1;
}
function KNt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 2));
  return i ? ((e.V = +i[0]), n + i[0].length) : -1;
}
function GNt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 2));
  return i ? ((e.W = +i[0]), n + i[0].length) : -1;
}
function ZNt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 4));
  return i ? ((e.y = +i[0]), n + i[0].length) : -1;
}
function YNt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 2));
  return i ? ((e.y = +i[0] + (+i[0] > 68 ? 1900 : 2e3)), n + i[0].length) : -1;
}
function XNt(e, t, n) {
  var i = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n, n + 6));
  return i ? ((e.Z = i[1] ? 0 : -(i[2] + (i[3] || "00"))), n + i[0].length) : -1;
}
function QNt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 1));
  return i ? ((e.q = 3 * i[0] - 3), n + i[0].length) : -1;
}
function JNt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 2));
  return i ? ((e.m = i[0] - 1), n + i[0].length) : -1;
}
function eLt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 2));
  return i ? ((e.d = +i[0]), n + i[0].length) : -1;
}
function tLt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 3));
  return i ? ((e.m = 0), (e.d = +i[0]), n + i[0].length) : -1;
}
function nLt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 2));
  return i ? ((e.H = +i[0]), n + i[0].length) : -1;
}
function iLt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 2));
  return i ? ((e.M = +i[0]), n + i[0].length) : -1;
}
function rLt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 2));
  return i ? ((e.S = +i[0]), n + i[0].length) : -1;
}
function oLt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 3));
  return i ? ((e.L = +i[0]), n + i[0].length) : -1;
}
function sLt(e, t, n) {
  var i = jNt.exec(t.slice(n, n + 6));
  return i ? ((e.L = Math.floor(i[0] / 1e3)), n + i[0].length) : -1;
}
function aLt(e, t, n) {
  var i = FNt.exec(t.slice(n, n + 1));
  return i ? n + i[0].length : -1;
}
function lLt(e, t, n) {
  var i = jNt.exec(t.slice(n));
  return i ? ((e.Q = +i[0]), n + i[0].length) : -1;
}
function cLt(e, t, n) {
  var i = jNt.exec(t.slice(n));
  return i ? ((e.s = +i[0]), n + i[0].length) : -1;
}
function dLt(e, t) {
  return VNt(e.getDate(), t, 2);
}
function uLt(e, t) {
  return VNt(e.getHours(), t, 2);
}
function hLt(e, t) {
  return VNt(e.getHours() % 12 || 12, t, 2);
}
function gLt(e, t) {
  return VNt(1 + nNt.count(CNt(e), e), t, 3);
}
function pLt(e, t) {
  return VNt(e.getMilliseconds(), t, 3);
}
function fLt(e, t) {
  return pLt(e, t) + "000";
}
function mLt(e, t) {
  return VNt(e.getMonth() + 1, t, 2);
}
function _Lt(e, t) {
  return VNt(e.getMinutes(), t, 2);
}
function vLt(e, t) {
  return VNt(e.getSeconds(), t, 2);
}
function bLt(e) {
  var t = e.getDay();
  return 0 === t ? 7 : t;
}
function yLt(e, t) {
  return VNt(sNt.count(CNt(e) - 1, e), t, 2);
}
function xLt(e) {
  var t = e.getDay();
  return t >= 4 || 0 === t ? dNt(e) : dNt.ceil(e);
}
function wLt(e, t) {
  return ((e = xLt(e)), VNt(dNt.count(CNt(e), e) + (4 === CNt(e).getDay()), t, 2));
}
function CLt(e) {
  return e.getDay();
}
function SLt(e, t) {
  return VNt(aNt.count(CNt(e) - 1, e), t, 2);
}
function kLt(e, t) {
  return VNt(e.getFullYear() % 100, t, 2);
}
function ELt(e, t) {
  return VNt((e = xLt(e)).getFullYear() % 100, t, 2);
}
function NLt(e, t) {
  return VNt(e.getFullYear() % 1e4, t, 4);
}
function LLt(e, t) {
  var n = e.getDay();
  return VNt((e = n >= 4 || 0 === n ? dNt(e) : dNt.ceil(e)).getFullYear() % 1e4, t, 4);
}
function DLt(e) {
  var t = e.getTimezoneOffset();
  return (t > 0 ? "-" : ((t *= -1), "+")) + VNt((t / 60) | 0, "0", 2) + VNt(t % 60, "0", 2);
}
function TLt(e, t) {
  return VNt(e.getUTCDate(), t, 2);
}
function ILt(e, t) {
  return VNt(e.getUTCHours(), t, 2);
}
function RLt(e, t) {
  return VNt(e.getUTCHours() % 12 || 12, t, 2);
}
function OLt(e, t) {
  return VNt(1 + iNt.count(SNt(e), e), t, 3);
}
function MLt(e, t) {
  return VNt(e.getUTCMilliseconds(), t, 3);
}
function ALt(e, t) {
  return MLt(e, t) + "000";
}
function PLt(e, t) {
  return VNt(e.getUTCMonth() + 1, t, 2);
}
function jLt(e, t) {
  return VNt(e.getUTCMinutes(), t, 2);
}
function FLt(e, t) {
  return VNt(e.getUTCSeconds(), t, 2);
}
function BLt(e) {
  var t = e.getUTCDay();
  return 0 === t ? 7 : t;
}
function VLt(e, t) {
  return VNt(pNt.count(SNt(e) - 1, e), t, 2);
}
function WLt(e) {
  var t = e.getUTCDay();
  return t >= 4 || 0 === t ? vNt(e) : vNt.ceil(e);
}
function HLt(e, t) {
  return ((e = WLt(e)), VNt(vNt.count(SNt(e), e) + (4 === SNt(e).getUTCDay()), t, 2));
}
function zLt(e) {
  return e.getUTCDay();
}
function ULt(e, t) {
  return VNt(fNt.count(SNt(e) - 1, e), t, 2);
}
function $Lt(e, t) {
  return VNt(e.getUTCFullYear() % 100, t, 2);
}
function qLt(e, t) {
  return VNt((e = WLt(e)).getUTCFullYear() % 100, t, 2);
}
function KLt(e, t) {
  return VNt(e.getUTCFullYear() % 1e4, t, 4);
}
function GLt(e, t) {
  var n = e.getUTCDay();
  return VNt((e = n >= 4 || 0 === n ? vNt(e) : vNt.ceil(e)).getUTCFullYear() % 1e4, t, 4);
}
function ZLt() {
  return "+0000";
}
function YLt() {
  return "%";
}
function XLt(e) {
  return +e;
}
function QLt(e) {
  return Math.floor(+e / 1e3);
}
function JLt(e) {
  return new Date(e);
}
function eDt(e) {
  return e instanceof Date ? +e : +new Date(+e);
}
function tDt(e, t, n, i, r, o, s, a, l, c) {
  var d = rEt(),
    u = d.invert,
    h = d.domain,
    g = c(".%L"),
    p = c(":%S"),
    f = c("%I:%M"),
    m = c("%I %p"),
    _ = c("%a %d"),
    v = c("%b %d"),
    b = c("%B"),
    y = c("%Y");
  function x(e) {
    return (
      l(e) < e
        ? g
        : a(e) < e
          ? p
          : s(e) < e
            ? f
            : o(e) < e
              ? m
              : i(e) < e
                ? r(e) < e
                  ? _
                  : v
                : n(e) < e
                  ? b
                  : y
    )(e);
  }
  return (
    (d.invert = function (e) {
      return new Date(u(e));
    }),
    (d.domain = function (e) {
      return arguments.length ? h(Array.from(e, eDt)) : h().map(JLt);
    }),
    (d.ticks = function (t) {
      var n = h();
      return e(n[0], n[n.length - 1], null == t ? 10 : t);
    }),
    (d.tickFormat = function (e, t) {
      return null == t ? x : c(t);
    }),
    (d.nice = function (e) {
      var n = h();
      return (
        (e && "function" == typeof e.range) || (e = t(n[0], n[n.length - 1], null == e ? 10 : e)),
        e ? h(CEt(n, e)) : d
      );
    }),
    (d.copy = function () {
      return nEt(d, tDt(e, t, n, i, r, o, s, a, l, c));
    }),
    d
  );
}
function nDt() {
  var e,
    t,
    n,
    i,
    r,
    o = 0,
    s = 1,
    a = Qkt,
    l = !1;
  function c(t) {
    return null == t || isNaN((t = +t))
      ? r
      : a(0 === n ? 0.5 : ((t = (i(t) - e) * n), l ? Math.max(0, Math.min(1, t)) : t));
  }
  function d(e) {
    return function (t) {
      var n, i;
      return arguments.length ? (([n, i] = t), (a = e(n, i)), c) : [a(0), a(1)];
    };
  }
  return (
    (c.domain = function (r) {
      return arguments.length
        ? (([o, s] = r), (e = i((o = +o))), (t = i((s = +s))), (n = e === t ? 0 : 1 / (t - e)), c)
        : [o, s];
    }),
    (c.clamp = function (e) {
      return arguments.length ? ((l = !!e), c) : l;
    }),
    (c.interpolator = function (e) {
      return arguments.length ? ((a = e), c) : a;
    }),
    (c.range = d(Kkt)),
    (c.rangeRound = d(Gkt)),
    (c.unknown = function (e) {
      return arguments.length ? ((r = e), c) : r;
    }),
    function (r) {
      return ((i = r), (e = r(o)), (t = r(s)), (n = e === t ? 0 : 1 / (t - e)), c);
    }
  );
}
function iDt(e, t) {
  return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown());
}
function rDt() {
  var e = jEt(nDt());
  return (
    (e.copy = function () {
      return iDt(e, rDt()).exponent(e.exponent());
    }),
    ZSt.apply(e, arguments)
  );
}
function oDt() {
  var e,
    t,
    n,
    i,
    r,
    o,
    s,
    a = 0,
    l = 0.5,
    c = 1,
    d = 1,
    u = Qkt,
    h = !1;
  function g(e) {
    return isNaN((e = +e))
      ? s
      : ((e = 0.5 + ((e = +o(e)) - t) * (d * e < d * t ? i : r)),
        u(h ? Math.max(0, Math.min(1, e)) : e));
  }
  function p(e) {
    return function (t) {
      var n, i, r;
      return arguments.length
        ? (([n, i, r] = t), (u = Zkt(e, [n, i, r])), g)
        : [u(0), u(0.5), u(1)];
    };
  }
  return (
    (g.domain = function (s) {
      return arguments.length
        ? (([a, l, c] = s),
          (e = o((a = +a))),
          (t = o((l = +l))),
          (n = o((c = +c))),
          (i = e === t ? 0 : 0.5 / (t - e)),
          (r = t === n ? 0 : 0.5 / (n - t)),
          (d = t < e ? -1 : 1),
          g)
        : [a, l, c];
    }),
    (g.clamp = function (e) {
      return arguments.length ? ((h = !!e), g) : h;
    }),
    (g.interpolator = function (e) {
      return arguments.length ? ((u = e), g) : u;
    }),
    (g.range = p(Kkt)),
    (g.rangeRound = p(Gkt)),
    (g.unknown = function (e) {
      return arguments.length ? ((s = e), g) : s;
    }),
    function (s) {
      return (
        (o = s),
        (e = s(a)),
        (t = s(l)),
        (n = s(c)),
        (i = e === t ? 0 : 0.5 / (t - e)),
        (r = t === n ? 0 : 0.5 / (n - t)),
        (d = t < e ? -1 : 1),
        g
      );
    }
  );
}
function sDt() {
  var e = jEt(oDt());
  return (
    (e.copy = function () {
      return iDt(e, sDt()).exponent(e.exponent());
    }),
    ZSt.apply(e, arguments)
  );
}
!(function (e) {
  ((ONt = (function (e) {
    var t = e.dateTime,
      n = e.date,
      i = e.time,
      r = e.periods,
      o = e.days,
      s = e.shortDays,
      a = e.months,
      l = e.shortMonths,
      c = HNt(r),
      d = zNt(r),
      u = HNt(o),
      h = zNt(o),
      g = HNt(s),
      p = zNt(s),
      f = HNt(a),
      m = zNt(a),
      _ = HNt(l),
      v = zNt(l),
      b = {
        a: function (e) {
          return s[e.getDay()];
        },
        A: function (e) {
          return o[e.getDay()];
        },
        b: function (e) {
          return l[e.getMonth()];
        },
        B: function (e) {
          return a[e.getMonth()];
        },
        c: null,
        d: dLt,
        e: dLt,
        f: fLt,
        g: ELt,
        G: LLt,
        H: uLt,
        I: hLt,
        j: gLt,
        L: pLt,
        m: mLt,
        M: _Lt,
        p: function (e) {
          return r[+(e.getHours() >= 12)];
        },
        q: function (e) {
          return 1 + ~~(e.getMonth() / 3);
        },
        Q: XLt,
        s: QLt,
        S: vLt,
        u: bLt,
        U: yLt,
        V: wLt,
        w: CLt,
        W: SLt,
        x: null,
        X: null,
        y: kLt,
        Y: NLt,
        Z: DLt,
        "%": YLt,
      },
      y = {
        a: function (e) {
          return s[e.getUTCDay()];
        },
        A: function (e) {
          return o[e.getUTCDay()];
        },
        b: function (e) {
          return l[e.getUTCMonth()];
        },
        B: function (e) {
          return a[e.getUTCMonth()];
        },
        c: null,
        d: TLt,
        e: TLt,
        f: ALt,
        g: qLt,
        G: GLt,
        H: ILt,
        I: RLt,
        j: OLt,
        L: MLt,
        m: PLt,
        M: jLt,
        p: function (e) {
          return r[+(e.getUTCHours() >= 12)];
        },
        q: function (e) {
          return 1 + ~~(e.getUTCMonth() / 3);
        },
        Q: XLt,
        s: QLt,
        S: FLt,
        u: BLt,
        U: VLt,
        V: HLt,
        w: zLt,
        W: ULt,
        x: null,
        X: null,
        y: $Lt,
        Y: KLt,
        Z: ZLt,
        "%": YLt,
      },
      x = {
        a: function (e, t, n) {
          var i = g.exec(t.slice(n));
          return i ? ((e.w = p.get(i[0].toLowerCase())), n + i[0].length) : -1;
        },
        A: function (e, t, n) {
          var i = u.exec(t.slice(n));
          return i ? ((e.w = h.get(i[0].toLowerCase())), n + i[0].length) : -1;
        },
        b: function (e, t, n) {
          var i = _.exec(t.slice(n));
          return i ? ((e.m = v.get(i[0].toLowerCase())), n + i[0].length) : -1;
        },
        B: function (e, t, n) {
          var i = f.exec(t.slice(n));
          return i ? ((e.m = m.get(i[0].toLowerCase())), n + i[0].length) : -1;
        },
        c: function (e, n, i) {
          return S(e, t, n, i);
        },
        d: eLt,
        e: eLt,
        f: sLt,
        g: YNt,
        G: ZNt,
        H: nLt,
        I: nLt,
        j: tLt,
        L: oLt,
        m: JNt,
        M: iLt,
        p: function (e, t, n) {
          var i = c.exec(t.slice(n));
          return i ? ((e.p = d.get(i[0].toLowerCase())), n + i[0].length) : -1;
        },
        q: QNt,
        Q: lLt,
        s: cLt,
        S: rLt,
        u: $Nt,
        U: qNt,
        V: KNt,
        w: UNt,
        W: GNt,
        x: function (e, t, i) {
          return S(e, n, t, i);
        },
        X: function (e, t, n) {
          return S(e, i, t, n);
        },
        y: YNt,
        Y: ZNt,
        Z: XNt,
        "%": aLt,
      };
    function w(e, t) {
      return function (n) {
        var i,
          r,
          o,
          s = [],
          a = -1,
          l = 0,
          c = e.length;
        for (n instanceof Date || (n = new Date(+n)); ++a < c; )
          37 === e.charCodeAt(a) &&
            (s.push(e.slice(l, a)),
            null != (r = PNt[(i = e.charAt(++a))])
              ? (i = e.charAt(++a))
              : (r = "e" === i ? " " : "0"),
            (o = t[i]) && (i = o(n, r)),
            s.push(i),
            (l = a + 1));
        return (s.push(e.slice(l, a)), s.join(""));
      };
    }
    function C(e, t) {
      return function (n) {
        var i,
          r,
          o = RNt(1900, void 0, 1);
        if (S(o, e, (n += ""), 0) != n.length) return null;
        if ("Q" in o) return new Date(o.Q);
        if ("s" in o) return new Date(1e3 * o.s + ("L" in o ? o.L : 0));
        if (
          (t && !("Z" in o) && (o.Z = 0),
          "p" in o && (o.H = (o.H % 12) + 12 * o.p),
          void 0 === o.m && (o.m = "q" in o ? o.q : 0),
          "V" in o)
        ) {
          if (o.V < 1 || o.V > 53) return null;
          ("w" in o || (o.w = 1),
            "Z" in o
              ? ((r = (i = INt(RNt(o.y, 0, 1))).getUTCDay()),
                (i = r > 4 || 0 === r ? fNt.ceil(i) : fNt(i)),
                (i = iNt.offset(i, 7 * (o.V - 1))),
                (o.y = i.getUTCFullYear()),
                (o.m = i.getUTCMonth()),
                (o.d = i.getUTCDate() + ((o.w + 6) % 7)))
              : ((r = (i = TNt(RNt(o.y, 0, 1))).getDay()),
                (i = r > 4 || 0 === r ? aNt.ceil(i) : aNt(i)),
                (i = nNt.offset(i, 7 * (o.V - 1))),
                (o.y = i.getFullYear()),
                (o.m = i.getMonth()),
                (o.d = i.getDate() + ((o.w + 6) % 7))));
        } else
          ("W" in o || "U" in o) &&
            ("w" in o || (o.w = "u" in o ? o.u % 7 : "W" in o ? 1 : 0),
            (r = "Z" in o ? INt(RNt(o.y, 0, 1)).getUTCDay() : TNt(RNt(o.y, 0, 1)).getDay()),
            (o.m = 0),
            (o.d =
              "W" in o
                ? ((o.w + 6) % 7) + 7 * o.W - ((r + 5) % 7)
                : o.w + 7 * o.U - ((r + 6) % 7)));
        return "Z" in o ? ((o.H += (o.Z / 100) | 0), (o.M += o.Z % 100), INt(o)) : TNt(o);
      };
    }
    function S(e, t, n, i) {
      for (var r, o, s = 0, a = t.length, l = n.length; s < a; ) {
        if (i >= l) return -1;
        if (37 === (r = t.charCodeAt(s++))) {
          if (((r = t.charAt(s++)), !(o = x[r in PNt ? t.charAt(s++) : r]) || (i = o(e, n, i)) < 0))
            return -1;
        } else if (r != n.charCodeAt(i++)) return -1;
      }
      return i;
    }
    return (
      (b.x = w(n, b)),
      (b.X = w(i, b)),
      (b.c = w(t, b)),
      (y.x = w(n, y)),
      (y.X = w(i, y)),
      (y.c = w(t, y)),
      {
        format: function (e) {
          var t = w((e += ""), b);
          return (
            (t.toString = function () {
              return e;
            }),
            t
          );
        },
        parse: function (e) {
          var t = C((e += ""), !1);
          return (
            (t.toString = function () {
              return e;
            }),
            t
          );
        },
        utcFormat: function (e) {
          var t = w((e += ""), y);
          return (
            (t.toString = function () {
              return e;
            }),
            t
          );
        },
        utcParse: function (e) {
          var t = C((e += ""), !0);
          return (
            (t.toString = function () {
              return e;
            }),
            t
          );
        },
      }
    );
  })(e)),
    (MNt = ONt.format),
    ONt.parse,
    (ANt = ONt.utcFormat),
    ONt.utcParse);
})({
  dateTime: "%x, %X",
  date: "%-m/%-d/%Y",
  time: "%-I:%M:%S %p",
  periods: ["AM", "PM"],
  days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  months: [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December",
  ],
  shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
});
const aDt = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      scaleBand: QSt,
      scaleDiverging: function e() {
        var t = xEt(oDt()(Qkt));
        return (
          (t.copy = function () {
            return iDt(t, e());
          }),
          ZSt.apply(t, arguments)
        );
      },
      scaleDivergingLog: function e() {
        var t = TEt(oDt()).domain([0.1, 1, 10]);
        return (
          (t.copy = function () {
            return iDt(t, e()).base(t.base());
          }),
          ZSt.apply(t, arguments)
        );
      },
      scaleDivergingPow: sDt,
      scaleDivergingSqrt: function () {
        return sDt.apply(null, arguments).exponent(0.5);
      },
      scaleDivergingSymlog: function e() {
        var t = OEt(oDt());
        return (
          (t.copy = function () {
            return iDt(t, e()).constant(t.constant());
          }),
          ZSt.apply(t, arguments)
        );
      },
      scaleIdentity: function e(t) {
        var n;
        function i(e) {
          return null == e || isNaN((e = +e)) ? n : e;
        }
        return (
          (i.invert = i),
          (i.domain = i.range =
            function (e) {
              return arguments.length ? ((t = Array.from(e, Ykt)), i) : t.slice();
            }),
          (i.unknown = function (e) {
            return arguments.length ? ((n = e), i) : n;
          }),
          (i.copy = function () {
            return e(t).unknown(n);
          }),
          (t = arguments.length ? Array.from(t, Ykt) : [0, 1]),
          xEt(i)
        );
      },
      scaleImplicit: YSt,
      scaleLinear: wEt,
      scaleLog: function e() {
        const t = TEt(iEt()).domain([1, 10]);
        return ((t.copy = () => nEt(t, e()).base(t.base())), GSt.apply(t, arguments), t);
      },
      scaleOrdinal: XSt,
      scalePoint: ekt,
      scalePow: FEt,
      scaleQuantile: function e() {
        var t,
          n = [],
          i = [],
          r = [];
        function o() {
          var e = 0,
            t = Math.max(1, i.length);
          for (r = new Array(t - 1); ++e < t; ) r[e - 1] = KSt(n, e / t);
          return s;
        }
        function s(e) {
          return null == e || isNaN((e = +e)) ? t : i[ISt(r, e)];
        }
        return (
          (s.invertExtent = function (e) {
            var t = i.indexOf(e);
            return t < 0
              ? [NaN, NaN]
              : [t > 0 ? r[t - 1] : n[0], t < r.length ? r[t] : n[n.length - 1]];
          }),
          (s.domain = function (e) {
            if (!arguments.length) return n.slice();
            n = [];
            for (let t of e) null == t || isNaN((t = +t)) || n.push(t);
            return (n.sort(ESt), o());
          }),
          (s.range = function (e) {
            return arguments.length ? ((i = Array.from(e)), o()) : i.slice();
          }),
          (s.unknown = function (e) {
            return arguments.length ? ((t = e), s) : t;
          }),
          (s.quantiles = function () {
            return r.slice();
          }),
          (s.copy = function () {
            return e().domain(n).range(i).unknown(t);
          }),
          GSt.apply(s, arguments)
        );
      },
      scaleQuantize: function e() {
        var t,
          n = 0,
          i = 1,
          r = 1,
          o = [0.5],
          s = [0, 1];
        function a(e) {
          return null != e && e <= e ? s[ISt(o, e, 0, r)] : t;
        }
        function l() {
          var e = -1;
          for (o = new Array(r); ++e < r; ) o[e] = ((e + 1) * i - (e - r) * n) / (r + 1);
          return a;
        }
        return (
          (a.domain = function (e) {
            return arguments.length ? (([n, i] = e), (n = +n), (i = +i), l()) : [n, i];
          }),
          (a.range = function (e) {
            return arguments.length ? ((r = (s = Array.from(e)).length - 1), l()) : s.slice();
          }),
          (a.invertExtent = function (e) {
            var t = s.indexOf(e);
            return t < 0
              ? [NaN, NaN]
              : t < 1
                ? [n, o[0]]
                : t >= r
                  ? [o[r - 1], i]
                  : [o[t - 1], o[t]];
          }),
          (a.unknown = function (e) {
            return arguments.length ? ((t = e), a) : a;
          }),
          (a.thresholds = function () {
            return o.slice();
          }),
          (a.copy = function () {
            return e().domain([n, i]).range(s).unknown(t);
          }),
          GSt.apply(xEt(a), arguments)
        );
      },
      scaleRadial: function e() {
        var t,
          n = rEt(),
          i = [0, 1],
          r = !1;
        function o(e) {
          var i = (function (e) {
            return Math.sign(e) * Math.sqrt(Math.abs(e));
          })(n(e));
          return isNaN(i) ? t : r ? Math.round(i) : i;
        }
        return (
          (o.invert = function (e) {
            return n.invert(BEt(e));
          }),
          (o.domain = function (e) {
            return arguments.length ? (n.domain(e), o) : n.domain();
          }),
          (o.range = function (e) {
            return arguments.length ? (n.range((i = Array.from(e, Ykt)).map(BEt)), o) : i.slice();
          }),
          (o.rangeRound = function (e) {
            return o.range(e).round(!0);
          }),
          (o.round = function (e) {
            return arguments.length ? ((r = !!e), o) : r;
          }),
          (o.clamp = function (e) {
            return arguments.length ? (n.clamp(e), o) : n.clamp();
          }),
          (o.unknown = function (e) {
            return arguments.length ? ((t = e), o) : t;
          }),
          (o.copy = function () {
            return e(n.domain(), i).round(r).clamp(n.clamp()).unknown(t);
          }),
          GSt.apply(o, arguments),
          xEt(o)
        );
      },
      scaleSequential: function e() {
        var t = xEt(nDt()(Qkt));
        return (
          (t.copy = function () {
            return iDt(t, e());
          }),
          ZSt.apply(t, arguments)
        );
      },
      scaleSequentialLog: function e() {
        var t = TEt(nDt()).domain([1, 10]);
        return (
          (t.copy = function () {
            return iDt(t, e()).base(t.base());
          }),
          ZSt.apply(t, arguments)
        );
      },
      scaleSequentialPow: rDt,
      scaleSequentialQuantile: function e() {
        var t = [],
          n = Qkt;
        function i(e) {
          if (null != e && !isNaN((e = +e))) return n((ISt(t, e, 1) - 1) / (t.length - 1));
        }
        return (
          (i.domain = function (e) {
            if (!arguments.length) return t.slice();
            t = [];
            for (let n of e) null == n || isNaN((n = +n)) || t.push(n);
            return (t.sort(ESt), i);
          }),
          (i.interpolator = function (e) {
            return arguments.length ? ((n = e), i) : n;
          }),
          (i.range = function () {
            return t.map((e, i) => n(i / (t.length - 1)));
          }),
          (i.quantiles = function (e) {
            return Array.from({ length: e + 1 }, (n, i) =>
              (function (e, t) {
                if (
                  (n = (e = Float64Array.from(
                    (function* (e) {
                      for (let t of e) null != t && (t = +t) >= t && (yield t);
                    })(e),
                  )).length) &&
                  !isNaN((t = +t))
                ) {
                  if (t <= 0 || n < 2) return USt(e);
                  if (t >= 1) return zSt(e);
                  var n,
                    i = (n - 1) * t,
                    r = Math.floor(i),
                    o = zSt($St(e, r).subarray(0, r + 1));
                  return o + (USt(e.subarray(r + 1)) - o) * (i - r);
                }
              })(t, i / e),
            );
          }),
          (i.copy = function () {
            return e(n).domain(t);
          }),
          ZSt.apply(i, arguments)
        );
      },
      scaleSequentialSqrt: function () {
        return rDt.apply(null, arguments).exponent(0.5);
      },
      scaleSequentialSymlog: function e() {
        var t = OEt(nDt());
        return (
          (t.copy = function () {
            return iDt(t, e()).constant(t.constant());
          }),
          ZSt.apply(t, arguments)
        );
      },
      scaleSqrt: function () {
        return FEt.apply(null, arguments).exponent(0.5);
      },
      scaleSymlog: function e() {
        var t = OEt(iEt());
        return (
          (t.copy = function () {
            return nEt(t, e()).constant(t.constant());
          }),
          GSt.apply(t, arguments)
        );
      },
      scaleThreshold: function e() {
        var t,
          n = [0.5],
          i = [0, 1],
          r = 1;
        function o(e) {
          return null != e && e <= e ? i[ISt(n, e, 0, r)] : t;
        }
        return (
          (o.domain = function (e) {
            return arguments.length
              ? ((n = Array.from(e)), (r = Math.min(n.length, i.length - 1)), o)
              : n.slice();
          }),
          (o.range = function (e) {
            return arguments.length
              ? ((i = Array.from(e)), (r = Math.min(n.length, i.length - 1)), o)
              : i.slice();
          }),
          (o.invertExtent = function (e) {
            var t = i.indexOf(e);
            return [n[t - 1], n[t]];
          }),
          (o.unknown = function (e) {
            return arguments.length ? ((t = e), o) : t;
          }),
          (o.copy = function () {
            return e().domain(n).range(i).unknown(t);
          }),
          GSt.apply(o, arguments)
        );
      },
      scaleTime: function () {
        return GSt.apply(
          tDt(LNt, DNt, CNt, xNt, sNt, nNt, eNt, QEt, XEt, MNt).domain([
            new Date(2e3, 0, 1),
            new Date(2e3, 0, 2),
          ]),
          arguments,
        );
      },
      scaleUtc: function () {
        return GSt.apply(
          tDt(ENt, NNt, SNt, wNt, pNt, iNt, tNt, JEt, XEt, ANt).domain([
            Date.UTC(2e3, 0, 1),
            Date.UTC(2e3, 0, 2),
          ]),
          arguments,
        );
      },
      tickFormat: yEt,
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
var lDt = But;
var cDt = function (e, t, n) {
  for (var i = -1, r = e.length; ++i < r; ) {
    var o = e[i],
      s = t(o);
    if (null != s && (void 0 === a ? s == s && !lDt(s) : n(s, a)))
      var a = s,
        l = o;
  }
  return l;
};
var dDt = cDt,
  uDt = function (e, t) {
    return e > t;
  },
  hDt = Eyt;
var gDt = function (e) {
  return e && e.length ? dDt(e, hDt, uDt) : void 0;
};
const pDt = n(gDt);
var fDt = cDt,
  mDt = function (e, t) {
    return e < t;
  },
  _Dt = Eyt;
var vDt = function (e) {
  return e && e.length ? fDt(e, _Dt, mDt) : void 0;
};
const bDt = n(vDt);
var yDt = Ngt,
  xDt = Vyt,
  wDt = Vxt,
  CDt = but;
var SDt = Txt,
  kDt = function (e, t) {
    return (CDt(e) ? yDt : wDt)(e, xDt(t));
  };
const EDt = n(function (e, t) {
  return SDt(kDt(e, t), 1);
});
var NDt = Kbt;
const LDt = n(function (e, t) {
  return NDt(e, t);
});
var DDt,
  TDt = 1e9,
  IDt = !0,
  RDt = "[DecimalError] ",
  ODt = RDt + "Invalid argument: ",
  MDt = RDt + "Exponent out of range: ",
  ADt = Math.floor,
  PDt = Math.pow,
  jDt = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
  FDt = 1e7,
  BDt = 9007199254740991,
  VDt = ADt(1286742750677284.5),
  WDt = {};
function HDt(e, t) {
  var n,
    i,
    r,
    o,
    s,
    a,
    l,
    c,
    d = e.constructor,
    u = d.precision;
  if (!e.s || !t.s) return (t.s || (t = new d(e)), IDt ? QDt(t, u) : t);
  if (((l = e.d), (c = t.d), (s = e.e), (r = t.e), (l = l.slice()), (o = s - r))) {
    for (
      o < 0 ? ((i = l), (o = -o), (a = c.length)) : ((i = c), (r = s), (a = l.length)),
        o > (a = (s = Math.ceil(u / 7)) > a ? s + 1 : a + 1) && ((o = a), (i.length = 1)),
        i.reverse();
      o--;
    )
      i.push(0);
    i.reverse();
  }
  for ((a = l.length) - (o = c.length) < 0 && ((o = a), (i = c), (c = l), (l = i)), n = 0; o; )
    ((n = ((l[--o] = l[o] + c[o] + n) / FDt) | 0), (l[o] %= FDt));
  for (n && (l.unshift(n), ++r), a = l.length; 0 == l[--a]; ) l.pop();
  return ((t.d = l), (t.e = r), IDt ? QDt(t, u) : t);
}
function zDt(e, t, n) {
  if (e !== ~~e || e < t || e > n) throw Error(ODt + e);
}
function UDt(e) {
  var t,
    n,
    i,
    r = e.length - 1,
    o = "",
    s = e[0];
  if (r > 0) {
    for (o += s, t = 1; t < r; t++) ((n = 7 - (i = e[t] + "").length) && (o += ZDt(n)), (o += i));
    (n = 7 - (i = (s = e[t]) + "").length) && (o += ZDt(n));
  } else if (0 === s) return "0";
  for (; s % 10 == 0; ) s /= 10;
  return o + s;
}
((WDt.absoluteValue = WDt.abs =
  function () {
    var e = new this.constructor(this);
    return (e.s && (e.s = 1), e);
  }),
  (WDt.comparedTo = WDt.cmp =
    function (e) {
      var t,
        n,
        i,
        r,
        o = this;
      if (((e = new o.constructor(e)), o.s !== e.s)) return o.s || -e.s;
      if (o.e !== e.e) return (o.e > e.e) ^ (o.s < 0) ? 1 : -1;
      for (t = 0, n = (i = o.d.length) < (r = e.d.length) ? i : r; t < n; ++t)
        if (o.d[t] !== e.d[t]) return (o.d[t] > e.d[t]) ^ (o.s < 0) ? 1 : -1;
      return i === r ? 0 : (i > r) ^ (o.s < 0) ? 1 : -1;
    }),
  (WDt.decimalPlaces = WDt.dp =
    function () {
      var e = this,
        t = e.d.length - 1,
        n = 7 * (t - e.e);
      if ((t = e.d[t])) for (; t % 10 == 0; t /= 10) n--;
      return n < 0 ? 0 : n;
    }),
  (WDt.dividedBy = WDt.div =
    function (e) {
      return $Dt(this, new this.constructor(e));
    }),
  (WDt.dividedToIntegerBy = WDt.idiv =
    function (e) {
      var t = this.constructor;
      return QDt($Dt(this, new t(e), 0, 1), t.precision);
    }),
  (WDt.equals = WDt.eq =
    function (e) {
      return !this.cmp(e);
    }),
  (WDt.exponent = function () {
    return KDt(this);
  }),
  (WDt.greaterThan = WDt.gt =
    function (e) {
      return this.cmp(e) > 0;
    }),
  (WDt.greaterThanOrEqualTo = WDt.gte =
    function (e) {
      return this.cmp(e) >= 0;
    }),
  (WDt.isInteger = WDt.isint =
    function () {
      return this.e > this.d.length - 2;
    }),
  (WDt.isNegative = WDt.isneg =
    function () {
      return this.s < 0;
    }),
  (WDt.isPositive = WDt.ispos =
    function () {
      return this.s > 0;
    }),
  (WDt.isZero = function () {
    return 0 === this.s;
  }),
  (WDt.lessThan = WDt.lt =
    function (e) {
      return this.cmp(e) < 0;
    }),
  (WDt.lessThanOrEqualTo = WDt.lte =
    function (e) {
      return this.cmp(e) < 1;
    }),
  (WDt.logarithm = WDt.log =
    function (e) {
      var t,
        n = this,
        i = n.constructor,
        r = i.precision,
        o = r + 5;
      if (void 0 === e) e = new i(10);
      else if ((e = new i(e)).s < 1 || e.eq(DDt)) throw Error(RDt + "NaN");
      if (n.s < 1) throw Error(RDt + (n.s ? "NaN" : "-Infinity"));
      return n.eq(DDt)
        ? new i(0)
        : ((IDt = !1), (t = $Dt(YDt(n, o), YDt(e, o), o)), (IDt = !0), QDt(t, r));
    }),
  (WDt.minus = WDt.sub =
    function (e) {
      var t = this;
      return ((e = new t.constructor(e)), t.s == e.s ? JDt(t, e) : HDt(t, ((e.s = -e.s), e)));
    }),
  (WDt.modulo = WDt.mod =
    function (e) {
      var t,
        n = this,
        i = n.constructor,
        r = i.precision;
      if (!(e = new i(e)).s) throw Error(RDt + "NaN");
      return n.s
        ? ((IDt = !1), (t = $Dt(n, e, 0, 1).times(e)), (IDt = !0), n.minus(t))
        : QDt(new i(n), r);
    }),
  (WDt.naturalExponential = WDt.exp =
    function () {
      return qDt(this);
    }),
  (WDt.naturalLogarithm = WDt.ln =
    function () {
      return YDt(this);
    }),
  (WDt.negated = WDt.neg =
    function () {
      var e = new this.constructor(this);
      return ((e.s = -e.s || 0), e);
    }),
  (WDt.plus = WDt.add =
    function (e) {
      var t = this;
      return ((e = new t.constructor(e)), t.s == e.s ? HDt(t, e) : JDt(t, ((e.s = -e.s), e)));
    }),
  (WDt.precision = WDt.sd =
    function (e) {
      var t,
        n,
        i,
        r = this;
      if (void 0 !== e && e !== !!e && 1 !== e && 0 !== e) throw Error(ODt + e);
      if (((t = KDt(r) + 1), (n = 7 * (i = r.d.length - 1) + 1), (i = r.d[i]))) {
        for (; i % 10 == 0; i /= 10) n--;
        for (i = r.d[0]; i >= 10; i /= 10) n++;
      }
      return e && t > n ? t : n;
    }),
  (WDt.squareRoot = WDt.sqrt =
    function () {
      var e,
        t,
        n,
        i,
        r,
        o,
        s,
        a = this,
        l = a.constructor;
      if (a.s < 1) {
        if (!a.s) return new l(0);
        throw Error(RDt + "NaN");
      }
      for (
        e = KDt(a),
          IDt = !1,
          0 == (r = Math.sqrt(+a)) || r == 1 / 0
            ? (((t = UDt(a.d)).length + e) % 2 == 0 && (t += "0"),
              (r = Math.sqrt(t)),
              (e = ADt((e + 1) / 2) - (e < 0 || e % 2)),
              (i = new l(
                (t =
                  r == 1 / 0 ? "5e" + e : (t = r.toExponential()).slice(0, t.indexOf("e") + 1) + e),
              )))
            : (i = new l(r.toString())),
          r = s = (n = l.precision) + 3;
        ;
      )
        if (
          ((i = (o = i).plus($Dt(a, o, s + 2)).times(0.5)),
          UDt(o.d).slice(0, s) === (t = UDt(i.d)).slice(0, s))
        ) {
          if (((t = t.slice(s - 3, s + 1)), r == s && "4999" == t)) {
            if ((QDt(o, n + 1, 0), o.times(o).eq(a))) {
              i = o;
              break;
            }
          } else if ("9999" != t) break;
          s += 4;
        }
      return ((IDt = !0), QDt(i, n));
    }),
  (WDt.times = WDt.mul =
    function (e) {
      var t,
        n,
        i,
        r,
        o,
        s,
        a,
        l,
        c,
        d = this,
        u = d.constructor,
        h = d.d,
        g = (e = new u(e)).d;
      if (!d.s || !e.s) return new u(0);
      for (
        e.s *= d.s,
          n = d.e + e.e,
          (l = h.length) < (c = g.length) && ((o = h), (h = g), (g = o), (s = l), (l = c), (c = s)),
          o = [],
          i = s = l + c;
        i--;
      )
        o.push(0);
      for (i = c; --i >= 0; ) {
        for (t = 0, r = l + i; r > i; )
          ((a = o[r] + g[i] * h[r - i - 1] + t), (o[r--] = (a % FDt) | 0), (t = (a / FDt) | 0));
        o[r] = ((o[r] + t) % FDt) | 0;
      }
      for (; !o[--s]; ) o.pop();
      return (t ? ++n : o.shift(), (e.d = o), (e.e = n), IDt ? QDt(e, u.precision) : e);
    }),
  (WDt.toDecimalPlaces = WDt.todp =
    function (e, t) {
      var n = this,
        i = n.constructor;
      return (
        (n = new i(n)),
        void 0 === e
          ? n
          : (zDt(e, 0, TDt),
            void 0 === t ? (t = i.rounding) : zDt(t, 0, 8),
            QDt(n, e + KDt(n) + 1, t))
      );
    }),
  (WDt.toExponential = function (e, t) {
    var n,
      i = this,
      r = i.constructor;
    return (
      void 0 === e
        ? (n = eTt(i, !0))
        : (zDt(e, 0, TDt),
          void 0 === t ? (t = r.rounding) : zDt(t, 0, 8),
          (n = eTt((i = QDt(new r(i), e + 1, t)), !0, e + 1))),
      n
    );
  }),
  (WDt.toFixed = function (e, t) {
    var n,
      i,
      r = this,
      o = r.constructor;
    return void 0 === e
      ? eTt(r)
      : (zDt(e, 0, TDt),
        void 0 === t ? (t = o.rounding) : zDt(t, 0, 8),
        (n = eTt((i = QDt(new o(r), e + KDt(r) + 1, t)).abs(), !1, e + KDt(i) + 1)),
        r.isneg() && !r.isZero() ? "-" + n : n);
  }),
  (WDt.toInteger = WDt.toint =
    function () {
      var e = this,
        t = e.constructor;
      return QDt(new t(e), KDt(e) + 1, t.rounding);
    }),
  (WDt.toNumber = function () {
    return +this;
  }),
  (WDt.toPower = WDt.pow =
    function (e) {
      var t,
        n,
        i,
        r,
        o,
        s,
        a = this,
        l = a.constructor,
        c = +(e = new l(e));
      if (!e.s) return new l(DDt);
      if (!(a = new l(a)).s) {
        if (e.s < 1) throw Error(RDt + "Infinity");
        return a;
      }
      if (a.eq(DDt)) return a;
      if (((i = l.precision), e.eq(DDt))) return QDt(a, i);
      if (((s = (t = e.e) >= (n = e.d.length - 1)), (o = a.s), s)) {
        if ((n = c < 0 ? -c : c) <= BDt) {
          for (
            r = new l(DDt), t = Math.ceil(i / 7 + 4), IDt = !1;
            n % 2 && tTt((r = r.times(a)).d, t), 0 !== (n = ADt(n / 2));
          )
            tTt((a = a.times(a)).d, t);
          return ((IDt = !0), e.s < 0 ? new l(DDt).div(r) : QDt(r, i));
        }
      } else if (o < 0) throw Error(RDt + "NaN");
      return (
        (o = o < 0 && 1 & e.d[Math.max(t, n)] ? -1 : 1),
        (a.s = 1),
        (IDt = !1),
        (r = e.times(YDt(a, i + 12))),
        (IDt = !0),
        ((r = qDt(r)).s = o),
        r
      );
    }),
  (WDt.toPrecision = function (e, t) {
    var n,
      i,
      r = this,
      o = r.constructor;
    return (
      void 0 === e
        ? (i = eTt(r, (n = KDt(r)) <= o.toExpNeg || n >= o.toExpPos))
        : (zDt(e, 1, TDt),
          void 0 === t ? (t = o.rounding) : zDt(t, 0, 8),
          (i = eTt((r = QDt(new o(r), e, t)), e <= (n = KDt(r)) || n <= o.toExpNeg, e))),
      i
    );
  }),
  (WDt.toSignificantDigits = WDt.tosd =
    function (e, t) {
      var n = this.constructor;
      return (
        void 0 === e
          ? ((e = n.precision), (t = n.rounding))
          : (zDt(e, 1, TDt), void 0 === t ? (t = n.rounding) : zDt(t, 0, 8)),
        QDt(new n(this), e, t)
      );
    }),
  (WDt.toString =
    WDt.valueOf =
    WDt.val =
    WDt.toJSON =
    WDt[Symbol.for("nodejs.util.inspect.custom")] =
      function () {
        var e = this,
          t = KDt(e),
          n = e.constructor;
        return eTt(e, t <= n.toExpNeg || t >= n.toExpPos);
      }));
var $Dt = (function () {
  function e(e, t) {
    var n,
      i = 0,
      r = e.length;
    for (e = e.slice(); r--; ) ((n = e[r] * t + i), (e[r] = (n % FDt) | 0), (i = (n / FDt) | 0));
    return (i && e.unshift(i), e);
  }
  function t(e, t, n, i) {
    var r, o;
    if (n != i) o = n > i ? 1 : -1;
    else
      for (r = o = 0; r < n; r++)
        if (e[r] != t[r]) {
          o = e[r] > t[r] ? 1 : -1;
          break;
        }
    return o;
  }
  function n(e, t, n) {
    for (var i = 0; n--; ) ((e[n] -= i), (i = e[n] < t[n] ? 1 : 0), (e[n] = i * FDt + e[n] - t[n]));
    for (; !e[0] && e.length > 1; ) e.shift();
  }
  return function (i, r, o, s) {
    var a,
      l,
      c,
      d,
      u,
      h,
      g,
      p,
      f,
      m,
      _,
      v,
      b,
      y,
      x,
      w,
      C,
      S,
      k = i.constructor,
      E = i.s == r.s ? 1 : -1,
      N = i.d,
      L = r.d;
    if (!i.s) return new k(i);
    if (!r.s) throw Error(RDt + "Division by zero");
    for (
      l = i.e - r.e, C = L.length, x = N.length, p = (g = new k(E)).d = [], c = 0;
      L[c] == (N[c] || 0);
    )
      ++c;
    if (
      (L[c] > (N[c] || 0) && --l,
      (v = null == o ? (o = k.precision) : s ? o + (KDt(i) - KDt(r)) + 1 : o) < 0)
    )
      return new k(0);
    if (((v = (v / 7 + 2) | 0), (c = 0), 1 == C))
      for (d = 0, L = L[0], v++; (c < x || d) && v--; c++)
        ((b = d * FDt + (N[c] || 0)), (p[c] = (b / L) | 0), (d = (b % L) | 0));
    else {
      for (
        (d = (FDt / (L[0] + 1)) | 0) > 1 &&
          ((L = e(L, d)), (N = e(N, d)), (C = L.length), (x = N.length)),
          y = C,
          m = (f = N.slice(0, C)).length;
        m < C;
      )
        f[m++] = 0;
      ((S = L.slice()).unshift(0), (w = L[0]), L[1] >= FDt / 2 && ++w);
      do {
        ((d = 0),
          (a = t(L, f, C, m)) < 0
            ? ((_ = f[0]),
              C != m && (_ = _ * FDt + (f[1] || 0)),
              (d = (_ / w) | 0) > 1
                ? (d >= FDt && (d = FDt - 1),
                  1 == (a = t((u = e(L, d)), f, (h = u.length), (m = f.length))) &&
                    (d--, n(u, C < h ? S : L, h)))
                : (0 == d && (a = d = 1), (u = L.slice())),
              (h = u.length) < m && u.unshift(0),
              n(f, u, m),
              -1 == a && (a = t(L, f, C, (m = f.length))) < 1 && (d++, n(f, C < m ? S : L, m)),
              (m = f.length))
            : 0 === a && (d++, (f = [0])),
          (p[c++] = d),
          a && f[0] ? (f[m++] = N[y] || 0) : ((f = [N[y]]), (m = 1)));
      } while ((y++ < x || void 0 !== f[0]) && v--);
    }
    return (p[0] || p.shift(), (g.e = l), QDt(g, s ? o + KDt(g) + 1 : o));
  };
})();
function qDt(e, t) {
  var n,
    i,
    r,
    o,
    s,
    a = 0,
    l = 0,
    c = e.constructor,
    d = c.precision;
  if (KDt(e) > 16) throw Error(MDt + KDt(e));
  if (!e.s) return new c(DDt);
  for (IDt = !1, s = d, o = new c(0.03125); e.abs().gte(0.1); ) ((e = e.times(o)), (l += 5));
  for (
    s += ((Math.log(PDt(2, l)) / Math.LN10) * 2 + 5) | 0, n = i = r = new c(DDt), c.precision = s;
    ;
  ) {
    if (
      ((i = QDt(i.times(e), s)),
      (n = n.times(++a)),
      UDt((o = r.plus($Dt(i, n, s))).d).slice(0, s) === UDt(r.d).slice(0, s))
    ) {
      for (; l--; ) r = QDt(r.times(r), s);
      return ((c.precision = d), null == t ? ((IDt = !0), QDt(r, d)) : r);
    }
    r = o;
  }
}
function KDt(e) {
  for (var t = 7 * e.e, n = e.d[0]; n >= 10; n /= 10) t++;
  return t;
}
function GDt(e, t, n) {
  if (t > e.LN10.sd())
    throw ((IDt = !0), n && (e.precision = n), Error(RDt + "LN10 precision limit exceeded"));
  return QDt(new e(e.LN10), t);
}
function ZDt(e) {
  for (var t = ""; e--; ) t += "0";
  return t;
}
function YDt(e, t) {
  var n,
    i,
    r,
    o,
    s,
    a,
    l,
    c,
    d,
    u = 1,
    h = e,
    g = h.d,
    p = h.constructor,
    f = p.precision;
  if (h.s < 1) throw Error(RDt + (h.s ? "NaN" : "-Infinity"));
  if (h.eq(DDt)) return new p(0);
  if ((null == t ? ((IDt = !1), (c = f)) : (c = t), h.eq(10)))
    return (null == t && (IDt = !0), GDt(p, c));
  if (
    ((c += 10),
    (p.precision = c),
    (i = (n = UDt(g)).charAt(0)),
    (o = KDt(h)),
    !(Math.abs(o) < 15e14))
  )
    return (
      (l = GDt(p, c + 2, f).times(o + "")),
      (h = YDt(new p(i + "." + n.slice(1)), c - 10).plus(l)),
      (p.precision = f),
      null == t ? ((IDt = !0), QDt(h, f)) : h
    );
  for (; (i < 7 && 1 != i) || (1 == i && n.charAt(1) > 3); )
    ((i = (n = UDt((h = h.times(e)).d)).charAt(0)), u++);
  for (
    o = KDt(h),
      i > 1 ? ((h = new p("0." + n)), o++) : (h = new p(i + "." + n.slice(1))),
      a = s = h = $Dt(h.minus(DDt), h.plus(DDt), c),
      d = QDt(h.times(h), c),
      r = 3;
    ;
  ) {
    if (
      ((s = QDt(s.times(d), c)),
      UDt((l = a.plus($Dt(s, new p(r), c))).d).slice(0, c) === UDt(a.d).slice(0, c))
    )
      return (
        (a = a.times(2)),
        0 !== o && (a = a.plus(GDt(p, c + 2, f).times(o + ""))),
        (a = $Dt(a, new p(u), c)),
        (p.precision = f),
        null == t ? ((IDt = !0), QDt(a, f)) : a
      );
    ((a = l), (r += 2));
  }
}
function XDt(e, t) {
  var n, i, r;
  for (
    (n = t.indexOf(".")) > -1 && (t = t.replace(".", "")),
      (i = t.search(/e/i)) > 0
        ? (n < 0 && (n = i), (n += +t.slice(i + 1)), (t = t.substring(0, i)))
        : n < 0 && (n = t.length),
      i = 0;
    48 === t.charCodeAt(i);
  )
    ++i;
  for (r = t.length; 48 === t.charCodeAt(r - 1); ) --r;
  if ((t = t.slice(i, r))) {
    if (
      ((r -= i),
      (n = n - i - 1),
      (e.e = ADt(n / 7)),
      (e.d = []),
      (i = (n + 1) % 7),
      n < 0 && (i += 7),
      i < r)
    ) {
      for (i && e.d.push(+t.slice(0, i)), r -= 7; i < r; ) e.d.push(+t.slice(i, (i += 7)));
      i = 7 - (t = t.slice(i)).length;
    } else i -= r;
    for (; i--; ) t += "0";
    if ((e.d.push(+t), IDt && (e.e > VDt || e.e < -VDt))) throw Error(MDt + n);
  } else ((e.s = 0), (e.e = 0), (e.d = [0]));
  return e;
}
function QDt(e, t, n) {
  var i,
    r,
    o,
    s,
    a,
    l,
    c,
    d,
    u = e.d;
  for (s = 1, o = u[0]; o >= 10; o /= 10) s++;
  if ((i = t - s) < 0) ((i += 7), (r = t), (c = u[(d = 0)]));
  else {
    if ((d = Math.ceil((i + 1) / 7)) >= (o = u.length)) return e;
    for (c = o = u[d], s = 1; o >= 10; o /= 10) s++;
    r = (i %= 7) - 7 + s;
  }
  if (
    (void 0 !== n &&
      ((a = ((c / (o = PDt(10, s - r - 1))) % 10) | 0),
      (l = t < 0 || void 0 !== u[d + 1] || c % o),
      (l =
        n < 4
          ? (a || l) && (0 == n || n == (e.s < 0 ? 3 : 2))
          : a > 5 ||
            (5 == a &&
              (4 == n ||
                l ||
                (6 == n && ((i > 0 ? (r > 0 ? c / PDt(10, s - r) : 0) : u[d - 1]) % 10) & 1) ||
                n == (e.s < 0 ? 8 : 7))))),
    t < 1 || !u[0])
  )
    return (
      l
        ? ((o = KDt(e)),
          (u.length = 1),
          (t = t - o - 1),
          (u[0] = PDt(10, (7 - (t % 7)) % 7)),
          (e.e = ADt(-t / 7) || 0))
        : ((u.length = 1), (u[0] = e.e = e.s = 0)),
      e
    );
  if (
    (0 == i
      ? ((u.length = d), (o = 1), d--)
      : ((u.length = d + 1),
        (o = PDt(10, 7 - i)),
        (u[d] = r > 0 ? (((c / PDt(10, s - r)) % PDt(10, r)) | 0) * o : 0)),
    l)
  )
    for (;;) {
      if (0 == d) {
        (u[0] += o) == FDt && ((u[0] = 1), ++e.e);
        break;
      }
      if (((u[d] += o), u[d] != FDt)) break;
      ((u[d--] = 0), (o = 1));
    }
  for (i = u.length; 0 === u[--i]; ) u.pop();
  if (IDt && (e.e > VDt || e.e < -VDt)) throw Error(MDt + KDt(e));
  return e;
}
function JDt(e, t) {
  var n,
    i,
    r,
    o,
    s,
    a,
    l,
    c,
    d,
    u,
    h = e.constructor,
    g = h.precision;
  if (!e.s || !t.s) return (t.s ? (t.s = -t.s) : (t = new h(e)), IDt ? QDt(t, g) : t);
  if (((l = e.d), (u = t.d), (i = t.e), (c = e.e), (l = l.slice()), (s = c - i))) {
    for (
      (d = s < 0) ? ((n = l), (s = -s), (a = u.length)) : ((n = u), (i = c), (a = l.length)),
        s > (r = Math.max(Math.ceil(g / 7), a) + 2) && ((s = r), (n.length = 1)),
        n.reverse(),
        r = s;
      r--;
    )
      n.push(0);
    n.reverse();
  } else {
    for ((d = (r = l.length) < (a = u.length)) && (a = r), r = 0; r < a; r++)
      if (l[r] != u[r]) {
        d = l[r] < u[r];
        break;
      }
    s = 0;
  }
  for (d && ((n = l), (l = u), (u = n), (t.s = -t.s)), a = l.length, r = u.length - a; r > 0; --r)
    l[a++] = 0;
  for (r = u.length; r > s; ) {
    if (l[--r] < u[r]) {
      for (o = r; o && 0 === l[--o]; ) l[o] = FDt - 1;
      (--l[o], (l[r] += FDt));
    }
    l[r] -= u[r];
  }
  for (; 0 === l[--a]; ) l.pop();
  for (; 0 === l[0]; l.shift()) --i;
  return l[0] ? ((t.d = l), (t.e = i), IDt ? QDt(t, g) : t) : new h(0);
}
function eTt(e, t, n) {
  var i,
    r = KDt(e),
    o = UDt(e.d),
    s = o.length;
  return (
    t
      ? (n && (i = n - s) > 0
          ? (o = o.charAt(0) + "." + o.slice(1) + ZDt(i))
          : s > 1 && (o = o.charAt(0) + "." + o.slice(1)),
        (o = o + (r < 0 ? "e" : "e+") + r))
      : r < 0
        ? ((o = "0." + ZDt(-r - 1) + o), n && (i = n - s) > 0 && (o += ZDt(i)))
        : r >= s
          ? ((o += ZDt(r + 1 - s)), n && (i = n - r - 1) > 0 && (o = o + "." + ZDt(i)))
          : ((i = r + 1) < s && (o = o.slice(0, i) + "." + o.slice(i)),
            n && (i = n - s) > 0 && (r + 1 === s && (o += "."), (o += ZDt(i)))),
    e.s < 0 ? "-" + o : o
  );
}
function tTt(e, t) {
  if (e.length > t) return ((e.length = t), !0);
}
function nTt(e) {
  if (!e || "object" != typeof e) throw Error(RDt + "Object expected");
  var t,
    n,
    i,
    r = ["precision", 1, TDt, "rounding", 0, 8, "toExpNeg", -1 / 0, 0, "toExpPos", 0, 1 / 0];
  for (t = 0; t < r.length; t += 3)
    if (void 0 !== (i = e[(n = r[t])])) {
      if (!(ADt(i) === i && i >= r[t + 1] && i <= r[t + 2])) throw Error(ODt + n + ": " + i);
      this[n] = i;
    }
  if (void 0 !== (i = e[(n = "LN10")])) {
    if (i != Math.LN10) throw Error(ODt + n + ": " + i);
    this[n] = new this(i);
  }
  return this;
}
var iTt = (function e(t) {
  var n, i, r;
  function o(e) {
    var t = this;
    if (!(t instanceof o)) return new o(e);
    if (((t.constructor = o), e instanceof o))
      return ((t.s = e.s), (t.e = e.e), void (t.d = (e = e.d) ? e.slice() : e));
    if ("number" == typeof e) {
      if (0 * e != 0) throw Error(ODt + e);
      if (e > 0) t.s = 1;
      else {
        if (!(e < 0)) return ((t.s = 0), (t.e = 0), void (t.d = [0]));
        ((e = -e), (t.s = -1));
      }
      return e === ~~e && e < 1e7 ? ((t.e = 0), void (t.d = [e])) : XDt(t, e.toString());
    }
    if ("string" != typeof e) throw Error(ODt + e);
    if ((45 === e.charCodeAt(0) ? ((e = e.slice(1)), (t.s = -1)) : (t.s = 1), !jDt.test(e)))
      throw Error(ODt + e);
    XDt(t, e);
  }
  if (
    ((o.prototype = WDt),
    (o.ROUND_UP = 0),
    (o.ROUND_DOWN = 1),
    (o.ROUND_CEIL = 2),
    (o.ROUND_FLOOR = 3),
    (o.ROUND_HALF_UP = 4),
    (o.ROUND_HALF_DOWN = 5),
    (o.ROUND_HALF_EVEN = 6),
    (o.ROUND_HALF_CEIL = 7),
    (o.ROUND_HALF_FLOOR = 8),
    (o.clone = e),
    (o.config = o.set = nTt),
    void 0 === t && (t = {}),
    t)
  )
    for (r = ["precision", "rounding", "toExpNeg", "toExpPos", "LN10"], n = 0; n < r.length; )
      t.hasOwnProperty((i = r[n++])) || (t[i] = this[i]);
  return (o.config(t), o);
})({
  precision: 20,
  rounding: 4,
  toExpNeg: -7,
  toExpPos: 21,
  LN10: "2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286",
});
DDt = new iTt(1);
const rTt = iTt;
function oTt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return sTt(e);
    })(e) ||
    (function (e) {
      if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e);
    })(e) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return sTt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return sTt(e, t);
    })(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function sTt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
var aTt = function (e) {
    return e;
  },
  lTt = {},
  cTt = function (e) {
    return e === lTt;
  },
  dTt = function (e) {
    return function t() {
      return 0 === arguments.length ||
        (1 === arguments.length && cTt(arguments.length <= 0 ? void 0 : arguments[0]))
        ? t
        : e.apply(void 0, arguments);
    };
  },
  uTt = function e(t, n) {
    return 1 === t
      ? n
      : dTt(function () {
          for (var i = arguments.length, r = new Array(i), o = 0; o < i; o++) r[o] = arguments[o];
          var s = r.filter(function (e) {
            return e !== lTt;
          }).length;
          return s >= t
            ? n.apply(void 0, r)
            : e(
                t - s,
                dTt(function () {
                  for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
                    t[i] = arguments[i];
                  var o = r.map(function (e) {
                    return cTt(e) ? t.shift() : e;
                  });
                  return n.apply(void 0, oTt(o).concat(t));
                }),
              );
        });
  },
  hTt = function (e) {
    return uTt(e.length, e);
  },
  gTt = function (e, t) {
    for (var n = [], i = e; i < t; ++i) n[i - e] = i;
    return n;
  },
  pTt = hTt(function (e, t) {
    return Array.isArray(t)
      ? t.map(e)
      : Object.keys(t)
          .map(function (e) {
            return t[e];
          })
          .map(e);
  }),
  fTt = function (e) {
    return Array.isArray(e) ? e.reverse() : e.split("").reverse.join("");
  },
  mTt = function (e) {
    var t = null,
      n = null;
    return function () {
      for (var i = arguments.length, r = new Array(i), o = 0; o < i; o++) r[o] = arguments[o];
      return t &&
        r.every(function (e, n) {
          return e === t[n];
        })
        ? n
        : ((t = r), (n = e.apply(void 0, r)));
    };
  };
var _Tt = hTt(function (e, t, n) {
    var i = +e;
    return i + n * (+t - i);
  }),
  vTt = hTt(function (e, t, n) {
    var i = t - +e;
    return (n - e) / (i = i || 1 / 0);
  }),
  bTt = hTt(function (e, t, n) {
    var i = t - +e;
    return ((i = i || 1 / 0), Math.max(0, Math.min(1, (n - e) / i)));
  });
const yTt = {
  rangeStep: function (e, t, n) {
    for (var i = new rTt(e), r = 0, o = []; i.lt(t) && r < 1e5; )
      (o.push(i.toNumber()), (i = i.add(n)), r++);
    return o;
  },
  getDigitCount: function (e) {
    return 0 === e ? 1 : Math.floor(new rTt(e).abs().log(10).toNumber()) + 1;
  },
  interpolateNumber: _Tt,
  uninterpolateNumber: vTt,
  uninterpolateTruncation: bTt,
};
function xTt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return STt(e);
    })(e) ||
    (function (e) {
      if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e);
    })(e) ||
    CTt(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function wTt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      if ("undefined" == typeof Symbol || !(Symbol.iterator in Object(e))) return;
      var n = [],
        i = !0,
        r = !1,
        o = void 0;
      try {
        for (
          var s, a = e[Symbol.iterator]();
          !(i = (s = a.next()).done) && (n.push(s.value), !t || n.length !== t);
          i = !0
        );
      } catch (W8t) {
        ((r = !0), (o = W8t));
      } finally {
        try {
          i || null == a.return || a.return();
        } finally {
          if (r) throw o;
        }
      }
      return n;
    })(e, t) ||
    CTt(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function CTt(e, t) {
  if (e) {
    if ("string" == typeof e) return STt(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    return (
      "Object" === n && e.constructor && (n = e.constructor.name),
      "Map" === n || "Set" === n
        ? Array.from(e)
        : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
          ? STt(e, t)
          : void 0
    );
  }
}
function STt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function kTt(e) {
  var t = wTt(e, 2),
    n = t[0],
    i = t[1],
    r = n,
    o = i;
  return (n > i && ((r = i), (o = n)), [r, o]);
}
function ETt(e, t, n) {
  if (e.lte(0)) return new rTt(0);
  var i = yTt.getDigitCount(e.toNumber()),
    r = new rTt(10).pow(i),
    o = e.div(r),
    s = 1 !== i ? 0.05 : 0.1,
    a = new rTt(Math.ceil(o.div(s).toNumber())).add(n).mul(s).mul(r);
  return t ? a : new rTt(Math.ceil(a));
}
function NTt(e, t, n) {
  var i = 1,
    r = new rTt(e);
  if (!r.isint() && n) {
    var o = Math.abs(e);
    o < 1
      ? ((i = new rTt(10).pow(yTt.getDigitCount(e) - 1)),
        (r = new rTt(Math.floor(r.div(i).toNumber())).mul(i)))
      : o > 1 && (r = new rTt(Math.floor(e)));
  } else 0 === e ? (r = new rTt(Math.floor((t - 1) / 2))) : n || (r = new rTt(Math.floor(e)));
  var s = Math.floor((t - 1) / 2),
    a = (function () {
      for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
      if (!t.length) return aTt;
      var i = t.reverse(),
        r = i[0],
        o = i.slice(1);
      return function () {
        return o.reduce(
          function (e, t) {
            return t(e);
          },
          r.apply(void 0, arguments),
        );
      };
    })(
      pTt(function (e) {
        return r.add(new rTt(e - s).mul(i)).toNumber();
      }),
      gTt,
    );
  return a(0, t);
}
function LTt(e, t, n, i) {
  var r = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0;
  if (!Number.isFinite((t - e) / (n - 1)))
    return { step: new rTt(0), tickMin: new rTt(0), tickMax: new rTt(0) };
  var o,
    s = ETt(new rTt(t).sub(e).div(n - 1), i, r);
  o = e <= 0 && t >= 0 ? new rTt(0) : (o = new rTt(e).add(t).div(2)).sub(new rTt(o).mod(s));
  var a = Math.ceil(o.sub(e).div(s).toNumber()),
    l = Math.ceil(new rTt(t).sub(o).div(s).toNumber()),
    c = a + l + 1;
  return c > n
    ? LTt(e, t, n, i, r + 1)
    : (c < n && ((l = t > 0 ? l + (n - c) : l), (a = t > 0 ? a : a + (n - c))),
      { step: s, tickMin: o.sub(new rTt(a).mul(s)), tickMax: o.add(new rTt(l).mul(s)) });
}
var DTt = mTt(function (e) {
    var t = wTt(e, 2),
      n = t[0],
      i = t[1],
      r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 6,
      o = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2],
      s = Math.max(r, 2),
      a = wTt(kTt([n, i]), 2),
      l = a[0],
      c = a[1];
    if (l === -1 / 0 || c === 1 / 0) {
      var d =
        c === 1 / 0
          ? [l].concat(
              xTt(
                gTt(0, r - 1).map(function () {
                  return 1 / 0;
                }),
              ),
            )
          : [].concat(
              xTt(
                gTt(0, r - 1).map(function () {
                  return -1 / 0;
                }),
              ),
              [c],
            );
      return n > i ? fTt(d) : d;
    }
    if (l === c) return NTt(l, r, o);
    var u = LTt(l, c, s, o),
      h = u.step,
      g = u.tickMin,
      p = u.tickMax,
      f = yTt.rangeStep(g, p.add(new rTt(0.1).mul(h)), h);
    return n > i ? fTt(f) : f;
  }),
  TTt = mTt(function (e, t) {
    var n = wTt(e, 2),
      i = n[0],
      r = n[1],
      o = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2],
      s = wTt(kTt([i, r]), 2),
      a = s[0],
      l = s[1];
    if (a === -1 / 0 || l === 1 / 0) return [i, r];
    if (a === l) return [a];
    var c = Math.max(t, 2),
      d = ETt(new rTt(l).sub(a).div(c - 1), o, 0),
      u = [].concat(xTt(yTt.rangeStep(new rTt(a), new rTt(l).sub(new rTt(0.99).mul(d)), d)), [l]);
    return i > r ? fTt(u) : u;
  });
function ITt(e, t) {
  throw new Error("Invariant failed");
}
var RTt = ["offset", "layout", "width", "dataKey", "data", "dataPointFormatter", "xAxis", "yAxis"];
function OTt(e) {
  return (OTt =
    "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
      ? function (e) {
          return typeof e;
        }
      : function (e) {
          return e &&
            "function" == typeof Symbol &&
            e.constructor === Symbol &&
            e !== Symbol.prototype
            ? "symbol"
            : typeof e;
        })(e);
}
function MTt() {
  return (
    (MTt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    MTt.apply(this, arguments)
  );
}
function ATt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t));
          else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (d) {
          ((c = !0), (r = d));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return PTt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return PTt(e, t);
    })(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function PTt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function jTt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function FTt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, UTt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function BTt(e, t, n) {
  return (
    (t = WTt(t)),
    (function (e, t) {
      if (t && ("object" === OTt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, VTt() ? Reflect.construct(t, n || [], WTt(e).constructor) : t.apply(e, n))
  );
}
function VTt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (t) {}
  return (VTt = function () {
    return !!e;
  })();
}
function WTt(e) {
  return (WTt = Object.setPrototypeOf
    ? Object.getPrototypeOf.bind()
    : function (e) {
        return e.__proto__ || Object.getPrototypeOf(e);
      })(e);
}
function HTt(e, t) {
  return (HTt = Object.setPrototypeOf
    ? Object.setPrototypeOf.bind()
    : function (e, t) {
        return ((e.__proto__ = t), e);
      })(e, t);
}
function zTt(e, t, n) {
  return (
    (t = UTt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function UTt(e) {
  var t = (function (e, t) {
    if ("object" != OTt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != OTt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == OTt(t) ? t : t + "";
}
var $Tt = (function () {
  function e() {
    return (
      (function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
      BTt(this, e, arguments)
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && HTt(e, t));
    })(e, z.Component),
    FTt(e, [
      {
        key: "render",
        value: function () {
          var e = this.props,
            t = e.offset,
            n = e.layout,
            i = e.width,
            r = e.dataKey,
            o = e.data,
            s = e.dataPointFormatter,
            a = e.xAxis,
            l = e.yAxis,
            c = jTt(e, RTt),
            d = rft(c, !1);
          "x" === this.props.direction && "number" !== a.type && ITt();
          var u = o.map(function (e) {
            var o = s(e, r),
              c = o.x,
              u = o.y,
              h = o.value,
              g = o.errorVal;
            if (!g) return null;
            var p,
              f,
              m = [];
            if (Array.isArray(g)) {
              var _ = ATt(g, 2);
              ((p = _[0]), (f = _[1]));
            } else p = f = g;
            if ("vertical" === n) {
              var v = a.scale,
                b = u + t,
                y = b + i,
                x = b - i,
                w = v(h - p),
                C = v(h + f);
              (m.push({ x1: C, y1: y, x2: C, y2: x }),
                m.push({ x1: w, y1: b, x2: C, y2: b }),
                m.push({ x1: w, y1: y, x2: w, y2: x }));
            } else if ("horizontal" === n) {
              var S = l.scale,
                k = c + t,
                E = k - i,
                N = k + i,
                L = S(h - p),
                D = S(h + f);
              (m.push({ x1: E, y1: D, x2: N, y2: D }),
                m.push({ x1: k, y1: L, x2: k, y2: D }),
                m.push({ x1: E, y1: L, x2: N, y2: L }));
            }
            return z.createElement(
              fft,
              MTt(
                {
                  className: "recharts-errorBar",
                  key: "bar-".concat(
                    m.map(function (e) {
                      return "".concat(e.x1, "-").concat(e.x2, "-").concat(e.y1, "-").concat(e.y2);
                    }),
                  ),
                },
                d,
              ),
              m.map(function (e) {
                return z.createElement(
                  "line",
                  MTt({}, e, {
                    key: "line-".concat(e.x1, "-").concat(e.x2, "-").concat(e.y1, "-").concat(e.y2),
                  }),
                );
              }),
            );
          });
          return z.createElement(fft, { className: "recharts-errorBars" }, u);
        },
      },
    ])
  );
})();
function qTt(e) {
  return (
    (qTt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    qTt(e)
  );
}
function KTt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function GTt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? KTt(Object(n), !0).forEach(function (t) {
          ZTt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : KTt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function ZTt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != qTt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != qTt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == qTt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
(zTt($Tt, "defaultProps", {
  stroke: "black",
  strokeWidth: 1.5,
  width: 5,
  offset: 0,
  layout: "horizontal",
}),
  zTt($Tt, "displayName", "ErrorBar"));
var YTt = function (e) {
  var t = e.children,
    n = e.formattedGraphicalItems,
    i = e.legendWidth,
    r = e.legendContent,
    o = eft(t, Sxt);
  if (!o) return null;
  var s,
    a = Sxt.defaultProps,
    l = void 0 !== a ? GTt(GTt({}, a), o.props) : {};
  return (
    (s =
      o.props && o.props.payload
        ? o.props && o.props.payload
        : "children" === r
          ? (n || []).reduce(function (e, t) {
              var n = t.item,
                i = t.props,
                r = i.sectors || i.data || [];
              return e.concat(
                r.map(function (e) {
                  return {
                    type: o.props.iconType || n.props.legendType,
                    value: e.name,
                    color: e.fill,
                    payload: e,
                  };
                }),
              );
            }, [])
          : (n || []).map(function (e) {
              var t = e.item,
                n = t.type.defaultProps,
                i = void 0 !== n ? GTt(GTt({}, n), t.props) : {},
                r = i.dataKey,
                o = i.name,
                s = i.legendType;
              return {
                inactive: i.hide,
                dataKey: r,
                type: l.iconType || s || "square",
                color: oIt(t),
                value: o || r,
                payload: i,
              };
            })),
    GTt(GTt(GTt({}, l), Sxt.getWithHeight(o, i)), {}, { payload: s, item: o })
  );
};
function XTt(e) {
  return (
    (XTt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    XTt(e)
  );
}
function QTt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return JTt(e);
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return JTt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return JTt(e, t);
    })(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function JTt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function eIt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function tIt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? eIt(Object(n), !0).forEach(function (t) {
          nIt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : eIt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function nIt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != XTt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != XTt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == XTt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function iIt(e, t, n) {
  return Zgt(e) || Zgt(t) ? n : Lpt(t) ? Ggt(e, t, n) : Yut(t) ? t(e) : n;
}
function rIt(e, t, n, i) {
  var r = EDt(e, function (e) {
    return iIt(e, t);
  });
  if ("number" === n) {
    var o = r.filter(function (e) {
      return Npt(e) || parseFloat(e);
    });
    return o.length ? [bDt(o), pDt(o)] : [1 / 0, -1 / 0];
  }
  return (
    i
      ? r.filter(function (e) {
          return !Zgt(e);
        })
      : r
  ).map(function (e) {
    return Lpt(e) || e instanceof Date ? e : "";
  });
}
var oIt = function (e) {
    var t,
      n,
      i = e.type.displayName,
      r =
        null !== (t = e.type) && void 0 !== t && t.defaultProps
          ? tIt(tIt({}, e.type.defaultProps), e.props)
          : e.props,
      o = r.stroke,
      s = r.fill;
    switch (i) {
      case "Line":
        n = o;
        break;
      case "Area":
      case "Radar":
        n = o && "none" !== o ? o : s;
        break;
      default:
        n = s;
    }
    return n;
  },
  sIt = function (e, t, n, i, r) {
    var o = Jpt(t.props.children, $Tt).filter(function (e) {
      return (function (e, t, n) {
        return (
          !!Zgt(t) ||
          ("horizontal" === e
            ? "yAxis" === t
            : "vertical" === e || "x" === n
              ? "xAxis" === t
              : "y" !== n || "yAxis" === t)
        );
      })(i, r, e.props.direction);
    });
    if (o && o.length) {
      var s = o.map(function (e) {
        return e.props.dataKey;
      });
      return e.reduce(
        function (e, t) {
          var i = iIt(t, n);
          if (Zgt(i)) return e;
          var r = Array.isArray(i) ? [bDt(i), pDt(i)] : [i, i],
            o = s.reduce(
              function (e, n) {
                var i = iIt(t, n, 0),
                  o = r[0] - Math.abs(Array.isArray(i) ? i[0] : i),
                  s = r[1] + Math.abs(Array.isArray(i) ? i[1] : i);
                return [Math.min(o, e[0]), Math.max(s, e[1])];
              },
              [1 / 0, -1 / 0],
            );
          return [Math.min(o[0], e[0]), Math.max(o[1], e[1])];
        },
        [1 / 0, -1 / 0],
      );
    }
    return null;
  },
  aIt = function (e, t, n, i, r) {
    var o = t.map(function (t) {
      var o = t.props.dataKey;
      return ("number" === n && o && sIt(e, t, o, i)) || rIt(e, o, n, r);
    });
    if ("number" === n)
      return o.reduce(
        function (e, t) {
          return [Math.min(e[0], t[0]), Math.max(e[1], t[1])];
        },
        [1 / 0, -1 / 0],
      );
    var s = {};
    return o.reduce(function (e, t) {
      for (var n = 0, i = t.length; n < i; n++) s[t[n]] || ((s[t[n]] = !0), e.push(t[n]));
      return e;
    }, []);
  },
  lIt = function (e, t) {
    return (
      ("horizontal" === e && "xAxis" === t) ||
      ("vertical" === e && "yAxis" === t) ||
      ("centric" === e && "angleAxis" === t) ||
      ("radial" === e && "radiusAxis" === t)
    );
  },
  cIt = function (e, t, n, i) {
    if (i)
      return e.map(function (e) {
        return e.coordinate;
      });
    var r,
      o,
      s = e.map(function (e) {
        return (e.coordinate === t && (r = !0), e.coordinate === n && (o = !0), e.coordinate);
      });
    return (r || s.push(t), o || s.push(n), s);
  },
  dIt = function (e, t, n) {
    if (!e) return null;
    var i = e.scale,
      r = e.duplicateDomain,
      o = e.type,
      s = e.range,
      a = "scaleBand" === e.realScaleType ? i.bandwidth() / 2 : 2,
      l = (t || n) && "category" === o && i.bandwidth ? i.bandwidth() / a : 0;
    return (
      (l =
        "angleAxis" === e.axisType && (null == s ? void 0 : s.length) >= 2
          ? 2 * kpt(s[0] - s[1]) * l
          : l),
      t && (e.ticks || e.niceTicks)
        ? (e.ticks || e.niceTicks)
            .map(function (e) {
              var t = r ? r.indexOf(e) : e;
              return { coordinate: i(t) + l, value: e, offset: l };
            })
            .filter(function (e) {
              return !Spt(e.coordinate);
            })
        : e.isCategorical && e.categoricalDomain
          ? e.categoricalDomain.map(function (e, t) {
              return { coordinate: i(e) + l, value: e, index: t, offset: l };
            })
          : i.ticks && !n
            ? i.ticks(e.tickCount).map(function (e) {
                return { coordinate: i(e) + l, value: e, offset: l };
              })
            : i.domain().map(function (e, t) {
                return { coordinate: i(e) + l, value: r ? r[e] : e, index: t, offset: l };
              })
    );
  },
  uIt = new WeakMap(),
  hIt = function (e, t) {
    if ("function" != typeof t) return e;
    uIt.has(e) || uIt.set(e, new WeakMap());
    var n = uIt.get(e);
    if (n.has(t)) return n.get(t);
    var i = function () {
      (e.apply(void 0, arguments), t.apply(void 0, arguments));
    };
    return (n.set(t, i), i);
  },
  gIt = 1e-4,
  pIt = {
    sign: function (e) {
      var t = e.length;
      if (!(t <= 0))
        for (var n = 0, i = e[0].length; n < i; ++n)
          for (var r = 0, o = 0, s = 0; s < t; ++s) {
            var a = Spt(e[s][n][1]) ? e[s][n][0] : e[s][n][1];
            a >= 0
              ? ((e[s][n][0] = r), (e[s][n][1] = r + a), (r = e[s][n][1]))
              : ((e[s][n][0] = o), (e[s][n][1] = o + a), (o = e[s][n][1]));
          }
    },
    expand: function (e, t) {
      if ((i = e.length) > 0) {
        for (var n, i, r, o = 0, s = e[0].length; o < s; ++o) {
          for (r = n = 0; n < i; ++n) r += e[n][o][1] || 0;
          if (r) for (n = 0; n < i; ++n) e[n][o][1] /= r;
        }
        qmt(e, t);
      }
    },
    none: qmt,
    silhouette: function (e, t) {
      if ((n = e.length) > 0) {
        for (var n, i = 0, r = e[t[0]], o = r.length; i < o; ++i) {
          for (var s = 0, a = 0; s < n; ++s) a += e[s][i][1] || 0;
          r[i][1] += r[i][0] = -a / 2;
        }
        qmt(e, t);
      }
    },
    wiggle: function (e, t) {
      if ((r = e.length) > 0 && (i = (n = e[t[0]]).length) > 0) {
        for (var n, i, r, o = 0, s = 1; s < i; ++s) {
          for (var a = 0, l = 0, c = 0; a < r; ++a) {
            for (
              var d = e[t[a]], u = d[s][1] || 0, h = (u - (d[s - 1][1] || 0)) / 2, g = 0;
              g < a;
              ++g
            ) {
              var p = e[t[g]];
              h += (p[s][1] || 0) - (p[s - 1][1] || 0);
            }
            ((l += u), (c += h * u));
          }
          ((n[s - 1][1] += n[s - 1][0] = o), l && (o -= c / l));
        }
        ((n[s - 1][1] += n[s - 1][0] = o), qmt(e, t));
      }
    },
    positive: function (e) {
      var t = e.length;
      if (!(t <= 0))
        for (var n = 0, i = e[0].length; n < i; ++n)
          for (var r = 0, o = 0; o < t; ++o) {
            var s = Spt(e[o][n][1]) ? e[o][n][0] : e[o][n][1];
            s >= 0
              ? ((e[o][n][0] = r), (e[o][n][1] = r + s), (r = e[o][n][1]))
              : ((e[o][n][0] = 0), (e[o][n][1] = 0));
          }
    },
  },
  fIt = function (e, t, n) {
    var i = t.map(function (e) {
        return e.props.dataKey;
      }),
      r = pIt[n],
      o = (function () {
        var e = qft([]),
          t = Kmt,
          n = qmt,
          i = Gmt;
        function r(r) {
          var o,
            s,
            a = Array.from(e.apply(this, arguments), Zmt),
            l = a.length,
            c = -1;
          for (const e of r)
            for (o = 0, ++c; o < l; ++o) (a[o][c] = [0, +i(e, a[o].key, c, r)]).data = e;
          for (o = 0, s = omt(t(a)); o < l; ++o) a[s[o]].index = o;
          return (n(a, s), a);
        }
        return (
          (r.keys = function (t) {
            return arguments.length
              ? ((e = "function" == typeof t ? t : qft(Array.from(t))), r)
              : e;
          }),
          (r.value = function (e) {
            return arguments.length ? ((i = "function" == typeof e ? e : qft(+e)), r) : i;
          }),
          (r.order = function (e) {
            return arguments.length
              ? ((t = null == e ? Kmt : "function" == typeof e ? e : qft(Array.from(e))), r)
              : t;
          }),
          (r.offset = function (e) {
            return arguments.length ? ((n = null == e ? qmt : e), r) : n;
          }),
          r
        );
      })()
        .keys(i)
        .value(function (e, t) {
          return +iIt(e, t, 0);
        })
        .order(Kmt)
        .offset(r);
    return o(e);
  };
function mIt(e) {
  var t = e.axis,
    n = e.ticks,
    i = e.bandSize,
    r = e.entry,
    o = e.index,
    s = e.dataKey;
  if ("category" === t.type) {
    if (!t.allowDuplicatedCategory && t.dataKey && !Zgt(r[t.dataKey])) {
      var a = Mpt(n, "value", r[t.dataKey]);
      if (a) return a.coordinate + i / 2;
    }
    return n[o] ? n[o].coordinate + i / 2 : null;
  }
  var l = iIt(r, Zgt(s) ? t.dataKey : s);
  return Zgt(l) ? null : t.scale(l);
}
var _It = function (e) {
    var t = e.axis,
      n = e.ticks,
      i = e.offset,
      r = e.bandSize,
      o = e.entry,
      s = e.index;
    if ("category" === t.type) return n[s] ? n[s].coordinate + i : null;
    var a = iIt(o, t.dataKey, t.domain[s]);
    return Zgt(a) ? null : t.scale(a) - r / 2 + i;
  },
  vIt = function (e, t, n) {
    return Object.keys(e)
      .reduce(
        function (i, r) {
          var o = e[r].stackedData.reduce(
            function (e, i) {
              var r = i.slice(t, n + 1).reduce(
                function (e, t) {
                  return [bDt(t.concat([e[0]]).filter(Npt)), pDt(t.concat([e[1]]).filter(Npt))];
                },
                [1 / 0, -1 / 0],
              );
              return [Math.min(e[0], r[0]), Math.max(e[1], r[1])];
            },
            [1 / 0, -1 / 0],
          );
          return [Math.min(o[0], i[0]), Math.max(o[1], i[1])];
        },
        [1 / 0, -1 / 0],
      )
      .map(function (e) {
        return e === 1 / 0 || e === -1 / 0 ? 0 : e;
      });
  },
  bIt = /^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,
  yIt = /^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,
  xIt = function (e, t, n) {
    if (Yut(e)) return e(t, n);
    if (!Array.isArray(e)) return t;
    var i = [];
    if (Npt(e[0])) i[0] = n ? e[0] : Math.min(e[0], t[0]);
    else if (bIt.test(e[0])) {
      var r = +bIt.exec(e[0])[1];
      i[0] = t[0] - r;
    } else Yut(e[0]) ? (i[0] = e[0](t[0])) : (i[0] = t[0]);
    if (Npt(e[1])) i[1] = n ? e[1] : Math.max(e[1], t[1]);
    else if (yIt.test(e[1])) {
      var o = +yIt.exec(e[1])[1];
      i[1] = t[1] + o;
    } else Yut(e[1]) ? (i[1] = e[1](t[1])) : (i[1] = t[1]);
    return i;
  },
  wIt = function (e, t, n) {
    if (e && e.scale && e.scale.bandwidth) {
      var i = e.scale.bandwidth();
      if (!n || i > 0) return i;
    }
    if (e && t && t.length >= 2) {
      for (
        var r = kwt(t, function (e) {
            return e.coordinate;
          }),
          o = 1 / 0,
          s = 1,
          a = r.length;
        s < a;
        s++
      ) {
        var l = r[s],
          c = r[s - 1];
        o = Math.min((l.coordinate || 0) - (c.coordinate || 0), o);
      }
      return o === 1 / 0 ? 0 : o;
    }
    return n ? void 0 : 0;
  },
  CIt = function (e, t, n) {
    return e && e.length ? (LDt(e, Ggt(n, "type.defaultProps.domain")) ? t : e) : t;
  },
  SIt = function (e, t) {
    var n = e.type.defaultProps ? tIt(tIt({}, e.type.defaultProps), e.props) : e.props,
      i = n.dataKey,
      r = n.name,
      o = n.unit,
      s = n.formatter,
      a = n.tooltipType,
      l = n.chartType,
      c = n.hide;
    return tIt(
      tIt({}, rft(e, !1)),
      {},
      {
        dataKey: i,
        unit: o,
        formatter: s,
        name: r || i,
        color: oIt(e),
        value: iIt(t, i),
        type: a,
        payload: t,
        chartType: l,
        hide: c,
      },
    );
  };
function kIt(e) {
  return (
    (kIt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    kIt(e)
  );
}
function EIt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function NIt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? EIt(Object(n), !0).forEach(function (t) {
          LIt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : EIt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function LIt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != kIt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != kIt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == kIt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
var DIt = Math.PI / 180,
  TIt = function (e) {
    return (180 * e) / Math.PI;
  },
  IIt = function (e, t, n, i) {
    return { x: e + Math.cos(-DIt * i) * n, y: t + Math.sin(-DIt * i) * n };
  },
  RIt = function (e, t) {
    var n = e.x,
      i = e.y,
      r = t.cx,
      o = t.cy,
      s = (function (e, t) {
        var n = e.x,
          i = e.y,
          r = t.x,
          o = t.y;
        return Math.sqrt(Math.pow(n - r, 2) + Math.pow(i - o, 2));
      })({ x: n, y: i }, { x: r, y: o });
    if (s <= 0) return { radius: s };
    var a = (n - r) / s,
      l = Math.acos(a);
    return (i > o && (l = 2 * Math.PI - l), { radius: s, angle: TIt(l), angleInRadian: l });
  },
  OIt = function (e, t) {
    var n = t.startAngle,
      i = t.endAngle,
      r = Math.floor(n / 360),
      o = Math.floor(i / 360);
    return e + 360 * Math.min(r, o);
  },
  MIt = function (e, t) {
    var n = e.x,
      i = e.y,
      r = RIt({ x: n, y: i }, t),
      o = r.radius,
      s = r.angle,
      a = t.innerRadius,
      l = t.outerRadius;
    if (o < a || o > l) return !1;
    if (0 === o) return !0;
    var c,
      d = (function (e) {
        var t = e.startAngle,
          n = e.endAngle,
          i = Math.floor(t / 360),
          r = Math.floor(n / 360),
          o = Math.min(i, r);
        return { startAngle: t - 360 * o, endAngle: n - 360 * o };
      })(t),
      u = d.startAngle,
      h = d.endAngle,
      g = s;
    if (u <= h) {
      for (; g > h; ) g -= 360;
      for (; g < u; ) g += 360;
      c = g >= u && g <= h;
    } else {
      for (; g > u; ) g -= 360;
      for (; g < h; ) g += 360;
      c = g >= h && g <= u;
    }
    return c ? NIt(NIt({}, t), {}, { radius: o, angle: OIt(g, t) }) : null;
  };
function AIt(e) {
  return (
    (AIt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    AIt(e)
  );
}
var PIt = ["offset"];
function jIt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return FIt(e);
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return FIt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return FIt(e, t);
    })(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function FIt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function BIt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function VIt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function WIt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? VIt(Object(n), !0).forEach(function (t) {
          HIt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : VIt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function HIt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != AIt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != AIt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == AIt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function zIt() {
  return (
    (zIt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    zIt.apply(this, arguments)
  );
}
var UIt = function (e, t, n) {
  var i,
    r,
    o = e.position,
    s = e.viewBox,
    a = e.offset,
    l = e.className,
    c = s,
    d = c.cx,
    u = c.cy,
    h = c.innerRadius,
    g = c.outerRadius,
    p = c.startAngle,
    f = c.endAngle,
    m = c.clockWise,
    _ = (h + g) / 2,
    v = (function (e, t) {
      return kpt(t - e) * Math.min(Math.abs(t - e), 360);
    })(p, f),
    b = v >= 0 ? 1 : -1;
  ("insideStart" === o
    ? ((i = p + b * a), (r = m))
    : "insideEnd" === o
      ? ((i = f - b * a), (r = !m))
      : "end" === o && ((i = f + b * a), (r = m)),
    (r = v <= 0 ? r : !r));
  var y = IIt(d, u, _, i),
    x = IIt(d, u, _, i + 359 * (r ? 1 : -1)),
    w = "M"
      .concat(y.x, ",")
      .concat(y.y, "\n    A")
      .concat(_, ",")
      .concat(_, ",0,1,")
      .concat(r ? 0 : 1, ",\n    ")
      .concat(x.x, ",")
      .concat(x.y),
    C = Zgt(e.id) ? Tpt("recharts-radial-line-") : e.id;
  return z.createElement(
    "text",
    zIt({}, n, { dominantBaseline: "central", className: Mp("recharts-radial-bar-label", l) }),
    z.createElement("defs", null, z.createElement("path", { id: C, d: w })),
    z.createElement("textPath", { xlinkHref: "#".concat(C) }, t),
  );
};
function $It(e) {
  var t,
    n = e.offset,
    i = WIt({ offset: void 0 === n ? 5 : n }, BIt(e, PIt)),
    r = i.viewBox,
    o = i.position,
    s = i.value,
    a = i.children,
    l = i.content,
    c = i.className,
    d = void 0 === c ? "" : c,
    u = i.textBreakAll;
  if (!r || (Zgt(s) && Zgt(a) && !H.isValidElement(l) && !Yut(l))) return null;
  if (H.isValidElement(l)) return H.cloneElement(l, i);
  if (Yut(l)) {
    if (((t = H.createElement(l, i)), H.isValidElement(t))) return t;
  } else
    t = (function (e) {
      var t = e.value,
        n = e.formatter,
        i = Zgt(e.children) ? t : e.children;
      return Yut(n) ? n(i) : i;
    })(i);
  var h = (function (e) {
      return "cx" in e && Npt(e.cx);
    })(r),
    g = rft(i, !0);
  if (h && ("insideStart" === o || "insideEnd" === o || "end" === o)) return UIt(i, t, g);
  var p = h
    ? (function (e) {
        var t = e.viewBox,
          n = e.offset,
          i = e.position,
          r = t,
          o = r.cx,
          s = r.cy,
          a = r.innerRadius,
          l = r.outerRadius,
          c = (r.startAngle + r.endAngle) / 2;
        if ("outside" === i) {
          var d = IIt(o, s, l + n, c),
            u = d.x;
          return { x: u, y: d.y, textAnchor: u >= o ? "start" : "end", verticalAnchor: "middle" };
        }
        if ("center" === i) return { x: o, y: s, textAnchor: "middle", verticalAnchor: "middle" };
        if ("centerTop" === i) return { x: o, y: s, textAnchor: "middle", verticalAnchor: "start" };
        if ("centerBottom" === i)
          return { x: o, y: s, textAnchor: "middle", verticalAnchor: "end" };
        var h = IIt(o, s, (a + l) / 2, c);
        return { x: h.x, y: h.y, textAnchor: "middle", verticalAnchor: "middle" };
      })(i)
    : (function (e) {
        var t = e.viewBox,
          n = e.parentViewBox,
          i = e.offset,
          r = e.position,
          o = t,
          s = o.x,
          a = o.y,
          l = o.width,
          c = o.height,
          d = c >= 0 ? 1 : -1,
          u = d * i,
          h = d > 0 ? "end" : "start",
          g = d > 0 ? "start" : "end",
          p = l >= 0 ? 1 : -1,
          f = p * i,
          m = p > 0 ? "end" : "start",
          _ = p > 0 ? "start" : "end";
        if ("top" === r)
          return WIt(
            WIt({}, { x: s + l / 2, y: a - d * i, textAnchor: "middle", verticalAnchor: h }),
            n ? { height: Math.max(a - n.y, 0), width: l } : {},
          );
        if ("bottom" === r)
          return WIt(
            WIt({}, { x: s + l / 2, y: a + c + u, textAnchor: "middle", verticalAnchor: g }),
            n ? { height: Math.max(n.y + n.height - (a + c), 0), width: l } : {},
          );
        if ("left" === r) {
          var v = { x: s - f, y: a + c / 2, textAnchor: m, verticalAnchor: "middle" };
          return WIt(WIt({}, v), n ? { width: Math.max(v.x - n.x, 0), height: c } : {});
        }
        if ("right" === r) {
          var b = { x: s + l + f, y: a + c / 2, textAnchor: _, verticalAnchor: "middle" };
          return WIt(WIt({}, b), n ? { width: Math.max(n.x + n.width - b.x, 0), height: c } : {});
        }
        var y = n ? { width: l, height: c } : {};
        return "insideLeft" === r
          ? WIt({ x: s + f, y: a + c / 2, textAnchor: _, verticalAnchor: "middle" }, y)
          : "insideRight" === r
            ? WIt({ x: s + l - f, y: a + c / 2, textAnchor: m, verticalAnchor: "middle" }, y)
            : "insideTop" === r
              ? WIt({ x: s + l / 2, y: a + u, textAnchor: "middle", verticalAnchor: g }, y)
              : "insideBottom" === r
                ? WIt({ x: s + l / 2, y: a + c - u, textAnchor: "middle", verticalAnchor: h }, y)
                : "insideTopLeft" === r
                  ? WIt({ x: s + f, y: a + u, textAnchor: _, verticalAnchor: g }, y)
                  : "insideTopRight" === r
                    ? WIt({ x: s + l - f, y: a + u, textAnchor: m, verticalAnchor: g }, y)
                    : "insideBottomLeft" === r
                      ? WIt({ x: s + f, y: a + c - u, textAnchor: _, verticalAnchor: h }, y)
                      : "insideBottomRight" === r
                        ? WIt({ x: s + l - f, y: a + c - u, textAnchor: m, verticalAnchor: h }, y)
                        : qut(r) && (Npt(r.x) || Ept(r.x)) && (Npt(r.y) || Ept(r.y))
                          ? WIt(
                              {
                                x: s + Ipt(r.x, l),
                                y: a + Ipt(r.y, c),
                                textAnchor: "end",
                                verticalAnchor: "end",
                              },
                              y,
                            )
                          : WIt(
                              {
                                x: s + l / 2,
                                y: a + c / 2,
                                textAnchor: "middle",
                                verticalAnchor: "middle",
                              },
                              y,
                            );
      })(i);
  return z.createElement(
    kSt,
    zIt({ className: Mp("recharts-label", d) }, g, p, { breakAll: u }),
    t,
  );
}
$It.displayName = "Label";
var qIt = function (e) {
  var t = e.cx,
    n = e.cy,
    i = e.angle,
    r = e.startAngle,
    o = e.endAngle,
    s = e.r,
    a = e.radius,
    l = e.innerRadius,
    c = e.outerRadius,
    d = e.x,
    u = e.y,
    h = e.top,
    g = e.left,
    p = e.width,
    f = e.height,
    m = e.clockWise,
    _ = e.labelViewBox;
  if (_) return _;
  if (Npt(p) && Npt(f)) {
    if (Npt(d) && Npt(u)) return { x: d, y: u, width: p, height: f };
    if (Npt(h) && Npt(g)) return { x: h, y: g, width: p, height: f };
  }
  return Npt(d) && Npt(u)
    ? { x: d, y: u, width: 0, height: 0 }
    : Npt(t) && Npt(n)
      ? {
          cx: t,
          cy: n,
          startAngle: r || i || 0,
          endAngle: o || i || 0,
          innerRadius: l || 0,
          outerRadius: c || a || s || 0,
          clockWise: m,
        }
      : e.viewBox
        ? e.viewBox
        : {};
};
(($It.parseViewBox = qIt),
  ($It.renderCallByParent = function (e, t) {
    var n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
    if (!e || (!e.children && n && !e.label)) return null;
    var i = e.children,
      r = qIt(e),
      o = Jpt(i, $It).map(function (e, n) {
        return H.cloneElement(e, { viewBox: t || r, key: "label-".concat(n) });
      });
    if (!n) return o;
    var s = (function (e, t) {
      return e
        ? !0 === e
          ? z.createElement($It, { key: "label-implicit", viewBox: t })
          : Lpt(e)
            ? z.createElement($It, { key: "label-implicit", viewBox: t, value: e })
            : H.isValidElement(e)
              ? e.type === $It
                ? H.cloneElement(e, { key: "label-implicit", viewBox: t })
                : z.createElement($It, { key: "label-implicit", content: e, viewBox: t })
              : Yut(e)
                ? z.createElement($It, { key: "label-implicit", content: e, viewBox: t })
                : qut(e)
                  ? z.createElement($It, zIt({ viewBox: t }, e, { key: "label-implicit" }))
                  : null
        : null;
    })(e.label, t || r);
    return [s].concat(jIt(o));
  }));
var KIt = function (e) {
  var t = null == e ? 0 : e.length;
  return t ? e[t - 1] : void 0;
};
const GIt = n(KIt);
function ZIt(e) {
  return (
    (ZIt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    ZIt(e)
  );
}
var YIt = ["valueAccessor"],
  XIt = ["data", "dataKey", "clockWise", "id", "textBreakAll"];
function QIt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return JIt(e);
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return JIt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return JIt(e, t);
    })(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function JIt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function eRt() {
  return (
    (eRt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    eRt.apply(this, arguments)
  );
}
function tRt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function nRt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? tRt(Object(n), !0).forEach(function (t) {
          iRt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : tRt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function iRt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != ZIt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != ZIt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == ZIt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function rRt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
var oRt = function (e) {
  return Array.isArray(e.value) ? GIt(e.value) : e.value;
};
function sRt(e) {
  var t = e.valueAccessor,
    n = void 0 === t ? oRt : t,
    i = rRt(e, YIt),
    r = i.data,
    o = i.dataKey,
    s = i.clockWise,
    a = i.id,
    l = i.textBreakAll,
    c = rRt(i, XIt);
  return r && r.length
    ? z.createElement(
        fft,
        { className: "recharts-label-list" },
        r.map(function (e, t) {
          var i = Zgt(o) ? n(e, t) : iIt(e && e.payload, o),
            r = Zgt(a) ? {} : { id: "".concat(a, "-").concat(t) };
          return z.createElement(
            $It,
            eRt({}, rft(e, !0), c, r, {
              parentViewBox: e.parentViewBox,
              value: i,
              textBreakAll: l,
              viewBox: $It.parseViewBox(Zgt(s) ? e : nRt(nRt({}, e), {}, { clockWise: s })),
              key: "label-".concat(t),
              index: t,
            }),
          );
        }),
      )
    : null;
}
function aRt(e) {
  return (
    (aRt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    aRt(e)
  );
}
function lRt() {
  return (
    (lRt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    lRt.apply(this, arguments)
  );
}
function cRt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function dRt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? cRt(Object(n), !0).forEach(function (t) {
          uRt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : cRt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function uRt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != aRt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != aRt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == aRt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
((sRt.displayName = "LabelList"),
  (sRt.renderCallByParent = function (e, t) {
    var n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
    if (!e || (!e.children && n && !e.label)) return null;
    var i = Jpt(e.children, sRt).map(function (e, n) {
      return H.cloneElement(e, { data: t, key: "labelList-".concat(n) });
    });
    return n
      ? [
          (function (e, t) {
            return e
              ? !0 === e
                ? z.createElement(sRt, { key: "labelList-implicit", data: t })
                : z.isValidElement(e) || Yut(e)
                  ? z.createElement(sRt, { key: "labelList-implicit", data: t, content: e })
                  : qut(e)
                    ? z.createElement(sRt, eRt({ data: t }, e, { key: "labelList-implicit" }))
                    : null
              : null;
          })(e.label, t),
        ].concat(QIt(i))
      : i;
  }));
var hRt = function (e) {
    var t = e.cx,
      n = e.cy,
      i = e.radius,
      r = e.angle,
      o = e.sign,
      s = e.isExternal,
      a = e.cornerRadius,
      l = e.cornerIsExternal,
      c = a * (s ? 1 : -1) + i,
      d = Math.asin(a / c) / DIt,
      u = l ? r : r + o * d,
      h = l ? r - o * d : r;
    return {
      center: IIt(t, n, c, u),
      circleTangency: IIt(t, n, i, u),
      lineTangency: IIt(t, n, c * Math.cos(d * DIt), h),
      theta: d,
    };
  },
  gRt = function (e) {
    var t = e.cx,
      n = e.cy,
      i = e.innerRadius,
      r = e.outerRadius,
      o = e.startAngle,
      s = (function (e, t) {
        return kpt(t - e) * Math.min(Math.abs(t - e), 359.999);
      })(o, e.endAngle),
      a = o + s,
      l = IIt(t, n, r, o),
      c = IIt(t, n, r, a),
      d = "M "
        .concat(l.x, ",")
        .concat(l.y, "\n    A ")
        .concat(r, ",")
        .concat(r, ",0,\n    ")
        .concat(+(Math.abs(s) > 180), ",")
        .concat(+(o > a), ",\n    ")
        .concat(c.x, ",")
        .concat(c.y, "\n  ");
    if (i > 0) {
      var u = IIt(t, n, i, o),
        h = IIt(t, n, i, a);
      d += "L "
        .concat(h.x, ",")
        .concat(h.y, "\n            A ")
        .concat(i, ",")
        .concat(i, ",0,\n            ")
        .concat(+(Math.abs(s) > 180), ",")
        .concat(+(o <= a), ",\n            ")
        .concat(u.x, ",")
        .concat(u.y, " Z");
    } else d += "L ".concat(t, ",").concat(n, " Z");
    return d;
  },
  pRt = {
    cx: 0,
    cy: 0,
    innerRadius: 0,
    outerRadius: 0,
    startAngle: 0,
    endAngle: 0,
    cornerRadius: 0,
    forceCornerRadius: !1,
    cornerIsExternal: !1,
  },
  fRt = function (e) {
    var t = dRt(dRt({}, pRt), e),
      n = t.cx,
      i = t.cy,
      r = t.innerRadius,
      o = t.outerRadius,
      s = t.cornerRadius,
      a = t.forceCornerRadius,
      l = t.cornerIsExternal,
      c = t.startAngle,
      d = t.endAngle,
      u = t.className;
    if (o < r || c === d) return null;
    var h,
      g = Mp("recharts-sector", u),
      p = o - r,
      f = Ipt(s, p, 0, !0);
    return (
      (h =
        f > 0 && Math.abs(c - d) < 360
          ? (function (e) {
              var t = e.cx,
                n = e.cy,
                i = e.innerRadius,
                r = e.outerRadius,
                o = e.cornerRadius,
                s = e.forceCornerRadius,
                a = e.cornerIsExternal,
                l = e.startAngle,
                c = e.endAngle,
                d = kpt(c - l),
                u = hRt({
                  cx: t,
                  cy: n,
                  radius: r,
                  angle: l,
                  sign: d,
                  cornerRadius: o,
                  cornerIsExternal: a,
                }),
                h = u.circleTangency,
                g = u.lineTangency,
                p = u.theta,
                f = hRt({
                  cx: t,
                  cy: n,
                  radius: r,
                  angle: c,
                  sign: -d,
                  cornerRadius: o,
                  cornerIsExternal: a,
                }),
                m = f.circleTangency,
                _ = f.lineTangency,
                v = f.theta,
                b = a ? Math.abs(l - c) : Math.abs(l - c) - p - v;
              if (b < 0)
                return s
                  ? "M "
                      .concat(g.x, ",")
                      .concat(g.y, "\n        a")
                      .concat(o, ",")
                      .concat(o, ",0,0,1,")
                      .concat(2 * o, ",0\n        a")
                      .concat(o, ",")
                      .concat(o, ",0,0,1,")
                      .concat(2 * -o, ",0\n      ")
                  : gRt({
                      cx: t,
                      cy: n,
                      innerRadius: i,
                      outerRadius: r,
                      startAngle: l,
                      endAngle: c,
                    });
              var y = "M "
                .concat(g.x, ",")
                .concat(g.y, "\n    A")
                .concat(o, ",")
                .concat(o, ",0,0,")
                .concat(+(d < 0), ",")
                .concat(h.x, ",")
                .concat(h.y, "\n    A")
                .concat(r, ",")
                .concat(r, ",0,")
                .concat(+(b > 180), ",")
                .concat(+(d < 0), ",")
                .concat(m.x, ",")
                .concat(m.y, "\n    A")
                .concat(o, ",")
                .concat(o, ",0,0,")
                .concat(+(d < 0), ",")
                .concat(_.x, ",")
                .concat(_.y, "\n  ");
              if (i > 0) {
                var x = hRt({
                    cx: t,
                    cy: n,
                    radius: i,
                    angle: l,
                    sign: d,
                    isExternal: !0,
                    cornerRadius: o,
                    cornerIsExternal: a,
                  }),
                  w = x.circleTangency,
                  C = x.lineTangency,
                  S = x.theta,
                  k = hRt({
                    cx: t,
                    cy: n,
                    radius: i,
                    angle: c,
                    sign: -d,
                    isExternal: !0,
                    cornerRadius: o,
                    cornerIsExternal: a,
                  }),
                  E = k.circleTangency,
                  N = k.lineTangency,
                  L = k.theta,
                  D = a ? Math.abs(l - c) : Math.abs(l - c) - S - L;
                if (D < 0 && 0 === o) return "".concat(y, "L").concat(t, ",").concat(n, "Z");
                y += "L"
                  .concat(N.x, ",")
                  .concat(N.y, "\n      A")
                  .concat(o, ",")
                  .concat(o, ",0,0,")
                  .concat(+(d < 0), ",")
                  .concat(E.x, ",")
                  .concat(E.y, "\n      A")
                  .concat(i, ",")
                  .concat(i, ",0,")
                  .concat(+(D > 180), ",")
                  .concat(+(d > 0), ",")
                  .concat(w.x, ",")
                  .concat(w.y, "\n      A")
                  .concat(o, ",")
                  .concat(o, ",0,0,")
                  .concat(+(d < 0), ",")
                  .concat(C.x, ",")
                  .concat(C.y, "Z");
              } else y += "L".concat(t, ",").concat(n, "Z");
              return y;
            })({
              cx: n,
              cy: i,
              innerRadius: r,
              outerRadius: o,
              cornerRadius: Math.min(f, p / 2),
              forceCornerRadius: a,
              cornerIsExternal: l,
              startAngle: c,
              endAngle: d,
            })
          : gRt({ cx: n, cy: i, innerRadius: r, outerRadius: o, startAngle: c, endAngle: d })),
      z.createElement("path", lRt({}, rft(t, !0), { className: g, d: h, role: "img" }))
    );
  };
function mRt(e) {
  return (
    (mRt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    mRt(e)
  );
}
function _Rt() {
  return (
    (_Rt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    _Rt.apply(this, arguments)
  );
}
function vRt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function bRt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? vRt(Object(n), !0).forEach(function (t) {
          yRt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : vRt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function yRt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != mRt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != mRt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == mRt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
var xRt = {
    curveBasisClosed: function (e) {
      return new Omt(e);
    },
    curveBasisOpen: function (e) {
      return new Mmt(e);
    },
    curveBasis: function (e) {
      return new Rmt(e);
    },
    curveBumpX: function (e) {
      return new hmt(e, !0);
    },
    curveBumpY: function (e) {
      return new hmt(e, !1);
    },
    curveLinearClosed: function (e) {
      return new Amt(e);
    },
    curveLinear: amt,
    curveMonotoneX: function (e) {
      return new Vmt(e);
    },
    curveMonotoneY: function (e) {
      return new Wmt(e);
    },
    curveNatural: function (e) {
      return new zmt(e);
    },
    curveStep: function (e) {
      return new $mt(e, 0.5);
    },
    curveStepAfter: function (e) {
      return new $mt(e, 1);
    },
    curveStepBefore: function (e) {
      return new $mt(e, 0);
    },
  },
  wRt = function (e) {
    return e.x === +e.x && e.y === +e.y;
  },
  CRt = function (e) {
    return e.x;
  },
  SRt = function (e) {
    return e.y;
  },
  kRt = function (e) {
    var t,
      n = e.type,
      i = void 0 === n ? "linear" : n,
      r = e.points,
      o = void 0 === r ? [] : r,
      s = e.baseLine,
      a = e.layout,
      l = e.connectNulls,
      c = void 0 !== l && l,
      d = (function (e, t) {
        if (Yut(e)) return e;
        var n = "curve".concat($ft(e));
        return ("curveMonotone" !== n && "curveBump" !== n) || !t
          ? xRt[n] || amt
          : xRt["".concat(n).concat("vertical" === t ? "Y" : "X")];
      })(i, a),
      u = c
        ? o.filter(function (e) {
            return wRt(e);
          })
        : o;
    if (Array.isArray(s)) {
      var h = c
          ? s.filter(function (e) {
              return wRt(e);
            })
          : s,
        g = u.map(function (e, t) {
          return bRt(bRt({}, e), {}, { base: h[t] });
        });
      return (
        (t =
          "vertical" === a
            ? umt()
                .y(SRt)
                .x1(CRt)
                .x0(function (e) {
                  return e.base.x;
                })
            : umt()
                .x(CRt)
                .y1(SRt)
                .y0(function (e) {
                  return e.base.y;
                })),
        t.defined(wRt).curve(d),
        t(g)
      );
    }
    return (
      (t =
        "vertical" === a && Npt(s)
          ? umt().y(SRt).x1(CRt).x0(s)
          : Npt(s)
            ? umt().x(CRt).y1(SRt).y0(s)
            : dmt().x(CRt).y(SRt))
        .defined(wRt)
        .curve(d),
      t(u)
    );
  },
  ERt = function (e) {
    var t = e.className,
      n = e.points,
      i = e.path,
      r = e.pathRef;
    if (!((n && n.length) || i)) return null;
    var o = n && n.length ? kRt(e) : i;
    return H.createElement(
      "path",
      _Rt({}, rft(e, !1), Hpt(e), { className: Mp("recharts-curve", t), d: o, ref: r }),
    );
  };
const { getOwnPropertyNames: NRt, getOwnPropertySymbols: LRt } = Object,
  { hasOwnProperty: DRt } = Object.prototype;
function TRt(e, t) {
  return function (n, i, r) {
    return e(n, i, r) && t(n, i, r);
  };
}
function IRt(e) {
  return function (t, n, i) {
    if (!t || !n || "object" != typeof t || "object" != typeof n) return e(t, n, i);
    const { cache: r } = i,
      o = r.get(t),
      s = r.get(n);
    if (o && s) return o === n && s === t;
    (r.set(t, n), r.set(n, t));
    const a = e(t, n, i);
    return (r.delete(t), r.delete(n), a);
  };
}
function RRt(e) {
  return NRt(e).concat(LRt(e));
}
const ORt = Object.hasOwn || ((e, t) => DRt.call(e, t));
function MRt(e, t) {
  return e === t || (!e && !t && e != e && t != t);
}
const { getOwnPropertyDescriptor: ARt, keys: PRt } = Object;
function jRt(e, t) {
  return e.byteLength === t.byteLength && YRt(new Uint8Array(e), new Uint8Array(t));
}
function FRt(e, t, n) {
  let i = e.length;
  if (t.length !== i) return !1;
  for (; i-- > 0; ) if (!n.equals(e[i], t[i], i, i, e, t, n)) return !1;
  return !0;
}
function BRt(e, t) {
  return (
    e.byteLength === t.byteLength &&
    YRt(
      new Uint8Array(e.buffer, e.byteOffset, e.byteLength),
      new Uint8Array(t.buffer, t.byteOffset, t.byteLength),
    )
  );
}
function VRt(e, t) {
  return MRt(e.getTime(), t.getTime());
}
function WRt(e, t) {
  return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
}
function HRt(e, t) {
  return e === t;
}
function zRt(e, t, n) {
  const i = e.size;
  if (i !== t.size) return !1;
  if (!i) return !0;
  const r = new Array(i),
    o = e.entries();
  let s,
    a,
    l = 0;
  for (; (s = o.next()) && !s.done; ) {
    const i = t.entries();
    let o = !1,
      c = 0;
    for (; (a = i.next()) && !a.done; ) {
      if (r[c]) {
        c++;
        continue;
      }
      const i = s.value,
        d = a.value;
      if (n.equals(i[0], d[0], l, c, e, t, n) && n.equals(i[1], d[1], i[0], d[0], e, t, n)) {
        o = r[c] = !0;
        break;
      }
      c++;
    }
    if (!o) return !1;
    l++;
  }
  return !0;
}
const URt = MRt;
function $Rt(e, t, n) {
  const i = PRt(e);
  let r = i.length;
  if (PRt(t).length !== r) return !1;
  for (; r-- > 0; ) if (!QRt(e, t, n, i[r])) return !1;
  return !0;
}
function qRt(e, t, n) {
  const i = RRt(e);
  let r,
    o,
    s,
    a = i.length;
  if (RRt(t).length !== a) return !1;
  for (; a-- > 0; ) {
    if (((r = i[a]), !QRt(e, t, n, r))) return !1;
    if (
      ((o = ARt(e, r)),
      (s = ARt(t, r)),
      (o || s) &&
        (!o ||
          !s ||
          o.configurable !== s.configurable ||
          o.enumerable !== s.enumerable ||
          o.writable !== s.writable))
    )
      return !1;
  }
  return !0;
}
function KRt(e, t) {
  return MRt(e.valueOf(), t.valueOf());
}
function GRt(e, t) {
  return e.source === t.source && e.flags === t.flags;
}
function ZRt(e, t, n) {
  const i = e.size;
  if (i !== t.size) return !1;
  if (!i) return !0;
  const r = new Array(i),
    o = e.values();
  let s, a;
  for (; (s = o.next()) && !s.done; ) {
    const i = t.values();
    let o = !1,
      l = 0;
    for (; (a = i.next()) && !a.done; ) {
      if (!r[l] && n.equals(s.value, a.value, s.value, a.value, e, t, n)) {
        o = r[l] = !0;
        break;
      }
      l++;
    }
    if (!o) return !1;
  }
  return !0;
}
function YRt(e, t) {
  let n = e.byteLength;
  if (t.byteLength !== n || e.byteOffset !== t.byteOffset) return !1;
  for (; n-- > 0; ) if (e[n] !== t[n]) return !1;
  return !0;
}
function XRt(e, t) {
  return (
    e.hostname === t.hostname &&
    e.pathname === t.pathname &&
    e.protocol === t.protocol &&
    e.port === t.port &&
    e.hash === t.hash &&
    e.username === t.username &&
    e.password === t.password
  );
}
function QRt(e, t, n, i) {
  return (
    !(("_owner" !== i && "__o" !== i && "__v" !== i) || (!e.$$typeof && !t.$$typeof)) ||
    (ORt(t, i) && n.equals(e[i], t[i], i, i, e, t, n))
  );
}
const JRt = {
    "[object Int8Array]": !0,
    "[object Uint8Array]": !0,
    "[object Uint8ClampedArray]": !0,
    "[object Int16Array]": !0,
    "[object Uint16Array]": !0,
    "[object Int32Array]": !0,
    "[object Uint32Array]": !0,
    "[object Float16Array]": !0,
    "[object Float32Array]": !0,
    "[object Float64Array]": !0,
    "[object BigInt64Array]": !0,
    "[object BigUint64Array]": !0,
  },
  eOt = Object.prototype.toString;
function tOt({
  areArrayBuffersEqual: e,
  areArraysEqual: t,
  areDataViewsEqual: n,
  areDatesEqual: i,
  areErrorsEqual: r,
  areFunctionsEqual: o,
  areMapsEqual: s,
  areNumbersEqual: a,
  areObjectsEqual: l,
  arePrimitiveWrappersEqual: c,
  areRegExpsEqual: d,
  areSetsEqual: u,
  areTypedArraysEqual: h,
  areUrlsEqual: g,
  unknownTagComparators: p,
}) {
  return function (f, m, _) {
    if (f === m) return !0;
    if (null == f || null == m) return !1;
    const v = typeof f;
    if (v !== typeof m) return !1;
    if ("object" !== v) return "number" === v ? a(f, m, _) : "function" === v && o(f, m, _);
    const b = f.constructor;
    if (b !== m.constructor) return !1;
    if (b === Object) return l(f, m, _);
    if (Array.isArray(f)) return t(f, m, _);
    if (b === Date) return i(f, m, _);
    if (b === RegExp) return d(f, m, _);
    if (b === Map) return s(f, m, _);
    if (b === Set) return u(f, m, _);
    const y = eOt.call(f);
    if ("[object Date]" === y) return i(f, m, _);
    if ("[object RegExp]" === y) return d(f, m, _);
    if ("[object Map]" === y) return s(f, m, _);
    if ("[object Set]" === y) return u(f, m, _);
    if ("[object Object]" === y)
      return "function" != typeof f.then && "function" != typeof m.then && l(f, m, _);
    if ("[object URL]" === y) return g(f, m, _);
    if ("[object Error]" === y) return r(f, m, _);
    if ("[object Arguments]" === y) return l(f, m, _);
    if (JRt[y]) return h(f, m, _);
    if ("[object ArrayBuffer]" === y) return e(f, m, _);
    if ("[object DataView]" === y) return n(f, m, _);
    if ("[object Boolean]" === y || "[object Number]" === y || "[object String]" === y)
      return c(f, m, _);
    if (p) {
      let e = p[y];
      if (!e) {
        const t = null != (x = f) ? x[Symbol.toStringTag] : void 0;
        t && (e = p[t]);
      }
      if (e) return e(f, m, _);
    }
    var x;
    return !1;
  };
}
const nOt = iOt();
function iOt(e = {}) {
  const { circular: t = !1, createInternalComparator: n, createState: i, strict: r = !1 } = e,
    o = (function ({ circular: e, createCustomConfig: t, strict: n }) {
      let i = {
        areArrayBuffersEqual: jRt,
        areArraysEqual: n ? qRt : FRt,
        areDataViewsEqual: BRt,
        areDatesEqual: VRt,
        areErrorsEqual: WRt,
        areFunctionsEqual: HRt,
        areMapsEqual: n ? TRt(zRt, qRt) : zRt,
        areNumbersEqual: URt,
        areObjectsEqual: n ? qRt : $Rt,
        arePrimitiveWrappersEqual: KRt,
        areRegExpsEqual: GRt,
        areSetsEqual: n ? TRt(ZRt, qRt) : ZRt,
        areTypedArraysEqual: n ? TRt(YRt, qRt) : YRt,
        areUrlsEqual: XRt,
        unknownTagComparators: void 0,
      };
      if ((t && (i = Object.assign({}, i, t(i))), e)) {
        const e = IRt(i.areArraysEqual),
          t = IRt(i.areMapsEqual),
          n = IRt(i.areObjectsEqual),
          r = IRt(i.areSetsEqual);
        i = Object.assign({}, i, {
          areArraysEqual: e,
          areMapsEqual: t,
          areObjectsEqual: n,
          areSetsEqual: r,
        });
      }
      return i;
    })(e),
    s = tOt(o),
    a = n
      ? n(s)
      : (function (e) {
          return function (t, n, i, r, o, s, a) {
            return e(t, n, a);
          };
        })(s);
  return (function ({ circular: e, comparator: t, createState: n, equals: i, strict: r }) {
    if (n)
      return function (o, s) {
        const { cache: a = e ? new WeakMap() : void 0, meta: l } = n();
        return t(o, s, { cache: a, equals: i, meta: l, strict: r });
      };
    if (e)
      return function (e, n) {
        return t(e, n, { cache: new WeakMap(), equals: i, meta: void 0, strict: r });
      };
    const o = { cache: void 0, equals: i, meta: void 0, strict: r };
    return function (e, n) {
      return t(e, n, o);
    };
  })({ circular: t, comparator: s, createState: i, equals: a, strict: r });
}
function rOt(e) {
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
    n = -1;
  requestAnimationFrame(function i(r) {
    (n < 0 && (n = r),
      r - n > t
        ? (e(r), (n = -1))
        : (function (e) {
            "undefined" != typeof requestAnimationFrame && requestAnimationFrame(e);
          })(i));
  });
}
function oOt(e) {
  return (
    (oOt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    oOt(e)
  );
}
function sOt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return aOt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return aOt(e, t);
    })(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function aOt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function lOt() {
  var e = function () {
      return null;
    },
    t = !1,
    n = function n(i) {
      if (!t) {
        if (Array.isArray(i)) {
          if (!i.length) return;
          var r = sOt(i),
            o = r[0],
            s = r.slice(1);
          return "number" == typeof o
            ? void rOt(n.bind(null, s), o)
            : (n(o), void rOt(n.bind(null, s)));
        }
        ("object" === oOt(i) && e(i), "function" == typeof i && i());
      }
    };
  return {
    stop: function () {
      t = !0;
    },
    start: function (e) {
      ((t = !1), n(e));
    },
    subscribe: function (t) {
      return (
        (e = t),
        function () {
          e = function () {
            return null;
          };
        }
      );
    },
  };
}
function cOt(e) {
  return (cOt =
    "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
      ? function (e) {
          return typeof e;
        }
      : function (e) {
          return e &&
            "function" == typeof Symbol &&
            e.constructor === Symbol &&
            e !== Symbol.prototype
            ? "symbol"
            : typeof e;
        })(e);
}
function dOt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function uOt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? dOt(Object(n), !0).forEach(function (t) {
          hOt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : dOt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function hOt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" !== cOt(e) || null === e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" !== cOt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" === cOt(t) ? t : String(t);
    })(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
(iOt({ strict: !0 }),
  iOt({ circular: !0 }),
  iOt({ circular: !0, strict: !0 }),
  iOt({ createInternalComparator: () => MRt }),
  iOt({ strict: !0, createInternalComparator: () => MRt }),
  iOt({ circular: !0, createInternalComparator: () => MRt }),
  iOt({ circular: !0, createInternalComparator: () => MRt, strict: !0 }));
var gOt = function (e) {
    return e;
  },
  pOt = function (e, t) {
    return Object.keys(t).reduce(function (n, i) {
      return uOt(uOt({}, n), {}, hOt({}, i, e(i, t[i])));
    }, {});
  },
  fOt = function (e, t, n) {
    return e
      .map(function (e) {
        return ""
          .concat(
            ((i = e),
            i.replace(/([A-Z])/g, function (e) {
              return "-".concat(e.toLowerCase());
            })),
            " ",
          )
          .concat(t, "ms ")
          .concat(n);
        var i;
      })
      .join(",");
  };
function mOt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t));
          else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (e) {
          ((c = !0), (r = e));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    vOt(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function _Ot(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return bOt(e);
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    vOt(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function vOt(e, t) {
  if (e) {
    if ("string" == typeof e) return bOt(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    return (
      "Object" === n && e.constructor && (n = e.constructor.name),
      "Map" === n || "Set" === n
        ? Array.from(e)
        : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
          ? bOt(e, t)
          : void 0
    );
  }
}
function bOt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
var yOt = 1e-4,
  xOt = function (e, t) {
    return [0, 3 * e, 3 * t - 6 * e, 3 * e - 3 * t + 1];
  },
  wOt = function (e, t) {
    return e
      .map(function (e, n) {
        return e * Math.pow(t, n);
      })
      .reduce(function (e, t) {
        return e + t;
      });
  },
  COt = function (e, t) {
    return function (n) {
      var i = xOt(e, t);
      return wOt(i, n);
    };
  },
  SOt = function () {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
    var i = t[0],
      r = t[1],
      o = t[2],
      s = t[3];
    if (1 === t.length)
      switch (t[0]) {
        case "linear":
          ((i = 0), (r = 0), (o = 1), (s = 1));
          break;
        case "ease":
          ((i = 0.25), (r = 0.1), (o = 0.25), (s = 1));
          break;
        case "ease-in":
          ((i = 0.42), (r = 0), (o = 1), (s = 1));
          break;
        case "ease-out":
          ((i = 0.42), (r = 0), (o = 0.58), (s = 1));
          break;
        case "ease-in-out":
          ((i = 0), (r = 0), (o = 0.58), (s = 1));
          break;
        default:
          var a = t[0].split("(");
          if ("cubic-bezier" === a[0] && 4 === a[1].split(")")[0].split(",").length) {
            var l = a[1]
                .split(")")[0]
                .split(",")
                .map(function (e) {
                  return parseFloat(e);
                }),
              c = mOt(l, 4);
            ((i = c[0]), (r = c[1]), (o = c[2]), (s = c[3]));
          }
      }
    var d,
      u,
      h = COt(i, o),
      g = COt(r, s),
      p =
        ((d = i),
        (u = o),
        function (e) {
          var t = xOt(d, u),
            n = [].concat(
              _Ot(
                t
                  .map(function (e, t) {
                    return e * t;
                  })
                  .slice(1),
              ),
              [0],
            );
          return wOt(n, e);
        }),
      f = function (e) {
        return e > 1 ? 1 : e < 0 ? 0 : e;
      },
      m = function (e) {
        for (var t = e > 1 ? 1 : e, n = t, i = 0; i < 8; ++i) {
          var r = h(n) - t,
            o = p(n);
          if (Math.abs(r - t) < yOt || o < yOt) return g(n);
          n = f(n - r / o);
        }
        return g(n);
      };
    return ((m.isStepper = !1), m);
  },
  kOt = function () {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
    var i = t[0];
    if ("string" == typeof i)
      switch (i) {
        case "ease":
        case "ease-in-out":
        case "ease-out":
        case "ease-in":
        case "linear":
          return SOt(i);
        case "spring":
          return (function () {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
              t = e.stiff,
              n = void 0 === t ? 100 : t,
              i = e.damping,
              r = void 0 === i ? 8 : i,
              o = e.dt,
              s = void 0 === o ? 17 : o,
              a = function (e, t, i) {
                var o = i + ((-(e - t) * n - i * r) * s) / 1e3,
                  a = (i * s) / 1e3 + e;
                return Math.abs(a - t) < yOt && Math.abs(o) < yOt ? [t, 0] : [a, o];
              };
            return ((a.isStepper = !0), (a.dt = s), a);
          })();
        default:
          if ("cubic-bezier" === i.split("(")[0]) return SOt(i);
      }
    return "function" == typeof i ? i : null;
  };
function EOt(e) {
  return (
    (EOt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    EOt(e)
  );
}
function NOt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return OOt(e);
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    ROt(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function LOt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function DOt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? LOt(Object(n), !0).forEach(function (t) {
          TOt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : LOt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function TOt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" !== EOt(e) || null === e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" !== EOt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" === EOt(t) ? t : String(t);
    })(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function IOt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t));
          else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (e) {
          ((c = !0), (r = e));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    ROt(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function ROt(e, t) {
  if (e) {
    if ("string" == typeof e) return OOt(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    return (
      "Object" === n && e.constructor && (n = e.constructor.name),
      "Map" === n || "Set" === n
        ? Array.from(e)
        : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
          ? OOt(e, t)
          : void 0
    );
  }
}
function OOt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
var MOt = function (e, t, n) {
    return e + (t - e) * n;
  },
  AOt = function (e) {
    return e.from !== e.to;
  },
  POt = function e(t, n, i) {
    var r = pOt(function (e, n) {
      if (AOt(n)) {
        var i = IOt(t(n.from, n.to, n.velocity), 2),
          r = i[0],
          o = i[1];
        return DOt(DOt({}, n), {}, { from: r, velocity: o });
      }
      return n;
    }, n);
    return i < 1
      ? pOt(function (e, t) {
          return AOt(t)
            ? DOt(
                DOt({}, t),
                {},
                { velocity: MOt(t.velocity, r[e].velocity, i), from: MOt(t.from, r[e].from, i) },
              )
            : t;
        }, n)
      : e(t, r, i - 1);
  };
const jOt = function (e, t, n, i, r) {
  var o,
    s,
    a,
    l,
    c =
      ((o = e),
      (s = t),
      [Object.keys(o), Object.keys(s)].reduce(function (e, t) {
        return e.filter(function (e) {
          return t.includes(e);
        });
      })),
    d = c.reduce(function (n, i) {
      return DOt(DOt({}, n), {}, TOt({}, i, [e[i], t[i]]));
    }, {}),
    u = c.reduce(function (n, i) {
      return DOt(DOt({}, n), {}, TOt({}, i, { from: e[i], velocity: 0, to: t[i] }));
    }, {}),
    h = -1,
    g = function () {
      return null;
    };
  return (
    (g = n.isStepper
      ? function (i) {
          a || (a = i);
          var o = (i - a) / n.dt;
          ((u = POt(n, u, o)),
            r(
              DOt(
                DOt(DOt({}, e), t),
                pOt(function (e, t) {
                  return t.from;
                }, u),
              ),
            ),
            (a = i),
            Object.values(u).filter(AOt).length && (h = requestAnimationFrame(g)));
        }
      : function (o) {
          l || (l = o);
          var s = (o - l) / i,
            a = pOt(function (e, t) {
              return MOt.apply(void 0, NOt(t).concat([n(s)]));
            }, d);
          if ((r(DOt(DOt(DOt({}, e), t), a)), s < 1)) h = requestAnimationFrame(g);
          else {
            var c = pOt(function (e, t) {
              return MOt.apply(void 0, NOt(t).concat([n(1)]));
            }, d);
            r(DOt(DOt(DOt({}, e), t), c));
          }
        }),
    function () {
      return (
        requestAnimationFrame(g),
        function () {
          cancelAnimationFrame(h);
        }
      );
    }
  );
};
function FOt(e) {
  return (
    (FOt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    FOt(e)
  );
}
var BOt = [
  "children",
  "begin",
  "duration",
  "attributeName",
  "easing",
  "isActive",
  "steps",
  "from",
  "to",
  "canBegin",
  "onAnimationEnd",
  "shouldReAnimate",
  "onAnimationReStart",
];
function VOt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n,
        i,
        r = {},
        o = Object.keys(e);
      for (i = 0; i < o.length; i++) ((n = o[i]), t.indexOf(n) >= 0 || (r[n] = e[n]));
      return r;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function WOt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return HOt(e);
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return HOt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return HOt(e, t);
    })(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function HOt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function zOt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function UOt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? zOt(Object(n), !0).forEach(function (t) {
          $Ot(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : zOt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function $Ot(e, t, n) {
  return (
    (t = KOt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function qOt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, KOt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function KOt(e) {
  var t = (function (e, t) {
    if ("object" !== FOt(e) || null === e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" !== FOt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === t ? String : Number)(e);
  })(e, "string");
  return "symbol" === FOt(t) ? t : String(t);
}
function GOt(e, t) {
  return (
    (GOt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    GOt(e, t)
  );
}
function ZOt(e) {
  var t = (function () {
    if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
    if (Reflect.construct.sham) return !1;
    if ("function" == typeof Proxy) return !0;
    try {
      return (Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0);
    } catch (spt) {
      return !1;
    }
  })();
  return function () {
    var n,
      i = QOt(e);
    if (t) {
      var r = QOt(this).constructor;
      n = Reflect.construct(i, arguments, r);
    } else n = i.apply(this, arguments);
    return YOt(this, n);
  };
}
function YOt(e, t) {
  if (t && ("object" === FOt(t) || "function" == typeof t)) return t;
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
  return XOt(e);
}
function XOt(e) {
  if (void 0 === e)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function QOt(e) {
  return (
    (QOt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    QOt(e)
  );
}
var JOt = (function () {
  !(function (e, t) {
    if ("function" != typeof t && null !== t)
      throw new TypeError("Super expression must either be null or a function");
    ((e.prototype = Object.create(t && t.prototype, {
      constructor: { value: e, writable: !0, configurable: !0 },
    })),
      Object.defineProperty(e, "prototype", { writable: !1 }),
      t && GOt(e, t));
  })(t, H.PureComponent);
  var e = ZOt(t);
  function t(n, i) {
    var r;
    !(function (e, t) {
      if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
    })(this, t);
    var o = (r = e.call(this, n, i)).props,
      s = o.isActive,
      a = o.attributeName,
      l = o.from,
      c = o.to,
      d = o.steps,
      u = o.children,
      h = o.duration;
    if (
      ((r.handleStyleChange = r.handleStyleChange.bind(XOt(r))),
      (r.changeStyle = r.changeStyle.bind(XOt(r))),
      !s || h <= 0)
    )
      return (
        (r.state = { style: {} }),
        "function" == typeof u && (r.state = { style: c }),
        YOt(r)
      );
    if (d && d.length) r.state = { style: d[0].style };
    else if (l) {
      if ("function" == typeof u) return ((r.state = { style: l }), YOt(r));
      r.state = { style: a ? $Ot({}, a, l) : l };
    } else r.state = { style: {} };
    return r;
  }
  return (
    qOt(t, [
      {
        key: "componentDidMount",
        value: function () {
          var e = this.props,
            t = e.isActive,
            n = e.canBegin;
          ((this.mounted = !0), t && n && this.runAnimation(this.props));
        },
      },
      {
        key: "componentDidUpdate",
        value: function (e) {
          var t = this.props,
            n = t.isActive,
            i = t.canBegin,
            r = t.attributeName,
            o = t.shouldReAnimate,
            s = t.to,
            a = t.from,
            l = this.state.style;
          if (i)
            if (n) {
              if (!(nOt(e.to, s) && e.canBegin && e.isActive)) {
                var c = !e.canBegin || !e.isActive;
                (this.manager && this.manager.stop(),
                  this.stopJSAnimation && this.stopJSAnimation());
                var d = c || o ? a : e.to;
                if (this.state && l) {
                  var u = { style: r ? $Ot({}, r, d) : d };
                  ((r && l[r] !== d) || (!r && l !== d)) && this.setState(u);
                }
                this.runAnimation(UOt(UOt({}, this.props), {}, { from: d, begin: 0 }));
              }
            } else {
              var h = { style: r ? $Ot({}, r, s) : s };
              this.state && l && ((r && l[r] !== s) || (!r && l !== s)) && this.setState(h);
            }
        },
      },
      {
        key: "componentWillUnmount",
        value: function () {
          this.mounted = !1;
          var e = this.props.onAnimationEnd;
          (this.unSubscribe && this.unSubscribe(),
            this.manager && (this.manager.stop(), (this.manager = null)),
            this.stopJSAnimation && this.stopJSAnimation(),
            e && e());
        },
      },
      {
        key: "handleStyleChange",
        value: function (e) {
          this.changeStyle(e);
        },
      },
      {
        key: "changeStyle",
        value: function (e) {
          this.mounted && this.setState({ style: e });
        },
      },
      {
        key: "runJSAnimation",
        value: function (e) {
          var t = this,
            n = e.from,
            i = e.to,
            r = e.duration,
            o = e.easing,
            s = e.begin,
            a = e.onAnimationEnd,
            l = e.onAnimationStart,
            c = jOt(n, i, kOt(o), r, this.changeStyle);
          this.manager.start([
            l,
            s,
            function () {
              t.stopJSAnimation = c();
            },
            r,
            a,
          ]);
        },
      },
      {
        key: "runStepAnimation",
        value: function (e) {
          var t = this,
            n = e.steps,
            i = e.begin,
            r = e.onAnimationStart,
            o = n[0],
            s = o.style,
            a = o.duration,
            l = void 0 === a ? 0 : a;
          return this.manager.start(
            [r].concat(
              WOt(
                n.reduce(
                  function (e, i, r) {
                    if (0 === r) return e;
                    var o = i.duration,
                      s = i.easing,
                      a = void 0 === s ? "ease" : s,
                      l = i.style,
                      c = i.properties,
                      d = i.onAnimationEnd,
                      u = r > 0 ? n[r - 1] : i,
                      h = c || Object.keys(l);
                    if ("function" == typeof a || "spring" === a)
                      return [].concat(WOt(e), [
                        t.runJSAnimation.bind(t, { from: u.style, to: l, duration: o, easing: a }),
                        o,
                      ]);
                    var g = fOt(h, o, a),
                      p = UOt(UOt(UOt({}, u.style), l), {}, { transition: g });
                    return [].concat(WOt(e), [p, o, d]).filter(gOt);
                  },
                  [s, Math.max(l, i)],
                ),
              ),
              [e.onAnimationEnd],
            ),
          );
        },
      },
      {
        key: "runAnimation",
        value: function (e) {
          this.manager || (this.manager = lOt());
          var t = e.begin,
            n = e.duration,
            i = e.attributeName,
            r = e.to,
            o = e.easing,
            s = e.onAnimationStart,
            a = e.onAnimationEnd,
            l = e.steps,
            c = e.children,
            d = this.manager;
          if (
            ((this.unSubscribe = d.subscribe(this.handleStyleChange)),
            "function" != typeof o && "function" != typeof c && "spring" !== o)
          )
            if (l.length > 1) this.runStepAnimation(e);
            else {
              var u = i ? $Ot({}, i, r) : r,
                h = fOt(Object.keys(u), n, o);
              d.start([s, t, UOt(UOt({}, u), {}, { transition: h }), n, a]);
            }
          else this.runJSAnimation(e);
        },
      },
      {
        key: "render",
        value: function () {
          var e = this.props,
            t = e.children;
          e.begin;
          var n = e.duration;
          (e.attributeName, e.easing);
          var i = e.isActive;
          (e.steps,
            e.from,
            e.to,
            e.canBegin,
            e.onAnimationEnd,
            e.shouldReAnimate,
            e.onAnimationReStart);
          var r = VOt(e, BOt),
            o = H.Children.count(t),
            s = this.state.style;
          if ("function" == typeof t) return t(s);
          if (!i || 0 === o || n <= 0) return t;
          var a = function (e) {
            var t = e.props,
              n = t.style,
              i = void 0 === n ? {} : n,
              o = t.className;
            return H.cloneElement(
              e,
              UOt(UOt({}, r), {}, { style: UOt(UOt({}, i), s), className: o }),
            );
          };
          return 1 === o
            ? a(H.Children.only(t))
            : z.createElement(
                "div",
                null,
                H.Children.map(t, function (e) {
                  return a(e);
                }),
              );
        },
      },
    ]),
    t
  );
})();
function eMt(e, t) {
  return (
    (eMt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    eMt(e, t)
  );
}
function tMt(e, t) {
  ((e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e), eMt(e, t));
}
function nMt(e) {
  if (void 0 === e)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function iMt(e) {
  return (
    (iMt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    iMt(e)
  );
}
function rMt() {
  return (
    (rMt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    rMt.apply(this, arguments)
  );
}
function oMt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t));
          else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (e) {
          ((c = !0), (r = e));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return sMt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return sMt(e, t);
    })(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function sMt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function aMt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function lMt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? aMt(Object(n), !0).forEach(function (t) {
          cMt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : aMt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function cMt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != iMt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != iMt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == iMt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
((JOt.displayName = "Animate"),
  (JOt.defaultProps = {
    begin: 0,
    duration: 1e3,
    from: "",
    to: "",
    attributeName: "",
    easing: "ease",
    isActive: !0,
    canBegin: !0,
    steps: [],
    onAnimationEnd: function () {},
    onAnimationStart: function () {},
  }),
  (JOt.propTypes = {
    from: Pf.oneOfType([Pf.object, Pf.string]),
    to: Pf.oneOfType([Pf.object, Pf.string]),
    attributeName: Pf.string,
    duration: Pf.number,
    begin: Pf.number,
    easing: Pf.oneOfType([Pf.string, Pf.func]),
    steps: Pf.arrayOf(
      Pf.shape({
        duration: Pf.number.isRequired,
        style: Pf.object.isRequired,
        easing: Pf.oneOfType([
          Pf.oneOf(["ease", "ease-in", "ease-out", "ease-in-out", "linear"]),
          Pf.func,
        ]),
        properties: Pf.arrayOf("string"),
        onAnimationEnd: Pf.func,
      }),
    ),
    children: Pf.oneOfType([Pf.node, Pf.func]),
    isActive: Pf.bool,
    canBegin: Pf.bool,
    onAnimationEnd: Pf.func,
    shouldReAnimate: Pf.bool,
    onAnimationStart: Pf.func,
    onAnimationReStart: Pf.func,
  }));
var dMt = function (e, t, n, i, r) {
    var o,
      s = Math.min(Math.abs(n) / 2, Math.abs(i) / 2),
      a = i >= 0 ? 1 : -1,
      l = n >= 0 ? 1 : -1,
      c = (i >= 0 && n >= 0) || (i < 0 && n < 0) ? 1 : 0;
    if (s > 0 && r instanceof Array) {
      for (var d = [0, 0, 0, 0], u = 0; u < 4; u++) d[u] = r[u] > s ? s : r[u];
      ((o = "M".concat(e, ",").concat(t + a * d[0])),
        d[0] > 0 &&
          (o += "A "
            .concat(d[0], ",")
            .concat(d[0], ",0,0,")
            .concat(c, ",")
            .concat(e + l * d[0], ",")
            .concat(t)),
        (o += "L ".concat(e + n - l * d[1], ",").concat(t)),
        d[1] > 0 &&
          (o += "A "
            .concat(d[1], ",")
            .concat(d[1], ",0,0,")
            .concat(c, ",\n        ")
            .concat(e + n, ",")
            .concat(t + a * d[1])),
        (o += "L ".concat(e + n, ",").concat(t + i - a * d[2])),
        d[2] > 0 &&
          (o += "A "
            .concat(d[2], ",")
            .concat(d[2], ",0,0,")
            .concat(c, ",\n        ")
            .concat(e + n - l * d[2], ",")
            .concat(t + i)),
        (o += "L ".concat(e + l * d[3], ",").concat(t + i)),
        d[3] > 0 &&
          (o += "A "
            .concat(d[3], ",")
            .concat(d[3], ",0,0,")
            .concat(c, ",\n        ")
            .concat(e, ",")
            .concat(t + i - a * d[3])),
        (o += "Z"));
    } else if (s > 0 && r === +r && r > 0) {
      var h = Math.min(s, r);
      o = "M "
        .concat(e, ",")
        .concat(t + a * h, "\n            A ")
        .concat(h, ",")
        .concat(h, ",0,0,")
        .concat(c, ",")
        .concat(e + l * h, ",")
        .concat(t, "\n            L ")
        .concat(e + n - l * h, ",")
        .concat(t, "\n            A ")
        .concat(h, ",")
        .concat(h, ",0,0,")
        .concat(c, ",")
        .concat(e + n, ",")
        .concat(t + a * h, "\n            L ")
        .concat(e + n, ",")
        .concat(t + i - a * h, "\n            A ")
        .concat(h, ",")
        .concat(h, ",0,0,")
        .concat(c, ",")
        .concat(e + n - l * h, ",")
        .concat(t + i, "\n            L ")
        .concat(e + l * h, ",")
        .concat(t + i, "\n            A ")
        .concat(h, ",")
        .concat(h, ",0,0,")
        .concat(c, ",")
        .concat(e, ",")
        .concat(t + i - a * h, " Z");
    } else
      o = "M ".concat(e, ",").concat(t, " h ").concat(n, " v ").concat(i, " h ").concat(-n, " Z");
    return o;
  },
  uMt = function (e, t) {
    if (!e || !t) return !1;
    var n = e.x,
      i = e.y,
      r = t.x,
      o = t.y,
      s = t.width,
      a = t.height;
    if (Math.abs(s) > 0 && Math.abs(a) > 0) {
      var l = Math.min(r, r + s),
        c = Math.max(r, r + s),
        d = Math.min(o, o + a),
        u = Math.max(o, o + a);
      return n >= l && n <= c && i >= d && i <= u;
    }
    return !1;
  },
  hMt = {
    x: 0,
    y: 0,
    width: 0,
    height: 0,
    radius: 0,
    isAnimationActive: !1,
    isUpdateAnimationActive: !1,
    animationBegin: 0,
    animationDuration: 1500,
    animationEasing: "ease",
  },
  gMt = function (e) {
    var t = lMt(lMt({}, hMt), e),
      n = H.useRef(),
      i = oMt(H.useState(-1), 2),
      r = i[0],
      o = i[1];
    H.useEffect(function () {
      if (n.current && n.current.getTotalLength)
        try {
          var e = n.current.getTotalLength();
          e && o(e);
        } catch (W8t) {}
    }, []);
    var s = t.x,
      a = t.y,
      l = t.width,
      c = t.height,
      d = t.radius,
      u = t.className,
      h = t.animationEasing,
      g = t.animationDuration,
      p = t.animationBegin,
      f = t.isAnimationActive,
      m = t.isUpdateAnimationActive;
    if (s !== +s || a !== +a || l !== +l || c !== +c || 0 === l || 0 === c) return null;
    var _ = Mp("recharts-rectangle", u);
    return m
      ? z.createElement(
          JOt,
          {
            canBegin: r > 0,
            from: { width: l, height: c, x: s, y: a },
            to: { width: l, height: c, x: s, y: a },
            duration: g,
            animationEasing: h,
            isActive: m,
          },
          function (e) {
            var i = e.width,
              o = e.height,
              s = e.x,
              a = e.y;
            return z.createElement(
              JOt,
              {
                canBegin: r > 0,
                from: "0px ".concat(-1 === r ? 1 : r, "px"),
                to: "".concat(r, "px 0px"),
                attributeName: "strokeDasharray",
                begin: p,
                duration: g,
                isActive: f,
                easing: h,
              },
              z.createElement(
                "path",
                rMt({}, rft(t, !0), { className: _, d: dMt(s, a, i, o, d), ref: n }),
              ),
            );
          },
        )
      : z.createElement("path", rMt({}, rft(t, !0), { className: _, d: dMt(s, a, l, c, d) }));
  };
function pMt() {
  return (
    (pMt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    pMt.apply(this, arguments)
  );
}
var fMt = function (e) {
  var t = e.cx,
    n = e.cy,
    i = e.r,
    r = Mp("recharts-dot", e.className);
  return t === +t && n === +n && i === +i
    ? H.createElement("circle", pMt({}, rft(e, !1), Hpt(e), { className: r, cx: t, cy: n, r: i }))
    : null;
};
function mMt(e) {
  return (
    (mMt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    mMt(e)
  );
}
var _Mt = ["x", "y", "top", "left", "width", "height", "className"];
function vMt() {
  return (
    (vMt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    vMt.apply(this, arguments)
  );
}
function bMt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function yMt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != mMt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != mMt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == mMt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function xMt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
var wMt = function (e, t, n, i, r, o) {
    return "M".concat(e, ",").concat(r, "v").concat(i, "M").concat(o, ",").concat(t, "h").concat(n);
  },
  CMt = function (e) {
    var t = e.x,
      n = void 0 === t ? 0 : t,
      i = e.y,
      r = void 0 === i ? 0 : i,
      o = e.top,
      s = void 0 === o ? 0 : o,
      a = e.left,
      l = void 0 === a ? 0 : a,
      c = e.width,
      d = void 0 === c ? 0 : c,
      u = e.height,
      h = void 0 === u ? 0 : u,
      g = e.className,
      p = (function (e) {
        for (var t = 1; t < arguments.length; t++) {
          var n = null != arguments[t] ? arguments[t] : {};
          t % 2
            ? bMt(Object(n), !0).forEach(function (t) {
                yMt(e, t, n[t]);
              })
            : Object.getOwnPropertyDescriptors
              ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
              : bMt(Object(n)).forEach(function (t) {
                  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
                });
        }
        return e;
      })({ x: n, y: r, top: s, left: l, width: d, height: h }, xMt(e, _Mt));
    return Npt(n) && Npt(r) && Npt(d) && Npt(h) && Npt(s) && Npt(l)
      ? z.createElement(
          "path",
          vMt({}, rft(p, !0), { className: Mp("recharts-cross", g), d: wMt(n, r, d, h, s, l) }),
        )
      : null;
  },
  SMt = $vt(Object.getPrototypeOf, Object),
  kMt = Aut,
  EMt = SMt,
  NMt = Put,
  LMt = Function.prototype,
  DMt = Object.prototype,
  TMt = LMt.toString,
  IMt = DMt.hasOwnProperty,
  RMt = TMt.call(Object);
const OMt = n(function (e) {
  if (!NMt(e) || "[object Object]" != kMt(e)) return !1;
  var t = EMt(e);
  if (null === t) return !0;
  var n = IMt.call(t, "constructor") && t.constructor;
  return "function" == typeof n && n instanceof n && TMt.call(n) == RMt;
});
var MMt = Aut,
  AMt = Put;
const PMt = n(function (e) {
  return !0 === e || !1 === e || (AMt(e) && "[object Boolean]" == MMt(e));
});
function jMt(e) {
  return (
    (jMt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    jMt(e)
  );
}
function FMt() {
  return (
    (FMt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    FMt.apply(this, arguments)
  );
}
function BMt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t));
          else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (e) {
          ((c = !0), (r = e));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return VMt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return VMt(e, t);
    })(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function VMt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function WMt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function HMt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? WMt(Object(n), !0).forEach(function (t) {
          zMt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : WMt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function zMt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != jMt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != jMt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == jMt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
var UMt = function (e, t, n, i, r) {
    var o,
      s = n - i;
    return (
      (o = "M ".concat(e, ",").concat(t)),
      (o += "L ".concat(e + n, ",").concat(t)),
      (o += "L ".concat(e + n - s / 2, ",").concat(t + r)),
      (o += "L ".concat(e + n - s / 2 - i, ",").concat(t + r)),
      (o += "L ".concat(e, ",").concat(t, " Z"))
    );
  },
  $Mt = {
    x: 0,
    y: 0,
    upperWidth: 0,
    lowerWidth: 0,
    height: 0,
    isUpdateAnimationActive: !1,
    animationBegin: 0,
    animationDuration: 1500,
    animationEasing: "ease",
  },
  qMt = function (e) {
    var t = HMt(HMt({}, $Mt), e),
      n = H.useRef(),
      i = BMt(H.useState(-1), 2),
      r = i[0],
      o = i[1];
    H.useEffect(function () {
      if (n.current && n.current.getTotalLength)
        try {
          var e = n.current.getTotalLength();
          e && o(e);
        } catch (W8t) {}
    }, []);
    var s = t.x,
      a = t.y,
      l = t.upperWidth,
      c = t.lowerWidth,
      d = t.height,
      u = t.className,
      h = t.animationEasing,
      g = t.animationDuration,
      p = t.animationBegin,
      f = t.isUpdateAnimationActive;
    if (s !== +s || a !== +a || l !== +l || c !== +c || d !== +d || (0 === l && 0 === c) || 0 === d)
      return null;
    var m = Mp("recharts-trapezoid", u);
    return f
      ? z.createElement(
          JOt,
          {
            canBegin: r > 0,
            from: { upperWidth: 0, lowerWidth: 0, height: d, x: s, y: a },
            to: { upperWidth: l, lowerWidth: c, height: d, x: s, y: a },
            duration: g,
            animationEasing: h,
            isActive: f,
          },
          function (e) {
            var i = e.upperWidth,
              o = e.lowerWidth,
              s = e.height,
              a = e.x,
              l = e.y;
            return z.createElement(
              JOt,
              {
                canBegin: r > 0,
                from: "0px ".concat(-1 === r ? 1 : r, "px"),
                to: "".concat(r, "px 0px"),
                attributeName: "strokeDasharray",
                begin: p,
                duration: g,
                easing: h,
              },
              z.createElement(
                "path",
                FMt({}, rft(t, !0), { className: m, d: UMt(a, l, i, o, s), ref: n }),
              ),
            );
          },
        )
      : z.createElement(
          "g",
          null,
          z.createElement("path", FMt({}, rft(t, !0), { className: m, d: UMt(s, a, l, c, d) })),
        );
  },
  KMt = ["option", "shapeType", "propTransformer", "activeClassName", "isActive"];
function GMt(e) {
  return (
    (GMt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    GMt(e)
  );
}
function ZMt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function YMt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function XMt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? YMt(Object(n), !0).forEach(function (t) {
          QMt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : YMt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function QMt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != GMt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != GMt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == GMt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function JMt(e, t) {
  return XMt(XMt({}, t), e);
}
function eAt(e) {
  var t = e.shapeType,
    n = e.elementProps;
  switch (t) {
    case "rectangle":
      return z.createElement(gMt, n);
    case "trapezoid":
      return z.createElement(qMt, n);
    case "sector":
      return z.createElement(fRt, n);
    case "symbols":
      if (
        (function (e) {
          return "symbols" === e;
        })(t)
      )
        return z.createElement(o_t, n);
      break;
    default:
      return null;
  }
}
function tAt(e) {
  var t,
    n = e.option,
    i = e.shapeType,
    r = e.propTransformer,
    o = void 0 === r ? JMt : r,
    s = e.activeClassName,
    a = void 0 === s ? "recharts-active-shape" : s,
    l = e.isActive,
    c = ZMt(e, KMt);
  if (H.isValidElement(n))
    t = H.cloneElement(
      n,
      XMt(
        XMt({}, c),
        (function (e) {
          return H.isValidElement(e) ? e.props : e;
        })(n),
      ),
    );
  else if (Yut(n)) t = n(c);
  else if (OMt(n) && !PMt(n)) {
    var d = o(n, c);
    t = z.createElement(eAt, { shapeType: i, elementProps: d });
  } else {
    var u = c;
    t = z.createElement(eAt, { shapeType: i, elementProps: u });
  }
  return l ? z.createElement(fft, { className: a }, t) : t;
}
function nAt(e, t) {
  return null != t && "trapezoids" in e.props;
}
function iAt(e, t) {
  return null != t && "sectors" in e.props;
}
function rAt(e, t) {
  return null != t && "points" in e.props;
}
function oAt(e, t) {
  var n,
    i,
    r =
      e.x === (null == t || null === (n = t.labelViewBox) || void 0 === n ? void 0 : n.x) ||
      e.x === t.x,
    o =
      e.y === (null == t || null === (i = t.labelViewBox) || void 0 === i ? void 0 : i.y) ||
      e.y === t.y;
  return r && o;
}
function sAt(e, t) {
  var n = e.endAngle === t.endAngle,
    i = e.startAngle === t.startAngle;
  return n && i;
}
function aAt(e, t) {
  var n = e.x === t.x,
    i = e.y === t.y,
    r = e.z === t.z;
  return n && i && r;
}
function lAt(e) {
  var t = e.activeTooltipItem,
    n = e.graphicalItem,
    i = e.itemData,
    r = (function (e, t) {
      var n;
      return (
        nAt(e, t) ? (n = "trapezoids") : iAt(e, t) ? (n = "sectors") : rAt(e, t) && (n = "points"),
        n
      );
    })(n, t),
    o = (function (e, t) {
      var n, i;
      return nAt(e, t)
        ? null === (n = t.tooltipPayload) ||
          void 0 === n ||
          null === (n = n[0]) ||
          void 0 === n ||
          null === (n = n.payload) ||
          void 0 === n
          ? void 0
          : n.payload
        : iAt(e, t)
          ? null === (i = t.tooltipPayload) ||
            void 0 === i ||
            null === (i = i[0]) ||
            void 0 === i ||
            null === (i = i.payload) ||
            void 0 === i
            ? void 0
            : i.payload
          : rAt(e, t)
            ? t.payload
            : {};
    })(n, t),
    s = i.filter(function (e, i) {
      var s = LDt(o, e),
        a = n.props[r].filter(function (e) {
          var i = (function (e, t) {
            var n;
            return (nAt(e, t) ? (n = oAt) : iAt(e, t) ? (n = sAt) : rAt(e, t) && (n = aAt), n);
          })(n, t);
          return i(e, t);
        }),
        l = n.props[r].indexOf(a[a.length - 1]);
      return s && i === l;
    });
  return i.indexOf(s[s.length - 1]);
}
var cAt = Math.ceil,
  dAt = Math.max;
var uAt = function (e, t, n, i) {
    for (var r = -1, o = dAt(cAt((t - e) / (n || 1)), 0), s = Array(o); o--; )
      ((s[i ? o : ++r] = e), (e += n));
    return s;
  },
  hAt = SCt,
  gAt = 1 / 0;
var pAt = function (e) {
    return e
      ? (e = hAt(e)) === gAt || e === -1 / 0
        ? 17976931348623157e292 * (e < 0 ? -1 : 1)
        : e == e
          ? e
          : 0
      : 0 === e
        ? e
        : 0;
  },
  fAt = uAt,
  mAt = xwt,
  _At = pAt;
const vAt = n(
  (function (e) {
    return function (t, n, i) {
      return (
        i && "number" != typeof i && mAt(t, n, i) && (n = i = void 0),
        (t = _At(t)),
        void 0 === n ? ((n = t), (t = 0)) : (n = _At(n)),
        (i = void 0 === i ? (t < n ? 1 : -1) : _At(i)),
        fAt(t, n, i, e)
      );
    };
  })(),
);
function bAt(e) {
  return (
    (bAt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    bAt(e)
  );
}
function yAt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function xAt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? yAt(Object(n), !0).forEach(function (t) {
          wAt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : yAt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function wAt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != bAt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != bAt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == bAt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
var CAt = ["Webkit", "Moz", "O", "ms"];
function SAt(e) {
  return (
    (SAt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    SAt(e)
  );
}
function kAt() {
  return (
    (kAt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    kAt.apply(this, arguments)
  );
}
function EAt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function NAt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? EAt(Object(n), !0).forEach(function (t) {
          OAt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : EAt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function LAt(e, t) {
  for (var n = 0; n < t.length; n++) {
    var i = t[n];
    ((i.enumerable = i.enumerable || !1),
      (i.configurable = !0),
      "value" in i && (i.writable = !0),
      Object.defineProperty(e, MAt(i.key), i));
  }
}
function DAt(e, t, n) {
  return (
    (t = IAt(t)),
    (function (e, t) {
      if (t && ("object" === SAt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, TAt() ? Reflect.construct(t, n || [], IAt(e).constructor) : t.apply(e, n))
  );
}
function TAt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (TAt = function () {
    return !!e;
  })();
}
function IAt(e) {
  return (
    (IAt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    IAt(e)
  );
}
function RAt(e, t) {
  return (
    (RAt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    RAt(e, t)
  );
}
function OAt(e, t, n) {
  return (
    (t = MAt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function MAt(e) {
  var t = (function (e, t) {
    if ("object" != SAt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != SAt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == SAt(t) ? t : t + "";
}
var AAt = function (e) {
    return e.changedTouches && !!e.changedTouches.length;
  },
  PAt = (function () {
    function e(t) {
      var n;
      return (
        (function (e, t) {
          if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
        })(this, e),
        OAt((n = DAt(this, e, [t])), "handleDrag", function (e) {
          (n.leaveTimer && (clearTimeout(n.leaveTimer), (n.leaveTimer = null)),
            n.state.isTravellerMoving
              ? n.handleTravellerMove(e)
              : n.state.isSlideMoving && n.handleSlideDrag(e));
        }),
        OAt(n, "handleTouchMove", function (e) {
          null != e.changedTouches &&
            e.changedTouches.length > 0 &&
            n.handleDrag(e.changedTouches[0]);
        }),
        OAt(n, "handleDragEnd", function () {
          (n.setState({ isTravellerMoving: !1, isSlideMoving: !1 }, function () {
            var e = n.props,
              t = e.endIndex,
              i = e.onDragEnd,
              r = e.startIndex;
            null == i || i({ endIndex: t, startIndex: r });
          }),
            n.detachDragEndListener());
        }),
        OAt(n, "handleLeaveWrapper", function () {
          (n.state.isTravellerMoving || n.state.isSlideMoving) &&
            (n.leaveTimer = window.setTimeout(n.handleDragEnd, n.props.leaveTimeOut));
        }),
        OAt(n, "handleEnterSlideOrTraveller", function () {
          n.setState({ isTextActive: !0 });
        }),
        OAt(n, "handleLeaveSlideOrTraveller", function () {
          n.setState({ isTextActive: !1 });
        }),
        OAt(n, "handleSlideDragStart", function (e) {
          var t = AAt(e) ? e.changedTouches[0] : e;
          (n.setState({ isTravellerMoving: !1, isSlideMoving: !0, slideMoveStartX: t.pageX }),
            n.attachDragEndListener());
        }),
        (n.travellerDragStartHandlers = {
          startX: n.handleTravellerDragStart.bind(n, "startX"),
          endX: n.handleTravellerDragStart.bind(n, "endX"),
        }),
        (n.state = {}),
        n
      );
    }
    return (
      (function (e, t) {
        if ("function" != typeof t && null !== t)
          throw new TypeError("Super expression must either be null or a function");
        ((e.prototype = Object.create(t && t.prototype, {
          constructor: { value: e, writable: !0, configurable: !0 },
        })),
          Object.defineProperty(e, "prototype", { writable: !1 }),
          t && RAt(e, t));
      })(e, H.PureComponent),
      (t = e),
      (n = [
        {
          key: "componentWillUnmount",
          value: function () {
            (this.leaveTimer && (clearTimeout(this.leaveTimer), (this.leaveTimer = null)),
              this.detachDragEndListener());
          },
        },
        {
          key: "getIndex",
          value: function (t) {
            var n = t.startX,
              i = t.endX,
              r = this.state.scaleValues,
              o = this.props,
              s = o.gap,
              a = o.data.length - 1,
              l = Math.min(n, i),
              c = Math.max(n, i),
              d = e.getIndexInRange(r, l),
              u = e.getIndexInRange(r, c);
            return { startIndex: d - (d % s), endIndex: u === a ? a : u - (u % s) };
          },
        },
        {
          key: "getTextOfTick",
          value: function (e) {
            var t = this.props,
              n = t.data,
              i = t.tickFormatter,
              r = t.dataKey,
              o = iIt(n[e], r, e);
            return Yut(i) ? i(o, e) : o;
          },
        },
        {
          key: "attachDragEndListener",
          value: function () {
            (window.addEventListener("mouseup", this.handleDragEnd, !0),
              window.addEventListener("touchend", this.handleDragEnd, !0),
              window.addEventListener("mousemove", this.handleDrag, !0));
          },
        },
        {
          key: "detachDragEndListener",
          value: function () {
            (window.removeEventListener("mouseup", this.handleDragEnd, !0),
              window.removeEventListener("touchend", this.handleDragEnd, !0),
              window.removeEventListener("mousemove", this.handleDrag, !0));
          },
        },
        {
          key: "handleSlideDrag",
          value: function (e) {
            var t = this.state,
              n = t.slideMoveStartX,
              i = t.startX,
              r = t.endX,
              o = this.props,
              s = o.x,
              a = o.width,
              l = o.travellerWidth,
              c = o.startIndex,
              d = o.endIndex,
              u = o.onChange,
              h = e.pageX - n;
            h > 0
              ? (h = Math.min(h, s + a - l - r, s + a - l - i))
              : h < 0 && (h = Math.max(h, s - i, s - r));
            var g = this.getIndex({ startX: i + h, endX: r + h });
            ((g.startIndex === c && g.endIndex === d) || !u || u(g),
              this.setState({ startX: i + h, endX: r + h, slideMoveStartX: e.pageX }));
          },
        },
        {
          key: "handleTravellerDragStart",
          value: function (e, t) {
            var n = AAt(t) ? t.changedTouches[0] : t;
            (this.setState({
              isSlideMoving: !1,
              isTravellerMoving: !0,
              movingTravellerId: e,
              brushMoveStartX: n.pageX,
            }),
              this.attachDragEndListener());
          },
        },
        {
          key: "handleTravellerMove",
          value: function (e) {
            var t = this.state,
              n = t.brushMoveStartX,
              i = t.movingTravellerId,
              r = t.endX,
              o = t.startX,
              s = this.state[i],
              a = this.props,
              l = a.x,
              c = a.width,
              d = a.travellerWidth,
              u = a.onChange,
              h = a.gap,
              g = a.data,
              p = { startX: this.state.startX, endX: this.state.endX },
              f = e.pageX - n;
            (f > 0 ? (f = Math.min(f, l + c - d - s)) : f < 0 && (f = Math.max(f, l - s)),
              (p[i] = s + f));
            var m = this.getIndex(p),
              _ = m.startIndex,
              v = m.endIndex;
            this.setState(OAt(OAt({}, i, s + f), "brushMoveStartX", e.pageX), function () {
              var e;
              u &&
                ((e = g.length - 1),
                (("startX" === i && (r > o ? _ % h === 0 : v % h === 0)) ||
                  (r < o && v === e) ||
                  ("endX" === i && (r > o ? v % h === 0 : _ % h === 0)) ||
                  (r > o && v === e)) &&
                  u(m));
            });
          },
        },
        {
          key: "handleTravellerMoveKeyboard",
          value: function (e, t) {
            var n = this,
              i = this.state,
              r = i.scaleValues,
              o = i.startX,
              s = i.endX,
              a = this.state[t],
              l = r.indexOf(a);
            if (-1 !== l) {
              var c = l + e;
              if (!(-1 === c || c >= r.length)) {
                var d = r[c];
                ("startX" === t && d >= s) ||
                  ("endX" === t && d <= o) ||
                  this.setState(OAt({}, t, d), function () {
                    n.props.onChange(n.getIndex({ startX: n.state.startX, endX: n.state.endX }));
                  });
              }
            }
          },
        },
        {
          key: "renderBackground",
          value: function () {
            var e = this.props,
              t = e.x,
              n = e.y,
              i = e.width,
              r = e.height,
              o = e.fill,
              s = e.stroke;
            return z.createElement("rect", { stroke: s, fill: o, x: t, y: n, width: i, height: r });
          },
        },
        {
          key: "renderPanorama",
          value: function () {
            var e = this.props,
              t = e.x,
              n = e.y,
              i = e.width,
              r = e.height,
              o = e.data,
              s = e.children,
              a = e.padding,
              l = H.Children.only(s);
            return l
              ? z.cloneElement(l, {
                  x: t,
                  y: n,
                  width: i,
                  height: r,
                  margin: a,
                  compact: !0,
                  data: o,
                })
              : null;
          },
        },
        {
          key: "renderTravellerLayer",
          value: function (t, n) {
            var i,
              r,
              o = this,
              s = this.props,
              a = s.y,
              l = s.travellerWidth,
              c = s.height,
              d = s.traveller,
              u = s.ariaLabel,
              h = s.data,
              g = s.startIndex,
              p = s.endIndex,
              f = Math.max(t, this.props.x),
              m = NAt(NAt({}, rft(this.props, !1)), {}, { x: f, y: a, width: l, height: c }),
              _ =
                u ||
                "Min value: "
                  .concat(null === (i = h[g]) || void 0 === i ? void 0 : i.name, ", Max value: ")
                  .concat(null === (r = h[p]) || void 0 === r ? void 0 : r.name);
            return z.createElement(
              fft,
              {
                tabIndex: 0,
                role: "slider",
                "aria-label": _,
                "aria-valuenow": t,
                className: "recharts-brush-traveller",
                onMouseEnter: this.handleEnterSlideOrTraveller,
                onMouseLeave: this.handleLeaveSlideOrTraveller,
                onMouseDown: this.travellerDragStartHandlers[n],
                onTouchStart: this.travellerDragStartHandlers[n],
                onKeyDown: function (e) {
                  ["ArrowLeft", "ArrowRight"].includes(e.key) &&
                    (e.preventDefault(),
                    e.stopPropagation(),
                    o.handleTravellerMoveKeyboard("ArrowRight" === e.key ? 1 : -1, n));
                },
                onFocus: function () {
                  o.setState({ isTravellerFocused: !0 });
                },
                onBlur: function () {
                  o.setState({ isTravellerFocused: !1 });
                },
                style: { cursor: "col-resize" },
              },
              e.renderTraveller(d, m),
            );
          },
        },
        {
          key: "renderSlide",
          value: function (e, t) {
            var n = this.props,
              i = n.y,
              r = n.height,
              o = n.stroke,
              s = n.travellerWidth,
              a = Math.min(e, t) + s,
              l = Math.max(Math.abs(t - e) - s, 0);
            return z.createElement("rect", {
              className: "recharts-brush-slide",
              onMouseEnter: this.handleEnterSlideOrTraveller,
              onMouseLeave: this.handleLeaveSlideOrTraveller,
              onMouseDown: this.handleSlideDragStart,
              onTouchStart: this.handleSlideDragStart,
              style: { cursor: "move" },
              stroke: "none",
              fill: o,
              fillOpacity: 0.2,
              x: a,
              y: i,
              width: l,
              height: r,
            });
          },
        },
        {
          key: "renderText",
          value: function () {
            var e = this.props,
              t = e.startIndex,
              n = e.endIndex,
              i = e.y,
              r = e.height,
              o = e.travellerWidth,
              s = e.stroke,
              a = this.state,
              l = a.startX,
              c = a.endX,
              d = { pointerEvents: "none", fill: s };
            return z.createElement(
              fft,
              { className: "recharts-brush-texts" },
              z.createElement(
                kSt,
                kAt(
                  {
                    textAnchor: "end",
                    verticalAnchor: "middle",
                    x: Math.min(l, c) - 5,
                    y: i + r / 2,
                  },
                  d,
                ),
                this.getTextOfTick(t),
              ),
              z.createElement(
                kSt,
                kAt(
                  {
                    textAnchor: "start",
                    verticalAnchor: "middle",
                    x: Math.max(l, c) + o + 5,
                    y: i + r / 2,
                  },
                  d,
                ),
                this.getTextOfTick(n),
              ),
            );
          },
        },
        {
          key: "render",
          value: function () {
            var e = this.props,
              t = e.data,
              n = e.className,
              i = e.children,
              r = e.x,
              o = e.y,
              s = e.width,
              a = e.height,
              l = e.alwaysShowText,
              c = this.state,
              d = c.startX,
              u = c.endX,
              h = c.isTextActive,
              g = c.isSlideMoving,
              p = c.isTravellerMoving,
              f = c.isTravellerFocused;
            if (!t || !t.length || !Npt(r) || !Npt(o) || !Npt(s) || !Npt(a) || s <= 0 || a <= 0)
              return null;
            var m,
              _,
              v,
              b,
              y = Mp("recharts-brush", n),
              x = 1 === z.Children.count(i),
              w =
                ((_ = "none"),
                (v = (m = "userSelect").replace(/(\w)/, function (e) {
                  return e.toUpperCase();
                })),
                ((b = CAt.reduce(function (e, t) {
                  return xAt(xAt({}, e), {}, wAt({}, t + v, _));
                }, {}))[m] = _),
                b);
            return z.createElement(
              fft,
              {
                className: y,
                onMouseLeave: this.handleLeaveWrapper,
                onTouchMove: this.handleTouchMove,
                style: w,
              },
              this.renderBackground(),
              x && this.renderPanorama(),
              this.renderSlide(d, u),
              this.renderTravellerLayer(d, "startX"),
              this.renderTravellerLayer(u, "endX"),
              (h || g || p || f || l) && this.renderText(),
            );
          },
        },
      ]),
      (i = [
        {
          key: "renderDefaultTraveller",
          value: function (e) {
            var t = e.x,
              n = e.y,
              i = e.width,
              r = e.height,
              o = e.stroke,
              s = Math.floor(n + r / 2) - 1;
            return z.createElement(
              z.Fragment,
              null,
              z.createElement("rect", { x: t, y: n, width: i, height: r, fill: o, stroke: "none" }),
              z.createElement("line", {
                x1: t + 1,
                y1: s,
                x2: t + i - 1,
                y2: s,
                fill: "none",
                stroke: "#fff",
              }),
              z.createElement("line", {
                x1: t + 1,
                y1: s + 2,
                x2: t + i - 1,
                y2: s + 2,
                fill: "none",
                stroke: "#fff",
              }),
            );
          },
        },
        {
          key: "renderTraveller",
          value: function (t, n) {
            return z.isValidElement(t)
              ? z.cloneElement(t, n)
              : Yut(t)
                ? t(n)
                : e.renderDefaultTraveller(n);
          },
        },
        {
          key: "getDerivedStateFromProps",
          value: function (e, t) {
            var n = e.data,
              i = e.width,
              r = e.x,
              o = e.travellerWidth,
              s = e.updateId,
              a = e.startIndex,
              l = e.endIndex;
            if (n !== t.prevData || s !== t.prevUpdateId)
              return NAt(
                { prevData: n, prevTravellerWidth: o, prevUpdateId: s, prevX: r, prevWidth: i },
                n && n.length
                  ? (function (e) {
                      var t = e.data,
                        n = e.startIndex,
                        i = e.endIndex,
                        r = e.x,
                        o = e.width,
                        s = e.travellerWidth;
                      if (!t || !t.length) return {};
                      var a = t.length,
                        l = ekt()
                          .domain(vAt(0, a))
                          .range([r, r + o - s]),
                        c = l.domain().map(function (e) {
                          return l(e);
                        });
                      return {
                        isTextActive: !1,
                        isSlideMoving: !1,
                        isTravellerMoving: !1,
                        isTravellerFocused: !1,
                        startX: l(n),
                        endX: l(i),
                        scale: l,
                        scaleValues: c,
                      };
                    })({ data: n, width: i, x: r, travellerWidth: o, startIndex: a, endIndex: l })
                  : { scale: null, scaleValues: null },
              );
            if (t.scale && (i !== t.prevWidth || r !== t.prevX || o !== t.prevTravellerWidth)) {
              t.scale.range([r, r + i - o]);
              var c = t.scale.domain().map(function (e) {
                return t.scale(e);
              });
              return {
                prevData: n,
                prevTravellerWidth: o,
                prevUpdateId: s,
                prevX: r,
                prevWidth: i,
                startX: t.scale(e.startIndex),
                endX: t.scale(e.endIndex),
                scaleValues: c,
              };
            }
            return null;
          },
        },
        {
          key: "getIndexInRange",
          value: function (e, t) {
            for (var n = 0, i = e.length - 1; i - n > 1; ) {
              var r = Math.floor((n + i) / 2);
              e[r] > t ? (i = r) : (n = r);
            }
            return t >= e[i] ? i : n;
          },
        },
      ]),
      n && LAt(t.prototype, n),
      i && LAt(t, i),
      Object.defineProperty(t, "prototype", { writable: !1 }),
      t
    );
    var t, n, i;
  })();
(OAt(PAt, "displayName", "Brush"),
  OAt(PAt, "defaultProps", {
    height: 40,
    travellerWidth: 5,
    gap: 1,
    fill: "#fff",
    stroke: "#666",
    padding: { top: 1, right: 1, bottom: 1, left: 1 },
    leaveTimeOut: 1e3,
    alwaysShowText: !1,
  }));
var jAt = jxt;
var FAt = function (e, t) {
    var n;
    return (
      jAt(e, function (e, i, r) {
        return !(n = t(e, i, r));
      }),
      !!n
    );
  },
  BAt = A_t,
  VAt = Vyt,
  WAt = FAt,
  HAt = but,
  zAt = xwt;
const UAt = n(function (e, t, n) {
  var i = HAt(e) ? BAt : WAt;
  return (n && zAt(e, t, n) && (t = void 0), i(e, VAt(t)));
});
var $At = function (e, t) {
    var n = e.alwaysShow,
      i = e.ifOverflow;
    return (n && (i = "extendDomain"), i === t);
  },
  qAt = swt;
var KAt = function (e, t, n) {
    "__proto__" == t && qAt
      ? qAt(e, t, { configurable: !0, enumerable: !0, value: n, writable: !0 })
      : (e[t] = n);
  },
  GAt = KAt,
  ZAt = Mxt,
  YAt = Vyt;
var XAt = function (e, t) {
  var n = {};
  return (
    (t = YAt(t)),
    ZAt(e, function (e, i, r) {
      GAt(n, i, t(e, i, r));
    }),
    n
  );
};
const QAt = n(XAt);
var JAt = function (e, t) {
    for (var n = -1, i = null == e ? 0 : e.length; ++n < i; ) if (!t(e[n], n, e)) return !1;
    return !0;
  },
  ePt = jxt;
var tPt = function (e, t) {
    var n = !0;
    return (
      ePt(e, function (e, i, r) {
        return (n = !!t(e, i, r));
      }),
      n
    );
  },
  nPt = JAt,
  iPt = tPt,
  rPt = Vyt,
  oPt = but,
  sPt = xwt;
const aPt = n(function (e, t, n) {
  var i = oPt(e) ? nPt : iPt;
  return (n && sPt(e, t, n) && (t = void 0), i(e, rPt(t)));
});
var lPt = ["x", "y"];
function cPt(e) {
  return (cPt =
    "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
      ? function (e) {
          return typeof e;
        }
      : function (e) {
          return e &&
            "function" == typeof Symbol &&
            e.constructor === Symbol &&
            e !== Symbol.prototype
            ? "symbol"
            : typeof e;
        })(e);
}
function dPt() {
  return (
    (dPt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    dPt.apply(this, arguments)
  );
}
function uPt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function hPt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? uPt(Object(n), !0).forEach(function (t) {
          gPt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : uPt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function gPt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != cPt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != cPt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == cPt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function pPt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function fPt(e, t) {
  var n = e.x,
    i = e.y,
    r = pPt(e, lPt),
    o = "".concat(n),
    s = parseInt(o, 10),
    a = "".concat(i),
    l = parseInt(a, 10),
    c = "".concat(t.height || r.height),
    d = parseInt(c, 10),
    u = "".concat(t.width || r.width),
    h = parseInt(u, 10);
  return hPt(
    hPt(hPt(hPt(hPt({}, t), r), s ? { x: s } : {}), l ? { y: l } : {}),
    {},
    { height: d, width: h, name: t.name, radius: t.radius },
  );
}
function mPt(e) {
  return z.createElement(
    tAt,
    dPt(
      { shapeType: "rectangle", propTransformer: fPt, activeClassName: "recharts-active-bar" },
      e,
    ),
  );
}
var _Pt,
  vPt = function (e) {
    var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
    return function (n, i) {
      if ("number" == typeof e) return e;
      var r =
        Npt(n) ||
        (function (e) {
          return Zgt(e);
        })(n);
      return r ? e(n, i) : (r || ITt(), t);
    };
  },
  bPt = ["value", "background"];
function yPt(e) {
  return (
    (yPt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    yPt(e)
  );
}
function xPt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function wPt() {
  return (
    (wPt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    wPt.apply(this, arguments)
  );
}
function CPt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function SPt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? CPt(Object(n), !0).forEach(function (t) {
          TPt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : CPt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function kPt(e, t) {
  for (var n = 0; n < t.length; n++) {
    var i = t[n];
    ((i.enumerable = i.enumerable || !1),
      (i.configurable = !0),
      "value" in i && (i.writable = !0),
      Object.defineProperty(e, IPt(i.key), i));
  }
}
function EPt(e, t, n) {
  return (
    (t = LPt(t)),
    (function (e, t) {
      if (t && ("object" === yPt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, NPt() ? Reflect.construct(t, n || [], LPt(e).constructor) : t.apply(e, n))
  );
}
function NPt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (NPt = function () {
    return !!e;
  })();
}
function LPt(e) {
  return (
    (LPt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    LPt(e)
  );
}
function DPt(e, t) {
  return (
    (DPt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    DPt(e, t)
  );
}
function TPt(e, t, n) {
  return (
    (t = IPt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function IPt(e) {
  var t = (function (e, t) {
    if ("object" != yPt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != yPt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == yPt(t) ? t : t + "";
}
var RPt = (function () {
  function e() {
    var t;
    !(function (e, t) {
      if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
    })(this, e);
    for (var n = arguments.length, i = new Array(n), r = 0; r < n; r++) i[r] = arguments[r];
    return (
      TPt((t = EPt(this, e, [].concat(i))), "state", { isAnimationFinished: !1 }),
      TPt(t, "id", Tpt("recharts-bar-")),
      TPt(t, "handleAnimationEnd", function () {
        var e = t.props.onAnimationEnd;
        (t.setState({ isAnimationFinished: !0 }), e && e());
      }),
      TPt(t, "handleAnimationStart", function () {
        var e = t.props.onAnimationStart;
        (t.setState({ isAnimationFinished: !1 }), e && e());
      }),
      t
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && DPt(e, t));
    })(e, H.PureComponent),
    (t = e),
    (n = [
      {
        key: "renderRectanglesStatically",
        value: function (e) {
          var t = this,
            n = this.props,
            i = n.shape,
            r = n.dataKey,
            o = n.activeIndex,
            s = n.activeBar,
            a = rft(this.props, !1);
          return (
            e &&
            e.map(function (e, n) {
              var l = n === o,
                c = l ? s : i,
                d = SPt(
                  SPt(SPt({}, a), e),
                  {},
                  {
                    isActive: l,
                    option: c,
                    index: n,
                    dataKey: r,
                    onAnimationStart: t.handleAnimationStart,
                    onAnimationEnd: t.handleAnimationEnd,
                  },
                );
              return z.createElement(
                fft,
                wPt({ className: "recharts-bar-rectangle" }, zpt(t.props, e, n), {
                  key: "rectangle-"
                    .concat(null == e ? void 0 : e.x, "-")
                    .concat(null == e ? void 0 : e.y, "-")
                    .concat(null == e ? void 0 : e.value, "-")
                    .concat(n),
                }),
                z.createElement(mPt, d),
              );
            })
          );
        },
      },
      {
        key: "renderRectanglesWithAnimation",
        value: function () {
          var e = this,
            t = this.props,
            n = t.data,
            i = t.layout,
            r = t.isAnimationActive,
            o = t.animationBegin,
            s = t.animationDuration,
            a = t.animationEasing,
            l = t.animationId,
            c = this.state.prevData;
          return z.createElement(
            JOt,
            {
              begin: o,
              duration: s,
              isActive: r,
              easing: a,
              from: { t: 0 },
              to: { t: 1 },
              key: "bar-".concat(l),
              onAnimationEnd: this.handleAnimationEnd,
              onAnimationStart: this.handleAnimationStart,
            },
            function (t) {
              var r = t.t,
                o = n.map(function (e, t) {
                  var n = c && c[t];
                  if (n) {
                    var o = Opt(n.x, e.x),
                      s = Opt(n.y, e.y),
                      a = Opt(n.width, e.width),
                      l = Opt(n.height, e.height);
                    return SPt(SPt({}, e), {}, { x: o(r), y: s(r), width: a(r), height: l(r) });
                  }
                  if ("horizontal" === i) {
                    var d = Opt(0, e.height)(r);
                    return SPt(SPt({}, e), {}, { y: e.y + e.height - d, height: d });
                  }
                  var u = Opt(0, e.width)(r);
                  return SPt(SPt({}, e), {}, { width: u });
                });
              return z.createElement(fft, null, e.renderRectanglesStatically(o));
            },
          );
        },
      },
      {
        key: "renderRectangles",
        value: function () {
          var e = this.props,
            t = e.data,
            n = e.isAnimationActive,
            i = this.state.prevData;
          return !(n && t && t.length) || (i && LDt(i, t))
            ? this.renderRectanglesStatically(t)
            : this.renderRectanglesWithAnimation();
        },
      },
      {
        key: "renderBackground",
        value: function () {
          var e = this,
            t = this.props,
            n = t.data,
            i = t.dataKey,
            r = t.activeIndex,
            o = rft(this.props.background, !1);
          return n.map(function (t, n) {
            t.value;
            var s = t.background,
              a = xPt(t, bPt);
            if (!s) return null;
            var l = SPt(
              SPt(SPt(SPt(SPt({}, a), {}, { fill: "#eee" }, s), o), zpt(e.props, t, n)),
              {},
              {
                onAnimationStart: e.handleAnimationStart,
                onAnimationEnd: e.handleAnimationEnd,
                dataKey: i,
                index: n,
                className: "recharts-bar-background-rectangle",
              },
            );
            return z.createElement(
              mPt,
              wPt(
                { key: "background-bar-".concat(n), option: e.props.background, isActive: n === r },
                l,
              ),
            );
          });
        },
      },
      {
        key: "renderErrorBar",
        value: function (e, t) {
          if (this.props.isAnimationActive && !this.state.isAnimationFinished) return null;
          var n = this.props,
            i = n.data,
            r = n.xAxis,
            o = n.yAxis,
            s = n.layout,
            a = Jpt(n.children, $Tt);
          if (!a) return null;
          var l = "vertical" === s ? i[0].height / 2 : i[0].width / 2,
            c = function (e, t) {
              var n = Array.isArray(e.value) ? e.value[1] : e.value;
              return { x: e.x, y: e.y, value: n, errorVal: iIt(e, t) };
            },
            d = { clipPath: e ? "url(#clipPath-".concat(t, ")") : null };
          return z.createElement(
            fft,
            d,
            a.map(function (e) {
              return z.cloneElement(e, {
                key: "error-bar-".concat(t, "-").concat(e.props.dataKey),
                data: i,
                xAxis: r,
                yAxis: o,
                layout: s,
                offset: l,
                dataPointFormatter: c,
              });
            }),
          );
        },
      },
      {
        key: "render",
        value: function () {
          var e = this.props,
            t = e.hide,
            n = e.data,
            i = e.className,
            r = e.xAxis,
            o = e.yAxis,
            s = e.left,
            a = e.top,
            l = e.width,
            c = e.height,
            d = e.isAnimationActive,
            u = e.background,
            h = e.id;
          if (t || !n || !n.length) return null;
          var g = this.state.isAnimationFinished,
            p = Mp("recharts-bar", i),
            f = r && r.allowDataOverflow,
            m = o && o.allowDataOverflow,
            _ = f || m,
            v = Zgt(h) ? this.id : h;
          return z.createElement(
            fft,
            { className: p },
            f || m
              ? z.createElement(
                  "defs",
                  null,
                  z.createElement(
                    "clipPath",
                    { id: "clipPath-".concat(v) },
                    z.createElement("rect", {
                      x: f ? s : s - l / 2,
                      y: m ? a : a - c / 2,
                      width: f ? l : 2 * l,
                      height: m ? c : 2 * c,
                    }),
                  ),
                )
              : null,
            z.createElement(
              fft,
              {
                className: "recharts-bar-rectangles",
                clipPath: _ ? "url(#clipPath-".concat(v, ")") : null,
              },
              u ? this.renderBackground() : null,
              this.renderRectangles(),
            ),
            this.renderErrorBar(_, v),
            (!d || g) && sRt.renderCallByParent(this.props, n),
          );
        },
      },
    ]),
    (i = [
      {
        key: "getDerivedStateFromProps",
        value: function (e, t) {
          return e.animationId !== t.prevAnimationId
            ? { prevAnimationId: e.animationId, curData: e.data, prevData: t.curData }
            : e.data !== t.curData
              ? { curData: e.data }
              : null;
        },
      },
    ]),
    n && kPt(t.prototype, n),
    i && kPt(t, i),
    Object.defineProperty(t, "prototype", { writable: !1 }),
    t
  );
  var t, n, i;
})();
function OPt(e) {
  return (
    (OPt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    OPt(e)
  );
}
function MPt(e, t) {
  for (var n = 0; n < t.length; n++) {
    var i = t[n];
    ((i.enumerable = i.enumerable || !1),
      (i.configurable = !0),
      "value" in i && (i.writable = !0),
      Object.defineProperty(e, FPt(i.key), i));
  }
}
function APt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function PPt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? APt(Object(n), !0).forEach(function (t) {
          jPt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : APt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function jPt(e, t, n) {
  return (
    (t = FPt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function FPt(e) {
  var t = (function (e, t) {
    if ("object" != OPt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != OPt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === t ? String : Number)(e);
  })(e, "string");
  return "symbol" == OPt(t) ? t : t + "";
}
((_Pt = RPt),
  TPt(RPt, "displayName", "Bar"),
  TPt(RPt, "defaultProps", {
    xAxisId: 0,
    yAxisId: 0,
    legendType: "rect",
    minPointSize: 0,
    hide: !1,
    data: [],
    layout: "vertical",
    activeBar: !1,
    isAnimationActive: !Qwt,
    animationBegin: 0,
    animationDuration: 400,
    animationEasing: "ease",
  }),
  TPt(RPt, "getComposedData", function (e) {
    var t = e.props,
      n = e.item,
      i = e.barPosition,
      r = e.bandSize,
      o = e.xAxis,
      s = e.yAxis,
      a = e.xAxisTicks,
      l = e.yAxisTicks,
      c = e.stackedData,
      d = e.dataStartIndex,
      u = e.displayedData,
      h = e.offset,
      g = (function (e, t) {
        if (!e) return null;
        for (var n = 0, i = e.length; n < i; n++) if (e[n].item === t) return e[n].position;
        return null;
      })(i, n);
    if (!g) return null;
    var p = t.layout,
      f = n.type.defaultProps,
      m = void 0 !== f ? SPt(SPt({}, f), n.props) : n.props,
      _ = m.dataKey,
      v = m.children,
      b = m.minPointSize,
      y = "horizontal" === p ? s : o,
      x = c ? y.scale.domain() : null,
      w = (function (e) {
        var t = e.numericAxis,
          n = t.scale.domain();
        if ("number" === t.type) {
          var i = Math.min(n[0], n[1]),
            r = Math.max(n[0], n[1]);
          return i <= 0 && r >= 0 ? 0 : r < 0 ? r : i;
        }
        return n[0];
      })({ numericAxis: y }),
      C = Jpt(v, HCt),
      S = u.map(function (e, t) {
        var i, u, h, f, m, v;
        c
          ? (i = (function (e, t) {
              if (!t || 2 !== t.length || !Npt(t[0]) || !Npt(t[1])) return e;
              var n = Math.min(t[0], t[1]),
                i = Math.max(t[0], t[1]),
                r = [e[0], e[1]];
              return (
                (!Npt(e[0]) || e[0] < n) && (r[0] = n),
                (!Npt(e[1]) || e[1] > i) && (r[1] = i),
                r[0] > i && (r[0] = i),
                r[1] < n && (r[1] = n),
                r
              );
            })(c[d + t], x))
          : ((i = iIt(e, _)), Array.isArray(i) || (i = [w, i]));
        var y = vPt(b, _Pt.defaultProps.minPointSize)(i[1], t);
        if ("horizontal" === p) {
          var S,
            k = [s.scale(i[0]), s.scale(i[1])],
            E = k[0],
            N = k[1];
          ((u = _It({ axis: o, ticks: a, bandSize: r, offset: g.offset, entry: e, index: t })),
            (h = null !== (S = null != N ? N : E) && void 0 !== S ? S : void 0),
            (f = g.size));
          var L = E - N;
          if (
            ((m = Number.isNaN(L) ? 0 : L),
            (v = { x: u, y: s.y, width: f, height: s.height }),
            Math.abs(y) > 0 && Math.abs(m) < Math.abs(y))
          ) {
            var D = kpt(m || y) * (Math.abs(y) - Math.abs(m));
            ((h -= D), (m += D));
          }
        } else {
          var T = [o.scale(i[0]), o.scale(i[1])],
            I = T[0],
            R = T[1];
          if (
            ((u = I),
            (h = _It({ axis: s, ticks: l, bandSize: r, offset: g.offset, entry: e, index: t })),
            (f = R - I),
            (m = g.size),
            (v = { x: o.x, y: h, width: o.width, height: m }),
            Math.abs(y) > 0 && Math.abs(f) < Math.abs(y))
          )
            f += kpt(f || y) * (Math.abs(y) - Math.abs(f));
        }
        return SPt(
          SPt(
            SPt({}, e),
            {},
            { x: u, y: h, width: f, height: m, value: c ? i : i[1], payload: e, background: v },
            C && C[t] && C[t].props,
          ),
          {},
          { tooltipPayload: [SIt(n, e)], tooltipPosition: { x: u + f / 2, y: h + m / 2 } },
        );
      });
    return SPt({ data: S, layout: p }, h);
  }));
var BPt = function (e, t) {
    var n = e.x,
      i = e.y,
      r = t.x,
      o = t.y;
    return {
      x: Math.min(n, r),
      y: Math.min(i, o),
      width: Math.abs(r - n),
      height: Math.abs(o - i),
    };
  },
  VPt = (function () {
    function e(t) {
      (!(function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
        (this.scale = t));
    }
    return (
      (t = e),
      (n = [
        {
          key: "domain",
          get: function () {
            return this.scale.domain;
          },
        },
        {
          key: "range",
          get: function () {
            return this.scale.range;
          },
        },
        {
          key: "rangeMin",
          get: function () {
            return this.range()[0];
          },
        },
        {
          key: "rangeMax",
          get: function () {
            return this.range()[1];
          },
        },
        {
          key: "bandwidth",
          get: function () {
            return this.scale.bandwidth;
          },
        },
        {
          key: "apply",
          value: function (e) {
            var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
              n = t.bandAware,
              i = t.position;
            if (void 0 !== e) {
              if (i)
                switch (i) {
                  case "start":
                  default:
                    return this.scale(e);
                  case "middle":
                    var r = this.bandwidth ? this.bandwidth() / 2 : 0;
                    return this.scale(e) + r;
                  case "end":
                    var o = this.bandwidth ? this.bandwidth() : 0;
                    return this.scale(e) + o;
                }
              if (n) {
                var s = this.bandwidth ? this.bandwidth() / 2 : 0;
                return this.scale(e) + s;
              }
              return this.scale(e);
            }
          },
        },
        {
          key: "isInRange",
          value: function (e) {
            var t = this.range(),
              n = t[0],
              i = t[t.length - 1];
            return n <= i ? e >= n && e <= i : e >= i && e <= n;
          },
        },
      ]),
      (i = [
        {
          key: "create",
          value: function (t) {
            return new e(t);
          },
        },
      ]),
      n && MPt(t.prototype, n),
      i && MPt(t, i),
      Object.defineProperty(t, "prototype", { writable: !1 }),
      t
    );
    var t, n, i;
  })();
jPt(VPt, "EPS", 1e-4);
var WPt = function (e) {
  var t = Object.keys(e).reduce(function (t, n) {
    return PPt(PPt({}, t), {}, jPt({}, n, VPt.create(e[n])));
  }, {});
  return PPt(
    PPt({}, t),
    {},
    {
      apply: function (e) {
        var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
          i = n.bandAware,
          r = n.position;
        return QAt(e, function (e, n) {
          return t[n].apply(e, { bandAware: i, position: r });
        });
      },
      isInRange: function (e) {
        return aPt(e, function (e, n) {
          return t[n].isInRange(e);
        });
      },
    },
  );
};
var HPt = Vyt,
  zPt = Jvt,
  UPt = ibt;
var $Pt = function (e) {
    return function (t, n, i) {
      var r = Object(t);
      if (!zPt(t)) {
        var o = HPt(n);
        ((t = UPt(t)),
          (n = function (e) {
            return o(r[e], e, r);
          }));
      }
      var s = e(t, n, i);
      return s > -1 ? r[o ? t[s] : s] : void 0;
    };
  },
  qPt = pAt;
var KPt = Wyt,
  GPt = Vyt,
  ZPt = function (e) {
    var t = qPt(e),
      n = t % 1;
    return t == t ? (n ? t - n : t) : 0;
  },
  YPt = Math.max;
var XPt = function (e, t, n) {
  var i = null == e ? 0 : e.length;
  if (!i) return -1;
  var r = null == n ? 0 : ZPt(n);
  return (r < 0 && (r = YPt(i + r, 0)), KPt(e, GPt(t), r));
};
const QPt = n($Pt(XPt));
var JPt = ygt(
    function (e) {
      return { x: e.left, y: e.top, width: e.width, height: e.height };
    },
    function (e) {
      return ["l", e.left, "t", e.top, "w", e.width, "h", e.height].join("");
    },
  ),
  ejt = H.createContext(void 0),
  tjt = H.createContext(void 0),
  njt = H.createContext(void 0),
  ijt = H.createContext({}),
  rjt = H.createContext(void 0),
  ojt = H.createContext(0),
  sjt = H.createContext(0),
  ajt = function (e) {
    var t = e.state,
      n = t.xAxisMap,
      i = t.yAxisMap,
      r = t.offset,
      o = e.clipPathId,
      s = e.children,
      a = e.width,
      l = e.height,
      c = JPt(r);
    return z.createElement(
      ejt.Provider,
      { value: n },
      z.createElement(
        tjt.Provider,
        { value: i },
        z.createElement(
          ijt.Provider,
          { value: r },
          z.createElement(
            njt.Provider,
            { value: c },
            z.createElement(
              rjt.Provider,
              { value: o },
              z.createElement(
                ojt.Provider,
                { value: l },
                z.createElement(sjt.Provider, { value: a }, s),
              ),
            ),
          ),
        ),
      ),
    );
  },
  ljt = function (e) {
    var t = H.useContext(ejt);
    null == t && ITt();
    var n = t[e];
    return (null == n && ITt(), n);
  },
  cjt = function (e) {
    var t = H.useContext(tjt);
    null == t && ITt();
    var n = t[e];
    return (null == n && ITt(), n);
  },
  djt = function () {
    return H.useContext(sjt);
  },
  ujt = function () {
    return H.useContext(ojt);
  };
function hjt(e) {
  return (
    (hjt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    hjt(e)
  );
}
function gjt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, xjt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function pjt(e, t, n) {
  return (
    (t = mjt(t)),
    (function (e, t) {
      if (t && ("object" === hjt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, fjt() ? Reflect.construct(t, n || [], mjt(e).constructor) : t.apply(e, n))
  );
}
function fjt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (fjt = function () {
    return !!e;
  })();
}
function mjt(e) {
  return (
    (mjt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    mjt(e)
  );
}
function _jt(e, t) {
  return (
    (_jt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    _jt(e, t)
  );
}
function vjt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function bjt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? vjt(Object(n), !0).forEach(function (t) {
          yjt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : vjt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function yjt(e, t, n) {
  return (
    (t = xjt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function xjt(e) {
  var t = (function (e, t) {
    if ("object" != hjt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != hjt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == hjt(t) ? t : t + "";
}
function wjt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t));
          else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (e) {
          ((c = !0), (r = e));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return Cjt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Cjt(e, t);
    })(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function Cjt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function Sjt() {
  return (
    (Sjt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    Sjt.apply(this, arguments)
  );
}
function kjt(e) {
  var t = e.x,
    n = e.y,
    i = e.segment,
    r = e.xAxisId,
    o = e.yAxisId,
    s = e.shape,
    a = e.className,
    l = e.alwaysShow,
    c = H.useContext(rjt),
    d = ljt(r),
    u = cjt(o),
    h = H.useContext(njt);
  if (!c || !h) return null;
  mft(
    void 0 === l,
    'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.',
  );
  var g = (function (e, t, n, i, r, o, s, a, l) {
    var c = r.x,
      d = r.y,
      u = r.width,
      h = r.height;
    if (n) {
      var g = l.y,
        p = e.y.apply(g, { position: o });
      if ($At(l, "discard") && !e.y.isInRange(p)) return null;
      var f = [
        { x: c + u, y: p },
        { x: c, y: p },
      ];
      return "left" === a ? f.reverse() : f;
    }
    if (t) {
      var m = l.x,
        _ = e.x.apply(m, { position: o });
      if ($At(l, "discard") && !e.x.isInRange(_)) return null;
      var v = [
        { x: _, y: d + h },
        { x: _, y: d },
      ];
      return "top" === s ? v.reverse() : v;
    }
    if (i) {
      var b = l.segment.map(function (t) {
        return e.apply(t, { position: o });
      });
      return $At(l, "discard") &&
        UAt(b, function (t) {
          return !e.isInRange(t);
        })
        ? null
        : b;
    }
    return null;
  })(
    WPt({ x: d.scale, y: u.scale }),
    Lpt(t),
    Lpt(n),
    i && 2 === i.length,
    h,
    e.position,
    d.orientation,
    u.orientation,
    e,
  );
  if (!g) return null;
  var p = wjt(g, 2),
    f = p[0],
    m = f.x,
    _ = f.y,
    v = p[1],
    b = v.x,
    y = v.y,
    x = bjt(
      bjt({ clipPath: $At(e, "hidden") ? "url(#".concat(c, ")") : void 0 }, rft(e, !0)),
      {},
      { x1: m, y1: _, x2: b, y2: y },
    );
  return z.createElement(
    fft,
    { className: Mp("recharts-reference-line", a) },
    (function (e, t) {
      return z.isValidElement(e)
        ? z.cloneElement(e, t)
        : Yut(e)
          ? e(t)
          : z.createElement("line", Sjt({}, t, { className: "recharts-reference-line-line" }));
    })(s, x),
    $It.renderCallByParent(
      e,
      (function (e) {
        var t = e.x1,
          n = e.y1,
          i = e.x2,
          r = e.y2;
        return BPt({ x: t, y: n }, { x: i, y: r });
      })({ x1: m, y1: _, x2: b, y2: y }),
    ),
  );
}
var Ejt = (function () {
  function e() {
    return (
      (function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
      pjt(this, e, arguments)
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && _jt(e, t));
    })(e, z.Component),
    gjt(e, [
      {
        key: "render",
        value: function () {
          return z.createElement(kjt, this.props);
        },
      },
    ])
  );
})();
function Njt() {
  return (
    (Njt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    Njt.apply(this, arguments)
  );
}
function Ljt(e) {
  return (
    (Ljt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    Ljt(e)
  );
}
function Djt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function Tjt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? Djt(Object(n), !0).forEach(function (t) {
          Pjt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : Djt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function Ijt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, jjt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function Rjt(e, t, n) {
  return (
    (t = Mjt(t)),
    (function (e, t) {
      if (t && ("object" === Ljt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, Ojt() ? Reflect.construct(t, n || [], Mjt(e).constructor) : t.apply(e, n))
  );
}
function Ojt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (Ojt = function () {
    return !!e;
  })();
}
function Mjt(e) {
  return (
    (Mjt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    Mjt(e)
  );
}
function Ajt(e, t) {
  return (
    (Ajt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    Ajt(e, t)
  );
}
function Pjt(e, t, n) {
  return (
    (t = jjt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function jjt(e) {
  var t = (function (e, t) {
    if ("object" != Ljt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != Ljt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == Ljt(t) ? t : t + "";
}
(yjt(Ejt, "displayName", "ReferenceLine"),
  yjt(Ejt, "defaultProps", {
    isFront: !1,
    ifOverflow: "discard",
    xAxisId: 0,
    yAxisId: 0,
    fill: "none",
    stroke: "#ccc",
    fillOpacity: 1,
    strokeWidth: 1,
    position: "middle",
  }));
var Fjt = (function () {
  function e() {
    return (
      (function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
      Rjt(this, e, arguments)
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && Ajt(e, t));
    })(e, z.Component),
    Ijt(e, [
      {
        key: "render",
        value: function () {
          var t = this.props,
            n = t.x,
            i = t.y,
            r = t.r,
            o = t.alwaysShow,
            s = t.clipPathId,
            a = Lpt(n),
            l = Lpt(i);
          if (
            (mft(
              void 0 === o,
              'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.',
            ),
            !a || !l)
          )
            return null;
          var c = (function (e) {
            var t = e.x,
              n = e.y,
              i = e.xAxis,
              r = e.yAxis,
              o = WPt({ x: i.scale, y: r.scale }),
              s = o.apply({ x: t, y: n }, { bandAware: !0 });
            return $At(e, "discard") && !o.isInRange(s) ? null : s;
          })(this.props);
          if (!c) return null;
          var d = c.x,
            u = c.y,
            h = this.props,
            g = h.shape,
            p = h.className,
            f = Tjt(
              Tjt(
                { clipPath: $At(this.props, "hidden") ? "url(#".concat(s, ")") : void 0 },
                rft(this.props, !0),
              ),
              {},
              { cx: d, cy: u },
            );
          return z.createElement(
            fft,
            { className: Mp("recharts-reference-dot", p) },
            e.renderDot(g, f),
            $It.renderCallByParent(this.props, { x: d - r, y: u - r, width: 2 * r, height: 2 * r }),
          );
        },
      },
    ])
  );
})();
function Bjt() {
  return (
    (Bjt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    Bjt.apply(this, arguments)
  );
}
function Vjt(e) {
  return (
    (Vjt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    Vjt(e)
  );
}
function Wjt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function Hjt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? Wjt(Object(n), !0).forEach(function (t) {
          Gjt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : Wjt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function zjt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, Zjt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function Ujt(e, t, n) {
  return (
    (t = qjt(t)),
    (function (e, t) {
      if (t && ("object" === Vjt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, $jt() ? Reflect.construct(t, n || [], qjt(e).constructor) : t.apply(e, n))
  );
}
function $jt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return ($jt = function () {
    return !!e;
  })();
}
function qjt(e) {
  return (
    (qjt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    qjt(e)
  );
}
function Kjt(e, t) {
  return (
    (Kjt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    Kjt(e, t)
  );
}
function Gjt(e, t, n) {
  return (
    (t = Zjt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function Zjt(e) {
  var t = (function (e, t) {
    if ("object" != Vjt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != Vjt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == Vjt(t) ? t : t + "";
}
(Pjt(Fjt, "displayName", "ReferenceDot"),
  Pjt(Fjt, "defaultProps", {
    isFront: !1,
    ifOverflow: "discard",
    xAxisId: 0,
    yAxisId: 0,
    r: 10,
    fill: "#fff",
    stroke: "#ccc",
    fillOpacity: 1,
    strokeWidth: 1,
  }),
  Pjt(Fjt, "renderDot", function (e, t) {
    return z.isValidElement(e)
      ? z.cloneElement(e, t)
      : Yut(e)
        ? e(t)
        : z.createElement(
            fMt,
            Njt({}, t, { cx: t.cx, cy: t.cy, className: "recharts-reference-dot-dot" }),
          );
  }));
var Yjt = (function () {
  function e() {
    return (
      (function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
      Ujt(this, e, arguments)
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && Kjt(e, t));
    })(e, z.Component),
    zjt(e, [
      {
        key: "render",
        value: function () {
          var t = this.props,
            n = t.x1,
            i = t.x2,
            r = t.y1,
            o = t.y2,
            s = t.className,
            a = t.alwaysShow,
            l = t.clipPathId;
          mft(
            void 0 === a,
            'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.',
          );
          var c = Lpt(n),
            d = Lpt(i),
            u = Lpt(r),
            h = Lpt(o),
            g = this.props.shape;
          if (!(c || d || u || h || g)) return null;
          var p = (function (e, t, n, i, r) {
            var o = r.x1,
              s = r.x2,
              a = r.y1,
              l = r.y2,
              c = r.xAxis,
              d = r.yAxis;
            if (!c || !d) return null;
            var u = WPt({ x: c.scale, y: d.scale }),
              h = {
                x: e ? u.x.apply(o, { position: "start" }) : u.x.rangeMin,
                y: n ? u.y.apply(a, { position: "start" }) : u.y.rangeMin,
              },
              g = {
                x: t ? u.x.apply(s, { position: "end" }) : u.x.rangeMax,
                y: i ? u.y.apply(l, { position: "end" }) : u.y.rangeMax,
              };
            return !$At(r, "discard") || (u.isInRange(h) && u.isInRange(g)) ? BPt(h, g) : null;
          })(c, d, u, h, this.props);
          if (!p && !g) return null;
          var f = $At(this.props, "hidden") ? "url(#".concat(l, ")") : void 0;
          return z.createElement(
            fft,
            { className: Mp("recharts-reference-area", s) },
            e.renderRect(g, Hjt(Hjt({ clipPath: f }, rft(this.props, !0)), p)),
            $It.renderCallByParent(this.props, p),
          );
        },
      },
    ])
  );
})();
function Xjt(e, t, n) {
  if (t < 1) return [];
  if (1 === t && void 0 === n) return e;
  for (var i = [], r = 0; r < e.length; r += t) i.push(e[r]);
  return i;
}
function Qjt(e, t, n) {
  return (function (e) {
    var t = e.width,
      n = e.height,
      i = (function (e) {
        return ((e % 180) + 180) % 180;
      })(arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0),
      r = (i * Math.PI) / 180,
      o = Math.atan(n / t),
      s = r > o && r < Math.PI - o ? n / Math.sin(r) : t / Math.cos(r);
    return Math.abs(s);
  })({ width: e.width + t.width, height: e.height + t.height }, n);
}
function Jjt(e, t, n, i, r) {
  if (e * t < e * i || e * t > e * r) return !1;
  var o = n();
  return e * (t - (e * o) / 2 - i) >= 0 && e * (t + (e * o) / 2 - r) <= 0;
}
function eFt(e) {
  return (
    (eFt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    eFt(e)
  );
}
function tFt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function nFt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? tFt(Object(n), !0).forEach(function (t) {
          iFt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : tFt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function iFt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != eFt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != eFt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == eFt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function rFt(e, t, n) {
  var i = e.tick,
    r = e.ticks,
    o = e.viewBox,
    s = e.minTickGap,
    a = e.orientation,
    l = e.interval,
    c = e.tickFormatter,
    d = e.unit,
    u = e.angle;
  if (!r || !r.length || !i) return [];
  if (Npt(l) || Qwt)
    return (function (e, t) {
      return Xjt(e, t + 1);
    })(r, "number" == typeof l && Npt(l) ? l : 0);
  var h = [],
    g = "top" === a || "bottom" === a ? "width" : "height",
    p = d && "width" === g ? YCt(d, { fontSize: t, letterSpacing: n }) : { width: 0, height: 0 },
    f = function (e, i) {
      var r = Yut(c) ? c(e.value, i) : e.value;
      return "width" === g
        ? Qjt(YCt(r, { fontSize: t, letterSpacing: n }), p, u)
        : YCt(r, { fontSize: t, letterSpacing: n })[g];
    },
    m = r.length >= 2 ? kpt(r[1].coordinate - r[0].coordinate) : 1,
    _ = (function (e, t, n) {
      var i = "width" === n,
        r = e.x,
        o = e.y,
        s = e.width,
        a = e.height;
      return 1 === t
        ? { start: i ? r : o, end: i ? r + s : o + a }
        : { start: i ? r + s : o + a, end: i ? r : o };
    })(o, m, g);
  return "equidistantPreserveStart" === l
    ? (function (e, t, n, i, r) {
        for (
          var o,
            s = (i || []).slice(),
            a = t.start,
            l = t.end,
            c = 0,
            d = 1,
            u = a,
            h = function () {
              var t = null == i ? void 0 : i[c];
              if (void 0 === t) return { v: Xjt(i, d) };
              var o,
                s = c,
                h = function () {
                  return (void 0 === o && (o = n(t, s)), o);
                },
                g = t.coordinate,
                p = 0 === c || Jjt(e, g, h, u, l);
              (p || ((c = 0), (u = a), (d += 1)), p && ((u = g + e * (h() / 2 + r)), (c += d)));
            };
          d <= s.length;
        )
          if ((o = h())) return o.v;
        return [];
      })(m, _, f, r, s)
    : ((h =
        "preserveStart" === l || "preserveStartEnd" === l
          ? (function (e, t, n, i, r, o) {
              var s = (i || []).slice(),
                a = s.length,
                l = t.start,
                c = t.end;
              if (o) {
                var d = i[a - 1],
                  u = n(d, a - 1),
                  h = e * (d.coordinate + (e * u) / 2 - c);
                ((s[a - 1] = d =
                  nFt(nFt({}, d), {}, { tickCoord: h > 0 ? d.coordinate - h * e : d.coordinate })),
                  Jjt(
                    e,
                    d.tickCoord,
                    function () {
                      return u;
                    },
                    l,
                    c,
                  ) &&
                    ((c = d.tickCoord - e * (u / 2 + r)),
                    (s[a - 1] = nFt(nFt({}, d), {}, { isShow: !0 }))));
              }
              for (
                var g = o ? a - 1 : a,
                  p = function (t) {
                    var i,
                      o = s[t],
                      a = function () {
                        return (void 0 === i && (i = n(o, t)), i);
                      };
                    if (0 === t) {
                      var d = e * (o.coordinate - (e * a()) / 2 - l);
                      s[t] = o = nFt(
                        nFt({}, o),
                        {},
                        { tickCoord: d < 0 ? o.coordinate - d * e : o.coordinate },
                      );
                    } else s[t] = o = nFt(nFt({}, o), {}, { tickCoord: o.coordinate });
                    Jjt(e, o.tickCoord, a, l, c) &&
                      ((l = o.tickCoord + e * (a() / 2 + r)),
                      (s[t] = nFt(nFt({}, o), {}, { isShow: !0 })));
                  },
                  f = 0;
                f < g;
                f++
              )
                p(f);
              return s;
            })(m, _, f, r, s, "preserveStartEnd" === l)
          : (function (e, t, n, i, r) {
              for (
                var o = (i || []).slice(),
                  s = o.length,
                  a = t.start,
                  l = t.end,
                  c = function (t) {
                    var i,
                      c = o[t],
                      d = function () {
                        return (void 0 === i && (i = n(c, t)), i);
                      };
                    if (t === s - 1) {
                      var u = e * (c.coordinate + (e * d()) / 2 - l);
                      o[t] = c = nFt(
                        nFt({}, c),
                        {},
                        { tickCoord: u > 0 ? c.coordinate - u * e : c.coordinate },
                      );
                    } else o[t] = c = nFt(nFt({}, c), {}, { tickCoord: c.coordinate });
                    Jjt(e, c.tickCoord, d, a, l) &&
                      ((l = c.tickCoord - e * (d() / 2 + r)),
                      (o[t] = nFt(nFt({}, c), {}, { isShow: !0 })));
                  },
                  d = s - 1;
                d >= 0;
                d--
              )
                c(d);
              return o;
            })(m, _, f, r, s)),
      h.filter(function (e) {
        return e.isShow;
      }));
}
(Gjt(Yjt, "displayName", "ReferenceArea"),
  Gjt(Yjt, "defaultProps", {
    isFront: !1,
    ifOverflow: "discard",
    xAxisId: 0,
    yAxisId: 0,
    r: 10,
    fill: "#ccc",
    fillOpacity: 0.5,
    stroke: "none",
    strokeWidth: 1,
  }),
  Gjt(Yjt, "renderRect", function (e, t) {
    return z.isValidElement(e)
      ? z.cloneElement(e, t)
      : Yut(e)
        ? e(t)
        : z.createElement(gMt, Bjt({}, t, { className: "recharts-reference-area-rect" }));
  }));
var oFt = ["viewBox"],
  sFt = ["viewBox"],
  aFt = ["ticks"];
function lFt(e) {
  return (
    (lFt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    lFt(e)
  );
}
function cFt() {
  return (
    (cFt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    cFt.apply(this, arguments)
  );
}
function dFt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function uFt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? dFt(Object(n), !0).forEach(function (t) {
          vFt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : dFt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function hFt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function gFt(e, t) {
  for (var n = 0; n < t.length; n++) {
    var i = t[n];
    ((i.enumerable = i.enumerable || !1),
      (i.configurable = !0),
      "value" in i && (i.writable = !0),
      Object.defineProperty(e, bFt(i.key), i));
  }
}
function pFt(e, t, n) {
  return (
    (t = mFt(t)),
    (function (e, t) {
      if (t && ("object" === lFt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, fFt() ? Reflect.construct(t, n || [], mFt(e).constructor) : t.apply(e, n))
  );
}
function fFt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (fFt = function () {
    return !!e;
  })();
}
function mFt(e) {
  return (
    (mFt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    mFt(e)
  );
}
function _Ft(e, t) {
  return (
    (_Ft = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    _Ft(e, t)
  );
}
function vFt(e, t, n) {
  return (
    (t = bFt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function bFt(e) {
  var t = (function (e, t) {
    if ("object" != lFt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != lFt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == lFt(t) ? t : t + "";
}
var yFt = (function () {
  function e(t) {
    var n;
    return (
      (function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
      ((n = pFt(this, e, [t])).state = { fontSize: "", letterSpacing: "" }),
      n
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && _Ft(e, t));
    })(e, H.Component),
    (t = e),
    (n = [
      {
        key: "shouldComponentUpdate",
        value: function (e, t) {
          var n = e.viewBox,
            i = hFt(e, oFt),
            r = this.props,
            o = r.viewBox,
            s = hFt(r, sFt);
          return !Ppt(n, o) || !Ppt(i, s) || !Ppt(t, this.state);
        },
      },
      {
        key: "componentDidMount",
        value: function () {
          var e = this.layerReference;
          if (e) {
            var t = e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];
            t &&
              this.setState({
                fontSize: window.getComputedStyle(t).fontSize,
                letterSpacing: window.getComputedStyle(t).letterSpacing,
              });
          }
        },
      },
      {
        key: "getTickLineCoord",
        value: function (e) {
          var t,
            n,
            i,
            r,
            o,
            s,
            a = this.props,
            l = a.x,
            c = a.y,
            d = a.width,
            u = a.height,
            h = a.orientation,
            g = a.tickSize,
            p = a.mirror,
            f = a.tickMargin,
            m = p ? -1 : 1,
            _ = e.tickSize || g,
            v = Npt(e.tickCoord) ? e.tickCoord : e.coordinate;
          switch (h) {
            case "top":
              ((t = n = e.coordinate), (s = (i = (r = c + +!p * u) - m * _) - m * f), (o = v));
              break;
            case "left":
              ((i = r = e.coordinate), (o = (t = (n = l + +!p * d) - m * _) - m * f), (s = v));
              break;
            case "right":
              ((i = r = e.coordinate), (o = (t = (n = l + +p * d) + m * _) + m * f), (s = v));
              break;
            default:
              ((t = n = e.coordinate), (s = (i = (r = c + +p * u) + m * _) + m * f), (o = v));
          }
          return { line: { x1: t, y1: i, x2: n, y2: r }, tick: { x: o, y: s } };
        },
      },
      {
        key: "getTickTextAnchor",
        value: function () {
          var e,
            t = this.props,
            n = t.orientation,
            i = t.mirror;
          switch (n) {
            case "left":
              e = i ? "start" : "end";
              break;
            case "right":
              e = i ? "end" : "start";
              break;
            default:
              e = "middle";
          }
          return e;
        },
      },
      {
        key: "getTickVerticalAnchor",
        value: function () {
          var e = this.props,
            t = e.orientation,
            n = e.mirror,
            i = "end";
          switch (t) {
            case "left":
            case "right":
              i = "middle";
              break;
            case "top":
              i = n ? "start" : "end";
              break;
            default:
              i = n ? "end" : "start";
          }
          return i;
        },
      },
      {
        key: "renderAxisLine",
        value: function () {
          var e = this.props,
            t = e.x,
            n = e.y,
            i = e.width,
            r = e.height,
            o = e.orientation,
            s = e.mirror,
            a = e.axisLine,
            l = uFt(uFt(uFt({}, rft(this.props, !1)), rft(a, !1)), {}, { fill: "none" });
          if ("top" === o || "bottom" === o) {
            var c = +(("top" === o && !s) || ("bottom" === o && s));
            l = uFt(uFt({}, l), {}, { x1: t, y1: n + c * r, x2: t + i, y2: n + c * r });
          } else {
            var d = +(("left" === o && !s) || ("right" === o && s));
            l = uFt(uFt({}, l), {}, { x1: t + d * i, y1: n, x2: t + d * i, y2: n + r });
          }
          return z.createElement(
            "line",
            cFt({}, l, { className: Mp("recharts-cartesian-axis-line", Ggt(a, "className")) }),
          );
        },
      },
      {
        key: "renderTicks",
        value: function (t, n, i) {
          var r = this,
            o = this.props,
            s = o.tickLine,
            a = o.stroke,
            l = o.tick,
            c = o.tickFormatter,
            d = o.unit,
            u = rFt(uFt(uFt({}, this.props), {}, { ticks: t }), n, i),
            h = this.getTickTextAnchor(),
            g = this.getTickVerticalAnchor(),
            p = rft(this.props, !1),
            f = rft(l, !1),
            m = uFt(uFt({}, p), {}, { fill: "none" }, rft(s, !1)),
            _ = u.map(function (t, n) {
              var i = r.getTickLineCoord(t),
                o = i.line,
                _ = i.tick,
                v = uFt(
                  uFt(
                    uFt(
                      uFt({ textAnchor: h, verticalAnchor: g }, p),
                      {},
                      { stroke: "none", fill: a },
                      f,
                    ),
                    _,
                  ),
                  {},
                  { index: n, payload: t, visibleTicksCount: u.length, tickFormatter: c },
                );
              return z.createElement(
                fft,
                cFt(
                  {
                    className: "recharts-cartesian-axis-tick",
                    key: "tick-".concat(t.value, "-").concat(t.coordinate, "-").concat(t.tickCoord),
                  },
                  zpt(r.props, t, n),
                ),
                s &&
                  z.createElement(
                    "line",
                    cFt({}, m, o, {
                      className: Mp("recharts-cartesian-axis-tick-line", Ggt(s, "className")),
                    }),
                  ),
                l &&
                  e.renderTickItem(
                    l,
                    v,
                    "".concat(Yut(c) ? c(t.value, n) : t.value).concat(d || ""),
                  ),
              );
            });
          return z.createElement("g", { className: "recharts-cartesian-axis-ticks" }, _);
        },
      },
      {
        key: "render",
        value: function () {
          var e = this,
            t = this.props,
            n = t.axisLine,
            i = t.width,
            r = t.height,
            o = t.ticksGenerator,
            s = t.className;
          if (t.hide) return null;
          var a = this.props,
            l = a.ticks,
            c = hFt(a, aFt),
            d = l;
          return (
            Yut(o) && (d = l && l.length > 0 ? o(this.props) : o(c)),
            i <= 0 || r <= 0 || !d || !d.length
              ? null
              : z.createElement(
                  fft,
                  {
                    className: Mp("recharts-cartesian-axis", s),
                    ref: function (t) {
                      e.layerReference = t;
                    },
                  },
                  n && this.renderAxisLine(),
                  this.renderTicks(d, this.state.fontSize, this.state.letterSpacing),
                  $It.renderCallByParent(this.props),
                )
          );
        },
      },
    ]),
    (i = [
      {
        key: "renderTickItem",
        value: function (e, t, n) {
          var i = Mp(t.className, "recharts-cartesian-axis-tick-value");
          return z.isValidElement(e)
            ? z.cloneElement(e, uFt(uFt({}, t), {}, { className: i }))
            : Yut(e)
              ? e(uFt(uFt({}, t), {}, { className: i }))
              : z.createElement(
                  kSt,
                  cFt({}, t, { className: "recharts-cartesian-axis-tick-value" }),
                  n,
                );
        },
      },
    ]),
    n && gFt(t.prototype, n),
    i && gFt(t, i),
    Object.defineProperty(t, "prototype", { writable: !1 }),
    t
  );
  var t, n, i;
})();
(vFt(yFt, "displayName", "CartesianAxis"),
  vFt(yFt, "defaultProps", {
    x: 0,
    y: 0,
    width: 0,
    height: 0,
    viewBox: { x: 0, y: 0, width: 0, height: 0 },
    orientation: "bottom",
    ticks: [],
    stroke: "#666",
    tickLine: !0,
    axisLine: !0,
    tick: !0,
    mirror: !1,
    minTickGap: 5,
    tickSize: 6,
    tickMargin: 2,
    interval: "preserveEnd",
  }));
var xFt = ["x1", "y1", "x2", "y2", "key"],
  wFt = ["offset"];
function CFt(e) {
  return (
    (CFt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    CFt(e)
  );
}
function SFt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function kFt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? SFt(Object(n), !0).forEach(function (t) {
          EFt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : SFt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function EFt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != CFt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != CFt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == CFt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function NFt() {
  return (
    (NFt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    NFt.apply(this, arguments)
  );
}
function LFt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
var DFt = function (e) {
  var t = e.fill;
  if (!t || "none" === t) return null;
  var n = e.fillOpacity,
    i = e.x,
    r = e.y,
    o = e.width,
    s = e.height,
    a = e.ry;
  return z.createElement("rect", {
    x: i,
    y: r,
    ry: a,
    width: o,
    height: s,
    stroke: "none",
    fill: t,
    fillOpacity: n,
    className: "recharts-cartesian-grid-bg",
  });
};
function TFt(e, t) {
  var n;
  if (z.isValidElement(e)) n = z.cloneElement(e, t);
  else if (Yut(e)) n = e(t);
  else {
    var i = t.x1,
      r = t.y1,
      o = t.x2,
      s = t.y2,
      a = t.key,
      l = LFt(t, xFt),
      c = rft(l, !1);
    c.offset;
    var d = LFt(c, wFt);
    n = z.createElement("line", NFt({}, d, { x1: i, y1: r, x2: o, y2: s, fill: "none", key: a }));
  }
  return n;
}
function IFt(e) {
  var t = e.x,
    n = e.width,
    i = e.horizontal,
    r = void 0 === i || i,
    o = e.horizontalPoints;
  if (!r || !o || !o.length) return null;
  var s = o.map(function (i, o) {
    var s = kFt(
      kFt({}, e),
      {},
      { x1: t, y1: i, x2: t + n, y2: i, key: "line-".concat(o), index: o },
    );
    return TFt(r, s);
  });
  return z.createElement("g", { className: "recharts-cartesian-grid-horizontal" }, s);
}
function RFt(e) {
  var t = e.y,
    n = e.height,
    i = e.vertical,
    r = void 0 === i || i,
    o = e.verticalPoints;
  if (!r || !o || !o.length) return null;
  var s = o.map(function (i, o) {
    var s = kFt(
      kFt({}, e),
      {},
      { x1: i, y1: t, x2: i, y2: t + n, key: "line-".concat(o), index: o },
    );
    return TFt(r, s);
  });
  return z.createElement("g", { className: "recharts-cartesian-grid-vertical" }, s);
}
function OFt(e) {
  var t = e.horizontalFill,
    n = e.fillOpacity,
    i = e.x,
    r = e.y,
    o = e.width,
    s = e.height,
    a = e.horizontalPoints,
    l = e.horizontal;
  if (!(void 0 === l || l) || !t || !t.length) return null;
  var c = a
    .map(function (e) {
      return Math.round(e + r - r);
    })
    .sort(function (e, t) {
      return e - t;
    });
  r !== c[0] && c.unshift(0);
  var d = c.map(function (e, a) {
    var l = !c[a + 1] ? r + s - e : c[a + 1] - e;
    if (l <= 0) return null;
    var d = a % t.length;
    return z.createElement("rect", {
      key: "react-".concat(a),
      y: e,
      x: i,
      height: l,
      width: o,
      stroke: "none",
      fill: t[d],
      fillOpacity: n,
      className: "recharts-cartesian-grid-bg",
    });
  });
  return z.createElement("g", { className: "recharts-cartesian-gridstripes-horizontal" }, d);
}
function MFt(e) {
  var t = e.vertical,
    n = void 0 === t || t,
    i = e.verticalFill,
    r = e.fillOpacity,
    o = e.x,
    s = e.y,
    a = e.width,
    l = e.height,
    c = e.verticalPoints;
  if (!n || !i || !i.length) return null;
  var d = c
    .map(function (e) {
      return Math.round(e + o - o);
    })
    .sort(function (e, t) {
      return e - t;
    });
  o !== d[0] && d.unshift(0);
  var u = d.map(function (e, t) {
    var n = !d[t + 1] ? o + a - e : d[t + 1] - e;
    if (n <= 0) return null;
    var c = t % i.length;
    return z.createElement("rect", {
      key: "react-".concat(t),
      x: e,
      y: s,
      width: n,
      height: l,
      stroke: "none",
      fill: i[c],
      fillOpacity: r,
      className: "recharts-cartesian-grid-bg",
    });
  });
  return z.createElement("g", { className: "recharts-cartesian-gridstripes-vertical" }, u);
}
var AFt = function (e, t) {
    var n = e.xAxis,
      i = e.width,
      r = e.height,
      o = e.offset;
    return cIt(
      rFt(
        kFt(
          kFt(kFt({}, yFt.defaultProps), n),
          {},
          { ticks: dIt(n, !0), viewBox: { x: 0, y: 0, width: i, height: r } },
        ),
      ),
      o.left,
      o.left + o.width,
      t,
    );
  },
  PFt = function (e, t) {
    var n = e.yAxis,
      i = e.width,
      r = e.height,
      o = e.offset;
    return cIt(
      rFt(
        kFt(
          kFt(kFt({}, yFt.defaultProps), n),
          {},
          { ticks: dIt(n, !0), viewBox: { x: 0, y: 0, width: i, height: r } },
        ),
      ),
      o.top,
      o.top + o.height,
      t,
    );
  },
  jFt = {
    horizontal: !0,
    vertical: !0,
    stroke: "#ccc",
    fill: "none",
    verticalFill: [],
    horizontalFill: [],
  };
function FFt(e) {
  var t,
    n,
    i,
    r,
    o,
    s,
    a,
    l,
    c = djt(),
    d = ujt(),
    u = H.useContext(ijt),
    h = kFt(
      kFt({}, e),
      {},
      {
        stroke: null !== (t = e.stroke) && void 0 !== t ? t : jFt.stroke,
        fill: null !== (n = e.fill) && void 0 !== n ? n : jFt.fill,
        horizontal: null !== (i = e.horizontal) && void 0 !== i ? i : jFt.horizontal,
        horizontalFill: null !== (r = e.horizontalFill) && void 0 !== r ? r : jFt.horizontalFill,
        vertical: null !== (o = e.vertical) && void 0 !== o ? o : jFt.vertical,
        verticalFill: null !== (s = e.verticalFill) && void 0 !== s ? s : jFt.verticalFill,
        x: Npt(e.x) ? e.x : u.left,
        y: Npt(e.y) ? e.y : u.top,
        width: Npt(e.width) ? e.width : u.width,
        height: Npt(e.height) ? e.height : u.height,
      },
    ),
    g = h.x,
    p = h.y,
    f = h.width,
    m = h.height,
    _ = h.syncWithTicks,
    v = h.horizontalValues,
    b = h.verticalValues,
    y = ((a = H.useContext(ejt)), Rpt(a)),
    x =
      ((l = H.useContext(tjt)),
      QPt(l, function (e) {
        return aPt(e.domain, Number.isFinite);
      }) || Rpt(l));
  if (!Npt(f) || f <= 0 || !Npt(m) || m <= 0 || !Npt(g) || g !== +g || !Npt(p) || p !== +p)
    return null;
  var w = h.verticalCoordinatesGenerator || AFt,
    C = h.horizontalCoordinatesGenerator || PFt,
    S = h.horizontalPoints,
    k = h.verticalPoints;
  if ((!S || !S.length) && Yut(C)) {
    var E = v && v.length,
      N = C(
        {
          yAxis: x ? kFt(kFt({}, x), {}, { ticks: E ? v : x.ticks }) : void 0,
          width: c,
          height: d,
          offset: u,
        },
        !!E || _,
      );
    (mft(
      Array.isArray(N),
      "horizontalCoordinatesGenerator should return Array but instead it returned [".concat(
        CFt(N),
        "]",
      ),
    ),
      Array.isArray(N) && (S = N));
  }
  if ((!k || !k.length) && Yut(w)) {
    var L = b && b.length,
      D = w(
        {
          xAxis: y ? kFt(kFt({}, y), {}, { ticks: L ? b : y.ticks }) : void 0,
          width: c,
          height: d,
          offset: u,
        },
        !!L || _,
      );
    (mft(
      Array.isArray(D),
      "verticalCoordinatesGenerator should return Array but instead it returned [".concat(
        CFt(D),
        "]",
      ),
    ),
      Array.isArray(D) && (k = D));
  }
  return z.createElement(
    "g",
    { className: "recharts-cartesian-grid" },
    z.createElement(DFt, {
      fill: h.fill,
      fillOpacity: h.fillOpacity,
      x: h.x,
      y: h.y,
      width: h.width,
      height: h.height,
      ry: h.ry,
    }),
    z.createElement(IFt, NFt({}, h, { offset: u, horizontalPoints: S, xAxis: y, yAxis: x })),
    z.createElement(RFt, NFt({}, h, { offset: u, verticalPoints: k, xAxis: y, yAxis: x })),
    z.createElement(OFt, NFt({}, h, { horizontalPoints: S })),
    z.createElement(MFt, NFt({}, h, { verticalPoints: k })),
  );
}
FFt.displayName = "CartesianGrid";
var BFt = ["type", "layout", "connectNulls", "ref"],
  VFt = ["key"];
function WFt(e) {
  return (
    (WFt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    WFt(e)
  );
}
function HFt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function zFt() {
  return (
    (zFt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    zFt.apply(this, arguments)
  );
}
function UFt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function $Ft(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? UFt(Object(n), !0).forEach(function (t) {
          JFt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : UFt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function qFt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return KFt(e);
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return KFt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return KFt(e, t);
    })(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function KFt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function GFt(e, t) {
  for (var n = 0; n < t.length; n++) {
    var i = t[n];
    ((i.enumerable = i.enumerable || !1),
      (i.configurable = !0),
      "value" in i && (i.writable = !0),
      Object.defineProperty(e, eBt(i.key), i));
  }
}
function ZFt(e, t, n) {
  return (
    (t = XFt(t)),
    (function (e, t) {
      if (t && ("object" === WFt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, YFt() ? Reflect.construct(t, n || [], XFt(e).constructor) : t.apply(e, n))
  );
}
function YFt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (YFt = function () {
    return !!e;
  })();
}
function XFt(e) {
  return (
    (XFt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    XFt(e)
  );
}
function QFt(e, t) {
  return (
    (QFt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    QFt(e, t)
  );
}
function JFt(e, t, n) {
  return (
    (t = eBt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function eBt(e) {
  var t = (function (e, t) {
    if ("object" != WFt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != WFt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === t ? String : Number)(e);
  })(e, "string");
  return "symbol" == WFt(t) ? t : t + "";
}
var tBt = (function () {
  function e() {
    var t;
    !(function (e, t) {
      if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
    })(this, e);
    for (var n = arguments.length, i = new Array(n), r = 0; r < n; r++) i[r] = arguments[r];
    return (
      JFt((t = ZFt(this, e, [].concat(i))), "state", { isAnimationFinished: !0, totalLength: 0 }),
      JFt(t, "generateSimpleStrokeDasharray", function (e, t) {
        return "".concat(t, "px ").concat(e - t, "px");
      }),
      JFt(t, "getStrokeDasharray", function (n, i, r) {
        var o = r.reduce(function (e, t) {
          return e + t;
        });
        if (!o) return t.generateSimpleStrokeDasharray(i, n);
        for (
          var s = Math.floor(n / o), a = n % o, l = i - n, c = [], d = 0, u = 0;
          d < r.length;
          u += r[d], ++d
        )
          if (u + r[d] > a) {
            c = [].concat(qFt(r.slice(0, d)), [a - u]);
            break;
          }
        var h = c.length % 2 == 0 ? [0, l] : [l];
        return []
          .concat(qFt(e.repeat(r, s)), qFt(c), h)
          .map(function (e) {
            return "".concat(e, "px");
          })
          .join(", ");
      }),
      JFt(t, "id", Tpt("recharts-line-")),
      JFt(t, "pathRef", function (e) {
        t.mainCurve = e;
      }),
      JFt(t, "handleAnimationEnd", function () {
        (t.setState({ isAnimationFinished: !0 }),
          t.props.onAnimationEnd && t.props.onAnimationEnd());
      }),
      JFt(t, "handleAnimationStart", function () {
        (t.setState({ isAnimationFinished: !1 }),
          t.props.onAnimationStart && t.props.onAnimationStart());
      }),
      t
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && QFt(e, t));
    })(e, H.PureComponent),
    (t = e),
    (n = [
      {
        key: "componentDidMount",
        value: function () {
          if (this.props.isAnimationActive) {
            var e = this.getTotalLength();
            this.setState({ totalLength: e });
          }
        },
      },
      {
        key: "componentDidUpdate",
        value: function () {
          if (this.props.isAnimationActive) {
            var e = this.getTotalLength();
            e !== this.state.totalLength && this.setState({ totalLength: e });
          }
        },
      },
      {
        key: "getTotalLength",
        value: function () {
          var e = this.mainCurve;
          try {
            return (e && e.getTotalLength && e.getTotalLength()) || 0;
          } catch (W8t) {
            return 0;
          }
        },
      },
      {
        key: "renderErrorBar",
        value: function (e, t) {
          if (this.props.isAnimationActive && !this.state.isAnimationFinished) return null;
          var n = this.props,
            i = n.points,
            r = n.xAxis,
            o = n.yAxis,
            s = n.layout,
            a = Jpt(n.children, $Tt);
          if (!a) return null;
          var l = function (e, t) {
              return { x: e.x, y: e.y, value: e.value, errorVal: iIt(e.payload, t) };
            },
            c = { clipPath: e ? "url(#clipPath-".concat(t, ")") : null };
          return z.createElement(
            fft,
            c,
            a.map(function (e) {
              return z.cloneElement(e, {
                key: "bar-".concat(e.props.dataKey),
                data: i,
                xAxis: r,
                yAxis: o,
                layout: s,
                dataPointFormatter: l,
              });
            }),
          );
        },
      },
      {
        key: "renderDots",
        value: function (t, n, i) {
          if (this.props.isAnimationActive && !this.state.isAnimationFinished) return null;
          var r = this.props,
            o = r.dot,
            s = r.points,
            a = r.dataKey,
            l = rft(this.props, !1),
            c = rft(o, !0),
            d = s.map(function (t, n) {
              var i = $Ft(
                $Ft($Ft({ key: "dot-".concat(n), r: 3 }, l), c),
                {},
                {
                  index: n,
                  cx: t.x,
                  cy: t.y,
                  value: t.value,
                  dataKey: a,
                  payload: t.payload,
                  points: s,
                },
              );
              return e.renderDotItem(o, i);
            }),
            u = { clipPath: t ? "url(#clipPath-".concat(n ? "" : "dots-").concat(i, ")") : null };
          return z.createElement(fft, zFt({ className: "recharts-line-dots", key: "dots" }, u), d);
        },
      },
      {
        key: "renderCurveStatically",
        value: function (e, t, n, i) {
          var r = this.props,
            o = r.type,
            s = r.layout,
            a = r.connectNulls;
          r.ref;
          var l = HFt(r, BFt),
            c = $Ft(
              $Ft(
                $Ft({}, rft(l, !0)),
                {},
                {
                  fill: "none",
                  className: "recharts-line-curve",
                  clipPath: t ? "url(#clipPath-".concat(n, ")") : null,
                  points: e,
                },
                i,
              ),
              {},
              { type: o, layout: s, connectNulls: a },
            );
          return z.createElement(ERt, zFt({}, c, { pathRef: this.pathRef }));
        },
      },
      {
        key: "renderCurveWithAnimation",
        value: function (e, t) {
          var n = this,
            i = this.props,
            r = i.points,
            o = i.strokeDasharray,
            s = i.isAnimationActive,
            a = i.animationBegin,
            l = i.animationDuration,
            c = i.animationEasing,
            d = i.animationId,
            u = i.animateNewValues,
            h = i.width,
            g = i.height,
            p = this.state,
            f = p.prevPoints,
            m = p.totalLength;
          return z.createElement(
            JOt,
            {
              begin: a,
              duration: l,
              isActive: s,
              easing: c,
              from: { t: 0 },
              to: { t: 1 },
              key: "line-".concat(d),
              onAnimationEnd: this.handleAnimationEnd,
              onAnimationStart: this.handleAnimationStart,
            },
            function (i) {
              var s = i.t;
              if (f) {
                var a = f.length / r.length,
                  l = r.map(function (e, t) {
                    var n = Math.floor(t * a);
                    if (f[n]) {
                      var i = f[n],
                        r = Opt(i.x, e.x),
                        o = Opt(i.y, e.y);
                      return $Ft($Ft({}, e), {}, { x: r(s), y: o(s) });
                    }
                    if (u) {
                      var l = Opt(2 * h, e.x),
                        c = Opt(g / 2, e.y);
                      return $Ft($Ft({}, e), {}, { x: l(s), y: c(s) });
                    }
                    return $Ft($Ft({}, e), {}, { x: e.x, y: e.y });
                  });
                return n.renderCurveStatically(l, e, t);
              }
              var c,
                d = Opt(0, m)(s);
              if (o) {
                var p = ""
                  .concat(o)
                  .split(/[,\s]+/gim)
                  .map(function (e) {
                    return parseFloat(e);
                  });
                c = n.getStrokeDasharray(d, m, p);
              } else c = n.generateSimpleStrokeDasharray(m, d);
              return n.renderCurveStatically(r, e, t, { strokeDasharray: c });
            },
          );
        },
      },
      {
        key: "renderCurve",
        value: function (e, t) {
          var n = this.props,
            i = n.points,
            r = n.isAnimationActive,
            o = this.state,
            s = o.prevPoints,
            a = o.totalLength;
          return r && i && i.length && ((!s && a > 0) || !LDt(s, i))
            ? this.renderCurveWithAnimation(e, t)
            : this.renderCurveStatically(i, e, t);
        },
      },
      {
        key: "render",
        value: function () {
          var e,
            t = this.props,
            n = t.hide,
            i = t.dot,
            r = t.points,
            o = t.className,
            s = t.xAxis,
            a = t.yAxis,
            l = t.top,
            c = t.left,
            d = t.width,
            u = t.height,
            h = t.isAnimationActive,
            g = t.id;
          if (n || !r || !r.length) return null;
          var p = this.state.isAnimationFinished,
            f = 1 === r.length,
            m = Mp("recharts-line", o),
            _ = s && s.allowDataOverflow,
            v = a && a.allowDataOverflow,
            b = _ || v,
            y = Zgt(g) ? this.id : g,
            x = null !== (e = rft(i, !1)) && void 0 !== e ? e : { r: 3, strokeWidth: 2 },
            w = x.r,
            C = void 0 === w ? 3 : w,
            S = x.strokeWidth,
            k = void 0 === S ? 2 : S,
            E = (ift(i) ? i : {}).clipDot,
            N = void 0 === E || E,
            L = 2 * C + k;
          return z.createElement(
            fft,
            { className: m },
            _ || v
              ? z.createElement(
                  "defs",
                  null,
                  z.createElement(
                    "clipPath",
                    { id: "clipPath-".concat(y) },
                    z.createElement("rect", {
                      x: _ ? c : c - d / 2,
                      y: v ? l : l - u / 2,
                      width: _ ? d : 2 * d,
                      height: v ? u : 2 * u,
                    }),
                  ),
                  !N &&
                    z.createElement(
                      "clipPath",
                      { id: "clipPath-dots-".concat(y) },
                      z.createElement("rect", {
                        x: c - L / 2,
                        y: l - L / 2,
                        width: d + L,
                        height: u + L,
                      }),
                    ),
                )
              : null,
            !f && this.renderCurve(b, y),
            this.renderErrorBar(b, y),
            (f || i) && this.renderDots(b, N, y),
            (!h || p) && sRt.renderCallByParent(this.props, r),
          );
        },
      },
    ]),
    (i = [
      {
        key: "getDerivedStateFromProps",
        value: function (e, t) {
          return e.animationId !== t.prevAnimationId
            ? { prevAnimationId: e.animationId, curPoints: e.points, prevPoints: t.curPoints }
            : e.points !== t.curPoints
              ? { curPoints: e.points }
              : null;
        },
      },
      {
        key: "repeat",
        value: function (e, t) {
          for (var n = e.length % 2 != 0 ? [].concat(qFt(e), [0]) : e, i = [], r = 0; r < t; ++r)
            i = [].concat(qFt(i), qFt(n));
          return i;
        },
      },
      {
        key: "renderDotItem",
        value: function (e, t) {
          var n;
          if (z.isValidElement(e)) n = z.cloneElement(e, t);
          else if (Yut(e)) n = e(t);
          else {
            var i = t.key,
              r = HFt(t, VFt),
              o = Mp("recharts-line-dot", "boolean" != typeof e ? e.className : "");
            n = z.createElement(fMt, zFt({ key: i }, r, { className: o }));
          }
          return n;
        },
      },
    ]),
    n && GFt(t.prototype, n),
    i && GFt(t, i),
    Object.defineProperty(t, "prototype", { writable: !1 }),
    t
  );
  var t, n, i;
})();
(JFt(tBt, "displayName", "Line"),
  JFt(tBt, "defaultProps", {
    xAxisId: 0,
    yAxisId: 0,
    connectNulls: !1,
    activeDot: !0,
    dot: !0,
    legendType: "line",
    stroke: "#3182bd",
    strokeWidth: 1,
    fill: "#fff",
    points: [],
    isAnimationActive: !Qwt,
    animateNewValues: !0,
    animationBegin: 0,
    animationDuration: 1500,
    animationEasing: "ease",
    hide: !1,
    label: !1,
  }),
  JFt(tBt, "getComposedData", function (e) {
    var t = e.props,
      n = e.xAxis,
      i = e.yAxis,
      r = e.xAxisTicks,
      o = e.yAxisTicks,
      s = e.dataKey,
      a = e.bandSize,
      l = e.displayedData,
      c = e.offset,
      d = t.layout,
      u = l.map(function (e, t) {
        var l = iIt(e, s);
        return "horizontal" === d
          ? {
              x: mIt({ axis: n, ticks: r, bandSize: a, entry: e, index: t }),
              y: Zgt(l) ? null : i.scale(l),
              value: l,
              payload: e,
            }
          : {
              x: Zgt(l) ? null : n.scale(l),
              y: mIt({ axis: i, ticks: o, bandSize: a, entry: e, index: t }),
              value: l,
              payload: e,
            };
      });
    return $Ft({ points: u, layout: d }, c);
  }));
var nBt,
  iBt = ["layout", "type", "stroke", "connectNulls", "isRange", "ref"],
  rBt = ["key"];
function oBt(e) {
  return (
    (oBt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    oBt(e)
  );
}
function sBt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function aBt() {
  return (
    (aBt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    aBt.apply(this, arguments)
  );
}
function lBt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function cBt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? lBt(Object(n), !0).forEach(function (t) {
          fBt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : lBt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function dBt(e, t) {
  for (var n = 0; n < t.length; n++) {
    var i = t[n];
    ((i.enumerable = i.enumerable || !1),
      (i.configurable = !0),
      "value" in i && (i.writable = !0),
      Object.defineProperty(e, mBt(i.key), i));
  }
}
function uBt(e, t, n) {
  return (
    (t = gBt(t)),
    (function (e, t) {
      if (t && ("object" === oBt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, hBt() ? Reflect.construct(t, n || [], gBt(e).constructor) : t.apply(e, n))
  );
}
function hBt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (hBt = function () {
    return !!e;
  })();
}
function gBt(e) {
  return (
    (gBt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    gBt(e)
  );
}
function pBt(e, t) {
  return (
    (pBt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    pBt(e, t)
  );
}
function fBt(e, t, n) {
  return (
    (t = mBt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function mBt(e) {
  var t = (function (e, t) {
    if ("object" != oBt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != oBt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == oBt(t) ? t : t + "";
}
var _Bt = (function () {
  function e() {
    var t;
    !(function (e, t) {
      if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
    })(this, e);
    for (var n = arguments.length, i = new Array(n), r = 0; r < n; r++) i[r] = arguments[r];
    return (
      fBt((t = uBt(this, e, [].concat(i))), "state", { isAnimationFinished: !0 }),
      fBt(t, "id", Tpt("recharts-area-")),
      fBt(t, "handleAnimationEnd", function () {
        var e = t.props.onAnimationEnd;
        (t.setState({ isAnimationFinished: !0 }), Yut(e) && e());
      }),
      fBt(t, "handleAnimationStart", function () {
        var e = t.props.onAnimationStart;
        (t.setState({ isAnimationFinished: !1 }), Yut(e) && e());
      }),
      t
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && pBt(e, t));
    })(e, H.PureComponent),
    (t = e),
    (n = [
      {
        key: "renderDots",
        value: function (t, n, i) {
          var r = this.props.isAnimationActive,
            o = this.state.isAnimationFinished;
          if (r && !o) return null;
          var s = this.props,
            a = s.dot,
            l = s.points,
            c = s.dataKey,
            d = rft(this.props, !1),
            u = rft(a, !0),
            h = l.map(function (t, n) {
              var i = cBt(
                cBt(cBt({ key: "dot-".concat(n), r: 3 }, d), u),
                {},
                {
                  index: n,
                  cx: t.x,
                  cy: t.y,
                  dataKey: c,
                  value: t.value,
                  payload: t.payload,
                  points: l,
                },
              );
              return e.renderDotItem(a, i);
            }),
            g = { clipPath: t ? "url(#clipPath-".concat(n ? "" : "dots-").concat(i, ")") : null };
          return z.createElement(fft, aBt({ className: "recharts-area-dots" }, g), h);
        },
      },
      {
        key: "renderHorizontalRect",
        value: function (e) {
          var t = this.props,
            n = t.baseLine,
            i = t.points,
            r = t.strokeWidth,
            o = i[0].x,
            s = i[i.length - 1].x,
            a = e * Math.abs(o - s),
            l = pDt(
              i.map(function (e) {
                return e.y || 0;
              }),
            );
          return (
            Npt(n) && "number" == typeof n
              ? (l = Math.max(n, l))
              : n &&
                Array.isArray(n) &&
                n.length &&
                (l = Math.max(
                  pDt(
                    n.map(function (e) {
                      return e.y || 0;
                    }),
                  ),
                  l,
                )),
            Npt(l)
              ? z.createElement("rect", {
                  x: o < s ? o : o - a,
                  y: 0,
                  width: a,
                  height: Math.floor(l + (r ? parseInt("".concat(r), 10) : 1)),
                })
              : null
          );
        },
      },
      {
        key: "renderVerticalRect",
        value: function (e) {
          var t = this.props,
            n = t.baseLine,
            i = t.points,
            r = t.strokeWidth,
            o = i[0].y,
            s = i[i.length - 1].y,
            a = e * Math.abs(o - s),
            l = pDt(
              i.map(function (e) {
                return e.x || 0;
              }),
            );
          return (
            Npt(n) && "number" == typeof n
              ? (l = Math.max(n, l))
              : n &&
                Array.isArray(n) &&
                n.length &&
                (l = Math.max(
                  pDt(
                    n.map(function (e) {
                      return e.x || 0;
                    }),
                  ),
                  l,
                )),
            Npt(l)
              ? z.createElement("rect", {
                  x: 0,
                  y: o < s ? o : o - a,
                  width: l + (r ? parseInt("".concat(r), 10) : 1),
                  height: Math.floor(a),
                })
              : null
          );
        },
      },
      {
        key: "renderClipRect",
        value: function (e) {
          return "vertical" === this.props.layout
            ? this.renderVerticalRect(e)
            : this.renderHorizontalRect(e);
        },
      },
      {
        key: "renderAreaStatically",
        value: function (e, t, n, i) {
          var r = this.props,
            o = r.layout,
            s = r.type,
            a = r.stroke,
            l = r.connectNulls,
            c = r.isRange;
          r.ref;
          var d = sBt(r, iBt);
          return z.createElement(
            fft,
            { clipPath: n ? "url(#clipPath-".concat(i, ")") : null },
            z.createElement(
              ERt,
              aBt({}, rft(d, !0), {
                points: e,
                connectNulls: l,
                type: s,
                baseLine: t,
                layout: o,
                stroke: "none",
                className: "recharts-area-area",
              }),
            ),
            "none" !== a &&
              z.createElement(
                ERt,
                aBt({}, rft(this.props, !1), {
                  className: "recharts-area-curve",
                  layout: o,
                  type: s,
                  connectNulls: l,
                  fill: "none",
                  points: e,
                }),
              ),
            "none" !== a &&
              c &&
              z.createElement(
                ERt,
                aBt({}, rft(this.props, !1), {
                  className: "recharts-area-curve",
                  layout: o,
                  type: s,
                  connectNulls: l,
                  fill: "none",
                  points: t,
                }),
              ),
          );
        },
      },
      {
        key: "renderAreaWithAnimation",
        value: function (e, t) {
          var n = this,
            i = this.props,
            r = i.points,
            o = i.baseLine,
            s = i.isAnimationActive,
            a = i.animationBegin,
            l = i.animationDuration,
            c = i.animationEasing,
            d = i.animationId,
            u = this.state,
            h = u.prevPoints,
            g = u.prevBaseLine;
          return z.createElement(
            JOt,
            {
              begin: a,
              duration: l,
              isActive: s,
              easing: c,
              from: { t: 0 },
              to: { t: 1 },
              key: "area-".concat(d),
              onAnimationEnd: this.handleAnimationEnd,
              onAnimationStart: this.handleAnimationStart,
            },
            function (i) {
              var s = i.t;
              if (h) {
                var a,
                  l = h.length / r.length,
                  c = r.map(function (e, t) {
                    var n = Math.floor(t * l);
                    if (h[n]) {
                      var i = h[n],
                        r = Opt(i.x, e.x),
                        o = Opt(i.y, e.y);
                      return cBt(cBt({}, e), {}, { x: r(s), y: o(s) });
                    }
                    return e;
                  });
                return (
                  (a =
                    Npt(o) && "number" == typeof o
                      ? Opt(g, o)(s)
                      : Zgt(o) || Spt(o)
                        ? Opt(g, 0)(s)
                        : o.map(function (e, t) {
                            var n = Math.floor(t * l);
                            if (g[n]) {
                              var i = g[n],
                                r = Opt(i.x, e.x),
                                o = Opt(i.y, e.y);
                              return cBt(cBt({}, e), {}, { x: r(s), y: o(s) });
                            }
                            return e;
                          })),
                  n.renderAreaStatically(c, a, e, t)
                );
              }
              return z.createElement(
                fft,
                null,
                z.createElement(
                  "defs",
                  null,
                  z.createElement(
                    "clipPath",
                    { id: "animationClipPath-".concat(t) },
                    n.renderClipRect(s),
                  ),
                ),
                z.createElement(
                  fft,
                  { clipPath: "url(#animationClipPath-".concat(t, ")") },
                  n.renderAreaStatically(r, o, e, t),
                ),
              );
            },
          );
        },
      },
      {
        key: "renderArea",
        value: function (e, t) {
          var n = this.props,
            i = n.points,
            r = n.baseLine,
            o = n.isAnimationActive,
            s = this.state,
            a = s.prevPoints,
            l = s.prevBaseLine,
            c = s.totalLength;
          return o && i && i.length && ((!a && c > 0) || !LDt(a, i) || !LDt(l, r))
            ? this.renderAreaWithAnimation(e, t)
            : this.renderAreaStatically(i, r, e, t);
        },
      },
      {
        key: "render",
        value: function () {
          var e,
            t = this.props,
            n = t.hide,
            i = t.dot,
            r = t.points,
            o = t.className,
            s = t.top,
            a = t.left,
            l = t.xAxis,
            c = t.yAxis,
            d = t.width,
            u = t.height,
            h = t.isAnimationActive,
            g = t.id;
          if (n || !r || !r.length) return null;
          var p = this.state.isAnimationFinished,
            f = 1 === r.length,
            m = Mp("recharts-area", o),
            _ = l && l.allowDataOverflow,
            v = c && c.allowDataOverflow,
            b = _ || v,
            y = Zgt(g) ? this.id : g,
            x = null !== (e = rft(i, !1)) && void 0 !== e ? e : { r: 3, strokeWidth: 2 },
            w = x.r,
            C = void 0 === w ? 3 : w,
            S = x.strokeWidth,
            k = void 0 === S ? 2 : S,
            E = (ift(i) ? i : {}).clipDot,
            N = void 0 === E || E,
            L = 2 * C + k;
          return z.createElement(
            fft,
            { className: m },
            _ || v
              ? z.createElement(
                  "defs",
                  null,
                  z.createElement(
                    "clipPath",
                    { id: "clipPath-".concat(y) },
                    z.createElement("rect", {
                      x: _ ? a : a - d / 2,
                      y: v ? s : s - u / 2,
                      width: _ ? d : 2 * d,
                      height: v ? u : 2 * u,
                    }),
                  ),
                  !N &&
                    z.createElement(
                      "clipPath",
                      { id: "clipPath-dots-".concat(y) },
                      z.createElement("rect", {
                        x: a - L / 2,
                        y: s - L / 2,
                        width: d + L,
                        height: u + L,
                      }),
                    ),
                )
              : null,
            f ? null : this.renderArea(b, y),
            (i || f) && this.renderDots(b, N, y),
            (!h || p) && sRt.renderCallByParent(this.props, r),
          );
        },
      },
    ]),
    (i = [
      {
        key: "getDerivedStateFromProps",
        value: function (e, t) {
          return e.animationId !== t.prevAnimationId
            ? {
                prevAnimationId: e.animationId,
                curPoints: e.points,
                curBaseLine: e.baseLine,
                prevPoints: t.curPoints,
                prevBaseLine: t.curBaseLine,
              }
            : e.points !== t.curPoints || e.baseLine !== t.curBaseLine
              ? { curPoints: e.points, curBaseLine: e.baseLine }
              : null;
        },
      },
    ]),
    n && dBt(t.prototype, n),
    i && dBt(t, i),
    Object.defineProperty(t, "prototype", { writable: !1 }),
    t
  );
  var t, n, i;
})();
function vBt(e) {
  return (
    (vBt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    vBt(e)
  );
}
function bBt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, kBt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function yBt(e, t, n) {
  return (
    (t = wBt(t)),
    (function (e, t) {
      if (t && ("object" === vBt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, xBt() ? Reflect.construct(t, n || [], wBt(e).constructor) : t.apply(e, n))
  );
}
function xBt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (xBt = function () {
    return !!e;
  })();
}
function wBt(e) {
  return (
    (wBt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    wBt(e)
  );
}
function CBt(e, t) {
  return (
    (CBt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    CBt(e, t)
  );
}
function SBt(e, t, n) {
  return (
    (t = kBt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function kBt(e) {
  var t = (function (e, t) {
    if ("object" != vBt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != vBt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === t ? String : Number)(e);
  })(e, "string");
  return "symbol" == vBt(t) ? t : t + "";
}
((nBt = _Bt),
  fBt(_Bt, "displayName", "Area"),
  fBt(_Bt, "defaultProps", {
    stroke: "#3182bd",
    fill: "#3182bd",
    fillOpacity: 0.6,
    xAxisId: 0,
    yAxisId: 0,
    legendType: "line",
    connectNulls: !1,
    points: [],
    dot: !1,
    activeDot: !0,
    hide: !1,
    isAnimationActive: !Qwt,
    animationBegin: 0,
    animationDuration: 1500,
    animationEasing: "ease",
  }),
  fBt(_Bt, "getBaseValue", function (e, t, n, i) {
    var r = e.layout,
      o = e.baseValue,
      s = t.props.baseValue,
      a = null != s ? s : o;
    if (Npt(a) && "number" == typeof a) return a;
    var l = "horizontal" === r ? i : n,
      c = l.scale.domain();
    if ("number" === l.type) {
      var d = Math.max(c[0], c[1]),
        u = Math.min(c[0], c[1]);
      return "dataMin" === a ? u : "dataMax" === a || d < 0 ? d : Math.max(Math.min(c[0], c[1]), 0);
    }
    return "dataMin" === a ? c[0] : "dataMax" === a ? c[1] : c[0];
  }),
  fBt(_Bt, "getComposedData", function (e) {
    var t,
      n = e.props,
      i = e.item,
      r = e.xAxis,
      o = e.yAxis,
      s = e.xAxisTicks,
      a = e.yAxisTicks,
      l = e.bandSize,
      c = e.dataKey,
      d = e.stackedData,
      u = e.dataStartIndex,
      h = e.displayedData,
      g = e.offset,
      p = n.layout,
      f = d && d.length,
      m = nBt.getBaseValue(n, i, r, o),
      _ = "horizontal" === p,
      v = !1,
      b = h.map(function (e, t) {
        var n;
        f ? (n = d[u + t]) : ((n = iIt(e, c)), Array.isArray(n) ? (v = !0) : (n = [m, n]));
        var i = null == n[1] || (f && null == iIt(e, c));
        return _
          ? {
              x: mIt({ axis: r, ticks: s, bandSize: l, entry: e, index: t }),
              y: i ? null : o.scale(n[1]),
              value: n,
              payload: e,
            }
          : {
              x: i ? null : r.scale(n[1]),
              y: mIt({ axis: o, ticks: a, bandSize: l, entry: e, index: t }),
              value: n,
              payload: e,
            };
      });
    return (
      (t =
        f || v
          ? b.map(function (e) {
              var t = Array.isArray(e.value) ? e.value[0] : null;
              return _
                ? { x: e.x, y: null != t && null != e.y ? o.scale(t) : null }
                : { x: null != t ? r.scale(t) : null, y: e.y };
            })
          : _
            ? o.scale(m)
            : r.scale(m)),
      cBt({ points: b, baseLine: t, layout: p, isRange: v }, g)
    );
  }),
  fBt(_Bt, "renderDotItem", function (e, t) {
    var n;
    if (z.isValidElement(e)) n = z.cloneElement(e, t);
    else if (Yut(e)) n = e(t);
    else {
      var i = Mp("recharts-area-dot", "boolean" != typeof e ? e.className : ""),
        r = t.key,
        o = sBt(t, rBt);
      n = z.createElement(fMt, aBt({}, o, { key: r, className: i }));
    }
    return n;
  }));
var EBt = (function () {
  function e() {
    return (
      (function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
      yBt(this, e, arguments)
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && CBt(e, t));
    })(e, H.Component),
    bBt(e, [
      {
        key: "render",
        value: function () {
          return null;
        },
      },
    ])
  );
})();
(SBt(EBt, "displayName", "ZAxis"),
  SBt(EBt, "defaultProps", { zAxisId: 0, range: [64, 64], scale: "auto", type: "number" }));
var NBt = ["option", "isActive"];
function LBt() {
  return (
    (LBt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    LBt.apply(this, arguments)
  );
}
function DBt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function TBt(e) {
  var t = e.option,
    n = e.isActive,
    i = DBt(e, NBt);
  return "string" == typeof t
    ? H.createElement(
        tAt,
        LBt(
          { option: H.createElement(o_t, LBt({ type: t }, i)), isActive: n, shapeType: "symbols" },
          i,
        ),
      )
    : H.createElement(tAt, LBt({ option: t, isActive: n, shapeType: "symbols" }, i));
}
function IBt(e) {
  return (
    (IBt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    IBt(e)
  );
}
function RBt() {
  return (
    (RBt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    RBt.apply(this, arguments)
  );
}
function OBt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function MBt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? OBt(Object(n), !0).forEach(function (t) {
          VBt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : OBt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function ABt(e, t) {
  for (var n = 0; n < t.length; n++) {
    var i = t[n];
    ((i.enumerable = i.enumerable || !1),
      (i.configurable = !0),
      "value" in i && (i.writable = !0),
      Object.defineProperty(e, WBt(i.key), i));
  }
}
function PBt(e, t, n) {
  return (
    (t = FBt(t)),
    (function (e, t) {
      if (t && ("object" === IBt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, jBt() ? Reflect.construct(t, n || [], FBt(e).constructor) : t.apply(e, n))
  );
}
function jBt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (jBt = function () {
    return !!e;
  })();
}
function FBt(e) {
  return (
    (FBt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    FBt(e)
  );
}
function BBt(e, t) {
  return (
    (BBt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    BBt(e, t)
  );
}
function VBt(e, t, n) {
  return (
    (t = WBt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function WBt(e) {
  var t = (function (e, t) {
    if ("object" != IBt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != IBt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === t ? String : Number)(e);
  })(e, "string");
  return "symbol" == IBt(t) ? t : t + "";
}
var HBt = (function () {
  function e() {
    var t;
    !(function (e, t) {
      if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
    })(this, e);
    for (var n = arguments.length, i = new Array(n), r = 0; r < n; r++) i[r] = arguments[r];
    return (
      VBt((t = PBt(this, e, [].concat(i))), "state", { isAnimationFinished: !1 }),
      VBt(t, "handleAnimationEnd", function () {
        t.setState({ isAnimationFinished: !0 });
      }),
      VBt(t, "handleAnimationStart", function () {
        t.setState({ isAnimationFinished: !1 });
      }),
      VBt(t, "id", Tpt("recharts-scatter-")),
      t
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && BBt(e, t));
    })(e, H.PureComponent),
    (t = e),
    (n = [
      {
        key: "renderSymbolsStatically",
        value: function (e) {
          var t = this,
            n = this.props,
            i = n.shape,
            r = n.activeShape,
            o = n.activeIndex,
            s = rft(this.props, !1);
          return e.map(function (e, n) {
            var a = o === n,
              l = a ? r : i,
              c = MBt(MBt({}, s), e);
            return z.createElement(
              fft,
              RBt(
                {
                  className: "recharts-scatter-symbol",
                  key: "symbol-"
                    .concat(null == e ? void 0 : e.cx, "-")
                    .concat(null == e ? void 0 : e.cy, "-")
                    .concat(null == e ? void 0 : e.size, "-")
                    .concat(n),
                },
                zpt(t.props, e, n),
                { role: "img" },
              ),
              z.createElement(TBt, RBt({ option: l, isActive: a, key: "symbol-".concat(n) }, c)),
            );
          });
        },
      },
      {
        key: "renderSymbolsWithAnimation",
        value: function () {
          var e = this,
            t = this.props,
            n = t.points,
            i = t.isAnimationActive,
            r = t.animationBegin,
            o = t.animationDuration,
            s = t.animationEasing,
            a = t.animationId,
            l = this.state.prevPoints;
          return z.createElement(
            JOt,
            {
              begin: r,
              duration: o,
              isActive: i,
              easing: s,
              from: { t: 0 },
              to: { t: 1 },
              key: "pie-".concat(a),
              onAnimationEnd: this.handleAnimationEnd,
              onAnimationStart: this.handleAnimationStart,
            },
            function (t) {
              var i = t.t,
                r = n.map(function (e, t) {
                  var n = l && l[t];
                  if (n) {
                    var r = Opt(n.cx, e.cx),
                      o = Opt(n.cy, e.cy),
                      s = Opt(n.size, e.size);
                    return MBt(MBt({}, e), {}, { cx: r(i), cy: o(i), size: s(i) });
                  }
                  var a = Opt(0, e.size);
                  return MBt(MBt({}, e), {}, { size: a(i) });
                });
              return z.createElement(fft, null, e.renderSymbolsStatically(r));
            },
          );
        },
      },
      {
        key: "renderSymbols",
        value: function () {
          var e = this.props,
            t = e.points,
            n = e.isAnimationActive,
            i = this.state.prevPoints;
          return !(n && t && t.length) || (i && LDt(i, t))
            ? this.renderSymbolsStatically(t)
            : this.renderSymbolsWithAnimation();
        },
      },
      {
        key: "renderErrorBar",
        value: function () {
          if (this.props.isAnimationActive && !this.state.isAnimationFinished) return null;
          var e = this.props,
            t = e.points,
            n = e.xAxis,
            i = e.yAxis,
            r = Jpt(e.children, $Tt);
          return r
            ? r.map(function (e, r) {
                var o = e.props,
                  s = o.direction,
                  a = o.dataKey;
                return z.cloneElement(e, {
                  key: "".concat(s, "-").concat(a, "-").concat(t[r]),
                  data: t,
                  xAxis: n,
                  yAxis: i,
                  layout: "x" === s ? "vertical" : "horizontal",
                  dataPointFormatter: function (e, t) {
                    return {
                      x: e.cx,
                      y: e.cy,
                      value: "x" === s ? +e.node.x : +e.node.y,
                      errorVal: iIt(e, t),
                    };
                  },
                });
              })
            : null;
        },
      },
      {
        key: "renderLine",
        value: function () {
          var e,
            t,
            n = this.props,
            i = n.points,
            r = n.line,
            o = n.lineType,
            s = n.lineJointType,
            a = rft(this.props, !1),
            l = rft(r, !1);
          if ("joint" === o)
            e = i.map(function (e) {
              return { x: e.cx, y: e.cy };
            });
          else if ("fitting" === o) {
            var c = (function (e) {
                if (!e || !e.length) return null;
                for (
                  var t = e.length,
                    n = 0,
                    i = 0,
                    r = 0,
                    o = 0,
                    s = 1 / 0,
                    a = -1 / 0,
                    l = 0,
                    c = 0,
                    d = 0;
                  d < t;
                  d++
                )
                  ((n += l = e[d].cx || 0),
                    (i += c = e[d].cy || 0),
                    (r += l * c),
                    (o += l * l),
                    (s = Math.min(s, l)),
                    (a = Math.max(a, l)));
                var u = t * o !== n * n ? (t * r - n * i) / (t * o - n * n) : 0;
                return { xmin: s, xmax: a, a: u, b: (i - u * n) / t };
              })(i),
              d = c.xmin,
              u = c.xmax,
              h = c.a,
              g = c.b,
              p = function (e) {
                return h * e + g;
              };
            e = [
              { x: d, y: p(d) },
              { x: u, y: p(u) },
            ];
          }
          var f = MBt(
            MBt(MBt({}, a), {}, { fill: "none", stroke: a && a.fill }, l),
            {},
            { points: e },
          );
          return (
            (t = z.isValidElement(r)
              ? z.cloneElement(r, f)
              : Yut(r)
                ? r(f)
                : z.createElement(ERt, RBt({}, f, { type: s }))),
            z.createElement(
              fft,
              { className: "recharts-scatter-line", key: "recharts-scatter-line" },
              t,
            )
          );
        },
      },
      {
        key: "render",
        value: function () {
          var e = this.props,
            t = e.hide,
            n = e.points,
            i = e.line,
            r = e.className,
            o = e.xAxis,
            s = e.yAxis,
            a = e.left,
            l = e.top,
            c = e.width,
            d = e.height,
            u = e.id,
            h = e.isAnimationActive;
          if (t || !n || !n.length) return null;
          var g = this.state.isAnimationFinished,
            p = Mp("recharts-scatter", r),
            f = o && o.allowDataOverflow,
            m = s && s.allowDataOverflow,
            _ = f || m,
            v = Zgt(u) ? this.id : u;
          return z.createElement(
            fft,
            { className: p, clipPath: _ ? "url(#clipPath-".concat(v, ")") : null },
            f || m
              ? z.createElement(
                  "defs",
                  null,
                  z.createElement(
                    "clipPath",
                    { id: "clipPath-".concat(v) },
                    z.createElement("rect", {
                      x: f ? a : a - c / 2,
                      y: m ? l : l - d / 2,
                      width: f ? c : 2 * c,
                      height: m ? d : 2 * d,
                    }),
                  ),
                )
              : null,
            i && this.renderLine(),
            this.renderErrorBar(),
            z.createElement(fft, { key: "recharts-scatter-symbols" }, this.renderSymbols()),
            (!h || g) && sRt.renderCallByParent(this.props, n),
          );
        },
      },
    ]),
    (i = [
      {
        key: "getDerivedStateFromProps",
        value: function (e, t) {
          return e.animationId !== t.prevAnimationId
            ? { prevAnimationId: e.animationId, curPoints: e.points, prevPoints: t.curPoints }
            : e.points !== t.curPoints
              ? { curPoints: e.points }
              : null;
        },
      },
    ]),
    n && ABt(t.prototype, n),
    i && ABt(t, i),
    Object.defineProperty(t, "prototype", { writable: !1 }),
    t
  );
  var t, n, i;
})();
function zBt(e) {
  return (
    (zBt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    zBt(e)
  );
}
function UBt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, YBt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function $Bt(e, t, n) {
  return (
    (t = KBt(t)),
    (function (e, t) {
      if (t && ("object" === zBt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, qBt() ? Reflect.construct(t, n || [], KBt(e).constructor) : t.apply(e, n))
  );
}
function qBt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (qBt = function () {
    return !!e;
  })();
}
function KBt(e) {
  return (
    (KBt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    KBt(e)
  );
}
function GBt(e, t) {
  return (
    (GBt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    GBt(e, t)
  );
}
function ZBt(e, t, n) {
  return (
    (t = YBt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function YBt(e) {
  var t = (function (e, t) {
    if ("object" != zBt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != zBt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == zBt(t) ? t : t + "";
}
function XBt() {
  return (
    (XBt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    XBt.apply(this, arguments)
  );
}
function QBt(e) {
  var t = e.xAxisId,
    n = djt(),
    i = ujt(),
    r = ljt(t);
  return null == r
    ? null
    : H.createElement(
        yFt,
        XBt({}, r, {
          className: Mp("recharts-".concat(r.axisType, " ").concat(r.axisType), r.className),
          viewBox: { x: 0, y: 0, width: n, height: i },
          ticksGenerator: function (e) {
            return dIt(e, !0);
          },
        }),
      );
}
(VBt(HBt, "displayName", "Scatter"),
  VBt(HBt, "defaultProps", {
    xAxisId: 0,
    yAxisId: 0,
    zAxisId: 0,
    legendType: "circle",
    lineType: "joint",
    lineJointType: "linear",
    data: [],
    shape: "circle",
    hide: !1,
    isAnimationActive: !Qwt,
    animationBegin: 0,
    animationDuration: 400,
    animationEasing: "linear",
  }),
  VBt(HBt, "getComposedData", function (e) {
    var t = e.xAxis,
      n = e.yAxis,
      i = e.zAxis,
      r = e.item,
      o = e.displayedData,
      s = e.xAxisTicks,
      a = e.yAxisTicks,
      l = e.offset,
      c = r.props.tooltipType,
      d = Jpt(r.props.children, HCt),
      u = Zgt(t.dataKey) ? r.props.dataKey : t.dataKey,
      h = Zgt(n.dataKey) ? r.props.dataKey : n.dataKey,
      g = i && i.dataKey,
      p = i ? i.range : EBt.defaultProps.range,
      f = p && p[0],
      m = t.scale.bandwidth ? t.scale.bandwidth() : 0,
      _ = n.scale.bandwidth ? n.scale.bandwidth() : 0,
      v = o.map(function (e, o) {
        var l = iIt(e, u),
          p = iIt(e, h),
          v = (!Zgt(g) && iIt(e, g)) || "-",
          b = [
            {
              name: Zgt(t.dataKey) ? r.props.name : t.name || t.dataKey,
              unit: t.unit || "",
              value: l,
              payload: e,
              dataKey: u,
              type: c,
            },
            {
              name: Zgt(n.dataKey) ? r.props.name : n.name || n.dataKey,
              unit: n.unit || "",
              value: p,
              payload: e,
              dataKey: h,
              type: c,
            },
          ];
        "-" !== v &&
          b.push({
            name: i.name || i.dataKey,
            unit: i.unit || "",
            value: v,
            payload: e,
            dataKey: g,
            type: c,
          });
        var y = mIt({ axis: t, ticks: s, bandSize: m, entry: e, index: o, dataKey: u }),
          x = mIt({ axis: n, ticks: a, bandSize: _, entry: e, index: o, dataKey: h }),
          w = "-" !== v ? i.scale(v) : f,
          C = Math.sqrt(Math.max(w, 0) / Math.PI);
        return MBt(
          MBt({}, e),
          {},
          {
            cx: y,
            cy: x,
            x: y - C,
            y: x - C,
            xAxis: t,
            yAxis: n,
            zAxis: i,
            width: 2 * C,
            height: 2 * C,
            size: w,
            node: { x: l, y: p, z: v },
            tooltipPayload: b,
            tooltipPosition: { x: y, y: x },
            payload: e,
          },
          d && d[o] && d[o].props,
        );
      });
    return MBt({ points: v }, l);
  }));
var JBt = (function () {
  function e() {
    return (
      (function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
      $Bt(this, e, arguments)
    );
  }
  return (
    (function (e, t) {
      if ("function" != typeof t && null !== t)
        throw new TypeError("Super expression must either be null or a function");
      ((e.prototype = Object.create(t && t.prototype, {
        constructor: { value: e, writable: !0, configurable: !0 },
      })),
        Object.defineProperty(e, "prototype", { writable: !1 }),
        t && GBt(e, t));
    })(e, H.Component),
    UBt(e, [
      {
        key: "render",
        value: function () {
          return H.createElement(QBt, this.props);
        },
      },
    ])
  );
})();
function eVt(e) {
  return (
    (eVt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    eVt(e)
  );
}
function tVt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, aVt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function nVt(e, t, n) {
  return (
    (t = rVt(t)),
    (function (e, t) {
      if (t && ("object" === eVt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, iVt() ? Reflect.construct(t, n || [], rVt(e).constructor) : t.apply(e, n))
  );
}
function iVt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (e) {}
  return (iVt = function () {
    return !!e;
  })();
}
function rVt(e) {
  return (
    (rVt = Object.setPrototypeOf
      ? Object.getPrototypeOf.bind()
      : function (e) {
          return e.__proto__ || Object.getPrototypeOf(e);
        }),
    rVt(e)
  );
}
function oVt(e, t) {
  return (
    (oVt = Object.setPrototypeOf
      ? Object.setPrototypeOf.bind()
      : function (e, t) {
          return ((e.__proto__ = t), e);
        }),
    oVt(e, t)
  );
}
function sVt(e, t, n) {
  return (
    (t = aVt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function aVt(e) {
  var t = (function (e, t) {
    if ("object" != eVt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != eVt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == eVt(t) ? t : t + "";
}
function lVt() {
  return (
    (lVt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    lVt.apply(this, arguments)
  );
}
(ZBt(JBt, "displayName", "XAxis"),
  ZBt(JBt, "defaultProps", {
    allowDecimals: !0,
    hide: !1,
    orientation: "bottom",
    width: 0,
    height: 30,
    mirror: !1,
    xAxisId: 0,
    tickCount: 5,
    type: "category",
    padding: { left: 0, right: 0 },
    allowDataOverflow: !1,
    scale: "auto",
    reversed: !1,
    allowDuplicatedCategory: !0,
  }));
var cVt = function (e) {
    var t = e.yAxisId,
      n = djt(),
      i = ujt(),
      r = cjt(t);
    return null == r
      ? null
      : H.createElement(
          yFt,
          lVt({}, r, {
            className: Mp("recharts-".concat(r.axisType, " ").concat(r.axisType), r.className),
            viewBox: { x: 0, y: 0, width: n, height: i },
            ticksGenerator: function (e) {
              return dIt(e, !0);
            },
          }),
        );
  },
  dVt = (function () {
    function e() {
      return (
        (function (e, t) {
          if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
        })(this, e),
        nVt(this, e, arguments)
      );
    }
    return (
      (function (e, t) {
        if ("function" != typeof t && null !== t)
          throw new TypeError("Super expression must either be null or a function");
        ((e.prototype = Object.create(t && t.prototype, {
          constructor: { value: e, writable: !0, configurable: !0 },
        })),
          Object.defineProperty(e, "prototype", { writable: !1 }),
          t && oVt(e, t));
      })(e, H.Component),
      tVt(e, [
        {
          key: "render",
          value: function () {
            return H.createElement(cVt, this.props);
          },
        },
      ])
    );
  })();
function uVt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return hVt(e);
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return hVt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return hVt(e, t);
    })(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function hVt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
(sVt(dVt, "displayName", "YAxis"),
  sVt(dVt, "defaultProps", {
    allowDuplicatedCategory: !0,
    allowDecimals: !0,
    hide: !1,
    orientation: "left",
    width: 60,
    height: 0,
    mirror: !1,
    yAxisId: 0,
    tickCount: 5,
    type: "number",
    padding: { top: 0, bottom: 0 },
    allowDataOverflow: !1,
    scale: "auto",
    reversed: !1,
  }));
var gVt = function (e, t, n, i, r) {
    var o = Jpt(e, Ejt),
      s = Jpt(e, Fjt),
      a = [].concat(uVt(o), uVt(s)),
      l = Jpt(e, Yjt),
      c = "".concat(i, "Id"),
      d = i[0],
      u = t;
    if (
      (a.length &&
        (u = a.reduce(function (e, t) {
          if (t.props[c] === n && $At(t.props, "extendDomain") && Npt(t.props[d])) {
            var i = t.props[d];
            return [Math.min(e[0], i), Math.max(e[1], i)];
          }
          return e;
        }, u)),
      l.length)
    ) {
      var h = "".concat(d, "1"),
        g = "".concat(d, "2");
      u = l.reduce(function (e, t) {
        if (
          t.props[c] === n &&
          $At(t.props, "extendDomain") &&
          Npt(t.props[h]) &&
          Npt(t.props[g])
        ) {
          var i = t.props[h],
            r = t.props[g];
          return [Math.min(e[0], i, r), Math.max(e[1], i, r)];
        }
        return e;
      }, u);
    }
    return (
      r &&
        r.length &&
        (u = r.reduce(function (e, t) {
          return Npt(t) ? [Math.min(e[0], t), Math.max(e[1], t)] : e;
        }, u)),
      u
    );
  },
  pVt = { exports: {} };
!(function (e) {
  var t = Object.prototype.hasOwnProperty,
    n = "~";
  function i() {}
  function r(e, t, n) {
    ((this.fn = e), (this.context = t), (this.once = n || !1));
  }
  function o(e, t, i, o, s) {
    if ("function" != typeof i) throw new TypeError("The listener must be a function");
    var a = new r(i, o || e, s),
      l = n ? n + t : t;
    return (
      e._events[l]
        ? e._events[l].fn
          ? (e._events[l] = [e._events[l], a])
          : e._events[l].push(a)
        : ((e._events[l] = a), e._eventsCount++),
      e
    );
  }
  function s(e, t) {
    0 === --e._eventsCount ? (e._events = new i()) : delete e._events[t];
  }
  function a() {
    ((this._events = new i()), (this._eventsCount = 0));
  }
  (Object.create && ((i.prototype = Object.create(null)), new i().__proto__ || (n = !1)),
    (a.prototype.eventNames = function () {
      var e,
        i,
        r = [];
      if (0 === this._eventsCount) return r;
      for (i in (e = this._events)) t.call(e, i) && r.push(n ? i.slice(1) : i);
      return Object.getOwnPropertySymbols ? r.concat(Object.getOwnPropertySymbols(e)) : r;
    }),
    (a.prototype.listeners = function (e) {
      var t = n ? n + e : e,
        i = this._events[t];
      if (!i) return [];
      if (i.fn) return [i.fn];
      for (var r = 0, o = i.length, s = new Array(o); r < o; r++) s[r] = i[r].fn;
      return s;
    }),
    (a.prototype.listenerCount = function (e) {
      var t = n ? n + e : e,
        i = this._events[t];
      return i ? (i.fn ? 1 : i.length) : 0;
    }),
    (a.prototype.emit = function (e, t, i, r, o, s) {
      var a = n ? n + e : e;
      if (!this._events[a]) return !1;
      var l,
        c,
        d = this._events[a],
        u = arguments.length;
      if (d.fn) {
        switch ((d.once && this.removeListener(e, d.fn, void 0, !0), u)) {
          case 1:
            return (d.fn.call(d.context), !0);
          case 2:
            return (d.fn.call(d.context, t), !0);
          case 3:
            return (d.fn.call(d.context, t, i), !0);
          case 4:
            return (d.fn.call(d.context, t, i, r), !0);
          case 5:
            return (d.fn.call(d.context, t, i, r, o), !0);
          case 6:
            return (d.fn.call(d.context, t, i, r, o, s), !0);
        }
        for (c = 1, l = new Array(u - 1); c < u; c++) l[c - 1] = arguments[c];
        d.fn.apply(d.context, l);
      } else {
        var h,
          g = d.length;
        for (c = 0; c < g; c++)
          switch ((d[c].once && this.removeListener(e, d[c].fn, void 0, !0), u)) {
            case 1:
              d[c].fn.call(d[c].context);
              break;
            case 2:
              d[c].fn.call(d[c].context, t);
              break;
            case 3:
              d[c].fn.call(d[c].context, t, i);
              break;
            case 4:
              d[c].fn.call(d[c].context, t, i, r);
              break;
            default:
              if (!l) for (h = 1, l = new Array(u - 1); h < u; h++) l[h - 1] = arguments[h];
              d[c].fn.apply(d[c].context, l);
          }
      }
      return !0;
    }),
    (a.prototype.on = function (e, t, n) {
      return o(this, e, t, n, !1);
    }),
    (a.prototype.once = function (e, t, n) {
      return o(this, e, t, n, !0);
    }),
    (a.prototype.removeListener = function (e, t, i, r) {
      var o = n ? n + e : e;
      if (!this._events[o]) return this;
      if (!t) return (s(this, o), this);
      var a = this._events[o];
      if (a.fn) a.fn !== t || (r && !a.once) || (i && a.context !== i) || s(this, o);
      else {
        for (var l = 0, c = [], d = a.length; l < d; l++)
          (a[l].fn !== t || (r && !a[l].once) || (i && a[l].context !== i)) && c.push(a[l]);
        c.length ? (this._events[o] = 1 === c.length ? c[0] : c) : s(this, o);
      }
      return this;
    }),
    (a.prototype.removeAllListeners = function (e) {
      var t;
      return (
        e
          ? ((t = n ? n + e : e), this._events[t] && s(this, t))
          : ((this._events = new i()), (this._eventsCount = 0)),
        this
      );
    }),
    (a.prototype.off = a.prototype.removeListener),
    (a.prototype.addListener = a.prototype.on),
    (a.prefixed = n),
    (a.EventEmitter = a),
    (e.exports = a));
})(pVt);
var fVt = pVt.exports;
var mVt = new (n(fVt))(),
  _Vt = "recharts.syncMouseEvents";
function vVt(e) {
  return (
    (vVt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    vVt(e)
  );
}
function bVt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, xVt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function yVt(e, t, n) {
  return (
    (t = xVt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function xVt(e) {
  var t = (function (e, t) {
    if ("object" != vVt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != vVt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == vVt(t) ? t : t + "";
}
var wVt = (function () {
  return bVt(
    function e() {
      (!(function (e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
      })(this, e),
        yVt(this, "activeIndex", 0),
        yVt(this, "coordinateList", []),
        yVt(this, "layout", "horizontal"));
    },
    [
      {
        key: "setDetails",
        value: function (e) {
          var t,
            n = e.coordinateList,
            i = void 0 === n ? null : n,
            r = e.container,
            o = void 0 === r ? null : r,
            s = e.layout,
            a = void 0 === s ? null : s,
            l = e.offset,
            c = void 0 === l ? null : l,
            d = e.mouseHandlerCallback,
            u = void 0 === d ? null : d;
          ((this.coordinateList =
            null !== (t = null != i ? i : this.coordinateList) && void 0 !== t ? t : []),
            (this.container = null != o ? o : this.container),
            (this.layout = null != a ? a : this.layout),
            (this.offset = null != c ? c : this.offset),
            (this.mouseHandlerCallback = null != u ? u : this.mouseHandlerCallback),
            (this.activeIndex = Math.min(
              Math.max(this.activeIndex, 0),
              this.coordinateList.length - 1,
            )));
        },
      },
      {
        key: "focus",
        value: function () {
          this.spoofMouse();
        },
      },
      {
        key: "keyboardEvent",
        value: function (e) {
          if (0 !== this.coordinateList.length)
            switch (e.key) {
              case "ArrowRight":
                if ("horizontal" !== this.layout) return;
                ((this.activeIndex = Math.min(
                  this.activeIndex + 1,
                  this.coordinateList.length - 1,
                )),
                  this.spoofMouse());
                break;
              case "ArrowLeft":
                if ("horizontal" !== this.layout) return;
                ((this.activeIndex = Math.max(this.activeIndex - 1, 0)), this.spoofMouse());
            }
        },
      },
      {
        key: "setIndex",
        value: function (e) {
          this.activeIndex = e;
        },
      },
      {
        key: "spoofMouse",
        value: function () {
          var e, t;
          if ("horizontal" === this.layout && 0 !== this.coordinateList.length) {
            var n = this.container.getBoundingClientRect(),
              i = n.x,
              r = n.y,
              o = n.height,
              s = this.coordinateList[this.activeIndex].coordinate,
              a = (null === (e = window) || void 0 === e ? void 0 : e.scrollX) || 0,
              l = (null === (t = window) || void 0 === t ? void 0 : t.scrollY) || 0,
              c = i + s + a,
              d = r + this.offset.top + o / 2 + l;
            this.mouseHandlerCallback({ pageX: c, pageY: d });
          }
        },
      },
    ],
  );
})();
function CVt(e) {
  var t = e.cx,
    n = e.cy,
    i = e.radius,
    r = e.startAngle,
    o = e.endAngle;
  return {
    points: [IIt(t, n, i, r), IIt(t, n, i, o)],
    cx: t,
    cy: n,
    radius: i,
    startAngle: r,
    endAngle: o,
  };
}
function SVt(e, t, n) {
  var i, r, o, s;
  if ("horizontal" === e) ((o = i = t.x), (r = n.top), (s = n.top + n.height));
  else if ("vertical" === e) ((s = r = t.y), (i = n.left), (o = n.left + n.width));
  else if (null != t.cx && null != t.cy) {
    if ("centric" !== e) return CVt(t);
    var a = t.cx,
      l = t.cy,
      c = t.innerRadius,
      d = t.outerRadius,
      u = t.angle,
      h = IIt(a, l, c, u),
      g = IIt(a, l, d, u);
    ((i = h.x), (r = h.y), (o = g.x), (s = g.y));
  }
  return [
    { x: i, y: r },
    { x: o, y: s },
  ];
}
function kVt(e) {
  return (
    (kVt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    kVt(e)
  );
}
function EVt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function NVt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? EVt(Object(n), !0).forEach(function (t) {
          LVt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : EVt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function LVt(e, t, n) {
  return (
    (t = (function (e) {
      var t = (function (e, t) {
        if ("object" != kVt(e) || !e) return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 !== n) {
          var i = n.call(e, t);
          if ("object" != kVt(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === t ? String : Number)(e);
      })(e, "string");
      return "symbol" == kVt(t) ? t : t + "";
    })(t)),
    t in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function DVt(e) {
  var t,
    n,
    i,
    r = e.element,
    o = e.tooltipEventType,
    s = e.isActive,
    a = e.activeCoordinate,
    l = e.activePayload,
    c = e.offset,
    d = e.activeTooltipIndex,
    u = e.tooltipAxisBandSize,
    h = e.layout,
    g = e.chartName,
    p =
      null !== (t = r.props.cursor) && void 0 !== t
        ? t
        : null === (n = r.type.defaultProps) || void 0 === n
          ? void 0
          : n.cursor;
  if (!r || !p || !s || !a || ("ScatterChart" !== g && "axis" !== o)) return null;
  var f = ERt;
  if ("ScatterChart" === g) ((i = a), (f = CMt));
  else if ("BarChart" === g)
    ((i = (function (e, t, n, i) {
      var r = i / 2;
      return {
        stroke: "none",
        fill: "#ccc",
        x: "horizontal" === e ? t.x - r : n.left + 0.5,
        y: "horizontal" === e ? n.top + 0.5 : t.y - r,
        width: "horizontal" === e ? i : n.width - 1,
        height: "horizontal" === e ? n.height - 1 : i,
      };
    })(h, a, c, u)),
      (f = gMt));
  else if ("radial" === h) {
    var m = CVt(a),
      _ = m.cx,
      v = m.cy,
      b = m.radius;
    ((i = {
      cx: _,
      cy: v,
      startAngle: m.startAngle,
      endAngle: m.endAngle,
      innerRadius: b,
      outerRadius: b,
    }),
      (f = fRt));
  } else ((i = { points: SVt(h, a, c) }), (f = ERt));
  var y = NVt(
    NVt(NVt(NVt({ stroke: "#ccc", pointerEvents: "none" }, c), i), rft(p, !1)),
    {},
    { payload: l, payloadIndex: d, className: Mp("recharts-tooltip-cursor", p.className) },
  );
  return H.isValidElement(p) ? H.cloneElement(p, y) : H.createElement(f, y);
}
var TVt = ["item"],
  IVt = ["children", "className", "width", "height", "style", "compact", "title", "desc"];
function RVt(e) {
  return (RVt =
    "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
      ? function (e) {
          return typeof e;
        }
      : function (e) {
          return e &&
            "function" == typeof Symbol &&
            e.constructor === Symbol &&
            e !== Symbol.prototype
            ? "symbol"
            : typeof e;
        })(e);
}
function OVt() {
  return (
    (OVt = Object.assign
      ? Object.assign.bind()
      : function (e) {
          for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          }
          return e;
        }),
    OVt.apply(this, arguments)
  );
}
function MVt(e, t) {
  return (
    (function (e) {
      if (Array.isArray(e)) return e;
    })(e) ||
    (function (e, t) {
      var n =
        null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
      if (null != n) {
        var i,
          r,
          o,
          s,
          a = [],
          l = !0,
          c = !1;
        try {
          if (((o = (n = n.call(e)).next), 0 === t));
          else for (; !(l = (i = o.call(n)).done) && (a.push(i.value), a.length !== t); l = !0);
        } catch (d) {
          ((c = !0), (r = d));
        } finally {
          try {
            if (!l && null != n.return && ((s = n.return()), Object(s) !== s)) return;
          } finally {
            if (c) throw r;
          }
        }
        return a;
      }
    })(e, t) ||
    HVt(e, t) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function AVt(e, t) {
  if (null == e) return {};
  var n,
    i,
    r = (function (e, t) {
      if (null == e) return {};
      var n = {};
      for (var i in e)
        if (Object.prototype.hasOwnProperty.call(e, i)) {
          if (t.indexOf(i) >= 0) continue;
          n[i] = e[i];
        }
      return n;
    })(e, t);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      ((n = o[i]),
        t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n])));
  }
  return r;
}
function PVt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, KVt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
function jVt(e, t, n) {
  return (
    (t = BVt(t)),
    (function (e, t) {
      if (t && ("object" === RVt(t) || "function" == typeof t)) return t;
      if (void 0 !== t)
        throw new TypeError("Derived constructors may only return object or undefined");
      return (function (e) {
        if (void 0 === e)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
      })(e);
    })(e, FVt() ? Reflect.construct(t, n || [], BVt(e).constructor) : t.apply(e, n))
  );
}
function FVt() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (t) {}
  return (FVt = function () {
    return !!e;
  })();
}
function BVt(e) {
  return (BVt = Object.setPrototypeOf
    ? Object.getPrototypeOf.bind()
    : function (e) {
        return e.__proto__ || Object.getPrototypeOf(e);
      })(e);
}
function VVt(e, t) {
  return (VVt = Object.setPrototypeOf
    ? Object.setPrototypeOf.bind()
    : function (e, t) {
        return ((e.__proto__ = t), e);
      })(e, t);
}
function WVt(e) {
  return (
    (function (e) {
      if (Array.isArray(e)) return zVt(e);
    })(e) ||
    (function (e) {
      if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"])
        return Array.from(e);
    })(e) ||
    HVt(e) ||
    (function () {
      throw new TypeError(
        "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
      );
    })()
  );
}
function HVt(e, t) {
  if (e) {
    if ("string" == typeof e) return zVt(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    return (
      "Object" === n && e.constructor && (n = e.constructor.name),
      "Map" === n || "Set" === n
        ? Array.from(e)
        : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
          ? zVt(e, t)
          : void 0
    );
  }
}
function zVt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function UVt(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    (t &&
      (i = i.filter(function (t) {
        return Object.getOwnPropertyDescriptor(e, t).enumerable;
      })),
      n.push.apply(n, i));
  }
  return n;
}
function $Vt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = null != arguments[t] ? arguments[t] : {};
    t % 2
      ? UVt(Object(n), !0).forEach(function (t) {
          qVt(e, t, n[t]);
        })
      : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : UVt(Object(n)).forEach(function (t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
          });
  }
  return e;
}
function qVt(e, t, n) {
  return (
    (t = KVt(t)) in e
      ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
      : (e[t] = n),
    e
  );
}
function KVt(e) {
  var t = (function (e, t) {
    if ("object" != RVt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != RVt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === t ? String : Number)(e);
  })(e, "string");
  return "symbol" == RVt(t) ? t : t + "";
}
var GVt = { xAxis: ["bottom", "top"], yAxis: ["left", "right"] },
  ZVt = { width: "100%", height: "100%" },
  YVt = { x: 0, y: 0 };
function XVt(e) {
  return e;
}
var QVt = function (e, t) {
  var n = t.graphicalItems,
    i = t.dataStartIndex,
    r = t.dataEndIndex,
    o = (null != n ? n : []).reduce(function (e, t) {
      var n = t.props.data;
      return n && n.length ? [].concat(WVt(e), WVt(n)) : e;
    }, []);
  return o.length > 0 ? o : e && e.length && Npt(i) && Npt(r) ? e.slice(i, r + 1) : [];
};
function JVt(e) {
  return "number" === e ? [0, "auto"] : void 0;
}
var eWt = function (e, t, n, i) {
    var r = e.graphicalItems,
      o = e.tooltipAxis,
      s = QVt(t, e);
    return n < 0 || !r || !r.length || n >= s.length
      ? null
      : r.reduce(function (r, a) {
          var l,
            c,
            d = null !== (l = a.props.data) && void 0 !== l ? l : t;
          (d &&
            e.dataStartIndex + e.dataEndIndex !== 0 &&
            e.dataEndIndex - e.dataStartIndex >= n &&
            (d = d.slice(e.dataStartIndex, e.dataEndIndex + 1)),
          o.dataKey && !o.allowDuplicatedCategory)
            ? (c = Mpt(void 0 === d ? s : d, o.dataKey, i))
            : (c = (d && d[n]) || s[n]);
          return c ? [].concat(WVt(r), [SIt(a, c)]) : r;
        }, []);
  },
  tWt = function (e, t, n, i) {
    var r = i || { x: e.chartX, y: e.chartY },
      o = (function (e, t) {
        return "horizontal" === t
          ? e.x
          : "vertical" === t
            ? e.y
            : "centric" === t
              ? e.angle
              : e.radius;
      })(r, n),
      s = e.orderedTooltipTicks,
      a = e.tooltipAxis,
      l = e.tooltipTicks,
      c = (function (e) {
        var t,
          n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [],
          i = arguments.length > 2 ? arguments[2] : void 0,
          r = arguments.length > 3 ? arguments[3] : void 0,
          o = -1,
          s = null !== (t = null == n ? void 0 : n.length) && void 0 !== t ? t : 0;
        if (s <= 1) return 0;
        if (
          r &&
          "angleAxis" === r.axisType &&
          Math.abs(Math.abs(r.range[1] - r.range[0]) - 360) <= 1e-6
        )
          for (var a = r.range, l = 0; l < s; l++) {
            var c = l > 0 ? i[l - 1].coordinate : i[s - 1].coordinate,
              d = i[l].coordinate,
              u = l >= s - 1 ? i[0].coordinate : i[l + 1].coordinate,
              h = void 0;
            if (kpt(d - c) !== kpt(u - d)) {
              var g = [];
              if (kpt(u - d) === kpt(a[1] - a[0])) {
                h = u;
                var p = d + a[1] - a[0];
                ((g[0] = Math.min(p, (p + c) / 2)), (g[1] = Math.max(p, (p + c) / 2)));
              } else {
                h = c;
                var f = u + a[1] - a[0];
                ((g[0] = Math.min(d, (f + d) / 2)), (g[1] = Math.max(d, (f + d) / 2)));
              }
              var m = [Math.min(d, (h + d) / 2), Math.max(d, (h + d) / 2)];
              if ((e > m[0] && e <= m[1]) || (e >= g[0] && e <= g[1])) {
                o = i[l].index;
                break;
              }
            } else {
              var _ = Math.min(c, u),
                v = Math.max(c, u);
              if (e > (_ + d) / 2 && e <= (v + d) / 2) {
                o = i[l].index;
                break;
              }
            }
          }
        else
          for (var b = 0; b < s; b++)
            if (
              (0 === b && e <= (n[b].coordinate + n[b + 1].coordinate) / 2) ||
              (b > 0 &&
                b < s - 1 &&
                e > (n[b].coordinate + n[b - 1].coordinate) / 2 &&
                e <= (n[b].coordinate + n[b + 1].coordinate) / 2) ||
              (b === s - 1 && e > (n[b].coordinate + n[b - 1].coordinate) / 2)
            ) {
              o = n[b].index;
              break;
            }
        return o;
      })(o, s, l, a);
    if (c >= 0 && l) {
      var d = l[c] && l[c].value,
        u = eWt(e, t, c, d),
        h = (function (e, t, n, i) {
          var r = t.find(function (e) {
            return e && e.index === n;
          });
          if (r) {
            if ("horizontal" === e) return { x: r.coordinate, y: i.y };
            if ("vertical" === e) return { x: i.x, y: r.coordinate };
            if ("centric" === e) {
              var o = r.coordinate,
                s = i.radius;
              return $Vt($Vt($Vt({}, i), IIt(i.cx, i.cy, s, o)), {}, { angle: o, radius: s });
            }
            var a = r.coordinate,
              l = i.angle;
            return $Vt($Vt($Vt({}, i), IIt(i.cx, i.cy, a, l)), {}, { angle: l, radius: a });
          }
          return YVt;
        })(n, s, c, r);
      return { activeTooltipIndex: c, activeLabel: d, activePayload: u, activeCoordinate: h };
    }
    return null;
  },
  nWt = function (e, t) {
    var n = t.axes,
      i = t.graphicalItems,
      r = t.axisType,
      o = t.axisIdKey,
      s = t.stackGroups,
      a = t.dataStartIndex,
      l = t.dataEndIndex,
      c = e.layout,
      d = e.children,
      u = e.stackOffset,
      h = lIt(c, r);
    return n.reduce(function (t, n) {
      var g,
        p = void 0 !== n.type.defaultProps ? $Vt($Vt({}, n.type.defaultProps), n.props) : n.props,
        f = p.type,
        m = p.dataKey,
        _ = p.allowDataOverflow,
        v = p.allowDuplicatedCategory,
        b = p.scale,
        y = p.ticks,
        x = p.includeHidden,
        w = p[o];
      if (t[w]) return t;
      var C,
        S,
        k,
        E = QVt(e.data, {
          graphicalItems: i.filter(function (e) {
            var t;
            return (
              (o in e.props
                ? e.props[o]
                : null === (t = e.type.defaultProps) || void 0 === t
                  ? void 0
                  : t[o]) === w
            );
          }),
          dataStartIndex: a,
          dataEndIndex: l,
        }),
        N = E.length;
      (function (e, t, n) {
        if ("number" === n && !0 === t && Array.isArray(e)) {
          var i = null == e ? void 0 : e[0],
            r = null == e ? void 0 : e[1];
          if (i && r && Npt(i) && Npt(r)) return !0;
        }
        return !1;
      })(p.domain, _, f) &&
        ((C = xIt(p.domain, null, _)),
        !h || ("number" !== f && "auto" === b) || (k = rIt(E, m, "category")));
      var L = JVt(f);
      if (!C || 0 === C.length) {
        var D,
          T = null !== (D = p.domain) && void 0 !== D ? D : L;
        if (m) {
          if (((C = rIt(E, m, f)), "category" === f && h)) {
            var I = (function (e) {
              if (!Array.isArray(e)) return !1;
              for (var t = e.length, n = {}, i = 0; i < t; i++) {
                if (n[e[i]]) return !0;
                n[e[i]] = !0;
              }
              return !1;
            })(C);
            v && I
              ? ((S = C), (C = vAt(0, N)))
              : v ||
                (C = CIt(T, C, n).reduce(function (e, t) {
                  return e.indexOf(t) >= 0 ? e : [].concat(WVt(e), [t]);
                }, []));
          } else if ("category" === f)
            C = v
              ? C.filter(function (e) {
                  return "" !== e && !Zgt(e);
                })
              : CIt(T, C, n).reduce(function (e, t) {
                  return e.indexOf(t) >= 0 || "" === t || Zgt(t) ? e : [].concat(WVt(e), [t]);
                }, []);
          else if ("number" === f) {
            var R = (function (e, t, n, i, r) {
              var o = t
                .map(function (t) {
                  return sIt(e, t, n, r, i);
                })
                .filter(function (e) {
                  return !Zgt(e);
                });
              return o && o.length
                ? o.reduce(
                    function (e, t) {
                      return [Math.min(e[0], t[0]), Math.max(e[1], t[1])];
                    },
                    [1 / 0, -1 / 0],
                  )
                : null;
            })(
              E,
              i.filter(function (e) {
                var t,
                  n,
                  i =
                    o in e.props
                      ? e.props[o]
                      : null === (t = e.type.defaultProps) || void 0 === t
                        ? void 0
                        : t[o],
                  r =
                    "hide" in e.props
                      ? e.props.hide
                      : null === (n = e.type.defaultProps) || void 0 === n
                        ? void 0
                        : n.hide;
                return i === w && (x || !r);
              }),
              m,
              r,
              c,
            );
            R && (C = R);
          }
          !h || ("number" !== f && "auto" === b) || (k = rIt(E, m, "category"));
        } else
          C = h
            ? vAt(0, N)
            : s && s[w] && s[w].hasStack && "number" === f
              ? "expand" === u
                ? [0, 1]
                : vIt(s[w].stackGroups, a, l)
              : aIt(
                  E,
                  i.filter(function (e) {
                    var t = o in e.props ? e.props[o] : e.type.defaultProps[o],
                      n = "hide" in e.props ? e.props.hide : e.type.defaultProps.hide;
                    return t === w && (x || !n);
                  }),
                  f,
                  c,
                  !0,
                );
        if ("number" === f) ((C = gVt(d, C, w, r, y)), T && (C = xIt(T, C, _)));
        else if ("category" === f && T) {
          var O = T;
          C.every(function (e) {
            return O.indexOf(e) >= 0;
          }) && (C = O);
        }
      }
      return $Vt(
        $Vt({}, t),
        {},
        qVt(
          {},
          w,
          $Vt(
            $Vt({}, p),
            {},
            {
              axisType: r,
              domain: C,
              categoricalDomain: k,
              duplicateDomain: S,
              originalDomain: null !== (g = p.domain) && void 0 !== g ? g : L,
              isCategorical: h,
              layout: c,
            },
          ),
        ),
      );
    }, {});
  },
  iWt = function (e, t) {
    var n = t.axisType,
      i = void 0 === n ? "xAxis" : n,
      r = t.AxisComp,
      o = t.graphicalItems,
      s = t.stackGroups,
      a = t.dataStartIndex,
      l = t.dataEndIndex,
      c = e.children,
      d = "".concat(i, "Id"),
      u = Jpt(c, r),
      h = {};
    return (
      u && u.length
        ? (h = nWt(e, {
            axes: u,
            graphicalItems: o,
            axisType: i,
            axisIdKey: d,
            stackGroups: s,
            dataStartIndex: a,
            dataEndIndex: l,
          }))
        : o &&
          o.length &&
          (h = (function (e, t) {
            var n = t.graphicalItems,
              i = t.Axis,
              r = t.axisType,
              o = t.axisIdKey,
              s = t.stackGroups,
              a = t.dataStartIndex,
              l = t.dataEndIndex,
              c = e.layout,
              d = e.children,
              u = QVt(e.data, { graphicalItems: n, dataStartIndex: a, dataEndIndex: l }),
              h = u.length,
              g = lIt(c, r),
              p = -1;
            return n.reduce(function (e, t) {
              var f,
                m = (
                  void 0 !== t.type.defaultProps
                    ? $Vt($Vt({}, t.type.defaultProps), t.props)
                    : t.props
                )[o],
                _ = JVt("number");
              return e[m]
                ? e
                : (p++,
                  g
                    ? (f = vAt(0, h))
                    : s && s[m] && s[m].hasStack
                      ? ((f = vIt(s[m].stackGroups, a, l)), (f = gVt(d, f, m, r)))
                      : ((f = xIt(
                          _,
                          aIt(
                            u,
                            n.filter(function (e) {
                              var t,
                                n,
                                i =
                                  o in e.props
                                    ? e.props[o]
                                    : null === (t = e.type.defaultProps) || void 0 === t
                                      ? void 0
                                      : t[o],
                                r =
                                  "hide" in e.props
                                    ? e.props.hide
                                    : null === (n = e.type.defaultProps) || void 0 === n
                                      ? void 0
                                      : n.hide;
                              return i === m && !r;
                            }),
                            "number",
                            c,
                          ),
                          i.defaultProps.allowDataOverflow,
                        )),
                        (f = gVt(d, f, m, r))),
                  $Vt(
                    $Vt({}, e),
                    {},
                    qVt(
                      {},
                      m,
                      $Vt(
                        $Vt({ axisType: r }, i.defaultProps),
                        {},
                        {
                          hide: !0,
                          orientation: Ggt(GVt, "".concat(r, ".").concat(p % 2), null),
                          domain: f,
                          originalDomain: _,
                          isCategorical: g,
                          layout: c,
                        },
                      ),
                    ),
                  ));
            }, {});
          })(e, {
            Axis: r,
            graphicalItems: o,
            axisType: i,
            axisIdKey: d,
            stackGroups: s,
            dataStartIndex: a,
            dataEndIndex: l,
          })),
      h
    );
  },
  rWt = function (e) {
    var t = e.children,
      n = e.defaultShowTooltip,
      i = eft(t, PAt),
      r = 0,
      o = 0;
    return (
      e.data && 0 !== e.data.length && (o = e.data.length - 1),
      i &&
        i.props &&
        (i.props.startIndex >= 0 && (r = i.props.startIndex),
        i.props.endIndex >= 0 && (o = i.props.endIndex)),
      {
        chartX: 0,
        chartY: 0,
        dataStartIndex: r,
        dataEndIndex: o,
        activeTooltipIndex: -1,
        isTooltipActive: Boolean(n),
      }
    );
  },
  oWt = function (e) {
    return "horizontal" === e
      ? { numericAxisName: "yAxis", cateAxisName: "xAxis" }
      : "vertical" === e
        ? { numericAxisName: "xAxis", cateAxisName: "yAxis" }
        : "centric" === e
          ? { numericAxisName: "radiusAxis", cateAxisName: "angleAxis" }
          : { numericAxisName: "angleAxis", cateAxisName: "radiusAxis" };
  },
  sWt = function (e, t) {
    var n = e.props,
      i = (e.graphicalItems, e.xAxisMap),
      r = void 0 === i ? {} : i,
      o = e.yAxisMap,
      s = void 0 === o ? {} : o,
      a = n.width,
      l = n.height,
      c = n.children,
      d = n.margin || {},
      u = eft(c, PAt),
      h = eft(c, Sxt),
      g = Object.keys(s).reduce(
        function (e, t) {
          var n = s[t],
            i = n.orientation;
          return n.mirror || n.hide ? e : $Vt($Vt({}, e), {}, qVt({}, i, e[i] + n.width));
        },
        { left: d.left || 0, right: d.right || 0 },
      ),
      p = Object.keys(r).reduce(
        function (e, t) {
          var n = r[t],
            i = n.orientation;
          return n.mirror || n.hide
            ? e
            : $Vt($Vt({}, e), {}, qVt({}, i, Ggt(e, "".concat(i)) + n.height));
        },
        { top: d.top || 0, bottom: d.bottom || 0 },
      ),
      f = $Vt($Vt({}, p), g),
      m = f.bottom;
    (u && (f.bottom += u.props.height || PAt.defaultProps.height),
      h &&
        t &&
        (f = (function (e, t, n, i) {
          var r = n.children,
            o = n.width,
            s = n.margin,
            a = o - (s.left || 0) - (s.right || 0),
            l = YTt({ children: r, legendWidth: a });
          if (l) {
            var c = i || {},
              d = c.width,
              u = c.height,
              h = l.align,
              g = l.verticalAlign,
              p = l.layout;
            if (
              ("vertical" === p || ("horizontal" === p && "middle" === g)) &&
              "center" !== h &&
              Npt(e[h])
            )
              return tIt(tIt({}, e), {}, nIt({}, h, e[h] + (d || 0)));
            if (
              ("horizontal" === p || ("vertical" === p && "center" === h)) &&
              "middle" !== g &&
              Npt(e[g])
            )
              return tIt(tIt({}, e), {}, nIt({}, g, e[g] + (u || 0)));
          }
          return e;
        })(f, 0, n, t)));
    var _ = a - f.left - f.right,
      v = l - f.top - f.bottom;
    return $Vt($Vt({ brushBottom: m }, f), {}, { width: Math.max(_, 0), height: Math.max(v, 0) });
  },
  aWt = function (e, t) {
    return "xAxis" === t ? e[t].width : "yAxis" === t ? e[t].height : void 0;
  },
  lWt = (function (e) {
    var t = e.chartName,
      n = e.GraphicalChild,
      i = e.defaultTooltipEventType,
      r = void 0 === i ? "axis" : i,
      o = e.validateTooltipEventTypes,
      s = void 0 === o ? ["axis"] : o,
      a = e.axisComponents,
      l = e.legendContent,
      c = e.formatAxisMap,
      d = e.defaultProps,
      u = function (e, t) {
        var n = t.graphicalItems,
          i = t.stackGroups,
          r = t.offset,
          o = t.updateId,
          s = t.dataStartIndex,
          l = t.dataEndIndex,
          c = e.barSize,
          d = e.layout,
          u = e.barGap,
          h = e.barCategoryGap,
          g = e.maxBarSize,
          p = oWt(d),
          f = p.numericAxisName,
          m = p.cateAxisName,
          _ = (function (e) {
            return (
              !(!e || !e.length) &&
              e.some(function (e) {
                var t = Zpt(e && e.type);
                return t && t.indexOf("Bar") >= 0;
              })
            );
          })(n),
          v = [];
        return (
          n.forEach(function (n, p) {
            var b = QVt(e.data, { graphicalItems: [n], dataStartIndex: s, dataEndIndex: l }),
              y =
                void 0 !== n.type.defaultProps
                  ? $Vt($Vt({}, n.type.defaultProps), n.props)
                  : n.props,
              x = y.dataKey,
              w = y.maxBarSize,
              C = y["".concat(f, "Id")],
              S = y["".concat(m, "Id")],
              k = a.reduce(function (e, n) {
                var i = t["".concat(n.axisType, "Map")],
                  r = y["".concat(n.axisType, "Id")];
                (i && i[r]) || "zAxis" === n.axisType || ITt();
                var o = i[r];
                return $Vt(
                  $Vt({}, e),
                  {},
                  qVt(qVt({}, n.axisType, o), "".concat(n.axisType, "Ticks"), dIt(o)),
                );
              }, {}),
              E = k[m],
              N = k["".concat(m, "Ticks")],
              L =
                i &&
                i[C] &&
                i[C].hasStack &&
                (function (e, t) {
                  var n,
                    i = (
                      null !== (n = e.type) && void 0 !== n && n.defaultProps
                        ? tIt(tIt({}, e.type.defaultProps), e.props)
                        : e.props
                    ).stackId;
                  if (Lpt(i)) {
                    var r = t[i];
                    if (r) {
                      var o = r.items.indexOf(e);
                      return o >= 0 ? r.stackedData[o] : null;
                    }
                  }
                  return null;
                })(n, i[C].stackGroups),
              D = Zpt(n.type).indexOf("Bar") >= 0,
              T = wIt(E, N),
              I = [],
              R =
                _ &&
                (function (e) {
                  var t = e.barSize,
                    n = e.totalSize,
                    i = e.stackGroups,
                    r = void 0 === i ? {} : i;
                  if (!r) return {};
                  for (var o = {}, s = Object.keys(r), a = 0, l = s.length; a < l; a++)
                    for (
                      var c = r[s[a]].stackGroups, d = Object.keys(c), u = 0, h = d.length;
                      u < h;
                      u++
                    ) {
                      var g = c[d[u]],
                        p = g.items,
                        f = g.cateAxisId,
                        m = p.filter(function (e) {
                          return Zpt(e.type).indexOf("Bar") >= 0;
                        });
                      if (m && m.length) {
                        var _ = m[0].type.defaultProps,
                          v = void 0 !== _ ? tIt(tIt({}, _), m[0].props) : m[0].props,
                          b = v.barSize,
                          y = v[f];
                        o[y] || (o[y] = []);
                        var x = Zgt(b) ? t : b;
                        o[y].push({
                          item: m[0],
                          stackList: m.slice(1),
                          barSize: Zgt(x) ? void 0 : Ipt(x, n, 0),
                        });
                      }
                    }
                  return o;
                })({ barSize: c, stackGroups: i, totalSize: aWt(k, m) });
            if (D) {
              var O,
                M,
                A = Zgt(w) ? g : w,
                P =
                  null !== (O = null !== (M = wIt(E, N, !0)) && void 0 !== M ? M : A) &&
                  void 0 !== O
                    ? O
                    : 0;
              ((I = (function (e) {
                var t = e.barGap,
                  n = e.barCategoryGap,
                  i = e.bandSize,
                  r = e.sizeList,
                  o = void 0 === r ? [] : r,
                  s = e.maxBarSize,
                  a = o.length;
                if (a < 1) return null;
                var l,
                  c = Ipt(t, i, 0, !0),
                  d = [];
                if (o[0].barSize === +o[0].barSize) {
                  var u = !1,
                    h = i / a,
                    g = o.reduce(function (e, t) {
                      return e + t.barSize || 0;
                    }, 0);
                  ((g += (a - 1) * c) >= i && ((g -= (a - 1) * c), (c = 0)),
                    g >= i && h > 0 && ((u = !0), (g = a * (h *= 0.9))));
                  var p = { offset: (((i - g) / 2) | 0) - c, size: 0 };
                  l = o.reduce(function (e, t) {
                    var n = {
                        item: t.item,
                        position: { offset: p.offset + p.size + c, size: u ? h : t.barSize },
                      },
                      i = [].concat(QTt(e), [n]);
                    return (
                      (p = i[i.length - 1].position),
                      t.stackList &&
                        t.stackList.length &&
                        t.stackList.forEach(function (e) {
                          i.push({ item: e, position: p });
                        }),
                      i
                    );
                  }, d);
                } else {
                  var f = Ipt(n, i, 0, !0);
                  i - 2 * f - (a - 1) * c <= 0 && (c = 0);
                  var m = (i - 2 * f - (a - 1) * c) / a;
                  m > 1 && (m >>= 0);
                  var _ = s === +s ? Math.min(m, s) : m;
                  l = o.reduce(function (e, t, n) {
                    var i = [].concat(QTt(e), [
                      {
                        item: t.item,
                        position: { offset: f + (m + c) * n + (m - _) / 2, size: _ },
                      },
                    ]);
                    return (
                      t.stackList &&
                        t.stackList.length &&
                        t.stackList.forEach(function (e) {
                          i.push({ item: e, position: i[i.length - 1].position });
                        }),
                      i
                    );
                  }, d);
                }
                return l;
              })({
                barGap: u,
                barCategoryGap: h,
                bandSize: P !== T ? P : T,
                sizeList: R[S],
                maxBarSize: A,
              })),
                P !== T &&
                  (I = I.map(function (e) {
                    return $Vt(
                      $Vt({}, e),
                      {},
                      {
                        position: $Vt(
                          $Vt({}, e.position),
                          {},
                          { offset: e.position.offset - P / 2 },
                        ),
                      },
                    );
                  })));
            }
            var j,
              F,
              B = n && n.type && n.type.getComposedData;
            B &&
              v.push({
                props: $Vt(
                  $Vt(
                    {},
                    B(
                      $Vt(
                        $Vt({}, k),
                        {},
                        {
                          displayedData: b,
                          props: e,
                          dataKey: x,
                          item: n,
                          bandSize: T,
                          barPosition: I,
                          offset: r,
                          stackedData: L,
                          layout: d,
                          dataStartIndex: s,
                          dataEndIndex: l,
                        },
                      ),
                    ),
                  ),
                  {},
                  qVt(
                    qVt(qVt({ key: n.key || "item-".concat(p) }, f, k[f]), m, k[m]),
                    "animationId",
                    o,
                  ),
                ),
                childIndex: ((j = n), (F = e.children), Qpt(F).indexOf(j)),
                item: n,
              });
          }),
          v
        );
      },
      h = function (e, i) {
        var r = e.props,
          o = e.dataStartIndex,
          s = e.dataEndIndex,
          l = e.updateId;
        if (!tft({ props: r })) return null;
        var d = r.children,
          h = r.layout,
          g = r.stackOffset,
          p = r.data,
          f = r.reverseStackOrder,
          m = oWt(h),
          _ = m.numericAxisName,
          v = m.cateAxisName,
          b = Jpt(d, n),
          y = (function (e, t, n, i, r, o) {
            if (!e) return null;
            var s = (o ? t.reverse() : t).reduce(function (e, t) {
              var r,
                o =
                  null !== (r = t.type) && void 0 !== r && r.defaultProps
                    ? tIt(tIt({}, t.type.defaultProps), t.props)
                    : t.props,
                s = o.stackId;
              if (o.hide) return e;
              var a = o[n],
                l = e[a] || { hasStack: !1, stackGroups: {} };
              if (Lpt(s)) {
                var c = l.stackGroups[s] || { numericAxisId: n, cateAxisId: i, items: [] };
                (c.items.push(t), (l.hasStack = !0), (l.stackGroups[s] = c));
              } else
                l.stackGroups[Tpt("_stackId_")] = { numericAxisId: n, cateAxisId: i, items: [t] };
              return tIt(tIt({}, e), {}, nIt({}, a, l));
            }, {});
            return Object.keys(s).reduce(function (t, o) {
              var a = s[o];
              return (
                a.hasStack &&
                  (a.stackGroups = Object.keys(a.stackGroups).reduce(function (t, o) {
                    var s = a.stackGroups[o];
                    return tIt(
                      tIt({}, t),
                      {},
                      nIt({}, o, {
                        numericAxisId: n,
                        cateAxisId: i,
                        items: s.items,
                        stackedData: fIt(e, s.items, r),
                      }),
                    );
                  }, {})),
                tIt(tIt({}, t), {}, nIt({}, o, a))
              );
            }, {});
          })(p, b, "".concat(_, "Id"), "".concat(v, "Id"), g, f),
          x = a.reduce(function (e, t) {
            var n = "".concat(t.axisType, "Map");
            return $Vt(
              $Vt({}, e),
              {},
              qVt(
                {},
                n,
                iWt(
                  r,
                  $Vt(
                    $Vt({}, t),
                    {},
                    {
                      graphicalItems: b,
                      stackGroups: t.axisType === _ && y,
                      dataStartIndex: o,
                      dataEndIndex: s,
                    },
                  ),
                ),
              ),
            );
          }, {}),
          w = sWt(
            $Vt($Vt({}, x), {}, { props: r, graphicalItems: b }),
            null == i ? void 0 : i.legendBBox,
          );
        Object.keys(x).forEach(function (e) {
          x[e] = c(r, x[e], w, e.replace("Map", ""), t);
        });
        var C,
          S,
          k = x["".concat(v, "Map")],
          E =
            ((C = Rpt(k)),
            {
              tooltipTicks: (S = dIt(C, !1, !0)),
              orderedTooltipTicks: kwt(S, function (e) {
                return e.coordinate;
              }),
              tooltipAxis: C,
              tooltipAxisBandSize: wIt(C, S),
            }),
          N = u(
            r,
            $Vt(
              $Vt({}, x),
              {},
              {
                dataStartIndex: o,
                dataEndIndex: s,
                updateId: l,
                graphicalItems: b,
                stackGroups: y,
                offset: w,
              },
            ),
          );
        return $Vt(
          $Vt({ formattedGraphicalItems: N, graphicalItems: b, offset: w, stackGroups: y }, E),
          x,
        );
      },
      g = (function () {
        function e(n) {
          var i, r, o;
          return (
            (function (e, t) {
              if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
            })(this, e),
            qVt((o = jVt(this, e, [n])), "eventEmitterSymbol", Symbol("rechartsEventEmitter")),
            qVt(o, "accessibilityManager", new wVt()),
            qVt(o, "handleLegendBBoxUpdate", function (e) {
              if (e) {
                var t = o.state,
                  n = t.dataStartIndex,
                  i = t.dataEndIndex,
                  r = t.updateId;
                o.setState(
                  $Vt(
                    { legendBBox: e },
                    h(
                      { props: o.props, dataStartIndex: n, dataEndIndex: i, updateId: r },
                      $Vt($Vt({}, o.state), {}, { legendBBox: e }),
                    ),
                  ),
                );
              }
            }),
            qVt(o, "handleReceiveSyncEvent", function (e, t, n) {
              if (o.props.syncId === e) {
                if (n === o.eventEmitterSymbol && "function" != typeof o.props.syncMethod) return;
                o.applySyncEvent(t);
              }
            }),
            qVt(o, "handleBrushChange", function (e) {
              var t = e.startIndex,
                n = e.endIndex;
              if (t !== o.state.dataStartIndex || n !== o.state.dataEndIndex) {
                var i = o.state.updateId;
                (o.setState(function () {
                  return $Vt(
                    { dataStartIndex: t, dataEndIndex: n },
                    h({ props: o.props, dataStartIndex: t, dataEndIndex: n, updateId: i }, o.state),
                  );
                }),
                  o.triggerSyncEvent({ dataStartIndex: t, dataEndIndex: n }));
              }
            }),
            qVt(o, "handleMouseEnter", function (e) {
              var t = o.getMouseInfo(e);
              if (t) {
                var n = $Vt($Vt({}, t), {}, { isTooltipActive: !0 });
                (o.setState(n), o.triggerSyncEvent(n));
                var i = o.props.onMouseEnter;
                Yut(i) && i(n, e);
              }
            }),
            qVt(o, "triggeredAfterMouseMove", function (e) {
              var t = o.getMouseInfo(e),
                n = t ? $Vt($Vt({}, t), {}, { isTooltipActive: !0 }) : { isTooltipActive: !1 };
              (o.setState(n), o.triggerSyncEvent(n));
              var i = o.props.onMouseMove;
              Yut(i) && i(n, e);
            }),
            qVt(o, "handleItemMouseEnter", function (e) {
              o.setState(function () {
                return {
                  isTooltipActive: !0,
                  activeItem: e,
                  activePayload: e.tooltipPayload,
                  activeCoordinate: e.tooltipPosition || { x: e.cx, y: e.cy },
                };
              });
            }),
            qVt(o, "handleItemMouseLeave", function () {
              o.setState(function () {
                return { isTooltipActive: !1 };
              });
            }),
            qVt(o, "handleMouseMove", function (e) {
              (e.persist(), o.throttleTriggeredAfterMouseMove(e));
            }),
            qVt(o, "handleMouseLeave", function (e) {
              o.throttleTriggeredAfterMouseMove.cancel();
              var t = { isTooltipActive: !1 };
              (o.setState(t), o.triggerSyncEvent(t));
              var n = o.props.onMouseLeave;
              Yut(n) && n(t, e);
            }),
            qVt(o, "handleOuterEvent", function (e) {
              var t,
                n = (function (e) {
                  var t = e && e.type;
                  return t && Gpt[t] ? Gpt[t] : null;
                })(e),
                i = Ggt(o.props, "".concat(n));
              n &&
                Yut(i) &&
                i(
                  null !==
                    (t = /.*touch.*/i.test(n)
                      ? o.getMouseInfo(e.changedTouches[0])
                      : o.getMouseInfo(e)) && void 0 !== t
                    ? t
                    : {},
                  e,
                );
            }),
            qVt(o, "handleClick", function (e) {
              var t = o.getMouseInfo(e);
              if (t) {
                var n = $Vt($Vt({}, t), {}, { isTooltipActive: !0 });
                (o.setState(n), o.triggerSyncEvent(n));
                var i = o.props.onClick;
                Yut(i) && i(n, e);
              }
            }),
            qVt(o, "handleMouseDown", function (e) {
              var t = o.props.onMouseDown;
              Yut(t) && t(o.getMouseInfo(e), e);
            }),
            qVt(o, "handleMouseUp", function (e) {
              var t = o.props.onMouseUp;
              Yut(t) && t(o.getMouseInfo(e), e);
            }),
            qVt(o, "handleTouchMove", function (e) {
              null != e.changedTouches &&
                e.changedTouches.length > 0 &&
                o.throttleTriggeredAfterMouseMove(e.changedTouches[0]);
            }),
            qVt(o, "handleTouchStart", function (e) {
              null != e.changedTouches &&
                e.changedTouches.length > 0 &&
                o.handleMouseDown(e.changedTouches[0]);
            }),
            qVt(o, "handleTouchEnd", function (e) {
              null != e.changedTouches &&
                e.changedTouches.length > 0 &&
                o.handleMouseUp(e.changedTouches[0]);
            }),
            qVt(o, "handleDoubleClick", function (e) {
              var t = o.props.onDoubleClick;
              Yut(t) && t(o.getMouseInfo(e), e);
            }),
            qVt(o, "handleContextMenu", function (e) {
              var t = o.props.onContextMenu;
              Yut(t) && t(o.getMouseInfo(e), e);
            }),
            qVt(o, "triggerSyncEvent", function (e) {
              void 0 !== o.props.syncId && mVt.emit(_Vt, o.props.syncId, e, o.eventEmitterSymbol);
            }),
            qVt(o, "applySyncEvent", function (e) {
              var t = o.props,
                n = t.layout,
                i = t.syncMethod,
                r = o.state.updateId,
                s = e.dataStartIndex,
                a = e.dataEndIndex;
              if (void 0 !== e.dataStartIndex || void 0 !== e.dataEndIndex)
                o.setState(
                  $Vt(
                    { dataStartIndex: s, dataEndIndex: a },
                    h({ props: o.props, dataStartIndex: s, dataEndIndex: a, updateId: r }, o.state),
                  ),
                );
              else if (void 0 !== e.activeTooltipIndex) {
                var l = e.chartX,
                  c = e.chartY,
                  d = e.activeTooltipIndex,
                  u = o.state,
                  g = u.offset,
                  p = u.tooltipTicks;
                if (!g) return;
                if ("function" == typeof i) d = i(p, e);
                else if ("value" === i) {
                  d = -1;
                  for (var f = 0; f < p.length; f++)
                    if (p[f].value === e.activeLabel) {
                      d = f;
                      break;
                    }
                }
                var m = $Vt($Vt({}, g), {}, { x: g.left, y: g.top }),
                  _ = Math.min(l, m.x + m.width),
                  v = Math.min(c, m.y + m.height),
                  b = p[d] && p[d].value,
                  y = eWt(o.state, o.props.data, d),
                  x = p[d]
                    ? {
                        x: "horizontal" === n ? p[d].coordinate : _,
                        y: "horizontal" === n ? v : p[d].coordinate,
                      }
                    : YVt;
                o.setState(
                  $Vt(
                    $Vt({}, e),
                    {},
                    {
                      activeLabel: b,
                      activeCoordinate: x,
                      activePayload: y,
                      activeTooltipIndex: d,
                    },
                  ),
                );
              } else o.setState(e);
            }),
            qVt(o, "renderCursor", function (e) {
              var n,
                i = o.state,
                r = i.isTooltipActive,
                s = i.activeCoordinate,
                a = i.activePayload,
                l = i.offset,
                c = i.activeTooltipIndex,
                d = i.tooltipAxisBandSize,
                u = o.getTooltipEventType(),
                h = null !== (n = e.props.active) && void 0 !== n ? n : r,
                g = o.props.layout,
                p = e.key || "_recharts-cursor";
              return z.createElement(DVt, {
                key: p,
                activeCoordinate: s,
                activePayload: a,
                activeTooltipIndex: c,
                chartName: t,
                element: e,
                isActive: h,
                layout: g,
                offset: l,
                tooltipAxisBandSize: d,
                tooltipEventType: u,
              });
            }),
            qVt(o, "renderPolarAxis", function (e, t, n) {
              var i = Ggt(e, "type.axisType"),
                r = Ggt(o.state, "".concat(i, "Map")),
                s = e.type.defaultProps,
                a = void 0 !== s ? $Vt($Vt({}, s), e.props) : e.props,
                l = r && r[a["".concat(i, "Id")]];
              return H.cloneElement(
                e,
                $Vt(
                  $Vt({}, l),
                  {},
                  {
                    className: Mp(i, l.className),
                    key: e.key || "".concat(t, "-").concat(n),
                    ticks: dIt(l, !0),
                  },
                ),
              );
            }),
            qVt(o, "renderPolarGrid", function (e) {
              var t = e.props,
                n = t.radialLines,
                i = t.polarAngles,
                r = t.polarRadius,
                s = o.state,
                a = s.radiusAxisMap,
                l = s.angleAxisMap,
                c = Rpt(a),
                d = Rpt(l),
                u = d.cx,
                h = d.cy,
                g = d.innerRadius,
                p = d.outerRadius;
              return H.cloneElement(e, {
                polarAngles: Array.isArray(i)
                  ? i
                  : dIt(d, !0).map(function (e) {
                      return e.coordinate;
                    }),
                polarRadius: Array.isArray(r)
                  ? r
                  : dIt(c, !0).map(function (e) {
                      return e.coordinate;
                    }),
                cx: u,
                cy: h,
                innerRadius: g,
                outerRadius: p,
                key: e.key || "polar-grid",
                radialLines: n,
              });
            }),
            qVt(o, "renderLegend", function () {
              var e = o.state.formattedGraphicalItems,
                t = o.props,
                n = t.children,
                i = t.width,
                r = t.height,
                s = o.props.margin || {},
                a = i - (s.left || 0) - (s.right || 0),
                c = YTt({
                  children: n,
                  formattedGraphicalItems: e,
                  legendWidth: a,
                  legendContent: l,
                });
              if (!c) return null;
              var d = c.item,
                u = AVt(c, TVt);
              return H.cloneElement(
                d,
                $Vt(
                  $Vt({}, u),
                  {},
                  {
                    chartWidth: i,
                    chartHeight: r,
                    margin: s,
                    onBBoxUpdate: o.handleLegendBBoxUpdate,
                  },
                ),
              );
            }),
            qVt(o, "renderTooltip", function () {
              var e,
                t = o.props,
                n = t.children,
                i = t.accessibilityLayer,
                r = eft(n, dCt);
              if (!r) return null;
              var s = o.state,
                a = s.isTooltipActive,
                l = s.activeCoordinate,
                c = s.activePayload,
                d = s.activeLabel,
                u = s.offset,
                h = null !== (e = r.props.active) && void 0 !== e ? e : a;
              return H.cloneElement(r, {
                viewBox: $Vt($Vt({}, u), {}, { x: u.left, y: u.top }),
                active: h,
                label: d,
                payload: h ? c : [],
                coordinate: l,
                accessibilityLayer: i,
              });
            }),
            qVt(o, "renderBrush", function (e) {
              var t = o.props,
                n = t.margin,
                i = t.data,
                r = o.state,
                s = r.offset,
                a = r.dataStartIndex,
                l = r.dataEndIndex,
                c = r.updateId;
              return H.cloneElement(e, {
                key: e.key || "_recharts-brush",
                onChange: hIt(o.handleBrushChange, e.props.onChange),
                data: i,
                x: Npt(e.props.x) ? e.props.x : s.left,
                y: Npt(e.props.y) ? e.props.y : s.top + s.height + s.brushBottom - (n.bottom || 0),
                width: Npt(e.props.width) ? e.props.width : s.width,
                startIndex: a,
                endIndex: l,
                updateId: "brush-".concat(c),
              });
            }),
            qVt(o, "renderReferenceElement", function (e, t, n) {
              if (!e) return null;
              var i = o.clipPathId,
                r = o.state,
                s = r.xAxisMap,
                a = r.yAxisMap,
                l = r.offset,
                c = e.type.defaultProps || {},
                d = e.props,
                u = d.xAxisId,
                h = void 0 === u ? c.xAxisId : u,
                g = d.yAxisId,
                p = void 0 === g ? c.yAxisId : g;
              return H.cloneElement(e, {
                key: e.key || "".concat(t, "-").concat(n),
                xAxis: s[h],
                yAxis: a[p],
                viewBox: { x: l.left, y: l.top, width: l.width, height: l.height },
                clipPathId: i,
              });
            }),
            qVt(o, "renderActivePoints", function (t) {
              var n = t.item,
                i = t.activePoint,
                r = t.basePoint,
                o = t.childIndex,
                s = t.isRange,
                a = [],
                l = n.props.key,
                c =
                  void 0 !== n.item.type.defaultProps
                    ? $Vt($Vt({}, n.item.type.defaultProps), n.item.props)
                    : n.item.props,
                d = c.activeDot,
                u = $Vt(
                  $Vt(
                    {
                      index: o,
                      dataKey: c.dataKey,
                      cx: i.x,
                      cy: i.y,
                      r: 4,
                      fill: oIt(n.item),
                      strokeWidth: 2,
                      stroke: "#fff",
                      payload: i.payload,
                      value: i.value,
                    },
                    rft(d, !1),
                  ),
                  Hpt(d),
                );
              return (
                a.push(e.renderActiveDot(d, u, "".concat(l, "-activePoint-").concat(o))),
                r
                  ? a.push(
                      e.renderActiveDot(
                        d,
                        $Vt($Vt({}, u), {}, { cx: r.x, cy: r.y }),
                        "".concat(l, "-basePoint-").concat(o),
                      ),
                    )
                  : s && a.push(null),
                a
              );
            }),
            qVt(o, "renderGraphicChild", function (e, t, n) {
              var i = o.filterFormatItem(e, t, n);
              if (!i) return null;
              var r = o.getTooltipEventType(),
                s = o.state,
                a = s.isTooltipActive,
                l = s.tooltipAxis,
                c = s.activeTooltipIndex,
                d = s.activeLabel,
                u = eft(o.props.children, dCt),
                h = i.props,
                g = h.points,
                p = h.isRange,
                f = h.baseLine,
                m =
                  void 0 !== i.item.type.defaultProps
                    ? $Vt($Vt({}, i.item.type.defaultProps), i.item.props)
                    : i.item.props,
                _ = m.activeDot,
                v = m.hide,
                b = m.activeBar,
                y = m.activeShape,
                x = Boolean(!v && a && u && (_ || b || y)),
                w = {};
              "axis" !== r && u && "click" === u.props.trigger
                ? (w = { onClick: hIt(o.handleItemMouseEnter, e.props.onClick) })
                : "axis" !== r &&
                  (w = {
                    onMouseLeave: hIt(o.handleItemMouseLeave, e.props.onMouseLeave),
                    onMouseEnter: hIt(o.handleItemMouseEnter, e.props.onMouseEnter),
                  });
              var C = H.cloneElement(e, $Vt($Vt({}, i.props), w));
              if (x) {
                if (!(c >= 0)) {
                  var S,
                    k = (
                      null !== (S = o.getItemByXY(o.state.activeCoordinate)) && void 0 !== S
                        ? S
                        : { graphicalItem: C }
                    ).graphicalItem,
                    E = k.item,
                    N = void 0 === E ? e : E,
                    L = k.childIndex,
                    D = $Vt($Vt($Vt({}, i.props), w), {}, { activeIndex: L });
                  return [H.cloneElement(N, D), null, null];
                }
                var T, I;
                if (l.dataKey && !l.allowDuplicatedCategory) {
                  var R =
                    "function" == typeof l.dataKey
                      ? function (e) {
                          return "function" == typeof l.dataKey ? l.dataKey(e.payload) : null;
                        }
                      : "payload.".concat(l.dataKey.toString());
                  ((T = Mpt(g, R, d)), (I = p && f && Mpt(f, R, d)));
                } else ((T = null == g ? void 0 : g[c]), (I = p && f && f[c]));
                if (y || b) {
                  var O = void 0 !== e.props.activeIndex ? e.props.activeIndex : c;
                  return [
                    H.cloneElement(e, $Vt($Vt($Vt({}, i.props), w), {}, { activeIndex: O })),
                    null,
                    null,
                  ];
                }
                if (!Zgt(T))
                  return [C].concat(
                    WVt(
                      o.renderActivePoints({
                        item: i,
                        activePoint: T,
                        basePoint: I,
                        childIndex: c,
                        isRange: p,
                      }),
                    ),
                  );
              }
              return p ? [C, null, null] : [C, null];
            }),
            qVt(o, "renderCustomized", function (e, t, n) {
              return H.cloneElement(
                e,
                $Vt($Vt({ key: "recharts-customized-".concat(n) }, o.props), o.state),
              );
            }),
            qVt(o, "renderMap", {
              CartesianGrid: { handler: XVt, once: !0 },
              ReferenceArea: { handler: o.renderReferenceElement },
              ReferenceLine: { handler: XVt },
              ReferenceDot: { handler: o.renderReferenceElement },
              XAxis: { handler: XVt },
              YAxis: { handler: XVt },
              Brush: { handler: o.renderBrush, once: !0 },
              Bar: { handler: o.renderGraphicChild },
              Line: { handler: o.renderGraphicChild },
              Area: { handler: o.renderGraphicChild },
              Radar: { handler: o.renderGraphicChild },
              RadialBar: { handler: o.renderGraphicChild },
              Scatter: { handler: o.renderGraphicChild },
              Pie: { handler: o.renderGraphicChild },
              Funnel: { handler: o.renderGraphicChild },
              Tooltip: { handler: o.renderCursor, once: !0 },
              PolarGrid: { handler: o.renderPolarGrid, once: !0 },
              PolarAngleAxis: { handler: o.renderPolarAxis },
              PolarRadiusAxis: { handler: o.renderPolarAxis },
              Customized: { handler: o.renderCustomized },
            }),
            (o.clipPathId = "".concat(
              null !== (i = n.id) && void 0 !== i ? i : Tpt("recharts"),
              "-clip",
            )),
            (o.throttleTriggeredAfterMouseMove = MCt(
              o.triggeredAfterMouseMove,
              null !== (r = n.throttleDelay) && void 0 !== r ? r : 1e3 / 60,
            )),
            (o.state = {}),
            o
          );
        }
        return (
          (function (e, t) {
            if ("function" != typeof t && null !== t)
              throw new TypeError("Super expression must either be null or a function");
            ((e.prototype = Object.create(t && t.prototype, {
              constructor: { value: e, writable: !0, configurable: !0 },
            })),
              Object.defineProperty(e, "prototype", { writable: !1 }),
              t && VVt(e, t));
          })(e, H.Component),
          PVt(e, [
            {
              key: "componentDidMount",
              value: function () {
                var e, t;
                (this.addListener(),
                  this.accessibilityManager.setDetails({
                    container: this.container,
                    offset: {
                      left: null !== (e = this.props.margin.left) && void 0 !== e ? e : 0,
                      top: null !== (t = this.props.margin.top) && void 0 !== t ? t : 0,
                    },
                    coordinateList: this.state.tooltipTicks,
                    mouseHandlerCallback: this.triggeredAfterMouseMove,
                    layout: this.props.layout,
                  }),
                  this.displayDefaultTooltip());
              },
            },
            {
              key: "displayDefaultTooltip",
              value: function () {
                var e = this.props,
                  t = e.children,
                  n = e.data,
                  i = e.height,
                  r = e.layout,
                  o = eft(t, dCt);
                if (o) {
                  var s = o.props.defaultIndex;
                  if (!("number" != typeof s || s < 0 || s > this.state.tooltipTicks.length - 1)) {
                    var a = this.state.tooltipTicks[s] && this.state.tooltipTicks[s].value,
                      l = eWt(this.state, n, s, a),
                      c = this.state.tooltipTicks[s].coordinate,
                      d = (this.state.offset.top + i) / 2,
                      u = "horizontal" === r ? { x: c, y: d } : { y: c, x: d },
                      h = this.state.formattedGraphicalItems.find(function (e) {
                        return "Scatter" === e.item.type.name;
                      });
                    h &&
                      ((u = $Vt($Vt({}, u), h.props.points[s].tooltipPosition)),
                      (l = h.props.points[s].tooltipPayload));
                    var g = {
                      activeTooltipIndex: s,
                      isTooltipActive: !0,
                      activeLabel: a,
                      activePayload: l,
                      activeCoordinate: u,
                    };
                    (this.setState(g), this.renderCursor(o), this.accessibilityManager.setIndex(s));
                  }
                }
              },
            },
            {
              key: "getSnapshotBeforeUpdate",
              value: function (e, t) {
                if (!this.props.accessibilityLayer) return null;
                var n, i;
                (this.state.tooltipTicks !== t.tooltipTicks &&
                  this.accessibilityManager.setDetails({ coordinateList: this.state.tooltipTicks }),
                this.props.layout !== e.layout &&
                  this.accessibilityManager.setDetails({ layout: this.props.layout }),
                this.props.margin !== e.margin) &&
                  this.accessibilityManager.setDetails({
                    offset: {
                      left: null !== (n = this.props.margin.left) && void 0 !== n ? n : 0,
                      top: null !== (i = this.props.margin.top) && void 0 !== i ? i : 0,
                    },
                  });
                return null;
              },
            },
            {
              key: "componentDidUpdate",
              value: function (e) {
                oft([eft(e.children, dCt)], [eft(this.props.children, dCt)]) ||
                  this.displayDefaultTooltip();
              },
            },
            {
              key: "componentWillUnmount",
              value: function () {
                (this.removeListener(), this.throttleTriggeredAfterMouseMove.cancel());
              },
            },
            {
              key: "getTooltipEventType",
              value: function () {
                var e = eft(this.props.children, dCt);
                if (e && "boolean" == typeof e.props.shared) {
                  var t = e.props.shared ? "axis" : "item";
                  return s.indexOf(t) >= 0 ? t : r;
                }
                return r;
              },
            },
            {
              key: "getMouseInfo",
              value: function (e) {
                if (!this.container) return null;
                var t,
                  n = this.container,
                  i = n.getBoundingClientRect(),
                  r = {
                    top: (t = i).top + window.scrollY - document.documentElement.clientTop,
                    left: t.left + window.scrollX - document.documentElement.clientLeft,
                  },
                  o = { chartX: Math.round(e.pageX - r.left), chartY: Math.round(e.pageY - r.top) },
                  s = i.width / n.offsetWidth || 1,
                  a = this.inRange(o.chartX, o.chartY, s);
                if (!a) return null;
                var l = this.state,
                  c = l.xAxisMap,
                  d = l.yAxisMap,
                  u = this.getTooltipEventType(),
                  h = tWt(this.state, this.props.data, this.props.layout, a);
                if ("axis" !== u && c && d) {
                  var g = Rpt(c).scale,
                    p = Rpt(d).scale,
                    f = g && g.invert ? g.invert(o.chartX) : null,
                    m = p && p.invert ? p.invert(o.chartY) : null;
                  return $Vt($Vt({}, o), {}, { xValue: f, yValue: m }, h);
                }
                return h ? $Vt($Vt({}, o), h) : null;
              },
            },
            {
              key: "inRange",
              value: function (e, t) {
                var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
                  i = this.props.layout,
                  r = e / n,
                  o = t / n;
                if ("horizontal" === i || "vertical" === i) {
                  var s = this.state.offset;
                  return r >= s.left && r <= s.left + s.width && o >= s.top && o <= s.top + s.height
                    ? { x: r, y: o }
                    : null;
                }
                var a = this.state,
                  l = a.angleAxisMap,
                  c = a.radiusAxisMap;
                if (l && c) {
                  var d = Rpt(l);
                  return MIt({ x: r, y: o }, d);
                }
                return null;
              },
            },
            {
              key: "parseEventsOfWrapper",
              value: function () {
                var e = this.props.children,
                  t = this.getTooltipEventType(),
                  n = eft(e, dCt),
                  i = {};
                return (
                  n &&
                    "axis" === t &&
                    (i =
                      "click" === n.props.trigger
                        ? { onClick: this.handleClick }
                        : {
                            onMouseEnter: this.handleMouseEnter,
                            onDoubleClick: this.handleDoubleClick,
                            onMouseMove: this.handleMouseMove,
                            onMouseLeave: this.handleMouseLeave,
                            onTouchMove: this.handleTouchMove,
                            onTouchStart: this.handleTouchStart,
                            onTouchEnd: this.handleTouchEnd,
                            onContextMenu: this.handleContextMenu,
                          }),
                  $Vt($Vt({}, Hpt(this.props, this.handleOuterEvent)), i)
                );
              },
            },
            {
              key: "addListener",
              value: function () {
                mVt.on(_Vt, this.handleReceiveSyncEvent);
              },
            },
            {
              key: "removeListener",
              value: function () {
                mVt.removeListener(_Vt, this.handleReceiveSyncEvent);
              },
            },
            {
              key: "filterFormatItem",
              value: function (e, t, n) {
                for (var i = this.state.formattedGraphicalItems, r = 0, o = i.length; r < o; r++) {
                  var s = i[r];
                  if (
                    s.item === e ||
                    s.props.key === e.key ||
                    (t === Zpt(s.item.type) && n === s.childIndex)
                  )
                    return s;
                }
                return null;
              },
            },
            {
              key: "renderClipPath",
              value: function () {
                var e = this.clipPathId,
                  t = this.state.offset,
                  n = t.left,
                  i = t.top,
                  r = t.height,
                  o = t.width;
                return z.createElement(
                  "defs",
                  null,
                  z.createElement(
                    "clipPath",
                    { id: e },
                    z.createElement("rect", { x: n, y: i, height: r, width: o }),
                  ),
                );
              },
            },
            {
              key: "getXScales",
              value: function () {
                var e = this.state.xAxisMap;
                return e
                  ? Object.entries(e).reduce(function (e, t) {
                      var n = MVt(t, 2),
                        i = n[0],
                        r = n[1];
                      return $Vt($Vt({}, e), {}, qVt({}, i, r.scale));
                    }, {})
                  : null;
              },
            },
            {
              key: "getYScales",
              value: function () {
                var e = this.state.yAxisMap;
                return e
                  ? Object.entries(e).reduce(function (e, t) {
                      var n = MVt(t, 2),
                        i = n[0],
                        r = n[1];
                      return $Vt($Vt({}, e), {}, qVt({}, i, r.scale));
                    }, {})
                  : null;
              },
            },
            {
              key: "getXScaleByAxisId",
              value: function (e) {
                var t;
                return null === (t = this.state.xAxisMap) ||
                  void 0 === t ||
                  null === (t = t[e]) ||
                  void 0 === t
                  ? void 0
                  : t.scale;
              },
            },
            {
              key: "getYScaleByAxisId",
              value: function (e) {
                var t;
                return null === (t = this.state.yAxisMap) ||
                  void 0 === t ||
                  null === (t = t[e]) ||
                  void 0 === t
                  ? void 0
                  : t.scale;
              },
            },
            {
              key: "getItemByXY",
              value: function (e) {
                var t = this.state,
                  n = t.formattedGraphicalItems,
                  i = t.activeItem;
                if (n && n.length)
                  for (var r = 0, o = n.length; r < o; r++) {
                    var s = n[r],
                      a = s.props,
                      l = s.item,
                      c =
                        void 0 !== l.type.defaultProps
                          ? $Vt($Vt({}, l.type.defaultProps), l.props)
                          : l.props,
                      d = Zpt(l.type);
                    if ("Bar" === d) {
                      var u = (a.data || []).find(function (t) {
                        return uMt(e, t);
                      });
                      if (u) return { graphicalItem: s, payload: u };
                    } else if ("RadialBar" === d) {
                      var h = (a.data || []).find(function (t) {
                        return MIt(e, t);
                      });
                      if (h) return { graphicalItem: s, payload: h };
                    } else if (nAt(s, i) || iAt(s, i) || rAt(s, i)) {
                      var g = lAt({ graphicalItem: s, activeTooltipItem: i, itemData: c.data }),
                        p = void 0 === c.activeIndex ? g : c.activeIndex;
                      return {
                        graphicalItem: $Vt($Vt({}, s), {}, { childIndex: p }),
                        payload: rAt(s, i) ? c.data[g] : s.props.data[g],
                      };
                    }
                  }
                return null;
              },
            },
            {
              key: "render",
              value: function () {
                var e = this;
                if (!tft(this)) return null;
                var t,
                  n,
                  i = this.props,
                  r = i.children,
                  o = i.className,
                  s = i.width,
                  a = i.height,
                  l = i.style,
                  c = i.compact,
                  d = i.title,
                  u = i.desc,
                  h = AVt(i, IVt),
                  g = rft(h, !1);
                if (c)
                  return z.createElement(
                    ajt,
                    {
                      state: this.state,
                      width: this.props.width,
                      height: this.props.height,
                      clipPathId: this.clipPathId,
                    },
                    z.createElement(
                      uft,
                      OVt({}, g, { width: s, height: a, title: d, desc: u }),
                      this.renderClipPath(),
                      aft(r, this.renderMap),
                    ),
                  );
                this.props.accessibilityLayer &&
                  ((g.tabIndex = null !== (t = this.props.tabIndex) && void 0 !== t ? t : 0),
                  (g.role = null !== (n = this.props.role) && void 0 !== n ? n : "application"),
                  (g.onKeyDown = function (t) {
                    e.accessibilityManager.keyboardEvent(t);
                  }),
                  (g.onFocus = function () {
                    e.accessibilityManager.focus();
                  }));
                var p = this.parseEventsOfWrapper();
                return z.createElement(
                  ajt,
                  {
                    state: this.state,
                    width: this.props.width,
                    height: this.props.height,
                    clipPathId: this.clipPathId,
                  },
                  z.createElement(
                    "div",
                    OVt(
                      {
                        className: Mp("recharts-wrapper", o),
                        style: $Vt(
                          { position: "relative", cursor: "default", width: s, height: a },
                          l,
                        ),
                      },
                      p,
                      {
                        ref: function (t) {
                          e.container = t;
                        },
                      },
                    ),
                    z.createElement(
                      uft,
                      OVt({}, g, { width: s, height: a, title: d, desc: u, style: ZVt }),
                      this.renderClipPath(),
                      aft(r, this.renderMap),
                    ),
                    this.renderLegend(),
                    this.renderTooltip(),
                  ),
                );
              },
            },
          ])
        );
      })();
    (qVt(g, "displayName", t),
      qVt(
        g,
        "defaultProps",
        $Vt(
          {
            layout: "horizontal",
            stackOffset: "none",
            barCategoryGap: "10%",
            barGap: 4,
            margin: { top: 5, right: 5, bottom: 5, left: 5 },
            reverseStackOrder: !1,
            syncMethod: "index",
          },
          d,
        ),
      ),
      qVt(g, "getDerivedStateFromProps", function (e, t) {
        var n = e.dataKey,
          i = e.data,
          r = e.children,
          o = e.width,
          s = e.height,
          a = e.layout,
          l = e.stackOffset,
          c = e.margin,
          d = t.dataStartIndex,
          u = t.dataEndIndex;
        if (void 0 === t.updateId) {
          var g = rWt(e);
          return $Vt(
            $Vt(
              $Vt({}, g),
              {},
              { updateId: 0 },
              h($Vt($Vt({ props: e }, g), {}, { updateId: 0 }), t),
            ),
            {},
            {
              prevDataKey: n,
              prevData: i,
              prevWidth: o,
              prevHeight: s,
              prevLayout: a,
              prevStackOffset: l,
              prevMargin: c,
              prevChildren: r,
            },
          );
        }
        if (
          n !== t.prevDataKey ||
          i !== t.prevData ||
          o !== t.prevWidth ||
          s !== t.prevHeight ||
          a !== t.prevLayout ||
          l !== t.prevStackOffset ||
          !Ppt(c, t.prevMargin)
        ) {
          var p = rWt(e),
            f = { chartX: t.chartX, chartY: t.chartY, isTooltipActive: t.isTooltipActive },
            m = $Vt($Vt({}, tWt(t, i, a)), {}, { updateId: t.updateId + 1 }),
            _ = $Vt($Vt($Vt({}, p), f), m);
          return $Vt(
            $Vt($Vt({}, _), h($Vt({ props: e }, _), t)),
            {},
            {
              prevDataKey: n,
              prevData: i,
              prevWidth: o,
              prevHeight: s,
              prevLayout: a,
              prevStackOffset: l,
              prevMargin: c,
              prevChildren: r,
            },
          );
        }
        if (!oft(r, t.prevChildren)) {
          var v,
            b,
            y,
            x,
            w = eft(r, PAt),
            C =
              w &&
              null !== (v = null === (b = w.props) || void 0 === b ? void 0 : b.startIndex) &&
              void 0 !== v
                ? v
                : d,
            S =
              w &&
              null !== (y = null === (x = w.props) || void 0 === x ? void 0 : x.endIndex) &&
              void 0 !== y
                ? y
                : u,
            k = C !== d || S !== u,
            E = !Zgt(i) && !k ? t.updateId : t.updateId + 1;
          return $Vt(
            $Vt(
              { updateId: E },
              h(
                $Vt($Vt({ props: e }, t), {}, { updateId: E, dataStartIndex: C, dataEndIndex: S }),
                t,
              ),
            ),
            {},
            { prevChildren: r, dataStartIndex: C, dataEndIndex: S },
          );
        }
        return null;
      }),
      qVt(g, "renderActiveDot", function (e, t, n) {
        var i;
        return (
          (i = H.isValidElement(e)
            ? H.cloneElement(e, t)
            : Yut(e)
              ? e(t)
              : z.createElement(fMt, t)),
          z.createElement(fft, { className: "recharts-active-dot", key: n }, i)
        );
      }));
    var p = H.forwardRef(function (e, t) {
      return z.createElement(g, OVt({}, e, { ref: t }));
    });
    return ((p.displayName = g.displayName), p);
  })({
    chartName: "ComposedChart",
    GraphicalChild: [tBt, _Bt, RPt, HBt],
    axisComponents: [
      { axisType: "xAxis", AxisComp: JBt },
      { axisType: "yAxis", AxisComp: dVt },
      { axisType: "zAxis", AxisComp: EBt },
    ],
    formatAxisMap: function (e, t, n, i, r) {
      var o = e.width,
        s = e.height,
        a = e.layout,
        l = e.children,
        c = Object.keys(t),
        d = {
          left: n.left,
          leftMirror: n.left,
          right: o - n.right,
          rightMirror: o - n.right,
          top: n.top,
          topMirror: n.top,
          bottom: s - n.bottom,
          bottomMirror: s - n.bottom,
        },
        u = !!eft(l, RPt);
      return c.reduce(function (o, s) {
        var l,
          c,
          h,
          g,
          p,
          f = t[s],
          m = f.orientation,
          _ = f.domain,
          v = f.padding,
          b = void 0 === v ? {} : v,
          y = f.mirror,
          x = f.reversed,
          w = "".concat(m).concat(y ? "Mirror" : "");
        if ("number" === f.type && ("gap" === f.padding || "no-gap" === f.padding)) {
          var C = _[1] - _[0],
            S = 1 / 0,
            k = f.categoricalDomain.sort(Apt);
          if (
            (k.forEach(function (e, t) {
              t > 0 && (S = Math.min((e || 0) - (k[t - 1] || 0), S));
            }),
            Number.isFinite(S))
          ) {
            var E = S / C,
              N = "vertical" === f.layout ? n.height : n.width;
            if (("gap" === f.padding && (l = (E * N) / 2), "no-gap" === f.padding)) {
              var L = Ipt(e.barCategoryGap, E * N),
                D = (E * N) / 2;
              l = D - L - ((D - L) / N) * L;
            }
          }
        }
        ((c =
          "xAxis" === i
            ? [n.left + (b.left || 0) + (l || 0), n.left + n.width - (b.right || 0) - (l || 0)]
            : "yAxis" === i
              ? "horizontal" === a
                ? [n.top + n.height - (b.bottom || 0), n.top + (b.top || 0)]
                : [n.top + (b.top || 0) + (l || 0), n.top + n.height - (b.bottom || 0) - (l || 0)]
              : f.range),
          x && (c = [c[1], c[0]]));
        var T = (function (e, t, n) {
            var i = e.scale,
              r = e.type,
              o = e.layout,
              s = e.axisType;
            if ("auto" === i)
              return "radial" === o && "radiusAxis" === s
                ? { scale: QSt(), realScaleType: "band" }
                : "radial" === o && "angleAxis" === s
                  ? { scale: wEt(), realScaleType: "linear" }
                  : "category" === r &&
                      t &&
                      (t.indexOf("LineChart") >= 0 ||
                        t.indexOf("AreaChart") >= 0 ||
                        (t.indexOf("ComposedChart") >= 0 && !n))
                    ? { scale: ekt(), realScaleType: "point" }
                    : "category" === r
                      ? { scale: QSt(), realScaleType: "band" }
                      : { scale: wEt(), realScaleType: "linear" };
            if (Jgt(i)) {
              var a = "scale".concat($ft(i));
              return { scale: (aDt[a] || ekt)(), realScaleType: aDt[a] ? a : "point" };
            }
            return Yut(i) ? { scale: i } : { scale: ekt(), realScaleType: "point" };
          })(f, r, u),
          I = T.scale,
          R = T.realScaleType;
        (I.domain(_).range(c),
          (function (e) {
            var t = e.domain();
            if (t && !(t.length <= 2)) {
              var n = t.length,
                i = e.range(),
                r = Math.min(i[0], i[1]) - gIt,
                o = Math.max(i[0], i[1]) + gIt,
                s = e(t[0]),
                a = e(t[n - 1]);
              (s < r || s > o || a < r || a > o) && e.domain([t[0], t[n - 1]]);
            }
          })(I));
        var O = (function (e, t) {
          var n = t.realScaleType,
            i = t.type,
            r = t.tickCount,
            o = t.originalDomain,
            s = t.allowDecimals,
            a = n || t.scale;
          if ("auto" !== a && "linear" !== a) return null;
          if (r && "number" === i && o && ("auto" === o[0] || "auto" === o[1])) {
            var l = e.domain();
            if (!l.length) return null;
            var c = DTt(l, r, s);
            return (e.domain([bDt(c), pDt(c)]), { niceTicks: c });
          }
          if (r && "number" === i) {
            var d = e.domain();
            return { niceTicks: TTt(d, r, s) };
          }
          return null;
        })(I, PPt(PPt({}, f), {}, { realScaleType: R }));
        "xAxis" === i
          ? ((p = ("top" === m && !y) || ("bottom" === m && y)),
            (h = n.left),
            (g = d[w] - p * f.height))
          : "yAxis" === i &&
            ((p = ("left" === m && !y) || ("right" === m && y)),
            (h = d[w] - p * f.width),
            (g = n.top));
        var M = PPt(
          PPt(PPt({}, f), O),
          {},
          {
            realScaleType: R,
            x: h,
            y: g,
            scale: I,
            width: "xAxis" === i ? n.width : f.width,
            height: "yAxis" === i ? n.height : f.height,
          },
        );
        return (
          (M.bandSize = wIt(M, O)),
          f.hide || "xAxis" !== i
            ? f.hide || (d[w] += (p ? -1 : 1) * M.width)
            : (d[w] += (p ? -1 : 1) * M.height),
          PPt(PPt({}, o), {}, jPt({}, s, M))
        );
      }, {});
    },
  });
function cWt(e, [t, n]) {
  return Math.min(n, Math.max(t, e));
}
function dWt(e) {
  const t = H.forwardRef((e, t) => {
    const { children: n, ...i } = e;
    if (H.isValidElement(n)) {
      const e = (function (e) {
          let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get,
            n = t && "isReactWarning" in t && t.isReactWarning;
          if (n) return e.ref;
          if (
            ((t = Object.getOwnPropertyDescriptor(e, "ref")?.get),
            (n = t && "isReactWarning" in t && t.isReactWarning),
            n)
          )
            return e.props.ref;
          return e.props.ref || e.ref;
        })(n),
        r = (function (e, t) {
          const n = { ...t };
          for (const i in t) {
            const r = e[i],
              o = t[i];
            /^on[A-Z]/.test(i)
              ? r && o
                ? (n[i] = (...e) => {
                    const t = o(...e);
                    return (r(...e), t);
                  })
                : r && (n[i] = r)
              : "style" === i
                ? (n[i] = { ...r, ...o })
                : "className" === i && (n[i] = [r, o].filter(Boolean).join(" "));
          }
          return { ...e, ...n };
        })(i, n.props);
      return (n.type !== H.Fragment && (r.ref = t ? Cp(t, e) : e), H.cloneElement(n, r));
    }
    return H.Children.count(n) > 1 ? H.Children.only(null) : null;
  });
  return ((t.displayName = `${e}.SlotClone`), t);
}
var uWt = Symbol("radix.slottable");
function hWt(e) {
  return (
    H.isValidElement(e) &&
    "function" == typeof e.type &&
    "__radixId" in e.type &&
    e.type.__radixId === uWt
  );
}
function gWt(e) {
  const t = H.useRef({ value: e, previous: e });
  return H.useMemo(
    () => (
      t.current.value !== e && ((t.current.previous = t.current.value), (t.current.value = e)),
      t.current.previous
    ),
    [e],
  );
}
var pWt = Object.freeze({
  position: "absolute",
  border: 0,
  width: 1,
  height: 1,
  padding: 0,
  margin: -1,
  overflow: "hidden",
  clip: "rect(0, 0, 0, 0)",
  whiteSpace: "nowrap",
  wordWrap: "normal",
});
H.forwardRef((e, t) =>
  Q.jsx(gx.span, { ...e, ref: t, style: { ...pWt, ...e.style } }),
).displayName = "VisuallyHidden";
var fWt = [" ", "Enter", "ArrowUp", "ArrowDown"],
  mWt = [" ", "Enter"],
  _Wt = "Select",
  [vWt, bWt, yWt] = ox(_Wt),
  [xWt] = Jy(_Wt, [yWt, lit]),
  wWt = lit(),
  [CWt, SWt] = xWt(_Wt),
  [kWt, EWt] = xWt(_Wt),
  NWt = (e) => {
    const {
        __scopeSelect: t,
        children: n,
        open: i,
        defaultOpen: r,
        onOpenChange: o,
        value: s,
        defaultValue: a,
        onValueChange: l,
        dir: c,
        name: d,
        autoComplete: u,
        disabled: h,
        required: g,
        form: p,
      } = e,
      f = wWt(t),
      [m, _] = H.useState(null),
      [v, b] = H.useState(null),
      [y, x] = H.useState(!1),
      w = bx(c),
      [C, S] = _x({ prop: i, defaultProp: r ?? !1, onChange: o, caller: _Wt }),
      [k, E] = _x({ prop: s, defaultProp: a, onChange: l, caller: _Wt }),
      N = H.useRef(null),
      L = !m || p || !!m.closest("form"),
      [D, T] = H.useState(new Set()),
      I = Array.from(D)
        .map((e) => e.props.value)
        .join(";");
    return Q.jsx(Sit, {
      ...f,
      children: Q.jsxs(CWt, {
        required: g,
        scope: t,
        trigger: m,
        onTriggerChange: _,
        valueNode: v,
        onValueNodeChange: b,
        valueNodeHasChildren: y,
        onValueNodeHasChildrenChange: x,
        contentId: cx(),
        value: k,
        onValueChange: E,
        open: C,
        onOpenChange: S,
        dir: w,
        triggerPointerDownPosRef: N,
        disabled: h,
        children: [
          Q.jsx(vWt.Provider, {
            scope: t,
            children: Q.jsx(kWt, {
              scope: e.__scopeSelect,
              onNativeOptionAdd: H.useCallback((e) => {
                T((t) => new Set(t).add(e));
              }, []),
              onNativeOptionRemove: H.useCallback((e) => {
                T((t) => {
                  const n = new Set(t);
                  return (n.delete(e), n);
                });
              }, []),
              children: n,
            }),
          }),
          L
            ? Q.jsxs(
                pHt,
                {
                  "aria-hidden": !0,
                  required: g,
                  tabIndex: -1,
                  name: d,
                  autoComplete: u,
                  value: k,
                  onChange: (e) => E(e.target.value),
                  disabled: h,
                  form: p,
                  children: [void 0 === k ? Q.jsx("option", { value: "" }) : null, Array.from(D)],
                },
                I,
              )
            : null,
        ],
      }),
    });
  };
NWt.displayName = _Wt;
var LWt = "SelectTrigger",
  DWt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, disabled: i = !1, ...r } = e,
      o = wWt(n),
      s = SWt(LWt, n),
      a = s.disabled || i,
      l = Sp(t, s.onTriggerChange),
      c = bWt(n),
      d = H.useRef("touch"),
      [u, h, g] = mHt((e) => {
        const t = c().filter((e) => !e.disabled),
          n = t.find((e) => e.value === s.value),
          i = _Ht(t, e, n);
        void 0 !== i && s.onValueChange(i.value);
      }),
      p = (e) => {
        (a || (s.onOpenChange(!0), g()),
          e &&
            (s.triggerPointerDownPosRef.current = {
              x: Math.round(e.pageX),
              y: Math.round(e.pageY),
            }));
      };
    return Q.jsx(kit, {
      asChild: !0,
      ...o,
      children: Q.jsx(gx.button, {
        type: "button",
        role: "combobox",
        "aria-controls": s.contentId,
        "aria-expanded": s.open,
        "aria-required": s.required,
        "aria-autocomplete": "none",
        dir: s.dir,
        "data-state": s.open ? "open" : "closed",
        disabled: a,
        "data-disabled": a ? "" : void 0,
        "data-placeholder": fHt(s.value) ? "" : void 0,
        ...r,
        ref: l,
        onClick: Qy(r.onClick, (e) => {
          (e.currentTarget.focus(), "mouse" !== d.current && p(e));
        }),
        onPointerDown: Qy(r.onPointerDown, (e) => {
          d.current = e.pointerType;
          const t = e.target;
          (t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId),
            0 === e.button &&
              !1 === e.ctrlKey &&
              "mouse" === e.pointerType &&
              (p(e), e.preventDefault()));
        }),
        onKeyDown: Qy(r.onKeyDown, (e) => {
          const t = "" !== u.current;
          (e.ctrlKey || e.altKey || e.metaKey || 1 !== e.key.length || h(e.key),
            (t && " " === e.key) || (fWt.includes(e.key) && (p(), e.preventDefault())));
        }),
      }),
    });
  });
DWt.displayName = LWt;
var TWt = "SelectValue",
  IWt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, className: i, style: r, children: o, placeholder: s = "", ...a } = e,
      l = SWt(TWt, n),
      { onValueNodeHasChildrenChange: c } = l,
      d = void 0 !== o,
      u = Sp(t, l.onValueNodeChange);
    return (
      sx(() => {
        c(d);
      }, [c, d]),
      Q.jsx(gx.span, {
        ...a,
        ref: u,
        style: { pointerEvents: "none" },
        children: fHt(l.value) ? Q.jsx(Q.Fragment, { children: s }) : o,
      })
    );
  });
IWt.displayName = TWt;
var RWt = H.forwardRef((e, t) => {
  const { __scopeSelect: n, children: i, ...r } = e;
  return Q.jsx(gx.span, { "aria-hidden": !0, ...r, ref: t, children: i || "▼" });
});
RWt.displayName = "SelectIcon";
var OWt = (e) => Q.jsx(y8e, { asChild: !0, ...e });
OWt.displayName = "SelectPortal";
var MWt = "SelectContent",
  AWt = H.forwardRef((e, t) => {
    const n = SWt(MWt, e.__scopeSelect),
      [i, r] = H.useState();
    if (
      (sx(() => {
        r(new DocumentFragment());
      }, []),
      !n.open)
    ) {
      const t = i;
      return t
        ? ru.createPortal(
            Q.jsx(jWt, {
              scope: e.__scopeSelect,
              children: Q.jsx(vWt.Slot, {
                scope: e.__scopeSelect,
                children: Q.jsx("div", { children: e.children }),
              }),
            }),
            t,
          )
        : null;
    }
    return Q.jsx(VWt, { ...e, ref: t });
  });
AWt.displayName = MWt;
var PWt = 10,
  [jWt, FWt] = xWt(MWt),
  BWt = (function (e) {
    const t = dWt(e),
      n = H.forwardRef((e, n) => {
        const { children: i, ...r } = e,
          o = H.Children.toArray(i),
          s = o.find(hWt);
        if (s) {
          const e = s.props.children,
            i = o.map((t) =>
              t === s
                ? H.Children.count(e) > 1
                  ? H.Children.only(null)
                  : H.isValidElement(e)
                    ? e.props.children
                    : null
                : t,
            );
          return Q.jsx(t, {
            ...r,
            ref: n,
            children: H.isValidElement(e) ? H.cloneElement(e, void 0, i) : null,
          });
        }
        return Q.jsx(t, { ...r, ref: n, children: i });
      });
    return ((n.displayName = `${e}.Slot`), n);
  })("SelectContent.RemoveScroll"),
  VWt = H.forwardRef((e, t) => {
    const {
        __scopeSelect: n,
        position: i = "item-aligned",
        onCloseAutoFocus: r,
        onEscapeKeyDown: o,
        onPointerDownOutside: s,
        side: a,
        sideOffset: l,
        align: c,
        alignOffset: d,
        arrowPadding: u,
        collisionBoundary: h,
        collisionPadding: g,
        sticky: p,
        hideWhenDetached: f,
        avoidCollisions: m,
        ..._
      } = e,
      v = SWt(MWt, n),
      [b, y] = H.useState(null),
      [x, w] = H.useState(null),
      C = Sp(t, (e) => y(e)),
      [S, k] = H.useState(null),
      [E, N] = H.useState(null),
      L = bWt(n),
      [D, T] = H.useState(!1),
      I = H.useRef(!1);
    (H.useEffect(() => {
      if (b) return b9e(b);
    }, [b]),
      w8e());
    const R = H.useCallback(
        (e) => {
          const [t, ...n] = L().map((e) => e.ref.current),
            [i] = n.slice(-1),
            r = document.activeElement;
          for (const o of e) {
            if (o === r) return;
            if (
              (o?.scrollIntoView({ block: "nearest" }),
              o === t && x && (x.scrollTop = 0),
              o === i && x && (x.scrollTop = x.scrollHeight),
              o?.focus(),
              document.activeElement !== r)
            )
              return;
          }
        },
        [L, x],
      ),
      O = H.useCallback(() => R([S, b]), [R, S, b]);
    H.useEffect(() => {
      D && O();
    }, [D, O]);
    const { onOpenChange: M, triggerPointerDownPosRef: A } = v;
    (H.useEffect(() => {
      if (b) {
        let e = { x: 0, y: 0 };
        const t = (t) => {
            e = {
              x: Math.abs(Math.round(t.pageX) - (A.current?.x ?? 0)),
              y: Math.abs(Math.round(t.pageY) - (A.current?.y ?? 0)),
            };
          },
          n = (n) => {
            (e.x <= 10 && e.y <= 10 ? n.preventDefault() : b.contains(n.target) || M(!1),
              document.removeEventListener("pointermove", t),
              (A.current = null));
          };
        return (
          null !== A.current &&
            (document.addEventListener("pointermove", t),
            document.addEventListener("pointerup", n, { capture: !0, once: !0 })),
          () => {
            (document.removeEventListener("pointermove", t),
              document.removeEventListener("pointerup", n, { capture: !0 }));
          }
        );
      }
    }, [b, M, A]),
      H.useEffect(() => {
        const e = () => M(!1);
        return (
          window.addEventListener("blur", e),
          window.addEventListener("resize", e),
          () => {
            (window.removeEventListener("blur", e), window.removeEventListener("resize", e));
          }
        );
      }, [M]));
    const [P, j] = mHt((e) => {
        const t = L().filter((e) => !e.disabled),
          n = t.find((e) => e.ref.current === document.activeElement),
          i = _Ht(t, e, n);
        i && setTimeout(() => i.ref.current.focus());
      }),
      F = H.useCallback(
        (e, t, n) => {
          const i = !I.current && !n;
          ((void 0 !== v.value && v.value === t) || i) && (k(e), i && (I.current = !0));
        },
        [v.value],
      ),
      B = H.useCallback(() => b?.focus(), [b]),
      V = H.useCallback(
        (e, t, n) => {
          const i = !I.current && !n;
          ((void 0 !== v.value && v.value === t) || i) && N(e);
        },
        [v.value],
      ),
      W = "popper" === i ? HWt : WWt,
      z =
        W === HWt
          ? {
              side: a,
              sideOffset: l,
              align: c,
              alignOffset: d,
              arrowPadding: u,
              collisionBoundary: h,
              collisionPadding: g,
              sticky: p,
              hideWhenDetached: f,
              avoidCollisions: m,
            }
          : {};
    return Q.jsx(jWt, {
      scope: n,
      content: b,
      viewport: x,
      onViewportChange: w,
      itemRefCallback: F,
      selectedItem: S,
      onItemLeave: B,
      itemTextRefCallback: V,
      focusSelectedItem: O,
      selectedItemText: E,
      position: i,
      isPositioned: D,
      searchRef: P,
      children: Q.jsx(h9e, {
        as: BWt,
        allowPinchZoom: !0,
        children: Q.jsx(g8e, {
          asChild: !0,
          trapped: v.open,
          onMountAutoFocus: (e) => {
            e.preventDefault();
          },
          onUnmountAutoFocus: Qy(r, (e) => {
            (v.trigger?.focus({ preventScroll: !0 }), e.preventDefault());
          }),
          children: Q.jsx(a8e, {
            asChild: !0,
            disableOutsidePointerEvents: !0,
            onEscapeKeyDown: o,
            onPointerDownOutside: s,
            onFocusOutside: (e) => e.preventDefault(),
            onDismiss: () => v.onOpenChange(!1),
            children: Q.jsx(W, {
              role: "listbox",
              id: v.contentId,
              "data-state": v.open ? "open" : "closed",
              dir: v.dir,
              onContextMenu: (e) => e.preventDefault(),
              ..._,
              ...z,
              onPlaced: () => T(!0),
              ref: C,
              style: { display: "flex", flexDirection: "column", outline: "none", ..._.style },
              onKeyDown: Qy(_.onKeyDown, (e) => {
                const t = e.ctrlKey || e.altKey || e.metaKey;
                if (
                  ("Tab" === e.key && e.preventDefault(),
                  t || 1 !== e.key.length || j(e.key),
                  ["ArrowUp", "ArrowDown", "Home", "End"].includes(e.key))
                ) {
                  let t = L()
                    .filter((e) => !e.disabled)
                    .map((e) => e.ref.current);
                  if (
                    (["ArrowUp", "End"].includes(e.key) && (t = t.slice().reverse()),
                    ["ArrowUp", "ArrowDown"].includes(e.key))
                  ) {
                    const n = e.target,
                      i = t.indexOf(n);
                    t = t.slice(i + 1);
                  }
                  (setTimeout(() => R(t)), e.preventDefault());
                }
              }),
            }),
          }),
        }),
      }),
    });
  });
VWt.displayName = "SelectContentImpl";
var WWt = H.forwardRef((e, t) => {
  const { __scopeSelect: n, onPlaced: i, ...r } = e,
    o = SWt(MWt, n),
    s = FWt(MWt, n),
    [a, l] = H.useState(null),
    [c, d] = H.useState(null),
    u = Sp(t, (e) => d(e)),
    h = bWt(n),
    g = H.useRef(!1),
    p = H.useRef(!0),
    { viewport: f, selectedItem: m, selectedItemText: _, focusSelectedItem: v } = s,
    b = H.useCallback(() => {
      if (o.trigger && o.valueNode && a && c && f && m && _) {
        const e = o.trigger.getBoundingClientRect(),
          t = c.getBoundingClientRect(),
          n = o.valueNode.getBoundingClientRect(),
          r = _.getBoundingClientRect();
        if ("rtl" !== o.dir) {
          const i = r.left - t.left,
            o = n.left - i,
            s = e.left - o,
            l = e.width + s,
            c = Math.max(l, t.width),
            d = window.innerWidth - PWt,
            u = cWt(o, [PWt, Math.max(PWt, d - c)]);
          ((a.style.minWidth = l + "px"), (a.style.left = u + "px"));
        } else {
          const i = t.right - r.right,
            o = window.innerWidth - n.right - i,
            s = window.innerWidth - e.right - o,
            l = e.width + s,
            c = Math.max(l, t.width),
            d = window.innerWidth - PWt,
            u = cWt(o, [PWt, Math.max(PWt, d - c)]);
          ((a.style.minWidth = l + "px"), (a.style.right = u + "px"));
        }
        const s = h(),
          l = window.innerHeight - 2 * PWt,
          d = f.scrollHeight,
          u = window.getComputedStyle(c),
          p = parseInt(u.borderTopWidth, 10),
          v = parseInt(u.paddingTop, 10),
          b = parseInt(u.borderBottomWidth, 10),
          y = p + v + d + parseInt(u.paddingBottom, 10) + b,
          x = Math.min(5 * m.offsetHeight, y),
          w = window.getComputedStyle(f),
          C = parseInt(w.paddingTop, 10),
          S = parseInt(w.paddingBottom, 10),
          k = e.top + e.height / 2 - PWt,
          E = l - k,
          N = m.offsetHeight / 2,
          L = p + v + (m.offsetTop + N),
          D = y - L;
        if (L <= k) {
          const e = s.length > 0 && m === s[s.length - 1].ref.current;
          a.style.bottom = "0px";
          const t = c.clientHeight - f.offsetTop - f.offsetHeight,
            n = L + Math.max(E, N + (e ? S : 0) + t + b);
          a.style.height = n + "px";
        } else {
          const e = s.length > 0 && m === s[0].ref.current;
          a.style.top = "0px";
          const t = Math.max(k, p + f.offsetTop + (e ? C : 0) + N) + D;
          ((a.style.height = t + "px"), (f.scrollTop = L - k + f.offsetTop));
        }
        ((a.style.margin = `${PWt}px 0`),
          (a.style.minHeight = x + "px"),
          (a.style.maxHeight = l + "px"),
          i?.(),
          requestAnimationFrame(() => (g.current = !0)));
      }
    }, [h, o.trigger, o.valueNode, a, c, f, m, _, o.dir, i]);
  sx(() => b(), [b]);
  const [y, x] = H.useState();
  sx(() => {
    c && x(window.getComputedStyle(c).zIndex);
  }, [c]);
  const w = H.useCallback(
    (e) => {
      e && !0 === p.current && (b(), v?.(), (p.current = !1));
    },
    [b, v],
  );
  return Q.jsx(zWt, {
    scope: n,
    contentWrapper: a,
    shouldExpandOnScrollRef: g,
    onScrollButtonChange: w,
    children: Q.jsx("div", {
      ref: l,
      style: { display: "flex", flexDirection: "column", position: "fixed", zIndex: y },
      children: Q.jsx(gx.div, {
        ...r,
        ref: u,
        style: { boxSizing: "border-box", maxHeight: "100%", ...r.style },
      }),
    }),
  });
});
WWt.displayName = "SelectItemAlignedPosition";
var HWt = H.forwardRef((e, t) => {
  const { __scopeSelect: n, align: i = "start", collisionPadding: r = PWt, ...o } = e,
    s = wWt(n);
  return Q.jsx(Eit, {
    ...s,
    ...o,
    ref: t,
    align: i,
    collisionPadding: r,
    style: {
      boxSizing: "border-box",
      ...o.style,
      "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-select-content-available-width": "var(--radix-popper-available-width)",
      "--radix-select-content-available-height": "var(--radix-popper-available-height)",
      "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-select-trigger-height": "var(--radix-popper-anchor-height)",
    },
  });
});
HWt.displayName = "SelectPopperPosition";
var [zWt, UWt] = xWt(MWt, {}),
  $Wt = "SelectViewport",
  qWt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, nonce: i, ...r } = e,
      o = FWt($Wt, n),
      s = UWt($Wt, n),
      a = Sp(t, o.onViewportChange),
      l = H.useRef(0);
    return Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx("style", {
          dangerouslySetInnerHTML: {
            __html:
              "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}",
          },
          nonce: i,
        }),
        Q.jsx(vWt.Slot, {
          scope: n,
          children: Q.jsx(gx.div, {
            "data-radix-select-viewport": "",
            role: "presentation",
            ...r,
            ref: a,
            style: { position: "relative", flex: 1, overflow: "hidden auto", ...r.style },
            onScroll: Qy(r.onScroll, (e) => {
              const t = e.currentTarget,
                { contentWrapper: n, shouldExpandOnScrollRef: i } = s;
              if (i?.current && n) {
                const e = Math.abs(l.current - t.scrollTop);
                if (e > 0) {
                  const i = window.innerHeight - 2 * PWt,
                    r = parseFloat(n.style.minHeight),
                    o = parseFloat(n.style.height),
                    s = Math.max(r, o);
                  if (s < i) {
                    const r = s + e,
                      o = Math.min(i, r),
                      a = r - o;
                    ((n.style.height = o + "px"),
                      "0px" === n.style.bottom &&
                        ((t.scrollTop = a > 0 ? a : 0), (n.style.justifyContent = "flex-end")));
                  }
                }
              }
              l.current = t.scrollTop;
            }),
          }),
        }),
      ],
    });
  });
qWt.displayName = $Wt;
var KWt = "SelectGroup",
  [GWt, ZWt] = xWt(KWt),
  YWt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, ...i } = e,
      r = cx();
    return Q.jsx(GWt, {
      scope: n,
      id: r,
      children: Q.jsx(gx.div, { role: "group", "aria-labelledby": r, ...i, ref: t }),
    });
  });
YWt.displayName = KWt;
var XWt = "SelectLabel",
  QWt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, ...i } = e,
      r = ZWt(XWt, n);
    return Q.jsx(gx.div, { id: r.id, ...i, ref: t });
  });
QWt.displayName = XWt;
var JWt = "SelectItem",
  [eHt, tHt] = xWt(JWt),
  nHt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, value: i, disabled: r = !1, textValue: o, ...s } = e,
      a = SWt(JWt, n),
      l = FWt(JWt, n),
      c = a.value === i,
      [d, u] = H.useState(o ?? ""),
      [h, g] = H.useState(!1),
      p = Sp(t, (e) => l.itemRefCallback?.(e, i, r)),
      f = cx(),
      m = H.useRef("touch"),
      _ = () => {
        r || (a.onValueChange(i), a.onOpenChange(!1));
      };
    if ("" === i)
      throw new Error(
        "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.",
      );
    return Q.jsx(eHt, {
      scope: n,
      value: i,
      disabled: r,
      textId: f,
      isSelected: c,
      onItemTextChange: H.useCallback((e) => {
        u((t) => t || (e?.textContent ?? "").trim());
      }, []),
      children: Q.jsx(vWt.ItemSlot, {
        scope: n,
        value: i,
        disabled: r,
        textValue: d,
        children: Q.jsx(gx.div, {
          role: "option",
          "aria-labelledby": f,
          "data-highlighted": h ? "" : void 0,
          "aria-selected": c && h,
          "data-state": c ? "checked" : "unchecked",
          "aria-disabled": r || void 0,
          "data-disabled": r ? "" : void 0,
          tabIndex: r ? void 0 : -1,
          ...s,
          ref: p,
          onFocus: Qy(s.onFocus, () => g(!0)),
          onBlur: Qy(s.onBlur, () => g(!1)),
          onClick: Qy(s.onClick, () => {
            "mouse" !== m.current && _();
          }),
          onPointerUp: Qy(s.onPointerUp, () => {
            "mouse" === m.current && _();
          }),
          onPointerDown: Qy(s.onPointerDown, (e) => {
            m.current = e.pointerType;
          }),
          onPointerMove: Qy(s.onPointerMove, (e) => {
            ((m.current = e.pointerType),
              r
                ? l.onItemLeave?.()
                : "mouse" === m.current && e.currentTarget.focus({ preventScroll: !0 }));
          }),
          onPointerLeave: Qy(s.onPointerLeave, (e) => {
            e.currentTarget === document.activeElement && l.onItemLeave?.();
          }),
          onKeyDown: Qy(s.onKeyDown, (e) => {
            ("" !== l.searchRef?.current && " " === e.key) ||
              (mWt.includes(e.key) && _(), " " === e.key && e.preventDefault());
          }),
        }),
      }),
    });
  });
nHt.displayName = JWt;
var iHt = "SelectItemText",
  rHt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, className: i, style: r, ...o } = e,
      s = SWt(iHt, n),
      a = FWt(iHt, n),
      l = tHt(iHt, n),
      c = EWt(iHt, n),
      [d, u] = H.useState(null),
      h = Sp(
        t,
        (e) => u(e),
        l.onItemTextChange,
        (e) => a.itemTextRefCallback?.(e, l.value, l.disabled),
      ),
      g = d?.textContent,
      p = H.useMemo(
        () => Q.jsx("option", { value: l.value, disabled: l.disabled, children: g }, l.value),
        [l.disabled, l.value, g],
      ),
      { onNativeOptionAdd: f, onNativeOptionRemove: m } = c;
    return (
      sx(() => (f(p), () => m(p)), [f, m, p]),
      Q.jsxs(Q.Fragment, {
        children: [
          Q.jsx(gx.span, { id: l.textId, ...o, ref: h }),
          l.isSelected && s.valueNode && !s.valueNodeHasChildren
            ? ru.createPortal(o.children, s.valueNode)
            : null,
        ],
      })
    );
  });
rHt.displayName = iHt;
var oHt = "SelectItemIndicator",
  sHt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, ...i } = e;
    return tHt(oHt, n).isSelected ? Q.jsx(gx.span, { "aria-hidden": !0, ...i, ref: t }) : null;
  });
sHt.displayName = oHt;
var aHt = "SelectScrollUpButton",
  lHt = H.forwardRef((e, t) => {
    const n = FWt(aHt, e.__scopeSelect),
      i = UWt(aHt, e.__scopeSelect),
      [r, o] = H.useState(!1),
      s = Sp(t, i.onScrollButtonChange);
    return (
      sx(() => {
        if (n.viewport && n.isPositioned) {
          let e = function () {
            const e = t.scrollTop > 0;
            o(e);
          };
          const t = n.viewport;
          return (e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e));
        }
      }, [n.viewport, n.isPositioned]),
      r
        ? Q.jsx(uHt, {
            ...e,
            ref: s,
            onAutoScroll: () => {
              const { viewport: e, selectedItem: t } = n;
              e && t && (e.scrollTop = e.scrollTop - t.offsetHeight);
            },
          })
        : null
    );
  });
lHt.displayName = aHt;
var cHt = "SelectScrollDownButton",
  dHt = H.forwardRef((e, t) => {
    const n = FWt(cHt, e.__scopeSelect),
      i = UWt(cHt, e.__scopeSelect),
      [r, o] = H.useState(!1),
      s = Sp(t, i.onScrollButtonChange);
    return (
      sx(() => {
        if (n.viewport && n.isPositioned) {
          let e = function () {
            const e = t.scrollHeight - t.clientHeight,
              n = Math.ceil(t.scrollTop) < e;
            o(n);
          };
          const t = n.viewport;
          return (e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e));
        }
      }, [n.viewport, n.isPositioned]),
      r
        ? Q.jsx(uHt, {
            ...e,
            ref: s,
            onAutoScroll: () => {
              const { viewport: e, selectedItem: t } = n;
              e && t && (e.scrollTop = e.scrollTop + t.offsetHeight);
            },
          })
        : null
    );
  });
dHt.displayName = cHt;
var uHt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, onAutoScroll: i, ...r } = e,
      o = FWt("SelectScrollButton", n),
      s = H.useRef(null),
      a = bWt(n),
      l = H.useCallback(() => {
        null !== s.current && (window.clearInterval(s.current), (s.current = null));
      }, []);
    return (
      H.useEffect(() => () => l(), [l]),
      sx(() => {
        const e = a().find((e) => e.ref.current === document.activeElement);
        e?.ref.current?.scrollIntoView({ block: "nearest" });
      }, [a]),
      Q.jsx(gx.div, {
        "aria-hidden": !0,
        ...r,
        ref: t,
        style: { flexShrink: 0, ...r.style },
        onPointerDown: Qy(r.onPointerDown, () => {
          null === s.current && (s.current = window.setInterval(i, 50));
        }),
        onPointerMove: Qy(r.onPointerMove, () => {
          (o.onItemLeave?.(), null === s.current && (s.current = window.setInterval(i, 50)));
        }),
        onPointerLeave: Qy(r.onPointerLeave, () => {
          l();
        }),
      })
    );
  }),
  hHt = H.forwardRef((e, t) => {
    const { __scopeSelect: n, ...i } = e;
    return Q.jsx(gx.div, { "aria-hidden": !0, ...i, ref: t });
  });
hHt.displayName = "SelectSeparator";
var gHt = "SelectArrow";
H.forwardRef((e, t) => {
  const { __scopeSelect: n, ...i } = e,
    r = wWt(n),
    o = SWt(gHt, n),
    s = FWt(gHt, n);
  return o.open && "popper" === s.position ? Q.jsx(Nit, { ...r, ...i, ref: t }) : null;
}).displayName = gHt;
var pHt = H.forwardRef(({ __scopeSelect: e, value: t, ...n }, i) => {
  const r = H.useRef(null),
    o = Sp(i, r),
    s = gWt(t);
  return (
    H.useEffect(() => {
      const e = r.current;
      if (!e) return;
      const n = window.HTMLSelectElement.prototype,
        i = Object.getOwnPropertyDescriptor(n, "value").set;
      if (s !== t && i) {
        const n = new Event("change", { bubbles: !0 });
        (i.call(e, t), e.dispatchEvent(n));
      }
    }, [s, t]),
    Q.jsx(gx.select, { ...n, style: { ...pWt, ...n.style }, ref: o, defaultValue: t })
  );
});
function fHt(e) {
  return "" === e || void 0 === e;
}
function mHt(e) {
  const t = fx(e),
    n = H.useRef(""),
    i = H.useRef(0),
    r = H.useCallback(
      (e) => {
        const r = n.current + e;
        (t(r),
          (function e(t) {
            ((n.current = t),
              window.clearTimeout(i.current),
              "" !== t && (i.current = window.setTimeout(() => e(""), 1e3)));
          })(r));
      },
      [t],
    ),
    o = H.useCallback(() => {
      ((n.current = ""), window.clearTimeout(i.current));
    }, []);
  return (H.useEffect(() => () => window.clearTimeout(i.current), []), [n, r, o]);
}
function _Ht(e, t, n) {
  const i = t.length > 1 && Array.from(t).every((e) => e === t[0]) ? t[0] : t,
    r = n ? e.indexOf(n) : -1;
  let o = (function (e, t) {
    return e.map((n, i) => e[(t + i) % e.length]);
  })(e, Math.max(r, 0));
  1 === i.length && (o = o.filter((e) => e !== n));
  const s = o.find((e) => e.textValue.toLowerCase().startsWith(i.toLowerCase()));
  return s !== n ? s : void 0;
}
pHt.displayName = "SelectBubbleInput";
var vHt = DWt,
  bHt = RWt,
  yHt = OWt,
  xHt = AWt,
  wHt = qWt,
  CHt = QWt,
  SHt = nHt,
  kHt = rHt,
  EHt = sHt,
  NHt = lHt,
  LHt = dHt,
  DHt = hHt;
const THt = NWt,
  IHt = YWt,
  RHt = IWt,
  OHt = H.forwardRef(({ className: e, children: t, ...n }, i) =>
    Q.jsxs(vHt, {
      ref: i,
      className: Rf(
        "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
        e,
      ),
      ...n,
      children: [
        t,
        Q.jsx(bHt, { asChild: !0, children: Q.jsx(m7e, { className: "h-4 w-4 opacity-50" }) }),
      ],
    }),
  );
OHt.displayName = vHt.displayName;
const MHt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(NHt, {
    ref: n,
    className: Rf("flex cursor-default items-center justify-center py-1", e),
    ...t,
    children: Q.jsx(w7e, { className: "h-4 w-4" }),
  }),
);
MHt.displayName = NHt.displayName;
const AHt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(LHt, {
    ref: n,
    className: Rf("flex cursor-default items-center justify-center py-1", e),
    ...t,
    children: Q.jsx(m7e, { className: "h-4 w-4" }),
  }),
);
AHt.displayName = LHt.displayName;
const PHt = H.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, r) =>
  Q.jsx(yHt, {
    children: Q.jsxs(xHt, {
      ref: r,
      className: Rf(
        "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
        "popper" === n &&
          "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
        e,
      ),
      position: n,
      ...i,
      children: [
        Q.jsx(MHt, {}),
        Q.jsx(wHt, {
          className: Rf(
            "p-1",
            "popper" === n &&
              "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
          ),
          children: t,
        }),
        Q.jsx(AHt, {}),
      ],
    }),
  }),
);
PHt.displayName = xHt.displayName;
const jHt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(CHt, { ref: n, className: Rf("px-2 py-1.5 text-sm font-semibold", e), ...t }),
);
jHt.displayName = CHt.displayName;
const FHt = H.forwardRef(({ className: e, children: t, ...n }, i) =>
  Q.jsxs(SHt, {
    ref: i,
    className: Rf(
      "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
      e,
    ),
    ...n,
    children: [
      Q.jsx("span", {
        className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center",
        children: Q.jsx(EHt, { children: Q.jsx(h7e, { className: "h-4 w-4" }) }),
      }),
      Q.jsx(kHt, { children: t }),
    ],
  }),
);
FHt.displayName = SHt.displayName;
const BHt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(DHt, { ref: n, className: Rf("-mx-1 my-1 h-px bg-muted", e), ...t }),
);
BHt.displayName = DHt.displayName;
const VHt = {
    lessThanXSeconds: { one: "不到 1 秒", other: "不到 {{count}} 秒" },
    xSeconds: { one: "1 秒", other: "{{count}} 秒" },
    halfAMinute: "半分钟",
    lessThanXMinutes: { one: "不到 1 分钟", other: "不到 {{count}} 分钟" },
    xMinutes: { one: "1 分钟", other: "{{count}} 分钟" },
    xHours: { one: "1 小时", other: "{{count}} 小时" },
    aboutXHours: { one: "大约 1 小时", other: "大约 {{count}} 小时" },
    xDays: { one: "1 天", other: "{{count}} 天" },
    aboutXWeeks: { one: "大约 1 个星期", other: "大约 {{count}} 个星期" },
    xWeeks: { one: "1 个星期", other: "{{count}} 个星期" },
    aboutXMonths: { one: "大约 1 个月", other: "大约 {{count}} 个月" },
    xMonths: { one: "1 个月", other: "{{count}} 个月" },
    aboutXYears: { one: "大约 1 年", other: "大约 {{count}} 年" },
    xYears: { one: "1 年", other: "{{count}} 年" },
    overXYears: { one: "超过 1 年", other: "超过 {{count}} 年" },
    almostXYears: { one: "将近 1 年", other: "将近 {{count}} 年" },
  },
  WHt = {
    date: AC({
      formats: {
        full: "y'年'M'月'd'日' EEEE",
        long: "y'年'M'月'd'日'",
        medium: "yyyy-MM-dd",
        short: "yy-MM-dd",
      },
      defaultWidth: "full",
    }),
    time: AC({
      formats: {
        full: "zzzz a h:mm:ss",
        long: "z a h:mm:ss",
        medium: "a h:mm:ss",
        short: "a h:mm",
      },
      defaultWidth: "full",
    }),
    dateTime: AC({
      formats: {
        full: "{{date}} {{time}}",
        long: "{{date}} {{time}}",
        medium: "{{date}} {{time}}",
        short: "{{date}} {{time}}",
      },
      defaultWidth: "full",
    }),
  };
function HHt(e, t, n) {
  const i = "eeee p";
  return (function (e, t, n) {
    const [i, r] = NC(n?.in, e, t);
    return +CC(i, n) === +CC(r, n);
  })(e, t, n)
    ? i
    : e.getTime() > t.getTime()
      ? "'下个'" + i
      : "'上个'" + i;
}
const zHt = {
    lastWeek: HHt,
    yesterday: "'昨天' p",
    today: "'今天' p",
    tomorrow: "'明天' p",
    nextWeek: HHt,
    other: "PP p",
  },
  UHt = {
    ordinalNumber: (e, t) => {
      const n = Number(e);
      switch (t?.unit) {
        case "date":
          return n.toString() + "日";
        case "hour":
          return n.toString() + "时";
        case "minute":
          return n.toString() + "分";
        case "second":
          return n.toString() + "秒";
        default:
          return "第 " + n.toString();
      }
    },
    era: FC({
      values: { narrow: ["前", "公元"], abbreviated: ["前", "公元"], wide: ["公元前", "公元"] },
      defaultWidth: "wide",
    }),
    quarter: FC({
      values: {
        narrow: ["1", "2", "3", "4"],
        abbreviated: ["第一季", "第二季", "第三季", "第四季"],
        wide: ["第一季度", "第二季度", "第三季度", "第四季度"],
      },
      defaultWidth: "wide",
      argumentCallback: (e) => e - 1,
    }),
    month: FC({
      values: {
        narrow: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],
        abbreviated: [
          "1月",
          "2月",
          "3月",
          "4月",
          "5月",
          "6月",
          "7月",
          "8月",
          "9月",
          "10月",
          "11月",
          "12月",
        ],
        wide: [
          "一月",
          "二月",
          "三月",
          "四月",
          "五月",
          "六月",
          "七月",
          "八月",
          "九月",
          "十月",
          "十一月",
          "十二月",
        ],
      },
      defaultWidth: "wide",
    }),
    day: FC({
      values: {
        narrow: ["日", "一", "二", "三", "四", "五", "六"],
        short: ["日", "一", "二", "三", "四", "五", "六"],
        abbreviated: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
        wide: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
      },
      defaultWidth: "wide",
    }),
    dayPeriod: FC({
      values: {
        narrow: {
          am: "上",
          pm: "下",
          midnight: "凌晨",
          noon: "午",
          morning: "早",
          afternoon: "下午",
          evening: "晚",
          night: "夜",
        },
        abbreviated: {
          am: "上午",
          pm: "下午",
          midnight: "凌晨",
          noon: "中午",
          morning: "早晨",
          afternoon: "中午",
          evening: "晚上",
          night: "夜间",
        },
        wide: {
          am: "上午",
          pm: "下午",
          midnight: "凌晨",
          noon: "中午",
          morning: "早晨",
          afternoon: "中午",
          evening: "晚上",
          night: "夜间",
        },
      },
      defaultWidth: "wide",
      formattingValues: {
        narrow: {
          am: "上",
          pm: "下",
          midnight: "凌晨",
          noon: "午",
          morning: "早",
          afternoon: "下午",
          evening: "晚",
          night: "夜",
        },
        abbreviated: {
          am: "上午",
          pm: "下午",
          midnight: "凌晨",
          noon: "中午",
          morning: "早晨",
          afternoon: "中午",
          evening: "晚上",
          night: "夜间",
        },
        wide: {
          am: "上午",
          pm: "下午",
          midnight: "凌晨",
          noon: "中午",
          morning: "早晨",
          afternoon: "中午",
          evening: "晚上",
          night: "夜间",
        },
      },
      defaultFormattingWidth: "wide",
    }),
  },
  $Ht = {
    ordinalNumber: WC({
      matchPattern: /^(第\s*)?\d+(日|时|分|秒)?/i,
      parsePattern: /\d+/i,
      valueCallback: (e) => parseInt(e, 10),
    }),
    era: VC({
      matchPatterns: { narrow: /^(前)/i, abbreviated: /^(前)/i, wide: /^(公元前|公元)/i },
      defaultMatchWidth: "wide",
      parsePatterns: { any: [/^(前)/i, /^(公元)/i] },
      defaultParseWidth: "any",
    }),
    quarter: VC({
      matchPatterns: {
        narrow: /^[1234]/i,
        abbreviated: /^第[一二三四]刻/i,
        wide: /^第[一二三四]刻钟/i,
      },
      defaultMatchWidth: "wide",
      parsePatterns: { any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i] },
      defaultParseWidth: "any",
      valueCallback: (e) => e + 1,
    }),
    month: VC({
      matchPatterns: {
        narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
        abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
        wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i,
      },
      defaultMatchWidth: "wide",
      parsePatterns: {
        narrow: [
          /^一/i,
          /^二/i,
          /^三/i,
          /^四/i,
          /^五/i,
          /^六/i,
          /^七/i,
          /^八/i,
          /^九/i,
          /^十(?!(一|二))/i,
          /^十一/i,
          /^十二/i,
        ],
        any: [
          /^一|1/i,
          /^二|2/i,
          /^三|3/i,
          /^四|4/i,
          /^五|5/i,
          /^六|6/i,
          /^七|7/i,
          /^八|8/i,
          /^九|9/i,
          /^十(?!(一|二))|10/i,
          /^十一|11/i,
          /^十二|12/i,
        ],
      },
      defaultParseWidth: "any",
    }),
    day: VC({
      matchPatterns: {
        narrow: /^[一二三四五六日]/i,
        short: /^[一二三四五六日]/i,
        abbreviated: /^周[一二三四五六日]/i,
        wide: /^星期[一二三四五六日]/i,
      },
      defaultMatchWidth: "wide",
      parsePatterns: { any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i] },
      defaultParseWidth: "any",
    }),
    dayPeriod: VC({
      matchPatterns: { any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i },
      defaultMatchWidth: "any",
      parsePatterns: {
        any: {
          am: /^上午?/i,
          pm: /^下午?/i,
          midnight: /^午夜/i,
          noon: /^[中正]午/i,
          morning: /^早上/i,
          afternoon: /^下午/i,
          evening: /^晚上?/i,
          night: /^凌晨/i,
        },
      },
      defaultParseWidth: "any",
    }),
  },
  qHt = {
    code: "zh-CN",
    formatDistance: (e, t, n) => {
      let i;
      const r = VHt[e];
      return (
        (i = "string" == typeof r ? r : 1 === t ? r.one : r.other.replace("{{count}}", String(t))),
        n?.addSuffix ? (n.comparison && n.comparison > 0 ? i + "内" : i + "前") : i
      );
    },
    formatLong: WHt,
    formatRelative: (e, t, n, i) => {
      const r = zHt[e];
      return "function" == typeof r ? r(t, n, i) : r;
    },
    localize: UHt,
    match: $Ht,
    options: { weekStartsOn: 1, firstWeekContainsDate: 4 },
  };
const KHt = {},
  GHt = {};
function ZHt(e, t) {
  try {
    const n = (KHt[e] ||= new Intl.DateTimeFormat("en-US", {
      timeZone: e,
      timeZoneName: "longOffset",
    }).format)(t).split("GMT")[1];
    return n in GHt ? GHt[n] : XHt(n, n.split(":"));
  } catch {
    if (e in GHt) return GHt[e];
    const t = e?.match(YHt);
    return t ? XHt(e, t.slice(1)) : NaN;
  }
}
const YHt = /([+-]\d\d):?(\d\d)?/;
function XHt(e, t) {
  const n = +(t[0] || 0),
    i = +(t[1] || 0),
    r = +(t[2] || 0) / 60;
  return (GHt[e] = 60 * n + i > 0 ? 60 * n + i + r : 60 * n - i - r);
}
class QHt extends Date {
  constructor(...e) {
    (super(),
      e.length > 1 && "string" == typeof e[e.length - 1] && (this.timeZone = e.pop()),
      (this.internal = new Date()),
      isNaN(ZHt(this.timeZone, this))
        ? this.setTime(NaN)
        : e.length
          ? "number" == typeof e[0] &&
            (1 === e.length || (2 === e.length && "number" != typeof e[1]))
            ? this.setTime(e[0])
            : "string" == typeof e[0]
              ? this.setTime(+new Date(e[0]))
              : e[0] instanceof Date
                ? this.setTime(+e[0])
                : (this.setTime(+new Date(...e)), tzt(this), ezt(this))
          : this.setTime(Date.now()));
  }
  static tz(e, ...t) {
    return t.length ? new QHt(...t, e) : new QHt(Date.now(), e);
  }
  withTimeZone(e) {
    return new QHt(+this, e);
  }
  getTimezoneOffset() {
    const e = -ZHt(this.timeZone, this);
    return e > 0 ? Math.floor(e) : Math.ceil(e);
  }
  setTime(e) {
    return (Date.prototype.setTime.apply(this, arguments), ezt(this), +this);
  }
  [Symbol.for("constructDateFrom")](e) {
    return new QHt(+new Date(e), this.timeZone);
  }
}
const JHt = /^(get|set)(?!UTC)/;
function ezt(e) {
  (e.internal.setTime(+e),
    e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(60 * -ZHt(e.timeZone, e))));
}
function tzt(e) {
  const t = ZHt(e.timeZone, e),
    n = t > 0 ? Math.floor(t) : Math.ceil(t),
    i = new Date(+e);
  i.setUTCHours(i.getUTCHours() - 1);
  const r = -new Date(+e).getTimezoneOffset(),
    o = r - -new Date(+i).getTimezoneOffset(),
    s = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
  o && s && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + o);
  const a = r - n;
  a && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + a);
  const l = new Date(+e);
  l.setUTCSeconds(0);
  const c = r > 0 ? l.getSeconds() : (l.getSeconds() - 60) % 60,
    d = Math.round(-60 * ZHt(e.timeZone, e)) % 60;
  (d || c) &&
    (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + d),
    Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + d + c));
  const u = ZHt(e.timeZone, e),
    h = u > 0 ? Math.floor(u) : Math.ceil(u),
    g = -new Date(+e).getTimezoneOffset() - h - a;
  if (h !== n && g) {
    Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + g);
    const t = ZHt(e.timeZone, e),
      n = h - (t > 0 ? Math.floor(t) : Math.ceil(t));
    n &&
      (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + n),
      Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + n));
  }
}
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
  if (!JHt.test(e)) return;
  const t = e.replace(JHt, "$1UTC");
  QHt.prototype[t] &&
    (e.startsWith("get")
      ? (QHt.prototype[e] = function () {
          return this.internal[t]();
        })
      : ((QHt.prototype[e] = function () {
          return (
            Date.prototype[t].apply(this.internal, arguments),
            (function (e) {
              (Date.prototype.setFullYear.call(
                e,
                e.internal.getUTCFullYear(),
                e.internal.getUTCMonth(),
                e.internal.getUTCDate(),
              ),
                Date.prototype.setHours.call(
                  e,
                  e.internal.getUTCHours(),
                  e.internal.getUTCMinutes(),
                  e.internal.getUTCSeconds(),
                  e.internal.getUTCMilliseconds(),
                ),
                tzt(e));
            })(this),
            +this
          );
        }),
        (QHt.prototype[t] = function () {
          return (Date.prototype[t].apply(this, arguments), ezt(this), +this);
        })));
});
class nzt extends QHt {
  static tz(e, ...t) {
    return t.length ? new nzt(...t, e) : new nzt(Date.now(), e);
  }
  toISOString() {
    const [e, t, n] = this.tzComponents(),
      i = `${e}${t}:${n}`;
    return this.internal.toISOString().slice(0, -1) + i;
  }
  toString() {
    return `${this.toDateString()} ${this.toTimeString()}`;
  }
  toDateString() {
    const [e, t, n, i] = this.internal.toUTCString().split(" ");
    return `${e?.slice(0, -1)} ${n} ${t} ${i}`;
  }
  toTimeString() {
    const e = this.internal.toUTCString().split(" ")[4],
      [t, n, i] = this.tzComponents();
    return `${e} GMT${t}${n}${i} (${(function (e, t, n = "long") {
      return new Intl.DateTimeFormat("en-US", { hour: "numeric", timeZone: e, timeZoneName: n })
        .format(t)
        .split(/\s/g)
        .slice(2)
        .join(" ");
    })(this.timeZone, this)})`;
  }
  toLocaleString(e, t) {
    return Date.prototype.toLocaleString.call(this, e, {
      ...t,
      timeZone: t?.timeZone || this.timeZone,
    });
  }
  toLocaleDateString(e, t) {
    return Date.prototype.toLocaleDateString.call(this, e, {
      ...t,
      timeZone: t?.timeZone || this.timeZone,
    });
  }
  toLocaleTimeString(e, t) {
    return Date.prototype.toLocaleTimeString.call(this, e, {
      ...t,
      timeZone: t?.timeZone || this.timeZone,
    });
  }
  tzComponents() {
    const e = this.getTimezoneOffset();
    return [
      e > 0 ? "-" : "+",
      String(Math.floor(Math.abs(e) / 60)).padStart(2, "0"),
      String(Math.abs(e) % 60).padStart(2, "0"),
    ];
  }
  withTimeZone(e) {
    return new nzt(+this, e);
  }
  [Symbol.for("constructDateFrom")](e) {
    return new nzt(+new Date(e), this.timeZone);
  }
}
function izt(e, t) {
  const n = t.startOfMonth(e),
    i = n.getDay();
  return 1 === i ? n : 0 === i ? t.addDays(n, -6) : t.addDays(n, -1 * (i - 1));
}
const rzt = {
  ...zC,
  labels: {
    labelDayButton: (e, t, n, i) => {
      let r;
      r =
        i && "function" == typeof i.format
          ? i.format.bind(i)
          : (e, t) => mS(e, t, { locale: zC, ...n });
      let o = r(e, "PPPP");
      return (t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o);
    },
    labelMonthDropdown: "Choose the Month",
    labelNext: "Go to the Next Month",
    labelPrevious: "Go to the Previous Month",
    labelWeekNumber: (e) => `Week ${e}`,
    labelYearDropdown: "Choose the Year",
    labelGrid: (e, t, n) => {
      let i;
      return (
        (i =
          n && "function" == typeof n.format
            ? n.format.bind(n)
            : (e, n) => mS(e, n, { locale: zC, ...t })),
        i(e, "LLLL yyyy")
      );
    },
    labelGridcell: (e, t, n, i) => {
      let r;
      r =
        i && "function" == typeof i.format
          ? i.format.bind(i)
          : (e, t) => mS(e, t, { locale: zC, ...n });
      let o = r(e, "PPPP");
      return (t?.today && (o = `Today, ${o}`), o);
    },
    labelNav: "Navigation bar",
    labelWeekNumberHeader: "Week Number",
    labelWeekday: (e, t, n) => {
      let i;
      return (
        (i =
          n && "function" == typeof n.format
            ? n.format.bind(n)
            : (e, n) => mS(e, n, { locale: zC, ...t })),
        i(e, "cccc")
      );
    },
  },
};
class ozt {
  constructor(e, t) {
    ((this.Date = Date),
      (this.today = () =>
        this.overrides?.today
          ? this.overrides.today()
          : this.options.timeZone
            ? nzt.tz(this.options.timeZone)
            : new this.Date()),
      (this.newDate = (e, t, n) =>
        this.overrides?.newDate
          ? this.overrides.newDate(e, t, n)
          : this.options.timeZone
            ? new nzt(e, t, n, this.options.timeZone)
            : new Date(e, t, n)),
      (this.addDays = (e, t) =>
        this.overrides?.addDays ? this.overrides.addDays(e, t) : bC(e, t)),
      (this.addMonths = (e, t) =>
        this.overrides?.addMonths ? this.overrides.addMonths(e, t) : yC(e, t)),
      (this.addWeeks = (e, t) =>
        this.overrides?.addWeeks
          ? this.overrides.addWeeks(e, t)
          : (function (e, t, n) {
              return bC(e, 7 * t, n);
            })(e, t)),
      (this.addYears = (e, t) =>
        this.overrides?.addYears
          ? this.overrides.addYears(e, t)
          : (function (e, t, n) {
              return yC(e, 12 * t, n);
            })(e, t)),
      (this.differenceInCalendarDays = (e, t) =>
        this.overrides?.differenceInCalendarDays
          ? this.overrides.differenceInCalendarDays(e, t)
          : DC(e, t)),
      (this.differenceInCalendarMonths = (e, t) =>
        this.overrides?.differenceInCalendarMonths
          ? this.overrides.differenceInCalendarMonths(e, t)
          : (function (e, t, n) {
              const [i, r] = NC(n?.in, e, t);
              return 12 * (i.getFullYear() - r.getFullYear()) + (i.getMonth() - r.getMonth());
            })(e, t)),
      (this.eachMonthOfInterval = (e) =>
        this.overrides?.eachMonthOfInterval
          ? this.overrides.eachMonthOfInterval(e)
          : (function (e, t) {
              const { start: n, end: i } = IC(t?.in, e);
              let r = +n > +i;
              const o = r ? +n : +i,
                s = r ? i : n;
              (s.setHours(0, 0, 0, 0), s.setDate(1));
              const a = [];
              for (; +s <= o; ) (a.push(_C(n, s)), s.setMonth(s.getMonth() + 1));
              return r ? a.reverse() : a;
            })(e)),
      (this.eachYearOfInterval = (e) => {
        const t = this.overrides?.eachYearOfInterval
            ? this.overrides.eachYearOfInterval(e)
            : (function (e, t) {
                const { start: n, end: i } = IC(t?.in, e);
                let r = +n > +i;
                const o = r ? +n : +i,
                  s = r ? i : n;
                (s.setHours(0, 0, 0, 0), s.setMonth(0, 1));
                const a = [];
                for (; +s <= o; ) (a.push(_C(n, s)), s.setFullYear(s.getFullYear() + 1));
                return r ? a.reverse() : a;
              })(e),
          n = new Set(t.map((e) => this.getYear(e)));
        if (n.size === t.length) return t;
        const i = [];
        return (
          n.forEach((e) => {
            i.push(new Date(e, 0, 1));
          }),
          i
        );
      }),
      (this.endOfBroadcastWeek = (e) =>
        this.overrides?.endOfBroadcastWeek
          ? this.overrides.endOfBroadcastWeek(e)
          : (function (e, t) {
              const n = izt(e, t),
                i = (function (e, t) {
                  const n = t.startOfMonth(e),
                    i = n.getDay() > 0 ? n.getDay() : 7,
                    r = t.addDays(e, 1 - i),
                    o = t.addDays(r, 34);
                  return t.getMonth(e) === t.getMonth(o) ? 5 : 4;
                })(e, t);
              return t.addDays(n, 7 * i - 1);
            })(e, this)),
      (this.endOfISOWeek = (e) =>
        this.overrides?.endOfISOWeek
          ? this.overrides.endOfISOWeek(e)
          : (function (e, t) {
              return OC(e, { ...t, weekStartsOn: 1 });
            })(e)),
      (this.endOfMonth = (e) =>
        this.overrides?.endOfMonth
          ? this.overrides.endOfMonth(e)
          : (function (e, t) {
              const n = vC(e, t?.in),
                i = n.getMonth();
              return (n.setFullYear(n.getFullYear(), i + 1, 0), n.setHours(23, 59, 59, 999), n);
            })(e)),
      (this.endOfWeek = (e, t) =>
        this.overrides?.endOfWeek ? this.overrides.endOfWeek(e, t) : OC(e, this.options)),
      (this.endOfYear = (e) =>
        this.overrides?.endOfYear
          ? this.overrides.endOfYear(e)
          : (function (e, t) {
              const n = vC(e, t?.in),
                i = n.getFullYear();
              return (n.setFullYear(i + 1, 0, 0), n.setHours(23, 59, 59, 999), n);
            })(e)),
      (this.format = (e, t, n) => {
        const i = this.overrides?.format
          ? this.overrides.format(e, t, this.options)
          : mS(e, t, this.options);
        return this.options.numerals && "latn" !== this.options.numerals
          ? this.replaceDigits(i)
          : i;
      }),
      (this.getISOWeek = (e) =>
        this.overrides?.getISOWeek ? this.overrides.getISOWeek(e) : UC(e)),
      (this.getMonth = (e, t) =>
        this.overrides?.getMonth
          ? this.overrides.getMonth(e, this.options)
          : (function (e, t) {
              return vC(e, t?.in).getMonth();
            })(e, this.options)),
      (this.getYear = (e, t) =>
        this.overrides?.getYear
          ? this.overrides.getYear(e, this.options)
          : (function (e, t) {
              return vC(e, t?.in).getFullYear();
            })(e, this.options)),
      (this.getWeek = (e, t) =>
        this.overrides?.getWeek ? this.overrides.getWeek(e, this.options) : qC(e, this.options)),
      (this.isAfter = (e, t) =>
        this.overrides?.isAfter
          ? this.overrides.isAfter(e, t)
          : (function (e, t) {
              return +vC(e) > +vC(t);
            })(e, t)),
      (this.isBefore = (e, t) =>
        this.overrides?.isBefore
          ? this.overrides.isBefore(e, t)
          : (function (e, t) {
              return +vC(e) < +vC(t);
            })(e, t)),
      (this.isDate = (e) => (this.overrides?.isDate ? this.overrides.isDate(e) : TC(e))),
      (this.isSameDay = (e, t) =>
        this.overrides?.isSameDay
          ? this.overrides.isSameDay(e, t)
          : (function (e, t, n) {
              const [i, r] = NC(n?.in, e, t);
              return +LC(i) === +LC(r);
            })(e, t)),
      (this.isSameMonth = (e, t) =>
        this.overrides?.isSameMonth
          ? this.overrides.isSameMonth(e, t)
          : (function (e, t, n) {
              const [i, r] = NC(n?.in, e, t);
              return i.getFullYear() === r.getFullYear() && i.getMonth() === r.getMonth();
            })(e, t)),
      (this.isSameYear = (e, t) =>
        this.overrides?.isSameYear
          ? this.overrides.isSameYear(e, t)
          : (function (e, t, n) {
              const [i, r] = NC(n?.in, e, t);
              return i.getFullYear() === r.getFullYear();
            })(e, t)),
      (this.max = (e) =>
        this.overrides?.max
          ? this.overrides.max(e)
          : (function (e, t) {
              let n,
                i = t?.in;
              return (
                e.forEach((e) => {
                  i || "object" != typeof e || (i = _C.bind(null, e));
                  const t = vC(e, i);
                  (!n || n < t || isNaN(+t)) && (n = t);
                }),
                _C(i, n || NaN)
              );
            })(e)),
      (this.min = (e) =>
        this.overrides?.min
          ? this.overrides.min(e)
          : (function (e, t) {
              let n,
                i = t?.in;
              return (
                e.forEach((e) => {
                  i || "object" != typeof e || (i = _C.bind(null, e));
                  const t = vC(e, i);
                  (!n || n > t || isNaN(+t)) && (n = t);
                }),
                _C(i, n || NaN)
              );
            })(e)),
      (this.setMonth = (e, t) =>
        this.overrides?.setMonth ? this.overrides.setMonth(e, t) : bS(e, t)),
      (this.setYear = (e, t) =>
        this.overrides?.setYear
          ? this.overrides.setYear(e, t)
          : (function (e, t, n) {
              const i = vC(e, n?.in);
              return isNaN(+i) ? _C(e, NaN) : (i.setFullYear(t), i);
            })(e, t)),
      (this.startOfBroadcastWeek = (e, t) =>
        this.overrides?.startOfBroadcastWeek
          ? this.overrides.startOfBroadcastWeek(e, this)
          : izt(e, this)),
      (this.startOfDay = (e) =>
        this.overrides?.startOfDay ? this.overrides.startOfDay(e) : LC(e)),
      (this.startOfISOWeek = (e) =>
        this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(e) : SC(e)),
      (this.startOfMonth = (e) =>
        this.overrides?.startOfMonth
          ? this.overrides.startOfMonth(e)
          : (function (e, t) {
              const n = vC(e, t?.in);
              return (n.setDate(1), n.setHours(0, 0, 0, 0), n);
            })(e)),
      (this.startOfWeek = (e, t) =>
        this.overrides?.startOfWeek
          ? this.overrides.startOfWeek(e, this.options)
          : CC(e, this.options)),
      (this.startOfYear = (e) =>
        this.overrides?.startOfYear ? this.overrides.startOfYear(e) : RC(e)),
      (this.options = { locale: rzt, ...e }),
      (this.overrides = t));
  }
  getDigitMap() {
    const { numerals: e = "latn" } = this.options,
      t = new Intl.NumberFormat("en-US", { numberingSystem: e }),
      n = {};
    for (let i = 0; i < 10; i++) n[i.toString()] = t.format(i);
    return n;
  }
  replaceDigits(e) {
    const t = this.getDigitMap();
    return e.replace(/\d/g, (e) => t[e] || e);
  }
  formatNumber(e) {
    return this.replaceDigits(e.toString());
  }
  getMonthYearOrder() {
    const e = this.options.locale?.code;
    return e && ozt.yearFirstLocales.has(e) ? "year-first" : "month-first";
  }
  formatMonthYear(e) {
    const { locale: t, timeZone: n, numerals: i } = this.options,
      r = t?.code;
    if (r && ozt.yearFirstLocales.has(r))
      try {
        const t = new Intl.DateTimeFormat(r, {
          month: "long",
          year: "numeric",
          timeZone: n,
          numberingSystem: i,
        });
        return t.format(e);
      } catch {}
    const o = "year-first" === this.getMonthYearOrder() ? "y LLLL" : "LLLL y";
    return this.format(e, o);
  }
}
ozt.yearFirstLocales = new Set([
  "eu",
  "hu",
  "ja",
  "ja-Hira",
  "ja-JP",
  "ko",
  "ko-KR",
  "lt",
  "lt-LT",
  "lv",
  "lv-LV",
  "mn",
  "mn-MN",
  "zh",
  "zh-CN",
  "zh-HK",
  "zh-TW",
]);
const szt = new ozt();
class azt {
  constructor(e, t, n = szt) {
    ((this.date = e),
      (this.displayMonth = t),
      (this.outside = Boolean(t && !n.isSameMonth(e, t))),
      (this.dateLib = n),
      (this.isoDate = n.format(e, "yyyy-MM-dd")),
      (this.displayMonthId = n.format(t, "yyyy-MM")),
      (this.dateMonthId = n.format(e, "yyyy-MM")));
  }
  isEqualTo(e) {
    return (
      this.dateLib.isSameDay(e.date, this.date) &&
      this.dateLib.isSameMonth(e.displayMonth, this.displayMonth)
    );
  }
}
class lzt {
  constructor(e, t) {
    ((this.date = e), (this.weeks = t));
  }
}
class czt {
  constructor(e, t) {
    ((this.days = t), (this.weekNumber = e));
  }
}
var dzt, uzt, hzt, gzt;
(!(function (e) {
  ((e.Root = "root"),
    (e.Chevron = "chevron"),
    (e.Day = "day"),
    (e.DayButton = "day_button"),
    (e.CaptionLabel = "caption_label"),
    (e.Dropdowns = "dropdowns"),
    (e.Dropdown = "dropdown"),
    (e.DropdownRoot = "dropdown_root"),
    (e.Footer = "footer"),
    (e.MonthGrid = "month_grid"),
    (e.MonthCaption = "month_caption"),
    (e.MonthsDropdown = "months_dropdown"),
    (e.Month = "month"),
    (e.Months = "months"),
    (e.Nav = "nav"),
    (e.NextMonthButton = "button_next"),
    (e.PreviousMonthButton = "button_previous"),
    (e.Week = "week"),
    (e.Weeks = "weeks"),
    (e.Weekday = "weekday"),
    (e.Weekdays = "weekdays"),
    (e.WeekNumber = "week_number"),
    (e.WeekNumberHeader = "week_number_header"),
    (e.YearsDropdown = "years_dropdown"));
})(dzt || (dzt = {})),
  (function (e) {
    ((e.disabled = "disabled"),
      (e.hidden = "hidden"),
      (e.outside = "outside"),
      (e.focused = "focused"),
      (e.today = "today"));
  })(uzt || (uzt = {})),
  (function (e) {
    ((e.range_end = "range_end"),
      (e.range_middle = "range_middle"),
      (e.range_start = "range_start"),
      (e.selected = "selected"));
  })(hzt || (hzt = {})),
  (function (e) {
    ((e.weeks_before_enter = "weeks_before_enter"),
      (e.weeks_before_exit = "weeks_before_exit"),
      (e.weeks_after_enter = "weeks_after_enter"),
      (e.weeks_after_exit = "weeks_after_exit"),
      (e.caption_after_enter = "caption_after_enter"),
      (e.caption_after_exit = "caption_after_exit"),
      (e.caption_before_enter = "caption_before_enter"),
      (e.caption_before_exit = "caption_before_exit"));
  })(gzt || (gzt = {})));
const pzt = H.createContext(void 0);
function fzt() {
  const e = H.useContext(pzt);
  if (void 0 === e) throw new Error("useDayPicker() must be used within a custom component.");
  return e;
}
const mzt = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      Button: function (e) {
        return z.createElement("button", { ...e });
      },
      CaptionLabel: function (e) {
        return z.createElement("span", { ...e });
      },
      Chevron: function (e) {
        const { size: t = 24, orientation: n = "left", className: i } = e;
        return z.createElement(
          "svg",
          { className: i, width: t, height: t, viewBox: "0 0 24 24" },
          "up" === n &&
            z.createElement("polygon", {
              points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28",
            }),
          "down" === n &&
            z.createElement("polygon", {
              points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72",
            }),
          "left" === n &&
            z.createElement("polygon", {
              points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20",
            }),
          "right" === n &&
            z.createElement("polygon", {
              points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20",
            }),
        );
      },
      Day: function (e) {
        const { day: t, modifiers: n, ...i } = e;
        return z.createElement("td", { ...i });
      },
      DayButton: function (e) {
        const { day: t, modifiers: n, ...i } = e,
          r = z.useRef(null);
        return (
          z.useEffect(() => {
            n.focused && r.current?.focus();
          }, [n.focused]),
          z.createElement("button", { ref: r, ...i })
        );
      },
      Dropdown: function (e) {
        const { options: t, className: n, components: i, classNames: r, ...o } = e,
          s = [r[dzt.Dropdown], n].join(" "),
          a = t?.find(({ value: e }) => e === o.value);
        return z.createElement(
          "span",
          { "data-disabled": o.disabled, className: r[dzt.DropdownRoot] },
          z.createElement(
            i.Select,
            { className: s, ...o },
            t?.map(({ value: e, label: t, disabled: n }) =>
              z.createElement(i.Option, { key: e, value: e, disabled: n }, t),
            ),
          ),
          z.createElement(
            "span",
            { className: r[dzt.CaptionLabel], "aria-hidden": !0 },
            a?.label,
            z.createElement(i.Chevron, {
              orientation: "down",
              size: 18,
              className: r[dzt.Chevron],
            }),
          ),
        );
      },
      DropdownNav: function (e) {
        return z.createElement("div", { ...e });
      },
      Footer: function (e) {
        return z.createElement("div", { ...e });
      },
      Month: function (e) {
        const { calendarMonth: t, displayIndex: n, ...i } = e;
        return z.createElement("div", { ...i }, e.children);
      },
      MonthCaption: function (e) {
        const { calendarMonth: t, displayIndex: n, ...i } = e;
        return z.createElement("div", { ...i });
      },
      MonthGrid: function (e) {
        return z.createElement("table", { ...e });
      },
      Months: function (e) {
        return z.createElement("div", { ...e });
      },
      MonthsDropdown: function (e) {
        const { components: t } = fzt();
        return z.createElement(t.Dropdown, { ...e });
      },
      Nav: function (e) {
        const { onPreviousClick: t, onNextClick: n, previousMonth: i, nextMonth: r, ...o } = e,
          {
            components: s,
            classNames: a,
            labels: { labelPrevious: l, labelNext: c },
          } = fzt(),
          d = H.useCallback(
            (e) => {
              r && n?.(e);
            },
            [r, n],
          ),
          u = H.useCallback(
            (e) => {
              i && t?.(e);
            },
            [i, t],
          );
        return z.createElement(
          "nav",
          { ...o },
          z.createElement(
            s.PreviousMonthButton,
            {
              type: "button",
              className: a[dzt.PreviousMonthButton],
              tabIndex: i ? void 0 : -1,
              "aria-disabled": !i || void 0,
              "aria-label": l(i),
              onClick: u,
            },
            z.createElement(s.Chevron, {
              disabled: !i || void 0,
              className: a[dzt.Chevron],
              orientation: "left",
            }),
          ),
          z.createElement(
            s.NextMonthButton,
            {
              type: "button",
              className: a[dzt.NextMonthButton],
              tabIndex: r ? void 0 : -1,
              "aria-disabled": !r || void 0,
              "aria-label": c(r),
              onClick: d,
            },
            z.createElement(s.Chevron, {
              disabled: !r || void 0,
              orientation: "right",
              className: a[dzt.Chevron],
            }),
          ),
        );
      },
      NextMonthButton: function (e) {
        const { components: t } = fzt();
        return z.createElement(t.Button, { ...e });
      },
      Option: function (e) {
        return z.createElement("option", { ...e });
      },
      PreviousMonthButton: function (e) {
        const { components: t } = fzt();
        return z.createElement(t.Button, { ...e });
      },
      Root: function (e) {
        const { rootRef: t, ...n } = e;
        return z.createElement("div", { ...n, ref: t });
      },
      Select: function (e) {
        return z.createElement("select", { ...e });
      },
      Week: function (e) {
        const { week: t, ...n } = e;
        return z.createElement("tr", { ...n });
      },
      WeekNumber: function (e) {
        const { week: t, ...n } = e;
        return z.createElement("th", { ...n });
      },
      WeekNumberHeader: function (e) {
        return z.createElement("th", { ...e });
      },
      Weekday: function (e) {
        return z.createElement("th", { ...e });
      },
      Weekdays: function (e) {
        return z.createElement("thead", { "aria-hidden": !0 }, z.createElement("tr", { ...e }));
      },
      Weeks: function (e) {
        return z.createElement("tbody", { ...e });
      },
      YearsDropdown: function (e) {
        const { components: t } = fzt();
        return z.createElement(t.Dropdown, { ...e });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
function _zt(e, t, n = !1, i = szt) {
  let { from: r, to: o } = e;
  const { differenceInCalendarDays: s, isSameDay: a } = i;
  if (r && o) {
    s(o, r) < 0 && ([r, o] = [o, r]);
    return s(t, r) >= (n ? 1 : 0) && s(o, t) >= (n ? 1 : 0);
  }
  return !n && o ? a(o, t) : !(n || !r) && a(r, t);
}
function vzt(e) {
  return Boolean(e && "object" == typeof e && "before" in e && "after" in e);
}
function bzt(e) {
  return Boolean(e && "object" == typeof e && "from" in e);
}
function yzt(e) {
  return Boolean(e && "object" == typeof e && "after" in e);
}
function xzt(e) {
  return Boolean(e && "object" == typeof e && "before" in e);
}
function wzt(e) {
  return Boolean(e && "object" == typeof e && "dayOfWeek" in e);
}
function Czt(e, t) {
  return Array.isArray(e) && e.every(t.isDate);
}
function Szt(e, t, n = szt) {
  const i = Array.isArray(t) ? t : [t],
    { isSameDay: r, differenceInCalendarDays: o, isAfter: s } = n;
  return i.some((t) => {
    if ("boolean" == typeof t) return t;
    if (n.isDate(t)) return r(e, t);
    if (Czt(t, n)) return t.some((t) => r(e, t));
    if (bzt(t)) return _zt(t, e, !1, n);
    if (wzt(t))
      return Array.isArray(t.dayOfWeek)
        ? t.dayOfWeek.includes(e.getDay())
        : t.dayOfWeek === e.getDay();
    if (vzt(t)) {
      const n = o(t.before, e) > 0,
        i = o(t.after, e) < 0;
      return s(t.before, t.after) ? i && n : n || i;
    }
    return yzt(t)
      ? o(e, t.after) > 0
      : xzt(t)
        ? o(t.before, e) > 0
        : "function" == typeof t && t(e);
  });
}
function kzt(e) {
  return { ...mzt, ...e };
}
function Ezt() {
  const e = {};
  for (const t in dzt) e[dzt[t]] = `rdp-${dzt[t]}`;
  for (const t in uzt) e[uzt[t]] = `rdp-${uzt[t]}`;
  for (const t in hzt) e[hzt[t]] = `rdp-${hzt[t]}`;
  for (const t in gzt) e[gzt[t]] = `rdp-${gzt[t]}`;
  return e;
}
function Nzt(e, t, n) {
  return (n ?? new ozt(t)).formatMonthYear(e);
}
const Lzt = Nzt;
function Dzt(e, t = szt) {
  return t.format(e, "yyyy");
}
const Tzt = Dzt,
  Izt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        formatCaption: Nzt,
        formatDay: function (e, t, n) {
          return (n ?? new ozt(t)).format(e, "d");
        },
        formatMonthCaption: Lzt,
        formatMonthDropdown: function (e, t = szt) {
          return t.format(e, "LLLL");
        },
        formatWeekNumber: function (e, t = szt) {
          return e < 10
            ? t.formatNumber(`0${e.toLocaleString()}`)
            : t.formatNumber(`${e.toLocaleString()}`);
        },
        formatWeekNumberHeader: function () {
          return "";
        },
        formatWeekdayName: function (e, t, n) {
          return (n ?? new ozt(t)).format(e, "cccccc");
        },
        formatYearCaption: Tzt,
        formatYearDropdown: Dzt,
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  );
function Rzt(e, t, n, i) {
  let r = (i ?? new ozt(n)).format(e, "PPPP");
  return (t.today && (r = `Today, ${r}`), t.selected && (r = `${r}, selected`), r);
}
const Ozt = Rzt;
function Mzt(e, t, n) {
  return (n ?? new ozt(t)).formatMonthYear(e);
}
const Azt = Mzt;
function Pzt(e, t, n, i) {
  let r = (i ?? new ozt(n)).format(e, "PPPP");
  return (t?.today && (r = `Today, ${r}`), r);
}
function jzt(e) {
  return "Choose the Month";
}
function Fzt() {
  return "";
}
function Bzt(e, t) {
  return "Go to the Next Month";
}
function Vzt(e) {
  return "Go to the Previous Month";
}
function Wzt(e, t, n) {
  return (n ?? new ozt(t)).format(e, "cccc");
}
function Hzt(e, t) {
  return `Week ${e}`;
}
function zzt(e) {
  return "Week Number";
}
function Uzt(e) {
  return "Choose the Year";
}
const $zt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        labelCaption: Azt,
        labelDay: Ozt,
        labelDayButton: Rzt,
        labelGrid: Mzt,
        labelGridcell: Pzt,
        labelMonthDropdown: jzt,
        labelNav: Fzt,
        labelNext: Bzt,
        labelPrevious: Vzt,
        labelWeekNumber: Hzt,
        labelWeekNumberHeader: zzt,
        labelWeekday: Wzt,
        labelYearDropdown: Uzt,
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  qzt = (e, t, n) => t || (n ? ("function" == typeof n ? n : (...e) => n) : e);
function Kzt(e, t) {
  const n = t.locale?.labels ?? {};
  return {
    ...$zt,
    ...(e ?? {}),
    labelDayButton: qzt(Rzt, e?.labelDayButton, n.labelDayButton),
    labelMonthDropdown: qzt(jzt, e?.labelMonthDropdown, n.labelMonthDropdown),
    labelNext: qzt(Bzt, e?.labelNext, n.labelNext),
    labelPrevious: qzt(Vzt, e?.labelPrevious, n.labelPrevious),
    labelWeekNumber: qzt(Hzt, e?.labelWeekNumber, n.labelWeekNumber),
    labelYearDropdown: qzt(Uzt, e?.labelYearDropdown, n.labelYearDropdown),
    labelGrid: qzt(Mzt, e?.labelGrid, n.labelGrid),
    labelGridcell: qzt(Pzt, e?.labelGridcell, n.labelGridcell),
    labelNav: qzt(Fzt, e?.labelNav, n.labelNav),
    labelWeekNumberHeader: qzt(zzt, e?.labelWeekNumberHeader, n.labelWeekNumberHeader),
    labelWeekday: qzt(Wzt, e?.labelWeekday, n.labelWeekday),
  };
}
function Gzt(e, t, n, i, r) {
  const { startOfMonth: o, startOfYear: s, endOfYear: a, eachMonthOfInterval: l, getMonth: c } = r;
  return l({ start: s(e), end: a(e) }).map((e) => {
    const s = i.formatMonthDropdown(e, r);
    return { value: c(e), label: s, disabled: (t && e < o(t)) || (n && e > o(n)) || !1 };
  });
}
function Zzt(e, t, n, i, r = !1) {
  if (!e) return;
  if (!t) return;
  const { startOfYear: o, endOfYear: s, eachYearOfInterval: a, getYear: l } = i,
    c = a({ start: o(e), end: s(t) });
  return (
    r && c.reverse(),
    c.map((e) => {
      const t = n.formatYearDropdown(e, i);
      return { value: l(e), label: t, disabled: !1 };
    })
  );
}
const Yzt = (e) => (e instanceof HTMLElement ? e : null),
  Xzt = (e) => [...(e.querySelectorAll("[data-animated-month]") ?? [])],
  Qzt = (e) => Yzt(e.querySelector("[data-animated-caption]")),
  Jzt = (e) => Yzt(e.querySelector("[data-animated-weeks]"));
function eUt(e, t, { classNames: n, months: i, focused: r, dateLib: o }) {
  const s = H.useRef(null),
    a = H.useRef(i),
    l = H.useRef(!1);
  H.useLayoutEffect(() => {
    const c = a.current;
    if (
      ((a.current = i),
      !(
        t &&
        e.current &&
        e.current instanceof HTMLElement &&
        0 !== i.length &&
        0 !== c.length &&
        i.length === c.length
      ))
    )
      return;
    const d = o.isSameMonth(i[0].date, c[0].date),
      u = o.isAfter(i[0].date, c[0].date),
      h = u ? n[gzt.caption_after_enter] : n[gzt.caption_before_enter],
      g = u ? n[gzt.weeks_after_enter] : n[gzt.weeks_before_enter],
      p = s.current,
      f = e.current.cloneNode(!0);
    if (f instanceof HTMLElement) {
      (Xzt(f).forEach((e) => {
        if (!(e instanceof HTMLElement)) return;
        const t = Yzt(e.querySelector("[data-animated-month]"));
        t && e.contains(t) && e.removeChild(t);
        const n = Qzt(e);
        n && n.classList.remove(h);
        const i = Jzt(e);
        i && i.classList.remove(g);
      }),
        (s.current = f));
    } else s.current = null;
    if (l.current || d || r) return;
    const m = p instanceof HTMLElement ? Xzt(p) : [],
      _ = Xzt(e.current);
    if (
      _?.every((e) => e instanceof HTMLElement) &&
      m &&
      m.every((e) => e instanceof HTMLElement)
    ) {
      ((l.current = !0), (e.current.style.isolation = "isolate"));
      const t = ((v = e.current), Yzt(v.querySelector("[data-animated-nav]")));
      (t && (t.style.zIndex = "1"),
        _.forEach((i, r) => {
          const o = m[r];
          if (!o) return;
          ((i.style.position = "relative"), (i.style.overflow = "hidden"));
          const s = Qzt(i);
          s && s.classList.add(h);
          const a = Jzt(i);
          a && a.classList.add(g);
          const c = () => {
            ((l.current = !1),
              e.current && (e.current.style.isolation = ""),
              t && (t.style.zIndex = ""),
              s && s.classList.remove(h),
              a && a.classList.remove(g),
              (i.style.position = ""),
              (i.style.overflow = ""),
              i.contains(o) && i.removeChild(o));
          };
          ((o.style.pointerEvents = "none"),
            (o.style.position = "absolute"),
            (o.style.overflow = "hidden"),
            o.setAttribute("aria-hidden", "true"));
          const d = ((e) => Yzt(e.querySelector("[data-animated-weekdays]")))(o);
          d && (d.style.opacity = "0");
          const p = Qzt(o);
          p &&
            (p.classList.add(u ? n[gzt.caption_before_exit] : n[gzt.caption_after_exit]),
            p.addEventListener("animationend", c));
          const f = Jzt(o);
          (f && f.classList.add(u ? n[gzt.weeks_before_exit] : n[gzt.weeks_after_exit]),
            i.insertBefore(o, i.firstChild));
        }));
    }
    var v;
  });
}
function tUt(e, t, n, i) {
  const { month: r, defaultMonth: o, today: s = i.today(), numberOfMonths: a = 1 } = e;
  let l = r || o || s;
  const { differenceInCalendarMonths: c, addMonths: d, startOfMonth: u } = i;
  if (n && c(n, l) < a - 1) {
    l = d(n, -1 * (a - 1));
  }
  return (t && c(l, t) < 0 && (l = t), u(l));
}
function nUt(e, t) {
  const [n, i] = H.useState(e);
  return [void 0 === t ? n : t, i];
}
function iUt(e, t) {
  const [n, i] = (function (e, t) {
      let { startMonth: n, endMonth: i } = e;
      const {
          startOfYear: r,
          startOfDay: o,
          startOfMonth: s,
          endOfMonth: a,
          addYears: l,
          endOfYear: c,
          newDate: d,
          today: u,
        } = t,
        { fromYear: h, toYear: g, fromMonth: p, toMonth: f } = e;
      (!n && p && (n = p),
        !n && h && (n = t.newDate(h, 0, 1)),
        !i && f && (i = f),
        !i && g && (i = d(g, 11, 31)));
      const m = "dropdown" === e.captionLayout || "dropdown-years" === e.captionLayout;
      return (
        n ? (n = s(n)) : h ? (n = d(h, 0, 1)) : !n && m && (n = r(l(e.today ?? u(), -100))),
        i ? (i = a(i)) : g ? (i = d(g, 11, 31)) : !i && m && (i = c(e.today ?? u())),
        [n ? o(n) : n, i ? o(i) : i]
      );
    })(e, t),
    { startOfMonth: r, endOfMonth: o } = t,
    s = tUt(e, n, i, t),
    [a, l] = nUt(s, e.month ? s : void 0);
  H.useEffect(() => {
    const r = tUt(e, n, i, t);
    l(r);
  }, [e.timeZone]);
  const {
      months: c,
      weeks: d,
      days: u,
      previousMonth: h,
      nextMonth: g,
    } = H.useMemo(() => {
      const r = (function (e, t, n, i) {
          const { numberOfMonths: r = 1 } = n,
            o = [];
          for (let s = 0; s < r; s++) {
            const n = i.addMonths(e, s);
            if (t && n > t) break;
            o.push(n);
          }
          return o;
        })(a, i, { numberOfMonths: e.numberOfMonths }, t),
        s = (function (e, t, n, i) {
          const r = e[0],
            o = e[e.length - 1],
            { ISOWeek: s, fixedWeeks: a, broadcastCalendar: l } = n ?? {},
            {
              addDays: c,
              differenceInCalendarDays: d,
              differenceInCalendarMonths: u,
              endOfBroadcastWeek: h,
              endOfISOWeek: g,
              endOfMonth: p,
              endOfWeek: f,
              isAfter: m,
              startOfBroadcastWeek: _,
              startOfISOWeek: v,
              startOfWeek: b,
            } = i,
            y = l ? _(r, i) : s ? v(r) : b(r),
            x = l ? h(o) : s ? g(p(o)) : f(p(o)),
            w = t && (l ? h(t) : s ? g(t) : f(t)),
            C = d(w && m(x, w) ? w : x, y),
            S = u(o, r) + 1,
            k = [];
          for (let N = 0; N <= C; N++) {
            const e = c(y, N);
            k.push(e);
          }
          const E = (l ? 35 : 42) * S;
          if (a && k.length < E) {
            const e = E - k.length;
            for (let t = 0; t < e; t++) {
              const e = c(k[k.length - 1], 1);
              k.push(e);
            }
          }
          return k;
        })(
          r,
          e.endMonth ? o(e.endMonth) : void 0,
          { ISOWeek: e.ISOWeek, fixedWeeks: e.fixedWeeks, broadcastCalendar: e.broadcastCalendar },
          t,
        ),
        l = (function (e, t, n, i) {
          const {
              addDays: r,
              endOfBroadcastWeek: o,
              endOfISOWeek: s,
              endOfMonth: a,
              endOfWeek: l,
              getISOWeek: c,
              getWeek: d,
              startOfBroadcastWeek: u,
              startOfISOWeek: h,
              startOfWeek: g,
            } = i,
            p = e.reduce((e, p) => {
              const f = n.broadcastCalendar ? u(p, i) : n.ISOWeek ? h(p) : g(p),
                m = n.broadcastCalendar ? o(p) : n.ISOWeek ? s(a(p)) : l(a(p)),
                _ = t.filter((e) => e >= f && e <= m),
                v = n.broadcastCalendar ? 35 : 42;
              if (n.fixedWeeks && _.length < v) {
                const e = t.filter((e) => {
                  const t = v - _.length;
                  return e > m && e <= r(m, t);
                });
                _.push(...e);
              }
              const b = _.reduce((e, t) => {
                  const r = n.ISOWeek ? c(t) : d(t),
                    o = e.find((e) => e.weekNumber === r),
                    s = new azt(t, p, i);
                  return (o ? o.days.push(s) : e.push(new czt(r, [s])), e);
                }, []),
                y = new lzt(p, b);
              return (e.push(y), e);
            }, []);
          return n.reverseMonths ? p.reverse() : p;
        })(
          r,
          s,
          {
            broadcastCalendar: e.broadcastCalendar,
            fixedWeeks: e.fixedWeeks,
            ISOWeek: e.ISOWeek,
            reverseMonths: e.reverseMonths,
          },
          t,
        ),
        c = (function (e) {
          return e.reduce((e, t) => e.concat(t.weeks.slice()), [].slice());
        })(l),
        d = (function (e) {
          const t = [];
          return e.reduce((e, n) => {
            const i = n.weeks.reduce((e, t) => e.concat(t.days.slice()), t.slice());
            return e.concat(i.slice());
          }, t.slice());
        })(l),
        u = (function (e, t, n, i) {
          if (n.disableNavigation) return;
          const { pagedNavigation: r, numberOfMonths: o } = n,
            { startOfMonth: s, addMonths: a, differenceInCalendarMonths: l } = i,
            c = r ? (o ?? 1) : 1,
            d = s(e);
          return t && l(d, t) <= 0 ? void 0 : a(d, -c);
        })(a, n, e, t),
        h = (function (e, t, n, i) {
          if (n.disableNavigation) return;
          const { pagedNavigation: r, numberOfMonths: o = 1 } = n,
            { startOfMonth: s, addMonths: a, differenceInCalendarMonths: l } = i,
            c = r ? o : 1,
            d = s(e);
          return t && l(t, e) < o ? void 0 : a(d, c);
        })(a, i, e, t);
      return { months: l, weeks: c, days: d, previousMonth: u, nextMonth: h };
    }, [
      t,
      a.getTime(),
      i?.getTime(),
      n?.getTime(),
      e.disableNavigation,
      e.broadcastCalendar,
      e.endMonth?.getTime(),
      e.fixedWeeks,
      e.ISOWeek,
      e.numberOfMonths,
      e.pagedNavigation,
      e.reverseMonths,
    ]),
    { disableNavigation: p, onMonthChange: f } = e,
    m = (e) => {
      if (p) return;
      let t = r(e);
      (n && t < r(n) && (t = r(n)), i && t > r(i) && (t = r(i)), l(t), f?.(t));
    },
    _ = {
      months: c,
      weeks: d,
      days: u,
      navStart: n,
      navEnd: i,
      previousMonth: h,
      nextMonth: g,
      goToMonth: m,
      goToDay: (e) => {
        ((e) => d.some((t) => t.days.some((t) => t.isEqualTo(e))))(e) || m(e.date);
      },
    };
  return _;
}
var rUt;
function oUt(e) {
  return !e[uzt.disabled] && !e[uzt.hidden] && !e[uzt.outside];
}
function sUt(e, t, n, i, r, o, s, a = 0) {
  if (a > 365) return;
  const l = (function (e, t, n, i, r, o, s) {
      const { ISOWeek: a, broadcastCalendar: l } = o,
        {
          addDays: c,
          addMonths: d,
          addWeeks: u,
          addYears: h,
          endOfBroadcastWeek: g,
          endOfISOWeek: p,
          endOfWeek: f,
          max: m,
          min: _,
          startOfBroadcastWeek: v,
          startOfISOWeek: b,
          startOfWeek: y,
        } = s,
        x = {
          day: c,
          week: u,
          month: d,
          year: h,
          startOfWeek: (e) => (l ? v(e, s) : a ? b(e) : y(e)),
          endOfWeek: (e) => (l ? g(e) : a ? p(e) : f(e)),
        };
      let w = x[e](n, "after" === t ? 1 : -1);
      return ("before" === t && i ? (w = m([i, w])) : "after" === t && r && (w = _([r, w])), w);
    })(e, t, n.date, i, r, o, s),
    c = Boolean(o.disabled && Szt(l, o.disabled, s)),
    d = Boolean(o.hidden && Szt(l, o.hidden, s)),
    u = new azt(l, l, s);
  return c || d ? sUt(e, t, u, i, r, o, s, a + 1) : u;
}
function aUt(e, t, n, i, r) {
  const { autoFocus: o } = e,
    [s, a] = H.useState(),
    l = (function (e, t, n, i) {
      let r,
        o = -1;
      for (const s of e) {
        const e = t(s);
        oUt(e) &&
          (e[uzt.focused] && o < rUt.FocusedModifier
            ? ((r = s), (o = rUt.FocusedModifier))
            : i?.isEqualTo(s) && o < rUt.LastFocused
              ? ((r = s), (o = rUt.LastFocused))
              : n(s.date) && o < rUt.Selected
                ? ((r = s), (o = rUt.Selected))
                : e[uzt.today] && o < rUt.Today && ((r = s), (o = rUt.Today)));
      }
      return (r || (r = e.find((e) => oUt(t(e)))), r);
    })(t.days, n, i || (() => !1), s),
    [c, d] = H.useState(o ? l : void 0);
  return {
    isFocusTarget: (e) => Boolean(l?.isEqualTo(e)),
    setFocused: d,
    focused: c,
    blur: () => {
      (a(c), d(void 0));
    },
    moveFocus: (n, i) => {
      if (!c) return;
      const o = sUt(n, i, c, t.navStart, t.navEnd, e, r);
      if (o) {
        if (e.disableNavigation) {
          if (!t.days.some((e) => e.isEqualTo(o))) return;
        }
        (t.goToDay(o), d(o));
      }
    },
  };
}
function lUt(e, t, n = szt) {
  return (
    _zt(e, t.from, !1, n) || _zt(e, t.to, !1, n) || _zt(t, e.from, !1, n) || _zt(t, e.to, !1, n)
  );
}
function cUt(e, t, n = szt) {
  const i = Array.isArray(t) ? t : [t],
    r = i
      .filter((e) => "function" != typeof e)
      .some((t) => {
        if ("boolean" == typeof t) return t;
        if (n.isDate(t)) return _zt(e, t, !1, n);
        if (Czt(t, n)) return t.some((t) => _zt(e, t, !1, n));
        if (bzt(t)) return !(!t.from || !t.to) && lUt(e, { from: t.from, to: t.to }, n);
        if (wzt(t))
          return (function (e, t, n = szt) {
            const i = Array.isArray(t) ? t : [t];
            let r = e.from;
            const o = n.differenceInCalendarDays(e.to, e.from),
              s = Math.min(o, 6);
            for (let a = 0; a <= s; a++) {
              if (i.includes(r.getDay())) return !0;
              r = n.addDays(r, 1);
            }
            return !1;
          })(e, t.dayOfWeek, n);
        if (vzt(t)) {
          return n.isAfter(t.before, t.after)
            ? lUt(e, { from: n.addDays(t.after, 1), to: n.addDays(t.before, -1) }, n)
            : Szt(e.from, t, n) || Szt(e.to, t, n);
        }
        return !(!yzt(t) && !xzt(t)) && (Szt(e.from, t, n) || Szt(e.to, t, n));
      });
  if (r) return !0;
  const o = i.filter((e) => "function" == typeof e);
  if (o.length) {
    let t = e.from;
    const i = n.differenceInCalendarDays(e.to, e.from);
    for (let e = 0; e <= i; e++) {
      if (o.some((e) => e(t))) return !0;
      t = n.addDays(t, 1);
    }
  }
  return !1;
}
function dUt(e, t) {
  const { disabled: n, excludeDisabled: i, selected: r, required: o, onSelect: s } = e,
    [a, l] = nUt(r, s ? r : void 0),
    c = s ? r : a;
  return {
    selected: c,
    select: (r, a, d) => {
      const { min: u, max: h } = e,
        g = r
          ? (function (e, t, n = 0, i = 0, r = !1, o = szt) {
              const { from: s, to: a } = t || {},
                { isSameDay: l, isAfter: c, isBefore: d } = o;
              let u;
              if (s || a) {
                if (s && !a)
                  u = l(s, e)
                    ? 0 === n
                      ? { from: s, to: e }
                      : r
                        ? { from: s, to: void 0 }
                        : void 0
                    : d(e, s)
                      ? { from: e, to: s }
                      : { from: s, to: e };
                else if (s && a)
                  if (l(s, e) && l(a, e)) u = r ? { from: s, to: a } : void 0;
                  else if (l(s, e)) u = { from: s, to: n > 0 ? void 0 : e };
                  else if (l(a, e)) u = { from: e, to: n > 0 ? void 0 : e };
                  else if (d(e, s)) u = { from: e, to: a };
                  else if (c(e, s)) u = { from: s, to: e };
                  else {
                    if (!c(e, a)) throw new Error("Invalid range");
                    u = { from: s, to: e };
                  }
              } else u = { from: e, to: n > 0 ? void 0 : e };
              if (u?.from && u?.to) {
                const t = o.differenceInCalendarDays(u.to, u.from);
                ((i > 0 && t > i) || (n > 1 && t < n)) && (u = { from: e, to: void 0 });
              }
              return u;
            })(r, c, u, h, o, t)
          : void 0;
      return (
        i &&
          n &&
          g?.from &&
          g.to &&
          cUt({ from: g.from, to: g.to }, n, t) &&
          ((g.from = r), (g.to = void 0)),
        s || l(g),
        s?.(g, r, a, d),
        g
      );
    },
    isSelected: (e) => c && _zt(c, e, !1, t),
  };
}
function uUt(e, t) {
  const n = (function (e, t) {
      const { selected: n, required: i, onSelect: r } = e,
        [o, s] = nUt(n, r ? n : void 0),
        a = r ? n : o,
        { isSameDay: l } = t;
      return {
        selected: a,
        select: (e, t, n) => {
          let o = e;
          return (!i && a && a && l(e, a) && (o = void 0), r || s(o), r?.(o, e, t, n), o);
        },
        isSelected: (e) => !!a && l(a, e),
      };
    })(e, t),
    i = (function (e, t) {
      const { selected: n, required: i, onSelect: r } = e,
        [o, s] = nUt(n, r ? n : void 0),
        a = r ? n : o,
        { isSameDay: l } = t,
        c = (e) => a?.some((t) => l(t, e)) ?? !1,
        { min: d, max: u } = e;
      return {
        selected: a,
        select: (e, t, n) => {
          let o = [...(a ?? [])];
          if (c(e)) {
            if (a?.length === d) return;
            if (i && 1 === a?.length) return;
            o = a?.filter((t) => !l(t, e));
          } else o = a?.length === u ? [e] : [...o, e];
          return (r || s(o), r?.(o, e, t, n), o);
        },
        isSelected: c,
      };
    })(e, t),
    r = dUt(e, t);
  switch (e.mode) {
    case "single":
      return n;
    case "multiple":
      return i;
    case "range":
      return r;
    default:
      return;
  }
}
function hUt(e, t) {
  return e instanceof nzt && e.timeZone === t ? e : new nzt(e, t);
}
function gUt(e, t) {
  return "boolean" == typeof e || "function" == typeof e
    ? e
    : e instanceof Date
      ? hUt(e, t)
      : Array.isArray(e)
        ? e.map((e) => (e instanceof Date ? hUt(e, t) : e))
        : bzt(e)
          ? { ...e, from: e.from ? hUt(e.from, t) : e.from, to: e.to ? hUt(e.to, t) : e.to }
          : vzt(e)
            ? { before: hUt(e.before, t), after: hUt(e.after, t) }
            : yzt(e)
              ? { after: hUt(e.after, t) }
              : xzt(e)
                ? { before: hUt(e.before, t) }
                : e;
}
function pUt(e, t) {
  return e ? (Array.isArray(e) ? e.map((e) => gUt(e, t)) : gUt(e, t)) : e;
}
function fUt(e) {
  let t = e;
  const n = t.timeZone;
  if (
    n &&
    ((t = { ...e, timeZone: n }),
    t.today && (t.today = hUt(t.today, n)),
    t.month && (t.month = hUt(t.month, n)),
    t.defaultMonth && (t.defaultMonth = hUt(t.defaultMonth, n)),
    t.startMonth && (t.startMonth = hUt(t.startMonth, n)),
    t.endMonth && (t.endMonth = hUt(t.endMonth, n)),
    "single" === t.mode && t.selected
      ? (t.selected = hUt(t.selected, n))
      : "multiple" === t.mode && t.selected
        ? (t.selected = t.selected?.map((e) => hUt(e, n)))
        : "range" === t.mode &&
          t.selected &&
          (t.selected = {
            from: t.selected.from ? hUt(t.selected.from, n) : t.selected.from,
            to: t.selected.to ? hUt(t.selected.to, n) : t.selected.to,
          }),
    void 0 !== t.disabled && (t.disabled = pUt(t.disabled, n)),
    void 0 !== t.hidden && (t.hidden = pUt(t.hidden, n)),
    t.modifiers)
  ) {
    const e = {};
    (Object.keys(t.modifiers).forEach((i) => {
      e[i] = pUt(t.modifiers?.[i], n);
    }),
      (t.modifiers = e));
  }
  const {
    components: i,
    formatters: r,
    labels: o,
    dateLib: s,
    locale: a,
    classNames: l,
  } = H.useMemo(() => {
    const e = { ...rzt, ...t.locale },
      n = new ozt(
        {
          locale: e,
          weekStartsOn: t.broadcastCalendar ? 1 : t.weekStartsOn,
          firstWeekContainsDate: t.firstWeekContainsDate,
          useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
          useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
          timeZone: t.timeZone,
          numerals: t.numerals,
        },
        t.dateLib,
      );
    return {
      dateLib: n,
      components: kzt(t.components),
      formatters:
        ((i = t.formatters),
        i?.formatMonthCaption && !i.formatCaption && (i.formatCaption = i.formatMonthCaption),
        i?.formatYearCaption &&
          !i.formatYearDropdown &&
          (i.formatYearDropdown = i.formatYearCaption),
        { ...Izt, ...i }),
      labels: Kzt(t.labels, n.options),
      locale: e,
      classNames: { ...Ezt(), ...t.classNames },
    };
    var i;
  }, [
    t.locale,
    t.broadcastCalendar,
    t.weekStartsOn,
    t.firstWeekContainsDate,
    t.useAdditionalWeekYearTokens,
    t.useAdditionalDayOfYearTokens,
    t.timeZone,
    t.numerals,
    t.dateLib,
    t.components,
    t.formatters,
    t.labels,
    t.classNames,
  ]);
  t.today || (t = { ...t, today: s.today() });
  const {
      captionLayout: c,
      mode: d,
      navLayout: u,
      numberOfMonths: h = 1,
      onDayBlur: g,
      onDayClick: p,
      onDayFocus: f,
      onDayKeyDown: m,
      onDayMouseEnter: _,
      onDayMouseLeave: v,
      onNextClick: b,
      onPrevClick: y,
      showWeekNumber: x,
      styles: w,
    } = t,
    {
      formatCaption: C,
      formatDay: S,
      formatMonthDropdown: k,
      formatWeekNumber: E,
      formatWeekNumberHeader: N,
      formatWeekdayName: L,
      formatYearDropdown: D,
    } = r,
    T = iUt(t, s),
    {
      days: I,
      months: R,
      navStart: O,
      navEnd: M,
      previousMonth: A,
      nextMonth: P,
      goToMonth: j,
    } = T,
    F = (function (e, t, n, i, r) {
      const {
          disabled: o,
          hidden: s,
          modifiers: a,
          showOutsideDays: l,
          broadcastCalendar: c,
          today: d = r.today(),
        } = t,
        {
          isSameDay: u,
          isSameMonth: h,
          startOfMonth: g,
          isBefore: p,
          endOfMonth: f,
          isAfter: m,
        } = r,
        _ = n && g(n),
        v = i && f(i),
        b = {
          [uzt.focused]: [],
          [uzt.outside]: [],
          [uzt.disabled]: [],
          [uzt.hidden]: [],
          [uzt.today]: [],
        },
        y = {};
      for (const x of e) {
        const { date: e, displayMonth: t } = x,
          n = Boolean(t && !h(e, t)),
          i = Boolean(_ && p(e, _)),
          g = Boolean(v && m(e, v)),
          f = Boolean(o && Szt(e, o, r)),
          w = Boolean(s && Szt(e, s, r)) || i || g || (!c && !l && n) || (c && !1 === l && n),
          C = u(e, d);
        (n && b.outside.push(x),
          f && b.disabled.push(x),
          w && b.hidden.push(x),
          C && b.today.push(x),
          a &&
            Object.keys(a).forEach((t) => {
              const n = a?.[t];
              n && Szt(e, n, r) && (y[t] ? y[t].push(x) : (y[t] = [x]));
            }));
      }
      return (e) => {
        const t = {
            [uzt.focused]: !1,
            [uzt.disabled]: !1,
            [uzt.hidden]: !1,
            [uzt.outside]: !1,
            [uzt.today]: !1,
          },
          n = {};
        for (const i in b) {
          const n = b[i];
          t[i] = n.some((t) => t === e);
        }
        for (const i in y) n[i] = y[i].some((t) => t === e);
        return { ...t, ...n };
      };
    })(I, t, O, M, s),
    { isSelected: B, select: V, selected: W } = uUt(t, s) ?? {},
    {
      blur: U,
      focused: $,
      isFocusTarget: q,
      moveFocus: K,
      setFocused: G,
    } = aUt(t, T, F, B ?? (() => !1), s),
    {
      labelDayButton: Z,
      labelGridcell: Y,
      labelGrid: X,
      labelMonthDropdown: Q,
      labelNav: J,
      labelPrevious: ee,
      labelNext: te,
      labelWeekday: ne,
      labelWeekNumber: ie,
      labelWeekNumberHeader: re,
      labelYearDropdown: oe,
    } = o,
    se = H.useMemo(
      () =>
        (function (e, t, n, i) {
          const r = i ?? e.today(),
            o = n ? e.startOfBroadcastWeek(r, e) : t ? e.startOfISOWeek(r) : e.startOfWeek(r),
            s = [];
          for (let a = 0; a < 7; a++) {
            const t = e.addDays(o, a);
            s.push(t);
          }
          return s;
        })(s, t.ISOWeek, t.broadcastCalendar, t.today),
      [s, t.ISOWeek, t.broadcastCalendar, t.today],
    ),
    ae = void 0 !== d || void 0 !== p,
    le = H.useCallback(() => {
      A && (j(A), y?.(A));
    }, [A, j, y]),
    ce = H.useCallback(() => {
      P && (j(P), b?.(P));
    }, [j, P, b]),
    de = H.useCallback(
      (e, t) => (n) => {
        (n.preventDefault(),
          n.stopPropagation(),
          G(e),
          t.disabled || (V?.(e.date, t, n), p?.(e.date, t, n)));
      },
      [V, p, G],
    ),
    ue = H.useCallback(
      (e, t) => (n) => {
        (G(e), f?.(e.date, t, n));
      },
      [f, G],
    ),
    he = H.useCallback(
      (e, t) => (n) => {
        (U(), g?.(e.date, t, n));
      },
      [U, g],
    ),
    ge = H.useCallback(
      (e, n) => (i) => {
        const r = {
          ArrowLeft: [i.shiftKey ? "month" : "day", "rtl" === t.dir ? "after" : "before"],
          ArrowRight: [i.shiftKey ? "month" : "day", "rtl" === t.dir ? "before" : "after"],
          ArrowDown: [i.shiftKey ? "year" : "week", "after"],
          ArrowUp: [i.shiftKey ? "year" : "week", "before"],
          PageUp: [i.shiftKey ? "year" : "month", "before"],
          PageDown: [i.shiftKey ? "year" : "month", "after"],
          Home: ["startOfWeek", "before"],
          End: ["endOfWeek", "after"],
        };
        if (r[i.key]) {
          (i.preventDefault(), i.stopPropagation());
          const [e, t] = r[i.key];
          K(e, t);
        }
        m?.(e.date, n, i);
      },
      [K, m, t.dir],
    ),
    pe = H.useCallback(
      (e, t) => (n) => {
        _?.(e.date, t, n);
      },
      [_],
    ),
    fe = H.useCallback(
      (e, t) => (n) => {
        v?.(e.date, t, n);
      },
      [v],
    ),
    me = H.useCallback(
      (e) => (t) => {
        const n = Number(t.target.value),
          i = s.setMonth(s.startOfMonth(e), n);
        j(i);
      },
      [s, j],
    ),
    _e = H.useCallback(
      (e) => (t) => {
        const n = Number(t.target.value),
          i = s.setYear(s.startOfMonth(e), n);
        j(i);
      },
      [s, j],
    ),
    { className: ve, style: be } = H.useMemo(
      () => ({
        className: [l[dzt.Root], t.className].filter(Boolean).join(" "),
        style: { ...w?.[dzt.Root], ...t.style },
      }),
      [l, t.className, t.style, w],
    ),
    ye = (function (e) {
      const t = {
        "data-mode": e.mode ?? void 0,
        "data-required": "required" in e ? e.required : void 0,
        "data-multiple-months": (e.numberOfMonths && e.numberOfMonths > 1) || void 0,
        "data-week-numbers": e.showWeekNumber || void 0,
        "data-broadcast-calendar": e.broadcastCalendar || void 0,
        "data-nav-layout": e.navLayout || void 0,
      };
      return (
        Object.entries(e).forEach(([e, n]) => {
          e.startsWith("data-") && (t[e] = n);
        }),
        t
      );
    })(t),
    xe = H.useRef(null);
  eUt(xe, Boolean(t.animate), { classNames: l, months: R, focused: $, dateLib: s });
  const we = {
    dayPickerProps: t,
    selected: W,
    select: V,
    isSelected: B,
    months: R,
    nextMonth: P,
    previousMonth: A,
    goToMonth: j,
    getModifiers: F,
    components: i,
    classNames: l,
    styles: w,
    labels: o,
    formatters: r,
  };
  return z.createElement(
    pzt.Provider,
    { value: we },
    z.createElement(
      i.Root,
      {
        rootRef: t.animate ? xe : void 0,
        className: ve,
        style: be,
        dir: t.dir,
        id: t.id,
        lang: t.lang,
        nonce: t.nonce,
        title: t.title,
        role: t.role,
        "aria-label": t["aria-label"],
        "aria-labelledby": t["aria-labelledby"],
        ...ye,
      },
      z.createElement(
        i.Months,
        { className: l[dzt.Months], style: w?.[dzt.Months] },
        !t.hideNavigation &&
          !u &&
          z.createElement(i.Nav, {
            "data-animated-nav": t.animate ? "true" : void 0,
            className: l[dzt.Nav],
            style: w?.[dzt.Nav],
            "aria-label": J(),
            onPreviousClick: le,
            onNextClick: ce,
            previousMonth: A,
            nextMonth: P,
          }),
        R.map((e, n) =>
          z.createElement(
            i.Month,
            {
              "data-animated-month": t.animate ? "true" : void 0,
              className: l[dzt.Month],
              style: w?.[dzt.Month],
              key: n,
              displayIndex: n,
              calendarMonth: e,
            },
            "around" === u &&
              !t.hideNavigation &&
              0 === n &&
              z.createElement(
                i.PreviousMonthButton,
                {
                  type: "button",
                  className: l[dzt.PreviousMonthButton],
                  tabIndex: A ? void 0 : -1,
                  "aria-disabled": !A || void 0,
                  "aria-label": ee(A),
                  onClick: le,
                  "data-animated-button": t.animate ? "true" : void 0,
                },
                z.createElement(i.Chevron, {
                  disabled: !A || void 0,
                  className: l[dzt.Chevron],
                  orientation: "rtl" === t.dir ? "right" : "left",
                }),
              ),
            z.createElement(
              i.MonthCaption,
              {
                "data-animated-caption": t.animate ? "true" : void 0,
                className: l[dzt.MonthCaption],
                style: w?.[dzt.MonthCaption],
                calendarMonth: e,
                displayIndex: n,
              },
              c?.startsWith("dropdown")
                ? z.createElement(
                    i.DropdownNav,
                    { className: l[dzt.Dropdowns], style: w?.[dzt.Dropdowns] },
                    (() => {
                      const n =
                          "dropdown" === c || "dropdown-months" === c
                            ? z.createElement(i.MonthsDropdown, {
                                key: "month",
                                className: l[dzt.MonthsDropdown],
                                "aria-label": Q(),
                                classNames: l,
                                components: i,
                                disabled: Boolean(t.disableNavigation),
                                onChange: me(e.date),
                                options: Gzt(e.date, O, M, r, s),
                                style: w?.[dzt.Dropdown],
                                value: s.getMonth(e.date),
                              })
                            : z.createElement("span", { key: "month" }, k(e.date, s)),
                        o =
                          "dropdown" === c || "dropdown-years" === c
                            ? z.createElement(i.YearsDropdown, {
                                key: "year",
                                className: l[dzt.YearsDropdown],
                                "aria-label": oe(s.options),
                                classNames: l,
                                components: i,
                                disabled: Boolean(t.disableNavigation),
                                onChange: _e(e.date),
                                options: Zzt(O, M, r, s, Boolean(t.reverseYears)),
                                style: w?.[dzt.Dropdown],
                                value: s.getYear(e.date),
                              })
                            : z.createElement("span", { key: "year" }, D(e.date, s));
                      return "year-first" === s.getMonthYearOrder() ? [o, n] : [n, o];
                    })(),
                    z.createElement(
                      "span",
                      {
                        role: "status",
                        "aria-live": "polite",
                        style: {
                          border: 0,
                          clip: "rect(0 0 0 0)",
                          height: "1px",
                          margin: "-1px",
                          overflow: "hidden",
                          padding: 0,
                          position: "absolute",
                          width: "1px",
                          whiteSpace: "nowrap",
                          wordWrap: "normal",
                        },
                      },
                      C(e.date, s.options, s),
                    ),
                  )
                : z.createElement(
                    i.CaptionLabel,
                    { className: l[dzt.CaptionLabel], role: "status", "aria-live": "polite" },
                    C(e.date, s.options, s),
                  ),
            ),
            "around" === u &&
              !t.hideNavigation &&
              n === h - 1 &&
              z.createElement(
                i.NextMonthButton,
                {
                  type: "button",
                  className: l[dzt.NextMonthButton],
                  tabIndex: P ? void 0 : -1,
                  "aria-disabled": !P || void 0,
                  "aria-label": te(P),
                  onClick: ce,
                  "data-animated-button": t.animate ? "true" : void 0,
                },
                z.createElement(i.Chevron, {
                  disabled: !P || void 0,
                  className: l[dzt.Chevron],
                  orientation: "rtl" === t.dir ? "left" : "right",
                }),
              ),
            n === h - 1 &&
              "after" === u &&
              !t.hideNavigation &&
              z.createElement(i.Nav, {
                "data-animated-nav": t.animate ? "true" : void 0,
                className: l[dzt.Nav],
                style: w?.[dzt.Nav],
                "aria-label": J(),
                onPreviousClick: le,
                onNextClick: ce,
                previousMonth: A,
                nextMonth: P,
              }),
            z.createElement(
              i.MonthGrid,
              {
                role: "grid",
                "aria-multiselectable": "multiple" === d || "range" === d,
                "aria-label": X(e.date, s.options, s) || void 0,
                className: l[dzt.MonthGrid],
                style: w?.[dzt.MonthGrid],
              },
              !t.hideWeekdays &&
                z.createElement(
                  i.Weekdays,
                  {
                    "data-animated-weekdays": t.animate ? "true" : void 0,
                    className: l[dzt.Weekdays],
                    style: w?.[dzt.Weekdays],
                  },
                  x &&
                    z.createElement(
                      i.WeekNumberHeader,
                      {
                        "aria-label": re(s.options),
                        className: l[dzt.WeekNumberHeader],
                        style: w?.[dzt.WeekNumberHeader],
                        scope: "col",
                      },
                      N(),
                    ),
                  se.map((e) =>
                    z.createElement(
                      i.Weekday,
                      {
                        "aria-label": ne(e, s.options, s),
                        className: l[dzt.Weekday],
                        key: String(e),
                        style: w?.[dzt.Weekday],
                        scope: "col",
                      },
                      L(e, s.options, s),
                    ),
                  ),
                ),
              z.createElement(
                i.Weeks,
                {
                  "data-animated-weeks": t.animate ? "true" : void 0,
                  className: l[dzt.Weeks],
                  style: w?.[dzt.Weeks],
                },
                e.weeks.map((e) =>
                  z.createElement(
                    i.Week,
                    { className: l[dzt.Week], key: e.weekNumber, style: w?.[dzt.Week], week: e },
                    x &&
                      z.createElement(
                        i.WeekNumber,
                        {
                          week: e,
                          style: w?.[dzt.WeekNumber],
                          "aria-label": ie(e.weekNumber, { locale: a }),
                          className: l[dzt.WeekNumber],
                          scope: "row",
                          role: "rowheader",
                        },
                        E(e.weekNumber, s),
                      ),
                    e.days.map((e) => {
                      const { date: n } = e,
                        r = F(e);
                      if (
                        ((r[uzt.focused] = !r.hidden && Boolean($?.isEqualTo(e))),
                        (r[hzt.selected] = B?.(n) || r.selected),
                        bzt(W))
                      ) {
                        const { from: e, to: t } = W;
                        ((r[hzt.range_start] = Boolean(e && t && s.isSameDay(n, e))),
                          (r[hzt.range_end] = Boolean(e && t && s.isSameDay(n, t))),
                          (r[hzt.range_middle] = _zt(W, n, !0, s)));
                      }
                      const o = (function (e, t = {}, n = {}) {
                          let i = { ...t?.[dzt.Day] };
                          return (
                            Object.entries(e)
                              .filter(([, e]) => !0 === e)
                              .forEach(([e]) => {
                                i = { ...i, ...n?.[e] };
                              }),
                            i
                          );
                        })(r, w, t.modifiersStyles),
                        a = (function (e, t, n = {}) {
                          return Object.entries(e)
                            .filter(([, e]) => !0 === e)
                            .reduce(
                              (e, [i]) => (
                                n[i]
                                  ? e.push(n[i])
                                  : t[uzt[i]]
                                    ? e.push(t[uzt[i]])
                                    : t[hzt[i]] && e.push(t[hzt[i]]),
                                e
                              ),
                              [t[dzt.Day]],
                            );
                        })(r, l, t.modifiersClassNames),
                        c = ae || r.hidden ? void 0 : Y(n, r, s.options, s);
                      return z.createElement(
                        i.Day,
                        {
                          key: `${e.isoDate}_${e.displayMonthId}`,
                          day: e,
                          modifiers: r,
                          className: a.join(" "),
                          style: o,
                          role: "gridcell",
                          "aria-selected": r.selected || void 0,
                          "aria-label": c,
                          "data-day": e.isoDate,
                          "data-month": e.outside ? e.dateMonthId : void 0,
                          "data-selected": r.selected || void 0,
                          "data-disabled": r.disabled || void 0,
                          "data-hidden": r.hidden || void 0,
                          "data-outside": e.outside || void 0,
                          "data-focused": r.focused || void 0,
                          "data-today": r.today || void 0,
                        },
                        !r.hidden && ae
                          ? z.createElement(
                              i.DayButton,
                              {
                                className: l[dzt.DayButton],
                                style: w?.[dzt.DayButton],
                                type: "button",
                                day: e,
                                modifiers: r,
                                disabled: (!r.focused && r.disabled) || void 0,
                                "aria-disabled": (r.focused && r.disabled) || void 0,
                                tabIndex: q(e) ? 0 : -1,
                                "aria-label": Z(n, r, s.options, s),
                                onClick: de(e, r),
                                onBlur: he(e, r),
                                onFocus: ue(e, r),
                                onKeyDown: ge(e, r),
                                onMouseEnter: pe(e, r),
                                onMouseLeave: fe(e, r),
                              },
                              S(n, s.options, s),
                            )
                          : !r.hidden && S(e.date, s.options, s),
                      );
                    }),
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
      t.footer &&
        z.createElement(
          i.Footer,
          {
            className: l[dzt.Footer],
            style: w?.[dzt.Footer],
            role: "status",
            "aria-live": "polite",
          },
          t.footer,
        ),
    ),
  );
}
function mUt({
  className: e,
  classNames: t,
  showOutsideDays: n = !0,
  captionLayout: i = "label",
  buttonVariant: r = "ghost",
  formatters: o,
  components: s,
  ...a
}) {
  const l = Ezt();
  return Q.jsx(fUt, {
    showOutsideDays: n,
    className: Rf(
      "bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
      String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
      String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
      e,
    ),
    captionLayout: i,
    formatters: {
      formatMonthDropdown: (e) => e.toLocaleString("default", { month: "short" }),
      ...o,
    },
    classNames: {
      root: Rf("w-fit", l.root),
      months: Rf("relative flex flex-col gap-4 md:flex-row", l.months),
      month: Rf("flex w-full flex-col gap-4", l.month),
      nav: Rf("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", l.nav),
      button_previous: Rf(
        att({ variant: r }),
        "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
        l.button_previous,
      ),
      button_next: Rf(
        att({ variant: r }),
        "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
        l.button_next,
      ),
      month_caption: Rf(
        "flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",
        l.month_caption,
      ),
      dropdowns: Rf(
        "flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",
        l.dropdowns,
      ),
      dropdown_root: Rf(
        "has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",
        l.dropdown_root,
      ),
      dropdown: Rf("absolute inset-0 opacity-0", l.dropdown),
      caption_label: Rf(
        "select-none font-medium",
        "label" === i
          ? "text-sm"
          : "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",
        l.caption_label,
      ),
      table: "w-full border-collapse",
      weekdays: Rf("flex", l.weekdays),
      weekday: Rf(
        "text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",
        l.weekday,
      ),
      week: Rf("mt-2 flex w-full", l.week),
      week_number_header: Rf("w-[--cell-size] select-none", l.week_number_header),
      week_number: Rf("text-muted-foreground select-none text-[0.8rem]", l.week_number),
      day: Rf(
        "group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",
        l.day,
      ),
      range_start: Rf("bg-accent rounded-l-md", l.range_start),
      range_middle: Rf("rounded-none", l.range_middle),
      range_end: Rf("bg-accent rounded-r-md", l.range_end),
      today: Rf(
        "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
        l.today,
      ),
      outside: Rf("text-muted-foreground aria-selected:text-muted-foreground", l.outside),
      disabled: Rf("text-muted-foreground opacity-50", l.disabled),
      hidden: Rf("invisible", l.hidden),
      ...t,
    },
    components: {
      Root: ({ className: e, rootRef: t, ...n }) =>
        Q.jsx("div", { "data-slot": "calendar", ref: t, className: Rf(e), ...n }),
      Chevron: ({ className: e, orientation: t, ...n }) =>
        "left" === t
          ? Q.jsx(cat, { className: Rf("size-4", e), ...n })
          : "right" === t
            ? Q.jsx(dat, { className: Rf("size-4", e), ...n })
            : Q.jsx(lat, { className: Rf("size-4", e), ...n }),
      DayButton: _Ut,
      WeekNumber: ({ children: e, ...t }) =>
        Q.jsx("td", {
          ...t,
          children: Q.jsx("div", {
            className: "flex size-[--cell-size] items-center justify-center text-center",
            children: e,
          }),
        }),
      ...s,
    },
    ...a,
  });
}
function _Ut({ className: e, day: t, modifiers: n, ...i }) {
  const r = Ezt(),
    o = H.useRef(null);
  return (
    H.useEffect(() => {
      n.focused && o.current?.focus();
    }, [n.focused]),
    Q.jsx(ltt, {
      ref: o,
      variant: "ghost",
      size: "icon",
      "data-day": t.date.toLocaleDateString(),
      "data-selected-single": n.selected && !n.range_start && !n.range_end && !n.range_middle,
      "data-range-start": n.range_start,
      "data-range-end": n.range_end,
      "data-range-middle": n.range_middle,
      className: Rf(
        "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",
        r.day,
        e,
      ),
      ...i,
    })
  );
}
function vUt(e) {
  const t = H.forwardRef((e, t) => {
    const { children: n, ...i } = e;
    if (H.isValidElement(n)) {
      const e = (function (e) {
          let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get,
            n = t && "isReactWarning" in t && t.isReactWarning;
          if (n) return e.ref;
          if (
            ((t = Object.getOwnPropertyDescriptor(e, "ref")?.get),
            (n = t && "isReactWarning" in t && t.isReactWarning),
            n)
          )
            return e.props.ref;
          return e.props.ref || e.ref;
        })(n),
        r = (function (e, t) {
          const n = { ...t };
          for (const i in t) {
            const r = e[i],
              o = t[i];
            /^on[A-Z]/.test(i)
              ? r && o
                ? (n[i] = (...e) => {
                    const t = o(...e);
                    return (r(...e), t);
                  })
                : r && (n[i] = r)
              : "style" === i
                ? (n[i] = { ...r, ...o })
                : "className" === i && (n[i] = [r, o].filter(Boolean).join(" "));
          }
          return { ...e, ...n };
        })(i, n.props);
      return (n.type !== H.Fragment && (r.ref = t ? Cp(t, e) : e), H.cloneElement(n, r));
    }
    return H.Children.count(n) > 1 ? H.Children.only(null) : null;
  });
  return ((t.displayName = `${e}.SlotClone`), t);
}
!(function (e) {
  ((e[(e.Today = 0)] = "Today"),
    (e[(e.Selected = 1)] = "Selected"),
    (e[(e.LastFocused = 2)] = "LastFocused"),
    (e[(e.FocusedModifier = 3)] = "FocusedModifier"));
})(rUt || (rUt = {}));
var bUt = Symbol("radix.slottable");
function yUt(e) {
  return (
    H.isValidElement(e) &&
    "function" == typeof e.type &&
    "__radixId" in e.type &&
    e.type.__radixId === bUt
  );
}
var xUt = "Popover",
  [wUt] = Jy(xUt, [lit]),
  CUt = lit(),
  [SUt, kUt] = wUt(xUt),
  EUt = (e) => {
    const {
        __scopePopover: t,
        children: n,
        open: i,
        defaultOpen: r,
        onOpenChange: o,
        modal: s = !1,
      } = e,
      a = CUt(t),
      l = H.useRef(null),
      [c, d] = H.useState(!1),
      [u, h] = _x({ prop: i, defaultProp: r ?? !1, onChange: o, caller: xUt });
    return Q.jsx(Sit, {
      ...a,
      children: Q.jsx(SUt, {
        scope: t,
        contentId: cx(),
        triggerRef: l,
        open: u,
        onOpenChange: h,
        onOpenToggle: H.useCallback(() => h((e) => !e), [h]),
        hasCustomAnchor: c,
        onCustomAnchorAdd: H.useCallback(() => d(!0), []),
        onCustomAnchorRemove: H.useCallback(() => d(!1), []),
        modal: s,
        children: n,
      }),
    });
  };
EUt.displayName = xUt;
var NUt = "PopoverAnchor",
  LUt = H.forwardRef((e, t) => {
    const { __scopePopover: n, ...i } = e,
      r = kUt(NUt, n),
      o = CUt(n),
      { onCustomAnchorAdd: s, onCustomAnchorRemove: a } = r;
    return (H.useEffect(() => (s(), () => a()), [s, a]), Q.jsx(kit, { ...o, ...i, ref: t }));
  });
LUt.displayName = NUt;
var DUt = "PopoverTrigger",
  TUt = H.forwardRef((e, t) => {
    const { __scopePopover: n, ...i } = e,
      r = kUt(DUt, n),
      o = CUt(n),
      s = Sp(t, r.triggerRef),
      a = Q.jsx(gx.button, {
        type: "button",
        "aria-haspopup": "dialog",
        "aria-expanded": r.open,
        "aria-controls": r.contentId,
        "data-state": zUt(r.open),
        ...i,
        ref: s,
        onClick: Qy(e.onClick, r.onOpenToggle),
      });
    return r.hasCustomAnchor ? a : Q.jsx(kit, { asChild: !0, ...o, children: a });
  });
TUt.displayName = DUt;
var IUt = "PopoverPortal",
  [RUt, OUt] = wUt(IUt, { forceMount: void 0 }),
  MUt = (e) => {
    const { __scopePopover: t, forceMount: n, children: i, container: r } = e,
      o = kUt(IUt, t);
    return Q.jsx(RUt, {
      scope: t,
      forceMount: n,
      children: Q.jsx(Fx, {
        present: n || o.open,
        children: Q.jsx(y8e, { asChild: !0, container: r, children: i }),
      }),
    });
  };
MUt.displayName = IUt;
var AUt = "PopoverContent",
  PUt = H.forwardRef((e, t) => {
    const n = OUt(AUt, e.__scopePopover),
      { forceMount: i = n.forceMount, ...r } = e,
      o = kUt(AUt, e.__scopePopover);
    return Q.jsx(Fx, {
      present: i || o.open,
      children: o.modal ? Q.jsx(FUt, { ...r, ref: t }) : Q.jsx(BUt, { ...r, ref: t }),
    });
  });
PUt.displayName = AUt;
var jUt = (function (e) {
    const t = vUt(e),
      n = H.forwardRef((e, n) => {
        const { children: i, ...r } = e,
          o = H.Children.toArray(i),
          s = o.find(yUt);
        if (s) {
          const e = s.props.children,
            i = o.map((t) =>
              t === s
                ? H.Children.count(e) > 1
                  ? H.Children.only(null)
                  : H.isValidElement(e)
                    ? e.props.children
                    : null
                : t,
            );
          return Q.jsx(t, {
            ...r,
            ref: n,
            children: H.isValidElement(e) ? H.cloneElement(e, void 0, i) : null,
          });
        }
        return Q.jsx(t, { ...r, ref: n, children: i });
      });
    return ((n.displayName = `${e}.Slot`), n);
  })("PopoverContent.RemoveScroll"),
  FUt = H.forwardRef((e, t) => {
    const n = kUt(AUt, e.__scopePopover),
      i = H.useRef(null),
      r = Sp(t, i),
      o = H.useRef(!1);
    return (
      H.useEffect(() => {
        const e = i.current;
        if (e) return b9e(e);
      }, []),
      Q.jsx(h9e, {
        as: jUt,
        allowPinchZoom: !0,
        children: Q.jsx(VUt, {
          ...e,
          ref: r,
          trapFocus: n.open,
          disableOutsidePointerEvents: !0,
          onCloseAutoFocus: Qy(e.onCloseAutoFocus, (e) => {
            (e.preventDefault(), o.current || n.triggerRef.current?.focus());
          }),
          onPointerDownOutside: Qy(
            e.onPointerDownOutside,
            (e) => {
              const t = e.detail.originalEvent,
                n = 0 === t.button && !0 === t.ctrlKey,
                i = 2 === t.button || n;
              o.current = i;
            },
            { checkForDefaultPrevented: !1 },
          ),
          onFocusOutside: Qy(e.onFocusOutside, (e) => e.preventDefault(), {
            checkForDefaultPrevented: !1,
          }),
        }),
      })
    );
  }),
  BUt = H.forwardRef((e, t) => {
    const n = kUt(AUt, e.__scopePopover),
      i = H.useRef(!1),
      r = H.useRef(!1);
    return Q.jsx(VUt, {
      ...e,
      ref: t,
      trapFocus: !1,
      disableOutsidePointerEvents: !1,
      onCloseAutoFocus: (t) => {
        (e.onCloseAutoFocus?.(t),
          t.defaultPrevented || (i.current || n.triggerRef.current?.focus(), t.preventDefault()),
          (i.current = !1),
          (r.current = !1));
      },
      onInteractOutside: (t) => {
        (e.onInteractOutside?.(t),
          t.defaultPrevented ||
            ((i.current = !0), "pointerdown" === t.detail.originalEvent.type && (r.current = !0)));
        const o = t.target,
          s = n.triggerRef.current?.contains(o);
        (s && t.preventDefault(),
          "focusin" === t.detail.originalEvent.type && r.current && t.preventDefault());
      },
    });
  }),
  VUt = H.forwardRef((e, t) => {
    const {
        __scopePopover: n,
        trapFocus: i,
        onOpenAutoFocus: r,
        onCloseAutoFocus: o,
        disableOutsidePointerEvents: s,
        onEscapeKeyDown: a,
        onPointerDownOutside: l,
        onFocusOutside: c,
        onInteractOutside: d,
        ...u
      } = e,
      h = kUt(AUt, n),
      g = CUt(n);
    return (
      w8e(),
      Q.jsx(g8e, {
        asChild: !0,
        loop: !0,
        trapped: i,
        onMountAutoFocus: r,
        onUnmountAutoFocus: o,
        children: Q.jsx(a8e, {
          asChild: !0,
          disableOutsidePointerEvents: s,
          onInteractOutside: d,
          onEscapeKeyDown: a,
          onPointerDownOutside: l,
          onFocusOutside: c,
          onDismiss: () => h.onOpenChange(!1),
          children: Q.jsx(Eit, {
            "data-state": zUt(h.open),
            role: "dialog",
            id: h.contentId,
            ...g,
            ...u,
            ref: t,
            style: {
              ...u.style,
              "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
              "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
              "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
              "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
              "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)",
            },
          }),
        }),
      })
    );
  }),
  WUt = "PopoverClose",
  HUt = H.forwardRef((e, t) => {
    const { __scopePopover: n, ...i } = e,
      r = kUt(WUt, n);
    return Q.jsx(gx.button, {
      type: "button",
      ...i,
      ref: t,
      onClick: Qy(e.onClick, () => r.onOpenChange(!1)),
    });
  });
HUt.displayName = WUt;
function zUt(e) {
  return e ? "open" : "closed";
}
H.forwardRef((e, t) => {
  const { __scopePopover: n, ...i } = e,
    r = CUt(n);
  return Q.jsx(Nit, { ...r, ...i, ref: t });
}).displayName = "PopoverArrow";
var UUt = MUt,
  $Ut = PUt;
const qUt = EUt,
  KUt = TUt,
  GUt = LUt,
  ZUt = H.forwardRef(({ className: e, align: t = "center", sideOffset: n = 4, ...i }, r) =>
    Q.jsx(UUt, {
      children: Q.jsx($Ut, {
        ref: r,
        align: t,
        sideOffset: n,
        className: Rf(
          "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
          e,
        ),
        ...i,
      }),
    }),
  );
ZUt.displayName = $Ut.displayName;
const YUt = {
    main: "hsl(var(--primary))",
    gradient: { start: "hsl(var(--primary))", end: "transparent" },
  },
  XUt = {
    main: "hsl(var(--secondary))",
    gradient: { start: "hsl(var(--secondary))", end: "transparent" },
  },
  QUt = (e) => (e / 100).toFixed(2),
  JUt = ({ active: e, payload: t, label: n }) => {
    const { t: i } = Py();
    return e && t && t.length
      ? Q.jsxs("div", {
          className: "rounded-lg border bg-background p-3 shadow-sm",
          children: [
            Q.jsx("div", { className: "mb-2 text-sm font-medium", children: n }),
            t.map((e, t) =>
              Q.jsxs(
                "div",
                {
                  className: "flex items-center gap-2 text-sm",
                  children: [
                    Q.jsx("div", {
                      className: "h-2 w-2 rounded-full",
                      style: { backgroundColor: e.color },
                    }),
                    Q.jsxs("span", {
                      className: "text-muted-foreground",
                      children: [i(e.name), ":"],
                    }),
                    Q.jsx("span", {
                      className: "font-medium",
                      children: e.name.includes(i("dashboard:overview.amount"))
                        ? `¥${QUt(e.value)}`
                        : i("dashboard:overview.transactions", { count: e.value }),
                    }),
                  ],
                },
                t,
              ),
            ),
          ],
        })
      : null;
  },
  e$t = [
    { value: "7d", label: "dashboard:overview.last7Days" },
    { value: "30d", label: "dashboard:overview.last30Days" },
    { value: "90d", label: "dashboard:overview.last90Days" },
    { value: "180d", label: "dashboard:overview.last180Days" },
    { value: "365d", label: "dashboard:overview.lastYear" },
    { value: "custom", label: "dashboard:overview.customRange" },
  ];
function t$t() {
  const [e, t] = H.useState("amount"),
    [n, i] = H.useState("30d"),
    [r, o] = H.useState({ from: vS(new Date(), 7), to: new Date() }),
    { t: s } = Py(),
    { startDate: a, endDate: l } = ((e, t) => {
      const n = ES(new Date());
      if ("custom" === e && t) {
        const e = new Date(t.from.getFullYear(), t.from.getMonth(), t.from.getDate()),
          n = new Date(t.to.getFullYear(), t.to.getMonth(), t.to.getDate());
        return { startDate: NS(e), endDate: NS(n) };
      }
      let i;
      switch (e) {
        case "7d":
          i = vS(n, 7);
          break;
        case "30d":
        default:
          i = vS(n, 30);
          break;
        case "90d":
          i = vS(n, 90);
          break;
        case "180d":
          i = vS(n, 180);
          break;
        case "365d":
          i = vS(n, 365);
      }
      return { startDate: NS(i), endDate: NS(n) };
    })(n, r),
    c = (e) => mS(ES(e), "yyyy-MM-dd"),
    { data: d } = gC({
      queryKey: ["orderStat", { start_date: c(a), end_date: c(l) }],
      queryFn: async () => {
        const { data: e } = await ML({ start_date: c(a), end_date: c(l) });
        return e;
      },
      refetchInterval: 3e4,
    });
  return Q.jsxs(q6e, {
    children: [
      Q.jsx(K6e, {
        children: Q.jsxs("div", {
          className: "flex items-center justify-between",
          children: [
            Q.jsxs("div", {
              children: [
                Q.jsx(G6e, { children: s("dashboard:overview.title") }),
                Q.jsxs(Z6e, {
                  children: [
                    d?.summary.start_date,
                    " ",
                    s("dashboard:overview.to"),
                    " ",
                    d?.summary.end_date,
                  ],
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "flex items-center gap-2",
              children: [
                Q.jsxs("div", {
                  className: "flex min-w-0 items-center gap-1",
                  children: [
                    Q.jsxs(THt, {
                      value: n,
                      onValueChange: (e) => i(e),
                      children: [
                        Q.jsx(OHt, {
                          className: "w-[120px]",
                          children: Q.jsx(RHt, {
                            placeholder: s("dashboard:overview.selectTimeRange"),
                          }),
                        }),
                        Q.jsx(PHt, {
                          children: e$t.map((e) =>
                            Q.jsx(FHt, { value: e.value, children: s(e.label) }, e.value),
                          ),
                        }),
                      ],
                    }),
                    "custom" === n &&
                      Q.jsxs(qUt, {
                        children: [
                          Q.jsx(KUt, {
                            asChild: !0,
                            children: Q.jsxs(ltt, {
                              variant: "outline",
                              className: Rf(
                                "min-w-0 justify-start text-left font-normal",
                                !r && "text-muted-foreground",
                              ),
                              children: [
                                Q.jsx(sat, { className: "mr-2 h-4 w-4 flex-shrink-0" }),
                                Q.jsx("span", {
                                  className: "truncate",
                                  children: r?.from
                                    ? r.to
                                      ? Q.jsxs(Q.Fragment, {
                                          children: [
                                            mS(r.from, "yyyy-MM-dd"),
                                            " -",
                                            " ",
                                            mS(r.to, "yyyy-MM-dd"),
                                          ],
                                        })
                                      : mS(r.from, "yyyy-MM-dd")
                                    : s("dashboard:overview.selectDate"),
                                }),
                              ],
                            }),
                          }),
                          Q.jsx(ZUt, {
                            className: "w-auto p-0",
                            align: "end",
                            children: Q.jsx(mUt, {
                              mode: "range",
                              defaultMonth: r?.from,
                              selected: { from: r?.from, to: r?.to },
                              onSelect: (e) => {
                                e?.from && e?.to && o({ from: e.from, to: e.to });
                              },
                              captionLayout: "dropdown",
                              numberOfMonths: 2,
                            }),
                          }),
                        ],
                      }),
                  ],
                }),
                Q.jsx(iw, {
                  value: e,
                  onValueChange: (e) => t(e),
                  children: Q.jsxs(rw, {
                    children: [
                      Q.jsx(ow, { value: "amount", children: s("dashboard:overview.amount") }),
                      Q.jsx(ow, { value: "count", children: s("dashboard:overview.count") }),
                    ],
                  }),
                }),
              ],
            }),
          ],
        }),
      }),
      Q.jsxs(Y6e, {
        children: [
          Q.jsxs("div", {
            className: "grid grid-cols-2 gap-4",
            children: [
              Q.jsxs("div", {
                className: "space-y-1",
                children: [
                  Q.jsx("div", {
                    className: "text-sm text-muted-foreground",
                    children: s("dashboard:overview.totalIncome"),
                  }),
                  Q.jsxs("div", {
                    className: "text-2xl font-bold",
                    children: ["¥", QUt(d?.summary?.paid_total || 0)],
                  }),
                  Q.jsx("div", {
                    className: "text-xs text-muted-foreground",
                    children: s("dashboard:overview.totalTransactions", {
                      count: d?.summary?.paid_count || 0,
                    }),
                  }),
                  Q.jsxs("div", {
                    className: "text-xs text-muted-foreground",
                    children: [
                      s("dashboard:overview.avgOrderAmount"),
                      " ¥",
                      QUt(d?.summary?.avg_paid_amount || 0),
                    ],
                  }),
                ],
              }),
              Q.jsxs("div", {
                className: "space-y-1",
                children: [
                  Q.jsx("div", {
                    className: "text-sm text-muted-foreground",
                    children: s("dashboard:overview.totalCommission"),
                  }),
                  Q.jsxs("div", {
                    className: "text-2xl font-bold",
                    children: ["¥", QUt(d?.summary?.commission_total || 0)],
                  }),
                  Q.jsx("div", {
                    className: "text-xs text-muted-foreground",
                    children: s("dashboard:overview.totalTransactions", {
                      count: d?.summary?.commission_count || 0,
                    }),
                  }),
                  Q.jsxs("div", {
                    className: "text-xs text-muted-foreground",
                    children: [
                      s("dashboard:overview.commissionRate"),
                      " ",
                      d?.summary?.commission_rate.toFixed(2) || 0,
                      "%",
                    ],
                  }),
                ],
              }),
            ],
          }),
          Q.jsx("div", {
            className: "h-[400px] w-full",
            children: Q.jsx(WCt, {
              width: "100%",
              height: "100%",
              children: Q.jsxs(lWt, {
                data: d?.list || [],
                margin: { top: 20, right: 20, left: 0, bottom: 0 },
                children: [
                  Q.jsxs("defs", {
                    children: [
                      Q.jsxs("linearGradient", {
                        id: "incomeGradient",
                        x1: "0",
                        y1: "0",
                        x2: "0",
                        y2: "1",
                        children: [
                          Q.jsx("stop", {
                            offset: "0%",
                            stopColor: YUt.gradient.start,
                            stopOpacity: 0.2,
                          }),
                          Q.jsx("stop", {
                            offset: "100%",
                            stopColor: YUt.gradient.end,
                            stopOpacity: 0.1,
                          }),
                        ],
                      }),
                      Q.jsxs("linearGradient", {
                        id: "commissionGradient",
                        x1: "0",
                        y1: "0",
                        x2: "0",
                        y2: "1",
                        children: [
                          Q.jsx("stop", {
                            offset: "0%",
                            stopColor: XUt.gradient.start,
                            stopOpacity: 0.2,
                          }),
                          Q.jsx("stop", {
                            offset: "100%",
                            stopColor: XUt.gradient.end,
                            stopOpacity: 0.1,
                          }),
                        ],
                      }),
                    ],
                  }),
                  Q.jsx(JBt, {
                    dataKey: "date",
                    axisLine: !1,
                    tickLine: !1,
                    tick: { fill: "hsl(var(--muted-foreground))", fontSize: 12 },
                    tickFormatter: (e) => mS(new Date(e), "MM-dd", { locale: qHt }),
                  }),
                  Q.jsx(dVt, {
                    axisLine: !1,
                    tickLine: !1,
                    tick: { fill: "hsl(var(--muted-foreground))", fontSize: 12 },
                    tickFormatter: (t) =>
                      "amount" === e
                        ? `¥${QUt(t)}`
                        : s("dashboard:overview.transactions", { count: t }),
                  }),
                  Q.jsx(FFt, {
                    strokeDasharray: "3 3",
                    vertical: !1,
                    stroke: "hsl(var(--border))",
                    opacity: 0.3,
                  }),
                  Q.jsx(dCt, { content: Q.jsx(JUt, {}) }),
                  "amount" === e
                    ? Q.jsxs(Q.Fragment, {
                        children: [
                          Q.jsx(_Bt, {
                            type: "monotone",
                            dataKey: "paid_total",
                            name: s("dashboard:overview.orderAmount"),
                            stroke: YUt.main,
                            fill: "url(#incomeGradient)",
                            strokeWidth: 2,
                          }),
                          Q.jsx(_Bt, {
                            type: "monotone",
                            dataKey: "commission_total",
                            name: s("dashboard:overview.commissionAmount"),
                            stroke: XUt.main,
                            fill: "url(#commissionGradient)",
                            strokeWidth: 2,
                          }),
                        ],
                      })
                    : Q.jsxs(Q.Fragment, {
                        children: [
                          Q.jsx(RPt, {
                            dataKey: "paid_count",
                            name: s("dashboard:overview.orderCount"),
                            fill: YUt.main,
                            radius: [4, 4, 0, 0],
                            maxBarSize: 40,
                          }),
                          Q.jsx(RPt, {
                            dataKey: "commission_count",
                            name: s("dashboard:overview.commissionCount"),
                            fill: XUt.main,
                            radius: [4, 4, 0, 0],
                            maxBarSize: 40,
                          }),
                        ],
                      }),
                ],
              }),
            }),
          }),
        ],
      }),
    ],
  });
}
function n$t({ className: e, ...t }) {
  return Q.jsx("div", { className: Rf("animate-pulse rounded-md bg-primary/10", e), ...t });
}
function i$t() {
  return Q.jsxs(q6e, {
    children: [
      Q.jsxs(K6e, {
        className: "flex flex-row items-center justify-between space-y-0 pb-2",
        children: [
          Q.jsx(n$t, { className: "h-4 w-[120px]" }),
          Q.jsx(n$t, { className: "h-4 w-4" }),
        ],
      }),
      Q.jsxs(Y6e, {
        children: [
          Q.jsx(n$t, { className: "h-8 w-[140px] mb-2" }),
          Q.jsxs("div", {
            className: "flex items-center gap-2",
            children: [
              Q.jsx(n$t, { className: "h-4 w-4" }),
              Q.jsx(n$t, { className: "h-4 w-[100px]" }),
            ],
          }),
        ],
      }),
    ],
  });
}
function r$t() {
  return Q.jsx("div", {
    className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
    children: Array.from({ length: 8 }).map((e, t) => Q.jsx(i$t, {}, t)),
  });
}
var o$t = ((e) => (
  (e[(e.PENDING = 0)] = "PENDING"),
  (e[(e.PROCESSING = 1)] = "PROCESSING"),
  (e[(e.CANCELLED = 2)] = "CANCELLED"),
  (e[(e.COMPLETED = 3)] = "COMPLETED"),
  (e[(e.DISCOUNTED = 4)] = "DISCOUNTED"),
  e
))(o$t || {});
const s$t = () => ({
    0: aL.t("order:status.PENDING"),
    1: aL.t("order:status.PROCESSING"),
    2: aL.t("order:status.CANCELLED"),
    3: aL.t("order:status.COMPLETED"),
    4: aL.t("order:status.DISCOUNTED"),
  }),
  a$t = { 0: "yellow-500", 1: "blue-500", 2: "red-500", 3: "green-500", 4: "green-500" };
var l$t = ((e) => (
    (e[(e.NEW = 1)] = "NEW"),
    (e[(e.RENEWAL = 2)] = "RENEWAL"),
    (e[(e.UPGRADE = 3)] = "UPGRADE"),
    (e[(e.RESET_FLOW = 4)] = "RESET_FLOW"),
    e
  ))(l$t || {}),
  c$t = ((e) => (
    (e[(e.PENDING = 0)] = "PENDING"),
    (e[(e.PROCESSING = 1)] = "PROCESSING"),
    (e[(e.VALID = 2)] = "VALID"),
    (e[(e.INVALID = 3)] = "INVALID"),
    e
  ))(c$t || {});
const d$t = () => ({
    0: aL.t("order:commission.PENDING"),
    1: aL.t("order:commission.PROCESSING"),
    2: aL.t("order:commission.VALID"),
    3: aL.t("order:commission.INVALID"),
  }),
  u$t = { 0: "yellow-500", 1: "blue-500", 2: "green-500", 3: "red-500" };
var h$t = ((e) => (
    (e.MONTH_PRICE = "month_price"),
    (e.QUARTER_PRICE = "quarter_price"),
    (e.HALF_YEAR_PRICE = "half_year_price"),
    (e.YEAR_PRICE = "year_price"),
    (e.TWO_YEAR_PRICE = "two_year_price"),
    (e.THREE_YEAR_PRICE = "three_year_price"),
    (e.ONETIME_PRICE = "onetime_price"),
    (e.RESET_PRICE = "reset_price"),
    e
  ))(h$t || {}),
  g$t = ((e) => (
    (e.Shadowsocks = "shadowsocks"),
    (e.Vmess = "vmess"),
    (e.Trojan = "trojan"),
    (e.Hysteria = "hysteria"),
    (e.Vless = "vless"),
    (e.Tuic = "tuic"),
    (e.Socks = "socks"),
    (e.Naive = "naive"),
    (e.Http = "http"),
    (e.Mieru = "mieru"),
    (e.AnyTLS = "anytls"),
    e
  ))(g$t || {});
const p$t = [
    { type: "shadowsocks", label: "Shadowsocks" },
    { type: "vmess", label: "VMess" },
    { type: "trojan", label: "Trojan" },
    { type: "hysteria", label: "Hysteria" },
    { type: "vless", label: "VLess" },
    { type: "tuic", label: "TUIC" },
    { type: "socks", label: "SOCKS" },
    { type: "naive", label: "Naive" },
    { type: "http", label: "HTTP" },
    { type: "mieru", label: "Mieru" },
    { type: "anytls", label: "AnyTLS" },
  ],
  f$t = {
    shadowsocks: "#489851",
    vmess: "#CB3180",
    trojan: "#EBB749",
    hysteria: "#5684e6",
    vless: "#1a1a1a",
    tuic: "#00C853",
    socks: "#2196F3",
    naive: "#9C27B0",
    http: "#FF5722",
    mieru: "#4CAF50",
    anytls: "#7E57C2",
  };
var m$t = ((e) => ((e[(e.AMOUNT = 1)] = "AMOUNT"), (e[(e.PERCENTAGE = 2)] = "PERCENTAGE"), e))(
  m$t || {},
);
var _$t = ((e) => ((e[(e.OPENING = 0)] = "OPENING"), (e[(e.CLOSED = 1)] = "CLOSED"), e))(_$t || {}),
  v$t = ((e) => (
    (e[(e.LOW = 0)] = "LOW"),
    (e[(e.MIDDLE = 1)] = "MIDDLE"),
    (e[(e.HIGH = 2)] = "HIGH"),
    e
  ))(v$t || {}),
  b$t = ((e) => (
    (e.MONTH = "monthly"),
    (e.QUARTER = "quarterly"),
    (e.HALF_YEAR = "half_yearly"),
    (e.YEAR = "yearly"),
    (e.TWO_YEAR = "two_yearly"),
    (e.THREE_YEAR = "three_yearly"),
    (e.ONETIME = "onetime"),
    (e.RESET = "reset_traffic"),
    e
  ))(b$t || {});
function y$t({
  title: e,
  value: t,
  icon: n,
  trend: i,
  description: r,
  onClick: o,
  highlight: s,
  className: a,
}) {
  return Q.jsxs(q6e, {
    className: Rf(
      "transition-colors",
      o && "cursor-pointer hover:bg-muted/50",
      s && "border-primary/50",
      a,
    ),
    onClick: o,
    children: [
      Q.jsxs(K6e, {
        className: "flex flex-row items-center justify-between space-y-0 pb-2",
        children: [Q.jsx(G6e, { className: "text-sm font-medium", children: e }), n],
      }),
      Q.jsxs(Y6e, {
        children: [
          Q.jsx("div", { className: "text-2xl font-bold", children: t }),
          i
            ? Q.jsxs("div", {
                className: "flex items-center pt-1",
                children: [
                  Q.jsx(olt, {
                    className: Rf("h-4 w-4", i.isPositive ? "text-emerald-500" : "text-red-500"),
                  }),
                  Q.jsxs("span", {
                    className: Rf(
                      "ml-1 text-xs",
                      i.isPositive ? "text-emerald-500" : "text-red-500",
                    ),
                    children: [i.isPositive ? "+" : "-", Math.abs(i.value), "%"],
                  }),
                  Q.jsx("span", {
                    className: "ml-1 text-xs text-muted-foreground",
                    children: i.label,
                  }),
                ],
              })
            : Q.jsx("p", { className: "text-xs text-muted-foreground", children: r }),
        ],
      }),
    ],
  });
}
function x$t({ className: e }) {
  const t = og(),
    { t: n } = Py(),
    { data: i, isLoading: r } = gC({
      queryKey: ["dashboardStats"],
      queryFn: async () => (await AL()).data,
      refetchInterval: 3e5,
    });
  if (r || !i) return Q.jsx(r$t, {});
  return Q.jsxs("div", {
    className: Rf("grid gap-4 md:grid-cols-2 lg:grid-cols-4", e),
    children: [
      Q.jsx(y$t, {
        title: n("dashboard:stats.pendingTickets"),
        value: i.ticketPendingTotal,
        icon: Q.jsx(Pat, {
          className: Rf(
            "h-4 w-4",
            i.ticketPendingTotal > 0 ? "text-orange-500" : "text-muted-foreground",
          ),
        }),
        description:
          i.ticketPendingTotal > 0
            ? n("dashboard:stats.hasPendingTickets")
            : n("dashboard:stats.noPendingTickets"),
        onClick: () => t("/user/ticket"),
        highlight: i.ticketPendingTotal > 0,
      }),
      Q.jsx(y$t, {
        title: n("dashboard:stats.totalUsers"),
        value: i.totalUsers,
        icon: Q.jsx(dlt, { className: "h-4 w-4 text-muted-foreground" }),
        description: n("dashboard:stats.activeUsers", { count: i.activeUsers }),
      }),
      Q.jsx(y$t, {
        title: n("dashboard:stats.monthlyUpload"),
        value: IS(i.monthTraffic.upload),
        icon: Q.jsx(alt, { className: "h-4 w-4 text-emerald-500" }),
        description: n("dashboard:stats.todayTraffic", { value: IS(i.todayTraffic.upload) }),
      }),
      Q.jsx(y$t, {
        title: n("dashboard:stats.monthlyDownload"),
        value: IS(i.monthTraffic.download),
        icon: Q.jsx(wat, { className: "h-4 w-4 text-blue-500" }),
        description: n("dashboard:stats.todayTraffic", { value: IS(i.todayTraffic.download) }),
      }),
    ],
  });
}
var w$t = "ScrollArea",
  [C$t] = Jy(w$t),
  [S$t, k$t] = C$t(w$t),
  E$t = H.forwardRef((e, t) => {
    const { __scopeScrollArea: n, type: i = "hover", dir: r, scrollHideDelay: o = 600, ...s } = e,
      [a, l] = H.useState(null),
      [c, d] = H.useState(null),
      [u, h] = H.useState(null),
      [g, p] = H.useState(null),
      [f, m] = H.useState(null),
      [_, v] = H.useState(0),
      [b, y] = H.useState(0),
      [x, w] = H.useState(!1),
      [C, S] = H.useState(!1),
      k = Sp(t, (e) => l(e)),
      E = bx(r);
    return Q.jsx(S$t, {
      scope: n,
      type: i,
      dir: E,
      scrollHideDelay: o,
      scrollArea: a,
      viewport: c,
      onViewportChange: d,
      content: u,
      onContentChange: h,
      scrollbarX: g,
      onScrollbarXChange: p,
      scrollbarXEnabled: x,
      onScrollbarXEnabledChange: w,
      scrollbarY: f,
      onScrollbarYChange: m,
      scrollbarYEnabled: C,
      onScrollbarYEnabledChange: S,
      onCornerWidthChange: v,
      onCornerHeightChange: y,
      children: Q.jsx(gx.div, {
        dir: E,
        ...s,
        ref: k,
        style: {
          position: "relative",
          "--radix-scroll-area-corner-width": _ + "px",
          "--radix-scroll-area-corner-height": b + "px",
          ...e.style,
        },
      }),
    });
  });
E$t.displayName = w$t;
var N$t = "ScrollAreaViewport",
  L$t = H.forwardRef((e, t) => {
    const { __scopeScrollArea: n, children: i, nonce: r, ...o } = e,
      s = k$t(N$t, n),
      a = Sp(t, H.useRef(null), s.onViewportChange);
    return Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx("style", {
          dangerouslySetInnerHTML: {
            __html:
              "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}",
          },
          nonce: r,
        }),
        Q.jsx(gx.div, {
          "data-radix-scroll-area-viewport": "",
          ...o,
          ref: a,
          style: {
            overflowX: s.scrollbarXEnabled ? "scroll" : "hidden",
            overflowY: s.scrollbarYEnabled ? "scroll" : "hidden",
            ...e.style,
          },
          children: Q.jsx("div", {
            ref: s.onContentChange,
            style: { minWidth: "100%", display: "table" },
            children: i,
          }),
        }),
      ],
    });
  });
L$t.displayName = N$t;
var D$t = "ScrollAreaScrollbar",
  T$t = H.forwardRef((e, t) => {
    const { forceMount: n, ...i } = e,
      r = k$t(D$t, e.__scopeScrollArea),
      { onScrollbarXEnabledChange: o, onScrollbarYEnabledChange: s } = r,
      a = "horizontal" === e.orientation;
    return (
      H.useEffect(
        () => (
          a ? o(!0) : s(!0),
          () => {
            a ? o(!1) : s(!1);
          }
        ),
        [a, o, s],
      ),
      "hover" === r.type
        ? Q.jsx(I$t, { ...i, ref: t, forceMount: n })
        : "scroll" === r.type
          ? Q.jsx(R$t, { ...i, ref: t, forceMount: n })
          : "auto" === r.type
            ? Q.jsx(O$t, { ...i, ref: t, forceMount: n })
            : "always" === r.type
              ? Q.jsx(M$t, { ...i, ref: t })
              : null
    );
  });
T$t.displayName = D$t;
var I$t = H.forwardRef((e, t) => {
    const { forceMount: n, ...i } = e,
      r = k$t(D$t, e.__scopeScrollArea),
      [o, s] = H.useState(!1);
    return (
      H.useEffect(() => {
        const e = r.scrollArea;
        let t = 0;
        if (e) {
          const n = () => {
              (window.clearTimeout(t), s(!0));
            },
            i = () => {
              t = window.setTimeout(() => s(!1), r.scrollHideDelay);
            };
          return (
            e.addEventListener("pointerenter", n),
            e.addEventListener("pointerleave", i),
            () => {
              (window.clearTimeout(t),
                e.removeEventListener("pointerenter", n),
                e.removeEventListener("pointerleave", i));
            }
          );
        }
      }, [r.scrollArea, r.scrollHideDelay]),
      Q.jsx(Fx, {
        present: n || o,
        children: Q.jsx(O$t, { "data-state": o ? "visible" : "hidden", ...i, ref: t }),
      })
    );
  }),
  R$t = H.forwardRef((e, t) => {
    const { forceMount: n, ...i } = e,
      r = k$t(D$t, e.__scopeScrollArea),
      o = "horizontal" === e.orientation,
      s = J$t(() => l("SCROLL_END"), 100),
      [a, l] = (function (e, t) {
        return H.useReducer((e, n) => t[e][n] ?? e, e);
      })("hidden", {
        hidden: { SCROLL: "scrolling" },
        scrolling: { SCROLL_END: "idle", POINTER_ENTER: "interacting" },
        interacting: { SCROLL: "interacting", POINTER_LEAVE: "idle" },
        idle: { HIDE: "hidden", SCROLL: "scrolling", POINTER_ENTER: "interacting" },
      });
    return (
      H.useEffect(() => {
        if ("idle" === a) {
          const e = window.setTimeout(() => l("HIDE"), r.scrollHideDelay);
          return () => window.clearTimeout(e);
        }
      }, [a, r.scrollHideDelay, l]),
      H.useEffect(() => {
        const e = r.viewport,
          t = o ? "scrollLeft" : "scrollTop";
        if (e) {
          let n = e[t];
          const i = () => {
            const i = e[t];
            (n !== i && (l("SCROLL"), s()), (n = i));
          };
          return (e.addEventListener("scroll", i), () => e.removeEventListener("scroll", i));
        }
      }, [r.viewport, o, l, s]),
      Q.jsx(Fx, {
        present: n || "hidden" !== a,
        children: Q.jsx(M$t, {
          "data-state": "hidden" === a ? "hidden" : "visible",
          ...i,
          ref: t,
          onPointerEnter: Qy(e.onPointerEnter, () => l("POINTER_ENTER")),
          onPointerLeave: Qy(e.onPointerLeave, () => l("POINTER_LEAVE")),
        }),
      })
    );
  }),
  O$t = H.forwardRef((e, t) => {
    const n = k$t(D$t, e.__scopeScrollArea),
      { forceMount: i, ...r } = e,
      [o, s] = H.useState(!1),
      a = "horizontal" === e.orientation,
      l = J$t(() => {
        if (n.viewport) {
          const e = n.viewport.offsetWidth < n.viewport.scrollWidth,
            t = n.viewport.offsetHeight < n.viewport.scrollHeight;
          s(a ? e : t);
        }
      }, 10);
    return (
      eqt(n.viewport, l),
      eqt(n.content, l),
      Q.jsx(Fx, {
        present: i || o,
        children: Q.jsx(M$t, { "data-state": o ? "visible" : "hidden", ...r, ref: t }),
      })
    );
  }),
  M$t = H.forwardRef((e, t) => {
    const { orientation: n = "vertical", ...i } = e,
      r = k$t(D$t, e.__scopeScrollArea),
      o = H.useRef(null),
      s = H.useRef(0),
      [a, l] = H.useState({
        content: 0,
        viewport: 0,
        scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 },
      }),
      c = K$t(a.viewport, a.content),
      d = {
        ...i,
        sizes: a,
        onSizesChange: l,
        hasThumb: Boolean(c > 0 && c < 1),
        onThumbChange: (e) => (o.current = e),
        onThumbPointerUp: () => (s.current = 0),
        onThumbPointerDown: (e) => (s.current = e),
      };
    function u(e, t) {
      return (function (e, t, n, i = "ltr") {
        const r = G$t(n),
          o = r / 2,
          s = t || o,
          a = r - s,
          l = n.scrollbar.paddingStart + s,
          c = n.scrollbar.size - n.scrollbar.paddingEnd - a,
          d = n.content - n.viewport,
          u = "ltr" === i ? [0, d] : [-1 * d, 0],
          h = Y$t([l, c], u);
        return h(e);
      })(e, s.current, a, t);
    }
    return "horizontal" === n
      ? Q.jsx(A$t, {
          ...d,
          ref: t,
          onThumbPositionChange: () => {
            if (r.viewport && o.current) {
              const e = Z$t(r.viewport.scrollLeft, a, r.dir);
              o.current.style.transform = `translate3d(${e}px, 0, 0)`;
            }
          },
          onWheelScroll: (e) => {
            r.viewport && (r.viewport.scrollLeft = e);
          },
          onDragScroll: (e) => {
            r.viewport && (r.viewport.scrollLeft = u(e, r.dir));
          },
        })
      : "vertical" === n
        ? Q.jsx(P$t, {
            ...d,
            ref: t,
            onThumbPositionChange: () => {
              if (r.viewport && o.current) {
                const e = Z$t(r.viewport.scrollTop, a);
                o.current.style.transform = `translate3d(0, ${e}px, 0)`;
              }
            },
            onWheelScroll: (e) => {
              r.viewport && (r.viewport.scrollTop = e);
            },
            onDragScroll: (e) => {
              r.viewport && (r.viewport.scrollTop = u(e));
            },
          })
        : null;
  }),
  A$t = H.forwardRef((e, t) => {
    const { sizes: n, onSizesChange: i, ...r } = e,
      o = k$t(D$t, e.__scopeScrollArea),
      [s, a] = H.useState(),
      l = H.useRef(null),
      c = Sp(t, l, o.onScrollbarXChange);
    return (
      H.useEffect(() => {
        l.current && a(getComputedStyle(l.current));
      }, [l]),
      Q.jsx(B$t, {
        "data-orientation": "horizontal",
        ...r,
        ref: c,
        sizes: n,
        style: {
          bottom: 0,
          left: "rtl" === o.dir ? "var(--radix-scroll-area-corner-width)" : 0,
          right: "ltr" === o.dir ? "var(--radix-scroll-area-corner-width)" : 0,
          "--radix-scroll-area-thumb-width": G$t(n) + "px",
          ...e.style,
        },
        onThumbPointerDown: (t) => e.onThumbPointerDown(t.x),
        onDragScroll: (t) => e.onDragScroll(t.x),
        onWheelScroll: (t, n) => {
          if (o.viewport) {
            const i = o.viewport.scrollLeft + t.deltaX;
            (e.onWheelScroll(i), X$t(i, n) && t.preventDefault());
          }
        },
        onResize: () => {
          l.current &&
            o.viewport &&
            s &&
            i({
              content: o.viewport.scrollWidth,
              viewport: o.viewport.offsetWidth,
              scrollbar: {
                size: l.current.clientWidth,
                paddingStart: q$t(s.paddingLeft),
                paddingEnd: q$t(s.paddingRight),
              },
            });
        },
      })
    );
  }),
  P$t = H.forwardRef((e, t) => {
    const { sizes: n, onSizesChange: i, ...r } = e,
      o = k$t(D$t, e.__scopeScrollArea),
      [s, a] = H.useState(),
      l = H.useRef(null),
      c = Sp(t, l, o.onScrollbarYChange);
    return (
      H.useEffect(() => {
        l.current && a(getComputedStyle(l.current));
      }, [l]),
      Q.jsx(B$t, {
        "data-orientation": "vertical",
        ...r,
        ref: c,
        sizes: n,
        style: {
          top: 0,
          right: "ltr" === o.dir ? 0 : void 0,
          left: "rtl" === o.dir ? 0 : void 0,
          bottom: "var(--radix-scroll-area-corner-height)",
          "--radix-scroll-area-thumb-height": G$t(n) + "px",
          ...e.style,
        },
        onThumbPointerDown: (t) => e.onThumbPointerDown(t.y),
        onDragScroll: (t) => e.onDragScroll(t.y),
        onWheelScroll: (t, n) => {
          if (o.viewport) {
            const i = o.viewport.scrollTop + t.deltaY;
            (e.onWheelScroll(i), X$t(i, n) && t.preventDefault());
          }
        },
        onResize: () => {
          l.current &&
            o.viewport &&
            s &&
            i({
              content: o.viewport.scrollHeight,
              viewport: o.viewport.offsetHeight,
              scrollbar: {
                size: l.current.clientHeight,
                paddingStart: q$t(s.paddingTop),
                paddingEnd: q$t(s.paddingBottom),
              },
            });
        },
      })
    );
  }),
  [j$t, F$t] = C$t(D$t),
  B$t = H.forwardRef((e, t) => {
    const {
        __scopeScrollArea: n,
        sizes: i,
        hasThumb: r,
        onThumbChange: o,
        onThumbPointerUp: s,
        onThumbPointerDown: a,
        onThumbPositionChange: l,
        onDragScroll: c,
        onWheelScroll: d,
        onResize: u,
        ...h
      } = e,
      g = k$t(D$t, n),
      [p, f] = H.useState(null),
      m = Sp(t, (e) => f(e)),
      _ = H.useRef(null),
      v = H.useRef(""),
      b = g.viewport,
      y = i.content - i.viewport,
      x = fx(d),
      w = fx(l),
      C = J$t(u, 10);
    function S(e) {
      if (_.current) {
        const t = e.clientX - _.current.left,
          n = e.clientY - _.current.top;
        c({ x: t, y: n });
      }
    }
    return (
      H.useEffect(() => {
        const e = (e) => {
          const t = e.target,
            n = p?.contains(t);
          n && x(e, y);
        };
        return (
          document.addEventListener("wheel", e, { passive: !1 }),
          () => document.removeEventListener("wheel", e, { passive: !1 })
        );
      }, [b, p, y, x]),
      H.useEffect(w, [i, w]),
      eqt(p, C),
      eqt(g.content, C),
      Q.jsx(j$t, {
        scope: n,
        scrollbar: p,
        hasThumb: r,
        onThumbChange: fx(o),
        onThumbPointerUp: fx(s),
        onThumbPositionChange: w,
        onThumbPointerDown: fx(a),
        children: Q.jsx(gx.div, {
          ...h,
          ref: m,
          style: { position: "absolute", ...h.style },
          onPointerDown: Qy(e.onPointerDown, (e) => {
            if (0 === e.button) {
              (e.target.setPointerCapture(e.pointerId),
                (_.current = p.getBoundingClientRect()),
                (v.current = document.body.style.webkitUserSelect),
                (document.body.style.webkitUserSelect = "none"),
                g.viewport && (g.viewport.style.scrollBehavior = "auto"),
                S(e));
            }
          }),
          onPointerMove: Qy(e.onPointerMove, S),
          onPointerUp: Qy(e.onPointerUp, (e) => {
            const t = e.target;
            (t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId),
              (document.body.style.webkitUserSelect = v.current),
              g.viewport && (g.viewport.style.scrollBehavior = ""),
              (_.current = null));
          }),
        }),
      })
    );
  }),
  V$t = "ScrollAreaThumb",
  W$t = H.forwardRef((e, t) => {
    const { forceMount: n, ...i } = e,
      r = F$t(V$t, e.__scopeScrollArea);
    return Q.jsx(Fx, { present: n || r.hasThumb, children: Q.jsx(H$t, { ref: t, ...i }) });
  }),
  H$t = H.forwardRef((e, t) => {
    const { __scopeScrollArea: n, style: i, ...r } = e,
      o = k$t(V$t, n),
      s = F$t(V$t, n),
      { onThumbPositionChange: a } = s,
      l = Sp(t, (e) => s.onThumbChange(e)),
      c = H.useRef(void 0),
      d = J$t(() => {
        c.current && (c.current(), (c.current = void 0));
      }, 100);
    return (
      H.useEffect(() => {
        const e = o.viewport;
        if (e) {
          const t = () => {
            if ((d(), !c.current)) {
              const t = Q$t(e, a);
              ((c.current = t), a());
            }
          };
          return (a(), e.addEventListener("scroll", t), () => e.removeEventListener("scroll", t));
        }
      }, [o.viewport, d, a]),
      Q.jsx(gx.div, {
        "data-state": s.hasThumb ? "visible" : "hidden",
        ...r,
        ref: l,
        style: {
          width: "var(--radix-scroll-area-thumb-width)",
          height: "var(--radix-scroll-area-thumb-height)",
          ...i,
        },
        onPointerDownCapture: Qy(e.onPointerDownCapture, (e) => {
          const t = e.target.getBoundingClientRect(),
            n = e.clientX - t.left,
            i = e.clientY - t.top;
          s.onThumbPointerDown({ x: n, y: i });
        }),
        onPointerUp: Qy(e.onPointerUp, s.onThumbPointerUp),
      })
    );
  });
W$t.displayName = V$t;
var z$t = "ScrollAreaCorner",
  U$t = H.forwardRef((e, t) => {
    const n = k$t(z$t, e.__scopeScrollArea),
      i = Boolean(n.scrollbarX && n.scrollbarY);
    return "scroll" !== n.type && i ? Q.jsx($$t, { ...e, ref: t }) : null;
  });
U$t.displayName = z$t;
var $$t = H.forwardRef((e, t) => {
  const { __scopeScrollArea: n, ...i } = e,
    r = k$t(z$t, n),
    [o, s] = H.useState(0),
    [a, l] = H.useState(0),
    c = Boolean(o && a);
  return (
    eqt(r.scrollbarX, () => {
      const e = r.scrollbarX?.offsetHeight || 0;
      (r.onCornerHeightChange(e), l(e));
    }),
    eqt(r.scrollbarY, () => {
      const e = r.scrollbarY?.offsetWidth || 0;
      (r.onCornerWidthChange(e), s(e));
    }),
    c
      ? Q.jsx(gx.div, {
          ...i,
          ref: t,
          style: {
            width: o,
            height: a,
            position: "absolute",
            right: "ltr" === r.dir ? 0 : void 0,
            left: "rtl" === r.dir ? 0 : void 0,
            bottom: 0,
            ...e.style,
          },
        })
      : null
  );
});
function q$t(e) {
  return e ? parseInt(e, 10) : 0;
}
function K$t(e, t) {
  const n = e / t;
  return isNaN(n) ? 0 : n;
}
function G$t(e) {
  const t = K$t(e.viewport, e.content),
    n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd,
    i = (e.scrollbar.size - n) * t;
  return Math.max(i, 18);
}
function Z$t(e, t, n = "ltr") {
  const i = G$t(t),
    r = t.scrollbar.paddingStart + t.scrollbar.paddingEnd,
    o = t.scrollbar.size - r,
    s = t.content - t.viewport,
    a = o - i,
    l = cWt(e, "ltr" === n ? [0, s] : [-1 * s, 0]);
  return Y$t([0, s], [0, a])(l);
}
function Y$t(e, t) {
  return (n) => {
    if (e[0] === e[1] || t[0] === t[1]) return t[0];
    const i = (t[1] - t[0]) / (e[1] - e[0]);
    return t[0] + i * (n - e[0]);
  };
}
function X$t(e, t) {
  return e > 0 && e < t;
}
var Q$t = (e, t = () => {}) => {
  let n = { left: e.scrollLeft, top: e.scrollTop },
    i = 0;
  return (
    (function r() {
      const o = { left: e.scrollLeft, top: e.scrollTop },
        s = n.left !== o.left,
        a = n.top !== o.top;
      ((s || a) && t(), (n = o), (i = window.requestAnimationFrame(r)));
    })(),
    () => window.cancelAnimationFrame(i)
  );
};
function J$t(e, t) {
  const n = fx(e),
    i = H.useRef(0);
  return (
    H.useEffect(() => () => window.clearTimeout(i.current), []),
    H.useCallback(() => {
      (window.clearTimeout(i.current), (i.current = window.setTimeout(n, t)));
    }, [n, t])
  );
}
function eqt(e, t) {
  const n = fx(t);
  sx(() => {
    let t = 0;
    if (e) {
      const i = new ResizeObserver(() => {
        (cancelAnimationFrame(t), (t = window.requestAnimationFrame(n)));
      });
      return (
        i.observe(e),
        () => {
          (window.cancelAnimationFrame(t), i.unobserve(e));
        }
      );
    }
  }, [e, n]);
}
var tqt = E$t,
  nqt = L$t,
  iqt = U$t;
const rqt = H.forwardRef(({ className: e, children: t, ...n }, i) =>
  Q.jsxs(tqt, {
    ref: i,
    className: Rf("relative overflow-hidden", e),
    ...n,
    children: [
      Q.jsx(nqt, { className: "h-full w-full rounded-[inherit]", children: t }),
      Q.jsx(oqt, {}),
      Q.jsx(iqt, {}),
    ],
  }),
);
rqt.displayName = tqt.displayName;
const oqt = H.forwardRef(({ className: e, orientation: t = "vertical", ...n }, i) =>
  Q.jsx(T$t, {
    ref: i,
    orientation: t,
    className: Rf(
      "flex touch-none select-none transition-colors",
      "vertical" === t && "h-full w-2.5 border-l border-l-transparent p-[1px]",
      "horizontal" === t && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
      e,
    ),
    ...n,
    children: Q.jsx(W$t, { className: "relative flex-1 rounded-full bg-border" }),
  }),
);
function sqt(e) {
  return Array.isArray(e)
    ? e
    : e && "object" == typeof e && "data" in e && Array.isArray(e.data)
      ? e.data
      : [];
}
oqt.displayName = T$t.displayName;
const aqt = {
  today: {
    getValue: () =>
      (function (e = new Date()) {
        const t = ES(e),
          n = new Date(t.getFullYear(), t.getMonth(), t.getDate()),
          i = new Date(n.getTime() + 864e5);
        return { start: NS(n), end: NS(i) };
      })(),
  },
  last7days: {
    getValue: () => {
      const e = ES(new Date());
      return { start: NS(vS(e, 7)), end: NS(e) };
    },
  },
  last30days: {
    getValue: () => {
      const e = ES(new Date());
      return { start: NS(vS(e, 30)), end: NS(e) };
    },
  },
  custom: { getValue: () => null },
};
function lqt({ selectedRange: e, customDateRange: t, onRangeChange: n, onCustomRangeChange: i }) {
  const { t: r } = Py(),
    o = {
      today: r("dashboard:trafficRank.today"),
      last7days: r("dashboard:trafficRank.last7days"),
      last30days: r("dashboard:trafficRank.last30days"),
      custom: r("dashboard:trafficRank.customRange"),
    };
  return Q.jsxs("div", {
    className: "flex min-w-0 flex-wrap items-center gap-1",
    children: [
      Q.jsxs(THt, {
        value: e,
        onValueChange: n,
        children: [
          Q.jsx(OHt, {
            className: "w-[120px]",
            children: Q.jsx(RHt, { placeholder: r("dashboard:trafficRank.selectTimeRange") }),
          }),
          Q.jsx(PHt, {
            position: "popper",
            className: "z-50",
            children: Object.entries(aqt).map(([e]) => Q.jsx(FHt, { value: e, children: o[e] }, e)),
          }),
        ],
      }),
      "custom" === e &&
        Q.jsxs(qUt, {
          children: [
            Q.jsx(KUt, {
              asChild: !0,
              children: Q.jsxs(ltt, {
                variant: "outline",
                className: Rf(
                  "min-w-0 justify-start text-left font-normal",
                  !t && "text-muted-foreground",
                ),
                children: [
                  Q.jsx(sat, { className: "mr-2 h-4 w-4 flex-shrink-0" }),
                  Q.jsx("span", {
                    className: "truncate",
                    children: t?.from
                      ? t.to
                        ? Q.jsxs(Q.Fragment, {
                            children: [mS(t.from, "yyyy-MM-dd"), " -", " ", mS(t.to, "yyyy-MM-dd")],
                          })
                        : mS(t.from, "yyyy-MM-dd")
                      : Q.jsx("span", { children: r("dashboard:trafficRank.selectDateRange") }),
                  }),
                ],
              }),
            }),
            Q.jsx(ZUt, {
              className: "w-auto p-0",
              align: "end",
              children: Q.jsx(mUt, {
                mode: "range",
                defaultMonth: t?.from,
                selected: { from: t?.from, to: t?.to },
                onSelect: (e) => {
                  e?.from && e?.to && i({ from: e.from, to: e.to });
                },
                numberOfMonths: 2,
              }),
            }),
          ],
        }),
    ],
  });
}
const cqt = (e) => `${(e / 1024 / 1024 / 1024).toFixed(2)} GB`;
function dqt({ className: e }) {
  const { t: t } = Py(),
    [n, i] = H.useState("today"),
    [r, o] = H.useState({ from: vS(new Date(), 7), to: new Date() }),
    [s, a] = H.useState("today"),
    [l, c] = H.useState({ from: vS(new Date(), 7), to: new Date() }),
    d = H.useMemo(() => {
      if ("custom" === n) {
        const e = new Date(r.from.getFullYear(), r.from.getMonth(), r.from.getDate()),
          t = bC(new Date(r.to.getFullYear(), r.to.getMonth(), r.to.getDate()), 1);
        return { start: NS(e), end: NS(t) };
      }
      return aqt[n].getValue();
    }, [n, r]),
    u = H.useMemo(() => {
      if ("custom" === s) {
        const e = new Date(l.from.getFullYear(), l.from.getMonth(), l.from.getDate()),
          t = bC(new Date(l.to.getFullYear(), l.to.getMonth(), l.to.getDate()), 1);
        return { start: NS(e), end: NS(t) };
      }
      return aqt[s].getValue();
    }, [s, l]),
    h = gC({
      queryKey: ["nodeTrafficRank", d.start, d.end],
      queryFn: async () => {
        const e = await PL({
          type: "node",
          start_time: kT.round(d.start.getTime() / 1e3),
          end_time: kT.round(d.end.getTime() / 1e3),
        });
        return sqt(e?.data);
      },
      refetchInterval: 3e4,
    }),
    g = gC({
      queryKey: ["userTrafficRank", u.start, u.end],
      queryFn: async () => {
        const e = await PL({
          type: "user",
          start_time: kT.round(u.start.getTime() / 1e3),
          end_time: kT.round(u.end.getTime() / 1e3),
        });
        return sqt(e?.data);
      },
      refetchInterval: 3e4,
    }),
    p = h.data ?? [],
    f = g.data ?? [],
    m = p[0]?.value || 1,
    _ = f[0]?.value || 1;
  return Q.jsxs("div", {
    className: Rf("grid gap-4 md:grid-cols-2", e),
    children: [
      Q.jsxs(q6e, {
        children: [
          Q.jsx(K6e, {
            className: "flex-none pb-2",
            children: Q.jsxs("div", {
              className: "flex flex-wrap items-center justify-between gap-2",
              children: [
                Q.jsxs(G6e, {
                  className: "flex items-center text-base font-medium",
                  children: [
                    Q.jsx(jat, { className: "mr-2 h-4 w-4" }),
                    t("dashboard:trafficRank.nodeTrafficRank"),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex min-w-0 items-center gap-1",
                  children: [
                    Q.jsx(lqt, {
                      selectedRange: n,
                      customDateRange: r,
                      onRangeChange: i,
                      onCustomRangeChange: o,
                    }),
                    Q.jsx(Qst, { className: "h-4 w-4 flex-shrink-0 text-muted-foreground" }),
                  ],
                }),
              ],
            }),
          }),
          Q.jsx(Y6e, {
            className: "flex-1",
            children: p.length
              ? Q.jsxs(rqt, {
                  className: "h-[400px] pr-4",
                  children: [
                    Q.jsx("div", {
                      className: "space-y-3",
                      children: p.map((e) =>
                        Q.jsx(
                          Pst,
                          {
                            delayDuration: 200,
                            children: Q.jsxs(jst, {
                              children: [
                                Q.jsx(Fst, {
                                  asChild: !0,
                                  children: Q.jsx("div", {
                                    className:
                                      "flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",
                                    children: Q.jsxs("div", {
                                      className: "min-w-0 flex-1",
                                      children: [
                                        Q.jsxs("div", {
                                          className: "flex items-center justify-between",
                                          children: [
                                            Q.jsx("span", {
                                              className: "truncate text-sm font-medium",
                                              children: e.name,
                                            }),
                                            Q.jsxs("span", {
                                              className: Rf(
                                                "ml-2 flex items-center text-xs font-medium",
                                                e.change >= 0 ? "text-green-600" : "text-red-600",
                                              ),
                                              children: [
                                                e.change >= 0
                                                  ? Q.jsx(iat, { className: "mr-1 h-3 w-3" })
                                                  : Q.jsx(eat, { className: "mr-1 h-3 w-3" }),
                                                Math.abs(Number(e.change || 0)).toFixed(2),
                                                "%",
                                              ],
                                            }),
                                          ],
                                        }),
                                        Q.jsxs("div", {
                                          className: "mt-1 flex items-center gap-2",
                                          children: [
                                            Q.jsx("div", {
                                              className:
                                                "h-2 flex-1 overflow-hidden rounded-full bg-muted",
                                              children: Q.jsx("div", {
                                                className: "h-full bg-primary transition-all",
                                                style: { width: (e.value / m) * 100 + "%" },
                                              }),
                                            }),
                                            Q.jsx("span", {
                                              className: "text-xs text-muted-foreground",
                                              children: cqt(e.value),
                                            }),
                                          ],
                                        }),
                                      ],
                                    }),
                                  }),
                                }),
                                Q.jsx(Bst, {
                                  side: "right",
                                  className: "space-y-2 p-4",
                                  children: Q.jsxs("div", {
                                    className: "grid grid-cols-2 gap-x-4 gap-y-2 text-sm",
                                    children: [
                                      Q.jsxs("span", {
                                        className: "text-muted-foreground",
                                        children: [t("dashboard:trafficRank.currentTraffic"), "："],
                                      }),
                                      Q.jsx("span", {
                                        className: "font-medium",
                                        children: cqt(e.value),
                                      }),
                                      Q.jsxs("span", {
                                        className: "text-muted-foreground",
                                        children: [
                                          t("dashboard:trafficRank.previousTraffic"),
                                          "：",
                                        ],
                                      }),
                                      Q.jsx("span", {
                                        className: "font-medium",
                                        children: cqt(e.previousValue),
                                      }),
                                      Q.jsxs("span", {
                                        className: "text-muted-foreground",
                                        children: [t("dashboard:trafficRank.changeRate"), "："],
                                      }),
                                      Q.jsxs("span", {
                                        className: Rf(
                                          "font-medium",
                                          e.change >= 0 ? "text-green-600" : "text-red-600",
                                        ),
                                        children: [
                                          e.change >= 0 ? "+" : "",
                                          Number(e.change || 0).toFixed(2),
                                          "%",
                                        ],
                                      }),
                                    ],
                                  }),
                                }),
                              ],
                            }),
                          },
                          e.id,
                        ),
                      ),
                    }),
                    Q.jsx(oqt, { orientation: "vertical" }),
                  ],
                })
              : Q.jsx("div", {
                  className: "flex h-[400px] items-center justify-center",
                  children: Q.jsx("div", {
                    className: "animate-pulse",
                    children: t("common:loading"),
                  }),
                }),
          }),
        ],
      }),
      Q.jsxs(q6e, {
        children: [
          Q.jsx(K6e, {
            className: "flex-none pb-2",
            children: Q.jsxs("div", {
              className: "flex flex-wrap items-center justify-between gap-2",
              children: [
                Q.jsxs(G6e, {
                  className: "flex items-center text-base font-medium",
                  children: [
                    Q.jsx(dlt, { className: "mr-2 h-4 w-4" }),
                    t("dashboard:trafficRank.userTrafficRank"),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex min-w-0 items-center gap-1",
                  children: [
                    Q.jsx(lqt, {
                      selectedRange: s,
                      customDateRange: l,
                      onRangeChange: a,
                      onCustomRangeChange: c,
                    }),
                    Q.jsx(Qst, { className: "h-4 w-4 flex-shrink-0 text-muted-foreground" }),
                  ],
                }),
              ],
            }),
          }),
          Q.jsx(Y6e, {
            className: "flex-1",
            children: f.length
              ? Q.jsxs(rqt, {
                  className: "h-[400px] pr-4",
                  children: [
                    Q.jsx("div", {
                      className: "space-y-3",
                      children: f.map((e) =>
                        Q.jsx(
                          Pst,
                          {
                            children: Q.jsxs(jst, {
                              children: [
                                Q.jsx(Fst, {
                                  asChild: !0,
                                  children: Q.jsx("div", {
                                    className:
                                      "flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",
                                    children: Q.jsxs("div", {
                                      className: "min-w-0 flex-1",
                                      children: [
                                        Q.jsxs("div", {
                                          className: "flex items-center justify-between",
                                          children: [
                                            Q.jsx("span", {
                                              className: "truncate text-sm font-medium",
                                              children: e.name,
                                            }),
                                            Q.jsxs("span", {
                                              className: Rf(
                                                "ml-2 flex items-center text-xs font-medium",
                                                e.change >= 0 ? "text-green-600" : "text-red-600",
                                              ),
                                              children: [
                                                e.change >= 0
                                                  ? Q.jsx(iat, { className: "mr-1 h-3 w-3" })
                                                  : Q.jsx(eat, { className: "mr-1 h-3 w-3" }),
                                                Math.abs(Number(e.change || 0)).toFixed(2),
                                                "%",
                                              ],
                                            }),
                                          ],
                                        }),
                                        Q.jsxs("div", {
                                          className: "mt-1 flex items-center gap-2",
                                          children: [
                                            Q.jsx("div", {
                                              className:
                                                "h-2 flex-1 overflow-hidden rounded-full bg-muted",
                                              children: Q.jsx("div", {
                                                className: "h-full bg-primary transition-all",
                                                style: { width: (e.value / _) * 100 + "%" },
                                              }),
                                            }),
                                            Q.jsx("span", {
                                              className: "text-xs text-muted-foreground",
                                              children: cqt(e.value),
                                            }),
                                          ],
                                        }),
                                      ],
                                    }),
                                  }),
                                }),
                                Q.jsx(Bst, {
                                  side: "right",
                                  className: "space-y-2 p-4",
                                  children: Q.jsxs("div", {
                                    className: "grid grid-cols-2 gap-x-4 gap-y-2 text-sm",
                                    children: [
                                      Q.jsxs("span", {
                                        className: "text-muted-foreground",
                                        children: [t("dashboard:trafficRank.currentTraffic"), "："],
                                      }),
                                      Q.jsx("span", {
                                        className: "font-medium",
                                        children: cqt(e.value),
                                      }),
                                      Q.jsxs("span", {
                                        className: "text-muted-foreground",
                                        children: [
                                          t("dashboard:trafficRank.previousTraffic"),
                                          "：",
                                        ],
                                      }),
                                      Q.jsx("span", {
                                        className: "font-medium",
                                        children: cqt(e.previousValue),
                                      }),
                                      Q.jsxs("span", {
                                        className: "text-muted-foreground",
                                        children: [t("dashboard:trafficRank.changeRate"), "："],
                                      }),
                                      Q.jsxs("span", {
                                        className: Rf(
                                          "font-medium",
                                          e.change >= 0 ? "text-green-600" : "text-red-600",
                                        ),
                                        children: [
                                          e.change >= 0 ? "+" : "",
                                          Number(e.change || 0).toFixed(2),
                                          "%",
                                        ],
                                      }),
                                    ],
                                  }),
                                }),
                              ],
                            }),
                          },
                          e.id,
                        ),
                      ),
                    }),
                    Q.jsx(oqt, { orientation: "vertical" }),
                  ],
                })
              : Q.jsx("div", {
                  className: "flex h-[400px] items-center justify-center",
                  children: Q.jsx("div", {
                    className: "animate-pulse",
                    children: t("common:loading"),
                  }),
                }),
          }),
        ],
      }),
    ],
  });
}
const uqt = jp(
  "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
  {
    variants: {
      variant: {
        default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/10",
        secondary:
          "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
        destructive:
          "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
        outline: "text-foreground",
      },
    },
    defaultVariants: { variant: "default" },
  },
);
function hqt({ className: e, variant: t, ...n }) {
  return Q.jsx("div", { className: Rf(uqt({ variant: t }), e), ...n });
}
function gqt(...e) {
  const t = e[0];
  if (1 === e.length) return t;
  const n = () => {
    const n = e.map((e) => ({ useScope: e(), scopeName: e.scopeName }));
    return function (e) {
      const i = n.reduce(
        (t, { useScope: n, scopeName: i }) => ({ ...t, ...n(e)[`__scope${i}`] }),
        {},
      );
      return H.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
    };
  };
  return ((n.scopeName = t.scopeName), n);
}
var pqt = [
    "a",
    "button",
    "div",
    "form",
    "h2",
    "h3",
    "img",
    "input",
    "label",
    "li",
    "nav",
    "ol",
    "p",
    "select",
    "span",
    "svg",
    "ul",
  ].reduce((e, t) => {
    const n = Lp(`Primitive.${t}`),
      i = H.forwardRef((e, i) => {
        const { asChild: r, ...o } = e,
          s = r ? n : t;
        return (
          "undefined" != typeof window && (window[Symbol.for("radix-ui")] = !0),
          Q.jsx(s, { ...o, ref: i })
        );
      });
    return ((i.displayName = `Primitive.${t}`), { ...e, [t]: i });
  }, {}),
  fqt = "Progress",
  [mqt] = (function (e, t = []) {
    let n = [];
    const i = () => {
      const t = n.map((e) => H.createContext(e));
      return function (n) {
        const i = n?.[e] || t;
        return H.useMemo(() => ({ [`__scope${e}`]: { ...n, [e]: i } }), [n, i]);
      };
    };
    return (
      (i.scopeName = e),
      [
        function (t, i) {
          const r = H.createContext(i);
          r.displayName = t + "Context";
          const o = n.length;
          n = [...n, i];
          const s = (t) => {
            const { scope: n, children: i, ...s } = t,
              a = n?.[e]?.[o] || r,
              l = H.useMemo(() => s, Object.values(s));
            return Q.jsx(a.Provider, { value: l, children: i });
          };
          return (
            (s.displayName = t + "Provider"),
            [
              s,
              function (n, s) {
                const a = s?.[e]?.[o] || r,
                  l = H.useContext(a);
                if (l) return l;
                if (void 0 !== i) return i;
                throw new Error(`\`${n}\` must be used within \`${t}\``);
              },
            ]
          );
        },
        gqt(i, ...t),
      ]
    );
  })(fqt),
  [_qt, vqt] = mqt(fqt),
  bqt = H.forwardRef((e, t) => {
    const { __scopeProgress: n, value: i = null, max: r, getValueLabel: o = wqt, ...s } = e;
    (r || 0 === r) && kqt(r);
    const a = kqt(r) ? r : 100;
    null !== i && Eqt(i, a);
    const l = Eqt(i, a) ? i : null,
      c = Sqt(l) ? o(l, a) : void 0;
    return Q.jsx(_qt, {
      scope: n,
      value: l,
      max: a,
      children: Q.jsx(pqt.div, {
        "aria-valuemax": a,
        "aria-valuemin": 0,
        "aria-valuenow": Sqt(l) ? l : void 0,
        "aria-valuetext": c,
        role: "progressbar",
        "data-state": Cqt(l, a),
        "data-value": l ?? void 0,
        "data-max": a,
        ...s,
        ref: t,
      }),
    });
  });
bqt.displayName = fqt;
var yqt = "ProgressIndicator",
  xqt = H.forwardRef((e, t) => {
    const { __scopeProgress: n, ...i } = e,
      r = vqt(yqt, n);
    return Q.jsx(pqt.div, {
      "data-state": Cqt(r.value, r.max),
      "data-value": r.value ?? void 0,
      "data-max": r.max,
      ...i,
      ref: t,
    });
  });
function wqt(e, t) {
  return `${Math.round((e / t) * 100)}%`;
}
function Cqt(e, t) {
  return null == e ? "indeterminate" : e === t ? "complete" : "loading";
}
function Sqt(e) {
  return "number" == typeof e;
}
function kqt(e) {
  return Sqt(e) && !isNaN(e) && e > 0;
}
function Eqt(e, t) {
  return Sqt(e) && !isNaN(e) && e <= t && e >= 0;
}
xqt.displayName = yqt;
var Nqt = bqt,
  Lqt = xqt;
const Dqt = H.forwardRef(({ className: e, value: t, ...n }, i) =>
  Q.jsx(Nqt, {
    ref: i,
    className: Rf("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", e),
    ...n,
    children: Q.jsx(Lqt, {
      className: "h-full w-full flex-1 bg-primary transition-all",
      style: { transform: `translateX(-${100 - (t || 0)}%)` },
    }),
  }),
);
function Tqt(e, t) {
  return "function" == typeof e ? e(t) : e;
}
function Iqt(e, t) {
  return (n) => {
    t.setState((t) => ({ ...t, [e]: Tqt(n, t[e]) }));
  };
}
function Rqt(e) {
  return e instanceof Function;
}
function Oqt(e, t, n) {
  let i,
    r = [];
  return (o) => {
    let s;
    n.key && n.debug && (s = Date.now());
    const a = e(o),
      l = a.length !== r.length || a.some((e, t) => r[t] !== e);
    if (!l) return i;
    let c;
    if (
      ((r = a),
      n.key && n.debug && (c = Date.now()),
      (i = t(...a)),
      null == n || null == n.onChange || n.onChange(i),
      n.key && n.debug && null != n && n.debug())
    ) {
      (Math.round(100 * (Date.now() - s)), Math.round(100 * (Date.now() - c)));
    }
    return i;
  };
}
function Mqt(e, t, n, i) {
  return {
    debug: () => {
      var n;
      return null != (n = null == e ? void 0 : e.debugAll) ? n : e[t];
    },
    key: !1,
    onChange: i,
  };
}
Dqt.displayName = Nqt.displayName;
const Aqt = "debugHeaders";
function Pqt(e, t, n) {
  var i;
  let r = {
    id: null != (i = n.id) ? i : t.id,
    column: t,
    index: n.index,
    isPlaceholder: !!n.isPlaceholder,
    placeholderId: n.placeholderId,
    depth: n.depth,
    subHeaders: [],
    colSpan: 0,
    rowSpan: 0,
    headerGroup: null,
    getLeafHeaders: () => {
      const e = [],
        t = (n) => {
          (n.subHeaders && n.subHeaders.length && n.subHeaders.map(t), e.push(n));
        };
      return (t(r), e);
    },
    getContext: () => ({ table: e, header: r, column: t }),
  };
  return (
    e._features.forEach((t) => {
      null == t.createHeader || t.createHeader(r, e);
    }),
    r
  );
}
const jqt = {
  createTable: (e) => {
    ((e.getHeaderGroups = Oqt(
      () => [
        e.getAllColumns(),
        e.getVisibleLeafColumns(),
        e.getState().columnPinning.left,
        e.getState().columnPinning.right,
      ],
      (t, n, i, r) => {
        var o, s;
        const a =
            null !=
            (o = null == i ? void 0 : i.map((e) => n.find((t) => t.id === e)).filter(Boolean))
              ? o
              : [],
          l =
            null !=
            (s = null == r ? void 0 : r.map((e) => n.find((t) => t.id === e)).filter(Boolean))
              ? s
              : [];
        return Fqt(
          t,
          [
            ...a,
            ...n.filter(
              (e) => !((null != i && i.includes(e.id)) || (null != r && r.includes(e.id))),
            ),
            ...l,
          ],
          e,
        );
      },
      Mqt(e.options, Aqt),
    )),
      (e.getCenterHeaderGroups = Oqt(
        () => [
          e.getAllColumns(),
          e.getVisibleLeafColumns(),
          e.getState().columnPinning.left,
          e.getState().columnPinning.right,
        ],
        (t, n, i, r) =>
          Fqt(
            t,
            (n = n.filter(
              (e) => !((null != i && i.includes(e.id)) || (null != r && r.includes(e.id))),
            )),
            e,
            "center",
          ),
        Mqt(e.options, Aqt),
      )),
      (e.getLeftHeaderGroups = Oqt(
        () => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left],
        (t, n, i) => {
          var r;
          const o =
            null !=
            (r = null == i ? void 0 : i.map((e) => n.find((t) => t.id === e)).filter(Boolean))
              ? r
              : [];
          return Fqt(t, o, e, "left");
        },
        Mqt(e.options, Aqt),
      )),
      (e.getRightHeaderGroups = Oqt(
        () => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right],
        (t, n, i) => {
          var r;
          const o =
            null !=
            (r = null == i ? void 0 : i.map((e) => n.find((t) => t.id === e)).filter(Boolean))
              ? r
              : [];
          return Fqt(t, o, e, "right");
        },
        Mqt(e.options, Aqt),
      )),
      (e.getFooterGroups = Oqt(
        () => [e.getHeaderGroups()],
        (e) => [...e].reverse(),
        Mqt(e.options, Aqt),
      )),
      (e.getLeftFooterGroups = Oqt(
        () => [e.getLeftHeaderGroups()],
        (e) => [...e].reverse(),
        Mqt(e.options, Aqt),
      )),
      (e.getCenterFooterGroups = Oqt(
        () => [e.getCenterHeaderGroups()],
        (e) => [...e].reverse(),
        Mqt(e.options, Aqt),
      )),
      (e.getRightFooterGroups = Oqt(
        () => [e.getRightHeaderGroups()],
        (e) => [...e].reverse(),
        Mqt(e.options, Aqt),
      )),
      (e.getFlatHeaders = Oqt(
        () => [e.getHeaderGroups()],
        (e) => e.map((e) => e.headers).flat(),
        Mqt(e.options, Aqt),
      )),
      (e.getLeftFlatHeaders = Oqt(
        () => [e.getLeftHeaderGroups()],
        (e) => e.map((e) => e.headers).flat(),
        Mqt(e.options, Aqt),
      )),
      (e.getCenterFlatHeaders = Oqt(
        () => [e.getCenterHeaderGroups()],
        (e) => e.map((e) => e.headers).flat(),
        Mqt(e.options, Aqt),
      )),
      (e.getRightFlatHeaders = Oqt(
        () => [e.getRightHeaderGroups()],
        (e) => e.map((e) => e.headers).flat(),
        Mqt(e.options, Aqt),
      )),
      (e.getCenterLeafHeaders = Oqt(
        () => [e.getCenterFlatHeaders()],
        (e) =>
          e.filter((e) => {
            var t;
            return !(null != (t = e.subHeaders) && t.length);
          }),
        Mqt(e.options, Aqt),
      )),
      (e.getLeftLeafHeaders = Oqt(
        () => [e.getLeftFlatHeaders()],
        (e) =>
          e.filter((e) => {
            var t;
            return !(null != (t = e.subHeaders) && t.length);
          }),
        Mqt(e.options, Aqt),
      )),
      (e.getRightLeafHeaders = Oqt(
        () => [e.getRightFlatHeaders()],
        (e) =>
          e.filter((e) => {
            var t;
            return !(null != (t = e.subHeaders) && t.length);
          }),
        Mqt(e.options, Aqt),
      )),
      (e.getLeafHeaders = Oqt(
        () => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()],
        (e, t, n) => {
          var i, r, o, s, a, l;
          return [
            ...(null != (i = null == (r = e[0]) ? void 0 : r.headers) ? i : []),
            ...(null != (o = null == (s = t[0]) ? void 0 : s.headers) ? o : []),
            ...(null != (a = null == (l = n[0]) ? void 0 : l.headers) ? a : []),
          ]
            .map((e) => e.getLeafHeaders())
            .flat();
        },
        Mqt(e.options, Aqt),
      )));
  },
};
function Fqt(e, t, n, i) {
  var r, o;
  let s = 0;
  const a = function (e, t) {
    (void 0 === t && (t = 1),
      (s = Math.max(s, t)),
      e
        .filter((e) => e.getIsVisible())
        .forEach((e) => {
          var n;
          null != (n = e.columns) && n.length && a(e.columns, t + 1);
        }, 0));
  };
  a(e);
  let l = [];
  const c = (e, t) => {
      const r = { depth: t, id: [i, `${t}`].filter(Boolean).join("_"), headers: [] },
        o = [];
      (e.forEach((e) => {
        const s = [...o].reverse()[0];
        let a,
          l = !1;
        if (
          (e.column.depth === r.depth && e.column.parent
            ? (a = e.column.parent)
            : ((a = e.column), (l = !0)),
          s && (null == s ? void 0 : s.column) === a)
        )
          s.subHeaders.push(e);
        else {
          const r = Pqt(n, a, {
            id: [i, t, a.id, null == e ? void 0 : e.id].filter(Boolean).join("_"),
            isPlaceholder: l,
            placeholderId: l ? `${o.filter((e) => e.column === a).length}` : void 0,
            depth: t,
            index: o.length,
          });
          (r.subHeaders.push(e), o.push(r));
        }
        (r.headers.push(e), (e.headerGroup = r));
      }),
        l.push(r),
        t > 0 && c(o, t - 1));
    },
    d = t.map((e, t) => Pqt(n, e, { depth: s, index: t }));
  (c(d, s - 1), l.reverse());
  const u = (e) => {
    const t = e.filter((e) => e.column.getIsVisible());
    return t.map((e) => {
      let t = 0,
        n = 0,
        i = [0];
      e.subHeaders && e.subHeaders.length
        ? ((i = []),
          u(e.subHeaders).forEach((e) => {
            let { colSpan: n, rowSpan: r } = e;
            ((t += n), i.push(r));
          }))
        : (t = 1);
      return ((n += Math.min(...i)), (e.colSpan = t), (e.rowSpan = n), { colSpan: t, rowSpan: n });
    });
  };
  return (u(null != (r = null == (o = l[0]) ? void 0 : o.headers) ? r : []), l);
}
const Bqt = (e, t, n, i, r, o, s) => {
    let a = {
      id: t,
      index: i,
      original: n,
      depth: r,
      parentId: s,
      _valuesCache: {},
      _uniqueValuesCache: {},
      getValue: (t) => {
        if (a._valuesCache.hasOwnProperty(t)) return a._valuesCache[t];
        const n = e.getColumn(t);
        return null != n && n.accessorFn
          ? ((a._valuesCache[t] = n.accessorFn(a.original, i)), a._valuesCache[t])
          : void 0;
      },
      getUniqueValues: (t) => {
        if (a._uniqueValuesCache.hasOwnProperty(t)) return a._uniqueValuesCache[t];
        const n = e.getColumn(t);
        return null != n && n.accessorFn
          ? n.columnDef.getUniqueValues
            ? ((a._uniqueValuesCache[t] = n.columnDef.getUniqueValues(a.original, i)),
              a._uniqueValuesCache[t])
            : ((a._uniqueValuesCache[t] = [a.getValue(t)]), a._uniqueValuesCache[t])
          : void 0;
      },
      renderValue: (t) => {
        var n;
        return null != (n = a.getValue(t)) ? n : e.options.renderFallbackValue;
      },
      subRows: [],
      getLeafRows: () =>
        (function (e, t) {
          const n = [],
            i = (e) => {
              e.forEach((e) => {
                n.push(e);
                const r = t(e);
                null != r && r.length && i(r);
              });
            };
          return (i(e), n);
        })(a.subRows, (e) => e.subRows),
      getParentRow: () => (a.parentId ? e.getRow(a.parentId, !0) : void 0),
      getParentRows: () => {
        let e = [],
          t = a;
        for (;;) {
          const n = t.getParentRow();
          if (!n) break;
          (e.push(n), (t = n));
        }
        return e.reverse();
      },
      getAllCells: Oqt(
        () => [e.getAllLeafColumns()],
        (t) =>
          t.map((t) =>
            (function (e, t, n, i) {
              const r = {
                id: `${t.id}_${n.id}`,
                row: t,
                column: n,
                getValue: () => t.getValue(i),
                renderValue: () => {
                  var t;
                  return null != (t = r.getValue()) ? t : e.options.renderFallbackValue;
                },
                getContext: Oqt(
                  () => [e, n, t, r],
                  (e, t, n, i) => ({
                    table: e,
                    column: t,
                    row: n,
                    cell: i,
                    getValue: i.getValue,
                    renderValue: i.renderValue,
                  }),
                  Mqt(e.options, "debugCells"),
                ),
              };
              return (
                e._features.forEach((i) => {
                  null == i.createCell || i.createCell(r, n, t, e);
                }, {}),
                r
              );
            })(e, a, t, t.id),
          ),
        Mqt(e.options, "debugRows"),
      ),
      _getAllCellsByColumnId: Oqt(
        () => [a.getAllCells()],
        (e) => e.reduce((e, t) => ((e[t.column.id] = t), e), {}),
        Mqt(e.options, "debugRows"),
      ),
    };
    for (let l = 0; l < e._features.length; l++) {
      const t = e._features[l];
      null == t || null == t.createRow || t.createRow(a, e);
    }
    return a;
  },
  Vqt = {
    createColumn: (e, t) => {
      ((e._getFacetedRowModel =
        t.options.getFacetedRowModel && t.options.getFacetedRowModel(t, e.id)),
        (e.getFacetedRowModel = () =>
          e._getFacetedRowModel ? e._getFacetedRowModel() : t.getPreFilteredRowModel()),
        (e._getFacetedUniqueValues =
          t.options.getFacetedUniqueValues && t.options.getFacetedUniqueValues(t, e.id)),
        (e.getFacetedUniqueValues = () =>
          e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : new Map()),
        (e._getFacetedMinMaxValues =
          t.options.getFacetedMinMaxValues && t.options.getFacetedMinMaxValues(t, e.id)),
        (e.getFacetedMinMaxValues = () => {
          if (e._getFacetedMinMaxValues) return e._getFacetedMinMaxValues();
        }));
    },
  },
  Wqt = (e, t, n) => {
    var i, r;
    const o = null == n || null == (i = n.toString()) ? void 0 : i.toLowerCase();
    return Boolean(
      null == (r = e.getValue(t)) || null == (r = r.toString()) || null == (r = r.toLowerCase())
        ? void 0
        : r.includes(o),
    );
  };
Wqt.autoRemove = (e) => Xqt(e);
const Hqt = (e, t, n) => {
  var i;
  return Boolean(
    null == (i = e.getValue(t)) || null == (i = i.toString()) ? void 0 : i.includes(n),
  );
};
Hqt.autoRemove = (e) => Xqt(e);
const zqt = (e, t, n) => {
  var i;
  return (
    (null == (i = e.getValue(t)) || null == (i = i.toString()) ? void 0 : i.toLowerCase()) ===
    (null == n ? void 0 : n.toLowerCase())
  );
};
zqt.autoRemove = (e) => Xqt(e);
const Uqt = (e, t, n) => {
  var i;
  return null == (i = e.getValue(t)) ? void 0 : i.includes(n);
};
Uqt.autoRemove = (e) => Xqt(e);
const $qt = (e, t, n) =>
  !n.some((n) => {
    var i;
    return !(null != (i = e.getValue(t)) && i.includes(n));
  });
$qt.autoRemove = (e) => Xqt(e) || !(null != e && e.length);
const qqt = (e, t, n) =>
  n.some((n) => {
    var i;
    return null == (i = e.getValue(t)) ? void 0 : i.includes(n);
  });
qqt.autoRemove = (e) => Xqt(e) || !(null != e && e.length);
const Kqt = (e, t, n) => e.getValue(t) === n;
Kqt.autoRemove = (e) => Xqt(e);
const Gqt = (e, t, n) => e.getValue(t) == n;
Gqt.autoRemove = (e) => Xqt(e);
const Zqt = (e, t, n) => {
  let [i, r] = n;
  const o = e.getValue(t);
  return o >= i && o <= r;
};
((Zqt.resolveFilterValue = (e) => {
  let [t, n] = e,
    i = "number" != typeof t ? parseFloat(t) : t,
    r = "number" != typeof n ? parseFloat(n) : n,
    o = null === t || Number.isNaN(i) ? -1 / 0 : i,
    s = null === n || Number.isNaN(r) ? 1 / 0 : r;
  if (o > s) {
    const e = o;
    ((o = s), (s = e));
  }
  return [o, s];
}),
  (Zqt.autoRemove = (e) => Xqt(e) || (Xqt(e[0]) && Xqt(e[1]))));
const Yqt = {
  includesString: Wqt,
  includesStringSensitive: Hqt,
  equalsString: zqt,
  arrIncludes: Uqt,
  arrIncludesAll: $qt,
  arrIncludesSome: qqt,
  equals: Kqt,
  weakEquals: Gqt,
  inNumberRange: Zqt,
};
function Xqt(e) {
  return null == e || "" === e;
}
const Qqt = {
  getDefaultColumnDef: () => ({ filterFn: "auto" }),
  getInitialState: (e) => ({ columnFilters: [], ...e }),
  getDefaultOptions: (e) => ({
    onColumnFiltersChange: Iqt("columnFilters", e),
    filterFromLeafRows: !1,
    maxLeafRowFilterDepth: 100,
  }),
  createColumn: (e, t) => {
    ((e.getAutoFilterFn = () => {
      const n = t.getCoreRowModel().flatRows[0],
        i = null == n ? void 0 : n.getValue(e.id);
      return "string" == typeof i
        ? Yqt.includesString
        : "number" == typeof i
          ? Yqt.inNumberRange
          : "boolean" == typeof i || (null !== i && "object" == typeof i)
            ? Yqt.equals
            : Array.isArray(i)
              ? Yqt.arrIncludes
              : Yqt.weakEquals;
    }),
      (e.getFilterFn = () => {
        var n, i;
        return Rqt(e.columnDef.filterFn)
          ? e.columnDef.filterFn
          : "auto" === e.columnDef.filterFn
            ? e.getAutoFilterFn()
            : null != (n = null == (i = t.options.filterFns) ? void 0 : i[e.columnDef.filterFn])
              ? n
              : Yqt[e.columnDef.filterFn];
      }),
      (e.getCanFilter = () => {
        var n, i, r;
        return (
          (null == (n = e.columnDef.enableColumnFilter) || n) &&
          (null == (i = t.options.enableColumnFilters) || i) &&
          (null == (r = t.options.enableFilters) || r) &&
          !!e.accessorFn
        );
      }),
      (e.getIsFiltered = () => e.getFilterIndex() > -1),
      (e.getFilterValue = () => {
        var n;
        return null == (n = t.getState().columnFilters) ||
          null == (n = n.find((t) => t.id === e.id))
          ? void 0
          : n.value;
      }),
      (e.getFilterIndex = () => {
        var n, i;
        return null !=
          (n =
            null == (i = t.getState().columnFilters) ? void 0 : i.findIndex((t) => t.id === e.id))
          ? n
          : -1;
      }),
      (e.setFilterValue = (n) => {
        t.setColumnFilters((t) => {
          const i = e.getFilterFn(),
            r = null == t ? void 0 : t.find((t) => t.id === e.id),
            o = Tqt(n, r ? r.value : void 0);
          var s;
          if (Jqt(i, o, e))
            return null != (s = null == t ? void 0 : t.filter((t) => t.id !== e.id)) ? s : [];
          const a = { id: e.id, value: o };
          var l;
          return r
            ? null != (l = null == t ? void 0 : t.map((t) => (t.id === e.id ? a : t)))
              ? l
              : []
            : null != t && t.length
              ? [...t, a]
              : [a];
        });
      }));
  },
  createRow: (e, t) => {
    ((e.columnFilters = {}), (e.columnFiltersMeta = {}));
  },
  createTable: (e) => {
    ((e.setColumnFilters = (t) => {
      const n = e.getAllLeafColumns();
      null == e.options.onColumnFiltersChange ||
        e.options.onColumnFiltersChange((e) => {
          var i;
          return null == (i = Tqt(t, e))
            ? void 0
            : i.filter((e) => {
                const t = n.find((t) => t.id === e.id);
                if (t) {
                  if (Jqt(t.getFilterFn(), e.value, t)) return !1;
                }
                return !0;
              });
        });
    }),
      (e.resetColumnFilters = (t) => {
        var n, i;
        e.setColumnFilters(
          t ? [] : null != (n = null == (i = e.initialState) ? void 0 : i.columnFilters) ? n : [],
        );
      }),
      (e.getPreFilteredRowModel = () => e.getCoreRowModel()),
      (e.getFilteredRowModel = () => (
        !e._getFilteredRowModel &&
          e.options.getFilteredRowModel &&
          (e._getFilteredRowModel = e.options.getFilteredRowModel(e)),
        e.options.manualFiltering || !e._getFilteredRowModel
          ? e.getPreFilteredRowModel()
          : e._getFilteredRowModel()
      )));
  },
};
function Jqt(e, t, n) {
  return (
    (!(!e || !e.autoRemove) && e.autoRemove(t, n)) || void 0 === t || ("string" == typeof t && !t)
  );
}
const eKt = {
    sum: (e, t, n) =>
      n.reduce((t, n) => {
        const i = n.getValue(e);
        return t + ("number" == typeof i ? i : 0);
      }, 0),
    min: (e, t, n) => {
      let i;
      return (
        n.forEach((t) => {
          const n = t.getValue(e);
          null != n && (i > n || (void 0 === i && n >= n)) && (i = n);
        }),
        i
      );
    },
    max: (e, t, n) => {
      let i;
      return (
        n.forEach((t) => {
          const n = t.getValue(e);
          null != n && (i < n || (void 0 === i && n >= n)) && (i = n);
        }),
        i
      );
    },
    extent: (e, t, n) => {
      let i, r;
      return (
        n.forEach((t) => {
          const n = t.getValue(e);
          null != n &&
            (void 0 === i ? n >= n && (i = r = n) : (i > n && (i = n), r < n && (r = n)));
        }),
        [i, r]
      );
    },
    mean: (e, t) => {
      let n = 0,
        i = 0;
      if (
        (t.forEach((t) => {
          let r = t.getValue(e);
          null != r && (r = +r) >= r && (++n, (i += r));
        }),
        n)
      )
        return i / n;
    },
    median: (e, t) => {
      if (!t.length) return;
      const n = t.map((t) => t.getValue(e));
      if (
        !(function (e) {
          return Array.isArray(e) && e.every((e) => "number" == typeof e);
        })(n)
      )
        return;
      if (1 === n.length) return n[0];
      const i = Math.floor(n.length / 2),
        r = n.sort((e, t) => e - t);
      return n.length % 2 != 0 ? r[i] : (r[i - 1] + r[i]) / 2;
    },
    unique: (e, t) => Array.from(new Set(t.map((t) => t.getValue(e))).values()),
    uniqueCount: (e, t) => new Set(t.map((t) => t.getValue(e))).size,
    count: (e, t) => t.length,
  },
  tKt = {
    getDefaultColumnDef: () => ({
      aggregatedCell: (e) => {
        var t, n;
        return null !=
          (t = null == (n = e.getValue()) || null == n.toString ? void 0 : n.toString())
          ? t
          : null;
      },
      aggregationFn: "auto",
    }),
    getInitialState: (e) => ({ grouping: [], ...e }),
    getDefaultOptions: (e) => ({
      onGroupingChange: Iqt("grouping", e),
      groupedColumnMode: "reorder",
    }),
    createColumn: (e, t) => {
      ((e.toggleGrouping = () => {
        t.setGrouping((t) =>
          null != t && t.includes(e.id)
            ? t.filter((t) => t !== e.id)
            : [...(null != t ? t : []), e.id],
        );
      }),
        (e.getCanGroup = () => {
          var n, i;
          return (
            (null == (n = e.columnDef.enableGrouping) || n) &&
            (null == (i = t.options.enableGrouping) || i) &&
            (!!e.accessorFn || !!e.columnDef.getGroupingValue)
          );
        }),
        (e.getIsGrouped = () => {
          var n;
          return null == (n = t.getState().grouping) ? void 0 : n.includes(e.id);
        }),
        (e.getGroupedIndex = () => {
          var n;
          return null == (n = t.getState().grouping) ? void 0 : n.indexOf(e.id);
        }),
        (e.getToggleGroupingHandler = () => {
          const t = e.getCanGroup();
          return () => {
            t && e.toggleGrouping();
          };
        }),
        (e.getAutoAggregationFn = () => {
          const n = t.getCoreRowModel().flatRows[0],
            i = null == n ? void 0 : n.getValue(e.id);
          return "number" == typeof i
            ? eKt.sum
            : "[object Date]" === Object.prototype.toString.call(i)
              ? eKt.extent
              : void 0;
        }),
        (e.getAggregationFn = () => {
          var n, i;
          if (!e) throw new Error();
          return Rqt(e.columnDef.aggregationFn)
            ? e.columnDef.aggregationFn
            : "auto" === e.columnDef.aggregationFn
              ? e.getAutoAggregationFn()
              : null !=
                  (n =
                    null == (i = t.options.aggregationFns) ? void 0 : i[e.columnDef.aggregationFn])
                ? n
                : eKt[e.columnDef.aggregationFn];
        }));
    },
    createTable: (e) => {
      ((e.setGrouping = (t) =>
        null == e.options.onGroupingChange ? void 0 : e.options.onGroupingChange(t)),
        (e.resetGrouping = (t) => {
          var n, i;
          e.setGrouping(
            t ? [] : null != (n = null == (i = e.initialState) ? void 0 : i.grouping) ? n : [],
          );
        }),
        (e.getPreGroupedRowModel = () => e.getFilteredRowModel()),
        (e.getGroupedRowModel = () => (
          !e._getGroupedRowModel &&
            e.options.getGroupedRowModel &&
            (e._getGroupedRowModel = e.options.getGroupedRowModel(e)),
          e.options.manualGrouping || !e._getGroupedRowModel
            ? e.getPreGroupedRowModel()
            : e._getGroupedRowModel()
        )));
    },
    createRow: (e, t) => {
      ((e.getIsGrouped = () => !!e.groupingColumnId),
        (e.getGroupingValue = (n) => {
          if (e._groupingValuesCache.hasOwnProperty(n)) return e._groupingValuesCache[n];
          const i = t.getColumn(n);
          return null != i && i.columnDef.getGroupingValue
            ? ((e._groupingValuesCache[n] = i.columnDef.getGroupingValue(e.original)),
              e._groupingValuesCache[n])
            : e.getValue(n);
        }),
        (e._groupingValuesCache = {}));
    },
    createCell: (e, t, n, i) => {
      ((e.getIsGrouped = () => t.getIsGrouped() && t.id === n.groupingColumnId),
        (e.getIsPlaceholder = () => !e.getIsGrouped() && t.getIsGrouped()),
        (e.getIsAggregated = () => {
          var t;
          return (
            !e.getIsGrouped() && !e.getIsPlaceholder() && !(null == (t = n.subRows) || !t.length)
          );
        }));
    },
  };
const nKt = {
    getInitialState: (e) => ({ columnOrder: [], ...e }),
    getDefaultOptions: (e) => ({ onColumnOrderChange: Iqt("columnOrder", e) }),
    createColumn: (e, t) => {
      ((e.getIndex = Oqt(
        (e) => [cKt(t, e)],
        (t) => t.findIndex((t) => t.id === e.id),
        Mqt(t.options, "debugColumns"),
      )),
        (e.getIsFirstColumn = (n) => {
          var i;
          return (null == (i = cKt(t, n)[0]) ? void 0 : i.id) === e.id;
        }),
        (e.getIsLastColumn = (n) => {
          var i;
          const r = cKt(t, n);
          return (null == (i = r[r.length - 1]) ? void 0 : i.id) === e.id;
        }));
    },
    createTable: (e) => {
      ((e.setColumnOrder = (t) =>
        null == e.options.onColumnOrderChange ? void 0 : e.options.onColumnOrderChange(t)),
        (e.resetColumnOrder = (t) => {
          var n;
          e.setColumnOrder(t ? [] : null != (n = e.initialState.columnOrder) ? n : []);
        }),
        (e._getOrderColumnsFn = Oqt(
          () => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode],
          (e, t, n) => (i) => {
            let r = [];
            if (null != e && e.length) {
              const t = [...e],
                n = [...i];
              for (; n.length && t.length; ) {
                const e = t.shift(),
                  i = n.findIndex((t) => t.id === e);
                i > -1 && r.push(n.splice(i, 1)[0]);
              }
              r = [...r, ...n];
            } else r = i;
            return (function (e, t, n) {
              if (null == t || !t.length || !n) return e;
              const i = e.filter((e) => !t.includes(e.id));
              if ("remove" === n) return i;
              const r = t.map((t) => e.find((e) => e.id === t)).filter(Boolean);
              return [...r, ...i];
            })(r, t, n);
          },
          Mqt(e.options, "debugTable"),
        )));
    },
  },
  iKt = {
    getInitialState: (e) => ({ columnPinning: { left: [], right: [] }, ...e }),
    getDefaultOptions: (e) => ({ onColumnPinningChange: Iqt("columnPinning", e) }),
    createColumn: (e, t) => {
      ((e.pin = (n) => {
        const i = e
          .getLeafColumns()
          .map((e) => e.id)
          .filter(Boolean);
        t.setColumnPinning((e) => {
          var t, r, o, s, a, l;
          return "right" === n
            ? {
                left: (null != (o = null == e ? void 0 : e.left) ? o : []).filter(
                  (e) => !(null != i && i.includes(e)),
                ),
                right: [
                  ...(null != (s = null == e ? void 0 : e.right) ? s : []).filter(
                    (e) => !(null != i && i.includes(e)),
                  ),
                  ...i,
                ],
              }
            : "left" === n
              ? {
                  left: [
                    ...(null != (a = null == e ? void 0 : e.left) ? a : []).filter(
                      (e) => !(null != i && i.includes(e)),
                    ),
                    ...i,
                  ],
                  right: (null != (l = null == e ? void 0 : e.right) ? l : []).filter(
                    (e) => !(null != i && i.includes(e)),
                  ),
                }
              : {
                  left: (null != (t = null == e ? void 0 : e.left) ? t : []).filter(
                    (e) => !(null != i && i.includes(e)),
                  ),
                  right: (null != (r = null == e ? void 0 : e.right) ? r : []).filter(
                    (e) => !(null != i && i.includes(e)),
                  ),
                };
        });
      }),
        (e.getCanPin = () =>
          e.getLeafColumns().some((e) => {
            var n, i, r;
            return (
              (null == (n = e.columnDef.enablePinning) || n) &&
              (null ==
                (i = null != (r = t.options.enableColumnPinning) ? r : t.options.enablePinning) ||
                i)
            );
          })),
        (e.getIsPinned = () => {
          const n = e.getLeafColumns().map((e) => e.id),
            { left: i, right: r } = t.getState().columnPinning,
            o = n.some((e) => (null == i ? void 0 : i.includes(e))),
            s = n.some((e) => (null == r ? void 0 : r.includes(e)));
          return o ? "left" : !!s && "right";
        }),
        (e.getPinnedIndex = () => {
          var n, i;
          const r = e.getIsPinned();
          return r
            ? null !=
              (n =
                null == (i = t.getState().columnPinning) || null == (i = i[r])
                  ? void 0
                  : i.indexOf(e.id))
              ? n
              : -1
            : 0;
        }));
    },
    createRow: (e, t) => {
      ((e.getCenterVisibleCells = Oqt(
        () => [
          e._getAllVisibleCells(),
          t.getState().columnPinning.left,
          t.getState().columnPinning.right,
        ],
        (e, t, n) => {
          const i = [...(null != t ? t : []), ...(null != n ? n : [])];
          return e.filter((e) => !i.includes(e.column.id));
        },
        Mqt(t.options, "debugRows"),
      )),
        (e.getLeftVisibleCells = Oqt(
          () => [e._getAllVisibleCells(), t.getState().columnPinning.left],
          (e, t) => {
            const n = (null != t ? t : [])
              .map((t) => e.find((e) => e.column.id === t))
              .filter(Boolean)
              .map((e) => ({ ...e, position: "left" }));
            return n;
          },
          Mqt(t.options, "debugRows"),
        )),
        (e.getRightVisibleCells = Oqt(
          () => [e._getAllVisibleCells(), t.getState().columnPinning.right],
          (e, t) => {
            const n = (null != t ? t : [])
              .map((t) => e.find((e) => e.column.id === t))
              .filter(Boolean)
              .map((e) => ({ ...e, position: "right" }));
            return n;
          },
          Mqt(t.options, "debugRows"),
        )));
    },
    createTable: (e) => {
      ((e.setColumnPinning = (t) =>
        null == e.options.onColumnPinningChange ? void 0 : e.options.onColumnPinningChange(t)),
        (e.resetColumnPinning = (t) => {
          var n, i;
          return e.setColumnPinning(
            t
              ? { left: [], right: [] }
              : null != (n = null == (i = e.initialState) ? void 0 : i.columnPinning)
                ? n
                : { left: [], right: [] },
          );
        }),
        (e.getIsSomeColumnsPinned = (t) => {
          var n;
          const i = e.getState().columnPinning;
          var r, o;
          return t
            ? Boolean(null == (n = i[t]) ? void 0 : n.length)
            : Boolean(
                (null == (r = i.left) ? void 0 : r.length) ||
                (null == (o = i.right) ? void 0 : o.length),
              );
        }),
        (e.getLeftLeafColumns = Oqt(
          () => [e.getAllLeafColumns(), e.getState().columnPinning.left],
          (e, t) => (null != t ? t : []).map((t) => e.find((e) => e.id === t)).filter(Boolean),
          Mqt(e.options, "debugColumns"),
        )),
        (e.getRightLeafColumns = Oqt(
          () => [e.getAllLeafColumns(), e.getState().columnPinning.right],
          (e, t) => (null != t ? t : []).map((t) => e.find((e) => e.id === t)).filter(Boolean),
          Mqt(e.options, "debugColumns"),
        )),
        (e.getCenterLeafColumns = Oqt(
          () => [
            e.getAllLeafColumns(),
            e.getState().columnPinning.left,
            e.getState().columnPinning.right,
          ],
          (e, t, n) => {
            const i = [...(null != t ? t : []), ...(null != n ? n : [])];
            return e.filter((e) => !i.includes(e.id));
          },
          Mqt(e.options, "debugColumns"),
        )));
    },
  };
const rKt = { size: 150, minSize: 20, maxSize: Number.MAX_SAFE_INTEGER },
  oKt = {
    getDefaultColumnDef: () => rKt,
    getInitialState: (e) => ({
      columnSizing: {},
      columnSizingInfo: {
        startOffset: null,
        startSize: null,
        deltaOffset: null,
        deltaPercentage: null,
        isResizingColumn: !1,
        columnSizingStart: [],
      },
      ...e,
    }),
    getDefaultOptions: (e) => ({
      columnResizeMode: "onEnd",
      columnResizeDirection: "ltr",
      onColumnSizingChange: Iqt("columnSizing", e),
      onColumnSizingInfoChange: Iqt("columnSizingInfo", e),
    }),
    createColumn: (e, t) => {
      ((e.getSize = () => {
        var n, i, r;
        const o = t.getState().columnSizing[e.id];
        return Math.min(
          Math.max(
            null != (n = e.columnDef.minSize) ? n : rKt.minSize,
            null != (i = null != o ? o : e.columnDef.size) ? i : rKt.size,
          ),
          null != (r = e.columnDef.maxSize) ? r : rKt.maxSize,
        );
      }),
        (e.getStart = Oqt(
          (e) => [e, cKt(t, e), t.getState().columnSizing],
          (t, n) => n.slice(0, e.getIndex(t)).reduce((e, t) => e + t.getSize(), 0),
          Mqt(t.options, "debugColumns"),
        )),
        (e.getAfter = Oqt(
          (e) => [e, cKt(t, e), t.getState().columnSizing],
          (t, n) => n.slice(e.getIndex(t) + 1).reduce((e, t) => e + t.getSize(), 0),
          Mqt(t.options, "debugColumns"),
        )),
        (e.resetSize = () => {
          t.setColumnSizing((t) => {
            let { [e.id]: n, ...i } = t;
            return i;
          });
        }),
        (e.getCanResize = () => {
          var n, i;
          return (
            (null == (n = e.columnDef.enableResizing) || n) &&
            (null == (i = t.options.enableColumnResizing) || i)
          );
        }),
        (e.getIsResizing = () => t.getState().columnSizingInfo.isResizingColumn === e.id));
    },
    createHeader: (e, t) => {
      ((e.getSize = () => {
        let t = 0;
        const n = (e) => {
          var i;
          e.subHeaders.length
            ? e.subHeaders.forEach(n)
            : (t += null != (i = e.column.getSize()) ? i : 0);
        };
        return (n(e), t);
      }),
        (e.getStart = () => {
          if (e.index > 0) {
            const t = e.headerGroup.headers[e.index - 1];
            return t.getStart() + t.getSize();
          }
          return 0;
        }),
        (e.getResizeHandler = (n) => {
          const i = t.getColumn(e.column.id),
            r = null == i ? void 0 : i.getCanResize();
          return (o) => {
            if (!i || !r) return;
            if ((null == o.persist || o.persist(), aKt(o) && o.touches && o.touches.length > 1))
              return;
            const s = e.getSize(),
              a = e
                ? e.getLeafHeaders().map((e) => [e.column.id, e.column.getSize()])
                : [[i.id, i.getSize()]],
              l = aKt(o) ? Math.round(o.touches[0].clientX) : o.clientX,
              c = {},
              d = (e, n) => {
                "number" == typeof n &&
                  (t.setColumnSizingInfo((e) => {
                    var i, r;
                    const o = "rtl" === t.options.columnResizeDirection ? -1 : 1,
                      s = (n - (null != (i = null == e ? void 0 : e.startOffset) ? i : 0)) * o,
                      a = Math.max(
                        s / (null != (r = null == e ? void 0 : e.startSize) ? r : 0),
                        -0.999999,
                      );
                    return (
                      e.columnSizingStart.forEach((e) => {
                        let [t, n] = e;
                        c[t] = Math.round(100 * Math.max(n + n * a, 0)) / 100;
                      }),
                      { ...e, deltaOffset: s, deltaPercentage: a }
                    );
                  }),
                  ("onChange" !== t.options.columnResizeMode && "end" !== e) ||
                    t.setColumnSizing((e) => ({ ...e, ...c })));
              },
              u = (e) => d("move", e),
              h = (e) => {
                (d("end", e),
                  t.setColumnSizingInfo((e) => ({
                    ...e,
                    isResizingColumn: !1,
                    startOffset: null,
                    startSize: null,
                    deltaOffset: null,
                    deltaPercentage: null,
                    columnSizingStart: [],
                  })));
              },
              g = n || ("undefined" != typeof document ? document : null);
            const p = {
                moveHandler: (e) => u(e.clientX),
                upHandler: (e) => {
                  (null == g || g.removeEventListener("mousemove", p.moveHandler),
                    null == g || g.removeEventListener("mouseup", p.upHandler),
                    h(e.clientX));
                },
              },
              f = {
                moveHandler: (e) => (
                  e.cancelable && (e.preventDefault(), e.stopPropagation()),
                  u(e.touches[0].clientX),
                  !1
                ),
                upHandler: (e) => {
                  var t;
                  (null == g || g.removeEventListener("touchmove", f.moveHandler),
                    null == g || g.removeEventListener("touchend", f.upHandler),
                    e.cancelable && (e.preventDefault(), e.stopPropagation()),
                    h(null == (t = e.touches[0]) ? void 0 : t.clientX));
                },
              },
              m = !!(function () {
                if ("boolean" == typeof sKt) return sKt;
                let e = !1;
                try {
                  const t = {
                      get passive() {
                        return ((e = !0), !1);
                      },
                    },
                    n = () => {};
                  (window.addEventListener("test", n, t), window.removeEventListener("test", n));
                } catch (W8t) {
                  e = !1;
                }
                return ((sKt = e), sKt);
              })() && { passive: !1 };
            (aKt(o)
              ? (null == g || g.addEventListener("touchmove", f.moveHandler, m),
                null == g || g.addEventListener("touchend", f.upHandler, m))
              : (null == g || g.addEventListener("mousemove", p.moveHandler, m),
                null == g || g.addEventListener("mouseup", p.upHandler, m)),
              t.setColumnSizingInfo((e) => ({
                ...e,
                startOffset: l,
                startSize: s,
                deltaOffset: 0,
                deltaPercentage: 0,
                columnSizingStart: a,
                isResizingColumn: i.id,
              })));
          };
        }));
    },
    createTable: (e) => {
      ((e.setColumnSizing = (t) =>
        null == e.options.onColumnSizingChange ? void 0 : e.options.onColumnSizingChange(t)),
        (e.setColumnSizingInfo = (t) =>
          null == e.options.onColumnSizingInfoChange
            ? void 0
            : e.options.onColumnSizingInfoChange(t)),
        (e.resetColumnSizing = (t) => {
          var n;
          e.setColumnSizing(t ? {} : null != (n = e.initialState.columnSizing) ? n : {});
        }),
        (e.resetHeaderSizeInfo = (t) => {
          var n;
          e.setColumnSizingInfo(
            t
              ? {
                  startOffset: null,
                  startSize: null,
                  deltaOffset: null,
                  deltaPercentage: null,
                  isResizingColumn: !1,
                  columnSizingStart: [],
                }
              : null != (n = e.initialState.columnSizingInfo)
                ? n
                : {
                    startOffset: null,
                    startSize: null,
                    deltaOffset: null,
                    deltaPercentage: null,
                    isResizingColumn: !1,
                    columnSizingStart: [],
                  },
          );
        }),
        (e.getTotalSize = () => {
          var t, n;
          return null !=
            (t =
              null == (n = e.getHeaderGroups()[0])
                ? void 0
                : n.headers.reduce((e, t) => e + t.getSize(), 0))
            ? t
            : 0;
        }),
        (e.getLeftTotalSize = () => {
          var t, n;
          return null !=
            (t =
              null == (n = e.getLeftHeaderGroups()[0])
                ? void 0
                : n.headers.reduce((e, t) => e + t.getSize(), 0))
            ? t
            : 0;
        }),
        (e.getCenterTotalSize = () => {
          var t, n;
          return null !=
            (t =
              null == (n = e.getCenterHeaderGroups()[0])
                ? void 0
                : n.headers.reduce((e, t) => e + t.getSize(), 0))
            ? t
            : 0;
        }),
        (e.getRightTotalSize = () => {
          var t, n;
          return null !=
            (t =
              null == (n = e.getRightHeaderGroups()[0])
                ? void 0
                : n.headers.reduce((e, t) => e + t.getSize(), 0))
            ? t
            : 0;
        }));
    },
  };
let sKt = null;
function aKt(e) {
  return "touchstart" === e.type;
}
const lKt = {
  getInitialState: (e) => ({ columnVisibility: {}, ...e }),
  getDefaultOptions: (e) => ({ onColumnVisibilityChange: Iqt("columnVisibility", e) }),
  createColumn: (e, t) => {
    ((e.toggleVisibility = (n) => {
      e.getCanHide() &&
        t.setColumnVisibility((t) => ({ ...t, [e.id]: null != n ? n : !e.getIsVisible() }));
    }),
      (e.getIsVisible = () => {
        var n, i;
        const r = e.columns;
        return (
          null ==
            (n = r.length
              ? r.some((e) => e.getIsVisible())
              : null == (i = t.getState().columnVisibility)
                ? void 0
                : i[e.id]) || n
        );
      }),
      (e.getCanHide = () => {
        var n, i;
        return (
          (null == (n = e.columnDef.enableHiding) || n) &&
          (null == (i = t.options.enableHiding) || i)
        );
      }),
      (e.getToggleVisibilityHandler = () => (t) => {
        null == e.toggleVisibility || e.toggleVisibility(t.target.checked);
      }));
  },
  createRow: (e, t) => {
    ((e._getAllVisibleCells = Oqt(
      () => [e.getAllCells(), t.getState().columnVisibility],
      (e) => e.filter((e) => e.column.getIsVisible()),
      Mqt(t.options, "debugRows"),
    )),
      (e.getVisibleCells = Oqt(
        () => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()],
        (e, t, n) => [...e, ...t, ...n],
        Mqt(t.options, "debugRows"),
      )));
  },
  createTable: (e) => {
    const t = (t, n) =>
      Oqt(
        () => [
          n(),
          n()
            .filter((e) => e.getIsVisible())
            .map((e) => e.id)
            .join("_"),
        ],
        (e) => e.filter((e) => (null == e.getIsVisible ? void 0 : e.getIsVisible())),
        Mqt(e.options, "debugColumns"),
      );
    ((e.getVisibleFlatColumns = t(0, () => e.getAllFlatColumns())),
      (e.getVisibleLeafColumns = t(0, () => e.getAllLeafColumns())),
      (e.getLeftVisibleLeafColumns = t(0, () => e.getLeftLeafColumns())),
      (e.getRightVisibleLeafColumns = t(0, () => e.getRightLeafColumns())),
      (e.getCenterVisibleLeafColumns = t(0, () => e.getCenterLeafColumns())),
      (e.setColumnVisibility = (t) =>
        null == e.options.onColumnVisibilityChange
          ? void 0
          : e.options.onColumnVisibilityChange(t)),
      (e.resetColumnVisibility = (t) => {
        var n;
        e.setColumnVisibility(t ? {} : null != (n = e.initialState.columnVisibility) ? n : {});
      }),
      (e.toggleAllColumnsVisible = (t) => {
        var n;
        ((t = null != (n = t) ? n : !e.getIsAllColumnsVisible()),
          e.setColumnVisibility(
            e
              .getAllLeafColumns()
              .reduce(
                (e, n) => ({ ...e, [n.id]: t || !(null != n.getCanHide && n.getCanHide()) }),
                {},
              ),
          ));
      }),
      (e.getIsAllColumnsVisible = () =>
        !e.getAllLeafColumns().some((e) => !(null != e.getIsVisible && e.getIsVisible()))),
      (e.getIsSomeColumnsVisible = () =>
        e.getAllLeafColumns().some((e) => (null == e.getIsVisible ? void 0 : e.getIsVisible()))),
      (e.getToggleAllColumnsVisibilityHandler = () => (t) => {
        var n;
        e.toggleAllColumnsVisible(null == (n = t.target) ? void 0 : n.checked);
      }));
  },
};
function cKt(e, t) {
  return t
    ? "center" === t
      ? e.getCenterVisibleLeafColumns()
      : "left" === t
        ? e.getLeftVisibleLeafColumns()
        : e.getRightVisibleLeafColumns()
    : e.getVisibleLeafColumns();
}
const dKt = {
    createTable: (e) => {
      ((e._getGlobalFacetedRowModel =
        e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__")),
        (e.getGlobalFacetedRowModel = () =>
          e.options.manualFiltering || !e._getGlobalFacetedRowModel
            ? e.getPreFilteredRowModel()
            : e._getGlobalFacetedRowModel()),
        (e._getGlobalFacetedUniqueValues =
          e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__")),
        (e.getGlobalFacetedUniqueValues = () =>
          e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : new Map()),
        (e._getGlobalFacetedMinMaxValues =
          e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__")),
        (e.getGlobalFacetedMinMaxValues = () => {
          if (e._getGlobalFacetedMinMaxValues) return e._getGlobalFacetedMinMaxValues();
        }));
    },
  },
  uKt = {
    getInitialState: (e) => ({ globalFilter: void 0, ...e }),
    getDefaultOptions: (e) => ({
      onGlobalFilterChange: Iqt("globalFilter", e),
      globalFilterFn: "auto",
      getColumnCanGlobalFilter: (t) => {
        var n;
        const i =
          null == (n = e.getCoreRowModel().flatRows[0]) ||
          null == (n = n._getAllCellsByColumnId()[t.id])
            ? void 0
            : n.getValue();
        return "string" == typeof i || "number" == typeof i;
      },
    }),
    createColumn: (e, t) => {
      e.getCanGlobalFilter = () => {
        var n, i, r, o;
        return (
          (null == (n = e.columnDef.enableGlobalFilter) || n) &&
          (null == (i = t.options.enableGlobalFilter) || i) &&
          (null == (r = t.options.enableFilters) || r) &&
          (null ==
            (o =
              null == t.options.getColumnCanGlobalFilter
                ? void 0
                : t.options.getColumnCanGlobalFilter(e)) ||
            o) &&
          !!e.accessorFn
        );
      };
    },
    createTable: (e) => {
      ((e.getGlobalAutoFilterFn = () => Yqt.includesString),
        (e.getGlobalFilterFn = () => {
          var t, n;
          const { globalFilterFn: i } = e.options;
          return Rqt(i)
            ? i
            : "auto" === i
              ? e.getGlobalAutoFilterFn()
              : null != (t = null == (n = e.options.filterFns) ? void 0 : n[i])
                ? t
                : Yqt[i];
        }),
        (e.setGlobalFilter = (t) => {
          null == e.options.onGlobalFilterChange || e.options.onGlobalFilterChange(t);
        }),
        (e.resetGlobalFilter = (t) => {
          e.setGlobalFilter(t ? void 0 : e.initialState.globalFilter);
        }));
    },
  },
  hKt = {
    getInitialState: (e) => ({ expanded: {}, ...e }),
    getDefaultOptions: (e) => ({ onExpandedChange: Iqt("expanded", e), paginateExpandedRows: !0 }),
    createTable: (e) => {
      let t = !1,
        n = !1;
      ((e._autoResetExpanded = () => {
        var i, r;
        if (t) {
          if (
            null != (i = null != (r = e.options.autoResetAll) ? r : e.options.autoResetExpanded)
              ? i
              : !e.options.manualExpanding
          ) {
            if (n) return;
            ((n = !0),
              e._queue(() => {
                (e.resetExpanded(), (n = !1));
              }));
          }
        } else
          e._queue(() => {
            t = !0;
          });
      }),
        (e.setExpanded = (t) =>
          null == e.options.onExpandedChange ? void 0 : e.options.onExpandedChange(t)),
        (e.toggleAllRowsExpanded = (t) => {
          (null != t ? t : !e.getIsAllRowsExpanded()) ? e.setExpanded(!0) : e.setExpanded({});
        }),
        (e.resetExpanded = (t) => {
          var n, i;
          e.setExpanded(
            t ? {} : null != (n = null == (i = e.initialState) ? void 0 : i.expanded) ? n : {},
          );
        }),
        (e.getCanSomeRowsExpand = () =>
          e.getPrePaginationRowModel().flatRows.some((e) => e.getCanExpand())),
        (e.getToggleAllRowsExpandedHandler = () => (t) => {
          (null == t.persist || t.persist(), e.toggleAllRowsExpanded());
        }),
        (e.getIsSomeRowsExpanded = () => {
          const t = e.getState().expanded;
          return !0 === t || Object.values(t).some(Boolean);
        }),
        (e.getIsAllRowsExpanded = () => {
          const t = e.getState().expanded;
          return "boolean" == typeof t
            ? !0 === t
            : !!Object.keys(t).length && !e.getRowModel().flatRows.some((e) => !e.getIsExpanded());
        }),
        (e.getExpandedDepth = () => {
          let t = 0;
          return (
            (!0 === e.getState().expanded
              ? Object.keys(e.getRowModel().rowsById)
              : Object.keys(e.getState().expanded)
            ).forEach((e) => {
              const n = e.split(".");
              t = Math.max(t, n.length);
            }),
            t
          );
        }),
        (e.getPreExpandedRowModel = () => e.getSortedRowModel()),
        (e.getExpandedRowModel = () => (
          !e._getExpandedRowModel &&
            e.options.getExpandedRowModel &&
            (e._getExpandedRowModel = e.options.getExpandedRowModel(e)),
          e.options.manualExpanding || !e._getExpandedRowModel
            ? e.getPreExpandedRowModel()
            : e._getExpandedRowModel()
        )));
    },
    createRow: (e, t) => {
      ((e.toggleExpanded = (n) => {
        t.setExpanded((i) => {
          var r;
          const o = !0 === i || !(null == i || !i[e.id]);
          let s = {};
          if (
            (!0 === i
              ? Object.keys(t.getRowModel().rowsById).forEach((e) => {
                  s[e] = !0;
                })
              : (s = i),
            (n = null != (r = n) ? r : !o),
            !o && n)
          )
            return { ...s, [e.id]: !0 };
          if (o && !n) {
            const { [e.id]: t, ...n } = s;
            return n;
          }
          return i;
        });
      }),
        (e.getIsExpanded = () => {
          var n;
          const i = t.getState().expanded;
          return !!(null !=
          (n = null == t.options.getIsRowExpanded ? void 0 : t.options.getIsRowExpanded(e))
            ? n
            : !0 === i || (null == i ? void 0 : i[e.id]));
        }),
        (e.getCanExpand = () => {
          var n, i, r;
          return null !=
            (n = null == t.options.getRowCanExpand ? void 0 : t.options.getRowCanExpand(e))
            ? n
            : (null == (i = t.options.enableExpanding) || i) &&
                !(null == (r = e.subRows) || !r.length);
        }),
        (e.getIsAllParentsExpanded = () => {
          let n = !0,
            i = e;
          for (; n && i.parentId; ) ((i = t.getRow(i.parentId, !0)), (n = i.getIsExpanded()));
          return n;
        }),
        (e.getToggleExpandedHandler = () => {
          const t = e.getCanExpand();
          return () => {
            t && e.toggleExpanded();
          };
        }));
    },
  },
  gKt = {
    getInitialState: (e) => ({
      ...e,
      pagination: { pageIndex: 0, pageSize: 10, ...(null == e ? void 0 : e.pagination) },
    }),
    getDefaultOptions: (e) => ({ onPaginationChange: Iqt("pagination", e) }),
    createTable: (e) => {
      let t = !1,
        n = !1;
      ((e._autoResetPageIndex = () => {
        var i, r;
        if (t) {
          if (
            null != (i = null != (r = e.options.autoResetAll) ? r : e.options.autoResetPageIndex)
              ? i
              : !e.options.manualPagination
          ) {
            if (n) return;
            ((n = !0),
              e._queue(() => {
                (e.resetPageIndex(), (n = !1));
              }));
          }
        } else
          e._queue(() => {
            t = !0;
          });
      }),
        (e.setPagination = (t) =>
          null == e.options.onPaginationChange
            ? void 0
            : e.options.onPaginationChange((e) => Tqt(t, e))),
        (e.resetPagination = (t) => {
          var n;
          e.setPagination(
            t
              ? { pageIndex: 0, pageSize: 10 }
              : null != (n = e.initialState.pagination)
                ? n
                : { pageIndex: 0, pageSize: 10 },
          );
        }),
        (e.setPageIndex = (t) => {
          e.setPagination((n) => {
            let i = Tqt(t, n.pageIndex);
            const r =
              void 0 === e.options.pageCount || -1 === e.options.pageCount
                ? Number.MAX_SAFE_INTEGER
                : e.options.pageCount - 1;
            return ((i = Math.max(0, Math.min(i, r))), { ...n, pageIndex: i });
          });
        }),
        (e.resetPageIndex = (t) => {
          var n, i;
          e.setPageIndex(
            t
              ? 0
              : null !=
                  (n =
                    null == (i = e.initialState) || null == (i = i.pagination)
                      ? void 0
                      : i.pageIndex)
                ? n
                : 0,
          );
        }),
        (e.resetPageSize = (t) => {
          var n, i;
          e.setPageSize(
            t
              ? 10
              : null !=
                  (n =
                    null == (i = e.initialState) || null == (i = i.pagination)
                      ? void 0
                      : i.pageSize)
                ? n
                : 10,
          );
        }),
        (e.setPageSize = (t) => {
          e.setPagination((e) => {
            const n = Math.max(1, Tqt(t, e.pageSize)),
              i = e.pageSize * e.pageIndex,
              r = Math.floor(i / n);
            return { ...e, pageIndex: r, pageSize: n };
          });
        }),
        (e.setPageCount = (t) =>
          e.setPagination((n) => {
            var i;
            let r = Tqt(t, null != (i = e.options.pageCount) ? i : -1);
            return ("number" == typeof r && (r = Math.max(-1, r)), { ...n, pageCount: r });
          })),
        (e.getPageOptions = Oqt(
          () => [e.getPageCount()],
          (e) => {
            let t = [];
            return (e && e > 0 && (t = [...new Array(e)].fill(null).map((e, t) => t)), t);
          },
          Mqt(e.options, "debugTable"),
        )),
        (e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0),
        (e.getCanNextPage = () => {
          const { pageIndex: t } = e.getState().pagination,
            n = e.getPageCount();
          return -1 === n || (0 !== n && t < n - 1);
        }),
        (e.previousPage = () => e.setPageIndex((e) => e - 1)),
        (e.nextPage = () => e.setPageIndex((e) => e + 1)),
        (e.firstPage = () => e.setPageIndex(0)),
        (e.lastPage = () => e.setPageIndex(e.getPageCount() - 1)),
        (e.getPrePaginationRowModel = () => e.getExpandedRowModel()),
        (e.getPaginationRowModel = () => (
          !e._getPaginationRowModel &&
            e.options.getPaginationRowModel &&
            (e._getPaginationRowModel = e.options.getPaginationRowModel(e)),
          e.options.manualPagination || !e._getPaginationRowModel
            ? e.getPrePaginationRowModel()
            : e._getPaginationRowModel()
        )),
        (e.getPageCount = () => {
          var t;
          return null != (t = e.options.pageCount)
            ? t
            : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
        }),
        (e.getRowCount = () => {
          var t;
          return null != (t = e.options.rowCount) ? t : e.getPrePaginationRowModel().rows.length;
        }));
    },
  },
  pKt = {
    getInitialState: (e) => ({ rowPinning: { top: [], bottom: [] }, ...e }),
    getDefaultOptions: (e) => ({ onRowPinningChange: Iqt("rowPinning", e) }),
    createRow: (e, t) => {
      ((e.pin = (n, i, r) => {
        const o = i
            ? e.getLeafRows().map((e) => {
                let { id: t } = e;
                return t;
              })
            : [],
          s = r
            ? e.getParentRows().map((e) => {
                let { id: t } = e;
                return t;
              })
            : [],
          a = new Set([...s, e.id, ...o]);
        t.setRowPinning((e) => {
          var t, i, r, o, s, l;
          return "bottom" === n
            ? {
                top: (null != (r = null == e ? void 0 : e.top) ? r : []).filter(
                  (e) => !(null != a && a.has(e)),
                ),
                bottom: [
                  ...(null != (o = null == e ? void 0 : e.bottom) ? o : []).filter(
                    (e) => !(null != a && a.has(e)),
                  ),
                  ...Array.from(a),
                ],
              }
            : "top" === n
              ? {
                  top: [
                    ...(null != (s = null == e ? void 0 : e.top) ? s : []).filter(
                      (e) => !(null != a && a.has(e)),
                    ),
                    ...Array.from(a),
                  ],
                  bottom: (null != (l = null == e ? void 0 : e.bottom) ? l : []).filter(
                    (e) => !(null != a && a.has(e)),
                  ),
                }
              : {
                  top: (null != (t = null == e ? void 0 : e.top) ? t : []).filter(
                    (e) => !(null != a && a.has(e)),
                  ),
                  bottom: (null != (i = null == e ? void 0 : e.bottom) ? i : []).filter(
                    (e) => !(null != a && a.has(e)),
                  ),
                };
        });
      }),
        (e.getCanPin = () => {
          var n;
          const { enableRowPinning: i, enablePinning: r } = t.options;
          return "function" == typeof i ? i(e) : null == (n = null != i ? i : r) || n;
        }),
        (e.getIsPinned = () => {
          const n = [e.id],
            { top: i, bottom: r } = t.getState().rowPinning,
            o = n.some((e) => (null == i ? void 0 : i.includes(e))),
            s = n.some((e) => (null == r ? void 0 : r.includes(e)));
          return o ? "top" : !!s && "bottom";
        }),
        (e.getPinnedIndex = () => {
          var n, i;
          const r = e.getIsPinned();
          if (!r) return -1;
          const o =
            null == (n = "top" === r ? t.getTopRows() : t.getBottomRows())
              ? void 0
              : n.map((e) => {
                  let { id: t } = e;
                  return t;
                });
          return null != (i = null == o ? void 0 : o.indexOf(e.id)) ? i : -1;
        }));
    },
    createTable: (e) => {
      ((e.setRowPinning = (t) =>
        null == e.options.onRowPinningChange ? void 0 : e.options.onRowPinningChange(t)),
        (e.resetRowPinning = (t) => {
          var n, i;
          return e.setRowPinning(
            t
              ? { top: [], bottom: [] }
              : null != (n = null == (i = e.initialState) ? void 0 : i.rowPinning)
                ? n
                : { top: [], bottom: [] },
          );
        }),
        (e.getIsSomeRowsPinned = (t) => {
          var n;
          const i = e.getState().rowPinning;
          var r, o;
          return t
            ? Boolean(null == (n = i[t]) ? void 0 : n.length)
            : Boolean(
                (null == (r = i.top) ? void 0 : r.length) ||
                (null == (o = i.bottom) ? void 0 : o.length),
              );
        }),
        (e._getPinnedRows = (t, n, i) => {
          var r;
          return (
            null == (r = e.options.keepPinnedRows) || r
              ? (null != n ? n : []).map((t) => {
                  const n = e.getRow(t, !0);
                  return n.getIsAllParentsExpanded() ? n : null;
                })
              : (null != n ? n : []).map((e) => t.find((t) => t.id === e))
          )
            .filter(Boolean)
            .map((e) => ({ ...e, position: i }));
        }),
        (e.getTopRows = Oqt(
          () => [e.getRowModel().rows, e.getState().rowPinning.top],
          (t, n) => e._getPinnedRows(t, n, "top"),
          Mqt(e.options, "debugRows"),
        )),
        (e.getBottomRows = Oqt(
          () => [e.getRowModel().rows, e.getState().rowPinning.bottom],
          (t, n) => e._getPinnedRows(t, n, "bottom"),
          Mqt(e.options, "debugRows"),
        )),
        (e.getCenterRows = Oqt(
          () => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom],
          (e, t, n) => {
            const i = new Set([...(null != t ? t : []), ...(null != n ? n : [])]);
            return e.filter((e) => !i.has(e.id));
          },
          Mqt(e.options, "debugRows"),
        )));
    },
  },
  fKt = {
    getInitialState: (e) => ({ rowSelection: {}, ...e }),
    getDefaultOptions: (e) => ({
      onRowSelectionChange: Iqt("rowSelection", e),
      enableRowSelection: !0,
      enableMultiRowSelection: !0,
      enableSubRowSelection: !0,
    }),
    createTable: (e) => {
      ((e.setRowSelection = (t) =>
        null == e.options.onRowSelectionChange ? void 0 : e.options.onRowSelectionChange(t)),
        (e.resetRowSelection = (t) => {
          var n;
          return e.setRowSelection(t ? {} : null != (n = e.initialState.rowSelection) ? n : {});
        }),
        (e.toggleAllRowsSelected = (t) => {
          e.setRowSelection((n) => {
            t = void 0 !== t ? t : !e.getIsAllRowsSelected();
            const i = { ...n },
              r = e.getPreGroupedRowModel().flatRows;
            return (
              t
                ? r.forEach((e) => {
                    e.getCanSelect() && (i[e.id] = !0);
                  })
                : r.forEach((e) => {
                    delete i[e.id];
                  }),
              i
            );
          });
        }),
        (e.toggleAllPageRowsSelected = (t) =>
          e.setRowSelection((n) => {
            const i = void 0 !== t ? t : !e.getIsAllPageRowsSelected(),
              r = { ...n };
            return (
              e.getRowModel().rows.forEach((t) => {
                mKt(r, t.id, i, !0, e);
              }),
              r
            );
          })),
        (e.getPreSelectedRowModel = () => e.getCoreRowModel()),
        (e.getSelectedRowModel = Oqt(
          () => [e.getState().rowSelection, e.getCoreRowModel()],
          (t, n) => (Object.keys(t).length ? _Kt(e, n) : { rows: [], flatRows: [], rowsById: {} }),
          Mqt(e.options, "debugTable"),
        )),
        (e.getFilteredSelectedRowModel = Oqt(
          () => [e.getState().rowSelection, e.getFilteredRowModel()],
          (t, n) => (Object.keys(t).length ? _Kt(e, n) : { rows: [], flatRows: [], rowsById: {} }),
          Mqt(e.options, "debugTable"),
        )),
        (e.getGroupedSelectedRowModel = Oqt(
          () => [e.getState().rowSelection, e.getSortedRowModel()],
          (t, n) => (Object.keys(t).length ? _Kt(e, n) : { rows: [], flatRows: [], rowsById: {} }),
          Mqt(e.options, "debugTable"),
        )),
        (e.getIsAllRowsSelected = () => {
          const t = e.getFilteredRowModel().flatRows,
            { rowSelection: n } = e.getState();
          let i = Boolean(t.length && Object.keys(n).length);
          return (i && t.some((e) => e.getCanSelect() && !n[e.id]) && (i = !1), i);
        }),
        (e.getIsAllPageRowsSelected = () => {
          const t = e.getPaginationRowModel().flatRows.filter((e) => e.getCanSelect()),
            { rowSelection: n } = e.getState();
          let i = !!t.length;
          return (i && t.some((e) => !n[e.id]) && (i = !1), i);
        }),
        (e.getIsSomeRowsSelected = () => {
          var t;
          const n = Object.keys(null != (t = e.getState().rowSelection) ? t : {}).length;
          return n > 0 && n < e.getFilteredRowModel().flatRows.length;
        }),
        (e.getIsSomePageRowsSelected = () => {
          const t = e.getPaginationRowModel().flatRows;
          return (
            !e.getIsAllPageRowsSelected() &&
            t
              .filter((e) => e.getCanSelect())
              .some((e) => e.getIsSelected() || e.getIsSomeSelected())
          );
        }),
        (e.getToggleAllRowsSelectedHandler = () => (t) => {
          e.toggleAllRowsSelected(t.target.checked);
        }),
        (e.getToggleAllPageRowsSelectedHandler = () => (t) => {
          e.toggleAllPageRowsSelected(t.target.checked);
        }));
    },
    createRow: (e, t) => {
      ((e.toggleSelected = (n, i) => {
        const r = e.getIsSelected();
        t.setRowSelection((o) => {
          var s;
          if (((n = void 0 !== n ? n : !r), e.getCanSelect() && r === n)) return o;
          const a = { ...o };
          return (mKt(a, e.id, n, null == (s = null == i ? void 0 : i.selectChildren) || s, t), a);
        });
      }),
        (e.getIsSelected = () => {
          const { rowSelection: n } = t.getState();
          return vKt(e, n);
        }),
        (e.getIsSomeSelected = () => {
          const { rowSelection: n } = t.getState();
          return "some" === bKt(e, n);
        }),
        (e.getIsAllSubRowsSelected = () => {
          const { rowSelection: n } = t.getState();
          return "all" === bKt(e, n);
        }),
        (e.getCanSelect = () => {
          var n;
          return "function" == typeof t.options.enableRowSelection
            ? t.options.enableRowSelection(e)
            : null == (n = t.options.enableRowSelection) || n;
        }),
        (e.getCanSelectSubRows = () => {
          var n;
          return "function" == typeof t.options.enableSubRowSelection
            ? t.options.enableSubRowSelection(e)
            : null == (n = t.options.enableSubRowSelection) || n;
        }),
        (e.getCanMultiSelect = () => {
          var n;
          return "function" == typeof t.options.enableMultiRowSelection
            ? t.options.enableMultiRowSelection(e)
            : null == (n = t.options.enableMultiRowSelection) || n;
        }),
        (e.getToggleSelectedHandler = () => {
          const t = e.getCanSelect();
          return (n) => {
            var i;
            t && e.toggleSelected(null == (i = n.target) ? void 0 : i.checked);
          };
        }));
    },
  },
  mKt = (e, t, n, i, r) => {
    var o;
    const s = r.getRow(t, !0);
    (n
      ? (s.getCanMultiSelect() || Object.keys(e).forEach((t) => delete e[t]),
        s.getCanSelect() && (e[t] = !0))
      : delete e[t],
      i &&
        null != (o = s.subRows) &&
        o.length &&
        s.getCanSelectSubRows() &&
        s.subRows.forEach((t) => mKt(e, t.id, n, i, r)));
  };
function _Kt(e, t) {
  const n = e.getState().rowSelection,
    i = [],
    r = {},
    o = function (e, t) {
      return e
        .map((e) => {
          var t;
          const s = vKt(e, n);
          if (
            (s && (i.push(e), (r[e.id] = e)),
            null != (t = e.subRows) && t.length && (e = { ...e, subRows: o(e.subRows) }),
            s)
          )
            return e;
        })
        .filter(Boolean);
    };
  return { rows: o(t.rows), flatRows: i, rowsById: r };
}
function vKt(e, t) {
  var n;
  return null != (n = t[e.id]) && n;
}
function bKt(e, t, n) {
  var i;
  if (null == (i = e.subRows) || !i.length) return !1;
  let r = !0,
    o = !1;
  return (
    e.subRows.forEach((e) => {
      if (
        (!o || r) &&
        (e.getCanSelect() && (vKt(e, t) ? (o = !0) : (r = !1)), e.subRows && e.subRows.length)
      ) {
        const n = bKt(e, t);
        "all" === n ? (o = !0) : "some" === n ? ((o = !0), (r = !1)) : (r = !1);
      }
    }),
    r ? "all" : !!o && "some"
  );
}
const yKt = /([0-9]+)/gm;
function xKt(e, t) {
  return e === t ? 0 : e > t ? 1 : -1;
}
function wKt(e) {
  return "number" == typeof e
    ? isNaN(e) || e === 1 / 0 || e === -1 / 0
      ? ""
      : String(e)
    : "string" == typeof e
      ? e
      : "";
}
function CKt(e, t) {
  const n = e.split(yKt).filter(Boolean),
    i = t.split(yKt).filter(Boolean);
  for (; n.length && i.length; ) {
    const e = n.shift(),
      t = i.shift(),
      r = parseInt(e, 10),
      o = parseInt(t, 10),
      s = [r, o].sort();
    if (isNaN(s[0])) {
      if (e > t) return 1;
      if (t > e) return -1;
    } else {
      if (isNaN(s[1])) return isNaN(r) ? -1 : 1;
      if (r > o) return 1;
      if (o > r) return -1;
    }
  }
  return n.length - i.length;
}
const SKt = {
    alphanumeric: (e, t, n) =>
      CKt(wKt(e.getValue(n)).toLowerCase(), wKt(t.getValue(n)).toLowerCase()),
    alphanumericCaseSensitive: (e, t, n) => CKt(wKt(e.getValue(n)), wKt(t.getValue(n))),
    text: (e, t, n) => xKt(wKt(e.getValue(n)).toLowerCase(), wKt(t.getValue(n)).toLowerCase()),
    textCaseSensitive: (e, t, n) => xKt(wKt(e.getValue(n)), wKt(t.getValue(n))),
    datetime: (e, t, n) => {
      const i = e.getValue(n),
        r = t.getValue(n);
      return i > r ? 1 : i < r ? -1 : 0;
    },
    basic: (e, t, n) => xKt(e.getValue(n), t.getValue(n)),
  },
  kKt = {
    getInitialState: (e) => ({ sorting: [], ...e }),
    getDefaultColumnDef: () => ({ sortingFn: "auto", sortUndefined: 1 }),
    getDefaultOptions: (e) => ({
      onSortingChange: Iqt("sorting", e),
      isMultiSortEvent: (e) => e.shiftKey,
    }),
    createColumn: (e, t) => {
      ((e.getAutoSortingFn = () => {
        const n = t.getFilteredRowModel().flatRows.slice(10);
        let i = !1;
        for (const t of n) {
          const n = null == t ? void 0 : t.getValue(e.id);
          if ("[object Date]" === Object.prototype.toString.call(n)) return SKt.datetime;
          if ("string" == typeof n && ((i = !0), n.split(yKt).length > 1)) return SKt.alphanumeric;
        }
        return i ? SKt.text : SKt.basic;
      }),
        (e.getAutoSortDir = () => {
          const n = t.getFilteredRowModel().flatRows[0];
          return "string" == typeof (null == n ? void 0 : n.getValue(e.id)) ? "asc" : "desc";
        }),
        (e.getSortingFn = () => {
          var n, i;
          if (!e) throw new Error();
          return Rqt(e.columnDef.sortingFn)
            ? e.columnDef.sortingFn
            : "auto" === e.columnDef.sortingFn
              ? e.getAutoSortingFn()
              : null != (n = null == (i = t.options.sortingFns) ? void 0 : i[e.columnDef.sortingFn])
                ? n
                : SKt[e.columnDef.sortingFn];
        }),
        (e.toggleSorting = (n, i) => {
          const r = e.getNextSortingOrder(),
            o = null != n;
          t.setSorting((s) => {
            const a = null == s ? void 0 : s.find((t) => t.id === e.id),
              l = null == s ? void 0 : s.findIndex((t) => t.id === e.id);
            let c,
              d = [],
              u = o ? n : "desc" === r;
            var h;
            ((c =
              null != s && s.length && e.getCanMultiSort() && i
                ? a
                  ? "toggle"
                  : "add"
                : null != s && s.length && l !== s.length - 1
                  ? "replace"
                  : a
                    ? "toggle"
                    : "replace"),
            "toggle" === c && (o || r || (c = "remove")),
            "add" === c)
              ? ((d = [...s, { id: e.id, desc: u }]),
                d.splice(
                  0,
                  d.length -
                    (null != (h = t.options.maxMultiSortColCount) ? h : Number.MAX_SAFE_INTEGER),
                ))
              : (d =
                  "toggle" === c
                    ? s.map((t) => (t.id === e.id ? { ...t, desc: u } : t))
                    : "remove" === c
                      ? s.filter((t) => t.id !== e.id)
                      : [{ id: e.id, desc: u }]);
            return d;
          });
        }),
        (e.getFirstSortDir = () => {
          var n, i;
          return (
            null != (n = null != (i = e.columnDef.sortDescFirst) ? i : t.options.sortDescFirst)
              ? n
              : "desc" === e.getAutoSortDir()
          )
            ? "desc"
            : "asc";
        }),
        (e.getNextSortingOrder = (n) => {
          var i, r;
          const o = e.getFirstSortDir(),
            s = e.getIsSorted();
          return s
            ? !!(
                s === o ||
                (null != (i = t.options.enableSortingRemoval) && !i) ||
                (n && null != (r = t.options.enableMultiRemove) && !r)
              ) && ("desc" === s ? "asc" : "desc")
            : o;
        }),
        (e.getCanSort = () => {
          var n, i;
          return (
            (null == (n = e.columnDef.enableSorting) || n) &&
            (null == (i = t.options.enableSorting) || i) &&
            !!e.accessorFn
          );
        }),
        (e.getCanMultiSort = () => {
          var n, i;
          return null !=
            (n = null != (i = e.columnDef.enableMultiSort) ? i : t.options.enableMultiSort)
            ? n
            : !!e.accessorFn;
        }),
        (e.getIsSorted = () => {
          var n;
          const i = null == (n = t.getState().sorting) ? void 0 : n.find((t) => t.id === e.id);
          return !!i && (i.desc ? "desc" : "asc");
        }),
        (e.getSortIndex = () => {
          var n, i;
          return null !=
            (n = null == (i = t.getState().sorting) ? void 0 : i.findIndex((t) => t.id === e.id))
            ? n
            : -1;
        }),
        (e.clearSorting = () => {
          t.setSorting((t) => (null != t && t.length ? t.filter((t) => t.id !== e.id) : []));
        }),
        (e.getToggleSortingHandler = () => {
          const n = e.getCanSort();
          return (i) => {
            n &&
              (null == i.persist || i.persist(),
              null == e.toggleSorting ||
                e.toggleSorting(
                  void 0,
                  !!e.getCanMultiSort() &&
                    (null == t.options.isMultiSortEvent ? void 0 : t.options.isMultiSortEvent(i)),
                ));
          };
        }));
    },
    createTable: (e) => {
      ((e.setSorting = (t) =>
        null == e.options.onSortingChange ? void 0 : e.options.onSortingChange(t)),
        (e.resetSorting = (t) => {
          var n, i;
          e.setSorting(
            t ? [] : null != (n = null == (i = e.initialState) ? void 0 : i.sorting) ? n : [],
          );
        }),
        (e.getPreSortedRowModel = () => e.getGroupedRowModel()),
        (e.getSortedRowModel = () => (
          !e._getSortedRowModel &&
            e.options.getSortedRowModel &&
            (e._getSortedRowModel = e.options.getSortedRowModel(e)),
          e.options.manualSorting || !e._getSortedRowModel
            ? e.getPreSortedRowModel()
            : e._getSortedRowModel()
        )));
    },
  },
  EKt = [jqt, lKt, nKt, iKt, Vqt, Qqt, dKt, uKt, kKt, tKt, hKt, gKt, pKt, fKt, oKt];
function NKt(e) {
  var t, n;
  const i = [...EKt, ...(null != (t = e._features) ? t : [])];
  let r = { _features: i };
  const o = r._features.reduce(
    (e, t) => Object.assign(e, null == t.getDefaultOptions ? void 0 : t.getDefaultOptions(r)),
    {},
  );
  let s = { ...(null != (n = e.initialState) ? n : {}) };
  r._features.forEach((e) => {
    var t;
    s = null != (t = null == e.getInitialState ? void 0 : e.getInitialState(s)) ? t : s;
  });
  const a = [];
  let l = !1;
  const c = {
    _features: i,
    options: { ...o, ...e },
    initialState: s,
    _queue: (e) => {
      (a.push(e),
        l ||
          ((l = !0),
          Promise.resolve()
            .then(() => {
              for (; a.length; ) a.shift()();
              l = !1;
            })
            .catch((e) =>
              setTimeout(() => {
                throw e;
              }),
            )));
    },
    reset: () => {
      r.setState(r.initialState);
    },
    setOptions: (e) => {
      const t = Tqt(e, r.options);
      var n;
      r.options = ((n = t), r.options.mergeOptions ? r.options.mergeOptions(o, n) : { ...o, ...n });
    },
    getState: () => r.options.state,
    setState: (e) => {
      null == r.options.onStateChange || r.options.onStateChange(e);
    },
    _getRowId: (e, t, n) => {
      var i;
      return null != (i = null == r.options.getRowId ? void 0 : r.options.getRowId(e, t, n))
        ? i
        : `${n ? [n.id, t].join(".") : t}`;
    },
    getCoreRowModel: () => (
      r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)),
      r._getCoreRowModel()
    ),
    getRowModel: () => r.getPaginationRowModel(),
    getRow: (e, t) => {
      let n = (t ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[e];
      if (!n && ((n = r.getCoreRowModel().rowsById[e]), !n)) throw new Error();
      return n;
    },
    _getDefaultColumnDef: Oqt(
      () => [r.options.defaultColumn],
      (e) => {
        var t;
        return (
          (e = null != (t = e) ? t : {}),
          {
            header: (e) => {
              const t = e.header.column.columnDef;
              return t.accessorKey ? t.accessorKey : t.accessorFn ? t.id : null;
            },
            cell: (e) => {
              var t, n;
              return null !=
                (t = null == (n = e.renderValue()) || null == n.toString ? void 0 : n.toString())
                ? t
                : null;
            },
            ...r._features.reduce(
              (e, t) =>
                Object.assign(e, null == t.getDefaultColumnDef ? void 0 : t.getDefaultColumnDef()),
              {},
            ),
            ...e,
          }
        );
      },
      Mqt(e, "debugColumns"),
    ),
    _getColumnDefs: () => r.options.columns,
    getAllColumns: Oqt(
      () => [r._getColumnDefs()],
      (e) => {
        const t = function (e, n, i) {
          return (
            void 0 === i && (i = 0),
            e.map((e) => {
              const o = (function (e, t, n, i) {
                  var r, o;
                  const s = { ...e._getDefaultColumnDef(), ...t },
                    a = s.accessorKey;
                  let l,
                    c =
                      null !=
                      (r =
                        null != (o = s.id)
                          ? o
                          : a
                            ? "function" == typeof String.prototype.replaceAll
                              ? a.replaceAll(".", "_")
                              : a.replace(/\./g, "_")
                            : void 0)
                        ? r
                        : "string" == typeof s.header
                          ? s.header
                          : void 0;
                  if (
                    (s.accessorFn
                      ? (l = s.accessorFn)
                      : a &&
                        (l = a.includes(".")
                          ? (e) => {
                              let t = e;
                              for (const i of a.split(".")) {
                                var n;
                                t = null == (n = t) ? void 0 : n[i];
                              }
                              return t;
                            }
                          : (e) => e[s.accessorKey]),
                    !c)
                  )
                    throw new Error();
                  let d = {
                    id: `${String(c)}`,
                    accessorFn: l,
                    parent: i,
                    depth: n,
                    columnDef: s,
                    columns: [],
                    getFlatColumns: Oqt(
                      () => [!0],
                      () => {
                        var e;
                        return [
                          d,
                          ...(null == (e = d.columns)
                            ? void 0
                            : e.flatMap((e) => e.getFlatColumns())),
                        ];
                      },
                      Mqt(e.options, "debugColumns"),
                    ),
                    getLeafColumns: Oqt(
                      () => [e._getOrderColumnsFn()],
                      (e) => {
                        var t;
                        return null != (t = d.columns) && t.length
                          ? e(d.columns.flatMap((e) => e.getLeafColumns()))
                          : [d];
                      },
                      Mqt(e.options, "debugColumns"),
                    ),
                  };
                  for (const u of e._features) null == u.createColumn || u.createColumn(d, e);
                  return d;
                })(r, e, i, n),
                s = e;
              return ((o.columns = s.columns ? t(s.columns, o, i + 1) : []), o);
            })
          );
        };
        return t(e);
      },
      Mqt(e, "debugColumns"),
    ),
    getAllFlatColumns: Oqt(
      () => [r.getAllColumns()],
      (e) => e.flatMap((e) => e.getFlatColumns()),
      Mqt(e, "debugColumns"),
    ),
    _getAllFlatColumnsById: Oqt(
      () => [r.getAllFlatColumns()],
      (e) => e.reduce((e, t) => ((e[t.id] = t), e), {}),
      Mqt(e, "debugColumns"),
    ),
    getAllLeafColumns: Oqt(
      () => [r.getAllColumns(), r._getOrderColumnsFn()],
      (e, t) => t(e.flatMap((e) => e.getLeafColumns())),
      Mqt(e, "debugColumns"),
    ),
    getColumn: (e) => r._getAllFlatColumnsById()[e],
  };
  Object.assign(r, c);
  for (let d = 0; d < r._features.length; d++) {
    const e = r._features[d];
    null == e || null == e.createTable || e.createTable(r);
  }
  return r;
}
function LKt() {
  return (e) =>
    Oqt(
      () => [e.options.data],
      (t) => {
        const n = { rows: [], flatRows: [], rowsById: {} },
          i = function (t, r, o) {
            void 0 === r && (r = 0);
            const s = [];
            for (let l = 0; l < t.length; l++) {
              const c = Bqt(e, e._getRowId(t[l], l, o), t[l], l, r, 0, null == o ? void 0 : o.id);
              var a;
              if ((n.flatRows.push(c), (n.rowsById[c.id] = c), s.push(c), e.options.getSubRows))
                ((c.originalSubRows = e.options.getSubRows(t[l], l)),
                  null != (a = c.originalSubRows) &&
                    a.length &&
                    (c.subRows = i(c.originalSubRows, r + 1, c)));
            }
            return s;
          };
        return ((n.rows = i(t)), n);
      },
      Mqt(e.options, "debugTable", 0, () => e._autoResetPageIndex()),
    );
}
function DKt(e, t, n) {
  return n.options.filterFromLeafRows
    ? (function (e, t, n) {
        var i;
        const r = [],
          o = {},
          s = null != (i = n.options.maxLeafRowFilterDepth) ? i : 100,
          a = function (e, i) {
            void 0 === i && (i = 0);
            const l = [];
            for (let d = 0; d < e.length; d++) {
              var c;
              let u = e[d];
              const h = Bqt(n, u.id, u.original, u.index, u.depth, 0, u.parentId);
              if (
                ((h.columnFilters = u.columnFilters), null != (c = u.subRows) && c.length && i < s)
              ) {
                if (((h.subRows = a(u.subRows, i + 1)), (u = h), t(u) && !h.subRows.length)) {
                  (l.push(u), (o[u.id] = u), r.push(u));
                  continue;
                }
                if (t(u) || h.subRows.length) {
                  (l.push(u), (o[u.id] = u), r.push(u));
                  continue;
                }
              } else ((u = h), t(u) && (l.push(u), (o[u.id] = u), r.push(u)));
            }
            return l;
          };
        return { rows: a(e), flatRows: r, rowsById: o };
      })(e, t, n)
    : (function (e, t, n) {
        var i;
        const r = [],
          o = {},
          s = null != (i = n.options.maxLeafRowFilterDepth) ? i : 100,
          a = function (e, i) {
            void 0 === i && (i = 0);
            const l = [];
            for (let d = 0; d < e.length; d++) {
              let u = e[d];
              if (t(u)) {
                var c;
                if (null != (c = u.subRows) && c.length && i < s) {
                  const e = Bqt(n, u.id, u.original, u.index, u.depth, 0, u.parentId);
                  ((e.subRows = a(u.subRows, i + 1)), (u = e));
                }
                (l.push(u), r.push(u), (o[u.id] = u));
              }
            }
            return l;
          };
        return { rows: a(e), flatRows: r, rowsById: o };
      })(e, t, n);
}
function TKt() {
  return (e, t) =>
    Oqt(
      () => [
        e.getPreFilteredRowModel(),
        e.getState().columnFilters,
        e.getState().globalFilter,
        e.getFilteredRowModel(),
      ],
      (n, i, r) => {
        if (!n.rows.length || ((null == i || !i.length) && !r)) return n;
        const o = [...i.map((e) => e.id).filter((e) => e !== t), r ? "__global__" : void 0].filter(
          Boolean,
        );
        return DKt(
          n.rows,
          (e) => {
            for (let t = 0; t < o.length; t++) if (!1 === e.columnFilters[o[t]]) return !1;
            return !0;
          },
          e,
        );
      },
      Mqt(e.options, "debugTable"),
    );
}
function IKt() {
  return (e, t) =>
    Oqt(
      () => {
        var n;
        return [null == (n = e.getColumn(t)) ? void 0 : n.getFacetedRowModel()];
      },
      (e) => {
        if (!e) return new Map();
        let n = new Map();
        for (let r = 0; r < e.flatRows.length; r++) {
          const o = e.flatRows[r].getUniqueValues(t);
          for (let e = 0; e < o.length; e++) {
            const t = o[e];
            var i;
            if (n.has(t)) n.set(t, (null != (i = n.get(t)) ? i : 0) + 1);
            else n.set(t, 1);
          }
        }
        return n;
      },
      Mqt(e.options, "debugTable"),
    );
}
function RKt() {
  return (e) =>
    Oqt(
      () => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter],
      (t, n, i) => {
        if (!t.rows.length || ((null == n || !n.length) && !i)) {
          for (let e = 0; e < t.flatRows.length; e++)
            ((t.flatRows[e].columnFilters = {}), (t.flatRows[e].columnFiltersMeta = {}));
          return t;
        }
        const r = [],
          o = [];
        (null != n ? n : []).forEach((t) => {
          var n;
          const i = e.getColumn(t.id);
          if (!i) return;
          const o = i.getFilterFn();
          o &&
            r.push({
              id: t.id,
              filterFn: o,
              resolvedValue:
                null != (n = null == o.resolveFilterValue ? void 0 : o.resolveFilterValue(t.value))
                  ? n
                  : t.value,
            });
        });
        const s = (null != n ? n : []).map((e) => e.id),
          a = e.getGlobalFilterFn(),
          l = e.getAllLeafColumns().filter((e) => e.getCanGlobalFilter());
        let c, d;
        i &&
          a &&
          l.length &&
          (s.push("__global__"),
          l.forEach((e) => {
            var t;
            o.push({
              id: e.id,
              filterFn: a,
              resolvedValue:
                null != (t = null == a.resolveFilterValue ? void 0 : a.resolveFilterValue(i))
                  ? t
                  : i,
            });
          }));
        for (let e = 0; e < t.flatRows.length; e++) {
          const n = t.flatRows[e];
          if (((n.columnFilters = {}), r.length))
            for (let e = 0; e < r.length; e++) {
              c = r[e];
              const t = c.id;
              n.columnFilters[t] = c.filterFn(n, t, c.resolvedValue, (e) => {
                n.columnFiltersMeta[t] = e;
              });
            }
          if (o.length) {
            for (let e = 0; e < o.length; e++) {
              d = o[e];
              const t = d.id;
              if (
                d.filterFn(n, t, d.resolvedValue, (e) => {
                  n.columnFiltersMeta[t] = e;
                })
              ) {
                n.columnFilters.__global__ = !0;
                break;
              }
            }
            !0 !== n.columnFilters.__global__ && (n.columnFilters.__global__ = !1);
          }
        }
        return DKt(
          t.rows,
          (e) => {
            for (let t = 0; t < s.length; t++) if (!1 === e.columnFilters[s[t]]) return !1;
            return !0;
          },
          e,
        );
      },
      Mqt(e.options, "debugTable", 0, () => e._autoResetPageIndex()),
    );
}
function OKt(e) {
  return (e) =>
    Oqt(
      () => [
        e.getState().pagination,
        e.getPrePaginationRowModel(),
        e.options.paginateExpandedRows ? void 0 : e.getState().expanded,
      ],
      (t, n) => {
        if (!n.rows.length) return n;
        const { pageSize: i, pageIndex: r } = t;
        let { rows: o, flatRows: s, rowsById: a } = n;
        const l = i * r,
          c = l + i;
        let d;
        ((o = o.slice(l, c)),
          (d = e.options.paginateExpandedRows
            ? { rows: o, flatRows: s, rowsById: a }
            : (function (e) {
                const t = [],
                  n = (e) => {
                    var i;
                    (t.push(e),
                      null != (i = e.subRows) &&
                        i.length &&
                        e.getIsExpanded() &&
                        e.subRows.forEach(n));
                  };
                return (e.rows.forEach(n), { rows: t, flatRows: e.flatRows, rowsById: e.rowsById });
              })({ rows: o, flatRows: s, rowsById: a })),
          (d.flatRows = []));
        const u = (e) => {
          (d.flatRows.push(e), e.subRows.length && e.subRows.forEach(u));
        };
        return (d.rows.forEach(u), d);
      },
      Mqt(e.options, "debugTable"),
    );
}
function MKt() {
  return (e) =>
    Oqt(
      () => [e.getState().sorting, e.getPreSortedRowModel()],
      (t, n) => {
        if (!n.rows.length || null == t || !t.length) return n;
        const i = e.getState().sorting,
          r = [],
          o = i.filter((t) => {
            var n;
            return null == (n = e.getColumn(t.id)) ? void 0 : n.getCanSort();
          }),
          s = {};
        o.forEach((t) => {
          const n = e.getColumn(t.id);
          n &&
            (s[t.id] = {
              sortUndefined: n.columnDef.sortUndefined,
              invertSorting: n.columnDef.invertSorting,
              sortingFn: n.getSortingFn(),
            });
        });
        const a = (e) => {
          const t = e.map((e) => ({ ...e }));
          return (
            t.sort((e, t) => {
              for (let i = 0; i < o.length; i += 1) {
                var n;
                const r = o[i],
                  a = s[r.id],
                  l = a.sortUndefined,
                  c = null != (n = null == r ? void 0 : r.desc) && n;
                let d = 0;
                if (l) {
                  const n = void 0 === e.getValue(r.id),
                    i = void 0 === t.getValue(r.id);
                  if (n || i) {
                    if ("first" === l) return n ? -1 : 1;
                    if ("last" === l) return n ? 1 : -1;
                    d = n && i ? 0 : n ? l : -l;
                  }
                }
                if ((0 === d && (d = a.sortingFn(e, t, r.id)), 0 !== d))
                  return (c && (d *= -1), a.invertSorting && (d *= -1), d);
              }
              return e.index - t.index;
            }),
            t.forEach((e) => {
              var t;
              (r.push(e), null != (t = e.subRows) && t.length && (e.subRows = a(e.subRows)));
            }),
            t
          );
        };
        return { rows: a(n.rows), flatRows: r, rowsById: n.rowsById };
      },
      Mqt(e.options, "debugTable", 0, () => e._autoResetPageIndex()),
    );
}
/**
 * react-table
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */ function AKt(e, t) {
  return e
    ? (function (e) {
        return (
          "function" == typeof e &&
          (() => {
            const t = Object.getPrototypeOf(e);
            return t.prototype && t.prototype.isReactComponent;
          })()
        );
      })((n = e)) ||
      "function" == typeof n ||
      (function (e) {
        return (
          "object" == typeof e &&
          "symbol" == typeof e.$$typeof &&
          ["react.memo", "react.forward_ref"].includes(e.$$typeof.description)
        );
      })(n)
      ? H.createElement(e, t)
      : e
    : null;
  var n;
}
function PKt(e) {
  const t = { state: {}, onStateChange: () => {}, renderFallbackValue: null, ...e },
    [n] = H.useState(() => ({ current: NKt(t) })),
    [i, r] = H.useState(() => n.current.initialState);
  return (
    n.current.setOptions((t) => ({
      ...t,
      ...e,
      state: { ...i, ...e.state },
      onStateChange: (t) => {
        (r(t), null == e.onStateChange || e.onStateChange(t));
      },
    })),
    n.current
  );
}
const jKt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("div", {
    className: "relative w-full overflow-auto",
    children: Q.jsx("table", { ref: n, className: Rf("w-full caption-bottom text-sm", e), ...t }),
  }),
);
jKt.displayName = "Table";
const FKt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("thead", { ref: n, className: Rf("[&_tr]:border-b", e), ...t }),
);
FKt.displayName = "TableHeader";
const BKt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("tbody", { ref: n, className: Rf("[&_tr:last-child]:border-0", e), ...t }),
);
BKt.displayName = "TableBody";
const VKt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("tfoot", {
    ref: n,
    className: Rf("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", e),
    ...t,
  }),
);
VKt.displayName = "TableFooter";
const WKt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("tr", {
    ref: n,
    className: Rf("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", e),
    ...t,
  }),
);
WKt.displayName = "TableRow";
const HKt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("th", {
    ref: n,
    className: Rf(
      "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
      e,
    ),
    ...t,
  }),
);
HKt.displayName = "TableHead";
const zKt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("td", {
    ref: n,
    className: Rf(
      "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
      e,
    ),
    ...t,
  }),
);
zKt.displayName = "TableCell";
const UKt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("caption", { ref: n, className: Rf("mt-4 text-sm text-muted-foreground", e), ...t }),
);
function $Kt({ table: e }) {
  const [t, n] = H.useState(""),
    { t: i } = Py("common"),
    r = e.getState().pagination.pageIndex;
  H.useEffect(() => {
    n((r + 1).toString());
  }, [r]);
  const o = (t) => {
    const i = parseInt(t);
    !isNaN(i) && i >= 1 && i <= e.getPageCount()
      ? e.setPageIndex(i - 1)
      : n((e.getState().pagination.pageIndex + 1).toString());
  };
  return Q.jsxs("div", {
    className:
      "flex flex-col-reverse gap-4 px-2 py-4 sm:flex-row sm:items-center sm:justify-between",
    children: [
      Q.jsx("div", {
        className: "flex-1 text-sm text-muted-foreground",
        children: i("table.pagination.selected", {
          selected: e.getFilteredSelectedRowModel().rows.length,
          total: e.getFilteredRowModel().rows.length,
        }),
      }),
      Q.jsxs("div", {
        className: "flex flex-col-reverse items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",
        children: [
          Q.jsxs("div", {
            className: "flex items-center space-x-2",
            children: [
              Q.jsx("p", {
                className: "text-sm font-medium",
                children: i("table.pagination.itemsPerPage"),
              }),
              Q.jsxs(THt, {
                value: `${e.getState().pagination.pageSize}`,
                onValueChange: (t) => {
                  e.setPageSize(Number(t));
                },
                children: [
                  Q.jsx(OHt, {
                    className: "h-8 w-[70px]",
                    children: Q.jsx(RHt, { placeholder: e.getState().pagination.pageSize }),
                  }),
                  Q.jsx(PHt, {
                    side: "top",
                    children: [10, 20, 30, 40, 50, 100, 500].map((e) =>
                      Q.jsx(FHt, { value: `${e}`, children: e }, e),
                    ),
                  }),
                ],
              }),
            ],
          }),
          Q.jsxs("div", {
            className: "flex items-center justify-center space-x-2 text-sm font-medium",
            children: [
              Q.jsx("span", { children: i("table.pagination.page") }),
              Q.jsx(Q6e, {
                type: "text",
                value: t,
                onChange: (e) => n(e.target.value),
                onBlur: (e) => o(e.target.value),
                onKeyDown: (e) => {
                  "Enter" === e.key && o(e.currentTarget.value);
                },
                className: "h-8 w-[50px] text-center",
              }),
              Q.jsx("span", {
                children: i("table.pagination.pageOf", { total: e.getPageCount() }),
              }),
            ],
          }),
          Q.jsxs("div", {
            className: "flex items-center space-x-2",
            children: [
              Q.jsxs(Nm, {
                variant: "outline",
                className: "hidden h-8 w-8 p-0 lg:flex",
                onClick: () => e.setPageIndex(0),
                disabled: !e.getCanPreviousPage(),
                children: [
                  Q.jsx("span", {
                    className: "sr-only",
                    children: i("table.pagination.firstPage"),
                  }),
                  Q.jsx(R7e, { className: "h-4 w-4" }),
                ],
              }),
              Q.jsxs(Nm, {
                variant: "outline",
                className: "h-8 w-8 p-0",
                onClick: () => e.previousPage(),
                disabled: !e.getCanPreviousPage(),
                children: [
                  Q.jsx("span", {
                    className: "sr-only",
                    children: i("table.pagination.previousPage"),
                  }),
                  Q.jsx(v7e, { className: "h-4 w-4" }),
                ],
              }),
              Q.jsxs(Nm, {
                variant: "outline",
                className: "h-8 w-8 p-0",
                onClick: () => e.nextPage(),
                disabled: !e.getCanNextPage(),
                children: [
                  Q.jsx("span", { className: "sr-only", children: i("table.pagination.nextPage") }),
                  Q.jsx(y7e, { className: "h-4 w-4" }),
                ],
              }),
              Q.jsxs(Nm, {
                variant: "outline",
                className: "hidden h-8 w-8 p-0 lg:flex",
                onClick: () => e.setPageIndex(e.getPageCount() - 1),
                disabled: !e.getCanNextPage(),
                children: [
                  Q.jsx("span", { className: "sr-only", children: i("table.pagination.lastPage") }),
                  Q.jsx(M7e, { className: "h-4 w-4" }),
                ],
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
function qKt(e) {
  if (!e || "object" != typeof e) return null;
  const t = e;
  if ("string" == typeof e) return e;
  if (t.props?.title && "string" == typeof t.props.title) return t.props.title;
  if (t.props?.children) {
    const { children: e } = t.props;
    if ("string" == typeof e) return e;
    if (Array.isArray(e))
      for (const t of e) {
        const e = qKt(t);
        if (e) return e;
      }
    if ("object" == typeof e) {
      const t = qKt(e);
      if (t) return t;
    }
  }
  return null;
}
function KKt(e, t) {
  if ("string" == typeof e) return e;
  if ("function" == typeof e)
    try {
      const t = e({ column: {} });
      if ("string" == typeof t) return t;
      if (t) {
        const e = qKt(t);
        if (e) return e;
      }
    } catch {}
  return t;
}
UKt.displayName = "TableCaption";
const GKt = ["select", "drag-handle", "actions"];
function ZKt({
  row: e,
  primaryField: t,
  secondaryFields: n,
  gridFields: i,
  className: r,
  actionSlot: o,
  excludeColumns: s = GKt,
}) {
  const a = e.getVisibleCells(),
    l = a.filter((e) => "right" === e.column.getIsPinned()),
    c = a.filter((e) => !s.includes(e.column.id) && "right" !== e.column.getIsPinned()),
    d = t ? c.find((e) => e.column.id === t) : null,
    u = n
      ? c.filter((e) => n.includes(e.column.id))
      : c.filter((e) => e.column.id !== t && !GKt.includes(e.column.id)),
    h = i ? c.filter((e) => i.includes(e.column.id)) : [],
    g = u.filter((e) => !i?.includes(e.column.id));
  return Q.jsx(q6e, {
    className: Rf("overflow-hidden", r),
    children: Q.jsxs(Y6e, {
      className: "p-0",
      children: [
        d &&
          Q.jsx("div", {
            className: "border-b bg-muted/30 px-4 py-3",
            children: Q.jsxs("div", {
              className: "flex items-center justify-between",
              children: [
                Q.jsx("div", {
                  className: "min-w-0 flex-1",
                  children: AKt(d.column.columnDef.cell, d.getContext()),
                }),
                (l.length > 0 || o) &&
                  Q.jsxs("div", {
                    className: "ml-2 flex items-center",
                    children: [
                      l.map((e) =>
                        Q.jsx(
                          "span",
                          { children: AKt(e.column.columnDef.cell, e.getContext()) },
                          e.id,
                        ),
                      ),
                      o,
                    ],
                  }),
              ],
            }),
          }),
        g.length > 0 &&
          Q.jsx("div", {
            className: "space-y-2 px-4 py-3",
            children: g.map((e) =>
              ((e, t = !0) => {
                const n = KKt(e.column.columnDef.header, e.column.id);
                return Q.jsxs(
                  "div",
                  {
                    className: "flex items-start justify-between gap-2",
                    children: [
                      t &&
                        Q.jsx("span", {
                          className: "shrink-0 text-xs text-muted-foreground",
                          children: n,
                        }),
                      Q.jsx("div", {
                        className: Rf(
                          "min-w-0 flex-1 [&>div]:!justify-end [&>div]:!px-0",
                          t && "text-right",
                        ),
                        children: AKt(e.column.columnDef.cell, e.getContext()),
                      }),
                    ],
                  },
                  e.id,
                );
              })(e),
            ),
          }),
        h.length > 0 &&
          Q.jsx("div", {
            className: Rf(
              "grid gap-3 border-t bg-muted/20 px-4 py-3",
              1 === h.length ? "grid-cols-1" : "grid-cols-2",
            ),
            children: h.map((e) => {
              const t = KKt(e.column.columnDef.header, e.column.id);
              return Q.jsxs(
                "div",
                {
                  className: "space-y-0.5",
                  children: [
                    Q.jsx("div", { className: "text-xs text-muted-foreground", children: t }),
                    Q.jsx("div", {
                      className: "text-right text-sm [&>div]:!px-0",
                      children: AKt(e.column.columnDef.cell, e.getContext()),
                    }),
                  ],
                },
                e.id,
              );
            }),
          }),
        !d &&
          l.length > 0 &&
          Q.jsx("div", {
            className: "flex items-center justify-end border-t bg-muted/20 px-4 py-2",
            children: l.map((e) =>
              Q.jsx("span", { children: AKt(e.column.columnDef.cell, e.getContext()) }, e.id),
            ),
          }),
      ],
    }),
  });
}
function YKt({ primaryField: e = !0, secondaryCount: t = 2, gridCount: n = 2 }) {
  return Q.jsx(q6e, {
    className: "overflow-hidden",
    children: Q.jsxs(Y6e, {
      className: "p-0",
      children: [
        e &&
          Q.jsx("div", {
            className: "border-b bg-muted/30 px-4 py-3",
            children: Q.jsx(n$t, { className: "h-5 w-40" }),
          }),
        Q.jsx("div", {
          className: "space-y-2 px-4 py-3",
          children: Array.from({ length: t }).map((e, t) =>
            Q.jsxs(
              "div",
              {
                className: "flex items-center justify-between",
                children: [
                  Q.jsx(n$t, { className: "h-4 w-16" }),
                  Q.jsx(n$t, { className: "h-4 w-24" }),
                ],
              },
              t,
            ),
          ),
        }),
        n > 0 &&
          Q.jsx("div", {
            className: Rf(
              "grid gap-3 border-t bg-muted/20 px-4 py-3",
              1 === n ? "grid-cols-1" : "grid-cols-2",
            ),
            children: Array.from({ length: n }).map((e, t) =>
              Q.jsxs(
                "div",
                {
                  className: "space-y-1",
                  children: [
                    Q.jsx(n$t, { className: "h-3 w-12" }),
                    Q.jsx(n$t, { className: "h-4 w-20" }),
                  ],
                },
                t,
              ),
            ),
          }),
      ],
    }),
  });
}
function XKt({
  rows: e,
  primaryField: t,
  secondaryFields: n,
  gridFields: i,
  isLoading: r = !1,
  skeletonCount: o = 3,
  emptyMessage: s = "No data",
  onRowClick: a,
  actionSlot: l,
  className: c,
}) {
  return r
    ? Q.jsx("div", {
        className: Rf("space-y-3", c),
        children: Array.from({ length: o }).map((e, t) => Q.jsx(YKt, {}, t)),
      })
    : 0 === e.length
      ? Q.jsx("div", {
          className: "flex h-24 items-center justify-center text-muted-foreground",
          children: s,
        })
      : Q.jsx("div", {
          className: Rf("space-y-3", c),
          children: e.map((e) =>
            Q.jsx(
              "div",
              {
                onClick: () => a?.(e),
                className: Rf(a && "cursor-pointer"),
                children: Q.jsx(ZKt, {
                  row: e,
                  primaryField: t,
                  secondaryFields: n,
                  gridFields: i,
                  actionSlot: l?.(e),
                }),
              },
              e.id,
            ),
          ),
        });
}
function QKt({
  table: e,
  toolbar: t,
  draggable: n = !1,
  onDragStart: i,
  onDragEnd: r,
  onDragOver: o,
  onDragLeave: s,
  onDrop: a,
  showPagination: l = !0,
  isLoading: c = !1,
  mobilePrimaryField: d,
  mobileSecondaryFields: u,
  mobileGridFields: h,
  mobileActionSlot: g,
  onMobileRowClick: p,
  onRowClick: f,
}) {
  const { t: m } = Py("common"),
    _ = H.useRef(null),
    v = t8e(),
    b = e.getAllColumns().filter((e) => "left" === e.getIsPinned()),
    y = e.getAllColumns().filter((e) => "right" === e.getIsPinned()),
    x = e.getVisibleLeafColumns().length,
    w = Math.min(e.getState().pagination.pageSize || 10, 10),
    C = (e) => b.slice(0, e).reduce((e, t) => e + (t.getSize() ?? 0), 0),
    S = (e) => y.slice(e + 1).reduce((e, t) => e + (t.getSize() ?? 0), 0);
  return Q.jsxs("div", {
    className: "space-y-4",
    children: [
      "function" == typeof t ? t(e) : t,
      v
        ? Q.jsx(XKt, {
            rows: e.getRowModel().rows,
            primaryField: d,
            secondaryFields: u,
            gridFields: h,
            isLoading: c,
            skeletonCount: w,
            emptyMessage: m("table.noData"),
            onRowClick: p,
            actionSlot: g,
          })
        : Q.jsx("div", {
            ref: _,
            className: "relative overflow-auto rounded-md border bg-card",
            children: Q.jsx("div", {
              className: "overflow-auto",
              children: Q.jsxs(jKt, {
                children: [
                  Q.jsx(FKt, {
                    children: e.getHeaderGroups().map((e) =>
                      Q.jsx(
                        WKt,
                        {
                          className: "hover:bg-transparent",
                          children: e.headers.map((e) => {
                              const t = "left" === e.column.getIsPinned(),
                                n = "right" === e.column.getIsPinned(),
                                i = t ? C(b.indexOf(e.column)) : void 0,
                                r = n ? S(y.indexOf(e.column)) : void 0;
                            return Q.jsx(
                              HKt,
                              {
                                colSpan: e.colSpan,
                                style: {
                                  width: e.getSize(),
                                  ...(t && { left: i }),
                                  ...(n && { right: r }),
                                },
                                className: Rf(
                                  "h-11 bg-card px-4 text-muted-foreground",
                                  (t || n) && [
                                    "sticky z-20",
                                    "before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",
                                    t && "before:right-0",
                                    n && "before:left-0",
                                  ],
                                ),
                                children: e.isPlaceholder
                                  ? null
                                  : AKt(e.column.columnDef.header, e.getContext()),
                              },
                              e.id,
                            );
                          }),
                        },
                        e.id,
                      ),
                    ),
                  }),
                  Q.jsx(BKt, {
                    children:
                      c && !e.getRowModel().rows?.length
                        ? Array.from({ length: w }).map((e, t) =>
                            Q.jsx(
                              WKt,
                              {
                                className: "animate-fade-in",
                                children: Array.from({ length: x }).map((e, n) =>
                                  Q.jsx(
                                    zKt,
                                    { children: Q.jsx(n$t, { className: "h-4 w-full" }) },
                                    `loading-${t}-${n}`,
                                  ),
                                ),
                              },
                              `loading-${t}`,
                            ),
                          )
                        : e.getRowModel().rows?.length
                          ? e.getRowModel().rows.map((e, t) =>
                              Q.jsx(
                                WKt,
                                {
                                  "data-state": e.getIsSelected() && "selected",
                                  className: "animate-fade-in hover:bg-muted/50",
                                  draggable: n,
                                   onDragStart: (e) => i?.(e, t),
                                   onDragEnd: r,
                                   onDragOver: o,
                                   onDragLeave: s,
                                   onDrop: (e) => a?.(e, t),
                                   onClick: () => f?.(e),
                                   children: e.getVisibleCells().map((e) => {
                                     const t = "left" === e.column.getIsPinned(),
                                       n = "right" === e.column.getIsPinned(),
                                       i = t ? C(b.indexOf(e.column)) : void 0,
                                       r = n ? S(y.indexOf(e.column)) : void 0;
                                    return Q.jsx(
                                      zKt,
                                      {
                                        style: {
                                          width: e.column.getSize(),
                                          ...(t && { left: i }),
                                          ...(n && { right: r }),
                                        },
                                        className: Rf(
                                          "bg-card",
                                          (t || n) && [
                                            "sticky z-20",
                                            "before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",
                                            t && "before:right-0",
                                            n && "before:left-0",
                                          ],
                                        ),
                                        children: AKt(e.column.columnDef.cell, e.getContext()),
                                      },
                                      e.id,
                                    );
                                  }),
                                },
                                e.id,
                              ),
                            )
                          : Q.jsx(WKt, {
                              className: "animate-fade-in",
                              children: Q.jsx(zKt, {
                                colSpan: x,
                                className: "h-24 text-center",
                                children: m("table.noData"),
                              }),
                            }),
                  }),
                ],
              }),
            }),
          }),
      l && Q.jsx($Kt, { table: e }),
    ],
  });
}
const JKt = {
  accessor: (e, t) => ("function" == typeof e ? { ...t, accessorFn: e } : { ...t, accessorKey: e }),
  display: (e) => e,
  group: (e) => e,
};
function eGt() {
  const { t: e } = Py(),
    [t, n] = H.useState(0),
    [i, r] = H.useState(!1),
    [o, s] = H.useState(1),
    [a] = H.useState(10),
    [l, c] = H.useState(null),
    [d, u] = H.useState(!1),
    {
      data: h,
      isLoading: g,
      isRefetching: p,
    } = gC({
      queryKey: ["queueStats", t],
      queryFn: async () => (await xT.getQueueStats()).data,
      refetchInterval: 3e4,
    }),
    {
      data: f,
      isLoading: m,
      refetch: _,
    } = gC({
      queryKey: ["failedJobs", o, a],
      queryFn: async () => {
        const e = await xT.getHorizonFailedJobs({ current: o, page_size: a });
        return { data: e.data, total: e.total || 0 };
      },
      enabled: i,
    }),
    v = f?.data || [],
    b = f?.total || 0,
    y = H.useMemo(
      () => [
        JKt.display({
          id: "failed_at",
          header: () => e("dashboard:queue.details.time"),
          cell: ({ row: e }) =>
            ((e) => {
              if (!e) return "";
              let t;
              if ("string" == typeof e) {
                if (((t = parseInt(e)), isNaN(t))) return e;
              } else t = e;
              return (10 === t.toString().length ? new Date(1e3 * t) : new Date(t)).toLocaleString(
                "zh-CN",
                {
                  year: "numeric",
                  month: "2-digit",
                  day: "2-digit",
                  hour: "2-digit",
                  minute: "2-digit",
                  second: "2-digit",
                },
              );
            })(e.original.failed_at),
        }),
        JKt.display({
          id: "queue",
          header: () => e("dashboard:queue.details.queue"),
          cell: ({ row: e }) => e.original.queue,
        }),
        JKt.display({
          id: "name",
          header: () => e("dashboard:queue.details.name"),
          cell: ({ row: e }) =>
            Q.jsx(Pst, {
              children: Q.jsxs(jst, {
                children: [
                  Q.jsx(Fst, {
                    asChild: !0,
                    children: Q.jsx("span", {
                      className: "inline-block max-w-[150px] truncate",
                      children: e.original.name,
                    }),
                  }),
                  Q.jsx(Bst, { children: Q.jsx("span", { children: e.original.name }) }),
                ],
              }),
            }),
        }),
        JKt.display({
          id: "exception",
          header: () => e("dashboard:queue.details.exception"),
          cell: ({ row: e }) =>
            Q.jsx(Pst, {
              children: Q.jsxs(jst, {
                children: [
                  Q.jsx(Fst, {
                    asChild: !0,
                    children: Q.jsx("span", {
                      className: "inline-block max-w-[200px] truncate",
                      children: e.original.exception.split("\n")[0],
                    }),
                  }),
                  Q.jsx(Bst, {
                    className: "max-w-[300px] whitespace-pre-wrap",
                    children: Q.jsx("span", { children: e.original.exception }),
                  }),
                ],
              }),
            }),
        }),
        JKt.display({
          id: "actions",
          header: () => e("dashboard:queue.details.action"),
          size: 80,
          cell: ({ row: t }) =>
            Q.jsx(ltt, {
              variant: "ghost",
              size: "sm",
              onClick: () => C(t.original),
              "aria-label": e("dashboard:queue.details.viewDetail"),
              children: Q.jsx(Eat, { className: "h-4 w-4" }),
            }),
        }),
      ],
      [e],
    ),
    x = PKt({
      data: v,
      columns: y,
      getCoreRowModel: LKt(),
      getPaginationRowModel: OKt(),
      pageCount: Math.ceil(b / a),
      manualPagination: !0,
      state: { pagination: { pageIndex: o - 1, pageSize: a } },
      onPaginationChange: (e) => {
        if ("function" == typeof e) {
          const t = e({ pageIndex: o - 1, pageSize: a });
          w(t.pageIndex + 1);
        } else w(e.pageIndex + 1);
      },
    }),
    w = (e) => {
      s(e);
    },
    C = (e) => {
      (c(e), u(!0));
    };
  if (g)
    return Q.jsx("div", {
      className: "flex items-center justify-center p-6",
      children: Q.jsx(Aat, { className: "h-6 w-6 animate-spin" }),
    });
  return Q.jsxs("div", {
    className: "space-y-4",
    children: [
      Q.jsxs("div", {
        className: "grid gap-4 md:grid-cols-2",
        children: [
          Q.jsxs(q6e, {
            children: [
              Q.jsxs(K6e, {
                className: "flex flex-row items-center justify-between space-y-0 pb-2",
                children: [
                  Q.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      Q.jsxs(G6e, {
                        className: "flex items-center gap-2",
                        children: [
                          Q.jsx(nlt, { className: "h-5 w-5" }),
                          e("dashboard:queue.title"),
                        ],
                      }),
                      Q.jsx(Z6e, { children: e("dashboard:queue.status.description") }),
                    ],
                  }),
                  Q.jsx(ltt, {
                    variant: "outline",
                    size: "icon",
                    onClick: () => {
                      n((e) => e + 1);
                    },
                    disabled: p,
                    children: Q.jsx($at, { className: Rf("h-4 w-4", p && "animate-spin") }),
                  }),
                ],
              }),
              Q.jsx(Y6e, {
                children: Q.jsxs("div", {
                  className: "space-y-4",
                  children: [
                    Q.jsxs("div", {
                      className: "space-y-2 rounded-lg bg-muted/50 p-3",
                      children: [
                        Q.jsxs("div", {
                          className: "flex items-center justify-between",
                          children: [
                            Q.jsxs("div", {
                              className: "flex items-center gap-2",
                              children: [
                                ((e) =>
                                  e
                                    ? Q.jsx(pat, { className: "h-5 w-5 text-green-500" })
                                    : Q.jsx(hat, { className: "h-5 w-5 text-red-500" }))(
                                  h?.status || !1,
                                ),
                                Q.jsx("span", {
                                  className: "font-medium",
                                  children: e("dashboard:queue.status.running"),
                                }),
                              ],
                            }),
                            Q.jsx(hqt, {
                              variant: h?.status ? "secondary" : "destructive",
                              children: e(
                                h?.status
                                  ? "dashboard:queue.status.normal"
                                  : "dashboard:queue.status.abnormal",
                              ),
                            }),
                          ],
                        }),
                        Q.jsx("div", {
                          className: "text-sm text-muted-foreground",
                          children: e("dashboard:queue.status.waitTime", {
                            seconds: h?.wait?.default || 0,
                          }),
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "grid grid-cols-2 gap-4",
                      children: [
                        Q.jsx(Pst, {
                          children: Q.jsxs(jst, {
                            children: [
                              Q.jsx(Fst, {
                                asChild: !0,
                                children: Q.jsxs("div", {
                                  className: "space-y-2 rounded-lg bg-muted/50 p-3",
                                  children: [
                                    Q.jsx("p", {
                                      className: "text-sm text-muted-foreground",
                                      children: e("dashboard:queue.details.recentJobs"),
                                    }),
                                    Q.jsx("p", {
                                      className: "text-2xl font-bold",
                                      children: h?.recentJobs || 0,
                                    }),
                                    Q.jsx(Dqt, {
                                      value:
                                        ((h?.recentJobs || 0) / (h?.periods?.recentJobs || 1)) *
                                        100,
                                      className: "h-1",
                                    }),
                                  ],
                                }),
                              }),
                              Q.jsx(Bst, {
                                children: Q.jsx("p", {
                                  children: e("dashboard:queue.details.statisticsPeriod", {
                                    hours: h?.periods?.recentJobs || 0,
                                  }),
                                }),
                              }),
                            ],
                          }),
                        }),
                        Q.jsx(Pst, {
                          children: Q.jsxs(jst, {
                            children: [
                              Q.jsx(Fst, {
                                asChild: !0,
                                children: Q.jsxs("div", {
                                  className: "space-y-2 rounded-lg bg-muted/50 p-3",
                                  children: [
                                    Q.jsx("p", {
                                      className: "text-sm text-muted-foreground",
                                      children: e("dashboard:queue.details.jobsPerMinute"),
                                    }),
                                    Q.jsx("p", {
                                      className: "text-2xl font-bold",
                                      children: h?.jobsPerMinute || 0,
                                    }),
                                    Q.jsx(Dqt, {
                                      value:
                                        ((h?.jobsPerMinute || 0) /
                                          (h?.queueWithMaxThroughput?.throughput || 1)) *
                                        100,
                                      className: "h-1",
                                    }),
                                  ],
                                }),
                              }),
                              Q.jsx(Bst, {
                                children: Q.jsx("p", {
                                  children: e("dashboard:queue.details.maxThroughput", {
                                    value: h?.queueWithMaxThroughput?.throughput || 0,
                                  }),
                                }),
                              }),
                            ],
                          }),
                        }),
                      ],
                    }),
                  ],
                }),
              }),
            ],
          }),
          Q.jsxs(q6e, {
            children: [
              Q.jsxs(K6e, {
                children: [
                  Q.jsxs(G6e, {
                    className: "flex items-center gap-2",
                    children: [
                      Q.jsx(xat, { className: "h-5 w-5" }),
                      e("dashboard:queue.jobDetails"),
                    ],
                  }),
                  Q.jsx(Z6e, { children: e("dashboard:queue.details.description") }),
                ],
              }),
              Q.jsx(Y6e, {
                children: Q.jsxs("div", {
                  className: "space-y-4",
                  children: [
                    Q.jsxs("div", {
                      className: "grid grid-cols-2 gap-4",
                      children: [
                        Q.jsxs("div", {
                          className: "space-y-2 rounded-lg bg-muted/50 p-3",
                          children: [
                            Q.jsx("p", {
                              className: "text-sm text-muted-foreground",
                              children: e("dashboard:queue.details.failedJobs7Days"),
                            }),
                            Q.jsxs("div", {
                              className: "flex items-center gap-2",
                              children: [
                                Q.jsx("span", {
                                  className:
                                    "cursor-pointer text-2xl font-bold text-destructive hover:underline",
                                  title: e("dashboard:queue.details.viewFailedJobs"),
                                  onClick: () => r(!0),
                                  style: { userSelect: "none" },
                                  children: h?.failedJobs || 0,
                                }),
                                Q.jsx(Eat, {
                                  className:
                                    "h-4 w-4 cursor-pointer text-muted-foreground hover:text-destructive",
                                  onClick: () => r(!0),
                                  "aria-label": e("dashboard:queue.details.viewFailedJobs"),
                                }),
                              ],
                            }),
                            Q.jsx("div", {
                              className: "text-xs text-muted-foreground",
                              children: e("dashboard:queue.details.retentionPeriod", {
                                hours: h?.periods?.failedJobs || 0,
                              }),
                            }),
                          ],
                        }),
                        Q.jsxs("div", {
                          className: "space-y-2 rounded-lg bg-muted/50 p-3",
                          children: [
                            Q.jsx("p", {
                              className: "text-sm text-muted-foreground",
                              children: e("dashboard:queue.details.longestRunningQueue"),
                            }),
                            Q.jsxs("p", {
                              className: "text-2xl font-bold",
                              children: [h?.queueWithMaxRuntime?.runtime || 0, "s"],
                            }),
                            Q.jsx("div", {
                              className: "truncate text-xs text-muted-foreground",
                              children: h?.queueWithMaxRuntime?.name || "N/A",
                            }),
                          ],
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "rounded-lg bg-muted/50 p-3",
                      children: [
                        Q.jsxs("div", {
                          className: "flex items-center justify-between",
                          children: [
                            Q.jsx("span", {
                              className: "text-sm text-muted-foreground",
                              children: e("dashboard:queue.details.activeProcesses"),
                            }),
                            Q.jsxs("span", {
                              className: "font-medium",
                              children: [
                                h?.processes || 0,
                                " /",
                                " ",
                                (h?.processes || 0) + (h?.pausedMasters || 0),
                              ],
                            }),
                          ],
                        }),
                        Q.jsx(Dqt, {
                          value:
                            ((h?.processes || 0) /
                              ((h?.processes || 0) + (h?.pausedMasters || 0))) *
                            100,
                          className: "mt-2 h-1",
                        }),
                      ],
                    }),
                  ],
                }),
              }),
            ],
          }),
        ],
      }),
      Q.jsx(Jet, {
        open: i,
        onOpenChange: r,
        children: Q.jsxs(ttt, {
          className: "max-h-[90vh] max-w-4xl overflow-y-auto",
          children: [
            Q.jsx(ntt, {
              children: Q.jsx(rtt, {
                children: e("dashboard:queue.details.failedJobsDetailTitle"),
              }),
            }),
            Q.jsxs("div", {
              className: "overflow-x-auto",
              children: [
                Q.jsx(QKt, { table: x, showPagination: !1, isLoading: m }),
                Q.jsx($Kt, { table: x }),
                0 === v.length &&
                  Q.jsx("div", {
                    className: "py-8 text-center text-muted-foreground",
                    children: e("dashboard:queue.details.noFailedJobs"),
                  }),
              ],
            }),
            Q.jsxs(itt, {
              children: [
                Q.jsxs(ltt, {
                  variant: "outline",
                  onClick: () => _(),
                  children: [
                    Q.jsx($at, { className: "mr-2 h-4 w-4" }),
                    e("dashboard:common.refresh"),
                  ],
                }),
                Q.jsx(stt, {
                  asChild: !0,
                  children: Q.jsx(ltt, { variant: "outline", children: e("common:close") }),
                }),
              ],
            }),
          ],
        }),
      }),
      Q.jsx(Jet, {
        open: d,
        onOpenChange: u,
        children: Q.jsxs(ttt, {
          className: "max-h-[90vh] max-w-4xl overflow-y-auto",
          children: [
            Q.jsx(ntt, {
              children: Q.jsx(rtt, { children: e("dashboard:queue.details.jobDetailTitle") }),
            }),
            l &&
              Q.jsxs("div", {
                className: "space-y-5",
                children: [
                  Q.jsxs("div", {
                    className: "grid grid-cols-2 gap-4",
                    children: [
                      Q.jsxs("div", {
                        className: "space-y-2",
                        children: [
                          Q.jsx("h3", {
                            className: "text-sm font-medium text-muted-foreground",
                            children: e("dashboard:queue.details.id"),
                          }),
                          Q.jsx("p", {
                            className: "break-all rounded-md bg-muted/50 p-2 text-sm",
                            children: l.id,
                          }),
                        ],
                      }),
                      Q.jsxs("div", {
                        className: "space-y-2",
                        children: [
                          Q.jsx("h3", {
                            className: "text-sm font-medium text-muted-foreground",
                            children: e("dashboard:queue.details.time"),
                          }),
                          Q.jsx("p", {
                            className: "rounded-md bg-muted/50 p-2 text-sm",
                            children: l.failed_at,
                          }),
                        ],
                      }),
                    ],
                  }),
                  Q.jsxs("div", {
                    className: "grid grid-cols-2 gap-4",
                    children: [
                      Q.jsxs("div", {
                        className: "space-y-2",
                        children: [
                          Q.jsx("h3", {
                            className: "text-sm font-medium text-muted-foreground",
                            children: e("dashboard:queue.details.queue"),
                          }),
                          Q.jsx("p", {
                            className: "rounded-md bg-muted/50 p-2 text-sm",
                            children: l.queue,
                          }),
                        ],
                      }),
                      Q.jsxs("div", {
                        className: "space-y-2",
                        children: [
                          Q.jsx("h3", {
                            className: "text-sm font-medium text-muted-foreground",
                            children: e("dashboard:queue.details.connection"),
                          }),
                          Q.jsx("p", {
                            className: "rounded-md bg-muted/50 p-2 text-sm",
                            children: l.connection,
                          }),
                        ],
                      }),
                    ],
                  }),
                  Q.jsxs("div", {
                    className: "space-y-2",
                    children: [
                      Q.jsx("h3", {
                        className: "text-sm font-medium text-muted-foreground",
                        children: e("dashboard:queue.details.name"),
                      }),
                      Q.jsx("p", {
                        className: "break-all rounded-md bg-muted/50 p-2 text-sm",
                        children: l.name,
                      }),
                    ],
                  }),
                  Q.jsxs("div", {
                    className: "space-y-2",
                    children: [
                      Q.jsx("h3", {
                        className: "text-sm font-medium text-muted-foreground",
                        children: e("dashboard:queue.details.exception"),
                      }),
                      Q.jsx("div", {
                        className:
                          "max-h-[200px] overflow-y-auto rounded-md bg-red-50 p-3 dark:bg-red-950/30",
                        children: Q.jsx("pre", {
                          className: "whitespace-pre-wrap text-xs text-red-700 dark:text-red-300",
                          children: l.exception,
                        }),
                      }),
                    ],
                  }),
                  Q.jsxs("div", {
                    className: "space-y-2",
                    children: [
                      Q.jsx("h3", {
                        className: "text-sm font-medium text-muted-foreground",
                        children: e("dashboard:queue.details.payload"),
                      }),
                      Q.jsx("div", {
                        className: "max-h-[200px] overflow-y-auto rounded-md bg-muted/50 p-3",
                        children: Q.jsx("pre", {
                          className: "whitespace-pre-wrap break-all text-xs",
                          children: (() => {
                            try {
                              return JSON.stringify(JSON.parse(l.payload), null, 2);
                            } catch (spt) {
                              return l.payload;
                            }
                          })(),
                        }),
                      }),
                    ],
                  }),
                ],
              }),
            Q.jsx(itt, {
              children: Q.jsx(ltt, {
                variant: "outline",
                onClick: () => u(!1),
                children: e("common:close"),
              }),
            }),
          ],
        }),
      }),
    ],
  });
}
const tGt = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py();
        return Q.jsxs(Wot, {
          children: [
            Q.jsxs(Hot, {
              children: [
                Q.jsx("div", {
                  className: "flex items-center",
                  children: Q.jsx("h1", {
                    className: "text-2xl font-bold tracking-tight md:text-3xl",
                    children: e("dashboard:title"),
                  }),
                }),
                Q.jsxs("div", {
                  className: "ml-auto flex items-center space-x-4",
                  children: [Q.jsx(Vdt, {}), Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                }),
              ],
            }),
            Q.jsx(zot, {
              children: Q.jsx("div", {
                className: "space-y-6",
                children: Q.jsxs("div", {
                  className: "grid gap-6",
                  children: [Q.jsx(x$t, {}), Q.jsx(dqt, {}), Q.jsx(eGt, {})],
                }),
              }),
            }),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
function nGt({ className: e, items: t, ...n }) {
  const { pathname: i } = ig(),
    r = og(),
    [o, s] = H.useState(i ?? "/settings"),
    { t: a } = Py("settings");
  return Q.jsxs(Q.Fragment, {
    children: [
      Q.jsx("div", {
        className: "p-1 md:hidden",
        children: Q.jsxs(THt, {
          value: o,
          onValueChange: (e) => {
            (s(e), r(e));
          },
          children: [
            Q.jsx(OHt, {
              className: "h-12 sm:w-48",
              children: Q.jsx(RHt, { placeholder: "Theme" }),
            }),
            Q.jsx(PHt, {
              children: t.map((e) =>
                Q.jsx(
                  FHt,
                  {
                    value: e.href,
                    children: Q.jsxs("div", {
                      className: "flex gap-x-4 px-2 py-1",
                      children: [
                        Q.jsx("span", { className: "scale-125", children: e.icon }),
                        Q.jsx("span", { className: "text-md", children: a(e.title) }),
                      ],
                    }),
                  },
                  e.href,
                ),
              ),
            }),
          ],
        }),
      }),
      Q.jsx("div", {
        className: "hidden w-full overflow-x-auto bg-background px-1 py-2 md:block",
        children: Q.jsx("nav", {
          className: Rf("flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1", e),
          ...n,
          children: t.map((e) =>
            Q.jsxs(
              jg,
              {
                to: e.href,
                className: Rf(
                  Em({ variant: "ghost" }),
                  i === e.href ? "bg-muted hover:bg-muted" : "hover:bg-transparent hover:underline",
                  "justify-start",
                ),
                children: [Q.jsx("span", { className: "mr-2", children: e.icon }), a(e.title)],
              },
              e.href,
            ),
          ),
        }),
      }),
    ],
  });
}
const iGt = [
  {
    title: "site.title",
    key: "site",
    icon: Q.jsx(Yf, { size: 18 }),
    href: "/config/system",
    description: "site.description",
  },
  {
    title: "safe.title",
    key: "safe",
    icon: Q.jsx(dm, { size: 18 }),
    href: "/config/system/safe",
    description: "safe.description",
  },
  {
    title: "subscribe.title",
    key: "subscribe",
    icon: Q.jsx(xm, { size: 18 }),
    href: "/config/system/subscribe",
    description: "subscribe.description",
  },
  {
    title: "invite.title",
    key: "invite",
    icon: Q.jsx(wm, { size: 18 }),
    href: "/config/system/invite",
    description: "invite.description",
  },
  {
    title: "server.title",
    key: "server",
    icon: Q.jsx(_m, { size: 18 }),
    href: "/config/system/server",
    description: "server.description",
  },
  {
    title: "email.title",
    key: "email",
    icon: Q.jsx(um, { size: 18 }),
    href: "/config/system/email",
    description: "email.description",
  },
  {
    title: "telegram.title",
    key: "telegram",
    icon: Q.jsx(Gf, { size: 18 }),
    href: "/config/system/telegram",
    description: "telegram.description",
  },
  {
    title: "app.title",
    key: "app",
    icon: Q.jsx(Kf, { size: 18 }),
    href: "/config/system/app",
    description: "app.description",
  },
  {
    title: "subscribe_template.title",
    key: "subscribe_template",
    icon: Q.jsx(ym, { size: 18 }),
    href: "/config/system/subscribe-template",
    description: "subscribe_template.description",
  },
];
const rGt = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py("settings");
        return Q.jsxs(Wot, {
          fadedBelow: !0,
          fixedHeight: !0,
          children: [
            Q.jsxs(Hot, {
              children: [
                Q.jsx(Vdt, {}),
                Q.jsxs("div", {
                  className: "ml-auto flex items-center space-x-4",
                  children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                }),
              ],
            }),
            Q.jsxs(zot, {
              className: "flex flex-col",
              fixedHeight: !0,
              children: [
                Q.jsxs("div", {
                  className: "space-y-2",
                  children: [
                    Q.jsx("h1", {
                      className: "text-2xl font-bold tracking-tight md:text-3xl",
                      children: e("title"),
                    }),
                    Q.jsx("div", {
                      className: "text-muted-foreground",
                      children: e("description"),
                    }),
                  ],
                }),
                Q.jsx(Um, { className: "my-6" }),
                Q.jsxs("div", {
                  className:
                    "flex flex-1 flex-col space-y-8 overflow-auto lg:flex-row lg:space-x-12 lg:space-y-0",
                  children: [
                    Q.jsx("aside", {
                      className: "sticky top-0 lg:w-1/5",
                      children: Q.jsx(nGt, { items: iGt }),
                    }),
                    Q.jsx("div", {
                      className: "flex-1 w-full p-1 pr-4",
                      children: Q.jsx("div", { className: "pb-16", children: Q.jsx(vg, {}) }),
                    }),
                  ],
                }),
              ],
            }),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
var oGt = "Switch",
  [sGt] = Jy(oGt),
  [aGt, lGt] = sGt(oGt),
  cGt = H.forwardRef((e, t) => {
    const {
        __scopeSwitch: n,
        name: i,
        checked: r,
        defaultChecked: o,
        required: s,
        disabled: a,
        value: l = "on",
        onCheckedChange: c,
        form: d,
        ...u
      } = e,
      [h, g] = H.useState(null),
      p = Sp(t, (e) => g(e)),
      f = H.useRef(!1),
      m = !h || d || !!h.closest("form"),
      [_, v] = _x({ prop: r, defaultProp: o ?? !1, onChange: c, caller: oGt });
    return Q.jsxs(aGt, {
      scope: n,
      checked: _,
      disabled: a,
      children: [
        Q.jsx(gx.button, {
          type: "button",
          role: "switch",
          "aria-checked": _,
          "aria-required": s,
          "data-state": gGt(_),
          "data-disabled": a ? "" : void 0,
          disabled: a,
          value: l,
          ...u,
          ref: p,
          onClick: Qy(e.onClick, (e) => {
            (v((e) => !e),
              m && ((f.current = e.isPropagationStopped()), f.current || e.stopPropagation()));
          }),
        }),
        m &&
          Q.jsx(hGt, {
            control: h,
            bubbles: !f.current,
            name: i,
            value: l,
            checked: _,
            required: s,
            disabled: a,
            form: d,
            style: { transform: "translateX(-100%)" },
          }),
      ],
    });
  });
cGt.displayName = oGt;
var dGt = "SwitchThumb",
  uGt = H.forwardRef((e, t) => {
    const { __scopeSwitch: n, ...i } = e,
      r = lGt(dGt, n);
    return Q.jsx(gx.span, {
      "data-state": gGt(r.checked),
      "data-disabled": r.disabled ? "" : void 0,
      ...i,
      ref: t,
    });
  });
uGt.displayName = dGt;
var hGt = H.forwardRef(({ __scopeSwitch: e, control: t, checked: n, bubbles: i = !0, ...r }, o) => {
  const s = H.useRef(null),
    a = Sp(s, o),
    l = gWt(n),
    c = oit(t);
  return (
    H.useEffect(() => {
      const e = s.current;
      if (!e) return;
      const t = window.HTMLInputElement.prototype,
        r = Object.getOwnPropertyDescriptor(t, "checked").set;
      if (l !== n && r) {
        const t = new Event("click", { bubbles: i });
        (r.call(e, n), e.dispatchEvent(t));
      }
    }, [l, n, i]),
    Q.jsx("input", {
      type: "checkbox",
      "aria-hidden": !0,
      defaultChecked: n,
      ...r,
      tabIndex: -1,
      ref: a,
      style: {
        ...r.style,
        ...c,
        position: "absolute",
        pointerEvents: "none",
        opacity: 0,
        margin: 0,
      },
    })
  );
});
function gGt(e) {
  return e ? "checked" : "unchecked";
}
hGt.displayName = "SwitchBubbleInput";
var pGt = cGt,
  fGt = uGt;
const mGt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(pGt, {
    className: Rf(
      "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
      e,
    ),
    ...t,
    ref: n,
    children: Q.jsx(fGt, {
      className: Rf(
        "pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",
      ),
    }),
  }),
);
mGt.displayName = pGt.displayName;
const _Gt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx("textarea", {
    className: Rf(
      "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
      e,
    ),
    ref: n,
    ...t,
  }),
);
_Gt.displayName = "Textarea";
const vGt = gy({
  logo: ly().nullable().default(""),
  force_https: cy().nullable().default(0),
  stop_register: cy().nullable().default(0),
  ticket_must_wait_reply: cy().nullable().default(0),
  app_name: ly().nullable().default(""),
  app_description: ly().nullable().default(""),
  app_url: ly().nullable().default(""),
  subscribe_url: ly().nullable().default(""),
  try_out_plan_id: cy().nullable().default(0),
  try_out_hour: by().nullable().default(0),
  tos_url: ly().nullable().default(""),
  currency: ly().nullable().default(""),
  currency_symbol: ly().nullable().default(""),
});
function bGt() {
  const { t: e } = Py("settings"),
    [t, n] = H.useState(!1),
    { data: r } = gC({ queryKey: ["settings", "site"], queryFn: () => xT.getSettings("site") }),
    { data: o } = gC({ queryKey: ["plans"], queryFn: () => DD() }),
    s = kv({ resolver: Ov(vGt), defaultValues: {}, mode: "onBlur" }),
    { mutateAsync: a } = pC({ mutationFn: xT.saveSettings }),
    c = H.useCallback(() => {}, []),
    l = s.handleSubmit(
      async (t) => {
        n(!0);
        try {
          const i = Object.entries(t).reduce((e, [t, n]) => ((e[t] = null === n ? "" : n), e), {});
          (await a(i)).data ? hN.success(e("common.autoSaved")) : hN.error(e("common.saveFailed"));
        } catch {
          hN.error(e("common.saveFailed"));
        } finally {
          n(!1);
        }
      },
      () => {
        hN.error(e("common.saveFailed"));
      },
    );
  H.useEffect(() => {
    if (r?.data?.site) {
      const e = r?.data?.site;
      Object.entries(e).forEach(([e, t]) => {
        s.setValue(e, t);
      });
    }
  }, [r, s]);
  return (
    Q.jsx(Hy, {
      ...s,
      children: Q.jsxs("form", {
        onSubmit: l,
        className: "space-y-4",
        children: [
          Q.jsx(Uy, {
            control: s.control,
            name: "app_name",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("site.form.siteName.label") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("site.form.siteName.placeholder"),
                      ...t,
                      value: t.value || "",
                      onChange: (e) => {
                        (t.onChange(e), c(s.getValues()));
                      },
                    }),
                  }),
                  Q.jsx(Yy, { children: e("site.form.siteName.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "app_description",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("site.form.siteDescription.label"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("site.form.siteDescription.placeholder"),
                      ...t,
                      value: t.value || "",
                      onChange: (e) => {
                        (t.onChange(e), c(s.getValues()));
                      },
                    }),
                  }),
                  Q.jsx(Yy, { children: e("site.form.siteDescription.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "app_url",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("site.form.siteUrl.label") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("site.form.siteUrl.placeholder"),
                      ...t,
                      value: t.value || "",
                      onChange: (e) => {
                        (t.onChange(e), c(s.getValues()));
                      },
                    }),
                  }),
                  Q.jsx(Yy, { children: e("site.form.siteUrl.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "force_https",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("site.form.forceHttps.label"),
                      }),
                      Q.jsx(Yy, { children: e("site.form.forceHttps.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: Boolean(t.value),
                      onCheckedChange: (e) => {
                        (t.onChange(Number(e)), c(s.getValues()));
                      },
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "logo",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("site.form.logo.label") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("site.form.logo.placeholder"),
                      ...t,
                      value: t.value || "",
                      onChange: (e) => {
                        (t.onChange(e), c(s.getValues()));
                      },
                    }),
                  }),
                  Q.jsx(Yy, { children: e("site.form.logo.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "subscribe_url",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("site.form.subscribeUrl.label"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(_Gt, {
                      placeholder: e("site.form.subscribeUrl.placeholder"),
                      ...t,
                      value: t.value || "",
                      onChange: (e) => {
                        (t.onChange(e), c(s.getValues()));
                      },
                    }),
                  }),
                  Q.jsx(Yy, { children: e("site.form.subscribeUrl.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "tos_url",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("site.form.tosUrl.label") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("site.form.tosUrl.placeholder"),
                      ...t,
                      value: t.value || "",
                      onChange: (e) => {
                        (t.onChange(e), c(s.getValues()));
                      },
                    }),
                  }),
                  Q.jsx(Yy, { children: e("site.form.tosUrl.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "stop_register",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("site.form.stopRegister.label"),
                      }),
                      Q.jsx(Yy, { children: e("site.form.stopRegister.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: Boolean(t.value),
                      onCheckedChange: (e) => {
                        (t.onChange(Number(e)), c(s.getValues()));
                      },
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "ticket_must_wait_reply",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("site.form.ticketMustWaitReply.label"),
                      }),
                      Q.jsx(Yy, { children: e("site.form.ticketMustWaitReply.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: Boolean(t.value),
                      onCheckedChange: (e) => {
                        (t.onChange(Number(e)), c(s.getValues()));
                      },
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "try_out_plan_id",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("site.form.tryOut.label") }),
                  Q.jsx(Zy, {
                    children: Q.jsxs(THt, {
                      value: t.value?.toString(),
                      onValueChange: (e) => {
                        (t.onChange(Number(e)), c(s.getValues()));
                      },
                      children: [
                        Q.jsx(OHt, {
                          children: Q.jsx(RHt, { placeholder: e("site.form.tryOut.placeholder") }),
                        }),
                        Q.jsxs(PHt, {
                          children: [
                            Q.jsx(FHt, { value: "0", children: e("site.form.tryOut.placeholder") }),
                            o?.data?.map((e) =>
                              Q.jsx(
                                FHt,
                                { value: e.id.toString(), children: e.name },
                                e.id.toString(),
                              ),
                            ),
                          ],
                        }),
                      ],
                    }),
                  }),
                  Q.jsx(Yy, { children: e("site.form.tryOut.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          !!s.watch("try_out_plan_id") &&
            Q.jsx(Uy, {
              control: s.control,
              name: "try_out_hour",
              render: ({ field: t }) =>
                Q.jsxs(Ky, {
                  children: [
                    Q.jsx(Gy, { className: "", children: e("site.form.tryOut.duration.label") }),
                    Q.jsx(Zy, {
                      children: Q.jsx(Q6e, {
                        placeholder: e("site.form.tryOut.duration.placeholder"),
                        ...t,
                        value: t.value || "",
                        onChange: (e) => {
                          (t.onChange(e), c(s.getValues()));
                        },
                      }),
                    }),
                    Q.jsx(Yy, { children: e("site.form.tryOut.duration.description") }),
                    Q.jsx(Xy, {}),
                  ],
                }),
            }),
          Q.jsx(Uy, {
            control: s.control,
            name: "currency",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("site.form.currency.label") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("site.form.currency.placeholder"),
                      ...t,
                      value: t.value || "",
                      onChange: (e) => {
                        (t.onChange(e), c(s.getValues()));
                      },
                    }),
                  }),
                  Q.jsx(Yy, { children: e("site.form.currency.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "currency_symbol",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("site.form.currencySymbol.label"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("site.form.currencySymbol.placeholder"),
                      ...t,
                      value: t.value || "",
                      onChange: (e) => {
                        (t.onChange(e), c(s.getValues()));
                      },
                    }),
                  }),
                  Q.jsx(Yy, { children: e("site.form.currencySymbol.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsxs("div", {
            className: "flex items-center justify-end gap-3",
            children: [
              t &&
                Q.jsx("div", {
                  className: "text-sm text-muted-foreground",
                  children: e("site.form.saving"),
                }),
              Q.jsx(Nm, {
                type: "submit",
                loading: t,
                children: e("common.save", "保存"),
              }),
            ],
          }),
        ],
      }),
    })
  );
}
const yGt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("settings");
          return Q.jsxs("div", {
            className: "space-y-6",
            children: [
              Q.jsxs("div", {
                children: [
                  Q.jsx("h3", { className: "text-lg font-medium", children: e("site.title") }),
                  Q.jsx("p", {
                    className: "text-sm text-muted-foreground",
                    children: e("site.description"),
                  }),
                ],
              }),
              Q.jsx(Um, {}),
              Q.jsx(bGt, {}),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  xGt = gy({
    email_verify: dy().nullable(),
    safe_mode_enable: dy().nullable(),
    secure_path: ly().nullable(),
    email_whitelist_enable: dy().nullable(),
    email_whitelist_suffix: hy(ly().nullable()).nullable(),
    email_gmail_limit_enable: dy().nullable(),
    captcha_enable: dy().nullable(),
    captcha_type: ly().nullable(),
    recaptcha_key: ly().nullable(),
    recaptcha_site_key: ly().nullable(),
    recaptcha_v3_secret_key: ly().nullable(),
    recaptcha_v3_site_key: ly().nullable(),
    recaptcha_v3_score_threshold: vy()
      .transform((e) => ("" === e ? null : e))
      .nullable(),
    turnstile_secret_key: ly().nullable(),
    turnstile_site_key: ly().nullable(),
    register_limit_by_ip_enable: dy().nullable(),
    register_limit_count: vy()
      .transform((e) => ("" === e ? null : e))
      .nullable(),
    register_limit_expire: vy()
      .transform((e) => ("" === e ? null : e))
      .nullable(),
    password_limit_enable: dy().nullable(),
    password_limit_count: vy()
      .transform((e) => ("" === e ? null : e))
      .nullable(),
    password_limit_expire: vy()
      .transform((e) => ("" === e ? null : e))
      .nullable(),
  }),
  wGt = {
    email_verify: !1,
    safe_mode_enable: !1,
    secure_path: "",
    email_whitelist_enable: !1,
    email_whitelist_suffix: [],
    email_gmail_limit_enable: !1,
    captcha_enable: !1,
    captcha_type: "recaptcha",
    recaptcha_key: "",
    recaptcha_site_key: "",
    recaptcha_v3_secret_key: "",
    recaptcha_v3_site_key: "",
    recaptcha_v3_score_threshold: "0.5",
    turnstile_secret_key: "",
    turnstile_site_key: "",
    register_limit_by_ip_enable: !1,
    register_limit_count: "",
    register_limit_expire: "",
    password_limit_enable: !1,
    password_limit_count: "",
    password_limit_expire: "",
  };
function CGt() {
  const { t: e } = Py("settings"),
    [t, n] = H.useState(!1),
    s = kv({ resolver: Ov(xGt), defaultValues: wGt, mode: "onBlur" }),
    { data: i } = gC({ queryKey: ["settings", "safe"], queryFn: () => xT.getSettings("safe") }),
    { mutateAsync: r } = pC({ mutationFn: xT.saveSettings }),
    o = s.handleSubmit(
      async (t) => {
        n(!0);
        try {
          const i = { ...t, email_whitelist_suffix: t.email_whitelist_suffix?.filter(Boolean) || [] };
          (await r(i)).data ? hN.success(e("common.autoSaved")) : hN.error(e("common.saveFailed"));
        } catch {
          hN.error(e("common.saveFailed"));
        } finally {
          n(!1);
        }
      },
      () => {
        hN.error(e("common.saveFailed"));
      },
    );
  H.useEffect(() => {
    if (i?.data.safe) {
      const e = i.data.safe;
      Object.entries(e).forEach(([e, t]) => {
        if ("number" == typeof t) {
          const n = String(t);
          s.setValue(e, n);
        } else s.setValue(e, t);
      });
    }
  }, [i, s]);
  return (
    Q.jsx(Hy, {
      ...s,
      children: Q.jsxs("form", {
        onSubmit: o,
        className: "space-y-4",
        children: [
          Q.jsx(Uy, {
            control: s.control,
            name: "email_verify",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("safe.form.emailVerify.label"),
                      }),
                      Q.jsx(Yy, { children: e("safe.form.emailVerify.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "email_gmail_limit_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("safe.form.gmailLimit.label"),
                      }),
                      Q.jsx(Yy, { children: e("safe.form.gmailLimit.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "safe_mode_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("safe.form.safeMode.label"),
                      }),
                      Q.jsx(Yy, { children: e("safe.form.safeMode.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "secure_path",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("safe.form.securePath.label") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("safe.form.securePath.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("safe.form.securePath.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: s.control,
            name: "email_whitelist_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("safe.form.emailWhitelist.label"),
                      }),
                      Q.jsx(Yy, { children: e("safe.form.emailWhitelist.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          s.watch("email_whitelist_enable") &&
            Q.jsx(Uy, {
              control: s.control,
              name: "email_whitelist_suffix",
              render: ({ field: t }) =>
                Q.jsxs(Ky, {
                  children: [
                    Q.jsx(Gy, {
                      className: "text-base",
                      children: e("safe.form.emailWhitelist.suffixes.label"),
                    }),
                    Q.jsx(Zy, {
                      children: Q.jsx(_Gt, {
                        placeholder: e("safe.form.emailWhitelist.suffixes.placeholder"),
                        ...t,
                        value: (t.value || []).join("\n"),
                        onChange: (e) => {
                          const n = e.target.value.split("\n").filter(Boolean);
                          t.onChange(n);
                        },
                      }),
                    }),
                    Q.jsx(Yy, { children: e("safe.form.emailWhitelist.suffixes.description") }),
                    Q.jsx(Xy, {}),
                  ],
                }),
            }),
          Q.jsx(Uy, {
            control: s.control,
            name: "captcha_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("safe.form.captcha.enable.label"),
                      }),
                      Q.jsx(Yy, { children: e("safe.form.captcha.enable.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          s.watch("captcha_enable") &&
            Q.jsxs(Q.Fragment, {
              children: [
                Q.jsx(Uy, {
                  control: s.control,
                  name: "captcha_type",
                  render: ({ field: t }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-base",
                          children: e("safe.form.captcha.type.label"),
                        }),
                        Q.jsxs(THt, {
                          onValueChange: t.onChange,
                          value: t.value || "recaptcha",
                          children: [
                            Q.jsx(Zy, {
                              children: Q.jsx(OHt, {
                                children: Q.jsx(RHt, {
                                  placeholder: e("safe.form.captcha.type.description"),
                                }),
                              }),
                            }),
                            Q.jsxs(PHt, {
                              children: [
                                Q.jsx(FHt, {
                                  value: "recaptcha",
                                  children: e("safe.form.captcha.type.options.recaptcha"),
                                }),
                                Q.jsx(FHt, {
                                  value: "recaptcha-v3",
                                  children: e("safe.form.captcha.type.options.recaptcha-v3"),
                                }),
                                Q.jsx(FHt, {
                                  value: "turnstile",
                                  children: e("safe.form.captcha.type.options.turnstile"),
                                }),
                              ],
                            }),
                          ],
                        }),
                        Q.jsx(Yy, { children: e("safe.form.captcha.type.description") }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
                "recaptcha" === s.watch("captcha_type") &&
                  Q.jsxs(Q.Fragment, {
                    children: [
                      Q.jsx(Uy, {
                        control: s.control,
                        name: "recaptcha_site_key",
                        render: ({ field: t }) =>
                          Q.jsxs(Ky, {
                            children: [
                              Q.jsx(Gy, {
                                className: "text-base",
                                children: e("safe.form.captcha.recaptcha.siteKey.label"),
                              }),
                              Q.jsx(Zy, {
                                children: Q.jsx(Q6e, {
                                  placeholder: e("safe.form.captcha.recaptcha.siteKey.placeholder"),
                                  ...t,
                                  value: t.value || "",
                                }),
                              }),
                              Q.jsx(Yy, {
                                children: e("safe.form.captcha.recaptcha.siteKey.description"),
                              }),
                              Q.jsx(Xy, {}),
                            ],
                          }),
                      }),
                      Q.jsx(Uy, {
                        control: s.control,
                        name: "recaptcha_key",
                        render: ({ field: t }) =>
                          Q.jsxs(Ky, {
                            children: [
                              Q.jsx(Gy, {
                                className: "text-base",
                                children: e("safe.form.captcha.recaptcha.key.label"),
                              }),
                              Q.jsx(Zy, {
                                children: Q.jsx(Q6e, {
                                  placeholder: e("safe.form.captcha.recaptcha.key.placeholder"),
                                  ...t,
                                  value: t.value || "",
                                }),
                              }),
                              Q.jsx(Yy, {
                                children: e("safe.form.captcha.recaptcha.key.description"),
                              }),
                              Q.jsx(Xy, {}),
                            ],
                          }),
                      }),
                    ],
                  }),
                "recaptcha-v3" === s.watch("captcha_type") &&
                  Q.jsxs(Q.Fragment, {
                    children: [
                      Q.jsx(Uy, {
                        control: s.control,
                        name: "recaptcha_v3_site_key",
                        render: ({ field: t }) =>
                          Q.jsxs(Ky, {
                            children: [
                              Q.jsx(Gy, {
                                className: "text-base",
                                children: e("safe.form.captcha.recaptcha_v3.siteKey.label"),
                              }),
                              Q.jsx(Zy, {
                                children: Q.jsx(Q6e, {
                                  placeholder: e(
                                    "safe.form.captcha.recaptcha_v3.siteKey.placeholder",
                                  ),
                                  ...t,
                                  value: t.value || "",
                                }),
                              }),
                              Q.jsx(Yy, {
                                children: e("safe.form.captcha.recaptcha_v3.siteKey.description"),
                              }),
                              Q.jsx(Xy, {}),
                            ],
                          }),
                      }),
                      Q.jsx(Uy, {
                        control: s.control,
                        name: "recaptcha_v3_secret_key",
                        render: ({ field: t }) =>
                          Q.jsxs(Ky, {
                            children: [
                              Q.jsx(Gy, {
                                className: "text-base",
                                children: e("safe.form.captcha.recaptcha_v3.secretKey.label"),
                              }),
                              Q.jsx(Zy, {
                                children: Q.jsx(Q6e, {
                                  placeholder: e(
                                    "safe.form.captcha.recaptcha_v3.secretKey.placeholder",
                                  ),
                                  ...t,
                                  value: t.value || "",
                                }),
                              }),
                              Q.jsx(Yy, {
                                children: e("safe.form.captcha.recaptcha_v3.secretKey.description"),
                              }),
                              Q.jsx(Xy, {}),
                            ],
                          }),
                      }),
                      Q.jsx(Uy, {
                        control: s.control,
                        name: "recaptcha_v3_score_threshold",
                        render: ({ field: t }) =>
                          Q.jsxs(Ky, {
                            children: [
                              Q.jsx(Gy, {
                                className: "text-base",
                                children: e("safe.form.captcha.recaptcha_v3.scoreThreshold.label"),
                              }),
                              Q.jsx(Zy, {
                                children: Q.jsx(Q6e, {
                                  type: "number",
                                  step: "0.1",
                                  min: "0",
                                  max: "1",
                                  placeholder: e(
                                    "safe.form.captcha.recaptcha_v3.scoreThreshold.placeholder",
                                  ),
                                  ...t,
                                  value: t.value || "",
                                }),
                              }),
                              Q.jsx(Yy, {
                                children: e(
                                  "safe.form.captcha.recaptcha_v3.scoreThreshold.description",
                                ),
                              }),
                              Q.jsx(Xy, {}),
                            ],
                          }),
                      }),
                    ],
                  }),
                "turnstile" === s.watch("captcha_type") &&
                  Q.jsxs(Q.Fragment, {
                    children: [
                      Q.jsx(Uy, {
                        control: s.control,
                        name: "turnstile_site_key",
                        render: ({ field: t }) =>
                          Q.jsxs(Ky, {
                            children: [
                              Q.jsx(Gy, {
                                className: "text-base",
                                children: e("safe.form.captcha.turnstile.siteKey.label"),
                              }),
                              Q.jsx(Zy, {
                                children: Q.jsx(Q6e, {
                                  placeholder: e("safe.form.captcha.turnstile.siteKey.placeholder"),
                                  ...t,
                                  value: t.value || "",
                                }),
                              }),
                              Q.jsx(Yy, {
                                children: e("safe.form.captcha.turnstile.siteKey.description"),
                              }),
                              Q.jsx(Xy, {}),
                            ],
                          }),
                      }),
                      Q.jsx(Uy, {
                        control: s.control,
                        name: "turnstile_secret_key",
                        render: ({ field: t }) =>
                          Q.jsxs(Ky, {
                            children: [
                              Q.jsx(Gy, {
                                className: "text-base",
                                children: e("safe.form.captcha.turnstile.secretKey.label"),
                              }),
                              Q.jsx(Zy, {
                                children: Q.jsx(Q6e, {
                                  placeholder: e(
                                    "safe.form.captcha.turnstile.secretKey.placeholder",
                                  ),
                                  ...t,
                                  value: t.value || "",
                                }),
                              }),
                              Q.jsx(Yy, {
                                children: e("safe.form.captcha.turnstile.secretKey.description"),
                              }),
                              Q.jsx(Xy, {}),
                            ],
                          }),
                      }),
                    ],
                  }),
              ],
            }),
          Q.jsx(Uy, {
            control: s.control,
            name: "register_limit_by_ip_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("safe.form.registerLimit.enable.label"),
                      }),
                      Q.jsx(Yy, { children: e("safe.form.registerLimit.enable.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          s.watch("register_limit_by_ip_enable") &&
            Q.jsxs(Q.Fragment, {
              children: [
                Q.jsx(Uy, {
                  control: s.control,
                  name: "register_limit_count",
                  render: ({ field: t }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-base",
                          children: e("safe.form.registerLimit.count.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            placeholder: e("safe.form.registerLimit.count.placeholder"),
                            ...t,
                            value: t.value || "",
                          }),
                        }),
                        Q.jsx(Yy, { children: e("safe.form.registerLimit.count.description") }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: s.control,
                  name: "register_limit_expire",
                  render: ({ field: t }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-base",
                          children: e("safe.form.registerLimit.expire.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            placeholder: e("safe.form.registerLimit.expire.placeholder"),
                            ...t,
                            value: t.value || "",
                          }),
                        }),
                        Q.jsx(Yy, { children: e("safe.form.registerLimit.expire.description") }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
              ],
            }),
          Q.jsx(Uy, {
            control: s.control,
            name: "password_limit_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("safe.form.passwordLimit.enable.label"),
                      }),
                      Q.jsx(Yy, { children: e("safe.form.passwordLimit.enable.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          s.watch("password_limit_enable") &&
            Q.jsxs(Q.Fragment, {
              children: [
                Q.jsx(Uy, {
                  control: s.control,
                  name: "password_limit_count",
                  render: ({ field: t }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-base",
                          children: e("safe.form.passwordLimit.count.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            placeholder: e("safe.form.passwordLimit.count.placeholder"),
                            ...t,
                            value: t.value || "",
                          }),
                        }),
                        Q.jsx(Yy, { children: e("safe.form.passwordLimit.count.description") }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: s.control,
                  name: "password_limit_expire",
                  render: ({ field: t }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-base",
                          children: e("safe.form.passwordLimit.expire.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            placeholder: e("safe.form.passwordLimit.expire.placeholder"),
                            ...t,
                            value: t.value || "",
                          }),
                        }),
                        Q.jsx(Yy, { children: e("safe.form.passwordLimit.expire.description") }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
              ],
            }),
          Q.jsxs("div", {
            className: "flex items-center justify-end gap-3",
            children: [
              t &&
                Q.jsx("div", {
                  className: "text-sm text-muted-foreground",
                  children: e("safe.form.saving"),
                }),
              Q.jsx(Nm, {
                type: "submit",
                loading: t,
                children: e("common.save", "Save"),
              }),
            ],
          }),
        ],
      }),
    })
  );
}
const SGt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("settings");
          return Q.jsxs("div", {
            className: "space-y-6",
            children: [
              Q.jsxs("div", {
                children: [
                  Q.jsx("h3", { className: "text-lg font-medium", children: e("safe.title") }),
                  Q.jsx("p", {
                    className: "text-sm text-muted-foreground",
                    children: e("safe.description"),
                  }),
                ],
              }),
              Q.jsx(Um, {}),
              Q.jsx(CGt, {}),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  kGt = gy({
    plan_change_enable: dy().nullable().default(!1),
    reset_traffic_method: by().nullable().default(0),
    surplus_enable: dy().nullable().default(!1),
    new_order_event_id: by().nullable().default(0),
    renew_order_event_id: by().nullable().default(0),
    change_order_event_id: by().nullable().default(0),
    show_info_to_server_enable: dy().nullable().default(!1),
    show_protocol_to_server_enable: dy().nullable().default(!1),
    default_remind_expire: dy().nullable().default(!1),
    default_remind_traffic: dy().nullable().default(!1),
    subscribe_path: ly().nullable().default("s"),
  }),
  EGt = {
    plan_change_enable: !1,
    reset_traffic_method: 0,
    surplus_enable: !1,
    new_order_event_id: 0,
    renew_order_event_id: 0,
    change_order_event_id: 0,
    show_info_to_server_enable: !1,
    show_protocol_to_server_enable: !1,
    default_remind_expire: !1,
    default_remind_traffic: !1,
    subscribe_path: "s",
  };
function NGt() {
  const { t: e } = Py("settings"),
    [t, n] = H.useState(!1),
    i = kv({ resolver: Ov(kGt), defaultValues: EGt, mode: "onBlur" }),
    { data: r } = gC({
      queryKey: ["settings", "subscribe"],
      queryFn: () => xT.getSettings("subscribe"),
    }),
    { mutateAsync: o } = pC({ mutationFn: xT.saveSettings }),
    s = i.handleSubmit(
      async (t) => {
        n(!0);
        try {
          (await o(t)).data ? hN.success(e("common.autoSaved")) : hN.error(e("common.saveFailed"));
        } catch {
          hN.error(e("common.saveFailed"));
        } finally {
          n(!1);
        }
      },
      () => {
        hN.error(e("common.saveFailed"));
      },
    );
  H.useEffect(() => {
    if (r?.data?.subscribe) {
      const e = r?.data?.subscribe;
      Object.entries(e).forEach(([e, t]) => {
        i.setValue(e, t);
      });
    }
  }, [r, i]);
  return (
    Q.jsx(Hy, {
      ...i,
      children: Q.jsxs("form", {
        onSubmit: s,
        className: "space-y-4",
        children: [
          Q.jsx(Uy, {
            control: i.control,
            name: "plan_change_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("subscribe.plan_change_enable.title"),
                  }),
                  Q.jsx(Yy, { children: e("subscribe.plan_change_enable.description") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "reset_traffic_method",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("subscribe.reset_traffic_method.title"),
                  }),
                  Q.jsxs(THt, {
                    onValueChange: (e) => {
                      t.onChange(Number(e));
                    },
                    value: t.value?.toString() || "0",
                    children: [
                      Q.jsx(Zy, {
                        children: Q.jsx(OHt, {
                          children: Q.jsx(RHt, { placeholder: "请选择重置方式" }),
                        }),
                      }),
                      Q.jsxs(PHt, {
                        children: [
                          Q.jsx(FHt, {
                            value: "0",
                            children: e("subscribe.reset_traffic_method.options.monthly_first"),
                          }),
                          Q.jsx(FHt, {
                            value: "1",
                            children: e("subscribe.reset_traffic_method.options.monthly_reset"),
                          }),
                          Q.jsx(FHt, {
                            value: "2",
                            children: e("subscribe.reset_traffic_method.options.no_reset"),
                          }),
                          Q.jsx(FHt, {
                            value: "3",
                            children: e("subscribe.reset_traffic_method.options.yearly_first"),
                          }),
                          Q.jsx(FHt, {
                            value: "4",
                            children: e("subscribe.reset_traffic_method.options.yearly_reset"),
                          }),
                        ],
                      }),
                    ],
                  }),
                  Q.jsx(Yy, { children: e("subscribe.reset_traffic_method.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "surplus_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("subscribe.surplus_enable.title"),
                  }),
                  Q.jsx(Yy, { children: e("subscribe.surplus_enable.description") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "new_order_event_id",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("subscribe.new_order_event.title"),
                  }),
                  Q.jsx("div", {
                    className: "relative w-max",
                    children: Q.jsx(Zy, {
                      children: Q.jsxs(THt, {
                        onValueChange: (e) => {
                          t.onChange(Number(e));
                        },
                        value: t.value?.toString(),
                        children: [
                          Q.jsx(OHt, { children: Q.jsx(RHt, { placeholder: "请选择" }) }),
                          Q.jsxs(PHt, {
                            children: [
                              Q.jsx(FHt, {
                                value: "0",
                                children: e("subscribe.new_order_event.options.no_action"),
                              }),
                              Q.jsx(FHt, {
                                value: "1",
                                children: e("subscribe.new_order_event.options.reset_traffic"),
                              }),
                            ],
                          }),
                        ],
                      }),
                    }),
                  }),
                  Q.jsx(Yy, { children: e("subscribe.new_order_event.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "renew_order_event_id",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("subscribe.renew_order_event.title"),
                  }),
                  Q.jsx("div", {
                    className: "relative w-max",
                    children: Q.jsx(Zy, {
                      children: Q.jsxs(THt, {
                        onValueChange: (e) => {
                          t.onChange(Number(e));
                        },
                        value: t.value?.toString(),
                        children: [
                          Q.jsx(OHt, { children: Q.jsx(RHt, { placeholder: "请选择" }) }),
                          Q.jsxs(PHt, {
                            children: [
                              Q.jsx(FHt, {
                                value: "0",
                                children: e("subscribe.renew_order_event.options.no_action"),
                              }),
                              Q.jsx(FHt, {
                                value: "1",
                                children: e("subscribe.renew_order_event.options.reset_traffic"),
                              }),
                            ],
                          }),
                        ],
                      }),
                    }),
                  }),
                  Q.jsx(Yy, { children: e("subscribe.renew_order_event.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "change_order_event_id",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("subscribe.change_order_event.title"),
                  }),
                  Q.jsx("div", {
                    className: "relative w-max",
                    children: Q.jsx(Zy, {
                      children: Q.jsxs(THt, {
                        onValueChange: (e) => {
                          t.onChange(Number(e));
                        },
                        value: t.value?.toString(),
                        children: [
                          Q.jsx(OHt, { children: Q.jsx(RHt, { placeholder: "请选择" }) }),
                          Q.jsxs(PHt, {
                            children: [
                              Q.jsx(FHt, {
                                value: "0",
                                children: e("subscribe.change_order_event.options.no_action"),
                              }),
                              Q.jsx(FHt, {
                                value: "1",
                                children: e("subscribe.change_order_event.options.reset_traffic"),
                              }),
                            ],
                          }),
                        ],
                      }),
                    }),
                  }),
                  Q.jsx(Yy, { children: e("subscribe.change_order_event.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "subscribe_path",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("subscribe.subscribe_path.title"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: "subscribe",
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsxs("div", {
                    className: "text-sm text-muted-foreground",
                    children: [
                      e("subscribe.subscribe_path.description"),
                      Q.jsx("br", {}),
                      e("subscribe.subscribe_path.current_format", { path: t.value || "s" }),
                      Q.jsx("br", {}),
                      e("subscribe.subscribe_path.restart_tip"),
                    ],
                  }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "show_info_to_server_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("subscribe.show_info_to_server.title"),
                      }),
                      Q.jsx(Yy, { children: e("subscribe.show_info_to_server.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "show_protocol_to_server_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("subscribe.show_protocol_to_server.title"),
                      }),
                      Q.jsx(Yy, { children: e("subscribe.show_protocol_to_server.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value || !1,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsxs("div", {
            className: "flex items-center justify-end gap-3",
            children: [
              t &&
                Q.jsx("div", {
                  className: "text-sm text-muted-foreground",
                  children: e("common.saving"),
                }),
              Q.jsx(Nm, {
                type: "submit",
                loading: t,
                children: e("common.save", "Save"),
              }),
            ],
          }),
        ],
      }),
    })
  );
}
const LGt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("settings");
          return Q.jsxs("div", {
            className: "space-y-6",
            children: [
              Q.jsxs("div", {
                children: [
                  Q.jsx("h3", { className: "text-lg font-medium", children: e("subscribe.title") }),
                  Q.jsx("p", {
                    className: "text-sm text-muted-foreground",
                    children: e("subscribe.description"),
                  }),
                ],
              }),
              Q.jsx(Um, {}),
              Q.jsx(NGt, {}),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  DGt = gy({
    invite_force: dy().default(!1),
    invite_commission: vy().default("0"),
    invite_gen_limit: vy().default("0"),
    invite_never_expire: dy().default(!1),
    commission_first_time_enable: dy().default(!1),
    commission_auto_check_enable: dy().default(!1),
    commission_withdraw_limit: vy().default("0"),
    commission_withdraw_method: hy(ly()).default(["支付宝", "USDT", "Paypal"]),
    withdraw_close_enable: dy().default(!1),
    commission_distribution_enable: dy().default(!1),
    commission_distribution_l1: by().default(0),
    commission_distribution_l2: by().default(0),
    commission_distribution_l3: by().default(0),
  }),
  TGt = {
    invite_force: !1,
    invite_commission: "0",
    invite_gen_limit: "0",
    invite_never_expire: !1,
    commission_first_time_enable: !1,
    commission_auto_check_enable: !1,
    commission_withdraw_limit: "0",
    commission_withdraw_method: ["支付宝", "USDT", "Paypal"],
    withdraw_close_enable: !1,
    commission_distribution_enable: !1,
    commission_distribution_l1: 0,
    commission_distribution_l2: 0,
    commission_distribution_l3: 0,
  };
function IGt() {
  const { t: e } = Py("settings"),
    [t, n] = H.useState(!1),
    i = kv({ resolver: Ov(DGt), defaultValues: TGt, mode: "onBlur" }),
    { data: r } = gC({ queryKey: ["settings", "invite"], queryFn: () => xT.getSettings("invite") }),
    { mutateAsync: o } = pC({ mutationFn: xT.saveSettings }),
    s = i.handleSubmit(
      async (t) => {
        n(!0);
        try {
          (await o(t)).data ? hN.success(e("common.autoSaved")) : hN.error(e("common.saveFailed"));
        } catch {
          hN.error(e("common.saveFailed"));
        } finally {
          n(!1);
        }
      },
      () => {
        hN.error(e("common.saveFailed"));
      },
    );
  H.useEffect(() => {
    if (r?.data?.invite) {
      const e = r?.data?.invite;
      Object.entries(e).forEach(([e, t]) => {
        if ("number" == typeof t) {
          const n = String(t);
          i.setValue(e, n);
        } else i.setValue(e, t);
      });
    }
  }, [r, i]);
  return (
    Q.jsx(Hy, {
      ...i,
      children: Q.jsxs("form", {
        onSubmit: s,
        className: "space-y-4",
        children: [
          Q.jsx(Uy, {
            control: i.control,
            name: "invite_force",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("invite.invite_force.title"),
                      }),
                      Q.jsx(Yy, { children: e("invite.invite_force.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "invite_commission",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("invite.invite_commission.title"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("invite.invite_commission.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("invite.invite_commission.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "invite_gen_limit",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("invite.invite_gen_limit.title"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("invite.invite_gen_limit.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("invite.invite_gen_limit.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "invite_never_expire",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("invite.invite_never_expire.title"),
                      }),
                      Q.jsx(Yy, { children: e("invite.invite_never_expire.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "commission_first_time_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("invite.commission_first_time.title"),
                      }),
                      Q.jsx(Yy, { children: e("invite.commission_first_time.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "commission_auto_check_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("invite.commission_auto_check.title"),
                      }),
                      Q.jsx(Yy, { children: e("invite.commission_auto_check.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "commission_withdraw_limit",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("invite.commission_withdraw_limit.title"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("invite.commission_withdraw_limit.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("invite.commission_withdraw_limit.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "commission_withdraw_method",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "text-base",
                    children: e("invite.commission_withdraw_method.title"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("invite.commission_withdraw_method.placeholder"),
                      ...t,
                      value: Array.isArray(t.value) ? t.value.join(",") : "",
                      onChange: (e) => {
                        const n = e.target.value.split(",").filter(Boolean);
                        t.onChange(n);
                      },
                    }),
                  }),
                  Q.jsx(Yy, { children: e("invite.commission_withdraw_method.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "withdraw_close_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("invite.withdraw_close.title"),
                      }),
                      Q.jsx(Yy, { children: e("invite.withdraw_close.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "commission_distribution_enable",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("invite.commission_distribution.title"),
                      }),
                      Q.jsx(Yy, { children: e("invite.commission_distribution.description") }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: t.value,
                      onCheckedChange: t.onChange,
                    }),
                  }),
                ],
              }),
          }),
          i.watch("commission_distribution_enable") &&
            Q.jsxs(Q.Fragment, {
              children: [
                Q.jsx(Uy, {
                  control: i.control,
                  name: "commission_distribution_l1",
                  render: ({ field: t }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, { children: e("invite.commission_distribution.l1") }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            type: "number",
                            placeholder: e("invite.commission_distribution.placeholder"),
                            ...t,
                            value: t.value || "",
                            onChange: (e) => {
                              const n = e.target.value ? Number(e.target.value) : 0;
                              t.onChange(n);
                            },
                          }),
                        }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: i.control,
                  name: "commission_distribution_l2",
                  render: ({ field: t }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, { children: e("invite.commission_distribution.l2") }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            type: "number",
                            placeholder: e("invite.commission_distribution.placeholder"),
                            ...t,
                            value: t.value || "",
                            onChange: (e) => {
                              const n = e.target.value ? Number(e.target.value) : 0;
                              t.onChange(n);
                            },
                          }),
                        }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: i.control,
                  name: "commission_distribution_l3",
                  render: ({ field: t }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, { children: e("invite.commission_distribution.l3") }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            type: "number",
                            placeholder: e("invite.commission_distribution.placeholder"),
                            ...t,
                            value: t.value || "",
                            onChange: (e) => {
                              const n = e.target.value ? Number(e.target.value) : 0;
                              t.onChange(n);
                            },
                          }),
                        }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
              ],
            }),
          Q.jsxs("div", {
            className: "flex items-center justify-end gap-3",
            children: [
              t &&
                Q.jsx("div", {
                  className: "text-sm text-muted-foreground",
                  children: e("invite.saving"),
                }),
              Q.jsx(Nm, {
                type: "submit",
                loading: t,
                children: e("common.save", "Save"),
              }),
            ],
          }),
        ],
      }),
    })
  );
}
const RGt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("settings");
          return Q.jsxs("div", {
            className: "space-y-6",
            children: [
              Q.jsxs("div", {
                children: [
                  Q.jsx("h3", { className: "text-lg font-medium", children: e("invite.title") }),
                  Q.jsx("p", {
                    className: "text-sm text-muted-foreground",
                    children: e("invite.description"),
                  }),
                ],
              }),
              Q.jsx(Um, {}),
              Q.jsx(IGt, {}),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  OGt = gy({
    frontend_theme: ly().nullable(),
    frontend_theme_sidebar: ly().nullable(),
    frontend_theme_header: ly().nullable(),
    frontend_theme_color: ly().nullable(),
    frontend_background_url: ly().url().nullable(),
  }),
  MGt = {
    frontend_theme: "",
    frontend_theme_sidebar: "",
    frontend_theme_header: "",
    frontend_theme_color: "",
    frontend_background_url: "",
  };
function AGt() {
  const { data: e } = gC({
      queryKey: ["settings", "frontend"],
      queryFn: () => xT.getSettings("frontend"),
    }),
    t = kv({ resolver: Ov(OGt), defaultValues: MGt, mode: "onChange" });
  return (
    H.useEffect(() => {
      if (e?.data?.frontend) {
        const n = e?.data?.frontend;
        Object.entries(n).forEach(([e, n]) => {
          t.setValue(e, n);
        });
      }
    }, [e, t]),
    Q.jsx(Hy, {
      ...t,
      children: Q.jsxs("form", {
        onSubmit: t.handleSubmit(function (e) {
          xT.saveSettings(e).then(({ data: e }) => {
            e && hN.success("更新成功");
          });
        }),
        className: "space-y-8",
        children: [
          Q.jsx(Uy, {
            control: t.control,
            name: "frontend_theme_sidebar",
            render: ({ field: e }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, { className: "text-base", children: "边栏风格" }),
                      Q.jsx(Yy, { children: "边栏风格" }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: t.control,
            name: "frontend_theme_header",
            render: ({ field: e }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsxs("div", {
                    className: "space-y-0.5",
                    children: [
                      Q.jsx(Gy, { className: "text-base", children: "头部风格" }),
                      Q.jsx(Yy, { children: "边栏风格" }),
                    ],
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                  }),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: t.control,
            name: "frontend_theme_color",
            render: ({ field: e }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { children: "主题色" }),
                  Q.jsxs("div", {
                    className: "relative w-max",
                    children: [
                      Q.jsx(Zy, {
                        children: Q.jsxs("select", {
                          className: Rf(
                            Em({ variant: "outline" }),
                            "w-[200px] appearance-none font-normal",
                          ),
                          ...e,
                          children: [
                            Q.jsx("option", { value: "default", children: "默认" }),
                            Q.jsx("option", { value: "black", children: "黑色" }),
                            Q.jsx("option", { value: "blackblue", children: "暗蓝色" }),
                            Q.jsx("option", { value: "green", children: "奶绿色" }),
                          ],
                        }),
                      }),
                      Q.jsx(m7e, { className: "absolute right-3 top-2.5 h-4 w-4 opacity-50" }),
                    ],
                  }),
                  Q.jsx(Yy, { children: "主题色" }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: t.control,
            name: "frontend_background_url",
            render: ({ field: e }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { children: "背景" }),
                  Q.jsx(Zy, { children: Q.jsx(Q6e, { placeholder: "请输入图片地址", ...e }) }),
                  Q.jsx(Yy, { children: "将会在后台登录页面进行展示。" }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Nm, { type: "submit", children: "保存设置" }),
        ],
      }),
    })
  );
}
const PGt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          return Q.jsxs("div", {
            className: "space-y-6",
            children: [
              Q.jsxs("div", {
                children: [
                  Q.jsx("h3", { className: "text-lg font-medium", children: "个性化设置" }),
                  Q.jsx("p", {
                    className: "text-sm text-muted-foreground",
                    children:
                      "自定义系统界面外观，包括主题风格、布局、颜色方案、背景图等个性化选项。",
                  }),
                ],
              }),
              Q.jsx(Um, {}),
              Q.jsx(AGt, {}),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  jGt = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8.01 8.01 0 0 1-8 8m0-8.5a1 1 0 0 0-1 1v3a1 1 0 0 0 2 0v-3a1 1 0 0 0-1-1m0-4a1.25 1.25 0 1 0 1.25 1.25A1.25 1.25 0 0 0 12 7.5",
      }),
    }),
  FGt = gy({
    server_pull_interval: by().nullable(),
    server_push_interval: by().nullable(),
    server_token: ly().nullable(),
    device_limit_mode: by().nullable(),
    server_ws_enable: dy().nullable(),
    server_ws_url: ly().nullable(),
  }),
  BGt = {
    server_pull_interval: 0,
    server_push_interval: 0,
    server_token: "",
    device_limit_mode: 0,
    server_ws_enable: !1,
    server_ws_url: "",
  };
function VGt() {
  const { t: e } = Py("settings"),
    [t, n] = H.useState(!1),
    i = kv({ resolver: Ov(FGt), defaultValues: BGt, mode: "onBlur" }),
    { data: r } = gC({ queryKey: ["settings", "server"], queryFn: () => xT.getSettings("server") }),
    { data: o } = gC({ queryKey: ["settings", "site"], queryFn: () => xT.getSettings("site") }),
    s = o?.data?.site?.site_url || "",
    { mutateAsync: a } = pC({ mutationFn: xT.saveSettings }),
    l = i.handleSubmit(
      async (t) => {
        n(!0);
        try {
          (await a(t)).data ? hN.success(e("common.autoSaved")) : hN.error(e("common.saveFailed"));
        } catch {
          hN.error(e("common.saveFailed"));
        } finally {
          n(!1);
        }
      },
      () => {
        hN.error(e("common.saveFailed"));
      },
    );
  H.useEffect(() => {
    if (r?.data.server) {
      const e = r.data.server;
      (Object.entries(e).forEach(([e, t]) => {
        i.setValue(e, t);
      }),
        !e.server_ws_url && s && i.setValue("server_ws_url", s));
    }
  }, [r, s, i]);
  return Q.jsx(Hy, {
    ...i,
    children: Q.jsxs("form", {
      onSubmit: l,
      className: "space-y-4",
      children: [
        Q.jsx(Uy, {
          control: i.control,
          name: "server_token",
          render: ({ field: t }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, { className: "text-base", children: e("server.server_token.title") }),
                Q.jsx(Zy, {
                  children: Q.jsxs("div", {
                    className: "relative",
                    children: [
                      Q.jsx(Q6e, {
                        placeholder: e("server.server_token.placeholder"),
                        ...t,
                        value: t.value || "",
                        className: "pr-10",
                      }),
                      Q.jsx(Pst, {
                        children: Q.jsxs(jst, {
                          children: [
                            Q.jsx(Fst, {
                              asChild: !0,
                              children: Q.jsx(ltt, {
                                type: "button",
                                variant: "ghost",
                                size: "icon",
                                className: "absolute right-0 top-0 h-full px-3 py-2",
                                onClick: (e) => {
                                  (e.preventDefault(),
                                    (() => {
                                      const e = Math.floor(17 * Math.random()) + 16,
                                        t =
                                          "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                                      let n = "";
                                      for (let i = 0; i < e; i++)
                                        n += t.charAt(Math.floor(62 * Math.random()));
                                      i.setValue("server_token", n);
                                    })());
                                },
                                children: Q.jsx(zat, {
                                  className: "h-4 w-4 text-muted-foreground hover:text-foreground",
                                }),
                              }),
                            }),
                            Q.jsx(Bst, {
                              children: Q.jsx("p", {
                                children: e("server.server_token.generate_tooltip"),
                              }),
                            }),
                          ],
                        }),
                      }),
                    ],
                  }),
                }),
                Q.jsx(Yy, { children: e("server.server_token.description") }),
                Q.jsx(Xy, {}),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: i.control,
          name: "server_pull_interval",
          render: ({ field: t }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-base",
                  children: e("server.server_pull_interval.title"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsx(Q6e, {
                    type: "number",
                    placeholder: e("server.server_pull_interval.placeholder"),
                    ...t,
                    value: t.value || "",
                    onChange: (e) => {
                      const n = e.target.value ? Number(e.target.value) : null;
                      t.onChange(n);
                    },
                  }),
                }),
                Q.jsx(Yy, { children: e("server.server_pull_interval.description") }),
                Q.jsx(Xy, {}),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: i.control,
          name: "server_push_interval",
          render: ({ field: t }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-base",
                  children: e("server.server_push_interval.title"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsx(Q6e, {
                    type: "number",
                    placeholder: e("server.server_push_interval.placeholder"),
                    ...t,
                    value: t.value || "",
                    onChange: (e) => {
                      const n = e.target.value ? Number(e.target.value) : null;
                      t.onChange(n);
                    },
                  }),
                }),
                Q.jsx(Yy, { children: e("server.server_push_interval.description") }),
                Q.jsx(Xy, {}),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: i.control,
          name: "server_ws_enable",
          render: ({ field: t }) =>
            Q.jsxs(Ky, {
              className: "flex flex-row items-center justify-between rounded-lg border p-4",
              children: [
                Q.jsxs("div", {
                  className: "space-y-0.5",
                  children: [
                    Q.jsx(Gy, {
                      className: "text-base",
                      children: e("server.server_ws_enable.title"),
                    }),
                    Q.jsx(Yy, { children: e("server.server_ws_enable.description") }),
                  ],
                }),
                Q.jsx(Zy, {
                  children: Q.jsx(mGt, { checked: t.value ?? !1, onCheckedChange: t.onChange }),
                }),
              ],
            }),
        }),
        i.watch("server_ws_enable") &&
          Q.jsx(Uy, {
            control: i.control,
            name: "server_ws_url",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("server.server_ws_url.title") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: s || e("server.server_ws_url.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("server.server_ws_url.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
        Q.jsxs("div", {
          className:
            "flex items-start gap-2 rounded-lg border border-blue-200 bg-blue-50 p-3 text-sm text-blue-700 dark:border-blue-800 dark:bg-blue-950/40 dark:text-blue-400",
          children: [
            Q.jsx(jGt, { className: "mt-0.5 h-4 w-4 shrink-0" }),
            Q.jsx("span", { children: e("server.server_ws_enable.supported_clients") }),
          ],
        }),
        Q.jsxs("div", {
          className: "flex items-center justify-end gap-3",
          children: [
            t &&
              Q.jsx("div", {
                className: "text-sm text-muted-foreground",
                children: e("server.saving"),
              }),
            Q.jsx(Nm, {
              type: "submit",
              loading: t,
              children: e("common.save", "Save"),
            }),
          ],
        }),
      ],
    }),
  });
}
const WGt = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py("settings");
        return Q.jsxs("div", {
          className: "space-y-6",
          children: [
            Q.jsxs("div", {
              children: [
                Q.jsx("h3", { className: "text-lg font-medium", children: e("server.title") }),
                Q.jsx("p", {
                  className: "text-sm text-muted-foreground",
                  children: e("server.description"),
                }),
              ],
            }),
            Q.jsx(Um, {}),
            Q.jsx(VGt, {}),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
function HGt({ open: e, onOpenChange: t, result: n }) {
  const i = !n.error;
  return Q.jsx(Jet, {
    open: e,
    onOpenChange: t,
    children: Q.jsxs(ttt, {
      className: "sm:max-w-[425px]",
      children: [
        Q.jsxs(ntt, {
          children: [
            Q.jsxs("div", {
              className: "flex items-center gap-2",
              children: [
                i
                  ? Q.jsx(pat, { className: "h-5 w-5 text-green-500" })
                  : Q.jsx(hat, { className: "h-5 w-5 text-destructive" }),
                Q.jsx(rtt, { children: i ? "邮件发送成功" : "邮件发送失败" }),
              ],
            }),
            Q.jsx(ott, {
              children: i ? "测试邮件已成功发送，请检查收件箱" : "发送测试邮件时遇到错误",
            }),
          ],
        }),
        Q.jsxs("div", {
          className: "grid gap-4 py-4",
          children: [
            Q.jsxs("div", {
              className: "grid gap-2",
              children: [
                Q.jsx("div", { className: "font-medium", children: "发送详情" }),
                Q.jsxs("div", {
                  className: "grid grid-cols-[100px_1fr] items-center gap-2 text-sm",
                  children: [
                    Q.jsx("div", { className: "text-muted-foreground", children: "收件地址" }),
                    Q.jsx("div", { children: n.email }),
                    Q.jsx("div", { className: "text-muted-foreground", children: "邮件主题" }),
                    Q.jsx("div", { children: n.subject }),
                    Q.jsx("div", { className: "text-muted-foreground", children: "模板名称" }),
                    Q.jsx("div", { children: n.template_name }),
                  ],
                }),
              ],
            }),
            n.error &&
              Q.jsxs("div", {
                className: "grid gap-2",
                children: [
                  Q.jsx("div", { className: "font-medium text-destructive", children: "错误信息" }),
                  Q.jsx("div", {
                    className:
                      "break-all rounded-md bg-destructive/10 p-3 text-sm text-destructive",
                    children: n.error,
                  }),
                ],
              }),
            Q.jsxs("div", {
              className: "grid gap-2",
              children: [
                Q.jsx("div", { className: "font-medium", children: "配置信息" }),
                Q.jsx(rqt, {
                  className: "h-[200px] rounded-md border p-4",
                  children: Q.jsx("div", {
                    className: "grid gap-2 text-sm",
                    children: Q.jsxs("div", {
                      className: "grid grid-cols-[100px_1fr] items-center gap-2",
                      children: [
                        Q.jsx("div", { className: "text-muted-foreground", children: "驱动" }),
                        Q.jsx("div", { children: n.config.driver }),
                        Q.jsx("div", { className: "text-muted-foreground", children: "服务器" }),
                        Q.jsx("div", { children: n.config.host }),
                        Q.jsx("div", { className: "text-muted-foreground", children: "端口" }),
                        Q.jsx("div", { children: n.config.port }),
                        Q.jsx("div", { className: "text-muted-foreground", children: "加密方式" }),
                        Q.jsx("div", { children: n.config.encryption || "无" }),
                        Q.jsx("div", { className: "text-muted-foreground", children: "发件人" }),
                        Q.jsx("div", {
                          children: (n.config.from?.address || n.config.from_address)
                            ? `${n.config.from?.address || n.config.from_address}${n.config.from?.name || n.config.from_name ? ` (${n.config.from?.name || n.config.from_name})` : ""}`
                            : "未设置",
                        }),
                        Q.jsx("div", { className: "text-muted-foreground", children: "用户名" }),
                        Q.jsx("div", { children: n.config.username || "未设置" }),
                      ],
                    }),
                  }),
                }),
              ],
            }),
          ],
        }),
      ],
    }),
  });
}
const zGt = gy({
  email_template: ly().nullable().default("classic"),
  email_host: ly().nullable().default(""),
  email_port: by().nullable().default(465),
  email_username: ly().nullable().default(""),
  email_password: ly().nullable().default(""),
  email_encryption: ly().nullable().default(""),
  email_from_address: ly().email().nullable().default(null),
  remind_mail_enable: dy().nullable().default(!1),
});
function UGt() {
  const { t: e } = Py("settings"),
    [t, n] = H.useState(null),
    [i, r] = H.useState(!1),
    [o, s] = H.useState(!1),
    a = kv({ resolver: Ov(zGt), defaultValues: {}, mode: "onBlur" }),
    { data: l } = gC({ queryKey: ["settings", "email"], queryFn: () => xT.getSettings("email") }),
    { data: c } = gC({ queryKey: ["emailTemplate"], queryFn: () => xT.getEmailTemplate() }),
    { mutateAsync: d } = pC({ mutationFn: xT.saveSettings }),
    { mutate: u, isPending: h } = pC({
      mutationFn: xT.sendTestMail,
      onMutate: () => {
        (n(null), r(!1));
      },
      onSuccess: (t) => {
        (n(t.data),
          r(!0),
          t.data.error ? hN.error(e("email.test.error")) : hN.success(e("email.test.success")));
      },
    }),
    g = a.handleSubmit(
      async (t) => {
        s(!0);
        try {
          (await d(t)).data ? hN.success(e("common.autoSaved")) : hN.error(e("common.saveFailed"));
        } catch {
          hN.error(e("common.saveFailed"));
        } finally {
          s(!1);
        }
      },
      () => {
        hN.error(e("common.saveFailed"));
      },
    );
  H.useEffect(() => {
    if (l?.data.email) {
      const e = l.data.email;
      Object.entries(e).forEach(([e, t]) => {
        a.setValue(e, "email_from_address" === e ? t || null : t);
      });
    }
  }, [l, a]);
  return (
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Hy, {
          ...a,
          children: Q.jsxs("form", {
            onSubmit: g,
            className: "space-y-4",
            children: [
              Q.jsx(Uy, {
                control: a.control,
                name: "email_host",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { className: "text-base", children: e("email.email_host.title") }),
                      Q.jsx(Zy, {
                        children: Q.jsx(Q6e, {
                          placeholder: e("common.placeholder"),
                          ...t,
                          value: t.value || "",
                        }),
                      }),
                      Q.jsx(Yy, { children: e("email.email_host.description") }),
                      Q.jsx(Xy, {}),
                    ],
                }),
              }),
              Q.jsx(Uy, {
                control: a.control,
                name: "email_port",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { className: "text-base", children: e("email.email_port.title") }),
                      Q.jsx(Zy, {
                        children: Q.jsx(Q6e, {
                          type: "number",
                          placeholder: e("common.placeholder"),
                          ...t,
                          value: t.value || "",
                          onChange: (e) => {
                            const n = e.target.value ? Number(e.target.value) : null;
                            t.onChange(n);
                          },
                        }),
                      }),
                      Q.jsx(Yy, { children: e("email.email_port.description") }),
                      Q.jsx(Xy, {}),
                    ],
                }),
              }),
              Q.jsx(Uy, {
                control: a.control,
                name: "email_encryption",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("email.email_encryption.title"),
                      }),
                      Q.jsxs(THt, {
                        onValueChange: (e) => {
                          const n = "none" === e ? "" : e;
                          t.onChange(n);
                        },
                        value:
                          "" === t.value || null === t.value || void 0 === t.value
                            ? "none"
                            : t.value,
                        children: [
                          Q.jsx(Zy, {
                            children: Q.jsx(OHt, {
                              children: Q.jsx(RHt, { placeholder: "请选择加密方式" }),
                            }),
                          }),
                          Q.jsxs(PHt, {
                            children: [
                              Q.jsx(FHt, {
                                value: "none",
                                children: e("email.email_encryption.none"),
                              }),
                              Q.jsx(FHt, {
                                value: "ssl",
                                children: e("email.email_encryption.ssl"),
                              }),
                              Q.jsx(FHt, {
                                value: "tls",
                                children: e("email.email_encryption.tls"),
                              }),
                            ],
                          }),
                        ],
                      }),
                      Q.jsx(Yy, { children: e("email.email_encryption.description") }),
                      Q.jsx(Xy, {}),
                    ],
                }),
              }),
              Q.jsx(Uy, {
                control: a.control,
                name: "email_username",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("email.email_username.title"),
                      }),
                      Q.jsx(Zy, {
                        children: Q.jsx(Q6e, {
                          placeholder: e("common.placeholder"),
                          autoComplete: "off",
                          ...t,
                          value: t.value || "",
                        }),
                      }),
                      Q.jsx(Yy, { children: e("email.email_username.description") }),
                      Q.jsx(Xy, {}),
                    ],
                }),
              }),
              Q.jsx(Uy, {
                control: a.control,
                name: "email_password",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("email.email_password.title"),
                      }),
                      Q.jsx(Zy, {
                        children: Q.jsx(Q6e, {
                          type: "password",
                          placeholder: e("common.placeholder"),
                          autoComplete: "off",
                          ...t,
                          value: t.value || "",
                        }),
                      }),
                      Q.jsx(Yy, { children: e("email.email_password.description") }),
                      Q.jsx(Xy, {}),
                    ],
                }),
              }),
              Q.jsx(Uy, {
                control: a.control,
                name: "email_from_address",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { className: "text-base", children: e("email.email_from.title") }),
                      Q.jsx(Zy, {
                        children: Q.jsx(Q6e, {
                          placeholder: e("common.placeholder"),
                          ...t,
                          value: t.value || "",
                          onChange: (e) => {
                            t.onChange(e.target.value || null);
                          },
                        }),
                      }),
                      Q.jsx(Yy, { children: e("email.email_from.description") }),
                      Q.jsx(Xy, {}),
                    ],
                }),
              }),
              Q.jsx(Uy, {
                control: a.control,
                name: "email_template",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, {
                        className: "text-base",
                        children: e("email.email_template.title"),
                      }),
                      Q.jsxs(THt, {
                        onValueChange: t.onChange,
                        value: t.value || void 0,
                        children: [
                          Q.jsx(Zy, {
                            children: Q.jsx(OHt, {
                              className: "w-[200px]",
                              children: Q.jsx(RHt, {
                                placeholder: e("email.email_template.placeholder"),
                              }),
                            }),
                          }),
                          Q.jsx(PHt, {
                            children: c?.data?.map((e) => Q.jsx(FHt, { value: e, children: e }, e)),
                          }),
                        ],
                      }),
                      Q.jsx(Yy, { children: e("email.email_template.description") }),
                      Q.jsx(Xy, {}),
                    ],
                }),
              }),
              Q.jsx(Uy, {
                control: a.control,
                name: "remind_mail_enable",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsxs("div", {
                        className: "space-y-0.5",
                        children: [
                          Q.jsx(Gy, {
                            className: "text-base",
                            children: e("email.remind_mail.title"),
                          }),
                          Q.jsx(Yy, { children: e("email.remind_mail.description") }),
                        ],
                      }),
                      Q.jsx(Zy, {
                        children: Q.jsx(mGt, {
                          checked: t.value || !1,
                          onCheckedChange: t.onChange,
                        }),
                      }),
                    ],
                  }),
              }),
              Q.jsxs("div", {
                className: "flex items-center justify-between gap-3",
                children: [
                  Q.jsx(Nm, {
                    type: "button",
                    onClick: () => u(),
                    loading: h,
                    disabled: h,
                    children: e(h ? "email.test.sending" : "email.test.title"),
                  }),
                  Q.jsxs("div", {
                    className: "flex items-center justify-end gap-3",
                    children: [
                      o &&
                        Q.jsx("div", {
                          className: "text-sm text-muted-foreground",
                          children: e("saving"),
                        }),
                      Q.jsx(Nm, {
                        type: "submit",
                        loading: o,
                        children: e("common.save", "Save"),
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
        }),
        t && Q.jsx(HGt, { open: i, onOpenChange: r, result: t }),
      ],
    })
  );
}
const $Gt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("settings");
          return Q.jsxs("div", {
            className: "space-y-6",
            children: [
              Q.jsxs("div", {
                children: [
                  Q.jsx("h3", { className: "text-lg font-medium", children: e("email.title") }),
                  Q.jsx("p", {
                    className: "text-sm text-muted-foreground",
                    children: e("email.description"),
                  }),
                ],
              }),
              Q.jsx(Um, {}),
              Q.jsx(UGt, {}),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  qGt = gy({
    telegram_bot_enable: dy().nullable(),
    telegram_bot_token: ly().nullable(),
    telegram_webhook_url: ly().nullable(),
    telegram_discuss_link: ly().nullable(),
  }),
  KGt = {
    telegram_bot_enable: !1,
    telegram_bot_token: "",
    telegram_webhook_url: "",
    telegram_discuss_link: "",
  };
function GGt() {
  const { t: e } = Py("settings"),
    [t, n] = H.useState(!1),
    i = kv({ resolver: Ov(qGt), defaultValues: KGt, mode: "onBlur" }),
    { data: r } = gC({
      queryKey: ["settings", "telegram"],
      queryFn: () => xT.getSettings("telegram"),
    }),
    { mutateAsync: o } = pC({ mutationFn: xT.saveSettings }),
    { mutate: s, isPending: a } = pC({
      mutationFn: xT.setTelegramWebhook,
      onSuccess: (t) => {
        const n = t.data;
        if (n) {
          const t = [
            { label: e("telegram.webhook.debug.url"), value: n.webhook_url },
            { label: e("telegram.webhook.debug.baseUrl"), value: n.webhook_base_url },
          ];
          hN.success(e("telegram.webhook.success"), {
            description: Q.jsx("div", {
              className: "mt-2 grid gap-2",
              children: t.map((e) =>
                Q.jsxs(
                  "div",
                  {
                    className: "rounded-md border border-border/60 bg-background/60 px-3 py-2.5",
                    children: [
                      Q.jsx("div", {
                        className:
                          "text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground",
                        children: e.label,
                      }),
                      Q.jsx("div", {
                        className:
                          "mt-1 break-all font-mono text-[11px] leading-5 text-foreground/90",
                        children: e.value,
                      }),
                    ],
                  },
                  e.label,
                ),
              ),
            }),
            duration: 6e3,
          });
        }
      },
    }),
    l = i.handleSubmit(
      async (t) => {
        n(!0);
        try {
          (await o(t)).data ? hN.success(e("common.autoSaved")) : hN.error(e("common.saveFailed"));
        } catch {
          hN.error(e("common.saveFailed"));
        } finally {
          n(!1);
        }
      },
      () => {
        hN.error(e("common.saveFailed"));
      },
    );
  H.useEffect(() => {
    if (r?.data.telegram) {
      const e = r.data.telegram;
      Object.entries(e).forEach(([e, t]) => {
        i.setValue(e, t);
      });
    }
  }, [r, i]);
  const c = Boolean(i.watch("telegram_bot_token")),
    d = i.watch("telegram_webhook_url")?.trim(),
    u = d ? e("telegram.webhook.target_custom", { url: d }) : e("telegram.webhook.target_default");
  return Q.jsx(Hy, {
    ...i,
    children: Q.jsxs("form", {
      onSubmit: l,
      className: "space-y-4",
      children: [
        Q.jsx(Uy, {
          control: i.control,
          name: "telegram_bot_token",
          render: ({ field: t }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, { className: "text-base", children: e("telegram.bot_token.title") }),
                Q.jsx(Zy, {
                  children: Q.jsx(Q6e, {
                    placeholder: e("telegram.bot_token.placeholder"),
                    ...t,
                    value: t.value || "",
                  }),
                }),
                Q.jsx(Yy, { children: e("telegram.bot_token.description") }),
                Q.jsx(Xy, {}),
              ],
            }),
        }),
        c &&
          Q.jsx(Uy, {
            control: i.control,
            name: "telegram_webhook_url",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("telegram.webhook_url.title") }),
                  Q.jsxs("div", {
                    className: "flex flex-col gap-3 sm:flex-row sm:items-start",
                    children: [
                      Q.jsx(Zy, {
                        children: Q.jsx(Q6e, {
                          className: "sm:flex-1",
                          placeholder: e("telegram.webhook_url.placeholder"),
                          ...t,
                          value: t.value || "",
                        }),
                      }),
                      Q.jsx(Nm, {
                        type: "button",
                        className: "sm:shrink-0",
                        loading: a,
                        disabled: a,
                        onClick: () => s(),
                        children: e(a ? "telegram.webhook.setting" : "telegram.webhook.button"),
                      }),
                    ],
                  }),
                  Q.jsx(Yy, {
                    children: Q.jsxs("div", {
                      className: "space-y-1.5",
                      children: [
                        Q.jsxs("div", {
                          children: [e("telegram.webhook_url.description"), " ", u],
                        }),
                        Q.jsxs("a", {
                          href: "https://core.telegram.org/bots/webhooks",
                          target: "_blank",
                          rel: "noreferrer",
                          className:
                            "inline-flex items-center gap-1 text-xs font-medium text-primary underline-offset-4 hover:underline",
                          children: [
                            e("telegram.webhook_url.docs"),
                            Q.jsx(Sat, { className: "h-3.5 w-3.5" }),
                          ],
                        }),
                      ],
                    }),
                  }),
                Q.jsx(Xy, {}),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: i.control,
          name: "telegram_bot_enable",
          render: ({ field: t }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, { className: "text-base", children: e("telegram.bot_enable.title") }),
                Q.jsx(Yy, { children: e("telegram.bot_enable.description") }),
                Q.jsx(Zy, {
                  children: Q.jsx(mGt, {
                    checked: t.value || !1,
                    onCheckedChange: t.onChange,
                  }),
                }),
                Q.jsx(Xy, {}),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: i.control,
          name: "telegram_discuss_link",
          render: ({ field: t }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, { className: "text-base", children: e("telegram.discuss_link.title") }),
                Q.jsx(Zy, {
                  children: Q.jsx(Q6e, {
                    placeholder: e("telegram.discuss_link.placeholder"),
                    ...t,
                    value: t.value || "",
                  }),
                }),
                Q.jsx(Yy, { children: e("telegram.discuss_link.description") }),
                Q.jsx(Xy, {}),
              ],
            }),
        }),
        Q.jsxs("div", {
          className: "flex items-center justify-end gap-3",
          children: [
            t &&
              Q.jsx("div", {
                className: "text-sm text-muted-foreground",
                children: e("common.saving"),
              }),
            Q.jsx(Nm, {
              type: "submit",
              loading: t,
              children: e("common.save", "Save"),
            }),
          ],
        }),
      ],
    }),
  });
}
const ZGt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("settings");
          return Q.jsxs("div", {
            className: "space-y-6",
            children: [
              Q.jsxs("div", {
                children: [
                  Q.jsx("h3", { className: "text-lg font-medium", children: e("telegram.title") }),
                  Q.jsx("p", {
                    className: "text-sm text-muted-foreground",
                    children: e("telegram.description"),
                  }),
                ],
              }),
              Q.jsx(Um, {}),
              Q.jsx(GGt, {}),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  YGt = gy({
    windows_version: ly().nullable(),
    windows_download_url: ly().nullable(),
    macos_version: ly().nullable(),
    macos_download_url: ly().nullable(),
    android_version: ly().nullable(),
    android_download_url: ly().nullable(),
  }),
  XGt = {
    windows_version: "",
    windows_download_url: "",
    macos_version: "",
    macos_download_url: "",
    android_version: "",
    android_download_url: "",
  };
function QGt() {
  const { t: e } = Py("settings"),
    [t, n] = H.useState(!1),
    i = kv({ resolver: Ov(YGt), defaultValues: XGt, mode: "onBlur" }),
    { data: r } = gC({ queryKey: ["settings", "app"], queryFn: () => xT.getSettings("app") }),
    { mutateAsync: o } = pC({ mutationFn: xT.saveSettings }),
    s = i.handleSubmit(
      async (t) => {
        n(!0);
        try {
          (await o(t)).data ? hN.success(e("app.save_success")) : hN.error(e("common.saveFailed"));
        } catch {
          hN.error(e("common.saveFailed"));
        } finally {
          n(!1);
        }
      },
      () => {
        hN.error(e("common.saveFailed"));
      },
    );
  H.useEffect(() => {
    if (r?.data.app) {
      const e = r.data.app;
      Object.entries(e).forEach(([e, t]) => {
        i.setValue(e, t);
      });
    }
  }, [r, i]);
  return (
    Q.jsx(Hy, {
      ...i,
      children: Q.jsxs("form", {
        onSubmit: s,
        className: "space-y-4",
        children: [
          Q.jsx(Uy, {
            control: i.control,
            name: "windows_version",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("app.windows.version.title") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("common.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("app.windows.version.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "windows_download_url",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("app.windows.download.title") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("common.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("app.windows.download.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "macos_version",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("app.macos.version.title") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("common.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("app.macos.version.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "macos_download_url",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("app.macos.download.title") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("common.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("app.macos.download.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "android_version",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("app.android.version.title") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("common.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("app.android.version.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsx(Uy, {
            control: i.control,
            name: "android_download_url",
            render: ({ field: t }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, { className: "text-base", children: e("app.android.download.title") }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      placeholder: e("common.placeholder"),
                      ...t,
                      value: t.value || "",
                    }),
                  }),
                  Q.jsx(Yy, { children: e("app.android.download.description") }),
                  Q.jsx(Xy, {}),
                ],
              }),
          }),
          Q.jsxs("div", {
            className: "flex items-center justify-end gap-3",
            children: [
              t &&
                Q.jsx("div", {
                  className: "text-sm text-muted-foreground",
                  children: e("common.saving"),
                }),
              Q.jsx(Nm, {
                type: "submit",
                loading: t,
                children: e("common.save", "Save"),
              }),
            ],
          }),
        ],
      }),
    })
  );
}
const JGt = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py("settings");
        return Q.jsxs("div", {
          className: "space-y-6",
          children: [
            Q.jsxs("div", {
              children: [
                Q.jsx("h3", { className: "text-lg font-medium", children: e("app.title") }),
                Q.jsx("p", {
                  className: "text-sm text-muted-foreground",
                  children: e("app.description"),
                }),
              ],
            }),
            Q.jsx(Um, {}),
            Q.jsx(QGt, {}),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
function eZt({
  control: e,
  name: t,
  label: n,
  placeholder: i,
  description: r,
  type: o = "text",
  unit: s,
  className: a,
  disabled: l,
  required: c,
  extra: d,
  children: u,
  onChangeCustom: h,
  valueCustom: g,
}) {
  return Q.jsx(Uy, {
    control: e,
    name: t,
    render: ({ field: e }) =>
      Q.jsxs(Ky, {
        className: Rf("space-y-1.5", a),
        children: [
          n &&
            Q.jsxs(Gy, {
              className: "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
              children: [
                n,
                c && Q.jsx("span", { className: "ml-1 text-destructive", children: "*" }),
              ],
            }),
          Q.jsxs("div", {
            className: "relative",
            children: [
              u
                ? Q.jsx(Zy, { children: u })
                : d
                  ? Q.jsx("div", { className: "flex min-h-9 w-full items-center", children: d })
                  : Q.jsx(Zy, {
                      children: Q.jsx(Q6e, {
                        ...e,
                        type: o,
                        placeholder: i,
                        disabled: l,
                        className: Rf(
                          "h-9 font-mono text-xs transition-all focus-visible:ring-1",
                          s && "pr-10",
                        ),
                        value: g ? g(e) : (e.value ?? ""),
                        onChange: (t) => {
                          h ? h(t.target.value, e) : e.onChange(t);
                        },
                      }),
                    }),
              s &&
                !d &&
                !u &&
                Q.jsx("div", {
                  className:
                    "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",
                  children: Q.jsx("span", {
                    className: "font-mono text-[10px] font-bold uppercase text-muted-foreground/40",
                    children: s,
                  }),
                }),
            ],
          }),
          r && Q.jsx(Yy, { className: "font-mono text-[10px] leading-relaxed", children: r }),
          Q.jsx(Xy, { className: "font-mono text-[10px] uppercase tracking-tight" }),
        ],
      }),
  });
}
function tZt({ form: e, config: t, namePrefix: n = "", className: i = "space-y-4" }) {
  const [r, o] = H.useState({}),
    s = (t, i) => {
      const o = ((e) => (n ? `${n}.${e}` : e))(t);
      switch (i.type) {
        case "string":
          return Q.jsx(
            eZt,
            {
              control: e.control,
              name: o,
              label: i.label || i.description,
              placeholder: i.placeholder,
              description: i.label ? i.description : void 0,
              required: i.required,
            },
            t,
          );
        case "number":
        case "percentage":
          return Q.jsx(
            eZt,
            {
              control: e.control,
              name: o,
              label: i.label || i.description,
              placeholder: i.placeholder,
              description: i.label ? i.description : void 0,
              type: "number",
              unit: "percentage" === i.type ? "%" : void 0,
              required: i.required,
              onChangeCustom: (e, t) => {
                const n = Number(e);
                "percentage" === i.type ? t.onChange(Math.min(100, Math.max(0, n))) : t.onChange(n);
              },
            },
            t,
          );
        case "select":
          return Q.jsx(
            eZt,
            {
              control: e.control,
              name: o,
              label: i.label || i.description,
              description: i.label ? i.description : void 0,
              required: i.required,
              extra: Q.jsxs(THt, {
                onValueChange: (t) => e.setValue(o, t),
                value: e.watch(o),
                children: [
                  Q.jsx(Zy, {
                    children: Q.jsx(OHt, {
                      className: "h-9 font-mono text-xs",
                      children: Q.jsx(RHt, { placeholder: i.placeholder }),
                    }),
                  }),
                  Q.jsx(PHt, {
                    children: i.options?.map((e) =>
                      Q.jsx(FHt, { value: e.value, children: e.label }, e.value),
                    ),
                  }),
                ],
              }),
            },
            t,
          );
        case "boolean":
          return Q.jsx(
            Uy,
            {
              control: e.control,
              name: o,
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  className:
                    "flex flex-row items-center justify-between space-y-0 rounded-lg border p-4",
                  children: [
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsxs(Gy, {
                          className:
                            "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                          children: [
                            i.label || i.description,
                            i.required &&
                              Q.jsx("span", { className: "ml-1 text-destructive", children: "*" }),
                          ],
                        }),
                        i.description &&
                          i.label &&
                          Q.jsx("p", {
                            className:
                              "font-mono text-[10px] leading-relaxed text-muted-foreground",
                            children: i.description,
                          }),
                      ],
                    }),
                    Q.jsx(Zy, {
                      children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                    }),
                  ],
                }),
            },
            t,
          );
        case "text":
          return Q.jsx(
            eZt,
            {
              control: e.control,
              name: o,
              label: i.label || i.description,
              placeholder: i.placeholder,
              description: i.label ? i.description : void 0,
              required: i.required,
              extra: Q.jsx(Zy, {
                children: Q.jsx(_Gt, {
                  placeholder: i.placeholder,
                  className: "min-h-[80px] font-mono text-xs",
                  ...e.register(o),
                }),
              }),
            },
            t,
          );
        case "yaml":
        case "json":
          return Q.jsx(
            Uy,
            {
              control: e.control,
              name: o,
              render: ({ field: e }) => {
                const o = (() => {
                    if (null === e.value || void 0 === e.value) return "";
                    if ("string" == typeof e.value) return e.value;
                    try {
                      return JSON.stringify(e.value, null, 2);
                    } catch {
                      return String(e.value);
                    }
                  })(),
                  s = r[`${n}_${t}`] || 150;
                return Q.jsxs(Ky, {
                  className: "space-y-1.5",
                  children: [
                    Q.jsxs(Gy, {
                      className:
                        "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                      children: [
                        i.label || i.description,
                        i.required &&
                          Q.jsx("span", { className: "ml-1 text-destructive", children: "*" }),
                      ],
                    }),
                    Q.jsx(Zy, {
                      children: Q.jsx("div", {
                        className: "resize-y overflow-hidden rounded-md border",
                        style: { height: `${s}px` },
                        children: Q.jsx(bI, {
                          height: "100%",
                          defaultLanguage: i.type,
                          value: o,
                          onChange: (t) => {
                            e.onChange(t || "");
                          },
                          options: {
                            minimap: { enabled: !1 },
                            fontSize: 14,
                            wordWrap: "on",
                            scrollBeyondLastLine: !1,
                            automaticLayout: !0,
                            formatOnPaste: "json" === i.type,
                            formatOnType: "json" === i.type,
                          },
                        }),
                      }),
                    }),
                    i.description &&
                      i.label &&
                      Q.jsx("p", {
                        className: "font-mono text-[10px] leading-relaxed text-muted-foreground",
                        children: i.description,
                      }),
                    Q.jsx(Xy, { className: "font-mono text-[10px] uppercase tracking-tight" }),
                  ],
                });
              },
            },
            t,
          );
        default:
          return null;
      }
    };
  return Q.jsx("div", { className: i, children: Object.entries(t).map(([e, t]) => s(e, t)) });
}
function nZt(e) {
  return Object.fromEntries(
    Object.entries(e).map(([e, t]) => {
      let n = t.value;
      if ("yaml" === t.type || "json" === t.type)
        if (null == n) n = "";
        else if ("string" != typeof n)
          try {
            n = JSON.stringify(n, null, 2);
          } catch {
            n = String(n);
          }
      return [e, n];
    }),
  );
}
iI.config({ monaco: CQe });
const iZt = Object.freeze({ left: 0, top: 0, width: 16, height: 16 }),
  rZt = Object.freeze({ rotate: 0, vFlip: !1, hFlip: !1 }),
  oZt = Object.freeze({ ...iZt, ...rZt }),
  sZt = Object.freeze({ ...oZt, body: "", hidden: !1 });
function aZt(e, t) {
  const n = (function (e, t) {
    const n = {};
    (!e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0));
    const i = ((e.rotate || 0) + (t.rotate || 0)) % 4;
    return (i && (n.rotate = i), n);
  })(e, t);
  for (const i in sZt)
    i in rZt
      ? i in e && !(i in n) && (n[i] = rZt[i])
      : i in t
        ? (n[i] = t[i])
        : i in e && (n[i] = e[i]);
  return n;
}
function lZt(e, t, n) {
  const i = e.icons,
    r = e.aliases || Object.create(null);
  let o = {};
  function s(e) {
    o = aZt(i[e] || r[e], o);
  }
  return (s(t), n.forEach(s), aZt(e, o));
}
function cZt(e, t) {
  const n = [];
  if ("object" != typeof e || "object" != typeof e.icons) return n;
  e.not_found instanceof Array &&
    e.not_found.forEach((e) => {
      (t(e, null), n.push(e));
    });
  const i = (function (e) {
    const t = e.icons,
      n = e.aliases || Object.create(null),
      i = Object.create(null);
    return (
      Object.keys(t)
        .concat(Object.keys(n))
        .forEach(function e(r) {
          if (t[r]) return (i[r] = []);
          if (!(r in i)) {
            i[r] = null;
            const t = n[r] && n[r].parent,
              o = t && e(t);
            o && (i[r] = [t].concat(o));
          }
          return i[r];
        }),
      i
    );
  })(e);
  for (const r in i) {
    const o = i[r];
    o && (t(r, lZt(e, r, o)), n.push(r));
  }
  return n;
}
const dZt = { provider: "", aliases: {}, not_found: {}, ...iZt };
function uZt(e, t) {
  for (const n in t) if (n in e && typeof e[n] != typeof t[n]) return !1;
  return !0;
}
function hZt(e) {
  if ("object" != typeof e || null === e) return null;
  const t = e;
  if ("string" != typeof t.prefix || !e.icons || "object" != typeof e.icons) return null;
  if (!uZt(e, dZt)) return null;
  const n = t.icons;
  for (const r in n) {
    const e = n[r];
    if (!r || "string" != typeof e.body || !uZt(e, sZt)) return null;
  }
  const i = t.aliases || Object.create(null);
  for (const r in i) {
    const e = i[r],
      t = e.parent;
    if (!r || "string" != typeof t || (!n[t] && !i[t]) || !uZt(e, sZt)) return null;
  }
  return t;
}
const gZt = /^[a-z0-9]+(-[a-z0-9]+)*$/,
  pZt = (e, t, n, i = "") => {
    const r = e.split(":");
    if ("@" === e.slice(0, 1)) {
      if (r.length < 2 || r.length > 3) return null;
      i = r.shift().slice(1);
    }
    if (r.length > 3 || !r.length) return null;
    if (r.length > 1) {
      const e = r.pop(),
        n = r.pop(),
        o = { provider: r.length > 0 ? r[0] : i, prefix: n, name: e };
      return t && !fZt(o) ? null : o;
    }
    const o = r[0],
      s = o.split("-");
    if (s.length > 1) {
      const e = { provider: i, prefix: s.shift(), name: s.join("-") };
      return t && !fZt(e) ? null : e;
    }
    if (n && "" === i) {
      const e = { provider: i, prefix: "", name: o };
      return t && !fZt(e, n) ? null : e;
    }
    return null;
  },
  fZt = (e, t) => !!e && !(!((t && "" === e.prefix) || e.prefix) || !e.name),
  mZt = Object.create(null);
function _Zt(e, t) {
  const n = mZt[e] || (mZt[e] = Object.create(null));
  return (
    n[t] ||
    (n[t] = (function (e, t) {
      return { provider: e, prefix: t, icons: Object.create(null), missing: new Set() };
    })(e, t))
  );
}
function vZt(e, t) {
  return hZt(t)
    ? cZt(t, (t, n) => {
        n ? (e.icons[t] = n) : e.missing.add(t);
      })
    : [];
}
let bZt = !1;
function yZt(e) {
  return ("boolean" == typeof e && (bZt = e), bZt);
}
function xZt(e) {
  const t = "string" == typeof e ? pZt(e, !0, bZt) : e;
  if (t) {
    const e = _Zt(t.provider, t.prefix),
      n = t.name;
    return e.icons[n] || (e.missing.has(n) ? null : void 0);
  }
}
function wZt(e, t) {
  if ("object" != typeof e) return !1;
  if (("string" != typeof t && (t = e.provider || ""), bZt && !t && !e.prefix)) {
    let t = !1;
    return (
      hZt(e) &&
        ((e.prefix = ""),
        cZt(e, (e, n) => {
          (function (e, t) {
            const n = pZt(e, !0, bZt);
            if (!n) return !1;
            const i = _Zt(n.provider, n.prefix);
            return t
              ? (function (e, t, n) {
                  try {
                    if ("string" == typeof n.body) return ((e.icons[t] = { ...n }), !0);
                  } catch (W8t) {}
                  return !1;
                })(i, n.name, t)
              : (i.missing.add(n.name), !0);
          })(e, n) && (t = !0);
        })),
      t
    );
  }
  const n = e.prefix;
  if (!fZt({ prefix: n, name: "a" })) return !1;
  return !!vZt(_Zt(t, n), e);
}
const CZt = Object.freeze({ width: null, height: null }),
  SZt = Object.freeze({ ...CZt, ...rZt }),
  kZt = /(-?[0-9.]*[0-9]+[0-9.]*)/g,
  EZt = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
function NZt(e, t, n) {
  if (1 === t) return e;
  if (((n = n || 100), "number" == typeof e)) return Math.ceil(e * t * n) / n;
  if ("string" != typeof e) return e;
  const i = e.split(kZt);
  if (null === i || !i.length) return e;
  const r = [];
  let o = i.shift(),
    s = EZt.test(o);
  for (;;) {
    if (s) {
      const e = parseFloat(o);
      isNaN(e) ? r.push(o) : r.push(Math.ceil(e * t * n) / n);
    } else r.push(o);
    if (((o = i.shift()), void 0 === o)) return r.join("");
    s = !s;
  }
}
const LZt = /\sid="(\S+)"/g,
  DZt = "IconifyId" + Date.now().toString(16) + ((16777216 * Math.random()) | 0).toString(16);
let TZt = 0;
function IZt(e, t = DZt) {
  const n = [];
  let i;
  for (; (i = LZt.exec(e)); ) n.push(i[1]);
  if (!n.length) return e;
  const r = "suffix" + ((16777216 * Math.random()) | Date.now()).toString(16);
  return (
    n.forEach((n) => {
      const i = "function" == typeof t ? t(n) : t + (TZt++).toString(),
        o = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
      e = e.replace(new RegExp('([#;"])(' + o + ')([")]|\\.[a-z])', "g"), "$1" + i + r + "$3");
    }),
    (e = e.replace(new RegExp(r, "g"), ""))
  );
}
const RZt = Object.create(null);
function OZt(e) {
  return RZt[e] || RZt[""];
}
function MZt(e) {
  let t;
  if ("string" == typeof e.resources) t = [e.resources];
  else if (((t = e.resources), !(t instanceof Array && t.length))) return null;
  return {
    resources: t,
    path: e.path || "/",
    maxURL: e.maxURL || 500,
    rotate: e.rotate || 750,
    timeout: e.timeout || 5e3,
    random: !0 === e.random,
    index: e.index || 0,
    dataAfterTimeout: !1 !== e.dataAfterTimeout,
  };
}
const AZt = Object.create(null),
  PZt = ["https://api.simplesvg.com", "https://api.unisvg.com"],
  jZt = [];
for (; PZt.length > 0; )
  1 === PZt.length || Math.random() > 0.5 ? jZt.push(PZt.shift()) : jZt.push(PZt.pop());
function FZt(e, t) {
  const n = MZt(t);
  return null !== n && ((AZt[e] = n), !0);
}
function BZt(e) {
  return AZt[e];
}
AZt[""] = MZt({ resources: ["https://api.iconify.design"].concat(jZt) });
let VZt = (() => {
  let e;
  try {
    if (((e = fetch), "function" == typeof e)) return e;
  } catch (W8t) {}
})();
const WZt = {
  prepare: (e, t, n) => {
    const i = [],
      r = (function (e, t) {
        const n = BZt(e);
        if (!n) return 0;
        let i;
        if (n.maxURL) {
          let e = 0;
          n.resources.forEach((t) => {
            const n = t;
            e = Math.max(e, n.length);
          });
          const r = t + ".json?icons=";
          i = n.maxURL - e - n.path.length - r.length;
        } else i = 0;
        return i;
      })(e, t),
      o = "icons";
    let s = { type: o, provider: e, prefix: t, icons: [] },
      a = 0;
    return (
      n.forEach((n, l) => {
        ((a += n.length + 1),
          a >= r &&
            l > 0 &&
            (i.push(s), (s = { type: o, provider: e, prefix: t, icons: [] }), (a = n.length)),
          s.icons.push(n));
      }),
      i.push(s),
      i
    );
  },
  send: (e, t, n) => {
    if (!VZt) return void n("abort", 424);
    let i = (function (e) {
      if ("string" == typeof e) {
        const t = BZt(e);
        if (t) return t.path;
      }
      return "/";
    })(t.provider);
    switch (t.type) {
      case "icons": {
        const e = t.prefix,
          n = t.icons.join(",");
        i += e + ".json?" + new URLSearchParams({ icons: n }).toString();
        break;
      }
      case "custom": {
        const e = t.uri;
        i += "/" === e.slice(0, 1) ? e.slice(1) : e;
        break;
      }
      default:
        return void n("abort", 400);
    }
    let r = 503;
    VZt(e + i)
      .then((e) => {
        const t = e.status;
        if (200 === t) return ((r = 501), e.json());
        setTimeout(() => {
          n(
            (function (e) {
              return 404 === e;
            })(t)
              ? "abort"
              : "next",
            t,
          );
        });
      })
      .then((e) => {
        "object" == typeof e && null !== e
          ? setTimeout(() => {
              n("success", e);
            })
          : setTimeout(() => {
              404 === e ? n("abort", e) : n("next", r);
            });
      })
      .catch(() => {
        n("next", r);
      });
  },
};
function HZt(e, t) {
  e.forEach((e) => {
    const n = e.loaderCallbacks;
    n && (e.loaderCallbacks = n.filter((e) => e.id !== t));
  });
}
let zZt = 0;
var UZt = { resources: [], index: 0, timeout: 2e3, rotate: 750, random: !1, dataAfterTimeout: !1 };
function $Zt(e, t, n, i) {
  const r = e.resources.length,
    o = e.random ? Math.floor(Math.random() * r) : e.index;
  let s;
  if (e.random) {
    let t = e.resources.slice(0);
    for (s = []; t.length > 1; ) {
      const e = Math.floor(Math.random() * t.length);
      (s.push(t[e]), (t = t.slice(0, e).concat(t.slice(e + 1))));
    }
    s = s.concat(t);
  } else s = e.resources.slice(o).concat(e.resources.slice(0, o));
  const a = Date.now();
  let l,
    c = "pending",
    d = 0,
    u = null,
    h = [],
    g = [];
  function p() {
    u && (clearTimeout(u), (u = null));
  }
  function f() {
    ("pending" === c && (c = "aborted"),
      p(),
      h.forEach((e) => {
        "pending" === e.status && (e.status = "aborted");
      }),
      (h = []));
  }
  function m(e, t) {
    (t && (g = []), "function" == typeof e && g.push(e));
  }
  function _() {
    ((c = "failed"),
      g.forEach((e) => {
        e(void 0, l);
      }));
  }
  function v() {
    (h.forEach((e) => {
      "pending" === e.status && (e.status = "aborted");
    }),
      (h = []));
  }
  function b() {
    if ("pending" !== c) return;
    p();
    const i = s.shift();
    if (void 0 === i)
      return h.length
        ? void (u = setTimeout(() => {
            (p(), "pending" === c && (v(), _()));
          }, e.timeout))
        : void _();
    const r = {
      status: "pending",
      resource: i,
      callback: (t, n) => {
        !(function (t, n, i) {
          const r = "success" !== n;
          switch (((h = h.filter((e) => e !== t)), c)) {
            case "pending":
              break;
            case "failed":
              if (r || !e.dataAfterTimeout) return;
              break;
            default:
              return;
          }
          if ("abort" === n) return ((l = i), void _());
          if (r) return ((l = i), void (h.length || (s.length ? b() : _())));
          if ((p(), v(), !e.random)) {
            const n = e.resources.indexOf(t.resource);
            -1 !== n && n !== e.index && (e.index = n);
          }
          ((c = "completed"),
            g.forEach((e) => {
              e(i);
            }));
        })(r, t, n);
      },
    };
    (h.push(r), d++, (u = setTimeout(b, e.rotate)), n(i, t, r.callback));
  }
  return (
    "function" == typeof i && g.push(i),
    setTimeout(b),
    function () {
      return {
        startTime: a,
        payload: t,
        status: c,
        queriesSent: d,
        queriesPending: h.length,
        subscribe: m,
        abort: f,
      };
    }
  );
}
function qZt(e) {
  const t = { ...UZt, ...e };
  let n = [];
  function i() {
    n = n.filter((e) => "pending" === e().status);
  }
  const r = {
    query: function (e, r, o) {
      const s = $Zt(t, e, r, (e, t) => {
        (i(), o && o(e, t));
      });
      return (n.push(s), s);
    },
    find: function (e) {
      return n.find((t) => e(t)) || null;
    },
    setIndex: (e) => {
      t.index = e;
    },
    getIndex: () => t.index,
    cleanup: i,
  };
  return r;
}
function KZt() {}
const GZt = Object.create(null);
function ZZt(e, t, n) {
  let i, r;
  if ("string" == typeof e) {
    const t = OZt(e);
    if (!t) return (n(void 0, 424), KZt);
    r = t.send;
    const o = (function (e) {
      if (!GZt[e]) {
        const t = BZt(e);
        if (!t) return;
        const n = { config: t, redundancy: qZt(t) };
        GZt[e] = n;
      }
      return GZt[e];
    })(e);
    o && (i = o.redundancy);
  } else {
    const t = MZt(e);
    if (t) {
      i = qZt(t);
      const n = OZt(e.resources ? e.resources[0] : "");
      n && (r = n.send);
    }
  }
  return i && r ? i.query(t, r, n)().abort : (n(void 0, 424), KZt);
}
function YZt() {}
function XZt(e) {
  e.iconsLoaderFlag ||
    ((e.iconsLoaderFlag = !0),
    setTimeout(() => {
      ((e.iconsLoaderFlag = !1),
        (function (e) {
          e.pendingCallbacksFlag ||
            ((e.pendingCallbacksFlag = !0),
            setTimeout(() => {
              e.pendingCallbacksFlag = !1;
              const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
              if (!t.length) return;
              let n = !1;
              const i = e.provider,
                r = e.prefix;
              t.forEach((t) => {
                const o = t.icons,
                  s = o.pending.length;
                ((o.pending = o.pending.filter((t) => {
                  if (t.prefix !== r) return !0;
                  const s = t.name;
                  if (e.icons[s]) o.loaded.push({ provider: i, prefix: r, name: s });
                  else {
                    if (!e.missing.has(s)) return ((n = !0), !0);
                    o.missing.push({ provider: i, prefix: r, name: s });
                  }
                  return !1;
                })),
                  o.pending.length !== s &&
                    (n || HZt([e], t.id),
                    t.callback(
                      o.loaded.slice(0),
                      o.missing.slice(0),
                      o.pending.slice(0),
                      t.abort,
                    )));
              });
            }));
        })(e));
    }));
}
function QZt(e, t, n) {
  function i() {
    const n = e.pendingIcons;
    t.forEach((t) => {
      (n && n.delete(t), e.icons[t] || e.missing.add(t));
    });
  }
  if (n && "object" == typeof n)
    try {
      if (!vZt(e, n).length) return void i();
    } catch (W8t) {}
  (i(), XZt(e));
}
function JZt(e, t) {
  e instanceof Promise
    ? e
        .then((e) => {
          t(e);
        })
        .catch(() => {
          t(null);
        })
    : t(e);
}
function eYt(e, t) {
  (e.iconsToLoad ? (e.iconsToLoad = e.iconsToLoad.concat(t).sort()) : (e.iconsToLoad = t),
    e.iconsQueueFlag ||
      ((e.iconsQueueFlag = !0),
      setTimeout(() => {
        e.iconsQueueFlag = !1;
        const { provider: t, prefix: n } = e,
          i = e.iconsToLoad;
        if ((delete e.iconsToLoad, !i || !i.length)) return;
        const r = e.loadIcon;
        if (e.loadIcons && (i.length > 1 || !r))
          return void JZt(e.loadIcons(i, n, t), (t) => {
            QZt(e, i, t);
          });
        if (r)
          return void i.forEach((i) => {
            JZt(r(i, n, t), (t) => {
              QZt(e, [i], t ? { prefix: n, icons: { [i]: t } } : null);
            });
          });
        const { valid: o, invalid: s } = (function (e) {
          const t = [],
            n = [];
          return (
            e.forEach((e) => {
              (e.match(gZt) ? t : n).push(e);
            }),
            { valid: t, invalid: n }
          );
        })(i);
        if ((s.length && QZt(e, s, null), !o.length)) return;
        const a = n.match(gZt) ? OZt(t) : null;
        if (!a) return void QZt(e, o, null);
        a.prepare(t, n, o).forEach((n) => {
          ZZt(t, n, (t) => {
            QZt(e, n.icons, t);
          });
        });
      })));
}
const tYt = (e, t) => {
  const n = (function (e, t = !0, n = !1) {
      const i = [];
      return (
        e.forEach((e) => {
          const r = "string" == typeof e ? pZt(e, t, n) : e;
          r && i.push(r);
        }),
        i
      );
    })(e, !0, yZt()),
    i = (function (e) {
      const t = { loaded: [], missing: [], pending: [] },
        n = Object.create(null);
      e.sort((e, t) =>
        e.provider !== t.provider
          ? e.provider.localeCompare(t.provider)
          : e.prefix !== t.prefix
            ? e.prefix.localeCompare(t.prefix)
            : e.name.localeCompare(t.name),
      );
      let i = { provider: "", prefix: "", name: "" };
      return (
        e.forEach((e) => {
          if (i.name === e.name && i.prefix === e.prefix && i.provider === e.provider) return;
          i = e;
          const r = e.provider,
            o = e.prefix,
            s = e.name,
            a = n[r] || (n[r] = Object.create(null)),
            l = a[o] || (a[o] = _Zt(r, o));
          let c;
          c = s in l.icons ? t.loaded : "" === o || l.missing.has(s) ? t.missing : t.pending;
          const d = { provider: r, prefix: o, name: s };
          c.push(d);
        }),
        t
      );
    })(n);
  if (!i.pending.length) {
    let e = !0;
    return (
      t &&
        setTimeout(() => {
          e && t(i.loaded, i.missing, i.pending, YZt);
        }),
      () => {
        e = !1;
      }
    );
  }
  const r = Object.create(null),
    o = [];
  let s, a;
  return (
    i.pending.forEach((e) => {
      const { provider: t, prefix: n } = e;
      if (n === a && t === s) return;
      ((s = t), (a = n), o.push(_Zt(t, n)));
      const i = r[t] || (r[t] = Object.create(null));
      i[n] || (i[n] = []);
    }),
    i.pending.forEach((e) => {
      const { provider: t, prefix: n, name: i } = e,
        o = _Zt(t, n),
        s = o.pendingIcons || (o.pendingIcons = new Set());
      s.has(i) || (s.add(i), r[t][n].push(i));
    }),
    o.forEach((e) => {
      const t = r[e.provider][e.prefix];
      t.length && eYt(e, t);
    }),
    t
      ? (function (e, t, n) {
          const i = zZt++,
            r = HZt.bind(null, n, i);
          if (!t.pending.length) return r;
          const o = { id: i, icons: t, callback: e, abort: r };
          return (
            n.forEach((e) => {
              (e.loaderCallbacks || (e.loaderCallbacks = [])).push(o);
            }),
            r
          );
        })(t, i, o)
      : YZt
  );
};
const nYt = /[\s,]+/;
function iYt(e, t) {
  t.split(nYt).forEach((t) => {
    switch (t.trim()) {
      case "horizontal":
        e.hFlip = !0;
        break;
      case "vertical":
        e.vFlip = !0;
    }
  });
}
function rYt(e, t = 0) {
  const n = e.replace(/^-?[0-9.]*/, "");
  function i(e) {
    for (; e < 0; ) e += 4;
    return e % 4;
  }
  if ("" === n) {
    const t = parseInt(e);
    return isNaN(t) ? 0 : i(t);
  }
  if (n !== e) {
    let t = 0;
    switch (n) {
      case "%":
        t = 25;
        break;
      case "deg":
        t = 90;
    }
    if (t) {
      let r = parseFloat(e.slice(0, e.length - n.length));
      return isNaN(r) ? 0 : ((r /= t), r % 1 == 0 ? i(r) : 0);
    }
  }
  return t;
}
function oYt(e) {
  return (
    'url("' +
    (function (e) {
      return (
        "data:image/svg+xml," +
        (function (e) {
          return e
            .replace(/"/g, "'")
            .replace(/%/g, "%25")
            .replace(/#/g, "%23")
            .replace(/</g, "%3C")
            .replace(/>/g, "%3E")
            .replace(/\s+/g, " ");
        })(e)
      );
    })(e) +
    '")'
  );
}
let sYt;
function aYt(e) {
  return (
    void 0 === sYt &&
      (function () {
        try {
          sYt = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
        } catch (W8t) {
          sYt = null;
        }
      })(),
    sYt ? sYt.createHTML(e) : e
  );
}
const lYt = { ...SZt, inline: !1 },
  cYt = {
    xmlns: "http://www.w3.org/2000/svg",
    xmlnsXlink: "http://www.w3.org/1999/xlink",
    "aria-hidden": !0,
    role: "img",
  },
  dYt = { display: "inline-block" },
  uYt = { backgroundColor: "currentColor" },
  hYt = { backgroundColor: "transparent" },
  gYt = { Image: "var(--svg)", Repeat: "no-repeat", Size: "100% 100%" },
  pYt = { WebkitMask: uYt, mask: uYt, background: hYt };
for (const Set in pYt) {
  const e = pYt[Set];
  for (const t in gYt) e[Set + t] = gYt[t];
}
const fYt = { ...lYt, inline: !0 };
function mYt(e) {
  return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
}
const _Yt = (e, t, n) => {
  const i = t.inline ? fYt : lYt,
    r = (function (e, t) {
      const n = { ...e };
      for (const i in t) {
        const e = t[i],
          r = typeof e;
        i in CZt
          ? (null === e || (e && ("string" === r || "number" === r))) && (n[i] = e)
          : r === typeof n[i] && (n[i] = "rotate" === i ? e % 4 : e);
      }
      return n;
    })(i, t),
    o = t.mode || "svg",
    s = {},
    a = t.style || {},
    l = { ...("svg" === o ? cYt : {}) };
  if (n) {
    const e = pZt(n, !1, !0);
    if (e) {
      const t = ["iconify"],
        n = ["provider", "prefix"];
      for (const i of n) e[i] && t.push("iconify--" + e[i]);
      l.className = t.join(" ");
    }
  }
  for (let m in t) {
    const e = t[m];
    if (void 0 !== e)
      switch (m) {
        case "icon":
        case "style":
        case "children":
        case "onLoad":
        case "mode":
        case "ssr":
          break;
        case "_ref":
          l.ref = e;
          break;
        case "className":
          l[m] = (l[m] ? l[m] + " " : "") + e;
          break;
        case "inline":
        case "hFlip":
        case "vFlip":
          r[m] = !0 === e || "true" === e || 1 === e;
          break;
        case "flip":
          "string" == typeof e && iYt(r, e);
          break;
        case "color":
          s.color = e;
          break;
        case "rotate":
          "string" == typeof e ? (r[m] = rYt(e)) : "number" == typeof e && (r[m] = e);
          break;
        case "ariaHidden":
        case "aria-hidden":
          !0 !== e && "true" !== e && delete l["aria-hidden"];
          break;
        default:
          void 0 === i[m] && (l[m] = e);
      }
  }
  const c = (function (e, t) {
      const n = { ...oZt, ...e },
        i = { ...SZt, ...t },
        r = { left: n.left, top: n.top, width: n.width, height: n.height };
      let o = n.body;
      [n, i].forEach((e) => {
        const t = [],
          n = e.hFlip,
          i = e.vFlip;
        let s,
          a = e.rotate;
        switch (
          (n
            ? i
              ? (a += 2)
              : (t.push(
                  "translate(" + (r.width + r.left).toString() + " " + (0 - r.top).toString() + ")",
                ),
                t.push("scale(-1 1)"),
                (r.top = r.left = 0))
            : i &&
              (t.push(
                "translate(" + (0 - r.left).toString() + " " + (r.height + r.top).toString() + ")",
              ),
              t.push("scale(1 -1)"),
              (r.top = r.left = 0)),
          a < 0 && (a -= 4 * Math.floor(a / 4)),
          (a %= 4),
          a)
        ) {
          case 1:
            ((s = r.height / 2 + r.top),
              t.unshift("rotate(90 " + s.toString() + " " + s.toString() + ")"));
            break;
          case 2:
            t.unshift(
              "rotate(180 " +
                (r.width / 2 + r.left).toString() +
                " " +
                (r.height / 2 + r.top).toString() +
                ")",
            );
            break;
          case 3:
            ((s = r.width / 2 + r.left),
              t.unshift("rotate(-90 " + s.toString() + " " + s.toString() + ")"));
        }
        (a % 2 == 1 &&
          (r.left !== r.top && ((s = r.left), (r.left = r.top), (r.top = s)),
          r.width !== r.height && ((s = r.width), (r.width = r.height), (r.height = s))),
          t.length &&
            (o = (function (e, t, n) {
              const i = (function (e, t = "defs") {
                let n = "";
                const i = e.indexOf("<" + t);
                for (; i >= 0; ) {
                  const r = e.indexOf(">", i),
                    o = e.indexOf("</" + t);
                  if (-1 === r || -1 === o) break;
                  const s = e.indexOf(">", o);
                  if (-1 === s) break;
                  ((n += e.slice(r + 1, o).trim()), (e = e.slice(0, i).trim() + e.slice(s + 1)));
                }
                return { defs: n, content: e };
              })(e);
              return ((r = i.defs), (o = t + i.content + n), r ? "<defs>" + r + "</defs>" + o : o);
              var r, o;
            })(o, '<g transform="' + t.join(" ") + '">', "</g>")));
      });
      const s = i.width,
        a = i.height,
        l = r.width,
        c = r.height;
      let d, u;
      null === s
        ? ((u = null === a ? "1em" : "auto" === a ? c : a), (d = NZt(u, l / c)))
        : ((d = "auto" === s ? l : s), (u = null === a ? NZt(d, c / l) : "auto" === a ? c : a));
      const h = {},
        g = (e, t) => {
          ((e) => "unset" === e || "undefined" === e || "none" === e)(t) || (h[e] = t.toString());
        };
      (g("width", d), g("height", u));
      const p = [r.left, r.top, l, c];
      return ((h.viewBox = p.join(" ")), { attributes: h, viewBox: p, body: o });
    })(e, r),
    d = c.attributes;
  if ((r.inline && (s.verticalAlign = "-0.125em"), "svg" === o)) {
    ((l.style = { ...s, ...a }), Object.assign(l, d));
    let e = 0,
      n = t.id;
    return (
      "string" == typeof n && (n = n.replace(/-/g, "_")),
      (l.dangerouslySetInnerHTML = {
        __html: aYt(IZt(c.body, n ? () => n + "ID" + e++ : "iconifyReact")),
      }),
      H.createElement("svg", l)
    );
  }
  const { body: u, width: h, height: g } = e,
    p = "mask" === o || ("bg" !== o && -1 !== u.indexOf("currentColor")),
    f = (function (e, t) {
      let n = -1 === e.indexOf("xlink:") ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
      for (const i in t) n += " " + i + '="' + t[i] + '"';
      return '<svg xmlns="http://www.w3.org/2000/svg"' + n + ">" + e + "</svg>";
    })(u, { ...d, width: h + "", height: g + "" });
  return (
    (l.style = {
      ...s,
      "--svg": oYt(f),
      width: mYt(d.width),
      height: mYt(d.height),
      ...dYt,
      ...(p ? uYt : hYt),
      ...a,
    }),
    H.createElement("span", l)
  );
};
var vYt;
if (
  (yZt(!0),
  (vYt = WZt),
  (RZt[""] = vYt),
  "undefined" != typeof document && "undefined" != typeof window)
) {
  const e = window;
  if (void 0 !== e.IconifyPreload) {
    const t = e.IconifyPreload;
    "object" == typeof t &&
      null !== t &&
      (t instanceof Array ? t : [t]).forEach((e) => {
        try {
          "object" != typeof e ||
            null === e ||
            e instanceof Array ||
            "object" != typeof e.icons ||
            "string" != typeof e.prefix ||
            wZt(e);
        } catch (spt) {}
      });
  }
  if (void 0 !== e.IconifyProviders) {
    const t = e.IconifyProviders;
    if ("object" == typeof t && null !== t)
      for (let e in t) {
        try {
          const n = t[e];
          if ("object" != typeof n || !n || void 0 === n.resources) continue;
          FZt(e, n);
        } catch (spt) {}
      }
  }
}
function bYt(e) {
  const [t, n] = H.useState(!!e.ssr),
    [i, r] = H.useState({});
  const [o, s] = H.useState(
    (function (t) {
      if (t) {
        const t = e.icon;
        if ("object" == typeof t) return { name: "", data: t };
        const n = xZt(t);
        if (n) return { name: t, data: n };
      }
      return { name: "" };
    })(!!e.ssr),
  );
  function a() {
    const e = i.callback;
    e && (e(), r({}));
  }
  function l(e) {
    if (JSON.stringify(o) !== JSON.stringify(e)) return (a(), s(e), !0);
  }
  function c() {
    var t;
    const n = e.icon;
    if ("object" == typeof n) return void l({ name: "", data: n });
    const i = xZt(n);
    if (l({ name: n, data: i }))
      if (void 0 === i) {
        const e = tYt([n], c);
        r({ callback: e });
      } else i && (null === (t = e.onLoad) || void 0 === t || t.call(e, n));
  }
  (H.useEffect(() => (n(!0), a), []),
    H.useEffect(() => {
      t && c();
    }, [e.icon, t]));
  const { name: d, data: u } = o;
  return u
    ? _Yt({ ...oZt, ...u }, e, d)
    : e.children
      ? e.children
      : e.fallback
        ? e.fallback
        : H.createElement("span", {});
}
const yYt = H.forwardRef((e, t) => bYt({ ...e, _ref: t }));
function xYt({
  title: e,
  description: t,
  children: n,
  onCancel: i,
  onSubmit: r,
  onConfirm: o,
  isSubmitting: s = !1,
  submitLabel: a,
  cancelLabel: l,
  submitIcon: c,
  isDestructive: d = !1,
  className: u,
  contentClassName: h,
  showFooter: g = !0,
  extraButtons: p,
}) {
  const { t: f } = Py(),
    m = (e) => {
      r ? r(e) : o && (e.preventDefault(), o());
    };
  return t8e()
    ? Q.jsxs(ttt, {
        drawerClassName: "max-h-[90vh]",
        children: [
          Q.jsxs(ntt, {
            className: "flex-shrink-0 border-b px-4 pb-3 pt-4",
            children: [
              Q.jsx(rtt, { className: "text-lg tracking-tight", children: e }),
              t && Q.jsx(ott, { className: "text-xs opacity-70", children: t }),
            ],
          }),
          Q.jsx("div", {
            className: Rf("min-h-0 flex-1 overflow-y-auto", h),
            children: Q.jsx("div", { className: "space-y-4 px-4 py-4 text-sm", children: n }),
          }),
          g &&
            Q.jsx(itt, {
              className: "flex-shrink-0 border-t px-4 py-4",
              children: Q.jsxs("div", {
                className: "flex flex-col gap-2",
                children: [
                  p &&
                    Q.jsx("div", {
                      className: "flex items-center justify-center gap-2",
                      children: p,
                    }),
                  Q.jsx(Nm, {
                    type: "button",
                    variant: "outline",
                    onClick: i,
                    className: "h-10 text-sm font-bold",
                    disabled: s,
                    children: l || f("common.cancel", "取消"),
                  }),
                  Q.jsx(Nm, {
                    type: r ? "submit" : "button",
                    onClick: m,
                    variant: d ? "destructive" : "default",
                    className: "h-10 text-sm font-bold",
                    loading: s,
                    leftSection: c,
                    children: a || f("common.submit", "确认"),
                  }),
                ],
              }),
            }),
        ],
      })
    : Q.jsxs(ttt, {
        className: Rf(
          "flex max-h-[90vh] max-w-xl flex-col gap-0 overflow-hidden border-border/50 p-0 shadow-none sm:rounded-xl",
          u,
        ),
        children: [
          Q.jsxs(ntt, {
            className: "flex-shrink-0 border-b px-6 pb-4 pt-6",
            children: [
              Q.jsx(rtt, { className: "text-lg tracking-tight", children: e }),
              t && Q.jsx(ott, { className: "text-xs opacity-70", children: t }),
            ],
          }),
          Q.jsx("div", {
            className: Rf("min-h-0 flex-1 overflow-y-auto", h),
            children: Q.jsx("div", { className: "space-y-4 px-6 py-4 text-sm", children: n }),
          }),
          g &&
            Q.jsx(itt, {
              className: "flex-shrink-0 border-t px-6 py-4",
              children: Q.jsxs("div", {
                className: "flex w-full items-center justify-between gap-3",
                children: [
                  Q.jsx("div", { className: "flex items-center gap-2", children: p }),
                  Q.jsxs("div", {
                    className: "flex items-center gap-3",
                    children: [
                      Q.jsx(Nm, {
                        type: "button",
                        variant: "ghost",
                        onClick: i,
                        className: "h-8 px-4 text-xs font-bold",
                        disabled: s,
                        children: l || f("common.cancel", "取消"),
                      }),
                      Q.jsx(Nm, {
                        type: r ? "submit" : "button",
                        onClick: m,
                        variant: d ? "destructive" : "default",
                        className: "h-8 px-8 text-xs font-bold",
                        loading: s,
                        leftSection: c,
                        children: a || f("common.submit", "确认"),
                      }),
                    ],
                  }),
                ],
              }),
            }),
        ],
      });
}
H.forwardRef((e, t) => bYt({ inline: !0, ...e, _ref: t }));
const wYt = {
  id: null,
  name: "",
  icon: "",
  notify_domain: "",
  handling_fee_fixed: 0,
  handling_fee_percent: 0,
  payment: "",
  config: {},
};
function CYt({ refetch: e, dialogTrigger: t, type: n = "add", defaultFormValues: i = wYt }) {
  const { t: r } = Py("payment"),
    [o, s] = H.useState(!1),
    [a, l] = H.useState(!1),
    [c, d] = H.useState([]),
    [u, h] = H.useState({}),
    g = ((e) =>
      gy({
        id: cy().nullable(),
        name: ly().min(2, e("form.validation.name.min")).max(30, e("form.validation.name.max")),
        icon: ly().optional().nullable(),
        notify_domain: ly()
          .refine((e) => !e || /^https?:\/\/\S+/.test(e), e("form.validation.notify_domain.url"))
          .optional()
          .nullable(),
        handling_fee_fixed: by().min(0).optional().nullable(),
        handling_fee_percent: by().min(0).max(100).optional().nullable(),
        payment: ly().min(1, e("form.validation.payment.required")),
        config: fy(ly(), ly()),
      }))(r),
    p = kv({ resolver: Ov(g), defaultValues: i, mode: "onChange" }),
    f = p.watch("payment");
  (H.useEffect(() => {
    if (o) {
      (async () => {
        const { data: e } = await cD();
        d(e);
      })();
    }
  }, [o]),
    H.useEffect(() => {
      if (!f || !o) return;
      (async () => {
        const e = { payment: f, ...("edit" === n && { id: Number(p.getValues("id")) }) };
        try {
          const { data: t } = await dD(e),
            n = Object.entries(t).reduce((e, [t, n]) => ((e[t] = n), e), {});
          h(n);
          const i = nZt(n);
          p.setValue("config", i);
        } catch (D2t) {
          h({});
        }
      })();
    }, [f, o, p, n]));
  const m = async (t) => {
    l(!0);
    try {
      (await uD(t)).data && (hN.success(r("form.messages.success")), p.reset(wYt), e(), s(!1));
    } finally {
      l(!1);
    }
  };
  return Q.jsxs(Jet, {
    open: o,
    onOpenChange: s,
    children: [
      Q.jsx(ett, {
        asChild: !0,
        children:
          t ||
          Q.jsxs(Nm, {
            variant: "outline",
            size: "sm",
            className: "space-x-2",
            children: [
              Q.jsx(yYt, { icon: "ion:add" }),
              " ",
              Q.jsx("div", { children: r("form.add.button") }),
            ],
          }),
      }),
      Q.jsx(xYt, {
        title: r("add" === n ? "form.add.title" : "form.edit.title"),
        onCancel: () => s(!1),
        onSubmit: p.handleSubmit(m),
        isSubmitting: a,
        children: Q.jsx(Hy, {
          ...p,
          children: Q.jsxs("form", {
            onSubmit: p.handleSubmit(m),
            className: "space-y-4",
            children: [
              Q.jsx(eZt, {
                control: p.control,
                name: "name",
                label: r("form.fields.name.label"),
                placeholder: r("form.fields.name.placeholder"),
                description: r("form.fields.name.description"),
                required: !0,
              }),
              Q.jsx(eZt, {
                control: p.control,
                name: "icon",
                label: r("form.fields.icon.label"),
                placeholder: r("form.fields.icon.placeholder"),
                description: r("form.fields.icon.description"),
              }),
              Q.jsx(eZt, {
                control: p.control,
                name: "notify_domain",
                label: r("form.fields.notify_domain.label"),
                placeholder: r("form.fields.notify_domain.placeholder"),
                description: r("form.fields.notify_domain.description"),
              }),
              Q.jsxs("div", {
                className: "grid grid-cols-2 gap-4",
                children: [
                  Q.jsx(eZt, {
                    control: p.control,
                    name: "handling_fee_percent",
                    label: r("form.fields.handling_fee_percent.label"),
                    placeholder: r("form.fields.handling_fee_percent.placeholder"),
                    type: "number",
                    unit: "%",
                  }),
                  Q.jsx(eZt, {
                    control: p.control,
                    name: "handling_fee_fixed",
                    label: r("form.fields.handling_fee_fixed.label"),
                    placeholder: r("form.fields.handling_fee_fixed.placeholder"),
                    type: "number",
                    unit: "元",
                    valueCustom: (e) => (e.value ? e.value / 100 : ""),
                    onChangeCustom: (e, t) => {
                      t.onChange(100 * parseFloat(e));
                    },
                  }),
                ],
              }),
              Q.jsx(eZt, {
                control: p.control,
                name: "payment",
                label: r("form.fields.payment.label"),
                description: r("form.fields.payment.description"),
                required: !0,
                extra: Q.jsxs(THt, {
                  onValueChange: p.setValue.bind(null, "payment"),
                  value: p.watch("payment"),
                  children: [
                    Q.jsx(OHt, {
                      className: "h-9 font-mono text-xs",
                      children: Q.jsx(RHt, { placeholder: r("form.fields.payment.placeholder") }),
                    }),
                    Q.jsx(PHt, {
                      children: c.map((e) => Q.jsx(FHt, { value: e, children: e }, e)),
                    }),
                  ],
                }),
              }),
              Object.keys(u).length > 0 &&
                Q.jsxs("div", {
                  className: "space-y-4 border-t pt-4",
                  children: [
                    Q.jsx("div", {
                      className:
                        "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                      children: r("form.sections.payment_config"),
                    }),
                    Q.jsx(tZt, {
                      form: p,
                      config: u,
                      namePrefix: "config",
                      className: "grid grid-cols-1 gap-4",
                    }),
                  ],
                }),
            ],
          }),
        }),
      }),
    ],
  });
}
function SYt({ column: e, title: t, tooltip: n, className: i }) {
  return e.getCanSort()
    ? Q.jsx("div", {
        className: "flex items-center gap-1",
        children: Q.jsx("div", {
          className: "flex items-center gap-2",
          children: Q.jsxs(Nm, {
            variant: "ghost",
            size: "default",
            className: Rf(
              "-ml-3 flex h-8 items-center gap-2 text-nowrap font-medium hover:bg-muted/60",
              i,
            ),
            onClick: () => e.toggleSorting("asc" === e.getIsSorted()),
            children: [
              Q.jsx("span", { children: t }),
              n &&
                Q.jsx(Pst, {
                  delayDuration: 100,
                  children: Q.jsxs(jst, {
                    children: [
                      Q.jsx(Fst, {
                        asChild: !0,
                        children: Q.jsx(fat, {
                          className: "h-4 w-4 cursor-pointer text-muted-foreground",
                        }),
                      }),
                      Q.jsx(Bst, { children: n }),
                    ],
                  }),
                }),
              "asc" === e.getIsSorted()
                ? Q.jsx(iat, { className: "h-4 w-4 text-foreground/70" })
                : "desc" === e.getIsSorted()
                  ? Q.jsx(eat, { className: "h-4 w-4 text-foreground/70" })
                  : Q.jsx(nat, {
                      className:
                        "h-4 w-4 text-muted-foreground/70 transition-colors hover:text-foreground/70",
                    }),
            ],
          }),
        }),
      })
    : Q.jsxs("div", {
        className: Rf(
          "flex items-center space-x-1 text-nowrap py-2 font-medium text-muted-foreground",
          i,
        ),
        children: [
          Q.jsx("span", { children: t }),
          n &&
            Q.jsx(Pst, {
              delayDuration: 100,
              children: Q.jsxs(jst, {
                children: [
                  Q.jsx(Fst, {
                    children: Q.jsx(fat, { className: "h-4 w-4 text-muted-foreground" }),
                  }),
                  Q.jsx(Bst, { children: n }),
                ],
              }),
            }),
        ],
      });
}
var kYt = Symbol("radix.slottable");
var EYt = "AlertDialog",
  [NYt] = Jy(EYt, [k9e]),
  LYt = k9e(),
  DYt = (e) => {
    const { __scopeAlertDialog: t, ...n } = e,
      i = LYt(t);
    return Q.jsx(n7e, { ...i, ...n, modal: !0 });
  };
DYt.displayName = EYt;
var TYt = H.forwardRef((e, t) => {
  const { __scopeAlertDialog: n, ...i } = e,
    r = LYt(n);
  return Q.jsx(i7e, { ...r, ...i, ref: t });
});
TYt.displayName = "AlertDialogTrigger";
var IYt = (e) => {
  const { __scopeAlertDialog: t, ...n } = e,
    i = LYt(t);
  return Q.jsx(r7e, { ...i, ...n });
};
IYt.displayName = "AlertDialogPortal";
var RYt = H.forwardRef((e, t) => {
  const { __scopeAlertDialog: n, ...i } = e,
    r = LYt(n);
  return Q.jsx(o7e, { ...r, ...i, ref: t });
});
RYt.displayName = "AlertDialogOverlay";
var OYt = "AlertDialogContent",
  [MYt, AYt] = NYt(OYt),
  PYt = (function (e) {
    const t = ({ children: e }) => Q.jsx(Q.Fragment, { children: e });
    return ((t.displayName = `${e}.Slottable`), (t.__radixId = kYt), t);
  })("AlertDialogContent"),
  jYt = H.forwardRef((e, t) => {
    const { __scopeAlertDialog: n, children: i, ...r } = e,
      o = LYt(n),
      s = H.useRef(null),
      a = Sp(t, s),
      l = H.useRef(null);
    return Q.jsx(Q9e, {
      contentName: OYt,
      titleName: FYt,
      docsSlug: "alert-dialog",
      children: Q.jsx(MYt, {
        scope: n,
        cancelRef: l,
        children: Q.jsxs(s7e, {
          role: "alertdialog",
          ...o,
          ...r,
          ref: a,
          onOpenAutoFocus: Qy(r.onOpenAutoFocus, (e) => {
            (e.preventDefault(), l.current?.focus({ preventScroll: !0 }));
          }),
          onPointerDownOutside: (e) => e.preventDefault(),
          onInteractOutside: (e) => e.preventDefault(),
          children: [Q.jsx(PYt, { children: i }), Q.jsx($Yt, { contentRef: s })],
        }),
      }),
    });
  });
jYt.displayName = OYt;
var FYt = "AlertDialogTitle",
  BYt = H.forwardRef((e, t) => {
    const { __scopeAlertDialog: n, ...i } = e,
      r = LYt(n);
    return Q.jsx(a7e, { ...r, ...i, ref: t });
  });
BYt.displayName = FYt;
var VYt = "AlertDialogDescription",
  WYt = H.forwardRef((e, t) => {
    const { __scopeAlertDialog: n, ...i } = e,
      r = LYt(n);
    return Q.jsx(l7e, { ...r, ...i, ref: t });
  });
WYt.displayName = VYt;
var HYt = H.forwardRef((e, t) => {
  const { __scopeAlertDialog: n, ...i } = e,
    r = LYt(n);
  return Q.jsx(c7e, { ...r, ...i, ref: t });
});
HYt.displayName = "AlertDialogAction";
var zYt = "AlertDialogCancel",
  UYt = H.forwardRef((e, t) => {
    const { __scopeAlertDialog: n, ...i } = e,
      { cancelRef: r } = AYt(zYt, n),
      o = LYt(n),
      s = Sp(t, r);
    return Q.jsx(c7e, { ...o, ...i, ref: s });
  });
UYt.displayName = zYt;
var $Yt = ({ contentRef: e }) => {
    const t = `\`${OYt}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${OYt}\` by passing a \`${VYt}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${OYt}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
    return (
      H.useEffect(() => {
        document.getElementById(e.current?.getAttribute("aria-describedby"));
      }, [t, e]),
      null
    );
  },
  qYt = RYt,
  KYt = jYt,
  GYt = HYt,
  ZYt = UYt,
  YYt = BYt,
  XYt = WYt;
const QYt = DYt,
  JYt = TYt,
  eXt = IYt,
  tXt = H.forwardRef(({ className: e, ...t }, n) =>
    Q.jsx(qYt, {
      className: Rf(
        "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
        e,
      ),
      ...t,
      ref: n,
    }),
  );
tXt.displayName = qYt.displayName;
const nXt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsxs(eXt, {
    children: [
      Q.jsx(tXt, {}),
      Q.jsx(KYt, {
        ref: n,
        className: Rf(
          "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
          e,
        ),
        ...t,
      }),
    ],
  }),
);
nXt.displayName = KYt.displayName;
const iXt = ({ className: e, ...t }) =>
  Q.jsx("div", { className: Rf("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
iXt.displayName = "AlertDialogHeader";
const rXt = ({ className: e, ...t }) =>
  Q.jsx("div", {
    className: Rf("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
    ...t,
  });
rXt.displayName = "AlertDialogFooter";
const oXt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(YYt, { ref: n, className: Rf("text-lg font-semibold", e), ...t }),
);
oXt.displayName = YYt.displayName;
const sXt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(XYt, { ref: n, className: Rf("text-sm text-muted-foreground", e), ...t }),
);
sXt.displayName = XYt.displayName;
const aXt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(GYt, { ref: n, className: Rf(att(), e), ...t }),
);
aXt.displayName = GYt.displayName;
const lXt = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(ZYt, { ref: n, className: Rf(att({ variant: "outline" }), "mt-2 sm:mt-0", e), ...t }),
);
lXt.displayName = ZYt.displayName;
const cXt = H.createContext(!1),
  dXt = () => H.useContext(cXt),
  uXt = ({ children: e, ...t }) => {
    const n = t8e();
    return Q.jsx(cXt.Provider, {
      value: n,
      children: n ? Q.jsx(Wet, { ...t, children: e }) : Q.jsx(QYt, { ...t, children: e }),
    });
  };
uXt.displayName = "ResponsiveAlertDialog";
const hXt = H.forwardRef((e, t) =>
  dXt() ? Q.jsx(Het, { ref: t, ...e }) : Q.jsx(JYt, { ref: t, ...e }),
);
hXt.displayName = "ResponsiveAlertDialogTrigger";
const gXt = H.forwardRef(({ className: e, drawerClassName: t, children: n, ...i }, r) =>
  dXt()
    ? Q.jsx(qet, { className: Rf("flex max-h-[90vh] flex-col", t), children: n })
    : Q.jsx(nXt, { ref: r, className: e, ...i, children: n }),
);
gXt.displayName = "ResponsiveAlertDialogContent";
const pXt = ({ className: e, ...t }) =>
  dXt() ? Q.jsx(Ket, { className: Rf("text-left", e), ...t }) : Q.jsx(iXt, { className: e, ...t });
pXt.displayName = "ResponsiveAlertDialogHeader";
const fXt = ({ className: e, ...t }) =>
  dXt() ? Q.jsx(Get, { className: e, ...t }) : Q.jsx(rXt, { className: e, ...t });
fXt.displayName = "ResponsiveAlertDialogFooter";
const mXt = H.forwardRef(({ className: e, ...t }, n) =>
  dXt() ? Q.jsx(Zet, { className: e, ...t }) : Q.jsx(oXt, { ref: n, className: e, ...t }),
);
mXt.displayName = "ResponsiveAlertDialogTitle";
const _Xt = H.forwardRef(({ className: e, ...t }, n) =>
  dXt() ? Q.jsx(Yet, { className: e, ...t }) : Q.jsx(sXt, { ref: n, className: e, ...t }),
);
_Xt.displayName = "ResponsiveAlertDialogDescription";
const vXt = H.forwardRef(({ className: e, onClick: t, ...n }, i) =>
  dXt()
    ? Q.jsx(Uet, {
        asChild: !0,
        children: Q.jsx("button", { ref: i, className: Rf(att(), "w-full", e), onClick: t, ...n }),
      })
    : Q.jsx(aXt, { ref: i, className: e, onClick: t, ...n }),
);
vXt.displayName = "ResponsiveAlertDialogAction";
const bXt = H.forwardRef(({ className: e, ...t }, n) =>
  dXt()
    ? Q.jsx(Uet, {
        asChild: !0,
        children: Q.jsx("button", {
          ref: n,
          className: Rf(att({ variant: "outline" }), "w-full", e),
          ...t,
        }),
      })
    : Q.jsx(lXt, { ref: n, className: e, ...t }),
);
function yXt({
  onConfirm: e,
  children: t,
  title: n = "确认操作",
  description: i = "确定要执行此操作吗？",
  cancelText: r = "取消",
  confirmText: o = "确认",
  variant: s = "default",
  className: a,
}) {
  return Q.jsxs(uXt, {
    children: [
      Q.jsx(hXt, { asChild: !0, children: t }),
      Q.jsxs(gXt, {
        className: Rf("sm:max-w-[425px]", a),
        children: [
          Q.jsxs(pXt, { children: [Q.jsx(mXt, { children: n }), Q.jsx(_Xt, { children: i })] }),
          Q.jsxs(fXt, {
            children: [
              Q.jsx(bXt, { asChild: !0, children: Q.jsx(Nm, { variant: "outline", children: r }) }),
              Q.jsx(vXt, {
                asChild: !0,
                children: Q.jsx(Nm, { variant: s, onClick: e, children: o }),
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
bXt.displayName = "ResponsiveAlertDialogCancel";
const xXt = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M11.29 15.29a2 2 0 0 0-.12.15a.8.8 0 0 0-.09.18a.6.6 0 0 0-.06.18a1.4 1.4 0 0 0 0 .2a.84.84 0 0 0 .08.38a.9.9 0 0 0 .54.54a.94.94 0 0 0 .76 0a.9.9 0 0 0 .54-.54A1 1 0 0 0 13 16a1 1 0 0 0-.29-.71a1 1 0 0 0-1.42 0M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8 8 0 0 1-8 8m0-13a3 3 0 0 0-2.6 1.5a1 1 0 1 0 1.73 1A1 1 0 0 1 12 9a1 1 0 0 1 0 2a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-.18A3 3 0 0 0 12 7",
      }),
    }),
  wXt = ({ refetch: e, isSortMode: t = !1, t: n }) => [
    {
      id: "drag-handle",
      header: () => null,
      cell: () =>
        Q.jsx("div", {
          className: t ? "cursor-move" : "opacity-0",
          children: Q.jsx(P7e, { className: "size-4" }),
        }),
      size: 40,
      enableSorting: !1,
    },
    {
      accessorKey: "id",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: n("table.columns.id") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex items-center space-x-2",
          children: Q.jsx(hqt, {
            variant: "outline",
            className: "font-mono",
            children: e.getValue("id"),
          }),
        }),
      enableSorting: !0,
      size: 60,
    },
    {
      accessorKey: "enable",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: n("table.columns.enable") }),
      cell: ({ row: t }) =>
        Q.jsx(mGt, {
          defaultChecked: t.getValue("enable"),
          onCheckedChange: async () => {
            const { data: n } = await gD({ id: t.original.id });
            n || e();
          },
        }),
      enableSorting: !1,
      size: 100,
    },
    {
      accessorKey: "name",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: n("table.columns.name") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex items-center",
          children: Q.jsx("span", {
            className: "max-w-[200px] truncate font-medium",
            children: e.getValue("name"),
          }),
        }),
      enableSorting: !1,
      size: 200,
    },
    {
      accessorKey: "payment",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: n("table.columns.payment") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex items-center",
          children: Q.jsx("span", {
            className: "max-w-[200px] truncate font-medium",
            children: e.getValue("payment"),
          }),
        }),
      enableSorting: !1,
      size: 200,
    },
    {
      accessorKey: "notify_url",
      header: ({ column: e }) =>
        Q.jsxs("div", {
          className: "flex items-center",
          children: [
            Q.jsx(SYt, { column: e, title: n("table.columns.notify_url") }),
            Q.jsx(Pst, {
              delayDuration: 100,
              children: Q.jsxs(jst, {
                children: [
                  Q.jsx(Fst, { className: "ml-1", children: Q.jsx(xXt, { className: "h-4 w-4" }) }),
                  Q.jsx(Bst, { children: n("table.columns.notify_url_tooltip") }),
                ],
              }),
            }),
          ],
        }),
      cell: ({ row: e }) =>
        Q.jsxs("div", {
          className: "group/url flex items-center gap-1",
          children: [
            Q.jsx("span", {
              className: "max-w-[260px] truncate font-medium",
              children: e.getValue("notify_url"),
            }),
            Q.jsx(Nm, {
              variant: "ghost",
              size: "icon",
              className:
                "size-6 shrink-0 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:text-muted-foreground group-hover/url:opacity-100",
              onClick: (t) => {
                (t.stopPropagation(),
                  TS(e.getValue("notify_url")).then(() => {
                    hN.success(n("common:copy.success"));
                  }));
              },
              children: Q.jsx(_at, { className: "size-3" }),
            }),
          ],
        }),
      enableSorting: !1,
      size: 3e3,
    },
    {
      id: "actions",
      header: ({ column: e }) =>
        Q.jsx(SYt, { className: "justify-end", column: e, title: n("table.columns.actions") }),
      cell: ({ row: t }) =>
        Q.jsxs("div", {
          className: "flex items-center justify-end space-x-2",
          children: [
            Q.jsx(CYt, {
              refetch: e,
              dialogTrigger: Q.jsxs(Nm, {
                variant: "ghost",
                size: "icon",
                className: "h-8 w-8 hover:bg-muted",
                children: [
                  Q.jsx(H7e, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
                  Q.jsx("span", { className: "sr-only", children: n("table.actions.edit") }),
                ],
              }),
              type: "edit",
              defaultFormValues: t.original,
            }),
            Q.jsx(yXt, {
              title: n("table.actions.delete.title"),
              description: n("table.actions.delete.description"),
              onConfirm: async () => {
                const { data: n } = await hD({ id: t.original.id });
                n && e();
              },
              children: Q.jsxs(Nm, {
                variant: "ghost",
                size: "icon",
                className: "h-8 w-8 hover:bg-destructive/10",
                children: [
                  Q.jsx(ilt, { className: "h-4 w-4 text-muted-foreground hover:text-destructive" }),
                  Q.jsx("span", {
                    className: "sr-only",
                    children: n("table.actions.delete.title"),
                  }),
                ],
              }),
            }),
          ],
        }),
      size: 100,
    },
  ];
function CXt({ table: e, refetch: t, saveOrder: n, isSortMode: i }) {
  const { t: r } = Py("payment"),
    o = e.getState().columnFilters.length > 0;
  return Q.jsxs("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: [
      i
        ? Q.jsx("p", {
            className: "text-sm text-muted-foreground",
            children: r("table.toolbar.sort.hint"),
          })
        : Q.jsxs("div", {
            className: "flex flex-wrap items-center gap-2 sm:flex-nowrap",
            children: [
              Q.jsx(CYt, { refetch: t }),
              Q.jsx(Q6e, {
                placeholder: r("table.toolbar.search"),
                value: e.getColumn("name")?.getFilterValue() ?? "",
                onChange: (t) => e.getColumn("name")?.setFilterValue(t.target.value),
                className: "h-8 w-full sm:w-[150px] lg:w-[250px]",
              }),
              o &&
                Q.jsxs(Nm, {
                  variant: "ghost",
                  onClick: () => e.resetColumnFilters(),
                  children: [r("table.toolbar.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
                }),
            ],
          }),
      e.getRowCount() > 0 &&
        Q.jsx("div", {
          className: "hidden items-center gap-2 md:flex",
          children: Q.jsx(Nm, {
            variant: i ? "default" : "outline",
            onClick: n,
            size: "sm",
            children: r(i ? "table.toolbar.sort.save" : "table.toolbar.sort.edit"),
          }),
        }),
    ],
  });
}
function SXt() {
  const { t: e } = Py("payment"),
    [t, n] = H.useState([]),
    [i, r] = H.useState([]),
    [o, s] = H.useState(!1),
    [a, l] = H.useState([]),
    [c, d] = H.useState({ "drag-handle": !1 }),
    [u, h] = H.useState({ pageSize: 20, pageIndex: 0 }),
    {
      refetch: g,
      data: p,
      isLoading: f,
    } = gC({
      queryKey: ["paymentList"],
      queryFn: async () => {
        const { data: e } = await lD();
        return e;
      },
    });
  (H.useEffect(() => {
    p && l(p.map((e) => ({ ...e, enable: Boolean(e.enable) })));
  }, [p]),
    H.useEffect(() => {
      (d({ "drag-handle": o, actions: !o }), h({ pageSize: o ? 99999 : 10, pageIndex: 0 }));
    }, [o]));
  const m = async () => {
      o
        ? pD({ ids: a.map((e) => e.id) }).then(() => {
            (g(), s(!1), hN.success("排序保存成功"));
          })
        : s(!0);
    },
    _ = PKt({
      data: a,
      columns: wXt({ refetch: g, isSortMode: o, t: e }),
      state: { sorting: i, columnFilters: t, columnVisibility: c, pagination: u },
      onSortingChange: r,
      onColumnFiltersChange: n,
      onColumnVisibilityChange: d,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      initialState: { columnPinning: { right: ["actions"] } },
      pageCount: o ? 1 : void 0,
    });
  return Q.jsx(QKt, {
    table: _,
    toolbar: (e) => Q.jsx(CXt, { table: e, refetch: g, saveOrder: m, isSortMode: o }),
    draggable: o,
    onDragStart: (e, t) => {
      o &&
        (e.dataTransfer.setData("text/plain", t.toString()),
        e.currentTarget.classList.add("opacity-50"));
    },
    onDragEnd: (e) => e.currentTarget.classList.remove("opacity-50"),
    onDragOver: (e) => {
      (e.preventDefault(), e.currentTarget.classList.add("bg-muted"));
    },
    onDragLeave: (e) => e.currentTarget.classList.remove("bg-muted"),
    onDrop: (e, t) => {
      if (!o) return;
      (e.preventDefault(), e.currentTarget.classList.remove("bg-muted"));
      const n = parseInt(e.dataTransfer.getData("text/plain"));
      if (n === t) return;
      const i = [...a],
        [r] = i.splice(n, 1);
      (i.splice(t, 0, r), l(i));
    },
    showPagination: !o,
    isLoading: f,
    mobilePrimaryField: "name",
    mobileGridFields: ["payment", "enable"],
  });
}
const kXt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("payment");
          return Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                className: "flex items-center justify-between",
                children: [
                  Q.jsx(Vdt, {}),
                  Q.jsxs("div", {
                    className: "flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                children: [
                  Q.jsx("header", {
                    className: "mb-2 flex items-center justify-between space-y-2",
                    children: Q.jsxs("div", {
                      children: [
                        Q.jsx("div", {
                          className: "mb-2",
                          children: Q.jsx("h2", {
                            className: "text-2xl font-bold tracking-tight",
                            children: e("title"),
                          }),
                        }),
                        Q.jsx("p", {
                          className: "text-muted-foreground",
                          children: e("description"),
                        }),
                      ],
                    }),
                  }),
                  Q.jsx("section", {
                    className:
                      "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                    children: Q.jsx(SXt, {}),
                  }),
                ],
              }),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  EXt = gy({ config: fy(uy()) });
function NXt({ pluginName: e, onClose: t, onSuccess: n }) {
  const { t: i } = Py("plugin"),
    [r, o] = H.useState(!0),
    [s, a] = H.useState(!1),
    [l, c] = H.useState(null),
    d = kv({ resolver: Ov(EXt), defaultValues: { config: {} } });
  H.useEffect(() => {
    (async () => {
      try {
        const { data: t } = await CT.getPluginConfig(e);
        c(t);
        const n = nZt(t);
        d.reset({ config: n });
      } catch (D2t) {
        hN.error(i("messages.configLoadError", "配置加载失败"));
      } finally {
        o(!1);
      }
    })();
  }, [e, d, i]);
  return r
    ? Q.jsxs("div", {
        className: "space-y-6 px-1",
        children: [
          Q.jsxs("div", {
            className: "space-y-2",
            children: [
              Q.jsx(n$t, { className: "h-3 w-24" }),
              Q.jsx(n$t, { className: "h-9 w-full shadow-sm" }),
            ],
          }),
          Q.jsxs("div", {
            className: "space-y-2",
            children: [
              Q.jsx(n$t, { className: "h-3 w-32" }),
              Q.jsx(n$t, { className: "h-24 w-full shadow-sm" }),
            ],
          }),
          Q.jsxs("div", {
            className: "space-y-2",
            children: [
              Q.jsx(n$t, { className: "h-3 w-20" }),
              Q.jsx(n$t, { className: "h-9 w-full shadow-sm" }),
            ],
          }),
        ],
      })
    : Q.jsx(Hy, {
        ...d,
        children: Q.jsxs("form", {
          onSubmit: d.handleSubmit(async (t) => {
            a(!0);
            try {
              (await CT.updatePluginConfig(e, t.config),
                hN.success(i("messages.configSaveSuccess", "配置保存成功")),
                n());
            } catch (D2t) {
              hN.error(i("messages.configSaveError", "配置保存失败"));
            } finally {
              a(!1);
            }
          }),
          className: "flex flex-col h-full overflow-hidden",
          children: [
            Q.jsx(rqt, {
              className: "flex-1 max-h-[60vh]",
              children: Q.jsx("div", {
                className: "space-y-6 py-1 px-1",
                children: l && Q.jsx(tZt, { form: d, config: l, namePrefix: "config" }),
              }),
            }),
            Q.jsxs("div", {
              className: "flex items-center justify-end gap-3 pt-6 mt-6 border-t border-border/40",
              children: [
                Q.jsx(ltt, {
                  type: "button",
                  variant: "ghost",
                  size: "sm",
                  className: "h-8 px-4 font-mono text-[11px] uppercase tracking-tight",
                  onClick: t,
                  disabled: s,
                  children: i("config.cancel", "取消"),
                }),
                Q.jsx(ltt, {
                  type: "submit",
                  size: "sm",
                  className: "h-8 px-8 font-mono text-[11px] uppercase tracking-tight font-bold",
                  disabled: s,
                  children: s
                    ? Q.jsxs("span", {
                        className: "flex items-center gap-2",
                        children: [
                          Q.jsx("span", {
                            className:
                              "h-3 w-3 animate-spin rounded-full border-2 border-current border-t-transparent",
                          }),
                          i("config.saving", "保存中..."),
                        ],
                      })
                    : i("config.save", "保存配置"),
                }),
              ],
            }),
          ],
        }),
      });
}
function LXt() {
  return {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null,
  };
}
let DXt = {
  async: !1,
  breaks: !1,
  extensions: null,
  gfm: !0,
  hooks: null,
  pedantic: !1,
  renderer: null,
  silent: !1,
  tokenizer: null,
  walkTokens: null,
};
function TXt(e) {
  DXt = e;
}
const IXt = /[&<>"']/,
  RXt = new RegExp(IXt.source, "g"),
  OXt = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
  MXt = new RegExp(OXt.source, "g"),
  AXt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" },
  PXt = (e) => AXt[e];
function jXt(e, t) {
  if (t) {
    if (IXt.test(e)) return e.replace(RXt, PXt);
  } else if (OXt.test(e)) return e.replace(MXt, PXt);
  return e;
}
const FXt = /(^|[^\[])\^/g;
function BXt(e, t) {
  let n = "string" == typeof e ? e : e.source;
  t = t || "";
  const i = {
    replace: (e, t) => {
      let r = "string" == typeof t ? t : t.source;
      return ((r = r.replace(FXt, "$1")), (n = n.replace(e, r)), i);
    },
    getRegex: () => new RegExp(n, t),
  };
  return i;
}
function VXt(e) {
  try {
    e = encodeURI(e).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return e;
}
const WXt = { exec: () => null };
function HXt(e, t) {
  const n = e.replace(/\|/g, (e, t, n) => {
      let i = !1,
        r = t;
      for (; --r >= 0 && "\\" === n[r]; ) i = !i;
      return i ? "|" : " |";
    }),
    i = n.split(/ \|/);
  let r = 0;
  if ((i[0].trim() || i.shift(), i.length > 0 && !i[i.length - 1].trim() && i.pop(), t))
    if (i.length > t) i.splice(t);
    else for (; i.length < t; ) i.push("");
  for (; r < i.length; r++) i[r] = i[r].trim().replace(/\\\|/g, "|");
  return i;
}
function zXt(e, t, n) {
  const i = e.length;
  if (0 === i) return "";
  let r = 0;
  for (; r < i; ) {
    if (e.charAt(i - r - 1) !== t) break;
    r++;
  }
  return e.slice(0, i - r);
}
function UXt(e, t, n, i) {
  const r = t.href,
    o = t.title ? jXt(t.title) : null,
    s = e[1].replace(/\\([\[\]])/g, "$1");
  if ("!" !== e[0].charAt(0)) {
    i.state.inLink = !0;
    const e = { type: "link", raw: n, href: r, title: o, text: s, tokens: i.inlineTokens(s) };
    return ((i.state.inLink = !1), e);
  }
  return { type: "image", raw: n, href: r, title: o, text: jXt(s) };
}
class $Xt {
  options;
  rules;
  lexer;
  constructor(e) {
    this.options = e || DXt;
  }
  space(e) {
    const t = this.rules.block.newline.exec(e);
    if (t && t[0].length > 0) return { type: "space", raw: t[0] };
  }
  code(e) {
    const t = this.rules.block.code.exec(e);
    if (t) {
      const e = t[0].replace(/^ {1,4}/gm, "");
      return {
        type: "code",
        raw: t[0],
        codeBlockStyle: "indented",
        text: this.options.pedantic ? e : zXt(e, "\n"),
      };
    }
  }
  fences(e) {
    const t = this.rules.block.fences.exec(e);
    if (t) {
      const e = t[0],
        n = (function (e, t) {
          const n = e.match(/^(\s+)(?:```)/);
          if (null === n) return t;
          const i = n[1];
          return t
            .split("\n")
            .map((e) => {
              const t = e.match(/^\s+/);
              if (null === t) return e;
              const [n] = t;
              return n.length >= i.length ? e.slice(i.length) : e;
            })
            .join("\n");
        })(e, t[3] || "");
      return {
        type: "code",
        raw: e,
        lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
        text: n,
      };
    }
  }
  heading(e) {
    const t = this.rules.block.heading.exec(e);
    if (t) {
      let e = t[2].trim();
      if (/#$/.test(e)) {
        const t = zXt(e, "#");
        this.options.pedantic ? (e = t.trim()) : (t && !/ $/.test(t)) || (e = t.trim());
      }
      return {
        type: "heading",
        raw: t[0],
        depth: t[1].length,
        text: e,
        tokens: this.lexer.inline(e),
      };
    }
  }
  hr(e) {
    const t = this.rules.block.hr.exec(e);
    if (t) return { type: "hr", raw: zXt(t[0], "\n") };
  }
  blockquote(e) {
    const t = this.rules.block.blockquote.exec(e);
    if (t) {
      let e = zXt(t[0], "\n").split("\n"),
        n = "",
        i = "";
      const r = [];
      for (; e.length > 0; ) {
        let t = !1;
        const o = [];
        let s;
        for (s = 0; s < e.length; s++)
          if (/^ {0,3}>/.test(e[s])) (o.push(e[s]), (t = !0));
          else {
            if (t) break;
            o.push(e[s]);
          }
        e = e.slice(s);
        const a = o.join("\n"),
          l = a
            .replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, "\n    $1")
            .replace(/^ {0,3}>[ \t]?/gm, "");
        ((n = n ? `${n}\n${a}` : a), (i = i ? `${i}\n${l}` : l));
        const c = this.lexer.state.top;
        if (
          ((this.lexer.state.top = !0),
          this.lexer.blockTokens(l, r, !0),
          (this.lexer.state.top = c),
          0 === e.length)
        )
          break;
        const d = r[r.length - 1];
        if ("code" === d?.type) break;
        if ("blockquote" === d?.type) {
          const t = d,
            o = t.raw + "\n" + e.join("\n"),
            s = this.blockquote(o);
          ((r[r.length - 1] = s),
            (n = n.substring(0, n.length - t.raw.length) + s.raw),
            (i = i.substring(0, i.length - t.text.length) + s.text));
          break;
        }
        if ("list" === d?.type) {
          const t = d,
            o = t.raw + "\n" + e.join("\n"),
            s = this.list(o);
          ((r[r.length - 1] = s),
            (n = n.substring(0, n.length - d.raw.length) + s.raw),
            (i = i.substring(0, i.length - t.raw.length) + s.raw),
            (e = o.substring(r[r.length - 1].raw.length).split("\n")));
          continue;
        }
      }
      return { type: "blockquote", raw: n, tokens: r, text: i };
    }
  }
  list(e) {
    let t = this.rules.block.list.exec(e);
    if (t) {
      let n = t[1].trim();
      const i = n.length > 1,
        r = {
          type: "list",
          raw: "",
          ordered: i,
          start: i ? +n.slice(0, -1) : "",
          loose: !1,
          items: [],
        };
      ((n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`),
        this.options.pedantic && (n = i ? n : "[*+-]"));
      const o = new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);
      let s = !1;
      for (; e; ) {
        let n = !1,
          i = "",
          a = "";
        if (!(t = o.exec(e))) break;
        if (this.rules.block.hr.test(e)) break;
        ((i = t[0]), (e = e.substring(i.length)));
        let l = t[2].split("\n", 1)[0].replace(/^\t+/, (e) => " ".repeat(3 * e.length)),
          c = e.split("\n", 1)[0],
          d = !l.trim(),
          u = 0;
        if (
          (this.options.pedantic
            ? ((u = 2), (a = l.trimStart()))
            : d
              ? (u = t[1].length + 1)
              : ((u = t[2].search(/[^ ]/)),
                (u = u > 4 ? 1 : u),
                (a = l.slice(u)),
                (u += t[1].length)),
          d && /^ *$/.test(c) && ((i += c + "\n"), (e = e.substring(c.length + 1)), (n = !0)),
          !n)
        ) {
          const t = new RegExp(
              `^ {0,${Math.min(3, u - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`,
            ),
            n = new RegExp(
              `^ {0,${Math.min(3, u - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`,
            ),
            r = new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:\`\`\`|~~~)`),
            o = new RegExp(`^ {0,${Math.min(3, u - 1)}}#`);
          for (; e; ) {
            const s = e.split("\n", 1)[0];
            if (
              ((c = s),
              this.options.pedantic && (c = c.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")),
              r.test(c))
            )
              break;
            if (o.test(c)) break;
            if (t.test(c)) break;
            if (n.test(e)) break;
            if (c.search(/[^ ]/) >= u || !c.trim()) a += "\n" + c.slice(u);
            else {
              if (d) break;
              if (l.search(/[^ ]/) >= 4) break;
              if (r.test(l)) break;
              if (o.test(l)) break;
              if (n.test(l)) break;
              a += "\n" + c;
            }
            (d || c.trim() || (d = !0),
              (i += s + "\n"),
              (e = e.substring(s.length + 1)),
              (l = c.slice(u)));
          }
        }
        r.loose || (s ? (r.loose = !0) : /\n *\n *$/.test(i) && (s = !0));
        let h,
          g = null;
        (this.options.gfm &&
          ((g = /^\[[ xX]\] /.exec(a)),
          g && ((h = "[ ] " !== g[0]), (a = a.replace(/^\[[ xX]\] +/, "")))),
          r.items.push({
            type: "list_item",
            raw: i,
            task: !!g,
            checked: h,
            loose: !1,
            text: a,
            tokens: [],
          }),
          (r.raw += i));
      }
      ((r.items[r.items.length - 1].raw = r.items[r.items.length - 1].raw.trimEnd()),
        (r.items[r.items.length - 1].text = r.items[r.items.length - 1].text.trimEnd()),
        (r.raw = r.raw.trimEnd()));
      for (let e = 0; e < r.items.length; e++)
        if (
          ((this.lexer.state.top = !1),
          (r.items[e].tokens = this.lexer.blockTokens(r.items[e].text, [])),
          !r.loose)
        ) {
          const t = r.items[e].tokens.filter((e) => "space" === e.type),
            n = t.length > 0 && t.some((e) => /\n.*\n/.test(e.raw));
          r.loose = n;
        }
      if (r.loose) for (let e = 0; e < r.items.length; e++) r.items[e].loose = !0;
      return r;
    }
  }
  html(e) {
    const t = this.rules.block.html.exec(e);
    if (t) {
      return {
        type: "html",
        block: !0,
        raw: t[0],
        pre: "pre" === t[1] || "script" === t[1] || "style" === t[1],
        text: t[0],
      };
    }
  }
  def(e) {
    const t = this.rules.block.def.exec(e);
    if (t) {
      const e = t[1].toLowerCase().replace(/\s+/g, " "),
        n = t[2]
          ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1")
          : "",
        i = t[3]
          ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1")
          : t[3];
      return { type: "def", tag: e, raw: t[0], href: n, title: i };
    }
  }
  table(e) {
    const t = this.rules.block.table.exec(e);
    if (!t) return;
    if (!/[:|]/.test(t[2])) return;
    const n = HXt(t[1]),
      i = t[2].replace(/^\||\| *$/g, "").split("|"),
      r = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split("\n") : [],
      o = { type: "table", raw: t[0], header: [], align: [], rows: [] };
    if (n.length === i.length) {
      for (const e of i)
        /^ *-+: *$/.test(e)
          ? o.align.push("right")
          : /^ *:-+: *$/.test(e)
            ? o.align.push("center")
            : /^ *:-+ *$/.test(e)
              ? o.align.push("left")
              : o.align.push(null);
      for (let e = 0; e < n.length; e++)
        o.header.push({
          text: n[e],
          tokens: this.lexer.inline(n[e]),
          header: !0,
          align: o.align[e],
        });
      for (const e of r)
        o.rows.push(
          HXt(e, o.header.length).map((e, t) => ({
            text: e,
            tokens: this.lexer.inline(e),
            header: !1,
            align: o.align[t],
          })),
        );
      return o;
    }
  }
  lheading(e) {
    const t = this.rules.block.lheading.exec(e);
    if (t)
      return {
        type: "heading",
        raw: t[0],
        depth: "=" === t[2].charAt(0) ? 1 : 2,
        text: t[1],
        tokens: this.lexer.inline(t[1]),
      };
  }
  paragraph(e) {
    const t = this.rules.block.paragraph.exec(e);
    if (t) {
      const e = "\n" === t[1].charAt(t[1].length - 1) ? t[1].slice(0, -1) : t[1];
      return { type: "paragraph", raw: t[0], text: e, tokens: this.lexer.inline(e) };
    }
  }
  text(e) {
    const t = this.rules.block.text.exec(e);
    if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
  }
  escape(e) {
    const t = this.rules.inline.escape.exec(e);
    if (t) return { type: "escape", raw: t[0], text: jXt(t[1]) };
  }
  tag(e) {
    const t = this.rules.inline.tag.exec(e);
    if (t)
      return (
        !this.lexer.state.inLink && /^<a /i.test(t[0])
          ? (this.lexer.state.inLink = !0)
          : this.lexer.state.inLink && /^<\/a>/i.test(t[0]) && (this.lexer.state.inLink = !1),
        !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0])
          ? (this.lexer.state.inRawBlock = !0)
          : this.lexer.state.inRawBlock &&
            /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) &&
            (this.lexer.state.inRawBlock = !1),
        {
          type: "html",
          raw: t[0],
          inLink: this.lexer.state.inLink,
          inRawBlock: this.lexer.state.inRawBlock,
          block: !1,
          text: t[0],
        }
      );
  }
  link(e) {
    const t = this.rules.inline.link.exec(e);
    if (t) {
      const e = t[2].trim();
      if (!this.options.pedantic && /^</.test(e)) {
        if (!/>$/.test(e)) return;
        const t = zXt(e.slice(0, -1), "\\");
        if ((e.length - t.length) % 2 == 0) return;
      } else {
        const e = (function (e, t) {
          if (-1 === e.indexOf(t[1])) return -1;
          let n = 0;
          for (let i = 0; i < e.length; i++)
            if ("\\" === e[i]) i++;
            else if (e[i] === t[0]) n++;
            else if (e[i] === t[1] && (n--, n < 0)) return i;
          return -1;
        })(t[2], "()");
        if (e > -1) {
          const n = (0 === t[0].indexOf("!") ? 5 : 4) + t[1].length + e;
          ((t[2] = t[2].substring(0, e)), (t[0] = t[0].substring(0, n).trim()), (t[3] = ""));
        }
      }
      let n = t[2],
        i = "";
      if (this.options.pedantic) {
        const e = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);
        e && ((n = e[1]), (i = e[3]));
      } else i = t[3] ? t[3].slice(1, -1) : "";
      return (
        (n = n.trim()),
        /^</.test(n) && (n = this.options.pedantic && !/>$/.test(e) ? n.slice(1) : n.slice(1, -1)),
        UXt(
          t,
          {
            href: n ? n.replace(this.rules.inline.anyPunctuation, "$1") : n,
            title: i ? i.replace(this.rules.inline.anyPunctuation, "$1") : i,
          },
          t[0],
          this.lexer,
        )
      );
    }
  }
  reflink(e, t) {
    let n;
    if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
      const e = t[(n[2] || n[1]).replace(/\s+/g, " ").toLowerCase()];
      if (!e) {
        const e = n[0].charAt(0);
        return { type: "text", raw: e, text: e };
      }
      return UXt(n, e, n[0], this.lexer);
    }
  }
  emStrong(e, t, n = "") {
    let i = this.rules.inline.emStrongLDelim.exec(e);
    if (!i) return;
    if (i[3] && n.match(/[\p{L}\p{N}]/u)) return;
    if (!(i[1] || i[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
      const n = [...i[0]].length - 1;
      let r,
        o,
        s = n,
        a = 0;
      const l =
        "*" === i[0][0] ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (l.lastIndex = 0, t = t.slice(-1 * e.length + n); null != (i = l.exec(t)); ) {
        if (((r = i[1] || i[2] || i[3] || i[4] || i[5] || i[6]), !r)) continue;
        if (((o = [...r].length), i[3] || i[4])) {
          s += o;
          continue;
        }
        if ((i[5] || i[6]) && n % 3 && !((n + o) % 3)) {
          a += o;
          continue;
        }
        if (((s -= o), s > 0)) continue;
        o = Math.min(o, o + s + a);
        const t = [...i[0]][0].length,
          l = e.slice(0, n + i.index + t + o);
        if (Math.min(n, o) % 2) {
          const e = l.slice(1, -1);
          return { type: "em", raw: l, text: e, tokens: this.lexer.inlineTokens(e) };
        }
        const c = l.slice(2, -2);
        return { type: "strong", raw: l, text: c, tokens: this.lexer.inlineTokens(c) };
      }
    }
  }
  codespan(e) {
    const t = this.rules.inline.code.exec(e);
    if (t) {
      let e = t[2].replace(/\n/g, " ");
      const n = /[^ ]/.test(e),
        i = /^ /.test(e) && / $/.test(e);
      return (
        n && i && (e = e.substring(1, e.length - 1)),
        (e = jXt(e, !0)),
        { type: "codespan", raw: t[0], text: e }
      );
    }
  }
  br(e) {
    const t = this.rules.inline.br.exec(e);
    if (t) return { type: "br", raw: t[0] };
  }
  del(e) {
    const t = this.rules.inline.del.exec(e);
    if (t) return { type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2]) };
  }
  autolink(e) {
    const t = this.rules.inline.autolink.exec(e);
    if (t) {
      let e, n;
      return (
        "@" === t[2] ? ((e = jXt(t[1])), (n = "mailto:" + e)) : ((e = jXt(t[1])), (n = e)),
        { type: "link", raw: t[0], text: e, href: n, tokens: [{ type: "text", raw: e, text: e }] }
      );
    }
  }
  url(e) {
    let t;
    if ((t = this.rules.inline.url.exec(e))) {
      let e, n;
      if ("@" === t[2]) ((e = jXt(t[0])), (n = "mailto:" + e));
      else {
        let i;
        do {
          ((i = t[0]), (t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? ""));
        } while (i !== t[0]);
        ((e = jXt(t[0])), (n = "www." === t[1] ? "http://" + t[0] : t[0]));
      }
      return {
        type: "link",
        raw: t[0],
        text: e,
        href: n,
        tokens: [{ type: "text", raw: e, text: e }],
      };
    }
  }
  inlineText(e) {
    const t = this.rules.inline.text.exec(e);
    if (t) {
      let e;
      return (
        (e = this.lexer.state.inRawBlock ? t[0] : jXt(t[0])),
        { type: "text", raw: t[0], text: e }
      );
    }
  }
}
const qXt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
  KXt = /(?:[*+-]|\d{1,9}[.)])/,
  GXt = BXt(
    /^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
  )
    .replace(/bull/g, KXt)
    .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(),
  ZXt = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
  YXt = /(?!\s*\])(?:\\.|[^\[\]\\])+/,
  XXt = BXt(
    /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
  )
    .replace("label", YXt)
    .replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/)
    .getRegex(),
  QXt = BXt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/)
    .replace(/bull/g, KXt)
    .getRegex(),
  JXt =
    "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",
  eQt = /<!--(?:-?>|[\s\S]*?(?:-->|$))/,
  tQt = BXt(
    "^ {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", eQt)
    .replace("tag", JXt)
    .replace(
      "attribute",
      / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/,
    )
    .getRegex(),
  nQt = BXt(ZXt)
    .replace("hr", qXt)
    .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", JXt)
    .getRegex(),
  iQt = {
    blockquote: BXt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/)
      .replace("paragraph", nQt)
      .getRegex(),
    code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
    def: XXt,
    fences:
      /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
    heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
    hr: qXt,
    html: tQt,
    lheading: GXt,
    list: QXt,
    newline: /^(?: *(?:\n|$))+/,
    paragraph: nQt,
    table: WXt,
    text: /^[^\n]+/,
  },
  rQt = BXt(
    "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",
  )
    .replace("hr", qXt)
    .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", JXt)
    .getRegex(),
  oQt = {
    ...iQt,
    table: rQt,
    paragraph: BXt(ZXt)
      .replace("hr", qXt)
      .replace("heading", " {0,3}#{1,6}(?:\\s|$)")
      .replace("|lheading", "")
      .replace("table", rQt)
      .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", JXt)
      .getRegex(),
  },
  sQt = {
    ...iQt,
    html: BXt(
      "^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))",
    )
      .replace("comment", eQt)
      .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: WXt,
    lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
    paragraph: BXt(ZXt)
      .replace("hr", qXt)
      .replace("heading", " *#{1,6} *[^\n]")
      .replace("lheading", GXt)
      .replace("|table", "")
      .replace("blockquote", " {0,3}>")
      .replace("|fences", "")
      .replace("|list", "")
      .replace("|html", "")
      .replace("|tag", "")
      .getRegex(),
  },
  aQt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
  lQt = /^( {2,}|\\)\n(?!\s*$)/,
  cQt = "\\p{P}\\p{S}",
  dQt = BXt(/^((?![*_])[\spunctuation])/, "u")
    .replace(/punctuation/g, cQt)
    .getRegex(),
  uQt = BXt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u")
    .replace(/punct/g, cQt)
    .getRegex(),
  hQt = BXt(
    "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])",
    "gu",
  )
    .replace(/punct/g, cQt)
    .getRegex(),
  gQt = BXt(
    "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])",
    "gu",
  )
    .replace(/punct/g, cQt)
    .getRegex(),
  pQt = BXt(/\\([punct])/, "gu")
    .replace(/punct/g, cQt)
    .getRegex(),
  fQt = BXt(/^<(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(),
  mQt = BXt(eQt).replace("(?:--\x3e|$)", "--\x3e").getRegex(),
  _Qt = BXt(
    "^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", mQt)
    .replace(
      "attribute",
      /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,
    )
    .getRegex(),
  vQt = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,
  bQt = BXt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/)
    .replace("label", vQt)
    .replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/)
    .replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/)
    .getRegex(),
  yQt = BXt(/^!?\[(label)\]\[(ref)\]/)
    .replace("label", vQt)
    .replace("ref", YXt)
    .getRegex(),
  xQt = BXt(/^!?\[(ref)\](?:\[\])?/)
    .replace("ref", YXt)
    .getRegex(),
  wQt = {
    _backpedal: WXt,
    anyPunctuation: pQt,
    autolink: fQt,
    blockSkip: /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,
    br: lQt,
    code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
    del: WXt,
    emStrongLDelim: uQt,
    emStrongRDelimAst: hQt,
    emStrongRDelimUnd: gQt,
    escape: aQt,
    link: bQt,
    nolink: xQt,
    punctuation: dQt,
    reflink: yQt,
    reflinkSearch: BXt("reflink|nolink(?!\\()", "g")
      .replace("reflink", yQt)
      .replace("nolink", xQt)
      .getRegex(),
    tag: _Qt,
    text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
    url: WXt,
  },
  CQt = {
    ...wQt,
    link: BXt(/^!?\[(label)\]\((.*?)\)/)
      .replace("label", vQt)
      .getRegex(),
    reflink: BXt(/^!?\[(label)\]\s*\[([^\]]*)\]/)
      .replace("label", vQt)
      .getRegex(),
  },
  SQt = {
    ...wQt,
    escape: BXt(aQt).replace("])", "~|])").getRegex(),
    url: BXt(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/,
  },
  kQt = {
    ...SQt,
    br: BXt(lQt).replace("{2,}", "*").getRegex(),
    text: BXt(SQt.text)
      .replace("\\b_", "\\b_| {2,}\\n")
      .replace(/\{2,\}/g, "*")
      .getRegex(),
  },
  EQt = { normal: iQt, gfm: oQt, pedantic: sQt },
  NQt = { normal: wQt, gfm: SQt, breaks: kQt, pedantic: CQt };
class LQt {
  tokens;
  options;
  state;
  tokenizer;
  inlineQueue;
  constructor(e) {
    ((this.tokens = []),
      (this.tokens.links = Object.create(null)),
      (this.options = e || DXt),
      (this.options.tokenizer = this.options.tokenizer || new $Xt()),
      (this.tokenizer = this.options.tokenizer),
      (this.tokenizer.options = this.options),
      (this.tokenizer.lexer = this),
      (this.inlineQueue = []),
      (this.state = { inLink: !1, inRawBlock: !1, top: !0 }));
    const t = { block: EQt.normal, inline: NQt.normal };
    (this.options.pedantic
      ? ((t.block = EQt.pedantic), (t.inline = NQt.pedantic))
      : this.options.gfm &&
        ((t.block = EQt.gfm), this.options.breaks ? (t.inline = NQt.breaks) : (t.inline = NQt.gfm)),
      (this.tokenizer.rules = t));
  }
  static get rules() {
    return { block: EQt, inline: NQt };
  }
  static lex(e, t) {
    return new LQt(t).lex(e);
  }
  static lexInline(e, t) {
    return new LQt(t).inlineTokens(e);
  }
  lex(e) {
    ((e = e.replace(/\r\n|\r/g, "\n")), this.blockTokens(e, this.tokens));
    for (let t = 0; t < this.inlineQueue.length; t++) {
      const e = this.inlineQueue[t];
      this.inlineTokens(e.src, e.tokens);
    }
    return ((this.inlineQueue = []), this.tokens);
  }
  blockTokens(e, t = [], n = !1) {
    let i, r, o;
    for (
      e = this.options.pedantic
        ? e.replace(/\t/g, "    ").replace(/^ +$/gm, "")
        : e.replace(/^( *)(\t+)/gm, (e, t, n) => t + "    ".repeat(n.length));
      e;
    )
      if (
        !(
          this.options.extensions &&
          this.options.extensions.block &&
          this.options.extensions.block.some(
            (n) =>
              !!(i = n.call({ lexer: this }, e, t)) &&
              ((e = e.substring(i.raw.length)), t.push(i), !0),
          )
        )
      )
        if ((i = this.tokenizer.space(e)))
          ((e = e.substring(i.raw.length)),
            1 === i.raw.length && t.length > 0 ? (t[t.length - 1].raw += "\n") : t.push(i));
        else if ((i = this.tokenizer.code(e)))
          ((e = e.substring(i.raw.length)),
            (r = t[t.length - 1]),
            !r || ("paragraph" !== r.type && "text" !== r.type)
              ? t.push(i)
              : ((r.raw += "\n" + i.raw),
                (r.text += "\n" + i.text),
                (this.inlineQueue[this.inlineQueue.length - 1].src = r.text)));
        else if ((i = this.tokenizer.fences(e))) ((e = e.substring(i.raw.length)), t.push(i));
        else if ((i = this.tokenizer.heading(e))) ((e = e.substring(i.raw.length)), t.push(i));
        else if ((i = this.tokenizer.hr(e))) ((e = e.substring(i.raw.length)), t.push(i));
        else if ((i = this.tokenizer.blockquote(e))) ((e = e.substring(i.raw.length)), t.push(i));
        else if ((i = this.tokenizer.list(e))) ((e = e.substring(i.raw.length)), t.push(i));
        else if ((i = this.tokenizer.html(e))) ((e = e.substring(i.raw.length)), t.push(i));
        else if ((i = this.tokenizer.def(e)))
          ((e = e.substring(i.raw.length)),
            (r = t[t.length - 1]),
            !r || ("paragraph" !== r.type && "text" !== r.type)
              ? this.tokens.links[i.tag] ||
                (this.tokens.links[i.tag] = { href: i.href, title: i.title })
              : ((r.raw += "\n" + i.raw),
                (r.text += "\n" + i.raw),
                (this.inlineQueue[this.inlineQueue.length - 1].src = r.text)));
        else if ((i = this.tokenizer.table(e))) ((e = e.substring(i.raw.length)), t.push(i));
        else if ((i = this.tokenizer.lheading(e))) ((e = e.substring(i.raw.length)), t.push(i));
        else {
          if (((o = e), this.options.extensions && this.options.extensions.startBlock)) {
            let t = 1 / 0;
            const n = e.slice(1);
            let i;
            (this.options.extensions.startBlock.forEach((e) => {
              ((i = e.call({ lexer: this }, n)),
                "number" == typeof i && i >= 0 && (t = Math.min(t, i)));
            }),
              t < 1 / 0 && t >= 0 && (o = e.substring(0, t + 1)));
          }
          if (this.state.top && (i = this.tokenizer.paragraph(o)))
            ((r = t[t.length - 1]),
              n && "paragraph" === r?.type
                ? ((r.raw += "\n" + i.raw),
                  (r.text += "\n" + i.text),
                  this.inlineQueue.pop(),
                  (this.inlineQueue[this.inlineQueue.length - 1].src = r.text))
                : t.push(i),
              (n = o.length !== e.length),
              (e = e.substring(i.raw.length)));
          else if ((i = this.tokenizer.text(e)))
            ((e = e.substring(i.raw.length)),
              (r = t[t.length - 1]),
              r && "text" === r.type
                ? ((r.raw += "\n" + i.raw),
                  (r.text += "\n" + i.text),
                  this.inlineQueue.pop(),
                  (this.inlineQueue[this.inlineQueue.length - 1].src = r.text))
                : t.push(i));
          else if (e) {
            const t = "Infinite loop on byte: " + e.charCodeAt(0);
            if (this.options.silent) break;
            throw new Error(t);
          }
        }
    return ((this.state.top = !0), t);
  }
  inline(e, t = []) {
    return (this.inlineQueue.push({ src: e, tokens: t }), t);
  }
  inlineTokens(e, t = []) {
    let n,
      i,
      r,
      o,
      s,
      a,
      l = e;
    if (this.tokens.links) {
      const e = Object.keys(this.tokens.links);
      if (e.length > 0)
        for (; null != (o = this.tokenizer.rules.inline.reflinkSearch.exec(l)); )
          e.includes(o[0].slice(o[0].lastIndexOf("[") + 1, -1)) &&
            (l =
              l.slice(0, o.index) +
              "[" +
              "a".repeat(o[0].length - 2) +
              "]" +
              l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; null != (o = this.tokenizer.rules.inline.blockSkip.exec(l)); )
      l =
        l.slice(0, o.index) +
        "[" +
        "a".repeat(o[0].length - 2) +
        "]" +
        l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; null != (o = this.tokenizer.rules.inline.anyPunctuation.exec(l)); )
      l =
        l.slice(0, o.index) + "++" + l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; e; )
      if (
        (s || (a = ""),
        (s = !1),
        !(
          this.options.extensions &&
          this.options.extensions.inline &&
          this.options.extensions.inline.some(
            (i) =>
              !!(n = i.call({ lexer: this }, e, t)) &&
              ((e = e.substring(n.raw.length)), t.push(n), !0),
          )
        ))
      )
        if ((n = this.tokenizer.escape(e))) ((e = e.substring(n.raw.length)), t.push(n));
        else if ((n = this.tokenizer.tag(e)))
          ((e = e.substring(n.raw.length)),
            (i = t[t.length - 1]),
            i && "text" === n.type && "text" === i.type
              ? ((i.raw += n.raw), (i.text += n.text))
              : t.push(n));
        else if ((n = this.tokenizer.link(e))) ((e = e.substring(n.raw.length)), t.push(n));
        else if ((n = this.tokenizer.reflink(e, this.tokens.links)))
          ((e = e.substring(n.raw.length)),
            (i = t[t.length - 1]),
            i && "text" === n.type && "text" === i.type
              ? ((i.raw += n.raw), (i.text += n.text))
              : t.push(n));
        else if ((n = this.tokenizer.emStrong(e, l, a)))
          ((e = e.substring(n.raw.length)), t.push(n));
        else if ((n = this.tokenizer.codespan(e))) ((e = e.substring(n.raw.length)), t.push(n));
        else if ((n = this.tokenizer.br(e))) ((e = e.substring(n.raw.length)), t.push(n));
        else if ((n = this.tokenizer.del(e))) ((e = e.substring(n.raw.length)), t.push(n));
        else if ((n = this.tokenizer.autolink(e))) ((e = e.substring(n.raw.length)), t.push(n));
        else if (this.state.inLink || !(n = this.tokenizer.url(e))) {
          if (((r = e), this.options.extensions && this.options.extensions.startInline)) {
            let t = 1 / 0;
            const n = e.slice(1);
            let i;
            (this.options.extensions.startInline.forEach((e) => {
              ((i = e.call({ lexer: this }, n)),
                "number" == typeof i && i >= 0 && (t = Math.min(t, i)));
            }),
              t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)));
          }
          if ((n = this.tokenizer.inlineText(r)))
            ((e = e.substring(n.raw.length)),
              "_" !== n.raw.slice(-1) && (a = n.raw.slice(-1)),
              (s = !0),
              (i = t[t.length - 1]),
              i && "text" === i.type ? ((i.raw += n.raw), (i.text += n.text)) : t.push(n));
          else if (e) {
            const t = "Infinite loop on byte: " + e.charCodeAt(0);
            if (this.options.silent) break;
            throw new Error(t);
          }
        } else ((e = e.substring(n.raw.length)), t.push(n));
    return t;
  }
}
class DQt {
  options;
  parser;
  constructor(e) {
    this.options = e || DXt;
  }
  space(e) {
    return "";
  }
  code({ text: e, lang: t, escaped: n }) {
    const i = (t || "").match(/^\S*/)?.[0],
      r = e.replace(/\n$/, "") + "\n";
    return i
      ? '<pre><code class="language-' + jXt(i) + '">' + (n ? r : jXt(r, !0)) + "</code></pre>\n"
      : "<pre><code>" + (n ? r : jXt(r, !0)) + "</code></pre>\n";
  }
  blockquote({ tokens: e }) {
    return `<blockquote>\n${this.parser.parse(e)}</blockquote>\n`;
  }
  html({ text: e }) {
    return e;
  }
  heading({ tokens: e, depth: t }) {
    return `<h${t}>${this.parser.parseInline(e)}</h${t}>\n`;
  }
  hr(e) {
    return "<hr>\n";
  }
  list(e) {
    const t = e.ordered,
      n = e.start;
    let i = "";
    for (let o = 0; o < e.items.length; o++) {
      const t = e.items[o];
      i += this.listitem(t);
    }
    const r = t ? "ol" : "ul";
    return "<" + r + (t && 1 !== n ? ' start="' + n + '"' : "") + ">\n" + i + "</" + r + ">\n";
  }
  listitem(e) {
    let t = "";
    if (e.task) {
      const n = this.checkbox({ checked: !!e.checked });
      e.loose
        ? e.tokens.length > 0 && "paragraph" === e.tokens[0].type
          ? ((e.tokens[0].text = n + " " + e.tokens[0].text),
            e.tokens[0].tokens &&
              e.tokens[0].tokens.length > 0 &&
              "text" === e.tokens[0].tokens[0].type &&
              (e.tokens[0].tokens[0].text = n + " " + e.tokens[0].tokens[0].text))
          : e.tokens.unshift({ type: "text", raw: n + " ", text: n + " " })
        : (t += n + " ");
    }
    return ((t += this.parser.parse(e.tokens, !!e.loose)), `<li>${t}</li>\n`);
  }
  checkbox({ checked: e }) {
    return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
  }
  paragraph({ tokens: e }) {
    return `<p>${this.parser.parseInline(e)}</p>\n`;
  }
  table(e) {
    let t = "",
      n = "";
    for (let r = 0; r < e.header.length; r++) n += this.tablecell(e.header[r]);
    t += this.tablerow({ text: n });
    let i = "";
    for (let r = 0; r < e.rows.length; r++) {
      const t = e.rows[r];
      n = "";
      for (let e = 0; e < t.length; e++) n += this.tablecell(t[e]);
      i += this.tablerow({ text: n });
    }
    return (
      i && (i = `<tbody>${i}</tbody>`),
      "<table>\n<thead>\n" + t + "</thead>\n" + i + "</table>\n"
    );
  }
  tablerow({ text: e }) {
    return `<tr>\n${e}</tr>\n`;
  }
  tablecell(e) {
    const t = this.parser.parseInline(e.tokens),
      n = e.header ? "th" : "td";
    return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>\n`;
  }
  strong({ tokens: e }) {
    return `<strong>${this.parser.parseInline(e)}</strong>`;
  }
  em({ tokens: e }) {
    return `<em>${this.parser.parseInline(e)}</em>`;
  }
  codespan({ text: e }) {
    return `<code>${e}</code>`;
  }
  br(e) {
    return "<br>";
  }
  del({ tokens: e }) {
    return `<del>${this.parser.parseInline(e)}</del>`;
  }
  link({ href: e, title: t, tokens: n }) {
    const i = this.parser.parseInline(n),
      r = VXt(e);
    if (null === r) return i;
    let o = '<a href="' + (e = r) + '"';
    return (t && (o += ' title="' + t + '"'), (o += ">" + i + "</a>"), o);
  }
  image({ href: e, title: t, text: n }) {
    const i = VXt(e);
    if (null === i) return n;
    let r = `<img src="${(e = i)}" alt="${n}"`;
    return (t && (r += ` title="${t}"`), (r += ">"), r);
  }
  text(e) {
    return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : e.text;
  }
}
class TQt {
  strong({ text: e }) {
    return e;
  }
  em({ text: e }) {
    return e;
  }
  codespan({ text: e }) {
    return e;
  }
  del({ text: e }) {
    return e;
  }
  html({ text: e }) {
    return e;
  }
  text({ text: e }) {
    return e;
  }
  link({ text: e }) {
    return "" + e;
  }
  image({ text: e }) {
    return "" + e;
  }
  br() {
    return "";
  }
}
class IQt {
  options;
  renderer;
  textRenderer;
  constructor(e) {
    ((this.options = e || DXt),
      (this.options.renderer = this.options.renderer || new DQt()),
      (this.renderer = this.options.renderer),
      (this.renderer.options = this.options),
      (this.renderer.parser = this),
      (this.textRenderer = new TQt()));
  }
  static parse(e, t) {
    return new IQt(t).parse(e);
  }
  static parseInline(e, t) {
    return new IQt(t).parseInline(e);
  }
  parse(e, t = !0) {
    let n = "";
    for (let i = 0; i < e.length; i++) {
      const r = e[i];
      if (
        this.options.extensions &&
        this.options.extensions.renderers &&
        this.options.extensions.renderers[r.type]
      ) {
        const e = r,
          t = this.options.extensions.renderers[e.type].call({ parser: this }, e);
        if (
          !1 !== t ||
          ![
            "space",
            "hr",
            "heading",
            "code",
            "table",
            "blockquote",
            "list",
            "html",
            "paragraph",
            "text",
          ].includes(e.type)
        ) {
          n += t || "";
          continue;
        }
      }
      const o = r;
      switch (o.type) {
        case "space":
          n += this.renderer.space(o);
          continue;
        case "hr":
          n += this.renderer.hr(o);
          continue;
        case "heading":
          n += this.renderer.heading(o);
          continue;
        case "code":
          n += this.renderer.code(o);
          continue;
        case "table":
          n += this.renderer.table(o);
          continue;
        case "blockquote":
          n += this.renderer.blockquote(o);
          continue;
        case "list":
          n += this.renderer.list(o);
          continue;
        case "html":
          n += this.renderer.html(o);
          continue;
        case "paragraph":
          n += this.renderer.paragraph(o);
          continue;
        case "text": {
          let r = o,
            s = this.renderer.text(r);
          for (; i + 1 < e.length && "text" === e[i + 1].type; )
            ((r = e[++i]), (s += "\n" + this.renderer.text(r)));
          n += t
            ? this.renderer.paragraph({
                type: "paragraph",
                raw: s,
                text: s,
                tokens: [{ type: "text", raw: s, text: s }],
              })
            : s;
          continue;
        }
        default: {
          const e = 'Token with "' + o.type + '" type was not found.';
          if (this.options.silent) return "";
          throw new Error(e);
        }
      }
    }
    return n;
  }
  parseInline(e, t) {
    t = t || this.renderer;
    let n = "";
    for (let i = 0; i < e.length; i++) {
      const r = e[i];
      if (
        this.options.extensions &&
        this.options.extensions.renderers &&
        this.options.extensions.renderers[r.type]
      ) {
        const e = this.options.extensions.renderers[r.type].call({ parser: this }, r);
        if (
          !1 !== e ||
          ![
            "escape",
            "html",
            "link",
            "image",
            "strong",
            "em",
            "codespan",
            "br",
            "del",
            "text",
          ].includes(r.type)
        ) {
          n += e || "";
          continue;
        }
      }
      const o = r;
      switch (o.type) {
        case "escape":
        case "text":
          n += t.text(o);
          break;
        case "html":
          n += t.html(o);
          break;
        case "link":
          n += t.link(o);
          break;
        case "image":
          n += t.image(o);
          break;
        case "strong":
          n += t.strong(o);
          break;
        case "em":
          n += t.em(o);
          break;
        case "codespan":
          n += t.codespan(o);
          break;
        case "br":
          n += t.br(o);
          break;
        case "del":
          n += t.del(o);
          break;
        default: {
          const e = 'Token with "' + o.type + '" type was not found.';
          if (this.options.silent) return "";
          throw new Error(e);
        }
      }
    }
    return n;
  }
}
class RQt {
  options;
  constructor(e) {
    this.options = e || DXt;
  }
  static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens"]);
  preprocess(e) {
    return e;
  }
  postprocess(e) {
    return e;
  }
  processAllTokens(e) {
    return e;
  }
}
const OQt = new (class {
  defaults = {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null,
  };
  options = this.setOptions;
  parse = this.parseMarkdown(LQt.lex, IQt.parse);
  parseInline = this.parseMarkdown(LQt.lexInline, IQt.parseInline);
  Parser = IQt;
  Renderer = DQt;
  TextRenderer = TQt;
  Lexer = LQt;
  Tokenizer = $Xt;
  Hooks = RQt;
  constructor(...e) {
    this.use(...e);
  }
  walkTokens(e, t) {
    let n = [];
    for (const i of e)
      switch (((n = n.concat(t.call(this, i))), i.type)) {
        case "table": {
          const e = i;
          for (const i of e.header) n = n.concat(this.walkTokens(i.tokens, t));
          for (const i of e.rows) for (const e of i) n = n.concat(this.walkTokens(e.tokens, t));
          break;
        }
        case "list": {
          const e = i;
          n = n.concat(this.walkTokens(e.items, t));
          break;
        }
        default: {
          const e = i;
          this.defaults.extensions?.childTokens?.[e.type]
            ? this.defaults.extensions.childTokens[e.type].forEach((i) => {
                const r = e[i].flat(1 / 0);
                n = n.concat(this.walkTokens(r, t));
              })
            : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
        }
      }
    return n;
  }
  use(...e) {
    const t = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return (
      e.forEach((e) => {
        const n = { ...e };
        if (
          ((n.async = this.defaults.async || n.async || !1),
          e.extensions &&
            (e.extensions.forEach((e) => {
              if (!e.name) throw new Error("extension name required");
              if ("renderer" in e) {
                const n = t.renderers[e.name];
                t.renderers[e.name] = n
                  ? function (...t) {
                      let i = e.renderer.apply(this, t);
                      return (!1 === i && (i = n.apply(this, t)), i);
                    }
                  : e.renderer;
              }
              if ("tokenizer" in e) {
                if (!e.level || ("block" !== e.level && "inline" !== e.level))
                  throw new Error("extension level must be 'block' or 'inline'");
                const n = t[e.level];
                (n ? n.unshift(e.tokenizer) : (t[e.level] = [e.tokenizer]),
                  e.start &&
                    ("block" === e.level
                      ? t.startBlock
                        ? t.startBlock.push(e.start)
                        : (t.startBlock = [e.start])
                      : "inline" === e.level &&
                        (t.startInline
                          ? t.startInline.push(e.start)
                          : (t.startInline = [e.start]))));
              }
              "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
            }),
            (n.extensions = t)),
          e.renderer)
        ) {
          const t = this.defaults.renderer || new DQt(this.defaults);
          for (const n in e.renderer) {
            if (!(n in t)) throw new Error(`renderer '${n}' does not exist`);
            if (["options", "parser"].includes(n)) continue;
            const i = n,
              r = e.renderer[i],
              o = t[i];
            t[i] = (...e) => {
              let n = r.apply(t, e);
              return (!1 === n && (n = o.apply(t, e)), n || "");
            };
          }
          n.renderer = t;
        }
        if (e.tokenizer) {
          const t = this.defaults.tokenizer || new $Xt(this.defaults);
          for (const n in e.tokenizer) {
            if (!(n in t)) throw new Error(`tokenizer '${n}' does not exist`);
            if (["options", "rules", "lexer"].includes(n)) continue;
            const i = n,
              r = e.tokenizer[i],
              o = t[i];
            t[i] = (...e) => {
              let n = r.apply(t, e);
              return (!1 === n && (n = o.apply(t, e)), n);
            };
          }
          n.tokenizer = t;
        }
        if (e.hooks) {
          const t = this.defaults.hooks || new RQt();
          for (const n in e.hooks) {
            if (!(n in t)) throw new Error(`hook '${n}' does not exist`);
            if ("options" === n) continue;
            const i = n,
              r = e.hooks[i],
              o = t[i];
            RQt.passThroughHooks.has(n)
              ? (t[i] = (e) => {
                  if (this.defaults.async)
                    return Promise.resolve(r.call(t, e)).then((e) => o.call(t, e));
                  const n = r.call(t, e);
                  return o.call(t, n);
                })
              : (t[i] = (...e) => {
                  let n = r.apply(t, e);
                  return (!1 === n && (n = o.apply(t, e)), n);
                });
          }
          n.hooks = t;
        }
        if (e.walkTokens) {
          const t = this.defaults.walkTokens,
            i = e.walkTokens;
          n.walkTokens = function (e) {
            let n = [];
            return (n.push(i.call(this, e)), t && (n = n.concat(t.call(this, e))), n);
          };
        }
        this.defaults = { ...this.defaults, ...n };
      }),
      this
    );
  }
  setOptions(e) {
    return ((this.defaults = { ...this.defaults, ...e }), this);
  }
  lexer(e, t) {
    return LQt.lex(e, t ?? this.defaults);
  }
  parser(e, t) {
    return IQt.parse(e, t ?? this.defaults);
  }
  parseMarkdown(e, t) {
    return (n, i) => {
      const r = { ...i },
        o = { ...this.defaults, ...r },
        s = this.onError(!!o.silent, !!o.async);
      if (!0 === this.defaults.async && !1 === r.async)
        return s(
          new 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 (null == n) return s(new Error("marked(): input parameter is undefined or null"));
      if ("string" != typeof n)
        return s(
          new Error(
            "marked(): input parameter is of type " +
              Object.prototype.toString.call(n) +
              ", string expected",
          ),
        );
      if ((o.hooks && (o.hooks.options = o), o.async))
        return Promise.resolve(o.hooks ? o.hooks.preprocess(n) : n)
          .then((t) => e(t, o))
          .then((e) => (o.hooks ? o.hooks.processAllTokens(e) : e))
          .then((e) =>
            o.walkTokens ? Promise.all(this.walkTokens(e, o.walkTokens)).then(() => e) : e,
          )
          .then((e) => t(e, o))
          .then((e) => (o.hooks ? o.hooks.postprocess(e) : e))
          .catch(s);
      try {
        o.hooks && (n = o.hooks.preprocess(n));
        let i = e(n, o);
        (o.hooks && (i = o.hooks.processAllTokens(i)),
          o.walkTokens && this.walkTokens(i, o.walkTokens));
        let r = t(i, o);
        return (o.hooks && (r = o.hooks.postprocess(r)), r);
      } catch (spt) {
        return s(spt);
      }
    };
  }
  onError(e, t) {
    return (n) => {
      if (((n.message += "\nPlease report this to https://github.com/markedjs/marked."), e)) {
        const e = "<p>An error occurred:</p><pre>" + jXt(n.message + "", !0) + "</pre>";
        return t ? Promise.resolve(e) : e;
      }
      if (t) return Promise.reject(n);
      throw n;
    };
  }
})();
function MQt(e, t) {
  return OQt.parse(e, t);
}
function AQt({
  plugin: e,
  onInstall: t,
  onUpgrade: n,
  onUninstall: i,
  onToggleEnable: r,
  onOpenConfig: o,
  onDelete: s,
  isLoading: a,
  onShowReadme: l,
  typeInfo: c,
}) {
  const { t: d } = Py("plugin");
  return Q.jsx(q6e, {
    className: "group relative overflow-hidden transition-all hover:shadow-md",
    children: Q.jsxs("div", {
      className: "p-4",
      children: [
        Q.jsxs("div", {
          className: "mb-2 flex items-center justify-between",
          children: [
            Q.jsxs("div", {
              className: "flex min-w-0 flex-1 items-center gap-2",
              children: [
                Q.jsx("h3", { className: "truncate text-base font-semibold", children: e.name }),
                c &&
                  Q.jsx(hqt, {
                    variant: "outline",
                    className: "border-primary/20 bg-primary/5 px-1.5 py-0.5 text-xs text-primary",
                    children: c.label,
                  }),
                e.is_installed
                  ? Q.jsx(hqt, {
                      variant: e.is_enabled ? "default" : "outline",
                      className: "px-1.5 py-0.5 text-xs",
                      children: e.is_enabled ? d("status.enabled") : d("status.disabled"),
                    })
                  : Q.jsx(hqt, {
                      variant: "outline",
                      className:
                        "border-muted-foreground/30 bg-muted/30 px-1.5 py-0.5 text-xs text-muted-foreground",
                      children: d("status.not_installed"),
                    }),
              ],
            }),
            Q.jsxs("div", {
              className: "flex flex-shrink-0 items-center gap-1.5",
              children: [
                e.is_protected &&
                  Q.jsx(Pst, {
                    children: Q.jsxs(jst, {
                      children: [
                        Q.jsx(Fst, {
                          asChild: !0,
                          children: Q.jsx("div", {
                            className:
                              "flex h-5 w-5 items-center justify-center rounded-full bg-amber-100 text-amber-600 dark:bg-amber-900/50 dark:text-amber-400",
                            children: Q.jsx(Jat, { className: "h-3 w-3" }),
                          }),
                        }),
                        Q.jsx(Bst, { children: Q.jsx("p", { children: d("status.protected") }) }),
                      ],
                    }),
                  }),
                e.readme &&
                  Q.jsx("button", {
                    type: "button",
                    onClick: l,
                    className:
                      "flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-primary",
                    title: d("button.readme"),
                    children: Q.jsx(Nat, { className: "h-3 w-3" }),
                  }),
              ],
            }),
          ],
        }),
        Q.jsxs("div", {
          className: "mb-2 flex items-center gap-3 text-xs text-muted-foreground",
          children: [
            Q.jsxs("div", {
              className: "flex items-center gap-1",
              children: [
                Q.jsx(Fat, { className: "h-3 w-3" }),
                Q.jsx("code", {
                  className: "rounded bg-muted px-1 py-0.5 text-xs",
                  children: e.code,
                }),
              ],
            }),
            Q.jsxs("span", { children: ["v", e.version] }),
            Q.jsxs("span", { children: [d("author"), ": ", e.author] }),
          ],
        }),
        Q.jsx("p", {
          className: "mb-3 overflow-hidden text-ellipsis text-sm text-muted-foreground",
          style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical" },
          children: e.description,
        }),
        Q.jsx("div", {
          className: "flex items-center justify-end gap-2",
          children: e.is_installed
            ? Q.jsxs(Q.Fragment, {
                children: [
                  e.need_upgrade &&
                    Q.jsx(yXt, {
                      title: d("upgrade.title"),
                      description: d("upgrade.description"),
                      cancelText: d("common:cancel"),
                      confirmText: d("upgrade.button"),
                      variant: "default",
                      onConfirm: async () => n(e.code),
                      children: Q.jsxs(Nm, {
                        variant: "destructive",
                        size: "sm",
                        disabled: a,
                        className: "h-7 bg-red-600 px-2 text-xs text-white hover:bg-red-700",
                        children: [Q.jsx(gat, { className: "mr-1 h-3 w-3" }), d("button.upgrade")],
                      }),
                    }),
                  e.config &&
                    Object.keys(e.config).length > 0 &&
                    Q.jsxs(Nm, {
                      variant: "outline",
                      size: "sm",
                      onClick: () => o(e.code),
                      disabled: !e.is_enabled || a,
                      className: "h-7 px-2 text-xs",
                      children: [Q.jsx(Yat, { className: "mr-1 h-3 w-3" }), d("button.config")],
                    }),
                  Q.jsxs(Nm, {
                    variant: e.is_enabled ? "destructive" : "default",
                    size: "sm",
                    onClick: () => r(e.code, e.is_enabled),
                    disabled: a,
                    className: "h-7 px-2 text-xs",
                    children: [
                      Q.jsx(Hat, { className: "mr-1 h-3 w-3" }),
                      e.is_enabled ? d("button.disable") : d("button.enable"),
                    ],
                  }),
                  Q.jsx(yXt, {
                    title: d("uninstall.title"),
                    description: d("uninstall.description"),
                    cancelText: d("common:cancel"),
                    confirmText: d("uninstall.button"),
                    variant: "destructive",
                    onConfirm: async () => i(e.code),
                    children: Q.jsxs(Nm, {
                      variant: "outline",
                      size: "sm",
                      className: "h-7 px-2 text-xs text-muted-foreground hover:text-destructive",
                      disabled: a || e.is_enabled,
                      children: [Q.jsx(ilt, { className: "mr-1 h-3 w-3" }), d("button.uninstall")],
                    }),
                  }),
                ],
              })
            : Q.jsxs(Q.Fragment, {
                children: [
                  Q.jsxs(Nm, {
                    onClick: () => t(e.code),
                    disabled: a,
                    size: "sm",
                    className: "h-7 px-3 text-xs",
                    children: [
                      a
                        ? Q.jsx("div", {
                            className:
                              "mr-1 h-3 w-3 animate-spin rounded-full border border-current border-t-transparent",
                          })
                        : null,
                      d("button.install"),
                    ],
                  }),
                  !1 !== e.can_be_deleted &&
                    Q.jsx(yXt, {
                      title: d("delete.title"),
                      description: d("delete.description"),
                      cancelText: d("common:cancel"),
                      confirmText: d("delete.button"),
                      variant: "destructive",
                      onConfirm: async () => s(e.code),
                      children: Q.jsx(Nm, {
                        variant: "ghost",
                        size: "sm",
                        className: "h-7 w-7 p-0 text-muted-foreground hover:text-destructive",
                        disabled: a,
                        children: Q.jsx(ilt, { className: "h-3 w-3" }),
                      }),
                    }),
                ],
              }),
        }),
      ],
    }),
  });
}
function PQt() {
  return Q.jsxs(q6e, {
    children: [
      Q.jsxs(K6e, {
        children: [
          Q.jsx("div", {
            className: "flex items-center justify-between",
            children: Q.jsxs("div", {
              className: "space-y-2",
              children: [
                Q.jsxs("div", {
                  className: "flex items-center gap-2",
                  children: [
                    Q.jsx(n$t, { className: "h-6 w-[200px]" }),
                    Q.jsx(n$t, { className: "h-6 w-[80px]" }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex items-center gap-4",
                  children: [
                    Q.jsx(n$t, { className: "h-5 w-[120px]" }),
                    Q.jsx(n$t, { className: "h-5 w-[60px]" }),
                  ],
                }),
              ],
            }),
          }),
          Q.jsxs("div", {
            className: "space-y-2 pt-2",
            children: [
              Q.jsx(n$t, { className: "h-4 w-[300px]" }),
              Q.jsx(n$t, { className: "h-4 w-[150px]" }),
            ],
          }),
        ],
      }),
      Q.jsx(Y6e, {
        children: Q.jsxs("div", {
          className: "flex justify-end space-x-2",
          children: [
            Q.jsx(n$t, { className: "h-9 w-[100px]" }),
            Q.jsx(n$t, { className: "h-9 w-[100px]" }),
            Q.jsx(n$t, { className: "h-8 w-8" }),
          ],
        }),
      }),
    ],
  });
}
((MQt.options = MQt.setOptions =
  function (e) {
    return (OQt.setOptions(e), (MQt.defaults = OQt.defaults), TXt(MQt.defaults), MQt);
  }),
  (MQt.getDefaults = LXt),
  (MQt.defaults = DXt),
  (MQt.use = function (...e) {
    return (OQt.use(...e), (MQt.defaults = OQt.defaults), TXt(MQt.defaults), MQt);
  }),
  (MQt.walkTokens = function (e, t) {
    return OQt.walkTokens(e, t);
  }),
  (MQt.parseInline = OQt.parseInline),
  (MQt.Parser = IQt),
  (MQt.parser = IQt.parse),
  (MQt.Renderer = DQt),
  (MQt.TextRenderer = TQt),
  (MQt.Lexer = LQt),
  (MQt.lexer = LQt.lex),
  (MQt.Tokenizer = $Xt),
  (MQt.Hooks = RQt),
  (MQt.parse = MQt),
  MQt.options,
  MQt.setOptions,
  MQt.use,
  MQt.walkTokens,
  MQt.parseInline,
  IQt.parse,
  LQt.lex);
const jQt = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("plugin"),
            [t, n] = H.useState(null),
            [i, r] = H.useState(!1),
            [o, s] = H.useState(null),
            [a, l] = H.useState(""),
            [c, d] = H.useState("feature"),
            [u, h] = H.useState("all"),
            [g, p] = H.useState(!1),
            [f, m] = H.useState(!1),
            [_, v] = H.useState(!1),
            b = H.useRef(null),
            [y, x] = H.useState(!1),
            [w, C] = H.useState(""),
            { data: S, isLoading: k } = gC({
              queryKey: ["pluginTypes"],
              queryFn: async () => {
                const { data: e } = await CT.getPluginTypes();
                return e;
              },
            }),
            {
              data: E,
              isLoading: N,
              refetch: L,
            } = gC({
              queryKey: ["pluginList"],
              queryFn: async () => {
                const { data: e } = await CT.getPluginList();
                return e;
              },
            }),
            D = E?.filter(
              (e) =>
                e.name.toLowerCase().includes(a.toLowerCase()) ||
                e.description.toLowerCase().includes(a.toLowerCase()) ||
                e.code.toLowerCase().includes(a.toLowerCase()),
            ),
            T = () => {
              if (!D) return [];
              let e = D;
              return (
                "all" !== c && (e = e.filter((e) => e.type === c)),
                "installed" === u
                  ? (e = e.filter((e) => e.is_installed))
                  : "available" === u && (e = e.filter((e) => !e.is_installed)),
                e
              );
            },
            I = (e) => S?.find((t) => t.value === e),
            R = async (t) => {
              (n(t),
                CT.installPlugin(t)
                  .then(() => {
                    (hN.success(e("messages.installSuccess")), L());
                  })
                  .catch((t) => {
                    hN.error(t.message || e("messages.installError"));
                  })
                  .finally(() => {
                    n(null);
                  }));
            },
            O = async (t) => {
              (n(t),
                CT.upgradePlugin(t)
                  .then(() => {
                    (hN.success(e("messages.upgradeSuccess")), L());
                  })
                  .catch((t) => {
                    hN.error(t.message || e("messages.upgradeError"));
                  })
                  .finally(() => {
                    n(null);
                  }));
            },
            M = async (t) => {
              (n(t),
                CT.uninstallPlugin(t)
                  .then(() => {
                    (hN.success(e("messages.uninstallSuccess")), L());
                  })
                  .catch((t) => {
                    hN.error(t.message || e("messages.uninstallError"));
                  })
                  .finally(() => {
                    n(null);
                  }));
            },
            A = async (t, i) => {
              n(t);
              (i ? CT.disablePlugin : CT.enablePlugin)(t)
                .then(() => {
                  (hN.success(e(i ? "messages.disableSuccess" : "messages.enableSuccess")), L());
                })
                .catch((t) => {
                  hN.error(t.message || e(i ? "messages.disableError" : "messages.enableError"));
                })
                .finally(() => {
                  n(null);
                });
            },
            P = (e) => {
              (s(e), r(!0));
            },
            j = async (t) => {
              t.name.endsWith(".zip")
                ? (p(!0),
                  CT.uploadPlugin(t)
                    .then(() => {
                      (hN.success(e("messages.uploadSuccess")), m(!1), L());
                    })
                    .catch((t) => {
                      hN.error(t.message || e("messages.uploadError"));
                    })
                    .finally(() => {
                      (p(!1), b.current && (b.current.value = ""));
                    }))
                : hN.error(e("upload.error.format"));
            },
            F = (e) => {
              (e.preventDefault(),
                e.stopPropagation(),
                "dragenter" === e.type || "dragover" === e.type
                  ? v(!0)
                  : "dragleave" === e.type && v(!1));
            },
            B = async (t) => {
              (n(t),
                CT.deletePlugin(t)
                  .then(() => {
                    (hN.success(e("messages.deleteSuccess")), L());
                  })
                  .catch((t) => {
                    hN.error(t.message || e("messages.deleteError"));
                  })
                  .finally(() => {
                    n(null);
                  }));
            };
          return Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                className: "flex items-center justify-between",
                children: [
                  Q.jsxs("div", {
                    className: "flex items-center space-x-4",
                    children: [
                      Q.jsx(Fat, { className: "h-6 w-6" }),
                      Q.jsx("h1", {
                        className: "text-2xl font-bold tracking-tight",
                        children: e("title"),
                      }),
                    ],
                  }),
                  Q.jsxs("div", {
                    className: "flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                children: [
                  Q.jsxs("div", {
                    className: "mb-8 space-y-4",
                    children: [
                      Q.jsxs("div", {
                        className:
                          "flex flex-col gap-4 md:flex-row md:items-center md:justify-between",
                        children: [
                          Q.jsxs("div", {
                            className: "relative max-w-sm flex-1",
                            children: [
                              Q.jsx(qat, {
                                className:
                                  "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",
                              }),
                              Q.jsx(Q6e, {
                                placeholder: e("search.placeholder"),
                                value: a,
                                onChange: (e) => l(e.target.value),
                                className: "pl-9",
                              }),
                            ],
                          }),
                          Q.jsxs("div", {
                            className: "flex items-center gap-4",
                            children: [
                              Q.jsxs(THt, {
                                value: u,
                                onValueChange: h,
                                children: [
                                  Q.jsx(OHt, {
                                    className: "w-[140px]",
                                    children: Q.jsx(RHt, {
                                      placeholder: e("status.filter_placeholder", {
                                        defaultValue: "安装状态",
                                      }),
                                    }),
                                  }),
                                  Q.jsxs(PHt, {
                                    children: [
                                      Q.jsx(FHt, {
                                        value: "all",
                                        children: e("status.all", { defaultValue: "全部状态" }),
                                      }),
                                      Q.jsx(FHt, {
                                        value: "installed",
                                        children: e("status.installed", { defaultValue: "已安装" }),
                                      }),
                                      Q.jsx(FHt, {
                                        value: "available",
                                        children: e("status.available", { defaultValue: "可安装" }),
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                              Q.jsxs(Nm, {
                                onClick: () => m(!0),
                                variant: "outline",
                                className: "shrink-0",
                                size: "sm",
                                children: [
                                  Q.jsx(alt, { className: "mr-2 h-4 w-4" }),
                                  e("upload.button"),
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                      Q.jsxs(iw, {
                        value: c,
                        onValueChange: d,
                        className: "w-full",
                        children: [
                          Q.jsxs(rw, {
                            children: [
                              S?.map((e) =>
                                Q.jsx(
                                  ow,
                                  {
                                    value: e.value,
                                    children: Q.jsx("div", {
                                      className: "flex items-center gap-2",
                                      children: Q.jsx("span", { children: e.label }),
                                    }),
                                  },
                                  e.value,
                                ),
                              ),
                              Q.jsx(ow, { value: "all", children: e("tabs.all") }),
                            ],
                          }),
                          Q.jsx(sw, {
                            value: "all",
                            className: "mt-6",
                            children: Q.jsx("div", {
                              className: "space-y-4",
                              children:
                                N || k
                                  ? Q.jsxs(Q.Fragment, {
                                      children: [Q.jsx(PQt, {}), Q.jsx(PQt, {}), Q.jsx(PQt, {})],
                                    })
                                  : T().map((e) =>
                                      Q.jsx(
                                        AQt,
                                        {
                                          plugin: e,
                                          typeInfo: I(e.type),
                                          onInstall: R,
                                          onUpgrade: O,
                                          onUninstall: M,
                                          onToggleEnable: A,
                                          onOpenConfig: P,
                                          onDelete: B,
                                          isLoading: t === e.code,
                                          onShowReadme: e.readme
                                            ? () => {
                                                (C(e.readme), x(!0));
                                              }
                                            : void 0,
                                        },
                                        e.code,
                                      ),
                                    ),
                            }),
                          }),
                          S?.map((e) =>
                            Q.jsx(
                              sw,
                              {
                                value: e.value,
                                className: "mt-6",
                                children: Q.jsx("div", {
                                  className: "space-y-4",
                                  children: T().map((e) =>
                                    Q.jsx(
                                      AQt,
                                      {
                                        plugin: e,
                                        typeInfo: I(e.type),
                                        onInstall: R,
                                        onUpgrade: O,
                                        onUninstall: M,
                                        onToggleEnable: A,
                                        onOpenConfig: P,
                                        onDelete: B,
                                        isLoading: t === e.code,
                                        onShowReadme: e.readme
                                          ? () => {
                                              (C(e.readme), x(!0));
                                            }
                                          : void 0,
                                      },
                                      e.code,
                                    ),
                                  ),
                                }),
                              },
                              e.value,
                            ),
                          ),
                        ],
                      }),
                    ],
                  }),
                  Q.jsx(Jet, {
                    open: i,
                    onOpenChange: r,
                    children: Q.jsxs(ttt, {
                      className: "sm:max-w-lg",
                      children: [
                        Q.jsxs(ntt, {
                          children: [
                            Q.jsxs(rtt, {
                              children: [
                                E?.find((e) => e.code === o)?.name,
                                " ",
                                e("config.title"),
                              ],
                            }),
                            Q.jsx(ott, { children: e("config.description") }),
                          ],
                        }),
                        o &&
                          Q.jsx(NXt, {
                            pluginName: o,
                            onClose: () => r(!1),
                            onSuccess: () => {
                              (r(!1), L());
                            },
                          }),
                      ],
                    }),
                  }),
                  Q.jsx(Jet, {
                    open: f,
                    onOpenChange: m,
                    children: Q.jsxs(ttt, {
                      className: "sm:max-w-md",
                      children: [
                        Q.jsxs(ntt, {
                          children: [
                            Q.jsx(rtt, { children: e("upload.title") }),
                            Q.jsx(ott, { children: e("upload.description") }),
                          ],
                        }),
                        Q.jsxs("div", {
                          className: Rf(
                            "relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",
                            _ && "border-primary/50 bg-muted/50",
                          ),
                          onDragEnter: F,
                          onDragLeave: F,
                          onDragOver: F,
                          onDrop: (e) => {
                            (e.preventDefault(),
                              e.stopPropagation(),
                              v(!1),
                              e.dataTransfer.files &&
                                e.dataTransfer.files[0] &&
                                j(e.dataTransfer.files[0]));
                          },
                          children: [
                            Q.jsx("input", {
                              type: "file",
                              ref: b,
                              className: "hidden",
                              accept: ".zip",
                              onChange: (e) => {
                                const t = e.target.files?.[0];
                                t && j(t);
                              },
                            }),
                            g
                              ? Q.jsxs("div", {
                                  className: "flex flex-col items-center space-y-2",
                                  children: [
                                    Q.jsx("div", {
                                      className:
                                        "h-10 w-10 animate-spin rounded-full border-b-2 border-primary",
                                    }),
                                    Q.jsx("div", {
                                      className: "text-sm text-muted-foreground",
                                      children: e("upload.uploading"),
                                    }),
                                  ],
                                })
                              : Q.jsx(Q.Fragment, {
                                  children: Q.jsxs("div", {
                                    className: "flex flex-col items-center space-y-4",
                                    children: [
                                      Q.jsx("div", {
                                        className:
                                          "rounded-full border-2 border-muted-foreground/25 p-3",
                                        children: Q.jsx(alt, {
                                          className: "h-6 w-6 text-muted-foreground/50",
                                        }),
                                      }),
                                      Q.jsxs("div", {
                                        className: "space-y-2",
                                        children: [
                                          Q.jsxs("div", {
                                            className: "text-sm font-medium",
                                            children: [
                                              e("upload.dragText"),
                                              " ",
                                              Q.jsx("button", {
                                                type: "button",
                                                onClick: () => b.current?.click(),
                                                className: "mx-1 text-primary hover:underline",
                                                children: e("upload.clickText"),
                                              }),
                                            ],
                                          }),
                                          Q.jsx("div", {
                                            className: "text-xs text-muted-foreground",
                                            children: e("upload.supportText"),
                                          }),
                                        ],
                                      }),
                                    ],
                                  }),
                                }),
                          ],
                        }),
                      ],
                    }),
                  }),
                  Q.jsx(Jet, {
                    open: y,
                    onOpenChange: x,
                    children: Q.jsxs(ttt, {
                      className: "max-w-2xl",
                      children: [
                        Q.jsx(ntt, {
                          children: Q.jsx(rtt, {
                            children: e("readme.title", { defaultValue: "插件文档" }),
                          }),
                        }),
                        Q.jsx("div", {
                          className: "markdown-body max-h-[60vh] overflow-y-auto",
                          dangerouslySetInnerHTML: {
                            __html: ((e) =>
                              MQt(e || "", {
                                walkTokens(e) {
                                  ("image" !== e.type && "link" !== e.type) ||
                                    ((e.type = "text"), (e.raw = ""), (e.text = ""));
                                },
                              }))(w),
                          },
                        }),
                      ],
                    }),
                  }),
                ],
              }),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  FQt = (e, t) => {
    let n = null;
    switch (e.field_type) {
      case "input":
        n = Q.jsx(Q6e, { placeholder: e.placeholder, ...t });
        break;
      case "textarea":
        n = Q.jsx(_Gt, { placeholder: e.placeholder, ...t });
        break;
      case "select":
        n = Q.jsx("select", {
          className: Rf(att({ variant: "outline" }), "w-full appearance-none font-normal"),
          ...t,
          children:
            e.select_options &&
            Object.keys(e.select_options).map((t) =>
              Q.jsx("option", { value: t, children: e.select_options?.[t] }, t),
            ),
        });
        break;
      default:
        n = null;
    }
    return n;
  };
function BQt({ themeKey: e, themeInfo: t }) {
  const { t: n } = Py("theme"),
    [i, r] = H.useState(!1),
    [o, s] = H.useState(!1),
    [a, l] = H.useState(!1),
    c = kv({ defaultValues: t.configs.reduce((e, t) => ((e[t.field_name] = ""), e), {}) });
  return Q.jsxs(Jet, {
    open: i,
    onOpenChange: (t) => {
      (r(t),
        t
          ? (async () => {
              (s(!0),
                BL(e)
                  .then(({ data: e }) => {
                    Object.entries(e).forEach(([e, t]) => {
                      c.setValue(e, t);
                    });
                  })
                  .finally(() => {
                    s(!1);
                  }));
            })()
          : c.reset());
    },
    children: [
      Q.jsx(ett, {
        asChild: !0,
        children: Q.jsx(Nm, { variant: "outline", children: n("card.configureTheme") }),
      }),
      Q.jsxs(ttt, {
        className: "max-h-[90vh] overflow-auto sm:max-w-[425px]",
        children: [
          Q.jsxs(ntt, {
            children: [
              Q.jsx(rtt, { children: n("config.title", { name: t.name }) }),
              Q.jsx(ott, { children: n("config.description") }),
            ],
          }),
          o
            ? Q.jsx("div", {
                className: "flex h-40 items-center justify-center",
                children: Q.jsx(Aat, { className: "h-6 w-6 animate-spin" }),
              })
            : Q.jsx(Hy, {
                ...c,
                children: Q.jsxs("form", {
                  onSubmit: c.handleSubmit(async (t) => {
                    (l(!0),
                      VL(e, t)
                        .then(() => {
                          (hN.success(n("config.success")), r(!1));
                        })
                        .finally(() => {
                          l(!1);
                        }));
                  }),
                  className: "space-y-4",
                  children: [
                    t.configs.map((e) =>
                      Q.jsx(
                        Uy,
                        {
                          control: c.control,
                          name: e.field_name,
                          render: ({ field: t }) =>
                            Q.jsxs(Ky, {
                              children: [
                                Q.jsx(Gy, { children: e.label }),
                                Q.jsx(Zy, { children: FQt(e, t) }),
                                Q.jsx(Xy, {}),
                              ],
                            }),
                        },
                        e.field_name,
                      ),
                    ),
                    Q.jsxs(itt, {
                      className: "mt-6 gap-2",
                      children: [
                        Q.jsx(Nm, {
                          type: "button",
                          variant: "secondary",
                          onClick: () => r(!1),
                          children: n("config.cancel"),
                        }),
                        Q.jsx(Nm, { type: "submit", loading: a, children: n("config.save") }),
                      ],
                    }),
                  ],
                }),
              }),
        ],
      }),
    ],
  });
}
function VQt() {
  return Q.jsxs(q6e, {
    children: [
      Q.jsxs(K6e, {
        children: [
          Q.jsx(n$t, { className: "h-6 w-[200px]" }),
          Q.jsx(n$t, { className: "h-4 w-[300px]" }),
        ],
      }),
      Q.jsxs(Y6e, {
        className: "flex items-center justify-end space-x-3",
        children: [
          Q.jsx(n$t, { className: "h-10 w-[100px]" }),
          Q.jsx(n$t, { className: "h-10 w-[100px]" }),
        ],
      }),
    ],
  });
}
const WQt_legacy = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py("theme"),
          [t, n] = H.useState(null),
          [i, r] = H.useState(!1),
          [o, s] = H.useState(!1),
          [a, l] = H.useState(!1),
          [c, d] = H.useState(null),
          u = H.useRef(null),
          [h, g] = H.useState(0),
          {
            data: p,
            isLoading: f,
            refetch: m,
          } = gC({
            queryKey: ["themeList"],
            queryFn: async () => {
              const { data: e } = await FL();
              return e;
            },
          }),
          _ = async (t) => {
            t.name.endsWith(".zip")
              ? (r(!0),
                WL(t)
                  .then(() => {
                    (hN.success("主题上传成功"), s(!1), m());
                  })
                  .finally(() => {
                    (r(!1), u.current && (u.current.value = ""));
                  }))
              : hN.error(e("upload.error.format"));
          },
          v = (e) => {
            (e.preventDefault(),
              e.stopPropagation(),
              "dragenter" === e.type || "dragover" === e.type
                ? l(!0)
                : "dragleave" === e.type && l(!1));
          };
        return Q.jsxs(Wot, {
          children: [
            Q.jsxs(Hot, {
              className: "flex items-center justify-between",
              children: [
                Q.jsx(Vdt, {}),
                Q.jsxs("div", {
                  className: "flex items-center space-x-4",
                  children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                }),
              ],
            }),
            Q.jsxs(zot, {
              className: "",
              children: [
                Q.jsxs("header", {
                  className: "mb-8",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2",
                      children: Q.jsx("h1", {
                        className: "text-2xl font-bold tracking-tight",
                        children: e("title"),
                      }),
                    }),
                    Q.jsxs("div", {
                      className: "flex items-center justify-between",
                      children: [
                        Q.jsx("div", {
                          className: "text-muted-foreground",
                          children: e("description"),
                        }),
                        Q.jsxs(Nm, {
                          onClick: () => s(!0),
                          variant: "outline",
                          className: "ml-4 shrink-0",
                          size: "sm",
                          children: [Q.jsx(alt, { className: "mr-2 h-4 w-4" }), e("upload.button")],
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsx("section", {
                  className: "grid gap-6 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3",
                  children: f
                    ? Q.jsxs(Q.Fragment, { children: [Q.jsx(VQt, {}), Q.jsx(VQt, {})] })
                    : p?.themes &&
                      Object.entries(p.themes).map(([i, r]) =>
                        Q.jsx(
                          q6e,
                          {
                            className:
                              "group relative overflow-hidden transition-all hover:shadow-md",
                            style: {
                              backgroundImage: r.background_url
                                ? `url(${r.background_url})`
                                : "none",
                              backgroundSize: "cover",
                              backgroundPosition: "center",
                            },
                            children: Q.jsxs("div", {
                              className: Rf(
                                "relative z-10 h-full transition-colors",
                                r.background_url
                                  ? "group-hover:from-background/98 bg-gradient-to-t from-background/95 via-background/80 to-background/60 backdrop-blur-[1px] group-hover:via-background/90 group-hover:to-background/70"
                                  : "bg-background",
                              ),
                              children: [
                                !!r.can_delete &&
                                  Q.jsx("div", {
                                    className: "absolute right-2 top-2",
                                    children: Q.jsx(yXt, {
                                      title: e("card.delete.title"),
                                      description: e("card.delete.description"),
                                      confirmText: e("card.delete.button"),
                                      variant: "destructive",
                                      onConfirm: async () => {
                                        i !== p?.active
                                          ? (n(i),
                                            HL(i)
                                              .then(() => {
                                                (hN.success("主题删除成功"), m());
                                              })
                                              .finally(() => {
                                                n(null);
                                              }))
                                          : hN.error(e("card.delete.error.active"));
                                      },
                                      children: Q.jsx(Nm, {
                                        disabled: t === i,
                                        loading: t === i,
                                        variant: "ghost",
                                        size: "icon",
                                        className:
                                          "h-8 w-8 text-muted-foreground hover:text-destructive",
                                        children: Q.jsx(ilt, { className: "h-4 w-4" }),
                                      }),
                                    }),
                                  }),
                                Q.jsxs(K6e, {
                                  children: [
                                    Q.jsx(G6e, { children: r.name }),
                                    Q.jsx(Z6e, {
                                      children: Q.jsxs("div", {
                                        className: "space-y-2",
                                        children: [
                                          Q.jsx("div", { children: r.description }),
                                          r.version &&
                                            Q.jsx("div", {
                                              className: "text-sm text-muted-foreground",
                                              children: e("card.version", { version: r.version }),
                                            }),
                                        ],
                                      }),
                                    }),
                                  ],
                                }),
                                Q.jsxs(Y6e, {
                                  className: "flex items-center justify-end space-x-3",
                                  children: [
                                    r.images &&
                                      Array.isArray(r.images) &&
                                      r.images.length > 0 &&
                                      Q.jsx(Nm, {
                                        variant: "outline",
                                        size: "icon",
                                        className: "h-8 w-8",
                                        onClick: () => {
                                          return (
                                            (e = r.name),
                                            (t = r.images),
                                            g(0),
                                            void d({ name: e, images: t })
                                          );
                                          var e, t;
                                        },
                                        children: Q.jsx(Mat, { className: "h-4 w-4" }),
                                      }),
                                    Q.jsx(BQt, { themeKey: i, themeInfo: r }),
                                    Q.jsx(Nm, {
                                      onClick: () =>
                                        (async (e) => {
                                          (n(e),
                                            xT
                                              .updateSystemConfig({ frontend_theme: e })
                                              .then(() => {
                                                (hN.success("主题切换成功"), m());
                                              })
                                              .finally(() => {
                                                n(null);
                                              }));
                                        })(i),
                                      disabled: t === i || i === p.active,
                                      loading: t === i,
                                      variant: i === p.active ? "secondary" : "default",
                                      children:
                                        i === p.active
                                          ? e("card.currentTheme")
                                          : e("card.activateTheme"),
                                    }),
                                  ],
                                }),
                              ],
                            }),
                          },
                          i,
                        ),
                      ),
                }),
                Q.jsx(Jet, {
                  open: o,
                  onOpenChange: s,
                  children: Q.jsxs(ttt, {
                    className: "sm:max-w-md",
                    children: [
                      Q.jsxs(ntt, {
                        children: [
                          Q.jsx(rtt, { children: e("upload.title") }),
                          Q.jsx(ott, { children: e("upload.description") }),
                        ],
                      }),
                      Q.jsxs("div", {
                        className: Rf(
                          "relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",
                          a && "border-primary/50 bg-muted/50",
                        ),
                        onDragEnter: v,
                        onDragLeave: v,
                        onDragOver: v,
                        onDrop: (e) => {
                          (e.preventDefault(),
                            e.stopPropagation(),
                            l(!1),
                            e.dataTransfer.files &&
                              e.dataTransfer.files[0] &&
                              _(e.dataTransfer.files[0]));
                        },
                        children: [
                          Q.jsx("input", {
                            type: "file",
                            ref: u,
                            className: "hidden",
                            accept: ".zip",
                            onChange: (e) => {
                              const t = e.target.files?.[0];
                              t && _(t);
                            },
                          }),
                          i
                            ? Q.jsxs("div", {
                                className: "flex flex-col items-center space-y-2",
                                children: [
                                  Q.jsx("div", {
                                    className:
                                      "h-10 w-10 animate-spin rounded-full border-b-2 border-primary",
                                  }),
                                  Q.jsx("div", {
                                    className: "text-sm text-muted-foreground",
                                    children: e("upload.uploading"),
                                  }),
                                ],
                              })
                            : Q.jsx(Q.Fragment, {
                                children: Q.jsxs("div", {
                                  className: "flex flex-col items-center space-y-4",
                                  children: [
                                    Q.jsx("div", {
                                      className:
                                        "rounded-full border-2 border-muted-foreground/25 p-3",
                                      children: Q.jsx(alt, {
                                        className: "h-6 w-6 text-muted-foreground/50",
                                      }),
                                    }),
                                    Q.jsxs("div", {
                                      className: "space-y-2",
                                      children: [
                                        Q.jsxs("div", {
                                          className: "text-sm font-medium",
                                          children: [
                                            e("upload.dragText"),
                                            " ",
                                            Q.jsx("button", {
                                              type: "button",
                                              onClick: () => u.current?.click(),
                                              className: "mx-1 text-primary hover:underline",
                                              children: e("upload.clickText"),
                                            }),
                                          ],
                                        }),
                                        Q.jsx("div", {
                                          className: "text-xs text-muted-foreground",
                                          children: e("upload.supportText"),
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                              }),
                        ],
                      }),
                    ],
                  }),
                }),
                Q.jsx(Jet, {
                  open: !!c,
                  onOpenChange: (e) => {
                    e || (d(null), g(0));
                  },
                  children: Q.jsxs(ttt, {
                    className: "max-w-4xl",
                    children: [
                      Q.jsxs(ntt, {
                        children: [
                          Q.jsxs(rtt, { children: [c?.name, " ", e("preview.title")] }),
                          Q.jsx(ott, {
                            className: "text-center",
                            children:
                              c &&
                              e("preview.imageCount", { current: h + 1, total: c.images.length }),
                          }),
                        ],
                      }),
                      Q.jsxs("div", {
                        className: "relative",
                        children: [
                          Q.jsx("div", {
                            className: "aspect-[16/9] overflow-hidden rounded-lg border bg-muted",
                            children:
                              c?.images[h] &&
                              Q.jsx("img", {
                                src: c.images[h],
                                alt: `${c.name} 预览图 ${h + 1}`,
                                className: "h-full w-full object-contain",
                              }),
                          }),
                          c &&
                            c.images.length > 1 &&
                            Q.jsxs(Q.Fragment, {
                              children: [
                                Q.jsx(Nm, {
                                  variant: "outline",
                                  size: "icon",
                                  className:
                                    "absolute left-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",
                                  onClick: () => {
                                    c && g((e) => (0 === e ? c.images.length - 1 : e - 1));
                                  },
                                  children: Q.jsx(cat, { className: "h-4 w-4" }),
                                }),
                                Q.jsx(Nm, {
                                  variant: "outline",
                                  size: "icon",
                                  className:
                                    "absolute right-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",
                                  onClick: () => {
                                    c && g((e) => (e === c.images.length - 1 ? 0 : e + 1));
                                  },
                                  children: Q.jsx(dat, { className: "h-4 w-4" }),
                                }),
                              ],
                            }),
                        ],
                      }),
                      c &&
                        c.images.length > 1 &&
                        Q.jsx("div", {
                          className: "mt-4 flex gap-2 overflow-x-auto pb-2",
                          children: c.images.map((e, t) =>
                            Q.jsx(
                              "button",
                              {
                                onClick: () => g(t),
                                className: Rf(
                                  "relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border-2",
                                  h === t ? "border-primary" : "border-transparent",
                                ),
                                children: Q.jsx("img", {
                                  src: e,
                                  alt: `缩略图 ${t + 1}`,
                                  className: "h-full w-full object-cover",
                                }),
                              },
                              t,
                            ),
                          ),
                        }),
                    ],
                  }),
                }),
              ],
            }),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
/* const WQt_temp = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const nebulaThemeDefaults = {
            nebula_theme_color: "aurora",
            nebula_hero_slogan: "",
            nebula_welcome_target: "",
            nebula_register_title: "",
            nebula_background_url: "",
            nebula_metrics_base_url: "",
            nebula_default_theme_mode: "system",
            nebula_light_logo_url: "",
            nebula_dark_logo_url: "",
            nebula_custom_html: "",
            nebula_static_cdn_url: "",
          },
          nebulaThemeColorOptions = [
            { value: "aurora", label: "Aurora" },
            { value: "sunset", label: "Sunset" },
            { value: "ember", label: "Ember" },
            { value: "violet", label: "Violet" },
          ],
          nebulaThemeModeOptions = [
            { value: "system", label: "跟随系统" },
            { value: "dark", label: "深色优先" },
            { value: "light", label: "浅色优先" },
          ],
          { data: e, isLoading: t } = gC({
            queryKey: ["settings", "nebula"],
            queryFn: () => xT.getSettings("nebula"),
          }),
          n = kv({ defaultValues: nebulaThemeDefaults, mode: "onBlur" }),
          { mutateAsync: i, isPending: r } = pC({
            mutationFn: xT.saveSettings,
            onSuccess: (e) => {
              e.data ? hN.success("Nebula 配置已保存") : hN.error("Nebula 配置保存失败");
            },
            onError: () => {
              hN.error("Nebula 配置保存失败");
            },
          }),
          o = n.handleSubmit(async (e) => {
            await i(
              Object.entries(e).reduce((e, [t, n]) => ((e[t] = null == n ? "" : n), e), {}),
            );
          });
        return (
          H.useEffect(() => {
            const t = e?.data?.nebula || {};
            n.reset({
              ...nebulaThemeDefaults,
              ...Object.entries(t).reduce((e, [t, n]) => ((e[t] = null == n ? "" : n), e), {}),
            });
          }, [e, n]),
          Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                className: "flex items-center justify-between",
                children: [
                  Q.jsx(Vdt, {}),
                  Q.jsxs("div", {
                    className: "flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                className: "",
                children: [
                  Q.jsxs("header", {
                    className: "mb-8",
                    children: [
                      Q.jsx("div", {
                        className: "mb-2",
                        children: Q.jsx("h1", {
                          className: "text-2xl font-bold tracking-tight",
                          children: "Nebula 主题配置",
                        }),
                      }),
                      Q.jsxs("div", {
                        className: "flex items-center justify-between gap-4",
                        children: [
                          Q.jsx("div", {
                            className: "text-muted-foreground",
                            children:
                              "集中配置 Nebula 前台主题的配色、文案、背景、Logo 与扩展注入内容。",
                          }),
                          Q.jsx(Nm, {
                            type: "submit",
                            form: "nebula-theme-config-form",
                            className: "ml-4 shrink-0",
                            loading: r,
                            children: "保存配置",
                          }),
                        ],
                      }),
                    ],
                  }),
                  Q.jsx(Hy, {
                    ...n,
                    children: Q.jsxs("form", {
                      id: "nebula-theme-config-form",
                      onSubmit: o,
                      className: "space-y-6",
                      children: [
                        Q.jsx(q6e, {
                          children: Q.jsxs(Q.Fragment, {
                            children: [
                              Q.jsxs(K6e, {
                                children: [
                                  Q.jsx(G6e, { children: "基础展示" }),
                                  Q.jsx(Z6e, {
                                    children: "配置 Nebula 首页主色、默认明暗模式以及首页文案内容。",
                                  }),
                                ],
                              }),
                              Q.jsx(Y6e, {
                                children: t
                                  ? Q.jsx("div", {
                                      className:
                                        "rounded-lg border border-dashed bg-muted/30 px-4 py-8 text-sm text-muted-foreground",
                                      children: "正在加载 Nebula 配置...",
                                    })
                                  : Q.jsxs("div", {
                                      className: "grid gap-4 md:grid-cols-2",
                                      children: [
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_theme_color",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "主题色方案" }),
                                                Q.jsxs("div", {
                                                  className: "relative",
                                                  children: [
                                                    Q.jsx(Zy, {
                                                      children: Q.jsx("select", {
                                                        className:
                                                          "flex h-9 w-full appearance-none rounded-md border border-input bg-transparent px-3 py-1 pr-9 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
                                                        value: e.value || "aurora",
                                                        onChange: (t) => {
                                                          e.onChange(t.target.value);
                                                        },
                                                        children: nebulaThemeColorOptions.map((e) =>
                                                          Q.jsx(
                                                            "option",
                                                            { value: e.value, children: e.label },
                                                            e.value,
                                                          ),
                                                        ),
                                                      }),
                                                    }),
                                                    Q.jsx(m7e, {
                                                      className:
                                                        "pointer-events-none absolute right-3 top-2.5 h-4 w-4 opacity-50",
                                                    }),
                                                  ],
                                                }),
                                                Q.jsx(Yy, {
                                                  children: "控制 Nebula 前台的默认色彩风格。",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_default_theme_mode",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "默认主题模式" }),
                                                Q.jsxs("div", {
                                                  className: "relative",
                                                  children: [
                                                    Q.jsx(Zy, {
                                                      children: Q.jsx("select", {
                                                        className:
                                                          "flex h-9 w-full appearance-none rounded-md border border-input bg-transparent px-3 py-1 pr-9 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
                                                        value: e.value || "system",
                                                        onChange: (t) => {
                                                          e.onChange(t.target.value);
                                                        },
                                                        children: nebulaThemeModeOptions.map((e) =>
                                                          Q.jsx(
                                                            "option",
                                                            { value: e.value, children: e.label },
                                                            e.value,
                                                          ),
                                                        ),
                                                      }),
                                                    }),
                                                    Q.jsx(m7e, {
                                                      className:
                                                        "pointer-events-none absolute right-3 top-2.5 h-4 w-4 opacity-50",
                                                    }),
                                                  ],
                                                }),
                                                Q.jsx(Yy, {
                                                  children: "首次进入前台时默认应用的明暗模式策略。",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_hero_slogan",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "首页主标语" }),
                                                Q.jsx(Zy, {
                                                  children: Q.jsx(Q6e, {
                                                    placeholder: "输入首页主视觉标语",
                                                    ...e,
                                                    value: e.value || "",
                                                  }),
                                                }),
                                                Q.jsx(Yy, {
                                                  children: "显示在首页主视觉区域的主标题文案。",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_welcome_target",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "欢迎对象" }),
                                                Q.jsx(Zy, {
                                                  children: Q.jsx(Q6e, {
                                                    placeholder: "例如 Voyage Network",
                                                    ...e,
                                                    value: e.value || "",
                                                  }),
                                                }),
                                                Q.jsx(Yy, {
                                                  children: "显示在 Welcome to 后面的目标名称。",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_register_title",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "注册页标题" }),
                                                Q.jsx(Zy, {
                                                  children: Q.jsx(Q6e, {
                                                    placeholder: "输入注册面板标题",
                                                    ...e,
                                                    value: e.value || "",
                                                  }),
                                                }),
                                                Q.jsx(Yy, {
                                                  children: "注册页面顶部显示的标题文案。",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_metrics_base_url",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "指标接口地址" }),
                                                Q.jsx(Zy, {
                                                  children: Q.jsx(Q6e, {
                                                    placeholder: "https://example.com/api/metrics",
                                                    ...e,
                                                    value: e.value || "",
                                                  }),
                                                }),
                                                Q.jsx(Yy, {
                                                  children:
                                                    "未登录状态展示性能指标时使用的 API 基础地址，可留空。",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                      ],
                                    }),
                              }),
                            ],
                          }),
                        }),
                        Q.jsx(q6e, {
                          children: Q.jsxs(Q.Fragment, {
                            children: [
                              Q.jsxs(K6e, {
                                children: [
                                  Q.jsx(G6e, { children: "品牌与扩展" }),
                                  Q.jsx(Z6e, {
                                    children: "配置 Logo、背景、静态资源地址以及自定义 HTML 注入。",
                                  }),
                                ],
                              }),
                              Q.jsx(Y6e, {
                                children: Q.jsxs("div", {
                                  className: "grid gap-4 md:grid-cols-2",
                                  children: [
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_background_url",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          children: [
                                            Q.jsx(Gy, { children: "背景图地址" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(Q6e, {
                                                placeholder:
                                                  "https://example.com/background.webp",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children: "Nebula 登录页或首页使用的背景图片链接。",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_static_cdn_url",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          children: [
                                            Q.jsx(Gy, { children: "静态资源 CDN" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(Q6e, {
                                                placeholder: "https://cdn.example.com/nebula",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children: "Nebula 静态资源的 CDN 根路径，可留空。",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_light_logo_url",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          children: [
                                            Q.jsx(Gy, { children: "浅色 Logo 地址" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(Q6e, {
                                                placeholder:
                                                  "https://example.com/logo-light.svg",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children: "浅色模式下显示的品牌 Logo。",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_dark_logo_url",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          children: [
                                            Q.jsx(Gy, { children: "深色 Logo 地址" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(Q6e, {
                                                placeholder:
                                                  "https://example.com/logo-dark.svg",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children: "深色模式下显示的品牌 Logo。",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_custom_html",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          className: "md:col-span-2",
                                          children: [
                                            Q.jsx(Gy, { children: "自定义 HTML / 脚本" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(_Gt, {
                                                className: "min-h-[220px] font-mono text-xs",
                                                placeholder:
                                                  "可注入自定义 HTML、脚本或样式到 Nebula 页面中",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children:
                                                "用于追加统计脚本、验证代码或局部样式覆盖。",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                  ],
                                }),
                              }),
                            ],
                          }),
                        }),
                      ],
                    }),
                  }),
                ],
              }),
            ],
          })
        );
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
*/
const WQt = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const nebulaThemeDefaults = {
            nebula_theme_color: "aurora",
            nebula_hero_slogan: "",
            nebula_welcome_target: "",
            nebula_register_title: "",
            nebula_background_url: "",
            nebula_metrics_base_url: "",
            nebula_default_theme_mode: "system",
            nebula_light_logo_url: "",
            nebula_dark_logo_url: "",
            nebula_custom_html: "",
            nebula_static_cdn_url: "",
          },
          nebulaThemeColorOptions = [
            { value: "aurora", label: "Aurora" },
            { value: "sunset", label: "Sunset" },
            { value: "ember", label: "Ember" },
            { value: "violet", label: "Violet" },
          ],
          nebulaThemeModeOptions = [
            { value: "system", label: "Follow system" },
            { value: "dark", label: "Prefer dark" },
            { value: "light", label: "Prefer light" },
          ],
          { data: e, isLoading: t } = gC({
            queryKey: ["settings", "nebula"],
            queryFn: () => xT.getSettings("nebula"),
          }),
          n = kv({ defaultValues: nebulaThemeDefaults, mode: "onBlur" }),
          { mutateAsync: i, isPending: r } = pC({
            mutationFn: xT.saveSettings,
            onSuccess: (e) => {
              e.data ? hN.success("Nebula settings saved") : hN.error("Nebula settings save failed");
            },
            onError: () => {
              hN.error("Nebula settings save failed");
            },
          }),
          o = n.handleSubmit(async (e) => {
            await i(
              Object.entries(e).reduce((e, [t, n]) => ((e[t] = null == n ? "" : n), e), {}),
            );
          });
        return (
          H.useEffect(() => {
            const t = e?.data?.nebula || {};
            n.reset({
              ...nebulaThemeDefaults,
              ...Object.entries(t).reduce((e, [t, n]) => ((e[t] = null == n ? "" : n), e), {}),
            });
          }, [e, n]),
          Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                className: "flex items-center justify-between",
                children: [
                  Q.jsx(Vdt, {}),
                  Q.jsxs("div", {
                    className: "flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                className: "",
                children: [
                  Q.jsxs("header", {
                    className: "mb-8",
                    children: [
                      Q.jsx("div", {
                        className: "mb-2",
                        children: Q.jsx("h1", {
                          className: "text-2xl font-bold tracking-tight",
                          children: "Nebula Theme",
                        }),
                      }),
                      Q.jsxs("div", {
                        className: "flex items-center justify-between gap-4",
                        children: [
                          Q.jsx("div", {
                            className: "text-muted-foreground",
                            children:
                              "Configure Nebula theme colors, copywriting, branding assets, and custom injections.",
                          }),
                          Q.jsx(Nm, {
                            type: "submit",
                            form: "nebula-theme-config-form",
                            className: "ml-4 shrink-0",
                            loading: r,
                            children: "Save settings",
                          }),
                        ],
                      }),
                    ],
                  }),
                  Q.jsx(Hy, {
                    ...n,
                    children: Q.jsxs("form", {
                      id: "nebula-theme-config-form",
                      onSubmit: o,
                      className: "space-y-6",
                      children: [
                        Q.jsx(q6e, {
                          children: Q.jsxs(Q.Fragment, {
                            children: [
                              Q.jsxs(K6e, {
                                children: [
                                  Q.jsx(G6e, { children: "Display" }),
                                  Q.jsx(Z6e, {
                                    children:
                                      "Set the primary color, theme mode, and hero copy shown by Nebula.",
                                  }),
                                ],
                              }),
                              Q.jsx(Y6e, {
                                children: t
                                  ? Q.jsx("div", {
                                      className:
                                        "rounded-lg border border-dashed bg-muted/30 px-4 py-8 text-sm text-muted-foreground",
                                      children: "Loading Nebula settings...",
                                    })
                                  : Q.jsxs("div", {
                                      className: "grid gap-4 md:grid-cols-2",
                                      children: [
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_theme_color",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "Theme palette" }),
                                                Q.jsxs("div", {
                                                  className: "relative",
                                                  children: [
                                                    Q.jsx(Zy, {
                                                      children: Q.jsx("select", {
                                                        className:
                                                          "flex h-9 w-full appearance-none rounded-md border border-input bg-transparent px-3 py-1 pr-9 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
                                                        value: e.value || "aurora",
                                                        onChange: (t) => {
                                                          e.onChange(t.target.value);
                                                        },
                                                        children: nebulaThemeColorOptions.map((e) =>
                                                          Q.jsx(
                                                            "option",
                                                            { value: e.value, children: e.label },
                                                            e.value,
                                                          ),
                                                        ),
                                                      }),
                                                    }),
                                                    Q.jsx(m7e, {
                                                      className:
                                                        "pointer-events-none absolute right-3 top-2.5 h-4 w-4 opacity-50",
                                                    }),
                                                  ],
                                                }),
                                                Q.jsx(Yy, {
                                                  children: "Controls the default Nebula color palette.",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_default_theme_mode",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "Theme mode" }),
                                                Q.jsxs("div", {
                                                  className: "relative",
                                                  children: [
                                                    Q.jsx(Zy, {
                                                      children: Q.jsx("select", {
                                                        className:
                                                          "flex h-9 w-full appearance-none rounded-md border border-input bg-transparent px-3 py-1 pr-9 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
                                                        value: e.value || "system",
                                                        onChange: (t) => {
                                                          e.onChange(t.target.value);
                                                        },
                                                        children: nebulaThemeModeOptions.map((e) =>
                                                          Q.jsx(
                                                            "option",
                                                            { value: e.value, children: e.label },
                                                            e.value,
                                                          ),
                                                        ),
                                                      }),
                                                    }),
                                                    Q.jsx(m7e, {
                                                      className:
                                                        "pointer-events-none absolute right-3 top-2.5 h-4 w-4 opacity-50",
                                                    }),
                                                  ],
                                                }),
                                                Q.jsx(Yy, {
                                                  children:
                                                    "Applied when a user opens the Nebula frontend for the first time.",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_hero_slogan",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "Hero slogan" }),
                                                Q.jsx(Zy, {
                                                  children: Q.jsx(Q6e, {
                                                    placeholder: "Enter the main slogan",
                                                    ...e,
                                                    value: e.value || "",
                                                  }),
                                                }),
                                                Q.jsx(Yy, {
                                                  children: "Shown as the main title in the hero area.",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_welcome_target",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "Welcome target" }),
                                                Q.jsx(Zy, {
                                                  children: Q.jsx(Q6e, {
                                                    placeholder: "For example: Voyage Network",
                                                    ...e,
                                                    value: e.value || "",
                                                  }),
                                                }),
                                                Q.jsx(Yy, {
                                                  children: "Appended after the Welcome to heading.",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_register_title",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "Register title" }),
                                                Q.jsx(Zy, {
                                                  children: Q.jsx(Q6e, {
                                                    placeholder: "Enter the register panel title",
                                                    ...e,
                                                    value: e.value || "",
                                                  }),
                                                }),
                                                Q.jsx(Yy, {
                                                  children: "Displayed at the top of the register panel.",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                        Q.jsx(Uy, {
                                          control: n.control,
                                          name: "nebula_metrics_base_url",
                                          render: ({ field: e }) =>
                                            Q.jsxs(Ky, {
                                              children: [
                                                Q.jsx(Gy, { children: "Metrics API URL" }),
                                                Q.jsx(Zy, {
                                                  children: Q.jsx(Q6e, {
                                                    placeholder: "https://example.com/api/metrics",
                                                    ...e,
                                                    value: e.value || "",
                                                  }),
                                                }),
                                                Q.jsx(Yy, {
                                                  children:
                                                    "Base URL used when Nebula shows public metrics before login.",
                                                }),
                                                Q.jsx(Xy, {}),
                                              ],
                                            }),
                                        }),
                                      ],
                                    }),
                              }),
                            ],
                          }),
                        }),
                        Q.jsx(q6e, {
                          children: Q.jsxs(Q.Fragment, {
                            children: [
                              Q.jsxs(K6e, {
                                children: [
                                  Q.jsx(G6e, { children: "Branding" }),
                                  Q.jsx(Z6e, {
                                    children:
                                      "Set background assets, logo URLs, CDN roots, and custom HTML.",
                                  }),
                                ],
                              }),
                              Q.jsx(Y6e, {
                                children: Q.jsxs("div", {
                                  className: "grid gap-4 md:grid-cols-2",
                                  children: [
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_background_url",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          children: [
                                            Q.jsx(Gy, { children: "Background URL" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(Q6e, {
                                                placeholder:
                                                  "https://example.com/background.webp",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children: "Used by the Nebula login or landing background.",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_static_cdn_url",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          children: [
                                            Q.jsx(Gy, { children: "Static CDN URL" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(Q6e, {
                                                placeholder: "https://cdn.example.com/nebula",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children: "Root CDN path for Nebula static assets.",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_light_logo_url",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          children: [
                                            Q.jsx(Gy, { children: "Light logo URL" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(Q6e, {
                                                placeholder:
                                                  "https://example.com/logo-light.svg",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children: "Displayed while the light theme is active.",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_dark_logo_url",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          children: [
                                            Q.jsx(Gy, { children: "Dark logo URL" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(Q6e, {
                                                placeholder:
                                                  "https://example.com/logo-dark.svg",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children: "Displayed while the dark theme is active.",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                    Q.jsx(Uy, {
                                      control: n.control,
                                      name: "nebula_custom_html",
                                      render: ({ field: e }) =>
                                        Q.jsxs(Ky, {
                                          className: "md:col-span-2",
                                          children: [
                                            Q.jsx(Gy, { children: "Custom HTML / scripts" }),
                                            Q.jsx(Zy, {
                                              children: Q.jsx(_Gt, {
                                                className: "min-h-[220px] font-mono text-xs",
                                                placeholder:
                                                  "Inject custom HTML, scripts, or styles into Nebula pages",
                                                ...e,
                                                value: e.value || "",
                                              }),
                                            }),
                                            Q.jsx(Yy, {
                                              children:
                                                "Useful for analytics scripts, verification tags, or scoped style overrides.",
                                            }),
                                            Q.jsx(Xy, {}),
                                          ],
                                        }),
                                    }),
                                  ],
                                }),
                              }),
                            ],
                          }),
                        }),
                      ],
                    }),
                  }),
                ],
              }),
            ],
          })
        );
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
var HQt,
  zQt = new Uint8Array(16);
function UQt() {
  if (
    !HQt &&
    !(HQt =
      ("undefined" != typeof crypto &&
        crypto.getRandomValues &&
        crypto.getRandomValues.bind(crypto)) ||
      ("undefined" != typeof msCrypto &&
        "function" == typeof msCrypto.getRandomValues &&
        msCrypto.getRandomValues.bind(msCrypto)))
  )
    throw new Error(
      "crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported",
    );
  return HQt(zQt);
}
const $Qt =
  /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
for (var qQt = [], KQt = 0; KQt < 256; ++KQt) qQt.push((KQt + 256).toString(16).substr(1));
function GQt(e) {
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
    n = (
      qQt[e[t + 0]] +
      qQt[e[t + 1]] +
      qQt[e[t + 2]] +
      qQt[e[t + 3]] +
      "-" +
      qQt[e[t + 4]] +
      qQt[e[t + 5]] +
      "-" +
      qQt[e[t + 6]] +
      qQt[e[t + 7]] +
      "-" +
      qQt[e[t + 8]] +
      qQt[e[t + 9]] +
      "-" +
      qQt[e[t + 10]] +
      qQt[e[t + 11]] +
      qQt[e[t + 12]] +
      qQt[e[t + 13]] +
      qQt[e[t + 14]] +
      qQt[e[t + 15]]
    ).toLowerCase();
  if (
    !(function (e) {
      return "string" == typeof e && $Qt.test(e);
    })(n)
  )
    throw TypeError("Stringified UUID is invalid");
  return n;
}
function ZQt(e, t, n) {
  var i = (e = e || {}).random || (e.rng || UQt)();
  return ((i[6] = (15 & i[6]) | 64), (i[8] = (63 & i[8]) | 128), GQt(i));
}
function YQt(e) {
  return H.createElement("i", { className: "rmel-iconfont rmel-icon-" + e.type });
}
function XQt(e) {
  return H.createElement(
    "div",
    { className: "rc-md-navigation " + (e.visible ? "visible" : "in-visible") },
    H.createElement(
      "div",
      { className: "navigation-nav left" },
      H.createElement("div", { className: "button-wrap" }, e.left),
    ),
    H.createElement(
      "div",
      { className: "navigation-nav right" },
      H.createElement("div", { className: "button-wrap" }, e.right),
    ),
  );
}
function QQt(e) {
  return H.createElement("div", { className: "tool-bar", style: e.style }, e.children);
}
var JQt = (function (e) {
    function t() {
      for (var t, n = arguments.length, i = new Array(n), r = 0; r < n; r++) i[r] = arguments[r];
      return (
        ((t = e.call.apply(e, [this].concat(i)) || this).EVENT_CHANGE = "a1"),
        (t.EVENT_FULL_SCREEN = "a2"),
        (t.EVENT_VIEW_CHANGE = "a3"),
        (t.EVENT_KEY_DOWN = "a4"),
        (t.EVENT_EDITOR_KEY_DOWN = "a5"),
        (t.EVENT_FOCUS = "a5"),
        (t.EVENT_BLUR = "a6"),
        (t.EVENT_SCROLL = "a7"),
        (t.EVENT_LANG_CHANGE = "b1"),
        t
      );
    }
    return (tMt(t, e), t);
  })(fVt.EventEmitter),
  eJt = new JQt();
const tJt = {
    clearTip: "Are you sure you want to clear all contents?",
    btnHeader: "Header",
    btnClear: "Clear",
    btnBold: "Bold",
    btnItalic: "Italic",
    btnUnderline: "Underline",
    btnStrikethrough: "Strikethrough",
    btnUnordered: "Unordered list",
    btnOrdered: "Ordered list",
    btnQuote: "Quote",
    btnLineBreak: "Line break",
    btnInlineCode: "Inline code",
    btnCode: "Code",
    btnTable: "Table",
    btnImage: "Image",
    btnLink: "Link",
    btnUndo: "Undo",
    btnRedo: "Redo",
    btnFullScreen: "Full screen",
    btnExitFullScreen: "Exit full screen",
    btnModeEditor: "Only display editor",
    btnModePreview: "Only display preview",
    btnModeAll: "Display both editor and preview",
    selectTabMap: "Actual input when typing a Tab key",
    tab: "Tab",
    spaces: "Spaces",
  },
  nJt = {
    clearTip: "您确定要清空所有内容吗？",
    btnHeader: "标题",
    btnClear: "清空",
    btnBold: "加粗",
    btnItalic: "斜体",
    btnUnderline: "下划线",
    btnStrikethrough: "删除线",
    btnUnordered: "无序列表",
    btnOrdered: "有序列表",
    btnQuote: "引用",
    btnLineBreak: "换行",
    btnInlineCode: "行内代码",
    btnCode: "代码块",
    btnTable: "表格",
    btnImage: "图片",
    btnLink: "链接",
    btnUndo: "撤销",
    btnRedo: "重做",
    btnFullScreen: "全屏",
    btnExitFullScreen: "退出全屏",
    btnModeEditor: "仅显示编辑器",
    btnModePreview: "仅显示预览",
    btnModeAll: "显示编辑器与预览",
    selectTabMap: "按下 Tab 键时实际的输入",
    tab: "制表符",
    spaces: "空格",
  };
var iJt = (function () {
    function e() {
      ((this.langs = { enUS: tJt, zhCN: nJt }), (this.current = "enUS"), this.setUp());
    }
    var t = e.prototype;
    return (
      (t.setUp = function () {
        if ("undefined" != typeof window) {
          var e = "enUS";
          if (navigator.language) {
            var t = navigator.language.split("-");
            ((e = t[0]), 1 !== t.length && (e += t[t.length - 1].toUpperCase()));
          }
          if (navigator.browserLanguage) {
            var n = navigator.browserLanguage.split("-");
            ((e = n[0]), n[1] && (e += n[1].toUpperCase()));
          }
          this.current !== e &&
            this.isAvailable(e) &&
            ((this.current = e), eJt.emit(eJt.EVENT_LANG_CHANGE, this, e, this.langs[e]));
        }
      }),
      (t.isAvailable = function (e) {
        return void 0 !== this.langs[e];
      }),
      (t.add = function (e, t) {
        this.langs[e] = t;
      }),
      (t.setCurrent = function (e) {
        if (!this.isAvailable(e)) throw new Error("Language " + e + " is not exists");
        this.current !== e &&
          ((this.current = e), eJt.emit(eJt.EVENT_LANG_CHANGE, this, e, this.langs[e]));
      }),
      (t.get = function (e, t) {
        var n = this.langs[this.current][e] || "";
        return (
          t &&
            Object.keys(t).forEach(function (e) {
              n = n.replace(new RegExp("\\{" + e + "\\}", "g"), t[e]);
            }),
          n
        );
      }),
      (t.getCurrent = function () {
        return this.current;
      }),
      e
    );
  })(),
  rJt = new iJt();
function oJt(e) {
  return (
    (oJt =
      "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
        ? function (e) {
            return typeof e;
          }
        : function (e) {
            return e &&
              "function" == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? "symbol"
              : typeof e;
          }),
    oJt(e)
  );
}
function sJt(e) {
  var t = (function (e, t) {
    if ("object" != oJt(e) || !e) return e;
    var n = e[Symbol.toPrimitive];
    if (void 0 !== n) {
      var i = n.call(e, t);
      if ("object" != oJt(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(e);
  })(e, "string");
  return "symbol" == oJt(t) ? t : t + "";
}
function aJt(e, t, n) {
  return (
    t &&
      (function (e, t) {
        for (var n = 0; n < t.length; n++) {
          var i = t[n];
          ((i.enumerable = i.enumerable || !1),
            (i.configurable = !0),
            "value" in i && (i.writable = !0),
            Object.defineProperty(e, sJt(i.key), i));
        }
      })(e.prototype, t),
    Object.defineProperty(e, "prototype", { writable: !1 }),
    e
  );
}
var lJt = (function (e) {
  function t() {
    return e.apply(this, arguments) || this;
  }
  return (
    tMt(t, e),
    (t.prototype.getConfig = function (e, t) {
      return void 0 !== this.props.config[e] && null !== this.props.config[e]
        ? this.props.config[e]
        : t;
    }),
    aJt(t, [
      {
        key: "editor",
        get: function () {
          return this.props.editor;
        },
      },
      {
        key: "editorConfig",
        get: function () {
          return this.props.editorConfig;
        },
      },
    ]),
    t
  );
})(H.Component);
((lJt.pluginName = ""), (lJt.align = "left"), (lJt.defaultConfig = {}));
var cJt = (function (e) {
  function t() {
    return e.apply(this, arguments) || this;
  }
  return (
    tMt(t, e),
    (t.prototype.render = function () {
      return H.createElement("span", { className: "rc-md-divider" });
    }),
    t
  );
})(lJt);
cJt.pluginName = "divider";
var dJt = { start: 0, end: 0, text: "" };
function uJt(e, t) {
  var n = ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
  if (n) return (n = n.call(e)).next.bind(n);
  if (
    Array.isArray(e) ||
    (n = (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return hJt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return hJt(e, t);
    })(e)) ||
    t
  ) {
    n && (e = n);
    var i = 0;
    return function () {
      return i >= e.length ? { done: !0 } : { done: !1, value: e[i++] };
    };
  }
  throw new TypeError(
    "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
  );
}
function hJt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
function gJt(e) {
  return (
    e &&
    (e instanceof Promise ||
      (("object" == typeof e || "function" == typeof e) && "function" == typeof e.then))
  );
}
function pJt(e, t) {
  for (var n = "", i = t; i--; ) n += e;
  return n;
}
function fJt(e, t) {
  var n = t.withKey,
    i = t.keyCode,
    r = t.key,
    o = t.aliasCommand,
    s = {
      ctrlKey: e.ctrlKey,
      metaKey: e.metaKey,
      altKey: e.altKey,
      shiftKey: e.shiftKey,
      keyCode: e.keyCode,
      key: e.key,
    };
  if ((o && (s.ctrlKey = s.ctrlKey || s.metaKey), n && n.length > 0))
    for (var a, l = uJt(n); !(a = l()).done; ) {
      var c = a.value;
      if (void 0 !== s[c] && !s[c]) return !1;
    }
  else if (s.metaKey || s.ctrlKey || s.shiftKey || s.altKey) return !1;
  return s.key ? s.key === r : s.keyCode === i;
}
function mJt(e, t) {
  var n = e.split("\n"),
    i = e.substr(0, t).split("\n"),
    r = i.length,
    o = i[i.length - 1].length,
    s = n[i.length - 1],
    a = i.length > 1 ? i[i.length - 2] : null,
    l = n.length > i.length ? n[i.length] : null;
  return {
    line: r,
    col: o,
    beforeText: e.substr(0, t),
    afterText: e.substr(t),
    curLine: s,
    prevLine: a,
    nextLine: l,
  };
}
for (
  var _Jt = {
      bold: ["**", "**"],
      italic: ["*", "*"],
      underline: ["++", "++"],
      strikethrough: ["~~", "~~"],
      quote: ["\n> ", "\n"],
      inlinecode: ["`", "`"],
      code: ["\n```\n", "\n```\n"],
    },
    vJt = 1;
  vJt <= 6;
  vJt++
)
  _Jt["h" + vJt] = ["\n" + pJt("#", vJt) + " ", "\n"];
function bJt(e) {
  for (
    var t = e.row,
      n = void 0 === t ? 2 : t,
      i = e.col,
      r = void 0 === i ? 2 : i,
      o = ["|"],
      s = ["|"],
      a = ["|"],
      l = "",
      c = 1;
    c <= r;
    c++
  )
    (o.push(" Head |"), a.push(" --- |"), s.push(" Data |"));
  for (var d = 1; d <= n; d++) l += "\n" + s.join("");
  return o.join("") + "\n" + a.join("") + l;
}
function yJt(e, t) {
  var n = t;
  if (("\n" !== n.substr(0, 1) && (n = "\n" + n), "unordered" === e))
    return n.length > 1 ? n.replace(/\n/g, "\n* ").trim() : "* ";
  var i = 1;
  return n.length > 1
    ? n
        .replace(/\n/g, function () {
          return "\n" + i++ + ". ";
        })
        .trim()
    : "1. ";
}
function xJt(e, t) {
  return { text: e, newBlock: t, selection: { start: e.length, end: e.length } };
}
function wJt(e, t, n) {
  if (void 0 !== _Jt[t])
    return {
      text: "" + _Jt[t][0] + e + _Jt[t][1],
      selection: { start: _Jt[t][0].length, end: _Jt[t][0].length + e.length },
    };
  switch (t) {
    case "tab":
      var i = 1 === n.tabMapValue ? "\t" : " ".repeat(n.tabMapValue),
        r = i + e.replace(/\n/g, "\n" + i),
        o = e.includes("\n") ? e.match(/\n/g).length : 0;
      return {
        text: r,
        selection: { start: n.tabMapValue, end: n.tabMapValue * (o + 1) + e.length },
      };
    case "unordered":
      return xJt(yJt("unordered", e), !0);
    case "order":
      return xJt(yJt("order", e), !0);
    case "hr":
      return xJt("---", !0);
    case "table":
      return { text: bJt(n), newBlock: !0 };
    case "image":
      return {
        text: "![" + (e || n.target) + "](" + (n.imageUrl || "") + ")",
        selection: { start: 2, end: e.length + 2 },
      };
    case "link":
      return {
        text: "[" + e + "](" + (n.linkUrl || "") + ")",
        selection: { start: 1, end: e.length + 1 },
      };
  }
  return { text: e, selection: { start: 0, end: e.length } };
}
function CJt(e, t) {
  var n = {};
  return (
    Object.keys(e).forEach(function (i) {
      void 0 !== t[i]
        ? "object" != typeof t[i]
          ? (n[i] = t[i])
          : Array.isArray(t[i])
            ? (n[i] = [].concat(t[i]))
            : (n[i] = CJt(e[i], t[i]))
        : (n[i] = e[i]);
    }),
    n
  );
}
function SJt(e) {
  for (
    var t = Nlt({}, e), n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), r = 1;
    r < n;
    r++
  )
    i[r - 1] = arguments[r];
  return (
    i.forEach(function (e) {
      "object" == typeof e && (t = CJt(t, e));
    }),
    t
  );
}
function kJt(e, t) {
  var n = wJt("", "image", { target: "Uploading_" + ZQt(), imageUrl: "" }).text,
    i = new Promise(function (n) {
      var i = function (t) {
          n(wJt("", "image", { target: e.name, imageUrl: t }).text);
        },
        r = t(e, i);
      gJt(r) && r.then(i);
    });
  return { placeholder: n, uploaded: i };
}
var EJt = {
    theme: "default",
    view: { menu: !0, md: !0, html: !0 },
    canView: { menu: !0, md: !0, html: !0, both: !0, fullScreen: !0, hideMenu: !0 },
    htmlClass: "",
    markdownClass: "",
    syncScrollMode: ["rightFollowLeft", "leftFollowRight"],
    imageUrl: "",
    imageAccept: "",
    linkUrl: "",
    loggerMaxSize: 100,
    loggerInterval: 600,
    table: { maxRow: 4, maxCol: 6 },
    allowPasteImage: !0,
    onImageUpload: void 0,
    onCustomImageUpload: void 0,
    shortcuts: !0,
    onChangeTrigger: "both",
  },
  NJt = (function (e) {
    function t() {
      return e.apply(this, arguments) || this;
    }
    tMt(t, e);
    var n = t.prototype;
    return (
      (n.getHtml = function () {
        return "string" == typeof this.props.html
          ? this.props.html
          : this.el.current
            ? this.el.current.innerHTML
            : "";
      }),
      (n.render = function () {
        return "string" == typeof this.props.html
          ? H.createElement("div", {
              ref: this.el,
              dangerouslySetInnerHTML: { __html: this.props.html },
              className: this.props.className || "custom-html-style",
            })
          : H.createElement(
              "div",
              { ref: this.el, className: this.props.className || "custom-html-style" },
              this.props.html,
            );
      }),
      t
    );
  })(
    (function (e) {
      function t(t) {
        var n;
        return (((n = e.call(this, t) || this).el = H.createRef()), n);
      }
      tMt(t, e);
      var n = t.prototype;
      return (
        (n.getElement = function () {
          return this.el.current;
        }),
        (n.getHeight = function () {
          return this.el.current ? this.el.current.offsetHeight : 0;
        }),
        t
      );
    })(H.Component),
  );
function LJt(e, t) {
  var n = ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
  if (n) return (n = n.call(e)).next.bind(n);
  if (
    Array.isArray(e) ||
    (n = (function (e, t) {
      if (!e) return;
      if ("string" == typeof e) return DJt(e, t);
      var n = Object.prototype.toString.call(e).slice(8, -1);
      "Object" === n && e.constructor && (n = e.constructor.name);
      if ("Map" === n || "Set" === n) return Array.from(e);
      if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return DJt(e, t);
    })(e)) ||
    t
  ) {
    n && (e = n);
    var i = 0;
    return function () {
      return i >= e.length ? { done: !0 } : { done: !1, value: e[i++] };
    };
  }
  throw new TypeError(
    "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
  );
}
function DJt(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
  return i;
}
var TJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).nodeMdText = H.createRef()),
      (n.nodeMdPreview = H.createRef()),
      (n.nodeMdPreviewWrapper = H.createRef()),
      (n.hasContentChanged = !0),
      (n.composing = !1),
      (n.pluginApis = new Map()),
      (n.scrollScale = 1),
      (n.isSyncingScroll = !1),
      (n.shouldSyncScroll = "md"),
      (n.keyboardListeners = []),
      (n.emitter = new JQt()),
      (n.config = SJt(EJt, n.props.config, n.props)),
      (n.state = {
        text: (n.props.value || n.props.defaultValue || "").replace(/↵/g, "\n"),
        html: "",
        view: n.config.view || EJt.view,
        fullScreen: !1,
        plugins: n.getPlugins(),
      }),
      n.config.canView && !n.config.canView.menu && (n.state.view.menu = !1),
      (n.nodeMdText = H.createRef()),
      (n.nodeMdPreviewWrapper = H.createRef()),
      (n.handleChange = n.handleChange.bind(nMt(n))),
      (n.handlePaste = n.handlePaste.bind(nMt(n))),
      (n.handleDrop = n.handleDrop.bind(nMt(n))),
      (n.handleToggleMenu = n.handleToggleMenu.bind(nMt(n))),
      (n.handleKeyDown = n.handleKeyDown.bind(nMt(n))),
      (n.handleEditorKeyDown = n.handleEditorKeyDown.bind(nMt(n))),
      (n.handleLocaleUpdate = n.handleLocaleUpdate.bind(nMt(n))),
      (n.handleFocus = n.handleFocus.bind(nMt(n))),
      (n.handleBlur = n.handleBlur.bind(nMt(n))),
      (n.handleInputScroll = n.handleSyncScroll.bind(nMt(n), "md")),
      (n.handlePreviewScroll = n.handleSyncScroll.bind(nMt(n), "html")),
      n
    );
  }
  (tMt(t, e),
    (t.use = function (e, n) {
      void 0 === n && (n = {});
      for (var i = 0; i < t.plugins.length; i++)
        if (t.plugins[i].comp === e) return void t.plugins.splice(i, 1, { comp: e, config: n });
      t.plugins.push({ comp: e, config: n });
    }),
    (t.unuse = function (e) {
      for (var n = 0; n < t.plugins.length; n++)
        if (t.plugins[n].comp === e) return void t.plugins.splice(n, 1);
    }),
    (t.unuseAll = function () {
      t.plugins = [];
    }));
  var n = t.prototype;
  return (
    (n.componentDidMount = function () {
      var e = this.state.text;
      (this.renderHTML(e), eJt.on(eJt.EVENT_LANG_CHANGE, this.handleLocaleUpdate), rJt.setUp());
    }),
    (n.componentWillUnmount = function () {
      eJt.off(eJt.EVENT_LANG_CHANGE, this.handleLocaleUpdate);
    }),
    (n.componentDidUpdate = function (e) {
      if (void 0 !== this.props.value && this.props.value !== this.state.text) {
        var t = this.props.value;
        ("string" != typeof t && (t = String(t).toString()),
          (t = t.replace(/↵/g, "\n")),
          this.state.text !== t && (this.setState({ text: t }), this.renderHTML(t)));
      }
      e.plugins !== this.props.plugins && this.setState({ plugins: this.getPlugins() });
    }),
    (n.isComposing = function () {
      return this.composing;
    }),
    (n.getPlugins = function () {
      var e = this,
        n = [];
      if (this.props.plugins)
        for (
          var i,
            r = function (e) {
              if (e !== cJt.pluginName)
                for (var i, r = LJt(t.plugins); !(i = r()).done; ) {
                  var o = i.value;
                  if (o.comp.pluginName === e) return void n.push(o);
                }
              else n.push({ comp: cJt, config: {} });
            },
            o = LJt(this.props.plugins);
          !(i = o()).done;
        ) {
          var s = i.value;
          "fonts" === s
            ? (r("font-bold"),
              r("font-italic"),
              r("font-underline"),
              r("font-strikethrough"),
              r("list-unordered"),
              r("list-ordered"),
              r("block-quote"),
              r("block-wrap"),
              r("block-code-inline"),
              r("block-code-block"))
            : r(s);
        }
      else n = [].concat(t.plugins);
      var a = {};
      return (
        n.forEach(function (t) {
          void 0 === a[t.comp.align] && (a[t.comp.align] = []);
          var n = "divider" === t.comp.pluginName ? ZQt() : t.comp.pluginName;
          a[t.comp.align].push(
            H.createElement(t.comp, {
              editor: e,
              editorConfig: e.config,
              config: Nlt({}, t.comp.defaultConfig || {}, t.config || {}),
              key: n,
            }),
          );
        }),
        a
      );
    }),
    (n.handleSyncScroll = function (e, t) {
      var n = this;
      if (e === this.shouldSyncScroll) {
        (this.props.onScroll && this.props.onScroll(t, e),
          this.emitter.emit(this.emitter.EVENT_SCROLL, t, e));
        var i = this.config.syncScrollMode;
        (void 0 === i ? [] : i).includes("md" === e ? "rightFollowLeft" : "leftFollowRight") &&
          (this.hasContentChanged &&
            this.nodeMdText.current &&
            this.nodeMdPreviewWrapper.current &&
            ((this.scrollScale =
              this.nodeMdText.current.scrollHeight /
              this.nodeMdPreviewWrapper.current.scrollHeight),
            (this.hasContentChanged = !1)),
          this.isSyncingScroll ||
            ((this.isSyncingScroll = !0),
            requestAnimationFrame(function () {
              (n.nodeMdText.current &&
                n.nodeMdPreviewWrapper.current &&
                ("md" === e
                  ? (n.nodeMdPreviewWrapper.current.scrollTop =
                      n.nodeMdText.current.scrollTop / n.scrollScale)
                  : (n.nodeMdText.current.scrollTop =
                      n.nodeMdPreviewWrapper.current.scrollTop * n.scrollScale)),
                (n.isSyncingScroll = !1));
            })));
      }
    }),
    (n.renderHTML = function (e) {
      var t = this;
      if (!this.props.renderHTML) return Promise.resolve();
      var n = this.props.renderHTML(e);
      return gJt(n)
        ? n.then(function (e) {
            return t.setHtml(e);
          })
        : "function" == typeof n
          ? this.setHtml(n())
          : this.setHtml(n);
    }),
    (n.setHtml = function (e) {
      var t = this;
      return new Promise(function (n) {
        t.setState({ html: e }, n);
      });
    }),
    (n.handleToggleMenu = function () {
      this.setView({ menu: !this.state.view.menu });
    }),
    (n.handleFocus = function (e) {
      var t = this.props.onFocus;
      (t && t(e), this.emitter.emit(this.emitter.EVENT_FOCUS, e));
    }),
    (n.handleBlur = function (e) {
      var t = this.props.onBlur;
      (t && t(e), this.emitter.emit(this.emitter.EVENT_BLUR, e));
    }),
    (n.handleChange = function (e) {
      e.persist();
      var t = e.target.value;
      this.setText(t, e);
    }),
    (n.handlePaste = function (e) {
      if (this.config.allowPasteImage && this.config.onImageUpload) {
        var t = (e.nativeEvent.clipboardData || window.clipboardData).items;
        t && (e.preventDefault(), this.uploadWithDataTransfer(t));
      }
    }),
    (n.handleDrop = function (e) {
      if (this.config.onImageUpload) {
        var t = e.nativeEvent;
        if (t.dataTransfer) {
          var n = t.dataTransfer.items;
          n && (e.preventDefault(), this.uploadWithDataTransfer(n));
        }
      }
    }),
    (n.handleEditorKeyDown = function (e) {
      var t = this,
        n = e.keyCode,
        i = e.key,
        r = e.currentTarget;
      if ((13 === n || "Enter" === i) && !1 === this.composing) {
        var o = r.value,
          s = r.selectionStart,
          a = mJt(o, s),
          l = function () {
            var n = r.value.substr(0, s - a.curLine.length) + r.value.substr(s);
            (t.setText(n, void 0, { start: s - a.curLine.length, end: s - a.curLine.length }),
              e.preventDefault());
          },
          c = function (n) {
            (t.insertText("\n" + n, !1, { start: n.length + 1, end: n.length + 1 }),
              e.preventDefault());
          },
          d = a.curLine.match(/^(\s*?)\* /);
        if (d) return /^(\s*?)\* $/.test(a.curLine) ? void l() : void c(d[0]);
        var u = a.curLine.match(/^(\s*?)(\d+)\. /);
        if (u)
          return /^(\s*?)(\d+)\. $/.test(a.curLine)
            ? void l()
            : void c("" + u[1] + (parseInt(u[2], 10) + 1) + ". ");
      }
      this.emitter.emit(this.emitter.EVENT_EDITOR_KEY_DOWN, e);
    }),
    (n.handleLocaleUpdate = function () {
      this.forceUpdate();
    }),
    (n.getMdElement = function () {
      return this.nodeMdText.current;
    }),
    (n.getHtmlElement = function () {
      return this.nodeMdPreviewWrapper.current;
    }),
    (n.clearSelection = function () {
      this.nodeMdText.current && this.nodeMdText.current.setSelectionRange(0, 0, "none");
    }),
    (n.getSelection = function () {
      var e = this.nodeMdText.current;
      if (!e) return Nlt({}, dJt);
      var t = e.selectionStart,
        n = e.selectionEnd;
      return { start: t, end: n, text: (e.value || "").slice(t, n) };
    }),
    (n.setSelection = function (e) {
      this.nodeMdText.current &&
        (this.nodeMdText.current.setSelectionRange(e.start, e.end, "forward"),
        this.nodeMdText.current.focus());
    }),
    (n.insertMarkdown = function (e, t) {
      void 0 === t && (t = {});
      var n = this.getSelection(),
        i = t ? Nlt({}, t) : {};
      if (
        ("image" === e &&
          (i = Nlt({}, i, {
            target: t.target || n.text || "",
            imageUrl: t.imageUrl || this.config.imageUrl,
          })),
        "link" === e && (i = Nlt({}, i, { linkUrl: this.config.linkUrl })),
        "tab" === e && n.start !== n.end)
      ) {
        var r = this.getMdValue().slice(0, n.start).lastIndexOf("\n") + 1;
        this.setSelection({ start: r, end: n.end });
      }
      var o = wJt(n.text, e, i),
        s = o.text,
        a = o.selection;
      if (o.newBlock) {
        var l = mJt(this.getMdValue(), n.start),
          c = l.col,
          d = l.curLine;
        c > 0 && d.length > 0 && ((s = "\n" + s), a && (a.start++, a.end++));
        var u = l.afterText;
        (n.start !== n.end && (u = mJt(this.getMdValue(), n.end).afterText),
          "" !== u.trim() &&
            "\n\n" !== u.substr(0, 2) &&
            ("\n" !== u.substr(0, 1) && (s += "\n"), (s += "\n")));
      }
      this.insertText(s, !0, a);
    }),
    (n.insertPlaceholder = function (e, t) {
      var n = this;
      (this.insertText(e, !0),
        t.then(function (t) {
          var i = n.getMdValue().replace(e, t);
          n.setText(i);
        }));
    }),
    (n.insertText = function (e, t, n) {
      (void 0 === e && (e = ""), void 0 === t && (t = !1));
      var i = this.state.text,
        r = this.getSelection(),
        o = i.slice(0, r.start),
        s = i.slice(t ? r.end : r.start, i.length);
      this.setText(
        o + e + s,
        void 0,
        n ? { start: n.start + o.length, end: n.end + o.length } : { start: r.start, end: r.start },
      );
    }),
    (n.setText = function (e, t, n) {
      var i = this;
      void 0 === e && (e = "");
      var r = this.config.onChangeTrigger,
        o = void 0 === r ? "both" : r,
        s = e.replace(/↵/g, "\n");
      if (this.state.text !== e) {
        (this.setState({ text: s }),
          !this.props.onChange ||
            ("both" !== o && "beforeRender" !== o) ||
            this.props.onChange({ text: s, html: this.getHtmlValue() }, t),
          this.emitter.emit(this.emitter.EVENT_CHANGE, e, t, void 0 === t),
          n &&
            setTimeout(function () {
              return i.setSelection(n);
            }),
          this.hasContentChanged || (this.hasContentChanged = !0));
        var a = this.renderHTML(s);
        ("both" !== o && "afterRender" !== o) ||
          a.then(function () {
            i.props.onChange && i.props.onChange({ text: i.state.text, html: i.getHtmlValue() }, t);
          });
      }
    }),
    (n.getMdValue = function () {
      return this.state.text;
    }),
    (n.getHtmlValue = function () {
      return "string" == typeof this.state.html
        ? this.state.html
        : this.nodeMdPreview.current
          ? this.nodeMdPreview.current.getHtml()
          : "";
    }),
    (n.onKeyboard = function (e) {
      var t = this;
      Array.isArray(e)
        ? e.forEach(function (e) {
            return t.onKeyboard(e);
          })
        : this.keyboardListeners.includes(e) || this.keyboardListeners.push(e);
    }),
    (n.offKeyboard = function (e) {
      var t = this;
      if (Array.isArray(e))
        e.forEach(function (e) {
          return t.offKeyboard(e);
        });
      else {
        var n = this.keyboardListeners.indexOf(e);
        n >= 0 && this.keyboardListeners.splice(n, 1);
      }
    }),
    (n.handleKeyDown = function (e) {
      for (var t, n = LJt(this.keyboardListeners); !(t = n()).done; ) {
        var i = t.value;
        if (fJt(e, i)) return (e.preventDefault(), void i.callback(e));
      }
      this.emitter.emit(this.emitter.EVENT_KEY_DOWN, e);
    }),
    (n.getEventType = function (e) {
      switch (e) {
        case "change":
          return this.emitter.EVENT_CHANGE;
        case "fullscreen":
          return this.emitter.EVENT_FULL_SCREEN;
        case "viewchange":
          return this.emitter.EVENT_VIEW_CHANGE;
        case "keydown":
          return this.emitter.EVENT_KEY_DOWN;
        case "editor_keydown":
          return this.emitter.EVENT_EDITOR_KEY_DOWN;
        case "blur":
          return this.emitter.EVENT_BLUR;
        case "focus":
          return this.emitter.EVENT_FOCUS;
        case "scroll":
          return this.emitter.EVENT_SCROLL;
      }
    }),
    (n.on = function (e, t) {
      var n = this.getEventType(e);
      n && this.emitter.on(n, t);
    }),
    (n.off = function (e, t) {
      var n = this.getEventType(e);
      n && this.emitter.off(n, t);
    }),
    (n.setView = function (e) {
      var t = this,
        n = Nlt({}, this.state.view, e);
      this.setState({ view: n }, function () {
        t.emitter.emit(t.emitter.EVENT_VIEW_CHANGE, n);
      });
    }),
    (n.getView = function () {
      return Nlt({}, this.state.view);
    }),
    (n.fullScreen = function (e) {
      var t = this;
      this.state.fullScreen !== e &&
        this.setState({ fullScreen: e }, function () {
          t.emitter.emit(t.emitter.EVENT_FULL_SCREEN, e);
        });
    }),
    (n.registerPluginApi = function (e, t) {
      this.pluginApis.set(e, t);
    }),
    (n.unregisterPluginApi = function (e) {
      this.pluginApis.delete(e);
    }),
    (n.callPluginApi = function (e) {
      var t = this.pluginApis.get(e);
      if (!t) throw new Error("API " + e + " not found");
      for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++)
        i[r - 1] = arguments[r];
      return t.apply(void 0, i);
    }),
    (n.isFullScreen = function () {
      return this.state.fullScreen;
    }),
    (n.uploadWithDataTransfer = function (e) {
      var t = this,
        n = this.config.onImageUpload;
      if (n) {
        var i = [];
        (Array.prototype.forEach.call(e, function (e) {
          if ("file" === e.kind && e.type.includes("image")) {
            var r = e.getAsFile();
            if (r) {
              var o = kJt(r, n);
              (i.push(Promise.resolve(o.placeholder)),
                o.uploaded.then(function (e) {
                  var n = t.getMdValue().replace(o.placeholder, e),
                    i = e.length - o.placeholder.length,
                    r = t.getSelection();
                  t.setText(n, void 0, { start: r.start + i, end: r.start + i });
                }));
            }
          } else
            "string" === e.kind &&
              "text/plain" === e.type &&
              i.push(
                new Promise(function (t) {
                  return e.getAsString(t);
                }),
              );
        }),
          Promise.all(i).then(function (e) {
            var n = e.join(""),
              i = t.getSelection();
            t.insertText(n, !0, { start: i.start === i.end ? n.length : 0, end: n.length });
          }));
      }
    }),
    (n.render = function () {
      var e = this,
        t = this.state,
        n = t.view,
        i = t.fullScreen,
        r = t.text,
        o = t.html,
        s = this.props,
        a = s.id,
        l = s.className,
        c = void 0 === l ? "" : l,
        d = s.style,
        u = s.name,
        h = void 0 === u ? "textarea" : u,
        g = s.autoFocus,
        p = s.placeholder,
        f = s.readOnly,
        m = this.config.canView && this.config.canView.hideMenu && !this.config.canView.menu,
        _ = function (t) {
          return e.state.plugins[t] || [];
        },
        v = !!n.menu,
        b = a ? a + "_md" : void 0,
        y = a ? a + "_html" : void 0;
      return H.createElement(
        "div",
        {
          id: a,
          className: "rc-md-editor " + (i ? "full" : "") + " " + c,
          style: d,
          onKeyDown: this.handleKeyDown,
          onDrop: this.handleDrop,
        },
        H.createElement(XQt, { visible: v, left: _("left"), right: _("right") }),
        H.createElement(
          "div",
          { className: "editor-container" },
          m &&
            H.createElement(
              QQt,
              null,
              H.createElement(
                "span",
                {
                  className: "button button-type-menu",
                  title: v ? "hidden menu" : "show menu",
                  onClick: this.handleToggleMenu,
                },
                H.createElement(YQt, { type: "expand-" + (v ? "less" : "more") }),
              ),
            ),
          H.createElement(
            "section",
            { className: "section sec-md " + (n.md ? "visible" : "in-visible") },
            H.createElement("textarea", {
              id: b,
              ref: this.nodeMdText,
              name: h,
              autoFocus: g,
              placeholder: p,
              readOnly: f,
              value: r,
              className: "section-container input " + (this.config.markdownClass || ""),
              wrap: "hard",
              onChange: this.handleChange,
              onScroll: this.handleInputScroll,
              onMouseOver: function () {
                return (e.shouldSyncScroll = "md");
              },
              onKeyDown: this.handleEditorKeyDown,
              onCompositionStart: function () {
                return (e.composing = !0);
              },
              onCompositionEnd: function () {
                return (e.composing = !1);
              },
              onPaste: this.handlePaste,
              onFocus: this.handleFocus,
              onBlur: this.handleBlur,
            }),
          ),
          H.createElement(
            "section",
            { className: "section sec-html " + (n.html ? "visible" : "in-visible") },
            H.createElement(
              "div",
              {
                id: y,
                className: "section-container html-wrap",
                ref: this.nodeMdPreviewWrapper,
                onMouseOver: function () {
                  return (e.shouldSyncScroll = "html");
                },
                onScroll: this.handlePreviewScroll,
              },
              H.createElement(NJt, {
                html: o,
                className: this.config.htmlClass,
                ref: this.nodeMdPreview,
              }),
            ),
          ),
        ),
      );
    }),
    t
  );
})(H.Component);
((TJt.plugins = []),
  (TJt.addLocale = rJt.add.bind(rJt)),
  (TJt.useLocale = rJt.setCurrent.bind(rJt)),
  (TJt.getLocale = rJt.getCurrent.bind(rJt)));
var IJt = (function (e) {
  function t() {
    return e.apply(this, arguments) || this;
  }
  return (
    tMt(t, e),
    (t.prototype.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-code-block",
          title: rJt.get("btnCode"),
          onClick: function () {
            return e.editor.insertMarkdown("code");
          },
        },
        H.createElement(YQt, { type: "code-block" }),
      );
    }),
    t
  );
})(lJt);
IJt.pluginName = "block-code-block";
var RJt = (function (e) {
  function t() {
    return e.apply(this, arguments) || this;
  }
  return (
    tMt(t, e),
    (t.prototype.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-code-inline",
          title: rJt.get("btnInlineCode"),
          onClick: function () {
            return e.editor.insertMarkdown("inlinecode");
          },
        },
        H.createElement(YQt, { type: "code" }),
      );
    }),
    t
  );
})(lJt);
RJt.pluginName = "block-code-inline";
var OJt = (function (e) {
  function t() {
    return e.apply(this, arguments) || this;
  }
  return (
    tMt(t, e),
    (t.prototype.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-quote",
          title: rJt.get("btnQuote"),
          onClick: function () {
            return e.editor.insertMarkdown("quote");
          },
        },
        H.createElement(YQt, { type: "quote" }),
      );
    }),
    t
  );
})(lJt);
OJt.pluginName = "block-quote";
var MJt = (function (e) {
  function t() {
    return e.apply(this, arguments) || this;
  }
  return (
    tMt(t, e),
    (t.prototype.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-wrap",
          title: rJt.get("btnLineBreak"),
          onClick: function () {
            return e.editor.insertMarkdown("hr");
          },
        },
        H.createElement(YQt, { type: "wrap" }),
      );
    }),
    t
  );
})(lJt);
MJt.pluginName = "block-wrap";
var AJt = (function (e) {
  function t(t) {
    var n;
    return (((n = e.call(this, t) || this).handleClick = n.handleClick.bind(nMt(n))), n);
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.handleClick = function () {
      "" !== this.editor.getMdValue() &&
        window.confirm &&
        "function" == typeof window.confirm &&
        window.confirm(rJt.get("clearTip")) &&
        this.editor.setText("");
    }),
    (n.render = function () {
      return H.createElement(
        "span",
        {
          className: "button button-type-clear",
          title: rJt.get("btnClear"),
          onClick: this.handleClick,
        },
        H.createElement(YQt, { type: "delete" }),
      );
    }),
    t
  );
})(lJt);
AJt.pluginName = "clear";
var PJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).handleKeyboard = {
        key: "b",
        keyCode: 66,
        aliasCommand: !0,
        withKey: ["ctrlKey"],
        callback: function () {
          return n.editor.insertMarkdown("bold");
        },
      }),
      n
    );
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.componentDidMount = function () {
      this.editorConfig.shortcuts && this.editor.onKeyboard(this.handleKeyboard);
    }),
    (n.componentWillUnmount = function () {
      this.editor.offKeyboard(this.handleKeyboard);
    }),
    (n.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-bold",
          title: rJt.get("btnBold"),
          onClick: function () {
            return e.editor.insertMarkdown("bold");
          },
        },
        H.createElement(YQt, { type: "bold" }),
      );
    }),
    t
  );
})(lJt);
PJt.pluginName = "font-bold";
var jJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).handleKeyboard = {
        key: "i",
        keyCode: 73,
        aliasCommand: !0,
        withKey: ["ctrlKey"],
        callback: function () {
          return n.editor.insertMarkdown("italic");
        },
      }),
      n
    );
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.componentDidMount = function () {
      this.editorConfig.shortcuts && this.editor.onKeyboard(this.handleKeyboard);
    }),
    (n.componentWillUnmount = function () {
      this.editor.offKeyboard(this.handleKeyboard);
    }),
    (n.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-italic",
          title: rJt.get("btnItalic"),
          onClick: function () {
            return e.editor.insertMarkdown("italic");
          },
        },
        H.createElement(YQt, { type: "italic" }),
      );
    }),
    t
  );
})(lJt);
jJt.pluginName = "font-italic";
var FJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).handleKeyboard = {
        key: "d",
        keyCode: 68,
        aliasCommand: !0,
        withKey: ["ctrlKey"],
        callback: function () {
          return n.editor.insertMarkdown("strikethrough");
        },
      }),
      n
    );
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.componentDidMount = function () {
      this.editorConfig.shortcuts && this.editor.onKeyboard(this.handleKeyboard);
    }),
    (n.componentWillUnmount = function () {
      this.editor.offKeyboard(this.handleKeyboard);
    }),
    (n.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-strikethrough",
          title: rJt.get("btnStrikethrough"),
          onClick: function () {
            return e.editor.insertMarkdown("strikethrough");
          },
        },
        H.createElement(YQt, { type: "strikethrough" }),
      );
    }),
    t
  );
})(lJt);
FJt.pluginName = "font-strikethrough";
var BJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).handleKeyboard = {
        key: "u",
        keyCode: 85,
        withKey: ["ctrlKey"],
        callback: function () {
          return n.editor.insertMarkdown("underline");
        },
      }),
      n
    );
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.componentDidMount = function () {
      this.editorConfig.shortcuts && this.editor.onKeyboard(this.handleKeyboard);
    }),
    (n.componentWillUnmount = function () {
      this.editor.offKeyboard(this.handleKeyboard);
    }),
    (n.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-underline",
          title: rJt.get("btnUnderline"),
          onClick: function () {
            return e.editor.insertMarkdown("underline");
          },
        },
        H.createElement(YQt, { type: "underline" }),
      );
    }),
    t
  );
})(lJt);
BJt.pluginName = "font-underline";
var VJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).handleClick = n.handleClick.bind(nMt(n))),
      (n.handleChange = n.handleChange.bind(nMt(n))),
      (n.state = { enable: n.editor.isFullScreen() }),
      n
    );
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.handleClick = function () {
      this.editor.fullScreen(!this.state.enable);
    }),
    (n.handleChange = function (e) {
      this.setState({ enable: e });
    }),
    (n.componentDidMount = function () {
      this.editor.on("fullscreen", this.handleChange);
    }),
    (n.componentWillUnmount = function () {
      this.editor.off("fullscreen", this.handleChange);
    }),
    (n.render = function () {
      if (this.editorConfig.canView && this.editorConfig.canView.fullScreen) {
        var e = this.state.enable;
        return H.createElement(
          "span",
          {
            className: "button button-type-fullscreen",
            title: rJt.get(e ? "btnExitFullScreen" : "btnFullScreen"),
            onClick: this.handleClick,
          },
          H.createElement(YQt, { type: e ? "fullscreen-exit" : "fullscreen" }),
        );
      }
      return null;
    }),
    t
  );
})(lJt);
((VJt.pluginName = "full-screen"), (VJt.align = "right"));
var WJt = (function (e) {
    function t(t) {
      var n;
      return (((n = e.call(this, t) || this).handleClose = n.handleClose.bind(nMt(n))), n);
    }
    tMt(t, e);
    var n = t.prototype;
    return (
      (n.handleClose = function (e) {
        e.stopPropagation();
        var t = this.props.onClose;
        "function" == typeof t && t();
      }),
      (n.render = function () {
        return H.createElement(
          "div",
          {
            className: "drop-wrap " + (this.props.show ? "show" : "hidden"),
            onClick: this.handleClose,
          },
          this.props.children,
        );
      }),
      t
    );
  })(H.Component),
  HJt = (function (e) {
    function t() {
      return e.apply(this, arguments) || this;
    }
    tMt(t, e);
    var n = t.prototype;
    return (
      (n.handleHeader = function (e) {
        var t = this.props.onSelectHeader;
        "function" == typeof t && t(e);
      }),
      (n.render = function () {
        return H.createElement(
          "ul",
          { className: "header-list" },
          H.createElement(
            "li",
            { className: "list-item" },
            H.createElement("h1", { onClick: this.handleHeader.bind(this, "h1") }, "H1"),
          ),
          H.createElement(
            "li",
            { className: "list-item" },
            H.createElement("h2", { onClick: this.handleHeader.bind(this, "h2") }, "H2"),
          ),
          H.createElement(
            "li",
            { className: "list-item" },
            H.createElement("h3", { onClick: this.handleHeader.bind(this, "h3") }, "H3"),
          ),
          H.createElement(
            "li",
            { className: "list-item" },
            H.createElement("h4", { onClick: this.handleHeader.bind(this, "h4") }, "H4"),
          ),
          H.createElement(
            "li",
            { className: "list-item" },
            H.createElement("h5", { onClick: this.handleHeader.bind(this, "h5") }, "H5"),
          ),
          H.createElement(
            "li",
            { className: "list-item" },
            H.createElement("h6", { onClick: this.handleHeader.bind(this, "h6") }, "H6"),
          ),
        );
      }),
      t
    );
  })(H.Component),
  zJt = (function (e) {
    function t(t) {
      var n;
      return (
        ((n = e.call(this, t) || this).show = n.show.bind(nMt(n))),
        (n.hide = n.hide.bind(nMt(n))),
        (n.state = { show: !1 }),
        n
      );
    }
    tMt(t, e);
    var n = t.prototype;
    return (
      (n.show = function () {
        this.setState({ show: !0 });
      }),
      (n.hide = function () {
        this.setState({ show: !1 });
      }),
      (n.render = function () {
        var e = this;
        return H.createElement(
          "span",
          {
            className: "button button-type-header",
            title: rJt.get("btnHeader"),
            onMouseEnter: this.show,
            onMouseLeave: this.hide,
          },
          H.createElement(YQt, { type: "font-size" }),
          H.createElement(
            WJt,
            { show: this.state.show, onClose: this.hide },
            H.createElement(HJt, {
              onSelectHeader: function (t) {
                return e.editor.insertMarkdown(t);
              },
            }),
          ),
        );
      }),
      t
    );
  })(lJt);
zJt.pluginName = "header";
var UJt = (function (e) {
    function t(t) {
      var n;
      return (
        ((n = e.call(this, t) || this).timerId = void 0),
        (n.locked = !1),
        (n.input = H.createRef()),
        n
      );
    }
    tMt(t, e);
    var n = t.prototype;
    return (
      (n.click = function () {
        var e = this;
        !this.locked &&
          this.input.current &&
          ((this.locked = !0),
          (this.input.current.value = ""),
          this.input.current.click(),
          this.timerId && window.clearTimeout(this.timerId),
          (this.timerId = window.setTimeout(function () {
            ((e.locked = !1), window.clearTimeout(e.timerId), (e.timerId = void 0));
          }, 200)));
      }),
      (n.componentWillUnmount = function () {
        this.timerId && window.clearTimeout(this.timerId);
      }),
      (n.render = function () {
        return H.createElement("input", {
          type: "file",
          ref: this.input,
          accept: this.props.accept,
          style: {
            position: "absolute",
            zIndex: -1,
            left: 0,
            top: 0,
            width: 0,
            height: 0,
            opacity: 0,
          },
          onChange: this.props.onChange,
        });
      }),
      t
    );
  })(H.Component),
  $Jt = (function (e) {
    function t(t) {
      var n;
      return (
        ((n = e.call(this, t) || this).inputFile = H.createRef()),
        (n.onImageChanged = n.onImageChanged.bind(nMt(n))),
        (n.handleCustomImageUpload = n.handleCustomImageUpload.bind(nMt(n))),
        (n.handleImageUpload = n.handleImageUpload.bind(nMt(n))),
        (n.state = { show: !1 }),
        n
      );
    }
    tMt(t, e);
    var n = t.prototype;
    return (
      (n.handleImageUpload = function () {
        "function" == typeof this.editorConfig.onImageUpload
          ? this.inputFile.current && this.inputFile.current.click()
          : this.editor.insertMarkdown("image");
      }),
      (n.onImageChanged = function (e) {
        var t = this.editorConfig.onImageUpload;
        if (t) {
          var n = kJt(e, t);
          this.editor.insertPlaceholder(n.placeholder, n.uploaded);
        }
      }),
      (n.handleCustomImageUpload = function (e) {
        var t = this,
          n = this.editorConfig.onCustomImageUpload;
        if (n) {
          var i = n.call(this, e);
          gJt(i) &&
            i.then(function (e) {
              e && e.url && t.editor.insertMarkdown("image", { target: e.text, imageUrl: e.url });
            });
        }
      }),
      (n.render = function () {
        var e = this;
        return !!this.editorConfig.onCustomImageUpload
          ? H.createElement(
              "span",
              {
                className: "button button-type-image",
                title: rJt.get("btnImage"),
                onClick: this.handleCustomImageUpload,
              },
              H.createElement(YQt, { type: "image" }),
            )
          : H.createElement(
              "span",
              {
                className: "button button-type-image",
                title: rJt.get("btnImage"),
                onClick: this.handleImageUpload,
                style: { position: "relative" },
              },
              H.createElement(YQt, { type: "image" }),
              H.createElement(UJt, {
                accept: this.editorConfig.imageAccept || "",
                ref: this.inputFile,
                onChange: function (t) {
                  (t.persist(),
                    t.target.files &&
                      t.target.files.length > 0 &&
                      e.onImageChanged(t.target.files[0]));
                },
              }),
            );
      }),
      t
    );
  })(lJt);
$Jt.pluginName = "image";
var qJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).handleKeyboard = {
        key: "k",
        keyCode: 75,
        aliasCommand: !0,
        withKey: ["ctrlKey"],
        callback: function () {
          return n.editor.insertMarkdown("link");
        },
      }),
      n
    );
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.componentDidMount = function () {
      this.editorConfig.shortcuts && this.editor.onKeyboard(this.handleKeyboard);
    }),
    (n.componentWillUnmount = function () {
      this.editor.offKeyboard(this.handleKeyboard);
    }),
    (n.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-link",
          title: rJt.get("btnLink"),
          onClick: function () {
            return e.editor.insertMarkdown("link");
          },
        },
        H.createElement(YQt, { type: "link" }),
      );
    }),
    t
  );
})(lJt);
qJt.pluginName = "link";
var KJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).handleKeyboard = {
        key: "7",
        keyCode: 55,
        withKey: ["ctrlKey", "shiftKey"],
        aliasCommand: !0,
        callback: function () {
          return n.editor.insertMarkdown("order");
        },
      }),
      n
    );
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.componentDidMount = function () {
      this.editorConfig.shortcuts && this.editor.onKeyboard(this.handleKeyboard);
    }),
    (n.componentWillUnmount = function () {
      this.editor.offKeyboard(this.handleKeyboard);
    }),
    (n.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-ordered",
          title: rJt.get("btnOrdered"),
          onClick: function () {
            return e.editor.insertMarkdown("order");
          },
        },
        H.createElement(YQt, { type: "list-ordered" }),
      );
    }),
    t
  );
})(lJt);
KJt.pluginName = "list-ordered";
var GJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).handleKeyboard = {
        key: "8",
        keyCode: 56,
        withKey: ["ctrlKey", "shiftKey"],
        aliasCommand: !0,
        callback: function () {
          return n.editor.insertMarkdown("unordered");
        },
      }),
      n
    );
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.componentDidMount = function () {
      this.editorConfig.shortcuts && this.editor.onKeyboard(this.handleKeyboard);
    }),
    (n.componentWillUnmount = function () {
      this.editor.offKeyboard(this.handleKeyboard);
    }),
    (n.render = function () {
      var e = this;
      return H.createElement(
        "span",
        {
          className: "button button-type-unordered",
          title: rJt.get("btnUnordered"),
          onClick: function () {
            return e.editor.insertMarkdown("unordered");
          },
        },
        H.createElement(YQt, { type: "list-unordered" }),
      );
    }),
    t
  );
})(lJt);
GJt.pluginName = "list-unordered";
var ZJt,
  YJt = (function () {
    function e(e) {
      (void 0 === e && (e = {}), (this.record = []), (this.recycle = []), (this.initValue = ""));
      var t = e.maxSize,
        n = void 0 === t ? 100 : t;
      this.maxSize = n;
    }
    var t = e.prototype;
    return (
      (t.push = function (e) {
        for (var t = this.record.push(e); this.record.length > this.maxSize; ) this.record.shift();
        return t;
      }),
      (t.get = function () {
        return this.record;
      }),
      (t.getLast = function () {
        var e = this.record.length;
        return this.record[e - 1];
      }),
      (t.undo = function (e) {
        var t = this.record.pop();
        if (void 0 === t) return this.initValue;
        if (t !== e) return (this.recycle.push(t), t);
        var n = this.record.pop();
        return void 0 === n ? (this.recycle.push(t), this.initValue) : (this.recycle.push(t), n);
      }),
      (t.redo = function () {
        var e = this.recycle.pop();
        if (void 0 !== e) return (this.push(e), e);
      }),
      (t.cleanRedo = function () {
        this.recycle = [];
      }),
      (t.getUndoCount = function () {
        return this.undo.length;
      }),
      (t.getRedoCount = function () {
        return this.recycle.length;
      }),
      e
    );
  })(),
  XJt = (function (e) {
    function t(t) {
      var n;
      return (
        ((n = e.call(this, t) || this).handleKeyboards = []),
        (n.lastPop = null),
        (n.handleChange = n.handleChange.bind(nMt(n))),
        (n.handleRedo = n.handleRedo.bind(nMt(n))),
        (n.handleUndo = n.handleUndo.bind(nMt(n))),
        (n.handleKeyboards = [
          { key: "y", keyCode: 89, withKey: ["ctrlKey"], callback: n.handleRedo },
          { key: "z", keyCode: 90, withKey: ["metaKey", "shiftKey"], callback: n.handleRedo },
          { key: "z", keyCode: 90, aliasCommand: !0, withKey: ["ctrlKey"], callback: n.handleUndo },
        ]),
        (n.logger = new YJt({ maxSize: n.editorConfig.loggerMaxSize })),
        n.editor.registerPluginApi("undo", n.handleUndo),
        n.editor.registerPluginApi("redo", n.handleRedo),
        n
      );
    }
    tMt(t, e);
    var n = t.prototype;
    return (
      (n.handleUndo = function () {
        var e = this.logger.undo(this.editor.getMdValue());
        void 0 !== e &&
          (this.pause(), (this.lastPop = e), this.editor.setText(e), this.forceUpdate());
      }),
      (n.handleRedo = function () {
        var e = this.logger.redo();
        void 0 !== e && ((this.lastPop = e), this.editor.setText(e), this.forceUpdate());
      }),
      (n.handleChange = function (e, t, n) {
        var i = this;
        if (this.logger.getLast() !== e && (null === this.lastPop || this.lastPop !== e)) {
          if ((this.logger.cleanRedo(), n))
            return (this.logger.push(e), (this.lastPop = null), void this.forceUpdate());
          (this.timerId && (window.clearTimeout(this.timerId), (this.timerId = 0)),
            (this.timerId = window.setTimeout(function () {
              (i.logger.getLast() !== e && (i.logger.push(e), (i.lastPop = null), i.forceUpdate()),
                window.clearTimeout(i.timerId),
                (i.timerId = 0));
            }, this.editorConfig.loggerInterval)));
        }
      }),
      (n.componentDidMount = function () {
        var e = this;
        (this.editor.on("change", this.handleChange),
          this.handleKeyboards.forEach(function (t) {
            return e.editor.onKeyboard(t);
          }),
          (this.logger.initValue = this.editor.getMdValue()),
          this.forceUpdate());
      }),
      (n.componentWillUnmount = function () {
        var e = this;
        (this.timerId && window.clearTimeout(this.timerId),
          this.editor.off("change", this.handleChange),
          this.editor.unregisterPluginApi("undo"),
          this.editor.unregisterPluginApi("redo"),
          this.handleKeyboards.forEach(function (t) {
            return e.editor.offKeyboard(t);
          }));
      }),
      (n.pause = function () {
        this.timerId && (window.clearTimeout(this.timerId), (this.timerId = void 0));
      }),
      (n.render = function () {
        var e =
            this.logger.getUndoCount() > 1 || this.logger.initValue !== this.editor.getMdValue(),
          t = this.logger.getRedoCount() > 0;
        return H.createElement(
          H.Fragment,
          null,
          H.createElement(
            "span",
            {
              className: "button button-type-undo " + (e ? "" : "disabled"),
              title: rJt.get("btnUndo"),
              onClick: this.handleUndo,
            },
            H.createElement(YQt, { type: "undo" }),
          ),
          H.createElement(
            "span",
            {
              className: "button button-type-redo " + (t ? "" : "disabled"),
              title: rJt.get("btnRedo"),
              onClick: this.handleRedo,
            },
            H.createElement(YQt, { type: "redo" }),
          ),
        );
      }),
      t
    );
  })(lJt);
((XJt.pluginName = "logger"),
  (function (e) {
    ((e[(e.SHOW_ALL = 0)] = "SHOW_ALL"),
      (e[(e.SHOW_MD = 1)] = "SHOW_MD"),
      (e[(e.SHOW_HTML = 2)] = "SHOW_HTML"));
  })(ZJt || (ZJt = {})));
var QJt = (function (e) {
  function t(t) {
    var n;
    return (
      ((n = e.call(this, t) || this).handleClick = n.handleClick.bind(nMt(n))),
      (n.handleChange = n.handleChange.bind(nMt(n))),
      (n.state = { view: n.editor.getView() }),
      n
    );
  }
  tMt(t, e);
  var n = t.prototype;
  return (
    (n.handleClick = function () {
      switch (this.next) {
        case ZJt.SHOW_ALL:
          this.editor.setView({ html: !0, md: !0 });
          break;
        case ZJt.SHOW_HTML:
          this.editor.setView({ html: !0, md: !1 });
          break;
        case ZJt.SHOW_MD:
          this.editor.setView({ html: !1, md: !0 });
      }
    }),
    (n.handleChange = function (e) {
      this.setState({ view: e });
    }),
    (n.componentDidMount = function () {
      this.editor.on("viewchange", this.handleChange);
    }),
    (n.componentWillUnmount = function () {
      this.editor.off("viewchange", this.handleChange);
    }),
    (n.getDisplayInfo = function () {
      switch (this.next) {
        case ZJt.SHOW_ALL:
          return { icon: "view-split", title: "All" };
        case ZJt.SHOW_HTML:
          return { icon: "visibility", title: "Preview" };
        default:
          return { icon: "keyboard", title: "Editor" };
      }
    }),
    (n.render = function () {
      if (this.isDisplay) {
        var e = this.getDisplayInfo();
        return H.createElement(
          "span",
          {
            className: "button button-type-mode",
            title: rJt.get("btnMode" + e.title),
            onClick: this.handleClick,
          },
          H.createElement(YQt, { type: e.icon }),
        );
      }
      return null;
    }),
    aJt(t, [
      {
        key: "isDisplay",
        get: function () {
          var e = this.editorConfig.canView;
          return (
            !!e &&
            [e.html, e.md, e.both].filter(function (e) {
              return e;
            }).length >= 2
          );
        },
      },
      {
        key: "next",
        get: function () {
          var e = this.editorConfig.canView,
            t = this.state.view,
            n = [ZJt.SHOW_ALL, ZJt.SHOW_MD, ZJt.SHOW_HTML];
          e &&
            (e.both || n.splice(n.indexOf(ZJt.SHOW_ALL), 1),
            e.md || n.splice(n.indexOf(ZJt.SHOW_MD), 1),
            e.html || n.splice(n.indexOf(ZJt.SHOW_HTML), 1));
          var i = ZJt.SHOW_MD;
          if ((t.html && (i = ZJt.SHOW_HTML), t.html && t.md && (i = ZJt.SHOW_ALL), 0 === n.length))
            return i;
          if (1 === n.length) return n[0];
          var r = n.indexOf(i);
          return r < n.length - 1 ? n[r + 1] : n[0];
        },
      },
    ]),
    t
  );
})(lJt);
((QJt.pluginName = "mode-toggle"), (QJt.align = "right"));
var JJt = (function (e) {
    function t(t) {
      var n;
      (n = e.call(this, t) || this).config = { padding: 3, width: 20, height: 20 };
      var i = t.maxRow,
        r = void 0 === i ? 5 : i,
        o = t.maxCol,
        s = void 0 === o ? 6 : o;
      return ((n.state = { maxRow: r, maxCol: s, list: n.formatTableModel(r, s) }), n);
    }
    tMt(t, e);
    var n = t.prototype;
    return (
      (n.formatTableModel = function (e, t) {
        return (
          void 0 === e && (e = 0),
          void 0 === t && (t = 0),
          new Array(e).fill(void 0).map(function (e) {
            return new Array(t).fill(0);
          })
        );
      }),
      (n.calcWrapStyle = function () {
        var e = this.state,
          t = e.maxRow,
          n = e.maxCol,
          i = this.config,
          r = i.width,
          o = i.height,
          s = i.padding;
        return { width: (r + s) * n - s + "px", height: (o + s) * t - s + "px" };
      }),
      (n.calcItemStyle = function (e, t) {
        (void 0 === e && (e = 0), void 0 === t && (t = 0));
        var n = this.config,
          i = n.width,
          r = n.height,
          o = n.padding;
        return { top: (r + o) * e + "px", left: (i + o) * t + "px" };
      }),
      (n.getList = function (e, t) {
        return this.state.list.map(function (n, i) {
          return n.map(function (n, r) {
            return i <= e && r <= t ? 1 : 0;
          });
        });
      }),
      (n.handleHover = function (e, t) {
        this.setState({ list: this.getList(e, t) });
      }),
      (n.handleSetTable = function (e, t) {
        var n = this.props.onSetTable;
        "function" == typeof n && n({ row: e + 1, col: t + 1 });
      }),
      (n.componentDidUpdate = function (e) {
        !1 === this.props.visibility &&
          e.visibility !== this.props.visibility &&
          this.setState({ list: this.getList(-1, -1) });
      }),
      (n.render = function () {
        var e = this;
        return H.createElement(
          "ul",
          { className: "table-list wrap", style: this.calcWrapStyle() },
          this.state.list.map(function (t, n) {
            return t.map(function (t, i) {
              return H.createElement("li", {
                className: "list-item " + (1 === t ? "active" : ""),
                key: n + "-" + i,
                style: e.calcItemStyle(n, i),
                onMouseOver: e.handleHover.bind(e, n, i),
                onClick: e.handleSetTable.bind(e, n, i),
              });
            });
          }),
        );
      }),
      t
    );
  })(H.Component),
  e0t = (function (e) {
    function t(t) {
      var n;
      return (
        ((n = e.call(this, t) || this).show = n.show.bind(nMt(n))),
        (n.hide = n.hide.bind(nMt(n))),
        (n.state = { show: !1 }),
        n
      );
    }
    tMt(t, e);
    var n = t.prototype;
    return (
      (n.show = function () {
        this.setState({ show: !0 });
      }),
      (n.hide = function () {
        this.setState({ show: !1 });
      }),
      (n.render = function () {
        var e = this,
          t = this.editorConfig.table || this.props.config;
        return H.createElement(
          "span",
          {
            className: "button button-type-table",
            title: rJt.get("btnTable"),
            onMouseEnter: this.show,
            onMouseLeave: this.hide,
          },
          H.createElement(YQt, { type: "grid" }),
          H.createElement(
            WJt,
            { show: this.state.show, onClose: this.hide },
            H.createElement(JJt, {
              visibility: this.state.show,
              maxRow: t.maxRow,
              maxCol: t.maxCol,
              onSetTable: function (t) {
                return e.editor.insertMarkdown("table", t);
              },
            }),
          ),
        );
      }),
      t
    );
  })(lJt);
((e0t.pluginName = "table"), (e0t.defaultConfig = { maxRow: 6, maxCol: 6 }));
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
(!(function (e) {
  !(function () {
    var t = {}.hasOwnProperty;
    function n() {
      for (var e = "", t = 0; t < arguments.length; t++) {
        var n = arguments[t];
        n && (e = r(e, i(n)));
      }
      return e;
    }
    function i(e) {
      if ("string" == typeof e || "number" == typeof e) return e;
      if ("object" != typeof e) return "";
      if (Array.isArray(e)) return n.apply(null, e);
      if (
        e.toString !== Object.prototype.toString &&
        !e.toString.toString().includes("[native code]")
      )
        return e.toString();
      var i = "";
      for (var o in e) t.call(e, o) && e[o] && (i = r(i, o));
      return i;
    }
    function r(e, t) {
      return t ? (e ? e + " " + t : e + t) : e;
    }
    e.exports ? ((n.default = n), (e.exports = n)) : (window.classNames = n);
  })();
})({ exports: {} }),
  TJt.use(zJt),
  TJt.use(PJt),
  TJt.use(jJt),
  TJt.use(BJt),
  TJt.use(FJt),
  TJt.use(GJt),
  TJt.use(KJt),
  TJt.use(OJt),
  TJt.use(MJt),
  TJt.use(RJt),
  TJt.use(IJt),
  TJt.use(e0t),
  TJt.use($Jt),
  TJt.use(qJt),
  TJt.use(AJt),
  TJt.use(XJt),
  TJt.use(QJt),
  TJt.use(VJt));
const t0t = H.forwardRef(({ className: e, value: t, onChange: n, ...i }, r) => {
  const o = Array.isArray(t) ? t : [],
    [s, a] = H.useState("");
  H.useEffect(() => {
    if (s.includes(",")) {
      const e = new Set([...o, ...s.split(",").map((e) => e.trim())]);
      (n(Array.from(e)), a(""));
    }
  }, [s, n, o]);
  return Q.jsxs("div", {
    className: Rf(
      " has-[:focus-visible]:outline-none has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-neutral-950  dark:has-[:focus-visible]:ring-neutral-300  flex w-full flex-wrap gap-2 rounded-md border border-input shadow-sm px-3 py-2 text-sm ring-offset-white  disabled:cursor-not-allowed disabled:opacity-50",
      e,
    ),
    children: [
      o.map((e) =>
        Q.jsxs(
          hqt,
          {
            variant: "secondary",
            children: [
              e,
              Q.jsx(ltt, {
                variant: "ghost",
                size: "icon",
                className: "ml-2 h-3 w-3",
                onClick: () => {
                  n(o.filter((t) => t !== e));
                },
                children: Q.jsx(plt, { className: "w-3" }),
              }),
            ],
          },
          e,
        ),
      ),
      Q.jsx("input", {
        className: "flex-1 outline-none placeholder:text-muted-foreground bg-transparent",
        value: s,
        onChange: (e) => a(e.target.value),
        onKeyDown: (e) => {
          "Enter" === e.key || "," === e.key
            ? (e.preventDefault(),
              (() => {
                if (s) {
                  const e = new Set([...o, s]);
                  (n(Array.from(e)), a(""));
                }
              })())
            : "Backspace" === e.key &&
              0 === s.length &&
              o.length > 0 &&
              (e.preventDefault(), n(o.slice(0, -1)));
        },
        ...i,
        ref: r,
      }),
    ],
  });
});
t0t.displayName = "InputTags";
const n0t = {};
function i0t(e, t) {
  "string" != typeof t && (t = i0t.defaultChars);
  const n = (function (e) {
    let t = n0t[e];
    if (t) return t;
    t = n0t[e] = [];
    for (let n = 0; n < 128; n++) {
      const e = String.fromCharCode(n);
      t.push(e);
    }
    for (let n = 0; n < e.length; n++) {
      const i = e.charCodeAt(n);
      t[i] = "%" + ("0" + i.toString(16).toUpperCase()).slice(-2);
    }
    return t;
  })(t);
  return e.replace(/(%[a-f0-9]{2})+/gi, function (e) {
    let t = "";
    for (let i = 0, r = e.length; i < r; i += 3) {
      const o = parseInt(e.slice(i + 1, i + 3), 16);
      if (o < 128) t += n[o];
      else {
        if (192 == (224 & o) && i + 3 < r) {
          const n = parseInt(e.slice(i + 4, i + 6), 16);
          if (128 == (192 & n)) {
            const e = ((o << 6) & 1984) | (63 & n);
            ((t += e < 128 ? "��" : String.fromCharCode(e)), (i += 3));
            continue;
          }
        }
        if (224 == (240 & o) && i + 6 < r) {
          const n = parseInt(e.slice(i + 4, i + 6), 16),
            r = parseInt(e.slice(i + 7, i + 9), 16);
          if (128 == (192 & n) && 128 == (192 & r)) {
            const e = ((o << 12) & 61440) | ((n << 6) & 4032) | (63 & r);
            ((t += e < 2048 || (e >= 55296 && e <= 57343) ? "���" : String.fromCharCode(e)),
              (i += 6));
            continue;
          }
        }
        if (240 == (248 & o) && i + 9 < r) {
          const n = parseInt(e.slice(i + 4, i + 6), 16),
            r = parseInt(e.slice(i + 7, i + 9), 16),
            s = parseInt(e.slice(i + 10, i + 12), 16);
          if (128 == (192 & n) && 128 == (192 & r) && 128 == (192 & s)) {
            let e = ((o << 18) & 1835008) | ((n << 12) & 258048) | ((r << 6) & 4032) | (63 & s);
            (e < 65536 || e > 1114111
              ? (t += "����")
              : ((e -= 65536), (t += String.fromCharCode(55296 + (e >> 10), 56320 + (1023 & e)))),
              (i += 9));
            continue;
          }
        }
        t += "�";
      }
    }
    return t;
  });
}
((i0t.defaultChars = ";/?:@&=+$,#"), (i0t.componentChars = ""));
const r0t = {};
function o0t(e, t, n) {
  ("string" != typeof t && ((n = t), (t = o0t.defaultChars)), void 0 === n && (n = !0));
  const i = (function (e) {
    let t = r0t[e];
    if (t) return t;
    t = r0t[e] = [];
    for (let n = 0; n < 128; n++) {
      const e = String.fromCharCode(n);
      /^[0-9a-z]$/i.test(e)
        ? t.push(e)
        : t.push("%" + ("0" + n.toString(16).toUpperCase()).slice(-2));
    }
    for (let n = 0; n < e.length; n++) t[e.charCodeAt(n)] = e[n];
    return t;
  })(t);
  let r = "";
  for (let o = 0, s = e.length; o < s; o++) {
    const t = e.charCodeAt(o);
    if (n && 37 === t && o + 2 < s && /^[0-9a-f]{2}$/i.test(e.slice(o + 1, o + 3)))
      ((r += e.slice(o, o + 3)), (o += 2));
    else if (t < 128) r += i[t];
    else if (t >= 55296 && t <= 57343) {
      if (t >= 55296 && t <= 56319 && o + 1 < s) {
        const t = e.charCodeAt(o + 1);
        if (t >= 56320 && t <= 57343) {
          ((r += encodeURIComponent(e[o] + e[o + 1])), o++);
          continue;
        }
      }
      r += "%EF%BF%BD";
    } else r += encodeURIComponent(e[o]);
  }
  return r;
}
function s0t(e) {
  let t = "";
  return (
    (t += e.protocol || ""),
    (t += e.slashes ? "//" : ""),
    (t += e.auth ? e.auth + "@" : ""),
    e.hostname && -1 !== e.hostname.indexOf(":")
      ? (t += "[" + e.hostname + "]")
      : (t += e.hostname || ""),
    (t += e.port ? ":" + e.port : ""),
    (t += e.pathname || ""),
    (t += e.search || ""),
    (t += e.hash || ""),
    t
  );
}
function a0t() {
  ((this.protocol = null),
    (this.slashes = null),
    (this.auth = null),
    (this.port = null),
    (this.hostname = null),
    (this.hash = null),
    (this.search = null),
    (this.pathname = null));
}
((o0t.defaultChars = ";/?:@&=+$,-_.!~*'()#"), (o0t.componentChars = "-_.!~*'()"));
const l0t = /^([a-z0-9.+-]+:)/i,
  c0t = /:[0-9]*$/,
  d0t = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  u0t = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"]),
  h0t = ["'"].concat(u0t),
  g0t = ["%", "/", "?", ";", "#"].concat(h0t),
  p0t = ["/", "?", "#"],
  f0t = /^[+a-z0-9A-Z_-]{0,63}$/,
  m0t = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  _0t = { javascript: !0, "javascript:": !0 },
  v0t = {
    http: !0,
    https: !0,
    ftp: !0,
    gopher: !0,
    file: !0,
    "http:": !0,
    "https:": !0,
    "ftp:": !0,
    "gopher:": !0,
    "file:": !0,
  };
function b0t(e, t) {
  if (e && e instanceof a0t) return e;
  const n = new a0t();
  return (n.parse(e, t), n);
}
((a0t.prototype.parse = function (e, t) {
  let n,
    i,
    r,
    o = e;
  if (((o = o.trim()), !t && 1 === e.split("#").length)) {
    const e = d0t.exec(o);
    if (e) return ((this.pathname = e[1]), e[2] && (this.search = e[2]), this);
  }
  let s = l0t.exec(o);
  if (
    (s && ((s = s[0]), (n = s.toLowerCase()), (this.protocol = s), (o = o.substr(s.length))),
    (t || s || o.match(/^\/\/[^@\/]+@[^@\/]+/)) &&
      ((r = "//" === o.substr(0, 2)),
      !r || (s && _0t[s]) || ((o = o.substr(2)), (this.slashes = !0))),
    !_0t[s] && (r || (s && !v0t[s])))
  ) {
    let e,
      t,
      n = -1;
    for (let a = 0; a < p0t.length; a++)
      ((i = o.indexOf(p0t[a])), -1 !== i && (-1 === n || i < n) && (n = i));
    ((t = -1 === n ? o.lastIndexOf("@") : o.lastIndexOf("@", n)),
      -1 !== t && ((e = o.slice(0, t)), (o = o.slice(t + 1)), (this.auth = e)),
      (n = -1));
    for (let a = 0; a < g0t.length; a++)
      ((i = o.indexOf(g0t[a])), -1 !== i && (-1 === n || i < n) && (n = i));
    (-1 === n && (n = o.length), ":" === o[n - 1] && n--);
    const r = o.slice(0, n);
    ((o = o.slice(n)), this.parseHost(r), (this.hostname = this.hostname || ""));
    const s = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
    if (!s) {
      const e = this.hostname.split(/\./);
      for (let t = 0, n = e.length; t < n; t++) {
        const n = e[t];
        if (n && !n.match(f0t)) {
          let i = "";
          for (let e = 0, t = n.length; e < t; e++)
            n.charCodeAt(e) > 127 ? (i += "x") : (i += n[e]);
          if (!i.match(f0t)) {
            const i = e.slice(0, t),
              r = e.slice(t + 1),
              s = n.match(m0t);
            (s && (i.push(s[1]), r.unshift(s[2])),
              r.length && (o = r.join(".") + o),
              (this.hostname = i.join(".")));
            break;
          }
        }
      }
    }
    (this.hostname.length > 255 && (this.hostname = ""),
      s && (this.hostname = this.hostname.substr(1, this.hostname.length - 2)));
  }
  const a = o.indexOf("#");
  -1 !== a && ((this.hash = o.substr(a)), (o = o.slice(0, a)));
  const l = o.indexOf("?");
  return (
    -1 !== l && ((this.search = o.substr(l)), (o = o.slice(0, l))),
    o && (this.pathname = o),
    v0t[n] && this.hostname && !this.pathname && (this.pathname = ""),
    this
  );
}),
  (a0t.prototype.parseHost = function (e) {
    let t = c0t.exec(e);
    (t &&
      ((t = t[0]), ":" !== t && (this.port = t.substr(1)), (e = e.substr(0, e.length - t.length))),
      e && (this.hostname = e));
  }));
const y0t = Object.freeze(
    Object.defineProperty(
      { __proto__: null, decode: i0t, encode: o0t, format: s0t, parse: b0t },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  x0t =
    /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,
  w0t = /[\0-\x1F\x7F-\x9F]/,
  C0t =
    /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,
  S0t =
    /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,
  k0t = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,
  E0t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        Any: x0t,
        Cc: w0t,
        Cf: /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,
        P: C0t,
        S: S0t,
        Z: k0t,
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  N0t = new Uint16Array(
    'ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'
      .split("")
      .map((e) => e.charCodeAt(0)),
  ),
  L0t = new Uint16Array(
    "Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((e) => e.charCodeAt(0)),
  );
var D0t;
const T0t = new Map([
    [0, 65533],
    [128, 8364],
    [130, 8218],
    [131, 402],
    [132, 8222],
    [133, 8230],
    [134, 8224],
    [135, 8225],
    [136, 710],
    [137, 8240],
    [138, 352],
    [139, 8249],
    [140, 338],
    [142, 381],
    [145, 8216],
    [146, 8217],
    [147, 8220],
    [148, 8221],
    [149, 8226],
    [150, 8211],
    [151, 8212],
    [152, 732],
    [153, 8482],
    [154, 353],
    [155, 8250],
    [156, 339],
    [158, 382],
    [159, 376],
  ]),
  I0t =
    null !== (D0t = String.fromCodePoint) && void 0 !== D0t
      ? D0t
      : function (e) {
          let t = "";
          return (
            e > 65535 &&
              ((e -= 65536),
              (t += String.fromCharCode(((e >>> 10) & 1023) | 55296)),
              (e = 56320 | (1023 & e))),
            (t += String.fromCharCode(e)),
            t
          );
        };
var R0t;
!(function (e) {
  ((e[(e.NUM = 35)] = "NUM"),
    (e[(e.SEMI = 59)] = "SEMI"),
    (e[(e.EQUALS = 61)] = "EQUALS"),
    (e[(e.ZERO = 48)] = "ZERO"),
    (e[(e.NINE = 57)] = "NINE"),
    (e[(e.LOWER_A = 97)] = "LOWER_A"),
    (e[(e.LOWER_F = 102)] = "LOWER_F"),
    (e[(e.LOWER_X = 120)] = "LOWER_X"),
    (e[(e.LOWER_Z = 122)] = "LOWER_Z"),
    (e[(e.UPPER_A = 65)] = "UPPER_A"),
    (e[(e.UPPER_F = 70)] = "UPPER_F"),
    (e[(e.UPPER_Z = 90)] = "UPPER_Z"));
})(R0t || (R0t = {}));
var O0t, M0t, A0t;
function P0t(e) {
  return e >= R0t.ZERO && e <= R0t.NINE;
}
function j0t(e) {
  return (e >= R0t.UPPER_A && e <= R0t.UPPER_F) || (e >= R0t.LOWER_A && e <= R0t.LOWER_F);
}
function F0t(e) {
  return (
    e === R0t.EQUALS ||
    (function (e) {
      return (
        (e >= R0t.UPPER_A && e <= R0t.UPPER_Z) || (e >= R0t.LOWER_A && e <= R0t.LOWER_Z) || P0t(e)
      );
    })(e)
  );
}
(!(function (e) {
  ((e[(e.VALUE_LENGTH = 49152)] = "VALUE_LENGTH"),
    (e[(e.BRANCH_LENGTH = 16256)] = "BRANCH_LENGTH"),
    (e[(e.JUMP_TABLE = 127)] = "JUMP_TABLE"));
})(O0t || (O0t = {})),
  (function (e) {
    ((e[(e.EntityStart = 0)] = "EntityStart"),
      (e[(e.NumericStart = 1)] = "NumericStart"),
      (e[(e.NumericDecimal = 2)] = "NumericDecimal"),
      (e[(e.NumericHex = 3)] = "NumericHex"),
      (e[(e.NamedEntity = 4)] = "NamedEntity"));
  })(M0t || (M0t = {})),
  (function (e) {
    ((e[(e.Legacy = 0)] = "Legacy"),
      (e[(e.Strict = 1)] = "Strict"),
      (e[(e.Attribute = 2)] = "Attribute"));
  })(A0t || (A0t = {})));
class B0t {
  constructor(e, t, n) {
    ((this.decodeTree = e),
      (this.emitCodePoint = t),
      (this.errors = n),
      (this.state = M0t.EntityStart),
      (this.consumed = 1),
      (this.result = 0),
      (this.treeIndex = 0),
      (this.excess = 1),
      (this.decodeMode = A0t.Strict));
  }
  startEntity(e) {
    ((this.decodeMode = e),
      (this.state = M0t.EntityStart),
      (this.result = 0),
      (this.treeIndex = 0),
      (this.excess = 1),
      (this.consumed = 1));
  }
  write(e, t) {
    switch (this.state) {
      case M0t.EntityStart:
        return e.charCodeAt(t) === R0t.NUM
          ? ((this.state = M0t.NumericStart),
            (this.consumed += 1),
            this.stateNumericStart(e, t + 1))
          : ((this.state = M0t.NamedEntity), this.stateNamedEntity(e, t));
      case M0t.NumericStart:
        return this.stateNumericStart(e, t);
      case M0t.NumericDecimal:
        return this.stateNumericDecimal(e, t);
      case M0t.NumericHex:
        return this.stateNumericHex(e, t);
      case M0t.NamedEntity:
        return this.stateNamedEntity(e, t);
    }
  }
  stateNumericStart(e, t) {
    return t >= e.length
      ? -1
      : (32 | e.charCodeAt(t)) === R0t.LOWER_X
        ? ((this.state = M0t.NumericHex), (this.consumed += 1), this.stateNumericHex(e, t + 1))
        : ((this.state = M0t.NumericDecimal), this.stateNumericDecimal(e, t));
  }
  addToNumericResult(e, t, n, i) {
    if (t !== n) {
      const r = n - t;
      ((this.result = this.result * Math.pow(i, r) + parseInt(e.substr(t, r), i)),
        (this.consumed += r));
    }
  }
  stateNumericHex(e, t) {
    const n = t;
    for (; t < e.length; ) {
      const i = e.charCodeAt(t);
      if (!P0t(i) && !j0t(i))
        return (this.addToNumericResult(e, n, t, 16), this.emitNumericEntity(i, 3));
      t += 1;
    }
    return (this.addToNumericResult(e, n, t, 16), -1);
  }
  stateNumericDecimal(e, t) {
    const n = t;
    for (; t < e.length; ) {
      const i = e.charCodeAt(t);
      if (!P0t(i)) return (this.addToNumericResult(e, n, t, 10), this.emitNumericEntity(i, 2));
      t += 1;
    }
    return (this.addToNumericResult(e, n, t, 10), -1);
  }
  emitNumericEntity(e, t) {
    var n;
    if (this.consumed <= t)
      return (
        null === (n = this.errors) ||
          void 0 === n ||
          n.absenceOfDigitsInNumericCharacterReference(this.consumed),
        0
      );
    if (e === R0t.SEMI) this.consumed += 1;
    else if (this.decodeMode === A0t.Strict) return 0;
    return (
      this.emitCodePoint(
        (function (e) {
          var t;
          return (e >= 55296 && e <= 57343) || e > 1114111
            ? 65533
            : null !== (t = T0t.get(e)) && void 0 !== t
              ? t
              : e;
        })(this.result),
        this.consumed,
      ),
      this.errors &&
        (e !== R0t.SEMI && this.errors.missingSemicolonAfterCharacterReference(),
        this.errors.validateNumericCharacterReference(this.result)),
      this.consumed
    );
  }
  stateNamedEntity(e, t) {
    const { decodeTree: n } = this;
    let i = n[this.treeIndex],
      r = (i & O0t.VALUE_LENGTH) >> 14;
    for (; t < e.length; t++, this.excess++) {
      const o = e.charCodeAt(t);
      if (((this.treeIndex = W0t(n, i, this.treeIndex + Math.max(1, r), o)), this.treeIndex < 0))
        return 0 === this.result || (this.decodeMode === A0t.Attribute && (0 === r || F0t(o)))
          ? 0
          : this.emitNotTerminatedNamedEntity();
      if (((i = n[this.treeIndex]), (r = (i & O0t.VALUE_LENGTH) >> 14), 0 !== r)) {
        if (o === R0t.SEMI)
          return this.emitNamedEntityData(this.treeIndex, r, this.consumed + this.excess);
        this.decodeMode !== A0t.Strict &&
          ((this.result = this.treeIndex), (this.consumed += this.excess), (this.excess = 0));
      }
    }
    return -1;
  }
  emitNotTerminatedNamedEntity() {
    var e;
    const { result: t, decodeTree: n } = this,
      i = (n[t] & O0t.VALUE_LENGTH) >> 14;
    return (
      this.emitNamedEntityData(t, i, this.consumed),
      null === (e = this.errors) || void 0 === e || e.missingSemicolonAfterCharacterReference(),
      this.consumed
    );
  }
  emitNamedEntityData(e, t, n) {
    const { decodeTree: i } = this;
    return (
      this.emitCodePoint(1 === t ? i[e] & ~O0t.VALUE_LENGTH : i[e + 1], n),
      3 === t && this.emitCodePoint(i[e + 2], n),
      n
    );
  }
  end() {
    var e;
    switch (this.state) {
      case M0t.NamedEntity:
        return 0 === this.result ||
          (this.decodeMode === A0t.Attribute && this.result !== this.treeIndex)
          ? 0
          : this.emitNotTerminatedNamedEntity();
      case M0t.NumericDecimal:
        return this.emitNumericEntity(0, 2);
      case M0t.NumericHex:
        return this.emitNumericEntity(0, 3);
      case M0t.NumericStart:
        return (
          null === (e = this.errors) ||
            void 0 === e ||
            e.absenceOfDigitsInNumericCharacterReference(this.consumed),
          0
        );
      case M0t.EntityStart:
        return 0;
    }
  }
}
function V0t(e) {
  let t = "";
  const n = new B0t(e, (e) => (t += I0t(e)));
  return function (e, i) {
    let r = 0,
      o = 0;
    for (; (o = e.indexOf("&", o)) >= 0; ) {
      ((t += e.slice(r, o)), n.startEntity(i));
      const s = n.write(e, o + 1);
      if (s < 0) {
        r = o + n.end();
        break;
      }
      ((r = o + s), (o = 0 === s ? r + 1 : r));
    }
    const s = t + e.slice(r);
    return ((t = ""), s);
  };
}
function W0t(e, t, n, i) {
  const r = (t & O0t.BRANCH_LENGTH) >> 7,
    o = t & O0t.JUMP_TABLE;
  if (0 === r) return 0 !== o && i === o ? n : -1;
  if (o) {
    const t = i - o;
    return t < 0 || t >= r ? -1 : e[n + t] - 1;
  }
  let s = n,
    a = s + r - 1;
  for (; s <= a; ) {
    const t = (s + a) >>> 1,
      n = e[t];
    if (n < i) s = t + 1;
    else {
      if (!(n > i)) return e[t + r];
      a = t - 1;
    }
  }
  return -1;
}
const H0t = V0t(N0t);
function z0t(e, t = A0t.Legacy) {
  return H0t(e, t);
}
function U0t(e) {
  return (
    "[object String]" ===
    (function (e) {
      return Object.prototype.toString.call(e);
    })(e)
  );
}
V0t(L0t);
const $0t = Object.prototype.hasOwnProperty;
function q0t(e) {
  return (
    Array.prototype.slice.call(arguments, 1).forEach(function (t) {
      if (t) {
        if ("object" != typeof t) throw new TypeError(t + "must be object");
        Object.keys(t).forEach(function (n) {
          e[n] = t[n];
        });
      }
    }),
    e
  );
}
function K0t(e, t, n) {
  return [].concat(e.slice(0, t), n, e.slice(t + 1));
}
function G0t(e) {
  return (
    !(e >= 55296 && e <= 57343) &&
    !(e >= 64976 && e <= 65007) &&
    !!(65535 & ~e && 65534 != (65535 & e)) &&
    !(e >= 0 && e <= 8) &&
    11 !== e &&
    !(e >= 14 && e <= 31) &&
    !(e >= 127 && e <= 159) &&
    !(e > 1114111)
  );
}
function Z0t(e) {
  if (e > 65535) {
    const t = 55296 + ((e -= 65536) >> 10),
      n = 56320 + (1023 & e);
    return String.fromCharCode(t, n);
  }
  return String.fromCharCode(e);
}
const Y0t = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,
  X0t = new RegExp(Y0t.source + "|" + /&([a-z#][a-z0-9]{1,31});/gi.source, "gi"),
  Q0t = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
function J0t(e) {
  return e.indexOf("\\") < 0 && e.indexOf("&") < 0
    ? e
    : e.replace(X0t, function (e, t, n) {
        return (
          t ||
          (function (e, t) {
            if (35 === t.charCodeAt(0) && Q0t.test(t)) {
              const n =
                "x" === t[1].toLowerCase() ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
              return G0t(n) ? Z0t(n) : e;
            }
            const n = z0t(e);
            return n !== e ? n : e;
          })(e, n)
        );
      });
}
const e1t = /[&<>"]/,
  t1t = /[&<>"]/g,
  n1t = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" };
function i1t(e) {
  return n1t[e];
}
function r1t(e) {
  return e1t.test(e) ? e.replace(t1t, i1t) : e;
}
const o1t = /[.?*+^$[\]\\(){}|-]/g;
function s1t(e) {
  switch (e) {
    case 9:
    case 32:
      return !0;
  }
  return !1;
}
function a1t(e) {
  if (e >= 8192 && e <= 8202) return !0;
  switch (e) {
    case 9:
    case 10:
    case 11:
    case 12:
    case 13:
    case 32:
    case 160:
    case 5760:
    case 8239:
    case 8287:
    case 12288:
      return !0;
  }
  return !1;
}
function l1t(e) {
  return C0t.test(e) || S0t.test(e);
}
function c1t(e) {
  switch (e) {
    case 33:
    case 34:
    case 35:
    case 36:
    case 37:
    case 38:
    case 39:
    case 40:
    case 41:
    case 42:
    case 43:
    case 44:
    case 45:
    case 46:
    case 47:
    case 58:
    case 59:
    case 60:
    case 61:
    case 62:
    case 63:
    case 64:
    case 91:
    case 92:
    case 93:
    case 94:
    case 95:
    case 96:
    case 123:
    case 124:
    case 125:
    case 126:
      return !0;
    default:
      return !1;
  }
}
function d1t(e) {
  return (
    (e = e.trim().replace(/\s+/g, " ")),
    "Ṿ" === "ẞ".toLowerCase() && (e = e.replace(/ẞ/g, "ß")),
    e.toLowerCase().toUpperCase()
  );
}
const u1t = { mdurl: y0t, ucmicro: E0t },
  h1t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        arrayReplaceAt: K0t,
        assign: q0t,
        escapeHtml: r1t,
        escapeRE: function (e) {
          return e.replace(o1t, "\\$&");
        },
        fromCodePoint: Z0t,
        has: function (e, t) {
          return $0t.call(e, t);
        },
        isMdAsciiPunct: c1t,
        isPunctChar: l1t,
        isSpace: s1t,
        isString: U0t,
        isValidEntityCode: G0t,
        isWhiteSpace: a1t,
        lib: u1t,
        normalizeReference: d1t,
        unescapeAll: J0t,
        unescapeMd: function (e) {
          return e.indexOf("\\") < 0 ? e : e.replace(Y0t, "$1");
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  );
const g1t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        parseLinkDestination: function (e, t, n) {
          let i,
            r = t;
          const o = { ok: !1, pos: 0, str: "" };
          if (60 === e.charCodeAt(r)) {
            for (r++; r < n; ) {
              if (((i = e.charCodeAt(r)), 10 === i)) return o;
              if (60 === i) return o;
              if (62 === i)
                return ((o.pos = r + 1), (o.str = J0t(e.slice(t + 1, r))), (o.ok = !0), o);
              92 === i && r + 1 < n ? (r += 2) : r++;
            }
            return o;
          }
          let s = 0;
          for (; r < n && ((i = e.charCodeAt(r)), 32 !== i) && !(i < 32 || 127 === i); )
            if (92 === i && r + 1 < n) {
              if (32 === e.charCodeAt(r + 1)) break;
              r += 2;
            } else {
              if (40 === i && (s++, s > 32)) return o;
              if (41 === i) {
                if (0 === s) break;
                s--;
              }
              r++;
            }
          return (
            t === r || 0 !== s || ((o.str = J0t(e.slice(t, r))), (o.pos = r), (o.ok = !0)),
            o
          );
        },
        parseLinkLabel: function (e, t, n) {
          let i, r, o, s;
          const a = e.posMax,
            l = e.pos;
          for (e.pos = t + 1, i = 1; e.pos < a; ) {
            if (((o = e.src.charCodeAt(e.pos)), 93 === o && (i--, 0 === i))) {
              r = !0;
              break;
            }
            if (((s = e.pos), e.md.inline.skipToken(e), 91 === o))
              if (s === e.pos - 1) i++;
              else if (n) return ((e.pos = l), -1);
          }
          let c = -1;
          return (r && (c = e.pos), (e.pos = l), c);
        },
        parseLinkTitle: function (e, t, n, i) {
          let r,
            o = t;
          const s = { ok: !1, can_continue: !1, pos: 0, str: "", marker: 0 };
          if (i) ((s.str = i.str), (s.marker = i.marker));
          else {
            if (o >= n) return s;
            let i = e.charCodeAt(o);
            if (34 !== i && 39 !== i && 40 !== i) return s;
            (t++, o++, 40 === i && (i = 41), (s.marker = i));
          }
          for (; o < n; ) {
            if (((r = e.charCodeAt(o)), r === s.marker))
              return ((s.pos = o + 1), (s.str += J0t(e.slice(t, o))), (s.ok = !0), s);
            if (40 === r && 41 === s.marker) return s;
            (92 === r && o + 1 < n && o++, o++);
          }
          return ((s.can_continue = !0), (s.str += J0t(e.slice(t, o))), s);
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  p1t = {};
function f1t() {
  this.rules = q0t({}, p1t);
}
function m1t() {
  ((this.__rules__ = []), (this.__cache__ = null));
}
function _1t(e, t, n) {
  ((this.type = e),
    (this.tag = t),
    (this.attrs = null),
    (this.map = null),
    (this.nesting = n),
    (this.level = 0),
    (this.children = null),
    (this.content = ""),
    (this.markup = ""),
    (this.info = ""),
    (this.meta = null),
    (this.block = !1),
    (this.hidden = !1));
}
function v1t(e, t, n) {
  ((this.src = e), (this.env = n), (this.tokens = []), (this.inlineMode = !1), (this.md = t));
}
((p1t.code_inline = function (e, t, n, i, r) {
  const o = e[t];
  return "<code" + r.renderAttrs(o) + ">" + r1t(o.content) + "</code>";
}),
  (p1t.code_block = function (e, t, n, i, r) {
    const o = e[t];
    return "<pre" + r.renderAttrs(o) + "><code>" + r1t(e[t].content) + "</code></pre>\n";
  }),
  (p1t.fence = function (e, t, n, i, r) {
    const o = e[t],
      s = o.info ? J0t(o.info).trim() : "";
    let a,
      l = "",
      c = "";
    if (s) {
      const e = s.split(/(\s+)/g);
      ((l = e[0]), (c = e.slice(2).join("")));
    }
    if (
      ((a = (n.highlight && n.highlight(o.content, l, c)) || r1t(o.content)),
      0 === a.indexOf("<pre"))
    )
      return a + "\n";
    if (s) {
      const e = o.attrIndex("class"),
        t = o.attrs ? o.attrs.slice() : [];
      e < 0
        ? t.push(["class", n.langPrefix + l])
        : ((t[e] = t[e].slice()), (t[e][1] += " " + n.langPrefix + l));
      const i = { attrs: t };
      return `<pre><code${r.renderAttrs(i)}>${a}</code></pre>\n`;
    }
    return `<pre><code${r.renderAttrs(o)}>${a}</code></pre>\n`;
  }),
  (p1t.image = function (e, t, n, i, r) {
    const o = e[t];
    return (
      (o.attrs[o.attrIndex("alt")][1] = r.renderInlineAsText(o.children, n, i)),
      r.renderToken(e, t, n)
    );
  }),
  (p1t.hardbreak = function (e, t, n) {
    return n.xhtmlOut ? "<br />\n" : "<br>\n";
  }),
  (p1t.softbreak = function (e, t, n) {
    return n.breaks ? (n.xhtmlOut ? "<br />\n" : "<br>\n") : "\n";
  }),
  (p1t.text = function (e, t) {
    return r1t(e[t].content);
  }),
  (p1t.html_block = function (e, t) {
    return e[t].content;
  }),
  (p1t.html_inline = function (e, t) {
    return e[t].content;
  }),
  (f1t.prototype.renderAttrs = function (e) {
    let t, n, i;
    if (!e.attrs) return "";
    for (i = "", t = 0, n = e.attrs.length; t < n; t++)
      i += " " + r1t(e.attrs[t][0]) + '="' + r1t(e.attrs[t][1]) + '"';
    return i;
  }),
  (f1t.prototype.renderToken = function (e, t, n) {
    const i = e[t];
    let r = "";
    if (i.hidden) return "";
    (i.block && -1 !== i.nesting && t && e[t - 1].hidden && (r += "\n"),
      (r += (-1 === i.nesting ? "</" : "<") + i.tag),
      (r += this.renderAttrs(i)),
      0 === i.nesting && n.xhtmlOut && (r += " /"));
    let o = !1;
    if (i.block && ((o = !0), 1 === i.nesting && t + 1 < e.length)) {
      const n = e[t + 1];
      ("inline" === n.type || n.hidden || (-1 === n.nesting && n.tag === i.tag)) && (o = !1);
    }
    return ((r += o ? ">\n" : ">"), r);
  }),
  (f1t.prototype.renderInline = function (e, t, n) {
    let i = "";
    const r = this.rules;
    for (let o = 0, s = e.length; o < s; o++) {
      const s = e[o].type;
      void 0 !== r[s] ? (i += r[s](e, o, t, n, this)) : (i += this.renderToken(e, o, t));
    }
    return i;
  }),
  (f1t.prototype.renderInlineAsText = function (e, t, n) {
    let i = "";
    for (let r = 0, o = e.length; r < o; r++)
      switch (e[r].type) {
        case "text":
        case "html_inline":
        case "html_block":
          i += e[r].content;
          break;
        case "image":
          i += this.renderInlineAsText(e[r].children, t, n);
          break;
        case "softbreak":
        case "hardbreak":
          i += "\n";
      }
    return i;
  }),
  (f1t.prototype.render = function (e, t, n) {
    let i = "";
    const r = this.rules;
    for (let o = 0, s = e.length; o < s; o++) {
      const s = e[o].type;
      "inline" === s
        ? (i += this.renderInline(e[o].children, t, n))
        : void 0 !== r[s]
          ? (i += r[s](e, o, t, n, this))
          : (i += this.renderToken(e, o, t, n));
    }
    return i;
  }),
  (m1t.prototype.__find__ = function (e) {
    for (let t = 0; t < this.__rules__.length; t++) if (this.__rules__[t].name === e) return t;
    return -1;
  }),
  (m1t.prototype.__compile__ = function () {
    const e = this,
      t = [""];
    (e.__rules__.forEach(function (e) {
      e.enabled &&
        e.alt.forEach(function (e) {
          t.indexOf(e) < 0 && t.push(e);
        });
    }),
      (e.__cache__ = {}),
      t.forEach(function (t) {
        ((e.__cache__[t] = []),
          e.__rules__.forEach(function (n) {
            n.enabled && ((t && n.alt.indexOf(t) < 0) || e.__cache__[t].push(n.fn));
          }));
      }));
  }),
  (m1t.prototype.at = function (e, t, n) {
    const i = this.__find__(e),
      r = n || {};
    if (-1 === i) throw new Error("Parser rule not found: " + e);
    ((this.__rules__[i].fn = t), (this.__rules__[i].alt = r.alt || []), (this.__cache__ = null));
  }),
  (m1t.prototype.before = function (e, t, n, i) {
    const r = this.__find__(e),
      o = i || {};
    if (-1 === r) throw new Error("Parser rule not found: " + e);
    (this.__rules__.splice(r, 0, { name: t, enabled: !0, fn: n, alt: o.alt || [] }),
      (this.__cache__ = null));
  }),
  (m1t.prototype.after = function (e, t, n, i) {
    const r = this.__find__(e),
      o = i || {};
    if (-1 === r) throw new Error("Parser rule not found: " + e);
    (this.__rules__.splice(r + 1, 0, { name: t, enabled: !0, fn: n, alt: o.alt || [] }),
      (this.__cache__ = null));
  }),
  (m1t.prototype.push = function (e, t, n) {
    const i = n || {};
    (this.__rules__.push({ name: e, enabled: !0, fn: t, alt: i.alt || [] }),
      (this.__cache__ = null));
  }),
  (m1t.prototype.enable = function (e, t) {
    Array.isArray(e) || (e = [e]);
    const n = [];
    return (
      e.forEach(function (e) {
        const i = this.__find__(e);
        if (i < 0) {
          if (t) return;
          throw new Error("Rules manager: invalid rule name " + e);
        }
        ((this.__rules__[i].enabled = !0), n.push(e));
      }, this),
      (this.__cache__ = null),
      n
    );
  }),
  (m1t.prototype.enableOnly = function (e, t) {
    (Array.isArray(e) || (e = [e]),
      this.__rules__.forEach(function (e) {
        e.enabled = !1;
      }),
      this.enable(e, t));
  }),
  (m1t.prototype.disable = function (e, t) {
    Array.isArray(e) || (e = [e]);
    const n = [];
    return (
      e.forEach(function (e) {
        const i = this.__find__(e);
        if (i < 0) {
          if (t) return;
          throw new Error("Rules manager: invalid rule name " + e);
        }
        ((this.__rules__[i].enabled = !1), n.push(e));
      }, this),
      (this.__cache__ = null),
      n
    );
  }),
  (m1t.prototype.getRules = function (e) {
    return (null === this.__cache__ && this.__compile__(), this.__cache__[e] || []);
  }),
  (_1t.prototype.attrIndex = function (e) {
    if (!this.attrs) return -1;
    const t = this.attrs;
    for (let n = 0, i = t.length; n < i; n++) if (t[n][0] === e) return n;
    return -1;
  }),
  (_1t.prototype.attrPush = function (e) {
    this.attrs ? this.attrs.push(e) : (this.attrs = [e]);
  }),
  (_1t.prototype.attrSet = function (e, t) {
    const n = this.attrIndex(e),
      i = [e, t];
    n < 0 ? this.attrPush(i) : (this.attrs[n] = i);
  }),
  (_1t.prototype.attrGet = function (e) {
    const t = this.attrIndex(e);
    let n = null;
    return (t >= 0 && (n = this.attrs[t][1]), n);
  }),
  (_1t.prototype.attrJoin = function (e, t) {
    const n = this.attrIndex(e);
    n < 0 ? this.attrPush([e, t]) : (this.attrs[n][1] = this.attrs[n][1] + " " + t);
  }),
  (v1t.prototype.Token = _1t));
const b1t = /\r\n?|\n/g,
  y1t = /\0/g;
function x1t(e) {
  return /^<a[>\s]/i.test(e);
}
function w1t(e) {
  return /^<\/a\s*>/i.test(e);
}
const C1t = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/,
  S1t = /\((c|tm|r)\)/i,
  k1t = /\((c|tm|r)\)/gi,
  E1t = { c: "©", r: "®", tm: "™" };
function N1t(e, t) {
  return E1t[t.toLowerCase()];
}
function L1t(e) {
  let t = 0;
  for (let n = e.length - 1; n >= 0; n--) {
    const i = e[n];
    ("text" !== i.type || t || (i.content = i.content.replace(k1t, N1t)),
      "link_open" === i.type && "auto" === i.info && t--,
      "link_close" === i.type && "auto" === i.info && t++);
  }
}
function D1t(e) {
  let t = 0;
  for (let n = e.length - 1; n >= 0; n--) {
    const i = e[n];
    ("text" !== i.type ||
      t ||
      (C1t.test(i.content) &&
        (i.content = i.content
          .replace(/\+-/g, "±")
          .replace(/\.{2,}/g, "…")
          .replace(/([?!])…/g, "$1..")
          .replace(/([?!]){4,}/g, "$1$1$1")
          .replace(/,{2,}/g, ",")
          .replace(/(^|[^-])---(?=[^-]|$)/gm, "$1—")
          .replace(/(^|\s)--(?=\s|$)/gm, "$1–")
          .replace(/(^|[^-\s])--(?=[^-\s]|$)/gm, "$1–"))),
      "link_open" === i.type && "auto" === i.info && t--,
      "link_close" === i.type && "auto" === i.info && t++);
  }
}
const T1t = /['"]/,
  I1t = /['"]/g;
function R1t(e, t, n) {
  return e.slice(0, t) + n + e.slice(t + 1);
}
function O1t(e, t) {
  let n;
  const i = [];
  for (let r = 0; r < e.length; r++) {
    const o = e[r],
      s = e[r].level;
    for (n = i.length - 1; n >= 0 && !(i[n].level <= s); n--);
    if (((i.length = n + 1), "text" !== o.type)) continue;
    let a = o.content,
      l = 0,
      c = a.length;
    e: for (; l < c; ) {
      I1t.lastIndex = l;
      const d = I1t.exec(a);
      if (!d) break;
      let u = !0,
        h = !0;
      l = d.index + 1;
      const g = "'" === d[0];
      let p = 32;
      if (d.index - 1 >= 0) p = a.charCodeAt(d.index - 1);
      else
        for (n = r - 1; n >= 0 && "softbreak" !== e[n].type && "hardbreak" !== e[n].type; n--)
          if (e[n].content) {
            p = e[n].content.charCodeAt(e[n].content.length - 1);
            break;
          }
      let f = 32;
      if (l < c) f = a.charCodeAt(l);
      else
        for (n = r + 1; n < e.length && "softbreak" !== e[n].type && "hardbreak" !== e[n].type; n++)
          if (e[n].content) {
            f = e[n].content.charCodeAt(0);
            break;
          }
      const m = c1t(p) || l1t(String.fromCharCode(p)),
        _ = c1t(f) || l1t(String.fromCharCode(f)),
        v = a1t(p),
        b = a1t(f);
      if (
        (b ? (u = !1) : _ && (v || m || (u = !1)),
        v ? (h = !1) : m && (b || _ || (h = !1)),
        34 === f && '"' === d[0] && p >= 48 && p <= 57 && (h = u = !1),
        u && h && ((u = m), (h = _)),
        u || h)
      ) {
        if (h)
          for (n = i.length - 1; n >= 0; n--) {
            let u = i[n];
            if (i[n].level < s) break;
            if (u.single === g && i[n].level === s) {
              let s, h;
              ((u = i[n]),
                g
                  ? ((s = t.md.options.quotes[2]), (h = t.md.options.quotes[3]))
                  : ((s = t.md.options.quotes[0]), (h = t.md.options.quotes[1])),
                (o.content = R1t(o.content, d.index, h)),
                (e[u.token].content = R1t(e[u.token].content, u.pos, s)),
                (l += h.length - 1),
                u.token === r && (l += s.length - 1),
                (a = o.content),
                (c = a.length),
                (i.length = n));
              continue e;
            }
          }
        u
          ? i.push({ token: r, pos: d.index, single: g, level: s })
          : h && g && (o.content = R1t(o.content, d.index, "’"));
      } else g && (o.content = R1t(o.content, d.index, "’"));
    }
  }
}
const M1t = [
  [
    "normalize",
    function (e) {
      let t;
      ((t = e.src.replace(b1t, "\n")), (t = t.replace(y1t, "�")), (e.src = t));
    },
  ],
  [
    "block",
    function (e) {
      let t;
      e.inlineMode
        ? ((t = new e.Token("inline", "", 0)),
          (t.content = e.src),
          (t.map = [0, 1]),
          (t.children = []),
          e.tokens.push(t))
        : e.md.block.parse(e.src, e.md, e.env, e.tokens);
    },
  ],
  [
    "inline",
    function (e) {
      const t = e.tokens;
      for (let n = 0, i = t.length; n < i; n++) {
        const i = t[n];
        "inline" === i.type && e.md.inline.parse(i.content, e.md, e.env, i.children);
      }
    },
  ],
  [
    "linkify",
    function (e) {
      const t = e.tokens;
      if (e.md.options.linkify)
        for (let n = 0, i = t.length; n < i; n++) {
          if ("inline" !== t[n].type || !e.md.linkify.pretest(t[n].content)) continue;
          let i = t[n].children,
            r = 0;
          for (let o = i.length - 1; o >= 0; o--) {
            const s = i[o];
            if ("link_close" !== s.type) {
              if (
                ("html_inline" === s.type &&
                  (x1t(s.content) && r > 0 && r--, w1t(s.content) && r++),
                !(r > 0) && "text" === s.type && e.md.linkify.test(s.content))
              ) {
                const r = s.content;
                let a = e.md.linkify.match(r);
                const l = [];
                let c = s.level,
                  d = 0;
                a.length > 0 &&
                  0 === a[0].index &&
                  o > 0 &&
                  "text_special" === i[o - 1].type &&
                  (a = a.slice(1));
                for (let t = 0; t < a.length; t++) {
                  const n = a[t].url,
                    i = e.md.normalizeLink(n);
                  if (!e.md.validateLink(i)) continue;
                  let o = a[t].text;
                  o = a[t].schema
                    ? "mailto:" !== a[t].schema || /^mailto:/i.test(o)
                      ? e.md.normalizeLinkText(o)
                      : e.md.normalizeLinkText("mailto:" + o).replace(/^mailto:/, "")
                    : e.md.normalizeLinkText("http://" + o).replace(/^http:\/\//, "");
                  const s = a[t].index;
                  if (s > d) {
                    const t = new e.Token("text", "", 0);
                    ((t.content = r.slice(d, s)), (t.level = c), l.push(t));
                  }
                  const u = new e.Token("link_open", "a", 1);
                  ((u.attrs = [["href", i]]),
                    (u.level = c++),
                    (u.markup = "linkify"),
                    (u.info = "auto"),
                    l.push(u));
                  const h = new e.Token("text", "", 0);
                  ((h.content = o), (h.level = c), l.push(h));
                  const g = new e.Token("link_close", "a", -1);
                  ((g.level = --c),
                    (g.markup = "linkify"),
                    (g.info = "auto"),
                    l.push(g),
                    (d = a[t].lastIndex));
                }
                if (d < r.length) {
                  const t = new e.Token("text", "", 0);
                  ((t.content = r.slice(d)), (t.level = c), l.push(t));
                }
                t[n].children = i = K0t(i, o, l);
              }
            } else for (o--; i[o].level !== s.level && "link_open" !== i[o].type; ) o--;
          }
        }
    },
  ],
  [
    "replacements",
    function (e) {
      let t;
      if (e.md.options.typographer)
        for (t = e.tokens.length - 1; t >= 0; t--)
          "inline" === e.tokens[t].type &&
            (S1t.test(e.tokens[t].content) && L1t(e.tokens[t].children),
            C1t.test(e.tokens[t].content) && D1t(e.tokens[t].children));
    },
  ],
  [
    "smartquotes",
    function (e) {
      if (e.md.options.typographer)
        for (let t = e.tokens.length - 1; t >= 0; t--)
          "inline" === e.tokens[t].type &&
            T1t.test(e.tokens[t].content) &&
            O1t(e.tokens[t].children, e);
    },
  ],
  [
    "text_join",
    function (e) {
      let t, n;
      const i = e.tokens,
        r = i.length;
      for (let o = 0; o < r; o++) {
        if ("inline" !== i[o].type) continue;
        const e = i[o].children,
          r = e.length;
        for (t = 0; t < r; t++) "text_special" === e[t].type && (e[t].type = "text");
        for (t = n = 0; t < r; t++)
          "text" === e[t].type && t + 1 < r && "text" === e[t + 1].type
            ? (e[t + 1].content = e[t].content + e[t + 1].content)
            : (t !== n && (e[n] = e[t]), n++);
        t !== n && (e.length = n);
      }
    },
  ],
];
function A1t() {
  this.ruler = new m1t();
  for (let e = 0; e < M1t.length; e++) this.ruler.push(M1t[e][0], M1t[e][1]);
}
function P1t(e, t, n, i) {
  ((this.src = e),
    (this.md = t),
    (this.env = n),
    (this.tokens = i),
    (this.bMarks = []),
    (this.eMarks = []),
    (this.tShift = []),
    (this.sCount = []),
    (this.bsCount = []),
    (this.blkIndent = 0),
    (this.line = 0),
    (this.lineMax = 0),
    (this.tight = !1),
    (this.ddIndent = -1),
    (this.listIndent = -1),
    (this.parentType = "root"),
    (this.level = 0));
  const r = this.src;
  for (let o = 0, s = 0, a = 0, l = 0, c = r.length, d = !1; s < c; s++) {
    const e = r.charCodeAt(s);
    if (!d) {
      if (s1t(e)) {
        (a++, 9 === e ? (l += 4 - (l % 4)) : l++);
        continue;
      }
      d = !0;
    }
    (10 !== e && s !== c - 1) ||
      (10 !== e && s++,
      this.bMarks.push(o),
      this.eMarks.push(s),
      this.tShift.push(a),
      this.sCount.push(l),
      this.bsCount.push(0),
      (d = !1),
      (a = 0),
      (l = 0),
      (o = s + 1));
  }
  (this.bMarks.push(r.length),
    this.eMarks.push(r.length),
    this.tShift.push(0),
    this.sCount.push(0),
    this.bsCount.push(0),
    (this.lineMax = this.bMarks.length - 1));
}
((A1t.prototype.process = function (e) {
  const t = this.ruler.getRules("");
  for (let n = 0, i = t.length; n < i; n++) t[n](e);
}),
  (A1t.prototype.State = v1t),
  (P1t.prototype.push = function (e, t, n) {
    const i = new _1t(e, t, n);
    return (
      (i.block = !0),
      n < 0 && this.level--,
      (i.level = this.level),
      n > 0 && this.level++,
      this.tokens.push(i),
      i
    );
  }),
  (P1t.prototype.isEmpty = function (e) {
    return this.bMarks[e] + this.tShift[e] >= this.eMarks[e];
  }),
  (P1t.prototype.skipEmptyLines = function (e) {
    for (let t = this.lineMax; e < t && !(this.bMarks[e] + this.tShift[e] < this.eMarks[e]); e++);
    return e;
  }),
  (P1t.prototype.skipSpaces = function (e) {
    for (let t = this.src.length; e < t; e++) {
      if (!s1t(this.src.charCodeAt(e))) break;
    }
    return e;
  }),
  (P1t.prototype.skipSpacesBack = function (e, t) {
    if (e <= t) return e;
    for (; e > t; ) if (!s1t(this.src.charCodeAt(--e))) return e + 1;
    return e;
  }),
  (P1t.prototype.skipChars = function (e, t) {
    for (let n = this.src.length; e < n && this.src.charCodeAt(e) === t; e++);
    return e;
  }),
  (P1t.prototype.skipCharsBack = function (e, t, n) {
    if (e <= n) return e;
    for (; e > n; ) if (t !== this.src.charCodeAt(--e)) return e + 1;
    return e;
  }),
  (P1t.prototype.getLines = function (e, t, n, i) {
    if (e >= t) return "";
    const r = new Array(t - e);
    for (let o = 0, s = e; s < t; s++, o++) {
      let e = 0;
      const a = this.bMarks[s];
      let l,
        c = a;
      for (l = s + 1 < t || i ? this.eMarks[s] + 1 : this.eMarks[s]; c < l && e < n; ) {
        const t = this.src.charCodeAt(c);
        if (s1t(t)) 9 === t ? (e += 4 - ((e + this.bsCount[s]) % 4)) : e++;
        else {
          if (!(c - a < this.tShift[s])) break;
          e++;
        }
        c++;
      }
      r[o] = e > n ? new Array(e - n + 1).join(" ") + this.src.slice(c, l) : this.src.slice(c, l);
    }
    return r.join("");
  }),
  (P1t.prototype.Token = _1t));
function j1t(e, t) {
  const n = e.bMarks[t] + e.tShift[t],
    i = e.eMarks[t];
  return e.src.slice(n, i);
}
function F1t(e) {
  const t = [],
    n = e.length;
  let i = 0,
    r = e.charCodeAt(i),
    o = !1,
    s = 0,
    a = "";
  for (; i < n; )
    (124 === r &&
      (o
        ? ((a += e.substring(s, i - 1)), (s = i))
        : (t.push(a + e.substring(s, i)), (a = ""), (s = i + 1))),
      (o = 92 === r),
      i++,
      (r = e.charCodeAt(i)));
  return (t.push(a + e.substring(s)), t);
}
function B1t(e, t) {
  const n = e.eMarks[t];
  let i = e.bMarks[t] + e.tShift[t];
  const r = e.src.charCodeAt(i++);
  if (42 !== r && 45 !== r && 43 !== r) return -1;
  if (i < n) {
    if (!s1t(e.src.charCodeAt(i))) return -1;
  }
  return i;
}
function V1t(e, t) {
  const n = e.bMarks[t] + e.tShift[t],
    i = e.eMarks[t];
  let r = n;
  if (r + 1 >= i) return -1;
  let o = e.src.charCodeAt(r++);
  if (o < 48 || o > 57) return -1;
  for (;;) {
    if (r >= i) return -1;
    if (((o = e.src.charCodeAt(r++)), !(o >= 48 && o <= 57))) {
      if (41 === o || 46 === o) break;
      return -1;
    }
    if (r - n >= 10) return -1;
  }
  return r < i && ((o = e.src.charCodeAt(r)), !s1t(o)) ? -1 : r;
}
const W1t =
    "<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",
  H1t = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",
  z1t = new RegExp(
    "^(?:" +
      W1t +
      "|" +
      H1t +
      "|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)",
  ),
  U1t = new RegExp("^(?:" + W1t + "|" + H1t + ")"),
  $1t = [
    [/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, !0],
    [/^<!--/, /-->/, !0],
    [/^<\?/, /\?>/, !0],
    [/^<![A-Z]/, />/, !0],
    [/^<!\[CDATA\[/, /\]\]>/, !0],
    [
      new RegExp(
        "^</?(" +
          [
            "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",
            "h1",
            "h2",
            "h3",
            "h4",
            "h5",
            "h6",
            "head",
            "header",
            "hr",
            "html",
            "iframe",
            "legend",
            "li",
            "link",
            "main",
            "menu",
            "menuitem",
            "nav",
            "noframes",
            "ol",
            "optgroup",
            "option",
            "p",
            "param",
            "search",
            "section",
            "summary",
            "table",
            "tbody",
            "td",
            "tfoot",
            "th",
            "thead",
            "title",
            "tr",
            "track",
            "ul",
          ].join("|") +
          ")(?=(\\s|/?>|$))",
        "i",
      ),
      /^$/,
      !0,
    ],
    [new RegExp(U1t.source + "\\s*$"), /^$/, !1],
  ];
const q1t = [
  [
    "table",
    function (e, t, n, i) {
      if (t + 2 > n) return !1;
      let r = t + 1;
      if (e.sCount[r] < e.blkIndent) return !1;
      if (e.sCount[r] - e.blkIndent >= 4) return !1;
      let o = e.bMarks[r] + e.tShift[r];
      if (o >= e.eMarks[r]) return !1;
      const s = e.src.charCodeAt(o++);
      if (124 !== s && 45 !== s && 58 !== s) return !1;
      if (o >= e.eMarks[r]) return !1;
      const a = e.src.charCodeAt(o++);
      if (124 !== a && 45 !== a && 58 !== a && !s1t(a)) return !1;
      if (45 === s && s1t(a)) return !1;
      for (; o < e.eMarks[r]; ) {
        const t = e.src.charCodeAt(o);
        if (124 !== t && 45 !== t && 58 !== t && !s1t(t)) return !1;
        o++;
      }
      let l = j1t(e, t + 1),
        c = l.split("|");
      const d = [];
      for (let _ = 0; _ < c.length; _++) {
        const e = c[_].trim();
        if (!e) {
          if (0 === _ || _ === c.length - 1) continue;
          return !1;
        }
        if (!/^:?-+:?$/.test(e)) return !1;
        58 === e.charCodeAt(e.length - 1)
          ? d.push(58 === e.charCodeAt(0) ? "center" : "right")
          : 58 === e.charCodeAt(0)
            ? d.push("left")
            : d.push("");
      }
      if (((l = j1t(e, t).trim()), -1 === l.indexOf("|"))) return !1;
      if (e.sCount[t] - e.blkIndent >= 4) return !1;
      ((c = F1t(l)),
        c.length && "" === c[0] && c.shift(),
        c.length && "" === c[c.length - 1] && c.pop());
      const u = c.length;
      if (0 === u || u !== d.length) return !1;
      if (i) return !0;
      const h = e.parentType;
      e.parentType = "table";
      const g = e.md.block.ruler.getRules("blockquote"),
        p = [t, 0];
      ((e.push("table_open", "table", 1).map = p),
        (e.push("thead_open", "thead", 1).map = [t, t + 1]),
        (e.push("tr_open", "tr", 1).map = [t, t + 1]));
      for (let _ = 0; _ < c.length; _++) {
        const t = e.push("th_open", "th", 1);
        d[_] && (t.attrs = [["style", "text-align:" + d[_]]]);
        const n = e.push("inline", "", 0);
        ((n.content = c[_].trim()), (n.children = []), e.push("th_close", "th", -1));
      }
      let f;
      (e.push("tr_close", "tr", -1), e.push("thead_close", "thead", -1));
      let m = 0;
      for (r = t + 2; r < n && !(e.sCount[r] < e.blkIndent); r++) {
        let i = !1;
        for (let t = 0, o = g.length; t < o; t++)
          if (g[t](e, r, n, !0)) {
            i = !0;
            break;
          }
        if (i) break;
        if (((l = j1t(e, r).trim()), !l)) break;
        if (e.sCount[r] - e.blkIndent >= 4) break;
        if (
          ((c = F1t(l)),
          c.length && "" === c[0] && c.shift(),
          c.length && "" === c[c.length - 1] && c.pop(),
          (m += u - c.length),
          m > 65536)
        )
          break;
        if (r === t + 2) {
          e.push("tbody_open", "tbody", 1).map = f = [t + 2, 0];
        }
        e.push("tr_open", "tr", 1).map = [r, r + 1];
        for (let t = 0; t < u; t++) {
          const n = e.push("td_open", "td", 1);
          d[t] && (n.attrs = [["style", "text-align:" + d[t]]]);
          const i = e.push("inline", "", 0);
          ((i.content = c[t] ? c[t].trim() : ""), (i.children = []), e.push("td_close", "td", -1));
        }
        e.push("tr_close", "tr", -1);
      }
      return (
        f && (e.push("tbody_close", "tbody", -1), (f[1] = r)),
        e.push("table_close", "table", -1),
        (p[1] = r),
        (e.parentType = h),
        (e.line = r),
        !0
      );
    },
    ["paragraph", "reference"],
  ],
  [
    "code",
    function (e, t, n) {
      if (e.sCount[t] - e.blkIndent < 4) return !1;
      let i = t + 1,
        r = i;
      for (; i < n; )
        if (e.isEmpty(i)) i++;
        else {
          if (!(e.sCount[i] - e.blkIndent >= 4)) break;
          (i++, (r = i));
        }
      e.line = r;
      const o = e.push("code_block", "code", 0);
      return (
        (o.content = e.getLines(t, r, 4 + e.blkIndent, !1) + "\n"),
        (o.map = [t, e.line]),
        !0
      );
    },
  ],
  [
    "fence",
    function (e, t, n, i) {
      let r = e.bMarks[t] + e.tShift[t],
        o = e.eMarks[t];
      if (e.sCount[t] - e.blkIndent >= 4) return !1;
      if (r + 3 > o) return !1;
      const s = e.src.charCodeAt(r);
      if (126 !== s && 96 !== s) return !1;
      let a = r;
      r = e.skipChars(r, s);
      let l = r - a;
      if (l < 3) return !1;
      const c = e.src.slice(a, r),
        d = e.src.slice(r, o);
      if (96 === s && d.indexOf(String.fromCharCode(s)) >= 0) return !1;
      if (i) return !0;
      let u = t,
        h = !1;
      for (
        ;
        (u++, !(u >= n)) &&
        ((r = a = e.bMarks[u] + e.tShift[u]),
        (o = e.eMarks[u]),
        !(r < o && e.sCount[u] < e.blkIndent));
      )
        if (
          e.src.charCodeAt(r) === s &&
          !(
            e.sCount[u] - e.blkIndent >= 4 ||
            ((r = e.skipChars(r, s)), r - a < l || ((r = e.skipSpaces(r)), r < o))
          )
        ) {
          h = !0;
          break;
        }
      ((l = e.sCount[t]), (e.line = u + (h ? 1 : 0)));
      const g = e.push("fence", "code", 0);
      return (
        (g.info = d),
        (g.content = e.getLines(t + 1, u, l, !0)),
        (g.markup = c),
        (g.map = [t, e.line]),
        !0
      );
    },
    ["paragraph", "reference", "blockquote", "list"],
  ],
  [
    "blockquote",
    function (e, t, n, i) {
      let r = e.bMarks[t] + e.tShift[t],
        o = e.eMarks[t];
      const s = e.lineMax;
      if (e.sCount[t] - e.blkIndent >= 4) return !1;
      if (62 !== e.src.charCodeAt(r)) return !1;
      if (i) return !0;
      const a = [],
        l = [],
        c = [],
        d = [],
        u = e.md.block.ruler.getRules("blockquote"),
        h = e.parentType;
      e.parentType = "blockquote";
      let g,
        p = !1;
      for (g = t; g < n; g++) {
        const t = e.sCount[g] < e.blkIndent;
        if (((r = e.bMarks[g] + e.tShift[g]), (o = e.eMarks[g]), r >= o)) break;
        if (62 === e.src.charCodeAt(r++) && !t) {
          let t,
            n,
            i = e.sCount[g] + 1;
          32 === e.src.charCodeAt(r)
            ? (r++, i++, (n = !1), (t = !0))
            : 9 === e.src.charCodeAt(r)
              ? ((t = !0), (e.bsCount[g] + i) % 4 == 3 ? (r++, i++, (n = !1)) : (n = !0))
              : (t = !1);
          let s = i;
          for (a.push(e.bMarks[g]), e.bMarks[g] = r; r < o; ) {
            const t = e.src.charCodeAt(r);
            if (!s1t(t)) break;
            (9 === t ? (s += 4 - ((s + e.bsCount[g] + (n ? 1 : 0)) % 4)) : s++, r++);
          }
          ((p = r >= o),
            l.push(e.bsCount[g]),
            (e.bsCount[g] = e.sCount[g] + 1 + (t ? 1 : 0)),
            c.push(e.sCount[g]),
            (e.sCount[g] = s - i),
            d.push(e.tShift[g]),
            (e.tShift[g] = r - e.bMarks[g]));
          continue;
        }
        if (p) break;
        let i = !1;
        for (let r = 0, o = u.length; r < o; r++)
          if (u[r](e, g, n, !0)) {
            i = !0;
            break;
          }
        if (i) {
          ((e.lineMax = g),
            0 !== e.blkIndent &&
              (a.push(e.bMarks[g]),
              l.push(e.bsCount[g]),
              d.push(e.tShift[g]),
              c.push(e.sCount[g]),
              (e.sCount[g] -= e.blkIndent)));
          break;
        }
        (a.push(e.bMarks[g]),
          l.push(e.bsCount[g]),
          d.push(e.tShift[g]),
          c.push(e.sCount[g]),
          (e.sCount[g] = -1));
      }
      const f = e.blkIndent;
      e.blkIndent = 0;
      const m = e.push("blockquote_open", "blockquote", 1);
      m.markup = ">";
      const _ = [t, 0];
      ((m.map = _),
        e.md.block.tokenize(e, t, g),
        (e.push("blockquote_close", "blockquote", -1).markup = ">"),
        (e.lineMax = s),
        (e.parentType = h),
        (_[1] = e.line));
      for (let v = 0; v < d.length; v++)
        ((e.bMarks[v + t] = a[v]),
          (e.tShift[v + t] = d[v]),
          (e.sCount[v + t] = c[v]),
          (e.bsCount[v + t] = l[v]));
      return ((e.blkIndent = f), !0);
    },
    ["paragraph", "reference", "blockquote", "list"],
  ],
  [
    "hr",
    function (e, t, n, i) {
      const r = e.eMarks[t];
      if (e.sCount[t] - e.blkIndent >= 4) return !1;
      let o = e.bMarks[t] + e.tShift[t];
      const s = e.src.charCodeAt(o++);
      if (42 !== s && 45 !== s && 95 !== s) return !1;
      let a = 1;
      for (; o < r; ) {
        const t = e.src.charCodeAt(o++);
        if (t !== s && !s1t(t)) return !1;
        t === s && a++;
      }
      if (a < 3) return !1;
      if (i) return !0;
      e.line = t + 1;
      const l = e.push("hr", "hr", 0);
      return ((l.map = [t, e.line]), (l.markup = Array(a + 1).join(String.fromCharCode(s))), !0);
    },
    ["paragraph", "reference", "blockquote", "list"],
  ],
  [
    "list",
    function (e, t, n, i) {
      let r,
        o,
        s,
        a,
        l = t,
        c = !0;
      if (e.sCount[l] - e.blkIndent >= 4) return !1;
      if (e.listIndent >= 0 && e.sCount[l] - e.listIndent >= 4 && e.sCount[l] < e.blkIndent)
        return !1;
      let d,
        u,
        h,
        g = !1;
      if (
        (i && "paragraph" === e.parentType && e.sCount[l] >= e.blkIndent && (g = !0),
        (h = V1t(e, l)) >= 0)
      ) {
        if (
          ((d = !0),
          (s = e.bMarks[l] + e.tShift[l]),
          (u = Number(e.src.slice(s, h - 1))),
          g && 1 !== u)
        )
          return !1;
      } else {
        if (!((h = B1t(e, l)) >= 0)) return !1;
        d = !1;
      }
      if (g && e.skipSpaces(h) >= e.eMarks[l]) return !1;
      if (i) return !0;
      const p = e.src.charCodeAt(h - 1),
        f = e.tokens.length;
      d
        ? ((a = e.push("ordered_list_open", "ol", 1)), 1 !== u && (a.attrs = [["start", u]]))
        : (a = e.push("bullet_list_open", "ul", 1));
      const m = [l, 0];
      ((a.map = m), (a.markup = String.fromCharCode(p)));
      let _ = !1;
      const v = e.md.block.ruler.getRules("list"),
        b = e.parentType;
      for (e.parentType = "list"; l < n; ) {
        ((o = h), (r = e.eMarks[l]));
        const t = e.sCount[l] + h - (e.bMarks[l] + e.tShift[l]);
        let i = t;
        for (; o < r; ) {
          const t = e.src.charCodeAt(o);
          if (9 === t) i += 4 - ((i + e.bsCount[l]) % 4);
          else {
            if (32 !== t) break;
            i++;
          }
          o++;
        }
        const u = o;
        let g;
        ((g = u >= r ? 1 : i - t), g > 4 && (g = 1));
        const f = t + g;
        ((a = e.push("list_item_open", "li", 1)), (a.markup = String.fromCharCode(p)));
        const m = [l, 0];
        ((a.map = m), d && (a.info = e.src.slice(s, h - 1)));
        const b = e.tight,
          y = e.tShift[l],
          x = e.sCount[l],
          w = e.listIndent;
        if (
          ((e.listIndent = e.blkIndent),
          (e.blkIndent = f),
          (e.tight = !0),
          (e.tShift[l] = u - e.bMarks[l]),
          (e.sCount[l] = i),
          u >= r && e.isEmpty(l + 1)
            ? (e.line = Math.min(e.line + 2, n))
            : e.md.block.tokenize(e, l, n, !0),
          (e.tight && !_) || (c = !1),
          (_ = e.line - l > 1 && e.isEmpty(e.line - 1)),
          (e.blkIndent = e.listIndent),
          (e.listIndent = w),
          (e.tShift[l] = y),
          (e.sCount[l] = x),
          (e.tight = b),
          (a = e.push("list_item_close", "li", -1)),
          (a.markup = String.fromCharCode(p)),
          (l = e.line),
          (m[1] = l),
          l >= n)
        )
          break;
        if (e.sCount[l] < e.blkIndent) break;
        if (e.sCount[l] - e.blkIndent >= 4) break;
        let C = !1;
        for (let r = 0, o = v.length; r < o; r++)
          if (v[r](e, l, n, !0)) {
            C = !0;
            break;
          }
        if (C) break;
        if (d) {
          if (((h = V1t(e, l)), h < 0)) break;
          s = e.bMarks[l] + e.tShift[l];
        } else if (((h = B1t(e, l)), h < 0)) break;
        if (p !== e.src.charCodeAt(h - 1)) break;
      }
      return (
        (a = d ? e.push("ordered_list_close", "ol", -1) : e.push("bullet_list_close", "ul", -1)),
        (a.markup = String.fromCharCode(p)),
        (m[1] = l),
        (e.line = l),
        (e.parentType = b),
        c &&
          (function (e, t) {
            const n = e.level + 2;
            for (let i = t + 2, r = e.tokens.length - 2; i < r; i++)
              e.tokens[i].level === n &&
                "paragraph_open" === e.tokens[i].type &&
                ((e.tokens[i + 2].hidden = !0), (e.tokens[i].hidden = !0), (i += 2));
          })(e, f),
        !0
      );
    },
    ["paragraph", "reference", "blockquote"],
  ],
  [
    "reference",
    function (e, t, n, i) {
      let r = e.bMarks[t] + e.tShift[t],
        o = e.eMarks[t],
        s = t + 1;
      if (e.sCount[t] - e.blkIndent >= 4) return !1;
      if (91 !== e.src.charCodeAt(r)) return !1;
      function a(t) {
        const n = e.lineMax;
        if (t >= n || e.isEmpty(t)) return null;
        let i = !1;
        if ((e.sCount[t] - e.blkIndent > 3 && (i = !0), e.sCount[t] < 0 && (i = !0), !i)) {
          const i = e.md.block.ruler.getRules("reference"),
            r = e.parentType;
          e.parentType = "reference";
          let o = !1;
          for (let s = 0, a = i.length; s < a; s++)
            if (i[s](e, t, n, !0)) {
              o = !0;
              break;
            }
          if (((e.parentType = r), o)) return null;
        }
        const r = e.bMarks[t] + e.tShift[t],
          o = e.eMarks[t];
        return e.src.slice(r, o + 1);
      }
      let l = e.src.slice(r, o + 1);
      o = l.length;
      let c = -1;
      for (r = 1; r < o; r++) {
        const e = l.charCodeAt(r);
        if (91 === e) return !1;
        if (93 === e) {
          c = r;
          break;
        }
        if (10 === e) {
          const e = a(s);
          null !== e && ((l += e), (o = l.length), s++);
        } else if (92 === e && (r++, r < o && 10 === l.charCodeAt(r))) {
          const e = a(s);
          null !== e && ((l += e), (o = l.length), s++);
        }
      }
      if (c < 0 || 58 !== l.charCodeAt(c + 1)) return !1;
      for (r = c + 2; r < o; r++) {
        const e = l.charCodeAt(r);
        if (10 === e) {
          const e = a(s);
          null !== e && ((l += e), (o = l.length), s++);
        } else if (!s1t(e)) break;
      }
      const d = e.md.helpers.parseLinkDestination(l, r, o);
      if (!d.ok) return !1;
      const u = e.md.normalizeLink(d.str);
      if (!e.md.validateLink(u)) return !1;
      r = d.pos;
      const h = r,
        g = s,
        p = r;
      for (; r < o; r++) {
        const e = l.charCodeAt(r);
        if (10 === e) {
          const e = a(s);
          null !== e && ((l += e), (o = l.length), s++);
        } else if (!s1t(e)) break;
      }
      let f,
        m = e.md.helpers.parseLinkTitle(l, r, o);
      for (; m.can_continue; ) {
        const t = a(s);
        if (null === t) break;
        ((l += t), (r = o), (o = l.length), s++, (m = e.md.helpers.parseLinkTitle(l, r, o, m)));
      }
      for (
        r < o && p !== r && m.ok ? ((f = m.str), (r = m.pos)) : ((f = ""), (r = h), (s = g));
        r < o;
      ) {
        if (!s1t(l.charCodeAt(r))) break;
        r++;
      }
      if (r < o && 10 !== l.charCodeAt(r) && f)
        for (f = "", r = h, s = g; r < o; ) {
          if (!s1t(l.charCodeAt(r))) break;
          r++;
        }
      if (r < o && 10 !== l.charCodeAt(r)) return !1;
      const _ = d1t(l.slice(1, c));
      return (
        !!_ &&
        (i ||
          (void 0 === e.env.references && (e.env.references = {}),
          void 0 === e.env.references[_] && (e.env.references[_] = { title: f, href: u }),
          (e.line = s)),
        !0)
      );
    },
  ],
  [
    "html_block",
    function (e, t, n, i) {
      let r = e.bMarks[t] + e.tShift[t],
        o = e.eMarks[t];
      if (e.sCount[t] - e.blkIndent >= 4) return !1;
      if (!e.md.options.html) return !1;
      if (60 !== e.src.charCodeAt(r)) return !1;
      let s = e.src.slice(r, o),
        a = 0;
      for (; a < $1t.length && !$1t[a][0].test(s); a++);
      if (a === $1t.length) return !1;
      if (i) return $1t[a][2];
      let l = t + 1;
      if (!$1t[a][1].test(s))
        for (; l < n && !(e.sCount[l] < e.blkIndent); l++)
          if (
            ((r = e.bMarks[l] + e.tShift[l]),
            (o = e.eMarks[l]),
            (s = e.src.slice(r, o)),
            $1t[a][1].test(s))
          ) {
            0 !== s.length && l++;
            break;
          }
      e.line = l;
      const c = e.push("html_block", "", 0);
      return ((c.map = [t, l]), (c.content = e.getLines(t, l, e.blkIndent, !0)), !0);
    },
    ["paragraph", "reference", "blockquote"],
  ],
  [
    "heading",
    function (e, t, n, i) {
      let r = e.bMarks[t] + e.tShift[t],
        o = e.eMarks[t];
      if (e.sCount[t] - e.blkIndent >= 4) return !1;
      let s = e.src.charCodeAt(r);
      if (35 !== s || r >= o) return !1;
      let a = 1;
      for (s = e.src.charCodeAt(++r); 35 === s && r < o && a <= 6; )
        (a++, (s = e.src.charCodeAt(++r)));
      if (a > 6 || (r < o && !s1t(s))) return !1;
      if (i) return !0;
      o = e.skipSpacesBack(o, r);
      const l = e.skipCharsBack(o, 35, r);
      (l > r && s1t(e.src.charCodeAt(l - 1)) && (o = l), (e.line = t + 1));
      const c = e.push("heading_open", "h" + String(a), 1);
      ((c.markup = "########".slice(0, a)), (c.map = [t, e.line]));
      const d = e.push("inline", "", 0);
      return (
        (d.content = e.src.slice(r, o).trim()),
        (d.map = [t, e.line]),
        (d.children = []),
        (e.push("heading_close", "h" + String(a), -1).markup = "########".slice(0, a)),
        !0
      );
    },
    ["paragraph", "reference", "blockquote"],
  ],
  [
    "lheading",
    function (e, t, n) {
      const i = e.md.block.ruler.getRules("paragraph");
      if (e.sCount[t] - e.blkIndent >= 4) return !1;
      const r = e.parentType;
      e.parentType = "paragraph";
      let o,
        s = 0,
        a = t + 1;
      for (; a < n && !e.isEmpty(a); a++) {
        if (e.sCount[a] - e.blkIndent > 3) continue;
        if (e.sCount[a] >= e.blkIndent) {
          let t = e.bMarks[a] + e.tShift[a];
          const n = e.eMarks[a];
          if (
            t < n &&
            ((o = e.src.charCodeAt(t)),
            (45 === o || 61 === o) && ((t = e.skipChars(t, o)), (t = e.skipSpaces(t)), t >= n))
          ) {
            s = 61 === o ? 1 : 2;
            break;
          }
        }
        if (e.sCount[a] < 0) continue;
        let t = !1;
        for (let r = 0, o = i.length; r < o; r++)
          if (i[r](e, a, n, !0)) {
            t = !0;
            break;
          }
        if (t) break;
      }
      if (!s) return !1;
      const l = e.getLines(t, a, e.blkIndent, !1).trim();
      e.line = a + 1;
      const c = e.push("heading_open", "h" + String(s), 1);
      ((c.markup = String.fromCharCode(o)), (c.map = [t, e.line]));
      const d = e.push("inline", "", 0);
      return (
        (d.content = l),
        (d.map = [t, e.line - 1]),
        (d.children = []),
        (e.push("heading_close", "h" + String(s), -1).markup = String.fromCharCode(o)),
        (e.parentType = r),
        !0
      );
    },
  ],
  [
    "paragraph",
    function (e, t, n) {
      const i = e.md.block.ruler.getRules("paragraph"),
        r = e.parentType;
      let o = t + 1;
      for (e.parentType = "paragraph"; o < n && !e.isEmpty(o); o++) {
        if (e.sCount[o] - e.blkIndent > 3) continue;
        if (e.sCount[o] < 0) continue;
        let t = !1;
        for (let r = 0, s = i.length; r < s; r++)
          if (i[r](e, o, n, !0)) {
            t = !0;
            break;
          }
        if (t) break;
      }
      const s = e.getLines(t, o, e.blkIndent, !1).trim();
      ((e.line = o), (e.push("paragraph_open", "p", 1).map = [t, e.line]));
      const a = e.push("inline", "", 0);
      return (
        (a.content = s),
        (a.map = [t, e.line]),
        (a.children = []),
        e.push("paragraph_close", "p", -1),
        (e.parentType = r),
        !0
      );
    },
  ],
];
function K1t() {
  this.ruler = new m1t();
  for (let e = 0; e < q1t.length; e++)
    this.ruler.push(q1t[e][0], q1t[e][1], { alt: (q1t[e][2] || []).slice() });
}
function G1t(e, t, n, i) {
  ((this.src = e),
    (this.env = n),
    (this.md = t),
    (this.tokens = i),
    (this.tokens_meta = Array(i.length)),
    (this.pos = 0),
    (this.posMax = this.src.length),
    (this.level = 0),
    (this.pending = ""),
    (this.pendingLevel = 0),
    (this.cache = {}),
    (this.delimiters = []),
    (this._prev_delimiters = []),
    (this.backticks = {}),
    (this.backticksScanned = !1),
    (this.linkLevel = 0));
}
function Z1t(e) {
  switch (e) {
    case 10:
    case 33:
    case 35:
    case 36:
    case 37:
    case 38:
    case 42:
    case 43:
    case 45:
    case 58:
    case 60:
    case 61:
    case 62:
    case 64:
    case 91:
    case 92:
    case 93:
    case 94:
    case 95:
    case 96:
    case 123:
    case 125:
    case 126:
      return !0;
    default:
      return !1;
  }
}
((K1t.prototype.tokenize = function (e, t, n) {
  const i = this.ruler.getRules(""),
    r = i.length,
    o = e.md.options.maxNesting;
  let s = t,
    a = !1;
  for (
    ;
    s < n && ((e.line = s = e.skipEmptyLines(s)), !(s >= n)) && !(e.sCount[s] < e.blkIndent);
  ) {
    if (e.level >= o) {
      e.line = n;
      break;
    }
    const t = e.line;
    let l = !1;
    for (let o = 0; o < r; o++)
      if (((l = i[o](e, s, n, !1)), l)) {
        if (t >= e.line) throw new Error("block rule didn't increment state.line");
        break;
      }
    if (!l) throw new Error("none of the block rules matched");
    ((e.tight = !a),
      e.isEmpty(e.line - 1) && (a = !0),
      (s = e.line),
      s < n && e.isEmpty(s) && ((a = !0), s++, (e.line = s)));
  }
}),
  (K1t.prototype.parse = function (e, t, n, i) {
    if (!e) return;
    const r = new this.State(e, t, n, i);
    this.tokenize(r, r.line, r.lineMax);
  }),
  (K1t.prototype.State = P1t),
  (G1t.prototype.pushPending = function () {
    const e = new _1t("text", "", 0);
    return (
      (e.content = this.pending),
      (e.level = this.pendingLevel),
      this.tokens.push(e),
      (this.pending = ""),
      e
    );
  }),
  (G1t.prototype.push = function (e, t, n) {
    this.pending && this.pushPending();
    const i = new _1t(e, t, n);
    let r = null;
    return (
      n < 0 && (this.level--, (this.delimiters = this._prev_delimiters.pop())),
      (i.level = this.level),
      n > 0 &&
        (this.level++,
        this._prev_delimiters.push(this.delimiters),
        (this.delimiters = []),
        (r = { delimiters: this.delimiters })),
      (this.pendingLevel = this.level),
      this.tokens.push(i),
      this.tokens_meta.push(r),
      i
    );
  }),
  (G1t.prototype.scanDelims = function (e, t) {
    const n = this.posMax,
      i = this.src.charCodeAt(e),
      r = e > 0 ? this.src.charCodeAt(e - 1) : 32;
    let o = e;
    for (; o < n && this.src.charCodeAt(o) === i; ) o++;
    const s = o - e,
      a = o < n ? this.src.charCodeAt(o) : 32,
      l = c1t(r) || l1t(String.fromCharCode(r)),
      c = c1t(a) || l1t(String.fromCharCode(a)),
      d = a1t(r),
      u = a1t(a),
      h = !u && (!c || d || l),
      g = !d && (!l || u || c);
    return { can_open: h && (t || !g || l), can_close: g && (t || !h || c), length: s };
  }),
  (G1t.prototype.Token = _1t));
const Y1t = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
const X1t = [];
for (let Set = 0; Set < 256; Set++) X1t.push(0);
function Q1t(e, t) {
  let n;
  const i = [],
    r = t.length;
  for (let o = 0; o < r; o++) {
    const r = t[o];
    if (126 !== r.marker) continue;
    if (-1 === r.end) continue;
    const s = t[r.end];
    ((n = e.tokens[r.token]),
      (n.type = "s_open"),
      (n.tag = "s"),
      (n.nesting = 1),
      (n.markup = "~~"),
      (n.content = ""),
      (n = e.tokens[s.token]),
      (n.type = "s_close"),
      (n.tag = "s"),
      (n.nesting = -1),
      (n.markup = "~~"),
      (n.content = ""),
      "text" === e.tokens[s.token - 1].type &&
        "~" === e.tokens[s.token - 1].content &&
        i.push(s.token - 1));
  }
  for (; i.length; ) {
    const t = i.pop();
    let r = t + 1;
    for (; r < e.tokens.length && "s_close" === e.tokens[r].type; ) r++;
    (r--, t !== r && ((n = e.tokens[r]), (e.tokens[r] = e.tokens[t]), (e.tokens[t] = n)));
  }
}
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function (e) {
  X1t[e.charCodeAt(0)] = 1;
});
const J1t = {
  tokenize: function (e, t) {
    const n = e.pos,
      i = e.src.charCodeAt(n);
    if (t) return !1;
    if (126 !== i) return !1;
    const r = e.scanDelims(e.pos, !0);
    let o = r.length;
    const s = String.fromCharCode(i);
    if (o < 2) return !1;
    let a;
    o % 2 && ((a = e.push("text", "", 0)), (a.content = s), o--);
    for (let l = 0; l < o; l += 2)
      ((a = e.push("text", "", 0)),
        (a.content = s + s),
        e.delimiters.push({
          marker: i,
          length: 0,
          token: e.tokens.length - 1,
          end: -1,
          open: r.can_open,
          close: r.can_close,
        }));
    return ((e.pos += r.length), !0);
  },
  postProcess: function (e) {
    const t = e.tokens_meta,
      n = e.tokens_meta.length;
    Q1t(e, e.delimiters);
    for (let i = 0; i < n; i++) t[i] && t[i].delimiters && Q1t(e, t[i].delimiters);
  },
};
function e2t(e, t) {
  for (let n = t.length - 1; n >= 0; n--) {
    const i = t[n];
    if (95 !== i.marker && 42 !== i.marker) continue;
    if (-1 === i.end) continue;
    const r = t[i.end],
      o =
        n > 0 &&
        t[n - 1].end === i.end + 1 &&
        t[n - 1].marker === i.marker &&
        t[n - 1].token === i.token - 1 &&
        t[i.end + 1].token === r.token + 1,
      s = String.fromCharCode(i.marker),
      a = e.tokens[i.token];
    ((a.type = o ? "strong_open" : "em_open"),
      (a.tag = o ? "strong" : "em"),
      (a.nesting = 1),
      (a.markup = o ? s + s : s),
      (a.content = ""));
    const l = e.tokens[r.token];
    ((l.type = o ? "strong_close" : "em_close"),
      (l.tag = o ? "strong" : "em"),
      (l.nesting = -1),
      (l.markup = o ? s + s : s),
      (l.content = ""),
      o &&
        ((e.tokens[t[n - 1].token].content = ""),
        (e.tokens[t[i.end + 1].token].content = ""),
        n--));
  }
}
const t2t = {
  tokenize: function (e, t) {
    const n = e.pos,
      i = e.src.charCodeAt(n);
    if (t) return !1;
    if (95 !== i && 42 !== i) return !1;
    const r = e.scanDelims(e.pos, 42 === i);
    for (let o = 0; o < r.length; o++) {
      ((e.push("text", "", 0).content = String.fromCharCode(i)),
        e.delimiters.push({
          marker: i,
          length: r.length,
          token: e.tokens.length - 1,
          end: -1,
          open: r.can_open,
          close: r.can_close,
        }));
    }
    return ((e.pos += r.length), !0);
  },
  postProcess: function (e) {
    const t = e.tokens_meta,
      n = e.tokens_meta.length;
    e2t(e, e.delimiters);
    for (let i = 0; i < n; i++) t[i] && t[i].delimiters && e2t(e, t[i].delimiters);
  },
};
const n2t =
    /^([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])?)*)$/,
  i2t = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
const r2t = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,
  o2t = /^&([a-z][a-z0-9]{1,31});/i;
function s2t(e) {
  const t = {},
    n = e.length;
  if (!n) return;
  let i = 0,
    r = -2;
  const o = [];
  for (let s = 0; s < n; s++) {
    const n = e[s];
    if (
      (o.push(0),
      (e[i].marker === n.marker && r === n.token - 1) || (i = s),
      (r = n.token),
      (n.length = n.length || 0),
      !n.close)
    )
      continue;
    t.hasOwnProperty(n.marker) || (t[n.marker] = [-1, -1, -1, -1, -1, -1]);
    const a = t[n.marker][(n.open ? 3 : 0) + (n.length % 3)];
    let l = i - o[i] - 1,
      c = l;
    for (; l > a; l -= o[l] + 1) {
      const t = e[l];
      if (t.marker === n.marker && t.open && t.end < 0) {
        let i = !1;
        if (
          ((t.close || n.open) &&
            (t.length + n.length) % 3 == 0 &&
            ((t.length % 3 == 0 && n.length % 3 == 0) || (i = !0)),
          !i)
        ) {
          const i = l > 0 && !e[l - 1].open ? o[l - 1] + 1 : 0;
          ((o[s] = s - l + i),
            (o[l] = i),
            (n.open = !1),
            (t.end = s),
            (t.close = !1),
            (c = -1),
            (r = -2));
          break;
        }
      }
    }
    -1 !== c && (t[n.marker][(n.open ? 3 : 0) + ((n.length || 0) % 3)] = c);
  }
}
const a2t = [
    [
      "text",
      function (e, t) {
        let n = e.pos;
        for (; n < e.posMax && !Z1t(e.src.charCodeAt(n)); ) n++;
        return n !== e.pos && (t || (e.pending += e.src.slice(e.pos, n)), (e.pos = n), !0);
      },
    ],
    [
      "linkify",
      function (e, t) {
        if (!e.md.options.linkify) return !1;
        if (e.linkLevel > 0) return !1;
        const n = e.pos;
        if (n + 3 > e.posMax) return !1;
        if (58 !== e.src.charCodeAt(n)) return !1;
        if (47 !== e.src.charCodeAt(n + 1)) return !1;
        if (47 !== e.src.charCodeAt(n + 2)) return !1;
        const i = e.pending.match(Y1t);
        if (!i) return !1;
        const r = i[1],
          o = e.md.linkify.matchAtStart(e.src.slice(n - r.length));
        if (!o) return !1;
        let s = o.url;
        if (s.length <= r.length) return !1;
        s = s.replace(/\*+$/, "");
        const a = e.md.normalizeLink(s);
        if (!e.md.validateLink(a)) return !1;
        if (!t) {
          e.pending = e.pending.slice(0, -r.length);
          const t = e.push("link_open", "a", 1);
          ((t.attrs = [["href", a]]), (t.markup = "linkify"), (t.info = "auto"));
          e.push("text", "", 0).content = e.md.normalizeLinkText(s);
          const n = e.push("link_close", "a", -1);
          ((n.markup = "linkify"), (n.info = "auto"));
        }
        return ((e.pos += s.length - r.length), !0);
      },
    ],
    [
      "newline",
      function (e, t) {
        let n = e.pos;
        if (10 !== e.src.charCodeAt(n)) return !1;
        const i = e.pending.length - 1,
          r = e.posMax;
        if (!t)
          if (i >= 0 && 32 === e.pending.charCodeAt(i))
            if (i >= 1 && 32 === e.pending.charCodeAt(i - 1)) {
              let t = i - 1;
              for (; t >= 1 && 32 === e.pending.charCodeAt(t - 1); ) t--;
              ((e.pending = e.pending.slice(0, t)), e.push("hardbreak", "br", 0));
            } else ((e.pending = e.pending.slice(0, -1)), e.push("softbreak", "br", 0));
          else e.push("softbreak", "br", 0);
        for (n++; n < r && s1t(e.src.charCodeAt(n)); ) n++;
        return ((e.pos = n), !0);
      },
    ],
    [
      "escape",
      function (e, t) {
        let n = e.pos;
        const i = e.posMax;
        if (92 !== e.src.charCodeAt(n)) return !1;
        if ((n++, n >= i)) return !1;
        let r = e.src.charCodeAt(n);
        if (10 === r) {
          for (
            t || e.push("hardbreak", "br", 0), n++;
            n < i && ((r = e.src.charCodeAt(n)), s1t(r));
          )
            n++;
          return ((e.pos = n), !0);
        }
        let o = e.src[n];
        if (r >= 55296 && r <= 56319 && n + 1 < i) {
          const t = e.src.charCodeAt(n + 1);
          t >= 56320 && t <= 57343 && ((o += e.src[n + 1]), n++);
        }
        const s = "\\" + o;
        if (!t) {
          const t = e.push("text_special", "", 0);
          (r < 256 && 0 !== X1t[r] ? (t.content = o) : (t.content = s),
            (t.markup = s),
            (t.info = "escape"));
        }
        return ((e.pos = n + 1), !0);
      },
    ],
    [
      "backticks",
      function (e, t) {
        let n = e.pos;
        if (96 !== e.src.charCodeAt(n)) return !1;
        const i = n;
        n++;
        const r = e.posMax;
        for (; n < r && 96 === e.src.charCodeAt(n); ) n++;
        const o = e.src.slice(i, n),
          s = o.length;
        if (e.backticksScanned && (e.backticks[s] || 0) <= i)
          return (t || (e.pending += o), (e.pos += s), !0);
        let a,
          l = n;
        for (; -1 !== (a = e.src.indexOf("`", l)); ) {
          for (l = a + 1; l < r && 96 === e.src.charCodeAt(l); ) l++;
          const i = l - a;
          if (i === s) {
            if (!t) {
              const t = e.push("code_inline", "code", 0);
              ((t.markup = o),
                (t.content = e.src
                  .slice(n, a)
                  .replace(/\n/g, " ")
                  .replace(/^ (.+) $/, "$1")));
            }
            return ((e.pos = l), !0);
          }
          e.backticks[i] = a;
        }
        return ((e.backticksScanned = !0), t || (e.pending += o), (e.pos += s), !0);
      },
    ],
    ["strikethrough", J1t.tokenize],
    ["emphasis", t2t.tokenize],
    [
      "link",
      function (e, t) {
        let n,
          i,
          r,
          o,
          s = "",
          a = "",
          l = e.pos,
          c = !0;
        if (91 !== e.src.charCodeAt(e.pos)) return !1;
        const d = e.pos,
          u = e.posMax,
          h = e.pos + 1,
          g = e.md.helpers.parseLinkLabel(e, e.pos, !0);
        if (g < 0) return !1;
        let p = g + 1;
        if (p < u && 40 === e.src.charCodeAt(p)) {
          for (c = !1, p++; p < u && ((n = e.src.charCodeAt(p)), s1t(n) || 10 === n); p++);
          if (p >= u) return !1;
          if (((l = p), (r = e.md.helpers.parseLinkDestination(e.src, p, e.posMax)), r.ok)) {
            for (
              s = e.md.normalizeLink(r.str), e.md.validateLink(s) ? (p = r.pos) : (s = ""), l = p;
              p < u && ((n = e.src.charCodeAt(p)), s1t(n) || 10 === n);
              p++
            );
            if (((r = e.md.helpers.parseLinkTitle(e.src, p, e.posMax)), p < u && l !== p && r.ok))
              for (
                a = r.str, p = r.pos;
                p < u && ((n = e.src.charCodeAt(p)), s1t(n) || 10 === n);
                p++
              );
          }
          ((p >= u || 41 !== e.src.charCodeAt(p)) && (c = !0), p++);
        }
        if (c) {
          if (void 0 === e.env.references) return !1;
          if (
            (p < u && 91 === e.src.charCodeAt(p)
              ? ((l = p + 1),
                (p = e.md.helpers.parseLinkLabel(e, p)),
                p >= 0 ? (i = e.src.slice(l, p++)) : (p = g + 1))
              : (p = g + 1),
            i || (i = e.src.slice(h, g)),
            (o = e.env.references[d1t(i)]),
            !o)
          )
            return ((e.pos = d), !1);
          ((s = o.href), (a = o.title));
        }
        if (!t) {
          ((e.pos = h), (e.posMax = g));
          const t = [["href", s]];
          ((e.push("link_open", "a", 1).attrs = t),
            a && t.push(["title", a]),
            e.linkLevel++,
            e.md.inline.tokenize(e),
            e.linkLevel--,
            e.push("link_close", "a", -1));
        }
        return ((e.pos = p), (e.posMax = u), !0);
      },
    ],
    [
      "image",
      function (e, t) {
        let n,
          i,
          r,
          o,
          s,
          a,
          l,
          c,
          d = "";
        const u = e.pos,
          h = e.posMax;
        if (33 !== e.src.charCodeAt(e.pos)) return !1;
        if (91 !== e.src.charCodeAt(e.pos + 1)) return !1;
        const g = e.pos + 2,
          p = e.md.helpers.parseLinkLabel(e, e.pos + 1, !1);
        if (p < 0) return !1;
        if (((o = p + 1), o < h && 40 === e.src.charCodeAt(o))) {
          for (o++; o < h && ((n = e.src.charCodeAt(o)), s1t(n) || 10 === n); o++);
          if (o >= h) return !1;
          for (
            c = o,
              a = e.md.helpers.parseLinkDestination(e.src, o, e.posMax),
              a.ok &&
                ((d = e.md.normalizeLink(a.str)), e.md.validateLink(d) ? (o = a.pos) : (d = "")),
              c = o;
            o < h && ((n = e.src.charCodeAt(o)), s1t(n) || 10 === n);
            o++
          );
          if (((a = e.md.helpers.parseLinkTitle(e.src, o, e.posMax)), o < h && c !== o && a.ok))
            for (
              l = a.str, o = a.pos;
              o < h && ((n = e.src.charCodeAt(o)), s1t(n) || 10 === n);
              o++
            );
          else l = "";
          if (o >= h || 41 !== e.src.charCodeAt(o)) return ((e.pos = u), !1);
          o++;
        } else {
          if (void 0 === e.env.references) return !1;
          if (
            (o < h && 91 === e.src.charCodeAt(o)
              ? ((c = o + 1),
                (o = e.md.helpers.parseLinkLabel(e, o)),
                o >= 0 ? (r = e.src.slice(c, o++)) : (o = p + 1))
              : (o = p + 1),
            r || (r = e.src.slice(g, p)),
            (s = e.env.references[d1t(r)]),
            !s)
          )
            return ((e.pos = u), !1);
          ((d = s.href), (l = s.title));
        }
        if (!t) {
          i = e.src.slice(g, p);
          const t = [];
          e.md.inline.parse(i, e.md, e.env, t);
          const n = e.push("image", "img", 0),
            r = [
              ["src", d],
              ["alt", ""],
            ];
          ((n.attrs = r), (n.children = t), (n.content = i), l && r.push(["title", l]));
        }
        return ((e.pos = o), (e.posMax = h), !0);
      },
    ],
    [
      "autolink",
      function (e, t) {
        let n = e.pos;
        if (60 !== e.src.charCodeAt(n)) return !1;
        const i = e.pos,
          r = e.posMax;
        for (;;) {
          if (++n >= r) return !1;
          const t = e.src.charCodeAt(n);
          if (60 === t) return !1;
          if (62 === t) break;
        }
        const o = e.src.slice(i + 1, n);
        if (i2t.test(o)) {
          const n = e.md.normalizeLink(o);
          if (!e.md.validateLink(n)) return !1;
          if (!t) {
            const t = e.push("link_open", "a", 1);
            ((t.attrs = [["href", n]]), (t.markup = "autolink"), (t.info = "auto"));
            e.push("text", "", 0).content = e.md.normalizeLinkText(o);
            const i = e.push("link_close", "a", -1);
            ((i.markup = "autolink"), (i.info = "auto"));
          }
          return ((e.pos += o.length + 2), !0);
        }
        if (n2t.test(o)) {
          const n = e.md.normalizeLink("mailto:" + o);
          if (!e.md.validateLink(n)) return !1;
          if (!t) {
            const t = e.push("link_open", "a", 1);
            ((t.attrs = [["href", n]]), (t.markup = "autolink"), (t.info = "auto"));
            e.push("text", "", 0).content = e.md.normalizeLinkText(o);
            const i = e.push("link_close", "a", -1);
            ((i.markup = "autolink"), (i.info = "auto"));
          }
          return ((e.pos += o.length + 2), !0);
        }
        return !1;
      },
    ],
    [
      "html_inline",
      function (e, t) {
        if (!e.md.options.html) return !1;
        const n = e.posMax,
          i = e.pos;
        if (60 !== e.src.charCodeAt(i) || i + 2 >= n) return !1;
        const r = e.src.charCodeAt(i + 1);
        if (
          33 !== r &&
          63 !== r &&
          47 !== r &&
          !(function (e) {
            const t = 32 | e;
            return t >= 97 && t <= 122;
          })(r)
        )
          return !1;
        const o = e.src.slice(i).match(z1t);
        if (!o) return !1;
        if (!t) {
          const t = e.push("html_inline", "", 0);
          ((t.content = o[0]),
            (s = t.content),
            /^<a[>\s]/i.test(s) && e.linkLevel++,
            (function (e) {
              return /^<\/a\s*>/i.test(e);
            })(t.content) && e.linkLevel--);
        }
        var s;
        return ((e.pos += o[0].length), !0);
      },
    ],
    [
      "entity",
      function (e, t) {
        const n = e.pos,
          i = e.posMax;
        if (38 !== e.src.charCodeAt(n)) return !1;
        if (n + 1 >= i) return !1;
        if (35 === e.src.charCodeAt(n + 1)) {
          const i = e.src.slice(n).match(r2t);
          if (i) {
            if (!t) {
              const t =
                  "x" === i[1][0].toLowerCase() ? parseInt(i[1].slice(1), 16) : parseInt(i[1], 10),
                n = e.push("text_special", "", 0);
              ((n.content = G0t(t) ? Z0t(t) : Z0t(65533)), (n.markup = i[0]), (n.info = "entity"));
            }
            return ((e.pos += i[0].length), !0);
          }
        } else {
          const i = e.src.slice(n).match(o2t);
          if (i) {
            const n = z0t(i[0]);
            if (n !== i[0]) {
              if (!t) {
                const t = e.push("text_special", "", 0);
                ((t.content = n), (t.markup = i[0]), (t.info = "entity"));
              }
              return ((e.pos += i[0].length), !0);
            }
          }
        }
        return !1;
      },
    ],
  ],
  l2t = [
    [
      "balance_pairs",
      function (e) {
        const t = e.tokens_meta,
          n = e.tokens_meta.length;
        s2t(e.delimiters);
        for (let i = 0; i < n; i++) t[i] && t[i].delimiters && s2t(t[i].delimiters);
      },
    ],
    ["strikethrough", J1t.postProcess],
    ["emphasis", t2t.postProcess],
    [
      "fragments_join",
      function (e) {
        let t,
          n,
          i = 0;
        const r = e.tokens,
          o = e.tokens.length;
        for (t = n = 0; t < o; t++)
          (r[t].nesting < 0 && i--,
            (r[t].level = i),
            r[t].nesting > 0 && i++,
            "text" === r[t].type && t + 1 < o && "text" === r[t + 1].type
              ? (r[t + 1].content = r[t].content + r[t + 1].content)
              : (t !== n && (r[n] = r[t]), n++));
        t !== n && (r.length = n);
      },
    ],
  ];
function c2t() {
  this.ruler = new m1t();
  for (let e = 0; e < a2t.length; e++) this.ruler.push(a2t[e][0], a2t[e][1]);
  this.ruler2 = new m1t();
  for (let e = 0; e < l2t.length; e++) this.ruler2.push(l2t[e][0], l2t[e][1]);
}
function d2t(e) {
  return (
    Array.prototype.slice.call(arguments, 1).forEach(function (t) {
      t &&
        Object.keys(t).forEach(function (n) {
          e[n] = t[n];
        });
    }),
    e
  );
}
function u2t(e) {
  return Object.prototype.toString.call(e);
}
function h2t(e) {
  return "[object Function]" === u2t(e);
}
function g2t(e) {
  return e.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
}
((c2t.prototype.skipToken = function (e) {
  const t = e.pos,
    n = this.ruler.getRules(""),
    i = n.length,
    r = e.md.options.maxNesting,
    o = e.cache;
  if (void 0 !== o[t]) return void (e.pos = o[t]);
  let s = !1;
  if (e.level < r) {
    for (let a = 0; a < i; a++)
      if ((e.level++, (s = n[a](e, !0)), e.level--, s)) {
        if (t >= e.pos) throw new Error("inline rule didn't increment state.pos");
        break;
      }
  } else e.pos = e.posMax;
  (s || e.pos++, (o[t] = e.pos));
}),
  (c2t.prototype.tokenize = function (e) {
    const t = this.ruler.getRules(""),
      n = t.length,
      i = e.posMax,
      r = e.md.options.maxNesting;
    for (; e.pos < i; ) {
      const o = e.pos;
      let s = !1;
      if (e.level < r)
        for (let i = 0; i < n; i++)
          if (((s = t[i](e, !1)), s)) {
            if (o >= e.pos) throw new Error("inline rule didn't increment state.pos");
            break;
          }
      if (s) {
        if (e.pos >= i) break;
      } else e.pending += e.src[e.pos++];
    }
    e.pending && e.pushPending();
  }),
  (c2t.prototype.parse = function (e, t, n, i) {
    const r = new this.State(e, t, n, i);
    this.tokenize(r);
    const o = this.ruler2.getRules(""),
      s = o.length;
    for (let a = 0; a < s; a++) o[a](r);
  }),
  (c2t.prototype.State = G1t));
const p2t = { fuzzyLink: !0, fuzzyEmail: !0, fuzzyIP: !1 };
const f2t = {
    "http:": {
      validate: function (e, t, n) {
        const i = e.slice(t);
        return (
          n.re.http ||
            (n.re.http = new RegExp(
              "^\\/\\/" + n.re.src_auth + n.re.src_host_port_strict + n.re.src_path,
              "i",
            )),
          n.re.http.test(i) ? i.match(n.re.http)[0].length : 0
        );
      },
    },
    "https:": "http:",
    "ftp:": "http:",
    "//": {
      validate: function (e, t, n) {
        const i = e.slice(t);
        return (
          n.re.no_http ||
            (n.re.no_http = new RegExp(
              "^" +
                n.re.src_auth +
                "(?:localhost|(?:(?:" +
                n.re.src_domain +
                ")\\.)+" +
                n.re.src_domain_root +
                ")" +
                n.re.src_port +
                n.re.src_host_terminator +
                n.re.src_path,
              "i",
            )),
          n.re.no_http.test(i)
            ? (t >= 3 && ":" === e[t - 3]) || (t >= 3 && "/" === e[t - 3])
              ? 0
              : i.match(n.re.no_http)[0].length
            : 0
        );
      },
    },
    "mailto:": {
      validate: function (e, t, n) {
        const i = e.slice(t);
        return (
          n.re.mailto ||
            (n.re.mailto = new RegExp("^" + n.re.src_email_name + "@" + n.re.src_host_strict, "i")),
          n.re.mailto.test(i) ? i.match(n.re.mailto)[0].length : 0
        );
      },
    },
  },
  m2t = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");
function _2t(e) {
  const t = (e.re = (function (e) {
      const t = {};
      ((e = e || {}),
        (t.src_Any = x0t.source),
        (t.src_Cc = w0t.source),
        (t.src_Z = k0t.source),
        (t.src_P = C0t.source),
        (t.src_ZPCc = [t.src_Z, t.src_P, t.src_Cc].join("|")),
        (t.src_ZCc = [t.src_Z, t.src_Cc].join("|")));
      const n = "[><｜]";
      return (
        (t.src_pseudo_letter = "(?:(?![><｜]|" + t.src_ZPCc + ")" + t.src_Any + ")"),
        (t.src_ip4 =
          "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"),
        (t.src_auth = "(?:(?:(?!" + t.src_ZCc + "|[@/\\[\\]()]).)+@)?"),
        (t.src_port =
          "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?"),
        (t.src_host_terminator =
          "(?=$|[><｜]|" +
          t.src_ZPCc +
          ")(?!" +
          (e["---"] ? "-(?!--)|" : "-|") +
          "_|:\\d|\\.-|\\.(?!$|" +
          t.src_ZPCc +
          "))"),
        (t.src_path =
          "(?:[/?#](?:(?!" +
          t.src_ZCc +
          "|" +
          n +
          "|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!" +
          t.src_ZCc +
          "|\\]).)*\\]|\\((?:(?!" +
          t.src_ZCc +
          "|[)]).)*\\)|\\{(?:(?!" +
          t.src_ZCc +
          '|[}]).)*\\}|\\"(?:(?!' +
          t.src_ZCc +
          '|["]).)+\\"|\\\'(?:(?!' +
          t.src_ZCc +
          "|[']).)+\\'|\\'(?=" +
          t.src_pseudo_letter +
          "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" +
          t.src_ZCc +
          "|[.]|$)|" +
          (e["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") +
          ",(?!" +
          t.src_ZCc +
          "|$)|;(?!" +
          t.src_ZCc +
          "|$)|\\!+(?!" +
          t.src_ZCc +
          "|[!]|$)|\\?(?!" +
          t.src_ZCc +
          "|[?]|$))+|\\/)?"),
        (t.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'),
        (t.src_xn = "xn--[a-z0-9\\-]{1,59}"),
        (t.src_domain_root = "(?:" + t.src_xn + "|" + t.src_pseudo_letter + "{1,63})"),
        (t.src_domain =
          "(?:" +
          t.src_xn +
          "|(?:" +
          t.src_pseudo_letter +
          ")|(?:" +
          t.src_pseudo_letter +
          "(?:-|" +
          t.src_pseudo_letter +
          "){0,61}" +
          t.src_pseudo_letter +
          "))"),
        (t.src_host = "(?:(?:(?:(?:" + t.src_domain + ")\\.)*" + t.src_domain + "))"),
        (t.tpl_host_fuzzy = "(?:" + t.src_ip4 + "|(?:(?:(?:" + t.src_domain + ")\\.)+(?:%TLDS%)))"),
        (t.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + t.src_domain + ")\\.)+(?:%TLDS%))"),
        (t.src_host_strict = t.src_host + t.src_host_terminator),
        (t.tpl_host_fuzzy_strict = t.tpl_host_fuzzy + t.src_host_terminator),
        (t.src_host_port_strict = t.src_host + t.src_port + t.src_host_terminator),
        (t.tpl_host_port_fuzzy_strict = t.tpl_host_fuzzy + t.src_port + t.src_host_terminator),
        (t.tpl_host_port_no_ip_fuzzy_strict =
          t.tpl_host_no_ip_fuzzy + t.src_port + t.src_host_terminator),
        (t.tpl_host_fuzzy_test =
          "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + t.src_ZPCc + "|>|$))"),
        (t.tpl_email_fuzzy =
          '(^|[><｜]|"|\\(|' +
          t.src_ZCc +
          ")(" +
          t.src_email_name +
          "@" +
          t.tpl_host_fuzzy_strict +
          ")"),
        (t.tpl_link_fuzzy =
          "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" +
          t.src_ZPCc +
          "))((?![$+<=>^`|｜])" +
          t.tpl_host_port_fuzzy_strict +
          t.src_path +
          ")"),
        (t.tpl_link_no_ip_fuzzy =
          "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" +
          t.src_ZPCc +
          "))((?![$+<=>^`|｜])" +
          t.tpl_host_port_no_ip_fuzzy_strict +
          t.src_path +
          ")"),
        t
      );
    })(e.__opts__)),
    n = e.__tlds__.slice();
  function i(e) {
    return e.replace("%TLDS%", t.src_tlds);
  }
  (e.onCompile(),
    e.__tlds_replaced__ ||
      n.push(
        "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",
      ),
    n.push(t.src_xn),
    (t.src_tlds = n.join("|")),
    (t.email_fuzzy = RegExp(i(t.tpl_email_fuzzy), "i")),
    (t.link_fuzzy = RegExp(i(t.tpl_link_fuzzy), "i")),
    (t.link_no_ip_fuzzy = RegExp(i(t.tpl_link_no_ip_fuzzy), "i")),
    (t.host_fuzzy_test = RegExp(i(t.tpl_host_fuzzy_test), "i")));
  const r = [];
  function o(e, t) {
    throw new Error('(LinkifyIt) Invalid schema "' + e + '": ' + t);
  }
  ((e.__compiled__ = {}),
    Object.keys(e.__schemas__).forEach(function (t) {
      const n = e.__schemas__[t];
      if (null === n) return;
      const i = { validate: null, link: null };
      if (((e.__compiled__[t] = i), "[object Object]" === u2t(n)))
        return (
          !(function (e) {
            return "[object RegExp]" === u2t(e);
          })(n.validate)
            ? h2t(n.validate)
              ? (i.validate = n.validate)
              : o(t, n)
            : (i.validate = (function (e) {
                return function (t, n) {
                  const i = t.slice(n);
                  return e.test(i) ? i.match(e)[0].length : 0;
                };
              })(n.validate)),
          void (h2t(n.normalize)
            ? (i.normalize = n.normalize)
            : n.normalize
              ? o(t, n)
              : (i.normalize = function (e, t) {
                  t.normalize(e);
                }))
        );
      !(function (e) {
        return "[object String]" === u2t(e);
      })(n)
        ? o(t, n)
        : r.push(t);
    }),
    r.forEach(function (t) {
      e.__compiled__[e.__schemas__[t]] &&
        ((e.__compiled__[t].validate = e.__compiled__[e.__schemas__[t]].validate),
        (e.__compiled__[t].normalize = e.__compiled__[e.__schemas__[t]].normalize));
    }),
    (e.__compiled__[""] = {
      validate: null,
      normalize: function (e, t) {
        t.normalize(e);
      },
    }));
  const s = Object.keys(e.__compiled__)
    .filter(function (t) {
      return t.length > 0 && e.__compiled__[t];
    })
    .map(g2t)
    .join("|");
  ((e.re.schema_test = RegExp("(^|(?!_)(?:[><｜]|" + t.src_ZPCc + "))(" + s + ")", "i")),
    (e.re.schema_search = RegExp("(^|(?!_)(?:[><｜]|" + t.src_ZPCc + "))(" + s + ")", "ig")),
    (e.re.schema_at_start = RegExp("^" + e.re.schema_search.source, "i")),
    (e.re.pretest = RegExp(
      "(" + e.re.schema_test.source + ")|(" + e.re.host_fuzzy_test.source + ")|@",
      "i",
    )),
    (function (e) {
      ((e.__index__ = -1), (e.__text_cache__ = ""));
    })(e));
}
function v2t(e, t) {
  const n = e.__index__,
    i = e.__last_index__,
    r = e.__text_cache__.slice(n, i);
  ((this.schema = e.__schema__.toLowerCase()),
    (this.index = n + t),
    (this.lastIndex = i + t),
    (this.raw = r),
    (this.text = r),
    (this.url = r));
}
function b2t(e, t) {
  const n = new v2t(e, t);
  return (e.__compiled__[n.schema].normalize(n, e), n);
}
function y2t(e, t) {
  if (!(this instanceof y2t)) return new y2t(e, t);
  var n;
  (t ||
    ((n = e),
    Object.keys(n || {}).reduce(function (e, t) {
      return e || p2t.hasOwnProperty(t);
    }, !1) && ((t = e), (e = {}))),
    (this.__opts__ = d2t({}, p2t, t)),
    (this.__index__ = -1),
    (this.__last_index__ = -1),
    (this.__schema__ = ""),
    (this.__text_cache__ = ""),
    (this.__schemas__ = d2t({}, f2t, e)),
    (this.__compiled__ = {}),
    (this.__tlds__ = m2t),
    (this.__tlds_replaced__ = !1),
    (this.re = {}),
    _2t(this));
}
((y2t.prototype.add = function (e, t) {
  return ((this.__schemas__[e] = t), _2t(this), this);
}),
  (y2t.prototype.set = function (e) {
    return ((this.__opts__ = d2t(this.__opts__, e)), this);
  }),
  (y2t.prototype.test = function (e) {
    if (((this.__text_cache__ = e), (this.__index__ = -1), !e.length)) return !1;
    let t, n, i, r, o, s, a, l, c;
    if (this.re.schema_test.test(e))
      for (a = this.re.schema_search, a.lastIndex = 0; null !== (t = a.exec(e)); )
        if (((r = this.testSchemaAt(e, t[2], a.lastIndex)), r)) {
          ((this.__schema__ = t[2]),
            (this.__index__ = t.index + t[1].length),
            (this.__last_index__ = t.index + t[0].length + r));
          break;
        }
    return (
      this.__opts__.fuzzyLink &&
        this.__compiled__["http:"] &&
        ((l = e.search(this.re.host_fuzzy_test)),
        l >= 0 &&
          (this.__index__ < 0 || l < this.__index__) &&
          null !==
            (n = e.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) &&
          ((o = n.index + n[1].length),
          (this.__index__ < 0 || o < this.__index__) &&
            ((this.__schema__ = ""),
            (this.__index__ = o),
            (this.__last_index__ = n.index + n[0].length)))),
      this.__opts__.fuzzyEmail &&
        this.__compiled__["mailto:"] &&
        ((c = e.indexOf("@")),
        c >= 0 &&
          null !== (i = e.match(this.re.email_fuzzy)) &&
          ((o = i.index + i[1].length),
          (s = i.index + i[0].length),
          (this.__index__ < 0 ||
            o < this.__index__ ||
            (o === this.__index__ && s > this.__last_index__)) &&
            ((this.__schema__ = "mailto:"), (this.__index__ = o), (this.__last_index__ = s)))),
      this.__index__ >= 0
    );
  }),
  (y2t.prototype.pretest = function (e) {
    return this.re.pretest.test(e);
  }),
  (y2t.prototype.testSchemaAt = function (e, t, n) {
    return this.__compiled__[t.toLowerCase()]
      ? this.__compiled__[t.toLowerCase()].validate(e, n, this)
      : 0;
  }),
  (y2t.prototype.match = function (e) {
    const t = [];
    let n = 0;
    this.__index__ >= 0 &&
      this.__text_cache__ === e &&
      (t.push(b2t(this, n)), (n = this.__last_index__));
    let i = n ? e.slice(n) : e;
    for (; this.test(i); )
      (t.push(b2t(this, n)), (i = i.slice(this.__last_index__)), (n += this.__last_index__));
    return t.length ? t : null;
  }),
  (y2t.prototype.matchAtStart = function (e) {
    if (((this.__text_cache__ = e), (this.__index__ = -1), !e.length)) return null;
    const t = this.re.schema_at_start.exec(e);
    if (!t) return null;
    const n = this.testSchemaAt(e, t[2], t[0].length);
    return n
      ? ((this.__schema__ = t[2]),
        (this.__index__ = t.index + t[1].length),
        (this.__last_index__ = t.index + t[0].length + n),
        b2t(this, 0))
      : null;
  }),
  (y2t.prototype.tlds = function (e, t) {
    return (
      (e = Array.isArray(e) ? e : [e]),
      t
        ? ((this.__tlds__ = this.__tlds__
            .concat(e)
            .sort()
            .filter(function (e, t, n) {
              return e !== n[t - 1];
            })
            .reverse()),
          _2t(this),
          this)
        : ((this.__tlds__ = e.slice()), (this.__tlds_replaced__ = !0), _2t(this), this)
    );
  }),
  (y2t.prototype.normalize = function (e) {
    (e.schema || (e.url = "http://" + e.url),
      "mailto:" !== e.schema || /^mailto:/i.test(e.url) || (e.url = "mailto:" + e.url));
  }),
  (y2t.prototype.onCompile = function () {}));
const x2t = 2147483647,
  w2t = 36,
  C2t = /^xn--/,
  S2t = /[^\0-\x7F]/,
  k2t = /[\x2E\u3002\uFF0E\uFF61]/g,
  E2t = {
    overflow: "Overflow: input needs wider integers to process",
    "not-basic": "Illegal input >= 0x80 (not a basic code point)",
    "invalid-input": "Invalid input",
  },
  N2t = Math.floor,
  L2t = String.fromCharCode;
function D2t(e) {
  throw new RangeError(E2t[e]);
}
function T2t(e, t) {
  const n = e.split("@");
  let i = "";
  n.length > 1 && ((i = n[0] + "@"), (e = n[1]));
  const r = (function (e, t) {
    const n = [];
    let i = e.length;
    for (; i--; ) n[i] = t(e[i]);
    return n;
  })((e = e.replace(k2t, ".")).split("."), t).join(".");
  return i + r;
}
function I2t(e) {
  const t = [];
  let n = 0;
  const i = e.length;
  for (; n < i; ) {
    const r = e.charCodeAt(n++);
    if (r >= 55296 && r <= 56319 && n < i) {
      const i = e.charCodeAt(n++);
      56320 == (64512 & i) ? t.push(((1023 & r) << 10) + (1023 & i) + 65536) : (t.push(r), n--);
    } else t.push(r);
  }
  return t;
}
const R2t = function (e) {
    return e >= 48 && e < 58
      ? e - 48 + 26
      : e >= 65 && e < 91
        ? e - 65
        : e >= 97 && e < 123
          ? e - 97
          : w2t;
  },
  O2t = function (e, t) {
    return e + 22 + 75 * (e < 26) - ((0 != t) << 5);
  },
  M2t = function (e, t, n) {
    let i = 0;
    for (e = n ? N2t(e / 700) : e >> 1, e += N2t(e / t); e > 455; i += w2t) e = N2t(e / 35);
    return N2t(i + (36 * e) / (e + 38));
  },
  A2t = function (e) {
    const t = [],
      n = e.length;
    let i = 0,
      r = 128,
      o = 72,
      s = e.lastIndexOf("-");
    s < 0 && (s = 0);
    for (let a = 0; a < s; ++a)
      (e.charCodeAt(a) >= 128 && D2t("not-basic"), t.push(e.charCodeAt(a)));
    for (let a = s > 0 ? s + 1 : 0; a < n; ) {
      const s = i;
      for (let t = 1, r = w2t; ; r += w2t) {
        a >= n && D2t("invalid-input");
        const s = R2t(e.charCodeAt(a++));
        (s >= w2t && D2t("invalid-input"), s > N2t((x2t - i) / t) && D2t("overflow"), (i += s * t));
        const l = r <= o ? 1 : r >= o + 26 ? 26 : r - o;
        if (s < l) break;
        const c = w2t - l;
        (t > N2t(x2t / c) && D2t("overflow"), (t *= c));
      }
      const l = t.length + 1;
      ((o = M2t(i - s, l, 0 == s)),
        N2t(i / l) > x2t - r && D2t("overflow"),
        (r += N2t(i / l)),
        (i %= l),
        t.splice(i++, 0, r));
    }
    return String.fromCodePoint(...t);
  },
  P2t = function (e) {
    const t = [],
      n = (e = I2t(e)).length;
    let i = 128,
      r = 0,
      o = 72;
    for (const l of e) l < 128 && t.push(L2t(l));
    const s = t.length;
    let a = s;
    for (s && t.push("-"); a < n; ) {
      let n = x2t;
      for (const t of e) t >= i && t < n && (n = t);
      const l = a + 1;
      (n - i > N2t((x2t - r) / l) && D2t("overflow"), (r += (n - i) * l), (i = n));
      for (const c of e)
        if ((c < i && ++r > x2t && D2t("overflow"), c === i)) {
          let e = r;
          for (let n = w2t; ; n += w2t) {
            const i = n <= o ? 1 : n >= o + 26 ? 26 : n - o;
            if (e < i) break;
            const r = e - i,
              s = w2t - i;
            (t.push(L2t(O2t(i + (r % s), 0))), (e = N2t(r / s)));
          }
          (t.push(L2t(O2t(e, 0))), (o = M2t(r, l, a === s)), (r = 0), ++a);
        }
      (++r, ++i);
    }
    return t.join("");
  },
  j2t = function (e) {
    return T2t(e, function (e) {
      return S2t.test(e) ? "xn--" + P2t(e) : e;
    });
  },
  F2t = function (e) {
    return T2t(e, function (e) {
      return C2t.test(e) ? A2t(e.slice(4).toLowerCase()) : e;
    });
  },
  B2t = {
    default: {
      options: {
        html: !1,
        xhtmlOut: !1,
        breaks: !1,
        langPrefix: "language-",
        linkify: !1,
        typographer: !1,
        quotes: "“”‘’",
        highlight: null,
        maxNesting: 100,
      },
      components: { core: {}, block: {}, inline: {} },
    },
    zero: {
      options: {
        html: !1,
        xhtmlOut: !1,
        breaks: !1,
        langPrefix: "language-",
        linkify: !1,
        typographer: !1,
        quotes: "“”‘’",
        highlight: null,
        maxNesting: 20,
      },
      components: {
        core: { rules: ["normalize", "block", "inline", "text_join"] },
        block: { rules: ["paragraph"] },
        inline: { rules: ["text"], rules2: ["balance_pairs", "fragments_join"] },
      },
    },
    commonmark: {
      options: {
        html: !0,
        xhtmlOut: !0,
        breaks: !1,
        langPrefix: "language-",
        linkify: !1,
        typographer: !1,
        quotes: "“”‘’",
        highlight: null,
        maxNesting: 20,
      },
      components: {
        core: { rules: ["normalize", "block", "inline", "text_join"] },
        block: {
          rules: [
            "blockquote",
            "code",
            "fence",
            "heading",
            "hr",
            "html_block",
            "lheading",
            "list",
            "reference",
            "paragraph",
          ],
        },
        inline: {
          rules: [
            "autolink",
            "backticks",
            "emphasis",
            "entity",
            "escape",
            "html_inline",
            "image",
            "link",
            "newline",
            "text",
          ],
          rules2: ["balance_pairs", "emphasis", "fragments_join"],
        },
      },
    },
  },
  V2t = /^(vbscript|javascript|file|data):/,
  W2t = /^data:image\/(gif|png|jpeg|webp);/;
function H2t(e) {
  const t = e.trim().toLowerCase();
  return !V2t.test(t) || W2t.test(t);
}
const z2t = ["http:", "https:", "mailto:"];
function U2t(e) {
  const t = b0t(e, !0);
  if (t.hostname && (!t.protocol || z2t.indexOf(t.protocol) >= 0))
    try {
      t.hostname = j2t(t.hostname);
    } catch (n) {}
  return o0t(s0t(t));
}
function $2t(e) {
  const t = b0t(e, !0);
  if (t.hostname && (!t.protocol || z2t.indexOf(t.protocol) >= 0))
    try {
      t.hostname = F2t(t.hostname);
    } catch (n) {}
  return i0t(s0t(t), i0t.defaultChars + "%");
}
function q2t(e, t) {
  if (!(this instanceof q2t)) return new q2t(e, t);
  (t || U0t(e) || ((t = e || {}), (e = "default")),
    (this.inline = new c2t()),
    (this.block = new K1t()),
    (this.core = new A1t()),
    (this.renderer = new f1t()),
    (this.linkify = new y2t()),
    (this.validateLink = H2t),
    (this.normalizeLink = U2t),
    (this.normalizeLinkText = $2t),
    (this.utils = h1t),
    (this.helpers = q0t({}, g1t)),
    (this.options = {}),
    this.configure(e),
    t && this.set(t));
}
((q2t.prototype.set = function (e) {
  return (q0t(this.options, e), this);
}),
  (q2t.prototype.configure = function (e) {
    const t = this;
    if (U0t(e)) {
      const t = e;
      if (!(e = B2t[t])) throw new Error('Wrong `markdown-it` preset "' + t + '", check name');
    }
    if (!e) throw new Error("Wrong `markdown-it` preset, can't be empty");
    return (
      e.options && t.set(e.options),
      e.components &&
        Object.keys(e.components).forEach(function (n) {
          (e.components[n].rules && t[n].ruler.enableOnly(e.components[n].rules),
            e.components[n].rules2 && t[n].ruler2.enableOnly(e.components[n].rules2));
        }),
      this
    );
  }),
  (q2t.prototype.enable = function (e, t) {
    let n = [];
    (Array.isArray(e) || (e = [e]),
      ["core", "block", "inline"].forEach(function (t) {
        n = n.concat(this[t].ruler.enable(e, !0));
      }, this),
      (n = n.concat(this.inline.ruler2.enable(e, !0))));
    const i = e.filter(function (e) {
      return n.indexOf(e) < 0;
    });
    if (i.length && !t) throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + i);
    return this;
  }),
  (q2t.prototype.disable = function (e, t) {
    let n = [];
    (Array.isArray(e) || (e = [e]),
      ["core", "block", "inline"].forEach(function (t) {
        n = n.concat(this[t].ruler.disable(e, !0));
      }, this),
      (n = n.concat(this.inline.ruler2.disable(e, !0))));
    const i = e.filter(function (e) {
      return n.indexOf(e) < 0;
    });
    if (i.length && !t) throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + i);
    return this;
  }),
  (q2t.prototype.use = function (e) {
    const t = [this].concat(Array.prototype.slice.call(arguments, 1));
    return (e.apply(e, t), this);
  }),
  (q2t.prototype.parse = function (e, t) {
    if ("string" != typeof e) throw new Error("Input data should be a String");
    const n = new this.core.State(e, this, t);
    return (this.core.process(n), n.tokens);
  }),
  (q2t.prototype.render = function (e, t) {
    return ((t = t || {}), this.renderer.render(this.parse(e, t), this.options, t));
  }),
  (q2t.prototype.parseInline = function (e, t) {
    const n = new this.core.State(e, this, t);
    return ((n.inlineMode = !0), this.core.process(n), n.tokens);
  }),
  (q2t.prototype.renderInline = function (e, t) {
    return ((t = t || {}), this.renderer.render(this.parseInline(e, t), this.options, t));
  }));
const K2t = gy({
    id: cy().nullable(),
    title: ly().min(1).max(250),
    content: ly().min(1),
    show: dy(),
    tags: hy(ly()),
    img_url: ly().nullable(),
  }),
  G2t = { id: null, show: !1, tags: [], img_url: "", title: "", content: "" };
function Z2t({ refetch: e, dialogTrigger: t, type: n = "add", defaultFormValues: i = G2t }) {
  const { t: r } = Py("notice"),
    [o, s] = H.useState(!1),
    a = kv({ resolver: Ov(K2t), defaultValues: i, mode: "onChange", shouldFocusError: !0 }),
    l = new q2t({ html: !0 });
  return Q.jsx(Hy, {
    ...a,
    children: Q.jsxs(Jet, {
      onOpenChange: s,
      open: o,
      children: [
        Q.jsx(ett, {
          asChild: !0,
          children:
            t ||
            Q.jsxs(Nm, {
              variant: "outline",
              size: "sm",
              className: "space-x-2",
              children: [
                Q.jsx(yYt, { icon: "ion:add" }),
                " ",
                Q.jsx("div", { children: r("form.add.button") }),
              ],
            }),
        }),
        Q.jsxs(ttt, {
          className: "max-w-4xl gap-0 overflow-hidden p-0 sm:rounded-2xl",
          children: [
            Q.jsxs(ntt, {
              className: "border-b bg-muted/20 px-6 pb-4 pt-6",
              children: [
                Q.jsx(rtt, {
                  className: "font-mono text-lg tracking-tight",
                  children: r("add" === n ? "form.add.title" : "form.edit.title"),
                }),
                Q.jsx(ott, {
                  className: "font-mono text-xs opacity-70",
                  children: r("form.description", "发布或编辑系统公告，支持 Markdown 格式。"),
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "max-h-[70vh] space-y-4 overflow-y-auto px-6 py-4 font-mono",
              children: [
                Q.jsx(Uy, {
                  control: a.control,
                  name: "title",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-[11px] uppercase tracking-wider text-muted-foreground",
                          children: r("form.fields.title.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            placeholder: r("form.fields.title.placeholder"),
                            ...e,
                            className: "h-9 font-mono text-xs",
                          }),
                        }),
                        Q.jsx(Xy, { className: "text-[10px]" }),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: a.control,
                  name: "content",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      className: "space-y-2",
                      children: [
                        Q.jsx(Gy, {
                          className: "text-[11px] uppercase tracking-wider text-muted-foreground",
                          children: r("form.fields.content.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx("div", {
                            className:
                              "overflow-hidden rounded-md border border-input focus-within:ring-1 focus-within:ring-ring",
                            children: Q.jsx(TJt, {
                              style: { height: "400px" },
                              value: e.value,
                              renderHTML: (e) => l.render(e),
                              onChange: ({ text: t }) => {
                                e.onChange(t);
                              },
                              className: "border-none font-mono text-xs",
                              config: {
                                view: { menu: !0, md: !0, html: !1 },
                                canView: {
                                  menu: !0,
                                  md: !0,
                                  html: !1,
                                  fullScreen: !1,
                                  hideMenu: !1,
                                },
                              },
                            }),
                          }),
                        }),
                        Q.jsx(Xy, { className: "text-[10px]" }),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: a.control,
                  name: "img_url",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-[11px] uppercase tracking-wider text-muted-foreground",
                          children: r("form.fields.img_url.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            type: "text",
                            placeholder: r("form.fields.img_url.placeholder"),
                            ...e,
                            value: e.value || "",
                            className: "h-9 font-mono text-xs",
                          }),
                        }),
                        Q.jsx(Xy, { className: "text-[10px]" }),
                      ],
                    }),
                }),
                Q.jsxs("div", {
                  className: "grid gap-4 md:grid-cols-2",
                  children: [
                    Q.jsx(Uy, {
                      control: a.control,
                      name: "tags",
                      render: ({ field: e }) =>
                        Q.jsxs(Ky, {
                          children: [
                            Q.jsx(Gy, {
                              className:
                                "text-[11px] uppercase tracking-wider text-muted-foreground",
                              children: r("form.fields.tags.label"),
                            }),
                            Q.jsx(Zy, {
                              children: Q.jsx(t0t, {
                                value: e.value,
                                onChange: e.onChange,
                                placeholder: r("form.fields.tags.placeholder"),
                                className: "w-full font-mono text-xs",
                              }),
                            }),
                            Q.jsx(Xy, { className: "text-[10px]" }),
                          ],
                        }),
                    }),
                    Q.jsx(Uy, {
                      control: a.control,
                      name: "show",
                      render: ({ field: e }) =>
                        Q.jsxs(Ky, {
                          className: "flex flex-col",
                          children: [
                            Q.jsx(Gy, {
                              className:
                                "text-[11px] uppercase tracking-wider text-muted-foreground",
                              children: r("form.fields.show.label"),
                            }),
                            Q.jsx("div", {
                              className: "flex h-9 items-center",
                              children: Q.jsx(Zy, {
                                children: Q.jsx(mGt, {
                                  checked: e.value,
                                  onCheckedChange: e.onChange,
                                }),
                              }),
                            }),
                            Q.jsx(Xy, { className: "text-[10px]" }),
                          ],
                        }),
                    }),
                  ],
                }),
              ],
            }),
            Q.jsx(itt, {
              className: "border-t bg-muted/20 px-6 py-4",
              children: Q.jsxs("div", {
                className: "flex w-full items-center justify-end gap-3",
                children: [
                  Q.jsx(stt, {
                    asChild: !0,
                    children: Q.jsx(Nm, {
                      type: "button",
                      variant: "ghost",
                      className: "h-8 px-4 font-mono text-xs font-bold",
                      children: r("form.buttons.cancel"),
                    }),
                  }),
                  Q.jsx(Nm, {
                    type: "submit",
                    className: "h-8 px-8 font-mono text-xs font-bold",
                    onClick: (t) => {
                      (t.preventDefault(),
                        a.handleSubmit(async (t) => {
                          _D(t).then(({ data: t }) => {
                            t && (hN.success(r("form.buttons.success")), e(), s(!1));
                          });
                        })());
                    },
                    children: r("form.buttons.submit"),
                  }),
                ],
              }),
            }),
          ],
        }),
      ],
    }),
  });
}
function Y2t({ table: e, refetch: t, saveOrder: n, isSortMode: i }) {
  const { t: r } = Py("notice"),
    o = e.getState().columnFilters.length > 0;
  return Q.jsxs("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: [
      Q.jsxs("div", {
        className: "flex flex-1 flex-wrap items-center gap-2 sm:flex-nowrap",
        children: [
          !i && Q.jsx(Z2t, { refetch: t }),
          !i &&
            Q.jsx(Q6e, {
              placeholder: r("table.toolbar.search"),
              value: e.getColumn("title")?.getFilterValue() ?? "",
              onChange: (t) => e.getColumn("title")?.setFilterValue(t.target.value),
              className: "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
            }),
          o &&
            !i &&
            Q.jsxs(Nm, {
              variant: "ghost",
              onClick: () => e.resetColumnFilters(),
              className: "h-9 px-2 lg:px-3",
              children: [r("table.toolbar.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
            }),
        ],
      }),
      e.getRowCount() > 0 &&
        Q.jsx("div", {
          className: "hidden items-center space-x-2 md:flex",
          children: Q.jsx(Nm, {
            variant: i ? "default" : "outline",
            onClick: n,
            className: "h-8",
            size: "sm",
            children: r(i ? "table.toolbar.sort.save" : "table.toolbar.sort.edit"),
          }),
        }),
    ],
  });
}
const X2t = (e, t) => [
  {
    id: "drag-handle",
    header: "",
    cell: () =>
      Q.jsx("div", {
        className: "flex items-center justify-center",
        children: Q.jsx(Rat, { className: "h-4 w-4 cursor-move text-muted-foreground" }),
      }),
    size: 40,
    enableSorting: !1,
  },
  {
    accessorKey: "id",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.id") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "flex items-center space-x-2",
        children: Q.jsx(hqt, {
          variant: "outline",
          className: "font-mono",
          children: e.getValue("id"),
        }),
      }),
    enableSorting: !0,
    size: 60,
  },
  {
    accessorKey: "show",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.show") }),
    cell: ({ row: t }) =>
      Q.jsx("div", {
        className: "flex items-center",
        children: Q.jsx(mGt, {
          defaultChecked: t.getValue("show"),
          onCheckedChange: async () => {
            const { data: n } = await bD(t.original.id);
            n || e();
          },
        }),
      }),
    enableSorting: !1,
    size: 100,
  },
  {
    accessorKey: "title",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.title") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "flex max-w-[500px] items-center",
        children: Q.jsx("span", {
          className: "truncate font-medium",
          children: e.getValue("title"),
        }),
      }),
    enableSorting: !1,
    size: 6e3,
  },
  {
    id: "actions",
    header: ({ column: e }) =>
      Q.jsx(SYt, { className: "justify-end", column: e, title: t("table.columns.actions") }),
    cell: ({ row: n }) =>
      Q.jsxs("div", {
        className: "flex items-center justify-end space-x-2",
        children: [
          Q.jsx(Z2t, {
            refetch: e,
            dialogTrigger: Q.jsxs(Nm, {
              variant: "ghost",
              size: "icon",
              className: "h-8 w-8 hover:bg-muted",
              children: [
                Q.jsx(H7e, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
                Q.jsx("span", { className: "sr-only", children: t("table.actions.edit") }),
              ],
            }),
            type: "edit",
            defaultFormValues: n.original,
          }),
          Q.jsx(yXt, {
            title: t("table.actions.delete.title"),
            description: t("table.actions.delete.description"),
            onConfirm: async () => {
              vD(n.original.id).then(() => {
                (hN.success(t("table.actions.delete.success")), e());
              });
            },
            children: Q.jsxs(Nm, {
              variant: "ghost",
              size: "icon",
              className: "h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",
              children: [
                Q.jsx(ilt, {
                  className:
                    "h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400",
                }),
                Q.jsx("span", { className: "sr-only", children: t("table.actions.delete.title") }),
              ],
            }),
          }),
        ],
      }),
    size: 100,
  },
];
function Q2t() {
  const { t: e } = Py("notice"),
    [t, n] = H.useState({}),
    [i, r] = H.useState({}),
    [o, s] = H.useState([]),
    [a, l] = H.useState([]),
    [c, d] = H.useState(!1),
    [u, h] = H.useState({}),
    [g, p] = H.useState({ pageSize: 50, pageIndex: 0 }),
    [f, m] = H.useState([]),
    {
      refetch: _,
      data: v,
      isLoading: b,
    } = gC({ queryKey: ["notices"], queryFn: async () => (await mD()).data ?? [] });
  (H.useEffect(() => {
    v && m(v);
  }, [v]),
    H.useEffect(() => {
      (r({ "drag-handle": c, content: !c, created_at: !c, actions: !c }),
        p({ pageSize: c ? 99999 : 50, pageIndex: 0 }));
    }, [c]));
  const y = async () => {
      c
        ? yD(f.map((e) => e.id))
            .then(() => {
              (hN.success("排序保存成功"), d(!1), _());
            })
            .finally(() => {
              d(!1);
            })
        : d(!0);
    },
    x = PKt({
      data: f ?? [],
      columns: X2t(_, e),
      state: {
        sorting: a,
        columnVisibility: i,
        rowSelection: t,
        columnFilters: o,
        columnSizing: u,
        pagination: g,
      },
      enableRowSelection: !0,
      onRowSelectionChange: n,
      onSortingChange: l,
      onColumnFiltersChange: s,
      onColumnVisibilityChange: r,
      onColumnSizingChange: h,
      onPaginationChange: p,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsx("div", {
    className: "space-y-4",
    children: Q.jsx(QKt, {
      table: x,
      toolbar: (e) => Q.jsx(Y2t, { table: e, refetch: _, saveOrder: y, isSortMode: c }),
      draggable: c,
      onDragStart: (e, t) => {
        c &&
          (e.dataTransfer.setData("text/plain", t.toString()),
          e.currentTarget.classList.add("opacity-50"));
      },
      onDragEnd: (e) => e.currentTarget.classList.remove("opacity-50"),
      onDragOver: (e) => {
        (e.preventDefault(), e.currentTarget.classList.add("bg-muted"));
      },
      onDragLeave: (e) => e.currentTarget.classList.remove("bg-muted"),
      onDrop: (e, t) => {
        if (!c) return;
        (e.preventDefault(), e.currentTarget.classList.remove("bg-muted"));
        const n = parseInt(e.dataTransfer.getData("text/plain"));
        if (n === t) return;
        const i = [...f],
          [r] = i.splice(n, 1);
        (i.splice(t, 0, r), m(i));
      },
      showPagination: !c,
      isLoading: b,
      mobilePrimaryField: "title",
    }),
  });
}
const J2t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("notice");
          return Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                className: "flex items-center justify-between",
                children: [
                  Q.jsx(Vdt, {}),
                  Q.jsxs("div", {
                    className: "flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                className: "flex flex-col",
                fixedHeight: !0,
                children: [
                  Q.jsx("div", {
                    className: "mb-2 flex items-center justify-between space-y-2",
                    children: Q.jsxs("div", {
                      children: [
                        Q.jsx("div", {
                          className: "mb-2",
                          children: Q.jsx("h2", {
                            className: "text-2xl font-bold tracking-tight",
                            children: e("title"),
                          }),
                        }),
                        Q.jsx("p", {
                          className: "text-muted-foreground",
                          children: e("description"),
                        }),
                      ],
                    }),
                  }),
                  Q.jsx("div", {
                    className:
                      "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                    children: Q.jsx(Q2t, {}),
                  }),
                ],
              }),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  e4t = gy({
    id: cy().nullable(),
    language: ly().max(250),
    category: ly().max(250),
    title: ly().min(1).max(250),
    body: ly().min(1),
    show: dy(),
  }),
  t4t = { id: null, language: "zh-CN", category: "", title: "", body: "", show: !1 };
function n4t({ refreshData: e, dialogTrigger: t, type: n = "add", defaultFormValues: i = t4t }) {
  const { t: r } = Py("knowledge"),
    [o, s] = H.useState(!1),
    a = kv({ resolver: Ov(e4t), defaultValues: i, mode: "onChange", shouldFocusError: !0 }),
    l = new q2t({ html: !0 });
  return (
    H.useEffect(() => {
      o &&
        i.id &&
        CD(i.id).then(({ data: e }) => {
          a.reset(e);
        });
    }, [i.id, a, o]),
    Q.jsxs(Jet, {
      onOpenChange: s,
      open: o,
      children: [
        Q.jsx(ett, {
          asChild: !0,
          children:
            t ||
            Q.jsxs(Nm, {
              variant: "outline",
              size: "sm",
              className: "space-x-2",
              children: [
                Q.jsx(yYt, { icon: "ion:add" }),
                " ",
                Q.jsx("div", { children: r("form.add") }),
              ],
            }),
        }),
        Q.jsxs(ttt, {
          className: "max-w-4xl gap-0 overflow-hidden p-0 sm:rounded-2xl",
          children: [
            Q.jsxs(ntt, {
              className: "border-b bg-muted/20 px-6 pb-4 pt-6",
              children: [
                Q.jsx(rtt, {
                  className: "font-mono text-lg tracking-tight",
                  children: r("add" === n ? "form.add" : "form.edit"),
                }),
                Q.jsx(ott, {
                  className: "font-mono text-xs opacity-70",
                  children: r(
                    "form.description",
                    "发布或编辑知识库文章，支持多语言和 Markdown 格式。",
                  ),
                }),
              ],
            }),
            Q.jsxs(Hy, {
              ...a,
              children: [
                Q.jsxs("div", {
                  className: "max-h-[70vh] space-y-4 overflow-y-auto px-6 py-4 font-mono text-xs",
                  children: [
                    Q.jsxs("div", {
                      className: "grid gap-4 md:grid-cols-2",
                      children: [
                        Q.jsx(Uy, {
                          control: a.control,
                          name: "title",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              children: [
                                Q.jsx(Gy, {
                                  className:
                                    "text-[11px] uppercase tracking-wider text-muted-foreground",
                                  children: r("form.title"),
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(Q6e, {
                                    placeholder: r("form.titlePlaceholder"),
                                    ...e,
                                    className: "h-9 font-mono text-xs",
                                  }),
                                }),
                                Q.jsx(Xy, { className: "text-[10px]" }),
                              ],
                            }),
                        }),
                        Q.jsx(Uy, {
                          control: a.control,
                          name: "category",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              children: [
                                Q.jsx(Gy, {
                                  className:
                                    "text-[11px] uppercase tracking-wider text-muted-foreground",
                                  children: r("form.category"),
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(Q6e, {
                                    placeholder: r("form.categoryPlaceholder"),
                                    ...e,
                                    className: "h-9 font-mono text-xs",
                                  }),
                                }),
                                Q.jsx(Xy, { className: "text-[10px]" }),
                              ],
                            }),
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "grid gap-4 md:grid-cols-2",
                      children: [
                        Q.jsx(Uy, {
                          control: a.control,
                          name: "language",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              children: [
                                Q.jsx(Gy, {
                                  className:
                                    "text-[11px] uppercase tracking-wider text-muted-foreground",
                                  children: r("form.language"),
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsxs(THt, {
                                    value: e.value,
                                    onValueChange: e.onChange,
                                    children: [
                                      Q.jsx(OHt, {
                                        className: "h-9 font-mono text-xs",
                                        children: Q.jsx(RHt, {
                                          placeholder: r("form.languagePlaceholder"),
                                        }),
                                      }),
                                      Q.jsx(PHt, {
                                        children: [
                                          { value: "en-US" },
                                          { value: "ja-JP" },
                                          { value: "ko-KR" },
                                          { value: "vi-VN" },
                                          { value: "zh-CN" },
                                          { value: "zh-TW" },
                                          { value: "ru-RU" },
                                        ].map((e) =>
                                          Q.jsx(
                                            FHt,
                                            {
                                              value: e.value,
                                              className: "cursor-pointer font-mono text-xs",
                                              children: r(`languages.${e.value}`),
                                            },
                                            e.value,
                                          ),
                                        ),
                                      }),
                                    ],
                                  }),
                                }),
                                Q.jsx(Xy, { className: "text-[10px]" }),
                              ],
                            }),
                        }),
                        Q.jsx(Uy, {
                          control: a.control,
                          name: "show",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              className: "flex flex-col",
                              children: [
                                Q.jsx(Gy, {
                                  className:
                                    "text-[11px] uppercase tracking-wider text-muted-foreground",
                                  children: r("form.show"),
                                }),
                                Q.jsx("div", {
                                  className: "flex h-9 items-center",
                                  children: Q.jsx(Zy, {
                                    children: Q.jsx(mGt, {
                                      checked: e.value,
                                      onCheckedChange: e.onChange,
                                    }),
                                  }),
                                }),
                                Q.jsx(Xy, { className: "text-[10px]" }),
                              ],
                            }),
                        }),
                      ],
                    }),
                    Q.jsx(Uy, {
                      control: a.control,
                      name: "body",
                      render: ({ field: e }) =>
                        Q.jsxs(Ky, {
                          className: "space-y-2",
                          children: [
                            Q.jsx(Gy, {
                              className:
                                "text-[11px] uppercase tracking-wider text-muted-foreground",
                              children: r("form.content"),
                            }),
                            Q.jsx(Zy, {
                              children: Q.jsx("div", {
                                className:
                                  "overflow-hidden rounded-md border border-input focus-within:ring-1 focus-within:ring-ring",
                                children: Q.jsx(TJt, {
                                  style: { height: "400px" },
                                  value: e.value,
                                  renderHTML: (e) => l.render(e),
                                  onChange: ({ text: t }) => {
                                    e.onChange(t);
                                  },
                                  className: "border-none font-mono text-xs",
                                  config: {
                                    view: { menu: !0, md: !0, html: !1 },
                                    canView: {
                                      menu: !0,
                                      md: !0,
                                      html: !1,
                                      fullScreen: !1,
                                      hideMenu: !1,
                                    },
                                  },
                                }),
                              }),
                            }),
                            Q.jsx(Xy, { className: "text-[10px]" }),
                          ],
                        }),
                    }),
                  ],
                }),
                Q.jsx(itt, {
                  className: "border-t bg-muted/20 px-6 py-4",
                  children: Q.jsxs("div", {
                    className: "flex w-full items-center justify-end gap-3",
                    children: [
                      Q.jsx(stt, {
                        asChild: !0,
                        children: Q.jsx(Nm, {
                          type: "button",
                          variant: "ghost",
                          className: "h-8 px-4 font-mono text-xs font-bold",
                          children: r("form.cancel"),
                        }),
                      }),
                      Q.jsx(Nm, {
                        type: "submit",
                        className: "h-8 px-8 font-mono text-xs font-bold",
                        onClick: () => {
                          a.handleSubmit((t) => {
                            SD(t).then(({ data: t }) => {
                              t &&
                                (a.reset(), hN.success(r("messages.operationSuccess")), s(!1), e());
                            });
                          })();
                        },
                        children: r("form.submit"),
                      }),
                    ],
                  }),
                }),
              ],
            }),
          ],
        }),
      ],
    })
  );
}
function i4t({ column: e, title: t, options: n }) {
  const i = e?.getFacetedUniqueValues(),
    r = new Set(e?.getFilterValue());
  return Q.jsxs(qUt, {
    children: [
      Q.jsx(KUt, {
        asChild: !0,
        children: Q.jsxs(Nm, {
          variant: "outline",
          size: "sm",
          className: "h-8 border-dashed",
          children: [
            Q.jsx(U7e, { className: "mr-2 h-4 w-4" }),
            t,
            r?.size > 0 &&
              Q.jsxs(Q.Fragment, {
                children: [
                  Q.jsx(Um, { orientation: "vertical", className: "mx-2 h-4" }),
                  Q.jsx(hqt, {
                    variant: "secondary",
                    className: "rounded-sm px-1 font-normal lg:hidden",
                    children: r.size,
                  }),
                  Q.jsx("div", {
                    className: "hidden space-x-1 lg:flex",
                    children:
                      r.size > 2
                        ? Q.jsxs(hqt, {
                            variant: "secondary",
                            className: "rounded-sm px-1 font-normal",
                            children: [r.size, " selected"],
                          })
                        : n
                            .filter((e) => r.has(e.value))
                            .map((e) =>
                              Q.jsx(
                                hqt,
                                {
                                  variant: "secondary",
                                  className: "rounded-sm px-1 font-normal",
                                  children: e.label,
                                },
                                e.value,
                              ),
                            ),
                  }),
                ],
              }),
          ],
        }),
      }),
      Q.jsx(ZUt, {
        className: "w-[200px] p-0",
        align: "start",
        children: Q.jsxs(Rdt, {
          children: [
            Q.jsx(Mdt, { placeholder: t }),
            Q.jsxs(Adt, {
              children: [
                Q.jsx(Pdt, { children: "No results found." }),
                Q.jsx(jdt, {
                  children: n.map((t) => {
                    const n = r.has(t.value);
                    return Q.jsxs(
                      Bdt,
                      {
                        onSelect: () => {
                          n ? r.delete(t.value) : r.add(t.value);
                          const i = Array.from(r);
                          e?.setFilterValue(i.length ? i : void 0);
                        },
                        children: [
                          Q.jsx("div", {
                            className: Rf(
                              "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
                              n
                                ? "bg-primary text-primary-foreground"
                                : "opacity-50 [&_svg]:invisible",
                            ),
                            children: Q.jsx(h7e, { className: Rf("h-4 w-4") }),
                          }),
                          t.icon &&
                            Q.jsx(t.icon, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
                          Q.jsx("span", { children: t.label }),
                          i?.get(t.value) &&
                            Q.jsx("span", {
                              className:
                                "ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",
                              children: i.get(t.value),
                            }),
                        ],
                      },
                      t.value,
                    );
                  }),
                }),
                r.size > 0 &&
                  Q.jsxs(Q.Fragment, {
                    children: [
                      Q.jsx(Fdt, {}),
                      Q.jsx(jdt, {
                        children: Q.jsx(Bdt, {
                          onSelect: () => e?.setFilterValue(void 0),
                          className: "justify-center text-center",
                          children: "Clear filters",
                        }),
                      }),
                    ],
                  }),
              ],
            }),
          ],
        }),
      }),
    ],
  });
}
function r4t({ table: e, refetch: t, saveOrder: n, isSortMode: i }) {
  const r = e.getState().columnFilters.length > 0,
    { t: o } = Py("knowledge");
  return Q.jsxs("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: [
      i
        ? Q.jsx("p", {
            className: "text-sm text-muted-foreground",
            children: o("toolbar.sortModeHint"),
          })
        : Q.jsxs("div", {
            className: "flex flex-wrap items-center gap-2 sm:flex-nowrap",
            children: [
              Q.jsx(n4t, { refreshData: t }),
              Q.jsx(Q6e, {
                placeholder: o("toolbar.searchPlaceholder"),
                value: e.getColumn("title")?.getFilterValue() ?? "",
                onChange: (t) => e.getColumn("title")?.setFilterValue(t.target.value),
                className: "h-8 w-full sm:w-[150px] lg:w-[250px]",
              }),
              e.getColumn("category") &&
                Q.jsx(i4t, {
                  column: e.getColumn("category"),
                  title: o("columns.category"),
                  options: Array.from(
                    new Set(e.getCoreRowModel().rows.map((e) => e.getValue("category"))),
                  ).map((e) => ({ label: e, value: e })),
                }),
              r &&
                Q.jsxs(Nm, {
                  variant: "ghost",
                  onClick: () => e.resetColumnFilters(),
                  children: [o("toolbar.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
                }),
            ],
          }),
      e.getRowCount() > 0 &&
        Q.jsx("div", {
          className: "hidden items-center gap-2 md:flex",
          children: Q.jsx(Nm, {
            variant: i ? "default" : "outline",
            onClick: n,
            size: "sm",
            children: o(i ? "toolbar.saveSort" : "toolbar.editSort"),
          }),
        }),
    ],
  });
}
const o4t = ({ refetch: e, isSortMode: t = !1, t: n }) => [
  {
    id: "drag-handle",
    header: () => null,
    cell: () =>
      Q.jsx("div", {
        className: t ? "cursor-move" : "opacity-0",
        children: Q.jsx(P7e, { className: "size-4" }),
      }),
    size: 40,
    enableSorting: !1,
  },
  {
    accessorKey: "id",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: n("columns.id") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "flex items-center space-x-2",
        children: Q.jsx(hqt, {
          variant: "outline",
          className: "font-mono",
          children: e.getValue("id"),
        }),
      }),
    enableSorting: !0,
    size: 70,
  },
  {
    accessorKey: "show",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: n("columns.status") }),
    cell: ({ row: t }) =>
      Q.jsx("div", {
        className: "flex items-center",
        children: Q.jsx(mGt, {
          defaultChecked: t.getValue("show"),
          onCheckedChange: async () => {
            ED({ id: t.original.id }).then(({ data: t }) => {
              t || e();
            });
          },
        }),
      }),
    enableSorting: !1,
    size: 100,
  },
  {
    accessorKey: "title",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: n("columns.title") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "flex space-x-2",
        children: Q.jsx("span", {
          className: "line-clamp-2 font-medium",
          children: e.getValue("title"),
        }),
      }),
    enableSorting: !0,
    size: 600,
  },
  {
    accessorKey: "category",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: n("columns.category") }),
    cell: ({ row: e }) =>
      Q.jsx(hqt, {
        variant: "secondary",
        className: "max-w-[180px] truncate",
        children: e.getValue("category"),
      }),
    enableSorting: !0,
    size: 1800,
  },
  {
    id: "actions",
    header: ({ column: e }) =>
      Q.jsx(SYt, { className: "justify-end", column: e, title: n("columns.actions") }),
    cell: ({ row: t }) =>
      Q.jsxs("div", {
        className: "flex items-center justify-end space-x-1",
        children: [
          Q.jsx(n4t, {
            refreshData: e,
            dialogTrigger: Q.jsxs(Nm, {
              variant: "ghost",
              size: "icon",
              className: "h-8 w-8 hover:bg-muted",
              children: [
                Q.jsx(H7e, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
                Q.jsx("span", { className: "sr-only", children: n("form.edit") }),
              ],
            }),
            type: "edit",
            defaultFormValues: t.original,
          }),
          Q.jsx(yXt, {
            title: n("messages.deleteConfirm"),
            description: n("messages.deleteDescription"),
            confirmText: n("messages.deleteButton"),
            variant: "destructive",
            onConfirm: async () => {
              kD({ id: t.original.id }).then(({ data: t }) => {
                t && (hN.success(n("messages.operationSuccess")), e());
              });
            },
            children: Q.jsxs(Nm, {
              variant: "ghost",
              size: "icon",
              className: "h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",
              children: [
                Q.jsx(ilt, {
                  className:
                    "h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400",
                }),
                Q.jsx("span", { className: "sr-only", children: n("messages.deleteButton") }),
              ],
            }),
          }),
        ],
      }),
    size: 100,
  },
];
function s4t() {
  const { t: e } = Py("knowledge"),
    [t, n] = H.useState([]),
    [i, r] = H.useState([]),
    [o, s] = H.useState(!1),
    [a, l] = H.useState([]),
    [c, d] = H.useState({ "drag-handle": !1 }),
    [u, h] = H.useState({ pageSize: 20, pageIndex: 0 }),
    {
      refetch: g,
      data: p,
      isLoading: f,
    } = gC({
      queryKey: ["knowledge"],
      queryFn: async () => {
        const { data: e } = await wD();
        return e;
      },
    });
  (H.useEffect(() => {
    p && l(p || []);
  }, [p]),
    H.useEffect(() => {
      (d({ "drag-handle": o, actions: !o }), h({ pageSize: o ? 99999 : 10, pageIndex: 0 }));
    }, [o]));
  const m = async () => {
      o
        ? ND({ ids: a.map((e) => e.id) }).then(() => {
            (g(), s(!1), hN.success("排序保存成功"));
          })
        : s(!0);
    },
    _ = PKt({
      data: a,
      columns: o4t({ refetch: g, isSortMode: o, t: e }),
      state: { sorting: i, columnFilters: t, columnVisibility: c, pagination: u },
      onSortingChange: r,
      onColumnFiltersChange: n,
      onColumnVisibilityChange: d,
      onPaginationChange: h,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsx(QKt, {
    table: _,
    toolbar: (e) => Q.jsx(r4t, { table: e, refetch: g, saveOrder: m, isSortMode: o }),
    draggable: o,
    onDragStart: (e, t) => {
      o &&
        (e.dataTransfer.setData("text/plain", t.toString()),
        e.currentTarget.classList.add("opacity-50"));
    },
    onDragEnd: (e) => e.currentTarget.classList.remove("opacity-50"),
    onDragOver: (e) => {
      (e.preventDefault(), e.currentTarget.classList.add("bg-muted"));
    },
    onDragLeave: (e) => e.currentTarget.classList.remove("bg-muted"),
    onDrop: (e, t) => {
      if (!o) return;
      (e.preventDefault(), e.currentTarget.classList.remove("bg-muted"));
      const n = parseInt(e.dataTransfer.getData("text/plain"));
      if (n === t) return;
      const i = [...a],
        [r] = i.splice(n, 1);
      (i.splice(t, 0, r), l(i));
    },
    showPagination: !o,
    isLoading: f,
    mobilePrimaryField: "title",
    mobileGridFields: ["category", "show"],
  });
}
const a4t = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py("knowledge");
        return Q.jsxs(Wot, {
          children: [
            Q.jsxs(Hot, {
              children: [
                Q.jsx(Vdt, {}),
                Q.jsxs("div", {
                  className: "ml-auto flex items-center space-x-4",
                  children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                }),
              ],
            }),
            Q.jsxs(zot, {
              className: "flex flex-col",
              fixedHeight: !0,
              children: [
                Q.jsx("div", {
                  className: "mb-2 flex items-center justify-between space-y-2",
                  children: Q.jsxs("div", {
                    children: [
                      Q.jsx("h2", {
                        className: "text-2xl font-bold tracking-tight mb-2",
                        children: e("title"),
                      }),
                      Q.jsx("p", {
                        className: "text-muted-foreground",
                        children: e("description"),
                      }),
                    ],
                  }),
                }),
                Q.jsx("div", {
                  className:
                    "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                  children: Q.jsx(s4t, {}),
                }),
              ],
            }),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
function l4t(e, t) {
  if (0 === e.length) return {};
  if (!t) return { "": e };
  const n = {};
  return (
    e.forEach((e) => {
      const i = e[t] || "";
      (n[i] || (n[i] = []), n[i].push(e));
    }),
    n
  );
}
const c4t = H.forwardRef(({ className: e, ...t }, n) =>
  Ldt((e) => 0 === e.filtered.count)
    ? Q.jsx("div", {
        ref: n,
        className: Rf("py-6 text-center text-sm", e),
        "cmdk-empty": "",
        role: "presentation",
        ...t,
      })
    : null,
);
c4t.displayName = "CommandEmpty";
const d4t = H.forwardRef(
  (
    {
      value: e,
      onChange: t,
      placeholder: n,
      defaultOptions: i = [],
      options: r,
      delay: o,
      onSearch: s,
      loadingIndicator: a,
      emptyIndicator: l,
      maxSelected: c = Number.MAX_SAFE_INTEGER,
      onMaxSelected: d,
      hidePlaceholderWhenSelected: u,
      disabled: h,
      groupBy: g,
      className: p,
      badgeClassName: f,
      selectFirstItem: m = !0,
      creatable: _ = !1,
      triggerSearchOnFocus: v = !1,
      commandProps: b,
      inputProps: y,
      hideClearAllButton: x = !1,
    },
    w,
  ) => {
    const C = H.useRef(null),
      [S, k] = H.useState(!1);
    H.useRef(!1);
    const [E, N] = H.useState(!1),
      [L, D] = H.useState(e || []),
      [T, I] = H.useState(l4t(i, g)),
      [R, O] = H.useState(""),
      M = (function (e, t) {
        const [n, i] = H.useState(e);
        return (
          H.useEffect(() => {
            const n = setTimeout(() => i(e), t);
            return () => {
              clearTimeout(n);
            };
          }, [e, t]),
          n
        );
      })(R, o || 500);
    H.useImperativeHandle(
      w,
      () => ({ selectedValue: [...L], input: C.current, focus: () => C.current?.focus() }),
      [L],
    );
    const A = H.useCallback(
        (e) => {
          const n = L.filter((t) => t.value !== e.value);
          (D(n), t?.(n));
        },
        [t, L],
      ),
      P = H.useCallback(
        (e) => {
          const t = C.current;
          if (t) {
            if (("Delete" === e.key || "Backspace" === e.key) && "" === t.value && L.length > 0) {
              L[L.length - 1].fixed || A(L[L.length - 1]);
            }
            "Escape" === e.key && t.blur();
          }
        },
        [A, L],
      );
    (H.useEffect(() => {
      e && D(e);
    }, [e]),
      H.useEffect(() => {
        if (!r || s) return;
        const e = l4t(r || [], g);
        JSON.stringify(e) !== JSON.stringify(T) && I(e);
      }, [i, r, g, s, T]),
      H.useEffect(() => {
        const e = async () => {
          N(!0);
          const e = await s?.(M);
          (I(l4t(e || [], g)), N(!1));
        };
        (async () => {
          s && S && (v && (await e()), M && (await e()));
        })();
      }, [M, g, S, v]));
    const j = H.useCallback(() => {
        if (l)
          return s && !_ && 0 === Object.keys(T).length
            ? Q.jsx(Bdt, { value: "-", disabled: !0, children: l })
            : Q.jsx(c4t, { children: l });
      }, [_, l, s, T]),
      F = H.useMemo(
        () =>
          (function (e, t) {
            const n = JSON.parse(JSON.stringify(e));
            for (const [i, r] of Object.entries(n))
              n[i] = r.filter((e) => !t.find((t) => t.value === e.value));
            return n;
          })(T, L),
        [T, L],
      ),
      B = H.useCallback(
        () =>
          b?.filter
            ? b.filter
            : _
              ? (e, t) => (e.toLowerCase().includes(t.toLowerCase()) ? 1 : -1)
              : void 0,
        [_, b?.filter],
      ),
      V = H.useCallback(() => {
        const e = L.filter((e) => e.fixed);
        (D(e), t?.(e));
      }, [t, L]);
    return Q.jsx(Rdt, {
      ...b,
      onKeyDown: (e) => {
        (P(e), b?.onKeyDown?.(e));
      },
      className: Rf("h-auto overflow-visible bg-transparent", b?.className),
      shouldFilter: void 0 !== b?.shouldFilter ? b.shouldFilter : !s,
      filter: B(),
      children: Q.jsxs(qUt, {
        open: S,
        onOpenChange: k,
        children: [
          Q.jsx(GUt, {
            asChild: !0,
            children: Q.jsx("div", {
              className: Rf(
                "rounded-md border border-input text-sm ring-offset-background focus-within:ring-1 focus-within:ring-ring ",
                { "px-3 py-2": 0 !== L.length, "cursor-text": !h && 0 !== L.length },
                p,
              ),
              onClick: () => {
                h || C.current?.focus();
              },
              children: Q.jsxs("div", {
                className: "flex flex-wrap gap-1",
                children: [
                  L.map((e) =>
                    Q.jsxs(
                      hqt,
                      {
                        className: Rf(
                          "data-[disabled]:bg-muted-foreground data-[disabled]:text-muted data-[disabled]:hover:bg-muted-foreground",
                          "data-[fixed]:bg-muted-foreground data-[fixed]:text-muted data-[fixed]:hover:bg-muted-foreground",
                          f,
                        ),
                        "data-fixed": e.fixed,
                        "data-disabled": h || void 0,
                        children: [
                          e.label,
                          Q.jsx("button", {
                            className: Rf(
                              "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",
                              (h || e.fixed) && "hidden",
                            ),
                            onKeyDown: (t) => {
                              "Enter" === t.key && A(e);
                            },
                            onMouseDown: (e) => {
                              (e.preventDefault(), e.stopPropagation());
                            },
                            onClick: () => A(e),
                            children: Q.jsx(plt, {
                              className: "h-3 w-3 text-muted-foreground hover:text-foreground",
                            }),
                          }),
                        ],
                      },
                      e.value,
                    ),
                  ),
                  Q.jsx(xdt.Input, {
                    ...y,
                    ref: C,
                    value: R,
                    disabled: h,
                    onValueChange: (e) => {
                      (O(e), y?.onValueChange?.(e));
                    },
                    onBlur: (e) => {
                      y?.onBlur?.(e);
                    },
                    onFocus: (e) => {
                      (k(!0), v && s?.(M), y?.onFocus?.(e));
                    },
                    placeholder: u && 0 !== L.length ? "" : n,
                    className: Rf(
                      "flex-1 bg-transparent outline-none placeholder:text-muted-foreground",
                      { "w-full": u, "px-3 py-2": 0 === L.length, "ml-1": 0 !== L.length },
                      y?.className,
                    ),
                  }),
                  Q.jsx("button", {
                    type: "button",
                    onClick: V,
                    className: Rf(
                      (x || h || L.length < 1 || L.filter((e) => e.fixed).length === L.length) &&
                        "hidden",
                    ),
                    children: Q.jsx(plt, {}),
                  }),
                ],
              }),
            }),
          }),
          Q.jsx(ZUt, {
            onOpenAutoFocus: (e) => e.preventDefault(),
            onInteractOutside: (e) => {
              e.target === C.current && e.preventDefault();
            },
            className: "p-0 border-none shadow-none bg-transparent",
            style: { width: "var(--radix-popover-trigger-width)" },
            side: "bottom",
            align: "start",
            sideOffset: 4,
            children: Q.jsx(Adt, {
              className:
                "rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",
              children: E
                ? Q.jsx(Q.Fragment, { children: a })
                : Q.jsxs(Q.Fragment, {
                    children: [
                      j(),
                      (() => {
                        if (!_) return;
                        if (
                          (function (e, t) {
                            for (const [, n] of Object.entries(e))
                              if (n.some((e) => t.find((t) => t.value === e.value))) return !0;
                            return !1;
                          })(T, [{ value: R, label: R }]) ||
                          L.find((e) => e.value === R)
                        )
                          return;
                        const e = Q.jsx(Bdt, {
                          value: R,
                          className: "cursor-pointer",
                          onMouseDown: (e) => {
                            (e.preventDefault(), e.stopPropagation());
                          },
                          onSelect: (e) => {
                            if (L.length >= c) return void d?.(L.length);
                            O("");
                            const n = [...L, { value: e, label: e }];
                            (D(n), t?.(n));
                          },
                          children: `Create "${R}"`,
                        });
                        return (!s && R.length > 0) || (s && M.length > 0 && !E) ? e : void 0;
                      })(),
                      !m && Q.jsx(Bdt, { value: "-", className: "hidden" }),
                      Object.entries(F).map(([e, n]) =>
                        Q.jsx(
                          jdt,
                          {
                            heading: e,
                            className: "h-full overflow-auto",
                            children: Q.jsx(Q.Fragment, {
                              children: n.map((e) =>
                                Q.jsx(
                                  Bdt,
                                  {
                                    value: e.value,
                                    disabled: e.disable,
                                    onMouseDown: (e) => {
                                      (e.preventDefault(), e.stopPropagation());
                                    },
                                    onSelect: () => {
                                      if (L.length >= c) return void d?.(L.length);
                                      O("");
                                      const n = [...L, e];
                                      (D(n), t?.(n));
                                    },
                                    className: Rf(
                                      "cursor-pointer",
                                      e.disable && "cursor-default text-muted-foreground",
                                    ),
                                    children: e.label,
                                  },
                                  e.value,
                                ),
                              ),
                            }),
                          },
                          e,
                        ),
                      ),
                    ],
                  }),
            }),
          }),
        ],
      }),
    });
  },
);
d4t.displayName = "MultipleSelector";
const u4t = (e) =>
  gy({
    id: cy().optional(),
    name: ly()
      .min(2, e("messages.nameValidation.min"))
      .max(50, e("messages.nameValidation.max"))
      .regex(/^[a-zA-Z0-9\u4e00-\u9fa5_-]+$/, e("messages.nameValidation.pattern")),
  });
function h4t({ refetch: e, dialogTrigger: t, defaultValues: n = { name: "" }, type: i = "add" }) {
  const { t: r } = Py("group"),
    o = kv({ resolver: Ov(u4t(r)), defaultValues: n, mode: "onChange" }),
    [s, a] = H.useState(!1),
    [l, c] = H.useState(!1);
  return Q.jsxs(Jet, {
    open: s,
    onOpenChange: a,
    children: [
      Q.jsx(ett, {
        asChild: !0,
        children:
          t ||
          Q.jsxs(Nm, {
            variant: "outline",
            size: "sm",
            className: "space-x-2",
            children: [Q.jsx(yYt, { icon: "ion:add" }), Q.jsx("span", { children: r("form.add") })],
          }),
      }),
      Q.jsxs(ttt, {
        className: "max-w-md gap-0 overflow-hidden p-0 sm:rounded-2xl",
        children: [
          Q.jsxs(ntt, {
            className: "border-b bg-muted/20 px-6 pb-4 pt-6",
            children: [
              Q.jsx(rtt, {
                className: "font-mono text-lg tracking-tight",
                children: r("edit" === i ? "form.edit" : "form.create"),
              }),
              Q.jsx(ott, {
                className: "font-mono text-xs opacity-70",
                children: r("edit" === i ? "form.editDescription" : "form.createDescription"),
              }),
            ],
          }),
          Q.jsx(Hy, {
            ...o,
            children: Q.jsxs("form", {
              onSubmit: o.handleSubmit(async (t) => {
                (c(!0),
                  tD(t)
                    .then(() => {
                      (hN.success(
                        r("edit" === i ? "messages.updateSuccess" : "messages.createSuccess"),
                      ),
                        e && e(),
                        o.reset(),
                        a(!1));
                    })
                    .finally(() => {
                      c(!1);
                    }));
              }),
              children: [
                Q.jsx("div", {
                  className: "space-y-4 px-6 py-4",
                  children: Q.jsx(Uy, {
                    control: o.control,
                    name: "name",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[11px] text-muted-foreground",
                            children: r("form.name"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              placeholder: r("form.namePlaceholder"),
                              ...e,
                              className: "w-full font-mono text-xs",
                            }),
                          }),
                          Q.jsx(Yy, {
                            className: "font-mono text-[10px] opacity-70",
                            children: r("form.nameDescription"),
                          }),
                          Q.jsx(Xy, {}),
                        ],
                      }),
                  }),
                }),
                Q.jsxs(itt, {
                  className:
                    "flex flex-row items-center justify-end gap-3 border-t bg-muted/20 px-6 py-4 sm:space-x-0",
                  children: [
                    Q.jsx(stt, {
                      asChild: !0,
                      children: Q.jsx(Nm, {
                        type: "button",
                        variant: "ghost",
                        className: "h-9 px-4 font-mono text-xs",
                        children: r("form.cancel"),
                      }),
                    }),
                    Q.jsxs(Nm, {
                      type: "submit",
                      disabled: l || !o.formState.isValid,
                      className: "h-9 px-4 font-mono text-xs",
                      children: [
                        l && Q.jsx(Aat, { className: "mr-2 h-4 w-4 animate-spin" }),
                        r("edit" === i ? "form.update" : "form.create"),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          }),
        ],
      }),
    ],
  });
}
const g4t = H.createContext(void 0);
function p4t() {
  const e = H.useContext(g4t);
  if (void 0 === e) throw new Error("useServerEdit must be used within a ServerEditProvider");
  return e;
}
const f4t = (e) =>
    gy({
      cipher: ly().default("aes-128-gcm"),
      plugin: ly().optional().default(""),
      plugin_opts: ly().optional().default(""),
      client_fingerprint: ly().optional().default("chrome"),
      routing: e.optional().default({}),
    }),
  m4t = {
    ciphers: [
      "aes-128-gcm",
      "aes-192-gcm",
      "aes-256-gcm",
      "chacha20-ietf-poly1305",
      "2022-blake3-aes-128-gcm",
      "2022-blake3-aes-256-gcm",
      "2022-blake3-chacha20-poly1305",
    ],
    plugins: [
      { value: "none", label: "None" },
      { value: "obfs", label: "Simple Obfs" },
      { value: "v2ray-plugin", label: "V2Ray Plugin" },
      { value: "gost-plugin", label: "Gost Plugin" },
      { value: "shadow-tls", label: "Shadow TLS" },
      { value: "restls", label: "ResTLS" },
      { value: "kcptun", label: "KCPTun" },
    ],
    clientFingerprints: [
      { value: "chrome", label: "Chrome" },
      { value: "firefox", label: "Firefox" },
      { value: "safari", label: "Safari" },
      { value: "ios", label: "iOS" },
    ],
  },
  _4t = ({ form: e, t: t }) => {
    const [n, i] = H.useState(!1),
      [r, o] = H.useState("");
    return Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: "cipher",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "font-mono text-[12px] text-foreground/80",
                  children: t("dynamic_form.shadowsocks.cipher.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(qUt, {
                    open: n,
                    onOpenChange: i,
                    children: [
                      Q.jsx(KUt, {
                        asChild: !0,
                        children: Q.jsxs(ltt, {
                          variant: "outline",
                          role: "combobox",
                          "aria-expanded": n,
                          className: Rf("w-full justify-between", !e.value && "text-foreground/80"),
                          children: [
                            e.value || t("dynamic_form.shadowsocks.cipher.placeholder"),
                            Q.jsx(uat, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" }),
                          ],
                        }),
                      }),
                      Q.jsx(ZUt, {
                        className: "w-[400px] p-0",
                        align: "start",
                        children: Q.jsxs(Rdt, {
                          shouldFilter: !1,
                          children: [
                            Q.jsx(Mdt, {
                              placeholder: t("dynamic_form.shadowsocks.cipher.search_placeholder"),
                              value: r,
                              onValueChange: (t) => {
                                (o(t), t && !m4t.ciphers.includes(t) && e.onChange(t));
                              },
                            }),
                            Q.jsxs(Adt, {
                              children: [
                                Q.jsxs(Pdt, {
                                  children: [
                                    r &&
                                      Q.jsxs(Bdt, {
                                        value: r,
                                        onSelect: (t) => {
                                          (e.onChange(t), o(""), i(!1));
                                        },
                                        children: [
                                          Q.jsx(aat, { className: "mr-2 h-4 w-4 opacity-100" }),
                                          Q.jsxs("span", {
                                            className: "font-medium text-blue-600",
                                            children: [
                                              t("dynamic_form.shadowsocks.cipher.use_custom"),
                                              " ",
                                              '"',
                                              r,
                                              '"',
                                            ],
                                          }),
                                          Q.jsxs("span", {
                                            className: "ml-2 text-xs text-foreground/80",
                                            children: [
                                              "(",
                                              t("dynamic_form.shadowsocks.cipher.custom_label"),
                                              ")",
                                            ],
                                          }),
                                        ],
                                      }),
                                    !r &&
                                      Q.jsxs("div", {
                                        className: "p-2 text-sm text-foreground/80",
                                        children: [
                                          Q.jsx("p", {
                                            children: t(
                                              "dynamic_form.shadowsocks.cipher.no_results",
                                            ),
                                          }),
                                          Q.jsx("p", {
                                            className: "mt-1 text-xs",
                                            children: t(
                                              "dynamic_form.shadowsocks.cipher.custom_hint",
                                            ),
                                          }),
                                        ],
                                      }),
                                  ],
                                }),
                                Q.jsx(jdt, {
                                  heading: t("dynamic_form.shadowsocks.cipher.preset_group"),
                                  children: m4t.ciphers.map((t) =>
                                    Q.jsxs(
                                      Bdt,
                                      {
                                        value: t,
                                        onSelect: (t) => {
                                          (e.onChange(t), o(""), i(!1));
                                        },
                                        children: [
                                          Q.jsx(aat, {
                                            className: Rf(
                                              "mr-2 h-4 w-4",
                                              e.value === t ? "opacity-100" : "opacity-0",
                                            ),
                                          }),
                                          t,
                                        ],
                                      },
                                      t,
                                    ),
                                  ),
                                }),
                              ],
                            }),
                          ],
                        }),
                      }),
                    ],
                  }),
                }),
                Q.jsx(Yy, {
                  className: "font-mono text-[11px] opacity-70",
                  children: t("dynamic_form.shadowsocks.cipher.description"),
                }),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "plugin",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "font-mono text-[12px] text-foreground/80",
                  children: t("dynamic_form.shadowsocks.plugin.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    onValueChange: (t) => e.onChange("none" === t ? "" : t),
                    value: "" === e.value ? "none" : e.value || "none",
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.shadowsocks.plugin.placeholder"),
                        }),
                      }),
                      Q.jsx(PHt, {
                        children: m4t.plugins.map((e) =>
                          Q.jsx(FHt, { value: e.value, children: e.label }, e.value),
                        ),
                      }),
                    ],
                  }),
                }),
                Q.jsx(Yy, {
                  className: "font-mono text-[11px] opacity-70",
                  children:
                    e.value &&
                    "none" !== e.value &&
                    "" !== e.value &&
                    Q.jsxs(Q.Fragment, {
                      children: [
                        "obfs" === e.value && t("dynamic_form.shadowsocks.plugin.obfs_hint"),
                        "v2ray-plugin" === e.value &&
                          t("dynamic_form.shadowsocks.plugin.v2ray_hint"),
                        "gost-plugin" === e.value && t("dynamic_form.shadowsocks.plugin.gost_hint"),
                        "shadow-tls" === e.value &&
                          t("dynamic_form.shadowsocks.plugin.shadow_tls_hint"),
                        "restls" === e.value && t("dynamic_form.shadowsocks.plugin.restls_hint"),
                        "kcptun" === e.value && t("dynamic_form.shadowsocks.plugin.kcptun_hint"),
                      ],
                    }),
                }),
              ],
            }),
        }),
        e.watch("plugin") &&
          "none" !== e.watch("plugin") &&
          "" !== e.watch("plugin") &&
          Q.jsx(Uy, {
            control: e.control,
            name: "plugin_opts",
            render: ({ field: e }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "font-mono text-[12px] text-foreground/80",
                    children: t("dynamic_form.shadowsocks.plugin_opts.label"),
                  }),
                  Q.jsx(Yy, {
                    className: "font-mono text-[11px] opacity-70",
                    children: t("dynamic_form.shadowsocks.plugin_opts.description"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsx(Q6e, {
                      className: "font-mono text-xs",
                      type: "text",
                      placeholder: t("dynamic_form.shadowsocks.plugin_opts.placeholder"),
                      ...e,
                    }),
                  }),
                ],
              }),
          }),
        ("shadow-tls" === e.watch("plugin") || "restls" === e.watch("plugin")) &&
          Q.jsx(Uy, {
            control: e.control,
            name: "client_fingerprint",
            render: ({ field: e }) =>
              Q.jsxs(Ky, {
                children: [
                  Q.jsx(Gy, {
                    className: "font-mono text-[12px] text-foreground/80",
                    children: t("dynamic_form.shadowsocks.client_fingerprint"),
                  }),
                  Q.jsx(Zy, {
                    children: Q.jsxs(THt, {
                      value: e.value || "chrome",
                      onValueChange: e.onChange,
                      children: [
                        Q.jsx(OHt, {
                          className: "font-mono text-xs",
                          children: Q.jsx(RHt, {
                            placeholder: t(
                              "dynamic_form.shadowsocks.client_fingerprint_placeholder",
                            ),
                          }),
                        }),
                        Q.jsx(PHt, {
                          children: m4t.clientFingerprints.map((e) =>
                            Q.jsx(FHt, { value: e.value, children: e.label }, e.value),
                          ),
                        }),
                      ],
                    }),
                  }),
                  Q.jsx(Yy, {
                    className: "font-mono text-[11px] opacity-70",
                    children: t("dynamic_form.shadowsocks.client_fingerprint_description"),
                  }),
                ],
              }),
          }),
      ],
    });
  };
function v4t({ dialogTrigger: e, value: t, setValue: n, templateType: i }) {
  const { t: r } = Py("server"),
    [o, s] = H.useState(!1),
    [a, l] = H.useState(() => {
      if (!t || 0 === Object.keys(t).length) return "";
      try {
        return JSON.stringify(t, null, 2);
      } catch (spt) {
        return "";
      }
    }),
    [c, d] = H.useState(null),
    u = (e) => {
      if (!e) return null;
      try {
        const t = JSON.parse(e);
        return "object" != typeof t || null === t
          ? r("network_settings.validation.must_be_object")
          : null;
      } catch (t) {
        return r("network_settings.validation.invalid_json");
      }
    },
    h = {
      tcp: { label: "TCP", content: { acceptProxyProtocol: !1, header: { type: "none" } } },
      "tcp-http": {
        label: "TCP + HTTP",
        content: {
          acceptProxyProtocol: !1,
          header: {
            type: "http",
            request: {
              version: "1.1",
              method: "GET",
              path: ["/"],
              headers: { Host: ["www.example.com"] },
            },
            response: { version: "1.1", status: "200", reason: "OK" },
          },
        },
      },
      grpc: { label: "gRPC", content: { serviceName: "GunService" } },
      ws: { label: "WebSocket", content: { path: "/", headers: { Host: "v2ray.com" } } },
      h2: { label: "HTTP/2", content: { path: "/", host: ["www.google.com"] } },
      httpupgrade: {
        label: "HttpUpgrade",
        content: {
          acceptProxyProtocol: !1,
          path: "/",
          host: "xray.com",
          headers: { key: "value" },
        },
      },
      xhttp: {
        label: "XHTTP",
        content: {
          host: "example.com",
          path: "/yourpath",
          mode: "auto",
          extra: {
            headers: {},
            xPaddingBytes: "100-1000",
            noGRPCHeader: !1,
            noSSEHeader: !1,
            scMaxEachPostBytes: 1e6,
            scMinPostsIntervalMs: 30,
            scMaxBufferedPosts: 30,
            xmux: {
              maxConcurrency: "16-32",
              maxConnections: 0,
              cMaxReuseTimes: "64-128",
              cMaxLifetimeMs: 0,
              hMaxRequestTimes: "800-900",
              hKeepAlivePeriod: 0,
            },
            downloadSettings: {
              address: "",
              port: 443,
              network: "xhttp",
              security: "tls",
              tlsSettings: {},
              xhttpSettings: { path: "/yourpath" },
              sockopt: {},
            },
          },
        },
      },
    },
    g = () => {
      switch (i) {
        case "tcp":
          return ["tcp", "tcp-http"];
        case "grpc":
          return ["grpc"];
        case "ws":
          return ["ws"];
        case "h2":
          return ["h2"];
        case "httpupgrade":
          return ["httpupgrade"];
        case "xhttp":
          return ["xhttp"];
        default:
          return [];
      }
    },
    p = () => {
      const e = u(a || "");
      if (e) hN.error(e);
      else
        try {
          if (!a) return (n(null), void s(!1));
          (n(JSON.parse(a)), s(!1));
        } catch (t) {
          hN.error(r("network_settings.errors.save_failed"));
        }
    };
  return (
    H.useEffect(() => {
      o && t && Object.keys(t).length > 0 && l(JSON.stringify(t, null, 2));
    }, [o, t]),
    Q.jsxs(Jet, {
      open: o,
      onOpenChange: (e) => {
        (!e && o && p(), s(e));
      },
      children: [
        Q.jsx(ett, {
          asChild: !0,
          children:
            e ?? Q.jsx(ltt, { variant: "link", children: r("network_settings.edit_protocol") }),
        }),
        Q.jsxs(ttt, {
          className: "sm:max-w-[425px]",
          children: [
            Q.jsx(ntt, {
              children: Q.jsx(rtt, { children: r("network_settings.edit_protocol_config") }),
            }),
            Q.jsxs("div", {
              className: "space-y-4",
              children: [
                g().length > 0 &&
                  Q.jsx("div", {
                    className: "flex flex-wrap gap-2 pt-2",
                    children: g().map((e) =>
                      Q.jsx(
                        ltt,
                        {
                          variant: "outline",
                          size: "sm",
                          onClick: () =>
                            ((e) => {
                              const t = h[e];
                              if (t) {
                                const e = JSON.stringify(t.content, null, 2);
                                (l(e), d(null));
                              }
                            })(e),
                          children: r("network_settings.use_template", { template: h[e].label }),
                        },
                        e,
                      ),
                    ),
                  }),
                Q.jsxs("div", {
                  className: "space-y-2",
                  children: [
                    Q.jsx(_Gt, {
                      className:
                        "min-h-[200px] font-mono text-sm " +
                        (c ? "border-red-500 focus-visible:ring-red-500" : ""),
                      value: a,
                      placeholder:
                        g().length > 0
                          ? r("network_settings.json_config_placeholder_with_template")
                          : r("network_settings.json_config_placeholder"),
                      onChange: (e) => {
                        return ((t = e.target.value), l(t), void d(u(t)));
                        var t;
                      },
                    }),
                    c && Q.jsx("p", { className: "text-sm text-red-500", children: c }),
                  ],
                }),
              ],
            }),
            Q.jsxs(itt, {
              className: "gap-2",
              children: [
                Q.jsx(ltt, {
                  variant: "outline",
                  onClick: () => s(!1),
                  children: r("common.cancel"),
                }),
                Q.jsx(ltt, { onClick: p, disabled: !!c, children: r("common.confirm") }),
              ],
            }),
          ],
        }),
      ],
    })
  );
}
const b4t = gy({
    enabled: dy().default(!1),
    protocol: my(["smux", "yamux", "h2mux"]).default("smux"),
    max_connections: cy().default(4),
    padding: dy().default(!1),
    brutal: gy({
      enabled: dy().default(!1),
      up_mbps: cy().default(100),
      down_mbps: cy().default(100),
    }).default({ enabled: !1, up_mbps: 100, down_mbps: 100 }),
  })
    .optional()
    .default({
      enabled: !1,
      protocol: "smux",
      max_connections: 4,
      padding: !1,
      brutal: { enabled: !1, up_mbps: 100, down_mbps: 100 },
    }),
  y4t = gy({ enabled: dy().default(!1), fingerprint: ly().default("chrome") })
    .optional()
    .default({ enabled: !1, fingerprint: "chrome" }),
  x4t = [
    { value: "chrome", label: "Chrome" },
    { value: "firefox", label: "Firefox" },
    { value: "safari", label: "Safari" },
    { value: "ios", label: "iOS" },
    { value: "edge", label: "Edge" },
    { value: "random", label: "Random" },
  ],
  w4t = ({ form: e, t: t, prefix: n = "utls" }) => {
    const i = e.watch(`${n}.enabled`);
    return Q.jsxs("div", {
      className: "space-y-4 rounded-lg border p-4 bg-muted/10",
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: `${n}.enabled`,
          render: ({ field: i }) =>
            Q.jsxs(Ky, {
              className: "flex flex-row items-center justify-between",
              children: [
                Q.jsxs("div", {
                  className: "space-y-0.5",
                  children: [
                    Q.jsx(Gy, { className: "text-[13px] font-mono font-bold", children: "uTLS" }),
                    Q.jsx(Yy, {
                      className: "text-[11px] font-mono opacity-70",
                      children: t("dynamic_form.shadowsocks.client_fingerprint_description"),
                    }),
                  ],
                }),
                Q.jsx(Zy, {
                  children: Q.jsx(mGt, {
                    checked: i.value,
                    onCheckedChange: (t) => {
                      (i.onChange(t),
                        t &&
                          !e.getValues(`${n}.fingerprint`) &&
                          e.setValue(`${n}.fingerprint`, "chrome", {
                            shouldDirty: !0,
                            shouldTouch: !0,
                            shouldValidate: !0,
                          }));
                    },
                  }),
                }),
              ],
            }),
        }),
        i &&
          Q.jsx("div", {
            className: "pt-2 border-t border-dashed",
            children: Q.jsx(Uy, {
              control: e.control,
              name: `${n}.fingerprint`,
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  children: [
                    Q.jsxs(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: [t("dynamic_form.shadowsocks.client_fingerprint"), " (uTLS)"],
                    }),
                    Q.jsxs(THt, {
                      onValueChange: e.onChange,
                      value: e.value || "chrome",
                      children: [
                        Q.jsx(Zy, {
                          children: Q.jsx(OHt, {
                            className: "h-8 text-xs font-mono",
                            children: Q.jsx(RHt, {
                              placeholder: t(
                                "dynamic_form.shadowsocks.client_fingerprint_placeholder",
                              ),
                            }),
                          }),
                        }),
                        Q.jsx(PHt, {
                          children: x4t.map((e) =>
                            Q.jsx(
                              FHt,
                              { value: e.value, className: "text-xs font-mono", children: e.label },
                              e.value,
                            ),
                          ),
                        }),
                      ],
                    }),
                  ],
                }),
            }),
          }),
      ],
    });
  },
  C4t = ({ form: e, t: t, prefix: n = "multiplex" }) => {
    const i = e.watch(`${n}.enabled`),
      r = e.watch(`${n}.brutal.enabled`);
    return Q.jsxs("div", {
      className: "space-y-4 rounded-lg border p-4 bg-muted/10",
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: `${n}.enabled`,
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              className: "flex flex-row items-center justify-between",
              children: [
                Q.jsxs("div", {
                  className: "space-y-0.5",
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[13px] font-mono font-bold",
                      children: t("dynamic_form.multiplex.enabled.label"),
                    }),
                    Q.jsx(Yy, {
                      className: "text-[11px]",
                      children: t("dynamic_form.multiplex.enabled.description"),
                    }),
                  ],
                }),
                Q.jsx(Zy, {
                  children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                }),
              ],
            }),
        }),
        i &&
          Q.jsxs("div", {
            className: "space-y-4 pt-2 border-t border-dashed",
            children: [
              Q.jsxs("div", {
                className: "grid grid-cols-2 gap-4",
                children: [
                  Q.jsx(Uy, {
                    control: e.control,
                    name: `${n}.protocol`,
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, {
                            className: "text-[12px] font-mono text-foreground/80",
                            children: t("dynamic_form.multiplex.protocol.label"),
                          }),
                          Q.jsxs(THt, {
                            onValueChange: e.onChange,
                            value: e.value,
                            children: [
                              Q.jsx(Zy, {
                                children: Q.jsx(OHt, {
                                  className: "h-8 text-xs font-mono",
                                  children: Q.jsx(RHt, {}),
                                }),
                              }),
                              Q.jsxs(PHt, {
                                children: [
                                  Q.jsx(FHt, {
                                    value: "smux",
                                    className: "text-xs font-mono",
                                    children: "smux",
                                  }),
                                  Q.jsx(FHt, {
                                    value: "yamux",
                                    className: "text-xs font-mono",
                                    children: "yamux",
                                  }),
                                  Q.jsx(FHt, {
                                    value: "h2mux",
                                    className: "text-xs font-mono",
                                    children: "h2mux",
                                  }),
                                ],
                              }),
                            ],
                          }),
                          Q.jsx(Yy, {
                            className: "text-[10px] opacity-70",
                            children:
                              "h2mux" === e.value
                                ? "适合高延迟、大带宽且不需要 Brutal 的环境"
                                : "通用模式，兼容性最好",
                          }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: e.control,
                    name: `${n}.max_connections`,
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, {
                            className: "text-[12px] font-mono text-foreground/80",
                            children: t("dynamic_form.multiplex.max_connections.label"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              type: "number",
                              className: "h-8 text-xs font-mono",
                              ...e,
                              onChange: (t) => e.onChange(Number(t.target.value)),
                            }),
                          }),
                          Q.jsx(Yy, {
                            className: "text-[10px] opacity-70",
                            children: "最大建立的物理 TCP 数量",
                          }),
                        ],
                      }),
                  }),
                ],
              }),
              Q.jsx("div", {
                className: "grid grid-cols-2 gap-4",
                children: Q.jsx(Uy, {
                  control: e.control,
                  name: `${n}.padding`,
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      className:
                        "flex flex-row items-center justify-between space-y-0 rounded-md border p-2 bg-muted/5",
                      children: [
                        Q.jsxs("div", {
                          className: "space-y-0.5",
                          children: [
                            Q.jsx(Gy, {
                              className: "text-[12px] font-mono text-foreground/80",
                              children: t("dynamic_form.multiplex.padding.label"),
                            }),
                            Q.jsx(Yy, {
                              className: "text-[10px] leading-tight",
                              children: "填充数据包以对抗流量特征分析",
                            }),
                          ],
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(mGt, {
                            checked: e.value,
                            onCheckedChange: e.onChange,
                            className: "scale-75",
                          }),
                        }),
                      ],
                    }),
                }),
              }),
              Q.jsxs("div", {
                className: "mt-2 p-3 rounded bg-primary/5 space-y-3",
                children: [
                  Q.jsx(Uy, {
                    control: e.control,
                    name: `${n}.brutal.enabled`,
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        className: "flex flex-row items-center justify-between",
                        children: [
                          Q.jsx("div", {
                            className: "space-y-0.5",
                            children: Q.jsx(Gy, {
                              className: "text-[12px] font-mono font-medium text-primary",
                              children: t("dynamic_form.multiplex.brutal.enabled.label"),
                            }),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                          }),
                        ],
                      }),
                  }),
                  r &&
                    Q.jsxs("div", {
                      className: "grid grid-cols-1 gap-3 animate-in fade-in zoom-in duration-200",
                      children: [
                        Q.jsxs("div", {
                          className: "grid grid-cols-2 gap-4",
                          children: [
                            Q.jsx(Uy, {
                              control: e.control,
                              name: `${n}.brutal.up_mbps`,
                              render: ({ field: e }) =>
                                Q.jsxs(Ky, {
                                  children: [
                                    Q.jsx(Gy, {
                                      className: "text-[11px] font-mono text-foreground/70",
                                      children: t("dynamic_form.multiplex.brutal.up_mbps.label"),
                                    }),
                                    Q.jsx(Zy, {
                                      children: Q.jsxs("div", {
                                        className: "relative",
                                        children: [
                                          Q.jsx(Q6e, {
                                            type: "number",
                                            className: "h-8 text-xs font-mono pr-12",
                                            ...e,
                                            onChange: (t) => e.onChange(Number(t.target.value)),
                                          }),
                                          Q.jsx("span", {
                                            className:
                                              "absolute right-2 top-2 text-[9px] text-muted-foreground font-mono",
                                            children: "Mbps",
                                          }),
                                        ],
                                      }),
                                    }),
                                  ],
                                }),
                            }),
                            Q.jsx(Uy, {
                              control: e.control,
                              name: `${n}.brutal.down_mbps`,
                              render: ({ field: e }) =>
                                Q.jsxs(Ky, {
                                  children: [
                                    Q.jsx(Gy, {
                                      className: "text-[11px] font-mono text-foreground/70",
                                      children: t("dynamic_form.multiplex.brutal.down_mbps.label"),
                                    }),
                                    Q.jsx(Zy, {
                                      children: Q.jsxs("div", {
                                        className: "relative",
                                        children: [
                                          Q.jsx(Q6e, {
                                            type: "number",
                                            className: "h-8 text-xs font-mono pr-12",
                                            ...e,
                                            onChange: (t) => e.onChange(Number(t.target.value)),
                                          }),
                                          Q.jsx("span", {
                                            className:
                                              "absolute right-2 top-2 text-[9px] text-muted-foreground font-mono",
                                            children: "Mbps",
                                          }),
                                        ],
                                      }),
                                    }),
                                  ],
                                }),
                            }),
                          ],
                        }),
                        Q.jsxs("p", {
                          className:
                            "text-[10px] text-primary/70 leading-relaxed font-mono italic px-1",
                          children: ["* ", t("dynamic_form.multiplex.brutal.description")],
                        }),
                      ],
                    }),
                ],
              }),
            ],
          }),
      ],
    });
  },
  S4t = (e, t) =>
    gy({
      tls: by().default(0),
      tls_settings: gy({ server_name: ly().default(""), allow_insecure: dy().default(!1) }).default(
        {},
      ),
      utls: y4t,
      cert_config: e.default({}),
      network: ly().default("tcp"),
      network_settings: fy(uy()).default({}),
      multiplex: b4t,
      routing: t.optional().default({}),
    }),
  k4t = {
    networkOptions: [
      { value: "tcp", label: "TCP" },
      { value: "ws", label: "Websocket" },
      { value: "grpc", label: "gRPC" },
      { value: "h2", label: "HTTP/2" },
      { value: "httpupgrade", label: "HttpUpgrade" },
    ],
  },
  E4t = ({ form: e, t: t }) =>
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: "tls",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.vmess.tls.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    value: e.value?.toString(),
                    onValueChange: (t) => e.onChange(Number(t)),
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.vmess.tls.placeholder"),
                        }),
                      }),
                      Q.jsxs(PHt, {
                        children: [
                          Q.jsx(FHt, { value: "0", children: "None" }),
                          Q.jsx(FHt, { value: "1", children: "TLS" }),
                        ],
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        1 == e.watch("tls") &&
          Q.jsxs(Q.Fragment, {
            children: [
              Q.jsxs("div", {
                className: "flex gap-2",
                children: [
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "tls_settings.server_name",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        className: "flex-[2]",
                        children: [
                          Q.jsx(Gy, {
                            className: "text-[12px] font-mono text-foreground/80",
                            children: t("dynamic_form.vmess.tls_settings.server_name.label"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              className: "font-mono text-xs",
                              placeholder: t(
                                "dynamic_form.vmess.tls_settings.server_name.placeholder",
                              ),
                              ...e,
                            }),
                          }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "tls_settings.allow_insecure",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, {
                            className: "text-[12px] font-mono text-foreground/80",
                            children: t("dynamic_form.vmess.tls_settings.allow_insecure"),
                          }),
                          Q.jsx("div", {
                            className: "py-2 text-center",
                            children: Q.jsx(Zy, {
                              children: Q.jsx(mGt, {
                                checked: e.value,
                                onCheckedChange: e.onChange,
                              }),
                            }),
                          }),
                        ],
                      }),
                  }),
                ],
              }),
              Q.jsx("div", { className: "mt-2", children: Q.jsx(w4t, { form: e, t: t }) }),
            ],
          }),
        Q.jsx(Uy, {
          control: e.control,
          name: "network",
          render: ({ field: n }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsxs(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: [
                    t("dynamic_form.vmess.network.label"),
                    Q.jsx(v4t, {
                      value: e.watch("network_settings"),
                      setValue: (t) => e.setValue("network_settings", t),
                      templateType: e.watch("network"),
                    }),
                  ],
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    onValueChange: n.onChange,
                    value: n.value,
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.vmess.network.placeholder"),
                        }),
                      }),
                      Q.jsx(PHt, {
                        children: k4t.networkOptions.map((e) =>
                          Q.jsx(FHt, { value: e.value, children: e.label }, e.value),
                        ),
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
      ],
    });
function N4t(e) {
  throw new Error(
    'Could not dynamically require "' +
      e +
      '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.',
  );
}
var L4t = { exports: {} };
const D4t = i(
  Object.freeze(
    Object.defineProperty({ __proto__: null, default: {} }, Symbol.toStringTag, {
      value: "Module",
    }),
  ),
);
!(function (e) {
  var t = function (e) {
      var t,
        n = new Float64Array(16);
      if (e) for (t = 0; t < e.length; t++) n[t] = e[t];
      return n;
    },
    n = function () {
      throw new Error("no PRNG");
    },
    i = new Uint8Array(16),
    r = new Uint8Array(32);
  r[0] = 9;
  var o = t(),
    s = t([1]),
    a = t([56129, 1]),
    l = t([
      30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119,
      27886, 20995,
    ]),
    c = t([
      61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239,
      55772, 9222,
    ]),
    d = t([
      54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502,
      52590, 14035, 8553,
    ]),
    u = t([
      26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214,
      26214, 26214, 26214,
    ]),
    h = t([
      41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417,
      9344, 11139,
    ]);
  function g(e, t, n, i) {
    ((e[t] = (n >> 24) & 255),
      (e[t + 1] = (n >> 16) & 255),
      (e[t + 2] = (n >> 8) & 255),
      (e[t + 3] = 255 & n),
      (e[t + 4] = (i >> 24) & 255),
      (e[t + 5] = (i >> 16) & 255),
      (e[t + 6] = (i >> 8) & 255),
      (e[t + 7] = 255 & i));
  }
  function p(e, t, n, i, r) {
    var o,
      s = 0;
    for (o = 0; o < r; o++) s |= e[t + o] ^ n[i + o];
    return (1 & ((s - 1) >>> 8)) - 1;
  }
  function f(e, t, n, i) {
    return p(e, t, n, i, 16);
  }
  function m(e, t, n, i) {
    return p(e, t, n, i, 32);
  }
  function _(e, t, n, i) {
    !(function (e, t, n, i) {
      for (
        var r,
          o = (255 & i[0]) | ((255 & i[1]) << 8) | ((255 & i[2]) << 16) | ((255 & i[3]) << 24),
          s = (255 & n[0]) | ((255 & n[1]) << 8) | ((255 & n[2]) << 16) | ((255 & n[3]) << 24),
          a = (255 & n[4]) | ((255 & n[5]) << 8) | ((255 & n[6]) << 16) | ((255 & n[7]) << 24),
          l = (255 & n[8]) | ((255 & n[9]) << 8) | ((255 & n[10]) << 16) | ((255 & n[11]) << 24),
          c = (255 & n[12]) | ((255 & n[13]) << 8) | ((255 & n[14]) << 16) | ((255 & n[15]) << 24),
          d = (255 & i[4]) | ((255 & i[5]) << 8) | ((255 & i[6]) << 16) | ((255 & i[7]) << 24),
          u = (255 & t[0]) | ((255 & t[1]) << 8) | ((255 & t[2]) << 16) | ((255 & t[3]) << 24),
          h = (255 & t[4]) | ((255 & t[5]) << 8) | ((255 & t[6]) << 16) | ((255 & t[7]) << 24),
          g = (255 & t[8]) | ((255 & t[9]) << 8) | ((255 & t[10]) << 16) | ((255 & t[11]) << 24),
          p = (255 & t[12]) | ((255 & t[13]) << 8) | ((255 & t[14]) << 16) | ((255 & t[15]) << 24),
          f = (255 & i[8]) | ((255 & i[9]) << 8) | ((255 & i[10]) << 16) | ((255 & i[11]) << 24),
          m = (255 & n[16]) | ((255 & n[17]) << 8) | ((255 & n[18]) << 16) | ((255 & n[19]) << 24),
          _ = (255 & n[20]) | ((255 & n[21]) << 8) | ((255 & n[22]) << 16) | ((255 & n[23]) << 24),
          v = (255 & n[24]) | ((255 & n[25]) << 8) | ((255 & n[26]) << 16) | ((255 & n[27]) << 24),
          b = (255 & n[28]) | ((255 & n[29]) << 8) | ((255 & n[30]) << 16) | ((255 & n[31]) << 24),
          y = (255 & i[12]) | ((255 & i[13]) << 8) | ((255 & i[14]) << 16) | ((255 & i[15]) << 24),
          x = o,
          w = s,
          C = a,
          S = l,
          k = c,
          E = d,
          N = u,
          L = h,
          D = g,
          T = p,
          I = f,
          R = m,
          O = _,
          M = v,
          A = b,
          P = y,
          j = 0;
        j < 20;
        j += 2
      )
        ((x ^=
          ((r =
            ((O ^=
              ((r =
                ((D ^=
                  ((r = ((k ^= ((r = (x + O) | 0) << 7) | (r >>> 25)) + x) | 0) << 9) |
                  (r >>> 23)) +
                  k) |
                0) <<
                13) |
              (r >>> 19)) +
              D) |
            0) <<
            18) |
          (r >>> 14)),
          (E ^=
            ((r =
              ((w ^=
                ((r =
                  ((M ^=
                    ((r = ((T ^= ((r = (E + w) | 0) << 7) | (r >>> 25)) + E) | 0) << 9) |
                    (r >>> 23)) +
                    T) |
                  0) <<
                  13) |
                (r >>> 19)) +
                M) |
              0) <<
              18) |
            (r >>> 14)),
          (I ^=
            ((r =
              ((N ^=
                ((r =
                  ((C ^=
                    ((r = ((A ^= ((r = (I + N) | 0) << 7) | (r >>> 25)) + I) | 0) << 9) |
                    (r >>> 23)) +
                    A) |
                  0) <<
                  13) |
                (r >>> 19)) +
                C) |
              0) <<
              18) |
            (r >>> 14)),
          (P ^=
            ((r =
              ((R ^=
                ((r =
                  ((L ^=
                    ((r = ((S ^= ((r = (P + R) | 0) << 7) | (r >>> 25)) + P) | 0) << 9) |
                    (r >>> 23)) +
                    S) |
                  0) <<
                  13) |
                (r >>> 19)) +
                L) |
              0) <<
              18) |
            (r >>> 14)),
          (x ^=
            ((r =
              ((S ^=
                ((r =
                  ((C ^=
                    ((r = ((w ^= ((r = (x + S) | 0) << 7) | (r >>> 25)) + x) | 0) << 9) |
                    (r >>> 23)) +
                    w) |
                  0) <<
                  13) |
                (r >>> 19)) +
                C) |
              0) <<
              18) |
            (r >>> 14)),
          (E ^=
            ((r =
              ((k ^=
                ((r =
                  ((L ^=
                    ((r = ((N ^= ((r = (E + k) | 0) << 7) | (r >>> 25)) + E) | 0) << 9) |
                    (r >>> 23)) +
                    N) |
                  0) <<
                  13) |
                (r >>> 19)) +
                L) |
              0) <<
              18) |
            (r >>> 14)),
          (I ^=
            ((r =
              ((T ^=
                ((r =
                  ((D ^=
                    ((r = ((R ^= ((r = (I + T) | 0) << 7) | (r >>> 25)) + I) | 0) << 9) |
                    (r >>> 23)) +
                    R) |
                  0) <<
                  13) |
                (r >>> 19)) +
                D) |
              0) <<
              18) |
            (r >>> 14)),
          (P ^=
            ((r =
              ((A ^=
                ((r =
                  ((M ^=
                    ((r = ((O ^= ((r = (P + A) | 0) << 7) | (r >>> 25)) + P) | 0) << 9) |
                    (r >>> 23)) +
                    O) |
                  0) <<
                  13) |
                (r >>> 19)) +
                M) |
              0) <<
              18) |
            (r >>> 14)));
      ((x = (x + o) | 0),
        (w = (w + s) | 0),
        (C = (C + a) | 0),
        (S = (S + l) | 0),
        (k = (k + c) | 0),
        (E = (E + d) | 0),
        (N = (N + u) | 0),
        (L = (L + h) | 0),
        (D = (D + g) | 0),
        (T = (T + p) | 0),
        (I = (I + f) | 0),
        (R = (R + m) | 0),
        (O = (O + _) | 0),
        (M = (M + v) | 0),
        (A = (A + b) | 0),
        (P = (P + y) | 0),
        (e[0] = (x >>> 0) & 255),
        (e[1] = (x >>> 8) & 255),
        (e[2] = (x >>> 16) & 255),
        (e[3] = (x >>> 24) & 255),
        (e[4] = (w >>> 0) & 255),
        (e[5] = (w >>> 8) & 255),
        (e[6] = (w >>> 16) & 255),
        (e[7] = (w >>> 24) & 255),
        (e[8] = (C >>> 0) & 255),
        (e[9] = (C >>> 8) & 255),
        (e[10] = (C >>> 16) & 255),
        (e[11] = (C >>> 24) & 255),
        (e[12] = (S >>> 0) & 255),
        (e[13] = (S >>> 8) & 255),
        (e[14] = (S >>> 16) & 255),
        (e[15] = (S >>> 24) & 255),
        (e[16] = (k >>> 0) & 255),
        (e[17] = (k >>> 8) & 255),
        (e[18] = (k >>> 16) & 255),
        (e[19] = (k >>> 24) & 255),
        (e[20] = (E >>> 0) & 255),
        (e[21] = (E >>> 8) & 255),
        (e[22] = (E >>> 16) & 255),
        (e[23] = (E >>> 24) & 255),
        (e[24] = (N >>> 0) & 255),
        (e[25] = (N >>> 8) & 255),
        (e[26] = (N >>> 16) & 255),
        (e[27] = (N >>> 24) & 255),
        (e[28] = (L >>> 0) & 255),
        (e[29] = (L >>> 8) & 255),
        (e[30] = (L >>> 16) & 255),
        (e[31] = (L >>> 24) & 255),
        (e[32] = (D >>> 0) & 255),
        (e[33] = (D >>> 8) & 255),
        (e[34] = (D >>> 16) & 255),
        (e[35] = (D >>> 24) & 255),
        (e[36] = (T >>> 0) & 255),
        (e[37] = (T >>> 8) & 255),
        (e[38] = (T >>> 16) & 255),
        (e[39] = (T >>> 24) & 255),
        (e[40] = (I >>> 0) & 255),
        (e[41] = (I >>> 8) & 255),
        (e[42] = (I >>> 16) & 255),
        (e[43] = (I >>> 24) & 255),
        (e[44] = (R >>> 0) & 255),
        (e[45] = (R >>> 8) & 255),
        (e[46] = (R >>> 16) & 255),
        (e[47] = (R >>> 24) & 255),
        (e[48] = (O >>> 0) & 255),
        (e[49] = (O >>> 8) & 255),
        (e[50] = (O >>> 16) & 255),
        (e[51] = (O >>> 24) & 255),
        (e[52] = (M >>> 0) & 255),
        (e[53] = (M >>> 8) & 255),
        (e[54] = (M >>> 16) & 255),
        (e[55] = (M >>> 24) & 255),
        (e[56] = (A >>> 0) & 255),
        (e[57] = (A >>> 8) & 255),
        (e[58] = (A >>> 16) & 255),
        (e[59] = (A >>> 24) & 255),
        (e[60] = (P >>> 0) & 255),
        (e[61] = (P >>> 8) & 255),
        (e[62] = (P >>> 16) & 255),
        (e[63] = (P >>> 24) & 255));
    })(e, t, n, i);
  }
  function v(e, t, n, i) {
    !(function (e, t, n, i) {
      for (
        var r,
          o = (255 & i[0]) | ((255 & i[1]) << 8) | ((255 & i[2]) << 16) | ((255 & i[3]) << 24),
          s = (255 & n[0]) | ((255 & n[1]) << 8) | ((255 & n[2]) << 16) | ((255 & n[3]) << 24),
          a = (255 & n[4]) | ((255 & n[5]) << 8) | ((255 & n[6]) << 16) | ((255 & n[7]) << 24),
          l = (255 & n[8]) | ((255 & n[9]) << 8) | ((255 & n[10]) << 16) | ((255 & n[11]) << 24),
          c = (255 & n[12]) | ((255 & n[13]) << 8) | ((255 & n[14]) << 16) | ((255 & n[15]) << 24),
          d = (255 & i[4]) | ((255 & i[5]) << 8) | ((255 & i[6]) << 16) | ((255 & i[7]) << 24),
          u = (255 & t[0]) | ((255 & t[1]) << 8) | ((255 & t[2]) << 16) | ((255 & t[3]) << 24),
          h = (255 & t[4]) | ((255 & t[5]) << 8) | ((255 & t[6]) << 16) | ((255 & t[7]) << 24),
          g = (255 & t[8]) | ((255 & t[9]) << 8) | ((255 & t[10]) << 16) | ((255 & t[11]) << 24),
          p = (255 & t[12]) | ((255 & t[13]) << 8) | ((255 & t[14]) << 16) | ((255 & t[15]) << 24),
          f = (255 & i[8]) | ((255 & i[9]) << 8) | ((255 & i[10]) << 16) | ((255 & i[11]) << 24),
          m = (255 & n[16]) | ((255 & n[17]) << 8) | ((255 & n[18]) << 16) | ((255 & n[19]) << 24),
          _ = (255 & n[20]) | ((255 & n[21]) << 8) | ((255 & n[22]) << 16) | ((255 & n[23]) << 24),
          v = (255 & n[24]) | ((255 & n[25]) << 8) | ((255 & n[26]) << 16) | ((255 & n[27]) << 24),
          b = (255 & n[28]) | ((255 & n[29]) << 8) | ((255 & n[30]) << 16) | ((255 & n[31]) << 24),
          y = (255 & i[12]) | ((255 & i[13]) << 8) | ((255 & i[14]) << 16) | ((255 & i[15]) << 24),
          x = 0;
        x < 20;
        x += 2
      )
        ((o ^=
          ((r =
            ((_ ^=
              ((r =
                ((g ^=
                  ((r = ((c ^= ((r = (o + _) | 0) << 7) | (r >>> 25)) + o) | 0) << 9) |
                  (r >>> 23)) +
                  c) |
                0) <<
                13) |
              (r >>> 19)) +
              g) |
            0) <<
            18) |
          (r >>> 14)),
          (d ^=
            ((r =
              ((s ^=
                ((r =
                  ((v ^=
                    ((r = ((p ^= ((r = (d + s) | 0) << 7) | (r >>> 25)) + d) | 0) << 9) |
                    (r >>> 23)) +
                    p) |
                  0) <<
                  13) |
                (r >>> 19)) +
                v) |
              0) <<
              18) |
            (r >>> 14)),
          (f ^=
            ((r =
              ((u ^=
                ((r =
                  ((a ^=
                    ((r = ((b ^= ((r = (f + u) | 0) << 7) | (r >>> 25)) + f) | 0) << 9) |
                    (r >>> 23)) +
                    b) |
                  0) <<
                  13) |
                (r >>> 19)) +
                a) |
              0) <<
              18) |
            (r >>> 14)),
          (y ^=
            ((r =
              ((m ^=
                ((r =
                  ((h ^=
                    ((r = ((l ^= ((r = (y + m) | 0) << 7) | (r >>> 25)) + y) | 0) << 9) |
                    (r >>> 23)) +
                    l) |
                  0) <<
                  13) |
                (r >>> 19)) +
                h) |
              0) <<
              18) |
            (r >>> 14)),
          (o ^=
            ((r =
              ((l ^=
                ((r =
                  ((a ^=
                    ((r = ((s ^= ((r = (o + l) | 0) << 7) | (r >>> 25)) + o) | 0) << 9) |
                    (r >>> 23)) +
                    s) |
                  0) <<
                  13) |
                (r >>> 19)) +
                a) |
              0) <<
              18) |
            (r >>> 14)),
          (d ^=
            ((r =
              ((c ^=
                ((r =
                  ((h ^=
                    ((r = ((u ^= ((r = (d + c) | 0) << 7) | (r >>> 25)) + d) | 0) << 9) |
                    (r >>> 23)) +
                    u) |
                  0) <<
                  13) |
                (r >>> 19)) +
                h) |
              0) <<
              18) |
            (r >>> 14)),
          (f ^=
            ((r =
              ((p ^=
                ((r =
                  ((g ^=
                    ((r = ((m ^= ((r = (f + p) | 0) << 7) | (r >>> 25)) + f) | 0) << 9) |
                    (r >>> 23)) +
                    m) |
                  0) <<
                  13) |
                (r >>> 19)) +
                g) |
              0) <<
              18) |
            (r >>> 14)),
          (y ^=
            ((r =
              ((b ^=
                ((r =
                  ((v ^=
                    ((r = ((_ ^= ((r = (y + b) | 0) << 7) | (r >>> 25)) + y) | 0) << 9) |
                    (r >>> 23)) +
                    _) |
                  0) <<
                  13) |
                (r >>> 19)) +
                v) |
              0) <<
              18) |
            (r >>> 14)));
      ((e[0] = (o >>> 0) & 255),
        (e[1] = (o >>> 8) & 255),
        (e[2] = (o >>> 16) & 255),
        (e[3] = (o >>> 24) & 255),
        (e[4] = (d >>> 0) & 255),
        (e[5] = (d >>> 8) & 255),
        (e[6] = (d >>> 16) & 255),
        (e[7] = (d >>> 24) & 255),
        (e[8] = (f >>> 0) & 255),
        (e[9] = (f >>> 8) & 255),
        (e[10] = (f >>> 16) & 255),
        (e[11] = (f >>> 24) & 255),
        (e[12] = (y >>> 0) & 255),
        (e[13] = (y >>> 8) & 255),
        (e[14] = (y >>> 16) & 255),
        (e[15] = (y >>> 24) & 255),
        (e[16] = (u >>> 0) & 255),
        (e[17] = (u >>> 8) & 255),
        (e[18] = (u >>> 16) & 255),
        (e[19] = (u >>> 24) & 255),
        (e[20] = (h >>> 0) & 255),
        (e[21] = (h >>> 8) & 255),
        (e[22] = (h >>> 16) & 255),
        (e[23] = (h >>> 24) & 255),
        (e[24] = (g >>> 0) & 255),
        (e[25] = (g >>> 8) & 255),
        (e[26] = (g >>> 16) & 255),
        (e[27] = (g >>> 24) & 255),
        (e[28] = (p >>> 0) & 255),
        (e[29] = (p >>> 8) & 255),
        (e[30] = (p >>> 16) & 255),
        (e[31] = (p >>> 24) & 255));
    })(e, t, n, i);
  }
  var b = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
  function y(e, t, n, i, r, o, s) {
    var a,
      l,
      c = new Uint8Array(16),
      d = new Uint8Array(64);
    for (l = 0; l < 16; l++) c[l] = 0;
    for (l = 0; l < 8; l++) c[l] = o[l];
    for (; r >= 64; ) {
      for (_(d, c, s, b), l = 0; l < 64; l++) e[t + l] = n[i + l] ^ d[l];
      for (a = 1, l = 8; l < 16; l++) ((a = (a + (255 & c[l])) | 0), (c[l] = 255 & a), (a >>>= 8));
      ((r -= 64), (t += 64), (i += 64));
    }
    if (r > 0) for (_(d, c, s, b), l = 0; l < r; l++) e[t + l] = n[i + l] ^ d[l];
    return 0;
  }
  function x(e, t, n, i, r) {
    var o,
      s,
      a = new Uint8Array(16),
      l = new Uint8Array(64);
    for (s = 0; s < 16; s++) a[s] = 0;
    for (s = 0; s < 8; s++) a[s] = i[s];
    for (; n >= 64; ) {
      for (_(l, a, r, b), s = 0; s < 64; s++) e[t + s] = l[s];
      for (o = 1, s = 8; s < 16; s++) ((o = (o + (255 & a[s])) | 0), (a[s] = 255 & o), (o >>>= 8));
      ((n -= 64), (t += 64));
    }
    if (n > 0) for (_(l, a, r, b), s = 0; s < n; s++) e[t + s] = l[s];
    return 0;
  }
  function w(e, t, n, i, r) {
    var o = new Uint8Array(32);
    v(o, i, r, b);
    for (var s = new Uint8Array(8), a = 0; a < 8; a++) s[a] = i[a + 16];
    return x(e, t, n, s, o);
  }
  function C(e, t, n, i, r, o, s) {
    var a = new Uint8Array(32);
    v(a, o, s, b);
    for (var l = new Uint8Array(8), c = 0; c < 8; c++) l[c] = o[c + 16];
    return y(e, t, n, i, r, l, a);
  }
  var S = function (e) {
    var t, n, i, r, o, s, a, l;
    ((this.buffer = new Uint8Array(16)),
      (this.r = new Uint16Array(10)),
      (this.h = new Uint16Array(10)),
      (this.pad = new Uint16Array(8)),
      (this.leftover = 0),
      (this.fin = 0),
      (t = (255 & e[0]) | ((255 & e[1]) << 8)),
      (this.r[0] = 8191 & t),
      (n = (255 & e[2]) | ((255 & e[3]) << 8)),
      (this.r[1] = 8191 & ((t >>> 13) | (n << 3))),
      (i = (255 & e[4]) | ((255 & e[5]) << 8)),
      (this.r[2] = 7939 & ((n >>> 10) | (i << 6))),
      (r = (255 & e[6]) | ((255 & e[7]) << 8)),
      (this.r[3] = 8191 & ((i >>> 7) | (r << 9))),
      (o = (255 & e[8]) | ((255 & e[9]) << 8)),
      (this.r[4] = 255 & ((r >>> 4) | (o << 12))),
      (this.r[5] = (o >>> 1) & 8190),
      (s = (255 & e[10]) | ((255 & e[11]) << 8)),
      (this.r[6] = 8191 & ((o >>> 14) | (s << 2))),
      (a = (255 & e[12]) | ((255 & e[13]) << 8)),
      (this.r[7] = 8065 & ((s >>> 11) | (a << 5))),
      (l = (255 & e[14]) | ((255 & e[15]) << 8)),
      (this.r[8] = 8191 & ((a >>> 8) | (l << 8))),
      (this.r[9] = (l >>> 5) & 127),
      (this.pad[0] = (255 & e[16]) | ((255 & e[17]) << 8)),
      (this.pad[1] = (255 & e[18]) | ((255 & e[19]) << 8)),
      (this.pad[2] = (255 & e[20]) | ((255 & e[21]) << 8)),
      (this.pad[3] = (255 & e[22]) | ((255 & e[23]) << 8)),
      (this.pad[4] = (255 & e[24]) | ((255 & e[25]) << 8)),
      (this.pad[5] = (255 & e[26]) | ((255 & e[27]) << 8)),
      (this.pad[6] = (255 & e[28]) | ((255 & e[29]) << 8)),
      (this.pad[7] = (255 & e[30]) | ((255 & e[31]) << 8)));
  };
  function k(e, t, n, i, r, o) {
    var s = new S(o);
    return (s.update(n, i, r), s.finish(e, t), 0);
  }
  function E(e, t, n, i, r, o) {
    var s = new Uint8Array(16);
    return (k(s, 0, n, i, r, o), f(e, t, s, 0));
  }
  function N(e, t, n, i, r) {
    var o;
    if (n < 32) return -1;
    for (C(e, 0, t, 0, n, i, r), k(e, 16, e, 32, n - 32, e), o = 0; o < 16; o++) e[o] = 0;
    return 0;
  }
  function L(e, t, n, i, r) {
    var o,
      s = new Uint8Array(32);
    if (n < 32) return -1;
    if ((w(s, 0, 32, i, r), 0 !== E(t, 16, t, 32, n - 32, s))) return -1;
    for (C(e, 0, t, 0, n, i, r), o = 0; o < 32; o++) e[o] = 0;
    return 0;
  }
  function D(e, t) {
    var n;
    for (n = 0; n < 16; n++) e[n] = 0 | t[n];
  }
  function T(e) {
    var t,
      n,
      i = 1;
    for (t = 0; t < 16; t++)
      ((n = e[t] + i + 65535), (i = Math.floor(n / 65536)), (e[t] = n - 65536 * i));
    e[0] += i - 1 + 37 * (i - 1);
  }
  function I(e, t, n) {
    for (var i, r = ~(n - 1), o = 0; o < 16; o++)
      ((i = r & (e[o] ^ t[o])), (e[o] ^= i), (t[o] ^= i));
  }
  function R(e, n) {
    var i,
      r,
      o,
      s = t(),
      a = t();
    for (i = 0; i < 16; i++) a[i] = n[i];
    for (T(a), T(a), T(a), r = 0; r < 2; r++) {
      for (s[0] = a[0] - 65517, i = 1; i < 15; i++)
        ((s[i] = a[i] - 65535 - ((s[i - 1] >> 16) & 1)), (s[i - 1] &= 65535));
      ((s[15] = a[15] - 32767 - ((s[14] >> 16) & 1)),
        (o = (s[15] >> 16) & 1),
        (s[14] &= 65535),
        I(a, s, 1 - o));
    }
    for (i = 0; i < 16; i++) ((e[2 * i] = 255 & a[i]), (e[2 * i + 1] = a[i] >> 8));
  }
  function O(e, t) {
    var n = new Uint8Array(32),
      i = new Uint8Array(32);
    return (R(n, e), R(i, t), m(n, 0, i, 0));
  }
  function M(e) {
    var t = new Uint8Array(32);
    return (R(t, e), 1 & t[0]);
  }
  function A(e, t) {
    var n;
    for (n = 0; n < 16; n++) e[n] = t[2 * n] + (t[2 * n + 1] << 8);
    e[15] &= 32767;
  }
  function P(e, t, n) {
    for (var i = 0; i < 16; i++) e[i] = t[i] + n[i];
  }
  function j(e, t, n) {
    for (var i = 0; i < 16; i++) e[i] = t[i] - n[i];
  }
  function F(e, t, n) {
    var i,
      r,
      o = 0,
      s = 0,
      a = 0,
      l = 0,
      c = 0,
      d = 0,
      u = 0,
      h = 0,
      g = 0,
      p = 0,
      f = 0,
      m = 0,
      _ = 0,
      v = 0,
      b = 0,
      y = 0,
      x = 0,
      w = 0,
      C = 0,
      S = 0,
      k = 0,
      E = 0,
      N = 0,
      L = 0,
      D = 0,
      T = 0,
      I = 0,
      R = 0,
      O = 0,
      M = 0,
      A = 0,
      P = n[0],
      j = n[1],
      F = n[2],
      B = n[3],
      V = n[4],
      W = n[5],
      H = n[6],
      z = n[7],
      U = n[8],
      $ = n[9],
      q = n[10],
      K = n[11],
      G = n[12],
      Z = n[13],
      Y = n[14],
      X = n[15];
    ((o += (i = t[0]) * P),
      (s += i * j),
      (a += i * F),
      (l += i * B),
      (c += i * V),
      (d += i * W),
      (u += i * H),
      (h += i * z),
      (g += i * U),
      (p += i * $),
      (f += i * q),
      (m += i * K),
      (_ += i * G),
      (v += i * Z),
      (b += i * Y),
      (y += i * X),
      (s += (i = t[1]) * P),
      (a += i * j),
      (l += i * F),
      (c += i * B),
      (d += i * V),
      (u += i * W),
      (h += i * H),
      (g += i * z),
      (p += i * U),
      (f += i * $),
      (m += i * q),
      (_ += i * K),
      (v += i * G),
      (b += i * Z),
      (y += i * Y),
      (x += i * X),
      (a += (i = t[2]) * P),
      (l += i * j),
      (c += i * F),
      (d += i * B),
      (u += i * V),
      (h += i * W),
      (g += i * H),
      (p += i * z),
      (f += i * U),
      (m += i * $),
      (_ += i * q),
      (v += i * K),
      (b += i * G),
      (y += i * Z),
      (x += i * Y),
      (w += i * X),
      (l += (i = t[3]) * P),
      (c += i * j),
      (d += i * F),
      (u += i * B),
      (h += i * V),
      (g += i * W),
      (p += i * H),
      (f += i * z),
      (m += i * U),
      (_ += i * $),
      (v += i * q),
      (b += i * K),
      (y += i * G),
      (x += i * Z),
      (w += i * Y),
      (C += i * X),
      (c += (i = t[4]) * P),
      (d += i * j),
      (u += i * F),
      (h += i * B),
      (g += i * V),
      (p += i * W),
      (f += i * H),
      (m += i * z),
      (_ += i * U),
      (v += i * $),
      (b += i * q),
      (y += i * K),
      (x += i * G),
      (w += i * Z),
      (C += i * Y),
      (S += i * X),
      (d += (i = t[5]) * P),
      (u += i * j),
      (h += i * F),
      (g += i * B),
      (p += i * V),
      (f += i * W),
      (m += i * H),
      (_ += i * z),
      (v += i * U),
      (b += i * $),
      (y += i * q),
      (x += i * K),
      (w += i * G),
      (C += i * Z),
      (S += i * Y),
      (k += i * X),
      (u += (i = t[6]) * P),
      (h += i * j),
      (g += i * F),
      (p += i * B),
      (f += i * V),
      (m += i * W),
      (_ += i * H),
      (v += i * z),
      (b += i * U),
      (y += i * $),
      (x += i * q),
      (w += i * K),
      (C += i * G),
      (S += i * Z),
      (k += i * Y),
      (E += i * X),
      (h += (i = t[7]) * P),
      (g += i * j),
      (p += i * F),
      (f += i * B),
      (m += i * V),
      (_ += i * W),
      (v += i * H),
      (b += i * z),
      (y += i * U),
      (x += i * $),
      (w += i * q),
      (C += i * K),
      (S += i * G),
      (k += i * Z),
      (E += i * Y),
      (N += i * X),
      (g += (i = t[8]) * P),
      (p += i * j),
      (f += i * F),
      (m += i * B),
      (_ += i * V),
      (v += i * W),
      (b += i * H),
      (y += i * z),
      (x += i * U),
      (w += i * $),
      (C += i * q),
      (S += i * K),
      (k += i * G),
      (E += i * Z),
      (N += i * Y),
      (L += i * X),
      (p += (i = t[9]) * P),
      (f += i * j),
      (m += i * F),
      (_ += i * B),
      (v += i * V),
      (b += i * W),
      (y += i * H),
      (x += i * z),
      (w += i * U),
      (C += i * $),
      (S += i * q),
      (k += i * K),
      (E += i * G),
      (N += i * Z),
      (L += i * Y),
      (D += i * X),
      (f += (i = t[10]) * P),
      (m += i * j),
      (_ += i * F),
      (v += i * B),
      (b += i * V),
      (y += i * W),
      (x += i * H),
      (w += i * z),
      (C += i * U),
      (S += i * $),
      (k += i * q),
      (E += i * K),
      (N += i * G),
      (L += i * Z),
      (D += i * Y),
      (T += i * X),
      (m += (i = t[11]) * P),
      (_ += i * j),
      (v += i * F),
      (b += i * B),
      (y += i * V),
      (x += i * W),
      (w += i * H),
      (C += i * z),
      (S += i * U),
      (k += i * $),
      (E += i * q),
      (N += i * K),
      (L += i * G),
      (D += i * Z),
      (T += i * Y),
      (I += i * X),
      (_ += (i = t[12]) * P),
      (v += i * j),
      (b += i * F),
      (y += i * B),
      (x += i * V),
      (w += i * W),
      (C += i * H),
      (S += i * z),
      (k += i * U),
      (E += i * $),
      (N += i * q),
      (L += i * K),
      (D += i * G),
      (T += i * Z),
      (I += i * Y),
      (R += i * X),
      (v += (i = t[13]) * P),
      (b += i * j),
      (y += i * F),
      (x += i * B),
      (w += i * V),
      (C += i * W),
      (S += i * H),
      (k += i * z),
      (E += i * U),
      (N += i * $),
      (L += i * q),
      (D += i * K),
      (T += i * G),
      (I += i * Z),
      (R += i * Y),
      (O += i * X),
      (b += (i = t[14]) * P),
      (y += i * j),
      (x += i * F),
      (w += i * B),
      (C += i * V),
      (S += i * W),
      (k += i * H),
      (E += i * z),
      (N += i * U),
      (L += i * $),
      (D += i * q),
      (T += i * K),
      (I += i * G),
      (R += i * Z),
      (O += i * Y),
      (M += i * X),
      (y += (i = t[15]) * P),
      (s += 38 * (w += i * F)),
      (a += 38 * (C += i * B)),
      (l += 38 * (S += i * V)),
      (c += 38 * (k += i * W)),
      (d += 38 * (E += i * H)),
      (u += 38 * (N += i * z)),
      (h += 38 * (L += i * U)),
      (g += 38 * (D += i * $)),
      (p += 38 * (T += i * q)),
      (f += 38 * (I += i * K)),
      (m += 38 * (R += i * G)),
      (_ += 38 * (O += i * Z)),
      (v += 38 * (M += i * Y)),
      (b += 38 * (A += i * X)),
      (o = (i = (o += 38 * (x += i * j)) + (r = 1) + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (s = (i = s + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (a = (i = a + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (l = (i = l + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (c = (i = c + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (d = (i = d + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (u = (i = u + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (h = (i = h + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (g = (i = g + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (p = (i = p + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (f = (i = f + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (m = (i = m + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (_ = (i = _ + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (v = (i = v + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (b = (i = b + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (y = (i = y + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (o =
        (i = (o += r - 1 + 37 * (r - 1)) + (r = 1) + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (s = (i = s + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (a = (i = a + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (l = (i = l + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (c = (i = c + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (d = (i = d + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (u = (i = u + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (h = (i = h + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (g = (i = g + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (p = (i = p + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (f = (i = f + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (m = (i = m + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (_ = (i = _ + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (v = (i = v + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (b = (i = b + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (y = (i = y + r + 65535) - 65536 * (r = Math.floor(i / 65536))),
      (o += r - 1 + 37 * (r - 1)),
      (e[0] = o),
      (e[1] = s),
      (e[2] = a),
      (e[3] = l),
      (e[4] = c),
      (e[5] = d),
      (e[6] = u),
      (e[7] = h),
      (e[8] = g),
      (e[9] = p),
      (e[10] = f),
      (e[11] = m),
      (e[12] = _),
      (e[13] = v),
      (e[14] = b),
      (e[15] = y));
  }
  function B(e, t) {
    F(e, t, t);
  }
  function V(e, n) {
    var i,
      r = t();
    for (i = 0; i < 16; i++) r[i] = n[i];
    for (i = 253; i >= 0; i--) (B(r, r), 2 !== i && 4 !== i && F(r, r, n));
    for (i = 0; i < 16; i++) e[i] = r[i];
  }
  function W(e, n) {
    var i,
      r = t();
    for (i = 0; i < 16; i++) r[i] = n[i];
    for (i = 250; i >= 0; i--) (B(r, r), 1 !== i && F(r, r, n));
    for (i = 0; i < 16; i++) e[i] = r[i];
  }
  function H(e, n, i) {
    var r,
      o,
      s = new Uint8Array(32),
      l = new Float64Array(80),
      c = t(),
      d = t(),
      u = t(),
      h = t(),
      g = t(),
      p = t();
    for (o = 0; o < 31; o++) s[o] = n[o];
    for (s[31] = (127 & n[31]) | 64, s[0] &= 248, A(l, i), o = 0; o < 16; o++)
      ((d[o] = l[o]), (h[o] = c[o] = u[o] = 0));
    for (c[0] = h[0] = 1, o = 254; o >= 0; --o)
      (I(c, d, (r = (s[o >>> 3] >>> (7 & o)) & 1)),
        I(u, h, r),
        P(g, c, u),
        j(c, c, u),
        P(u, d, h),
        j(d, d, h),
        B(h, g),
        B(p, c),
        F(c, u, c),
        F(u, d, g),
        P(g, c, u),
        j(c, c, u),
        B(d, c),
        j(u, h, p),
        F(c, u, a),
        P(c, c, h),
        F(u, u, c),
        F(c, h, p),
        F(h, d, l),
        B(d, g),
        I(c, d, r),
        I(u, h, r));
    for (o = 0; o < 16; o++)
      ((l[o + 16] = c[o]), (l[o + 32] = u[o]), (l[o + 48] = d[o]), (l[o + 64] = h[o]));
    var f = l.subarray(32),
      m = l.subarray(16);
    return (V(f, f), F(m, m, f), R(e, m), 0);
  }
  function z(e, t) {
    return H(e, t, r);
  }
  function U(e, t) {
    return (n(t, 32), z(e, t));
  }
  function $(e, t, n) {
    var r = new Uint8Array(32);
    return (H(r, n, t), v(e, i, r, b));
  }
  ((S.prototype.blocks = function (e, t, n) {
    for (
      var i,
        r,
        o,
        s,
        a,
        l,
        c,
        d,
        u,
        h,
        g,
        p,
        f,
        m,
        _,
        v,
        b,
        y,
        x,
        w = this.fin ? 0 : 2048,
        C = this.h[0],
        S = this.h[1],
        k = this.h[2],
        E = this.h[3],
        N = this.h[4],
        L = this.h[5],
        D = this.h[6],
        T = this.h[7],
        I = this.h[8],
        R = this.h[9],
        O = this.r[0],
        M = this.r[1],
        A = this.r[2],
        P = this.r[3],
        j = this.r[4],
        F = this.r[5],
        B = this.r[6],
        V = this.r[7],
        W = this.r[8],
        H = this.r[9];
      n >= 16;
    )
      ((h = u = 0),
        (h += (C += 8191 & (i = (255 & e[t + 0]) | ((255 & e[t + 1]) << 8))) * O),
        (h +=
          (S += 8191 & ((i >>> 13) | ((r = (255 & e[t + 2]) | ((255 & e[t + 3]) << 8)) << 3))) *
          (5 * H)),
        (h +=
          (k += 8191 & ((r >>> 10) | ((o = (255 & e[t + 4]) | ((255 & e[t + 5]) << 8)) << 6))) *
          (5 * W)),
        (h +=
          (E += 8191 & ((o >>> 7) | ((s = (255 & e[t + 6]) | ((255 & e[t + 7]) << 8)) << 9))) *
          (5 * V)),
        (u =
          (h +=
            (N += 8191 & ((s >>> 4) | ((a = (255 & e[t + 8]) | ((255 & e[t + 9]) << 8)) << 12))) *
            (5 * B)) >>> 13),
        (h &= 8191),
        (h += (L += (a >>> 1) & 8191) * (5 * F)),
        (h +=
          (D += 8191 & ((a >>> 14) | ((l = (255 & e[t + 10]) | ((255 & e[t + 11]) << 8)) << 2))) *
          (5 * j)),
        (h +=
          (T += 8191 & ((l >>> 11) | ((c = (255 & e[t + 12]) | ((255 & e[t + 13]) << 8)) << 5))) *
          (5 * P)),
        (h +=
          (I += 8191 & ((c >>> 8) | ((d = (255 & e[t + 14]) | ((255 & e[t + 15]) << 8)) << 8))) *
          (5 * A)),
        (g = u += (h += (R += (d >>> 5) | w) * (5 * M)) >>> 13),
        (g += C * M),
        (g += S * O),
        (g += k * (5 * H)),
        (g += E * (5 * W)),
        (u = (g += N * (5 * V)) >>> 13),
        (g &= 8191),
        (g += L * (5 * B)),
        (g += D * (5 * F)),
        (g += T * (5 * j)),
        (g += I * (5 * P)),
        (u += (g += R * (5 * A)) >>> 13),
        (g &= 8191),
        (p = u),
        (p += C * A),
        (p += S * M),
        (p += k * O),
        (p += E * (5 * H)),
        (u = (p += N * (5 * W)) >>> 13),
        (p &= 8191),
        (p += L * (5 * V)),
        (p += D * (5 * B)),
        (p += T * (5 * F)),
        (p += I * (5 * j)),
        (f = u += (p += R * (5 * P)) >>> 13),
        (f += C * P),
        (f += S * A),
        (f += k * M),
        (f += E * O),
        (u = (f += N * (5 * H)) >>> 13),
        (f &= 8191),
        (f += L * (5 * W)),
        (f += D * (5 * V)),
        (f += T * (5 * B)),
        (f += I * (5 * F)),
        (m = u += (f += R * (5 * j)) >>> 13),
        (m += C * j),
        (m += S * P),
        (m += k * A),
        (m += E * M),
        (u = (m += N * O) >>> 13),
        (m &= 8191),
        (m += L * (5 * H)),
        (m += D * (5 * W)),
        (m += T * (5 * V)),
        (m += I * (5 * B)),
        (_ = u += (m += R * (5 * F)) >>> 13),
        (_ += C * F),
        (_ += S * j),
        (_ += k * P),
        (_ += E * A),
        (u = (_ += N * M) >>> 13),
        (_ &= 8191),
        (_ += L * O),
        (_ += D * (5 * H)),
        (_ += T * (5 * W)),
        (_ += I * (5 * V)),
        (v = u += (_ += R * (5 * B)) >>> 13),
        (v += C * B),
        (v += S * F),
        (v += k * j),
        (v += E * P),
        (u = (v += N * A) >>> 13),
        (v &= 8191),
        (v += L * M),
        (v += D * O),
        (v += T * (5 * H)),
        (v += I * (5 * W)),
        (b = u += (v += R * (5 * V)) >>> 13),
        (b += C * V),
        (b += S * B),
        (b += k * F),
        (b += E * j),
        (u = (b += N * P) >>> 13),
        (b &= 8191),
        (b += L * A),
        (b += D * M),
        (b += T * O),
        (b += I * (5 * H)),
        (y = u += (b += R * (5 * W)) >>> 13),
        (y += C * W),
        (y += S * V),
        (y += k * B),
        (y += E * F),
        (u = (y += N * j) >>> 13),
        (y &= 8191),
        (y += L * P),
        (y += D * A),
        (y += T * M),
        (y += I * O),
        (x = u += (y += R * (5 * H)) >>> 13),
        (x += C * H),
        (x += S * W),
        (x += k * V),
        (x += E * B),
        (u = (x += N * F) >>> 13),
        (x &= 8191),
        (x += L * j),
        (x += D * P),
        (x += T * A),
        (x += I * M),
        (C = h =
          8191 & (u = ((u = (((u += (x += R * O) >>> 13) << 2) + u) | 0) + (h &= 8191)) | 0)),
        (S = g += u >>>= 13),
        (k = p &= 8191),
        (E = f &= 8191),
        (N = m &= 8191),
        (L = _ &= 8191),
        (D = v &= 8191),
        (T = b &= 8191),
        (I = y &= 8191),
        (R = x &= 8191),
        (t += 16),
        (n -= 16));
    ((this.h[0] = C),
      (this.h[1] = S),
      (this.h[2] = k),
      (this.h[3] = E),
      (this.h[4] = N),
      (this.h[5] = L),
      (this.h[6] = D),
      (this.h[7] = T),
      (this.h[8] = I),
      (this.h[9] = R));
  }),
    (S.prototype.finish = function (e, t) {
      var n,
        i,
        r,
        o,
        s = new Uint16Array(10);
      if (this.leftover) {
        for (o = this.leftover, this.buffer[o++] = 1; o < 16; o++) this.buffer[o] = 0;
        ((this.fin = 1), this.blocks(this.buffer, 0, 16));
      }
      for (n = this.h[1] >>> 13, this.h[1] &= 8191, o = 2; o < 10; o++)
        ((this.h[o] += n), (n = this.h[o] >>> 13), (this.h[o] &= 8191));
      for (
        this.h[0] += 5 * n,
          n = this.h[0] >>> 13,
          this.h[0] &= 8191,
          this.h[1] += n,
          n = this.h[1] >>> 13,
          this.h[1] &= 8191,
          this.h[2] += n,
          s[0] = this.h[0] + 5,
          n = s[0] >>> 13,
          s[0] &= 8191,
          o = 1;
        o < 10;
        o++
      )
        ((s[o] = this.h[o] + n), (n = s[o] >>> 13), (s[o] &= 8191));
      for (s[9] -= 8192, i = (1 ^ n) - 1, o = 0; o < 10; o++) s[o] &= i;
      for (i = ~i, o = 0; o < 10; o++) this.h[o] = (this.h[o] & i) | s[o];
      for (
        this.h[0] = 65535 & (this.h[0] | (this.h[1] << 13)),
          this.h[1] = 65535 & ((this.h[1] >>> 3) | (this.h[2] << 10)),
          this.h[2] = 65535 & ((this.h[2] >>> 6) | (this.h[3] << 7)),
          this.h[3] = 65535 & ((this.h[3] >>> 9) | (this.h[4] << 4)),
          this.h[4] = 65535 & ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)),
          this.h[5] = 65535 & ((this.h[6] >>> 2) | (this.h[7] << 11)),
          this.h[6] = 65535 & ((this.h[7] >>> 5) | (this.h[8] << 8)),
          this.h[7] = 65535 & ((this.h[8] >>> 8) | (this.h[9] << 5)),
          r = this.h[0] + this.pad[0],
          this.h[0] = 65535 & r,
          o = 1;
        o < 8;
        o++
      )
        ((r = (((this.h[o] + this.pad[o]) | 0) + (r >>> 16)) | 0), (this.h[o] = 65535 & r));
      ((e[t + 0] = (this.h[0] >>> 0) & 255),
        (e[t + 1] = (this.h[0] >>> 8) & 255),
        (e[t + 2] = (this.h[1] >>> 0) & 255),
        (e[t + 3] = (this.h[1] >>> 8) & 255),
        (e[t + 4] = (this.h[2] >>> 0) & 255),
        (e[t + 5] = (this.h[2] >>> 8) & 255),
        (e[t + 6] = (this.h[3] >>> 0) & 255),
        (e[t + 7] = (this.h[3] >>> 8) & 255),
        (e[t + 8] = (this.h[4] >>> 0) & 255),
        (e[t + 9] = (this.h[4] >>> 8) & 255),
        (e[t + 10] = (this.h[5] >>> 0) & 255),
        (e[t + 11] = (this.h[5] >>> 8) & 255),
        (e[t + 12] = (this.h[6] >>> 0) & 255),
        (e[t + 13] = (this.h[6] >>> 8) & 255),
        (e[t + 14] = (this.h[7] >>> 0) & 255),
        (e[t + 15] = (this.h[7] >>> 8) & 255));
    }),
    (S.prototype.update = function (e, t, n) {
      var i, r;
      if (this.leftover) {
        for ((r = 16 - this.leftover) > n && (r = n), i = 0; i < r; i++)
          this.buffer[this.leftover + i] = e[t + i];
        if (((n -= r), (t += r), (this.leftover += r), this.leftover < 16)) return;
        (this.blocks(this.buffer, 0, 16), (this.leftover = 0));
      }
      if ((n >= 16 && ((r = n - (n % 16)), this.blocks(e, t, r), (t += r), (n -= r)), n)) {
        for (i = 0; i < n; i++) this.buffer[this.leftover + i] = e[t + i];
        this.leftover += n;
      }
    }));
  var q = N,
    K = L,
    G = [
      1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548,
      961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560,
      3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994,
      1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868,
      3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933,
      770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837,
      2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956,
      3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936,
      666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823,
      1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627,
      2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008,
      3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720,
      430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280,
      958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899,
      1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044,
      2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427,
      3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992,
      116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315,
      685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676,
      1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591,
    ];
  function Z(e, t, n, i) {
    for (
      var r,
        o,
        s,
        a,
        l,
        c,
        d,
        u,
        h,
        g,
        p,
        f,
        m,
        _,
        v,
        b,
        y,
        x,
        w,
        C,
        S,
        k,
        E,
        N,
        L,
        D,
        T = new Int32Array(16),
        I = new Int32Array(16),
        R = e[0],
        O = e[1],
        M = e[2],
        A = e[3],
        P = e[4],
        j = e[5],
        F = e[6],
        B = e[7],
        V = t[0],
        W = t[1],
        H = t[2],
        z = t[3],
        U = t[4],
        $ = t[5],
        q = t[6],
        K = t[7],
        Z = 0;
      i >= 128;
    ) {
      for (w = 0; w < 16; w++)
        ((C = 8 * w + Z),
          (T[w] = (n[C + 0] << 24) | (n[C + 1] << 16) | (n[C + 2] << 8) | n[C + 3]),
          (I[w] = (n[C + 4] << 24) | (n[C + 5] << 16) | (n[C + 6] << 8) | n[C + 7]));
      for (w = 0; w < 80; w++)
        if (
          ((r = R),
          (o = O),
          (s = M),
          (a = A),
          (l = P),
          (c = j),
          (d = F),
          (h = V),
          (g = W),
          (p = H),
          (f = z),
          (m = U),
          (_ = $),
          (v = q),
          (E = 65535 & (k = K)),
          (N = k >>> 16),
          (L = 65535 & (S = B)),
          (D = S >>> 16),
          (E +=
            65535 &
            (k = ((U >>> 14) | (P << 18)) ^ ((U >>> 18) | (P << 14)) ^ ((P >>> 9) | (U << 23)))),
          (N += k >>> 16),
          (L +=
            65535 &
            (S = ((P >>> 14) | (U << 18)) ^ ((P >>> 18) | (U << 14)) ^ ((U >>> 9) | (P << 23)))),
          (D += S >>> 16),
          (E += 65535 & (k = (U & $) ^ (~U & q))),
          (N += k >>> 16),
          (L += 65535 & (S = (P & j) ^ (~P & F))),
          (D += S >>> 16),
          (E += 65535 & (k = G[2 * w + 1])),
          (N += k >>> 16),
          (L += 65535 & (S = G[2 * w])),
          (D += S >>> 16),
          (S = T[w % 16]),
          (N += (k = I[w % 16]) >>> 16),
          (L += 65535 & S),
          (D += S >>> 16),
          (L += (N += (E += 65535 & k) >>> 16) >>> 16),
          (E = 65535 & (k = x = (65535 & E) | (N << 16))),
          (N = k >>> 16),
          (L = 65535 & (S = y = (65535 & L) | ((D += L >>> 16) << 16))),
          (D = S >>> 16),
          (E +=
            65535 &
            (k = ((V >>> 28) | (R << 4)) ^ ((R >>> 2) | (V << 30)) ^ ((R >>> 7) | (V << 25)))),
          (N += k >>> 16),
          (L +=
            65535 &
            (S = ((R >>> 28) | (V << 4)) ^ ((V >>> 2) | (R << 30)) ^ ((V >>> 7) | (R << 25)))),
          (D += S >>> 16),
          (N += (k = (V & W) ^ (V & H) ^ (W & H)) >>> 16),
          (L += 65535 & (S = (R & O) ^ (R & M) ^ (O & M))),
          (D += S >>> 16),
          (u = (65535 & (L += (N += (E += 65535 & k) >>> 16) >>> 16)) | ((D += L >>> 16) << 16)),
          (b = (65535 & E) | (N << 16)),
          (E = 65535 & (k = f)),
          (N = k >>> 16),
          (L = 65535 & (S = a)),
          (D = S >>> 16),
          (N += (k = x) >>> 16),
          (L += 65535 & (S = y)),
          (D += S >>> 16),
          (O = r),
          (M = o),
          (A = s),
          (P = a =
            (65535 & (L += (N += (E += 65535 & k) >>> 16) >>> 16)) | ((D += L >>> 16) << 16)),
          (j = l),
          (F = c),
          (B = d),
          (R = u),
          (W = h),
          (H = g),
          (z = p),
          (U = f = (65535 & E) | (N << 16)),
          ($ = m),
          (q = _),
          (K = v),
          (V = b),
          w % 16 == 15)
        )
          for (C = 0; C < 16; C++)
            ((S = T[C]),
              (E = 65535 & (k = I[C])),
              (N = k >>> 16),
              (L = 65535 & S),
              (D = S >>> 16),
              (S = T[(C + 9) % 16]),
              (E += 65535 & (k = I[(C + 9) % 16])),
              (N += k >>> 16),
              (L += 65535 & S),
              (D += S >>> 16),
              (y = T[(C + 1) % 16]),
              (E +=
                65535 &
                (k =
                  (((x = I[(C + 1) % 16]) >>> 1) | (y << 31)) ^
                  ((x >>> 8) | (y << 24)) ^
                  ((x >>> 7) | (y << 25)))),
              (N += k >>> 16),
              (L += 65535 & (S = ((y >>> 1) | (x << 31)) ^ ((y >>> 8) | (x << 24)) ^ (y >>> 7))),
              (D += S >>> 16),
              (y = T[(C + 14) % 16]),
              (N +=
                (k =
                  (((x = I[(C + 14) % 16]) >>> 19) | (y << 13)) ^
                  ((y >>> 29) | (x << 3)) ^
                  ((x >>> 6) | (y << 26))) >>> 16),
              (L += 65535 & (S = ((y >>> 19) | (x << 13)) ^ ((x >>> 29) | (y << 3)) ^ (y >>> 6))),
              (D += S >>> 16),
              (D += (L += (N += (E += 65535 & k) >>> 16) >>> 16) >>> 16),
              (T[C] = (65535 & L) | (D << 16)),
              (I[C] = (65535 & E) | (N << 16)));
      ((E = 65535 & (k = V)),
        (N = k >>> 16),
        (L = 65535 & (S = R)),
        (D = S >>> 16),
        (S = e[0]),
        (N += (k = t[0]) >>> 16),
        (L += 65535 & S),
        (D += S >>> 16),
        (D += (L += (N += (E += 65535 & k) >>> 16) >>> 16) >>> 16),
        (e[0] = R = (65535 & L) | (D << 16)),
        (t[0] = V = (65535 & E) | (N << 16)),
        (E = 65535 & (k = W)),
        (N = k >>> 16),
        (L = 65535 & (S = O)),
        (D = S >>> 16),
        (S = e[1]),
        (N += (k = t[1]) >>> 16),
        (L += 65535 & S),
        (D += S >>> 16),
        (D += (L += (N += (E += 65535 & k) >>> 16) >>> 16) >>> 16),
        (e[1] = O = (65535 & L) | (D << 16)),
        (t[1] = W = (65535 & E) | (N << 16)),
        (E = 65535 & (k = H)),
        (N = k >>> 16),
        (L = 65535 & (S = M)),
        (D = S >>> 16),
        (S = e[2]),
        (N += (k = t[2]) >>> 16),
        (L += 65535 & S),
        (D += S >>> 16),
        (D += (L += (N += (E += 65535 & k) >>> 16) >>> 16) >>> 16),
        (e[2] = M = (65535 & L) | (D << 16)),
        (t[2] = H = (65535 & E) | (N << 16)),
        (E = 65535 & (k = z)),
        (N = k >>> 16),
        (L = 65535 & (S = A)),
        (D = S >>> 16),
        (S = e[3]),
        (N += (k = t[3]) >>> 16),
        (L += 65535 & S),
        (D += S >>> 16),
        (D += (L += (N += (E += 65535 & k) >>> 16) >>> 16) >>> 16),
        (e[3] = A = (65535 & L) | (D << 16)),
        (t[3] = z = (65535 & E) | (N << 16)),
        (E = 65535 & (k = U)),
        (N = k >>> 16),
        (L = 65535 & (S = P)),
        (D = S >>> 16),
        (S = e[4]),
        (N += (k = t[4]) >>> 16),
        (L += 65535 & S),
        (D += S >>> 16),
        (D += (L += (N += (E += 65535 & k) >>> 16) >>> 16) >>> 16),
        (e[4] = P = (65535 & L) | (D << 16)),
        (t[4] = U = (65535 & E) | (N << 16)),
        (E = 65535 & (k = $)),
        (N = k >>> 16),
        (L = 65535 & (S = j)),
        (D = S >>> 16),
        (S = e[5]),
        (N += (k = t[5]) >>> 16),
        (L += 65535 & S),
        (D += S >>> 16),
        (D += (L += (N += (E += 65535 & k) >>> 16) >>> 16) >>> 16),
        (e[5] = j = (65535 & L) | (D << 16)),
        (t[5] = $ = (65535 & E) | (N << 16)),
        (E = 65535 & (k = q)),
        (N = k >>> 16),
        (L = 65535 & (S = F)),
        (D = S >>> 16),
        (S = e[6]),
        (N += (k = t[6]) >>> 16),
        (L += 65535 & S),
        (D += S >>> 16),
        (D += (L += (N += (E += 65535 & k) >>> 16) >>> 16) >>> 16),
        (e[6] = F = (65535 & L) | (D << 16)),
        (t[6] = q = (65535 & E) | (N << 16)),
        (E = 65535 & (k = K)),
        (N = k >>> 16),
        (L = 65535 & (S = B)),
        (D = S >>> 16),
        (S = e[7]),
        (N += (k = t[7]) >>> 16),
        (L += 65535 & S),
        (D += S >>> 16),
        (D += (L += (N += (E += 65535 & k) >>> 16) >>> 16) >>> 16),
        (e[7] = B = (65535 & L) | (D << 16)),
        (t[7] = K = (65535 & E) | (N << 16)),
        (Z += 128),
        (i -= 128));
    }
    return i;
  }
  function Y(e, t, n) {
    var i,
      r = new Int32Array(8),
      o = new Int32Array(8),
      s = new Uint8Array(256),
      a = n;
    for (
      r[0] = 1779033703,
        r[1] = 3144134277,
        r[2] = 1013904242,
        r[3] = 2773480762,
        r[4] = 1359893119,
        r[5] = 2600822924,
        r[6] = 528734635,
        r[7] = 1541459225,
        o[0] = 4089235720,
        o[1] = 2227873595,
        o[2] = 4271175723,
        o[3] = 1595750129,
        o[4] = 2917565137,
        o[5] = 725511199,
        o[6] = 4215389547,
        o[7] = 327033209,
        Z(r, o, t, n),
        n %= 128,
        i = 0;
      i < n;
      i++
    )
      s[i] = t[a - n + i];
    for (
      s[n] = 128,
        s[(n = 256 - 128 * (n < 112 ? 1 : 0)) - 9] = 0,
        g(s, n - 8, (a / 536870912) | 0, a << 3),
        Z(r, o, s, n),
        i = 0;
      i < 8;
      i++
    )
      g(e, 8 * i, r[i], o[i]);
    return 0;
  }
  function X(e, n) {
    var i = t(),
      r = t(),
      o = t(),
      s = t(),
      a = t(),
      l = t(),
      d = t(),
      u = t(),
      h = t();
    (j(i, e[1], e[0]),
      j(h, n[1], n[0]),
      F(i, i, h),
      P(r, e[0], e[1]),
      P(h, n[0], n[1]),
      F(r, r, h),
      F(o, e[3], n[3]),
      F(o, o, c),
      F(s, e[2], n[2]),
      P(s, s, s),
      j(a, r, i),
      j(l, s, o),
      P(d, s, o),
      P(u, r, i),
      F(e[0], a, l),
      F(e[1], u, d),
      F(e[2], d, l),
      F(e[3], a, u));
  }
  function Q(e, t, n) {
    var i;
    for (i = 0; i < 4; i++) I(e[i], t[i], n);
  }
  function J(e, n) {
    var i = t(),
      r = t(),
      o = t();
    (V(o, n[2]), F(i, n[0], o), F(r, n[1], o), R(e, r), (e[31] ^= M(i) << 7));
  }
  function ee(e, t, n) {
    var i, r;
    for (D(e[0], o), D(e[1], s), D(e[2], s), D(e[3], o), r = 255; r >= 0; --r)
      (Q(e, t, (i = (n[(r / 8) | 0] >> (7 & r)) & 1)), X(t, e), X(e, e), Q(e, t, i));
  }
  function te(e, n) {
    var i = [t(), t(), t(), t()];
    (D(i[0], d), D(i[1], u), D(i[2], s), F(i[3], d, u), ee(e, i, n));
  }
  function ne(e, i, r) {
    var o,
      s = new Uint8Array(64),
      a = [t(), t(), t(), t()];
    for (
      r || n(i, 32), Y(s, i, 32), s[0] &= 248, s[31] &= 127, s[31] |= 64, te(a, s), J(e, a), o = 0;
      o < 32;
      o++
    )
      i[o + 32] = e[o];
    return 0;
  }
  var ie = new Float64Array([
    237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 16,
  ]);
  function re(e, t) {
    var n, i, r, o;
    for (i = 63; i >= 32; --i) {
      for (n = 0, r = i - 32, o = i - 12; r < o; ++r)
        ((t[r] += n - 16 * t[i] * ie[r - (i - 32)]),
          (n = Math.floor((t[r] + 128) / 256)),
          (t[r] -= 256 * n));
      ((t[r] += n), (t[i] = 0));
    }
    for (n = 0, r = 0; r < 32; r++)
      ((t[r] += n - (t[31] >> 4) * ie[r]), (n = t[r] >> 8), (t[r] &= 255));
    for (r = 0; r < 32; r++) t[r] -= n * ie[r];
    for (i = 0; i < 32; i++) ((t[i + 1] += t[i] >> 8), (e[i] = 255 & t[i]));
  }
  function oe(e) {
    var t,
      n = new Float64Array(64);
    for (t = 0; t < 64; t++) n[t] = e[t];
    for (t = 0; t < 64; t++) e[t] = 0;
    re(e, n);
  }
  function se(e, n, i, r) {
    var o,
      s,
      a = new Uint8Array(64),
      l = new Uint8Array(64),
      c = new Uint8Array(64),
      d = new Float64Array(64),
      u = [t(), t(), t(), t()];
    (Y(a, r, 32), (a[0] &= 248), (a[31] &= 127), (a[31] |= 64));
    var h = i + 64;
    for (o = 0; o < i; o++) e[64 + o] = n[o];
    for (o = 0; o < 32; o++) e[32 + o] = a[32 + o];
    for (Y(c, e.subarray(32), i + 32), oe(c), te(u, c), J(e, u), o = 32; o < 64; o++) e[o] = r[o];
    for (Y(l, e, i + 64), oe(l), o = 0; o < 64; o++) d[o] = 0;
    for (o = 0; o < 32; o++) d[o] = c[o];
    for (o = 0; o < 32; o++) for (s = 0; s < 32; s++) d[o + s] += l[o] * a[s];
    return (re(e.subarray(32), d), h);
  }
  function ae(e, n, i, r) {
    var a,
      c = new Uint8Array(32),
      d = new Uint8Array(64),
      u = [t(), t(), t(), t()],
      g = [t(), t(), t(), t()];
    if (i < 64) return -1;
    if (
      (function (e, n) {
        var i = t(),
          r = t(),
          a = t(),
          c = t(),
          d = t(),
          u = t(),
          g = t();
        return (
          D(e[2], s),
          A(e[1], n),
          B(a, e[1]),
          F(c, a, l),
          j(a, a, e[2]),
          P(c, e[2], c),
          B(d, c),
          B(u, d),
          F(g, u, d),
          F(i, g, a),
          F(i, i, c),
          W(i, i),
          F(i, i, a),
          F(i, i, c),
          F(i, i, c),
          F(e[0], i, c),
          B(r, e[0]),
          F(r, r, c),
          O(r, a) && F(e[0], e[0], h),
          B(r, e[0]),
          F(r, r, c),
          O(r, a) ? -1 : (M(e[0]) === n[31] >> 7 && j(e[0], o, e[0]), F(e[3], e[0], e[1]), 0)
        );
      })(g, r)
    )
      return -1;
    for (a = 0; a < i; a++) e[a] = n[a];
    for (a = 0; a < 32; a++) e[a + 32] = r[a];
    if (
      (Y(d, e, i),
      oe(d),
      ee(u, g, d),
      te(g, n.subarray(32)),
      X(u, g),
      J(c, u),
      (i -= 64),
      m(n, 0, c, 0))
    ) {
      for (a = 0; a < i; a++) e[a] = 0;
      return -1;
    }
    for (a = 0; a < i; a++) e[a] = n[a + 64];
    return i;
  }
  var le = 16,
    ce = 64,
    de = 32,
    ue = 64;
  function he(e, t) {
    if (32 !== e.length) throw new Error("bad key size");
    if (24 !== t.length) throw new Error("bad nonce size");
  }
  function ge() {
    for (var e = 0; e < arguments.length; e++)
      if (!(arguments[e] instanceof Uint8Array))
        throw new TypeError("unexpected type, use Uint8Array");
  }
  function pe(e) {
    for (var t = 0; t < e.length; t++) e[t] = 0;
  }
  ((e.lowlevel = {
    crypto_core_hsalsa20: v,
    crypto_stream_xor: C,
    crypto_stream: w,
    crypto_stream_salsa20_xor: y,
    crypto_stream_salsa20: x,
    crypto_onetimeauth: k,
    crypto_onetimeauth_verify: E,
    crypto_verify_16: f,
    crypto_verify_32: m,
    crypto_secretbox: N,
    crypto_secretbox_open: L,
    crypto_scalarmult: H,
    crypto_scalarmult_base: z,
    crypto_box_beforenm: $,
    crypto_box_afternm: q,
    crypto_box: function (e, t, n, i, r, o) {
      var s = new Uint8Array(32);
      return ($(s, r, o), q(e, t, n, i, s));
    },
    crypto_box_open: function (e, t, n, i, r, o) {
      var s = new Uint8Array(32);
      return ($(s, r, o), K(e, t, n, i, s));
    },
    crypto_box_keypair: U,
    crypto_hash: Y,
    crypto_sign: se,
    crypto_sign_keypair: ne,
    crypto_sign_open: ae,
    crypto_secretbox_KEYBYTES: 32,
    crypto_secretbox_NONCEBYTES: 24,
    crypto_secretbox_ZEROBYTES: 32,
    crypto_secretbox_BOXZEROBYTES: le,
    crypto_scalarmult_BYTES: 32,
    crypto_scalarmult_SCALARBYTES: 32,
    crypto_box_PUBLICKEYBYTES: 32,
    crypto_box_SECRETKEYBYTES: 32,
    crypto_box_BEFORENMBYTES: 32,
    crypto_box_NONCEBYTES: 24,
    crypto_box_ZEROBYTES: 32,
    crypto_box_BOXZEROBYTES: 16,
    crypto_sign_BYTES: ce,
    crypto_sign_PUBLICKEYBYTES: de,
    crypto_sign_SECRETKEYBYTES: ue,
    crypto_sign_SEEDBYTES: 32,
    crypto_hash_BYTES: 64,
    gf: t,
    D: l,
    L: ie,
    pack25519: R,
    unpack25519: A,
    M: F,
    A: P,
    S: B,
    Z: j,
    pow2523: W,
    add: X,
    set25519: D,
    modL: re,
    scalarmult: ee,
    scalarbase: te,
  }),
    (e.randomBytes = function (e) {
      var t = new Uint8Array(e);
      return (n(t, e), t);
    }),
    (e.secretbox = function (e, t, n) {
      (ge(e, t, n), he(n, t));
      for (
        var i = new Uint8Array(32 + e.length), r = new Uint8Array(i.length), o = 0;
        o < e.length;
        o++
      )
        i[o + 32] = e[o];
      return (N(r, i, i.length, t, n), r.subarray(le));
    }),
    (e.secretbox.open = function (e, t, n) {
      (ge(e, t, n), he(n, t));
      for (
        var i = new Uint8Array(le + e.length), r = new Uint8Array(i.length), o = 0;
        o < e.length;
        o++
      )
        i[o + le] = e[o];
      return i.length < 32 || 0 !== L(r, i, i.length, t, n) ? null : r.subarray(32);
    }),
    (e.secretbox.keyLength = 32),
    (e.secretbox.nonceLength = 24),
    (e.secretbox.overheadLength = le),
    (e.scalarMult = function (e, t) {
      if ((ge(e, t), 32 !== e.length)) throw new Error("bad n size");
      if (32 !== t.length) throw new Error("bad p size");
      var n = new Uint8Array(32);
      return (H(n, e, t), n);
    }),
    (e.scalarMult.base = function (e) {
      if ((ge(e), 32 !== e.length)) throw new Error("bad n size");
      var t = new Uint8Array(32);
      return (z(t, e), t);
    }),
    (e.scalarMult.scalarLength = 32),
    (e.scalarMult.groupElementLength = 32),
    (e.box = function (t, n, i, r) {
      var o = e.box.before(i, r);
      return e.secretbox(t, n, o);
    }),
    (e.box.before = function (e, t) {
      (ge(e, t),
        (function (e, t) {
          if (32 !== e.length) throw new Error("bad public key size");
          if (32 !== t.length) throw new Error("bad secret key size");
        })(e, t));
      var n = new Uint8Array(32);
      return ($(n, e, t), n);
    }),
    (e.box.after = e.secretbox),
    (e.box.open = function (t, n, i, r) {
      var o = e.box.before(i, r);
      return e.secretbox.open(t, n, o);
    }),
    (e.box.open.after = e.secretbox.open),
    (e.box.keyPair = function () {
      var e = new Uint8Array(32),
        t = new Uint8Array(32);
      return (U(e, t), { publicKey: e, secretKey: t });
    }),
    (e.box.keyPair.fromSecretKey = function (e) {
      if ((ge(e), 32 !== e.length)) throw new Error("bad secret key size");
      var t = new Uint8Array(32);
      return (z(t, e), { publicKey: t, secretKey: new Uint8Array(e) });
    }),
    (e.box.publicKeyLength = 32),
    (e.box.secretKeyLength = 32),
    (e.box.sharedKeyLength = 32),
    (e.box.nonceLength = 24),
    (e.box.overheadLength = e.secretbox.overheadLength),
    (e.sign = function (e, t) {
      if ((ge(e, t), t.length !== ue)) throw new Error("bad secret key size");
      var n = new Uint8Array(ce + e.length);
      return (se(n, e, e.length, t), n);
    }),
    (e.sign.open = function (e, t) {
      if ((ge(e, t), t.length !== de)) throw new Error("bad public key size");
      var n = new Uint8Array(e.length),
        i = ae(n, e, e.length, t);
      if (i < 0) return null;
      for (var r = new Uint8Array(i), o = 0; o < r.length; o++) r[o] = n[o];
      return r;
    }),
    (e.sign.detached = function (t, n) {
      for (var i = e.sign(t, n), r = new Uint8Array(ce), o = 0; o < r.length; o++) r[o] = i[o];
      return r;
    }),
    (e.sign.detached.verify = function (e, t, n) {
      if ((ge(e, t, n), t.length !== ce)) throw new Error("bad signature size");
      if (n.length !== de) throw new Error("bad public key size");
      var i,
        r = new Uint8Array(ce + e.length),
        o = new Uint8Array(ce + e.length);
      for (i = 0; i < ce; i++) r[i] = t[i];
      for (i = 0; i < e.length; i++) r[i + ce] = e[i];
      return ae(o, r, r.length, n) >= 0;
    }),
    (e.sign.keyPair = function () {
      var e = new Uint8Array(de),
        t = new Uint8Array(ue);
      return (ne(e, t), { publicKey: e, secretKey: t });
    }),
    (e.sign.keyPair.fromSecretKey = function (e) {
      if ((ge(e), e.length !== ue)) throw new Error("bad secret key size");
      for (var t = new Uint8Array(de), n = 0; n < t.length; n++) t[n] = e[32 + n];
      return { publicKey: t, secretKey: new Uint8Array(e) };
    }),
    (e.sign.keyPair.fromSeed = function (e) {
      if ((ge(e), 32 !== e.length)) throw new Error("bad seed size");
      for (var t = new Uint8Array(de), n = new Uint8Array(ue), i = 0; i < 32; i++) n[i] = e[i];
      return (ne(t, n, !0), { publicKey: t, secretKey: n });
    }),
    (e.sign.publicKeyLength = de),
    (e.sign.secretKeyLength = ue),
    (e.sign.seedLength = 32),
    (e.sign.signatureLength = ce),
    (e.hash = function (e) {
      ge(e);
      var t = new Uint8Array(64);
      return (Y(t, e, e.length), t);
    }),
    (e.hash.hashLength = 64),
    (e.verify = function (e, t) {
      return (
        ge(e, t),
        0 !== e.length && 0 !== t.length && e.length === t.length && 0 === p(e, 0, t, 0, e.length)
      );
    }),
    (e.setPRNG = function (e) {
      n = e;
    }),
    (function () {
      var t = "undefined" != typeof self ? self.crypto || self.msCrypto : null;
      t && t.getRandomValues
        ? e.setPRNG(function (e, n) {
            var i,
              r = new Uint8Array(n);
            for (i = 0; i < n; i += 65536)
              t.getRandomValues(r.subarray(i, i + Math.min(n - i, 65536)));
            for (i = 0; i < n; i++) e[i] = r[i];
            pe(r);
          })
        : void 0 !== N4t &&
          (t = D4t) &&
          t.randomBytes &&
          e.setPRNG(function (e, n) {
            var i,
              r = t.randomBytes(n);
            for (i = 0; i < n; i++) e[i] = r[i];
            pe(r);
          });
    })());
})(L4t.exports ? L4t.exports : (self.nacl = self.nacl || {}));
var T4t = L4t.exports,
  I4t = { exports: {} };
!(function (e) {
  !(function (t, n) {
    e.exports ? (e.exports = n()) : (t.nacl || (t.nacl = {}), (t.nacl.util = n()));
  })(t, function () {
    var e = {};
    function t(e) {
      if (
        !/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(
          e,
        )
      )
        throw new TypeError("invalid encoding");
    }
    return (
      (e.decodeUTF8 = function (e) {
        if ("string" != typeof e) throw new TypeError("expected string");
        var t,
          n = unescape(encodeURIComponent(e)),
          i = new Uint8Array(n.length);
        for (t = 0; t < n.length; t++) i[t] = n.charCodeAt(t);
        return i;
      }),
      (e.encodeUTF8 = function (e) {
        var t,
          n = [];
        for (t = 0; t < e.length; t++) n.push(String.fromCharCode(e[t]));
        return decodeURIComponent(escape(n.join("")));
      }),
      "undefined" == typeof atob
        ? void 0 !== Buffer.from
          ? ((e.encodeBase64 = function (e) {
              return Buffer.from(e).toString("base64");
            }),
            (e.decodeBase64 = function (e) {
              return (
                t(e),
                new Uint8Array(Array.prototype.slice.call(Buffer.from(e, "base64"), 0))
              );
            }))
          : ((e.encodeBase64 = function (e) {
              return new Buffer(e).toString("base64");
            }),
            (e.decodeBase64 = function (e) {
              return (t(e), new Uint8Array(Array.prototype.slice.call(new Buffer(e, "base64"), 0)));
            }))
        : ((e.encodeBase64 = function (e) {
            var t,
              n = [],
              i = e.length;
            for (t = 0; t < i; t++) n.push(String.fromCharCode(e[t]));
            return btoa(n.join(""));
          }),
          (e.decodeBase64 = function (e) {
            t(e);
            var n,
              i = atob(e),
              r = new Uint8Array(i.length);
            for (n = 0; n < i.length; n++) r[n] = i.charCodeAt(n);
            return r;
          })),
      e
    );
  });
})(I4t);
var R4t = I4t.exports;
const O4t = (e) => e.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""),
  M4t = () => {
    try {
      return (() => {
        try {
          const e = T4t.box.keyPair();
          return {
            privateKey: O4t(R4t.encodeBase64(e.secretKey)),
            publicKey: O4t(R4t.encodeBase64(e.publicKey)),
          };
        } catch (D2t) {
          throw D2t;
        }
      })();
    } catch (D2t) {
      throw D2t;
    }
  },
  A4t = () =>
    ((e) => {
      const t = new Uint8Array(Math.ceil(e / 2));
      return (
        window.crypto.getRandomValues(t),
        Array.from(t)
          .map((e) => e.toString(16).padStart(2, "0"))
          .join("")
          .substring(0, e)
      );
    })(2 * Math.floor(8 * Math.random()) + 2),
  P4t = (e, t) =>
    gy({
      tls: by().default(0),
      tls_settings: gy({ server_name: ly().default(""), allow_insecure: dy().default(!1) }).default(
        {},
      ),
      utls: y4t,
      cert_config: e.default({}),
      reality_settings: gy({
        server_port: by().default(443),
        server_name: ly().default(""),
        allow_insecure: dy().default(!1),
        public_key: ly().default(""),
        private_key: ly().default(""),
        short_id: ly().default(""),
        fingerprint: ly().default("chrome"),
      }).default({}),
      network: ly().default("tcp"),
      network_settings: fy(uy()).default({}),
      flow: ly().default(""),
      multiplex: b4t,
      routing: t.optional().default({}),
      encryption: gy({
        enabled: dy().default(!1),
        encryption: ly().default(""),
        decryption: ly().default(""),
      }).default({}),
    }),
  j4t = {
    networkOptions: [
      { value: "tcp", label: "TCP" },
      { value: "ws", label: "Websocket" },
      { value: "grpc", label: "gRPC" },
      { value: "kcp", label: "mKCP" },
      { value: "httpupgrade", label: "HttpUpgrade" },
      { value: "xhttp", label: "XHTTP" },
    ],
    flowOptions: ["none", "xtls-rprx-direct", "xtls-rprx-splice", "xtls-rprx-vision"],
  },
  F4t = ({ form: e, t: t }) =>
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: "tls",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "font-mono text-[12px] text-foreground/80",
                  children: t("dynamic_form.vless.tls.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    value: e.value?.toString(),
                    onValueChange: (t) => e.onChange(Number(t)),
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.vless.tls.placeholder"),
                        }),
                      }),
                      Q.jsxs(PHt, {
                        children: [
                          Q.jsx(FHt, { value: "0", children: t("dynamic_form.vless.tls.none") }),
                          Q.jsx(FHt, { value: "1", children: t("dynamic_form.vless.tls.tls") }),
                          Q.jsx(FHt, { value: "2", children: t("dynamic_form.vless.tls.reality") }),
                        ],
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        "1" == e.watch("tls") &&
          Q.jsxs(Q.Fragment, {
            children: [
              Q.jsxs("div", {
                className: "flex gap-2",
                children: [
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "tls_settings.server_name",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        className: "flex-[2]",
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[12px] text-foreground/80",
                            children: t("dynamic_form.vless.tls_settings.server_name.label"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              className: "font-mono text-xs",
                              placeholder: t(
                                "dynamic_form.vless.tls_settings.server_name.placeholder",
                              ),
                              ...e,
                            }),
                          }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "tls_settings.allow_insecure",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[12px] text-foreground/80",
                            children: t("dynamic_form.vless.tls_settings.allow_insecure"),
                          }),
                          Q.jsx("div", {
                            className: "py-2 text-center",
                            children: Q.jsx(Zy, {
                              children: Q.jsx(mGt, {
                                checked: e.value,
                                onCheckedChange: e.onChange,
                              }),
                            }),
                          }),
                        ],
                      }),
                  }),
                ],
              }),
              Q.jsx("div", { className: "mt-2", children: Q.jsx(w4t, { form: e, t: t }) }),
            ],
          }),
        2 == e.watch("tls") &&
          Q.jsxs(Q.Fragment, {
            children: [
              Q.jsxs("div", {
                className: "flex gap-2",
                children: [
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "reality_settings.server_name",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        className: "flex-[2]",
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[12px] text-foreground/80",
                            children: t("dynamic_form.vless.reality_settings.server_name.label"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              className: "font-mono text-xs",
                              placeholder: t(
                                "dynamic_form.vless.reality_settings.server_name.placeholder",
                              ),
                              ...e,
                            }),
                          }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "reality_settings.server_port",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        className: "flex-1",
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[12px] text-foreground/80",
                            children: t("dynamic_form.vless.reality_settings.server_port.label"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              className: "font-mono text-xs",
                              placeholder: t(
                                "dynamic_form.vless.reality_settings.server_port.placeholder",
                              ),
                              ...e,
                            }),
                          }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "reality_settings.allow_insecure",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[12px] text-foreground/80",
                            children: t("dynamic_form.vless.reality_settings.allow_insecure"),
                          }),
                          Q.jsx("div", {
                            className: "py-2 text-center",
                            children: Q.jsx(Zy, {
                              children: Q.jsx(mGt, {
                                checked: e.value,
                                onCheckedChange: e.onChange,
                              }),
                            }),
                          }),
                        ],
                      }),
                  }),
                ],
              }),
              Q.jsx("div", {
                className: "flex items-end gap-2",
                children: Q.jsx(Uy, {
                  control: e.control,
                  name: "reality_settings.private_key",
                  render: ({ field: n }) =>
                    Q.jsxs(Ky, {
                      className: "flex-1",
                      children: [
                        Q.jsx(Gy, {
                          className: "font-mono text-[12px] text-foreground/80",
                          children: t("dynamic_form.vless.reality_settings.private_key.label"),
                        }),
                        Q.jsxs("div", {
                          className: "relative",
                          children: [
                            Q.jsx(Zy, {
                              children: Q.jsx(Q6e, { className: "pr-9 font-mono text-xs", ...n }),
                            }),
                            Q.jsx(Pst, {
                              children: Q.jsxs(jst, {
                                children: [
                                  Q.jsx(Fst, {
                                    asChild: !0,
                                    children: Q.jsx(ltt, {
                                      type: "button",
                                      variant: "ghost",
                                      size: "icon",
                                      onClick: () => {
                                        try {
                                          const n = M4t();
                                          (e.setValue("reality_settings.private_key", n.privateKey),
                                            e.setValue("reality_settings.public_key", n.publicKey),
                                            hN.success(
                                              t(
                                                "dynamic_form.vless.reality_settings.key_pair.success",
                                              ),
                                            ));
                                        } catch (D2t) {
                                          hN.error(
                                            t("dynamic_form.vless.reality_settings.key_pair.error"),
                                          );
                                        }
                                      },
                                      className:
                                        "absolute right-0 top-0 h-full px-2 transition-transform duration-150 active:scale-90",
                                      children: Q.jsx(yYt, {
                                        icon: "ion:key-outline",
                                        className:
                                          "h-4 w-4 transition-transform duration-300 hover:rotate-180",
                                      }),
                                    }),
                                  }),
                                  Q.jsx(Mst, {
                                    children: Q.jsx(Bst, {
                                      children: Q.jsx("p", {
                                        children: t(
                                          "dynamic_form.vless.reality_settings.key_pair.generate",
                                        ),
                                      }),
                                    }),
                                  }),
                                ],
                              }),
                            }),
                          ],
                        }),
                      ],
                    }),
                }),
              }),
              Q.jsx(Uy, {
                control: e.control,
                name: "reality_settings.public_key",
                render: ({ field: e }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, {
                        className: "font-mono text-[12px] text-foreground/80",
                        children: t("dynamic_form.vless.reality_settings.public_key.label"),
                      }),
                      Q.jsx(Zy, { children: Q.jsx(Q6e, { className: "font-mono text-xs", ...e }) }),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: e.control,
                name: "reality_settings.short_id",
                render: ({ field: n }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, {
                        className: "font-mono text-[12px] text-foreground/80",
                        children: t("dynamic_form.vless.reality_settings.short_id.label"),
                      }),
                      Q.jsxs("div", {
                        className: "relative",
                        children: [
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              className: "pr-9 font-mono text-xs",
                              ...n,
                              placeholder: t(
                                "dynamic_form.vless.reality_settings.short_id.placeholder",
                              ),
                            }),
                          }),
                          Q.jsx(Pst, {
                            children: Q.jsxs(jst, {
                              children: [
                                Q.jsx(Fst, {
                                  asChild: !0,
                                  children: Q.jsx(ltt, {
                                    type: "button",
                                    variant: "ghost",
                                    size: "icon",
                                    onClick: () => {
                                      const n = A4t();
                                      (e.setValue("reality_settings.short_id", n),
                                        hN.success(
                                          t("dynamic_form.vless.reality_settings.short_id.success"),
                                        ));
                                    },
                                    className:
                                      "absolute right-0 top-0 h-full px-2 transition-transform duration-150 active:scale-90",
                                    children: Q.jsx(yYt, {
                                      icon: "ion:refresh-outline",
                                      className:
                                        "h-4 w-4 transition-transform duration-300 hover:rotate-180",
                                    }),
                                  }),
                                }),
                                Q.jsx(Mst, {
                                  children: Q.jsx(Bst, {
                                    children: Q.jsx("p", {
                                      children: t(
                                        "dynamic_form.vless.reality_settings.short_id.generate",
                                      ),
                                    }),
                                  }),
                                }),
                              ],
                            }),
                          }),
                        ],
                      }),
                      Q.jsx(Yy, {
                        className: "font-mono text-[11px] text-xs text-foreground/80 opacity-70",
                        children: t("dynamic_form.vless.reality_settings.short_id.description"),
                      }),
                    ],
                  }),
              }),
              Q.jsx("div", { className: "mt-2", children: Q.jsx(w4t, { form: e, t: t }) }),
            ],
          }),
        Q.jsx(Uy, {
          control: e.control,
          name: "network",
          render: ({ field: n }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsxs(Gy, {
                  className: "font-mono text-[12px] text-foreground/80",
                  children: [
                    t("dynamic_form.vless.network.label"),
                    Q.jsx(v4t, {
                      value: e.watch("network_settings"),
                      setValue: (t) => e.setValue("network_settings", t),
                      templateType: e.watch("network"),
                    }),
                  ],
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    onValueChange: n.onChange,
                    value: n.value,
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.vless.network.placeholder"),
                        }),
                      }),
                      Q.jsx(PHt, {
                        children: j4t.networkOptions.map((e) =>
                          Q.jsx(
                            FHt,
                            { value: e.value, className: "cursor-pointer", children: e.label },
                            e.value,
                          ),
                        ),
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "flow",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "font-mono text-[12px] text-foreground/80",
                  children: t("dynamic_form.vless.flow.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    onValueChange: (t) => e.onChange("none" === t ? null : t),
                    value: e.value || "none",
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.vless.flow.placeholder"),
                        }),
                      }),
                      Q.jsx(PHt, {
                        children: j4t.flowOptions.map((e) =>
                          Q.jsx(FHt, { value: e, children: e }, e),
                        ),
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        Q.jsxs("div", {
          className: "space-y-4 rounded-lg border bg-muted/10 p-4",
          children: [
            Q.jsx(Uy, {
              control: e.control,
              name: "encryption.enabled",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  className: "flex flex-row items-center justify-between",
                  children: [
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx(Gy, {
                          className: "font-mono text-[13px] font-bold",
                          children: t("dynamic_form.vless.encryption.label"),
                        }),
                        Q.jsx(Yy, {
                          className: "font-mono text-[11px] opacity-70",
                          children: t("dynamic_form.vless.encryption.description"),
                        }),
                      ],
                    }),
                    Q.jsx(Zy, {
                      children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                    }),
                  ],
                }),
            }),
            e.watch("encryption.enabled") &&
              Q.jsxs("div", {
                className: "space-y-4 border-t border-dashed pt-2",
                children: [
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "encryption.decryption",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[11px] text-foreground/60",
                            children: t("dynamic_form.vless.encryption.server_label"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              className: "font-mono text-xs",
                              placeholder: t("dynamic_form.vless.encryption.server_placeholder"),
                              ...e,
                            }),
                          }),
                          Q.jsx(Yy, {
                            className: "font-mono text-[10px] text-foreground/60 opacity-70",
                            children: t("dynamic_form.vless.encryption.server_description"),
                          }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "encryption.encryption",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[11px] text-foreground/60",
                            children: t("dynamic_form.vless.encryption.client_label"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              className: "font-mono text-xs",
                              placeholder: t("dynamic_form.vless.encryption.client_placeholder"),
                              ...e,
                            }),
                          }),
                          Q.jsx(Yy, {
                            className: "font-mono text-[10px] text-foreground/60 opacity-70",
                            children: t("dynamic_form.vless.encryption.client_description"),
                          }),
                        ],
                      }),
                  }),
                  Q.jsxs("p", {
                    className: "px-1 font-mono text-[10px] italic leading-relaxed text-primary/70",
                    children: ["* ", t("dynamic_form.vless.encryption.generate_hint")],
                  }),
                ],
              }),
          ],
        }),
      ],
    }),
  B4t = (e, t) =>
    gy({
      version: by().default(2),
      alpn: ly().default("h2"),
      obfs: gy({
        open: yy().default(!1),
        type: ly().default("salamander"),
        password: ly().default(""),
      }).default({}),
      tls: gy({ server_name: ly().default(""), allow_insecure: dy().default(!1) }).default({}),
      cert_config: e.default({}),
      bandwidth: gy({ up: ly().default(""), down: ly().default("") }).default({}),
      hop_interval: cy().optional(),
      port_range: ly().optional(),
      routing: t.optional().default({}),
    }),
  V4t = { versions: ["1", "2"], alpnOptions: ["hysteria", "http/1.1", "h2", "h3"] },
  W4t = ({ form: e, t: t }) =>
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsxs("div", {
          className: "flex gap-2",
          children: [
            Q.jsx(Uy, {
              control: e.control,
              name: "version",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  className: "flex-1",
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: t("dynamic_form.hysteria.version.label"),
                    }),
                    Q.jsx(Zy, {
                      children: Q.jsxs(THt, {
                        value: (e.value || 2).toString(),
                        onValueChange: (t) => e.onChange(Number(t)),
                        children: [
                          Q.jsx(OHt, {
                            className: "font-mono text-xs",
                            children: Q.jsx(RHt, {
                              placeholder: t("dynamic_form.hysteria.version.placeholder"),
                            }),
                          }),
                          Q.jsx(PHt, {
                            children: Q.jsx(IHt, {
                              children: V4t.versions.map((e) =>
                                Q.jsxs(
                                  FHt,
                                  { value: e, className: "cursor-pointer", children: ["V", e] },
                                  e,
                                ),
                              ),
                            }),
                          }),
                        ],
                      }),
                    }),
                  ],
                }),
            }),
            1 == e.watch("version") &&
              Q.jsx(Uy, {
                control: e.control,
                name: "alpn",
                render: ({ field: e }) =>
                  Q.jsxs(Ky, {
                    className: "flex-[2]",
                    children: [
                      Q.jsx(Gy, {
                        className: "text-[12px] font-mono text-foreground/80",
                        children: t("dynamic_form.hysteria.alpn.label"),
                      }),
                      Q.jsx(Zy, {
                        children: Q.jsxs(THt, {
                          value: e.value || "h2",
                          onValueChange: e.onChange,
                          children: [
                            Q.jsx(OHt, {
                              className: "font-mono text-xs",
                              children: Q.jsx(RHt, {
                                placeholder: t("dynamic_form.hysteria.alpn.placeholder"),
                              }),
                            }),
                            Q.jsx(PHt, {
                              children: Q.jsx(IHt, {
                                children: V4t.alpnOptions.map((e) =>
                                  Q.jsx(FHt, { value: e, children: e }, e),
                                ),
                              }),
                            }),
                          ],
                        }),
                      }),
                    ],
                  }),
              }),
          ],
        }),
        Q.jsxs("div", {
          className: "flex gap-2",
          children: [
            Q.jsx(Uy, {
              control: e.control,
              name: "obfs.open",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: t("dynamic_form.hysteria.obfs.label"),
                    }),
                    Q.jsx("div", {
                      className: "py-2 text-center",
                      children: Q.jsx(Zy, {
                        children: Q.jsx(mGt, {
                          checked: e.value || !1,
                          onCheckedChange: e.onChange,
                        }),
                      }),
                    }),
                  ],
                }),
            }),
            !!e.watch("obfs.open") &&
              Q.jsxs(Q.Fragment, {
                children: [
                  "2" == e.watch("version") &&
                    Q.jsx(Uy, {
                      control: e.control,
                      name: "obfs.type",
                      render: ({ field: e }) =>
                        Q.jsxs(Ky, {
                          className: "flex-1",
                          children: [
                            Q.jsx(Gy, {
                              className: "text-[12px] font-mono text-foreground/80",
                              children: t("dynamic_form.hysteria.obfs.type.label"),
                            }),
                            Q.jsx(Zy, {
                              children: Q.jsxs(THt, {
                                value: e.value || "salamander",
                                onValueChange: e.onChange,
                                children: [
                                  Q.jsx(OHt, {
                                    className: "font-mono text-xs",
                                    children: Q.jsx(RHt, {
                                      placeholder: t("dynamic_form.hysteria.obfs.type.placeholder"),
                                    }),
                                  }),
                                  Q.jsx(PHt, {
                                    children: Q.jsx(IHt, {
                                      children: Q.jsx(FHt, {
                                        value: "salamander",
                                        children: t("dynamic_form.hysteria.obfs.type.salamander"),
                                      }),
                                    }),
                                  }),
                                ],
                              }),
                            }),
                          ],
                        }),
                    }),
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "obfs.password",
                    render: ({ field: n }) =>
                      Q.jsxs(Ky, {
                        className: 2 == e.watch("version") ? "w-full" : "flex-[2]",
                        children: [
                          Q.jsx(Gy, {
                            className: "text-[12px] font-mono text-foreground/80",
                            children: t("dynamic_form.hysteria.obfs.password.label"),
                          }),
                          Q.jsxs("div", {
                            className: "relative",
                            children: [
                              Q.jsx(Zy, {
                                children: Q.jsx(Q6e, {
                                  className: "font-mono text-xs pr-9",
                                  placeholder: t("dynamic_form.hysteria.obfs.password.placeholder"),
                                  ...n,
                                  value: n.value || "",
                                }),
                              }),
                              Q.jsx(ltt, {
                                type: "button",
                                variant: "ghost",
                                size: "icon",
                                onClick: () => {
                                  const n =
                                      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
                                    i = Array.from(crypto.getRandomValues(new Uint8Array(16)))
                                      .map((e) => n[e % 62])
                                      .join("");
                                  (e.setValue("obfs.password", i),
                                    hN.success(
                                      t("dynamic_form.hysteria.obfs.password.generate_success"),
                                    ));
                                },
                                className:
                                  "absolute right-0 top-0 h-full px-2  transition-transform duration-150 active:scale-90",
                                children: Q.jsx(yYt, {
                                  icon: "ion:refresh-outline",
                                  className:
                                    "h-4 w-4 transition-transform duration-300 hover:rotate-180",
                                }),
                              }),
                            ],
                          }),
                        ],
                      }),
                  }),
                ],
              }),
          ],
        }),
        Q.jsxs("div", {
          className: "flex gap-2",
          children: [
            Q.jsx(Uy, {
              control: e.control,
              name: "tls.server_name",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  className: "flex-[2]",
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: t("dynamic_form.hysteria.tls.server_name.label"),
                    }),
                    Q.jsx(Zy, {
                      children: Q.jsx(Q6e, {
                        className: "font-mono text-xs",
                        placeholder: t("dynamic_form.hysteria.tls.server_name.placeholder"),
                        ...e,
                        value: e.value || "",
                      }),
                    }),
                  ],
                }),
            }),
            Q.jsx(Uy, {
              control: e.control,
              name: "tls.allow_insecure",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: t("dynamic_form.hysteria.tls.allow_insecure"),
                    }),
                    Q.jsx("div", {
                      className: "py-2 text-center",
                      children: Q.jsx(Zy, {
                        children: Q.jsx(mGt, {
                          checked: e.value || !1,
                          onCheckedChange: e.onChange,
                        }),
                      }),
                    }),
                  ],
                }),
            }),
          ],
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "bandwidth.up",
          render: ({ field: n }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.hysteria.bandwidth.up.label"),
                }),
                Q.jsxs("div", {
                  className: "relative flex",
                  children: [
                    Q.jsx(Zy, {
                      children: Q.jsx(Q6e, {
                        className: "font-mono text-xs rounded-br-none rounded-tr-none",
                        type: "number",
                        placeholder:
                          t("dynamic_form.hysteria.bandwidth.up.placeholder") +
                          (2 == e.watch("version")
                            ? t("dynamic_form.hysteria.bandwidth.up.bbr_tip")
                            : ""),
                        ...n,
                        value: n.value || "",
                      }),
                    }),
                    Q.jsx("div", {
                      className:
                        "pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",
                      children: Q.jsx("span", {
                        className: "text-gray-500",
                        children: t("dynamic_form.hysteria.bandwidth.up.suffix"),
                      }),
                    }),
                  ],
                }),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "bandwidth.down",
          render: ({ field: n }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.hysteria.bandwidth.down.label"),
                }),
                Q.jsxs("div", {
                  className: "relative flex",
                  children: [
                    Q.jsx(Zy, {
                      children: Q.jsx(Q6e, {
                        className: "font-mono text-xs rounded-br-none rounded-tr-none",
                        type: "number",
                        placeholder:
                          t("dynamic_form.hysteria.bandwidth.down.placeholder") +
                          (2 == e.watch("version")
                            ? t("dynamic_form.hysteria.bandwidth.down.bbr_tip")
                            : ""),
                        ...n,
                        value: n.value || "",
                      }),
                    }),
                    Q.jsx("div", {
                      className:
                        "pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",
                      children: Q.jsx("span", {
                        className: "text-gray-500",
                        children: t("dynamic_form.hysteria.bandwidth.down.suffix"),
                      }),
                    }),
                  ],
                }),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "hop_interval",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.hysteria.hop_interval.label", "Hop 间隔 (秒)"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsx(Q6e, {
                    className: "font-mono text-xs",
                    type: "number",
                    placeholder: t("dynamic_form.hysteria.hop_interval.placeholder", "例如: 30"),
                    ...e,
                    value: e.value || "",
                    onChange: (t) => {
                      const n = t.target.value ? parseInt(t.target.value) : void 0;
                      e.onChange(n);
                    },
                  }),
                }),
                Q.jsx(Yy, {
                  className: "text-[11px] font-mono opacity-70",
                  children: t(
                    "dynamic_form.hysteria.hop_interval.description",
                    "Hop 间隔时间，单位为秒",
                  ),
                }),
              ],
            }),
        }),
      ],
    }),
  H4t = (e, t) =>
    gy({
      tls: by().default(1),
      server_name: ly().default(""),
      allow_insecure: dy().default(!1),
      reality_settings: gy({
        server_port: by().default(443),
        server_name: ly().default(""),
        allow_insecure: dy().default(!1),
        public_key: ly().default(""),
        private_key: ly().default(""),
        short_id: ly().default(""),
      }).default({}),
      utls: y4t,
      network: ly().default("tcp"),
      network_settings: fy(uy()).default({}),
      cert_config: e.default({}),
      multiplex: b4t,
      routing: t.optional().default({}),
    }),
  z4t = {
    networkOptions: [
      { value: "tcp", label: "TCP" },
      { value: "ws", label: "Websocket" },
      { value: "grpc", label: "gRPC" },
    ],
  },
  U4t = ({ form: e, t: t }) =>
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: "tls",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "font-mono text-[12px] text-foreground/80",
                  children: t("dynamic_form.vless.tls.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    value: e.value?.toString(),
                    onValueChange: (t) => e.onChange(Number(t)),
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.vless.tls.placeholder"),
                        }),
                      }),
                      Q.jsxs(PHt, {
                        children: [
                          Q.jsx(FHt, { value: "1", children: t("dynamic_form.vless.tls.tls") }),
                          Q.jsx(FHt, { value: "2", children: t("dynamic_form.vless.tls.reality") }),
                        ],
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        1 == e.watch("tls") &&
          Q.jsx(Q.Fragment, {
            children: Q.jsxs("div", {
              className: "flex gap-2",
              children: [
                Q.jsx(Uy, {
                  control: e.control,
                  name: "server_name",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      className: "flex-[2]",
                      children: [
                        Q.jsx(Gy, {
                          className: "text-[12px] font-mono text-foreground/80",
                          children: t("dynamic_form.trojan.server_name.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            className: "font-mono text-xs",
                            placeholder: t("dynamic_form.trojan.server_name.placeholder"),
                            ...e,
                            value: e.value || "",
                          }),
                        }),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: e.control,
                  name: "allow_insecure",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-[12px] font-mono text-foreground/80",
                          children: t("dynamic_form.trojan.allow_insecure"),
                        }),
                        Q.jsx("div", {
                          className: "py-2 text-center",
                          children: Q.jsx(Zy, {
                            children: Q.jsx(mGt, {
                              checked: e.value || !1,
                              onCheckedChange: e.onChange,
                            }),
                          }),
                        }),
                      ],
                    }),
                }),
              ],
            }),
          }),
        2 == e.watch("tls") &&
          Q.jsxs(Q.Fragment, {
            children: [
              Q.jsxs("div", {
                className: "flex gap-2",
                children: [
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "reality_settings.server_name",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        className: "flex-[2]",
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[12px] text-foreground/80",
                            children: t("dynamic_form.vless.reality_settings.server_name.label"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              className: "font-mono text-xs",
                              placeholder: t(
                                "dynamic_form.vless.reality_settings.server_name.placeholder",
                              ),
                              ...e,
                            }),
                          }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "reality_settings.server_port",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        className: "flex-1",
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[12px] text-foreground/80",
                            children: t("dynamic_form.vless.reality_settings.server_port.label"),
                          }),
                          Q.jsx(Zy, {
                            children: Q.jsx(Q6e, {
                              className: "font-mono text-xs",
                              placeholder: t(
                                "dynamic_form.vless.reality_settings.server_port.placeholder",
                              ),
                              ...e,
                            }),
                          }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: e.control,
                    name: "reality_settings.allow_insecure",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, {
                            className: "font-mono text-[12px] text-foreground/80",
                            children: t("dynamic_form.vless.reality_settings.allow_insecure"),
                          }),
                          Q.jsx("div", {
                            className: "py-2 text-center",
                            children: Q.jsx(Zy, {
                              children: Q.jsx(mGt, {
                                checked: e.value,
                                onCheckedChange: e.onChange,
                              }),
                            }),
                          }),
                        ],
                      }),
                  }),
                ],
              }),
              Q.jsx("div", {
                className: "flex items-end gap-2",
                children: Q.jsx(Uy, {
                  control: e.control,
                  name: "reality_settings.private_key",
                  render: ({ field: n }) =>
                    Q.jsxs(Ky, {
                      className: "flex-1",
                      children: [
                        Q.jsx(Gy, {
                          className: "font-mono text-[12px] text-foreground/80",
                          children: t("dynamic_form.vless.reality_settings.private_key.label"),
                        }),
                        Q.jsxs("div", {
                          className: "relative",
                          children: [
                            Q.jsx(Zy, {
                              children: Q.jsx(Q6e, { className: "pr-9 font-mono text-xs", ...n }),
                            }),
                            Q.jsx(Pst, {
                              children: Q.jsxs(jst, {
                                children: [
                                  Q.jsx(Fst, {
                                    asChild: !0,
                                    children: Q.jsx(ltt, {
                                      type: "button",
                                      variant: "ghost",
                                      size: "icon",
                                      onClick: () => {
                                        try {
                                          const n = M4t();
                                          (e.setValue("reality_settings.private_key", n.privateKey),
                                            e.setValue("reality_settings.public_key", n.publicKey),
                                            hN.success(
                                              t(
                                                "dynamic_form.vless.reality_settings.key_pair.success",
                                              ),
                                            ));
                                        } catch (D2t) {
                                          hN.error(
                                            t("dynamic_form.vless.reality_settings.key_pair.error"),
                                          );
                                        }
                                      },
                                      className:
                                        "absolute right-0 top-0 h-full px-2 transition-transform duration-150 active:scale-90",
                                      children: Q.jsx(yYt, {
                                        icon: "ion:key-outline",
                                        className:
                                          "h-4 w-4 transition-transform duration-300 hover:rotate-180",
                                      }),
                                    }),
                                  }),
                                  Q.jsx(Mst, {
                                    children: Q.jsx(Bst, {
                                      children: Q.jsx("p", {
                                        children: t(
                                          "dynamic_form.vless.reality_settings.key_pair.generate",
                                        ),
                                      }),
                                    }),
                                  }),
                                ],
                              }),
                            }),
                          ],
                        }),
                      ],
                    }),
                }),
              }),
              Q.jsx(Uy, {
                control: e.control,
                name: "reality_settings.public_key",
                render: ({ field: e }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, {
                        className: "font-mono text-[12px] text-foreground/80",
                        children: t("dynamic_form.vless.reality_settings.public_key.label"),
                      }),
                      Q.jsx(Zy, { children: Q.jsx(Q6e, { className: "font-mono text-xs", ...e }) }),
                    ],
                  }),
              }),
              Q.jsx("div", {
                className: "flex gap-2",
                children: Q.jsx(Uy, {
                  control: e.control,
                  name: "reality_settings.short_id",
                  render: ({ field: n }) =>
                    Q.jsxs(Ky, {
                      className: "flex-1",
                      children: [
                        Q.jsx(Gy, {
                          className: "font-mono text-[12px] text-foreground/80",
                          children: Q.jsxs("div", {
                            className: "flex items-center gap-1",
                            children: [
                              t("dynamic_form.vless.reality_settings.short_id.label"),
                              Q.jsx(Pst, {
                                children: Q.jsxs(jst, {
                                  children: [
                                    Q.jsx(Fst, {
                                      asChild: !0,
                                      children: Q.jsx(yYt, {
                                        icon: "lucide:info",
                                        className: "h-3 w-3 cursor-help text-muted-foreground",
                                      }),
                                    }),
                                    Q.jsx(Bst, {
                                      className: "max-w-[300px]",
                                      children: Q.jsx("p", {
                                        children: t(
                                          "dynamic_form.vless.reality_settings.short_id.description",
                                        ),
                                      }),
                                    }),
                                  ],
                                }),
                              }),
                            ],
                          }),
                        }),
                        Q.jsxs("div", {
                          className: "relative",
                          children: [
                            Q.jsx(Zy, {
                              children: Q.jsx(Q6e, { className: "pr-9 font-mono text-xs", ...n }),
                            }),
                            Q.jsx(Pst, {
                              children: Q.jsxs(jst, {
                                children: [
                                  Q.jsx(Fst, {
                                    asChild: !0,
                                    children: Q.jsx(ltt, {
                                      type: "button",
                                      variant: "ghost",
                                      size: "icon",
                                      onClick: () => {
                                        const n = A4t();
                                        (e.setValue("reality_settings.short_id", n),
                                          hN.success(
                                            t(
                                              "dynamic_form.vless.reality_settings.short_id.success",
                                            ),
                                          ));
                                      },
                                      className:
                                        "absolute right-0 top-0 h-full px-2 transition-transform duration-150 active:scale-90",
                                      children: Q.jsx(yYt, {
                                        icon: "lucide:refresh-cw",
                                        className: "h-4 w-4",
                                      }),
                                    }),
                                  }),
                                  Q.jsx(Bst, {
                                    children: Q.jsx("p", {
                                      children: t(
                                        "dynamic_form.vless.reality_settings.short_id.generate",
                                      ),
                                    }),
                                  }),
                                ],
                              }),
                            }),
                          ],
                        }),
                      ],
                    }),
                }),
              }),
            ],
          }),
        Q.jsx("div", { className: "mb-4", children: Q.jsx(w4t, { form: e, t: t }) }),
        Q.jsx(Uy, {
          control: e.control,
          name: "network",
          render: ({ field: n }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsxs(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: [
                    t("dynamic_form.trojan.network.label"),
                    Q.jsx(v4t, {
                      value: e.watch("network_settings") || {},
                      setValue: (t) => e.setValue("network_settings", t),
                      templateType: e.watch("network") || "tcp",
                    }),
                  ],
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    onValueChange: n.onChange,
                    value: n.value || "tcp",
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.trojan.network.placeholder"),
                        }),
                      }),
                      Q.jsx(PHt, {
                        children: Q.jsx(IHt, {
                          children: z4t.networkOptions.map((e) =>
                            Q.jsx(
                              FHt,
                              { value: e.value, className: "cursor-pointer", children: e.label },
                              e.value,
                            ),
                          ),
                        }),
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
      ],
    }),
  $4t = (e, t) =>
    gy({
      version: by().default(5),
      congestion_control: ly().default("bbr"),
      alpn: hy(ly()).default(["h3"]),
      udp_relay_mode: ly().default("native"),
      tls: gy({ server_name: ly().default(""), allow_insecure: dy().default(!1) }).default({}),
      cert_config: e.default({}),
      routing: t.optional().default({}),
    }),
  q4t = {
    versions: ["5", "4"],
    congestionControls: ["bbr", "cubic", "new_reno"],
    alpnOptions: [
      { value: "h3", label: "HTTP/3" },
      { value: "h2", label: "HTTP/2" },
      { value: "http/1.1", label: "HTTP/1.1" },
    ],
    udpRelayModes: [
      { value: "native", label: "Native" },
      { value: "quic", label: "QUIC" },
    ],
  },
  K4t = ({ form: e, t: t }) =>
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: "version",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.tuic.version.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    value: e.value?.toString(),
                    onValueChange: (t) => e.onChange(Number(t)),
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.tuic.version.placeholder"),
                        }),
                      }),
                      Q.jsx(PHt, {
                        children: Q.jsx(IHt, {
                          children: q4t.versions.map((e) =>
                            Q.jsxs(FHt, { value: e, children: ["V", e] }, e),
                          ),
                        }),
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "congestion_control",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.tuic.congestion_control.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    onValueChange: e.onChange,
                    value: e.value,
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.tuic.congestion_control.placeholder"),
                        }),
                      }),
                      Q.jsx(PHt, {
                        children: Q.jsx(IHt, {
                          children: q4t.congestionControls.map((e) =>
                            Q.jsx(FHt, { value: e, children: e.toUpperCase() }, e),
                          ),
                        }),
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        Q.jsxs("div", {
          className: "flex gap-2",
          children: [
            Q.jsx(Uy, {
              control: e.control,
              name: "tls.server_name",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  className: "flex-[2]",
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: t("dynamic_form.tuic.tls.server_name.label"),
                    }),
                    Q.jsx(Zy, {
                      children: Q.jsx(Q6e, {
                        className: "font-mono text-xs",
                        placeholder: t("dynamic_form.tuic.tls.server_name.placeholder"),
                        ...e,
                      }),
                    }),
                  ],
                }),
            }),
            Q.jsx(Uy, {
              control: e.control,
              name: "tls.allow_insecure",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: t("dynamic_form.tuic.tls.allow_insecure"),
                    }),
                    Q.jsx("div", {
                      className: "py-2 text-center",
                      children: Q.jsx(Zy, {
                        children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                      }),
                    }),
                  ],
                }),
            }),
          ],
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "alpn",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.tuic.tls.alpn.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsx(d4t, {
                    className: "font-mono text-xs",
                    options: q4t.alpnOptions,
                    onChange: (t) => e.onChange(t.map((e) => e.value)),
                    value: q4t.alpnOptions.filter((t) => e.value?.includes(t.value)),
                    placeholder: t("dynamic_form.tuic.tls.alpn.placeholder"),
                    emptyIndicator: Q.jsx("p", {
                      className: "text-center text-lg leading-10 text-gray-600 dark:text-gray-400",
                      children: t("dynamic_form.tuic.tls.alpn.empty"),
                    }),
                  }),
                }),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "udp_relay_mode",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.tuic.udp_relay_mode.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    onValueChange: e.onChange,
                    value: e.value,
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.tuic.udp_relay_mode.placeholder"),
                        }),
                      }),
                      Q.jsx(PHt, {
                        children: Q.jsx(IHt, {
                          children: q4t.udpRelayModes.map((e) =>
                            Q.jsx(FHt, { value: e.value, children: e.label }, e.value),
                          ),
                        }),
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
      ],
    }),
  G4t = (e, t) =>
    gy({
      padding_scheme: hy(ly()).optional().default([]),
      tls: gy({ server_name: ly().default(""), allow_insecure: dy().default(!1) }).default({}),
      cert_config: e.default({}),
      routing: t.optional().default({}),
    }),
  Z4t = [
    "stop=8",
    "0=30-30",
    "1=100-400",
    "2=400-500,c,500-1000,c,500-1000,c,500-1000,c,500-1000",
    "3=9-9,500-1000",
    "4=500-1000",
    "5=500-1000",
    "6=500-1000",
    "7=500-1000",
  ],
  Y4t = ({ form: e, t: t }) =>
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsxs("div", {
          className: "flex gap-2",
          children: [
            Q.jsx(Uy, {
              control: e.control,
              name: "tls.server_name",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  className: "flex-[2]",
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: t("dynamic_form.anytls.tls.server_name.label"),
                    }),
                    Q.jsx(Zy, {
                      children: Q.jsx(Q6e, {
                        className: "font-mono text-xs",
                        placeholder: t("dynamic_form.anytls.tls.server_name.placeholder"),
                        ...e,
                      }),
                    }),
                  ],
                }),
            }),
            Q.jsx(Uy, {
              control: e.control,
              name: "tls.allow_insecure",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: t("dynamic_form.anytls.tls.allow_insecure"),
                    }),
                    Q.jsx("div", {
                      className: "py-2 text-center",
                      children: Q.jsx(Zy, {
                        children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                      }),
                    }),
                  ],
                }),
            }),
          ],
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "padding_scheme",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsxs("div", {
                  className: "flex items-center justify-between",
                  children: [
                    Q.jsx(Gy, {
                      className: "text-[12px] font-mono text-foreground/80",
                      children: t("dynamic_form.anytls.padding_scheme.label"),
                    }),
                    Q.jsx(ltt, {
                      type: "button",
                      variant: "outline",
                      size: "sm",
                      className: "h-7 px-2 text-[10px]",
                      onClick: () => {
                        e.onChange(Z4t);
                      },
                      children: t("dynamic_form.anytls.padding_scheme.use_default"),
                    }),
                  ],
                }),
                Q.jsx("div", {
                  className: "text-[10px] text-muted-foreground font-mono mb-1",
                  children: t("dynamic_form.anytls.padding_scheme.description"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsx(_Gt, {
                    className: "font-mono text-xs min-h-[120px] resize-y",
                    ...e,
                    value: Array.isArray(e.value) ? e.value.join("\n") : e.value,
                    onChange: (t) => {
                      const n = t.target.value;
                      e.onChange(n.split("\n").filter((e) => "" !== e.trim()));
                    },
                    placeholder: t("dynamic_form.anytls.padding_scheme.placeholder"),
                  }),
                }),
              ],
            }),
        }),
      ],
    }),
  X4t = (e) => gy({ routing: e.optional().default({}) }),
  Q4t = ({ form: e }) => null,
  J4t = (e, t) =>
    gy({
      tls: by().default(0),
      tls_settings: gy({ server_name: ly().default(""), allow_insecure: dy().default(!1) }).default(
        {},
      ),
      cert_config: e.default({}),
      routing: t.optional().default({}),
    }),
  e5t = ({ form: e, t: t }) =>
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: "tls",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.http.tls.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    value: e.value?.toString(),
                    onValueChange: (t) => e.onChange(Number(t)),
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.http.tls.placeholder"),
                        }),
                      }),
                      Q.jsxs(PHt, {
                        children: [
                          Q.jsx(FHt, { value: "0", children: t("dynamic_form.http.tls.disabled") }),
                          Q.jsx(FHt, { value: "1", children: t("dynamic_form.http.tls.enabled") }),
                        ],
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        1 == e.watch("tls") &&
          Q.jsx(Q.Fragment, {
            children: Q.jsxs("div", {
              className: "flex gap-2",
              children: [
                Q.jsx(Uy, {
                  control: e.control,
                  name: "tls_settings.server_name",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      className: "flex-[2]",
                      children: [
                        Q.jsx(Gy, {
                          className: "text-[12px] font-mono text-foreground/80",
                          children: t("dynamic_form.http.tls_settings.server_name.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            className: "font-mono text-xs",
                            placeholder: t(
                              "dynamic_form.http.tls_settings.server_name.placeholder",
                            ),
                            ...e,
                          }),
                        }),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: e.control,
                  name: "tls_settings.allow_insecure",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-[12px] font-mono text-foreground/80",
                          children: t("dynamic_form.http.tls_settings.allow_insecure"),
                        }),
                        Q.jsx("div", {
                          className: "py-2 text-center",
                          children: Q.jsx(Zy, {
                            children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                          }),
                        }),
                      ],
                    }),
                }),
              ],
            }),
          }),
      ],
    }),
  t5t = (e, t) =>
    gy({
      tls: by().default(0),
      tls_settings: gy({ server_name: ly().default(""), allow_insecure: dy().default(!1) }).default(
        {},
      ),
      cert_config: e.default({}),
      routing: t.optional().default({}),
    }),
  n5t = ({ form: e, t: t }) =>
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: "tls",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.naive.tls.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    value: e.value?.toString(),
                    onValueChange: (t) => e.onChange(Number(t)),
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.naive.tls.placeholder"),
                        }),
                      }),
                      Q.jsxs(PHt, {
                        children: [
                          Q.jsx(FHt, {
                            value: "0",
                            children: t("dynamic_form.naive.tls.disabled"),
                          }),
                          Q.jsx(FHt, { value: "1", children: t("dynamic_form.naive.tls.enabled") }),
                        ],
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        1 == e.watch("tls") &&
          Q.jsx(Q.Fragment, {
            children: Q.jsxs("div", {
              className: "flex gap-2",
              children: [
                Q.jsx(Uy, {
                  control: e.control,
                  name: "tls_settings.server_name",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      className: "flex-[2]",
                      children: [
                        Q.jsx(Gy, {
                          className: "text-[12px] font-mono text-foreground/80",
                          children: t("dynamic_form.naive.tls_settings.server_name.label"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            className: "font-mono text-xs",
                            placeholder: t(
                              "dynamic_form.naive.tls_settings.server_name.placeholder",
                            ),
                            ...e,
                          }),
                        }),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: e.control,
                  name: "tls_settings.allow_insecure",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, {
                          className: "text-[12px] font-mono text-foreground/80",
                          children: t("dynamic_form.naive.tls_settings.allow_insecure"),
                        }),
                        Q.jsx("div", {
                          className: "py-2 text-center",
                          children: Q.jsx(Zy, {
                            children: Q.jsx(mGt, { checked: e.value, onCheckedChange: e.onChange }),
                          }),
                        }),
                      ],
                    }),
                }),
              ],
            }),
          }),
      ],
    }),
  i5t = (e) =>
    gy({
      transport: ly().default("TCP"),
      traffic_pattern: ly().default(""),
      routing: e.optional().default({}),
    }),
  r5t = {
    transportOptions: [
      { value: "TCP", label: "TCP" },
      { value: "UDP", label: "UDP" },
    ],
  },
  o5t = ({ form: e, t: t }) =>
    Q.jsxs(Q.Fragment, {
      children: [
        Q.jsx(Uy, {
          control: e.control,
          name: "transport",
          render: ({ field: e }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.mieru.transport.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs(THt, {
                    onValueChange: e.onChange,
                    value: e.value,
                    children: [
                      Q.jsx(OHt, {
                        className: "font-mono text-xs",
                        children: Q.jsx(RHt, {
                          placeholder: t("dynamic_form.mieru.transport.placeholder"),
                        }),
                      }),
                      Q.jsx(PHt, {
                        hideWhenDetached: !0,
                        children: Q.jsx(IHt, {
                          children: r5t.transportOptions.map((e) =>
                            Q.jsx(FHt, { value: e.value, children: e.label }, e.value),
                          ),
                        }),
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
        Q.jsx(Uy, {
          control: e.control,
          name: "traffic_pattern",
          render: ({ field: n }) =>
            Q.jsxs(Ky, {
              children: [
                Q.jsx(Gy, {
                  className: "text-[12px] font-mono text-foreground/80",
                  children: t("dynamic_form.mieru.traffic_pattern.label"),
                }),
                Q.jsx(Zy, {
                  children: Q.jsxs("div", {
                    className: "flex gap-2",
                    children: [
                      Q.jsx(Q6e, {
                        className: "font-mono text-xs",
                        placeholder: t("dynamic_form.mieru.traffic_pattern.placeholder"),
                        ...n,
                      }),
                      Q.jsx(ltt, {
                        type: "button",
                        variant: "outline",
                        size: "icon",
                        className: "h-9 w-9 shrink-0",
                        onClick: () => {
                          const n = (() => {
                            const e = Math.floor(101 * Math.random()) + 100,
                              t = Math.floor(201 * Math.random()) + 400,
                              n = (e) => {
                                const t = [];
                                for (; e >= 128; ) (t.push((127 & e) | 128), (e >>>= 7));
                                return (t.push(e), t);
                              },
                              i = [8, ...n(e), 16, ...n(t)],
                              r = [10, ...n(i.length), ...i],
                              o = new Uint8Array(r);
                            let s = "";
                            for (let a = 0; a < o.byteLength; a++) s += String.fromCharCode(o[a]);
                            return window.btoa(s);
                          })();
                          (e.setValue("traffic_pattern", n),
                            hN.success(t("dynamic_form.mieru.traffic_pattern.success")));
                        },
                        children: Q.jsx(yYt, { icon: "lucide:rotate-cw", className: "h-4 w-4" }),
                      }),
                    ],
                  }),
                }),
              ],
            }),
        }),
      ],
    }),
  s5t = ((e, t) => ({
    shadowsocks: { schema: f4t(t), component: _4t },
    vmess: { schema: S4t(e, t), component: E4t },
    vless: { schema: P4t(e, t), component: F4t },
    hysteria: { schema: B4t(e, t), component: W4t },
    trojan: { schema: H4t(e, t), component: U4t },
    tuic: { schema: $4t(e, t), component: K4t },
    anytls: { schema: G4t(e, t), component: Y4t },
    socks: { schema: X4t(t), component: Q4t },
    http: { schema: J4t(e, t), component: e5t },
    naive: { schema: t5t(e, t), component: n5t },
    mieru: { schema: i5t(t), component: o5t },
  }))(
    gy({
      cert_mode: my(["http", "dns", "self", "file", "none"]).default("none"),
      domain: ly().optional().default(""),
      email: ly().optional().default(""),
      dns_provider: ly().optional().default(""),
      dns_env: fy(ly()).optional().default({}),
      http_port: by().optional().default(80),
      cert_content: ly().optional().default(""),
      key_content: ly().optional().default(""),
    }),
    gy({}),
  ),
  a5t = ({ serverType: e, value: t, onChange: n }) => {
    const { t: i } = Py("server"),
      r = H.useRef(n);
    r.current = n;
    const o = H.useRef(!1),
      s = e ? s5t[e] : null,
      a = H.useMemo(() => s?.schema || fy(uy()), [e]),
      l = kv({ resolver: Ov(a), defaultValues: a.parse({}), mode: "onChange" });
    if (
      (H.useEffect(() => {
        if (!t) return;
        const e = l.getValues();
        if (JSON.stringify(e) !== JSON.stringify(t)) {
          ((o.current = !0), l.reset(t));
          const e = () => {
            o.current = !1;
          };
          "function" == typeof queueMicrotask ? queueMicrotask(e) : setTimeout(e, 0);
        }
      }, [t, l]),
      H.useEffect(() => {
        const e = l.watch((e) => {
          o.current || r.current(e);
        });
        return () => e.unsubscribe();
      }, [l]),
      !e || !s)
    )
      return Q.jsx("div", {
        className: "py-8 text-center font-mono text-sm text-muted-foreground",
        children: i("form.type.not_supported") || "请选择协议类型",
      });
    const c = s.component;
    return Q.jsx(Pst, { children: Q.jsx(c, { form: l, t: i }) });
  };
function l5t({ form: e, certPath: t = "cert_config", hasMultiplex: n = !1 }) {
  const { t: i } = Py("server"),
    [r, o] = H.useState(!1),
    [s, a] = H.useState("cert"),
    l = !!t,
    c = t ? `${t}.cert_mode` : "cert_mode",
    d = t ? `${t}.domain` : "domain",
    u = t ? `${t}.email` : "email",
    h = t ? `${t}.dns_provider` : "dns_provider",
    g = t ? `${t}.dns_env` : "dns_env",
    p = t ? `${t}.http_port` : "http_port",
    f = t ? `${t}.cert_content` : "cert_content",
    m = t ? `${t}.key_content` : "key_content",
    _ = "custom_outbounds",
    v = "custom_routes",
    [b, y] = H.useState(""),
    [x, w] = H.useState(null),
    [C, S] = H.useState(""),
    [k, E] = H.useState(null),
    [N, L] = H.useState(""),
    D = e.watch(c),
    T = e.watch(_) || [],
    I = e.watch(v) || [],
    R = e.watch("protocol_settings.multiplex")?.enabled,
    O = (t = "cert") => {
      let i = t;
      ("cert" !== t || l
        ? "multiplex" !== t || n || (i = l ? "cert" : "outbounds")
        : (i = n ? "multiplex" : "outbounds"),
        a(i));
      const r = e.getValues(_),
        s = e.getValues(v);
      var c;
      (y(Array.isArray(r) && r.length > 0 ? JSON.stringify(r, null, 2) : ""),
        S(Array.isArray(s) && s.length > 0 ? JSON.stringify(s, null, 2) : ""),
        L(
          !(c = e.getValues(g)) || "object" != typeof c || Array.isArray(c)
            ? "string" == typeof c
              ? c
              : ""
            : Object.entries(c)
                .map(([e, t]) => `${e}=${t ?? ""}`)
                .join("\n"),
        ),
        w(null),
        E(null),
        o(!0));
    };
  return Q.jsxs("div", {
    className: "flex items-center gap-2",
    children: [
      Q.jsxs(ltt, {
        type: "button",
        variant: "secondary",
        size: "sm",
        onClick: () => O(l ? "cert" : n ? "multiplex" : "outbounds"),
        className:
          "flex h-7 items-center gap-2 rounded-md border border-border/50 bg-muted/50 px-2.5 font-mono text-[11px] transition-all hover:bg-muted",
        children: [
          Q.jsx(Zat, { className: "h-3 w-3 text-muted-foreground" }),
          Q.jsx("span", {
            className: "opacity-80",
            children: i("dynamic_form.advanced.trigger_label", "Advanced"),
          }),
          ((D && "none" !== D) || T.length > 0 || I.length > 0 || R) &&
            Q.jsxs("div", {
              className: "ml-1 flex items-center gap-1.5 border-l border-border/60 pl-2",
              children: [
                D &&
                  "none" !== D &&
                  Q.jsxs("div", {
                    className: "group/item flex items-center gap-1",
                    children: [
                      Q.jsx("div", {
                        className:
                          "h-1 w-1 rounded-full bg-primary shadow-[0_0_4px_rgba(var(--primary),0.5)]",
                      }),
                      Q.jsx("span", {
                        className: "text-[9px] font-bold tracking-tighter text-primary",
                        children: "TLS",
                      }),
                    ],
                  }),
                R &&
                  Q.jsxs("div", {
                    className: "group/item flex cursor-pointer items-center gap-1 hover:opacity-70",
                    onClick: (e) => {
                      (e.stopPropagation(), O("multiplex"));
                    },
                    children: [
                      Q.jsx("div", {
                        className:
                          "h-1 w-1 rounded-full bg-primary shadow-[0_0_4px_rgba(var(--primary),0.5)]",
                      }),
                      Q.jsx("span", {
                        className: "text-[9px] font-bold tracking-tighter text-primary",
                        children: "MUX",
                      }),
                    ],
                  }),
                (T.length > 0 || I.length > 0) &&
                  Q.jsxs("div", {
                    className: "group/item flex cursor-pointer items-center gap-1 hover:opacity-70",
                    onClick: (e) => {
                      (e.stopPropagation(), O("outbounds"));
                    },
                    children: [
                      Q.jsx("div", {
                        className:
                          "h-1 w-1 rounded-full bg-primary shadow-[0_0_4px_rgba(var(--primary),0.5)]",
                      }),
                      Q.jsx("span", {
                        className: "text-[9px] font-bold tracking-tighter text-primary",
                        children: "RT",
                      }),
                    ],
                  }),
              ],
            }),
        ],
      }),
      Q.jsx(Jet, {
        open: r,
        onOpenChange: o,
        children: Q.jsx(ttt, {
          className: "max-w-2xl gap-0 overflow-hidden p-0 sm:rounded-2xl",
          children: Q.jsxs(iw, {
            value: s,
            onValueChange: (e) => a(e),
            className: "w-full",
            children: [
              Q.jsxs(ntt, {
                className: "px-6 pb-2 pt-6",
                children: [
                  Q.jsx("div", {
                    className: "mb-2 flex items-center justify-between",
                    children: Q.jsx(rtt, {
                      className: "font-mono text-sm tracking-wide",
                      children: i(
                        "dynamic_form.advanced.dialog_title",
                        "Advanced Protocol Configuration",
                      ),
                    }),
                  }),
                  Q.jsxs(rw, {
                    className: "grid w-full rounded-lg bg-muted/50 p-1",
                    style: {
                      gridTemplateColumns: `repeat(${2 + (l ? 1 : 0) + (n ? 1 : 0)}, minmax(0, 1fr))`,
                    },
                    children: [
                      l &&
                        Q.jsx(ow, {
                          value: "cert",
                          className:
                            "text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",
                          children: i("dynamic_form.advanced.tls_tab", "TLS"),
                        }),
                      n &&
                        Q.jsx(ow, {
                          value: "multiplex",
                          className:
                            "text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",
                          children: i("dynamic_form.advanced.multiplex_tab", "Multiplex"),
                        }),
                      Q.jsx(ow, {
                        value: "outbounds",
                        className:
                          "text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",
                        children: i("dynamic_form.routing.outbounds_tab", "Outbounds"),
                      }),
                      Q.jsx(ow, {
                        value: "routes",
                        className:
                          "text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",
                        children: i("dynamic_form.routing.routes_tab", "Routes"),
                      }),
                    ],
                  }),
                ],
              }),
              Q.jsxs("div", {
                className: "max-h-[60vh] min-h-[350px] overflow-y-auto px-6 py-4",
                children: [
                  Q.jsx(sw, {
                    value: "multiplex",
                    className: "mt-0 space-y-4 duration-200 animate-in fade-in-50",
                    children: Q.jsx(C4t, { form: e, t: i, prefix: "protocol_settings.multiplex" }),
                  }),
                  Q.jsxs(sw, {
                    value: "cert",
                    className: "mt-0 space-y-4 duration-200 animate-in fade-in-50",
                    children: [
                      Q.jsx(Uy, {
                        control: e.control,
                        name: c,
                        render: ({ field: e }) =>
                          Q.jsxs(Ky, {
                            children: [
                              Q.jsx(Gy, {
                                className: "font-mono text-[11px] text-muted-foreground",
                                children: i(
                                  "dynamic_form.shadowsocks.cert_config.cert_mode.label",
                                  "证书模式",
                                ),
                              }),
                              Q.jsxs(THt, {
                                onValueChange: e.onChange,
                                value: e.value || "none",
                                children: [
                                  Q.jsx(Zy, {
                                    children: Q.jsx(OHt, {
                                      className: "font-mono text-xs",
                                      children: Q.jsx(RHt, { placeholder: "none" }),
                                    }),
                                  }),
                                  Q.jsxs(PHt, {
                                    children: [
                                      Q.jsx(FHt, { value: "none", children: "none" }),
                                      Q.jsx(FHt, { value: "http", children: "http-01 (ACME)" }),
                                      Q.jsx(FHt, { value: "dns", children: "dns-01 (ACME)" }),
                                      Q.jsx(FHt, { value: "self", children: "self-signed" }),
                                      Q.jsx(FHt, {
                                        value: "content",
                                        children: "content (Cert Push)",
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                              Q.jsxs(Yy, {
                                className: "font-mono text-[11px]",
                                children: [
                                  "self" === D &&
                                    i(
                                      "dynamic_form.shadowsocks.cert_config.cert_mode.self_description",
                                    ),
                                  "http" === D &&
                                    i(
                                      "dynamic_form.shadowsocks.cert_config.cert_mode.http_description",
                                    ),
                                  "dns" === D &&
                                    i(
                                      "dynamic_form.shadowsocks.cert_config.cert_mode.dns_description",
                                    ),
                                  "content" === D &&
                                    i(
                                      "dynamic_form.shadowsocks.cert_config.cert_mode.content_description",
                                    ),
                                  "none" === D &&
                                    i("dynamic_form.shadowsocks.cert_config.cert_mode.description"),
                                ],
                              }),
                            ],
                          }),
                      }),
                      ("http" === D || "dns" === D || "self" === D || "content" === D) &&
                        Q.jsxs(Q.Fragment, {
                          children: [
                            Q.jsx(Um, { className: "opacity-40" }),
                            Q.jsxs("div", {
                              className: "grid grid-cols-2 gap-4",
                              children: [
                                Q.jsx(Uy, {
                                  control: e.control,
                                  name: d,
                                  render: ({ field: e }) =>
                                    Q.jsxs(Ky, {
                                      children: [
                                        Q.jsx(Gy, {
                                          className: "font-mono text-[11px] text-muted-foreground",
                                          children: i(
                                            "dynamic_form.shadowsocks.cert_config.domain.label",
                                          ),
                                        }),
                                        Q.jsx(Zy, {
                                          children: Q.jsx(Q6e, {
                                            placeholder: "example.com",
                                            className: "font-mono text-xs",
                                            ...e,
                                            value: e.value || "",
                                          }),
                                        }),
                                      ],
                                    }),
                                }),
                                ("http" === D || "dns" === D) &&
                                  Q.jsx(Uy, {
                                    control: e.control,
                                    name: u,
                                    render: ({ field: e }) =>
                                      Q.jsxs(Ky, {
                                        children: [
                                          Q.jsx(Gy, {
                                            className:
                                              "font-mono text-[11px] text-muted-foreground",
                                            children: i(
                                              "dynamic_form.shadowsocks.cert_config.email.label",
                                            ),
                                          }),
                                          Q.jsx(Zy, {
                                            children: Q.jsx(Q6e, {
                                              placeholder: "admin@example.com",
                                              className: "font-mono text-xs",
                                              ...e,
                                              value: e.value || "",
                                            }),
                                          }),
                                        ],
                                      }),
                                  }),
                              ],
                            }),
                          ],
                        }),
                      "http" === D &&
                        Q.jsx(Uy, {
                          control: e.control,
                          name: p,
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              children: [
                                Q.jsx(Gy, {
                                  className: "font-mono text-[11px] text-muted-foreground",
                                  children: i(
                                    "dynamic_form.shadowsocks.cert_config.http_port.label",
                                  ),
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(Q6e, {
                                    type: "number",
                                    className: "font-mono text-xs",
                                    ...e,
                                  }),
                                }),
                                Q.jsx(Yy, {
                                  className: "font-mono text-[11px]",
                                  children: i(
                                    "dynamic_form.shadowsocks.cert_config.http_port.description",
                                  ),
                                }),
                              ],
                            }),
                        }),
                      "dns" === D &&
                        Q.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            Q.jsx(Uy, {
                              control: e.control,
                              name: h,
                              render: ({ field: e }) =>
                                Q.jsxs(Ky, {
                                  children: [
                                    Q.jsx(Gy, {
                                      className: "font-mono text-[11px] text-muted-foreground",
                                      children: i(
                                        "dynamic_form.shadowsocks.cert_config.dns_provider.label",
                                        "DNS Provider",
                                      ),
                                    }),
                                    Q.jsx(Zy, {
                                      children: Q.jsx(Q6e, {
                                        placeholder: "cloudflare / alidns / dnspod",
                                        className: "font-mono text-xs",
                                        ...e,
                                        value: e.value || "",
                                      }),
                                    }),
                                    Q.jsx(Yy, {
                                      className: "flex items-center gap-1 font-mono text-[11px]",
                                      children: Q.jsxs("a", {
                                        href: "https://go-acme.github.io/lego/dns/",
                                        target: "_blank",
                                        rel: "noopener noreferrer",
                                        className:
                                          "inline-flex items-center gap-1 text-primary hover:underline",
                                        children: [
                                          i(
                                            "dynamic_form.shadowsocks.cert_config.dns_provider.doc_link",
                                          ),
                                          Q.jsx(Sat, { className: "h-3 w-3" }),
                                        ],
                                      }),
                                    }),
                                  ],
                                }),
                            }),
                            Q.jsx(Uy, {
                              control: e.control,
                              name: g,
                              render: ({ field: e }) =>
                                Q.jsxs(Ky, {
                                  children: [
                                    Q.jsx(Gy, {
                                      className: "font-mono text-[11px] text-muted-foreground",
                                      children: i(
                                        "dynamic_form.shadowsocks.cert_config.dns_env.label",
                                      ),
                                    }),
                                    Q.jsx(Zy, {
                                      children: Q.jsx(_Gt, {
                                        placeholder:
                                          "CF_API_TOKEN=xxxxxx\nALIDNS_ACCESS_KEY_ID=xxxx",
                                        value: N,
                                        onChange: (t) => {
                                          const n = t.target.value;
                                          (L(n),
                                            e.onChange(
                                              (function (e) {
                                                const t = {};
                                                return (
                                                  e.split("\n").forEach((e) => {
                                                    const n = e.indexOf("=");
                                                    if (n <= 0) return;
                                                    const i = e.slice(0, n).trim();
                                                    i && (t[i] = e.slice(n + 1).trim());
                                                  }),
                                                  t
                                                );
                                              })(n),
                                            ));
                                        },
                                        className:
                                          "min-h-[100px] border-border/50 bg-muted/30 font-mono text-xs focus-visible:border-border focus-visible:ring-0",
                                        spellCheck: !1,
                                      }),
                                    }),
                                    Q.jsx(Yy, {
                                      className: "font-mono text-[11px]",
                                      children: i(
                                        "dynamic_form.shadowsocks.cert_config.dns_env.description_short",
                                      ),
                                    }),
                                  ],
                                }),
                            }),
                          ],
                        }),
                      "content" === D &&
                        Q.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            Q.jsx(Um, { className: "opacity-40" }),
                            Q.jsx(Uy, {
                              control: e.control,
                              name: f,
                              render: ({ field: e }) =>
                                Q.jsxs(Ky, {
                                  children: [
                                    Q.jsx(Gy, {
                                      className: "font-mono text-[11px] text-muted-foreground",
                                      children: i(
                                        "dynamic_form.shadowsocks.cert_config.cert_content.label",
                                      ),
                                    }),
                                    Q.jsx(Zy, {
                                      children: Q.jsx(_Gt, {
                                        placeholder: "-----BEGIN CERTIFICATE-----\n...",
                                        className:
                                          "min-h-[100px] border-border/50 bg-muted/30 font-mono text-xs focus-visible:border-border focus-visible:ring-0",
                                        spellCheck: !1,
                                        ...e,
                                        value: e.value || "",
                                      }),
                                    }),
                                  ],
                                }),
                            }),
                            Q.jsx(Uy, {
                              control: e.control,
                              name: m,
                              render: ({ field: e }) =>
                                Q.jsxs(Ky, {
                                  children: [
                                    Q.jsx(Gy, {
                                      className: "font-mono text-[11px] text-muted-foreground",
                                      children: i(
                                        "dynamic_form.shadowsocks.cert_config.key_content.label",
                                      ),
                                    }),
                                    Q.jsx(Zy, {
                                      children: Q.jsx(_Gt, {
                                        placeholder: "-----BEGIN RSA PRIVATE KEY-----\n...",
                                        className:
                                          "min-h-[100px] border-border/50 bg-muted/30 font-mono text-xs focus-visible:border-border focus-visible:ring-0",
                                        spellCheck: !1,
                                        ...e,
                                        value: e.value || "",
                                      }),
                                    }),
                                  ],
                                }),
                            }),
                          ],
                        }),
                      "none" === D &&
                        Q.jsxs("div", {
                          className: "flex flex-col items-center justify-center py-12 text-center",
                          children: [
                            Q.jsx("div", {
                              className:
                                "mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-muted",
                              children: Q.jsx(yYt, {
                                icon: "lucide:shield-off",
                                className: "h-6 w-6 text-muted-foreground/30",
                              }),
                            }),
                            Q.jsx("p", {
                              className: "font-mono text-xs text-muted-foreground",
                              children: i(
                                "dynamic_form.shadowsocks.cert_config.none_desc",
                                "未启用 TLS 证书配置",
                              ),
                            }),
                          ],
                        }),
                    ],
                  }),
                  Q.jsx(sw, {
                    value: "outbounds",
                    className: "mt-0 duration-200 animate-in fade-in-50",
                    children: Q.jsxs("div", {
                      className: "space-y-3",
                      children: [
                        Q.jsx("div", {
                          className: "flex items-center justify-between",
                          children: Q.jsx("label", {
                            className: "font-mono text-[11px] italic text-muted-foreground",
                            children: i("dynamic_form.routing.outbounds", "自定义Outbounds (JSON)"),
                          }),
                        }),
                        Q.jsx(_Gt, {
                          value: b,
                          onChange: (e) => y(e.target.value),
                          className:
                            "min-h-[300px] border-border/50 bg-muted/30 font-mono text-[11px] focus-visible:border-border focus-visible:ring-0 " +
                            (x ? "border-destructive" : ""),
                          placeholder: '[{"tag": "proxy", "protocol": "shadowsocks", ...}]',
                          spellCheck: !1,
                        }),
                        x &&
                          Q.jsx("p", {
                            className: "font-mono text-[10px] text-destructive",
                            children: x,
                          }),
                      ],
                    }),
                  }),
                  Q.jsx(sw, {
                    value: "routes",
                    className: "mt-0 duration-200 animate-in fade-in-50",
                    children: Q.jsxs("div", {
                      className: "space-y-3",
                      children: [
                        Q.jsx("div", {
                          className: "flex items-center justify-between",
                          children: Q.jsx("label", {
                            className: "font-mono text-[11px] italic text-muted-foreground",
                            children: i("dynamic_form.routing.routes", "自定义Routes (JSON)"),
                          }),
                        }),
                        Q.jsx(_Gt, {
                          value: C,
                          onChange: (e) => S(e.target.value),
                          className:
                            "min-h-[300px] border-border/50 bg-muted/30 font-mono text-[11px] focus-visible:border-border focus-visible:ring-0 " +
                            (k ? "border-destructive" : ""),
                          placeholder:
                            '[{"outboundTag": "proxy", "domain": ["domain:google.com"], ...}]',
                          spellCheck: !1,
                        }),
                        k &&
                          Q.jsx("p", {
                            className: "font-mono text-[10px] text-destructive",
                            children: k,
                          }),
                      ],
                    }),
                  }),
                ],
              }),
              Q.jsxs(itt, {
                className: "border-t bg-muted/20 px-6 py-4",
                children: [
                  Q.jsx(ltt, {
                    type: "button",
                    variant: "ghost",
                    onClick: () => o(!1),
                    className: "font-mono text-xs",
                    children: i("common.cancel", "Cancel"),
                  }),
                  Q.jsx(ltt, {
                    type: "button",
                    onClick: () => {
                      (() => {
                        let t = !1;
                        if (b.trim())
                          try {
                            const n = JSON.parse(b);
                            Array.isArray(n)
                              ? (e.setValue(_, n), w(null))
                              : (w(
                                  i(
                                    "dynamic_form.routing.error.must_be_array",
                                    "Must be a JSON array []",
                                  ),
                                ),
                                (t = !0));
                          } catch {
                            (w(i("dynamic_form.routing.error.invalid_json", "Invalid JSON format")),
                              (t = !0));
                          }
                        else (e.setValue(_, []), w(null));
                        if (C.trim())
                          try {
                            const n = JSON.parse(C);
                            Array.isArray(n)
                              ? (e.setValue(v, n), E(null))
                              : (E(
                                  i(
                                    "dynamic_form.routing.error.must_be_array",
                                    "Must be a JSON array []",
                                  ),
                                ),
                                (t = !0));
                          } catch {
                            (E(i("dynamic_form.routing.error.invalid_json", "Invalid JSON format")),
                              (t = !0));
                          }
                        else (e.setValue(v, []), E(null));
                        return !t;
                      })() && o(!1);
                    },
                    className: "px-8 font-mono text-xs",
                    children: i("common.save", "Save"),
                  }),
                ],
              }),
            ],
          }),
        }),
      }),
    ],
  });
}
function c5t() {
  const { t: e } = Py("server"),
    t = gy({
      start: ly().min(1, e("form.dynamic_rate.start_time_error")),
      end: ly().min(1, e("form.dynamic_rate.end_time_error")),
      rate: ly()
        .min(1, e("form.dynamic_rate.multiplier_error"))
        .refine((e) => !isNaN(parseFloat(e)) && isFinite(Number(e)), {
          message: e("form.dynamic_rate.multiplier_error_numeric"),
        })
        .refine((e) => parseFloat(e) >= 0, {
          message: e("form.dynamic_rate.multiplier_error_gte_zero"),
        }),
    }),
    n = gy({
      id: cy().optional().nullable(),
      specific_key: ly().optional().nullable(),
      code: ly().optional(),
      show: dy().optional().nullable(),
      name: ly().min(1, e("form.name.error")),
      rate: ly()
        .min(1, e("form.rate.error"))
        .refine((e) => !isNaN(parseFloat(e)) && isFinite(Number(e)), {
          message: e("form.rate.error_numeric"),
        })
        .refine((e) => parseFloat(e) >= 0, { message: e("form.rate.error_gte_zero") }),
      rate_time_enable: dy().default(!1),
      rate_time_ranges: hy(t).default([]),
      tags: hy(ly()).default([]),
      transfer_enable_gb: ly().optional().default(""),
      excludes: hy(ly()).default([]),
      ips: hy(ly()).default([]),
      group_ids: hy(ly()).default([]),
      host: ly().min(1, e("form.host.error")),
      port: ly().min(1, e("form.port.error")),
      server_port: ly().min(1, e("form.server_port.error")),
      parent_id: ly().default("0").nullable(),
      route_ids: hy(ly()).default([]),
      custom_outbounds: hy(uy()).default([]),
      custom_routes: hy(uy()).default([]),
      protocol_settings: fy(uy()).default({}).nullable(),
      listen_address: ly().optional().default(""),
    }),
    i = H.useMemo(
      () => ({
        id: null,
        specific_key: null,
        code: "",
        show: !1,
        name: "",
        rate: "1",
        rate_time_enable: !1,
        rate_time_ranges: [],
        tags: [],
        transfer_enable_gb: "",
        banned: !1,
        excludes: [],
        ips: [],
        group_ids: [],
        host: "",
        port: "",
        server_port: "",
        parent_id: "0",
        route_ids: [],
        custom_outbounds: [],
        custom_routes: [],
        protocol_settings: {},
        listen_address: "",
      }),
      [],
    ),
    {
      isOpen: r,
      setIsOpen: o,
      editingServer: s,
      setEditingServer: a,
      serverType: l,
      setServerType: c,
      openNewNode: d,
      refetch: u,
    } = p4t(),
    [h, g] = H.useState([]),
    [p, f] = H.useState([]),
    [m, _] = H.useState([]),
    v = kv({ resolver: Ov(n), defaultValues: i, mode: "onChange" }),
    b = T_({ control: v.control, name: "protocol_settings" }),
    y = H.useRef(new Map()),
    T = H.useRef(0),
    x = H.useCallback(async () => {
      if (!r) return;
      const [e, t, n] = await Promise.all([eD(), rD(), UL()]);
      (g(
        e.data?.filter((e) => e.id).map((e) => ({ label: e.name || "", value: e.id.toString() })) ||
          [],
      ),
        f(
          t.data
            ?.filter((e) => e.id)
            .map((e) => ({ label: e.remarks || "", value: e.id.toString() })) || [],
        ),
        _(n.data || []));
    }, [r]);
  (H.useEffect(() => {
    x();
  }, [x]),
    H.useEffect(() => {
      r && s && (T.current = Date.now());
    }, [r, s]),
    H.useEffect(() => {
      if (s) {
        const e =
            "string" == typeof s.protocol_settings
              ? JSON.parse(s.protocol_settings)
              : (s.protocol_settings ?? {}),
          t = s.transfer_enable || 0,
          n = t ? (t / 1073741824).toFixed(2) : "0";
        (v.reset({ ...i, ...s, transfer_enable_gb: n, protocol_settings: e }),
          s.type && y.current.set(s.type, e),
          s.type && c(s.type));
      } else (y.current.clear(), v.reset(i));
    }, [s, v, i, c]));
  const w = H.useMemo(
      () =>
        m?.filter(
          (e) =>
            (0 === e.parent_id || null === e.parent_id) && e.type === l && e.id !== v.watch("id"),
        ),
      [l, m, v],
    ),
    C = H.useCallback(() => {
      if (!l) return;
      const e = v.getValues("protocol_settings") ?? {};
      y.current.set(l, e);
    }, [v, l]),
    S = H.useCallback((e) => y.current.get(e) ?? {}, []),
    k = H.useCallback(
      (e) => {
        (l && y.current.set(l, e),
          v.setValue("protocol_settings", e, {
            shouldDirty: !0,
            shouldTouch: !0,
            shouldValidate: !0,
          }));
      },
      [v, l],
    ),
    E = (e) => {
      if (e) {
        s && (T.current = Date.now());
        o(!0);
        return;
      }
      if (s && Date.now() - T.current < 250) return;
      (o(!1), a(null), v.reset(i));
    };
  return Q.jsxs(Jet, {
    open: r,
    onOpenChange: E,
    children: [
      Q.jsxs(Nm, {
        variant: "outline",
        size: "sm",
        className: "space-x-2",
        onClick: d,
        children: [Q.jsx(yYt, { icon: "ion:add" }), Q.jsx("div", { children: e("form.add_node") })],
      }),
      Q.jsxs(ttt, {
        className: "max-w-xl gap-0 overflow-hidden p-0 sm:rounded-2xl",
        children: [
          Q.jsxs(ntt, {
            className: "border-b bg-muted/20 px-6 pb-4 pt-6",
            children: [
              Q.jsxs("div", {
                className: "flex items-center justify-between pr-8",
                children: [
                  Q.jsxs("div", {
                    className: "flex items-center gap-3",
                    children: [
                      Q.jsx(rtt, {
                        className: "font-mono text-lg tracking-tight",
                        children: e(s ? "form.edit_node" : "form.new_node"),
                      }),
                      l &&
                        Q.jsx("span", {
                          className: "rounded px-2 py-0.5 font-mono text-xs text-white",
                          style: { background: f$t[l] },
                          children: p$t.find((e) => e.type === l)?.label || l,
                        }),
                    ],
                  }),
                  Q.jsxs(THt, {
                    value: l || "",
                    onValueChange: (e) => {
                      const t = e;
                      (C(), v.setValue("protocol_settings", S(t)), c(t));
                    },
                    children: [
                      Q.jsx(OHt, {
                        className: "h-8 w-[150px] border-2 font-mono text-xs",
                        children: Q.jsx(RHt, { placeholder: e("form.type.placeholder") }),
                      }),
                      Q.jsx(PHt, {
                        children: p$t.map(({ type: e, label: t }) =>
                          Q.jsx(
                            FHt,
                            {
                              value: e,
                              className: "cursor-pointer font-mono text-xs",
                              children: Q.jsxs("div", {
                                className: "flex items-center gap-2",
                                children: [
                                  Q.jsx("span", {
                                    className: "h-2.5 w-2.5 rounded-full",
                                    style: { background: f$t[e] },
                                  }),
                                  t,
                                ],
                              }),
                            },
                            e,
                          ),
                        ),
                      }),
                    ],
                  }),
                ],
              }),
              Q.jsx(ott, {
                className: "font-mono text-xs opacity-70",
                children: e("manage.description"),
              }),
            ],
          }),
          Q.jsxs(Hy, {
            ...v,
            children: [
              Q.jsx("div", {
                className: "flex h-[75vh] min-h-[500px] flex-col",
                children: Q.jsxs("div", {
                  className: "flex-1 space-y-8 overflow-y-auto px-6 py-6",
                  children: [
                    Q.jsxs("div", {
                      className: "space-y-4",
                      children: [
                        Q.jsxs("div", {
                          className: "flex gap-4",
                          children: [
                            Q.jsx(Uy, {
                              control: v.control,
                              name: "name",
                              render: ({ field: t }) =>
                                Q.jsxs(Ky, {
                                  className: "flex-[2]",
                                  children: [
                                    Q.jsx(Gy, {
                                      className: "font-mono text-[12px] text-foreground/80",
                                      children: e("form.name.label"),
                                    }),
                                    Q.jsx(Zy, {
                                      children: Q.jsx(Q6e, {
                                        placeholder: e("form.name.placeholder"),
                                        className: "h-9 font-mono text-xs",
                                        ...t,
                                      }),
                                    }),
                                    Q.jsx(Xy, {}),
                                  ],
                                }),
                            }),
                            Q.jsx(Uy, {
                              control: v.control,
                              name: "rate",
                              render: ({ field: t }) => {
                                const n =
                                  "0" != v.watch("parent_id") && null !== v.watch("parent_id");
                                return Q.jsxs(Ky, {
                                  className: "flex-[1]",
                                  children: [
                                    Q.jsx("div", {
                                      className: "relative",
                                      children: Q.jsx(Gy, {
                                        className: "font-mono text-[12px] text-foreground/80",
                                        children: e("form.rate.label"),
                                      }),
                                    }),
                                    Q.jsx(Zy, {
                                      children: Q.jsxs("div", {
                                        className: "relative",
                                        children: [
                                          Q.jsx(Q6e, {
                                            type: "number",
                                            min: "0",
                                            step: "0.1",
                                            ...t,
                                            disabled: n,
                                            className:
                                              "h-9 pr-8 font-mono text-xs " +
                                              (n ? "cursor-not-allowed bg-muted/50" : ""),
                                          }),
                                          Q.jsx("span", {
                                            className:
                                              "absolute right-2.5 top-1/2 -translate-y-1/2 font-mono text-[10px] text-muted-foreground",
                                            children: "x",
                                          }),
                                          n &&
                                            Q.jsx("div", {
                                              className:
                                                "absolute right-2 top-1/2 hidden -translate-y-1/2",
                                              children: Q.jsx(yYt, {
                                                icon: "ph:lock-simple",
                                                className: "size-4 text-muted-foreground/60",
                                              }),
                                            }),
                                        ],
                                      }),
                                    }),
                                    Q.jsx(Xy, {}),
                                  ],
                                });
                              },
                            }),
                          ],
                        }),
                        "0" != v.watch("parent_id") &&
                          null !== v.watch("parent_id") &&
                          Q.jsxs("div", {
                            className:
                              "ml-auto flex w-fit items-center gap-1 text-xs text-muted-foreground",
                            children: [
                              Q.jsx(yYt, { icon: "ph:info", className: "size-3" }),
                              e("form.rate.child_node_note"),
                            ],
                          }),
                      ],
                    }),
                    Q.jsx(Uy, {
                      control: v.control,
                      name: "rate_time_enable",
                      render: ({ field: t }) =>
                        Q.jsxs(Ky, {
                          children: [
                            Q.jsxs("div", {
                              className: "flex items-center justify-between",
                              children: [
                                Q.jsxs("div", {
                                  children: [
                                    Q.jsx(Gy, {
                                      className: "font-mono text-[12px] text-foreground/80",
                                      children: e("form.dynamic_rate.enable_label"),
                                    }),
                                    Q.jsx("div", {
                                      className: "font-mono text-[11px] opacity-70",
                                      children: e("form.dynamic_rate.enable_description"),
                                    }),
                                  ],
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(mGt, {
                                    checked: t.value,
                                    onCheckedChange: t.onChange,
                                    className: "scale-90",
                                  }),
                                }),
                              ],
                            }),
                            Q.jsx(Xy, {}),
                          ],
                        }),
                    }),
                    v.watch("rate_time_enable") &&
                      Q.jsxs("div", {
                        className: "space-y-3 rounded-xl border bg-muted/5 p-4",
                        children: [
                          Q.jsxs("div", {
                            className: "flex items-center justify-between",
                            children: [
                              Q.jsx(Gy, {
                                className: "font-mono text-[12px] text-foreground/80",
                                children: e("form.dynamic_rate.rules_label"),
                              }),
                              Q.jsxs(Nm, {
                                type: "button",
                                variant: "outline",
                                size: "sm",
                                className: "h-7 px-2 font-mono text-[10px]",
                                onClick: () => {
                                  const e = v.getValues("rate_time_ranges") || [];
                                  v.setValue("rate_time_ranges", [
                                    ...e,
                                    { start: "00:00", end: "23:59", rate: "1" },
                                  ]);
                                },
                                children: [
                                  Q.jsx(yYt, { icon: "ion:add", className: "mr-1 size-3" }),
                                  e("form.dynamic_rate.add_rule"),
                                ],
                              }),
                            ],
                          }),
                          (v.watch("rate_time_ranges") || []).map((t, n) =>
                            Q.jsxs(
                              "div",
                              {
                                className: "space-y-3 rounded-lg border bg-background p-3",
                                children: [
                                  Q.jsxs("div", {
                                    className: "flex items-center justify-between",
                                    children: [
                                      Q.jsx("span", {
                                        className: "font-mono text-[11px] font-bold",
                                        children: e("form.dynamic_rate.rule_title", {
                                          index: n + 1,
                                        }),
                                      }),
                                      Q.jsx(Nm, {
                                        type: "button",
                                        variant: "ghost",
                                        size: "icon",
                                        className:
                                          "size-7 text-muted-foreground hover:text-destructive",
                                        onClick: () => {
                                          const e = v.getValues("rate_time_ranges") || [];
                                          (e.splice(n, 1), v.setValue("rate_time_ranges", [...e]));
                                        },
                                        children: Q.jsx(yYt, {
                                          icon: "ion:trash-outline",
                                          className: "size-3.5",
                                        }),
                                      }),
                                    ],
                                  }),
                                  Q.jsxs("div", {
                                    className: "grid grid-cols-3 gap-3",
                                    children: [
                                      Q.jsx(Uy, {
                                        control: v.control,
                                        name: `rate_time_ranges.${n}.start`,
                                        render: ({ field: t }) =>
                                          Q.jsxs(Ky, {
                                            children: [
                                              Q.jsx(Gy, {
                                                className:
                                                  "font-mono text-[11px] text-foreground/80",
                                                children: e("form.dynamic_rate.start_time"),
                                              }),
                                              Q.jsx(Zy, {
                                                children: Q.jsx(Q6e, {
                                                  type: "time",
                                                  ...t,
                                                  className: "h-8 px-2 font-mono text-xs",
                                                }),
                                              }),
                                              Q.jsx(Xy, {}),
                                            ],
                                          }),
                                      }),
                                      Q.jsx(Uy, {
                                        control: v.control,
                                        name: `rate_time_ranges.${n}.end`,
                                        render: ({ field: t }) =>
                                          Q.jsxs(Ky, {
                                            children: [
                                              Q.jsx(Gy, {
                                                className:
                                                  "font-mono text-[11px] text-foreground/80",
                                                children: e("form.dynamic_rate.end_time"),
                                              }),
                                              Q.jsx(Zy, {
                                                children: Q.jsx(Q6e, {
                                                  type: "time",
                                                  ...t,
                                                  className: "h-8 px-2 font-mono text-xs",
                                                }),
                                              }),
                                              Q.jsx(Xy, {}),
                                            ],
                                          }),
                                      }),
                                      Q.jsx(Uy, {
                                        control: v.control,
                                        name: `rate_time_ranges.${n}.rate`,
                                        render: ({ field: t }) =>
                                          Q.jsxs(Ky, {
                                            children: [
                                              Q.jsx(Gy, {
                                                className:
                                                  "font-mono text-[11px] text-foreground/80",
                                                children: e("form.dynamic_rate.multiplier"),
                                              }),
                                              Q.jsx(Zy, {
                                                children: Q.jsx(Q6e, {
                                                  type: "number",
                                                  min: "0",
                                                  step: "0.1",
                                                  ...t,
                                                  className: "h-8 px-2 font-mono text-xs",
                                                  placeholder: "1.0",
                                                }),
                                              }),
                                              Q.jsx(Xy, {}),
                                            ],
                                          }),
                                      }),
                                    ],
                                  }),
                                ],
                              },
                              n,
                            ),
                          ),
                          0 === (v.watch("rate_time_ranges") || []).length &&
                            Q.jsx("div", {
                              className:
                                "py-4 text-center font-mono text-[10px] italic text-muted-foreground",
                              children: e("form.dynamic_rate.no_rules"),
                            }),
                        ],
                      }),
                    Q.jsxs("div", {
                      className: "flex gap-3",
                      children: [
                        Q.jsx(Uy, {
                          control: v.control,
                          name: "transfer_enable_gb",
                          render: ({ field: t }) =>
                            Q.jsxs(Ky, {
                              className: "flex-1 space-y-1",
                              children: [
                                Q.jsxs(Gy, {
                                  className: "font-mono text-[11px] text-muted-foreground",
                                  children: [
                                    e("form.traffic_limit.label"),
                                    Q.jsx("span", {
                                      className: "ml-1 text-[9px]",
                                      children: "(GB)",
                                    }),
                                  ],
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(Q6e, {
                                    type: "number",
                                    min: "0",
                                    step: "1",
                                    placeholder: e("form.traffic_limit.placeholder"),
                                    ...t,
                                    value: t.value || "",
                                    className: "h-8 font-mono text-xs",
                                  }),
                                }),
                                Q.jsx(Xy, { className: "text-[10px]" }),
                              ],
                            }),
                        }),
                        Q.jsx(Uy, {
                          control: v.control,
                          name: "code",
                          render: ({ field: t }) =>
                            Q.jsxs(Ky, {
                              className: "flex-1 space-y-1",
                              children: [
                                Q.jsxs(Gy, {
                                  className: "font-mono text-[11px] text-muted-foreground",
                                  children: [
                                    e("form.code.label"),
                                    Q.jsxs("span", {
                                      className: "ml-1 text-[9px]",
                                      children: ["(", e("form.code.optional"), ")"],
                                    }),
                                  ],
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(Q6e, {
                                    placeholder: e("form.code.placeholder"),
                                    className: "h-8 font-mono text-xs",
                                    ...t,
                                    value: t.value || "",
                                  }),
                                }),
                                Q.jsx(Xy, { className: "text-[10px]" }),
                              ],
                            }),
                        }),
                      ],
                    }),
                    Q.jsx(Uy, {
                      control: v.control,
                      name: "tags",
                      render: ({ field: t }) =>
                        Q.jsxs(Ky, {
                          children: [
                            Q.jsx(Gy, {
                              className: "font-mono text-[12px] text-foreground/80",
                              children: e("form.tags.label"),
                            }),
                            Q.jsx(Zy, {
                              children: Q.jsx(t0t, {
                                value: t.value,
                                onChange: t.onChange,
                                placeholder: e("form.tags.placeholder"),
                                className: "min-h-9 w-full font-mono text-xs",
                              }),
                            }),
                            Q.jsx(Xy, {}),
                          ],
                        }),
                    }),
                    Q.jsx(Uy, {
                      control: v.control,
                      name: "group_ids",
                      render: ({ field: t }) =>
                        Q.jsxs(Ky, {
                          children: [
                            Q.jsxs(Gy, {
                              className:
                                "flex items-center justify-between font-mono text-[12px] text-foreground/80",
                              children: [
                                e("form.groups.label"),
                                Q.jsx(h4t, {
                                  dialogTrigger: Q.jsx(Nm, {
                                    variant: "link",
                                    className: "h-auto p-0 font-mono text-[11px]",
                                    children: e("form.groups.add"),
                                  }),
                                  refetch: x,
                                }),
                              ],
                            }),
                            Q.jsx(Zy, {
                              children: Q.jsx(d4t, {
                                options: h,
                                onChange: (e) => t.onChange(e.map((e) => e.value)),
                                value: h?.filter((e) => (t.value ?? []).includes(e.value)),
                                placeholder: e("form.groups.placeholder"),
                                className: "font-mono text-xs",
                                emptyIndicator: Q.jsx("p", {
                                  className:
                                    "text-center font-mono text-xs leading-10 text-muted-foreground",
                                  children: e("form.groups.empty"),
                                }),
                              }),
                            }),
                            Q.jsx(Xy, {}),
                          ],
                        }),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-4",
                      children: [
                        Q.jsx("div", {
                          className: "flex space-x-2",
                          children: Q.jsx(Uy, {
                            control: v.control,
                            name: "host",
                            render: ({ field: t }) =>
                              Q.jsxs(Ky, {
                                className: "flex-1",
                                children: [
                                  Q.jsx(Gy, {
                                    className: "font-mono text-[12px] text-foreground/80",
                                    children: e("form.host.label"),
                                  }),
                                  Q.jsx(Zy, {
                                    children: Q.jsx(Q6e, {
                                      placeholder: e("form.host.placeholder"),
                                      className: "h-9 font-mono text-xs",
                                      ...t,
                                    }),
                                  }),
                                  Q.jsx(Xy, {}),
                                ],
                              }),
                          }),
                        }),
                        Q.jsxs("div", {
                          className: "flex space-x-2",
                          children: [
                            Q.jsx(Uy, {
                              control: v.control,
                              name: "port",
                              render: ({ field: t }) =>
                                Q.jsxs(Ky, {
                                  className: "flex-1",
                                  children: [
                                    Q.jsxs(Gy, {
                                      className:
                                        "flex items-center gap-1.5 font-mono text-[12px] text-foreground/80",
                                      children: [
                                        e("form.port.label"),
                                        Q.jsx(Pst, {
                                          delayDuration: 100,
                                          children: Q.jsxs(jst, {
                                            children: [
                                              Q.jsx(Fst, {
                                                asChild: !0,
                                                children: Q.jsx(yYt, {
                                                  icon: "ph:info-light",
                                                  className: "size-3.5 cursor-help opacity-70",
                                                }),
                                              }),
                                              Q.jsx(Mst, {
                                                children: Q.jsx(Bst, {
                                                  side: "top",
                                                  sideOffset: 8,
                                                  className: "max-w-80 p-3 font-mono text-[11px]",
                                                  children: Q.jsx("p", {
                                                    children: e("form.port.tooltip"),
                                                  }),
                                                }),
                                              }),
                                            ],
                                          }),
                                        }),
                                      ],
                                    }),
                                    Q.jsxs("div", {
                                      className: "flex items-center gap-1",
                                      children: [
                                        Q.jsx(Zy, {
                                          children: Q.jsx(Q6e, {
                                            placeholder: e("form.port.placeholder"),
                                            className: "h-9 font-mono text-xs",
                                            ...t,
                                          }),
                                        }),
                                        Q.jsx(Pst, {
                                          delayDuration: 100,
                                          children: Q.jsxs(jst, {
                                            children: [
                                              Q.jsx(Fst, {
                                                asChild: !0,
                                                children: Q.jsx(Nm, {
                                                  type: "button",
                                                  variant: "ghost",
                                                  size: "icon",
                                                  className:
                                                    "size-6 shrink-0 text-muted-foreground/50 hover:text-muted-foreground",
                                                  onClick: () => {
                                                    const e = t.value;
                                                    e && v.setValue("server_port", e);
                                                  },
                                                  children: Q.jsx(yYt, {
                                                    icon: "tabler:arrows-right",
                                                    className: "size-3",
                                                  }),
                                                }),
                                              }),
                                              Q.jsx(Bst, {
                                                side: "right",
                                                className: "font-mono text-[11px]",
                                                children: Q.jsx("p", {
                                                  children: e("form.port.sync"),
                                                }),
                                              }),
                                            ],
                                          }),
                                        }),
                                      ],
                                    }),
                                    Q.jsx(Xy, {}),
                                  ],
                                }),
                            }),
                            Q.jsx(Uy, {
                              control: v.control,
                              name: "server_port",
                              render: ({ field: t }) =>
                                Q.jsxs(Ky, {
                                  className: "flex-1",
                                  children: [
                                    Q.jsxs(Gy, {
                                      className:
                                        "flex items-center gap-1.5 font-mono text-[12px] text-foreground/80",
                                      children: [
                                        e("form.server_port.label"),
                                        Q.jsx(Pst, {
                                          delayDuration: 100,
                                          children: Q.jsxs(jst, {
                                            children: [
                                              Q.jsx(Fst, {
                                                asChild: !0,
                                                children: Q.jsx(yYt, {
                                                  icon: "ph:info-light",
                                                  className: "size-3.5 cursor-help opacity-70",
                                                }),
                                              }),
                                              Q.jsx(Mst, {
                                                children: Q.jsx(Bst, {
                                                  side: "top",
                                                  sideOffset: 8,
                                                  className: "max-w-80 p-3 font-mono text-[11px]",
                                                  children: Q.jsx("p", {
                                                    children: e("form.server_port.tooltip"),
                                                  }),
                                                }),
                                              }),
                                            ],
                                          }),
                                        }),
                                      ],
                                    }),
                                    Q.jsx(Zy, {
                                      children: Q.jsx(Q6e, {
                                        placeholder: e("form.server_port.placeholder"),
                                        className: "h-9 font-mono text-xs",
                                        ...t,
                                      }),
                                    }),
                                    Q.jsx(Xy, {}),
                                  ],
                                }),
                            }),
                          ],
                        }),
                      ],
                    }),
                    r &&
                      (l
                        ? Q.jsx(a5t, { serverType: l, value: b, onChange: k })
                        : Q.jsx("div", {
                            className:
                              "flex items-center justify-center py-12 text-muted-foreground",
                            children: Q.jsxs("div", {
                              className: "text-center",
                              children: [
                                Q.jsx(yYt, {
                                  icon: "ph:info",
                                  className: "mx-auto mb-2 size-8 opacity-50",
                                }),
                                Q.jsx("p", {
                                  className: "font-mono text-sm",
                                  children: e("form.type.select_prompt"),
                                }),
                              ],
                            }),
                          })),
                    Q.jsx(Uy, {
                      control: v.control,
                      name: "parent_id",
                      render: ({ field: t }) =>
                        Q.jsxs(Ky, {
                          children: [
                            Q.jsx(Gy, {
                              className: "font-mono text-[12px] text-foreground/80",
                              children: e("form.parent.label"),
                            }),
                            Q.jsxs(THt, {
                              onValueChange: t.onChange,
                              value: t.value?.toString() || "0",
                              children: [
                                Q.jsx(Zy, {
                                  children: Q.jsx(OHt, {
                                    className: "h-9 font-mono text-xs",
                                    children: Q.jsx(RHt, {
                                      placeholder: e("form.parent.placeholder"),
                                    }),
                                  }),
                                }),
                                Q.jsxs(PHt, {
                                  className: "font-mono text-xs",
                                  children: [
                                    Q.jsx(FHt, {
                                      value: "0",
                                      className: "text-xs",
                                      children: e("form.parent.none"),
                                    }),
                                    w?.map((e) =>
                                      Q.jsx(
                                        FHt,
                                        {
                                          value: e.id.toString(),
                                          className: "cursor-pointer text-xs",
                                          children: e.name,
                                        },
                                        e.id,
                                      ),
                                    ),
                                  ],
                                }),
                              ],
                            }),
                            Q.jsx(Xy, {}),
                          ],
                        }),
                    }),
                    Q.jsx(Uy, {
                      control: v.control,
                      name: "route_ids",
                      render: ({ field: t }) =>
                        Q.jsxs(Ky, {
                          children: [
                            Q.jsx(Gy, {
                              className: "font-mono text-[12px] text-foreground/80",
                              children: e("form.route.label"),
                            }),
                            Q.jsx(Zy, {
                              children: Q.jsx(d4t, {
                                options: p,
                                onChange: (e) => t.onChange(e.map((e) => e.value)),
                                value: p?.filter((e) => (t.value ?? []).includes(e.value)),
                                placeholder: e("form.route.placeholder"),
                                className: "font-mono text-xs",
                                emptyIndicator: Q.jsx("p", {
                                  className:
                                    "text-center font-mono text-xs leading-10 text-muted-foreground",
                                  children: e("form.route.empty"),
                                }),
                              }),
                            }),
                            Q.jsx(Xy, {}),
                          ],
                        }),
                    }),
                  ],
                }),
              }),
              Q.jsxs(itt, {
                className:
                  "flex flex-row items-center justify-between border-t bg-muted/20 px-6 py-4 sm:space-x-0",
                children: [
                  Q.jsx("div", {
                    className: "flex items-center gap-2",
                    children:
                      r &&
                      l &&
                      Q.jsx(l5t, {
                        form: v,
                        certPath:
                          "cert_config" in (s5t[l]?.schema?.shape || {}) ? "cert_config" : void 0,
                        hasMultiplex: "multiplex" in (s5t[l]?.schema?.shape || {}),
                      }),
                  }),
                  Q.jsxs("div", {
                    className: "flex items-center gap-3",
                    children: [
                      Q.jsx(Nm, {
                        type: "button",
                        variant: "ghost",
                        onClick: E,
                        className: "h-8 px-4 font-mono text-xs font-bold",
                        children: e("form.cancel"),
                      }),
                      Q.jsx(Nm, {
                        type: "button",
                        onClick: async () => {
                          if (!l) return void hN.error(e("form.type.select_error"));
                          const t = v.getValues(),
                            n = parseFloat(t.transfer_enable_gb || "0"),
                            i = n > 0 ? Math.round(1024 * n * 1024 * 1024) : 0,
                            { transfer_enable_gb: r, ...o } = t;
                          (await $L({ ...o, type: l, transfer_enable: i })).data &&
                            (E(), hN.success(e("form.success")), u());
                        },
                        className:
                          "h-8 bg-primary px-8 font-mono text-xs font-bold text-primary-foreground hover:bg-primary/90",
                        children: e("form.submit"),
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
function d5t({ column: e, title: t, options: n }) {
  const i = e?.getFacetedUniqueValues(),
    r = new Set(e?.getFilterValue());
  return Q.jsxs(qUt, {
    children: [
      Q.jsx(KUt, {
        asChild: !0,
        children: Q.jsxs(Nm, {
          variant: "outline",
          size: "sm",
          className: "h-8 border-dashed",
          children: [
            Q.jsx(U7e, { className: "mr-2 h-4 w-4" }),
            t,
            r?.size > 0 &&
              Q.jsxs(Q.Fragment, {
                children: [
                  Q.jsx(Um, { orientation: "vertical", className: "mx-2 h-4" }),
                  Q.jsx(hqt, {
                    variant: "secondary",
                    className: "rounded-sm px-1 font-normal lg:hidden",
                    children: r.size,
                  }),
                  Q.jsx("div", {
                    className: "hidden space-x-1 lg:flex",
                    children:
                      r.size > 2
                        ? Q.jsxs(hqt, {
                            variant: "secondary",
                            className: "rounded-sm px-1 font-normal",
                            children: [r.size, " selected"],
                          })
                        : n
                            .filter((e) => r.has(e.value))
                            .map((e) =>
                              Q.jsx(
                                hqt,
                                {
                                  variant: "secondary",
                                  className: "rounded-sm px-1 font-normal",
                                  children: e.label,
                                },
                                e.value,
                              ),
                            ),
                  }),
                ],
              }),
          ],
        }),
      }),
      Q.jsx(ZUt, {
        className: "w-[200px] p-0",
        align: "start",
        children: Q.jsxs(Rdt, {
          children: [
            Q.jsx(Mdt, { placeholder: t }),
            Q.jsxs(Adt, {
              children: [
                Q.jsx(Pdt, { children: "No results found." }),
                Q.jsx(jdt, {
                  children: n.map((t) => {
                    const n = r.has(t.value);
                    return Q.jsxs(
                      Bdt,
                      {
                        onSelect: () => {
                          n ? r.delete(t.value) : r.add(t.value);
                          const i = Array.from(r);
                          e?.setFilterValue(i.length ? i : void 0);
                        },
                        className: "cursor-pointer",
                        children: [
                          Q.jsx("div", {
                            className: Rf(
                              "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
                              n
                                ? "bg-primary text-primary-foreground"
                                : "opacity-50 [&_svg]:invisible",
                            ),
                            children: Q.jsx(h7e, { className: Rf("h-4 w-4") }),
                          }),
                          t.icon &&
                            Q.jsx(t.icon, {
                              className: `mr-2 h-4 w-4 text-muted-foreground text-${t.color}`,
                            }),
                          Q.jsx("span", { children: t.label }),
                          i?.get(t.value) &&
                            Q.jsx("span", {
                              className:
                                "ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",
                              children: i.get(t.value),
                            }),
                        ],
                      },
                      t.value,
                    );
                  }),
                }),
                r.size > 0 &&
                  Q.jsxs(Q.Fragment, {
                    children: [
                      Q.jsx(Fdt, {}),
                      Q.jsx(jdt, {
                        children: Q.jsx(Bdt, {
                          onSelect: () => e?.setFilterValue(void 0),
                          className: "justify-center text-center cursor-pointer",
                          children: "Clear filters",
                        }),
                      }),
                    ],
                  }),
              ],
            }),
          ],
        }),
      }),
    ],
  });
}
const u5t = [
  {
    value: g$t.Shadowsocks,
    label: p$t.find((e) => e.type === g$t.Shadowsocks)?.label,
    color: f$t[g$t.Shadowsocks],
  },
  { value: g$t.Vmess, label: p$t.find((e) => e.type === g$t.Vmess)?.label, color: f$t[g$t.Vmess] },
  {
    value: g$t.Trojan,
    label: p$t.find((e) => e.type === g$t.Trojan)?.label,
    color: f$t[g$t.Trojan],
  },
  {
    value: g$t.Hysteria,
    label: p$t.find((e) => e.type === g$t.Hysteria)?.label,
    color: f$t[g$t.Hysteria],
  },
  { value: g$t.Vless, label: p$t.find((e) => e.type === g$t.Vless)?.label, color: f$t[g$t.Vless] },
  { value: g$t.Tuic, label: p$t.find((e) => e.type === g$t.Tuic)?.label, color: f$t[g$t.Tuic] },
  { value: g$t.Socks, label: p$t.find((e) => e.type === g$t.Socks)?.label, color: f$t[g$t.Socks] },
  { value: g$t.Naive, label: p$t.find((e) => e.type === g$t.Naive)?.label, color: f$t[g$t.Naive] },
  { value: g$t.Http, label: p$t.find((e) => e.type === g$t.Http)?.label, color: f$t[g$t.Http] },
  { value: g$t.Mieru, label: p$t.find((e) => e.type === g$t.Mieru)?.label, color: f$t[g$t.Mieru] },
];
function h5t({ table: e, refetch: t, saveOrder: n, isSortMode: i, groups: r }) {
  const o = e.getState().columnFilters.length > 0,
    s = e.getFilteredSelectedRowModel().rows,
    a = s.length > 0,
    { t: l } = Py("server"),
    c = t8e(),
    d = async () => {
      const n = s.map((e) => e.original.id);
      try {
        const { data: i } = await KL({ ids: n });
        i &&
          (hN.success(l("toolbar.batch_delete_success", { count: n.length })),
          e.resetRowSelection(),
          t());
      } catch {
        hN.error(l("toolbar.batch_delete_error"));
      }
    },
    u = async () => {
      const n = s.map((e) => e.original.id);
      try {
        const { data: i } = await QL({ ids: n });
        i &&
          (hN.success(l("toolbar.batch_reset_traffic_success", { count: n.length })),
          e.resetRowSelection(),
          t());
      } catch {
        hN.error(l("toolbar.batch_reset_traffic_error"));
      }
    };
  return i
    ? Q.jsxs("div", {
        className: "flex items-center justify-between",
        children: [
          Q.jsx("p", {
            className: "text-sm text-muted-foreground",
            children: l("toolbar.sort.tip"),
          }),
          Q.jsx(Nm, {
            variant: "default",
            onClick: n,
            size: "sm",
            children: l("toolbar.sort.save"),
          }),
        ],
      })
    : c
      ? Q.jsxs("div", {
          className: "flex flex-col gap-2",
          children: [
            Q.jsxs("div", {
              className: "flex items-center gap-2",
              children: [
                Q.jsx(c5t, {}),
                Q.jsx(Q6e, {
                  placeholder: l("toolbar.search"),
                  value: e.getColumn("name")?.getFilterValue() ?? "",
                  onChange: (t) => e.getColumn("name")?.setFilterValue(t.target.value),
                  className: "h-8 flex-1",
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "flex items-center gap-2",
              children: [
                Q.jsxs("div", {
                  className: "flex gap-x-2",
                  children: [
                    e.getColumn("type") &&
                      Q.jsx(d5t, {
                        column: e.getColumn("type"),
                        title: l("toolbar.type"),
                        options: u5t,
                      }),
                    e.getColumn("group_ids") &&
                      Q.jsx(d5t, {
                        column: e.getColumn("group_ids"),
                        title: l("columns.groups.title"),
                        options: r.map((e) => ({ label: e.name, value: e.id.toString() })),
                      }),
                  ],
                }),
                o &&
                  Q.jsxs(Nm, {
                    variant: "ghost",
                    onClick: () => e.resetColumnFilters(),
                    className: "h-8 px-2",
                    children: [l("toolbar.reset"), Q.jsx(E7e, { className: "ml-1 h-4 w-4" })],
                  }),
                Q.jsxs(Not, {
                  modal: !1,
                  children: [
                    Q.jsx(Lot, { asChild: !0, onClick: (e) => (e.stopPropagation(), e.preventDefault()), children: Q.jsx(Nm, {
                        variant: "outline",
                        size: "sm",
                        className: "h-8 border-dashed",
                        children: l("toolbar.actions"),
                      }),
                    }),
                    Q.jsxs(Iot, {
                      align: "start",
                      className: "w-48",
                      children: [
                        Q.jsx(yXt, {
                          title: l("toolbar.batch_reset_traffic.title"),
                          description: l("toolbar.batch_reset_traffic.description", {
                            count: s.length,
                          }),
                          confirmText: l("toolbar.batch_reset_traffic.confirm"),
                          variant: "default",
                          onConfirm: u,
                          children: Q.jsxs(Rot, {
                            onSelect: (e) => e.preventDefault(),
                            disabled: !a,
                            children: [
                              Q.jsx(Uat, { className: "mr-2 size-4" }),
                              l("toolbar.batch_reset_traffic.menu"),
                              a &&
                                Q.jsxs("span", {
                                  className: "ml-auto font-mono text-[10px] text-muted-foreground",
                                  children: ["(", s.length, ")"],
                                }),
                            ],
                          }),
                        }),
                        Q.jsx(Pot, {}),
                        Q.jsx(yXt, {
                          title: l("toolbar.batch_delete.title"),
                          description: l("toolbar.batch_delete.description", { count: s.length }),
                          confirmText: l("toolbar.batch_delete.confirm"),
                          variant: "destructive",
                          onConfirm: d,
                          children: Q.jsxs(Rot, {
                            onSelect: (e) => e.preventDefault(),
                            disabled: !a,
                            className: "text-destructive focus:text-destructive",
                            children: [
                              Q.jsx(ilt, { className: "mr-2 size-4" }),
                              l("toolbar.batch_delete.menu"),
                              a &&
                                Q.jsxs("span", {
                                  className: "ml-auto font-mono text-[10px] text-muted-foreground",
                                  children: ["(", s.length, ")"],
                                }),
                            ],
                          }),
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          ],
        })
      : Q.jsxs("div", {
          className: "flex items-center justify-between",
          children: [
            Q.jsxs("div", {
              className: "flex flex-1 items-center space-x-2",
              children: [
                Q.jsx(c5t, {}),
                Q.jsx(Q6e, {
                  placeholder: l("toolbar.search"),
                  value: e.getColumn("name")?.getFilterValue() ?? "",
                  onChange: (t) => e.getColumn("name")?.setFilterValue(t.target.value),
                  className: "h-8 w-[150px] lg:w-[250px]",
                }),
                Q.jsxs("div", {
                  className: "flex gap-x-2",
                  children: [
                    e.getColumn("type") &&
                      Q.jsx(d5t, {
                        column: e.getColumn("type"),
                        title: l("toolbar.type"),
                        options: u5t,
                      }),
                    e.getColumn("group_ids") &&
                      Q.jsx(d5t, {
                        column: e.getColumn("group_ids"),
                        title: l("columns.groups.title"),
                        options: r.map((e) => ({ label: e.name, value: e.id.toString() })),
                      }),
                  ],
                }),
                o &&
                  Q.jsxs(Nm, {
                    variant: "ghost",
                    onClick: () => e.resetColumnFilters(),
                    className: "h-8 px-2 lg:px-3",
                    children: [l("toolbar.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
                  }),
                Q.jsxs(Not, {
                  modal: !1,
                  children: [
                    Q.jsx(Lot, { asChild: !0, onClick: (e) => (e.stopPropagation(), e.preventDefault()), children: Q.jsx(Nm, {
                        variant: "outline",
                        size: "sm",
                        className: "h-8 border-dashed",
                        children: l("toolbar.actions"),
                      }),
                    }),
                    Q.jsxs(Iot, {
                      align: "start",
                      className: "w-48",
                      children: [
                        Q.jsx(yXt, {
                          title: l("toolbar.batch_reset_traffic.title"),
                          description: l("toolbar.batch_reset_traffic.description", {
                            count: s.length,
                          }),
                          confirmText: l("toolbar.batch_reset_traffic.confirm"),
                          variant: "default",
                          onConfirm: u,
                          children: Q.jsxs(Rot, {
                            onSelect: (e) => e.preventDefault(),
                            disabled: !a,
                            children: [
                              Q.jsx(Uat, { className: "mr-2 size-4" }),
                              l("toolbar.batch_reset_traffic.menu"),
                              a &&
                                Q.jsxs("span", {
                                  className: "ml-auto font-mono text-[10px] text-muted-foreground",
                                  children: ["(", s.length, ")"],
                                }),
                            ],
                          }),
                        }),
                        Q.jsx(Pot, {}),
                        Q.jsx(yXt, {
                          title: l("toolbar.batch_delete.title"),
                          description: l("toolbar.batch_delete.description", { count: s.length }),
                          confirmText: l("toolbar.batch_delete.confirm"),
                          variant: "destructive",
                          onConfirm: d,
                          children: Q.jsxs(Rot, {
                            onSelect: (e) => e.preventDefault(),
                            disabled: !a,
                            className: "text-destructive focus:text-destructive",
                            children: [
                              Q.jsx(ilt, { className: "mr-2 size-4" }),
                              l("toolbar.batch_delete.menu"),
                              a &&
                                Q.jsxs("span", {
                                  className: "ml-auto font-mono text-[10px] text-muted-foreground",
                                  children: ["(", s.length, ")"],
                                }),
                            ],
                          }),
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
            e.getRowCount() > 0 &&
              Q.jsx("div", {
                className: "hidden items-center gap-2 md:flex",
                children: Q.jsx(Nm, {
                  variant: "outline",
                  onClick: n,
                  size: "sm",
                  children: l("toolbar.sort.edit"),
                }),
              }),
          ],
        });
}
var g5t = "Checkbox",
  [p5t] = Jy(g5t),
  [f5t, m5t] = p5t(g5t);
function _5t(e) {
  const {
      __scopeCheckbox: t,
      checked: n,
      children: i,
      defaultChecked: r,
      disabled: o,
      form: s,
      name: a,
      onCheckedChange: l,
      required: c,
      value: d = "on",
      internal_do_not_use_render: u,
    } = e,
    [h, g] = _x({ prop: n, defaultProp: r ?? !1, onChange: l, caller: g5t }),
    [p, f] = H.useState(null),
    [m, _] = H.useState(null),
    v = H.useRef(!1),
    b = !p || !!s || !!p.closest("form"),
    y = {
      checked: h,
      disabled: o,
      setChecked: g,
      control: p,
      setControl: f,
      name: a,
      form: s,
      value: d,
      hasConsumerStoppedPropagationRef: v,
      required: c,
      defaultChecked: !E5t(r) && r,
      isFormControl: b,
      bubbleInput: m,
      setBubbleInput: _,
    };
  return Q.jsx(f5t, { scope: t, ...y, children: k5t(u) ? u(y) : i });
}
var v5t = "CheckboxTrigger",
  b5t = H.forwardRef(({ __scopeCheckbox: e, onKeyDown: t, onClick: n, ...i }, r) => {
    const {
        control: o,
        value: s,
        disabled: a,
        checked: l,
        required: c,
        setControl: d,
        setChecked: u,
        hasConsumerStoppedPropagationRef: h,
        isFormControl: g,
        bubbleInput: p,
      } = m5t(v5t, e),
      f = Sp(r, d),
      m = H.useRef(l);
    return (
      H.useEffect(() => {
        const e = o?.form;
        if (e) {
          const t = () => u(m.current);
          return (e.addEventListener("reset", t), () => e.removeEventListener("reset", t));
        }
      }, [o, u]),
      Q.jsx(gx.button, {
        type: "button",
        role: "checkbox",
        "aria-checked": E5t(l) ? "mixed" : l,
        "aria-required": c,
        "data-state": N5t(l),
        "data-disabled": a ? "" : void 0,
        disabled: a,
        value: s,
        ...i,
        ref: f,
        onKeyDown: Qy(t, (e) => {
          "Enter" === e.key && e.preventDefault();
        }),
        onClick: Qy(n, (e) => {
          (u((e) => !!E5t(e) || !e),
            p && g && ((h.current = e.isPropagationStopped()), h.current || e.stopPropagation()));
        }),
      })
    );
  });
b5t.displayName = v5t;
var y5t = H.forwardRef((e, t) => {
  const {
    __scopeCheckbox: n,
    name: i,
    checked: r,
    defaultChecked: o,
    required: s,
    disabled: a,
    value: l,
    onCheckedChange: c,
    form: d,
    ...u
  } = e;
  return Q.jsx(_5t, {
    __scopeCheckbox: n,
    checked: r,
    defaultChecked: o,
    disabled: a,
    required: s,
    onCheckedChange: c,
    name: i,
    form: d,
    value: l,
    internal_do_not_use_render: ({ isFormControl: e }) =>
      Q.jsxs(Q.Fragment, {
        children: [
          Q.jsx(b5t, { ...u, ref: t, __scopeCheckbox: n }),
          e && Q.jsx(S5t, { __scopeCheckbox: n }),
        ],
      }),
  });
});
y5t.displayName = g5t;
var x5t = "CheckboxIndicator",
  w5t = H.forwardRef((e, t) => {
    const { __scopeCheckbox: n, forceMount: i, ...r } = e,
      o = m5t(x5t, n);
    return Q.jsx(Fx, {
      present: i || E5t(o.checked) || !0 === o.checked,
      children: Q.jsx(gx.span, {
        "data-state": N5t(o.checked),
        "data-disabled": o.disabled ? "" : void 0,
        ...r,
        ref: t,
        style: { pointerEvents: "none", ...e.style },
      }),
    });
  });
w5t.displayName = x5t;
var C5t = "CheckboxBubbleInput",
  S5t = H.forwardRef(({ __scopeCheckbox: e, ...t }, n) => {
    const {
        control: i,
        hasConsumerStoppedPropagationRef: r,
        checked: o,
        defaultChecked: s,
        required: a,
        disabled: l,
        name: c,
        value: d,
        form: u,
        bubbleInput: h,
        setBubbleInput: g,
      } = m5t(C5t, e),
      p = Sp(n, g),
      f = gWt(o),
      m = oit(i);
    H.useEffect(() => {
      const e = h;
      if (!e) return;
      const t = window.HTMLInputElement.prototype,
        n = Object.getOwnPropertyDescriptor(t, "checked").set,
        i = !r.current;
      if (f !== o && n) {
        const t = new Event("click", { bubbles: i });
        ((e.indeterminate = E5t(o)), n.call(e, !E5t(o) && o), e.dispatchEvent(t));
      }
    }, [h, f, o, r]);
    const _ = H.useRef(!E5t(o) && o);
    return Q.jsx(gx.input, {
      type: "checkbox",
      "aria-hidden": !0,
      defaultChecked: s ?? _.current,
      required: a,
      disabled: l,
      name: c,
      value: d,
      form: u,
      ...t,
      tabIndex: -1,
      ref: p,
      style: {
        ...t.style,
        ...m,
        position: "absolute",
        pointerEvents: "none",
        opacity: 0,
        margin: 0,
        transform: "translateX(-100%)",
      },
    });
  });
function k5t(e) {
  return "function" == typeof e;
}
function E5t(e) {
  return "indeterminate" === e;
}
function N5t(e) {
  return E5t(e) ? "indeterminate" : e ? "checked" : "unchecked";
}
S5t.displayName = C5t;
const L5t = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(y5t, {
    ref: n,
    className: Rf(
      "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
      e,
    ),
    ...t,
    children: Q.jsx(w5t, {
      className: Rf("flex items-center justify-center text-current"),
      children: Q.jsx(h7e, { className: "h-4 w-4" }),
    }),
  }),
);
function D5t({ node: e, refetch: t }) {
  const [n, i] = H.useState(Boolean(e.show));
  return Q.jsx(mGt, {
    checked: n,
    onCheckedChange: async (n) => {
      (i(n),
        ZL({ id: e.id, type: e.type, show: n ? 1 : 0 }).catch(() => {
          (i(!n), t());
        }));
    },
    style: { backgroundColor: n ? f$t[e.type] : void 0 },
  });
}
function T5t({ node: e, refetch: t, t: n }) {
  const { setIsOpen: i, setEditingServer: r, setServerType: o } = p4t(),
    [s, a] = H.useState(!1),
    l = H.useCallback(() => {
      (a(!1),
        window.requestAnimationFrame(() => {
          window.requestAnimationFrame(() => {
            (o(e.type), r(e), i(!0));
          });
        }));
    }, [e, i, r, o]);
  return Q.jsx("div", {
    className: "flex justify-center",
    children: Q.jsxs(Not, {
      modal: !1,
      open: s,
      onOpenChange: a,
      children: [
        Q.jsx(Lot, {
          asChild: !0,
          onClick: (e) => (e.stopPropagation(), e.preventDefault()),
          children: Q.jsx(Nm, {
            variant: "ghost",
            className: "h-8 w-8 p-0 hover:bg-muted",
            "aria-label": n("columns.actions"),
            children: Q.jsx(Cat, { className: "size-4" }),
          }),
        }),
        Q.jsxs(Iot, {
          align: "end",
          className: "w-40",
          children: [
            Q.jsx(Rot, {
              className: "cursor-pointer",
              onSelect: (e) => {
                (e.preventDefault(), e.stopPropagation(), l());
              },
              children: Q.jsxs("div", {
                className: "flex w-full items-center",
                children: [
                  Q.jsx(Vat, { className: "mr-2 size-4" }),
                  n("columns.actions_dropdown.edit"),
                ],
              }),
            }),
            Q.jsxs(Rot, {
              className: "cursor-pointer",
              onClick: async () => {
                GL({ id: e.id }).then(({ data: e }) => {
                  e && (hN.success(n("columns.actions_dropdown.copy_success")), t());
                });
              },
              children: [
                Q.jsx(yat, { className: "mr-2 size-4" }),
                n("columns.actions_dropdown.copy"),
              ],
            }),
            Q.jsx(Rot, {
              className: "cursor-pointer",
              onSelect: (e) => e.preventDefault(),
              children: Q.jsx(yXt, {
                title: n("columns.actions_dropdown.reset_traffic.title"),
                description: n("columns.actions_dropdown.reset_traffic.description"),
                confirmText: n("columns.actions_dropdown.reset_traffic.confirm"),
                variant: "default",
                onConfirm: async () => {
                  XL({ id: e.id }).then(({ data: e }) => {
                    e && (hN.success(n("columns.actions_dropdown.reset_traffic_success")), t());
                  });
                },
                children: Q.jsxs("div", {
                  className: "flex w-full items-center",
                  children: [
                    Q.jsx(Uat, { className: "mr-2 size-4" }),
                    n("columns.actions_dropdown.reset_traffic.confirm"),
                  ],
                }),
              }),
            }),
            Q.jsx(Pot, {}),
            Q.jsx(Rot, {
              className: "cursor-pointer text-destructive focus:text-destructive",
              onSelect: (e) => e.preventDefault(),
              children: Q.jsx(yXt, {
                title: n("columns.actions_dropdown.delete.title"),
                description: n("columns.actions_dropdown.delete.description"),
                confirmText: n("columns.actions_dropdown.delete.confirm"),
                variant: "destructive",
                onConfirm: async () => {
                  qL({ id: e.id }).then(({ data: e }) => {
                    e && (hN.success(n("columns.actions_dropdown.delete_success")), t());
                  });
                },
                children: Q.jsxs("div", {
                  className: "flex w-full items-center",
                  children: [
                    Q.jsx(ilt, { className: "mr-2 size-4" }),
                    n("columns.actions_dropdown.delete.confirm"),
                  ],
                }),
              }),
            }),
          ],
        }),
      ],
    }),
  });
}
L5t.displayName = y5t.displayName;
const I5t = {
    0: "bg-destructive/80 shadow-sm shadow-destructive/50",
    1: "bg-yellow-500/80 shadow-sm shadow-yellow-500/50",
    2: "bg-emerald-500/80 shadow-sm shadow-emerald-500/50",
  },
  R5t = (e, t) => (t > 0 ? Math.round((e / t) * 100) : 0),
  O5t = z.memo(({ node: e, t: t, expanded: r = !1, toggleExpand: o, hasChildren: s = !1 }) => {
    const n = e.id,
      i = e.code,
      a = !!(e.parent_id ?? e.parent?.id),
      l = s && !a;
    return Q.jsxs(jst, {
      children: [
        Q.jsx(Fst, {
          asChild: !0,
          children: Q.jsxs("div", {
            className: Rf("group/id flex items-center space-x-2", e.__tree_level > 0 && "pl-6"),
            children: [
              l &&
                Q.jsx(Nm, {
                  variant: "ghost",
                  size: "icon",
                  className:
                    "size-6 flex-shrink-0 text-muted-foreground/60 transition-colors hover:text-foreground",
                  title: r ? "Collapse children" : "Expand children",
                  onClick: (e) => {
                    e.stopPropagation(), o?.(n);
                  },
                  children: r ? Q.jsx(lat, { className: "size-3.5" }) : Q.jsx(dat, { className: "size-3.5" }),
                }),
              !a &&
                !l &&
                Q.jsx("span", {
                  className: "size-6 flex-shrink-0",
                }),
              Q.jsxs(hqt, {
                variant: "outline",
                className: Rf(
                  "border-2 font-medium transition-all duration-200 hover:opacity-80",
                  "flex items-center gap-1.5",
                ),
                style: { borderColor: f$t[e.type] },
                children: [
                  Q.jsx(Gat, { className: "size-3" }),
                  Q.jsxs("span", {
                    className: "flex flex-col items-start gap-0.5 leading-tight",
                    children: [
                      a
                        ? Q.jsxs("span", {
                            className: "flex items-center gap-1",
                            children: [
                              Q.jsx("span", { children: n }),
                              Q.jsx("span", {
                                className: "text-sm text-muted-foreground/30",
                                children: "\u2192",
                              }),
                              Q.jsx("span", { children: e.parent_id ?? e.parent?.id }),
                            ],
                          })
                        : Q.jsx("span", {
                            className: "flex items-center gap-0.5",
                            children: n,
                          }),
                      i &&
                        Q.jsxs("span", {
                          className: "font-mono text-[10px] text-muted-foreground",
                          children: [t("columns.customId"), ": ", i],
                        }),
                    ],
                  }),
                ],
              }),
              Q.jsx(Nm, {
                variant: "ghost",
                size: "icon",
                className:
                  "size-5 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:text-muted-foreground group-hover/id:opacity-100",
                onClick: (e) => {
                  (e.stopPropagation(),
                    TS(i || n.toString()).then(() => {
                      hN.success(t("common:copy.success"));
                    }));
                },
                children: Q.jsx(_at, { className: "size-3" }),
              }),
            ],
          }),
        }),
        Q.jsxs(Bst, {
          side: "top",
          className: "flex flex-col gap-2 p-3 ",
          children: [
            Q.jsxs("p", {
              className: "font-medium",
              children: [p$t.find((t) => t.type === e.type)?.label, e.parent ? " (子节点)" : ""],
            }),
            Q.jsxs("div", {
              className: "mt-1 grid gap-1.5",
              children: [
                Q.jsxs("div", {
                  className: "flex items-center gap-3",
                  children: [
                    Q.jsx("span", {
                      className: "text-xs text-muted-foreground",
                      children: t("columns.customId"),
                    }),
                    Q.jsxs("div", {
                      className: "flex items-center gap-1.5",
                      children: [
                        Q.jsx("span", {
                          className: "max-w-[120px] truncate font-mono text-xs font-medium",
                          children: i ?? "—",
                        }),
                        i &&
                          Q.jsx(Nm, {
                            variant: "ghost",
                            size: "icon",
                            className:
                              "size-6 text-muted-foreground/60 hover:text-muted-foreground",
                            onClick: (e) => {
                              (e.stopPropagation(),
                                TS(i).then(() => {
                                  hN.success(t("common:copy.success"));
                                }));
                            },
                            children: Q.jsx(_at, { className: "size-3" }),
                          }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex items-center gap-3",
                  children: [
                    Q.jsx("span", {
                      className: "text-xs text-muted-foreground",
                      children: t("columns.originalId"),
                    }),
                    Q.jsxs("div", {
                      className: "flex items-center gap-1.5",
                      children: [
                        Q.jsx("span", {
                          className: "font-mono text-xs font-semibold ",
                          children: e.id,
                        }),
                        Q.jsx(Nm, {
                          variant: "ghost",
                          size: "icon",
                          className: "size-6 text-muted-foreground/60 hover:text-muted-foreground",
                          onClick: (n) => {
                            (n.stopPropagation(),
                              TS(String(e.id)).then(() => {
                                hN.success(t("common:copy.success"));
                              }));
                          },
                          children: Q.jsx(_at, { className: "size-3" }),
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          ],
        }),
      ],
    });
  }),
  M5t = ({ node: e, t: t }) =>
    Q.jsxs("div", {
      className: "space-y-3",
      children: [
        Q.jsx("p", {
          className: "font-medium",
          children: t(`columns.status.${e.available_status}`),
        }),
        e.load_status &&
          Q.jsxs("div", {
            className: "space-y-2 border-t border-border/50 pt-3",
            children: [
              Q.jsxs("div", {
                className: "space-y-1",
                children: [
                  Q.jsxs("div", {
                    className: "flex items-center justify-between text-[11px]",
                    children: [
                      Q.jsx("span", {
                        className: "font-semibold text-white dark:text-neutral-800",
                        children: t("columns.loadStatus.cpu"),
                      }),
                      Q.jsxs("span", {
                        className: Rf(
                          "font-mono font-bold text-white dark:text-neutral-800",
                          e.load_status.cpu >= 90
                            ? "text-destructive"
                            : e.load_status.cpu >= 70
                              ? "text-yellow-200 dark:text-yellow-400"
                              : "text-emerald-200 dark:text-emerald-400",
                        ),
                        children: [Math.round(e.load_status.cpu), "%"],
                      }),
                    ],
                  }),
                  Q.jsx("div", {
                    className:
                      "h-1 w-full overflow-hidden rounded-full bg-neutral-800 dark:bg-neutral-700",
                    children: Q.jsx("div", {
                      className: Rf(
                        "h-full transition-all duration-500",
                        e.load_status.cpu >= 90
                          ? "bg-destructive"
                          : e.load_status.cpu >= 70
                            ? "bg-yellow-500"
                            : "bg-emerald-500",
                      ),
                      style: { width: `${Math.min(100, e.load_status.cpu)}%` },
                    }),
                  }),
                ],
              }),
              Q.jsxs("div", {
                className: "space-y-1",
                children: [
                  Q.jsxs("div", {
                    className: "flex items-center justify-between text-[11px]",
                    children: [
                      Q.jsxs("div", {
                        className: "flex items-center gap-2",
                        children: [
                          Q.jsx("span", {
                            className: "font-semibold text-white dark:text-neutral-800",
                            children: t("columns.loadStatus.memory"),
                          }),
                          Q.jsxs("span", {
                            className: "text-[9px] text-white dark:text-neutral-800",
                            children: [
                              IS(e.load_status.mem.used),
                              " /",
                              " ",
                              IS(e.load_status.mem.total),
                            ],
                          }),
                        ],
                      }),
                      Q.jsxs("span", {
                        className: Rf(
                          "font-mono font-bold text-white dark:text-neutral-800",
                          R5t(e.load_status.mem.used, e.load_status.mem.total) >= 90
                            ? "text-destructive"
                            : R5t(e.load_status.mem.used, e.load_status.mem.total) >= 70
                              ? "text-yellow-200 dark:text-yellow-400"
                              : "text-emerald-200 dark:text-emerald-400",
                        ),
                        children: [R5t(e.load_status.mem.used, e.load_status.mem.total), "%"],
                      }),
                    ],
                  }),
                  Q.jsx("div", {
                    className:
                      "h-1 w-full overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-700",
                    children: Q.jsx("div", {
                      className: Rf(
                        "h-full transition-all duration-500",
                        R5t(e.load_status.mem.used, e.load_status.mem.total) >= 90
                          ? "bg-destructive"
                          : R5t(e.load_status.mem.used, e.load_status.mem.total) >= 70
                            ? "bg-yellow-500"
                            : "bg-emerald-500",
                      ),
                      style: { width: `${R5t(e.load_status.mem.used, e.load_status.mem.total)}%` },
                    }),
                  }),
                ],
              }),
              Q.jsxs("div", {
                className: "space-y-1",
                children: [
                  Q.jsxs("div", {
                    className: "flex items-center justify-between text-[11px]",
                    children: [
                      Q.jsxs("div", {
                        className: "flex items-center gap-2",
                        children: [
                          Q.jsx("span", {
                            className: "font-semibold text-white dark:text-neutral-800",
                            children: t("columns.loadStatus.disk"),
                          }),
                          Q.jsxs("span", {
                            className: "text-[9px] text-white dark:text-neutral-800",
                            children: [
                              IS(e.load_status.disk.used),
                              " /",
                              " ",
                              IS(e.load_status.disk.total),
                            ],
                          }),
                        ],
                      }),
                      Q.jsxs("span", {
                        className: Rf(
                          "font-mono font-bold text-white dark:text-neutral-800",
                          R5t(e.load_status.disk.used, e.load_status.disk.total) >= 90
                            ? "text-destructive"
                            : R5t(e.load_status.disk.used, e.load_status.disk.total) >= 70
                              ? "text-yellow-200 dark:text-yellow-400"
                              : "text-emerald-200 dark:text-emerald-400",
                        ),
                        children: [R5t(e.load_status.disk.used, e.load_status.disk.total), "%"],
                      }),
                    ],
                  }),
                  Q.jsx("div", {
                    className:
                      "h-1 w-full overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-700",
                    children: Q.jsx("div", {
                      className: Rf(
                        "h-full transition-all duration-500",
                        R5t(e.load_status.disk.used, e.load_status.disk.total) >= 90
                          ? "bg-destructive"
                          : R5t(e.load_status.disk.used, e.load_status.disk.total) >= 70
                            ? "bg-yellow-500"
                            : "bg-emerald-500",
                      ),
                      style: {
                        width: `${R5t(e.load_status.disk.used, e.load_status.disk.total)}%`,
                      },
                    }),
                  }),
                ],
              }),
            ],
          }),
        e.metrics &&
          Q.jsx("div", {
            className: "mt-3 border-t border-border/50 pt-3",
            children: Q.jsxs("div", {
              className: "grid grid-cols-2 gap-x-4 gap-y-2",
              children: [
                Q.jsxs("div", {
                  className: "flex items-center gap-1.5",
                  title: t("columns.loadStatus.metrics.uptime"),
                  children: [
                    Q.jsx(nlt, { className: "size-3 text-blue-500" }),
                    Q.jsx("span", {
                      className: "font-mono text-[11px] font-medium",
                      children: RS(e.metrics.uptime || 0),
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex items-center gap-1.5",
                  title: t("columns.loadStatus.metrics.conns"),
                  children: [
                    Q.jsx(Qst, { className: "size-3 text-orange-500" }),
                    Q.jsxs("span", {
                      className: "font-mono text-[11px] font-medium",
                      children: [
                        e.metrics.active_connections || 0,
                        e.metrics.total_connections ? ` / ${e.metrics.total_connections}` : "",
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex items-center gap-1.5",
                  title: t("columns.loadStatus.metrics.speed"),
                  children: [
                    Q.jsx(iat, { className: "size-3 text-emerald-500" }),
                    Q.jsxs("span", {
                      className:
                        "font-mono text-[11px] font-medium text-emerald-600 dark:text-emerald-400",
                      children: [IS(e.metrics.outbound_speed || 0), "/s"],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex items-center gap-1.5 col-span-1",
                  title: t("columns.loadStatus.metrics.speed"),
                  children: [
                    Q.jsx(eat, { className: "size-3 text-blue-500" }),
                    Q.jsxs("span", {
                      className:
                        "font-mono text-[11px] font-medium text-blue-600 dark:text-blue-400",
                      children: [IS(e.metrics.inbound_speed || 0), "/s"],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex items-center gap-1.5 col-span-1 border-t border-border/20 pt-1",
                  title: t("columns.loadStatus.metrics.users"),
                  children: [
                    Q.jsx(dlt, { className: "size-3 text-purple-500" }),
                    Q.jsxs("span", {
                      className: "font-mono text-[11px] font-medium",
                      children: [e.metrics.active_users || 0, " / ", e.metrics.total_users || 0],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex items-center gap-1.5 col-span-1 border-t border-border/20 pt-1",
                  title: t("columns.loadStatus.metrics.goroutines"),
                  children: [
                    Q.jsx(Dat, { className: "size-3 text-blue-400" }),
                    Q.jsx("span", {
                      className: "font-mono text-[11px] font-medium",
                      children: e.metrics.goroutines || 0,
                    }),
                  ],
                }),
                e.metrics.load &&
                  void 0 !== e.metrics.load.load5 &&
                  Q.jsxs("div", {
                    className:
                      "flex items-center gap-1.5 col-span-1 border-t border-border/20 pt-1",
                    title: t("columns.loadStatus.metrics.load"),
                    children: [
                      Q.jsx(xat, { className: "size-3 text-orange-400" }),
                      Q.jsx("span", {
                        className: "font-mono text-[11px] font-medium",
                        children: e.metrics.load.load5.toFixed(2),
                      }),
                    ],
                  }),
                e.metrics.api &&
                  Q.jsxs("div", {
                    className:
                      "flex items-center gap-1.5 col-span-1 border-t border-border/20 pt-1",
                    title: t("columns.loadStatus.metrics.api"),
                    children: [
                      Q.jsx(flt, {
                        className: Rf(
                          "size-3",
                          e.metrics.api.failure > 0
                            ? "text-destructive animate-pulse"
                            : "text-yellow-500",
                        ),
                      }),
                      Q.jsxs("span", {
                        className: "font-mono text-[10px] font-medium",
                        children: [e.metrics.api.success, "/", e.metrics.api.failure],
                      }),
                    ],
                  }),
                e.metrics.ws?.enabled &&
                  Q.jsxs("div", {
                    className:
                      "flex items-center gap-1.5 col-span-1 border-t border-border/20 pt-1",
                    title: t("columns.loadStatus.metrics.ws"),
                    children: [
                      e.metrics.ws?.connected
                        ? Q.jsx(glt, { className: "size-3 text-emerald-500" })
                        : Q.jsx(hlt, { className: "size-3 text-destructive animate-pulse" }),
                      Q.jsx("span", {
                        className: "font-mono text-[10px] font-medium",
                        children: e.metrics.ws?.connected ? "WS-OK" : "WS-ERR",
                      }),
                    ],
                  }),
                (void 0 !== e.metrics.kernel_status || e.metrics.gc) &&
                  Q.jsxs("div", {
                    className:
                      "flex items-center gap-1.5 col-span-1 border-t border-border/20 pt-1",
                    title: t("columns.loadStatus.metrics.kernel"),
                    children: [
                      Q.jsx(Qat, {
                        className: Rf(
                          "size-3",
                          e.metrics.kernel_status ? "text-emerald-500" : "text-destructive",
                        ),
                      }),
                      Q.jsxs("span", {
                        className: "font-mono text-[10px] font-medium text-nowrap",
                        children: [
                          e.metrics.kernel_status ? "ON" : "OFF",
                          void 0 !== e.metrics.gc?.last_pause_ms &&
                            ` (${e.metrics.gc.last_pause_ms.toFixed(0)}ms)`,
                        ],
                      }),
                    ],
                  }),
                (e.metrics.speed_limiter?.has_limits ||
                  (e.metrics.limits?.device_limit_events ?? 0) > 0) &&
                  Q.jsxs("div", {
                    className:
                      "flex items-center gap-1.5 col-span-2 mt-1 rounded bg-destructive/10 px-1 py-0.5 text-destructive",
                    title: t("columns.loadStatus.metrics.limit"),
                    children: [
                      Q.jsx(Dat, { className: "size-3" }),
                      Q.jsxs("span", {
                        className: "font-mono text-[10px] font-bold",
                        children: [
                          e.metrics.speed_limiter?.limited_users ?? 0,
                          " Limit",
                          (e.metrics.limits?.device_limit_events ?? 0) > 0 &&
                            ` | ${e.metrics.limits?.device_limit_events} Events`,
                        ],
                      }),
                    ],
                  }),
              ],
            }),
          }),
      ],
    }),
  A5t = z.memo(({ node: e, t: t }) =>
    Q.jsxs("div", {
      className: Rf("flex items-center space-x-2.5 outline-none", e.__tree_level > 0 && "pl-6"),
      children: [
        Q.jsxs(jst, {
          children: [
            Q.jsx(Fst, {
              asChild: !0,
              children: Q.jsx("span", {
                className: Rf(
                  "size-2.5 flex-shrink-0 cursor-pointer rounded-full transition-all duration-200",
                  I5t[e.available_status],
                ),
              }),
            }),
            Q.jsx(Bst, {
              side: "top",
              align: "center",
              sideOffset: 10,
              children: Q.jsx(M5t, { node: e, t: t }),
            }),
          ],
        }),
        Q.jsx("span", {
          className: "cursor-default text-left font-medium transition-colors hover:text-primary",
          children: e.name,
        }),
      ],
    }),
  ),
  P5t = z.memo(({ node: e, t: t }) => {
    const n = `${e.host}:${e.port}`,
      i = e.port !== e.server_port;
    return Q.jsxs("div", {
      className: "group relative flex min-w-0 items-start",
      children: [
        Q.jsxs("div", {
          className: "flex min-w-0 flex-wrap items-baseline gap-x-1 gap-y-0.5 pr-7",
          children: [
            Q.jsx("div", {
              className: "flex items-center ",
              children: Q.jsxs("span", {
                className: "font-mono text-sm font-medium text-foreground/90",
                children: [e.host, ":", e.port],
              }),
            }),
            i &&
              Q.jsxs("span", {
                className:
                  "whitespace-nowrap text-[0.7rem] tracking-tight text-muted-foreground/40",
                children: ["(", t("columns.internalPort"), " ", e.server_port, ")"],
              }),
          ],
        }),
        Q.jsx("div", {
          className: "absolute right-0 top-0",
          children: Q.jsxs(jst, {
            children: [
              Q.jsx(Fst, {
                asChild: !0,
                children: Q.jsx(Nm, {
                  variant: "ghost",
                  size: "icon",
                  className:
                    "size-6 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:bg-muted/50 hover:text-muted-foreground group-hover:opacity-100",
                  onClick: (e) => {
                    (e.stopPropagation(),
                      TS(n).then(() => {
                        hN.success(t("common:copy.success"));
                      }));
                  },
                  children: Q.jsx(_at, { className: "size-3" }),
                }),
              }),
              Q.jsx(Bst, { side: "top", sideOffset: 10, children: t("columns.copyAddress") }),
            ],
          }),
        }),
      ],
    });
  }),
  j5t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M15.71 12.71a6 6 0 1 0-7.42 0a10 10 0 0 0-6.22 8.18a1 1 0 0 0 2 .22a8 8 0 0 1 15.9 0a1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1a10 10 0 0 0-6.25-8.19M12 12a4 4 0 1 1 4-4a4 4 0 0 1-4 4",
      }),
    }),
  F5t = "bg-destructive/80 shadow-sm shadow-destructive/50",
  B5t = "bg-yellow-500/80 shadow-sm shadow-yellow-500/50",
  V5t = "bg-emerald-500/80 shadow-sm shadow-emerald-500/50",
  W5t = (e, t, n, i, r) => [
    {
      accessorKey: "id",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.nodeId") }),
      cell: ({ row: e }) =>
        Q.jsx(O5t, {
          node: e.original,
          t: t,
          expanded: !!n[e.original.id],
          toggleExpand: i,
          hasChildren: !r && !!e.original.__has_child_nodes,
        }),
      size: 50,
      enableSorting: !0,
    },
    {
      accessorKey: "show",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.show") }),
      cell: ({ row: t }) => Q.jsx(D5t, { node: t.original, refetch: e }),
      size: 50,
      enableSorting: !1,
    },
    {
      accessorKey: "name",
      header: ({ column: e }) =>
        Q.jsx("div", {
          className: "flex items-center",
          children: Q.jsx(SYt, {
            column: e,
            title: t("columns.node"),
            tooltip: Q.jsxs("div", {
              className: "grid grid-cols-1 gap-3 p-2",
              children: [
                Q.jsxs("div", {
                  className: "flex items-center space-x-2.5",
                  children: [
                    Q.jsx("span", { className: Rf("h-2.5 w-2.5 rounded-full", F5t) }),
                    Q.jsx("span", {
                      className: "text-sm font-medium",
                      children: t("columns.status.0"),
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex items-center space-x-2.5",
                  children: [
                    Q.jsx("span", { className: Rf("h-2.5 w-2.5 rounded-full", B5t) }),
                    Q.jsx("span", {
                      className: "text-sm font-medium",
                      children: t("columns.status.1"),
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex items-center space-x-2.5",
                  children: [
                    Q.jsx("span", { className: Rf("h-2.5 w-2.5 rounded-full", V5t) }),
                    Q.jsx("span", {
                      className: "text-sm font-medium",
                      children: t("columns.status.2"),
                    }),
                  ],
                }),
              ],
            }),
          }),
        }),
      cell: ({ row: e }) => Q.jsx(A5t, { node: e.original, t: t }),
      enableSorting: !1,
      size: 200,
    },
    {
      accessorKey: "host",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.address") }),
      cell: ({ row: e }) => Q.jsx(P5t, { node: e.original, t: t }),
      enableSorting: !1,
      enableHiding: !0,
    },
    {
      accessorKey: "online",
      header: ({ column: e }) =>
        Q.jsx(SYt, {
          column: e,
          title: t("columns.onlineUsers.title"),
          tooltip: t("columns.onlineUsers.tooltip"),
        }),
      cell: ({ row: e }) =>
        Q.jsxs("div", {
          className: "flex items-center space-x-2 px-4",
          children: [
            Q.jsx(j5t, { className: "size-4" }),
            Q.jsx("span", { className: "font-medium", children: e.getValue("online") }),
          ],
        }),
      size: 80,
      enableSorting: !0,
      enableHiding: !0,
    },
    {
      accessorKey: "rate",
      header: ({ column: e }) =>
        Q.jsx(SYt, {
          column: e,
          title: t("columns.rate.title"),
          tooltip: t("columns.rate.tooltip"),
        }),
      cell: ({ row: e }) =>
        Q.jsxs(hqt, {
          variant: "secondary",
          className: "font-medium",
          children: [e.getValue("rate"), " x"],
        }),
      size: 80,
      enableSorting: !1,
      enableHiding: !0,
    },
    {
      accessorKey: "group_ids",
      header: ({ column: e }) =>
        Q.jsx(SYt, {
          column: e,
          title: t("columns.groups.title"),
          tooltip: t("columns.groups.tooltip"),
        }),
      cell: ({ row: e }) => {
        const n = e.original.groups || [];
        return Q.jsxs("div", {
          className: "flex flex-wrap gap-1.5",
          children: [
            n.map((e, t) =>
              Q.jsx(
                hqt,
                {
                  variant: "secondary",
                  className: Rf(
                    "px-2 py-0.5 font-medium",
                    "bg-secondary/50 hover:bg-secondary/70",
                    "border border-border/50",
                    "transition-all duration-200",
                    "cursor-default select-none",
                    "flex items-center gap-1.5",
                  ),
                  children: e.name,
                },
                t,
              ),
            ),
            0 === n.length &&
              Q.jsx("span", {
                className: "text-sm text-muted-foreground",
                children: t("columns.groups.empty"),
              }),
          ],
        });
      },
      enableSorting: !1,
      filterFn: (e, t, n) => {
        const i = e.getValue(t);
        return !!i && n.some((e) => i.includes(e));
      },
    },
    {
      accessorKey: "type",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.type") }),
      cell: ({ row: e }) => {
        const t = e.getValue("type");
        return Q.jsx(hqt, {
          variant: "outline",
          className: "border-2 font-medium transition-colors",
          style: { borderColor: f$t[t] },
          children: t,
        });
      },
      enableSorting: !1,
      enableHiding: !0,
      enableColumnFilter: !1,
      size: 100,
    },
    {
      id: "traffic",
      header: ({ column: e }) =>
        Q.jsx(SYt, {
          column: e,
          title: t("columns.traffic.title"),
          tooltip: t("columns.traffic.tooltip"),
        }),
      cell: ({ row: e }) => {
        const n = (e.original.u || 0) + (e.original.d || 0),
          i = e.original.transfer_enable ?? 0,
          r = e.original.banned ?? !1,
          o = IS(n),
          s = IS(i);
        if (i <= 0)
          return Q.jsx("div", { className: "text-sm text-muted-foreground", children: o });
        const a = Math.min((n / i) * 100, 100);
        return Q.jsx(Pst, {
          delayDuration: 100,
          children: Q.jsxs(jst, {
            children: [
              Q.jsx(Fst, {
                children: Q.jsxs("div", {
                  className: "flex items-center gap-2",
                  children: [
                    Q.jsx("div", {
                      className: "h-1.5 w-12 rounded-full bg-secondary",
                      children: Q.jsx("div", {
                        className: Rf(
                          "h-full rounded-full transition-all",
                          r || a > 90 ? "bg-destructive" : "bg-primary",
                        ),
                        style: { width: `${a}%` },
                      }),
                    }),
                    Q.jsx("span", {
                      className: Rf(
                        "text-xs tabular-nums text-muted-foreground",
                        r && "text-destructive",
                      ),
                      children: o,
                    }),
                  ],
                }),
              }),
              Q.jsx(Bst, {
                side: "bottom",
                children: Q.jsxs("div", {
                  className: "space-y-1 text-sm",
                  children: [
                    Q.jsxs("p", { children: [t("columns.traffic.used"), ": ", o] }),
                    Q.jsxs("p", { children: [t("columns.traffic.total"), ": ", s] }),
                    Q.jsxs("p", {
                      children: [t("columns.traffic.percentage"), ": ", a.toFixed(1), "%"],
                    }),
                  ],
                }),
              }),
            ],
          }),
        });
      },
      size: 120,
      enableSorting: !1,
      enableHiding: !0,
    },
    {
      id: "actions",
      header: ({ column: e }) =>
        Q.jsx(SYt, { className: "justify-end", column: e, title: t("columns.actions") }),
      cell: ({ row: n }) => Q.jsx(T5t, { node: n.original, refetch: e, t: t }),
      size: 50,
    },
  ];
function H5t({ children: e, refetch: t }) {
  const [n, i] = H.useState(!1),
    [r, o] = H.useState(null),
    [s, a] = H.useState(null),
    l = H.useCallback(() => {
      (o(null), a(null), i(!0));
    }, []);
  return Q.jsx(g4t.Provider, {
    value: {
      isOpen: n,
      setIsOpen: i,
      editingServer: r,
      setEditingServer: o,
      serverType: s,
      setServerType: a,
      openNewNode: l,
      refetch: t,
    },
    children: e,
  });
}
function z5t() {
  const { t: e } = Py("server"),
    [t, n] = H.useState({}),
    [i, r] = H.useState({ "drag-handle": !1 }),
    [o, s] = H.useState([]),
    [a, l] = H.useState({ pageSize: 500, pageIndex: 0 }),
    [c, d] = H.useState([]),
    [u, h] = H.useState(!1),
    [g, p] = H.useState({}),
    [f, m] = H.useState([]),
    [k, S] = H.useState({}),
    {
      data: _,
      refetch: v,
      isLoading: b,
    } = gC({
      queryKey: ["nodeList"],
      queryFn: async () => {
        const { data: e } = await UL();
        return e;
      },
      refetchInterval: !u && 3e4,
    });
  H.useEffect(() => {
    !u && Array.isArray(_) && m(_);
  }, [_, u]);
  const { data: y } = gC({
    queryKey: ["groups"],
    queryFn: async () => {
      const { data: e } = await eD();
      return e;
    },
  });
  H.useEffect(() => {
    (r({
      "drag-handle": u,
      show: !u,
      host: !u,
      online: !u,
      rate: !u,
      groups: !u,
      type: !1,
      actions: !u,
    }),
      p({ name: u ? 2e3 : 200 }),
      l({ pageSize: u ? 99999 : 500, pageIndex: 0 }));
  }, [u]);
  const T = H.useMemo(() => {
      const e = Array.isArray(f) ? f : [],
        t = [],
        n = new Map();
      e.forEach((e) => {
        const i = Number(e.parent_id ?? 0);
        if (i > 0) {
          const r = n.get(i) || [];
          r.push({ ...e, __tree_level: 1 }), n.set(i, r);
          return;
        }
        t.push(e);
      });
      const i = t.flatMap((e) => {
          const t = n.get(e.id) || [],
            i = t.length > 0 || !!e.has_children,
            r = { ...e, __tree_level: 0, __has_child_nodes: i };
          return i && k[e.id] ? [r, ...t] : [r];
        }),
        r = new Set(t.map((e) => e.id));
      return (
        n.forEach((e, t) => {
          r.has(t) || i.push(...e);
        }),
        i
      );
    }, [f, k]),
    N = H.useCallback((e) => {
      S((t) => ({ ...t, [e]: !t[e] }));
    }, []),
    E = !u && 0 === o.length && 0 === c.length,
    j = u ? f || [] : E ? T : f || [],
    x = async () => {
      if (!u) return void h(!0);
      const e = f?.map((e, t) => ({ id: e.id, order: t + 1 }));
      try {
        (await YL(e), hN.success("排序保存成功"), await v());
      } finally {
        h(!1);
      }
    },
    w = PKt({
      data: j,
      columns: W5t(v, e, k, N, u),
      state: {
        sorting: c,
        columnVisibility: i,
        rowSelection: t,
        columnFilters: o,
        columnSizing: g,
        pagination: a,
      },
      enableRowSelection: !0,
      onRowSelectionChange: n,
      onSortingChange: d,
      onColumnFiltersChange: s,
      onColumnVisibilityChange: r,
      onColumnSizingChange: p,
      onPaginationChange: l,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsx(Pst, {
    delayDuration: 100,
    children: Q.jsx(H5t, {
      refetch: v,
      children: Q.jsx("div", {
        className: "space-y-4",
        children: Q.jsx(QKt, {
          table: w,
          toolbar: (e) =>
            Q.jsx(h5t, { table: e, refetch: v, saveOrder: x, isSortMode: u, groups: y || [] }),
          draggable: u,
          onDragStart: (e, t) => {
            u &&
              (e.dataTransfer.setData("text/plain", t.toString()),
              e.currentTarget.classList.add("opacity-50"));
          },
          onDragEnd: (e) => e.currentTarget.classList.remove("opacity-50"),
          onDragOver: (e) => {
            (e.preventDefault(), e.currentTarget.classList.add("bg-muted"));
          },
          onDragLeave: (e) => e.currentTarget.classList.remove("bg-muted"),
          onDrop: (e, t) => {
            if (!u) return;
            (e.preventDefault(), e.currentTarget.classList.remove("bg-muted"));
            const n = parseInt(e.dataTransfer.getData("text/plain"));
            if (n === t) return;
            const i = [...f],
              [r] = i.splice(n, 1);
            (i.splice(t, 0, r), m(i));
          },
          onRowClick: (e) => {
            u || e.toggleSelected(!e.getIsSelected());
          },
          showPagination: !u,
          isLoading: b,
          mobilePrimaryField: "name",
          mobileGridFields: ["type", "online", "rate", "group_ids"],
        }),
      }),
    }),
  });
}
const U5t = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py("server");
        return Q.jsxs(Wot, {
          children: [
            Q.jsxs(Hot, {
              children: [
                Q.jsx(Vdt, {}),
                Q.jsxs("div", {
                  className: "ml-auto flex items-center space-x-4",
                  children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                }),
              ],
            }),
            Q.jsxs(zot, {
              className: "flex flex-col",
              fixedHeight: !0,
              children: [
                Q.jsx("div", {
                  className: "mb-2 flex items-center justify-between space-y-2",
                  children: Q.jsxs("div", {
                    children: [
                      Q.jsx("h2", {
                        className: "text-2xl font-bold tracking-tight",
                        children: e("manage.title"),
                      }),
                      Q.jsx("p", {
                        className: "text-muted-foreground mt-2",
                        children: e("manage.description"),
                      }),
                    ],
                  }),
                }),
                Q.jsx("div", {
                  className:
                    "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                  children: Q.jsx(z5t, {}),
                }),
              ],
            }),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
function $5t({ table: e, refetch: t }) {
  const n = e.getState().columnFilters.length > 0,
    { t: i } = Py("group");
  return Q.jsx("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: Q.jsxs("div", {
      className: "flex flex-1 flex-wrap items-center gap-2 sm:flex-nowrap",
      children: [
        Q.jsx(h4t, { refetch: t }),
        Q.jsx(Q6e, {
          placeholder: i("toolbar.searchPlaceholder"),
          value: e.getColumn("name")?.getFilterValue() ?? "",
          onChange: (t) => e.getColumn("name")?.setFilterValue(t.target.value),
          className: Rf(
            "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
            n && "border-primary/50 ring-primary/20",
          ),
        }),
        n &&
          Q.jsxs(Nm, {
            variant: "ghost",
            onClick: () => e.resetColumnFilters(),
            className: "h-8 px-2 lg:px-3",
            children: [i("toolbar.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
          }),
      ],
    }),
  });
}
const q5t = (e, t) => [
  {
    accessorKey: "id",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.id") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "flex items-center space-x-2",
        children: Q.jsx(hqt, { variant: "outline", children: e.getValue("id") }),
      }),
    enableSorting: !0,
  },
  {
    accessorKey: "name",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.name") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "flex space-x-2",
        children: Q.jsx("span", {
          className: "max-w-32 truncate font-medium",
          children: e.getValue("name"),
        }),
      }),
  },
  {
    accessorKey: "users_count",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.usersCount") }),
    cell: ({ row: e }) =>
      Q.jsxs("div", {
        className: "flex items-center space-x-2 px-4",
        children: [
          Q.jsx(j5t, { className: "h-4 w-4" }),
          Q.jsx("span", { className: "font-medium", children: e.getValue("users_count") }),
        ],
      }),
    enableSorting: !0,
  },
  {
    accessorKey: "server_count",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.serverCount") }),
    cell: ({ row: e }) =>
      Q.jsxs("div", {
        className: "flex items-center space-x-2 px-4",
        children: [
          Q.jsx(Gat, { className: "h-4 w-4" }),
          Q.jsx("span", { className: "font-medium", children: e.getValue("server_count") }),
        ],
      }),
    enableSorting: !0,
    size: 8e3,
  },
  {
    id: "actions",
    header: ({ column: e }) =>
      Q.jsx(SYt, { className: "justify-end", column: e, title: t("columns.actions") }),
    cell: ({ row: n }) =>
      Q.jsxs("div", {
        className: "flex items-center justify-center",
        children: [
          Q.jsx(h4t, {
            defaultValues: n.original,
            refetch: e,
            type: "edit",
            dialogTrigger: Q.jsxs(Nm, {
              variant: "ghost",
              size: "icon",
              className: "h-8 w-8 hover:bg-muted",
              children: [
                Q.jsx(H7e, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
                Q.jsx("span", { className: "sr-only", children: t("form.edit") }),
              ],
            }),
          }),
          Q.jsx(yXt, {
            title: t("messages.deleteConfirm"),
            description: t("messages.deleteDescription"),
            confirmText: t("messages.deleteButton"),
            variant: "destructive",
            onConfirm: async () => {
              nD({ id: n.original.id }).then(({ data: n }) => {
                n && (hN.success(t("messages.updateSuccess")), e());
              });
            },
            children: Q.jsxs(Nm, {
              variant: "ghost",
              size: "icon",
              className: "h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",
              children: [
                Q.jsx(ilt, {
                  className:
                    "h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400",
                }),
                Q.jsx("span", { className: "sr-only", children: t("messages.deleteButton") }),
              ],
            }),
          }),
        ],
      }),
  },
];
function K5t() {
  const { t: e } = Py("group"),
    [t, n] = H.useState({}),
    [i, r] = H.useState({}),
    [o, s] = H.useState([]),
    [a, l] = H.useState([]),
    {
      data: c,
      refetch: d,
      isLoading: u,
    } = gC({
      queryKey: ["serverGroupList"],
      queryFn: async () => {
        const { data: e } = await eD();
        return e;
      },
    }),
    h = PKt({
      data: c || [],
      columns: q5t(d, e),
      state: { sorting: a, columnVisibility: i, rowSelection: t, columnFilters: o },
      enableRowSelection: !0,
      onRowSelectionChange: n,
      onSortingChange: l,
      onColumnFiltersChange: s,
      onColumnVisibilityChange: r,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsx(QKt, {
    table: h,
    toolbar: (e) => Q.jsx($5t, { table: e, refetch: d }),
    isLoading: u,
    mobilePrimaryField: "name",
    mobileGridFields: ["users_count", "server_count"],
  });
}
const G5t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("group");
          return Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                children: [
                  Q.jsx(Vdt, {}),
                  Q.jsxs("div", {
                    className: "ml-auto flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                className: "flex flex-col",
                fixedHeight: !0,
                children: [
                  Q.jsx("div", {
                    className: "mb-2 flex items-center justify-between space-y-2",
                    children: Q.jsxs("div", {
                      children: [
                        Q.jsx("h2", {
                          className: "text-2xl font-bold tracking-tight",
                          children: e("title"),
                        }),
                        Q.jsx("p", {
                          className: "mt-2 text-muted-foreground",
                          children: e("description"),
                        }),
                      ],
                    }),
                  }),
                  Q.jsx("div", {
                    className:
                      "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                    children: Q.jsx(K5t, {}),
                  }),
                ],
              }),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  Z5t = (e) =>
    gy({
      id: cy().optional(),
      remarks: ly().min(1, e("form.validation.remarks")),
      match: uy().optional(),
      action: ly().optional(),
      action_value: uy().optional().nullable(),
    });
function Y5t({
  refetch: e,
  dialogTrigger: t,
  defaultValues: n = { remarks: "", match: [], action: "block", action_value: "" },
  type: i = "create",
}) {
  const { t: r } = Py("route"),
    [o, s] = H.useState(!1),
    [a, l] = H.useState(!1),
    c = kv({ resolver: Ov(Z5t(r)), values: n, mode: "onChange" }),
    d = (t) => {
      l(!0);
      const n = t.match,
        o = Array.isArray(n) ? n : "string" == typeof n ? n.split("\n") : [],
        a = { ...t, match: o.filter((e) => e && "" !== e.trim()) };
      ("dns" !== a.action && "proxy" !== a.action && (a.action_value = ""),
        oD(a)
          .then((t) => {
            (s(!1),
              e && e(),
              hN.success(r("edit" === i ? "messages.updateSuccess" : "messages.createSuccess")),
              c.reset());
          })
          .catch((e) => {
            hN.error(r("messages.saveFailed") || "保存失败");
          })
          .finally(() => {
            l(!1);
          }));
    };
  return Q.jsxs(Jet, {
    open: o,
    onOpenChange: s,
    children: [
      Q.jsx(ett, {
        asChild: !0,
        children:
          t ||
          Q.jsxs(Nm, {
            variant: "outline",
            size: "sm",
            className: "space-x-2",
            children: [
              Q.jsx(yYt, { icon: "ion:add" }),
              " ",
              Q.jsx("div", { children: r("form.add") }),
            ],
          }),
      }),
      Q.jsx(xYt, {
        title: r("edit" === i ? "form.edit" : "form.create"),
        onCancel: () => s(!1),
        onSubmit: c.handleSubmit(d),
        isSubmitting: a,
        children: Q.jsx(Hy, {
          ...c,
          children: Q.jsxs("form", {
            onSubmit: c.handleSubmit(d),
            className: "space-y-4",
            children: [
              Object.keys(c.formState.errors).length > 0 &&
                Q.jsx("div", {
                  className:
                    "mb-4 rounded border border-destructive/20 bg-destructive/10 p-2 font-mono text-xs text-destructive",
                  children: r("messages.validationError") || "表单校验失败，请检查输入",
                }),
              Q.jsx(eZt, {
                control: c.control,
                name: "remarks",
                label: r("form.remarks"),
                placeholder: r("form.remarksPlaceholder"),
                required: !0,
              }),
              Q.jsx(eZt, {
                control: c.control,
                name: "match",
                label: r("form.match"),
                required: !0,
                extra: Q.jsx(Zy, {
                  children: Q.jsx(_Gt, {
                    className: "min-h-[120px] font-mono text-xs",
                    placeholder: r("form.matchPlaceholder"),
                    value: Array.isArray(c.watch("match")) ? c.watch("match").join("\n") : "",
                    onChange: (e) => {
                      const t = e.target.value.split("\n");
                      c.setValue("match", t);
                    },
                  }),
                }),
              }),
              Q.jsx(eZt, {
                control: c.control,
                name: "action",
                label: r("form.action"),
                required: !0,
                extra: Q.jsxs(THt, {
                  onValueChange: (e) => c.setValue("action", e),
                  value: c.watch("action"),
                  children: [
                    Q.jsx(Zy, {
                      children: Q.jsx(OHt, {
                        className: "h-9 font-mono text-xs",
                        children: Q.jsx(RHt, { placeholder: r("form.actionPlaceholder") }),
                      }),
                    }),
                    Q.jsxs(PHt, {
                      children: [
                        Q.jsx(FHt, { value: "block", children: r("actions.block") }),
                        Q.jsx(FHt, { value: "dns", children: r("actions.dns") }),
                        Q.jsx(FHt, { value: "direct", children: r("actions.direct") }),
                        Q.jsx(FHt, { value: "proxy", children: r("actions.proxy") }),
                      ],
                    }),
                  ],
                }),
              }),
              "dns" === c.watch("action") &&
                Q.jsx(eZt, {
                  control: c.control,
                  name: "action_value",
                  label: r("form.dns"),
                  placeholder: r("form.dnsPlaceholder"),
                  required: !0,
                }),
              "proxy" === c.watch("action") &&
                Q.jsx(eZt, {
                  control: c.control,
                  name: "action_value",
                  label: r("form.proxy"),
                  placeholder: r("form.proxyPlaceholder"),
                  required: !0,
                }),
            ],
          }),
        }),
      }),
    ],
  });
}
function X5t({ table: e, refetch: t }) {
  const n = e.getState().columnFilters.length > 0,
    { t: i } = Py("route");
  return Q.jsx("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: Q.jsxs("div", {
      className:
        "flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",
      children: [
        Q.jsx(Y5t, { refetch: t }),
        Q.jsx(Q6e, {
          placeholder: i("toolbar.searchPlaceholder"),
          value: e.getColumn("remarks")?.getFilterValue() ?? "",
          onChange: (t) => e.getColumn("remarks")?.setFilterValue(t.target.value),
          className: "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
        }),
        n &&
          Q.jsxs(Nm, {
            variant: "ghost",
            onClick: () => e.resetColumnFilters(),
            className: "h-8 px-2 lg:px-3",
            children: [i("toolbar.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
          }),
      ],
    }),
  });
}
function Q5t({ columns: e, data: t, refetch: n, isLoading: i = !1 }) {
  const [r, o] = H.useState({}),
    [s, a] = H.useState({}),
    [l, c] = H.useState([]),
    [d, u] = H.useState([]),
    h = PKt({
      data: t,
      columns: e,
      state: { sorting: d, columnVisibility: s, rowSelection: r, columnFilters: l },
      enableRowSelection: !0,
      onRowSelectionChange: o,
      onSortingChange: u,
      onColumnFiltersChange: c,
      onColumnVisibilityChange: a,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsx(QKt, {
    table: h,
    toolbar: (e) => Q.jsx(X5t, { table: e, refetch: n }),
    isLoading: i,
    mobilePrimaryField: "remarks",
    mobileGridFields: ["action", "action_value"],
  });
}
const J5t = (e, t) => {
  const n = {
    block: {
      icon: Xat,
      variant: "destructive",
      className:
        "bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-800",
    },
    dns: {
      icon: Iat,
      variant: "secondary",
      className:
        "bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800",
    },
    direct: {
      icon: flt,
      variant: "secondary",
      className:
        "bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-400 hover:bg-green-200 dark:hover:bg-green-800",
    },
    proxy: {
      icon: tat,
      variant: "default",
      className:
        "bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-400 hover:bg-purple-200 dark:hover:bg-purple-800",
    },
  };
  return [
    {
      accessorKey: "id",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.id") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex items-center space-x-2",
          children: Q.jsx(hqt, { variant: "outline", children: e.getValue("id") }),
        }),
      enableSorting: !0,
      enableHiding: !1,
    },
    {
      accessorKey: "remarks",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.remarks") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex space-x-2",
          children: Q.jsx("span", {
            className: "max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",
            children: e.original.remarks,
          }),
        }),
      enableHiding: !1,
      enableSorting: !1,
    },
    {
      accessorKey: "action_value",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.action_value.title") }),
      cell: ({ row: e }) => {
        const n = e.original.action,
          i = e.original.action_value,
          r = e.original.match?.length || 0;
        return Q.jsxs("div", {
          className: "flex flex-col space-y-1",
          children: [
            Q.jsx("span", {
              className: "text-sm font-medium",
              children:
                "dns" === n && i
                  ? t("columns.action_value.dns", { value: i })
                  : "proxy" === n && i
                    ? t("columns.action_value.proxy", { value: i })
                    : "block" === n
                      ? Q.jsx("span", {
                          className: "text-destructive",
                          children: t("columns.action_value.block"),
                        })
                      : t("columns.action_value.direct"),
            }),
            Q.jsx("span", {
              className: "text-xs text-muted-foreground",
              children: t("columns.matchRules", { count: r }),
            }),
          ],
        });
      },
      enableHiding: !1,
      enableSorting: !1,
      size: 300,
    },
    {
      accessorKey: "action",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.action") }),
      cell: ({ row: e }) => {
        const i = e.getValue("action"),
          r = n[i]?.icon;
        return Q.jsx("div", {
          className: "flex items-center space-x-2",
          children: Q.jsxs(hqt, {
            variant: n[i]?.variant || "default",
            className: Rf("flex items-center gap-1.5 px-3 py-1 capitalize", n[i]?.className),
            children: [r && Q.jsx(r, { className: "h-3.5 w-3.5" }), t(`actions.${i}`)],
          }),
        });
      },
      enableSorting: !1,
      size: 9e3,
    },
    {
      id: "actions",
      header: () => Q.jsx("div", { className: "text-right", children: t("columns.actions") }),
      cell: ({ row: n }) =>
        Q.jsxs("div", {
          className: "flex items-center justify-center",
          children: [
            Q.jsx(Y5t, {
              defaultValues: n.original,
              refetch: e,
              type: "edit",
              dialogTrigger: Q.jsxs(Nm, {
                variant: "ghost",
                size: "icon",
                className: "h-8 w-8 hover:bg-muted",
                children: [
                  Q.jsx(H7e, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
                  Q.jsx("span", { className: "sr-only", children: t("form.edit") }),
                ],
              }),
            }),
            Q.jsx(yXt, {
              title: t("messages.deleteConfirm"),
              description: t("messages.deleteDescription"),
              confirmText: t("messages.deleteButton"),
              variant: "destructive",
              onConfirm: async () => {
                sD({ id: n.original.id }).then(({ data: n }) => {
                  n && (hN.success(t("messages.deleteSuccess")), e());
                });
              },
              children: Q.jsxs(Nm, {
                variant: "ghost",
                size: "icon",
                className: "h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",
                children: [
                  Q.jsx(ilt, {
                    className:
                      "h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400",
                  }),
                  Q.jsx("span", { className: "sr-only", children: t("messages.deleteButton") }),
                ],
              }),
            }),
          ],
        }),
    },
  ];
};
const e3t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("route"),
            [t, n] = H.useState([]),
            [i, r] = H.useState(!0);
          function o() {
            (r(!0),
              rD()
                .then(({ data: e }) => {
                  n(e);
                })
                .finally(() => {
                  r(!1);
                }));
          }
          return (
            H.useEffect(() => {
              o();
            }, []),
            Q.jsxs(Wot, {
              children: [
                Q.jsxs(Hot, {
                  children: [
                    Q.jsx(Vdt, {}),
                    Q.jsxs("div", {
                      className: "ml-auto flex items-center space-x-4",
                      children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                    }),
                  ],
                }),
                Q.jsxs(zot, {
                  className: "flex flex-col",
                  fixedHeight: !0,
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 flex items-center justify-between space-y-2",
                      children: Q.jsxs("div", {
                        children: [
                          Q.jsx("h2", {
                            className: "text-2xl font-bold tracking-tight",
                            children: e("title"),
                          }),
                          Q.jsx("p", {
                            className: "mt-2 text-muted-foreground",
                            children: e("description"),
                          }),
                        ],
                      }),
                    }),
                    Q.jsx("div", {
                      className:
                        "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                      children: Q.jsx(Q5t, {
                        data: t,
                        columns: J5t(o, e),
                        refetch: o,
                        isLoading: i,
                      }),
                    }),
                  ],
                }),
              ],
            })
          );
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  t3t = H.createContext(void 0);
function n3t() {
  const e = H.useContext(t3t);
  if (void 0 === e) throw new Error("usePlanEdit must be used within a PlanEditProvider");
  return e;
}
function i3t({ table: e, saveOrder: t, isSortMode: n }) {
  const { setIsOpen: i } = n3t(),
    { t: r } = Py("subscribe");
  return Q.jsxs("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: [
      Q.jsxs("div", {
        className: "flex flex-1 flex-wrap items-center gap-2 sm:flex-nowrap",
        children: [
          Q.jsxs(Nm, {
            variant: "outline",
            className: "space-x-2",
            size: "sm",
            onClick: () => i(!0),
            children: [Q.jsx(yYt, { icon: "ion:add" }), Q.jsx("div", { children: r("plan.add") })],
          }),
          Q.jsx(Q6e, {
            placeholder: r("plan.search"),
            value: e.getColumn("name")?.getFilterValue() ?? "",
            onChange: (t) => e.getColumn("name")?.setFilterValue(t.target.value),
            className: "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
          }),
        ],
      }),
      e.getRowCount() > 0 &&
        Q.jsx("div", {
          className: "hidden items-center gap-2 md:flex",
          children: Q.jsx(Nm, {
            variant: n ? "default" : "outline",
            onClick: t,
            size: "sm",
            children: r(n ? "plan.sort.save" : "plan.sort.edit"),
          }),
        }),
    ],
  });
}
function r3t({ plan: e, refreshData: t, t: n }) {
  const { setIsOpen: i, setEditingPlan: r } = n3t();
  return Q.jsxs("div", {
    className: "flex items-center justify-center",
    children: [
      Q.jsxs(Nm, {
        variant: "ghost",
        size: "icon",
        className: "h-8 w-8 hover:bg-muted",
        onClick: () => {
          (r(e), i(!0));
        },
        children: [
          Q.jsx(H7e, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
          Q.jsx("span", { className: "sr-only", children: n("plan.columns.edit") }),
        ],
      }),
      Q.jsx(yXt, {
        title: n("plan.columns.delete_confirm.title"),
        description: n("plan.columns.delete_confirm.description"),
        confirmText: n("plan.columns.delete"),
        cancelText: n("common:cancel"),
        variant: "destructive",
        onConfirm: async () => {
          RD({ id: e.id }).then(({ data: e }) => {
            e && (hN.success(n("plan.columns.delete_confirm.success")), t());
          });
        },
        children: Q.jsxs(Nm, {
          variant: "ghost",
          size: "icon",
          className: "h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",
          children: [
            Q.jsx(ilt, {
              className: "h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400",
            }),
            Q.jsx("span", { className: "sr-only", children: n("plan.columns.delete") }),
          ],
        }),
      }),
    ],
  });
}
const o3t = {
    monthly: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    quarterly: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    half_yearly: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    yearly: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    two_yearly: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    three_yearly: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    onetime: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    reset_traffic: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
  },
  s3t = (e, t) => [
    {
      id: "drag-handle",
      header: () => null,
      cell: () =>
        Q.jsx("div", { className: "cursor-move", children: Q.jsx(P7e, { className: "size-4" }) }),
      size: 40,
      enableSorting: !1,
    },
    {
      accessorKey: "id",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("plan.columns.id") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex items-center space-x-2",
          children: Q.jsx(hqt, { variant: "outline", children: e.getValue("id") }),
        }),
      enableSorting: !0,
      enableHiding: !1,
    },
    {
      accessorKey: "show",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("plan.columns.show") }),
      cell: ({ row: t }) =>
        Q.jsx(mGt, {
          defaultChecked: t.getValue("show"),
          onCheckedChange: (n) => {
            ID({ id: t.original.id, show: n }).then(({ data: t }) => {
              !t && e();
            });
          },
        }),
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "sell",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("plan.columns.sell") }),
      cell: ({ row: t }) =>
        Q.jsx(mGt, {
          defaultChecked: t.getValue("sell"),
          onCheckedChange: (n) => {
            ID({ id: t.original.id, sell: n }).then(({ data: t }) => {
              !t && e();
            });
          },
        }),
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "renew",
      header: ({ column: e }) =>
        Q.jsx(SYt, {
          column: e,
          title: t("plan.columns.renew"),
          tooltip: t("plan.columns.renew_tooltip"),
        }),
      cell: ({ row: t }) =>
        Q.jsx(mGt, {
          defaultChecked: t.getValue("renew"),
          onCheckedChange: (n) => {
            ID({ id: t.original.id, renew: n }).then(({ data: t }) => {
              !t && e();
            });
          },
        }),
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "name",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("plan.columns.name") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex space-x-2",
          children: Q.jsx("span", {
            className: "max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",
            children: e.getValue("name"),
          }),
        }),
      enableSorting: !1,
      enableHiding: !1,
      size: 900,
    },
    {
      accessorKey: "users_count",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("plan.columns.stats") }),
      cell: ({ row: e }) => {
        const t = e.getValue("users_count") || 0,
          n = e.original.active_users_count || 0,
          i = t > 0 ? Math.round((n / t) * 100) : 0;
        return Q.jsxs("div", {
          className: "flex items-center gap-2",
          children: [
            Q.jsx(Pst, {
              children: Q.jsxs(jst, {
                children: [
                  Q.jsx(Fst, {
                    asChild: !0,
                    children: Q.jsxs("div", {
                      className:
                        "flex items-center gap-1 rounded-md bg-slate-50 px-2 py-1 hover:bg-slate-100 transition-colors cursor-help",
                      children: [
                        Q.jsx(dlt, { className: "h-3.5 w-3.5 text-slate-500" }),
                        Q.jsx("span", {
                          className: "text-sm font-medium text-slate-700",
                          children: t,
                        }),
                      ],
                    }),
                  }),
                  Q.jsx(Bst, {
                    side: "top",
                    className: "max-w-xs",
                    children: Q.jsxs("div", {
                      className: "space-y-1",
                      children: [
                        Q.jsx("p", { className: "font-medium", children: "总用户数" }),
                        Q.jsx("p", {
                          className: "text-xs text-muted-foreground",
                          children: "所有使用该套餐的用户（包括已过期）",
                        }),
                      ],
                    }),
                  }),
                ],
              }),
            }),
            Q.jsx(Pst, {
              children: Q.jsxs(jst, {
                children: [
                  Q.jsx(Fst, {
                    asChild: !0,
                    children: Q.jsxs("div", {
                      className:
                        "flex items-center gap-1 rounded-md bg-green-50 px-2 py-1 hover:bg-green-100 transition-colors cursor-help",
                      children: [
                        Q.jsx(llt, { className: "h-3.5 w-3.5 text-green-600" }),
                        Q.jsx("span", {
                          className: "text-sm font-medium text-green-700",
                          children: n,
                        }),
                      ],
                    }),
                  }),
                  Q.jsx(Bst, {
                    side: "top",
                    className: "max-w-xs",
                    children: Q.jsxs("div", {
                      className: "space-y-1",
                      children: [
                        Q.jsx("p", { className: "font-medium", children: "有效期内用户" }),
                        Q.jsx("p", {
                          className: "text-xs text-muted-foreground",
                          children: "当前仍在有效期内的活跃用户",
                        }),
                        t > 0 &&
                          Q.jsxs("p", {
                            className: "text-xs font-medium text-green-600",
                            children: ["活跃率：", i, "%"],
                          }),
                      ],
                    }),
                  }),
                ],
              }),
            }),
          ],
        });
      },
      enableSorting: !0,
      size: 120,
    },
    {
      accessorKey: "group",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("plan.columns.group") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex max-w-[600px] flex-wrap items-center gap-1.5 text-nowrap",
          children: Q.jsx(hqt, {
            variant: "secondary",
            className: Rf(
              "px-2 py-0.5 font-medium",
              "bg-secondary/50 hover:bg-secondary/70",
              "border border-border/50",
              "transition-all duration-200",
              "cursor-default select-none",
              "flex items-center gap-1.5",
            ),
            children: e.getValue("group")?.name,
          }),
        }),
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "prices",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("plan.columns.price") }),
      cell: ({ row: e }) => {
        const n = e.getValue("prices"),
          i = [
            {
              period: t("plan.columns.price_period.monthly"),
              key: "monthly",
              unit: t("plan.columns.price_period.unit.month"),
            },
            {
              period: t("plan.columns.price_period.quarterly"),
              key: "quarterly",
              unit: t("plan.columns.price_period.unit.quarter"),
            },
            {
              period: t("plan.columns.price_period.half_yearly"),
              key: "half_yearly",
              unit: t("plan.columns.price_period.unit.half_year"),
            },
            {
              period: t("plan.columns.price_period.yearly"),
              key: "yearly",
              unit: t("plan.columns.price_period.unit.year"),
            },
            {
              period: t("plan.columns.price_period.two_yearly"),
              key: "two_yearly",
              unit: t("plan.columns.price_period.unit.two_year"),
            },
            {
              period: t("plan.columns.price_period.three_yearly"),
              key: "three_yearly",
              unit: t("plan.columns.price_period.unit.three_year"),
            },
            { period: t("plan.columns.price_period.onetime"), key: "onetime", unit: "" },
            {
              period: t("plan.columns.price_period.reset_traffic"),
              key: "reset_traffic",
              unit: t("plan.columns.price_period.unit.times"),
            },
          ];
        return n
          ? Q.jsx("div", {
              className: "flex flex-wrap items-center gap-2",
              children: i.map(
                ({ period: e, key: t, unit: i }) =>
                  null != n[t] &&
                  Q.jsxs(
                    hqt,
                    {
                      variant: "secondary",
                      className: Rf(
                        "px-2 py-0.5 font-medium transition-colors text-nowrap",
                        o3t[t].color,
                        o3t[t].bgColor,
                        "border border-border/50",
                        "hover:bg-slate-200/80",
                      ),
                      children: [e, " ¥", n[t], i],
                    },
                    t,
                  ),
              ),
            })
          : Q.jsx("div", {
              className: "flex items-center",
              children: Q.jsx(hqt, {
                variant: "outline",
                className: "px-2 py-0.5 text-xs text-muted-foreground border-dashed",
                children: t("plan.columns.price_period.no_price"),
              }),
            });
      },
      enableSorting: !1,
      size: 9e3,
    },
    {
      id: "actions",
      header: ({ column: e }) =>
        Q.jsx(SYt, { className: "justify-end", column: e, title: t("plan.columns.actions") }),
      cell: ({ row: n }) => Q.jsx(r3t, { plan: n.original, refreshData: e, t: t }),
    },
  ];
function a3t({ children: e, refreshData: t }) {
  const [n, i] = H.useState(!1),
    [r, o] = H.useState(null);
  return Q.jsx(t3t.Provider, {
    value: { isOpen: n, setIsOpen: i, editingPlan: r, setEditingPlan: o, refreshData: t },
    children: e,
  });
}
const l3t = gy({
    id: cy().nullable(),
    group_id: py([cy(), ly()]).nullable().optional(),
    name: ly().min(1).max(250),
    tags: hy(ly()).nullable().optional(),
    content: ly().nullable().optional(),
    transfer_enable: py([cy().min(0), ly().min(1)]),
    prices: gy({
      monthly: py([cy(), ly()]).nullable().optional(),
      quarterly: py([cy(), ly()]).nullable().optional(),
      half_yearly: py([cy(), ly()]).nullable().optional(),
      yearly: py([cy(), ly()]).nullable().optional(),
      two_yearly: py([cy(), ly()]).nullable().optional(),
      three_yearly: py([cy(), ly()]).nullable().optional(),
      onetime: py([cy(), ly()]).nullable().optional(),
      reset_traffic: py([cy(), ly()]).nullable().optional(),
    }).default({}),
    speed_limit: py([cy(), ly()]).nullable().optional(),
    capacity_limit: py([cy(), ly()]).nullable().optional(),
    device_limit: py([cy(), ly()]).nullable().optional(),
    force_update: dy().optional(),
    reset_traffic_method: cy().nullable(),
    users_count: cy().optional(),
    active_users_count: cy().optional(),
  }),
  c3t = {
    id: null,
    group_id: null,
    name: "",
    tags: [],
    content: "",
    transfer_enable: "",
    prices: {
      monthly: "",
      quarterly: "",
      half_yearly: "",
      yearly: "",
      two_yearly: "",
      three_yearly: "",
      onetime: "",
      reset_traffic: "",
    },
    speed_limit: "",
    capacity_limit: "",
    device_limit: "",
    force_update: !1,
    reset_traffic_method: null,
  },
  d3t = {
    monthly: { label: "月付", months: 1, discount: 1 },
    quarterly: { label: "季付", months: 3, discount: 0.95 },
    half_yearly: { label: "半年付", months: 6, discount: 0.9 },
    yearly: { label: "年付", months: 12, discount: 0.85 },
    two_yearly: { label: "两年付", months: 24, discount: 0.8 },
    three_yearly: { label: "三年付", months: 36, discount: 0.75 },
    onetime: { label: "流量包", months: 1, discount: 1 },
    reset_traffic: { label: "重置包", months: 1, discount: 1 },
  },
  u3t = [
    { value: null, label: "follow_system" },
    { value: 0, label: "monthly_first" },
    { value: 1, label: "monthly_reset" },
    { value: 2, label: "no_reset" },
    { value: 3, label: "yearly_first" },
    { value: 4, label: "yearly_reset" },
  ];
function h3t() {
  const { isOpen: e, setIsOpen: t, editingPlan: n, setEditingPlan: i, refreshData: r } = n3t(),
    [o, s] = H.useState(!1),
    [a, l] = H.useState(!1),
    { t: c } = Py("subscribe"),
    d = kv({ resolver: Ov(l3t), defaultValues: { ...c3t, ...(n || {}) }, mode: "onChange" });
  H.useEffect(() => {
    n ? d.reset({ ...c3t, ...n }) : d.reset(c3t);
  }, [n, d]);
  const u = new q2t({ html: !0 }),
    [h, g] = H.useState();
  async function p() {
    eD().then(({ data: e }) => {
      g(e);
    });
  }
  H.useEffect(() => {
    e && p();
  }, [e]);
  const f = () => {
    (t(!1), i(null), d.reset(c3t));
  };
  return Q.jsx(Jet, {
    open: e,
    onOpenChange: f,
    children: Q.jsx(xYt, {
      title: c(n ? "plan.form.edit_title" : "plan.form.add_title"),
      isSubmitting: o,
      onCancel: f,
      onSubmit: d.handleSubmit(
        async (e) => {
          (s(!0),
            TD(e)
              .then(({ data: e }) => {
                e &&
                  (hN.success(
                    c(n ? "plan.form.submit.success.update" : "plan.form.submit.success.add"),
                  ),
                  f(),
                  r());
              })
              .finally(() => {
                s(!1);
              }));
        },
        (e) => {
          const t = Object.values(e)
            .map((e) => e?.message)
            .filter(Boolean);
          hN.error(t.join("\n") || c("plan.form.submit.error.validation", "表单校验失败"));
        },
      ),
      submitLabel: c("plan.form.submit.submit"),
      cancelLabel: c("plan.form.submit.cancel"),
      extraButtons: n
        ? Q.jsx(Hy, {
            ...d,
            children: Q.jsx(Uy, {
              control: d.control,
              name: "force_update",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  className: "flex flex-row items-center space-x-2 space-y-0",
                  children: [
                    Q.jsx(Zy, {
                      children: Q.jsx(L5t, { checked: e.value, onCheckedChange: e.onChange }),
                    }),
                    Q.jsx(Gy, {
                      className: "cursor-pointer select-none text-xs font-normal",
                      children: c("plan.form.force_update.label"),
                    }),
                  ],
                }),
            }),
          })
        : null,
      children: Q.jsx(Hy, {
        ...d,
        children: Q.jsxs("form", {
          className: "space-y-6",
          children: [
            Q.jsxs("div", {
              className: "grid grid-cols-1 gap-4 md:grid-cols-2",
              children: [
                Q.jsx(eZt, {
                  control: d.control,
                  name: "name",
                  label: c("plan.form.name.label"),
                  placeholder: c("plan.form.name.placeholder"),
                }),
                Q.jsx(Uy, {
                  control: d.control,
                  name: "tags",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, { children: c("plan.form.tags.label", "标签") }),
                        Q.jsx(Zy, {
                          children: Q.jsx(t0t, {
                            value: e.value || [],
                            onChange: e.onChange,
                            placeholder: c("plan.form.tags.placeholder", "输入标签后按回车确认"),
                            className: "w-full",
                          }),
                        }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "grid grid-cols-1 gap-4 md:grid-cols-2",
              children: [
                Q.jsx(Uy, {
                  control: d.control,
                  name: "group_id",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsxs(Gy, {
                          className: "flex items-center justify-between",
                          children: [
                            c("plan.form.group.label"),
                            Q.jsx(h4t, {
                              dialogTrigger: Q.jsx(Nm, {
                                variant: "link",
                                size: "sm",
                                className: "h-auto p-0 text-xs",
                                children: c("plan.form.group.add"),
                              }),
                              refetch: p,
                            }),
                          ],
                        }),
                        Q.jsxs(THt, {
                          value: e.value?.toString() ?? "",
                          onValueChange: (t) => e.onChange(t ? Number(t) : null),
                          children: [
                            Q.jsx(Zy, {
                              children: Q.jsx(OHt, {
                                children: Q.jsx(RHt, {
                                  placeholder: c("plan.form.group.placeholder"),
                                }),
                              }),
                            }),
                            Q.jsx(PHt, {
                              children: h?.map((e) =>
                                Q.jsx(FHt, { value: e.id.toString(), children: e.name }, e.id),
                              ),
                            }),
                          ],
                        }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
                Q.jsx(eZt, {
                  control: d.control,
                  name: "transfer_enable",
                  label: c("plan.form.transfer.label"),
                  type: "number",
                  min: 0,
                  unit: c("plan.form.transfer.unit"),
                  placeholder: c("plan.form.transfer.placeholder"),
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "grid grid-cols-1 gap-4 md:grid-cols-2",
              children: [
                Q.jsx(eZt, {
                  control: d.control,
                  name: "speed_limit",
                  label: c("plan.form.speed.label"),
                  type: "number",
                  min: 0,
                  unit: c("plan.form.speed.unit"),
                  placeholder: c("plan.form.speed.placeholder"),
                }),
                Q.jsx(eZt, {
                  control: d.control,
                  name: "device_limit",
                  label: c("plan.form.device.label"),
                  type: "number",
                  min: 0,
                  unit: c("plan.form.device.unit"),
                  placeholder: c("plan.form.device.placeholder"),
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "grid grid-cols-1 gap-4 md:grid-cols-2",
              children: [
                Q.jsx(eZt, {
                  control: d.control,
                  name: "capacity_limit",
                  label: c("plan.form.capacity.label"),
                  type: "number",
                  min: 0,
                  unit: c("plan.form.capacity.unit"),
                  placeholder: c("plan.form.capacity.placeholder"),
                }),
                Q.jsx(Uy, {
                  control: d.control,
                  name: "reset_traffic_method",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      children: [
                        Q.jsx(Gy, { children: c("plan.form.reset_method.label") }),
                        Q.jsxs(THt, {
                          value: e.value?.toString() ?? "null",
                          onValueChange: (t) => e.onChange("null" == t ? null : Number(t)),
                          children: [
                            Q.jsx(Zy, {
                              children: Q.jsx(OHt, {
                                children: Q.jsx(RHt, {
                                  placeholder: c("plan.form.reset_method.placeholder"),
                                }),
                              }),
                            }),
                            Q.jsx(PHt, {
                              children: u3t.map((e) =>
                                Q.jsx(
                                  FHt,
                                  {
                                    value: e.value?.toString() ?? "null",
                                    children: c(`plan.form.reset_method.options.${e.label}`),
                                  },
                                  e.value ?? "null",
                                ),
                              ),
                            }),
                          ],
                        }),
                        Q.jsx(Xy, {}),
                      ],
                    }),
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "space-y-4 rounded-lg border border-dashed p-4",
              children: [
                Q.jsxs("div", {
                  className: "flex items-center justify-between",
                  children: [
                    Q.jsx("h3", {
                      className: "text-sm font-medium",
                      children: c("plan.form.price.title"),
                    }),
                    Q.jsxs("div", {
                      className: "flex items-center gap-2",
                      children: [
                        Q.jsxs("div", {
                          className: "relative",
                          children: [
                            Q.jsx(Q6e, {
                              type: "number",
                              step: "0.01",
                              placeholder: c("plan.form.price.base_price"),
                              className: "h-8 w-24 pl-5 text-xs",
                              onChange: (e) =>
                                ((e) => {
                                  if (isNaN(e)) return;
                                  const t = Object.entries(d3t).reduce((t, [n, i]) => {
                                    const r = e * i.months * i.discount;
                                    return { ...t, [n]: r.toFixed(2) };
                                  }, {});
                                  d.setValue("prices", t, { shouldDirty: !0 });
                                })(parseFloat(e.target.value)),
                            }),
                            Q.jsx("span", {
                              className:
                                "absolute left-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground",
                              children: "¥",
                            }),
                          ],
                        }),
                        Q.jsx(Nm, {
                          variant: "outline",
                          size: "sm",
                          className: "h-8 px-2",
                          type: "button",
                          onClick: () => {
                            const e = Object.keys(d3t).reduce((e, t) => ({ ...e, [t]: "" }), {});
                            d.setValue("prices", e, { shouldDirty: !0 });
                          },
                          children: Q.jsx(ilt, { className: "h-3.5 w-3.5" }),
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsx("div", {
                  className: "grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4",
                  children: Object.entries(d3t)
                    .filter(([e]) => !["onetime", "reset_traffic"].includes(e))
                    .map(([e]) =>
                      Q.jsx(
                        eZt,
                        {
                          control: d.control,
                          name: `prices.${e}`,
                          label: c(`plan.columns.price_period.${e}`),
                          type: "number",
                          step: "0.01",
                          prefix: "¥",
                          className: "text-xs",
                        },
                        e,
                      ),
                    ),
                }),
                Q.jsx(Um, {}),
                Q.jsx("div", {
                  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
                  children: ["onetime", "reset_traffic"].map((e) =>
                    Q.jsx(
                      eZt,
                      {
                        control: d.control,
                        name: `prices.${e}`,
                        label: c(`plan.columns.price_period.${e}`),
                        description: c(
                          "onetime" === e
                            ? "plan.form.price.onetime_desc"
                            : "plan.form.price.reset_desc",
                        ),
                        type: "number",
                        step: "0.01",
                        prefix: "¥",
                      },
                      e,
                    ),
                  ),
                }),
              ],
            }),
            Q.jsx(Uy, {
              control: d.control,
              name: "content",
              render: ({ field: e }) =>
                Q.jsxs(Ky, {
                  className: "space-y-3",
                  children: [
                    Q.jsxs("div", {
                      className: "flex items-center justify-between",
                      children: [
                        Q.jsx(Gy, { children: c("plan.form.content.label") }),
                        Q.jsxs("div", {
                          className: "flex items-center gap-2",
                          children: [
                            Q.jsxs(Nm, {
                              variant: "outline",
                              size: "sm",
                              className: "h-8",
                              type: "button",
                              onClick: () => e.onChange(c("plan.form.content.template.content")),
                              children: [
                                Q.jsx(ult, { className: "mr-2 h-3.5 w-3.5" }),
                                c("plan.form.content.template.button"),
                              ],
                            }),
                            Q.jsxs(Nm, {
                              variant: "outline",
                              size: "sm",
                              className: "h-8",
                              type: "button",
                              onClick: () => l(!a),
                              children: [
                                a
                                  ? Q.jsx(kat, { className: "mr-2 h-3.5 w-3.5" })
                                  : Q.jsx(Eat, { className: "mr-2 h-3.5 w-3.5" }),
                                c(
                                  a
                                    ? "plan.form.content.preview_button.hide"
                                    : "plan.form.content.preview_button.show",
                                ),
                              ],
                            }),
                          ],
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "grid gap-4 " + (a ? "grid-cols-1 lg:grid-cols-2" : "grid-cols-1"),
                      children: [
                        Q.jsx(Zy, {
                          children: Q.jsx(TJt, {
                            style: { height: "300px" },
                            value: e.value || "",
                            renderHTML: (e) => u.render(e),
                            onChange: ({ text: t }) => e.onChange(t),
                            config: {
                              view: { menu: !0, md: !0, html: !1 },
                              canView: { menu: !0, md: !0, html: !1, fullScreen: !1, hideMenu: !1 },
                            },
                            className: "rounded-md border",
                          }),
                        }),
                        a &&
                          Q.jsx("div", {
                            className:
                              "prose prose-sm dark:prose-invert h-[300px] max-w-none overflow-y-auto rounded-md border bg-muted/20 p-4",
                            children: Q.jsx("div", {
                              dangerouslySetInnerHTML: { __html: u.render(e.value || "") },
                            }),
                          }),
                      ],
                    }),
                    Q.jsx(Yy, {
                      className: "text-xs",
                      children: c("plan.form.content.description"),
                    }),
                    Q.jsx(Xy, {}),
                  ],
                }),
            }),
          ],
        }),
      }),
    }),
  });
}
function g3t() {
  const { t: e } = Py("subscribe"),
    [t, n] = H.useState({}),
    [i, r] = H.useState({ "drag-handle": !1 }),
    [o, s] = H.useState([]),
    [a, l] = H.useState([]),
    [c, d] = H.useState(!1),
    [u, h] = H.useState({ pageSize: 20, pageIndex: 0 }),
    [g, p] = H.useState([]),
    {
      refetch: f,
      data: m,
      isLoading: _,
    } = gC({
      queryKey: ["planList"],
      queryFn: async () => {
        const { data: e } = await DD();
        return e;
      },
    });
  (H.useEffect(() => {
    m && p(m);
  }, [m]),
    H.useEffect(() => {
      (r({ "drag-handle": c }), h({ pageSize: c ? 99999 : 10, pageIndex: 0 }));
    }, [c]));
  const v = async () => {
      if (!c) return void d(!0);
      const e = g.map((e) => e.id);
      OD(e)
        .then(() => {
          (hN.success("排序保存成功"), d(!1), f());
        })
        .finally(() => {
          d(!1);
        });
    },
    b = PKt({
      data: g || [],
      columns: s3t(f, e),
      state: { sorting: a, columnVisibility: i, rowSelection: t, columnFilters: o, pagination: u },
      enableRowSelection: !0,
      onPaginationChange: h,
      onRowSelectionChange: n,
      onSortingChange: l,
      onColumnFiltersChange: s,
      onColumnVisibilityChange: r,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
      pageCount: c ? 1 : void 0,
    });
  return Q.jsx(a3t, {
    refreshData: f,
    children: Q.jsxs("div", {
      className: "space-y-4",
      children: [
        Q.jsx(QKt, {
          table: b,
          toolbar: (e) => Q.jsx(i3t, { table: e, refetch: f, saveOrder: v, isSortMode: c }),
          draggable: c,
          onDragStart: (e, t) => {
            c &&
              (e.dataTransfer.setData("text/plain", t.toString()),
              e.currentTarget.classList.add("opacity-50"));
          },
          onDragEnd: (e) => e.currentTarget.classList.remove("opacity-50"),
          onDragOver: (e) => {
            (e.preventDefault(), e.currentTarget.classList.add("bg-muted"));
          },
          onDragLeave: (e) => e.currentTarget.classList.remove("bg-muted"),
          onDrop: (e, t) => {
            if (!c) return;
            (e.preventDefault(), e.currentTarget.classList.remove("bg-muted"));
            const n = parseInt(e.dataTransfer.getData("text/plain"));
            if (n === t) return;
            const i = [...g],
              [r] = i.splice(n, 1);
            (i.splice(t, 0, r), p(i));
          },
          showPagination: !c,
          isLoading: _,
          mobilePrimaryField: "name",
          mobileGridFields: ["prices", "users_count", "group"],
        }),
        Q.jsx(h3t, {}),
      ],
    }),
  });
}
const p3t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("subscribe");
          return Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                children: [
                  Q.jsx(Vdt, {}),
                  Q.jsxs("div", {
                    className: "ml-auto flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                className: "flex flex-col",
                fixedHeight: !0,
                children: [
                  Q.jsx("div", {
                    className: "mb-2 flex items-center justify-between space-y-2",
                    children: Q.jsxs("div", {
                      children: [
                        Q.jsx("h2", {
                          className: "text-2xl font-bold tracking-tight",
                          children: e("plan.title"),
                        }),
                        Q.jsx("p", {
                          className: "mt-2 text-muted-foreground",
                          children: e("plan.page.description"),
                        }),
                      ],
                    }),
                  }),
                  Q.jsx("div", {
                    className:
                      "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                    children: Q.jsx(g3t, {}),
                  }),
                ],
              }),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  f3t = [
    { value: o$t.PENDING, label: s$t()[o$t.PENDING], icon: S7e, color: a$t[o$t.PENDING] },
    { value: o$t.PROCESSING, label: s$t()[o$t.PROCESSING], icon: G7e, color: a$t[o$t.PROCESSING] },
    { value: o$t.COMPLETED, label: s$t()[o$t.COMPLETED], icon: p7e, color: a$t[o$t.COMPLETED] },
    { value: o$t.CANCELLED, label: s$t()[o$t.CANCELLED], icon: L7e, color: a$t[o$t.CANCELLED] },
    { value: o$t.DISCOUNTED, label: s$t()[o$t.DISCOUNTED], icon: p7e, color: a$t[o$t.DISCOUNTED] },
  ],
  m3t = [
    { value: c$t.PENDING, label: d$t()[c$t.PENDING], icon: q7e, color: u$t[c$t.PENDING] },
    { value: c$t.PROCESSING, label: d$t()[c$t.PROCESSING], icon: G7e, color: u$t[c$t.PROCESSING] },
    { value: c$t.VALID, label: d$t()[c$t.VALID], icon: p7e, color: u$t[c$t.VALID] },
    { value: c$t.INVALID, label: d$t()[c$t.INVALID], icon: L7e, color: u$t[c$t.INVALID] },
  ];
function _3t({ column: e, title: t, options: n }) {
  const i = e?.getFacetedUniqueValues(),
    r = e?.getFilterValue(),
    o = Array.isArray(r) ? new Set(r) : void 0 !== r ? new Set([r]) : new Set();
  return Q.jsxs(qUt, {
    children: [
      Q.jsx(KUt, {
        asChild: !0,
        children: Q.jsxs(Nm, {
          variant: "outline",
          size: "sm",
          className: "h-8 border-dashed",
          children: [
            Q.jsx(U7e, { className: "mr-2 h-4 w-4" }),
            t,
            o?.size > 0 &&
              Q.jsxs(Q.Fragment, {
                children: [
                  Q.jsx(Um, { orientation: "vertical", className: "mx-2 h-4" }),
                  Q.jsx(hqt, {
                    variant: "secondary",
                    className: "rounded-sm px-1 font-normal lg:hidden",
                    children: o.size,
                  }),
                  Q.jsx("div", {
                    className: "hidden space-x-1 lg:flex",
                    children:
                      o.size > 2
                        ? Q.jsxs(hqt, {
                            variant: "secondary",
                            className: "rounded-sm px-1 font-normal",
                            children: [o.size, " selected"],
                          })
                        : n
                            .filter((e) => o.has(e.value))
                            .map((e) =>
                              Q.jsx(
                                hqt,
                                {
                                  variant: "secondary",
                                  className: "rounded-sm px-1 font-normal",
                                  children: e.label,
                                },
                                e.value,
                              ),
                            ),
                  }),
                ],
              }),
          ],
        }),
      }),
      Q.jsx(ZUt, {
        className: "w-[200px] p-0",
        align: "start",
        children: Q.jsxs(Rdt, {
          children: [
            Q.jsx(Mdt, { placeholder: t }),
            Q.jsxs(Adt, {
              children: [
                Q.jsx(Pdt, { children: "No results found." }),
                Q.jsx(jdt, {
                  children: n.map((t) => {
                    const n = o.has(t.value);
                    return Q.jsxs(
                      Bdt,
                      {
                        onSelect: () => {
                          const i = new Set(o);
                          n ? i.delete(t.value) : i.add(t.value);
                          const r = Array.from(i);
                          e?.setFilterValue(r.length ? r : void 0);
                        },
                        children: [
                          Q.jsx("div", {
                            className: Rf(
                              "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
                              n
                                ? "bg-primary text-primary-foreground"
                                : "opacity-50 [&_svg]:invisible",
                            ),
                            children: Q.jsx(h7e, { className: Rf("h-4 w-4") }),
                          }),
                          t.icon &&
                            Q.jsx(t.icon, {
                              className: `mr-2 h-4 w-4 text-muted-foreground text-${t.color}`,
                            }),
                          Q.jsx("span", { children: t.label }),
                          i?.get(t.value) &&
                            Q.jsx("span", {
                              className:
                                "ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",
                              children: i.get(t.value),
                            }),
                        ],
                      },
                      t.value,
                    );
                  }),
                }),
                o.size > 0 &&
                  Q.jsxs(Q.Fragment, {
                    children: [
                      Q.jsx(Fdt, {}),
                      Q.jsx(jdt, {
                        children: Q.jsx(Bdt, {
                          onSelect: () => e?.setFilterValue(void 0),
                          className: "justify-center text-center",
                          children: "Clear filters",
                        }),
                      }),
                    ],
                  }),
              ],
            }),
          ],
        }),
      }),
    ],
  });
}
const v3t = gy({ email: ly().min(1), plan_id: cy(), period: ly(), total_amount: cy() }),
  b3t = { email: "", plan_id: 0, total_amount: 0, period: "" };
function y3t({ refetch: e, trigger: t, defaultValues: n }) {
  const { t: i } = Py("order"),
    [r, o] = H.useState(!1),
    s = kv({ resolver: Ov(v3t), defaultValues: { ...b3t, ...n }, mode: "onChange" }),
    [a, l] = H.useState([]);
  return (
    H.useEffect(() => {
      r &&
        DD().then(({ data: e }) => {
          l(e);
        });
    }, [r]),
    Q.jsxs(Jet, {
      open: r,
      onOpenChange: o,
      children: [
        Q.jsx(ett, {
          asChild: !0,
          children:
            t ||
            Q.jsxs(Nm, {
              variant: "outline",
              size: "sm",
              className: "h-8 space-x-2",
              children: [
                Q.jsx(yYt, { icon: "ion:add" }),
                Q.jsx("div", { children: i("dialog.addOrder") }),
              ],
            }),
        }),
        Q.jsx(xYt, {
          title: i("dialog.assignOrder"),
          onSubmit: s.handleSubmit((t) => {
            VD(t).then(({ data: t }) => {
              t && (e && e(), s.reset(), o(!1), hN.success(i("dialog.messages.addSuccess")));
            });
          }),
          onCancel: () => o(!1),
          children: Q.jsx(Hy, {
            ...s,
            children: Q.jsxs("div", {
              className: "grid grid-cols-1 gap-4",
              children: [
                Q.jsx(Uy, {
                  control: s.control,
                  name: "email",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      className: "space-y-1.5",
                      children: [
                        Q.jsx(Gy, {
                          className:
                            "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                          children: i("dialog.fields.userEmail"),
                        }),
                        Q.jsx(Zy, {
                          children: Q.jsx(Q6e, {
                            placeholder: i("dialog.placeholders.email"),
                            ...e,
                          }),
                        }),
                        Q.jsx(Xy, { className: "font-mono text-[10px] uppercase tracking-tight" }),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: s.control,
                  name: "plan_id",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      className: "space-y-1.5",
                      children: [
                        Q.jsx(Gy, {
                          className:
                            "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                          children: i("dialog.fields.subscriptionPlan"),
                        }),
                        Q.jsxs(THt, {
                          onValueChange: (t) => e.onChange(parseInt(t)),
                          value: e.value?.toString(),
                          children: [
                            Q.jsx(Zy, {
                              children: Q.jsx(OHt, {
                                children: Q.jsx(RHt, {
                                  placeholder: i("dialog.placeholders.plan"),
                                }),
                              }),
                            }),
                            Q.jsx(PHt, {
                              children: a.map((e) =>
                                Q.jsx(FHt, { value: e.id.toString(), children: e.name }, e.id),
                              ),
                            }),
                          ],
                        }),
                        Q.jsx(Xy, { className: "font-mono text-[10px] uppercase tracking-tight" }),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: s.control,
                  name: "period",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      className: "space-y-1.5",
                      children: [
                        Q.jsx(Gy, {
                          className:
                            "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                          children: i("dialog.fields.orderPeriod"),
                        }),
                        Q.jsxs(THt, {
                          onValueChange: e.onChange,
                          value: e.value,
                          children: [
                            Q.jsx(Zy, {
                              children: Q.jsx(OHt, {
                                children: Q.jsx(RHt, {
                                  placeholder: i("dialog.placeholders.period"),
                                }),
                              }),
                            }),
                            Q.jsx(PHt, {
                              children: Object.values(h$t).map((e) =>
                                Q.jsx(FHt, { value: e, children: i(`period.${e}`) }, e),
                              ),
                            }),
                          ],
                        }),
                        Q.jsx(Xy, { className: "font-mono text-[10px] uppercase tracking-tight" }),
                      ],
                    }),
                }),
                Q.jsx(Uy, {
                  control: s.control,
                  name: "total_amount",
                  render: ({ field: e }) =>
                    Q.jsxs(Ky, {
                      className: "space-y-1.5",
                      children: [
                        Q.jsx(Gy, {
                          className:
                            "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                          children: i("dialog.fields.paymentAmount"),
                        }),
                        Q.jsxs("div", {
                          className: "relative",
                          children: [
                            Q.jsx(Zy, {
                              children: Q.jsx(Q6e, {
                                type: "number",
                                placeholder: i("dialog.placeholders.amount"),
                                value: e.value / 100,
                                onChange: (t) =>
                                  e.onChange(100 * parseFloat(t.currentTarget.value)),
                                className: "pr-10",
                              }),
                            }),
                            Q.jsx("div", {
                              className:
                                "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",
                              children: Q.jsx("span", {
                                className:
                                  "font-mono text-[10px] font-bold uppercase text-muted-foreground/40",
                                children: "CNY",
                              }),
                            }),
                          ],
                        }),
                        Q.jsx(Xy, { className: "font-mono text-[10px] uppercase tracking-tight" }),
                      ],
                    }),
                }),
              ],
            }),
          }),
        }),
      ],
    })
  );
}
function x3t({ table: e, refetch: t }) {
  const { t: n } = Py("order"),
    i = e.getState().columnFilters.length > 0,
    r = Object.values(l$t)
      .filter((e) => "number" == typeof e)
      .map((e) => ({
        label: n(`type.${l$t[e]}`),
        value: e,
        color:
          e === l$t.NEW
            ? "green-500"
            : e === l$t.RENEWAL
              ? "blue-500"
              : e === l$t.UPGRADE
                ? "purple-500"
                : "orange-500",
      })),
    o = Object.values(h$t).map((e) => ({
      label: n(`period.${e}`),
      value: e,
      color:
        e === h$t.MONTH_PRICE
          ? "slate-500"
          : e === h$t.QUARTER_PRICE
            ? "cyan-500"
            : e === h$t.HALF_YEAR_PRICE
              ? "indigo-500"
              : e === h$t.YEAR_PRICE
                ? "violet-500"
                : e === h$t.TWO_YEAR_PRICE
                  ? "fuchsia-500"
                  : e === h$t.THREE_YEAR_PRICE
                    ? "pink-500"
                    : e === h$t.ONETIME_PRICE
                      ? "rose-500"
                      : "orange-500",
    })),
    s = Object.values(o$t)
      .filter((e) => "number" == typeof e)
      .map((e) => ({
        label: n(`status.${o$t[e]}`),
        value: e,
        icon:
          e === o$t.PENDING
            ? f3t[0].icon
            : e === o$t.PROCESSING
              ? f3t[1].icon
              : e === o$t.COMPLETED
                ? f3t[2].icon
                : e === o$t.CANCELLED
                  ? f3t[3].icon
                  : f3t[4].icon,
        color:
          e === o$t.PENDING
            ? "yellow-500"
            : e === o$t.PROCESSING
              ? "blue-500"
              : e === o$t.COMPLETED
                ? "green-500"
                : e === o$t.CANCELLED
                  ? "red-500"
                  : "green-500",
      })),
    a = Object.values(c$t)
      .filter((e) => "number" == typeof e)
      .map((e) => ({
        label: n(`commission.${c$t[e]}`),
        value: e,
        icon:
          e === c$t.PENDING
            ? m3t[0].icon
            : e === c$t.PROCESSING
              ? m3t[1].icon
              : e === c$t.VALID
                ? m3t[2].icon
                : m3t[3].icon,
        color:
          e === c$t.PENDING
            ? "yellow-500"
            : e === c$t.PROCESSING
              ? "blue-500"
              : e === c$t.VALID
                ? "green-500"
                : "red-500",
      }));
  return Q.jsx("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: Q.jsxs("div", {
      className: "flex flex-1 flex-wrap items-center gap-2 sm:flex-nowrap",
      children: [
        Q.jsx(y3t, { refetch: t }),
        Q.jsx(Q6e, {
          placeholder: n("search.placeholder"),
          value: e.getColumn("trade_no")?.getFilterValue() ?? "",
          onChange: (t) => e.getColumn("trade_no")?.setFilterValue(t.target.value),
          className: "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
        }),
        Q.jsxs("div", {
          className: "flex flex-wrap gap-2",
          children: [
            e.getColumn("type") &&
              Q.jsx(_3t, {
                column: e.getColumn("type"),
                title: n("table.columns.type"),
                options: r,
              }),
            e.getColumn("period") &&
              Q.jsx(_3t, {
                column: e.getColumn("period"),
                title: n("table.columns.period"),
                options: o,
              }),
            e.getColumn("status") &&
              Q.jsx(_3t, {
                column: e.getColumn("status"),
                title: n("table.columns.status"),
                options: s,
              }),
            e.getColumn("commission_status") &&
              Q.jsx(_3t, {
                column: e.getColumn("commission_status"),
                title: n("table.columns.commissionStatus"),
                options: a,
              }),
          ],
        }),
        i &&
          Q.jsxs(Nm, {
            variant: "ghost",
            onClick: () => e.resetColumnFilters(),
            className: "h-8 px-2 lg:px-3",
            children: [n("actions.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
          }),
      ],
    }),
  });
}
function w3t({ label: e, value: t, className: n, valueClassName: i }) {
  return Q.jsxs("div", {
    className: Rf("flex items-center py-1.5", n),
    children: [
      Q.jsx("div", { className: "w-28 shrink-0 text-sm text-muted-foreground", children: e }),
      Q.jsx("div", { className: Rf("text-sm", i), children: t || "-" }),
    ],
  });
}
function C3t({ status: e }) {
  const { t: t } = Py("order"),
    n = {
      [o$t.PENDING]: "bg-yellow-100 text-yellow-800 hover:bg-yellow-100",
      [o$t.PROCESSING]: "bg-blue-100 text-blue-800 hover:bg-blue-100",
      [o$t.CANCELLED]: "bg-red-100 text-red-800 hover:bg-red-100",
      [o$t.COMPLETED]: "bg-green-100 text-green-800 hover:bg-green-100",
      [o$t.DISCOUNTED]: "bg-gray-100 text-gray-800 hover:bg-gray-100",
    };
  return Q.jsx(hqt, {
    variant: "secondary",
    className: Rf("font-medium text-nowrap", n[e]),
    children: t(`status.${o$t[e]}`),
  });
}
function S3t({ id: e, trigger: t }) {
  const [n, i] = H.useState(!1),
    [r, o] = H.useState(),
    { t: s } = Py("order");
  return (
    H.useEffect(() => {
      (async () => {
        if (n) {
          const { data: t } = await PD({ id: e });
          o(t);
        }
      })();
    }, [n, e]),
    Q.jsxs(Jet, {
      onOpenChange: i,
      open: n,
      children: [
        Q.jsx(ett, { asChild: !0, children: t }),
        Q.jsxs(ttt, {
          className: "max-w-xl",
          children: [
            Q.jsxs(ntt, {
              className: "space-y-2",
              children: [
                Q.jsx(rtt, { className: "text-lg font-medium", children: s("dialog.title") }),
                Q.jsx("div", {
                  className: "flex items-center justify-between text-sm",
                  children: Q.jsxs("div", {
                    className: "flex items-center space-x-6",
                    children: [
                      Q.jsxs("div", {
                        className: "text-muted-foreground",
                        children: [s("table.columns.tradeNo"), "：", r?.trade_no],
                      }),
                      !!r?.status && Q.jsx(C3t, { status: r.status }),
                    ],
                  }),
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "space-y-4",
              children: [
                Q.jsxs("div", {
                  className: "rounded-lg border p-4",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 text-sm font-medium",
                      children: s("dialog.basicInfo"),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx(w3t, {
                          label: s("dialog.fields.userEmail"),
                          value: r?.user?.email
                            ? Q.jsxs(jg, {
                                to: `/user/manage?email=${r.user.email}`,
                                className:
                                  "group inline-flex items-center gap-1 text-primary hover:underline",
                                children: [
                                  r.user.email,
                                  Q.jsx(Sat, {
                                    className:
                                      "h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100",
                                  }),
                                ],
                              })
                            : "-",
                        }),
                        Q.jsx(w3t, {
                          label: s("dialog.fields.orderPeriod"),
                          value: r && s(`period.${r.period}`),
                        }),
                        Q.jsx(w3t, {
                          label: s("dialog.fields.subscriptionPlan"),
                          value: r?.plan?.name,
                          valueClassName: "font-medium",
                        }),
                        Q.jsx(w3t, {
                          label: s("dialog.fields.callbackNo"),
                          value: r?.callback_no,
                          valueClassName: "font-mono text-xs",
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "rounded-lg border p-4",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 text-sm font-medium",
                      children: s("dialog.amountInfo"),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx(w3t, {
                          label: s("dialog.fields.paymentAmount"),
                          value: DS(r?.total_amount || 0),
                          valueClassName: "font-medium text-primary",
                        }),
                        Q.jsx(Um, { className: "my-2" }),
                        Q.jsx(w3t, {
                          label: s("dialog.fields.balancePayment"),
                          value: DS(r?.balance_amount || 0),
                        }),
                        Q.jsx(w3t, {
                          label: s("dialog.fields.discountAmount"),
                          value: DS(r?.discount_amount || 0),
                          valueClassName: "text-green-600",
                        }),
                        Q.jsx(w3t, {
                          label: s("dialog.fields.refundAmount"),
                          value: DS(r?.refund_amount || 0),
                          valueClassName: "text-red-600",
                        }),
                        Q.jsx(w3t, {
                          label: s("dialog.fields.deductionAmount"),
                          value: DS(r?.surplus_amount || 0),
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "rounded-lg border p-4",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 text-sm font-medium",
                      children: s("dialog.timeInfo"),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx(w3t, {
                          label: s("dialog.fields.createdAt"),
                          value: CS(r?.created_at),
                          valueClassName: "font-mono text-xs",
                        }),
                        Q.jsx(w3t, {
                          label: s("dialog.fields.updatedAt"),
                          value: CS(r?.updated_at),
                          valueClassName: "font-mono text-xs",
                        }),
                      ],
                    }),
                  ],
                }),
                void 0 !== r?.commission_status &&
                  !!r?.commission_balance &&
                  Q.jsxs("div", {
                    className: "rounded-lg border p-4",
                    children: [
                      Q.jsx("div", {
                        className: "mb-2 text-sm font-medium",
                        children: s("dialog.commissionInfo"),
                      }),
                      Q.jsxs("div", {
                        className: "space-y-0.5",
                        children: [
                          Q.jsx(w3t, {
                            label: s("dialog.fields.commissionStatus"),
                            value: Q.jsx(hqt, {
                              variant: "secondary",
                              className: Rf(
                                "font-medium",
                                r?.commission_status === c$t.PENDING
                                  ? "bg-yellow-100 text-yellow-800 hover:bg-yellow-100"
                                  : r?.commission_status === c$t.PROCESSING
                                    ? "bg-blue-100 text-blue-800 hover:bg-blue-100"
                                    : r?.commission_status === c$t.VALID
                                      ? "bg-green-100 text-green-800 hover:bg-green-100"
                                      : r?.commission_status === c$t.INVALID
                                        ? "bg-red-100 text-red-800 hover:bg-red-100"
                                        : "bg-orange-100 text-orange-800 hover:bg-orange-100",
                              ),
                              children: s(
                                void 0 !== r?.commission_status
                                  ? `commission.${c$t[r.commission_status]}`
                                  : "dialog.commissionStatusActive",
                              ),
                            }),
                          }),
                          Q.jsx(w3t, {
                            label: s("dialog.fields.commissionAmount"),
                            value: DS(r?.commission_balance || 0),
                            valueClassName: "font-medium text-orange-600",
                          }),
                          r?.actual_commission_balance &&
                            Q.jsx(w3t, {
                              label: s("dialog.fields.actualCommissionAmount"),
                              value: DS(r?.actual_commission_balance || 0),
                              valueClassName: "font-medium text-orange-700",
                            }),
                          r?.invite_user &&
                            Q.jsxs(Q.Fragment, {
                              children: [
                                Q.jsx(Um, { className: "my-2" }),
                                Q.jsx(w3t, {
                                  label: s("dialog.fields.inviteUser"),
                                  value: Q.jsxs(jg, {
                                    to: `/user/manage?email=${r.invite_user.email}`,
                                    className:
                                      "group inline-flex items-center gap-1 text-primary hover:underline",
                                    children: [
                                      r.invite_user.email,
                                      Q.jsx(Sat, {
                                        className:
                                          "h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100",
                                      }),
                                    ],
                                  }),
                                }),
                                Q.jsx(w3t, {
                                  label: s("dialog.fields.inviteUserId"),
                                  value: r?.invite_user?.id,
                                  valueClassName: "font-mono text-xs",
                                }),
                              ],
                            }),
                        ],
                      }),
                    ],
                  }),
              ],
            }),
          ],
        }),
      ],
    })
  );
}
const k3t = { color: "text-slate-700", bgColor: "bg-slate-100/80" },
  E3t = {
    [l$t.NEW]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [l$t.RENEWAL]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [l$t.UPGRADE]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [l$t.RESET_FLOW]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
  },
  N3t = {
    [h$t.MONTH_PRICE]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [h$t.QUARTER_PRICE]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [h$t.HALF_YEAR_PRICE]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [h$t.YEAR_PRICE]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [h$t.TWO_YEAR_PRICE]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [h$t.THREE_YEAR_PRICE]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [h$t.ONETIME_PRICE]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
    [h$t.RESET_PRICE]: { color: "text-slate-700", bgColor: "bg-slate-100/80" },
  },
  L3t = (e) => o$t[e],
  D3t = (e) => c$t[e],
  T3t = (e, t) => [
    {
      accessorKey: "trade_no",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.tradeNo") }),
      cell: ({ row: e }) => {
        const t = e.original.trade_no,
          n = t.length > 6 ? `${t.slice(0, 3)}...${t.slice(-3)}` : t;
        return Q.jsx("div", {
          className: "flex items-center",
          children: Q.jsx(S3t, {
            trigger: Q.jsxs(ltt, {
              variant: "ghost",
              size: "sm",
              className:
                "flex h-8 items-center gap-1.5 px-2 font-medium text-primary transition-colors hover:bg-primary/10 hover:text-primary/80",
              children: [
                Q.jsx("span", { className: "font-mono", children: n }),
                Q.jsx(Sat, { className: "h-3.5 w-3.5 opacity-70" }),
              ],
            }),
            id: e.original.id,
          }),
        });
      },
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "type",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.type") }),
      cell: ({ row: e }) => {
        const n = e.getValue("type"),
          i = null != n ? (E3t[n] ?? k3t) : k3t,
          r = null != n ? ((e) => l$t[e])(n) : void 0,
          o = r ? t(`type.${r}`, { defaultValue: String(n) }) : String(n ?? "-");
        return Q.jsx(hqt, {
          variant: "secondary",
          className: Rf(
            "font-medium transition-colors text-nowrap",
            i.color,
            i.bgColor,
            "border border-border/50",
            "hover:bg-slate-200/80",
          ),
          children: o,
        });
      },
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "plan.name",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.plan") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex space-x-2",
          children: Q.jsx("span", {
            className:
              "max-w-32 truncate font-medium text-foreground/90 sm:max-w-72 md:max-w-[31rem]",
            children: e.original.plan?.name || "-",
          }),
        }),
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "period",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.period") }),
      cell: ({ row: e }) => {
        const n = e.getValue("period"),
          i = null != n ? N3t[n] : void 0;
        return Q.jsx(hqt, {
          variant: "secondary",
          className: Rf(
            "font-medium transition-colors text-nowrap",
            i?.color,
            i?.bgColor,
            "hover:bg-opacity-80",
          ),
          children: null != n ? t(`period.${n}`, { defaultValue: String(n) }) : "-",
        });
      },
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "total_amount",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.amount") }),
      cell: ({ row: e }) => {
        const t = e.getValue("total_amount"),
          n = "number" == typeof t ? (t / 100).toFixed(2) : "N/A";
        return Q.jsxs("div", {
          className: "flex items-center font-mono text-foreground/90",
          children: ["¥", n],
        });
      },
      enableSorting: !0,
      enableHiding: !1,
    },
    {
      accessorKey: "status",
      header: ({ column: e }) =>
        Q.jsxs("div", {
          className: "flex items-center gap-1",
          children: [
            Q.jsx(SYt, { column: e, title: t("table.columns.status") }),
            Q.jsx(Pst, {
              delayDuration: 100,
              children: Q.jsxs(jst, {
                children: [
                  Q.jsx(Fst, {
                    children: Q.jsx(xXt, {
                      className:
                        "h-4 w-4 text-muted-foreground/70 transition-colors hover:text-muted-foreground",
                    }),
                  }),
                  Q.jsx(Bst, {
                    side: "top",
                    className: "max-w-[200px] text-sm",
                    children: t("status.tooltip"),
                  }),
                ],
              }),
            }),
          ],
        }),
      cell: ({ row: n }) => {
        const i = f3t.find((e) => e.value === n.getValue("status"));
        return i
          ? Q.jsxs("div", {
              className: "flex items-center justify-between gap-2",
              children: [
                Q.jsxs("div", {
                  className: "flex items-center gap-2",
                  children: [
                    i.icon && Q.jsx(i.icon, { className: `h-4 w-4 text-${i.color}` }),
                    Q.jsx("span", {
                      className: "text-sm font-medium",
                      children: t(`status.${L3t(i.value)}`),
                    }),
                  ],
                }),
                i.value === o$t.PENDING &&
                  Q.jsxs(Not, {
                    modal: !0,
                    children: [
                      Q.jsx(Lot, {
                        asChild: !0,
                        children: Q.jsxs(ltt, {
                          variant: "ghost",
                          size: "sm",
                          className: "h-8 w-8 p-0 hover:bg-muted/60",
                          children: [
                            Q.jsx(Cat, { className: "h-4 w-4" }),
                            Q.jsx("span", {
                              className: "sr-only",
                              children: t("actions.openMenu"),
                            }),
                          ],
                        }),
                      }),
                      Q.jsxs(Iot, {
                        align: "end",
                        className: "w-[140px]",
                        children: [
                          Q.jsx(Rot, {
                            className: "cursor-pointer",
                            onClick: async () => {
                              (await jD({ trade_no: n.original.trade_no }), e());
                            },
                            children: t("actions.markAsPaid"),
                          }),
                          Q.jsx(Rot, {
                            className: "cursor-pointer text-destructive focus:text-destructive",
                            onClick: async () => {
                              (await FD({ trade_no: n.original.trade_no }), e());
                            },
                            children: t("actions.cancel"),
                          }),
                        ],
                      }),
                    ],
                  }),
              ],
            })
          : Q.jsx("span", { className: "text-muted-foreground", children: "-" });
      },
      enableSorting: !0,
      enableHiding: !1,
    },
    {
      accessorKey: "commission_balance",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.commission") }),
      cell: ({ row: e }) => {
        const t = e.getValue("commission_balance"),
          n = t ? (t / 100).toFixed(2) : "-";
        return Q.jsx("div", {
          className: "flex items-center font-mono text-foreground/90",
          children: t ? `¥${n}` : "-",
        });
      },
      enableSorting: !0,
      enableHiding: !1,
    },
    {
      accessorKey: "commission_status",
      header: ({ column: e }) =>
        Q.jsx(SYt, { column: e, title: t("table.columns.commissionStatus") }),
      cell: ({ row: n }) => {
        const i = n.original.status,
          r = n.original.commission_balance,
          o = m3t.find((e) => e.value === n.getValue("commission_status"));
        return 0 != r && o
          ? Q.jsxs("div", {
              className: "flex items-center justify-between gap-2",
              children: [
                Q.jsxs("div", {
                  className: "flex items-center gap-2",
                  children: [
                    o.icon && Q.jsx(o.icon, { className: `h-4 w-4 text-${o.color}` }),
                    Q.jsx("span", {
                      className: "text-sm font-medium",
                      children: t(`commission.${D3t(o.value)}`),
                    }),
                  ],
                }),
                o.value === c$t.PENDING &&
                  i === o$t.COMPLETED &&
                  Q.jsxs(Not, {
                    modal: !0,
                    children: [
                      Q.jsx(Lot, {
                        asChild: !0,
                        children: Q.jsxs(ltt, {
                          variant: "ghost",
                          size: "sm",
                          className: "h-8 w-8 p-0 hover:bg-muted/60",
                          children: [
                            Q.jsx(Cat, { className: "h-4 w-4" }),
                            Q.jsx("span", {
                              className: "sr-only",
                              children: t("actions.openMenu"),
                            }),
                          ],
                        }),
                      }),
                      Q.jsxs(Iot, {
                        align: "end",
                        className: "w-[120px]",
                        children: [
                          Q.jsx(Rot, {
                            className: "cursor-pointer",
                            onClick: async () => {
                              (await BD({
                                trade_no: n.original.trade_no,
                                commission_status: c$t.PROCESSING,
                              }),
                                e());
                            },
                            children: t("commission.PROCESSING"),
                          }),
                          Q.jsx(Rot, {
                            className: "cursor-pointer text-destructive focus:text-destructive",
                            onClick: async () => {
                              (await BD({
                                trade_no: n.original.trade_no,
                                commission_status: c$t.INVALID,
                              }),
                                e());
                            },
                            children: t("commission.INVALID"),
                          }),
                        ],
                      }),
                    ],
                  }),
              ],
            })
          : Q.jsx("span", { className: "text-muted-foreground", children: "-" });
      },
      enableSorting: !0,
      enableHiding: !1,
    },
    {
      accessorKey: "created_at",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.createdAt") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "text-nowrap font-mono text-sm text-muted-foreground",
          children: CS(e.getValue("created_at"), "yyyy/MM/dd HH:mm:ss"),
        }),
      enableSorting: !0,
      enableHiding: !1,
    },
  ];
function I3t() {
  const { t: e } = Py("order"),
    [t] = Hg(),
    [n, i] = H.useState({}),
    [r, o] = H.useState({}),
    [s, a] = H.useState([]),
    [l, c] = H.useState([]),
    [d, u] = H.useState({ pageIndex: 0, pageSize: 20 });
  H.useEffect(() => {
    const e = Object.entries({
      user_id: "string",
      order_id: "string",
      commission_status: "number",
      status: "number",
      commission_balance: "string",
    })
      .map(([e, n]) => {
        const i = t.get(e);
        return i ? { id: e, value: "number" === n ? parseInt(i) : i } : null;
      })
      .filter(Boolean);
    e.length > 0 && a(e);
  }, [t]);
  const {
      refetch: h,
      data: g,
      isLoading: p,
    } = gC({
      queryKey: ["orderList", d, s, l],
      queryFn: () => AD({ pageSize: d.pageSize, current: d.pageIndex + 1, filter: s, sort: l }),
    }),
    f = PKt({
      data: g?.data ?? [],
      columns: T3t(h, e),
      state: { sorting: l, columnVisibility: r, rowSelection: n, columnFilters: s, pagination: d },
      rowCount: g?.total ?? 0,
      manualPagination: !0,
      manualFiltering: !0,
      manualSorting: !0,
      enableRowSelection: !0,
      onRowSelectionChange: i,
      onSortingChange: c,
      onColumnFiltersChange: a,
      onColumnVisibilityChange: o,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      onPaginationChange: u,
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsx(QKt, {
    table: f,
    toolbar: Q.jsx(x3t, { table: f, refetch: h }),
    showPagination: !0,
    isLoading: p,
    mobilePrimaryField: "trade_no",
    mobileGridFields: ["plan.name", "total_amount", "status", "created_at"],
  });
}
const R3t = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py("order");
        return Q.jsxs(Wot, {
          children: [
            Q.jsxs(Hot, {
              children: [
                Q.jsx(Vdt, {}),
                Q.jsxs("div", {
                  className: "ml-auto flex items-center space-x-4",
                  children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                }),
              ],
            }),
            Q.jsxs(zot, {
              className: "flex flex-col",
              fixedHeight: !0,
              children: [
                Q.jsx("div", {
                  className: "mb-2 flex items-center justify-between space-y-2",
                  children: Q.jsxs("div", {
                    children: [
                      Q.jsx("h2", {
                        className: "text-2xl font-bold tracking-tight",
                        children: e("title"),
                      }),
                      Q.jsx("p", {
                        className: "text-muted-foreground mt-2",
                        children: e("description"),
                      }),
                    ],
                  }),
                }),
                Q.jsx("div", {
                  className:
                    "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                  children: Q.jsx(I3t, {}),
                }),
              ],
            }),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
function O3t({ column: e, title: t, options: n }) {
  const i = e?.getFacetedUniqueValues(),
    r = new Set(e?.getFilterValue());
  return Q.jsxs(qUt, {
    children: [
      Q.jsx(KUt, {
        asChild: !0,
        children: Q.jsxs(Nm, {
          variant: "outline",
          size: "sm",
          className: "h-8 border-dashed",
          children: [
            Q.jsx(U7e, { className: "mr-2 h-4 w-4" }),
            t,
            r?.size > 0 &&
              Q.jsxs(Q.Fragment, {
                children: [
                  Q.jsx(Um, { orientation: "vertical", className: "mx-2 h-4" }),
                  Q.jsx(hqt, {
                    variant: "secondary",
                    className: "rounded-sm px-1 font-normal lg:hidden",
                    children: r.size,
                  }),
                  Q.jsx("div", {
                    className: "hidden space-x-1 lg:flex",
                    children:
                      r.size > 2
                        ? Q.jsxs(hqt, {
                            variant: "secondary",
                            className: "rounded-sm px-1 font-normal",
                            children: [r.size, " selected"],
                          })
                        : n
                            .filter((e) => r.has(e.value))
                            .map((e) =>
                              Q.jsx(
                                hqt,
                                {
                                  variant: "secondary",
                                  className: "rounded-sm px-1 font-normal",
                                  children: e.label,
                                },
                                e.value,
                              ),
                            ),
                  }),
                ],
              }),
          ],
        }),
      }),
      Q.jsx(ZUt, {
        className: "w-[200px] p-0",
        align: "start",
        children: Q.jsxs(Rdt, {
          children: [
            Q.jsx(Mdt, { placeholder: t }),
            Q.jsxs(Adt, {
              children: [
                Q.jsx(Pdt, { children: "No results found." }),
                Q.jsx(jdt, {
                  children: n.map((t) => {
                    const n = r.has(t.value);
                    return Q.jsxs(
                      Bdt,
                      {
                        onSelect: () => {
                          n ? r.delete(t.value) : r.add(t.value);
                          const i = Array.from(r);
                          e?.setFilterValue(i.length ? i : void 0);
                        },
                        children: [
                          Q.jsx("div", {
                            className: Rf(
                              "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
                              n
                                ? "bg-primary text-primary-foreground"
                                : "opacity-50 [&_svg]:invisible",
                            ),
                            children: Q.jsx(h7e, { className: Rf("h-4 w-4") }),
                          }),
                          t.icon &&
                            Q.jsx(t.icon, {
                              className: `mr-2 h-4 w-4 text-muted-foreground text-${t.color}`,
                            }),
                          Q.jsx("span", { children: t.label }),
                          i?.get(t.value) &&
                            Q.jsx("span", {
                              className:
                                "ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",
                              children: i.get(t.value),
                            }),
                        ],
                      },
                      t.value,
                    );
                  }),
                }),
                r.size > 0 &&
                  Q.jsxs(Q.Fragment, {
                    children: [
                      Q.jsx(Fdt, {}),
                      Q.jsx(jdt, {
                        children: Q.jsx(Bdt, {
                          onSelect: () => e?.setFilterValue(void 0),
                          className: "justify-center text-center",
                          children: "Clear filters",
                        }),
                      }),
                    ],
                  }),
              ],
            }),
          ],
        }),
      }),
    ],
  });
}
const M3t = {
  name: "",
  code: null,
  type: m$t.AMOUNT,
  value: 0,
  started_at: Math.floor(Date.now() / 1e3),
  ended_at: Math.floor(Date.now() / 1e3) + 604800,
  limit_use: null,
  limit_use_with_user: null,
  limit_plan_ids: [],
  limit_period: [],
  generate_count: null,
};
function A3t({
  defaultValues: e,
  refetch: t,
  type: n = "create",
  dialogTrigger: i = null,
  open: r,
  onOpenChange: o,
}) {
  const { t: s } = Py("coupon"),
    [a, l] = H.useState(!1),
    c = r ?? a,
    d = o ?? l,
    [u, h] = H.useState([]),
    g = ((e) =>
      gy({
        id: by().nullable().optional(),
        name: ly().min(1, e("form.name.required")),
        code: ly().nullable(),
        type: by(),
        value: by(),
        started_at: by(),
        ended_at: by(),
        limit_use: py([ly(), cy()]).nullable(),
        limit_use_with_user: py([ly(), cy()]).nullable(),
        generate_count: by().nullable().optional(),
        limit_plan_ids: hy(by()).default([]).nullable(),
        limit_period: hy(_y(b$t)).default([]).nullable(),
      }).refine((e) => e.ended_at > e.started_at, {
        message: e("form.validity.endTimeError"),
        path: ["ended_at"],
      }))(s),
    p = ((e) => [
      { label: e("form.timeRange.presets.1week"), days: 7 },
      { label: e("form.timeRange.presets.2weeks"), days: 14 },
      { label: e("form.timeRange.presets.1month"), days: 30 },
      { label: e("form.timeRange.presets.3months"), days: 90 },
      { label: e("form.timeRange.presets.6months"), days: 180 },
      { label: e("form.timeRange.presets.1year"), days: 365 },
    ])(s),
    f = kv({ resolver: Ov(g), defaultValues: e || M3t });
  (H.useEffect(() => {
    e && f.reset(e);
  }, [e, f]),
    H.useEffect(() => {
      DD().then(({ data: e }) => h(e));
    }, []));
  const m = (e, t) =>
    Q.jsxs("div", {
      className: "flex-1 space-y-1.5",
      children: [
        Q.jsx("div", { className: "text-sm font-medium text-muted-foreground", children: t }),
        Q.jsx(Q6e, {
          type: "datetime-local",
          step: "1",
          value: CS(f.watch(e), "yyyy-MM-dd'T'HH:mm:ss"),
          onChange: (t) => {
            const n = new Date(t.target.value);
            f.setValue(e, Math.floor(n.getTime() / 1e3));
          },
          className: "h-8 [&::-webkit-calendar-picker-indicator]:hidden",
        }),
      ],
    });
  return Q.jsxs(Jet, {
    open: c,
    onOpenChange: d,
    children: [
      i && Q.jsx(ett, { asChild: !0, children: i }),
      Q.jsx(xYt, {
        title: s("create" === n ? "form.add" : "form.edit"),
        description: s("form.description", "创建或编辑优惠券，支持金额、百分比优惠及多种限制。"),
        onCancel: () => d(!1),
        onSubmit: f.handleSubmit(async (e) => {
          const i = await JD(e);
          if (e.generate_count && "string" == typeof i) {
            const e = new Blob([i], { type: "text/csv;charset=utf-8;" }),
              t = document.createElement("a");
            ((t.href = window.URL.createObjectURL(e)),
              (t.download = `coupons_${new Date().getTime()}.csv`),
              t.click(),
              window.URL.revokeObjectURL(t.href));
          }
          (d(!1), "create" === n && f.reset(M3t), t());
        }),
        isSubmitting: f.formState.isSubmitting,
        className: "max-w-2xl",
        children: Q.jsx(Hy, {
          ...f,
          children: Q.jsxs("form", {
            className: "space-y-4 font-mono text-xs",
            children: [
              Q.jsx(eZt, {
                control: f.control,
                name: "name",
                label: s("form.name.label"),
                placeholder: s("form.name.placeholder"),
                required: !0,
              }),
              Q.jsxs("div", {
                className: "flex flex-col space-y-4",
                children: [
                  "create" === n &&
                    Q.jsx(eZt, {
                      control: f.control,
                      name: "generate_count",
                      type: "number",
                      label: s("form.generateCount.label"),
                      placeholder: s("form.generateCount.placeholder"),
                      description: s("form.generateCount.description"),
                      className: "w-full",
                    }),
                  (!f.watch("generate_count") || null == f.watch("generate_count")) &&
                    Q.jsx(eZt, {
                      control: f.control,
                      name: "code",
                      label: s("form.code.label"),
                      placeholder: s("form.code.placeholder"),
                      description: s("form.code.description"),
                      className: "w-full",
                    }),
                ],
              }),
              Q.jsxs("div", {
                className: "grid grid-cols-1 gap-4 md:grid-cols-2",
                children: [
                  Q.jsxs(Ky, {
                    className: "space-y-1.5 md:col-span-2",
                    children: [
                      Q.jsx(Gy, {
                        className:
                          "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                        children: s("form.type.label"),
                      }),
                      Q.jsxs("div", {
                        className: "flex",
                        children: [
                          Q.jsx(Uy, {
                            control: f.control,
                            name: "type",
                            render: ({ field: e }) =>
                              Q.jsxs(THt, {
                                value: e.value.toString(),
                                onValueChange: (t) => {
                                  const n = e.value,
                                    i = parseInt(t);
                                  e.onChange(i);
                                  const r = f.getValues("value");
                                  r &&
                                    (n === m$t.AMOUNT && i === m$t.PERCENTAGE
                                      ? f.setValue("value", r / 100)
                                      : n === m$t.PERCENTAGE &&
                                        i === m$t.AMOUNT &&
                                        f.setValue("value", 100 * r));
                                },
                                children: [
                                  Q.jsx(OHt, {
                                    className:
                                      "h-9 flex-[1.2] rounded-r-none border-r-0 font-mono text-xs shadow-none focus:z-10",
                                    children: Q.jsx(RHt, {
                                      placeholder: s("form.type.placeholder"),
                                    }),
                                  }),
                                  Q.jsx(PHt, {
                                    className: "font-mono text-xs",
                                    children: Object.entries({
                                      1: aL.t("coupon:table.toolbar.types.1"),
                                      2: aL.t("coupon:table.toolbar.types.2"),
                                    }).map(([e]) =>
                                      Q.jsx(
                                        FHt,
                                        { value: e, children: s(`table.toolbar.types.${e}`) },
                                        e,
                                      ),
                                    ),
                                  }),
                                ],
                              }),
                          }),
                          Q.jsx(Uy, {
                            control: f.control,
                            name: "value",
                            render: ({ field: e }) => {
                              const t =
                                null == e.value
                                  ? ""
                                  : f.watch("type") === m$t.AMOUNT && "number" == typeof e.value
                                    ? (e.value / 100).toString()
                                    : e.value.toString();
                              return Q.jsx(Q6e, {
                                type: "number",
                                placeholder: s("form.value.placeholder"),
                                ...e,
                                value: t,
                                onChange: (t) => {
                                  const n = t.target.value;
                                  if ("" === n) return void e.onChange("");
                                  const i = parseFloat(n);
                                  isNaN(i) ||
                                    e.onChange(
                                      f.watch("type") === m$t.AMOUNT ? Math.round(100 * i) : i,
                                    );
                                },
                                step: "any",
                                min: 0,
                                className:
                                  "h-9 flex-[2] rounded-none border-x-0 text-left font-mono text-xs shadow-none focus-visible:ring-0",
                              });
                            },
                          }),
                          Q.jsx("div", {
                            className:
                              "flex min-w-[40px] items-center justify-center rounded-md rounded-l-none border border-l-0 border-input bg-muted/50 px-3 text-[10px] font-bold text-muted-foreground/50",
                            children: Q.jsx("span", {
                              children: f.watch("type") == m$t.AMOUNT ? "¥" : "%",
                            }),
                          }),
                        ],
                      }),
                      Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                    ],
                  }),
                  Q.jsxs(Ky, {
                    className: "space-y-1.5 md:col-span-2",
                    children: [
                      Q.jsx(Gy, {
                        className:
                          "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                        children: s("form.validity.label"),
                      }),
                      Q.jsxs(qUt, {
                        children: [
                          Q.jsx(KUt, {
                            asChild: !0,
                            children: Q.jsxs(Nm, {
                              variant: "outline",
                              className: Rf(
                                "h-9 w-full justify-start text-left font-mono text-xs shadow-none",
                                !f.watch("started_at") && "text-muted-foreground",
                              ),
                              children: [
                                Q.jsx(sat, { className: "mr-2 h-3.5 w-3.5 opacity-50" }),
                                Q.jsxs("span", {
                                  className: "truncate",
                                  children: [
                                    CS(f.watch("started_at"), "yyyy-MM-dd HH:mm:ss"),
                                    " ",
                                    "-",
                                    " ",
                                    CS(f.watch("ended_at"), "yyyy-MM-dd HH:mm:ss"),
                                  ],
                                }),
                              ],
                            }),
                          }),
                          Q.jsxs(ZUt, {
                            className: "w-auto border-muted p-0 font-mono text-xs shadow-xl",
                            align: "start",
                            children: [
                              Q.jsx("div", {
                                className:
                                  "border-b border-border bg-muted/20 p-3 text-[10px] font-bold uppercase tracking-widest text-muted-foreground",
                                children: s("form.timeRange.quickSet"),
                              }),
                              Q.jsx("div", {
                                className: "p-3",
                                children: Q.jsx("div", {
                                  className: "grid grid-cols-3 gap-2",
                                  children: p.map((e) =>
                                    Q.jsx(
                                      Nm,
                                      {
                                        variant: "secondary",
                                        size: "sm",
                                        className: "h-7 px-2 font-mono text-[10px] shadow-none",
                                        onClick: () =>
                                          ((e) => {
                                            const t = new Date(),
                                              n = Math.floor(t.getTime() / 1e3),
                                              i = Math.floor(
                                                (t.getTime() + 24 * e * 60 * 60 * 1e3) / 1e3,
                                              );
                                            (f.setValue("started_at", n),
                                              f.setValue("ended_at", i));
                                          })(e.days),
                                        type: "button",
                                        children: e.label,
                                      },
                                      e.days,
                                    ),
                                  ),
                                }),
                              }),
                              Q.jsx("div", {
                                className: "hidden border-t border-border sm:block",
                                children: Q.jsx(mUt, {
                                  mode: "range",
                                  selected: {
                                    from: new Date(1e3 * f.watch("started_at")),
                                    to: new Date(1e3 * f.watch("ended_at")),
                                  },
                                  onSelect: (e) => {
                                    if (!e) return;
                                    const t = (e, t) => {
                                      const n = new Date(1e3 * t);
                                      return (
                                        e.setHours(n.getHours(), n.getMinutes(), n.getSeconds()),
                                        Math.floor(e.getTime() / 1e3)
                                      );
                                    };
                                    (e.from &&
                                      f.setValue("started_at", t(e.from, f.watch("started_at"))),
                                      e.to && f.setValue("ended_at", t(e.to, f.watch("ended_at"))));
                                  },
                                  numberOfMonths: 2,
                                  className: "font-mono",
                                }),
                              }),
                              Q.jsx("div", {
                                className: "border-t bg-muted/10 p-3",
                                children: Q.jsxs("div", {
                                  className: "flex flex-col gap-4 sm:flex-row sm:items-end",
                                  children: [
                                    m("started_at", s("table.validity.startTime")),
                                    Q.jsx("div", {
                                      className: "pb-2 text-center text-xs opacity-40",
                                      children: "TO",
                                    }),
                                    m("ended_at", s("table.validity.endTime")),
                                  ],
                                }),
                              }),
                            ],
                          }),
                        ],
                      }),
                      Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                    ],
                  }),
                  Q.jsx(eZt, {
                    control: f.control,
                    name: "limit_use",
                    type: "number",
                    label: s("form.limitUse.label"),
                    placeholder: s("form.limitUse.placeholder"),
                    description: s("form.limitUse.description"),
                  }),
                  Q.jsx(eZt, {
                    control: f.control,
                    name: "limit_use_with_user",
                    type: "number",
                    label: s("form.limitUseWithUser.label"),
                    placeholder: s("form.limitUseWithUser.placeholder"),
                    description: s("form.limitUseWithUser.description"),
                  }),
                  Q.jsx(Uy, {
                    control: f.control,
                    name: "limit_period",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        className: "flex flex-col",
                        children: [
                          Q.jsx(Gy, {
                            className:
                              "mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                            children: s("form.limitPeriod.label"),
                          }),
                          Q.jsx("div", {
                            className: "flex-1",
                            children: Q.jsx(Zy, {
                              children: Q.jsx(d4t, {
                                className: "min-h-9 font-mono text-xs shadow-none",
                                options: Object.entries(b$t)
                                  .filter(([e]) => isNaN(Number(e)))
                                  .map(([e, t]) => ({ label: s(`coupon:period.${t}`), value: e })),
                                onChange: (t) => {
                                  if (0 === t.length) return void e.onChange([]);
                                  const n = t.map((e) => b$t[e.value]);
                                  e.onChange(n);
                                },
                                value: (e.value || []).map((e) => ({
                                  label: s(`coupon:period.${e}`),
                                  value: Object.entries(b$t).find(([, t]) => t === e)?.[0] || "",
                                })),
                                placeholder: s("form.limitPeriod.placeholder"),
                              }),
                            }),
                          }),
                          Q.jsx(Yy, {
                            className: "mt-2 font-mono text-[10px] opacity-70",
                            children: s("form.limitPeriod.description"),
                          }),
                          Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: f.control,
                    name: "limit_plan_ids",
                    render: ({ field: e }) =>
                      Q.jsxs(Ky, {
                        className: "flex flex-col",
                        children: [
                          Q.jsx(Gy, {
                            className:
                              "mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                            children: s("form.limitPlan.label"),
                          }),
                          Q.jsx("div", {
                            className: "flex-1",
                            children: Q.jsx(Zy, {
                              children: Q.jsx(d4t, {
                                className: "min-h-9 font-mono text-xs shadow-none",
                                options:
                                  u?.map((e) => ({ label: e.name, value: e.id.toString() })) || [],
                                onChange: (t) => e.onChange(t.map((e) => Number(e.value))),
                                value: (u || [])
                                  .filter((t) => (e.value || []).includes(t.id))
                                  .map((e) => ({ label: e.name, value: e.id.toString() })),
                                placeholder: s("form.limitPlan.placeholder"),
                              }),
                            }),
                          }),
                          Q.jsx(Yy, {
                            className: "mt-2 font-mono text-[10px] opacity-70",
                            children: s("form.limitPlan.description"),
                          }),
                          Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                        ],
                      }),
                  }),
                ],
              }),
            ],
          }),
        }),
      }),
    ],
  });
}
function P3t({ table: e, refetch: t }) {
  const n = e.getState().columnFilters.length > 0,
    { t: i } = Py("coupon");
  return Q.jsxs("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: [
      Q.jsxs("div", {
        className: "flex flex-1 flex-wrap items-center gap-2 sm:flex-nowrap",
        children: [
          Q.jsx(A3t, {
            refetch: t,
            dialogTrigger: Q.jsxs(Nm, {
              variant: "outline",
              size: "sm",
              className: "h-8 space-x-2",
              children: [
                Q.jsx(yYt, { icon: "ion:add" }),
                Q.jsx("div", { children: i("form.add") }),
              ],
            }),
          }),
          Q.jsx(Q6e, {
            placeholder: i("table.toolbar.search"),
            value: e.getColumn("name")?.getFilterValue() ?? "",
            onChange: (t) => e.getColumn("name")?.setFilterValue(t.target.value),
            className: "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
          }),
        ],
      }),
      Q.jsxs("div", {
        className: "flex items-center gap-2",
        children: [
          e.getColumn("type") &&
            Q.jsx(O3t, {
              column: e.getColumn("type"),
              title: i("table.toolbar.type"),
              options: [
                { value: m$t.AMOUNT, label: i(`table.toolbar.types.${m$t.AMOUNT}`) },
                { value: m$t.PERCENTAGE, label: i(`table.toolbar.types.${m$t.PERCENTAGE}`) },
              ],
            }),
          n &&
            Q.jsxs(Nm, {
              variant: "ghost",
              onClick: () => e.resetColumnFilters(),
              className: "h-8 px-2 lg:px-3",
              children: [i("table.toolbar.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
            }),
        ],
      }),
    ],
  });
}
const j3t = H.createContext(void 0);
function F3t({ coupon: e, t: t }) {
  const [n, i] = H.useState(!1),
    r = Date.now(),
    o = 1e3 * e.started_at,
    s = 1e3 * e.ended_at,
    a = r > s,
    l = r < o,
    c = Math.ceil((s - r) / 864e5),
    d = a
      ? {
          label: t("table.validity.expired", { days: Math.abs(c) }),
          color: "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400",
        }
      : l
        ? {
            label: t("table.validity.notStarted", { days: Math.abs(Math.ceil((o - r) / 864e5)) }),
            color: "bg-yellow-50 text-yellow-600 dark:bg-yellow-500/10 dark:text-yellow-400",
          }
        : {
            label: t("table.validity.remaining", { days: c }),
            color: "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400",
          };
  return Q.jsxs(tst, {
    open: n,
    onOpenChange: i,
    children: [
      Q.jsx(nst, {
        asChild: !0,
        children: Q.jsxs("div", {
          className:
            "group -m-0.5 flex max-w-[280px] cursor-pointer items-center gap-2 rounded-md p-0.5 transition-colors hover:bg-muted/40",
          children: [
            Q.jsxs("div", {
              className: "flex flex-1 items-center gap-2",
              children: [
                Q.jsx("div", {
                  className: Rf(
                    "whitespace-nowrap rounded-md px-1.5 py-0.5 text-xs font-medium",
                    d.color,
                  ),
                  children: d.label,
                }),
                Q.jsxs("div", {
                  className: "flex min-w-0 items-center gap-1 text-muted-foreground",
                  children: [
                    Q.jsx("div", {
                      className: "truncate text-xs",
                      children: CS(e.started_at, "MM/dd HH:mm"),
                    }),
                    Q.jsx("div", { className: "shrink-0 opacity-30", children: "->" }),
                    Q.jsx("div", {
                      className: "truncate text-xs",
                      children: CS(e.ended_at, "MM/dd HH:mm"),
                    }),
                  ],
                }),
              ],
            }),
            Q.jsx(lat, {
              className: Rf(
                "h-3.5 w-3.5 shrink-0 text-muted-foreground/50 transition-transform duration-200",
                n && "rotate-180",
              ),
            }),
          ],
        }),
      }),
      Q.jsx(ist, {
        children: Q.jsx("div", {
          className: "px-0.5 pb-0.5 pt-1.5",
          children: Q.jsxs("div", {
            className: "space-y-1.5 border-l-2 border-muted pl-3 text-xs text-muted-foreground",
            children: [
              Q.jsxs("div", {
                className: "flex items-center justify-between",
                children: [
                  Q.jsx("span", { children: t("table.validity.startTime") }),
                  Q.jsx("span", {
                    className: "font-medium text-foreground",
                    children: CS(e.started_at, "yyyy/MM/dd HH:mm"),
                  }),
                ],
              }),
              Q.jsxs("div", {
                className: "flex items-center justify-between",
                children: [
                  Q.jsx("span", { children: t("table.validity.endTime") }),
                  Q.jsx("span", {
                    className: "font-medium text-foreground",
                    children: CS(e.ended_at, "yyyy/MM/dd HH:mm"),
                  }),
                ],
              }),
            ],
          }),
        }),
      }),
    ],
  });
}
function B3t({ coupon: e, refetch: t, t: n }) {
  const { openEdit: i } = (function () {
    const e = H.useContext(j3t);
    if (void 0 === e) throw new Error("useCouponEdit must be used within a CouponEditProvider");
    return e;
  })();
  return Q.jsxs("div", {
    className: "flex items-center justify-center",
    children: [
      Q.jsxs(Nm, {
        variant: "ghost",
        size: "icon",
        className: "h-8 w-8 hover:bg-muted",
        onClick: () => i(e),
        children: [
          Q.jsx(H7e, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
          Q.jsx("span", { className: "sr-only", children: n("table.actions.edit") }),
        ],
      }),
      Q.jsx(yXt, {
        title: n("table.actions.deleteConfirm.title"),
        description: n("table.actions.deleteConfirm.description"),
        confirmText: n("table.actions.deleteConfirm.confirmText"),
        variant: "destructive",
        onConfirm: async () => {
          eT({ id: e.id }).then(({ data: e }) => {
            e && (hN.success("删除成功"), t());
          });
        },
        children: Q.jsxs(Nm, {
          variant: "ghost",
          size: "icon",
          className: "h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",
          children: [
            Q.jsx(ilt, {
              className: "h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400",
            }),
            Q.jsx("span", { className: "sr-only", children: n("table.actions.delete") }),
          ],
        }),
      }),
    ],
  });
}
const V3t = (e, t) => [
  {
    accessorKey: "id",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.id") }),
    cell: ({ row: e }) => Q.jsx(hqt, { children: e.original.id }),
    enableSorting: !0,
  },
  {
    accessorKey: "show",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.show") }),
    cell: ({ row: t }) =>
      Q.jsx(mGt, {
        defaultChecked: t.original.show,
        onCheckedChange: (n) => {
          tT({ id: t.original.id, show: n }).then(({ data: t }) => !t && e());
        },
      }),
    enableSorting: !1,
  },
  {
    accessorKey: "name",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.name") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "flex items-center",
        children: Q.jsx("span", { children: e.original.name }),
      }),
    enableSorting: !1,
    size: 800,
  },
  {
    accessorKey: "type",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.type") }),
    cell: ({ row: e }) =>
      Q.jsx(hqt, { variant: "outline", children: t(`table.toolbar.types.${e.original.type}`) }),
    enableSorting: !0,
  },
  {
    accessorKey: "code",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.code") }),
    cell: ({ row: e }) => Q.jsx(hqt, { variant: "secondary", children: e.original.code }),
    enableSorting: !0,
  },
  {
    accessorKey: "limit_use",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.limitUse") }),
    cell: ({ row: e }) =>
      Q.jsx(hqt, {
        variant: "outline",
        children:
          null === e.original.limit_use ? t("table.validity.unlimited") : e.original.limit_use,
      }),
    enableSorting: !0,
  },
  {
    accessorKey: "limit_use_with_user",
    header: ({ column: e }) =>
      Q.jsx(SYt, { column: e, title: t("table.columns.limitUseWithUser") }),
    cell: ({ row: e }) =>
      Q.jsx(hqt, {
        variant: "outline",
        children:
          null === e.original.limit_use_with_user
            ? t("table.validity.noLimit")
            : e.original.limit_use_with_user,
      }),
    enableSorting: !0,
  },
  {
    accessorKey: "#",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("table.columns.validity") }),
    cell: ({ row: e }) => Q.jsx(F3t, { coupon: e.original, t: t }),
    enableSorting: !1,
    size: 8e3,
  },
  {
    id: "actions",
    header: ({ column: e }) =>
      Q.jsx(SYt, { className: "justify-end", column: e, title: t("table.columns.actions") }),
    cell: ({ row: n }) => Q.jsx(B3t, { coupon: n.original, refetch: e, t: t }),
  },
];
function W3t({ children: e, refetch: t }) {
  const [n, i] = H.useState(!1),
    [r, o] = H.useState(null);
  return Q.jsxs(j3t.Provider, {
    value: {
      isOpen: n,
      currentCoupon: r,
      openEdit: (e) => {
        (o(e), i(!0));
      },
      closeEdit: () => {
        (i(!1), o(null));
      },
    },
    children: [
      e,
      r && Q.jsx(A3t, { defaultValues: r, refetch: t, type: "edit", open: n, onOpenChange: i }),
    ],
  });
}
function H3t() {
  const { t: e } = Py("coupon"),
    [t, n] = H.useState({}),
    [i, r] = H.useState({}),
    [o, s] = H.useState([]),
    [a, l] = H.useState([]),
    [c, d] = H.useState({ pageIndex: 0, pageSize: 20 }),
    {
      refetch: u,
      data: h,
      isLoading: g,
    } = gC({
      queryKey: ["couponList", c, o, a],
      queryFn: () => QD({ pageSize: c.pageSize, current: c.pageIndex + 1, filter: o, sort: a }),
    }),
    p = PKt({
      data: h?.data ?? [],
      columns: V3t(u, e),
      state: { sorting: a, columnVisibility: i, rowSelection: t, columnFilters: o, pagination: c },
      pageCount: Math.ceil((h?.total ?? 0) / c.pageSize),
      rowCount: h?.total ?? 0,
      manualPagination: !0,
      manualFiltering: !0,
      manualSorting: !0,
      enableRowSelection: !0,
      onRowSelectionChange: n,
      onSortingChange: l,
      onColumnFiltersChange: s,
      onColumnVisibilityChange: r,
      onPaginationChange: d,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsx(W3t, {
    refetch: u,
    children: Q.jsx("div", {
      className: "space-y-4",
      children: Q.jsx(QKt, {
        table: p,
        toolbar: Q.jsx(P3t, { table: p, refetch: u }),
        isLoading: g,
        mobilePrimaryField: "name",
        mobileGridFields: ["code", "type", "limit_use"],
      }),
    }),
  });
}
const z3t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("coupon");
          return Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                children: [
                  Q.jsx(Vdt, {}),
                  Q.jsxs("div", {
                    className: "ml-auto flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                className: "flex flex-col",
                fixedHeight: !0,
                children: [
                  Q.jsx("div", {
                    className: "mb-2 flex items-center justify-between space-y-2",
                    children: Q.jsxs("div", {
                      children: [
                        Q.jsx("h2", {
                          className: "text-2xl font-bold tracking-tight",
                          children: e("title"),
                        }),
                        Q.jsx("p", {
                          className: "text-muted-foreground mt-2",
                          children: e("description"),
                        }),
                      ],
                    }),
                  }),
                  Q.jsx("div", {
                    className:
                      "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                    children: Q.jsx(H3t, {}),
                  }),
                ],
              }),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  U3t = H.createContext(void 0);
function $3t({ rewards: e, type: t, t: n }) {
  const i = [];
  return (
    e &&
      (e.balance &&
        i.push(
          `${n("template.form.rewards.balance.short_label")}: ${e.balance / 100} ${n("common:currency.yuan", "元")}`,
        ),
      e.transfer_enable &&
        i.push(
          `${n("template.form.rewards.transfer_enable.short_label")}: ${IS(e.transfer_enable)}`,
        ),
      e.expire_days &&
        i.push(
          `${n("template.form.rewards.expire_days.short_label")}: ${e.expire_days}${n("common:time.day", "天")}`,
        ),
      e.device_limit &&
        i.push(`${n("template.form.rewards.device_limit.short_label")}: ${e.device_limit}`),
      2 === t &&
        e.plan_id &&
        i.push(`${n("template.form.rewards.plan_id.short_label")}: ${e.plan_id}`),
      2 === t &&
        e.plan_validity_days &&
        i.push(
          `${n("template.form.rewards.plan_validity_days.short_label")}: ${e.plan_validity_days}${n("common:time.day", "天")}`,
        ),
      3 === t && e.random_rewards?.length && i.push(n("types.3"))),
    0 === i.length
      ? Q.jsx(hqt, { variant: "secondary", children: n("template.table.columns.no_rewards") })
      : Q.jsx("div", {
          className: "flex flex-col space-y-1",
          children: i.map((e, t) =>
            Q.jsx(hqt, { variant: "outline", className: "whitespace-nowrap", children: e }, t),
          ),
        })
  );
}
function q3t({ template: e, refetch: t, t: n }) {
  const [i, r] = H.useState(!1);
  return Q.jsx(mGt, {
    checked: e.status,
    disabled: i,
    onCheckedChange: async (i) => {
      r(!0);
      try {
        const { data: r } = await UD({ id: e.id, status: i });
        r
          ? (hN.success(n("messages.templateUpdated")), t())
          : hN.error(n("messages.updateTemplateFailed"));
      } catch {
        hN.error(n("messages.updateTemplateFailed"));
      } finally {
        r(!1);
      }
    },
  });
}
function K3t({ template: e, refetch: t, t: n }) {
  const { setEditingTemplate: i } = (function () {
    const e = H.useContext(U3t);
    if (void 0 === e) throw new Error("useTemplateEdit must be used within a TemplateEditProvider");
    return e;
  })();
  return Q.jsxs("div", {
    className: "flex space-x-2",
    children: [
      Q.jsxs(Nm, {
        variant: "outline",
        size: "sm",
        onClick: () => i(e),
        children: [Q.jsx(H7e, { className: "h-4 w-4" }), n("template.actions.edit")],
      }),
      Q.jsx(yXt, {
        title: n("template.actions.deleteConfirm.title"),
        description: n("template.actions.deleteConfirm.description"),
        confirmText: n("template.actions.deleteConfirm.confirmText"),
        onConfirm: async () => {
          try {
            const { data: i } = await $D({ id: e.id });
            i
              ? (hN.success(n("messages.templateDeleted")), t())
              : hN.error(n("messages.deleteTemplateFailed"));
          } catch {
            hN.error(n("messages.deleteTemplateFailed"));
          }
        },
        children: Q.jsxs(Nm, {
          variant: "outline",
          size: "sm",
          children: [Q.jsx(ilt, { className: "h-4 w-4" }), n("template.actions.delete")],
        }),
      }),
    ],
  });
}
const G3t = (e, t) => [
    {
      accessorKey: "id",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("template.table.columns.id") }),
      cell: ({ row: e }) => Q.jsx(hqt, { children: e.original.id }),
      enableSorting: !0,
    },
    {
      accessorKey: "status",
      header: ({ column: e }) =>
        Q.jsx(SYt, { column: e, title: t("template.table.columns.status") }),
      cell: ({ row: n }) => Q.jsx(q3t, { template: n.original, refetch: e, t: t }),
      enableSorting: !1,
    },
    {
      accessorKey: "name",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("template.table.columns.name") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex items-center",
          children: Q.jsx("span", { children: e.original.name }),
        }),
      enableSorting: !1,
      size: 300,
    },
    {
      accessorKey: "type",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("template.table.columns.type") }),
      cell: ({ row: e }) =>
        Q.jsx(hqt, { variant: "outline", children: t(`types.${e.original.type}`) }),
      enableSorting: !0,
    },
    {
      accessorKey: "rewards",
      header: ({ column: e }) =>
        Q.jsx(SYt, { column: e, title: t("template.table.columns.rewards") }),
      cell: ({ row: e }) =>
        Q.jsx($3t, { rewards: e.original.rewards, type: e.original.type, t: t }),
      enableSorting: !1,
    },
    {
      accessorKey: "sort",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("template.table.columns.sort") }),
      cell: ({ row: e }) => Q.jsx(hqt, { variant: "secondary", children: e.original.sort }),
      enableSorting: !0,
    },
    {
      accessorKey: "created_at",
      header: ({ column: e }) =>
        Q.jsx(SYt, { column: e, title: t("template.table.columns.created_at") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "text-sm text-muted-foreground",
          children: CS(e.original.created_at),
        }),
      enableSorting: !0,
    },
    {
      id: "actions",
      header: ({ column: e }) =>
        Q.jsx(SYt, { column: e, title: t("template.table.columns.actions") }),
      cell: ({ row: n }) => Q.jsx(K3t, { template: n.original, refetch: e, t: t }),
      enableSorting: !1,
    },
  ],
  Z3t = gy({
    name: ly().min(1, "请输入模板名称"),
    description: ly().optional(),
    type: by().min(1).max(4),
    status: dy(),
    sort: by().min(0),
    icon: ly().optional(),
    background_image: ly().optional(),
    conditions: gy({
      allowed_plans: hy(by()).optional(),
      disallowed_plans: hy(by()).optional(),
      new_user_only: dy().optional(),
      new_user_max_days: by().optional(),
      paid_user_only: dy().optional(),
      require_invite: dy().optional(),
    }).optional(),
    limits: gy({
      max_use_per_user: by().optional(),
      cooldown_hours: by().optional(),
      invite_reward_rate: by().optional(),
    }).optional(),
    rewards: gy({
      balance: by().optional(),
      transfer_enable: by().optional(),
      expire_days: by().optional(),
      device_limit: by().optional(),
      reset_package: dy().optional(),
      plan_id: by().optional(),
      plan_validity_days: by().optional(),
      random_rewards: hy(
        gy({
          weight: by(),
          balance: by().optional(),
          transfer_enable: by().optional(),
          expire_days: by().optional(),
          device_limit: by().optional(),
        }),
      ).optional(),
    }),
    special_config: gy({
      start_time: by().optional(),
      end_time: by().optional(),
      festival_bonus: by().optional(),
    }).optional(),
  });
function Y3t({ template: e, refetch: t, open: n, onCancel: i, onOpenChange: r }) {
  const o = () => {
      (i?.(), r?.(!1));
    },
    { t: s } = Py("giftCard"),
    [a, l] = H.useState(!1),
    [c, d] = H.useState([]),
    [u, h] = H.useState([]),
    g = kv({
      resolver: Ov(Z3t),
      defaultValues: {
        name: "",
        description: "",
        type: 1,
        status: !0,
        sort: 0,
        icon: "",
        background_image: "",
        conditions: {},
        limits: {},
        rewards: {},
        special_config: {},
      },
    }),
    {
      fields: p,
      append: f,
      remove: m,
    } = (function (e) {
      const t = C_(),
        { control: n = t.control, name: i, keyName: r = "id", shouldUnregister: o, rules: s } = e,
        [a, l] = z.useState(n._getFieldArray(i)),
        c = z.useRef(n._getFieldArray(i).map(fv)),
        d = z.useRef(!1);
      (n._names.array.add(i),
        z.useMemo(() => s && a.length >= 0 && n.register(i, s), [n, i, a.length, s]),
        k_(
          () =>
            n._subjects.array.subscribe({
              next: ({ values: e, name: t }) => {
                if (t === i || !t) {
                  const t = r_(e, i);
                  Array.isArray(t) && (l(t), (c.current = t.map(fv)));
                }
              },
            }).unsubscribe,
          [n, i],
        ));
      const u = z.useCallback(
        (e) => {
          ((d.current = !0), n._setFieldArray(i, e));
        },
        [n, i],
      );
      return (
        z.useEffect(() => {
          if (
            ((n._state.action = !1),
            sv(i, n._names) && n._subjects.state.next({ ...n._formState }),
            d.current &&
              (!iv(n._options.mode).isOnSubmit || n._formState.isSubmitted) &&
              !iv(n._options.reValidateMode).isOnSubmit)
          )
            if (n._options.resolver)
              n._runSchema([i]).then((e) => {
                const t = r_(e.errors, i),
                  r = r_(n._formState.errors, i);
                (r
                  ? (!t && r.type) || (t && (r.type !== t.type || r.message !== t.message))
                  : t && t.type) &&
                  (t ? s_(n._formState.errors, i, t) : U_(n._formState.errors, i),
                  n._subjects.state.next({ errors: n._formState.errors }));
              });
            else {
              const e = r_(n._fields, i);
              !e ||
                !e._f ||
                (iv(n._options.reValidateMode).isOnSubmit && iv(n._options.mode).isOnSubmit) ||
                hv(
                  e,
                  n._names.disabled,
                  n._formValues,
                  n._options.criteriaMode === p_,
                  n._options.shouldUseNativeValidation,
                  !0,
                ).then(
                  (e) =>
                    !j_(e) && n._subjects.state.next({ errors: cv(n._formState.errors, e, i) }),
                );
            }
          (n._subjects.state.next({ name: i, values: Jm(n._formValues) }),
            n._names.focus &&
              av(n._fields, (e, t) => {
                if (n._names.focus && t.startsWith(n._names.focus) && e.focus)
                  return (e.focus(), 1);
              }),
            (n._names.focus = ""),
            n._setValid(),
            (d.current = !1));
        }, [a, i, n]),
        z.useEffect(
          () => (
            !r_(n._formValues, i) && n._setFieldArray(i),
            () => {
              n._options.shouldUnregister || o
                ? n.unregister(i)
                : ((e, t) => {
                    const i = r_(n._fields, e);
                    i && i._f && (i._f.mount = t);
                  })(i, !1);
            }
          ),
          [i, n, r, o],
        ),
        {
          swap: z.useCallback(
            (e, t) => {
              const r = n._getFieldArray(i);
              (Cv(r, e, t),
                Cv(c.current, e, t),
                u(r),
                l(r),
                n._setFieldArray(i, r, Cv, { argA: e, argB: t }, !1));
            },
            [u, i, n],
          ),
          move: z.useCallback(
            (e, t) => {
              const r = n._getFieldArray(i);
              (yv(r, e, t),
                yv(c.current, e, t),
                u(r),
                l(r),
                n._setFieldArray(i, r, yv, { argA: e, argB: t }, !1));
            },
            [u, i, n],
          ),
          prepend: z.useCallback(
            (e, t) => {
              const r = M_(Jm(e)),
                o = xv(n._getFieldArray(i), r);
              ((n._names.focus = mv(i, 0, t)),
                (c.current = xv(c.current, r.map(fv))),
                u(o),
                l(o),
                n._setFieldArray(i, o, xv, { argA: vv(e) }));
            },
            [u, i, n],
          ),
          append: z.useCallback(
            (e, t) => {
              const r = M_(Jm(e)),
                o = _v(n._getFieldArray(i), r);
              ((n._names.focus = mv(i, o.length - 1, t)),
                (c.current = _v(c.current, r.map(fv))),
                u(o),
                l(o),
                n._setFieldArray(i, o, _v, { argA: vv(e) }));
            },
            [u, i, n],
          ),
          remove: z.useCallback(
            (e) => {
              const t = wv(n._getFieldArray(i), e);
              ((c.current = wv(c.current, e)),
                u(t),
                l(t),
                !Array.isArray(r_(n._fields, i)) && s_(n._fields, i, void 0),
                n._setFieldArray(i, t, wv, { argA: e }));
            },
            [u, i, n],
          ),
          insert: z.useCallback(
            (e, t, r) => {
              const o = M_(Jm(t)),
                s = bv(n._getFieldArray(i), e, o);
              ((n._names.focus = mv(i, e, r)),
                (c.current = bv(c.current, e, o.map(fv))),
                u(s),
                l(s),
                n._setFieldArray(i, s, bv, { argA: e, argB: vv(t) }));
            },
            [u, i, n],
          ),
          update: z.useCallback(
            (e, t) => {
              const r = Jm(t),
                o = Sv(n._getFieldArray(i), e, r);
              ((c.current = [...o].map((t, n) => (t && n !== e ? c.current[n] : fv()))),
                u(o),
                l([...o]),
                n._setFieldArray(i, o, Sv, { argA: e, argB: r }, !0, !1));
            },
            [u, i, n],
          ),
          replace: z.useCallback(
            (e) => {
              const t = M_(Jm(e));
              ((c.current = t.map(fv)),
                u([...t]),
                l([...t]),
                n._setFieldArray(i, [...t], (e) => e, {}, !0, !1));
            },
            [u, i, n],
          ),
          fields: z.useMemo(() => a.map((e, t) => ({ ...e, [r]: c.current[t] || fv() })), [a, r]),
        }
      );
    })({ control: g.control, name: "rewards.random_rewards" });
  (H.useEffect(() => {
    if (n) {
      const e = async () => {
        try {
          const e = (await DD()).data || [];
          (d(e), h(e.map((e) => ({ label: e.name, value: e.id.toString() }))));
        } catch (D2t) {
          hN.error("Failed to load plan list");
        }
      };
      e();
    }
  }, [n]),
    H.useEffect(() => {
      if (e) {
        const t = e.rewards || {};
        g.reset({
          name: e.name,
          description: e.description || "",
          type: e.type,
          status: e.status,
          sort: e.sort,
          icon: e.icon || "",
          background_image: e.background_image || "",
          conditions: e.conditions && !Array.isArray(e.conditions) ? e.conditions : {},
          limits:
            e.limits && !Array.isArray(e.limits)
              ? { ...e.limits, invite_reward_rate: e.limits?.invite_reward_rate || void 0 }
              : {},
          rewards: {
            balance: t.balance ? t.balance / 100 : void 0,
            transfer_enable:
              "number" == typeof t.transfer_enable
                ? t.transfer_enable / 1024 / 1024 / 1024
                : void 0,
            expire_days: t.expire_days,
            device_limit: t.device_limit,
            reset_package: t.reset_package,
            plan_id: t.plan_id,
            plan_validity_days: t.plan_validity_days,
            random_rewards:
              t.random_rewards?.map((e) => ({
                weight: e.weight,
                balance: e.balance ? e.balance / 100 : void 0,
                transfer_enable:
                  "number" == typeof e.transfer_enable
                    ? e.transfer_enable / 1024 / 1024 / 1024
                    : void 0,
                expire_days: e.expire_days,
                device_limit: e.device_limit,
              })) || [],
          },
          special_config:
            e.special_config && !Array.isArray(e.special_config) ? e.special_config : {},
        });
      } else
        g.reset({
          name: "",
          description: "",
          type: 1,
          status: !0,
          sort: 0,
          icon: "",
          background_image: "",
          conditions: {},
          limits: {},
          rewards: { random_rewards: [] },
          special_config: {},
        });
    }, [e, g, n]));
  const _ = g.watch("type"),
    v = 1 === _;
  return n
    ? Q.jsx(Jet, {
        open: n,
        onOpenChange: (e) => !e && o(),
        children: Q.jsx(Hy, {
          ...g,
          children: Q.jsx(xYt, {
            title: s(e ? "template.form.edit" : "template.form.add"),
            description: " ",
            isSubmitting: a,
            onCancel: o,
            onSubmit: g.handleSubmit(
              async (n) => {
                l(!0);
                const i = JSON.parse(JSON.stringify(n));
                i.rewards &&
                  ("number" == typeof i.rewards.balance &&
                    (i.rewards.balance = Math.round(100 * i.rewards.balance)),
                  "number" == typeof i.rewards.transfer_enable &&
                    (i.rewards.transfer_enable = Math.round(
                      1024 * i.rewards.transfer_enable * 1024 * 1024,
                    )),
                  i.rewards.random_rewards &&
                    i.rewards.random_rewards.forEach((e) => {
                      ("number" == typeof e.balance && (e.balance = Math.round(100 * e.balance)),
                        "number" == typeof e.transfer_enable &&
                          (e.transfer_enable = Math.round(1024 * e.transfer_enable * 1024 * 1024)));
                    }));
                const r = {
                  ...i,
                  conditions: i.conditions || {},
                  limits: i.limits || {},
                  rewards: i.rewards || {},
                  special_config: i.special_config || {},
                };
                try {
                  if (e) (await UD({ id: e.id, ...r }), hN.success(s("messages.templateUpdated")));
                  else {
                    (await zD(r)) && hN.success(s("messages.templateCreated"));
                  }
                  (t(), o());
                } catch (D2t) {
                  const t = D2t?.response?.data?.errors;
                  t &&
                    Object.keys(t).forEach((e) => {
                      g.setError(e, { type: "manual", message: t[e][0] });
                    });
                } finally {
                  l(!1);
                }
              },
              (e) => {
                hN.error(s("messages.formInvalid"));
              },
            ),
            children: Q.jsxs("form", {
              className: "space-y-6",
              children: [
                Q.jsxs("div", {
                  className: "space-y-4 rounded-xl border bg-card/50 p-4",
                  children: [
                    Q.jsxs("div", {
                      className: "mb-2 flex items-center gap-2",
                      children: [
                        Q.jsx(Iat, { className: "h-4 w-4 text-primary" }),
                        Q.jsx("h3", {
                          className: "text-sm font-semibold",
                          children: s("template.form.basic.title", "基础配置"),
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "grid grid-cols-2 gap-4",
                      children: [
                        Q.jsx(eZt, {
                          control: g.control,
                          name: "name",
                          label: s("template.form.name.label"),
                          placeholder: s("template.form.name.placeholder"),
                        }),
                        Q.jsx(Uy, {
                          control: g.control,
                          name: "type",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              children: [
                                Q.jsx(Gy, {
                                  className:
                                    "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                                  children: s("template.form.type.label"),
                                }),
                                Q.jsxs(THt, {
                                  value: e.value?.toString(),
                                  onValueChange: (t) => e.onChange(parseInt(t)),
                                  children: [
                                    Q.jsx(Zy, {
                                      children: Q.jsx(OHt, {
                                        className: "h-9 font-mono text-xs",
                                        children: Q.jsx(RHt, {
                                          placeholder: s("template.form.type.placeholder"),
                                        }),
                                      }),
                                    }),
                                    Q.jsx(PHt, {
                                      children: [1, 2, 3].map((e) =>
                                        Q.jsx(
                                          FHt,
                                          {
                                            value: e.toString(),
                                            className: "font-mono text-xs",
                                            children: s(`types.${e}`),
                                          },
                                          e,
                                        ),
                                      ),
                                    }),
                                  ],
                                }),
                                Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                              ],
                            }),
                        }),
                      ],
                    }),
                    Q.jsx(Uy, {
                      control: g.control,
                      name: "description",
                      render: ({ field: e }) =>
                        Q.jsxs(Ky, {
                          children: [
                            Q.jsx(Gy, {
                              className:
                                "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                              children: s("template.form.description.label"),
                            }),
                            Q.jsx(Zy, {
                              children: Q.jsx(_Gt, {
                                placeholder: s("template.form.description.placeholder"),
                                className: "min-h-[80px] font-mono text-xs",
                                ...e,
                              }),
                            }),
                            Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                          ],
                        }),
                    }),
                    Q.jsxs("div", {
                      className: "grid grid-cols-2 gap-4",
                      children: [
                        Q.jsx(eZt, {
                          control: g.control,
                          name: "sort",
                          type: "number",
                          label: s("template.form.sort.label", "排序"),
                          placeholder: "0",
                        }),
                        Q.jsx(Uy, {
                          control: g.control,
                          name: "status",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              className:
                                "flex flex-row items-center justify-between rounded-md border border-dashed p-3",
                              children: [
                                Q.jsxs("div", {
                                  className: "space-y-0.5",
                                  children: [
                                    Q.jsx(Gy, {
                                      className: "text-xs font-semibold",
                                      children: s("template.form.status.label"),
                                    }),
                                    Q.jsx(Yy, {
                                      className: "text-[10px]",
                                      children: s("template.form.status.description"),
                                    }),
                                  ],
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(mGt, {
                                    checked: e.value,
                                    onCheckedChange: e.onChange,
                                  }),
                                }),
                              ],
                            }),
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "space-y-4 rounded-xl border bg-card/50 p-4",
                  children: [
                    Q.jsxs("div", {
                      className: "mb-2 flex items-center gap-2",
                      children: [
                        Q.jsx(Tat, { className: "h-4 w-4 text-primary" }),
                        Q.jsx("h3", {
                          className: "text-sm font-semibold",
                          children: s("template.form.rewards.title"),
                        }),
                      ],
                    }),
                    v &&
                      Q.jsxs(Q.Fragment, {
                        children: [
                          Q.jsxs("div", {
                            className: "grid grid-cols-2 gap-4",
                            children: [
                              Q.jsx(eZt, {
                                control: g.control,
                                name: "rewards.balance",
                                label: s("template.form.rewards.balance.label"),
                                placeholder: s("template.form.rewards.balance.placeholder"),
                                type: "number",
                                unit: "¥",
                              }),
                              Q.jsx(eZt, {
                                control: g.control,
                                name: "rewards.transfer_enable",
                                label: s("template.form.rewards.transfer_enable.label"),
                                placeholder: s("template.form.rewards.transfer_enable.placeholder"),
                                type: "number",
                                unit: "GB",
                              }),
                              Q.jsx(eZt, {
                                control: g.control,
                                name: "rewards.expire_days",
                                label: s("template.form.rewards.expire_days.label"),
                                placeholder: s("template.form.rewards.expire_days.placeholder"),
                                type: "number",
                                unit: s("common:days", "天"),
                              }),
                              Q.jsx(eZt, {
                                control: g.control,
                                name: "rewards.device_limit",
                                label: s("template.form.rewards.device_limit.label"),
                                placeholder: s("template.form.rewards.device_limit.placeholder"),
                                type: "number",
                              }),
                            ],
                          }),
                          Q.jsx(Uy, {
                            control: g.control,
                            name: "rewards.reset_package",
                            render: ({ field: e }) =>
                              Q.jsxs(Ky, {
                                className:
                                  "flex flex-row items-center justify-between rounded-md border border-dashed p-3",
                                children: [
                                  Q.jsxs("div", {
                                    className: "space-y-0.5",
                                    children: [
                                      Q.jsx(Gy, {
                                        className: "text-xs font-semibold",
                                        children: s("template.form.rewards.reset_package.label"),
                                      }),
                                      Q.jsx(Yy, {
                                        className: "text-[10px]",
                                        children: s(
                                          "template.form.rewards.reset_package.description",
                                        ),
                                      }),
                                    ],
                                  }),
                                  Q.jsx(Zy, {
                                    children: Q.jsx(mGt, {
                                      checked: e.value,
                                      onCheckedChange: e.onChange,
                                    }),
                                  }),
                                ],
                              }),
                          }),
                        ],
                      }),
                    4 === _ &&
                      Q.jsx("p", {
                        className:
                          "rounded-lg bg-muted/50 p-3 font-mono text-xs text-muted-foreground",
                        children: s("template.form.rewards.task_card.description"),
                      }),
                    2 === _ &&
                      Q.jsxs("div", {
                        className: "grid grid-cols-2 gap-4",
                        children: [
                          Q.jsx(Uy, {
                            control: g.control,
                            name: "rewards.plan_id",
                            render: ({ field: e }) =>
                              Q.jsxs(Ky, {
                                children: [
                                  Q.jsx(Gy, {
                                    className:
                                      "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                                    children: s("template.form.rewards.plan_id.label"),
                                  }),
                                  Q.jsxs(THt, {
                                    value: e.value?.toString(),
                                    onValueChange: (t) => e.onChange(parseInt(t, 10)),
                                    children: [
                                      Q.jsx(Zy, {
                                        children: Q.jsx(OHt, {
                                          className: "h-9 font-mono text-xs",
                                          children: Q.jsx(RHt, {
                                            placeholder: s(
                                              "template.form.rewards.plan_id.placeholder",
                                            ),
                                          }),
                                        }),
                                      }),
                                      Q.jsx(PHt, {
                                        children: c.map((e) =>
                                          Q.jsx(
                                            FHt,
                                            {
                                              value: e.id.toString(),
                                              className: "font-mono text-xs",
                                              children: e.name,
                                            },
                                            e.id,
                                          ),
                                        ),
                                      }),
                                    ],
                                  }),
                                  Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                                ],
                              }),
                          }),
                          Q.jsx(eZt, {
                            control: g.control,
                            name: "rewards.plan_validity_days",
                            label: s("template.form.rewards.plan_validity_days.label"),
                            placeholder: s("template.form.rewards.plan_validity_days.placeholder"),
                            type: "number",
                            unit: s("common:days", "天"),
                          }),
                        ],
                      }),
                    3 === _ &&
                      Q.jsxs("div", {
                        className: "space-y-4",
                        children: [
                          Q.jsxs("div", {
                            className: "flex items-center justify-between",
                            children: [
                              Q.jsx(Gy, {
                                className:
                                  "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                                children: s("template.form.rewards.random_rewards.label"),
                              }),
                              Q.jsx(Nm, {
                                type: "button",
                                variant: "outline",
                                size: "sm",
                                className: "h-7 text-[10px]",
                                onClick: () =>
                                  f({
                                    weight: 10,
                                    balance: void 0,
                                    transfer_enable: void 0,
                                    expire_days: void 0,
                                    device_limit: void 0,
                                  }),
                                children: s("template.form.rewards.random_rewards.add"),
                              }),
                            ],
                          }),
                          p.map((e, t) =>
                            Q.jsxs(
                              "div",
                              {
                                className:
                                  "relative grid grid-cols-5 items-end gap-2 rounded-lg border border-dashed bg-muted/20 px-3 pb-2 pt-6",
                                children: [
                                  Q.jsxs("div", {
                                    className:
                                      "absolute left-3 top-2 font-mono text-[10px] uppercase text-muted-foreground opacity-50",
                                    children: ["#", t + 1],
                                  }),
                                  Q.jsx(eZt, {
                                    control: g.control,
                                    name: `rewards.random_rewards.${t}.weight`,
                                    label: s("template.form.rewards.random_rewards.weight"),
                                    type: "number",
                                  }),
                                  Q.jsx(eZt, {
                                    control: g.control,
                                    name: `rewards.random_rewards.${t}.balance`,
                                    label: s("template.form.rewards.balance.label"),
                                    unit: "¥",
                                    type: "number",
                                  }),
                                  Q.jsx(eZt, {
                                    control: g.control,
                                    name: `rewards.random_rewards.${t}.transfer_enable`,
                                    label: s("template.form.rewards.transfer_enable.label"),
                                    unit: "GB",
                                    type: "number",
                                  }),
                                  Q.jsx(eZt, {
                                    control: g.control,
                                    name: `rewards.random_rewards.${t}.expire_days`,
                                    label: s("template.form.rewards.expire_days.label"),
                                    unit: "d",
                                    type: "number",
                                  }),
                                  Q.jsx("div", {
                                    className: "flex h-9 items-center justify-center",
                                    children: Q.jsx(Nm, {
                                      type: "button",
                                      variant: "ghost",
                                      size: "icon",
                                      className:
                                        "h-8 w-8 text-destructive hover:bg-destructive/10 hover:text-destructive",
                                      onClick: () => m(t),
                                      children: Q.jsx(rlt, { className: "h-3.5 w-3.5" }),
                                    }),
                                  }),
                                ],
                              },
                              e.id,
                            ),
                          ),
                        ],
                      }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "space-y-4 rounded-xl border bg-card/50 p-4",
                  children: [
                    Q.jsxs("div", {
                      className: "mb-2 flex items-center gap-2",
                      children: [
                        Q.jsx(tlt, { className: "h-4 w-4 text-primary" }),
                        Q.jsx("h3", {
                          className: "text-sm font-semibold",
                          children: s("template.form.conditions.title"),
                        }),
                      ],
                    }),
                    Q.jsx("div", {
                      className: "grid grid-cols-1 gap-4",
                      children: Q.jsx(eZt, {
                        control: g.control,
                        name: "conditions.new_user_max_days",
                        label: s("template.form.conditions.new_user_max_days.label"),
                        placeholder: s("template.form.conditions.new_user_max_days.placeholder"),
                        type: "number",
                        unit: s("common:days", "天"),
                      }),
                    }),
                    Q.jsxs("div", {
                      className: "grid grid-cols-3 gap-4",
                      children: [
                        Q.jsx(Uy, {
                          control: g.control,
                          name: "conditions.new_user_only",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              className:
                                "flex flex-col items-center justify-between space-y-2 rounded-md border border-dashed p-3",
                              children: [
                                Q.jsx(Gy, {
                                  className: "text-center font-mono text-[10px] uppercase",
                                  children: s("template.form.conditions.new_user_only.label"),
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(mGt, {
                                    checked: e.value,
                                    onCheckedChange: e.onChange,
                                  }),
                                }),
                              ],
                            }),
                        }),
                        Q.jsx(Uy, {
                          control: g.control,
                          name: "conditions.paid_user_only",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              className:
                                "flex flex-col items-center justify-between space-y-2 rounded-md border border-dashed p-3",
                              children: [
                                Q.jsx(Gy, {
                                  className: "text-center font-mono text-[10px] uppercase",
                                  children: s("template.form.conditions.paid_user_only.label"),
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(mGt, {
                                    checked: e.value,
                                    onCheckedChange: e.onChange,
                                  }),
                                }),
                              ],
                            }),
                        }),
                        Q.jsx(Uy, {
                          control: g.control,
                          name: "conditions.require_invite",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              className:
                                "flex flex-col items-center justify-between space-y-2 rounded-md border border-dashed p-3",
                              children: [
                                Q.jsx(Gy, {
                                  className: "text-center font-mono text-[10px] uppercase",
                                  children: s("template.form.conditions.require_invite.label"),
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(mGt, {
                                    checked: e.value,
                                    onCheckedChange: e.onChange,
                                  }),
                                }),
                              ],
                            }),
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "grid gap-4",
                      children: [
                        Q.jsx(Uy, {
                          control: g.control,
                          name: "conditions.allowed_plans",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              children: [
                                Q.jsx(Gy, {
                                  className:
                                    "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                                  children: s("template.form.conditions.allowed_plans.label"),
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(d4t, {
                                    className: "font-mono text-xs",
                                    value:
                                      e.value?.map((e) => ({
                                        label: c.find((t) => t.id === e)?.name || `ID: ${e}`,
                                        value: e.toString(),
                                      })) ?? [],
                                    onChange: (t) => e.onChange(t.map((e) => parseInt(e.value))),
                                    options: u,
                                    placeholder: s(
                                      "template.form.conditions.allowed_plans.placeholder",
                                    ),
                                  }),
                                }),
                                Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                              ],
                            }),
                        }),
                        Q.jsx(Uy, {
                          control: g.control,
                          name: "conditions.disallowed_plans",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              children: [
                                Q.jsx(Gy, {
                                  className:
                                    "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                                  children: s("template.form.conditions.disallowed_plans.label"),
                                }),
                                Q.jsx(Zy, {
                                  children: Q.jsx(d4t, {
                                    className: "font-mono text-xs",
                                    value:
                                      e.value?.map((e) => ({
                                        label: c.find((t) => t.id === e)?.name || `ID: ${e}`,
                                        value: e.toString(),
                                      })) ?? [],
                                    onChange: (t) => e.onChange(t.map((e) => parseInt(e.value))),
                                    options: u,
                                    placeholder: s(
                                      "template.form.conditions.disallowed_plans.placeholder",
                                    ),
                                  }),
                                }),
                                Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                              ],
                            }),
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "space-y-4 rounded-xl border bg-card/50 p-4",
                  children: [
                    Q.jsxs("div", {
                      className: "mb-2 flex items-center gap-2",
                      children: [
                        Q.jsx(Qat, { className: "h-4 w-4 text-primary" }),
                        Q.jsx("h3", {
                          className: "text-sm font-semibold",
                          children: s("template.form.limits.title"),
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "grid grid-cols-2 gap-4",
                      children: [
                        Q.jsx(eZt, {
                          control: g.control,
                          name: "limits.max_use_per_user",
                          label: s("template.form.limits.max_use_per_user.label"),
                          placeholder: s("template.form.limits.max_use_per_user.placeholder"),
                          type: "number",
                        }),
                        Q.jsx(eZt, {
                          control: g.control,
                          name: "limits.cooldown_hours",
                          label: s("template.form.limits.cooldown_hours.label"),
                          placeholder: s("template.form.limits.cooldown_hours.placeholder"),
                          type: "number",
                          unit: "h",
                        }),
                        Q.jsx("div", {
                          className: "col-span-2",
                          children: Q.jsx(eZt, {
                            control: g.control,
                            name: "limits.invite_reward_rate",
                            label: s("template.form.limits.invite_reward_rate.label"),
                            placeholder: s("template.form.limits.invite_reward_rate.placeholder"),
                            type: "number",
                            description: s("template.form.limits.invite_reward_rate.description"),
                            unit: "%",
                          }),
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "space-y-4 rounded-xl border bg-card/50 p-4",
                  children: [
                    Q.jsxs("div", {
                      className: "mb-2 flex items-center gap-2",
                      children: [
                        Q.jsx(vat, { className: "h-4 w-4 text-primary" }),
                        Q.jsx("h3", {
                          className: "text-sm font-semibold",
                          children: s("template.form.special_config.title"),
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "grid grid-cols-1 gap-4 md:grid-cols-2",
                      children: [
                        Q.jsx(Uy, {
                          control: g.control,
                          name: "special_config.start_time",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              className: "flex flex-col",
                              children: [
                                Q.jsx(Gy, {
                                  className:
                                    "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                                  children: s("template.form.special_config.start_time.label"),
                                }),
                                Q.jsxs(qUt, {
                                  children: [
                                    Q.jsx(KUt, {
                                      asChild: !0,
                                      children: Q.jsx(Zy, {
                                        children: Q.jsxs(Nm, {
                                          variant: "outline",
                                          className: Rf(
                                            "h-9 w-full pl-3 text-left font-mono text-xs",
                                            !e.value && "text-muted-foreground",
                                          ),
                                          children: [
                                            e.value
                                              ? mS(new Date(1e3 * e.value), "PPP")
                                              : Q.jsx("span", {
                                                  children: s(
                                                    "template.form.special_config.start_time.placeholder",
                                                  ),
                                                }),
                                            Q.jsx(sat, { className: "ml-auto h-4 w-4 opacity-50" }),
                                          ],
                                        }),
                                      }),
                                    }),
                                    Q.jsx(ZUt, {
                                      className: "w-auto p-0",
                                      align: "start",
                                      children: Q.jsx(mUt, {
                                        mode: "single",
                                        selected: e.value ? new Date(1e3 * e.value) : void 0,
                                        onSelect: (t) =>
                                          e.onChange(t ? Math.floor(t.getTime() / 1e3) : void 0),
                                        initialFocus: !0,
                                      }),
                                    }),
                                  ],
                                }),
                                Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                              ],
                            }),
                        }),
                        Q.jsx(Uy, {
                          control: g.control,
                          name: "special_config.end_time",
                          render: ({ field: e }) =>
                            Q.jsxs(Ky, {
                              className: "flex flex-col",
                              children: [
                                Q.jsx(Gy, {
                                  className:
                                    "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                                  children: s("template.form.special_config.end_time.label"),
                                }),
                                Q.jsxs(qUt, {
                                  children: [
                                    Q.jsx(KUt, {
                                      asChild: !0,
                                      children: Q.jsx(Zy, {
                                        children: Q.jsxs(Nm, {
                                          variant: "outline",
                                          className: Rf(
                                            "h-9 w-full pl-3 text-left font-mono text-xs",
                                            !e.value && "text-muted-foreground",
                                          ),
                                          children: [
                                            e.value
                                              ? mS(new Date(1e3 * e.value), "PPP")
                                              : Q.jsx("span", {
                                                  children: s(
                                                    "template.form.special_config.end_time.placeholder",
                                                  ),
                                                }),
                                            Q.jsx(sat, { className: "ml-auto h-4 w-4 opacity-50" }),
                                          ],
                                        }),
                                      }),
                                    }),
                                    Q.jsx(ZUt, {
                                      className: "w-auto p-0",
                                      align: "start",
                                      children: Q.jsx(mUt, {
                                        mode: "single",
                                        selected: e.value ? new Date(1e3 * e.value) : void 0,
                                        onSelect: (t) =>
                                          e.onChange(t ? Math.floor(t.getTime() / 1e3) : void 0),
                                        initialFocus: !0,
                                      }),
                                    }),
                                  ],
                                }),
                                Q.jsx(Xy, { className: "font-mono text-[10px] uppercase" }),
                              ],
                            }),
                        }),
                        Q.jsx("div", {
                          className: "md:col-span-2",
                          children: Q.jsx(eZt, {
                            control: g.control,
                            name: "special_config.festival_bonus",
                            label: s("template.form.special_config.festival_bonus.label"),
                            placeholder: s(
                              "template.form.special_config.festival_bonus.placeholder",
                            ),
                            type: "number",
                            unit: "x",
                          }),
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "space-y-4 rounded-xl border bg-card/50 p-4",
                  children: [
                    Q.jsxs("div", {
                      className: "mb-2 flex items-center gap-2",
                      children: [
                        Q.jsx(Bat, { className: "h-4 w-4 text-primary" }),
                        Q.jsx("h3", {
                          className: "text-sm font-semibold",
                          children: s("template.form.display.title"),
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "grid grid-cols-1 gap-4 md:grid-cols-2",
                      children: [
                        Q.jsx(eZt, {
                          control: g.control,
                          name: "icon",
                          label: s("template.form.icon.label"),
                          placeholder: s("template.form.icon.placeholder"),
                        }),
                        Q.jsx(eZt, {
                          control: g.control,
                          name: "background_image",
                          label: s("template.form.background_image.label"),
                          placeholder: s("template.form.background_image.placeholder"),
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          }),
        }),
      })
    : null;
}
function X3t({ children: e, refetch: t }) {
  const [n, i] = H.useState(!1),
    [r, o] = H.useState(null),
    s = () => {
      (i(!1), o(null));
    };
  return Q.jsxs(U3t.Provider, {
    value: {
      isOpen: n,
      editingTemplate: r,
      setEditingTemplate: (e) => {
        (o(e), i(!!e));
      },
      closeEdit: s,
    },
    children: [e, Q.jsx(Y3t, { template: r, refetch: t, open: n, onCancel: s })],
  });
}
function Q3t({ table: e }) {
  const { t: t } = Py("common");
  return Q.jsxs(Not, {
    children: [
      Q.jsx(oot, {
        asChild: !0,
        children: Q.jsxs(Nm, {
          variant: "outline",
          size: "sm",
          className: "ml-auto hidden h-8 lg:flex",
          children: [Q.jsx(V7e, { className: "mr-2 h-4 w-4" }), t("table.viewOptions.button")],
        }),
      }),
      Q.jsxs(Iot, {
        align: "end",
        className: "w-[150px]",
        children: [
          Q.jsx(Aot, { children: t("table.viewOptions.label") }),
          Q.jsx(Pot, {}),
          e
            .getAllColumns()
            .filter((e) => void 0 !== e.accessorFn && e.getCanHide())
            .map((e) =>
              Q.jsx(
                Oot,
                {
                  className: "capitalize",
                  checked: e.getIsVisible(),
                  onCheckedChange: (t) => e.toggleVisibility(!!t),
                  children: e.id,
                },
                e.id,
              ),
            ),
        ],
      }),
    ],
  });
}
function J3t({ column: e, title: t, options: n }) {
  const i = new Set(e?.getFilterValue());
  return Q.jsxs(qUt, {
    children: [
      Q.jsx(KUt, {
        asChild: !0,
        children: Q.jsxs(ltt, {
          variant: "outline",
          size: "sm",
          className: "h-8 border-dashed",
          children: [
            Q.jsx(mat, { className: "mr-2 h-4 w-4" }),
            t,
            i?.size > 0 &&
              Q.jsxs(Q.Fragment, {
                children: [
                  Q.jsx(Um, { orientation: "vertical", className: "mx-2 h-4" }),
                  Q.jsx(hqt, {
                    variant: "secondary",
                    className: "rounded-sm px-1 font-normal lg:hidden",
                    children: i.size,
                  }),
                  Q.jsx("div", {
                    className: "hidden space-x-1 lg:flex",
                    children:
                      i.size > 2
                        ? Q.jsxs(hqt, {
                            variant: "secondary",
                            className: "rounded-sm px-1 font-normal",
                            children: [i.size, " selected"],
                          })
                        : n
                            .filter((e) => i.has(e.value))
                            .map((e) =>
                              Q.jsx(
                                hqt,
                                {
                                  variant: "secondary",
                                  className: "rounded-sm px-1 font-normal",
                                  children: e.label,
                                },
                                `selected-${e.value}`,
                              ),
                            ),
                  }),
                ],
              }),
          ],
        }),
      }),
      Q.jsx(ZUt, {
        className: "w-[200px] p-0",
        align: "start",
        children: Q.jsxs(Rdt, {
          children: [
            Q.jsx(Mdt, { placeholder: t }),
            Q.jsxs(Adt, {
              children: [
                Q.jsx(Pdt, { children: "No results found." }),
                Q.jsx(jdt, {
                  children: n.map((t) => {
                    const n = i.has(t.value);
                    return Q.jsxs(
                      Bdt,
                      {
                        onSelect: () => {
                          n ? i.delete(t.value) : i.add(t.value);
                          const r = Array.from(i);
                          e?.setFilterValue(r.length ? r : void 0);
                        },
                        children: [
                          Q.jsx("div", {
                            className: Rf(
                              "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
                              n
                                ? "bg-primary text-primary-foreground"
                                : "opacity-50 [&_svg]:invisible",
                            ),
                            children: Q.jsx(aat, { className: Rf("h-4 w-4") }),
                          }),
                          t.icon &&
                            Q.jsx(t.icon, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
                          Q.jsx("span", { children: t.label }),
                        ],
                      },
                      `option-${t.value}`,
                    );
                  }),
                }),
                i.size > 0 &&
                  Q.jsxs(Q.Fragment, {
                    children: [
                      Q.jsx(Fdt, {}),
                      Q.jsx(jdt, {
                        children: Q.jsx(Bdt, {
                          onSelect: () => e?.setFilterValue(void 0),
                          className: "justify-center text-center",
                          children: "Clear filters",
                        }),
                      }),
                    ],
                  }),
              ],
            }),
          ],
        }),
      }),
    ],
  });
}
function e6t({ table: e, refetch: t }) {
  const { t: n } = Py("giftCard"),
    [i, r] = H.useState(!1),
    o = e.getState().columnFilters.length > 0,
    s = [
      { label: n("types.1"), value: "1" },
      { label: n("types.2"), value: "2" },
      { label: n("types.3"), value: "3" },
      { label: n("types.4"), value: "4" },
      { label: n("types.5"), value: "5" },
      { label: n("types.6"), value: "6" },
      { label: n("types.7"), value: "7" },
      { label: n("types.8"), value: "8" },
      { label: n("types.9"), value: "9" },
      { label: n("types.10"), value: "10" },
    ],
    a = [
      { label: n("common.enabled"), value: "true" },
      { label: n("common.disabled"), value: "false" },
    ];
  return Q.jsxs("div", {
    className: "flex items-center justify-between",
    children: [
      Q.jsxs("div", {
        className: "flex flex-1 items-center space-x-2",
        children: [
          Q.jsx(Q6e, {
            placeholder: n("common.search"),
            value: e.getColumn("name")?.getFilterValue() ?? "",
            onChange: (t) => e.getColumn("name")?.setFilterValue(t.target.value),
            className: "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
          }),
          e.getColumn("type") &&
            Q.jsx(J3t, {
              column: e.getColumn("type"),
              title: n("template.table.columns.type"),
              options: s,
            }),
          e.getColumn("status") &&
            Q.jsx(J3t, {
              column: e.getColumn("status"),
              title: n("template.table.columns.status"),
              options: a,
            }),
          o &&
            Q.jsxs(Nm, {
              variant: "ghost",
              onClick: () => e.resetColumnFilters(),
              className: "h-8 px-2 lg:px-3",
              children: [n("common.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
            }),
        ],
      }),
      Q.jsxs("div", {
        className: "flex items-center space-x-2",
        children: [
          Q.jsxs(Nm, {
            variant: "outline",
            size: "sm",
            onClick: () => r(!0),
            children: [Q.jsx(Wat, { className: "mr-2 h-4 w-4" }), n("template.form.add")],
          }),
          Q.jsx(Q3t, { table: e }),
        ],
      }),
      Q.jsx(Y3t, { template: null, refetch: t, open: i, onOpenChange: r }),
    ],
  });
}
function t6t() {
  const { t: e } = Py("giftCard"),
    [t, n] = H.useState({}),
    [i, r] = H.useState({}),
    [o, s] = H.useState([]),
    [a, l] = H.useState([]),
    [c, d] = H.useState({ pageIndex: 0, pageSize: 20 }),
    {
      refetch: u,
      data: h,
      isLoading: g,
    } = gC({
      queryKey: ["giftCardTemplates", c, o, a],
      queryFn: () => HD({ per_page: c.pageSize, page: c.pageIndex + 1, filter: o, sort: a }),
    }),
    p = PKt({
      data: h?.data ?? [],
      columns: G3t(u, e),
      state: { sorting: a, columnVisibility: i, rowSelection: t, columnFilters: o, pagination: c },
      pageCount: Math.ceil((h?.total ?? 0) / c.pageSize),
      rowCount: h?.total ?? 0,
      manualPagination: !0,
      manualFiltering: !0,
      manualSorting: !0,
      enableRowSelection: !0,
      onRowSelectionChange: n,
      onSortingChange: l,
      onColumnFiltersChange: s,
      onColumnVisibilityChange: r,
      onPaginationChange: d,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsx(X3t, {
    refetch: u,
    children: Q.jsx("div", {
      className: "space-y-4",
      children: Q.jsx(QKt, {
        table: p,
        toolbar: Q.jsx(e6t, { table: p, refetch: u }),
        isLoading: g,
      }),
    }),
  });
}
const n6t = gy({
  template_id: cy().min(1, "请选择一个模板"),
  count: cy().min(1, "生成数量必须大于0").max(1e4, "单次最多生成10000个"),
  prefix: ly().optional(),
  expires_hours: cy().min(1, "有效期必须大于0"),
  max_usage: cy().min(1, "最大使用次数必须大于0"),
  download_csv: dy().optional(),
});
function i6t({ refetch: e, open: t, onOpenChange: n }) {
  const { t: i } = Py("giftCard"),
    [r, o] = H.useState(!1),
    [s, a] = H.useState([]);
  H.useEffect(() => {
    t &&
      HD({ per_page: 1e3, page: 1 }).then(({ data: e }) => {
        a(e || []);
      });
  }, [t]);
  const l = kv({
      resolver: Ov(n6t),
      defaultValues: { count: 10, prefix: "", expires_hours: 720, max_usage: 1, download_csv: !1 },
    }),
    c = async (t) => {
      o(!0);
      try {
        if (t.download_csv) {
          const r = await KD(t);
          if (r && r instanceof Blob) {
            const t = window.URL.createObjectURL(r),
              o = document.createElement("a");
            ((o.href = t),
              (o.download = `gift_codes_${new Date().getTime()}.csv`),
              document.body.appendChild(o),
              o.click(),
              o.remove(),
              window.URL.revokeObjectURL(t),
              hN.success(i("messages.codesGenerated")),
              e(),
              n(!1),
              l.reset());
          }
        } else (await KD(t), hN.success(i("messages.codesGenerated")), e(), n(!1), l.reset());
      } catch (D2t) {
      } finally {
        o(!1);
      }
    };
  return Q.jsx(Jet, {
    open: t,
    onOpenChange: n,
    children: Q.jsx(xYt, {
      title: i("code.form.generate"),
      onCancel: () => n(!1),
      onSubmit: l.handleSubmit(c),
      isSubmitting: r,
      children: Q.jsx(Hy, {
        ...l,
        children: Q.jsxs("form", {
          onSubmit: l.handleSubmit(c),
          className: "space-y-4",
          children: [
            Q.jsx(eZt, {
              control: l.control,
              name: "template_id",
              label: i("code.form.template_id.label"),
              required: !0,
              extra: Q.jsxs(THt, {
                onValueChange: (e) => l.setValue("template_id", parseInt(e)),
                value: l.watch("template_id")?.toString(),
                children: [
                  Q.jsx(Zy, {
                    children: Q.jsx(OHt, {
                      className: "h-9 font-mono text-xs",
                      children: Q.jsx(RHt, { placeholder: i("code.form.template_id.placeholder") }),
                    }),
                  }),
                  Q.jsx(PHt, {
                    children: s.map((e) =>
                      Q.jsx(FHt, { value: e.id.toString(), children: e.name }, e.id),
                    ),
                  }),
                ],
              }),
            }),
            Q.jsxs("div", {
              className: "grid grid-cols-2 gap-4",
              children: [
                Q.jsx(eZt, {
                  control: l.control,
                  name: "count",
                  label: i("code.form.count.label"),
                  type: "number",
                  required: !0,
                  onChangeCustom: (e, t) => t.onChange(parseInt(e) || 0),
                }),
                Q.jsx(eZt, {
                  control: l.control,
                  name: "prefix",
                  label: i("code.form.prefix.label"),
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "grid grid-cols-2 gap-4",
              children: [
                Q.jsx(eZt, {
                  control: l.control,
                  name: "expires_hours",
                  label: i("code.form.expires_hours.label"),
                  type: "number",
                  unit: "H",
                  required: !0,
                  onChangeCustom: (e, t) => t.onChange(parseInt(e) || 0),
                }),
                Q.jsx(eZt, {
                  control: l.control,
                  name: "max_usage",
                  label: i("code.form.max_usage.label"),
                  type: "number",
                  required: !0,
                  onChangeCustom: (e, t) => t.onChange(parseInt(e) || 0),
                }),
              ],
            }),
            Q.jsx(eZt, {
              control: l.control,
              name: "download_csv",
              label: i("code.form.download_csv"),
              className:
                "flex flex-row items-center justify-between space-y-0 rounded-lg border p-4",
              extra: Q.jsx(Zy, {
                children: Q.jsx(mGt, {
                  checked: l.watch("download_csv"),
                  onCheckedChange: (e) => l.setValue("download_csv", e),
                }),
              }),
            }),
          ],
        }),
      }),
    }),
  });
}
function r6t({ table: e, refetch: t }) {
  const { t: n } = Py("giftCard"),
    [i, r] = H.useState(!1),
    o = e.getState().columnFilters.length > 0,
    s = Object.entries(n("code.status", { returnObjects: !0 })).map(([e, t]) => ({
      value: e,
      label: t,
    }));
  return Q.jsxs("div", {
    className: "flex items-center justify-between",
    children: [
      Q.jsxs("div", {
        className: "flex flex-1 items-center space-x-2",
        children: [
          Q.jsx(Q6e, {
            placeholder: n("common.search"),
            value: e.getColumn("code")?.getFilterValue() ?? "",
            onChange: (t) => e.getColumn("code")?.setFilterValue(t.target.value),
            className: "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
          }),
          e.getColumn("status") &&
            Q.jsx(J3t, {
              column: e.getColumn("status"),
              title: n("code.table.columns.status"),
              options: s,
            }),
          o &&
            Q.jsxs(Nm, {
              variant: "ghost",
              onClick: () => e.resetColumnFilters(),
              className: "h-8 px-2 lg:px-3",
              children: [n("common.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
            }),
        ],
      }),
      Q.jsxs("div", {
        className: "flex items-center space-x-2",
        children: [
          Q.jsxs(Nm, {
            variant: "outline",
            size: "sm",
            onClick: () => r(!0),
            children: [Q.jsx(Wat, { className: "mr-2 h-4 w-4" }), n("code.form.generate")],
          }),
          Q.jsxs(Nm, {
            variant: "outline",
            size: "sm",
            disabled: !0,
            children: [Q.jsx(wat, { className: "mr-2 h-4 w-4" }), n("common.export")],
          }),
          Q.jsx(Q3t, { table: e }),
        ],
      }),
      Q.jsx(i6t, { refetch: t, open: i, onOpenChange: r }),
    ],
  });
}
const o6t = (e, t) => [
  {
    accessorKey: "id",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("code.table.columns.id") }),
    cell: ({ row: e }) => Q.jsx(hqt, { children: e.original.id }),
  },
  {
    accessorKey: "code",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("code.table.columns.code") }),
    cell: ({ row: e }) =>
      Q.jsxs("div", {
        className: "flex items-center space-x-2",
        children: [
          Q.jsx(hqt, { variant: "secondary", children: e.original.code }),
          Q.jsx(Nm, {
            variant: "ghost",
            size: "icon",
            className: "h-6 w-6",
            onClick: () =>
              TS(e.original.code).then(() => {
                hN.success(t("common:copy.success"));
              }),
            children: Q.jsx(yat, { className: "h-4 w-4" }),
          }),
        ],
      }),
  },
  {
    accessorKey: "template_name",
    header: ({ column: e }) =>
      Q.jsx(SYt, { column: e, title: t("code.table.columns.template_name") }),
  },
  {
    accessorKey: "status",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("code.table.columns.status") }),
    cell: ({ row: n }) => {
      const i = n.original.status,
        r = 3 === i,
        o = 0 === i || 3 === i;
      return Q.jsxs("div", {
        className: "flex items-center space-x-2",
        children: [
          Q.jsx(hqt, {
            variant: 1 === i ? "secondary" : 2 === i || 3 === i ? "destructive" : "default",
            children: t(`code.status.${i}`),
          }),
          o &&
            Q.jsx(mGt, {
              checked: !r,
              onCheckedChange: async (i) => {
                const r = i ? "enable" : "disable";
                try {
                  const { data: i } = await GD({ id: n.original.id, action: r });
                  i
                    ? (hN.success(t("messages.codeStatusUpdated")), e())
                    : hN.error(t("messages.updateCodeStatusFailed"));
                } catch (D2t) {
                  hN.error(t("messages.updateCodeStatusFailed"));
                }
              },
            }),
        ],
      });
    },
  },
  {
    accessorKey: "expires_at",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("code.table.columns.expires_at") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "text-sm text-muted-foreground",
        children: CS(e.original.expires_at),
      }),
  },
  {
    accessorKey: "usage_count",
    header: ({ column: e }) =>
      Q.jsx(SYt, { column: e, title: t("code.table.columns.usage_count") }),
    cell: ({ row: e }) => Q.jsx(hqt, { variant: "outline", children: e.original.usage_count }),
  },
  {
    accessorKey: "max_usage",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("code.table.columns.max_usage") }),
    cell: ({ row: e }) => Q.jsx(hqt, { variant: "outline", children: e.original.max_usage }),
  },
  {
    accessorKey: "created_at",
    header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("code.table.columns.created_at") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "text-sm text-muted-foreground",
        children: CS(e.original.created_at),
      }),
  },
];
function s6t() {
  const { t: e } = Py("giftCard"),
    [t, n] = H.useState({}),
    [i, r] = H.useState({}),
    [o, s] = H.useState([]),
    [a, l] = H.useState([]),
    [c, d] = H.useState({ pageIndex: 0, pageSize: 20 }),
    {
      refetch: u,
      data: h,
      isLoading: g,
    } = gC({
      queryKey: ["giftCardCodes", c, o, a],
      queryFn: () => qD({ per_page: c.pageSize, page: c.pageIndex + 1, filter: o, sort: a }),
    }),
    p = PKt({
      data: h?.data ?? [],
      columns: o6t(u, e),
      state: { sorting: a, columnVisibility: i, rowSelection: t, columnFilters: o, pagination: c },
      pageCount: Math.ceil((h?.total ?? 0) / c.pageSize),
      rowCount: h?.total ?? 0,
      manualPagination: !0,
      manualFiltering: !0,
      manualSorting: !0,
      enableRowSelection: !0,
      onRowSelectionChange: n,
      onSortingChange: l,
      onColumnFiltersChange: s,
      onColumnVisibilityChange: r,
      onPaginationChange: d,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsx("div", {
    className: "space-y-4",
    children: Q.jsx(QKt, { table: p, toolbar: Q.jsx(r6t, { table: p, refetch: u }), isLoading: g }),
  });
}
const a6t = (e) => [
  {
    accessorKey: "id",
    header: ({ column: t }) => Q.jsx(SYt, { column: t, title: e("usage.table.columns.id") }),
    cell: ({ row: e }) => Q.jsx(hqt, { children: e.original.id }),
  },
  {
    accessorKey: "code",
    header: ({ column: t }) => Q.jsx(SYt, { column: t, title: e("usage.table.columns.code") }),
    cell: ({ row: e }) => Q.jsx(hqt, { variant: "secondary", children: e.original.code }),
  },
  {
    accessorKey: "user_email",
    header: ({ column: t }) =>
      Q.jsx(SYt, { column: t, title: e("usage.table.columns.user_email") }),
  },
  {
    accessorKey: "template_name",
    header: ({ column: t }) =>
      Q.jsx(SYt, { column: t, title: e("usage.table.columns.template_name") }),
  },
  {
    accessorKey: "created_at",
    header: ({ column: t }) =>
      Q.jsx(SYt, { column: t, title: e("usage.table.columns.created_at") }),
    cell: ({ row: e }) =>
      Q.jsx("div", {
        className: "text-sm text-muted-foreground",
        children: CS(e.original.created_at),
      }),
  },
];
function l6t() {
  const { t: e } = Py("giftCard"),
    [t, n] = H.useState([]),
    [i, r] = H.useState([]),
    [o, s] = H.useState({ pageIndex: 0, pageSize: 20 }),
    { data: a, isLoading: l } = gC({
      queryKey: ["giftCardUsages", o, t, i],
      queryFn: () => ZD({ per_page: o.pageSize, page: o.pageIndex + 1, filter: t, sort: i }),
    }),
    c = PKt({
      data: a?.data ?? [],
      columns: a6t(e),
      state: { sorting: i, columnFilters: t, pagination: o },
      pageCount: Math.ceil((a?.total ?? 0) / o.pageSize),
      rowCount: a?.total ?? 0,
      manualPagination: !0,
      manualFiltering: !0,
      manualSorting: !0,
      onSortingChange: r,
      onColumnFiltersChange: n,
      onPaginationChange: s,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      getSortedRowModel: MKt(),
    });
  return Q.jsxs("div", {
    className: "space-y-4",
    children: [
      Q.jsx("div", {
        className: "flex items-center justify-between",
        children: Q.jsx(Q6e, {
          placeholder: "搜索用户邮箱...",
          value: c.getColumn("user_email")?.getFilterValue() ?? "",
          onChange: (e) => c.getColumn("user_email")?.setFilterValue(e.target.value),
          className: "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
        }),
      }),
      Q.jsx(QKt, { table: c, isLoading: l }),
    ],
  });
}
function c6t() {
  const { t: e } = Py("giftCard"),
    { data: t, isLoading: n } = gC({ queryKey: ["giftCardStats"], queryFn: () => YD({}) }),
    i = t?.data?.total_stats,
    r = [
      { title: e("statistics.total.templates_count"), value: i?.templates_count },
      { title: e("statistics.total.active_templates_count"), value: i?.active_templates_count },
      { title: e("statistics.total.codes_count"), value: i?.codes_count },
      { title: e("statistics.total.used_codes_count"), value: i?.used_codes_count },
    ];
  return Q.jsx("div", {
    className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
    children: r.map((e, t) =>
      Q.jsxs(
        q6e,
        {
          children: [
            Q.jsx(K6e, {
              className: "flex flex-row items-center justify-between space-y-0 pb-2",
              children: Q.jsx(G6e, { className: "text-sm font-medium", children: e.title }),
            }),
            Q.jsx(Y6e, {
              children: n
                ? Q.jsx(n$t, { className: "h-8 w-1/2" })
                : Q.jsx("div", { className: "text-2xl font-bold", children: e.value ?? 0 }),
            }),
          ],
        },
        t,
      ),
    ),
  });
}
const d6t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("giftCard"),
            [t, n] = H.useState("templates");
          return Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                children: [
                  Q.jsx(Vdt, {}),
                  Q.jsxs("div", {
                    className: "ml-auto flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                className: "flex flex-col",
                fixedHeight: !0,
                children: [
                  Q.jsx("div", {
                    className: "mb-6 flex items-center justify-between space-y-2",
                    children: Q.jsxs("div", {
                      children: [
                        Q.jsx("h2", {
                          className: "text-2xl font-bold tracking-tight",
                          children: e("title"),
                        }),
                        Q.jsx("p", {
                          className: "text-muted-foreground mt-2",
                          children: e("description"),
                        }),
                      ],
                    }),
                  }),
                  Q.jsxs(iw, {
                    value: t,
                    onValueChange: n,
                    className: "flex-1",
                    children: [
                      Q.jsxs(rw, {
                        className: "grid w-full grid-cols-4",
                        children: [
                          Q.jsx(ow, { value: "templates", children: e("tabs.templates") }),
                          Q.jsx(ow, { value: "codes", children: e("tabs.codes") }),
                          Q.jsx(ow, { value: "usages", children: e("tabs.usages") }),
                          Q.jsx(ow, { value: "statistics", children: e("tabs.statistics") }),
                        ],
                      }),
                      Q.jsx(sw, {
                        value: "templates",
                        className: "mt-6 flex-1",
                        children: Q.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            Q.jsx("div", {
                              className: "flex items-center justify-between",
                              children: Q.jsxs("div", {
                                children: [
                                  Q.jsx("h3", {
                                    className: "text-lg font-medium",
                                    children: e("template.title"),
                                  }),
                                  Q.jsx("p", {
                                    className: "text-sm text-muted-foreground",
                                    children: e("template.description"),
                                  }),
                                ],
                              }),
                            }),
                            Q.jsx(t6t, {}),
                          ],
                        }),
                      }),
                      Q.jsx(sw, {
                        value: "codes",
                        className: "mt-6 flex-1",
                        children: Q.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            Q.jsx("div", {
                              className: "flex items-center justify-between",
                              children: Q.jsxs("div", {
                                children: [
                                  Q.jsx("h3", {
                                    className: "text-lg font-medium",
                                    children: e("code.title"),
                                  }),
                                  Q.jsx("p", {
                                    className: "text-sm text-muted-foreground",
                                    children: e("code.description"),
                                  }),
                                ],
                              }),
                            }),
                            Q.jsx(s6t, {}),
                          ],
                        }),
                      }),
                      Q.jsx(sw, {
                        value: "usages",
                        className: "mt-6 flex-1",
                        children: Q.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            Q.jsx("div", {
                              className: "flex items-center justify-between",
                              children: Q.jsxs("div", {
                                children: [
                                  Q.jsx("h3", {
                                    className: "text-lg font-medium",
                                    children: e("usage.title"),
                                  }),
                                  Q.jsx("p", {
                                    className: "text-sm text-muted-foreground",
                                    children: e("usage.description"),
                                  }),
                                ],
                              }),
                            }),
                            Q.jsx(l6t, {}),
                          ],
                        }),
                      }),
                      Q.jsx(sw, {
                        value: "statistics",
                        className: "mt-6 flex-1",
                        children: Q.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            Q.jsx("div", {
                              className: "flex items-center justify-between",
                              children: Q.jsxs("div", {
                                children: [
                                  Q.jsx("h3", {
                                    className: "text-lg font-medium",
                                    children: e("statistics.title"),
                                  }),
                                  Q.jsx("p", {
                                    className: "text-sm text-muted-foreground",
                                    children: e("statistics.description"),
                                  }),
                                ],
                              }),
                            }),
                            Q.jsx(c6t, {}),
                          ],
                        }),
                      }),
                    ],
                  }),
                ],
              }),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  u6t = "【{{app.name}}】系统通知（{{now}}）",
  h6t =
    "尊敬的用户 {{user.email}} 您好：\n\n这里是来自 {{app.name}} 的系统通知。\n\n如有问题请访问：{{app.url}}\n";
function g6t({ open: e, onOpenChange: t, table: n }) {
  const { t: i } = Py("user"),
    [r, o] = H.useState(!1),
    [s, a] = H.useState(""),
    [l, c] = H.useState(""),
    [d, u] = H.useState("all"),
    h = n.getSelectedRowModel().rows.length,
    g = n.getState().columnFilters.length > 0,
    p = h > 0 ? "selected" : g ? "filtered" : "all";
  H.useEffect(() => {
    e && u(p);
  }, [e, p]);
  return Q.jsx(Jet, {
    open: e,
    onOpenChange: t,
    children: Q.jsxs(xYt, {
      title: i("send_mail.title"),
      description: i("send_mail.description"),
      onCancel: () => t(!1),
      onConfirm: async () => {
        if (s && l)
          try {
            o(!0);
            const e = n.getState().sorting[0],
              r = e?.desc ? "DESC" : "ASC";
            if ("selected" === d) {
              const e = n.getSelectedRowModel().rows.map((e) => e.original.id);
              if (!e.length)
                return void hN.error(i("messages.send_mail.required_selected", "请先选择用户"));
              for (const t of e)
                await cT({ subject: s, content: l, filter: [{ id: "id", value: `eq:${t}` }] });
            } else
              "filtered" === d
                ? await cT({
                    subject: s,
                    content: l,
                    filter: n.getState().columnFilters,
                    sort: e?.id,
                    sort_type: r,
                  })
                : await cT({ subject: s, content: l });
            (hN.success(i("messages.send_mail.success")), t(!1), a(""), c(""));
          } catch (D2t) {
            hN.error(i("messages.send_mail.failed"));
          } finally {
            o(!1);
          }
        else hN.error(i("messages.send_mail.required_fields"));
      },
      isSubmitting: r,
      submitLabel: i(r ? "send_mail.sending" : "send_mail.send"),
      submitIcon: Q.jsx(Kat, { className: "h-4 w-4" }),
      className: "max-w-2xl",
      contentClassName: "bg-background",
      children: [
        Q.jsxs("div", {
          className: "space-y-2",
          children: [
            Q.jsx("label", {
              className: "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
              children: i("send_mail.scope", "发送范围"),
            }),
            Q.jsxs(THt, {
              value: d,
              onValueChange: (e) => u(e),
              children: [
                Q.jsx(OHt, { className: "h-9 font-mono text-xs", children: Q.jsx(RHt, {}) }),
                Q.jsxs(PHt, {
                  children: [
                    Q.jsx(FHt, {
                      value: "selected",
                      disabled: 0 === h,
                      children: i("send_mail.scope.selected", `仅选中（${h}）`),
                    }),
                    Q.jsx(FHt, {
                      value: "filtered",
                      disabled: !g,
                      children: i("send_mail.scope.filtered", "筛选后的用户"),
                    }),
                    Q.jsx(FHt, { value: "all", children: i("send_mail.scope.all", "全部用户") }),
                  ],
                }),
              ],
            }),
          ],
        }),
        Q.jsxs("div", {
          className: "space-y-2",
          children: [
            Q.jsx("label", {
              htmlFor: "subject",
              className: "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
              children: i("send_mail.subject"),
            }),
            Q.jsx(Q6e, {
              id: "subject",
              value: s,
              onChange: (e) => a(e.target.value),
              placeholder: i("send_mail.subject_placeholder", "例如：系统通知（支持占位符）"),
              className: "h-9 font-mono text-xs",
            }),
            Q.jsxs("p", {
              className: "font-mono text-[10px] leading-relaxed opacity-70",
              children: [
                "支持占位符：",
                "{{key}}",
                " 或 ",
                "{{key|默认值}}",
                "（未知变量会原样保留）",
              ],
            }),
          ],
        }),
        Q.jsxs("div", {
          className: "space-y-2",
          children: [
            Q.jsxs("div", {
              className: "flex items-center justify-between gap-3",
              children: [
                Q.jsx("label", {
                  htmlFor: "content",
                  className:
                    "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
                  children: i("send_mail.content"),
                }),
                Q.jsx(Nm, {
                  type: "button",
                  variant: "outline",
                  size: "sm",
                  className: "h-8 font-mono text-[10px]",
                  onClick: () => {
                    (a(u6t), c(h6t));
                  },
                  disabled: r,
                  children: i("send_mail.apply_system_notice", "填入系统通知模板"),
                }),
              ],
            }),
            Q.jsx(_Gt, {
              id: "content",
              value: l,
              onChange: (e) => c(e.target.value),
              className: "min-h-[220px] font-mono text-xs",
              placeholder: i("send_mail.content_placeholder", "请输入邮件正文（可使用占位符）"),
            }),
            Q.jsx("p", {
              className: "font-mono text-[10px] leading-relaxed opacity-70",
              children: "content 默认按纯文本处理（会转义），不支持 HTML 富文本。",
            }),
          ],
        }),
        Q.jsxs("div", {
          className: "rounded-md border bg-muted/10 p-3",
          children: [
            Q.jsx("div", {
              className: "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
              children: i("send_mail.available_vars", "可用变量"),
            }),
            Q.jsxs("div", {
              className: "mt-2 font-mono text-[10px] leading-relaxed opacity-80",
              children: [
                "{{app.name}}",
                " ",
                "{{app.url}}",
                " ",
                "{{now}}",
                " ",
                "{{user.id}}",
                " ",
                "{{user.email}}",
                " ",
                "{{user.uuid}}",
                " ",
                "{{user.plan_name}}",
                " ",
                "{{user.expired_at}}",
                " ",
                "{{user.transfer_enable}}",
                " ",
                "{{user.transfer_used}}",
                " ",
                "{{user.transfer_left}}",
              ],
            }),
          ],
        }),
      ],
    }),
  });
}
const p6t = gy({
    email_prefix: ly().optional(),
    email_suffix: ly().min(1),
    password: ly().optional(),
    expired_at: cy().optional().nullable(),
    plan_id: cy().nullable(),
    generate_count: cy().optional().nullable(),
    download_csv: dy().optional(),
  }).refine(
    (e) => null !== e.generate_count || (void 0 !== e.email_prefix && "" !== e.email_prefix),
    { message: "Email prefix is required when generate_count is null", path: ["email_prefix"] },
  ),
  f6t = {
    email_prefix: "",
    email_suffix: "",
    password: "",
    expired_at: null,
    plan_id: null,
    generate_count: void 0,
    download_csv: !1,
  };
function m6t({ refetch: e }) {
  const { t: t } = Py("user"),
    [n, i] = H.useState(!1),
    r = kv({ resolver: Ov(p6t), defaultValues: f6t, mode: "onChange" }),
    [o, s] = H.useState([]),
    [a, l] = H.useState(!1);
  H.useEffect(() => {
    n &&
      DD().then(({ data: e }) => {
        e && s(e);
      });
  }, [n]);
  const c = async (n) => {
    l(!0);
    try {
      if (n.download_csv) {
        const o = await sT(n);
        if (o && o instanceof Blob) {
          const n = window.URL.createObjectURL(o),
            s = document.createElement("a");
          ((s.href = n),
            (s.download = `users_${new Date().getTime()}.csv`),
            document.body.appendChild(s),
            s.click(),
            s.remove(),
            window.URL.revokeObjectURL(n),
            hN.success(t("generate.form.success")),
            r.reset(),
            e(),
            i(!1));
        }
      } else {
        const { data: o } = await sT(n);
        o && (hN.success(t("generate.form.success")), r.reset(), e(), i(!1));
      }
    } finally {
      l(!1);
    }
  };
  return Q.jsxs(Jet, {
    open: n,
    onOpenChange: i,
    children: [
      Q.jsx(ett, {
        asChild: !0,
        children: Q.jsxs(Nm, {
          size: "sm",
          variant: "outline",
          className: "gap-0 space-x-2",
          children: [
            Q.jsx(yYt, { icon: "ion:add" }),
            Q.jsx("div", { children: t("generate.button") }),
          ],
        }),
      }),
      Q.jsx(xYt, {
        title: t("generate.title"),
        onCancel: () => i(!1),
        onSubmit: r.handleSubmit(c),
        isSubmitting: a,
        children: Q.jsx(Hy, {
          ...r,
          children: Q.jsxs("form", {
            onSubmit: r.handleSubmit(c),
            className: "space-y-4",
            children: [
              Q.jsx(eZt, {
                control: r.control,
                name: "email_suffix",
                label: t("generate.form.email"),
                required: !0,
                extra: Q.jsxs("div", {
                  className: "flex w-full items-center gap-0",
                  children: [
                    !r.watch("generate_count") &&
                      Q.jsx(Zy, {
                        children: Q.jsx("input", {
                          className:
                            "h-9 flex-[5] rounded-l-md border border-input bg-background px-3 font-mono text-xs focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
                          placeholder: t("generate.form.email_prefix"),
                          ...r.register("email_prefix"),
                        }),
                      }),
                    Q.jsx("div", {
                      className: Rf(
                        "flex h-9 items-center border-y border-input bg-muted/30 px-3 font-mono text-xs text-muted-foreground",
                        r.watch("generate_count") ? "rounded-l-md border-l" : "border-l-0",
                      ),
                      children: "@",
                    }),
                    Q.jsx(Zy, {
                      children: Q.jsx("input", {
                        className:
                          "h-9 flex-[4] rounded-r-md border border-l-0 border-input bg-background px-3 font-mono text-xs focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
                        placeholder: t("generate.form.email_domain"),
                        ...r.register("email_suffix"),
                      }),
                    }),
                  ],
                }),
              }),
              Q.jsx(eZt, {
                control: r.control,
                name: "password",
                label: t("generate.form.password"),
                placeholder: t("generate.form.password_placeholder"),
              }),
              Q.jsxs("div", {
                className: "grid grid-cols-2 gap-4",
                children: [
                  Q.jsx(eZt, {
                    control: r.control,
                    name: "expired_at",
                    label: t("generate.form.expire_time"),
                    extra: Q.jsxs(qUt, {
                      children: [
                        Q.jsx(KUt, {
                          asChild: !0,
                          children: Q.jsx(Zy, {
                            children: Q.jsxs(Nm, {
                              variant: "outline",
                              className: Rf(
                                "h-9 w-full px-3 text-left font-mono text-xs font-normal",
                                !r.watch("expired_at") && "text-muted-foreground",
                              ),
                              children: [
                                r.watch("expired_at")
                                  ? CS(r.watch("expired_at"))
                                  : Q.jsx("span", {
                                      children: t("generate.form.expire_time_placeholder"),
                                    }),
                                Q.jsx(sat, { className: "ml-auto h-3.5 w-3.5 opacity-50" }),
                              ],
                            }),
                          }),
                        }),
                        Q.jsxs(ZUt, {
                          className: "flex w-auto flex-col space-y-2 p-2",
                          children: [
                            Q.jsx(HUt, {
                              asChild: !0,
                              children: Q.jsx(Nm, {
                                variant: "outline",
                                className: "h-8 w-full font-mono text-xs",
                                onClick: () => {
                                  r.setValue("expired_at", null);
                                },
                                children: t("generate.form.permanent"),
                              }),
                            }),
                            Q.jsx("div", {
                              className: "rounded-md border",
                              children: Q.jsx(mUt, {
                                mode: "single",
                                selected: r.watch("expired_at")
                                  ? new Date(1e3 * r.watch("expired_at"))
                                  : void 0,
                                onSelect: (e) => {
                                  e && r.setValue("expired_at", e?.getTime() / 1e3);
                                },
                              }),
                            }),
                          ],
                        }),
                      ],
                    }),
                  }),
                  Q.jsx(eZt, {
                    control: r.control,
                    name: "plan_id",
                    label: t("generate.form.subscription"),
                    extra: Q.jsxs(THt, {
                      value: r.watch("plan_id")?.toString() || "null",
                      onValueChange: (e) =>
                        r.setValue("plan_id", "null" === e ? null : parseInt(e)),
                      children: [
                        Q.jsx(Zy, {
                          children: Q.jsx(OHt, {
                            className: "h-9 font-mono text-xs",
                            children: Q.jsx(RHt, {
                              placeholder: t("generate.form.subscription_none"),
                            }),
                          }),
                        }),
                        Q.jsxs(PHt, {
                          children: [
                            Q.jsx(FHt, {
                              value: "null",
                              className: "font-mono text-xs",
                              children: t("generate.form.subscription_none"),
                            }),
                            o.map((e) =>
                              Q.jsx(
                                FHt,
                                {
                                  value: e.id.toString(),
                                  className: "font-mono text-xs",
                                  children: e.name,
                                },
                                e.id,
                              ),
                            ),
                          ],
                        }),
                      ],
                    }),
                  }),
                ],
              }),
              !r.watch("email_prefix") &&
                Q.jsx(eZt, {
                  control: r.control,
                  name: "generate_count",
                  label: t("generate.form.generate_count"),
                  type: "number",
                  placeholder: t("generate.form.generate_count_placeholder"),
                  onChangeCustom: (e, t) => t.onChange(e ? parseInt(e) : null),
                }),
              r.watch("generate_count") &&
                Q.jsx(eZt, {
                  control: r.control,
                  name: "download_csv",
                  label: t("generate.form.download_csv"),
                  className:
                    "flex flex-row items-center justify-between space-y-0 rounded-lg border p-4",
                  extra: Q.jsx(Zy, {
                    children: Q.jsx(mGt, {
                      checked: r.watch("download_csv"),
                      onCheckedChange: (e) => r.setValue("download_csv", e),
                    }),
                  }),
                }),
            ],
          }),
        }),
      }),
    ],
  });
}
let _6t = 0;
const v6t = new Map(),
  b6t = (e) => {
    if (v6t.has(e)) return;
    const t = setTimeout(() => {
      (v6t.delete(e), C6t({ type: "REMOVE_TOAST", toastId: e }));
    }, 1e6);
    v6t.set(e, t);
  },
  y6t = (e, t) => {
    switch (t.type) {
      case "ADD_TOAST":
        return { ...e, toasts: [t.toast, ...e.toasts].slice(0, 1) };
      case "UPDATE_TOAST":
        return {
          ...e,
          toasts: e.toasts.map((e) => (e.id === t.toast.id ? { ...e, ...t.toast } : e)),
        };
      case "DISMISS_TOAST": {
        const { toastId: n } = t;
        return (
          n
            ? b6t(n)
            : e.toasts.forEach((e) => {
                b6t(e.id);
              }),
          {
            ...e,
            toasts: e.toasts.map((e) => (e.id === n || void 0 === n ? { ...e, open: !1 } : e)),
          }
        );
      }
      case "REMOVE_TOAST":
        return void 0 === t.toastId
          ? { ...e, toasts: [] }
          : { ...e, toasts: e.toasts.filter((e) => e.id !== t.toastId) };
    }
  },
  x6t = [];
let w6t = { toasts: [] };
function C6t(e) {
  ((w6t = y6t(w6t, e)),
    x6t.forEach((e) => {
      e(w6t);
    }));
}
function S6t({ ...e }) {
  const t = ((_6t = (_6t + 1) % Number.MAX_SAFE_INTEGER), _6t.toString()),
    n = () => C6t({ type: "DISMISS_TOAST", toastId: t });
  return (
    C6t({
      type: "ADD_TOAST",
      toast: {
        ...e,
        id: t,
        open: !0,
        onOpenChange: (e) => {
          e || n();
        },
      },
    }),
    { id: t, dismiss: n, update: (e) => C6t({ type: "UPDATE_TOAST", toast: { ...e, id: t } }) }
  );
}
function k6t() {
  const [e, t] = H.useState(w6t);
  return (
    H.useEffect(
      () => (
        x6t.push(t),
        () => {
          const e = x6t.indexOf(t);
          e > -1 && x6t.splice(e, 1);
        }
      ),
      [e],
    ),
    { ...e, toast: S6t, dismiss: (e) => C6t({ type: "DISMISS_TOAST", toastId: e }) }
  );
}
const E6t = n7e,
  N6t = i7e,
  L6t = r7e,
  D6t = H.forwardRef(({ className: e, ...t }, n) =>
    Q.jsx(o7e, {
      className: Rf(
        "fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
        e,
      ),
      ...t,
      ref: n,
    }),
  );
D6t.displayName = o7e.displayName;
const T6t = jp(
    "fixed overflow-y-scroll  z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out",
    {
      variants: {
        side: {
          top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
          bottom:
            "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
          left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-md",
          right:
            "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-md",
        },
      },
      defaultVariants: { side: "right" },
    },
  ),
  I6t = H.forwardRef(({ side: e = "right", className: t, children: n, ...i }, r) =>
    Q.jsxs(L6t, {
      children: [
        Q.jsx(D6t, {}),
        Q.jsxs(s7e, {
          ref: r,
          className: Rf(T6t({ side: e }), t),
          ...i,
          children: [
            Q.jsxs(c7e, {
              className:
                "absolute right-4 top-4  rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",
              children: [
                Q.jsx(E7e, { className: "h-4 w-4" }),
                Q.jsx("span", { className: "sr-only", children: "Close" }),
              ],
            }),
            n,
          ],
        }),
      ],
    }),
  );
I6t.displayName = s7e.displayName;
const R6t = ({ className: e, ...t }) =>
  Q.jsx("div", { className: Rf("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
R6t.displayName = "SheetHeader";
const O6t = ({ className: e, ...t }) =>
  Q.jsx("div", {
    className: Rf("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
    ...t,
  });
O6t.displayName = "SheetFooter";
const M6t = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(a7e, { ref: n, className: Rf("text-lg font-semibold text-foreground", e), ...t }),
);
M6t.displayName = a7e.displayName;
const A6t = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(l7e, { ref: n, className: Rf("text-sm text-muted-foreground", e), ...t }),
);
function P6t({ table: e, refetch: t, subscriptionPlans: n = [] }) {
  const { t: i } = Py("user"),
    { toast: r } = k6t(),
    o = e.getState().columnFilters.length > 0,
    s = e.getSelectedRowModel(),
    a = s.rows.length,
    l = s.rows.map((e) => e.original.id),
    c = a > 0 ? "selected" : o ? "filtered" : "all",
    d =
      "selected" === c
        ? `(${a})`
        : "filtered" === c
          ? i("actions.scope.filtered_suffix", "筛选")
          : i("actions.scope.all_suffix", "全部"),
    u = "selected" === c ? d : `(${d})`,
    [h, g] = H.useState([]),
    [p, f] = H.useState(!1),
    [m, _] = H.useState(!1),
    [v, b] = H.useState(!1),
    [y, x] = H.useState(!1),
    w = [
      {
        label: i("filter.fields.email"),
        value: "email",
        type: "text",
        operators: [
          { label: i("filter.operators.contains"), value: "contains" },
          { label: i("filter.operators.eq"), value: "eq" },
        ],
      },
      {
        label: i("filter.fields.id"),
        value: "id",
        type: "number",
        operators: [
          { label: i("filter.operators.eq"), value: "eq" },
          { label: i("filter.operators.gt"), value: "gt" },
          { label: i("filter.operators.lt"), value: "lt" },
        ],
      },
      {
        label: i("filter.fields.plan_id"),
        value: "plan_id",
        type: "select",
        operators: [{ label: i("filter.operators.eq"), value: "eq" }],
        useOptions: !0,
      },
      {
        label: i("filter.fields.transfer_enable"),
        value: "transfer_enable",
        type: "number",
        unit: "GB",
        operators: [
          { label: i("filter.operators.gt"), value: "gt" },
          { label: i("filter.operators.lt"), value: "lt" },
          { label: i("filter.operators.eq"), value: "eq" },
        ],
      },
      {
        label: i("filter.fields.total_used"),
        value: "total_used",
        type: "number",
        unit: "GB",
        operators: [
          { label: i("filter.operators.gt"), value: "gt" },
          { label: i("filter.operators.lt"), value: "lt" },
          { label: i("filter.operators.eq"), value: "eq" },
        ],
      },
      {
        label: i("filter.fields.online_count"),
        value: "online_count",
        type: "number",
        operators: [
          { label: i("filter.operators.eq"), value: "eq" },
          { label: i("filter.operators.gt"), value: "gt" },
          { label: i("filter.operators.lt"), value: "lt" },
        ],
      },
      {
        label: i("filter.fields.expired_at"),
        value: "expired_at",
        type: "date",
        operators: [
          { label: i("filter.operators.lt"), value: "lt" },
          { label: i("filter.operators.gt"), value: "gt" },
          { label: i("filter.operators.eq"), value: "eq" },
        ],
      },
      {
        label: i("filter.fields.uuid"),
        value: "uuid",
        type: "text",
        operators: [{ label: i("filter.operators.eq"), value: "eq" }],
      },
      {
        label: i("filter.fields.token"),
        value: "token",
        type: "text",
        operators: [{ label: i("filter.operators.eq"), value: "eq" }],
      },
      {
        label: i("filter.fields.banned"),
        value: "banned",
        type: "select",
        operators: [{ label: i("filter.operators.eq"), value: "eq" }],
        options: [
          { label: i("filter.status.normal"), value: "0" },
          { label: i("filter.status.banned"), value: "1" },
        ],
      },
      {
        label: i("filter.fields.remark"),
        value: "remarks",
        type: "text",
        operators: [
          { label: i("filter.operators.contains"), value: "contains" },
          { label: i("filter.operators.eq"), value: "eq" },
        ],
      },
      {
        label: i("filter.fields.inviter_email"),
        value: "invite_user.email",
        type: "text",
        operators: [
          { label: i("filter.operators.contains"), value: "contains" },
          { label: i("filter.operators.eq"), value: "eq" },
        ],
      },
      {
        label: i("filter.fields.invite_user_id"),
        value: "invite_user_id",
        type: "number",
        operators: [{ label: i("filter.operators.eq"), value: "eq" }],
      },
      {
        label: i("filter.fields.is_admin"),
        value: "is_admin",
        type: "boolean",
        operators: [{ label: i("filter.operators.eq"), value: "eq" }],
      },
      {
        label: i("filter.fields.is_staff"),
        value: "is_staff",
        type: "boolean",
        operators: [{ label: i("filter.operators.eq"), value: "eq" }],
      },
    ],
    C = (e, t, n) => {
      const i = [...h];
      if (((i[e] = { ...i[e], [t]: n }), "field" === t)) {
        const t = w.find((e) => e.value === n);
        t && ((i[e].operator = t.operators[0].value), (i[e].value = "boolean" !== t.type && ""));
      }
      g(i);
    },
    S = (e, t) => {
      const r = w.find((t) => t.value === e.field);
      if (!r) return null;
      switch (r.type) {
        case "text":
          return Q.jsx(Q6e, {
            placeholder: i("filter.sheet.value"),
            value: e.value,
            onChange: (e) => C(t, "value", e.target.value),
          });
        case "number":
          return Q.jsxs("div", {
            className: "flex items-center space-x-2",
            children: [
              Q.jsx(Q6e, {
                type: "number",
                placeholder: i("filter.sheet.value_number", { unit: r.unit }),
                value: "GB" === r.unit ? ((o = e.value || 0), o / 1073741824) : e.value,
                onChange: (e) => {
                  const n = Number(e.target.value);
                  C(t, "value", "GB" === r.unit ? ((e) => 1024 * e * 1024 * 1024)(n) : n);
                },
              }),
              r.unit &&
                Q.jsx("span", { className: "text-sm text-muted-foreground", children: r.unit }),
            ],
          });
        case "date":
          return Q.jsx(mUt, {
            mode: "single",
            selected: e.value,
            onSelect: (e) => C(t, "value", e),
            className: "flex flex-1 justify-center rounded-md border",
          });
        case "select":
          return Q.jsxs(THt, {
            value: e.value,
            onValueChange: (e) => C(t, "value", e),
            children: [
              Q.jsx(OHt, { children: Q.jsx(RHt, { placeholder: i("filter.sheet.value") }) }),
              Q.jsx(PHt, {
                children: r.useOptions
                  ? n.map((e) =>
                      Q.jsx(FHt, { value: e.value.toString(), children: e.label }, e.value),
                    )
                  : r.options?.map((e) =>
                      Q.jsx(FHt, { value: e.value.toString(), children: e.label }, e.value),
                    ),
              }),
            ],
          });
        case "boolean":
          return Q.jsxs("div", {
            className: "flex items-center space-x-2",
            children: [
              Q.jsx(mGt, { checked: e.value, onCheckedChange: (e) => C(t, "value", e) }),
              Q.jsx(Wy, {
                children: e.value ? i("filter.boolean.true") : i("filter.boolean.false"),
              }),
            ],
          });
        default:
          return null;
      }
      var o;
    };
  return Q.jsxs("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: [
      Q.jsxs("div", {
        className: "flex items-center gap-2",
        children: [
          Q.jsx(m6t, { refetch: t }),
          Q.jsx(Q6e, {
            placeholder: i("filter.email_search"),
            value: e.getColumn("email")?.getFilterValue() ?? "",
            onChange: (t) => e.getColumn("email")?.setFilterValue(t.target.value),
            className: "h-8 min-w-[150px] flex-1 sm:w-[150px] lg:w-[250px]",
          }),
        ],
      }),
      Q.jsxs("div", {
        className: "flex items-center gap-2",
        children: [
          Q.jsxs(E6t, {
            open: p,
            onOpenChange: f,
            children: [
              Q.jsx(N6t, {
                asChild: !0,
                children: Q.jsxs(Nm, {
                  variant: "outline",
                  size: "sm",
                  className: "h-8 border-dashed",
                  children: [
                    Q.jsx(V7e, { className: "mr-2 h-4 w-4" }),
                    i("filter.advanced"),
                    h.length > 0 &&
                      Q.jsx(hqt, {
                        variant: "secondary",
                        className: "ml-2 rounded-sm px-1",
                        children: h.length,
                      }),
                  ],
                }),
              }),
              Q.jsxs(I6t, {
                className: "w-full sm:w-[540px]",
                children: [
                  Q.jsxs(R6t, {
                    children: [
                      Q.jsx(M6t, { children: i("filter.sheet.title") }),
                      Q.jsx(A6t, { children: i("filter.sheet.description") }),
                    ],
                  }),
                  Q.jsxs("div", {
                    className: "mt-6 space-y-4",
                    children: [
                      Q.jsxs("div", {
                        className: "flex items-center justify-between",
                        children: [
                          Q.jsx("h4", {
                            className: "font-medium",
                            children: i("filter.sheet.conditions"),
                          }),
                          Q.jsx(Nm, {
                            variant: "outline",
                            size: "sm",
                            onClick: () => {
                              g([...h, { field: "", operator: "", value: "" }]);
                            },
                            children: i("filter.sheet.add"),
                          }),
                        ],
                      }),
                      Q.jsx(rqt, {
                        className: "h-[calc(100vh-280px)] ",
                        children: Q.jsx("div", {
                          className: "space-y-4",
                          children: h.map((e, t) =>
                            Q.jsxs(
                              "div",
                              {
                                className: "space-y-3 rounded-lg border p-4",
                                children: [
                                  Q.jsxs("div", {
                                    className: "flex items-center justify-between",
                                    children: [
                                      Q.jsx(Wy, {
                                        children: i("filter.sheet.condition", { number: t + 1 }),
                                      }),
                                      Q.jsx(Nm, {
                                        variant: "ghost",
                                        size: "sm",
                                        onClick: () =>
                                          ((e) => {
                                            g(h.filter((t, n) => n !== e));
                                          })(t),
                                        children: Q.jsx(E7e, { className: "h-4 w-4" }),
                                      }),
                                    ],
                                  }),
                                  Q.jsxs(THt, {
                                    value: e.field,
                                    onValueChange: (e) => C(t, "field", e),
                                    children: [
                                      Q.jsx(OHt, {
                                        children: Q.jsx(RHt, {
                                          placeholder: i("filter.sheet.field"),
                                        }),
                                      }),
                                      Q.jsx(PHt, {
                                        children: Q.jsx(IHt, {
                                          children: w.map((e) =>
                                            Q.jsx(
                                              FHt,
                                              {
                                                value: e.value,
                                                className: "cursor-pointer",
                                                children: e.label,
                                              },
                                              e.value,
                                            ),
                                          ),
                                        }),
                                      }),
                                    ],
                                  }),
                                  e.field &&
                                    Q.jsxs(THt, {
                                      value: e.operator,
                                      onValueChange: (e) => C(t, "operator", e),
                                      children: [
                                        Q.jsx(OHt, {
                                          children: Q.jsx(RHt, {
                                            placeholder: i("filter.sheet.operator"),
                                          }),
                                        }),
                                        Q.jsx(PHt, {
                                          children: w
                                            .find((t) => t.value === e.field)
                                            ?.operators.map((e) =>
                                              Q.jsx(
                                                FHt,
                                                { value: e.value, children: e.label },
                                                e.value,
                                              ),
                                            ),
                                        }),
                                      ],
                                    }),
                                  e.field && e.operator && S(e, t),
                                ],
                              },
                              t,
                            ),
                          ),
                        }),
                      }),
                      Q.jsxs("div", {
                        className: "flex justify-end space-x-2",
                        children: [
                          Q.jsx(Nm, {
                            variant: "outline",
                            onClick: () => {
                              (g([]), f(!1));
                            },
                            children: i("filter.sheet.reset"),
                          }),
                          Q.jsx(Nm, {
                            onClick: () => {
                              const t = h
                                .filter((e) => e.field && e.operator && "" !== e.value)
                                .map((e) => {
                                  const t = w.find((t) => t.value === e.field);
                                  let n = e.value;
                                  return "contains" === e.operator
                                    ? { id: e.field, value: n }
                                    : ("date" === t?.type &&
                                        n instanceof Date &&
                                        (n = Math.floor(n.getTime() / 1e3)),
                                      "boolean" === t?.type && (n = n ? 1 : 0),
                                      { id: e.field, value: `${e.operator}:${n}` });
                                });
                              (e.setColumnFilters(t), f(!1));
                            },
                            children: i("filter.sheet.apply"),
                          }),
                        ],
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          o &&
            Q.jsxs(Nm, {
              variant: "ghost",
              onClick: () => {
                (e.resetColumnFilters(), g([]));
              },
              className: "h-8 px-2 lg:px-3",
              children: [i("filter.sheet.reset"), Q.jsx(E7e, { className: "ml-2 h-4 w-4" })],
            }),
          Q.jsxs(Not, {
            modal: !1,
            children: [
              Q.jsx(Lot, { asChild: !0, onClick: (e) => (e.stopPropagation(), e.preventDefault()), children: Q.jsx(Nm, {
                  variant: "outline",
                  size: "sm",
                  className: "h-8 border-dashed",
                  children: i("actions.title"),
                }),
              }),
              Q.jsxs(Iot, {
                children: [
                  Q.jsxs(Rot, {
                    onClick: () => _(!0),
                    className: "selected" === c ? "focus:bg-muted" : void 0,
                    children: [
                      i("actions.send_email"),
                      Q.jsx("span", {
                        className:
                          "selected" === c
                            ? "ml-2 animate-pulse font-mono text-[10px] opacity-80"
                            : "ml-2 font-mono text-[10px] opacity-80",
                        children: u,
                      }),
                    ],
                  }),
                  Q.jsxs(Rot, {
                    onClick: async () => {
                      try {
                        const t =
                            "selected" === c
                              ? await dT({ scope: c, user_ids: l })
                              : "filtered" === c
                                ? await dT({
                                    scope: c,
                                    filter: e.getState().columnFilters,
                                    sort: e.getState().sorting[0]?.id,
                                    sort_type: e.getState().sorting[0]?.desc ? "DESC" : "ASC",
                                  })
                                : await dT({ scope: c }),
                          n = new Blob([t], { type: "text/csv;charset=utf-8;" }),
                          o = window.URL.createObjectURL(n),
                          s = document.createElement("a");
                        ((s.href = o),
                          s.setAttribute("download", `users_${new Date().toISOString()}.csv`),
                          document.body.appendChild(s),
                          s.click(),
                          s.remove(),
                          window.URL.revokeObjectURL(o),
                          r({
                            title: i("messages.success"),
                            description: i("messages.export.success"),
                          }));
                      } catch (D2t) {
                        r({
                          title: i("messages.error"),
                          description: i("messages.export.failed"),
                          variant: "destructive",
                        });
                      }
                    },
                    children: [
                      i("actions.export_csv"),
                      Q.jsx("span", {
                        className: "ml-2 font-mono text-[10px] opacity-80",
                        children: u,
                      }),
                    ],
                  }),
                  Q.jsx(Pot, {}),
                  Q.jsxs(Rot, {
                    onClick: () => b(!0),
                    className: "text-red-600 focus:text-red-600",
                    children: [
                      i("actions.batch_ban"),
                      Q.jsx("span", {
                        className:
                          "selected" === c
                            ? "ml-2 animate-pulse font-mono text-[10px] opacity-80"
                            : "ml-2 font-mono text-[10px] opacity-80",
                        children: u,
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
      Q.jsx(g6t, { open: m, onOpenChange: _, table: e }),
      Q.jsx(QYt, {
        open: v,
        onOpenChange: b,
        children: Q.jsxs(nXt, {
          children: [
            Q.jsxs(iXt, {
              children: [
                Q.jsx(oXt, { children: i("actions.confirm_ban.title") }),
                Q.jsx(sXt, {
                  children:
                    "selected" === c
                      ? i(
                          "actions.confirm_ban.selected_description",
                          `将对选中的 ${a} 个用户执行封禁`,
                        )
                      : i(
                          o
                            ? "actions.confirm_ban.filtered_description"
                            : "actions.confirm_ban.all_description",
                        ),
                }),
              ],
            }),
            Q.jsxs(rXt, {
              children: [
                Q.jsx(lXt, { disabled: y, children: i("actions.confirm_ban.cancel") }),
                Q.jsx(aXt, {
                  onClick: async () => {
                    try {
                      (x(!0),
                        await uT(
                          "selected" === c
                            ? { scope: c, user_ids: l }
                            : "filtered" === c
                              ? {
                                  scope: c,
                                  filter: e.getState().columnFilters,
                                  sort: e.getState().sorting[0]?.id,
                                  sort_type: e.getState().sorting[0]?.desc ? "DESC" : "ASC",
                                }
                              : { scope: c },
                        ),
                        r({
                          title: i("messages.success"),
                          description: i("messages.batch_ban.success"),
                        }),
                        t());
                    } catch (D2t) {
                      r({
                        title: i("messages.error"),
                        description: i("messages.batch_ban.failed"),
                        variant: "destructive",
                      });
                    } finally {
                      (x(!1), b(!1));
                    }
                  },
                  disabled: y,
                  className: "bg-red-600 hover:bg-red-700 focus:ring-red-600",
                  children: i(y ? "actions.confirm_ban.banning" : "actions.confirm_ban.confirm"),
                }),
              ],
            }),
          ],
        }),
      }),
    ],
  });
}
A6t.displayName = l7e.displayName;
const j6t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "m17.71 11.29l-5-5a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-5 5a1 1 0 0 0 1.42 1.42L11 9.41V17a1 1 0 0 0 2 0V9.41l3.29 3.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42",
      }),
    }),
  F6t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M17.71 11.29a1 1 0 0 0-1.42 0L13 14.59V7a1 1 0 0 0-2 0v7.59l-3.29-3.3a1 1 0 0 0-1.42 1.42l5 5a1 1 0 0 0 .33.21a.94.94 0 0 0 .76 0a1 1 0 0 0 .33-.21l5-5a1 1 0 0 0 0-1.42",
      }),
    }),
  B6t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M17 11H9.41l3.3-3.29a1 1 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33a1 1 0 0 0 0 .76a1 1 0 0 0 .21.33l5 5a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L9.41 13H17a1 1 0 0 0 0-2",
      }),
    }),
  V6t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M17.92 11.62a1 1 0 0 0-.21-.33l-5-5a1 1 0 0 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l5-5a1 1 0 0 0 .21-.33a1 1 0 0 0 0-.76",
      }),
    }),
  W6t = [
    {
      accessorKey: "record_at",
      header: "时间",
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex items-center space-x-2",
          children: Q.jsx("time", {
            className: "text-sm text-muted-foreground",
            children: SS(e.original.record_at),
          }),
        }),
    },
    {
      accessorKey: "u",
      header: "上行流量",
      cell: ({ row: e }) =>
        Q.jsxs("div", {
          className: "flex items-center space-x-2",
          children: [
            Q.jsx(j6t, { className: "h-4 w-4 text-emerald-500" }),
            Q.jsx("span", {
              className: "font-mono text-sm",
              children: IS(e.original.u / parseFloat(e.original.server_rate)),
            }),
          ],
        }),
    },
    {
      accessorKey: "d",
      header: "下行流量",
      cell: ({ row: e }) =>
        Q.jsxs("div", {
          className: "flex items-center space-x-2",
          children: [
            Q.jsx(F6t, { className: "h-4 w-4 text-blue-500" }),
            Q.jsx("span", {
              className: "font-mono text-sm",
              children: IS(e.original.d / parseFloat(e.original.server_rate)),
            }),
          ],
        }),
    },
    {
      accessorKey: "server_rate",
      header: "倍率",
      cell: ({ row: e }) => {
        const t = e.original.server_rate;
        return Q.jsx("div", {
          className: "flex items-center space-x-2",
          children: Q.jsxs(hqt, { variant: "outline", className: "font-mono", children: [t, "x"] }),
        });
      },
    },
    {
      id: "total",
      header: "总计",
      cell: ({ row: e }) => {
        const t = e.original.u + e.original.d;
        return Q.jsx("div", {
          className: "flex items-center justify-end font-mono text-sm",
          children: IS(t),
        });
      },
    },
  ];
function H6t({ user_id: e, dialogTrigger: t }) {
  const { t: n } = Py(["traffic"]),
    [i, r] = H.useState(!1),
    [o, s] = H.useState({ pageIndex: 0, pageSize: 20 }),
    { data: a, isLoading: l } = gC({
      queryKey: ["userStats", e, o, i],
      queryFn: () => (i ? aT({ user_id: e, pageSize: o.pageSize, page: o.pageIndex + 1 }) : null),
    }),
    c = PKt({
      data: a?.data ?? [],
      columns: W6t,
      pageCount: Math.ceil((a?.total ?? 0) / o.pageSize),
      state: { pagination: o },
      manualPagination: !0,
      getCoreRowModel: LKt(),
      onPaginationChange: s,
    });
  return Q.jsxs(Jet, {
    open: i,
    onOpenChange: r,
    children: [
      Q.jsx(ett, { asChild: !0, children: t }),
      Q.jsxs(ttt, {
        className: "sm:max-w-[700px]",
        children: [
          Q.jsx(ntt, { children: Q.jsx(rtt, { children: n("trafficRecord.title") }) }),
          Q.jsxs("div", {
            className: "space-y-4",
            children: [
              Q.jsx("div", {
                className: "rounded-md border",
                children: Q.jsxs(jKt, {
                  children: [
                    Q.jsx(FKt, {
                      children: c
                        .getHeaderGroups()
                        .map((e) =>
                          Q.jsx(
                            WKt,
                            {
                              children: e.headers.map((e) =>
                                Q.jsx(
                                  HKt,
                                  {
                                    className: Rf(
                                      "h-10 px-2 text-xs",
                                      "total" === e.id && "text-right",
                                    ),
                                    children: e.isPlaceholder
                                      ? null
                                      : AKt(e.column.columnDef.header, e.getContext()),
                                  },
                                  e.id,
                                ),
                              ),
                            },
                            e.id,
                          ),
                        ),
                    }),
                    Q.jsx(BKt, {
                      children: l
                        ? Array.from({ length: o.pageSize }).map((e, t) =>
                            Q.jsx(
                              WKt,
                              {
                                children: Array.from({ length: W6t.length }).map((e, t) =>
                                  Q.jsx(
                                    zKt,
                                    {
                                      className: "p-2",
                                      children: Q.jsx(n$t, { className: "h-6 w-full" }),
                                    },
                                    t,
                                  ),
                                ),
                              },
                              t,
                            ),
                          )
                        : c.getRowModel().rows?.length
                          ? c
                              .getRowModel()
                              .rows.map((e) =>
                                Q.jsx(
                                  WKt,
                                  {
                                    "data-state": e.getIsSelected() && "selected",
                                    className: "h-10",
                                    children: e
                                      .getVisibleCells()
                                      .map((e) =>
                                        Q.jsx(
                                          zKt,
                                          {
                                            className: "px-2",
                                            children: AKt(e.column.columnDef.cell, e.getContext()),
                                          },
                                          e.id,
                                        ),
                                      ),
                                  },
                                  e.id,
                                ),
                              )
                          : Q.jsx(WKt, {
                              children: Q.jsx(zKt, {
                                colSpan: W6t.length,
                                className: "h-24 text-center",
                                children: n("trafficRecord.noRecords"),
                              }),
                            }),
                    }),
                  ],
                }),
              }),
              Q.jsxs("div", {
                className: "flex items-center justify-between",
                children: [
                  Q.jsxs("div", {
                    className: "flex items-center space-x-2",
                    children: [
                      Q.jsx("p", {
                        className: "text-sm font-medium",
                        children: n("trafficRecord.perPage"),
                      }),
                      Q.jsxs(THt, {
                        value: `${c.getState().pagination.pageSize}`,
                        onValueChange: (e) => {
                          c.setPageSize(Number(e));
                        },
                        children: [
                          Q.jsx(OHt, {
                            className: "h-8 w-[70px]",
                            children: Q.jsx(RHt, { placeholder: c.getState().pagination.pageSize }),
                          }),
                          Q.jsx(PHt, {
                            side: "top",
                            children: [10, 20, 30, 40, 50].map((e) =>
                              Q.jsx(FHt, { value: `${e}`, children: e }, e),
                            ),
                          }),
                        ],
                      }),
                      Q.jsx("p", {
                        className: "text-sm font-medium",
                        children: n("trafficRecord.records"),
                      }),
                    ],
                  }),
                  Q.jsxs("div", {
                    className: "flex items-center space-x-2",
                    children: [
                      Q.jsx("div", {
                        className: "flex w-[100px] items-center justify-center text-sm",
                        children: n("trafficRecord.page", {
                          current: c.getState().pagination.pageIndex + 1,
                          total: c.getPageCount(),
                        }),
                      }),
                      Q.jsxs("div", {
                        className: "flex items-center space-x-2",
                        children: [
                          Q.jsx(ltt, {
                            variant: "outline",
                            size: "icon",
                            className: "h-8 w-8",
                            onClick: () => c.previousPage(),
                            disabled: !c.getCanPreviousPage() || l,
                            children: Q.jsx(B6t, { className: "h-4 w-4" }),
                          }),
                          Q.jsx(ltt, {
                            variant: "outline",
                            size: "icon",
                            className: "h-8 w-8",
                            onClick: () => c.nextPage(),
                            disabled: !c.getCanNextPage() || l,
                            children: Q.jsx(V6t, { className: "h-4 w-4" }),
                          }),
                        ],
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
function z6t({ user: e, trigger: t, onSuccess: n }) {
  const { t: i } = Py("user"),
    [r, o] = H.useState(!1),
    [s, a] = H.useState(""),
    [l, c] = H.useState(!1),
    { data: d, isLoading: u } = gC({
      queryKey: ["trafficResetHistory", e.id],
      queryFn: () => pT(e.id, { limit: 10 }),
      enabled: r,
    });
  return Q.jsxs(Jet, {
    open: r,
    onOpenChange: o,
    children: [
      Q.jsx(ett, { asChild: !0, children: t }),
      Q.jsx(xYt, {
        title: i("traffic_reset.title"),
        onCancel: () => o(!1),
        onSubmit: async () => {
          try {
            c(!0);
            const { data: t } = await gT({ user_id: e.id, reason: s.trim() || void 0 });
            t && (hN.success(i("traffic_reset.reset_success")), o(!1), a(""), n?.());
          } finally {
            c(!1);
          }
        },
        submitLabel: i("traffic_reset.confirm_reset"),
        submitIcon: Q.jsx(Uat, { className: "h-4 w-4" }),
        isSubmitting: l,
        isDestructive: !0,
        className: "max-w-4xl",
        children: Q.jsxs(iw, {
          defaultValue: "reset",
          className: "w-full",
          children: [
            Q.jsxs(rw, {
              className: "grid w-full grid-cols-2",
              children: [
                Q.jsxs(ow, {
                  value: "reset",
                  className: "flex items-center gap-2",
                  children: [Q.jsx(Uat, { className: "h-4 w-4" }), i("traffic_reset.tabs.reset")],
                }),
                Q.jsxs(ow, {
                  value: "history",
                  className: "flex items-center gap-2",
                  children: [Q.jsx(Oat, { className: "h-4 w-4" }), i("traffic_reset.tabs.history")],
                }),
              ],
            }),
            Q.jsxs(sw, {
              value: "reset",
              className: "space-y-4 pt-4",
              children: [
                Q.jsxs("div", {
                  className: "grid grid-cols-1 gap-4 md:grid-cols-2",
                  children: [
                    Q.jsxs(q6e, {
                      className: "shadow-none",
                      children: [
                        Q.jsx(K6e, {
                          className: "pb-3",
                          children: Q.jsxs(G6e, {
                            className:
                              "flex items-center gap-2 text-sm font-bold uppercase tracking-tight",
                            children: [
                              Q.jsx(clt, { className: "h-4 w-4" }),
                              i("traffic_reset.user_info"),
                            ],
                          }),
                        }),
                        Q.jsx(Y6e, {
                          className: "space-y-3",
                          children: Q.jsxs("div", {
                            className: "grid grid-cols-1 gap-4 font-mono text-xs",
                            children: [
                              Q.jsxs("div", {
                                className: "flex justify-between border-b pb-1",
                                children: [
                                  Q.jsx("span", {
                                    className: "uppercase text-muted-foreground",
                                    children: i("columns.email"),
                                  }),
                                  Q.jsx("span", { className: "font-medium", children: e.email }),
                                ],
                              }),
                              Q.jsxs("div", {
                                className: "flex justify-between border-b pb-1",
                                children: [
                                  Q.jsx("span", {
                                    className: "uppercase text-muted-foreground",
                                    children: i("columns.used_traffic"),
                                  }),
                                  Q.jsx("span", {
                                    className: "font-medium text-destructive",
                                    children: IS(e.total_used),
                                  }),
                                ],
                              }),
                              Q.jsxs("div", {
                                className: "flex justify-between border-b pb-1",
                                children: [
                                  Q.jsx("span", {
                                    className: "uppercase text-muted-foreground",
                                    children: i("columns.total_traffic"),
                                  }),
                                  Q.jsx("span", {
                                    className: "font-medium",
                                    children: IS(e.transfer_enable),
                                  }),
                                ],
                              }),
                              Q.jsxs("div", {
                                className: "flex justify-between border-b pb-1",
                                children: [
                                  Q.jsx("span", {
                                    className: "uppercase text-muted-foreground",
                                    children: i("columns.expire_time"),
                                  }),
                                  Q.jsx("span", {
                                    className: "font-medium",
                                    children: e.expired_at
                                      ? CS(e.expired_at)
                                      : i("columns.expire_status.permanent"),
                                  }),
                                ],
                              }),
                            ],
                          }),
                        }),
                      ],
                    }),
                    Q.jsxs(q6e, {
                      className: "border-amber-200 bg-amber-50 shadow-none",
                      children: [
                        Q.jsx(K6e, {
                          className: "pb-3",
                          children: Q.jsxs(G6e, {
                            className:
                              "flex items-center gap-2 text-sm font-bold uppercase tracking-tight text-amber-800",
                            children: [
                              Q.jsx(slt, { className: "h-4 w-4" }),
                              i("traffic_reset.warning.title"),
                            ],
                          }),
                        }),
                        Q.jsx(Y6e, {
                          children: Q.jsxs("ul", {
                            className: "space-y-2 font-mono text-xs text-amber-700",
                            children: [
                              Q.jsxs("li", {
                                children: ["• ", i("traffic_reset.warning.irreversible")],
                              }),
                              Q.jsxs("li", {
                                children: ["• ", i("traffic_reset.warning.reset_to_zero")],
                              }),
                              Q.jsxs("li", { children: ["• ", i("traffic_reset.warning.logged")] }),
                            ],
                          }),
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "space-y-2",
                  children: [
                    Q.jsx(Wy, {
                      htmlFor: "reason",
                      className: "text-xs font-bold uppercase tracking-tight",
                      children: i("traffic_reset.reason.label"),
                    }),
                    Q.jsx(_Gt, {
                      id: "reason",
                      placeholder: i("traffic_reset.reason.placeholder"),
                      value: s,
                      onChange: (e) => a(e.target.value),
                      className: "min-h-[80px] font-mono text-xs",
                    }),
                    Q.jsx("p", {
                      className: "text-[10px] uppercase text-muted-foreground",
                      children: i("traffic_reset.reason.optional"),
                    }),
                  ],
                }),
              ],
            }),
            Q.jsx(sw, {
              value: "history",
              className: "space-y-4 pt-4",
              children: u
                ? Q.jsx("div", {
                    className: "flex items-center justify-center py-8",
                    children: Q.jsx(cm, { className: "h-6 w-6 animate-spin" }),
                  })
                : Q.jsxs("div", {
                    className: "grid grid-cols-1 gap-4 md:grid-cols-3",
                    children: [
                      d?.data?.user &&
                        Q.jsxs(q6e, {
                          className: "shadow-none md:col-span-1",
                          children: [
                            Q.jsx(K6e, {
                              className: "pb-3",
                              children: Q.jsx(G6e, {
                                className: "text-sm font-bold uppercase tracking-tight",
                                children: i("traffic_reset.history.summary"),
                              }),
                            }),
                            Q.jsx(Y6e, {
                              children: Q.jsxs("div", {
                                className: "space-y-4 font-mono text-xs",
                                children: [
                                  Q.jsxs("div", {
                                    className: "flex flex-col gap-1 border-b pb-1",
                                    children: [
                                      Q.jsx("span", {
                                        className: "uppercase text-muted-foreground",
                                        children: i("traffic_reset.history.reset_count"),
                                      }),
                                      Q.jsx("p", {
                                        className: "text-base font-medium",
                                        children: d.data.user.reset_count,
                                      }),
                                    ],
                                  }),
                                  Q.jsxs("div", {
                                    className: "flex flex-col gap-1 border-b pb-1",
                                    children: [
                                      Q.jsx("span", {
                                        className: "uppercase text-muted-foreground",
                                        children: i("traffic_reset.history.last_reset"),
                                      }),
                                      Q.jsx("p", {
                                        className: "font-medium",
                                        children: d.data.user.last_reset_at
                                          ? CS(d.data.user.last_reset_at)
                                          : i("traffic_reset.history.never"),
                                      }),
                                    ],
                                  }),
                                  Q.jsxs("div", {
                                    className: "flex flex-col gap-1",
                                    children: [
                                      Q.jsx("span", {
                                        className: "uppercase text-muted-foreground",
                                        children: i("traffic_reset.history.next_reset"),
                                      }),
                                      Q.jsx("p", {
                                        className: "font-medium",
                                        children: d.data.user.next_reset_at
                                          ? CS(d.data.user.next_reset_at)
                                          : i("traffic_reset.history.no_schedule"),
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                            }),
                          ],
                        }),
                      Q.jsxs(q6e, {
                        className: "shadow-none md:col-span-2",
                        children: [
                          Q.jsxs(K6e, {
                            className: "pb-3",
                            children: [
                              Q.jsx(G6e, {
                                className: "text-sm font-bold uppercase tracking-tight",
                                children: i("traffic_reset.history.records"),
                              }),
                              Q.jsx(Z6e, {
                                className: "text-[10px] uppercase",
                                children: i("traffic_reset.history.recent_records"),
                              }),
                            ],
                          }),
                          Q.jsx(Y6e, {
                            children: Q.jsx(rqt, {
                              className: "h-[300px] pr-4",
                              children: d?.data?.history?.length
                                ? Q.jsx("div", {
                                    className: "space-y-3",
                                    children: d.data.history.map((e, t) =>
                                      Q.jsx(
                                        "div",
                                        {
                                          children: Q.jsx("div", {
                                            className:
                                              "flex items-start justify-between rounded border bg-muted/30 p-3",
                                            children: Q.jsxs("div", {
                                              className: "flex-1 space-y-2",
                                              children: [
                                                Q.jsxs("div", {
                                                  className: "flex items-center gap-2",
                                                  children: [
                                                    Q.jsx(hqt, {
                                                      variant: "outline",
                                                      className:
                                                        "rounded-none py-0 font-mono text-[10px] uppercase",
                                                      children: e.reset_type_name,
                                                    }),
                                                    Q.jsx(hqt, {
                                                      variant: "secondary",
                                                      className:
                                                        "rounded-none py-0 font-mono text-[10px] uppercase",
                                                      children: e.trigger_source_name,
                                                    }),
                                                  ],
                                                }),
                                                Q.jsxs("div", {
                                                  className:
                                                    "grid grid-cols-2 gap-4 font-mono text-[10px]",
                                                  children: [
                                                    Q.jsxs("div", {
                                                      children: [
                                                        Q.jsxs(Wy, {
                                                          className:
                                                            "mb-1 flex items-center gap-1 uppercase text-muted-foreground",
                                                          children: [
                                                            Q.jsx(vat, { className: "h-3 w-3" }),
                                                            i("traffic_reset.history.reset_time"),
                                                          ],
                                                        }),
                                                        Q.jsx("p", {
                                                          className: "font-medium",
                                                          children: CS(e.reset_time),
                                                        }),
                                                      ],
                                                    }),
                                                    Q.jsxs("div", {
                                                      children: [
                                                        Q.jsx(Wy, {
                                                          className:
                                                            "mb-1 block uppercase text-muted-foreground",
                                                          children: i(
                                                            "traffic_reset.history.traffic_cleared",
                                                          ),
                                                        }),
                                                        Q.jsx("p", {
                                                          className: "font-medium text-destructive",
                                                          children: e.old_traffic.formatted,
                                                        }),
                                                      ],
                                                    }),
                                                  ],
                                                }),
                                              ],
                                            }),
                                          }),
                                        },
                                        e.id,
                                      ),
                                    ),
                                  })
                                : Q.jsxs("div", {
                                    className:
                                      "py-8 text-center font-mono text-xs text-muted-foreground",
                                    children: [
                                      Q.jsx(Oat, { className: "mx-auto mb-4 h-8 w-8 opacity-20" }),
                                      Q.jsx("p", {
                                        className: "uppercase",
                                        children: i("traffic_reset.history.no_records"),
                                      }),
                                    ],
                                  }),
                            }),
                          }),
                        ],
                      }),
                    ],
                  }),
            }),
          ],
        }),
      }),
    ],
  });
}
function U6t({
  onConfirm: e,
  children: t,
  title: n = "确认操作",
  description: i = "确定要执行此操作吗？",
  cancelText: r = "取消",
  confirmText: o = "确认",
  variant: s = "default",
  className: a,
}) {
  return Q.jsxs(uXt, {
    children: [
      Q.jsx(hXt, { asChild: !0, children: t }),
      Q.jsxs(gXt, {
        className: Rf("sm:max-w-[425px]", a),
        children: [
          Q.jsxs(pXt, { children: [Q.jsx(mXt, { children: n }), Q.jsx(_Xt, { children: i })] }),
          Q.jsxs(fXt, {
            children: [
              Q.jsx(bXt, { asChild: !0, children: Q.jsx(Nm, { variant: "outline", children: r }) }),
              Q.jsx(vXt, {
                asChild: !0,
                children: Q.jsx(Nm, { variant: s, onClick: e, children: o }),
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
function $6t({ label: e, value: t, className: n, valueClassName: i }) {
  return Q.jsxs("div", {
    className: Rf("flex items-center py-1.5", n),
    children: [
      Q.jsx("div", { className: "w-28 shrink-0 text-sm text-muted-foreground", children: e }),
      Q.jsx("div", { className: Rf("text-sm", i), children: t || "-" }),
    ],
  });
}
function q6t({ banned: e, isAdmin: t, isStaff: n }) {
  const { t: i } = Py("user");
  return e
    ? Q.jsx(hqt, { variant: "destructive", className: "font-medium", children: i("status.banned") })
    : t
      ? Q.jsx(hqt, {
          className: "bg-red-100 font-medium text-red-800 hover:bg-red-100",
          children: i("status.admin"),
        })
      : n
        ? Q.jsx(hqt, {
            className: "bg-blue-100 font-medium text-blue-800 hover:bg-blue-100",
            children: i("status.staff"),
          })
        : Q.jsx(hqt, {
            className: "bg-green-100 font-medium text-green-800 hover:bg-green-100",
            children: i("status.normal"),
          });
}
function K6t({ user: e, trigger: t }) {
  const { t: n } = Py("user"),
    [i, r] = z.useState(e);
  return (
    z.useEffect(() => {
      r(e);
    }, [e]),
    Q.jsxs(Jet, {
      children: [
        Q.jsx(ett, { asChild: !0, children: t }),
        Q.jsxs(ttt, {
          className: "max-w-xl",
          children: [
            Q.jsxs(ntt, {
              className: "space-y-2",
              children: [
                Q.jsx(rtt, { className: "text-lg font-medium", children: n("dialog.title") }),
                Q.jsx("div", {
                  className: "flex items-center justify-between text-sm",
                  children: Q.jsxs("div", {
                    className: "flex items-center space-x-6",
                    children: [
                      Q.jsxs("div", {
                        className: "text-muted-foreground",
                        children: [n("dialog.fields.userId"), "：", i.id],
                      }),
                      Q.jsx(q6t, { banned: i.banned, isAdmin: i.is_admin, isStaff: i.is_staff }),
                    ],
                  }),
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "space-y-4",
              children: [
                Q.jsxs("div", {
                  className: "rounded-lg border p-4",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 text-sm font-medium",
                      children: n("dialog.basicInfo"),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx($6t, {
                          label: n("dialog.fields.email"),
                          value: i.email,
                          valueClassName: "font-medium",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.uuid"),
                          value: i.uuid,
                          valueClassName: "font-mono text-xs",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.token"),
                          value: i.token,
                          valueClassName: "font-mono text-xs",
                        }),
                        Q.jsx($6t, { label: n("dialog.fields.remarks"), value: i.remarks }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.telegramId"),
                          value: i.telegram_id
                            ? Q.jsx("span", {
                                className: "font-mono text-xs",
                                children: i.telegram_id,
                              })
                            : "-",
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "rounded-lg border p-4",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 text-sm font-medium",
                      children: n("dialog.subscriptionInfo"),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx($6t, {
                          label: n("dialog.fields.subscriptionPlan"),
                          value: i.plan?.name,
                          valueClassName: "font-medium",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.permissionGroup"),
                          value: i.group?.name,
                          valueClassName: "font-medium",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.expiredAt"),
                          value: Q.jsx(Pst, {
                            delayDuration: 100,
                            children: Q.jsxs(jst, {
                              children: [
                                Q.jsx(Fst, {
                                  children: Q.jsx("span", {
                                    className: "font-mono text-xs",
                                    children:
                                      null == i.expired_at
                                        ? n("columns.expire_status.permanent")
                                        : CS(i.expired_at, "yyyy-MM-dd"),
                                  }),
                                }),
                                Q.jsx(Bst, {
                                  side: "bottom",
                                  className: "space-y-1 p-3",
                                  children:
                                    null != i.expired_at
                                      ? Q.jsxs(Q.Fragment, {
                                          children: [
                                            Q.jsxs("p", {
                                              className: "text-sm text-muted-foreground",
                                              children: [
                                                n("columns.expire_time"),
                                                ":",
                                                " ",
                                                CS(i.expired_at),
                                              ],
                                            }),
                                            Q.jsx("p", {
                                              className: Rf(
                                                "text-sm font-medium",
                                                i.expired_at < Date.now() / 1e3
                                                  ? "text-destructive"
                                                  : "text-success",
                                              ),
                                              children:
                                                i.expired_at < Date.now() / 1e3
                                                  ? n("columns.expire_status.expired", {
                                                      days: Math.abs(
                                                        Math.ceil(
                                                          (1e3 * i.expired_at - Date.now()) / 864e5,
                                                        ),
                                                      ),
                                                    })
                                                  : n("columns.expire_status.remaining", {
                                                      days: Math.ceil(
                                                        (1e3 * i.expired_at - Date.now()) / 864e5,
                                                      ),
                                                    }),
                                            }),
                                            i.next_reset_at &&
                                              Q.jsxs("p", {
                                                className: "text-sm",
                                                children: [
                                                  n("columns.next_reset_at"),
                                                  ":",
                                                  " ",
                                                  CS(i.next_reset_at),
                                                ],
                                              }),
                                          ],
                                        })
                                      : Q.jsx("p", {
                                          className: "text-sm font-medium",
                                          children: n("columns.expire_status.permanent"),
                                        }),
                                }),
                              ],
                            }),
                          }),
                          valueClassName: "",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.deviceLimit"),
                          value: i.device_limit || "-",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.speedLimit"),
                          value: i.speed_limit ? `${i.speed_limit} Mbps` : "-",
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "rounded-lg border p-4",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 text-sm font-medium",
                      children: n("dialog.trafficInfo"),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx($6t, {
                          label: n("dialog.fields.transferEnable"),
                          value: i.transfer_enable ? IS(i.transfer_enable) : "-",
                          valueClassName: "font-medium",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.uploadUsed"),
                          value: i.u ? IS(i.u) : "-",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.downloadUsed"),
                          value: i.d ? IS(i.d) : "-",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.totalUsed"),
                          value: i.total_used ? IS(i.total_used) : "-",
                          valueClassName: "text-primary",
                        }),
                        Q.jsx(Um, { className: "my-2" }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.lastResetAt"),
                          value: i.last_reset_at ? CS(i.last_reset_at) : "-",
                          valueClassName: "font-mono text-xs",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.nextResetAt"),
                          value: i.next_reset_at ? CS(i.next_reset_at) : "-",
                          valueClassName: "font-mono text-xs",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.resetCount"),
                          value: i.reset_count || "0",
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "rounded-lg border p-4",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 text-sm font-medium",
                      children: n("dialog.financialInfo"),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx($6t, {
                          label: n("dialog.fields.balance"),
                          value: i.balance ? `¥${(i.balance / 100).toFixed(2)}` : "¥0.00",
                          valueClassName: "font-medium text-primary",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.commissionBalance"),
                          value: i.commission_balance
                            ? `¥${(i.commission_balance / 100).toFixed(2)}`
                            : "¥0.00",
                          valueClassName: "font-medium text-orange-600",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.commissionType"),
                          value: i.commission_type || "0",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.commissionRate"),
                          value: i.commission_rate
                            ? `${(100 * i.commission_rate).toFixed(2)}%`
                            : "-",
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "rounded-lg border p-4",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 text-sm font-medium",
                      children: n("dialog.activityInfo"),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx($6t, {
                          label: n("dialog.fields.lastLoginAt"),
                          value: i.last_login_at ? CS(i.last_login_at) : "-",
                          valueClassName: "font-mono text-xs",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.lastLoginIp"),
                          value: i.last_login_ip || "-",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.lastOnlineAt"),
                          value: i.last_online_at ? CS(i.last_online_at) : "-",
                          valueClassName: "font-mono text-xs",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.onlineCount"),
                          value: i.online_count || "0",
                        }),
                      ],
                    }),
                  ],
                }),
                i.invite_user &&
                  Q.jsxs("div", {
                    className: "rounded-lg border p-4",
                    children: [
                      Q.jsx("div", {
                        className: "mb-2 text-sm font-medium",
                        children: n("dialog.inviteInfo"),
                      }),
                      Q.jsxs("div", {
                        className: "space-y-0.5",
                        children: [
                          Q.jsx($6t, {
                            label: n("dialog.fields.inviteUser"),
                            value: Q.jsxs(jg, {
                              to: `/user/manage?email=${i.invite_user.email}`,
                              className:
                                "group inline-flex items-center gap-1 text-primary hover:underline",
                              children: [
                                i.invite_user.email,
                                Q.jsx(Sat, {
                                  className:
                                    "h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100",
                                }),
                              ],
                            }),
                          }),
                          Q.jsx($6t, {
                            label: n("dialog.fields.inviteUserId"),
                            value: i.invite_user.id,
                            valueClassName: "font-mono text-xs",
                          }),
                        ],
                      }),
                    ],
                  }),
                Q.jsxs("div", {
                  className: "rounded-lg border p-4",
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 text-sm font-medium",
                      children: n("dialog.timeInfo"),
                    }),
                    Q.jsxs("div", {
                      className: "space-y-0.5",
                      children: [
                        Q.jsx($6t, {
                          label: n("dialog.fields.createdAt"),
                          value: CS(i.created_at),
                          valueClassName: "font-mono text-xs",
                        }),
                        Q.jsx($6t, {
                          label: n("dialog.fields.updatedAt"),
                          value: CS(i.updated_at),
                          valueClassName: "font-mono text-xs",
                        }),
                      ],
                    }),
                  ],
                }),
                i.subscribe_url &&
                  Q.jsxs("div", {
                    className: "rounded-lg border p-4",
                    children: [
                      Q.jsx("div", {
                        className: "mb-2 text-sm font-medium",
                        children: n("dialog.subscriptionUrl"),
                      }),
                      Q.jsx("div", {
                        className: "space-y-0.5",
                        children: Q.jsx($6t, {
                          label: n("dialog.fields.subscribeUrl"),
                          value: Q.jsxs("a", {
                            href: i.subscribe_url,
                            target: "_blank",
                            rel: "noopener noreferrer",
                            className:
                              "group inline-flex items-center gap-1 break-all text-primary hover:underline",
                            children: [
                              i.subscribe_url,
                              Q.jsx(Sat, {
                                className:
                                  "h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100",
                              }),
                            ],
                          }),
                          valueClassName: "text-xs",
                        }),
                      }),
                    ],
                  }),
              ],
            }),
          ],
        }),
      ],
    })
  );
}
function G6t({ user: e, t: t }) {
  const [n, i] = z.useState(!1),
    r = e.t || 0,
    o = Date.now() / 1e3 - r < 120,
    s = Math.floor(Date.now() / 1e3 - r);
  let a = o
    ? t("columns.online_status.online")
    : 0 === r
      ? t("columns.online_status.never")
      : t("columns.online_status.last_online", { time: CS(r) });
  if (!o && 0 !== r) {
    const e = Math.floor(s / 60),
      n = Math.floor(e / 60),
      i = Math.floor(n / 24);
    a +=
      i > 0
        ? "\n" + t("columns.online_status.offline_duration.days", { count: i })
        : n > 0
          ? "\n" + t("columns.online_status.offline_duration.hours", { count: n })
          : e > 0
            ? "\n" + t("columns.online_status.offline_duration.minutes", { count: e })
            : "\n" + t("columns.online_status.offline_duration.seconds", { count: s });
  }
  return Q.jsx(Pst, {
    delayDuration: 100,
    children: Q.jsxs(jst, {
      children: [
        Q.jsx(Fst, {
          asChild: !0,
          children: Q.jsxs("div", {
            className: "group flex items-center gap-2.5",
            onMouseEnter: () => i(!0),
            onMouseLeave: () => i(!1),
            children: [
              Q.jsx("div", {
                className: Rf(
                  "size-2.5 rounded-full ring-2 ring-offset-2",
                  o ? "bg-green-500 ring-green-500/20" : "bg-gray-300 ring-gray-300/20",
                  "transition-all duration-300",
                ),
              }),
              Q.jsx(K6t, {
                user: e,
                trigger: Q.jsx("span", {
                  className:
                    "cursor-pointer font-medium text-foreground/90 transition-colors hover:text-primary hover:underline",
                  children: e.email,
                }),
              }),
              Q.jsx("button", {
                type: "button",
                className: Rf(
                  "ml-1 rounded bg-transparent p-1 transition-opacity hover:bg-muted",
                  n ? "opacity-100" : "pointer-events-none opacity-0",
                  "group-hover:pointer-events-auto group-hover:opacity-100",
                ),
                tabIndex: -1,
                "aria-label": t("columns.actions_menu.copy_email", { defaultValue: "Copy Email" }),
                onClick: (n) => {
                  (n.stopPropagation(), TS(e.email), hN.success(t("common:copy.success")));
                },
                style: { lineHeight: 0 },
                children: Q.jsx(yat, { className: "h-4 w-4 text-muted-foreground" }),
              }),
            ],
          }),
        }),
        Q.jsx(Bst, {
          side: "bottom",
          className: "max-w-[280px]",
          children: Q.jsx("p", { className: "whitespace-pre-line text-sm", children: a }),
        }),
      ],
    }),
  });
}
const Z6t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M5 18h4.24a1 1 0 0 0 .71-.29l6.92-6.93L19.71 8a1 1 0 0 0 0-1.42l-4.24-4.29a1 1 0 0 0-1.42 0l-2.82 2.83l-6.94 6.93a1 1 0 0 0-.29.71V17a1 1 0 0 0 1 1m9.76-13.59l2.83 2.83l-1.42 1.42l-2.83-2.83ZM6 13.17l5.93-5.93l2.83 2.83L8.83 16H6ZM21 20H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2",
      }),
    }),
  Y6t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M19 11h-6V5a1 1 0 0 0-2 0v6H5a1 1 0 0 0 0 2h6v6a1 1 0 0 0 2 0v-6h6a1 1 0 0 0 0-2",
      }),
    }),
  X6t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M21 8.94a1.3 1.3 0 0 0-.06-.27v-.09a1 1 0 0 0-.19-.28l-6-6a1 1 0 0 0-.28-.19a.3.3 0 0 0-.09 0a.9.9 0 0 0-.33-.11H10a3 3 0 0 0-3 3v1H6a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3zm-6-3.53L17.59 8H16a1 1 0 0 1-1-1ZM15 19a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h1v7a3 3 0 0 0 3 3h5Zm4-4a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3v3a3 3 0 0 0 3 3h3Z",
      }),
    }),
  Q6t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M21 11a1 1 0 0 0-1 1a8.05 8.05 0 1 1-2.22-5.5h-2.4a1 1 0 0 0 0 2h4.53a1 1 0 0 0 1-1V3a1 1 0 0 0-2 0v1.77A10 10 0 1 0 22 12a1 1 0 0 0-1-1",
      }),
    }),
  J6t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M9.5 10.5H12a1 1 0 0 0 0-2h-1V8a1 1 0 0 0-2 0v.55a2.5 2.5 0 0 0 .5 4.95h1a.5.5 0 0 1 0 1H8a1 1 0 0 0 0 2h1v.5a1 1 0 0 0 2 0v-.55a2.5 2.5 0 0 0-.5-4.95h-1a.5.5 0 0 1 0-1M21 12h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Z",
      }),
    }),
  e8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M12.3 12.22A4.92 4.92 0 0 0 14 8.5a5 5 0 0 0-10 0a4.92 4.92 0 0 0 1.7 3.72A8 8 0 0 0 1 19.5a1 1 0 0 0 2 0a6 6 0 0 1 12 0a1 1 0 0 0 2 0a8 8 0 0 0-4.7-7.28M9 11.5a3 3 0 1 1 3-3a3 3 0 0 1-3 3m9.74.32A5 5 0 0 0 15 3.5a1 1 0 0 0 0 2a3 3 0 0 1 3 3a3 3 0 0 1-1.5 2.59a1 1 0 0 0-.5.84a1 1 0 0 0 .45.86l.39.26l.13.07a7 7 0 0 1 4 6.38a1 1 0 0 0 2 0a9 9 0 0 0-4.23-7.68",
      }),
    }),
  t8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M12 2a10 10 0 0 0-6.88 2.77V3a1 1 0 0 0-2 0v4.5a1 1 0 0 0 1 1h4.5a1 1 0 0 0 0-2h-2.4A8 8 0 1 1 4 12a1 1 0 0 0-2 0A10 10 0 1 0 12 2m0 6a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h2a1 1 0 0 0 0-2h-1V9a1 1 0 0 0-1-1",
      }),
    }),
  n8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M20 6h-4V5a3 3 0 0 0-3-3h-2a3 3 0 0 0-3 3v1H4a1 1 0 0 0 0 2h1v11a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V8h1a1 1 0 0 0 0-2M10 5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1h-4Zm7 14a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8h10Z",
      }),
    }),
  i8t = (e, t, n, i, r) => [
    {
      id: "select",
      size: 40,
      enableSorting: !1,
      enableHiding: !1,
      header: ({ table: e }) => {
        const t = e.getRowModel().rows,
          n = t.length > 0 && t.every((e) => e.getIsSelected());
        return Q.jsx(L5t, {
          "aria-label": r("columns.select_all", "选择全部"),
          checked: n,
          onCheckedChange: (e) => t.forEach((t) => t.toggleSelected(!!e)),
          disabled: !t.length,
        });
      },
      cell: ({ row: e }) =>
        Q.jsx(L5t, {
          "aria-label": r("columns.select_row", "选择用户"),
          checked: e.getIsSelected(),
          onCheckedChange: (t) => e.toggleSelected(!!t),
        }),
    },
    {
      accessorKey: "is_admin",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.is_admin") }),
      enableSorting: !1,
      enableHiding: !0,
      filterFn: (e, t, n) => n.includes(e.getValue(t)),
      size: 0,
    },
    {
      accessorKey: "is_staff",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.is_staff") }),
      enableSorting: !1,
      enableHiding: !0,
      filterFn: (e, t, n) => n.includes(e.getValue(t)),
      size: 0,
    },
    {
      accessorKey: "id",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.id") }),
      cell: ({ row: e }) => Q.jsx(hqt, { variant: "outline", children: e.original.id }),
      enableSorting: !0,
      enableHiding: !1,
    },
    {
      accessorKey: "email",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.email") }),
      cell: ({ row: e }) => Q.jsx(G6t, { user: e.original, t: r }),
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "online_count",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.online_count") }),
      cell: ({ row: e }) => {
        const t = e.original.device_limit,
          n = e.original.online_count || 0;
        return Q.jsx(Pst, {
          delayDuration: 100,
          children: Q.jsxs(jst, {
            children: [
              Q.jsx(Fst, {
                children: Q.jsx("div", {
                  className: "flex items-center gap-1.5",
                  children: Q.jsxs(hqt, {
                    variant: "outline",
                    className: Rf(
                      "min-w-[4rem] justify-center",
                      null !== t && n >= t
                        ? "border-destructive/50 bg-destructive/10 text-destructive"
                        : "border-primary/40 bg-primary/5 text-primary/90",
                    ),
                    children: [n, " / ", null === t ? "∞" : t],
                  }),
                }),
              }),
              Q.jsx(Bst, {
                side: "bottom",
                children: Q.jsx("p", {
                  className: "text-sm",
                  children:
                    null === t
                      ? r("columns.device_limit.unlimited")
                      : r("columns.device_limit.limited", { count: t }),
                }),
              }),
            ],
          }),
        });
      },
      enableSorting: !0,
      enableHiding: !1,
    },
    {
      accessorKey: "banned",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.status") }),
      cell: ({ row: e }) => {
        const t = e.original.banned;
        return Q.jsx("div", {
          className: "flex justify-center",
          children: Q.jsx(hqt, {
            className: Rf(
              "min-w-20 justify-center transition-colors",
              t
                ? "bg-destructive/15 text-destructive hover:bg-destructive/25"
                : "bg-success/15 text-success hover:bg-success/25",
            ),
            children: r(t ? "columns.status_text.banned" : "columns.status_text.normal"),
          }),
        });
      },
      enableSorting: !0,
      filterFn: (e, t, n) => n.includes(e.getValue(t)),
    },
    {
      accessorKey: "plan_id",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.subscription") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "min-w-[10em] break-all",
          children: e.original?.plan?.name || "-",
        }),
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "group_id",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.group") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "flex flex-wrap gap-1",
          children: Q.jsx(hqt, {
            variant: "outline",
            className: Rf(
              "px-2 py-0.5 font-medium",
              "bg-secondary/50 hover:bg-secondary/70",
              "border border-border/50",
              "transition-all duration-200",
              "cursor-default select-none",
              "flex items-center gap-1.5 whitespace-nowrap",
            ),
            children: e.original?.group?.name || "-",
          }),
        }),
      enableSorting: !1,
    },
    {
      accessorKey: "total_used",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.used_traffic") }),
      cell: ({ row: e }) => {
        const t = IS(e.original?.total_used),
          n = IS(e.original?.transfer_enable),
          i = (e.original?.total_used / e.original?.transfer_enable) * 100 || 0;
        return Q.jsx(Pst, {
          delayDuration: 100,
          children: Q.jsxs(jst, {
            children: [
              Q.jsx(Fst, {
                className: "w-full",
                children: Q.jsxs("div", {
                  className: "w-full space-y-1",
                  children: [
                    Q.jsxs("div", {
                      className: "flex justify-between text-sm",
                      children: [
                        Q.jsx("span", { className: "text-muted-foreground", children: t }),
                        Q.jsxs("span", {
                          className: "text-xs text-muted-foreground",
                          children: [i.toFixed(1), "%"],
                        }),
                      ],
                    }),
                    Q.jsx("div", {
                      className: "h-1.5 w-full rounded-full bg-secondary",
                      children: Q.jsx("div", {
                        className: Rf(
                          "h-full rounded-full transition-all",
                          i > 90 ? "bg-destructive" : "bg-primary",
                        ),
                        style: { width: `${Math.min(i, 100)}%` },
                      }),
                    }),
                  ],
                }),
              }),
              Q.jsx(Bst, {
                side: "bottom",
                children: Q.jsxs("p", {
                  className: "text-sm",
                  children: [r("columns.total_traffic"), ": ", n],
                }),
              }),
            ],
          }),
        });
      },
    },
    {
      accessorKey: "transfer_enable",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.total_traffic") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "font-medium text-muted-foreground",
          children: IS(e.original?.transfer_enable),
        }),
    },
    {
      accessorKey: "expired_at",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.expire_time") }),
      cell: ({ row: e }) => {
        const t = e.original.expired_at,
          n = Date.now() / 1e3,
          i = null != t && t < n,
          o = null != t ? new Date(1e3 * t) : null,
          s = null != o ? Math.ceil((o.getTime() - Date.now()) / 864e5) : null;
        return Q.jsx(Pst, {
          delayDuration: 100,
          children: Q.jsxs(jst, {
            children: [
              Q.jsx(Fst, {
                className: "block w-full",
                children: Q.jsx(hqt, {
                  variant: "outline",
                  className: Rf(
                    "w-full justify-center transition-colors",
                    i
                      ? "border-destructive/50 bg-destructive/10 text-destructive"
                      : t
                        ? "border-success/50 bg-success/10 text-success"
                        : "border-primary/40 bg-primary/5 text-primary/90",
                  ),
                  children: null == t ? r("columns.expire_status.permanent") : CS(t, "yyyy-MM-dd"),
                }),
              }),
              Q.jsx(Bst, {
                side: "bottom",
                className: "space-y-1 p-3",
                children:
                  null != t
                    ? Q.jsxs(Q.Fragment, {
                        children: [
                          Q.jsxs("p", {
                            className: "text-sm text-muted-foreground",
                            children: [r("columns.expire_time"), ": ", CS(t)],
                          }),
                          Q.jsx("p", {
                            className: Rf(
                              "text-sm font-medium",
                              i ? "text-destructive" : "text-success",
                            ),
                            children: i
                              ? r("columns.expire_status.expired", { days: Math.abs(s ?? 0) })
                              : r("columns.expire_status.remaining", { days: s ?? 0 }),
                          }),
                          e.original.next_reset_at &&
                            Q.jsxs("p", {
                              className: "text-sm",
                              children: [
                                r("columns.next_reset_at"),
                                ":",
                                " ",
                                CS(e.original.next_reset_at),
                              ],
                            }),
                        ],
                      })
                    : Q.jsx("p", {
                        className: "text-sm font-medium",
                        children: r("columns.expire_status.permanent"),
                      }),
              }),
            ],
          }),
        });
      },
    },
    {
      accessorKey: "balance",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.balance") }),
      cell: ({ row: e }) => {
        const t = LS(e.original?.balance);
        return Q.jsxs("div", {
          className: "flex items-center gap-1 font-medium",
          children: [
            Q.jsx("span", { className: "text-sm text-muted-foreground", children: "¥" }),
            Q.jsx("span", { className: "tabular-nums text-foreground", children: t }),
          ],
        });
      },
    },
    {
      accessorKey: "commission_balance",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.commission") }),
      cell: ({ row: e }) => {
        const t = LS(e.original?.commission_balance);
        return Q.jsxs("div", {
          className: "flex items-center gap-1 font-medium",
          children: [
            Q.jsx("span", { className: "text-sm text-muted-foreground", children: "¥" }),
            Q.jsx("span", { className: "tabular-nums text-foreground", children: t }),
          ],
        });
      },
    },
    {
      accessorKey: "created_at",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: r("columns.register_time") }),
      cell: ({ row: e }) =>
        Q.jsx("div", { className: "truncate", children: CS(e.original?.created_at) }),
      size: 1e3,
    },
    {
      id: "actions",
      header: ({ column: e }) =>
        Q.jsx(SYt, { column: e, className: "justify-end", title: r("columns.actions") }),
      cell: ({ row: t, table: o }) =>
        Q.jsxs(Not, {
          modal: !1,
          children: [
            Q.jsx(Lot, {
              asChild: !0,
              children: Q.jsx("div", {
                className: "text-center",
                children: Q.jsx(ltt, {
                  variant: "ghost",
                  className: "h-8 w-8 p-0 hover:bg-muted",
                  "aria-label": r("columns.actions"),
                  children: Q.jsx(Cat, { className: "size-4" }),
                }),
              }),
            }),
            Q.jsxs(Iot, {
              align: "end",
              className: "min-w-[40px]",
              children: [
                Q.jsx(Rot, {
                  onSelect: (e) => {
                    (e.preventDefault(), n(t.original), i(!0));
                  },
                  className: "p-0",
                  children: Q.jsxs(ltt, {
                    variant: "ghost",
                    className: "w-full justify-start px-2 py-1.5",
                    children: [Q.jsx(Z6t, { className: "mr-2" }), r("columns.actions_menu.edit")],
                  }),
                }),
                Q.jsx(Rot, {
                  onSelect: (e) => e.preventDefault(),
                  className: "p-0",
                  children: Q.jsx(y3t, {
                    defaultValues: { email: t.original.email },
                    trigger: Q.jsxs(ltt, {
                      variant: "ghost",
                      className: "w-full justify-start px-2 py-1.5",
                      children: [
                        Q.jsx(Y6t, { className: "mr-2" }),
                        r("columns.actions_menu.assign_order"),
                      ],
                    }),
                  }),
                }),
                Q.jsx(Rot, {
                  onSelect: () => {
                    TS(t.original.subscribe_url).then(() => {
                      hN.success(r("common:copy.success"));
                    });
                  },
                  className: "p-0",
                  children: Q.jsxs(ltt, {
                    variant: "ghost",
                    className: "w-full justify-start px-2 py-1.5",
                    children: [
                      Q.jsx(X6t, { className: "mr-2" }),
                      r("columns.actions_menu.copy_url"),
                    ],
                  }),
                }),
                Q.jsxs(Rot, {
                  className: "",
                  onSelect: () => {
                    oT(t.original.id).then(({ data: t }) => {
                      t && (hN.success("重置成功"), e());
                    });
                  },
                  children: [
                    Q.jsx(Q6t, { className: "mr-4" }),
                    r("columns.actions_menu.reset_secret"),
                  ],
                }),
                Q.jsx(Rot, {
                  onSelect: (e) => e.preventDefault(),
                  className: "p-0",
                  children: Q.jsx(ltt, {
                    variant: "ghost",
                    className: "h-auto w-full justify-start px-2 py-1.5 font-normal",
                    asChild: !0,
                    children: Q.jsxs(jg, {
                      to: `/finance/order?user_id=eq:${t.original.id}`,
                      children: [
                        Q.jsx(J6t, { className: "mr-2" }),
                        r("columns.actions_menu.orders"),
                      ],
                    }),
                  }),
                }),
                Q.jsxs(Rot, {
                  onSelect: () => {
                    o.setColumnFilters([{ id: "invite_user_id", value: "eq:" + t.original?.id }]);
                  },
                  children: [Q.jsx(e8t, { className: "mr-4" }), r("columns.actions_menu.invites")],
                }),
                Q.jsx(Rot, {
                  onSelect: (e) => e.preventDefault(),
                  className: "p-0",
                  children: Q.jsx(H6t, {
                    user_id: t.original?.id,
                    dialogTrigger: Q.jsxs(ltt, {
                      variant: "ghost",
                      className: "w-full justify-start px-2 py-1.5",
                      children: [
                        Q.jsx(t8t, { className: "mr-2" }),
                        r("columns.actions_menu.traffic_records"),
                      ],
                    }),
                  }),
                }),
                Q.jsx(Rot, {
                  onSelect: (e) => e.preventDefault(),
                  className: "p-0",
                  children: Q.jsx(z6t, {
                    user: t.original,
                    onSuccess: e,
                    trigger: Q.jsxs(ltt, {
                      variant: "ghost",
                      className: "w-full justify-start px-2 py-1.5",
                      children: [
                        Q.jsx(Q6t, { className: "mr-2" }),
                        r("columns.actions_menu.reset_traffic"),
                      ],
                    }),
                  }),
                }),
                Q.jsx(Rot, {
                  onSelect: (e) => e.preventDefault(),
                  className: "p-0",
                  children: Q.jsx(U6t, {
                    title: r("columns.actions_menu.delete_confirm_title"),
                    description: r("columns.actions_menu.delete_confirm_description", {
                      email: t.original.email,
                    }),
                    cancelText: r("common:cancel"),
                    confirmText: r("common:confirm"),
                    variant: "destructive",
                    onConfirm: async () => {
                      try {
                        const { data: n } = await lT(t.original.id);
                        n && (hN.success(r("common:delete.success")), e());
                      } catch (D2t) {
                        hN.error(r("common:delete.failed"));
                      }
                    },
                    children: Q.jsxs(ltt, {
                      variant: "ghost",
                      className:
                        "w-full justify-start px-2 py-1.5 text-destructive hover:text-destructive",
                      children: [
                        Q.jsx(n8t, { className: "mr-2" }),
                        r("columns.actions_menu.delete"),
                      ],
                    }),
                  }),
                }),
              ],
            }),
          ],
        }),
    },
  ],
  r8t = H.createContext(void 0),
  o8t = ({ children: e, refreshData: t }) => {
    const [n, i] = H.useState(!1),
      [r, o] = H.useState(null),
      s = { isOpen: n, setIsOpen: i, editingUser: r, setEditingUser: o, refreshData: t };
    return Q.jsx(r8t.Provider, { value: s, children: e });
  };
function s8t() {
  const e = H.useContext(r8t);
  if (!e) throw new Error("useUserEdit must be used within an UserEditProvider");
  return e;
}
const a8t = gy({
  id: cy().default(0),
  email: ly().email().default(""),
  invite_user_email: ly().email().nullable().optional().default(null),
  password: ly().optional().nullable().default(null),
  balance: by().default(0),
  commission_balance: by().default(0),
  u: by().default(0),
  d: by().default(0),
  transfer_enable: cy().default(0),
  expired_at: cy().nullable().default(null),
  plan_id: cy().nullable().default(null),
  banned: dy().default(!1),
  commission_type: cy().default(0),
  commission_rate: cy().nullable().default(null),
  discount: cy().nullable().default(null),
  speed_limit: cy().nullable().default(null),
  device_limit: cy().nullable().default(null),
  is_admin: dy().default(!1),
  is_staff: dy().default(!1),
  remarks: ly().nullable().default(null),
});
function l8t() {
  const { t: e } = Py("user"),
    { isOpen: t, setIsOpen: n, editingUser: i, refreshData: r } = s8t(),
    [o, s] = H.useState(!1),
    [a, l] = H.useState([]),
    c = kv({ resolver: Ov(a8t) });
  return (
    H.useEffect(() => {
      t &&
        DD().then(({ data: e }) => {
          l(e);
        });
    }, [t]),
    H.useEffect(() => {
      if (i) {
        const e = i.invite_user?.email,
          { ...t } = i;
        c.reset({
          ...t,
          invite_user_email: e || null,
          password: null,
          u: t.u ? (t.u / 1024 / 1024 / 1024).toFixed(3) : "",
          d: t.d ? (t.d / 1024 / 1024 / 1024).toFixed(3) : "",
        });
      }
    }, [i, c]),
    Q.jsx(E6t, {
      open: t,
      onOpenChange: n,
      children: Q.jsxs(I6t, {
        className: "max-w-[90%] space-y-4",
        children: [
          Q.jsxs(R6t, { children: [Q.jsx(M6t, { children: e("edit.title") }), Q.jsx(A6t, {})] }),
          Q.jsxs(Hy, {
            ...c,
            children: [
              Q.jsx(Uy, {
                control: c.control,
                name: "email",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.email") }),
                      Q.jsx(Zy, {
                        children: Q.jsx(Q6e, {
                          ...t,
                          placeholder: e("edit.form.email_placeholder"),
                          autoComplete: "username",
                        }),
                      }),
                      Q.jsx(Xy, { ...t }),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "invite_user_email",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.inviter_email") }),
                      Q.jsx(Zy, {
                        children: Q.jsx(Q6e, {
                          value: t.value || "",
                          onChange: (e) => t.onChange(e.target.value ? e.target.value : null),
                          placeholder: e("edit.form.inviter_email_placeholder"),
                          autoComplete: "off",
                          name: "invite_user_email",
                        }),
                      }),
                      Q.jsx(Xy, { ...t }),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "password",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.password") }),
                      Q.jsx(Zy, {
                        children: Q.jsx(Q6e, {
                          type: "password",
                          value: t.value || "",
                          onChange: t.onChange,
                          placeholder: e("edit.form.password_placeholder"),
                          autoComplete: "new-password",
                        }),
                      }),
                      Q.jsx(Xy, { ...t }),
                    ],
                  }),
              }),
              Q.jsxs("div", {
                className: "grid gap-2 md:grid-cols-2",
                children: [
                  Q.jsx(Uy, {
                    control: c.control,
                    name: "balance",
                    render: ({ field: t }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, { children: e("edit.form.balance") }),
                          Q.jsx(Zy, {
                            children: Q.jsxs("div", {
                              className: "flex",
                              children: [
                                Q.jsx(Q6e, {
                                  type: "number",
                                  value: t.value || "",
                                  onChange: t.onChange,
                                  placeholder: e("edit.form.balance_placeholder"),
                                  className: "rounded-r-none",
                                }),
                                Q.jsx("div", {
                                  className:
                                    "z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",
                                  children: "¥",
                                }),
                              ],
                            }),
                          }),
                          Q.jsx(Xy, { ...t }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: c.control,
                    name: "commission_balance",
                    render: ({ field: t }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, { children: e("edit.form.commission_balance") }),
                          Q.jsx(Zy, {
                            children: Q.jsxs("div", {
                              className: "flex",
                              children: [
                                Q.jsx(Q6e, {
                                  type: "number",
                                  value: t.value || "",
                                  onChange: t.onChange,
                                  placeholder: e("edit.form.commission_balance_placeholder"),
                                  className: "rounded-r-none",
                                }),
                                Q.jsx("div", {
                                  className:
                                    "z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",
                                  children: "¥",
                                }),
                              ],
                            }),
                          }),
                          Q.jsx(Xy, { ...t }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: c.control,
                    name: "u",
                    render: ({ field: t }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, { children: e("edit.form.upload") }),
                          Q.jsx(Zy, {
                            children: Q.jsxs("div", {
                              className: "flex",
                              children: [
                                Q.jsx(Q6e, {
                                  type: "number",
                                  step: "any",
                                  value: t.value ?? "",
                                  onChange: (e) => t.onChange(e.target.value),
                                  placeholder: e("edit.form.upload_placeholder"),
                                  className: "rounded-r-none",
                                }),
                                Q.jsx("div", {
                                  className:
                                    "z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",
                                  children: "GB",
                                }),
                              ],
                            }),
                          }),
                          Q.jsx(Xy, { ...t }),
                        ],
                      }),
                  }),
                  Q.jsx(Uy, {
                    control: c.control,
                    name: "d",
                    render: ({ field: t }) =>
                      Q.jsxs(Ky, {
                        children: [
                          Q.jsx(Gy, { children: e("edit.form.download") }),
                          Q.jsx(Zy, {
                            children: Q.jsxs("div", {
                              className: "flex",
                              children: [
                                Q.jsx(Q6e, {
                                  type: "number",
                                  step: "any",
                                  value: t.value ?? "",
                                  onChange: (e) => t.onChange(e.target.value),
                                  placeholder: e("edit.form.download_placeholder"),
                                  className: "rounded-r-none",
                                }),
                                Q.jsx("div", {
                                  className:
                                    "z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",
                                  children: "GB",
                                }),
                              ],
                            }),
                          }),
                          Q.jsx(Xy, { ...t }),
                        ],
                      }),
                  }),
                ],
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "transfer_enable",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.total_traffic") }),
                      Q.jsx(Zy, {
                        children: Q.jsxs("div", {
                          className: "flex",
                          children: [
                            Q.jsx(Q6e, {
                              type: "number",
                              value: t.value / 1024 / 1024 / 1024 || "",
                              onChange: (e) =>
                                t.onChange(1024 * parseInt(e.target.value) * 1024 * 1024),
                              placeholder: e("edit.form.total_traffic_placeholder"),
                              className: "rounded-r-none",
                            }),
                            Q.jsx("div", {
                              className:
                                "z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",
                              children: "GB",
                            }),
                          ],
                        }),
                      }),
                      Q.jsx(Xy, {}),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "expired_at",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    className: "flex flex-col",
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.expire_time") }),
                      Q.jsxs(qUt, {
                        open: o,
                        onOpenChange: s,
                        children: [
                          Q.jsx(KUt, {
                            asChild: !0,
                            children: Q.jsx(Zy, {
                              children: Q.jsxs(Nm, {
                                type: "button",
                                variant: "outline",
                                className: Rf(
                                  "w-full pl-3 text-left font-normal",
                                  !t.value && "text-muted-foreground",
                                ),
                                onClick: () => s(!0),
                                children: [
                                  t.value
                                    ? CS(t.value)
                                    : Q.jsx("span", {
                                        children: e("edit.form.expire_time_placeholder"),
                                      }),
                                  Q.jsx(sat, { className: "ml-auto h-4 w-4 opacity-50" }),
                                ],
                              }),
                            }),
                          }),
                          Q.jsx(ZUt, {
                            className: "w-auto p-0",
                            align: "start",
                            side: "top",
                            sideOffset: 4,
                            onInteractOutside: (e) => {
                              e.preventDefault();
                            },
                            onEscapeKeyDown: (e) => {
                              e.preventDefault();
                            },
                            children: Q.jsxs("div", {
                              className: "flex flex-col space-y-3 p-3",
                              children: [
                                Q.jsxs("div", {
                                  className: "flex gap-2",
                                  children: [
                                    Q.jsx(Nm, {
                                      type: "button",
                                      variant: "outline",
                                      className: "flex-1",
                                      onClick: () => {
                                        (t.onChange(null), s(!1));
                                      },
                                      children: e("edit.form.expire_time_permanent"),
                                    }),
                                    Q.jsx(Nm, {
                                      type: "button",
                                      variant: "outline",
                                      className: "flex-1",
                                      onClick: () => {
                                        const e = new Date();
                                        (e.setMonth(e.getMonth() + 1),
                                          e.setHours(23, 59, 59, 999),
                                          t.onChange(Math.floor(e.getTime() / 1e3)),
                                          s(!1));
                                      },
                                      children: e("edit.form.expire_time_1month"),
                                    }),
                                    Q.jsx(Nm, {
                                      type: "button",
                                      variant: "outline",
                                      className: "flex-1",
                                      onClick: () => {
                                        const e = new Date();
                                        (e.setMonth(e.getMonth() + 3),
                                          e.setHours(23, 59, 59, 999),
                                          t.onChange(Math.floor(e.getTime() / 1e3)),
                                          s(!1));
                                      },
                                      children: e("edit.form.expire_time_3months"),
                                    }),
                                  ],
                                }),
                                Q.jsx("div", {
                                  className: "rounded-md border",
                                  children: Q.jsx(mUt, {
                                    mode: "single",
                                    selected: t.value ? new Date(1e3 * t.value) : void 0,
                                    onSelect: (e) => {
                                      if (e) {
                                        const n = new Date(t.value ? 1e3 * t.value : Date.now());
                                        (e.setHours(n.getHours(), n.getMinutes(), n.getSeconds()),
                                          t.onChange(Math.floor(e.getTime() / 1e3)));
                                      }
                                    },
                                    disabled: (e) => e < new Date(),
                                    initialFocus: !0,
                                    className: "rounded-md border-none",
                                  }),
                                }),
                                Q.jsxs("div", {
                                  className: "space-y-1.5",
                                  children: [
                                    Q.jsxs("div", {
                                      className: "flex items-center justify-between",
                                      children: [
                                        Q.jsx("div", {
                                          className: "text-sm font-medium text-muted-foreground",
                                          children: e("edit.form.expire_time_specific"),
                                        }),
                                        Q.jsx(Nm, {
                                          type: "button",
                                          variant: "ghost",
                                          size: "sm",
                                          onClick: () => {
                                            const e = new Date();
                                            (e.setHours(23, 59, 59, 999),
                                              t.onChange(Math.floor(e.getTime() / 1e3)));
                                          },
                                          className: "h-6 px-2 text-xs",
                                          children: e("edit.form.expire_time_today"),
                                        }),
                                      ],
                                    }),
                                    Q.jsxs("div", {
                                      className: "flex gap-2",
                                      children: [
                                        Q.jsx(Q6e, {
                                          type: "datetime-local",
                                          step: "1",
                                          value: CS(t.value, "yyyy-MM-dd'T'HH:mm:ss"),
                                          onChange: (e) => {
                                            const n = new Date(e.target.value);
                                            isNaN(n.getTime()) ||
                                              t.onChange(Math.floor(n.getTime() / 1e3));
                                          },
                                          className: "flex-1",
                                        }),
                                        Q.jsx(Nm, {
                                          type: "button",
                                          variant: "outline",
                                          onClick: () => s(!1),
                                          children: e("edit.form.expire_time_confirm"),
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                              ],
                            }),
                          }),
                        ],
                      }),
                      Q.jsx(Xy, {}),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "plan_id",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.subscription") }),
                      Q.jsx(Zy, {
                        children: Q.jsxs(THt, {
                          value: null !== t.value ? String(t.value) : "null",
                          onValueChange: (e) => t.onChange("null" === e ? null : parseInt(e)),
                          children: [
                            Q.jsx(OHt, {
                              children: Q.jsx(RHt, {
                                placeholder: e("edit.form.subscription_none"),
                              }),
                            }),
                            Q.jsxs(PHt, {
                              children: [
                                Q.jsx(FHt, {
                                  value: "null",
                                  children: e("edit.form.subscription_none"),
                                }),
                                a.map((e) =>
                                  Q.jsx(FHt, { value: String(e.id), children: e.name }, e.id),
                                ),
                              ],
                            }),
                          ],
                        }),
                      }),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "banned",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.account_status") }),
                      Q.jsx(Zy, {
                        children: Q.jsxs(THt, {
                          value: t.value.toString(),
                          onValueChange: (e) => t.onChange("true" === e),
                          children: [
                            Q.jsx(OHt, { children: Q.jsx(RHt, {}) }),
                            Q.jsxs(PHt, {
                              children: [
                                Q.jsx(FHt, {
                                  value: "true",
                                  children: e("columns.status_text.banned"),
                                }),
                                Q.jsx(FHt, {
                                  value: "false",
                                  children: e("columns.status_text.normal"),
                                }),
                              ],
                            }),
                          ],
                        }),
                      }),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "commission_type",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.commission_type") }),
                      Q.jsx(Zy, {
                        children: Q.jsxs(THt, {
                          value: t.value.toString(),
                          onValueChange: (e) => t.onChange(parseInt(e)),
                          children: [
                            Q.jsx(OHt, {
                              children: Q.jsx(RHt, {
                                placeholder: e("edit.form.subscription_none"),
                              }),
                            }),
                            Q.jsxs(PHt, {
                              children: [
                                Q.jsx(FHt, {
                                  value: "0",
                                  children: e("edit.form.commission_type_system"),
                                }),
                                Q.jsx(FHt, {
                                  value: "1",
                                  children: e("edit.form.commission_type_cycle"),
                                }),
                                Q.jsx(FHt, {
                                  value: "2",
                                  children: e("edit.form.commission_type_onetime"),
                                }),
                              ],
                            }),
                          ],
                        }),
                      }),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "commission_rate",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.commission_rate") }),
                      Q.jsx(Zy, {
                        children: Q.jsxs("div", {
                          className: "flex",
                          children: [
                            Q.jsx(Q6e, {
                              type: "number",
                              value: t.value || "",
                              onChange: (e) => t.onChange(parseInt(e.currentTarget.value) || null),
                              placeholder: e("edit.form.commission_rate_placeholder"),
                              className: "rounded-r-none",
                            }),
                            Q.jsx("div", {
                              className:
                                "z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",
                              children: "%",
                            }),
                          ],
                        }),
                      }),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "discount",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.discount") }),
                      Q.jsx(Zy, {
                        children: Q.jsxs("div", {
                          className: "flex",
                          children: [
                            Q.jsx(Q6e, {
                              type: "number",
                              value: t.value || "",
                              onChange: (e) => t.onChange(parseInt(e.currentTarget.value) || null),
                              placeholder: e("edit.form.discount_placeholder"),
                              className: "rounded-r-none",
                            }),
                            Q.jsx("div", {
                              className:
                                "z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",
                              children: "%",
                            }),
                          ],
                        }),
                      }),
                      Q.jsx(Xy, {}),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "speed_limit",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.speed_limit") }),
                      Q.jsx(Zy, {
                        children: Q.jsxs("div", {
                          className: "flex",
                          children: [
                            Q.jsx(Q6e, {
                              type: "number",
                              value: t.value || "",
                              onChange: (e) => t.onChange(parseInt(e.currentTarget.value) || null),
                              placeholder: e("edit.form.speed_limit_placeholder"),
                              className: "rounded-r-none",
                            }),
                            Q.jsx("div", {
                              className:
                                "z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",
                              children: "Mbps",
                            }),
                          ],
                        }),
                      }),
                      Q.jsx(Xy, {}),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "device_limit",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.device_limit") }),
                      Q.jsx(Zy, {
                        children: Q.jsxs("div", {
                          className: "flex",
                          children: [
                            Q.jsx(Q6e, {
                              type: "number",
                              value: t.value || "",
                              onChange: (e) => t.onChange(parseInt(e.currentTarget.value) || null),
                              placeholder: e("edit.form.device_limit_placeholder"),
                              className: "rounded-r-none",
                            }),
                            Q.jsx("div", {
                              className:
                                "z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",
                              children: "台",
                            }),
                          ],
                        }),
                      }),
                      Q.jsx(Xy, {}),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "is_admin",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.is_admin") }),
                      Q.jsx("div", {
                        className: "py-2",
                        children: Q.jsx(Zy, {
                          children: Q.jsx(mGt, {
                            checked: t.value,
                            onCheckedChange: (e) => t.onChange(e),
                          }),
                        }),
                      }),
                      Q.jsx(Xy, {}),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "is_staff",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.is_staff") }),
                      Q.jsx("div", {
                        className: "py-2",
                        children: Q.jsx(Zy, {
                          children: Q.jsx(mGt, {
                            checked: t.value,
                            onCheckedChange: (e) => t.onChange(e),
                          }),
                        }),
                      }),
                    ],
                  }),
              }),
              Q.jsx(Uy, {
                control: c.control,
                name: "remarks",
                render: ({ field: t }) =>
                  Q.jsxs(Ky, {
                    children: [
                      Q.jsx(Gy, { children: e("edit.form.remarks") }),
                      Q.jsx(Zy, {
                        children: Q.jsx(_Gt, {
                          className: "h-24",
                          value: t.value || "",
                          onChange: (e) => t.onChange(e.currentTarget.value ?? null),
                          placeholder: e("edit.form.remarks_placeholder"),
                        }),
                      }),
                      Q.jsx(Xy, {}),
                    ],
                  }),
              }),
              Q.jsxs(O6t, {
                children: [
                  Q.jsx(Nm, {
                    variant: "outline",
                    onClick: () => n(!1),
                    children: e("edit.form.cancel"),
                  }),
                  Q.jsx(Nm, {
                    type: "submit",
                    onClick: () => {
                      c.handleSubmit((t) => {
                        const i = { id: t.id };
                        (c.formState.dirtyFields.u &&
                          (i.u = Math.round(1024 * parseFloat(t.u) * 1024 * 1024)),
                          c.formState.dirtyFields.d &&
                            (i.d = Math.round(1024 * parseFloat(t.d) * 1024 * 1024)),
                          Object.keys(t).forEach((e) => {
                            "u" !== e &&
                              "d" !== e &&
                              "id" !== e &&
                              c.formState.dirtyFields[e] &&
                              (i[e] = t[e]);
                          }),
                          rT(i).then(({ data: t }) => {
                            t && (hN.success(e("edit.form.success")), n(!1), r());
                          }));
                      })();
                    },
                    children: e("edit.form.submit"),
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
    })
  );
}
function codexNativePageLayout(e, t, n) {
  return Q.jsxs(Wot, {
    children: [
      Q.jsxs(Hot, {
        children: [
          Q.jsx(Vdt, {}),
          Q.jsxs("div", {
            className: "ml-auto flex items-center space-x-4",
            children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
          }),
        ],
      }),
      Q.jsxs(zot, {
        className: "flex flex-col",
        fixedHeight: !0,
        children: [
          Q.jsx("div", {
            className: "mb-2 flex items-center justify-between space-y-2",
            children: Q.jsxs("div", {
              children: [
                Q.jsx("h2", { className: "text-2xl font-bold tracking-tight", children: e }),
                Q.jsx("p", { className: "mt-2 text-muted-foreground", children: t }),
              ],
            }),
          }),
          Q.jsx("div", {
            className: "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
            children: Q.jsx("div", { className: "w-full", children: n }),
          }),
        ],
      }),
    ],
  });
}
function codexNativeStatusBadge(e) {
  const t = String(e || "-").toLowerCase(),
    n = /approved|active|enabled|ready/.test(t)
      ? "bg-emerald-500/15 text-emerald-600 dark:text-emerald-400"
      : /pending|eligible|unverified/.test(t)
        ? "bg-yellow-500/15 text-yellow-700 dark:text-yellow-400"
        : "bg-destructive/10 text-destructive";
  return Q.jsx("span", {
    className: Rf("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold", n),
    children: e || "-",
  });
}
function codexNativeRelationChip(e, t) {
  return Q.jsxs("span", {
    className:
      "inline-flex items-center gap-1 rounded-full border bg-muted/50 px-2.5 py-1 font-mono text-xs",
    children: [
      e,
      Q.jsx("span", { className: "text-muted-foreground/60", children: "\u2192" }),
      t,
    ],
  });
}
function codexNativeSearchToolbar({
  keyword: e,
  setKeyword: t,
  onSearch: n,
  onReset: i,
  refetch: r,
  actions: o,
}) {
  return Q.jsxs("div", {
    className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
    children: [
      Q.jsxs("div", {
        className: "flex flex-1 flex-wrap items-center gap-2 sm:flex-nowrap",
        children: [
          Q.jsx(Q6e, {
            placeholder: "搜索用户 ID / 邮箱",
            value: e,
            onChange: (e) => t(e.target.value),
            onKeyDown: (e) => {
              "Enter" === e.key && n();
            },
            className: "h-8 w-full min-w-[150px] sm:w-[180px] lg:w-[280px]",
          }),
          Q.jsx(Nm, { variant: "outline", className: "h-8 px-3", onClick: n, children: "搜索" }),
          Q.jsx(Nm, { variant: "ghost", className: "h-8 px-3", onClick: i, children: "重置" }),
          Q.jsx(Nm, { variant: "ghost", className: "h-8 px-3", onClick: () => r(), children: "刷新" }),
        ],
      }),
      o ? Q.jsx("div", { className: "flex flex-wrap items-center gap-2", children: o }) : null,
    ],
  });
}
function codexNativeRealnameTable() {
  const [e, t] = H.useState(""),
    [n, i] = H.useState(""),
    [r, o] = H.useState({}),
    [s, a] = H.useState({}),
    [l, c] = H.useState({ pageIndex: 0, pageSize: 20 }),
    {
      refetch: d,
      data: u,
      isLoading: h,
    } = gC({
      queryKey: ["codexNativeRealname", l, n],
      queryFn: () =>
        TL(`${RL()}/realname/records`, {
          params: { page: l.pageIndex + 1, per_page: l.pageSize, keyword: n },
        }),
    }),
    g = H.useMemo(
      () => [
        {
          accessorKey: "id",
          header: () => "用户 ID",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "font-mono text-sm font-medium", children: e.getValue("id") }),
        },
        {
          accessorKey: "email",
          header: () => "邮箱",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "max-w-[240px] truncate", children: e.getValue("email") || "-" }),
        },
        {
          accessorKey: "real_name",
          header: () => "姓名",
          cell: ({ row: e }) => e.getValue("real_name") || "-",
        },
        {
          accessorKey: "identity_no_masked",
          header: () => "证件号",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "font-mono text-xs", children: e.getValue("identity_no_masked") || "-" }),
        },
        JKt.display({
          id: "status",
          header: () => "状态",
          cell: ({ row: e }) => codexNativeStatusBadge(e.original.status_label || e.original.status),
        }),
        JKt.display({
          id: "actions",
          header: () => "操作",
          cell: ({ row: e }) =>
            Q.jsxs("div", {
              className: "flex flex-wrap items-center gap-2",
              children: [
                Q.jsx(Nm, {
                  size: "sm",
                  className: "h-8",
                  onClick: async () => {
                    await IL(`${RL()}/realname/review/${e.original.id}`, { status: "approved", reason: "" });
                    hN.success("已通过实名认证");
                    d();
                  },
                  children: "通过",
                }),
                Q.jsx(Nm, {
                  size: "sm",
                  variant: "outline",
                  className: "h-8",
                  onClick: async () => {
                    const t = window.prompt("请输入驳回原因", "") || "";
                    await IL(`${RL()}/realname/review/${e.original.id}`, {
                      status: "rejected",
                      reason: t,
                    });
                    hN.success("已驳回实名认证");
                    d();
                  },
                  children: "驳回",
                }),
                Q.jsx(Nm, {
                  size: "sm",
                  variant: "ghost",
                  className: "h-8",
                  onClick: async () => {
                    await IL(`${RL()}/realname/reset/${e.original.id}`, {});
                    hN.success("已重置实名记录");
                    d();
                  },
                  children: "重置",
                }),
              ],
            }),
        }),
      ],
      [d],
    ),
    p = PKt({
      data: u?.data?.data ?? [],
      columns: g,
      state: { columnVisibility: o, rowSelection: s, pagination: l },
      getRowId: (e) => String(e.id),
      rowCount: u?.data?.pagination?.total ?? 0,
      manualPagination: !0,
      enableRowSelection: !0,
      onRowSelectionChange: a,
      onColumnVisibilityChange: o,
      onPaginationChange: c,
      getCoreRowModel: LKt(),
      getPaginationRowModel: OKt(),
    });
  return Q.jsxs("div", {
    className: "space-y-4",
    children: [
      Q.jsx(codexNativeSearchToolbar, {
        keyword: e,
        setKeyword: t,
        onSearch: () => {
          c((e) => ({ ...e, pageIndex: 0 }));
          i(e.trim());
        },
        onReset: () => {
          t("");
          i("");
          c((e) => ({ ...e, pageIndex: 0 }));
        },
        refetch: d,
        actions: Q.jsxs(Q.Fragment, {
          children: [
            Q.jsx(Nm, {
              variant: "outline",
              className: "h-8",
              onClick: async () => {
                await IL(`${RL()}/realname/sync-all`, {});
                hN.success("已同步全部实名状态");
                d();
              },
              children: "同步全部",
            }),
            Q.jsx(Nm, {
              className: "h-8",
              onClick: async () => {
                await IL(`${RL()}/realname/approve-all`, {});
                hN.success("已全部通过");
                d();
              },
              children: "全部通过",
            }),
          ],
        }),
      }),
      Q.jsx(QKt, {
        table: p,
        isLoading: h,
        showPagination: !0,
        mobilePrimaryField: "email",
        mobileGridFields: ["real_name", "status", "identity_no_masked"],
      }),
    ],
  });
}
function codexNativeRealnamePage() {
  return codexNativePageLayout("实名认证", "审核实名记录并同步实名状态。", Q.jsx(codexNativeRealnameTable, {}));
}
function codexNativeOnlineDevicesTable() {
  const [e, t] = H.useState(""),
    [n, i] = H.useState(""),
    [r, o] = H.useState({}),
    [s, a] = H.useState({}),
    [l, c] = H.useState({ pageIndex: 0, pageSize: 20 }),
    {
      refetch: d,
      data: u,
      isLoading: h,
    } = gC({
      queryKey: ["codexNativeOnlineDevices", l, n],
      queryFn: () =>
        TL(`${RL()}/user-online-devices/users`, {
          params: { page: l.pageIndex + 1, per_page: l.pageSize, keyword: n },
        }),
    }),
    g = H.useMemo(
      () => [
        {
          accessorKey: "id",
          header: () => "用户 ID",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "font-mono text-sm font-medium", children: e.getValue("id") }),
        },
        {
          accessorKey: "email",
          header: () => "邮箱",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "max-w-[240px] truncate", children: e.getValue("email") || "-" }),
        },
        {
          accessorKey: "subscription_name",
          header: () => "套餐",
          cell: ({ row: e }) => e.getValue("subscription_name") || "-",
        },
        JKt.display({
          id: "online_devices",
          header: () => "在线 IP",
          cell: ({ row: e }) => {
            const t = e.original.online_devices || [];
            return t.length
              ? Q.jsx("div", {
                  className: "flex flex-col gap-1 font-mono text-xs",
                  children: t.map((e, t) => Q.jsx("span", { children: e }, `${e}-${t}`)),
                })
              : "-";
          },
        }),
        {
          accessorKey: "online_count",
          header: () => "数量",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "font-mono text-sm", children: e.getValue("online_count") || 0 }),
        },
        JKt.display({
          id: "status",
          header: () => "Status",
          cell: ({ row: e }) => codexNativeStatusBadge(e.original.status_label || e.original.status),
        }),
        {
          accessorKey: "last_online_text",
          header: () => "最后在线",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "text-nowrap text-sm text-muted-foreground", children: e.getValue("last_online_text") || "-" }),
        },
      ],
      [],
    ),
    p = PKt({
      data: u?.data?.list ?? [],
      columns: g,
      state: { columnVisibility: r, rowSelection: s, pagination: l },
      getRowId: (e) => String(e.id),
      rowCount: u?.data?.pagination?.total ?? 0,
      manualPagination: !0,
      enableRowSelection: !0,
      onRowSelectionChange: a,
      onColumnVisibilityChange: o,
      onPaginationChange: c,
      getCoreRowModel: LKt(),
      getPaginationRowModel: OKt(),
    });
  return Q.jsxs("div", {
    className: "space-y-4",
    children: [
      Q.jsx(codexNativeSearchToolbar, {
        keyword: e,
        setKeyword: t,
        onSearch: () => {
          c((e) => ({ ...e, pageIndex: 0 }));
          i(e.trim());
        },
        onReset: () => {
          t("");
          i("");
          c((e) => ({ ...e, pageIndex: 0 }));
        },
        refetch: d,
      }),
      Q.jsx(QKt, {
        table: p,
        isLoading: h,
        showPagination: !0,
        mobilePrimaryField: "email",
        mobileGridFields: ["subscription_name", "online_count", "status", "last_online_text"],
      }),
    ],
  });
}
function codexNativeOnlineDevicesPage() {
  return codexNativePageLayout("在线设备", "查看用户在线 IP、数量和最后在线时间。", Q.jsx(codexNativeOnlineDevicesTable, {}));
}
/* function codexNativeIPv6Table() {
  const [e, t] = H.useState(""),
    [n, i] = H.useState(""),
    [r, o] = H.useState({}),
    [s, a] = H.useState({}),
    [l, c] = H.useState({ pageIndex: 0, pageSize: 20 }),
    [d, u] = H.useState("0"),
    [h, g] = H.useState(!1),
    {
      refetch: p,
      data: f,
      isLoading: m,
    } = gC({
      queryKey: ["codexNativeIPv6", l, n],
      queryFn: () =>
        TL(`${RL()}/user-add-ipv6-subscription/users`, {
          params: { page: l.pageIndex + 1, per_page: l.pageSize, keyword: n },
        }),
    }),
    { data: _, refetch: v } = gC({
      queryKey: ["codexNativeIPv6Config"],
      queryFn: () => TL(`${RL()}/user-add-ipv6-subscription/config`),
    }),
    { data: b } = gC({
      queryKey: ["codexNativeIPv6Plans"],
      queryFn: () => DD(),
    }),
    y = H.useMemo(() => (Array.isArray(b?.data) ? b.data : []), [b]),
    x = H.useMemo(
      () => [
        JKt.display({
          id: "relation",
          header: () => "主从关系",
          cell: ({ row: e }) =>
            codexNativeRelationChip(e.original.id, e.original.shadow_user_id || "-"),
        }),
        {
          accessorKey: "email",
          header: () => "主账号",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "max-w-[240px] truncate", children: e.getValue("email") || "-" }),
        },
        {
          accessorKey: "ipv6_email",
          header: () => "IPv6 账号",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "font-mono text-xs", children: e.getValue("ipv6_email") || "-" }),
        },
        {
          accessorKey: "plan_name",
          header: () => "套餐",
          cell: ({ row: e }) => e.getValue("plan_name") || "-",
        },
        JKt.display({
          id: "status",
          header: () => "状态",
          cell: ({ row: e }) => codexNativeStatusBadge(e.original.status_label || e.original.status),
        }),
        JKt.display({
          id: "actions",
          header: () => "操作",
          cell: ({ row: e }) =>
            Q.jsxs("div", {
              className: "flex flex-wrap items-center gap-2",
              children: [
                Q.jsx(Nm, {
                  size: "sm",
                  className: "h-8",
                  onClick: async () => {
                    await IL(`${RL()}/user-add-ipv6-subscription/enable/${e.original.id}`, {});
                    hN.success("已开通并同步 IPv6 子账号");
                    p();
                  },
                  children: "开通并同步",
                }),
                Q.jsx(Nm, {
                  size: "sm",
                  variant: "outline",
                  className: "h-8",
                  onClick: async () => {
                    await IL(`${RL()}/user-add-ipv6-subscription/sync-password/${e.original.id}`, {});
                    hN.success("已同步密码");
                    p();
                  },
                  children: "同步密码",
                }),
              ],
            }),
        }),
      ],
      [p],
    ),
    w = PKt({
      data: f?.data?.list ?? [],
      columns: x,
      state: { columnVisibility: r, rowSelection: s, pagination: l },
      getRowId: (e) => String(e.id),
      rowCount: f?.data?.pagination?.total ?? 0,
      manualPagination: !0,
      enableRowSelection: !0,
      onRowSelectionChange: a,
      onColumnVisibilityChange: o,
      onPaginationChange: c,
      getCoreRowModel: LKt(),
      getPaginationRowModel: OKt(),
    });
  return (
    H.useEffect(() => {
      const e = _?.data?.ipv6_plan_id;
      u(e && e > 0 ? String(e) : "0");
    }, [_]),
    Q.jsxs("div", {
      className: "space-y-4",
      children: [
        Q.jsx(codexNativeSearchToolbar, {
          keyword: e,
          setKeyword: t,
          onSearch: () => {
            c((e) => ({ ...e, pageIndex: 0 }));
            i(e.trim());
          },
          onReset: () => {
            t("");
            i("");
            c((e) => ({ ...e, pageIndex: 0 }));
          },
          refetch: p,
          actions: Q.jsxs("div", {
            className: "flex flex-wrap items-center gap-2",
            children: [
              Q.jsx("span", { className: "text-sm text-muted-foreground", children: "IPv6Only 套餐" }),
              Q.jsxs("div", {
                className: "relative",
                children: [
                  Q.jsxs("select", {
                    className:
                      "flex h-8 min-w-[180px] appearance-none rounded-md border border-input bg-transparent px-3 pr-8 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
                    value: d,
                    onChange: (e) => u(e.target.value),
                    children: [
                      Q.jsx("option", { value: "0", children: "未设置" }),
                      y.map((e) =>
                        Q.jsx("option", { value: String(e.id), children: e.name || `Plan ${e.id}` }, e.id),
                      ),
                    ],
                  }),
                  Q.jsx(m7e, {
                    className:
                      "pointer-events-none absolute right-2 top-2 h-4 w-4 text-muted-foreground/70",
                  }),
                ],
              }),
              Q.jsx(Nm, {
                className: "h-8",
                loading: h,
                onClick: async () => {
                  g(!0);
                  try {
                    await IL(`${RL()}/user-add-ipv6-subscription/config`, {
                      ipv6_plan_id: Number(d) || 0,
                    });
                    hN.success("已保存 IPv6Only 套餐");
                    await Promise.all([v(), p()]);
                  } finally {
                    g(!1);
                  }
                },
                children: "保存套餐",
              }),
            ],
          }),
        }),
        Q.jsx(QKt, {
          table: w,
          isLoading: m,
          showPagination: !0,
          mobilePrimaryField: "email",
          mobileGridFields: ["ipv6_email", "plan_name", "status"],
        }),
      ],
    })
  );
}
function codexNativeIPv6Page() {
  return codexNativePageLayout(
    "IPv6 子账号",
    "管理 IPv6 子账号开通、IPv6Only 套餐配置、主从关系和密码同步。",
    Q.jsx(codexNativeIPv6Table, {}),
  );
}
*/
function codexNativeIPv6Table() {
  const [e, t] = H.useState(""),
    [n, i] = H.useState(""),
    [r, o] = H.useState({}),
    [s, a] = H.useState({}),
    [l, c] = H.useState({ pageIndex: 0, pageSize: 20 }),
    [d, u] = H.useState({ open: !1, user: null, planId: "0" }),
    [h, g] = H.useState(!1),
    {
      refetch: p,
      data: f,
      isLoading: m,
    } = gC({
      queryKey: ["codexNativeIPv6", l, n],
      queryFn: () =>
        TL(`${RL()}/user-add-ipv6-subscription/users`, {
          params: { page: l.pageIndex + 1, per_page: l.pageSize, keyword: n },
        }),
    }),
    { data: _ } = gC({
      queryKey: ["codexNativeIPv6Config"],
      queryFn: () => TL(`${RL()}/user-add-ipv6-subscription/config`),
    }),
    { data: v } = gC({
      queryKey: ["codexNativeIPv6Plans"],
      queryFn: () => DD(),
    }),
    b = H.useMemo(() => (Array.isArray(v?.data) ? v.data : []), [v]),
    y = H.useMemo(() => {
      const e = _?.data?.ipv6_plan_id;
      return e && e > 0 ? String(e) : "0";
    }, [_]),
    x = H.useCallback(
      (e) => {
        const t = e?.plan_id && e.plan_id > 0 ? String(e.plan_id) : y;
        u({ open: !0, user: e, planId: t });
      },
      [y],
    ),
    w = H.useCallback(() => {
      u({ open: !1, user: null, planId: y });
    }, [y]),
    C = H.useMemo(
      () => [
        JKt.display({
          id: "relation",
          header: () => "Relation",
          cell: ({ row: e }) =>
            codexNativeRelationChip(e.original.id, e.original.shadow_user_id || "-"),
        }),
        {
          accessorKey: "email",
          header: () => "Primary account",
          cell: ({ row: e }) =>
            Q.jsx("div", { className: "max-w-[240px] truncate", children: e.getValue("email") || "-" }),
        },
        {
          accessorKey: "plan_name",
          header: () => "IPv6 plan",
          cell: ({ row: e }) => e.getValue("plan_name") || "",
        },
        JKt.display({
          id: "status",
          header: () => "Status",
          cell: ({ row: e }) => codexNativeStatusBadge(e.original.status_label || e.original.status),
        }),
        JKt.display({
          id: "actions",
          header: () => "Actions",
          cell: ({ row: e }) => {
            const t = e.original.is_active || "active" === e.original.status,
              n = "disabled" === e.original.status,
              i = t ? "Set plan" : n ? "Re-enable" : "Enable";
            return Q.jsxs("div", {
              className: "flex flex-wrap items-center gap-2",
              children: [
                Q.jsx(Nm, {
                  size: "sm",
                  className: "h-8",
                  onClick: () => x(e.original),
                  children: i,
                }),
                t &&
                  Q.jsx(Nm, {
                    size: "sm",
                    variant: "outline",
                    className: "h-8",
                    onClick: async () => {
                      await IL(`${RL()}/user-add-ipv6-subscription/disable/${e.original.id}`, {});
                      hN.success("IPv6 account disabled");
                      p();
                    },
                    children: "Disable",
                  }),
                t &&
                  Q.jsx(Nm, {
                    size: "sm",
                    variant: "outline",
                    className: "h-8",
                    onClick: async () => {
                      await IL(`${RL()}/user-add-ipv6-subscription/sync-password/${e.original.id}`, {});
                      hN.success("Password synced");
                      p();
                    },
                    children: "Sync password",
                  }),
              ],
            });
          },
        }),
      ],
      [x, p],
    ),
    S = PKt({
      data: f?.data?.list ?? [],
      columns: C,
      state: { columnVisibility: r, rowSelection: s, pagination: l },
      getRowId: (e) => String(e.id),
      rowCount: f?.data?.pagination?.total ?? 0,
      manualPagination: !0,
      enableRowSelection: !0,
      onRowSelectionChange: a,
      onColumnVisibilityChange: o,
      onPaginationChange: c,
      getCoreRowModel: LKt(),
      getPaginationRowModel: OKt(),
    });
  return Q.jsxs("div", {
    className: "space-y-4",
    children: [
      Q.jsx(codexNativeSearchToolbar, {
        keyword: e,
        setKeyword: t,
        onSearch: () => {
          c((e) => ({ ...e, pageIndex: 0 }));
          i(e.trim());
        },
        onReset: () => {
          t("");
          i("");
          c((e) => ({ ...e, pageIndex: 0 }));
        },
        refetch: p,
      }),
      Q.jsx(QKt, {
        table: S,
        isLoading: m,
        showPagination: !0,
        mobilePrimaryField: "email",
        mobileGridFields: ["plan_name", "status"],
      }),
      Q.jsx(Jet, {
        open: d.open,
        onOpenChange: (e) => {
          e ? u((e) => ({ ...e, open: !0 })) : w();
        },
        children: Q.jsxs(ttt, {
          className: "sm:max-w-md",
          children: [
            Q.jsxs(ntt, {
              children: [
                Q.jsx(rtt, { children: "Set IPv6 plan" }),
                Q.jsx(ott, {
                  children: d.user ? `User: ${d.user.email || d.user.id}` : "Choose the plan for this IPv6 account.",
                }),
              ],
            }),
            Q.jsxs("div", {
              className: "space-y-4 p-6",
              children: [
                Q.jsxs("div", {
                  className: "space-y-2",
                  children: [
                    Q.jsx("label", { className: "text-sm font-medium text-foreground", children: "IPv6 plan" }),
                    Q.jsxs("div", {
                      className: "relative",
                      children: [
                        Q.jsxs("select", {
                          className:
                            "flex h-10 w-full appearance-none rounded-md border border-input bg-transparent px-3 pr-8 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
                          value: d.planId,
                          onChange: (e) => u((t) => ({ ...t, planId: e.target.value })),
                          children: [
                            Q.jsx("option", { value: "0", children: "Use default plan" }),
                            b.map((e) =>
                              Q.jsx("option", { value: String(e.id), children: e.name || `Plan ${e.id}` }, e.id),
                            ),
                          ],
                        }),
                        Q.jsx(m7e, {
                          className:
                            "pointer-events-none absolute right-3 top-3.5 h-4 w-4 text-muted-foreground/70",
                        }),
                      ],
                    }),
                  ],
                }),
                Q.jsxs("div", {
                  className: "flex justify-end gap-2",
                  children: [
                    Q.jsx(Nm, { type: "button", variant: "outline", onClick: w, children: "Cancel" }),
                    Q.jsx(Nm, {
                      type: "button",
                      loading: h,
                      onClick: async () => {
                        if (!d.user) return;
                        g(!0);
                        try {
                          await IL(`${RL()}/user-add-ipv6-subscription/enable/${d.user.id}`, {
                            plan_id: Number(d.planId) || 0,
                          });
                          hN.success("IPv6 account updated");
                          w();
                          await p();
                        } finally {
                          g(!1);
                        }
                      },
                      children: "Save",
                    }),
                  ],
                }),
              ],
            }),
          ],
        }),
      }),
    ],
  });
}
function codexNativeIPv6Page() {
  return codexNativePageLayout(
    "IPv6 subscription",
    "Manage IPv6 account activation, IPv6Only plan configuration, relation mapping, and password sync.",
    Q.jsx(codexNativeIPv6Table, {}),
  );
}
function c8t() {
  const [e] = Hg(),
    [t, n] = H.useState({}),
    [i, r] = H.useState({ is_admin: !1, is_staff: !1 }),
    [o, s] = H.useState([]),
    [a, l] = H.useState([]),
    [c, d] = H.useState({ pageIndex: 0, pageSize: 20 });
  H.useEffect(() => {
    const t = e.get("email");
    t && s((e) => (e.some((e) => "email" === e.id) ? e : [...e, { id: "email", value: t }]));
  }, [e]);
  const {
      refetch: u,
      data: h,
      isLoading: g,
    } = gC({
      queryKey: ["userList", c, o, a],
      queryFn: () => iT({ pageSize: c.pageSize, current: c.pageIndex + 1, filter: o, sort: a }),
    }),
    [p, f] = H.useState([]),
    [m, _] = H.useState([]);
  H.useEffect(() => {
    (eD().then(({ data: e }) => {
      f(e);
    }),
      DD().then(({ data: e }) => {
        _(e);
      }));
  }, []);
  const v = m.map((e) => ({ label: e.name, value: e.id }));
  return Q.jsxs(o8t, {
    refreshData: u,
    children: [
      Q.jsx(d8t, {
        data: h?.data || [],
        rowCount: h?.total ?? 0,
        sorting: a,
        setSorting: l,
        columnVisibility: i,
        setColumnVisibility: r,
        rowSelection: t,
        setRowSelection: n,
        columnFilters: o,
        setColumnFilters: s,
        pagination: c,
        setPagination: d,
        refetch: u,
        serverGroupList: p,
        subscriptionPlans: v,
        isLoading: g,
      }),
      Q.jsx(l8t, {}),
    ],
  });
}
function d8t({
  data: e,
  rowCount: t,
  sorting: n,
  setSorting: i,
  columnVisibility: r,
  setColumnVisibility: o,
  rowSelection: s,
  setRowSelection: a,
  columnFilters: l,
  setColumnFilters: c,
  pagination: d,
  setPagination: u,
  refetch: h,
  serverGroupList: g,
  subscriptionPlans: p,
  isLoading: f,
}) {
  const { t: m } = Py("user"),
    { setIsOpen: _, setEditingUser: v } = s8t(),
    b = PKt({
      data: e,
      columns: i8t(h, 0, v, _, m),
      state: { sorting: n, columnVisibility: r, rowSelection: s, columnFilters: l, pagination: d },
      getRowId: (e) => String(e.id),
      rowCount: t,
      manualPagination: !0,
      manualFiltering: !0,
      manualSorting: !0,
      enableRowSelection: !0,
      onRowSelectionChange: a,
      onSortingChange: i,
      onColumnFiltersChange: c,
      onColumnVisibilityChange: o,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      onPaginationChange: u,
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: {
        columnVisibility: {
          commission_balance: !1,
          created_at: !1,
          is_admin: !1,
          is_staff: !1,
          permission_group: !1,
          plan_id: !1,
        },
        columnPinning: { right: ["actions"] },
      },
    });
  return Q.jsxs("div", {
    className: "space-y-4",
    children: [
      Q.jsx(P6t, { table: b, refetch: h, serverGroupList: g, subscriptionPlans: p }),
      Q.jsx(QKt, {
        table: b,
        isLoading: f,
        mobilePrimaryField: "email",
        mobileGridFields: ["online_count", "transfer_enable", "used_traffic", "expired_at"],
      }),
    ],
  });
}
const u8t = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        default: function () {
          const { t: e } = Py("user");
          return Q.jsxs(Wot, {
            children: [
              Q.jsxs(Hot, {
                children: [
                  Q.jsx(Vdt, {}),
                  Q.jsxs("div", {
                    className: "ml-auto flex items-center space-x-4",
                    children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                  }),
                ],
              }),
              Q.jsxs(zot, {
                className: "flex flex-col",
                fixedHeight: !0,
                children: [
                  Q.jsx("div", {
                    className: "mb-2 flex items-center justify-between space-y-2",
                    children: Q.jsxs("div", {
                      children: [
                        Q.jsx("h2", {
                          className: "text-2xl font-bold tracking-tight",
                          children: e("manage.title"),
                        }),
                        Q.jsx("p", {
                          className: "mt-2 text-muted-foreground",
                          children: e("manage.description"),
                        }),
                      ],
                    }),
                  }),
                  Q.jsx("div", {
                    className:
                      "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                    children: Q.jsx("div", { className: "w-full", children: Q.jsx(c8t, {}) }),
                  }),
                ],
              }),
            ],
          });
        },
      },
      Symbol.toStringTag,
      { value: "Module" },
    ),
  ),
  h8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M19 11H5a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2",
      }),
    });
function g8t({ table: e }) {
  const { t: t } = Py("ticket");
  return Q.jsx("div", {
    className: "flex items-center justify-between",
    children: Q.jsxs("div", {
      className:
        "flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-4",
      children: [
        Q.jsx(iw, {
          defaultValue: e.getColumn("status")?.getFilterValue(),
          onValueChange: (t) => e.getColumn("status")?.setFilterValue(t),
          children: Q.jsxs(rw, {
            className: "grid w-full grid-cols-2",
            children: [
              Q.jsx(ow, { value: "0", children: t("status.processing") }),
              Q.jsx(ow, { value: "1", children: t("status.closed") }),
            ],
          }),
        }),
        e.getColumn("level") &&
          Q.jsx(J3t, {
            column: e.getColumn("level"),
            title: t("columns.level"),
            options: [
              { label: t("level.low"), value: v$t.LOW, icon: h8t, color: "gray" },
              { label: t("level.medium"), value: v$t.MIDDLE, icon: j6t, color: "yellow" },
              { label: t("level.high"), value: v$t.HIGH, icon: F6t, color: "red" },
            ],
          }),
      ],
    }),
  });
}
function p8t() {
  return Q.jsxs("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg",
    className: "text-foreground",
    children: [
      Q.jsx("circle", {
        cx: "4",
        cy: "12",
        r: "2",
        fill: "currentColor",
        children: Q.jsx("animate", {
          id: "spinner_qFRN",
          begin: "0;spinner_OcgL.end+0.25s",
          attributeName: "cy",
          calcMode: "spline",
          dur: "0.6s",
          values: "12;6;12",
          keySplines: ".33,.66,.66,1;.33,0,.66,.33",
        }),
      }),
      Q.jsx("circle", {
        cx: "12",
        cy: "12",
        r: "2",
        fill: "currentColor",
        children: Q.jsx("animate", {
          begin: "spinner_qFRN.begin+0.1s",
          attributeName: "cy",
          calcMode: "spline",
          dur: "0.6s",
          values: "12;6;12",
          keySplines: ".33,.66,.66,1;.33,0,.66,.33",
        }),
      }),
      Q.jsx("circle", {
        cx: "20",
        cy: "12",
        r: "2",
        fill: "currentColor",
        children: Q.jsx("animate", {
          id: "spinner_OcgL",
          begin: "spinner_qFRN.begin+0.2s",
          attributeName: "cy",
          calcMode: "spline",
          dur: "0.6s",
          values: "12;6;12",
          keySplines: ".33,.66,.66,1;.33,0,.66,.33",
        }),
      }),
    ],
  });
}
const f8t = jp("flex gap-2 max-w-[60%] items-end relative group", {
    variants: {
      variant: { received: "self-start", sent: "self-end flex-row-reverse" },
      layout: { default: "", ai: "max-w-full w-full items-center" },
    },
    defaultVariants: { variant: "received", layout: "default" },
  }),
  m8t = H.forwardRef(({ className: e, variant: t, layout: n, children: i, ...r }, o) =>
    Q.jsx("div", {
      className: Rf(f8t({ variant: t, layout: n, className: e }), "relative group"),
      ref: o,
      ...r,
      children: H.Children.map(i, (e) =>
        H.isValidElement(e) && "string" != typeof e.type
          ? H.cloneElement(e, { variant: t, layout: n })
          : e,
      ),
    }),
  );
m8t.displayName = "ChatBubble";
const _8t = jp("p-4", {
    variants: {
      variant: {
        received: "bg-secondary text-secondary-foreground rounded-r-lg rounded-tl-lg",
        sent: "bg-primary text-primary-foreground rounded-l-lg rounded-tr-lg",
      },
      layout: { default: "", ai: "border-t w-full rounded-none bg-transparent" },
    },
    defaultVariants: { variant: "received", layout: "default" },
  }),
  v8t = H.forwardRef(
    ({ className: e, variant: t, layout: n, isLoading: i = !1, children: r, ...o }, s) =>
      Q.jsx("div", {
        className: Rf(
          _8t({ variant: t, layout: n, className: e }),
          "break-words max-w-full whitespace-pre-wrap",
        ),
        ref: s,
        ...o,
        children: i
          ? Q.jsx("div", { className: "flex items-center space-x-2", children: Q.jsx(p8t, {}) })
          : r,
      }),
  );
v8t.displayName = "ChatBubbleMessage";
const b8t = H.forwardRef(({ variant: e, className: t, children: n, ...i }, r) =>
  Q.jsx("div", {
    ref: r,
    className: Rf(
      "absolute top-1/2 -translate-y-1/2 flex opacity-0 group-hover:opacity-100 transition-opacity duration-200",
      "sent" === e ? "-left-1 -translate-x-full flex-row-reverse" : "-right-1 translate-x-full",
      t,
    ),
    ...i,
    children: n,
  }),
);
b8t.displayName = "ChatBubbleActionWrapper";
const y8t = H.forwardRef(({ className: e, ...t }, n) =>
  Q.jsx(_Gt, {
    autoComplete: "off",
    ref: n,
    name: "message",
    className: Rf(
      "max-h-12 px-4 py-3 bg-background text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 w-full rounded-md flex items-center h-16 resize-none",
      e,
    ),
    ...t,
  }),
);
y8t.displayName = "ChatInput";
const x8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "m13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42Z",
      }),
    }),
  w8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M15.098 12.634L13 11.423V7a1 1 0 0 0-2 0v5a1 1 0 0 0 .5.866l2.598 1.5a1 1 0 1 0 1-1.732M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8.01 8.01 0 0 1-8 8",
      }),
    }),
  C8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "m11.29 12l3.54-3.54a1 1 0 0 0 0-1.41a1 1 0 0 0-1.42 0l-4.24 4.24a1 1 0 0 0 0 1.42L13.41 17a1 1 0 0 0 .71.29a1 1 0 0 0 .71-.29a1 1 0 0 0 0-1.41Z",
      }),
    }),
  S8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7",
      }),
    }),
  k8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M3.71 16.29a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21a1 1 0 0 0-.21.33a1 1 0 0 0 .21 1.09a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1 1 0 0 0 .21-1.09a1 1 0 0 0-.21-.33M7 8h14a1 1 0 0 0 0-2H7a1 1 0 0 0 0 2m-3.29 3.29a1 1 0 0 0-1.09-.21a1.2 1.2 0 0 0-.33.21a1 1 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1 1 0 0 0-.21-.33M21 11H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2M3.71 6.29a1 1 0 0 0-.33-.21a1 1 0 0 0-1.09.21a1.2 1.2 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a1 1 0 0 0 1.09-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1.2 1.2 0 0 0-.21-.33M21 16H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2",
      }),
    }),
  E8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M9 12H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m-1-2h4a1 1 0 0 0 0-2H8a1 1 0 0 0 0 2m1 6H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m12-4h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Zm-6.44-2.83a.8.8 0 0 0-.18-.09a.6.6 0 0 0-.19-.06a1 1 0 0 0-.9.27A1.05 1.05 0 0 0 12 17a1 1 0 0 0 .07.38a1.2 1.2 0 0 0 .22.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21A1 1 0 0 0 14 17a1.05 1.05 0 0 0-.29-.71a2 2 0 0 0-.15-.12m.14-3.88a1 1 0 0 0-1.62.33A1 1 0 0 0 13 14a1 1 0 0 0 1-1a1 1 0 0 0-.08-.38a.9.9 0 0 0-.22-.33",
      }),
    });
function N8t() {
  return Q.jsxs("div", {
    className: "flex h-full flex-col space-y-4 p-6",
    children: [
      Q.jsxs("div", {
        className: "space-y-2",
        children: [Q.jsx(n$t, { className: "h-8 w-3/4" }), Q.jsx(n$t, { className: "h-4 w-1/2" })],
      }),
      Q.jsx("div", {
        className: "flex-1 space-y-4",
        children: [1, 2, 3].map((e) => Q.jsx(n$t, { className: "h-20 w-2/3" }, e)),
      }),
    ],
  });
}
function L8t() {
  return Q.jsx("div", {
    className: "space-y-4 p-4",
    children: [1, 2, 3, 4].map((e) =>
      Q.jsxs(
        "div",
        {
          className: "space-y-2",
          children: [
            Q.jsx(n$t, { className: "h-5 w-4/5" }),
            Q.jsx(n$t, { className: "h-4 w-2/3" }),
            Q.jsx(n$t, { className: "h-3 w-1/2" }),
          ],
        },
        e,
      ),
    ),
  });
}
function D8t({ ticket: e, isActive: t, onClick: n }) {
  const { t: i } = Py("ticket");
  return Q.jsxs("div", {
    className: Rf("flex cursor-pointer flex-col border-b p-4 hover:bg-accent/50", t && "bg-accent"),
    onClick: n,
    children: [
      Q.jsxs("div", {
        className: "flex max-w-[280px] items-center justify-between gap-2",
        children: [
          Q.jsx("h4", { className: "flex-1 truncate font-medium", children: e.subject }),
          Q.jsx(hqt, {
            variant: e.status === _$t.CLOSED ? "secondary" : "default",
            className: "shrink-0",
            children: e.status === _$t.CLOSED ? i("status.closed") : i("status.processing"),
          }),
        ],
      }),
      Q.jsx("div", {
        className: "mt-1 max-w-[280px] truncate text-sm text-muted-foreground",
        children: e.user?.email,
      }),
      Q.jsxs("div", {
        className: "mt-2 flex items-center justify-between text-xs",
        children: [
          Q.jsx("time", { className: "text-muted-foreground", children: CS(e.updated_at) }),
          Q.jsx("div", {
            className: Rf(
              "rounded-full border px-2 py-0.5 text-xs font-medium",
              ((e) => {
                switch (e) {
                  case v$t.HIGH:
                    return "bg-red-50 text-red-600 border-red-200";
                  case v$t.MIDDLE:
                    return "bg-yellow-50 text-yellow-600 border-yellow-200";
                  case v$t.LOW:
                    return "bg-green-50 text-green-600 border-green-200";
                  default:
                    return "bg-gray-50 text-gray-600 border-gray-200";
                }
              })(e.level),
            ),
            children: i(
              "level." + (e.level === v$t.LOW ? "low" : e.level === v$t.MIDDLE ? "medium" : "high"),
            ),
          }),
        ],
      }),
    ],
  });
}
function T8t({ ticketId: e, dialogTrigger: t, statusFilter: n = _$t.OPENING }) {
  const { t: i } = Py("ticket"),
    r = og(),
    o = H.useRef(null),
    s = H.useRef(null),
    [a, l] = H.useState(!1),
    [c, d] = H.useState(""),
    [u, h] = H.useState(!1),
    [g, p] = H.useState(e),
    [f, m] = H.useState(""),
    [_, v] = H.useState(!1),
    { setIsOpen: b, setEditingUser: y } = s8t(),
    x = t8e();
  H.useEffect(() => {
    a || (p(e), m(""));
  }, [a, e]);
  const {
      data: w,
      isLoading: C,
      refetch: S,
    } = gC({
      queryKey: ["ticketSidebarList", a, n],
      queryFn: () => (a ? mT({ filter: [{ id: "status", value: [n] }] }) : Promise.resolve(null)),
      enabled: a,
    }),
    {
      data: k,
      refetch: E,
      isLoading: N,
    } = gC({
      queryKey: ["ticketDetail", g, a],
      queryFn: () => (a ? _T(g) : Promise.resolve(null)),
      refetchInterval: !!a && 5e3,
      retry: 3,
    }),
    L = k?.data,
    D = (w?.data || []).filter(
      (e) =>
        e.subject.toLowerCase().includes(f.toLowerCase()) ||
        e.user?.email.toLowerCase().includes(f.toLowerCase()),
    ),
    T = (e = "smooth") => {
      if (o.current) {
        const { scrollHeight: t, clientHeight: n } = o.current;
        o.current.scrollTo({ top: t - n, behavior: e });
      }
    };
  H.useEffect(() => {
    if (!a) return;
    const e = requestAnimationFrame(() => {
      (T("instant"), setTimeout(() => T(), 1e3));
    });
    return () => {
      cancelAnimationFrame(e);
    };
  }, [a, L?.messages]);
  const I = async () => {
      const e = c.trim();
      e &&
        !u &&
        (h(!0),
        vT({ id: g, message: e })
          .then(() => {
            (d(""),
              E(),
              T(),
              setTimeout(() => {
                s.current?.focus();
              }, 0));
          })
          .finally(() => {
            h(!1);
          }));
    },
    R = L?.status === _$t.CLOSED;
  return Q.jsxs(Jet, {
    open: a,
    onOpenChange: l,
    children: [
      Q.jsx(ett, {
        asChild: !0,
        children: t ?? Q.jsx(ltt, { variant: "outline", children: i("actions.view_ticket") }),
      }),
      Q.jsxs(ttt, {
        className: "flex h-[90vh] max-w-6xl flex-col gap-0 overflow-hidden p-0",
        children: [
          Q.jsx(rtt, {}),
          Q.jsxs("div", {
            className: "flex h-full",
            children: [
              Q.jsx(ltt, {
                variant: "ghost",
                size: "icon",
                className: "absolute left-2 top-2 z-50 md:hidden",
                onClick: () => v(!_),
                children: Q.jsx(C8t, {
                  className: Rf("h-4 w-4 transition-transform", !_ && "rotate-180"),
                }),
              }),
              Q.jsx("div", {
                className: Rf(
                  "flex-shrink-0 overflow-hidden bg-background",
                  "absolute inset-y-0 left-0 z-40 w-80 border-r",
                  "transition-transform duration-200 ease-in-out",
                  "md:relative md:inset-auto md:border-0 md:transition-none",
                  _ ? "-translate-x-full" : "translate-x-0",
                ),
                style: {
                  width: _ ? (x ? 320 : 0) : 320,
                  transition: x ? void 0 : "width 0.25s ease",
                  borderRight: x
                    ? void 0
                    : "1px solid " + (_ ? "transparent" : "hsl(var(--border))"),
                },
                children: Q.jsxs("div", {
                  className: "flex h-full w-80 flex-shrink-0 flex-col",
                  children: [
                    Q.jsxs("div", {
                      className: "space-y-3 border-b px-4 py-3",
                      children: [
                        Q.jsx("p", {
                          className:
                            "text-xs font-semibold uppercase tracking-wider text-muted-foreground",
                          children: i("list.title"),
                        }),
                        Q.jsxs("div", {
                          className: "relative",
                          children: [
                            Q.jsx(S8t, {
                              className:
                                "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground",
                            }),
                            Q.jsx(Q6e, {
                              placeholder: i("list.search_placeholder"),
                              value: f,
                              onChange: (e) => m(e.target.value),
                              className: "h-8 pl-7 text-sm",
                            }),
                          ],
                        }),
                      ],
                    }),
                    Q.jsx(rqt, {
                      className: "flex-1",
                      children: Q.jsx("div", {
                        className: "w-full",
                        children: C
                          ? Q.jsx(L8t, {})
                          : 0 === D.length
                            ? Q.jsx("div", {
                                className:
                                  "flex h-full items-center justify-center p-4 text-sm text-muted-foreground",
                                children: f
                                  ? i("list.no_search_results")
                                  : n === _$t.CLOSED
                                    ? i("list.no_closed_tickets")
                                    : i("list.no_open_tickets"),
                              })
                            : D.map((e) =>
                                Q.jsx(
                                  D8t,
                                  {
                                    ticket: e,
                                    isActive: e.id === g,
                                    onClick: () => {
                                      (p(e.id), x && v(!0));
                                    },
                                  },
                                  e.id,
                                ),
                              ),
                      }),
                    }),
                  ],
                }),
              }),
              Q.jsxs("div", {
                className: "relative flex flex-1 flex-col overflow-hidden",
                children: [
                  !_ &&
                    Q.jsx("div", {
                      className: "absolute inset-0 z-30 bg-black/20 md:hidden",
                      onClick: () => v(!0),
                    }),
                  N
                    ? Q.jsx(N8t, {})
                    : Q.jsxs(Q.Fragment, {
                        children: [
                          Q.jsx("div", {
                            className: "flex flex-col gap-2 border-b px-5 py-4 pr-14",
                            children: Q.jsxs("div", {
                              className: "flex items-start justify-between gap-4",
                              children: [
                                Q.jsxs("div", {
                                  className: "flex min-w-0 items-start gap-2",
                                  children: [
                                    Q.jsx(ltt, {
                                      variant: "outline",
                                      size: "icon",
                                      className: "mt-0.5 hidden h-8 w-8 flex-shrink-0 md:flex",
                                      onClick: () => v(!_),
                                      title: i(_ ? "list.expand" : "list.collapse"),
                                      children: Q.jsx(C8t, {
                                        className: Rf(
                                          "h-4 w-4 transition-transform duration-200",
                                          _ && "rotate-180",
                                        ),
                                      }),
                                    }),
                                    Q.jsxs("div", {
                                      className: "min-w-0 space-y-1.5",
                                      children: [
                                        Q.jsxs("div", {
                                          className: "flex flex-wrap items-center gap-2",
                                          children: [
                                            Q.jsx("h2", {
                                              className:
                                                "truncate text-xl font-semibold leading-tight",
                                              children: L?.subject,
                                            }),
                                            Q.jsx(hqt, {
                                              variant: R ? "secondary" : "default",
                                              children: i(
                                                R ? "status.closed" : "status.processing",
                                              ),
                                            }),
                                            !R &&
                                              Q.jsxs(ltt, {
                                                variant: "ghost",
                                                size: "sm",
                                                className:
                                                  "h-6 gap-1 px-2 text-xs text-muted-foreground hover:text-destructive",
                                                onClick: async () => {
                                                  bT(g).then(() => {
                                                    (hN.success(i("actions.close_success")),
                                                      E(),
                                                      S());
                                                  });
                                                },
                                                children: [
                                                  Q.jsx(x8t, { className: "h-3.5 w-3.5" }),
                                                  i("actions.close_ticket"),
                                                ],
                                              }),
                                          ],
                                        }),
                                        Q.jsxs("div", {
                                          className:
                                            "flex flex-wrap items-center gap-2 text-xs text-muted-foreground",
                                          children: [
                                            Q.jsxs("div", {
                                              className: "flex items-center gap-1",
                                              children: [
                                                Q.jsx(j5t, { className: "h-3.5 w-3.5" }),
                                                Q.jsx("span", { children: L?.user?.email }),
                                              ],
                                            }),
                                            Q.jsx(Um, {
                                              orientation: "vertical",
                                              className: "h-3",
                                            }),
                                            Q.jsxs("div", {
                                              className: "flex items-center gap-1",
                                              children: [
                                                Q.jsx(w8t, { className: "h-3.5 w-3.5" }),
                                                Q.jsxs("span", {
                                                  children: [
                                                    i("detail.created_at"),
                                                    " ",
                                                    CS(L?.created_at),
                                                  ],
                                                }),
                                              ],
                                            }),
                                            Q.jsx(Um, {
                                              orientation: "vertical",
                                              className: "h-3",
                                            }),
                                            Q.jsx(hqt, {
                                              variant: "outline",
                                              className: "text-xs",
                                              children:
                                                null != L?.level &&
                                                i(
                                                  "level." +
                                                    (L.level === v$t.LOW
                                                      ? "low"
                                                      : L.level === v$t.MIDDLE
                                                        ? "medium"
                                                        : "high"),
                                                ),
                                            }),
                                          ],
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                                L?.user &&
                                  Q.jsxs("div", {
                                    className: "flex flex-shrink-0 items-center gap-1.5",
                                    children: [
                                      Q.jsx(ltt, {
                                        variant: "ghost",
                                        size: "icon",
                                        className: "h-8 w-8",
                                        title: i("detail.user_info"),
                                        onClick: () => {
                                          (y(L.user), b(!0));
                                        },
                                        children: Q.jsx(j5t, { className: "h-4 w-4" }),
                                      }),
                                      Q.jsx(H6t, {
                                        user_id: L.user.id,
                                        dialogTrigger: Q.jsx(ltt, {
                                          variant: "ghost",
                                          size: "icon",
                                          className: "h-8 w-8",
                                          title: i("detail.traffic_records"),
                                          children: Q.jsx(k8t, { className: "h-4 w-4" }),
                                        }),
                                      }),
                                      Q.jsx(ltt, {
                                        variant: "ghost",
                                        size: "icon",
                                        className: "h-8 w-8",
                                        title: i("detail.order_records"),
                                        onClick: () => {
                                          L?.user && r("/finance/order?user_id=" + L.user.id);
                                        },
                                        children: Q.jsx(E8t, { className: "h-4 w-4" }),
                                      }),
                                    ],
                                  }),
                              ],
                            }),
                          }),
                          Q.jsx("div", {
                            className: "flex-1 overflow-hidden",
                            children: Q.jsx("div", {
                              ref: o,
                              className: "h-full space-y-4 overflow-y-auto p-6",
                              children:
                                0 === L?.messages?.length
                                  ? Q.jsx("div", {
                                      className:
                                        "flex h-full items-center justify-center text-muted-foreground",
                                      children: i("detail.no_messages"),
                                    })
                                  : L?.messages?.map((e) =>
                                      Q.jsx(
                                        m8t,
                                        {
                                          variant: e.is_from_admin ? "sent" : "received",
                                          className: e.is_from_admin ? "ml-auto" : "mr-auto",
                                          children: Q.jsx(v8t, {
                                            children: Q.jsxs("div", {
                                              className: "space-y-1",
                                              children: [
                                                Q.jsx("div", {
                                                  className: "whitespace-pre-wrap break-words",
                                                  children: e.message,
                                                }),
                                                Q.jsx("div", {
                                                  className: "text-right",
                                                  children: Q.jsx("time", {
                                                    className: "text-[10px] text-muted-foreground",
                                                    children: CS(e.created_at),
                                                  }),
                                                }),
                                              ],
                                            }),
                                          }),
                                        },
                                        e.id,
                                      ),
                                    ),
                            }),
                          }),
                          Q.jsx("div", {
                            className: "border-t p-4",
                            children: Q.jsxs("div", {
                              className: "flex items-center gap-2",
                              children: [
                                Q.jsx(y8t, {
                                  ref: s,
                                  disabled: R || u,
                                  placeholder: i(
                                    R
                                      ? "detail.input.closed_placeholder"
                                      : "detail.input.reply_placeholder",
                                  ),
                                  className:
                                    "flex-1 resize-none rounded-lg border bg-background p-3 focus-visible:ring-1",
                                  value: c,
                                  onChange: (e) => d(e.target.value),
                                  onKeyDown: (e) => {
                                    "Enter" !== e.key || e.shiftKey || (e.preventDefault(), I());
                                  },
                                }),
                                Q.jsx(ltt, {
                                  disabled: R || u || !c.trim(),
                                  onClick: I,
                                  children: i(u ? "detail.input.sending" : "detail.input.send"),
                                }),
                              ],
                            }),
                          }),
                        ],
                      }),
                ],
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
const I8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3m-.41 2l-5.88 5.88a1 1 0 0 1-1.42 0L5.41 6ZM20 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7.41l5.88 5.88a3 3 0 0 0 4.24 0L20 7.41Z",
      }),
    }),
  R8t = (e) =>
    Q.jsx("svg", {
      className: "inline-block",
      viewBox: "0 0 24 24",
      width: "1.2em",
      height: "1.2em",
      ...e,
      children: Q.jsx("path", {
        fill: "currentColor",
        d: "M21.92 11.6C19.9 6.91 16.1 4 12 4s-7.9 2.91-9.92 7.6a1 1 0 0 0 0 .8C4.1 17.09 7.9 20 12 20s7.9-2.91 9.92-7.6a1 1 0 0 0 0-.8M12 18c-3.17 0-6.17-2.29-7.9-6C5.83 8.29 8.83 6 12 6s6.17 2.29 7.9 6c-1.73 3.71-4.73 6-7.9 6m0-10a4 4 0 1 0 4 4a4 4 0 0 0-4-4m0 6a2 2 0 1 1 2-2a2 2 0 0 1-2 2",
      }),
    }),
  O8t = (e, t) => [
    {
      accessorKey: "id",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.id") }),
      cell: ({ row: e }) => Q.jsx(hqt, { variant: "outline", children: e.getValue("id") }),
      enableSorting: !1,
      enableHiding: !1,
    },
    {
      accessorKey: "subject",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.subject") }),
      cell: ({ row: e }) =>
        Q.jsxs("div", {
          className: "flex items-center space-x-2",
          children: [
            Q.jsx(I8t, { className: "h-4 w-4 text-muted-foreground" }),
            Q.jsx("span", {
              className: "max-w-[500px] truncate font-medium",
              children: e.getValue("subject"),
            }),
          ],
        }),
      enableSorting: !1,
      enableHiding: !1,
      size: 4e3,
    },
    {
      accessorKey: "level",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.level") }),
      cell: ({ row: e }) => {
        const n = e.getValue("level"),
          i = n === v$t.LOW ? "default" : n === v$t.MIDDLE ? "secondary" : "destructive";
        return Q.jsx("div", {
          className: "flex items-center space-x-2",
          children: Q.jsx(hqt, {
            variant: i,
            className: "whitespace-nowrap",
            children: t("level." + (n === v$t.LOW ? "low" : n === v$t.MIDDLE ? "medium" : "high")),
          }),
        });
      },
      filterFn: (e, t, n) => n.includes(e.getValue(t)),
    },
    {
      accessorKey: "status",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.status") }),
      cell: ({ row: e }) => {
        const n = e.getValue("status"),
          i = e.original.reply_status,
          r =
            n === _$t.CLOSED
              ? t("status.closed")
              : t(0 === i ? "status.replied" : "status.pending"),
          o = n === _$t.CLOSED ? "default" : 0 === i ? "secondary" : "destructive";
        return Q.jsx("div", {
          className: "flex items-center space-x-2",
          children: Q.jsx(hqt, { variant: o, className: "whitespace-nowrap", children: r }),
        });
      },
    },
    {
      accessorKey: "updated_at",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.updated_at") }),
      cell: ({ row: e }) =>
        Q.jsxs("div", {
          className: "flex items-center space-x-2 text-muted-foreground",
          children: [
            Q.jsx(w8t, { className: "h-4 w-4" }),
            Q.jsx("span", { className: "text-sm", children: CS(e.getValue("updated_at")) }),
          ],
        }),
      enableSorting: !0,
    },
    {
      accessorKey: "created_at",
      header: ({ column: e }) => Q.jsx(SYt, { column: e, title: t("columns.created_at") }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "text-sm text-muted-foreground",
          children: CS(e.getValue("created_at")),
        }),
      enableSorting: !0,
      meta: { isFlexGrow: !0 },
    },
    {
      id: "actions",
      header: ({ column: e }) =>
        Q.jsx(SYt, { className: "justify-end", column: e, title: t("columns.actions") }),
      cell: ({ row: n }) => {
        const i = n.original.status !== _$t.CLOSED;
        return Q.jsxs("div", {
          className: "flex items-center justify-center",
          children: [
            Q.jsx(T8t, {
              ticketId: n.original.id,
              statusFilter: n.original.status,
              dialogTrigger: Q.jsx(ltt, {
                variant: "ghost",
                size: "icon",
                className: "h-8 w-8",
                title: t("actions.view_details"),
                children: Q.jsx(R8t, { className: "h-4 w-4" }),
              }),
            }),
            i &&
              Q.jsx(ltt, {
                variant: "ghost",
                size: "icon",
                className: "h-8 w-8",
                title: t("actions.close_ticket"),
                onClick: () => {
                  bT(n.original.id).then(() => {
                    (hN.success(t("actions.close_success")), e());
                  });
                },
                children: Q.jsx(x8t, { className: "h-4 w-4" }),
              }),
          ],
        });
      },
    },
  ];
function M8t() {
  const { t: e } = Py("ticket"),
    [t, n] = H.useState({}),
    [i, r] = H.useState({}),
    [o, s] = H.useState([{ id: "status", value: "0" }]),
    [a, l] = H.useState([]),
    [c, d] = H.useState({ pageIndex: 0, pageSize: 20 }),
    {
      refetch: u,
      data: h,
      isLoading: g,
    } = gC({
      queryKey: ["ticketList", c, o, a],
      queryFn: () => mT({ pageSize: c.pageSize, current: c.pageIndex + 1, filter: o, sort: a }),
    }),
    p = PKt({
      data: h?.data ?? [],
      columns: O8t(u, e),
      state: { sorting: a, columnVisibility: i, rowSelection: t, columnFilters: o, pagination: c },
      rowCount: h?.total ?? 0,
      manualPagination: !0,
      manualFiltering: !0,
      manualSorting: !0,
      enableRowSelection: !0,
      onRowSelectionChange: n,
      onSortingChange: l,
      onColumnFiltersChange: s,
      onColumnVisibilityChange: r,
      getCoreRowModel: LKt(),
      getFilteredRowModel: RKt(),
      getPaginationRowModel: OKt(),
      onPaginationChange: d,
      getSortedRowModel: MKt(),
      getFacetedRowModel: TKt(),
      getFacetedUniqueValues: IKt(),
      initialState: { columnPinning: { right: ["actions"] } },
    });
  return Q.jsxs("div", {
    className: "space-y-4",
    children: [
      Q.jsx(g8t, { table: p, refetch: u }),
      Q.jsx(QKt, { table: p, showPagination: !0, isLoading: g }),
    ],
  });
}
const A8t = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py("ticket");
        return Q.jsxs(o8t, {
          refreshData: () => {},
          children: [
            Q.jsxs(Wot, {
              children: [
                Q.jsxs(Hot, {
                  children: [
                    Q.jsx(Vdt, {}),
                    Q.jsxs("div", {
                      className: "ml-auto flex items-center space-x-4",
                      children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                    }),
                  ],
                }),
                Q.jsxs(zot, {
                  className: "flex flex-col",
                  fixedHeight: !0,
                  children: [
                    Q.jsx("div", {
                      className: "mb-2 flex items-center justify-between space-y-2",
                      children: Q.jsxs("div", {
                        children: [
                          Q.jsx("h2", {
                            className: "text-2xl font-bold tracking-tight",
                            children: e("title"),
                          }),
                          Q.jsx("p", {
                            className: "mt-2 text-muted-foreground",
                            children: e("description"),
                          }),
                        ],
                      }),
                    }),
                    Q.jsx("div", {
                      className:
                        "-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",
                      children: Q.jsx(M8t, {}),
                    }),
                  ],
                }),
              ],
            }),
            Q.jsx(l8t, {}),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
function P8t({ table: e }) {
  const { t: t } = Py("user"),
    n = e.getState().columnFilters.length > 0,
    [i, r] = H.useState(),
    [o, s] = H.useState(),
    [a, l] = H.useState(!1),
    c = [
      { value: "monthly", label: t("traffic_reset_logs.filters.reset_types.monthly") },
      {
        value: "first_day_month",
        label: t("traffic_reset_logs.filters.reset_types.first_day_month"),
      },
      { value: "yearly", label: t("traffic_reset_logs.filters.reset_types.yearly") },
      {
        value: "first_day_year",
        label: t("traffic_reset_logs.filters.reset_types.first_day_year"),
      },
      { value: "manual", label: t("traffic_reset_logs.filters.reset_types.manual") },
    ],
    d = [
      { value: "auto", label: t("traffic_reset_logs.filters.trigger_sources.auto") },
      { value: "manual", label: t("traffic_reset_logs.filters.trigger_sources.manual") },
      { value: "cron", label: t("traffic_reset_logs.filters.trigger_sources.cron") },
    ],
    u = () => {
      const t = e.getState().columnFilters.filter((e) => "date_range" !== e.id);
      ((i || o) &&
        t.push({
          id: "date_range",
          value: { start: i ? mS(i, "yyyy-MM-dd") : null, end: o ? mS(o, "yyyy-MM-dd") : null },
        }),
        e.setColumnFilters(t));
    },
    h = async () => {
      try {
        l(!0);
        const n = e.getState().columnFilters.reduce((e, t) => {
            if (t.value)
              if ("date_range" === t.id) {
                const n = t.value;
                (n.start && (e.start_date = n.start), n.end && (e.end_date = n.end));
              } else e[t.id] = t.value;
            return e;
          }, {}),
          i = await hT({ ...n, page: 1, per_page: 1e4 }),
          r = (Array.isArray(i.data) ? i.data : Array.isArray(i.data?.data) ? i.data.data : []).map((e) => ({
            ID: e.id,
            用户邮箱: e.user_email,
            用户ID: e.user_id,
            重置类型: e.reset_type_name,
            触发源: e.trigger_source_name,
            清零流量: e.old_traffic.formatted,
            "上传流量(GB)": (e.old_traffic.upload / 1024 ** 3).toFixed(2),
            "下载流量(GB)": (e.old_traffic.download / 1024 ** 3).toFixed(2),
            重置时间: mS(new Date(e.reset_time), "yyyy-MM-dd HH:mm:ss"),
            记录时间: mS(new Date(e.created_at), "yyyy-MM-dd HH:mm:ss"),
          })),
          o = Object.keys(r[0] || {}),
          s = [
            o.join(","),
            ...r.map((e) =>
              o
                .map((t) => {
                  const n = e[t];
                  return "string" == typeof n && n.includes(",") ? `"${n}"` : n;
                })
                .join(","),
            ),
          ].join("\n"),
          a = new Blob([s], { type: "text/csv;charset=utf-8;" }),
          c = document.createElement("a"),
          d = URL.createObjectURL(a);
        (c.setAttribute("href", d),
          c.setAttribute("download", `traffic-reset-logs-${mS(new Date(), "yyyy-MM-dd")}.csv`),
          (c.style.visibility = "hidden"),
          document.body.appendChild(c),
          c.click(),
          c.parentNode && c.parentNode.removeChild(c),
          hN.success(t("traffic_reset_logs.actions.export_success")));
      } catch (D2t) {
        hN.error(t("traffic_reset_logs.actions.export_failed"));
      } finally {
        l(!1);
      }
    },
    g = () =>
      Q.jsxs("div", {
        className: "space-y-4",
        children: [
          Q.jsxs("div", {
            className: "space-y-2",
            children: [
              Q.jsx("label", {
                className: "text-sm font-medium",
                children: t("traffic_reset_logs.filters.search_user"),
              }),
              Q.jsx(Q6e, {
                placeholder: t("traffic_reset_logs.filters.search_user"),
                value: e.getColumn("user_email")?.getFilterValue() ?? "",
                onChange: (t) => e.getColumn("user_email")?.setFilterValue(t.target.value),
                className: "h-9",
              }),
            ],
          }),
          Q.jsxs("div", {
            className: "space-y-2",
            children: [
              Q.jsx("label", {
                className: "text-sm font-medium",
                children: t("traffic_reset_logs.filters.reset_type"),
              }),
              Q.jsxs(THt, {
                value: e.getColumn("reset_type")?.getFilterValue() ?? "",
                onValueChange: (t) =>
                  e.getColumn("reset_type")?.setFilterValue("all" === t ? "" : t),
                children: [
                  Q.jsx(OHt, {
                    className: "h-9",
                    children: Q.jsx(RHt, {
                      placeholder: t("traffic_reset_logs.filters.reset_type"),
                    }),
                  }),
                  Q.jsxs(PHt, {
                    children: [
                      Q.jsx(FHt, {
                        value: "all",
                        children: t("traffic_reset_logs.filters.all_types"),
                      }),
                      c.map((e) => Q.jsx(FHt, { value: e.value, children: e.label }, e.value)),
                    ],
                  }),
                ],
              }),
            ],
          }),
          Q.jsxs("div", {
            className: "space-y-2",
            children: [
              Q.jsx("label", {
                className: "text-sm font-medium",
                children: t("traffic_reset_logs.filters.trigger_source"),
              }),
              Q.jsxs(THt, {
                value: e.getColumn("trigger_source")?.getFilterValue() ?? "",
                onValueChange: (t) =>
                  e.getColumn("trigger_source")?.setFilterValue("all" === t ? "" : t),
                children: [
                  Q.jsx(OHt, {
                    className: "h-9",
                    children: Q.jsx(RHt, {
                      placeholder: t("traffic_reset_logs.filters.trigger_source"),
                    }),
                  }),
                  Q.jsxs(PHt, {
                    children: [
                      Q.jsx(FHt, {
                        value: "all",
                        children: t("traffic_reset_logs.filters.all_sources"),
                      }),
                      d.map((e) => Q.jsx(FHt, { value: e.value, children: e.label }, e.value)),
                    ],
                  }),
                ],
              }),
            ],
          }),
          Q.jsxs("div", {
            className: "grid grid-cols-2 gap-2",
            children: [
              Q.jsxs("div", {
                className: "space-y-2",
                children: [
                  Q.jsx("label", {
                    className: "text-sm font-medium",
                    children: t("traffic_reset_logs.filters.start_date"),
                  }),
                  Q.jsxs(qUt, {
                    children: [
                      Q.jsx(KUt, {
                        asChild: !0,
                        children: Q.jsxs(Nm, {
                          variant: "outline",
                          className: Rf(
                            "h-9 w-full justify-start text-left font-normal",
                            !i && "text-muted-foreground",
                          ),
                          children: [
                            Q.jsx(sat, { className: "mr-2 h-4 w-4" }),
                            i ? mS(i, "MM-dd") : t("traffic_reset_logs.filters.start_date"),
                          ],
                        }),
                      }),
                      Q.jsx(ZUt, {
                        className: "w-auto p-0",
                        align: "start",
                        children: Q.jsx(mUt, {
                          mode: "single",
                          selected: i,
                          onSelect: r,
                          initialFocus: !0,
                        }),
                      }),
                    ],
                  }),
                ],
              }),
              Q.jsxs("div", {
                className: "space-y-2",
                children: [
                  Q.jsx("label", {
                    className: "text-sm font-medium",
                    children: t("traffic_reset_logs.filters.end_date"),
                  }),
                  Q.jsxs(qUt, {
                    children: [
                      Q.jsx(KUt, {
                        asChild: !0,
                        children: Q.jsxs(Nm, {
                          variant: "outline",
                          className: Rf(
                            "h-9 w-full justify-start text-left font-normal",
                            !o && "text-muted-foreground",
                          ),
                          children: [
                            Q.jsx(sat, { className: "mr-2 h-4 w-4" }),
                            o ? mS(o, "MM-dd") : t("traffic_reset_logs.filters.end_date"),
                          ],
                        }),
                      }),
                      Q.jsx(ZUt, {
                        className: "w-auto p-0",
                        align: "start",
                        children: Q.jsx(mUt, {
                          mode: "single",
                          selected: o,
                          onSelect: s,
                          initialFocus: !0,
                        }),
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          (i || o) &&
            Q.jsxs(Nm, {
              variant: "outline",
              className: "w-full",
              onClick: u,
              children: [
                Q.jsx(Lat, { className: "mr-2 h-4 w-4" }),
                t("traffic_reset_logs.filters.apply_date"),
              ],
            }),
          n &&
            Q.jsxs(Nm, {
              variant: "ghost",
              onClick: () => {
                (e.resetColumnFilters(), r(void 0), s(void 0));
              },
              className: "w-full",
              children: [
                t("traffic_reset_logs.filters.reset"),
                Q.jsx(E7e, { className: "ml-2 h-4 w-4" }),
              ],
            }),
        ],
      });
  return Q.jsxs("div", {
    className: "space-y-4",
    children: [
      Q.jsxs("div", {
        className: "flex items-center justify-between md:hidden",
        children: [
          Q.jsx("div", {
            className: "flex items-center space-x-2",
            children: Q.jsxs(E6t, {
              children: [
                Q.jsx(N6t, {
                  asChild: !0,
                  children: Q.jsxs(Nm, {
                    variant: "outline",
                    size: "sm",
                    className: "h-8",
                    children: [
                      Q.jsx(elt, { className: "mr-2 h-4 w-4" }),
                      t("traffic_reset_logs.filters.reset_type"),
                      n &&
                        Q.jsx("div", {
                          className:
                            "ml-1 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground",
                          children: e.getState().columnFilters.length,
                        }),
                    ],
                  }),
                }),
                Q.jsxs(I6t, {
                  side: "bottom",
                  className: "h-[85vh]",
                  children: [
                    Q.jsxs(R6t, {
                      className: "mb-4",
                      children: [
                        Q.jsx(M6t, { children: t("traffic_reset_logs.filters.filter_title") }),
                        Q.jsx(A6t, {
                          children: t("traffic_reset_logs.filters.filter_description"),
                        }),
                      ],
                    }),
                    Q.jsx("div", {
                      className: "max-h-[calc(85vh-120px)] overflow-y-auto",
                      children: Q.jsx(g, {}),
                    }),
                  ],
                }),
              ],
            }),
          }),
          Q.jsxs(Nm, {
            variant: "outline",
            size: "sm",
            className: "h-8",
            onClick: h,
            disabled: a,
            children: [
              Q.jsx(wat, { className: "mr-2 h-4 w-4" }),
              t(a ? "traffic_reset_logs.actions.exporting" : "traffic_reset_logs.actions.export"),
            ],
          }),
        ],
      }),
      Q.jsxs("div", {
        className: "hidden items-center justify-between md:flex",
        children: [
          Q.jsxs("div", {
            className: "flex flex-1 items-center space-x-2",
            children: [
              Q.jsx(Q6e, {
                placeholder: t("traffic_reset_logs.filters.search_user"),
                value: e.getColumn("user_email")?.getFilterValue() ?? "",
                onChange: (t) => e.getColumn("user_email")?.setFilterValue(t.target.value),
                className: "h-8 w-full min-w-[150px] sm:w-[150px] lg:w-[250px]",
              }),
              Q.jsxs(THt, {
                value: e.getColumn("reset_type")?.getFilterValue() ?? "",
                onValueChange: (t) =>
                  e.getColumn("reset_type")?.setFilterValue("all" === t ? "" : t),
                children: [
                  Q.jsx(OHt, {
                    className: "h-8 w-[180px]",
                    children: Q.jsx(RHt, {
                      placeholder: t("traffic_reset_logs.filters.reset_type"),
                    }),
                  }),
                  Q.jsxs(PHt, {
                    children: [
                      Q.jsx(FHt, {
                        value: "all",
                        children: t("traffic_reset_logs.filters.all_types"),
                      }),
                      c.map((e) => Q.jsx(FHt, { value: e.value, children: e.label }, e.value)),
                    ],
                  }),
                ],
              }),
              Q.jsxs(THt, {
                value: e.getColumn("trigger_source")?.getFilterValue() ?? "",
                onValueChange: (t) =>
                  e.getColumn("trigger_source")?.setFilterValue("all" === t ? "" : t),
                children: [
                  Q.jsx(OHt, {
                    className: "h-8 w-[180px]",
                    children: Q.jsx(RHt, {
                      placeholder: t("traffic_reset_logs.filters.trigger_source"),
                    }),
                  }),
                  Q.jsxs(PHt, {
                    children: [
                      Q.jsx(FHt, {
                        value: "all",
                        children: t("traffic_reset_logs.filters.all_sources"),
                      }),
                      d.map((e) => Q.jsx(FHt, { value: e.value, children: e.label }, e.value)),
                    ],
                  }),
                ],
              }),
              Q.jsxs("div", {
                className: "flex items-center space-x-2",
                children: [
                  Q.jsxs(qUt, {
                    children: [
                      Q.jsx(KUt, {
                        asChild: !0,
                        children: Q.jsxs(Nm, {
                          variant: "outline",
                          size: "sm",
                          className: Rf(
                            "h-8 w-[140px] justify-start text-left font-normal",
                            !i && "text-muted-foreground",
                          ),
                          children: [
                            Q.jsx(sat, { className: "mr-2 h-4 w-4" }),
                            i ? mS(i, "yyyy-MM-dd") : t("traffic_reset_logs.filters.start_date"),
                          ],
                        }),
                      }),
                      Q.jsx(ZUt, {
                        className: "w-auto p-0",
                        align: "start",
                        children: Q.jsx(mUt, {
                          mode: "single",
                          selected: i,
                          onSelect: r,
                          initialFocus: !0,
                        }),
                      }),
                    ],
                  }),
                  Q.jsxs(qUt, {
                    children: [
                      Q.jsx(KUt, {
                        asChild: !0,
                        children: Q.jsxs(Nm, {
                          variant: "outline",
                          size: "sm",
                          className: Rf(
                            "h-8 w-[140px] justify-start text-left font-normal",
                            !o && "text-muted-foreground",
                          ),
                          children: [
                            Q.jsx(sat, { className: "mr-2 h-4 w-4" }),
                            o ? mS(o, "yyyy-MM-dd") : t("traffic_reset_logs.filters.end_date"),
                          ],
                        }),
                      }),
                      Q.jsx(ZUt, {
                        className: "w-auto p-0",
                        align: "start",
                        children: Q.jsx(mUt, {
                          mode: "single",
                          selected: o,
                          onSelect: s,
                          initialFocus: !0,
                        }),
                      }),
                    ],
                  }),
                  (i || o) &&
                    Q.jsxs(Nm, {
                      variant: "outline",
                      size: "sm",
                      className: "h-8",
                      onClick: u,
                      children: [
                        Q.jsx(Lat, { className: "mr-2 h-4 w-4" }),
                        t("traffic_reset_logs.filters.apply_date"),
                      ],
                    }),
                ],
              }),
              n &&
                Q.jsxs(Nm, {
                  variant: "ghost",
                  onClick: () => {
                    (e.resetColumnFilters(), r(void 0), s(void 0));
                  },
                  className: "h-8 px-2 lg:px-3",
                  children: [
                    t("traffic_reset_logs.filters.reset"),
                    Q.jsx(E7e, { className: "ml-2 h-4 w-4" }),
                  ],
                }),
            ],
          }),
          Q.jsx("div", {
            className: "flex items-center space-x-2",
            children: Q.jsxs(Nm, {
              variant: "outline",
              size: "sm",
              className: "h-8 border-dashed",
              onClick: h,
              disabled: a,
              children: [
                Q.jsx(wat, { className: "mr-2 h-4 w-4" }),
                t(a ? "traffic_reset_logs.actions.exporting" : "traffic_reset_logs.actions.export"),
              ],
            }),
          }),
        ],
      }),
    ],
  });
}
const j8t = (e) => {
  const t = (e) => {
      switch (e) {
        case "manual":
          return "bg-blue-100 text-blue-800 border-blue-200";
        case "monthly":
          return "bg-green-100 text-green-800 border-green-200";
        case "yearly":
          return "bg-purple-100 text-purple-800 border-purple-200";
        case "first_day_month":
          return "bg-orange-100 text-orange-800 border-orange-200";
        case "first_day_year":
          return "bg-indigo-100 text-indigo-800 border-indigo-200";
        default:
          return "bg-gray-100 text-gray-800 border-gray-200";
      }
    },
    n = (e) => {
      switch (e) {
        case "manual":
          return "bg-orange-100 text-orange-800 border-orange-200";
        case "cron":
          return "bg-indigo-100 text-indigo-800 border-indigo-200";
        case "auto":
          return "bg-emerald-100 text-emerald-800 border-emerald-200";
        default:
          return "bg-gray-100 text-gray-800 border-gray-200";
      }
    },
    i = (e) => {
      switch (e) {
        case "manual":
        default:
          return Q.jsx(Yat, { className: "h-3 w-3" });
        case "cron":
          return Q.jsx(bat, { className: "h-3 w-3" });
        case "auto":
          return Q.jsx(flt, { className: "h-3 w-3" });
      }
    };
  return [
    {
      accessorKey: "id",
      header: ({ column: t }) =>
        Q.jsx(SYt, { column: t, title: e("traffic_reset_logs.columns.id"), className: "w-[60px]" }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "w-[60px]",
          children: Q.jsx(hqt, {
            variant: "outline",
            className: "text-xs",
            children: e.original.id,
          }),
        }),
      enableSorting: !0,
      enableHiding: !0,
      size: 60,
    },
    {
      accessorKey: "user_email",
      header: ({ column: t }) =>
        Q.jsx(SYt, {
          column: t,
          title: e("traffic_reset_logs.columns.user"),
          className: "min-w-[200px]",
        }),
      cell: ({ row: e }) =>
        Q.jsxs("div", {
          className: "flex min-w-[200px] items-start gap-2",
          children: [
            Q.jsx(clt, { className: "mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground" }),
            Q.jsxs("div", {
              className: "min-w-0 flex-1",
              children: [
                Q.jsx("div", {
                  className: "truncate text-sm font-medium",
                  children: e.original.user_email,
                }),
                Q.jsxs("div", {
                  className: "text-xs text-muted-foreground",
                  children: ["ID: ", e.original.user_id],
                }),
              ],
            }),
          ],
        }),
      enableSorting: !1,
      enableHiding: !1,
      size: 100,
    },
    {
      accessorKey: "trigger_source",
      header: ({ column: t }) =>
        Q.jsx(SYt, {
          column: t,
          title: e("traffic_reset_logs.columns.trigger_source"),
          className: "w-[120px]",
        }),
      cell: ({ row: t }) =>
        Q.jsx("div", {
          className: "w-[120px]",
          children: Q.jsx(Pst, {
            delayDuration: 100,
            children: Q.jsxs(jst, {
              children: [
                Q.jsx(Fst, {
                  asChild: !0,
                  children: Q.jsx("div", {
                    className: "cursor-pointer",
                    children: Q.jsxs(hqt, {
                      variant: "outline",
                      className: Rf(
                        "flex items-center gap-1.5 border text-xs",
                        n(t.original.trigger_source),
                      ),
                      children: [
                        i(t.original.trigger_source),
                        Q.jsx("span", {
                          className: "truncate",
                          children: t.original.trigger_source_name,
                        }),
                      ],
                    }),
                  }),
                }),
                Q.jsx(Bst, {
                  side: "bottom",
                  className: "max-w-[200px]",
                  children: Q.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      Q.jsx("div", {
                        className: "text-sm font-medium",
                        children: t.original.trigger_source_name,
                      }),
                      Q.jsxs("div", {
                        className: "text-xs text-muted-foreground",
                        children: [
                          "manual" === t.original.trigger_source &&
                            e("traffic_reset_logs.trigger_descriptions.manual"),
                          "cron" === t.original.trigger_source &&
                            e("traffic_reset_logs.trigger_descriptions.cron"),
                          "auto" === t.original.trigger_source &&
                            e("traffic_reset_logs.trigger_descriptions.auto"),
                          !["manual", "cron", "auto"].includes(t.original.trigger_source) &&
                            e("traffic_reset_logs.trigger_descriptions.other"),
                        ],
                      }),
                    ],
                  }),
                }),
              ],
            }),
          }),
        }),
      enableSorting: !0,
      enableHiding: !1,
      filterFn: (e, t, n) => n.includes(e.getValue(t)),
      size: 120,
    },
    {
      accessorKey: "reset_type",
      header: ({ column: t }) =>
        Q.jsx(SYt, {
          column: t,
          title: e("traffic_reset_logs.columns.reset_type"),
          className: "w-[120px]",
        }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "w-[120px]",
          children: Q.jsx(hqt, {
            className: Rf("border text-xs", t(e.original.reset_type)),
            children: Q.jsx("span", {
              className: "truncate",
              children: e.original.reset_type_name,
            }),
          }),
        }),
      enableSorting: !0,
      enableHiding: !1,
      filterFn: (e, t, n) => n.includes(e.getValue(t)),
      size: 120,
    },
    {
      accessorKey: "old_traffic",
      header: ({ column: t }) =>
        Q.jsx(SYt, {
          column: t,
          title: e("traffic_reset_logs.columns.cleared_traffic"),
          className: "w-[120px]",
        }),
      cell: ({ row: t }) => {
        const n = t.original.old_traffic;
        return Q.jsx("div", {
          className: "w-[120px]",
          children: Q.jsx(Pst, {
            delayDuration: 100,
            children: Q.jsxs(jst, {
              children: [
                Q.jsx(Fst, {
                  asChild: !0,
                  children: Q.jsxs("div", {
                    className: "cursor-pointer text-center",
                    children: [
                      Q.jsx("div", {
                        className: "text-sm font-medium text-destructive",
                        children: n.formatted,
                      }),
                      Q.jsx("div", {
                        className: "text-xs text-muted-foreground",
                        children: e("traffic_reset_logs.columns.cleared"),
                      }),
                    ],
                  }),
                }),
                Q.jsxs(Bst, {
                  side: "bottom",
                  className: "space-y-1",
                  children: [
                    Q.jsxs("div", {
                      className: "flex items-center gap-2 text-sm",
                      children: [
                        Q.jsx(alt, { className: "h-3 w-3" }),
                        Q.jsxs("span", {
                          children: [
                            e("traffic_reset_logs.columns.upload"),
                            ":",
                            " ",
                            (n.upload / 1024 ** 3).toFixed(2),
                            " GB",
                          ],
                        }),
                      ],
                    }),
                    Q.jsxs("div", {
                      className: "flex items-center gap-2 text-sm",
                      children: [
                        Q.jsx(wat, { className: "h-3 w-3" }),
                        Q.jsxs("span", {
                          children: [
                            e("traffic_reset_logs.columns.download"),
                            ":",
                            " ",
                            (n.download / 1024 ** 3).toFixed(2),
                            " GB",
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          }),
        });
      },
      enableSorting: !1,
      enableHiding: !1,
      size: 120,
    },
    {
      accessorKey: "reset_time",
      header: ({ column: t }) =>
        Q.jsx(SYt, {
          column: t,
          title: e("traffic_reset_logs.columns.reset_time"),
          className: "w-[140px]",
        }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "w-[140px]",
          children: Q.jsxs("div", {
            className: "flex items-start gap-2",
            children: [
              Q.jsx(Uat, { className: "mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground" }),
              Q.jsxs("div", {
                className: "min-w-0 flex-1",
                children: [
                  Q.jsx("div", {
                    className: "text-sm font-medium",
                    children: CS(e.original.reset_time, "MM-DD"),
                  }),
                  Q.jsx("div", {
                    className: "text-xs text-muted-foreground",
                    children: CS(e.original.reset_time, "HH:mm"),
                  }),
                ],
              }),
            ],
          }),
        }),
      enableSorting: !0,
      enableHiding: !0,
      size: 140,
    },
    {
      accessorKey: "created_at",
      header: ({ column: t }) =>
        Q.jsx(SYt, {
          column: t,
          title: e("traffic_reset_logs.columns.log_time"),
          className: "w-[140px]",
        }),
      cell: ({ row: e }) =>
        Q.jsx("div", {
          className: "w-[140px]",
          children: Q.jsxs("div", {
            className: "flex items-start gap-2",
            children: [
              Q.jsx(vat, { className: "mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground" }),
              Q.jsxs("div", {
                className: "min-w-0 flex-1",
                children: [
                  Q.jsx("div", {
                    className: "text-sm font-medium",
                    children: CS(e.original.created_at, "YYYY-MM-DD"),
                  }),
                  Q.jsx("div", {
                    className: "text-xs text-muted-foreground",
                    children: CS(e.original.created_at, "H:m:s"),
                  }),
                ],
              }),
            ],
          }),
        }),
      enableSorting: !0,
      enableHiding: !1,
      size: 1400,
    },
  ];
};
function F8t() {
  const { t: e } = Py("user"),
    [t, n] = H.useState({}),
    [i, r] = H.useState({ reset_time: !1 }),
    [o, s] = H.useState([]),
    [a, l] = H.useState([{ id: "created_at", desc: !0 }]),
    [c, d] = H.useState({ pageIndex: 0, pageSize: 20 }),
    u = {
      page: c.pageIndex + 1,
      per_page: c.pageSize,
      ...o.reduce((e, t) => {
        if (t.value)
          if ("date_range" === t.id) {
            const n = t.value;
            (n.start && (e.start_date = n.start), n.end && (e.end_date = n.end));
          } else e[t.id] = t.value;
        return e;
      }, {}),
    },
    { data: h, isLoading: g } = gC({
      queryKey: ["trafficResetLogs", c, o, a],
      queryFn: () => hT(u),
    });
  return Q.jsx(B8t, {
    data: h?.data ?? [],
    rowCount: h?.total ?? 0,
    sorting: a,
    setSorting: l,
    columnVisibility: i,
    setColumnVisibility: r,
    rowSelection: t,
    setRowSelection: n,
    columnFilters: o,
    setColumnFilters: s,
    pagination: c,
    setPagination: d,
    t: e,
    isLoading: g,
  });
}
function B8t({
  data: e,
  rowCount: t,
  sorting: n,
  setSorting: i,
  columnVisibility: r,
  setColumnVisibility: o,
  rowSelection: s,
  setRowSelection: a,
  columnFilters: l,
  setColumnFilters: c,
  pagination: d,
  setPagination: u,
  t: h,
  isLoading: g,
}) {
  const p = PKt({
    data: e,
    columns: j8t(h),
    state: { sorting: n, columnVisibility: r, rowSelection: s, columnFilters: l, pagination: d },
    rowCount: t,
    manualPagination: !0,
    manualFiltering: !0,
    manualSorting: !0,
    enableRowSelection: !0,
    onRowSelectionChange: a,
    onSortingChange: i,
    onColumnFiltersChange: c,
    onColumnVisibilityChange: o,
    getCoreRowModel: LKt(),
    getFilteredRowModel: RKt(),
    getPaginationRowModel: OKt(),
    onPaginationChange: u,
    getSortedRowModel: MKt(),
    getFacetedRowModel: TKt(),
    getFacetedUniqueValues: IKt(),
    initialState: { columnVisibility: { reset_time: !1 } },
  });
  return Q.jsxs("div", {
    className: "h-full space-y-4",
    children: [Q.jsx(P8t, { table: p }), Q.jsx(QKt, { table: p, isLoading: g })],
  });
}
const V8t = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      default: function () {
        const { t: e } = Py("user");
        return Q.jsxs(Wot, {
          children: [
            Q.jsxs(Hot, {
              children: [
                Q.jsx("div", { className: "hidden md:block", children: Q.jsx(Vdt, {}) }),
                Q.jsxs("div", {
                  className: "ml-auto flex items-center space-x-4",
                  children: [Q.jsx(Wdt, {}), Q.jsx(vut, {})],
                }),
              ],
            }),
            Q.jsxs(zot, {
              className: "flex flex-col",
              fixedHeight: !0,
              children: [
                Q.jsx("div", {
                  className:
                    "mb-4 space-y-2 md:mb-2 md:flex md:items-center md:justify-between md:space-y-0",
                  children: Q.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      Q.jsx("h2", {
                        className: "text-xl font-bold tracking-tight md:text-2xl",
                        children: e("traffic_reset_logs.title"),
                      }),
                      Q.jsx("p", {
                        className: "text-sm text-muted-foreground md:mt-2",
                        children: e("traffic_reset_logs.description"),
                      }),
                    ],
                  }),
                }),
                Q.jsx("div", {
                  className: "-mx-4 flex-1 overflow-hidden px-4 py-1",
                  children: Q.jsx("div", { className: "h-full w-full", children: Q.jsx(F8t, {}) }),
                }),
              ],
            }),
          ],
        });
      },
    },
    Symbol.toStringTag,
    { value: "Module" },
  ),
);
